DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Private Attributes
DGtal::Point2ShapePredicate< TSurface, isUpward, isClosed > Class Template Reference

#include <Point2ShapePredicate.h>

Public Types

typedef TSurface::Point Point
typedef TSurface::Distance Distance

Public Member Functions

 Point2ShapePredicate (const TSurface &aSurface)
 Point2ShapePredicate (const Point2ShapePredicate &other)
bool operator() (const Point &p) const
void selfDisplay (std::ostream &out) const
 ~Point2ShapePredicate ()

Private Attributes

TSurface myS

Detailed Description

template<typename TSurface, bool isUpward, bool isClosed>
class DGtal::Point2ShapePredicate< TSurface, isUpward, isClosed >

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 \form#164:

Definition at line 95 of file Point2ShapePredicate.h.


Member Typedef Documentation

template<typename TSurface, bool isUpward, bool isClosed>
typedef TSurface::Distance DGtal::Point2ShapePredicate< TSurface, isUpward, isClosed >::Distance

Definition at line 101 of file Point2ShapePredicate.h.

template<typename TSurface, bool isUpward, bool isClosed>
typedef TSurface::Point DGtal::Point2ShapePredicate< TSurface, isUpward, isClosed >::Point

Definition at line 100 of file Point2ShapePredicate.h.


Constructor & Destructor Documentation

template<typename TSurface , bool isUpward, bool isClosed>
DGtal::Point2ShapePredicate< TSurface, isUpward, isClosed >::Point2ShapePredicate ( const TSurface &  aSurface)
inline

Constructor.

Parameters:
aSurfaceany Surface

Definition at line 50 of file Point2ShapePredicate.ih.

:
myS(aSurface)
{
}
template<typename TSurface , bool isUpward, bool isClosed>
DGtal::Point2ShapePredicate< TSurface, isUpward, isClosed >::Point2ShapePredicate ( const Point2ShapePredicate< TSurface, isUpward, isClosed > &  other)
inline

Copy constructor.

Parameters:
otherthe object to clone.

Definition at line 62 of file Point2ShapePredicate.ih.

:
myS(other.myS)
{
}
template<typename TSurface , bool isUpward, bool isClosed>
DGtal::Point2ShapePredicate< TSurface, isUpward, isClosed >::~Point2ShapePredicate ( )
inline

Destructor. Does nothing

Definition at line 44 of file Point2ShapePredicate.ih.

{
}

Member Function Documentation

template<typename TSurface , bool isUpward, bool isClosed>
bool DGtal::Point2ShapePredicate< TSurface, isUpward, isClosed >::operator() ( const Point p) const
inline
Parameters:
pany point.
Returns:
true iff p is in the interior of the shape.

Definition at line 73 of file Point2ShapePredicate.ih.

{
isUpward,
isClosed> theComparator;
return theComparator(myS.signedDistance(p),0);
}
template<typename TSurface , bool isUpward, bool isClosed>
void DGtal::Point2ShapePredicate< TSurface, isUpward, isClosed >::selfDisplay ( std::ostream &  out) const
inline

Writes/Displays the object on an output stream.

Parameters:
outthe output stream where the object is written.

Definition at line 92 of file Point2ShapePredicate.ih.

References DGtal::Point2ShapePredicate< TSurface, isUpward, isClosed >::selfDisplay().

Referenced by DGtal::Point2ShapePredicate< TSurface, isUpward, isClosed >::selfDisplay().

{
out << "[Point2ShapePredicate] :\n";
myS.selfDisplay(out);
out << "\n";
std::string orientation = (isUpward)?
"upward oriented":"downward oriented";
std::string closure = (isClosed)?
"closed":"open";
out << "(" << orientation << ", " << closure << ")\n";
}

Field Documentation

template<typename TSurface, bool isUpward, bool isClosed>
TSurface DGtal::Point2ShapePredicate< TSurface, isUpward, isClosed >::myS
private

The surface with respect to the points have to be located

Definition at line 141 of file Point2ShapePredicate.h.


The documentation for this class was generated from the following files: