DGtal  1.1.0
Public Types | Public Member Functions | Private Attributes
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. More...
 
typedef TParametricShape::RealPoint RealPoint
 Type of const iterator on points. More...
 
typedef double Quantity
 Type of the functor output. More...
 

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. More...
 

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.

◆ 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) {};

◆ ~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  }

References DGtal::PointVector< dim, TEuclideanRing, TContainer >::L_infty, and DGtal::ParametricShapeArcLengthFunctor< TParametricShape >::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< dim, TEuclideanRing, TContainer >::L_infty, and DGtal::ParametricShapeArcLengthFunctor< TParametricShape >::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.

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 DGtal::ParametricShapeArcLengthFunctor< TParametricShape >::operator()().


The documentation for this class was generated from the following file:
DGtal::ParametricShapeArcLengthFunctor::myShape
const ParametricShape & myShape
Reference of the implicit shape.
Definition: ParametricShapeArcLengthFunctor.h:148
DGtal::PointVector::L_infty
@ L_infty
Definition: PointVector.h:1488
DGtal::PointVector
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:593