DGtal 1.4.0
Loading...
Searching...
No Matches
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)
35#define Naive3DDSSComputer_RECURSES
36
37#if !defined Naive3DDSSComputer_h
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
56namespace DGtal
57{
58
60// class Naive3DDSSComputer
68
69// class Naive3DDSSComputer
96template <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
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)
This class adapts any iterator so that operator* returns another element than the one pointed to by t...
Aim: Dynamic recognition of a 3d-digital straight segment (DSS)
std::pair< Integer, Integer > Quotient
Type which represent quotient of two integers first/second.
Naive3DDSSComputer(const Naive3DDSSComputer &other)
bool operator==(const Naive3DDSSComputer &other) const
IteratorCirculatorTraits< ConstIterator >::Value Vector3d
Type of 3d digital vector.
void init(const ConstIterator &it)
ArithmeticalDSSComputer2d myYZalgo
2d-arithmeticalDSS recognition algorithms for YZ-plane.
ArithmeticalDSSComputer2d myXYalgo
2d-arithmeticalDSS recognition algorithms for XY-plane.
Point3d::Coordinate Coordinate
Type of 3d digital point coordinate.
TInteger Integer
Type of integer, devoted to remainders (and intercepts)
Naive3DDSSComputer< ReverseIterator< ConstIterator >, TInteger, connectivity > Reverse
Reverse type.
Naive3DDSSComputer & operator=(const Naive3DDSSComputer &other)
const ArithmeticalDSSComputer2d & arithmeticalDSS2dXZ() const
ConstIterator begin() const
DGtal::ArithmeticalDSSComputer< IteratorAdapter, TInteger, connectivity > ArithmeticalDSSComputer2d
2D arithmetical DSS recognition algorithm
DGtal::PointVector< 2, Coordinate > Point2d
Type of 2d digital point.
const ArithmeticalDSSComputer2d & arithmeticalDSS2d(Dimension i) const
bool operator!=(const Naive3DDSSComputer &other) const
ConstIteratorAdapter< ConstIterator, Projector2d, Point2d > IteratorAdapter
Iterator over adapter.
Reverse getReverse() const
bool extendFront(ArithmeticalDSSComputer2d &DSS2D, bool &blocked)
void getParameters(Vector3d &direction, PointR3d &intercept, PointR3d &thickness) const
void selfDisplay(std::ostream &out)
bool isInDSS(const ConstIterator &it) const
IteratorCirculatorTraits< ConstIterator >::Value Point3d
Type of 3d digital point.
Naive3DDSSComputer(const ConstIterator &it)
Projector2d myProjYZ
Projector for YZ-plane.
BOOST_CONCEPT_ASSERT((concepts::CInteger< TInteger >))
const ArithmeticalDSSComputer2d & arithmeticalDSS2dYZ() const
Projector2d myProjXY
Projector for XY-plane.
bool isInDSS(const Point3d &aPoint) const
ConstIterator myBegin
begin and end iterators
Projector2d myProjXZ
Projector for XZ-plane.
ConstIterator end() const
TIterator ConstIterator
Type of iterator, at least readable and forward.
functors::Projector< SpaceND< 2, Coordinate > > Projector2d
Adapter for iterators.
std::array< Quotient, 3 > PointR3d
Type of 3d rational point.
Naive3DDSSComputer< ConstIterator, TInteger, connectivity > Self
Self type.
ArithmeticalDSSComputer2d myXZalgo
2d-arithmeticalDSS recognition algorithms for XZ-plane.
std::string className() const
bool validArithmeticalDSS2d(Dimension i) const
const ArithmeticalDSSComputer2d & arithmeticalDSS2dXY() const
Aim: Implements basic operations that will be used in Point and Vector classes.
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::uint32_t Dimension
Definition Common.h:136
Aim: Concept checking for Integer Numbers. More precisely, this concept is a refinement of both CEucl...
Definition CInteger.h:88
Aim: Functor that maps a point P of dimension i to a point Q of dimension j. The member myDims is an ...
const Point aPoint(3, 4)