DGtal
0.9.4.1
|
#include <DGtal/shapes/parametric/StarShaped2D.h>
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 |
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 Member Functions | |
StarShaped2D & | operator= (const StarShaped2D &other) |
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.
TSpace | space in which the shape is defined. |
Definition at line 74 of file StarShaped2D.h.
typedef Space::Point DGtal::StarShaped2D< TSpace >::Point |
Definition at line 79 of file StarShaped2D.h.
typedef Space::RealPoint DGtal::StarShaped2D< TSpace >::RealPoint |
Definition at line 80 of file StarShaped2D.h.
typedef TSpace DGtal::StarShaped2D< TSpace >::Space |
Definition at line 78 of file StarShaped2D.h.
|
inline |
DGtal::StarShaped2D< TSpace >::~StarShaped2D | ( | ) |
Destructor.
double DGtal::StarShaped2D< TSpace >::arclength | ( | double | t1, |
double | t2, | ||
unsigned int | nb | ||
) | const |
t1 | any angle between 0 and 2*Pi. |
t2 | any angle between 0 and 2*Pi, further from [t1]. |
nb | the number of points used to estimate the arclength between x(t1) and x(t2). |
|
pure virtual |
Implemented in DGtal::AccFlower2D< TSpace >, DGtal::Flower2D< TSpace >, DGtal::Ellipse2D< TSpace >, DGtal::NGon2D< TSpace >, and DGtal::Ball2D< TSpace >.
Referenced by DGtal::StarShaped2D< TSpace >::interiorPoint().
RealPoint DGtal::StarShaped2D< TSpace >::closestPointWithWitnesses | ( | const RealPoint & | p, |
const RealPoint & | left, | ||
const RealPoint & | right, | ||
const int | step | ||
) | const |
Return a point that lies between the projection of left and right and that is the closest regarding the \(L_2\) norm
p | the point to be projected |
left | a point that is supposed to be projected left of p (regarding the angle) |
right | a point that is supposed to be projected right of p (regarding the angle) |
step | precision of the approximation |
double DGtal::StarShaped2D< TSpace >::curvature | ( | double | t | ) | const |
t | any angle between 0 and 2*Pi. |
RealPoint DGtal::StarShaped2D< TSpace >::findIntersection | ( | const RealPoint & | inner, |
const RealPoint & | outer, | ||
const double | epsilon | ||
) | const |
Return a point on the segment [inner;outer] that is at most \(\epsilon\) from the shape in \(L_2\) norm.
inner | a point that is inside the shape |
outer | a point that is outside the shape |
epsilon | error parameter |
|
pure virtual |
Implemented in DGtal::AccFlower2D< TSpace >, DGtal::Flower2D< TSpace >, DGtal::Ellipse2D< TSpace >, DGtal::NGon2D< TSpace >, and DGtal::Ball2D< TSpace >.
|
pure virtual |
Implemented in DGtal::AccFlower2D< TSpace >, DGtal::Flower2D< TSpace >, DGtal::Ellipse2D< TSpace >, DGtal::NGon2D< TSpace >, and DGtal::Ball2D< TSpace >.
|
inlinevirtual |
Definition at line 98 of file StarShaped2D.h.
References DGtal::StarShaped2D< TSpace >::center().
bool DGtal::StarShaped2D< TSpace >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
RealPoint DGtal::StarShaped2D< TSpace >::normal | ( | double | t | ) | const |
t | any angle between 0 and 2*Pi. |
|
private |
Constructor. Forbidden by default (protected to avoid g++ warnings). Copy constructor.
other | the object to clone. Forbidden by default. Assignment. |
other | the object to copy. |
Orientation DGtal::StarShaped2D< TSpace >::orientation | ( | const RealPoint & | p | ) | const |
Return the orienatation of a point with respect to a shape.
p | input point |
|
pure virtual |
p | any point in the plane. |
Implemented in DGtal::AccFlower2D< TSpace >, DGtal::Flower2D< TSpace >, DGtal::Ellipse2D< TSpace >, DGtal::NGon2D< TSpace >, and DGtal::Ball2D< TSpace >.
void DGtal::StarShaped2D< TSpace >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
RealPoint DGtal::StarShaped2D< TSpace >::tangent | ( | double | t | ) | const |
t | any angle between 0 and 2*Pi. |
|
pure virtual |
t | any angle between 0 and 2*Pi. |
Implemented in DGtal::AccFlower2D< TSpace >, DGtal::Flower2D< TSpace >, DGtal::Ellipse2D< TSpace >, DGtal::NGon2D< TSpace >, and DGtal::Ball2D< TSpace >.
|
pure virtual |
t | any angle between 0 and 2*Pi. |
Implemented in DGtal::AccFlower2D< TSpace >, DGtal::Flower2D< TSpace >, DGtal::Ellipse2D< TSpace >, DGtal::NGon2D< TSpace >, and DGtal::Ball2D< TSpace >.
|
pure virtual |
t | any angle between 0 and 2*Pi. |
Implemented in DGtal::AccFlower2D< TSpace >, DGtal::Flower2D< TSpace >, DGtal::Ellipse2D< TSpace >, DGtal::NGon2D< TSpace >, and DGtal::Ball2D< TSpace >.