QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
| Public 类型 | Public 成员函数 | 所有成员列表
QwtSpline类 参考abstract

Base class for all splines 更多...

#include <qwt_spline.h>

类 QwtSpline 继承关系图:
QwtSplineBasis QwtSplineInterpolating QwtSplineG1 QwtSplineC1 QwtSplinePleasing QwtSplineC2 QwtSplineLocal QwtSplineCubic

class  PrivateData
 

Public 类型

enum  BoundaryType { ConditionalBoundaries , PeriodicPolygon , ClosedPolygon }
 Boundary type specifying the spline at its endpoints 更多...
 
enum  BoundaryPosition { AtBeginning , AtEnd }
 position of a boundary condition 更多...
 
enum  BoundaryCondition { Clamped1 , Clamped2 , Clamped3 , LinearRunout }
 Boundary condition 更多...
 

Public 成员函数

 QwtSpline ()
 Constructor
 
virtual ~QwtSpline ()
 Destructor
 
void setParametrization (int type)
 Set parametrization by type
 
void setParametrization (QwtSplineParametrization *)
 Set parametrization object
 
const QwtSplineParametrizationparametrization () const
 Get parametrization
 
void setBoundaryType (BoundaryType)
 Set boundary type
 
BoundaryType boundaryType () const
 Get boundary type
 
void setBoundaryValue (BoundaryPosition, double value)
 Set boundary value
 
double boundaryValue (BoundaryPosition) const
 Get boundary value
 
void setBoundaryCondition (BoundaryPosition, int condition)
 Set boundary condition
 
int boundaryCondition (BoundaryPosition) const
 Get boundary condition
 
void setBoundaryConditions (int condition, double valueBegin=0.0, double valueEnd=0.0)
 Set boundary conditions for both ends
 
virtual QPolygonF polygon (const QPolygonF &, double tolerance) const
 Get polygon approximation with tolerance
 
virtual QPainterPath painterPath (const QPolygonF &) const =0
 Get painter path from polygon (pure virtual)
 
virtual uint locality () const
 Get locality (number of points used for calculation)
 

详细描述

Base class for all splines

A spline is a curve represented by a sequence of polynomials. Spline approximation is the process of finding polynomials for a given set of points. When the algorithm preserves the initial points it is called interpolating.

Splines can be classified according to conditions of the polynomials that are met at the start/endpoints of the pieces:

Geometric continuity requires the geometry to be continuous, while parametric continuity requires that the underlying parameterization be continuous as well. Parametric continuity of order n implies geometric continuity of order n, but not vice-versa.

QwtSpline is the base class for spline approximations of any continuity.

成员枚举类型说明

◆ BoundaryCondition

Boundary condition

A spline algorithm calculates polynomials by looking a couple of points back/ahead ( locality() ). At the ends additional rules are necessary to compensate the missing points.

参见
boundaryCondition(), boundaryValue()
QwtSplineC2::BoundaryConditionC2
枚举值
Clamped1 

The first derivative at the end point is given

参见
boundaryValue()
Clamped2 

The second derivative at the end point is given

参见
boundaryValue()
注解
a condition having a second derivative of 0 is also called "natural".
Clamped3 

The third derivative at the end point is given

参见
boundaryValue()
注解
a condition having a third derivative of 0 is also called "parabolic runout".
LinearRunout 

The first derivate at the endpoint is related to the first derivative at its neighbour by the boundary value. F,e when the boundary value at the end is 1.0 then the slope at the last 2 points is the same.

参见
boundaryValue().

◆ BoundaryPosition

position of a boundary condition

参见
boundaryCondition(), boundaryValue()
枚举值
AtBeginning 

the condition is at the beginning of the polynomial

AtEnd 

the condition is at the end of the polynomial

◆ BoundaryType

Boundary type specifying the spline at its endpoints

参见
setBoundaryType(), boundaryType()
枚举值
ConditionalBoundaries 

The polynomials at the start/endpoint depend on specific conditions

参见
QwtSpline::BoundaryCondition
PeriodicPolygon 

The polynomials at the start/endpoint are found by using imaginary additional points. Additional points at the end are found by translating points from the beginning or v.v.

ClosedPolygon 

ClosedPolygon is similar to PeriodicPolygon beside, that the interpolation includes the connection between the last and the first control point.

注解
Only works for parametrizations, where the parameter increment for the the final closing line is positive. This excludes QwtSplineParametrization::ParameterX and QwtSplineParametrization::ParameterY

构造及析构函数说明

◆ QwtSpline()

QwtSpline::QwtSpline ( )

Constructor

The default setting is a non-closing spline with chordal parametrization.

参见
setParametrization(), setBoundaryType()

Destructor

成员函数说明

◆ boundaryCondition()

int QwtSpline::boundaryCondition ( BoundaryPosition  position) const

Get boundary condition

参数
[in]positionAt the beginning or the end of the spline
返回
Condition for an endpoint of the spline
参见
setBoundaryCondition(), boundaryValue(), setBoundaryConditions()

◆ boundaryType()

QwtSpline::BoundaryType QwtSpline::boundaryType ( ) const

Get boundary type

返回
Boundary type
参见
setBoundaryType()

◆ boundaryValue()

double QwtSpline::boundaryValue ( BoundaryPosition  position) const

Get boundary value

参数
[in]positionAt the beginning or the end of the spline
返回
Boundary value
参见
setBoundaryValue(), boundaryCondition()

◆ locality()

uint QwtSpline::locality ( ) const
virtual

Get locality (number of points used for calculation)

Get the locality of the spline interpolation

The locality of a spline interpolation identifies how many adjacent polynomials are affected when changing the position of one point.

A locality of 'n' means that changing the coordinates of a point has an effect on 'n' leading and 'n' following polynomials. Those polynomials can be calculated from a local subpolygon.

A value of 0 means the interpolation is not local and any modification of the polygon requires recalculating all polynomials (e.g., cubic splines).

返回
Order of locality

QwtSplineBasis, QwtSplineCubic, QwtSplineLocal , 以及 QwtSplinePleasing 重载.

◆ painterPath()

QPainterPath QwtSpline::painterPath ( const QPolygonF &  points) const
pure virtual

Get painter path from polygon (pure virtual)

Approximates a polygon piecewise with cubic Bezier curves and returns them as QPainterPath.

参数
pointsControl points
返回
Painter path, that can be rendered by QPainter
参见
polygon(), QwtBezier

QwtSplineInterpolating, QwtSplineC1, QwtSplineC2, QwtSplineBasis, QwtSplineCubic, QwtSplineLocal , 以及 QwtSplinePleasing 内被实现.

◆ parametrization()

const QwtSplineParametrization * QwtSpline::parametrization ( ) const

Get parametrization

返回
Parametrization object
参见
setParametrization()

◆ polygon()

QPolygonF QwtSpline::polygon ( const QPolygonF &  points,
double  tolerance 
) const
virtual

Get polygon approximation with tolerance

Interpolate a curve by a polygon

Interpolates a polygon piecewise with Bezier curves interpolating them in a 2nd pass by polygons.

The interpolation is based on "Piecewise Linear Approximation of Bezier Curves" by Roger Willcocks ( http://www.rops.org )

参数
[in]pointsControl points
[in]toleranceMaximum for the accepted error of the approximation
返回
Polygon approximating the interpolating polynomials
参见
bezierControlLines(), QwtBezier

QwtSplineInterpolating 重载.

◆ setBoundaryCondition()

void QwtSpline::setBoundaryCondition ( BoundaryPosition  position,
int  condition 
)

Set boundary condition

Define the condition for an endpoint of the spline.

参数
[in]positionAt the beginning or the end of the spline
[in]conditionCondition
参见
BoundaryCondition, QwtSplineC2::BoundaryCondition, boundaryCondition()

◆ setBoundaryConditions()

void QwtSpline::setBoundaryConditions ( int  condition,
double  valueBegin = 0.0,
double  valueEnd = 0.0 
)

Set boundary conditions for both ends

Define the condition at the endpoints of a spline.

参数
[in]conditionCondition
[in]valueBeginUsed for the condition at the beginning of the spline
[in]valueEndUsed for the condition at the end of the spline
参见
BoundaryCondition, QwtSplineC2::BoundaryCondition, testBoundaryCondition(), setBoundaryValue()

◆ setBoundaryType()

void QwtSpline::setBoundaryType ( BoundaryType  boundaryType)

Set boundary type

Define the boundary type for the endpoints of the approximating spline.

参数
[in]boundaryTypeBoundary type
参见
boundaryType()

◆ setBoundaryValue()

void QwtSpline::setBoundaryValue ( BoundaryPosition  position,
double  value 
)

Set boundary value

The boundary value is a parameter used in combination with the boundary condition. Its meaning depends on the condition.

参数
[in]positionAt the beginning or the end of the spline
[in]valueValue used for the condition at the endpoint
参见
boundaryValue(), setBoundaryCondition()

◆ setParametrization() [1/2]

void QwtSpline::setParametrization ( int  type)

Set parametrization by type

Define the parametrization for a parametric spline approximation. The default setting is a chordal parametrization.

参数
[in]typeType of parametrization, usually one of QwtSplineParametrization::Type
参见
parametrization()

◆ setParametrization() [2/2]

void QwtSpline::setParametrization ( QwtSplineParametrization parametrization)

Set parametrization object

Define the parametrization for a parametric spline approximation. The default setting is a chordal parametrization.

参数
[in]parametrizationParametrization object
参见
parametrization()

该类的文档由以下文件生成: