QGeoPolygon Class

QGeoPolygon 클래스는 지리적 다각형을 정의합니다. 더 보기...

Header: #include <QGeoPolygon>
CMake: find_package(Qt6 REQUIRED COMPONENTS Positioning)
target_link_libraries(mytarget PRIVATE Qt6::Positioning)
qmake: QT += positioning
상속합니다: QGeoShape

공용 함수

QGeoPolygon()
QGeoPolygon(const QGeoShape &other)
QGeoPolygon(const QList<QGeoCoordinate> &path)
QGeoPolygon(const QGeoPolygon &other)
~QGeoPolygon()
void addCoordinate(const QGeoCoordinate &coordinate)
void addHole(const QList<QGeoCoordinate> &holePath)
void addHole(const QVariant &holePath)
bool containsCoordinate(const QGeoCoordinate &coordinate) const
QGeoCoordinate coordinateAt(qsizetype index) const
const QVariantList hole(qsizetype index) const
const QList<QGeoCoordinate> holePath(qsizetype index) const
qsizetype holesCount() const
void insertCoordinate(qsizetype index, const QGeoCoordinate &coordinate)
double length(qsizetype indexFrom = 0, qsizetype indexTo = -1) const
(since QtPositioning 5.12) const QList<QGeoCoordinate> &perimeter() const
void removeCoordinate(const QGeoCoordinate &coordinate)
void removeCoordinate(qsizetype index)
void removeHole(qsizetype index)
void replaceCoordinate(qsizetype index, const QGeoCoordinate &coordinate)
(since QtPositioning 5.12) void setPerimeter(const QList<QGeoCoordinate> &path)
qsizetype size() const
QString toString() const
void translate(double degreesLatitude, double degreesLongitude)
QGeoPolygon translated(double degreesLatitude, double degreesLongitude) const
QGeoPolygon &operator=(const QGeoPolygon &other)

상세 설명

다각형은 그 둘레를 나타내는 QGeoCoordinate 객체의 정렬된 목록으로 정의됩니다.

이 목록에서 인접한 두 요소는 두 요소를 통과하는 최단 방위각의 최단 선분으로 서로 연결되도록 되어 있습니다. 이러한 유형의 연결은 날짜 선을 세로 방향으로 교차할 수 있지만 극을 가로지르지는 않습니다.

이는 이 도형에 대해 QGeoShape::boundingGeoRectangle()가 반환하는 바운딩 박스 계산과 관련이 있으며, 왼쪽 상단 모서리의 위도는 경로 포인트 설정의 최대 위도로 설정됩니다. 마찬가지로 오른쪽 아래 모서리의 위도는 경로 포인트 세트의 최소 위도가 됩니다.

이 클래스는 Q_GADGET. C++ 및 QML에서 직접 사용할 수 있습니다.

멤버 함수 문서

QGeoPolygon::QGeoPolygon()

새로운 빈 지리적 다각형을 만듭니다.

QGeoPolygon::QGeoPolygon(const QGeoShape &other)

other 의 내용에서 새 지리적 다각형을 만듭니다.

QGeoPolygon::QGeoPolygon(const QList<QGeoCoordinate> &path)

path 에 지정된 좌표에서 새 지리적 다각형을 만듭니다.

QGeoPolygon::QGeoPolygon(const QGeoPolygon &other)

other 의 내용에서 새 지리적 다각형을 만듭니다.

[noexcept] QGeoPolygon::~QGeoPolygon()

이 다각형을 파괴합니다.

[invokable] void QGeoPolygon::addCoordinate(const QGeoCoordinate &coordinate)

다각형에 coordinate 을 추가합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하십시오.

void QGeoPolygon::addHole(const QList<QGeoCoordinate> &holePath)

과부하 메서드. 다각형 내부의 구멍에 holePath 을 설정합니다. 구멍은 QList<QGeoCoordinate>입니다.

[invokable] void QGeoPolygon::addHole(const QVariant &holePath)

다각형 내부의 구멍에 holePath 을 설정합니다. 구멍은 QList<QGeoCoordinate>를 포함하는 QVariant 입니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

[invokable] bool QGeoPolygon::containsCoordinate(const QGeoCoordinate &coordinate) const

다각형의 둘레에 요소 중 하나로 coordinate 이 포함된 경우 참을 반환합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

[invokable] QGeoCoordinate QGeoPolygon::coordinateAt(qsizetype index) const

index 에서 좌표를 반환합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

[invokable] const QVariantList QGeoPolygon::hole(qsizetype index) const

index 에서 구멍을 나타내는 QList<QGeoCoordinate>을 포함하는 QVariant 을 반환합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

const QList<QGeoCoordinate> QGeoPolygon::holePath(qsizetype index) const

index 에서 구멍을 나타내는 QList<QGeoCoordinate>을 반환합니다.

[invokable] qsizetype QGeoPolygon::holesCount() const

구멍의 개수를 반환합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

[invokable] void QGeoPolygon::insertCoordinate(qsizetype index, const QGeoCoordinate &coordinate)

지정된 indexcoordinate 을 삽입합니다.

참고: 이 함수는 메타객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

[invokable] double QGeoPolygon::length(qsizetype indexFrom = 0, qsizetype indexTo = -1) const

indexFrom 요소에서 indexTo 요소까지 다각형 둘레의 길이(미터)를 반환합니다. 길이는 인접한 각 점 쌍의 최단 거리의 합이 되도록 되어 있습니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

[since QtPositioning 5.12] const QList<QGeoCoordinate> &QGeoPolygon::perimeter() const

다각형 둘레의 모든 요소를 반환합니다.

참고: 속성 둘레에 대한 겟터 함수입니다.

이 함수는 QtPositioning 5.12에 도입되었습니다.

setPerimeter()도 참조하세요 .

[invokable] void QGeoPolygon::removeCoordinate(const QGeoCoordinate &coordinate)

다각형에서 coordinate 의 마지막 항목을 제거합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

[invokable] void QGeoPolygon::removeCoordinate(qsizetype index)

다각형에서 index 위치에 있는 요소를 제거합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

[invokable] void QGeoPolygon::removeHole(qsizetype index)

구멍 목록에서 index 위치에 있는 요소를 제거합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

[invokable] void QGeoPolygon::replaceCoordinate(qsizetype index, const QGeoCoordinate &coordinate)

지정된 index 의 경로 요소를 coordinate 로 바꿉니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

[since QtPositioning 5.12] void QGeoPolygon::setPerimeter(const QList<QGeoCoordinate> &path)

좌표 목록에 따라 다각형의 둘레를 설정합니다 path.

참고: 속성에 대한 세터 함수 perimeter.

이 함수는 QtPositioning 5.12에 도입되었습니다.

perimeter()도 참조하십시오 .

[invokable] qsizetype QGeoPolygon::size() const

다각형의 요소 수를 반환합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

[invokable] QString QGeoPolygon::toString() const

지리적 다각형 속성을 문자열로 반환합니다.

참고: 이 함수는 메타객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

[invokable] void QGeoPolygon::translate(double degreesLatitude, double degreesLongitude)

이 지오 폴리곤을 degreesLatitude 북쪽으로, degreesLongitude 동쪽으로 번역합니다.

음수 값 degreesLatitudedegreesLongitude 은 각각 남쪽 및 서쪽으로 번역합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

[invokable] QGeoPolygon QGeoPolygon::translated(double degreesLatitude, double degreesLongitude) const

degreesLatitude 북쪽으로, degreesLongitude 동쪽으로 번역된 이 지오 폴리곤의 복사본을 반환합니다.

음수 값 degreesLatitudedegreesLongitude 은 각각 남쪽 및 서쪽으로의 번역에 해당합니다.

참고: 이 함수는 메타 객체 시스템과 QML을 통해 호출할 수 있습니다. Q_INVOKABLE 을 참조하세요.

translate()도 참조하세요 .

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

이 지리적 다각형에 other 을 할당하고 이 지리적 다각형에 대한 참조를 반환합니다.

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.