QGeoPath Class
QGeoPath クラスは地理パスを定義します。詳細...
ヘッダー | #include <QGeoPath> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Positioning) target_link_libraries(mytarget PRIVATE Qt6::Positioning) |
qmake: | QT += positioning |
継承: | QGeoShape |
プロパティ
パブリック機能
QGeoPath() | |
QGeoPath(const QGeoShape &other) | |
QGeoPath(const QList<QGeoCoordinate> &path, const qreal &width = 0.0) | |
QGeoPath(const QGeoPath &other) | |
~QGeoPath() | |
void | addCoordinate(const QGeoCoordinate &coordinate) |
void | clearPath() |
bool | containsCoordinate(const QGeoCoordinate &coordinate) const |
QGeoCoordinate | coordinateAt(qsizetype index) const |
void | insertCoordinate(qsizetype index, const QGeoCoordinate &coordinate) |
double | length(qsizetype indexFrom = 0, qsizetype indexTo = -1) const |
const QList<QGeoCoordinate> & | path() const |
void | removeCoordinate(const QGeoCoordinate &coordinate) |
void | removeCoordinate(qsizetype index) |
void | replaceCoordinate(qsizetype index, const QGeoCoordinate &coordinate) |
void | setPath(const QList<QGeoCoordinate> &path) |
void | setWidth(const qreal &width) |
qsizetype | size() const |
QString | toString() const |
void | translate(double degreesLatitude, double degreesLongitude) |
QGeoPath | translated(double degreesLatitude, double degreesLongitude) const |
qreal | width() const |
QGeoPath & | operator=(const QGeoPath &other) |
詳細説明
パスはQGeoCoordinate オブジェクトの順序付きリストによって定義される。
パスの中の隣接する2つの要素はそれぞれ、両方の要素を通る一定の方位の最短線分によって接続されることを意図している。このタイプの接続は、長手方向には日付変更線を横切ることができるが、極を横切ることはない。
これは、この形状に対してQGeoShape::boundingGeoRectangle() が返すバウンディングボックスの計算に関連しており、左上隅の緯度はパスポイントセット内の最大緯度に設定されます。同様に、右下隅の緯度はパス点集合の最小緯度となる。
このクラスはQ_GADGET です。C++ や QML から直接使用することができます。
QGeoPath は、座標を含んでいなければ無効であり、また空でもあります。
注: デフォルトで構築された QGeoPath は、座標を含まないため、無効でもあり空でもある。
プロパティー ドキュメント
path : const QVariantList
このプロパティは、ジオパスの座標のリストを保持する。
注意: 座標をその場で処理することはできません。このプロパティの値を変更するには、座標の完全なリストを取得して処理し、新しい値をプロパティに割り当てます。
width : qreal
このプロパティは、パスの幅をメートル単位で保持する。
アクセス関数
qreal | width() const |
void | setWidth(const qreal &width) |
メンバー関数ドキュメント
QGeoPath::QGeoPath()
新しい空のジオパスを構築します。
QGeoPath::QGeoPath(const QGeoShape &other)
other の内容から新しいジオパスを構築する。
QGeoPath::QGeoPath(const QList<QGeoCoordinate> &path, const qreal &width = 0.0)
座標のリスト (path とwidth) から新しいジオパスを構築する。
QGeoPath::QGeoPath(const QGeoPath &other)
other の内容から新しいジオパスを構築する。
[noexcept]
QGeoPath::~QGeoPath()
このパスを破壊する。
[invokable]
void QGeoPath::addCoordinate(const QGeoCoordinate &coordinate)
coordinate をパスに追加する。
Note: この関数はメタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
void QGeoPath::clearPath()
パスをクリアする。
[invokable]
bool QGeoPath::containsCoordinate(const QGeoCoordinate &coordinate) const
パスの要素のひとつにcoordinate が含まれていれば真を返す。
注意: この関数はメタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable]
QGeoCoordinate QGeoPath::coordinateAt(qsizetype index) const
index における座標を返す。
注意: この関数はメタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable]
void QGeoPath::insertCoordinate(qsizetype index, const QGeoCoordinate &coordinate)
指定されたindex にcoordinate を挿入する。
注意: この関数はメタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable]
double QGeoPath::length(qsizetype indexFrom = 0, qsizetype indexTo = -1) const
要素indexFrom から要素indexTo までのパスの長さをメートル単位で返す。この長さは、隣接する点の各ペアの最短距離の合計であることを意図しています。
indexTo が -1 (デ フ ォ ル ト 値) の と き は、 長 さ は、 最後の座標 と 最初の座標 と の間の距離を含む (閉ループ)。パスの長さを取得するには、indexFrom には 0 を、indexTo にはQGeoPath::size() - 1 を使用します。
注意: この関数はメタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
const QList<QGeoCoordinate> &QGeoPath::path() const
パスのすべての要素を返します。
setPath()も参照 。
[invokable]
void QGeoPath::removeCoordinate(const QGeoCoordinate &coordinate)
パスから最後に出現したcoordinate を削除する。
注意: この関数はメタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable]
void QGeoPath::removeCoordinate(qsizetype index)
index の位置にある要素をパスから削除します。
注意: この関数はメタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable]
void QGeoPath::replaceCoordinate(qsizetype index, const QGeoCoordinate &coordinate)
指定されたindex の path 要素をcoordinate で置き換える。
注意: この関数はメタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
void QGeoPath::setPath(const QList<QGeoCoordinate> &path)
path のすべての要素を設定する。
path()も参照のこと 。
[invokable]
qsizetype QGeoPath::size() const
パスの要素数を返します。
注意: この関数はメタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable]
QString QGeoPath::toString() const
ジオパスのプロパティを文字列として返す。
注意: この関数はメタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable]
void QGeoPath::translate(double degreesLatitude, double degreesLongitude)
このジオパスをdegreesLatitude 北方向およびdegreesLongitude 東方向に変換する。
degreesLatitude とdegreesLongitude の負の値はそれぞれ南方向と西方向への移動に対応する。
注意: この関数はメタオブジェクトシステムおよび QML から呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable]
QGeoPath QGeoPath::translated(double degreesLatitude, double degreesLongitude) const
このジオパスのコピーを、degreesLatitude で北に、degreesLongitude で東に変換して返す。
degreesLatitude とdegreesLongitude の負の値はそれぞれ南方向と西方向への変換に対応する。
注意: この関数はメタオブジェクトシステムおよび QML から呼び出すことができます。Q_INVOKABLE を参照してください。
translate()も参照してください 。
qreal QGeoPath::width() const
パスの幅をメートル単位で返す。この情報はcontains メソッドで使用されます。デフォルト値は 0 です。
メモ: width プロパティのゲッター関数。
setWidth()も参照 。
QGeoPath &QGeoPath::operator=(const QGeoPath &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.