![]() |
WhirlyGlobe
1.2
A 3D interactive globe toolkit for iOS
|
#include <WhirlyVector.h>
Public Member Functions | |
GeoMbr () | |
Construct invalid. | |
GeoMbr (GeoCoord ll, GeoCoord ur) | |
Construct with two coordinates to start. | |
GeoMbr (const std::vector< GeoCoord > &coords) | |
Construct from a list of geo coordinates. | |
GeoMbr (const std::vector< Point2f > &pts) | |
Construct with a list of 2d coordinates. X is lon, Y is lat. | |
void | reset () |
Resets back to invalid. | |
const GeoCoord & | ll () const |
Fetch the lower left. | |
GeoCoord & | ll () |
const GeoCoord & | ur () const |
Fetch the upper right. | |
GeoCoord & | ur () |
GeoCoord | lr () const |
Fetch the lower right. | |
GeoCoord | ul () const |
Fetch the upper left. | |
GeoCoord | mid () const |
Construct the mid point. | |
bool | valid () |
Check the validity. Will be invalid after construction. | |
float | area () const |
void | addGeoCoord (GeoCoord coord) |
Expand the MBR by this amount. | |
void | addGeoCoords (const std::vector< GeoCoord > &coords) |
Expand by the vector of geo coords. | |
void | addGeoCoords (const std::vector< Point2f > &coords) |
Expand by a vector of 2d coordinates. x is lon, y is lat. | |
bool | overlaps (const GeoMbr &that) const |
bool | inside (GeoCoord coord) const |
See if a single geo coordinate is inside the MBR. | |
Protected Member Functions | |
void | splitIntoMbrs (std::vector< Mbr > &mbrs) const |
Break into one or two MBRs. | |
Protected Attributes | |
GeoCoord | pt_ll |
GeoCoord | pt_ur |
Geographic MBR. Coordinates are restricted to [-180,-90]->[+180,+90]
float WhirlyGlobe::GeoMbr::area | ( | ) | const |
Calculate area This is an approximation, treating the coordinates as Euclidean
bool WhirlyGlobe::GeoMbr::overlaps | ( | const GeoMbr & | that | ) | const |
Determine overlap. This takes into account MBRs that wrap over -180/+180