36#if defined(OneBalancedWordComputer_RECURSES)
37#error Recursive header files inclusion detected in OneBalancedWordComputer.h
40#define OneBalancedWordComputer_RECURSES
42#if !defined OneBalancedWordComputer_h
44#define OneBalancedWordComputer_h
49#include "DGtal/base/Common.h"
50#include "DGtal/geometry/curves/FreemanChain.h"
51#include "DGtal/base/OrderedAlphabet.h"
52#include "DGtal/base/IteratorCirculatorTraits.h"
53#include "DGtal/kernel/CInteger.h"
54#include "DGtal/arithmetic/IntegerComputer.h"
55#include "DGtal/geometry/curves/ArithmeticalDSL.h"
90 template <
typename TConstIterator,
typename TInteger>
128 template < class TIterator, class iterator_type = typename IteratorCirculatorTraits <TIterator>::Category >
class CodeHandler
133 void init(
const TIterator & it )
162 template <
class TIterator >
169 void init(
const TIterator & it )
177 return ( n >= 0 ) ? myPosCodes[ n ] : myNegCodes[ 1-n ];
185 unsigned int i = 1-n;
186 while ( i >= myNegCodes.size() )
189 myNegCodes.push_back( *myFirst );
196 while ( i >= myPosCodes.size() )
198 myPosCodes.push_back( *myLast );
216 template <
class TIterator>
223 void init (
const TIterator & it )
927 Integer x = ( c ==
'0' ) ? 1 : ( ( c ==
'2' ) ? -1 : 0 ) ;
928 Integer y = ( c ==
'1' ) ? 1 : ( ( c ==
'3' ) ? -1 : 0 ) ;
942 template <
typename TConstIterator,
typename TInteger >
953#include "DGtal/geometry/curves/OneBalancedWordComputer.ih"
959#undef OneBalancedWordComputer_RECURSES
Aim: This class represents a naive (resp. standard) digital straight line (DSL), ie....
Code getCode(Index n) const
std::vector< Code > myNegCodes
void init(const TIterator &it)
std::vector< Code > myPosCodes
void init(const TIterator &it)
Code getCode(Index n) const
void init(const TIterator &it)
Code getCode(Index n) const
std::vector< Code > myCodes
bool longestChristoffelPrefix(ConstIterator it, const OrderedAlphabet &aOA)
void init(const FreemanChainCode &fc)
Vector(* myDisplacements)(Code)
Vector mainPatternVector() const
void translate(const Vector &v)
void init(const typename FreemanChainCode::ConstIterator &it)
bool isUL(Index pos) const
void computeLeaningPoints(Point &uf, Point &ul, Point &lf, Point &ll) const
ConstPointIterator pointEnd() const
ArithmeticalDSL< TInteger, TInteger, 4 > DSL
OneBalancedWordComputer< ConstIterator, Integer > Self
Code getSmallLetter() const
ConstPointIterator pointBegin() const
DSL getArithmeticalDescription() const
void init(const ConstIterator &it, const Point &start=Point(0, 0), Vector(*displacements)(Code)=defaultMoves)
Vector(* DisplacementFct)(Code)
OneBalancedWordComputer(const Self &other)
DGtal::PointVector< 2, Integer > Vector
Code getBigLetter() const
void selfDisplay(std::ostream &out) const
bool operator==(const Self &other) const
void setPosition(const Point &p)
void init(const ConstPointIterator &i)
CodeHandler< ConstIterator > myCodeHandler
DGtal::PointVector< 2, Integer > Point
ConstIterator end() const
Reverse getReverse() const
BOOST_CONCEPT_ASSERT((concepts::CInteger< TInteger >))
bool operator!=(const Self &other) const
TConstIterator ConstIterator
IteratorCirculatorTraits< ConstIterator >::Value Code
Integer remainder(const Point &aPoint) const
OneBalancedWordComputer()
ConstIterator begin() const
Vector displacement(Code c) const
bool previousIsLL(Index pos) const
Code getCode(Index pos) const
Size suffixLength() const
static Vector defaultMoves(Code c)
~OneBalancedWordComputer()
Size mainPatternLength() const
FreemanChain< TInteger > FreemanChainCode
bool nextIsLL(Index pos) const
OneBalancedWordComputer< ConstIterator, Integer > Reverse
Size prefixLength() const
OneBalancedWordComputer & operator=(const Self &other)
Aim: Describes an alphabet over an interval of (ascii) letters, where the lexicographic order can be ...
Aim: Implements basic operations that will be used in Point and Vector classes.
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
ConstPointIterator & operator=(const ConstPointIterator &other)
const OneBalancedWordComputer * getDSS() const
const OneBalancedWordComputer * myDSS
ConstPointIterator operator--(int)
bool operator!=(const ConstPointIterator other) const
BidirectionalCategory iterator_category
ConstPointIterator(const OneBalancedWordComputer *dss, Index ind, Point pt)
bool operator==(const ConstPointIterator other) const
ConstPointIterator operator++(int)
ConstPointIterator(const ConstPointIterator &other)=default
ConstPointIterator & operator--()
Index operator-(const ConstPointIterator other) const
ConstPointIterator & operator++()
Aim: Concept checking for Integer Numbers. More precisely, this concept is a refinement of both CEucl...