Qwt User's Guide 6.2.0

qwt_bezier.h
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
10 #ifndef QWT_BEZIER_H
11 #define QWT_BEZIER_H
12
13 #include "qwt_global.h"
14
15 class QPointF;
16 class QPolygonF;
17
29 class QWT_EXPORT QwtBezier
30 {
31 public:
32 QwtBezier( double tolerance = 0.5 );
33 ~QwtBezier();
34
35 void setTolerance( double tolerance );
36 double tolerance() const;
37
38 QPolygonF toPolygon( const QPointF& p1, const QPointF& cp1,
39 const QPointF& cp2, const QPointF& p2 ) const;
40
41 void appendToPolygon( const QPointF& p1, const QPointF& cp1,
42 const QPointF& cp2, const QPointF& p2, QPolygonF& polygon ) const;
43
44 static QPointF pointAt( const QPointF& p1, const QPointF& cp1,
45 const QPointF& cp2, const QPointF& p2, double t );
46
47 private:
48 double m_tolerance;
49 double m_flatness;
50 };
51
56 inline double QwtBezier::tolerance() const
57 {
58 return m_tolerance;
59 }
60
61 #endif
QwtBezier
An implementation of the de Casteljau’s Algorithm for interpolating Bézier curves.
Definition: qwt_bezier.h:30
QwtBezier::tolerance
double tolerance() const
Definition: qwt_bezier.h:56