DGtal  0.9.2
PolarPointComparatorBy2x2DetComputer.h
1 
17 #pragma once
18 
31 #if defined(PolarPointComparatorBy2x2DetComputer_RECURSES)
32 #error Recursive header files inclusion detected in PolarPointComparatorBy2x2DetComputer.h
33 #else // defined(PolarPointComparatorBy2x2DetComputer_RECURSES)
34 
35 #define PolarPointComparatorBy2x2DetComputer_RECURSES
36 
37 #if !defined PolarPointComparatorBy2x2DetComputer_h
38 
39 #define PolarPointComparatorBy2x2DetComputer_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 
46 #include "DGtal/geometry/tools/determinant/C2x2DetComputer.h"
47 #include "DGtal/geometry/tools/determinant/Simple2x2DetComputer.h"
49 
50 namespace DGtal
51 {
52 
53  namespace functors {
54 
56  // template class PolarPointComparatorBy2x2DetComputer
77  template <typename TPoint,
78  typename TDetComputer = Simple2x2DetComputer<typename TPoint::Coordinate, DGtal::int64_t > >
80  {
81  // ----------------------- Inner types ------------------------------------
82  public:
83 
87  typedef TPoint Point;
91  typedef typename Point::Coordinate Coordinate;
95  typedef Point Vector;
96 
101  typedef TDetComputer DetComputer;
103 
107  typedef typename DetComputer::ResultInteger ResultInteger;
108 
114 
115 
116  // ----------------------- Standard services ------------------------------
117  public:
118 
124 
129  PolarPointComparatorBy2x2DetComputer(const Point& aPoint);
130 
136 
143 
144  // ----------------------- Interface --------------------------------------
145  public:
146 
151  void selfDisplay ( std::ostream & out ) const;
152 
157  bool isValid() const;
158 
163  void setPole ( const Point& aPole );
164 
180  bool operator()(const Point& aPoint1, const Point& aPoint2) const;
181 
182  // ------------------------- Internals ------------------------------------
183  private:
184 
208  bool isBefore(const Point& aU, const Point& aV) const;
209 
210  // ------------------------- Private Datas --------------------------------
211  private:
212 
216  Point myPole;
217 
222  mutable DetComputer myDetComputer;
223 
227  CustomThresholder myThresholder;
228 
229  // ------------------------- Hidden services ------------------------------
230  protected:
231 
232 
233  private:
234 
235 
236  }; // end of class PolarPointComparatorBy2x2DetComputer
237 
238 
245  template <typename TPoint, typename TDetComputer>
246  std::ostream&
247  operator<< ( std::ostream & out, const PolarPointComparatorBy2x2DetComputer<TPoint,TDetComputer> & object );
248 
249  } //namespace functors
250 
251 } // namespace DGtal
252 
253 
255 // Includes inline functions.
256 #include "DGtal/geometry/tools/PolarPointComparatorBy2x2DetComputer.ih"
257 
258 // //
260 
261 #endif // !defined PolarPointComparatorBy2x2DetComputer_h
262 
263 #undef PolarPointComparatorBy2x2DetComputer_RECURSES
264 #endif // else defined(PolarPointComparatorBy2x2DetComputer_RECURSES)
PolarPointComparatorBy2x2DetComputer & operator=(const PolarPointComparatorBy2x2DetComputer &other)
functors::Thresholder< ResultInteger, false, false > CustomThresholder
Aim: This concept gathers all models that are able to compute the (sign of the) determinant of a 2x2 ...
BOOST_CONCEPT_ASSERT((C2x2DetComputer< DetComputer >))
Aim: Class that implements a binary point predicate, which is able to compare the position of two giv...
bool isBefore(const Point &aU, const Point &aV) const
bool operator()(const Point &aPoint1, const Point &aPoint2) const
DGtal is the top-level namespace which contains all DGtal functions and types.