Simbody
|
This class implements a non-uniform B-spline curve. More...
#include <Spline.h>
Classes | |
class | SplineImpl |
Public Member Functions | |
Spline_ (int degree, const Vector &x, const Vector_< T > &y) | |
Create a Spline_ object based on a set of control points. | |
Spline_ (const Spline_ ©) | |
Spline_ () | |
Spline_ & | operator= (const Spline_ ©) |
~Spline_ () | |
T | calcValue (const Vector &x) const |
Calculate the values of the dependent variables at a particular value of the independent variable. | |
T | calcDerivative (const Array_< int > &derivComponents, const Vector &x) const |
Calculate a derivative of the spline function. | |
int | getArgumentSize () const |
Get the number of components expected in the input vector. | |
int | getMaxDerivativeOrder () const |
Get the maximum derivative order this Function_ object can calculate. | |
const Vector & | getControlPointLocations () const |
Get the locations (that is, the values of the independent variable) of the control points. | |
const Vector_< T > & | getControlPointValues () const |
Get the values of the dependent variables at the control points. | |
int | getSplineDegree () const |
Get the degree of the spline. | |
T | calcDerivative (const std::vector< int > &derivComponents, const Vector &x) const |
This provides compatibility with std::vector without requiring any copying. |
This class implements a non-uniform B-spline curve.
It requires the spline degree to be odd (linear, cubic, quintic, etc.), but supports arbitrarily high degrees. Only spline curves are supported, not surfaces or higher dimensional objects, but the curve may be defined in an arbitrary dimensional space. That is, a Spline_ is a Function_ that calculates an arbitrary number of output values based on a single input value. The template argument must be either Real or Vec<N> from some integer N. The name "Spline" (with no trailing _) may be used as a synonym for Spline_<Real>.
SimTK::Spline_< T >::Spline_ | ( | int | degree, |
const Vector & | x, | ||
const Vector_< T > & | y | ||
) | [inline] |
Create a Spline_ object based on a set of control points.
degree | the degree of the spline to create. This must be a positive odd value. |
x | the values of the independent variable for each control point |
y | the values of the dependent variables for each control point |
SimTK::Spline_< T >::Spline_ | ( | const Spline_< T > & | copy | ) | [inline] |
SimTK::Spline_< T >::Spline_ | ( | ) | [inline] |
SimTK::Spline_< T >::~Spline_ | ( | ) | [inline] |
Spline_& SimTK::Spline_< T >::operator= | ( | const Spline_< T > & | copy | ) | [inline] |
T SimTK::Spline_< T >::calcValue | ( | const Vector & | x | ) | const [inline, virtual] |
Calculate the values of the dependent variables at a particular value of the independent variable.
x | a Vector of length 1 containing the value of the independent variable. |
Implements SimTK::Function_< T >.
T SimTK::Spline_< T >::calcDerivative | ( | const Array_< int > & | derivComponents, |
const Vector & | x | ||
) | const [inline, virtual] |
Calculate a derivative of the spline function.
See the Function_ class for details. Because Spline_ only allows a single independent variable, all elements of derivComponents should be 0, and its length determines the order of the derivative to calculate.
Implements SimTK::Function_< T >.
int SimTK::Spline_< T >::getArgumentSize | ( | ) | const [inline, virtual] |
Get the number of components expected in the input vector.
Implements SimTK::Function_< T >.
int SimTK::Spline_< T >::getMaxDerivativeOrder | ( | ) | const [inline, virtual] |
Get the maximum derivative order this Function_ object can calculate.
Implements SimTK::Function_< T >.
const Vector& SimTK::Spline_< T >::getControlPointLocations | ( | ) | const [inline] |
Get the locations (that is, the values of the independent variable) of the control points.
const Vector_<T>& SimTK::Spline_< T >::getControlPointValues | ( | ) | const [inline] |
Get the values of the dependent variables at the control points.
int SimTK::Spline_< T >::getSplineDegree | ( | ) | const [inline] |
Get the degree of the spline.
T SimTK::Spline_< T >::calcDerivative | ( | const std::vector< int > & | derivComponents, |
const Vector & | x | ||
) | const [inline] |
This provides compatibility with std::vector without requiring any copying.
Reimplemented from SimTK::Function_< T >.