SGInterpTable Class Reference

A class that provids a simple linear 2d interpolation lookup table. More...

#include <interpolater.hxx>

Inheritance diagram for SGInterpTable:

SGReferenced List of all members.

Public Member Functions

 SGInterpTable ()
 Constructor.
 SGInterpTable (const SGPropertyNode *interpolation)
 Constructor.
 SGInterpTable (const string &file)
 Constructor.
void addEntry (double ind, double dep)
 Add an entry to the table, extending the table's length.
double interpolate (double x) const
 Given an x value, linearly interpolate the y value from the table.
 ~SGInterpTable ()
 Destructor.

Detailed Description

A class that provids a simple linear 2d interpolation lookup table.

The actual table is expected to be loaded from a file. The independant variable must be strictly ascending. The dependent variable can be anything.

Definition at line 53 of file interpolater.hxx.


Constructor & Destructor Documentation

SGInterpTable::SGInterpTable (  ) 

Constructor.

Creates a new, empty table.

Definition at line 39 of file interpolater.cxx.

SGInterpTable::SGInterpTable ( const SGPropertyNode interpolation  ) 

Constructor.

Loads the interpolation table from an interpolation property node.

Parameters:
interpolation property node having entry children

Definition at line 43 of file interpolater.cxx.

References addEntry(), and SGPropertyNode::getChildren().

SGInterpTable::SGInterpTable ( const string &  file  ) 

Constructor.

Loads the interpolation table from the specified file.

Parameters:
file name of interpolation file

Definition at line 55 of file interpolater.cxx.

References sg_gzifstream::is_open(), SG_LOG, skipcomment(), and skipws().


Member Function Documentation

void SGInterpTable::addEntry ( double  ind,
double  dep 
)

Add an entry to the table, extending the table's length.

Parameters:
ind The independent variable.
dep The dependent variable.

Definition at line 76 of file interpolater.cxx.

Referenced by SGInterpTable().

double SGInterpTable::interpolate ( double  x  )  const

Given an x value, linearly interpolate the y value from the table.

Parameters:
x independent variable
Returns:
interpolated dependent variable

Definition at line 82 of file interpolater.cxx.

Referenced by SGDistScaleAnimation::distScaleCallback(), SGTexTranslateAnimation::update(), SGTexRotateAnimation::update(), SGScaleAnimation::update(), SGTranslateAnimation::update(), SGBlendAnimation::update(), and SGRotateAnimation::update().


The documentation for this class was generated from the following files:
Generated on Mon Dec 17 09:30:57 2007 for SimGear by  doxygen 1.5.1