MOAB: Mesh Oriented datABase  (version 5.5.0)
MBiMesh Class Reference

#include <MBiMesh.hpp>

+ Collaboration diagram for MBiMesh:

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::InterfacembImpl
 
int lastErrorType
 
char lastErrorDescription [120]
 

Private Attributes

bool haveDeletedEntities
 
bool iCreatedInterface
 
std::vector< TagsetHandleTags
 
std::vector< TagentHandleTags
 

Detailed Description

Definition at line 14 of file MBiMesh.hpp.

Constructor & Destructor Documentation

◆ MBiMesh()

◆ ~MBiMesh()

MBiMesh::~MBiMesh ( )
inlinevirtual

Definition at line 77 of file MBiMesh.hpp.

78 {
79  if( iCreatedInterface ) delete mbImpl;
80 }

References iCreatedInterface, and mbImpl.

Member Function Documentation

◆ delete_entities() [1/2]

ErrorCode MBiMesh::delete_entities ( const EntityHandle a,
const int  n 
)
inlinevirtual

Definition at line 88 of file MBiMesh.hpp.

89 {
90  if( n > 0 ) haveDeletedEntities = true;
91  return mbImpl->delete_entities( a, n );
92 }

References moab::Interface::delete_entities(), haveDeletedEntities, and mbImpl.

◆ delete_entities() [2/2]

ErrorCode MBiMesh::delete_entities ( const Range r)
inlinevirtual

Definition at line 94 of file MBiMesh.hpp.

95 {
96  if( !r.empty() ) haveDeletedEntities = true;
97  return mbImpl->delete_entities( r );
98 }

References moab::Interface::delete_entities(), moab::Range::empty(), haveDeletedEntities, and mbImpl.

◆ delete_mesh()

ErrorCode MBiMesh::delete_mesh ( )
inlinevirtual

Definition at line 82 of file MBiMesh.hpp.

83 {
84  haveDeletedEntities = true;
85  return mbImpl->delete_mesh();
86 }

References moab::Interface::delete_mesh(), haveDeletedEntities, and mbImpl.

◆ have_deleted_ents()

bool MBiMesh::have_deleted_ents ( bool  reset)
inline

Definition at line 25 of file MBiMesh.hpp.

26  {
27  bool result = haveDeletedEntities;
28  if( reset ) haveDeletedEntities = false;
29  return result;
30  }

◆ is_ent_handle_tag()

bool MBiMesh::is_ent_handle_tag ( Tag  t) const
inline

Definition at line 132 of file MBiMesh.hpp.

133 {
134  return std::binary_search( entHandleTags.begin(), entHandleTags.end(), t );
135 }

References entHandleTags, and t.

◆ is_set_handle_tag()

bool MBiMesh::is_set_handle_tag ( Tag  t) const
inline

Definition at line 127 of file MBiMesh.hpp.

128 {
129  return std::binary_search( setHandleTags.begin(), setHandleTags.end(), t );
130 }

References setHandleTags, and t.

◆ note_ent_handle_tag()

void MBiMesh::note_ent_handle_tag ( Tag  t)
inline

Definition at line 109 of file MBiMesh.hpp.

110 {
111  std::vector< Tag >::iterator i;
112  i = std::lower_bound( setHandleTags.begin(), setHandleTags.end(), t );
113  if( i != setHandleTags.end() && *i == t ) setHandleTags.erase( i );
114  i = std::lower_bound( entHandleTags.begin(), entHandleTags.end(), t );
115  if( i == entHandleTags.end() || *i != t ) entHandleTags.insert( i, t );
116 }

References entHandleTags, setHandleTags, and t.

Referenced by check_handle_tag_type().

◆ note_set_handle_tag()

void MBiMesh::note_set_handle_tag ( Tag  t)
inline

Definition at line 100 of file MBiMesh.hpp.

101 {
102  std::vector< Tag >::iterator i;
103  i = std::lower_bound( entHandleTags.begin(), entHandleTags.end(), t );
104  if( i != entHandleTags.end() && *i == t ) entHandleTags.erase( i );
105  i = std::lower_bound( setHandleTags.begin(), setHandleTags.end(), t );
106  if( i == setHandleTags.end() || *i != t ) setHandleTags.insert( i, t );
107 }

References entHandleTags, setHandleTags, and t.

Referenced by check_handle_tag_type().

◆ note_tag_destroyed()

void MBiMesh::note_tag_destroyed ( Tag  t)
inline

Definition at line 118 of file MBiMesh.hpp.

119 {
120  std::vector< Tag >::iterator i;
121  i = std::lower_bound( setHandleTags.begin(), setHandleTags.end(), t );
122  if( i != setHandleTags.end() && *i == t ) setHandleTags.erase( i );
123  i = std::lower_bound( entHandleTags.begin(), entHandleTags.end(), t );
124  if( i != entHandleTags.end() && *i == t ) entHandleTags.erase( i );
125 }

References entHandleTags, setHandleTags, and t.

◆ set_last_error() [1/2]

int MBiMesh::set_last_error ( ErrorCode  code,
const char *  msg 
)
inline

Definition at line 144 of file MBiMesh.hpp.

145 {
146  std::string message( msg );
147  message += " (MOAB Error Code: ";
148  message += mbImpl->get_error_string( code );
149  message += ")";
150  return set_last_error( iBase_ERROR_MAP[code], message.c_str() );
151 }

References moab::Interface::get_error_string(), iBase_ERROR_MAP, mbImpl, and set_last_error().

◆ set_last_error() [2/2]

int MBiMesh::set_last_error ( int  code,
const char *  msg 
)
inline

Definition at line 137 of file MBiMesh.hpp.

138 {
139  std::strncpy( lastErrorDescription, msg, sizeof( lastErrorDescription ) );
140  lastErrorDescription[sizeof( lastErrorDescription ) - 1] = '\0';
141  return ( lastErrorType = static_cast< iBase_ErrorType >( code ) );
142 }

References lastErrorDescription, and lastErrorType.

Referenced by iMesh_newMesh(), and set_last_error().

Member Data Documentation

◆ AdjTable

iBase_AdjacencyCost MBiMesh::AdjTable[16]

Definition at line 35 of file MBiMesh.hpp.

Referenced by create_int_ents(), and MBiMesh().

◆ entHandleTags

std::vector< Tag > MBiMesh::entHandleTags
private

◆ haveDeletedEntities

bool MBiMesh::haveDeletedEntities
private

Definition at line 17 of file MBiMesh.hpp.

Referenced by delete_entities(), and delete_mesh().

◆ iCreatedInterface

bool MBiMesh::iCreatedInterface
private

Definition at line 18 of file MBiMesh.hpp.

Referenced by MBiMesh(), and ~MBiMesh().

◆ lastErrorDescription

char MBiMesh::lastErrorDescription[120]

Definition at line 38 of file MBiMesh.hpp.

Referenced by MBiMesh(), and set_last_error().

◆ lastErrorType

int MBiMesh::lastErrorType

Definition at line 37 of file MBiMesh.hpp.

Referenced by set_last_error().

◆ mbImpl

◆ setHandleTags

std::vector< Tag > MBiMesh::setHandleTags
private

The documentation for this class was generated from the following file: