-#include STL_STRING
-
-FG_USING_STD(string);
-
-#if ! defined( FG_HAVE_NATIVE_SGI_COMPILERS )
-FG_USING_STD(ostream);
-#endif
-
-
-
-#define FG_BUCKET_SPAN 0.125 // 1/8 of a degree
-#define FG_HALF_BUCKET_SPAN 0.0625 // 1/2 of 1/8 of a degree = 1/16 = 0.0625
-
-class FGBucket;
-ostream& operator<< ( ostream&, const FGBucket& );
-bool operator== ( const FGBucket&, const FGBucket& );
-
-class FGBucket {
-
-private:
- double cx, cy; // centerpoint (lon, lat) in degrees of bucket
- int lon; // longitude index (-180 to 179)
- int lat; // latitude index (-90 to 89)
- int x; // x subdivision (0 to 7)
- int y; // y subdivision (0 to 7)
-
-public:
-
- // default constructor
- FGBucket();
-
- // create a bucket which would contain the specified lon/lat
- FGBucket(const double lon, const double lat);
-
- // create a bucket based on "long int" index
- FGBucket(const long int bindex);
-
- // create an impossible bucket if false
- FGBucket(const bool is_good);
-
- ~FGBucket();
-
- // Set the bucket params for the specified lat and lon
- void set_bucket( double dlon, double dlat );
- void set_bucket( double *lonlat ) {
- set_bucket( lonlat[0], lonlat[1] );
- }
-
- void make_bad ( void );
-
- // Generate the unique scenery tile index for this bucket
- long int gen_index() const;
- string gen_index_str() const;
-
- // Build the path name for this bucket
- string gen_base_path() const;
-
- // return the center lon of a tile
- double get_center_lon() const;
-
- // return width of the tile
- double get_width() const;
-
- // return the center lat of a tile
- double get_center_lat() const;
-
- // return height of the tile
- double get_height() const;
-
- // Informational methods
- inline int get_lon() const { return lon; }
- inline int get_lat() const { return lat; }
- inline int get_x() const { return x; }
- inline int get_y() const { return y; }
-
- // friends
- friend ostream& operator<< ( ostream&, const FGBucket& );
- friend bool operator== ( const FGBucket&, const FGBucket& );
-};