38using namespace Qt::StringLiterals;
46struct QgsChunkListEntry;
47struct QgsChunkQueueJob;
68 QgsChunkNodeId(
int _d = -1,
int _x = -1,
int _y = -1,
int _z = -1 )
80 QgsChunkNodeId(
long long id )
88 long long uniqueId = -1;
94 return QString::number( uniqueId );
96 return u
"%1/%2/%3"_s.arg( d ).arg( x ).arg( y );
98 return u
"%1/%2/%3/%4"_s.arg( d ).arg( x ).arg( y ).arg( z );
101 bool operator==(
const QgsChunkNodeId &other )
const
103 return ( uniqueId == -1 && other.uniqueId == -1 && d == other.d && x == other.x && y == other.y && z == other.z ) || ( uniqueId != -1 && uniqueId == other.uniqueId );
106 bool operator!=(
const QgsChunkNodeId &other )
const {
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 QgsChunkQueueJob *loaderJob()
const {
return mLoaderJob; }
185 Qt3DCore::QEntity *entity()
const {
return mEntity; }
187 QgsChunkQueueJob *updateJob()
const {
return mUpdateJob; }
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( QgsChunkQueueJob &job );
221 void cancelLoading();
224 void setLoaded( Qt3DCore::QEntity *mEntity );
230 void setQueuedForUpdate( QgsChunkListEntry *entry );
233 void cancelQueuedForUpdate();
236 void setUpdating( QgsChunkQueueJob &job );
239 void cancelUpdating();
245 void replaceEntity( Qt3DCore::QEntity *newEntity );
248 bool creatingChildren()
const;
251 void setCreatingChildren(
bool creatingChildren );
254 void setExactBox3D(
const QgsBox3D &box3D );
263 void updateParentBoundingBoxesRecursively()
const;
266 void setHasData(
bool hasData ) { mHasData = hasData; }
268 bool hasData()
const {
return mHasData; }
274 QgsChunkNodeId mNodeId;
276 QgsChunkNode *mParent;
277 QVector<QgsChunkNode *> mChildren;
278 bool mChildrenPopulated =
false;
280 State mState = Skeleton;
284 QgsChunkListEntry *mLoaderQueueEntry =
nullptr;
285 QgsChunkListEntry *mReplacementQueueEntry =
nullptr;
287 QgsChunkQueueJob *mLoaderJob =
nullptr;
288 Qt3DCore::QEntity *mEntity =
nullptr;
290 QgsChunkQueueJob *mUpdateJob =
nullptr;
292 QTime mEntityCreatedTime;
293 bool mHasData =
true;
295 bool mCreatingChildren =
false;
TileRefinementProcess
Tiled scene tile refinement processes.
@ Replacement
When tile is refined then its children should be used in place of itself.
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)