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

An implementation of the de Casteljau's Algorithm for interpolating Bézier curves 更多...

#include <qwt_bezier.h>

Public 成员函数

 QwtBezier (double tolerance=0.5)
 Constructor with tolerance parameter
 
 ~QwtBezier ()
 Destructor
 
void setTolerance (double tolerance)
 Set the tolerance for curve subdivision
 
double tolerance () const
 Get the tolerance value
 
QPolygonF toPolygon (const QPointF &p1, const QPointF &cp1, const QPointF &cp2, const QPointF &p2) const
 Interpolate a Bézier curve as a polygon
 
void appendToPolygon (const QPointF &p1, const QPointF &cp1, const QPointF &cp2, const QPointF &p2, QPolygonF &polygon) const
 Append Bézier curve points to an existing polygon
 

静态 Public 成员函数

static QPointF pointAt (const QPointF &p1, const QPointF &cp1, const QPointF &cp2, const QPointF &p2, double t)
 Find a point on a Bézier curve at parameter t
 

详细描述

An implementation of the de Casteljau's Algorithm for interpolating Bézier curves

The flatness criterion for terminating the subdivision is based on "Piecewise Linear Approximation of Bézier Curves" by Roger Willcocks. See: https://jeremykun.com/2013/05/11/bezier-curves-and-picasso

构造及析构函数说明

◆ QwtBezier()

QwtBezier::QwtBezier ( double  tolerance = 0.5)

Constructor with tolerance parameter

Constructor

参数
toleranceTermination criterion for the subdivision
参见
setTolerance()

成员函数说明

◆ appendToPolygon()

void QwtBezier::appendToPolygon ( const QPointF &  p1,
const QPointF &  cp1,
const QPointF &  cp2,
const QPointF &  p2,
QPolygonF &  polygon 
) const

Append Bézier curve points to an existing polygon

Interpolate a Bézier curve by adding points to a polygon

appendToPolygon() is tailored for accumulating points from a sequence of Bézier curves, such as those created by spline interpolation.

参数
p1Start point
cp1First control point
cp2Second control point
p2End point
polygonPolygon where the interpolating points are added
注解
If the last point of the incoming polygon matches p1, it won't be inserted a second time.

◆ pointAt()

QPointF QwtBezier::pointAt ( const QPointF &  p1,
const QPointF &  cp1,
const QPointF &  cp2,
const QPointF &  p2,
double  t 
)
static

Find a point on a Bézier curve at parameter t

Find a point on a Bézier curve

参数
p1Start point
cp1First control point
cp2Second control point
p2End point
tParameter value in range [0,1]
返回
Point on the curve

◆ setTolerance()

void QwtBezier::setTolerance ( double  tolerance)

Set the tolerance for curve subdivision

The tolerance is a measurement for the flatness of a curve. A curve with a flatness below the tolerance is considered as being flat, terminating the subdivision algorithm. When interpolating a Bezier curve to render it as a sequence of lines to some sort of raster (e.g., to screen), a value of 0.5 of the pixel size is a good value for the tolerance.

参数
toleranceTermination criterion for the subdivision
参见
tolerance()

◆ tolerance()

double QwtBezier::tolerance ( ) const
inline

Get the tolerance value

返回
Tolerance value used for subdivision

◆ toPolygon()

QPolygonF QwtBezier::toPolygon ( const QPointF &  p1,
const QPointF &  cp1,
const QPointF &  cp2,
const QPointF &  p2 
) const

Interpolate a Bézier curve as a polygon

Interpolate a Bézier curve by a polygon

参数
p1Start point
cp1First control point
cp2Second control point
p2End point
返回
Interpolating polygon

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