]> git.mxchange.org Git - flightgear.git/blobdiff - DEM/dem.hxx
Added a routine to dump out the portion of the dem data covered by a
[flightgear.git] / DEM / dem.hxx
index de96a3700d871c4a485ed7ac0116ed84ea19bad7..832a957ae528f0324c7564a704f822d7f4cb9245 100644 (file)
@@ -35,9 +35,7 @@
 
 #include <stdio.h>
 
-#include <Bucket/bucketutils.h>
-
-//#include <zlib/zlib.h>
+#include <Bucket/newbucket.hxx>
 #include <Misc/fgstream.hxx>
 
 
 #define DEM_SIZE_1 1201
 
 
-class fgDEM {
+class FGDem {
+
+private:
+
     // file pointer for input
     // gzFile fd;
     fg_gzifstream *in;
@@ -59,7 +60,7 @@ class fgDEM {
     // Distance between column and row data points (in arc seconds)
     double col_step, row_step;
     
-    // pointers to the actual mesh data allocated here
+    // pointers to the actual grid data allocated here
     float (*dem_data)[DEM_SIZE_1];
     float (*output_data)[DEM_SIZE_1];
 
@@ -90,18 +91,22 @@ class fgDEM {
     double next_double();
 
     // return next exponential num from input stream
-    int next_exp();
+    double next_exp();
 
 public:
 
     // Constructor
-    fgDEM( void );
+    FGDem( void );
+    FGDem( const string& file );
+
+    // Destructor
+    ~FGDem( void );
 
     // open a DEM file (use "-" if input is coming from stdin)
     int open ( const string& file );
 
     // close a DEM file
-    int close ();
+    int close();
 
     // parse a DEM file
     int parse();
@@ -112,17 +117,19 @@ public:
     // read and parse DEM "B" record
     void read_b_record();
 
-    // Informational methods
-    double info_originx( void ) { return(originx); }
-    double info_originy( void ) { return(originy); }
+    // write out the area of data covered by the specified bucket.
+    // Data is written out column by column starting at the lower left
+    // hand corner.
+    int write_area( const string& root, FGBucket& b, bool compress );
 
-    // return the current altitude based on mesh data.  We should
+#if 0
+    // return the current altitude based on grid data.  We should
     // rewrite this to interpolate exact values, but for now this is
     // good enough
     double interpolate_altitude( double lon, double lat );
 
     // Use least squares to fit a simpler data set to dem data
-    void fit( double error, fgBUCKET *p );
+    void fit( double error, FGBucket& p );
 
     // Initialize output mesh structure
     void outputmesh_init( void );
@@ -134,10 +141,16 @@ public:
     void outputmesh_set_pt( int i, int j, double value );
 
     // Write out a node file that can be used by the "triangle" program
-    void outputmesh_output_nodes( const string& fg_root, fgBUCKET *p );
+    void outputmesh_output_nodes( const string& fg_root, FGBucket& p );
+#endif
 
-    // Destructor
-    ~fgDEM( void );
+    // Informational methods
+    inline double get_originx() const { return originx; }
+    inline double get_originy() const { return originy; }
+    inline int get_cols() const { return cols; }
+    inline int get_rows() const { return rows; }
+    inline double get_col_step() const { return col_step; }
+    inline double get_row_step() const { return row_step; }
 };
 
 
@@ -145,6 +158,20 @@ public:
 
 
 // $Log$
+// Revision 1.12  1999/03/12 22:53:09  curt
+// Added a routine to dump out the portion of the dem data covered by a
+// specified bucket.  Other changes related to needs of scenery tools overhaul.
+//
+// Revision 1.11  1999/03/11 23:31:57  curt
+// Tweaks to use newbucket.hxx
+//
+// Revision 1.10  1999/03/10 01:09:13  curt
+// Tweaks to go along with scenery tools overhaul.
+// Added a new constructor that accepts the file name.
+//
+// Revision 1.9  1998/10/16 19:08:14  curt
+// Portability updates from Bernie Bright.
+//
 // Revision 1.8  1998/09/19 17:59:46  curt
 // Use c++ streams (fg_gzifstream).  Also converted many character arrays to
 // the string class.