Loading [MathJax]/extensions/TeX/AMSsymbols.js
DGtal 2.0.0
StabbingCircleComputer.h
1
16
17#pragma once
18
30
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#include "boost/iterator/reverse_iterator.hpp"
55
57
58namespace DGtal
59{
60
62 // template class StabbingCircleComputer
112 template <typename TConstIterator>
114 {
115
116 public:
117
118 //requiered types
119 typedef TConstIterator ConstIterator;
122
123 //point type
125 //Pair::first_type and Pair::second_type should be the same type;
127 typedef typename Pair::first_type Point;
128 BOOST_STATIC_ASSERT(( Point::dimension == 2 ));
129
130 private:
131
132 //other types used for the recognition
135
136 //Predicates used to decide whether the current circle is still seperating or not
141
142 // ----------------------- Standard services ------------------------------
143 public:
144
149
154 StabbingCircleComputer ( const Self& other );
155
161 Self& operator= ( const Self& other );
162
167
175 bool operator==( const Self & other) const;
176
184 bool operator!=( const Self & other) const;
185
189 Self getSelf() const;
190
195
196
197 // ----------------------- Interface --------------------------------------
198 public:
199
204 bool isValid() const;
205
210
215
216 //------------------ accessors -------------------------------
217
222 bool isStraight() const;
223
230
235
236 // ----------------------- growth operations --------------------------------------
237
242 void init(const ConstIterator& anIt);
243
250
257
264
271
272 //------------------ display -------------------------------
277 void selfDisplay ( std::ostream & out ) const;
278
279
283 std::string className() const;
284
285
286 // ------------------------- Protected Datas ------------------------------
287 private:
288 // ------------------------- Private Datas --------------------------------
289 private:
311
312 // ------------------------- Hidden services ------------------------------
313 protected:
314
315
316 private:
317
318
319 // ------------------------- Internals ------------------------------------
320 private:
321
341 template <typename TIterator>
342 bool isCircularlySeparable(const TIterator& itb, const TIterator& ite,
343 const Point& aPole,
344 Point& Pf, Point& Pl, Point& Qf, Point& Ql);
345
346 // ------------------------- Private Datas --------------------------------
347 private:
348
349
350 }; // end of class StabbingCircleComputer
351
352
359 template <typename TConstIterator>
360 std::ostream&
361 operator<< ( std::ostream & out, const StabbingCircleComputer<TConstIterator> & object );
362
363} // namespace DGtal
364
365
367// Includes inline functions.
368#include "DGtal/geometry/curves/StabbingCircleComputer.ih"
369
370// //
372
373#endif // !defined StabbingCircleComputer_h
374
375#undef StabbingCircleComputer_RECURSES
376#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
StabbingCircleComputer< ReverseIterator< ConstIterator > > Reverse
Aim: Predicate returning 'true' iff a given point is in the 'interior' of a given shape,...
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)