X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fmath%2Finterpolater.cxx;h=1bbbadc801d2a427ccd91cb8ac66cb3ef18d7f6e;hb=11479cd8c386d8bf7e1fee7bed60ab4abefc5fad;hp=ae2af9b65ed0ecf51124e3f66cebca146902ae13;hpb=a3bc2eb836466a141ab48efa05b2c3d34c4d383b;p=simgear.git diff --git a/simgear/math/interpolater.cxx b/simgear/math/interpolater.cxx index ae2af9b6..1bbbadc8 100644 --- a/simgear/math/interpolater.cxx +++ b/simgear/math/interpolater.cxx @@ -22,23 +22,38 @@ // // $Id$ +#ifdef HAVE_CONFIG_H +# include +#endif #include -#include STL_STRING +#include #include #include +#include #include "interpolater.hxx" -SG_USING_STD(string); +#include + +using std::string; // Constructor -- starts with an empty table. SGInterpTable::SGInterpTable() { } +SGInterpTable::SGInterpTable(const SGPropertyNode* interpolation) +{ + if (!interpolation) + return; + std::vector 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