cesium-native 0.53.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 <memory>
13#include <unordered_map>
14#include <vector>
15
16namespace Cesium3DTilesSelection {
17
18class GltfModifier;
19class Tile;
20class Tileset;
21class TilesetContentManager;
23
36class CESIUM3DTILESSELECTION_API TilesetViewGroup final
37 : public TileLoadRequester {
38public:
45
49 TilesetViewGroup() noexcept;
50
59 TilesetViewGroup(const TilesetViewGroup& rhs) noexcept;
60
71 virtual ~TilesetViewGroup() noexcept;
72
78
81
86 TraversalState& getTraversalState() noexcept { return this->_traversalState; }
87
89 const TraversalState& getTraversalState() const noexcept {
90 return this->_traversalState;
91 }
92
106 const TileLoadTask& task,
107 const std::shared_ptr<GltfModifier>& pModifier = nullptr);
108
117 private:
118 size_t mainThread;
119 size_t workerThread;
120 friend class TilesetViewGroup;
121 };
122
136
153
159
165
173 void
174 startNewFrame(const Tileset& tileset, const TilesetFrameState& frameState);
175
189 void finishFrame(const Tileset& tileset, const TilesetFrameState& frameState);
190
204
206 double getWeight() const override;
207
216 void setWeight(double weight) noexcept;
217
219 bool hasMoreTilesToLoadInWorkerThread() const override;
222
224 bool hasMoreTilesToLoadInMainThread() const override;
227
228private:
229 double _weight = 1.0;
230 std::vector<TileLoadTask> _mainThreadLoadQueue;
231 std::vector<TileLoadTask> _workerThreadLoadQueue;
232 size_t _tilesAlreadyLoadingOrUnloading = 0;
233 float _loadProgressPercentage = 0.0f;
234 ViewUpdateResult _updateResult;
235 TraversalState _traversalState;
236 CesiumUtility::CreditReferencer _previousFrameCredits;
237 CesiumUtility::CreditReferencer _currentFrameCredits;
238};
239
240} // namespace Cesium3DTilesSelection
An abstract class that allows modifying a tile's glTF model after it has been loaded.
TileLoadRequester() noexcept
Constructs a new instance.
A tile in a Tileset.
Definition Tile.h:123
Captures information about the current frame during a call to Tileset::updateViewGroup.
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
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.
const Tile * getNextTileToLoadInWorkerThread() override
CesiumUtility::TreeTraversalState< Tile::Pointer, TileSelectionState > TraversalState
The type of the CesiumUtility::TreeTraversalState used to track tile selection states for this view g...
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.
const Tile * getNextTileToLoadInMainThread() override
const ViewUpdateResult & getViewUpdateResult() const
Gets the result from the last time this view group was updated by calling Tileset::updateViewGroup.
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.
void addToLoadQueue(const TileLoadTask &task, const std::shared_ptr< GltfModifier > &pModifier=nullptr)
Adds a tile load task to this view group's load queue.
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.
TraversalState & getTraversalState() noexcept
Gets an object used to track the selection state of tiles as they are traversed for this view group.
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...
Associates state (arbitrary data) with each node during partial, depth-first traversal of a tree....
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.