- string-based version will be removed in the future.
return;
}
+ in >> skipcomment;
+ while ( in ) {
+ double ind, dep;
+ in >> ind >> dep;
+ in >> std::skipws;
+ _table[ind] = dep;
+ }
+}
+
+
+// Constructor -- loads the interpolation table from the specified
+// file
+SGInterpTable::SGInterpTable( const SGPath& file )
+{
+ SG_LOG( SG_MATH, SG_INFO, "Initializing Interpolator for " << file );
+
+ sg_gzifstream in( file );
+ if ( !in.is_open() ) {
+ SG_LOG( SG_GENERAL, SG_ALERT, "Cannot open file: " << file );
+ return;
+ }
+
in >> skipcomment;
while ( in ) {
double ind, dep;
#include <string>
class SGPropertyNode;
+class SGPath;
/**
* A class that provids a simple linear 2d interpolation lookup table.
*/
SGInterpTable( const std::string& file );
-
+ /**
+ * Constructor. Loads the interpolation table from the specified file.
+ * @param file name of interpolation file
+ */
+ SGInterpTable( const SGPath& path );
+
/**
* Add an entry to the table, extending the table's length.
*