11 #define QWT_BEZIER_H 1 33 void setTolerance(
double tolerance );
34 double tolerance()
const;
36 QPolygonF toPolygon(
const QPointF &p1,
const QPointF &cp1,
37 const QPointF &cp2,
const QPointF &p2 )
const;
39 void appendToPolygon(
const QPointF &p1,
const QPointF &cp1,
40 const QPointF &cp2,
const QPointF &p2, QPolygonF &polygon )
const;
42 static QPointF pointAt(
const QPointF &p1,
const QPointF &cp1,
43 const QPointF &cp2,
const QPointF &p2,
double t );
71 const QPointF &cp1,
const QPointF &cp2,
const QPointF &p2,
double t )
73 const double d1 = 3.0 * t;
74 const double d2 = 3.0 * t * t;
75 const double d3 = t * t * t;
76 const double s = 1.0 - t;
78 const double x = (( s * p1.x() + d1 * cp1.x() ) * s + d2 * cp2.x() ) * s + d3 * p2.x();
79 const double y = (( s * p1.y() + d1 * cp1.y() ) * s + d2 * cp2.y() ) * s + d3 * p2.y();
81 return QPointF( x, y );
static QPointF pointAt(const QPointF &p1, const QPointF &cp1, const QPointF &cp2, const QPointF &p2, double t)
TFSIMD_FORCE_INLINE const tfScalar & y() const
An implementation of the de Casteljau’s Algorithm for interpolating Bézier curves.
TFSIMD_FORCE_INLINE const tfScalar & x() const