MOAB: Mesh Oriented datABase  (version 5.5.0)
FBiGeom_MOAB.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <map>
3 #include "FBiGeom_MOAB.hpp"
4 #include "moab/GeomTopoTool.hpp"
6 #include "moab/CartVect.hpp"
7 #include "moab/FileOptions.hpp"
8 #include "MBTagConventions.hpp"
9 #include <cstdlib>
10 #include <cstring>
11 #include <map>
12 #include <cassert>
13 
14 using namespace moab;
15 
16 static int compare_no_case1( const char* str1, const char* str2, size_t n )
17 {
18  for( size_t i = 1; i != n && *str1 && toupper( *str1 ) == toupper( *str2 ); ++i, ++str1, ++str2 )
19  ;
20  return toupper( *str2 ) - toupper( *str1 );
21 }
22 // Filter out non-MOAB options and remove the "moab:" prefix
23 static std::string filter_options1( const char* begin, const char* end )
24 {
25  const char* opt_begin = begin;
26  const char* opt_end = begin;
27 
28  std::string filtered;
29  bool first = true;
30 
31  while( opt_end != end )
32  {
33  opt_end = std::find( opt_begin, end, ' ' );
34 
35  if( opt_end - opt_begin >= 5 && compare_no_case1( opt_begin, "moab:", 5 ) == 0 )
36  {
37  if( !first ) filtered.push_back( ';' );
38  first = false;
39  filtered.append( opt_begin + 5, opt_end );
40  }
41 
42  opt_begin = opt_end + 1;
43  }
44  return filtered;
45 }
46 
47 bool debug_igeom = false;
48 bool Debug_surf_eval = false;
49 
50 #define COPY_RANGE( r, vec ) \
51  { \
52  EntityHandle* tmp_ptr = reinterpret_cast< EntityHandle* >( vec ); \
53  std::copy( ( r ).begin(), ( r ).end(), tmp_ptr ); \
54  }
55 
56 #define TAG_HANDLE( tagh ) reinterpret_cast< Tag >( tagh )
57 
58 #define COPY_DOUBLEVEC( r, vec ) \
59  { \
60  double* tmp_ptr = reinterpret_cast< double* >( vec ); \
61  std::copy( ( r ).begin(), ( r ).end(), tmp_ptr ); \
62  }
63 
64 void FBiGeom_getDescription( FBiGeom_Instance instance, char* descr, int descr_len )
65 {
66  iMesh_getDescription( IMESH_INSTANCE( instance ), descr, descr_len );
67 }
68 
69 void FBiGeom_getErrorType( FBiGeom_Instance instance, /*out*/ int* error_type )
70 {
71  iMesh_getErrorType( IMESH_INSTANCE( instance ), /*out*/ error_type );
72 }
73 
74 void FBiGeom_newGeom( char const* options, FBiGeom_Instance* instance_out, int* err, int options_len )
75 {
76 
77  std::string tmp_options = filter_options1( options, options + options_len );
78  FileOptions opts( tmp_options.c_str() );
79  // process some options?
80 
81  MBiGeom** mbigeom = reinterpret_cast< MBiGeom** >( instance_out );
82  *mbigeom = NULL;
83  *mbigeom = new MBiGeom();
84  *err = iBase_SUCCESS;
85 }
86 
87 void FBiGeom_dtor( FBiGeom_Instance instance, int* err )
88 {
89  MBiGeom** mbigeom = reinterpret_cast< MBiGeom** >( &instance );
90  if( *mbigeom ) delete *mbigeom;
91  *err = iBase_SUCCESS;
92 }
93 
96  const char* options,
98  int* err,
99  int )
100 {
101  MBiMesh* mbimesh = reinterpret_cast< MBiMesh* >( mesh );
102  moab::Interface* mbi = mbimesh->mbImpl;
103  moab::EntityHandle rootSet = reinterpret_cast< moab::EntityHandle >( set );
104  moab::GeomTopoTool* gtt = new moab::GeomTopoTool( mbi, true, rootSet );
105  bool smooth = false; // decide from options
106  char smth[] = "SMOOTH;";
107  const char* res = strstr( options, smth );
108  if( res != NULL ) smooth = true;
109  moab::FBEngine* fbe = new moab::FBEngine( mbi, gtt, smooth );
110  MBiGeom** mbigeom = reinterpret_cast< MBiGeom** >( geom );
111  *mbigeom = NULL;
112  *mbigeom = new MBiGeom( mbimesh, fbe );
113  // will do now the initialization of the engine;
114  // heavy duty computation
115  fbe->Init();
116  *err = iBase_SUCCESS;
117 }
118 // corresponding to constructor 2, from iMesh instance
119 void FBiGeom_dtor2( FBiGeom_Instance instance, int* err )
120 {
121  moab::FBEngine* fbe = FBE_cast( instance );
122  if( fbe )
123  {
124  moab::GeomTopoTool* gtt = fbe->get_gtt();
125  if( gtt ) delete gtt;
126  delete fbe;
127  }
128  MBiGeom** mbigeom = reinterpret_cast< MBiGeom** >( &instance );
129  if( *mbigeom ) delete *mbigeom;
130  *err = iBase_SUCCESS;
131 }
132 
133 void FBiGeom_load( FBiGeom_Instance instance, char const* name, char const* options, int* err, int, int options_len )
134 {
135  // first remove option for smooth facetting
136 
137  const char smth[] = "SMOOTH;";
138  bool smooth = false;
139  const char* res = NULL;
140 
141  char* reducedOptions = NULL;
142  bool localReduce = false;
143  if( options ) res = strstr( options, smth );
144  if( res )
145  {
146  // extract that option, will not be recognized by our moab/imesh
147  reducedOptions = new char[options_len - 6];
148  localReduce = true;
149  int preLen = (int)( res - options );
150  strncpy( reducedOptions, options, preLen );
151  int postLen = options_len - 7 - preLen;
152 
153  char* tmp = reducedOptions + preLen;
154 
155  strncpy( tmp, res + 7, postLen );
156  reducedOptions[options_len - 7] = 0;
157  std::cout << reducedOptions << std::endl;
158  smooth = true;
159  }
160  else
161  {
162  reducedOptions = const_cast< char* >( options );
163  }
164  // load mesh-based geometry
165  const EntityHandle* file_set = 0;
166  ErrorCode rval = MBI->load_file( name, file_set, reducedOptions );CHKERR( rval, "can't load mesh file" );
167  if( localReduce ) delete[] reducedOptions;
168 
169  FBEngine* fbe = FBE_cast( instance );
170  if( fbe == NULL )
171  {
172  *err = iBase_FAILURE;
173  return;
174  }
175  GeomTopoTool* gtt = GETGTT( instance );
176  if( gtt == NULL )
177  {
178  *err = iBase_FAILURE;
179  return;
180  }
181  // keep mesh-based geometries in Range
182  rval = gtt->find_geomsets();CHKERR( rval, "Failure to find geometry lists." );
183 
184  if( smooth ) fbe->set_smooth(); // assumes that initialization did not happen yet
185 
186  fbe->Init(); // major computation
187 
189 }
190 
192  char const* name,
193  char const* options,
194  int* err,
195  int name_len,
196  int options_len )
197 {
198  iMesh_save( IMESH_INSTANCE( instance ), NULL, name, options, err, name_len, options_len );
199 }
200 
202 {
203  EntityHandle modelSet;
204  ErrorCode rval = FBE_cast( instance )->getRootSet( &modelSet );CHKERR( rval, "can't get root set " );
205  *root_set = (iBase_EntitySetHandle)modelSet;
207 }
208 
209 void FBiGeom_getBoundBox( FBiGeom_Instance instance, double*, double*, double*, double*, double*, double*, int* err )
210 {
212 }
213 
215  iBase_EntitySetHandle set_handle,
216  int entity_type,
217  iBase_EntityHandle** entity_handles,
218  int* entity_handles_allocated,
219  int* entity_handles_size,
220  int* err )
221 {
222 
223  if( 0 > entity_type || 4 < entity_type )
224  {
225  ERROR( iBase_INVALID_ENTITY_TYPE, "Bad entity type." );
226  }
227  else /* 0<= entity_type <= 4) */
228  {
229  Range gentities;
230  ErrorCode rval = FBE_cast( instance )->getEntities( (EntityHandle)set_handle, entity_type, gentities );CHKERR( rval, "can't get entities " );
231  *entity_handles_size = gentities.size();
232 
233  CHECK_SIZE( *entity_handles, *entity_handles_allocated, *entity_handles_size, iBase_EntityHandle, NULL );
234  COPY_RANGE( gentities, *entity_handles );
235  }
236 
238 }
239 
241  iBase_EntitySetHandle set_handle,
242  int entity_type,
243  int* num_out,
244  int* err )
245 {
246  if( 0 > entity_type || 4 < entity_type )
247  {
248  ERROR( iBase_INVALID_ENTITY_TYPE, "Bad entity type." );
249  }
250  ErrorCode rval = FBE_cast( instance )->getNumOfType( (EntityHandle)set_handle, entity_type, num_out );CHKERR( rval, "can't get number of type " );
251 
253 }
254 
255 void FBiGeom_getEntType( FBiGeom_Instance instance, iBase_EntityHandle entity_handle, int* type, int* err )
256 {
257 
258  ErrorCode rval = FBE_cast( instance )->getEntType( (EntityHandle)entity_handle, type );CHKERR( rval, "can't get entity type " );
259 
261 }
262 
264  iBase_EntityHandle const* entity_handles,
265  int entity_handles_size,
266  int** type,
267  int* type_allocated,
268  int* type_size,
269  int* err )
270 {
271  CHECK_SIZE( *type, *type_allocated, entity_handles_size, int, NULL );
272  *type_size = entity_handles_size;
273 
274  int tmp_err;
275 
276  for( int i = 0; i < entity_handles_size; i++ )
277  {
278  FBiGeom_getEntType( instance, entity_handles[i], *type + i, &tmp_err );
279  if( iBase_SUCCESS != tmp_err )
280  {
281  ERROR( tmp_err, "Failed to get entity type in FBiGeom_getArrType." );
282  }
283  }
284 
286 }
287 
289  iBase_EntityHandle entity_handle,
290  int to_dimension,
291  iBase_EntityHandle** adj_entities,
292  int* adj_entities_allocated,
293  int* adj_entities_size,
294  int* err )
295 {
296  Range adjs;
297  EntityHandle this_ent = MBH_cast( entity_handle );
298 
299  ErrorCode rval = FBE_cast( instance )->getEntAdj( this_ent, to_dimension, adjs );
300 
301  CHKERR( rval, "Failed to get adjacent entities in FBiGeom_getEntAdj." );
302 
303  // copy adjacent entities
304  *adj_entities_size = adjs.size();
305  CHECK_SIZE( *adj_entities, *adj_entities_allocated, *adj_entities_size, iBase_EntityHandle, NULL );
306  COPY_RANGE( adjs, *adj_entities );
307 
309 }
310 
311 // I suspect this is wrong
313  iBase_EntityHandle const* entity_handles,
314  int entity_handles_size,
315  int requested_entity_type,
316  iBase_EntityHandle** adj_entity_handles,
317  int* adj_entity_handles_allocated,
318  int* adj_entity_handles_size,
319  int** offset,
320  int* offset_allocated,
321  int* offset_size,
322  int* err )
323 {
324  // check offset array size
325  Range temp_range, total_range;
326  CHECK_SIZE( *offset, *offset_allocated, entity_handles_size + 1, int, NULL );
327  *offset_size = entity_handles_size + 1;
328 
329  // get adjacent entities
330  for( int i = 0; i < entity_handles_size; ++i )
331  {
332  ( *offset )[i] = total_range.size();
333  temp_range.clear();
334  ErrorCode rval =
335  FBE_cast( instance )->getEntAdj( MBH_cast( entity_handles[i] ), requested_entity_type, temp_range );CHKERR( rval, "Failed to get adjacent entities in FBiGeom_getArrAdj." );
336  total_range.merge( temp_range );
337  }
338  int nTot = total_range.size();
339  ( *offset )[entity_handles_size] = nTot;
340 
341  // copy adjacent entities
342  CHECK_SIZE( *adj_entity_handles, *adj_entity_handles_allocated, nTot, iBase_EntityHandle, NULL );
343  COPY_RANGE( total_range, *adj_entity_handles );
344  *adj_entity_handles_size = nTot;
345 
347 }
348 
350  iBase_EntityHandle entity_handle,
351  int bridge_dimension,
352  int to_dimension,
353  iBase_EntityHandle** adjacent_entities,
354  int* adjacent_entities_allocated,
355  int* adjacent_entities_size,
356  int* err )
357 {
358  Range to_ents, bridge_ents, tmp_ents;
359  ErrorCode rval = FBE_cast( instance )->getEntAdj( MBH_cast( entity_handle ), bridge_dimension, bridge_ents );
360 
361  CHKERR( rval, "Failed to get adjacent entities in FBiGeom_getEnt2ndAdj." );
362 
363  Range::iterator iter, jter, kter, end_jter;
364  Range::iterator end_iter = bridge_ents.end();
365  for( iter = bridge_ents.begin(); iter != end_iter; ++iter )
366  {
367  rval = FBE_cast( instance )->getEntAdj( *iter, to_dimension, tmp_ents );
368 
369  CHKERR( rval, "Failed to get adjacent entities in FBiGeom_getEnt2ndAdj." );
370 
371  for( jter = tmp_ents.begin(); jter != end_jter; ++jter )
372  {
373  if( to_ents.find( *jter ) == to_ents.end() )
374  {
375  to_ents.insert( *jter );
376  }
377  }
378  tmp_ents.clear();
379  }
380 
381  *adjacent_entities_size = to_ents.size();
382  CHECK_SIZE( *adjacent_entities, *adjacent_entities_allocated, *adjacent_entities_size, iBase_EntityHandle, NULL );
383  COPY_RANGE( to_ents, *adjacent_entities );
384 
386 }
387 
389  iBase_EntityHandle const*,
390  int,
391  int,
392  int,
394  int*,
395  int*,
396  int**,
397  int*,
398  int*,
399  int* err )
400 {
401  // not implemented
402  // who would need this monster, anyway?
404 }
405 
407  iBase_EntityHandle entity_handle1,
408  iBase_EntityHandle entity_handle2,
409  int* are_adjacent,
410  int* err )
411 {
412 
413  bool adjacent_out;
414  ErrorCode rval =
415  FBE_cast( instance )->isEntAdj( MBH_cast( entity_handle1 ), MBH_cast( entity_handle2 ), adjacent_out );CHKERR( rval, "Failed to get adjacent info" );
416  *are_adjacent = (int)adjacent_out; // 0 or 1, really
417 
419 }
420 
422  iBase_EntityHandle const* entity_handles_1,
423  int entity_handles_1_size,
424  iBase_EntityHandle const* entity_handles_2,
425  int entity_handles_2_size,
426  int** is_adjacent_info,
427  int* is_adjacent_info_allocated,
428  int* is_adjacent_info_size,
429  int* err )
430 {
431  int index1 = 0;
432  int index2 = 0;
433  size_t index1_step, index2_step;
434  int count;
435 
436  // If either list contains only 1 entry, compare that entry with
437  // every entry in the other list.
438  if( entity_handles_1_size == entity_handles_2_size )
439  {
440  index1_step = index2_step = 1;
441  count = entity_handles_1_size;
442  }
443  else if( entity_handles_1_size == 1 )
444  {
445  index1_step = 0;
446  index2_step = 1;
447  count = entity_handles_2_size;
448  }
449  else if( entity_handles_2_size == 1 )
450  {
451  index1_step = 1;
452  index2_step = 0;
453  count = entity_handles_1_size;
454  }
455  else
456  {
458  }
459 
460  CHECK_SIZE( *is_adjacent_info, *is_adjacent_info_allocated, count, int, NULL );
461 
462  for( int i = 0; i < count; ++i )
463  {
464  FBiGeom_isEntAdj( instance, entity_handles_1[index1], entity_handles_2[index2], &( ( *is_adjacent_info )[i] ),
465  err );
466  FWDERR();
467 
468  index1 += index1_step;
469  index2 += index2_step;
470  }
471  // it is now safe to set the size
472  *is_adjacent_info_size = count;
473 
475 }
476 
478  iBase_EntityHandle entity_handle,
479  double near_x,
480  double near_y,
481  double near_z,
482  double* on_x,
483  double* on_y,
484  double* on_z,
485  int* err )
486 {
487 
488  ErrorCode rval =
489  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" );
490 
492 }
493 
495  iBase_EntityHandle const* entity_handles,
496  int entity_handles_size,
497  int storage_order,
498  double const* near_coordinates,
499  int near_coordinates_size,
500  double** on_coordinates,
501  int* on_coordinates_allocated,
502  int* on_coordinates_size,
503  int* err )
504 {
505  CHECK_SIZE( *on_coordinates, *on_coordinates_allocated, near_coordinates_size, double, NULL );
506 
507  for( int i = 0; i < entity_handles_size; i++ )
508  {
509  if( storage_order == iBase_INTERLEAVED )
510  {
511  FBiGeom_getEntClosestPt( instance, entity_handles[i], near_coordinates[3 * i], near_coordinates[3 * i + 1],
512  near_coordinates[3 * i + 2], on_coordinates[3 * i], on_coordinates[3 * i + 1],
513  on_coordinates[3 * i + 2], err );
514  }
515  else if( storage_order == iBase_BLOCKED )
516  {
517  FBiGeom_getEntClosestPt( instance, entity_handles[i], near_coordinates[i],
518  near_coordinates[i + entity_handles_size],
519  near_coordinates[i + 2 * entity_handles_size], on_coordinates[i],
520  on_coordinates[i + entity_handles_size],
521  on_coordinates[i + 2 * entity_handles_size], err );
522  }
523  FWDERR();
524  }
525  *on_coordinates_size = near_coordinates_size;
526 
528 }
529 
531  iBase_EntityHandle entity_handle,
532  double x,
533  double y,
534  double z,
535  double* nrml_i,
536  double* nrml_j,
537  double* nrml_k,
538  int* err )
539 {
540 
541  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" );
543 }
544 
546  iBase_EntityHandle const* entity_handles,
547  int entity_handles_size,
548  int storage_order,
549  double const* coordinates,
550  int coordinates_size,
551  double** normals,
552  int* normals_allocated,
553  int* normals_size,
554  int* err )
555 {
556  // set up iteration according to storage order.
557  // allow either gentity_handles or near_coordinates to contain
558  // only one value, where that single value is applied for every
559  // entry in the other list.
560  size_t index = 0;
561  size_t coord_step, norm_step = 1, ent_step;
562  int count;
563  if( 3 * entity_handles_size == coordinates_size )
564  {
565  coord_step = ent_step = 1;
566  count = entity_handles_size;
567  }
568  else if( coordinates_size == 3 )
569  {
570  coord_step = 0;
571  ent_step = 1;
572  count = entity_handles_size;
573  }
574  else if( entity_handles_size == 1 )
575  {
576  coord_step = 1;
577  ent_step = 0;
578  count = coordinates_size / 3;
579  }
580  else
581  {
582  ERROR( iBase_INVALID_ENTITY_COUNT, "Mismatched array sizes" );
583  }
584 
585  // check or pre-allocate the coordinate arrays
586  CHECK_SIZE( *normals, *normals_allocated, 3 * count, double, NULL );
587 
588  const double *coord_x, *coord_y, *coord_z;
589  double *norm_x, *norm_y, *norm_z;
590  if( storage_order == iBase_BLOCKED )
591  {
592  coord_x = coordinates;
593  coord_y = coord_x + coordinates_size / 3;
594  coord_z = coord_y + coordinates_size / 3;
595  norm_x = *normals;
596  norm_y = norm_x + count;
597  norm_z = norm_y + count;
598  norm_step = 1;
599  }
600  else
601  {
602  storage_order = iBase_INTERLEAVED; /* set if unspecified */
603  coord_x = coordinates;
604  coord_y = coord_x + 1;
605  coord_z = coord_x + 2;
606  norm_x = *normals;
607  norm_y = norm_x + 1;
608  norm_z = norm_x + 2;
609  coord_step *= 3;
610  norm_step = 3;
611  }
612 
613  for( int i = 0; i < count; ++i )
614  {
615  FBiGeom_getEntNrmlXYZ( instance, entity_handles[index], *coord_x, *coord_y, *coord_z, norm_x, norm_y, norm_z,
616  err );
617  FWDERR();
618 
619  index += ent_step;
620  coord_x += coord_step;
621  coord_y += coord_step;
622  coord_z += coord_step;
623  norm_x += norm_step;
624  norm_y += norm_step;
625  norm_z += norm_step;
626  }
627  *normals_size = count;
629 }
630 
632  iBase_EntityHandle entity_handle,
633  double x,
634  double y,
635  double z,
636  double* pt_x,
637  double* pt_y,
638  double* pt_z,
639  double* nrml_i,
640  double* nrml_j,
641  double* nrml_k,
642  int* err )
643 {
644  // just do for surface and volume
645  int type;
646  FBiGeom_getEntType( instance, entity_handle, &type, err );
647  FWDERR();
648 
649  if( type != 2 && type != 3 )
650  {
651  ERROR( iBase_INVALID_ENTITY_TYPE, "Entities passed into gentityNormal must be face or volume." );
652  }
653 
654  // do 2 searches, so it is not fast enough
655  FBiGeom_getEntClosestPt( instance, entity_handle, x, y, z, pt_x, pt_y, pt_z, err );
656 
657  FWDERR();
658  FBiGeom_getEntNrmlXYZ( instance, entity_handle, *pt_x, *pt_y, *pt_z, nrml_i, nrml_j, nrml_k, err );
659  FWDERR();
660 
662 }
663 
665  iBase_EntityHandle const* entity_handles,
666  int entity_handles_size,
667  int storage_order,
668  double const* near_coordinates,
669  int near_coordinates_size,
670  double** on_coordinates,
671  int* on_coordinates_allocated,
672  int* on_coordinates_size,
673  double** normals,
674  int* normals_allocated,
675  int* normals_size,
676  int* err )
677 {
678  // set up iteration according to storage order.
679  // allow either gentity_handles or near_coordinates to contain
680  // only one value, where that single value is applied for every
681  // entry in the other list.
682  size_t index = 0;
683  size_t near_step, on_step = 1, ent_step;
684  int count;
685  if( 3 * entity_handles_size == near_coordinates_size )
686  {
687  near_step = ent_step = 1;
688  count = entity_handles_size;
689  }
690  else if( near_coordinates_size == 3 )
691  {
692  near_step = 0;
693  ent_step = 1;
694  count = entity_handles_size;
695  }
696  else if( entity_handles_size == 1 )
697  {
698  near_step = 1;
699  ent_step = 0;
700  count = near_coordinates_size / 3;
701  }
702  else
703  {
704  ERROR( iBase_INVALID_ENTITY_COUNT, "Mismatched array sizes" );
705  }
706 
707  // check or pre-allocate the coordinate arrays
708  CHECK_SIZE( *on_coordinates, *on_coordinates_allocated, 3 * count, double, NULL );
709  CHECK_SIZE( *normals, *normals_allocated, 3 * count, double, NULL );
710 
711  const double *near_x, *near_y, *near_z;
712  double *on_x, *on_y, *on_z;
713  double *norm_x, *norm_y, *norm_z;
714  if( storage_order == iBase_BLOCKED )
715  {
716  near_x = near_coordinates;
717  near_y = near_x + near_coordinates_size / 3;
718  near_z = near_y + near_coordinates_size / 3;
719  on_x = *on_coordinates;
720  on_y = on_x + count;
721  on_z = on_y + count;
722  norm_x = *normals;
723  norm_y = norm_x + count;
724  norm_z = norm_y + count;
725  on_step = 1;
726  }
727  else
728  {
729  storage_order = iBase_INTERLEAVED; /* set if unspecified */
730  near_x = near_coordinates;
731  near_y = near_x + 1;
732  near_z = near_x + 2;
733  on_x = *on_coordinates;
734  on_y = on_x + 1;
735  on_z = on_x + 2;
736  norm_x = *normals;
737  norm_y = norm_x + 1;
738  norm_z = norm_x + 2;
739  near_step *= 3;
740  on_step = 3;
741  }
742 
743  for( int i = 0; i < count; ++i )
744  {
745  FBiGeom_getEntNrmlPlXYZ( instance, entity_handles[index], *near_x, *near_y, *near_z, on_x, on_y, on_z, norm_x,
746  norm_y, norm_z, err );
747  FWDERR();
748 
749  // entities += ent_step;
750  index += ent_step;
751  near_x += near_step;
752  near_y += near_step;
753  near_z += near_step;
754  on_x += on_step;
755  on_y += on_step;
756  on_z += on_step;
757  norm_x += on_step;
758  norm_y += on_step;
759  norm_z += on_step;
760  }
761  *on_coordinates_size = count * 3;
762  *normals_size = count;
764 }
765 
768  double,
769  double,
770  double,
771  double*,
772  double*,
773  double*,
774  int* err )
775 {
777 }
778 
780  iBase_EntityHandle const*,
781  int,
782  int,
783  double const*,
784  int,
785  double**,
786  int*,
787  int*,
788  int* err )
789 {
791 }
792 
794  iBase_EntityHandle entity_handle,
795  double* min_x,
796  double* min_y,
797  double* min_z,
798  double* max_x,
799  double* max_y,
800  double* max_z,
801  int* err )
802 {
803  ErrorCode rval;
804  int type;
805  FBiGeom_getEntType( instance, entity_handle, &type, err );
806  FWDERR();
807 
808  if( type == 0 )
809  {
810  FBiGeom_getVtxCoord( instance, entity_handle, min_x, min_y, min_z, err );
811  FWDERR();
812  max_x = min_x;
813  max_y = min_y;
814  max_z = min_z;
815  }
816  else if( type == 1 )
817  {
818  // it could be relatively easy to support
819  *err = iBase_NOT_SUPPORTED;
820  FWDERR();
821  }
822  else if( type == 2 || type == 3 )
823  {
824 
825  EntityHandle root;
826  CartVect center, axis[3];
827  GeomTopoTool* gtt = GETGTT( instance );
828  if( !gtt ) ERROR( iBase_FAILURE, "Can't get geom topo tool." );
829  rval = gtt->get_root( MBH_cast( entity_handle ), root );CHKERR( rval, "Failed to get tree root in FBiGeom_getEntBoundBox." );
830  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." );
831 
832  CartVect absv[3];
833  for( int i = 0; i < 3; i++ )
834  {
835  absv[i] = CartVect( fabs( axis[i][0] ), fabs( axis[i][1] ), fabs( axis[i][2] ) );
836  }
837  CartVect min, max;
838  min = center - absv[0] - absv[1] - absv[2];
839  max = center + absv[0] + absv[1] + absv[2];
840  *min_x = min[0];
841  *min_y = min[1];
842  *min_z = min[2];
843  *max_x = max[0];
844  *max_y = max[1];
845  *max_z = max[2];
846  }
847  else
849 
851 }
852 
854  iBase_EntityHandle const* entity_handles,
855  int entity_handles_size,
856  int storage_order,
857  double** min_corner,
858  int* min_corner_allocated,
859  int* min_corner_size,
860  double** max_corner,
861  int* max_corner_allocated,
862  int* max_corner_size,
863  int* err )
864 {
865  // check or pre-allocate the coordinate arrays
866  CHECK_SIZE( *min_corner, *min_corner_allocated, 3 * entity_handles_size, double, NULL );
867  CHECK_SIZE( *max_corner, *max_corner_allocated, 3 * entity_handles_size, double, NULL );
868 
869  size_t step, init;
870  if( storage_order == iBase_BLOCKED )
871  {
872  step = 1;
873  init = entity_handles_size;
874  }
875  else
876  {
877  step = 3;
878  init = 1;
879  }
880  double *min_x, *min_y, *min_z, *max_x, *max_y, *max_z;
881  min_x = *min_corner;
882  max_x = *max_corner;
883  min_y = min_x + init;
884  max_y = max_x + init;
885  min_z = min_y + init;
886  max_z = max_y + init;
887 
888  for( int i = 0; i < entity_handles_size; ++i )
889  {
890  FBiGeom_getEntBoundBox( instance, entity_handles[i], min_x, min_y, min_z, max_x, max_y, max_z, err );
891  FWDERR();
892 
893  min_x += step;
894  max_x += step;
895  min_y += step;
896  max_y += step;
897  min_z += step;
898  max_z += step;
899  }
900  *min_corner_size = 3 * entity_handles_size;
901  *max_corner_size = 3 * entity_handles_size;
903 }
904 
906  iBase_EntityHandle vertex_handle,
907  double* x,
908  double* y,
909  double* z,
910  int* err )
911 {
912  ErrorCode rval = FBE_cast( instance )->getVtxCoord( MBH_cast( vertex_handle ), x, y, z );CHKERR( rval, "Failed to vertex position" );
914 }
915 
917  iBase_EntityHandle const* entity_handles,
918  int entity_handles_size,
919  int storage_order,
920  double** coordinates,
921  int* coordinates_allocated,
922  int* coordinates_size,
923  int* err )
924 {
925  // check or pre-allocate the coordinate arrays
926  CHECK_SIZE( *coordinates, *coordinates_allocated, 3 * entity_handles_size, double, NULL );
927 
928  double *x, *y, *z;
929  size_t step;
930  if( storage_order == iBase_BLOCKED )
931  {
932  x = *coordinates;
933  y = x + entity_handles_size;
934  z = y + entity_handles_size;
935  step = 1;
936  }
937  else
938  {
939  x = *coordinates;
940  y = x + 1;
941  z = x + 2;
942  step = 3;
943  }
944 
945  for( int i = 0; i < entity_handles_size; i++ )
946  {
947  FBiGeom_getVtxCoord( instance, entity_handles[i], x, y, z, err );
948  x += step;
949  y += step;
950  z += step;
951  }
952  *coordinates_size = 3 * entity_handles_size;
954 }
955 
957  double x,
958  double y,
959  double z,
960  double dir_x,
961  double dir_y,
962  double dir_z,
963  iBase_EntityHandle** intersect_entity_handles,
964  int* intersect_entity_handles_allocated,
965  int* intersect_entity_handles_size,
966  int storage_order,
967  double** intersect_coords,
968  int* intersect_coords_allocated,
969  int* intersect_coords_size,
970  double** param_coords,
971  int* param_coords_allocated,
972  int* param_coords_size,
973  int* err )
974 {
975  // this is pretty cool
976  // we will return only surfaces
977  //
978  // storage order is ignored
979  std::vector< EntityHandle > intersect_handles;
980  std::vector< double > coords;
981  std::vector< double > params;
982  ErrorCode rval =
983  FBE_cast( instance )->getPntRayIntsct( x, y, z, dir_x, dir_y, dir_z, intersect_handles, coords, params );CHKERR( rval, "can't get ray intersections " );
984  *intersect_entity_handles_size = (int)intersect_handles.size();
985 
986  CHECK_SIZE( *intersect_entity_handles, *intersect_entity_handles_allocated, *intersect_entity_handles_size,
987  iBase_EntityHandle, NULL );
988  *intersect_coords_size = 3 * (int)intersect_handles.size();
989  CHECK_SIZE( *intersect_coords, *intersect_coords_allocated, *intersect_coords_size, double, NULL );
990  *param_coords_size = (int)intersect_handles.size();
991  CHECK_SIZE( *param_coords, *param_coords_allocated, *param_coords_size, double, NULL );
992 
993  COPY_RANGE( intersect_handles, *intersect_entity_handles );
994 
995  COPY_DOUBLEVEC( params, *param_coords );
996  if( storage_order == iBase_BLOCKED )
997  {
998  int sz = (int)intersect_handles.size();
999  for( int i = 0; i < sz; i++ )
1000  {
1001  *intersect_coords[i] = coords[3 * i];
1002  *intersect_coords[sz + i] = coords[3 * i + 1];
1003  *intersect_coords[2 * sz + i] = coords[3 * i + 2];
1004  }
1005  }
1006  else
1007  {
1008  COPY_DOUBLEVEC( coords, *intersect_coords );
1009  }
1010 
1011  RETURN( iBase_SUCCESS );
1012 }
1013 
1015  int,
1016  const double*,
1017  int,
1018  const double*,
1019  int,
1021  int*,
1022  int*,
1023  int**,
1024  int*,
1025  int*,
1026  double**,
1027  int*,
1028  int*,
1029  double**,
1030  int*,
1031  int*,
1032  int* err )
1033 {
1034  // not implemented
1036 }
1037 
1040  iBase_EntityHandle region,
1041  int* sense_out,
1042  int* err )
1043 {
1044  moab::EntityHandle mbregion = (moab::EntityHandle)region;
1046  moab::ErrorCode rval = FBE_cast( instance )->getEgFcSense( mbface, mbregion, *sense_out );CHKERR( rval, "can't get normal sense " );
1047  RETURN( iBase_SUCCESS );
1048 }
1050  iBase_EntityHandle const*,
1051  int,
1052  iBase_EntityHandle const*,
1053  int,
1054  int**,
1055  int*,
1056  int*,
1057  int* err )
1058 {
1059  // not implemented
1061 }
1062 
1063 /**\brief Get the sense of an edge with respect to a face
1064  * Get the sense of an edge with respect to a face. Sense returned is -1, 0, or 1,
1065  * representing "reversed", "both", or "forward". "both" sense indicates that edge bounds
1066  * the face once with each sense.
1067  * \param edge Edge being queried
1068  * \param face Face being queried
1069  * \param sense_out Sense of edge with respect to face
1070  */
1071 
1075  int* sense_out,
1076  int* err )
1077 {
1078  // this one is important, for establishing the orientation of the edges in faces
1079  // bummer, I "thought" it is already implemented
1080  // use senses
1081  ErrorCode rval = FBE_cast( instance )->getEgFcSense( MBH_cast( edge ), MBH_cast( face ), *sense_out );
1082 
1083  CHKERR( rval, "Failed to get edge senses in FBiGeom_getEgFcSense." );
1084  RETURN( iBase_SUCCESS );
1085 }
1087  iBase_EntityHandle const*,
1088  int,
1089  iBase_EntityHandle const*,
1090  int,
1091  int**,
1092  int*,
1093  int*,
1094  int* err )
1095 {
1097 }
1098 
1101  iBase_EntityHandle vertex1,
1102  iBase_EntityHandle vertex2,
1103  int* sense_out,
1104  int* err )
1105 {
1106 
1107  ErrorCode rval =
1108  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" );
1109  RETURN( iBase_SUCCESS );
1110 }
1112  iBase_EntityHandle const*,
1113  int,
1114  iBase_EntityHandle const*,
1115  int,
1116  iBase_EntityHandle const*,
1117  int,
1118  int**,
1119  int*,
1120  int*,
1121  int* err )
1122 {
1124 }
1125 
1127  iBase_EntityHandle const* entity_handles,
1128  int entity_handles_size,
1129  double** measures,
1130  int* measures_allocated,
1131  int* measures_size,
1132  int* err )
1133 {
1134 
1135  CHECK_SIZE( *measures, *measures_allocated, entity_handles_size, double, NULL );
1136  ErrorCode rval = FBE_cast( instance )->measure( (EntityHandle*)( entity_handles ), entity_handles_size, *measures );CHKERR( rval, "Failed to get measures" );
1137  *measures_size = entity_handles_size;
1138  RETURN( iBase_SUCCESS );
1139 }
1140 
1143  char* face_type,
1144  int* err,
1145  int* face_type_length )
1146 {
1147  std::string type = "nonplanar"; // for swept faces created with rays between surfaces,
1148  // we could actually create planar surfaces; maybe we should
1149  // recognize them as such
1150  face_type = new char[type.length() + 1];
1151  strcpy( face_type, type.c_str() );
1152  *face_type_length = type.length() + 1;
1153  RETURN( iBase_SUCCESS );
1154 }
1155 void FBiGeom_getParametric( FBiGeom_Instance instance, int* is_parametric, int* err )
1156 {
1157  *is_parametric = 0; //(false)
1158  RETURN( iBase_SUCCESS );
1159 }
1160 void FBiGeom_isEntParametric( FBiGeom_Instance instance, iBase_EntityHandle entity_handle, int* parametric, int* err )
1161 {
1162  int type = -1;
1163  FBiGeom_getEntType( instance, entity_handle, &type, err );
1164  if( type == 1 )
1165  *parametric = 1; // true
1166  else
1167  *parametric = 0; // false
1168  RETURN( iBase_SUCCESS );
1169 }
1170 void FBiGeom_isArrParametric( FBiGeom_Instance instance, iBase_EntityHandle const*, int, int**, int*, int*, int* err )
1171 {
1172  // not implemented
1174 }
1177  double,
1178  double,
1179  double*,
1180  double*,
1181  double*,
1182  int* err )
1183 {
1185 }
1187  iBase_EntityHandle const*,
1188  int,
1189  int,
1190  double const*,
1191  int,
1192  double**,
1193  int*,
1194  int*,
1195  int* err )
1196 {
1198 }
1199 
1201  iBase_EntityHandle entity_handle,
1202  double u,
1203  double* x,
1204  double* y,
1205  double* z,
1206  int* err )
1207 {
1208  int type;
1209  FBiGeom_getEntType( instance, entity_handle, &type, err );
1210  FWDERR();
1211 
1212  if( type != 1 ) // not edge
1214 
1215  ErrorCode rval = FBE_cast( instance )->getEntUtoXYZ( (EntityHandle)entity_handle, u, *x, *y, *z );CHKERR( rval, "Failed to get position from parameter" );
1216  RETURN( iBase_SUCCESS );
1217 }
1218 
1220  iBase_EntityHandle const*,
1221  int,
1222  double const*,
1223  int,
1224  int,
1225  double**,
1226  int*,
1227  int*,
1228  int* err )
1229 {
1230  // not implemented
1232 }
1235  double,
1236  double,
1237  double,
1238  double*,
1239  double*,
1240  int* err )
1241 {
1243 }
1244 void FBiGeom_getEntXYZtoU( FBiGeom_Instance instance, iBase_EntityHandle, double, double, double, double*, int* err )
1245 {
1247 }
1249  iBase_EntityHandle const*,
1250  int,
1251  int,
1252  double const*,
1253  int,
1254  double**,
1255  int*,
1256  int*,
1257  int* err )
1258 {
1260 }
1262  iBase_EntityHandle const*,
1263  int,
1264  int,
1265  double const*,
1266  int,
1267  double**,
1268  int*,
1269  int*,
1270  int* err )
1271 {
1273 }
1276  double,
1277  double,
1278  double,
1279  double*,
1280  double*,
1281  int* err )
1282 {
1284 }
1286  iBase_EntityHandle const*,
1287  int,
1288  int,
1289  double const*,
1290  int,
1291  double**,
1292  int*,
1293  int*,
1294  int* err )
1295 {
1297 }
1300  double*,
1301  double*,
1302  double*,
1303  double*,
1304  int* err )
1305 {
1307 }
1308 
1310  iBase_EntityHandle entity_handle,
1311  double* u_min,
1312  double* u_max,
1313  int* err )
1314 {
1315  ErrorCode rval = FBE_cast( instance )->getEntURange( (EntityHandle)entity_handle, *u_min, *u_max );CHKERR( rval, "Failed to get range" );
1316  RETURN( iBase_SUCCESS );
1317 }
1319  iBase_EntityHandle const*,
1320  int,
1321  int,
1322  double**,
1323  int*,
1324  int*,
1325  double**,
1326  int*,
1327  int*,
1328  int* err )
1329 {
1331 }
1333  iBase_EntityHandle const*,
1334  int,
1335  double**,
1336  int*,
1337  int*,
1338  double**,
1339  int*,
1340  int*,
1341  int* err )
1342 {
1344 }
1348  double,
1349  double*,
1350  double*,
1351  int* err )
1352 {
1354 }
1355 void FBiGeom_getVtxToUV( FBiGeom_Instance instance, iBase_EntityHandle, iBase_EntityHandle, double*, double*, int* err )
1356 {
1358 }
1360 {
1362 }
1364  iBase_EntityHandle const*,
1365  int,
1366  iBase_EntityHandle const*,
1367  int,
1368  double const*,
1369  int,
1370  int,
1371  double**,
1372  int*,
1373  int*,
1374  int* err )
1375 {
1377 }
1379  iBase_EntityHandle const*,
1380  int,
1381  iBase_EntityHandle const*,
1382  int,
1383  int,
1384  double**,
1385  int*,
1386  int*,
1387  int* err )
1388 {
1390 }
1392  iBase_EntityHandle const*,
1393  int,
1394  iBase_EntityHandle const*,
1395  int,
1396  double**,
1397  int*,
1398  int*,
1399  int* err )
1400 {
1402 }
1405  double,
1406  double,
1407  double*,
1408  double*,
1409  double*,
1410  int* err )
1411 {
1413 }
1415  iBase_EntityHandle const*,
1416  int,
1417  int,
1418  double const*,
1419  int,
1420  double**,
1421  int*,
1422  int*,
1423  int* err )
1424 {
1426 }
1428  iBase_EntityHandle entity_handle,
1429  double u,
1430  double* tgnt_i,
1431  double* tgnt_j,
1432  double* tgnt_k,
1433  int* err )
1434 {
1435  ErrorCode rval =
1436  FBE_cast( instance )->getEntTgntU( (moab::EntityHandle)entity_handle, u, *tgnt_i, *tgnt_j, *tgnt_k );CHKERR( rval, "Failed to get tangent from u" );
1437  RETURN( iBase_SUCCESS );
1438 }
1440  iBase_EntityHandle const*,
1441  int,
1442  int,
1443  double const*,
1444  int,
1445  double**,
1446  int*,
1447  int*,
1448  int* err )
1449 {
1451 }
1454  double,
1455  double,
1456  double**,
1457  int*,
1458  int*,
1459  double**,
1460  int*,
1461  int*,
1462  int* err )
1463 {
1465 }
1467  iBase_EntityHandle const*,
1468  int,
1469  int,
1470  double const*,
1471  int,
1472  double**,
1473  int*,
1474  int*,
1475  int**,
1476  int*,
1477  int*,
1478  double**,
1479  int*,
1480  int*,
1481  int**,
1482  int*,
1483  int*,
1484  int* err )
1485 {
1487 }
1490  double,
1491  double,
1492  double**,
1493  int*,
1494  int*,
1495  double**,
1496  int*,
1497  int*,
1498  double**,
1499  int*,
1500  int*,
1501  int* err )
1502 {
1504 }
1506  iBase_EntityHandle const*,
1507  int,
1508  int,
1509  double const*,
1510  int,
1511  double**,
1512  int*,
1513  int*,
1514  int**,
1515  int*,
1516  int*,
1517  double**,
1518  int*,
1519  int*,
1520  int**,
1521  int*,
1522  int*,
1523  double**,
1524  int*,
1525  int*,
1526  int**,
1527  int*,
1528  int*,
1529  int* err )
1530 {
1532 }
1535  double,
1536  double,
1537  double*,
1538  double*,
1539  double*,
1540  double*,
1541  double*,
1542  double*,
1543  int* err )
1544 {
1546 }
1548  iBase_EntityHandle const*,
1549  int,
1550  int,
1551  double const*,
1552  int,
1553  double**,
1554  int*,
1555  int*,
1556  double**,
1557  int*,
1558  int*,
1559  int* err )
1560 {
1562 }
1564  iBase_EntityHandle /*entity_handle*/,
1565  int* in_u,
1566  int* in_v,
1567  int* err )
1568 {
1569  *in_u = 0;
1570  *in_v = 0;
1571  *err = 0;
1572  return;
1573 }
1574 void FBiGeom_isArrPeriodic( FBiGeom_Instance instance, iBase_EntityHandle const*, int, int**, int*, int*, int* err )
1575 {
1577 }
1579 {
1581 }
1582 void FBiGeom_isFcArrDegenerate( FBiGeom_Instance instance, iBase_EntityHandle const*, int, int**, int*, int*, int* err )
1583 {
1585 }
1586 
1588 {
1590 }
1591 
1594  int,
1595  int,
1597  int* err )
1598 {
1600 }
1601 
1603 {
1605 }
1606 
1610  int*,
1611  int*,
1612  int*,
1613  int* err )
1614 {
1616 }
1617 
1619 {
1621 }
1622 
1624 {
1626 }
1627 
1629 {
1631 }
1632 
1634 {
1636 }
1637 
1639 {
1641 }
1642 
1645  double,
1646  double,
1647  double,
1648  double,
1650  int* err )
1651 {
1653 }
1654 
1655 void FBiGeom_deleteAll( FBiGeom_Instance instance, int* err )
1656 {
1657  // it means deleting some sets from moab db ; is this what we want?
1659 }
1660 
1661 void FBiGeom_deleteEnt( FBiGeom_Instance instance, iBase_EntityHandle /*entity_handle*/, int* err )
1662 {
1664 }
1665 
1666 void FBiGeom_createSphere( FBiGeom_Instance instance, double, iBase_EntityHandle*, int* err )
1667 {
1669 }
1670 
1671 void FBiGeom_createPrism( FBiGeom_Instance instance, double, int, double, double, iBase_EntityHandle*, int* err )
1672 {
1674 }
1675 
1676 void FBiGeom_createBrick( FBiGeom_Instance instance, double, double, double, iBase_EntityHandle*, int* err )
1677 {
1679 }
1680 
1681 void FBiGeom_createCylinder( FBiGeom_Instance instance, double, double, double, iBase_EntityHandle*, int* err )
1682 {
1684 }
1685 
1686 void FBiGeom_createCone( FBiGeom_Instance instance, double, double, double, double, iBase_EntityHandle*, int* err )
1687 {
1689 }
1690 
1691 void FBiGeom_createTorus( FBiGeom_Instance instance, double, double, iBase_EntityHandle*, int* err )
1692 {
1694 }
1695 
1696 void FBiGeom_moveEnt( FBiGeom_Instance instance, iBase_EntityHandle, double, double, double, int* err )
1697 {
1699 }
1700 
1701 void FBiGeom_rotateEnt( FBiGeom_Instance instance, iBase_EntityHandle, double, double, double, double, int* err )
1702 {
1704 }
1705 
1708  double,
1709  double,
1710  double,
1711  double,
1712  double,
1713  double,
1714  int* err )
1715 {
1717 }
1718 
1721  double,
1722  double,
1723  double,
1724  double,
1725  double,
1726  double,
1727  int* err )
1728 {
1730 }
1731 
1733 {
1735 }
1736 
1741  int* err )
1742 {
1744 }
1745 
1750  int* err )
1751 {
1753 }
1754 
1757  double,
1758  double,
1759  double,
1760  double,
1761  int,
1763  int* err )
1764 {
1766 }
1767 
1768 void FBiGeom_imprintEnts( FBiGeom_Instance instance, iBase_EntityHandle const*, int, int* err )
1769 {
1771 }
1772 
1773 void FBiGeom_mergeEnts( FBiGeom_Instance instance, iBase_EntityHandle const*, int, double, int* err )
1774 {
1776 }
1777 // start copy old
1778 
1779 void FBiGeom_createEntSet( FBiGeom_Instance instance, int isList, iBase_EntitySetHandle* entity_set_created, int* err )
1780 {
1781  iMesh_createEntSet( IMESH_INSTANCE( instance ), isList, entity_set_created, err );
1782  FWDERR();
1783 }
1784 
1786 {
1788 }
1789 
1790 void FBiGeom_isList( FBiGeom_Instance instance, iBase_EntitySetHandle, int*, int* err )
1791 {
1793 }
1794 
1796  iBase_EntitySetHandle entity_set_handle,
1797  int /*num_hops*/,
1798  int* num_sets,
1799  int* err )
1800 {
1801  // here, we get only the entity sets that have gents as members
1802  // we have the convention that entity sets of geom dimension 4 are
1803  // sets of geo entities; they should contain only gentities as elements (or other sets of gents)
1804  // we should also consider the number of hops
1805  // first, get all sets of geo dim 4 from the entity_set_handle; then intersect with
1806  // the range from geom topo tool
1807  Tag geomTag;
1808  ErrorCode rval = MBI->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER, geomTag );
1809  if( MB_SUCCESS != rval ) RETURN( iBase_FAILURE );
1810  GeomTopoTool* gtt = GETGTT( instance );
1811  const Range* gRange = gtt->geoRanges();
1812  // get all sets of geom dimension 4 from the entity set
1813  EntityHandle moabSet = (EntityHandle)entity_set_handle;
1814  const int four = 4;
1815  const void* const four_val[] = { &four };
1816  Range tmp;
1817  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 " );
1818  tmp = intersect( tmp, gRange[4] );
1819  *num_sets = tmp.size(); // ignore, for the time being, number of hops
1820 
1821  RETURN( iBase_SUCCESS );
1822 }
1823 
1825  iBase_EntitySetHandle entity_set_handle,
1826  int,
1827  iBase_EntitySetHandle** contained_set_handles,
1828  int* contained_set_handles_allocated,
1829  int* contained_set_handles_size,
1830  int* err )
1831 {
1832  // we get only the entity sets that have gents as members
1833  // we keep the convention that entity sets of geom dimension 4 are
1834  // sets of geo entities; they should contain only gentities as elements (or other sets of gents)
1835  Tag geomTag;
1836  ErrorCode rval = MBI->tag_get_handle( GEOM_DIMENSION_TAG_NAME, 1, MB_TYPE_INTEGER, geomTag );
1837  if( MB_SUCCESS != rval ) RETURN( iBase_FAILURE );
1838  GeomTopoTool* gtt = GETGTT( instance );
1839  const Range* gRange = gtt->geoRanges();
1840  // get all sets of geom dimension 4 from the entity set
1841  EntityHandle moabSet = (EntityHandle)entity_set_handle;
1842  const int four = 4;
1843  const void* const four_val[] = { &four };
1844  Range tmp;
1845  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 " );
1846  tmp = intersect( tmp, gRange[4] );
1847  *contained_set_handles_size = tmp.size();
1848  CHECK_SIZE( *contained_set_handles, *contained_set_handles_allocated, *contained_set_handles_size,
1849  iBase_EntitySetHandle, NULL );
1850  COPY_RANGE( tmp, *contained_set_handles );
1851 
1852  RETURN( iBase_SUCCESS );
1853 }
1854 
1856  iBase_EntityHandle entity_handle,
1857  iBase_EntitySetHandle entity_set,
1858  int* err )
1859 {
1860  iMesh_addEntToSet( IMESH_INSTANCE( instance ), entity_handle, entity_set, err );
1861 }
1862 
1864  iBase_EntityHandle entity_handle,
1865  iBase_EntitySetHandle entity_set,
1866  int* err )
1867 {
1868  iMesh_rmvEntFromSet( IMESH_INSTANCE( instance ), entity_handle, entity_set, err );
1869 }
1870 
1872  const iBase_EntityHandle* entity_handles,
1873  int entity_handles_size,
1874  iBase_EntitySetHandle entity_set,
1875  int* err )
1876 {
1877  iMesh_addEntArrToSet( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, entity_set, err );
1878 }
1879 
1881  const iBase_EntityHandle* entity_handles,
1882  int entity_handles_size,
1883  iBase_EntitySetHandle entity_set,
1884  int* err )
1885 {
1886  iMesh_rmvEntArrFromSet( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, entity_set, err );
1887 }
1888 
1890  iBase_EntitySetHandle entity_set_to_add,
1891  iBase_EntitySetHandle entity_set_handle,
1892  int* err )
1893 {
1894  iMesh_addEntSet( IMESH_INSTANCE( instance ), entity_set_to_add, entity_set_handle, err );
1895 }
1896 
1898  iBase_EntitySetHandle entity_set_to_remove,
1899  iBase_EntitySetHandle entity_set_handle,
1900  int* err )
1901 {
1902  iMesh_rmvEntSet( IMESH_INSTANCE( instance ), entity_set_to_remove, entity_set_handle, err );
1903 }
1904 
1906  iBase_EntitySetHandle containing_entity_set,
1907  iBase_EntityHandle contained_entity,
1908  int* is_contained,
1909  int* err )
1910 {
1911  iMesh_isEntContained( IMESH_INSTANCE( instance ), containing_entity_set, contained_entity, is_contained, err );
1912 }
1913 
1915  iBase_EntitySetHandle containing_set,
1916  const iBase_EntityHandle* entity_handles,
1917  int num_entity_handles,
1918  int** is_contained,
1919  int* is_contained_allocated,
1920  int* is_contained_size,
1921  int* err )
1922 {
1923  iMesh_isEntArrContained( IMESH_INSTANCE( instance ), containing_set, entity_handles, num_entity_handles,
1924  is_contained, is_contained_allocated, is_contained_size, err );
1925 }
1926 
1928  iBase_EntitySetHandle containing_entity_set,
1929  iBase_EntitySetHandle contained_entity_set,
1930  int* is_contained,
1931  int* err )
1932 {
1933  iMesh_isEntSetContained( IMESH_INSTANCE( instance ), containing_entity_set, contained_entity_set, is_contained,
1934  err );
1935 }
1936 
1938  iBase_EntitySetHandle parent_entity_set,
1939  iBase_EntitySetHandle child_entity_set,
1940  int* err )
1941 {
1942  iMesh_addPrntChld( IMESH_INSTANCE( instance ), parent_entity_set, child_entity_set, err );
1943 }
1944 
1946  iBase_EntitySetHandle parent_entity_set,
1947  iBase_EntitySetHandle child_entity_set,
1948  int* err )
1949 {
1950  iMesh_rmvPrntChld( IMESH_INSTANCE( instance ), parent_entity_set, child_entity_set, err );
1951 }
1952 
1954  iBase_EntitySetHandle parent_entity_set,
1955  iBase_EntitySetHandle child_entity_set,
1956  int* is_child,
1957  int* err )
1958 {
1959  iMesh_isChildOf( IMESH_INSTANCE( instance ), parent_entity_set, child_entity_set, is_child, err );
1960 }
1961 
1963  iBase_EntitySetHandle entity_set,
1964  int num_hops,
1965  int* num_child,
1966  int* err )
1967 {
1968  iMesh_getNumChld( IMESH_INSTANCE( instance ), entity_set, num_hops, num_child, err );
1969 }
1970 
1972  iBase_EntitySetHandle entity_set,
1973  int num_hops,
1974  int* num_parent,
1975  int* err )
1976 {
1977  iMesh_getNumPrnt( IMESH_INSTANCE( instance ), entity_set, num_hops, num_parent, err );
1978 }
1979 
1981  iBase_EntitySetHandle from_entity_set,
1982  int num_hops,
1983  iBase_EntitySetHandle** entity_set_handles,
1984  int* entity_set_handles_allocated,
1985  int* entity_set_handles_size,
1986  int* err )
1987 {
1988  iMesh_getChldn( IMESH_INSTANCE( instance ), from_entity_set, num_hops, entity_set_handles,
1989  entity_set_handles_allocated, entity_set_handles_size, err );
1990 }
1991 
1993  iBase_EntitySetHandle from_entity_set,
1994  int num_hops,
1995  iBase_EntitySetHandle** entity_set_handles,
1996  int* entity_set_handles_allocated,
1997  int* entity_set_handles_size,
1998  int* err )
1999 {
2000  iMesh_getPrnts( IMESH_INSTANCE( instance ), from_entity_set, num_hops, entity_set_handles,
2001  entity_set_handles_allocated, entity_set_handles_size, err );
2002 }
2003 
2005  const char* tag_name,
2006  int tag_size,
2007  int tag_type,
2008  iBase_TagHandle* tag_handle,
2009  int* err,
2010  int tag_name_len )
2011 {
2012 
2013  iMesh_createTag( IMESH_INSTANCE( instance ), tag_name, tag_size, tag_type, tag_handle, err, tag_name_len );
2014 }
2015 
2016 void FBiGeom_destroyTag( FBiGeom_Instance instance, iBase_TagHandle tag_handle, int, int* err )
2017 {
2018  ErrorCode rval = MBI->tag_delete( TAG_HANDLE( tag_handle ) );CHKERR( rval, "Failed to delete tag" );
2019  RETURN( iBase_SUCCESS );
2020 }
2021 
2022 void FBiGeom_getTagName( FBiGeom_Instance instance, iBase_TagHandle tag_handle, char* name, int* err, int name_len )
2023 {
2024  iMesh_getTagName( IMESH_INSTANCE( instance ), tag_handle, name, err, name_len );
2025 }
2026 
2027 void FBiGeom_getTagSizeValues( FBiGeom_Instance instance, iBase_TagHandle tag_handle, int* tag_size, int* err )
2028 {
2029  iMesh_getTagSizeValues( IMESH_INSTANCE( instance ), tag_handle, tag_size, err );
2030 }
2031 
2032 void FBiGeom_getTagSizeBytes( FBiGeom_Instance instance, iBase_TagHandle tag_handle, int* tag_size, int* err )
2033 {
2034  iMesh_getTagSizeBytes( IMESH_INSTANCE( instance ), tag_handle, tag_size, err );
2035 }
2036 
2038  const char* tag_name,
2039  iBase_TagHandle* tag_handle,
2040  int* err,
2041  int tag_name_len )
2042 {
2043  iMesh_getTagHandle( IMESH_INSTANCE( instance ), tag_name, tag_handle, err, tag_name_len );
2044 }
2045 
2046 void FBiGeom_getTagType( FBiGeom_Instance instance, iBase_TagHandle tag_handle, int* tag_type, int* err )
2047 {
2048  iMesh_getTagType( IMESH_INSTANCE( instance ), tag_handle, tag_type, err );
2049 }
2050 
2052  iBase_EntitySetHandle entity_set_handle,
2053  iBase_TagHandle tag_handle,
2054  const void* tag_value,
2055  int tag_value_size,
2056  int* err )
2057 {
2058  iMesh_setEntSetData( IMESH_INSTANCE( instance ), entity_set_handle, tag_handle, tag_value, tag_value_size, err );
2059 }
2060 
2062  iBase_EntitySetHandle entity_set,
2063  iBase_TagHandle tag_handle,
2064  int tag_value,
2065  int* err )
2066 {
2067  iMesh_setEntSetIntData( IMESH_INSTANCE( instance ), entity_set, tag_handle, tag_value, err );
2068 }
2069 
2071  iBase_EntitySetHandle entity_set,
2072  iBase_TagHandle tag_handle,
2073  double tag_value,
2074  int* err )
2075 {
2076  iMesh_setEntSetDblData( IMESH_INSTANCE( instance ), entity_set, tag_handle, tag_value, err );
2077 }
2078 
2080  iBase_EntitySetHandle entity_set,
2081  iBase_TagHandle tag_handle,
2082  iBase_EntityHandle tag_value,
2083  int* err )
2084 {
2085  iMesh_setEntSetEHData( IMESH_INSTANCE( instance ), entity_set, tag_handle, tag_value, err );
2086 }
2087 
2089  iBase_EntitySetHandle entity_set,
2090  iBase_TagHandle tag_handle,
2091  iBase_EntitySetHandle tag_value,
2092  int* err )
2093 {
2094  iMesh_setEntSetESHData( IMESH_INSTANCE( instance ), entity_set, tag_handle, tag_value, err );
2095 }
2096 
2098  iBase_EntitySetHandle entity_set_handle,
2099  iBase_TagHandle tag_handle,
2100  void** tag_value,
2101  int* tag_value_allocated,
2102  int* tag_value_size,
2103  int* err )
2104 {
2105  iMesh_getEntSetData( IMESH_INSTANCE( instance ), entity_set_handle, tag_handle, tag_value, tag_value_allocated,
2106  tag_value_size, err );
2107 }
2108 
2110  iBase_EntitySetHandle entity_set,
2111  iBase_TagHandle tag_handle,
2112  int* out_data,
2113  int* err )
2114 {
2115  iMesh_getEntSetIntData( IMESH_INSTANCE( instance ), entity_set, tag_handle, out_data, err );
2116 }
2117 
2119  iBase_EntitySetHandle entity_set,
2120  iBase_TagHandle tag_handle,
2121  double* out_data,
2122  int* err )
2123 {
2124  iMesh_getEntSetDblData( IMESH_INSTANCE( instance ), entity_set, tag_handle, out_data, err );
2125 }
2126 
2128  iBase_EntitySetHandle entity_set,
2129  iBase_TagHandle tag_handle,
2130  iBase_EntityHandle* out_data,
2131  int* err )
2132 {
2133  iMesh_getEntSetEHData( IMESH_INSTANCE( instance ), entity_set, tag_handle, out_data, err );
2134 }
2135 
2137  iBase_EntitySetHandle entity_set,
2138  iBase_TagHandle tag_handle,
2139  iBase_EntitySetHandle* out_data,
2140  int* err )
2141 {
2142  iMesh_getEntSetESHData( IMESH_INSTANCE( instance ), entity_set, tag_handle, out_data, err );
2143 }
2144 
2146  iBase_EntitySetHandle entity_set_handle,
2147  iBase_TagHandle** tag_handles,
2148  int* tag_handles_allocated,
2149  int* tag_handles_size,
2150  int* err )
2151 {
2152  iMesh_getAllEntSetTags( IMESH_INSTANCE( instance ), entity_set_handle, tag_handles, tag_handles_allocated,
2153  tag_handles_size, err );
2154 }
2155 
2157  iBase_EntitySetHandle entity_set_handle,
2158  iBase_TagHandle tag_handle,
2159  int* err )
2160 {
2161  iMesh_rmvEntSetTag( IMESH_INSTANCE( instance ), entity_set_handle, tag_handle, err );
2162 }
2163 
2165  const iBase_EntityHandle* entity_handles,
2166  int entity_handles_size,
2167  iBase_TagHandle tag_handle,
2168  void** tag_values,
2169  int* tag_values_allocated,
2170  int* tag_values_size,
2171  int* err )
2172 {
2173  iMesh_getArrData( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, tag_handle, tag_values,
2174  tag_values_allocated, tag_values_size, err );
2175 }
2176 
2178  const iBase_EntityHandle* entity_handles,
2179  int entity_handles_size,
2180  iBase_TagHandle tag_handle,
2181  int** tag_values,
2182  int* tag_values_allocated,
2183  int* tag_values_size,
2184  int* err )
2185 {
2186  iMesh_getIntArrData( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, tag_handle, tag_values,
2187  tag_values_allocated, tag_values_size, err );
2188 }
2189 
2191  const iBase_EntityHandle* entity_handles,
2192  int entity_handles_size,
2193  iBase_TagHandle tag_handle,
2194  double** tag_values,
2195  int* tag_values_allocated,
2196  int* tag_values_size,
2197  int* err )
2198 {
2199  iMesh_getDblArrData( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, tag_handle, tag_values,
2200  tag_values_allocated, tag_values_size, err );
2201 }
2202 
2204  const iBase_EntityHandle* entity_handles,
2205  int entity_handles_size,
2206  iBase_TagHandle tag_handle,
2207  iBase_EntityHandle** tag_value,
2208  int* tag_value_allocated,
2209  int* tag_value_size,
2210  int* err )
2211 {
2212  iMesh_getEHArrData( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, tag_handle, tag_value,
2213  tag_value_allocated, tag_value_size, err );
2214 }
2215 
2217  const iBase_EntityHandle* entity_handles,
2218  int entity_handles_size,
2219  iBase_TagHandle tag_handle,
2220  iBase_EntitySetHandle** tag_value,
2221  int* tag_value_allocated,
2222  int* tag_value_size,
2223  int* err )
2224 {
2225  iMesh_getESHArrData( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, tag_handle, tag_value,
2226  tag_value_allocated, tag_value_size, err );
2227 }
2228 
2230  const iBase_EntityHandle* entity_handles,
2231  int entity_handles_size,
2232  iBase_TagHandle tag_handle,
2233  const void* tag_values,
2234  int tag_values_size,
2235  int* err )
2236 {
2237  iMesh_setArrData( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, tag_handle, tag_values,
2238  tag_values_size, err );
2239 }
2240 
2242  const iBase_EntityHandle* entity_handles,
2243  int entity_handles_size,
2244  iBase_TagHandle tag_handle,
2245  const int* tag_values,
2246  int tag_values_size,
2247  int* err )
2248 {
2249  iMesh_setIntArrData( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, tag_handle, tag_values,
2250  tag_values_size, err );
2251 }
2252 
2254  const iBase_EntityHandle* entity_handles,
2255  int entity_handles_size,
2256  iBase_TagHandle tag_handle,
2257  const double* tag_values,
2258  const int tag_values_size,
2259  int* err )
2260 {
2261  iMesh_setDblArrData( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, tag_handle, tag_values,
2262  tag_values_size, err );
2263 }
2264 
2266  const iBase_EntityHandle* entity_handles,
2267  int entity_handles_size,
2268  iBase_TagHandle tag_handle,
2269  const iBase_EntityHandle* tag_values,
2270  int tag_values_size,
2271  int* err )
2272 {
2273  iMesh_setEHArrData( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, tag_handle, tag_values,
2274  tag_values_size, err );
2275 }
2276 
2278  const iBase_EntityHandle* entity_handles,
2279  int entity_handles_size,
2280  iBase_TagHandle tag_handle,
2281  const iBase_EntitySetHandle* tag_values,
2282  int tag_values_size,
2283  int* err )
2284 {
2285  iMesh_setESHArrData( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, tag_handle, tag_values,
2286  tag_values_size, err );
2287 }
2288 
2290  const iBase_EntityHandle* entity_handles,
2291  int entity_handles_size,
2292  iBase_TagHandle tag_handle,
2293  int* err )
2294 {
2295  iMesh_rmvArrTag( IMESH_INSTANCE( instance ), entity_handles, entity_handles_size, tag_handle, err );
2296 }
2297 
2299  iBase_EntityHandle entity_handle,
2300  iBase_TagHandle tag_handle,
2301  void** tag_value,
2302  int* tag_value_allocated,
2303  int* tag_value_size,
2304  int* err )
2305 {
2306  iMesh_getData( IMESH_INSTANCE( instance ), entity_handle, tag_handle, tag_value, tag_value_allocated,
2307  tag_value_size, err );
2308 }
2309 
2311  iBase_EntityHandle entity_handle,
2312  iBase_TagHandle tag_handle,
2313  int* out_data,
2314  int* err )
2315 {
2316  iMesh_getIntData( IMESH_INSTANCE( instance ), entity_handle, tag_handle, out_data, err );
2317 }
2318 
2320  const iBase_EntityHandle entity_handle,
2321  const iBase_TagHandle tag_handle,
2322  double* out_data,
2323  int* err )
2324 {
2325  iMesh_getDblData( IMESH_INSTANCE( instance ), entity_handle, tag_handle, out_data, err );
2326 }
2327 
2329  iBase_EntityHandle entity_handle,
2330  iBase_TagHandle tag_handle,
2331  iBase_EntityHandle* out_data,
2332  int* err )
2333 {
2334  iMesh_getEHData( IMESH_INSTANCE( instance ), entity_handle, tag_handle, out_data, err );
2335 }
2336 
2338  iBase_EntityHandle entity_handle,
2339  iBase_TagHandle tag_handle,
2340  iBase_EntitySetHandle* out_data,
2341  int* err )
2342 {
2343  iMesh_getESHData( IMESH_INSTANCE( instance ), entity_handle, tag_handle, out_data, err );
2344 }
2345 
2347  iBase_EntityHandle entity_handle,
2348  iBase_TagHandle tag_handle,
2349  const void* tag_value,
2350  int tag_value_size,
2351  int* err )
2352 {
2353  iMesh_setData( IMESH_INSTANCE( instance ), entity_handle, tag_handle, tag_value, tag_value_size, err );
2354 }
2355 
2357  iBase_EntityHandle entity_handle,
2358  iBase_TagHandle tag_handle,
2359  int tag_value,
2360  int* err )
2361 {
2362  iMesh_setIntData( IMESH_INSTANCE( instance ), entity_handle, tag_handle, tag_value, err );
2363 }
2364 
2366  iBase_EntityHandle entity_handle,
2367  iBase_TagHandle tag_handle,
2368  double tag_value,
2369  int* err )
2370 {
2371  iMesh_setDblData( IMESH_INSTANCE( instance ), entity_handle, tag_handle, tag_value, err );
2372 }
2373 
2375  iBase_EntityHandle entity_handle,
2376  iBase_TagHandle tag_handle,
2377  iBase_EntityHandle tag_value,
2378  int* err )
2379 {
2380  iMesh_setEHData( IMESH_INSTANCE( instance ), entity_handle, tag_handle, tag_value, err );
2381 }
2382 
2384  iBase_EntityHandle entity_handle,
2385  iBase_TagHandle tag_handle,
2386  iBase_EntitySetHandle tag_value,
2387  int* err )
2388 {
2389  iMesh_setESHData( IMESH_INSTANCE( instance ), entity_handle, tag_handle, tag_value, err );
2390 }
2391 
2393  iBase_EntityHandle entity_handle,
2394  iBase_TagHandle** tag_handles,
2395  int* tag_handles_allocated,
2396  int* tag_handles_size,
2397  int* err )
2398 {
2399  iMesh_getAllTags( IMESH_INSTANCE( instance ), entity_handle, tag_handles, tag_handles_allocated, tag_handles_size,
2400  err );
2401 }
2402 
2403 void FBiGeom_rmvTag( FBiGeom_Instance instance, iBase_EntityHandle entity_handle, iBase_TagHandle tag_handle, int* err )
2404 {
2405  iMesh_rmvTag( IMESH_INSTANCE( instance ), entity_handle, tag_handle, err );
2406 }
2407 
2412  int* err )
2413 {
2415 }
2416 
2421  int* err )
2422 {
2424 }
2425 
2430  int* err )
2431 {
2433 }
2434 
2435 // TODO methods not yet implemented
2438  double,
2439  double,
2440  double,
2441  double*,
2442  double*,
2443  double*,
2444  int* err )
2445 {
2447 }
2448 
2451  double,
2452  double,
2453  double,
2454  double*,
2455  double*,
2456  double*,
2457  double*,
2458  double*,
2459  double*,
2460  int* err )
2461 {
2463 }
2464 
2467  double,
2468  double,
2469  double,
2470  double*,
2471  double*,
2472  double*,
2473  int* err )
2474 {
2476 }
2477 
2479  iBase_EntityHandle const*,
2480  int,
2481  int,
2482  double const*,
2483  int,
2484  double**,
2485  int*,
2486  int*,
2487  double**,
2488  int*,
2489  int*,
2490  int* err )
2491 {
2493 }
2494 
2497  double x,
2498  double y,
2499  double z,
2500  double* on_x,
2501  double* on_y,
2502  double* on_z,
2503  double* tngt_i,
2504  double* tngt_j,
2505  double* tngt_k,
2506  double* cvtr_i,
2507  double* cvtr_j,
2508  double* cvtr_k,
2509  int* err )
2510 {
2511  ErrorCode rval = FBE_cast( instance )
2512  ->getEgEvalXYZ( (moab::EntityHandle)edge, x, y, z, *on_x, *on_y, *on_z, *tngt_i, *tngt_j,
2513  *tngt_k, *cvtr_i, *cvtr_j, *cvtr_k );CHKERR( rval, "can't get point on edge " );
2514  RETURN( iBase_SUCCESS );
2515 }
2516 
2518  iBase_EntityHandle face_handle,
2519  double x,
2520  double y,
2521  double z,
2522  double* on_x,
2523  double* on_y,
2524  double* on_z,
2525  double* nrml_i,
2526  double* nrml_j,
2527  double* nrml_k,
2528  double* cvtr1_i,
2529  double* cvtr1_j,
2530  double* cvtr1_k,
2531  double* cvtr2_i,
2532  double* cvtr2_j,
2533  double* cvtr2_k,
2534  int* err )
2535 {
2536  /*
2537  moab::ErrorCode rval = _fbEngine->getFcEvalXYZ( (moab::EntityHandle) face,
2538  x, y, z,
2539  on_x, on_y, on_z,
2540  nrml_i, nrml_j, nrml_k,
2541  cvtr1_i, cvtr1_j, cvtr1_k,
2542  cvtr2_i, cvtr2_j, cvtr2_k );*/
2543  // camal really does not use curvatures
2544  // the most it is calling for normals and for closest point
2545  // return all curvatures = 0 for the time being, because we
2546  // know camal is not requesting them
2547 
2548  *cvtr1_i = *cvtr1_j = *cvtr1_k = *cvtr2_i = *cvtr2_j = *cvtr2_k = 0.;
2549  // first get closest point, then normal, separately
2550  ErrorCode rval =
2551  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 " );
2552  rval = FBE_cast( instance )
2553  ->getEntNrmlXYZ( (moab::EntityHandle)face_handle, x, y, z, nrml_i, nrml_j,
2554  nrml_k ); // some inconsistency here, we use pointers, not refs
2555  CHKERR( rval, "can't get normal on closest point on surface " );
2556  RETURN( iBase_SUCCESS );
2557 }
2558 
2560  iBase_EntityHandle const*,
2561  int,
2562  int,
2563  double const*,
2564  int,
2565  double**,
2566  int*,
2567  int*,
2568  double**,
2569  int*,
2570  int*,
2571  double**,
2572  int*,
2573  int*,
2574  int* err )
2575 {
2577 }
2578 
2580  iBase_EntityHandle const*,
2581  int,
2582  int,
2583  double const*,
2584  int,
2585  double**,
2586  int*,
2587  int*,
2588  double**,
2589  int*,
2590  int*,
2591  double**,
2592  int*,
2593  int*,
2594  double**,
2595  int*,
2596  int*,
2597  int* err )
2598 {
2600 }
2601 
2602 void FBiGeom_getPntClsf( FBiGeom_Instance instance, double, double, double, iBase_EntityHandle*, int* err )
2603 {
2605 }
2606 
2608  int,
2609  double const*,
2610  int,
2612  int*,
2613  int*,
2614  int* err )
2615 {
2617 }
2618 
2621  double,
2622  double,
2623  int,
2624  int,
2625  int,
2626  int,
2627  int,
2628  int* err )
2629 {
2631 }
2632 
2634 {
2636 }
2638  iBase_EntityHandle const*,
2639  int,
2640  double**,
2641  int*,
2642  int*,
2643  int* err )
2644 {
2646 }
2647 void FBiGeom_getTolerance( FBiGeom_Instance instance, int*, double*, int* err )
2648 {
2650 }