16#ifndef QGSCHUNKEDENTITY_P_H
17#define QGSCHUNKEDENTITY_P_H
38class QgsChunkQueueJob;
39class QgsChunkLoaderFactory;
40class QgsChunkBoundsEntity;
41class QgsChunkQueueJobFactory;
46 struct RayCastContext;
64class QgsChunkedEntity :
public Qgs3DMapSceneEntity
69 QgsChunkedEntity(
float tau, QgsChunkLoaderFactory *loaderFactory,
bool ownsFactory,
70 int primitivesBudget = std::numeric_limits<int>::max(),
71 Qt3DCore::QNode *parent =
nullptr );
72 ~QgsChunkedEntity()
override;
75 void handleSceneUpdate(
const SceneState &state )
override;
78 int pendingJobsCount()
const override;
81 bool needsUpdate()
const override {
return mNeedsUpdate; }
83 QgsRange<float> getNearFarPlaneRange(
const QMatrix4x4 &viewMatrix )
const override;
86 void setShowBoundingBoxes(
bool enabled );
89 void updateNodes(
const QList<QgsChunkNode *> &nodes, QgsChunkQueueJobFactory *updateJobFactory );
92 QList<QgsChunkNode *> activeNodes()
const {
return mActiveNodes; }
94 QgsChunkNode *rootNode()
const {
return mRootNode; }
105 virtual QVector<QgsRayCastingUtils::RayHit> rayIntersection(
const QgsRayCastingUtils::Ray3D &ray,
const QgsRayCastingUtils::RayCastContext &context )
const;
109 void cancelActiveJob( QgsChunkQueueJob *job );
110 void cancelActiveJobs();
112 void setNeedsUpdate(
bool needsUpdate ) { mNeedsUpdate = needsUpdate; }
115 void update( QgsChunkNode *node,
const SceneState &state );
118 void pruneLoaderQueue(
const SceneState &state );
121 void requestResidency( QgsChunkNode *node );
124 QgsChunkQueueJob *startJob( QgsChunkNode *node );
129 void onActiveJobFinished();
133 QgsChunkNode *mRootNode =
nullptr;
135 bool mNeedsUpdate =
false;
146 QgsChunkLoaderFactory *mChunkLoaderFactory =
nullptr;
148 bool mOwnsFactory =
true;
150 QgsChunkList *mChunkLoaderQueue =
nullptr;
152 QgsChunkList *mReplacementQueue =
nullptr;
154 QList<QgsChunkNode *> mActiveNodes;
156 int mFrustumCulled = 0;
163 QgsChunkBoundsEntity *mBboxesEntity =
nullptr;
166 QList<QgsChunkQueueJob *> mActiveJobs;
168 bool mIsValid =
true;
170 int mPrimitivesBudget = std::numeric_limits<int>::max();
A template based class for storing ranges (lower to upper values).