DGtal  1.2.0
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/PointVector.h"
50 #include "DGtal/kernel/CInteger.h"
51 #include "DGtal/base/ReverseIterator.h"
52 #include "DGtal/geometry/curves/ArithmeticalDSS.h"
53 #include "DGtal/topology/CCellularGridSpaceND.h"
55 
56 
57 namespace DGtal
58 {
60  // class ArithmeticalDSSComputerOnSurfels
79  template <typename TKSpace, typename TIterator,
80  typename TInteger = typename TKSpace::Space::Integer,
81  unsigned short adjacency = 8>
83  {
85  BOOST_STATIC_ASSERT(( TKSpace::dimension == 3 ));
86 
87  // ----------------------- inner types ------------------------------
88  public:
89 
93  typedef TKSpace KSpace;
94 
98  typedef typename KSpace::SCell SCell;
99 
103  typedef typename KSpace::Cell Cell;
104 
108  typedef TIterator ConstIterator;
116  typedef typename KSpace::Space::Point Point3;
117 
122 
126  typedef typename Point::Coordinate Coordinate;
128 
132  typedef TInteger Integer;
134 
139  //we expect that the iterator type returned DGtal points, used in the DSS representation
141 
145  typedef DSS Primitive;
146 
150  typedef Point Vector;
151 
154 
155  // ----------------------- Standard services ------------------------------
156  public:
157 
163 
171 
176  void init(const ConstIterator& it);
177 
183 
190 
194  Self getSelf() const;
195 
200 
208  bool operator==( const ArithmeticalDSSComputerOnSurfels & other ) const;
209 
216  bool operator!=( const ArithmeticalDSSComputerOnSurfels & other ) const;
217 
222 
223  // ----------------------- Interface --------------------------------------
224  public:
225 
232 
239 
245  bool extendFront();
246 
252  bool extendBack();
253 
259  bool retractFront();
260 
266  bool retractBack();
267 
268 
269  // ------------------------- Accessors ------------------------------
276  const Primitive& primitive() const;
280  Integer a() const;
284  Integer b() const;
288  Integer mu() const;
292  Integer omega() const;
296  Point Uf() const;
300  Point Ul() const;
304  Point Lf() const;
308  Point Ll() const;
312  Point back() const ;
316  Point front() const ;
325 
330  bool isValid() const;
331 
336  std::pair<Point, Point> projectSurfel(SCell const& aSCell) const;
337 
338  // ------------------------- Hidden services ------------------------------
339  private:
346  bool commonLinel (Cell const& aSurfel1, Cell const& aSurfel2, Cell& aLinel);
347 
353 
361  bool getOtherPointFromSurfel (ConstIterator const& it, Point& aPoint, bool aIsFront, bool aUpdatePrevious);
362 
363  // ------------------------- Protected Datas ------------------------------
364  protected:
365 
369  const KSpace* myKSpace;
370 
375 
380 
385 
390 
395 
401 
407 
420 
421  // ------------------ Display ------------------------------------------
422 
423  public:
424 
429  void selfDisplay ( std::ostream & out ) const;
430 
431 
432  }; // end of class ArithmeticalDSSComputerOnSurfels
433 
434 
441 template <typename TKSpace, typename TIterator, typename TInteger, unsigned short adjacency>
442 std::ostream&
444 {
445  object.selfDisplay( out);
446  return out;
447 }
448 
449 } // namespace DGtal
450 
451 
453 // Includes inline functions/methods.
454 #include "DGtal/geometry/surfaces/ArithmeticalDSSComputerOnSurfels.ih"
455 
456 // //
458 
459 #endif // !defined ArithmeticalDSSComputerOnSurfels_h
460 
461 #undef ArithmeticalDSSComputerOnSurfels_RECURSES
462 #endif // else defined(ArithmeticalDSSComputerOnSurfels_RECURSES)
Aim: This class is a wrapper around ArithmeticalDSS that is devoted to the dynamic recognition of dig...
ArithmeticalDSS< Coordinate, Integer, adjacency > DSS
BOOST_CONCEPT_ASSERT((concepts::CCellularGridSpaceND< TKSpace >))
BOOST_CONCEPT_ASSERT((boost_concepts::ForwardTraversalConcept< ConstIterator >))
BOOST_STATIC_ASSERT((concepts::ConceptUtils::SameType< SCell, typename IteratorCirculatorTraits< ConstIterator >::Value >::value))
bool commonLinel(Cell const &aSurfel1, Cell const &aSurfel2, Cell &aLinel)
BOOST_CONCEPT_ASSERT((concepts::CInteger< Integer >))
ArithmeticalDSSComputerOnSurfels< KSpace, ConstIterator, TInteger, adjacency > Self
BOOST_STATIC_ASSERT((TKSpace::dimension==3))
ArithmeticalDSSComputerOnSurfels< KSpace, ReverseIterator< ConstIterator >, TInteger, adjacency > Reverse
const Primitive & primitive() const
BOOST_STATIC_ASSERT((concepts::ConceptUtils::SameType< Point, typename DSS::Point >::value))
bool operator!=(const ArithmeticalDSSComputerOnSurfels &other) const
bool getOtherPointFromSurfel(ConstIterator const &it, Point &aPoint, bool aIsFront, bool aUpdatePrevious)
ArithmeticalDSSComputerOnSurfels(const ArithmeticalDSSComputerOnSurfels &other)
ArithmeticalDSSComputerOnSurfels(const KSpace &aKSpace, Dimension aDim1, Dimension aDim2)
bool operator==(const ArithmeticalDSSComputerOnSurfels &other) const
std::pair< Point, Point > projectSurfel(SCell const &aSCell) const
BOOST_CONCEPT_ASSERT((concepts::CInteger< Coordinate >))
void selfDisplay(std::ostream &out) const
void init(const ConstIterator &it)
ArithmeticalDSSComputerOnSurfels & operator=(const ArithmeticalDSSComputerOnSurfels &other)
Point projectInPlane(Point3 const &aPoint) const
BOOST_CONCEPT_ASSERT((boost_concepts::ReadableIteratorConcept< ConstIterator >))
Aim: This class represents a naive (resp. standard) digital straight segment (DSS),...
Component Coordinate
Type for Point elements.
Definition: PointVector.h:617
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:137
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
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.
const Point aPoint(3, 4)