WhirlyGlobe  1.2
A 3D interactive globe toolkit for iOS
WhirlyGlobe::GeoMbr Class Reference

#include <WhirlyVector.h>

List of all members.

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 GeoCoordll () const
 Fetch the lower left.
GeoCoordll ()
const GeoCoordur () const
 Fetch the upper right.
GeoCoordur ()
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

Detailed Description

Geographic MBR. Coordinates are restricted to [-180,-90]->[+180,+90]


Member Function Documentation

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


The documentation for this class was generated from the following file: