16#ifndef QGSCHUNKEDENTITY_H
17#define QGSCHUNKEDENTITY_H
41class QgsChunkQueueJob;
42class QgsChunkLoaderFactory;
43class QgsChunkBoundsEntity;
44class QgsChunkQueueJobFactory;
54class QgsChunkedEntity :
public Qgs3DMapSceneEntity
59 QgsChunkedEntity( Qgs3DMapSettings *mapSettings,
float tau, QgsChunkLoaderFactory *loaderFactory,
bool ownsFactory,
int primitivesBudget = std::numeric_limits<int>::max(), Qt3DCore::QNode *parent =
nullptr );
60 ~QgsChunkedEntity()
override;
63 void handleSceneUpdate(
const SceneContext &sceneContext )
override;
66 int pendingJobsCount()
const override;
69 bool needsUpdate()
const override {
return mNeedsUpdate; }
71 QgsRange<float> getNearFarPlaneRange(
const QMatrix4x4 &viewMatrix )
const override;
74 void setShowBoundingBoxes(
bool enabled );
77 void updateNodes(
const QList<QgsChunkNode *> &nodes, QgsChunkQueueJobFactory *updateJobFactory );
80 QList<QgsChunkNode *> activeNodes()
const {
return mActiveNodes; }
82 QgsChunkNode *rootNode()
const {
return mRootNode; }
93 virtual QList<QgsRayCastHit> rayIntersection(
const QgsRay3D &ray,
const QgsRayCastContext &context )
const;
97 void cancelActiveJob( QgsChunkQueueJob *job );
98 void cancelActiveJobs();
100 void setNeedsUpdate(
bool needsUpdate ) { mNeedsUpdate = needsUpdate; }
103 void update( QgsChunkNode *node,
const SceneContext &sceneContext );
106 void pruneLoaderQueue(
const SceneContext &sceneContext );
109 void requestResidency( QgsChunkNode *node );
112 QgsChunkQueueJob *startJob( QgsChunkNode *node );
117 void onActiveJobFinished();
121 QgsChunkNode *mRootNode =
nullptr;
123 bool mNeedsUpdate =
false;
134 QgsChunkLoaderFactory *mChunkLoaderFactory =
nullptr;
136 bool mOwnsFactory =
true;
138 QgsChunkList *mChunkLoaderQueue =
nullptr;
140 QgsChunkList *mReplacementQueue =
nullptr;
142 QList<QgsChunkNode *> mActiveNodes;
144 int mFrustumCulled = 0;
151 QgsChunkBoundsEntity *mBboxesEntity =
nullptr;
154 QList<QgsChunkQueueJob *> mActiveJobs;
156 bool mIsValid =
true;
158 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.