43struct QgsChunkListEntry;
45class QgsChunkQueueJob;
46class 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 );
127 QgsChunkNode(
const QgsChunkNodeId &nodeId,
const QgsBox3D &box3D,
float error, QgsChunkNode *parent =
nullptr );
160 QgsBox3D box3D()
const {
return mBox3D; }
162 float error()
const {
return mError; }
164 QgsChunkNodeId tileId()
const {
return mNodeId; }
166 QgsChunkNode *parent()
const {
return mParent; }
168 int childCount()
const {
return mChildren.count(); }
170 QgsChunkNode *
const *children()
const {
return mChildren.constData(); }
174 State state()
const {
return mState; }
177 QgsChunkListEntry *loaderQueueEntry()
const {
return mLoaderQueueEntry; }
179 QgsChunkListEntry *replacementQueueEntry()
const {
return mReplacementQueueEntry; }
181 QgsChunkLoader *loader()
const {
return mLoader; }
183 Qt3DCore::QEntity *entity()
const {
return mEntity; }
185 QgsChunkQueueJob *updater()
const {
return mUpdater; }
188 bool allChildChunksResident( QTime currentTime )
const;
191 bool hasChildrenPopulated()
const {
return mChildrenPopulated; }
194 void populateChildren(
const QVector<QgsChunkNode *> &children );
203 QList<QgsChunkNode *> descendants();
210 void setQueuedForLoad( QgsChunkListEntry *entry );
213 void cancelQueuedForLoad();
216 void setLoading( QgsChunkLoader *chunkLoader );
219 void cancelLoading();
222 void setLoaded( Qt3DCore::QEntity *mEntity );
228 void setQueuedForUpdate( QgsChunkListEntry *entry, QgsChunkQueueJobFactory *updateJobFactory );
231 void cancelQueuedForUpdate();
237 void cancelUpdating();
243 void setExactBox3D(
const QgsBox3D &box3D );
252 void updateParentBoundingBoxesRecursively()
const;
255 void setHasData(
bool hasData ) { mHasData = hasData; }
257 bool hasData()
const {
return mHasData; }
263 QgsChunkNodeId mNodeId;
265 QgsChunkNode *mParent;
266 QVector<QgsChunkNode *> mChildren;
267 bool mChildrenPopulated =
false;
273 QgsChunkListEntry *mLoaderQueueEntry;
274 QgsChunkListEntry *mReplacementQueueEntry;
276 QgsChunkLoader *mLoader;
277 Qt3DCore::QEntity *mEntity;
279 QgsChunkQueueJobFactory *mUpdaterFactory;
280 QgsChunkQueueJob *mUpdater;
282 QTime mEntityCreatedTime;
283 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)