DGtal  0.9.3beta
Public Types | Public Member Functions | Private Member Functions
DGtal::StarShaped2D< TSpace > Class Template Referenceabstract

#include <DGtal/shapes/parametric/StarShaped2D.h>

Inheritance diagram for DGtal::StarShaped2D< TSpace >:
[legend]

Public Types

typedef TSpace Space
 
typedef Space::Point Point
 
typedef Space::RealPoint RealPoint
 

Public Member Functions

 StarShaped2D ()
 
 ~StarShaped2D ()
 
virtual RealPoint interiorPoint () const
 
virtual RealPoint getLowerBound () const =0
 
virtual RealPoint getUpperBound () const =0
 
virtual RealPoint center () const =0
 
virtual double parameter (const RealPoint &p) const =0
 
virtual RealPoint x (const double t) const =0
 
virtual RealPoint xp (const double t) const =0
 
virtual RealPoint xpp (const double t) const =0
 
Orientation orientation (const RealPoint &p) const
 
RealPoint tangent (double t) const
 
RealPoint normal (double t) const
 
double curvature (double t) const
 
double arclength (double t1, double t2, unsigned int nb) const
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Private Member Functions

StarShaped2Doperator= (const StarShaped2D &other)
 

Detailed Description

template<typename TSpace>
class DGtal::StarShaped2D< TSpace >

Description of template class 'StarShaped2D'

Aim: Abstract class that represents any star-shaped object in dimension 2. Such a shape as a center and any segment from this center to the shape boundary is included in the shape. These shapes can thus be parameterized by an angle 't' turning around the center.

StarShaped2D and its derived classes are models of CEuclideanBoundedShape and CEuclideanOrientedShape.

NB: A backport from ImaGene.

Template Parameters
TSpacespace in which the shape is defined.

Definition at line 73 of file StarShaped2D.h.

Member Typedef Documentation

template<typename TSpace >
typedef Space::Point DGtal::StarShaped2D< TSpace >::Point

Definition at line 78 of file StarShaped2D.h.

template<typename TSpace >
typedef Space::RealPoint DGtal::StarShaped2D< TSpace >::RealPoint

Definition at line 79 of file StarShaped2D.h.

template<typename TSpace >
typedef TSpace DGtal::StarShaped2D< TSpace >::Space

Definition at line 77 of file StarShaped2D.h.

Constructor & Destructor Documentation

template<typename TSpace >
DGtal::StarShaped2D< TSpace >::StarShaped2D ( )
inline

Constructor.

Definition at line 84 of file StarShaped2D.h.

85  {}
template<typename TSpace >
DGtal::StarShaped2D< TSpace >::~StarShaped2D ( )

Destructor.

Member Function Documentation

template<typename TSpace >
double DGtal::StarShaped2D< TSpace >::arclength ( double  t1,
double  t2,
unsigned int  nb 
) const
Parameters
t1any angle between 0 and 2*Pi.
t2any angle between 0 and 2*Pi, further from [t1].
nbthe number of points used to estimate the arclength between x(t1) and x(t2).
Returns
the estimated arclength.
template<typename TSpace >
virtual RealPoint DGtal::StarShaped2D< TSpace >::center ( ) const
pure virtual
template<typename TSpace >
double DGtal::StarShaped2D< TSpace >::curvature ( double  t) const
Parameters
tany angle between 0 and 2*Pi.
Returns
the algebraic curvature at point (x(t),y(t)), positive is convex, negative is concave when shape is to the left and the shape boundary is followed counterclockwise.
template<typename TSpace >
virtual RealPoint DGtal::StarShaped2D< TSpace >::getLowerBound ( ) const
pure virtual
template<typename TSpace >
virtual RealPoint DGtal::StarShaped2D< TSpace >::getUpperBound ( ) const
pure virtual
template<typename TSpace >
virtual RealPoint DGtal::StarShaped2D< TSpace >::interiorPoint ( ) const
inlinevirtual
Returns
a point p such that 'isInside(p)' returns 'true'.

Definition at line 97 of file StarShaped2D.h.

References DGtal::StarShaped2D< TSpace >::center().

98  {
99  return center();
100  }
virtual RealPoint center() const =0
template<typename TSpace >
bool DGtal::StarShaped2D< TSpace >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.
template<typename TSpace >
RealPoint DGtal::StarShaped2D< TSpace >::normal ( double  t) const
Parameters
tany angle between 0 and 2*Pi.
Returns
the vector (x''(t),y''(t)) made unitary which is the unit normal to the shape boundary looking inside the shape.
template<typename TSpace >
StarShaped2D& DGtal::StarShaped2D< TSpace >::operator= ( const StarShaped2D< TSpace > &  other)
private

Constructor. Forbidden by default (protected to avoid g++ warnings). Copy constructor.

Parameters
otherthe object to clone. Forbidden by default. Assignment.
otherthe object to copy.
Returns
a reference on 'this'. Forbidden by default.
template<typename TSpace >
Orientation DGtal::StarShaped2D< TSpace >::orientation ( const RealPoint p) const

Return the orienatation of a point with respect to a shape.

Parameters
pinput point
Returns
the orientation of the point (<0 means inside, ...)
template<typename TSpace >
virtual double DGtal::StarShaped2D< TSpace >::parameter ( const RealPoint p) const
pure virtual
Parameters
pany point in the plane.
Returns
the angle parameter between 0 and 2*Pi corresponding to this point for the shape.

Implemented in DGtal::AccFlower2D< TSpace >, DGtal::Flower2D< TSpace >, DGtal::Ellipse2D< TSpace >, DGtal::NGon2D< TSpace >, and DGtal::Ball2D< TSpace >.

template<typename TSpace >
void DGtal::StarShaped2D< TSpace >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.
template<typename TSpace >
RealPoint DGtal::StarShaped2D< TSpace >::tangent ( double  t) const
Parameters
tany angle between 0 and 2*Pi.
Returns
the vector (x'(t),y'(t)) made unitary which is the unit tangent to the shape boundary.
template<typename TSpace >
virtual RealPoint DGtal::StarShaped2D< TSpace >::x ( const double  t) const
pure virtual
Parameters
tany angle between 0 and 2*Pi.
Returns
the vector (x(t),y(t)) which is the position on the shape boundary.

Implemented in DGtal::AccFlower2D< TSpace >, DGtal::Flower2D< TSpace >, DGtal::Ellipse2D< TSpace >, DGtal::NGon2D< TSpace >, and DGtal::Ball2D< TSpace >.

template<typename TSpace >
virtual RealPoint DGtal::StarShaped2D< TSpace >::xp ( const double  t) const
pure virtual
Parameters
tany angle between 0 and 2*Pi.
Returns
the vector (x'(t),y'(t)) which is the tangent to the shape boundary.

Implemented in DGtal::AccFlower2D< TSpace >, DGtal::Flower2D< TSpace >, DGtal::Ellipse2D< TSpace >, DGtal::NGon2D< TSpace >, and DGtal::Ball2D< TSpace >.

template<typename TSpace >
virtual RealPoint DGtal::StarShaped2D< TSpace >::xpp ( const double  t) const
pure virtual
Parameters
tany angle between 0 and 2*Pi.
Returns
the vector (x''(t),y''(t)).

Implemented in DGtal::AccFlower2D< TSpace >, DGtal::Flower2D< TSpace >, DGtal::Ellipse2D< TSpace >, DGtal::NGon2D< TSpace >, and DGtal::Ball2D< TSpace >.


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