moab
moab::SweptVertexData Class Reference

#include <SweptVertexData.hpp>

Inheritance diagram for moab::SweptVertexData:
moab::SequenceData

List of all members.

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 32 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 22 of file SweptVertexData.cpp.

    : 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 55 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 168 of file SweptVertexData.hpp.

{
  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 173 of file SweptVertexData.hpp.

{
  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 113 of file SweptVertexData.hpp.

{
  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 101 of file SweptVertexData.hpp.

{
  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 108 of file SweptVertexData.hpp.

{
  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 87 of file SweptVertexData.hpp.

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

convenience functions for parameter extents

Definition at line 84 of file SweptVertexData.hpp.

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

Definition at line 88 of file SweptVertexData.hpp.

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

Definition at line 85 of file SweptVertexData.hpp.

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

Definition at line 89 of file SweptVertexData.hpp.

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

Definition at line 86 of file SweptVertexData.hpp.

{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 143 of file SweptVertexData.hpp.

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

get the max params

Definition at line 155 of file SweptVertexData.hpp.

{
  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 135 of file SweptVertexData.hpp.

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

get the min params

Definition at line 150 of file SweptVertexData.hpp.

{
  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 161 of file SweptVertexData.hpp.

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

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

Definition at line 46 of file SweptVertexData.hpp.

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

Definition at line 38 of file SweptVertexData.hpp.


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