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

#include <SweptVertexData.hpp>

+ Inheritance diagram for moab::SweptVertexData:
+ Collaboration diagram for moab::SweptVertexData:

Public Member Functions

 SweptVertexData (const EntityHandle start_vertex, const int imin, const int jmin, const int kmin, const int imax, const int jmax, const int kmax)
 constructor
virtual ~SweptVertexData ()
EntityHandle get_vertex (const int i, const int j, const int k) const
 get handle of vertex at i, j, k
EntityHandle get_vertex (const HomCoord &coords) const
 get handle of vertex at homogeneous coordinates
ErrorCode get_params (const EntityHandle vhandle, int &i, int &j, int &k) const
void min_params (int &i, int &j, int &k) const
 get min params for this vertex
void max_params (int &i, int &j, int &k) const
 get max params for this vertex
const HomCoordmin_params () const
 get the min params
const HomCoordmax_params () const
 get the max params
void param_extents (int &di, int &dj, int &dk) const
 get the number of vertices in each direction, inclusive
int i_min () const
 convenience functions for parameter extents
int j_min () const
int k_min () const
int i_max () const
int j_max () const
int k_max () const
bool contains (const HomCoord &coords) const
 return whether this vseq's parameter space contains these parameters
bool contains (const int i, const int j, const int k) const
SequenceDatasubset (EntityHandle start, EntityHandle end, const int *sequence_data_sizes, const int *tag_data_sizes) const

Private Attributes

HomCoord vertexParams [3]
 parameter min/max, in homogeneous coords ijkh (extra row for stride eventually)
int dIJK [3]
int dIJKm1 [3]

Detailed Description

Definition at line 33 of file SweptVertexData.hpp.


Constructor & Destructor Documentation

moab::SweptVertexData::SweptVertexData ( const EntityHandle  start_vertex,
const int  imin,
const int  jmin,
const int  kmin,
const int  imax,
const int  jmax,
const int  kmax 
)

constructor

Definition at line 23 of file SweptVertexData.cpp.

References moab::SequenceData::create_sequence_data(), dIJK, dIJKm1, and vertexParams.

    : SequenceData( 3,
                    start_vertex,
                    start_vertex + ( imax - imin + 1 ) * ( jmax - jmin + 1 ) * ( kmax - kmin + 1 ) - 1 )
{
    // need to have meaningful parameters
    assert( imax >= imin && jmax >= jmin && kmax >= kmin );

    vertexParams[0] = HomCoord( imin, jmin, kmin );
    vertexParams[1] = HomCoord( imax, jmax, kmax );
    vertexParams[2] = HomCoord( 1, 1, 1 );

    dIJK[0]   = imax - imin + 1;
    dIJK[1]   = jmax - jmin + 1;
    dIJK[2]   = kmax - kmin + 1;
    dIJKm1[0] = dIJK[0] - 1;
    dIJKm1[1] = dIJK[1] - 1;
    dIJKm1[2] = dIJK[2] - 1;

    create_sequence_data( 0, sizeof( double ) );
    create_sequence_data( 1, sizeof( double ) );
    create_sequence_data( 2, sizeof( double ) );
}
virtual moab::SweptVertexData::~SweptVertexData ( ) [inline, virtual]

Definition at line 58 of file SweptVertexData.hpp.

{}

Member Function Documentation

bool moab::SweptVertexData::contains ( const HomCoord coords) const [inline]

return whether this vseq's parameter space contains these parameters

Definition at line 185 of file SweptVertexData.hpp.

References vertexParams.

Referenced by contains().

{
    return ( coords >= vertexParams[0] && coords <= vertexParams[1] ) ? true : false;
}
bool moab::SweptVertexData::contains ( const int  i,
const int  j,
const int  k 
) const [inline]

Definition at line 190 of file SweptVertexData.hpp.

References contains().

{
    return contains( HomCoord( i, j, k ) );
}
ErrorCode moab::SweptVertexData::get_params ( const EntityHandle  vhandle,
int &  i,
int &  j,
int &  k 
) const [inline]

get the parameters of a given handle; return MB_FAILURE if vhandle not in this sequence

Definition at line 131 of file SweptVertexData.hpp.

References dIJK, moab::HomCoord::i(), i_max(), i_min(), moab::HomCoord::j(), j_max(), j_min(), moab::HomCoord::k(), k_max(), k_min(), MB_SUCCESS, MBVERTEX, moab::SequenceData::start_handle(), moab::TYPE_FROM_HANDLE(), and vertexParams.

{
    if( TYPE_FROM_HANDLE( vhandle ) != MBVERTEX ) return MB_FAILURE;

    int hdiff = vhandle - start_handle();

    k = hdiff / ( dIJK[0] * dIJK[1] );
    j = ( hdiff - ( k * dIJK[0] * dIJK[1] ) ) / dIJK[0];
    i = hdiff % dIJK[0];

    k += vertexParams[0].k();
    j += vertexParams[0].j();
    i += vertexParams[0].i();

    return ( vhandle >= start_handle() && i >= i_min() && i <= i_max() && j >= j_min() && j <= j_max() &&
             k >= k_min() && k <= k_max() )
               ? MB_SUCCESS
               : MB_FAILURE;
}
EntityHandle moab::SweptVertexData::get_vertex ( const int  i,
const int  j,
const int  k 
) const [inline]

get handle of vertex at i, j, k

Definition at line 121 of file SweptVertexData.hpp.

References dIJK, i_min(), j_min(), k_min(), and moab::SequenceData::start_handle().

Referenced by get_vertex().

{
    return start_handle() + ( i - i_min() ) + ( j - j_min() ) * dIJK[0] + ( k - k_min() ) * dIJK[0] * dIJK[1];
}
EntityHandle moab::SweptVertexData::get_vertex ( const HomCoord coords) const [inline]

get handle of vertex at homogeneous coordinates

Definition at line 126 of file SweptVertexData.hpp.

References get_vertex(), and moab::HomCoord::hom_coord().

{
    return get_vertex( coords.hom_coord()[0], coords.hom_coord()[1], coords.hom_coord()[2] );
}
int moab::SweptVertexData::i_max ( ) const [inline]

Definition at line 98 of file SweptVertexData.hpp.

References moab::HomCoord::hom_coord(), and vertexParams.

Referenced by get_params(), and max_params().

    {
        return vertexParams[1].hom_coord()[0];
    }
int moab::SweptVertexData::i_min ( ) const [inline]

convenience functions for parameter extents

Definition at line 86 of file SweptVertexData.hpp.

References moab::HomCoord::hom_coord(), and vertexParams.

Referenced by get_params(), get_vertex(), and min_params().

    {
        return vertexParams[0].hom_coord()[0];
    }
int moab::SweptVertexData::j_max ( ) const [inline]

Definition at line 102 of file SweptVertexData.hpp.

References moab::HomCoord::hom_coord(), and vertexParams.

Referenced by get_params(), and max_params().

    {
        return vertexParams[1].hom_coord()[1];
    }
int moab::SweptVertexData::j_min ( ) const [inline]

Definition at line 90 of file SweptVertexData.hpp.

References moab::HomCoord::hom_coord(), and vertexParams.

Referenced by get_params(), get_vertex(), and min_params().

    {
        return vertexParams[0].hom_coord()[1];
    }
int moab::SweptVertexData::k_max ( ) const [inline]

Definition at line 106 of file SweptVertexData.hpp.

References moab::HomCoord::hom_coord(), and vertexParams.

Referenced by get_params(), and max_params().

    {
        return vertexParams[1].hom_coord()[2];
    }
int moab::SweptVertexData::k_min ( ) const [inline]

Definition at line 94 of file SweptVertexData.hpp.

References moab::HomCoord::hom_coord(), and vertexParams.

Referenced by get_params(), get_vertex(), and min_params().

    {
        return vertexParams[0].hom_coord()[2];
    }
void moab::SweptVertexData::max_params ( int &  i,
int &  j,
int &  k 
) const [inline]

get max params for this vertex

Definition at line 160 of file SweptVertexData.hpp.

References i_max(), j_max(), and k_max().

Referenced by moab::SweptElementData::add_vsequence().

{
    i = i_max();
    j = j_max();
    k = k_max();
}
const HomCoord & moab::SweptVertexData::max_params ( ) const [inline]

get the max params

Definition at line 172 of file SweptVertexData.hpp.

References vertexParams.

{
    return vertexParams[1];
}
void moab::SweptVertexData::min_params ( int &  i,
int &  j,
int &  k 
) const [inline]

get min params for this vertex

Definition at line 152 of file SweptVertexData.hpp.

References i_min(), j_min(), and k_min().

Referenced by moab::SweptElementData::add_vsequence().

{
    i = i_min();
    j = j_min();
    k = k_min();
}
const HomCoord & moab::SweptVertexData::min_params ( ) const [inline]

get the min params

Definition at line 167 of file SweptVertexData.hpp.

References vertexParams.

{
    return vertexParams[0];
}
void moab::SweptVertexData::param_extents ( int &  di,
int &  dj,
int &  dk 
) const [inline]

get the number of vertices in each direction, inclusive

Definition at line 178 of file SweptVertexData.hpp.

References dIJK.

{
    di = dIJK[0];
    dj = dIJK[1];
    dk = dIJK[2];
}
SequenceData * moab::SweptVertexData::subset ( EntityHandle  start,
EntityHandle  end,
const int *  sequence_data_sizes,
const int *  tag_data_sizes 
) const

Definition at line 53 of file SweptVertexData.cpp.

{
    return 0;
}

Member Data Documentation

int moab::SweptVertexData::dIJK[3] [private]

difference between max and min params plus one (i.e. # VERTICES in each parametric direction)

Definition at line 42 of file SweptVertexData.hpp.

Referenced by get_params(), get_vertex(), param_extents(), and SweptVertexData().

difference between max and min params (i.e. # VERTEXS in each parametric direction)

Definition at line 46 of file SweptVertexData.hpp.

Referenced by SweptVertexData().

parameter min/max, in homogeneous coords ijkh (extra row for stride eventually)

Definition at line 38 of file SweptVertexData.hpp.

Referenced by contains(), get_params(), i_max(), i_min(), j_max(), j_min(), k_max(), k_min(), max_params(), min_params(), and SweptVertexData().

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