Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
remove primitiveCount and primitiveBudget from chunk loader
- Loading branch information
|
@@ -250,7 +250,7 @@ void QgsChunkedEntity::update( QgsChunkNode *root, const SceneState &state ) |
|
|
QSet<QgsChunkNode *> nodes; |
|
|
|
|
|
using slot = std::pair<QgsChunkNode *, float>; |
|
|
auto cmp_funct = []( slot &p1, slot &p2 ) |
|
|
auto cmp_funct = []( slot & p1, slot & p2 ) |
|
|
{ |
|
|
return p1.second < p2.second; |
|
|
}; |
|
|
|
@@ -44,22 +44,13 @@ class QgsChunkLoader : public QgsChunkQueueJob |
|
|
Q_OBJECT |
|
|
public: |
|
|
//! Construct chunk loader for a node |
|
|
QgsChunkLoader( QgsChunkNode *node, int primitiveBudget = 1000000 ) |
|
|
: QgsChunkQueueJob( node ) |
|
|
, mPrimitiveBudget( primitiveBudget ) |
|
|
{ |
|
|
} |
|
|
QgsChunkLoader( QgsChunkNode *node ) : QgsChunkQueueJob( node ) { } |
|
|
|
|
|
/** |
|
|
* Run in main thread to use loaded data. |
|
|
* Returns entity attached to the given parent entity in disabled state |
|
|
*/ |
|
|
virtual Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent ) = 0; |
|
|
|
|
|
virtual int primitiveCount() const { return 0; } |
|
|
virtual int primitiveBudget() const { return mPrimitiveBudget; } |
|
|
protected: |
|
|
int mPrimitiveBudget = 1000000; |
|
|
}; |
|
|
|
|
|
|
|
|
|
@@ -47,11 +47,10 @@ |
|
|
/////////////// |
|
|
|
|
|
QgsPointCloudLayerChunkLoader::QgsPointCloudLayerChunkLoader( const QgsPointCloudLayerChunkLoaderFactory *factory, QgsChunkNode *node, std::unique_ptr< QgsPointCloud3DSymbol > symbol, |
|
|
double zValueScale, double zValueOffset, int pointBudget, int count ) |
|
|
: QgsChunkLoader( node, pointBudget ) |
|
|
double zValueScale, double zValueOffset ) |
|
|
: QgsChunkLoader( node ) |
|
|
, mFactory( factory ) |
|
|
, mContext( factory->mMap, std::move( symbol ), zValueScale, zValueOffset ) |
|
|
, mPointsCount( count ) |
|
|
{ |
|
|
mContext.setIsCanceledCallback( [this] { return mCanceled; } ); |
|
|
|
|
@@ -126,11 +125,6 @@ Qt3DCore::QEntity *QgsPointCloudLayerChunkLoader::createEntity( Qt3DCore::QEntit |
|
|
return entity; |
|
|
} |
|
|
|
|
|
int QgsPointCloudLayerChunkLoader::primitiveCount() const |
|
|
{ |
|
|
return mPointsCount; |
|
|
} |
|
|
|
|
|
/////////////// |
|
|
|
|
|
|
|
@@ -150,8 +144,7 @@ QgsChunkLoader *QgsPointCloudLayerChunkLoaderFactory::createChunkLoader( QgsChun |
|
|
QgsChunkNodeId id = node->tileId(); |
|
|
IndexedPointCloudNode n( id.d, id.x, id.y, id.z ); |
|
|
Q_ASSERT( mPointCloudIndex->hasNode( n ) ); |
|
|
int pointCount = mPointCloudIndex->nodePointCount( n ); |
|
|
return new QgsPointCloudLayerChunkLoader( this, node, std::unique_ptr< QgsPointCloud3DSymbol >( static_cast< QgsPointCloud3DSymbol * >( mSymbol->clone() ) ), mZValueScale, mZValueOffset, mPointBudget, pointCount ); |
|
|
return new QgsPointCloudLayerChunkLoader( this, node, std::unique_ptr< QgsPointCloud3DSymbol >( static_cast< QgsPointCloud3DSymbol * >( mSymbol->clone() ) ), mZValueScale, mZValueOffset ); |
|
|
} |
|
|
|
|
|
int QgsPointCloudLayerChunkLoaderFactory::primitivesCount( QgsChunkNode *node ) const |
|
|
|
@@ -92,11 +92,9 @@ class QgsPointCloudLayerChunkLoader : public QgsChunkLoader |
|
|
* Constructs the loader |
|
|
* QgsPointCloudLayerChunkLoader takes ownership over symbol |
|
|
*/ |
|
|
QgsPointCloudLayerChunkLoader( const QgsPointCloudLayerChunkLoaderFactory *factory, QgsChunkNode *node, std::unique_ptr< QgsPointCloud3DSymbol > symbol, double zValueScale, double zValueOffset, int pointBudget, int count ); |
|
|
QgsPointCloudLayerChunkLoader( const QgsPointCloudLayerChunkLoaderFactory *factory, QgsChunkNode *node, std::unique_ptr< QgsPointCloud3DSymbol > symbol, double zValueScale, double zValueOffset ); |
|
|
~QgsPointCloudLayerChunkLoader() override; |
|
|
|
|
|
int primitiveCount() const override; |
|
|
|
|
|
virtual void cancel() override; |
|
|
virtual Qt3DCore::QEntity *createEntity( Qt3DCore::QEntity *parent ) override; |
|
|
|
|
@@ -106,7 +104,6 @@ class QgsPointCloudLayerChunkLoader : public QgsChunkLoader |
|
|
QgsPointCloud3DRenderContext mContext; |
|
|
bool mCanceled = false; |
|
|
QFutureWatcher<void> *mFutureWatcher = nullptr; |
|
|
int mPointsCount; |
|
|
}; |
|
|
|
|
|
|
|
|