Chaste Commit::ca8ccdedf819b6e02855bc0e8e6f50bdecbc5208
PottsMesh< DIM >::PottsElementIterator Class Reference

#include <PottsMesh.hpp>

+ Collaboration diagram for PottsMesh< DIM >::PottsElementIterator:

Public Member Functions

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

Private Member Functions

bool IsAtEnd ()
 
bool IsAllowedElement ()
 

Private Attributes

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

Detailed Description

template<unsigned DIM>
class PottsMesh< DIM >::PottsElementIterator

A smart iterator over the elements in the mesh.

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

Definition at line 347 of file PottsMesh.hpp.

Constructor & Destructor Documentation

◆ PottsElementIterator()

template<unsigned DIM>
PottsMesh< DIM >::PottsElementIterator::PottsElementIterator ( PottsMesh< 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 PottsMesh::GetElementIteratorBegin and PottsMesh::GetElementIteratorEnd instead.

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

Definition at line 467 of file PottsMesh.hpp.

References PottsMesh< DIM >::PottsElementIterator::IsAllowedElement(), PottsMesh< DIM >::PottsElementIterator::mElementIter, and PottsMesh< DIM >::PottsElementIterator::mrMesh.

Member Function Documentation

◆ IsAllowedElement()

template<unsigned DIM>
bool PottsMesh< DIM >::PottsElementIterator::IsAllowedElement ( )
inlineprivate
Returns
whether we're allowed to point at this element.

Definition at line 497 of file PottsMesh.hpp.

Referenced by PottsMesh< DIM >::PottsElementIterator::PottsElementIterator().

◆ IsAtEnd()

template<unsigned DIM>
bool PottsMesh< DIM >::PottsElementIterator::IsAtEnd ( )
inlineprivate
Returns
whether we're at the end.

Definition at line 491 of file PottsMesh.hpp.

Referenced by PottsMesh< DIM >::PottsElementIterator::operator*().

◆ operator!=()

template<unsigned DIM>
bool PottsMesh< DIM >::PottsElementIterator::operator!= ( const typename PottsMesh< DIM >::PottsElementIterator rOther)
inline

Comparison not-equal-to.

Parameters
rOtheriterator with which comparison is made
Returns
not-equal

Definition at line 449 of file PottsMesh.hpp.

References PottsMesh< DIM >::PottsElementIterator::mElementIter.

◆ operator*()

template<unsigned DIM>
PottsElement< DIM > & PottsMesh< DIM >::PottsElementIterator::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.

Returns
reference

Definition at line 435 of file PottsMesh.hpp.

References PottsMesh< DIM >::PottsElementIterator::IsAtEnd(), and PottsMesh< DIM >::PottsElementIterator::mElementIter.

◆ operator++()

template<unsigned DIM>
PottsMesh< DIM >::PottsElementIterator & PottsMesh< DIM >::PottsElementIterator::operator++ ( )
inline

Prefix increment operator.

Returns
incremented object

Definition at line 455 of file PottsMesh.hpp.

◆ operator->()

template<unsigned DIM>
PottsElement< DIM > * PottsMesh< DIM >::PottsElementIterator::operator-> ( )
inline

Member access from a pointer.

Returns
pointer

Definition at line 442 of file PottsMesh.hpp.

Member Data Documentation

◆ mElementIter

template<unsigned DIM>
std::vector<PottsElement<DIM>*>::iterator PottsMesh< DIM >::PottsElementIterator::mElementIter
private

◆ mrMesh

template<unsigned DIM>
PottsMesh<DIM>& PottsMesh< DIM >::PottsElementIterator::mrMesh
private

The mesh we're iterating over.

Definition at line 394 of file PottsMesh.hpp.

Referenced by PottsMesh< DIM >::PottsElementIterator::PottsElementIterator().

◆ mSkipDeletedElements

template<unsigned DIM>
bool PottsMesh< DIM >::PottsElementIterator::mSkipDeletedElements
private
Returns
whether to skip deleted elements.

Definition at line 400 of file PottsMesh.hpp.


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