3#include <Cesium3DTilesSelection/GltfModifierState.h>
4#include <Cesium3DTilesSelection/Tile.h>
5#include <Cesium3DTilesSelection/TileLoadRequester.h>
6#include <CesiumAsync/AsyncSystem.h>
7#include <CesiumAsync/Future.h>
8#include <CesiumGltf/Model.h>
10#include <spdlog/fwd.h>
24class TilesetContentManager;
173 virtual ~GltfModifier();
199 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
200 const std::shared_ptr<spdlog::logger>& pLogger,
202 const Tile& rootTile);
213 TilesetContentManager& contentManager,
215 const Tile& rootTile);
223 void onUnregister(TilesetContentManager& contentManager);
238 void onOldVersionContentLoadingComplete(
const Tile& tile);
251 void onWorkerThreadApplyComplete(
const Tile& tile);
254 double getWeight()
const override;
255 bool hasMoreTilesToLoadInWorkerThread()
const override;
256 const Tile* getNextTileToLoadInWorkerThread()
override;
257 bool hasMoreTilesToLoadInMainThread()
const override;
258 const Tile* getNextTileToLoadInMainThread()
override;
260 std::optional<int64_t> _currentVersion;
262 const Tile* _pRootTile;
266 std::vector<Tile::ConstPointer> _workerThreadQueue;
267 std::vector<Tile::ConstPointer> _mainThreadQueue;
269 friend class TilesetContentManager;
270 friend class MockTilesetContentManagerForGltfModifier;
bool needsMainThreadModification(const Tile &tile) const
Checks if the given tile needs to be processed by this GltfModifier in the main thread.
bool needsWorkerThreadModification(const Tile &tile) const
Checks if the given tile needs to be processed by this GltfModifier in a worker thread.
virtual CesiumAsync::Future< std::optional< GltfModifierOutput > > apply(GltfModifierInput &&input)=0
Implement this method to apply custom modification to a glTF model. It is called by the Tileset from ...
std::optional< int64_t > getCurrentVersion() const
Gets the current version number, or std::nullopt if the GltfModifier is currently inactive.
void trigger()
Call this the first time to activate this GltfModifier after it has been constructed in its default n...
bool isActive() const
Checks if this GltfModifier is active.
virtual CesiumAsync::Future< void > onRegister(const CesiumAsync::AsyncSystem &asyncSystem, const std::shared_ptr< CesiumAsync::IAssetAccessor > &pAssetAccessor, const std::shared_ptr< spdlog::logger > &pLogger, const TilesetMetadata &tilesetMetadata, const Tile &rootTile)
Notifies this instance that it has been registered with a Tileset.
TileLoadRequester() noexcept
Constructs a new instance.
A system for managing asynchronous requests and tasks.
A value that will be available in the future, as produced by AsyncSystem.
Provides asynchronous access to assets, usually files downloaded via HTTP.
Classes that implement the 3D Tiles standard.
Classes that support asynchronous operations.
The output of GltfModifier::apply.
CesiumGltf::Model modifiedModel
The new, modified model.
This class is not meant to be instantiated directly. Use Model instead.