MOAB: Mesh Oriented datABase  (version 5.4.1)
moab::VertexSequence Class Reference

#include <VertexSequence.hpp>

+ Inheritance diagram for moab::VertexSequence:
+ Collaboration diagram for moab::VertexSequence:

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 10 of file VertexSequence.hpp.


Member Enumeration Documentation

Enumerator:
X 
Y 
Z 

Definition at line 52 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.

Referenced by split().

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

Definition at line 15 of file VertexSequence.hpp.

References moab::SequenceData::create_sequence_data(), moab::EntitySequence::data(), X, Y, and Z.

        : 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 6 of file VertexSequence.cpp.

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

Definition at line 95 of file VertexSequence.hpp.

: EntitySequence( split_from, here ) {}

Member Function Documentation

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

Definition at line 59 of file VertexSequence.hpp.

References moab::EntitySequence::data(), and moab::SequenceData::get_sequence_data().

Referenced by x_array(), y_array(), and z_array().

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

Definition at line 64 of file VertexSequence.hpp.

References moab::EntitySequence::data(), and moab::SequenceData::get_sequence_data().

    {
        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 13 of file VertexSequence.cpp.

References moab::EntitySequence::data(), sizes, and moab::SequenceData::subset().

{
    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 29 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]
ErrorCode moab::VertexSequence::get_coordinate_arrays ( const double *&  x,
const double *&  y,
const double *&  z 
) const [inline]

Definition at line 155 of file VertexSequence.hpp.

References get_coordinates_ref(), and moab::EntitySequence::start_handle().

{
    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.

References moab::EntitySequence::data(), MB_SUCCESS, moab::SequenceData::start_handle(), x_array(), y_array(), and z_array().

Referenced by moab::Core::get_coords(), and moab::Core::print_database().

{
    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 107 of file VertexSequence.hpp.

References moab::EntitySequence::data(), MB_SUCCESS, moab::SequenceData::start_handle(), X, x_array(), Y, y_array(), Z, and z_array().

{
    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 116 of file VertexSequence.hpp.

References moab::EntitySequence::data(), MB_SUCCESS, moab::SequenceData::start_handle(), x_array(), y_array(), and z_array().

Referenced by get_coordinate_arrays().

{
    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 128 of file VertexSequence.hpp.

References moab::EntitySequence::data(), MB_SUCCESS, moab::SequenceData::start_handle(), x_array(), y_array(), and z_array().

Referenced by moab::SequenceManager::create_vertex().

{
    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 8 of file VertexSequence.cpp.

References VertexSequence().

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

Definition at line 69 of file VertexSequence.hpp.

References array(), and X.

Referenced by get_coordinate_arrays(), get_coordinates(), get_coordinates_ref(), and set_coordinates().

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

Definition at line 82 of file VertexSequence.hpp.

References array(), and X.

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

Definition at line 73 of file VertexSequence.hpp.

References array(), and Y.

Referenced by get_coordinate_arrays(), get_coordinates(), get_coordinates_ref(), and set_coordinates().

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

Definition at line 86 of file VertexSequence.hpp.

References array(), and Y.

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

Definition at line 77 of file VertexSequence.hpp.

References array(), and Z.

Referenced by get_coordinate_arrays(), get_coordinates(), get_coordinates_ref(), and set_coordinates().

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

Definition at line 90 of file VertexSequence.hpp.

References array(), and Z.

    {
        return array( Z );
    }

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