cesium-native 0.43.0
Loading...
Searching...
No Matches
SubtreeFileReader.h
1#pragma once
2
3#include <Cesium3DTilesReader/Library.h>
4#include <Cesium3DTilesReader/SubtreeReader.h>
5#include <CesiumAsync/AsyncSystem.h>
6#include <CesiumAsync/Future.h>
7#include <CesiumAsync/IAssetAccessor.h>
8
9namespace Cesium3DTilesReader {
10
23class CESIUM3DTILESREADER_API SubtreeFileReader {
24public:
29
34
39
59 const CesiumAsync::AsyncSystem& asyncSystem,
60 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
61 const std::string& url,
62 const std::vector<CesiumAsync::IAssetAccessor::THeader>& headers = {})
63 const noexcept;
64
82 const CesiumAsync::AsyncSystem& asyncSystem,
83 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
84 const std::shared_ptr<CesiumAsync::IAssetRequest>& pRequest)
85 const noexcept;
86
108 const CesiumAsync::AsyncSystem& asyncSystem,
109 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
110 const std::string& url,
111 const std::vector<CesiumAsync::IAssetAccessor::THeader>& requestHeaders,
112 const std::span<const std::byte>& data) const noexcept;
113
114private:
116 loadBinary(
117 const CesiumAsync::AsyncSystem& asyncSystem,
118 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
119 const std::string& url,
120 const std::vector<CesiumAsync::IAssetAccessor::THeader>& requestHeaders,
121 const std::span<const std::byte>& data) const noexcept;
123 loadJson(
124 const CesiumAsync::AsyncSystem& asyncSystem,
125 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
126 const std::string& url,
127 const std::vector<CesiumAsync::IAssetAccessor::THeader>& requestHeaders,
128 const std::span<const std::byte>& data) const noexcept;
130 postprocess(
131 const CesiumAsync::AsyncSystem& asyncSystem,
132 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
133 const std::string& url,
134 const std::vector<CesiumAsync::IAssetAccessor::THeader>& requestHeaders,
136 const noexcept;
137
138 SubtreeReader _reader;
139};
140
141} // namespace Cesium3DTilesReader
Reads 3D Tiles subtrees from a binary or JSON subtree file.
CesiumAsync::Future< CesiumJsonReader::ReadJsonResult< Cesium3DTiles::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.
SubtreeFileReader()
Constructs a new instance.
const CesiumJsonReader::JsonReaderOptions & getOptions() const
Gets the options controlling how the JSON is read.
CesiumAsync::Future< CesiumJsonReader::ReadJsonResult< Cesium3DTiles::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.
CesiumJsonReader::JsonReaderOptions & getOptions()
Gets the options controlling how the JSON is read.
CesiumAsync::Future< CesiumJsonReader::ReadJsonResult< Cesium3DTiles::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 loads a subtree from data obtained from a URL.
Reads Subtree instances from JSON.
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
Holds options for reading statically-typed data structures from JSON.
Classes for reading 3D Tiles.
Definition Library.h:8
The result of JsonReader::readJson.
Definition JsonReader.h:23