cesium-native  0.41.0
TilesetContentLoader.h
1 #pragma once
2 
3 #include "BoundingVolume.h"
4 #include "Library.h"
5 #include "TileContent.h"
6 #include "TileLoadResult.h"
7 #include "TilesetOptions.h"
8 
9 #include <CesiumAsync/AsyncSystem.h>
10 #include <CesiumAsync/Future.h>
11 #include <CesiumAsync/IAssetAccessor.h>
12 #include <CesiumGeometry/Axis.h>
13 #include <CesiumGeospatial/Ellipsoid.h>
14 #include <CesiumGltf/Model.h>
15 #include <CesiumRasterOverlays/RasterOverlayDetails.h>
16 
17 #include <spdlog/logger.h>
18 
19 #include <functional>
20 #include <memory>
21 #include <optional>
22 #include <vector>
23 
24 namespace Cesium3DTilesSelection {
25 class Tile;
26 
30 struct CESIUM3DTILESSELECTION_API TileLoadInput {
43  const Tile& tile,
44  const TilesetContentOptions& contentOptions,
45  const CesiumAsync::AsyncSystem& asyncSystem,
46  const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
47  const std::shared_ptr<spdlog::logger>& pLogger,
48  const std::vector<CesiumAsync::IAssetAccessor::THeader>& requestHeaders,
49  const CesiumGeospatial::Ellipsoid& ellipsoid CESIUM_DEFAULT_ELLIPSOID);
50 
54  const Tile& tile;
55 
60 
65 
70  const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor;
71 
75  const std::shared_ptr<spdlog::logger>& pLogger;
76 
80  const std::vector<CesiumAsync::IAssetAccessor::THeader>& requestHeaders;
81 
86 };
87 
92 struct CESIUM3DTILESSELECTION_API TileChildrenResult {
96  std::vector<Tile> children;
97 
109 };
110 
114 class CESIUM3DTILESSELECTION_API TilesetContentLoader {
115 public:
119  virtual ~TilesetContentLoader() = default;
120 
128  loadTileContent(const TileLoadInput& input) = 0;
129 
145  const Tile& tile,
146  const CesiumGeospatial::Ellipsoid& ellipsoid
147  CESIUM_DEFAULT_ELLIPSOID) = 0;
148 };
149 } // namespace Cesium3DTilesSelection
A tile in a Tileset.
Definition: Tile.h:97
The loader interface to load the tile content.
virtual ~TilesetContentLoader()=default
Default virtual destructor.
virtual CesiumAsync::Future< TileLoadResult > loadTileContent(const TileLoadInput &input)=0
Load the tile content.
virtual TileChildrenResult createTileChildren(const Tile &tile, const CesiumGeospatial::Ellipsoid &ellipsoid CESIUM_DEFAULT_ELLIPSOID)=0
Create the tile's children.
A system for managing asynchronous requests and tasks.
Definition: AsyncSystem.h:36
A value that will be available in the future, as produced by AsyncSystem.
Definition: Future.h:29
A quadratic surface defined in Cartesian coordinates.
Definition: Ellipsoid.h:38
Classes that implement the 3D Tiles standard.
TileLoadResultState
Indicate the status of TilesetContentLoader::loadTileContent and TilesetContentLoader::createTileChil...
Store the result of creating tile's children after invoking TilesetContentLoader::createTileChildren.
std::vector< Tile > children
The children of this tile.
TileLoadResultState state
The result of creating children for this tile. Note that: when receiving RetryLater status,...
Store the parameters that are needed to load a tile.
TileLoadInput(const Tile &tile, const TilesetContentOptions &contentOptions, const CesiumAsync::AsyncSystem &asyncSystem, const std::shared_ptr< CesiumAsync::IAssetAccessor > &pAssetAccessor, const std::shared_ptr< spdlog::logger > &pLogger, const std::vector< CesiumAsync::IAssetAccessor::THeader > &requestHeaders, const CesiumGeospatial::Ellipsoid &ellipsoid CESIUM_DEFAULT_ELLIPSOID)
Creates a new instance.
const Tile & tile
The tile that the TilesetContentLoader will request the server for the content.
const std::shared_ptr< spdlog::logger > & pLogger
The logger that receives details of loading errors and warnings.
const std::vector< CesiumAsync::IAssetAccessor::THeader > & requestHeaders
The request headers that will be attached to the request.
const CesiumAsync::AsyncSystem & asyncSystem
The async system to run the loading in worker thread or main thread.
const CesiumGeospatial::Ellipsoid & ellipsoid
The ellipsoid that this tileset uses.
const TilesetContentOptions & contentOptions
The content options the TilesetContentLoader will use to process the content of the tile.
const std::shared_ptr< CesiumAsync::IAssetAccessor > & pAssetAccessor
The asset accessor to make requests for the tile content over the wire.
Options for configuring the parsing of a Tileset's content and construction of Gltf models.