DGtal  1.1.0
ArithmeticalDSSComputer.h
1
17 #pragma once
18
35 #if defined(ArithmeticalDSSComputer_RECURSES)
36 #error Recursive header files inclusion detected in ArithmeticalDSSComputer.h
37 #else // defined(ArithmeticalDSSComputer_RECURSES)
38
39 #define ArithmeticalDSSComputer_RECURSES
40
41 #if !defined ArithmeticalDSSComputer_h
42
43 #define ArithmeticalDSSComputer_h
44
46 // Inclusions
47 #include <iostream>
48 #include <list>
49 #include "DGtal/base/Exceptions.h"
50 #include "DGtal/base/Common.h"
51 #include "DGtal/kernel/PointVector.h"
52 #include "DGtal/kernel/CInteger.h"
53 #include "DGtal/base/ReverseIterator.h"
54 #include "DGtal/geometry/curves/ArithmeticalDSS.h"
56
57
58 namespace DGtal
59 {
61  // class ArithmeticalDSSComputer
83  template <typename TIterator,
84  typename TInteger = typename IteratorCirculatorTraits<TIterator>::Value::Coordinate,
85  unsigned short adjacency = 8>
87  {
88
89  // ----------------------- inner types ------------------------------
90  public:
91
95  typedef TIterator ConstIterator;
98
103  BOOST_STATIC_ASSERT(( Point::dimension == 2 ));
104
110
114  typedef TInteger Integer;
116
121  //we expect that the iterator type returned DGtal points, used in the DSS representation
123
127  typedef DSS Primitive;
128
132  typedef Point Vector;
133
136
137  // ----------------------- Standard services ------------------------------
138  public:
139
145
152
157  void init(const ConstIterator& it);
158
164
171
175  Self getSelf() const;
176
181
189  bool operator==( const ArithmeticalDSSComputer & other ) const;
190
197  bool operator!=( const ArithmeticalDSSComputer & other ) const;
198
203
204  // ----------------------- Interface --------------------------------------
205  public:
206
213
220
226  bool extendFront();
227
233  bool extendBack();
234
240  bool retractFront();
241
247  bool retractBack();
248
249
250  // ------------------------- Accessors ------------------------------
257  const Primitive& primitive() const;
261  Integer a() const;
265  Integer b() const;
269  Integer mu() const;
273  Integer omega() const;
277  Point Uf() const;
281  Point Ul() const;
285  Point Lf() const;
289  Point Ll() const;
293  Point back() const ;
297  Point front() const ;
306
311  bool isValid() const;
312
313
314  // ------------------ Useful tools -----------------------------------
315
322  Integer remainder(const ConstIterator & it) const;
323
330  Integer remainder( const Point& aPoint ) const;
331
338  Integer position(const ConstIterator & it) const;
339
346  Integer position( const Point& aPoint ) const;
347
354  bool isInDSL( const Point& aPoint ) const;
355
362  bool isInDSL(const ConstIterator & it) const;
363
369  bool isInDSS( const Point& aPoint ) const;
370
376  bool isInDSS(const ConstIterator & it) const;
377
378
379  // ------------------------- Hidden services ------------------------------
380  private:
381
382
383  // ------------------------- Protected Datas ------------------------------
384  protected:
385
398
399  // ------------------ Display ------------------------------------------
400
401  public:
402
407  void selfDisplay ( std::ostream & out ) const;
408
409
410  }; // end of class ArithmeticalDSSComputer
411
412
419 template <typename TIterator, typename TInteger, unsigned short adjacency>
420 std::ostream&
421 operator<< ( std::ostream & out, const ArithmeticalDSSComputer<TIterator,TInteger,adjacency> & object )
422 {
423  object.selfDisplay( out);
424  return out;
425 }
426
427 } // namespace DGtal
428
430 // Aliases
431 namespace DGtal
432 {
460  template <typename TIterator,
461  typename TInteger = typename IteratorCirculatorTraits<TIterator>::Value::Coordinate>
463
484  template <typename TIterator,
485  typename TInteger = typename IteratorCirculatorTraits<TIterator>::Value::Coordinate>
487
488 } // namespace DGtal
489
490
492 // Includes inline functions/methods.
493 #include "DGtal/geometry/curves/ArithmeticalDSSComputer.ih"
494
495 // //
497
498 #endif // !defined ArithmeticalDSSComputer_h
499
500 #undef ArithmeticalDSSComputer_RECURSES
501 #endif // else defined(ArithmeticalDSSComputer_RECURSES)
DGtal::ArithmeticalDSSComputer::Lf
Point Lf() const
DGtal::ArithmeticalDSSComputer::front
Point front() const
DGtal::ArithmeticalDSSComputer::isValid
bool isValid() const
DGtal::ArithmeticalDSSComputer::retractFront
bool retractFront()
DGtal::ArithmeticalDSSComputer::isInDSS
bool isInDSS(const ConstIterator &it) const
DGtal::ArithmeticalDSSComputer::back
Point back() const
DGtal::IteratorCirculatorTraits
Aim: Provides nested types for both iterators and circulators: Type, Category, Value,...
Definition: IteratorCirculatorTraits.h:294
DGtal::ArithmeticalDSSComputer::ArithmeticalDSSComputer
ArithmeticalDSSComputer(const ConstIterator &it)
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
Aim: This class is a wrapper around ArithmeticalDSS that is devoted to the dynamic recognition of dig...
Definition: ArithmeticalDSSComputer.h:87
This class adapts any lvalue iterator so that operator* returns a member on the element pointed to by...
DGtal::ArithmeticalDSSComputer::Ll
Point Ll() const
DGtal::ArithmeticalDSSComputer::Reverse
ArithmeticalDSSComputer< ReverseIterator< ConstIterator >, TInteger, adjacency > Reverse
Definition: ArithmeticalDSSComputer.h:135
DGtal::ArithmeticalDSSComputer::remainder
Integer remainder(const Point &aPoint) const
aPoint
const Point aPoint(3, 4)
DGtal::ArithmeticalDSSComputer::Coordinate
IteratorCirculatorTraits< TIterator >::Value::Coordinate Coordinate
Definition: ArithmeticalDSSComputer.h:108
DGtal::ArithmeticalDSSComputer::myDSS
DSS myDSS
Definition: ArithmeticalDSSComputer.h:389
DGtal::ArithmeticalDSSComputer::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CInteger< Integer >))
DGtal::ArithmeticalDSSComputer::isInDSL
bool isInDSL(const ConstIterator &it) const
DGtal::ArithmeticalDSSComputer::position
Integer position(const Point &aPoint) const
DGtal::ArithmeticalDSSComputer::Ul
Point Ul() const
DGtal::ArithmeticalDSSComputer::myEnd
ConstIterator myEnd
Definition: ArithmeticalDSSComputer.h:397
DGtal::ArithmeticalDSSComputer::myBegin
ConstIterator myBegin
Definition: ArithmeticalDSSComputer.h:393
DGtal::ArithmeticalDSSComputer::omega
Integer omega() const
DGtal::ArithmeticalDSSComputer::ArithmeticalDSSComputer
ArithmeticalDSSComputer()
DGtal::ArithmeticalDSSComputer::primitive
const Primitive & primitive() const
DGtal::ArithmeticalDSSComputer::ConstIterator
TIterator ConstIterator
Definition: ArithmeticalDSSComputer.h:95
DGtal::ArithmeticalDSSComputer::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((concepts::ConceptUtils::SameType< Point, typename DSS::Point >::value))
DGtal::ArithmeticalDSSComputer::DSS
ArithmeticalDSS< Coordinate, Integer, adjacency > DSS
Definition: ArithmeticalDSSComputer.h:120
DGtal::ArithmeticalDSSComputer::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::ArithmeticalDSSComputer::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((boost_concepts::ForwardTraversalConcept< ConstIterator >))
DGtal::ArithmeticalDSSComputer::init
void init(const ConstIterator &it)
boost_concepts::ForwardTraversalConcept
Go to http://www.boost.org/doc/libs/1_52_0/libs/iterator/doc/ForwardTraversal.html.
Definition: BoostConcepts.dox:47
DGtal::ArithmeticalDSSComputer::Self
ArithmeticalDSSComputer< ConstIterator, TInteger, adjacency > Self
Definition: ArithmeticalDSSComputer.h:134
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition: ClosedIntegerHalfPlane.h:49
DGtal::ArithmeticalDSSComputer::isInDSL
bool isInDSL(const Point &aPoint) const
DGtal::ArithmeticalDSSComputer::isInDSS
bool isInDSS(const Point &aPoint) const
DGtal::ArithmeticalDSSComputer::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CInteger< Coordinate >))
DGtal::ArithmeticalDSSComputer::operator=
ArithmeticalDSSComputer & operator=(const ArithmeticalDSSComputer &other)
DGtal::ArithmeticalDSSComputer::end
ConstIterator end() const
DGtal::ArithmeticalDSSComputer::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((Point::dimension==2))
DGtal::ArithmeticalDSSComputer::BOOST_CONCEPT_ASSERT
DGtal::ArithmeticalDSSComputer::Uf
Point Uf() const
DGtal::ArithmeticalDSSComputer::retractBack
bool retractBack()
DGtal::ArithmeticalDSSComputer::ArithmeticalDSSComputer
ArithmeticalDSSComputer(const ArithmeticalDSSComputer &other)
DGtal::ArithmeticalDSSComputer::operator==
bool operator==(const ArithmeticalDSSComputer &other) const
DGtal::ArithmeticalDSSComputer::mu
Integer mu() const
DGtal::ArithmeticalDSSComputer::position
Integer position(const ConstIterator &it) const
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
DGtal::ArithmeticalDSSComputer::isExtendableBack
bool isExtendableBack()
DGtal::ArithmeticalDSSComputer::extendFront
bool extendFront()
DGtal::ArithmeticalDSSComputer::a
Integer a() const
DGtal::ArithmeticalDSSComputer::~ArithmeticalDSSComputer
~ArithmeticalDSSComputer()
Definition: ArithmeticalDSSComputer.h:202
DGtal::ArithmeticalDSSComputer::b
Integer b() const
DGtal::ArithmeticalDSSComputer::begin
ConstIterator begin() const
DGtal::ArithmeticalDSSComputer::operator!=
bool operator!=(const ArithmeticalDSSComputer &other) const
DGtal::ArithmeticalDSSComputer::Integer
TInteger Integer
Definition: ArithmeticalDSSComputer.h:114
DGtal::ArithmeticalDSSComputer::Primitive
DSS Primitive
Definition: ArithmeticalDSSComputer.h:127
Definition: BoostConcepts.dox:29
DGtal::ArithmeticalDSSComputer::Vector
Point Vector
Definition: ArithmeticalDSSComputer.h:132
DGtal::ArithmeticalDSSComputer::remainder
Integer remainder(const ConstIterator &it) const
DGtal::IteratorCirculatorTraits::Value
IC::value_type Value
Definition: IteratorCirculatorTraits.h:303
DGtal::ArithmeticalDSSComputer::Point
IteratorCirculatorTraits< ConstIterator >::Value Point
Definition: ArithmeticalDSSComputer.h:102
DGtal::ArithmeticalDSSComputer::isExtendableFront
bool isExtendableFront()
DGtal::ArithmeticalDSSComputer::getReverse
Reverse getReverse() const
DGtal::ArithmeticalDSSComputer::extendBack
bool extendBack()
DGtal::ArithmeticalDSSComputer::getSelf
Self getSelf() const