cesium-native 0.43.0
Loading...
Searching...
No Matches
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 <Cesium3DTilesSelection/SampleHeightResult.h>
10#include <CesiumAsync/AsyncSystem.h>
11#include <CesiumAsync/Future.h>
12#include <CesiumAsync/IAssetAccessor.h>
13#include <CesiumGeometry/Axis.h>
14#include <CesiumGeospatial/Ellipsoid.h>
15#include <CesiumGltf/Model.h>
16#include <CesiumRasterOverlays/RasterOverlayDetails.h>
17
18#include <spdlog/logger.h>
19
20#include <functional>
21#include <memory>
22#include <optional>
23#include <vector>
24
25namespace Cesium3DTilesSelection {
26class Tile;
27class ITilesetHeightSampler;
28
32struct CESIUM3DTILESSELECTION_API TileLoadInput {
46 const Tile& tile,
47 const TilesetContentOptions& contentOptions,
48 const CesiumAsync::AsyncSystem& asyncSystem,
49 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
50 const std::shared_ptr<spdlog::logger>& pLogger,
51 const std::vector<CesiumAsync::IAssetAccessor::THeader>& requestHeaders,
52 const CesiumGeospatial::Ellipsoid& ellipsoid CESIUM_DEFAULT_ELLIPSOID);
53
57 const Tile& tile;
58
63
68
73 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor;
74
78 const std::shared_ptr<spdlog::logger>& pLogger;
79
83 const std::vector<CesiumAsync::IAssetAccessor::THeader>& requestHeaders;
84
89};
90
95struct CESIUM3DTILESSELECTION_API TileChildrenResult {
99 std::vector<Tile> children;
100
112};
113
117class CESIUM3DTILESSELECTION_API TilesetContentLoader {
118public:
122 virtual ~TilesetContentLoader() = default;
123
132
149 const Tile& tile,
150 const CesiumGeospatial::Ellipsoid& ellipsoid
151 CESIUM_DEFAULT_ELLIPSOID) = 0;
152
170 virtual ITilesetHeightSampler* getHeightSampler() { return nullptr; }
171};
172} // namespace Cesium3DTilesSelection
An interface to query heights from a tileset that can do so efficiently without necessarily downloadi...
A tile in a Tileset.
Definition Tile.h:97
The loader interface to load the tile content.
virtual TileChildrenResult createTileChildren(const Tile &tile, const CesiumGeospatial::Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84)=0
Create the tile's children.
virtual ~TilesetContentLoader()=default
Default virtual destructor.
virtual CesiumAsync::Future< TileLoadResult > loadTileContent(const TileLoadInput &input)=0
Load the tile content.
virtual ITilesetHeightSampler * getHeightSampler()
Gets an interface that can be used to efficiently query heights from this tileset.
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 Promise.h:11
A quadratic surface defined in Cartesian coordinates.
Definition Ellipsoid.h:38
Classes that implement the 3D Tiles standard.
TileLoadResultState
Indicate the status of Cesium3DTilesSelection::TilesetContentLoader::loadTileContent and Cesium3DTile...
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.
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.
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=CesiumGeospatial::Ellipsoid::WGS84)
Creates a new instance.
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.