cesium-native 0.67.0
Loading...
Searching...
No Matches
SubtreeFileReader.h
1#pragma once
2
3#include <CesiumAsync/AsyncSystem.h>
4#include <CesiumAsync/Future.h>
5#include <CesiumAsync/IAssetAccessor.h>
6#include <CesiumTilesetJsonReader/Library.h>
7#include <CesiumTilesetJsonReader/SubtreeReader.h>
8
9#include <rapidjson/document.h>
10
12
25class CESIUMTILESETJSONREADER_API SubtreeFileReader {
26public:
31
36
41
62 const CesiumAsync::AsyncSystem& asyncSystem,
63 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
64 const std::string& url,
65 const std::vector<CesiumAsync::IAssetAccessor::THeader>& headers = {})
66 const noexcept;
67
86 const CesiumAsync::AsyncSystem& asyncSystem,
87 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
88 const std::shared_ptr<CesiumAsync::IAssetRequest>& pRequest)
89 const noexcept;
90
113 const CesiumAsync::AsyncSystem& asyncSystem,
114 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
115 const std::string& url,
116 const std::vector<CesiumAsync::IAssetAccessor::THeader>& requestHeaders,
117 const std::span<const std::byte>& data) const noexcept;
118
142 const CesiumAsync::AsyncSystem& asyncSystem,
143 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
144 const std::string& url,
145 const std::vector<CesiumAsync::IAssetAccessor::THeader>& requestHeaders,
146 const rapidjson::Document& document) const noexcept;
147
148private:
151 loadBinary(
152 const CesiumAsync::AsyncSystem& asyncSystem,
153 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
154 const std::string& url,
155 const std::vector<CesiumAsync::IAssetAccessor::THeader>& requestHeaders,
156 const std::span<const std::byte>& data) const noexcept;
159 loadJson(
160 const CesiumAsync::AsyncSystem& asyncSystem,
161 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
162 const std::string& url,
163 const std::vector<CesiumAsync::IAssetAccessor::THeader>& requestHeaders,
164 const std::span<const std::byte>& data) const noexcept;
167 loadJson(
168 const CesiumAsync::AsyncSystem& asyncSystem,
169 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
170 const std::string& url,
171 const std::vector<CesiumAsync::IAssetAccessor::THeader>& requestHeaders,
172 const rapidjson::Document& document) const noexcept;
175 postprocess(
176 const CesiumAsync::AsyncSystem& asyncSystem,
177 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
178 const std::string& url,
179 const std::vector<CesiumAsync::IAssetAccessor::THeader>& requestHeaders,
181 const noexcept;
182
183 SubtreeReader _reader;
184};
185
186} // namespace CesiumTilesetJsonReader
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
Holds options for reading statically-typed data structures from JSON.
CesiumAsync::Future< CesiumJsonReader::ReadJsonResult< CesiumTilesetJson::Subtree > > load(const CesiumAsync::AsyncSystem &asyncSystem, const std::shared_ptr< CesiumAsync::IAssetAccessor > &pAssetAccessor, const std::shared_ptr< CesiumAsync::IAssetRequest > &pRequest) const noexcept
Asynchronously loads a subtree from a request.
CesiumAsync::Future< CesiumJsonReader::ReadJsonResult< CesiumTilesetJson::Subtree > > load(const CesiumAsync::AsyncSystem &asyncSystem, const std::shared_ptr< CesiumAsync::IAssetAccessor > &pAssetAccessor, const std::string &url, const std::vector< CesiumAsync::IAssetAccessor::THeader > &requestHeaders, const rapidjson::Document &document) const noexcept
Asynchronously loads a subtree from a rapidjson::Document obtained from a URL.
CesiumJsonReader::JsonReaderOptions & getOptions()
Gets the options controlling how the JSON is read.
CesiumAsync::Future< CesiumJsonReader::ReadJsonResult< CesiumTilesetJson::Subtree > > load(const CesiumAsync::AsyncSystem &asyncSystem, const std::shared_ptr< CesiumAsync::IAssetAccessor > &pAssetAccessor, const std::string &url, const std::vector< CesiumAsync::IAssetAccessor::THeader > &headers={}) const noexcept
Asynchronously loads a subtree from a URL.
SubtreeFileReader()
Constructs a new instance.
const CesiumJsonReader::JsonReaderOptions & getOptions() const
Gets the options controlling how the JSON is read.
CesiumAsync::Future< CesiumJsonReader::ReadJsonResult< CesiumTilesetJson::Subtree > > load(const CesiumAsync::AsyncSystem &asyncSystem, const std::shared_ptr< CesiumAsync::IAssetAccessor > &pAssetAccessor, const std::string &url, const std::vector< CesiumAsync::IAssetAccessor::THeader > &requestHeaders, const std::span< const std::byte > &data) const noexcept
Asynchronously loads a subtree from data obtained from a URL.
Reads Subtree instances from JSON.
Classes for reading a tileset.json from 3D Tiles 1.1.
Definition Library.h:9
The result of JsonReader::readJson.
Definition JsonReader.h:23