bioprocessing  5.1.2
bio::VolumeGraph< T, P >::vertex_const_iterator Class Reference

Iterator on the vertices of a volume graph. More...

#include <bioprocessing/graph/volumegraph.h>

Inheritance diagram for bio::VolumeGraph< T, P >::vertex_const_iterator:

Public Types

typedef Owner::Edge Edge
 
typedef Owner::Vertex Vertex
 
typedef Owner::Volume Volume
 
typedef Owner::Point Point
 

Public Member Functions

 vertex_const_iterator ()
 
 vertex_const_iterator (const This &o)
 
 vertex_const_iterator (const NonConstThis &o)
 
 ~vertex_const_iterator ()
 
Thisoperator= (const This &o)
 
Thisoperator= (const NonConstThis &o)
 
Thisoperator++ ()
 
This operator++ (int)
 
bool operator== (const This &o) const
 
bool operator!= (const This &o) const
 
bool operator== (const NonConstThis &o) const
 
bool operator!= (const NonConstThis &o) const
 
const Vertexoperator* () const
 
const Vertexoperator-> () const
 

Protected Types

typedef vertex_const_iterator This
 
typedef vertex_iterator NonConstThis
 
typedef VolumeGraph< T, P > Owner
 

Protected Member Functions

 vertex_const_iterator (const Volume &vol, bool end)
 
void toEnd ()
 
void setVertex ()
 

Protected Attributes

Volume _vol
 
Point4d _cur
 
Point4d _dim
 
Vertex _vtx
 

Friends

class VolumeGraph< T, P >
 

Detailed Description

template<typename T, typename P>
class bio::VolumeGraph< T, P >::vertex_const_iterator

Iterator on the vertices of a volume graph.

This is really ugly and I am sure there is a prettier way to do that, but I needed something that worked. Basically, an iterator is a class that points to a value, and which increment makes it change of pointed value. The issue here is there are no real vertices to point to since the graph is stored as a volume. Consequentely, I need to create from scratch the pointed vertex. I also need to keep in mind the corresponding voxel (actually, I keep a reference to the volume, and the coordinates of the voxel).

So the work done is iterator over the dimensions of the volume (we move along x, except if we're at the end of a line in which case we need to find where to go next). Then we create a fake vertex and point toward it.

I'm not sure I respect entirely the standard for one way random iterators as described in the standard library (I should check that). But it is usable for now (iteration from begin to end, with a temporary use in the loop. The vertices should not have an existence outside the loop).

Definition at line 420 of file volumegraph.h.

Member Typedef Documentation

◆ Edge

template<typename T , typename P >
typedef Owner::Edge bio::VolumeGraph< T, P >::vertex_const_iterator::Edge

Definition at line 427 of file volumegraph.h.

◆ NonConstThis

template<typename T , typename P >
typedef vertex_iterator bio::VolumeGraph< T, P >::vertex_const_iterator::NonConstThis
protected

Definition at line 424 of file volumegraph.h.

◆ Owner

template<typename T , typename P >
typedef VolumeGraph<T,P> bio::VolumeGraph< T, P >::vertex_const_iterator::Owner
protected

Definition at line 425 of file volumegraph.h.

◆ Point

template<typename T , typename P >
typedef Owner::Point bio::VolumeGraph< T, P >::vertex_const_iterator::Point

Definition at line 430 of file volumegraph.h.

◆ This

template<typename T , typename P >
typedef vertex_const_iterator bio::VolumeGraph< T, P >::vertex_const_iterator::This
protected

Definition at line 423 of file volumegraph.h.

◆ Vertex

template<typename T , typename P >
typedef Owner::Vertex bio::VolumeGraph< T, P >::vertex_const_iterator::Vertex

Definition at line 428 of file volumegraph.h.

◆ Volume

template<typename T , typename P >
typedef Owner::Volume bio::VolumeGraph< T, P >::vertex_const_iterator::Volume

Definition at line 429 of file volumegraph.h.

Constructor & Destructor Documentation

◆ vertex_const_iterator() [1/4]

template<typename T , typename P >
bio::VolumeGraph< T, P >::vertex_const_iterator::vertex_const_iterator ( const Volume vol,
bool  end 
)
inlineprotected

◆ vertex_const_iterator() [2/4]

template<typename T , typename P >
bio::VolumeGraph< T, P >::vertex_const_iterator::vertex_const_iterator ( )
inline

Definition at line 446 of file volumegraph.h.

◆ vertex_const_iterator() [3/4]

template<typename T , typename P >
bio::VolumeGraph< T, P >::vertex_const_iterator::vertex_const_iterator ( const This o)
inline

Definition at line 452 of file volumegraph.h.

◆ vertex_const_iterator() [4/4]

template<typename T , typename P >
bio::VolumeGraph< T, P >::vertex_const_iterator::vertex_const_iterator ( const NonConstThis o)
inline

Definition at line 458 of file volumegraph.h.

◆ ~vertex_const_iterator()

template<typename T , typename P >
bio::VolumeGraph< T, P >::vertex_const_iterator::~vertex_const_iterator ( )
inline

Definition at line 464 of file volumegraph.h.

Member Function Documentation

◆ operator!=() [1/2]

template<typename T , typename P >
bool bio::VolumeGraph< T, P >::vertex_const_iterator::operator!= ( const NonConstThis o) const
inline

◆ operator!=() [2/2]

template<typename T , typename P >
bool bio::VolumeGraph< T, P >::vertex_const_iterator::operator!= ( const This o) const
inline

◆ operator*()

template<typename T , typename P >
const Vertex& bio::VolumeGraph< T, P >::vertex_const_iterator::operator* ( ) const
inline

Definition at line 521 of file volumegraph.h.

◆ operator++() [1/2]

template<typename T , typename P >
This& bio::VolumeGraph< T, P >::vertex_const_iterator::operator++ ( )
inline

◆ operator++() [2/2]

template<typename T , typename P >
This bio::VolumeGraph< T, P >::vertex_const_iterator::operator++ ( int  )
inline

Definition at line 511 of file volumegraph.h.

◆ operator->()

template<typename T , typename P >
const Vertex* bio::VolumeGraph< T, P >::vertex_const_iterator::operator-> ( ) const
inline

Definition at line 522 of file volumegraph.h.

◆ operator=() [1/2]

◆ operator=() [2/2]

◆ operator==() [1/2]

template<typename T , typename P >
bool bio::VolumeGraph< T, P >::vertex_const_iterator::operator== ( const NonConstThis o) const
inline

◆ operator==() [2/2]

template<typename T , typename P >
bool bio::VolumeGraph< T, P >::vertex_const_iterator::operator== ( const This o) const
inline

◆ setVertex()

template<typename T , typename P >
void bio::VolumeGraph< T, P >::vertex_const_iterator::setVertex ( )
inlineprotected

Definition at line 529 of file volumegraph.h.

◆ toEnd()

template<typename T , typename P >
void bio::VolumeGraph< T, P >::vertex_const_iterator::toEnd ( )
inlineprotected

Definition at line 525 of file volumegraph.h.

Friends And Related Function Documentation

◆ VolumeGraph< T, P >

template<typename T , typename P >
friend class VolumeGraph< T, P >
friend

Definition at line 539 of file volumegraph.h.

Member Data Documentation

◆ _cur

template<typename T , typename P >
Point4d bio::VolumeGraph< T, P >::vertex_const_iterator::_cur
protected

◆ _dim

template<typename T , typename P >
Point4d bio::VolumeGraph< T, P >::vertex_const_iterator::_dim
protected

◆ _vol

template<typename T , typename P >
Volume bio::VolumeGraph< T, P >::vertex_const_iterator::_vol
protected

◆ _vtx

template<typename T , typename P >
Vertex bio::VolumeGraph< T, P >::vertex_const_iterator::_vtx
protected

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