DGtal  1.2.0
ArithmeticalDSSFactory.h
1 
17 #pragma once
18 
31 #if defined(ArithmeticalDSSFactory_RECURSES)
32 #error Recursive header files inclusion detected in ArithmeticalDSSFactory.h
33 #else // defined(ArithmeticalDSSFactory_RECURSES)
35 #define ArithmeticalDSSFactory_RECURSES
36 
37 #if !defined ArithmeticalDSSFactory_h
39 #define ArithmeticalDSSFactory_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/geometry/curves/ArithmeticalDSL.h"
47 
48 namespace DGtal
49 {
50 
51  //forward declaration of ArithmeticalDSS
52  template <typename TCoordinate,
53  typename TInteger,
54  unsigned short adjacency>
55  class ArithmeticalDSS;
56 
58  // template class ArithmeticalDSSFactory
70  template <typename TCoordinate,
71  typename TInteger = TCoordinate,
72  unsigned short adjacency = 8>
74  {
75 
76  // ----------------------- Inner types -----------------------------------
77  public:
78 
79  typedef TCoordinate Coordinate;
81  typedef TInteger Integer;
83  typedef Point Vector;
84  typedef std::pair<Vector,Vector> Steps;
85 
88 
89  // ----------------------- Creation methods ------------------------------
90 
91  public:
92 
103  static DSS createSubsegment(const DSL& aDSL, const Point& aF, const Point& aL);
104 
117  static DSS createSubsegment(const DSS& aDSS, const Point& aF, const Point& aL);
118 
129  static DSS createPattern(const Point& aF, const Point& aL);
130 
145  static DSS createReversedPattern(const Point& aF, const Point& aL);
146 
163  static DSS createDSS(const Coordinate& aA, const Coordinate& aB, const Point& aF, const Point& aL, const Point& aU);
164 
165 
166 
167  // ----------------------- Internals -------------------------------------
168  private:
169 
180  static DSS createLeftSubsegment(const DSS& aDSS, const Point& aL);
181 
197  static Vector bezoutVector(const Coordinate& aA,
198  const Coordinate& aB,
199  const Coordinate& aR);
200 
201 
202  }; // end of class ArithmeticalDSSFactory
203 
204 
205 
206 } // namespace DGtal
207 
208 
210 // Includes inline functions.
211 #include "DGtal/geometry/curves/ArithmeticalDSSFactory.ih"
212 
213 // //
215 
216 #endif // !defined ArithmeticalDSSFactory_h
217 
218 #undef ArithmeticalDSSFactory_RECURSES
219 #endif // else defined(ArithmeticalDSSFactory_RECURSES)
Aim: This class represents a naive (resp. standard) digital straight line (DSL), ie....
Aim: Set of static methods that create digital straight segments (DSS) from some input parameters,...
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...
static DSS createSubsegment(const DSL &aDSL, const Point &aF, const Point &aL)
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 i...
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 point...
ArithmeticalDSS< TCoordinate, TInteger, adjacency > DSS
ArithmeticalDSL< TCoordinate, TInteger, adjacency > DSL
DGtal::PointVector< 2, Coordinate > Point
static Vector bezoutVector(const Coordinate &aA, const Coordinate &aB, const Coordinate &aR)
static DSS createLeftSubsegment(const DSS &aDSS, const Point &aL)
std::pair< Vector, Vector > Steps
static DSS createSubsegment(const DSS &aDSS, const Point &aF, const Point &aL)
Aim: This class represents a naive (resp. standard) digital straight segment (DSS),...
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:593
DGtal is the top-level namespace which contains all DGtal functions and types.