moab
moab::Modulator Class Reference

List of all members.

Public Member Functions

 Modulator (Interface *iface, std::string tag_name, DataType mb_type, size_t sz, size_t per_elem)
void add_entity (EntityHandle ent, const unsigned char *bytes, size_t len)
void add_entities (Range &range, const unsigned char *bytes, size_t bytes_per_ent)
EntityHandle congruence_class (const Hash &h, const void *tag_data)

Public Attributes

Interfacemesh
Tag tag

Detailed Description

Definition at line 85 of file ReadVtk.cpp.


Constructor & Destructor Documentation

moab::Modulator::Modulator ( Interface iface,
std::string  tag_name,
DataType  mb_type,
size_t  sz,
size_t  per_elem 
) [inline]

Definition at line 88 of file ReadVtk.cpp.

    {
    this->mesh = iface;
    std::vector<unsigned char> default_val;
    default_val.resize( sz * per_elem );
    this->mesh->tag_get_handle( tag_name.c_str(), per_elem, mb_type, this->tag,
                            MB_TAG_SPARSE|MB_TAG_BYTES|MB_TAG_CREAT, 
                            &default_val[0] );
    }

Member Function Documentation

void moab::Modulator::add_entities ( Range range,
const unsigned char *  bytes,
size_t  bytes_per_ent 
) [inline]

Definition at line 103 of file ReadVtk.cpp.

    {
    for( Range::iterator it = range.begin(); it != range.end(); ++ it, bytes += bytes_per_ent )
      {
      Hash h( bytes, bytes_per_ent );
      EntityHandle mset = this->congruence_class( h, bytes );
      this->mesh->add_entities( mset, &*it, 1 );
      }
    }
void moab::Modulator::add_entity ( EntityHandle  ent,
const unsigned char *  bytes,
size_t  len 
) [inline]

Definition at line 97 of file ReadVtk.cpp.

    {
    Hash h( bytes, len );
    EntityHandle mset = this->congruence_class( h, bytes );
    this->mesh->add_entities( mset, &ent, 1 );
    }
EntityHandle moab::Modulator::congruence_class ( const Hash h,
const void *  tag_data 
) [inline]

Definition at line 112 of file ReadVtk.cpp.

    {
    std::map<Hash,EntityHandle>::iterator it = this->find( h );
    if ( it == this->end() )
      {
      EntityHandle mset;
      Range preexist;
      this->mesh->get_entities_by_type_and_tag( 0, MBENTITYSET, &this->tag, &tag_data, 1, preexist );
      if ( preexist.size() )
        {
        mset = *preexist.begin();
        }
      else
        {
        this->mesh->create_meshset( MESHSET_SET, mset );
        this->mesh->tag_set_data( this->tag, &mset, 1, tag_data );
        }
      (*this)[h] = mset;
      return mset;
      }
    return it->second;
    }

Member Data Documentation

Definition at line 135 of file ReadVtk.cpp.

Definition at line 136 of file ReadVtk.cpp.


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