| 1 | #ifndef REFGROUP_CCAPI_H |
|---|
| 2 | #define REFGROUP_CCAPI_H |
|---|
| 3 | |
|---|
| 4 | #include "CubitDefines.h" |
|---|
| 5 | #include "CubitVectorStruct.h" |
|---|
| 6 | #include "CubitBoxStruct.h" |
|---|
| 7 | #include "EntityType.h" |
|---|
| 8 | |
|---|
| 9 | #ifdef __cplusplus |
|---|
| 10 | extern "C" { |
|---|
| 11 | #endif |
|---|
| 12 | |
|---|
| 13 | int RefGroup_maximum_dimension(void *this_group); |
|---|
| 14 | //- This routine returns the maximum dimension of its owned subentities. |
|---|
| 15 | //- The 'only' kludge is that if one of its subentities is a RefGroup, it |
|---|
| 16 | //- must call 'maximum_dimension' on that entity instead of dimension(). |
|---|
| 17 | |
|---|
| 18 | enum EntityType RefGroup_entity_type(void *this_group); |
|---|
| 19 | //- return the type for this geometryEntity |
|---|
| 20 | |
|---|
| 21 | enum CubitStatus RefGroup_add_ref_entity_1(void *this_group, |
|---|
| 22 | /* RefEntity * */ void *ref_entity); |
|---|
| 23 | |
|---|
| 24 | enum CubitStatus RefGroup_add_ref_entity_2(void *this_group, |
|---|
| 25 | /* DLRefEntityList& */ void ***entity_list, |
|---|
| 26 | int *entity_list_size); |
|---|
| 27 | |
|---|
| 28 | enum CubitStatus RefGroup_remove_ref_entity(void *this_group, |
|---|
| 29 | /* RefEntity * */ void *ref_entity, |
|---|
| 30 | const enum CubitBoolean from_observable); |
|---|
| 31 | |
|---|
| 32 | //- add or remove one or more ref entities to/from this group |
|---|
| 33 | |
|---|
| 34 | void RefGroup_get_sub_entities(void *this_group, |
|---|
| 35 | /* DLRefEntityList & */ void ***entity_list, |
|---|
| 36 | int *entity_list_size); |
|---|
| 37 | //- appends all ref entities owned by this entity and recurses |
|---|
| 38 | //- down to dimension 0 |
|---|
| 39 | |
|---|
| 40 | void RefGroup_is_mergeable_1(void *this_group, int val); |
|---|
| 41 | |
|---|
| 42 | int RefGroup_is_mergeable_2(void *this_group); |
|---|
| 43 | |
|---|
| 44 | int RefGroup_remove_all_ref_entities(void *this_group); |
|---|
| 45 | //- remove all geometry entities in the group. |
|---|
| 46 | //- Returns number of items removed. |
|---|
| 47 | |
|---|
| 48 | void RefGroup_get_parent_ref_entities(void *this_group, |
|---|
| 49 | /* DLRefEntityList& */ void ***, |
|---|
| 50 | int *); |
|---|
| 51 | //- appends all ref entities that own this to entity_list. |
|---|
| 52 | //- Goes up just one dimension. |
|---|
| 53 | |
|---|
| 54 | void RefGroup_get_child_ref_entities(void *this_group, |
|---|
| 55 | /* DLRefEntityList& */ void ***entity_list, |
|---|
| 56 | int *entity_list_size); |
|---|
| 57 | //- appends all immediate ref entities owned by this entity on entity_list |
|---|
| 58 | //- Goes down just one dimension. |
|---|
| 59 | |
|---|
| 60 | void RefGroup_get_child_entities(void *this_group, |
|---|
| 61 | /* DLCubitEntityList& */ void ***cub_entity_list, |
|---|
| 62 | int *cub_entity_list_size); |
|---|
| 63 | //- appends all immediate ref entities owned by this entity on entity_list |
|---|
| 64 | //- Goes down just one dimension. |
|---|
| 65 | |
|---|
| 66 | void RefGroup_expand_group(void *this_group, |
|---|
| 67 | /* DLRefEntityList& */ void ***entity_list, |
|---|
| 68 | int *entity_list_size); |
|---|
| 69 | //- appends all the ref entities owned by this group. It will go down |
|---|
| 70 | //- until there are no ref-groups in the entity_list. |
|---|
| 71 | |
|---|
| 72 | struct CubitBoxStruct RefGroup_bounding_box(void *this_group); |
|---|
| 73 | |
|---|
| 74 | struct CubitVectorStruct RefGroup_center_point(void *this_group); |
|---|
| 75 | |
|---|
| 76 | void* RefGroup_get_address(void *this_group, |
|---|
| 77 | enum EntityType inputEntityType); |
|---|
| 78 | //R void* |
|---|
| 79 | //R- Returned void pointer |
|---|
| 80 | //I inputEntityType |
|---|
| 81 | //I- The input type to get the address of. |
|---|
| 82 | //- This function returns a void pointer that points to the |
|---|
| 83 | //- "appropriate" portion of this object. The appropriate |
|---|
| 84 | //- portion is determined by the input EntityType variable. |
|---|
| 85 | //- Returns NULL if the input type and the type of "this" |
|---|
| 86 | //- are not related by inheritance. |
|---|
| 87 | //- Note: The RTTI capabilities encoded in these functions |
|---|
| 88 | //- are designed to work with any form of multiple |
|---|
| 89 | //- inheritance, as well. Multiple inheritance is what |
|---|
| 90 | //- necessitates having this function defined in every |
|---|
| 91 | //- class in the hierarchy. |
|---|
| 92 | //- Note: This function can also be used to merely check if |
|---|
| 93 | //- an object of one type is related to another type |
|---|
| 94 | //- through inheritance. If a non-NULL pointer is |
|---|
| 95 | //- returned, then this is true. |
|---|
| 96 | |
|---|
| 97 | int RefGroup_subtract(void *this_group, |
|---|
| 98 | /* RefGroup * */ void *group_to_subtract, |
|---|
| 99 | /* RefGroup * */ void *target_group); |
|---|
| 100 | //- subtract group_to_subtract from this group |
|---|
| 101 | |
|---|
| 102 | int RefGroup_intersect(void *this_group, |
|---|
| 103 | /* RefGroup * */ void *other_group, |
|---|
| 104 | /* RefGroup * */ void *target_group); |
|---|
| 105 | //- intersect other_group with this one |
|---|
| 106 | |
|---|
| 107 | int RefGroup_unite(void *this_group, |
|---|
| 108 | /* RefGroup * */ void *other_group, |
|---|
| 109 | /* RefGroup * */ void *target_group); |
|---|
| 110 | //- unite other_group with this one |
|---|
| 111 | |
|---|
| 112 | int RefGroup_validate(void *this_group); |
|---|
| 113 | //- Return number of problems detected, 0 if none. |
|---|
| 114 | |
|---|
| 115 | void RefGroup_draw (void *this_group, int color); |
|---|
| 116 | //- draw the group's contained entities |
|---|
| 117 | |
|---|
| 118 | static enum CubitStatus RefGroup_delete_group (void *this_group, |
|---|
| 119 | /* RefGroup * */ void *group_ptr, |
|---|
| 120 | enum CubitBoolean propagate); |
|---|
| 121 | //- deletes a specified group from the global group list |
|---|
| 122 | //- if the boolean "propagate" is true, the groups sub_groups are |
|---|
| 123 | //- deleted also; as well as the sub_group's groups, etc.. |
|---|
| 124 | |
|---|
| 125 | static void RefGroup_delete_all_groups (void *this_group); |
|---|
| 126 | //- deletes all the groups from the model (except for 'picked_group' and 'drawn_group') |
|---|
| 127 | |
|---|
| 128 | static void RefGroup_get_contained_groups (void *this_group, |
|---|
| 129 | /* RefGroup * */ void *group_ptr, |
|---|
| 130 | /* DLRefGroupList & */ void ***contained_groups, |
|---|
| 131 | int *contained_groups_size); |
|---|
| 132 | //- gets the groups owned by group_ptr, as well as any other groups |
|---|
| 133 | //- owned by these groups, etc.. Current group (group_ptr) is also |
|---|
| 134 | //- added to the list. |
|---|
| 135 | |
|---|
| 136 | static void RefGroup_get_groups_within_1(void *this_group, |
|---|
| 137 | /* CubitEntity* */ void *cubit_entity_ptr, |
|---|
| 138 | /* DLRefGroupList & */ void ***groups_within, |
|---|
| 139 | int *groups_within_size, |
|---|
| 140 | const enum CubitBoolean recursive); |
|---|
| 141 | static void RefGroup_get_groups_within_2(void *this_group, |
|---|
| 142 | /* RefEntity* */ void *ref_entity_ptr, |
|---|
| 143 | /* DLRefGroupList & */ void ***groups_within, |
|---|
| 144 | int *groups_within_size, |
|---|
| 145 | const enum CubitBoolean recursive); |
|---|
| 146 | static void RefGroup_get_groups_within_3(void *this_group, |
|---|
| 147 | /* RefGroup* */ void *ref_group_ptr, |
|---|
| 148 | /* DLRefGroupList & */ void ***groups_within, |
|---|
| 149 | int *groups_within_size, |
|---|
| 150 | const enum CubitBoolean recursive); |
|---|
| 151 | //- Finds those groups which contain the input entity, at any level |
|---|
| 152 | //- (i.e., if group 2 contains group 3 which contains the entity, then |
|---|
| 153 | //- group 2 and group 3 will be returned in the output list). |
|---|
| 154 | |
|---|
| 155 | enum CubitStatus RefGroup_notify_observer(void *this_group, |
|---|
| 156 | /* CubitObservable * */ void *observable, |
|---|
| 157 | const /* CubitEvent & */ void *observer_event, |
|---|
| 158 | enum CubitBoolean from_observable); |
|---|
| 159 | //- handle notify observer function |
|---|
| 160 | |
|---|
| 161 | #ifdef __cplusplus |
|---|
| 162 | } |
|---|
| 163 | #endif |
|---|
| 164 | |
|---|
| 165 | #endif |
|---|