moab
|
#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 53 of file MBiMesh.hpp.
: 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 73 of file MBiMesh.hpp.
{ if (iCreatedInterface) delete mbImpl; }
ErrorCode MBiMesh::delete_entities | ( | const EntityHandle * | a, |
const int | n | ||
) | [inline, virtual] |
Definition at line 83 of file MBiMesh.hpp.
{ if (n > 0) haveDeletedEntities = true; return mbImpl->delete_entities( a, n ); }
ErrorCode MBiMesh::delete_entities | ( | const Range & | r | ) | [inline, virtual] |
Definition at line 90 of file MBiMesh.hpp.
{ if (!r.empty()) haveDeletedEntities = true; return mbImpl->delete_entities( r ); }
ErrorCode MBiMesh::delete_mesh | ( | ) | [inline, virtual] |
Definition at line 78 of file MBiMesh.hpp.
{ haveDeletedEntities = true; return mbImpl->delete_mesh(); }
bool MBiMesh::have_deleted_ents | ( | bool | reset | ) | [inline] |
Definition at line 24 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 136 of file MBiMesh.hpp.
{ return std::binary_search( entHandleTags.begin(), entHandleTags.end(), t ); }
bool MBiMesh::is_set_handle_tag | ( | Tag | t | ) | const [inline] |
Definition at line 131 of file MBiMesh.hpp.
{ 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.
{ 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 98 of file MBiMesh.hpp.
{ 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 120 of file MBiMesh.hpp.
{ 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 141 of file MBiMesh.hpp.
{ 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 148 of file MBiMesh.hpp.
{ 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 34 of file MBiMesh.hpp.
std::vector<Tag> MBiMesh::entHandleTags [private] |
Definition at line 19 of file MBiMesh.hpp.
bool MBiMesh::haveDeletedEntities [private] |
Definition at line 17 of file MBiMesh.hpp.
bool MBiMesh::iCreatedInterface [private] |
Definition at line 18 of file MBiMesh.hpp.
char MBiMesh::lastErrorDescription[120] |
Definition at line 37 of file MBiMesh.hpp.
Definition at line 36 of file MBiMesh.hpp.
Definition at line 35 of file MBiMesh.hpp.
std::vector<Tag> MBiMesh::setHandleTags [private] |
Definition at line 19 of file MBiMesh.hpp.