cesium-native 0.64.0
Loading...
Searching...
No Matches
TilesetContentLoader.h
1#pragma once
2
3#include <Cesium3DTilesSelection/BoundingVolume.h>
4#include <Cesium3DTilesSelection/Library.h>
5#include <Cesium3DTilesSelection/SampleHeightResult.h>
6#include <Cesium3DTilesSelection/TileContent.h>
7#include <Cesium3DTilesSelection/TileLoadResult.h>
8#include <Cesium3DTilesSelection/TilesetOptions.h>
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
24namespace CesiumGltf {
25struct Schema;
26};
27
28namespace Cesium3DTilesSelection {
29class Tile;
31class TilesetContentManager;
33
37struct CESIUM3DTILESSELECTION_API TileLoadInput {
52 const Tile& tile,
55 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
56 const std::shared_ptr<spdlog::logger>& pLogger,
57 const std::vector<CesiumAsync::IAssetAccessor::THeader>& requestHeaders,
58 const CesiumGeospatial::Ellipsoid& ellipsoid CESIUM_DEFAULT_ELLIPSOID);
59 ~TileLoadInput() noexcept;
60
64 TileLoadInput(const TileLoadInput& rhs) noexcept;
65
70
75 const Tile& tile;
76
82
86 const CesiumAsync::AsyncSystem& asyncSystem;
87
92 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor;
93
97 const std::shared_ptr<spdlog::logger>& pLogger;
98
102 const std::vector<CesiumAsync::IAssetAccessor::THeader>& requestHeaders;
103
109
113 const CesiumGeospatial::Ellipsoid& ellipsoid;
114};
115
120struct CESIUM3DTILESSELECTION_API TileChildrenResult {
124 std::vector<Tile> children;
125
137};
138
142class CESIUM3DTILESSELECTION_API TilesetContentLoader {
143public:
147 virtual ~TilesetContentLoader() = default;
148
158
175 const Tile& tile,
176 const CesiumGeospatial::Ellipsoid& ellipsoid
177 CESIUM_DEFAULT_ELLIPSOID) = 0;
178
196 virtual ITilesetHeightSampler* getHeightSampler() { return nullptr; }
197
201 const TilesetContentManager* getOwner() const noexcept;
202
206 TilesetContentManager* getOwner() noexcept;
207
211 void setOwner(TilesetContentManager& owner) noexcept;
212
219 virtual void setExternalSchema(CesiumGltf::Schema* schema);
220
226 virtual CesiumUtility::IntrusivePointer<CesiumGltf::Schema>
228
229protected:
234 virtual void setOwnerOfNestedLoaders(TilesetContentManager& owner) noexcept;
235
236private:
237 TilesetContentManager* _pOwner = nullptr;
238};
239} // 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:123
The loader interface to load the tile content.
virtual void setOwnerOfNestedLoaders(TilesetContentManager &owner) noexcept
Called by setOwner to allow the loader to apply the new owner to any loaders that are aggregated by t...
void setOwner(TilesetContentManager &owner) noexcept
Sets the TilesetContentManager that owns this loader.
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.
const TilesetContentManager * getOwner() const noexcept
Gets the TilesetContentManager that owns this loader.
virtual CesiumUtility::IntrusivePointer< CesiumGltf::Schema > getExternalSchema()
Get the external glTF schema object.
virtual void setExternalSchema(CesiumGltf::Schema *schema)
Store a glTF schema object that will be used to parse metadata in a loader and its children.
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.
Contains assets that are potentially shared across multiple Tilesets.
A system for managing asynchronous requests and tasks.
Definition AsyncSystem.h:37
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:39
Classes that implement the 3D Tiles standard.
TileLoadResultState
Indicate the status of Cesium3DTilesSelection::TilesetContentLoader::loadTileContent and Cesium3DTile...
Classes that support asynchronous operations.
Classes for geospatial computations in Cesium.
Classes for working with glTF models.
Utility classes for Cesium.
STL namespace.
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.
CesiumUtility::IntrusivePointer< TilesetSharedAssetSystem > pSharedAssetSystem
The shared asset system that will be used to resolve external assets associated with 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 the contents of a Tileset, including construction of its glTF mod...
An object defining classes and enums.
Definition Schema.h:18