cgma
|
Go to the source code of this file.
Typedefs | |
typedef struct iGeom_Instance_Private * | iGeom_Instance |
Type used to store iGeom interface handle. | |
Functions | |
static void | iGeom_getDescription (iGeom_Instance instance, char *descr, int descr_len) |
Get a description of the error returned from the last iGeom call. | |
static void | iGeom_getErrorType (iGeom_Instance instance, int *error_type) |
Get the error type returned from the last iGeom function. | |
static void | iGeom_newGeom (char const *options, iGeom_Instance *instance_out, int *err, int options_len) |
Construct a new iGeom instance. | |
static void | iGeom_dtor (iGeom_Instance instance, int *err) |
Destroy an iGeom instance. | |
static void | iGeom_load (iGeom_Instance instance, char const *name, char const *options, int *err, int name_len, int options_len) |
Load a geom from a file. | |
static void | iGeom_save (iGeom_Instance instance, char const *name, char const *options, int *err, int name_len, int options_len) |
Save a geom to a file. | |
static void | iGeom_getRootSet (iGeom_Instance instance, iBase_EntitySetHandle *root_set, int *err) |
Get handle of the root set for this instance. | |
static void | iGeom_getBoundBox (iGeom_Instance instance, double *min_x, double *min_y, double *min_z, double *max_x, double *max_y, double *max_z, int *err) |
Get the bounding box of the entire model. | |
static void | iGeom_getEntities (iGeom_Instance instance, iBase_EntitySetHandle set_handle, int entity_type, iBase_EntityHandle **entity_handles, int *entity_handles_allococated, int *entity_handles_size, int *err) |
Get entities of specific type in set or instance. | |
static void | iGeom_getNumOfType (iGeom_Instance instance, iBase_EntitySetHandle set_handle, int entity_type, int *num_out, int *err) |
Get the number of entities with the specified type in the instance or set. | |
static void | iGeom_getEntType (iGeom_Instance instance, iBase_EntityHandle entity_handle, int *type, int *err) |
Get the entity type for the specified entity. | |
static void | iGeom_getArrType (iGeom_Instance instance, iBase_EntityHandle const *entity_handles, int entity_handles_size, int **type, int *type_allocated, int *type_size, int *err) |
Get the entity type for the specified entities. | |
static void | iGeom_getEntAdj (iGeom_Instance instance, iBase_EntityHandle entity_handle, int to_dimension, iBase_EntityHandle **adj_entities, int *adj_entities_allocated, int *adj_entities_size, int *err) |
Get entities of specified type adjacent to an entity. | |
static void | iGeom_getArrAdj (iGeom_Instance instance, iBase_EntityHandle const *entity_handles, int entity_handles_size, int requested_entity_type, iBase_EntityHandle **adj_entity_handles, int *adj_entity_handles_allocated, int *adj_entity_handles_size, int **offset, int *offset_allocated, int *offset_size, int *err) |
Get entities of specified type adjacent to entities. | |
static void | iGeom_getEnt2ndAdj (iGeom_Instance instance, iBase_EntityHandle entity_handle, int bridge_dimension, int to_dimension, iBase_EntityHandle **adjacent_entities, int *adjacent_entities_allocated, int *adjacent_entities_size, int *err) |
Get "2nd order" adjacencies to an entity. | |
static void | iGeom_getArr2ndAdj (iGeom_Instance instance, iBase_EntityHandle const *entity_handles, int entity_handles_size, int order_adjacent_key, int requested_entity_type, iBase_EntityHandle **adj_entity_handles, int *adj_entity_handles_allocated, int *adj_entity_handles_size, int **offset, int *offset_allocated, int *offset_size, int *err) |
Get "2nd order" adjacencies to an array of entities. | |
static void | iGeom_isEntAdj (iGeom_Instance instance, iBase_EntityHandle entity_handle1, iBase_EntityHandle entity_handle2, int *are_adjacent, int *err) |
Return whether two entities are adjacent. | |
static void | iGeom_isArrAdj (iGeom_Instance instance, iBase_EntityHandle const *entity_handles_1, int entity_handles_1_size, iBase_EntityHandle const *entity_handles_2, int entity_handles_2_size, int **is_adjacent_info, int *is_adjacent_info_allocated, int *is_adjacent_info_size, int *err) |
Return whether entity pairs are adjacent. | |
static void | iGeom_getTopoLevel (iGeom_Instance instance, int *topo_level_out, int *err) |
Return the topology level of the geometry. | |
static void | iGeom_getEntClosestPt (iGeom_Instance instance, iBase_EntityHandle entity_handle, double near_x, double near_y, double near_z, double *on_x, double *on_y, double *on_z, int *err) |
Get closest point to an entity. | |
static void | iGeom_getEntClosestPtTrimmed (iGeom_Instance instance, iBase_EntityHandle entity_handle, double near_x, double near_y, double near_z, double *on_x, double *on_y, double *on_z, int *err) |
Get closest point for an array of entities and points For surfaces, closest point could be on the void space inside it. Get closest point for an array of entities and points. If either the number of entities or number of coordinate triples is unity, then all points or entities are queried for that entity or point, respectively, otherwise each point corresponds to each entity. storage_order should be a value in the iBase_StorageOrder enum. | |
static void | iGeom_getArrClosestPt (iGeom_Instance instance, iBase_EntityHandle const *entity_handles, int entity_handles_size, int storage_order, double const *near_coordinates, int near_coordinates_size, double **on_coordinates, int *on_coordinates_allocated, int *on_coordinates_size, int *err) |
Get closest point for an array of entities and points For surfaces, it made sure the closest point in on surface. Get closest point for an array of entities and points. If either the number of entities or number of coordinate triples is unity, then all points or entities are queried for that entity or point, respectively, otherwise each point corresponds to each entity. storage_order should be a value in the iBase_StorageOrder enum. | |
static void | iGeom_getEntNrmlXYZ (iGeom_Instance instance, iBase_EntityHandle entity_handle, double x, double y, double z, double *nrml_i, double *nrml_j, double *nrml_k, int *err) |
Get the normal vector on an entity at the given position Get the normal vector on an entity at the given position. | |
static void | iGeom_getArrNrmlXYZ (iGeom_Instance instance, iBase_EntityHandle const *entity_handles, int entity_handles_size, int storage_order, double const *coordinates, int coordinates_size, double **normals, int *normals_allocated, int *normals_size, int *err) |
Get the normal vector on an entity(ies) at given position(s) | |
static void | iGeom_getEntNrmlPlXYZ (iGeom_Instance instance, iBase_EntityHandle entity_handle, double x, double y, double z, double *pt_x, double *pt_y, double *pt_z, double *nrml_i, double *nrml_j, double *nrml_k, int *err) |
Get the normal vector AND closest point on an entity at given position. | |
static void | iGeom_getArrNrmlPlXYZ (iGeom_Instance instance, iBase_EntityHandle const *entity_handles, int entity_handles_size, int storage_order, double const *near_coordinates, int near_coordinates_size, double **on_coordinates, int *on_coordinates_allocated, int *on_coordinates_size, double **normals, int *normals_allocated, int *normals_size, int *err) |
Get the normal vector AND closest point on an entity(ies) at given position(s) | |
static void | iGeom_getEntTgntXYZ (iGeom_Instance instance, iBase_EntityHandle entity_handle, double x, double y, double z, double *tgnt_i, double *tgnt_j, double *tgnt_k, int *err) |
Get the tangent vector on an entity at given position. | |
static void | iGeom_getArrTgntXYZ (iGeom_Instance instance, iBase_EntityHandle const *entity_handles, int entity_handles_size, int storage_order, double const *coordinates, int coordinates_size, double **tangents, int *tangents_allocated, int *tangents_size, int *err) |
Get the tangent vector on an entity(ies) at given position(s) | |
static void | iGeom_getFcCvtrXYZ (iGeom_Instance instance, iBase_EntityHandle face_handle, double x, double y, double z, double *cvtr1_i, double *cvtr1_j, double *cvtr1_k, double *cvtr2_i, double *cvtr2_j, double *cvtr2_k, int *err) |
Get the two principle curvature vectors for a face at a point. | |
static void | iGeom_getEgCvtrXYZ (iGeom_Instance instance, iBase_EntityHandle edge_handle, double x, double y, double z, double *cvtr_i, double *cvtr_j, double *cvtr_k, int *err) |
Get the principle curvature vector for an edge at a point. | |
static void | iGeom_getEntArrCvtrXYZ (iGeom_Instance instance, iBase_EntityHandle const *entity_handles, int entity_handles_size, int storage_order, double const *coords, int coords_size, double **cvtr_1, int *cvtr_1_allocated, int *cvtr_1_size, double **cvtr_2, int *cvtr_2_allocated, int *cvtr_2_size, int *err) |
Get the curvature(s) on an entity(ies) at given position(s) | |
static void | iGeom_getEgEvalXYZ (iGeom_Instance instance, iBase_EntityHandle edge_handle, double x, double y, double z, double *on_x, double *on_y, double *on_z, double *tgnt_i, double *tgnt_j, double *tgnt_k, double *cvtr_i, double *cvtr_j, double *cvtr_k, int *err) |
Get closest point, tangent, and curvature of edge. | |
static void | iGeom_getFcEvalXYZ (iGeom_Instance instance, iBase_EntityHandle face_handle, double x, double y, double z, double *on_x, double *on_y, double *on_z, double *nrml_i, double *nrml_j, double *nrml_k, double *cvtr1_i, double *cvtr1_j, double *cvtr1_k, double *cvtr2_i, double *cvtr2_j, double *cvtr2_k, int *err) |
Get closest point, tangent, and curvature of face. | |
static void | iGeom_getArrEgEvalXYZ (iGeom_Instance instance, iBase_EntityHandle const *edge_handles, int edge_handles_size, int storage_order, double const *coords, int coords_size, double **on_coords, int *on_coords_allocated, int *on_coords_size, double **tangent, int *tangent_allocated, int *tangent_size, double **cvtr, int *cvtr_allocated, int *cvtr_size, int *err) |
Get the closest point(s), tangent(s), and curvature(s) on an entity(ies) at given position(s) | |
static void | iGeom_getArrFcEvalXYZ (iGeom_Instance instance, iBase_EntityHandle const *face_handles, int face_handles_size, int storage_order, double const *coords, int coords_size, double **on_coords, int *on_coords_allocated, int *on_coords_size, double **normal, int *normal_allocated, int *normal_size, double **cvtr1, int *cvtr1_allocated, int *cvtr1_size, double **cvtr2, int *cvtr2_allocated, int *cvtr2_size, int *err) |
Get the closest point(s), tangent(s), and curvature(s) on an entity(ies) at given position(s) | |
static void | iGeom_getEntBoundBox (iGeom_Instance instance, iBase_EntityHandle entity_handle, double *min_x, double *min_y, double *min_z, double *max_x, double *max_y, double *max_z, int *err) |
Get the bounding box of the specified entity. | |
static void | iGeom_getArrBoundBox (iGeom_Instance instance, iBase_EntityHandle const *entity_handles, int entity_handles_size, int storage_order, double **min_corner, int *min_corner_allocated, int *min_corner_size, double **max_corner, int *max_corner_allocated, int *max_corner_size, int *err) |
Get the bounding box of the specified entities. | |
static void | iGeom_getVtxCoord (iGeom_Instance instance, iBase_EntityHandle vertex_handle, double *x, double *y, double *z, int *err) |
Get coordinates of specified vertex. | |
static void | iGeom_getVtxArrCoords (iGeom_Instance instance, iBase_EntityHandle const *entity_handles, int entity_handles_size, int storage_order, double **coordinates, int *coordinates_allocated, int *coordinates_size, int *err) |
Get coordinates of specified vertices. | |
static void | iGeom_getPntRayIntsct (iGeom_Instance instance, double x, double y, double z, double dir_x, double dir_y, double dir_z, iBase_EntityHandle **intersect_entity_handles, int *intersect_entity_handles_allocated, int *intersect_entity_hangles_size, int storage_order, double **intersect_coords, int *intersect_coords_allocated, int *intersect_coords_size, double **param_coords, int *param_coords_allocated, int *param_coords_size, int *err) |
Intersect a ray with the model. | |
static void | iGeom_getPntArrRayIntsct (iGeom_Instance instance, int storage_order, const double *coords, int coords_size, const double *directions, int directions_size, iBase_EntityHandle **intersect_entity_handles, int *intersect_entity_handles_allocated, int *intersect_entity_hangles_size, int **offset, int *offset_allocated, int *offset_size, double **intersect_coords, int *intersect_coords_allocated, int *intersect_coords_size, double **param_coords, int *param_coords_allocated, int *param_coords_size, int *err) |
Intersect an array of rays with the model. | |
static void | iGeom_getPntClsf (iGeom_Instance instance, double x, double y, double z, iBase_EntityHandle *entity_handle, int *err) |
Get the entity on which a point is located. | |
static void | iGeom_getPntArrClsf (iGeom_Instance instance, int storage_order, double const *coords, int coords_size, iBase_EntityHandle **entity_handles, int *entity_handles_allocated, int *entity_handles_size, int *err) |
Get the entities on which points are located. | |
static void | iGeom_getEntNrmlSense (iGeom_Instance instance, iBase_EntityHandle face, iBase_EntityHandle region, int *sense_out, int *err) |
Get the sense of a face with respect to a region. | |
static void | iGeom_getArrNrmlSense (iGeom_Instance instance, iBase_EntityHandle const *face_handles, int face_handles_size, iBase_EntityHandle const *region_handles, int region_handles_size, int **sense, int *sense_allocated, int *sense_size, int *err) |
Get the senses of an array of faces with respect to an array of regions. | |
static void | iGeom_getEgFcSense (iGeom_Instance, iBase_EntityHandle edge, iBase_EntityHandle face, int *sense_out, int *err) |
Get the sense of an edge with respect to a face. | |
static void | iGeom_getEgFcArrSense (iGeom_Instance instance, iBase_EntityHandle const *edge_handles, int edge_handles_size, iBase_EntityHandle const *face_handles, int face_handles_size, int **sense, int *sense_allocated, int *sense_size, int *err) |
Get the senses of an array of edges with respect to an array of faces. | |
static void | iGeom_getEgVtxSense (iGeom_Instance instance, iBase_EntityHandle edge, iBase_EntityHandle vertex1, iBase_EntityHandle vertex2, int *sense_out, int *err) |
Get the sense of a vertex pair with respect to an edge. | |
static void | iGeom_getEgVtxArrSense (iGeom_Instance instance, iBase_EntityHandle const *edge_handles, int edge_handles_size, iBase_EntityHandle const *vertex_handles_1, int veretx_handles_1_size, iBase_EntityHandle const *vertex_handles_2, int vertex_handles_2_size, int **sense, int *sense_allocated, int *sense_size, int *err) |
Get the senses of vertex pair with respect to a edges. | |
static void | iGeom_measure (iGeom_Instance instance, iBase_EntityHandle const *entity_handles, int entity_handles_size, double **measures, int *measures_allocated, int *measures_size, int *err) |
Return the measure (length, area, or volume) of entities. | |
static void | iGeom_getFaceType (iGeom_Instance instance, iBase_EntityHandle face_handle, char *face_type, int *err, int *face_type_length) |
Get the geometric type of a face. | |
static void | iGeom_getParametric (iGeom_Instance instance, int *is_parametric, int *err) |
Return whether interface has information about parameterization. | |
static void | iGeom_isEntParametric (iGeom_Instance instance, iBase_EntityHandle entity_handle, int *parametric, int *err) |
Return whether an entity has a parameterization. | |
static void | iGeom_isArrParametric (iGeom_Instance instance, iBase_EntityHandle const *entity_handles, int entity_handles_size, int **is_parametric, int *is_parametric_allocated, int *is_parametric_size, int *err) |
Return whether entities have parameterizations. | |
static void | iGeom_getEntUVtoXYZ (iGeom_Instance instance, iBase_EntityHandle entity_handle, double u, double v, double *x, double *y, double *z, int *err) |
Return coordinate position at specified parametric position on entity. | |
static void | iGeom_getArrUVtoXYZ (iGeom_Instance instance, iBase_EntityHandle const *entity_handles, int entity_handles_size, int storage_order, double const *uv, int uv_size, double **coordinates, int *coordinates_allocated, int *coordinates_size, int *err) |
Return coordinate positions at specified parametric position(s) on entity(ies) | |
static void | iGeom_getEntUtoXYZ (iGeom_Instance instance, iBase_EntityHandle entity_handle, double u, double *x, double *y, double *z, int *err) |
Return coordinate position at specified parametric position on entity. | |
static void | iGeom_getArrUtoXYZ (iGeom_Instance instance, iBase_EntityHandle const *entity_handles, int entity_handles_size, double const *u, int u_size, int storage_order, double **on_coords, int *on_coords_allocated, int *on_coords_size, int *err) |
Return coordinate positions at specified parametric position(s) on entity(ies) | |
static void | iGeom_getEntXYZtoUV (iGeom_Instance instance, iBase_EntityHandle entity_handle, double x, double y, double z, double *u, double *v, int *err) |
Return parametric position at specified spatial position on entity. | |
static void | iGeom_getEntXYZtoU (iGeom_Instance instance, iBase_EntityHandle entity_handle, double x, double y, double z, double *u, int *err) |
Return parametric position at specified spatial position on entity. | |
static void | iGeom_getArrXYZtoUV (iGeom_Instance instance, iBase_EntityHandle const *entity_handles, int entity_handles_size, int storage_order, double const *coordinates, int coordinates_size, double **uv, int *uv_allocated, int *uv_size, int *err) |
Return parametric positions at specified spatial position(s) on entity(ies) Return parametric positions at specified spatial position(s) on entity(ies). If either the number of entities or number of spatial coordinate triples is unity, then all points or entities are queried for that entity or point, respectively, otherwise each point corresponds to each entity. storage_order should be a value in the iBase_StorageOrder enum. | |
static void | iGeom_getArrXYZtoU (iGeom_Instance instance, iBase_EntityHandle const *entity_handles, int entity_handles_size, int storage_order, double const *coordinates, int coordinates_size, double **u, int *u_allocated, int *u_size, int *err) |
Return spatial positions at specified parametric position(s) on entity(ies) | |
static void | iGeom_getEntXYZtoUVHint (iGeom_Instance instance, iBase_EntityHandle entity_handle, double x, double y, double z, double *u, double *v, int *err) |
Return parametric position at specified spatial position on entity, based on parametric position hint. | |
static void | iGeom_getArrXYZtoUVHint (iGeom_Instance instance, iBase_EntityHandle const *entity_handles, int entity_handles_size, int storage_order, double const *coords, int coords_size, double **uv, int *uv_allocated, int *uv_size, int *err) |
Return parametric positions at specified spatial position(s) on entity(ies), based on parametric position hints Return parametric positions at specified spatial position(s) on entity(ies), based on parametric position hints. If either the number of entities or number of spatial coordinate triples is unity, then all points or entities are queried for that entity or point, respectively, otherwise each point corresponds to each entity. storage_order should be a value in the iBase_StorageOrder enum. | |
static void | iGeom_getEntUVRange (iGeom_Instance instance, iBase_EntityHandle entity_handle, double *u_min, double *v_min, double *u_max, double *v_max, int *err) |
Get parametric range of entity. | |
static void | iGeom_getEntURange (iGeom_Instance instance, iBase_EntityHandle entity_handle, double *u_min, double *u_max, int *err) |
Get parametric range of entity. | |
static void | iGeom_getArrUVRange (iGeom_Instance instance, iBase_EntityHandle const *entity_handles, int entity_handles_size, int storage_order, double **uv_min, int *uv_min_allocated, int *uv_min_size, double **uv_max, int *uv_max_allocated, int *uv_max_size, int *err) |
Get parametric range of entities. | |
static void | iGeom_getArrURange (iGeom_Instance instance, iBase_EntityHandle const *entity_handles, int entity_handles_size, double **u_min, int *u_min_allocated, int *u_min_size, double **u_max, int *u_max_allocated, int *u_max_size, int *err) |
Get parametric range of entities. | |
static void | iGeom_getEntUtoUV (iGeom_Instance instance, iBase_EntityHandle edge_handle, iBase_EntityHandle face_handle, double in_u, double *u, double *v, int *err) |
Return the face parametric coordinates for a parametric position on a bounding edge. | |
static void | iGeom_getVtxToUV (iGeom_Instance instance, iBase_EntityHandle vertex_handle, iBase_EntityHandle face_handle, double *u, double *v, int *err) |
Return parametric coordinates on face of vertex position. | |
static void | iGeom_getVtxToU (iGeom_Instance instance, iBase_EntityHandle vertex_handle, iBase_EntityHandle edge_handle, double *u, int *err) |
Return parametric coordinates on edge of vertex position. | |
static void | iGeom_getArrUtoUV (iGeom_Instance instance, iBase_EntityHandle const *edge_handles, int edge_handles_size, iBase_EntityHandle const *face_handles, int face_handles_size, double const *u_in, int u_in_size, int storage_order, double **uv, int *uv_allocated, int *uv_size, int *err) |
Return the face parametric coordinates for a parametric position on bounding edges. | |
static void | iGeom_getVtxArrToUV (iGeom_Instance instance, iBase_EntityHandle const *vertex_handles, int vertex_handles_size, iBase_EntityHandle const *face_handles, int face_handles_size, int storage_order, double **uv, int *uv_allocated, int *uv_size, int *err) |
Return parametric coordinates on faces of vertex positions. | |
static void | iGeom_getVtxArrToU (iGeom_Instance instance, iBase_EntityHandle const *vertex_handles, int vertex_handles_size, iBase_EntityHandle const *edge_handles, int edge_handles_size, double **u, int *u_allocated, int *u_size, int *err) |
Return parametric coordinates on edges of vertex positions. | |
static void | iGeom_getEntNrmlUV (iGeom_Instance instance, iBase_EntityHandle entity_handle, double u, double v, double *nrml_i, double *nrml_j, double *nrml_k, int *err) |
Return the normal at a specified parametric position. | |
static void | iGeom_getArrNrmlUV (iGeom_Instance instance, iBase_EntityHandle const *face_handles, int face_handles_size, int storage_order, double const *parameters, int parameters_size, double **normals, int *normals_allocated, int *normals_size, int *err) |
Return the normals at specified parametric positions. | |
static void | iGeom_getEntTgntU (iGeom_Instance instance, iBase_EntityHandle entity_handle, double u, double *tgnt_i, double *tgnt_j, double *tgnt_k, int *err) |
Return the tangent at a specified parametric position. | |
static void | iGeom_getArrTgntU (iGeom_Instance instance, iBase_EntityHandle const *edge_handles, int edge_handles_size, int storage_order, double const *parameters, int parameters_size, double **tangents, int *tangents_allocated, int *tangents_size, int *err) |
Return the tangents at specified parametric positions. | |
static void | iGeom_getEnt1stDrvt (iGeom_Instance instance, iBase_EntityHandle entity_handle, double u, double v, double **drvt_u, int *drvt_u_allocated, int *drvt_u_size, double **drvt_v, int *dvrt_v_allocated, int *dvrt_v_size, int *err) |
Get the first derivative of a face at specified parametric position. | |
static void | iGeom_getArr1stDrvt (iGeom_Instance instance, iBase_EntityHandle const *entity_handles, int entity_handles_size, int storage_order, double const *uv, int uv_size, double **dvrt_u, int *dvrt_u_allocated, int *dvrt_u_size, int **u_offset, int *u_offset_allocated, int *u_offset_size, double **dvrt_v, int *dvrt_v_allocated, int *dvrt_v_size, int **v_offset, int *v_offset_allocated, int *v_offset_size, int *err) |
Get the first derivatives of faces at specified parametric positions. | |
static void | iGeom_getEnt2ndDrvt (iGeom_Instance instance, iBase_EntityHandle entity_handle, double u, double v, double **drvt_uu, int *drvt_uu_allocated, int *drvt_uu_size, double **drvt_vv, int *dvrt_vv_allocated, int *dvrt_vv_size, double **drvt_uv, int *dvrt_uv_allocated, int *dvrt_uv_size, int *err) |
Get the second derivative of a face at specified parametric position. | |
static void | iGeom_getArr2ndDrvt (iGeom_Instance instance, iBase_EntityHandle const *entity_handles, int entity_handles_size, int storage_order, double const *uv, int uv_size, double **dvtr_uu, int *dvrt_uu_allocated, int *dvrt_uu_size, int **uu_offset, int *uu_offset_allocated, int *uu_offset_size, double **dvtr_vv, int *dvrt_vv_allocated, int *dvrt_vv_size, int **vv_offset, int *vv_offset_allocated, int *vv_offset_size, double **dvrt_uv, int *dvrt_uv_allocated, int *dvrt_uv_size, int **uv_offset, int *uv_offset_allocated, int *uv_offset_size, int *err) |
Get the second derivatives of faces at specified parametric positions. | |
static void | iGeom_getFcCvtrUV (iGeom_Instance instance, iBase_EntityHandle face_handle, double u, double v, double *cvtr1_i, double *cvtr1_j, double *cvtr1_k, double *cvtr2_i, double *cvtr2_j, double *cvtr2_k, int *err) |
Get the two principle curvature vectors for a face at a parametric position. | |
static void | iGeom_getFcArrCvtrUV (iGeom_Instance instance, iBase_EntityHandle const *face_handles, int face_handles_size, int storage_order, double const *uv, int uv_size, double **cvtr_1, int *cvtr_1_allocated, int *cvtr_1_size, double **cvtr_2, int *cvtr_2_allocated, int *cvtr_2_size, int *err) |
Get the curvature(s) on face(s) at given parametric position(s) | |
static void | iGeom_isEntPeriodic (iGeom_Instance instance, iBase_EntityHandle entity_handle, int *in_u, int *in_v, int *err) |
Return whether an entity is periodic. | |
static void | iGeom_isArrPeriodic (iGeom_Instance instance, iBase_EntityHandle const *entity_handles, int entity_handles_size, int **in_uv, int *in_uv_allocated, int *in_uv_size, int *err) |
Return whether entities are periodic. | |
static void | iGeom_isFcDegenerate (iGeom_Instance instance, iBase_EntityHandle face_handle, int *is_degenerate, int *err) |
Return whether a face is degenerate. | |
static void | iGeom_isFcArrDegenerate (iGeom_Instance instance, iBase_EntityHandle const *face_handles, int face_handles_size, int **degenerate, int *degenerate_allocated, int *degenerate_size, int *err) |
Return whether faces are degenerate. | |
static void | iGeom_getTolerance (iGeom_Instance instance, int *type, double *tolerance, int *err) |
Get the tolerance of the instance. | |
static void | iGeom_getEntTolerance (iGeom_Instance instance, iBase_EntityHandle entity_handle, double *tolerance, int *err) |
Get the tolerance of the specified entity. | |
static void | iGeom_getArrTolerance (iGeom_Instance instance, iBase_EntityHandle const *entity_handles, int entity_handles_size, double **tolerances, int *tolerances_allocated, int *tolerances_size, int *err) |
Get the tolerances of the specified entities. | |
static void | iGeom_initEntIter (iGeom_Instance instance, iBase_EntitySetHandle entity_set_handle, int requested_entity_type, iBase_EntityIterator *entity_iterator, int *err) |
Initialize an iterator over specified entity type. | |
static void | iGeom_initEntArrIter (iGeom_Instance instance, iBase_EntitySetHandle entity_set_handle, int requested_entity_type, int requested_array_size, iBase_EntityArrIterator *entArr_iterator, int *err) |
Initialize an array iterator over specified entity type and size. | |
static void | iGeom_getNextEntIter (iGeom_Instance instance, iBase_EntityIterator entity_iterator, iBase_EntityHandle *entity_handle, int *has_data, int *err) |
Get entity corresponding to an iterator and increment iterator. | |
static void | iGeom_getNextEntArrIter (iGeom_Instance instance, iBase_EntityArrIterator entArr_iterator, iBase_EntityHandle **entity_handles, int *entity_handles_allocated, int *entity_handles_size, int *has_data, int *err) |
Get entities contained in array iterator and increment iterator. | |
static void | iGeom_resetEntIter (iGeom_Instance instance, iBase_EntityIterator entity_iterator, int *err) |
Reset the iterator. | |
static void | iGeom_resetEntArrIter (iGeom_Instance instance, iBase_EntityArrIterator entArr_iterator, int *err) |
Reset the array iterator. | |
static void | iGeom_endEntIter (iGeom_Instance instance, iBase_EntityIterator entity_iterator, int *err) |
Destroy the specified iterator. | |
static void | iGeom_endEntArrIter (iGeom_Instance instance, iBase_EntityArrIterator entArr_iterator, int *err) |
Destroy the specified array iterator. | |
static void | iGeom_copyEnt (iGeom_Instance instance, iBase_EntityHandle source, iBase_EntityHandle *copy, int *err) |
Make a copy of the specified entity. | |
static void | iGeom_sweepEntAboutAxis (iGeom_Instance instance, iBase_EntityHandle geom_entity, double angle, double axis_x, double axis_y, double axis_z, iBase_EntityHandle *geom_entity2, int *err) |
Sweep (extrude) an entity about an axis. | |
static void | iGeom_deleteAll (iGeom_Instance instance, int *err) |
Delete all entities and sets. | |
static void | iGeom_deleteEnt (iGeom_Instance instance, iBase_EntityHandle entity_handle, int *err) |
Delete specified entity. | |
static void | iGeom_createSphere (iGeom_Instance instance, double radius, iBase_EntityHandle *geom_entity, int *err) |
Create a sphere. | |
static void | iGeom_createPrism (iGeom_Instance instance, double height, int n_sides, double major_rad, double minor_rad, iBase_EntityHandle *geom_entity, int *err) |
Create a prism. | |
static void | iGeom_createBrick (iGeom_Instance instance, double x, double y, double z, iBase_EntityHandle *geom_entity, int *err) |
Create an axis-oriented box. | |
static void | iGeom_createCylinder (iGeom_Instance instance, double height, double major_rad, double minor_rad, iBase_EntityHandle *geom_entity, int *err) |
Create a cylinder. | |
static void | iGeom_createCone (iGeom_Instance instance, double height, double major_rad_base, double minor_rad_base, double rad_top, iBase_EntityHandle *geom_entity, int *err) |
Create a cone or tapered cylinder. | |
static void | iGeom_createTorus (iGeom_Instance instance, double major_rad, double minor_rad, iBase_EntityHandle *geom_entity, int *err) |
Create a torus. | |
static void | iGeom_moveEnt (iGeom_Instance instance, iBase_EntityHandle geom_entity, double x, double y, double z, int *err) |
Move an entity by the given vector. | |
static void | iGeom_rotateEnt (iGeom_Instance instance, iBase_EntityHandle geom_entity, double angle, double axis_x, double axis_y, double axis_z, int *err) |
Rotate an entity about an axis. | |
static void | iGeom_reflectEnt (iGeom_Instance instance, iBase_EntityHandle geom_entity, double plane_normal_x, double plane_normal_y, double plane_normal_z, int *err) |
Reflect an entity across a plane. | |
static void | iGeom_scaleEnt (iGeom_Instance instance, iBase_EntityHandle geom_entity, double scale_x, double scale_y, double scale_z, int *err) |
Scale an entity in the x, y, and z directions. | |
static void | iGeom_uniteEnts (iGeom_Instance instace, iBase_EntityHandle const *geom_entities, int geom_entities_size, iBase_EntityHandle *geom_entity, int *err) |
Geometrically unite entities. | |
static void | iGeom_subtractEnts (iGeom_Instance instance, iBase_EntityHandle blank, iBase_EntityHandle tool, iBase_EntityHandle *geom_entity, int *err) |
Geometrically subtract one entity from another. | |
static void | iGeom_intersectEnts (iGeom_Instance instance, iBase_EntityHandle entity2, iBase_EntityHandle entity1, iBase_EntityHandle *geom_entity, int *err) |
Geometrically intersect a pair of entities. | |
static void | iGeom_sectionEnt (iGeom_Instance instance, iBase_EntityHandle geom_entity, double plane_normal_x, double plane_normal_y, double plane_normal_z, double offset, int reverse, iBase_EntityHandle *geom_entity2, int *err) |
Section (cut) a region with a plane. | |
static void | iGeom_imprintEnts (iGeom_Instance instance, iBase_EntityHandle const *geom_entities, int geom_entities_size, int *err) |
Imprint entities. | |
static void | iGeom_mergeEnts (iGeom_Instance instance, iBase_EntityHandle const *geom_entities, int geom_entities_size, double tolerance, int *err) |
Merge ents. | |
static void | iGeom_createEntSet (iGeom_Instance instance, int isList, iBase_EntitySetHandle *entity_set_created, int *err) |
Create an entity set. | |
static void | iGeom_destroyEntSet (iGeom_Instance instance, iBase_EntitySetHandle entity_set, int *err) |
Destroy an entity set. | |
static void | iGeom_isList (iGeom_Instance instance, iBase_EntitySetHandle entity_set, int *is_list, int *err) |
Return whether a specified set is ordered or unordered. | |
static void | iGeom_getNumEntSets (iGeom_Instance instance, iBase_EntitySetHandle entity_set_handle, int num_hops, int *num_sets, int *err) |
Get the number of entity sets contained in a set or interface. | |
static void | iGeom_getEntSets (iGeom_Instance instance, iBase_EntitySetHandle entity_set_handle, int num_hops, iBase_EntitySetHandle **contained_set_handles, int *contained_set_handles_allocated, int *contained_set_handles_size, int *err) |
Get the entity sets contained in a set or interface. | |
static void | iGeom_addEntToSet (iGeom_Instance instance, iBase_EntityHandle entity_handle, iBase_EntitySetHandle entity_set, int *err) |
Add an entity to a set. | |
static void | iGeom_rmvEntFromSet (iGeom_Instance instance, iBase_EntityHandle entity_handle, iBase_EntitySetHandle entity_set, int *err) |
Remove an entity from a set. | |
static void | iGeom_addEntArrToSet (iGeom_Instance instance, const iBase_EntityHandle *entity_handles, int entity_handles_size, iBase_EntitySetHandle entity_set, int *err) |
Add an array of entities to a set. | |
static void | iGeom_rmvEntArrFromSet (iGeom_Instance instance, const iBase_EntityHandle *entity_handles, int entity_handles_size, iBase_EntitySetHandle entity_set, int *err) |
Remove an array of entities from a set. | |
static void | iGeom_addEntSet (iGeom_Instance instance, iBase_EntitySetHandle entity_set_to_add, iBase_EntitySetHandle entity_set_handle, int *err) |
Add an entity set to a set. | |
static void | iGeom_rmvEntSet (iGeom_Instance instance, iBase_EntitySetHandle entity_set_to_remove, iBase_EntitySetHandle entity_set_handle, int *err) |
Remove an entity set from a set. | |
static void | iGeom_isEntContained (iGeom_Instance instance, iBase_EntitySetHandle containing_entity_set, iBase_EntityHandle contained_entity, int *is_contained, int *err) |
Return whether an entity is contained in another set. | |
static void | iGeom_isEntArrContained (iGeom_Instance instance, iBase_EntitySetHandle containing_set, const iBase_EntityHandle *entity_handles, int num_entity_handles, int **is_contained, int *is_contained_allocated, int *is_contained_size, int *err) |
Return whether entities are contained in a set. | |
static void | iGeom_isEntSetContained (iGeom_Instance instance, iBase_EntitySetHandle containing_entity_set, iBase_EntitySetHandle contained_entity_set, int *is_contained, int *err) |
Return whether an entity set is contained in another set. | |
static void | iGeom_addPrntChld (iGeom_Instance instance, iBase_EntitySetHandle parent_entity_set, iBase_EntitySetHandle child_entity_set, int *err) |
Add parent/child links between two sets. | |
static void | iGeom_rmvPrntChld (iGeom_Instance instance, iBase_EntitySetHandle parent_entity_set, iBase_EntitySetHandle child_entity_set, int *err) |
Remove parent/child links between two sets. | |
static void | iGeom_isChildOf (iGeom_Instance instance, iBase_EntitySetHandle parent_entity_set, iBase_EntitySetHandle child_entity_set, int *is_child, int *err) |
Return whether two sets are related by parent/child links. | |
static void | iGeom_getNumChld (iGeom_Instance instance, iBase_EntitySetHandle entity_set, int num_hops, int *num_child, int *err) |
Get the number of child sets linked from a specified set. | |
static void | iGeom_getNumPrnt (iGeom_Instance instance, iBase_EntitySetHandle entity_set, int num_hops, int *num_parent, int *err) |
Get the number of parent sets linked from a specified set. | |
static void | iGeom_getChldn (iGeom_Instance instance, iBase_EntitySetHandle from_entity_set, int num_hops, iBase_EntitySetHandle **entity_set_handles, int *entity_set_handles_allocated, int *entity_set_handles_size, int *err) |
Get the child sets linked from a specified set. | |
static void | iGeom_getPrnts (iGeom_Instance instance, iBase_EntitySetHandle from_entity_set, int num_hops, iBase_EntitySetHandle **entity_set_handles, int *entity_set_handles_allocated, int *entity_set_handles_size, int *err) |
Get the parent sets linked from a specified set. | |
static void | iGeom_createTag (iGeom_Instance instance, const char *tag_name, int tag_size, int tag_type, iBase_TagHandle *tag_handle, int *err, int tag_name_len) |
Create a tag with specified name, size, and type. | |
static void | iGeom_destroyTag (iGeom_Instance instance, iBase_TagHandle tag_handle, int forced, int *err) |
Destroy a tag. | |
static void | iGeom_getTagName (iGeom_Instance instance, iBase_TagHandle tag_handle, char *name, int *err, int name_len) |
Get the name for a given tag handle. | |
static void | iGeom_getTagSizeValues (iGeom_Instance instance, iBase_TagHandle tag_handle, int *tag_size, int *err) |
Get size of a tag in units of numbers of tag data type. | |
static void | iGeom_getTagSizeBytes (iGeom_Instance instance, iBase_TagHandle tag_handle, int *tag_size, int *err) |
Get size of a tag in units of bytes. | |
static void | iGeom_getTagHandle (iGeom_Instance instance, const char *tag_name, iBase_TagHandle *tag_handle, int *err, int tag_name_len) |
Get a the handle of an existing tag with the specified name. | |
static void | iGeom_getTagType (iGeom_Instance instance, iBase_TagHandle tag_handle, int *tag_type, int *err) |
Get the data type of the specified tag handle. | |
static void | iGeom_setEntSetData (iGeom_Instance instance, iBase_EntitySetHandle entity_set_handle, const iBase_TagHandle tag_handle, const void *tag_value, const int tag_value_size, int *err) |
Set a tag value of arbitrary type on an entity set. | |
static void | iGeom_setEntSetIntData (iGeom_Instance instance, iBase_EntitySetHandle entity_set, iBase_TagHandle tag_handle, int tag_value, int *err) |
Set a tag value of integer type on an entity set. | |
static void | iGeom_setEntSetDblData (iGeom_Instance instance, iBase_EntitySetHandle entity_set, iBase_TagHandle tag_handle, double tag_value, int *err) |
Set a tag value of double type on an entity set. | |
static void | iGeom_setEntSetEHData (iGeom_Instance instance, iBase_EntitySetHandle entity_set, iBase_TagHandle tag_handle, iBase_EntityHandle tag_value, int *err) |
Set a tag value of entity handle type on an entity set. | |
static void | iGeom_setEntSetESHData (iGeom_Instance instance, iBase_EntitySetHandle entity_set, iBase_TagHandle tag_handle, iBase_EntitySetHandle tag_value, int *err) |
Set a tag value of entity set handle type on an entity set. | |
static void | iGeom_getEntSetData (iGeom_Instance instance, iBase_EntitySetHandle entity_set_handle, iBase_TagHandle tag_handle, void **tag_value, int *tag_value_allocated, int *tag_value_size, int *err) |
Get the value of a tag of arbitrary type on an entity set. | |
static void | iGeom_getEntSetIntData (iGeom_Instance instance, iBase_EntitySetHandle entity_set, iBase_TagHandle tag_handle, int *out_data, int *err) |
Get the value of a tag of integer type on an entity set. | |
static void | iGeom_getEntSetDblData (iGeom_Instance instance, iBase_EntitySetHandle entity_set, iBase_TagHandle tag_handle, double *out_data, int *err) |
Get the value of a tag of double type on an entity set. | |
static void | iGeom_getEntSetEHData (iGeom_Instance instance, iBase_EntitySetHandle entity_set, iBase_TagHandle tag_handle, iBase_EntityHandle *out_data, int *err) |
Get the value of a tag of entity handle type on an entity set. | |
static void | iGeom_getEntSetESHData (iGeom_Instance instance, iBase_EntitySetHandle entity_set, iBase_TagHandle tag_handle, iBase_EntitySetHandle *out_data, int *err) |
Get the value of a tag of entity set handle type on an entity set. | |
static void | iGeom_getAllEntSetTags (iGeom_Instance instance, iBase_EntitySetHandle entity_set_handle, iBase_TagHandle **tag_handles, int *tag_handles_allocated, int *tag_handles_size, int *err) |
Get all the tags associated with a specified entity set. | |
static void | iGeom_rmvEntSetTag (iGeom_Instance instance, iBase_EntitySetHandle entity_set_handle, iBase_TagHandle tag_handle, int *err) |
Remove a tag value from an entity set. | |
static void | iGeom_getArrData (iGeom_Instance instance, const iBase_EntityHandle *entity_handles, int entity_handles_size, iBase_TagHandle tag_handle, void **tag_values, int *tag_values_allocated, int *tag_values_size, int *err) |
Get tag values of arbitrary type for an array of entities. | |
static void | iGeom_getIntArrData (iGeom_Instance instance, const iBase_EntityHandle *entity_handles, int entity_handles_size, iBase_TagHandle tag_handle, int **tag_values, int *tag_values_allocated, int *tag_values_size, int *err) |
Get tag values of integer type for an array of entities. | |
static void | iGeom_getDblArrData (iGeom_Instance instance, const iBase_EntityHandle *entity_handles, int entity_handles_size, iBase_TagHandle tag_handle, double **tag_values, int *tag_values_allocated, int *tag_values_size, int *err) |
Get tag values of double type for an array of entities. | |
static void | iGeom_getEHArrData (iGeom_Instance instance, const iBase_EntityHandle *entity_handles, int entity_handles_size, iBase_TagHandle tag_handle, iBase_EntityHandle **tag_value, int *tag_value_allocated, int *tag_value_size, int *err) |
Get tag values of entity handle type for an array of entities. | |
static void | iGeom_getESHArrData (iGeom_Instance instance, const iBase_EntityHandle *entity_handles, int entity_handles_size, iBase_TagHandle tag_handle, iBase_EntitySetHandle **tag_value, int *tag_value_allocated, int *tag_value_size, int *err) |
Get tag values of entity set handle type for an array of entities. | |
static void | iGeom_setArrData (iGeom_Instance instance, const iBase_EntityHandle *entity_handles, int entity_handles_size, iBase_TagHandle tag_handle, const void *tag_values, int tag_values_size, int *err) |
Set tag values of arbitrary type on an array of entities. | |
static void | iGeom_setIntArrData (iGeom_Instance instance, const iBase_EntityHandle *entity_handles, int entity_handles_size, iBase_TagHandle tag_handle, const int *tag_values, int tag_values_size, int *err) |
Set tag values of integer type on an array of entities. | |
static void | iGeom_setDblArrData (iGeom_Instance instance, const iBase_EntityHandle *entity_handles, int entity_handles_size, iBase_TagHandle tag_handle, const double *tag_values, const int tag_values_size, int *err) |
Set tag values of double type on an array of entities. | |
static void | iGeom_setEHArrData (iGeom_Instance instance, const iBase_EntityHandle *entity_handles, int entity_handles_size, iBase_TagHandle tag_handle, const iBase_EntityHandle *tag_values, int tag_values_size, int *err) |
Set tag values of entity handle type on an array of entities. | |
static void | iGeom_setESHArrData (iGeom_Instance instance, const iBase_EntityHandle *entity_handles, int entity_handles_size, iBase_TagHandle tag_handle, const iBase_EntitySetHandle *tag_values, int tag_values_size, int *err) |
Set tag values of entity set handle type on an array of entities. | |
static void | iGeom_rmvArrTag (iGeom_Instance instance, const iBase_EntityHandle *entity_handles, int entity_handles_size, iBase_TagHandle tag_handle, int *err) |
Remove a tag value from an array of entities. | |
static void | iGeom_getData (iGeom_Instance instance, iBase_EntityHandle entity_handle, iBase_TagHandle tag_handle, void **tag_value, int *tag_value_allocated, int *tag_value_size, int *err) |
Get the value of a tag of arbitrary type on an entity. | |
static void | iGeom_getIntData (iGeom_Instance instance, iBase_EntityHandle entity_handle, iBase_TagHandle tag_handle, int *out_data, int *err) |
Get the value of a tag of integer type on an entity. | |
static void | iGeom_getDblData (iGeom_Instance instance, const iBase_EntityHandle entity_handle, const iBase_TagHandle tag_handle, double *out_data, int *err) |
Get the value of a tag of double type on an entity. | |
static void | iGeom_getEHData (iGeom_Instance instance, iBase_EntityHandle entity_handle, iBase_TagHandle tag_handle, iBase_EntityHandle *out_data, int *err) |
Get the value of a tag of entity handle type on an entity. | |
static void | iGeom_getESHData (iGeom_Instance instance, iBase_EntityHandle entity_handle, iBase_TagHandle tag_handle, iBase_EntitySetHandle *out_data, int *err) |
Get the value of a tag of entity set handle type on an entity. | |
static void | iGeom_setData (iGeom_Instance instance, iBase_EntityHandle entity_handle, iBase_TagHandle tag_handle, const void *tag_value, int tag_value_size, int *err) |
Set a tag value of arbitrary type on an entity. | |
static void | iGeom_setIntData (iGeom_Instance instance, iBase_EntityHandle entity_handle, iBase_TagHandle tag_handle, int tag_value, int *err) |
Set a tag value of integer type on an entity. | |
static void | iGeom_setDblData (iGeom_Instance instance, iBase_EntityHandle entity_handle, iBase_TagHandle tag_handle, double tag_value, int *err) |
Set a tag value of double type on an entity. | |
static void | iGeom_setEHData (iGeom_Instance instance, iBase_EntityHandle entity_handle, iBase_TagHandle tag_handle, iBase_EntityHandle tag_value, int *err) |
Set a tag value of entity handle type on an entity. | |
static void | iGeom_setESHData (iGeom_Instance instance, iBase_EntityHandle entity_handle, iBase_TagHandle tag_handle, iBase_EntitySetHandle tag_value, int *err) |
Set a tag value of entity set handle type on an entity. | |
static void | iGeom_getAllTags (iGeom_Instance instance, iBase_EntityHandle entity_handle, iBase_TagHandle **tag_handles, int *tag_handles_allocated, int *tag_handles_size, int *err) |
Get all the tags associated with a specified entity handle. | |
static void | iGeom_rmvTag (iGeom_Instance instance, iBase_EntityHandle entity_handle, iBase_TagHandle tag_handle, int *err) |
Remove a tag value from an entity. | |
static void | iGeom_subtract (iGeom_Instance instance, iBase_EntitySetHandle entity_set_1, iBase_EntitySetHandle entity_set_2, iBase_EntitySetHandle *result_entity_set, int *err) |
Subtract contents of one entity set from another. | |
static void | iGeom_intersect (iGeom_Instance instance, iBase_EntitySetHandle entity_set_1, iBase_EntitySetHandle entity_set_2, iBase_EntitySetHandle *result_entity_set, int *err) |
Intersect contents of one entity set with another. | |
static void | iGeom_unite (iGeom_Instance instance, iBase_EntitySetHandle entity_set_1, iBase_EntitySetHandle entity_set_2, iBase_EntitySetHandle *result_entity_set, int *err) |
Unite contents of one entity set with another. | |
static void | iGeom_getFacets (iGeom_Instance instance, iBase_EntityHandle entity, double dist_tolerance, double **points, int *points_allocated, int *points_size, int **facets, int *facets_allocated, int *facets_size, int *err) |
Return facet information from solid modeling engine. |
typedef struct iGeom_Instance_Private* iGeom_Instance |
Type used to store iGeom interface handle.
Type used to store iGeom interface handle
Definition at line 70 of file iGeom_private.h.
static void iGeom_addEntArrToSet | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | entity_handles, | ||
int | entity_handles_size, | ||
iBase_EntitySetHandle | entity_set, | ||
int * | err | ||
) | [static] |
Add an array of entities to a set.
Add an array of entities to a set
instance | iGeom instance handle |
entity_handles | Array of entities being added |
entity_handles_size | Number of entities in entity_handles array |
entity_set | Pointer to the set being added to |
*err | Pointer to error type returned from function |
Add existing gentities to the gentity_set (do not create them). Note that if a gentity of dimension d>0 is added to the gentityset, the lower-dimensional gentities that bound it are not automatically associated with the gentityset.
gentity_set | Set being added to |
gentity_handles | Gentities being added to gentity_set |
Definition at line 4254 of file iGeom_CGMA.cc.
{ if (NULL == entity_set) RETURN(iBase_INVALID_ARGUMENT); RefGroup *this_set = SET_HANDLE(entity_set); RefEntity **ent_array = (RefEntity**)(entity_handles); CubitStatus status = CUBIT_SUCCESS, tmp_status; for (int i = 0; i < entity_handles_size; i++) { tmp_status = this_set->add_ref_entity(ent_array[i]); if (CUBIT_SUCCESS != tmp_status) status = tmp_status; } if (CUBIT_SUCCESS != status) { ERROR(iBase_FAILURE, "Problem adding entities to a set."); } RETURN(iBase_SUCCESS); }
static void iGeom_addEntSet | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set_to_add, | ||
iBase_EntitySetHandle | entity_set_handle, | ||
int * | err | ||
) | [static] |
Add an entity set to a set.
Add an entity set to a set
instance | iGeom instance handle |
entity_set_to_add | The entity set being added |
entity_set_handle | Pointer to the set being added to |
*err | Pointer to error type returned from function |
Allows the user to explicitly add one or more gentity_sets to another. This automatically sets the contained in relationship, but not the parent/child relationships. All gentity_set handles are automatically contained in the parent mesh interface, so passing in NULL as the first argument results in no action.
gentity_set | Set to which other sets are being added |
gentity_set_handles | Sets added to gentity_set |
Definition at line 4111 of file iGeom_CGMA.cc.
{ iGeom_addEntToSet(instance, reinterpret_cast<iBase_EntityHandle>(entity_set_to_add), entity_set_handle, err); }
static void iGeom_addEntToSet | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_to_add, | ||
iBase_EntitySetHandle | entity_set_handle, | ||
int * | err | ||
) | [static] |
Add an entity to a set.
Add an entity to a set
instance | iGeom instance handle |
entity_handle | The entity being added |
entity_set | Pointer to the set being added to |
*err | Pointer to error type returned from function |
Allows the user to explicitly add one or more gentity_sets to another. This automatically sets the contained in relationship, but not the parent/child relationships. All gentity_set handles are automatically contained in the parent mesh interface, so passing in NULL as the first argument results in no action.
gentity_set | Set to which other sets are being added |
gentity_set_handles | Sets added to gentity_set |
Definition at line 4146 of file iGeom_CGMA.cc.
{ if (NULL == entity_to_add) RETURN(iBase_INVALID_ARGUMENT); CubitStatus status = SET_HANDLE(entity_set_handle)-> add_ref_entity(const_cast<RefEntity*>(ENTITY_HANDLE(entity_to_add))); if (CUBIT_SUCCESS != status) { ERROR(iBase_FAILURE, "Problem adding entity to another set."); } RETURN(iBase_SUCCESS); }
static void iGeom_addPrntChld | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | parent_entity_set, | ||
iBase_EntitySetHandle | child_entity_set, | ||
int * | err | ||
) | [static] |
Add parent/child links between two sets.
Add parent/child links between two sets. Makes parent point to child and child point to parent.
instance | iGeom instance handle |
parent_entity_set | Pointer to parent set |
child_entity_set | Pointer to child set |
*err | Pointer to error type returned from function |
Add a parent to the gentity_set
Definition at line 1114 of file iGeom_CGMA.cc.
{ std::vector<RefGroup*> *my_parents = TM->pc_list(SET_HANDLE(child_entity_set), 0, true); std::vector<RefGroup*> *my_children = TM->pc_list(SET_HANDLE(parent_entity_set), 1, true); RefGroup *par_group = SET_HANDLE(parent_entity_set); RefGroup *child_group = SET_HANDLE(child_entity_set); my_parents->push_back(par_group); my_children->push_back(child_group); RETURN(iBase_SUCCESS); }
static void iGeom_copyEnt | ( | iGeom_Instance | instance, |
iBase_EntityHandle | source, | ||
iBase_EntityHandle * | copy, | ||
int * | err | ||
) | [static] |
Make a copy of the specified entity.
Make a copy of the specified entity
instance | iGeom instance handle |
source | entity to be copied |
copy | the newly-created entity |
*err | Pointer to error type returned from function |
Definition at line 5802 of file iGeom_CGMA.cc.
{ Body *this_body = dynamic_cast<Body*>(ENTITY_HANDLE(geom_entity)); RefVolume *this_vol = dynamic_cast<RefVolume*>(ENTITY_HANDLE(geom_entity)); if (NULL != this_vol || NULL != this_body) { // need to get the associated body, since cgm only supports copying bodies, // not volumes if (NULL == this_body) { this_body = this_vol->get_body_ptr(); if (NULL == this_body) { ERROR(iBase_FAILURE, "Can't get body from volume."); } } RefEntity *temp_entity = gmt->copy_body(this_body); *geom_entity2 = reinterpret_cast<iBase_EntityHandle>(temp_entity); } else { RefEntity *this_ent = ENTITY_HANDLE(geom_entity); RefEntity *temp_entity = gmt->copy_refentity(this_ent); *geom_entity2 = reinterpret_cast<iBase_EntityHandle>(temp_entity); } if (NULL == *geom_entity2) { ERROR(iBase_FAILURE, "NULL returned from CGM copy."); } RETURN(iBase_SUCCESS); }
static void iGeom_createBrick | ( | iGeom_Instance | instance, |
double | x, | ||
double | y, | ||
double | z, | ||
iBase_EntityHandle * | geom_entity, | ||
int * | err | ||
) | [static] |
Create an axis-oriented box.
Create an axis-oriented box of the given dimensions, centered at the origin.
instance | iGeom instance handle |
x | x dimension of new box |
y | y dimension of new box |
z | z dimension of new box |
geom_entity | Pointer to new entity handle returned from function |
*err | Pointer to error type returned from function |
Definition at line 5972 of file iGeom_CGMA.cc.
{ double tmp_x = x; double tmp_y = y; double tmp_z = z; if (0.0 == y && 0.0 == z) { tmp_y = x; tmp_z = x; } if (0.0 >= tmp_x || 0.0 >= tmp_y || 0.0 >= tmp_z) { ERROR(iBase_INVALID_ARGUMENT, "Dimensions must be >= 0, or y & z must both be zero."); } RefEntity *temp_body = gmt->brick(tmp_x, tmp_y, tmp_z); *geom_entity = reinterpret_cast<iBase_EntityHandle>(temp_body); if (NULL == *geom_entity) { RETURN(iBase_FAILURE); } RETURN(iBase_SUCCESS); }
static void iGeom_createCone | ( | iGeom_Instance | instance, |
double | height, | ||
double | major_rad_base, | ||
double | minor_rad_base, | ||
double | rad_top, | ||
iBase_EntityHandle * | geom_entity, | ||
int * | err | ||
) | [static] |
Create a cone or tapered cylinder.
Create a cone parallel to the z-axis and centered at the origin (so that its z-coordinate extents are +height/2 and -height/2). The 'base' of the cylinder is at z = -height/2, and the top is at +height/2.
instance | iGeom instance handle |
height | The height of the cone. |
major_rad_base | The x-axis radius at the base of the cylinder |
minor_rad_base | The y-axis radius at the base. If minor_rad_base is 0, the cylinder will be circular (as if minor_rad_base == major_rad_base) |
rad_top | The x-axis radius at the top of the cone. The y-axis radius at the top of the cone will be inferred to keep the aspect ratio of the top of the cone the same as the bottom. If rad_top is 0, the cone terminates at a point. |
geom_entity | Pointer to new entity handle returned from function |
*err | Pointer to error type returned from function |
Definition at line 6024 of file iGeom_CGMA.cc.
{ double tmp_minor = (0.0 == minor_rad_base ? major_rad_base : minor_rad_base); RefEntity *temp_body = gmt->cylinder(height, major_rad_base, tmp_minor, rad_top); *geom_entity = reinterpret_cast<iBase_EntityHandle>(temp_body); if (NULL == *geom_entity) { RETURN(iBase_FAILURE); } RETURN(iBase_SUCCESS); }
static void iGeom_createCylinder | ( | iGeom_Instance | instance, |
double | height, | ||
double | major_rad, | ||
double | minor_rad, | ||
iBase_EntityHandle * | geom_entity, | ||
int * | err | ||
) | [static] |
Create a cylinder.
Create a cylinder parallel to the z-axis and centered at the origin (so that its z-coordinate extents are +height/2 and -height/2).
instance | iGeom instance handle |
height | The height of the cylinder. |
major_rad | The x-axis radius |
minor_rad | The y-axis radius. If minor_rad is 0, the cylinder will be circular (as if minor_rad == major_rad). |
geom_entity | Pointer to new entity handle returned from function |
*err | Pointer to error type returned from function |
Definition at line 6003 of file iGeom_CGMA.cc.
{ double tmp_minor = (0.0 == minor_rad ? major_rad : minor_rad); RefEntity *temp_body = gmt->cylinder(height, major_rad, tmp_minor, major_rad); *geom_entity = reinterpret_cast<iBase_EntityHandle>(temp_body); if (NULL == *geom_entity) { RETURN(iBase_FAILURE); } RETURN(iBase_SUCCESS); }
static void iGeom_createEntSet | ( | iGeom_Instance | instance, |
int | isList, | ||
iBase_EntitySetHandle * | entity_set, | ||
int * | err | ||
) | [static] |
Create an entity set.
Create an entity set, either ordered (isList=1) or unordered (isList=0). Unordered entity sets can contain a given entity or set only once.
instance | iGeom instance handle |
isList | If non-zero, an ordered list is created, otherwise an unordered set is created. |
entity_set_created | Entity set created by function |
*err | Pointer to error type returned from function |
This function allows a new gentity_set to be created. The user may set the multiset, ordered, isMesh, flags as needed; otherwise default values (all false) will be used. On creation, Entitysets are empty of entities and contained in the parent geometry interface. They must be explicitly filled with entities using the addGentities call and relationships with other Entitysets must be done through the addEntityset and parent/child relationship calls.
multiset | If true, gentities can appear more than once in this gentity_set |
ordered | If true, order of addition and removal is maintained for this gentity_set |
gentity_set_created | Entity_set created by this function |
Definition at line 4049 of file iGeom_CGMA.cc.
{ RefGroup* grp = RefEntityFactory::instance()->construct_RefGroup(); *entity_set = reinterpret_cast<iBase_EntitySetHandle>(grp); // need to set a tag denoting multiset or not... if (*entity_set == NULL) { RETURN(iBase_FAILURE); } else { RETURN(iBase_SUCCESS); } }
static void iGeom_createPrism | ( | iGeom_Instance | instance, |
double | height, | ||
int | n_sides, | ||
double | major_rad, | ||
double | minor_rad, | ||
iBase_EntityHandle * | geom_entity, | ||
int * | err | ||
) | [static] |
Create a prism.
Create a prism parallel to the z-axis and centered at the origin (so that its z-coordinate extents are +height/2 and -height/2).
instance | iGeom instance handle |
height | height of new prism |
n_sides | number of sides of new prism |
major_rad | major radius of new prism |
minor_rad | minor radius of new prism |
geom_entity | Pointer to new entity handle returned from function |
*err | Pointer to error type returned from function |
Definition at line 5951 of file iGeom_CGMA.cc.
{ if ( 0.0>=height ) { ERROR(iBase_INVALID_ARGUMENT, "Prism height must be positive."); } else if ( 3>n_sides ) { ERROR(iBase_INVALID_ARGUMENT, "Prism must have at least three sides."); } RefEntity* tmp_body = gmt->prism( height, n_sides, major_rad, minor_rad ); *geom_entity = reinterpret_cast<iBase_EntityHandle>(tmp_body); RETURN ((tmp_body ? iBase_SUCCESS :iBase_FAILURE)); }
static void iGeom_createSphere | ( | iGeom_Instance | instance, |
double | radius, | ||
iBase_EntityHandle * | geom_entity, | ||
int * | err | ||
) | [static] |
Create a sphere.
Create a sphere of the specified radius centered on the origin.
instance | iGeom instance handle |
radius | radius of the sphere |
geom_entity | Pointer to new entity handle returned from function |
*err | Pointer to error type returned from function |
Definition at line 5935 of file iGeom_CGMA.cc.
{ if (radius <= 0.0) { ERROR(iBase_INVALID_ARGUMENT, "Sphere radius must be must be positive."); } RefEntity* tmp_body = gmt->sphere( radius ); *geom_entity = reinterpret_cast<iBase_EntityHandle>(tmp_body); RETURN ((tmp_body ? iBase_SUCCESS : iBase_FAILURE)); }
static void iGeom_createTag | ( | iGeom_Instance | instance, |
const char * | tag_name, | ||
int | tag_size, | ||
int | tag_type, | ||
iBase_TagHandle * | tag_handle, | ||
int * | err, | ||
int | tag_name_len | ||
) | [static] |
Create a tag with specified name, size, and type.
Create a tag with specified name, size, and type. Tag size is in units of size of tag_type data types. Value input for tag type must be value in iBase_TagType enumeration.
instance | iGeom instance handle |
tag_name | Character string indicating tag name |
tag_size | Size of each tag value, in units of number of tag_type entities |
tag_type | Data type for data stored in this tag |
tag_handle | Pointer to tag handle returned from function |
*err | Pointer to error type returned from function |
tag_name_len | Length of tag name string |
Create a tag handle with a given name, size (in bytes), and default value. The tag name is a unique string; if it duplicates an existing tag name, an error is returned. The tag_handle is returned as an opaque value which is not associated with any mesh gentities until explicitly done so through one of the 'AddTag' functions defined later. The implementation is assumed to allocate memory as needed to store the tag data.
Definition at line 1516 of file iGeom_CGMA.cc.
{ long new_tag; int this_size = tag_size; switch (tag_type) { case iBase_INTEGER: this_size *= sizeof(int); break; case iBase_DOUBLE: this_size *= sizeof(double); break; case iBase_ENTITY_HANDLE: this_size *= sizeof(iBase_EntityHandle); break; case iBase_ENTITY_SET_HANDLE: this_size *= sizeof(iBase_EntitySetHandle); break; case iBase_BYTES: break; } // make sure string is null terminated std::string name_buf( tag_name, tag_name_len ); tag_name = name_buf.c_str(); iBase_ErrorType retval = TM->createTag(tag_name, this_size, tag_type, NULL, &new_tag); *tag_handle = (iBase_TagHandle) new_tag; RETURN(retval); }
static void iGeom_createTorus | ( | iGeom_Instance | instance, |
double | major_rad, | ||
double | minor_rad, | ||
iBase_EntityHandle * | geom_entity, | ||
int * | err | ||
) | [static] |
Create a torus.
Create a torus centered on the origin and encircling the z-axis.
instance | iGeom instance handle |
major_rad | The distance from the origin to the center of the torus's circular cross-section. |
minor_rad | The radius of the cross-section. |
geom_entity | Pointer to new entity handle returned from function |
*err | Pointer to error type returned from function |
Definition at line 6046 of file iGeom_CGMA.cc.
{ if (minor_rad >= major_rad) { ERROR(iBase_INVALID_ARGUMENT, "Major radius must be greater than minor radius for tori."); } RefEntity *temp_body = gmt->torus(major_rad, minor_rad); *geom_entity = reinterpret_cast<iBase_EntityHandle>(temp_body); if (NULL == *geom_entity) { RETURN(iBase_FAILURE); } RETURN(iBase_SUCCESS); }
static void iGeom_deleteAll | ( | iGeom_Instance | instance, |
int * | err | ||
) | [static] |
Delete all entities and sets.
Delete all entities and sets
instance | iGeom instance handle |
*err | Pointer to error type returned from function |
Definition at line 5895 of file iGeom_CGMA.cc.
{ GeometryQueryTool::instance()->delete_geometry(); *err = iBase_SUCCESS; }
static void iGeom_deleteEnt | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
int * | err | ||
) | [static] |
Delete specified entity.
Delete specified entity
instance | iGeom instance handle |
entity_handle | Entity to be deleted |
*err | Pointer to error type returned from function |
Definition at line 5904 of file iGeom_CGMA.cc.
{ RefEntity *this_ent = ENTITY_HANDLE(geom_entity); // special case: if this is a volume, delete the body instead CubitStatus result; RefVolume *this_vol = CAST_TO(this_ent, RefVolume); if (NULL != this_vol) result = gqt->delete_Body(this_vol->body()); else result = gqt->delete_RefEntity(this_ent); if (CUBIT_FAILURE == result) { ERROR(iBase_FAILURE, "Problems deleting entity."); } // check to see if this was last thing deleted; if so, reset ids RefEntityFactory *rfi = RefEntityFactory::instance(); if (rfi->num_bodies() == 0 && rfi->num_ref_volumes() == 0 && rfi->num_ref_faces() == 0 && rfi->num_ref_edges() == 0 && rfi->num_ref_vertices() == 0) rfi->reset_ids(); RETURN(iBase_SUCCESS); }
static void iGeom_destroyEntSet | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set, | ||
int * | err | ||
) | [static] |
Destroy an entity set.
Destroy an entity set
instance | iGeom instance handle |
entity_set | Entity set to be destroyed |
*err | Pointer to error type returned from function |
Destroy the gentity set. This method only destroys the grouping of gentities, not the gentities themselves.
gentity_set | Entity_set to be destroyed |
Definition at line 4072 of file iGeom_CGMA.cc.
{ if (NULL == entity_set) { ERROR(iBase_INVALID_ARGUMENT, "Can't destroy interface set."); } CubitStatus result = RefGroup::delete_group(SET_HANDLE(entity_set)); if (CUBIT_SUCCESS == result) { RETURN(iBase_SUCCESS); } else { RETURN(iBase_FAILURE); } }
static void iGeom_destroyTag | ( | iGeom_Instance | instance, |
iBase_TagHandle | tag_handle, | ||
int | forced, | ||
int * | err | ||
) | [static] |
Destroy a tag.
Destroy a tag. If forced is non-zero and entities still have values set for this tag, tag is deleted anyway and those values disappear, otherwise tag is not deleted.
instance | iGeom instance handle |
tag_handle | Handle of tag to be deleted |
forced | If non-zero, delete the tag even if entities have values set for that tag |
*err | Pointer to error type returned from function |
Delete a tag handle and the data associated with that tag. The deletion can be forced or not forced. If the deletion is forced, the tag and all of its associated data are deleted from the implementation even if the tag is still associated with mesh gentities. If the deletion is not forced, the tag will not be deleted if it is still associated with one or more mesh gentities. In this case an error is returned asking the user to remove the tag from that gentity before deleting it. If the underlying implementation does not support the requested deletion mechanism, an error will be returned.
Definition at line 1565 of file iGeom_CGMA.cc.
{ iBase_ErrorType retval = TM->destroyTag(TAG_HANDLE(tag_handle), forced); RETURN(retval); }
static void iGeom_dtor | ( | iGeom_Instance | instance, |
int * | err | ||
) | [static] |
Destroy an iGeom instance.
Destroy an iGeom instance
instance | iGeom instance to be destroyed |
*err | Pointer to error type returned from function |
Definition at line 630 of file iGeom_CGMA.cc.
{ if (NULL == TM) ERROR(iBase_INVALID_ARGUMENT, "NUll Instance"); // delete TM; // shut down CGM CGMApp::instance()->shutdown(); RETURN(iBase_SUCCESS); }
static void iGeom_endEntArrIter | ( | iGeom_Instance | instance, |
iBase_EntityArrIterator | entArr_iterator, | ||
int * | err | ||
) | [static] |
Destroy the specified array iterator.
Destroy the specified array iterator
instance | iGeom instance handle |
entArr_iterator | Iterator which gets destroyed |
*err | Pointer to error type returned from function |
Definition at line 979 of file iGeom_CGMA.cc.
{ CGMAIterator* iterator = reinterpret_cast<CGMAIterator*>(gentity_iterator); delete iterator; RETURN(iBase_SUCCESS); }
static void iGeom_endEntIter | ( | iGeom_Instance | instance, |
iBase_EntityIterator | gentity_iterator, | ||
int * | err | ||
) | [static] |
Destroy the specified iterator.
Destroy the specified iterator
instance | iGeom instance handle |
entity_iterator | Iterator which gets destroyed |
*err | Pointer to error type returned from function |
Delete an iterator
gentity_iterator | Iterator deleted by this function |
Definition at line 969 of file iGeom_CGMA.cc.
{ CGMAIterator* iterator = reinterpret_cast<CGMAIterator*>(gentity_iterator); delete iterator; RETURN(iBase_SUCCESS); }
static void iGeom_getAllEntSetTags | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set, | ||
iBase_TagHandle ** | tag_handles, | ||
int * | tag_handles_allocated, | ||
int * | tag_handles_size, | ||
int * | err | ||
) | [static] |
Get all the tags associated with a specified entity set.
Get all the tags associated with a specified entity set
instance | iGeom instance handle |
entity_set_handle | Entity being queried |
*tag_handles | Pointer to array of tag_handles returned from function |
*tag_handles_allocated | Pointer to allocated size of tag_handles array |
*tag_handles_size | Pointer to occupied size of tag_handles array |
*err | Pointer to error type returned from function |
Get all tag handles associated with a given mesh or gentity_set.
Definition at line 2050 of file iGeom_CGMA.cc.
{ // have to go through RefEntity* so that RefEntity** gets set right const RefEntity *tmp_entity = SET_HANDLE(entity_set); iBase_ErrorType retval = TM->getAllTags(tmp_entity,TAG_HANDLE_ARRAY_INOUT(tag_handles)); RETURN(retval); }
static void iGeom_getAllTags | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
iBase_TagHandle ** | tag_handles, | ||
int * | tag_handles_allocated, | ||
int * | tag_handles_size, | ||
int * | err | ||
) | [static] |
Get all the tags associated with a specified entity handle.
Get all the tags associated with a specified entity handle
instance | iGeom instance handle |
entity_handle | Entity being queried |
*tag_handles | Pointer to array of tag_handles returned from function |
*tag_handles_allocated | Pointer to allocated size of tag_handles array |
*tag_handles_size | Pointer to occupied size of tag_handles array |
*err | Pointer to error type returned from function |
Get all tag handles associated with a given gentity.
Definition at line 1698 of file iGeom_CGMA.cc.
{ iBase_ErrorType retval = TM->getAllTags(SET_HANDLE(entity_handle), TAG_HANDLE_ARRAY_INOUT(tag_handles)); RETURN(retval); }
static void iGeom_getArr1stDrvt | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | entity_handles, | ||
int | entity_handles_size, | ||
int | storage_order, | ||
double const * | uv, | ||
int | uv_size, | ||
double ** | dvrt_u, | ||
int * | dvrt_u_allocated, | ||
int * | dvrt_u_size, | ||
int ** | u_offset, | ||
int * | u_offset_allocated, | ||
int * | u_offset_size, | ||
double ** | dvrt_v, | ||
int * | dvrt_v_allocated, | ||
int * | dvrt_v_size, | ||
int ** | v_offset, | ||
int * | v_offset_allocated, | ||
int * | v_offset_size, | ||
int * | err | ||
) | [static] |
Get the first derivatives of faces at specified parametric positions.
Get the first derivatives of faces at specified parametric positions. storage_order should be a value in the iBase_StorageOrder enum.
instance | iGeom instance handle |
entity_handles | Array of entity handles being queried |
entity_handles_size | Number of entities in entity_handles array |
storage_order | Storage order of coordinates input and output |
uv | Parametric coordinates being queried |
uv_size | Number of coordinates in array |
dvrt_u | Pointer to array of coordinates of derivative with respect to u at specified position returned from function |
dvrt_u_allocated | Allocated size of dvrt_u array |
dvrt_u_size | Occupied size of dvrt_u array |
u_offset | Pointer to array of offsets for dvrt_u returned from function |
u_offset_allocated | Pointer to allocated size of u_offset array |
u_offset_size | Pointer to occupied size of u_offset array |
dvrt_v | Pointer to array of coordinates of derivative with respect to v at specified position returned from function |
dvrt_v_allocated | Allocated size of dvrt_v array |
dvrt_v_size | Occupied size of dvrt_v array |
v_offset | Pointer to array of offsets for dvrt_v returned from function |
v_offset_allocated | Pointer to allocated size of v_offset array |
v_offset_size | Pointer to occupied size of v_offset array |
*err | Pointer to error type returned from function |
Definition at line 5477 of file iGeom_CGMA.cc.
{ if (2*entity_handles_size != uv_size) { ERROR(iBase_INVALID_ENTITY_COUNT, "Mismatched input array sizes."); RETURN(iBase_INVALID_ENTITY_COUNT); } ALLOC_CHECK_ARRAY( drvt_u, 3*entity_handles_size ); ALLOC_CHECK_ARRAY( drvt_v, 3*entity_handles_size ); ALLOC_CHECK_ARRAY( u_offset, entity_handles_size+1 ); ALLOC_CHECK_ARRAY( v_offset, entity_handles_size+1 ); size_t u_step, du_step, init; if (storage_order == iBase_BLOCKED) { u_step = du_step = 1; init = entity_handles_size; } else { storage_order = iBase_INTERLEAVED; u_step = 2; du_step = 3; init = 1; } const double *u = uv; const double *v = u + init; double *du_x = *drvt_u; double *du_y = du_x + init; double *du_z = du_y + init; double *dv_x = *drvt_v; double *dv_y = dv_x + init; double *dv_z = dv_y + init; int off = 0; RefEntity** entities = (RefEntity**)entity_handles; for (int i = 0; i < entity_handles_size; ++i) { RefFace* face = dynamic_cast<RefFace*>(entities[i]); if (!face) { ERROR( iBase_INVALID_ENTITY_TYPE, "Derivatives only for faces." ); } CubitVector du, dv; CubitStatus s = face->get_surface_ptr()->uv_derivitives( *u, *v, du, dv ); if (s != CUBIT_SUCCESS) { RETURN(iBase_FAILURE); } du.get_xyz( *du_x, *du_y, *du_z ); dv.get_xyz( *dv_x, *dv_y, *dv_z ); u += u_step; v += u_step; du_x += du_step; du_y += du_step; du_z += du_step; dv_x += du_step; dv_y += du_step; dv_z += du_step; (*u_offset)[i] = off; (*v_offset)[i] = off; off += du_step; } (*u_offset)[entity_handles_size] = off; (*v_offset)[entity_handles_size] = off; KEEP_ARRAY( drvt_u ); KEEP_ARRAY( drvt_v ); KEEP_ARRAY( u_offset ); KEEP_ARRAY( v_offset ); RETURN(iBase_SUCCESS); }
static void iGeom_getArr2ndAdj | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | entity_handles, | ||
int | entity_handles_size, | ||
int | order_adjacent_key, | ||
int | requested_entity_type, | ||
iBase_EntityHandle ** | adj_entity_handles, | ||
int * | adj_entity_handles_allocated, | ||
int * | adj_entity_handles_size, | ||
int ** | offset, | ||
int * | offset_allocated, | ||
int * | offset_size, | ||
int * | err | ||
) | [static] |
Get "2nd order" adjacencies to an array of entities.
Get "2nd order" adjacencies to an array of entities, that is, from each entity, through other entities of a specified "bridge" dimension, to other entities of another specified "to" dimension.
instance | iGeom instance handle |
entity_handles | Entities from which adjacencies are requested |
entity_handles_size | Number of entities whose adjacencies are requested |
bridge_dimension | Bridge dimension for 2nd order adjacencies |
to_dimension | Dimension of adjacent entities returned |
adj_entity_handles | Adjacent entities |
adj_entity_handles_allocated | Allocated size of returned array |
adj_entity_handles_size | Occupied size of returned array |
offset | Offset[i] is offset into adj_entity_handles of 2nd order adjacencies of ith entity in entity_handles |
offset_allocated | Allocated size of offset array |
offset_size | Occupied size of offset array |
*err | Pointer to error type returned from function |
Definition at line 1388 of file iGeom_CGMA.cc.
{ ALLOC_CHECK_ARRAY(offset, entity_handles_size+1); DLIList<RefEntity*> bridge_list, temp_list, entity_list, total_list; for (int i = 0; i < entity_handles_size; ++i) { bridge_list.clean_out(); entity_list.clean_out(); iGeom_get_adjacent_entities( (RefEntity*)(entity_handles[i]), order_adjacent_key, bridge_list, err ); if (iBase_SUCCESS != *err) return; bridge_list.reset(); for (int j = bridge_list.size(); j > 0; --j) { temp_list.clean_out(); iGeom_get_adjacent_entities( bridge_list.get_and_step(), requested_entity_type, temp_list, err ); if (iBase_SUCCESS != *err) return; entity_list += temp_list; } entity_list.uniquify_unordered(); (*offset)[i] = total_list.size(); total_list += entity_list; } (*offset)[entity_handles_size] = total_list.size(); ALLOC_CHECK_ARRAY_NOFAIL(adj_entity_handles, total_list.size()); total_list.copy_to((RefEntity**)*adj_entity_handles); KEEP_ARRAY(offset); RETURN(iBase_SUCCESS); }
static void iGeom_getArr2ndDrvt | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | entity_handles, | ||
int | entity_handles_size, | ||
int | storage_order, | ||
double const * | uv, | ||
int | uv_size, | ||
double ** | dvtr_uu, | ||
int * | dvrt_uu_allocated, | ||
int * | dvrt_uu_size, | ||
int ** | uu_offset, | ||
int * | uu_offset_allocated, | ||
int * | uu_offset_size, | ||
double ** | dvtr_vv, | ||
int * | dvrt_vv_allocated, | ||
int * | dvrt_vv_size, | ||
int ** | vv_offset, | ||
int * | vv_offset_allocated, | ||
int * | vv_offset_size, | ||
double ** | dvrt_uv, | ||
int * | dvrt_uv_allocated, | ||
int * | dvrt_uv_size, | ||
int ** | uv_offset, | ||
int * | uv_offset_allocated, | ||
int * | uv_offset_size, | ||
int * | err | ||
) | [static] |
Get the second derivatives of faces at specified parametric positions.
Get the second derivatives of faces at specified parametric positions. storage_order should be a value in the iBase_StorageOrder enum.
instance | iGeom instance handle |
entity_handles | Array of entity handles being queried |
entity_handles_size | Number of entities in entity_handles array |
storage_order | Storage order of coordinates input and output |
uv | Parametric coordinates being queried |
uv_size | Number of coordinates in array |
dvrt_uu | Pointer to array of coordinates of derivative with respect to u at specified position returned from function |
dvrt_uu_allocated | Allocated size of dvrt_uu array |
dvrt_uu_size | Occupied size of dvrt_uu array |
uu_offset | Pointer to array of offsets for dvrt_uu returned from function |
uu_offset_allocated | Pointer to allocated size of uu_offset array |
uu_offset_size | Pointer to occupied size of uu_offset array |
dvrt_vv | Pointer to array of coordinates of derivative with respect to v at specified position returned from function |
dvrt_vv_allocated | Allocated size of dvrt_vv array |
dvrt_vv_size | Occupied size of dvrt_vv array |
vv_offset | Pointer to array of offsets for dvrt_vv returned from function |
vv_offset_allocated | Pointer to allocated size of vv_offset array |
vv_offset_size | Pointer to occupied size of vv_offset array |
dvrt_uv | Pointer to array of coordinates of derivative with respect to u and v at specified position returned from function |
dvrt_uv_allocated | Allocated size of dvrt_uv array |
dvrt_uv_size | Occupied size of dvrt_uv array |
uv_offset | Pointer to array of offsets for dvrt_uv returned from function |
uv_offset_allocated | Pointer to allocated size of uv_offset array |
uv_offset_size | Pointer to occupied size of uv_offset array |
*err | Pointer to error type returned from function |
Definition at line 5585 of file iGeom_CGMA.cc.
{ RETURN(iBase_NOT_SUPPORTED); }
static void iGeom_getArrAdj | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | entity_handles, | ||
int | entity_handles_size, | ||
int | requested_entity_type, | ||
iBase_EntityHandle ** | adj_entity_handles, | ||
int * | adj_entity_handles_allocated, | ||
int * | adj_entity_handles_size, | ||
int ** | offset, | ||
int * | offset_allocated, | ||
int * | offset_size, | ||
int * | err | ||
) | [static] |
Get entities of specified type adjacent to entities.
Get entities of specified type adjacent to entities. Specified type must be value in the iBase_EntityType enumeration. offset(i) is index of first entity in adjacentEntityHandles array adjacent to entity_handles[i].
instance | iGeom instance handle |
entity_handles | Array of entity handles being queried |
entity_handles_size | Number of entities in entity_handles array |
entity_type_requested | Type of adjacent entities requested |
*adjacentEntityHandles | Pointer to array of adjacentEntityHandles returned from function |
*adjacentEntityHandles_allocated | Pointer to allocated size of adjacentEntityHandles array |
*adj_entity_handles_size | Pointer to occupied size of adjacentEntityHandles array |
*offset | Pointer to array of offsets returned from function |
*offset_allocated | Pointer to allocated size of offset array |
*offset_size | Pointer to occupied size of offset array |
*err | Pointer to error type returned from function |
Definition at line 1312 of file iGeom_CGMA.cc.
{ ALLOC_CHECK_ARRAY(offset, entity_handles_size+1); DLIList<RefEntity*> temp_list, total_list; for (int i = 0; i < entity_handles_size; ++i) { (*offset)[i] = total_list.size(); temp_list.clean_out(); iGeom_get_adjacent_entities( (RefEntity*)(entity_handles[i]), requested_entity_type, temp_list, err ); if (iBase_SUCCESS != *err) return; total_list += temp_list; } (*offset)[entity_handles_size] = total_list.size(); ALLOC_CHECK_ARRAY_NOFAIL(adj_entity_handles, total_list.size()); total_list.copy_to((RefEntity**)*adj_entity_handles); KEEP_ARRAY(offset); RETURN(iBase_SUCCESS); }
static void iGeom_getArrBoundBox | ( | iGeom_Instance | instance, |
const iBase_EntityHandle * | gentity_handles, | ||
int | gentity_handles_size, | ||
int | storage_order, | ||
double ** | min_corner, | ||
int * | min_corner_allocated, | ||
int * | min_corner_size, | ||
double ** | max_corner, | ||
int * | max_corner_allocated, | ||
int * | max_corner_size, | ||
int * | err | ||
) | [static] |
Get the bounding box of the specified entities.
Get the bounding box of the specified entities. Storage order passed in should be a member of iBase_StorageOrder enum.
instance | iGeom instance handle |
entity_handles | Entity handles being queried |
enttiy_handles_size | Number of entities being queried |
storage_order | Storage order of coordinates passed back |
min_corner | Minimum coordinates of bounding boxes |
min_corner_allocated | Allocated size of minimum coordinates array |
min_corner_size | Occupied size of minimum coordinates array |
max_corner | Maximum coordinates of bounding boxes |
max_corner_allocated | Allocated size of maximum coordinates array |
max_corner_size | Occupied size of maximum coordinates array |
*err | Pointer to error type returned from function |
Return the bounding boxex of given entities; coordinates returned interleaved.
gentity_handles | The gentities being queried |
min_corners | Minimum corner coordinates of the boxes, interleaved |
max_corners | Maximum corner coordinates of the boxes, interleaved |
Definition at line 3337 of file iGeom_CGMA.cc.
{ // check or pre-allocate the coordinate arrays ALLOC_CHECK_ARRAY(min_corner, 3*gentity_handles_size); ALLOC_CHECK_ARRAY(max_corner, 3*gentity_handles_size); size_t step, init; if (storage_order == iBase_BLOCKED) { step = 1; init = gentity_handles_size; } else { step = 3; init = 1; } double *min_x, *min_y, *min_z, *max_x, *max_y, *max_z; min_x = *min_corner; max_x = *max_corner; min_y = min_x + init; max_y = max_x + init; min_z = min_y + init; max_z = max_y + init; iBase_ErrorType result = iBase_SUCCESS; RefEntity** entities = (RefEntity**)gentity_handles; for (int i = 0; i < gentity_handles_size; ++i) { CubitVector min_c, max_c; CubitStatus s = iGeom_bounding_box( entities[i], min_c, max_c ); if (s != CUBIT_SUCCESS) result = iBase_FAILURE; min_c.get_xyz( *min_x, *min_y, *min_z ); max_c.get_xyz( *max_x, *max_y, *max_z ); min_x += step; max_x += step; min_y += step; max_y += step; min_z += step; max_z += step; } KEEP_ARRAY(min_corner); KEEP_ARRAY(max_corner); RETURN(result); }
static void iGeom_getArrClosestPt | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | gentity_handles, | ||
int | gentity_handles_size, | ||
int | storage_order, | ||
const double * | near_coordinates, | ||
int | near_coordinates_size, | ||
double ** | on_coordinates, | ||
int * | on_coordinates_allocated, | ||
int * | on_coordinates_size, | ||
int * | err | ||
) | [static] |
Get closest point for an array of entities and points For surfaces, it made sure the closest point in on surface. Get closest point for an array of entities and points. If either the number of entities or number of coordinate triples is unity, then all points or entities are queried for that entity or point, respectively, otherwise each point corresponds to each entity. storage_order should be a value in the iBase_StorageOrder enum.
instance | iGeom instance handle |
entity_handles | Entity(ies) being queried |
entity_handles_size | Number of entities being queried |
storage_order | Storage order of input points |
near_coordinates | Coordinates of starting point(s) |
near_coordinates_size | Number of values in near_coordinates array |
on_coordinates | Coordinates of closest points |
on_coordinates_allocated | Allocated size of closest point array |
on_coordinates_size | Occupied size of closest point array |
*err | Pointer to error type returned from function |
Return a points on specified entities closest to specified points in space. Input coordinates and output points are interleaved in the arrays.
gentity_handles | The gentities being queried |
near_coordinates | Input coordinates |
on_coordinates | Closest point on gentity |
Definition at line 2254 of file iGeom_CGMA.cc.
{ /* set up iteration according to storage order. allow either gentity_handles or near_coordinates to contain only one value, where that single value is applied for every entry in the other list. */ size_t near_step, on_step = 1, ent_step; int count; if (3*gentity_handles_size == near_coordinates_size) { near_step = ent_step = 1; count = gentity_handles_size; } else if (near_coordinates_size == 3) { near_step = 0; ent_step = 1; count = gentity_handles_size; } else if (gentity_handles_size == 1) { near_step = 1; ent_step = 0; count = near_coordinates_size / 3; } else { ERROR( iBase_INVALID_ENTITY_COUNT, "Mismatched array sizes" ); } ALLOC_CHECK_ARRAY( on_coordinates, 3*count ); const double *near_x, *near_y, *near_z; double *on_x, *on_y, *on_z; if (storage_order == iBase_BLOCKED) { near_x = near_coordinates; near_y = near_x + near_coordinates_size/3; near_z = near_y + near_coordinates_size/3; on_x = *on_coordinates; on_y = on_x + count; on_z = on_y + count; on_step = 1; } else { storage_order = iBase_INTERLEAVED; /* set if unspecified */ near_x = near_coordinates; near_y = near_x+1; near_z = near_x+2; on_x = *on_coordinates; on_y = on_x+1; on_z = on_x+2; near_step *= 3; on_step = 3; } RefEntity** ent_iter = (RefEntity**)(gentity_handles); CubitStatus final_result = CUBIT_SUCCESS; for (int i = 0; i < count; ++i) { CubitVector on, near( *near_x, *near_y, *near_z ); CubitStatus status = iGeom_closest_point( *ent_iter, near, on ); if (status != CUBIT_SUCCESS) final_result = status; on.get_xyz( *on_x, *on_y, *on_z ); ent_iter += ent_step; near_x += near_step; near_y += near_step; near_z += near_step; on_x += on_step; on_y += on_step; on_z += on_step; } if (final_result == CUBIT_FAILURE) { ERROR(iBase_FAILURE, "Problems getting closest point for some entity."); } KEEP_ARRAY(on_coordinates); RETURN(iBase_SUCCESS); }
static void iGeom_getArrData | ( | iGeom_Instance | instance, |
const iBase_EntityHandle * | entity_handles, | ||
int | entity_handles_size, | ||
iBase_TagHandle | tag_handle, | ||
void ** | tag_values, | ||
int * | tag_values_allocated, | ||
int * | tag_values_size, | ||
int * | err | ||
) | [static] |
Get tag values of arbitrary type for an array of entities.
Get tag values of arbitrary type for an array of entities. Tag data is returned as void*. tag_values_size specifies the size of the memory pointed to by tag_values in terms of bytes. Applications may use this function to get data of any type, not just iBase_BYTES. However, because this function supports data of arbitrary type, in all cases the size specified by tag_values_size always in terms of bytes.
instance | iGeom instance handle |
entity_handles | Entity array on which tag is being set |
entity_handles_size | Number of entities in array |
tag_handle | Tag being set on an entity |
*tag_values | Pointer to tag data array being returned from function. Note that the implicit INTERLEAVED storage order rule applies (see section ITAPS Storage Orders) |
tag_values_allocated | Pointer to allocated size of tag data array |
tag_values_size | Pointer to occupied size in bytes of tag data array |
*err | Pointer to error type returned from function |
Definition at line 1711 of file iGeom_CGMA.cc.
{ char **tag_value = reinterpret_cast<char**>(tag_value_tmp); iBase_ErrorType retval = TM->getArrData(reinterpret_cast<RefEntity*const*>(entity_handles), entity_handles_size, TAG_HANDLE(tag_handle), ARRAY_INOUT(tag_value)); RETURN(retval); }
static void iGeom_getArrEgEvalXYZ | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | edge_handles, | ||
int | edge_handles_size, | ||
int | storage_order, | ||
double const * | coords, | ||
int | coords_size, | ||
double ** | on_coords, | ||
int * | on_coords_allocated, | ||
int * | on_coords_size, | ||
double ** | tangent, | ||
int * | tangent_allocated, | ||
int * | tangent_size, | ||
double ** | cvtr, | ||
int * | cvtr_allocated, | ||
int * | cvtr_size, | ||
int * | err | ||
) | [static] |
Get the closest point(s), tangent(s), and curvature(s) on an entity(ies) at given position(s)
Get the closest point(s), tangent(s), and curvature(s) on an entity(ies) at given position(s). If either the number of entities or number of coordinate triples is unity, then all points or entities are queried for that entity or point, respectively, otherwise each point corresponds to each entity. storage_order should be a value in the iBase_StorageOrder enum.
instance | iGeom instance handle |
edge_handles | Edge(s) being queried |
edge_handles_size | Number of edges being queried |
storage_order | Storage order of coordinates |
coords | Starting coordinates |
coords_size | Number of values in coordinates array |
on_coords | Closest point array |
on_coords_allocated | Allocated size of closest point array |
on_coords_size | Occupied size of closest point array |
tangent | Tangent array |
tangent_allocated | Allocated size of tangent array |
tangent_size | Occupied size of tangent array |
cvtr | First principal curvatures |
cvtr_allocated | Allocated size of first curvature array |
cvtr_size | Occupied size of first curvature array |
*err | Pointer to error type returned from function |
Definition at line 2977 of file iGeom_CGMA.cc.
{ /* set up iteration according to storage order. allow either gentity_handles or near_coordinates to contain only one value, where that single value is applied for every entry in the other list. */ size_t coord_step, on_step = 1, ent_step; int count; if (3*edge_handles_size == coordinates_size) { coord_step = ent_step = 1; count = edge_handles_size; } else if (coordinates_size == 3) { coord_step = 0; ent_step = 1; count = edge_handles_size; } else if (edge_handles_size == 1) { coord_step = 1; ent_step = 0; count = coordinates_size / 3; } else { ERROR( iBase_INVALID_ENTITY_COUNT, "Mismatched array sizes" ); } // check or pre-allocate the coordinate arrays ALLOC_CHECK_ARRAY( on_coords, 3*count ); ALLOC_CHECK_ARRAY( tangents, 3*count ); ALLOC_CHECK_ARRAY( curvatures, 3*count ); const double *coord_x, *coord_y, *coord_z; double *on_x, *on_y, *on_z; double *tan_x, *tan_y, *tan_z; double *curv_x, *curv_y, *curv_z; if (storage_order == iBase_BLOCKED) { coord_x = coordinates; coord_y = coord_x + coordinates_size/3; coord_z = coord_y + coordinates_size/3; on_x = *on_coords; on_y = on_x + count; on_z = on_y + count; tan_x = *tangents; tan_y = tan_x + count; tan_z = tan_y + count; curv_x = *curvatures; curv_y = curv_x + count; curv_z = curv_y + count; on_step = 1; } else { storage_order = iBase_INTERLEAVED; /* set if unspecified */ coord_x = coordinates; coord_y = coord_x+1; coord_z = coord_x+2; on_x = *on_coords; on_y = on_x + 1; on_z = on_x + 2; tan_x = *tangents; tan_y = tan_x+1; tan_z = tan_x+2; curv_x = *curvatures; curv_y = curv_x + 1; curv_z = curv_x + 2; coord_step *= 3; on_step = 3; } RefEntity** ent_iter = (RefEntity**)edge_handles; iBase_ErrorType result = iBase_SUCCESS; for (int i = 0; i < count; ++i) { RefEdge* edge = dynamic_cast<RefEdge*>(*ent_iter); if (!edge) { ERROR(iBase_INVALID_ENTITY_TYPE, "Non-edge input handle."); } else { const CubitVector coords( *coord_x, *coord_y, *coord_z ); CubitVector on, tan, curv; CubitStatus s = edge->closest_point( coords, on, &tan, &curv ); if (s == CUBIT_FAILURE) result = iBase_FAILURE; on.get_xyz( *on_x, *on_y, *on_z ); tan.get_xyz( *tan_x, *tan_y, *tan_z ); curv.get_xyz( *curv_x, *curv_y, *curv_z ); } ent_iter += ent_step; coord_x += coord_step; coord_y += coord_step; coord_z += coord_step; on_x += on_step; on_y += on_step; on_z += on_step; tan_x += on_step; tan_y += on_step; tan_z += on_step; curv_x += on_step; curv_y += on_step; curv_z += on_step; } KEEP_ARRAY( on_coords ); KEEP_ARRAY( tangents ); KEEP_ARRAY( curvatures ); RETURN(result); }
static void iGeom_getArrFcEvalXYZ | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | face_handles, | ||
int | face_handles_size, | ||
int | storage_order, | ||
double const * | coords, | ||
int | coords_size, | ||
double ** | on_coords, | ||
int * | on_coords_allocated, | ||
int * | on_coords_size, | ||
double ** | normal, | ||
int * | normal_allocated, | ||
int * | normal_size, | ||
double ** | cvtr1, | ||
int * | cvtr1_allocated, | ||
int * | cvtr1_size, | ||
double ** | cvtr2, | ||
int * | cvtr2_allocated, | ||
int * | cvtr2_size, | ||
int * | err | ||
) | [static] |
Get the closest point(s), tangent(s), and curvature(s) on an entity(ies) at given position(s)
Get the closest point(s), tangent(s), and curvature(s) on an entity(ies) at given position(s). If either the number of entities or number of coordinate triples is unity, then all points or entities are queried for that entity or point, respectively, otherwise each point corresponds to each entity. storage_order should be a value in the iBase_StorageOrder enum.
instance | iGeom instance handle |
edge_handles | Edge(s) being queried |
edge_handles_size | Number of edges being queried |
storage_order | Storage order of coordinates |
coords | Starting coordinates |
coords_size | Number of values in coordinates array |
on_coords | Closest point array |
on_coords_allocated | Allocated size of closest point array |
on_coords_size | Occupied size of closest point array |
normal | Normal array |
normal_allocated | Allocated size of normal array |
normal_size | Occupied size of normal array |
cvtr_1 | First principal curvatures |
cvtr_1_allocated | Allocated size of first curvature array |
cvtr_1_size | Occupied size of first curvature array |
cvtr_2 | Second principal curvatures |
cvtr_2_allocated | Allocated size of second curvature array |
cvtr_2_size | Occupied size of second curvature array |
*err | Pointer to error type returned from function |
Definition at line 3101 of file iGeom_CGMA.cc.
{ /* set up iteration according to storage order. allow either gentity_handles or near_coordinates to contain only one value, where that single value is applied for every entry in the other list. */ size_t coord_step, on_step = 1, ent_step; int count; if (3*face_handles_size == coordinates_size) { coord_step = ent_step = 1; count = face_handles_size; } else if (coordinates_size == 3) { coord_step = 0; ent_step = 1; count = face_handles_size; } else if (face_handles_size == 1) { coord_step = 1; ent_step = 0; count = coordinates_size / 3; } else { ERROR( iBase_INVALID_ENTITY_COUNT, "Mismatched array sizes" ); } // check or pre-allocate the coordinate arrays ALLOC_CHECK_ARRAY( on_coords, 3*count ); ALLOC_CHECK_ARRAY( normals, 3*count ); ALLOC_CHECK_ARRAY( curvatures_1, 3*count ); ALLOC_CHECK_ARRAY( curvatures_2, 3*count ); const double *coord_x, *coord_y, *coord_z; double *on_x, *on_y, *on_z; double *norm_x, *norm_y, *norm_z; double *curv1_x, *curv1_y, *curv1_z; double *curv2_x, *curv2_y, *curv2_z; if (storage_order == iBase_BLOCKED) { coord_x = coordinates; coord_y = coord_x + coordinates_size/3; coord_z = coord_y + coordinates_size/3; on_x = *on_coords; on_y = on_x + count; on_z = on_y + count; norm_x = *normals; norm_y = norm_x + count; norm_z = norm_y + count; curv1_x = *curvatures_1; curv1_y = curv1_x + count; curv1_z = curv1_y + count; curv2_x = *curvatures_2; curv2_y = curv2_x + count; curv2_z = curv2_y + count; on_step = 1; } else { storage_order = iBase_INTERLEAVED; /* set if unspecified */ coord_x = coordinates; coord_y = coord_x+1; coord_z = coord_x+2; on_x = *on_coords; on_y = on_x + 1; on_z = on_x + 2; norm_x = *normals; norm_y = norm_x+1; norm_z = norm_x+2; curv1_x = *curvatures_1; curv1_y = curv1_x + 1; curv1_z = curv1_x + 2; curv2_x = *curvatures_2; curv2_y = curv2_x + 1; curv2_z = curv2_x + 2; coord_step *= 3; on_step = 3; } RefEntity** ent_iter = (RefEntity**)face_handles; iBase_ErrorType result = iBase_SUCCESS; for (int i = 0; i < count; ++i) { RefFace* face = dynamic_cast<RefFace*>(*ent_iter); if (!face) { ERROR(iBase_INVALID_ENTITY_TYPE, "Non-face input handle."); result = iBase_INVALID_ENTITY_TYPE; } else { const CubitVector coords( *coord_x, *coord_y, *coord_z ); CubitVector on, norm, curv1, curv2; Surface* surf = face->get_surface_ptr(); #ifdef CGM_HAVE_FACET_ENGINE_ONLY CubitStatus s = surf->closest_point( coords, &on, &norm); #else CubitStatus s = surf->closest_point( coords, &on, &norm, &curv1, &curv2 ); #endif if (s == CUBIT_FAILURE) result = iBase_FAILURE; on.get_xyz( *on_x, *on_y, *on_z ); norm.get_xyz( *norm_x, *norm_y, *norm_z ); curv1.get_xyz( *curv1_x, *curv1_y, *curv1_z ); curv2.get_xyz( *curv2_x, *curv2_y, *curv2_z ); } ent_iter += ent_step; coord_x += coord_step; coord_y += coord_step; coord_z += coord_step; on_x += on_step; on_y += on_step; on_z += on_step; norm_x += on_step; norm_y += on_step; norm_z += on_step; curv1_x += on_step; curv1_y += on_step; curv1_z += on_step; curv2_x += on_step; curv2_y += on_step; curv2_z += on_step; } KEEP_ARRAY( on_coords ); KEEP_ARRAY( normals ); KEEP_ARRAY( curvatures_1 ); KEEP_ARRAY( curvatures_2 ); RETURN(result); }
static void iGeom_getArrNrmlPlXYZ | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | gentity_handles, | ||
const int | gentity_handles_size, | ||
int | storage_order, | ||
const double * | near_coordinates, | ||
const int | near_coordinates_size, | ||
double ** | on_coordinates, | ||
int * | on_coordinates_allocated, | ||
int * | on_coordinates_size, | ||
double ** | normals, | ||
int * | normals_allocated, | ||
int * | normals_size, | ||
int * | err | ||
) | [static] |
Get the normal vector AND closest point on an entity(ies) at given position(s)
Get the normal vector AND closest point on an entity(ies) at given position(s). If either the number of entities or number of coordinate triples is unity, then all points or entities are queried for that entity or point, respectively, otherwise each point corresponds to each entity. storage_order should be a value in the iBase_StorageOrder enum.
instance | iGeom instance handle |
entity_handles | Entity(ies) being queried |
entity_handles_size | Number of entity(ies) being queried |
storage_order | Storage order in near_coordinates array |
near_coordinates | Starting coordinates |
near_coordinates_size | Number of values in near_coordinates array |
on_coordinates | Closest point array |
on_coordinates_allocated | Allocated size of closest point array |
on_coordinates_size | Occupied size of closest point array |
normals | Normal array |
normals_allocated | Allocated size of normal array |
normals_size | Occupied size of normal array |
*err | Pointer to error type returned from function |
Return a points on specified entities closest to specified points in space, and normals at that point. Input coordinates and output points are interleaved in the arrays.
gentity_handles | The gentities being queried |
near_coordinates | Input coordinates |
on_coordinates | Closest point on gentity |
Definition at line 2376 of file iGeom_CGMA.cc.
{ /* set up iteration according to storage order. allow either gentity_handles or near_coordinates to contain only one value, where that single value is applied for every entry in the other list. */ size_t near_step, on_step = 1, ent_step; int count; if (3*gentity_handles_size == near_coordinates_size) { near_step = ent_step = 1; count = gentity_handles_size; } else if (near_coordinates_size == 3) { near_step = 0; ent_step = 1; count = gentity_handles_size; } else if (gentity_handles_size == 1) { near_step = 1; ent_step = 0; count = near_coordinates_size / 3; } else { ERROR( iBase_INVALID_ENTITY_COUNT, "Mismatched array sizes" ); } ALLOC_CHECK_ARRAY( on_coordinates, 3*count ); ALLOC_CHECK_ARRAY( normals, 3*count ); const double *near_x, *near_y, *near_z; double *on_x, *on_y, *on_z; double *norm_x, *norm_y, *norm_z; if (storage_order == iBase_BLOCKED) { near_x = near_coordinates; near_y = near_x + near_coordinates_size/3; near_z = near_y + near_coordinates_size/3; on_x = *on_coordinates; on_y = on_x + count; on_z = on_y + count; norm_x = *normals; norm_y = norm_x + count; norm_z = norm_y + count; on_step = 1; } else { storage_order = iBase_INTERLEAVED; /* set if unspecified */ near_x = near_coordinates; near_y = near_x+1; near_z = near_x+2; on_x = *on_coordinates; on_y = on_x+1; on_z = on_x+2; norm_x = *normals; norm_y = norm_x+1; norm_z = norm_x+2; near_step *= 3; on_step = 3; } RefEntity** ent_iter = (RefEntity**)(gentity_handles); CubitStatus final_result = CUBIT_SUCCESS; for (int i = 0; i < count; ++i) { CubitVector on, norm, near( *near_x, *near_y, *near_z ); CubitStatus status = iGeom_closest_point_and_normal( *ent_iter, near, on, norm ); if (status != CUBIT_SUCCESS) final_result = status; on.get_xyz( *on_x, *on_y, *on_z ); norm.get_xyz( *norm_x, *norm_y, *norm_z ); ent_iter += ent_step; near_x += near_step; near_y += near_step; near_z += near_step; on_x += on_step; on_y += on_step; on_z += on_step; norm_x += on_step; norm_y += on_step; norm_z += on_step; } if (final_result == CUBIT_FAILURE) { ERROR(iBase_FAILURE, "Problems getting closest point for some entity."); } KEEP_ARRAY(on_coordinates); KEEP_ARRAY(normals); RETURN(iBase_SUCCESS); }
static void iGeom_getArrNrmlSense | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | face_handles, | ||
int | face_handles_size, | ||
iBase_EntityHandle const * | region_handles, | ||
int | region_handles_size, | ||
int ** | sense, | ||
int * | sense_allocated, | ||
int * | sense_size, | ||
int * | err | ||
) | [static] |
Get the senses of an array of faces with respect to an array of regions.
Get the senses of an array of faces with respect to an array of regions. Sense returned is -1, 0, or 1, representing "reversed", "both", or "forward". "both" sense indicates that face bounds the region once with each sense.
instance | iGeom instance handle |
face_handles | Faces being queried |
face_handles_size | Size of face handles array |
region_handles | Regions being queried |
region_handles_size | Size of region handles array |
sense | Senses of faces with respect to regions |
sense_allocated | Allocated size of senses array |
sense_size | Occupied size of senses array |
*err | Pointer to error type returned from function |
Definition at line 3721 of file iGeom_CGMA.cc.
{ size_t faces_step, regions_step; int count; if (faces_size == regions_size) { faces_step = regions_step = 1; count = faces_size; } else if (faces_size == 1) { faces_step = 0; regions_step = 1; count = regions_size; } else if (regions_size == 1) { faces_step = 1; regions_step = 0; count = faces_size; } else { ERROR( iBase_INVALID_ENTITY_COUNT, "Mismatched input array sizes" ); RETURN (iBase_INVALID_ENTITY_COUNT); } RefEntity** face_iter = (RefEntity**)faces; RefEntity** region_iter = (RefEntity**)regions; ALLOC_CHECK_ARRAY( senses, count ); for (int i = 0; i < count; ++i) { RefFace *face_ent = dynamic_cast<RefFace*>(*face_iter); if (NULL == face_ent) { ERROR(iBase_INVALID_ENTITY_TYPE, "1st argument to getArrNrmlSense must be a face."); } // XXX: workaround; remove this when we switch iBase_REGIONs to RefVolume const RefVolume *volume_ent; Body *body_ent = dynamic_cast<Body*>(*region_iter); if (NULL != body_ent) { DLIList<RefEntity*> children; body_ent->get_child_ref_entities(children); if (children.size() != 1) { ERROR(iBase_FAILURE, "Can only support bodies with one volume"); } volume_ent = dynamic_cast<const RefVolume*>(children[0]); } else { volume_ent = dynamic_cast<const RefVolume*>(*region_iter); } if (NULL == volume_ent) { ERROR(iBase_INVALID_ENTITY_TYPE, "2nd argument to getArrNrmlSense must be a region."); } (*senses)[i] = iGeom_get_nonmanifold_sense( face_ent, volume_ent, err ); if (iBase_SUCCESS != *err) return; face_iter += faces_step; region_iter += regions_step; } KEEP_ARRAY(senses); RETURN(iBase_SUCCESS); }
static void iGeom_getArrNrmlUV | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | gface_handles, | ||
int | gface_handles_size, | ||
int | storage_order, | ||
const double * | parameters, | ||
int | parameters_size, | ||
double ** | normals, | ||
int * | normals_allocated, | ||
int * | normals_size, | ||
int * | err | ||
) | [static] |
Return the normals at specified parametric positions.
Return the normals at specified parametric positions. If either the number of entities or number of spatial coordinate pairs is unity, then all points or entities are queried for that entity or point, respectively, otherwise each point corresponds to each entity. storage_order should be a value in the iBase_StorageOrder enum.
instance | iGeom instance handle |
face_handle | Faces being queried |
face_handles_size | Number of faces being queried |
storage_order | Storage order of coordinates input and output |
parameters | Parametric coordinates being queried |
parameters_size | Number of coordinates in array |
normals | Coordinates of normals at specified positions |
normals_allocated | Allocated size of normals array |
normals_size | Occupied size of normals array |
*err | Pointer to error type returned from function |
Return the normals at specified uv positions on gfaces. If any gentity input is not a face, returns error. Input parameters and output normals are interleaved.
gface_handles | The entities being queried |
parameters | The uv parameters of points being queried, interleaved |
normals | Normals at specified points, interleaved |
Definition at line 5324 of file iGeom_CGMA.cc.
{ int count; size_t face_step, param_step, norm_step; if (2*gface_handles_size == parameters_size) { count = gface_handles_size; face_step = param_step = 1; } else if (parameters_size == 2) { count = gface_handles_size; face_step = 1; param_step = 0; } else if (gface_handles_size == 1) { count = parameters_size/2; face_step = 0; param_step = 1; } else { ERROR(iBase_INVALID_ENTITY_COUNT, "Mismatched input array sizes."); } // check or pre-allocate the coordinate arrays ALLOC_CHECK_ARRAY( normals, 3*count ); const double *u, *v; double *x, *y, *z; u = parameters; x = *normals; if (storage_order == iBase_BLOCKED) { v = u + (param_step ? count : 1); y = x + count; z = y + count; norm_step = 1; } else { storage_order = iBase_INTERLEAVED; v = u + 1; y = x + 1; z = x + 2; norm_step = 3; param_step *= 2; } RefEntity** face_iter = (RefEntity**)gface_handles; for (int i = 0; i < count; ++i) { RefFace* face = dynamic_cast<RefFace*>(*face_iter); if (!face) { RETURN (iBase_INVALID_ENTITY_TYPE); } CubitVector normal; CubitStatus s = iGeom_normal_from_uv( face, *u, *v, normal ); normal.get_xyz( *x, *y, *z ); if (CUBIT_SUCCESS != s) { RETURN(iBase_FAILURE); } face_iter += face_step; x += norm_step; y += norm_step; z += norm_step; u += param_step; v += param_step; } KEEP_ARRAY(normals); RETURN(iBase_SUCCESS); }
static void iGeom_getArrNrmlXYZ | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | gentity_handles, | ||
int | gentity_handles_size, | ||
int | storage_order, | ||
const double * | coordinates, | ||
int | coordinates_size, | ||
double ** | normals, | ||
int * | normals_allocated, | ||
int * | normals_size, | ||
int * | err | ||
) | [static] |
Get the normal vector on an entity(ies) at given position(s)
Get the normal vector on an entity(ies) at given position(s). If either the number of entities or number of coordinate triples is unity, then all points or entities are queried for that entity or point, respectively, otherwise each point corresponds to each entity. storage_order should be a value in the iBase_StorageOrder enum.
instance | iGeom instance handle |
entity_handles | Entity(ies) being queried |
entity_handles_size | Number of entities being queried |
storage_order | Storage order of coordinates |
coordinates | Starting coordinates |
coordinates_size | Number of values in coordinates array |
normals | Normal coordinates |
normals_allocated | Allocated size of normals array |
normals_size | Occupied size of normals array |
*err | Pointer to error type returned from function |
Return the normals at point on specified entities. Returns error if any input entity is not a gface. Input coordinates and normals are interleaved in the arrays.
gentity_handles | The gentities being queried |
coordinates | Input coordinates, interleaved |
normals | The normals at the specified points, interleaved |
Definition at line 2510 of file iGeom_CGMA.cc.
{ /* set up iteration according to storage order. allow either gentity_handles or near_coordinates to contain only one value, where that single value is applied for every entry in the other list. */ size_t coord_step, norm_step = 1, ent_step; int count; if (3*gentity_handles_size == coordinates_size) { coord_step = ent_step = 1; count = gentity_handles_size; } else if (coordinates_size == 3) { coord_step = 0; ent_step = 1; count = gentity_handles_size; } else if (gentity_handles_size == 1) { coord_step = 1; ent_step = 0; count = coordinates_size / 3; } else { ERROR( iBase_INVALID_ENTITY_COUNT, "Mismatched array sizes" ); } // check or pre-allocate the coordinate arrays ALLOC_CHECK_ARRAY( normals, 3*count ); const double *coord_x, *coord_y, *coord_z; double *norm_x, *norm_y, *norm_z; if (storage_order == iBase_BLOCKED) { coord_x = coordinates; coord_y = coord_x + coordinates_size/3; coord_z = coord_y + coordinates_size/3; norm_x = *normals; norm_y = norm_x + count; norm_z = norm_y + count; norm_step = 1; } else { storage_order = iBase_INTERLEAVED; /* set if unspecified */ coord_x = coordinates; coord_y = coord_x+1; coord_z = coord_x+2; norm_x = *normals; norm_y = norm_x+1; norm_z = norm_x+2; coord_step *= 3; norm_step = 3; } RefEntity** entities = (RefEntity**)(gentity_handles); for (int i = 0; i < count; ++i) { RefFace* face = dynamic_cast<RefFace*>(*entities); if (NULL == face) { ERROR(iBase_INVALID_ENTITY_TYPE, "Entities passed into gentityNormal must be faces."); } else { CubitVector normal, coords( *coord_x, *coord_y, *coord_z ); normal = face->normal_at( coords ); normal.get_xyz( *norm_x, *norm_y, *norm_z ); } entities += ent_step; coord_x += coord_step; coord_y += coord_step; coord_z += coord_step; norm_x += norm_step; norm_y += norm_step; norm_z += norm_step; } KEEP_ARRAY(normals); RETURN(iBase_SUCCESS); }
static void iGeom_getArrTgntU | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | gedge_handles, | ||
int | gedge_handles_size, | ||
int | storage_order, | ||
const double * | parameters, | ||
int | parameters_size, | ||
double ** | tangents, | ||
int * | tangents_allocated, | ||
int * | tangents_size, | ||
int * | err | ||
) | [static] |
Return the tangents at specified parametric positions.
Return the tangents at specified parametric positions. If either the number of entities or number of spatial coordinates is unity, then all points or entities are queried for that entity or point, respectively, otherwise each point corresponds to each entity. storage_order should be a value in the iBase_StorageOrder enum.
instance | iGeom instance handle |
edge_handle | Edges being queried |
edge_handles_size | Number of faces being queried |
storage_order | Storage order of coordinates output |
parameters | Parametric coordinates being queried |
parameters_size | Number of coordinates in array |
tangents | Coordinates of tangents at specified positions |
tangents_allocated | Allocated size of tangents array |
tangents_size | Occupied size of tangents array |
*err | Pointer to error type returned from function |
Return the tangents at specified u positions on gedges. If any gentity input is not a face, returns error. Output normals are interleaved.
gentity_handles | The gedges being queried |
parameters | The u parameters of points being queried |
tangents | Tangents at specified points, interleaved |
Definition at line 5426 of file iGeom_CGMA.cc.
{ iGeom_getArrUtoXYZ(instance, ARRAY_IN(gedge_handles), ARRAY_IN(parameters), storage_order, ARRAY_INOUT(tangents), err); if (iBase_SUCCESS == *err) iGeom_getArrTgntXYZ(instance, ARRAY_IN(gedge_handles), storage_order, *tangents, *tangents_size, ARRAY_INOUT(tangents), err); }
static void iGeom_getArrTgntXYZ | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | gentity_handles, | ||
int | gentity_handles_size, | ||
int | storage_order, | ||
const double * | coordinates, | ||
int | coordinates_size, | ||
double ** | tangents, | ||
int * | tangents_allocated, | ||
int * | tangents_size, | ||
int * | err | ||
) | [static] |
Get the tangent vector on an entity(ies) at given position(s)
Get the tangent vector on an entity(ies) at given position(s). If either the number of entities or number of coordinate triples is unity, then all points or entities are queried for that entity or point, respectively, otherwise each point corresponds to each entity. storage_order should be a value in the iBase_StorageOrder enum
instance | iGeom instance handle |
entity_handles | Entity(ies) being queried |
entity_handles_size | Number of entities being queried |
storage_order | Storage order of coordinates |
coordinates | Starting coordinates |
coordinates_size | Number of values in coordinates array |
tangents | Tangent coordinates |
tangents_allocated | Allocated size of tangents array |
tangents_size | Occupied size of tangents array |
*err | Pointer to error type returned from function |
Return the tangent at point on specified entities. Returns error if any input entity is not a gedge. Input coordinates and tangents are interleaved in the arrays.
gentity_handles | The gentities being queried |
coordinates | Input coordinates, interleaved |
tangents | The tangents at the specified points, interleaved |
Definition at line 2630 of file iGeom_CGMA.cc.
{ /* set up iteration according to storage order. allow either gentity_handles or near_coordinates to contain only one value, where that single value is applied for every entry in the other list. */ size_t coord_step, tan_step = 1, ent_step; int count; if (3*gentity_handles_size == coordinates_size) { coord_step = ent_step = 1; count = gentity_handles_size; } else if (coordinates_size == 3) { coord_step = 0; ent_step = 1; count = gentity_handles_size; } else if (gentity_handles_size == 1) { coord_step = 1; ent_step = 0; count = coordinates_size / 3; } else { ERROR( iBase_INVALID_ENTITY_COUNT, "Mismatched array sizes" ); } // check or pre-allocate the coordinate arrays ALLOC_CHECK_ARRAY( tangents, 3*count ); const double *coord_x, *coord_y, *coord_z; double *tan_x, *tan_y, *tan_z; if (storage_order == iBase_BLOCKED) { coord_x = coordinates; coord_y = coord_x + coordinates_size/3; coord_z = coord_y + coordinates_size/3; tan_x = *tangents; tan_y = tan_x + count; tan_z = tan_y + count; tan_step = 1; } else { storage_order = iBase_INTERLEAVED; /* set if unspecified */ coord_x = coordinates; coord_y = coord_x+1; coord_z = coord_x+2; tan_x = *tangents; tan_y = tan_x+1; tan_z = tan_x+2; coord_step *= 3; tan_step = 3; } RefEntity** entities = (RefEntity**)(gentity_handles); for (int i = 0; i < count; ++i) { RefEdge* edge = dynamic_cast<RefEdge*>(*entities); if (NULL == edge) { ERROR(iBase_INVALID_ENTITY_TYPE, "Entities passed into gentityTangent must be edges."); } else { CubitVector tangent, coords( *coord_x, *coord_y, *coord_z ); edge->tangent( coords, tangent ); tangent.get_xyz( *tan_x, *tan_y, *tan_z ); } entities += ent_step; coord_x += coord_step; coord_y += coord_step; coord_z += coord_step; tan_x += tan_step; tan_y += tan_step; tan_z += tan_step; } KEEP_ARRAY(tangents); RETURN(iBase_SUCCESS); }
static void iGeom_getArrTolerance | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | gentity_handles, | ||
const int | gentity_handles_size, | ||
double ** | tolerances, | ||
int * | tolerances_allocated, | ||
int * | tolerances_size, | ||
int * | err | ||
) | [static] |
Get the tolerances of the specified entities.
Get the tolerances of the specified entities.
instance | iGeom instance handle |
entity_handles | Array of entity handles being queried |
entity_handles_size | Number of entities in entity_handles array |
tolerance | Pointer to array of tolerances returned from function |
tolerance_allocated | Pointer to allocated size of tolerance array |
tololerance_size | Pointer to occupied size of tolerance array |
*err | Pointer to error type returned from function |
Return the relative and absolute tolerances for specified gentities. If a gentity does not have a specific tolerance, zero is returned for both values.
gentity_handles | Gentities being queried |
relative_tolerances | Relative tolerances |
absolute_tolerances | Absolute tolerances |
Definition at line 4343 of file iGeom_CGMA.cc.
{ ALLOC_CHECK_ARRAY_NOFAIL(tolerances, gentity_handles_size); double dum_abs_tol = gqt->get_sme_resabs_tolerance(); for (int i = 0; i < gentity_handles_size; i++) { (*tolerances)[i] = dum_abs_tol; } RETURN(iBase_SUCCESS); }
static void iGeom_getArrType | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | gentity_handles, | ||
int | gentity_handles_size, | ||
int ** | gtype, | ||
int * | gtype_allocated, | ||
int * | gtype_size, | ||
int * | err | ||
) | [static] |
Get the entity type for the specified entities.
Get the entity type for the specified entities. Types returned are values in the iBase_EntityType enumeration.
instance | iGeom instance handle |
entity_handles | Array of entity handles being queried |
entity_handles_size | Number of entities in entity_handles array |
*type | Pointer to array of types returned from function |
*type_allocated | Pointer to allocated size of type array |
*type_size | Pointer to occupied size of type array |
*err | Pointer to error type returned from function |
Returns an integer array of topological dimensions for an input array of entity handles.
Definition at line 1258 of file iGeom_CGMA.cc.
{ // go through each entity and look up its dimension ALLOC_CHECK_ARRAY_NOFAIL(gtype, gentity_handles_size); const RefEntity **tmp_handles = (const RefEntity**)(gentity_handles); for (int i = 0; i < gentity_handles_size; i++) { if (dynamic_cast<const Body*>(tmp_handles[i])) (*gtype)[i] = iBase_REGION; else (*gtype)[i] = tmp_handles[i]->dimension(); } RETURN(iBase_SUCCESS); }
static void iGeom_getArrURange | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | entity_handles, | ||
int | entity_handles_size, | ||
double ** | u_min, | ||
int * | u_min_allocated, | ||
int * | u_min_size, | ||
double ** | u_max, | ||
int * | u_max_allocated, | ||
int * | u_max_size, | ||
int * | err | ||
) | [static] |
Get parametric range of entities.
Get parametric range of entities
instance | iGeom instance handle |
entity_handles | Entities being queried |
entity_handles_size | Number of entities being queried |
storage_order | Storage order of parametric coordinates being returned |
u_min | Minimum parametric coordinate for entities |
u_min_allocated | Allocated size of minimum parametric coordinate array |
u_min_size | Occupied size of minimum parametric coordinate array |
u_max | Maximum parametric coordinate for entities |
u_max_allocated | Allocated size of maximum parametric coordinate array |
u_max_size | Occupied size of maximum parametric coordinate array |
*err | Pointer to error type returned from function |
Definition at line 5000 of file iGeom_CGMA.cc.
{ ALLOC_CHECK_ARRAY(u_min, gentity_handles_size); ALLOC_CHECK_ARRAY(u_max, gentity_handles_size); RefEntity** entities = (RefEntity**)gentity_handles; for (int i = 0; i < gentity_handles_size; ++i) { RefEdge* edge = dynamic_cast<RefEdge*>(entities[i]); if (!edge) { ERROR(iBase_INVALID_ENTITY_TYPE, "Expected edge for 1-param method."); } CubitBoolean r1 = edge->get_param_range((*u_min)[i], (*u_max)[i]); if (!r1) { RETURN(iBase_FAILURE); } } KEEP_ARRAY(u_min); KEEP_ARRAY(u_max); RETURN(iBase_SUCCESS); }
static void iGeom_getArrUtoUV | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | edge_handles, | ||
int | edge_handles_size, | ||
iBase_EntityHandle const * | face_handles, | ||
int | face_handles_size, | ||
double const * | u_in, | ||
int | u_in_size, | ||
int | storage_order, | ||
double ** | uv, | ||
int * | uv_allocated, | ||
int * | uv_size, | ||
int * | err | ||
) | [static] |
Return the face parametric coordinates for a parametric position on bounding edges.
Return the face parametric coordinates for a parametric position on bounding edges
instance | iGeom instance handle |
edge_handles | Edges being queried |
edge_handles_size | Number of edges being queried |
face_handles | Faces being queried |
face_handles_size | Number of faces being queried |
u_in | Parametric positions on edges |
u_in_size | Number of parametric positions on edges |
storage_order | Storage order of coordinates returned |
uv | Corresponding parametric positions on faces |
uv_allocated | Allocated size of parameter array |
uv_size | Occupied size of parameter array |
*err | Pointer to error type returned from function |
Definition at line 5064 of file iGeom_CGMA.cc.
{ int count; size_t edge_step, face_step, coord_step, in_u_step; if (!(iGeom_check_array_size(edge_handles_size, face_handles_size) && iGeom_check_array_size(edge_handles_size, in_u_size) && iGeom_check_array_size(face_handles_size, in_u_size))) { ERROR(iBase_INVALID_ENTITY_COUNT, "Mismatched input array sizes."); } edge_step = (edge_handles_size == 1) ? 0:1; face_step = (face_handles_size == 1) ? 0:1; in_u_step = (in_u_size == 1) ? 0:1; count = std::max(edge_handles_size, std::max(face_handles_size, in_u_size)); ALLOC_CHECK_ARRAY( uv, 2*count ); const double *in_u_iter; double *u, *v; in_u_iter = in_u; u = *uv; if (storage_order == iBase_BLOCKED) { v = u + count; coord_step = 1; } else { v = u + 1; coord_step = 2; } RefEntity** edge_ent = (RefEntity**)edge_handles; RefEntity** face_ent = (RefEntity**)face_handles; for (int i = 0; i < count; ++i) { RefEdge* edge = dynamic_cast<RefEdge*>(*edge_ent); RefFace* face = dynamic_cast<RefFace*>(*face_ent); if (!edge || !face) { RETURN(iBase_INVALID_ENTITY_TYPE); } CubitVector xyz; CubitStatus s; s = edge->position_from_u( *in_u_iter, xyz ); if (CUBIT_SUCCESS != s) RETURN(iBase_FAILURE); s = face->u_v_from_position( xyz, *u, *v ); if (CUBIT_SUCCESS != s) RETURN(iBase_FAILURE); edge_ent += edge_step; face_ent += face_step; in_u_iter += in_u_step; u += coord_step; v += coord_step; } KEEP_ARRAY(uv); RETURN(iBase_SUCCESS); }
static void iGeom_getArrUtoXYZ | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | entity_handles, | ||
int | entity_handles_size, | ||
double const * | u, | ||
int | u_size, | ||
int | storage_order, | ||
double ** | on_coords, | ||
int * | on_coords_allocated, | ||
int * | on_coords_size, | ||
int * | err | ||
) | [static] |
Return coordinate positions at specified parametric position(s) on entity(ies)
Return coordinate positions at specified parametric position(s) on entity(ies). If either the number of entities or number of parametric coordinate pairs is unity, then all points or entities are queried for that entity or point, respectively, otherwise each point corresponds to each entity. storage_order should be a value in the iBase_StorageOrder enum.
instance | iGeom instance handle |
entity_handles | Entities being queried |
entity_handles_size | Number of entities being queried |
storage_order | Storage order of resulting coordinates |
uv | Coordinates being queried |
uv_size | Number of coordinates in array |
coordinates | Coordinates of parametric positions |
coordinates_allocated | Allocated size of coordinates array |
coordinates_size | Occupied size of coordinates array |
*err | Pointer to error type returned from function |
Definition at line 4526 of file iGeom_CGMA.cc.
{ int count; size_t ent_step, coord_step, u_step; if (gentity_handles_size == u_size) { ent_step = u_step = 1; count = gentity_handles_size; } else if (u_size == 1) { ent_step = 1; u_step = 0; count = gentity_handles_size; } else if (gentity_handles_size == 1) { ent_step = 0; u_step = 1; count = u_size; } else { ERROR(iBase_INVALID_ENTITY_COUNT, "Mismatched input array sizes."); } ALLOC_CHECK_ARRAY( coordinates, 3*count ); const double *u_iter; double *x, *y, *z; u_iter = u; x = *coordinates; if (storage_order == iBase_BLOCKED) { y = x + count; z = y + count; coord_step = 1; } else { y = x + 1; z = x + 2; coord_step = 3; } iBase_ErrorType result = iBase_SUCCESS; RefEntity** ent = (RefEntity**)gentity_handles; for (int i = 0; i < count; ++i) { RefEdge* edge = dynamic_cast<RefEdge*>(*ent); if (!edge) { ERROR(iBase_INVALID_ENTITY_TYPE, "Expected edge for 1-param method."); } CubitVector xyz; CubitStatus s = edge->position_from_u( *u_iter, xyz ); if (CUBIT_SUCCESS != s) result = iBase_FAILURE; xyz.get_xyz( *x, *y, *z ); ent += ent_step; u_iter += u_step; x += coord_step; y += coord_step; z += coord_step; } KEEP_ARRAY(coordinates); RETURN(result); }
static void iGeom_getArrUVRange | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | gentity_handles, | ||
int | gentity_handles_size, | ||
int | storage_order, | ||
double ** | uv_min, | ||
int * | uv_min_allocated, | ||
int * | uv_min_size, | ||
double ** | uv_max, | ||
int * | uv_max_allocated, | ||
int * | uv_max_size, | ||
int * | err | ||
) | [static] |
Get parametric range of entities.
Get parametric range of entities
instance | iGeom instance handle |
entity_handles | Entities being queried |
entity_handles_size | Number of entities being queried |
storage_order | Storage order of parametric coordinates being returned |
uv_min | Minimum parametric coordinate for entities |
uv_min_allocated | Allocated size of minimum parametric coordinate array |
uv_min_size | Occupied size of minimum parametric coordinate array |
uv_max | Maximum parametric coordinate for entities |
uv_max_allocated | Allocated size of maximum parametric coordinate array |
uv_max_size | Occupied size of maximum parametric coordinate array |
*err | Pointer to error type returned from function |
Return the uv range of the specified gentities. Parameters are interleaved.
gentity_handles | Gentities being queried. |
uv_min | Minimum parameters of gentities, interleaved |
uv_max | Maximum parameters of gentities, interleaved |
Definition at line 4945 of file iGeom_CGMA.cc.
{ ALLOC_CHECK_ARRAY(uv_min, 2*gentity_handles_size); ALLOC_CHECK_ARRAY(uv_max, 2*gentity_handles_size); size_t init, step; if (storage_order == iBase_BLOCKED) { init = gentity_handles_size; step = 1; } else { init = 1; step = 2; } double *u_min = *uv_min; double *v_min = u_min + init; double *u_max = *uv_max; double *v_max = u_max + init; RefEntity** entities = (RefEntity**)gentity_handles; for (int i = 0; i < gentity_handles_size; ++i) { RefFace* face = dynamic_cast<RefFace*>(entities[i]); if (!face) { ERROR(iBase_INVALID_ENTITY_TYPE, "Expected face for UV method."); } CubitBoolean r1 = face->get_param_range_U(*u_min, *u_max); CubitBoolean r2 = face->get_param_range_V(*v_min, *v_max); if (!(r1 && r2)) { RETURN(iBase_FAILURE); } u_min += step; v_min += step; u_max += step; v_max += step; } KEEP_ARRAY(uv_min); KEEP_ARRAY(uv_max); RETURN(iBase_SUCCESS); }
static void iGeom_getArrUVtoXYZ | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | gentity_handles, | ||
int | gentity_handles_size, | ||
int | storage_order, | ||
const double * | uv, | ||
int | uv_size, | ||
double ** | coordinates, | ||
int * | coordinates_allocated, | ||
int * | coordinates_size, | ||
int * | err | ||
) | [static] |
Return coordinate positions at specified parametric position(s) on entity(ies)
Return coordinate positions at specified parametric position(s) on entity(ies). If either the number of entities or number of parametric coordinate pairs is unity, then all points or entities are queried for that entity or point, respectively, otherwise each point corresponds to each entity. storage_order should be a value in the iBase_StorageOrder enum.
instance | iGeom instance handle |
entity_handles | Entities being queried |
entity_handles_size | Number of entities being queried |
storage_order | Storage order of uv coordinates input and xyz coordinate output |
uv | Coordinates being queried |
uv_size | Number of coordinates in array |
coordinates | Coordinates of parametric positions |
coordinates_allocated | Allocated size of coordinates array |
coordinates_size | Occupied size of coordinates array |
*err | Pointer to error type returned from function |
Given sets of parametric coordinates, return the corresponding real space coordinates on the gentities. Input and output coordinates are interleaved.
gentity_handles | Gentities being queried. |
uv | Input parametric coordinates |
xyz | Output real space coordinates |
Definition at line 4430 of file iGeom_CGMA.cc.
{ size_t ent_step, coord_step, uv_step; int count; if (2*gentity_handles_size == uv_size) { ent_step = uv_step = 1; count = gentity_handles_size; } else if (uv_size == 2) { ent_step = 1; uv_step = 0; count = gentity_handles_size; } else if (gentity_handles_size == 1) { ent_step = 0; uv_step = 1; count = uv_size/2; } else { ERROR(iBase_INVALID_ENTITY_COUNT, "Mismatched input array sizes."); } ALLOC_CHECK_ARRAY( coordinates, 3*count ); const double *u, *v; double *x, *y, *z; u = uv; x = *coordinates; if (storage_order == iBase_BLOCKED) { v = u + (uv_step ? count : 1); y = x + count; z = y + count; coord_step = 1; } else { storage_order = iBase_INTERLEAVED; v = u + 1; y = x + 1; z = x + 2; coord_step = 3; uv_step *= 2; } RefEntity** ent = (RefEntity**)gentity_handles; for (int i = 0; i < count; ++i) { RefFace* face = dynamic_cast<RefFace*>(*ent); if (!face) { ERROR(iBase_INVALID_ENTITY_TYPE, "Expected face for UV method."); } CubitVector xyz = face->position_from_u_v( *u, *v ); xyz.get_xyz( *x, *y, *z ); ent += ent_step; u += uv_step; v += uv_step; x += coord_step; y += coord_step; z += coord_step; } KEEP_ARRAY(coordinates); RETURN(iBase_SUCCESS); }
static void iGeom_getArrXYZtoU | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | entity_handles, | ||
int | entity_handles_size, | ||
int | storage_order, | ||
double const * | coordinates, | ||
int | coordinates_size, | ||
double ** | u, | ||
int * | u_allocated, | ||
int * | u_size, | ||
int * | err | ||
) | [static] |
Return spatial positions at specified parametric position(s) on entity(ies)
Return spatial positions at specified parametric position(s) on entity(ies). If either the number of entities or number of spatial coordinate triples is unity, then all points or entities are queried for that entity or point, respectively, otherwise each point corresponds to each entity. storage_order should be a value in the iBase_StorageOrder enum.
instance | iGeom instance handle |
entity_handles | Entities being queried |
entity_handles_size | Number of entities being queried |
storage_order | Storage order of spatial coordinates input |
coordinates | Coordinates being queried |
coordinates_size | Number of coordinates in array |
u | Coordinates of parametric positions |
u_allocated | Allocated size of coordinates array |
u_size | Occupied size of coordinates array |
*err | Pointer to error type returned from function |
Definition at line 4729 of file iGeom_CGMA.cc.
{ int count; size_t ent_step, coord_step; if (3*gentity_handles_size == coordinates_size) { ent_step = coord_step = 1; count = gentity_handles_size; } else if (coordinates_size == 3) { ent_step = 1; coord_step = 0; count = gentity_handles_size; } else if (gentity_handles_size == 1) { ent_step = 0; coord_step = 1; count = coordinates_size/3; } else { ERROR(iBase_INVALID_ENTITY_COUNT, "Mismatched input array sizes."); } const double *x, *y, *z; x = coordinates; if (storage_order == iBase_BLOCKED) { y = x + (coord_step ? count : 1); z = y + (coord_step ? count : 1); } else { storage_order = iBase_INTERLEAVED; y = x + 1; z = x + 2; coord_step *= 3; } ALLOC_CHECK_ARRAY( u, count ); RefEntity** ent = (RefEntity**)gentity_handles; for (int i = 0; i < count; ++i) { RefEdge* edge = dynamic_cast<RefEdge*>(*ent); if (!edge) { ERROR(iBase_INVALID_ENTITY_TYPE, "Expected edge for 1-param method."); } CubitVector xyz( *x, *y, *z ); (*u)[i] = edge->u_from_position( xyz ); ent += ent_step; x += coord_step; y += coord_step; z += coord_step; } KEEP_ARRAY(u); RETURN(iBase_SUCCESS); }
static void iGeom_getArrXYZtoUV | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | gentity_handles, | ||
int | gentity_handles_size, | ||
int | storage_order, | ||
const double * | coordinates, | ||
int | coordinates_size, | ||
double ** | uv, | ||
int * | uv_allocated, | ||
int * | uv_size, | ||
int * | err | ||
) | [static] |
Return parametric positions at specified spatial position(s) on entity(ies) Return parametric positions at specified spatial position(s) on entity(ies). If either the number of entities or number of spatial coordinate triples is unity, then all points or entities are queried for that entity or point, respectively, otherwise each point corresponds to each entity. storage_order should be a value in the iBase_StorageOrder enum.
instance | iGeom instance handle |
entity_handles | Entities being queried |
entity_handles_size | Number of entities being queried |
storage_order | Storage order of spatial coordinates input |
coordinates | Coordinates being queried |
coordinates_size | Number of coordinates in array |
uv | Coordinates of parametric positions |
uv_allocated | Allocated size of coordinates array |
uv_size | Occupied size of coordinates array |
*err | Pointer to error type returned from function |
Given sets of real space coordinates, return the corresponding parametric coordinates on the gentities. Input and output coordinates are interleaved.
gentity_handles | Gentities being queried. |
xyz | Input real space coordinates |
uv | Output parametric coordinates |
Definition at line 4630 of file iGeom_CGMA.cc.
{ int count; size_t ent_step, coord_step, uv_step; if (3*gentity_handles_size == coordinates_size) { ent_step = coord_step = 1; count = gentity_handles_size; } else if (coordinates_size == 3) { ent_step = 1; coord_step = 0; count = gentity_handles_size; } else if (gentity_handles_size == 1) { ent_step = 0; coord_step = 1; count = coordinates_size/3; } else { ERROR(iBase_INVALID_ENTITY_COUNT, "Mismatched input array sizes."); } ALLOC_CHECK_ARRAY( uv, 2*count ); double *u, *v; const double *x, *y, *z; u = *uv; x = coordinates; if (storage_order == iBase_BLOCKED) { v = u + count; y = x + (coord_step ? count : 1); z = y + (coord_step ? count : 1); uv_step = 1; } else { storage_order = iBase_INTERLEAVED; v = u + 1; y = x + 1; z = x + 2; coord_step *= 3; uv_step = 2; } RefEntity** ent = (RefEntity**)gentity_handles; for (int i = 0; i < count; ++i) { RefFace* face = dynamic_cast<RefFace*>(*ent); if (!face) { ERROR(iBase_INVALID_ENTITY_TYPE, "Expected face for UV method."); } CubitVector xyz( *x, *y, *z ); CubitStatus s = face->u_v_from_position( xyz, *u, *v ); if (CUBIT_SUCCESS != s) RETURN(iBase_FAILURE); ent += ent_step; u += uv_step; v += uv_step; x += coord_step; y += coord_step; z += coord_step; } KEEP_ARRAY(uv); RETURN(iBase_SUCCESS); }
static void iGeom_getArrXYZtoUVHint | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | gentity_handles, | ||
int | gentity_handles_size, | ||
int | storage_order, | ||
const double * | coordinates, | ||
int | coordinates_size, | ||
double ** | uv, | ||
int * | uv_allocated, | ||
int * | uv_size, | ||
int * | err | ||
) | [static] |
Return parametric positions at specified spatial position(s) on entity(ies), based on parametric position hints Return parametric positions at specified spatial position(s) on entity(ies), based on parametric position hints. If either the number of entities or number of spatial coordinate triples is unity, then all points or entities are queried for that entity or point, respectively, otherwise each point corresponds to each entity. storage_order should be a value in the iBase_StorageOrder enum.
instance | iGeom instance handle |
entity_handles | Entities being queried |
entity_handles_size | Number of entities being queried |
storage_order | Storage order of spatial coordinates input |
coordinates | Coordinates being queried |
coordinates_size | Number of coordinates in array |
uv | Coordinates of parametric positions |
uv_allocated | Allocated size of coordinates array |
uv_size | Occupied size of coordinates array |
*err | Pointer to error type returned from function |
Given sets of real space coordinates, return the corresponding parametric coordinates on the gentities. Input and output coordinates are interleaved.
gentity_handles | Gentities being queried. |
xyz | Input real space coordinates |
uv | Output parametric coordinates |
Definition at line 4826 of file iGeom_CGMA.cc.
{ int count; size_t ent_step, coord_step, uv_step; if (3*gentity_handles_size == coordinates_size) { ent_step = coord_step = 1; count = gentity_handles_size; } else if (coordinates_size == 3) { ent_step = 1; coord_step = 0; count = gentity_handles_size; } else if (gentity_handles_size == 1) { ent_step = 0; coord_step = 1; count = coordinates_size/3; } else { ERROR(iBase_INVALID_ENTITY_COUNT, "Mismatched input array sizes."); } double *u, *v; const double *x, *y, *z; u = *uv; x = coordinates; if (storage_order == iBase_BLOCKED) { v = u + count; y = x + (coord_step ? count : 1); z = y + (coord_step ? count : 1); uv_step = 1; } else { storage_order = iBase_INTERLEAVED; v = u + 1; y = x + 1; z = x + 2; coord_step *= 3; uv_step = 2; } ALLOC_CHECK_ARRAY( uv, 2*count ); RefEntity** ent = (RefEntity**)gentity_handles; for (int i = 0; i < count; ++i) { RefFace* face = dynamic_cast<RefFace*>(*ent); if (!face) { ERROR(iBase_INVALID_ENTITY_TYPE, "Expected face for UV method."); } CubitVector xyz( *x, *y, *z ); face->move_to_surface( xyz, u, v ); ent += ent_step; u += uv_step; v += uv_step; x += coord_step; y += coord_step; z += coord_step; } KEEP_ARRAY(uv); RETURN(iBase_SUCCESS); }
static void iGeom_getBoundBox | ( | iGeom_Instance | instance, |
double * | min_x, | ||
double * | min_y, | ||
double * | min_z, | ||
double * | max_x, | ||
double * | max_y, | ||
double * | max_z, | ||
int * | err | ||
) | [static] |
Get the bounding box of the entire model.
Get the bounding box of the entire model
instance | iGeom instance handle |
min_x | Minimum coordinate of bounding box |
min_y | Minimum coordinate of bounding box |
min_z | Minimum coordinate of bounding box |
max_x | Maximum coordinate of bounding box |
max_y | Maximum coordinate of bounding box |
max_z | Maximum coordinate of bounding box |
*err | Pointer to error type returned from function |
Definition at line 832 of file iGeom_CGMA.cc.
{ CubitBox box = GeometryQueryTool::instance()->model_bounding_box(); *min_x = box.min_x(); *min_y = box.min_y(); *min_z = box.min_z(); *max_x = box.max_x(); *max_y = box.max_y(); *max_z = box.max_z(); RETURN(iBase_SUCCESS); }
static void iGeom_getChldn | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | from_entity_set, | ||
const int | num_hops, | ||
iBase_EntitySetHandle ** | entity_set_handles, | ||
int * | entity_set_handles_allocated, | ||
int * | entity_set_handles_size, | ||
int * | err | ||
) | [static] |
Get the child sets linked from a specified set.
Get the child sets linked from a specified set. If num_hops is not -1, this represents the maximum hops from entity_set to any child.
instance | iGeom instance handle |
from_entity_set | Entity set being queried |
num_hops | Maximum hops from entity_set_handle to child set, not inclusive of the child set |
*entity_set_handles | Pointer to array of child sets returned from function |
*entity_set_handles_allocated | Pointer to allocated size of entity_set_handles array |
*entity_set_handles_size | Pointer to occupied size of entity_set_handles array |
*err | Pointer to error type returned from function |
Recursively gets the children of this gentity_set up to num_hops levels; if num_hops is set to -1 all children are returned
Definition at line 1026 of file iGeom_CGMA.cc.
{ std::vector<RefGroup*> group_ptrs; const RefGroup *this_grp = SET_HANDLE(from_entity_set); TM->get_pc_groups(const_cast<RefGroup*>(this_grp), 1, num_hops, group_ptrs); ALLOC_CHECK_ARRAY_NOFAIL(entity_set_handles, group_ptrs.size()); iBase_EntitySetHandle* ent_arr = reinterpret_cast<iBase_EntitySetHandle*>(&group_ptrs[0]); std::copy( ent_arr, ent_arr + group_ptrs.size(), *entity_set_handles); RETURN(iBase_SUCCESS); }
static void iGeom_getData | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
iBase_TagHandle | tag_handle, | ||
void ** | tag_value_tmp, | ||
int * | tag_value_allocated, | ||
int * | tag_value_size, | ||
int * | err | ||
) | [static] |
Get the value of a tag of arbitrary type on an entity.
Get the value of a tag of arbitrary type on an entity. Tag data is passed back as void*. tag_value_size specifies the size of the memory pointed to by tag_value in terms of bytes. Applications may use this function to get data of any type, not just iBase_BYTES. However, because this function supports arbitrary type, in all cases the size specified by tag_value_size is always in terms of bytes.
instance | iGeom instance handle |
entity_handle | Entity on which tag is being set |
tag_handle | Tag being set on an entity |
*tag_value | Pointer to tag data array being queried |
*tag_value_allocated | Pointer to tag data array allocated size |
*tag_value_size | Pointer to occupied size in bytes of tag data array |
*err | Pointer to error type returned from function |
Allows the user to retrieve an array of tag values associated with a tag handle from an input array of gentity handles
Definition at line 1898 of file iGeom_CGMA.cc.
{ char **tag_value = reinterpret_cast<char **>(tag_value_tmp); RefEntity *tmp_entity = ENTITY_HANDLE(entity_handle); iBase_ErrorType retval = TM->getArrData(&tmp_entity, 1, TAG_HANDLE(tag_handle), ARRAY_INOUT(tag_value)); RETURN(retval); }
static void iGeom_getDblArrData | ( | iGeom_Instance | instance, |
const iBase_EntityHandle * | entity_handles, | ||
int | entity_handles_size, | ||
iBase_TagHandle | tag_handle, | ||
double ** | tag_values, | ||
int * | tag_values_allocated, | ||
int * | tag_values_size, | ||
int * | err | ||
) | [static] |
Get tag values of double type for an array of entities.
Get tag values of double type for an array of entities.
instance | iGeom instance handle |
entity_handles | Entity array on which tag is being set |
entity_handles_size | Number of entities in array |
tag_handle | Tag being set on an entity |
*tag_values | Pointer to tag data array being returned from function |
tag_values_allocated | Pointer to allocated size of tag data array |
tag_values_size | Pointer to occupied size of tag data array |
*err | Pointer to error type returned from function |
Definition at line 1753 of file iGeom_CGMA.cc.
{ int tag_value_allocated_tmp = *tag_value_allocated * sizeof(double); int tag_value_size_tmp = *tag_value_size * sizeof(double); iGeom_getArrData(instance, entity_handles, entity_handles_size, tag_handle, reinterpret_cast<void**>(tag_value), &tag_value_allocated_tmp, &tag_value_size_tmp, err); *tag_value_allocated = tag_value_allocated_tmp / sizeof(double); *tag_value_size = tag_value_size_tmp / sizeof(double); }
static void iGeom_getDblData | ( | iGeom_Instance | instance, |
const iBase_EntityHandle | entity_handle, | ||
const iBase_TagHandle | tag_handle, | ||
double * | out_data, | ||
int * | err | ||
) | [static] |
Get the value of a tag of double type on an entity.
Get the value of a tag of double type on an entity.
instance | iGeom instance handle |
entity_handle | Entity on which tag is being set |
tag_handle | Tag being set on an entity |
*out_data | Pointer to tag value returned from function |
*err | Pointer to error type returned from function |
Definition at line 1927 of file iGeom_CGMA.cc.
{ void *val_ptr = data_out; int val_size = sizeof(double); iGeom_getArrData(instance, &entity_handle, 1, tag_handle, &val_ptr, &val_size, &val_size, err); }
static void iGeom_getDescription | ( | iGeom_Instance | instance, |
char * | descr, | ||
int | descr_len | ||
) | [static] |
Get a description of the error returned from the last iGeom call.
Get a description of the error returned from the last iGeom function
instance | iGeom instance handle |
descr | Pointer to a character string to be filled with a description of the error from the last iGeom function |
descr_len | Length of the character string pointed to by descr |
Definition at line 585 of file iGeom_CGMA.cc.
{ CGM_iGeom_getLastErrorDesc(description_buffer, description_buffer_length); }
static void iGeom_getEgCvtrXYZ | ( | iGeom_Instance | instance, |
iBase_EntityHandle | edge_handle, | ||
double | x, | ||
double | y, | ||
double | z, | ||
double * | cvtr_i, | ||
double * | cvtr_j, | ||
double * | cvtr_k, | ||
int * | err | ||
) | [static] |
Get the principle curvature vector for an edge at a point.
Get the principle curvature vector for an edge at a point. Magnitude of vector is the curvature, direction is direction of principal curvature.
instance | iGeom instance handle |
edge_handle | Edge being queried |
x | Position being queried |
y | Position being queried |
z | Position being queried |
cvtr_i | Maximum curvature vector |
cvtr_j | Maximum curvature vector |
cvtr_k | Maximum curvature vector |
*err | Pointer to error type returned from function |
Definition at line 2751 of file iGeom_CGMA.cc.
{ RefEntity* entity = (RefEntity*)edge_handle; RefEdge* edge = dynamic_cast<RefEdge*>(entity); if (!edge) RETURN(iBase_INVALID_ENTITY_TYPE); CubitVector loc(x,y,z), junk, curv; CubitStatus status = edge->closest_point( loc, junk, 0, &curv ); curv.get_xyz( *cvtr_i, *cvtr_j, *cvtr_k ); RETURN( (status == CUBIT_SUCCESS ? iBase_SUCCESS : iBase_FAILURE) ); }
static void iGeom_getEgEvalXYZ | ( | iGeom_Instance | instance, |
iBase_EntityHandle | edge_handle, | ||
double | x, | ||
double | y, | ||
double | z, | ||
double * | on_x, | ||
double * | on_y, | ||
double * | on_z, | ||
double * | tgnt_i, | ||
double * | tgnt_j, | ||
double * | tgnt_k, | ||
double * | cvtr_i, | ||
double * | cvtr_j, | ||
double * | cvtr_k, | ||
int * | err | ||
) | [static] |
Get closest point, tangent, and curvature of edge.
Get closest point, tangent, and curvature of edge.
instance | iGeom instance handle |
edge_handle | Edge being queried |
x | Point at which entity is being queried |
y | Point at which entity is being queried |
z | Point at which entity is being queried |
on_x | Closest point at point being queried |
on_y | Closest point at point being queried |
on_z | Closest point at point being queried |
tgnt_i | Tangent at point being queried |
tgnt_j | Tangent at point being queried |
tgnt_k | Tangent at point being queried |
cvtr_i | Curvature at point being queried |
cvtr_j | Curvature at point being queried |
cvtr_k | Curvature at point being queried |
*err | Pointer to error type returned from function |
Definition at line 2902 of file iGeom_CGMA.cc.
{ RefEntity* entity = (RefEntity*)edge_handle; RefEdge* edge = dynamic_cast<RefEdge*>(entity); if (!edge) RETURN(iBase_INVALID_ENTITY_TYPE); CubitVector loc(x,y,z), on, tan, curv; CubitStatus status = edge->closest_point( loc, on, &tan, &curv ); on.get_xyz( *on_x, *on_y, *on_z ); tan.get_xyz( *tan_i, *tan_j, *tan_k ); curv.get_xyz( *cvtr_i, *cvtr_j, *cvtr_k ); RETURN( (status == CUBIT_SUCCESS ? iBase_SUCCESS : iBase_FAILURE) ); }
static void iGeom_getEgFcArrSense | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | edge_handles, | ||
int | edge_handles_size, | ||
iBase_EntityHandle const * | face_handles, | ||
int | face_handles_size, | ||
int ** | sense, | ||
int * | sense_allocated, | ||
int * | sense_size, | ||
int * | err | ||
) | [static] |
Get the senses of an array of edges with respect to an array of faces.
Get the senses of an array of edges with respect to an array of faces. Sense returned is -1, 0, or 1, representing "reversed", "both", or "forward". "both" sense indicates that edge bounds the face once with each sense.
instance | iGeom instance handle |
edge_handles | Edges being queried |
edge_handles_size | Size of edge handles array |
face_handles | Faces being queried |
face_handles_size | Size of face handles array |
sense | Senses of faces with respect to regions |
sense_allocated | Allocated size of senses array |
sense_size | Occupied size of senses array |
*err | Pointer to error type returned from function |
Definition at line 3821 of file iGeom_CGMA.cc.
{ size_t faces_step, edges_step; int count; if (faces_size == edges_size) { faces_step = edges_step = 1; count = faces_size; } else if (faces_size == 1) { faces_step = 0; edges_step = 1; count = edges_size; } else if (edges_size == 1) { faces_step = 1; edges_step = 0; count = faces_size; } else { ERROR( iBase_INVALID_ENTITY_COUNT, "Mismatched input array sizes" ); } RefEntity** face_iter = (RefEntity**)faces; RefEntity** edge_iter = (RefEntity**)edges; ALLOC_CHECK_ARRAY( senses, count ); for (int i = 0; i < count; ++i) { RefEdge *edge_ent = dynamic_cast<RefEdge*>(*edge_iter); if (NULL == edge_ent) { ERROR(iBase_INVALID_ENTITY_TYPE, "1st argument to getGnormalSense must be a face."); } RefFace *face_ent = dynamic_cast<RefFace*>(*face_iter); if (NULL == face_ent) { ERROR(iBase_INVALID_ENTITY_TYPE, "2nd argument to getGnormalSense must be a region."); } (*senses)[i] = iGeom_get_nonmanifold_sense( edge_ent, face_ent, err ); if (iBase_SUCCESS != *err) return; face_iter += faces_step; edge_iter += edges_step; } KEEP_ARRAY(senses); RETURN(iBase_SUCCESS); }
static void iGeom_getEgFcSense | ( | iGeom_Instance | instance, |
iBase_EntityHandle | gedge, | ||
iBase_EntityHandle | gface, | ||
int * | rel_sense, | ||
int * | err | ||
) | [static] |
Get the sense of an edge with respect to a face.
Get the sense of an edge with respect to a face. Sense returned is -1, 0, or 1, representing "reversed", "both", or "forward". "both" sense indicates that edge bounds the face once with each sense.
instance | iGeom instance handle |
edge | Edge being queried |
face | Face being queried |
sense_out | Sense of edge with respect to face |
*err | Pointer to error type returned from function |
Return the sense of a gedge with respect to a gface. Sense is either forward (=1), reverse (=-1), both (=0), or unknown (=2). Error is returned if first entity is not a gedge or second entity is not a gface.
gedge | Gedge whose sense is being queried. |
gface | Gface gedge is being queried with respect to |
Definition at line 3802 of file iGeom_CGMA.cc.
{ const RefEdge *edge_ent = dynamic_cast<const RefEdge*>(ENTITY_HANDLE(gedge)); if (NULL == edge_ent) { ERROR(iBase_INVALID_ENTITY_TYPE, "1st argument to getGtangentSense must be an edge."); } const RefFace *face_ent = dynamic_cast<const RefFace*>(ENTITY_HANDLE(gface)); if (NULL == face_ent) { ERROR(iBase_INVALID_ENTITY_TYPE, "2nd argument to getGtangentSense must be a face."); } *rel_sense = iGeom_get_nonmanifold_sense( edge_ent, face_ent, err ); RETURN(iBase_SUCCESS); }
static void iGeom_getEgVtxArrSense | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | edge_handles, | ||
int | edge_handles_size, | ||
iBase_EntityHandle const * | vertex_handles_1, | ||
int | veretx_handles_1_size, | ||
iBase_EntityHandle const * | vertex_handles_2, | ||
int | vertex_handles_2_size, | ||
int ** | sense, | ||
int * | sense_allocated, | ||
int * | sense_size, | ||
int * | err | ||
) | [static] |
Get the senses of vertex pair with respect to a edges.
Get the senses of vertex pairs with respect to edges. Sense returned is -1, 0, or 1, representing "reversed", "both", or "forward". "both" sense indicates that both vertices in pair are identical and that vertex bounds both sides of the edge.
instance | iGeom instance handle |
edge_handles | Edges being queried |
edge_handles_size | Number of edges being queried |
vertex_handles_1 | First vertex being queried |
vertex_handles_1_size | Number of vertices in vertices array |
vertex_handles_2 | Second vertex being queried |
vertex_handles_2_size | Number of vertices in vertices array |
sense | Sense of vertex pair with respect to edge |
sense_allocated | Allocated size of sense array |
sense_size | Occupied size of sense array |
*err | Pointer to error type returned from function |
Definition at line 3904 of file iGeom_CGMA.cc.
{ int count; size_t edge_step, start_step, end_step; edge_step = edges_size > 1; start_step = start_vertices_size > 1; end_step = end_vertices_size > 1; count = edges_size; if (count != 1) { if (start_vertices_size != 1 && start_vertices_size != count) { ERROR( iBase_INVALID_ENTITY_COUNT, "Mismatched input array sizes" ); } } else count = start_vertices_size; if (count != 1) { if (end_vertices_size != 1 && end_vertices_size != count) { ERROR( iBase_INVALID_ENTITY_COUNT, "Mismatched input array sizes" ); } } else count = end_vertices_size; ALLOC_CHECK_ARRAY( senses, count ); RefEntity** edge_iter = (RefEntity**)edges; RefEntity** start_iter = (RefEntity**)start_vertices; RefEntity** end_iter = (RefEntity**)end_vertices; for (int i = 0; i < count; ++i) { RefEdge* edge = dynamic_cast<RefEdge*>(*edge_iter); RefVertex* vtx1 = dynamic_cast<RefVertex*>(*start_iter); RefVertex* vtx2 = dynamic_cast<RefVertex*>(*end_iter); if (!edge || !vtx1 || !vtx2) { ERROR(iBase_INVALID_ENTITY_TYPE, "Bad entity argument to getGvertexTangentSense."); } (*senses)[i] = iGeom_edge_vertex_sense( edge, vtx1, vtx2, err ); if (iBase_SUCCESS != *err) return; edge_iter += edge_step; start_iter += start_step; end_iter += end_step; } KEEP_ARRAY(senses); RETURN(iBase_SUCCESS); }
static void iGeom_getEgVtxSense | ( | iGeom_Instance | instance, |
iBase_EntityHandle | gedge, | ||
iBase_EntityHandle | gvertex1, | ||
iBase_EntityHandle | gvertex2, | ||
int * | rel_sense, | ||
int * | err | ||
) | [static] |
Get the sense of a vertex pair with respect to an edge.
Get the sense of a vertex pair with respect to an edge. Sense returned is -1, 0, or 1, representing "reversed", "both", or "forward". "both" sense indicates that vertices are identical and that vertex bounds both sides of the edge.
instance | iGeom instance handle |
edge | Edge being queried |
vertex1 | First vertex being queried |
vertex2 | Second vertex being queried |
sense_out | Sense of vertex pair with respect to edge |
*err | Pointer to error type returned from function |
Return the sense of a gedge with respect to a specified order of vertices bounding the gedge. Sense is either forward (=1), reverse (=-1), or closed (=0). Error is returned if any gentities are not the expected type or if the gedge is bounded by only one gvertex (in this case, use getGtangentSense).
gedge | Gedge whose sense is being queried. |
gvertex1 | First gvertex |
gvertex2 | Second gvertex |
Definition at line 3886 of file iGeom_CGMA.cc.
{ const RefEdge *this_edge = dynamic_cast<const RefEdge*>(ENTITY_HANDLE(gedge)); const RefVertex *vertex1 = dynamic_cast<const RefVertex*>(ENTITY_HANDLE(gvertex1)); const RefVertex *vertex2 = dynamic_cast<const RefVertex*>(ENTITY_HANDLE(gvertex2)); if (NULL == this_edge || NULL == vertex1 || NULL == vertex2) { ERROR(iBase_INVALID_ENTITY_TYPE, "Bad entity argument to getGvertexTangentSense."); } *rel_sense = iGeom_edge_vertex_sense( this_edge, vertex1, vertex2, err ); RETURN(iBase_SUCCESS); }
static void iGeom_getEHArrData | ( | iGeom_Instance | instance, |
const iBase_EntityHandle * | entity_handles, | ||
int | entity_handles_size, | ||
iBase_TagHandle | tag_handle, | ||
iBase_EntityHandle ** | tag_value, | ||
int * | tag_value_allocated, | ||
int * | tag_value_size, | ||
int * | err | ||
) | [static] |
Get tag values of entity handle type for an array of entities.
Get tag values of entity handle type for an array of entities.
instance | iGeom instance handle |
entity_handles | Entity array on which tag is being set |
entity_handles_size | Number of entities in array |
tag_handle | Tag being set on an entity |
*tag_value | Pointer to tag data array being returned from function |
tag_value_allocated | Pointer to allocated size of tag data array |
tag_value_size | Pointer to occupied size of tag data array |
*err | Pointer to error type returned from function |
Definition at line 1775 of file iGeom_CGMA.cc.
{ int tag_value_allocated_tmp = *tag_value_allocated * sizeof(iBase_EntityHandle); int tag_value_size_tmp = *tag_value_size * sizeof(iBase_EntityHandle); iGeom_getArrData(instance, entity_handles, entity_handles_size, tag_handle, reinterpret_cast<void**>(tag_value), &tag_value_allocated_tmp, &tag_value_size_tmp, err); *tag_value_allocated = tag_value_allocated_tmp / sizeof(iBase_EntityHandle); *tag_value_size = tag_value_size_tmp / sizeof(iBase_EntityHandle); }
static void iGeom_getEHData | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
iBase_TagHandle | tag_handle, | ||
iBase_EntityHandle * | out_data, | ||
int * | err | ||
) | [static] |
Get the value of a tag of entity handle type on an entity.
Get the value of a tag of entity handle type on an entity.
instance | iGeom instance handle |
entity_handle | Entity on which tag is being set |
tag_handle | Tag being set on an entity |
*out_data | Pointer to tag value returned from function |
*err | Pointer to error type returned from function |
Definition at line 1940 of file iGeom_CGMA.cc.
{ void *val_ptr = data_out; int val_size = sizeof(iBase_EntityHandle); iGeom_getArrData(instance, &entity_handle, 1, tag_handle, &val_ptr, &val_size, &val_size, err); }
static void iGeom_getEnt1stDrvt | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
double | u, | ||
double | v, | ||
double ** | drvt_u, | ||
int * | drvt_u_allocated, | ||
int * | drvt_u_size, | ||
double ** | drvt_v, | ||
int * | dvrt_v_allocated, | ||
int * | dvrt_v_size, | ||
int * | err | ||
) | [static] |
Get the first derivative of a face at specified parametric position.
Get the first derivative of a face at specified parametric position.
instance | iGeom instance handle |
entity_handle | Entity being queried |
u | Parametric position being queried |
v | Parametric position being queried |
dvrt_u | Pointer to coordinates of derivative with respect to u at specified position returned from function |
dvrt_u_allocated | Allocated size of dvrt_u array |
dvrt_u_size | Occupied size of dvrt_u array |
dvrt_v | Pointer to coordinates of derivative with respect to v at specified position returned from function |
dvrt_v_allocated | Allocated size of dvrt_v array |
dvrt_v_size | Occupied size of dvrt_v array |
*err | Pointer to error type returned from function |
Definition at line 5446 of file iGeom_CGMA.cc.
{ RefFace* face = dynamic_cast<RefFace*>((RefEntity*)entity_handle); if (!face) { ERROR( iBase_INVALID_ENTITY_TYPE, "Derivatives only for faces." ); } CubitVector du, dv; CubitStatus s = face->get_surface_ptr()->uv_derivitives( u, v, du, dv ); if (CUBIT_SUCCESS != s) { RETURN(iBase_FAILURE); } ALLOC_CHECK_ARRAY_NOFAIL( dvrt_u, 3 ); ALLOC_CHECK_ARRAY_NOFAIL( dvrt_v, 3 ); du.get_xyz( *dvrt_u ); dv.get_xyz( *dvrt_v ); RETURN (iBase_SUCCESS); }
static void iGeom_getEnt2ndAdj | ( | iGeom_Instance | instance, |
iBase_EntityHandle | gentity_handle, | ||
int | bridge_dimension, | ||
int | to_dimension, | ||
iBase_EntityHandle ** | adjacent_gentities, | ||
int * | adjacent_gentities_allocated, | ||
int * | adjacent_gentities_size, | ||
int * | err | ||
) | [static] |
Get "2nd order" adjacencies to an entity.
Get "2nd order" adjacencies to an entity, that is, from an entity, through other entities of a specified "bridge" dimension, to other entities of another specified "to" dimension.
instance | iGeom instance handle |
entity_handle | Entity from which adjacencies are requested |
bridge_dimension | Bridge dimension for 2nd order adjacencies |
to_dimension | Dimension of adjacent entities returned |
adjacent_entities | Adjacent entities |
adjacent_entities_allocated | Allocated size of returned array |
adjacent_entities_size | Occupied size of returned array |
*err | Pointer to error type returned from function |
Get the "2nd order" adjacent entities, through a specified "bridge" dimension, of a target dimension. For example, given a region, return the regions (to_dimension=3) sharing an edge (bridge_dimension=1) with that region. bridge_dimension must be less than dimension of gentity_handle, and to_dimension must be greater than bridge dimension.
gentity_handle | Entity for which 2nd order adjacencies are requested |
to_dimension | Target dimension of 2nd order adjacent entities |
bridge_dimension | Dimension of "bridge" entities |
adj_gentities | List returned with 2nd order adjacent entities |
Definition at line 1354 of file iGeom_CGMA.cc.
{ // for better or worse, go to cgm as quickly as possible, to avoid working with // sidl arrays const RefEntity *gentity = ENTITY_HANDLE(gentity_handle); DLIList<RefEntity*> to_ents, bridge_ents, tmp_ents; iGeom_get_adjacent_entities(gentity, bridge_dimension, bridge_ents, err); if (iBase_SUCCESS != *err) return; for (int i = bridge_ents.size(); i > 0; i--) { iGeom_get_adjacent_entities(bridge_ents.get_and_step(), to_dimension, tmp_ents, err); if (iBase_SUCCESS != *err) return; to_ents += tmp_ents; tmp_ents.clean_out(); } to_ents.uniquify_unordered(); ALLOC_CHECK_ARRAY_NOFAIL(adjacent_gentities, to_ents.size()); to_ents.copy_to((RefEntity**)*adjacent_gentities); RETURN(iBase_SUCCESS); }
static void iGeom_getEnt2ndDrvt | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
double | u, | ||
double | v, | ||
double ** | drvt_uu, | ||
int * | drvt_uu_allocated, | ||
int * | drvt_uu_size, | ||
double ** | drvt_vv, | ||
int * | dvrt_vv_allocated, | ||
int * | dvrt_vv_size, | ||
double ** | drvt_uv, | ||
int * | dvrt_uv_allocated, | ||
int * | dvrt_uv_size, | ||
int * | err | ||
) | [static] |
Get the second derivative of a face at specified parametric position.
Get the second derivative of a face at specified parametric position.
instance | iGeom instance handle |
entity_handle | Entity being queried |
u | Parametric position being queried |
v | Parametric position being queried |
dvrt_uu | Pointer to coordinates of derivative with respect to u at specified position returned from function |
dvrt_uu_allocated | Allocated size of dvrt_uu array |
dvrt_uu_size | Occupied size of dvrt_uu array |
dvrt_vv | Pointer to coordinates of derivative with respect to v at specified position returned from function |
dvrt_vv_allocated | Allocated size of dvrt_vv array |
dvrt_vv_size | Occupied size of dvrt_vv array |
dvrt_uv | Pointer to coordinates of derivative with respect to u and v at specified position returned from function |
dvrt_uv_allocated | Allocated size of dvrt_uv array |
dvrt_uv_size | Occupied size of dvrt_uv array |
*err | Pointer to error type returned from function |
Definition at line 5566 of file iGeom_CGMA.cc.
{ RETURN(iBase_NOT_SUPPORTED); }
static void iGeom_getEntAdj | ( | iGeom_Instance | instance, |
iBase_EntityHandle | gentity_handle, | ||
int | to_dimension, | ||
iBase_EntityHandle ** | adj_gentities, | ||
int * | adj_gentities_allocated, | ||
int * | adj_gentities_size, | ||
int * | err | ||
) | [static] |
Get entities of specified type adjacent to an entity.
Get entities of specified type adjacent to an entity. Specified type must be value in the iBase_EntityType enumeration.
instance | iGeom instance handle |
entity_handle | Entity handle being queried |
entity_type_requested | Type of adjacent entities requested |
*adj_entity_handles | Pointer to array of adjacent entities returned from function |
*adj_entity_handles_allocated | Pointer to allocated size of adj_entity_handles array |
*adj_entity_handles_size | Pointer to occupied size of adj_entity_handles array |
*err | Pointer to error type returned from function |
Get the adjacent entities of a given dimension.
gentity_handle | Entity for which adjacencies are requested |
to_dimension | Target dimension of adjacent entities |
adj_gentities | List returned with adjacent entities |
Definition at line 1288 of file iGeom_CGMA.cc.
{ const RefEntity *tmp_hndl = ENTITY_HANDLE(gentity_handle); if (tmp_hndl->dimension() == to_dimension) { ERROR(iBase_INVALID_ARGUMENT, "Can't get adjacencies to entities of same dimension."); } static DLIList<RefEntity*> tmp_ents; iGeom_get_adjacent_entities(tmp_hndl, to_dimension, tmp_ents, err); if (iBase_SUCCESS != *err) return; ALLOC_CHECK_ARRAY_NOFAIL(adj_gentities, tmp_ents.size()); tmp_ents.copy_to((RefEntity**)*adj_gentities); RETURN(iBase_SUCCESS); }
static void iGeom_getEntArrCvtrXYZ | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | entity_handles, | ||
int | entity_handles_size, | ||
int | storage_order, | ||
double const * | coords, | ||
int | coords_size, | ||
double ** | cvtr_1, | ||
int * | cvtr_1_allocated, | ||
int * | cvtr_1_size, | ||
double ** | cvtr_2, | ||
int * | cvtr_2_allocated, | ||
int * | cvtr_2_size, | ||
int * | err | ||
) | [static] |
Get the curvature(s) on an entity(ies) at given position(s)
Get the curvature(s) on an entity(ies) at given position(s). If either the number of entities or number of coordinate triples is unity, then all points or entities are queried for that entity or point, respectively, otherwise each point corresponds to each entity. storage_order should be a value in the iBase_StorageOrder enum.
instance | iGeom instance handle |
entity_handles | Entity(ies) being queried |
entity_handles_size | Number of entities being queried |
storage_order | Storage order of coordinates |
coords | Starting coordinates |
coords_size | Number of values in coordinates array |
cvtr_1 | First principal curvatures |
cvtr_1_allocated | Allocated size of first curvature array |
cvtr_1_size | Occupied size of first curvature array |
cvtr_2 | Second principal curvatures |
cvtr_2_allocated | Allocated size of second curvature array |
cvtr_2_size | Occupied size of second curvature array |
*err | Pointer to error type returned from function |
Definition at line 2773 of file iGeom_CGMA.cc.
{ RefEntity** entities = (RefEntity**)(entity_handles); /* set up iteration according to storage order. allow either gentity_handles or near_coordinates to contain only one value, where that single value is applied for every entry in the other list. */ size_t coord_step, cvtr_step = 1, ent_step; int count; if (3*entity_handles_size == coordinates_size) { coord_step = ent_step = 1; count = entity_handles_size; } else if (coordinates_size == 3) { coord_step = 0; ent_step = 1; count = entity_handles_size; } else if (entity_handles_size == 1) { coord_step = 1; ent_step = 0; count = coordinates_size / 3; } else { ERROR( iBase_INVALID_ENTITY_COUNT, "Mismatched array sizes" ); } /* check if input list contains any surfaces. */ bool have_surfs = false; for (int s = 0; s < entity_handles_size; ++s) if (dynamic_cast<RefFace*>(entities[s])) { have_surfs = true; break; } // check or pre-allocate the coordinate arrays ALLOC_CHECK_ARRAY( cvtr_1, 3*count ); ALLOC_CHECK_ARRAY( cvtr_2, have_surfs ? 3*count : 0 ); const double *coord_x, *coord_y, *coord_z; double *c1x, *c1y, *c1z, *c2x, *c2y, *c2z; if (storage_order == iBase_BLOCKED) { coord_x = coordinates; coord_y = coord_x + coordinates_size/3; coord_z = coord_y + coordinates_size/3; c1x = *cvtr_1; c1y = c1x + count; c1z = c1y + count; c2x = *cvtr_2; c2y = c2x + count; c2z = c2y + count; cvtr_step = 1; } else { storage_order = iBase_INTERLEAVED; /* set if unspecified */ coord_x = coordinates; coord_y = coord_x+1; coord_z = coord_x+2; c1x = *cvtr_1; c1y = c1x+1; c1z = c1x+2; c2x = *cvtr_2; c2y = c2x+1; c2z = c2x+2; coord_step *= 3; cvtr_step = 3; } RefFace *face; RefEdge *edge; CubitStatus result = CUBIT_SUCCESS; for (int i = 0; i < count; ++i) { CubitStatus status; const CubitVector coords( *coord_x, *coord_y, *coord_z ); if ((face = dynamic_cast<RefFace*>(*entities))) { Surface* surf = face->get_surface_ptr(); CubitVector curv1, curv2; status = surf->closest_point( coords, 0, 0, &curv1, &curv2 ); curv1.get_xyz( *c1x, *c1y, *c1z ); curv2.get_xyz( *c2x, *c2y, *c2z ); } else if ((edge = dynamic_cast<RefEdge*>(*entities))) { CubitVector junk, curv; status = edge->closest_point( coords, junk, 0, &curv ); curv.get_xyz( *c1x, *c1y, *c1z ); } else { status = CUBIT_FAILURE; } if (CUBIT_SUCCESS != status) result = status; entities += ent_step; coord_x += coord_step; coord_y += coord_step; coord_z += coord_step; c1x += cvtr_step; c1y += cvtr_step; c1z += cvtr_step; c2x += cvtr_step; c2y += cvtr_step; c2z += cvtr_step; } if (result == CUBIT_FAILURE) RETURN(iBase_FAILURE); KEEP_ARRAY( cvtr_1 ); KEEP_ARRAY( cvtr_2 ); RETURN( iBase_SUCCESS ); }
static void iGeom_getEntBoundBox | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
double * | min_x, | ||
double * | min_y, | ||
double * | min_z, | ||
double * | max_x, | ||
double * | max_y, | ||
double * | max_z, | ||
int * | err | ||
) | [static] |
Get the bounding box of the specified entity.
Get the bounding box of the specified entity
instance | iGeom instance handle |
entity_handle | Entity being queried |
min_x | Minimum coordinate of bounding box |
min_y | Minimum coordinate of bounding box |
min_z | Minimum coordinate of bounding box |
max_x | Maximum coordinate of bounding box |
max_y | Maximum coordinate of bounding box |
max_z | Maximum coordinate of bounding box |
*err | Pointer to error type returned from function |
Definition at line 3273 of file iGeom_CGMA.cc.
{ RefEntity* entity = (RefEntity*)entity_handle; CubitVector minc, maxc; CubitStatus status = iGeom_bounding_box( entity, minc, maxc ); minc.get_xyz( *min_x, *min_y, *min_z ); maxc.get_xyz( *max_x, *max_y, *max_z ); RETURN( (status == CUBIT_SUCCESS ? iBase_SUCCESS : iBase_FAILURE) ); }
static void iGeom_getEntClosestPt | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
double | near_x, | ||
double | near_y, | ||
double | near_z, | ||
double * | on_x, | ||
double * | on_y, | ||
double * | on_z, | ||
int * | err | ||
) | [static] |
Get closest point to an entity.
Get closest point to a specified position on an entity
instance | iGeom instance handle |
entity_handle | Entity being queried |
near_x | Coordinates of starting point |
near_y | Coordinates of starting point |
near_z | Coordinates of starting point |
on_x | Closest point on entity |
on_y | Closest point on entity |
on_z | Closest point on entity |
*err | Pointer to error type returned from function |
Definition at line 2204 of file iGeom_CGMA.cc.
{ RefEntity* entity = (RefEntity*)entity_handle; CubitVector on, near(near_x, near_y, near_z); CubitStatus status = iGeom_closest_point( entity, near, on ); if (status == CUBIT_FAILURE) { ERROR(iBase_FAILURE, "Problems getting closest point for some entity."); } on.get_xyz( *on_x, *on_y, *on_z ); RETURN(iBase_SUCCESS); }
static void iGeom_getEntClosestPtTrimmed | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
double | near_x, | ||
double | near_y, | ||
double | near_z, | ||
double * | on_x, | ||
double * | on_y, | ||
double * | on_z, | ||
int * | err | ||
) | [static] |
Get closest point for an array of entities and points For surfaces, closest point could be on the void space inside it. Get closest point for an array of entities and points. If either the number of entities or number of coordinate triples is unity, then all points or entities are queried for that entity or point, respectively, otherwise each point corresponds to each entity. storage_order should be a value in the iBase_StorageOrder enum.
instance | iGeom instance handle |
entity_handles | Entity(ies) being queried |
entity_handles_size | Number of entities being queried |
storage_order | Storage order of input points |
near_coordinates | Coordinates of starting point(s) |
near_coordinates_size | Number of values in near_coordinates array |
on_coordinates | Coordinates of closest points |
on_coordinates_allocated | Allocated size of closest point array |
on_coordinates_size | Occupied size of closest point array |
*err | Pointer to error type returned from function |
Definition at line 2225 of file iGeom_CGMA.cc.
{ RefEntity* entity = (RefEntity*)entity_handle; CubitVector on, near(near_x, near_y, near_z); CubitStatus status = iGeom_closest_point_trimmed( entity, near, on ); if (status == CUBIT_FAILURE) { ERROR(iBase_FAILURE, "Problems getting closest point for some entity."); } on.get_xyz( *on_x, *on_y, *on_z ); RETURN(iBase_SUCCESS); }
static void iGeom_getEntities | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | set_handle, | ||
int | gentity_type, | ||
iBase_EntityHandle ** | gentity_handles, | ||
int * | gentity_handles_allocated, | ||
int * | gentity_handles_size, | ||
int * | err | ||
) | [static] |
Get entities of specific type in set or instance.
Get entities of specific type in set or instance. All entities are requested by specifying iBase_ALL_TYPES. Specified type must be a value in the iBase_EntityType enumeration.
instance | iGeom instance handle |
entity_set_handle | Entity set being queried |
entity_type | Type of entities being requested |
entity_topology | Topology of entities being requested |
*entity_handles | Pointer to array of entity handles returned from function |
*entity_handles_allocated | Pointer to allocated size of entity_handles array |
*entity_handles_size | Pointer to occupied size of entity_handles array |
*err | Pointer to error type returned from function |
Return gentities of specified dimension in this set, or in whole model.
set_handle | Entity set being queried (if 0, whole model) |
gentity_dimension | Dimension of entities being queried |
gentity_handles | Entity handles |
Definition at line 1159 of file iGeom_CGMA.cc.
{ if (RefGroup *this_set = SET_HANDLE(set_handle)) { static DLIList<CubitEntity*> centities; centities.clean_out(); this_set->get_child_entities(centities); copy_ibase_type( gentity_type, centities, gentity_handles, gentity_handles_allocated, gentity_handles_size, err ); } else { static DLIList<RefEntity*> dim_entities; dim_entities.clean_out(); append_all_ibase_type( gentity_type, dim_entities, err ); if (iBase_SUCCESS != *err) return; ALLOC_CHECK_ARRAY_NOFAIL(gentity_handles, dim_entities.size()); dim_entities.copy_to((RefEntity**)*gentity_handles); RETURN(iBase_SUCCESS); } }
static void iGeom_getEntNrmlPlXYZ | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
double | x, | ||
double | y, | ||
double | z, | ||
double * | pt_x, | ||
double * | pt_y, | ||
double * | pt_z, | ||
double * | nrml_i, | ||
double * | nrml_j, | ||
double * | nrml_k, | ||
int * | err | ||
) | [static] |
Get the normal vector AND closest point on an entity at given position.
Get the normal vector AND closest point on an entity at a given position.
entity_handle | Entity being queried |
instance | iGeom instance handle |
x | Starting coordinates |
y | Starting coordinates |
z | Starting coordinates |
pt_x | Closest point |
pt_y | Closest point |
pt_z | Closest point |
nrml_i | Normal at closest point |
nrml_j | Normal at closest point |
nrml_k | Normal at closest point |
*err | Pointer to error type returned from function |
Definition at line 2342 of file iGeom_CGMA.cc.
{ RefEntity* entity = (RefEntity*)entity_handle; CubitVector pt, nmrl, near(x, y, z); CubitStatus status = iGeom_closest_point_and_normal( entity, near, pt, nmrl ); if (status == CUBIT_FAILURE) { ERROR(iBase_FAILURE, "Problems getting closest point for some entity."); } pt.get_xyz( *pt_x, *pt_y, *pt_z ); nmrl.get_xyz( *nmrl_i, *nmrl_j, *nmrl_k ); RETURN(iBase_SUCCESS); }
static void iGeom_getEntNrmlSense | ( | iGeom_Instance | instance, |
iBase_EntityHandle | gface, | ||
iBase_EntityHandle | gregion, | ||
int * | rel_sense, | ||
int * | err | ||
) | [static] |
Get the sense of a face with respect to a region.
Get the sense of a face with respect to a region. Sense returned is -1, 0, or 1, representing "reversed", "both", or "forward". "both" sense indicates that face bounds the region once with each sense.
instance | iGeom instance handle |
face | Face being queried |
region | Region being queried |
sense_out | Sense of face with respect to region |
*err | Pointer to error type returned from function |
Return the sense of a face with respect to a region. Sense is either forward (=1), reverse (=-1), both (=0). Error is returned if first entity is not a gface or second entity is not a gregion.
gface | face whose sense is being queried. |
gregion | region gface is being queried with respect to |
Definition at line 3687 of file iGeom_CGMA.cc.
{ const RefFace *face_ent = dynamic_cast<const RefFace*>(ENTITY_HANDLE(gface)); if (NULL == face_ent) { ERROR(iBase_INVALID_ENTITY_TYPE, "1st argument to getEntNrmlSense must be a face."); } // XXX: workaround; remove this when we switch iBase_REGIONs to RefVolume const RefVolume *volume_ent; Body *body_ent = dynamic_cast<Body*>(ENTITY_HANDLE(gregion)); if (NULL != body_ent) { DLIList<RefEntity*> children; body_ent->get_child_ref_entities(children); if (children.size() != 1) { ERROR(iBase_FAILURE, "Can only support bodies with one volume"); } volume_ent = dynamic_cast<const RefVolume*>(children[0]); } else { volume_ent = dynamic_cast<const RefVolume*>(ENTITY_HANDLE(gregion)); } if (NULL == volume_ent) { ERROR(iBase_INVALID_ENTITY_TYPE, "2nd argument to getEntNrmlSense must be a region."); } *rel_sense = iGeom_get_nonmanifold_sense( face_ent, volume_ent, err ); }
static void iGeom_getEntNrmlUV | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
double | u, | ||
double | v, | ||
double * | nrml_i, | ||
double * | nrml_j, | ||
double * | nrml_k, | ||
int * | err | ||
) | [static] |
Return the normal at a specified parametric position.
Return the normal at a specified parametric position
instance | iGeom instance handle |
entity_handle | Entity being queried |
u | Parametric position being queried |
v | Parametric position being queried |
nrml_i | Normal at specified position |
nrml_j | Normal at specified position |
nrml_k | Normal at specified position |
*err | Pointer to error type returned from functino |
Definition at line 5295 of file iGeom_CGMA.cc.
{ RefFace* face = dynamic_cast<RefFace*>((RefEntity*)entity_handle); if (!face) { RETURN (iBase_INVALID_ENTITY_TYPE); } CubitVector normal; CubitStatus s = iGeom_normal_from_uv( face, u, v, normal ); normal.get_xyz( *nrml_i, *nrml_j, *nrml_k ); RETURN ((s == CUBIT_SUCCESS ? iBase_SUCCESS : iBase_FAILURE)); }
static void iGeom_getEntNrmlXYZ | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
double | x, | ||
double | y, | ||
double | z, | ||
double * | nrml_i, | ||
double * | nrml_j, | ||
double * | nrml_k, | ||
int * | err | ||
) | [static] |
Get the normal vector on an entity at the given position Get the normal vector on an entity at the given position.
instance | iGeom instance handle |
entity_handle | Entity being queried |
x | Coordinates of starting point |
y | Coordinates of starting point |
z | Coordinates of starting point |
nrml_i | Normal vector at starting point |
nrml_j | Normal vector at starting point |
nrml_k | Normal vector at starting point |
*err | Pointer to error type returned from function |
Definition at line 2479 of file iGeom_CGMA.cc.
{ RefEntity* entity = (RefEntity*)entity_handle; RefFace* face = dynamic_cast<RefFace*>(entity); if (NULL == face) { ERROR(iBase_INVALID_ENTITY_TYPE, "Entities passed into gentityNormal must be faces."); } CubitVector normal, near( near_x, near_y, near_z ); normal = face->normal_at( near ); normal.get_xyz( *nmrl_i, *nmrl_j, *nmrl_k ); RETURN(iBase_SUCCESS); }
static void iGeom_getEntSetData | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set, | ||
iBase_TagHandle | tag_handle, | ||
void ** | tag_value_tmp, | ||
int * | tag_value_allocated, | ||
int * | tag_value_size, | ||
int * | err | ||
) | [static] |
Get the value of a tag of arbitrary type on an entity set.
Get the value of a tag of arbitrary type on an entity set. Tag data is returned back as void*. tag_value_size specifies the size of the memory pointed to by tag_value in terms of bytes. Applications may use this function to get data of any type, not just iBase_BYTES. However because this function supports data of arbitrary type, in all cases the size specified by tag_value_size is always in terms of bytes.
instance | iGeom instance handle |
entity_set_handle | Entity set on which tag is being set |
tag_handle | Tag being set on an entity set |
*tag_value | Pointer to tag data array being queried |
*tag_value_allocated | Pointer to tag data array allocated size |
*tag_value_size | Pointer to occupied size in bytes of tag data array |
*err | Pointer to error type returned from function |
Get the tag data associated with a tag handle from the mesh or gentity_set. It is assumed that the tag_value argument is allocated by the application before being passed into the getTag function.
Definition at line 2070 of file iGeom_CGMA.cc.
{ char **tag_value = reinterpret_cast<char **>(tag_value_tmp); // have to go through RefEntity* so that RefEntity** gets set right RefEntity *tmp_entity = SET_HANDLE(entity_set); iBase_ErrorType retval = TM->getArrData(&tmp_entity, 1, TAG_HANDLE(tag_handle), ARRAY_INOUT(tag_value)); RETURN(retval); }
static void iGeom_getEntSetDblData | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set, | ||
iBase_TagHandle | tag_handle, | ||
double * | out_data, | ||
int * | err | ||
) | [static] |
Get the value of a tag of double type on an entity set.
Get the value of a tag of double type on an entity set.
instance | iGeom instance handle |
entity_set | Entity set on which tag is being set |
tag_handle | Tag being set on an entity set |
*out_data | Pointer to tag value returned from function |
*err | Pointer to error type returned from function |
Definition at line 2100 of file iGeom_CGMA.cc.
{ int tag_size = sizeof(double); void* data_ptr = tag_ptr; iGeom_getEntSetData(instance, entity_set, tag_handle, &data_ptr, &tag_size, &tag_size, err); }
static void iGeom_getEntSetEHData | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set, | ||
iBase_TagHandle | tag_handle, | ||
iBase_EntityHandle * | out_data, | ||
int * | err | ||
) | [static] |
Get the value of a tag of entity handle type on an entity set.
Get the value of a tag of entity handle type on an entity set.
instance | iGeom instance handle |
entity_set | Entity set on which tag is being set |
tag_handle | Tag being set on an entity set |
*out_data | Pointer to tag value returned from function |
*err | Pointer to error type returned from function |
Definition at line 2113 of file iGeom_CGMA.cc.
{ int tag_size = sizeof(iBase_EntityHandle); void* data_ptr = tag_ptr; iGeom_getEntSetData(instance, entity_set, tag_handle, &data_ptr, &tag_size, &tag_size, err); }
static void iGeom_getEntSetESHData | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set, | ||
iBase_TagHandle | tag_handle, | ||
iBase_EntitySetHandle * | out_data, | ||
int * | err | ||
) | [static] |
Get the value of a tag of entity set handle type on an entity set.
Get the value of a tag of entity set handle type on an entity set.
instance | iGeom instance handle |
entity_set | Entity set on which tag is being set |
tag_handle | Tag being set on an entity set |
*out_data | Pointer to tag value returned from function |
*err | Pointer to error type returned from function |
Definition at line 2126 of file iGeom_CGMA.cc.
{ int tag_size = sizeof(iBase_EntitySetHandle); void* data_ptr = tag_ptr; iGeom_getEntSetData(instance, entity_set, tag_handle, &data_ptr, &tag_size, &tag_size, err); }
static void iGeom_getEntSetIntData | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set, | ||
iBase_TagHandle | tag_handle, | ||
int * | out_data, | ||
int * | err | ||
) | [static] |
Get the value of a tag of integer type on an entity set.
Get the value of a tag of integer type on an entity set.
instance | iGeom instance handle |
entity_set | Entity set on which tag is being set |
tag_handle | Tag being set on an entity set |
*out_data | Pointer to tag value returned from function |
*err | Pointer to error type returned from function |
Definition at line 2087 of file iGeom_CGMA.cc.
{ int tag_size = sizeof(int); void* data_ptr = tag_ptr; iGeom_getEntSetData(instance, entity_set, tag_handle, &data_ptr, &tag_size, &tag_size, err); }
static void iGeom_getEntSets | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set, | ||
int | num_hops, | ||
iBase_EntitySetHandle ** | contained_entity_set_handles, | ||
int * | contained_entity_set_handles_allocated, | ||
int * | contained_entity_set_handles_size, | ||
int * | err | ||
) | [static] |
Get the entity sets contained in a set or interface.
Get the entity sets contained in a set or interface. If a set is input which is not the root set, num_hops indicates the maximum number of contained sets from entity_set_handle to one of the contained sets, not inclusive of the contained set.
instance | iGeom instance handle |
entity_set_handle | Entity set being queried |
num_hops | Maximum hops from entity_set_handle to contained set, not inclusive of the contained set |
*contained_set_handles | Pointer to array of set handles returned from function |
contained_set_handles_allocated | Pointer to allocated length of contained_set_handles array |
contained_set_handles_size | Pointer to occupied length of contained_set_handles array |
*err | Pointer to error type returned from function |
Returns the gentity_set handles contained in a given model or gentity_set one level deep
gentity_set_handle | Entity set being queried |
contained_gentity_set_handles | Number of entity sets in gentity_set_handle |
Definition at line 4006 of file iGeom_CGMA.cc.
{ if (0 < num_hops) { ERROR(iBase_NOT_SUPPORTED, "Num_hops argument not yet supported."); } const RefGroup *this_set = SET_HANDLE(entity_set); DLIList<RefEntity*> tmp_ents; DLIList<RefGroup*> groups; if (NULL == this_set) RefEntityFactory::instance()->ref_groups(groups); else { const_cast<RefGroup*>(this_set)->get_child_ref_entities(tmp_ents); CAST_LIST(tmp_ents, groups, RefGroup); } ALLOC_CHECK_ARRAY_NOFAIL(contained_entity_set_handles, groups.size()); groups.copy_to(*SET_HANDLE_ARRAY_PTR(contained_entity_set_handles)); RETURN(iBase_SUCCESS); }
static void iGeom_getEntTgntU | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
double | u, | ||
double * | tgnt_i, | ||
double * | tgnt_j, | ||
double * | tgnt_k, | ||
int * | err | ||
) | [static] |
Return the tangent at a specified parametric position.
Return the tangent at a specified parametric position
instance | iGeom instance handle |
entity_handle | Entity being queried |
u | Parametric position being queried |
tgnt_i | Tangent at specified position |
tgnt_j | Tangent at specified position |
tgnt_k | Tangent at specified position |
*err | Pointer to error type returned from function |
Definition at line 5403 of file iGeom_CGMA.cc.
{ double x, y, z; iGeom_getEntUtoXYZ( instance, entity_handle, param_coord, &x, &y, &z, err ); if (iBase_SUCCESS == *err) iGeom_getEntTgntXYZ( instance, entity_handle, x, y, z, tngt_i, tngt_j, tngt_k, err ); }
static void iGeom_getEntTgntXYZ | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
double | x, | ||
double | y, | ||
double | z, | ||
double * | tgnt_i, | ||
double * | tgnt_j, | ||
double * | tgnt_k, | ||
int * | err | ||
) | [static] |
Get the tangent vector on an entity at given position.
Get the tangent vector on an entity at a given position.
instance | iGeom instance handle |
entity_handle | Entity being queried |
x | Starting coordinates |
y | Starting coordinates |
z | Starting coordinates |
tgnt_i | Tangent at closest point |
tgnt_j | Tangent at closest point |
tgnt_k | Tangent at closest point |
*err | Pointer to error type returned from function |
Definition at line 2599 of file iGeom_CGMA.cc.
{ RefEntity* entity = (RefEntity*)entity_handle; RefEdge* edge = dynamic_cast<RefEdge*>(entity); if (NULL == edge) { ERROR(iBase_INVALID_ENTITY_TYPE, "Entities passed into gentityTangent must be edges."); } CubitVector tangent, near( x, y, x ); edge->tangent( near, tangent ); tangent.get_xyz( *tgnt_i, *tgnt_j, *tgnt_k ); RETURN(iBase_SUCCESS); }
static void iGeom_getEntTolerance | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
double * | tolerance, | ||
int * | err | ||
) | [static] |
Get the tolerance of the specified entity.
Get the tolerance of the specified entity.
instance | iGeom instance handle |
entity_handle | Entity handle being queried |
tolerance | Pointer to tolerance returned from function |
*err | Pointer to error type returned from function |
Definition at line 4325 of file iGeom_CGMA.cc.
{ *tolerance = gqt->get_sme_resabs_tolerance(); RETURN(iBase_SUCCESS); }
static void iGeom_getEntType | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
int * | type, | ||
int * | err | ||
) | [static] |
Get the entity type for the specified entity.
Get the entity type for the specified entity. Type returned is a value in the iBase_EntityType enumeration.
instance | iGeom instance handle |
entity_handle | entity handle being queried |
*type | Pointer to location at which to store the returned type |
*err | Pointer to error type returned from function |
Definition at line 1240 of file iGeom_CGMA.cc.
{ RefEntity* entity = reinterpret_cast<RefEntity*>(handle); if (dynamic_cast<Body*>(entity)) *gtype = iBase_REGION; else *gtype = static_cast<int>(entity->dimension()); RETURN(iBase_SUCCESS); }
static void iGeom_getEntURange | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
double * | u_min, | ||
double * | u_max, | ||
int * | err | ||
) | [static] |
Get parametric range of entity.
Get parametric range of entity
instance | iGeom instance handle |
entity_handle | Entity being queried |
u_min | Minimum parametric coordinate for entity |
u_max | Maximum parametric coordinate for entity |
*err | Pointer to error type returned from function |
Definition at line 4921 of file iGeom_CGMA.cc.
{ RefEntity* entity = (RefEntity*)entity_handle; RefEdge* edge = dynamic_cast<RefEdge*>(entity); if (!edge) { ERROR(iBase_INVALID_ENTITY_TYPE, "Expected edge for 1-param method."); } CubitBoolean r1 = edge->get_param_range(*u_min, *u_max); RETURN( (r1 ? iBase_SUCCESS : iBase_FAILURE) ); }
static void iGeom_getEntUtoUV | ( | iGeom_Instance | instance, |
iBase_EntityHandle | edge_handle, | ||
iBase_EntityHandle | face_handle, | ||
double | in_u, | ||
double * | u, | ||
double * | v, | ||
int * | err | ||
) | [static] |
Return the face parametric coordinates for a parametric position on a bounding edge.
Return the face parametric coordinates for a parametric position on a bounding edge
instance | iGeom instance handle |
edge_handle | Edge being queried |
face_handle | Face being queried |
in_u | Parametric position on edge |
u | Corresponding parametric position on face |
v | Corresponding parametric position on face |
*err | Pointer to error type returned from function |
Definition at line 5033 of file iGeom_CGMA.cc.
{ RefEdge* edge = dynamic_cast<RefEdge*>((RefEntity*)edge_handle); RefFace* face = dynamic_cast<RefFace*>((RefEntity*)face_handle); if (!edge || !face) { RETURN(iBase_INVALID_ENTITY_TYPE); } CubitVector xyz; CubitStatus s; s = edge->position_from_u( in_u, xyz ); if (s != CUBIT_SUCCESS) RETURN(iBase_FAILURE); s = face->u_v_from_position( xyz, *u, *v ); RETURN( (s == CUBIT_SUCCESS ? iBase_SUCCESS : iBase_FAILURE) ); }
static void iGeom_getEntUtoXYZ | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
double | u, | ||
double * | x, | ||
double * | y, | ||
double * | z, | ||
int * | err | ||
) | [static] |
Return coordinate position at specified parametric position on entity.
Return coordinate position at specified parametric position on entity.
instance | iGeom instance handle |
entity_handle | Entity being queried |
u | Parametric coordinate being queried |
x | Spatial coordinate at parametric position being queried |
y | Spatial coordinate at parametric position being queried |
z | Spatial coordinate at parametric position being queried |
*err | Pointer to error type returned from function |
Definition at line 4505 of file iGeom_CGMA.cc.
{ RefEntity* entity = (RefEntity*)entity_handle; RefEdge* edge = dynamic_cast<RefEdge*>(entity); if (!edge) { ERROR(iBase_INVALID_ENTITY_TYPE, "Expected edge for 1-param method."); } CubitVector xyz; CubitStatus s = edge->position_from_u( u, xyz ); xyz.get_xyz( *x, *y, *z ); RETURN( (s == CUBIT_SUCCESS ? iBase_SUCCESS : iBase_FAILURE) ); }
static void iGeom_getEntUVRange | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
double * | u_min, | ||
double * | v_min, | ||
double * | u_max, | ||
double * | v_max, | ||
int * | err | ||
) | [static] |
Get parametric range of entity.
Get parametric range of entity
instance | iGeom instance handle |
entity_handle | Entity being queried |
u_min | Minimum parametric coordinate for entity |
v_min | Minimum parametric coordinate for entity |
u_max | Maximum parametric coordinate for entity |
v_max | Maximum parametric coordinate for entity |
*err | Pointer to error type returned from function |
Definition at line 4901 of file iGeom_CGMA.cc.
{ RefEntity* entity = (RefEntity*)entity_handle; RefFace* face = dynamic_cast<RefFace*>(entity); if (!face) { ERROR(iBase_INVALID_ENTITY_TYPE, "Expected face for UV method."); } CubitBoolean r1 = face->get_param_range_U(*u_min, *u_max); CubitBoolean r2 = face->get_param_range_V(*v_min, *v_max); RETURN( ((r1 && r2) ? iBase_SUCCESS : iBase_FAILURE) ); }
static void iGeom_getEntUVtoXYZ | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
double | u, | ||
double | v, | ||
double * | x, | ||
double * | y, | ||
double * | z, | ||
int * | err | ||
) | [static] |
Return coordinate position at specified parametric position on entity.
Return coordinate position at specified parametric position on entity.
instance | iGeom instance handle |
entity_handle | Entity being queried |
u | Parametric coordinate being queried |
v | Parametric coordinate being queried |
x | Spatial coordinate at parametric position being queried |
y | Spatial coordinate at parametric position being queried |
z | Spatial coordinate at parametric position being queried |
*err | Pointer to error type returned from function |
Definition at line 4401 of file iGeom_CGMA.cc.
{ RefEntity* entity = (RefEntity*)entity_handle; RefFace* face = dynamic_cast<RefFace*>(entity); if (!face) { ERROR(iBase_INVALID_ENTITY_TYPE, "Expected face for UV method."); } CubitVector xyz = face->position_from_u_v( u, v ); xyz.get_xyz( *x, *y, *z ); RETURN(iBase_SUCCESS); }
static void iGeom_getEntXYZtoU | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
double | x, | ||
double | y, | ||
double | z, | ||
double * | u, | ||
int * | err | ||
) | [static] |
Return parametric position at specified spatial position on entity.
Return parametric position at specified spatial position on entity
instance | iGeom instance handle |
entity_handle | Entity being queried |
x | Spatial coordinate being queried |
y | Spatial coordinate being queried |
z | Spatial coordinate being queried |
u | Parametric coordinate at spatial position being queried |
*err | Pointer to error type returned from function |
Definition at line 4708 of file iGeom_CGMA.cc.
{ RefEntity* entity = (RefEntity*)entity_handle; RefEdge* edge = dynamic_cast<RefEdge*>(entity); if (!edge) { ERROR(iBase_INVALID_ENTITY_TYPE, "Expected edge for 1-param method."); } const CubitVector xyz( x, y, z ); *u = edge->u_from_position( xyz ); RETURN(iBase_SUCCESS); }
static void iGeom_getEntXYZtoUV | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
double | x, | ||
double | y, | ||
double | z, | ||
double * | u, | ||
double * | v, | ||
int * | err | ||
) | [static] |
Return parametric position at specified spatial position on entity.
Return parametric position at specified spatial position on entity
instance | iGeom instance handle |
entity_handle | Entity being queried |
x | Spatial coordinate being queried |
y | Spatial coordinate being queried |
z | Spatial coordinate being queried |
u | Parametric coordinate at spatial position being queried |
v | Parametric coordinate at spatial position being queried |
*err | Pointer to error type returned from function |
Definition at line 4600 of file iGeom_CGMA.cc.
{ RefEntity* entity = (RefEntity*)entity_handle; RefFace* face = dynamic_cast<RefFace*>(entity); if (!face) { ERROR(iBase_INVALID_ENTITY_TYPE, "Expected face for UV method."); } const CubitVector xyz( x, y, z ); CubitStatus s = face->u_v_from_position( xyz, *u, *v ); RETURN( (s == CUBIT_SUCCESS ? iBase_SUCCESS : iBase_FAILURE) ); }
static void iGeom_getEntXYZtoUVHint | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
double | x, | ||
double | y, | ||
double | z, | ||
double * | u, | ||
double * | v, | ||
int * | err | ||
) | [static] |
Return parametric position at specified spatial position on entity, based on parametric position hint.
Return parametric position at specified spatial position on entity, based on parametric position hint. For this function, u and v are input with parameters from which to start search. Typically this will reduce the search time for new parametric coordinates.
instance | iGeom instance handle |
entity_handle | Entity being queried |
x | Spatial coordinate being queried |
y | Spatial coordinate being queried |
z | Spatial coordinate being queried |
u | Parametric coordinate at spatial position being queried |
v | Parametric coordinate at spatial position being queried |
*err | Pointer to error type returned from function |
Definition at line 4796 of file iGeom_CGMA.cc.
{ RefEntity* entity = (RefEntity*)entity_handle; RefFace* face = dynamic_cast<RefFace*>(entity); if (!face) { ERROR(iBase_INVALID_ENTITY_TYPE, "Expected face for UV method."); } CubitVector xyz( x, y, z ); face->move_to_surface( xyz, u, v ); RETURN(iBase_SUCCESS); }
static void iGeom_getErrorType | ( | iGeom_Instance | instance, |
int * | error_type | ||
) | [static] |
Get the error type returned from the last iGeom function.
Get the error type returned from the last iGeom function. Value returned is a member of the iBase_ErrorType enumeration.
instance | iGeom instance handle |
*error_type | Error type returned from last iGeom function |
Definition at line 578 of file iGeom_CGMA.cc.
{ *error_type = CGM_iGeom_getLastErrorType(); }
static void iGeom_getESHArrData | ( | iGeom_Instance | instance, |
const iBase_EntityHandle * | entity_handles, | ||
int | entity_handles_size, | ||
iBase_TagHandle | tag_handle, | ||
iBase_EntitySetHandle ** | tag_value, | ||
int * | tag_value_allocated, | ||
int * | tag_value_size, | ||
int * | err | ||
) | [static] |
Get tag values of entity set handle type for an array of entities.
Get tag values of entity set handle type for an array of entities.
instance | iGeom instance handle |
entity_handles | Entity array on which tag is being set |
entity_handles_size | Number of entities in array |
tag_handle | Tag being set on an entity |
*tag_value | Pointer to tag data array being returned from function |
tag_value_allocated | Pointer to allocated size of tag data array |
tag_value_size | Pointer to occupied size of tag data array |
*err | Pointer to error type returned from function |
Definition at line 1797 of file iGeom_CGMA.cc.
{ int tag_value_allocated_tmp = *tag_value_allocated * sizeof(iBase_EntitySetHandle); int tag_value_size_tmp = *tag_value_size * sizeof(iBase_EntitySetHandle); iGeom_getArrData(instance, entity_handles, entity_handles_size, tag_handle, reinterpret_cast<void**>(tag_value), &tag_value_allocated_tmp, &tag_value_size_tmp, err); *tag_value_allocated = tag_value_allocated_tmp / sizeof(iBase_EntitySetHandle); *tag_value_size = tag_value_size_tmp / sizeof(iBase_EntitySetHandle); }
static void iGeom_getESHData | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
iBase_TagHandle | tag_handle, | ||
iBase_EntitySetHandle * | out_data, | ||
int * | err | ||
) | [static] |
Get the value of a tag of entity set handle type on an entity.
Get the value of a tag of entity set handle type on an entity.
instance | iGeom instance handle |
entity_handle | Entity on which tag is being set |
tag_handle | Tag being set on an entity |
*out_data | Pointer to tag value returned from function |
*err | Pointer to error type returned from function |
Definition at line 1953 of file iGeom_CGMA.cc.
{ void *val_ptr = data_out; int val_size = sizeof(iBase_EntitySetHandle); iGeom_getArrData(instance, &entity_handle, 1, tag_handle, &val_ptr, &val_size, &val_size, err); }
static void iGeom_getFacets | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity, | ||
double | dist_tolerance, | ||
double ** | points, | ||
int * | points_allocated, | ||
int * | points_size, | ||
int ** | facets, | ||
int * | facets_allocated, | ||
int * | facets_size, | ||
int * | err | ||
) | [static] |
Return facet information from solid modeling engine.
Return facet information from solid modeling engine
instance | iGeom instance handle |
entity_handle | Entity being queried |
dist_tolerance | Tolerance guidance for faceting engine |
points | List of vertices in faceting of curve or surface |
points_allocated | Allocated size of vertex list array |
points_size | Occupied size of vertex list array |
facets | List of facets in faceting of surface |
facets_allocated | Allocated size of facet list array |
facets_size | Occupied size of facet list array |
*err | Pointer to error type returned from function |
Definition at line 7381 of file iGeom_CGMA.cc.
{ GMem gMem; CubitStatus resl = CUBIT_SUCCESS; RefFace *ref_face = dynamic_cast<RefFace*>(ENTITY_HANDLE(entity)); if(ref_face) resl = ref_face->get_graphics(gMem, 15, dist_tolerance); RefEdge *ref_edge = dynamic_cast<RefEdge*>(ENTITY_HANDLE(entity)); if(ref_edge) resl = ref_edge->get_graphics(gMem, 15, dist_tolerance); if(resl == CUBIT_FAILURE) ERROR(iBase_FAILURE, "Can't get facets for this entity."); if(ref_face || ref_edge) { int p_count = gMem.point_list_size(); int f_count = gMem.facet_list_size(); if(p_count) { ALLOC_CHECK_ARRAY_NOFAIL(points, p_count * 3); GPoint* gpoints = gMem.point_list(); double *x, *y, *z; x = *points; y = x + 1; z = x + 2; size_t step = 3; for(int i = 0; i < p_count; i++) { GPoint pt = gpoints[i]; *x = pt.x; *y = pt.y; *z = pt.z; x += step; y += step; z += step; } } if(f_count) { //return all the triangles. Current gMem gives 4*triangle facets which //includes a '3' for each facet set to indicate there are 3 nodes on //the tessilation. Here trying to ignore the '3'. ALLOC_CHECK_ARRAY_NOFAIL(facets, f_count*3/4); int *connectivity; connectivity = *facets; int* list = gMem.facet_list(); for (int i = 0; i < f_count/4; i++) { *connectivity = list[i*4 + 1]; *(connectivity + 1) = list[i*4 + 2]; *(connectivity + 2) = list[i*4 + 3]; connectivity += 3; } } RETURN(iBase_SUCCESS); } else RETURN(iBase_INVALID_ENTITY_TYPE); }
static void iGeom_getFaceType | ( | iGeom_Instance | instance, |
iBase_EntityHandle | gentity_handle, | ||
char * | face_type, | ||
int * | err, | ||
int * | face_type_length | ||
) | [static] |
Get the geometric type of a face.
Get the geometric type of a face. Specific types depend on implementation.
instance | iGeom instance handle |
face_handle | Face being queried |
face_type | Face type |
face_type_length | Length of face type string |
Return the type of surface as a string; if not a surface, an error is returned
face_handle | Face for which the type is requested |
face_type | Type of face, returned as a string |
Definition at line 3297 of file iGeom_CGMA.cc.
{ static const char *surf_types[] = {"cone", "plane", "sphere", "spline", "torus", "best_fit", "facet", "undefined"}; RefEntity *this_ent = ENTITY_HANDLE(gentity_handle); RefFace *this_face = dynamic_cast<RefFace*>(this_ent); if (!this_face) RETURN(iBase_INVALID_ENTITY_TYPE); GeometryType this_type = this_face->get_surface_ptr()->geometry_type(); if (this_type < CONE_SURFACE_TYPE || this_type > UNDEFINED_SURFACE_TYPE) { RETURN(iBase_FAILURE); } const char* result = surf_types[this_type - CONE_SURFACE_TYPE]; const int len = strlen(result); if (len < *face_type_length) { strcpy(face_type, result); *face_type_length = len; } else { strncpy(face_type, result, *face_type_length-1); face_type[*face_type_length] = '\0'; } RETURN(iBase_SUCCESS); }
static void iGeom_getFcArrCvtrUV | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | face_handles, | ||
int | face_handles_size, | ||
int | storage_order, | ||
double const * | uv, | ||
int | uv_size, | ||
double ** | cvtr_1, | ||
int * | cvtr_1_allocated, | ||
int * | cvtr_1_size, | ||
double ** | cvtr_2, | ||
int * | cvtr_2_allocated, | ||
int * | cvtr_2_size, | ||
int * | err | ||
) | [static] |
Get the curvature(s) on face(s) at given parametric position(s)
Get the curvature(s) on face(s) at given parametric position(s). If either the number of faces or number of coordinate pairs is unity, then all points or entities are queried for that entity or point, respectively, otherwise each point corresponds to each entity. storage_order should be a value in the iBase_StorageOrder enum.
instance | iGeom instance handle |
face_handles | Face(s) being queried |
face_handles_size | Number of entities being queried |
storage_order | Storage order of uv coordinates |
uv | Starting parametric coordinates |
uv_size | Number of values in uv array |
cvtr_1 | First principal curvatures |
cvtr_1_allocated | Allocated size of first curvature array |
cvtr_1_size | Occupied size of first curvature array |
cvtr_2 | Second principal curvatures |
cvtr_2_allocated | Allocated size of second curvature array |
cvtr_2_size | Occupied size of second curvature array |
*err | Pointer to error type returned from function |
Definition at line 5638 of file iGeom_CGMA.cc.
{ iGeom_getArrUVtoXYZ(instance, ARRAY_IN(face_handles), storage_order, ARRAY_IN(uv), ARRAY_INOUT(cvtr_1), err); if (*err == iBase_SUCCESS) iGeom_getEntArrCvtrXYZ(instance, ARRAY_IN(face_handles), storage_order, *cvtr_1, *cvtr_1_size, ARRAY_INOUT(cvtr_1), ARRAY_INOUT(cvtr_2), err); }
static void iGeom_getFcCvtrUV | ( | iGeom_Instance | instance, |
iBase_EntityHandle | face_handle, | ||
double | u, | ||
double | v, | ||
double * | cvtr1_i, | ||
double * | cvtr1_j, | ||
double * | cvtr1_k, | ||
double * | cvtr2_i, | ||
double * | cvtr2_j, | ||
double * | cvtr2_k, | ||
int * | err | ||
) | [static] |
Get the two principle curvature vectors for a face at a parametric position.
Get the two principle curvature vectors for a face at a parametric position. Magnitudes of vectors are curvature, directions are directions of principal curvatures.
instance | iGeom instance handle |
face_handle | Face being queried |
u | Parametric position being queried |
v | Parametric position being queried |
cvtr1_i | Maximum curvature vector |
cvtr1_j | Maximum curvature vector |
cvtr1_k | Maximum curvature vector |
cvtr2_i | Minimum curvature vector |
cvtr2_j | Minimum curvature vector |
cvtr2_k | Minimum curvature vector |
*err | Pointer to error type returned from function |
Definition at line 5615 of file iGeom_CGMA.cc.
{ double x, y, z; iGeom_getEntUVtoXYZ(instance, entity_handle, u, v, &x, &y, &z, err ); if (*err == iBase_SUCCESS) iGeom_getFcCvtrXYZ(instance, entity_handle, x, y, z, cvtr1_i, cvtr1_j, cvtr1_k, cvtr2_i, cvtr2_j, cvtr2_k, err ); }
static void iGeom_getFcCvtrXYZ | ( | iGeom_Instance | instance, |
iBase_EntityHandle | face_handle, | ||
double | x, | ||
double | y, | ||
double | z, | ||
double * | cvtr1_i, | ||
double * | cvtr1_j, | ||
double * | cvtr1_k, | ||
double * | cvtr2_i, | ||
double * | cvtr2_j, | ||
double * | cvtr2_k, | ||
int * | err | ||
) | [static] |
Get the two principle curvature vectors for a face at a point.
Get the two principle curvature vectors for a face at a point. Magnitudes of vectors are curvature, directions are directions of principal curvatures.
instance | iGeom instance handle |
face_handle | Face being queried |
x | Position being queried |
y | Position being queried |
z | Position being queried |
cvtr1_i | Maximum curvature vector |
cvtr1_j | Maximum curvature vector |
cvtr1_k | Maximum curvature vector |
cvtr2_i | Minimum curvature vector |
cvtr2_j | Minimum curvature vector |
cvtr2_k | Minimum curvature vector |
*err | Pointer to error type returned from function |
Definition at line 2720 of file iGeom_CGMA.cc.
{ RefEntity* entity = (RefEntity*)face_handle; RefFace* face = dynamic_cast<RefFace*>(entity); if (!face) RETURN(iBase_INVALID_ENTITY_TYPE); Surface* surf = face->get_surface_ptr(); CubitVector loc(x,y,z), curv1, curv2; CubitStatus status = surf->closest_point( loc, 0, 0, &curv1, &curv2 ); if (surf->bridge_sense() == CUBIT_REVERSED) { curv1 = -curv1; curv2 = -curv2; } curv1.get_xyz( *cvtr1_i, *cvtr1_j, *cvtr1_k ); curv2.get_xyz( *cvtr2_i, *cvtr2_j, *cvtr2_k ); RETURN( (status == CUBIT_SUCCESS ? iBase_SUCCESS : iBase_FAILURE) ); }
static void iGeom_getFcEvalXYZ | ( | iGeom_Instance | instance, |
iBase_EntityHandle | face_handle, | ||
double | x, | ||
double | y, | ||
double | z, | ||
double * | on_x, | ||
double * | on_y, | ||
double * | on_z, | ||
double * | nrml_i, | ||
double * | nrml_j, | ||
double * | nrml_k, | ||
double * | cvtr1_i, | ||
double * | cvtr1_j, | ||
double * | cvtr1_k, | ||
double * | cvtr2_i, | ||
double * | cvtr2_j, | ||
double * | cvtr2_k, | ||
int * | err | ||
) | [static] |
Get closest point, tangent, and curvature of face.
Get closest point, tangent, and curvature of face. If any of input coordinate pointers are NULL, that value is not returned.
instance | iGeom instance handle |
face_handle | Face being queried |
x | Point at which entity is being queried |
y | Point at which entity is being queried |
z | Point at which entity is being queried |
on_x | Closest point at point being queried |
on_y | Closest point at point being queried |
on_z | Closest point at point being queried |
nrml_i | Normal at point being queried |
nrml_j | Normal at point being queried |
nrml_k | Normal at point being queried |
cvtr1_i | First principal curvature at point being queried |
cvtr1_j | First principal curvature at point being queried |
cvtr1_k | First principal curvature at point being queried |
cvtr2_i | Second principal curvature at point being queried |
cvtr2_j | Second principal curvature at point being queried |
cvtr2_k | Second principal curvature at point being queried |
*err | Pointer to error type returned from function |
Definition at line 2932 of file iGeom_CGMA.cc.
{ RefEntity* entity = (RefEntity*)face_handle; RefFace* face = dynamic_cast<RefFace*>(entity); if (!face) RETURN(iBase_INVALID_ENTITY_TYPE); Surface* surf = face->get_surface_ptr(); CubitVector loc(x,y,z), on, norm, curv1, curv2; #ifdef CGM_HAVE_FACET_ENGINE_ONLY CubitStatus status = surf->closest_point( loc, &on, &norm); #else CubitStatus status = surf->closest_point( loc, &on, &norm, &curv1, &curv2 ); #endif if (surf->bridge_sense() == CUBIT_REVERSED) { norm = -norm; curv1 = -curv1; curv2 = -curv2; } on.get_xyz( *on_x, *on_y, *on_z ); norm.get_xyz( *norm_i, *norm_j, *norm_k ); curv1.get_xyz( *cvtr1_i, *cvtr1_j, *cvtr1_k ); curv2.get_xyz( *cvtr2_i, *cvtr2_j, *cvtr2_k ); RETURN( (status == CUBIT_SUCCESS ? iBase_SUCCESS : iBase_FAILURE) ); }
static void iGeom_getIntArrData | ( | iGeom_Instance | instance, |
const iBase_EntityHandle * | entity_handles, | ||
int | entity_handles_size, | ||
iBase_TagHandle | tag_handle, | ||
int ** | tag_values, | ||
int * | tag_values_allocated, | ||
int * | tag_values_size, | ||
int * | err | ||
) | [static] |
Get tag values of integer type for an array of entities.
Get tag values of integer type for an array of entities.
instance | iGeom instance handle |
entity_handles | Entity array on which tag is being set |
entity_handles_size | Number of entities in array |
tag_handle | Tag being set on an entity |
*tag_values | Pointer to tag data array being returned from function |
tag_values_allocated | Pointer to allocated size of tag data array |
tag_values_size | Pointer to occupied size of tag data array |
*err | Pointer to error type returned from function |
Definition at line 1730 of file iGeom_CGMA.cc.
{ int tag_value_allocated_tmp = *tag_value_allocated * sizeof(int); int tag_value_size_tmp = *tag_value_size * sizeof(int); iGeom_getArrData(instance, entity_handles, entity_handles_size, tag_handle, reinterpret_cast<void**>(tag_value), &tag_value_allocated_tmp, &tag_value_size_tmp, err); *tag_value_allocated = tag_value_allocated_tmp / sizeof(int); *tag_value_size = tag_value_size_tmp / sizeof(int); }
static void iGeom_getIntData | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
iBase_TagHandle | tag_handle, | ||
int * | out_data, | ||
int * | err | ||
) | [static] |
Get the value of a tag of integer type on an entity.
Get the value of a tag of integer type on an entity.
instance | iGeom instance handle |
entity_handle | Entity on which tag is being set |
tag_handle | Tag being set on an entity |
*out_data | Pointer to tag value returned from function |
*err | Pointer to error type returned from function |
Definition at line 1914 of file iGeom_CGMA.cc.
{ void *val_ptr = data_out; int val_size = sizeof(int); iGeom_getArrData(instance, &entity_handle, 1, tag_handle, &val_ptr, &val_size, &val_size, err); }
static void iGeom_getNextEntArrIter | ( | iGeom_Instance | instance, |
iBase_EntityArrIterator | entArr_iterator, | ||
iBase_EntityHandle ** | entity_handles, | ||
int * | entity_handles_allocated, | ||
int * | entity_handles_size, | ||
int * | has_data, | ||
int * | err | ||
) | [static] |
Get entities contained in array iterator and increment iterator.
Get the entities contained in an array iterator, and increment the iterator. Also return whether the next value of the iterator has any entities (if non-zero, next iterator value is the end of the iteration).
instance | iGeom instance handle |
entArr_iterator | Iterator being queried |
*entity_handles | Pointer to array of entity handles contained in current value of iterator |
*entity_handles_allocated | Pointer to allocated size of entity_handles array |
*entity_handles_size | Pointer to occupied size of entity_handles array |
has_data | Pointer to a flag indicating if the value(s) returned in entity_handles are valid. A non-zero value indicates the value(s) are valid. A zero value indicates the value(s) are NOT valid. |
*err | Pointer to error type returned from function |
Definition at line 922 of file iGeom_CGMA.cc.
{ CGMAIterator* iterator = reinterpret_cast<CGMAIterator*>(entArr_iterator); *has_data = !iterator->at_end(); if (has_data) { ALLOC_CHECK_ARRAY_NOFAIL(entity_handles, iterator->size()); iterator->next( (RefEntity**)*entity_handles, *entity_handles_size ); } RETURN(iBase_SUCCESS); }
static void iGeom_getNextEntIter | ( | iGeom_Instance | instance, |
iBase_EntityIterator | gentity_iterator, | ||
iBase_EntityHandle * | gentity_handle, | ||
int * | has_data, | ||
int * | err | ||
) | [static] |
Get entity corresponding to an iterator and increment iterator.
Get the entity corresponding to an array iterator, and increment the iterator. Also return whether the next value of the iterator has an entity (if non-zero, next iterator value is the end of the iteration).
instance | iGeom instance handle |
entity_iterator | Iterator being queried |
entity_handle | Pointer to an entity handle corresponding to the current value of iterator |
has_data | Pointer to a flag indicating if the value returned in entity_handle is valid. A non-zero value indicates the value is valid. A zero value indicates the value is NOT valid. |
*err | Pointer to error type returned from function |
Get the next entity for this iterator.
gentity_iterator | Iterator being iterated over |
gentity_handle | Next gentity |
Definition at line 904 of file iGeom_CGMA.cc.
{ CGMAIterator* iterator = reinterpret_cast<CGMAIterator*>(gentity_iterator); RefEntity** out_handle = reinterpret_cast<RefEntity**>(gentity_handle); *has_data = !iterator->at_end(); if (*has_data) { int count = 1; iterator->next( out_handle, count ); } RETURN(iBase_SUCCESS); }
static void iGeom_getNumChld | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set, | ||
const int | num_hops, | ||
int * | num_child, | ||
int * | err | ||
) | [static] |
Get the number of child sets linked from a specified set.
Get the number of child sets linked from a specified set. If num_hops is not -1, this represents the maximum hops from entity_set to any child in the count.
instance | iGeom instance handle |
entity_set | Entity set being queried |
num_hops | Maximum hops from entity_set_handle to child set, not inclusive of the child set |
num_child | Pointer to number of children returned from function |
*err | Pointer to error type returned from function |
Returns the number of immediate children in the gentity_set (one level down only)
Definition at line 1073 of file iGeom_CGMA.cc.
{ // HJK: num_hops has to be handled if (0 < num_hops) { ERROR(iBase_NOT_SUPPORTED, "Num_hops argument not yet supported."); } std::vector<RefGroup*> *my_children = TM->pc_list(const_cast<RefGroup*>(SET_HANDLE(entity_set)), 1, false); *num_child = my_children == NULL ? 0 : my_children->size(); RETURN (iBase_SUCCESS); }
static void iGeom_getNumEntSets | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set, | ||
int | num_hops, | ||
int * | num_ent_sets, | ||
int * | err | ||
) | [static] |
Get the number of entity sets contained in a set or interface.
Get the number of entity sets contained in a set or interface. If a set is input which is not the root set, num_hops indicates the maximum number of contained sets from entity_set_handle to one of the contained sets, not inclusive of the contained set.
instance | iGeom instance handle |
entity_set_handle | Entity set being queried |
num_hops | Maximum hops from entity_set_handle to contained set, not inclusive of the contained set |
num_sets | Pointer to the number of sets returned from function |
*err | Pointer to error type returned from function |
Returns the number of gentity_sets contained in a given model or gentity_set one level deep
gentity_set_handle | Entity set being queried |
Definition at line 3973 of file iGeom_CGMA.cc.
{ // HJK: num_hops has to be handled if (0 < num_hops) { ERROR(iBase_NOT_SUPPORTED, "Num_hops argument not yet supported."); } const RefGroup *this_set = SET_HANDLE(entity_set); if (NULL == this_set) *num_ent_sets = RefEntityFactory::instance()->num_ref_groups(); else { DLIList<RefEntity*> tmp_ents; DLIList<RefGroup*> groups; const_cast<RefGroup*>(this_set)->get_child_ref_entities(tmp_ents); CAST_LIST(tmp_ents, groups, RefGroup); *num_ent_sets = groups.size(); } RETURN(iBase_SUCCESS); }
static void iGeom_getNumOfType | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | set_handle, | ||
int | gentity_type, | ||
int * | count, | ||
int * | err | ||
) | [static] |
Get the number of entities with the specified type in the instance or set.
Get the number of entities with the specified type in the instance or set. If entity set handle is zero, return information for instance, otherwise for set. Value of entity type must be from the iBase_EntityType enumeration. If iBase_ALL_TYPES is specified, total number of entities (excluding entity sets) is returned.
instance | iGeom instance handle |
entity_set_handle | Entity set being queried |
entity_type | Type of entity requested |
num_type | Pointer to number of entities, returned from function |
*err | Pointer to error type returned from function |
Return number of gentities of specified dimension in this set, or in whole model.
set_handle | Entity set being queried (if 0, whole model) |
gentity_dimension | Dimension of entities being queried |
Definition at line 1198 of file iGeom_CGMA.cc.
{ const RefGroup *this_set = SET_HANDLE(set_handle); if (0 == this_set) { switch (gentity_type) { case iBase_ALL_TYPES: *count = GeometryQueryTool::instance()->num_bodies(); *count += GeometryQueryTool::instance()->num_ref_faces(); *count += GeometryQueryTool::instance()->num_ref_edges(); *count += GeometryQueryTool::instance()->num_ref_vertices(); break; case iBase_REGION: *count = GeometryQueryTool::instance()->num_bodies(); break; case iBase_FACE: *count = GeometryQueryTool::instance()->num_ref_faces(); break; case iBase_EDGE: *count = GeometryQueryTool::instance()->num_ref_edges(); break; case iBase_VERTEX: *count = GeometryQueryTool::instance()->num_ref_vertices(); break; default: RETURN(iBase_BAD_TYPE_AND_TOPO); break; } RETURN (iBase_SUCCESS); } else { static DLIList<CubitEntity*> centities; centities.clean_out(); const_cast<RefGroup*>(this_set)->get_child_entities(centities); *count = count_ibase_type( gentity_type, centities, err ); } }
static void iGeom_getNumPrnt | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set, | ||
const int | num_hops, | ||
int * | num_parent, | ||
int * | err | ||
) | [static] |
Get the number of parent sets linked from a specified set.
Get the number of parent sets linked from a specified set. If num_hops is not -1, this represents the maximum hops from entity_set to any parent in the count.
instance | iGeom instance handle |
entity_set | Entity set being queried |
num_hops | Maximum hops from entity_set_handle to parent set, not inclusive of the parent set |
num_parent | Pointer to number of parents returned from function |
*err | Pointer to error type returned from function |
Returns the number of immediate parents to the gentity_set (one level up only)
Definition at line 1094 of file iGeom_CGMA.cc.
{ // HJK: num_hops has to be handled if (0 < num_hops) { ERROR(iBase_NOT_SUPPORTED, "Num_hops argument not yet supported."); } std::vector<RefGroup*> *my_parents = TM->pc_list(const_cast<RefGroup*>(SET_HANDLE(entity_set)), 0, false); *num_parent = my_parents == NULL ? 0 : my_parents->size(); RETURN (iBase_SUCCESS); }
static void iGeom_getParametric | ( | iGeom_Instance | instance, |
int * | is_parametric, | ||
int * | err | ||
) | [static] |
Return whether interface has information about parameterization.
Return whether an interface has information about parameterization (!=0) or not (0)
instance | iGeom instance handle |
is_parametric | If non-zero, interface has information about parameterization |
*err | Pointer to error type returned from function |
Definition at line 4360 of file iGeom_CGMA.cc.
{ *is_parametric = true; RETURN(iBase_SUCCESS); }
static void iGeom_getPntArrClsf | ( | iGeom_Instance | instance, |
int | storage_order, | ||
double const * | coords, | ||
int | coords_size, | ||
iBase_EntityHandle ** | entity_handles, | ||
int * | entity_handles_allocated, | ||
int * | entity_handles_size, | ||
int * | err | ||
) | [static] |
Get the entities on which points are located.
Get the entities on which points are located. Storage orders should be members of the iBase_StorageOrder enumeration.
instance | iGeom instance handle |
storage_order | Storage order of coordinates in coords |
coords | Points being queried |
coords_size | Number of entries in coords array |
entity_handles | Entities on which points are located |
entity_handles_allocated | Allocated size of entity_handles array |
entity_handles_size | Occupied size of entity_handles array |
*err | Pointer to error type returned from function |
Definition at line 3636 of file iGeom_CGMA.cc.
{ size_t init, step; int count = coords_size / 3; if (storage_order == iBase_BLOCKED) { init = count; step = 1; } else { storage_order = iBase_INTERLEAVED; init = 1; step = 3; } const double *x = coords; const double *y = x + init; const double *z = y + init; ALLOC_CHECK_ARRAY( entity_handles, count ); RefEntity** array = (RefEntity**)*entity_handles; for (int i = 0; i < count; ++i) { const CubitVector pt( *x, *y, *z ); array[i] = iGeom_get_point_containment( pt ); if (!array[i]) { RETURN(iBase_FAILURE); } x += step; y += step; z += step; } KEEP_ARRAY(entity_handles); RETURN(iBase_SUCCESS); }
static void iGeom_getPntArrRayIntsct | ( | iGeom_Instance | instance, |
int | storage_order, | ||
const double * | coords, | ||
int | coords_size, | ||
const double * | directions, | ||
int | directions_size, | ||
iBase_EntityHandle ** | intersect_entity_handles, | ||
int * | intersect_entity_handles_allocated, | ||
int * | intersect_entity_hangles_size, | ||
int ** | offset, | ||
int * | offset_allocated, | ||
int * | offset_size, | ||
double ** | intersect_coords, | ||
int * | intersect_coords_allocated, | ||
int * | intersect_coords_size, | ||
double ** | param_coords, | ||
int * | param_coords_allocated, | ||
int * | param_coords_size, | ||
int * | err | ||
) | [static] |
Intersect an array of rays with the model.
Intersect an array of rays with the model. Storage order passed in is a member of the iBase_StorageOrder enumeration.
instance | iGeom instance handle |
storage_order | Storage order of input coordinates |
coords | Points from which rays are fired |
coords_size | Number of points from which rays are fired |
directions | Directions in which rays are fired |
directions_size | Number of coordinates in directions array |
intersect_entity_handles | Entities intersected by ray |
intersect_entity_handles_allocated | Allocated size of intersections array |
intersect_entity_hangles_size | Occupied size of intersections array |
offset | Offset[i] is offset into intersect_entity_handles of ith ray |
offset_allocated | Allocated size of offset array |
offset_size | Occupied size of offset array |
storage_order | Storage order of coordinates passed back |
intersect_coords | Coordinates of intersections |
intersect_coords_allocated | Allocated size of coordinates array |
intersect_coords_size | Occupied size of coordinates array |
param_coords | Distances along ray of intersections |
param_coords_allocated | Allocated size of param_coords array |
param_coords_size | Occupied size of param_coords array |
*err | Pointer to error type returned from function |
Definition at line 3527 of file iGeom_CGMA.cc.
{ if (points_size != directions_size || points_size % 3) { ERROR(iBase_INVALID_ARGUMENT, "Mismatched or invalid input array size"); } const int count = points_size / 3; ALLOC_CHECK_ARRAY( offset, count ); const double *px, *py, *pz, *dx, *dy, *dz; size_t init, step; if (storage_order == iBase_BLOCKED) { init = count; step = 1; } else { storage_order = iBase_INTERLEAVED; init = 1; step = 3; } px = points; py = px + init; pz = py + init; dx = directions; dy = dx + init; dz = dy + init; DLIList<RefEntity*> entities, tmp_entities; DLIList<double> params, tmp_params; std::vector<CubitVector> coords; for (int i = 0; i < count; ++i) { tmp_entities.clean_out(); tmp_params.clean_out(); (*offset)[i] = params.size(); const CubitVector point(*px, *py, *pz), dir(*dx, *dy, *dz); CubitStatus s = iGeom_fire_ray( point, dir, tmp_entities, tmp_params ); if (CUBIT_SUCCESS != s) { RETURN(iBase_FAILURE); } entities += tmp_entities; params += tmp_params; tmp_params.reset(); for (int j = tmp_params.size(); j > 0; --j) coords.push_back( tmp_params.get_and_step() * dir + point ); px += step; py += step; pz += step; dx += step; dy += step; dz += step; } ALLOC_CHECK_ARRAY_NOFAIL( intersect_entity_handles, entities.size() ); ALLOC_CHECK_ARRAY_NOFAIL( intersect_coords, coords.size() ); ALLOC_CHECK_ARRAY_NOFAIL( param_coords, params.size() ); entities.copy_to( (RefEntity**)*intersect_entity_handles ); params.copy_to( *param_coords ); double *x = *intersect_coords; double *y = x + init; double *z = y + init; for (std::vector<CubitVector>::const_iterator k = coords.begin(); k != coords.end(); ++k) { k->get_xyz( *x, *y, *z ); x += step; y += step; z += step; } KEEP_ARRAY(offset); RETURN(iBase_SUCCESS); }
static void iGeom_getPntClsf | ( | iGeom_Instance | instance, |
double | x, | ||
double | y, | ||
double | z, | ||
iBase_EntityHandle * | entity_handle, | ||
int * | err | ||
) | [static] |
Get the entity on which a point is located.
Get the entity on which a point is located
instance | iGeom instance handle |
x | Point being queried |
y | Point being queried |
z | Point being queried |
entity_handle | Entity on which point is located |
*err | Pointer to error type returned from function |
Definition at line 3622 of file iGeom_CGMA.cc.
{ RefEntity** ptr = (RefEntity**)entity_handle; const CubitVector pt(x,y,z); *ptr = iGeom_get_point_containment( pt ); RETURN( *ptr ? iBase_SUCCESS : iBase_FAILURE ); }
static void iGeom_getPntRayIntsct | ( | iGeom_Instance | instance, |
double | x, | ||
double | y, | ||
double | z, | ||
double | dir_x, | ||
double | dir_y, | ||
double | dir_z, | ||
iBase_EntityHandle ** | intersect_entity_handles, | ||
int * | intersect_entity_handles_allocated, | ||
int * | intersect_entity_hangles_size, | ||
int | storage_order, | ||
double ** | intersect_coords, | ||
int * | intersect_coords_allocated, | ||
int * | intersect_coords_size, | ||
double ** | param_coords, | ||
int * | param_coords_allocated, | ||
int * | param_coords_size, | ||
int * | err | ||
) | [static] |
Intersect a ray with the model.
Intersect a ray with the model. Storage orders passed in should be a member of the iBase_StorageOrder enumeration.
instance | iGeom instance handle |
x | Point from which ray is fired |
y | Point from which ray is fired |
z | Point from which ray is fired |
dir_x | Direction in which ray is fired |
dir_y | Direction in which ray is fired |
dir_z | Direction in which ray is fired |
intersect_entity_handles | Entities intersected by ray |
intersect_entity_handles_allocated | Allocated size of intersections array |
intersect_entity_hangles_size | Occupied size of intersections array |
storage_order | Storage order of coordinates passed back |
intersect_coords | Coordinates of intersections |
intersect_coords_allocated | Allocated size of coordinates array |
intersect_coords_size | Occupied size of coordinates array |
param_coords | Distances along ray of intersections |
param_coords_allocated | Allocated size of param_coords array |
param_coords_size | Occupied size of param_coords array |
*err | Pointer to error type returned from function |
Definition at line 3469 of file iGeom_CGMA.cc.
{ DLIList<double> ray_params; DLIList<RefEntity*> entities; CubitVector point(x,y,z), dir(dx,dy,dz); CubitStatus status = iGeom_fire_ray( point, dir, entities, ray_params ); if (status != CUBIT_SUCCESS) RETURN(iBase_FAILURE); ALLOC_CHECK_ARRAY_NOFAIL( intersect_entity_handles, entities.size() ); ALLOC_CHECK_ARRAY_NOFAIL( intersect_coords, 3*ray_params.size() ); ALLOC_CHECK_ARRAY_NOFAIL( param_coords, ray_params.size() ); size_t init, step; if (storage_order == iBase_BLOCKED) { init = ray_params.size(); step = 1; } else { init = 1; step = 3; } double *x_iter = *intersect_coords; double *y_iter = x_iter + init; double *z_iter = y_iter + init; for (size_t i = ray_params.size(); i > 0; --i) { double t = ray_params.get_and_step(); CubitVector pos = t * dir + point; pos.get_xyz( *x_iter, *y_iter, *z_iter ); x_iter += step; y_iter += step; z_iter += step; } ray_params.copy_to( *param_coords ); entities.copy_to( (RefEntity**)*intersect_entity_handles ); RETURN(iBase_SUCCESS); }
static void iGeom_getPrnts | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | from_entity_set, | ||
const int | num_hops, | ||
iBase_EntitySetHandle ** | entity_set_handles, | ||
int * | entity_set_handles_allocated, | ||
int * | entity_set_handles_size, | ||
int * | err | ||
) | [static] |
Get the parent sets linked from a specified set.
Get the parent sets linked from a specified set. If num_hops is not -1, this represents the maximum hops from entity_set to any parent.
instance | iGeom instance handle |
from_entity_set | Entity set being queried |
num_hops | Maximum hops from entity_set_handle to parent set, not inclusive of the parent set |
*entity_set_handles | Pointer to array of parent sets returned from function |
*entity_set_handles_allocated | Pointer to allocated size of entity_set_handles array |
*entity_set_handles_size | Pointer to occupied size of entity_set_handles array |
*err | Pointer to error type returned from function |
Recursively gets the parents of this gentity_set up to num_hops levels; if num_hops is set to -1 all parents are returned
Definition at line 1050 of file iGeom_CGMA.cc.
{ std::vector<RefGroup*> group_ptrs; const RefGroup *this_grp = SET_HANDLE(from_entity_set); TM->get_pc_groups(const_cast<RefGroup*>(this_grp), 0, num_hops, group_ptrs); ALLOC_CHECK_ARRAY_NOFAIL(entity_set_handles, group_ptrs.size()); iBase_EntitySetHandle* ent_arr = reinterpret_cast<iBase_EntitySetHandle*>(&group_ptrs[0]); std::copy( ent_arr, ent_arr + group_ptrs.size(), *entity_set_handles); RETURN(iBase_SUCCESS); }
static void iGeom_getRootSet | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle * | root_set, | ||
int * | err | ||
) | [static] |
Get handle of the root set for this instance.
Get handle of the root set for this instance. All geom in this instance can be accessed from this set.
instance | iGeom instance handle |
root_set | Pointer to set handle returned from function |
*err | Pointer to error type returned from function |
Definition at line 822 of file iGeom_CGMA.cc.
{ *root = NULL; RETURN(iBase_SUCCESS); }
static void iGeom_getTagHandle | ( | iGeom_Instance | instance, |
const char * | tag_name, | ||
iBase_TagHandle * | tag_handle, | ||
int * | err, | ||
int | tag_name_len | ||
) | [static] |
Get a the handle of an existing tag with the specified name.
Get a the handle of an existing tag with the specified name
instance | iGeom instance handle |
tag_name | Name of tag being queried |
tag_handle | Pointer to tag handle returned from function |
*err | Pointer to error type returned from function |
tag_name_len | Length of tag name string |
Get the tag handle associated with a given string name.
Definition at line 1650 of file iGeom_CGMA.cc.
{ // make sure string is null-terminated std::string tag_name_buf( tag_name, tag_name_len ); tag_name = tag_name_buf.c_str(); *tag_handle = reinterpret_cast<iBase_TagHandle>(static_cast<size_t>(TM->getTagHandle( tag_name ))); // XXX: this seems really wrong... iGeom_getErrorType(instance, err); }
static void iGeom_getTagName | ( | iGeom_Instance | instance, |
iBase_TagHandle | tag_handle, | ||
char * | name, | ||
int * | err, | ||
int | name_len | ||
) | [static] |
Get the name for a given tag handle.
Get the name for a given tag handle
instance | iGeom instance handle |
tag_handle | Tag handle being queried |
name | Pointer to character string to store name returned from function |
*err | Pointer to error type returned from function |
name_len | Length of character string input to function |
Get the tag name associated with a given tag handle.
Definition at line 1578 of file iGeom_CGMA.cc.
{ const char* name_ptr = TM->getTagName(TAG_HANDLE(tag_handle)); int len = strlen(name_ptr) + 1; if (len > name_len) len = name_len; memcpy( name, name_ptr, len ); RETURN(iBase_SUCCESS); }
static void iGeom_getTagSizeBytes | ( | iGeom_Instance | instance, |
iBase_TagHandle | tag_handle, | ||
int * | tag_size, | ||
int * | err | ||
) | [static] |
Get size of a tag in units of bytes.
Get size of a tag in units of bytes
instance | iGeom instance handle |
tag_handle | Handle of tag being queried |
tag_size | Pointer to tag size returned from function |
*err | Pointer to error type returned from function |
Get the size of the data associated with a given tag handle.
Definition at line 1627 of file iGeom_CGMA.cc.
{ *tag_size = TM->getTagSize(TAG_HANDLE(tag_handle)); RETURN(iBase_SUCCESS); }
static void iGeom_getTagSizeValues | ( | iGeom_Instance | instance, |
iBase_TagHandle | tag_handle, | ||
int * | tag_size, | ||
int * | err | ||
) | [static] |
Get size of a tag in units of numbers of tag data type.
Get size of a tag in units of numbers of tag data type
instance | iGeom instance handle |
tag_handle | Handle of tag being queried |
tag_size | Pointer to tag size returned from function |
*err | Pointer to error type returned from function |
Get the size of the data associated with a given tag handle.
Definition at line 1596 of file iGeom_CGMA.cc.
{ *tag_size = TM->getTagSize(TAG_HANDLE(tag_handle)); int type; iGeom_getTagType( instance, tag_handle, &type, err ); if (iBase_SUCCESS != *err) return; switch (type) { case iBase_INTEGER: *tag_size /= sizeof(int); break; case iBase_DOUBLE: *tag_size /= sizeof(double); break; case iBase_ENTITY_HANDLE: case iBase_ENTITY_SET_HANDLE: *tag_size /= sizeof(iBase_EntityHandle); break; case iBase_BYTES: break; } RETURN(iBase_SUCCESS); }
static void iGeom_getTagType | ( | iGeom_Instance | instance, |
iBase_TagHandle | tag_handle, | ||
int * | tag_type, | ||
int * | err | ||
) | [static] |
Get the data type of the specified tag handle.
Get the data type of the specified tag handle. Tag type is a value in the iBase_TagType enumeration.
instance | iGeom instance handle |
tag_handle | Handle for the tag being queried |
tag_type | Pointer to tag type returned from function |
*err | Pointer to error type returned from function |
Definition at line 1637 of file iGeom_CGMA.cc.
{ *type = TM->getTagType(TAG_HANDLE(tag_handle)); RETURN(iBase_SUCCESS); }
static void iGeom_getTolerance | ( | iGeom_Instance | instance, |
int * | type, | ||
double * | tolerance, | ||
int * | err | ||
) | [static] |
Get the tolerance of the instance.
Get the tolerance at the modeler level. type is an integer representing the type of the tolerance, where 0 = no tolerance information, 1 = modeler-level tolerance, 2 = entity-level tolerances. If type is 1, tolerance returns the modeler-level tolerance. If type is 2, use iGeom_getEntTolerance to query the tolerance on a per-entity basis.
instance | iGeom instance handle |
type | Type of tolerance used by the modeler |
tolerance | Modeler-level tolerance, if any |
*err | Pointer to error type returned from function |
Return the relative and absolute tolerances at the modeler level. If model does not have a modeler-wide tolerance, zero is returned for both values.
relative_tolerance | Relative tolerance for model as a whole |
absolute_tolerance | Absolute tolerance for model as a whole |
Definition at line 4314 of file iGeom_CGMA.cc.
{ *type = 1; *tolerance = gqt->get_sme_resabs_tolerance(); RETURN(iBase_SUCCESS); }
static void iGeom_getTopoLevel | ( | iGeom_Instance | instance, |
int * | topo_level_out, | ||
int * | err | ||
) | [static] |
Return the topology level of the geometry.
Return the topology level of the geometry as an integer, where 0 = basic entities only, 1 = manifold entities, 2 = non-manifold entities.
instance | iGeom instance handle |
topo_level_out | The topology level |
*err | Pointer to error type returned from function |
Definition at line 1497 of file iGeom_CGMA.cc.
{ *level = 2; // 0->basic entities only, 1->manifold, 2->non-manifold RETURN(iBase_SUCCESS); }
static void iGeom_getVtxArrCoords | ( | iGeom_Instance | instance, |
const iBase_EntityHandle * | gentity_handles, | ||
int | gentity_handles_size, | ||
int | storage_order, | ||
double ** | coordinates, | ||
int * | coordinates_allocated, | ||
int * | coordinates_size, | ||
int * | err | ||
) | [static] |
Get coordinates of specified vertices.
Get coordinates of specified vertices. If storage order is passed in with a value other than iBase_UNDETERMINED, coordinates are returned in the specified storage order, otherwise storage order is that native to the implementation. Storage order of returned coordinates is also returned.
instance | iGeom instance handle |
vertex_handles | Array of geom vertex handles whose coordinates are being requested |
vertex_handles_size | Number of vertices in vertex_handles array |
storage_order | Storage order requested for coordinate data |
*coords | Pointer to array of coordinates returned from function |
*coords_allocated | Pointer to allocated size of coords array |
*coords_size | Pointer to occupied size of coords array |
*err | Pointer to error type returned from function |
Return the coordinates of the specified vertices; returns error if any of the entities are not gvertices. Coordinates returned interleaved.
gentity_handles | The gentities being queried |
coordinates | The coordinates of the gvertices, interleaved. |
Definition at line 3418 of file iGeom_CGMA.cc.
{ const RefEntity **handle_array = (const RefEntity**)(gentity_handles); // check or pre-allocate the coordinate arrays ALLOC_CHECK_ARRAY(coordinates, 3*gentity_handles_size); CubitVector dumvec; const RefVertex *this_vertex; double *x, *y, *z; size_t step; if (storage_order == iBase_BLOCKED) { x = *coordinates; y = x + gentity_handles_size; z = y + gentity_handles_size; step = 1; } else { x = *coordinates; y = x + 1; z = x + 2; step = 3; } for (int i = 0; i < gentity_handles_size; i++) { this_vertex = dynamic_cast<const RefVertex*>(handle_array[i]); if (NULL == this_vertex) { ERROR(iBase_INVALID_ENTITY_TYPE, "Entities passed into getGvertexCoordinates must be vertices."); } else { dumvec = this_vertex->coordinates(); dumvec.get_xyz(*x,*y,*z); x += step; y += step; z += step; } } KEEP_ARRAY(coordinates); RETURN(iBase_SUCCESS); }
static void iGeom_getVtxArrToU | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | vertex_handles, | ||
int | vertex_handles_size, | ||
iBase_EntityHandle const * | edge_handles, | ||
int | edge_handles_size, | ||
double ** | u, | ||
int * | u_allocated, | ||
int * | u_size, | ||
int * | err | ||
) | [static] |
Return parametric coordinates on edges of vertex positions.
Return parametric coordinates on edges of vertex positions
instance | iGeom instance handle |
vertex_handles | Vertices being queried |
vertex_handles_size | Number of vertices being queried |
edge_handles | Edges being queried |
edge_handles_size | Number of edges being queried |
u | Corresponding parametric positions on faces |
u_allocated | Allocated size of positions array |
u_size | Occupied size of positions array |
*err | Pointer to error type returned from function |
Definition at line 5241 of file iGeom_CGMA.cc.
{ int count; size_t vtx_step, edge_step; if (vertex_handles_size == edge_handles_size) { count = vertex_handles_size; vtx_step = edge_step = 1; } else if (edge_handles_size == 1) { count = vertex_handles_size; vtx_step = 1; edge_step = 0; } else if (vertex_handles_size == 1) { count = edge_handles_size; vtx_step = 0; edge_step = 1; } else { ERROR(iBase_INVALID_ENTITY_COUNT, "Mismatched input array sizes."); } ALLOC_CHECK_ARRAY( u, count ); RefEntity** vtx_iter = (RefEntity**)vertex_handles; RefEntity** edge_iter = (RefEntity**)edge_handles; for (int i = 0; i < count; ++i) { RefVertex* vtx = dynamic_cast<RefVertex*>(*vtx_iter); RefEdge* edge = dynamic_cast<RefEdge*>(*edge_iter); if (!vtx || !edge) { RETURN(iBase_INVALID_ENTITY_TYPE); } iBase_ErrorType rval = iGeom_get_vtx_to_u( vtx, edge, (*u)[i] ); if (iBase_SUCCESS != rval) { RETURN(rval); } vtx_iter += vtx_step; edge_iter += edge_step; } KEEP_ARRAY(u); RETURN(iBase_SUCCESS); }
static void iGeom_getVtxArrToUV | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | vertex_handles, | ||
int | vertex_handles_size, | ||
iBase_EntityHandle const * | face_handles, | ||
int | face_handles_size, | ||
int | storage_order, | ||
double ** | uv, | ||
int * | uv_allocated, | ||
int * | uv_size, | ||
int * | err | ||
) | [static] |
Return parametric coordinates on faces of vertex positions.
Return parametric coordinates on faces of vertex positions
instance | iGeom instance handle |
vertex_handles | Vertices being queried |
vertex_handles_size | Number of vertices being queried |
face_handles | Faces being queried |
face_handles_size | Number of faces being queried |
storage_order | Storage order of coordinates returned |
uv | Corresponding parametric positions on faces |
uv_allocated | Allocated size of positions array |
uv_size | Occupied size of positions array |
*err | Pointer to error type returned from function |
Definition at line 5155 of file iGeom_CGMA.cc.
{ int count; size_t vtx_step, face_step, uv_step; if (vertex_handles_size == face_handles_size) { count = vertex_handles_size; vtx_step = face_step = 1; } else if (face_handles_size == 1) { count = vertex_handles_size; vtx_step = 1; face_step = 0; } else if (vertex_handles_size == 1) { count = face_handles_size; vtx_step = 0; face_step = 1; } else { ERROR(iBase_INVALID_ENTITY_COUNT, "Mismatched input array sizes."); } ALLOC_CHECK_ARRAY( uv, 2*count ); double *u, *v; u = *uv; if (storage_order == iBase_BLOCKED) { v = u + count; uv_step = 1; } else { storage_order = iBase_INTERLEAVED; v = u + 1; uv_step = 2; } RefEntity** vtx_iter = (RefEntity**)vertex_handles; RefEntity** face_iter = (RefEntity**)face_handles; for (int i = 0; i < count; ++i) { RefVertex* vtx = dynamic_cast<RefVertex*>(*vtx_iter); RefFace* face = dynamic_cast<RefFace*>(*face_iter); if (!vtx || !face) { RETURN(iBase_INVALID_ENTITY_TYPE); } iBase_ErrorType rval = iGeom_get_vtx_to_uv( vtx, face, *u, *v ); if (iBase_SUCCESS != rval) { RETURN(rval); } vtx_iter += vtx_step; face_iter += face_step; u += uv_step; v += uv_step; } KEEP_ARRAY(uv); RETURN(iBase_SUCCESS); }
static void iGeom_getVtxCoord | ( | iGeom_Instance | instance, |
iBase_EntityHandle | vertex_handle, | ||
double * | x, | ||
double * | y, | ||
double * | z, | ||
int * | err | ||
) | [static] |
Get coordinates of specified vertex.
Get coordinates of specified vertex.
instance | iGeom instance handle |
vertex_handle | Geom vertex being queried |
*x | Pointer to x coordinate returned from function |
*y | Pointer to y coordinate returned from function |
*z | Pointer to z coordinate returned from function |
*err | Pointer to error type returned from function |
Definition at line 3395 of file iGeom_CGMA.cc.
{ RefEntity* entity = (RefEntity*)vertex_handle; RefVertex* vertex = dynamic_cast<RefVertex*>(entity); if (!vertex) { ERROR(iBase_INVALID_ENTITY_TYPE, "Entity not a vertex"); } vertex->coordinates().get_xyz(*x, *y, *z); RETURN(iBase_SUCCESS); }
static void iGeom_getVtxToU | ( | iGeom_Instance | instance, |
iBase_EntityHandle | vertex_handle, | ||
iBase_EntityHandle | edge_handle, | ||
double * | u, | ||
int * | err | ||
) | [static] |
Return parametric coordinates on edge of vertex position.
Return parametric coordinates on edge of vertex position
instance | iGeom instance handle |
vertex_handle | Vertex being queried |
edge_handle | Edge being queried |
u | Corresponding parametric position on face |
*err | Pointer to error type returned from function |
Definition at line 5224 of file iGeom_CGMA.cc.
{ RefVertex* vtx = dynamic_cast<RefVertex*>((RefEntity*)vertex_handle); RefEdge* edge = dynamic_cast<RefEdge*>((RefEntity*)edge_handle); if (!vtx || !edge) { RETURN(iBase_INVALID_ENTITY_TYPE); } iBase_ErrorType result = iGeom_get_vtx_to_u( vtx, edge, *u ); RETURN(result); }
static void iGeom_getVtxToUV | ( | iGeom_Instance | instance, |
iBase_EntityHandle | vertex_handle, | ||
iBase_EntityHandle | face_handle, | ||
double * | u, | ||
double * | v, | ||
int * | err | ||
) | [static] |
Return parametric coordinates on face of vertex position.
Return parametric coordinates on face of vertex position
instance | iGeom instance handle |
vertex_handle | Vertex being queried |
face_handle | Face being queried |
u | Corresponding parametric position on face |
v | Corresponding parametric position on face |
*err | Pointer to error type returned from function |
Definition at line 5137 of file iGeom_CGMA.cc.
{ RefVertex* vtx = dynamic_cast<RefVertex*>((RefEntity*)vertex_handle); RefFace* face = dynamic_cast<RefFace*>((RefEntity*)face_handle); if (!vtx || !face) { RETURN(iBase_INVALID_ENTITY_TYPE); } iBase_ErrorType result = iGeom_get_vtx_to_uv( vtx, face, *u, *v ); RETURN(result); }
static void iGeom_imprintEnts | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | geom_entities, | ||
int | geom_entities_size, | ||
int * | err | ||
) | [static] |
Imprint entities.
Imprint entities by merging coincident surfaces.
instance | iGeom instance handle |
geom_entities | Array of entity handles being imprinted |
geom_entities_size | Number of entities in geom_entities array |
*err | Pointer to error type returned from function |
Definition at line 6450 of file iGeom_CGMA.cc.
{ if (gentity_handles_size < 1) // GMT::imprint segfaults if passed an empty list RETURN(iBase_SUCCESS); DLIList<Body*> bods; DLIList<RefVolume*> vols, temp_vols; RefEntity* const* handle_array = ENTITY_HANDLE_CONST_ARRAY(gentity_handles); CubitStatus status = CUBIT_SUCCESS; for (int i = 0; i < gentity_handles_size; i++) { Body *temp_bod = dynamic_cast<Body*>(handle_array[i]); if (NULL != temp_bod) { bods.append_unique(temp_bod); continue; } RefVolume *temp_vol = dynamic_cast<RefVolume*>(handle_array[i]); if (NULL != temp_vol) { TopologyEntity *topo_ent = dynamic_cast<TopologyEntity*>(handle_array[i]); if (NULL == topo_ent) { status = CUBIT_FAILURE; continue; } temp_bod = topo_ent->body(); if (NULL == temp_bod) { status = CUBIT_FAILURE; continue; } bods.append_unique(temp_bod); continue; } // if we've gotten here, it's an error status = CUBIT_FAILURE; } if (CUBIT_SUCCESS != status) RETURN(iBase_FAILURE); DLIList<Body*> temp_bods; status = GeometryModifyTool::instance()->imprint(bods, temp_bods, false); RETURN(iBase_SUCCESS); }
static void iGeom_initEntArrIter | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set_handle, | ||
int | requested_entity_type, | ||
int | requested_array_size, | ||
iBase_EntityArrIterator * | entArr_iterator, | ||
int * | err | ||
) | [static] |
Initialize an array iterator over specified entity type and size.
Initialize an array iterator over specified entity type and size for a specified set or instance. Iterator returned can be used as input to functions returning entities for the iterator. If all entities of a specified type are to be iterated, specify iBase_ALL_TYPES. Specified type must be a value in the iBase_EntityType enumerations.
instance | iGeom instance handle |
entity_set_handle | Entity set being iterated |
requested_entity_type | Type of entity to iterate |
requested_array_size | Size of chunks of handles returned for each value of the iterator |
entArr_iterator | Pointer to iterator returned from function |
*err | Pointer to error type returned from function |
Definition at line 871 of file iGeom_CGMA.cc.
{ DLIList<RefEntity*> entities; if (RefGroup* group = reinterpret_cast<RefGroup*>(entity_set_handle)) { DLIList<CubitEntity*> centities; group->get_child_entities( centities ); append_ibase_type( type, centities, entities, err ); } else { append_all_ibase_type( type, entities, err ); } if (*err == iBase_SUCCESS) { CGMAIterator* iter = new CGMAIterator(entities, requested_array_size); *entArr_iterator = reinterpret_cast<iBase_EntityArrIterator>(iter); } }
static void iGeom_initEntIter | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set_handle, | ||
const int | dimension, | ||
iBase_EntityIterator * | iterator, | ||
int * | err | ||
) | [static] |
Initialize an iterator over specified entity type.
Initialize an iterator over specified entity type for a specified set or instance. Iterator returned can be used as input to functions returning the entity for the iterator. If all entities of a specified type are to be iterated, specify iBase_ALL_TYPES. Specified type must be a value in the iBase_EntityType enumeration.
instance | iGeom instance handle |
entity_set_handle | Entity set being iterated |
requested_entity_type | Type of entity to iterate |
entity_iterator | Pointer to iterator returned from function |
*err | Pointer to error type returned from function |
Initialize an iterator over gentities of a specified dimension.
gentity_dimension | Dimension of gentities to be iterated over |
gentity_iterator | Iterator initialized by this function |
Definition at line 859 of file iGeom_CGMA.cc.
{ iGeom_initEntArrIter( instance, entity_set_handle, dimension, 1, reinterpret_cast<iBase_EntityArrIterator*>(iterator), err ); }
static void iGeom_intersect | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set_1, | ||
iBase_EntitySetHandle | entity_set_2, | ||
iBase_EntitySetHandle * | result_entity_set, | ||
int * | err | ||
) | [static] |
Intersect contents of one entity set with another.
Intersect contents of one entity set with another
instance | iGeom instance handle |
entity_set_1 | Entity set being intersected with another |
entity_set_2 | Entity set being intersected with another |
result_entity_set | Pointer to entity set returned from function |
*err | Pointer to error type returned from function |
Intersect gentity_set_1 and gentity_set_2; the result is returned in gentity_set_1. If both are multisets and both contain 2 entries of gentity k, the intersection contains 2 entries as well.
Definition at line 5759 of file iGeom_CGMA.cc.
{ const RefGroup *set1 = SET_HANDLE(entity_set_1); const RefGroup *set2 = SET_HANDLE(entity_set_2); RefGroup *set3 = SET_HANDLE(*result_entity_set); if (NULL == set3) { set3 = RefEntityFactory::instance()->construct_RefGroup(); *result_entity_set = reinterpret_cast<iBase_EntitySetHandle>(set3); } const_cast<RefGroup*>(set1)->intersect(const_cast<RefGroup*>(set2), set3); RETURN(iBase_SUCCESS); }
static void iGeom_intersectEnts | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity2, | ||
iBase_EntityHandle | entity1, | ||
iBase_EntityHandle * | geom_entity, | ||
int * | err | ||
) | [static] |
Geometrically intersect a pair of entities.
Geometrically intersect a pair of entities.
instance | iGeom instance handle |
entity1 | The entity to intersect |
entity2 | The entity to intersect |
geom_entity | Pointer to new entity handle returned from function |
*err | Pointer to error type returned from function |
Definition at line 6349 of file iGeom_CGMA.cc.
{ Body *this_ent1 = dynamic_cast<Body*>(ENTITY_HANDLE(ent1)); Body *ent1_copy = gmt->copy_body(this_ent1); if (NULL == ent1_copy) { ERROR(iBase_FAILURE, "Trouble copying blank."); } Body *this_ent2 = dynamic_cast<Body*>(ENTITY_HANDLE(ent2)); Body *ent2_copy = gmt->copy_body(this_ent2); if (NULL == ent2_copy) { ERROR(iBase_FAILURE, "Trouble copying tool."); gqt->delete_RefEntity(ent1_copy); RETURN(iBase_FAILURE); } DLIList<Body*> ent1_list, new_body_list; ent1_list.append(ent1_copy); RefEntity *new_body = NULL; CubitStatus result = gmt->intersect(ent2_copy, ent1_list, new_body_list); if (CUBIT_SUCCESS != result || 0 == new_body_list.size()) { ERROR(iBase_FAILURE, "Intersect failed."); } else { new_body = new_body_list.get(); *geom_entity = reinterpret_cast<iBase_EntityHandle>(new_body); gqt->delete_RefEntity(this_ent2); gqt->delete_RefEntity(this_ent1); } RETURN(iBase_SUCCESS); }
static void iGeom_isArrAdj | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | entity_handles_1, | ||
int | entity_handles_1_size, | ||
iBase_EntityHandle const * | entity_handles_2, | ||
int | entity_handles_2_size, | ||
int ** | is_adjacent_info, | ||
int * | is_adjacent_info_allocated, | ||
int * | is_adjacent_info_size, | ||
int * | err | ||
) | [static] |
Return whether entity pairs are adjacent.
Return whether entity pairs are adjacent, i.e. if entity_handles_1[i] is adjacent to entity_handles_2[i]. This function requires entity_handles_1_size and entity_handles_2_size to be equal.
instance | iGeom instance handle |
entity_handles_1 | First array of entities |
entity_handles_1_size | Number of entities in first array |
entity_handles_2 | Second array of entities |
entity_handles_2_size | Number of entities in second array |
is_adjacent_info | Array of flags returned from function |
is_adjacent_info_allocated | Allocated size of flags array |
is_adjacent_info_size | Occupied size of flags array |
*err | Pointer to error type returned from function |
Definition at line 1450 of file iGeom_CGMA.cc.
{ RefEntity **list_1_iter = (RefEntity**)entity_handles_1, **list_2_iter = (RefEntity**)entity_handles_2; size_t list_1_step, list_2_step; int count; // If either list contains only 1 entry, compare that entry with // every entry in the other list. if (entity_handles_1_size == entity_handles_2_size) { list_1_step = list_2_step = 1; count = entity_handles_1_size; } else if (entity_handles_1_size == 1) { list_1_step = 0; list_2_step = 1; count = entity_handles_2_size; } else if (entity_handles_2_size == 1) { list_1_step = 1; list_2_step = 0; count = entity_handles_1_size; } else { RETURN(iBase_INVALID_ENTITY_COUNT); } ALLOC_CHECK_ARRAY_NOFAIL(is_adjacent_info, count); for (int i = 0; i < count; ++i) { TopologyEntity* ent1 = dynamic_cast<TopologyEntity*>(*list_1_iter); TopologyEntity* ent2 = dynamic_cast<TopologyEntity*>(*list_2_iter); (*is_adjacent_info)[i] = ent1->is_directly_related(ent2); list_1_iter += list_1_step; list_2_iter += list_2_step; } RETURN(iBase_SUCCESS); }
static void iGeom_isArrParametric | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | entity_handles, | ||
int | entity_handles_size, | ||
int ** | is_parametric, | ||
int * | is_parametric_allocated, | ||
int * | is_parametric_size, | ||
int * | err | ||
) | [static] |
Return whether entities have parameterizations.
Return whether entities have parameterizations (=1) or not (=0)
instance | iGeom instance handle |
entity_handles | Entities being queried |
entity_handles_size | Number of entities being queried |
is_parametric | entity_handles[i] has a parameterization (=1) or not (=0) |
is_parametric_allocated | Allocated size of is_parametric array |
is_parametric_size | Occupied size of is_parametric array |
*err | Pointer to error type returned from function |
Definition at line 4385 of file iGeom_CGMA.cc.
{ ALLOC_CHECK_ARRAY_NOFAIL( is_parametric, entity_handles_size ); RefEntity** const ent_array = (RefEntity**)entity_handles; for (int i = 0; i < entity_handles_size; ++i) (*is_parametric)[i] = iGeom_is_parametric( ent_array[i] ); RETURN(iBase_SUCCESS); }
static void iGeom_isArrPeriodic | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | entity_handles, | ||
int | entity_handles_size, | ||
int ** | in_uv, | ||
int * | in_uv_allocated, | ||
int * | in_uv_size, | ||
int * | err | ||
) | [static] |
Return whether entities are periodic.
Return whether entities are periodic (=1) or not (=0) in the u and v directions.
instance | iGeom instance handle |
entity_handles | Entities being queried |
entity_handles_size | Number of entities being queried |
in_uv | Array of pairs of integers representing whether entity_handles[i] is periodic (=1) or not (=0) in u and v directions |
in_uv_allocated | Allocated size of in_uv array |
in_uv_size | Occupied size of in_uv array |
*err | Pointer to error type returned from function |
Definition at line 5672 of file iGeom_CGMA.cc.
{ ALLOC_CHECK_ARRAY( in_uv, 2*entity_handles_size ); RefEntity** ents = (RefEntity**)entity_handles; for (int i = 0; i < entity_handles_size; ++i) { CubitStatus s = iGeom_is_periodic( ents[i], (*in_uv)[2*i], (*in_uv)[2*i+1] ); if (s != CUBIT_SUCCESS) { RETURN(iBase_FAILURE); } } KEEP_ARRAY(in_uv); RETURN(iBase_SUCCESS); }
static void iGeom_isChildOf | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | parent_entity_set, | ||
iBase_EntitySetHandle | child_entity_set, | ||
int * | is_child, | ||
int * | err | ||
) | [static] |
Return whether two sets are related by parent/child links.
Return whether two sets are related (*is_child=1) or not (*is_child=0) by parent/child links
instance | iGeom instance handle |
parent_entity_set | Pointer to parent set |
child_entity_set | Pointer to child set |
is_child | Pointer to flag returned from function |
*err | Pointer to error type returned from function |
Returns true if the gentity_sets are related through a parent/child relationship.
Definition at line 993 of file iGeom_CGMA.cc.
{ std::vector<RefGroup*> *par1, *ch1, *par2, *ch2; TM->pc_list(const_cast<RefGroup*>(SET_HANDLE(parent_entity_set)), par1, ch1, false); if (NULL == ch1 || ch1->empty()) { *is_child = false; RETURN (iBase_SUCCESS); } TM->pc_list(const_cast<RefGroup*>(SET_HANDLE(child_entity_set)), par2, ch2, false); if (NULL == par2 || par2->empty()) { *is_child = false; RETURN (iBase_SUCCESS); } const RefGroup *group1 = SET_HANDLE(parent_entity_set); const RefGroup *group2 = SET_HANDLE(child_entity_set); if ((std::find(ch1->begin(), ch1->end(), group2) != ch1->end()) || (std::find(par2->begin(), par2->end(), group1) != par2->end())) *is_child = true; else *is_child = false; RETURN(iBase_SUCCESS); }
static void iGeom_isEntAdj | ( | iGeom_Instance | instance, |
iBase_EntityHandle | gentity_handle1, | ||
iBase_EntityHandle | gentity_handle2, | ||
int * | are_adjacent, | ||
int * | err | ||
) | [static] |
Return whether two entities are adjacent.
Return whether two entities are adjacent.
instance | iGeom instance handle |
entity_handle1 | First entity queried |
entity_handle2 | Second entity queried |
are_adjacent | If returned non-zero, entities are adjacent, otherwise they are not |
*err | Pointer to error type returned from function |
Return whether or not entities are adjacent.
gentity_handle1 | 1st entity |
gentity_handle2 | 2nd entity |
are_adjacent | If true, entities are adjacent |
Definition at line 1435 of file iGeom_CGMA.cc.
{ const TopologyEntity *ent1 = dynamic_cast<const TopologyEntity*>(ENTITY_HANDLE(gentity_handle1)); const TopologyEntity *ent2 = dynamic_cast<const TopologyEntity*>(ENTITY_HANDLE(gentity_handle2)); if (ent1 != NULL && ent2 != NULL) *are_adjacent = const_cast<TopologyEntity*>(ent1)->is_directly_related(const_cast<TopologyEntity*>(ent2)); else *are_adjacent = false; RETURN(iBase_SUCCESS); }
static void iGeom_isEntArrContained | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | containing_set, | ||
const iBase_EntityHandle * | entity_handles, | ||
int | num_entity_handles, | ||
int ** | is_contained, | ||
int * | is_contained_allocated, | ||
int * | is_contained_size, | ||
int * | err | ||
) | [static] |
Return whether entities are contained in a set.
Return whether each entity is contained in the set.
instance | iMesh instance handle |
containing_entity_set | Entity set being queried |
entity_handles | List of entities for which to check containment. |
is_contained | One value for each input entity, 1 if contained in set, zero otherwise. |
*err | Pointer to error type returned from function |
Definition at line 4211 of file iGeom_CGMA.cc.
{ // go through each entity and look up its dimension ALLOC_CHECK_ARRAY(is_contained, num_entity_handles); for (int i = 0; i < num_entity_handles; ++i) { iGeom_isEntContained( instance, containing_set, entity_handles[i], (*is_contained)+i, err ); if (iBase_SUCCESS != *err) return; } KEEP_ARRAY(is_contained); RETURN(iBase_SUCCESS); }
static void iGeom_isEntContained | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | containing_entity_set, | ||
iBase_EntityHandle | contained_entity, | ||
int * | is_contained, | ||
int * | err | ||
) | [static] |
Return whether an entity is contained in another set.
Return whether an entity is contained (*is_contained=1) or not contained (*is_contained=0) in another set
instance | iGeom instance handle |
containing_entity_set | Entity set being queried |
contained_entity | Entity potentially contained in containing_entity_set |
is_contained | Pointer to flag returned from function |
*err | Pointer to error type returned from function |
Definition at line 4189 of file iGeom_CGMA.cc.
{ // everything is contained in root set if (NULL == containing_entity_set && NULL != contained_entity) { *is_contained = true; RETURN( iBase_SUCCESS ); } DLIList<RefGroup*> containing_groups; RefEntity *contained_entity_temp = const_cast<RefEntity*>(ENTITY_HANDLE(contained_entity)); RefGroup::get_groups_within(contained_entity_temp, containing_groups, CUBIT_FALSE); *is_contained = containing_groups.size() > 0 && containing_groups.move_to(const_cast<RefGroup*>(SET_HANDLE(containing_entity_set))) ; RETURN(iBase_SUCCESS); }
static void iGeom_isEntParametric | ( | iGeom_Instance | instance, |
iBase_EntityHandle | gentity_handle, | ||
int * | is_parametric, | ||
int * | err | ||
) | [static] |
Return whether an entity has a parameterization.
Return whether an entity has a parameterization (=1) or not (=0)
instance | iGeom instance handle |
entity_handle | Entity being queried |
is_parametric | Entity has a parameterization (=1) or not (=0) |
*err | Pointer to error type returned from function |
Return whether a given gentity is parametric or not. If a gentity is not parametric, all of the following functions will return an error when called on that entity.
gentity_handle | Entity being queried. |
Definition at line 4375 of file iGeom_CGMA.cc.
{ *is_parametric = iGeom_is_parametric( (RefEntity*)gentity_handle ); RETURN (iBase_SUCCESS); }
static void iGeom_isEntPeriodic | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
int * | in_u, | ||
int * | in_v, | ||
int * | err | ||
) | [static] |
Return whether an entity is periodic.
Return whether an entity is periodic (=1) or not (=0) in the u and v directions.
instance | iGeom instance handle |
entity_handle | Entity being queried |
in_u | Entity is periodic in u direction (=1) or not (=0) |
in_v | Entity is periodic in v direction (=1) or not (=0) |
*err | Pointer to error type returned from function |
Definition at line 5661 of file iGeom_CGMA.cc.
{ CubitStatus s = iGeom_is_periodic( (RefEntity*)entity_handle, *in_u, *in_v ); RETURN( (s == CUBIT_SUCCESS ? iBase_SUCCESS : iBase_FAILURE) ); }
static void iGeom_isEntSetContained | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | containing_entity_set, | ||
iBase_EntitySetHandle | contained_entity_set, | ||
int * | is_contained, | ||
int * | err | ||
) | [static] |
Return whether an entity set is contained in another set.
Return whether a set is contained (*is_contained=1) or not contained (*is_contained=0) in another set
instance | iGeom instance handle |
containing_entity_set | Entity set being queried |
contained_entity_set | Entity set potentially contained in containing_entity_set |
is_contained | Pointer to flag returned from function |
*err | Pointer to error type returned from function |
Definition at line 4234 of file iGeom_CGMA.cc.
{ iGeom_isEntContained( instance, containing_entity_set, reinterpret_cast<iBase_EntityHandle>(contained_entity_set), is_contained, err); }
static void iGeom_isFcArrDegenerate | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | face_handles, | ||
int | face_handles_size, | ||
int ** | degenerate, | ||
int * | degenerate_allocated, | ||
int * | degenerate_size, | ||
int * | err | ||
) | [static] |
Return whether faces are degenerate.
Return whether faces are degenerate (=1) or not (=0).
instance | iGeom instance handle |
face_handles | Faces being queried |
face_handles_size | Number of faces being queried |
degenerate | face_handles[i] is degenerate (=1) or not (=0) |
degenerate_allocated | Allocated size of degenerate array |
degenerate_size | Occupied size of degenerate array |
*err | Pointer to error type returned from function |
Definition at line 5705 of file iGeom_CGMA.cc.
{ ALLOC_CHECK_ARRAY( degenerate, face_handles_size ); RefEntity** faces = (RefEntity**)face_handles; for (int i = 0; i < face_handles_size; ++i) { RefFace* face = dynamic_cast<RefFace*>(faces[i]); if (!face) { RETURN (iBase_INVALID_ENTITY_TYPE); } (*degenerate)[i] = iGeom_is_face_degenerate( face ); } KEEP_ARRAY(degenerate); RETURN(iBase_SUCCESS); }
static void iGeom_isFcDegenerate | ( | iGeom_Instance | instance, |
iBase_EntityHandle | face_handle, | ||
int * | is_degenerate, | ||
int * | err | ||
) | [static] |
Return whether a face is degenerate.
Return whether a face is degenerate (=1) or not (=0).
instance | iGeom instance handle |
face_handle | Face being queried |
is_degenerate | Face is degenerate (=1) or not (=0) |
*err | Pointer to error type returned from function |
Definition at line 5693 of file iGeom_CGMA.cc.
{ RefFace* face = dynamic_cast<RefFace*>((RefEntity*)entity_handle); if (!face) { RETURN (iBase_INVALID_ENTITY_TYPE); } *is_degenerate = iGeom_is_face_degenerate(face); RETURN (iBase_SUCCESS); }
static void iGeom_isList | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set, | ||
int * | is_list, | ||
int * | err | ||
) | [static] |
Return whether a specified set is ordered or unordered.
Return whether a specified set is ordered (*is_list=1) or unordered (*is_list=0)
instance | iGeom instance handle |
entity_set | Entity set being queried |
is_list | Pointer to flag returned from function |
*err | Pointer to error type returned from function |
Definition at line 4092 of file iGeom_CGMA.cc.
{ *result = true; RETURN (iBase_SUCCESS); }
static void iGeom_load | ( | iGeom_Instance | instance, |
const char * | name, | ||
const char * | options, | ||
int * | err, | ||
int | name_len, | ||
int | options_size | ||
) | [static] |
Load a geom from a file.
Load a geom from a file. If entity set is specified, loaded geom is added to that set; specify zero if that is not desired.
instance | iGeom instance handle |
entity_set_handle | Set to which loaded geom will be added, zero if not desired |
name | File name from which geom is to be loaded |
options | Pointer to implementation-specific options string |
*err | Pointer to error type returned from function |
name_len | Length of the file name character string |
options_len | Length of the options character string |
Load a model specified by name. Which formats are supported and the specific meaning of this name string (e.g. file name, model name, etc.) are implementation-dependent. Options are also implementation- dependent.
name | Name of the model |
options | String options |
Definition at line 654 of file iGeom_CGMA.cc.
{ // pre-get all entities, so we can filter them out later; use cubit list // 'cuz we need to get both volumes and bodies DLIList<RefEntity*> ref_list, tmp_ref_list; for (int dim = 0; dim < 5; dim++) { // Using a temporary since GeometryQueryTool::ref_entity_list cleans out // the list before appending to it gqt->ref_entity_list(cgm_type_names[dim], tmp_ref_list, false); ref_list += tmp_ref_list; } // make sure we have a null-terminated string for file name std::string file_name( name, name_len ); name = file_name.c_str(); // check if work in parallel bool parallel = false; std::string parallel_opt; std::vector<std::string> opts; std::string tmp_options(options, options_size); tmp_options.insert(0, ";"); tokenize(tmp_options, opts ); for (std::vector<std::string>::iterator i = opts.begin(); i != opts.end(); ++i) { if (match_option( *i, "PARALLEL", parallel_opt )) parallel = true; } // parallel if (parallel) { #ifdef USE_MPI CGMParallelComm* p_comm = new CGMParallelComm(); CGMReadParallel* p_reader = new CGMReadParallel(GeometryQueryTool::instance(), p_comm); CubitStatus status = p_reader->load_file(name, options); if (CUBIT_SUCCESS != status) { ERROR(iBase_FAILURE, "Trouble loading geometry file in parallel."); } #endif } else { CubitStatus status = CUBIT_SUCCESS; std::string file_type; if (strstr(name, ".brep") != NULL || strstr(name, ".BREP") != NULL || strstr(name, ".occ") != NULL || strstr(name, ".OCC") != NULL) file_type = "OCC"; else if (strstr(name, ".stp") != NULL || strstr(name, ".STP") != NULL || strstr(name, ".step") != NULL || strstr(name, ".STEP") != NULL) file_type = "STEP"; else if (strstr(name, ".igs") != NULL || strstr(name, ".IGS") != NULL || strstr(name, ".iges") != NULL || strstr(name, ".IGES") != NULL) file_type = "IGES"; status = CubitCompat_import_solid_model(name, file_type.c_str()); if (CUBIT_SUCCESS != status) { ERROR(iBase_FILE_NOT_FOUND, "Trouble loading geometry file."); } } DLIList<RefEntity*> ref_list_2; for (int dim = 0; dim < 5; dim++) { // Using a temporary since GeometryQueryTool::ref_entity_list cleans out // the list before appending to it gqt->ref_entity_list(cgm_type_names[dim], tmp_ref_list, false); ref_list_2 += tmp_ref_list; } ref_list_2 -= ref_list; // now process uncaught/unregistered attributes iBase_ErrorType result = process_attribs(instance, ref_list_2); RETURN(result); }
static void iGeom_measure | ( | iGeom_Instance | instance, |
const iBase_EntityHandle * | gentity_handles, | ||
int | gentity_handles_size, | ||
double ** | measures, | ||
int * | measures_allocated, | ||
int * | measures_size, | ||
int * | err | ||
) | [static] |
Return the measure (length, area, or volume) of entities.
Return the measure (length, area, or volume) of entities
instance | iGeom instance handle |
entity_handles | Array of entities being queried |
entity_handles_size | Number of entities in entity array |
measures | Measures of entities being queried |
measures_allocated | Allocated size of measures array |
measures_size | Occupied size of measures array |
*err | Pointer to error type returned from function |
Return the arc length / area / volume of the entities
gentity_handles | Entities for which measure is requested |
gentity_handles_size | Number of gentities |
measures | Arc length / area / volume of the entities |
measures_length | Number of entries in measures |
Definition at line 3254 of file iGeom_CGMA.cc.
{ RefEntity **handle_array = (RefEntity**)(gentity_handles); // check or pre-allocate the measure arrays ALLOC_CHECK_ARRAY_NOFAIL(measures, gentity_handles_size); for (int i = 0; i < gentity_handles_size; i++) (*measures)[i] = handle_array[i]->measure(); RETURN(iBase_SUCCESS); }
static void iGeom_mergeEnts | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | geom_entities, | ||
int | geom_entities_size, | ||
double | tolerance, | ||
int * | err | ||
) | [static] |
Merge ents.
Merge entities of corresponding topology/geometry within the specified tolerance.
instance | iGeom instance handle |
geom_entities | Array of entity handles being imprinted |
geom_entities_size | Number of entities in geom_entities array |
tolerance | Tolerance within which entities are considered the same |
*err | Pointer to error type returned from function |
Definition at line 6498 of file iGeom_CGMA.cc.
{ double old_factor = GeometryQueryTool::instance()->get_geometry_factor(); if (tolerance != old_factor) GeometryQueryTool::instance()->set_geometry_factor(tolerance*1.0e6); else old_factor = 0.0; DLIList<Body*> bods; DLIList<RefVolume*> vols, temp_vols; DLIList<RefFace*> faces; DLIList<RefEdge*> edges; DLIList<RefVertex*> verts; RefEntity* const* handle_array = ENTITY_HANDLE_CONST_ARRAY(gentity_handles); for (int i = 0; i < gentity_handles_size; i++) { TopologyEntity *topo_ent = dynamic_cast<TopologyEntity*>(handle_array[i]); if (NULL == topo_ent) continue; Body *temp_bod; RefVolume *temp_vol; RefFace *temp_face; RefEdge *temp_edge; RefVertex *temp_vert; switch (handle_array[i]->dimension()) { case -1: // it should be a body temp_bod = dynamic_cast<Body*>(handle_array[i]); if (NULL == temp_bod) RETURN(iBase_FAILURE); temp_vols.clean_out(); topo_ent->ref_volumes(temp_vols); vols += temp_vols; break; case 0: temp_vert = dynamic_cast<RefVertex*>(handle_array[i]); if (NULL == temp_vert) RETURN(iBase_FAILURE); verts.append(temp_vert); break; case 1: temp_edge = dynamic_cast<RefEdge*>(handle_array[i]); if (NULL == temp_edge) RETURN(iBase_FAILURE); edges.append(temp_edge); break; case 2: temp_face = dynamic_cast<RefFace*>(handle_array[i]); if (NULL == temp_face) RETURN(iBase_FAILURE); faces.append(temp_face); break; case 3: temp_vol = dynamic_cast<RefVolume*>(handle_array[i]); if (NULL == temp_vol) RETURN(iBase_FAILURE); vols.append(temp_vol); break; } } CubitStatus status = CUBIT_SUCCESS, temp_status; if (verts.size() != 0) { temp_status = MergeTool::instance()->merge_refvertices(verts, false); if (CUBIT_SUCCESS != temp_status) status = temp_status; } if (edges.size() != 0) { temp_status = MergeTool::instance()->merge_refedges(edges, true, false); if (CUBIT_SUCCESS != temp_status) status = temp_status; } if (faces.size() != 0) { temp_status = MergeTool::instance()->merge_reffaces(faces, false); if (CUBIT_SUCCESS != temp_status) status = temp_status; } if (vols.size() != 0) { temp_status = MergeTool::instance()->merge_volumes(vols, false); if (CUBIT_SUCCESS != temp_status) status = temp_status; } if (bods.size() != 0) { temp_status = MergeTool::instance()->merge_bodies(bods); if (CUBIT_SUCCESS != temp_status) status = temp_status; } if (0 != old_factor) GeometryQueryTool::instance()->set_geometry_factor(old_factor); if (CUBIT_SUCCESS != status) { RETURN(iBase_FAILURE); } else { RETURN(iBase_SUCCESS); } }
static void iGeom_moveEnt | ( | iGeom_Instance | instance, |
iBase_EntityHandle | geom_entity, | ||
double | x, | ||
double | y, | ||
double | z, | ||
int * | err | ||
) | [static] |
Move an entity by the given vector.
Move an entity by translating it along the given vector.
instance | iGeom instance handle |
geom_entity | the entity to move |
x | x coordinate of the vector |
y | y coordinate of the vector |
z | z coordinate of the vector |
*err | Pointer to error type returned from function |
Definition at line 6067 of file iGeom_CGMA.cc.
{ CubitVector vec(x, y, z); Body *this_bod = dynamic_cast<Body*>(ENTITY_HANDLE(geom_entity)); DLIList<Body*> bods; bods.append(this_bod); CubitStatus result; if (NULL != this_bod) { result = gqt->translate(bods, vec); if (CUBIT_SUCCESS != result) { ERROR(iBase_FAILURE, "Failed to move body."); RETURN(iBase_FAILURE); } RETURN(iBase_SUCCESS); } BasicTopologyEntity *this_bte = dynamic_cast<BasicTopologyEntity*>(ENTITY_HANDLE(geom_entity)); if (NULL != this_bte) { // non-body move; check to see if there are any siblings to this entity in the // same body; if so, we can't move it; if not, get the body and move that; if // there is no body, it's a free entity and we can move it anyway Body *this_body = this_bte->body(); if (NULL == this_body) { DLIList<BasicTopologyEntity*> btes; btes.append(this_bte); result = gqt->translate(btes, vec); if (CUBIT_SUCCESS != result) { ERROR(iBase_FAILURE, "Failed to move entity."); } } else { int num_sibs = -1; switch (this_bte->dimension()) { case 0: num_sibs = this_body->num_ref_vertices(); break; case 1: num_sibs = this_body->num_ref_edges(); break; case 2: num_sibs = this_body->num_ref_faces(); break; } if (num_sibs == 1) { // ok to move the body instead result = gqt->translate(bods, vec); if (CUBIT_SUCCESS != result) { ERROR(iBase_FAILURE, "Failed to move body even only one entity of that" " dimension in the body."); } } else { ERROR(iBase_FAILURE, "Too many siblings for an entity to move it."); } } RETURN(iBase_SUCCESS); } ERROR(iBase_INVALID_ENTITY_TYPE, "Wrong type of entity specified for move."); }
static void iGeom_newGeom | ( | char const * | options, |
iGeom_Instance * | instance_out, | ||
int * | err, | ||
int | options_len | ||
) | [static] |
Construct a new iGeom instance.
Construct a new iGeom instance, using implementation-specific options
options | Pointer to implementation-specific options string |
instance | Pointer to iGeom instance handle returned from function |
*err | Pointer to error type returned from function |
options_len | Length of the character string pointed to by options |
Definition at line 593 of file iGeom_CGMA.cc.
{ // scan options for default engine option std::string engine; if (options && options_size) { std::string tmp(options, options_size); char f[] = ";engine="; f[0]=tmp[0]; // correct delimiter size_t p = tmp.find( f ); if (p != std::string::npos) { // if we found engine option p += strlen(f); // advance to value (past '=') size_t e = tmp.find( tmp[0], p ); // find end delimiter if (e == std::string::npos) // if no end delim, then must be last option engine = tmp.substr( p, std::string::npos ); else engine = tmp.substr( p, e-p ); } } // initialize static var with result so that call happens only once static const CubitStatus status = init_cgm( engine ); // but check the result for every call if (CUBIT_SUCCESS != status) RETURN (iBase_FAILURE); // return the tagmanager as the instance #ifdef ITAPS_SHIM CGMTagManager::instance().vtable = &CGM_iGeom_vtable; #endif *instance_out = reinterpret_cast<iGeom_Instance>(&CGMTagManager::instance()); RETURN(iBase_SUCCESS); }
static void iGeom_reflectEnt | ( | iGeom_Instance | instance, |
iBase_EntityHandle | geom_entity, | ||
double | plane_normal_x, | ||
double | plane_normal_y, | ||
double | plane_normal_z, | ||
int * | err | ||
) | [static] |
Reflect an entity across a plane.
Reflect an entity across the given plane
instance | iGeom instance handle |
geom_entity | the entity to reflect |
plane_normal_x | x coordinate of the plane's normal |
plane_normal_y | y coordinate of the plane's normal |
plane_normal_z | z coordinate of the plane's normal |
*err | Pointer to error type returned from function |
static void iGeom_resetEntArrIter | ( | iGeom_Instance | instance, |
iBase_EntityArrIterator | entArr_iterator, | ||
int * | err | ||
) | [static] |
Reset the array iterator.
Reset the array iterator
instance | iGeom instance handle |
entArr_iterator | Iterator to reset |
*err | Pointer to error type returned from function |
Definition at line 955 of file iGeom_CGMA.cc.
{ CGMAIterator* iterator = reinterpret_cast<CGMAIterator*>(gentity_iterator); iterator->reset(); RETURN(iBase_SUCCESS); }
static void iGeom_resetEntIter | ( | iGeom_Instance | instance, |
iBase_EntityIterator | gentity_iterator, | ||
int * | err | ||
) | [static] |
Reset the iterator.
Reset the iterator
instance | iGeom instance handle |
entity_iterator | Iterator to reset |
*err | Pointer to error type returned from function |
Reset an iterator back to the first gentity
gentity_iterator | Iterator reset by this function |
Definition at line 945 of file iGeom_CGMA.cc.
{ CGMAIterator* iterator = reinterpret_cast<CGMAIterator*>(gentity_iterator); iterator->reset(); RETURN(iBase_SUCCESS); }
static void iGeom_rmvArrTag | ( | iGeom_Instance | instance, |
const iBase_EntityHandle * | entity_handles, | ||
int | entity_handles_size, | ||
iBase_TagHandle | tag_handle, | ||
int * | err | ||
) | [static] |
Remove a tag value from an array of entities.
Remove a tag value from an array of entities
instance | iGeom instance handle |
entity_handles | Entity from which tag is being removed |
entity_handles_size | Number of entities in entity array |
tag_handle | Tag handle of tag being removed |
*err | Pointer to error type returned from function |
Definition at line 1666 of file iGeom_CGMA.cc.
{ RefEntity *const *tmp_entity_handles = reinterpret_cast<RefEntity*const *>(entity_handles); iBase_ErrorType retval = TM->rmvArrTag(tmp_entity_handles, entity_handles_size, TAG_HANDLE(tag_handle)); RETURN(retval); }
static void iGeom_rmvEntArrFromSet | ( | iGeom_Instance | instance, |
iBase_EntityHandle const * | entity_handles, | ||
int | entity_handles_size, | ||
iBase_EntitySetHandle | entity_set, | ||
int * | err | ||
) | [static] |
Remove an array of entities from a set.
Remove an array of entities from a set
instance | iGeom instance handle |
entity_handles | Array of entities being remove |
entity_handles_size | Number of entities in entity_handles array |
entity_set | Pointer to the set being removed from |
*err | Pointer to error type returned from function |
Remove existing gentities from the gentity_set (do not delete them)
gentity_set | Set being removed from |
gentity_handles | Gentities being removed from gentity_set |
Definition at line 4283 of file iGeom_CGMA.cc.
{ if (NULL == entity_set) RETURN(iBase_INVALID_ARGUMENT); RefGroup *this_set = SET_HANDLE(entity_set); RefEntity **ent_array = (RefEntity**)(entity_handles); CubitStatus status = CUBIT_SUCCESS, tmp_status; for (int i = 0; i < entity_handles_size; i++) { tmp_status = this_set->remove_ref_entity(ent_array[i]); if (CUBIT_SUCCESS != tmp_status) status = tmp_status; } if (CUBIT_SUCCESS != status) { ERROR(iBase_FAILURE, "Problem removing entities from a set."); } RETURN(iBase_SUCCESS); }
static void iGeom_rmvEntFromSet | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_to_remove, | ||
iBase_EntitySetHandle | entity_set_handle, | ||
int * | err | ||
) | [static] |
Remove an entity from a set.
Remove an entity from a set
instance | iGeom instance handle |
entity_handle | The entity being removed |
entity_set | Pointer to the set being removed from |
*err | Pointer to error type returned from function |
Allows the user to remove one or more gentity_sets from another gentity_set. Users cannot delete a contained in relationship of an gentity set with the parent mesh interface so passing in a NULL value for the first argument results in no action.
gentity_set | Set from which other sets are being removed |
gentity_set_handles | Sets being removed from gentity_set |
Definition at line 4172 of file iGeom_CGMA.cc.
{ if (NULL == entity_set_handle) RETURN(iBase_INVALID_ARGUMENT); CubitStatus status = SET_HANDLE(entity_set_handle)-> remove_ref_entity(const_cast<RefEntity*>(ENTITY_HANDLE(entity_to_remove))); if (CUBIT_SUCCESS != status) { ERROR(iBase_FAILURE, "Problem removing entity from a set."); } RETURN(iBase_SUCCESS); }
static void iGeom_rmvEntSet | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set_to_remove, | ||
iBase_EntitySetHandle | entity_set_handle, | ||
int * | err | ||
) | [static] |
Remove an entity set from a set.
Remove an entity set from a set
instance | iGeom instance handle |
entity_set_to_remove | The entity set being removed |
entity_set_handle | Pointer to the set being removed from |
*err | Pointer to error type returned from function |
Allows the user to remove one or more gentity_sets from another gentity_set. Users cannot delete a contained in relationship of an gentity set with the parent mesh interface so passing in a NULL value for the first argument results in no action.
gentity_set | Set from which other sets are being removed |
gentity_set_handles | Sets being removed from gentity_set |
Definition at line 4128 of file iGeom_CGMA.cc.
{ iGeom_rmvEntFromSet(instance, reinterpret_cast<iBase_EntityHandle>(entity_set_to_remove), entity_set_handle, err); }
static void iGeom_rmvEntSetTag | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set, | ||
iBase_TagHandle | tag_handle, | ||
int * | err | ||
) | [static] |
Remove a tag value from an entity set.
Remove a tag value from an entity set
instance | iGeom instance handle |
entity_set_handle | Entity set from which tag is being removed |
tag_handle | Tag handle of tag being removed |
*err | Pointer to error type returned from function |
Remove the tag associated with the tag_handle from the mesh or gentity_set. The tag data is not destroyed in this function, but can be destroyed using the deleteTag function.
Definition at line 2035 of file iGeom_CGMA.cc.
{ // have to go through RefEntity* so that RefEntity** gets set right RefEntity *tmp_entity = SET_HANDLE(entity_set); iBase_ErrorType retval = TM->rmvArrTag(&tmp_entity, 1, TAG_HANDLE(tag_handle)); RETURN(retval); }
static void iGeom_rmvPrntChld | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | parent_entity_set, | ||
iBase_EntitySetHandle | child_entity_set, | ||
int * | err | ||
) | [static] |
Remove parent/child links between two sets.
Remove parent/child links between two sets.
instance | iGeom instance handle |
parent_entity_set | Pointer to parent set |
child_entity_set | Pointer to child set |
*err | Pointer to error type returned from function |
Remove a parent/child link between gentity_sets
Definition at line 1134 of file iGeom_CGMA.cc.
{ RefGroup *parent = reinterpret_cast<RefGroup *>(parent_entity_set); RefGroup *child = reinterpret_cast<RefGroup *>(child_entity_set); std::vector<RefGroup*> *children = TM->pc_list(parent, 1, false), *parents = TM->pc_list(child, 0, false); if (NULL == children || NULL == parents) { RETURN(iBase_INVALID_ARGUMENT); } children->erase(std::remove(children->begin(), children->end(), child), children->end()); parents->erase(std::remove(parents->begin(), parents->end(), parent), parents->end()); RETURN(iBase_SUCCESS); }
static void iGeom_rmvTag | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
iBase_TagHandle | tag_handle, | ||
int * | err | ||
) | [static] |
Remove a tag value from an entity.
Remove a tag value from an entity
instance | iGeom instance handle |
entity_handle | Entity from which tag is being removed |
tag_handle | Tag handle of tag being removed |
*err | Pointer to error type returned from function |
Allows the user to disassociate the tag referenced by the tag handle from the specified gentities. The tag data is not deleted in this call, but can be deleted later using the deleteTag function defined above.
Definition at line 1684 of file iGeom_CGMA.cc.
{ RefEntity *tmp_entity = ENTITY_HANDLE(entity_handle); iBase_ErrorType retval = TM->rmvArrTag(&tmp_entity, 1, TAG_HANDLE(tag_handle)); RETURN(retval); }
static void iGeom_rotateEnt | ( | iGeom_Instance | instance, |
iBase_EntityHandle | geom_entity, | ||
double | angle, | ||
double | axis_x, | ||
double | axis_y, | ||
double | axis_z, | ||
int * | err | ||
) | [static] |
Rotate an entity about an axis.
Rotate an entity by the given angle about the given axis.
instance | iGeom instance handle |
geom_entity | the entity to rotate |
angle | the rotational angle, in degrees |
axis_x | x coordinate of the axis |
axis_y | y coordinate of the axis |
axis_z | z coordinate of the axis |
*err | Pointer to error type returned from function |
Definition at line 6130 of file iGeom_CGMA.cc.
{ CubitVector this_axis(axis_normal_x, axis_normal_y, axis_normal_z); Body *this_bod = dynamic_cast<Body*>(ENTITY_HANDLE(geom_entity)); DLIList<Body*> bods; bods.append(this_bod); CubitStatus result; if (NULL != this_bod) { result = gqt->rotate(bods, this_axis, angle); if (CUBIT_SUCCESS != result) { ERROR(iBase_FAILURE, "Failed to rotate body."); } RETURN(iBase_SUCCESS); } BasicTopologyEntity *this_bte = dynamic_cast<BasicTopologyEntity*>(ENTITY_HANDLE(geom_entity)); if (NULL != this_bte) { DLIList<BasicTopologyEntity*> btes; btes.append(this_bte); result = gqt->rotate(btes, this_axis, angle); if (CUBIT_SUCCESS != result) { ERROR(iBase_FAILURE, "Failed to rotate entity."); } RETURN(iBase_SUCCESS); } ERROR(iBase_INVALID_ENTITY_TYPE, "Wrong type of entity specified for move."); }
static void iGeom_save | ( | iGeom_Instance | instance, |
const char * | name, | ||
const char * | options, | ||
int * | err, | ||
int | name_len, | ||
int | options_len | ||
) | [static] |
Save a geom to a file.
Save a geom to a file. If entity set is specified, save only the geom contained in that set.
instance | iGeom instance handle |
entity_set_handle | Entity set being saved |
name | File name to which geom is to be saved |
options | Pointer to implementation-specific options string |
*err | Pointer to error type returned from function |
name_len | Length of the file name character string |
options_len | Length of the options character string |
Save a model to file specified by name. Which formats are supported and the specific meaning of this name string (e.g. file name, model name, etc.) are implementation-dependent. Options are also implementation- dependent.
name | Name of the model |
options | String options |
Work around QueryEngine log file handling bug: If the export format is iges or step, be sure the log file name is not null
Definition at line 754 of file iGeom_CGMA.cc.
{ // make sure strings are null terminated std::string name_buf(name, name_len); name = name_buf.c_str(); // parse options std::string file_type; std::vector<std::string> opts; tokenize( std::string(options, options_len), opts ); for (std::vector<std::string>::iterator i = opts.begin(); i != opts.end(); ++i) { if (!match_option( *i, "TYPE", file_type )) // ERROR( iBase_INVALID_ARGUMENT, i->c_str() ); } // if no type, check file type for known extensions if (file_type.empty()) { size_t name_len = name_buf.length(); if (name_buf.find(".igs") < name_len || name_buf.find(".IGS") < name_len || name_buf.find(".iges") < name_len || name_buf.find(".IGES") < name_len) file_type = "IGES"; else if (name_buf.find(".stp") < name_len || name_buf.find(".STP") < name_len || name_buf.find(".step") < name_len || name_buf.find(".STEP") < name_len) file_type = "STEP"; else if (name_buf.find(".occ") < name_len || name_buf.find(".brep") < name_len || name_buf.find(".OCC") < name_len || name_buf.find(".BREP") < name_len) file_type = "OCC"; else ERROR(iBase_FAILURE, "Unknown geometry file extension and no file type."); } const char* logfile_name = NULL; if( file_type == "IGES" ){ logfile_name = "igeom_iges_export.log"; } else if( file_type == "STEP" ){ logfile_name = "igeom_step_export.log"; } // process options (none right now...) DLIList<RefEntity*> bodies; int num_ents_exported; CubitString cubit_version(" (iGeom)"); CubitStatus status = CubitCompat_export_solid_model(bodies, name, file_type.c_str(), num_ents_exported, cubit_version, logfile_name ); if (CUBIT_SUCCESS != status) ERROR(iBase_FAILURE, "Trouble saving geometry file."); RETURN(iBase_SUCCESS); }
static void iGeom_scaleEnt | ( | iGeom_Instance | instance, |
iBase_EntityHandle | geom_entity, | ||
double | scale_x, | ||
double | scale_y, | ||
double | scale_z, | ||
int * | err | ||
) | [static] |
Scale an entity in the x, y, and z directions.
Scale an entity in the x, y, and z directions.
instance | iGeom instance handle |
geom_entity | the entity to scale |
scale_x | factor to scale by in the x direction |
scale_y | factor to scale by in the y direction |
scale_z | factor to scale by in the z direction |
*err | Pointer to error type returned from function |
static void iGeom_sectionEnt | ( | iGeom_Instance | instance, |
iBase_EntityHandle | geom_entity, | ||
double | plane_normal_x, | ||
double | plane_normal_y, | ||
double | plane_normal_z, | ||
double | offset, | ||
int | reverse, | ||
iBase_EntityHandle * | geom_entity2, | ||
int * | err | ||
) | [static] |
Section (cut) a region with a plane.
Section (cut) a region with a plane, retaining one of the pieces and discarding the other.
instance | iGeom instance handle |
geom_entity | The entity to section |
plane_normal_x | x coordinate of the plane's normal |
plane_normal_y | y coordinate of the plane's normal |
plane_normal_z | z coordinate of the plane's normal |
offset | Distance of the plane from the origin |
reverse | Keep the piece on the normal's side (=0) or not (=1) |
geom_entity2 | Pointer to new entity handle returned from function |
*err | Pointer to error type returned from function |
Definition at line 6387 of file iGeom_CGMA.cc.
{ Body *this_body = dynamic_cast<Body*>(ENTITY_HANDLE(geom_entity)); if (NULL == this_body) { RefVolume *this_vol = dynamic_cast<RefVolume*>(ENTITY_HANDLE(geom_entity)); if (NULL != this_vol) this_body = this_vol->get_body_ptr(); } if (NULL == this_body) { ERROR(iBase_INVALID_ARGUMENT, "Can only section bodies."); } CubitVector normal(plane_normal_x, plane_normal_y, plane_normal_z); if (normal.length_squared() == 0.0) { ERROR(iBase_INVALID_ARGUMENT, "Zero-length vector input."); } CubitVector point1 = normal * CubitVector(1.0, 0.0, 0.0); if (point1.length_squared() == 0.0) point1 = normal * CubitVector(0.0, 1.0, 0.0); CubitVector point2 = normal * point1; CubitVector point3(0.0, 0.0, 0.0); if (0.0 != offset) { normal.normalize(); normal *= offset; point1 += normal; point2 += normal; point3 += normal; } DLIList<Body*> blank_list, new_body_list; blank_list.append(gmt->copy_body(this_body)); CubitStatus result = gmt->section(blank_list, point1, point2, point3, new_body_list, !reverse, false); if (CUBIT_SUCCESS != result || 0 == new_body_list.size()) { gqt->delete_RefEntity(blank_list.get()); ERROR(iBase_FAILURE, "Section failed."); } else { // need to assign it to a RE* first so the void cast gets done right RefEntity *new_body = new_body_list.get(); *geom_entity2 = reinterpret_cast<iBase_EntityHandle>(new_body); // also, delete the original body, now that the section worked gqt->delete_RefEntity(this_body); } RETURN(iBase_SUCCESS); }
static void iGeom_setArrData | ( | iGeom_Instance | instance, |
const iBase_EntityHandle * | entity_handles, | ||
int | entity_handles_size, | ||
iBase_TagHandle | tag_handle, | ||
const void * | tag_values, | ||
int | tag_values_size, | ||
int * | err | ||
) | [static] |
Set tag values of arbitrary type on an array of entities.
Set tag values of arbitrary type on an array of entities. Tag data is passed as void*. tag_values_size specifies the size of the memory pointed to by tag_values in terms of bytes. Applications may use this function to set data of any type, not just iBase_BYTES. However, because this function supports data of arbitrary type, in all cases the size specified by tag_values_size is always in terms of bytes.
instance | iGeom instance handle |
entity_handles | Entity array on which tag is being set |
entity_handles_size | Number of entities in array |
tag_handle | Tag being set on an entity |
tag_values | Pointer to tag data being set on entity. Note that the implicit INTERLEAVED storage order rule applies (see section ITAPS Storage Orders) |
tag_values_size | Size in bytes of tag data |
*err | Pointer to error type returned from function |
Definition at line 1819 of file iGeom_CGMA.cc.
{ const char *tag_value = reinterpret_cast<const char*>(tag_value_tmp); iBase_ErrorType retval = TM->setArrData(ENTITY_HANDLE_CONST_ARRAY(entity_handles), entity_handles_size, TAG_HANDLE(tag_handle), ARRAY_IN(tag_value)); RETURN(retval); }
static void iGeom_setData | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
iBase_TagHandle | tag_handle, | ||
const void * | tag_value_tmp, | ||
int | tag_value_size, | ||
int * | err | ||
) | [static] |
Set a tag value of arbitrary type on an entity.
Set a tag value of arbitrary type on an entity. Tag data is passed as void*. tag_value_size specifies the size of the memory pointed to by tag_value in terms of bytes. Applications may use this function to set data of any type, not just iBase_BYTES. However, because this function supports data of arbitrary type, in all cases the size specified by tag_value_size is always in terms of bytes.
instance | iGeom instance handle |
entity_handle | Entity on which tag is being set |
tag_handle | Tag being set on an entity |
tag_value | Pointer to tag data being set on entity |
tag_value_size | Size in bytes of tag data |
*err | Pointer to error type returned from function |
Allows the user to set the tag data values on an array of gentity handles
Definition at line 1970 of file iGeom_CGMA.cc.
{ const char *tag_value = reinterpret_cast<const char *>(tag_value_tmp); RefEntity *tmp_entity = ENTITY_HANDLE(entity_handle); iBase_ErrorType retval = TM->setArrData(&tmp_entity, 1, TAG_HANDLE(tag_handle), ARRAY_IN(tag_value)); RETURN(retval); }
static void iGeom_setDblArrData | ( | iGeom_Instance | instance, |
const iBase_EntityHandle * | entity_handles, | ||
int | entity_handles_size, | ||
iBase_TagHandle | tag_handle, | ||
const double * | tag_values, | ||
const int | tag_values_size, | ||
int * | err | ||
) | [static] |
Set tag values of double type on an array of entities.
Set tag values of double type on an array of entities.
instance | iGeom instance handle |
entity_handles | Entity array on which tag is being set |
entity_handles_size | Number of entities in array |
tag_handle | Tag being set on an entity |
tag_values | Pointer to tag data being set on entities |
tag_values_size | Size in total number of doubles of tag data |
*err | Pointer to error type returned from function |
Definition at line 1850 of file iGeom_CGMA.cc.
{ iGeom_setArrData(instance, entity_handles, entity_handles_size, tag_handle, tag_value, sizeof(double)*tag_value_size, err); }
static void iGeom_setDblData | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
iBase_TagHandle | tag_handle, | ||
double | tag_value, | ||
int * | err | ||
) | [static] |
Set a tag value of double type on an entity.
Set a tag value of double type on an entity.
instance | iGeom instance handle |
entity_handle | Entity on which tag is being set |
tag_handle | Tag being set on an entity |
tag_value | Tag value being set on entity |
*err | Pointer to error type returned from function |
Definition at line 1997 of file iGeom_CGMA.cc.
{ iGeom_setArrData(instance, &entity_handle, 1, tag_handle, &tag_value, sizeof(double), err); }
static void iGeom_setEHArrData | ( | iGeom_Instance | instance, |
const iBase_EntityHandle * | entity_handles, | ||
int | entity_handles_size, | ||
iBase_TagHandle | tag_handle, | ||
const iBase_EntityHandle * | tag_values, | ||
int | tag_values_size, | ||
int * | err | ||
) | [static] |
Set tag values of entity handle type on an array of entities.
Set tag values of entity handle type on an array of entities.
instance | iGeom instance handle |
entity_handles | Entity array on which tag is being set |
entity_handles_size | Number of entities in array |
tag_handle | Tag being set on an entity |
tag_values | Pointer to tag data being set on entities |
tag_values_size | Size in total number of entity handles of tag data |
*err | Pointer to error type returned from function |
Definition at line 1864 of file iGeom_CGMA.cc.
{ iGeom_setArrData(instance, entity_handles, entity_handles_size, tag_handle, tag_values, sizeof(iBase_EntityHandle)*tag_values_size, err); }
static void iGeom_setEHData | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
iBase_TagHandle | tag_handle, | ||
iBase_EntityHandle | tag_value, | ||
int * | err | ||
) | [static] |
Set a tag value of entity handle type on an entity.
Set a tag value of entity handle type on an entity.
instance | iGeom instance handle |
entity_handle | Entity on which tag is being set |
tag_handle | Tag being set on an entity |
tag_value | Tag value being set on entity |
*err | Pointer to error type returned from function |
Definition at line 2008 of file iGeom_CGMA.cc.
{ iGeom_setArrData(instance, &entity_handle, 1, tag_handle, &tag_value, sizeof(iBase_EntityHandle), err); }
static void iGeom_setEntSetData | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set, | ||
iBase_TagHandle | tag_handle, | ||
const void * | tag_value_tmp, | ||
int | tag_value_size, | ||
int * | err | ||
) | [static] |
Set a tag value of arbitrary type on an entity set.
Set a tag value of arbitrary type on an entity set. The tag data is passed as void*. tag_value_size specifies the size of the memory pointed to by tag_value in terms of bytes. Applications are free to use this function to set data of any type, not just iBase_BYTES. However, in all cases, the size specified by tag_value_size is always in terms of bytes.
instance | iGeom instance handle |
entity_set_handle | Entity set on which tag is being set |
tag_handle | Tag being set on an entity set |
tag_value | Pointer to tag data being set on entity set |
tag_value_size | Size in bytes of tag data |
*err | Pointer to error type returned from function |
Set the tag data associated with a given tag handle on the mesh or gentity_set
Definition at line 2143 of file iGeom_CGMA.cc.
{ const char *tag_value = reinterpret_cast<const char *>(tag_value_tmp); // have to go through RefEntity* so that RefEntity** gets set right RefEntity *tmp_entity = SET_HANDLE(entity_set); iBase_ErrorType retval = TM->setArrData(&tmp_entity, 1, TAG_HANDLE(tag_handle), ARRAY_IN(tag_value)); RETURN(retval); }
static void iGeom_setEntSetDblData | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set, | ||
iBase_TagHandle | tag_handle, | ||
double | tag_value, | ||
int * | err | ||
) | [static] |
Set a tag value of double type on an entity set.
Set a tag value of double type on an entity set.
instance | iGeom instance handle |
entity_set | Entity set on which tag is being set |
tag_handle | Tag being set on an entity set |
tag_value | Tag value being set on entity set |
*err | Pointer to error type returned from function |
Definition at line 2170 of file iGeom_CGMA.cc.
{ iGeom_setEntSetData(instance, entity_set, tag_handle, &tag_value, sizeof(double), err); }
static void iGeom_setEntSetEHData | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set, | ||
iBase_TagHandle | tag_handle, | ||
iBase_EntityHandle | tag_value, | ||
int * | err | ||
) | [static] |
Set a tag value of entity handle type on an entity set.
Set a tag value of entity handle type on an entity set.
instance | iGeom instance handle |
entity_set | Entity set on which tag is being set |
tag_handle | Tag being set on an entity set |
tag_value | Tag value being set on entity set |
*err | Pointer to error type returned from function |
Definition at line 2181 of file iGeom_CGMA.cc.
{ iGeom_setEntSetData(instance, entity_set, tag_handle, &tag_value, sizeof(iBase_EntityHandle), err); }
static void iGeom_setEntSetESHData | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set, | ||
iBase_TagHandle | tag_handle, | ||
iBase_EntitySetHandle | tag_value, | ||
int * | err | ||
) | [static] |
Set a tag value of entity set handle type on an entity set.
Set a tag value of entity set handle type on an entity set.
instance | iGeom instance handle |
entity_set | Entity set on which tag is being set |
tag_handle | Tag being set on an entity set |
tag_value | Tag value being set on entity set |
*err | Pointer to error type returned from function |
Definition at line 2193 of file iGeom_CGMA.cc.
{ iGeom_setEntSetData(instance, entity_set, tag_handle, &tag_value, sizeof(iBase_EntitySetHandle), err); }
static void iGeom_setEntSetIntData | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set, | ||
iBase_TagHandle | tag_handle, | ||
int | tag_value, | ||
int * | err | ||
) | [static] |
Set a tag value of integer type on an entity set.
Set a tag value of integer type on an entity set.
instance | iGeom instance handle |
entity_set | Entity set on which tag is being set |
tag_handle | Tag being set on an entity set |
tag_value | Tag value being set on entity set |
*err | Pointer to error type returned from function |
Definition at line 2159 of file iGeom_CGMA.cc.
{ iGeom_setEntSetData(instance, entity_set, tag_handle, &tag_value, sizeof(int), err); }
static void iGeom_setESHArrData | ( | iGeom_Instance | instance, |
const iBase_EntityHandle * | entity_handles, | ||
int | entity_handles_size, | ||
iBase_TagHandle | tag_handle, | ||
const iBase_EntitySetHandle * | tag_values, | ||
int | tag_values_size, | ||
int * | err | ||
) | [static] |
Set tag values of entity set handle type on an array of entities.
Set tag values of entity set handle type on an array of entities.
instance | iGeom instance handle |
entity_handles | Entity array on which tag is being set |
entity_handles_size | Number of entities in array |
tag_handle | Tag being set on an entity |
tag_values | Pointer to tag data being set on entities |
tag_values_size | Size in total number of entity handles of tag data |
*err | Pointer to error type returned from function |
Definition at line 1879 of file iGeom_CGMA.cc.
{ iGeom_setArrData(instance, entity_handles, entity_handles_size, tag_handle, tag_values, sizeof(iBase_EntitySetHandle)*tag_values_size, err); }
static void iGeom_setESHData | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
iBase_TagHandle | tag_handle, | ||
iBase_EntitySetHandle | tag_value, | ||
int * | err | ||
) | [static] |
Set a tag value of entity set handle type on an entity.
Set a tag value of entity set handle type on an entity.
instance | iGeom instance handle |
entity_handle | Entity on which tag is being set |
tag_handle | Tag being set on an entity |
tag_value | Tag value being set on entity |
*err | Pointer to error type returned from function |
Definition at line 2019 of file iGeom_CGMA.cc.
{ iGeom_setArrData(instance, &entity_handle, 1, tag_handle, &tag_value, sizeof(iBase_EntitySetHandle), err); }
static void iGeom_setIntArrData | ( | iGeom_Instance | instance, |
const iBase_EntityHandle * | entity_handles, | ||
int | entity_handles_size, | ||
iBase_TagHandle | tag_handle, | ||
const int * | tag_values, | ||
int | tag_values_size, | ||
int * | err | ||
) | [static] |
Set tag values of integer type on an array of entities.
Set tag values of integer type on an array of entities.
instance | iGeom instance handle |
entity_handles | Entity array on which tag is being set |
entity_handles_size | Number of entities in array |
tag_handle | Tag being set on an entity |
tag_values | Pointer to tag data being set on entities |
tag_values_size | Size in total number of integers of tag data |
*err | Pointer to error type returned from function |
Definition at line 1836 of file iGeom_CGMA.cc.
{ iGeom_setArrData(instance, entity_handles, entity_handles_size, tag_handle, tag_value, sizeof(int)*tag_value_size, err); }
static void iGeom_setIntData | ( | iGeom_Instance | instance, |
iBase_EntityHandle | entity_handle, | ||
iBase_TagHandle | tag_handle, | ||
int | tag_value, | ||
int * | err | ||
) | [static] |
Set a tag value of integer type on an entity.
Set a tag value of integer type on an entity.
instance | iGeom instance handle |
entity_handle | Entity on which tag is being set |
tag_handle | Tag being set on an entity |
tag_value | Tag value being set on entity |
*err | Pointer to error type returned from function |
Definition at line 1986 of file iGeom_CGMA.cc.
{ iGeom_setArrData(instance, &entity_handle, 1, tag_handle, &tag_value, sizeof(int), err); }
static void iGeom_subtract | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set_1, | ||
iBase_EntitySetHandle | entity_set_2, | ||
iBase_EntitySetHandle * | result_entity_set, | ||
int * | err | ||
) | [static] |
Subtract contents of one entity set from another.
Subtract contents of one entity set from another
instance | iGeom instance handle |
entity_set_1 | Entity set from which other set is being subtracted |
entity_set_2 | Entity set being subtracted from other set |
result_entity_set | Pointer to entity set returned from function |
*err | Pointer to error type returned from function |
Subtract the gentities in gentity_set_2 from the gentities in gentity_set_1; the result is returned in gentity_set_1. If gentity_set 1 is a multiset and contains m entries of a particular gentity, say gentity k, and gentity_set 2 contains n entry of gentity k, the result contains m-n entries of gentity k. (What about ordered sets? What if gentity_set 2 is not a subset of gentity set 1? Should be consistent with STL... )
Definition at line 5735 of file iGeom_CGMA.cc.
{ const RefGroup *set1 = SET_HANDLE(entity_set_1); const RefGroup *set2 = SET_HANDLE(entity_set_2); RefGroup *set3 = SET_HANDLE(*result_entity_set); if (NULL == set3) { set3 = RefEntityFactory::instance()->construct_RefGroup(); *result_entity_set = reinterpret_cast<iBase_EntitySetHandle>(set3); } const_cast<RefGroup*>(set1)->subtract(const_cast<RefGroup*>(set2), set3); RETURN(iBase_SUCCESS); }
static void iGeom_subtractEnts | ( | iGeom_Instance | instance, |
iBase_EntityHandle | blank, | ||
iBase_EntityHandle | tool, | ||
iBase_EntityHandle * | geom_entity, | ||
int * | err | ||
) | [static] |
Geometrically subtract one entity from another.
Geometrically subtract the entity tool from the entity blank.
instance | iGeom instance handle |
blank | The entity to subtract from |
tool | The entity to subtract |
geom_entity | Pointer to new entity handle returned from function |
*err | Pointer to error type returned from function |
Definition at line 6311 of file iGeom_CGMA.cc.
{ Body *this_blank = dynamic_cast<Body*>(ENTITY_HANDLE(blank)); Body *blank_copy = gmt->copy_body(this_blank); if (NULL == blank_copy) { ERROR(iBase_FAILURE, "Trouble copying blank."); } Body *this_tool = dynamic_cast<Body*>(ENTITY_HANDLE(tool)); Body *tool_copy = gmt->copy_body(this_tool); if (NULL == tool_copy) { ERROR(iBase_FAILURE, "Trouble copying tool."); gqt->delete_RefEntity(blank_copy); RETURN(iBase_FAILURE); } DLIList<Body*> blank_list, new_body_list; blank_list.append(blank_copy); RefEntity *new_body = NULL; CubitStatus result = gmt->subtract(tool_copy, blank_list, new_body_list); if (CUBIT_SUCCESS != result || 0 == new_body_list.size()) { ERROR(iBase_FAILURE, "Subtract failed."); } else { new_body = new_body_list.get(); *geom_entity = reinterpret_cast<iBase_EntityHandle>(new_body); gqt->delete_RefEntity(this_blank); gqt->delete_RefEntity(this_tool); } RETURN(iBase_SUCCESS); }
static void iGeom_sweepEntAboutAxis | ( | iGeom_Instance | instance, |
iBase_EntityHandle | geom_entity, | ||
double | angle, | ||
double | axis_x, | ||
double | axis_y, | ||
double | axis_z, | ||
iBase_EntityHandle * | geom_entity2, | ||
int * | err | ||
) | [static] |
Sweep (extrude) an entity about an axis.
Sweep (extrude) an entity by the given angle about the given axis.
instance | iGeom instance handle |
geom_entity | the entity to rotate |
angle | the rotational angle, in degrees |
axis_x | x coordinate of the axis |
axis_y | y coordinate of the axis |
axis_z | z coordinate of the axis |
geom_entity2 | Pointer to new entity handle returned from function |
*err | Pointer to error type returned from function |
Definition at line 5836 of file iGeom_CGMA.cc.
{ DLIList<RefEntity*> ents; RefEntity *this_ent = ENTITY_HANDLE(geom_entity); if (NULL == this_ent) { ERROR(iBase_FAILURE, "Can't get ref entity from specified entity."); } else if (this_ent->dimension() > 2) { ERROR(iBase_INVALID_ENTITY_TYPE, "Can't sweep 3-d entities."); } RefEntity *new_ent = gmt->copy_refentity(this_ent); ents.append(new_ent); CubitVector origin(0.0, 0.0, 0.0); CubitVector direction(axis_normal_x, axis_normal_y, axis_normal_z); double radian_angle = angle * DEG_TO_RAD; DLIList<Body*> new_bodies; CubitStatus result = gmt->sweep_rotational(ents, origin, direction, radian_angle, new_bodies, CUBIT_FALSE, CUBIT_FALSE); if (CUBIT_FAILURE == result) { // destroy entity we copied before gqt->delete_RefEntity(new_ent); ERROR(iBase_FAILURE, "Sweep returned failure."); } else { // HACK to get last entity created, because cgm doesn't return // body created by sweep RefEntity *new_body = new_bodies.get(); *geom_entity2 = reinterpret_cast<iBase_EntityHandle>(new_body); // now we know it's succeeded, delete original body Body *this_body = dynamic_cast<TopologyEntity*>(this_ent)->body(); if (NULL != this_body) gqt->delete_RefEntity(this_body); else gqt->delete_RefEntity(this_ent); } if (NULL == *geom_entity2) { RETURN(iBase_FAILURE); } RETURN(iBase_SUCCESS); }
static void iGeom_unite | ( | iGeom_Instance | instance, |
iBase_EntitySetHandle | entity_set_1, | ||
iBase_EntitySetHandle | entity_set_2, | ||
iBase_EntitySetHandle * | result_entity_set, | ||
int * | err | ||
) | [static] |
Unite contents of one entity set with another.
Unite contents of one entity set with another
instance | iGeom instance handle |
entity_set_1 | Entity set being united with another |
entity_set_2 | Entity set being united with another |
result_entity_set | Pointer to entity set returned from function |
*err | Pointer to error type returned from function |
Union the gentities in gentity_set_1 and gentity_set_2; the result is returned in gentity_set_1. The multiset flag in gentityset 1 determines if duplicate entries are allowed.
Definition at line 5783 of file iGeom_CGMA.cc.
{ const RefGroup *set1 = SET_HANDLE(entity_set_1); const RefGroup *set2 = SET_HANDLE(entity_set_2); RefGroup *set3 = SET_HANDLE(*result_entity_set); if (NULL == set3) { set3 = RefEntityFactory::instance()->construct_RefGroup(); *result_entity_set = reinterpret_cast<iBase_EntitySetHandle>(set3); } const_cast<RefGroup*>(set1)->unite(const_cast<RefGroup*>(set2), set3); RETURN(iBase_SUCCESS); }
static void iGeom_uniteEnts | ( | iGeom_Instance | instace, |
iBase_EntityHandle const * | geom_entities, | ||
int | geom_entities_size, | ||
iBase_EntityHandle * | geom_entity, | ||
int * | err | ||
) | [static] |
Geometrically unite entities.
Geometrically unite the specified entities.
instance | iGeom instance handle |
geom_entities | Array of entity handles being united |
geom_entities_size | Number of entities in geom_entities array |
geom_entity | Pointer to new entity handle returned from function |
*err | Pointer to error type returned from function |
Definition at line 6269 of file iGeom_CGMA.cc.
{ DLIList<Body*> bods, orig_bods; RefEntity* const* handle_array = ENTITY_HANDLE_CONST_ARRAY(geom_entities); for (int i = 0; i < geom_entities_size; i++) { Body *this_body = dynamic_cast<Body*>(handle_array[i]); if (NULL != this_body) { Body *new_body = gmt->copy_body(this_body); if (NULL != new_body) { bods.append(this_body); orig_bods.append(new_body); } } } if (bods.size() < geom_entities_size) { ERROR(iBase_INVALID_ARGUMENT, "Not all entities input were regions."); for (int i = bods.size(); i > 0; i--) gqt->delete_RefEntity(bods.get_and_step()); RETURN(iBase_SUCCESS); } DLIList<Body*> new_bods; CubitStatus result = gmt->unite(bods, new_bods, false); if (CUBIT_SUCCESS != result || 1 != new_bods.size()) { ERROR(iBase_FAILURE, "Unite failed."); } else { *geom_entity = reinterpret_cast<iBase_EntityHandle>(dynamic_cast<RefEntity*>(new_bods.get())); for (int i = orig_bods.size(); i > 0; i--) gqt->delete_RefEntity(orig_bods.get_and_step()); } RETURN(iBase_SUCCESS); }