DGtal  0.9.4beta
Public Types | Public Member Functions | Private Attributes
DGtal::ArithDSSIterator< TInteger, connectivity > Class Template Reference

#include <DGtal/geometry/curves/ArithDSSIterator.h>

Collaboration diagram for DGtal::ArithDSSIterator< TInteger, connectivity >:
[legend]

Public Types

typedef ArithDSSIterator Self
 
typedef TInteger Integer
 
typedef PointVector< 2, IntegerPoint
 
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

 BOOST_CONCEPT_ASSERT ((concepts::CInteger< Integer >))
 
TInteger remainder (const Point &Q)
 
reference operator* () const
 
Selfoperator++ ()
 
Self operator++ (int a)
 
bool operator== (const Self &other) const
 
bool operator!= (const Self &other) const
 
 ArithDSSIterator (const Integer a, const Integer b, const Integer mu, const Point &p)
 
 ArithDSSIterator ()
 
 ~ArithDSSIterator ()
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 
 ArithDSSIterator (const ArithDSSIterator &other)
 
Selfoperator= (const Self &other)
 

Private Attributes

Integer myA
 
Integer myB
 
Integer myMu
 
Point myP
 

Detailed Description

template<typename TInteger, int connectivity = 8>
class DGtal::ArithDSSIterator< TInteger, connectivity >

Aim: An iterator on the points of a Digital Straight Segment. Template parameters are the integer type and the connectivity of the DSS (8-connectivity as default value).

Description of class 'ArithDSSIterator'

Definition at line 63 of file ArithDSSIterator.h.

Member Typedef Documentation

template<typename TInteger , int connectivity = 8>
typedef std::ptrdiff_t DGtal::ArithDSSIterator< TInteger, connectivity >::difference_type

Definition at line 90 of file ArithDSSIterator.h.

template<typename TInteger , int connectivity = 8>
typedef TInteger DGtal::ArithDSSIterator< TInteger, connectivity >::Integer

Integer type.

Definition at line 76 of file ArithDSSIterator.h.

template<typename TInteger , int connectivity = 8>
typedef std::forward_iterator_tag DGtal::ArithDSSIterator< TInteger, connectivity >::iterator_category

stl iterator types.

Definition at line 88 of file ArithDSSIterator.h.

template<typename TInteger , int connectivity = 8>
typedef PointVector<2,Integer> DGtal::ArithDSSIterator< TInteger, connectivity >::Point

2D integer point type.

Definition at line 83 of file ArithDSSIterator.h.

template<typename TInteger , int connectivity = 8>
typedef const Point* DGtal::ArithDSSIterator< TInteger, connectivity >::pointer

Definition at line 91 of file ArithDSSIterator.h.

template<typename TInteger , int connectivity = 8>
typedef const Point& DGtal::ArithDSSIterator< TInteger, connectivity >::reference

Definition at line 92 of file ArithDSSIterator.h.

template<typename TInteger , int connectivity = 8>
typedef ArithDSSIterator DGtal::ArithDSSIterator< TInteger, connectivity >::Self

Self type.

Definition at line 71 of file ArithDSSIterator.h.

template<typename TInteger , int connectivity = 8>
typedef Point DGtal::ArithDSSIterator< TInteger, connectivity >::value_type

Definition at line 89 of file ArithDSSIterator.h.

Constructor & Destructor Documentation

template<typename TInteger , int connectivity = 8>
DGtal::ArithDSSIterator< TInteger, connectivity >::ArithDSSIterator ( const Integer  a,
const Integer  b,
const Integer  mu,
const Point p 
)

Constructor with initialisation of the DSS parameters and begin point.

Parameters
aDSS a parameter.
bDSS b parameter.
muDSS mu parameter.
pbegin point of the DSS.
template<typename TInteger , int connectivity = 8>
DGtal::ArithDSSIterator< TInteger, connectivity >::ArithDSSIterator ( )
inline

Constructor. Forbidden by default (protected to avoid g++ warnings).

Definition at line 150 of file ArithDSSIterator.h.

150 {};
template<typename TInteger , int connectivity = 8>
DGtal::ArithDSSIterator< TInteger, connectivity >::~ArithDSSIterator ( )
inline

Destructor.

Definition at line 157 of file ArithDSSIterator.h.

157 {};
template<typename TInteger , int connectivity = 8>
DGtal::ArithDSSIterator< TInteger, connectivity >::ArithDSSIterator ( const ArithDSSIterator< TInteger, connectivity > &  other)

Copy constructor.

Parameters
otherthe object to clone. Forbidden by default.

Member Function Documentation

template<typename TInteger , int connectivity = 8>
DGtal::ArithDSSIterator< TInteger, connectivity >::BOOST_CONCEPT_ASSERT ( (concepts::CInteger< Integer >)  )
template<typename TInteger , int connectivity = 8>
bool DGtal::ArithDSSIterator< TInteger, connectivity >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.
template<typename TInteger , int connectivity = 8>
bool DGtal::ArithDSSIterator< TInteger, connectivity >::operator!= ( const Self other) const

Difference operator.

Parameters
otherthe object to compare with.
Returns
'false' if equal, 'true' otherwise
template<typename TInteger , int connectivity = 8>
reference DGtal::ArithDSSIterator< TInteger, connectivity >::operator* ( ) const

Dereference operator.

Returns
the current point of the DSS
template<typename TInteger , int connectivity = 8>
Self& DGtal::ArithDSSIterator< TInteger, connectivity >::operator++ ( )

Prefix increment operator.

Returns
a reference to self where myP has been set up to the next point of the DSS
template<typename TInteger , int connectivity = 8>
Self DGtal::ArithDSSIterator< TInteger, connectivity >::operator++ ( int  a)

Postfix increment operator.

Parameters
anumber of unit increments
Returns
self
template<typename TInteger , int connectivity = 8>
Self& DGtal::ArithDSSIterator< TInteger, connectivity >::operator= ( const Self other)

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'. Forbidden by default.
template<typename TInteger , int connectivity = 8>
bool DGtal::ArithDSSIterator< TInteger, connectivity >::operator== ( const Self other) const

Equality operator.

Parameters
otherthe object to compare with.
Returns
'true' if the first point and the DSS parameters match and 'false' otherwise
template<typename TInteger , int connectivity = 8>
TInteger DGtal::ArithDSSIterator< TInteger, connectivity >::remainder ( const Point Q)

Compute the remainder of a point wrt the DSS characteristics

Parameters
Qa point
Returns
Integer its remainder
template<typename TInteger , int connectivity = 8>
void DGtal::ArithDSSIterator< TInteger, connectivity >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

Field Documentation

template<typename TInteger , int connectivity = 8>
Integer DGtal::ArithDSSIterator< TInteger, connectivity >::myA
private

y-component of the direction vector

Definition at line 183 of file ArithDSSIterator.h.

template<typename TInteger , int connectivity = 8>
Integer DGtal::ArithDSSIterator< TInteger, connectivity >::myB
private

x-component of the direction vector

Definition at line 188 of file ArithDSSIterator.h.

template<typename TInteger , int connectivity = 8>
Integer DGtal::ArithDSSIterator< TInteger, connectivity >::myMu
private

Intercept

Definition at line 193 of file ArithDSSIterator.h.

template<typename TInteger , int connectivity = 8>
Point DGtal::ArithDSSIterator< TInteger, connectivity >::myP
private

Current point of the DSS visited by the iterator

Definition at line 198 of file ArithDSSIterator.h.


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