#include <UT_Spline.h>
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) |
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.
| UT_Spline::UT_Spline | ( | ) |
| UT_Spline::~UT_Spline | ( | ) |
| static T UT_Spline::evalCubic | ( | T | kt, | |
| T | dt, | |||
| T | iv, | |||
| T | im, | |||
| T | ov, | |||
| T | 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 |
| bool UT_Spline::evaluate | ( | fpreal | t, | |
| fpreal32 * | result, | |||
| int | size, | |||
| UT_ColorType | interp_space | |||
| ) | const |
| 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] |
| 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.
1.5.9