DGtal 2.0.0
Loading...
Searching...
No Matches
DGtal::ParametricShapeArcLengthFunctor< TParametricShape > Class Template Reference

Aim: implements a functor that estimates the arc length of a paramtric curve. More...

#include <DGtal/geometry/curves/estimation/ParametricShapeArcLengthFunctor.h>

Public Types

typedef TParametricShape ParametricShape
 Type of parametric shape.
typedef TParametricShape::RealPoint RealPoint
 Type of const iterator on points.
typedef double Quantity
 Type of the functor output.

Public Member Functions

 ParametricShapeArcLengthFunctor ()=delete
 ParametricShapeArcLengthFunctor (const ParametricShape &aShape)
 ~ParametricShapeArcLengthFunctor ()=default
ParametricShapeArcLengthFunctoroperator= (const ParametricShapeArcLengthFunctor &other)=delete
Quantity operator() (const RealPoint &aFirstPoint, const RealPoint &aSecondPoint) const
Quantity operator() () const

Private Attributes

const ParametricShapemyShape
 Reference of the implicit shape.

Detailed Description

template<typename TParametricShape>
class DGtal::ParametricShapeArcLengthFunctor< TParametricShape >

Aim: implements a functor that estimates the arc length of a paramtric curve.

Description of template class 'ParametricShapeArcLengthFunctor'

Template Parameters
TParametricShapea model of parametric shape.

Definition at line 64 of file ParametricShapeArcLengthFunctor.h.

Member Typedef Documentation

◆ ParametricShape

template<typename TParametricShape>
typedef TParametricShape DGtal::ParametricShapeArcLengthFunctor< TParametricShape >::ParametricShape

Type of parametric shape.

Definition at line 71 of file ParametricShapeArcLengthFunctor.h.

◆ Quantity

template<typename TParametricShape>
typedef double DGtal::ParametricShapeArcLengthFunctor< TParametricShape >::Quantity

Type of the functor output.

Definition at line 77 of file ParametricShapeArcLengthFunctor.h.

◆ RealPoint

template<typename TParametricShape>
typedef TParametricShape::RealPoint DGtal::ParametricShapeArcLengthFunctor< TParametricShape >::RealPoint

Type of const iterator on points.

Definition at line 74 of file ParametricShapeArcLengthFunctor.h.

Constructor & Destructor Documentation

◆ ParametricShapeArcLengthFunctor() [1/2]

template<typename TParametricShape>
DGtal::ParametricShapeArcLengthFunctor< TParametricShape >::ParametricShapeArcLengthFunctor ( )
delete

Constructor.

Referenced by operator=().

◆ ParametricShapeArcLengthFunctor() [2/2]

template<typename TParametricShape>
DGtal::ParametricShapeArcLengthFunctor< TParametricShape >::ParametricShapeArcLengthFunctor ( const ParametricShape & aShape)
inline

Constructor.

Parameters
aShapethe input shape.

Definition at line 89 of file ParametricShapeArcLengthFunctor.h.

89: myShape(aShape) {};
Aim: implements a functor that estimates the arc length of a paramtric curve.
const ParametricShape & myShape
Reference of the implicit shape.

References myShape.

◆ ~ParametricShapeArcLengthFunctor()

template<typename TParametricShape>
DGtal::ParametricShapeArcLengthFunctor< TParametricShape >::~ParametricShapeArcLengthFunctor ( )
default

Destructor.

Member Function Documentation

◆ operator()() [1/2]

template<typename TParametricShape>
Quantity DGtal::ParametricShapeArcLengthFunctor< TParametricShape >::operator() ( ) const
inline

Compute the total length

Returns
the estimated length

Definition at line 134 of file ParametricShapeArcLengthFunctor.h.

135 {
136 //determining nbSamples from the bounding box size of the shape
137 RealPoint v = myShape.getUpperBound() - myShape.getLowerBound();
138 double n = v.norm(RealPoint::L_infty);
139 unsigned int nbSamples = (unsigned int) ceil( n*100 );
140
141 return myShape.arclength( 0,2*M_PI, nbSamples );
142 }
TParametricShape::RealPoint RealPoint
Type of const iterator on points.

References DGtal::PointVector< 3, double >::L_infty, and myShape.

◆ operator()() [2/2]

template<typename TParametricShape>
Quantity DGtal::ParametricShapeArcLengthFunctor< TParametricShape >::operator() ( const RealPoint & aFirstPoint,
const RealPoint & aSecondPoint ) const
inline

Compute the arc length between two points.

Parameters
aFirstPointthe first point
aSecondPointthe second point
Returns
the estimated arc length

Definition at line 115 of file ParametricShapeArcLengthFunctor.h.

116 {
117 //determining nbSamples from the bounding box size of the shape
118 RealPoint v = myShape.getUpperBound() - myShape.getLowerBound();
119 double n = v.norm(RealPoint::L_infty);
120 unsigned int nbSamples = (unsigned int) ceil( n*100 );
121
122 //computes the angles
123 double t = myShape.parameter( aFirstPoint );
124 double t2 = myShape.parameter( aSecondPoint );
125 return myShape.arclength( t, t2, nbSamples );
126
127 }

References DGtal::PointVector< 3, double >::L_infty, and myShape.

◆ operator=()

template<typename TParametricShape>
ParametricShapeArcLengthFunctor & DGtal::ParametricShapeArcLengthFunctor< TParametricShape >::operator= ( const ParametricShapeArcLengthFunctor< TParametricShape > & other)
delete

Assignment.

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

References ParametricShapeArcLengthFunctor().

Field Documentation

◆ myShape

template<typename TParametricShape>
const ParametricShape& DGtal::ParametricShapeArcLengthFunctor< TParametricShape >::myShape
private

Reference of the implicit shape.

Definition at line 148 of file ParametricShapeArcLengthFunctor.h.

Referenced by operator()(), operator()(), and ParametricShapeArcLengthFunctor().


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