MOAB: Mesh Oriented datABase  (version 5.4.0)
FBiGeom_MOAB.cpp
Go to the documentation of this file.
00001 #include <iostream>
00002 #include <map>
00003 #include "FBiGeom_MOAB.hpp"
00004 #include "moab/GeomTopoTool.hpp"
00005 #include "moab/OrientedBoxTreeTool.hpp"
00006 #include "moab/CartVect.hpp"
00007 #include "moab/FileOptions.hpp"
00008 #include "MBTagConventions.hpp"
00009 #include <cstdlib>
00010 #include <cstring>
00011 #include <map>
00012 #include <cassert>
00013 
00014 using namespace moab;
00015 
00016 static int compare_no_case1( const char* str1, const char* str2, size_t n )
00017 {
00018     for( size_t i = 1; i != n && *str1 && toupper( *str1 ) == toupper( *str2 ); ++i, ++str1, ++str2 )
00019         ;
00020     return toupper( *str2 ) - toupper( *str1 );
00021 }
00022 // Filter out non-MOAB options and remove the "moab:" prefix
00023 static std::string filter_options1( const char* begin, const char* end )
00024 {
00025     const char* opt_begin = begin;
00026     const char* opt_end   = begin;
00027 
00028     std::string filtered;
00029     bool first = true;
00030 
00031     while( opt_end != end )
00032     {
00033         opt_end = std::find( opt_begin, end, ' ' );
00034 
00035         if( opt_end - opt_begin >= 5 && compare_no_case1( opt_begin, "moab:", 5 ) == 0 )
00036         {
00037             if( !first ) filtered.push_back( ';' );
00038             first = false;
00039             filtered.append( opt_begin + 5, opt_end );
00040         }
00041 
00042         opt_begin = opt_end + 1;
00043     }
00044     return filtered;
00045 }
00046 
00047 bool debug_igeom     = false;
00048 bool Debug_surf_eval = false;
00049 
00050 #define COPY_RANGE( r, vec )                                              \
00051     {                                                                     \
00052         EntityHandle* tmp_ptr = reinterpret_cast< EntityHandle* >( vec ); \
00053         std::copy( ( r ).begin(), ( r ).end(), tmp_ptr );                 \
00054     }
00055 
00056 #define TAG_HANDLE( tagh ) reinterpret_cast< Tag >( tagh )
00057 
00058 #define COPY_DOUBLEVEC( r, vec )                              \
00059     {                                                         \
00060         double* tmp_ptr = reinterpret_cast< double* >( vec ); \
00061         std::copy( ( r ).begin(), ( r ).end(), tmp_ptr );     \
00062     }
00063 
00064 void FBiGeom_getDescription( FBiGeom_Instance instance, char* descr, int descr_len )
00065 {
00066     iMesh_getDescription( IMESH_INSTANCE( instance ), descr, descr_len );
00067 }
00068 
00069 void FBiGeom_getErrorType( FBiGeom_Instance instance, /*out*/ int* error_type )
00070 {
00071     iMesh_getErrorType( IMESH_INSTANCE( instance ), /*out*/ error_type );
00072 }
00073 
00074 void FBiGeom_newGeom( char const* options, FBiGeom_Instance* instance_out, int* err, int options_len )
00075 {
00076 
00077     std::string tmp_options = filter_options1( options, options + options_len );
00078     FileOptions opts( tmp_options.c_str() );
00079     // process some options?
00080 
00081     MBiGeom** mbigeom = reinterpret_cast< MBiGeom** >( instance_out );
00082     *mbigeom          = NULL;
00083     *mbigeom          = new MBiGeom();
00084     *err              = iBase_SUCCESS;
00085 }
00086 
00087 void FBiGeom_dtor( FBiGeom_Instance instance, int* err )
00088 {
00089     MBiGeom** mbigeom = reinterpret_cast< MBiGeom** >( &instance );
00090     if( *mbigeom ) delete *mbigeom;
00091     *err = iBase_SUCCESS;
00092 }
00093 
00094 void FBiGeom_newGeomFromMesh( iMesh_Instance mesh,
00095                               iBase_EntitySetHandle set,
00096                               const char* options,
00097                               FBiGeom_Instance* geom,
00098                               int* err,
00099                               int )
00100 {
00101     MBiMesh* mbimesh           = reinterpret_cast< MBiMesh* >( mesh );
00102     moab::Interface* mbi       = mbimesh->mbImpl;
00103     moab::EntityHandle rootSet = reinterpret_cast< moab::EntityHandle >( set );
00104     moab::GeomTopoTool* gtt    = new moab::GeomTopoTool( mbi, true, rootSet );
00105     bool smooth                = false;  // decide from options
00106     char smth[]                = "SMOOTH;";
00107     const char* res            = strstr( options, smth );
00108     if( res != NULL ) smooth = true;
00109     moab::FBEngine* fbe = new moab::FBEngine( mbi, gtt, smooth );
00110     MBiGeom** mbigeom   = reinterpret_cast< MBiGeom** >( geom );
00111     *mbigeom            = NULL;
00112     *mbigeom            = new MBiGeom( mbimesh, fbe );
00113     // will do now the initialization of the engine;
00114     // heavy duty computation
00115     fbe->Init();
00116     *err = iBase_SUCCESS;
00117 }
00118 // corresponding to constructor 2, from iMesh instance
00119 void FBiGeom_dtor2( FBiGeom_Instance instance, int* err )
00120 {
00121     moab::FBEngine* fbe = FBE_cast( instance );
00122     if( fbe )
00123     {
00124         moab::GeomTopoTool* gtt = fbe->get_gtt();
00125         if( gtt ) delete gtt;
00126         delete fbe;
00127     }
00128     MBiGeom** mbigeom = reinterpret_cast< MBiGeom** >( &instance );
00129     if( *mbigeom ) delete *mbigeom;
00130     *err = iBase_SUCCESS;
00131 }
00132 
00133 void FBiGeom_load( FBiGeom_Instance instance, char const* name, char const* options, int* err, int, int options_len )
00134 {
00135     // first remove option for smooth facetting
00136 
00137     const char smth[] = "SMOOTH;";
00138     bool smooth       = false;
00139     const char* res   = NULL;
00140 
00141     char* reducedOptions = NULL;
00142     bool localReduce     = false;
00143     if( options ) res = strstr( options, smth );
00144     if( res )
00145     {
00146         // extract that option, will not be recognized by our moab/imesh
00147         reducedOptions = new char[options_len - 6];
00148         localReduce    = true;
00149         int preLen     = (int)( res - options );
00150         strncpy( reducedOptions, options, preLen );
00151         int postLen = options_len - 7 - preLen;
00152 
00153         char* tmp = reducedOptions + preLen;
00154 
00155         strncpy( tmp, res + 7, postLen );
00156         reducedOptions[options_len - 7] = 0;
00157         std::cout << reducedOptions << std::endl;
00158         smooth = true;
00159     }
00160     else
00161     {
00162         reducedOptions = const_cast< char* >( options );
00163     }
00164     // load mesh-based geometry
00165     const EntityHandle* file_set = 0;
00166     ErrorCode rval               = MBI->load_file( name, file_set, reducedOptions );CHKERR( rval, "can't load mesh file" );
00167     if( localReduce ) delete[] reducedOptions;
00168 
00169     FBEngine* fbe = FBE_cast( instance );
00170     if( fbe == NULL )
00171     {
00172         *err = iBase_FAILURE;
00173         return;
00174     }
00175     GeomTopoTool* gtt = GETGTT( instance );
00176     if( gtt == NULL )
00177     {
00178         *err = iBase_FAILURE;
00179         return;
00180     }
00181     // keep mesh-based geometries in Range
00182     rval = gtt->find_geomsets();CHKERR( rval, "Failure to find geometry lists." );
00183 
00184     if( smooth ) fbe->set_smooth();  // assumes that initialization did not happen yet
00185 
00186     fbe->Init();  // major computation
00187 
00188     RETURN( iBase_SUCCESS );
00189 }
00190 
00191 void FBiGeom_save( FBiGeom_Instance instance,
00192                    char const* name,
00193                    char const* options,
00194                    int* err,
00195                    int name_len,
00196                    int options_len )
00197 {
00198     iMesh_save( IMESH_INSTANCE( instance ), NULL, name, options, err, name_len, options_len );
00199 }
00200 
00201 void FBiGeom_getRootSet( FBiGeom_Instance instance, iBase_EntitySetHandle* root_set, int* err )
00202 {
00203     EntityHandle modelSet;
00204     ErrorCode rval = FBE_cast( instance )->getRootSet( &modelSet );CHKERR( rval, "can't get root set " );
00205     *root_set = (iBase_EntitySetHandle)modelSet;
00206     RETURN( iBase_SUCCESS );
00207 }
00208 
00209 void FBiGeom_getBoundBox( FBiGeom_Instance instance, double*, double*, double*, double*, double*, double*, int* err )
00210 {
00211     RETURN( iBase_NOT_SUPPORTED );
00212 }
00213 
00214 void FBiGeom_getEntities( FBiGeom_Instance instance,
00215                           iBase_EntitySetHandle set_handle,
00216                           int entity_type,
00217                           iBase_EntityHandle** entity_handles,
00218                           int* entity_handles_allocated,
00219                           int* entity_handles_size,
00220                           int* err )
00221 {
00222 
00223     if( 0 > entity_type || 4 < entity_type )
00224     {
00225         ERROR( iBase_INVALID_ENTITY_TYPE, "Bad entity type." );
00226     }
00227     else /* 0<= entity_type <= 4) */
00228     {
00229         Range gentities;
00230         ErrorCode rval = FBE_cast( instance )->getEntities( (EntityHandle)set_handle, entity_type, gentities );CHKERR( rval, "can't get entities " );
00231         *entity_handles_size = gentities.size();
00232 
00233         CHECK_SIZE( *entity_handles, *entity_handles_allocated, *entity_handles_size, iBase_EntityHandle, NULL );
00234         COPY_RANGE( gentities, *entity_handles );
00235     }
00236 
00237     RETURN( iBase_SUCCESS );
00238 }
00239 
00240 void FBiGeom_getNumOfType( FBiGeom_Instance instance,
00241                            iBase_EntitySetHandle set_handle,
00242                            int entity_type,
00243                            int* num_out,
00244                            int* err )
00245 {
00246     if( 0 > entity_type || 4 < entity_type )
00247     {
00248         ERROR( iBase_INVALID_ENTITY_TYPE, "Bad entity type." );
00249     }
00250     ErrorCode rval = FBE_cast( instance )->getNumOfType( (EntityHandle)set_handle, entity_type, num_out );CHKERR( rval, "can't get number of type " );
00251 
00252     RETURN( iBase_SUCCESS );
00253 }
00254 
00255 void FBiGeom_getEntType( FBiGeom_Instance instance, iBase_EntityHandle entity_handle, int* type, int* err )
00256 {
00257 
00258     ErrorCode rval = FBE_cast( instance )->getEntType( (EntityHandle)entity_handle, type );CHKERR( rval, "can't get entity type " );
00259 
00260     RETURN( iBase_SUCCESS );
00261 }
00262 
00263 void FBiGeom_getArrType( FBiGeom_Instance instance,
00264                          iBase_EntityHandle const* entity_handles,
00265                          int entity_handles_size,
00266                          int** type,
00267                          int* type_allocated,
00268                          int* type_size,
00269                          int* err )
00270 {
00271     CHECK_SIZE( *type, *type_allocated, entity_handles_size, int, NULL );
00272     *type_size = entity_handles_size;
00273 
00274     int tmp_err;
00275 
00276     for( int i = 0; i < entity_handles_size; i++ )
00277     {
00278         FBiGeom_getEntType( instance, entity_handles[i], *type + i, &tmp_err );
00279         if( iBase_SUCCESS != tmp_err )
00280         {
00281             ERROR( tmp_err, "Failed to get entity type in FBiGeom_getArrType." );
00282         }
00283     }
00284 
00285     RETURN( iBase_SUCCESS );
00286 }
00287 
00288 void FBiGeom_getEntAdj( FBiGeom_Instance instance,
00289                         iBase_EntityHandle entity_handle,
00290                         int to_dimension,
00291                         iBase_EntityHandle** adj_entities,
00292                         int* adj_entities_allocated,
00293                         int* adj_entities_size,
00294                         int* err )
00295 {
00296     Range adjs;
00297     EntityHandle this_ent = MBH_cast( entity_handle );
00298 
00299     ErrorCode rval = FBE_cast( instance )->getEntAdj( this_ent, to_dimension, adjs );
00300 
00301     CHKERR( rval, "Failed to get adjacent entities in FBiGeom_getEntAdj." );
00302 
00303     // copy adjacent entities
00304     *adj_entities_size = adjs.size();
00305     CHECK_SIZE( *adj_entities, *adj_entities_allocated, *adj_entities_size, iBase_EntityHandle, NULL );
00306     COPY_RANGE( adjs, *adj_entities );
00307 
00308     RETURN( iBase_SUCCESS );
00309 }
00310 
00311 // I suspect this is wrong
00312 void FBiGeom_getArrAdj( FBiGeom_Instance instance,
00313                         iBase_EntityHandle const* entity_handles,
00314                         int entity_handles_size,
00315                         int requested_entity_type,
00316                         iBase_EntityHandle** adj_entity_handles,
00317                         int* adj_entity_handles_allocated,
00318                         int* adj_entity_handles_size,
00319                         int** offset,
00320                         int* offset_allocated,
00321                         int* offset_size,
00322                         int* err )
00323 {
00324     // check offset array size
00325     Range temp_range, total_range;
00326     CHECK_SIZE( *offset, *offset_allocated, entity_handles_size + 1, int, NULL );
00327     *offset_size = entity_handles_size + 1;
00328 
00329     // get adjacent entities
00330     for( int i = 0; i < entity_handles_size; ++i )
00331     {
00332         ( *offset )[i] = total_range.size();
00333         temp_range.clear();
00334         ErrorCode rval =
00335             FBE_cast( instance )->getEntAdj( MBH_cast( entity_handles[i] ), requested_entity_type, temp_range );CHKERR( rval, "Failed to get adjacent entities in FBiGeom_getArrAdj." );
00336         total_range.merge( temp_range );
00337     }
00338     int nTot                         = total_range.size();
00339     ( *offset )[entity_handles_size] = nTot;
00340 
00341     // copy adjacent entities
00342     CHECK_SIZE( *adj_entity_handles, *adj_entity_handles_allocated, nTot, iBase_EntityHandle, NULL );
00343     COPY_RANGE( total_range, *adj_entity_handles );
00344     *adj_entity_handles_size = nTot;
00345 
00346     RETURN( iBase_SUCCESS );
00347 }
00348 
00349 void FBiGeom_getEnt2ndAdj( FBiGeom_Instance instance,
00350                            iBase_EntityHandle entity_handle,
00351                            int bridge_dimension,
00352                            int to_dimension,
00353                            iBase_EntityHandle** adjacent_entities,
00354                            int* adjacent_entities_allocated,
00355                            int* adjacent_entities_size,
00356                            int* err )
00357 {
00358     Range to_ents, bridge_ents, tmp_ents;
00359     ErrorCode rval = FBE_cast( instance )->getEntAdj( MBH_cast( entity_handle ), bridge_dimension, bridge_ents );
00360 
00361     CHKERR( rval, "Failed to get adjacent entities in FBiGeom_getEnt2ndAdj." );
00362 
00363     Range::iterator iter, jter, kter, end_jter;
00364     Range::iterator end_iter = bridge_ents.end();
00365     for( iter = bridge_ents.begin(); iter != end_iter; ++iter )
00366     {
00367         rval = FBE_cast( instance )->getEntAdj( *iter, to_dimension, tmp_ents );
00368 
00369         CHKERR( rval, "Failed to get adjacent entities in FBiGeom_getEnt2ndAdj." );
00370 
00371         for( jter = tmp_ents.begin(); jter != end_jter; ++jter )
00372         {
00373             if( to_ents.find( *jter ) == to_ents.end() )
00374             {
00375                 to_ents.insert( *jter );
00376             }
00377         }
00378         tmp_ents.clear();
00379     }
00380 
00381     *adjacent_entities_size = to_ents.size();
00382     CHECK_SIZE( *adjacent_entities, *adjacent_entities_allocated, *adjacent_entities_size, iBase_EntityHandle, NULL );
00383     COPY_RANGE( to_ents, *adjacent_entities );
00384 
00385     RETURN( iBase_SUCCESS );
00386 }
00387 
00388 void FBiGeom_getArr2ndAdj( FBiGeom_Instance instance,
00389                            iBase_EntityHandle const*,
00390                            int,
00391                            int,
00392                            int,
00393                            iBase_EntityHandle**,
00394                            int*,
00395                            int*,
00396                            int**,
00397                            int*,
00398                            int*,
00399                            int* err )
00400 {
00401     // not implemented
00402     // who would need this monster, anyway?
00403     RETURN( iBase_NOT_SUPPORTED );
00404 }
00405 
00406 void FBiGeom_isEntAdj( FBiGeom_Instance instance,
00407                        iBase_EntityHandle entity_handle1,
00408                        iBase_EntityHandle entity_handle2,
00409                        int* are_adjacent,
00410                        int* err )
00411 {
00412 
00413     bool adjacent_out;
00414     ErrorCode rval =
00415         FBE_cast( instance )->isEntAdj( MBH_cast( entity_handle1 ), MBH_cast( entity_handle2 ), adjacent_out );CHKERR( rval, "Failed to get adjacent info" );
00416     *are_adjacent = (int)adjacent_out;  // 0 or 1, really
00417 
00418     RETURN( iBase_SUCCESS );
00419 }
00420 
00421 void FBiGeom_isArrAdj( FBiGeom_Instance instance,
00422                        iBase_EntityHandle const* entity_handles_1,
00423                        int entity_handles_1_size,
00424                        iBase_EntityHandle const* entity_handles_2,
00425                        int entity_handles_2_size,
00426                        int** is_adjacent_info,
00427                        int* is_adjacent_info_allocated,
00428                        int* is_adjacent_info_size,
00429                        int* err )
00430 {
00431     int index1 = 0;
00432     int index2 = 0;
00433     size_t index1_step, index2_step;
00434     int count;
00435 
00436     // If either list contains only 1 entry, compare that entry with
00437     // every entry in the other list.
00438     if( entity_handles_1_size == entity_handles_2_size )
00439     {
00440         index1_step = index2_step = 1;
00441         count                     = entity_handles_1_size;
00442     }
00443     else if( entity_handles_1_size == 1 )
00444     {
00445         index1_step = 0;
00446         index2_step = 1;
00447         count       = entity_handles_2_size;
00448     }
00449     else if( entity_handles_2_size == 1 )
00450     {
00451         index1_step = 1;
00452         index2_step = 0;
00453         count       = entity_handles_1_size;
00454     }
00455     else
00456     {
00457         RETURN( iBase_INVALID_ENTITY_COUNT );
00458     }
00459 
00460     CHECK_SIZE( *is_adjacent_info, *is_adjacent_info_allocated, count, int, NULL );
00461 
00462     for( int i = 0; i < count; ++i )
00463     {
00464         FBiGeom_isEntAdj( instance, entity_handles_1[index1], entity_handles_2[index2], &( ( *is_adjacent_info )[i] ),
00465                           err );
00466         FWDERR();
00467 
00468         index1 += index1_step;
00469         index2 += index2_step;
00470     }
00471     // it is now safe to set the size
00472     *is_adjacent_info_size = count;
00473 
00474     RETURN( iBase_SUCCESS );
00475 }
00476 
00477 void FBiGeom_getEntClosestPt( FBiGeom_Instance instance,
00478                               iBase_EntityHandle entity_handle,
00479                               double near_x,
00480                               double near_y,
00481                               double near_z,
00482                               double* on_x,
00483                               double* on_y,
00484                               double* on_z,
00485                               int* err )
00486 {
00487 
00488     ErrorCode rval =
00489         FBE_cast( instance )->getEntClosestPt( MBH_cast( entity_handle ), near_x, near_y, near_z, on_x, on_y, on_z );CHKERR( rval, "Failed to get closest point" );
00490 
00491     RETURN( iBase_SUCCESS );
00492 }
00493 
00494 void FBiGeom_getArrClosestPt( FBiGeom_Instance instance,
00495                               iBase_EntityHandle const* entity_handles,
00496                               int entity_handles_size,
00497                               int storage_order,
00498                               double const* near_coordinates,
00499                               int near_coordinates_size,
00500                               double** on_coordinates,
00501                               int* on_coordinates_allocated,
00502                               int* on_coordinates_size,
00503                               int* err )
00504 {
00505     CHECK_SIZE( *on_coordinates, *on_coordinates_allocated, near_coordinates_size, double, NULL );
00506 
00507     for( int i = 0; i < entity_handles_size; i++ )
00508     {
00509         if( storage_order == iBase_INTERLEAVED )
00510         {
00511             FBiGeom_getEntClosestPt( instance, entity_handles[i], near_coordinates[3 * i], near_coordinates[3 * i + 1],
00512                                      near_coordinates[3 * i + 2], on_coordinates[3 * i], on_coordinates[3 * i + 1],
00513                                      on_coordinates[3 * i + 2], err );
00514         }
00515         else if( storage_order == iBase_BLOCKED )
00516         {
00517             FBiGeom_getEntClosestPt( instance, entity_handles[i], near_coordinates[i],
00518                                      near_coordinates[i + entity_handles_size],
00519                                      near_coordinates[i + 2 * entity_handles_size], on_coordinates[i],
00520                                      on_coordinates[i + entity_handles_size],
00521                                      on_coordinates[i + 2 * entity_handles_size], err );
00522         }
00523         FWDERR();
00524     }
00525     *on_coordinates_size = near_coordinates_size;
00526 
00527     RETURN( iBase_SUCCESS );
00528 }
00529 
00530 void FBiGeom_getEntNrmlXYZ( FBiGeom_Instance instance,
00531                             iBase_EntityHandle entity_handle,
00532                             double x,
00533                             double y,
00534                             double z,
00535                             double* nrml_i,
00536                             double* nrml_j,
00537                             double* nrml_k,
00538                             int* err )
00539 {
00540 
00541     ErrorCode rval = FBE_cast( instance )->getEntNrmlXYZ( MBH_cast( entity_handle ), x, y, z, nrml_i, nrml_j, nrml_k );CHKERR( rval, "Failed to get normal" );
00542     RETURN( iBase_SUCCESS );
00543 }
00544 
00545 void FBiGeom_getArrNrmlXYZ( FBiGeom_Instance instance,
00546                             iBase_EntityHandle const* entity_handles,
00547                             int entity_handles_size,
00548                             int storage_order,
00549                             double const* coordinates,
00550                             int coordinates_size,
00551                             double** normals,
00552                             int* normals_allocated,
00553                             int* normals_size,
00554                             int* err )
00555 {
00556     // set up iteration according to storage order.
00557     // allow either gentity_handles or near_coordinates to contain
00558     // only one value, where that single value is applied for every
00559     // entry in the other list.
00560     size_t index = 0;
00561     size_t coord_step, norm_step = 1, ent_step;
00562     int count;
00563     if( 3 * entity_handles_size == coordinates_size )
00564     {
00565         coord_step = ent_step = 1;
00566         count                 = entity_handles_size;
00567     }
00568     else if( coordinates_size == 3 )
00569     {
00570         coord_step = 0;
00571         ent_step   = 1;
00572         count      = entity_handles_size;
00573     }
00574     else if( entity_handles_size == 1 )
00575     {
00576         coord_step = 1;
00577         ent_step   = 0;
00578         count      = coordinates_size / 3;
00579     }
00580     else
00581     {
00582         ERROR( iBase_INVALID_ENTITY_COUNT, "Mismatched array sizes" );
00583     }
00584 
00585     // check or pre-allocate the coordinate arrays
00586     CHECK_SIZE( *normals, *normals_allocated, 3 * count, double, NULL );
00587 
00588     const double *coord_x, *coord_y, *coord_z;
00589     double *norm_x, *norm_y, *norm_z;
00590     if( storage_order == iBase_BLOCKED )
00591     {
00592         coord_x   = coordinates;
00593         coord_y   = coord_x + coordinates_size / 3;
00594         coord_z   = coord_y + coordinates_size / 3;
00595         norm_x    = *normals;
00596         norm_y    = norm_x + count;
00597         norm_z    = norm_y + count;
00598         norm_step = 1;
00599     }
00600     else
00601     {
00602         storage_order = iBase_INTERLEAVED; /* set if unspecified */
00603         coord_x       = coordinates;
00604         coord_y       = coord_x + 1;
00605         coord_z       = coord_x + 2;
00606         norm_x        = *normals;
00607         norm_y        = norm_x + 1;
00608         norm_z        = norm_x + 2;
00609         coord_step *= 3;
00610         norm_step = 3;
00611     }
00612 
00613     for( int i = 0; i < count; ++i )
00614     {
00615         FBiGeom_getEntNrmlXYZ( instance, entity_handles[index], *coord_x, *coord_y, *coord_z, norm_x, norm_y, norm_z,
00616                                err );
00617         FWDERR();
00618 
00619         index += ent_step;
00620         coord_x += coord_step;
00621         coord_y += coord_step;
00622         coord_z += coord_step;
00623         norm_x += norm_step;
00624         norm_y += norm_step;
00625         norm_z += norm_step;
00626     }
00627     *normals_size = count;
00628     RETURN( iBase_SUCCESS );
00629 }
00630 
00631 void FBiGeom_getEntNrmlPlXYZ( FBiGeom_Instance instance,
00632                               iBase_EntityHandle entity_handle,
00633                               double x,
00634                               double y,
00635                               double z,
00636                               double* pt_x,
00637                               double* pt_y,
00638                               double* pt_z,
00639                               double* nrml_i,
00640                               double* nrml_j,
00641                               double* nrml_k,
00642                               int* err )
00643 {
00644     // just do for surface and volume
00645     int type;
00646     FBiGeom_getEntType( instance, entity_handle, &type, err );
00647     FWDERR();
00648 
00649     if( type != 2 && type != 3 )
00650     {
00651         ERROR( iBase_INVALID_ENTITY_TYPE, "Entities passed into gentityNormal must be face or volume." );
00652     }
00653 
00654     // do 2 searches, so it is not fast enough
00655     FBiGeom_getEntClosestPt( instance, entity_handle, x, y, z, pt_x, pt_y, pt_z, err );
00656 
00657     FWDERR();
00658     FBiGeom_getEntNrmlXYZ( instance, entity_handle, *pt_x, *pt_y, *pt_z, nrml_i, nrml_j, nrml_k, err );
00659     FWDERR();
00660 
00661     RETURN( iBase_SUCCESS );
00662 }
00663 
00664 void FBiGeom_getArrNrmlPlXYZ( FBiGeom_Instance instance,
00665                               iBase_EntityHandle const* entity_handles,
00666                               int entity_handles_size,
00667                               int storage_order,
00668                               double const* near_coordinates,
00669                               int near_coordinates_size,
00670                               double** on_coordinates,
00671                               int* on_coordinates_allocated,
00672                               int* on_coordinates_size,
00673                               double** normals,
00674                               int* normals_allocated,
00675                               int* normals_size,
00676                               int* err )
00677 {
00678     // set up iteration according to storage order.
00679     // allow either gentity_handles or near_coordinates to contain
00680     // only one value, where that single value is applied for every
00681     // entry in the other list.
00682     size_t index = 0;
00683     size_t near_step, on_step = 1, ent_step;
00684     int count;
00685     if( 3 * entity_handles_size == near_coordinates_size )
00686     {
00687         near_step = ent_step = 1;
00688         count                = entity_handles_size;
00689     }
00690     else if( near_coordinates_size == 3 )
00691     {
00692         near_step = 0;
00693         ent_step  = 1;
00694         count     = entity_handles_size;
00695     }
00696     else if( entity_handles_size == 1 )
00697     {
00698         near_step = 1;
00699         ent_step  = 0;
00700         count     = near_coordinates_size / 3;
00701     }
00702     else
00703     {
00704         ERROR( iBase_INVALID_ENTITY_COUNT, "Mismatched array sizes" );
00705     }
00706 
00707     // check or pre-allocate the coordinate arrays
00708     CHECK_SIZE( *on_coordinates, *on_coordinates_allocated, 3 * count, double, NULL );
00709     CHECK_SIZE( *normals, *normals_allocated, 3 * count, double, NULL );
00710 
00711     const double *near_x, *near_y, *near_z;
00712     double *on_x, *on_y, *on_z;
00713     double *norm_x, *norm_y, *norm_z;
00714     if( storage_order == iBase_BLOCKED )
00715     {
00716         near_x  = near_coordinates;
00717         near_y  = near_x + near_coordinates_size / 3;
00718         near_z  = near_y + near_coordinates_size / 3;
00719         on_x    = *on_coordinates;
00720         on_y    = on_x + count;
00721         on_z    = on_y + count;
00722         norm_x  = *normals;
00723         norm_y  = norm_x + count;
00724         norm_z  = norm_y + count;
00725         on_step = 1;
00726     }
00727     else
00728     {
00729         storage_order = iBase_INTERLEAVED; /* set if unspecified */
00730         near_x        = near_coordinates;
00731         near_y        = near_x + 1;
00732         near_z        = near_x + 2;
00733         on_x          = *on_coordinates;
00734         on_y          = on_x + 1;
00735         on_z          = on_x + 2;
00736         norm_x        = *normals;
00737         norm_y        = norm_x + 1;
00738         norm_z        = norm_x + 2;
00739         near_step *= 3;
00740         on_step = 3;
00741     }
00742 
00743     for( int i = 0; i < count; ++i )
00744     {
00745         FBiGeom_getEntNrmlPlXYZ( instance, entity_handles[index], *near_x, *near_y, *near_z, on_x, on_y, on_z, norm_x,
00746                                  norm_y, norm_z, err );
00747         FWDERR();
00748 
00749         // entities += ent_step;
00750         index += ent_step;
00751         near_x += near_step;
00752         near_y += near_step;
00753         near_z += near_step;
00754         on_x += on_step;
00755         on_y += on_step;
00756         on_z += on_step;
00757         norm_x += on_step;
00758         norm_y += on_step;
00759         norm_z += on_step;
00760     }
00761     *on_coordinates_size = count * 3;
00762     *normals_size        = count;
00763     RETURN( iBase_SUCCESS );
00764 }
00765 
00766 void FBiGeom_getEntTgntXYZ( FBiGeom_Instance instance,
00767                             iBase_EntityHandle,
00768                             double,
00769                             double,
00770                             double,
00771                             double*,
00772                             double*,
00773                             double*,
00774                             int* err )
00775 {
00776     RETURN( iBase_NOT_SUPPORTED );
00777 }
00778 
00779 void FBiGeom_getArrTgntXYZ( FBiGeom_Instance instance,
00780                             iBase_EntityHandle const*,
00781                             int,
00782                             int,
00783                             double const*,
00784                             int,
00785                             double**,
00786                             int*,
00787                             int*,
00788                             int* err )
00789 {
00790     RETURN( iBase_NOT_SUPPORTED );
00791 }
00792 
00793 void FBiGeom_getEntBoundBox( FBiGeom_Instance instance,
00794                              iBase_EntityHandle entity_handle,
00795                              double* min_x,
00796                              double* min_y,
00797                              double* min_z,
00798                              double* max_x,
00799                              double* max_y,
00800                              double* max_z,
00801                              int* err )
00802 {
00803     ErrorCode rval;
00804     int type;
00805     FBiGeom_getEntType( instance, entity_handle, &type, err );
00806     FWDERR();
00807 
00808     if( type == 0 )
00809     {
00810         FBiGeom_getVtxCoord( instance, entity_handle, min_x, min_y, min_z, err );
00811         FWDERR();
00812         max_x = min_x;
00813         max_y = min_y;
00814         max_z = min_z;
00815     }
00816     else if( type == 1 )
00817     {
00818         // it could be relatively easy to support
00819         *err = iBase_NOT_SUPPORTED;
00820         FWDERR();
00821     }
00822     else if( type == 2 || type == 3 )
00823     {
00824 
00825         EntityHandle root;
00826         CartVect center, axis[3];
00827         GeomTopoTool* gtt = GETGTT( instance );
00828         if( !gtt ) ERROR( iBase_FAILURE, "Can't get geom topo tool." );
00829         rval = gtt->get_root( MBH_cast( entity_handle ), root );CHKERR( rval, "Failed to get tree root in FBiGeom_getEntBoundBox." );
00830         rval = gtt->obb_tree()->box( root, center.array(), axis[0].array(), axis[1].array(), axis[2].array() );CHKERR( rval, "Failed to get box from obb tree." );
00831 
00832         CartVect absv[3];
00833         for( int i = 0; i < 3; i++ )
00834         {
00835             absv[i] = CartVect( fabs( axis[i][0] ), fabs( axis[i][1] ), fabs( axis[i][2] ) );
00836         }
00837         CartVect min, max;
00838         min    = center - absv[0] - absv[1] - absv[2];
00839         max    = center + absv[0] + absv[1] + absv[2];
00840         *min_x = min[0];
00841         *min_y = min[1];
00842         *min_z = min[2];
00843         *max_x = max[0];
00844         *max_y = max[1];
00845         *max_z = max[2];
00846     }
00847     else
00848         RETURN( iBase_INVALID_ENTITY_TYPE );
00849 
00850     RETURN( iBase_SUCCESS );
00851 }
00852 
00853 void FBiGeom_getArrBoundBox( FBiGeom_Instance instance,
00854                              iBase_EntityHandle const* entity_handles,
00855                              int entity_handles_size,
00856                              int storage_order,
00857                              double** min_corner,
00858                              int* min_corner_allocated,
00859                              int* min_corner_size,
00860                              double** max_corner,
00861                              int* max_corner_allocated,
00862                              int* max_corner_size,
00863                              int* err )
00864 {
00865     // check or pre-allocate the coordinate arrays
00866     CHECK_SIZE( *min_corner, *min_corner_allocated, 3 * entity_handles_size, double, NULL );
00867     CHECK_SIZE( *max_corner, *max_corner_allocated, 3 * entity_handles_size, double, NULL );
00868 
00869     size_t step, init;
00870     if( storage_order == iBase_BLOCKED )
00871     {
00872         step = 1;
00873         init = entity_handles_size;
00874     }
00875     else
00876     {
00877         step = 3;
00878         init = 1;
00879     }
00880     double *min_x, *min_y, *min_z, *max_x, *max_y, *max_z;
00881     min_x = *min_corner;
00882     max_x = *max_corner;
00883     min_y = min_x + init;
00884     max_y = max_x + init;
00885     min_z = min_y + init;
00886     max_z = max_y + init;
00887 
00888     for( int i = 0; i < entity_handles_size; ++i )
00889     {
00890         FBiGeom_getEntBoundBox( instance, entity_handles[i], min_x, min_y, min_z, max_x, max_y, max_z, err );
00891         FWDERR();
00892 
00893         min_x += step;
00894         max_x += step;
00895         min_y += step;
00896         max_y += step;
00897         min_z += step;
00898         max_z += step;
00899     }
00900     *min_corner_size = 3 * entity_handles_size;
00901     *max_corner_size = 3 * entity_handles_size;
00902     RETURN( iBase_SUCCESS );
00903 }
00904 
00905 void FBiGeom_getVtxCoord( FBiGeom_Instance instance,
00906                           iBase_EntityHandle vertex_handle,
00907                           double* x,
00908                           double* y,
00909                           double* z,
00910                           int* err )
00911 {
00912     ErrorCode rval = FBE_cast( instance )->getVtxCoord( MBH_cast( vertex_handle ), x, y, z );CHKERR( rval, "Failed to vertex position" );
00913     RETURN( iBase_SUCCESS );
00914 }
00915 
00916 void FBiGeom_getVtxArrCoords( FBiGeom_Instance instance,
00917                               iBase_EntityHandle const* entity_handles,
00918                               int entity_handles_size,
00919                               int storage_order,
00920                               double** coordinates,
00921                               int* coordinates_allocated,
00922                               int* coordinates_size,
00923                               int* err )
00924 {
00925     // check or pre-allocate the coordinate arrays
00926     CHECK_SIZE( *coordinates, *coordinates_allocated, 3 * entity_handles_size, double, NULL );
00927 
00928     double *x, *y, *z;
00929     size_t step;
00930     if( storage_order == iBase_BLOCKED )
00931     {
00932         x    = *coordinates;
00933         y    = x + entity_handles_size;
00934         z    = y + entity_handles_size;
00935         step = 1;
00936     }
00937     else
00938     {
00939         x    = *coordinates;
00940         y    = x + 1;
00941         z    = x + 2;
00942         step = 3;
00943     }
00944 
00945     for( int i = 0; i < entity_handles_size; i++ )
00946     {
00947         FBiGeom_getVtxCoord( instance, entity_handles[i], x, y, z, err );
00948         x += step;
00949         y += step;
00950         z += step;
00951     }
00952     *coordinates_size = 3 * entity_handles_size;
00953     RETURN( iBase_SUCCESS );
00954 }
00955 
00956 void FBiGeom_getPntRayIntsct( FBiGeom_Instance instance,
00957                               double x,
00958                               double y,
00959                               double z,
00960                               double dir_x,
00961                               double dir_y,
00962                               double dir_z,
00963                               iBase_EntityHandle** intersect_entity_handles,
00964                               int* intersect_entity_handles_allocated,
00965                               int* intersect_entity_handles_size,
00966                               int storage_order,
00967                               double** intersect_coords,
00968                               int* intersect_coords_allocated,
00969                               int* intersect_coords_size,
00970                               double** param_coords,
00971                               int* param_coords_allocated,
00972                               int* param_coords_size,
00973                               int* err )
00974 {
00975     // this is pretty cool
00976     // we will return only surfaces
00977     //
00978     // storage order is ignored
00979     std::vector< EntityHandle > intersect_handles;
00980     std::vector< double > coords;
00981     std::vector< double > params;
00982     ErrorCode rval =
00983         FBE_cast( instance )->getPntRayIntsct( x, y, z, dir_x, dir_y, dir_z, intersect_handles, coords, params );CHKERR( rval, "can't get ray intersections " );
00984     *intersect_entity_handles_size = (int)intersect_handles.size();
00985 
00986     CHECK_SIZE( *intersect_entity_handles, *intersect_entity_handles_allocated, *intersect_entity_handles_size,
00987                 iBase_EntityHandle, NULL );
00988     *intersect_coords_size = 3 * (int)intersect_handles.size();
00989     CHECK_SIZE( *intersect_coords, *intersect_coords_allocated, *intersect_coords_size, double, NULL );
00990     *param_coords_size = (int)intersect_handles.size();
00991     CHECK_SIZE( *param_coords, *param_coords_allocated, *param_coords_size, double, NULL );
00992 
00993     COPY_RANGE( intersect_handles, *intersect_entity_handles );
00994 
00995     COPY_DOUBLEVEC( params, *param_coords );
00996     if( storage_order == iBase_BLOCKED )
00997     {
00998         int sz = (int)intersect_handles.size();
00999         for( int i = 0; i < sz; i++ )
01000         {
01001             *intersect_coords[i]          = coords[3 * i];
01002             *intersect_coords[sz + i]     = coords[3 * i + 1];
01003             *intersect_coords[2 * sz + i] = coords[3 * i + 2];
01004         }
01005     }
01006     else
01007     {
01008         COPY_DOUBLEVEC( coords, *intersect_coords );
01009     }
01010 
01011     RETURN( iBase_SUCCESS );
01012 }
01013 
01014 void FBiGeom_getPntArrRayIntsct( FBiGeom_Instance instance,
01015                                  int,
01016                                  const double*,
01017                                  int,
01018                                  const double*,
01019                                  int,
01020                                  iBase_EntityHandle**,
01021                                  int*,
01022                                  int*,
01023                                  int**,
01024                                  int*,
01025                                  int*,
01026                                  double**,
01027                                  int*,
01028                                  int*,
01029                                  double**,
01030                                  int*,
01031                                  int*,
01032                                  int* err )
01033 {
01034     // not implemented
01035     RETURN( iBase_NOT_SUPPORTED );
01036 }
01037 
01038 void FBiGeom_getEntNrmlSense( FBiGeom_Instance instance,
01039                               iBase_EntityHandle face,
01040                               iBase_EntityHandle region,
01041                               int* sense_out,
01042                               int* err )
01043 {
01044     moab::EntityHandle mbregion = (moab::EntityHandle)region;
01045     moab::EntityHandle mbface   = (moab::EntityHandle)face;
01046     moab::ErrorCode rval        = FBE_cast( instance )->getEgFcSense( mbface, mbregion, *sense_out );CHKERR( rval, "can't get normal sense " );
01047     RETURN( iBase_SUCCESS );
01048 }
01049 void FBiGeom_getArrNrmlSense( FBiGeom_Instance instance,
01050                               iBase_EntityHandle const*,
01051                               int,
01052                               iBase_EntityHandle const*,
01053                               int,
01054                               int**,
01055                               int*,
01056                               int*,
01057                               int* err )
01058 {
01059     // not implemented
01060     RETURN( iBase_NOT_SUPPORTED );
01061 }
01062 
01063 /**\brief Get the sense of an edge with respect to a face
01064  * Get the sense of an edge with respect to a face.  Sense returned is -1, 0, or 1,
01065  * representing "reversed", "both", or "forward".  "both" sense indicates that edge bounds
01066  * the face once with each sense.
01067  * \param edge Edge being queried
01068  * \param face Face being queried
01069  * \param sense_out Sense of edge with respect to face
01070  */
01071 
01072 void FBiGeom_getEgFcSense( FBiGeom_Instance instance,
01073                            iBase_EntityHandle edge,
01074                            iBase_EntityHandle face,
01075                            int* sense_out,
01076                            int* err )
01077 {
01078     // this one is important, for establishing the orientation of the edges in faces
01079     // bummer, I "thought" it is already implemented
01080     // use senses
01081     ErrorCode rval = FBE_cast( instance )->getEgFcSense( MBH_cast( edge ), MBH_cast( face ), *sense_out );
01082 
01083     CHKERR( rval, "Failed to get edge senses in FBiGeom_getEgFcSense." );
01084     RETURN( iBase_SUCCESS );
01085 }
01086 void FBiGeom_getEgFcArrSense( FBiGeom_Instance instance,
01087                               iBase_EntityHandle const*,
01088                               int,
01089                               iBase_EntityHandle const*,
01090                               int,
01091                               int**,
01092                               int*,
01093                               int*,
01094                               int* err )
01095 {
01096     RETURN( iBase_NOT_SUPPORTED );
01097 }
01098 
01099 void FBiGeom_getEgVtxSense( FBiGeom_Instance instance,
01100                             iBase_EntityHandle edge,
01101                             iBase_EntityHandle vertex1,
01102                             iBase_EntityHandle vertex2,
01103                             int* sense_out,
01104                             int* err )
01105 {
01106 
01107     ErrorCode rval =
01108         FBE_cast( instance )->getEgVtxSense( MBH_cast( edge ), MBH_cast( vertex1 ), MBH_cast( vertex2 ), *sense_out );CHKERR( rval, "Failed to get vertex sense wrt edge in FBiGeom_getEgVtxSense" );
01109     RETURN( iBase_SUCCESS );
01110 }
01111 void FBiGeom_getEgVtxArrSense( FBiGeom_Instance instance,
01112                                iBase_EntityHandle const*,
01113                                int,
01114                                iBase_EntityHandle const*,
01115                                int,
01116                                iBase_EntityHandle const*,
01117                                int,
01118                                int**,
01119                                int*,
01120                                int*,
01121                                int* err )
01122 {
01123     RETURN( iBase_NOT_SUPPORTED );
01124 }
01125 
01126 void FBiGeom_measure( FBiGeom_Instance instance,
01127                       iBase_EntityHandle const* entity_handles,
01128                       int entity_handles_size,
01129                       double** measures,
01130                       int* measures_allocated,
01131                       int* measures_size,
01132                       int* err )
01133 {
01134 
01135     CHECK_SIZE( *measures, *measures_allocated, entity_handles_size, double, NULL );
01136     ErrorCode rval = FBE_cast( instance )->measure( (EntityHandle*)( entity_handles ), entity_handles_size, *measures );CHKERR( rval, "Failed to get measures" );
01137     *measures_size = entity_handles_size;
01138     RETURN( iBase_SUCCESS );
01139 }
01140 
01141 void FBiGeom_getFaceType( FBiGeom_Instance instance,
01142                           iBase_EntityHandle,
01143                           char* face_type,
01144                           int* err,
01145                           int* face_type_length )
01146 {
01147     std::string type = "nonplanar";  // for swept faces created with rays between surfaces,
01148                                      // we could actually create planar surfaces; maybe we should
01149                                      // recognize them as such
01150     face_type = new char[type.length() + 1];
01151     strcpy( face_type, type.c_str() );
01152     *face_type_length = type.length() + 1;
01153     RETURN( iBase_SUCCESS );
01154 }
01155 void FBiGeom_getParametric( FBiGeom_Instance instance, int* is_parametric, int* err )
01156 {
01157     *is_parametric = 0;  //(false)
01158     RETURN( iBase_SUCCESS );
01159 }
01160 void FBiGeom_isEntParametric( FBiGeom_Instance instance, iBase_EntityHandle entity_handle, int* parametric, int* err )
01161 {
01162     int type = -1;
01163     FBiGeom_getEntType( instance, entity_handle, &type, err );
01164     if( type == 1 )
01165         *parametric = 1;  // true
01166     else
01167         *parametric = 0;  // false
01168     RETURN( iBase_SUCCESS );
01169 }
01170 void FBiGeom_isArrParametric( FBiGeom_Instance instance, iBase_EntityHandle const*, int, int**, int*, int*, int* err )
01171 {
01172     // not implemented
01173     RETURN( iBase_NOT_SUPPORTED );
01174 }
01175 void FBiGeom_getEntUVtoXYZ( FBiGeom_Instance instance,
01176                             iBase_EntityHandle,
01177                             double,
01178                             double,
01179                             double*,
01180                             double*,
01181                             double*,
01182                             int* err )
01183 {
01184     RETURN( iBase_NOT_SUPPORTED );
01185 }
01186 void FBiGeom_getArrUVtoXYZ( FBiGeom_Instance instance,
01187                             iBase_EntityHandle const*,
01188                             int,
01189                             int,
01190                             double const*,
01191                             int,
01192                             double**,
01193                             int*,
01194                             int*,
01195                             int* err )
01196 {
01197     RETURN( iBase_NOT_SUPPORTED );
01198 }
01199 
01200 void FBiGeom_getEntUtoXYZ( FBiGeom_Instance instance,
01201                            iBase_EntityHandle entity_handle,
01202                            double u,
01203                            double* x,
01204                            double* y,
01205                            double* z,
01206                            int* err )
01207 {
01208     int type;
01209     FBiGeom_getEntType( instance, entity_handle, &type, err );
01210     FWDERR();
01211 
01212     if( type != 1 )  // not edge
01213         RETURN( iBase_NOT_SUPPORTED );
01214 
01215     ErrorCode rval = FBE_cast( instance )->getEntUtoXYZ( (EntityHandle)entity_handle, u, *x, *y, *z );CHKERR( rval, "Failed to get position from parameter" );
01216     RETURN( iBase_SUCCESS );
01217 }
01218 
01219 void FBiGeom_getArrUtoXYZ( FBiGeom_Instance instance,
01220                            iBase_EntityHandle const*,
01221                            int,
01222                            double const*,
01223                            int,
01224                            int,
01225                            double**,
01226                            int*,
01227                            int*,
01228                            int* err )
01229 {
01230     // not implemented
01231     RETURN( iBase_NOT_SUPPORTED );
01232 }
01233 void FBiGeom_getEntXYZtoUV( FBiGeom_Instance instance,
01234                             iBase_EntityHandle,
01235                             double,
01236                             double,
01237                             double,
01238                             double*,
01239                             double*,
01240                             int* err )
01241 {
01242     RETURN( iBase_NOT_SUPPORTED );
01243 }
01244 void FBiGeom_getEntXYZtoU( FBiGeom_Instance instance, iBase_EntityHandle, double, double, double, double*, int* err )
01245 {
01246     RETURN( iBase_NOT_SUPPORTED );
01247 }
01248 void FBiGeom_getArrXYZtoUV( FBiGeom_Instance instance,
01249                             iBase_EntityHandle const*,
01250                             int,
01251                             int,
01252                             double const*,
01253                             int,
01254                             double**,
01255                             int*,
01256                             int*,
01257                             int* err )
01258 {
01259     RETURN( iBase_NOT_SUPPORTED );
01260 }
01261 void FBiGeom_getArrXYZtoU( FBiGeom_Instance instance,
01262                            iBase_EntityHandle const*,
01263                            int,
01264                            int,
01265                            double const*,
01266                            int,
01267                            double**,
01268                            int*,
01269                            int*,
01270                            int* err )
01271 {
01272     RETURN( iBase_NOT_SUPPORTED );
01273 }
01274 void FBiGeom_getEntXYZtoUVHint( FBiGeom_Instance instance,
01275                                 iBase_EntityHandle,
01276                                 double,
01277                                 double,
01278                                 double,
01279                                 double*,
01280                                 double*,
01281                                 int* err )
01282 {
01283     RETURN( iBase_NOT_SUPPORTED );
01284 }
01285 void FBiGeom_getArrXYZtoUVHint( FBiGeom_Instance instance,
01286                                 iBase_EntityHandle const*,
01287                                 int,
01288                                 int,
01289                                 double const*,
01290                                 int,
01291                                 double**,
01292                                 int*,
01293                                 int*,
01294                                 int* err )
01295 {
01296     RETURN( iBase_NOT_SUPPORTED );
01297 }
01298 void FBiGeom_getEntUVRange( FBiGeom_Instance instance,
01299                             iBase_EntityHandle,
01300                             double*,
01301                             double*,
01302                             double*,
01303                             double*,
01304                             int* err )
01305 {
01306     RETURN( iBase_NOT_SUPPORTED );
01307 }
01308 
01309 void FBiGeom_getEntURange( FBiGeom_Instance instance,
01310                            iBase_EntityHandle entity_handle,
01311                            double* u_min,
01312                            double* u_max,
01313                            int* err )
01314 {
01315     ErrorCode rval = FBE_cast( instance )->getEntURange( (EntityHandle)entity_handle, *u_min, *u_max );CHKERR( rval, "Failed to get range" );
01316     RETURN( iBase_SUCCESS );
01317 }
01318 void FBiGeom_getArrUVRange( FBiGeom_Instance instance,
01319                             iBase_EntityHandle const*,
01320                             int,
01321                             int,
01322                             double**,
01323                             int*,
01324                             int*,
01325                             double**,
01326                             int*,
01327                             int*,
01328                             int* err )
01329 {
01330     RETURN( iBase_NOT_SUPPORTED );
01331 }
01332 void FBiGeom_getArrURange( FBiGeom_Instance instance,
01333                            iBase_EntityHandle const*,
01334                            int,
01335                            double**,
01336                            int*,
01337                            int*,
01338                            double**,
01339                            int*,
01340                            int*,
01341                            int* err )
01342 {
01343     RETURN( iBase_NOT_SUPPORTED );
01344 }
01345 void FBiGeom_getEntUtoUV( FBiGeom_Instance instance,
01346                           iBase_EntityHandle,
01347                           iBase_EntityHandle,
01348                           double,
01349                           double*,
01350                           double*,
01351                           int* err )
01352 {
01353     RETURN( iBase_NOT_SUPPORTED );
01354 }
01355 void FBiGeom_getVtxToUV( FBiGeom_Instance instance, iBase_EntityHandle, iBase_EntityHandle, double*, double*, int* err )
01356 {
01357     RETURN( iBase_NOT_SUPPORTED );
01358 }
01359 void FBiGeom_getVtxToU( FBiGeom_Instance instance, iBase_EntityHandle, iBase_EntityHandle, double*, int* err )
01360 {
01361     RETURN( iBase_NOT_SUPPORTED );
01362 }
01363 void FBiGeom_getArrUtoUV( FBiGeom_Instance instance,
01364                           iBase_EntityHandle const*,
01365                           int,
01366                           iBase_EntityHandle const*,
01367                           int,
01368                           double const*,
01369                           int,
01370                           int,
01371                           double**,
01372                           int*,
01373                           int*,
01374                           int* err )
01375 {
01376     RETURN( iBase_NOT_SUPPORTED );
01377 }
01378 void FBiGeom_getVtxArrToUV( FBiGeom_Instance instance,
01379                             iBase_EntityHandle const*,
01380                             int,
01381                             iBase_EntityHandle const*,
01382                             int,
01383                             int,
01384                             double**,
01385                             int*,
01386                             int*,
01387                             int* err )
01388 {
01389     RETURN( iBase_NOT_SUPPORTED );
01390 }
01391 void FBiGeom_getVtxArrToU( FBiGeom_Instance instance,
01392                            iBase_EntityHandle const*,
01393                            int,
01394                            iBase_EntityHandle const*,
01395                            int,
01396                            double**,
01397                            int*,
01398                            int*,
01399                            int* err )
01400 {
01401     RETURN( iBase_NOT_SUPPORTED );
01402 }
01403 void FBiGeom_getEntNrmlUV( FBiGeom_Instance instance,
01404                            iBase_EntityHandle,
01405                            double,
01406                            double,
01407                            double*,
01408                            double*,
01409                            double*,
01410                            int* err )
01411 {
01412     RETURN( iBase_NOT_SUPPORTED );
01413 }
01414 void FBiGeom_getArrNrmlUV( FBiGeom_Instance instance,
01415                            iBase_EntityHandle const*,
01416                            int,
01417                            int,
01418                            double const*,
01419                            int,
01420                            double**,
01421                            int*,
01422                            int*,
01423                            int* err )
01424 {
01425     RETURN( iBase_NOT_SUPPORTED );
01426 }
01427 void FBiGeom_getEntTgntU( FBiGeom_Instance instance,
01428                           iBase_EntityHandle entity_handle,
01429                           double u,
01430                           double* tgnt_i,
01431                           double* tgnt_j,
01432                           double* tgnt_k,
01433                           int* err )
01434 {
01435     ErrorCode rval =
01436         FBE_cast( instance )->getEntTgntU( (moab::EntityHandle)entity_handle, u, *tgnt_i, *tgnt_j, *tgnt_k );CHKERR( rval, "Failed to get tangent from u" );
01437     RETURN( iBase_SUCCESS );
01438 }
01439 void FBiGeom_getArrTgntU( FBiGeom_Instance instance,
01440                           iBase_EntityHandle const*,
01441                           int,
01442                           int,
01443                           double const*,
01444                           int,
01445                           double**,
01446                           int*,
01447                           int*,
01448                           int* err )
01449 {
01450     RETURN( iBase_NOT_SUPPORTED );
01451 }
01452 void FBiGeom_getEnt1stDrvt( FBiGeom_Instance instance,
01453                             iBase_EntityHandle,
01454                             double,
01455                             double,
01456                             double**,
01457                             int*,
01458                             int*,
01459                             double**,
01460                             int*,
01461                             int*,
01462                             int* err )
01463 {
01464     RETURN( iBase_NOT_SUPPORTED );
01465 }
01466 void FBiGeom_getArr1stDrvt( FBiGeom_Instance instance,
01467                             iBase_EntityHandle const*,
01468                             int,
01469                             int,
01470                             double const*,
01471                             int,
01472                             double**,
01473                             int*,
01474                             int*,
01475                             int**,
01476                             int*,
01477                             int*,
01478                             double**,
01479                             int*,
01480                             int*,
01481                             int**,
01482                             int*,
01483                             int*,
01484                             int* err )
01485 {
01486     RETURN( iBase_NOT_SUPPORTED );
01487 }
01488 void FBiGeom_getEnt2ndDrvt( FBiGeom_Instance instance,
01489                             iBase_EntityHandle,
01490                             double,
01491                             double,
01492                             double**,
01493                             int*,
01494                             int*,
01495                             double**,
01496                             int*,
01497                             int*,
01498                             double**,
01499                             int*,
01500                             int*,
01501                             int* err )
01502 {
01503     RETURN( iBase_NOT_SUPPORTED );
01504 }
01505 void FBiGeom_getArr2ndDrvt( FBiGeom_Instance instance,
01506                             iBase_EntityHandle const*,
01507                             int,
01508                             int,
01509                             double const*,
01510                             int,
01511                             double**,
01512                             int*,
01513                             int*,
01514                             int**,
01515                             int*,
01516                             int*,
01517                             double**,
01518                             int*,
01519                             int*,
01520                             int**,
01521                             int*,
01522                             int*,
01523                             double**,
01524                             int*,
01525                             int*,
01526                             int**,
01527                             int*,
01528                             int*,
01529                             int* err )
01530 {
01531     RETURN( iBase_NOT_SUPPORTED );
01532 }
01533 void FBiGeom_getFcCvtrUV( FBiGeom_Instance instance,
01534                           iBase_EntityHandle,
01535                           double,
01536                           double,
01537                           double*,
01538                           double*,
01539                           double*,
01540                           double*,
01541                           double*,
01542                           double*,
01543                           int* err )
01544 {
01545     RETURN( iBase_NOT_SUPPORTED );
01546 }
01547 void FBiGeom_getFcArrCvtrUV( FBiGeom_Instance instance,
01548                              iBase_EntityHandle const*,
01549                              int,
01550                              int,
01551                              double const*,
01552                              int,
01553                              double**,
01554                              int*,
01555                              int*,
01556                              double**,
01557                              int*,
01558                              int*,
01559                              int* err )
01560 {
01561     RETURN( iBase_NOT_SUPPORTED );
01562 }
01563 void FBiGeom_isEntPeriodic( FBiGeom_Instance /*instance*/,
01564                             iBase_EntityHandle /*entity_handle*/,
01565                             int* in_u,
01566                             int* in_v,
01567                             int* err )
01568 {
01569     *in_u = 0;
01570     *in_v = 0;
01571     *err  = 0;
01572     return;
01573 }
01574 void FBiGeom_isArrPeriodic( FBiGeom_Instance instance, iBase_EntityHandle const*, int, int**, int*, int*, int* err )
01575 {
01576     RETURN( iBase_NOT_SUPPORTED );
01577 }
01578 void FBiGeom_isFcDegenerate( FBiGeom_Instance instance, iBase_EntityHandle, int*, int* err )
01579 {
01580     RETURN( iBase_NOT_SUPPORTED );
01581 }
01582 void FBiGeom_isFcArrDegenerate( FBiGeom_Instance instance, iBase_EntityHandle const*, int, int**, int*, int*, int* err )
01583 {
01584     RETURN( iBase_NOT_SUPPORTED );
01585 }
01586 
01587 void FBiGeom_initEntIter( FBiGeom_Instance instance, iBase_EntitySetHandle, int, iBase_EntityIterator*, int* err )
01588 {
01589     RETURN( iBase_NOT_SUPPORTED );
01590 }
01591 
01592 void FBiGeom_initEntArrIter( FBiGeom_Instance instance,
01593                              iBase_EntitySetHandle,
01594                              int,
01595                              int,
01596                              iBase_EntityArrIterator*,
01597                              int* err )
01598 {
01599     RETURN( iBase_NOT_SUPPORTED );
01600 }
01601 
01602 void FBiGeom_getNextEntIter( FBiGeom_Instance instance, iBase_EntityIterator, iBase_EntityHandle*, int*, int* err )
01603 {
01604     RETURN( iBase_NOT_SUPPORTED );
01605 }
01606 
01607 void FBiGeom_getNextEntArrIter( FBiGeom_Instance instance,
01608                                 iBase_EntityArrIterator,
01609                                 iBase_EntityHandle**,
01610                                 int*,
01611                                 int*,
01612                                 int*,
01613                                 int* err )
01614 {
01615     RETURN( iBase_NOT_SUPPORTED );
01616 }
01617 
01618 void FBiGeom_resetEntIter( FBiGeom_Instance instance, iBase_EntityIterator, int* err )
01619 {
01620     RETURN( iBase_NOT_SUPPORTED );
01621 }
01622 
01623 void FBiGeom_resetEntArrIter( FBiGeom_Instance instance, iBase_EntityArrIterator, int* err )
01624 {
01625     RETURN( iBase_NOT_SUPPORTED );
01626 }
01627 
01628 void FBiGeom_endEntIter( FBiGeom_Instance instance, iBase_EntityIterator, int* err )
01629 {
01630     RETURN( iBase_NOT_SUPPORTED );
01631 }
01632 
01633 void FBiGeom_endEntArrIter( FBiGeom_Instance instance, iBase_EntityArrIterator, int* err )
01634 {
01635     RETURN( iBase_NOT_SUPPORTED );
01636 }
01637 
01638 void FBiGeom_copyEnt( FBiGeom_Instance instance, iBase_EntityHandle, iBase_EntityHandle*, int* err )
01639 {
01640     RETURN( iBase_NOT_SUPPORTED );
01641 }
01642 
01643 void FBiGeom_sweepEntAboutAxis( FBiGeom_Instance instance,
01644                                 iBase_EntityHandle,
01645                                 double,
01646                                 double,
01647                                 double,
01648                                 double,
01649                                 iBase_EntityHandle*,
01650                                 int* err )
01651 {
01652     RETURN( iBase_NOT_SUPPORTED );
01653 }
01654 
01655 void FBiGeom_deleteAll( FBiGeom_Instance instance, int* err )
01656 {
01657     // it means deleting some sets from moab db ; is this what we want?
01658     RETURN( iBase_NOT_SUPPORTED );
01659 }
01660 
01661 void FBiGeom_deleteEnt( FBiGeom_Instance instance, iBase_EntityHandle /*entity_handle*/, int* err )
01662 {
01663     RETURN( iBase_NOT_SUPPORTED );
01664 }
01665 
01666 void FBiGeom_createSphere( FBiGeom_Instance instance, double, iBase_EntityHandle*, int* err )
01667 {
01668     RETURN( iBase_NOT_SUPPORTED );
01669 }
01670 
01671 void FBiGeom_createPrism( FBiGeom_Instance instance, double, int, double, double, iBase_EntityHandle*, int* err )
01672 {
01673     RETURN( iBase_NOT_SUPPORTED );
01674 }
01675 
01676 void FBiGeom_createBrick( FBiGeom_Instance instance, double, double, double, iBase_EntityHandle*, int* err )
01677 {
01678     RETURN( iBase_NOT_SUPPORTED );
01679 }
01680 
01681 void FBiGeom_createCylinder( FBiGeom_Instance instance, double, double, double, iBase_EntityHandle*, int* err )
01682 {
01683     RETURN( iBase_NOT_SUPPORTED );
01684 }
01685 
01686 void FBiGeom_createCone( FBiGeom_Instance instance, double, double, double, double, iBase_EntityHandle*, int* err )
01687 {
01688     RETURN( iBase_NOT_SUPPORTED );
01689 }
01690 
01691 void FBiGeom_createTorus( FBiGeom_Instance instance, double, double, iBase_EntityHandle*, int* err )
01692 {
01693     RETURN( iBase_NOT_SUPPORTED );
01694 }
01695 
01696 void FBiGeom_moveEnt( FBiGeom_Instance instance, iBase_EntityHandle, double, double, double, int* err )
01697 {
01698     RETURN( iBase_NOT_SUPPORTED );
01699 }
01700 
01701 void FBiGeom_rotateEnt( FBiGeom_Instance instance, iBase_EntityHandle, double, double, double, double, int* err )
01702 {
01703     RETURN( iBase_NOT_SUPPORTED );
01704 }
01705 
01706 void FBiGeom_reflectEnt( FBiGeom_Instance instance,
01707                          iBase_EntityHandle,
01708                          double,
01709                          double,
01710                          double,
01711                          double,
01712                          double,
01713                          double,
01714                          int* err )
01715 {
01716     RETURN( iBase_NOT_SUPPORTED );
01717 }
01718 
01719 void FBiGeom_scaleEnt( FBiGeom_Instance instance,
01720                        iBase_EntityHandle,
01721                        double,
01722                        double,
01723                        double,
01724                        double,
01725                        double,
01726                        double,
01727                        int* err )
01728 {
01729     RETURN( iBase_NOT_SUPPORTED );
01730 }
01731 
01732 void FBiGeom_uniteEnts( FBiGeom_Instance instance, iBase_EntityHandle const*, int, iBase_EntityHandle*, int* err )
01733 {
01734     RETURN( iBase_NOT_SUPPORTED );
01735 }
01736 
01737 void FBiGeom_subtractEnts( FBiGeom_Instance instance,
01738                            iBase_EntityHandle,
01739                            iBase_EntityHandle,
01740                            iBase_EntityHandle*,
01741                            int* err )
01742 {
01743     RETURN( iBase_NOT_SUPPORTED );
01744 }
01745 
01746 void FBiGeom_intersectEnts( FBiGeom_Instance instance,
01747                             iBase_EntityHandle,
01748                             iBase_EntityHandle,
01749                             iBase_EntityHandle*,
01750                             int* err )
01751 {
01752     RETURN( iBase_NOT_SUPPORTED );
01753 }
01754 
01755 void FBiGeom_sectionEnt( FBiGeom_Instance instance,
01756                          iBase_EntityHandle,
01757                          double,
01758                          double,
01759                          double,
01760                          double,
01761                          int,
01762                          iBase_EntityHandle*,
01763                          int* err )
01764 {
01765     RETURN( iBase_NOT_SUPPORTED );
01766 }
01767 
01768 void FBiGeom_imprintEnts( FBiGeom_Instance instance, iBase_EntityHandle const*, int, int* err )
01769 {
01770     RETURN( iBase_NOT_SUPPORTED );
01771 }
01772 
01773 void FBiGeom_mergeEnts( FBiGeom_Instance instance, iBase_EntityHandle const*, int, double, int* err )
01774 {
01775     RETURN( iBase_NOT_SUPPORTED );
01776 }
01777 // start copy old
01778 
01779 void FBiGeom_createEntSet( FBiGeom_Instance instance, int isList, iBase_EntitySetHandle* entity_set_created, int* err )
01780 {
01781     iMesh_createEntSet( IMESH_INSTANCE( instance ), isList, entity_set_created, err );
01782     FWDERR();
01783 }
01784 
01785 void FBiGeom_destroyEntSet( FBiGeom_Instance instance, iBase_EntitySetHandle, int* err )
01786 {
01787     RETURN( iBase_NOT_SUPPORTED );
01788 }
01789 
01790 void FBiGeom_isList( FBiGeom_Instance instance, iBase_EntitySetHandle, int*, int* err )
01791 {
01792     RETURN( iBase_NOT_SUPPORTED );
01793 }
01794 
01795 void FBiGeom_getNumEntSets( FBiGeom_Instance instance,
01796                             iBase_EntitySetHandle entity_set_handle,
01797                             int /*num_hops*/,
01798                             int* num_sets,
01799                             int* err )
01800 {
01801     //  here, we get only the entity sets that have gents as members
01802     // we have the convention that entity sets of geom dimension 4 are
01803     // sets of geo entities; they should contain only gentities as elements (or other sets of gents)
01804     // we should also consider the number of hops
01805     // first, get all sets of geo dim 4 from the entity_set_handle; then intersect with
01806     // the range from geom topo tool
01807     Tag geomTag;
01808     ErrorCode rval = MBI->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER, geomTag );
01809     if( MB_SUCCESS != rval ) RETURN( iBase_FAILURE );
01810     GeomTopoTool* gtt   = GETGTT( instance );
01811     const Range* gRange = gtt->geoRanges();
01812     // get all sets of geom dimension 4 from the entity set
01813     EntityHandle moabSet         = (EntityHandle)entity_set_handle;
01814     const int four               = 4;
01815     const void* const four_val[] = { &four };
01816     Range tmp;
01817     rval = MBI->get_entities_by_type_and_tag( moabSet, MBENTITYSET, &geomTag, four_val, 1, tmp );CHKERR( rval, "can't get sets of geo dim 4 " );
01818     tmp       = intersect( tmp, gRange[4] );
01819     *num_sets = tmp.size();  // ignore, for the time being, number of hops
01820 
01821     RETURN( iBase_SUCCESS );
01822 }
01823 
01824 void FBiGeom_getEntSets( FBiGeom_Instance instance,
01825                          iBase_EntitySetHandle entity_set_handle,
01826                          int,
01827                          iBase_EntitySetHandle** contained_set_handles,
01828                          int* contained_set_handles_allocated,
01829                          int* contained_set_handles_size,
01830                          int* err )
01831 {
01832     //  we get only the entity sets that have gents as members
01833     // we keep the convention that entity sets of geom dimension 4 are
01834     // sets of geo entities; they should contain only gentities as elements (or other sets of gents)
01835     Tag geomTag;
01836     ErrorCode rval = MBI->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER, geomTag );
01837     if( MB_SUCCESS != rval ) RETURN( iBase_FAILURE );
01838     GeomTopoTool* gtt   = GETGTT( instance );
01839     const Range* gRange = gtt->geoRanges();
01840     // get all sets of geom dimension 4 from the entity set
01841     EntityHandle moabSet         = (EntityHandle)entity_set_handle;
01842     const int four               = 4;
01843     const void* const four_val[] = { &four };
01844     Range tmp;
01845     rval = MBI->get_entities_by_type_and_tag( moabSet, MBENTITYSET, &geomTag, four_val, 1, tmp );CHKERR( rval, "can't get sets of geo dim 4 " );
01846     tmp                         = intersect( tmp, gRange[4] );
01847     *contained_set_handles_size = tmp.size();
01848     CHECK_SIZE( *contained_set_handles, *contained_set_handles_allocated, *contained_set_handles_size,
01849                 iBase_EntitySetHandle, NULL );
01850     COPY_RANGE( tmp, *contained_set_handles );
01851 
01852     RETURN( iBase_SUCCESS );
01853 }
01854 
01855 void FBiGeom_addEntToSet( FBiGeom_Instance instance,
01856                           iBase_EntityHandle entity_handle,
01857                           iBase_EntitySetHandle entity_set,
01858                           int* err )
01859 {
01860     iMesh_addEntToSet( IMESH_INSTANCE( instance ), entity_handle, entity_set, err );
01861 }
01862 
01863 void FBiGeom_rmvEntFromSet( FBiGeom_Instance instance,
01864                             iBase_EntityHandle entity_handle,
01865                             iBase_EntitySetHandle entity_set,
01866                             int* err )
01867 {
01868     iMesh_rmvEntFromSet( IMESH_INSTANCE( instance ), entity_handle, entity_set, err );
01869 }
01870 
01871 void FBiGeom_addEntArrToSet( FBiGeom_Instance instance,
01872                              const iBase_EntityHandle* entity_handles,
01873                              int entity_handles_size,
01874                              iBase_EntitySetHandle entity_set,
01875                              int* err )
01876 {
01877     iMesh_addEntArrToSet( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, entity_set, err );
01878 }
01879 
01880 void FBiGeom_rmvEntArrFromSet( FBiGeom_Instance instance,
01881                                const iBase_EntityHandle* entity_handles,
01882                                int entity_handles_size,
01883                                iBase_EntitySetHandle entity_set,
01884                                int* err )
01885 {
01886     iMesh_rmvEntArrFromSet( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, entity_set, err );
01887 }
01888 
01889 void FBiGeom_addEntSet( FBiGeom_Instance instance,
01890                         iBase_EntitySetHandle entity_set_to_add,
01891                         iBase_EntitySetHandle entity_set_handle,
01892                         int* err )
01893 {
01894     iMesh_addEntSet( IMESH_INSTANCE( instance ), entity_set_to_add, entity_set_handle, err );
01895 }
01896 
01897 void FBiGeom_rmvEntSet( FBiGeom_Instance instance,
01898                         iBase_EntitySetHandle entity_set_to_remove,
01899                         iBase_EntitySetHandle entity_set_handle,
01900                         int* err )
01901 {
01902     iMesh_rmvEntSet( IMESH_INSTANCE( instance ), entity_set_to_remove, entity_set_handle, err );
01903 }
01904 
01905 void FBiGeom_isEntContained( FBiGeom_Instance instance,
01906                              iBase_EntitySetHandle containing_entity_set,
01907                              iBase_EntityHandle contained_entity,
01908                              int* is_contained,
01909                              int* err )
01910 {
01911     iMesh_isEntContained( IMESH_INSTANCE( instance ), containing_entity_set, contained_entity, is_contained, err );
01912 }
01913 
01914 void FBiGeom_isEntArrContained( FBiGeom_Instance instance,
01915                                 iBase_EntitySetHandle containing_set,
01916                                 const iBase_EntityHandle* entity_handles,
01917                                 int num_entity_handles,
01918                                 int** is_contained,
01919                                 int* is_contained_allocated,
01920                                 int* is_contained_size,
01921                                 int* err )
01922 {
01923     iMesh_isEntArrContained( IMESH_INSTANCE( instance ), containing_set, entity_handles, num_entity_handles,
01924                              is_contained, is_contained_allocated, is_contained_size, err );
01925 }
01926 
01927 void FBiGeom_isEntSetContained( FBiGeom_Instance instance,
01928                                 iBase_EntitySetHandle containing_entity_set,
01929                                 iBase_EntitySetHandle contained_entity_set,
01930                                 int* is_contained,
01931                                 int* err )
01932 {
01933     iMesh_isEntSetContained( IMESH_INSTANCE( instance ), containing_entity_set, contained_entity_set, is_contained,
01934                              err );
01935 }
01936 
01937 void FBiGeom_addPrntChld( FBiGeom_Instance instance,
01938                           iBase_EntitySetHandle parent_entity_set,
01939                           iBase_EntitySetHandle child_entity_set,
01940                           int* err )
01941 {
01942     iMesh_addPrntChld( IMESH_INSTANCE( instance ), parent_entity_set, child_entity_set, err );
01943 }
01944 
01945 void FBiGeom_rmvPrntChld( FBiGeom_Instance instance,
01946                           iBase_EntitySetHandle parent_entity_set,
01947                           iBase_EntitySetHandle child_entity_set,
01948                           int* err )
01949 {
01950     iMesh_rmvPrntChld( IMESH_INSTANCE( instance ), parent_entity_set, child_entity_set, err );
01951 }
01952 
01953 void FBiGeom_isChildOf( FBiGeom_Instance instance,
01954                         iBase_EntitySetHandle parent_entity_set,
01955                         iBase_EntitySetHandle child_entity_set,
01956                         int* is_child,
01957                         int* err )
01958 {
01959     iMesh_isChildOf( IMESH_INSTANCE( instance ), parent_entity_set, child_entity_set, is_child, err );
01960 }
01961 
01962 void FBiGeom_getNumChld( FBiGeom_Instance instance,
01963                          iBase_EntitySetHandle entity_set,
01964                          int num_hops,
01965                          int* num_child,
01966                          int* err )
01967 {
01968     iMesh_getNumChld( IMESH_INSTANCE( instance ), entity_set, num_hops, num_child, err );
01969 }
01970 
01971 void FBiGeom_getNumPrnt( FBiGeom_Instance instance,
01972                          iBase_EntitySetHandle entity_set,
01973                          int num_hops,
01974                          int* num_parent,
01975                          int* err )
01976 {
01977     iMesh_getNumPrnt( IMESH_INSTANCE( instance ), entity_set, num_hops, num_parent, err );
01978 }
01979 
01980 void FBiGeom_getChldn( FBiGeom_Instance instance,
01981                        iBase_EntitySetHandle from_entity_set,
01982                        int num_hops,
01983                        iBase_EntitySetHandle** entity_set_handles,
01984                        int* entity_set_handles_allocated,
01985                        int* entity_set_handles_size,
01986                        int* err )
01987 {
01988     iMesh_getChldn( IMESH_INSTANCE( instance ), from_entity_set, num_hops, entity_set_handles,
01989                     entity_set_handles_allocated, entity_set_handles_size, err );
01990 }
01991 
01992 void FBiGeom_getPrnts( FBiGeom_Instance instance,
01993                        iBase_EntitySetHandle from_entity_set,
01994                        int num_hops,
01995                        iBase_EntitySetHandle** entity_set_handles,
01996                        int* entity_set_handles_allocated,
01997                        int* entity_set_handles_size,
01998                        int* err )
01999 {
02000     iMesh_getPrnts( IMESH_INSTANCE( instance ), from_entity_set, num_hops, entity_set_handles,
02001                     entity_set_handles_allocated, entity_set_handles_size, err );
02002 }
02003 
02004 void FBiGeom_createTag( FBiGeom_Instance instance,
02005                         const char* tag_name,
02006                         int tag_size,
02007                         int tag_type,
02008                         iBase_TagHandle* tag_handle,
02009                         int* err,
02010                         int tag_name_len )
02011 {
02012 
02013     iMesh_createTag( IMESH_INSTANCE( instance ), tag_name, tag_size, tag_type, tag_handle, err, tag_name_len );
02014 }
02015 
02016 void FBiGeom_destroyTag( FBiGeom_Instance instance, iBase_TagHandle tag_handle, int, int* err )
02017 {
02018     ErrorCode rval = MBI->tag_delete( TAG_HANDLE( tag_handle ) );CHKERR( rval, "Failed to delete tag" );
02019     RETURN( iBase_SUCCESS );
02020 }
02021 
02022 void FBiGeom_getTagName( FBiGeom_Instance instance, iBase_TagHandle tag_handle, char* name, int* err, int name_len )
02023 {
02024     iMesh_getTagName( IMESH_INSTANCE( instance ), tag_handle, name, err, name_len );
02025 }
02026 
02027 void FBiGeom_getTagSizeValues( FBiGeom_Instance instance, iBase_TagHandle tag_handle, int* tag_size, int* err )
02028 {
02029     iMesh_getTagSizeValues( IMESH_INSTANCE( instance ), tag_handle, tag_size, err );
02030 }
02031 
02032 void FBiGeom_getTagSizeBytes( FBiGeom_Instance instance, iBase_TagHandle tag_handle, int* tag_size, int* err )
02033 {
02034     iMesh_getTagSizeBytes( IMESH_INSTANCE( instance ), tag_handle, tag_size, err );
02035 }
02036 
02037 void FBiGeom_getTagHandle( FBiGeom_Instance instance,
02038                            const char* tag_name,
02039                            iBase_TagHandle* tag_handle,
02040                            int* err,
02041                            int tag_name_len )
02042 {
02043     iMesh_getTagHandle( IMESH_INSTANCE( instance ), tag_name, tag_handle, err, tag_name_len );
02044 }
02045 
02046 void FBiGeom_getTagType( FBiGeom_Instance instance, iBase_TagHandle tag_handle, int* tag_type, int* err )
02047 {
02048     iMesh_getTagType( IMESH_INSTANCE( instance ), tag_handle, tag_type, err );
02049 }
02050 
02051 void FBiGeom_setEntSetData( FBiGeom_Instance instance,
02052                             iBase_EntitySetHandle entity_set_handle,
02053                             iBase_TagHandle tag_handle,
02054                             const void* tag_value,
02055                             int tag_value_size,
02056                             int* err )
02057 {
02058     iMesh_setEntSetData( IMESH_INSTANCE( instance ), entity_set_handle, tag_handle, tag_value, tag_value_size, err );
02059 }
02060 
02061 void FBiGeom_setEntSetIntData( FBiGeom_Instance instance,
02062                                iBase_EntitySetHandle entity_set,
02063                                iBase_TagHandle tag_handle,
02064                                int tag_value,
02065                                int* err )
02066 {
02067     iMesh_setEntSetIntData( IMESH_INSTANCE( instance ), entity_set, tag_handle, tag_value, err );
02068 }
02069 
02070 void FBiGeom_setEntSetDblData( FBiGeom_Instance instance,
02071                                iBase_EntitySetHandle entity_set,
02072                                iBase_TagHandle tag_handle,
02073                                double tag_value,
02074                                int* err )
02075 {
02076     iMesh_setEntSetDblData( IMESH_INSTANCE( instance ), entity_set, tag_handle, tag_value, err );
02077 }
02078 
02079 void FBiGeom_setEntSetEHData( FBiGeom_Instance instance,
02080                               iBase_EntitySetHandle entity_set,
02081                               iBase_TagHandle tag_handle,
02082                               iBase_EntityHandle tag_value,
02083                               int* err )
02084 {
02085     iMesh_setEntSetEHData( IMESH_INSTANCE( instance ), entity_set, tag_handle, tag_value, err );
02086 }
02087 
02088 void FBiGeom_setEntSetESHData( FBiGeom_Instance instance,
02089                                iBase_EntitySetHandle entity_set,
02090                                iBase_TagHandle tag_handle,
02091                                iBase_EntitySetHandle tag_value,
02092                                int* err )
02093 {
02094     iMesh_setEntSetESHData( IMESH_INSTANCE( instance ), entity_set, tag_handle, tag_value, err );
02095 }
02096 
02097 void FBiGeom_getEntSetData( FBiGeom_Instance instance,
02098                             iBase_EntitySetHandle entity_set_handle,
02099                             iBase_TagHandle tag_handle,
02100                             void** tag_value,
02101                             int* tag_value_allocated,
02102                             int* tag_value_size,
02103                             int* err )
02104 {
02105     iMesh_getEntSetData( IMESH_INSTANCE( instance ), entity_set_handle, tag_handle, tag_value, tag_value_allocated,
02106                          tag_value_size, err );
02107 }
02108 
02109 void FBiGeom_getEntSetIntData( FBiGeom_Instance instance,
02110                                iBase_EntitySetHandle entity_set,
02111                                iBase_TagHandle tag_handle,
02112                                int* out_data,
02113                                int* err )
02114 {
02115     iMesh_getEntSetIntData( IMESH_INSTANCE( instance ), entity_set, tag_handle, out_data, err );
02116 }
02117 
02118 void FBiGeom_getEntSetDblData( FBiGeom_Instance instance,
02119                                iBase_EntitySetHandle entity_set,
02120                                iBase_TagHandle tag_handle,
02121                                double* out_data,
02122                                int* err )
02123 {
02124     iMesh_getEntSetDblData( IMESH_INSTANCE( instance ), entity_set, tag_handle, out_data, err );
02125 }
02126 
02127 void FBiGeom_getEntSetEHData( FBiGeom_Instance instance,
02128                               iBase_EntitySetHandle entity_set,
02129                               iBase_TagHandle tag_handle,
02130                               iBase_EntityHandle* out_data,
02131                               int* err )
02132 {
02133     iMesh_getEntSetEHData( IMESH_INSTANCE( instance ), entity_set, tag_handle, out_data, err );
02134 }
02135 
02136 void FBiGeom_getEntSetESHData( FBiGeom_Instance instance,
02137                                iBase_EntitySetHandle entity_set,
02138                                iBase_TagHandle tag_handle,
02139                                iBase_EntitySetHandle* out_data,
02140                                int* err )
02141 {
02142     iMesh_getEntSetESHData( IMESH_INSTANCE( instance ), entity_set, tag_handle, out_data, err );
02143 }
02144 
02145 void FBiGeom_getAllEntSetTags( FBiGeom_Instance instance,
02146                                iBase_EntitySetHandle entity_set_handle,
02147                                iBase_TagHandle** tag_handles,
02148                                int* tag_handles_allocated,
02149                                int* tag_handles_size,
02150                                int* err )
02151 {
02152     iMesh_getAllEntSetTags( IMESH_INSTANCE( instance ), entity_set_handle, tag_handles, tag_handles_allocated,
02153                             tag_handles_size, err );
02154 }
02155 
02156 void FBiGeom_rmvEntSetTag( FBiGeom_Instance instance,
02157                            iBase_EntitySetHandle entity_set_handle,
02158                            iBase_TagHandle tag_handle,
02159                            int* err )
02160 {
02161     iMesh_rmvEntSetTag( IMESH_INSTANCE( instance ), entity_set_handle, tag_handle, err );
02162 }
02163 
02164 void FBiGeom_getArrData( FBiGeom_Instance instance,
02165                          const iBase_EntityHandle* entity_handles,
02166                          int entity_handles_size,
02167                          iBase_TagHandle tag_handle,
02168                          void** tag_values,
02169                          int* tag_values_allocated,
02170                          int* tag_values_size,
02171                          int* err )
02172 {
02173     iMesh_getArrData( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, tag_handle, tag_values,
02174                       tag_values_allocated, tag_values_size, err );
02175 }
02176 
02177 void FBiGeom_getIntArrData( FBiGeom_Instance instance,
02178                             const iBase_EntityHandle* entity_handles,
02179                             int entity_handles_size,
02180                             iBase_TagHandle tag_handle,
02181                             int** tag_values,
02182                             int* tag_values_allocated,
02183                             int* tag_values_size,
02184                             int* err )
02185 {
02186     iMesh_getIntArrData( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, tag_handle, tag_values,
02187                          tag_values_allocated, tag_values_size, err );
02188 }
02189 
02190 void FBiGeom_getDblArrData( FBiGeom_Instance instance,
02191                             const iBase_EntityHandle* entity_handles,
02192                             int entity_handles_size,
02193                             iBase_TagHandle tag_handle,
02194                             double** tag_values,
02195                             int* tag_values_allocated,
02196                             int* tag_values_size,
02197                             int* err )
02198 {
02199     iMesh_getDblArrData( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, tag_handle, tag_values,
02200                          tag_values_allocated, tag_values_size, err );
02201 }
02202 
02203 void FBiGeom_getEHArrData( FBiGeom_Instance instance,
02204                            const iBase_EntityHandle* entity_handles,
02205                            int entity_handles_size,
02206                            iBase_TagHandle tag_handle,
02207                            iBase_EntityHandle** tag_value,
02208                            int* tag_value_allocated,
02209                            int* tag_value_size,
02210                            int* err )
02211 {
02212     iMesh_getEHArrData( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, tag_handle, tag_value,
02213                         tag_value_allocated, tag_value_size, err );
02214 }
02215 
02216 void FBiGeom_getESHArrData( FBiGeom_Instance instance,
02217                             const iBase_EntityHandle* entity_handles,
02218                             int entity_handles_size,
02219                             iBase_TagHandle tag_handle,
02220                             iBase_EntitySetHandle** tag_value,
02221                             int* tag_value_allocated,
02222                             int* tag_value_size,
02223                             int* err )
02224 {
02225     iMesh_getESHArrData( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, tag_handle, tag_value,
02226                          tag_value_allocated, tag_value_size, err );
02227 }
02228 
02229 void FBiGeom_setArrData( FBiGeom_Instance instance,
02230                          const iBase_EntityHandle* entity_handles,
02231                          int entity_handles_size,
02232                          iBase_TagHandle tag_handle,
02233                          const void* tag_values,
02234                          int tag_values_size,
02235                          int* err )
02236 {
02237     iMesh_setArrData( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, tag_handle, tag_values,
02238                       tag_values_size, err );
02239 }
02240 
02241 void FBiGeom_setIntArrData( FBiGeom_Instance instance,
02242                             const iBase_EntityHandle* entity_handles,
02243                             int entity_handles_size,
02244                             iBase_TagHandle tag_handle,
02245                             const int* tag_values,
02246                             int tag_values_size,
02247                             int* err )
02248 {
02249     iMesh_setIntArrData( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, tag_handle, tag_values,
02250                          tag_values_size, err );
02251 }
02252 
02253 void FBiGeom_setDblArrData( FBiGeom_Instance instance,
02254                             const iBase_EntityHandle* entity_handles,
02255                             int entity_handles_size,
02256                             iBase_TagHandle tag_handle,
02257                             const double* tag_values,
02258                             const int tag_values_size,
02259                             int* err )
02260 {
02261     iMesh_setDblArrData( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, tag_handle, tag_values,
02262                          tag_values_size, err );
02263 }
02264 
02265 void FBiGeom_setEHArrData( FBiGeom_Instance instance,
02266                            const iBase_EntityHandle* entity_handles,
02267                            int entity_handles_size,
02268                            iBase_TagHandle tag_handle,
02269                            const iBase_EntityHandle* tag_values,
02270                            int tag_values_size,
02271                            int* err )
02272 {
02273     iMesh_setEHArrData( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, tag_handle, tag_values,
02274                         tag_values_size, err );
02275 }
02276 
02277 void FBiGeom_setESHArrData( FBiGeom_Instance instance,
02278                             const iBase_EntityHandle* entity_handles,
02279                             int entity_handles_size,
02280                             iBase_TagHandle tag_handle,
02281                             const iBase_EntitySetHandle* tag_values,
02282                             int tag_values_size,
02283                             int* err )
02284 {
02285     iMesh_setESHArrData( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, tag_handle, tag_values,
02286                          tag_values_size, err );
02287 }
02288 
02289 void FBiGeom_rmvArrTag( FBiGeom_Instance instance,
02290                         const iBase_EntityHandle* entity_handles,
02291                         int entity_handles_size,
02292                         iBase_TagHandle tag_handle,
02293                         int* err )
02294 {
02295     iMesh_rmvArrTag( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, tag_handle, err );
02296 }
02297 
02298 void FBiGeom_getData( FBiGeom_Instance instance,
02299                       iBase_EntityHandle entity_handle,
02300                       iBase_TagHandle tag_handle,
02301                       void** tag_value,
02302                       int* tag_value_allocated,
02303                       int* tag_value_size,
02304                       int* err )
02305 {
02306     iMesh_getData( IMESH_INSTANCE( instance ), entity_handle, tag_handle, tag_value, tag_value_allocated,
02307                    tag_value_size, err );
02308 }
02309 
02310 void FBiGeom_getIntData( FBiGeom_Instance instance,
02311                          iBase_EntityHandle entity_handle,
02312                          iBase_TagHandle tag_handle,
02313                          int* out_data,
02314                          int* err )
02315 {
02316     iMesh_getIntData( IMESH_INSTANCE( instance ), entity_handle, tag_handle, out_data, err );
02317 }
02318 
02319 void FBiGeom_getDblData( FBiGeom_Instance instance,
02320                          const iBase_EntityHandle entity_handle,
02321                          const iBase_TagHandle tag_handle,
02322                          double* out_data,
02323                          int* err )
02324 {
02325     iMesh_getDblData( IMESH_INSTANCE( instance ), entity_handle, tag_handle, out_data, err );
02326 }
02327 
02328 void FBiGeom_getEHData( FBiGeom_Instance instance,
02329                         iBase_EntityHandle entity_handle,
02330                         iBase_TagHandle tag_handle,
02331                         iBase_EntityHandle* out_data,
02332                         int* err )
02333 {
02334     iMesh_getEHData( IMESH_INSTANCE( instance ), entity_handle, tag_handle, out_data, err );
02335 }
02336 
02337 void FBiGeom_getESHData( FBiGeom_Instance instance,
02338                          iBase_EntityHandle entity_handle,
02339                          iBase_TagHandle tag_handle,
02340                          iBase_EntitySetHandle* out_data,
02341                          int* err )
02342 {
02343     iMesh_getESHData( IMESH_INSTANCE( instance ), entity_handle, tag_handle, out_data, err );
02344 }
02345 
02346 void FBiGeom_setData( FBiGeom_Instance instance,
02347                       iBase_EntityHandle entity_handle,
02348                       iBase_TagHandle tag_handle,
02349                       const void* tag_value,
02350                       int tag_value_size,
02351                       int* err )
02352 {
02353     iMesh_setData( IMESH_INSTANCE( instance ), entity_handle, tag_handle, tag_value, tag_value_size, err );
02354 }
02355 
02356 void FBiGeom_setIntData( FBiGeom_Instance instance,
02357                          iBase_EntityHandle entity_handle,
02358                          iBase_TagHandle tag_handle,
02359                          int tag_value,
02360                          int* err )
02361 {
02362     iMesh_setIntData( IMESH_INSTANCE( instance ), entity_handle, tag_handle, tag_value, err );
02363 }
02364 
02365 void FBiGeom_setDblData( FBiGeom_Instance instance,
02366                          iBase_EntityHandle entity_handle,
02367                          iBase_TagHandle tag_handle,
02368                          double tag_value,
02369                          int* err )
02370 {
02371     iMesh_setDblData( IMESH_INSTANCE( instance ), entity_handle, tag_handle, tag_value, err );
02372 }
02373 
02374 void FBiGeom_setEHData( FBiGeom_Instance instance,
02375                         iBase_EntityHandle entity_handle,
02376                         iBase_TagHandle tag_handle,
02377                         iBase_EntityHandle tag_value,
02378                         int* err )
02379 {
02380     iMesh_setEHData( IMESH_INSTANCE( instance ), entity_handle, tag_handle, tag_value, err );
02381 }
02382 
02383 void FBiGeom_setESHData( FBiGeom_Instance instance,
02384                          iBase_EntityHandle entity_handle,
02385                          iBase_TagHandle tag_handle,
02386                          iBase_EntitySetHandle tag_value,
02387                          int* err )
02388 {
02389     iMesh_setESHData( IMESH_INSTANCE( instance ), entity_handle, tag_handle, tag_value, err );
02390 }
02391 
02392 void FBiGeom_getAllTags( FBiGeom_Instance instance,
02393                          iBase_EntityHandle entity_handle,
02394                          iBase_TagHandle** tag_handles,
02395                          int* tag_handles_allocated,
02396                          int* tag_handles_size,
02397                          int* err )
02398 {
02399     iMesh_getAllTags( IMESH_INSTANCE( instance ), entity_handle, tag_handles, tag_handles_allocated, tag_handles_size,
02400                       err );
02401 }
02402 
02403 void FBiGeom_rmvTag( FBiGeom_Instance instance, iBase_EntityHandle entity_handle, iBase_TagHandle tag_handle, int* err )
02404 {
02405     iMesh_rmvTag( IMESH_INSTANCE( instance ), entity_handle, tag_handle, err );
02406 }
02407 
02408 void FBiGeom_subtract( FBiGeom_Instance instance,
02409                        iBase_EntitySetHandle,
02410                        iBase_EntitySetHandle,
02411                        iBase_EntitySetHandle*,
02412                        int* err )
02413 {
02414     RETURN( iBase_NOT_SUPPORTED );
02415 }
02416 
02417 void FBiGeom_intersect( FBiGeom_Instance instance,
02418                         iBase_EntitySetHandle,
02419                         iBase_EntitySetHandle,
02420                         iBase_EntitySetHandle*,
02421                         int* err )
02422 {
02423     RETURN( iBase_NOT_SUPPORTED );
02424 }
02425 
02426 void FBiGeom_unite( FBiGeom_Instance instance,
02427                     iBase_EntitySetHandle,
02428                     iBase_EntitySetHandle,
02429                     iBase_EntitySetHandle*,
02430                     int* err )
02431 {
02432     RETURN( iBase_NOT_SUPPORTED );
02433 }
02434 
02435 // TODO methods not yet implemented
02436 void FBiGeom_getEntClosestPtTrimmed( FBiGeom_Instance instance,
02437                                      iBase_EntityHandle,
02438                                      double,
02439                                      double,
02440                                      double,
02441                                      double*,
02442                                      double*,
02443                                      double*,
02444                                      int* err )
02445 {
02446     RETURN( iBase_NOT_SUPPORTED );
02447 }
02448 
02449 void FBiGeom_getFcCvtrXYZ( FBiGeom_Instance instance,
02450                            iBase_EntityHandle,
02451                            double,
02452                            double,
02453                            double,
02454                            double*,
02455                            double*,
02456                            double*,
02457                            double*,
02458                            double*,
02459                            double*,
02460                            int* err )
02461 {
02462     RETURN( iBase_NOT_SUPPORTED );
02463 }
02464 
02465 void FBiGeom_getEgCvtrXYZ( FBiGeom_Instance instance,
02466                            iBase_EntityHandle,
02467                            double,
02468                            double,
02469                            double,
02470                            double*,
02471                            double*,
02472                            double*,
02473                            int* err )
02474 {
02475     RETURN( iBase_NOT_SUPPORTED );
02476 }
02477 
02478 void FBiGeom_getEntArrCvtrXYZ( FBiGeom_Instance instance,
02479                                iBase_EntityHandle const*,
02480                                int,
02481                                int,
02482                                double const*,
02483                                int,
02484                                double**,
02485                                int*,
02486                                int*,
02487                                double**,
02488                                int*,
02489                                int*,
02490                                int* err )
02491 {
02492     RETURN( iBase_NOT_SUPPORTED );
02493 }
02494 
02495 void FBiGeom_getEgEvalXYZ( FBiGeom_Instance instance,
02496                            iBase_EntityHandle edge,
02497                            double x,
02498                            double y,
02499                            double z,
02500                            double* on_x,
02501                            double* on_y,
02502                            double* on_z,
02503                            double* tngt_i,
02504                            double* tngt_j,
02505                            double* tngt_k,
02506                            double* cvtr_i,
02507                            double* cvtr_j,
02508                            double* cvtr_k,
02509                            int* err )
02510 {
02511     ErrorCode rval = FBE_cast( instance )
02512                          ->getEgEvalXYZ( (moab::EntityHandle)edge, x, y, z, *on_x, *on_y, *on_z, *tngt_i, *tngt_j,
02513                                          *tngt_k, *cvtr_i, *cvtr_j, *cvtr_k );CHKERR( rval, "can't get point on edge " );
02514     RETURN( iBase_SUCCESS );
02515 }
02516 
02517 void FBiGeom_getFcEvalXYZ( FBiGeom_Instance instance,
02518                            iBase_EntityHandle face_handle,
02519                            double x,
02520                            double y,
02521                            double z,
02522                            double* on_x,
02523                            double* on_y,
02524                            double* on_z,
02525                            double* nrml_i,
02526                            double* nrml_j,
02527                            double* nrml_k,
02528                            double* cvtr1_i,
02529                            double* cvtr1_j,
02530                            double* cvtr1_k,
02531                            double* cvtr2_i,
02532                            double* cvtr2_j,
02533                            double* cvtr2_k,
02534                            int* err )
02535 {
02536     /*
02537       moab::ErrorCode rval = _fbEngine->getFcEvalXYZ( (moab::EntityHandle) face,
02538       x,  y, z,
02539       on_x, on_y, on_z,
02540       nrml_i, nrml_j, nrml_k,
02541       cvtr1_i, cvtr1_j, cvtr1_k,
02542       cvtr2_i, cvtr2_j,  cvtr2_k );*/
02543     // camal really does not use curvatures
02544     // the most it is calling for normals and for closest point
02545     // return all curvatures = 0 for the time being, because we
02546     // know camal is not requesting them
02547 
02548     *cvtr1_i = *cvtr1_j = *cvtr1_k = *cvtr2_i = *cvtr2_j = *cvtr2_k = 0.;
02549     // first get closest point, then normal, separately
02550     ErrorCode rval =
02551         FBE_cast( instance )->getEntClosestPt( (moab::EntityHandle)face_handle, x, y, z, on_x, on_y, on_z );CHKERR( rval, "can't get closest point on surface " );
02552     rval = FBE_cast( instance )
02553                ->getEntNrmlXYZ( (moab::EntityHandle)face_handle, x, y, z, nrml_i, nrml_j,
02554                                 nrml_k );  // some inconsistency here, we use pointers, not refs
02555     CHKERR( rval, "can't get normal on closest point on surface " );
02556     RETURN( iBase_SUCCESS );
02557 }
02558 
02559 void FBiGeom_getArrEgEvalXYZ( FBiGeom_Instance instance,
02560                               iBase_EntityHandle const*,
02561                               int,
02562                               int,
02563                               double const*,
02564                               int,
02565                               double**,
02566                               int*,
02567                               int*,
02568                               double**,
02569                               int*,
02570                               int*,
02571                               double**,
02572                               int*,
02573                               int*,
02574                               int* err )
02575 {
02576     RETURN( iBase_NOT_SUPPORTED );
02577 }
02578 
02579 void FBiGeom_getArrFcEvalXYZ( FBiGeom_Instance instance,
02580                               iBase_EntityHandle const*,
02581                               int,
02582                               int,
02583                               double const*,
02584                               int,
02585                               double**,
02586                               int*,
02587                               int*,
02588                               double**,
02589                               int*,
02590                               int*,
02591                               double**,
02592                               int*,
02593                               int*,
02594                               double**,
02595                               int*,
02596                               int*,
02597                               int* err )
02598 {
02599     RETURN( iBase_NOT_SUPPORTED );
02600 }
02601 
02602 void FBiGeom_getPntClsf( FBiGeom_Instance instance, double, double, double, iBase_EntityHandle*, int* err )
02603 {
02604     RETURN( iBase_NOT_SUPPORTED );
02605 }
02606 
02607 void FBiGeom_getPntArrClsf( FBiGeom_Instance instance,
02608                             int,
02609                             double const*,
02610                             int,
02611                             iBase_EntityHandle**,
02612                             int*,
02613                             int*,
02614                             int* err )
02615 {
02616     RETURN( iBase_NOT_SUPPORTED );
02617 }
02618 
02619 void FBiGeom_getFacets( FBiGeom_Instance instance,
02620                         iBase_EntityHandle,
02621                         double,
02622                         double,
02623                         int,
02624                         int,
02625                         int,
02626                         int,
02627                         int,
02628                         int* err )
02629 {
02630     RETURN( iBase_NOT_SUPPORTED );
02631 }
02632 
02633 void FBiGeom_getEntTolerance( FBiGeom_Instance instance, iBase_EntityHandle, double*, int* err )
02634 {
02635     RETURN( iBase_NOT_SUPPORTED );
02636 }
02637 void FBiGeom_getArrTolerance( FBiGeom_Instance instance,
02638                               iBase_EntityHandle const*,
02639                               int,
02640                               double**,
02641                               int*,
02642                               int*,
02643                               int* err )
02644 {
02645     RETURN( iBase_NOT_SUPPORTED );
02646 }
02647 void FBiGeom_getTolerance( FBiGeom_Instance instance, int*, double*, int* err )
02648 {
02649     RETURN( iBase_NOT_SUPPORTED );
02650 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines