DGtal 1.4.2
Loading...
Searching...
No Matches
ArithmeticalDSSComputerOnSurfels.h
1
17#pragma once
18
33#if defined(ArithmeticalDSSComputerOnSurfels_RECURSES)
34#error Recursive header files inclusion detected in ArithmeticalDSSComputerOnSurfels.h
35#else // defined(ArithmeticalDSSComputerOnSurfels_RECURSES)
37#define ArithmeticalDSSComputerOnSurfels_RECURSES
38
39#if !defined ArithmeticalDSSComputerOnSurfels_h
41#define ArithmeticalDSSComputerOnSurfels_h
42
44// Inclusions
45#include <iostream>
46#include <list>
47#include "DGtal/base/Exceptions.h"
48#include "DGtal/base/Common.h"
49#include "DGtal/kernel/SpaceND.h"
50#include "DGtal/kernel/PointVector.h"
51#include "DGtal/kernel/BasicPointFunctors.h"
52#include "DGtal/kernel/CInteger.h"
53#include "DGtal/base/ReverseIterator.h"
54#include "DGtal/geometry/curves/ArithmeticalDSS.h"
55#include "DGtal/topology/CCellularGridSpaceND.h"
57
58
59namespace DGtal
60{
62 // class ArithmeticalDSSComputerOnSurfels
83 template <typename TKSpace, typename TIterator,
84 typename TInteger = typename TKSpace::Space::Integer>
86 {
88 BOOST_STATIC_ASSERT(( TKSpace::dimension == 3 ));
89
90 // ----------------------- inner types ------------------------------
91 public:
92
96 typedef TKSpace KSpace;
97
101 typedef typename KSpace::SCell SCell;
102
106 typedef TIterator ConstIterator;
114 typedef typename KSpace::Space::Point Point3;
115
120
125
131
135 typedef TInteger Integer;
137
142 //we expect that the iterator type returned DGtal points, used in the DSS representation
144
148 typedef DSS Primitive;
149
153 typedef Point Vector;
154
159
164
165 virtual Point first(const std::pair<Point,Point>& aPair) const { return aPair.first; }
166 virtual Point second(const std::pair<Point,Point>& aPair) const { return aPair.second; }
167
168 };
170
171 Point first(const std::pair<Point,Point>& aPair) const { return aPair.second; }
172 Point second(const std::pair<Point,Point>& aPair) const { return aPair.first; }
173
174 };
175 typedef std::shared_ptr<DirectPairExtractor> PairExtractor;
176
181
182 // ----------------------- Standard services ------------------------------
183 public:
184
190
200 ArithmeticalDSSComputerOnSurfels(const KSpace& aKSpace, Dimension aDim1, Dimension aDim2, bool aFlagToReverse = false);
201
206 void init(const ConstIterator& it);
207
213
220
224 Self getSelf() const;
225
230
238 bool operator==( const ArithmeticalDSSComputerOnSurfels & other ) const;
239
246 bool operator!=( const ArithmeticalDSSComputerOnSurfels & other ) const;
247
252
253 // ----------------------- Interface --------------------------------------
254 public:
255
265
272
283
290
297
304
312 std::pair<Point,Point> getProjectedPointsFromSurfel(SCell const& aSurfel) const;
313
321 Point getNextProjectedPoint(SCell const& aSurfel) const;
322
330 Point getPreviousProjectedPoint(SCell const& aSurfel) const;
331
332 // ------------------------- Accessors ------------------------------
339 const Primitive& primitive() const;
343 Integer a() const;
347 Integer b() const;
351 Integer mu() const;
355 Integer omega() const;
359 Point Uf() const;
363 Point Ul() const;
367 Point Lf() const;
371 Point Ll() const;
375 Point back() const ;
379 Point front() const ;
388
393 bool isValid() const;
394
395
396 // ------------------------- Hidden services ------------------------------
397 private:
398
406 std::pair<Point,Point> getProjectedPointsFromLinel(SCell const& aLinel) const;
407
414 Dimension dimNotIn(Dimension const& aDim1, Dimension const& aDim2) const;
415
416 // ------------------------- Protected Datas ------------------------------
417 protected:
418
423
428
433
439
444
450
455
460
468
469 // ------------------ Display ------------------------------------------
470
471 public:
472
477 void selfDisplay ( std::ostream & out ) const;
478
479
480 }; // end of class ArithmeticalDSSComputerOnSurfels
481
482
489template <typename TKSpace, typename TIterator, typename TInteger>
490std::ostream&
492{
493 object.selfDisplay( out);
494 return out;
495}
496
497} // namespace DGtal
498
499
501// Includes inline functions/methods.
502#include "DGtal/geometry/surfaces/ArithmeticalDSSComputerOnSurfels.ih"
503
504// //
506
507#endif // !defined ArithmeticalDSSComputerOnSurfels_h
508
509#undef ArithmeticalDSSComputerOnSurfels_RECURSES
510#endif // else defined(ArithmeticalDSSComputerOnSurfels_RECURSES)
Aim: This class is a wrapper around ArithmeticalDSS that is devoted to the dynamic recognition of dig...
BOOST_STATIC_ASSERT((TKSpace::dimension==3))
ArithmeticalDSSComputerOnSurfels(const ArithmeticalDSSComputerOnSurfels &other)
ArithmeticalDSSComputerOnSurfels & operator=(const ArithmeticalDSSComputerOnSurfels &other)
std::pair< Point, Point > getProjectedPointsFromSurfel(SCell const &aSurfel) const
BOOST_CONCEPT_ASSERT((boost_concepts::ReadableIteratorConcept< ConstIterator >))
bool operator!=(const ArithmeticalDSSComputerOnSurfels &other) const
ArithmeticalDSS< Coordinate, Integer, 4 > DSS
Point getNextProjectedPoint(SCell const &aSurfel) const
ArithmeticalDSSComputerOnSurfels< KSpace, ConstIterator, TInteger > Self
BOOST_CONCEPT_ASSERT((concepts::CInteger< Integer >))
const Primitive & primitive() const
std::pair< Point, Point > getProjectedPointsFromLinel(SCell const &aLinel) const
bool operator==(const ArithmeticalDSSComputerOnSurfels &other) const
ArithmeticalDSSComputerOnSurfels(const KSpace &aKSpace, Dimension aDim1, Dimension aDim2, bool aFlagToReverse=false)
Point getPreviousProjectedPoint(SCell const &aSurfel) const
BOOST_CONCEPT_ASSERT((concepts::CCellularGridSpaceND< TKSpace >))
BOOST_STATIC_ASSERT((concepts::ConceptUtils::SameType< Point, typename DSS::Point >::value))
BOOST_CONCEPT_ASSERT((boost_concepts::ForwardTraversalConcept< ConstIterator >))
BOOST_STATIC_ASSERT((concepts::ConceptUtils::SameType< SCell, typename IteratorCirculatorTraits< ConstIterator >::Value >::value))
std::shared_ptr< DirectPairExtractor > PairExtractor
Dimension dimNotIn(Dimension const &aDim1, Dimension const &aDim2) const
void init(const ConstIterator &it)
BOOST_CONCEPT_ASSERT((concepts::CInteger< Coordinate >))
ArithmeticalDSSComputerOnSurfels< KSpace, ReverseIterator< ConstIterator >, TInteger > Reverse
void selfDisplay(std::ostream &out) const
functors::Projector< SpaceND< 2, TInteger > > Projector
Aim: This class represents a naive (resp. standard) digital straight segment (DSS),...
Component Coordinate
Type for Point elements.
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
DGtal::uint32_t Dimension
Definition Common.h:136
virtual Point second(const std::pair< Point, Point > &aPair) const
virtual Point first(const std::pair< Point, Point > &aPair) const
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
Aim: This concept describes a cellular grid space in nD. In these spaces obtained by cartesian produc...
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 ...
Go to http://www.boost.org/doc/libs/1_52_0/libs/iterator/doc/ForwardTraversal.html.
Go to http://www.boost.org/doc/libs/1_52_0/libs/iterator/doc/ReadableIterator.html.