MeshKit  1.0
FBiGeom.hpp
Go to the documentation of this file.
00001 #ifndef MESHKIT_ITAPS_FBIGEOM_HPP
00002 #define MESHKIT_ITAPS_FBIGEOM_HPP
00003 
00007 #include "FBiGeom.h"
00008 #include "iGeom.hpp"
00009 #include "iRel.hpp"
00010 
00027 class FBiGeom : public iGeom {
00028         protected:
00029                 FBiGeom_Instance mInstance;
00030         public:
00031         virtual inline iRel::IfaceType iface_type() const {
00032             return iRel::FBIGEOM_IFACE;
00033         }
00034 
00035                 typedef iBase_EntitySetHandle EntitySetHandle;
00036                 typedef iBase_EntityHandle EntityHandle;
00037                 typedef iBase_TagHandle TagHandle;
00038                 typedef iBase_ErrorType Error;
00039                 typedef iBase_EntityType EntityType;
00040                 typedef iBase_StorageOrder StorageOrder;
00041                 typedef iBase_TagValueType TagValueType;
00042 
00043                 inline FBiGeom(const char* options = 0);
00044                 inline FBiGeom(FBiGeom_Instance instance);
00045 
00046                 inline FBiGeom(bool meshBased);
00047 
00048                 virtual inline ~FBiGeom();
00049 
00050                 virtual inline Error load(const char* file_name, const char* options = 0);
00051 
00052                 virtual inline Error save(const char* file_name, const char* options = 0);
00053 
00054                 virtual inline Error getBoundBox(double& min_x, double& min_y, double& min_z,
00055                                 double& max_x, double& max_y, double& max_z) const;
00056 
00057                 virtual inline int getParametric();
00058 
00059                 virtual inline Error getNumOfType(EntitySetHandle set, EntityType type,
00060                                 int& count_out) const;
00061 
00062                 virtual inline Error getEntities(EntitySetHandle set, EntityType type,
00063                                 std::vector<EntityHandle>& entities_out) const;
00064 
00065                 virtual inline Error getEntType(EntityHandle handle, EntityType& type_out) const;
00066 
00067                 virtual inline Error getArrType(const EntityHandle* entity_handles,
00068                                 int entity_handles_Size, EntityType* types_out) const;
00069 
00070                 virtual inline Error getEntAdj(EntityHandle handle,
00071                                 EntityType type_requested, std::vector<EntityHandle>& adj_entities_out) const;
00072 
00073                 virtual inline Error getArrAdj(const EntityHandle* entity_handles,
00074                                 int entity_handles_size, EntityType type_requested, std::vector<
00075                                 EntityHandle>& adjacent_entity_handles_out, int* offsets_out) const;
00076 
00077                 virtual inline Error getEnt2ndAdj(EntityHandle handle,
00078                                 EntityType bridge_dimension, EntityType type_requested, std::vector<
00079                                 EntityHandle>& adj_entities_out) const;
00080 
00081                 virtual inline Error getArr2ndAdj(const EntityHandle* entity_handles,
00082                                 int entity_handles_size, EntityType order_adjacent_key,
00083                                 EntityType type_requested,
00084                                 std::vector<EntityHandle>& adjacent_entity_handles_out, int* offsets_out) const;
00085 
00086                 virtual inline Error isEntAdj(EntityHandle entity1, EntityHandle entity2,
00087                                 bool& adjacent_out) const;
00088 
00089                 virtual inline Error isArrAdj(const EntityHandle* entities1,
00090                                 const EntityHandle* entities2, int num_entity_pairs, int* is_adj_out) const;
00091 
00092                 virtual inline Error getEntClosestPt(EntityHandle entity, double near_x,
00093                                 double near_y, double near_z, double& on_x, double& on_y, double& on_z) const;
00094 
00095                 virtual inline Error getEntClosestPtTrimmed(EntityHandle entity, double near_x,
00096                                 double near_y, double near_z, double& on_x, double& on_y, double& on_z) const;
00097 
00098                 virtual inline Error getArrClosestPt(const EntityHandle* handles,
00099                                 int handles_size, StorageOrder order, const double* near_coordinates,
00100                                 int near_coordinates_size, double* on_coordinates) const;
00101 
00102                 virtual inline Error getEntNrmlXYZ(EntityHandle entity, double x, double y,
00103                                 double z, double& i, double& j, double& k) const;
00104 
00105                 virtual inline Error getArrNrmlXYZ(const EntityHandle* entities,
00106                                 int entities_size, StorageOrder order, const double* xyz, int xyz_size,
00107                                 double* ijk) const;
00108 
00109                 virtual inline Error getEntNrmlPlXYZ(EntityHandle entity, double x, double y,
00110                                 double z, double& on_x, double& on_y, double& on_z, double& i, double& j,
00111                                 double& k) const;
00112 
00113                 virtual inline Error getArrNrmlPlXYZ(const EntityHandle* entities,
00114                                 int entities_size, StorageOrder order, const double* near_xyz,
00115                                 int near_xyz_size, double* on_xyz, double* nrml_ijk) const;
00116 
00117                 virtual inline Error getEntTgntXYZ(EntityHandle entity, double x, double y,
00118                                 double z, double& i, double& j, double& k) const;
00119 
00120                 virtual inline Error getArrTgntXYZ(const EntityHandle* entities,
00121                                 int entities_size, StorageOrder order, const double* xyz, int xyz_size,
00122                                 double* ijk) const;
00123 
00124                 virtual inline Error getFcCvtrXYZ(EntityHandle face, double x, double y,
00125                                 double z, double& i1, double& j1, double& k1, double& i2, double& j2,
00126                                 double& k2) const;
00127 
00128                 virtual inline Error getEgCvtrXYZ(EntityHandle edge, double x, double y,
00129                                 double z, double& i, double& j, double& k) const;
00130 
00131                 virtual inline Error getEntArrCvtrXYZ(const EntityHandle* entities,
00132                                 int entities_size, StorageOrder order, const double* xyz, int xyz_size,
00133                                 double* cvtr_1, double* cvtr_2) const;
00134 
00135                 virtual inline Error getEgEvalXYZ(EntityHandle edge, double x, double y,
00136                                 double z, double& on_x, double& on_y, double& on_z, double& tngt_i,
00137                                 double& tngt_j, double& tngt_k, double& cvtr_i, double& cvtr_j,
00138                                 double& cvtr_k) const;
00139 
00140                 virtual inline Error getFcEvalXYZ(EntityHandle face, double x, double y,
00141                                 double z, double& on_x, double& on_y, double& on_z, double& nrml_i,
00142                                 double& nrml_j, double& nrml_k, double& cvtr1_i, double& cvtr1_j,
00143                                 double& cvtr1_k, double& cvtr2_i, double& cvtr2_j, double& cvtr2_k) const;
00144 
00145                 virtual inline Error getArrEgEvalXYZ(const EntityHandle* edges,
00146                                 int edges_size, StorageOrder order, const double* near_coords,
00147                                 int near_coords_size, double* on_coords, double* tangent,
00148                                 double* curvature) const;
00149 
00150                 virtual inline Error getArrFcEvalXYZ(const EntityHandle* faces,
00151                                 int faces_size, StorageOrder order, const double* near_coords,
00152                                 int near_coords_size, double* on_coords, double* normal,
00153                                 double* curvature1, double* curvature2) const;
00154 
00155                 virtual inline Error
00156                         getEntBoundBox(EntityHandle entity, double& min_x, double& min_y,
00157                                         double& min_z, double& max_x, double& max_y, double& max_z) const;
00158 
00159                 virtual inline Error getArrBoundBox(const EntityHandle* entities,
00160                                 int entities_size, StorageOrder order, double* min_corners,
00161                                 double* max_corners) const;
00162 
00163                 virtual inline Error getVtxCoord(EntityHandle vertex, double& x, double& y,
00164                                 double& z) const;
00165 
00166                 virtual inline Error getVtxArrCoords(const EntityHandle* vertices,
00167                                 int vertices_size, StorageOrder order, double* coords) const;
00168 
00169                 virtual inline Error getPntRayIntsct(double x, double y, double z, double i,
00170                                 double j, double k, StorageOrder order,
00171                                 std::vector<EntityHandle>& entities_out, std::vector<double>& points_out,
00172                                 std::vector<double>& params_out) const;
00173 
00174                 virtual inline Error getPntClsf(double x, double y, double z,
00175                                 EntityHandle& handle_out)const;
00176 
00177                 virtual inline Error getPntArrClsf(StorageOrder order, const double* coords,
00178                                 int coords_size, EntityHandle* entities_out) const;
00179 
00180                 virtual inline Error getEntNrmlSense(EntityHandle face, EntityHandle region,
00181                                 int& sense) const;
00182 
00183                 virtual inline Error getEgFcSense(EntityHandle edge, EntityHandle face,
00184                                 int& sense) const;
00185 
00186                 virtual inline Error getEgVtxSense(EntityHandle edge, EntityHandle vtx1,
00187                                 EntityHandle vtx2, int& sense) const;
00188 
00189                 virtual inline Error getArrNrmlSense(const EntityHandle* faces,
00190                                 int faces_size, const EntityHandle* vols, int vols_size, int* senses_out)const;
00191 
00192                 virtual inline Error getEgFcArrSense(const EntityHandle* edges,
00193                                 int edges_size, const EntityHandle* faces, int faces_size,
00194                                 int* senses_out) const;
00195 
00196                 virtual inline Error getEgVtxArrSense(const EntityHandle* edges,
00197                                 int edges_size, const EntityHandle* vertices1, int vertices1_size,
00198                                 const EntityHandle* vertices2, int vertices2_size, int* senses_out) const;
00199 
00200                 virtual inline Error getSense(EntityHandle ent, EntityHandle wrt_ent,
00201                                 int &sense) const;
00202 
00203                 virtual inline Error getArrSense(const EntityHandle *ent, int num_ents,
00204                                 EntityHandle wrt_ent, int *sense) const;
00205 
00206                 virtual inline Error measure(const EntityHandle* entities, int entities_size,
00207                                 double* measures) const;
00208 
00209                 virtual inline Error getFaceType(EntityHandle face, std::string& type) const;
00210 
00211                 virtual inline Error isEntParametric(EntityHandle entity, bool& parametric) const;
00212 
00213                 virtual inline Error isArrParametric(const EntityHandle* entities,
00214                                 int entities_size, int* is_parametric) const;
00215 
00216                 virtual inline Error getEntUVtoXYZ(EntityHandle face, double u, double v,
00217                                 double& x, double& y, double& z) const;
00218 
00219                 virtual inline Error getEntUtoXYZ(EntityHandle edge, double u, double& x,
00220                                 double& y, double& z) const;
00221 
00222                 virtual inline Error getArrUVtoXYZ(const EntityHandle* faces, int faces_size,
00223                                 StorageOrder order, const double* uv, int uv_size, double* xyz) const;
00224 
00225                 virtual inline Error getArrUtoXYZ(const EntityHandle* edges, int edges_size,
00226                                 const double* u, int u_size, StorageOrder order, double* xyz) const;
00227 
00228                 virtual inline Error getEntXYZtoUV(EntityHandle face, double x, double y,
00229                                 double z, double& u, double& v) const;
00230 
00231                 virtual inline Error getEntXYZtoU(EntityHandle edge, double x, double y,
00232                                 double z, double& u) const;
00233 
00234                 virtual inline Error getArrXYZtoUV(const EntityHandle* faces, int faces_size,
00235                                 StorageOrder order, const double* coords, int coords_size, double* uv) const;
00236 
00237                 virtual inline Error getArrXYZtoU(const EntityHandle* edges, int edges_size,
00238                                 StorageOrder order, const double* coords, int coords_size, double* u) const;
00239 
00240                 virtual inline Error getEntXYZtoUVHint(EntityHandle face, double x, double y,
00241                                 double z, double& u, double& v) const;
00242 
00243                 virtual inline Error getArrXYZtoUVHint(const EntityHandle* faces,
00244                                 int faces_size, StorageOrder order, const double* coords,
00245                                 int coords_size, double* uv) const;
00246 
00247                 virtual inline Error getEntNrmlUV(EntityHandle face, double u, double v,
00248                                 double& i, double& j, double& k) const;
00249 
00250                 virtual inline Error getArrNrmlUV(const EntityHandle* faces, int faces_size,
00251                                 StorageOrder order, const double* uv, int uv_size, double* normals) const;
00252 
00253                 virtual inline Error getEntTgntU(EntityHandle edge, double u, double& i,
00254                                 double& j, double& k) const;
00255 
00256                 virtual inline Error getArrTgntU(const EntityHandle* edges, int edges_size,
00257                                 StorageOrder order, const double* u, int u_size, double* normals) const;
00258 
00259                 virtual inline Error getEnt1stDrvt(EntityHandle handle, double u, double v,
00260                                 double& du_i, double& du_j, double& du_k, double& dv_i, double& dv_j,
00261                                 double& dv_k) const;
00262                 virtual inline Error
00263                         getEnt2ndDrvt(EntityHandle handle, double u, double v, double& duu_i,
00264                                         double& duu_j, double& duu_k, double& dvv_i, double& dvv_j,
00265                                         double& dvv_k, double& duv_i, double& duv_j, double& duv_k) const;
00266 
00267                 virtual inline Error getArr1stDrvt(const EntityHandle* entities,
00268                                 int entities_size, StorageOrder order, const double* uv, int uv_size,
00269                                 double* dvtr_u, double* dvtr_v) const;
00270 
00271                 virtual inline Error getArr2ndDrvt(const EntityHandle* entities,
00272                                 int entities_size, StorageOrder order, const double* uv, int uv_size,
00273                                 double* dvtr_uu, double* dvtr_vv, double* dvtr_uv) const;
00274 
00275                 virtual inline Error getFcCvtrUV(EntityHandle face, double u, double v,
00276                                 double& i1, double& j1, double& k1, double& i2, double& j2, double& k2) const;
00277 
00278                 virtual inline Error getFcArrCvtrUV(const EntityHandle* faces,
00279                                 int faces_size, StorageOrder order, const double* uv, int uv_size,
00280                                 double* cvtr1, double* cvtr2) const;
00281 
00282                 virtual inline Error isEntPeriodic(EntityHandle entity, bool& in_u,
00283                                 bool& in_v) const;
00284 
00285                 virtual inline Error isArrPeriodic(const EntityHandle* entities,
00286                                 int entities_size, int* in_uv) const;
00287 
00288                 virtual inline Error isFcDegenerate(EntityHandle face, bool& is_degenerate) const;
00289 
00290                 virtual inline Error isFcArrDegenerate(const EntityHandle* faces,
00291                                 int faces_size, int* degenerate) const;
00292 
00293                 virtual inline Error getTolerance(int& type_out, double& tolerance_out) const;
00294                 virtual inline Error getEntTolerance(EntityHandle entity, double& tolerance) const;
00295                 virtual inline Error getArrTolerance(const EntityHandle* entities,
00296                                 int entities_size, double* tolerances) const;
00297 
00298                 virtual inline Error getEntUVRange(EntityHandle face, double& u_min,
00299                                 double& v_min, double& u_max, double& v_max) const;
00300                 virtual inline Error getEntURange(EntityHandle edge, double& u_min,
00301                                 double& u_max) const;
00302                 virtual inline Error getArrUVRange(const EntityHandle* faces, int faces_size,
00303                                 StorageOrder order, double* uv_min, double* uv_max) const;
00304                 virtual inline Error getArrURange(const EntityHandle* edges, int edges_size,
00305                                 double* u_min, double* u_max) const;
00306 
00307                 virtual inline Error getEntUtoUV(EntityHandle edge, EntityHandle face,
00308                                 double edge_u, double& face_u, double& face_v) const;
00309                 virtual inline Error getVtxToUV(EntityHandle vertex, EntityHandle face,
00310                                 double& u, double& v) const;
00311                 virtual inline Error getVtxToU(EntityHandle vertex, EntityHandle edge,
00312                                 double& u) const;
00313                 virtual inline Error getArrUtoUV(const EntityHandle* edges, int edges_size,
00314                                 const EntityHandle* faces, int faces_size, const double* edge_u,
00315                                 int edge_u_size, StorageOrder order, double* face_uv) const;
00316                 virtual inline Error getVtxArrToUV(const EntityHandle* vertices,
00317                                 int vertices_size, const EntityHandle* faces, int faces_size,
00318                                 StorageOrder order, double* face_uv) const;
00319                 virtual inline Error getVtxArrToU(const EntityHandle* vertices,
00320                                 int vertices_size, const EntityHandle* edges, int edges_size,
00321                                 double* edge_u) const;
00322 
00323                 virtual inline Error deleteAll();
00324 
00325                 virtual inline Error deleteEnt(EntityHandle entity);
00326 
00327                 virtual inline Error copyEnt(EntityHandle source, EntityHandle& copy);
00328 
00329                 virtual inline Error createSphere(double radius, EntityHandle& sphere);
00330                 virtual inline Error createPrism(double height, int num_sides,
00331                                 double maj_radius, double min_radius, EntityHandle& prism);
00332                 virtual inline Error createBrick(double x, double y, double z,
00333                                 EntityHandle& brick);
00334                 virtual inline Error createCylinder(double height, double maj_rad,
00335                                 double min_rad, EntityHandle& cylinder);
00336                 virtual inline Error createTorus(double maj_rad, double min_rad,
00337                                 EntityHandle& torus);
00338 
00339                 virtual inline Error moveEnt(EntityHandle entity, double x, double y,
00340                                 double z);
00341                 virtual inline Error rotateEnt(EntityHandle entity, double angle,
00342                                 double axis_x, double axis_y, double axis_z);
00343                 virtual inline Error reflectEnt(EntityHandle entity, double x,
00344                                                 double y, double z, double norm_x,
00345                                                 double norm_y, double norm_z);
00346                 virtual inline Error scaleEnt(EntityHandle entity, double x,
00347                                               double y, double z, double x_factor,
00348                                               double y_factor, double z_factor);
00349 
00350                 virtual inline Error uniteEnts(const EntityHandle* entities,
00351                                 int entities_size, EntityHandle& result_entity);
00352                 virtual inline Error subtractEnts(EntityHandle blank, EntityHandle tool,
00353                                 EntityHandle& result);
00354                 virtual inline Error intersectEnts(EntityHandle entity1,
00355                                 EntityHandle entity2, EntityHandle& result);
00356 
00357                 virtual inline Error sectionEnt(EntityHandle entity, double plane_x,
00358                                 double plane_y, double plane_z, double offset, bool reverse,
00359                                 EntityHandle& result);
00360 
00361                 virtual inline Error sweepEntAboutAxis(EntityHandle entity, double angle,
00362                                 double axis_x, double axis_y, double axis_z, EntityHandle& swept_entity);
00363 
00364                 virtual inline Error imprintEnts(const EntityHandle* entities,
00365                                 int entities_size);
00366                 virtual inline Error mergeEnts(const EntityHandle* entities,
00367                                 int entities_size, double tolerance);
00368 
00369                 // copied from iBaseVirtual.hpp
00370                 FBiGeom_Instance instance() {
00371                         return mInstance;
00372                 }
00373 
00374                 virtual inline std::string getDescription() const;
00375 
00376                 virtual inline Error getErrorType() const;
00377 
00378                 virtual inline EntitySetHandle getRootSet() const;
00379 
00380                 virtual inline Error createEntSet(bool is_list, EntitySetHandle& handle_out);
00381                 virtual inline Error destroyEntSet(EntitySetHandle handle);
00382                 virtual inline Error isList(EntitySetHandle handle, bool& is_list);
00383 
00384                 virtual inline Error getNumEntSets(EntitySetHandle set, int num_hops,
00385                                 int& num_sets_out) const;
00386                 virtual inline Error getEntSets(EntitySetHandle set, int num_hops, std::vector<
00387                                 EntitySetHandle>& contained_sets_out) const;
00388 
00389                 virtual inline Error addEntToSet(EntityHandle entity, EntitySetHandle set);
00390                 virtual inline Error rmvEntFromSet(EntityHandle entity, EntitySetHandle set);
00391 
00392                 virtual inline Error addEntArrToSet(const EntityHandle* entity_handles,
00393                                 int entity_handles_size, EntitySetHandle entity_set);
00394                 virtual inline Error rmvEntArrFromSet(const EntityHandle* entity_handles,
00395                                 int entity_handles_size, EntitySetHandle entity_set);
00396 
00397                 virtual inline Error addEntSet(EntitySetHandle to_add, EntitySetHandle add_to);
00398                 virtual inline Error rmvEntSet(EntitySetHandle to_rmv, EntitySetHandle rmv_from);
00399 
00400                 virtual inline Error isEntContained(EntitySetHandle set, EntityHandle ent,
00401                                 bool& contained_out) const;
00402                 virtual inline Error isEntArrContained(EntitySetHandle containing_set,
00403                                 const EntityHandle* entity_handles, int num_entity_handles,
00404                                 bool* is_contained_out) const;
00405                 virtual inline Error isEntSetContained(EntitySetHandle containing_set,
00406                                 EntitySetHandle contained_set, bool& contained_out) const;
00407 
00408                 virtual inline Error addPrntChld(EntitySetHandle parent, EntitySetHandle child);
00409                 virtual inline Error rmvPrntChld(EntitySetHandle parent, EntitySetHandle child);
00410                 virtual inline Error isChildOf(EntitySetHandle parent, EntitySetHandle child,
00411                                 bool& is_child_out) const;
00412                 virtual inline Error getNumChld(EntitySetHandle parent, int num_hops,
00413                                 int& num_child_out) const;
00414                 virtual inline Error getNumPrnt(EntitySetHandle child, int num_hops,
00415                                 int& num_parent_out) const;
00416                 virtual inline Error getChldn(EntitySetHandle parent, int num_hops, std::vector<
00417                                 EntitySetHandle>& children_out) const;
00418                 virtual inline Error getPrnts(EntitySetHandle child, int num_hops, std::vector<
00419                                 EntitySetHandle>& parents_out) const;
00420 
00421                 virtual inline Error subtract(EntitySetHandle set1, EntitySetHandle set2,
00422                                 EntitySetHandle& result_set_out);
00423                 virtual inline Error intersect(EntitySetHandle set1, EntitySetHandle set2,
00424                                 EntitySetHandle& result_set_out);
00425                 virtual inline Error unite(EntitySetHandle set1, EntitySetHandle set2,
00426                                 EntitySetHandle& result_set_out);
00427 
00428                 virtual inline Error createTag(const char* tag_name, int tag_num_type_values,
00429                                 TagValueType tag_type, TagHandle& tag_handle_out);
00430 
00431                 virtual inline Error destroyTag(TagHandle tag_handle, bool forced);
00432                 virtual inline Error getTagName(TagHandle tag_handle, std::string& name_out) const;
00433                 virtual inline Error getTagSizeValues(TagHandle tag_handle, int& size_out) const;
00434                 virtual inline Error getTagSizeBytes(TagHandle tag_handle, int& size_out) const;
00435                 virtual inline Error getTagHandle(const char* name, TagHandle& handle_out) const;
00436                 virtual inline Error getTagType(TagHandle tag_handle, TagValueType& type_out) const;
00437 
00438                 virtual inline Error setEntSetData(EntitySetHandle set_handle, TagHandle tag_handle,
00439                                 const void* tag_value);
00440                 virtual inline Error setEntSetIntData(EntitySetHandle set_handle,
00441                                 TagHandle tag_handle, int value);
00442                 virtual inline Error setEntSetDblData(EntitySetHandle set_handle,
00443                                 TagHandle tag_handle, double value);
00444                 virtual inline Error setEntSetEHData(EntitySetHandle set_handle,
00445                                 TagHandle tag_handle, EntityHandle value);
00446                 virtual inline Error setEntSetESHData(EntitySetHandle set_handle,
00447                                 TagHandle tag_handle, EntitySetHandle value);
00448 
00449                 virtual inline Error getEntSetData(EntitySetHandle set_handle, TagHandle tag_handle,
00450                                 void* tag_value_out) const;
00451                 virtual inline Error getEntSetIntData(EntitySetHandle set_handle,
00452                                 TagHandle tag_handle, int& value_out) const;
00453                 virtual inline Error getEntSetDblData(EntitySetHandle set_handle,
00454                                 TagHandle tag_handle, double& value_out) const;
00455                 virtual inline Error getEntSetEHData(EntitySetHandle set_handle,
00456                                 TagHandle tag_handle, EntityHandle& value_out) const;
00457                 virtual inline Error getEntSetESHData(EntitySetHandle set_handle,
00458                                 TagHandle tag_handle, EntitySetHandle& value_out) const;
00459 
00460                 virtual inline Error getAllEntSetTags(EntitySetHandle set,
00461                                 std::vector<TagHandle>& tags_out) const;
00462                 virtual inline Error getAllTags(EntityHandle entity,
00463                                 std::vector<TagHandle>& tags_out) const;
00464 
00465                 virtual inline Error rmvEntSetTag(EntitySetHandle set, TagHandle tag);
00466                 virtual inline Error rmvTag(EntityHandle entity, TagHandle tag);
00467                 virtual inline Error rmvArrTag(const EntityHandle* handles, int size, TagHandle tag);
00468 
00469                 virtual inline Error getArrData(const EntityHandle* entity_handles,
00470                                 int entity_handles_size, TagHandle tag_handle, void* tag_values_out) const;
00471                 virtual inline Error getIntArrData(const EntityHandle* entity_handles,
00472                                 int entity_handles_size, TagHandle tag_handle, int* tag_values_out) const;
00473                 virtual inline Error getDblArrData(const EntityHandle* entity_handles,
00474                                 int entity_handles_size, TagHandle tag_handle, double* tag_values_out) const;
00475                 virtual inline Error getEHArrData(const EntityHandle* entity_handles,
00476                                 int entity_handles_size, TagHandle tag_handle,
00477                                 EntityHandle* tag_values_out) const;
00478                 virtual inline Error getESHArrData(const EntityHandle* entity_handles,
00479                                 int entity_handles_size, TagHandle tag_handle,
00480                                 EntitySetHandle* tag_values_out) const;
00481 
00482                 virtual inline Error setArrData(const EntityHandle* entity_handles,
00483                                 int entity_handles_size, TagHandle tag_handle, const void* tag_values);
00484                 virtual inline Error setIntArrData(const EntityHandle* entity_handles,
00485                                 int entity_handles_size, TagHandle tag_handle, const int* tag_values);
00486                 virtual inline Error setDblArrData(const EntityHandle* entity_handles,
00487                                 int entity_handles_size, TagHandle tag_handle, const double* tag_values);
00488                 virtual inline Error setEHArrData(const EntityHandle* entity_handles,
00489                                 int entity_handles_size, TagHandle tag_handle,
00490                                 const EntityHandle* tag_values);
00491                 virtual inline Error setESHArrData(const EntityHandle* entity_handles,
00492                                 int entity_handles_size, TagHandle tag_handle,
00493                                 const EntitySetHandle* tag_values);
00494 
00495                 virtual inline Error setData(EntityHandle entity_handle, TagHandle tag_handle,
00496                                 const void* tag_value);
00497                 virtual inline Error setIntData(EntityHandle entity_handle, TagHandle tag_handle,
00498                                 int value);
00499                 virtual inline Error setDblData(EntityHandle entity_handle, TagHandle tag_handle,
00500                                 double value);
00501                 virtual inline Error setEHData(EntityHandle entity_handle, TagHandle tag_handle,
00502                                 EntityHandle value);
00503                 virtual inline Error setESHData(EntityHandle entity_handle, TagHandle tag_handle,
00504                                 EntitySetHandle value);
00505 
00506                 virtual inline Error getData(EntityHandle entity_handle, TagHandle tag_handle,
00507                                 void* tag_value_out) const;
00508                 virtual inline Error getFacets(EntityHandle entity_handle, double dist_tolerance,
00509         std::vector<double> &point, std::vector<int> &facets) const;
00510                 virtual inline Error getIntData(EntityHandle entity_handle, TagHandle tag_handle,
00511                                 int& value_out) const;
00512                 virtual inline Error getDblData(EntityHandle entity_handle, TagHandle tag_handle,
00513                                 double& value_out) const;
00514                 virtual inline Error getEHData(EntityHandle entity_handle, TagHandle tag_handle,
00515                                 EntityHandle& value_out) const;
00516                 virtual inline Error getESHData(EntityHandle entity_handle, TagHandle tag_handle,
00517                                 EntitySetHandle& value_out) const;
00518 
00519                 virtual bool isFBiGeom() {return true;}
00520                 // end copy from iBaseVirtual.hpp
00524                 class FBEntArrIter {
00525                         private:
00526                                 friend class FBiGeom;
00527                                 iBase_EntityArrIterator mHandle;
00528                                 FBiGeom_Instance mInstance;
00529                                 int mSize;
00530                         public:
00531                                 FBEntArrIter() :
00532                                         mHandle(0), mInstance(0), mSize(0) {
00533                                         }
00534                                 inline ~FBEntArrIter();
00535                                 inline Error getNext(EntityHandle* entity_handles_out, int& size_out,
00536                                                 bool& has_more_data_out);
00537                                 inline Error reset();
00538                 };
00539 
00543                 class FBEntIter {
00544                         private:
00545                                 friend class FBiGeom;
00546                                 iBase_EntityIterator mHandle;
00547                                 FBiGeom_Instance mInstance;
00548                         public:
00549                                 FBEntIter() :
00550                                         mHandle(0), mInstance(0) {
00551                                         }
00552                                 inline ~FBEntIter();
00553                                 inline Error getNext(EntityHandle& entity_handle_out,
00554                                                 bool& has_more_data_out);
00555                                 inline Error reset();
00556                 };
00557 
00558                 virtual inline Error initFBEntIter(EntitySetHandle set,
00559                                 EntityType requested_type, FBEntIter& iter);
00560                 virtual inline Error initFBEntArrIter(EntitySetHandle set,
00561                                 EntityType requested_type, int requested_array_size, FBEntArrIter& iter);
00562         private:
00563                 bool FBiGeomInstanceOwner;
00564 
00565                 // prohibit copying
00566                 FBiGeom(const FBiGeom&) {
00567                 }
00568                 void operator=(const FBiGeom&) {
00569                 }
00570 };
00571 
00572 inline FBiGeom::FBiGeom(const char* options) :
00573         FBiGeomInstanceOwner(true)
00574 {
00575         int err, len = options ? strlen(options) : 0;
00576         FBiGeom_newGeom(options, &mInstance, &err, len);
00577         if (iBase_SUCCESS != err) {
00578                 mInstance = 0;
00579                 FBiGeomInstanceOwner = false;
00580         }
00581 }
00582 
00583 inline FBiGeom::FBiGeom(FBiGeom_Instance instance) :
00584         FBiGeomInstanceOwner(false)
00585 {
00586         mInstance = instance;
00587 }
00588 inline FBiGeom::FBiGeom(bool meshBased)
00589 {
00590         mInstance = 0;
00591         FBiGeomInstanceOwner = false;
00592 }
00593 inline FBiGeom::~FBiGeom()
00594 {
00595         if (FBiGeomInstanceOwner) {
00596                 int err;
00597                 FBiGeom_dtor(mInstance, &err);
00598         }
00599 }
00600 
00601 inline FBiGeom::Error FBiGeom::load(const char* file_name, const char* options)
00602 {
00603         int err, len = options ? strlen(options) : 0;
00604         FBiGeom_load(mInstance, file_name, options, &err, strlen(file_name), len);
00605         return (Error) err;
00606 }
00607 
00608 inline FBiGeom::Error FBiGeom::save(const char* file_name, const char* options)
00609 {
00610         int err, len = options ? strlen(options) : 0;
00611         FBiGeom_save(mInstance, file_name, options, &err, strlen(file_name), len);
00612         return (Error) err;
00613 }
00614 
00615 //inline FBiGeom::StorageOrder
00616 //FBiGeom::getDfltStorage()
00617 //{
00618 //  int err, order;
00619 //  FBiGeom_getDfltStorage( mInstance, &order, &err );
00620 //  return (iBase_SUCCESS == err) ? (StorageOrder)order : iBase_UNDETERMINED;
00621 //}
00622 
00623 inline FBiGeom::Error FBiGeom::getNumOfType(EntitySetHandle set, EntityType type,
00624                 int& count_out) const
00625 {
00626         int err;
00627         FBiGeom_getNumOfType(mInstance, set, type, &count_out, &err);
00628         return (Error) err;
00629 }
00630 
00631 inline FBiGeom::Error FBiGeom::getEntities(EntitySetHandle set, EntityType type,
00632                 std::vector<EntityHandle>& entities_out) const
00633 {
00634         // if input vect has no allocated space, allocate some so
00635         // we don't accidentally ask the impl to allocate an array
00636         if (entities_out.capacity() == 0) {
00637                 int count;
00638                 Error err2 = getNumOfType(set, iBase_ALL_TYPES, count);
00639                 if (err2 != iBase_SUCCESS)
00640                         return err2;
00641                 entities_out.resize(count);
00642         }
00643 
00644         // try getting results using whatever space input vector has allocated
00645         int err, size = 0, alloc = entities_out.capacity();
00646         entities_out.resize(entities_out.capacity());
00647         EntityHandle* ptr = &entities_out[0];
00648         FBiGeom_getEntities(mInstance, set, type, &ptr, &alloc, &size, &err);
00649         entities_out.resize(size);
00650 
00651         // if input vector was too small, try again with increased size
00652         if (iBase_BAD_ARRAY_DIMENSION == err || iBase_BAD_ARRAY_SIZE == err) {
00653                 alloc = entities_out.size();
00654                 ptr = &entities_out[0];
00655                 FBiGeom_getEntities(mInstance, set, type, &ptr, &alloc, &size, &err);
00656         }
00657 
00658         return (Error) err;
00659 }
00660 
00661 inline FBiGeom::Error FBiGeom::deleteEnt(EntityHandle handle)
00662 {
00663         int err;
00664         FBiGeom_deleteEnt(mInstance, handle, &err);
00665         return (Error) err;
00666 }
00667 
00668 //inline FBiGeom::Error
00669 //FBiGeom::deleteEntArr( const EntityHandle* entity_handles, int num_handles )
00670 //{
00671 //  int err;
00672 //  FBiGeom_deleteEntArr( mInstance, entity_handles, num_handles, &err );
00673 //  return (Error)err;
00674 //}
00675 
00676 //inline FBiGeom::Error
00677 //FBiGeom::getAdjEntities( EntitySetHandle set,
00678 //                       EntityType type_requestor,
00679 //                       EntityType type_requested,
00680 //                       std::vector<EntityHandle>& adj_entity_handles,
00681 //                       std::vector<int>& offset )
00682 //{
00683 //  std::vector<EntityHandle> entities;
00684 //  Error err = getEntities( set, type_requestor, entities );
00685 //  if (iBase_SUCCESS != err)
00686 //    return err;
00687 //
00688 //  offset.resize( entities.size() + 1 );
00689 //  return getArrAdj( &entities[0], entities.size(), type_requested,
00690 //                    adj_entity_handles, &offset[0] );
00691 //}
00692 
00693 inline FBiGeom::Error FBiGeom::initFBEntIter(EntitySetHandle set,
00694                 EntityType requested_type, FBiGeom::FBEntIter& iter)
00695 {
00696         int err;
00697         iter.mInstance = mInstance;
00698         FBiGeom_initEntIter(mInstance, set, requested_type, &iter.mHandle, &err);
00699         return (Error) err;
00700 }
00701 
00702 inline FBiGeom::Error FBiGeom::initFBEntArrIter(EntitySetHandle set,
00703                 EntityType requested_type, int requested_array_size,
00704                 FBiGeom::FBEntArrIter& iter)
00705 {
00706         int err;
00707         iter.mInstance = mInstance;
00708         iter.mSize = requested_array_size;
00709         FBiGeom_initEntArrIter(mInstance, set, requested_type, requested_array_size,
00710                         &iter.mHandle, &err);
00711         return (Error) err;
00712 }
00713 
00714 inline FBiGeom::FBEntArrIter::~FBEntArrIter()
00715 {
00716         int err;
00717         if (mHandle != 0) {
00718                 FBiGeom_endEntArrIter(mInstance, mHandle, &err);
00719                 mHandle = 0;
00720         }
00721 }
00722 
00723 inline FBiGeom::FBEntIter::~FBEntIter()
00724 {
00725         int err;
00726         if (mHandle != 0) {
00727                 FBiGeom_endEntIter(mInstance, mHandle, &err);
00728                 mHandle = 0;
00729         }
00730 }
00731 
00732 inline FBiGeom::Error FBiGeom::FBEntArrIter::getNext(EntityHandle* entity_handles,
00733                 int& size_out, bool& has_more_data_out)
00734 {
00735         int err, alloc = mSize, has_data;
00736         FBiGeom_getNextEntArrIter(mInstance, mHandle, &entity_handles, &alloc,
00737                         &size_out, &has_data, &err);
00738         has_more_data_out = (has_data != 0);
00739         return (Error) err;
00740 }
00741 
00742 inline FBiGeom::Error FBiGeom::FBEntIter::getNext(EntityHandle& handle_out,
00743                 bool& has_more_data_out)
00744 {
00745         int err, has_data;
00746         FBiGeom_getNextEntIter(mInstance, mHandle, &handle_out, &has_data, &err);
00747         has_more_data_out = (has_data != 0);
00748         return (Error) err;
00749 }
00750 
00751 inline FBiGeom::Error FBiGeom::FBEntArrIter::reset()
00752 {
00753         int err;
00754         FBiGeom_resetEntArrIter(mInstance, mHandle, &err);
00755         return (Error) err;
00756 }
00757 
00758 inline FBiGeom::Error FBiGeom::FBEntIter::reset()
00759 {
00760         int err;
00761         FBiGeom_resetEntIter(mInstance, mHandle, &err);
00762         return (Error) err;
00763 }
00764 
00765 inline FBiGeom::Error FBiGeom::getEntType(EntityHandle handle, EntityType& type_out) const
00766 {
00767         int err, result;
00768         FBiGeom_getEntType(mInstance, handle, &result, &err);
00769         type_out = (EntityType) result;
00770         return (Error) err;
00771 }
00772 
00773 inline FBiGeom::Error FBiGeom::getArrType(const EntityHandle* entity_handles,
00774                 int entity_handles_size, EntityType* types_out) const
00775 {
00776         int err, alloc = entity_handles_size, junk, *ptr;
00777         std::vector<int> storage;
00778         if (sizeof(EntityType) == sizeof(int))
00779                 ptr = reinterpret_cast<int*> (types_out);
00780         else {
00781                 storage.resize(entity_handles_size);
00782                 ptr = &storage[0];
00783         }
00784 
00785         FBiGeom_getArrType(mInstance, entity_handles, entity_handles_size, &ptr,
00786                         &alloc, &junk, &err);
00787 
00788         if (sizeof(EntityType) != sizeof(int))
00789                 for (int i = 0; i < entity_handles_size; ++i)
00790                         types_out[i] = (EntityType) storage[i];
00791 
00792         return (Error) err;
00793 }
00794 
00795 inline FBiGeom::Error FBiGeom::getEntAdj(EntityHandle handle,
00796                 EntityType type_requested, std::vector<EntityHandle>& adj_entities_out) const
00797 {
00798         if (adj_entities_out.capacity() == 0)
00799                 adj_entities_out.resize(12);
00800         else
00801                 adj_entities_out.resize(adj_entities_out.capacity());
00802 
00803         int err, alloc = adj_entities_out.size(), size = 0;
00804         EntityHandle* ptr = &adj_entities_out[0];
00805         FBiGeom_getEntAdj(mInstance, handle, type_requested, &ptr, &alloc, &size, &err);
00806         adj_entities_out.resize(size);
00807 
00808         if (iBase_BAD_ARRAY_DIMENSION == err || iBase_BAD_ARRAY_SIZE == err) {
00809                 alloc = adj_entities_out.size();
00810                 ptr = &adj_entities_out[0];
00811                 FBiGeom_getEntAdj(mInstance, handle, type_requested, &ptr, &alloc, &size,
00812                                 &err);
00813         }
00814 
00815         return (Error) err;
00816 }
00817 
00818 inline FBiGeom::Error FBiGeom::getArrAdj(const EntityHandle* entity_handles,
00819                 int entity_handles_size, EntityType type_requested, std::vector<
00820                 EntityHandle>& adj_entities_out, int* offsets_out) const
00821 {
00822         if (adj_entities_out.capacity() == 0)
00823                 adj_entities_out.resize(12 * entity_handles_size);
00824         else
00825                 adj_entities_out.resize(adj_entities_out.capacity());
00826 
00827         int err, alloc = adj_entities_out.size(), size = 0;
00828         int off_alloc = entity_handles_size + 1, junk;
00829         EntityHandle* ptr = &adj_entities_out[0];
00830         FBiGeom_getArrAdj(mInstance, entity_handles, entity_handles_size,
00831                         type_requested, &ptr, &alloc, &size, &offsets_out, &off_alloc, &junk,
00832                         &err);
00833         adj_entities_out.resize(size);
00834 
00835         if (iBase_BAD_ARRAY_DIMENSION == err || iBase_BAD_ARRAY_SIZE == err) {
00836                 alloc = adj_entities_out.size();
00837                 ptr = &adj_entities_out[0];
00838                 FBiGeom_getArrAdj(mInstance, entity_handles, entity_handles_size,
00839                                 type_requested, &ptr, &alloc, &size, &offsets_out, &off_alloc, &junk,
00840                                 &err);
00841         }
00842 
00843         return (Error) err;
00844 }
00845 
00846 inline FBiGeom::Error FBiGeom::getEnt2ndAdj(EntityHandle handle,
00847                 EntityType bridge_entity_type, EntityType type_requested, std::vector<
00848                 EntityHandle>& adj_entities_out) const
00849 {
00850         if (adj_entities_out.capacity() == 0)
00851                 adj_entities_out.resize(12);
00852         else
00853                 adj_entities_out.resize(adj_entities_out.capacity());
00854 
00855         int err, alloc = adj_entities_out.size(), size = 0;
00856         EntityHandle* ptr = &adj_entities_out[0];
00857         FBiGeom_getEnt2ndAdj(mInstance, handle, bridge_entity_type, type_requested,
00858                         &ptr, &alloc, &size, &err);
00859         adj_entities_out.resize(size);
00860 
00861         if (iBase_BAD_ARRAY_DIMENSION == err || iBase_BAD_ARRAY_SIZE == err) {
00862                 alloc = adj_entities_out.size();
00863                 ptr = &adj_entities_out[0];
00864                 FBiGeom_getEnt2ndAdj(mInstance, handle, bridge_entity_type, type_requested,
00865                                 &ptr, &alloc, &size, &err);
00866         }
00867 
00868         return (Error) err;
00869 }
00870 
00871 inline FBiGeom::Error FBiGeom::getArr2ndAdj(const EntityHandle* entity_handles,
00872                 int entity_handles_size, EntityType order_key, EntityType type_requested,
00873                 std::vector<EntityHandle>& adj_entities_out, int* offsets_out) const
00874 {
00875         if (adj_entities_out.capacity() == 0)
00876                 adj_entities_out.resize(12 * entity_handles_size);
00877         else
00878                 adj_entities_out.resize(adj_entities_out.capacity());
00879 
00880         int err, alloc = adj_entities_out.size(), size = 0;
00881         int off_alloc = entity_handles_size + 1, junk;
00882         EntityHandle* ptr = &adj_entities_out[0];
00883         FBiGeom_getArr2ndAdj(mInstance, entity_handles, entity_handles_size, order_key,
00884                         type_requested, &ptr, &alloc, &size, &offsets_out, &off_alloc, &junk,
00885                         &err);
00886         adj_entities_out.resize(size);
00887 
00888         if (iBase_BAD_ARRAY_DIMENSION == err || iBase_BAD_ARRAY_SIZE == err) {
00889                 alloc = adj_entities_out.size();
00890                 ptr = &adj_entities_out[0];
00891                 FBiGeom_getArr2ndAdj(mInstance, entity_handles, entity_handles_size,
00892                                 order_key, type_requested, &ptr, &alloc, &size, &offsets_out,
00893                                 &off_alloc, &junk, &err);
00894         }
00895 
00896         return (Error) err;
00897 }
00898 
00899 inline FBiGeom::Error FBiGeom::getBoundBox(double& min_x, double& min_y,
00900                 double& min_z, double& max_x, double& max_y, double& max_z) const
00901 {
00902         int err;
00903         FBiGeom_getBoundBox(mInstance, &min_x, &min_y, &min_z, &max_x, &max_y, &max_z,
00904                         &err);
00905         return (Error) err;
00906 }
00907 
00908 inline int FBiGeom::getParametric()
00909 {
00910         int err, result;
00911         FBiGeom_getParametric(mInstance, &result, &err);
00912         return result;
00913 }
00914 
00915 inline FBiGeom::Error FBiGeom::isEntAdj(EntityHandle entity1, EntityHandle entity2,
00916                 bool& adjacent_out) const
00917 {
00918         int err, result;
00919         FBiGeom_isEntAdj(mInstance, entity1, entity2, &result, &err);
00920         adjacent_out = (result != 0);
00921         return (Error) err;
00922 }
00923 
00924 inline FBiGeom::Error FBiGeom::isArrAdj(const EntityHandle* entities1,
00925                 const EntityHandle* entities2, int num_entity_pairs, int* is_adj_out) const
00926 {
00927         int err, alloc = num_entity_pairs, size = 0;
00928         FBiGeom_isArrAdj(mInstance, entities1, num_entity_pairs, entities2,
00929                         num_entity_pairs, &is_adj_out, &alloc, &size, &err);
00930         return (Error) err;
00931 }
00932 
00933 inline FBiGeom::Error FBiGeom::getEntClosestPt(EntityHandle entity, double near_x,
00934                 double near_y, double near_z, double& on_x, double& on_y, double& on_z) const
00935 {
00936         int err;
00937         FBiGeom_getEntClosestPt(mInstance, entity, near_x, near_y, near_z, &on_x,
00938                         &on_y, &on_z, &err);
00939         return (Error) err;
00940 }
00941 
00942 inline FBiGeom::Error FBiGeom::getEntClosestPtTrimmed(EntityHandle entity, double near_x,
00943                                           double near_y, double near_z, double& on_x, double& on_y, double& on_z) const
00944 {
00945     int err=0;
00946     FBiGeom_getEntClosestPtTrimmed(mInstance, entity, near_x, near_y, near_z, &on_x, &on_y, &on_z, &err);
00947     return (Error) err;
00948 }
00949 
00950 inline FBiGeom::Error FBiGeom::getArrClosestPt(const EntityHandle* handles,
00951           int handles_size, StorageOrder order, const double* near_coordinates,
00952           int near_coordinates_size, double* on_coordinates) const
00953 {
00954      int err, alloc = std::max(near_coordinates_size, 3 * handles_size), size = 0;
00955      FBiGeom_getArrClosestPt(mInstance, handles, handles_size, order,
00956                            near_coordinates, near_coordinates_size, &on_coordinates, &alloc, &size,
00957                            &err);
00958      return (Error) err;
00959 }
00960 
00961 inline FBiGeom::Error FBiGeom::getEntNrmlXYZ(EntityHandle entity, double x,
00962           double y, double z, double& i, double& j, double& k) const
00963 {
00964      int err;
00965      FBiGeom_getEntNrmlXYZ(mInstance, entity, x, y, z, &i, &j, &k, &err);
00966      return (Error) err;
00967 }
00968 
00969 inline FBiGeom::Error FBiGeom::getArrNrmlXYZ(const EntityHandle* entities,
00970           int entities_size, StorageOrder order, const double* xyz, int xyz_size,
00971           double* ijk) const
00972 {
00973      int err, alloc = std::max(xyz_size, 3 * entities_size), size = 0;
00974      FBiGeom_getArrNrmlXYZ(mInstance, entities, entities_size, order, xyz, xyz_size,
00975                          &ijk, &alloc, &size, &err);
00976      return (Error) err;
00977 }
00978 
00979 inline FBiGeom::Error FBiGeom::getEntNrmlPlXYZ(EntityHandle entity, double x,
00980           double y, double z, double& on_x, double& on_y, double& on_z, double& i,
00981           double& j, double& k) const
00982 {
00983      int err;
00984      FBiGeom_getEntNrmlPlXYZ(mInstance, entity, x, y, z, &on_x, &on_y, &on_z, &i,
00985                            &j, &k, &err);
00986      return (Error) err;
00987 }
00988 
00989 inline FBiGeom::Error FBiGeom::getArrNrmlPlXYZ(const EntityHandle* entities,
00990           int entities_size, StorageOrder order, const double* near_xyz,
00991           int near_xyz_size, double* on_xyz, double* nrml_ijk) const
00992 {
00993      int err, alloc = std::max(near_xyz_size, 3 * entities_size), size = 0;
00994      FBiGeom_getArrNrmlPlXYZ(mInstance, entities, entities_size, order, near_xyz,
00995                            near_xyz_size, &on_xyz, &alloc, &size, &nrml_ijk, &alloc, &size, &err);
00996      return (Error) err;
00997 }
00998 
00999 inline FBiGeom::Error FBiGeom::getEntTgntXYZ(EntityHandle entity, double x,
01000           double y, double z, double& i, double& j, double& k) const
01001 {
01002      int err;
01003      FBiGeom_getEntTgntXYZ(mInstance, entity, x, y, z, &i, &j, &k, &err);
01004      return (Error) err;
01005 }
01006 
01007 inline FBiGeom::Error FBiGeom::getArrTgntXYZ(const EntityHandle* entities,
01008           int entities_size, StorageOrder order, const double* xyz, int xyz_size,
01009           double* ijk) const
01010 {
01011      int err, alloc = std::max(xyz_size, 3 * entities_size), size = 0;
01012      FBiGeom_getArrTgntXYZ(mInstance, entities, entities_size, order, xyz, xyz_size,
01013                          &ijk, &alloc, &size, &err);
01014      return (Error) err;
01015 }
01016 
01017 inline FBiGeom::Error FBiGeom::getFcCvtrXYZ(EntityHandle face, double x, double y,
01018                                         double z, double& i1, double& j1, double& k1, double& i2, double& j2,
01019                                         double& k2) const
01020 {
01021      int err=0;
01022      FBiGeom_getFcCvtrXYZ(mInstance, face, x, y, z, &i1, &j1, &k1, &i2, &j2, &k2,
01023                         &err);
01024      return (Error) err;
01025 }
01026 
01027 inline FBiGeom::Error FBiGeom::getEgCvtrXYZ(EntityHandle edge, double x, double y,
01028                                         double z, double& i, double& j, double& k) const
01029 {
01030      int err=0;
01031      FBiGeom_getEgCvtrXYZ(mInstance, edge, x, y, z, &i, &j, &k, &err);
01032      return (Error) err;
01033 }
01034 
01035 inline FBiGeom::Error FBiGeom::getEntArrCvtrXYZ(const EntityHandle* entities,
01036           int entities_size, StorageOrder order, const double* xyz, int xyz_size,
01037           double* cvtr_1, double* cvtr_2) const
01038 {
01039      int err=0, alloc = std::max(xyz_size, 3 * entities_size), size = 0;
01040      FBiGeom_getEntArrCvtrXYZ(mInstance, entities, entities_size, order, xyz,
01041                             xyz_size, &cvtr_1, &alloc, &size, &cvtr_2, &alloc, &size, &err);
01042      return (Error) err;
01043 }
01044 
01045 inline FBiGeom::Error FBiGeom::getEgEvalXYZ(EntityHandle edge, double x, double y,
01046                                         double z, double& on_x, double& on_y, double& on_z, double& tngt_i,
01047                                         double& tngt_j, double& tngt_k, double& cvtr_i, double& cvtr_j,
01048                                         double& cvtr_k) const
01049 {
01050      int err=0;
01051      FBiGeom_getEgEvalXYZ(mInstance, edge, x, y, z, &on_x, &on_y, &on_z, &tngt_i,
01052                         &tngt_j, &tngt_k, &cvtr_i, &cvtr_j, &cvtr_k, &err);
01053      return (Error) err;
01054 }
01055 
01056 inline FBiGeom::Error FBiGeom::getFcEvalXYZ(EntityHandle face, double x, double y,
01057                                         double z, double& on_x, double& on_y, double& on_z, double& tngt_i,
01058                                         double& tngt_j, double& tngt_k, double& cvtr1_i, double& cvtr1_j,
01059                                         double& cvtr1_k, double& cvtr2_i, double& cvtr2_j, double& cvtr2_k) const
01060 {
01061      int err=0;
01062      FBiGeom_getFcEvalXYZ(mInstance, face, x, y, z, &on_x, &on_y, &on_z, &tngt_i,
01063                         &tngt_j, &tngt_k, &cvtr1_i, &cvtr1_j, &cvtr1_k, &cvtr2_i, &cvtr2_j,
01064                         &cvtr2_k, &err);
01065      return (Error) err;
01066 }
01067 
01068 inline FBiGeom::Error FBiGeom::getArrEgEvalXYZ(const EntityHandle* edges,
01069           int edges_size, StorageOrder order, const double* near_coords,
01070           int near_coords_size, double* on_coords, double* tangent, double* curvature) const
01071 {
01072      int err=0, alloc = std::max(near_coords_size, 3 * edges_size), size = 0;
01073      FBiGeom_getArrEgEvalXYZ(mInstance, edges, edges_size, order, near_coords,
01074                            near_coords_size, &on_coords, &alloc, &size, &tangent, &alloc, &size,
01075                            &curvature, &alloc, &size, &err);
01076      return (Error) err;
01077 }
01078 
01079 inline FBiGeom::Error FBiGeom::getArrFcEvalXYZ(const EntityHandle* faces,
01080           int faces_size, StorageOrder order, const double* near_coords,
01081           int near_coords_size, double* on_coords, double* tangent,
01082           double* curvature1, double* curvature2) const
01083 {
01084      int err=0, alloc = std::max(near_coords_size, 3 * faces_size), size = 0;
01085      FBiGeom_getArrFcEvalXYZ(mInstance, faces, faces_size, order, near_coords,
01086                            near_coords_size, &on_coords, &alloc, &size, &tangent, &alloc, &size,
01087                            &curvature1, &alloc, &size, &curvature2, &alloc, &size, &err);
01088      return (Error) err;
01089 }
01090 
01091 inline FBiGeom::Error FBiGeom::getEntBoundBox(EntityHandle entity, double& min_x,
01092           double& min_y, double& min_z, double& max_x, double& max_y, double& max_z) const
01093 {
01094      int err;
01095      FBiGeom_getEntBoundBox(mInstance, entity, &min_x, &min_y, &min_z, &max_x,
01096                           &max_y, &max_z, &err);
01097      return (Error) err;
01098 }
01099 
01100 inline FBiGeom::Error FBiGeom::getArrBoundBox(const EntityHandle* entities,
01101           int entities_size, StorageOrder order, double* min_corners,
01102           double* max_corners) const
01103 {
01104      int err, alloc = 3 * entities_size, size = 0, order_int = order;
01105      FBiGeom_getArrBoundBox(mInstance, entities, entities_size, order_int,
01106                           &min_corners, &alloc, &size, &max_corners, &alloc, &size, &err);
01107      return (Error) err;
01108 }
01109 
01110 inline FBiGeom::Error FBiGeom::getVtxCoord(EntityHandle vertex, double& x,
01111                                        double& y, double& z) const
01112 {
01113      int err;
01114      FBiGeom_getVtxCoord(mInstance, vertex, &x, &y, &z, &err);
01115      return (Error) err;
01116 }
01117 
01118 inline FBiGeom::Error FBiGeom::getVtxArrCoords(const EntityHandle* vertices,
01119           int vertices_size, StorageOrder order, double* coords) const
01120 {
01121      int err, alloc = vertices_size, size = 0;
01122      FBiGeom_getVtxArrCoords(mInstance, vertices, vertices_size, order, &coords,
01123                            &alloc, &size, &err);
01124      return (Error) err;
01125 }
01126 
01127 inline FBiGeom::Error FBiGeom::getPntRayIntsct(double x, double y, double z,
01128           double i, double j, double k, StorageOrder order,
01129           std::vector<EntityHandle>& entities_out, std::vector<double>& points_out,
01130           std::vector<double>& params_out) const
01131 {
01132      int err, count;
01133      Error err2 = getNumOfType(getRootSet(), iBase_ALL_TYPES, count);
01134      if (err2 != iBase_SUCCESS)
01135           return err2;
01136 
01137      entities_out.resize(count);
01138      points_out.resize(3 * count);
01139      params_out.resize(2 * count);
01140      int entities_alloc = entities_out.size(), entities_size = 0;
01141      int points_alloc = points_out.size(), points_size = 0;
01142      int params_alloc = params_out.size(), params_size = 0;
01143      EntityHandle* entities_ptr = &entities_out[0];
01144      double * points_ptr = &points_out[0];
01145      double * params_ptr = &params_out[0];
01146 
01147      FBiGeom_getPntRayIntsct(mInstance, x, y, z, i, j, k, &entities_ptr,
01148                            &entities_alloc, &entities_size, order, &points_ptr, &points_alloc,
01149                            &points_size, &params_ptr, &params_alloc, &params_size, &err);
01150      entities_out.resize(entities_size);
01151      points_out.resize(points_size);
01152      params_out.resize(params_size);
01153      if (err == iBase_BAD_ARRAY_SIZE || err == iBase_BAD_ARRAY_DIMENSION) {
01154           entities_alloc = entities_out.size();
01155           points_alloc = points_out.size();
01156           params_alloc = params_out.size();
01157           entities_ptr = &entities_out[0];
01158           points_ptr = &points_out[0];
01159           params_ptr = &params_out[0];
01160           FBiGeom_getPntRayIntsct(mInstance, x, y, z, i, j, k, &entities_ptr,
01161                                 &entities_alloc, &entities_size, order, &points_ptr, &points_alloc,
01162                                 &points_size, &params_ptr, &params_alloc, &params_size, &err);
01163      }
01164 
01165      return (Error) err;
01166 }
01167 
01168 inline FBiGeom::Error FBiGeom::getPntClsf(double x, double y, double z,
01169                                       EntityHandle& handle_out) const
01170 {
01171      int err=0;
01172      /*FBiGeom_getPntClsf(mInstance, x, y, z, &handle_out, &err);*/
01173      return (Error) err;
01174 }
01175 
01176 inline FBiGeom::Error FBiGeom::getPntArrClsf(StorageOrder order,
01177           const double* coords, int coords_size, EntityHandle* entities_out) const
01178 {
01179      int err=0;//, alloc = coords_size / 3, size = 0;
01180      /*FBiGeom_getPntArrClsf(mInstance, order, coords, coords_size, &entities_out,
01181                          &alloc, &size, &err);*/
01182      return (Error) err;
01183 }
01184 
01185 inline FBiGeom::Error FBiGeom::getSense(EntityHandle ent, EntityHandle wrt_ent,
01186                                     int &sense) const
01187 {
01188      EntityType tp_wrt, tp_ent;
01189      Error err = getEntType(wrt_ent, tp_wrt);
01190      if (iBase_SUCCESS != err)
01191           return err;
01192      err = getEntType(ent, tp_ent);
01193      if (iBase_SUCCESS != err)
01194           return err;
01195      if (tp_wrt - tp_ent != 1)
01196           return iBase_FAILURE;
01197      switch (tp_wrt) {
01198      case iBase_REGION:
01199           return getEntNrmlSense(ent, wrt_ent, sense);
01200           break;
01201      case iBase_FACE:
01202           return getEgFcSense(ent, wrt_ent, sense);
01203      case iBase_EDGE:
01204           return getEgVtxSense(wrt_ent, ent, ent, sense);
01205      case iBase_VERTEX:
01206      case iBase_ALL_TYPES:
01207           return iBase_FAILURE;
01208      }
01209      return iBase_FAILURE;
01210 }
01211 
01212 inline FBiGeom::Error FBiGeom::getArrSense(const EntityHandle *ent, int num_ents,
01213                                        EntityHandle wrt_ent, int *sense) const
01214 {
01215      EntityType tp_wrt, tp_ent;
01216      Error err = getEntType(wrt_ent, tp_wrt);
01217      if (iBase_SUCCESS != err)
01218           return err;
01219      err = getEntType(ent[0], tp_ent);
01220      if (iBase_SUCCESS != err)
01221           return err;
01222      if (tp_wrt - tp_ent != 1)
01223           return iBase_FAILURE;
01224      std::vector<EntityHandle> dum_wrts(num_ents, wrt_ent);
01225      switch (tp_wrt) {
01226      case iBase_REGION:
01227           return getArrNrmlSense(ent, num_ents, &dum_wrts[0], num_ents, sense);
01228           break;
01229      case iBase_FACE:
01230           return getEgFcArrSense(ent, num_ents, &dum_wrts[0], num_ents, sense);
01231           break;
01232      case iBase_EDGE:
01233           return getEgVtxArrSense(&dum_wrts[0], num_ents, ent, num_ents, ent,
01234                                   num_ents, sense);
01235           break;
01236      case iBase_VERTEX:
01237      case iBase_ALL_TYPES:
01238           return iBase_FAILURE;
01239           break;
01240      }
01241      return iBase_FAILURE;
01242 }
01243 
01244 inline FBiGeom::Error FBiGeom::getEntNrmlSense(EntityHandle face,
01245           EntityHandle region, int& sense) const
01246 {
01247      int err;
01248      FBiGeom_getEntNrmlSense(mInstance, face, region, &sense, &err);
01249      return (Error) err;
01250 }
01251 
01252 inline FBiGeom::Error FBiGeom::getEgFcSense(EntityHandle edge, EntityHandle face,
01253                                         int& sense) const
01254 {
01255      int err;
01256      FBiGeom_getEgFcSense(mInstance, edge, face, &sense, &err);
01257      return (Error) err;
01258 }
01259 
01260 inline FBiGeom::Error FBiGeom::getEgVtxSense(EntityHandle edge, EntityHandle vtx1,
01261           EntityHandle vtx2, int& sense) const
01262 {
01263      int err;
01264      FBiGeom_getEgVtxSense(mInstance, edge, vtx1, vtx2, &sense, &err);
01265      return (Error) err;
01266 }
01267 
01268 inline FBiGeom::Error FBiGeom::getArrNrmlSense(const EntityHandle* faces,
01269           int faces_size, const EntityHandle* vols, int vols_size, int* senses_out) const
01270 {
01271      int err, alloc = std::max(vols_size, faces_size), size = 0;
01272      FBiGeom_getArrNrmlSense(mInstance, faces, faces_size, vols, vols_size,
01273                            &senses_out, &alloc, &size, &err);
01274      return (Error) err;
01275 }
01276 
01277 inline FBiGeom::Error FBiGeom::getEgFcArrSense(const EntityHandle* edges,
01278           int edges_size, const EntityHandle* faces, int faces_size, int* senses_out) const
01279 {
01280      int err, alloc = std::max(edges_size, faces_size), size = 0;
01281      FBiGeom_getEgFcArrSense(mInstance, edges, edges_size, faces, faces_size,
01282                            &senses_out, &alloc, &size, &err);
01283      return (Error) err;
01284 }
01285 
01286 inline FBiGeom::Error FBiGeom::getEgVtxArrSense(const EntityHandle* edges,
01287           int edges_size, const EntityHandle* vertices1, int vertices1_size,
01288           const EntityHandle* vertices2, int vertices2_size, int* senses_out) const
01289 {
01290      int err, alloc = std::max(vertices1_size,
01291                                std::max(vertices2_size, edges_size)), size = 0;
01292      FBiGeom_getEgVtxArrSense(mInstance, edges, edges_size, vertices1,
01293                             vertices1_size, vertices2, vertices2_size, &senses_out, &alloc, &size,
01294                             &err);
01295      return (Error) err;
01296 }
01297 
01298 inline FBiGeom::Error FBiGeom::measure(const EntityHandle* entities,
01299                                    int entities_size, double* measures) const
01300 {
01301      int err, alloc = entities_size, size = 0;
01302      FBiGeom_measure(mInstance, entities, entities_size, &measures, &alloc, &size,
01303                    &err);
01304      return (Error) err;
01305 }
01306 
01307 inline FBiGeom::Error FBiGeom::getFaceType(EntityHandle face, std::string& type) const
01308 {
01309      char buffer[1024];
01310      int err, len = sizeof(buffer);
01311      FBiGeom_getFaceType(mInstance, face, buffer, &err, &len);
01312      type = std::string(buffer, len);
01313      return (Error) err;
01314 }
01315 
01316 inline FBiGeom::Error FBiGeom::isEntParametric(EntityHandle entity,
01317           bool& parametric) const
01318 {
01319      int err, result;
01320      FBiGeom_isEntParametric(mInstance, entity, &result, &err);
01321      parametric = (result != 0);
01322      return (Error) err;
01323 }
01324 
01325 inline FBiGeom::Error FBiGeom::isArrParametric(const EntityHandle* entities,
01326           int entities_size, int* is_parametric) const
01327 {
01328      int err, alloc = entities_size, size = 1;
01329      FBiGeom_isArrParametric(mInstance, entities, entities_size, &is_parametric,
01330                            &alloc, &size, &err);
01331      return (Error) err;
01332 }
01333 
01334 inline FBiGeom::Error FBiGeom::getEntUVtoXYZ(EntityHandle face, double u, double v,
01335           double& x, double& y, double& z) const
01336 {
01337      int err;
01338      FBiGeom_getEntUVtoXYZ(mInstance, face, u, v, &x, &y, &z, &err);
01339      return (Error) err;
01340 }
01341 
01342 inline FBiGeom::Error FBiGeom::getEntUtoXYZ(EntityHandle edge, double u, double& x,
01343                                         double& y, double& z) const
01344 {
01345      int err;
01346      FBiGeom_getEntUtoXYZ(mInstance, edge, u, &x, &y, &z, &err);
01347      return (Error) err;
01348 }
01349 
01350 inline FBiGeom::Error FBiGeom::getArrUVtoXYZ(const EntityHandle* faces,
01351           int faces_size, StorageOrder order, const double* uv, int uv_size,
01352           double* xyz) const
01353 {
01354      int err, alloc = std::max(3 * uv_size / 2, 3 * faces_size), size = 0;
01355      FBiGeom_getArrUVtoXYZ(mInstance, faces, faces_size, order, uv, uv_size, &xyz,
01356                          &alloc, &size, &err);
01357      return (Error) err;
01358 }
01359 
01360 inline FBiGeom::Error FBiGeom::getArrUtoXYZ(const EntityHandle* edges,
01361                                         int edges_size, const double* u, int u_size, StorageOrder order,
01362                                         double* xyz) const
01363 {
01364      int err, alloc = std::max(3 * u_size, 3 * edges_size), size = 0;
01365      FBiGeom_getArrUtoXYZ(mInstance, edges, edges_size, u, u_size, order, &xyz,
01366                         &alloc, &size, &err);
01367      return (Error) err;
01368 }
01369 
01370 inline FBiGeom::Error FBiGeom::getEntXYZtoUV(EntityHandle face, double x, double y,
01371           double z, double& u, double& v) const
01372 {
01373      int err;
01374      FBiGeom_getEntXYZtoUV(mInstance, face, x, y, z, &u, &v, &err);
01375      return (Error) err;
01376 }
01377 
01378 inline FBiGeom::Error FBiGeom::getEntXYZtoU(EntityHandle edge, double x, double y,
01379                                         double z, double& u) const
01380 {
01381      int err;
01382      FBiGeom_getEntXYZtoU(mInstance, edge, x, y, z, &u, &err);
01383      return (Error) err;
01384 }
01385 
01386 inline FBiGeom::Error FBiGeom::getArrXYZtoUV(const EntityHandle* faces,
01387           int faces_size, StorageOrder order, const double* coords, int coords_size,
01388           double* uv) const
01389 {
01390      int err, alloc = std::max(2 * coords_size / 3, 2 * faces_size), size = 0;
01391      FBiGeom_getArrXYZtoUV(mInstance, faces, faces_size, order, coords, coords_size,
01392                          &uv, &alloc, &size, &err);
01393      return (Error) err;
01394 }
01395 
01396 inline FBiGeom::Error FBiGeom::getArrXYZtoU(const EntityHandle* edges,
01397                                         int edges_size, StorageOrder order, const double* coords, int coords_size,
01398                                         double* u) const
01399 {
01400      int err, alloc = std::max(coords_size / 3, edges_size), size = 0;
01401      FBiGeom_getArrXYZtoU(mInstance, edges, edges_size, order, coords, coords_size,
01402                         &u, &alloc, &size, &err);
01403      return (Error) err;
01404 }
01405 
01406 inline FBiGeom::Error FBiGeom::getEntXYZtoUVHint(EntityHandle face, double x,
01407           double y, double z, double& u, double& v) const
01408 {
01409      int err;
01410      FBiGeom_getEntXYZtoUVHint(mInstance, face, x, y, z, &u, &v, &err);
01411      return (Error) err;
01412 }
01413 
01414 inline FBiGeom::Error FBiGeom::getArrXYZtoUVHint(const EntityHandle* faces,
01415           int faces_size, StorageOrder order, const double* coords, int coords_size,
01416           double* uv) const
01417 {
01418      int err, alloc = std::max(2 * coords_size / 3, 2 * faces_size), size = 0;
01419      FBiGeom_getArrXYZtoUVHint(mInstance, faces, faces_size, order, coords,
01420                              coords_size, &uv, &alloc, &size, &err);
01421      return (Error) err;
01422 }
01423 
01424 inline FBiGeom::Error FBiGeom::getEntNrmlUV(EntityHandle face, double u, double v,
01425                                         double& i, double& j, double& k) const
01426 {
01427      int err;
01428      FBiGeom_getEntNrmlUV(mInstance, face, u, v, &i, &j, &k, &err);
01429      return (Error) err;
01430 }
01431 
01432 inline FBiGeom::Error FBiGeom::getArrNrmlUV(const EntityHandle* faces,
01433                                         int faces_size, StorageOrder order, const double* uv, int uv_size,
01434                                         double* normals) const
01435 {
01436      int err, alloc = std::max(3 * uv_size / 2, 3 * faces_size), size = 0;
01437      FBiGeom_getArrNrmlUV(mInstance, faces, faces_size, order, uv, uv_size,
01438                         &normals, &alloc, &size, &err);
01439      return (Error) err;
01440 }
01441 
01442 inline FBiGeom::Error FBiGeom::getEntTgntU(EntityHandle edge, double u, double& i,
01443                                        double& j, double& k) const
01444 {
01445      int err;
01446      FBiGeom_getEntTgntU(mInstance, edge, u, &i, &j, &k, &err);
01447      return (Error) err;
01448 }
01449 
01450 inline FBiGeom::Error FBiGeom::getArrTgntU(const EntityHandle* edges,
01451                                        int edges_size, StorageOrder order, const double* u, int u_size,
01452                                        double* normals) const
01453 {
01454      int err, alloc = std::max(3 * u_size, 3 * edges_size), size = 0;
01455      FBiGeom_getArrTgntU(mInstance, edges, edges_size, order, u, u_size, &normals,
01456                        &alloc, &size, &err);
01457      return (Error) err;
01458 }
01459 
01460 inline FBiGeom::Error FBiGeom::getEnt1stDrvt(EntityHandle handle, double u,
01461           double v, double& du_i, double& du_j, double& du_k, double& dv_i,
01462           double& dv_j, double& dv_k) const
01463 {
01464      int err, du_alloc = 3, dv_alloc = 3, du_size = 0, dv_size = 0;
01465      double du[3], dv[3], *du_ptr = du, *dv_ptr = dv;
01466      FBiGeom_getEnt1stDrvt(mInstance, handle, u, v, &du_ptr, &du_alloc, &du_size,
01467                          &dv_ptr, &dv_alloc, &dv_size, &err);
01468      du_i = du[0];
01469      du_j = du[1];
01470      du_k = du[2];
01471      dv_i = dv[0];
01472      dv_j = dv[1];
01473      dv_k = dv[2];
01474      return (Error) err;
01475 }
01476 
01477 inline FBiGeom::Error FBiGeom::getEnt2ndDrvt(EntityHandle handle, double u,
01478           double v, double& duu_i, double& duu_j, double& duu_k, double& dvv_i,
01479           double& dvv_j, double& dvv_k, double& duv_i, double& duv_j, double& duv_k) const
01480 {
01481      int err, uu_alloc = 3, uv_alloc = 3, vv_alloc = 3, uu_size = 0, uv_size = 0,
01482                                        vv_size = 0;
01483      double uu[3], uv[3], vv[3], *uu_ptr = uu, *vv_ptr = vv, *uv_ptr = uv;
01484      FBiGeom_getEnt2ndDrvt(mInstance, handle, u, v, &uu_ptr, &uu_alloc, &uu_size,
01485                          &vv_ptr, &vv_alloc, &vv_size, &uv_ptr, &uv_alloc, &uv_size, &err);
01486      duu_i = uu[0];
01487      duu_j = uu[1];
01488      duu_k = uu[2];
01489      dvv_i = vv[0];
01490      dvv_j = vv[1];
01491      dvv_k = vv[2];
01492      duv_i = uv[0];
01493      duv_j = uv[1];
01494      duv_k = uv[2];
01495      return (Error) err;
01496 }
01497 
01498 inline FBiGeom::Error FBiGeom::getArr1stDrvt(const EntityHandle* entities,
01499           int entities_size, StorageOrder order, const double* uv, int uv_size,
01500           double* dvtr_u, double* dvtr_v) const
01501 {
01502      int err, allocu = std::max(3 * uv_size / 2, 3 * entities_size), sizeu = 0,
01503                        allocv = allocu, sizev = 0;
01504      std::vector<int> offset1(std::max(uv_size / 2, entities_size) + 1);
01505      std::vector<int> offset2(std::max(uv_size / 2, entities_size) + 1);
01506      int alloc1 = offset1.size(), size1 = 0, *ptr1 = &offset1[0];
01507      int alloc2 = offset2.size(), size2 = 0, *ptr2 = &offset2[0];
01508      FBiGeom_getArr1stDrvt(mInstance, entities, entities_size, order, uv, uv_size,
01509                          &dvtr_u, &allocu, &sizeu, &ptr1, &alloc1, &size1, &dvtr_v, &allocv,
01510                          &sizev, &ptr2, &alloc2, &size2, &err);
01511      return (Error) err;
01512 }
01513 
01514 inline FBiGeom::Error FBiGeom::getArr2ndDrvt(const EntityHandle* entities,
01515           int entities_size, StorageOrder order, const double* uv, int uv_size,
01516           double* dvtr_uu, double* dvtr_vv, double* dvtr_uv) const
01517 {
01518      int err, allocuu = std::max(3 * uv_size / 2, 3 * entities_size), sizeuu = 0,
01519                         allocvv = allocuu, sizevv = 0, allocuv = allocuu, sizeuv = 0;
01520      std::vector<int> offset1(std::max(uv_size / 2, entities_size) + 1);
01521      std::vector<int> offset2(std::max(uv_size / 2, entities_size) + 1);
01522      std::vector<int> offset3(std::max(uv_size / 2, entities_size) + 1);
01523      int alloc1 = offset1.size(), size1 = 0, *ptr1 = &offset1[0];
01524      int alloc2 = offset2.size(), size2 = 0, *ptr2 = &offset2[0];
01525      int alloc3 = offset3.size(), size3 = 0, *ptr3 = &offset3[0];
01526      FBiGeom_getArr2ndDrvt(mInstance, entities, entities_size, order, uv, uv_size,
01527                          &dvtr_uu, &allocuu, &sizeuu, &ptr1, &alloc1, &size1, &dvtr_vv, &allocvv,
01528                          &sizevv, &ptr2, &alloc2, &size2, &dvtr_uv, &allocuv, &sizeuv, &ptr3,
01529                          &alloc3, &size3, &err);
01530      return (Error) err;
01531 }
01532 
01533 inline FBiGeom::Error FBiGeom::getFcCvtrUV(EntityHandle face, double u, double v,
01534                                        double& i1, double& j1, double& k1, double& i2, double& j2, double& k2) const
01535 {
01536      int err;
01537      FBiGeom_getFcCvtrUV(mInstance, face, u, v, &i1, &j1, &k1, &i2, &j2, &k2, &err);
01538      return (Error) err;
01539 }
01540 
01541 inline FBiGeom::Error FBiGeom::getFcArrCvtrUV(const EntityHandle* faces,
01542           int faces_size, StorageOrder order, const double* uv, int uv_size,
01543           double* cvtr1, double* cvtr2) const
01544 {
01545      int err, alloc = std::max(3 * uv_size / 2, 3 * faces_size), size = 0;
01546      FBiGeom_getFcArrCvtrUV(mInstance, faces, faces_size, order, uv, uv_size,
01547                           &cvtr1, &alloc, &size, &cvtr2, &alloc, &size, &err);
01548      return (Error) err;
01549 }
01550 
01551 inline FBiGeom::Error FBiGeom::isEntPeriodic(EntityHandle entity, bool& in_u,
01552           bool& in_v) const
01553 {
01554      int err, u, v;
01555      FBiGeom_isEntPeriodic(mInstance, entity, &u, &v, &err);
01556      in_u = (u != 0);
01557      in_v = (v != 0);
01558      return (Error) err;
01559 }
01560 
01561 inline FBiGeom::Error FBiGeom::isArrPeriodic(const EntityHandle* entities,
01562           int entities_size, int* in_uv) const
01563 {
01564      int err, alloc = 2 * entities_size, size = 0;
01565      FBiGeom_isArrPeriodic(mInstance, entities, entities_size, &in_uv, &alloc,
01566                          &size, &err);
01567      return (Error) err;
01568 }
01569 
01570 inline FBiGeom::Error FBiGeom::isFcDegenerate(EntityHandle face,
01571           bool& is_degenerate) const
01572 {
01573      int err, result;
01574      FBiGeom_isFcDegenerate(mInstance, face, &result, &err);
01575      is_degenerate = (result != 0);
01576      return (Error) err;
01577 }
01578 
01579 inline FBiGeom::Error FBiGeom::isFcArrDegenerate(const EntityHandle* faces,
01580           int faces_size, int* degenerate) const
01581 {
01582      int err, alloc = faces_size, size = 0;
01583      FBiGeom_isFcArrDegenerate(mInstance, faces, faces_size, &degenerate, &alloc,
01584                              &size, &err);
01585      return (Error) err;
01586 }
01587 
01588 inline FBiGeom::Error FBiGeom::getTolerance(int& type_out, double& tolerance_out) const
01589 {
01590      int err=0;
01591      FBiGeom_getTolerance(mInstance, &type_out, &tolerance_out, &err);
01592      return (Error) err;
01593 }
01594 
01595 inline FBiGeom::Error FBiGeom::getEntTolerance(EntityHandle entity,
01596           double& tolerance) const
01597 {
01598      int err=0;
01599      FBiGeom_getEntTolerance(mInstance, entity, &tolerance, &err);
01600      return (Error) err;
01601 }
01602 
01603 inline FBiGeom::Error FBiGeom::getArrTolerance(const EntityHandle* entities,
01604           int entities_size, double* tolerances) const
01605 {
01606      int err, alloc = entities_size, size = 0;
01607      FBiGeom_getArrTolerance(mInstance, entities, entities_size, &tolerances,
01608                            &alloc, &size, &err);
01609      return (Error) err;
01610 }
01611 
01612 inline FBiGeom::Error FBiGeom::getEntUVRange(EntityHandle face, double& u_min,
01613           double& v_min, double& u_max, double& v_max) const
01614 {
01615      int err;
01616      FBiGeom_getEntUVRange(mInstance, face, &u_min, &v_min, &u_max, &v_max, &err);
01617      return (Error) err;
01618 }
01619 
01620 inline FBiGeom::Error FBiGeom::getEntURange(EntityHandle edge, double& u_min,
01621                                         double& u_max) const
01622 {
01623      int err;
01624      FBiGeom_getEntURange(mInstance, edge, &u_min, &u_max, &err);
01625      return (Error) err;
01626 }
01627 
01628 inline FBiGeom::Error FBiGeom::getArrUVRange(const EntityHandle* faces,
01629           int faces_size, StorageOrder order, double* uv_min, double* uv_max) const
01630 {
01631      int err, alloc = faces_size, size = 0;
01632      FBiGeom_getArrUVRange(mInstance, faces, faces_size, order, &uv_min, &alloc,
01633                          &size, &uv_max, &alloc, &size, &err);
01634      return (Error) err;
01635 }
01636 
01637 inline FBiGeom::Error FBiGeom::getArrURange(const EntityHandle* edges,
01638                                         int edges_size, double* u_min, double* u_max) const
01639 {
01640      int err, alloc = edges_size, size = 0;
01641      FBiGeom_getArrURange(mInstance, edges, edges_size, &u_min, &alloc, &size,
01642                         &u_max, &alloc, &size, &err);
01643      return (Error) err;
01644 }
01645 
01646 inline FBiGeom::Error FBiGeom::getEntUtoUV(EntityHandle edge, EntityHandle face,
01647                                        double edge_u, double& face_u, double& face_v) const
01648 {
01649      int err;
01650      FBiGeom_getEntUtoUV(mInstance, edge, face, edge_u, &face_u, &face_v, &err);
01651      return (Error) err;
01652 }
01653 
01654 inline FBiGeom::Error FBiGeom::getVtxToUV(EntityHandle vertex, EntityHandle face,
01655                                       double& u, double& v) const
01656 {
01657      int err;
01658      FBiGeom_getVtxToUV(mInstance, vertex, face, &u, &v, &err);
01659      return (Error) err;
01660 }
01661 
01662 inline FBiGeom::Error FBiGeom::getVtxToU(EntityHandle vertex, EntityHandle edge,
01663                                      double& u) const
01664 {
01665      int err;
01666      FBiGeom_getVtxToU(mInstance, vertex, edge, &u, &err);
01667      return (Error) err;
01668 }
01669 
01670 inline FBiGeom::Error FBiGeom::getArrUtoUV(const EntityHandle* edges,
01671                                        int edges_size, const EntityHandle* faces, int faces_size,
01672                                        const double* edge_u, int edge_u_size, StorageOrder order, double* face_uv) const
01673 {
01674      int err, alloc = std::max(edge_u_size, std::max(edges_size, faces_size));
01675      int size = 0;
01676      FBiGeom_getArrUtoUV(mInstance, edges, edges_size, faces, faces_size, edge_u,
01677                        edge_u_size, order, &face_uv, &alloc, &size, &err);
01678      return (Error) err;
01679 }
01680 
01681 inline FBiGeom::Error FBiGeom::getVtxArrToUV(const EntityHandle* vertices,
01682           int vertices_size, const EntityHandle* faces, int faces_size,
01683           StorageOrder order, double* face_uv) const
01684 {
01685      int err, alloc = std::max(vertices_size, faces_size), size = 0;
01686      FBiGeom_getVtxArrToUV(mInstance, vertices, vertices_size, faces, faces_size,
01687                          order, &face_uv, &alloc, &size, &err);
01688      return (Error) err;
01689 }
01690 
01691 inline FBiGeom::Error FBiGeom::getVtxArrToU(const EntityHandle* vertices,
01692                                         int vertices_size, const EntityHandle* edges, int edges_size,
01693                                         double* edge_u) const
01694 {
01695      int err, alloc = std::max(vertices_size, edges_size), size = 0;
01696      FBiGeom_getVtxArrToU(mInstance, vertices, vertices_size, edges, edges_size,
01697                         &edge_u, &alloc, &size, &err);
01698      return (Error) err;
01699 }
01700 
01701 inline FBiGeom::Error FBiGeom::deleteAll()
01702 {
01703      int err;
01704      FBiGeom_deleteAll(mInstance, &err);
01705      return (Error) err;
01706 }
01707 
01708 inline FBiGeom::Error FBiGeom::copyEnt(EntityHandle source, EntityHandle& copy)
01709 {
01710      int err;
01711      FBiGeom_copyEnt(mInstance, source, &copy, &err);
01712      return (Error) err;
01713 }
01714 
01715 inline FBiGeom::Error FBiGeom::createSphere(double radius, EntityHandle& sphere)
01716 {
01717      int err;
01718      FBiGeom_createSphere(mInstance, radius, &sphere, &err);
01719      return (Error) err;
01720 }
01721 
01722 inline FBiGeom::Error FBiGeom::createPrism(double height, int num_sides,
01723                                        double maj_radius, double min_radius, EntityHandle& prism)
01724 {
01725      int err;
01726      FBiGeom_createPrism(mInstance, height, num_sides, maj_radius, min_radius,
01727                        &prism, &err);
01728      return (Error) err;
01729 }
01730 
01731 inline FBiGeom::Error FBiGeom::createBrick(double x, double y, double z,
01732                                        EntityHandle& brick)
01733 {
01734      int err;
01735      FBiGeom_createBrick(mInstance, x, y, z, &brick, &err);
01736      return (Error) err;
01737 }
01738 
01739 inline FBiGeom::Error FBiGeom::createCylinder(double height, double maj_rad,
01740           double min_rad, EntityHandle& cylinder)
01741 {
01742      int err;
01743      FBiGeom_createCylinder(mInstance, height, maj_rad, min_rad, &cylinder, &err);
01744      return (Error) err;
01745 }
01746 
01747 inline FBiGeom::Error FBiGeom::createTorus(double maj_rad, double min_rad,
01748                                        EntityHandle& torus)
01749 {
01750      int err;
01751      FBiGeom_createTorus(mInstance, maj_rad, min_rad, &torus, &err);
01752      return (Error) err;
01753 }
01754 
01755 inline FBiGeom::Error FBiGeom::moveEnt(EntityHandle entity, double x, double y,
01756                                    double z)
01757 {
01758      int err;
01759      FBiGeom_moveEnt(mInstance, entity, x, y, z, &err);
01760      return (Error) err;
01761 }
01762 
01763 inline FBiGeom::Error FBiGeom::rotateEnt(EntityHandle entity, double angle,
01764                                      double axis_x, double axis_y, double axis_z)
01765 {
01766      int err;
01767      FBiGeom_rotateEnt(mInstance, entity, angle, axis_x, axis_y, axis_z, &err);
01768      return (Error) err;
01769 }
01770 
01771 inline FBiGeom::Error FBiGeom::reflectEnt(EntityHandle entity, double x,
01772                                           double y, double z, double norm_x,
01773                                           double norm_y, double norm_z)
01774 {
01775      int err;
01776      FBiGeom_reflectEnt(mInstance, entity, x, y, z, norm_x, norm_y, norm_z, &err);
01777      return (Error) err;
01778 }
01779 
01780 inline FBiGeom::Error FBiGeom::scaleEnt(EntityHandle entity, double x,
01781                                         double y, double z, double x_factor,
01782                                         double y_factor, double z_factor)
01783 {
01784      int err;
01785      FBiGeom_scaleEnt(mInstance, entity, x, y, z, x_factor, y_factor, z_factor, &err);
01786      return (Error) err;
01787 }
01788 
01789 inline FBiGeom::Error FBiGeom::uniteEnts(const EntityHandle* entities,
01790                                      int entities_size, EntityHandle& result_entity)
01791 {
01792      int err;
01793      FBiGeom_uniteEnts(mInstance, entities, entities_size, &result_entity, &err);
01794      return (Error) err;
01795 }
01796 
01797 inline FBiGeom::Error FBiGeom::subtractEnts(EntityHandle blank, EntityHandle tool,
01798                                         EntityHandle& result)
01799 {
01800      int err;
01801      FBiGeom_subtractEnts(mInstance, blank, tool, &result, &err);
01802      return (Error) err;
01803 }
01804 
01805 inline FBiGeom::Error FBiGeom::intersectEnts(EntityHandle entity1,
01806           EntityHandle entity2, EntityHandle& result)
01807 {
01808      int err;
01809      FBiGeom_intersectEnts(mInstance, entity1, entity2, &result, &err);
01810      return (Error) err;
01811 }
01812 
01813 inline FBiGeom::Error FBiGeom::sectionEnt(EntityHandle entity, double plane_x,
01814                                       double plane_y, double plane_z, double offset, bool reverse,
01815                                       EntityHandle& result)
01816 {
01817      int err;
01818      FBiGeom_sectionEnt(mInstance, entity, plane_x, plane_y, plane_z, offset,
01819                       reverse, &result, &err);
01820      return (Error) err;
01821 }
01822 
01823 inline FBiGeom::Error FBiGeom::sweepEntAboutAxis(EntityHandle entity, double angle,
01824           double axis_x, double axis_y, double axis_z, EntityHandle& swept_entity)
01825 {
01826      int err;
01827      FBiGeom_sweepEntAboutAxis(mInstance, entity, angle, axis_x, axis_y, axis_z,
01828                              &swept_entity, &err);
01829      return (Error) err;
01830 }
01831 
01832 inline FBiGeom::Error FBiGeom::imprintEnts(const EntityHandle* entities,
01833                                        int entities_size)
01834 {
01835      int err;
01836      FBiGeom_imprintEnts(mInstance, entities, entities_size, &err);
01837      return (Error) err;
01838 }
01839 
01840 inline FBiGeom::Error FBiGeom::mergeEnts(const EntityHandle* entities,
01841                                      int entities_size, double tolerance)
01842 {
01843      int err;
01844      FBiGeom_mergeEnts(mInstance, entities, entities_size, tolerance, &err);
01845      return (Error) err;
01846 }
01847 
01848 
01849 FBiGeom::Error
01850 FBiGeom::getErrorType() const
01851 {
01852      int err;
01853      FBiGeom_getErrorType( mInstance, &err );
01854      return (Error)err;
01855 }
01856 
01857 std::string
01858 FBiGeom::getDescription() const
01859 {
01860      std::vector<char> buffer(1024);
01861      FBiGeom_getDescription( mInstance, &buffer[0], buffer.size() );
01862      return std::string(&buffer[0]);
01863 }
01864 
01865 
01866 
01867 
01868 FBiGeom::EntitySetHandle
01869 FBiGeom::getRootSet() const
01870 {
01871      int err;
01872      EntitySetHandle result;
01873      FBiGeom_getRootSet( mInstance, &result, &err );
01874      return iBase_SUCCESS == err ? result : 0;
01875 }
01876 
01877 
01878 
01879 FBiGeom::Error
01880 FBiGeom::createEntSet( bool is_list, EntitySetHandle& handle_out )
01881 {
01882      int err;
01883      FBiGeom_createEntSet( mInstance, is_list, &handle_out, &err );
01884      return (Error)err;
01885 }
01886 
01887 FBiGeom::Error
01888 FBiGeom::destroyEntSet( EntitySetHandle handle )
01889 {
01890      int err;
01891      FBiGeom_destroyEntSet( mInstance, handle, &err );
01892      return (Error)err;
01893 }
01894 
01895 FBiGeom::Error
01896 FBiGeom::isList( EntitySetHandle handle, bool& is_list )
01897 {
01898      int err, result;
01899      FBiGeom_isList( mInstance, handle, &result, &err );
01900      is_list = (result != 0);
01901      return (Error)err;
01902 }
01903 
01904 FBiGeom::Error
01905 FBiGeom::getNumEntSets( EntitySetHandle set, int num_hops, int& num_sets_out ) const
01906 {
01907      int err;
01908      FBiGeom_getNumEntSets( mInstance, set, num_hops, &num_sets_out, &err );
01909      return (Error)err;
01910 }
01911 
01912 FBiGeom::Error
01913 FBiGeom::getEntSets( EntitySetHandle set, int num_hops,
01914                    std::vector<EntitySetHandle>& contained_sets_out ) const
01915 {
01916      int err, count;
01917      FBiGeom_getNumEntSets( mInstance, set, num_hops, &count, &err );
01918      if (iBase_SUCCESS != err)
01919           return (Error)err;
01920      contained_sets_out.resize(count);
01921      int alloc = contained_sets_out.size(), size;
01922      EntitySetHandle* ptr = &contained_sets_out[0];
01923      FBiGeom_getEntSets( mInstance, set, num_hops, &ptr, &alloc, &size, &err );
01924      return (Error)err;
01925 }
01926 
01927 FBiGeom::Error
01928 FBiGeom::addEntToSet( EntityHandle entity, EntitySetHandle set )
01929 {
01930      int err;
01931      FBiGeom_addEntToSet( mInstance, entity,set, &err );
01932      return (Error)err;
01933 }
01934 
01935 FBiGeom::Error
01936 FBiGeom::rmvEntFromSet( EntityHandle entity, EntitySetHandle set )
01937 {
01938      int err;
01939      FBiGeom_rmvEntFromSet( mInstance, entity,set, &err );
01940      return (Error)err;
01941 }
01942 
01943 FBiGeom::Error
01944 FBiGeom::addEntArrToSet( const EntityHandle* entity_handles,
01945                        int entity_handles_size,
01946                        EntitySetHandle entity_set )
01947 {
01948      int err;
01949      FBiGeom_addEntArrToSet( mInstance, entity_handles, entity_handles_size, entity_set, &err );
01950      return (Error)err;
01951 }
01952 
01953 FBiGeom::Error
01954 FBiGeom::rmvEntArrFromSet( const EntityHandle* entity_handles,
01955                          int entity_handles_size,
01956                          EntitySetHandle entity_set )
01957 {
01958      int err;
01959      FBiGeom_rmvEntArrFromSet( mInstance, entity_handles, entity_handles_size, entity_set, &err );
01960      return (Error)err;
01961 }
01962 
01963 FBiGeom::Error
01964 FBiGeom::addEntSet( EntitySetHandle to_add, EntitySetHandle add_to )
01965 {
01966      int err;
01967      FBiGeom_addEntSet( mInstance, to_add, add_to, &err );
01968      return (Error)err;
01969 }
01970 
01971 FBiGeom::Error
01972 FBiGeom::rmvEntSet( EntitySetHandle to_rmv, EntitySetHandle rmv_from )
01973 {
01974      int err;
01975      FBiGeom_rmvEntSet( mInstance, to_rmv, rmv_from, &err );
01976      return (Error)err;
01977 }
01978 
01979 FBiGeom::Error
01980 FBiGeom::isEntContained( EntitySetHandle set, EntityHandle ent, bool& contained_out ) const
01981 {
01982      int err, result;
01983      FBiGeom_isEntContained( mInstance, set, ent, &result, &err );
01984      contained_out = (result != 0);
01985      return (Error)err;
01986 }
01987 
01988 FBiGeom::Error
01989 FBiGeom::isEntArrContained( EntitySetHandle containing_set,
01990                           const EntityHandle* entity_handles,
01991                           int num_entity_handles,
01992                           bool* is_contained_out ) const
01993 {
01994      int err, *ptr = 0, alloc = 0, size = 0;
01995      FBiGeom_isEntArrContained( mInstance, containing_set,
01996                               entity_handles, num_entity_handles,
01997                               &ptr, &alloc, &size, &err );
01998      if (iBase_SUCCESS != err)
01999           return (Error)err;
02000      for (int i = 0; i < num_entity_handles; ++i)
02001           is_contained_out[i] = (ptr[i] != 0);
02002      free(ptr);
02003      return iBase_SUCCESS;
02004 }
02005 
02006 FBiGeom::Error
02007 FBiGeom::isEntSetContained( EntitySetHandle containing_set,
02008                           EntitySetHandle contained_set,
02009                           bool& contained_out ) const
02010 {
02011      int err, result;
02012      FBiGeom_isEntSetContained( mInstance, containing_set, contained_set, &result, &err );
02013      contained_out = (result != 0);
02014      return (Error)err;
02015 }
02016 
02017 FBiGeom::Error
02018 FBiGeom::addPrntChld( EntitySetHandle parent, EntitySetHandle child )
02019 {
02020      int err;
02021      FBiGeom_addPrntChld( mInstance, parent, child, &err );
02022      return (Error)err;
02023 }
02024 
02025 FBiGeom::Error
02026 FBiGeom::rmvPrntChld( EntitySetHandle parent, EntitySetHandle child )
02027 {
02028      int err;
02029      FBiGeom_rmvPrntChld( mInstance, parent, child, &err );
02030      return (Error)err;
02031 }
02032 
02033 FBiGeom::Error
02034 FBiGeom::isChildOf( EntitySetHandle parent, EntitySetHandle child, bool& is_child_out ) const
02035 {
02036      int err, result;
02037      FBiGeom_isChildOf( mInstance, parent, child, &result, &err );
02038      is_child_out = (result != 0);
02039      return (Error)err;
02040 }
02041 
02042 FBiGeom::Error
02043 FBiGeom::getNumChld( EntitySetHandle parent, int num_hops, int& num_child_out ) const
02044 {
02045      int err;
02046      FBiGeom_getNumChld( mInstance, parent, num_hops, &num_child_out, &err );
02047      return (Error)err;
02048 }
02049 
02050 FBiGeom::Error
02051 FBiGeom::getNumPrnt( EntitySetHandle child, int num_hops, int& num_parent_out ) const
02052 {
02053      int err;
02054      FBiGeom_getNumPrnt( mInstance, child, num_hops, &num_parent_out, &err );
02055      return (Error)err;
02056 }
02057 
02058 FBiGeom::Error
02059 FBiGeom::getChldn( EntitySetHandle parent, int num_hops,
02060                  std::vector<EntitySetHandle>& children_out ) const
02061 {
02062      int err, count;
02063      FBiGeom_getNumChld( mInstance, parent, num_hops, &count, &err );
02064      if (iBase_SUCCESS != err)
02065           return (Error)err;
02066      children_out.resize(count);
02067      int alloc = children_out.size(), size;
02068      EntitySetHandle* ptr = &children_out[0];
02069      FBiGeom_getEntSets( mInstance, parent, num_hops, &ptr, &alloc, &size, &err );
02070      return (Error)err;
02071 }
02072 
02073 FBiGeom::Error
02074 FBiGeom::getPrnts( EntitySetHandle child, int num_hops,
02075                  std::vector<EntitySetHandle>& parents_out ) const
02076 {
02077      int err, count;
02078      FBiGeom_getNumPrnt( mInstance, child, num_hops, &count, &err );
02079      if (iBase_SUCCESS != err)
02080           return (Error)err;
02081      parents_out.resize(count);
02082      int alloc = parents_out.size(), size;
02083      EntitySetHandle* ptr = &parents_out[0];
02084      FBiGeom_getEntSets( mInstance, child, num_hops, &ptr, &alloc, &size, &err );
02085      return (Error)err;
02086 }
02087 
02088 
02089 FBiGeom::Error
02090 FBiGeom::subtract( EntitySetHandle set1, EntitySetHandle set2,
02091                  EntitySetHandle& result_set_out )
02092 {
02093      int err;
02094      FBiGeom_subtract( mInstance, set1, set1, &result_set_out, &err );
02095      return (Error)err;
02096 }
02097 
02098 FBiGeom::Error
02099 FBiGeom::intersect( EntitySetHandle set1, EntitySetHandle set2,
02100                   EntitySetHandle& result_set_out )
02101 {
02102      int err;
02103      FBiGeom_intersect( mInstance, set1, set1, &result_set_out, &err );
02104      return (Error)err;
02105 }
02106 
02107 FBiGeom::Error
02108 FBiGeom::unite( EntitySetHandle set1, EntitySetHandle set2,
02109               EntitySetHandle& result_set_out )
02110 {
02111      int err;
02112      FBiGeom_unite( mInstance, set1, set1, &result_set_out, &err );
02113      return (Error)err;
02114 }
02115 
02116 
02117 FBiGeom::Error
02118 FBiGeom::createTag( const char* tag_name,
02119                   int tag_num_type_values,
02120                   TagValueType tag_type,
02121                   TagHandle& tag_handle_out )
02122 {
02123      int err;
02124      FBiGeom_createTag( mInstance, tag_name, tag_num_type_values, tag_type,
02125                       &tag_handle_out, &err, strlen(tag_name) );
02126      return (Error)err;
02127 }
02128 
02129 
02130 FBiGeom::Error
02131 FBiGeom::destroyTag( TagHandle tag_handle, bool forced )
02132 {
02133      int err;
02134      FBiGeom_destroyTag( mInstance, tag_handle, forced, &err );
02135      return (Error)err;
02136 }
02137 
02138 FBiGeom::Error
02139 FBiGeom::getTagName( TagHandle tag_handle, std::string& name_out ) const
02140 {
02141      int err;
02142      char buffer[1024];
02143      memset( buffer, 0, sizeof(buffer) );
02144      FBiGeom_getTagName( mInstance, tag_handle, buffer, &err, sizeof(buffer) );
02145      name_out = buffer;
02146      return (Error)err;
02147 }
02148 
02149 FBiGeom::Error
02150 FBiGeom::getTagSizeValues( TagHandle tag_handle, int& size_out ) const
02151 {
02152      int err;
02153      FBiGeom_getTagSizeValues( mInstance, tag_handle, &size_out, &err );
02154      return (Error)err;
02155 }
02156 
02157 FBiGeom::Error
02158 FBiGeom::getTagSizeBytes( TagHandle tag_handle, int& size_out ) const
02159 {
02160      int err;
02161      FBiGeom_getTagSizeBytes( mInstance, tag_handle, &size_out, &err );
02162      return (Error)err;
02163 }
02164 
02165 FBiGeom::Error
02166 FBiGeom::getTagHandle( const char* name, TagHandle& handle_out ) const
02167 {
02168      int err;
02169      FBiGeom_getTagHandle( mInstance, name, &handle_out, &err, strlen(name) );
02170      return (Error)err;
02171 }
02172 
02173 FBiGeom::Error
02174 FBiGeom::getTagType( TagHandle tag_handle, TagValueType& type_out ) const
02175 {
02176      int err, result;
02177      FBiGeom_getTagType( mInstance, tag_handle, &result, &err );
02178      type_out = (TagValueType)result;
02179      return (Error)err;
02180 }
02181 
02182 
02183 FBiGeom::Error
02184 FBiGeom::setEntSetData( EntitySetHandle set_handle,
02185                       TagHandle tag_handle,
02186                       const void* tag_value )
02187 {
02188      int err, size = 1;
02189      FBiGeom_getTagSizeBytes( mInstance, tag_handle, &size, &err );
02190      FBiGeom_setEntSetData( mInstance, set_handle, tag_handle,
02191                           tag_value, size, &err);
02192      return (Error)err;
02193 }
02194 
02195 FBiGeom::Error
02196 FBiGeom::setEntSetIntData( EntitySetHandle set_handle,
02197                          TagHandle tag_handle,
02198                          int value )
02199 {
02200      int err;
02201      FBiGeom_setEntSetIntData( mInstance, set_handle, tag_handle, value, &err );
02202      return (Error)err;
02203 }
02204 
02205 FBiGeom::Error
02206 FBiGeom::setEntSetDblData( EntitySetHandle set_handle,
02207                          TagHandle tag_handle,
02208                          double value )
02209 {
02210      int err;
02211      FBiGeom_setEntSetDblData( mInstance, set_handle, tag_handle, value, &err );
02212      return (Error)err;
02213 }
02214 
02215 FBiGeom::Error
02216 FBiGeom::setEntSetEHData( EntitySetHandle set_handle,
02217                         TagHandle tag_handle,
02218                         EntityHandle value )
02219 
02220 {
02221      int err;
02222      FBiGeom_setEntSetEHData( mInstance, set_handle, tag_handle, value, &err );
02223      return (Error)err;
02224 }
02225 
02226 FBiGeom::Error
02227 FBiGeom::setEntSetESHData( EntitySetHandle set_handle,
02228                          TagHandle tag_handle,
02229                          EntitySetHandle value )
02230 
02231 {
02232      int err;
02233      FBiGeom_setEntSetESHData( mInstance, set_handle, tag_handle, value, &err );
02234      return (Error)err;
02235 }
02236 
02237 FBiGeom::Error
02238 FBiGeom::getEntSetData( EntitySetHandle set_handle,
02239                       TagHandle tag_handle,
02240                       void* tag_value_out ) const
02241 {
02242      int err, alloc = std::numeric_limits<int>::max(), size;
02243      FBiGeom_getEntSetData( mInstance, set_handle, tag_handle,
02244                           &tag_value_out, &alloc, &size, &err);
02245      return (Error)err;
02246 }
02247 
02248 FBiGeom::Error
02249 FBiGeom::getEntSetIntData( EntitySetHandle set_handle,
02250                          TagHandle tag_handle,
02251                          int& value_out ) const
02252 {
02253      int err;
02254      FBiGeom_getEntSetIntData( mInstance, set_handle, tag_handle, &value_out, &err );
02255      return (Error)err;
02256 }
02257 
02258 FBiGeom::Error
02259 FBiGeom::getEntSetDblData( EntitySetHandle set_handle,
02260                          TagHandle tag_handle,
02261                          double& value_out ) const
02262 {
02263      int err;
02264      FBiGeom_getEntSetDblData( mInstance, set_handle, tag_handle, &value_out, &err );
02265      return (Error)err;
02266 }
02267 
02268 FBiGeom::Error
02269 FBiGeom::getEntSetEHData( EntitySetHandle set_handle,
02270                         TagHandle tag_handle,
02271                         EntityHandle& value_out ) const
02272 
02273 {
02274      int err;
02275      FBiGeom_getEntSetEHData( mInstance, set_handle, tag_handle, &value_out, &err );
02276      return (Error)err;
02277 }
02278 
02279 FBiGeom::Error
02280 FBiGeom::getEntSetESHData( EntitySetHandle set_handle,
02281                          TagHandle tag_handle,
02282                          EntitySetHandle& value_out ) const
02283 
02284 {
02285      int err;
02286      FBiGeom_getEntSetESHData( mInstance, set_handle, tag_handle, &value_out, &err );
02287      return (Error)err;
02288 }
02289 
02290 FBiGeom::Error
02291 FBiGeom::getAllEntSetTags( EntitySetHandle set,
02292                          std::vector<TagHandle>& tags_out ) const
02293 {
02294      if (tags_out.capacity() == 0)
02295           tags_out.resize( 32 );
02296      else
02297           tags_out.resize( tags_out.capacity() );
02298 
02299      int err, alloc = tags_out.size(), size = 0;
02300      TagHandle* ptr = &tags_out[0];
02301      FBiGeom_getAllEntSetTags( mInstance, set, &ptr, &alloc, &size, &err );
02302      tags_out.resize(size);
02303 
02304      if (iBase_BAD_ARRAY_DIMENSION == err || iBase_BAD_ARRAY_SIZE == err) {
02305           alloc = tags_out.size();
02306           ptr = &tags_out[0];
02307           FBiGeom_getAllEntSetTags( mInstance, set, &ptr, &alloc, &size, &err );
02308      }
02309 
02310      return (Error)err;
02311 }
02312 
02313 FBiGeom::Error
02314 FBiGeom::getAllTags( EntityHandle entity,
02315                    std::vector<TagHandle>& tags_out ) const
02316 
02317 {
02318      if (tags_out.capacity() == 0)
02319           tags_out.resize( 32 );
02320      else
02321           tags_out.resize( tags_out.capacity() );
02322 
02323      int err, alloc = tags_out.size(), size = 0;
02324      TagHandle* ptr = &tags_out[0];
02325      FBiGeom_getAllTags( mInstance, entity, &ptr, &alloc, &size, &err );
02326      tags_out.resize(size);
02327 
02328      if (iBase_BAD_ARRAY_DIMENSION == err || iBase_BAD_ARRAY_SIZE == err) {
02329           alloc = tags_out.size();
02330           ptr = &tags_out[0];
02331           FBiGeom_getAllTags( mInstance, entity, &ptr, &alloc, &size, &err );
02332      }
02333 
02334      return (Error)err;
02335 }
02336 
02337 FBiGeom::Error
02338 FBiGeom::rmvEntSetTag( EntitySetHandle set, TagHandle tag )
02339 {
02340      int err;
02341      FBiGeom_rmvEntSetTag( mInstance, set, tag, &err );
02342      return (Error)err;
02343 }
02344 
02345 FBiGeom::Error
02346 FBiGeom::rmvTag( EntityHandle entity, TagHandle tag )
02347 {
02348      int err;
02349      FBiGeom_rmvTag( mInstance, entity, tag, &err );
02350      return (Error)err;
02351 }
02352 
02353 FBiGeom::Error
02354 FBiGeom::rmvArrTag( const EntityHandle* handles, int size, TagHandle tag )
02355 {
02356      int err;
02357      FBiGeom_rmvArrTag( mInstance, handles, size, tag, &err );
02358      return (Error)err;
02359 }
02360 
02361 
02362 FBiGeom::Error
02363 FBiGeom::getArrData( const EntityHandle* entity_handles,
02364                    int entity_handles_size,
02365                    TagHandle tag_handle,
02366                    void* tag_values_out ) const
02367 {
02368      int err, alloc = std::numeric_limits<int>::max(), size;
02369      FBiGeom_getArrData( mInstance, entity_handles, entity_handles_size, tag_handle,
02370                        &tag_values_out, &alloc, &size, &err);
02371      return (Error)err;
02372 }
02373 
02374 FBiGeom::Error
02375 FBiGeom::getIntArrData( const EntityHandle* entity_handles,
02376                       int entity_handles_size,
02377                       TagHandle tag_handle,
02378                       int* tag_values_out ) const
02379 {
02380      int err, alloc = std::numeric_limits<int>::max(), size;
02381      FBiGeom_getIntArrData( mInstance, entity_handles, entity_handles_size, tag_handle,
02382                           &tag_values_out, &alloc, &size, &err);
02383      return (Error)err;
02384 }
02385 
02386 FBiGeom::Error FBiGeom::getFacets(EntityHandle entity_handle, double dist_tolerance,
02387                                   std::vector<double> &point, std::vector<int> &facets) const
02388 {
02389      int err=1; //, alloc_f = std::numeric_limits<int>::max(),
02390                         //alloc_p = std::numeric_limits<double>::max(), size_f, size_p;
02391      /*FBiGeom_getFacets(mInstance, entity_handle, dist_tolerance, &point, &alloc_p, &size_p,
02392                      &facets, &alloc_f, &size_f, &err);*/
02393 
02394      return (Error)err;
02395 }
02396 
02397 FBiGeom::Error
02398 FBiGeom::getDblArrData( const EntityHandle* entity_handles,
02399                       int entity_handles_size,
02400                       TagHandle tag_handle,
02401                       double* tag_values_out ) const
02402 {
02403      int err, alloc = std::numeric_limits<int>::max(), size;
02404      FBiGeom_getDblArrData( mInstance, entity_handles, entity_handles_size, tag_handle,
02405                           &tag_values_out, &alloc, &size, &err);
02406      return (Error)err;
02407 }
02408 
02409 FBiGeom::Error
02410 FBiGeom::getEHArrData( const EntityHandle* entity_handles,
02411                      int entity_handles_size,
02412                      TagHandle tag_handle,
02413                      EntityHandle* tag_values_out ) const
02414 
02415 {
02416      int err, alloc = std::numeric_limits<int>::max(), size;
02417      FBiGeom_getEHArrData( mInstance, entity_handles, entity_handles_size, tag_handle,
02418                          &tag_values_out, &alloc, &size, &err);
02419      return (Error)err;
02420 }
02421 
02422 FBiGeom::Error
02423 FBiGeom::getESHArrData( const EntityHandle* entity_handles,
02424                       int entity_handles_size,
02425                       TagHandle tag_handle,
02426                       EntitySetHandle* tag_values_out ) const
02427 
02428 {
02429      int err, alloc = std::numeric_limits<int>::max(), size;
02430      FBiGeom_getESHArrData( mInstance, entity_handles, entity_handles_size, tag_handle,
02431                           &tag_values_out, &alloc, &size, &err);
02432      return (Error)err;
02433 }
02434 
02435 FBiGeom::Error
02436 FBiGeom::setArrData( const EntityHandle* entity_handles,
02437                    int entity_handles_size,
02438                    TagHandle tag_handle,
02439                    const void* tag_values )
02440 {
02441      int err, size = 1;
02442      FBiGeom_getTagSizeBytes( mInstance, tag_handle, &size, &err );
02443      FBiGeom_setArrData( mInstance, entity_handles, entity_handles_size, tag_handle,
02444                        tag_values, size*entity_handles_size,
02445                        &err );
02446      return (Error)err;
02447 }
02448 
02449 FBiGeom::Error
02450 FBiGeom::setIntArrData( const EntityHandle* entity_handles,
02451                       int entity_handles_size,
02452                       TagHandle tag_handle,
02453                       const int* tag_values )
02454 {
02455      int err, size = 1;
02456      FBiGeom_getTagSizeValues( mInstance, tag_handle, &size, &err );
02457      FBiGeom_setIntArrData( mInstance, entity_handles, entity_handles_size, tag_handle,
02458                           tag_values, size*entity_handles_size, &err );
02459      return (Error)err;
02460 }
02461 
02462 FBiGeom::Error
02463 FBiGeom::setDblArrData( const EntityHandle* entity_handles,
02464                       int entity_handles_size,
02465                       TagHandle tag_handle,
02466                       const double* tag_values )
02467 {
02468      int err, size = 1;
02469      FBiGeom_getTagSizeValues( mInstance, tag_handle, &size, &err );
02470      FBiGeom_setDblArrData( mInstance, entity_handles, entity_handles_size, tag_handle,
02471                           tag_values, size*entity_handles_size, &err );
02472      return (Error)err;
02473 }
02474 
02475 FBiGeom::Error
02476 FBiGeom::setEHArrData( const EntityHandle* entity_handles,
02477                      int entity_handles_size,
02478                      TagHandle tag_handle,
02479                      const EntityHandle* tag_values )
02480 {
02481      int err, size = 1;
02482      FBiGeom_getTagSizeValues( mInstance, tag_handle, &size, &err );
02483      FBiGeom_setEHArrData( mInstance, entity_handles, entity_handles_size, tag_handle,
02484                          tag_values, size*entity_handles_size, &err );
02485      return (Error)err;
02486 }
02487 
02488 FBiGeom::Error
02489 FBiGeom::setESHArrData( const EntityHandle* entity_handles,
02490                       int entity_handles_size,
02491                       TagHandle tag_handle,
02492                       const EntitySetHandle* tag_values )
02493 {
02494      int err, size = 1;
02495      FBiGeom_getTagSizeValues( mInstance, tag_handle, &size, &err );
02496      FBiGeom_setESHArrData( mInstance, entity_handles, entity_handles_size, tag_handle,
02497                           tag_values, size*entity_handles_size, &err );
02498      return (Error)err;
02499 }
02500 
02501 
02502 
02503 FBiGeom::Error
02504 FBiGeom::setData( EntityHandle entity_handle,
02505                 TagHandle tag_handle,
02506                 const void* tag_value )
02507 {
02508      int err, size = 1;
02509      FBiGeom_getTagSizeBytes( mInstance, tag_handle, &size, &err );
02510      FBiGeom_setData( mInstance, entity_handle, tag_handle,
02511                     tag_value, size, &err);
02512      return (Error)err;
02513 }
02514 
02515 FBiGeom::Error
02516 FBiGeom::setIntData( EntityHandle entity_handle,
02517                    TagHandle tag_handle,
02518                    int value )
02519 {
02520      int err;
02521      FBiGeom_setIntData( mInstance, entity_handle, tag_handle, value, &err );
02522      return (Error)err;
02523 }
02524 
02525 FBiGeom::Error
02526 FBiGeom::setDblData( EntityHandle entity_handle,
02527                    TagHandle tag_handle,
02528                    double value )
02529 {
02530      int err;
02531      FBiGeom_setDblData( mInstance, entity_handle, tag_handle, value, &err );
02532      return (Error)err;
02533 }
02534 
02535 FBiGeom::Error
02536 FBiGeom::setEHData( EntityHandle entity_handle,
02537                   TagHandle tag_handle,
02538                   EntityHandle value )
02539 
02540 {
02541      int err;
02542      FBiGeom_setEHData( mInstance, entity_handle, tag_handle, value, &err );
02543      return (Error)err;
02544 }
02545 
02546 FBiGeom::Error
02547 FBiGeom::setESHData( EntityHandle entity_handle,
02548                    TagHandle tag_handle,
02549                    EntitySetHandle value )
02550 
02551 {
02552      int err;
02553      FBiGeom_setESHData( mInstance, entity_handle, tag_handle, value, &err );
02554      return (Error)err;
02555 }
02556 
02557 FBiGeom::Error
02558 FBiGeom::getData( EntityHandle entity_handle,
02559                 TagHandle tag_handle,
02560                 void* tag_value_out ) const
02561 {
02562      int err, alloc = std::numeric_limits<int>::max(), size;
02563      FBiGeom_getData( mInstance, entity_handle, tag_handle,
02564                     &tag_value_out, &alloc, &size, &err);
02565      return (Error)err;
02566 }
02567 
02568 FBiGeom::Error
02569 FBiGeom::getIntData( EntityHandle entity_handle,
02570                    TagHandle tag_handle,
02571                    int& value_out ) const
02572 {
02573      int err;
02574      FBiGeom_getIntData( mInstance, entity_handle, tag_handle, &value_out, &err );
02575      return (Error)err;
02576 }
02577 
02578 FBiGeom::Error
02579 FBiGeom::getDblData( EntityHandle entity_handle,
02580                    TagHandle tag_handle,
02581                    double& value_out ) const
02582 {
02583      int err;
02584      FBiGeom_getDblData( mInstance, entity_handle, tag_handle, &value_out, &err );
02585      return (Error)err;
02586 }
02587 
02588 FBiGeom::Error
02589 FBiGeom::getEHData( EntityHandle entity_handle,
02590                   TagHandle tag_handle,
02591                   EntityHandle& value_out ) const
02592 {
02593      int err;
02594      FBiGeom_getEHData( mInstance, entity_handle, tag_handle, &value_out, &err );
02595      return (Error)err;
02596 }
02597 
02598 FBiGeom::Error
02599 FBiGeom::getESHData( EntityHandle entity_handle,
02600                    TagHandle tag_handle,
02601                    EntitySetHandle& value_out ) const
02602 {
02603      int err;
02604      FBiGeom_getESHData( mInstance, entity_handle, tag_handle, &value_out, &err );
02605      return (Error)err;
02606 }
02607 
02608 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines