File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/config/TeX-MML-AM_CHTML/MathJax.js
DGtal 2.0.0
DGtal::StandardDSLQ0< TFraction >::ConstIterator Struct Reference

#include <DGtal/arithmetic/StandardDSLQ0.h>

Public Types

typedef ConstIterator Self
typedef Point Value
typedef std::forward_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 (ConstAlias< 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 110 of file StandardDSLQ0.h.

Member Typedef Documentation

◆ difference_type

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

Definition at line 117 of file StandardDSLQ0.h.

◆ iterator_category

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

Definition at line 115 of file StandardDSLQ0.h.

◆ pointer

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

Definition at line 118 of file StandardDSLQ0.h.

◆ reference

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

Definition at line 119 of file StandardDSLQ0.h.

◆ Self

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

Definition at line 111 of file StandardDSLQ0.h.

◆ Value

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

Definition at line 112 of file StandardDSLQ0.h.

◆ value_type

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

Definition at line 116 of file StandardDSLQ0.h.

Constructor & Destructor Documentation

◆ ConstIterator() [1/3]

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

Definition at line 121 of file StandardDSLQ0.h.

122 : myPtrDSL( 0 )
123 {}
const StandardDSLQ0< TFraction > * myPtrDSL

References myPtrDSL.

◆ ConstIterator() [2/3]

template<typename TFraction>
DGtal::StandardDSLQ0< TFraction >::ConstIterator::ConstIterator ( ConstAlias< StandardDSLQ0< TFraction > > myDSL,
const Point & p )
inline

Definition at line 124 of file StandardDSLQ0.h.

126 : myPtrDSL( & myDSL ), myP( p )
127 {}
Aim: Represents a digital straight line with slope in the first quadrant (Q0: x >= 0,...

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

◆ ConstIterator() [3/3]

template<typename TFraction>
DGtal::StandardDSLQ0< TFraction >::ConstIterator::ConstIterator ( const Self & other)
inline

Definition at line 128 of file StandardDSLQ0.h.

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

References myP, and myPtrDSL.

Member Function Documentation

◆ operator!=()

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

Definition at line 180 of file StandardDSLQ0.h.

181 {
182 return ! ( this->operator==( other ) );
183 }
bool operator==(const Self &other) const

References operator==().

◆ operator*()

template<typename TFraction>
reference DGtal::StandardDSLQ0< TFraction >::ConstIterator::operator* ( ) const
inline

Definition at line 141 of file StandardDSLQ0.h.

142 {
143 ASSERT( myPtrDSL != 0 );
144 return myP;
145 }

References myP, and myPtrDSL.

◆ operator++() [1/2]

template<typename TFraction>
Self & DGtal::StandardDSLQ0< TFraction >::ConstIterator::operator++ ( )
inline

Definition at line 153 of file StandardDSLQ0.h.

154 {
155 Integer rem = myPtrDSL->r( myP );
156 if ( rem - myPtrDSL->b() >= myPtrDSL->mu() )
157 ++myP[ 1 ]; // +y;
158 else
159 ++myP[ 0 ]; // +x;
160 return *this;
161 }
Integer r(const Point &p) const
const Integer & mu() const
Integer b() const

References myP, and myPtrDSL.

Referenced by operator++().

◆ operator++() [2/2]

template<typename TFraction>
Self DGtal::StandardDSLQ0< TFraction >::ConstIterator::operator++ ( int )
inline

Definition at line 165 of file StandardDSLQ0.h.

166 {
167 Self __tmp = *this;
168 this->operator++();
169 return __tmp;
170 }

References operator++().

◆ operator->()

template<typename TFraction>
pointer DGtal::StandardDSLQ0< TFraction >::ConstIterator::operator-> ( ) const
inline

Definition at line 147 of file StandardDSLQ0.h.

148 {
149 ASSERT( myPtrDSL != 0 );
150 return &myP;
151 }

References myP, and myPtrDSL.

◆ operator=()

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

Definition at line 131 of file StandardDSLQ0.h.

132 {
133 if ( this != &other )
134 {
135 myPtrDSL = other.myPtrDSL;
136 myP = other.myP;
137 }
138 return *this;
139 }

References myP, and myPtrDSL.

◆ operator==()

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

Definition at line 173 of file StandardDSLQ0.h.

174 {
175 ASSERT( myPtrDSL == other.myPtrDSL );
176 return myP == other.myP;
177 }

References myP, and myPtrDSL.

Referenced by operator!=().

Field Documentation

◆ myP

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

◆ myPtrDSL

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

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