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 
11 #include "qwt_spline_local.h"
13 
14 #include <qpolygon.h>
15 #include <qpainterpath.h>
16 
20 {
23 }
24 
27 {
28  delete m_spline;
29 }
30 
41 {
42  if ( m_spline == spline )
43  return;
44 
45  delete m_spline;
46  m_spline = spline;
47 }
48 
54 {
55  return m_spline;
56 }
57 
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 Mon Nov 11 2024 03:23:46