DGtal  0.9.2
PredicateFromOrientationFunctor2.h
1 
17 #pragma once
18 
31 #if defined(PredicateFromOrientationFunctor2_RECURSES)
32 #error Recursive header files inclusion detected in PredicateFromOrientationFunctor2.h
33 #else // defined(PredicateFromOrientationFunctor2_RECURSES)
34 
35 #define PredicateFromOrientationFunctor2_RECURSES
36 
37 #if !defined PredicateFromOrientationFunctor2_h
38 
39 #define PredicateFromOrientationFunctor2_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 
46 #include "DGtal/base/Alias.h"
47 #include "DGtal/base/BasicFunctors.h"
48 #include "DGtal/geometry/tools/determinant/COrientationFunctor2.h"
50 
51 namespace DGtal
52 {
53 
55  // template class PredicateFromOrientationFunctor2
80  template <typename TOrientationFunctor, bool acceptNeg = false, bool acceptZero = false >
82  {
83  // ----------------------- Types ------------------------------------------
84  public:
88  typedef TOrientationFunctor Functor;
90 
94  typedef typename Functor::Point Point;
95 
101 
102  // ----------------------- Standard services ------------------------------
103  public:
104 
110 
116  void init( const Point& aPoint1, const Point& aPoint2 );
117 
124  bool operator()( const Point& aPoint ) const;
125 
134  bool operator()(const Point& aPoint1, const Point& aPoint2, const Point& aPoint3 ) const;
135 
136  // ----------------------- Interface --------------------------------------
137  public:
138 
143  void selfDisplay ( std::ostream & out ) const;
144 
149  bool isValid() const;
150 
151  // ------------------------- Private Datas --------------------------------
152  private:
153 
157  Functor* const myFunctorPtr;
158 
162  const MyThresholder myThresholder;
163 
164 
165  }; // end of class PredicateFromOrientationFunctor2
166 
167 
174  template <typename TOrientationFunctor, bool acceptNeg, bool acceptZero>
175  std::ostream&
176  operator<< ( std::ostream & out, const PredicateFromOrientationFunctor2<TOrientationFunctor, acceptNeg, acceptZero > & object );
177 
178 } // namespace DGtal
179 
180 
182 // Includes inline functions.
183 #include "DGtal/geometry/tools/determinant/PredicateFromOrientationFunctor2.ih"
184 
185 // //
187 
188 #endif // !defined PredicateFromOrientationFunctor2_h
189 
190 #undef PredicateFromOrientationFunctor2_RECURSES
191 #endif // else defined(PredicateFromOrientationFunctor2_RECURSES)
void init(const Point &aPoint1, const Point &aPoint2)
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: Alias.h:182
Aim: This concept is a refinement of COrientationFunctor, useful for simple algebraic curves that can...
Aim: A small functor with an operator () that compares one value to a threshold value according to tw...
Aim: Small adapter to models of COrientationFunctor2. It is a model of concepts::CPointPredicate. It is also a ternary predicate on points, useful for basic geometric tasks such as convex hull computation.
bool operator()(const Point &aPoint) const
BOOST_CONCEPT_ASSERT((concepts::COrientationFunctor2< Functor >))
DGtal is the top-level namespace which contains all DGtal functions and types.
void selfDisplay(std::ostream &out) const
PredicateFromOrientationFunctor2(Alias< Functor > aFunctor)
functors::Thresholder< typename Functor::Value, acceptNeg, acceptZero > MyThresholder