16 #ifndef QGSCHUNKEDENTITY_P_H
17 #define QGSCHUNKEDENTITY_P_H
30 #include <Qt3DCore/QEntity>
37 class QgsChunkQueueJob;
38 class QgsChunkLoaderFactory;
39 class QgsChunkBoundsEntity;
40 class QgsChunkQueueJobFactory;
60 class QgsChunkedEntity :
public Qt3DCore::QEntity
65 QgsChunkedEntity(
const QgsAABB &rootBbox,
float rootError,
float mTau,
int mMaxLevel, QgsChunkLoaderFactory *loaderFactory,
bool ownsFactory, Qt3DCore::QNode *parent =
nullptr );
66 ~QgsChunkedEntity()
override;
74 QMatrix4x4 viewProjectionMatrix;
78 void update(
const SceneState &state );
81 bool needsUpdate()
const {
return mNeedsUpdate; }
84 void setShowBoundingBoxes(
bool enabled );
87 void updateNodes(
const QList<QgsChunkNode *> &nodes, QgsChunkQueueJobFactory *updateJobFactory );
90 QList<QgsChunkNode *> activeNodes()
const {
return mActiveNodes; }
92 QgsChunkNode *rootNode()
const {
return mRootNode; }
95 int pendingJobsCount()
const;
98 void setPickingEnabled(
bool enabled );
100 bool hasPickingEnabled()
const {
return mPickingEnabled; }
104 void cancelActiveJob( QgsChunkQueueJob *job );
105 void cancelActiveJobs();
107 void setNeedsUpdate(
bool needsUpdate ) { mNeedsUpdate = needsUpdate; }
110 void update( QgsChunkNode *node,
const SceneState &state );
113 void requestResidency( QgsChunkNode *node );
116 QgsChunkQueueJob *startJob( QgsChunkNode *node );
119 void onActiveJobFinished();
121 void onPickEvent( Qt3DRender::QPickEvent *event );
125 void pendingJobsCountChanged();
128 void newEntityCreated( Qt3DCore::QEntity *entity );
131 void pickedObject( Qt3DRender::QPickEvent *pickEvent,
QgsFeatureId fid );
135 QgsChunkNode *mRootNode =
nullptr;
137 bool mNeedsUpdate =
false;
150 QgsChunkLoaderFactory *mChunkLoaderFactory =
nullptr;
152 bool mOwnsFactory =
true;
154 QgsChunkList *mChunkLoaderQueue =
nullptr;
156 QgsChunkList *mReplacementQueue =
nullptr;
158 QList<QgsChunkNode *> mActiveNodes;
160 int mFrustumCulled = 0;
167 int mMaxLoadedChunks = 512;
170 QgsChunkBoundsEntity *mBboxesEntity =
nullptr;
173 QList<QgsChunkQueueJob *> mActiveJobs;
176 bool mPickingEnabled =
false;
178 bool mIsValid =
true;
183 #endif // QGSCHUNKEDENTITY_P_H