mirror of
https://github.com/qgis/QGIS.git
synced 2025-11-22 00:14:55 -05:00
Further fix tests
This commit is contained in:
parent
406a1b5bec
commit
5ac1517f43
@ -432,18 +432,15 @@ bool QgsCopcPointCloudIndex::hasNode( const QgsPointCloudNodeId &n ) const
|
|||||||
|
|
||||||
QgsPointCloudNode QgsCopcPointCloudIndex::getNode( const QgsPointCloudNodeId &id ) const
|
QgsPointCloudNode QgsCopcPointCloudIndex::getNode( const QgsPointCloudNodeId &id ) const
|
||||||
{
|
{
|
||||||
fetchNodeHierarchy( id );
|
Q_ASSERT( fetchNodeHierarchy( id ) );
|
||||||
|
|
||||||
qint64 pointCount;
|
qint64 pointCount;
|
||||||
|
|
||||||
QList<QgsPointCloudNodeId> children;
|
|
||||||
{
|
{
|
||||||
QMutexLocker locker( &mHierarchyMutex );
|
QMutexLocker locker( &mHierarchyMutex );
|
||||||
|
|
||||||
pointCount = mHierarchy.value( id, -1 );
|
pointCount = mHierarchy.value( id, -1 );
|
||||||
|
}
|
||||||
|
|
||||||
auto hierarchyIt = mHierarchy.constFind( id );
|
QList<QgsPointCloudNodeId> children;
|
||||||
Q_ASSERT( hierarchyIt != mHierarchy.constEnd() );
|
|
||||||
children.reserve( 8 );
|
children.reserve( 8 );
|
||||||
const int d = id.d() + 1;
|
const int d = id.d() + 1;
|
||||||
const int x = id.x() * 2;
|
const int x = id.x() * 2;
|
||||||
@ -454,9 +451,9 @@ QgsPointCloudNode QgsCopcPointCloudIndex::getNode( const QgsPointCloudNodeId &id
|
|||||||
{
|
{
|
||||||
int dx = i & 1, dy = !!( i & 2 ), dz = !!( i & 4 );
|
int dx = i & 1, dy = !!( i & 2 ), dz = !!( i & 4 );
|
||||||
const QgsPointCloudNodeId n2( d, x + dx, y + dy, z + dz );
|
const QgsPointCloudNodeId n2( d, x + dx, y + dy, z + dz );
|
||||||
mHierarchyMutex.unlock();
|
|
||||||
bool found = fetchNodeHierarchy( n2 );
|
bool found = fetchNodeHierarchy( n2 );
|
||||||
mHierarchyMutex.lock();
|
{
|
||||||
|
QMutexLocker locker( &mHierarchyMutex );
|
||||||
if ( found && mHierarchy[id] >= 0 )
|
if ( found && mHierarchy[id] >= 0 )
|
||||||
children.append( n2 );
|
children.append( n2 );
|
||||||
}
|
}
|
||||||
|
|||||||
@ -871,10 +871,11 @@ void QgsPointCloudLayer::calculateStatistics()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Use the layer statistics for now, until we can calculate complete ones
|
||||||
|
mStatistics = indexStats;
|
||||||
if ( attributes.empty() && indexStats.sampledPointsCount() > 0 )
|
if ( attributes.empty() && indexStats.sampledPointsCount() > 0 )
|
||||||
{
|
{
|
||||||
// All attributes are covered by the saved stats, use them directly
|
// All attributes are covered by the saved stats, skip calculating anything
|
||||||
mStatistics = indexStats;
|
|
||||||
mStatisticsCalculationState = QgsPointCloudLayer::PointCloudStatisticsCalculationState::Calculated;
|
mStatisticsCalculationState = QgsPointCloudLayer::PointCloudStatisticsCalculationState::Calculated;
|
||||||
emit statisticsCalculationStateChanged( mStatisticsCalculationState );
|
emit statisticsCalculationStateChanged( mStatisticsCalculationState );
|
||||||
resetRenderer();
|
resetRenderer();
|
||||||
|
|||||||
@ -828,9 +828,9 @@ void TestQgsCopcProvider::testPointCloudIndex()
|
|||||||
QVERIFY( index->isValid() );
|
QVERIFY( index->isValid() );
|
||||||
|
|
||||||
QCOMPARE( index->getNode( QgsPointCloudNodeId::fromString( QStringLiteral( "0-0-0-0" ) ) ).pointCount(), 56721 );
|
QCOMPARE( index->getNode( QgsPointCloudNodeId::fromString( QStringLiteral( "0-0-0-0" ) ) ).pointCount(), 56721 );
|
||||||
QCOMPARE( index->getNode( QgsPointCloudNodeId::fromString( QStringLiteral( "1-1-1-1" ) ) ).pointCount(), -1 );
|
QVERIFY( !index->hasNode( QgsPointCloudNodeId::fromString( QStringLiteral( "1-1-1-1" ) ) ) );
|
||||||
QCOMPARE( index->getNode( QgsPointCloudNodeId::fromString( QStringLiteral( "2-3-3-1" ) ) ).pointCount(), 446 );
|
QCOMPARE( index->getNode( QgsPointCloudNodeId::fromString( QStringLiteral( "2-3-3-1" ) ) ).pointCount(), 446 );
|
||||||
QCOMPARE( index->getNode( QgsPointCloudNodeId::fromString( QStringLiteral( "9-9-9-9" ) ) ).pointCount(), -1 );
|
QVERIFY( !index->hasNode( QgsPointCloudNodeId::fromString( QStringLiteral( "9-9-9-9" ) ) ) );
|
||||||
|
|
||||||
QCOMPARE( index->pointCount(), 518862 );
|
QCOMPARE( index->pointCount(), 518862 );
|
||||||
QCOMPARE( index->zMin(), 2322.89625 );
|
QCOMPARE( index->zMin(), 2322.89625 );
|
||||||
@ -840,7 +840,6 @@ void TestQgsCopcProvider::testPointCloudIndex()
|
|||||||
QCOMPARE( index->span(), 128 );
|
QCOMPARE( index->span(), 128 );
|
||||||
|
|
||||||
QCOMPARE( index->getNode( QgsPointCloudNodeId::fromString( QStringLiteral( "0-0-0-0" ) ) ).error(), 0.328125 );
|
QCOMPARE( index->getNode( QgsPointCloudNodeId::fromString( QStringLiteral( "0-0-0-0" ) ) ).error(), 0.328125 );
|
||||||
QCOMPARE( index->getNode( QgsPointCloudNodeId::fromString( QStringLiteral( "1-1-1-1" ) ) ).error(), 0.1640625 );
|
|
||||||
QCOMPARE( index->getNode( QgsPointCloudNodeId::fromString( QStringLiteral( "2-3-3-1" ) ) ).error(), 0.08203125 );
|
QCOMPARE( index->getNode( QgsPointCloudNodeId::fromString( QStringLiteral( "2-3-3-1" ) ) ).error(), 0.08203125 );
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -854,7 +853,7 @@ void TestQgsCopcProvider::testPointCloudIndex()
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
QgsBox3D bounds = index->getNode( QgsPointCloudNodeId::fromString( QStringLiteral( "1-1-1-1" ) ) ).bounds();
|
QgsBox3D bounds = QgsPointCloudNode::bounds( index->rootNodeBounds(), QgsPointCloudNodeId::fromString( QStringLiteral( "1-1-1-1" ) ) );
|
||||||
QCOMPARE( bounds.xMinimum(), 515389 );
|
QCOMPARE( bounds.xMinimum(), 515389 );
|
||||||
QCOMPARE( bounds.yMinimum(), 4918361 );
|
QCOMPARE( bounds.yMinimum(), 4918361 );
|
||||||
QCOMPARE( bounds.zMinimum(), 2343 );
|
QCOMPARE( bounds.zMinimum(), 2343 );
|
||||||
|
|||||||
@ -633,7 +633,7 @@ void TestQgsEptProvider::testPointCloudIndex()
|
|||||||
QCOMPARE( index->getNode( QgsPointCloudNodeId::fromString( QStringLiteral( "0-0-0-0" ) ) ).pointCount(), 41998 );
|
QCOMPARE( index->getNode( QgsPointCloudNodeId::fromString( QStringLiteral( "0-0-0-0" ) ) ).pointCount(), 41998 );
|
||||||
QCOMPARE( index->getNode( QgsPointCloudNodeId::fromString( QStringLiteral( "1-1-1-1" ) ) ).pointCount(), 48879 );
|
QCOMPARE( index->getNode( QgsPointCloudNodeId::fromString( QStringLiteral( "1-1-1-1" ) ) ).pointCount(), 48879 );
|
||||||
QCOMPARE( index->getNode( QgsPointCloudNodeId::fromString( QStringLiteral( "2-3-3-1" ) ) ).pointCount(), 41734 );
|
QCOMPARE( index->getNode( QgsPointCloudNodeId::fromString( QStringLiteral( "2-3-3-1" ) ) ).pointCount(), 41734 );
|
||||||
QCOMPARE( index->getNode( QgsPointCloudNodeId::fromString( QStringLiteral( "9-9-9-9" ) ) ).pointCount(), -1 );
|
QVERIFY( !index->hasNode( QgsPointCloudNodeId::fromString( QStringLiteral( "9-9-9-9" ) ) ) );
|
||||||
|
|
||||||
QCOMPARE( index->pointCount(), 518862 );
|
QCOMPARE( index->pointCount(), 518862 );
|
||||||
QCOMPARE( index->zMin(), 2322 );
|
QCOMPARE( index->zMin(), 2322 );
|
||||||
@ -647,15 +647,6 @@ void TestQgsEptProvider::testPointCloudIndex()
|
|||||||
QCOMPARE( index->getNode( QgsPointCloudNodeId::fromString( QStringLiteral( "2-3-3-1" ) ) ).error(), 0.0859375 );
|
QCOMPARE( index->getNode( QgsPointCloudNodeId::fromString( QStringLiteral( "2-3-3-1" ) ) ).error(), 0.0859375 );
|
||||||
|
|
||||||
{
|
{
|
||||||
<<<<<<< HEAD
|
|
||||||
QgsPointCloudDataBounds bounds = index->nodeBounds( IndexedPointCloudNode::fromString( QStringLiteral( "0-0-0-0" ) ) );
|
|
||||||
QCOMPARE( bounds.xMin(), -88000 );
|
|
||||||
QCOMPARE( bounds.yMin(), -88000 );
|
|
||||||
QCOMPARE( bounds.zMin(), -88000 );
|
|
||||||
QCOMPARE( bounds.xMax(), 88000 );
|
|
||||||
QCOMPARE( bounds.yMax(), 88000 );
|
|
||||||
QCOMPARE( bounds.zMax(), 88000 );
|
|
||||||
=======
|
|
||||||
QgsBox3D bounds = index->getNode( QgsPointCloudNodeId::fromString( QStringLiteral( "0-0-0-0" ) ) ).bounds();
|
QgsBox3D bounds = index->getNode( QgsPointCloudNodeId::fromString( QStringLiteral( "0-0-0-0" ) ) ).bounds();
|
||||||
QCOMPARE( bounds.xMinimum(), 515363 );
|
QCOMPARE( bounds.xMinimum(), 515363 );
|
||||||
QCOMPARE( bounds.yMinimum(), 4918339 );
|
QCOMPARE( bounds.yMinimum(), 4918339 );
|
||||||
@ -663,7 +654,6 @@ void TestQgsEptProvider::testPointCloudIndex()
|
|||||||
QCOMPARE( bounds.xMaximum(), 515407 );
|
QCOMPARE( bounds.xMaximum(), 515407 );
|
||||||
QCOMPARE( bounds.yMaximum(), 4918383 );
|
QCOMPARE( bounds.yMaximum(), 4918383 );
|
||||||
QCOMPARE( bounds.zMaximum(), 2353 );
|
QCOMPARE( bounds.zMaximum(), 2353 );
|
||||||
>>>>>>> 4bac513354a (Refactor QgsPointCloudIndex)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user