#include <SweptVertexData.hpp>
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 More... | |
virtual | ~SweptVertexData () |
EntityHandle | get_vertex (const int i, const int j, const int k) const |
get handle of vertex at i, j, k More... | |
EntityHandle | get_vertex (const HomCoord &coords) const |
get handle of vertex at homogeneous coordinates More... | |
ErrorCode | get_params (const EntityHandle vhandle, int &i, int &j, int &k) const |
get the parameters of a given handle; return MB_FAILURE if vhandle not in this sequence More... | |
void | min_params (int &i, int &j, int &k) const |
get min params for this vertex More... | |
void | max_params (int &i, int &j, int &k) const |
get max params for this vertex More... | |
const HomCoord & | min_params () const |
get the min params More... | |
const HomCoord & | max_params () const |
get the max params More... | |
void | param_extents (int &di, int &dj, int &dk) const |
get the number of vertices in each direction, inclusive More... | |
int | i_min () const |
convenience functions for parameter extents More... | |
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 More... | |
bool | contains (const int i, const int j, const int k) const |
SequenceData * | subset (EntityHandle start, EntityHandle end, const int *sequence_data_sizes, const int *tag_data_sizes) const |
![]() | |
SequenceData (int num_sequence_arrays, EntityHandle start, EntityHandle end) | |
virtual | ~SequenceData () |
EntityHandle | start_handle () const |
EntityHandle | end_handle () const |
EntityID | size () const |
void * | get_sequence_data (int array_num) |
void const * | get_sequence_data (int array_num) const |
AdjacencyDataType * | get_adjacency_data () |
AdjacencyDataType const * | get_adjacency_data () const |
void * | get_tag_data (unsigned tag_num) |
void const * | get_tag_data (unsigned tag_num) const |
void * | create_sequence_data (int array_num, int bytes_per_ent, const void *initial_val=0) |
Allocate array of sequence-specific data. More... | |
void * | create_custom_data (int array_num, size_t total_bytes) |
Allocate array of sequence-specific data. More... | |
AdjacencyDataType * | allocate_adjacency_data () |
Allocate array for storing adjacency data. More... | |
void * | allocate_tag_array (int index, int bytes_per_ent, const void *default_value=0) |
Allocate array of dense tag data. More... | |
SequenceData * | subset (EntityHandle start, EntityHandle end, const int *sequence_data_sizes) const |
Create new SequenceData that is a copy of a subset of this one. More... | |
void | move_tag_data (SequenceData *destination, const int *tag_sizes, int num_tag_sizes) |
Move tag data for a subset of this sequences to specified sequence. More... | |
void | release_tag_data (const int *tag_sizes, int num_tag_sizes) |
Free all tag data arrays. More... | |
void | release_tag_data (int index, int tag_size) |
Free specified tag data array. More... | |
Private Attributes | |
HomCoord | vertexParams [3] |
parameter min/max, in homogeneous coords ijkh (extra row for stride eventually) More... | |
int | dIJK [3] |
difference between max and min params plus one (i.e. # VERTICES in each parametric direction) More... | |
int | dIJKm1 [3] |
difference between max and min params (i.e. # VERTEXS in each parametric direction) More... | |
Additional Inherited Members | |
![]() | |
typedef std::vector< EntityHandle > * | AdjacencyDataType |
![]() | |
TypeSequenceManager::SequenceDataPtr | seqManData |
SequenceManager data. More... | |
![]() | |
SequenceData (const SequenceData *subset_from, EntityHandle start, EntityHandle end, const int *sequence_data_sizes) | |
Definition at line 33 of file SweptVertexData.hpp.
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.
30 : SequenceData( 3,
31 start_vertex,
32 start_vertex + ( imax - imin + 1 ) * ( jmax - jmin + 1 ) * ( kmax - kmin + 1 ) - 1 )
33 {
34 // need to have meaningful parameters
35 assert( imax >= imin && jmax >= jmin && kmax >= kmin );
36
37 vertexParams[0] = HomCoord( imin, jmin, kmin );
38 vertexParams[1] = HomCoord( imax, jmax, kmax );
39 vertexParams[2] = HomCoord( 1, 1, 1 );
40
41 dIJK[0] = imax - imin + 1;
42 dIJK[1] = jmax - jmin + 1;
43 dIJK[2] = kmax - kmin + 1;
44 dIJKm1[0] = dIJK[0] - 1;
45 dIJKm1[1] = dIJK[1] - 1;
46 dIJKm1[2] = dIJK[2] - 1;
47
48 create_sequence_data( 0, sizeof( double ) );
49 create_sequence_data( 1, sizeof( double ) );
50 create_sequence_data( 2, sizeof( double ) );
51 }
References moab::SequenceData::create_sequence_data(), dIJK, dIJKm1, and vertexParams.
|
inlinevirtual |
Definition at line 58 of file SweptVertexData.hpp.
58 {}
|
inline |
return whether this vseq's parameter space contains these parameters
Definition at line 185 of file SweptVertexData.hpp.
186 {
187 return ( coords >= vertexParams[0] && coords <= vertexParams[1] ) ? true : false;
188 }
References vertexParams.
Referenced by contains().
|
inline |
Definition at line 190 of file SweptVertexData.hpp.
191 {
192 return contains( HomCoord( i, j, k ) );
193 }
References contains().
|
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.
132 {
133 if( TYPE_FROM_HANDLE( vhandle ) != MBVERTEX ) return MB_FAILURE;
134
135 int hdiff = vhandle - start_handle();
136
137 k = hdiff / ( dIJK[0] * dIJK[1] );
138 j = ( hdiff - ( k * dIJK[0] * dIJK[1] ) ) / dIJK[0];
139 i = hdiff % dIJK[0];
140
141 k += vertexParams[0].k();
142 j += vertexParams[0].j();
143 i += vertexParams[0].i();
144
145 return ( vhandle >= start_handle() && i >= i_min() && i <= i_max() && j >= j_min() && j <= j_max() &&
146 k >= k_min() && k <= k_max() )
147 ? MB_SUCCESS
148 : MB_FAILURE;
149 }
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.
|
inline |
get handle of vertex at homogeneous coordinates
Definition at line 126 of file SweptVertexData.hpp.
127 {
128 return get_vertex( coords.hom_coord()[0], coords.hom_coord()[1], coords.hom_coord()[2] );
129 }
References get_vertex(), and moab::HomCoord::hom_coord().
|
inline |
get handle of vertex at i, j, k
Definition at line 121 of file SweptVertexData.hpp.
122 {
123 return start_handle() + ( i - i_min() ) + ( j - j_min() ) * dIJK[0] + ( k - k_min() ) * dIJK[0] * dIJK[1];
124 }
References dIJK, i_min(), j_min(), k_min(), and moab::SequenceData::start_handle().
Referenced by get_vertex().
|
inline |
Definition at line 98 of file SweptVertexData.hpp.
99 {
100 return vertexParams[1].hom_coord()[0];
101 }
References moab::HomCoord::hom_coord(), and vertexParams.
Referenced by get_params(), and max_params().
|
inline |
convenience functions for parameter extents
Definition at line 86 of file SweptVertexData.hpp.
87 {
88 return vertexParams[0].hom_coord()[0];
89 }
References moab::HomCoord::hom_coord(), and vertexParams.
Referenced by get_params(), get_vertex(), and min_params().
|
inline |
Definition at line 102 of file SweptVertexData.hpp.
103 {
104 return vertexParams[1].hom_coord()[1];
105 }
References moab::HomCoord::hom_coord(), and vertexParams.
Referenced by get_params(), and max_params().
|
inline |
Definition at line 90 of file SweptVertexData.hpp.
91 {
92 return vertexParams[0].hom_coord()[1];
93 }
References moab::HomCoord::hom_coord(), and vertexParams.
Referenced by get_params(), get_vertex(), and min_params().
|
inline |
Definition at line 106 of file SweptVertexData.hpp.
107 {
108 return vertexParams[1].hom_coord()[2];
109 }
References moab::HomCoord::hom_coord(), and vertexParams.
Referenced by get_params(), and max_params().
|
inline |
Definition at line 94 of file SweptVertexData.hpp.
95 {
96 return vertexParams[0].hom_coord()[2];
97 }
References moab::HomCoord::hom_coord(), and vertexParams.
Referenced by get_params(), get_vertex(), and min_params().
|
inline |
get the max params
Definition at line 172 of file SweptVertexData.hpp.
173 {
174 return vertexParams[1];
175 }
References vertexParams.
|
inline |
get max params for this vertex
Definition at line 160 of file SweptVertexData.hpp.
161 { 162 i = i_max(); 163 j = j_max(); 164 k = k_max(); 165 }
References i_max(), j_max(), and k_max().
Referenced by moab::SweptElementData::add_vsequence().
|
inline |
get the min params
Definition at line 167 of file SweptVertexData.hpp.
168 {
169 return vertexParams[0];
170 }
References vertexParams.
|
inline |
get min params for this vertex
Definition at line 152 of file SweptVertexData.hpp.
153 { 154 i = i_min(); 155 j = j_min(); 156 k = k_min(); 157 }
References i_min(), j_min(), and k_min().
Referenced by moab::SweptElementData::add_vsequence().
|
inline |
get the number of vertices in each direction, inclusive
Definition at line 178 of file SweptVertexData.hpp.
179 { 180 di = dIJK[0]; 181 dj = dIJK[1]; 182 dk = dIJK[2]; 183 }
References dIJK.
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.
57 {
58 return 0;
59 }
|
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().
|
private |
difference between max and min params (i.e. # VERTEXS in each parametric direction)
Definition at line 46 of file SweptVertexData.hpp.
Referenced by SweptVertexData().
|
private |
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().