DGtal  1.3.beta
Public Types | Public Member Functions | Private Attributes
DGtal::Flower2D< TSpace > Class Template Referencefinal

Aim: Model of the concept StarShaped represents any flower with k-petals in the plane. More...

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

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

Public Types

typedef TSpace Space
 
typedef Space::RealPoint RealPoint
 
typedef Space::RealVector RealVector
 
- Public Types inherited from DGtal::StarShaped2D< TSpace >
typedef TSpace Space
 
typedef Space::RealPoint RealPoint
 

Public Member Functions

 Flower2D ()=delete
 
 Flower2D (const double x0, const double y0, const double r, const double smallr, const unsigned int k, const double phi)
 
 Flower2D (const RealPoint &aPoint, const double r, const double smallr, const unsigned int k, const double phi)
 
 Flower2D (const Flower2D &other)
 
Flower2Doperator= (const Flower2D &other)=delete
 
 ~Flower2D ()=default
 
RealPoint getLowerBound () const
 
RealPoint getUpperBound () const
 
RealPoint center () const
 
void moveTo (const RealPoint &newCenter)
 
double parameter (const RealPoint &p) const
 
RealPoint x (const double t) const
 
RealVector xp (const double t) const
 
RealVector xpp (const double t) const
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 
- Public Member Functions inherited from DGtal::StarShaped2D< TSpace >
 StarShaped2D ()=default
 
 StarShaped2D (const StarShaped2D &other)=delete
 
StarShaped2Doperator= (const StarShaped2D &other)=delete
 
virtual ~StarShaped2D ()=default
 
virtual RealPoint interiorPoint () const
 
Orientation orientation (const RealPoint &p) const
 
RealPoint tangent (const double t) const
 
RealPoint normal (const double t) const
 
double curvature (const double t) const
 
double arclength (const double t1, double t2, const unsigned int nb) const
 
RealPoint findIntersection (const RealPoint &inner, const RealPoint &outer, const double epsilon) const
 
RealPoint closestPointWithWitnesses (const RealPoint &p, const RealPoint &left, const RealPoint &right, const int step) const
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Private Attributes

RealPoint myCenter
 
double myRadius
 
double myVarRadius
 
unsigned int myK
 
double myPhi
 

Detailed Description

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

Aim: Model of the concept StarShaped represents any flower with k-petals in the plane.

Description of template class 'Flower2D'

NB: A backport from ImaGene.

Examples
geometry/curves/estimation/exampleCurvature.cpp, and topology/digitalSetToCubicalComplexes2D.cpp.

Definition at line 64 of file Flower2D.h.

Member Typedef Documentation

◆ RealPoint

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

Definition at line 70 of file Flower2D.h.

◆ RealVector

template<typename TSpace >
typedef Space::RealVector DGtal::Flower2D< TSpace >::RealVector

Definition at line 71 of file Flower2D.h.

◆ Space

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

Definition at line 69 of file Flower2D.h.

Constructor & Destructor Documentation

◆ Flower2D() [1/4]

template<typename TSpace >
DGtal::Flower2D< TSpace >::Flower2D ( )
delete

Constructor. Forbidden by default.

◆ Flower2D() [2/4]

template<typename TSpace >
DGtal::Flower2D< TSpace >::Flower2D ( const double  x0,
const double  y0,
const double  r,
const double  smallr,
const unsigned int  k,
const double  phi 
)

Constructor.

Parameters
x0the x-coordinate of the flower center.
y0the y-coordinate of the flower center.
rthe radius of the flower.
smallrthe variable small radius of the flower.
kthe number of flower extremeties.
phithe phase of the flower (in radian).

◆ Flower2D() [3/4]

template<typename TSpace >
DGtal::Flower2D< TSpace >::Flower2D ( const RealPoint aPoint,
const double  r,
const double  smallr,
const unsigned int  k,
const double  phi 
)

Constructor.

Parameters
aPointthe flower center.
rthe radius of the flower.
smallrthe variable small radius of the flower.
kthe number of flower extremeties.
phithe phase of the flower (in radian).

◆ Flower2D() [4/4]

template<typename TSpace >
DGtal::Flower2D< TSpace >::Flower2D ( const Flower2D< TSpace > &  other)

Copy constructor.

Parameters
otherthe object to clone.

◆ ~Flower2D()

template<typename TSpace >
DGtal::Flower2D< TSpace >::~Flower2D ( )
default

Destructor.

Member Function Documentation

◆ center()

template<typename TSpace >
RealPoint DGtal::Flower2D< TSpace >::center ( ) const
inlinevirtual
Returns
the center of the star-shaped object.

Implements DGtal::StarShaped2D< TSpace >.

Definition at line 152 of file Flower2D.h.

153  {
154  return myCenter;
155  }

References DGtal::Flower2D< TSpace >::myCenter.

◆ getLowerBound()

template<typename TSpace >
RealPoint DGtal::Flower2D< TSpace >::getLowerBound ( ) const
inlinevirtual
Returns
the lower bound of the shape bounding box.

Implements DGtal::StarShaped2D< TSpace >.

Definition at line 135 of file Flower2D.h.

136  {
137  return myCenter - (myRadius + myVarRadius);
138  }

References DGtal::Flower2D< TSpace >::myCenter, DGtal::Flower2D< TSpace >::myRadius, and DGtal::Flower2D< TSpace >::myVarRadius.

◆ getUpperBound()

template<typename TSpace >
RealPoint DGtal::Flower2D< TSpace >::getUpperBound ( ) const
inlinevirtual
Returns
the upper bound of the shape bounding box.

Implements DGtal::StarShaped2D< TSpace >.

Definition at line 144 of file Flower2D.h.

145  {
146  return myCenter + (myRadius + myVarRadius);
147  }

References DGtal::Flower2D< TSpace >::myCenter, DGtal::Flower2D< TSpace >::myRadius, and DGtal::Flower2D< TSpace >::myVarRadius.

◆ isValid()

template<typename TSpace >
bool DGtal::Flower2D< TSpace >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

◆ moveTo()

template<typename TSpace >
void DGtal::Flower2D< TSpace >::moveTo ( const RealPoint newCenter)
inlinevirtual

Modify the shape center

Parameters
newCenterthe new center position

Implements DGtal::StarShaped2D< TSpace >.

Definition at line 162 of file Flower2D.h.

163  {
164  myCenter = newCenter;
165  }

References DGtal::Flower2D< TSpace >::myCenter.

◆ operator=()

template<typename TSpace >
Flower2D& DGtal::Flower2D< TSpace >::operator= ( const Flower2D< TSpace > &  other)
delete

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'. Forbidden by default.

◆ parameter()

template<typename TSpace >
double DGtal::Flower2D< TSpace >::parameter ( const RealPoint p) const
virtual
Parameters
pany point in the plane.
Returns
the angle parameter between 0 and 2*Pi corresponding to this point for the shape.

Implements DGtal::StarShaped2D< TSpace >.

◆ selfDisplay()

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

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

◆ x()

template<typename TSpace >
RealPoint DGtal::Flower2D< TSpace >::x ( const double  t) const
virtual
Parameters
tany angle between 0 and 2*Pi.
Returns
the vector (x(t),y(t)) which is the position on the shape boundary.

Implements DGtal::StarShaped2D< TSpace >.

◆ xp()

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

Implements DGtal::StarShaped2D< TSpace >.

◆ xpp()

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

Implements DGtal::StarShaped2D< TSpace >.

Field Documentation

◆ myCenter

template<typename TSpace >
RealPoint DGtal::Flower2D< TSpace >::myCenter
private

◆ myK

template<typename TSpace >
unsigned int DGtal::Flower2D< TSpace >::myK
private

the number of flower extremeties.

Definition at line 221 of file Flower2D.h.

◆ myPhi

template<typename TSpace >
double DGtal::Flower2D< TSpace >::myPhi
private

the phase of the flower (in radian).

Definition at line 226 of file Flower2D.h.

◆ myRadius

template<typename TSpace >
double DGtal::Flower2D< TSpace >::myRadius
private

Radius of the flower.

Definition at line 211 of file Flower2D.h.

Referenced by DGtal::Flower2D< TSpace >::getLowerBound(), and DGtal::Flower2D< TSpace >::getUpperBound().

◆ myVarRadius

template<typename TSpace >
double DGtal::Flower2D< TSpace >::myVarRadius
private

the variable small radius of the flower.

Definition at line 216 of file Flower2D.h.

Referenced by DGtal::Flower2D< TSpace >::getLowerBound(), and DGtal::Flower2D< TSpace >::getUpperBound().


The documentation for this class was generated from the following file:
DGtal::Flower2D::myRadius
double myRadius
Definition: Flower2D.h:211
DGtal::Flower2D::myVarRadius
double myVarRadius
Definition: Flower2D.h:216
DGtal::Flower2D::myCenter
RealPoint myCenter
Definition: Flower2D.h:206