16#ifndef QGSCHUNKEDENTITY_H
17#define QGSCHUNKEDENTITY_H
41class QgsChunkQueueJob;
42class QgsChunkLoaderFactory;
43class QgsChunkBoundsEntity;
44class QgsChunkQueueJobFactory;
54class QgsChunkedEntity :
public Qgs3DMapSceneEntity
60 Qgs3DMapSettings *mapSettings,
float tau, QgsChunkLoaderFactory *loaderFactory,
bool ownsFactory,
int primitivesBudget = std::numeric_limits<int>::max(), Qt3DCore::QNode *parent =
nullptr
62 ~QgsChunkedEntity()
override;
65 void handleSceneUpdate(
const SceneContext &sceneContext )
override;
68 int pendingJobsCount()
const override;
71 bool needsUpdate()
const override {
return mNeedsUpdate; }
73 QgsRange<float> getNearFarPlaneRange(
const QMatrix4x4 &viewMatrix )
const override;
76 void setShowBoundingBoxes(
bool enabled );
79 void updateNodes(
const QList<QgsChunkNode *> &nodes, QgsChunkQueueJobFactory *updateJobFactory );
82 QList<QgsChunkNode *> activeNodes()
const {
return mActiveNodes; }
84 QgsChunkNode *rootNode()
const {
return mRootNode; }
95 virtual QList<QgsRayCastHit> rayIntersection(
const QgsRay3D &ray,
const QgsRayCastContext &context )
const;
99 void cancelActiveJob( QgsChunkQueueJob *job );
100 void cancelActiveJobs();
102 void setNeedsUpdate(
bool needsUpdate ) { mNeedsUpdate = needsUpdate; }
105 void update( QgsChunkNode *node,
const SceneContext &sceneContext );
108 void pruneLoaderQueue(
const SceneContext &sceneContext );
111 void requestResidency( QgsChunkNode *node );
114 QgsChunkQueueJob *startJob( QgsChunkNode *node );
119 void onActiveJobFinished();
123 QgsChunkNode *mRootNode =
nullptr;
125 bool mNeedsUpdate =
false;
136 QgsChunkLoaderFactory *mChunkLoaderFactory =
nullptr;
138 bool mOwnsFactory =
true;
140 QgsChunkList *mChunkLoaderQueue =
nullptr;
142 QgsChunkList *mReplacementQueue =
nullptr;
144 QList<QgsChunkNode *> mActiveNodes;
146 int mFrustumCulled = 0;
153 QgsChunkBoundsEntity *mBboxesEntity =
nullptr;
156 QList<QgsChunkQueueJob *> mActiveJobs;
158 bool mIsValid =
true;
160 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.