MOAB: Mesh Oriented datABase  (version 5.4.1)
MBMesquite::MeshImplElemIter Class Reference

ElementIterator for MeshImpl. More...

#include <MeshImplData.hpp>

+ Inheritance diagram for MBMesquite::MeshImplElemIter:
+ Collaboration diagram for MBMesquite::MeshImplElemIter:

Public Member Functions

 MeshImplElemIter (MeshImplData *data)
virtual ~MeshImplElemIter ()
virtual void restart ()
virtual void operator++ ()
 ++iterator
virtual Mesh::ElementHandle operator* () const
virtual bool is_at_end () const

Private Attributes

MeshImplDatamesh
size_t index

Detailed Description

ElementIterator for MeshImpl.

Iterate over valid element indices

Definition at line 281 of file MeshImplData.hpp.


Constructor & Destructor Documentation

Definition at line 288 of file MeshImplData.hpp.

References restart().

                                           : mesh( data )
    {
        restart();
    }

Definition at line 765 of file MeshImplData.cpp.

{}

Member Function Documentation

bool MBMesquite::MeshImplElemIter::is_at_end ( ) const [virtual]

Returns false until the iterator has been advanced PAST the last entity. Once is_at_end() returns true, *iterator returns 0.

Implements MBMesquite::EntityIterator.

Definition at line 785 of file MeshImplData.cpp.

References index, MBMesquite::MeshImplData::max_element_index(), and mesh.

{
    return index >= mesh->max_element_index();
}
Mesh::ElementHandle MBMesquite::MeshImplElemIter::operator* ( ) const [virtual]

*iterator. Return the handle currently being pointed at by the iterator.

Implements MBMesquite::EntityIterator.

Definition at line 780 of file MeshImplData.cpp.

References index.

{
    return reinterpret_cast< Mesh::ElementHandle >( index );
}
void MBMesquite::MeshImplElemIter::operator++ ( ) [virtual]

++iterator

Implements MBMesquite::EntityIterator.

Definition at line 773 of file MeshImplData.cpp.

References index, MBMesquite::MeshImplData::is_element_valid(), and mesh.

{
    ++index;
    while( index < mesh->max_element_index() && !mesh->is_element_valid( index ) )
        ++index;
}

Moves the iterator back to the first entity in the list.

Implements MBMesquite::EntityIterator.

Definition at line 767 of file MeshImplData.cpp.

References index, MBMesquite::MeshImplData::is_element_valid(), and mesh.

Referenced by MeshImplElemIter().

{
    index = 0;
    if( !mesh->is_element_valid( index ) ) operator++();
}

Member Data Documentation

Definition at line 285 of file MeshImplData.hpp.

Referenced by is_at_end(), operator*(), operator++(), and restart().

Definition at line 284 of file MeshImplData.hpp.

Referenced by is_at_end(), operator++(), and restart().

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