16 #ifndef QGSCHUNKEDENTITY_P_H 17 #define QGSCHUNKEDENTITY_P_H 30 #include <Qt3DCore/QEntity> 35 class QgsChunkQueueJob;
36 class QgsChunkLoaderFactory;
37 class QgsChunkBoundsEntity;
38 class QgsChunkQueueJobFactory;
58 class QgsChunkedEntity :
public Qt3DCore::QEntity
63 QgsChunkedEntity(
const QgsAABB &rootBbox,
float rootError,
float mTau,
int mMaxLevel, QgsChunkLoaderFactory *loaderFactory, Qt3DCore::QNode *parent =
nullptr );
64 ~QgsChunkedEntity()
override;
72 QMatrix4x4 viewProjectionMatrix;
76 void update(
const SceneState &state );
79 bool needsUpdate()
const {
return mNeedsUpdate; }
82 void setShowBoundingBoxes(
bool enabled );
85 void updateNodes(
const QList<QgsChunkNode *> &nodes, QgsChunkQueueJobFactory *updateJobFactory );
88 QList<QgsChunkNode *> activeNodes()
const {
return mActiveNodes; }
90 QgsChunkNode *rootNode()
const {
return mRootNode; }
93 int pendingJobsCount()
const;
96 void setPickingEnabled(
bool enabled );
98 bool hasPickingEnabled()
const {
return mPickingEnabled; }
102 void cancelActiveJob( QgsChunkQueueJob *job );
103 void cancelActiveJobs();
105 void setNeedsUpdate(
bool needsUpdate ) { mNeedsUpdate = needsUpdate; }
108 void update( QgsChunkNode *node,
const SceneState &state );
111 void requestResidency( QgsChunkNode *node );
114 QgsChunkQueueJob *startJob( QgsChunkNode *node );
117 void onActiveJobFinished();
119 void onPickEvent( Qt3DRender::QPickEvent *event );
123 void pendingJobsCountChanged();
126 void newEntityCreated( Qt3DCore::QEntity *entity );
129 void pickedObject( Qt3DRender::QPickEvent *pickEvent,
QgsFeatureId fid );
133 QgsChunkNode *mRootNode =
nullptr;
135 bool mNeedsUpdate =
false;
148 QgsChunkLoaderFactory *mChunkLoaderFactory =
nullptr;
150 QgsChunkList *mChunkLoaderQueue =
nullptr;
152 QgsChunkList *mReplacementQueue =
nullptr;
154 QList<QgsChunkNode *> mActiveNodes;
156 int mFrustumCulled = 0;
163 int mMaxLoadedChunks = 512;
166 QgsChunkBoundsEntity *mBboxesEntity =
nullptr;
169 QList<QgsChunkQueueJob *> mActiveJobs;
172 bool mPickingEnabled =
false;
177 #endif // QGSCHUNKEDENTITY_P_H 3 Axis-aligned bounding box - in world coords.