Chaste Commit::ca8ccdedf819b6e02855bc0e8e6f50bdecbc5208
VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator Class Reference

#include <VertexMesh.hpp>

+ Collaboration diagram for VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator:

Public Member Functions

VertexElement< ELEMENT_DIM, SPACE_DIM > & operator* ()
 
VertexElement< ELEMENT_DIM, SPACE_DIM > * operator-> ()
 
bool operator!= (const typename VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator &rOther)
 
VertexElementIteratoroperator++ ()
 
 VertexElementIterator (VertexMesh< ELEMENT_DIM, SPACE_DIM > &rMesh, typename std::vector< VertexElement< ELEMENT_DIM, SPACE_DIM > * >::iterator elementIter, bool skipDeletedElements=true)
 

Private Member Functions

bool IsAtEnd ()
 
bool IsAllowedElement ()
 

Private Attributes

VertexMeshmrMesh
 
std::vector< VertexElement< ELEMENT_DIM, SPACE_DIM > * >::iterator mElementIter
 
bool mSkipDeletedElements
 

Detailed Description

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
class VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator

A smart iterator over the elements in the mesh.

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

Definition at line 657 of file VertexMesh.hpp.

Constructor & Destructor Documentation

◆ VertexElementIterator()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator::VertexElementIterator ( VertexMesh< ELEMENT_DIM, SPACE_DIM > &  rMesh,
typename std::vector< VertexElement< ELEMENT_DIM, SPACE_DIM > * >::iterator  elementIter,
bool  skipDeletedElements = true 
)

Constructor for a new iterator.

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

Parameters
rMeshthe mesh to iterator over
elementIterwhere to start iterating
skipDeletedElementswhether to include deleted elements

Definition at line 776 of file VertexMesh.hpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator::IsAllowedElement(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator::mElementIter, VertexMesh< ELEMENT_DIM, SPACE_DIM >::mElements, and VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator::mrMesh.

Member Function Documentation

◆ IsAllowedElement()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator::IsAllowedElement ( )
inlineprivate

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

Returns
true if allowed

Definition at line 806 of file VertexMesh.hpp.

Referenced by VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator::VertexElementIterator().

◆ IsAtEnd()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator::IsAtEnd ( )
inlineprivate

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

Returns
true if at end

Definition at line 800 of file VertexMesh.hpp.

Referenced by VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator::operator*().

◆ operator!=()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator::operator!= ( const typename VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator rOther)
inline

Comparison not-equal-to.

Returns
true if not equal
Parameters
rOtheriterator with which comparison is made

Definition at line 759 of file VertexMesh.hpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator::mElementIter.

◆ operator*()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexElement< ELEMENT_DIM, SPACE_DIM > & VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator::operator* ( )
inline

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

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

Definition at line 745 of file VertexMesh.hpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator::IsAtEnd(), and VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator::mElementIter.

◆ operator++()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator & VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator::operator++ ( )
inline

Prefix increment operator.

Returns
reference to incremented object

Definition at line 765 of file VertexMesh.hpp.

◆ operator->()

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexElement< ELEMENT_DIM, SPACE_DIM > * VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator::operator-> ( )
inline

Member access from a pointer.

Returns
pointer

Definition at line 752 of file VertexMesh.hpp.

Member Data Documentation

◆ mElementIter

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector<VertexElement<ELEMENT_DIM,SPACE_DIM>*>::iterator VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator::mElementIter
private

◆ mrMesh

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexMesh& VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator::mrMesh
private

The mesh we're iterating over.

Definition at line 702 of file VertexMesh.hpp.

Referenced by VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator::VertexElementIterator().

◆ mSkipDeletedElements

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator::mSkipDeletedElements
private

Whether to skip deleted elements.

Definition at line 708 of file VertexMesh.hpp.


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