UT_Spline Class Reference

#include <UT_Spline.h>

List of all members.

Public Member Functions

 UT_Spline ()
 ~UT_Spline ()
UT_SPLINE_BASIS getGlobalBasis () const
 Query the basis or knot length of the spline.
int getVectorSize () const
int getKnotLength () const
fpreal64 getTension () const
void setGlobalBasis (UT_SPLINE_BASIS b)
void setSize (int nkeys, int vector_size)
void setTension (fpreal64 t)
void setBasis (int key, UT_SPLINE_BASIS b)
void setValue (int key, const fpreal32 *value, int size)
void setValue (int key, const fpreal64 *value, int size)
bool evaluate (fpreal t, fpreal32 *result, int size, UT_ColorType interp_space) const
bool evaluate (fpreal t, fpreal64 *result, int size, UT_ColorType interp_space) const
bool evaluateMulti (fpreal t, fpreal32 *result, int n, UT_ColorType interp_space) const
bool evaluateMulti (fpreal t, fpreal64 *result, int n, UT_ColorType interp_space) const

Static Public Member Functions

template<typename T >
static T evalCubic (T kt, T dt, T iv, T im, T ov, T om)
static fpreal64 getMonotoneSlopeFC (fpreal64 v_cur, fpreal64 t_cur, fpreal64 v_prev, fpreal64 t_prev, fpreal64 v_next, fpreal64 t_next)
static fpreal64 getMonotoneSlopePA (fpreal64 v_cur, fpreal64 t_cur, fpreal64 v_prev, fpreal64 t_prev, fpreal64 v_next, fpreal64 t_next)


Detailed Description

The Linear & Catmull-Rom splines expect a parametric coordinate for evaluation between 0 and 1. The Catmull-Rom spline requires additional key values at the beginning and end of the spline to evaluate the slopes of the Hermite spline properly.

The LinearSolve only works on scalar values. It will compute the parametric coordinate associated with the value passed in. This can be used to simulate non-uniform keys on the spline.

Definition at line 51 of file UT_Spline.h.


Constructor & Destructor Documentation

UT_Spline::UT_Spline (  ) 

UT_Spline::~UT_Spline (  ) 


Member Function Documentation

template<typename T >
static T UT_Spline::evalCubic ( kt,
dt,
iv,
im,
ov,
om 
) [inline, static]

Given the keys surrounding a channel segment, evaluate it as cubic hermite spline. This function assumes dt > 0. kt is [0,1] which maps over the dt time interval.

Definition at line 131 of file UT_Spline.h.

bool UT_Spline::evaluate ( fpreal  t,
fpreal64 result,
int  size,
UT_ColorType  interp_space 
) const

Evaluate the spline using the global basis. When interp_space is not UT_RGB, then values are treated as UT_RGBA and converted into the desired color space before being interpolated. The result is always returned as UT_RGBA.

bool UT_Spline::evaluate ( fpreal  t,
fpreal32 result,
int  size,
UT_ColorType  interp_space 
) const

Evaluate the spline using the global basis. When interp_space is not UT_RGB, then values are treated as UT_RGBA and converted into the desired color space before being interpolated. The result is always returned as UT_RGBA.

bool UT_Spline::evaluateMulti ( fpreal  t,
fpreal64 result,
int  n,
UT_ColorType  interp_space 
) const

Evaluate the spline using multiple basis types depending on t. Also unlike evaluate(), evaluateMulti() doesn't require extra keys for Catmull-Rom on the ends. It always evaluates using a 0 slope at the ends.

bool UT_Spline::evaluateMulti ( fpreal  t,
fpreal32 result,
int  n,
UT_ColorType  interp_space 
) const

Evaluate the spline using multiple basis types depending on t. Also unlike evaluate(), evaluateMulti() doesn't require extra keys for Catmull-Rom on the ends. It always evaluates using a 0 slope at the ends.

UT_SPLINE_BASIS UT_Spline::getGlobalBasis (  )  const [inline]

Query the basis or knot length of the spline.

Definition at line 57 of file UT_Spline.h.

int UT_Spline::getKnotLength (  )  const [inline]

Definition at line 59 of file UT_Spline.h.

static fpreal64 UT_Spline::getMonotoneSlopeFC ( fpreal64  v_cur,
fpreal64  t_cur,
fpreal64  v_prev,
fpreal64  t_prev,
fpreal64  v_next,
fpreal64  t_next 
) [static]

Return _monotone_ cubic Hermite slopes at the current knot given the previous and next knots. Fritsch-Carlson (local) method. It gives relatively good looking C1 curves but might not give a C2 solution even if it exists. 1. Fritsch, F.N., Carlson, R.E., Monotone piecewise cubic interpolant, SIAM J. Numer. Anal., 17(1980), 238-246.

static fpreal64 UT_Spline::getMonotoneSlopePA ( fpreal64  v_cur,
fpreal64  t_cur,
fpreal64  v_prev,
fpreal64  t_prev,
fpreal64  v_next,
fpreal64  t_next 
) [static]

Paul Kupan's method. Similar to Fritsch-Carlson method except it gives more visually pleasing results when the intervals next to the knot are uneven. 2. Kupan, P.A., Monotone Interpolant Built with Slopes Obtained by Linear Combination, Studia Universitatis Babes-Bolyai Mathematica, 53(2008), 59-66.

fpreal64 UT_Spline::getTension (  )  const [inline]

Definition at line 60 of file UT_Spline.h.

int UT_Spline::getVectorSize (  )  const [inline]

Definition at line 58 of file UT_Spline.h.

void UT_Spline::setBasis ( int  key,
UT_SPLINE_BASIS  b 
)

Set the basis for the given key index. This will also set the global basis.

void UT_Spline::setGlobalBasis ( UT_SPLINE_BASIS  b  )  [inline]

Definition at line 62 of file UT_Spline.h.

void UT_Spline::setSize ( int  nkeys,
int  vector_size 
)

Construction of the spline object. All values are initialized to 0. Warning, calling setSize() will clear all existing values.

void UT_Spline::setTension ( fpreal64  t  ) 

Cubic splines may have a "tension". The tension defaults to 0.5 which results in Catmull-Rom splines.

void UT_Spline::setValue ( int  key,
const fpreal64 value,
int  size 
)

Once the spline has been constructed, the values need to be set. It is possible to change values between evaluations.

void UT_Spline::setValue ( int  key,
const fpreal32 value,
int  size 
)

Once the spline has been constructed, the values need to be set. It is possible to change values between evaluations.


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

Generated on Fri May 25 00:10:55 2012 for HDK by  doxygen 1.5.9