root/cgm/cgm_apps/ccapi/geom/RefEntity_ccapi.cpp @ 1040

Revision 1040, 11.9 KB (checked in by tautges, 2 years ago)

Version 10.2 of cgm.

Line 
1#include "EntityType.h"
2#include "CubitDefines.h"
3
4#include "RefEntity_ccapi.h"
5#include "RefEntity.hpp"
6#include "DLRefEntityList.hpp"
7
8#include "copy_defines.h"
9
10  /* RefEntity* */ void *RefEntity_get_by_name(void *,
11                                                        /* const CubitString& */ const char *name) 
12{
13  return RefEntity::get_by_name(CubitString(name));
14}
15
16    /* CubitString */ const char *RefEntity_entity_name_1(void *this_ref_entity) 
17{
18  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
19  return temp_ref_entity->entity_name().c_str();
20}
21
22  enum CubitStatus RefEntity_entity_name_2(void *this_ref_entity, /* CubitString */ const char *name) 
23{
24  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
25  return temp_ref_entity->entity_name(name);
26}
27
28  void RefEntity_entity_names(void *this_ref_entity, /* DLCubitStringList & */ void ***names, int *names_size) 
29{
30  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
31  DLCubitStringList temp_names;
32 
33  temp_ref_entity->entity_names(temp_names);
34
35  COPY_LIST_TO_ARRAY(temp_names, *names, *names_size);
36 
37}
38
39  int RefEntity_num_names(void *this_ref_entity) 
40{
41  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
42  return temp_ref_entity->num_names();
43}
44
45  enum CubitStatus RefEntity_generate_default_name (void *this_ref_entity,  /* CubitString & */ char **name ) 
46{
47  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
48  CubitString temp_name;
49 
50  CubitStatus result = temp_ref_entity->generate_default_name(temp_name);
51
52  *name = new char[temp_name.length()];
53  strcpy(*name, temp_name.c_str());
54 
55  return result;
56}
57
58  enum CubitStatus RefEntity_assign_default_name(void *this_ref_entity,  enum CubitBoolean user_setting) 
59{
60  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
61  return temp_ref_entity->assign_default_name(user_setting);
62}
63
64  enum CubitStatus RefEntity_remove_entity_name(void *this_ref_entity, /* CubitString const & */ const char *name) 
65{
66  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
67  CubitString temp_name(name);
68 
69  return temp_ref_entity->remove_entity_name(temp_name);
70}
71
72  enum CubitStatus RefEntity_remove_entity_names(void *this_ref_entity) 
73{
74  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
75  return temp_ref_entity->remove_entity_names();
76}
77
78  void RefEntity_merge_entity_names(void *this_ref_entity, /* RefEntity * */ void *dead_entity) 
79{
80  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
81  RefEntity *temp_dead_entity = (RefEntity *) dead_entity;
82 
83  temp_ref_entity->merge_entity_names(temp_dead_entity);
84}
85
86  void RefEntity_switch_entity_names(void *this_ref_entity, /* RefEntity * */ void *other_entity) 
87{
88  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
89  RefEntity *temp_other_entity = (RefEntity *) other_entity;
90
91  temp_ref_entity->switch_entity_names(temp_other_entity);
92}
93 
94  void RefEntity_marked_1(void *this_ref_entity, int value) 
95{
96  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
97  temp_ref_entity->marked(value);
98}
99
100  int  RefEntity_marked_2(void *this_ref_entity) 
101{
102  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
103  return temp_ref_entity->marked ();
104}
105
106  void RefEntity_is_mergeable_1(void *this_ref_entity, int val) 
107{
108  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
109  temp_ref_entity->is_mergeable(val);
110}
111
112  int  RefEntity_is_mergeable_2(void *this_ref_entity) 
113{
114  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
115  return temp_ref_entity->is_mergeable();
116}
117
118  int RefEntity_children_mergeable(void *this_ref_entity) 
119{
120  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
121  return temp_ref_entity->children_mergeable();
122}
123 
124  int RefEntity_dimension(void *this_ref_entity) 
125{
126  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
127  return temp_ref_entity->dimension();
128}
129 
130  enum EntityType RefEntity_get_child_ref_entity_type(void *this_ref_entity) 
131{
132  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
133  return temp_ref_entity->get_child_ref_entity_type();
134}
135 
136  enum EntityType RefEntity_get_parent_ref_entity_type(void *this_ref_entity) 
137{
138  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
139  return temp_ref_entity->get_parent_ref_entity_type();
140}
141 
142  void RefEntity_get_child_ref_entities(void *this_ref_entity,
143                                          /* DLRefEntityList & */ void ***entity_list, int *entity_list_size) 
144{
145  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
146  DLRefEntityList temp_entity_list;
147 
148  temp_ref_entity->get_child_ref_entities(temp_entity_list);
149
150  COPY_LIST_TO_ARRAY(temp_entity_list, *entity_list, *entity_list_size);
151 
152}
153 
154  void RefEntity_get_all_child_ref_entities(void *this_ref_entity,
155                                              /* DLRefEntityList & */ void ***entity_list, int *entity_list_size) 
156{
157  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
158  DLRefEntityList temp_entity_list;
159 
160  temp_ref_entity->get_all_child_ref_entities(temp_entity_list);
161
162  COPY_LIST_TO_ARRAY(temp_entity_list, *entity_list, *entity_list_size);
163 
164}
165 
166  void RefEntity_gather_bdy_entities(void *,
167                                              /* DLRefEntityList & */ void ***entity_list, int *entity_list_size, 
168                                              /* DLRefEntityList & */ void ***bdy_list, int *bdy_list_size) 
169{
170  DLRefEntityList temp_bdy_list;
171  DLRefEntityList temp_entity_list;
172  COPY_ARRAY_TO_LIST(*entity_list, *entity_list_size, temp_entity_list);
173 
174  RefEntity::gather_bdy_entities(temp_entity_list, temp_bdy_list);
175
176  COPY_LIST_TO_ARRAY(temp_bdy_list, *bdy_list, *bdy_list_size);
177}
178
179  void RefEntity_get_parent_ref_entities(void *this_ref_entity,
180                                           /* DLRefEntityList & */ void ***entity_list, int *entity_list_size) 
181{
182  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
183  DLRefEntityList temp_entity_list;
184 
185  temp_ref_entity->get_parent_ref_entities(temp_entity_list);
186
187  COPY_LIST_TO_ARRAY(temp_entity_list, *entity_list, *entity_list_size);
188}
189 
190  void RefEntity_change_to_parent_ref_entities(void *,
191                                                        /* DLRefEntityList & */ void ***ancestors, int *ancestors_size) 
192{
193  DLRefEntityList temp_ancestors;
194 
195  COPY_ARRAY_TO_LIST(*ancestors, *ancestors_size, temp_ancestors);
196
197  RefEntity::change_to_parent_ref_entities(temp_ancestors);
198
199  COPY_LIST_TO_ARRAY(temp_ancestors, *ancestors, *ancestors_size);
200}
201 
202    /* RefEntity * */ void *RefEntity_join_1(void *this_ref_entity,  /* RefEntity * */ void *ref_entity_2,
203                                             /* DLRefEntityList & */ void ***join_set, int *join_set_size) 
204{
205  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
206  DLRefEntityList temp_join_set;
207  RefEntity *temp_ref_entity_2 = (RefEntity *) ref_entity_2;
208 
209  RefEntity *result = temp_ref_entity->join(temp_ref_entity_2, temp_join_set);
210
211  COPY_LIST_TO_ARRAY(temp_join_set, *join_set, *join_set_size);
212
213  return result;
214}
215  /* RefEntity * */ void *RefEntity_join_2(void *,
216                                                  /* DLRefEntityList & */ void ***ref_entities, int *ref_entities_size, 
217                                                  /* DLRefEntityList & */ void ***join_set, int *join_set_size) 
218{
219  DLRefEntityList temp_join_set;
220  DLRefEntityList temp_ref_entities;
221  COPY_ARRAY_TO_LIST(*ref_entities, *ref_entities_size, temp_ref_entities);
222 
223  RefEntity *result = RefEntity::join(temp_ref_entities, temp_join_set);
224
225  COPY_LIST_TO_ARRAY(temp_join_set, *join_set, *join_set_size);
226 
227  return result;
228}
229 
230    /* RefEntity * */ void *RefEntity_meet_1(void *this_ref_entity,  /* RefEntity * */ void *ref_entity_2,
231                                             /* DLRefEntityList & */ void ***join_set, int *join_set_size) 
232{
233  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
234  DLRefEntityList temp_join_set;
235  RefEntity *temp_ref_entity_2 = (RefEntity *) ref_entity_2;
236 
237  RefEntity *result = temp_ref_entity->meet(temp_ref_entity_2, temp_join_set);
238
239  COPY_LIST_TO_ARRAY(temp_join_set, *join_set, *join_set_size);
240
241  return result;
242}
243  /* RefEntity * */ void *RefEntity_meet_2(void *,
244                                                  /* DLRefEntityList & */ void ***ref_entities, int *ref_entities_size, 
245                                                  /* DLRefEntityList & */ void ***join_set, int *join_set_size) 
246{
247  DLRefEntityList temp_join_set;
248  DLRefEntityList temp_ref_entities;
249  COPY_ARRAY_TO_LIST(*ref_entities, *ref_entities_size, temp_ref_entities);
250 
251  RefEntity *result = RefEntity::meet(temp_ref_entities, temp_join_set);
252
253  COPY_LIST_TO_ARRAY(temp_join_set, *join_set, *join_set_size);
254 
255  return result;
256}
257
258  int RefEntity_valence(void *this_ref_entity, /* RefEntity * */ void *parent) 
259{
260  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
261  RefEntity *temp_parent = (RefEntity *) parent;
262 
263  return temp_ref_entity->valence(temp_parent);
264}
265
266  enum CubitBoolean RefEntity_is_child(void *this_ref_entity, /* RefEntity * */ void *entity) 
267{
268  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
269  RefEntity *temp_entity = (RefEntity *) entity;
270
271  return temp_ref_entity->is_child(temp_entity);
272}
273
274  enum CubitBoolean RefEntity_is_parent(void *this_ref_entity, /* RefEntity * */ void *entity) 
275{
276  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
277  RefEntity *temp_entity = (RefEntity *) entity;
278
279  return temp_ref_entity->is_parent(temp_entity);
280}
281
282  struct CubitVectorStruct RefEntity_center_point(void *this_ref_entity) 
283{
284  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
285  return temp_ref_entity->center_point();
286}
287 
288  double RefEntity_measure(void *this_ref_entity) 
289{
290  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
291  return temp_ref_entity->measure();
292}
293 
294    /* CubitString */ const char *RefEntity_measure_label(void *this_ref_entity) 
295{
296  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
297  return temp_ref_entity->measure_label().c_str();
298}
299 
300  int RefEntity_validate(void *this_ref_entity) 
301{
302  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
303  return temp_ref_entity->validate();
304}
305 
306  enum EntityType RefEntity_entity_type(void *this_ref_entity) 
307{
308  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
309  return temp_ref_entity->entity_type();
310}
311 
312  void* RefEntity_get_address(void *this_ref_entity, enum EntityType inputEntityType) 
313{
314  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
315  return temp_ref_entity->get_address(inputEntityType);
316}
317 
318void RefEntity_notify(void *this_ref_entity, /* RefEntity * */ void *partner, enum EventType event) 
319{
320  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
321  RefEntity *temp_partner = (RefEntity *) partner;
322
323  temp_ref_entity->notify(temp_partner, event);
324}
325 
326void RefEntity_add_compare_data(void *this_ref_entity, /* RefEntity * */ void *partner) 
327{
328  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
329  RefEntity *temp_partner = (RefEntity *) partner;
330
331  temp_ref_entity->add_compare_data(temp_partner);
332}
333 
334void RefEntity_remove_compare_data(void *this_ref_entity) 
335{
336  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
337  temp_ref_entity->remove_compare_data();
338}
339
340  void RefEntity_get_related_entity_list(void *this_ref_entity, enum EntityType related_entity_type,
341                                           /* DLRefEntityList & */ void ***entity_list, int *entity_list_size) 
342{
343  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
344  DLRefEntityList temp_entity_list;
345 
346  temp_ref_entity->get_related_entity_list(related_entity_type, temp_entity_list);
347
348  COPY_LIST_TO_ARRAY(temp_entity_list, *entity_list, *entity_list_size);
349 
350}
351
352void RefEntity_set_id(void *this_ref_entity, int i) 
353{
354  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
355  temp_ref_entity->set_id(i);
356}
357
358void RefEntity_draw(void *this_ref_entity, int color) 
359{
360  RefEntity *temp_ref_entity = (RefEntity *) this_ref_entity;
361  temp_ref_entity->draw(color);
362}
Note: See TracBrowser for help on using the browser.