moab
moab::DamselUtil Class Reference

#include <DamselUtil.hpp>

List of all members.

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 64 of file DamselUtil.hpp.


Constructor & Destructor Documentation

needs to be a constructor to initialize dtom_data_type

Definition at line 59 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 66 of file DamselUtil.cpp.

{
  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 68 of file DamselUtil.hpp.

friend class WriteDamsel [friend]

Definition at line 67 of file DamselUtil.hpp.


Member Data Documentation

Definition at line 118 of file DamselUtil.hpp.

Definition at line 118 of file DamselUtil.hpp.

damsel_library moab::DamselUtil::dmslLib [private]

damsel library id

Definition at line 112 of file DamselUtil.hpp.

damsel_model moab::DamselUtil::dmslModel [private]

damsel model id

Definition at line 115 of file DamselUtil.hpp.

Initial value:

Definition at line 79 of file DamselUtil.hpp.

damsel_handle_type moab::DamselUtil::moabHandleType [private]

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

Definition at line 125 of file DamselUtil.hpp.

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 73 of file DamselUtil.hpp.

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 77 of file DamselUtil.hpp.

Definition at line 118 of file DamselUtil.hpp.

std::vector<tinfo> moab::DamselUtil::tagMap [private]

MOAB/damsel handles for dense [0], sparse [1], and conventional [2] tags.

Definition at line 122 of file DamselUtil.hpp.

other conventional tags

Definition at line 118 of file DamselUtil.hpp.

Definition at line 118 of file DamselUtil.hpp.

Definition at line 118 of file DamselUtil.hpp.


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