MOAB: Mesh Oriented datABase  (version 5.3.1)
moab::DamselUtil Class Reference

#include <DamselUtil.hpp>

+ Collaboration diagram for moab::DamselUtil:

Classes

struct  DtagP
struct  MtagP
class  tinfo
 struct to hold information on damsel/moab tags More...

Public Member Functions

 DamselUtil ()
 Needs to be a constructor to initialize dtom_data_type.

Static Public Member Functions

static ErrorCode container_to_range (damsel_model m, damsel_container &cont, Range &range)

Static Public Attributes

static damsel_data_type mtod_data_type [MB_MAX_DATA_TYPE+1]
static enum DataType dtom_data_type [DAMSEL_DATA_TYPE_PREDEFINED_WATERMARK+1]
static enum damsel_entity_type mtod_entity_type [MBMAXTYPE+1]
static enum EntityType dtom_entity_type [DAMSEL_ENTITY_TYPE_ALL_TYPES+1]

Private Attributes

damsel_library dmslLib
 Damsel library id.
damsel_model dmslModel
 Damsel model id.
tinfo xcoordsTag
 Other conventional tags.
tinfo ycoordsTag
tinfo zcoordsTag
tinfo collFlagsTag
tinfo parentsTag
tinfo childrenTag
std::vector< tinfotagMap
 MOAB/damsel handles for dense [0], sparse [1], and conventional [2] tags.
damsel_handle_type moabHandleType
 Damsel handle type used in (this build of) MOAB.

Friends

class WriteDamsel
class ReadDamsel

Detailed Description

Definition at line 37 of file DamselUtil.hpp.


Constructor & Destructor Documentation

Needs to be a constructor to initialize dtom_data_type.

Definition at line 60 of file DamselUtil.cpp.

    : dmslLib( DAMSEL_LIBRARY_INVALID ), dmslModel( DAMSEL_MODEL_INVALID ), moabHandleType( DAMSEL_HANDLE_TYPE_INVALID )
{
}

Member Function Documentation

ErrorCode moab::DamselUtil::container_to_range ( damsel_model  m,
damsel_container &  c,
Range r 
) [static]

Convert handles in a container to a range; assumes EntityHandle and Damsel entity handles are the same size

Definition at line 67 of file DamselUtil.cpp.

References CHK_DMSL_ERR_NM, ErrorCode, moab::Range::insert(), and MB_SUCCESS.

Referenced by moab::ReadDamsel::process_ent_info().

{
    if( DMSLcontainer_get_type( c ) == DAMSEL_HANDLE_CONTAINER_TYPE_SEQUENCE )
    {
        damsel_handle start;
        size_t count, stride;
        damsel_err_t err = DMSLcontainer_sequence_get_contents( m, c, &start, &count, &stride );
        CHK_DMSL_ERR_NM( err );
        for( damsel_handle i = start + ( count - 1 ) * stride; i >= start; i -= stride )
            r.insert( i );
    }
    else if( DMSLcontainer_get_type( c ) == DAMSEL_HANDLE_CONTAINER_TYPE_VECTOR )
    {
        damsel_handle* handle_ptr;
        size_t count;
        damsel_err_t err = DMSLcontainer_vector_get_contents( m, c, &handle_ptr, &count );
        CHK_DMSL_ERR_NM( err );
        for( int i = count - 1; i >= 0; i-- )
            r.insert( handle_ptr[i] );
    }
    else if( DMSLcontainer_get_type( c ) == DAMSEL_HANDLE_CONTAINER_TYPE_TREE )
    {
        damsel_handle_ptr node_ptr = NULL;
        damsel_container cont      = NULL;
        damsel_err_t err           = DMSLcontainer_tree_get_contents( m, c, &node_ptr, &cont );
        while( err.id == DMSL_OK.id && cont )
        {
            ErrorCode rval = container_to_range( m, c, r );
            if( MB_SUCCESS != rval ) return rval;
            err = DMSLcontainer_tree_get_contents( m, c, &node_ptr, &cont );
        }
    }

    return MB_SUCCESS;
}

Friends And Related Function Documentation

friend class ReadDamsel [friend]

Definition at line 41 of file DamselUtil.hpp.

friend class WriteDamsel [friend]

Definition at line 40 of file DamselUtil.hpp.


Member Data Documentation

Definition at line 116 of file DamselUtil.hpp.

Referenced by moab::ReadDamsel::process_tags().

damsel_library moab::DamselUtil::dmslLib [private]

Damsel library id.

Definition at line 110 of file DamselUtil.hpp.

Referenced by moab::ReadDamsel::load_file(), moab::WriteDamsel::write_file(), and moab::ReadDamsel::~ReadDamsel().

Initial value:

Definition at line 52 of file DamselUtil.hpp.

Referenced by moab::ReadDamsel::process_ent_info().

damsel_handle_type moab::DamselUtil::moabHandleType [private]

Damsel handle type used in (this build of) MOAB.

Definition at line 122 of file DamselUtil.hpp.

Referenced by moab::WriteDamsel::WriteDamsel().

damsel_data_type moab::DamselUtil::mtod_data_type [static]
Initial value:
 {
    DAMSEL_DATA_TYPE_BYTES,    
    DAMSEL_DATA_TYPE_INTEGER,  
    DAMSEL_DATA_TYPE_DOUBLE,   
    DAMSEL_DATA_TYPE_INVALID,  
    DAMSEL_DATA_TYPE_HANDLE    
}

Definition at line 46 of file DamselUtil.hpp.

Referenced by moab::WriteDamsel::init_tag_info().

damsel_entity_type moab::DamselUtil::mtod_entity_type [static]
Initial value:
 {
    DAMSEL_ENTITY_TYPE_VERTEX,      
    DAMSEL_ENTITY_TYPE_EDGE,        
    DAMSEL_ENTITY_TYPE_TRI,         
    DAMSEL_ENTITY_TYPE_QUAD,        
    DAMSEL_ENTITY_TYPE_POLYGON,     
    DAMSEL_ENTITY_TYPE_TET,         
    DAMSEL_ENTITY_TYPE_PYRAMID,     
    DAMSEL_ENTITY_TYPE_PRISM,       
    DAMSEL_ENTITY_TYPE_UNDEFINED,   
    DAMSEL_ENTITY_TYPE_HEX,         
    DAMSEL_ENTITY_TYPE_POLYHEDRON,  
    DAMSEL_ENTITY_TYPE_UNDEFINED    
}

Definition at line 50 of file DamselUtil.hpp.

Referenced by moab::WriteDamsel::write_entities().

Definition at line 116 of file DamselUtil.hpp.

Referenced by moab::ReadDamsel::process_tags().

List of all members.


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