]> git.mxchange.org Git - simgear.git/blobdiff - simgear/math/interpolater.cxx
Merge branch 'ehofman/sound'
[simgear.git] / simgear / math / interpolater.cxx
index ae2af9b65ed0ecf51124e3f66cebca146902ae13..1bbbadc801d2a427ccd91cb8ac66cb3ef18d7f6e 100644 (file)
 //
 // $Id$
 
+#ifdef HAVE_CONFIG_H
+#  include <simgear_config.h>
+#endif
 
 #include <simgear/compiler.h>
 
-#include STL_STRING
+#include <string>
 
 #include <simgear/debug/logstream.hxx>
 #include <simgear/misc/sgstream.hxx>
+#include <simgear/props/props.hxx>
 
 #include "interpolater.hxx"
 
-SG_USING_STD(string);
+#include <simgear/math/SGMath.hxx>
+
+using std::string;
 
 // Constructor -- starts with an empty table.
 SGInterpTable::SGInterpTable()
 {
 }
 
+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