QGeoRectangle Class
QGeoRectangle クラスは、矩形の地理領域を定義します。詳細...
ヘッダー | #include <QGeoRectangle> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Positioning) target_link_libraries(mytarget PRIVATE Qt6::Positioning) |
qmake: | QT += positioning |
継承: | QGeoShape |
プロパティ
|
パブリック機能
QGeoRectangle() | |
QGeoRectangle(const QGeoShape &other) | |
QGeoRectangle(const QList<QGeoCoordinate> &coordinates) | |
QGeoRectangle(const QGeoCoordinate &topLeft, const QGeoCoordinate &bottomRight) | |
QGeoRectangle(const QGeoCoordinate ¢er, double degreesWidth, double degreesHeight) | |
QGeoRectangle(const QGeoRectangle &other) | |
~QGeoRectangle() | |
QGeoCoordinate | bottomLeft() const |
QGeoCoordinate | bottomRight() const |
QGeoCoordinate | center() const |
bool | contains(const QGeoRectangle &rectangle) const |
void | extendRectangle(const QGeoCoordinate &coordinate) |
double | height() const |
bool | intersects(const QGeoRectangle &rectangle) const |
void | setBottomLeft(const QGeoCoordinate &bottomLeft) |
void | setBottomRight(const QGeoCoordinate &bottomRight) |
void | setCenter(const QGeoCoordinate ¢er) |
void | setHeight(double degreesHeight) |
void | setTopLeft(const QGeoCoordinate &topLeft) |
void | setTopRight(const QGeoCoordinate &topRight) |
void | setWidth(double degreesWidth) |
QString | toString() const |
QGeoCoordinate | topLeft() const |
QGeoCoordinate | topRight() const |
void | translate(double degreesLatitude, double degreesLongitude) |
QGeoRectangle | translated(double degreesLatitude, double degreesLongitude) const |
QGeoRectangle | united(const QGeoRectangle &rectangle) const |
double | width() const |
QGeoRectangle & | operator=(const QGeoRectangle &other) |
QGeoRectangle | operator|(const QGeoRectangle &rectangle) const |
QGeoRectangle & | operator|=(const QGeoRectangle &rectangle) |
詳細説明
矩形は、矩形の左上座標を指定するQGeoCoordinate と、矩形の右下座標を指定するQGeoCoordinate で定義される。
ジオ矩形は、左上座標または右下座標が無効な場合、あるいは左上座標が右下座標より南にある場合、無効であるとみなされる。
ジオ矩形は決して極を横切ることはできません。
い く つかの メ ソ ッ ド は、 ジ オ矩形が中心座標 と 、 ジ オ矩形の幅 (度単位) と 、 ジ オ矩形の高 さ (度単位) と で定義 さ れてい るかの よ う に動作 し ます。
ジオ矩形の高さや中心が、極の 1 つを横切るように調整された場合、ジオ矩形が極に接するが横切らないように、また中心座標がジオ矩形の中心にあるように、高さが修正されます。
このクラスは Qt 5.5 以降のQ_GADGET です。C++やQMLから直接使用することができます。
プロパティのドキュメント
bottomLeft : QGeoCoordinate
このプロパティは、このジオ矩形の左下座標を保持します。
このプロパティは Qt 5.5 で導入されましたが、関連するアクセサ関数はこのクラスの最初のバージョンから存在しています。
アクセス関数
QGeoCoordinate | bottomLeft() const |
void | setBottomLeft(const QGeoCoordinate &bottomLeft) |
bottomRight : QGeoCoordinate
このプロパティは、このジオ矩形の右下座標を保持する。
このプロパティは Qt 5.5 で導入されましたが、関連するアクセサ関数はこのクラスの最初のバージョンから存在しています。
アクセス関数
QGeoCoordinate | bottomRight() const |
void | setBottomRight(const QGeoCoordinate &bottomRight) |
center : QGeoCoordinate
このプロパティは、このジオ矩形の中心を保持します。
このプロパティは Qt 5.5 で導入されましたが、関連するアクセサ関数はこのクラスの最初のバージョンから存在しています。
アクセス関数:
QGeoShape::centerも参照してください 。
height : double
このプロパティは、このジオ矩形の高さを度単位で保持する。
このジオ矩形が無効な場合、プロパティ値は未定義である。
新しい高さが 0.0 より小さい場合、またはこのジオ矩形が無効な場合、プロパティは変更されない。中心、幅、高さに基づいて無効なジオ矩形の値を設定するには、まずsetCenter() を使用してジオ矩形を有効にする必要があります。
高さの変更によってジオ矩形がポールを横切ることになる場合は、ジオ矩形がポールに触れるだけになるように高さが調整される。
こ の変更は、 中心座標がジオ矩形の中心にあ る ま ま にな る よ う に行 う ため、 結果 と し ては、 予想よ り も 高 さ の小さいジオ矩形にな る 可能性があ り ます。
180.0 は、新しい高さが 180 以上の場合にのみ使用される高さです。
このプロパティは Qt 5.5 で導入されましたが、関連するアクセサ関数はこのクラスの最初のバージョンから存在しています。
アクセス関数
topLeft : QGeoCoordinate
このプロパティは、このジオ矩形の左上座標を保持する。
このプロパティは Qt 5.5 で導入されましたが、関連するアクセサ関数はこのクラスの最初のバージョンから存在しています。
アクセス関数
QGeoCoordinate | topLeft() const |
void | setTopLeft(const QGeoCoordinate &topLeft) |
topRight : QGeoCoordinate
このプロパティは、このジオ矩形の右上座標を保持する。
このプロパティは Qt 5.5 で導入されましたが、関連するアクセサ関数はこのクラスの最初のバージョンから存在しています。
アクセス関数
QGeoCoordinate | topRight() const |
void | setTopRight(const QGeoCoordinate &topRight) |
width : double
このプロパティは、このジオ矩形の幅を度単位で保持する。
このジオ矩形が無効な場合、プロパティ値は未定義である。
新しい幅が 0.0 より小さい場合、またはこのジオ矩形が無効な場合、この関数は何もしない。中心、幅、高さに基づいて無効なジオ矩形の値を設定するには、まずsetCenter() を使用してジオ矩形を有効にする必要があります。
360.0 は、新しい幅が 360 以上の場合にのみ使用される幅である。このような場合、ジオ矩形の左端の経度は -180.0 度に設定され、ジオ矩形の右端の経度は 180.0 度に設定されます。
このプロパティは Qt 5.5 で導入されましたが、関連するアクセサ関数はこのクラスの最初のバージョンから存在しています。
アクセス関数
メンバ関数のドキュメント
QGeoRectangle::QGeoRectangle()
新しい、無効なジオ矩形を構築する。
QGeoRectangle::QGeoRectangle(const QGeoShape &other)
other の内容からジオ矩形を構築する。
QGeoRectangle::QGeoRectangle(const QList<QGeoCoordinate> &coordinates)
coordinates のすべてを含む、最小サイズの新しいジオ矩形を構築する。
QGeoRectangle::QGeoRectangle(const QGeoCoordinate &topLeft, const QGeoCoordinate &bottomRight)
左上座標topLeft 、右下座標bottomRight 。
QGeoRectangle::QGeoRectangle(const QGeoCoordinate ¢er, double degreesWidth, double degreesHeight)
center を中心とし、幅を度単位でdegreesWidth とし、高さを度単位でdegreesHeight とする新しいジオ矩形を構築する。
もしdegreesHeight がジオ矩形を極のひとつを超えてしまうのであれば、ジオ矩形の高さは切り捨てられ、ジオ矩形は極までしか伸びなくなる。ジオ矩形の中心は変更されず、中心点が切り捨てられたジオ矩形の中心に来るように高さが調整される。
QGeoRectangle::QGeoRectangle(const QGeoRectangle &other)
other の内容からジオ矩形を構築する。
[noexcept]
QGeoRectangle::~QGeoRectangle()
このジオ矩形を破壊する。
QGeoCoordinate QGeoRectangle::bottomLeft() const
このジオ矩形の左下座標を返します。
注: プロパティ bottomLeft のゲッター関数。
setBottomLeft()も参照してください 。
QGeoCoordinate QGeoRectangle::bottomRight() const
このジオ矩形の右下座標を返します。
注: プロパティ bottomRight のゲッター関数。
setBottomRight()も参照してください 。
QGeoCoordinate QGeoRectangle::center() const
このジオ矩形の中心を返します。QGeoShape::center() と同等。
注釈 center プロパティのゲッター関数。
setCenter()も参照してください 。
bool QGeoRectangle::contains(const QGeoRectangle &rectangle) const
ジオ矩形rectangle がこのジオ矩形内に含まれるかどうかを返します。
[invokable]
void QGeoRectangle::extendRectangle(const QGeoCoordinate &coordinate)
座標をカバーするようにジオ矩形を拡張する。coordinate
注意: この関数はメタオブジェクトシステムおよび QML から呼び出すことができます。Q_INVOKABLE を参照してください。
double QGeoRectangle::height() const
このジオ矩形の高さを度単位で返します。
このジオ矩形が無効な場合、戻り値は未定義である。
備考: プロパティ height のゲッター関数。
setHeight()も参照してください 。
[invokable]
bool QGeoRectangle::intersects(const QGeoRectangle &rectangle) const
ジオ矩形rectangle がこのジオ矩形と交差しているかどうかを返します。
両方のジオ矩形の上辺または下辺が極のどちらかにある場合、ジオ矩形は交差しているとみなされます。
注意: この関数はメタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
void QGeoRectangle::setBottomLeft(const QGeoCoordinate &bottomLeft)
このジオ矩形の左下座標をbottomLeft に設定します。
注: プロパティbottomLeft に対するセッター関数。
bottomLeft()も参照してください 。
void QGeoRectangle::setBottomRight(const QGeoCoordinate &bottomRight)
このジオ矩形の右下座標をbottomRight に設定します。
注: プロパティbottomRight に対するセッター関数。
bottomRight()も参照してください 。
void QGeoRectangle::setCenter(const QGeoCoordinate ¢er)
このジオ矩形の中心をcenter に設定する。
これによってジオ矩形が極を横切る場合、ジオ矩形の高さは切り詰められ、ジオ矩形は極までしか伸びなくなる。ジオ矩形の中心は変更されず、中心点が切り捨てられたジオ矩形の中心に来るように高さが調整されます。
注: プロパティcenter に対するセッター関数。
center()も参照してください 。
void QGeoRectangle::setHeight(double degreesHeight)
このジオ矩形の高さを度単位でdegreesHeight に設定します。
注: プロパティheight に対するセッター関数。
height()も参照 。
void QGeoRectangle::setTopLeft(const QGeoCoordinate &topLeft)
このジオ矩形の左上座標をtopLeft に設定します。
注: プロパティtopLeft に対するセッター関数。
topLeft()も参照してください 。
void QGeoRectangle::setTopRight(const QGeoCoordinate &topRight)
このジオ矩形の右上座標をtopRight に設定します。
注: プロパティtopRight のセッター関数。
topRight()も参照してください 。
void QGeoRectangle::setWidth(double degreesWidth)
このジオ矩形の幅を度単位でdegreesWidth に設定する。
注: プロパティwidth に対するセッター関数。
width()も参照 。
[invokable]
QString QGeoRectangle::toString() const
ジオ矩形のプロパティを文字列で返します。
Note: この関数はメタオブジェクトシステムおよび QML から呼び出すことができます。Q_INVOKABLE を参照してください。
QGeoCoordinate QGeoRectangle::topLeft() const
このジオ矩形の左上座標を返します。
注: プロパティ topLeft のゲッター関数。
setTopLeft()も参照してください 。
QGeoCoordinate QGeoRectangle::topRight() const
このジオ矩形の右上座標を返します。
注: プロパティ topRight のゲッター関数。
setTopRight()も参照してください 。
[invokable]
void QGeoRectangle::translate(double degreesLatitude, double degreesLongitude)
こ のジオ矩形を、degreesLatitude で北へ、degreesLongitude で東へ平行移動 さ せます。
degreesLatitude とdegreesLongitude の負の値は、それぞれ南向きと西向きの平行移動に対応する。
変換によってジオ矩形が極を横切ることになる場合、ジオ矩形は、ジオ矩形の上端または下端が極に触れるまで変換されますが、それ以上には変換されません。
注意: この関数はメタオブジェクトシステムおよび QML から呼び出すことができます。Q_INVOKABLE を参照してください。
[invokable]
QGeoRectangle QGeoRectangle::translated(double degreesLatitude, double degreesLongitude) const
degreesLatitude を北へ、degreesLongitude を東へ平行移動した、このジオ矩形のコピーを返します。
degreesLatitude とdegreesLongitude の負の値は、それぞれ南向きと西向きの変換に対応します。
注意: この関数はメタオブジェクトシステムおよび QML から呼び出すことができます。Q_INVOKABLE を参照してください。
translate()も参照してください 。
[invokable]
QGeoRectangle QGeoRectangle::united(const QGeoRectangle &rectangle) const
このジオ矩形とrectangle の両方を含む最小のジオ矩形を返します。
2つのジオ矩形の中心がちょうど180.0度離れている場合、幅は360.0度に設定され、左端の経度は-180.0度、右端の経度は180.0度に設定される。これは、結果がオペランドの順序に依存しないようにするためである。
注意: この関数はメタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
double QGeoRectangle::width() const
このジオ矩形の幅を度単位で返します。
このジオ矩形が無効な場合、戻り値は未定義である。
注意: プロパティ width のゲッター関数。
setWidth()も参照してください 。
QGeoRectangle &QGeoRectangle::operator=(const QGeoRectangle &other)
このジオ矩形にother を割り当て、このジオ矩形への参照を返します。
QGeoRectangle QGeoRectangle::operator|(const QGeoRectangle &rectangle) const
このジオ矩形とrectangle の両方を含む最小のジオ矩形を返します。
2つのジオ矩形の中心がちょうど180.0度離れている場合、幅は360.0度に設定され、左端の経度は-180.0度、右端の経度は180.0度に設定される。これは、結果がオペランドの順序に依存しないことを保証するために行われます。
QGeoRectangle &QGeoRectangle::operator|=(const QGeoRectangle &rectangle)
このジオ矩形とrectangle の両方を含む最小のジオ矩形を返します。
2つのジオ矩形の中心がちょうど180.0度離れている場合、幅は360.0度に設定され、左端の経度は-180.0度、右端の経度は180.0度に設定される。これは、結果がオペランドの順序に依存しないことを保証するために行われます。
© 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.