|
Core 1.0
|
Piecewise Bézier quadric curves with 2D control points. More...
#include <bezier.h>
Public Member Functions | |
| QuadricCurve2 | GetQuadric (int) const |
| Return the i-th QuadricCurve2. | |
| Box2 | GetBox () const |
| Return the bounding box. | |
| void | Draw (QGraphicsScene &, const QPen &=QPen(), const QBrush &=QBrush()) const |
| Draw the curve. | |
Protected Attributes | |
| QVector< Vector2 > | c |
| Set of control points. | |
Piecewise Bézier quadric curves with 2D control points.
The class only stores the control points.
| void BezierQuadricCurve2::Draw | ( | QGraphicsScene & | scene, |
| const QPen & | pen = QPen(), | ||
| const QBrush & | brush = QBrush() ) const |
Draw the curve.
| scene | Graphics scene. |
| pen | Pen. |
| brush | Brush. |
| QuadricCurve2 BezierQuadricCurve2::GetQuadric | ( | int | i | ) | const |
Return the i-th QuadricCurve2.
The n control points define n-2 quadrics, which are joined with a continuous tangent: the curve starts at the first control point, ends at the last one, and goes through the middle of the other control segments. The quadric number i has the control points i, i+1 and i+2, the end points being replaced by the middle of the control segments, except for the end points of the curve. An empty QuadricCurve2 is returned if there are less than three control points.
| i | Index of the quadric, which should be in [0,n-3]. |