DGtal  0.9.2
DGtal::ParametricShapeArcLengthFunctor< TParametricShape > Class Template Reference

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

## Public Types

typedef TParametricShape ParametricShape

typedef TParametricShape::RealPoint RealPoint

typedef TParametricShape::Point Point

typedef TParametricShape::Point Vector

typedef Point::Coordinate Integer

typedef double Quantity

## Public Member Functions

ParametricShapeArcLengthFunctor ()

ParametricShapeArcLengthFunctor (ParametricShape *aShape)

~ParametricShapeArcLengthFunctor ()

ParametricShapeArcLengthFunctoroperator= (const ParametricShapeArcLengthFunctor &other)

Quantity operator() (const RealPoint &aFirstPoint, const RealPoint &aSecondPoint)

Quantity operator() ()

## Private Attributes

ParametricShapemyShape

## 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
 TParametricShape a model of parametric shape.

Definition at line 64 of file ParametricShapeArcLengthFunctor.h.

## Member Typedef Documentation

template<typename TParametricShape >
 typedef Point::Coordinate DGtal::ParametricShapeArcLengthFunctor< TParametricShape >::Integer

Definition at line 77 of file ParametricShapeArcLengthFunctor.h.

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

Type of parametric shape.

Definition at line 71 of file ParametricShapeArcLengthFunctor.h.

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

Definition at line 75 of file ParametricShapeArcLengthFunctor.h.

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

Type of the functor output.

Definition at line 80 of file ParametricShapeArcLengthFunctor.h.

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

Type of const iterator on points.

Definition at line 74 of file ParametricShapeArcLengthFunctor.h.

template<typename TParametricShape >
 typedef TParametricShape::Point DGtal::ParametricShapeArcLengthFunctor< TParametricShape >::Vector

Definition at line 76 of file ParametricShapeArcLengthFunctor.h.

## Constructor & Destructor Documentation

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

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

Definition at line 86 of file ParametricShapeArcLengthFunctor.h.

86 {}
template<typename TParametricShape >
 DGtal::ParametricShapeArcLengthFunctor< TParametricShape >::ParametricShapeArcLengthFunctor ( ParametricShape * aShape )
inline

Constructor.

Parameters
 aShape the input shape.

Definition at line 93 of file ParametricShapeArcLengthFunctor.h.

93 : myShape(aShape) {};
ParametricShape * myShape
Copy of the implicit shape.
template<typename TParametricShape >
 DGtal::ParametricShapeArcLengthFunctor< TParametricShape >::~ParametricShapeArcLengthFunctor ( )
inline

Destructor.

Definition at line 99 of file ParametricShapeArcLengthFunctor.h.

99 {}

## Member Function Documentation

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

Compute the arc length between two points.

Parameters
 aFirstPoint the first point aSecondPoint the second point
Returns
the estimated arc length

Definition at line 125 of file ParametricShapeArcLengthFunctor.h.

126  {
127
128  ASSERT(myShape);
129
130  //determining nbSamples from the bounding box size of the shape
131  Vector v = myShape->getUpperBound() - myShape->getLowerBound();
132  double n = (double) NumberTraits<Integer>::castToInt64_t( (const DGtal::int32_t)v.norm(Vector::L_infty) );
133  unsigned int nbSamples = (unsigned int) ceil( n*100 );
134
135  //computes the angles
136  double t = myShape->parameter( aFirstPoint );
137  double t2 = myShape->parameter( aSecondPoint );
138  return myShape->arclength (t,t2,nbSamples);
139
140  }
ParametricShape * myShape
Copy of the implicit shape.
static DGtal::int64_t castToInt64_t(const Integer &aT)
Definition: NumberTraits.h:146
boost::int32_t int32_t
signed 32-bit integer.
Definition: BasicTypes.h:72
template<typename TParametricShape >
 Quantity DGtal::ParametricShapeArcLengthFunctor< TParametricShape >::operator() ( )
inline

Compute the total length

Returns
the estimated length

Definition at line 147 of file ParametricShapeArcLengthFunctor.h.

148  {
149
150  ASSERT(myShape);
151
152  //determining nbSamples from the bounding box size of the shape
153  Vector v = myShape->getUpperBound() - myShape->getLowerBound();
154  double n = (double) NumberTraits<Integer>::castToInt64_t( (const DGtal::int32_t)v.norm(Vector::L_infty) );
155  unsigned int nbSamples = (unsigned int) ceil( n*100 );
156
157  return myShape->arclength (0,2*M_PI,nbSamples);
158  }
ParametricShape * myShape
Copy of the implicit shape.
static DGtal::int64_t castToInt64_t(const Integer &aT)
Definition: NumberTraits.h:146
boost::int32_t int32_t
signed 32-bit integer.
Definition: BasicTypes.h:72
template<typename TParametricShape >
 ParametricShapeArcLengthFunctor& DGtal::ParametricShapeArcLengthFunctor< TParametricShape >::operator= ( const ParametricShapeArcLengthFunctor< TParametricShape > & other )
inline

Assignment.

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

Definition at line 111 of file ParametricShapeArcLengthFunctor.h.

112  {
113  myShape = other.myShape;
114  return *this;
115  }
ParametricShape * myShape
Copy of the implicit shape.

## Field Documentation

template<typename TParametricShape >
 ParametricShape* DGtal::ParametricShapeArcLengthFunctor< TParametricShape >::myShape
private

Copy of the implicit shape.

Definition at line 164 of file ParametricShapeArcLengthFunctor.h.

The documentation for this class was generated from the following file:
{"ft_lang_label":"__label__en","ft_lang_prob":0.52375287,"math_prob":0.87326163,"size":3317,"snap":"2020-34-2020-40","text_gpt3_token_len":815,"char_repetition_ratio":0.37035918,"word_repetition_ratio":0.086666666,"special_character_ratio":0.17184202,"punctuation_ratio":0.25282168,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9768544,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-09-27T17:48:39Z\",\"WARC-Record-ID\":\"<urn:uuid:b40c6c44-1ae6-4433-a2e9-3b917d975d37>\",\"Content-Length\":\"40186\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:db90c5f3-24a6-4726-a4ee-1b111a09fd2e>\",\"WARC-Concurrent-To\":\"<urn:uuid:98c1a6c9-784e-4876-af96-2533a4534b03>\",\"WARC-IP-Address\":\"185.199.108.153\",\"WARC-Target-URI\":\"https://dgtal.org/doc/0.9.2/classDGtal_1_1ParametricShapeArcLengthFunctor.html\",\"WARC-Payload-Digest\":\"sha1:3MNDR4O3B6R6QCEE6PE3BXDHGPLDWKGF\",\"WARC-Block-Digest\":\"sha1:JSUS7GZAWARGK2MR3473YU3INIAQAVVD\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-40/CC-MAIN-2020-40_segments_1600400283990.75_warc_CC-MAIN-20200927152349-20200927182349-00777.warc.gz\"}"}