#include <newbucket.hxx>
Public Member Functions | |
| SGBucket () | |
| Default constructor. | |
| SGBucket (const double dlon, const double dlat) | |
| Construct a bucket given a specific location. | |
| SGBucket (const bool is_good) | |
| Construct a bucket. | |
| SGBucket (const long int bindex) | |
| Construct a bucket given a unique bucket index number. | |
| ~SGBucket () | |
| Default destructor. | |
| void | set_bucket (double dlon, double dlat) |
| Reset a bucket to represent a new lat and lon. | |
| void | set_bucket (double *lonlat) |
| Reset a bucket to represent a new lat and lon. | |
| void | make_bad () |
| Create an impossible bucket. | |
| long int | gen_index () const |
| Generate the unique scenery tile index for this bucket. | |
| string | gen_index_str () const |
| Generate the unique scenery tile index for this bucket in ascii string form. | |
| string | gen_base_path () const |
| Build the base path name for this bucket. | |
| double | get_center_lon () const |
| |
| double | get_center_lat () const |
| |
| double | get_width () const |
| |
| double | get_height () const |
| |
| double | get_width_m () const |
| |
| double | get_height_m () const |
| |
| int | get_chunk_lon () const |
| |
| int | get_chunk_lat () const |
| |
| int | get_x () const |
| |
| int | get_y () const |
| |
Friends | |
| ostream & | operator<< (ostream &, const SGBucket &) |
| Write the bucket lon, lat, x, and y to the output stream. | |
| bool | operator== (const SGBucket &, const SGBucket &) |
| Compare two bucket structures for equality. | |
Related Functions | |
| (Note that these are not member functions.) | |
| SGBucket | sgBucketOffset (double dlon, double dlat, int x, int y) |
| Return the bucket which is offset from the specified dlon, dlat by the specified tile units in the X & Y direction. | |
| void | sgBucketDiff (const SGBucket &b1, const SGBucket &b2, int *dx, int *dy) |
| Calculate the offset between two buckets (in quantity of buckets). | |
This class encapsulates the world tiling scheme. It provides ways to calculate a unique tile index from a lat/lon, and it can provide information such as the dimensions of a given tile.
Definition at line 113 of file newbucket.hxx.
| SGBucket::SGBucket | ( | const double | dlon, | |
| const double | dlat | |||
| ) |
Construct a bucket given a specific location.
| dlon | longitude specified in degrees | |
| dlat | latitude specified in degrees |
Definition at line 43 of file newbucket.cxx.
References set_bucket().
| SGBucket::SGBucket | ( | const bool | is_good | ) |
Construct a bucket.
| is_good | if false, create an invalid bucket. This is useful * if you are comparing cur_bucket to last_bucket and you want to * make sure last_bucket starts out as something impossible. |
Definition at line 49 of file newbucket.cxx.
References set_bucket().
| SGBucket::SGBucket | ( | const long int | bindex | ) |
Construct a bucket given a unique bucket index number.
| bindex | unique bucket index |
Definition at line 58 of file newbucket.cxx.
| void SGBucket::set_bucket | ( | double | dlon, | |
| double | dlat | |||
| ) |
Reset a bucket to represent a new lat and lon.
| dlon | longitude specified in degrees | |
| dlat | latitude specified in degrees |
Definition at line 88 of file newbucket.cxx.
References SG_EPSILON.
Referenced by make_bad(), set_bucket(), SGBucket(), and sgBucketOffset().
| void SGBucket::set_bucket | ( | double * | lonlat | ) |
Reset a bucket to represent a new lat and lon.
| lonlat | an array of double[2] holding lon and lat (specified) in degrees |
Definition at line 82 of file newbucket.cxx.
References set_bucket().
| void SGBucket::make_bad | ( | ) | [inline] |
Create an impossible bucket.
This is useful if you are comparing cur_bucket to last_bucket and you want to make sure last_bucket starts out as something impossible.
Definition at line 174 of file newbucket.hxx.
References set_bucket().
| long int SGBucket::gen_index | ( | ) | const [inline] |
Generate the unique scenery tile index for this bucket.
The index is constructed as follows:
9 bits - to represent 360 degrees of longitude (-180 to 179) 8 bits - to represent 180 degrees of latitude (-90 to 89)
Each 1 degree by 1 degree tile is further broken down into an 8x8 grid. So we also need:
3 bits - to represent x (0 to 7) 3 bits - to represent y (0 to 7)
Definition at line 194 of file newbucket.hxx.
| string SGBucket::gen_index_str | ( | ) | const [inline] |
Generate the unique scenery tile index for this bucket in ascii string form.
Definition at line 203 of file newbucket.hxx.
| string SGBucket::gen_base_path | ( | ) | const |
Build the base path name for this bucket.
Definition at line 139 of file newbucket.cxx.
References SGPath::str().
Referenced by SGBinObject::write_ascii(), and SGBinObject::write_bin().
| ostream& operator<< | ( | ostream & | out, | |
| const SGBucket & | b | |||
| ) | [friend] |
Write the bucket lon, lat, x, and y to the output stream.
| out | output stream | |
| b | bucket |
Definition at line 317 of file newbucket.hxx.
Compare two bucket structures for equality.
| b1 | bucket 1 | |
| b2 | bucket 2 |
Definition at line 330 of file newbucket.hxx.
| SGBucket sgBucketOffset | ( | double | dlon, | |
| double | dlat, | |||
| int | x, | |||
| int | y | |||
| ) | [related] |
Return the bucket which is offset from the specified dlon, dlat by the specified tile units in the X & Y direction.
| dlon | starting lon in degrees | |
| dlat | starting lat in degrees | |
| x | number of bucket units to offset in x (lon) direction | |
| y | number of bucket units to offset in y (lat) direction |
Definition at line 230 of file newbucket.cxx.
Calculate the offset between two buckets (in quantity of buckets).
| b1 | bucket 1 | |
| b2 | bucket 2 | |
| dx | offset distance (lon) in tile units | |
| dy | offset distance (lat) in tile units |
Definition at line 255 of file newbucket.cxx.
1.5.1