From c5b835c97b1ffa8e4f42019e040a6adc81555c24 Mon Sep 17 00:00:00 2001 From: curt Date: Thu, 6 May 1999 02:19:11 +0000 Subject: [PATCH] Initial revision. --- Tools/Construct/Main/master.cxx | 99 +++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 Tools/Construct/Main/master.cxx diff --git a/Tools/Construct/Main/master.cxx b/Tools/Construct/Main/master.cxx new file mode 100644 index 000000000..192c18ea1 --- /dev/null +++ b/Tools/Construct/Main/master.cxx @@ -0,0 +1,99 @@ +// master.cxx -- top level construction routines +// +// Written by Curtis Olson, started May 1999. +// +// Copyright (C) 1999 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 +// published by the Free Software Foundation; either version 2 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// +// $Id$ + + +#include // for directory reading +#include // for directory reading + +#include + +#include + +// #include +// #include + +// #include +// #include +// #include +// #include +// #include +// #include + + +// check if the specified tile has data defined for it +static bool has_data( const string& path, const FGBucket& b ) { + + return false; +} + + +// build the tile and check for success +bool build_tile( const string& work_base, const string& output_base, + const FGBucket& b ) { + return true; +} + + +// display usage and exit +void usage( const string name ) { + cout << "Usage: " << name << " " << endl; + exit(-1); +} + + +main(int argc, char **argv) { + double lon, lat; + + if ( argc < 3 ) { + usage( argv[0] ); + } + + string work_base = argv[1]; + string output_base = argv[2]; + + FGBucket tmp1( 0.0, 0.0 ); + + double dy = tmp1.get_height(); + + lat = -90.0 + dy * 0.5; + while ( lat <= 90.0 ) { + FGBucket tmp2( 0.0, lat ); + double dx = tmp2.get_width(); + + lon = -180 + dx * 0.5; + while ( lon <= 180.0 ) { + FGBucket b( lon, lat ); + cout << "Bucket = " << b << endl; + + if ( has_data( work_base, b ) ) { + build_tile( work_base, output_base, b ); + } + + lon += dx; + } + + + lat += dy; + } +} + +