16#ifndef QGSCHUNKEDENTITY_H
17#define QGSCHUNKEDENTITY_H
38class QgsChunkQueueJob;
39class QgsChunkLoaderFactory;
40class QgsChunkBoundsEntity;
41class QgsChunkQueueJobFactory;
46 struct RayCastContext;
63class QgsChunkedEntity :
public Qgs3DMapSceneEntity
68 QgsChunkedEntity(
Qgs3DMapSettings *mapSettings,
float tau, QgsChunkLoaderFactory *loaderFactory,
bool ownsFactory,
int primitivesBudget = std::numeric_limits<int>::max(), Qt3DCore::QNode *parent =
nullptr );
69 ~QgsChunkedEntity()
override;
72 void handleSceneUpdate(
const SceneContext &sceneContext )
override;
75 int pendingJobsCount()
const override;
78 bool needsUpdate()
const override {
return mNeedsUpdate; }
80 QgsRange<float> getNearFarPlaneRange(
const QMatrix4x4 &viewMatrix )
const override;
83 void setShowBoundingBoxes(
bool enabled );
86 void updateNodes(
const QList<QgsChunkNode *> &nodes, QgsChunkQueueJobFactory *updateJobFactory );
89 QList<QgsChunkNode *> activeNodes()
const {
return mActiveNodes; }
91 QgsChunkNode *rootNode()
const {
return mRootNode; }
106 void cancelActiveJob( QgsChunkQueueJob *job );
107 void cancelActiveJobs();
109 void setNeedsUpdate(
bool needsUpdate ) { mNeedsUpdate = needsUpdate; }
112 void update( QgsChunkNode *node,
const SceneContext &sceneContext );
115 void pruneLoaderQueue(
const SceneContext &sceneContext );
118 void requestResidency( QgsChunkNode *node );
121 QgsChunkQueueJob *startJob( QgsChunkNode *node );
126 void onActiveJobFinished();
130 QgsChunkNode *mRootNode =
nullptr;
132 bool mNeedsUpdate =
false;
143 QgsChunkLoaderFactory *mChunkLoaderFactory =
nullptr;
145 bool mOwnsFactory =
true;
147 QgsChunkList *mChunkLoaderQueue =
nullptr;
149 QgsChunkList *mReplacementQueue =
nullptr;
151 QList<QgsChunkNode *> mActiveNodes;
153 int mFrustumCulled = 0;
160 QgsChunkBoundsEntity *mBboxesEntity =
nullptr;
163 QList<QgsChunkQueueJob *> mActiveJobs;
165 bool mIsValid =
true;
167 int mPrimitivesBudget = std::numeric_limits<int>::max();
A template based class for storing ranges (lower to upper values).
Helper struct to store ray casting parameters.