Chaste Release::3.1
SemMesh< DIM >::SemElementIterator Class Reference

#include <SemMesh.hpp>

Collaboration diagram for SemMesh< DIM >::SemElementIterator:

List of all members.

Public Member Functions

PottsElement< DIM > & operator* ()
PottsElement< DIM > * operator-> ()
bool operator!= (const SemMesh< DIM >::SemElementIterator &rOther)
SemElementIteratoroperator++ ()
 SemElementIterator (SemMesh< DIM > &rMesh, typename std::vector< PottsElement< DIM > * >::iterator elementIter, bool skipDeletedElements=true)

Private Member Functions

bool IsAtEnd ()
bool IsAllowedElement ()

Private Attributes

SemMesh< DIM > & mrMesh
std::vector< PottsElement< DIM >
* >::iterator 
mElementIter
bool mSkipDeletedElements

Detailed Description

template<unsigned DIM>
class SemMesh< DIM >::SemElementIterator

A smart iterator over the elements in the mesh.

Todo:
This is the same as in AbstractTetrahedralMesh and VertexMesh- merge? (#1379)

Definition at line 266 of file SemMesh.hpp.


Constructor & Destructor Documentation

template<unsigned DIM>
SemMesh< DIM >::SemElementIterator::SemElementIterator ( SemMesh< DIM > &  rMesh,
typename std::vector< PottsElement< DIM > * >::iterator  elementIter,
bool  skipDeletedElements = true 
)

Constructor for a new iterator.

This should not be called directly by user code; use the mesh methods SemMesh::GetElementIteratorBegin and SemMesh::GetElementIteratorEnd instead.

Parameters:
rMeshthe mesh to iterator over
elementIterwhere to start iterating
skipDeletedElementswhether to include deleted elements (defaults to true)

Definition at line 381 of file SemMesh.hpp.

References SemMesh< DIM >::SemElementIterator::IsAllowedElement(), SemMesh< DIM >::SemElementIterator::mElementIter, and SemMesh< DIM >::SemElementIterator::mrMesh.


Member Function Documentation

template<unsigned DIM>
bool SemMesh< DIM >::SemElementIterator::IsAllowedElement ( ) [inline, private]

Helper method to say if we're allowed to point at this element.

Definition at line 411 of file SemMesh.hpp.

Referenced by SemMesh< DIM >::SemElementIterator::SemElementIterator().

template<unsigned DIM>
bool SemMesh< DIM >::SemElementIterator::IsAtEnd ( ) [inline, private]

Helper method to say when we're at the end.

Definition at line 405 of file SemMesh.hpp.

References SemMesh< DIM >::mElements.

Referenced by SemMesh< DIM >::SemElementIterator::operator*().

template<unsigned DIM>
bool SemMesh< DIM >::SemElementIterator::operator!= ( const SemMesh< DIM >::SemElementIterator rOther) [inline]

Comparison not-equal-to.

Parameters:
rOtheriterator with which comparison is made

Definition at line 363 of file SemMesh.hpp.

References SemMesh< DIM >::SemElementIterator::mElementIter.

template<unsigned DIM>
PottsElement< DIM > & SemMesh< DIM >::SemElementIterator::operator* ( ) [inline]

Dereference the iterator giving you a *reference* to the current element.

Make sure to use a reference for the result to avoid copying elements unnecessarily.

Definition at line 349 of file SemMesh.hpp.

References SemMesh< DIM >::SemElementIterator::IsAtEnd(), and SemMesh< DIM >::SemElementIterator::mElementIter.

template<unsigned DIM>
SemMesh< DIM >::SemElementIterator & SemMesh< DIM >::SemElementIterator::operator++ ( ) [inline]

Prefix increment operator.

Definition at line 369 of file SemMesh.hpp.

template<unsigned DIM>
PottsElement< DIM > * SemMesh< DIM >::SemElementIterator::operator-> ( ) [inline]

Member access from a pointer.

Definition at line 356 of file SemMesh.hpp.


Member Data Documentation

template<unsigned DIM>
std::vector<PottsElement<DIM> *>::iterator SemMesh< DIM >::SemElementIterator::mElementIter [private]
template<unsigned DIM>
SemMesh<DIM>& SemMesh< DIM >::SemElementIterator::mrMesh [private]

The mesh we're iterating over.

Definition at line 309 of file SemMesh.hpp.

Referenced by SemMesh< DIM >::SemElementIterator::SemElementIterator().

template<unsigned DIM>
bool SemMesh< DIM >::SemElementIterator::mSkipDeletedElements [private]

Whether to skip deleted elements.

Definition at line 315 of file SemMesh.hpp.


The documentation for this class was generated from the following file: