DGtal  1.5.beta
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)
35 #define PolarPointComparatorBy2x2DetComputer_RECURSES
36 
37 #if !defined PolarPointComparatorBy2x2DetComputer_h
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 
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 
217 
223 
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)
Aim: Class that implements a binary point predicate, which is able to compare the position of two giv...
PolarPointComparatorBy2x2DetComputer(const PolarPointComparatorBy2x2DetComputer &other)
PolarPointComparatorBy2x2DetComputer & operator=(const PolarPointComparatorBy2x2DetComputer &other)
bool isBefore(const Point &aU, const Point &aV) const
functors::Thresholder< ResultInteger, false, false > CustomThresholder
bool operator()(const Point &aPoint1, const Point &aPoint2) const
BOOST_CONCEPT_ASSERT((C2x2DetComputer< DetComputer >))
std::ostream & operator<<(std::ostream &out, const FunctorHolder< FunctorStorage, NeedDereference > &object)
Overloads 'operator<<' for displaying objects of class FunctorHolder.
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: This concept gathers all models that are able to compute the (sign of the) determinant of a 2x2 ...
const Point aPoint(3, 4)