Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
v
Enumerator
a
b
c
d
f
g
h
i
l
m
n
o
p
r
s
t
u
v
x
y
Classes
Class List
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
k
l
m
o
p
r
s
t
u
w
x
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
Properties
a
b
c
d
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Related Functions
:
a
b
c
d
e
f
g
i
m
o
q
r
s
v
w
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
x
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
b
c
d
e
f
h
k
l
o
p
r
s
t
u
x
z
Enumerator
b
c
d
f
h
i
k
l
n
o
p
r
s
t
u
v
w
x
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
3rdparty
qwt
src
qwt_spline_curve_fitter.cpp
Go to the documentation of this file.
1
/******************************************************************************
2
* Qwt Widget Library
3
* Copyright (C) 1997 Josef Wilgen
4
* Copyright (C) 2002 Uwe Rathmann
5
*
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the Qwt License, Version 1.0
8
*****************************************************************************/
9
10
#include "
qwt_spline_curve_fitter.h
"
11
#include "
qwt_spline_local.h
"
12
#include "
qwt_spline_parametrization.h
"
13
14
#include <qpolygon.h>
15
#include <qpainterpath.h>
16
18
QwtSplineCurveFitter::QwtSplineCurveFitter
()
19
:
QwtCurveFitter
(
QwtCurveFitter
::Path )
20
{
21
m_spline
=
new
QwtSplineLocal
(
QwtSplineLocal::Cardinal
);
22
m_spline
->
setParametrization
(
QwtSplineParametrization::ParameterUniform
);
23
}
24
26
QwtSplineCurveFitter::~QwtSplineCurveFitter
()
27
{
28
delete
m_spline
;
29
}
30
40
void
QwtSplineCurveFitter::setSpline
(
QwtSpline
* spline )
41
{
42
if
(
m_spline
==
spline
)
43
return
;
44
45
delete
m_spline
;
46
m_spline
=
spline
;
47
}
48
53
const
QwtSpline
*
QwtSplineCurveFitter::spline
()
const
54
{
55
return
m_spline
;
56
}
57
62
QwtSpline
*
QwtSplineCurveFitter::spline
()
63
{
64
return
m_spline
;
65
}
66
75
QPolygonF
QwtSplineCurveFitter::fitCurve
(
const
QPolygonF& points )
const
76
{
77
const
QPainterPath path =
fitCurvePath
( points );
78
79
const
QList< QPolygonF >
subPaths = path.toSubpathPolygons();
80
if
( subPaths.size() == 1 )
81
return
subPaths.first();
82
83
return
QPolygonF();
84
}
85
94
QPainterPath
QwtSplineCurveFitter::fitCurvePath
(
const
QPolygonF& points )
const
95
{
96
QPainterPath path;
97
98
if
(
m_spline
)
99
path =
m_spline
->
painterPath
( points );
100
101
return
path;
102
}
QwtSplineCurveFitter::QwtSplineCurveFitter
QwtSplineCurveFitter()
Constructor.
Definition:
qwt_spline_curve_fitter.cpp:18
QwtSplineCurveFitter::m_spline
QwtSpline * m_spline
Definition:
qwt_spline_curve_fitter.h:40
QwtSplineCurveFitter::~QwtSplineCurveFitter
virtual ~QwtSplineCurveFitter()
Destructor.
Definition:
qwt_spline_curve_fitter.cpp:26
QList
Definition:
qwt_abstract_legend.h:17
QwtSpline::painterPath
virtual QPainterPath painterPath(const QPolygonF &) const =0
QwtSpline::setParametrization
void setParametrization(int type)
Definition:
qwt_spline.cpp:576
QwtSpline
Base class for all splines.
Definition:
qwt_spline.h:57
QwtCurveFitter
Abstract base class for a curve fitter.
Definition:
qwt_curve_fitter.h:21
QwtSplineCurveFitter::fitCurvePath
virtual QPainterPath fitCurvePath(const QPolygonF &) const QWT_OVERRIDE
Definition:
qwt_spline_curve_fitter.cpp:94
QwtSplineLocal
A spline with C1 continuity.
Definition:
qwt_spline_local.h:24
QwtSplineLocal::Cardinal
@ Cardinal
Definition:
qwt_spline_local.h:56
qwt_spline_local.h
QwtSplineCurveFitter::spline
const QwtSpline * spline() const
Definition:
qwt_spline_curve_fitter.cpp:53
qwt_spline_curve_fitter.h
QwtSplineCurveFitter::setSpline
void setSpline(QwtSpline *)
Definition:
qwt_spline_curve_fitter.cpp:40
QwtSplineCurveFitter::fitCurve
virtual QPolygonF fitCurve(const QPolygonF &) const QWT_OVERRIDE
Definition:
qwt_spline_curve_fitter.cpp:75
qwt_spline_parametrization.h
QwtSplineParametrization::ParameterUniform
@ ParameterUniform
Definition:
qwt_spline_parametrization.h:86
plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Jan 26 2025 03:23:25