DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
ParametricShapeArcLengthFunctor.h
1
16
17
#pragma once
18
33
34
#if defined(ParametricShapeArcLengthFunctor_RECURSES)
35
#error Recursive header files inclusion detected in ParametricShapeArcLengthFunctor.h
36
#else
// defined(ParametricShapeArcLengthFunctor_RECURSES)
38
#define ParametricShapeArcLengthFunctor_RECURSES
39
40
#if !defined ParametricShapeArcLengthFunctor_h
42
#define ParametricShapeArcLengthFunctor_h
43
45
// Inclusions
46
#include <iostream>
47
#include "DGtal/base/Common.h"
49
50
namespace
DGtal
51
{
52
54
// template class ParametricShapeArcLengthFunctor
63
template
<
typename
TParametricShape>
64
class
ParametricShapeArcLengthFunctor
65
{
66
67
// ----------------------- Standard services ------------------------------
68
public
:
69
71
typedef
TParametricShape
ParametricShape
;
72
74
typedef
typename
TParametricShape::RealPoint
RealPoint
;
75
77
typedef
double
Quantity
;
78
82
ParametricShapeArcLengthFunctor
() =
delete
;
83
84
89
ParametricShapeArcLengthFunctor
(
const
ParametricShape
&aShape):
myShape
(aShape) {};
90
91
95
~ParametricShapeArcLengthFunctor
() =
default
;
96
97
98
// ----------------------- Interface --------------------------------------
99
public
:
106
ParametricShapeArcLengthFunctor
&
operator=
(
const
ParametricShapeArcLengthFunctor
& other ) =
delete
;
107
115
Quantity
operator()
(
const
RealPoint
&aFirstPoint,
const
RealPoint
&aSecondPoint)
const
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
}
128
134
Quantity
operator()
()
const
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
}
143
144
// ------------------------- Private Data --------------------------------
145
private
:
146
148
const
ParametricShape
&
myShape
;
149
150
// ------------------------- Internals ------------------------------------
151
private
:
152
153
};
// end of class ParametricShapeArcLengthFunctor
154
155
}
// namespace DGtal
156
157
//
159
160
#endif
// !defined ParametricShapeArcLengthFunctor_h
161
162
#undef ParametricShapeArcLengthFunctor_RECURSES
163
#endif
// else defined(ParametricShapeArcLengthFunctor_RECURSES)
DGtal::ParametricShapeArcLengthFunctor::operator()
Quantity operator()() const
Definition
ParametricShapeArcLengthFunctor.h:134
DGtal::ParametricShapeArcLengthFunctor::ParametricShape
TParametricShape ParametricShape
Type of parametric shape.
Definition
ParametricShapeArcLengthFunctor.h:71
DGtal::ParametricShapeArcLengthFunctor::ParametricShapeArcLengthFunctor
ParametricShapeArcLengthFunctor()=delete
DGtal::ParametricShapeArcLengthFunctor::operator=
ParametricShapeArcLengthFunctor & operator=(const ParametricShapeArcLengthFunctor &other)=delete
DGtal::ParametricShapeArcLengthFunctor::myShape
const ParametricShape & myShape
Reference of the implicit shape.
Definition
ParametricShapeArcLengthFunctor.h:148
DGtal::ParametricShapeArcLengthFunctor::operator()
Quantity operator()(const RealPoint &aFirstPoint, const RealPoint &aSecondPoint) const
Definition
ParametricShapeArcLengthFunctor.h:115
DGtal::ParametricShapeArcLengthFunctor::RealPoint
TParametricShape::RealPoint RealPoint
Type of const iterator on points.
Definition
ParametricShapeArcLengthFunctor.h:74
DGtal::ParametricShapeArcLengthFunctor::ParametricShapeArcLengthFunctor
ParametricShapeArcLengthFunctor(const ParametricShape &aShape)
Definition
ParametricShapeArcLengthFunctor.h:89
DGtal::ParametricShapeArcLengthFunctor::~ParametricShapeArcLengthFunctor
~ParametricShapeArcLengthFunctor()=default
DGtal::ParametricShapeArcLengthFunctor::Quantity
double Quantity
Type of the functor output.
Definition
ParametricShapeArcLengthFunctor.h:77
DGtal::PointVector< 3, double >::L_infty
@ L_infty
Definition
PointVector.h:1493
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
src
DGtal
geometry
curves
estimation
ParametricShapeArcLengthFunctor.h
Generated on
for DGtal by
1.18.0