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 ()
doublebottom () const
Pointcenter () const
boolexpandToInclude (const BoundingBox &other)
boolexpandToInclude (double top, double bottom, double left, double right)
doubleheight () const
boolintersects (const BoundingBox &other) const
boolintersects (double top, double bottom, double left, double right) const
voidinvalidate ()
boolisValid () const
doubleleft () const
booloperator!= (const BoundingBox &rhs) const
BoundingBox &operator= (const BoundingBox &src)
booloperator== (const BoundingBox &rhs) const
doubleright () const
boolset (double top=0, double bottom=0, double left=0, double right=0)
boolsetBottom (double bottom)
boolsetLeft (double left)
boolsetRight (double right)
boolsetTop (double top)
doubletop () const
boolwhollyContains (const BoundingBox &other) const
boolwhollyContains (double top, double bottom, double left, double right) const
doublewidth () const

Public Functions

BoundingBox ()

Default Constructor.

Creates a default (invalid) bounding box.

Since:

BlackBerry 10.0.0

BoundingBox (
  • doubletop,
  • doublebottom,
  • doubleleft,
  • doubleright )

Full constructor.

Creates a bounding box with the given edges (top, bottom, left, right).

Since:

BlackBerry 10.0.0

BoundingBox (

Default Copy Constructor.

Since:

BlackBerry 10.0.0

~BoundingBox ()

Destructor.

Since:

BlackBerry 10.0.0

double bottom ()

Gets the latitude of the bottom edge of the bounding box.

Since:

BlackBerry 10.0.0

Point center ()

Gets the coordinates of the center of this bounding box.

If this bounding box is invalid, then the returned Point is also invalid.

Since:

BlackBerry 10.0.0

bool expandToInclude (

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.

Return:

true if this operation modified this object; otherwise, false if no modifications were made.

Since:

BlackBerry 10.0.0

bool expandToInclude (
  • doubletop,
  • doublebottom,
  • doubleleft,
  • doubleright )

Expands this bounding box's boundaries to include the the bounding box indicated by the edges given as parameters.

Return:

true if this operation modified this object; otherwise, false if no modifications were made.

Since:

BlackBerry 10.0.0

double height ()

Calculates the height of the bounding box in degrees.

Since:

BlackBerry 10.1.0

bool intersects (

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.

Return:

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.

Since:

BlackBerry 10.0.0

bool intersects (
  • doubletop,
  • doublebottom,
  • doubleleft,
  • doubleright )

Determines if this bounding box shares any space with the bounding box indicated by the edges given as parameters.

Return:

true if the two boxes share any space in common. If this bounding box is invalid, then false is returned.

Since:

BlackBerry 10.0.0

void invalidate ()

Invalidates this bounding box.

Since:

BlackBerry 10.0.0

bool isValid ()

Indicates whether this bounding box contains valid information.

Since:

BlackBerry 10.0.0

double left ()

Gets the longitude of the left edge of the bounding box.

Since:

BlackBerry 10.0.0

bool operator!= (

Inequality operator.

Since:

BlackBerry 10.0.0

BoundingBox & operator= (

Assignment operator.

Since:

BlackBerry 10.0.0

bool operator== (

Equality operator.

Since:

BlackBerry 10.0.0

double right ()

Gets the longitude of the right edge of the bounding box.

Since:

BlackBerry 10.0.0

bool set (
  • doubletop,
  • doublebottom,
  • doubleleft,
  • doubleright )

Sets the values of all edges of the bounding box (top edge, bottom edge, left edge, right edge).

Return:

true if this modification was performed; otherwise, false if this modification is invalid.

Since:

BlackBerry 10.0.0

bool setBottom (
  • doublebottom)

Sets the latitude of the bottom edge of the bounding box.

Return:

true if this modification was performed; otherwise, false if this modification is invalid.

Since:

BlackBerry 10.0.0

bool setLeft (
  • doubleleft)

Sets the longitude of the left edge of the bounding box.

Return:

true if this modification was performed; otherwise, false if this modification is invalid.

Since:

BlackBerry 10.0.0

bool setRight (
  • doubleright)

Sets the longitude of the right edge of the bounding box.

Return:

true if this modification was performed; otherwise, false if this modification is invalid.

Since:

BlackBerry 10.0.0

bool setTop (
  • doubletop)

Sets the latitude of the top edge of the bounding box.

Return:

true if this modification was performed; otherwise, false if this modification is invalid.

Since:

BlackBerry 10.0.0

double top ()

Gets the latitude of the top edge of the bounding box.

Since:

BlackBerry 10.0.0

bool whollyContains (

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.

Return:

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.

Since:

BlackBerry 10.0.0

bool whollyContains (
  • doubletop,
  • doublebottom,
  • doubleleft,
  • doubleright )

Determines if this bounding box wholly contains the contents of the bounding box indicated by the edges given as parameters.

Return:

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.

Since:

BlackBerry 10.0.0

double width ()

Calculates the width of the bounding box in degrees.

Since:

BlackBerry 10.1.0

Last modified: 2014-03-13

comments powered by Disqus