DGtal 1.3.0
|
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. More...
#include <DGtal/geometry/tools/determinant/PredicateFromOrientationFunctor2.h>
Public Types | |
typedef TOrientationFunctor | Functor |
typedef Functor::Point | Point |
typedef functors::Thresholder< typename Functor::Value, acceptNeg, acceptZero > | MyThresholder |
Public Member Functions | |
BOOST_CONCEPT_ASSERT ((concepts::COrientationFunctor2< Functor >)) | |
PredicateFromOrientationFunctor2 (Alias< Functor > aFunctor) | |
void | init (const Point &aPoint1, const Point &aPoint2) |
bool | operator() (const Point &aPoint) const |
bool | operator() (const Point &aPoint1, const Point &aPoint2, const Point &aPoint3) const |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Private Attributes | |
Functor *const | myFunctorPtr |
const MyThresholder | myThresholder |
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.
Description of template class 'PredicateFromOrientationFunctor2'
Once a orientation functor is defined, you can adapt it as follows:
The test can be done in one or two separate steps as follows:
The default behavior is to return 'true' for strictly positive functor values. You can however custom this behavior with the last two template parameters.
TOrientationFunctor | a model of COrientationFunctor2 |
acceptNeg | bool equal to 'true' to get a predicate returning 'true' for strictly negative values of the functor, but equal to 'false' to get a predicate returning 'true' for strictly positive values (default). |
acceptZero | bool equal to 'true' to get a predicate returning 'true' for null values, but equal to 'false' for strictly positive or negative values (default). |
Definition at line 81 of file PredicateFromOrientationFunctor2.h.
typedef TOrientationFunctor DGtal::PredicateFromOrientationFunctor2< TOrientationFunctor, acceptNeg, acceptZero >::Functor |
Type of the adapter orientation functor
Definition at line 88 of file PredicateFromOrientationFunctor2.h.
typedef functors::Thresholder<typename Functor::Value, acceptNeg, acceptZero> DGtal::PredicateFromOrientationFunctor2< TOrientationFunctor, acceptNeg, acceptZero >::MyThresholder |
Type of the thresholder, which compares the result of the functor to zero
Definition at line 100 of file PredicateFromOrientationFunctor2.h.
typedef Functor::Point DGtal::PredicateFromOrientationFunctor2< TOrientationFunctor, acceptNeg, acceptZero >::Point |
Type of input points
Definition at line 94 of file PredicateFromOrientationFunctor2.h.
DGtal::PredicateFromOrientationFunctor2< TOrientationFunctor, acceptNeg, acceptZero >::PredicateFromOrientationFunctor2 | ( | Alias< Functor > | aFunctor | ) |
Constructor
aFunctor | any orientation functor to alias |
DGtal::PredicateFromOrientationFunctor2< TOrientationFunctor, acceptNeg, acceptZero >::BOOST_CONCEPT_ASSERT | ( | (concepts::COrientationFunctor2< Functor >) | ) |
void DGtal::PredicateFromOrientationFunctor2< TOrientationFunctor, acceptNeg, acceptZero >::init | ( | const Point & | aPoint1, |
const Point & | aPoint2 | ||
) |
Initialization of myFunctor
aPoint1 | a first point |
aPoint2 | a second point |
Referenced by basicUsage().
bool DGtal::PredicateFromOrientationFunctor2< TOrientationFunctor, acceptNeg, acceptZero >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
bool DGtal::PredicateFromOrientationFunctor2< TOrientationFunctor, acceptNeg, acceptZero >::operator() | ( | const Point & | aPoint | ) | const |
Unary parenthesis operator
aPoint | any point |
bool DGtal::PredicateFromOrientationFunctor2< TOrientationFunctor, acceptNeg, acceptZero >::operator() | ( | const Point & | aPoint1, |
const Point & | aPoint2, | ||
const Point & | aPoint3 | ||
) | const |
Ternary parenthesis operator on three points
aPoint1 | first point |
aPoint2 | second point |
aPoint3 | third point |
void DGtal::PredicateFromOrientationFunctor2< TOrientationFunctor, acceptNeg, acceptZero >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
|
private |
a pointer to an orientation functor
Definition at line 157 of file PredicateFromOrientationFunctor2.h.
|
private |
object that thresholds the result of the functor
Definition at line 162 of file PredicateFromOrientationFunctor2.h.