]> git.mxchange.org Git - simgear.git/blobdiff - simgear/bucket/newbucket.hxx
sprintf -> snprintf in bucket code.
[simgear.git] / simgear / bucket / newbucket.hxx
index 56333c4d670e4b985529fa289be32fec6fe77a2b..09169f860fd0435d8d8a60a5a185ac7842e4edfb 100644 (file)
@@ -42,6 +42,7 @@
 #include <cstdio> // sprintf()
 #include <ostream>
 #include <string>
+#include <vector>
 
 /**
  * standard size of a bucket in degrees (1/8 of a degree)
@@ -57,9 +58,7 @@
 // return the horizontal tile span factor based on latitude
 static double sg_bucket_span( double l ) {
     if ( l >= 89.0 ) {
-       return 360.0;
-    } else if ( l >= 88.0 ) {
-       return 8.0;
+       return 12.0;
     } else if ( l >= 86.0 ) {
        return 4.0;
     } else if ( l >= 83.0 ) {
@@ -80,12 +79,10 @@ static double sg_bucket_span( double l ) {
        return 1.0;
     } else if ( l >= -86.0 ) {
        return 2.0;
-    } else if ( l >= -88.0 ) {
-       return 4.0;
     } else if ( l >= -89.0 ) {
-       return 8.0;
+       return 4.0;
     } else {
-       return 360.0;
+       return 12.0;
     }
 }
 
@@ -326,6 +323,15 @@ SGBucket sgBucketOffset( double dlon, double dlat, int x, int y );
 void sgBucketDiff( const SGBucket& b1, const SGBucket& b2, int *dx, int *dy );
 
 
+/**
+ * \relates SGBucket
+ * retrieve a list of buckets in the given bounding box
+ * @param min min lon,lat of bounding box in degrees
+ * @param max max lon,lat of bounding box in degrees
+ * @param list standard vector of buckets within the bounding box
+ */
+void sgGetBuckets( const SGGeod& min, const SGGeod& max, std::vector<SGBucket>& list );
+
 /**
  * Write the bucket lon, lat, x, and y to the output stream.
  * @param out output stream