1 #ifndef FBIGEOM_MOAB_HPP
2 #define FBIGEOM_MOAB_HPP
64 return reinterpret_cast< MBiGeom*
>( i )->moabItf();
67 #define MBI MBI_cast( instance )
71 return reinterpret_cast< MBiGeom*
>( i )->FBItf();
80 #define GETGTT( a ) ( reinterpret_cast< MBiGeom* >( a )->FBItf()->get_gtt() )
92 #define IMESH_INSTANCE( i ) reinterpret_cast< iMesh_Instance >( reinterpret_cast< MBiGeom* >( i )->mbimesh() )
96 #define MBIM ( reinterpret_cast< MBiGeom* >( instance )->mbimesh() )
98 #define RETURN( CODE ) \
101 *err = MBIM->set_last_error( ( CODE ), "" ); \
105 #define ERROR( CODE, MSG ) \
108 *err = MBIM->set_last_error( ( CODE ), ( MSG ) ); \
112 #define CHKERR( CODE, MSG ) \
115 if( FBiGeom_isError( ( CODE ) ) ) ERROR( ( CODE ), ( MSG ) ); \
121 if( FBiGeom_isError( *err ) ) return; \
124 #define CHECK_SIZE( array, allocated, size, type, retval ) \
127 if( 0 != ( allocated ) && NULL != ( array ) && ( allocated ) < ( size ) ) \
129 ERROR( iBase_MEMORY_ALLOCATION_FAILED, "Allocated array not " \
130 "enough to hold returned contents." ); \
132 if( ( size ) && ( ( allocated ) == 0 || NULL == ( array ) ) ) \
134 ( array ) = (type*)malloc( ( size ) * sizeof( type ) ); \
135 ( allocated ) = ( size ); \
136 if( NULL == ( array ) ) \
138 ERROR( iBase_MEMORY_ALLOCATION_FAILED, "Couldn't allocate array." ); \