Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NEDJIMAbelgacem authored and wonder-sk committed Feb 10, 2021
1 parent 6019168 commit 5da9686
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
8 changes: 6 additions & 2 deletions src/3d/chunks/qgschunkloader_p.h
Expand Up @@ -56,7 +56,7 @@ class QgsChunkLoader : public QgsChunkQueueJob
*/
virtual Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent ) = 0;

virtual int primitiveCount() { return 0; }
virtual int primitiveCount() const { return 0; }
virtual int primitiveBudget() const { return mPrimitiveBudget; }
protected:
int mPrimitiveBudget = 1000000;
Expand All @@ -78,7 +78,11 @@ class QgsChunkLoaderFactory : public QObject
virtual QgsChunkLoader *createChunkLoader( QgsChunkNode *node ) const = 0;

//! Returns the primitives count for the chunk \a node
virtual int primitivesCount( QgsChunkNode *node ) { return 0; }
virtual int primitivesCount( QgsChunkNode *node ) const
{
Q_UNUSED(node);
return 0;
}

//! Creates root node of the hierarchy. Ownership of the returned object is passed to the caller.
virtual QgsChunkNode *createRootNode() const = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/3d/qgspointcloudlayerchunkloader_p.cpp
Expand Up @@ -126,7 +126,7 @@ Qt3DCore::QEntity *QgsPointCloudLayerChunkLoader::createEntity( Qt3DCore::QEntit
return entity;
}

int QgsPointCloudLayerChunkLoader::primitiveCount()
int QgsPointCloudLayerChunkLoader::primitiveCount() const
{
return mPointsCount;
}
Expand Down Expand Up @@ -154,7 +154,7 @@ QgsChunkLoader *QgsPointCloudLayerChunkLoaderFactory::createChunkLoader( QgsChun
return new QgsPointCloudLayerChunkLoader( this, node, std::unique_ptr< QgsPointCloud3DSymbol >( static_cast< QgsPointCloud3DSymbol * >( mSymbol->clone() ) ), mZValueScale, mZValueOffset, mPointBudget, pointCount );
}

int QgsPointCloudLayerChunkLoaderFactory::primitivesCount( QgsChunkNode *node )
int QgsPointCloudLayerChunkLoaderFactory::primitivesCount( QgsChunkNode *node ) const
{
QgsChunkNodeId id = node->tileId();
IndexedPointCloudNode n( id.d, id.x, id.y, id.z );
Expand Down
4 changes: 2 additions & 2 deletions src/3d/qgspointcloudlayerchunkloader_p.h
Expand Up @@ -66,7 +66,7 @@ class QgsPointCloudLayerChunkLoaderFactory : public QgsChunkLoaderFactory
virtual QgsChunkLoader *createChunkLoader( QgsChunkNode *node ) const override;
virtual QgsChunkNode *createRootNode() const override;
virtual QVector<QgsChunkNode *> createChildren( QgsChunkNode *node ) const override;
virtual int primitivesCount( QgsChunkNode *node ) override;
virtual int primitivesCount( QgsChunkNode *node ) const override;
const Qgs3DMapSettings &mMap;
QgsPointCloudIndex *mPointCloudIndex;
std::unique_ptr< QgsPointCloud3DSymbol > mSymbol;
Expand Down Expand Up @@ -95,7 +95,7 @@ class QgsPointCloudLayerChunkLoader : public QgsChunkLoader
QgsPointCloudLayerChunkLoader( const QgsPointCloudLayerChunkLoaderFactory *factory, QgsChunkNode *node, std::unique_ptr< QgsPointCloud3DSymbol > symbol, double zValueScale, double zValueOffset, int pointBudget, int count );
~QgsPointCloudLayerChunkLoader() override;

int primitiveCount() override;
int primitiveCount() const override;

virtual void cancel() override;
virtual Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent ) override;
Expand Down
3 changes: 3 additions & 0 deletions src/core/pointcloud/qgspointcloudindex.h
Expand Up @@ -222,6 +222,9 @@ class CORE_EXPORT QgsPointCloudIndex: public QObject
*/
int span() const;

/**
* Returns the number of poiny of indexed point cloud node \a n
*/
int nodePointCount( const IndexedPointCloudNode &n );

protected: //TODO private
Expand Down

0 comments on commit 5da9686

Please sign in to comment.