Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QGeoBoundingBox Class Reference

The QGeoBoundingBox class defines a rectangular geographic area. More...

 #include <QGeoBoundingBox>

Inherits QGeoBoundingArea.

Public Functions

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 )

Reimplemented Public Functions

virtual bool contains ( const QGeoCoordinate & coordinate ) const
virtual bool isEmpty () const
virtual bool isValid () const
virtual QGeoBoundingArea::AreaType type () const

Detailed Description

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.

Member Function Documentation

QGeoBoundingBox::QGeoBoundingBox ()

Constructs a new, invalid bounding box.

QGeoBoundingBox::QGeoBoundingBox ( const QGeoCoordinate & center, double degreesWidth, double degreesHeight )

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.

QGeoBoundingBox::QGeoBoundingBox ( const QGeoCoordinate & topLeft, const QGeoCoordinate & bottomRight )

Constructs a new bounding box with a top left coordinate topLeft and a bottom right coordinate bottomRight.

QGeoBoundingBox::QGeoBoundingBox ( const QGeoBoundingBox & other )

Constructs a bounding box from the contents of other.

QGeoBoundingBox::~QGeoBoundingBox ()

Destroys this bounding box.

QGeoCoordinate QGeoBoundingBox::bottomLeft () const

Returns the bottom left coordinate of this bounding box.

See also setBottomLeft().

QGeoCoordinate QGeoBoundingBox::bottomRight () const

Returns the bottom right coordinate of this bounding box.

See also setBottomRight().

QGeoCoordinate QGeoBoundingBox::center () const

Returns the center of this bounding box.

See also setCenter().

bool QGeoBoundingBox::contains ( const QGeoCoordinate & coordinate ) const [virtual]

Reimplemented from QGeoBoundingArea::contains().

Returns whether the coordinate coordinate is contained within this bounding box.

bool QGeoBoundingBox::contains ( const QGeoBoundingBox & boundingBox ) const

Returns whether the bounding box boundingBox is contained within this bounding box.

double QGeoBoundingBox::height () const

Returns the height of this bounding box in degrees.

The return value is undefined if this bounding box is invalid.

See also setHeight().

bool QGeoBoundingBox::intersects ( const QGeoBoundingBox & boundingBox ) const

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.

bool QGeoBoundingBox::isEmpty () const [virtual]

Reimplemented from QGeoBoundingArea::isEmpty().

Returns whether this bounding box has a geometrical area of 0.

Returns true if this bounding box is invalid.

bool QGeoBoundingBox::isValid () const [virtual]

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.

void QGeoBoundingBox::setBottomLeft ( const QGeoCoordinate & bottomLeft )

Sets the bottom left coordinate of this bounding box to bottomLeft.

See also bottomLeft().

void QGeoBoundingBox::setBottomRight ( const QGeoCoordinate & bottomRight )

Sets the bottom right coordinate of this bounding box to bottomRight.

See also bottomRight().

void QGeoBoundingBox::setCenter ( const QGeoCoordinate & center )

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.

See also center().

void QGeoBoundingBox::setHeight ( double degreesHeight )

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.

See also height().

void QGeoBoundingBox::setTopLeft ( const QGeoCoordinate & topLeft )

Sets the top left coordinate of this bounding box to topLeft.

See also topLeft().

void QGeoBoundingBox::setTopRight ( const QGeoCoordinate & topRight )

Sets the top right coordinate of this bounding box to topRight.

See also topRight().

void QGeoBoundingBox::setWidth ( double degreesWidth )

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.

See also width().

QGeoCoordinate QGeoBoundingBox::topLeft () const

Returns the top left coordinate of this bounding box.

See also setTopLeft().

QGeoCoordinate QGeoBoundingBox::topRight () const

Returns the top right coordinate of this bounding box.

See also setTopRight().

void QGeoBoundingBox::translate ( double degreesLatitude, double degreesLongitude )

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.

QGeoBoundingBox QGeoBoundingBox::translated ( double degreesLatitude, double degreesLongitude ) const

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.

See also translate().

QGeoBoundingArea::AreaType QGeoBoundingBox::type () const [virtual]

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.

QGeoBoundingBox QGeoBoundingBox::united ( const QGeoBoundingBox & boundingBox ) const

Returns the smallest bounding box which contains both this bounding box and boundingBox.

double QGeoBoundingBox::width () const

Returns the width of this bounding box in degrees.

The return value is undefined if this bounding box is invalid.

See also setWidth().

bool QGeoBoundingBox::operator!= ( const QGeoBoundingBox & other ) const

Returns whether this bounding box is not equal to other.

QGeoBoundingBox & QGeoBoundingBox::operator= ( const QGeoBoundingBox & other )

Assigns other to this bounding box and returns a reference to this bounding box.

bool QGeoBoundingBox::operator== ( const QGeoBoundingBox & other ) const

Returns whether this bounding box is equal to other.

QGeoBoundingBox QGeoBoundingBox::operator| ( const QGeoBoundingBox & boundingBox ) const

Returns the smallest bounding box which contains both this bounding box and boundingBox.

QGeoBoundingBox & QGeoBoundingBox::operator|= ( const QGeoBoundingBox & boundingBox )

Returns the smallest bounding box which contains both this bounding box and boundingBox.

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.

[0]; s.parentNode.insertBefore(ga, s); })();
Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 64
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le Qt Developer Network au hasard

Logo

Combiner licence, à propos et fermer d'une autre manière

Le Qt Developer Network est un réseau de développeurs Qt anglophone, où ils peuvent partager leur expérience sur le framework. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtmobility-1.1
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web