16#ifndef QGSCHUNKNODE_P_H
17#define QGSCHUNKNODE_P_H
42struct QgsChunkListEntry;
44class QgsChunkQueueJob;
45class QgsChunkQueueJobFactory;
66 QgsChunkNodeId(
int _d = -1,
int _x = -1,
int _y = -1,
int _z = -1 )
67 : d( _d ), x( _x ), y( _y ), z( _z ) {}
74 QgsChunkNodeId(
long long id )
82 long long uniqueId = -1;
88 return QString::number( uniqueId );
90 return QStringLiteral(
"%1/%2/%3" ).arg( d ).arg( x ).arg( y );
92 return QStringLiteral(
"%1/%2/%3/%4" ).arg( d ).arg( x ).arg( y ).arg( z );
95 bool operator==(
const QgsChunkNodeId &other )
const
97 return ( uniqueId == -1 && other.uniqueId == -1 && d == other.d && x == other.x && y == other.y && z == other.z )
98 || ( uniqueId != -1 && uniqueId == other.uniqueId );
101 bool operator!=(
const QgsChunkNodeId &other )
const
103 return !( *
this == other );
126 QgsChunkNode(
const QgsChunkNodeId &nodeId,
const QgsAABB &bbox,
float error, QgsChunkNode *parent =
nullptr );
159 QgsAABB bbox()
const {
return mBbox; }
161 float error()
const {
return mError; }
163 QgsChunkNodeId tileId()
const {
return mNodeId; }
165 QgsChunkNode *parent()
const {
return mParent; }
167 int childCount()
const {
return mChildren.count(); }
169 QgsChunkNode *
const *children()
const {
return mChildren.constData(); }
173 State state()
const {
return mState; }
176 QgsChunkListEntry *loaderQueueEntry()
const {
return mLoaderQueueEntry; }
178 QgsChunkListEntry *replacementQueueEntry()
const {
return mReplacementQueueEntry; }
180 QgsChunkLoader *loader()
const {
return mLoader; }
182 Qt3DCore::QEntity *entity()
const {
return mEntity; }
184 QgsChunkQueueJob *updater()
const {
return mUpdater; }
187 bool allChildChunksResident( QTime currentTime )
const;
190 bool hasChildrenPopulated()
const {
return mChildrenPopulated; }
193 void populateChildren(
const QVector<QgsChunkNode *> &children );
202 QList<QgsChunkNode *> descendants();
209 void setQueuedForLoad( QgsChunkListEntry *entry );
212 void cancelQueuedForLoad();
215 void setLoading( QgsChunkLoader *chunkLoader );
218 void cancelLoading();
221 void setLoaded( Qt3DCore::QEntity *mEntity );
227 void setQueuedForUpdate( QgsChunkListEntry *entry, QgsChunkQueueJobFactory *updateJobFactory );
230 void cancelQueuedForUpdate();
236 void cancelUpdating();
242 void setExactBbox(
const QgsAABB &box );
251 void updateParentBoundingBoxesRecursively()
const;
254 void setHasData(
bool hasData ) { mHasData = hasData; }
256 bool hasData()
const {
return mHasData; }
262 QgsChunkNodeId mNodeId;
264 QgsChunkNode *mParent;
265 QVector<QgsChunkNode *> mChildren;
266 bool mChildrenPopulated =
false;
272 QgsChunkListEntry *mLoaderQueueEntry;
273 QgsChunkListEntry *mReplacementQueueEntry;
275 QgsChunkLoader *mLoader;
276 Qt3DCore::QEntity *mEntity;
278 QgsChunkQueueJobFactory *mUpdaterFactory;
279 QgsChunkQueueJob *mUpdater;
281 QTime mEntityCreatedTime;
282 bool mHasData =
true;
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)