Simbody
3.7
|
This class implements a non-uniform Bezier curve. More...
Classes | |
class | SplineImpl |
This is the implementation class that supports the Spline_ interface. More... | |
Public Member Functions | |
Spline_ (int degree, const Vector &x, const Vector_< T > &y) | |
Create a Spline_ object based on a set of control points. See SplineFitter for a nicer way to create these objects. More... | |
Spline_ () | |
Default constructor creates an empty Spline_ handle; not very useful. More... | |
Spline_ (const Spline_ &source) | |
Copy constructor is shallow and reference-counted; that is, the new Spline_ refers to the same object as does source. More... | |
Spline_ & | operator= (const Spline_ &source) |
Copy assignment is shallow and reference-counted; that is, after the assignment this Spline_ refers to the same object as does source. More... | |
~Spline_ () | |
Destructor decrements the reference count and frees the heap space if this is the last reference. More... | |
T | calcValue (Real x) const |
Calculate the values of the dependent variables at a particular value of the independent variable. More... | |
T | calcDerivative (int order, Real x) const |
Calculate a derivative of the spline function with respect to its independent variable, at the given value. More... | |
const Vector & | getControlPointLocations () const |
Get the locations (that is, the values of the independent variable) for each of the Bezier control points. More... | |
const Vector_< T > & | getControlPointValues () const |
Get the values of the dependent variables at each of the Bezier control points. More... | |
int | getSplineDegree () const |
Get the degree of the spline. More... | |
T | calcValue (const Vector &x) const override |
Alternate signature provided to implement the generic Function_ interface expects a one-element Vector for the independent variable. More... | |
T | calcDerivative (const Array_< int > &derivComponents, const Vector &x) const override |
Alternate signature provided to implement the generic Function_ interface expects an awkward derivComponents argument, and takes a one-element Vector for the independent variable. More... | |
T | calcDerivative (const std::vector< int > &derivComponents, const Vector &x) const |
For the Function_ style interface, this provides compatibility with std::vector. More... | |
int | getArgumentSize () const override |
Required by the Function_ interface. More... | |
int | getMaxDerivativeOrder () const override |
Required by the Function_ interface. More... | |
Spline_ * | clone () const override |
Required by the Function_ interface. More... | |
![]() | |
virtual | ~Function_ () |
T | calcDerivative (const std::vector< int > &derivComponents, const Vector &x) const |
This provides compatibility with std::vector without requiring any copying. More... | |
This class implements a non-uniform Bezier 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>.
Most users should generate Spline_ objects using SplineFitter which can be used to generate spline curves through data points rather than requiring Bezier control points.
|
inline |
Create a Spline_ object based on a set of control points. See SplineFitter for a nicer way to create these objects.
[in] | degree | The degree of the spline to create. This must be a positive odd value. |
[in] | x | Values of the independent variable for each Bezier control point. |
[in] | y | Values of the dependent variables for each Bezier control point. |
|
inline |
Default constructor creates an empty Spline_ handle; not very useful.
|
inline |
Copy constructor is shallow and reference-counted; that is, the new Spline_ refers to the same object as does source.
|
inline |
Destructor decrements the reference count and frees the heap space if this is the last reference.
|
inline |
Copy assignment is shallow and reference-counted; that is, after the assignment this Spline_ refers to the same object as does source.
|
inline |
Calculate the values of the dependent variables at a particular value of the independent variable.
[in] | x | The value of the independent variable. |
|
inline |
Calculate a derivative of the spline function with respect to its independent variable, at the given value.
[in] | order | Which derivative? order==1 returns first derivative, order==2 is second, etc. Must be >= 1. |
[in] | x | The value of the independent variable about which the derivative is taken. |
|
inline |
Get the locations (that is, the values of the independent variable) for each of the Bezier control points.
|
inline |
Get the values of the dependent variables at each of the Bezier control points.
|
inline |
Get the degree of the spline.
|
inlineoverridevirtual |
Alternate signature provided to implement the generic Function_ interface expects a one-element Vector for the independent variable.
Implements SimTK::Function_< T >.
|
inlineoverridevirtual |
Alternate signature provided to implement the generic Function_ interface expects an awkward derivComponents argument, and takes a one-element Vector for the independent variable.
Because Spline_ only allows a single independent variable, all elements of derivComponents should be 0; only its length determines the order of the derivative to calculate.
Implements SimTK::Function_< T >.
|
inline |
For the Function_ style interface, this provides compatibility with std::vector.
No copying or heap allocation is required.
|
inlineoverridevirtual |
Required by the Function_ interface.
Implements SimTK::Function_< T >.
|
inlineoverridevirtual |
Required by the Function_ interface.
Implements SimTK::Function_< T >.
|
inlineoverridevirtual |
Required by the Function_ interface.
Reimplemented from SimTK::Function_< T >.