ffc102099c61b3705bfee36be979a6f4198eeb08
4 //#define CURR_ODAT (OB[obi])
5 //#define CURR_VDAT (VB[vbi])
6 //#define CURR_CDAT (CB[cbi])
8 //TODO: label and vdat_id
12 cdat_buf
[cbi
].set_list
[set_index
].odat_id
= obi
;
13 cdat_buf
[cbi
].set_list
[set_index
].parent_id
=//from lexer
14 //TODO: add ele_stack is created in element_list
15 //TODO: add set to odat_buf
19 #define CURR_QUAD (odat_buf[obi].ref_list[ref_index])
21 insert_ref(int x
, int y
, int z
, int ref
)
30 //Insert element into odat_buf and cdat_buf
32 insert_ele(char* label
, int vdat_id
)
36 odat_buf
[obi
].label
= label
;
37 odat_buf
[obi
].vdat_id
= vdat_id
;
38 //TODO: check set_obi to see if set_map_data exists
40 odat_buf
[obi
].num_ref
= odat_buf
[set_obi
].num_ref
;
41 odat_buf
[obi
].ref_list
= odat_buf
[set_obi
].ref_list
;
42 odat_buf
[obi
].class_id
= cbi
;
46 cdat_buf
[cbi
].subclass_list
[subclass_index
].set_list
[set_index
].ele_list
[ele_index
].odat_id
= obi
;
47 cdat_buf
[cbi
].subclass_list
[subclass_index
].set_list
[set_index
].ele_list
[ele_index
].parent_id
= cdat_buf
[cbi
].subclass_list
[subclass_index
].set_index
;
51 cdat_buf
[cbi
].set_list
[set_index
].ele_list
[ele_index
].odat_id
= obi
;
52 cdat_buf
[cbi
].set_list
[set_index
].ele_list
[ele_index
].parent_id
= cdat_buf
[cbi
].set_index
;
59 /* fd could be a directory entry */
61 insert_fdat(char* label
, char direction
, int fd
)
63 vdat_buf
[vbi
].model_list
[vdat_buf
[vbi
].len
].label
= label
;
64 vdat_buf
[vbi
].model_list
[vdat_buf
[vbi
].len
].fdat_id
[(int)direction
] = fd
;
74 vp
= fopen("vdat_output", w
+);
76 perror("vdat_output failed to open\n");
78 op
= fopen("odat_output", w
+);
80 perror("odat_output failed to open\n");
82 cp
= fopen("cdat_output", w
+);
84 perror("cdat_output failed to open\n");
89 for(v
= 0; v
<= vbi
; v
++)
91 num_models
= vdat_buf
[v
].num_models
; //data duplication for caching
92 for(m
= 0; m
<= num_models
; m
++)
99 /* Convert ref_list to actual offset */
112 set_class_label(char* label
)
114 cdat_buf
[cbi
].label
= $
1;
120 cdat_buf
[cbi
].subclass_index
++;
126 odat_buf
[cbi
].set_index
++;
132 odat_buf
[obi
].ref_index
++;
133 odat_buf
[obi
].num_ref
++;
136 //TODO: This needs to be changed to account for
137 // when the set is of a subclass.
141 cdat_buf
[cbi
].set_stack
[stack_index
].num_ele
++;
147 vdat_buf
[vbi
].num_models
++;