HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_SplineCubic Class Reference

#include <UT_Spline.h>

Public Member Functions

template<float(func)(const float *, float) >
SYS_STATIC_FORCE_INLINE void enlargeBoundingBoxCommon (UT_BoundingBox &box, const UT_Vector3 *cvs, const UT_Vector3 &a, const UT_Vector3 &b, const UT_Vector3 &c, float rootmin, float rootmax)
 
template<>
SYS_FORCE_INLINE UT_Vector3 evalOpen (const UT_Vector3 *cvs, float t)
 
template<>
SYS_FORCE_INLINE float evalOpen (const float *cvs, float t)
 
template<>
void evalRangeOpen (UT_Vector3 *results, const UT_Vector3 *cvs, float start_t, float step_t, int len_t, int nseg)
 
template<>
void evalRangeOpen (float *results, const float *cvs, float start_t, float step_t, int len_t, int nseg)
 
template<>
SYS_FORCE_INLINE UT_Vector3 evalClosed (const UT_Vector3 *cvs, float t, int seg, int nseg, bool deriv)
 
template<>
SYS_FORCE_INLINE float evalClosed (const float *cvs, float t, int seg, int nseg, bool deriv)
 
template<>
void evalRangeClosed (UT_Vector3 *results, const UT_Vector3 *cvs, float start_t, float step_t, int len_t, int nseg, bool deriv)
 
template<>
void evalRangeClosed (float *results, const float *cvs, float start_t, float step_t, int len_t, int nseg, bool deriv)
 

Static Public Member Functions

template<typename T >
static T evalOpen (const T *cvs, float t)
 
template<typename T >
static void evalRangeOpen (T *results, const T *cvs, float start_t, float step_t, int len_t, int nseg)
 
template<typename T >
static T evalClosed (const T *cvs, float t, int seg, int nseg, bool deriv=false)
 
template<typename T >
static void evalRangeClosed (T *results, const T *cvs, float start_t, float step_t, int len_t, int nseg, bool deriv=false)
 
template<typename T >
static T evalSubDStart (const T *cvs, float t)
 
template<typename T >
static T evalSubDEnd (const T *cvs, float t)
 
static void enlargeBoundingBoxOpen (UT_BoundingBox &box, const UT_Vector3 *cvs, float rootmin, float rootmax)
 
static void enlargeBoundingBoxSubDStart (UT_BoundingBox &box, const UT_Vector3 *cvs, float rootmin, float rootmax)
 
static void enlargeBoundingBoxSubDEnd (UT_BoundingBox &box, const UT_Vector3 *cvs, float rootmin, float rootmax)
 
static UT_Matrix4 getOpenWeights ()
 
static UT_Matrix4 getOpenWeightsTranspose ()
 
template<typename T >
static T evalMatrix (const UT_Matrix4 &basis, const T cvs[4], float t)
 
template<typename T >
static T evalSubDCurve (const T *cvs, float t, int npts, bool deriv=false)
 
static UT_Matrix4 getClosedWeights (int seg, int nseg, bool deriv=false)
 
static UT_Matrix4 getClosedWeightsTranspose (int seg, int nseg, bool deriv=false)
 

Static Public Attributes

static const UT_Matrix4 theSubDFirstBasis
 
static const UT_Matrix4 theSubDFirstDerivBasis
 
static const UT_Matrix4 theOpenBasis
 
static const UT_Matrix4 theOpenDerivBasis
 
static const UT_Matrix4 theInterpFirstBasis
 
static const UT_Matrix4 theInterpBasis
 
static const UT_Matrix4 theHermiteBasis
 
static const UT_Matrix4 theHermiteDerivBasis
 

Detailed Description

Definition at line 54 of file UT_Spline.h.

Member Function Documentation

template<float(func)(const float *, float) >
SYS_STATIC_FORCE_INLINE void UT_SplineCubic::enlargeBoundingBoxCommon ( UT_BoundingBox box,
const UT_Vector3 cvs,
const UT_Vector3 a,
const UT_Vector3 b,
const UT_Vector3 c,
float  rootmin,
float  rootmax 
)
inline

Definition at line 194 of file UT_Spline.h.

void UT_SplineCubic::enlargeBoundingBoxOpen ( UT_BoundingBox box,
const UT_Vector3 cvs,
float  rootmin,
float  rootmax 
)
inlinestatic

Enlarges box by any minima/maxima of the cubic curve defined by 4 cvs, that lie between rootmin and rootmax. NOTE: This must be defined below so that it doesn't instantiate evalOpen before its specialization below.

Definition at line 1460 of file UT_Spline.h.

void UT_SplineCubic::enlargeBoundingBoxSubDEnd ( UT_BoundingBox box,
const UT_Vector3 cvs,
float  rootmin,
float  rootmax 
)
inlinestatic

Enlarges box by any minima/maxima of the cubic curve defined by cvs, that lie between rootmin and rootmax. The curve in this case is the end segment of a subdivision curve.

Definition at line 1513 of file UT_Spline.h.

void UT_SplineCubic::enlargeBoundingBoxSubDStart ( UT_BoundingBox box,
const UT_Vector3 cvs,
float  rootmin,
float  rootmax 
)
inlinestatic

Enlarges box by any minima/maxima of the cubic curve defined by 3 cvs, that lie between rootmin and rootmax. The curve in this case is the start segment of a subdivision curve.

Definition at line 1484 of file UT_Spline.h.

template<typename T >
static T UT_SplineCubic::evalClosed ( const T cvs,
float  t,
int  seg,
int  nseg,
bool  deriv = false 
)
inlinestatic

Evaluates a closed spline at the given location. The given cv list must have 4 elements. Whether we are end interpolated or not depends on which segment this represents. The cvs list should be the cvs for the current segment and t in [0, 1]

Definition at line 112 of file UT_Spline.h.

template<>
SYS_FORCE_INLINE UT_Vector3 UT_SplineCubic::evalClosed ( const UT_Vector3 cvs,
float  t,
int  seg,
int  nseg,
bool  deriv 
)

Definition at line 1189 of file UT_Spline.h.

template<>
SYS_FORCE_INLINE float UT_SplineCubic::evalClosed ( const float cvs,
float  t,
int  seg,
int  nseg,
bool  deriv 
)

Definition at line 1245 of file UT_Spline.h.

template<typename T >
static T UT_SplineCubic::evalMatrix ( const UT_Matrix4 basis,
const T  cvs[4],
float  t 
)
inlinestatic

Definition at line 286 of file UT_Spline.h.

template<typename T >
static T UT_SplineCubic::evalOpen ( const T cvs,
float  t 
)
inlinestatic

Evaluates an open spline at a given location. The given CV list must have 4 elements in it! The cvs should be for the current segment, and t in [0, 1]

Definition at line 61 of file UT_Spline.h.

template<>
SYS_FORCE_INLINE UT_Vector3 UT_SplineCubic::evalOpen ( const UT_Vector3 cvs,
float  t 
)

Definition at line 939 of file UT_Spline.h.

template<>
SYS_FORCE_INLINE float UT_SplineCubic::evalOpen ( const float cvs,
float  t 
)

Definition at line 993 of file UT_Spline.h.

template<typename T >
static void UT_SplineCubic::evalRangeClosed ( T results,
const T cvs,
float  start_t,
float  step_t,
int  len_t,
int  nseg,
bool  deriv = false 
)
inlinestatic

Evaluates a range of t values in uniform increasing manner. The cvs list should have 3 + nseg entries.

Definition at line 134 of file UT_Spline.h.

template<>
void UT_SplineCubic::evalRangeClosed ( UT_Vector3 results,
const UT_Vector3 cvs,
float  start_t,
float  step_t,
int  len_t,
int  nseg,
bool  deriv 
)
inline

Definition at line 1293 of file UT_Spline.h.

template<>
void UT_SplineCubic::evalRangeClosed ( float results,
const float cvs,
float  start_t,
float  step_t,
int  len_t,
int  nseg,
bool  deriv 
)
inline

Definition at line 1382 of file UT_Spline.h.

template<typename T >
static void UT_SplineCubic::evalRangeOpen ( T results,
const T cvs,
float  start_t,
float  step_t,
int  len_t,
int  nseg 
)
inlinestatic

Evaluates a range of t values in uniform increasing manner. The cvs list should have 3 + nseg entries.

Definition at line 83 of file UT_Spline.h.

template<>
void UT_SplineCubic::evalRangeOpen ( UT_Vector3 results,
const UT_Vector3 cvs,
float  start_t,
float  step_t,
int  len_t,
int  nseg 
)
inline

Definition at line 1039 of file UT_Spline.h.

template<>
void UT_SplineCubic::evalRangeOpen ( float results,
const float cvs,
float  start_t,
float  step_t,
int  len_t,
int  nseg 
)
inline

Definition at line 1119 of file UT_Spline.h.

template<typename T >
static T UT_SplineCubic::evalSubDCurve ( const T cvs,
float  t,
int  npts,
bool  deriv = false 
)
inlinestatic

This function is for evaluating a subdivision curve that is open. For simplicitly, the parameter range is [0,1]. It's implemented in a way that maximizes stability and readability, not necessarily performance.

Definition at line 303 of file UT_Spline.h.

template<typename T >
static T UT_SplineCubic::evalSubDEnd ( const T cvs,
float  t 
)
inlinestatic

Definition at line 175 of file UT_Spline.h.

template<typename T >
static T UT_SplineCubic::evalSubDStart ( const T cvs,
float  t 
)
inlinestatic

Definition at line 159 of file UT_Spline.h.

static UT_Matrix4 UT_SplineCubic::getClosedWeights ( int  seg,
int  nseg,
bool  deriv = false 
)
inlinestatic

Uniform knots with closed end conditions. seg is which segment is being evaluates, nseg is the total. nseg should be number of vertices minus three as we have cubics.

Definition at line 402 of file UT_Spline.h.

static UT_Matrix4 UT_SplineCubic::getClosedWeightsTranspose ( int  seg,
int  nseg,
bool  deriv = false 
)
inlinestatic

Definition at line 555 of file UT_Spline.h.

static UT_Matrix4 UT_SplineCubic::getOpenWeights ( )
inlinestatic

Returns the weights for a power-basis evaluation of a segment. The t values should be normalized inside the segment. The format is (1, t, t^2, t^3), and colVecMult. Assumes uniform knots.

Definition at line 270 of file UT_Spline.h.

static UT_Matrix4 UT_SplineCubic::getOpenWeightsTranspose ( )
inlinestatic

Definition at line 277 of file UT_Spline.h.

Member Data Documentation

const UT_Matrix4 UT_SplineCubic::theHermiteBasis
static

Basis for Hermite cubic curve using two values (p) and two derivatives (v): Evaluation is: [p[0] p[1] v[0] v[1]] * theHermiteBasis * [1 t t^2 t^3]^T

Definition at line 391 of file UT_Spline.h.

const UT_Matrix4 UT_SplineCubic::theHermiteDerivBasis
static

Basis for derivative of Hermite cubic curve using two values (p) and two derivatives (v): Evaluation is: [p[0] p[1] v[0] v[1]] * theHermiteDerivBasis * [1 t t^2 t^3]^T FYI: The last column is all zero, since the derivative has no cubic component.

Definition at line 397 of file UT_Spline.h.

const UT_Matrix4 UT_SplineCubic::theInterpBasis
static

Basis for middle segment of interpolating curve. Evaluation is: [p[-1] p[0] p[1] p[2]] * theInterpBasis * [1 t t^2 t^3]^T

Definition at line 386 of file UT_Spline.h.

const UT_Matrix4 UT_SplineCubic::theInterpFirstBasis
static

Basis for first segment of interpolating curve. Evaluation is: [p[0] p[1] p[2] p[3]] * theInterpFirstBasis * [1 t t^2 t^3]^T The last segment can be evaluated as: (NOTE the reversed order and 1-t) [p[n-1] p[n-2] p[n-3] p[n-4]] * theInterpFirstBasis * [1 (1-t) (1-t)^2 (1-t)^3]^T FYI: The last row is all zero, since it only depends on 3 points.

Definition at line 382 of file UT_Spline.h.

const UT_Matrix4 UT_SplineCubic::theOpenBasis
static

Basis for middle segment of subd curve or uniform, open, cubic NURBS. Evaluation is: [p[-1] p[0] p[1] p[2]] * theOpenBasis * [1 t t^2 t^3]^T

Definition at line 369 of file UT_Spline.h.

const UT_Matrix4 UT_SplineCubic::theOpenDerivBasis
static

Basis for derivative of middle segment of subd curve or uniform, open, cubic NURBS. Evaluation is: [p[-1] p[0] p[1] p[2]] * theOpenDerivBasis * [1 t t^2 t^3]^T FYI: The last column is all zero, since the derivative has no cubic component.

Definition at line 375 of file UT_Spline.h.

const UT_Matrix4 UT_SplineCubic::theSubDFirstBasis
static

Basis for first segment of subd curve. Evaluation is: [p[0] p[1] p[2] p[3]] * theSubDFirstBasis * [1 t t^2 t^3]^T The last segment can be evaluated as: (NOTE the reversed order and 1-t) [p[n-1] p[n-2] p[n-3] p[n-4]] * theSubDFirstBasis * [1 (1-t) (1-t)^2 (1-t)^3]^T FYI: The last row is all zero, since it only depends on 3 points.

Definition at line 356 of file UT_Spline.h.

const UT_Matrix4 UT_SplineCubic::theSubDFirstDerivBasis
static

Basis for derivative of first segment of subd curve. Evaluation is: [p[0] p[1] p[2] p[3]] * theSubDFirstDerivBasis * [1 t t^2 t^3]^T The last segment derivative can be evaluated as: (NOTE the reversed order and 1-t) [p[n-1] p[n-2] p[n-3] p[n-4]] * theSubDFirstDerivBasis * [1 (1-t) (1-t)^2 t^3]^T FYI: The last row is all zero, since it only depends on 3 points. The last column is all zero, since the derivative has no cubic component.

Definition at line 364 of file UT_Spline.h.


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