MOAB: Mesh Oriented datABase  (version 5.5.0)
iMesh_MOAB.hpp File Reference
#include "iMesh.h"
#include "MBiMesh.hpp"
#include "moab/Forward.hpp"
#include <cstring>
#include <cstdlib>
#include <cstdio>
+ Include dependency graph for iMesh_MOAB.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  iMeshArrayManager
 

Macros

#define PP_CAT_(a, b)   a##b
 
#define PP_CAT(a, b)   PP_CAT_( a, b )
 
#define RETURN(CODE)
 
#define ERROR(CODE, MSG)
 
#define CHKERR(CODE, MSG)
 
#define CHKENUM(VAL, TYPE, ERR)
 
#define CHKTAGTYPE(TAG, TYPE)
 
#define CHKNONEMPTY()
 
#define ALLOC_CHECK_ARRAY(array, this_size)
 
#define ALLOC_CHECK_TAG_ARRAY(array, this_size)
 
#define KEEP_ARRAY(array)   array##_manager.keep_array()
 
#define ALLOC_CHECK_ARRAY_NOFAIL(array, this_size)
 

Functions

static bool iMesh_isError (int code)
 
static bool iMesh_isError (ErrorCode code)
 
int compare_no_case (const char *str1, const char *str2, size_t n)
 
std::string filter_options (const char *begin, const char *end)
 

Variables

const iMesh_EntityTopology tstt_topology_table [MBMAXTYPE+1]
 
const iBase_EntityType tstt_type_table [MBMAXTYPE+1]
 
const EntityType mb_topology_table [MBMAXTYPE+1]
 
const DataType mb_data_type_table [iBase_TagValueType_MAX+1]
 
const iBase_TagValueType tstt_data_type_table [MB_MAX_DATA_TYPE+1]
 
const iBase_ErrorType iBase_ERROR_MAP [MB_FAILURE+1]
 

Macro Definition Documentation

◆ ALLOC_CHECK_ARRAY

#define ALLOC_CHECK_ARRAY (   array,
  this_size 
)
Value:
iMeshArrayManager array##_manager( instance, reinterpret_cast< void** >( array ), *( array##_allocated ), \
*( array##_size ), this_size, sizeof( **( array ) ), err ); \
if( iBase_SUCCESS != *err ) return

Definition at line 98 of file iMesh_MOAB.hpp.

◆ ALLOC_CHECK_ARRAY_NOFAIL

#define ALLOC_CHECK_ARRAY_NOFAIL (   array,
  this_size 
)
Value:
ALLOC_CHECK_ARRAY( array, this_size ); \
KEEP_ARRAY( array )

Definition at line 112 of file iMesh_MOAB.hpp.

◆ ALLOC_CHECK_TAG_ARRAY

#define ALLOC_CHECK_TAG_ARRAY (   array,
  this_size 
)
Value:
iMeshArrayManager array##_manager( instance, reinterpret_cast< void** >( array ), *( array##_allocated ), \
*( array##_size ), this_size, 1, err ); \
if( iBase_SUCCESS != *err ) return

Definition at line 103 of file iMesh_MOAB.hpp.

◆ CHKENUM

#define CHKENUM (   VAL,
  TYPE,
  ERR 
)
Value:
do \
{ \
if( ( VAL ) < PP_CAT( TYPE, _MIN ) || ( VAL ) > PP_CAT( TYPE, _MAX ) ) \
ERROR( ( ERR ), "Invalid enumeration value" ); \
} while( false )

Definition at line 65 of file iMesh_MOAB.hpp.

◆ CHKERR

#define CHKERR (   CODE,
  MSG 
)
Value:
do \
{ \
if( iMesh_isError( ( CODE ) ) ) ERROR( ( CODE ), ( MSG ) ); \
} while( false )

Definition at line 59 of file iMesh_MOAB.hpp.

◆ CHKNONEMPTY

#define CHKNONEMPTY ( )
Value:
do \
{ \
int count, result; \
iMesh_getNumOfType( instance, 0, iBase_ALL_TYPES, &count, &result ); \
CHKERR( result, "Couldn't get number of entities" ); \
if( count == 0 ) ERROR( iBase_INVALID_ENTITY_HANDLE, "Invalid entity handle: mesh is empty" ); \
} while( false )

Definition at line 86 of file iMesh_MOAB.hpp.

◆ CHKTAGTYPE

#define CHKTAGTYPE (   TAG,
  TYPE 
)
Value:
do \
{ \
int type, result; \
iMesh_getTagType( instance, ( TAG ), &type, &result ); \
CHKERR( result, "Couldn't get tag data type" ); \
if( ( type == iBase_ENTITY_HANDLE && ( TYPE ) == iBase_ENTITY_SET_HANDLE ) || \
( type == iBase_ENTITY_SET_HANDLE && ( TYPE ) == iBase_ENTITY_HANDLE ) ) \
break; \
if( type != ( TYPE ) ) ERROR( iBase_INVALID_TAG_HANDLE, "Invalid tag data type" ); \
} while( false )

Definition at line 74 of file iMesh_MOAB.hpp.

◆ ERROR

#define ERROR (   CODE,
  MSG 
)
Value:
do \
{ \
*err = MBIMESHI->set_last_error( ( CODE ), ( MSG ) ); \
return; \
} while( false )

Definition at line 52 of file iMesh_MOAB.hpp.

◆ KEEP_ARRAY

#define KEEP_ARRAY (   array)    array##_manager.keep_array()

Definition at line 108 of file iMesh_MOAB.hpp.

◆ PP_CAT

#define PP_CAT (   a,
 
)    PP_CAT_( a, b )

Definition at line 43 of file iMesh_MOAB.hpp.

◆ PP_CAT_

#define PP_CAT_ (   a,
 
)    a##b

Definition at line 42 of file iMesh_MOAB.hpp.

◆ RETURN

#define RETURN (   CODE)
Value:
do \
{ \
*err = MBIMESHI->set_last_error( ( CODE ), "" ); \
return; \
} while( false )

Definition at line 45 of file iMesh_MOAB.hpp.

Function Documentation

◆ compare_no_case()

int compare_no_case ( const char *  str1,
const char *  str2,
size_t  n 
)
inline

Definition at line 167 of file iMesh_MOAB.hpp.

168 {
169  for( size_t i = 1; i != n && *str1 && toupper( *str1 ) == toupper( *str2 ); ++i, ++str1, ++str2 )
170  ;
171  return toupper( *str2 ) - toupper( *str1 );
172 }

Referenced by filter_options().

◆ filter_options()

std::string filter_options ( const char *  begin,
const char *  end 
)
inline

Definition at line 175 of file iMesh_MOAB.hpp.

176 {
177  const char* opt_begin = begin;
178  const char* opt_end = begin;
179 
180  std::string filtered;
181  bool first = true;
182 
183  while( opt_end != end )
184  {
185  opt_end = std::find( opt_begin, end, ' ' );
186 
187  if( opt_end - opt_begin >= 5 && compare_no_case( opt_begin, "moab:", 5 ) == 0 )
188  {
189  if( !first ) filtered.push_back( ';' );
190  first = false;
191  filtered.append( opt_begin + 5, opt_end );
192  }
193 
194  opt_begin = opt_end + 1;
195  }
196  return filtered;
197 }

References compare_no_case(), and moab::GeomUtil::first().

Referenced by iMesh_createTagWithOptions(), iMesh_load(), iMesh_newMesh(), and iMesh_save().

◆ iMesh_isError() [1/2]

static bool iMesh_isError ( ErrorCode  code)
inlinestatic

Definition at line 37 of file iMesh_MOAB.hpp.

38 {
39  return ( MB_SUCCESS != code );
40 }

References MB_SUCCESS.

◆ iMesh_isError() [2/2]

static bool iMesh_isError ( int  code)
inlinestatic

Definition at line 33 of file iMesh_MOAB.hpp.

34 {
35  return ( iBase_SUCCESS != code );
36 }

References iBase_SUCCESS.

Variable Documentation

◆ iBase_ERROR_MAP

const iBase_ErrorType iBase_ERROR_MAP[MB_FAILURE+1]

Definition at line 29 of file iMesh_MOAB.hpp.

◆ mb_data_type_table

const DataType mb_data_type_table[iBase_TagValueType_MAX+1]
extern

Definition at line 89 of file iMesh_MOAB.cpp.

Referenced by iMesh_createTagWithOptions().

◆ mb_topology_table

◆ tstt_data_type_table

const iBase_TagValueType tstt_data_type_table[MB_MAX_DATA_TYPE+1]
extern

Definition at line 93 of file iMesh_MOAB.cpp.

Referenced by iMesh_getTagType().

◆ tstt_topology_table

const iMesh_EntityTopology tstt_topology_table[MBMAXTYPE+1]
extern

Definition at line 51 of file iMesh_MOAB.cpp.

Referenced by iMesh_getEntArrTopo(), and iMesh_getEntTopo().

◆ tstt_type_table

const iBase_EntityType tstt_type_table[MBMAXTYPE+1]
extern

Definition at line 68 of file iMesh_MOAB.cpp.

Referenced by iMesh_getEntArrType(), and iMesh_getEntType().