Mesh Oriented datABase
(version 5.4.1)
Array-based unstructured mesh datastructure
|
#include <MBiMesh.hpp>
Public Member Functions | |
MBiMesh (moab::Interface *mbImpl=NULL) | |
virtual | ~MBiMesh () |
bool | have_deleted_ents (bool reset) |
virtual ErrorCode | delete_mesh () |
virtual ErrorCode | delete_entities (const EntityHandle *, const int) |
virtual ErrorCode | delete_entities (const Range &) |
void | note_set_handle_tag (Tag) |
void | note_ent_handle_tag (Tag) |
void | note_tag_destroyed (Tag) |
bool | is_set_handle_tag (Tag) const |
bool | is_ent_handle_tag (Tag) const |
int | set_last_error (int, const char *) |
int | set_last_error (ErrorCode, const char *) |
Public Attributes | |
iBase_AdjacencyCost | AdjTable [16] |
moab::Interface * | mbImpl |
int | lastErrorType |
char | lastErrorDescription [120] |
Private Attributes | |
bool | haveDeletedEntities |
bool | iCreatedInterface |
std::vector< Tag > | setHandleTags |
std::vector< Tag > | entHandleTags |
Definition at line 14 of file MBiMesh.hpp.
MBiMesh::MBiMesh | ( | moab::Interface * | mbImpl = NULL | ) | [inline] |
Definition at line 57 of file MBiMesh.hpp.
References AdjTable, iBase_ALL_ORDER_1, iBase_SOME_ORDER_1, iBase_SOME_ORDER_LOGN, iBase_UNAVAILABLE, iCreatedInterface, lastErrorDescription, and mbImpl.
: haveDeletedEntities( false ), iCreatedInterface( false ), mbImpl( impl ), lastErrorType( iBase_SUCCESS ) { lastErrorDescription[0] = '\0'; iBase_AdjacencyCost tmp_table[] = { iBase_ALL_ORDER_1, iBase_SOME_ORDER_1, iBase_SOME_ORDER_1, iBase_ALL_ORDER_1, iBase_ALL_ORDER_1, iBase_UNAVAILABLE, iBase_SOME_ORDER_LOGN, iBase_SOME_ORDER_LOGN, iBase_ALL_ORDER_1, iBase_SOME_ORDER_LOGN, iBase_UNAVAILABLE, iBase_SOME_ORDER_LOGN, iBase_ALL_ORDER_1, iBase_SOME_ORDER_LOGN, iBase_SOME_ORDER_LOGN, iBase_ALL_ORDER_1 }; memcpy( AdjTable, tmp_table, 16 * sizeof( iBase_AdjacencyCost ) ); if( !mbImpl ) { mbImpl = new Core(); iCreatedInterface = true; } }
MBiMesh::~MBiMesh | ( | ) | [inline, virtual] |
Definition at line 77 of file MBiMesh.hpp.
References iCreatedInterface, and mbImpl.
{ if( iCreatedInterface ) delete mbImpl; }
ErrorCode MBiMesh::delete_entities | ( | const EntityHandle * | a, |
const int | n | ||
) | [inline, virtual] |
Definition at line 88 of file MBiMesh.hpp.
References moab::Interface::delete_entities(), haveDeletedEntities, and mbImpl.
{ if( n > 0 ) haveDeletedEntities = true; return mbImpl->delete_entities( a, n ); }
ErrorCode MBiMesh::delete_entities | ( | const Range & | r | ) | [inline, virtual] |
Definition at line 94 of file MBiMesh.hpp.
References moab::Interface::delete_entities(), moab::Range::empty(), haveDeletedEntities, and mbImpl.
{ if( !r.empty() ) haveDeletedEntities = true; return mbImpl->delete_entities( r ); }
ErrorCode MBiMesh::delete_mesh | ( | ) | [inline, virtual] |
Definition at line 82 of file MBiMesh.hpp.
References moab::Interface::delete_mesh(), haveDeletedEntities, and mbImpl.
{ haveDeletedEntities = true; return mbImpl->delete_mesh(); }
bool MBiMesh::have_deleted_ents | ( | bool | reset | ) | [inline] |
Definition at line 25 of file MBiMesh.hpp.
{ bool result = haveDeletedEntities; if( reset ) haveDeletedEntities = false; return result; }
bool MBiMesh::is_ent_handle_tag | ( | Tag | t | ) | const [inline] |
Definition at line 132 of file MBiMesh.hpp.
References entHandleTags, and t.
{ return std::binary_search( entHandleTags.begin(), entHandleTags.end(), t ); }
bool MBiMesh::is_set_handle_tag | ( | Tag | t | ) | const [inline] |
Definition at line 127 of file MBiMesh.hpp.
References setHandleTags, and t.
{ return std::binary_search( setHandleTags.begin(), setHandleTags.end(), t ); }
void MBiMesh::note_ent_handle_tag | ( | Tag | t | ) | [inline] |
Definition at line 109 of file MBiMesh.hpp.
References entHandleTags, setHandleTags, and t.
Referenced by check_handle_tag_type().
{ std::vector< Tag >::iterator i; i = std::lower_bound( setHandleTags.begin(), setHandleTags.end(), t ); if( i != setHandleTags.end() && *i == t ) setHandleTags.erase( i ); i = std::lower_bound( entHandleTags.begin(), entHandleTags.end(), t ); if( i == entHandleTags.end() || *i != t ) entHandleTags.insert( i, t ); }
void MBiMesh::note_set_handle_tag | ( | Tag | t | ) | [inline] |
Definition at line 100 of file MBiMesh.hpp.
References entHandleTags, setHandleTags, and t.
Referenced by check_handle_tag_type().
{ std::vector< Tag >::iterator i; i = std::lower_bound( entHandleTags.begin(), entHandleTags.end(), t ); if( i != entHandleTags.end() && *i == t ) entHandleTags.erase( i ); i = std::lower_bound( setHandleTags.begin(), setHandleTags.end(), t ); if( i == setHandleTags.end() || *i != t ) setHandleTags.insert( i, t ); }
void MBiMesh::note_tag_destroyed | ( | Tag | t | ) | [inline] |
Definition at line 118 of file MBiMesh.hpp.
References entHandleTags, setHandleTags, and t.
{ std::vector< Tag >::iterator i; i = std::lower_bound( setHandleTags.begin(), setHandleTags.end(), t ); if( i != setHandleTags.end() && *i == t ) setHandleTags.erase( i ); i = std::lower_bound( entHandleTags.begin(), entHandleTags.end(), t ); if( i != entHandleTags.end() && *i == t ) entHandleTags.erase( i ); }
int MBiMesh::set_last_error | ( | int | code, |
const char * | msg | ||
) | [inline] |
Definition at line 137 of file MBiMesh.hpp.
References lastErrorDescription, and lastErrorType.
Referenced by iMesh_newMesh(), and set_last_error().
{ std::strncpy( lastErrorDescription, msg, sizeof( lastErrorDescription ) ); lastErrorDescription[sizeof( lastErrorDescription ) - 1] = '\0'; return ( lastErrorType = static_cast< iBase_ErrorType >( code ) ); }
int MBiMesh::set_last_error | ( | ErrorCode | code, |
const char * | msg | ||
) | [inline] |
Definition at line 144 of file MBiMesh.hpp.
References moab::Interface::get_error_string(), iBase_ERROR_MAP, mbImpl, and set_last_error().
{ std::string message( msg ); message += " (MOAB Error Code: "; message += mbImpl->get_error_string( code ); message += ")"; return set_last_error( iBase_ERROR_MAP[code], message.c_str() ); }
Definition at line 35 of file MBiMesh.hpp.
Referenced by create_int_ents(), and MBiMesh().
std::vector< Tag > MBiMesh::entHandleTags [private] |
Definition at line 19 of file MBiMesh.hpp.
Referenced by is_ent_handle_tag(), note_ent_handle_tag(), note_set_handle_tag(), and note_tag_destroyed().
bool MBiMesh::haveDeletedEntities [private] |
Definition at line 17 of file MBiMesh.hpp.
Referenced by delete_entities(), and delete_mesh().
bool MBiMesh::iCreatedInterface [private] |
Definition at line 18 of file MBiMesh.hpp.
Referenced by MBiMesh(), and ~MBiMesh().
char MBiMesh::lastErrorDescription[120] |
Definition at line 38 of file MBiMesh.hpp.
Referenced by MBiMesh(), and set_last_error().
Definition at line 37 of file MBiMesh.hpp.
Referenced by set_last_error().
Definition at line 36 of file MBiMesh.hpp.
Referenced by check_handle_tag_type(), create_int_ents(), delete_entities(), delete_mesh(), FBiGeom_newGeomFromMesh(), MBiGeom::MBiGeom(), MBiMesh(), MBiGeom::moabItf(), set_last_error(), and ~MBiMesh().
std::vector< Tag > MBiMesh::setHandleTags [private] |
Definition at line 19 of file MBiMesh.hpp.
Referenced by is_set_handle_tag(), note_ent_handle_tag(), note_set_handle_tag(), and note_tag_destroyed().