cesium-native 0.53.0
Loading...
Searching...
No Matches
TileContent.h
1#pragma once
2
3#include <Cesium3DTilesSelection/GltfModifierState.h>
4#include <Cesium3DTilesSelection/Library.h>
5#include <Cesium3DTilesSelection/TilesetMetadata.h>
6#include <CesiumGeospatial/Projection.h>
7#include <CesiumGltf/Model.h>
8#include <CesiumRasterOverlays/RasterOverlayDetails.h>
9#include <CesiumUtility/CreditSystem.h>
10#include <CesiumUtility/ExtensibleObject.h>
11
12#include <memory>
13#include <variant>
14#include <vector>
15
16namespace Cesium3DTilesSelection {
23struct CESIUM3DTILESSELECTION_API TileUnknownContent {};
24
46struct CESIUM3DTILESSELECTION_API TileEmptyContent {};
47
53struct CESIUM3DTILESSELECTION_API TileExternalContent
59};
60
65class CESIUM3DTILESSELECTION_API TileRenderContent {
66public:
73
79 const CesiumGltf::Model& getModel() const noexcept;
80
86 CesiumGltf::Model& getModel() noexcept;
87
93 void setModel(const CesiumGltf::Model& model);
94
100 void setModel(CesiumGltf::Model&& model);
101
107 const CesiumRasterOverlays::RasterOverlayDetails&
108 getRasterOverlayDetails() const noexcept;
109
115 CesiumRasterOverlays::RasterOverlayDetails&
117
124 const CesiumRasterOverlays::RasterOverlayDetails& rasterOverlayDetails);
125
132 CesiumRasterOverlays::RasterOverlayDetails&& rasterOverlayDetails);
133
139 const std::vector<CesiumUtility::Credit>& getCredits() const noexcept;
140
146 std::vector<CesiumUtility::Credit>& getCredits() noexcept;
147
154 void setCredits(std::vector<CesiumUtility::Credit>&& credits);
155
162 void setCredits(const std::vector<CesiumUtility::Credit>& credits);
163
170 void* getRenderResources() const noexcept;
171
179 void setRenderResources(void* pRenderResources) noexcept;
180
191 float getLodTransitionFadePercentage() const noexcept;
192
199 void setLodTransitionFadePercentage(float percentage) noexcept;
200
206
211 void setGltfModifierState(GltfModifierState modifierState) noexcept;
212
217 const std::optional<CesiumGltf::Model>& getModifiedModel() const noexcept;
218
224 void* getModifiedRenderResources() const noexcept;
225
233 CesiumGltf::Model&& modifiedModel,
234 void* pModifiedRenderResources) noexcept;
235
242
253
254private:
255 CesiumGltf::Model _model;
256 void* _pRenderResources;
257
258 GltfModifierState _modifierState;
259 std::optional<CesiumGltf::Model> _modifiedModel;
260 void* _pModifiedRenderResources;
261
262 CesiumRasterOverlays::RasterOverlayDetails _rasterOverlayDetails;
263 std::vector<CesiumUtility::Credit> _credits;
264 float _lodTransitionFadePercentage;
265};
266
271class CESIUM3DTILESSELECTION_API TileContent {
272 using TileContentKindImpl = std::variant<
275 std::unique_ptr<TileExternalContent>,
276 std::unique_ptr<TileRenderContent>>;
277
278public:
285
290
295 TileContent(std::unique_ptr<TileExternalContent>&& content);
296
303
308
313 void setContentKind(std::unique_ptr<TileExternalContent>&& content);
314
318 void setContentKind(std::unique_ptr<TileRenderContent>&& content);
319
323 bool isUnknownContent() const noexcept;
324
328 bool isEmptyContent() const noexcept;
329
334 bool isExternalContent() const noexcept;
335
339 bool isRenderContent() const noexcept;
340
345 const TileRenderContent* getRenderContent() const noexcept;
346
352
358
364
365private:
366 TileContentKindImpl _contentKind;
367};
368} // namespace Cesium3DTilesSelection
TileContent(std::unique_ptr< TileExternalContent > &&content)
Construct an external content for a tile whose content points to an external tileset.
TileContent(TileEmptyContent content)
Construct an empty content for a tile.
TileContent()
Construct an unknown content for a tile. This constructor is useful when the tile content is known af...
const TileExternalContent * getExternalContent() const noexcept
Get the TileExternalContent which stores the details of the external tileset.
void setContentKind(TileEmptyContent content)
Construct an empty content tag for a tile.
const TileRenderContent * getRenderContent() const noexcept
Get the TileRenderContent which stores the glTF model and render resources of the tile.
bool isExternalContent() const noexcept
Query if a tile has an external content which points to an external tileset.
void setContentKind(std::unique_ptr< TileRenderContent > &&content)
Set a glTF model content for a tile.
bool isEmptyContent() const noexcept
Query if a tile has an empty content.
bool isRenderContent() const noexcept
Query if a tile has an glTF model content.
void setContentKind(std::unique_ptr< TileExternalContent > &&content)
Set an external content for a tile whose content points to an external tileset.
bool isUnknownContent() const noexcept
Query if a tile has an unknown content.
void setContentKind(TileUnknownContent content)
Set an unknown content tag for a tile. This constructor is useful when the tile content is known afte...
A content tag that indicates a tile has a glTF model content and render resources for the model.
Definition TileContent.h:65
void replaceWithModifiedModel() noexcept
Overwrites this instance's model and renderer resources with the modified ones produced by GltfModifi...
void setModel(const CesiumGltf::Model &model)
Set the glTF model for this content.
void setCredits(std::vector< CesiumUtility::Credit > &&credits)
Set the list of Credit for the content.
void * getRenderResources() const noexcept
Get the renderer resources created for the glTF model of the content.
GltfModifierState getGltfModifierState() const noexcept
Gets the state of the GltfModifier processing of this tile's content.
void setLodTransitionFadePercentage(float percentage) noexcept
Set the fade percentage of this tile during an LOD transition with. Not to be used by clients.
TileRenderContent(CesiumGltf::Model &&model)
Construct the content with a glTF model.
const std::vector< CesiumUtility::Credit > & getCredits() const noexcept
Get the list of Credit of the content.
void * getModifiedRenderResources() const noexcept
Gets the renderer resources for the modified model produced by the GltfModifier that is not yet avail...
void setRenderResources(void *pRenderResources) noexcept
Set the renderer resources created for the glTF model of the content.
float getLodTransitionFadePercentage() const noexcept
Get the fade percentage that this tile during an LOD transition.
void setModifiedModelAndRenderResources(CesiumGltf::Model &&modifiedModel, void *pModifiedRenderResources) noexcept
Stores the modified model and associated renderer resources produced by the GltfModifier that are not...
void resetModifiedModelAndRenderResources() noexcept
Resets the modified model and renderer resources after they have been determined to be outdated and h...
void setGltfModifierState(GltfModifierState modifierState) noexcept
Sets the state of the GltfModifier processing of this tile's content.
const std::optional< CesiumGltf::Model > & getModifiedModel() const noexcept
Gets the modified model produced by the GltfModifier that is not yet available for rendering.
void setRasterOverlayDetails(const CesiumRasterOverlays::RasterOverlayDetails &rasterOverlayDetails)
Set the CesiumRasterOverlays::RasterOverlayDetails which is the result of generating raster overlay U...
const CesiumRasterOverlays::RasterOverlayDetails & getRasterOverlayDetails() const noexcept
Get the CesiumRasterOverlays::RasterOverlayDetails which is the result of generating raster overlay U...
const CesiumGltf::Model & getModel() const noexcept
Retrieve a glTF model that is owned by this content.
Holds the metadata associated with a Tileset or an external tileset. This holds all of the fields of ...
Classes that implement the 3D Tiles standard.
Classes for working with glTF models.
Classes for raster overlays, which allow draping massive 2D textures over a model.
Utility classes for Cesium.
STL namespace.
A content tag that indicates a tile has no content.
Definition TileContent.h:46
A content tag that indicates a tile content points to an external tileset. When this tile is loaded,...
Definition TileContent.h:54
TilesetMetadata metadata
The metadata associated with this tileset.
Definition TileContent.h:58
A content tag that indicates the TilesetContentLoader does not know if a tile's content will point to...
Definition TileContent.h:23
This class is not meant to be instantiated directly. Use Model instead.
Definition Model.h:14
The base class for objects that have extensions and extras.