cesium-native  0.41.0
TileLoadResult.h
1 #pragma once
2 
3 #include "BoundingVolume.h"
4 #include "TileContent.h"
5 
6 #include <CesiumAsync/IAssetRequest.h>
7 #include <CesiumGeometry/Axis.h>
8 #include <CesiumGeospatial/Ellipsoid.h>
9 #include <CesiumGltf/Model.h>
10 #include <CesiumRasterOverlays/RasterOverlayDetails.h>
11 
12 #include <functional>
13 #include <memory>
14 #include <optional>
15 #include <variant>
16 
17 namespace Cesium3DTilesSelection {
18 
19 class Tile;
20 
38 using TileContentKind = std::variant<
43 
48 enum class TileLoadResultState {
53  Success,
54 
59  Failed,
60 
67 };
68 
73 struct CESIUM3DTILESSELECTION_API TileLoadResult {
78 
83 
89  std::optional<BoundingVolume> updatedBoundingVolume;
90 
96  std::optional<BoundingVolume> updatedContentBoundingVolume;
97 
102  std::optional<CesiumRasterOverlays::RasterOverlayDetails>
104 
108  std::shared_ptr<CesiumAsync::IAssetRequest> pCompletedRequest;
109 
116  std::function<void(Tile&)> tileInitializer;
117 
124 
132 
139  std::shared_ptr<CesiumAsync::IAssetRequest> pCompletedRequest);
140 
147  std::shared_ptr<CesiumAsync::IAssetRequest> pCompletedRequest);
148 };
149 
150 } // namespace Cesium3DTilesSelection
A tile in a Tileset.
Definition: Tile.h:97
A quadratic surface defined in Cartesian coordinates.
Definition: Ellipsoid.h:38
static const Ellipsoid UNIT_SPHERE
An Ellipsoid with all three radii set to one meter.
Definition: Ellipsoid.h:52
Classes that implement the 3D Tiles standard.
std::variant< TileUnknownContent, TileEmptyContent, TileExternalContent, CesiumGltf::Model > TileContentKind
Store the content of the tile after finishing loading tile using TilesetContentLoader::loadTileConten...
TileLoadResultState
Indicate the status of TilesetContentLoader::loadTileContent and TilesetContentLoader::createTileChil...
@ Success
The operation is successful and all the fields in TileLoadResult or TileChildrenResult are applied to...
@ RetryLater
The operation requires the client to retry later due to some background work happenning and none of t...
@ Failed
The operation is failed and none of the fields in TileLoadResult or TileChildrenResult are applied to...
Axis
An enum describing the x, y, and z axes.
Definition: Axis.h:10
A content tag that indicates a tile has no content.
Definition: TileContent.h:45
A content tag that indicates a tile content points to an external tileset. When this tile is loaded,...
Definition: TileContent.h:52
Store the result of loading a tile content after invoking TilesetContentLoader::loadTileContent.
std::shared_ptr< CesiumAsync::IAssetRequest > pCompletedRequest
The request that is created to download the tile content.
TileLoadResultState state
The result of loading a tile. Note that if the state is Failed or RetryLater, none of the fields abov...
TileContentKind contentKind
The content type of the tile.
std::function< void(Tile &)> tileInitializer
A callback that is invoked in the main thread immediately when the loading is finished....
std::optional< BoundingVolume > updatedContentBoundingVolume
A tile can potentially store a more fit content bounding volume along with its content....
std::optional< CesiumRasterOverlays::RasterOverlayDetails > rasterOverlayDetails
Holds details of the TileRenderContent that are useful for raster overlays.
static TileLoadResult createFailedResult(std::shared_ptr< CesiumAsync::IAssetRequest > pCompletedRequest)
Create a result with Failed state.
std::optional< BoundingVolume > updatedBoundingVolume
A tile can potentially store a more fit bounding volume along with its content. If this field is set,...
static TileLoadResult createRetryLaterResult(std::shared_ptr< CesiumAsync::IAssetRequest > pCompletedRequest)
Create a result with RetryLater state.
CesiumGeometry::Axis glTFUpAxis
The up axis of glTF content.
A content tag that indicates the TilesetContentLoader does not know if a tile's content will point to...
Definition: TileContent.h:22
The root object for a glTF asset.
Definition: Model.h:14