| 1 | #ifndef REF_EDGE_CCAPI_HPP |
|---|
| 2 | #define REF_EDGE_CCAPI_HPP |
|---|
| 3 | |
|---|
| 4 | #include "EntityType.h" |
|---|
| 5 | #include "CubitDefines.h" |
|---|
| 6 | #include "CubitVectorStruct.h" |
|---|
| 7 | |
|---|
| 8 | #ifdef __cplusplus |
|---|
| 9 | extern "C" { |
|---|
| 10 | #endif |
|---|
| 11 | |
|---|
| 12 | void *RefEdge_get_address(void *this_ref_edge, |
|---|
| 13 | enum EntityType inputEntityType); |
|---|
| 14 | /* R void **/ |
|---|
| 15 | /* R- Returned void pointer */ |
|---|
| 16 | /* I inputenum EntityType */ |
|---|
| 17 | /* I- The input type to get the address of. */ |
|---|
| 18 | /* - This function returns a void pointer that points to the */ |
|---|
| 19 | /* - "appropriate" portion of this object. The appropriate */ |
|---|
| 20 | /* - portion is determined by the input enum EntityType variable. */ |
|---|
| 21 | /* - Returns NULL if the input type and the type of "this" */ |
|---|
| 22 | /* - are not related by inheritance. */ |
|---|
| 23 | /* - Note: The RTTI capabilities encoded in these functions */ |
|---|
| 24 | /* - are designed to work with any form of multiple */ |
|---|
| 25 | /* - inheritance, as well. Multiple inheritance is what */ |
|---|
| 26 | /* - necessitates having this function defined in every */ |
|---|
| 27 | /* - class in the hierarchy. */ |
|---|
| 28 | /* - Note: This function can also be used to merely check if */ |
|---|
| 29 | /* - an object of one type is related to another type */ |
|---|
| 30 | /* - through inheritance. If a non-NULL pointer is */ |
|---|
| 31 | /* - returned, then this is true. */ |
|---|
| 32 | |
|---|
| 33 | enum CubitStatus RefEdge_get_point_direction(void *this_ref_edge, |
|---|
| 34 | /* CubitVector & */ struct CubitVectorStruct *origin, |
|---|
| 35 | /* CubitVector & */ struct CubitVectorStruct *direction ); |
|---|
| 36 | /* - Only valid for straight lines */ |
|---|
| 37 | /* - Finds the underlying line's origin and direction unit vector */ |
|---|
| 38 | /* - Returns CUBIT_FAILURE if curve is not a line */ |
|---|
| 39 | |
|---|
| 40 | enum CubitStatus RefEdge_get_center_radius(void *this_ref_edge, |
|---|
| 41 | /* CubitVector & */ struct CubitVectorStruct *center, |
|---|
| 42 | /* double& */ double *radius ); |
|---|
| 43 | /* - Only valid for arcs */ |
|---|
| 44 | /* - Finds the underlying arc's center point and radius */ |
|---|
| 45 | /* - Returns CUBIT_FAILURE if curve is not an arc */ |
|---|
| 46 | |
|---|
| 47 | enum EntityType RefEdge_entity_type(void *this_ref_edge); |
|---|
| 48 | |
|---|
| 49 | enum EntityType RefEdge_get_child_ref_entity_type(void *this_ref_edge); |
|---|
| 50 | /* R enum EntityType */ |
|---|
| 51 | /* R- A type value. */ |
|---|
| 52 | /* - This function returns the type of the child RefEntity of */ |
|---|
| 53 | /* - RefEdge, which is the type value of the RefVertex class. */ |
|---|
| 54 | |
|---|
| 55 | enum EntityType RefEdge_get_parent_ref_entity_type(void *this_ref_edge); |
|---|
| 56 | /* R enum EntityType */ |
|---|
| 57 | /* R- A type value. */ |
|---|
| 58 | /* - This function returns the type of the parent RefEntity of */ |
|---|
| 59 | /* - RefEdge, which is the type value of the RefFace class. */ |
|---|
| 60 | |
|---|
| 61 | enum EntityType RefEdge_get_topology_bridge_type(void *this_ref_edge); |
|---|
| 62 | /* R enum EntityType */ |
|---|
| 63 | /* R- The type of GeometryEntity associated with this object */ |
|---|
| 64 | /* - This function returns the type of GeometryEntity associated with */ |
|---|
| 65 | /* - this BasicTopologyEntity. */ |
|---|
| 66 | |
|---|
| 67 | /* ********* TOPOLOGY ******************** */ |
|---|
| 68 | |
|---|
| 69 | enum EntityType RefEdge_get_grouping_entity_type(void *this_ref_edge); |
|---|
| 70 | /* R enum EntityType */ |
|---|
| 71 | /* R- The type of the corresponding GroupingEntity type. */ |
|---|
| 72 | /* - This function returns the type of the corresponding */ |
|---|
| 73 | /* - GroupingEntity . */ |
|---|
| 74 | |
|---|
| 75 | enum EntityType RefEdge_get_sense_entity_type(void *this_ref_edge); |
|---|
| 76 | /* R enum EntityType */ |
|---|
| 77 | /* R- The type of SenseEntity associated with this object */ |
|---|
| 78 | /* - This function returns the type of SenseEntity associated with */ |
|---|
| 79 | /* - this BasicTopologyEntity. */ |
|---|
| 80 | |
|---|
| 81 | /* RefVertex * */ void *RefEdge_startRefVertex(void *this_ref_edge); |
|---|
| 82 | /* RefVertex * */ void *RefEdge_endRefVertex(void *this_ref_edge); |
|---|
| 83 | |
|---|
| 84 | void RefEdge_switch_vertices(void *this_ref_edge); |
|---|
| 85 | /* R RefVertex **/ |
|---|
| 86 | /* R- Returned RefVertex pointer */ |
|---|
| 87 | /* - These functions get the start and end RefVertex'es of this */ |
|---|
| 88 | /* - RefEdge. */ |
|---|
| 89 | /* - */ |
|---|
| 90 | /* - MJP Notes: */ |
|---|
| 91 | /* - The start and end RefVertices are cached in the RefEdge (see */ |
|---|
| 92 | /* - private member data, start/end_RefVertex). These need to be */ |
|---|
| 93 | /* - updated if the end RefVertices could have changed during a */ |
|---|
| 94 | /* - geometric operation. See the routine, RefEdge::update to */ |
|---|
| 95 | /* - see how this is done. */ |
|---|
| 96 | |
|---|
| 97 | /* Chain * */ void *RefEdge_get_first_chain_ptr(void *this_ref_edge); |
|---|
| 98 | /* R Chain **/ |
|---|
| 99 | /* R- Pointer to the first Chain */ |
|---|
| 100 | /* - This function returns a pointer to the first Chain that this */ |
|---|
| 101 | /* - RefEdge points to. */ |
|---|
| 102 | |
|---|
| 103 | enum CubitStatus RefEdge_get_co_edges(void *this_ref_edge, |
|---|
| 104 | /* DLCoEdgeList & */ void ***co_edges_found_list, int *co_edges_found_list_size, |
|---|
| 105 | /* RefFace * */ void *input_ref_face_ptr); |
|---|
| 106 | /* R enum CubitStatus */ |
|---|
| 107 | /* R-CubitSucces/CubitFailure */ |
|---|
| 108 | /* O co_edges_found_list and optional input_ref_face_ptr */ |
|---|
| 109 | /* O- Gets the coedges that */ |
|---|
| 110 | /* - correspond to "this" RefEdge, they are populated into the */ |
|---|
| 111 | /* - co_edges_found_list. If an input_ref_face_ptr is sent it */ |
|---|
| 112 | /* - gets the co_edges that are just associated with that ref_face. */ |
|---|
| 113 | /* - Remember that usually there will be only one but for hard lines */ |
|---|
| 114 | /* - and sipes there may be two co-edges/ref-edge/ref-face. */ |
|---|
| 115 | /* - Note: This function will just blindly append the co-edges it */ |
|---|
| 116 | /* - finds into the co_edges_found_list. A merge-unique might be */ |
|---|
| 117 | /* - more expensive than we want. */ |
|---|
| 118 | |
|---|
| 119 | double RefEdge_angle_between(void *this_ref_edge, |
|---|
| 120 | /* RefEdge * */ void *other_edge_ptr, /* RefFace * */ void *face_ptr ); |
|---|
| 121 | /* - Returns the "inside" angle between this edge and */ |
|---|
| 122 | /* other_edge_ptr. Figures out which edge comes first. Only */ |
|---|
| 123 | /* requirement is that both edges must be on face_ptr and on */ |
|---|
| 124 | /* the same loop. Angle is in radians. */ |
|---|
| 125 | |
|---|
| 126 | enum CubitSense RefEdge_sense(void *this_ref_edge, |
|---|
| 127 | /* RefFace * */ void *face ); |
|---|
| 128 | /* - Sense of this edge wrt the given face. */ |
|---|
| 129 | /* - Return CUBIT_FORWARD or CUBIT_REVERSE. */ |
|---|
| 130 | /* - Returns CUBIT_UNKNOWN if there is more than one coedge, and */ |
|---|
| 131 | /* - senses don't agree, or if there are no coedges. */ |
|---|
| 132 | |
|---|
| 133 | int RefEdge_dimension(void *this_ref_edge); |
|---|
| 134 | /* - returns dimension of the actual entity. */ |
|---|
| 135 | |
|---|
| 136 | /* RefVertex * */ void *RefEdge_common_ref_vertex_1(void *this_ref_edge, |
|---|
| 137 | /* RefEdge * */ void *otherRefEdgePtr ); |
|---|
| 138 | /* - Find common RefVertex */ |
|---|
| 139 | |
|---|
| 140 | /* RefVertex * */ void *RefEdge_common_ref_vertex_2(void *this_ref_edge, |
|---|
| 141 | /* RefEdge * */ void *next_ref_edge, |
|---|
| 142 | /* RefFace * */ void *ref_face_ptr ); |
|---|
| 143 | /* - Finds the common vertex between the next_ref_edge and */ |
|---|
| 144 | /* - this edge, assuming that this edge comes before next_ref_edge */ |
|---|
| 145 | /* - in a the loop around the surface. This is needed because */ |
|---|
| 146 | /* - two edges may share two vertices... */ |
|---|
| 147 | |
|---|
| 148 | enum CubitBoolean RefEdge_common_vertices(void *this_ref_edge, |
|---|
| 149 | /* RefEdge * */ void *otherRefEdgePtr, |
|---|
| 150 | /* DLRefVertexList & */ void ***common_verts, int *common_verts_size); |
|---|
| 151 | /* -Populates the common_verts with the vertices that are common */ |
|---|
| 152 | /* -between the two curves. */ |
|---|
| 153 | /* -Returns CUBIT_TRUE if there are common vertices/ false otherwise. */ |
|---|
| 154 | |
|---|
| 155 | /* RefEdge * */ void *RefEdge_get_other_curve(void *this_ref_edge, |
|---|
| 156 | /* RefVertex * */ void *common_vertex, |
|---|
| 157 | /* RefFace * */ void *ref_face_ptr); |
|---|
| 158 | /* - Finds the other curve on the ref_face_ptr that shares */ |
|---|
| 159 | /* - the common vertex */ |
|---|
| 160 | |
|---|
| 161 | enum CubitStatus RefEdge_get_two_co_edges(void *this_ref_edge, |
|---|
| 162 | /* RefEdge * */ void *next_ref_edge, |
|---|
| 163 | /* RefFace * */ void *ref_face_ptr, |
|---|
| 164 | /* CoEdge *& */ void **co_edge_this, |
|---|
| 165 | /* CoEdge *& */ void **co_edge_next ); |
|---|
| 166 | /* R enum CubitStatus */ |
|---|
| 167 | /* R- CUBIT_SUCCESS/CUBIT_FAILURE */ |
|---|
| 168 | /* O next_ref_edge, ref_face_ptr, co_edge_this, co_edge_next */ |
|---|
| 169 | /* O-Returns the co_edge that corrisponds to 'this' ref_edge */ |
|---|
| 170 | /* - and the one that corrisponds to next_ref_edge, with */ |
|---|
| 171 | /* - respect to the ref_face_ptr. */ |
|---|
| 172 | /* - Special Note : next_ref_edge must follow 'this' ref_edge in a Loop */ |
|---|
| 173 | /* - on the ref_face_ptr, this is assumed so the function */ |
|---|
| 174 | /* - will assert if this is not done... */ |
|---|
| 175 | |
|---|
| 176 | /* RefFace * */ void *RefEdge_other_face(void *this_ref_edge, |
|---|
| 177 | /* RefFace * */ void *not_face, /* RefVolume * */ void *ref_volume); |
|---|
| 178 | /* - return the (an) other face sharing this edge, which also borders */ |
|---|
| 179 | /* - ref_volume if non-NULL */ |
|---|
| 180 | |
|---|
| 181 | /* RefVertex * */ void *RefEdge_other_vertex(void *this_ref_edge, |
|---|
| 182 | /* RefVertex * */ void *refVertexPtr ); |
|---|
| 183 | /* - Returns the vertex at the other end of the edge. */ |
|---|
| 184 | |
|---|
| 185 | /* RefVertex * */ void *RefEdge_closest_vertex(void *this_ref_edge, |
|---|
| 186 | const /* CubitVector & */ struct CubitVectorStruct *point3); |
|---|
| 187 | |
|---|
| 188 | /* ********* GEOMETRY ******************** */ |
|---|
| 189 | |
|---|
| 190 | /* Curve * */ void *RefEdge_get_curve_ptr(void *this_ref_edge) ; |
|---|
| 191 | /* R Curve **/ |
|---|
| 192 | /* R- A pointer to the Curve to which this RefEdge points. */ |
|---|
| 193 | /* - This function returns a pointer to the Curve */ |
|---|
| 194 | /* - to which the current RefEdge points. */ |
|---|
| 195 | |
|---|
| 196 | struct CubitVectorStruct RefEdge_start_coordinates(void *this_ref_edge); |
|---|
| 197 | struct CubitVectorStruct RefEdge_end_coordinates(void *this_ref_edge); |
|---|
| 198 | /* R CubitVector */ |
|---|
| 199 | /* R- Returned location. */ |
|---|
| 200 | /* - These functions return the start and end global coordinate */ |
|---|
| 201 | /* - locations of the RefEdge. */ |
|---|
| 202 | /* - */ |
|---|
| 203 | /* - NOTE: */ |
|---|
| 204 | /* - These coordinates remain consistent throughout the life of the */ |
|---|
| 205 | /* - RefEdge, regardless of the fact that the actual start and */ |
|---|
| 206 | /* - end RefVerex'es may change (e.g., after a merge operation). */ |
|---|
| 207 | |
|---|
| 208 | void RefEdge_move_to_curve (void *this_ref_edge, |
|---|
| 209 | /* CubitVector & */ struct CubitVectorStruct *vector ); |
|---|
| 210 | /* - Moves the given location (CubitVector or CubitNode) to the closest */ |
|---|
| 211 | /* - point on the Curve */ |
|---|
| 212 | |
|---|
| 213 | enum CubitStatus RefEdge_get_interior_extrema(void *this_ref_edge, |
|---|
| 214 | /* DLCubitVectorList& */ struct CubitVectorStruct **interior_points, |
|---|
| 215 | enum CubitSense *return_sense); |
|---|
| 216 | |
|---|
| 217 | enum CubitStatus RefEdge_closest_point_trimmed(void *this_ref_edge, |
|---|
| 218 | /* CubitVector const& */ struct CubitVectorStruct *location, |
|---|
| 219 | /* CubitVector & */ struct CubitVectorStruct *closest_location); |
|---|
| 220 | /* R void */ |
|---|
| 221 | /* I location */ |
|---|
| 222 | /* I- The point to which the closest point on the Curve is desired. */ |
|---|
| 223 | /* O closest_location */ |
|---|
| 224 | /* O- The point on the Curve, closest to the input location which */ |
|---|
| 225 | /* O- will be on the Curve. This is input as a reference */ |
|---|
| 226 | /* O- so that the function can modify its contents. */ |
|---|
| 227 | |
|---|
| 228 | |
|---|
| 229 | enum CubitStatus RefEdge_closest_point(void *this_ref_edge, |
|---|
| 230 | /* CubitVector const& */ struct CubitVectorStruct *location, |
|---|
| 231 | /* CubitVector & */ struct CubitVectorStruct *closest_location, |
|---|
| 232 | /* CubitVector * */ struct CubitVectorStruct *tangent_ptr, |
|---|
| 233 | /* CubitVector * */ struct CubitVectorStruct *curvature_ptr); |
|---|
| 234 | /* R void */ |
|---|
| 235 | /* I location */ |
|---|
| 236 | /* I- The point to which the closest point on the Curve is desired. */ |
|---|
| 237 | /* O closest_location */ |
|---|
| 238 | /* O- The point on the Curve, closest to the input location which */ |
|---|
| 239 | /* O- might not be on the Curve. This is input as a reference */ |
|---|
| 240 | /* O- so that the function can modify its contents. */ |
|---|
| 241 | /* O tangent_ptr */ |
|---|
| 242 | /* O- The tangent to the Curve (output as a unit vector) at the */ |
|---|
| 243 | /* O- closest_location. */ |
|---|
| 244 | /* O curvature_ptr */ |
|---|
| 245 | /* O- The curvature of the Curve at the closest_location. */ |
|---|
| 246 | /* - This function computes the point on the Curve closest to the input */ |
|---|
| 247 | /* - location. */ |
|---|
| 248 | /* - */ |
|---|
| 249 | /* - If the tangent and/or curvature is required, then the calling code */ |
|---|
| 250 | /* - is responsible for allocating space for the CubitVector(s) and */ |
|---|
| 251 | /* - sending in the relevant non-NULL pointers. If either of these */ |
|---|
| 252 | /* - pointers is NULL, the related quantity is not computed. */ |
|---|
| 253 | /* - */ |
|---|
| 254 | /* - Notes: */ |
|---|
| 255 | /* - The tangent direction is always in the positive direction of the */ |
|---|
| 256 | /* - *owning RefEdge*, regardless of the positive direction of the */ |
|---|
| 257 | /* - underlying solid model entities, if any. */ |
|---|
| 258 | |
|---|
| 259 | void RefEdge_tangent_1(void *this_ref_edge, |
|---|
| 260 | const /* CubitVector & */ struct CubitVectorStruct *point, /* CubitVector & */ struct CubitVectorStruct *tangent_vec ); |
|---|
| 261 | /* - Return the tangent for the point on this RefEdge that is closest */ |
|---|
| 262 | /* - to the input "point". The tangent direction is always in the */ |
|---|
| 263 | /* - positive direction of the RefEdge. The positive direction of */ |
|---|
| 264 | /* - the RefEdge is an invariant through its lifecycle. */ |
|---|
| 265 | |
|---|
| 266 | |
|---|
| 267 | enum CubitStatus RefEdge_tangent_2(void *this_ref_edge, |
|---|
| 268 | const /* CubitVector & */ struct CubitVectorStruct *point, |
|---|
| 269 | /* CubitVector & */ struct CubitVectorStruct *tangent_vec, |
|---|
| 270 | /* RefFace * */ void *ref_face_ptr ); |
|---|
| 271 | /* R enum CubitStatus */ |
|---|
| 272 | /* R- CUBIT_SUCCESS/CUBIT_FAILURE */ |
|---|
| 273 | /* O point, tangent_vec, ref_face_ptr */ |
|---|
| 274 | /* O- Get the correct tangent with respect to */ |
|---|
| 275 | /* - the ref_face_ptr. */ |
|---|
| 276 | /* - This tangent function is not the safest method for getting */ |
|---|
| 277 | /* - the tangent on a surface. In face if there could be */ |
|---|
| 278 | /* - another direction, this function could fail...(assert). */ |
|---|
| 279 | /* - This function assumes that there is only 1 co-edge per */ |
|---|
| 280 | /* - this ref_face for this REfEdge. */ |
|---|
| 281 | |
|---|
| 282 | enum CubitStatus RefEdge_tangent_3(void *this_ref_edge, |
|---|
| 283 | const /* CubitVector & */ struct CubitVectorStruct *point, /* CubitVector & */ struct CubitVectorStruct *tangent_vec, |
|---|
| 284 | /* RefEdge * */ void *next_ref_edge, |
|---|
| 285 | /* RefFace * */ void *ref_face_ptr ); |
|---|
| 286 | /* - Retruns the tangent for the point on this RefEdge that is closest */ |
|---|
| 287 | /* - to the input "point". Also, because the next_ref_edge and */ |
|---|
| 288 | /* - the ref_face_ptr are given, the tangent is oriented correctly. */ |
|---|
| 289 | /* - NOTE: It is assumed that 'this' RefEdge and next_ref_edge are */ |
|---|
| 290 | /* - in order in a "Loop" sense on the given ref_face_ptr. The next */ |
|---|
| 291 | /* - ref_edge obviously must follow 'this' edge in this loop. */ |
|---|
| 292 | |
|---|
| 293 | double RefEdge_measure(void *this_ref_edge); |
|---|
| 294 | /* - A generic geometric extent function. */ |
|---|
| 295 | /* - Returns volume for RefVolumes, area for RefFaces, length for RefEdge, */ |
|---|
| 296 | /* - and 1.0 for RefVertices */ |
|---|
| 297 | /* - A RefGroup calculates the maximum dimension of its contained */ |
|---|
| 298 | /* - entities and returns the sum of the measures() of all entities */ |
|---|
| 299 | /* - of that dimension. */ |
|---|
| 300 | /* - Default return value is 0.0 for all other RefEntities. */ |
|---|
| 301 | |
|---|
| 302 | /* CubitString */ const char *measure_label(); |
|---|
| 303 | /* - Returns the type of measure: (volume, area, length, or N/A) */ |
|---|
| 304 | |
|---|
| 305 | double RefEdge_get_arc_length_1(void *this_ref_edge); |
|---|
| 306 | double RefEdge_get_arc_length_2(void *this_ref_edge, |
|---|
| 307 | const /* CubitVector & */ struct CubitVectorStruct *point1, |
|---|
| 308 | const /* CubitVector & */ struct CubitVectorStruct *point2 ); |
|---|
| 309 | double RefEdge_get_arc_length_3(void *this_ref_edge, |
|---|
| 310 | const /* CubitVector & */ struct CubitVectorStruct *point1, const int whichEnd ); |
|---|
| 311 | /* - Various arc length calculations, some are redundant */ |
|---|
| 312 | |
|---|
| 313 | double RefEdge_get_chord_length(void *this_ref_edge); |
|---|
| 314 | /* - Calculates and returns the straight-line distance */ |
|---|
| 315 | /* - between the startRefVertex and the endRefVertex */ |
|---|
| 316 | |
|---|
| 317 | /* CubitVector */ struct CubitVectorStruct RefEdge_center_point(void *this_ref_edge); |
|---|
| 318 | /* - Returns location at the "actual" center of this RefEdge (along the */ |
|---|
| 319 | /* - arc of the RefEdge) */ |
|---|
| 320 | |
|---|
| 321 | enum CubitStatus RefEdge_mid_point_1(void *this_ref_edge, |
|---|
| 322 | const /* CubitVector & */ struct CubitVectorStruct *point1, const /* CubitVector & */ struct CubitVectorStruct *point2, |
|---|
| 323 | /* CubitVector & */ struct CubitVectorStruct *midPoint ); |
|---|
| 324 | /* - Calculate midpoint between the 2 points on this RefEdge */ |
|---|
| 325 | |
|---|
| 326 | enum CubitStatus RefEdge_mid_point_2(void *this_ref_edge, |
|---|
| 327 | /* CubitVector & */ struct CubitVectorStruct *mid_point); |
|---|
| 328 | /* - Calculate midpoint on this RefEdge */ |
|---|
| 329 | |
|---|
| 330 | enum CubitStatus RefEdge_position_from_fraction(void *this_ref_edge, |
|---|
| 331 | const double fraction_along_curve, |
|---|
| 332 | /* CubitVector & */ struct CubitVectorStruct *ouput_position ); |
|---|
| 333 | /* R enum CubitStatus */ |
|---|
| 334 | /* I fraction in parameter space along refedge. (1/3,2/3,4/5...) */ |
|---|
| 335 | /* O- position where percent in parameter space lies. */ |
|---|
| 336 | /* -This function takes the given fraction, finds the parameter value, */ |
|---|
| 337 | /* -and calculates this position. This is based off the vgi curve. */ |
|---|
| 338 | |
|---|
| 339 | double RefEdge_start_param(void *this_ref_edge); |
|---|
| 340 | /* R double */ |
|---|
| 341 | /* - this function returns the starting parameter of the underlying curve */ |
|---|
| 342 | |
|---|
| 343 | double RefEdge_end_param(void *this_ref_edge); |
|---|
| 344 | /* R double */ |
|---|
| 345 | /* - this function returns the ending parameter of the underlying curve */ |
|---|
| 346 | |
|---|
| 347 | enum CubitBoolean RefEdge_get_param_range(void *this_ref_edge, |
|---|
| 348 | /* double& */ double *start_param, |
|---|
| 349 | /* double& */ double *end_param ); |
|---|
| 350 | /* R enum CubitBoolean */ |
|---|
| 351 | /* R- CUBIT_TRUE/FALSE */ |
|---|
| 352 | /* O start_param, end_param */ |
|---|
| 353 | /* O- The "lower" and "upper" parameter values of the RefEdge. */ |
|---|
| 354 | /* - This function returns the parameter bounds for the RefEdge. */ |
|---|
| 355 | /* - The start_param represents the parameter value of the */ |
|---|
| 356 | /* - start location of the RefEdge and the end_param that of the */ |
|---|
| 357 | /* - end location. */ |
|---|
| 358 | /* - */ |
|---|
| 359 | /* - CUBIT_TRUE is returned if the RefEdge is defined parametrically */ |
|---|
| 360 | /* - and CUBIT_FALSE if it is not. In the latter case, the */ |
|---|
| 361 | /* - output values of start_ and end_param are undetermined. */ |
|---|
| 362 | /* - */ |
|---|
| 363 | /* - MJP Note: */ |
|---|
| 364 | /* - The numercial value of the start_param could be higher */ |
|---|
| 365 | /* - than that of the end_param. */ |
|---|
| 366 | |
|---|
| 367 | double RefEdge_u_from_position (void *this_ref_edge, |
|---|
| 368 | const /* CubitVector & */ struct CubitVectorStruct *input_position); |
|---|
| 369 | /* R double */ |
|---|
| 370 | /* R- The returned "u" parameter value in local parametric space */ |
|---|
| 371 | /* I input_position */ |
|---|
| 372 | /* I- The input position for which "u" is to be computed. */ |
|---|
| 373 | /* - This function returns the coordinate of a point in the local */ |
|---|
| 374 | /* - parametric (u) space that corresponds to the input position in */ |
|---|
| 375 | /* - global (world) space. The input point is first moved to the */ |
|---|
| 376 | /* - closest point on the Curve and the parameter value of that */ |
|---|
| 377 | /* - point is determined. */ |
|---|
| 378 | |
|---|
| 379 | enum CubitStatus RefEdge_position_from_u (void *this_ref_edge, |
|---|
| 380 | double u_value, |
|---|
| 381 | /* CubitVector & */ struct CubitVectorStruct *output_position); |
|---|
| 382 | /* R enum CubitStatus */ |
|---|
| 383 | /* R- CUBIT_SUCCESS/FAILURE */ |
|---|
| 384 | /* I u_value */ |
|---|
| 385 | /* I- The input u parameter value */ |
|---|
| 386 | /* O output_position */ |
|---|
| 387 | /* O- The output position */ |
|---|
| 388 | /* - This function returns the coordinates of a point in the global */ |
|---|
| 389 | /* - (world) space that corresponds to the input parametric position */ |
|---|
| 390 | /* - in the local space. */ |
|---|
| 391 | /* - */ |
|---|
| 392 | /* - If the input parameter value is not defined for the Curve, then */ |
|---|
| 393 | /* - the input CubitVector is not modified and CUBIT_FAILURE is */ |
|---|
| 394 | /* - returned. Otherwise, position is appropriately modified and */ |
|---|
| 395 | /* - CUBIT_SUCCESS is returned. */ |
|---|
| 396 | /* - */ |
|---|
| 397 | /* - If the curve is periodic, the input u_value is first "normalized" */ |
|---|
| 398 | /* - to the fundamental period of the Curve before its position */ |
|---|
| 399 | /* - in global space is determined. */ |
|---|
| 400 | |
|---|
| 401 | double RefEdge_u_from_arc_length (void *this_ref_edge, |
|---|
| 402 | double root_param, |
|---|
| 403 | double arc_length ); |
|---|
| 404 | /* R double */ |
|---|
| 405 | /* R- Returned parameter value */ |
|---|
| 406 | /* I root_param */ |
|---|
| 407 | /* I- The parameter value of the "root point" */ |
|---|
| 408 | /* I arc_length */ |
|---|
| 409 | /* I- A distance along the Curve */ |
|---|
| 410 | /* - This function returns the parameter value of the point that is */ |
|---|
| 411 | /* - "arc_length" away from the root point in the */ |
|---|
| 412 | /* - positive sense direction of the owning RefEdge. */ |
|---|
| 413 | /* - */ |
|---|
| 414 | /* - A negative value for distance would force the search to go in the */ |
|---|
| 415 | /* - negative (sense) direction of the RefEdge. */ |
|---|
| 416 | /* - */ |
|---|
| 417 | /* - NOTE: */ |
|---|
| 418 | /* - The important assumption that is made in this routine is that */ |
|---|
| 419 | /* - the end points of the RefEdge that owns this CurveACIS are the same */ |
|---|
| 420 | /* - as the end points of the first solid model entity in the list of */ |
|---|
| 421 | /* - solid model entities associated with this Curve. */ |
|---|
| 422 | |
|---|
| 423 | enum CubitStatus RefEdge_point_from_arc_length (void *this_ref_edge, |
|---|
| 424 | const /* CubitVector & */ struct CubitVectorStruct *root_point, |
|---|
| 425 | double const arc_length, |
|---|
| 426 | /* CubitVector & */ struct CubitVectorStruct *new_point ); |
|---|
| 427 | /* - Return a point arc_length distance from root_point */ |
|---|
| 428 | /* - on this RefEdge. */ |
|---|
| 429 | /* - */ |
|---|
| 430 | /* - If arc_length is negative, the new point */ |
|---|
| 431 | /* - is in the negative sense direction (along the RefEdge) from */ |
|---|
| 432 | /* - the root point. */ |
|---|
| 433 | /* - */ |
|---|
| 434 | /* - If the curve is not periodic and the point arc_length away */ |
|---|
| 435 | /* - from root_point in the appropriate direction goes beyond */ |
|---|
| 436 | /* - the end point of the RefEdge, that end point is returned */ |
|---|
| 437 | /* - as new_point. */ |
|---|
| 438 | /* - */ |
|---|
| 439 | /* - If the curve is periodic and the point arc_length away */ |
|---|
| 440 | /* - from root_point in the appropriate direction goes beyond */ |
|---|
| 441 | /* - the end point of the RefEdge, wrap around is done. */ |
|---|
| 442 | /* - */ |
|---|
| 443 | /* - NOTE: I have had problems with this function if the root point */ |
|---|
| 444 | /* - is the start vertex, for some reason by a factor of 1e-7 the */ |
|---|
| 445 | /* - parameter value is different between the start_param and the */ |
|---|
| 446 | /* - parameter found from the start_vertex location. So I will switch */ |
|---|
| 447 | /* - EdgeMeshTool to go off the start parameter instead of this function. */ |
|---|
| 448 | |
|---|
| 449 | double RefEdge_length_from_u(void *this_ref_edge, |
|---|
| 450 | double parameter1, |
|---|
| 451 | double parameter2 ); |
|---|
| 452 | |
|---|
| 453 | enum CubitBoolean RefEdge_is_periodic_1(void *this_ref_edge); |
|---|
| 454 | /* R enum CubitBoolean */ |
|---|
| 455 | /* R- CUBIT_TRUE/CUBIT_FALSE */ |
|---|
| 456 | /* - This function determines whether the underlying geometry of the */ |
|---|
| 457 | /* - Curve is periodic or not. Returns CUBIT_TRUE if it is and */ |
|---|
| 458 | /* - CUBIT_FALSE if it is not. */ |
|---|
| 459 | |
|---|
| 460 | enum CubitBoolean RefEdge_is_periodic_2(void *this_ref_edge, |
|---|
| 461 | /* double& */ double *period); |
|---|
| 462 | /* R enum CubitBoolean */ |
|---|
| 463 | /* R- CUBIT_TRUE/CUBIT_FALSE */ |
|---|
| 464 | /* O period */ |
|---|
| 465 | /* O- Returned period value */ |
|---|
| 466 | /* - This function determines whether the underlying geometry of the */ |
|---|
| 467 | /* - Curve is periodic or not. Returns CUBIT_TRUE if it is and */ |
|---|
| 468 | /* - CUBIT_FALSE if it is not. */ |
|---|
| 469 | /* - */ |
|---|
| 470 | /* - If it is periodic, then it returns the period in the input */ |
|---|
| 471 | /* - reference variable, "period". This value is set to 0.0 if */ |
|---|
| 472 | /* - the Curve is not periodic. */ |
|---|
| 473 | |
|---|
| 474 | int RefEdge_get_mark(void *this_ref_edge); |
|---|
| 475 | void RefEdge_set_mark(void *this_ref_edge, |
|---|
| 476 | int set_value ); |
|---|
| 477 | /* - get/set generic 2-bit mark. */ |
|---|
| 478 | |
|---|
| 479 | enum CubitStatus RefEdge_relative_sense(void *this_ref_edge, |
|---|
| 480 | /* RefEdge * */ void *ref_edge_ptr_2, |
|---|
| 481 | double tolerance_factor, |
|---|
| 482 | enum CubitSense *sense, |
|---|
| 483 | /* CubitBoolean & */ enum CubitBoolean *spatially_equal, |
|---|
| 484 | /* CubitBoolean & */ enum CubitBoolean *tangent_warning, |
|---|
| 485 | enum CubitBoolean force_merge); |
|---|
| 486 | /* - calculates the relative sense of two refedges and tries to */ |
|---|
| 487 | /* - see if there are two points that are close on each edge (1/3 and 2/3 */ |
|---|
| 488 | /* - param value). */ |
|---|
| 489 | |
|---|
| 490 | enum CubitBoolean RefEdge_about_spatially_equal(void *this_ref_edge, |
|---|
| 491 | /* RefEdge * */ void *ref_edge_ptr_2, |
|---|
| 492 | double tolerance_factor, |
|---|
| 493 | enum CubitSense *sensePtr, |
|---|
| 494 | enum CubitBoolean notify_refEntity, |
|---|
| 495 | enum CubitBoolean force_merge); |
|---|
| 496 | |
|---|
| 497 | /* R enum CubitBoolean */ |
|---|
| 498 | /* R-CUBIT_TRUE/CUBIT_FALSE */ |
|---|
| 499 | /* I RefEdge, double, CubitSense*, enum CubitBoolean */ |
|---|
| 500 | /* I- Second RefEdge to compare, Tolerance factor to for GEOMETRY_RESABS, */ |
|---|
| 501 | /* I- and flag for notifying compared RefEntities. */ |
|---|
| 502 | /* O CubitSense*, and returned enum CubitBoolean. */ |
|---|
| 503 | /* O- if the two refEdges are spatially equal within the GEOMETRY_RESABS* */ |
|---|
| 504 | /* - the tolerance_factor, then CUBIT_TRUE will be returned. Otherwise */ |
|---|
| 505 | /* - CUBIT_FALSE is returned. If there is a non-null sesnePtr sent in, */ |
|---|
| 506 | /* - the sense pointer value will be assinged the relative sense of the */ |
|---|
| 507 | /* - RefEdges, ie, CUBIT_FORWARD/CUBIT_REVERSED. */ |
|---|
| 508 | /* - To do the comparison, the end points, 1/3 and 2/3 world */ |
|---|
| 509 | /* - points are spatially compared. */ |
|---|
| 510 | |
|---|
| 511 | int RefEdge_validate(void *this_ref_edge); |
|---|
| 512 | /* - Check that entity is valid. Returns number of problems detected. */ |
|---|
| 513 | |
|---|
| 514 | /* ========= Add Code by SRS of Cat, 3/3/99 2:28:31 PM ========= */ |
|---|
| 515 | enum CubitBoolean RefEdge_is_tolerant(void *this_ref_edge); |
|---|
| 516 | /* - Returns CUBIT_TRUE if refedge is a tolerant edge. Tolerant */ |
|---|
| 517 | /* - edges can be created in the ACIS healer if it is unable to */ |
|---|
| 518 | /* - heal the edge. */ |
|---|
| 519 | /* ========= Code End by SRS of Cat, 3/3/99 2:28:31 PM ========= */ |
|---|
| 520 | |
|---|
| 521 | /* RefVertex * */ void *RefEdge_get_startRefVertex(void *this_ref_edge); |
|---|
| 522 | /* RefVertex * */ void *RefEdge_get_endRefVertex(void *this_ref_edge); |
|---|
| 523 | /* - retrieve the start/end vertices from the chain */ |
|---|
| 524 | |
|---|
| 525 | |
|---|
| 526 | #ifdef __cplusplus |
|---|
| 527 | } |
|---|
| 528 | #endif |
|---|
| 529 | |
|---|
| 530 | #endif |
|---|