MOAB: Mesh Oriented datABase  (version 5.4.1)
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

Defines

#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]

Define Documentation

#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.

Referenced by iMesh_getArrData(), and iMesh_getEntSetData().

#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.

Referenced by iMesh_createTagWithOptions(), iMesh_getEntArr2ndAdj(), iMesh_getEntitiesRec(), iMesh_getEntsByTagsRec(), iMesh_getNumOfTopoRec(), iMesh_getNumOfTypeRec(), iMesh_initEntArrIterRec(), and iMesh_setVtxArrCoords().

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

Definition at line 59 of file iMesh_MOAB.hpp.

#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.

Referenced by iMesh_getArrData(), iMesh_rmvArrTag(), iMesh_setArrData(), and iMesh_setEntSetEHData().

#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.

Referenced by iMeshArrayManager::iMeshArrayManager().

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

Definition at line 43 of file iMesh_MOAB.hpp.

#define PP_CAT_ (   a,
 
)    a##b

Definition at line 42 of file iMesh_MOAB.hpp.

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

Definition at line 45 of file iMesh_MOAB.hpp.

Referenced by iMeshArrayManager::iMeshArrayManager().


Function Documentation

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

Definition at line 167 of file iMesh_MOAB.hpp.

Referenced by filter_options().

{
    for( size_t i = 1; i != n && *str1 && toupper( *str1 ) == toupper( *str2 ); ++i, ++str1, ++str2 )
        ;
    return toupper( *str2 ) - toupper( *str1 );
}
std::string filter_options ( const char *  begin,
const char *  end 
) [inline]

Definition at line 175 of file iMesh_MOAB.hpp.

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

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

{
    const char* opt_begin = begin;
    const char* opt_end   = begin;

    std::string filtered;
    bool first = true;

    while( opt_end != end )
    {
        opt_end = std::find( opt_begin, end, ' ' );

        if( opt_end - opt_begin >= 5 && compare_no_case( opt_begin, "moab:", 5 ) == 0 )
        {
            if( !first ) filtered.push_back( ';' );
            first = false;
            filtered.append( opt_begin + 5, opt_end );
        }

        opt_begin = opt_end + 1;
    }
    return filtered;
}
static bool iMesh_isError ( int  code) [inline, static]

Definition at line 33 of file iMesh_MOAB.hpp.

References iBase_SUCCESS.

{
    return ( iBase_SUCCESS != code );
}
static bool iMesh_isError ( ErrorCode  code) [inline, static]

Definition at line 37 of file iMesh_MOAB.hpp.

References MB_SUCCESS.

{
    return ( MB_SUCCESS != code );
}

Variable Documentation

const iBase_ErrorType iBase_ERROR_MAP[MB_FAILURE+1]

Definition at line 29 of file iMesh_MOAB.hpp.

const iBase_TagValueType tstt_data_type_table[MB_MAX_DATA_TYPE+1]

Definition at line 93 of file iMesh_MOAB.cpp.

Referenced by iMesh_getTagType().

Definition at line 68 of file iMesh_MOAB.cpp.

Referenced by iMesh_getEntArrType(), and iMesh_getEntType().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines