X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fmath%2Finterpolater.hxx;h=393e39ffb267ba58c3bfe0505d1a8f1fda2903db;hb=3cd4c5566f8c418bc9bbb6026072eb0192027993;hp=1fdee24d82feab7a062094595899218b2eea9759;hpb=dcb95d131bc6aef1abe25d1f415e309f06e52436;p=simgear.git diff --git a/simgear/math/interpolater.hxx b/simgear/math/interpolater.hxx index 1fdee24d..393e39ff 100644 --- a/simgear/math/interpolater.hxx +++ b/simgear/math/interpolater.hxx @@ -35,12 +35,14 @@ #include -#include -SG_USING_STD(vector); +#include -#include STL_STRING -SG_USING_STD(string); +#include +#include +using std::string; + +class SGPropertyNode; /** * A class that provids a simple linear 2d interpolation lookup table. @@ -48,21 +50,7 @@ SG_USING_STD(string); * independant variable must be strictly ascending. The dependent * variable can be anything. */ -class SGInterpTable { - - struct Entry - { - Entry () - : ind(0.0L), dep(0.0L) {} - Entry (double independent, double dependent) - : ind(independent), dep(dependent) {} - double ind; - double dep; - }; - - int size; - vector table; - +class SGInterpTable : public SGReferenced { public: /** @@ -70,6 +58,13 @@ public: */ 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 @@ -95,6 +90,10 @@ public: /** Destructor */ ~SGInterpTable(); + +private: + typedef std::map Table; + Table _table; };