DGtal 1.4.0
|
#include <DGtal/shapes/parametric/StarShaped2D.h>
Public Types | |
typedef TSpace | Space |
typedef Space::RealPoint | RealPoint |
Public Member Functions | |
StarShaped2D ()=default | |
StarShaped2D (const StarShaped2D &other)=delete | |
StarShaped2D & | operator= (const StarShaped2D &other)=delete |
virtual | ~StarShaped2D ()=default |
virtual RealPoint | interiorPoint () const |
virtual RealPoint | getLowerBound () const =0 |
virtual RealPoint | getUpperBound () const =0 |
virtual RealPoint | center () const =0 |
virtual void | moveTo (const RealPoint &newCenter)=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 (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 Member Functions | |
template<typename T > | |
bool | isAlmostEqual (T x, T y) const |
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::RealPoint DGtal::StarShaped2D< TSpace >::RealPoint |
Definition at line 79 of file StarShaped2D.h.
typedef TSpace DGtal::StarShaped2D< TSpace >::Space |
Definition at line 78 of file StarShaped2D.h.
|
default |
Constructor.
|
delete |
Copy constructor.
other | the object to clone. Forbidden by default. |
|
virtualdefault |
Destructor.
double DGtal::StarShaped2D< TSpace >::arclength | ( | const double | t1, |
double | t2, | ||
const 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::Astroid2D< TSpace >, DGtal::Astroid2D< Space >, DGtal::Ball2D< TSpace >, DGtal::Ellipse2D< TSpace >, DGtal::Flower2D< TSpace >, DGtal::Lemniscate2D< TSpace >, and DGtal::NGon2D< 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 |
Referenced by test_shape().
double DGtal::StarShaped2D< TSpace >::curvature | ( | const 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 |
Referenced by test_shape().
|
pure virtual |
Implemented in DGtal::AccFlower2D< TSpace >, DGtal::Astroid2D< TSpace >, DGtal::Astroid2D< Space >, DGtal::Ball2D< TSpace >, DGtal::Ellipse2D< TSpace >, DGtal::Flower2D< TSpace >, DGtal::Lemniscate2D< TSpace >, and DGtal::NGon2D< TSpace >.
|
pure virtual |
Implemented in DGtal::AccFlower2D< TSpace >, DGtal::Astroid2D< TSpace >, DGtal::Astroid2D< Space >, DGtal::Ball2D< TSpace >, DGtal::Ellipse2D< TSpace >, DGtal::Flower2D< TSpace >, DGtal::Lemniscate2D< TSpace >, and DGtal::NGon2D< TSpace >.
|
inlinevirtual |
Definition at line 111 of file StarShaped2D.h.
References DGtal::StarShaped2D< TSpace >::center().
|
inlineprivate |
Equality test using relative tolerance.
Definition at line 267 of file StarShaped2D.h.
bool DGtal::StarShaped2D< TSpace >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
|
pure virtual |
Move the center of the star-shaped object to a new position
newCenter | the new center position |
Implemented in DGtal::AccFlower2D< TSpace >, DGtal::Astroid2D< TSpace >, DGtal::Astroid2D< Space >, DGtal::Ball2D< TSpace >, DGtal::Ellipse2D< TSpace >, DGtal::Flower2D< TSpace >, DGtal::Lemniscate2D< TSpace >, and DGtal::NGon2D< TSpace >.
RealPoint DGtal::StarShaped2D< TSpace >::normal | ( | const double | t | ) | const |
t | any angle between 0 and 2*Pi. |
|
delete |
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::Astroid2D< TSpace >, DGtal::Astroid2D< Space >, DGtal::Ball2D< TSpace >, DGtal::Ellipse2D< TSpace >, DGtal::Flower2D< TSpace >, DGtal::Lemniscate2D< TSpace >, and DGtal::NGon2D< 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 | ( | const 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::Astroid2D< TSpace >, DGtal::Astroid2D< Space >, DGtal::Ball2D< TSpace >, DGtal::Ellipse2D< TSpace >, DGtal::Flower2D< TSpace >, DGtal::Lemniscate2D< TSpace >, and DGtal::NGon2D< TSpace >.
|
pure virtual |
t | any angle between 0 and 2*Pi. |
Implemented in DGtal::AccFlower2D< TSpace >, DGtal::Astroid2D< TSpace >, DGtal::Astroid2D< Space >, DGtal::Ball2D< TSpace >, DGtal::Ellipse2D< TSpace >, DGtal::Flower2D< TSpace >, DGtal::Lemniscate2D< TSpace >, and DGtal::NGon2D< TSpace >.
|
pure virtual |
t | any angle between 0 and 2*Pi. |
Implemented in DGtal::AccFlower2D< TSpace >, DGtal::Astroid2D< TSpace >, DGtal::Astroid2D< Space >, DGtal::Ball2D< TSpace >, DGtal::Ellipse2D< TSpace >, DGtal::Flower2D< TSpace >, DGtal::Lemniscate2D< TSpace >, and DGtal::NGon2D< TSpace >.