cgma
iGeom_private.h File Reference
#include "iBase.h"
#include "iGeom_protos.h"

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 Documentation

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.


Function Documentation

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

Parameters:
instanceiGeom instance handle
entity_handlesArray of entities being added
entity_handles_sizeNumber of entities in entity_handles array
entity_setPointer to the set being added to
*errPointer 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.

Parameters:
gentity_setSet being added to
gentity_handlesGentities 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

Parameters:
instanceiGeom instance handle
entity_set_to_addThe entity set being added
entity_set_handlePointer to the set being added to
*errPointer 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.

Parameters:
gentity_setSet to which other sets are being added
gentity_set_handlesSets 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

Parameters:
instanceiGeom instance handle
entity_handleThe entity being added
entity_setPointer to the set being added to
*errPointer 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.

Parameters:
gentity_setSet to which other sets are being added
gentity_set_handlesSets 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.

Parameters:
instanceiGeom instance handle
parent_entity_setPointer to parent set
child_entity_setPointer to child set
*errPointer 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

Parameters:
instanceiGeom instance handle
sourceentity to be copied
copythe newly-created entity
*errPointer 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.

Parameters:
instanceiGeom instance handle
xx dimension of new box
yy dimension of new box
zz dimension of new box
geom_entityPointer to new entity handle returned from function
*errPointer 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.

Parameters:
instanceiGeom instance handle
heightThe height of the cone.
major_rad_baseThe x-axis radius at the base of the cylinder
minor_rad_baseThe 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_topThe 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_entityPointer to new entity handle returned from function
*errPointer 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).

Parameters:
instanceiGeom instance handle
heightThe height of the cylinder.
major_radThe x-axis radius
minor_radThe y-axis radius. If minor_rad is 0, the cylinder will be circular (as if minor_rad == major_rad).
geom_entityPointer to new entity handle returned from function
*errPointer 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.

Parameters:
instanceiGeom instance handle
isListIf non-zero, an ordered list is created, otherwise an unordered set is created.
entity_set_createdEntity set created by function
*errPointer 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.

Parameters:
multisetIf true, gentities can appear more than once in this gentity_set
orderedIf true, order of addition and removal is maintained for this gentity_set
gentity_set_createdEntity_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).

Parameters:
instanceiGeom instance handle
heightheight of new prism
n_sidesnumber of sides of new prism
major_radmajor radius of new prism
minor_radminor radius of new prism
geom_entityPointer to new entity handle returned from function
*errPointer 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.

Parameters:
instanceiGeom instance handle
radiusradius of the sphere
geom_entityPointer to new entity handle returned from function
*errPointer 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.

Parameters:
instanceiGeom instance handle
tag_nameCharacter string indicating tag name
tag_sizeSize of each tag value, in units of number of tag_type entities
tag_typeData type for data stored in this tag
tag_handlePointer to tag handle returned from function
*errPointer to error type returned from function
tag_name_lenLength 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.

Parameters:
instanceiGeom instance handle
major_radThe distance from the origin to the center of the torus's circular cross-section.
minor_radThe radius of the cross-section.
geom_entityPointer to new entity handle returned from function
*errPointer 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

Parameters:
instanceiGeom instance handle
*errPointer to error type returned from function

Definition at line 5895 of file iGeom_CGMA.cc.

static void iGeom_deleteEnt ( iGeom_Instance  instance,
iBase_EntityHandle  entity_handle,
int *  err 
) [static]

Delete specified entity.

Delete specified entity

Parameters:
instanceiGeom instance handle
entity_handleEntity to be deleted
*errPointer 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

Parameters:
instanceiGeom instance handle
entity_setEntity set to be destroyed
*errPointer to error type returned from function

Destroy the gentity set. This method only destroys the grouping of gentities, not the gentities themselves.

Parameters:
gentity_setEntity_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.

Parameters:
instanceiGeom instance handle
tag_handleHandle of tag to be deleted
forcedIf non-zero, delete the tag even if entities have values set for that tag
*errPointer 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

Parameters:
instanceiGeom instance to be destroyed
*errPointer 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

Parameters:
instanceiGeom instance handle
entArr_iteratorIterator which gets destroyed
*errPointer 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

Parameters:
instanceiGeom instance handle
entity_iteratorIterator which gets destroyed
*errPointer to error type returned from function

Delete an iterator

Parameters:
gentity_iteratorIterator 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

Parameters:
instanceiGeom instance handle
entity_set_handleEntity being queried
*tag_handlesPointer to array of tag_handles returned from function
*tag_handles_allocatedPointer to allocated size of tag_handles array
*tag_handles_sizePointer to occupied size of tag_handles array
*errPointer 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

Parameters:
instanceiGeom instance handle
entity_handleEntity being queried
*tag_handlesPointer to array of tag_handles returned from function
*tag_handles_allocatedPointer to allocated size of tag_handles array
*tag_handles_sizePointer to occupied size of tag_handles array
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handlesArray of entity handles being queried
entity_handles_sizeNumber of entities in entity_handles array
storage_orderStorage order of coordinates input and output
uvParametric coordinates being queried
uv_sizeNumber of coordinates in array
dvrt_uPointer to array of coordinates of derivative with respect to u at specified position returned from function
dvrt_u_allocatedAllocated size of dvrt_u array
dvrt_u_sizeOccupied size of dvrt_u array
u_offsetPointer to array of offsets for dvrt_u returned from function
u_offset_allocatedPointer to allocated size of u_offset array
u_offset_sizePointer to occupied size of u_offset array
dvrt_vPointer to array of coordinates of derivative with respect to v at specified position returned from function
dvrt_v_allocatedAllocated size of dvrt_v array
dvrt_v_sizeOccupied size of dvrt_v array
v_offsetPointer to array of offsets for dvrt_v returned from function
v_offset_allocatedPointer to allocated size of v_offset array
v_offset_sizePointer to occupied size of v_offset array
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handlesEntities from which adjacencies are requested
entity_handles_sizeNumber of entities whose adjacencies are requested
bridge_dimensionBridge dimension for 2nd order adjacencies
to_dimensionDimension of adjacent entities returned
adj_entity_handlesAdjacent entities
adj_entity_handles_allocatedAllocated size of returned array
adj_entity_handles_sizeOccupied size of returned array
offsetOffset[i] is offset into adj_entity_handles of 2nd order adjacencies of ith entity in entity_handles
offset_allocatedAllocated size of offset array
offset_sizeOccupied size of offset array
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handlesArray of entity handles being queried
entity_handles_sizeNumber of entities in entity_handles array
storage_orderStorage order of coordinates input and output
uvParametric coordinates being queried
uv_sizeNumber of coordinates in array
dvrt_uuPointer to array of coordinates of derivative with respect to u at specified position returned from function
dvrt_uu_allocatedAllocated size of dvrt_uu array
dvrt_uu_sizeOccupied size of dvrt_uu array
uu_offsetPointer to array of offsets for dvrt_uu returned from function
uu_offset_allocatedPointer to allocated size of uu_offset array
uu_offset_sizePointer to occupied size of uu_offset array
dvrt_vvPointer to array of coordinates of derivative with respect to v at specified position returned from function
dvrt_vv_allocatedAllocated size of dvrt_vv array
dvrt_vv_sizeOccupied size of dvrt_vv array
vv_offsetPointer to array of offsets for dvrt_vv returned from function
vv_offset_allocatedPointer to allocated size of vv_offset array
vv_offset_sizePointer to occupied size of vv_offset array
dvrt_uvPointer to array of coordinates of derivative with respect to u and v at specified position returned from function
dvrt_uv_allocatedAllocated size of dvrt_uv array
dvrt_uv_sizeOccupied size of dvrt_uv array
uv_offsetPointer to array of offsets for dvrt_uv returned from function
uv_offset_allocatedPointer to allocated size of uv_offset array
uv_offset_sizePointer to occupied size of uv_offset array
*errPointer to error type returned from function

Definition at line 5585 of file iGeom_CGMA.cc.

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].

Parameters:
instanceiGeom instance handle
entity_handlesArray of entity handles being queried
entity_handles_sizeNumber of entities in entity_handles array
entity_type_requestedType of adjacent entities requested
*adjacentEntityHandlesPointer to array of adjacentEntityHandles returned from function
*adjacentEntityHandles_allocatedPointer to allocated size of adjacentEntityHandles array
*adj_entity_handles_sizePointer to occupied size of adjacentEntityHandles array
*offsetPointer to array of offsets returned from function
*offset_allocatedPointer to allocated size of offset array
*offset_sizePointer to occupied size of offset array
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handlesEntity handles being queried
enttiy_handles_sizeNumber of entities being queried
storage_orderStorage order of coordinates passed back
min_cornerMinimum coordinates of bounding boxes
min_corner_allocatedAllocated size of minimum coordinates array
min_corner_sizeOccupied size of minimum coordinates array
max_cornerMaximum coordinates of bounding boxes
max_corner_allocatedAllocated size of maximum coordinates array
max_corner_sizeOccupied size of maximum coordinates array
*errPointer to error type returned from function

Return the bounding boxex of given entities; coordinates returned interleaved.

Parameters:
gentity_handlesThe gentities being queried
min_cornersMinimum corner coordinates of the boxes, interleaved
max_cornersMaximum 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.

Parameters:
instanceiGeom instance handle
entity_handlesEntity(ies) being queried
entity_handles_sizeNumber of entities being queried
storage_orderStorage order of input points
near_coordinatesCoordinates of starting point(s)
near_coordinates_sizeNumber of values in near_coordinates array
on_coordinatesCoordinates of closest points
on_coordinates_allocatedAllocated size of closest point array
on_coordinates_sizeOccupied size of closest point array
*errPointer 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.

Parameters:
gentity_handlesThe gentities being queried
near_coordinatesInput coordinates
on_coordinatesClosest 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.

Parameters:
instanceiGeom instance handle
entity_handlesEntity array on which tag is being set
entity_handles_sizeNumber of entities in array
tag_handleTag being set on an entity
*tag_valuesPointer to tag data array being returned from function. Note that the implicit INTERLEAVED storage order rule applies (see section ITAPS Storage Orders)
tag_values_allocatedPointer to allocated size of tag data array
tag_values_sizePointer to occupied size in bytes of tag data array
*errPointer 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.

Parameters:
instanceiGeom instance handle
edge_handlesEdge(s) being queried
edge_handles_sizeNumber of edges being queried
storage_orderStorage order of coordinates
coordsStarting coordinates
coords_sizeNumber of values in coordinates array
on_coordsClosest point array
on_coords_allocatedAllocated size of closest point array
on_coords_sizeOccupied size of closest point array
tangentTangent array
tangent_allocatedAllocated size of tangent array
tangent_sizeOccupied size of tangent array
cvtrFirst principal curvatures
cvtr_allocatedAllocated size of first curvature array
cvtr_sizeOccupied size of first curvature array
*errPointer 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.

Parameters:
instanceiGeom instance handle
edge_handlesEdge(s) being queried
edge_handles_sizeNumber of edges being queried
storage_orderStorage order of coordinates
coordsStarting coordinates
coords_sizeNumber of values in coordinates array
on_coordsClosest point array
on_coords_allocatedAllocated size of closest point array
on_coords_sizeOccupied size of closest point array
normalNormal array
normal_allocatedAllocated size of normal array
normal_sizeOccupied size of normal array
cvtr_1First principal curvatures
cvtr_1_allocatedAllocated size of first curvature array
cvtr_1_sizeOccupied size of first curvature array
cvtr_2Second principal curvatures
cvtr_2_allocatedAllocated size of second curvature array
cvtr_2_sizeOccupied size of second curvature array
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handlesEntity(ies) being queried
entity_handles_sizeNumber of entity(ies) being queried
storage_orderStorage order in near_coordinates array
near_coordinatesStarting coordinates
near_coordinates_sizeNumber of values in near_coordinates array
on_coordinatesClosest point array
on_coordinates_allocatedAllocated size of closest point array
on_coordinates_sizeOccupied size of closest point array
normalsNormal array
normals_allocatedAllocated size of normal array
normals_sizeOccupied size of normal array
*errPointer 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.

Parameters:
gentity_handlesThe gentities being queried
near_coordinatesInput coordinates
on_coordinatesClosest 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.

Parameters:
instanceiGeom instance handle
face_handlesFaces being queried
face_handles_sizeSize of face handles array
region_handlesRegions being queried
region_handles_sizeSize of region handles array
senseSenses of faces with respect to regions
sense_allocatedAllocated size of senses array
sense_sizeOccupied size of senses array
*errPointer 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.

Parameters:
instanceiGeom instance handle
face_handleFaces being queried
face_handles_sizeNumber of faces being queried
storage_orderStorage order of coordinates input and output
parametersParametric coordinates being queried
parameters_sizeNumber of coordinates in array
normalsCoordinates of normals at specified positions
normals_allocatedAllocated size of normals array
normals_sizeOccupied size of normals array
*errPointer 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.

Parameters:
gface_handlesThe entities being queried
parametersThe uv parameters of points being queried, interleaved
normalsNormals 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.

Parameters:
instanceiGeom instance handle
entity_handlesEntity(ies) being queried
entity_handles_sizeNumber of entities being queried
storage_orderStorage order of coordinates
coordinatesStarting coordinates
coordinates_sizeNumber of values in coordinates array
normalsNormal coordinates
normals_allocatedAllocated size of normals array
normals_sizeOccupied size of normals array
*errPointer 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.

Parameters:
gentity_handlesThe gentities being queried
coordinatesInput coordinates, interleaved
normalsThe 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.

Parameters:
instanceiGeom instance handle
edge_handleEdges being queried
edge_handles_sizeNumber of faces being queried
storage_orderStorage order of coordinates output
parametersParametric coordinates being queried
parameters_sizeNumber of coordinates in array
tangentsCoordinates of tangents at specified positions
tangents_allocatedAllocated size of tangents array
tangents_sizeOccupied size of tangents array
*errPointer 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.

Parameters:
gentity_handlesThe gedges being queried
parametersThe u parameters of points being queried
tangentsTangents 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

Parameters:
instanceiGeom instance handle
entity_handlesEntity(ies) being queried
entity_handles_sizeNumber of entities being queried
storage_orderStorage order of coordinates
coordinatesStarting coordinates
coordinates_sizeNumber of values in coordinates array
tangentsTangent coordinates
tangents_allocatedAllocated size of tangents array
tangents_sizeOccupied size of tangents array
*errPointer 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.

Parameters:
gentity_handlesThe gentities being queried
coordinatesInput coordinates, interleaved
tangentsThe 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.

Parameters:
instanceiGeom instance handle
entity_handlesArray of entity handles being queried
entity_handles_sizeNumber of entities in entity_handles array
tolerancePointer to array of tolerances returned from function
tolerance_allocatedPointer to allocated size of tolerance array
tololerance_sizePointer to occupied size of tolerance array
*errPointer 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.

Parameters:
gentity_handlesGentities being queried
relative_tolerancesRelative tolerances
absolute_tolerancesAbsolute 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.

Parameters:
instanceiGeom instance handle
entity_handlesArray of entity handles being queried
entity_handles_sizeNumber of entities in entity_handles array
*typePointer to array of types returned from function
*type_allocatedPointer to allocated size of type array
*type_sizePointer to occupied size of type array
*errPointer 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

Parameters:
instanceiGeom instance handle
entity_handlesEntities being queried
entity_handles_sizeNumber of entities being queried
storage_orderStorage order of parametric coordinates being returned
u_minMinimum parametric coordinate for entities
u_min_allocatedAllocated size of minimum parametric coordinate array
u_min_sizeOccupied size of minimum parametric coordinate array
u_maxMaximum parametric coordinate for entities
u_max_allocatedAllocated size of maximum parametric coordinate array
u_max_sizeOccupied size of maximum parametric coordinate array
*errPointer 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

Parameters:
instanceiGeom instance handle
edge_handlesEdges being queried
edge_handles_sizeNumber of edges being queried
face_handlesFaces being queried
face_handles_sizeNumber of faces being queried
u_inParametric positions on edges
u_in_sizeNumber of parametric positions on edges
storage_orderStorage order of coordinates returned
uvCorresponding parametric positions on faces
uv_allocatedAllocated size of parameter array
uv_sizeOccupied size of parameter array
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handlesEntities being queried
entity_handles_sizeNumber of entities being queried
storage_orderStorage order of resulting coordinates
uvCoordinates being queried
uv_sizeNumber of coordinates in array
coordinatesCoordinates of parametric positions
coordinates_allocatedAllocated size of coordinates array
coordinates_sizeOccupied size of coordinates array
*errPointer 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

Parameters:
instanceiGeom instance handle
entity_handlesEntities being queried
entity_handles_sizeNumber of entities being queried
storage_orderStorage order of parametric coordinates being returned
uv_minMinimum parametric coordinate for entities
uv_min_allocatedAllocated size of minimum parametric coordinate array
uv_min_sizeOccupied size of minimum parametric coordinate array
uv_maxMaximum parametric coordinate for entities
uv_max_allocatedAllocated size of maximum parametric coordinate array
uv_max_sizeOccupied size of maximum parametric coordinate array
*errPointer to error type returned from function

Return the uv range of the specified gentities. Parameters are interleaved.

Parameters:
gentity_handlesGentities being queried.
uv_minMinimum parameters of gentities, interleaved
uv_maxMaximum 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.

Parameters:
instanceiGeom instance handle
entity_handlesEntities being queried
entity_handles_sizeNumber of entities being queried
storage_orderStorage order of uv coordinates input and xyz coordinate output
uvCoordinates being queried
uv_sizeNumber of coordinates in array
coordinatesCoordinates of parametric positions
coordinates_allocatedAllocated size of coordinates array
coordinates_sizeOccupied size of coordinates array
*errPointer 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.

Parameters:
gentity_handlesGentities being queried.
uvInput parametric coordinates
xyzOutput 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.

Parameters:
instanceiGeom instance handle
entity_handlesEntities being queried
entity_handles_sizeNumber of entities being queried
storage_orderStorage order of spatial coordinates input
coordinatesCoordinates being queried
coordinates_sizeNumber of coordinates in array
uCoordinates of parametric positions
u_allocatedAllocated size of coordinates array
u_sizeOccupied size of coordinates array
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handlesEntities being queried
entity_handles_sizeNumber of entities being queried
storage_orderStorage order of spatial coordinates input
coordinatesCoordinates being queried
coordinates_sizeNumber of coordinates in array
uvCoordinates of parametric positions
uv_allocatedAllocated size of coordinates array
uv_sizeOccupied size of coordinates array
*errPointer 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.

Parameters:
gentity_handlesGentities being queried.
xyzInput real space coordinates
uvOutput 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.

Parameters:
instanceiGeom instance handle
entity_handlesEntities being queried
entity_handles_sizeNumber of entities being queried
storage_orderStorage order of spatial coordinates input
coordinatesCoordinates being queried
coordinates_sizeNumber of coordinates in array
uvCoordinates of parametric positions
uv_allocatedAllocated size of coordinates array
uv_sizeOccupied size of coordinates array
*errPointer 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.

Parameters:
gentity_handlesGentities being queried.
xyzInput real space coordinates
uvOutput 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

Parameters:
instanceiGeom instance handle
min_xMinimum coordinate of bounding box
min_yMinimum coordinate of bounding box
min_zMinimum coordinate of bounding box
max_xMaximum coordinate of bounding box
max_yMaximum coordinate of bounding box
max_zMaximum coordinate of bounding box
*errPointer 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.

Parameters:
instanceiGeom instance handle
from_entity_setEntity set being queried
num_hopsMaximum hops from entity_set_handle to child set, not inclusive of the child set
*entity_set_handlesPointer to array of child sets returned from function
*entity_set_handles_allocatedPointer to allocated size of entity_set_handles array
*entity_set_handles_sizePointer to occupied size of entity_set_handles array
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handleEntity on which tag is being set
tag_handleTag being set on an entity
*tag_valuePointer to tag data array being queried
*tag_value_allocatedPointer to tag data array allocated size
*tag_value_sizePointer to occupied size in bytes of tag data array
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handlesEntity array on which tag is being set
entity_handles_sizeNumber of entities in array
tag_handleTag being set on an entity
*tag_valuesPointer to tag data array being returned from function
tag_values_allocatedPointer to allocated size of tag data array
tag_values_sizePointer to occupied size of tag data array
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handleEntity on which tag is being set
tag_handleTag being set on an entity
*out_dataPointer to tag value returned from function
*errPointer 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

Parameters:
instanceiGeom instance handle
descrPointer to a character string to be filled with a description of the error from the last iGeom function
descr_lenLength 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.

Parameters:
instanceiGeom instance handle
edge_handleEdge being queried
xPosition being queried
yPosition being queried
zPosition being queried
cvtr_iMaximum curvature vector
cvtr_jMaximum curvature vector
cvtr_kMaximum curvature vector
*errPointer 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.

Parameters:
instanceiGeom instance handle
edge_handleEdge being queried
xPoint at which entity is being queried
yPoint at which entity is being queried
zPoint at which entity is being queried
on_xClosest point at point being queried
on_yClosest point at point being queried
on_zClosest point at point being queried
tgnt_iTangent at point being queried
tgnt_jTangent at point being queried
tgnt_kTangent at point being queried
cvtr_iCurvature at point being queried
cvtr_jCurvature at point being queried
cvtr_kCurvature at point being queried
*errPointer 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.

Parameters:
instanceiGeom instance handle
edge_handlesEdges being queried
edge_handles_sizeSize of edge handles array
face_handlesFaces being queried
face_handles_sizeSize of face handles array
senseSenses of faces with respect to regions
sense_allocatedAllocated size of senses array
sense_sizeOccupied size of senses array
*errPointer 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.

Parameters:
instanceiGeom instance handle
edgeEdge being queried
faceFace being queried
sense_outSense of edge with respect to face
*errPointer 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.

Parameters:
gedgeGedge whose sense is being queried.
gfaceGface 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.

Parameters:
instanceiGeom instance handle
edge_handlesEdges being queried
edge_handles_sizeNumber of edges being queried
vertex_handles_1First vertex being queried
vertex_handles_1_sizeNumber of vertices in vertices array
vertex_handles_2Second vertex being queried
vertex_handles_2_sizeNumber of vertices in vertices array
senseSense of vertex pair with respect to edge
sense_allocatedAllocated size of sense array
sense_sizeOccupied size of sense array
*errPointer 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.

Parameters:
instanceiGeom instance handle
edgeEdge being queried
vertex1First vertex being queried
vertex2Second vertex being queried
sense_outSense of vertex pair with respect to edge
*errPointer 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).

Parameters:
gedgeGedge whose sense is being queried.
gvertex1First gvertex
gvertex2Second 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.

Parameters:
instanceiGeom instance handle
entity_handlesEntity array on which tag is being set
entity_handles_sizeNumber of entities in array
tag_handleTag being set on an entity
*tag_valuePointer to tag data array being returned from function
tag_value_allocatedPointer to allocated size of tag data array
tag_value_sizePointer to occupied size of tag data array
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handleEntity on which tag is being set
tag_handleTag being set on an entity
*out_dataPointer to tag value returned from function
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handleEntity being queried
uParametric position being queried
vParametric position being queried
dvrt_uPointer to coordinates of derivative with respect to u at specified position returned from function
dvrt_u_allocatedAllocated size of dvrt_u array
dvrt_u_sizeOccupied size of dvrt_u array
dvrt_vPointer to coordinates of derivative with respect to v at specified position returned from function
dvrt_v_allocatedAllocated size of dvrt_v array
dvrt_v_sizeOccupied size of dvrt_v array
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handleEntity from which adjacencies are requested
bridge_dimensionBridge dimension for 2nd order adjacencies
to_dimensionDimension of adjacent entities returned
adjacent_entitiesAdjacent entities
adjacent_entities_allocatedAllocated size of returned array
adjacent_entities_sizeOccupied size of returned array
*errPointer 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.

Parameters:
gentity_handleEntity for which 2nd order adjacencies are requested
to_dimensionTarget dimension of 2nd order adjacent entities
bridge_dimensionDimension of "bridge" entities
adj_gentitiesList 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.

Parameters:
instanceiGeom instance handle
entity_handleEntity being queried
uParametric position being queried
vParametric position being queried
dvrt_uuPointer to coordinates of derivative with respect to u at specified position returned from function
dvrt_uu_allocatedAllocated size of dvrt_uu array
dvrt_uu_sizeOccupied size of dvrt_uu array
dvrt_vvPointer to coordinates of derivative with respect to v at specified position returned from function
dvrt_vv_allocatedAllocated size of dvrt_vv array
dvrt_vv_sizeOccupied size of dvrt_vv array
dvrt_uvPointer to coordinates of derivative with respect to u and v at specified position returned from function
dvrt_uv_allocatedAllocated size of dvrt_uv array
dvrt_uv_sizeOccupied size of dvrt_uv array
*errPointer to error type returned from function

Definition at line 5566 of file iGeom_CGMA.cc.

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.

Parameters:
instanceiGeom instance handle
entity_handleEntity handle being queried
entity_type_requestedType of adjacent entities requested
*adj_entity_handlesPointer to array of adjacent entities returned from function
*adj_entity_handles_allocatedPointer to allocated size of adj_entity_handles array
*adj_entity_handles_sizePointer to occupied size of adj_entity_handles array
*errPointer to error type returned from function

Get the adjacent entities of a given dimension.

Parameters:
gentity_handleEntity for which adjacencies are requested
to_dimensionTarget dimension of adjacent entities
adj_gentitiesList 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.

Parameters:
instanceiGeom instance handle
entity_handlesEntity(ies) being queried
entity_handles_sizeNumber of entities being queried
storage_orderStorage order of coordinates
coordsStarting coordinates
coords_sizeNumber of values in coordinates array
cvtr_1First principal curvatures
cvtr_1_allocatedAllocated size of first curvature array
cvtr_1_sizeOccupied size of first curvature array
cvtr_2Second principal curvatures
cvtr_2_allocatedAllocated size of second curvature array
cvtr_2_sizeOccupied size of second curvature array
*errPointer 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

Parameters:
instanceiGeom instance handle
entity_handleEntity being queried
min_xMinimum coordinate of bounding box
min_yMinimum coordinate of bounding box
min_zMinimum coordinate of bounding box
max_xMaximum coordinate of bounding box
max_yMaximum coordinate of bounding box
max_zMaximum coordinate of bounding box
*errPointer 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

Parameters:
instanceiGeom instance handle
entity_handleEntity being queried
near_xCoordinates of starting point
near_yCoordinates of starting point
near_zCoordinates of starting point
on_xClosest point on entity
on_yClosest point on entity
on_zClosest point on entity
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handlesEntity(ies) being queried
entity_handles_sizeNumber of entities being queried
storage_orderStorage order of input points
near_coordinatesCoordinates of starting point(s)
near_coordinates_sizeNumber of values in near_coordinates array
on_coordinatesCoordinates of closest points
on_coordinates_allocatedAllocated size of closest point array
on_coordinates_sizeOccupied size of closest point array
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_set_handleEntity set being queried
entity_typeType of entities being requested
entity_topologyTopology of entities being requested
*entity_handlesPointer to array of entity handles returned from function
*entity_handles_allocatedPointer to allocated size of entity_handles array
*entity_handles_sizePointer to occupied size of entity_handles array
*errPointer to error type returned from function

Return gentities of specified dimension in this set, or in whole model.

Parameters:
set_handleEntity set being queried (if 0, whole model)
gentity_dimensionDimension of entities being queried
gentity_handlesEntity 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.

Parameters:
entity_handleEntity being queried
instanceiGeom instance handle
xStarting coordinates
yStarting coordinates
zStarting coordinates
pt_xClosest point
pt_yClosest point
pt_zClosest point
nrml_iNormal at closest point
nrml_jNormal at closest point
nrml_kNormal at closest point
*errPointer 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.

Parameters:
instanceiGeom instance handle
faceFace being queried
regionRegion being queried
sense_outSense of face with respect to region
*errPointer 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.

Parameters:
gfaceface whose sense is being queried.
gregionregion 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

Parameters:
instanceiGeom instance handle
entity_handleEntity being queried
uParametric position being queried
vParametric position being queried
nrml_iNormal at specified position
nrml_jNormal at specified position
nrml_kNormal at specified position
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handleEntity being queried
xCoordinates of starting point
yCoordinates of starting point
zCoordinates of starting point
nrml_iNormal vector at starting point
nrml_jNormal vector at starting point
nrml_kNormal vector at starting point
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_set_handleEntity set on which tag is being set
tag_handleTag being set on an entity set
*tag_valuePointer to tag data array being queried
*tag_value_allocatedPointer to tag data array allocated size
*tag_value_sizePointer to occupied size in bytes of tag data array
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_setEntity set on which tag is being set
tag_handleTag being set on an entity set
*out_dataPointer to tag value returned from function
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_setEntity set on which tag is being set
tag_handleTag being set on an entity set
*out_dataPointer to tag value returned from function
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_setEntity set on which tag is being set
tag_handleTag being set on an entity set
*out_dataPointer to tag value returned from function
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_setEntity set on which tag is being set
tag_handleTag being set on an entity set
*out_dataPointer to tag value returned from function
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_set_handleEntity set being queried
num_hopsMaximum hops from entity_set_handle to contained set, not inclusive of the contained set
*contained_set_handlesPointer to array of set handles returned from function
contained_set_handles_allocatedPointer to allocated length of contained_set_handles array
contained_set_handles_sizePointer to occupied length of contained_set_handles array
*errPointer to error type returned from function

Returns the gentity_set handles contained in a given model or gentity_set one level deep

Parameters:
gentity_set_handleEntity set being queried
contained_gentity_set_handlesNumber 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

Parameters:
instanceiGeom instance handle
entity_handleEntity being queried
uParametric position being queried
tgnt_iTangent at specified position
tgnt_jTangent at specified position
tgnt_kTangent at specified position
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handleEntity being queried
xStarting coordinates
yStarting coordinates
zStarting coordinates
tgnt_iTangent at closest point
tgnt_jTangent at closest point
tgnt_kTangent at closest point
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handleEntity handle being queried
tolerancePointer to tolerance returned from function
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handleentity handle being queried
*typePointer to location at which to store the returned type
*errPointer 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

Parameters:
instanceiGeom instance handle
entity_handleEntity being queried
u_minMinimum parametric coordinate for entity
u_maxMaximum parametric coordinate for entity
*errPointer 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

Parameters:
instanceiGeom instance handle
edge_handleEdge being queried
face_handleFace being queried
in_uParametric position on edge
uCorresponding parametric position on face
vCorresponding parametric position on face
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handleEntity being queried
uParametric coordinate being queried
xSpatial coordinate at parametric position being queried
ySpatial coordinate at parametric position being queried
zSpatial coordinate at parametric position being queried
*errPointer 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

Parameters:
instanceiGeom instance handle
entity_handleEntity being queried
u_minMinimum parametric coordinate for entity
v_minMinimum parametric coordinate for entity
u_maxMaximum parametric coordinate for entity
v_maxMaximum parametric coordinate for entity
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handleEntity being queried
uParametric coordinate being queried
vParametric coordinate being queried
xSpatial coordinate at parametric position being queried
ySpatial coordinate at parametric position being queried
zSpatial coordinate at parametric position being queried
*errPointer 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

Parameters:
instanceiGeom instance handle
entity_handleEntity being queried
xSpatial coordinate being queried
ySpatial coordinate being queried
zSpatial coordinate being queried
uParametric coordinate at spatial position being queried
*errPointer 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

Parameters:
instanceiGeom instance handle
entity_handleEntity being queried
xSpatial coordinate being queried
ySpatial coordinate being queried
zSpatial coordinate being queried
uParametric coordinate at spatial position being queried
vParametric coordinate at spatial position being queried
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handleEntity being queried
xSpatial coordinate being queried
ySpatial coordinate being queried
zSpatial coordinate being queried
uParametric coordinate at spatial position being queried
vParametric coordinate at spatial position being queried
*errPointer 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.

Parameters:
instanceiGeom instance handle
*error_typeError 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.

Parameters:
instanceiGeom instance handle
entity_handlesEntity array on which tag is being set
entity_handles_sizeNumber of entities in array
tag_handleTag being set on an entity
*tag_valuePointer to tag data array being returned from function
tag_value_allocatedPointer to allocated size of tag data array
tag_value_sizePointer to occupied size of tag data array
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handleEntity on which tag is being set
tag_handleTag being set on an entity
*out_dataPointer to tag value returned from function
*errPointer 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

Parameters:
instanceiGeom instance handle
entity_handleEntity being queried
dist_toleranceTolerance guidance for faceting engine
pointsList of vertices in faceting of curve or surface
points_allocatedAllocated size of vertex list array
points_sizeOccupied size of vertex list array
facetsList of facets in faceting of surface
facets_allocatedAllocated size of facet list array
facets_sizeOccupied size of facet list array
*errPointer 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.

Parameters:
instanceiGeom instance handle
face_handleFace being queried
face_typeFace type
face_type_lengthLength of face type string

Return the type of surface as a string; if not a surface, an error is returned

Parameters:
face_handleFace for which the type is requested
face_typeType 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.

Parameters:
instanceiGeom instance handle
face_handlesFace(s) being queried
face_handles_sizeNumber of entities being queried
storage_orderStorage order of uv coordinates
uvStarting parametric coordinates
uv_sizeNumber of values in uv array
cvtr_1First principal curvatures
cvtr_1_allocatedAllocated size of first curvature array
cvtr_1_sizeOccupied size of first curvature array
cvtr_2Second principal curvatures
cvtr_2_allocatedAllocated size of second curvature array
cvtr_2_sizeOccupied size of second curvature array
*errPointer 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.

Parameters:
instanceiGeom instance handle
face_handleFace being queried
uParametric position being queried
vParametric position being queried
cvtr1_iMaximum curvature vector
cvtr1_jMaximum curvature vector
cvtr1_kMaximum curvature vector
cvtr2_iMinimum curvature vector
cvtr2_jMinimum curvature vector
cvtr2_kMinimum curvature vector
*errPointer 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.

Parameters:
instanceiGeom instance handle
face_handleFace being queried
xPosition being queried
yPosition being queried
zPosition being queried
cvtr1_iMaximum curvature vector
cvtr1_jMaximum curvature vector
cvtr1_kMaximum curvature vector
cvtr2_iMinimum curvature vector
cvtr2_jMinimum curvature vector
cvtr2_kMinimum curvature vector
*errPointer 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.

Parameters:
instanceiGeom instance handle
face_handleFace being queried
xPoint at which entity is being queried
yPoint at which entity is being queried
zPoint at which entity is being queried
on_xClosest point at point being queried
on_yClosest point at point being queried
on_zClosest point at point being queried
nrml_iNormal at point being queried
nrml_jNormal at point being queried
nrml_kNormal at point being queried
cvtr1_iFirst principal curvature at point being queried
cvtr1_jFirst principal curvature at point being queried
cvtr1_kFirst principal curvature at point being queried
cvtr2_iSecond principal curvature at point being queried
cvtr2_jSecond principal curvature at point being queried
cvtr2_kSecond principal curvature at point being queried
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handlesEntity array on which tag is being set
entity_handles_sizeNumber of entities in array
tag_handleTag being set on an entity
*tag_valuesPointer to tag data array being returned from function
tag_values_allocatedPointer to allocated size of tag data array
tag_values_sizePointer to occupied size of tag data array
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handleEntity on which tag is being set
tag_handleTag being set on an entity
*out_dataPointer to tag value returned from function
*errPointer 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).

Parameters:
instanceiGeom instance handle
entArr_iteratorIterator being queried
*entity_handlesPointer to array of entity handles contained in current value of iterator
*entity_handles_allocatedPointer to allocated size of entity_handles array
*entity_handles_sizePointer to occupied size of entity_handles array
has_dataPointer 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.
*errPointer 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).

Parameters:
instanceiGeom instance handle
entity_iteratorIterator being queried
entity_handlePointer to an entity handle corresponding to the current value of iterator
has_dataPointer 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.
*errPointer to error type returned from function

Get the next entity for this iterator.

Parameters:
gentity_iteratorIterator being iterated over
gentity_handleNext gentity
Returns:
If true, there were more gentities, if false, the iterator was already at the end.

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.

Parameters:
instanceiGeom instance handle
entity_setEntity set being queried
num_hopsMaximum hops from entity_set_handle to child set, not inclusive of the child set
num_childPointer to number of children returned from function
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_set_handleEntity set being queried
num_hopsMaximum hops from entity_set_handle to contained set, not inclusive of the contained set
num_setsPointer to the number of sets returned from function
*errPointer to error type returned from function

Returns the number of gentity_sets contained in a given model or gentity_set one level deep

Parameters:
gentity_set_handleEntity set being queried
Returns:
Number of entity sets in gentity_set_handle

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.

Parameters:
instanceiGeom instance handle
entity_set_handleEntity set being queried
entity_typeType of entity requested
num_typePointer to number of entities, returned from function
*errPointer to error type returned from function

Return number of gentities of specified dimension in this set, or in whole model.

Parameters:
set_handleEntity set being queried (if 0, whole model)
gentity_dimensionDimension of entities being queried
Returns:
Number of entities

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.

Parameters:
instanceiGeom instance handle
entity_setEntity set being queried
num_hopsMaximum hops from entity_set_handle to parent set, not inclusive of the parent set
num_parentPointer to number of parents returned from function
*errPointer 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)

Parameters:
instanceiGeom instance handle
is_parametricIf non-zero, interface has information about parameterization
*errPointer 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.

Parameters:
instanceiGeom instance handle
storage_orderStorage order of coordinates in coords
coordsPoints being queried
coords_sizeNumber of entries in coords array
entity_handlesEntities on which points are located
entity_handles_allocatedAllocated size of entity_handles array
entity_handles_sizeOccupied size of entity_handles array
*errPointer 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.

Parameters:
instanceiGeom instance handle
storage_orderStorage order of input coordinates
coordsPoints from which rays are fired
coords_sizeNumber of points from which rays are fired
directionsDirections in which rays are fired
directions_sizeNumber of coordinates in directions array
intersect_entity_handlesEntities intersected by ray
intersect_entity_handles_allocatedAllocated size of intersections array
intersect_entity_hangles_sizeOccupied size of intersections array
offsetOffset[i] is offset into intersect_entity_handles of ith ray
offset_allocatedAllocated size of offset array
offset_sizeOccupied size of offset array
storage_orderStorage order of coordinates passed back
intersect_coordsCoordinates of intersections
intersect_coords_allocatedAllocated size of coordinates array
intersect_coords_sizeOccupied size of coordinates array
param_coordsDistances along ray of intersections
param_coords_allocatedAllocated size of param_coords array
param_coords_sizeOccupied size of param_coords array
*errPointer 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

Parameters:
instanceiGeom instance handle
xPoint being queried
yPoint being queried
zPoint being queried
entity_handleEntity on which point is located
*errPointer 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.

Parameters:
instanceiGeom instance handle
xPoint from which ray is fired
yPoint from which ray is fired
zPoint from which ray is fired
dir_xDirection in which ray is fired
dir_yDirection in which ray is fired
dir_zDirection in which ray is fired
intersect_entity_handlesEntities intersected by ray
intersect_entity_handles_allocatedAllocated size of intersections array
intersect_entity_hangles_sizeOccupied size of intersections array
storage_orderStorage order of coordinates passed back
intersect_coordsCoordinates of intersections
intersect_coords_allocatedAllocated size of coordinates array
intersect_coords_sizeOccupied size of coordinates array
param_coordsDistances along ray of intersections
param_coords_allocatedAllocated size of param_coords array
param_coords_sizeOccupied size of param_coords array
*errPointer 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.

Parameters:
instanceiGeom instance handle
from_entity_setEntity set being queried
num_hopsMaximum hops from entity_set_handle to parent set, not inclusive of the parent set
*entity_set_handlesPointer to array of parent sets returned from function
*entity_set_handles_allocatedPointer to allocated size of entity_set_handles array
*entity_set_handles_sizePointer to occupied size of entity_set_handles array
*errPointer 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.

Parameters:
instanceiGeom instance handle
root_setPointer to set handle returned from function
*errPointer 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

Parameters:
instanceiGeom instance handle
tag_nameName of tag being queried
tag_handlePointer to tag handle returned from function
*errPointer to error type returned from function
tag_name_lenLength 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

Parameters:
instanceiGeom instance handle
tag_handleTag handle being queried
namePointer to character string to store name returned from function
*errPointer to error type returned from function
name_lenLength 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

Parameters:
instanceiGeom instance handle
tag_handleHandle of tag being queried
tag_sizePointer to tag size returned from function
*errPointer 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

Parameters:
instanceiGeom instance handle
tag_handleHandle of tag being queried
tag_sizePointer to tag size returned from function
*errPointer 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.

Parameters:
instanceiGeom instance handle
tag_handleHandle for the tag being queried
tag_typePointer to tag type returned from function
*errPointer 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.

Parameters:
instanceiGeom instance handle
typeType of tolerance used by the modeler
toleranceModeler-level tolerance, if any
*errPointer 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.

Parameters:
relative_toleranceRelative tolerance for model as a whole
absolute_toleranceAbsolute 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.

Parameters:
instanceiGeom instance handle
topo_level_outThe topology level
*errPointer 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.

Parameters:
instanceiGeom instance handle
vertex_handlesArray of geom vertex handles whose coordinates are being requested
vertex_handles_sizeNumber of vertices in vertex_handles array
storage_orderStorage order requested for coordinate data
*coordsPointer to array of coordinates returned from function
*coords_allocatedPointer to allocated size of coords array
*coords_sizePointer to occupied size of coords array
*errPointer 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.

Parameters:
gentity_handlesThe gentities being queried
coordinatesThe 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

Parameters:
instanceiGeom instance handle
vertex_handlesVertices being queried
vertex_handles_sizeNumber of vertices being queried
edge_handlesEdges being queried
edge_handles_sizeNumber of edges being queried
uCorresponding parametric positions on faces
u_allocatedAllocated size of positions array
u_sizeOccupied size of positions array
*errPointer 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

Parameters:
instanceiGeom instance handle
vertex_handlesVertices being queried
vertex_handles_sizeNumber of vertices being queried
face_handlesFaces being queried
face_handles_sizeNumber of faces being queried
storage_orderStorage order of coordinates returned
uvCorresponding parametric positions on faces
uv_allocatedAllocated size of positions array
uv_sizeOccupied size of positions array
*errPointer 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.

Parameters:
instanceiGeom instance handle
vertex_handleGeom vertex being queried
*xPointer to x coordinate returned from function
*yPointer to y coordinate returned from function
*zPointer to z coordinate returned from function
*errPointer 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

Parameters:
instanceiGeom instance handle
vertex_handleVertex being queried
edge_handleEdge being queried
uCorresponding parametric position on face
*errPointer 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

Parameters:
instanceiGeom instance handle
vertex_handleVertex being queried
face_handleFace being queried
uCorresponding parametric position on face
vCorresponding parametric position on face
*errPointer 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.

Parameters:
instanceiGeom instance handle
geom_entitiesArray of entity handles being imprinted
geom_entities_sizeNumber of entities in geom_entities array
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_set_handleEntity set being iterated
requested_entity_typeType of entity to iterate
requested_array_sizeSize of chunks of handles returned for each value of the iterator
entArr_iteratorPointer to iterator returned from function
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_set_handleEntity set being iterated
requested_entity_typeType of entity to iterate
entity_iteratorPointer to iterator returned from function
*errPointer to error type returned from function

Initialize an iterator over gentities of a specified dimension.

Parameters:
gentity_dimensionDimension of gentities to be iterated over
gentity_iteratorIterator 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

Parameters:
instanceiGeom instance handle
entity_set_1Entity set being intersected with another
entity_set_2Entity set being intersected with another
result_entity_setPointer to entity set returned from function
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity1The entity to intersect
entity2The entity to intersect
geom_entityPointer to new entity handle returned from function
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handles_1First array of entities
entity_handles_1_sizeNumber of entities in first array
entity_handles_2Second array of entities
entity_handles_2_sizeNumber of entities in second array
is_adjacent_infoArray of flags returned from function
is_adjacent_info_allocatedAllocated size of flags array
is_adjacent_info_sizeOccupied size of flags array
*errPointer 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)

Parameters:
instanceiGeom instance handle
entity_handlesEntities being queried
entity_handles_sizeNumber of entities being queried
is_parametricentity_handles[i] has a parameterization (=1) or not (=0)
is_parametric_allocatedAllocated size of is_parametric array
is_parametric_sizeOccupied size of is_parametric array
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handlesEntities being queried
entity_handles_sizeNumber of entities being queried
in_uvArray of pairs of integers representing whether entity_handles[i] is periodic (=1) or not (=0) in u and v directions
in_uv_allocatedAllocated size of in_uv array
in_uv_sizeOccupied size of in_uv array
*errPointer 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

Parameters:
instanceiGeom instance handle
parent_entity_setPointer to parent set
child_entity_setPointer to child set
is_childPointer to flag returned from function
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_handle1First entity queried
entity_handle2Second entity queried
are_adjacentIf returned non-zero, entities are adjacent, otherwise they are not
*errPointer to error type returned from function

Return whether or not entities are adjacent.

Parameters:
gentity_handle11st entity
gentity_handle22nd entity
are_adjacentIf 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.

Parameters:
instanceiMesh instance handle
containing_entity_setEntity set being queried
entity_handlesList of entities for which to check containment.
is_containedOne value for each input entity, 1 if contained in set, zero otherwise.
*errPointer 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

Parameters:
instanceiGeom instance handle
containing_entity_setEntity set being queried
contained_entityEntity potentially contained in containing_entity_set
is_containedPointer to flag returned from function
*errPointer 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)

Parameters:
instanceiGeom instance handle
entity_handleEntity being queried
is_parametricEntity has a parameterization (=1) or not (=0)
*errPointer 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.

Parameters:
gentity_handleEntity 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.

Parameters:
instanceiGeom instance handle
entity_handleEntity being queried
in_uEntity is periodic in u direction (=1) or not (=0)
in_vEntity is periodic in v direction (=1) or not (=0)
*errPointer 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

Parameters:
instanceiGeom instance handle
containing_entity_setEntity set being queried
contained_entity_setEntity set potentially contained in containing_entity_set
is_containedPointer to flag returned from function
*errPointer 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).

Parameters:
instanceiGeom instance handle
face_handlesFaces being queried
face_handles_sizeNumber of faces being queried
degenerateface_handles[i] is degenerate (=1) or not (=0)
degenerate_allocatedAllocated size of degenerate array
degenerate_sizeOccupied size of degenerate array
*errPointer 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).

Parameters:
instanceiGeom instance handle
face_handleFace being queried
is_degenerateFace is degenerate (=1) or not (=0)
*errPointer 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)

Parameters:
instanceiGeom instance handle
entity_setEntity set being queried
is_listPointer to flag returned from function
*errPointer 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.

Parameters:
instanceiGeom instance handle
entity_set_handleSet to which loaded geom will be added, zero if not desired
nameFile name from which geom is to be loaded
optionsPointer to implementation-specific options string
*errPointer to error type returned from function
name_lenLength of the file name character string
options_lenLength 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.

Parameters:
nameName of the model
optionsString 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

Parameters:
instanceiGeom instance handle
entity_handlesArray of entities being queried
entity_handles_sizeNumber of entities in entity array
measuresMeasures of entities being queried
measures_allocatedAllocated size of measures array
measures_sizeOccupied size of measures array
*errPointer to error type returned from function

Return the arc length / area / volume of the entities

Parameters:
gentity_handlesEntities for which measure is requested
gentity_handles_sizeNumber of gentities
measuresArc length / area / volume of the entities
measures_lengthNumber 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.

Parameters:
instanceiGeom instance handle
geom_entitiesArray of entity handles being imprinted
geom_entities_sizeNumber of entities in geom_entities array
toleranceTolerance within which entities are considered the same
*errPointer 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.

Parameters:
instanceiGeom instance handle
geom_entitythe entity to move
xx coordinate of the vector
yy coordinate of the vector
zz coordinate of the vector
*errPointer 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

Parameters:
optionsPointer to implementation-specific options string
instancePointer to iGeom instance handle returned from function
*errPointer to error type returned from function
options_lenLength 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

Parameters:
instanceiGeom instance handle
geom_entitythe entity to reflect
plane_normal_xx coordinate of the plane's normal
plane_normal_yy coordinate of the plane's normal
plane_normal_zz coordinate of the plane's normal
*errPointer 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

Parameters:
instanceiGeom instance handle
entArr_iteratorIterator to reset
*errPointer 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

Parameters:
instanceiGeom instance handle
entity_iteratorIterator to reset
*errPointer to error type returned from function

Reset an iterator back to the first gentity

Parameters:
gentity_iteratorIterator 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

Parameters:
instanceiGeom instance handle
entity_handlesEntity from which tag is being removed
entity_handles_sizeNumber of entities in entity array
tag_handleTag handle of tag being removed
*errPointer 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

Parameters:
instanceiGeom instance handle
entity_handlesArray of entities being remove
entity_handles_sizeNumber of entities in entity_handles array
entity_setPointer to the set being removed from
*errPointer to error type returned from function

Remove existing gentities from the gentity_set (do not delete them)

Parameters:
gentity_setSet being removed from
gentity_handlesGentities 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

Parameters:
instanceiGeom instance handle
entity_handleThe entity being removed
entity_setPointer to the set being removed from
*errPointer 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.

Parameters:
gentity_setSet from which other sets are being removed
gentity_set_handlesSets 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

Parameters:
instanceiGeom instance handle
entity_set_to_removeThe entity set being removed
entity_set_handlePointer to the set being removed from
*errPointer 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.

Parameters:
gentity_setSet from which other sets are being removed
gentity_set_handlesSets 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);
}