| 1 | #ifndef REFENTITY_CCAPI_H |
|---|
| 2 | #define REFENTITY_CCAPI_H |
|---|
| 3 | |
|---|
| 4 | #include "CubitDefines.h" |
|---|
| 5 | #include "EntityType.h" |
|---|
| 6 | #include "CubitVectorStruct.h" |
|---|
| 7 | |
|---|
| 8 | #ifdef __cplusplus |
|---|
| 9 | extern "C" { |
|---|
| 10 | #endif |
|---|
| 11 | |
|---|
| 12 | /* Name-related functions */ |
|---|
| 13 | /* RefEntity* */ void *RefEntity_get_by_name(void *this_ref_entity, |
|---|
| 14 | /* const CubitString& */ const char *name); |
|---|
| 15 | |
|---|
| 16 | /* CubitString */ const char *RefEntity_entity_name_1(void *this_ref_entity); |
|---|
| 17 | |
|---|
| 18 | enum CubitStatus RefEntity_entity_name_2(void *this_ref_entity, /* CubitString */ const char *name); |
|---|
| 19 | |
|---|
| 20 | void RefEntity_entity_names(void *this_ref_entity, /* DLCubitStringList & */ void ***names, int *names_size); |
|---|
| 21 | |
|---|
| 22 | int RefEntity_num_names(void *this_ref_entity); |
|---|
| 23 | |
|---|
| 24 | enum CubitStatus RefEntity_generate_default_name (void *this_ref_entity, /* CubitString & */ char **name ); |
|---|
| 25 | |
|---|
| 26 | enum CubitStatus RefEntity_assign_default_name(void *this_ref_entity, enum CubitBoolean user_setting); |
|---|
| 27 | |
|---|
| 28 | enum CubitStatus RefEntity_remove_entity_name(void *this_ref_entity, /* CubitString const & */ const char *name); |
|---|
| 29 | |
|---|
| 30 | enum CubitStatus RefEntity_remove_entity_names(void *this_ref_entity); |
|---|
| 31 | |
|---|
| 32 | void RefEntity_merge_entity_names(void *this_ref_entity, /* RefEntity* */ void *dead_entity); |
|---|
| 33 | |
|---|
| 34 | void RefEntity_switch_entity_names(void *this_ref_entity, /* RefEntity * */ void *other_entity); |
|---|
| 35 | |
|---|
| 36 | /* - Functions related to naming of RefEntity objects */ |
|---|
| 37 | |
|---|
| 38 | void RefEntity_marked_1(void *this_ref_entity, int value); |
|---|
| 39 | |
|---|
| 40 | int RefEntity_marked_2(void *this_ref_entity); |
|---|
| 41 | |
|---|
| 42 | /* - Generic flag for temporary use by algorithms. */ |
|---|
| 43 | /* - Value is volatile and may change unexpectedly. */ |
|---|
| 44 | |
|---|
| 45 | void RefEntity_is_mergeable_1(void *this_ref_entity, int val); |
|---|
| 46 | |
|---|
| 47 | int RefEntity_is_mergeable_2(void *this_ref_entity); |
|---|
| 48 | |
|---|
| 49 | /* - Set/Get the mergeable status for this entity. */ |
|---|
| 50 | |
|---|
| 51 | int RefEntity_children_mergeable(void *this_ref_entity); |
|---|
| 52 | |
|---|
| 53 | /* - Get whether all child entities are mergeable. */ |
|---|
| 54 | |
|---|
| 55 | int RefEntity_dimension(void *this_ref_entity); |
|---|
| 56 | /* Returns the geometric dimension of the entity. */ |
|---|
| 57 | /* vertex == 0, edge == 1, etc. */ |
|---|
| 58 | |
|---|
| 59 | enum EntityType RefEntity_get_child_ref_entity_type(void *this_ref_entity); |
|---|
| 60 | /* R EntityType */ |
|---|
| 61 | /* R- A type value. */ |
|---|
| 62 | /* - This function returns the type of the child RefEntity for */ |
|---|
| 63 | /* - "this" type of RefEntity. If there is no child RefEntity type, */ |
|---|
| 64 | /* - for example for RefVertex, then InvalidEntity_TYPE is returned. */ |
|---|
| 65 | |
|---|
| 66 | enum EntityType RefEntity_get_parent_ref_entity_type(void *this_ref_entity); |
|---|
| 67 | /* R EntityType */ |
|---|
| 68 | /* R- A type value. */ |
|---|
| 69 | /* - This function returns the type of the parent RefEntity for */ |
|---|
| 70 | /* - "this" type of RefEntity. If there is no parent RefEntity type, */ |
|---|
| 71 | /* - for example for RefVolume, then InvalidEntity_TYPE is returned. */ |
|---|
| 72 | |
|---|
| 73 | void RefEntity_get_child_ref_entities(void *this_ref_entity, |
|---|
| 74 | /* DLRefEntityList & */ void ***entity_list, int *entity_list_size); |
|---|
| 75 | /* - Appends all immediate (child) RefEntities owned by this RefEntity to */ |
|---|
| 76 | /* - entity_list. (The query goes down just one dimension.) */ |
|---|
| 77 | |
|---|
| 78 | void RefEntity_get_all_child_ref_entities(void *this_ref_entity, |
|---|
| 79 | /* DLRefEntityList & */ void ***entity_list, int *entity_list_size); |
|---|
| 80 | |
|---|
| 81 | /* - Appends all child RefEntities owned by this entity to entity_list. */ |
|---|
| 82 | /* - (The query recurses all the way down to RefEntities of dimension 0). */ |
|---|
| 83 | |
|---|
| 84 | void RefEntity_gather_bdy_entities(void *this_ref_entity, |
|---|
| 85 | /* DLRefEntityList & */ void ***entity_list, int *entity_list_size, |
|---|
| 86 | /* DLRefEntityList & */ void ***bdy_list, int *bdy_list_size); |
|---|
| 87 | |
|---|
| 88 | /* Gather the boundary entities of the entity_list into the bdy_list. */ |
|---|
| 89 | /* Entities appear once in bdy_list, and will not appear in bdy_list */ |
|---|
| 90 | /* if they are already in the entity_list. */ |
|---|
| 91 | /* Uses listMark. */ |
|---|
| 92 | |
|---|
| 93 | void RefEntity_get_parent_ref_entities(void *this_ref_entity, |
|---|
| 94 | /* DLRefEntityList & */ void ***entity_list, |
|---|
| 95 | int *entity_list_size); |
|---|
| 96 | |
|---|
| 97 | /* - Appends all RefEntities that own this (parent RefEntities) to */ |
|---|
| 98 | /* - entity_list. */ |
|---|
| 99 | /* - (The query goes up just one dimension. For example, if this is a */ |
|---|
| 100 | /* - vertex, the resulting list contains only RefEdges). */ |
|---|
| 101 | |
|---|
| 102 | void RefEntity_change_to_parent_ref_entities(void *this_ref_entity, |
|---|
| 103 | /* DLRefEntityList & */ void ***ancestors, |
|---|
| 104 | int *ancestors_size); |
|---|
| 105 | |
|---|
| 106 | /* - Modify the input list to contain the list of RefEntities that are */ |
|---|
| 107 | /* - the parents of each of the RefEntities in the original list. */ |
|---|
| 108 | |
|---|
| 109 | /* RefEntity * */ void *RefEntity_join_1(void *this_ref_entity, /* RefEntity* */ void *ref_entity_2, |
|---|
| 110 | /* DLRefEntityList & */ void ***join_set, int *join_set_size); |
|---|
| 111 | |
|---|
| 112 | /* RefEntity * */ void *RefEntity_join_2(void *this_ref_entity, |
|---|
| 113 | /* DLRefEntityList & */ void ***ref_entities, int *ref_entities_size, |
|---|
| 114 | /* DLRefEntityList & */ void ***join_set, int *join_set_size); |
|---|
| 115 | |
|---|
| 116 | /* RefEntity* join( RefEntity* ref_entity_2 ); */ |
|---|
| 117 | /* - Computes the geometric "join" of elements (elements on the list or */ |
|---|
| 118 | /* - this and ref_entity_2). */ |
|---|
| 119 | /* - Definition "Join" = The lowest dimensional entitity that */ |
|---|
| 120 | /* - is a higher dimensional ancestor of them all. */ |
|---|
| 121 | /* - Note join could be one of the entities itself, NULL, */ |
|---|
| 122 | /* - or multiple elements. */ |
|---|
| 123 | /* - E.g. The join of a vertex and a curve containing the vertex is */ |
|---|
| 124 | /* - the curve. The join of two curves of a split cylinder is */ |
|---|
| 125 | /* - both containing surfaces. */ |
|---|
| 126 | /* - The join of two entities in separate, unmerged volumes is null. */ |
|---|
| 127 | /* - Returns the first element of the join_set, or NULL if set is empty. */ |
|---|
| 128 | |
|---|
| 129 | /* RefEntity * */ void *RefEntity_meet_1(void *this_ref_entity, /* RefEntity* */ void *ref_entity_2, |
|---|
| 130 | /* DLRefEntityList & */ void ***join_set, int *join_set_size); |
|---|
| 131 | |
|---|
| 132 | /* RefEntity * */ void *RefEntity_meet_2(void *this_ref_entity, |
|---|
| 133 | /* DLRefEntityList & */ void ***ref_entities, int *ref_entities_size, |
|---|
| 134 | /* DLRefEntityList & */ void ***join_set, int *join_set_size); |
|---|
| 135 | |
|---|
| 136 | /* - like join, except returns the lower order entities common to the input */ |
|---|
| 137 | /* - entities */ |
|---|
| 138 | |
|---|
| 139 | int RefEntity_valence(void *this_ref_entity, /* RefEntity * */ void *parent); |
|---|
| 140 | |
|---|
| 141 | /* - the valence of this entity with respect to parent (absolute */ |
|---|
| 142 | /* - valence if parent is null) */ |
|---|
| 143 | |
|---|
| 144 | enum CubitBoolean RefEntity_is_child(void *this_ref_entity, /* RefEntity * */ void *entity); |
|---|
| 145 | |
|---|
| 146 | enum CubitBoolean RefEntity_is_parent(void *this_ref_entity, /* RefEntity * */ void *entity); |
|---|
| 147 | |
|---|
| 148 | /* - Return TRUE if this is entity, or a direct child (parent) of entity. */ |
|---|
| 149 | |
|---|
| 150 | /* void common_draw_label(int color, const int label_style); */ |
|---|
| 151 | /* //- Common code used for drawing labels. Actually, the entire */ |
|---|
| 152 | /* //- draw_label function could be implemented here if the */ |
|---|
| 153 | /* //- is_*_labeling_on() functions were or better implemented. */ |
|---|
| 154 | |
|---|
| 155 | struct CubitVectorStruct RefEntity_center_point(void *this_ref_entity); |
|---|
| 156 | /* - Return the approximate (spatial) center of this RefEntity */ |
|---|
| 157 | |
|---|
| 158 | double RefEntity_measure(void *this_ref_entity); |
|---|
| 159 | |
|---|
| 160 | /* - A generic geometric extent function. */ |
|---|
| 161 | /* - Returns volume for RefVolumes, area for RefFaces, length for RefEdge, */ |
|---|
| 162 | /* - and 1.0 for RefVertices */ |
|---|
| 163 | /* - A RefGroup calculates the maximum dimension of its contained */ |
|---|
| 164 | /* - entities and returns the sum of the measures() of all entities */ |
|---|
| 165 | /* - of that dimension. */ |
|---|
| 166 | /* - Default return value is 0.0 for all other entities. */ |
|---|
| 167 | |
|---|
| 168 | /* CubitString */ const char *RefEntity_measure_label(void *this_ref_entity); |
|---|
| 169 | |
|---|
| 170 | /* - Returns the type of measure: (volume, area, length, or N/A) */ |
|---|
| 171 | |
|---|
| 172 | int RefEntity_validate(void *this_ref_entity); |
|---|
| 173 | |
|---|
| 174 | /* - Perform checks to see if entity valid. */ |
|---|
| 175 | |
|---|
| 176 | enum EntityType RefEntity_entity_type(void *this_ref_entity); |
|---|
| 177 | /* - Return the type of the entity */ |
|---|
| 178 | |
|---|
| 179 | void* RefEntity_get_address(void *this_ref_entity, enum EntityType inputEntityType); |
|---|
| 180 | |
|---|
| 181 | /* R void* */ |
|---|
| 182 | /* R- Returned void pointer */ |
|---|
| 183 | /* I inputEntityType */ |
|---|
| 184 | /* I- The input type to get the address of. */ |
|---|
| 185 | /* - This function returns a void pointer that points to the */ |
|---|
| 186 | /* - "appropriate" portion of this object. The appropriate */ |
|---|
| 187 | /* - portion is determined by the input EntityType variable. */ |
|---|
| 188 | /* - Returns NULL if the input type and the type of "this" */ |
|---|
| 189 | /* - are not related by inheritance. */ |
|---|
| 190 | /* - Note: The RTTI capabilities encoded in these functions */ |
|---|
| 191 | /* - are designed to work with any form of multiple */ |
|---|
| 192 | /* - inheritance, as well. Multiple inheritance is what */ |
|---|
| 193 | /* - necessitates having this function defined in every */ |
|---|
| 194 | /* - class in the hierarchy. */ |
|---|
| 195 | /* - Note: This function can also be used to merely check if */ |
|---|
| 196 | /* - an object of one type is related to another type */ |
|---|
| 197 | /* - through inheritance. If a non-NULL pointer is */ |
|---|
| 198 | /* - returned, then this is true. */ |
|---|
| 199 | |
|---|
| 200 | void RefEntity_notify(void *this_ref_entity, /* RefEntity * */ void *partner, |
|---|
| 201 | enum EventType event); |
|---|
| 202 | |
|---|
| 203 | /* R void */ |
|---|
| 204 | /* I partner */ |
|---|
| 205 | /* I- The merge partner for this object */ |
|---|
| 206 | /* I event */ |
|---|
| 207 | /* I- The type of event */ |
|---|
| 208 | /* - This function takes actions depending on the type of event it */ |
|---|
| 209 | /* - is notified of. */ |
|---|
| 210 | /* - COMPARISON_FOUND: */ |
|---|
| 211 | /* - Make temporary TDCompare objects and attach to "this" and */ |
|---|
| 212 | /* - the "partner" object. */ |
|---|
| 213 | |
|---|
| 214 | void RefEntity_add_compare_data(void *this_ref_entity, /* RefEntity * */ void *partner); |
|---|
| 215 | |
|---|
| 216 | /* R void */ |
|---|
| 217 | /* I partner */ |
|---|
| 218 | /* I- The compare partner for this object */ |
|---|
| 219 | /* - This function makes the connection between the two RefEntities, */ |
|---|
| 220 | /* - this and partner. At the end of this function the two entities */ |
|---|
| 221 | /* - would know who they compare with. */ |
|---|
| 222 | |
|---|
| 223 | void RefEntity_remove_compare_data(void *this_ref_entity); |
|---|
| 224 | |
|---|
| 225 | /* R void */ |
|---|
| 226 | /* - This function clears the compare related temporary data. */ |
|---|
| 227 | |
|---|
| 228 | /* ======== Change Code by RY of Cat, 5/7/99 11:08:12 AM ======== */ |
|---|
| 229 | void RefEntity_get_related_entity_list(void *this_ref_entity, enum EntityType related_entity_type, |
|---|
| 230 | /* DLRefEntityList & */ void ***entity_list, int *entity_list_size); |
|---|
| 231 | |
|---|
| 232 | /* - to parse group in <ref_entity> commands */ |
|---|
| 233 | /* ======== Change End by RY of Cat, 5/7/99 11:08:12 AM ======== */ |
|---|
| 234 | |
|---|
| 235 | void RefEntity_set_id(void *this_ref_entity, int i); |
|---|
| 236 | |
|---|
| 237 | /* - set the id of this entity to i */ |
|---|
| 238 | |
|---|
| 239 | void RefEntity_draw(void *this_ref_entity, int color); |
|---|
| 240 | |
|---|
| 241 | #ifdef __cplusplus |
|---|
| 242 | } |
|---|
| 243 | #endif |
|---|
| 244 | |
|---|
| 245 | #endif |
|---|