DGtal  1.4.beta
DGtal::ArithmeticalDSSFactory< TCoordinate, TInteger, adjacency > Class Template Reference

Aim: Set of static methods that create digital straight segments (DSS) from some input parameters, eg. patterns (or reversed patterns) from two upper leaning points (or lower leaning points). More...

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

## Public Types

typedef TCoordinate Coordinate

typedef Coordinate Position

typedef TInteger Integer

typedef DGtal::PointVector< 2, CoordinatePoint

typedef Point Vector

typedef std::pair< Vector, VectorSteps

typedef ArithmeticalDSS< TCoordinate, TInteger, adjacency > DSS

typedef ArithmeticalDSL< TCoordinate, TInteger, adjacency > DSL

## Static Public Member Functions

static DSS createSubsegment (const DSL &aDSL, const Point &aF, const Point &aL)

static DSS createSubsegment (const DSS &aDSS, const Point &aF, const Point &aL)

static DSS createPattern (const Point &aF, const Point &aL)
Method that creates a DSS that is a pattern or a repetition of a pattern from two input digital points, viewed as upper leaning points. More...

static DSS createReversedPattern (const Point &aF, const Point &aL)
Method that creates a DSS that is a reversed pattern or a repetition of a reversed pattern from two input digital points, viewed as lower leaning points. Creates the pattern from aL to aF and negates the result. More...

static DSS createDSS (const Coordinate &aA, const Coordinate &aB, const Point &aF, const Point &aL, const Point &aU)
Method that creates a DSS from a direction vector, a first and last point and one upper leaning point. More...

## Static Private Member Functions

static DSS createLeftSubsegment (const DSS &aDSS, const Point &aL)

static Vector bezoutVector (const Coordinate &aA, const Coordinate &aB, const Coordinate &aR)

## Detailed Description

### template<typename TCoordinate, typename TInteger = TCoordinate, unsigned short adjacency = 8> class DGtal::ArithmeticalDSSFactory< TCoordinate, TInteger, adjacency >

Aim: Set of static methods that create digital straight segments (DSS) from some input parameters, eg. patterns (or reversed patterns) from two upper leaning points (or lower leaning points).

Description of template class 'ArithmeticalDSSFactory'

Template Parameters
 TCoordinate a model of integer for the DGtal point coordinate TInteger a model of integer for the DSS parameters (a, b, mu, omega) adjacency a integer equal to 8 (default) for naive and 8-connected DSS, and 4 for standard and 4-connected DSS.

Definition at line 73 of file ArithmeticalDSSFactory.h.

## ◆ Coordinate

template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
 typedef TCoordinate DGtal::ArithmeticalDSSFactory< TCoordinate, TInteger, adjacency >::Coordinate

Definition at line 79 of file ArithmeticalDSSFactory.h.

## ◆ DSL

template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
 typedef ArithmeticalDSL DGtal::ArithmeticalDSSFactory< TCoordinate, TInteger, adjacency >::DSL

Definition at line 87 of file ArithmeticalDSSFactory.h.

## ◆ DSS

template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
 typedef ArithmeticalDSS DGtal::ArithmeticalDSSFactory< TCoordinate, TInteger, adjacency >::DSS

Definition at line 86 of file ArithmeticalDSSFactory.h.

## ◆ Integer

template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
 typedef TInteger DGtal::ArithmeticalDSSFactory< TCoordinate, TInteger, adjacency >::Integer

Definition at line 81 of file ArithmeticalDSSFactory.h.

## ◆ Point

template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
 typedef DGtal::PointVector<2, Coordinate> DGtal::ArithmeticalDSSFactory< TCoordinate, TInteger, adjacency >::Point

Definition at line 82 of file ArithmeticalDSSFactory.h.

## ◆ Position

template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
 typedef Coordinate DGtal::ArithmeticalDSSFactory< TCoordinate, TInteger, adjacency >::Position

Definition at line 80 of file ArithmeticalDSSFactory.h.

## ◆ Steps

template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
 typedef std::pair DGtal::ArithmeticalDSSFactory< TCoordinate, TInteger, adjacency >::Steps

Definition at line 84 of file ArithmeticalDSSFactory.h.

## ◆ Vector

template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
 typedef Point DGtal::ArithmeticalDSSFactory< TCoordinate, TInteger, adjacency >::Vector

Definition at line 83 of file ArithmeticalDSSFactory.h.

## ◆ bezoutVector()

template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
 static Vector DGtal::ArithmeticalDSSFactory< TCoordinate, TInteger, adjacency >::bezoutVector ( const Coordinate & aA, const Coordinate & aB, const Coordinate & aR )
staticprivate

Returns the bezout vector (u,v) of a given direction vector of slope aA / aB such that u and aB (resp. v and aA) have the same sign.

Returns
bezout vector
Parameters
 aA y-component of the direction vector aB x-component of the dirention vector aR a remainder equal to either 1 or -1
createPattern

NB: this method uses the extended Euclid's algorithm and runs in logarithmic time.

## ◆ createDSS()

template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
 static DSS DGtal::ArithmeticalDSSFactory< TCoordinate, TInteger, adjacency >::createDSS ( const Coordinate & aA, const Coordinate & aB, const Point & aF, const Point & aL, const Point & aU )
static

Method that creates a DSS from a direction vector, a first and last point and one upper leaning point.

Parameters
 aA y-component of the direction vector aB x-component of the direction vector aF first input digital point aL second input digital point aU upper leaning point
Returns
a DSS

NB: logarithmic-time in the max of the greatest component of the vector starting from aU and pointing to aL and the greatest component of the vector starting from aF and pointing to aU.

## ◆ createLeftSubsegment()

template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
 static DSS DGtal::ArithmeticalDSSFactory< TCoordinate, TInteger, adjacency >::createLeftSubsegment ( const DSS & aDSS, const Point & aL )
staticprivate

Construction of the left subsegment of minimal parameters of a greater DSS. It is bound by the first point of aDSS on the left and by aL on the right.

Parameters
 aDSS bounding DSS aL last point of the subsegment

NB: logarithmic-time in the greatest component of the direction vector of the subsegment. Uses reversedSmartCH algorithm [Roussillon 2014 : ].

## ◆ createPattern()

template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
 static DSS DGtal::ArithmeticalDSSFactory< TCoordinate, TInteger, adjacency >::createPattern ( const Point & aF, const Point & aL )
static

Method that creates a DSS that is a pattern or a repetition of a pattern from two input digital points, viewed as upper leaning points.

Parameters
 aF first input digital point aL second input digital point

NB: logarithmic-time in the greatest component of the vector starting from aF and pointing to aL

## ◆ createReversedPattern()

template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
 static DSS DGtal::ArithmeticalDSSFactory< TCoordinate, TInteger, adjacency >::createReversedPattern ( const Point & aF, const Point & aL )
static

Method that creates a DSS that is a reversed pattern or a repetition of a reversed pattern from two input digital points, viewed as lower leaning points. Creates the pattern from aL to aF and negates the result.

createPattern
Parameters
 aF first input digital point aL second input digital point

NB: logarithmic-time in the greatest component of the vector starting from aF and pointing to aL

## ◆ createSubsegment() [1/2]

template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
 static DSS DGtal::ArithmeticalDSSFactory< TCoordinate, TInteger, adjacency >::createSubsegment ( const DSL & aDSL, const Point & aF, const Point & aL )
static

Construction of the subsegment of minimal parameters of a given DSL.

Parameters
 aDSL bounding DSL aF first point of the subsegment aL last point of the subsegment

NB: logarithmic-time in the greatest component of the direction vector of the subsegment. Uses smartCH algorithm [Roussillon 2014 : ].

## ◆ createSubsegment() [2/2]

template<typename TCoordinate , typename TInteger = TCoordinate, unsigned short adjacency = 8>
 static DSS DGtal::ArithmeticalDSSFactory< TCoordinate, TInteger, adjacency >::createSubsegment ( const DSS & aDSS, const Point & aF, const Point & aL )
static

Construction of the subsegment of minimal parameters of a greater DSS.

Parameters
 aDSS bounding DSS aF first point of the subsegment aL last point of the subsegment

NB: logarithmic-time in the greatest component of the direction vector of the subsegment. Uses reversedSmartCH algorithm [Roussillon 2014 : ].