From 48e3734e8fa480c3b7ec52901105939de2cd02be Mon Sep 17 00:00:00 2001 From: curt Date: Thu, 25 Mar 1999 19:03:50 +0000 Subject: [PATCH] Minor tweaks related to FGBucket usage. --- Array/array.cxx | 14 +++++++------- Array/testarray.cxx | 6 +----- DEM/dem.cxx | 9 ++++----- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/Array/array.cxx b/Array/array.cxx index 90e04142d..76d4b7f27 100644 --- a/Array/array.cxx +++ b/Array/array.cxx @@ -443,14 +443,13 @@ void FGArray::outputmesh_output_nodes( const string& fg_root, FGBucket& p ) { double exnodes[MAX_EX_NODES][3]; struct stat stat_buf; - string dir; - char file[256], exfile[256]; + string dir, file; + char exfile[256]; #ifdef WIN32 char tmp_path[256]; #endif string command; FILE *fd; - long int index; int colmin, colmax, rowmin, rowmax; int i, j, count, excount, result; @@ -481,13 +480,11 @@ void FGArray::outputmesh_output_nodes( const string& fg_root, FGBucket& p ) } // get index and generate output file name - index = p.gen_index(); - sprintf(file, "%s/%ld.node", dir.c_str(), index); + file = dir + "/" + p.gen_index_str() + ".node"; // get (optional) extra node file name (in case there is matching // .poly file. - strcpy(exfile, file); - strcat(exfile, ".ex"); + exfile = file + ".ex"; // load extra nodes if they exist excount = 0; @@ -560,6 +557,9 @@ FGArray::~FGArray( void ) { // $Log$ +// Revision 1.5 1999/03/25 19:03:50 curt +// Minor tweaks related to FGBucket usage. +// // Revision 1.4 1999/03/20 20:32:51 curt // First mostly successful tile triangulation works. There's plenty of tweaking // to do, but we are marching in the right direction. diff --git a/Array/testarray.cxx b/Array/testarray.cxx index 9d65c0bf7..74012eb93 100644 --- a/Array/testarray.cxx +++ b/Array/testarray.cxx @@ -3,7 +3,6 @@ #include "array.hxx" main(int argc, char **argv) { - char tile_name[256]; double lon, lat; if ( argc != 2 ) { @@ -12,7 +11,6 @@ main(int argc, char **argv) { } string work_dir = argv[1]; - lon = -146.248360; lat = 61.133950; // PAVD (Valdez, AK) lon = -110.664244; lat = 33.352890; // P13 @@ -21,9 +19,7 @@ main(int argc, char **argv) { string base = b.gen_base_path(); string path = work_dir + "/Scenery/" + base; - long int b_index = b.gen_index(); - sprintf(tile_name, "%ld", b_index); - string arrayfile = path + "/" + tile_name + ".dem"; + string arrayfile = path + "/" + b.gen_index_str() + ".dem"; cout << "arrayfile = " << arrayfile << endl; FGArray a(arrayfile); diff --git a/DEM/dem.cxx b/DEM/dem.cxx index b7fdbfc74..e4661a3c7 100644 --- a/DEM/dem.cxx +++ b/DEM/dem.cxx @@ -371,8 +371,6 @@ FGDem::parse( ) { // corner. int FGDem::write_area( const string& root, FGBucket& b, bool compress ) { - char tile_name[256]; - // calculate some boundaries double min_x = ( b.get_center_lon() - 0.5 * b.get_width() ) * 3600.0; double max_x = ( b.get_center_lon() + 0.5 * b.get_width() ) * 3600.0; @@ -412,9 +410,7 @@ FGDem::write_area( const string& root, FGBucket& b, bool compress ) { string command = "mkdir -p " + path; system( command.c_str() ); - long int b_index = b.gen_index(); - sprintf(tile_name, "%ld", b_index); - string demfile = path + "/" + tile_name + ".dem"; + string demfile = path + "/" + b.gen_index_str() + ".dem"; cout << "demfile = " << demfile << endl; // write the file @@ -869,6 +865,9 @@ FGDem::~FGDem( void ) { // $Log$ +// Revision 1.27 1999/03/25 19:04:36 curt +// Minor tweaks related to FGBucket usage. +// // Revision 1.26 1999/03/13 17:40:37 curt // Moved point interpolation and least squares fitting to contruction program // area. -- 2.39.5