BoundingBox
Since: BlackBerry 10.0.0
#include <bb/platform/geo/BoundingBox>
To link against this class, add the following line to your .pro file: LIBS += -lbbcascadesmaps
A 2-dimensional, axis-aligned bounding box (rectangle) used to define the limits of a Geographic element, or any other bounding box.
Validity -------- A bounding box is considered valid when all of its attributes (edges) are set. If a bounding box is invalid, its attributes are undefined.
Overview
Public Functions Index
BoundingBox () | |
BoundingBox (double top, double bottom, double left, double right) | |
BoundingBox (const BoundingBox &src) | |
~BoundingBox () | |
double | bottom () const |
Point | center () const |
bool | expandToInclude (const BoundingBox &other) |
bool | expandToInclude (double top, double bottom, double left, double right) |
double | height () const |
bool | intersects (const BoundingBox &other) const |
bool | intersects (double top, double bottom, double left, double right) const |
void | invalidate () |
bool | isValid () const |
double | left () const |
bool | operator!= (const BoundingBox &rhs) const |
BoundingBox & | operator= (const BoundingBox &src) |
bool | operator== (const BoundingBox &rhs) const |
double | right () const |
bool | set (double top=0, double bottom=0, double left=0, double right=0) |
bool | setBottom (double bottom) |
bool | setLeft (double left) |
bool | setRight (double right) |
bool | setTop (double top) |
double | top () const |
bool | whollyContains (const BoundingBox &other) const |
bool | whollyContains (double top, double bottom, double left, double right) const |
double | width () const |
Public Functions
Default Constructor.
BlackBerry 10.0.0
Full constructor.
Creates a bounding box with the given edges (top, bottom, left, right).
BlackBerry 10.0.0
Default Copy Constructor.
BlackBerry 10.0.0
Destructor.
BlackBerry 10.0.0
double
Gets the latitude of the bottom edge of the bounding box.
BlackBerry 10.0.0
Point
Gets the coordinates of the center of this bounding box.
If this bounding box is invalid, then the returned Point is also invalid.
BlackBerry 10.0.0
bool
Expands this bounding box's boundaries to include the bounding box given as the parameter.
If the parameter is invalid, nothing is done. If this bounding box is invalid but the parameter is valid, this bounding box is set to the values of the parameter. If both bounding boxes are invalid, nothing is done.
Parameters | |
---|---|
other |
The bounding box to expand this bounding box to include. If other is invalid, no modifications are performed. |
true if this operation modified this object; otherwise, false if no modifications were made.
BlackBerry 10.0.0
bool
Expands this bounding box's boundaries to include the the bounding box indicated by the edges given as parameters.
true if this operation modified this object; otherwise, false if no modifications were made.
BlackBerry 10.0.0
double
Calculates the height of the bounding box in degrees.
BlackBerry 10.1.0
bool
Determines if this bounding box shares any space with the other bounding box given as the parameter.
Parameters | |
---|---|
other |
The bounding box to compare this bounding box with. |
true if the two boxes share any space in common. If either of the bounding boxes (this or other) are invalid, then false is returned.
BlackBerry 10.0.0
bool
Determines if this bounding box shares any space with the bounding box indicated by the edges given as parameters.
true if the two boxes share any space in common. If this bounding box is invalid, then false is returned.
BlackBerry 10.0.0
void
Invalidates this bounding box.
BlackBerry 10.0.0
bool
Indicates whether this bounding box contains valid information.
BlackBerry 10.0.0
double
Gets the longitude of the left edge of the bounding box.
BlackBerry 10.0.0
bool
Inequality operator.
BlackBerry 10.0.0
bool
Equality operator.
BlackBerry 10.0.0
double
Gets the longitude of the right edge of the bounding box.
BlackBerry 10.0.0
bool
Sets the values of all edges of the bounding box (top edge, bottom edge, left edge, right edge).
true if this modification was performed; otherwise, false if this modification is invalid.
BlackBerry 10.0.0
bool
Sets the latitude of the bottom edge of the bounding box.
true if this modification was performed; otherwise, false if this modification is invalid.
BlackBerry 10.0.0
bool
Sets the longitude of the left edge of the bounding box.
true if this modification was performed; otherwise, false if this modification is invalid.
BlackBerry 10.0.0
bool
Sets the longitude of the right edge of the bounding box.
true if this modification was performed; otherwise, false if this modification is invalid.
BlackBerry 10.0.0
bool
Sets the latitude of the top edge of the bounding box.
true if this modification was performed; otherwise, false if this modification is invalid.
BlackBerry 10.0.0
double
Gets the latitude of the top edge of the bounding box.
BlackBerry 10.0.0
bool
Determines if this bounding box wholly contains the contents of the other bounding box given as the parameter.
Parameters | |
---|---|
other |
The bounding box to compare this bounding box with. |
true if the bounding box given as the parameter is completely inside this bounding box. If either of the bounding boxes (this or other) are invalid, then false is returned.
BlackBerry 10.0.0
bool
Determines if this bounding box wholly contains the contents of the bounding box indicated by the edges given as parameters.
true if the bounding box indicated by the parameters is completely inside this bounding box. If this bounding box is invalid, then false is returned.
BlackBerry 10.0.0
double
Calculates the width of the bounding box in degrees.
BlackBerry 10.1.0