The Title
Namespaces Paths
Namespace Paths
class Bezier BezierPaths::Bezier The Bezier class. It implements a Bezier curve for the given order.
Bezier() BezierPaths::Bezier::Bezier Bezier(); Create a new Bezier.
draw() drawPaths::Bezier::draw void draw();
controls_ std::vector<Vertex> controls_; The data...
add_control_point(const Vertex&) add_control_pointPaths::Bezier::add_control_point void add_control_point(const Vertex&); Add a new control point. Parameters pA point
remove_control_point(size_t) remove_control_pointPaths::Bezier::remove_control_point void remove_control_point(size_t i); Remove the control point at index i. Parameters iAn index
class Nurbs NurbsPaths::Nurbs The Nurbs class. It implements a nurbs curve for the given order. It is a very powerful and flexible curve representation. For simpler cases you may prefer to use a Bezier curve.While non-rational curves are not sufficient to represent a circle, this is one of many sets of NURBS control points for an almost uniformly parameterized circle: x y weight 1 0 1 1 1 sqrt(2)/2 0 1 1 -1 1 sqrt(2)/2 -1 0 1 -1 -1 sqrt(2)/2 0 -1 1 1 -1 sqrt(2)/2 1 0 1 The order is three, the knot vector is {0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4}. It should be noted that the circle is composed of four quarter circles, tied together with double knots. Although double knots in a third order NURBS curve would normally result in loss of continuity in the first derivative, the control points are positioned in such a way that the first derivative is continuous. (From Wikipedia )Example: Nurbs<3> circle; circle.insert_control_point(0, Vertex(1., 0.), 1.); circle.insert_control_point(0, Vertex(1., 1.), sqrt(2.)/2.); ...
Nurbs() NurbsPaths::Nurbs::Nurbs Nurbs(); Create a new Nurbs curve.
insert_control_point(double,const Vertex&,double) insert_control_pointPaths::Nurbs::insert_control_point void insert_control_point(double knot, const Vertex& vertex, double weight); Inserts a control point with the given weight. The knot value determines the position in the sequence. Parameters: knot the parameter value at which to insert a new knot vertex the control point weight the weight of the control point
draw() drawPaths::Nurbs::draw void draw();
controls_ std::vector<Vertex> controls_; The data...
weights_ std::vector<double> weights_;
knots_ std::vector<double> knots_;
class Polyline PolylinePaths::Polyline The Polyline class. It is an ordered set of connected line segments.
Polyline() PolylinePaths::Polyline::Polyline Polyline(); Create a new Polyline.
draw() drawPaths::Polyline::draw void draw();
vertices_ std::vector<Vertex> vertices_; The data...
add_vertex(const Vertex&) add_vertexPaths::Polyline::add_vertex void add_vertex(const Vertex&); Add a new vertex.
remove_vertex(size_t) remove_vertexPaths::Polyline::remove_vertex void remove_vertex(size_t i); Remove the vertex at index i.
Bezier_h_ Bezier_h_
Nurbs_h_ Nurbs_h_
class Path PathPath Path is the basic abstraction used for drawing (curved) paths.
~Path() ~PathPath::~Path ~Path();
draw() drawPath::draw void draw(); Draw this path.
Path_h_ Path_h_
Polyline_h_ Polyline_h_
struct Vertex VertexVertex A Vertex is a 2D point.
Vertex(double,double) VertexVertex::Vertex Vertex(double xx, double yy);
x double x;
y double y; the y coordinate