template<typename TSurface, bool isUpward, bool isClosed>
class DGtal::functors::Point2ShapePredicate< TSurface, isUpward, isClosed >
\brief Aim: Predicate returning 'true' iff a given point is in
the 'interior' of a given shape, 'false' otherwise
@tparam TSurface a type that is a model of COrientableHypersurface.
Must separate the space in two disjoints parts (the 'interior' and the 'exterior')
and must be able to return for any given point (of type TSurface::Point)
the signed distance to itself (of type TSurface::Distance) by a method called signedDistance()
@tparam isUpward a bool for the orientation ('true' means that the interior
is the set of points of positive distance)
@tparam isClosed a bool for the closure ('true' means that the surface is included)
For instance, in 2d, you can define four shapes from one straight line of equation @f$ y = ax + b @f$:
- the set \( \{(x,y) | y > ax + b \} \)
- \( \{(x,y) | y \geq ax + b \} \)
- \( \{(x,y) | y < ax + b \} \)
\( \{(x,y) | y \leq ax + b \} \)
The second set can be defined as follows:
Then, you can create and use your half-plane as shown below:
UpClosedHalfPlane hp(line);
trace.
info() <<
"Does " << r1 <<
" belongs to hp (no)?" << std::endl;
You should get:
[StraightLine] passing through:
(upward oriented, closed)
no
Aim: Implements basic operations that will be used in Point and Vector classes.
Point2ShapePredicate(const TSurface &aSurface)
This class is a model of concepts::CPointPredicate.
- See also
- testHalfPlane.cpp
Definition at line 95 of file Point2ShapePredicate.h.