The QGeoBoundingBox class defines a rectangular geographic area. More...
#include <QGeoBoundingBox>
Inherits: QGeoBoundingArea.
This class was introduced in Qt Mobility 1.1.
QGeoBoundingBox () | |
QGeoBoundingBox ( const QGeoCoordinate & center, double degreesWidth, double degreesHeight ) | |
QGeoBoundingBox ( const QGeoCoordinate & topLeft, const QGeoCoordinate & bottomRight ) | |
QGeoBoundingBox ( const QGeoBoundingBox & other ) | |
~QGeoBoundingBox () | |
QGeoCoordinate | bottomLeft () const |
QGeoCoordinate | bottomRight () const |
QGeoCoordinate | center () const |
bool | contains ( const QGeoBoundingBox & boundingBox ) const |
double | height () const |
bool | intersects ( const QGeoBoundingBox & boundingBox ) const |
void | setBottomLeft ( const QGeoCoordinate & bottomLeft ) |
void | setBottomRight ( const QGeoCoordinate & bottomRight ) |
void | setCenter ( const QGeoCoordinate & center ) |
void | setHeight ( double degreesHeight ) |
void | setTopLeft ( const QGeoCoordinate & topLeft ) |
void | setTopRight ( const QGeoCoordinate & topRight ) |
void | setWidth ( double degreesWidth ) |
QGeoCoordinate | topLeft () const |
QGeoCoordinate | topRight () const |
void | translate ( double degreesLatitude, double degreesLongitude ) |
QGeoBoundingBox | translated ( double degreesLatitude, double degreesLongitude ) const |
QGeoBoundingBox | united ( const QGeoBoundingBox & boundingBox ) const |
double | width () const |
bool | operator!= ( const QGeoBoundingBox & other ) const |
QGeoBoundingBox & | operator= ( const QGeoBoundingBox & other ) |
bool | operator== ( const QGeoBoundingBox & other ) const |
QGeoBoundingBox | operator| ( const QGeoBoundingBox & boundingBox ) const |
QGeoBoundingBox & | operator|= ( const QGeoBoundingBox & boundingBox ) |
virtual bool | contains ( const QGeoCoordinate & coordinate ) const |
virtual bool | isEmpty () const |
virtual bool | isValid () const |
virtual QGeoBoundingArea::AreaType | type () const |
The QGeoBoundingBox class defines a rectangular geographic area.
The rectangle is defined in terms of a QGeoCoordinate which specifies the top left coordinate of the rectangle and a QGeoCoordinate which specifies the bottom right coordinate of the rectangle.
A bounding box is considered invalid if the top left or bottom right coordinates are invalid or if the top left coordinate is south of the bottom right coordinate.
Bounding boxes can never cross the poles.
Several methods behave as though the bounding box is defined in terms of a center coordinate, the width of the bounding box in degrees and the height of the bounding box in degrees.
If the height or center of a bounding box is adjusted such that it would cross one of the poles the height is modified such that the bounding box touches but does not cross the pole and that the center coordinate is still in the center of the bounding box.
Constructs a new, invalid bounding box.
Constructs a new bounding box centered at center with a width in degrees of degreesWidth and a height in degrees of degreesHeight.
If degreesHeight would take the bounding box beyond one of the poles, the height of the bounding box will be truncated such that the bounding box only extends up to the pole. The center of the bounding box will be unchanged, and the height will be adjusted such that the center point is at the center of the truncated bounding box.
This function was introduced in Qt Mobility 1.1.
Constructs a new bounding box with a top left coordinate topLeft and a bottom right coordinate bottomRight.
This function was introduced in Qt Mobility 1.1.
Constructs a bounding box from the contents of other.
This function was introduced in Qt Mobility 1.1.
Destroys this bounding box.
Returns the bottom left coordinate of this bounding box.
This function was introduced in Qt Mobility 1.1.
See also setBottomLeft().
Returns the bottom right coordinate of this bounding box.
This function was introduced in Qt Mobility 1.1.
See also setBottomRight().
Returns the center of this bounding box.
This function was introduced in Qt Mobility 1.1.
See also setCenter().
Reimplemented from QGeoBoundingArea::contains().
Returns whether the coordinate coordinate is contained within this bounding box.
This function was introduced in Qt Mobility 1.1.
Returns whether the bounding box boundingBox is contained within this bounding box.
This function was introduced in Qt Mobility 1.1.
Returns the height of this bounding box in degrees.
The return value is undefined if this bounding box is invalid.
This function was introduced in Qt Mobility 1.1.
See also setHeight().
Returns whether the bounding box boundingBox intersects this bounding box.
If the top or bottom edges of both bounding boxes are at one of the poles the bounding boxes are considered to be intersecting, since the longitude is irrelevant when the edges are at the pole.
This function was introduced in Qt Mobility 1.1.
Reimplemented from QGeoBoundingArea::isEmpty().
Returns whether this bounding box has a geometrical area of 0.
Returns true if this bounding box is invalid.
This function was introduced in Qt Mobility 1.1.
Reimplemented from QGeoBoundingArea::isValid().
Returns whether this bounding box is valid.
A valid bounding box has valid top left and bottom right coordinates and has a top left coordinate with latitude greater than or equal to the latitude of the bottom right coordinate.
This function was introduced in Qt Mobility 1.1.
Sets the bottom left coordinate of this bounding box to bottomLeft.
This function was introduced in Qt Mobility 1.1.
See also bottomLeft().
Sets the bottom right coordinate of this bounding box to bottomRight.
This function was introduced in Qt Mobility 1.1.
See also bottomRight().
Sets the center of this bounding box to center.
If this causes the bounding box to cross on of the poles the height of the bounding box will be truncated such that the bounding box only extends up to the pole. The center of the bounding box will be unchanged, and the height will be adjusted such that the center point is at the center of the truncated bounding box.
This function was introduced in Qt Mobility 1.1.
See also center().
Sets the height of this bounding box in degrees to degreesHeight.
If degreesHeight is less than 0.0 or if this bounding box is invalid this function does nothing. To set up the values of an invalid QGeoBoundingBox based on the center, width and height you should use setCenter() first in order to make the QGeoBoundingBox valid.
If the change in height would cause the bounding box to cross a pole the height is adjusted such that the bounding box only touches the pole.
This changes is done such that the center coordinate is still at the center of the bounding box, which may result in a bounding box with a smaller height than might otherwise be expected.
If degreesHeight is greater than 180.0 then 180.0 is used as the height.
This function was introduced in Qt Mobility 1.1.
See also height().
Sets the top left coordinate of this bounding box to topLeft.
This function was introduced in Qt Mobility 1.1.
See also topLeft().
Sets the top right coordinate of this bounding box to topRight.
This function was introduced in Qt Mobility 1.1.
See also topRight().
Sets the width of this bounding box in degrees to degreesWidth.
If degreesWidth is less than 0.0 or if this bounding box is invalid this function does nothing. To set up the values of an invalid QGeoBoundingBox based on the center, width and height you should use setCenter() first in order to make the QGeoBoundingBox valid.
If degreesWidth is greater than 360.0 then 360.0 is used as the width, the leftmost longitude of the bounding box is set to -180.0 degrees and the rightmost longitude of the bounding box is set to 180.0 degrees.
This function was introduced in Qt Mobility 1.1.
See also width().
Returns the top left coordinate of this bounding box.
This function was introduced in Qt Mobility 1.1.
See also setTopLeft().
Returns the top right coordinate of this bounding box.
This function was introduced in Qt Mobility 1.1.
See also setTopRight().
Translates this bounding box by degreesLatitude northwards and degreesLongitude eastwards.
Negative values of degreesLatitude and degreesLongitude correspond to southward and westward translation respectively.
If the translation would have caused the bounding box to cross a pole the bounding box will be translated until the top or bottom edge of bounding box touches the pole but not further.
This function was introduced in Qt Mobility 1.1.
Returns a copy of this bounding box translated by degreesLatitude northwards and degreesLongitude eastwards.
Negative values of degreesLatitude and degreesLongitude correspond to southward and westward translation respectively.
This function was introduced in Qt Mobility 1.1.
See also translate().
Reimplemented from QGeoBoundingArea::type().
Returns QGeoBoundingArea::BoxType to identify this as a QGeoBoundingBox instance.
This function is provided to help find the specific type of aQGeoBoundingArea instance.
This function was introduced in Qt Mobility 1.1.
Returns the smallest bounding box which contains both this bounding box and boundingBox.
If the centers of the two bounding boxes are separated by exactly 180.0 degrees then the width is set to 360.0 degrees with the leftmost longitude set to -180.0 degrees and the rightmost longitude set to 180.0 degrees. This is done to ensure that the result is independent of the order of the operands.
This function was introduced in Qt Mobility 1.1.
Returns the width of this bounding box in degrees.
The return value is undefined if this bounding box is invalid.
This function was introduced in Qt Mobility 1.1.
See also setWidth().
Returns whether this bounding box is not equal to other.
This function was introduced in Qt Mobility 1.1.
Assigns other to this bounding box and returns a reference to this bounding box.
This function was introduced in Qt Mobility 1.1.
Returns whether this bounding box is equal to other.
This function was introduced in Qt Mobility 1.1.
Returns the smallest bounding box which contains both this bounding box and boundingBox.
If the centers of the two bounding boxes are separated by exactly 180.0 degrees then the width is set to 360.0 degrees with the leftmost longitude set to -180.0 degrees and the rightmost longitude set to 180.0 degrees. This is done to ensure that the result is independent of the order of the operands.
This function was introduced in Qt Mobility 1.1.
Returns the smallest bounding box which contains both this bounding box and boundingBox.
If the centers of the two bounding boxes are separated by exactly 180.0 degrees then the width is set to 360.0 degrees with the leftmost longitude set to -180.0 degrees and the rightmost longitude set to 180.0 degrees. This is done to ensure that the result is independent of the order of the operands.
This function was introduced in Qt Mobility 1.1.
© 2008-2011 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners. Privacy Policy
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.