16#ifndef QGSCHUNKEDENTITY_H
17#define QGSCHUNKEDENTITY_H
39class QgsChunkQueueJob;
40class QgsChunkLoaderFactory;
41class QgsChunkBoundsEntity;
42class QgsChunkQueueJobFactory;
61class QgsChunkedEntity :
public Qgs3DMapSceneEntity
66 QgsChunkedEntity( Qgs3DMapSettings *mapSettings,
float tau, QgsChunkLoaderFactory *loaderFactory,
bool ownsFactory,
int primitivesBudget = std::numeric_limits<int>::max(), Qt3DCore::QNode *parent =
nullptr );
67 ~QgsChunkedEntity()
override;
70 void handleSceneUpdate(
const SceneContext &sceneContext )
override;
73 int pendingJobsCount()
const override;
76 bool needsUpdate()
const override {
return mNeedsUpdate; }
78 QgsRange<float> getNearFarPlaneRange(
const QMatrix4x4 &viewMatrix )
const override;
81 void setShowBoundingBoxes(
bool enabled );
84 void updateNodes(
const QList<QgsChunkNode *> &nodes, QgsChunkQueueJobFactory *updateJobFactory );
87 QList<QgsChunkNode *> activeNodes()
const {
return mActiveNodes; }
89 QgsChunkNode *rootNode()
const {
return mRootNode; }
100 virtual QList<QgsRayCastHit> rayIntersection(
const QgsRay3D &ray,
const QgsRayCastContext &context )
const;
104 void cancelActiveJob( QgsChunkQueueJob *job );
105 void cancelActiveJobs();
107 void setNeedsUpdate(
bool needsUpdate ) { mNeedsUpdate = needsUpdate; }
110 void update( QgsChunkNode *node,
const SceneContext &sceneContext );
113 void pruneLoaderQueue(
const SceneContext &sceneContext );
116 void requestResidency( QgsChunkNode *node );
119 QgsChunkQueueJob *startJob( QgsChunkNode *node );
124 void onActiveJobFinished();
128 QgsChunkNode *mRootNode =
nullptr;
130 bool mNeedsUpdate =
false;
141 QgsChunkLoaderFactory *mChunkLoaderFactory =
nullptr;
143 bool mOwnsFactory =
true;
145 QgsChunkList *mChunkLoaderQueue =
nullptr;
147 QgsChunkList *mReplacementQueue =
nullptr;
149 QList<QgsChunkNode *> mActiveNodes;
151 int mFrustumCulled = 0;
158 QgsChunkBoundsEntity *mBboxesEntity =
nullptr;
161 QList<QgsChunkQueueJob *> mActiveJobs;
163 bool mIsValid =
true;
165 int mPrimitivesBudget = std::numeric_limits<int>::max();
Axis-aligned bounding box - in world coords.
A representation of a ray in 3D.
Responsible for defining parameters of the ray casting operations in 3D map canvases.