| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/bspline.h>

Public Member Functions | |
| BSpline (int curveDegree=1, bool openCurve=true, Array< Vector > *controlPoints=0, Array< int > *knotArray=0) | |
| Constructs a BSpline with the given values. | |
| void | setControlPoint (int i, const Vector &p) |
| Sets the control point at the position i to the given point. | |
| Vector | getControlPoint (int i) const |
| Returns the control point at the position i. | |
| int | controlPoints () const |
| Returns the number of control points. | |
| Iterator< Vector > * | newControlPointIterator () const |
| Returns the control points. | |
| void | setKnot (int i, int value) |
| Sets the knot at the positions i to the given value. | |
| int | getKnot (int i) const |
| Returns the knot at the positions i. | |
| int | knots () const |
| Returns the number of knots. | |
| Iterator< int > * | newKnotIterator () const |
| Returns the knots. | |
| void | insertKnots (int noNewKnots, int knotValue) |
| Inserts noNewKnots knots of value knotValue into the knot vector. | |
| bool | knotsConsistent () const |
| Checks the knot values for consistency. | |
| void | setOpenCurve () |
| Sets the type to open. | |
| void | setClosedCurve () |
| Sets the type to closed. | |
| bool | isOpen () const |
| Returns if the type is open. | |
| void | setCachingOn (int tessellation) |
| Enables caching of the tessellation of the curve. | |
| void | setCachingOff () |
| Disabled caching, see setCachingOn. | |
| bool | isCached () const |
| Returns if the caching is enabled. | |
| void | reconfigure (int newDegree, int newNoOfPoints) |
| virtual Vector | curvePoint (double u) const |
| Returns the curve point specified by u. | |
| virtual Vector | derivative (int n, double u) const |
| Returns the n's derivative at the point specified by u, see curvePoint. | |
| virtual Bounds | boundingBox () const |
| Returns the bounding-box. | |
| virtual void | modified () |
| Returns the length of the curve. | |
| VRS_TYPEINFO (BSpline, Curve) | |
| VRS_SERIALIZABLE (BSpline) | |
If a b-spline is open, the constraint for its knots is: k[0] = ... = k[noCtrlPts], k[noCtrlPts+1] = k[noCtrlPts+degree+1]
The constraint for closed b-spline curves is: k[i+noCtrlPts+2] = k[i+noCtrlPts+1] + k[i] - k[i-1], 0<i<=degree
| VRS::BSpline::BSpline | ( | int | curveDegree = 1, |
|
| bool | openCurve = true, |
|||
| Array< Vector > * | controlPoints = 0, |
|||
| Array< int > * | knotArray = 0 | |||
| ) |
Constructs a BSpline with the given values.
| void VRS::BSpline::setControlPoint | ( | int | i, | |
| const Vector & | p | |||
| ) |
Sets the control point at the position i to the given point.
| Vector VRS::BSpline::getControlPoint | ( | int | i | ) | const |
Returns the control point at the position i.
| int VRS::BSpline::controlPoints | ( | ) | const |
Returns the number of control points.
| void VRS::BSpline::setKnot | ( | int | i, | |
| int | value | |||
| ) |
Sets the knot at the positions i to the given value.
| int VRS::BSpline::getKnot | ( | int | i | ) | const |
Returns the knot at the positions i.
| int VRS::BSpline::knots | ( | ) | const |
Returns the number of knots.
| Iterator< int >* VRS::BSpline::newKnotIterator | ( | ) | const |
Returns the knots.
| void VRS::BSpline::insertKnots | ( | int | noNewKnots, | |
| int | knotValue | |||
| ) |
Inserts noNewKnots knots of value knotValue into the knot vector.
| bool VRS::BSpline::knotsConsistent | ( | ) | const |
Checks the knot values for consistency.
Knot values are consistent if (N : no of points - 1):
| void VRS::BSpline::setOpenCurve | ( | ) |
Sets the type to open.
| void VRS::BSpline::setClosedCurve | ( | ) |
Sets the type to closed.
| bool VRS::BSpline::isOpen | ( | ) | const |
Returns if the type is open.
| void VRS::BSpline::setCachingOn | ( | int | tessellation | ) |
Enables caching of the tessellation of the curve.
If caching is set to on, the values of the B-spline are precomputed for 'tessellation' many points. If an intermediate value is needed, it's calculated by linear interpolation between two precomputed curve points.
| void VRS::BSpline::setCachingOff | ( | ) |
Disabled caching, see setCachingOn.
| bool VRS::BSpline::isCached | ( | ) | const |
Returns if the caching is enabled.
| void VRS::BSpline::reconfigure | ( | int | newDegree, | |
| int | newNoOfPoints | |||
| ) |
Increases/decreases the number of control points and knots. If a number is increased, no new points are generated, only free space is allocates. If a number is decreased, knots or points will be cut off.
| virtual Vector VRS::BSpline::curvePoint | ( | double | u | ) | const [virtual] |
Returns the curve point specified by u.
u is the parametric value between 0 and 1. The calculation is based on the current set of control points.
Implements VRS::Curve.
| virtual Vector VRS::BSpline::derivative | ( | int | n, | |
| double | u | |||
| ) | const [virtual] |
| virtual Bounds VRS::BSpline::boundingBox | ( | ) | const [virtual] |
| virtual void VRS::BSpline::modified | ( | ) | [virtual] |
Returns the length of the curve.
Overwritten to set the updateLengthMapping_ flag
Reimplemented from VRS::Curve.
| VRS::BSpline::VRS_SERIALIZABLE | ( | BSpline | ) |