cesium-native 0.47.0
Loading...
Searching...
No Matches
TilesetViewGroup.h
1#pragma once
2
3#include <Cesium3DTilesSelection/TileLoadRequester.h>
4#include <Cesium3DTilesSelection/TileLoadTask.h>
5#include <Cesium3DTilesSelection/TileSelectionState.h>
6#include <Cesium3DTilesSelection/ViewUpdateResult.h>
7#include <CesiumUtility/CreditReferencer.h>
8#include <CesiumUtility/IntrusivePointer.h>
9#include <CesiumUtility/TreeTraversalState.h>
10
11#include <cstddef>
12#include <unordered_map>
13#include <vector>
14
15namespace Cesium3DTilesSelection {
16
17class Tile;
18class Tileset;
19class TilesetContentManager;
20class TilesetFrameState;
21
34class CESIUM3DTILESSELECTION_API TilesetViewGroup final
35 : public TileLoadRequester {
36public:
43
47 TilesetViewGroup() noexcept;
48
57 TilesetViewGroup(const TilesetViewGroup& rhs) noexcept;
58
69 virtual ~TilesetViewGroup() noexcept;
70
75 const ViewUpdateResult& getViewUpdateResult() const;
76
78 ViewUpdateResult& getViewUpdateResult();
79
84 TraversalState& getTraversalState() noexcept { return this->_traversalState; }
85
87 const TraversalState& getTraversalState() const noexcept {
88 return this->_traversalState;
89 }
90
100 void addToLoadQueue(const TileLoadTask& task);
101
110 private:
111 size_t mainThread;
112 size_t workerThread;
113 friend class TilesetViewGroup;
114 };
115
129
146
152
158
166 void
167 startNewFrame(const Tileset& tileset, const TilesetFrameState& frameState);
168
182 void finishFrame(const Tileset& tileset, const TilesetFrameState& frameState);
183
197
199 double getWeight() const override;
200
209 void setWeight(double weight) noexcept;
210
212 bool hasMoreTilesToLoadInWorkerThread() const override;
215
217 bool hasMoreTilesToLoadInMainThread() const override;
220
221private:
222 double _weight = 1.0;
223 std::vector<TileLoadTask> _mainThreadLoadQueue;
224 std::vector<TileLoadTask> _workerThreadLoadQueue;
225 size_t _tilesAlreadyLoadingOrUnloading = 0;
226 float _loadProgressPercentage = 0.0f;
227 ViewUpdateResult _updateResult;
228 TraversalState _traversalState;
229 CesiumUtility::CreditReferencer _previousFrameCredits;
230 CesiumUtility::CreditReferencer _currentFrameCredits;
231};
232
233} // namespace Cesium3DTilesSelection
The base class for something that requests loading of specific tiles from a 3D Tiles Tileset.
A tile in a Tileset.
Definition Tile.h:122
Captures information about the current frame during a call to Tileset::updateViewGroup.
Represents a group of views that collectively select tiles from a particular Tileset.
float getPreviousLoadProgressPercentage() const
Gets the previous load progress percentage for this view group as of the last time it was updated.
bool hasMoreTilesToLoadInMainThread() const override
Tile * getNextTileToLoadInWorkerThread() override
void addToLoadQueue(const TileLoadTask &task)
Adds a tile load task to this view group's load queue.
void finishFrame(const Tileset &tileset, const TilesetFrameState &frameState)
Finishes the current frame by making the current tile selection state the previous one and releasing ...
size_t restoreTileLoadQueueCheckpoint(const LoadQueueCheckpoint &checkpoint)
Restores a previously-saved checkpoint of the tile load queue associated with this view group.
void startNewFrame(const Tileset &tileset, const TilesetFrameState &frameState)
Starts a new frame, clearing the set of tiles to be loaded so that a new set can be selected.
TilesetViewGroup() noexcept
Constructs a new instance.
const TraversalState & getTraversalState() const noexcept
Gets an object used to track the selection state of tiles as they are traversed for this view group.
void setWeight(double weight) noexcept
Sets the weight of this view group relative to other tile requesters.
LoadQueueCheckpoint saveTileLoadQueueCheckpoint()
Saves a checkpoint of the tile load queue associated with this view group.
bool hasMoreTilesToLoadInWorkerThread() const override
size_t getMainThreadLoadQueueLength() const
Gets the number of tiles that are currently in the queue waiting to be loaded in the main thread.
size_t getWorkerThreadLoadQueueLength() const
Gets the number of tiles that are currently in the queue waiting to be loaded in the worker thread.
A 3D Tiles tileset, used for streaming massive heterogeneous 3D geospatial datasets.
Definition Tileset.h:42
Reports the results of Tileset::updateViewGroup.
Provides a way to reference a set of credits in a CreditSystem so that the references can easily be r...
Classes that implement the 3D Tiles standard.
Represents the need to load a particular Cesium3DTilesSelection::Tile with a particular priority.
A checkpoint within this view group's load queue.