cesium-native 0.55.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
176 void
177 startNewFrame(const Tileset& tileset, const TilesetFrameState& frameState);
178
190 void finishFrame(const Tileset& tileset, const TilesetFrameState& frameState);
191
205
207 double getWeight() const override;
208
217 void setWeight(double weight) noexcept;
218
220 bool hasMoreTilesToLoadInWorkerThread() const override;
223
225 bool hasMoreTilesToLoadInMainThread() const override;
228
245 bool isCreditReferenced(CesiumUtility::Credit credit) const noexcept;
246
247private:
248 double _weight = 1.0;
249 std::vector<TileLoadTask> _mainThreadLoadQueue;
250 std::vector<TileLoadTask> _workerThreadLoadQueue;
251 size_t _tilesAlreadyLoadingOrUnloading = 0;
252 float _loadProgressPercentage = 0.0f;
253 ViewUpdateResult _updateResult;
254 TraversalState _traversalState;
255 CesiumUtility::CreditReferencer _previousFrameCredits;
256 CesiumUtility::CreditReferencer _currentFrameCredits;
257};
258
259} // 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
bool isCreditReferenced(CesiumUtility::Credit credit) const noexcept
Checks if a given credit is referenced in the most recently completed frame.
void finishFrame(const Tileset &tileset, const TilesetFrameState &frameState)
Finishes the current frame.
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.
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.
Represents an HTML string that should be shown on screen to attribute third parties for used data,...