DGtal  1.5.beta
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)
35 #define PredicateFromOrientationFunctor2_RECURSES
36 
37 #if !defined PredicateFromOrientationFunctor2_h
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 
158 
163 
164 
165  }; // end of class PredicateFromOrientationFunctor2
166 
167 
174  template <typename TOrientationFunctor, bool acceptNeg, bool acceptZero>
175  std::ostream&
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)
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: Alias.h:183
Aim: Small adapter to models of COrientationFunctor2. It is a model of concepts::CPointPredicate....
bool operator()(const Point &aPoint) const
bool operator()(const Point &aPoint1, const Point &aPoint2, const Point &aPoint3) const
void init(const Point &aPoint1, const Point &aPoint2)
void selfDisplay(std::ostream &out) const
functors::Thresholder< typename Functor::Value, acceptNeg, acceptZero > MyThresholder
PredicateFromOrientationFunctor2(Alias< Functor > aFunctor)
BOOST_CONCEPT_ASSERT((concepts::COrientationFunctor2< Functor >))
Aim: A small functor with an operator () that compares one value to a threshold value according to tw...
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
Aim: This concept is a refinement of COrientationFunctor, useful for simple algebraic curves that can...
const Point aPoint(3, 4)