]> git.mxchange.org Git - flightgear.git/blobdiff - DEM/dem.hxx
Dynamically update "error" until the resulting tile data scales within
[flightgear.git] / DEM / dem.hxx
index 57969352ad7ff4587e739ebc4c3925dcf01d4227..46849e3a4ef8712786c1ea9679fa71ea2fa1d439 100644 (file)
@@ -1,10 +1,8 @@
-// -*- Mode: C++ -*-
-//
-// dem.h -- DEM management class
+// dem.hxx -- DEM management class
 //
 // Written by Curtis Olson, started March 1998.
 //
-// Copyright (C) 1998  Curtis L. Olson  - curt@me.umn.edu
+// Copyright (C) 1998  Curtis L. Olson  - curt@flightgear.org
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
@@ -24,8 +22,8 @@
 // (Log is kept at end of this file)
 
 
-#ifndef _DEM_H
-#define _DEM_H
+#ifndef _DEM_HXX
+#define _DEM_HXX
 
 
 #ifndef __cplusplus                                                          
@@ -33,8 +31,6 @@
 #endif                                   
 
 
-#include <stdio.h>
-
 #include <Bucket/newbucket.hxx>
 #include <Misc/fgstream.hxx>
 
@@ -43,7 +39,7 @@
 #define DEM_SIZE_1 1201
 
 
-class fgDEM {
+class FGDem {
 
 private:
 
@@ -60,7 +56,7 @@ private:
     // 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];
 
@@ -96,11 +92,11 @@ private:
 public:
 
     // Constructor
-    fgDEM( void );
-    fgDEM( const string& file );
+    FGDem( void );
+    FGDem( const string& file );
 
     // Destructor
-    ~fgDEM( void );
+    ~FGDem( void );
 
     // open a DEM file (use "-" if input is coming from stdin)
     int open ( const string& file );
@@ -117,13 +113,19 @@ public:
     // read and parse DEM "B" record
     void read_b_record();
 
-    // return the current altitude based on mesh data.  We should
+    // 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 );
+
+#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, const FGBucket& p );
+    void fit( double error, FGBucket& p );
 
     // Initialize output mesh structure
     void outputmesh_init( void );
@@ -135,7 +137,8 @@ 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, const FGBucket& p );
+    void outputmesh_output_nodes( const string& fg_root, FGBucket& p );
+#endif
 
     // Informational methods
     inline double get_originx() const { return originx; }
@@ -147,10 +150,19 @@ public:
 };
 
 
-#endif // _DEM_H
+#endif // _DEM_HXX
 
 
 // $Log$
+// Revision 1.13  1999/03/13 17:40:39  curt
+// Moved point interpolation and least squares fitting to contruction program
+// area.
+// Moved leastsqs.* to Lib/Math/
+//
+// 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
 //