1
0
Fork 0

Tweaks to use newbucket.hxx

This commit is contained in:
curt 1999-03-11 23:31:56 +00:00
parent 14888bd09f
commit 04b12c5c54
2 changed files with 26 additions and 18 deletions

View file

@ -524,7 +524,7 @@ double fgDEM::interpolate_altitude( double lon, double lat ) {
// Use least squares to fit a simpler data set to dem data // Use least squares to fit a simpler data set to dem data
void fgDEM::fit( double error, fgBUCKET *p ) { void fgDEM::fit( double error, const FGBucket& p ) {
double x[DEM_SIZE_1], y[DEM_SIZE_1]; double x[DEM_SIZE_1], y[DEM_SIZE_1];
double m, b, ave_error, max_error; double m, b, ave_error, max_error;
double cury, lasty; double cury, lasty;
@ -688,7 +688,8 @@ void fgDEM::outputmesh_set_pt( int i, int j, double value ) {
// Check for an optional "index.node.ex" file in case there is a .poly // Check for an optional "index.node.ex" file in case there is a .poly
// file to go along with this node file. Include these nodes first // file to go along with this node file. Include these nodes first
// since they are referenced by position from the .poly file. // since they are referenced by position from the .poly file.
void fgDEM::outputmesh_output_nodes( const string& fg_root, fgBUCKET *p ) { void fgDEM::outputmesh_output_nodes( const string& fg_root, const FGBucket& p )
{
double exnodes[MAX_EX_NODES][3]; double exnodes[MAX_EX_NODES][3];
struct stat stat_buf; struct stat stat_buf;
string dir; string dir;
@ -830,6 +831,9 @@ fgDEM::~fgDEM( void ) {
// $Log$ // $Log$
// Revision 1.24 1999/03/11 23:31:56 curt
// Tweaks to use newbucket.hxx
//
// Revision 1.23 1999/03/10 01:09:12 curt // Revision 1.23 1999/03/10 01:09:12 curt
// Tweaks to go along with scenery tools overhaul. // Tweaks to go along with scenery tools overhaul.
// Added a new constructor that accepts the file name. // Added a new constructor that accepts the file name.

View file

@ -35,9 +35,7 @@
#include <stdio.h> #include <stdio.h>
#include <Bucket/bucketutils.h> #include <Bucket/newbucket.hxx>
//#include <zlib/zlib.h>
#include <Misc/fgstream.hxx> #include <Misc/fgstream.hxx>
@ -46,6 +44,9 @@
class fgDEM { class fgDEM {
private:
// file pointer for input // file pointer for input
// gzFile fd; // gzFile fd;
fg_gzifstream *in; fg_gzifstream *in;
@ -98,11 +99,14 @@ public:
fgDEM( void ); fgDEM( void );
fgDEM( const string& file ); fgDEM( const string& file );
// Destructor
~fgDEM( void );
// open a DEM file (use "-" if input is coming from stdin) // open a DEM file (use "-" if input is coming from stdin)
int open ( const string& file ); int open ( const string& file );
// close a DEM file // close a DEM file
int close (); int close();
// parse a DEM file // parse a DEM file
int parse(); int parse();
@ -113,21 +117,13 @@ public:
// read and parse DEM "B" record // read and parse DEM "B" record
void read_b_record(); void read_b_record();
// Informational methods
double get_originx( void ) { return originx; }
double get_originy( void ) { return originy; }
int get_cols( void ) { return cols; }
int get_rows( void ) { return rows; }
double get_col_step( void ) { return col_step; }
double get_row_step( void ) { return row_step; }
// return the current altitude based on mesh data. We should // return the current altitude based on mesh data. We should
// rewrite this to interpolate exact values, but for now this is // rewrite this to interpolate exact values, but for now this is
// good enough // good enough
double interpolate_altitude( double lon, double lat ); double interpolate_altitude( double lon, double lat );
// Use least squares to fit a simpler data set to dem data // Use least squares to fit a simpler data set to dem data
void fit( double error, fgBUCKET *p ); void fit( double error, const FGBucket& p );
// Initialize output mesh structure // Initialize output mesh structure
void outputmesh_init( void ); void outputmesh_init( void );
@ -139,10 +135,15 @@ public:
void outputmesh_set_pt( int i, int j, double value ); void outputmesh_set_pt( int i, int j, double value );
// Write out a node file that can be used by the "triangle" program // 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, const FGBucket& p );
// Destructor // Informational methods
~fgDEM( void ); 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; }
}; };
@ -150,6 +151,9 @@ public:
// $Log$ // $Log$
// 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 // Revision 1.10 1999/03/10 01:09:13 curt
// Tweaks to go along with scenery tools overhaul. // Tweaks to go along with scenery tools overhaul.
// Added a new constructor that accepts the file name. // Added a new constructor that accepts the file name.