[cig-commits] r18918 - cs/spatialdata/trunk/libsrc/spatialdb

brad at geodynamics.org brad at geodynamics.org
Fri Sep 16 08:32:11 PDT 2011


Author: brad
Date: 2011-09-16 08:32:11 -0700 (Fri, 16 Sep 2011)
New Revision: 18918

Modified:
   cs/spatialdata/trunk/libsrc/spatialdb/TimeHistory.cc
   cs/spatialdata/trunk/libsrc/spatialdb/TimeHistory.hh
Log:
Create float version of query for TimeHistory.

Modified: cs/spatialdata/trunk/libsrc/spatialdb/TimeHistory.cc
===================================================================
--- cs/spatialdata/trunk/libsrc/spatialdb/TimeHistory.cc	2011-09-16 02:03:30 UTC (rev 18917)
+++ cs/spatialdata/trunk/libsrc/spatialdb/TimeHistory.cc	2011-09-16 15:32:11 UTC (rev 18918)
@@ -74,7 +74,6 @@
   _npts = 0;
 } // close
 
-#include <iostream>
 // ----------------------------------------------------------------------
 // Query the database.
 int
@@ -118,4 +117,19 @@
 } // query
 
 
+// ----------------------------------------------------------------------
+// Query the database.
+int
+spatialdata::spatialdb::TimeHistory::query(float* value,
+					   const float t)
+{ // query
+  double valueD = 0.0;
+  const double tD = t;
+
+  const int err = query(&valueD, tD);
+  *value = valueD;
+  return err;
+} // query
+
+
 // End of file 

Modified: cs/spatialdata/trunk/libsrc/spatialdb/TimeHistory.hh
===================================================================
--- cs/spatialdata/trunk/libsrc/spatialdb/TimeHistory.hh	2011-09-16 02:03:30 UTC (rev 18917)
+++ cs/spatialdata/trunk/libsrc/spatialdb/TimeHistory.hh	2011-09-16 15:32:11 UTC (rev 18918)
@@ -89,6 +89,18 @@
   int query(double* value,
 	    const double t);
 
+  /** Query the database.
+   *
+   * @pre Must call open() before query()
+   *
+   * @param value Value in time history.
+   * @param t Time for query.
+   *
+   * @returns 0 on success, 1 on failure (i.e., could not interpolate)
+   */
+  int query(float* value,
+	    const float t);
+
 private :
  // PRIVATE MEMBERS ////////////////////////////////////////////////////
   



More information about the CIG-COMMITS mailing list