43struct QgsChunkListEntry;
45class QgsChunkQueueJob;
46class QgsChunkQueueJobFactory;
67 QgsChunkNodeId(
int _d = -1,
int _x = -1,
int _y = -1,
int _z = -1 )
68 : d( _d ), x( _x ), y( _y ), z( _z ) {}
75 QgsChunkNodeId(
long long id )
83 long long uniqueId = -1;
89 return QString::number( uniqueId );
91 return QStringLiteral(
"%1/%2/%3" ).arg( d ).arg( x ).arg( y );
93 return QStringLiteral(
"%1/%2/%3/%4" ).arg( d ).arg( x ).arg( y ).arg( z );
96 bool operator==(
const QgsChunkNodeId &other )
const
98 return ( uniqueId == -1 && other.uniqueId == -1 && d == other.d && x == other.x && y == other.y && z == other.z )
99 || ( uniqueId != -1 && uniqueId == other.uniqueId );
102 bool operator!=(
const QgsChunkNodeId &other )
const
104 return !( *
this == other );
129 QgsChunkNode(
const QgsChunkNodeId &nodeId,
const QgsBox3D &box3D,
float error, QgsChunkNode *parent =
nullptr );
162 QgsBox3D box3D()
const {
return mBox3D; }
164 float error()
const {
return mError; }
166 QgsChunkNodeId tileId()
const {
return mNodeId; }
168 QgsChunkNode *parent()
const {
return mParent; }
170 int childCount()
const {
return mChildren.count(); }
172 QgsChunkNode *
const *children()
const {
return mChildren.constData(); }
176 State state()
const {
return mState; }
179 QgsChunkListEntry *loaderQueueEntry()
const {
return mLoaderQueueEntry; }
181 QgsChunkListEntry *replacementQueueEntry()
const {
return mReplacementQueueEntry; }
183 QgsChunkLoader *loader()
const {
return mLoader; }
185 Qt3DCore::QEntity *entity()
const {
return mEntity; }
187 QgsChunkQueueJob *updater()
const {
return mUpdater; }
190 bool allChildChunksResident( QTime currentTime )
const;
193 bool hasChildrenPopulated()
const {
return mChildrenPopulated; }
196 void populateChildren(
const QVector<QgsChunkNode *> &children );
205 QList<QgsChunkNode *> descendants();
212 void setQueuedForLoad( QgsChunkListEntry *entry );
215 void cancelQueuedForLoad();
218 void setLoading( QgsChunkLoader *chunkLoader );
221 void cancelLoading();
224 void setLoaded( Qt3DCore::QEntity *mEntity );
230 void setQueuedForUpdate( QgsChunkListEntry *entry, QgsChunkQueueJobFactory *updateJobFactory );
233 void cancelQueuedForUpdate();
239 void cancelUpdating();
245 void setExactBox3D(
const QgsBox3D &box3D );
254 void updateParentBoundingBoxesRecursively()
const;
257 void setHasData(
bool hasData ) { mHasData = hasData; }
259 bool hasData()
const {
return mHasData; }
265 QgsChunkNodeId mNodeId;
267 QgsChunkNode *mParent;
268 QVector<QgsChunkNode *> mChildren;
269 bool mChildrenPopulated =
false;
275 QgsChunkListEntry *mLoaderQueueEntry;
276 QgsChunkListEntry *mReplacementQueueEntry;
278 QgsChunkLoader *mLoader;
279 Qt3DCore::QEntity *mEntity;
281 QgsChunkQueueJobFactory *mUpdaterFactory;
282 QgsChunkQueueJob *mUpdater;
284 QTime mEntityCreatedTime;
285 bool mHasData =
true;
TileRefinementProcess
Tiled scene tile refinement processes.
@ Replacement
When tile is refined then its children should be used in place of itself.
A 3-dimensional box composed of x, y, z coordinates.
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)