DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Private Attributes
DGtal::StandardDSLQ0< TFraction >::ConstIterator Struct Reference

#include <StandardDSLQ0.h>

Collaboration diagram for DGtal::StandardDSLQ0< TFraction >::ConstIterator:
Collaboration graph
[legend]

Public Types

typedef ConstIterator Self
typedef Point Value
typedef std::input_iterator_tag iterator_category
typedef Point value_type
typedef std::ptrdiff_t difference_type
typedef const Pointpointer
typedef const Pointreference

Public Member Functions

 ConstIterator ()
 ConstIterator (const StandardDSLQ0< TFraction > &myDSL, const Point &p)
 ConstIterator (const Self &other)
Selfoperator= (const Self &other)
reference operator* () const
pointer operator-> () const
Selfoperator++ ()
Self operator++ (int)
bool operator== (const Self &other) const
bool operator!= (const Self &other) const

Private Attributes

const StandardDSLQ0< TFraction > * myPtrDSL
Point myP

Detailed Description

template<typename TFraction>
struct DGtal::StandardDSLQ0< TFraction >::ConstIterator

The iterator to move in the standard digital straight line, point by point. To move from A to B on the DSL D, visiting [A,B], write:

for ( ConstIterator it = D.begin( A ), it_end = D.end( B );
it != it_end; ++it )
Point P = *it;

Definition at line 109 of file StandardDSLQ0.h.


Member Typedef Documentation

template<typename TFraction>
typedef std::ptrdiff_t DGtal::StandardDSLQ0< TFraction >::ConstIterator::difference_type

Definition at line 116 of file StandardDSLQ0.h.

template<typename TFraction>
typedef std::input_iterator_tag DGtal::StandardDSLQ0< TFraction >::ConstIterator::iterator_category

Definition at line 114 of file StandardDSLQ0.h.

template<typename TFraction>
typedef const Point* DGtal::StandardDSLQ0< TFraction >::ConstIterator::pointer

Definition at line 117 of file StandardDSLQ0.h.

template<typename TFraction>
typedef const Point& DGtal::StandardDSLQ0< TFraction >::ConstIterator::reference

Definition at line 118 of file StandardDSLQ0.h.

template<typename TFraction>
typedef ConstIterator DGtal::StandardDSLQ0< TFraction >::ConstIterator::Self

Definition at line 110 of file StandardDSLQ0.h.

template<typename TFraction>
typedef Point DGtal::StandardDSLQ0< TFraction >::ConstIterator::Value

Definition at line 111 of file StandardDSLQ0.h.

template<typename TFraction>
typedef Point DGtal::StandardDSLQ0< TFraction >::ConstIterator::value_type

Definition at line 115 of file StandardDSLQ0.h.


Constructor & Destructor Documentation

template<typename TFraction>
DGtal::StandardDSLQ0< TFraction >::ConstIterator::ConstIterator ( )
inline

Definition at line 120 of file StandardDSLQ0.h.

: myPtrDSL( 0 )
{}
template<typename TFraction>
DGtal::StandardDSLQ0< TFraction >::ConstIterator::ConstIterator ( const StandardDSLQ0< TFraction > &  myDSL,
const Point p 
)
inline

Definition at line 123 of file StandardDSLQ0.h.

: myPtrDSL( & myDSL ), myP( p )
{}
template<typename TFraction>
DGtal::StandardDSLQ0< TFraction >::ConstIterator::ConstIterator ( const Self other)
inline

Definition at line 127 of file StandardDSLQ0.h.

: myPtrDSL( other.myPtrDSL ), myP( other.myP )
{}

Member Function Documentation

template<typename TFraction>
bool DGtal::StandardDSLQ0< TFraction >::ConstIterator::operator!= ( const Self other) const
inline

Definition at line 179 of file StandardDSLQ0.h.

References DGtal::StandardDSLQ0< TFraction >::ConstIterator::operator==().

{
return ! ( this->operator==( other ) );
}
template<typename TFraction>
reference DGtal::StandardDSLQ0< TFraction >::ConstIterator::operator* ( ) const
inline
template<typename TFraction>
Self& DGtal::StandardDSLQ0< TFraction >::ConstIterator::operator++ ( )
inline

Definition at line 152 of file StandardDSLQ0.h.

References DGtal::StandardDSLQ0< TFraction >::ConstIterator::myP, and DGtal::StandardDSLQ0< TFraction >::ConstIterator::myPtrDSL.

Referenced by DGtal::StandardDSLQ0< TFraction >::ConstIterator::operator++().

{
Integer rem = myPtrDSL->r( myP );
if ( rem - myPtrDSL->b() >= myPtrDSL->mu() )
++myP[ 1 ]; // +y;
else
++myP[ 0 ]; // +x;
return *this;
}
template<typename TFraction>
Self DGtal::StandardDSLQ0< TFraction >::ConstIterator::operator++ ( int  )
inline

Definition at line 164 of file StandardDSLQ0.h.

References DGtal::StandardDSLQ0< TFraction >::ConstIterator::operator++().

{
Self __tmp = *this;
this->operator++();
return __tmp;
}
template<typename TFraction>
pointer DGtal::StandardDSLQ0< TFraction >::ConstIterator::operator-> ( ) const
inline
template<typename TFraction>
Self& DGtal::StandardDSLQ0< TFraction >::ConstIterator::operator= ( const Self other)
inline

Definition at line 130 of file StandardDSLQ0.h.

References DGtal::StandardDSLQ0< TFraction >::ConstIterator::myP, and DGtal::StandardDSLQ0< TFraction >::ConstIterator::myPtrDSL.

{
if ( this != &other )
{
myPtrDSL = other.myPtrDSL;
myP = other.myP;
}
return *this;
}
template<typename TFraction>
bool DGtal::StandardDSLQ0< TFraction >::ConstIterator::operator== ( const Self other) const
inline

Field Documentation

template<typename TFraction>
Point DGtal::StandardDSLQ0< TFraction >::ConstIterator::myP
private
template<typename TFraction>
const StandardDSLQ0<TFraction>* DGtal::StandardDSLQ0< TFraction >::ConstIterator::myPtrDSL
private

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