Simbody
Classes | Public Member Functions

SimTK::Spline_< T > Class Template Reference

This class implements a non-uniform B-spline curve. More...

#include <Spline.h>

Inheritance diagram for SimTK::Spline_< T >:

List of all members.

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_ &copy)
 Spline_ ()
Spline_operator= (const Spline_ &copy)
 ~Spline_ ()
calcValue (const Vector &x) const
 Calculate the values of the dependent variables at a particular value of the independent variable.
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 VectorgetControlPointLocations () 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.
calcDerivative (const std::vector< int > &derivComponents, const Vector &x) const
 This provides compatibility with std::vector without requiring any copying.

Detailed Description

template<class T>
class SimTK::Spline_< T >

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>.


Constructor & Destructor Documentation

template<class T>
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.

Parameters:
degreethe degree of the spline to create. This must be a positive odd value.
xthe values of the independent variable for each control point
ythe values of the dependent variables for each control point
template<class T>
SimTK::Spline_< T >::Spline_ ( const Spline_< T > &  copy) [inline]
template<class T>
SimTK::Spline_< T >::Spline_ ( ) [inline]
template<class T>
SimTK::Spline_< T >::~Spline_ ( ) [inline]

Member Function Documentation

template<class T>
Spline_& SimTK::Spline_< T >::operator= ( const Spline_< T > &  copy) [inline]
template<class T>
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.

Parameters:
xa Vector of length 1 containing the value of the independent variable.

Implements SimTK::Function_< T >.

template<class 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 >.

template<class T>
int SimTK::Spline_< T >::getArgumentSize ( ) const [inline, virtual]

Get the number of components expected in the input vector.

Implements SimTK::Function_< T >.

template<class T>
int SimTK::Spline_< T >::getMaxDerivativeOrder ( ) const [inline, virtual]

Get the maximum derivative order this Function_ object can calculate.

Implements SimTK::Function_< T >.

template<class T>
const Vector& SimTK::Spline_< T >::getControlPointLocations ( ) const [inline]

Get the locations (that is, the values of the independent variable) of the control points.

template<class T>
const Vector_<T>& SimTK::Spline_< T >::getControlPointValues ( ) const [inline]

Get the values of the dependent variables at the control points.

template<class T>
int SimTK::Spline_< T >::getSplineDegree ( ) const [inline]

Get the degree of the spline.

template<class T>
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 >.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines