DGtal  1.0.0
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DGtal::Astroid2D< TSpace > Class Template Reference

Aim: Model of the concept StarShaped represents an astroid. More...

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

Inheritance diagram for DGtal::Astroid2D< TSpace >:
[legend]
Collaboration diagram for DGtal::Astroid2D< TSpace >:
[legend]

Public Types

typedef TSpace Space
 
typedef Space::Point Point2D
 
typedef Space::RealPoint RealPoint2D
 
typedef Space::RealVector RealVector2D
 
- Public Types inherited from DGtal::StarShaped2D< TSpace >
typedef TSpace Space
 
typedef Space::Point Point
 
typedef Space::RealPoint RealPoint
 

Public Member Functions

 ~Astroid2D ()
 
 Astroid2D (const double x0, const double y0, const double a, const double b)
 
 Astroid2D (const RealPoint2D &aPoint, const double a, const double b)
 
 Astroid2D (const Point2D &aPoint, const double a, const double b)
 
RealPoint2D getLowerBound () const
 
RealPoint2D getUpperBound () const
 
RealPoint2D center () const
 
double parameter (const RealPoint2D &p) const
 
RealPoint2D x (const double t) const
 
RealVector2D xp (const double t) const
 
RealVector2D xpp (const double t) const
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 
- Public Member Functions inherited from DGtal::StarShaped2D< TSpace >
 StarShaped2D ()
 
 ~StarShaped2D ()
 
virtual RealPoint interiorPoint () const
 
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
 
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
 

Protected Member Functions

 Astroid2D ()
 

Private Member Functions

Astroid2Doperator= (const Astroid2D &other)
 

Private Attributes

RealPoint2D myCenter
 
double myA
 
double myB
 

Detailed Description

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

Aim: Model of the concept StarShaped represents an astroid.

Description of template class 'Astroid2D'

Definition at line 61 of file Astroid2D.h.

Member Typedef Documentation

◆ Point2D

template<typename TSpace>
typedef Space::Point DGtal::Astroid2D< TSpace >::Point2D

Definition at line 67 of file Astroid2D.h.

◆ RealPoint2D

template<typename TSpace>
typedef Space::RealPoint DGtal::Astroid2D< TSpace >::RealPoint2D

Definition at line 68 of file Astroid2D.h.

◆ RealVector2D

template<typename TSpace>
typedef Space::RealVector DGtal::Astroid2D< TSpace >::RealVector2D

Definition at line 69 of file Astroid2D.h.

◆ Space

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

Definition at line 66 of file Astroid2D.h.

Constructor & Destructor Documentation

◆ ~Astroid2D()

template<typename TSpace>
DGtal::Astroid2D< TSpace >::~Astroid2D ( )

Destructor.

◆ Astroid2D() [1/4]

template<typename TSpace>
DGtal::Astroid2D< TSpace >::Astroid2D ( const double  x0,
const double  y0,
const double  a,
const double  b 
)

Constructor.

Parameters
x0the x-coordinate of the astroid center.
y0the y-coordinate of the astroid center.
acoefficient along x-axis
bcoefficient along y-axis

◆ Astroid2D() [2/4]

template<typename TSpace>
DGtal::Astroid2D< TSpace >::Astroid2D ( const RealPoint2D aPoint,
const double  a,
const double  b 
)

Constructor.

Parameters
aPointthe astroid center
acoefficient along x-axis
bcoefficient along y-axis

◆ Astroid2D() [3/4]

template<typename TSpace>
DGtal::Astroid2D< TSpace >::Astroid2D ( const Point2D aPoint,
const double  a,
const double  b 
)

Constructor.

Parameters
aPointthe astroid center
acoefficient along x-axis
bcoefficient along y-axis

◆ Astroid2D() [4/4]

template<typename TSpace>
DGtal::Astroid2D< TSpace >::Astroid2D ( )
protected

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

Member Function Documentation

◆ center()

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

Implements DGtal::StarShaped2D< TSpace >.

Definition at line 127 of file Astroid2D.h.

128  {
129  return myCenter;
130  }
RealPoint2D myCenter
Definition: Astroid2D.h:171

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

◆ getLowerBound()

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

Implements DGtal::StarShaped2D< TSpace >.

Definition at line 110 of file Astroid2D.h.

111  {
112  return RealPoint2D(-myA - myCenter[0] , -myB - myCenter[1] );
113  }
RealPoint2D myCenter
Definition: Astroid2D.h:171
Space::RealPoint RealPoint2D
Definition: Astroid2D.h:68

References DGtal::Astroid2D< TSpace >::myA, DGtal::Astroid2D< TSpace >::myB, and DGtal::Astroid2D< TSpace >::myCenter.

◆ getUpperBound()

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

Implements DGtal::StarShaped2D< TSpace >.

Definition at line 119 of file Astroid2D.h.

120  {
121  return RealPoint2D(myA - myCenter[0] , myB - myCenter[1]);
122  }
RealPoint2D myCenter
Definition: Astroid2D.h:171
Space::RealPoint RealPoint2D
Definition: Astroid2D.h:68

References DGtal::Astroid2D< TSpace >::myA, DGtal::Astroid2D< TSpace >::myB, and DGtal::Astroid2D< TSpace >::myCenter.

◆ isValid()

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

Checks the validity/consistency of the object.

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

◆ operator=()

template<typename TSpace>
Astroid2D& DGtal::Astroid2D< TSpace >::operator= ( const Astroid2D< TSpace > &  other)
private

Copy constructor.

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

◆ parameter()

template<typename TSpace>
double DGtal::Astroid2D< TSpace >::parameter ( const RealPoint2D 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::Astroid2D< 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>
RealPoint2D DGtal::Astroid2D< 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>
RealVector2D DGtal::Astroid2D< 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>
RealVector2D DGtal::Astroid2D< 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

◆ myA

template<typename TSpace>
double DGtal::Astroid2D< TSpace >::myA
private

Coefficient along x-axis

Definition at line 176 of file Astroid2D.h.

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

◆ myB

template<typename TSpace>
double DGtal::Astroid2D< TSpace >::myB
private

Coefficient along y-axis

Definition at line 181 of file Astroid2D.h.

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

◆ myCenter

template<typename TSpace>
RealPoint2D DGtal::Astroid2D< TSpace >::myCenter
private

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