The QGeoPolygon class defines a geographic polygon. More...
Header: | #include <QGeoPolygon> |
qmake: | QT += positioning |
Since: | Qt 5.10 |
Inherits: | QGeoShape |
This class was introduced in Qt 5.10.
QGeoPolygon(const QGeoShape &other) | |
QGeoPolygon(const QGeoPolygon &other) | |
QGeoPolygon(const QList<QGeoCoordinate> &path) | |
QGeoPolygon() | |
QGeoPolygon & | operator=(const QGeoPolygon &other) |
~QGeoPolygon() | |
void | addCoordinate(const QGeoCoordinate &coordinate) |
void | addHole(const QVariant &holePath) |
void | addHole(const QList<QGeoCoordinate> &holePath) |
bool | containsCoordinate(const QGeoCoordinate &coordinate) const |
QGeoCoordinate | coordinateAt(int index) const |
const QVariantList | hole(int index) const |
const QList<QGeoCoordinate> | holePath(int index) const |
int | holesCount() const |
void | insertCoordinate(int index, const QGeoCoordinate &coordinate) |
double | length(int indexFrom = 0, int indexTo = -1) const |
const QList<QGeoCoordinate> & | path() const |
void | removeCoordinate(const QGeoCoordinate &coordinate) |
void | removeCoordinate(int index) |
void | removeHole(int index) |
void | replaceCoordinate(int index, const QGeoCoordinate &coordinate) |
void | setPath(const QList<QGeoCoordinate> &path) |
int | size() const |
QString | toString() const |
void | translate(double degreesLatitude, double degreesLongitude) |
QGeoPolygon | translated(double degreesLatitude, double degreesLongitude) const |
bool | operator!=(const QGeoPolygon &other) const |
bool | operator==(const QGeoPolygon &other) const |
QVariantList | perimeter() const |
void | setPerimeter(const QVariantList &path) |
The polygon is defined by an ordered list of QGeoCoordinates representing its perimeter.
Each two adjacent elements in this list are intended to be connected together by the shortest line segment of constant bearing passing through both elements. This type of connection can cross the date line in the longitudinal direction, but never crosses the poles.
This is relevant for the calculation of the bounding box returned by QGeoShape::boundingGeoRectangle() for this shape, which will have the latitude of the top left corner set to the maximum latitude in the path point set. Similarly, the latitude of the bottom right corner will be the minimum latitude in the path point set.
This class is a Q_GADGET. It can be directly used from C++ and QML.
Constructs a new geo polygon from the contents of other.
Constructs a new geo polygon from the contents of other.
Constructs a new geo polygon from the coordinates specified in path.
Constructs a new, empty geo polygon.
Assigns other to this geo polygon and returns a reference to this geo polygon.
Destroys this polygon.
Appends coordinate to the polygon.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
Sets the holePath for a hole inside the polygon. The hole is a QVariant containing a QList<QGeoCoordinate>.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
This function was introduced in Qt 5.12.
Overloaded method. Sets the holePath for a hole inside the polygon. The hole is a QList<QGeoCoordinate>.
This function was introduced in Qt 5.12.
Returns true if the polygon's perimeter contains coordinate as one of the elements.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
Returns the coordinate at index .
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
Returns a QVariant containing a QVariant containing a QList<QGeoCoordinate> which represents the hole at index.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
This function was introduced in Qt 5.12.
Returns a QList<QGeoCoordinate> which represents the hole at index.
This function was introduced in Qt 5.12.
Returns the number of holes.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
This function was introduced in Qt 5.12.
Inserts coordinate at the specified index.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
Returns the length of the polygon's perimeter, in meters, from the element indexFrom to the element indexTo. The length is intended to be the sum of the shortest distances for each pair of adjacent points.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
Returns all the elements of the polygon's boundary.
See also setPath().
[protected]
QVariantList QGeoPolygon::perimeter() const
Returns all the elements of the polygon's perimeter.
This function was introduced in QtPositioning 5.12.
See also setPerimeter().
Removes the last occurrence of coordinate from the polygon.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
Removes element at position index from the polygon.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
Removes element at position index from the holes QList.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
This function was introduced in Qt 5.12.
Replaces the path element at the specified index with coordinate.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
Sets the path for the polygon.
See also path().
[protected]
void QGeoPolygon::setPerimeter(const QVariantList &path)
Sets all the elements of the polygon's perimeter based on a list of coordinates (path). .
This function was introduced in QtPositioning 5.12.
See also perimeter().
Returns the number of elements in the polygon.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
This function was introduced in Qt 5.10.
Returns the geo polygon properties as a string.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
Translates this geo polygon by degreesLatitude northwards and degreesLongitude eastwards.
Negative values of degreesLatitude and degreesLongitude correspond to southward and westward translation respectively.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
Returns a copy of this geo polygon translated by degreesLatitude northwards and degreesLongitude eastwards.
Negative values of degreesLatitude and degreesLongitude correspond to southward and westward translation respectively.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
See also translate().
Returns whether this geo polygon is not equal to other.
Returns whether this geo polygon is equal to other.
© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-5.15/qgeopolygon.html