- // Constructor -- loads the interpolation table from the specified
- // file
- fgINTERPTABLE( const string& file );
-
- // Given an x value, linearly interpolate the y value from the table
- double interpolate(double x);
-
- // Destructor
- ~fgINTERPTABLE( void );
+ /**
+ * Constructor. Creates a new, empty table.
+ */
+ 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
+ */
+ SGInterpTable( const string& file );
+
+
+ /**
+ * Add an entry to the table, extending the table's length.
+ *
+ * @param ind The independent variable.
+ * @param dep The dependent variable.
+ */
+ void addEntry (double ind, double dep);
+
+
+ /**
+ * Given an x value, linearly interpolate the y value from the table.
+ * @param x independent variable
+ * @return interpolated dependent variable
+ */
+ double interpolate(double x) const;
+
+ /** Destructor */
+ ~SGInterpTable();
+
+private:
+ typedef std::map<double, double> Table;
+ Table _table;