Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

PointBasedMathFunction Class Reference

MathFunction based on bend points. More...

Inherits MathFunction< float, float >.

List of all members.

Public Types

enum  InterpolType { Linear, Poly, Snap }

Public Member Functions

 PointBasedMathFunction (InterpolType t=Linear, bool extr=true)
void setEmpty ()
int size () const
void add (float x, float y)
void remove (int idx)
float getValue (float x) const
const TypeSet< float > & xVals () const
const TypeSet< float > & yVals () const
InterpolType interpolType () const
bool extrapolate () const
void setInterpolType (InterpolType t)
void setExtrapolate (bool yn)

Protected Member Functions

int baseIdx (float) const
float snapVal (float) const
float interpVal (float) const
float outsideVal (float) const

Protected Attributes

InterpolType itype_
bool extrapol_
TypeSet< float > x_
TypeSet< float > y_

Detailed Description

MathFunction based on bend points.

The object maintains sorted positions (in X), so you cannot bluntly stuff X and Y in. You cannot change or remove positions; instead make a copy.

If the given point is outside the 'defined' X-range, the value can be undef or the first/last defined point's value, depending on the 'extrapol_' setting. If no point at all is defined you will always get undef.

You can add undefined Y-values, but not undef X-values (those add()'s simply return). Undef sections are therefore supported.


Member Enumeration Documentation

Enumerator:
Linear 
Poly 
Snap 

Constructor & Destructor Documentation

PointBasedMathFunction::PointBasedMathFunction ( InterpolType  t = Linear,
bool  extr = true 
) [inline]

Member Function Documentation

void PointBasedMathFunction::add ( float  x,
float  y 
)
int PointBasedMathFunction::baseIdx ( float   )  const [protected]
bool PointBasedMathFunction::extrapolate (  )  const [inline]
float PointBasedMathFunction::getValue ( float  x  )  const [inline, virtual]
InterpolType PointBasedMathFunction::interpolType (  )  const [inline]
float PointBasedMathFunction::interpVal ( float   )  const [protected]
float PointBasedMathFunction::outsideVal ( float   )  const [protected]
void PointBasedMathFunction::remove ( int  idx  ) 
void PointBasedMathFunction::setEmpty (  )  [inline]
void PointBasedMathFunction::setExtrapolate ( bool  yn  )  [inline]
void PointBasedMathFunction::setInterpolType ( InterpolType  t  )  [inline]
int PointBasedMathFunction::size (  )  const [inline]
float PointBasedMathFunction::snapVal ( float   )  const [protected]
const TypeSet<float>& PointBasedMathFunction::xVals (  )  const [inline]
const TypeSet<float>& PointBasedMathFunction::yVals (  )  const [inline]

Member Data Documentation

TypeSet<float> PointBasedMathFunction::x_ [protected]
TypeSet<float> PointBasedMathFunction::y_ [protected]