DGtal  0.9.2
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)
34 
35 #define ArithmeticalDSSFactory_RECURSES
36 
37 #if !defined ArithmeticalDSSFactory_h
38 
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;
80  typedef Coordinate Position;
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)
ArithmeticalDSL< TCoordinate, TInteger, adjacency > DSL
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...
std::pair< Vector, Vector > Steps
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:141
DGtal::PointVector< 2, Coordinate > Point
static DSS createSubsegment(const DSL &aDSL, const Point &aF, const Point &aL)
static DSS createLeftSubsegment(const DSS &aDSS, const Point &aL)
ArithmeticalDSS< TCoordinate, TInteger, adjacency > DSS
Aim: Set of static methods that create digital straight segments (DSS) from some input parameters...
Aim: This class represents a naive (resp. standard) digital straight segment (DSS), ie. the sequence of simply 8- (resp. 4-)connected digital points contained in a naive (resp. standard) digital straight line (DSL) between two points of it.
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: This class represents a naive (resp. standard) digital straight line (DSL), ie. the set of digital points such that with , and (resp. ). Note that any DSL such that (resp. ) is simply 8-connected (resp. 4-connected).
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 Vector bezoutVector(const Coordinate &aA, const Coordinate &aB, const Coordinate &aR)
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...