qwt_spline.h
Go to the documentation of this file.
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
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 #ifndef QWT_SPLINE_H
11 #define QWT_SPLINE_H 1
12 
13 #include "qwt_global.h"
14 #include "qwt_spline.h"
15 #include "qwt_spline_polynomial.h"
16 #include <qpolygon.h>
17 #include <qpainterpath.h>
18 #include <qmath.h>
19 
21 
54 {
55 public:
62  {
69 
76 
88  ClosedPolygon
89  };
90 
96  {
99 
101  AtEnd
102  };
103 
116  {
122 
131 
140 
149  LinearRunout
150  };
151 
152  QwtSpline();
153  virtual ~QwtSpline();
154 
155  void setParametrization( int type );
156  void setParametrization( QwtSplineParametrization * );
157  const QwtSplineParametrization *parametrization() const;
158 
159  void setBoundaryType( BoundaryType );
160  BoundaryType boundaryType() const;
161 
162  void setBoundaryValue( BoundaryPosition, double value );
163  double boundaryValue( BoundaryPosition ) const;
164 
165  void setBoundaryCondition( BoundaryPosition, int condition );
166  int boundaryCondition( BoundaryPosition ) const;
167 
168  void setBoundaryConditions( int condition,
169  double valueBegin = 0.0, double valueEnd = 0.0 );
170 
171  virtual QPolygonF polygon( const QPolygonF &, double tolerance ) const;
172  virtual QPainterPath painterPath( const QPolygonF & ) const = 0;
173 
174  virtual uint locality() const;
175 
176 private:
177  Q_DISABLE_COPY(QwtSpline)
178 
179  class PrivateData;
180  PrivateData *d_data;
181 };
182 
190 {
191 public:
193  virtual ~QwtSplineInterpolating();
194 
195  virtual QPolygonF equidistantPolygon( const QPolygonF &,
196  double distance, bool withNodes ) const;
197 
198  virtual QPolygonF polygon( const QPolygonF &, double tolerance ) const;
199 
200  virtual QPainterPath painterPath( const QPolygonF & ) const;
201  virtual QVector<QLineF> bezierControlLines( const QPolygonF &points ) const = 0;
202 
203 private:
204  Q_DISABLE_COPY(QwtSplineInterpolating)
205 };
206 
212 {
213 public:
214  QwtSplineG1();
215  virtual ~QwtSplineG1();
216 };
217 
231 {
232 public:
233  QwtSplineC1();
234  virtual ~QwtSplineC1();
235 
236  virtual QPainterPath painterPath( const QPolygonF & ) const;
237  virtual QVector<QLineF> bezierControlLines( const QPolygonF & ) const;
238 
239  virtual QPolygonF equidistantPolygon( const QPolygonF &,
240  double distance, bool withNodes ) const;
241 
242  // these methods are the non parametric part
243  virtual QVector<QwtSplinePolynomial> polynomials( const QPolygonF & ) const;
244  virtual QVector<double> slopes( const QPolygonF & ) const = 0;
245 
246  virtual double slopeAtBeginning( const QPolygonF &, double slopeNext ) const;
247  virtual double slopeAtEnd( const QPolygonF &, double slopeBefore ) const;
248 };
249 
263 {
264 public:
271  {
278  CubicRunout = LinearRunout + 1,
279 
287  NotAKnot
288  };
289 
290  QwtSplineC2();
291  virtual ~QwtSplineC2();
292 
293  virtual QPainterPath painterPath( const QPolygonF & ) const;
294  virtual QVector<QLineF> bezierControlLines( const QPolygonF & ) const;
295 
296  virtual QPolygonF equidistantPolygon( const QPolygonF &,
297  double distance, bool withNodes ) const;
298 
299  // calculating the parametric equations
300  virtual QVector<QwtSplinePolynomial> polynomials( const QPolygonF & ) const;
301  virtual QVector<double> slopes( const QPolygonF & ) const;
302  virtual QVector<double> curvatures( const QPolygonF & ) const = 0;
303 };
304 
305 #endif
Curve parametrization used for a spline interpolation.
virtual QPainterPath painterPath(const QPolygonF &) const
Interpolate a curve with Bezier curves.
Definition: qwt_spline.cpp:746
virtual QPainterPath painterPath(const QPolygonF &) const
Calculate an interpolated painter path.
virtual QPolygonF equidistantPolygon(const QPolygonF &, double distance, bool withNodes) const
Find an interpolated polygon with "equidistant" points.
Definition: qwt_spline.cpp:861
#define QWT_EXPORT
Definition: qwt_global.h:38
virtual QVector< double > slopes(const QPolygonF &) const =0
Find the first derivative at the control points.
Base class for all splines.
Definition: qwt_spline.h:53
TFSIMD_FORCE_INLINE tfScalar distance(const Vector3 &v) const
BoundaryCondition
Boundary condition.
Definition: qwt_spline.h:115
virtual QPolygonF equidistantPolygon(const QPolygonF &, double distance, bool withNodes) const
Find an interpolated polygon with "equidistant" points.
Base class for spline interpolations providing a first order parametric continuity ( C1 ) between adj...
Definition: qwt_spline.h:230
the condiation is at the beginning of the polynomial
Definition: qwt_spline.h:98
virtual QVector< QLineF > bezierControlLines(const QPolygonF &points) const =0
Interpolate a curve with Bezier curves.
Base class for spline interpolations providing a first order geometric continuity ( G1 ) between adjo...
Definition: qwt_spline.h:211
Base class for spline interpolations providing a second order parametric continuity ( C2 ) between ad...
Definition: qwt_spline.h:262
Base class for a spline interpolation.
Definition: qwt_spline.h:189
virtual QVector< QwtSplinePolynomial > polynomials(const QPolygonF &) const
Calculate the interpolating polynomials for a non parametric spline.
virtual QVector< QLineF > bezierControlLines(const QPolygonF &) const
Interpolate a curve with Bezier curves.
BoundaryPosition
Definition: qwt_spline.h:95


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:18