MOAB: Mesh Oriented datABase  (version 5.4.1)
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 ( ) [inline, virtual]

Definition at line 77 of file MBiMesh.hpp.

References iCreatedInterface, and mbImpl.

{
    if( iCreatedInterface ) delete mbImpl;
}

Member Function Documentation

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() );
}

Member Data Documentation

Definition at line 35 of file MBiMesh.hpp.

Referenced by create_int_ents(), and MBiMesh().

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

Definition at line 17 of file MBiMesh.hpp.

Referenced by delete_entities(), and delete_mesh().

Definition at line 18 of file MBiMesh.hpp.

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

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().

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

List of all members.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines