DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes
DGtal::CombinatorialDSS< TConstIterator, TInteger > Class Template Reference

#include <CombinatorialDSS.h>

Collaboration diagram for DGtal::CombinatorialDSS< TConstIterator, TInteger >:
Collaboration graph
[legend]

Data Structures

class  CodeHandler
class  CodeHandler< TIterator, bidirectional_iterator_tag >
class  CodeHandler< TIterator, random_access_iterator_tag >
struct  ConstPointIterator

Public Types

typedef TConstIterator ConstIterator
typedef TInteger Integer
typedef FreemanChain< TInteger > FreemanChainCode
typedef CombinatorialDSS
< ConstIterator, Integer
Self
typedef CombinatorialDSS
< ConstIterator, Integer
Reverse
typedef DGtal::PointVector
< 2, Integer
Point
typedef DGtal::PointVector
< 2, Integer
Vector
typedef iterator_traits
< ConstIterator >::value_type 
Code
typedef int Size
typedef int Index
typedef Vector(* DisplacementFct )(Code)

Public Member Functions

 BOOST_CONCEPT_ASSERT ((CInteger< TInteger >))
 CombinatorialDSS ()
 ~CombinatorialDSS ()
void init (const ConstIterator &it, const Point &start=Point(0, 0), Vector(*displacements)(Code)=defaultMoves)
void init (const ConstPointIterator &i)
void init (const FreemanChainCode &fc)
void init (const typename FreemanChainCode::ConstIterator &it)
 CombinatorialDSS (const Self &other)
CombinatorialDSSoperator= (const Self &other)
Self getSelf () const
bool operator== (const Self &other) const
bool operator!= (const Self &other) const
Reverse getReverse () const
bool isExtendableForward ()
bool extendForward ()
bool extendBackward ()
bool isExtendableBackward ()
bool retractForward ()
bool retractBackward ()
void setPosition (const Point &p)
void translate (const Vector &v)
void getArithmeticalDescription (Integer &a, Integer &b, Integer &mu, Integer &omega) const
Integer getA () const
Integer getB () const
Integer getMu () const
Integer getOmega () const
Integer getRemainder (const Point &aPoint) const
void computeLeaningPoints (Point &uf, Point &ul, Point &lf, Point &ll) const
Point getUf () const
Point getUl () const
Point getLf () const
Point getLl () const
bool isValid () const
bool longestChristoffelPrefix (ConstIterator it, const OrderedAlphabet &aOA)
Point getFirstPoint () const
Point getLastPoint () const
ConstPointIterator pointBegin () const
ConstPointIterator pointEnd () const
ConstIterator begin () const
ConstIterator end () const
void selfDisplay (std::ostream &out) const
Code getSmallLetter () const
Code getBigLetter () const
Code getCode (Index pos)
Code getCode (Index pos) const
Size mainPatternLength () const
Vector mainPatternVector () const
Size suffixLength () const
Size prefixLength () const
bool isUL (Index pos) const
bool nextIsLL (Index pos) const
bool previousIsLL (Index pos) const
bool isTrivial () const
Vector displacement (Code c) const

Static Public Member Functions

static Vector defaultMoves (Code c)

Protected Attributes

CodeHandler< ConstIteratormyCodeHandler
ConstIterator myBegin
ConstIterator myEnd
Point myFirstPoint
Point myLastPoint
Index myFirstLetter
Index myLastLetter
unsigned int myNbRepeat
Index myPatternBegin
Index myPatternEnd
Size myLeftPatternLength
Index myNextBefore
Index myNextAfter
Vector(* myDisplacements )(Code)

Detailed Description

template<typename TConstIterator, typename TInteger>
class DGtal::CombinatorialDSS< TConstIterator, TInteger >

Aim:

Description of template class 'CombinatorialDSS'

A combinatorial DSS is a specialized type of 4-connected DSS that reads codes of a Freeman chain as input.

In general, the Freeman coding of a 4-connected DSS has the following form : 's.c^k.p' where 'k>0', 'c' is a Christoffel word, 's' is a suffix of 'c' and 'p' a prefix of 'c'.

More precisely 'c' codes the path between two consecutive upper leaning points so the only exceptions are where the DSS is parallel to one of the axes , in this case the DSS is called 'trivial', and when the DSS has only one upper leaning point.

This class is a model of the concept CBidirectionalSegmentComputer.

Template Parameters:
TConstIteratorthe type of iterator used to read the input codes (preferably of category 'random_access_iterator_tag').
TIntegerthe type of scalars used for the coordinates of the points (satisfying CInteger)

Definition at line 87 of file CombinatorialDSS.h.


Member Typedef Documentation

template<typename TConstIterator, typename TInteger>
typedef iterator_traits<ConstIterator>::value_type DGtal::CombinatorialDSS< TConstIterator, TInteger >::Code

Definition at line 107 of file CombinatorialDSS.h.

template<typename TConstIterator, typename TInteger>
typedef TConstIterator DGtal::CombinatorialDSS< TConstIterator, TInteger >::ConstIterator

Definition at line 94 of file CombinatorialDSS.h.

template<typename TConstIterator, typename TInteger>
typedef Vector(* DGtal::CombinatorialDSS< TConstIterator, TInteger >::DisplacementFct)(Code)

Definition at line 112 of file CombinatorialDSS.h.

template<typename TConstIterator, typename TInteger>
typedef FreemanChain<TInteger> DGtal::CombinatorialDSS< TConstIterator, TInteger >::FreemanChainCode

Definition at line 98 of file CombinatorialDSS.h.

template<typename TConstIterator, typename TInteger>
typedef int DGtal::CombinatorialDSS< TConstIterator, TInteger >::Index

Definition at line 109 of file CombinatorialDSS.h.

template<typename TConstIterator, typename TInteger>
typedef TInteger DGtal::CombinatorialDSS< TConstIterator, TInteger >::Integer

Definition at line 95 of file CombinatorialDSS.h.

template<typename TConstIterator, typename TInteger>
typedef DGtal::PointVector<2,Integer> DGtal::CombinatorialDSS< TConstIterator, TInteger >::Point

Definition at line 103 of file CombinatorialDSS.h.

template<typename TConstIterator, typename TInteger>
typedef CombinatorialDSS<ConstIterator, Integer> DGtal::CombinatorialDSS< TConstIterator, TInteger >::Reverse

Definition at line 100 of file CombinatorialDSS.h.

template<typename TConstIterator, typename TInteger>
typedef CombinatorialDSS<ConstIterator, Integer> DGtal::CombinatorialDSS< TConstIterator, TInteger >::Self

Definition at line 99 of file CombinatorialDSS.h.

template<typename TConstIterator, typename TInteger>
typedef int DGtal::CombinatorialDSS< TConstIterator, TInteger >::Size

Definition at line 108 of file CombinatorialDSS.h.

template<typename TConstIterator, typename TInteger>
typedef DGtal::PointVector<2,Integer> DGtal::CombinatorialDSS< TConstIterator, TInteger >::Vector

Definition at line 104 of file CombinatorialDSS.h.


Constructor & Destructor Documentation

template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::CombinatorialDSS ( )
inline

Default constructor

Definition at line 45 of file CombinatorialDSS.ih.

{ }
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::~CombinatorialDSS ( )
inline

Destructor.

Definition at line 51 of file CombinatorialDSS.ih.

{ }
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::CombinatorialDSS ( const Self other)
inline

Initialize from an array of codes.

Parameters:
apointer to an array of codes.
thelength of the code array.
thestart position in 'theCode'.
theposition of the starting point of the first code.
afunction that returns the displacement vector of the codes. Copy constructor.
otherthe object to clone.
otherthe object to clone.

Definition at line 122 of file CombinatorialDSS.ih.

:
myCodeHandler ( other.myCodeHandler ),
myBegin ( other.myBegin ),
myEnd ( other.myEnd ),
myFirstPoint ( other.myFirstPoint ),
myLastPoint ( other.myLastPoint ),
myFirstLetter ( other.myFirstLetter ),
myLastLetter ( other.myLastLetter ),
myNbRepeat ( other.myNbRepeat ),
myPatternBegin ( other.myPatternBegin ),
myPatternEnd ( other.myPatternEnd ),
myLeftPatternLength ( other.myLeftPatternLength ),
myNextBefore ( other.myNextBefore ),
myNextAfter ( other.myNextAfter ),
myDisplacements ( other.myDisplacements )
{}

Member Function Documentation

template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::ConstIterator DGtal::CombinatorialDSS< TConstIterator, TInteger >::begin ( ) const
inline
Returns:
begin iterator of the DSS range.

Definition at line 870 of file CombinatorialDSS.ih.

Referenced by DGtal::CombinatorialDSS< TConstIterator, TInteger >::operator==().

{
return myBegin;
}
template<typename TConstIterator, typename TInteger>
DGtal::CombinatorialDSS< TConstIterator, TInteger >::BOOST_CONCEPT_ASSERT ( (CInteger< TInteger >)  )
template<typename TConstIterator , typename TInteger >
void DGtal::CombinatorialDSS< TConstIterator, TInteger >::computeLeaningPoints ( Point uf,
Point ul,
Point lf,
Point ll 
) const
inline

Computes the leaning points of the DSS

Parameters:
(returns)the first upper leaning point.
(returns)the last upper leaning point.
(returns)the first lower leaning point.
(returns)the last lower leaning point.

Definition at line 1004 of file CombinatorialDSS.ih.

References DGtal::CombinatorialDSS< TConstIterator, TInteger >::ConstPointIterator::getIndex().

{
ConstPointIterator it = pointBegin();
while ( ! isUL ( it.getIndex() ) )
++it;
uf = *it;
Vector v = mainPatternVector();
ul = uf + v*myNbRepeat;
while ( ! previousIsLL ( it.getIndex() ) )
++it;
lf = ( suffixLength() >= myLeftPatternLength ) ? *it - mainPatternVector() : *it;
int nbLowerRepeats = ( prefixLength() >= mainPatternLength() - myLeftPatternLength )
? myNbRepeat : myNbRepeat - 1;
ll = *it + v*nbLowerRepeats;
if ( getRemainder( uf ) > getRemainder( lf ) )
{
swap ( uf, lf );
swap ( ul, ll );
}
}
template<typename TConstIterator, typename TInteger>
static Vector DGtal::CombinatorialDSS< TConstIterator, TInteger >::defaultMoves ( Code  c)
inlinestatic

Default displacement vectors associated to codes.

   (1)
    ^
    |
    |

(2) <——-> (0) | | v (3)

Definition at line 940 of file CombinatorialDSS.h.

{
Integer x = ( c == '0' ) ? 1 : ( ( c == '2' ) ? -1 : 0 ) ;
Integer y = ( c == '1' ) ? 1 : ( ( c == '3' ) ? -1 : 0 ) ;
return Vector( x, y );
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::Vector DGtal::CombinatorialDSS< TConstIterator, TInteger >::displacement ( Code  c) const
inline

Convert a code into vector.

Parameters:
acode.
Returns:
the vector defined by that code.
Parameters:
acode.
Returns:
the vector defined by that code.

Definition at line 1097 of file CombinatorialDSS.ih.

{
return this->myDisplacements( c );
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::ConstIterator DGtal::CombinatorialDSS< TConstIterator, TInteger >::end ( ) const
inline
Returns:
end iterator of the DSS range.

Definition at line 878 of file CombinatorialDSS.ih.

Referenced by DGtal::CombinatorialDSS< TConstIterator, TInteger >::operator==().

{
return myEnd;
}
template<typename TConstIterator , typename TInteger >
bool DGtal::CombinatorialDSS< TConstIterator, TInteger >::extendBackward ( )
inline

Tests whether the current DSS can be extended at the back. Computes the parameters of the extended DSS if yes.

Returns:
'true' if yes, 'false' otherwise.
'true' if yes, 'false' otherwise.

Definition at line 283 of file CombinatorialDSS.ih.

{
Code letterRead = getCode( myFirstLetter - 1 );
Code letterExpected = getCode( myNextBefore );
// Test if the new letter forms a longer suffix of the main pattern
// If the new letter is not what was expected, either the main pattern
// has to grow or either the DSS may not be extended.
if ( letterRead == letterExpected ) {
// Test if it forms a complete repetition of the main pattern
//cout << "Case 1" << endl;
// Move main pattern one iteration backward, nb 'myNextBefore' is
// already one iteration before.
myPatternEnd -= mpl;
myNextAfter -= mpl;
} else {
//cout << "Case 2" << endl;
}
} else if ( isTrivial() ) {
//cout << "Case 3" << endl;
} else if ( previousIsLL( myNextBefore ) && ( letterRead == getSmallLetter() ) ) {
//cout << "Case 4" << endl;
// The previous main pattern is now the left subpattern
Size myOldMainPatternLength = mainPatternLength();
Size myOldLeftPatternLength = myLeftPatternLength;
//Size myOldRightPatternLength = myOldMainPatternLength - myOldLeftPatternLength;
myPatternEnd += (myNbRepeat-1) * myOldMainPatternLength;
myLeftPatternLength = mainPatternLength() - myOldMainPatternLength;
myNextAfter -= myOldLeftPatternLength;
} else if ( isUL( myNextBefore ) && ( letterRead == getBigLetter() ) ) {
//In this case the whole main pattern is modified! Not only complexified.
Size myOldMainPatternLength = mainPatternLength();
Size myOldRightPatternLength = myOldMainPatternLength - myLeftPatternLength;
Size myOldPrefixLength = prefixLength();
// test if the prefix is long enough to contain the new Last Upper
// Leaning point
if ( myOldPrefixLength < myOldRightPatternLength ) {
//cout << "Case 5" << endl;
myNextAfter = myNextAfter - myOldMainPatternLength + myLeftPatternLength;
+ (myNbRepeat - 1)*myOldMainPatternLength
- myLeftPatternLength;
} else {
//cout << "Case 6" << endl;
myNextAfter = myNextAfter - myOldMainPatternLength - myOldRightPatternLength;
+ myNbRepeat*myOldMainPatternLength
}
myLeftPatternLength = mainPatternLength() - myOldMainPatternLength;
} else {
//cout << "Case 7" << endl;
return false;
}
return true;
}
template<typename TConstIterator , typename TInteger >
bool DGtal::CombinatorialDSS< TConstIterator, TInteger >::extendForward ( )
inline

Tests whether the current DSS can be extended at the front. Computes the parameters of the extended DSS if yes.

Returns:
'true' if yes, 'false' otherwise.
'true' if yes, 'false' otherwise.

Definition at line 214 of file CombinatorialDSS.ih.

{
Code letterRead = getCode( myLastLetter + 1 );
Code letterExpected = getCode( myNextAfter );
// Test if the new letter forms a longer prefix of the main pattern
// If the new letter is not what was expected, either the main pattern
// has to grow or either the DSS may not be extended.
if ( letterRead == letterExpected ) {
// Test if it is a complete repetition of the main pattern
} else {
}
} else if ( isTrivial() ) {
} else if ( nextIsLL( myNextAfter ) && ( letterRead == getBigLetter() ) ) {
// The previous main pattern is now the left subpattern
Size myOldSuffixLength = suffixLength();
myNextBefore = myPatternEnd - myOldSuffixLength;
} else if ( isUL( myNextAfter ) && ( letterRead == getSmallLetter() ) ) {
//In this case thw whole main pattern is modified! Not only complexified.
Size myOldLeftPatternLength = myLeftPatternLength;
Size myOldSuffixLength = suffixLength();
// test if the suffix is long enough to contain the new first upper
// leaning point (beginning of the main pattern)
if ( myOldSuffixLength < myOldLeftPatternLength ) {
- myOldLeftPatternLength;
myOldLeftPatternLength - myOldSuffixLength;
} else {
//TODO : test this!
myPatternBegin = myPatternBegin - myOldLeftPatternLength;
myNextBefore = myPatternEnd - (myOldSuffixLength - myOldLeftPatternLength);
}
} else {
return false;
}
++myEnd;
return true;
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::Integer DGtal::CombinatorialDSS< TConstIterator, TInteger >::getA ( ) const
inline

Computes the arithmetic description of the DSS : 0 <= ax+by+mu < omega Uses 'getArithmeticalDescription' so prefer this latter one if more then one parameter is computed.

Returns:
the value of 'a' in the DSS equation
the value of 'a' in the DSS equation

Definition at line 917 of file CombinatorialDSS.ih.

{
Integer a,b,mu,omega;
getArithmeticalDescription ( a, b, mu, omega);
return a;
}
template<typename TConstIterator , typename TInteger >
void DGtal::CombinatorialDSS< TConstIterator, TInteger >::getArithmeticalDescription ( Integer a,
Integer b,
Integer mu,
Integer omega 
) const
inline

Computes the arithmetic description of the DSS : 0 <= ax+by+mu < omega

Parameters:
(returns)'a' from the equation mu <= ax-by < mu + omega
(returns)'b' from the equation mu <= ax-by < mu + omega
(returns)'mu' from the equation mu <= ax-by < mu + omega
(returns)'omega' from the equation mu <= ax-by < mu + omega TODO test this !
(returns)'a' from the equation mu <= ax-by < mu + omega
(returns)'b' from the equation mu <= ax-by < mu + omega
(returns)'mu' from the equation mu <= ax-by < mu + omega
(returns)'omega' from the equation mu <= ax-by < mu + omega

Definition at line 975 of file CombinatorialDSS.ih.

References DGtal::PointVector< dim, TEuclideanRing >::at(), and DGtal::CombinatorialDSS< TConstIterator, TInteger >::ConstPointIterator::getIndex().

{
ConstPointIterator itBegin = pointBegin();
while ( itBegin.getIndex() != myPatternBegin )
itBegin++;
ConstPointIterator itEnd = pointEnd();
while ( itEnd.getIndex() != myPatternEnd+1 )
itEnd--;
ConstPointIterator it;
Size myRightPatternLenght = mainPatternLength() - myLeftPatternLength;
it = itBegin;
for (int i=0; i<myRightPatternLenght; i++)
it++;
Point pb = *itBegin;
Point pe = *itEnd;
Point po = *it;
Vector v = pe - pb;
a = v.at(1);
b = v.at(0);
Integer r1 = a*pb.at(0) - b*pb.at(1);
Integer r2 = a*po.at(0) - b*po.at(1);
mu = min (r1, r2);
omega = ((a>0) ? a : -a) + ((b>0) ? b : -b );
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::Integer DGtal::CombinatorialDSS< TConstIterator, TInteger >::getB ( ) const
inline

Computes the arithmetic description of the DSS : 0 <= ax+by+mu < omega Uses 'getArithmeticalDescription' so prefer this latter one if more then one parameter is computed.

Returns:
the value of 'b' in the DSS equation
the value of 'b' in the DSS equation

Definition at line 930 of file CombinatorialDSS.ih.

{
Integer a,b,mu,omega;
getArithmeticalDescription ( a, b, mu, omega);
return b;
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::Code DGtal::CombinatorialDSS< TConstIterator, TInteger >::getBigLetter ( ) const
inline

Returns the last letter of the main pattern.

Returns:
the big letter over which the DSS is written.
the big letter over which the DSS is written.

Definition at line 714 of file CombinatorialDSS.ih.

{
return getCode( myPatternEnd );
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::Code DGtal::CombinatorialDSS< TConstIterator, TInteger >::getCode ( Index  pos)
inline

Get the code at a given index, if code at index 'pos' has not been read yet, the input iterator will be used to access it.

Parameters:
aposition in the FreemanChain
Returns:
the letter at the given position

Definition at line 742 of file CombinatorialDSS.ih.

References DGtal::CombinatorialDSS< TConstIterator, TInteger >::getCode().

Referenced by DGtal::CombinatorialDSS< TConstIterator, TInteger >::getCode(), DGtal::CombinatorialDSS< TConstIterator, TInteger >::ConstPointIterator::next(), and DGtal::CombinatorialDSS< TConstIterator, TInteger >::ConstPointIterator::prev().

{
return myCodeHandler.getCode( pos );
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::Code DGtal::CombinatorialDSS< TConstIterator, TInteger >::getCode ( Index  pos) const
inline

Get the code at a given index.

Parameters:
aposition in the FreemanChain
Returns:
the letter at the given position

Definition at line 750 of file CombinatorialDSS.ih.

References DGtal::CombinatorialDSS< TConstIterator, TInteger >::getCode().

{
return myCodeHandler.getCode( pos );
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::Point DGtal::CombinatorialDSS< TConstIterator, TInteger >::getFirstPoint ( ) const
inline

Accessor to the first added point to the DSS

Returns:
point.

Definition at line 1130 of file CombinatorialDSS.ih.

{
return myFirstPoint;
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::Point DGtal::CombinatorialDSS< TConstIterator, TInteger >::getLastPoint ( ) const
inline

Accessor to the last added point to the DSS

Returns:
point.

Definition at line 1143 of file CombinatorialDSS.ih.

{
return myLastPoint;
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::Point DGtal::CombinatorialDSS< TConstIterator, TInteger >::getLf ( ) const
inline

Accessor to the first lower leaning point Uses 'computeLeaningPoints' so prefer this latter one if more then one leaning point is computed.

Returns:
first lower leaning point.
first lower leaning point.

Definition at line 1068 of file CombinatorialDSS.ih.

{
Point uf, ul, lf, ll;
computeLeaningPoints( uf, ul, lf, ll );
return lf;
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::Point DGtal::CombinatorialDSS< TConstIterator, TInteger >::getLl ( ) const
inline

Accessor to the last lower leaning point Uses 'computeLeaningPoints' so prefer this latter one if more then one leaning point is computed.

Returns:
last lower leaning point.
last lower leaning point.

Definition at line 1082 of file CombinatorialDSS.ih.

{
Point uf, ul, lf, ll;
computeLeaningPoints( uf, ul, lf, ll );
return ll;
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::Integer DGtal::CombinatorialDSS< TConstIterator, TInteger >::getMu ( ) const
inline

Computes the arithmetic description of the DSS : 0 <= ax+by+mu < omega Uses 'getArithmeticalDescription' so prefer this latter one if more then one parameter is computed.

Returns:
the value of 'mu' in the DSS equation
the value of 'mu' in the DSS equation

Definition at line 945 of file CombinatorialDSS.ih.

{
Integer a,b,mu,omega;
getArithmeticalDescription ( a, b, mu, omega );
return mu;
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::Integer DGtal::CombinatorialDSS< TConstIterator, TInteger >::getOmega ( ) const
inline

Computes the arithmetic description of the DSS : 0 <= ax+by+mu < omega Uses 'getArithmeticalDescription' so prefer this latter one if more then one parameter is computed.

Returns:
the value of 'omega' in the DSS equation
the value of 'omega' in the DSS equation

Definition at line 959 of file CombinatorialDSS.ih.

{
Integer a,b,mu,omega;
getArithmeticalDescription ( a, b, mu, omega );
return omega;
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::Integer DGtal::CombinatorialDSS< TConstIterator, TInteger >::getRemainder ( const Point aPoint) const
inline

Computes the remained of a point relatively to the arithmetical description of the current DSS.

Parameters:
aPointa point whose remainder is returned
Returns:
the remaindre of aPoint

Definition at line 1106 of file CombinatorialDSS.ih.

{
Integer a,b,mu,omega;
Integer x = aPoint[0];
Integer y = aPoint[1];
getArithmeticalDescription( a, b, mu, omega );
return a*x - b*y;
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::Reverse DGtal::CombinatorialDSS< TConstIterator, TInteger >::getReverse ( ) const
inline
Returns:
a reverse version of '*this'. TODO : not implemented yet

Definition at line 202 of file CombinatorialDSS.ih.

{
return Reverse();
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::Self DGtal::CombinatorialDSS< TConstIterator, TInteger >::getSelf ( ) const
inline
Returns:
an uninitialized instance of CombinatorialDSS.

Definition at line 170 of file CombinatorialDSS.ih.

{
return CombinatorialDSS( );
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::Code DGtal::CombinatorialDSS< TConstIterator, TInteger >::getSmallLetter ( ) const
inline

Returns the first letter of the main pattern.

Returns:
the small letter over which the DSS is written.
the small letter over which the DSS is written.

Definition at line 702 of file CombinatorialDSS.ih.

{
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::Point DGtal::CombinatorialDSS< TConstIterator, TInteger >::getUf ( ) const
inline

Accessor to the first upper leaning point Uses 'computeLeaningPoints' so prefer this latter one if more then one leaning point is computed.

Returns:
first upper leaning point.
first upper leaning point.

Definition at line 1040 of file CombinatorialDSS.ih.

{
Point uf, ul, lf, ll;
computeLeaningPoints( uf, ul, lf, ll );
return uf;
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::Point DGtal::CombinatorialDSS< TConstIterator, TInteger >::getUl ( ) const
inline

Accessor to the last upper leaning point Uses 'computeLeaningPoints' so prefer this latter one if more then one leaning point is computed.

Returns:
last upper leaning point.
last upper leaning point.

Definition at line 1054 of file CombinatorialDSS.ih.

{
Point uf, ul, lf, ll;
computeLeaningPoints( uf, ul, lf, ll );
return ul;
}
template<typename TConstIterator , typename TInteger >
void DGtal::CombinatorialDSS< TConstIterator, TInteger >::init ( const ConstIterator it,
const Point start = Point(0,0),
Vector(*)(Code displacements = defaultMoves 
)
inline

Initialize from input iterator. A DSS of length 1 is initialize from the iterator.

By default, displacements are defined as : '0' -> (1,0), '1' -> (0,1), '2' -> (-1,0), '3' -> (0,-1)

Parameters:
itFirstthe first code to include in the DSS. start the position where the DSS starts.
displacement,thefunction that defines displacement vectors from codes.

Definition at line 60 of file CombinatorialDSS.ih.

template<typename TConstIterator , typename TInteger >
void DGtal::CombinatorialDSS< TConstIterator, TInteger >::init ( const ConstPointIterator i)
inline

Initialize from a ConstPointIterator on a CombinatorialDSS.

Parameters:
ConstPointIterator

Definition at line 91 of file CombinatorialDSS.ih.

References DGtal::CombinatorialDSS< TConstIterator, TInteger >::ConstPointIterator::getDSS().

{
*this = *( i.getDSS() );
}
template<typename TConstIterator , typename TInteger >
void DGtal::CombinatorialDSS< TConstIterator, TInteger >::init ( const FreemanChainCode fc)
inline

Initialize from a Freman Chain code.

Note : to be used, this initialization method requires that the class is templated by string::const_iterator.

Parameters:
FreemanChainon which is defined the DSS.

Definition at line 100 of file CombinatorialDSS.ih.

References DGtal::FreemanChain< TInteger >::chain, and DGtal::FreemanChain< TInteger >::firstPoint().

{
init( fc.chain.begin(), fc.firstPoint(), FreemanChainCode::displacement );
}
template<typename TConstIterator , typename TInteger >
void DGtal::CombinatorialDSS< TConstIterator, TInteger >::init ( const typename FreemanChainCode::ConstIterator it)
inline

Initialize from a ConstIterator over a Freman Chain code.

Note : to be used, this initialization method requires that the class is templated by string::const_iterator.

Parameters:
ConstIteratorgiving the letter to initialize the DSS with.

Definition at line 109 of file CombinatorialDSS.ih.

References DGtal::FreemanChain< TInteger >::chain, DGtal::FreemanChain< TInteger >::ConstIterator::getChain(), and DGtal::FreemanChain< TInteger >::ConstIterator::getPosition().

{
std::string::const_iterator string_it = it.getChain()->chain.begin();
string_it += it.getPosition();
}
template<typename TConstIterator , typename TInteger >
bool DGtal::CombinatorialDSS< TConstIterator, TInteger >::isExtendableBackward ( )
inline

Tests whether the current DSS can be extended at the back.

Returns:
'true' if yes, 'false' otherwise.
'true' if yes, 'false' otherwise.

Definition at line 576 of file CombinatorialDSS.ih.

{
Code letterRead = getCode( myFirstLetter - 1);
Code letterExpected = getCode( myNextBefore );
if ( letterRead == letterExpected )
{
return true;
}
else if ( isTrivial() )
{
return true;
}
else if ( previousIsLL( myNextBefore ) && ( letterRead == getSmallLetter() ) )
{
return true;
}
else if ( isUL( myNextBefore ) && ( letterRead == getBigLetter() ) )
{
return true;
}
return false;
}
template<typename TConstIterator , typename TInteger >
bool DGtal::CombinatorialDSS< TConstIterator, TInteger >::isExtendableForward ( )
inline

Tests whether the current DSS can be extended at the front.

Returns:
'true' if yes, 'false' otherwise.
'true' if yes, 'false' otherwise.

Definition at line 546 of file CombinatorialDSS.ih.

{
Code letterRead = getCode( myLastLetter + 1 );
Code letterExpected = getCode( myNextAfter );
if ( letterRead == letterExpected )
{
return true;
}
else if ( isTrivial() )
{
return true;
}
else if ( nextIsLL( myNextAfter ) && ( letterRead == getBigLetter() ) )
{
return true;
}
else if ( isUL( myNextAfter ) && ( letterRead == getSmallLetter() ) )
{
return true;
}
return false;
}
template<typename TConstIterator , typename TInteger >
bool DGtal::CombinatorialDSS< TConstIterator, TInteger >::isTrivial ( ) const
inline

Test if the DSS is a trivial one, that is a DSS with slope 0 or infinite

Returns:
'true' is the DSS is trivial, 'false' otherwise.
'true' is the DSS is trivial, 'false' otherwise.

Definition at line 860 of file CombinatorialDSS.ih.

{
// If there is no left subpattern, then the DSS is trivial.
return ( myLeftPatternLength == 0 );
}
template<typename TConstIterator , typename TInteger >
bool DGtal::CombinatorialDSS< TConstIterator, TInteger >::isUL ( Index  pos) const
inline

Determines if a given position is a "upper leaning point". Note that it is assume that the orientation is such that the main pattern begins and ends on upper leaning points. NB: 'pos' must be between 'myPatternBegin' and 'myPatternEnd'

Parameters:
theposition of a letter in the main pattern of the DSS
Returns:
'true' if this letter is an "upper leaning point" 'false' otherwise.
Parameters:
theposition of a letter in the DSS
Returns:
'true' if this letter is an "upper leaning point" 'false' otherwise.

Definition at line 823 of file CombinatorialDSS.ih.

{
return ( (pos == myPatternBegin) || ( pos == myPatternEnd ) );
}
template<typename TConstIterator , typename TInteger >
bool DGtal::CombinatorialDSS< TConstIterator, TInteger >::isValid ( ) const
inline

Performs some basic tests to check the validity of the DSS. For debugging purpose only.

Returns:
'false' if the data is incoherent.
'false' if the data is incoherent.

Definition at line 625 of file CombinatorialDSS.ih.

template<typename TConstIterator, typename TInteger>
bool DGtal::CombinatorialDSS< TConstIterator, TInteger >::longestChristoffelPrefix ( ConstIterator  it,
const OrderedAlphabet aOA 
)

Initializes the DSS with the longest Christoffel word that is read starting from a given position on a FreemanCode. Only Christoffel words written on a given pair of letters are considered. More precisely, if the ordered alphabet is [a0, a1, a2, a3] then the Christoffel word must be written on the letter a1 < a2.

Note that by usually Christoffel words are defined as primitive words while here repetitions of a Christoffel word will be included in the DSS.

Computation time is O(k) where k is the number of points included in the DSS.

Parameters:
aFCa FreemanChain.
aOAthe ordered alphabet.
len(returns) the number of points inserted in the DSS which is exacly the length of the Christoffel word read (with repetitions).
sthe position from where the FreemanCode is read (default value = 0).
Returns:
'true' if the FreemanChain is coding a path that is possibly digitally convex, 'false' if the path is not digitally convex.
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::Size DGtal::CombinatorialDSS< TConstIterator, TInteger >::mainPatternLength ( ) const
inline

Computes the length of the main pattern.

Returns:
the length of the main pattern

Definition at line 764 of file CombinatorialDSS.ih.

{
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::Vector DGtal::CombinatorialDSS< TConstIterator, TInteger >::mainPatternVector ( ) const
inline

Computes the vector defined by the main pattern.

Returns:
the vector defined by the main pattern.

Definition at line 776 of file CombinatorialDSS.ih.

References DGtal::CombinatorialDSS< TConstIterator, TInteger >::ConstPointIterator::getIndex().

{
ConstPointIterator it = pointBegin();
while ( ! isUL ( it.getIndex() ) )
++it;
Point p_uf = *it;
++it; /* At least one letter in the pattern */
if ( ! isTrivial() )
{
while ( ! isUL ( it.getIndex() ) )
++it;
++it;
}
return *it - p_uf;
}
template<typename TConstIterator , typename TInteger >
bool DGtal::CombinatorialDSS< TConstIterator, TInteger >::nextIsLL ( Index  pos) const
inline

Determines if the letter at a given position leads a "lower leaning point". Note that it is assume that the orientation is such that the main pattern begins and ends on upper leaning points. NB: 'pos' must be between 'myPatternBegin' and 'myPatternEnd'

Parameters:
theposition of a letter in the main pattern of the DSS
Returns:
'true' if this letter leads to a "lower leaning point" 'false' otherwise.
Parameters:
theposition of a letter in the DSS
Returns:
'true' if this letter leads to a "lower leaning point" 'false' otherwise.

Definition at line 837 of file CombinatorialDSS.ih.

{
return ( (pos - myPatternBegin) == mainPatternLength() - myLeftPatternLength - 1) ;
}
template<typename TConstIterator , typename TInteger >
bool DGtal::CombinatorialDSS< TConstIterator, TInteger >::operator!= ( const Self other) const
inline

Difference operator.

Parameters:
otherthe object to compare with.
Returns:
'false' if equal 'true' otherwise
Parameters:
otherthe object to compare with.
Returns:
'false' if equal 'true' otherwise

Definition at line 193 of file CombinatorialDSS.ih.

{
return !(*this == other);
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger > & DGtal::CombinatorialDSS< TConstIterator, TInteger >::operator= ( const Self other)
inline

Assignment.

Parameters:
otherthe object to copy.
Returns:
a reference on 'this'.
Parameters:
otherthe object to copy.
Returns:
a reference on 'this'.

Definition at line 147 of file CombinatorialDSS.ih.

References DGtal::CombinatorialDSS< TConstIterator, TInteger >::myBegin, DGtal::CombinatorialDSS< TConstIterator, TInteger >::myCodeHandler, DGtal::CombinatorialDSS< TConstIterator, TInteger >::myDisplacements, DGtal::CombinatorialDSS< TConstIterator, TInteger >::myEnd, DGtal::CombinatorialDSS< TConstIterator, TInteger >::myFirstLetter, DGtal::CombinatorialDSS< TConstIterator, TInteger >::myFirstPoint, DGtal::CombinatorialDSS< TConstIterator, TInteger >::myLastLetter, DGtal::CombinatorialDSS< TConstIterator, TInteger >::myLastPoint, DGtal::CombinatorialDSS< TConstIterator, TInteger >::myLeftPatternLength, DGtal::CombinatorialDSS< TConstIterator, TInteger >::myNbRepeat, DGtal::CombinatorialDSS< TConstIterator, TInteger >::myNextAfter, DGtal::CombinatorialDSS< TConstIterator, TInteger >::myNextBefore, DGtal::CombinatorialDSS< TConstIterator, TInteger >::myPatternBegin, and DGtal::CombinatorialDSS< TConstIterator, TInteger >::myPatternEnd.

{
myCodeHandler = other.myCodeHandler;
myBegin = other.myBegin;
myEnd = other.myEnd;
myFirstPoint = other.myFirstPoint;
myLastPoint = other.myLastPoint;
myFirstLetter = other.myFirstLetter;
myLastLetter = other.myLastLetter;
myNbRepeat = other.myNbRepeat;
myPatternBegin = other.myPatternBegin ;
myPatternEnd = other.myPatternEnd;
myLeftPatternLength = other.myLeftPatternLength;
myNextBefore = other.myNextBefore;
myNextAfter = other.myNextAfter;
myDisplacements = other.myDisplacements;
return *this;
}
template<typename TConstIterator , typename TInteger >
bool DGtal::CombinatorialDSS< TConstIterator, TInteger >::operator== ( const Self other) const
inline

Equality operator.

Parameters:
otherthe object to compare with.
otherthe object to compare with.

Definition at line 180 of file CombinatorialDSS.ih.

References DGtal::CombinatorialDSS< TConstIterator, TInteger >::begin(), and DGtal::CombinatorialDSS< TConstIterator, TInteger >::end().

{
return ( ( begin() == other.begin() ) && ( end() == other.end() ) );
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::ConstPointIterator DGtal::CombinatorialDSS< TConstIterator, TInteger >::pointBegin ( ) const
inline

Accessor to the first added point to the DSS

Returns:
point.
an iterator pointing on the first point of the chain.

Definition at line 890 of file CombinatorialDSS.ih.

{
return ConstPointIterator( this, myFirstLetter, myFirstPoint );
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::ConstPointIterator DGtal::CombinatorialDSS< TConstIterator, TInteger >::pointEnd ( ) const
inline

Accessor to the last added point to the DSS

Returns:
point.
an iterator pointing on the last point of the chain.

Definition at line 902 of file CombinatorialDSS.ih.

{
ConstPointIterator it ( this, myLastLetter+1, myLastPoint );
return ++it;
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::Size DGtal::CombinatorialDSS< TConstIterator, TInteger >::prefixLength ( ) const
inline

Computes the length of the prefix of the main pattern read after it.

Returns:
the length of the prefix read.
the length of the prefix read.

Definition at line 811 of file CombinatorialDSS.ih.

{
}
template<typename TConstIterator , typename TInteger >
bool DGtal::CombinatorialDSS< TConstIterator, TInteger >::previousIsLL ( Index  pos) const
inline

Determines if the letter at a given position comes from a "lower leaning point". Note that it is assume that the orientation is such that the main pattern begins and ends on upper leaning points. NB: 'pos' must be between 'myPatternBegin' and 'myPatternEnd'

Parameters:
theposition of a letter in the main pattern of the DSS
Returns:
'true' if this letter comes from a "lower leaning point" 'false' otherwise.
Parameters:
theposition of a letter in the DSS
Returns:
'true' if this letter comes from a "lower leaning point" 'false' otherwise.

Definition at line 849 of file CombinatorialDSS.ih.

{
}
template<typename TConstIterator , typename TInteger >
bool DGtal::CombinatorialDSS< TConstIterator, TInteger >::retractBackward ( )
inline

Removes the last point of the DSS (at front). NB : Unlike the ArithmeticalDSS, a CombinatorialDSS must containt at least two points since it is defined by a letter in a Freeman Chain code.

Returns:
'true' if the last point is removed, 'false' otherwise.
'true' if the last point is removed, 'false' otherwise.

Definition at line 464 of file CombinatorialDSS.ih.

{
// Normal case
//cout << "Case 1" << endl;
} else if ( isTrivial() ) {
// In this case, it can be shorten only if there is more than one
// repetition.
//cout << "Case 2" << endl;
if ( myNbRepeat == 1 ) return false;
} else if ( myNbRepeat >= 2 ) {
// Got more than one repetition, it suffices to consider the next
// repetition of the main pattern with one less repetition.
//cout << "Case 3" << endl;
} else {
//Only one repetition, the slope is modified.
Size myOldMainPatternLength = mainPatternLength();
Size myOldLeftPatternLength = myLeftPatternLength;
Size myOldRightPatternLength = myOldMainPatternLength -
myOldLeftPatternLength;
if ( suffixLength() >= myOldLeftPatternLength ) {
// A second Lower Leaning Point has been read in the suffix at
// the front of the main pattern. The slope is simply reversed.
//cout << "Case 4" << endl;
myLeftPatternLength = myOldRightPatternLength;
myPatternBegin -= myOldLeftPatternLength;
myPatternEnd -= myOldLeftPatternLength;
myNextAfter = myPatternBegin + myOldLeftPatternLength - 1;
} else if ( myOldLeftPatternLength > myOldRightPatternLength ) {
// Remove one repetition of the right Berstel pattern.
//cout << "Case 5" << endl;
myPatternEnd -= myOldRightPatternLength;
myNextAfter += ( myOldRightPatternLength - 1 );
myNextBefore -= myOldRightPatternLength;
myLeftPatternLength -= myOldRightPatternLength;
} else if ( myOldLeftPatternLength < myOldRightPatternLength ) {
// The complexity of the slope is modified.
//cout << "Case 6" << endl;
Size myNbBerstelLeft = (myOldLeftPatternLength > 1) ?
myOldMainPatternLength / myOldLeftPatternLength :
myOldMainPatternLength - 1;
Size myBerstelRightLength = myOldMainPatternLength -
( myNbBerstelLeft * myOldLeftPatternLength );
Size myOldSuffixLength = suffixLength();
// Left subpattern becomes the main pattern.
myNbRepeat = myNbBerstelLeft;
myLeftPatternLength = myOldLeftPatternLength - myBerstelRightLength;
myPatternEnd = myPatternBegin + myOldLeftPatternLength - 1;
myNextBefore = myPatternEnd - myOldSuffixLength;
myNextAfter = myPatternBegin + myBerstelRightLength - 1;
} else {
// Special case of slope 1/1 with no prefix read, only a trivial
// DSS remains.
//cout << "Case 7" << endl;
}
}
--myEnd;
return true;
}
template<typename TConstIterator , typename TInteger >
bool DGtal::CombinatorialDSS< TConstIterator, TInteger >::retractForward ( )
inline

Removes the first point of the DSS (at back). NB : Unlike the ArithmeticalDSS, a CombinatorialDSS must containt at least two points since it is defined by a letter in a Freeman Chain code.

Returns:
'true' if the first point is removed, 'false' otherwise.
'true' if the first point is removed, 'false' otherwise.

Definition at line 377 of file CombinatorialDSS.ih.

{
//Normal case
//cout << "Case 1" << endl;
} else if ( isTrivial() ) {
// In this case, it can be shorten only if there is more than one
// repetition.
//cout << "Case 2" << endl;
if ( myNbRepeat == 1 ) return false;
} else if ( myNbRepeat >= 2 ) {
// Got more than one repetition, it suffices to consider the next
// repetition of the main pattern with one less repetition.
//cout << "Case 3" << endl;
Size myOldMainPatternLength = mainPatternLength();
myPatternBegin += myOldMainPatternLength;
myPatternEnd += myOldMainPatternLength;
myNextAfter += myOldMainPatternLength;
} else {
//Only one repetition, the slope is modified.
Size myOldMainPatternLength = mainPatternLength();
Size myOldLeftPatternLength = myLeftPatternLength;
Size myOldRightPatternLength = myOldMainPatternLength - myOldLeftPatternLength;
if ( prefixLength() >= myOldRightPatternLength ) {
// A second Lower Leaning Point has been read in the prefix at
// the end of the main pattern. The slope is simply reversed.
//cout << "Case 4" << endl;
myLeftPatternLength = myOldRightPatternLength;
myPatternBegin += myOldRightPatternLength;
myPatternEnd += myOldRightPatternLength;
myNextBefore = myPatternEnd - myOldRightPatternLength + 1;
} else if ( myOldLeftPatternLength < myOldRightPatternLength ) {
// Remove one repetition of the left Berstel pattern.
//cout << "Case 5" << endl;
myPatternBegin += myOldLeftPatternLength;
myNextBefore -= ( myOldLeftPatternLength - 1 );
myNextAfter += myOldLeftPatternLength;
} else if ( myOldLeftPatternLength > myOldRightPatternLength ) {
// The complexity of the slope is modified.
//cout << "Case 6" << endl;
Size myNbBerstelRight = (myOldRightPatternLength > 1) ?
myOldMainPatternLength / myOldRightPatternLength :
myOldMainPatternLength - 1;
Size myBerstelLeftLength = myOldMainPatternLength -
( myNbBerstelRight * myOldRightPatternLength );
// Right subpattern becomes the main pattern
myNbRepeat = myNbBerstelRight;
myPatternBegin += myBerstelLeftLength;
myPatternEnd = myPatternBegin + myOldRightPatternLength - 1;
myNextBefore = myPatternEnd - myBerstelLeftLength + 1;
myNextAfter += myBerstelLeftLength;
0 : myBerstelLeftLength;
} else {
// Special case of slope 1/1 with no prefix read, only a trivial
// DSS remains.
//cout << "Case 7" << endl;
}
}
return true;
}
template<typename TConstIterator , typename TInteger >
void DGtal::CombinatorialDSS< TConstIterator, TInteger >::selfDisplay ( std::ostream &  out) const
inline

Writes/Displays the object on an output stream.

Parameters:
outthe output stream where the object is written.

Definition at line 650 of file CombinatorialDSS.ih.

{
std::string s;
for (int i=myFirstLetter; i<= myLastLetter; i++)
s += getCode( i );
s += ".";
for (int i=myLastLetter+1; i<myLastLetter+4 ; i++)
s += getCode( i );
Integer a,b,mu,omega;
out << "[CombinatorialDSS]\n";
out << "myCodes = " << s << "\n";
out << "myFirstPoint = " << myFirstPoint << "\n";
out << "myLastPoint = " << myLastPoint << "\n";
out << "myFirstLetter = " << myFirstLetter << "\n";
out << "myLastLetter = " << myLastLetter << "\n";
out << "myNbRepeat = " << myNbRepeat << "\n";
out << "myPatternBegin = " << myPatternBegin << "\n";
out << "myPatternEnd = " << myPatternEnd << "\n";
out << "myLeftPatternLength = " << myLeftPatternLength << "\n";
out << "myNextBefore = " << myNextBefore << "\n";
out << "myNextAfter = " << myNextAfter << "\n";
out << "(a,b,mu,omega) = (" << a << ", " << b << ", " << mu << ", " <<
omega << ")\n";
out << "[End CombinatorialDSS]" << endl;
}
template<typename TConstIterator, typename TInteger>
void DGtal::CombinatorialDSS< TConstIterator, TInteger >::setPosition ( const Point p)
inline

Set the position of the first point of the DSS.

Parameters:
pthe point where the DSS starts;

Definition at line 601 of file CombinatorialDSS.ih.

{
Vector v = myLastPoint - myFirstPoint;
myFirstPoint = p;
myLastPoint = p+v;
}
template<typename TConstIterator , typename TInteger >
DGtal::CombinatorialDSS< TConstIterator, TInteger >::Size DGtal::CombinatorialDSS< TConstIterator, TInteger >::suffixLength ( ) const
inline

Computes the length of the suffix of the main pattern read before it.

Returns:
the length of the suffix read.
the length of the suffix read.

Definition at line 799 of file CombinatorialDSS.ih.

{
return ( myPatternEnd - myNextBefore );
}
template<typename TConstIterator, typename TInteger>
void DGtal::CombinatorialDSS< TConstIterator, TInteger >::translate ( const Vector v)
inline

Translates the DSS's position by a given vector.

Parameters:
vthe translation vector.

Definition at line 612 of file CombinatorialDSS.ih.

{
}

Field Documentation

template<typename TConstIterator, typename TInteger>
ConstIterator DGtal::CombinatorialDSS< TConstIterator, TInteger >::myBegin
protected

Iterators on the input codes.

Definition at line 756 of file CombinatorialDSS.h.

Referenced by DGtal::CombinatorialDSS< TConstIterator, TInteger >::operator=().

template<typename TConstIterator, typename TInteger>
CodeHandler<ConstIterator> DGtal::CombinatorialDSS< TConstIterator, TInteger >::myCodeHandler
protected

longer used Freeman chain on which is defined the CombinatarialDSS The array of char on which is defined the CombinatorialDSS

Definition at line 751 of file CombinatorialDSS.h.

Referenced by DGtal::CombinatorialDSS< TConstIterator, TInteger >::operator=().

template<typename TConstIterator, typename TInteger>
Vector(* DGtal::CombinatorialDSS< TConstIterator, TInteger >::myDisplacements)(Code)
protected

Function that converts the codes of a FreemanChain into a elementary translations.

Definition at line 805 of file CombinatorialDSS.h.

Referenced by DGtal::CombinatorialDSS< TConstIterator, TInteger >::ConstPointIterator::next(), DGtal::CombinatorialDSS< TConstIterator, TInteger >::operator=(), and DGtal::CombinatorialDSS< TConstIterator, TInteger >::ConstPointIterator::prev().

template<typename TConstIterator, typename TInteger>
ConstIterator DGtal::CombinatorialDSS< TConstIterator, TInteger >::myEnd
protected

Definition at line 757 of file CombinatorialDSS.h.

Referenced by DGtal::CombinatorialDSS< TConstIterator, TInteger >::operator=().

template<typename TConstIterator, typename TInteger>
Index DGtal::CombinatorialDSS< TConstIterator, TInteger >::myFirstLetter
protected

Index of the first letter of DSS in the FreemanChain

Definition at line 769 of file CombinatorialDSS.h.

Referenced by DGtal::CombinatorialDSS< TConstIterator, TInteger >::operator=().

template<typename TConstIterator, typename TInteger>
Point DGtal::CombinatorialDSS< TConstIterator, TInteger >::myFirstPoint
protected

In order to keep track of the DSS position, first and last points are memorized.

Definition at line 763 of file CombinatorialDSS.h.

Referenced by DGtal::CombinatorialDSS< TConstIterator, TInteger >::operator=().

template<typename TConstIterator, typename TInteger>
Index DGtal::CombinatorialDSS< TConstIterator, TInteger >::myLastLetter
protected

Definition at line 770 of file CombinatorialDSS.h.

Referenced by DGtal::CombinatorialDSS< TConstIterator, TInteger >::operator=().

template<typename TConstIterator, typename TInteger>
Point DGtal::CombinatorialDSS< TConstIterator, TInteger >::myLastPoint
protected

Definition at line 764 of file CombinatorialDSS.h.

Referenced by DGtal::CombinatorialDSS< TConstIterator, TInteger >::operator=().

template<typename TConstIterator, typename TInteger>
Size DGtal::CombinatorialDSS< TConstIterator, TInteger >::myLeftPatternLength
protected

The main pattern factorizes as two subpatterns: a left one and a right one.

Definition at line 791 of file CombinatorialDSS.h.

Referenced by DGtal::CombinatorialDSS< TConstIterator, TInteger >::operator=().

template<typename TConstIterator, typename TInteger>
unsigned int DGtal::CombinatorialDSS< TConstIterator, TInteger >::myNbRepeat
protected

Number of repetitions of the central Christoffel word, otherwise said, the number of upper leaning points minus 1.

Definition at line 778 of file CombinatorialDSS.h.

Referenced by DGtal::CombinatorialDSS< TConstIterator, TInteger >::operator=().

template<typename TConstIterator, typename TInteger>
Index DGtal::CombinatorialDSS< TConstIterator, TInteger >::myNextAfter
protected

Definition at line 799 of file CombinatorialDSS.h.

Referenced by DGtal::CombinatorialDSS< TConstIterator, TInteger >::operator=().

template<typename TConstIterator, typename TInteger>
Index DGtal::CombinatorialDSS< TConstIterator, TInteger >::myNextBefore
protected

In order to add/remove letters efficiently from the prefix and the suffix of the main pattern being read, the position of the next letter to read is memorized.

Definition at line 798 of file CombinatorialDSS.h.

Referenced by DGtal::CombinatorialDSS< TConstIterator, TInteger >::operator=().

template<typename TConstIterator, typename TInteger>
Index DGtal::CombinatorialDSS< TConstIterator, TInteger >::myPatternBegin
protected

Indexes indicates where, in the FreemanChain, is located the main pattern of this DSS.

Definition at line 784 of file CombinatorialDSS.h.

Referenced by DGtal::CombinatorialDSS< TConstIterator, TInteger >::operator=().

template<typename TConstIterator, typename TInteger>
Index DGtal::CombinatorialDSS< TConstIterator, TInteger >::myPatternEnd
protected

Definition at line 785 of file CombinatorialDSS.h.

Referenced by DGtal::CombinatorialDSS< TConstIterator, TInteger >::operator=().


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