DGtal 1.3.0
Loading...
Searching...
No Matches
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)
35#define StabbingCircleComputer_RECURSES
36
37#if !defined StabbingCircleComputer_h
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
57namespace 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
194
195
196 // ----------------------- Interface --------------------------------------
197 public:
198
203 bool isValid() const;
204
209
214
215 //------------------ accessors -------------------------------
216
221 bool isStraight() const;
222
229
234
235 // ----------------------- growth operations --------------------------------------
236
241 void init(const ConstIterator& anIt);
242
249
256
263
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)
Aim: Represents a circle uniquely defined by three 2D points and that is able to return for any given...
Aim: Copy on write shared pointer.
Definition: CowPtr.h:68
Aim: On-line recognition of a digital circular arcs (DCA) defined as a sequence of connected grid edg...
CowPtr< StabbingLineComputer< ConstIterator > > StabbingLineComputerPtr
bool operator==(const Self &other) const
void selfDisplay(std::ostream &out) const
IteratorCirculatorTraits< ConstIterator >::Value Pair
StabbingCircleComputer< ConstIterator > Self
ConstIterator begin() const
bool isCircularlySeparable(const TIterator &itb, const TIterator &ite, const Point &aPole, Point &Pf, Point &Pl, Point &Qf, Point &Ql)
BOOST_STATIC_ASSERT((concepts::ConceptUtils::SameType< typename Pair::first_type, typename Pair::second_type >::value))
functors::Point2ShapePredicate< Circle, true, true > QInCirclePred
functors::Point2ShapePredicate< Circle, false, true > PInCirclePred
void init(const ConstIterator &anIt)
BOOST_STATIC_ASSERT((Point::dimension==2))
bool operator!=(const Self &other) const
StabbingCircleComputer(const Self &other)
Self & operator=(const Self &other)
std::string className() const
Circle getSeparatingCircle() const
StabbingLineComputerPtr getStabbingLineComputerPtr() const
ConstIterator end() const
CircleFrom3Points< Point > Circle
StabbingCircleComputer< ReverseIterator< ConstIterator > > Reverse
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)