DGtal  1.0.beta
Public Types | Public Member Functions
DGtal::StandardDSS4Computer< TIterator, TInteger > Class Template Reference

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

Inheritance diagram for DGtal::StandardDSS4Computer< TIterator, TInteger >:
[legend]
Collaboration diagram for DGtal::StandardDSS4Computer< TIterator, TInteger >:
[legend]

Public Types

typedef ArithmeticalDSSComputer< TIterator, TInteger, 4 > Super
 
typedef Super::ConstIterator ConstIterator
 
- Public Types inherited from DGtal::ArithmeticalDSSComputer< TIterator, TInteger, 4 >
typedef TIterator ConstIterator
 
typedef IteratorCirculatorTraits< ConstIterator >::Value Point
 
typedef IteratorCirculatorTraits< TIterator >::Value::Coordinate Coordinate
 
typedef TInteger Integer
 
typedef ArithmeticalDSS< Coordinate, Integer, adjacency > DSS
 
typedef DSS Primitive
 
typedef Point Vector
 
typedef ArithmeticalDSSComputer< ConstIterator, TInteger, adjacency > Self
 
typedef ArithmeticalDSSComputer< ReverseIterator< ConstIterator >, TInteger, adjacency > Reverse
 

Public Member Functions

 StandardDSS4Computer ()
 
 StandardDSS4Computer (const ConstIterator &it)
 
 StandardDSS4Computer (const StandardDSS4Computer &aOther)
 
StandardDSS4Computeroperator= (const StandardDSS4Computer &aOther)
 
- Public Member Functions inherited from DGtal::ArithmeticalDSSComputer< TIterator, TInteger, 4 >
 BOOST_CONCEPT_ASSERT ((boost_concepts::ReadableIteratorConcept< ConstIterator >))
 
 BOOST_CONCEPT_ASSERT ((boost_concepts::ForwardTraversalConcept< ConstIterator >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CInteger< Coordinate >))
 
 BOOST_CONCEPT_ASSERT ((concepts::CInteger< Integer >))
 
 BOOST_STATIC_ASSERT ((Point::dimension==2))
 
 BOOST_STATIC_ASSERT ((concepts::ConceptUtils::SameType< Point, typename DSS::Point >::value))
 
 ArithmeticalDSSComputer ()
 
 ArithmeticalDSSComputer (const ConstIterator &it)
 
 ArithmeticalDSSComputer (const ArithmeticalDSSComputer &other)
 
void init (const ConstIterator &it)
 
ArithmeticalDSSComputeroperator= (const ArithmeticalDSSComputer &other)
 
Self getSelf () const
 
Reverse getReverse () const
 
bool operator== (const ArithmeticalDSSComputer &other) const
 
bool operator!= (const ArithmeticalDSSComputer &other) const
 
 ~ArithmeticalDSSComputer ()
 
bool isExtendableFront ()
 
bool isExtendableBack ()
 
bool extendFront ()
 
bool extendBack ()
 
bool retractFront ()
 
bool retractBack ()
 
const Primitiveprimitive () const
 
Integer a () const
 
Integer b () const
 
Integer mu () const
 
Integer omega () const
 
Point Uf () const
 
Point Ul () const
 
Point Lf () const
 
Point Ll () const
 
Point back () const
 
Point front () const
 
ConstIterator begin () const
 
ConstIterator end () const
 
bool isValid () const
 
Integer remainder (const ConstIterator &it) const
 
Integer remainder (const Point &aPoint) const
 
Integer position (const ConstIterator &it) const
 
Integer position (const Point &aPoint) const
 
bool isInDSL (const Point &aPoint) const
 
bool isInDSL (const ConstIterator &it) const
 
bool isInDSS (const Point &aPoint) const
 
bool isInDSS (const ConstIterator &it) const
 
void selfDisplay (std::ostream &out) const
 

Additional Inherited Members

- Protected Attributes inherited from DGtal::ArithmeticalDSSComputer< TIterator, TInteger, 4 >
DSS myDSS
 
ConstIterator myBegin
 
ConstIterator myEnd
 

Detailed Description

template<typename TIterator, typename TInteger = typename IteratorCirculatorTraits<TIterator>::Value::Coordinate>
class DGtal::StandardDSS4Computer< TIterator, TInteger >

Aim: This class is a wrapper around ArithmeticalDSS that is devoted to the dynamic recognition of standard and simply 4-connected digital straight segments (DSS) along any sequence of digital points.

Before using a DSS computer, you must include the following header:

#include "DGtal/geometry/curves/ArithmeticalDSSComputer.h"

Then, you can construct a DSS computer as follows:

// Container of digital points
typedef std::vector<Z2::Point> Container;
// Iterator on the container
typedef Container::const_iterator ConstIterator;
// StandardDSS4 computer
typedef StandardDSS4Computer<ConstIterator> DSSComputer;
// Construction of the computer
DSSComputer theDSSComputer;

The extention is simply done as follows:

// Add points while it is possible
theDSSComputer.init( contour.begin() );
while ( ( theDSSComputer.end() != contour.end() ) &&
( theDSSComputer.extendFront() ) ) {}

See Digital straight lines and segments for further details.

Template Parameters
TIteratortype of iterator on 2d digital points, at least readable and forward.
TIntegertype of integers used for the computation of remainders, which is a model of CInteger.

This class is a model of CDynamicBidirectionalSegmentComputer. It is also default constructible, copy constructible, assignable and equality comparable.

See also
ArithmeticalDSSComputer NaiveDSS8Computer ArithmeticalDSS
exampleArithmeticalDSSComputer.cpp exampleArithmeticalDSS.cpp
Examples:
geometry/curves/exampleArithmeticalDSSComputer.cpp.

Definition at line 462 of file ArithmeticalDSSComputer.h.

Member Typedef Documentation

template<typename TIterator , typename TInteger = typename IteratorCirculatorTraits<TIterator>::Value::Coordinate>
typedef Super::ConstIterator DGtal::StandardDSS4Computer< TIterator, TInteger >::ConstIterator

Definition at line 470 of file ArithmeticalDSSComputer.h.

template<typename TIterator , typename TInteger = typename IteratorCirculatorTraits<TIterator>::Value::Coordinate>
typedef ArithmeticalDSSComputer<TIterator, TInteger, 4> DGtal::StandardDSS4Computer< TIterator, TInteger >::Super

Base class

Definition at line 469 of file ArithmeticalDSSComputer.h.

Constructor & Destructor Documentation

template<typename TIterator , typename TInteger = typename IteratorCirculatorTraits<TIterator>::Value::Coordinate>
DGtal::StandardDSS4Computer< TIterator, TInteger >::StandardDSS4Computer ( )

Default constructor. NB: not valid.

template<typename TIterator , typename TInteger = typename IteratorCirculatorTraits<TIterator>::Value::Coordinate>
DGtal::StandardDSS4Computer< TIterator, TInteger >::StandardDSS4Computer ( const ConstIterator it)

Constructor with initialisation

Parameters
itan iterator on 2d points
template<typename TIterator , typename TInteger = typename IteratorCirculatorTraits<TIterator>::Value::Coordinate>
DGtal::StandardDSS4Computer< TIterator, TInteger >::StandardDSS4Computer ( const StandardDSS4Computer< TIterator, TInteger > &  aOther)

Copy constructor.

Parameters
aOtherthe object to clone.

Member Function Documentation

template<typename TIterator , typename TInteger = typename IteratorCirculatorTraits<TIterator>::Value::Coordinate>
StandardDSS4Computer& DGtal::StandardDSS4Computer< TIterator, TInteger >::operator= ( const StandardDSS4Computer< TIterator, TInteger > &  aOther)

Assignment.

Parameters
aOtherthe object to copy.
Returns
a reference on 'this'.

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