DGtal  1.1.0
Naive3DDSSComputer.h
1 
17 #pragma once
18 
31 #if defined(Naive3DDSSComputer_RECURSES)
32 #error Recursive header files inclusion detected in Naive3DDSSComputer.h
33 #else // defined(Naive3DDSSComputer_RECURSES)
34 
35 #define Naive3DDSSComputer_RECURSES
36 
37 #if !defined Naive3DDSSComputer_h
38 
39 #define Naive3DDSSComputer_h
40 
42 // Inclusions
43 #include <iostream>
44 #include <list>
45 #include <utility>
46 #include <array>
47 #include "DGtal/base/Exceptions.h"
48 #include "DGtal/base/Common.h"
49 #include "DGtal/kernel/PointVector.h"
50 #include "DGtal/kernel/CInteger.h"
51 #include "DGtal/geometry/curves/ArithmeticalDSSComputer.h"
52 #include "DGtal/base/ConstIteratorAdapter.h"
53 #include "DGtal/kernel/BasicPointFunctors.h"
55 
56 namespace DGtal
57 {
58 
60 // class Naive3DDSSComputer
68 // class Naive3DDSSComputer
96 template <typename TIterator, typename TInteger, int connectivity = 8>
98 {
100  // ----------------------- Types ------------------------------
101  public:
103  typedef TInteger Integer;
105  typedef std::pair <Integer, Integer> Quotient;
107  typedef TIterator ConstIterator;
117  typedef typename Point3d::Coordinate Coordinate;
121  typedef std::array< Quotient, 3 > PointR3d;
128 
129  // ----------------------- Standard services ------------------------------
130  public:
131 
132 
138 
145 
150  void init ( const ConstIterator& it );
151 
152 
158 
165 
169  Self getSelf() const;
170 
175 
181  bool isInDSS ( const Point3d& aPoint ) const;
182 
188  bool isInDSS ( const ConstIterator & it ) const;
189 
198  bool operator== ( const Naive3DDSSComputer & other ) const;
199 
206  bool operator!= ( const Naive3DDSSComputer & other ) const;
207 
212 
213  // ----------------------- Interface --------------------------------------
214  public:
215 
216 
223  bool extendFront();
224 
225 
232 
233  // ------------------------- Accessors ------------------------------
234 
243  void getParameters ( Vector3d& direction, PointR3d& intercept, PointR3d& thickness ) const;
244 
249  bool isValid() const;
250 
260 
266 
272 
278 
288 
297 
298 
299  // ------------------ Display ------------------------------------------
300  public:
301 
305  std::string className() const;
306 
311  void selfDisplay ( std::ostream & out ) ;
312 
313  // ------------------------- Hidden services ------------------------------
314  private:
325  bool extendFront ( ArithmeticalDSSComputer2d & DSS2D, bool & blocked );
326 
327  // ------------------------- Protected Datas ------------------------------
328  protected:
329 
336 
343 
350 
353 }; // end of class Naive3DDSSComputer
354 
355 } // namespace DGtal
356 
357 
359 // Includes inline functions.
360 #if !defined(BUILD_INLINE)
361 #include "DGtal/geometry/curves/Naive3DDSSComputer.ih"
362 #endif
363 
364 
365 // //
367 
368 #endif // !defined Naive3DDSSComputer_h
369 
370 #undef Naive3DDSSComputer_RECURSES
371 #endif // else defined(Naive3DDSSComputer_RECURSES)
DGtal::Naive3DDSSComputer::Reverse
Naive3DDSSComputer< ReverseIterator< ConstIterator >, TInteger, connectivity > Reverse
Reverse type.
Definition: Naive3DDSSComputer.h:111
DGtal::Naive3DDSSComputer::myProjYZ
Projector2d myProjYZ
Projector for YZ-plane.
Definition: Naive3DDSSComputer.h:335
DGtal::functors::Projector
Aim: Functor that maps a point P of dimension i to a point Q of dimension j. The member myDims is an ...
Definition: BasicPointFunctors.h:107
DGtal::Naive3DDSSComputer::Projector2d
functors::Projector< SpaceND< 2, Coordinate > > Projector2d
Adapter for iterators.
Definition: Naive3DDSSComputer.h:123
DGtal::Naive3DDSSComputer::isValid
bool isValid() const
DGtal::Naive3DDSSComputer::end
ConstIterator end() const
DGtal::Naive3DDSSComputer::begin
ConstIterator begin() const
DGtal::Naive3DDSSComputer::myXYalgo
ArithmeticalDSSComputer2d myXYalgo
2d-arithmeticalDSS recognition algorithms for XY-plane.
Definition: Naive3DDSSComputer.h:338
DGtal::Naive3DDSSComputer::extendFront
bool extendFront(ArithmeticalDSSComputer2d &DSS2D, bool &blocked)
DGtal::Naive3DDSSComputer::blockXZ
bool blockXZ
Definition: Naive3DDSSComputer.h:349
DGtal::Naive3DDSSComputer::arithmeticalDSS2dYZ
const ArithmeticalDSSComputer2d & arithmeticalDSS2dYZ() const
DGtal::Naive3DDSSComputer::getParameters
void getParameters(Vector3d &direction, PointR3d &intercept, PointR3d &thickness) const
DGtal::concepts::CInteger
Aim: Concept checking for Integer Numbers. More precisely, this concept is a refinement of both CEucl...
Definition: CInteger.h:88
DGtal::ArithmeticalDSSComputer< IteratorAdapter, TInteger, connectivity >
DGtal::Naive3DDSSComputer::selfDisplay
void selfDisplay(std::ostream &out)
DGtal::Naive3DDSSComputer::operator=
Naive3DDSSComputer & operator=(const Naive3DDSSComputer &other)
DGtal::Naive3DDSSComputer::extendFront
bool extendFront()
aPoint
const Point aPoint(3, 4)
DGtal::Dimension
DGtal::uint32_t Dimension
Definition: Common.h:133
DGtal::Naive3DDSSComputer::myBegin
ConstIterator myBegin
begin and end iterators
Definition: Naive3DDSSComputer.h:352
DGtal::Naive3DDSSComputer::Point2d
DGtal::PointVector< 2, Coordinate > Point2d
Type of 2d digital point.
Definition: Naive3DDSSComputer.h:119
DGtal::Naive3DDSSComputer::myEnd
ConstIterator myEnd
Definition: Naive3DDSSComputer.h:352
DGtal::Naive3DDSSComputer::Naive3DDSSComputer
Naive3DDSSComputer()
DGtal::Naive3DDSSComputer::ArithmeticalDSSComputer2d
DGtal::ArithmeticalDSSComputer< IteratorAdapter, TInteger, connectivity > ArithmeticalDSSComputer2d
2D arithmetical DSS recognition algorithm
Definition: Naive3DDSSComputer.h:127
DGtal::Naive3DDSSComputer::init
void init(const ConstIterator &it)
DGtal::Naive3DDSSComputer::isExtendableFront
bool isExtendableFront()
DGtal::Naive3DDSSComputer::Naive3DDSSComputer
Naive3DDSSComputer(const ConstIterator &it)
DGtal::Naive3DDSSComputer::Coordinate
Point3d::Coordinate Coordinate
Type of 3d digital point coordinate.
Definition: Naive3DDSSComputer.h:117
DGtal::Naive3DDSSComputer::blockYZ
bool blockYZ
Definition: Naive3DDSSComputer.h:349
DGtal::Naive3DDSSComputer::myProjXY
Projector2d myProjXY
Projector for XY-plane.
Definition: Naive3DDSSComputer.h:331
DGtal::Naive3DDSSComputer::arithmeticalDSS2dXZ
const ArithmeticalDSSComputer2d & arithmeticalDSS2dXZ() const
DGtal::Naive3DDSSComputer::getSelf
Self getSelf() const
DGtal::Naive3DDSSComputer::ConstIterator
TIterator ConstIterator
Type of iterator, at least readable and forward.
Definition: Naive3DDSSComputer.h:107
DGtal::Naive3DDSSComputer::arithmeticalDSS2dXY
const ArithmeticalDSSComputer2d & arithmeticalDSS2dXY() const
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition: ClosedIntegerHalfPlane.h:49
DGtal::Naive3DDSSComputer::Quotient
std::pair< Integer, Integer > Quotient
Type which represent quotient of two integers first/second.
Definition: Naive3DDSSComputer.h:105
DGtal::Naive3DDSSComputer::isInDSS
bool isInDSS(const Point3d &aPoint) const
DGtal::Naive3DDSSComputer::validArithmeticalDSS2d
bool validArithmeticalDSS2d(Dimension i) const
DGtal::Naive3DDSSComputer::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CInteger< TInteger >))
DGtal::Naive3DDSSComputer::IteratorAdapter
ConstIteratorAdapter< ConstIterator, Projector2d, Point2d > IteratorAdapter
Iterator over adapter.
Definition: Naive3DDSSComputer.h:125
DGtal::Naive3DDSSComputer::Vector3d
IteratorCirculatorTraits< ConstIterator >::Value Vector3d
Type of 3d digital vector.
Definition: Naive3DDSSComputer.h:115
DGtal::Naive3DDSSComputer::Naive3DDSSComputer
Naive3DDSSComputer(const Naive3DDSSComputer &other)
DGtal::Naive3DDSSComputer::myYZalgo
ArithmeticalDSSComputer2d myYZalgo
2d-arithmeticalDSS recognition algorithms for YZ-plane.
Definition: Naive3DDSSComputer.h:342
DGtal::Naive3DDSSComputer::operator==
bool operator==(const Naive3DDSSComputer &other) const
DGtal::Naive3DDSSComputer::arithmeticalDSS2d
const ArithmeticalDSSComputer2d & arithmeticalDSS2d(Dimension i) const
DGtal::Naive3DDSSComputer::myXZalgo
ArithmeticalDSSComputer2d myXZalgo
2d-arithmeticalDSS recognition algorithms for XZ-plane.
Definition: Naive3DDSSComputer.h:340
DGtal::PointVector
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:593
DGtal::Naive3DDSSComputer
Aim: Dynamic recognition of a 3d-digital straight segment (DSS)
Definition: Naive3DDSSComputer.h:98
DGtal::Naive3DDSSComputer::Self
Naive3DDSSComputer< ConstIterator, TInteger, connectivity > Self
Self type.
Definition: Naive3DDSSComputer.h:109
DGtal::Naive3DDSSComputer::Point3d
IteratorCirculatorTraits< ConstIterator >::Value Point3d
Type of 3d digital point.
Definition: Naive3DDSSComputer.h:113
DGtal::Naive3DDSSComputer::blockXY
bool blockXY
Definition: Naive3DDSSComputer.h:349
DGtal::Naive3DDSSComputer::className
std::string className() const
DGtal::Naive3DDSSComputer::getReverse
Reverse getReverse() const
DGtal::Naive3DDSSComputer::isInDSS
bool isInDSS(const ConstIterator &it) const
DGtal::Naive3DDSSComputer::PointR3d
std::array< Quotient, 3 > PointR3d
Type of 3d rational point.
Definition: Naive3DDSSComputer.h:121
DGtal::Naive3DDSSComputer::myProjXZ
Projector2d myProjXZ
Projector for XZ-plane.
Definition: Naive3DDSSComputer.h:333
DGtal::Naive3DDSSComputer::~Naive3DDSSComputer
~Naive3DDSSComputer()
Definition: Naive3DDSSComputer.h:211
DGtal::IteratorCirculatorTraits::Value
IC::value_type Value
Definition: IteratorCirculatorTraits.h:303
DGtal::Naive3DDSSComputer::Integer
TInteger Integer
Type of integer, devoted to remainders (and intercepts)
Definition: Naive3DDSSComputer.h:103
DGtal::Naive3DDSSComputer::operator!=
bool operator!=(const Naive3DDSSComputer &other) const
DGtal::ConstIteratorAdapter
This class adapts any iterator so that operator* returns another element than the one pointed to by t...
Definition: ConstIteratorAdapter.h:88