#include <interpolater.hxx>
Inheritance diagram for SGInterpTable:

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. | |
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.
| SGInterpTable::SGInterpTable | ( | ) |
| SGInterpTable::SGInterpTable | ( | const SGPropertyNode * | interpolation | ) |
Constructor.
Loads the interpolation table from an interpolation property node.
| 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.
| file | name of interpolation file |
Definition at line 55 of file interpolater.cxx.
References sg_gzifstream::is_open(), SG_LOG, skipcomment(), and skipws().
| void SGInterpTable::addEntry | ( | double | ind, | |
| double | dep | |||
| ) |
Add an entry to the table, extending the table's length.
| 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.
| x | independent 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().
1.5.1