moab
moab::VertexSequence Class Reference

#include <VertexSequence.hpp>

Inheritance diagram for moab::VertexSequence:
moab::EntitySequence

List of all members.

Public Member Functions

 VertexSequence (EntityHandle start, EntityID count, SequenceData *dat)
 VertexSequence (EntityHandle start, EntityID count, EntityID data_size)
virtual ~VertexSequence ()
ErrorCode get_coordinates (EntityHandle handle, double &x, double &y, double &z) const
ErrorCode get_coordinates (EntityHandle handle, double coords[3]) const
ErrorCode get_coordinates_ref (EntityHandle handle, const double *&x, const double *&y, const double *&z) const
ErrorCode set_coordinates (EntityHandle entity, double x, double y, double z)
ErrorCode set_coordinates (EntityHandle entity, const double xyz[3])
ErrorCode get_coordinate_arrays (double *&x, double *&y, double *&z)
ErrorCode get_coordinate_arrays (const double *&x, const double *&y, const double *&z) const
EntitySequencesplit (EntityHandle here)
 Split this sequence into two consecutive sequences.
SequenceDatacreate_data_subset (EntityHandle start, EntityHandle end) const
 Create a new SequenceData that is a copy of a subset of the one referenced by this sequence.
ErrorCode push_front (EntityID count)
ErrorCode push_back (EntityID count)
void get_const_memory_use (unsigned long &bytes_per_entity, unsigned long &size_of_sequence) const
 Get memory characteristcs that are the same for all entities.

Private Types

enum  Coord { X = 0, Y = 1, Z = 2 }

Private Member Functions

double * array (Coord coord)
const double * array (Coord coord) const
double * x_array ()
double * y_array ()
double * z_array ()
const double * x_array () const
const double * y_array () const
const double * z_array () const
 VertexSequence (VertexSequence &split_from, EntityHandle here)

Detailed Description

Definition at line 9 of file VertexSequence.hpp.


Member Enumeration Documentation

Enumerator:
X 
Y 
Z 

Definition at line 72 of file VertexSequence.hpp.

{ X = 0, Y = 1, Z = 2 };

Constructor & Destructor Documentation

moab::VertexSequence::VertexSequence ( EntityHandle  start,
EntityID  count,
SequenceData dat 
) [inline]

Definition at line 13 of file VertexSequence.hpp.

    : EntitySequence( start, count, dat )
    {}
moab::VertexSequence::VertexSequence ( EntityHandle  start,
EntityID  count,
EntityID  data_size 
) [inline]

Definition at line 19 of file VertexSequence.hpp.

    : EntitySequence( start, count, new SequenceData( 3, start, start+data_size-1 ) )
    {
      data()->create_sequence_data( X, sizeof(double) );
      data()->create_sequence_data( Y, sizeof(double) );
      data()->create_sequence_data( Z, sizeof(double) );
    } 

Definition at line 5 of file VertexSequence.cpp.

{}
moab::VertexSequence::VertexSequence ( VertexSequence split_from,
EntityHandle  here 
) [inline, private]

Definition at line 92 of file VertexSequence.hpp.

    : EntitySequence( split_from, here )
    {}

Member Function Documentation

double* moab::VertexSequence::array ( Coord  coord) [inline, private]

Definition at line 74 of file VertexSequence.hpp.

  { 
    return reinterpret_cast<double*>(data()->get_sequence_data( coord ));
  }
const double* moab::VertexSequence::array ( Coord  coord) const [inline, private]

Definition at line 79 of file VertexSequence.hpp.

  { 
    return reinterpret_cast<const double*>(data()->get_sequence_data( coord ));
  }
SequenceData * moab::VertexSequence::create_data_subset ( EntityHandle  start_handle,
EntityHandle  end_handle 
) const [virtual]

Create a new SequenceData that is a copy of a subset of the one referenced by this sequence.

Create a new SequenceData that is a copy of a subset of the SequenceData referenced by this EntitySequence. Do not make any changes to this EntitySequence or the current SequenceData.

Implements moab::EntitySequence.

Definition at line 10 of file VertexSequence.cpp.

{
  const int sizes[] = { sizeof(double), sizeof(double), sizeof(double) };
  return data()->subset(start, end, sizes );
}
void moab::VertexSequence::get_const_memory_use ( unsigned long &  bytes_per_entity,
unsigned long &  size_of_sequence 
) const [virtual]

Get memory characteristcs that are the same for all entities.

Get charactersitic constant memory use for all entities in sequence.

Parameters:
bytes_per_entityThe total bytes consumed for each entity in the underlying SequenceData. It is assumed that the same amount of memory is consumed for unused portions of the SequenceData.
size_of_sequenceThe size of the leaf subclass of this class

Implements moab::EntitySequence.

Definition at line 23 of file VertexSequence.cpp.

{
  per_ent = 3 * sizeof(double);
  seq = sizeof(*this);
}
ErrorCode moab::VertexSequence::get_coordinate_arrays ( double *&  x,
double *&  y,
double *&  z 
) [inline]

Definition at line 155 of file VertexSequence.hpp.

{
  EntityID offset = start_handle() - data()->start_handle();
  x = x_array()+offset;
  y = y_array()+offset;
  z = z_array()+offset;
  return MB_SUCCESS;
}
ErrorCode moab::VertexSequence::get_coordinate_arrays ( const double *&  x,
const double *&  y,
const double *&  z 
) const [inline]

Definition at line 166 of file VertexSequence.hpp.

{
  return get_coordinates_ref( start_handle(), x, y, z ); 
}
ErrorCode moab::VertexSequence::get_coordinates ( EntityHandle  handle,
double &  x,
double &  y,
double &  z 
) const [inline]

Definition at line 98 of file VertexSequence.hpp.

{
  EntityID offset = handle - data()->start_handle();
  x = x_array()[offset];
  y = y_array()[offset];
  z = z_array()[offset];
  return MB_SUCCESS;
}
ErrorCode moab::VertexSequence::get_coordinates ( EntityHandle  handle,
double  coords[3] 
) const [inline]

Definition at line 110 of file VertexSequence.hpp.

{
  EntityID offset = handle - data()->start_handle();
  coords[X] = x_array()[offset];
  coords[Y] = y_array()[offset];
  coords[Z] = z_array()[offset];
  return MB_SUCCESS;
}
ErrorCode moab::VertexSequence::get_coordinates_ref ( EntityHandle  handle,
const double *&  x,
const double *&  y,
const double *&  z 
) const [inline]

Definition at line 121 of file VertexSequence.hpp.

{
  EntityID offset = handle - data()->start_handle();
  x = x_array()+offset;
  y = y_array()+offset;
  z = z_array()+offset;
  return MB_SUCCESS;
}
ErrorCode moab::VertexSequence::set_coordinates ( EntityHandle  entity,
double  x,
double  y,
double  z 
) [inline]

Definition at line 133 of file VertexSequence.hpp.

{
  EntityID offset = entity - data()->start_handle();
  x_array()[offset] = x;
  y_array()[offset] = y;
  z_array()[offset] = z;
  return MB_SUCCESS;
}
ErrorCode moab::VertexSequence::set_coordinates ( EntityHandle  entity,
const double  xyz[3] 
) [inline]

Split this sequence into two consecutive sequences.

Split this sequence into two sequences.

Parameters:
hereNew sequences should be [start_handle(),here) & [here,end_handle()]
Returns:
New sequence containing [here,end_handle()]

Implements moab::EntitySequence.

Definition at line 7 of file VertexSequence.cpp.

  { return new VertexSequence( *this, here ); }
double* moab::VertexSequence::x_array ( ) [inline, private]

Definition at line 84 of file VertexSequence.hpp.

{ return array(X); }
const double* moab::VertexSequence::x_array ( ) const [inline, private]

Definition at line 88 of file VertexSequence.hpp.

{ return array(X); }
double* moab::VertexSequence::y_array ( ) [inline, private]

Definition at line 85 of file VertexSequence.hpp.

{ return array(Y); }
const double* moab::VertexSequence::y_array ( ) const [inline, private]

Definition at line 89 of file VertexSequence.hpp.

{ return array(Y); }
double* moab::VertexSequence::z_array ( ) [inline, private]

Definition at line 86 of file VertexSequence.hpp.

{ return array(Z); }
const double* moab::VertexSequence::z_array ( ) const [inline, private]

Definition at line 90 of file VertexSequence.hpp.

{ return array(Z); }

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