DGtal  0.9.3beta
StandardDSS6Computer.h
1 
17 #pragma once
18 
36 #if defined(StandardDSS6Computer_RECURSES)
37 #error Recursive header files inclusion detected in StandardDSS6Computer.h
38 #else // defined(StandardDSS6Computer_RECURSES)
39 
40 #define StandardDSS6Computer_RECURSES
41 
42 #if !defined StandardDSS6Computer_h
43 
44 #define StandardDSS6Computer_h
45 
47 // Inclusions
48 #include <iostream>
49 #include <list>
50 #include <utility>
51 #include <boost/array.hpp>
52 #include "DGtal/base/Exceptions.h"
53 #include "DGtal/base/Common.h"
54 #include "DGtal/kernel/PointVector.h"
55 #include "DGtal/kernel/CInteger.h"
56 #include "DGtal/geometry/curves/ArithmeticalDSSComputer.h"
57 #include "DGtal/base/ConstIteratorAdapter.h"
58 #include "DGtal/kernel/BasicPointFunctors.h"
59 
61 
62 
63 namespace DGtal
64 {
65 
66 
68  // class StandardDSS6Computer
75  template <typename TIterator, typename TInteger, int connectivity>
77  {
79 
80  // ----------------------- Types ------------------------------
81  public:
83  typedef TInteger Integer;
85  typedef std::pair <Integer, Integer> Quotient;
87  typedef TIterator ConstIterator;
97  typedef typename Point3d::Coordinate Coordinate;
101  typedef boost::array< Quotient, 3 > PointR3d;
108 
109  // ----------------------- Standard services ------------------------------
110  public:
111 
112 
118 
124  StandardDSS6Computer(const ConstIterator& it);
125 
130  void init(const ConstIterator& it);
131 
132 
137  StandardDSS6Computer ( const StandardDSS6Computer & other );
138 
145 
149  Self getSelf() const;
150 
154  Reverse getReverse() const;
155 
156 
157 
166  bool operator==( const StandardDSS6Computer & other ) const;
167 
174  bool operator!=( const StandardDSS6Computer & other ) const;
175 
180 
181  // ----------------------- Interface --------------------------------------
182  public:
183 
184 
191  bool extendFront();
192 
193 
199  bool isExtendableFront();
200 
201  // ------------------------- Accessors ------------------------------
202 
211  void getParameters ( Vector3d& direction, PointR3d& intercept, PointR3d& thickness ) const;
212 
217  bool isValid() const;
218 
219 
224  ConstIterator begin() const;
228  ConstIterator end() const;
229 
234  const ArithmeticalDSSComputer2d & arithmeticalDSS2dXY() const;
235 
240  const ArithmeticalDSSComputer2d & arithmeticalDSS2dXZ() const;
241 
246  const ArithmeticalDSSComputer2d & arithmeticalDSS2dYZ() const;
247 
253  const ArithmeticalDSSComputer2d & arithmeticalDSS2d( Dimension i ) const;
254 
255 
256  // ------------------ Display ------------------------------------------
257 
258  public:
259 
263  std::string className() const;
264 
269  void selfDisplay ( std::ostream & out ) const;
270 
271  // ------------------------- Protected Datas ------------------------------
272  protected:
273 
275  Projector2d myProjXY, myProjXZ, myProjYZ;
276 
278  ArithmeticalDSSComputer2d myXYalgo;
279  ArithmeticalDSSComputer2d myXZalgo;
280  ArithmeticalDSSComputer2d myYZalgo;
281 
283  ConstIterator myBegin, myEnd;
284 
285 
286  // ------------------------- Private Datas --------------------------------
287 
288  private:
289 
290 
291  }; // end of class StandardDSS6Computer
292 
293 
294 
301  template <typename TIterator, typename TInteger, int connectivity>
302  std::ostream&
303  operator<< ( std::ostream & out, const StandardDSS6Computer<TIterator,TInteger,connectivity> & object )
304  {
305  object.selfDisplay( out);
306  return out;
307  }
308 
309 
310 } // namespace DGtal
311 
312 
313 
315 // Includes inline functions/methods.
316 #include "DGtal/geometry/curves/StandardDSS6Computer.ih"
317 
318 // //
320 
321 #endif // !defined StandardDSS6Computer_h
322 
323 #undef StandardDSS6Computer_RECURSES
324 #endif // else defined(StandardDSS6Computer_RECURSES)
Point3d::Coordinate Coordinate
Type of 3d digital point coordinate.
This class adapts any iterator so that operator* returns another element than the one pointed to by t...
void selfDisplay(std::ostream &out) const
Aim: Dynamic recognition of a 3d-digital straight segment (DSS)
std::string className() const
DGtal::uint32_t Dimension
Definition: Common.h:120
ConstIterator end() const
const ArithmeticalDSSComputer2d & arithmeticalDSS2dXY() const
const ArithmeticalDSSComputer2d & arithmeticalDSS2dXZ() const
Aim: Functor that maps a point P of dimension i to a point Q of dimension j. The member myDims is an ...
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:141
StandardDSS6Computer & operator=(const StandardDSS6Computer &other)
ConstIteratorAdapter< ConstIterator, Projector2d, Point2d > IteratorAdapter
Iterator over adapter.
DGtal::PointVector< 2, Coordinate > Point2d
Type of 2d digital point.
bool operator!=(const StandardDSS6Computer &other) const
ConstIterator myBegin
begin and end iterators
Aim: Concept checking for Integer Numbers. More precisely, this concept is a refinement of both CEucl...
Definition: CInteger.h:87
bool operator==(const StandardDSS6Computer &other) const
std::pair< Integer, Integer > Quotient
Type which represent quotient of two integers first/second.
void getParameters(Vector3d &direction, PointR3d &intercept, PointR3d &thickness) const
DGtal::ArithmeticalDSSComputer< IteratorAdapter, TInteger, connectivity > ArithmeticalDSSComputer2d
2D arithmetical DSS recognition algorithm
Reverse getReverse() const
IteratorCirculatorTraits< ConstIterator >::Value Vector3d
Type of 3d digital vector.
TInteger Integer
Type of integer, devoted to remainders (and intercepts)
StandardDSS6Computer< ReverseIterator< ConstIterator >, TInteger, connectivity > Reverse
Reverse type.
DGtal is the top-level namespace which contains all DGtal functions and types.
ArithmeticalDSSComputer2d myXZalgo
functors::Projector< SpaceND< 2, Coordinate > > Projector2d
Adapter for iterators.
const ArithmeticalDSSComputer2d & arithmeticalDSS2dYZ() const
ArithmeticalDSSComputer2d myYZalgo
void init(const ConstIterator &it)
StandardDSS6Computer< ConstIterator, TInteger, connectivity > Self
Self type.
ArithmeticalDSSComputer2d myXYalgo
2d-arithmeticalDSS recognition algorithms
Projector2d myProjXY
projectors
BOOST_CONCEPT_ASSERT((concepts::CInteger< TInteger >))
boost::array< Quotient, 3 > PointR3d
Type of 3d rational point.
ConstIterator begin() const
IteratorCirculatorTraits< ConstIterator >::Value Point3d
Type of 3d digital point.
const ArithmeticalDSSComputer2d & arithmeticalDSS2d(Dimension i) const
TIterator ConstIterator
Type of iterator, at least readable and forward.