DGtal  1.4.beta
StabbingCircleComputer.h
1 
17 #pragma once
18 
31 #if defined(StabbingCircleComputer_RECURSES)
32 #error Recursive header files inclusion detected in StabbingCircleComputer.h
33 #else // defined(StabbingCircleComputer_RECURSES)
34 
35 #define StabbingCircleComputer_RECURSES
36 
37 #if !defined StabbingCircleComputer_h
38 
39 #define StabbingCircleComputer_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/base/CowPtr.h"
46 #include "DGtal/base/ConceptUtils.h"
47 #include "DGtal/geometry/curves/SegmentComputerUtils.h"
48 
49 #include "DGtal/geometry/curves/StabbingLineComputer.h"
50 #include "DGtal/shapes/fromPoints/CircleFrom2Points.h"
51 #include "DGtal/geometry/tools/Preimage2D.h"
52 #include "DGtal/shapes/fromPoints/CircleFrom3Points.h"
53 #include "DGtal/shapes/fromPoints/Point2ShapePredicate.h"
54 
56 
57 namespace DGtal
58 {
59 
61  // template class StabbingCircleComputer
111  template <typename TConstIterator>
113  {
114 
115  public:
116 
117  //requiered types
118  typedef TConstIterator ConstIterator;
121 
122  //point type
124  //Pair::first_type and Pair::second_type should be the same type;
126  typedef typename Pair::first_type Point;
127  BOOST_STATIC_ASSERT(( Point::dimension == 2 ));
128 
129  private:
130 
131  //other types used for the recognition
134 
135  //Predicates used to decide whether the current circle is still seperating or not
140 
141  // ----------------------- Standard services ------------------------------
142  public:
143 
148 
153  StabbingCircleComputer ( const Self& other );
154 
160  Self& operator= ( const Self& other );
161 
166 
174  bool operator==( const Self & other) const;
175 
183  bool operator!=( const Self & other) const;
184 
188  Self getSelf() const;
189 
193  Reverse getReverse() const;
194 
195 
196  // ----------------------- Interface --------------------------------------
197  public:
198 
203  bool isValid() const;
204 
208  ConstIterator begin() const;
209 
213  ConstIterator end() const;
214 
215  //------------------ accessors -------------------------------
216 
221  bool isStraight() const;
222 
229 
233  Circle getSeparatingCircle() const;
234 
235  // ----------------------- growth operations --------------------------------------
236 
241  void init(const ConstIterator& anIt);
242 
248  bool extendFront();
249 
255  bool isExtendableFront();
256 
262  bool extendBack();
263 
269  bool isExtendableBack();
270 
271  //------------------ display -------------------------------
276  void selfDisplay ( std::ostream & out ) const;
277 
278 
282  std::string className() const;
283 
284 
285  // ------------------------- Protected Datas ------------------------------
286  private:
287  // ------------------------- Private Datas --------------------------------
288  private:
310 
311  // ------------------------- Hidden services ------------------------------
312  protected:
313 
314 
315  private:
316 
317 
318  // ------------------------- Internals ------------------------------------
319  private:
320 
340  template <typename TIterator>
341  bool isCircularlySeparable(const TIterator& itb, const TIterator& ite,
342  const Point& aPole,
343  Point& Pf, Point& Pl, Point& Qf, Point& Ql);
344 
345  // ------------------------- Private Datas --------------------------------
346  private:
347 
348 
349  }; // end of class StabbingCircleComputer
350 
351 
358  template <typename TConstIterator>
359  std::ostream&
360  operator<< ( std::ostream & out, const StabbingCircleComputer<TConstIterator> & object );
361 
362 } // namespace DGtal
363 
364 
366 // Includes inline functions.
367 #include "DGtal/geometry/curves/StabbingCircleComputer.ih"
368 
369 // //
371 
372 #endif // !defined StabbingCircleComputer_h
373 
374 #undef StabbingCircleComputer_RECURSES
375 #endif // else defined(StabbingCircleComputer_RECURSES)
DGtal::StabbingCircleComputer::extendBack
bool extendBack()
DGtal::StabbingCircleComputer::myCircle
Circle myCircle
Definition: StabbingCircleComputer.h:304
DGtal::StabbingCircleComputer::isCircularlySeparable
bool isCircularlySeparable(const TIterator &itb, const TIterator &ite, const Point &aPole, Point &Pf, Point &Pl, Point &Qf, Point &Ql)
DGtal::StabbingCircleComputer::Pair
IteratorCirculatorTraits< ConstIterator >::Value Pair
Definition: StabbingCircleComputer.h:123
DGtal::CircleFrom3Points< Point >
DGtal::functors::Point2ShapePredicate
Definition: Point2ShapePredicate.h:95
DGtal::StabbingCircleComputer::begin
ConstIterator begin() const
DGtal::StabbingCircleComputer::Circle
CircleFrom3Points< Point > Circle
Definition: StabbingCircleComputer.h:133
DGtal::StabbingCircleComputer::Reverse
StabbingCircleComputer< ReverseIterator< ConstIterator > > Reverse
Definition: StabbingCircleComputer.h:120
DGtal::StabbingCircleComputer::~StabbingCircleComputer
~StabbingCircleComputer()
DGtal::StabbingCircleComputer::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((concepts::ConceptUtils::SameType< typename Pair::first_type, typename Pair::second_type >::value))
DGtal::StabbingCircleComputer::myEnd
ConstIterator myEnd
Definition: StabbingCircleComputer.h:296
DGtal::StabbingCircleComputer::StabbingCircleComputer
StabbingCircleComputer()
DGtal::StabbingCircleComputer
Aim: On-line recognition of a digital circular arcs (DCA) defined as a sequence of connected grid edg...
Definition: StabbingCircleComputer.h:112
DGtal::StabbingCircleComputer::isValid
bool isValid() const
DGtal::StabbingCircleComputer::PInCirclePred
functors::Point2ShapePredicate< Circle, false, true > PInCirclePred
Definition: StabbingCircleComputer.h:137
DGtal::StabbingCircleComputer::isExtendableFront
bool isExtendableFront()
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::StabbingCircleComputer::isStraight
bool isStraight() const
DGtal::StabbingCircleComputer::extendFront
bool extendFront()
DGtal::StabbingCircleComputer::operator==
bool operator==(const Self &other) const
DGtal::StabbingCircleComputer::className
std::string className() const
DGtal::StabbingCircleComputer::mySegPtr
StabbingLineComputerPtr mySegPtr
Definition: StabbingCircleComputer.h:300
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::StabbingCircleComputer::operator=
Self & operator=(const Self &other)
DGtal::StabbingCircleComputer::ConstIterator
TConstIterator ConstIterator
Definition: StabbingCircleComputer.h:118
DGtal::StabbingCircleComputer::QInCirclePred
functors::Point2ShapePredicate< Circle, true, true > QInCirclePred
Definition: StabbingCircleComputer.h:139
DGtal::StabbingCircleComputer::getReverse
Reverse getReverse() const
DGtal::concepts::ConceptUtils::SameType
Definition: ConceptUtils.h:106
DGtal::StabbingCircleComputer::Self
StabbingCircleComputer< ConstIterator > Self
Definition: StabbingCircleComputer.h:119
DGtal::StabbingCircleComputer::getSelf
Self getSelf() const
DGtal::StabbingCircleComputer::Point
Pair::first_type Point
Definition: StabbingCircleComputer.h:126
DGtal::StabbingCircleComputer::StabbingLineComputerPtr
CowPtr< StabbingLineComputer< ConstIterator > > StabbingLineComputerPtr
Definition: StabbingCircleComputer.h:132
DGtal::StabbingCircleComputer::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::StabbingCircleComputer::end
ConstIterator end() const
DGtal::StabbingCircleComputer::myBegin
ConstIterator myBegin
Definition: StabbingCircleComputer.h:292
DGtal::StabbingCircleComputer::init
void init(const ConstIterator &anIt)
DGtal::StabbingCircleComputer::isExtendableBack
bool isExtendableBack()
DGtal::StabbingCircleComputer::getStabbingLineComputerPtr
StabbingLineComputerPtr getStabbingLineComputerPtr() const
DGtal::StabbingCircleComputer::myFlagIsInit
bool myFlagIsInit
Definition: StabbingCircleComputer.h:309
DGtal::StabbingCircleComputer::getSeparatingCircle
Circle getSeparatingCircle() const
DGtal::IteratorCirculatorTraits::Value
IC::value_type Value
Definition: IteratorCirculatorTraits.h:303
DGtal::StabbingCircleComputer::operator!=
bool operator!=(const Self &other) const
DGtal::CowPtr
Aim: Copy on write shared pointer.
Definition: CowPtr.h:67