本文整理汇总了C++中GeoDataLatLonAltBox::maxAltitude方法的典型用法代码示例。如果您正苦于以下问题:C++ GeoDataLatLonAltBox::maxAltitude方法的具体用法?C++ GeoDataLatLonAltBox::maxAltitude怎么用?C++ GeoDataLatLonAltBox::maxAltitude使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeoDataLatLonAltBox
的用法示例。
在下文中一共展示了GeoDataLatLonAltBox::maxAltitude方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: intersects
bool GeoDataLatLonAltBox::intersects( const GeoDataLatLonAltBox &other ) const
{
// Case 1: maximum altitude of other box intersects:
if ( ( d->m_maxAltitude >= other.maxAltitude() && d->m_minAltitude <= other.maxAltitude() )
// Case 2: maximum altitude of this box intersects:
|| ( other.maxAltitude() >= d->m_maxAltitude && other.minAltitude() <= d->m_maxAltitude )
// Case 3: minimum altitude of other box intersects:
|| ( d->m_maxAltitude >= other.minAltitude() && d->m_minAltitude <= other.minAltitude() )
// Case 4: minimum altitude of this box intersects:
|| ( other.maxAltitude() >= d->m_minAltitude && other.minAltitude() <= d->m_minAltitude ) ) {
if ( GeoDataLatLonBox::intersects( other ) )
return true;
}
return false;
}
示例2: testAltitude
void TestGeoDataLatLonAltBox::testAltitude()
{
QFETCH(qreal, alt);
GeoDataLatLonAltBox box;
box.setMinAltitude(alt);
QCOMPARE(box.minAltitude(), alt);
box.setMaxAltitude(alt);
QCOMPARE(box.maxAltitude(), alt);
}
示例3: contains
bool GeoDataLatLonAltBox::contains( const GeoDataLatLonAltBox &other ) const
{
// check the contain criterion for the altitude first as this is trivial:
// mDebug() << "this " << this->toString(GeoDataCoordinates::Degree);
// mDebug() << "other" << other.toString(GeoDataCoordinates::Degree);
if ( d->m_maxAltitude >= other.maxAltitude() && d->m_minAltitude <= other.minAltitude() ) {
return GeoDataLatLonBox::contains( other );
}
return false;
}
示例4: testPack
void TestGeoDataLatLonAltBox::testPack() {
QFETCH(GeoDataCoordinates, coordinates);
GeoDataLatLonAltBox const original = GeoDataLatLonAltBox(coordinates);
QBuffer buffer;
bool const isOpenForWriting = buffer.open(QBuffer::WriteOnly);
QVERIFY(isOpenForWriting);
QDataStream out(&buffer);
original.pack(out);
buffer.close();
bool const isOpenForReading = buffer.open(QBuffer::ReadOnly);
QVERIFY(isOpenForReading);
QDataStream in(&buffer);
GeoDataLatLonAltBox unpacked;
unpacked.unpack(in);
buffer.close();
#if 0
QCOMPARE(unpacked.north(), original.north());
QCOMPARE(unpacked.south(), original.south());
QCOMPARE(unpacked.east(), original.east());
QCOMPARE(unpacked.west(), original.west());
#endif
QCOMPARE(unpacked.maxAltitude(), original.maxAltitude());
QCOMPARE(unpacked.minAltitude(), original.minAltitude());
QCOMPARE(unpacked.altitudeMode(), original.altitudeMode());
}
示例5: testDefaultConstruction
void TestGeoDataLatLonAltBox::testDefaultConstruction()
{
GeoDataLatLonBox const latLonBox;
QCOMPARE( latLonBox.north(), 0.0 );
QCOMPARE( latLonBox.south(), 0.0 );
QCOMPARE( latLonBox.east(), 0.0 );
QCOMPARE( latLonBox.west(), 0.0 );
QCOMPARE( latLonBox.rotation(), 0.0 );
QCOMPARE( latLonBox.width(), 0.0 );
QCOMPARE( latLonBox.height(), 0.0 );
QVERIFY( !latLonBox.crossesDateLine() );
QCOMPARE( latLonBox.center(), GeoDataCoordinates( 0, 0 ) );
QVERIFY( latLonBox.isNull() );
QVERIFY( latLonBox.isEmpty() );
QVERIFY( (latLonBox|latLonBox).isNull() );
QVERIFY( (latLonBox|latLonBox).isEmpty() );
QVERIFY( !latLonBox.intersects( latLonBox ) );
GeoDataLatLonAltBox const latLonAltBox;
QCOMPARE( latLonAltBox.north(), 0.0 );
QCOMPARE( latLonAltBox.south(), 0.0 );
QCOMPARE( latLonAltBox.east(), 0.0 );
QCOMPARE( latLonAltBox.west(), 0.0 );
QCOMPARE( latLonAltBox.rotation(), 0.0 );
QCOMPARE( latLonAltBox.width(), 0.0 );
QCOMPARE( latLonAltBox.height(), 0.0 );
QVERIFY( !latLonAltBox.crossesDateLine() );
QCOMPARE( latLonAltBox.center(), GeoDataCoordinates( 0, 0, 0 ) );
QVERIFY( latLonAltBox.isNull() );
QVERIFY( latLonAltBox.isEmpty() );
QCOMPARE( latLonAltBox.minAltitude(), 0.0 );
QCOMPARE( latLonAltBox.maxAltitude(), 0.0 );
QCOMPARE( latLonAltBox.altitudeMode(), ClampToGround );
QVERIFY( (latLonAltBox|latLonAltBox).isNull() );
QVERIFY( (latLonAltBox|latLonAltBox).isEmpty() );
QVERIFY( !latLonAltBox.intersects( latLonAltBox ) );
}
示例6: resolves
bool ViewportParams::resolves ( const GeoDataLatLonAltBox &latLonAltBox ) const
{
return latLonAltBox.width() + latLonAltBox.height() > 2.0 * angularResolution()
|| latLonAltBox.maxAltitude() - latLonAltBox.minAltitude() > 10000;
}