SeExpr::SeCurve< T > Class Template Reference

Interpolation curve class for double->double and double->SeVec3D. More...

#include <SeCurve.h>

List of all members.

Classes

struct  CV

Public Types

enum  InterpType {
  kNone = 0, kLinear, kSmooth, kSpline,
  kMonotoneSpline
}
 

Supported interpolation types.

More...

Public Member Functions

 SeCurve ()
void addPoint (double position, const T &val, InterpType type)
 Adds a point to the curve.
void preparePoints ()
 Prepares points for evaluation (sorts and computes boundaries, clamps extrema).
getValue (const double param) const
 Evaluates curve and returns full value.
double getChannelValue (const double param, int channel) const
CV getLowerBoundCV (const double param) const
template<>
double comp (const double &val, const int)
template<>
double comp (const SeVec3d &val, const int i)
template<>
void clampCurveSegment (const double &delta, double &d1, double &d2)
template<>
void clampCurveSegment (const SeVec3d &delta, SeVec3d &d1, SeVec3d &d2)

Static Public Member Functions

static bool interpTypeValid (InterpType interp)
 Returns whether the given interpolation type is supported.
static bool cvLessThan (const CV &cv1, const CV &cv2)
 CV Parameter ordering (cv1._pos < cv2._pos).

Private Member Functions

void clampCurveSegment (const T &delta, T &d1, T &d2)
 Performs hermite derivative clamping in canonical space.

Static Private Member Functions

static double comp (const T &val, const int i)
 Returns a component of the given value.

Private Attributes

int cacheCV
std::vector< CV_cvData
bool prepared

Detailed Description

template<class T>
class SeExpr::SeCurve< T >

Interpolation curve class for double->double and double->SeVec3D.

Interpolation curve class for mapping from double -> double or double -> SeVec3D Subject to some interpolation points.

Each segment is interpolated according to the interpolation type specified on the left control point. Interpolation types supported are members of InterpType below.

Valid instantiation types for this are double, or SeVec3D

Definition at line 32 of file SeCurve.h.


Member Enumeration Documentation

template<class T>
enum SeExpr::SeCurve::InterpType

Supported interpolation types.

Enumerator:
kNone 
kLinear 
kSmooth 
kSpline 
kMonotoneSpline 

Definition at line 37 of file SeCurve.h.


Constructor & Destructor Documentation

template<class T >
SeExpr::SeCurve< T >::SeCurve (  )  [inline]

Definition at line 33 of file SeCurve.cpp.

References SeExpr::SeCurve< T >::_cvData, and SeExpr::SeCurve< T >::kNone.


Member Function Documentation

template<class T >
void SeExpr::SeCurve< T >::addPoint ( double  position,
const T &  val,
InterpType  type 
) [inline]

Adds a point to the curve.

Definition at line 41 of file SeCurve.cpp.

References SeExpr::SeCurve< T >::_cvData, and SeExpr::SeCurve< T >::prepared.

Referenced by CurveScene::rebuildCurve(), and CCurveScene::rebuildCurve().

template<>
void SeExpr::SeCurve< SeVec3d >::clampCurveSegment ( const SeVec3d delta,
SeVec3d d1,
SeVec3d d2 
) [inline]

Definition at line 237 of file SeCurve.cpp.

References SeExpr::clamp().

template<>
void SeExpr::SeCurve< double >::clampCurveSegment ( const double &  delta,
double &  d1,
double &  d2 
) [inline]

Definition at line 227 of file SeCurve.cpp.

References SeExpr::clamp().

template<class T>
void SeExpr::SeCurve< T >::clampCurveSegment ( const T &  delta,
T &  d1,
T &  d2 
) [private]

Performs hermite derivative clamping in canonical space.

Referenced by SeExpr::SeCurve< T >::preparePoints().

template<>
double SeExpr::SeCurve< SeVec3d >::comp ( const SeVec3d val,
const int  i 
) [inline]

Definition at line 23 of file SeCurve.cpp.

template<>
double SeExpr::SeCurve< double >::comp ( const double &  val,
const   int 
) [inline]

Definition at line 20 of file SeCurve.cpp.

template<class T>
static double SeExpr::SeCurve< T >::comp ( const T &  val,
const int  i 
) [static, private]

Returns a component of the given value.

Referenced by SeExpr::SeCurve< T >::getChannelValue().

template<class T >
bool SeExpr::SeCurve< T >::cvLessThan ( const CV cv1,
const CV cv2 
) [inline, static]
template<class T >
double SeExpr::SeCurve< T >::getChannelValue ( const double  param,
int  channel 
) const [inline]
template<class T >
SeCurve< T >::CV SeExpr::SeCurve< T >::getLowerBoundCV ( const double  param  )  const [inline]

Returns the control point that is less than the parameter, unless there is no point, in which case it returns the right point or nothing

Definition at line 207 of file SeCurve.cpp.

References SeExpr::SeCurve< T >::_cvData, SeExpr::SeCurve< T >::cvLessThan(), index(), SeExpr::SeCurve< T >::kLinear, SeExpr::max(), SeExpr::min(), and SeExpr::SeCurve< T >::prepared.

Referenced by CurveScene::mousePressEvent(), and CCurveScene::mousePressEvent().

template<class T >
T SeExpr::SeCurve< T >::getValue ( const double  param  )  const [inline]
template<class T >
bool SeExpr::SeCurve< T >::interpTypeValid ( InterpType  interp  )  [inline, static]

Returns whether the given interpolation type is supported.

Definition at line 220 of file SeCurve.cpp.

References SeExpr::SeCurve< T >::kLinear, SeExpr::SeCurve< T >::kMonotoneSpline, SeExpr::SeCurve< T >::kNone, SeExpr::SeCurve< T >::kSmooth, and SeExpr::SeCurve< T >::kSpline.

template<class T >
void SeExpr::SeCurve< T >::preparePoints (  )  [inline]

Member Data Documentation

template<class T>
std::vector<CV> SeExpr::SeCurve< T >::_cvData [private]
template<class T>
int SeExpr::SeCurve< T >::cacheCV [mutable, private]

Definition at line 34 of file SeCurve.h.

Referenced by SeExpr::SeCurve< T >::preparePoints().

template<class T>
bool SeExpr::SeCurve< T >::prepared [private]

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

Generated on 25 Jul 2013 for SeExpr by  doxygen 1.6.1