Spline_< T > Class Template Reference

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

#include <Spline.h>

Inheritance diagram for Spline_< T >:
Function_< 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 std::vector< 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.

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

Spline_ ( int  degree,
const Vector x,
const Vector_< T > &  y 
) [inline]

Create a Spline_ object based on a set of control points.

Parameters:
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
Spline_ ( const Spline_< T > &  copy  )  [inline]
Spline_ (  )  [inline]
~Spline_ (  )  [inline]

Member Function Documentation

T calcDerivative ( const std::vector< 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 Function_< T >.

References SplineImpl::getDerivative(), and VectorBase< ELT >::size().

T calcValue ( const Vector x  )  const [inline, virtual]

Calculate the values of the dependent variables at a particular value of the independent variable.

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

Implements Function_< T >.

References SplineImpl::getValue(), and VectorBase< ELT >::size().

int getArgumentSize (  )  const [inline, virtual]

Get the number of components expected in the input vector.

Implements Function_< T >.

const Vector& getControlPointLocations (  )  const [inline]

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

References SplineImpl::x.

const Vector_<T>& getControlPointValues (  )  const [inline]

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

References SplineImpl::y.

int getMaxDerivativeOrder (  )  const [inline, virtual]

Get the maximum derivative order this Function_ object can calculate.

Implements Function_< T >.

References SimTK::max().

int getSplineDegree (  )  const [inline]

Get the degree of the spline.

References SplineImpl::degree.

Spline_& operator= ( const Spline_< T > &  copy  )  [inline]

The documentation for this class was generated from the following file:

Generated on Wed Dec 30 11:05:16 2009 for SimTKcore by  doxygen 1.6.1