#include <simgear/debug/logstream.hxx>
#include <simgear/misc/sgstream.hxx>
+#include <simgear/props/props.hxx>
#include "interpolater.hxx"
{
}
+SGInterpTable::SGInterpTable(const SGPropertyNode* interpolation)
+{
+ if (!interpolation)
+ return;
+ std::vector<SGPropertyNode_ptr> entries = interpolation->getChildren("entry");
+ for (unsigned i = 0; i < entries.size(); ++i)
+ addEntry(entries[i]->getDoubleValue("ind", 0.0),
+ entries[i]->getDoubleValue("dep", 0.0));
+}
// Constructor -- loads the interpolation table from the specified
// file
#include STL_STRING
SG_USING_STD(string);
+class SGPropertyNode;
+
/**
* A class that provids a simple linear 2d interpolation lookup table.
* The actual table is expected to be loaded from a file. The
*/
SGInterpTable();
+ /**
+ * Constructor. Loads the interpolation table from an interpolation
+ * property node.
+ * @param interpolation property node having entry children
+ */
+ SGInterpTable(const SGPropertyNode* interpolation);
+
/**
* Constructor. Loads the interpolation table from the specified file.
* @param file name of interpolation file