MOAB: Mesh Oriented datABase
(version 5.4.1)
|
iterates over indexes of free vetices in a PatchData. More...
#include <MsqFreeVertexIndexIterator.hpp>
Public Member Functions | |
MsqFreeVertexIndexIterator (const PatchData &p_pd, MsqError &) | |
void | reset () |
bool | next () |
Increments the iterator. returns false if there is no more free vertex. | |
std::size_t | value () |
Returns an index corresponding to a free vertex. | |
Private Attributes | |
const PatchData & | iterOriginator |
std::size_t | iterCurrentIndex |
iterates over indexes of free vetices in a PatchData.
A free vertex is defined as not having the MSQ_CULLED and MSQ_HARD_FIXED flags activated.
Use the iterator as follow: MsqFreeVertexIndexIterator ind(&patch_data,err); ind.reset(); while (ind.next()) { cout << ind.value(); } .
Definition at line 62 of file MsqFreeVertexIndexIterator.hpp.
MBMesquite::MsqFreeVertexIndexIterator::MsqFreeVertexIndexIterator | ( | const PatchData & | p_pd, |
MsqError & | |||
) | [inline] |
Definition at line 65 of file MsqFreeVertexIndexIterator.hpp.
: iterOriginator( p_pd ), iterCurrentIndex( (size_t)-1 ) { }
bool MBMesquite::MsqFreeVertexIndexIterator::next | ( | ) | [inline] |
Increments the iterator. returns false if there is no more free vertex.
Advance iterator.
Advance iterator to next free vertex
Definition at line 93 of file MsqFreeVertexIndexIterator.hpp.
References MBMesquite::MsqVertex::is_flag_set(), iterCurrentIndex, iterOriginator, MBMesquite::MsqVertex::MSQ_CULLED, MBMesquite::PatchData::num_free_vertices(), and MBMesquite::PatchData::vertex_by_index().
Referenced by MBMesquite::Randomize::optimize_vertex_positions(), MBMesquite::NonSmoothDescent::optimize_vertex_positions(), MsqFreeVertexIndexIteratorTest::test_hard_fixed_flags(), and MsqFreeVertexIndexIteratorTest::test_soft_fixed_flags().
{ ++iterCurrentIndex; while( iterCurrentIndex < iterOriginator.num_free_vertices() ) { if( !iterOriginator.vertex_by_index( iterCurrentIndex ).is_flag_set( MsqVertex::MSQ_CULLED ) ) return true; ++iterCurrentIndex; } return false; }
void MBMesquite::MsqFreeVertexIndexIterator::reset | ( | ) | [inline] |
Resets the iterator. The next call to next() will set the iterator on the first free vertex.
Definition at line 71 of file MsqFreeVertexIndexIterator.hpp.
References iterCurrentIndex.
Referenced by MBMesquite::Randomize::optimize_vertex_positions(), MBMesquite::NonSmoothDescent::optimize_vertex_positions(), MsqFreeVertexIndexIteratorTest::test_hard_fixed_flags(), and MsqFreeVertexIndexIteratorTest::test_soft_fixed_flags().
{ iterCurrentIndex = (size_t)-1; }
std::size_t MBMesquite::MsqFreeVertexIndexIterator::value | ( | ) | [inline] |
Returns an index corresponding to a free vertex.
Definition at line 78 of file MsqFreeVertexIndexIterator.hpp.
References iterCurrentIndex.
Referenced by MBMesquite::Randomize::optimize_vertex_positions(), MBMesquite::NonSmoothDescent::optimize_vertex_positions(), MsqFreeVertexIndexIteratorTest::test_hard_fixed_flags(), and MsqFreeVertexIndexIteratorTest::test_soft_fixed_flags().
{ return iterCurrentIndex; }
std::size_t MBMesquite::MsqFreeVertexIndexIterator::iterCurrentIndex [private] |
Definition at line 85 of file MsqFreeVertexIndexIterator.hpp.
const PatchData& MBMesquite::MsqFreeVertexIndexIterator::iterOriginator [private] |
Definition at line 84 of file MsqFreeVertexIndexIterator.hpp.
Referenced by next().