cesium-native  0.41.0
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 
9 namespace Cesium3DTilesReader {
10 
23 class CESIUM3DTILESREADER_API SubtreeFileReader {
24 public:
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 
66  load(
67  const CesiumAsync::AsyncSystem& asyncSystem,
68  const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
69  const std::shared_ptr<CesiumAsync::IAssetRequest>& pRequest)
70  const noexcept;
71 
73  load(
74  const CesiumAsync::AsyncSystem& asyncSystem,
75  const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
76  const std::string& url,
77  const std::vector<CesiumAsync::IAssetAccessor::THeader>& requestHeaders,
78  const gsl::span<const std::byte>& data) const noexcept;
79 
80 private:
82  loadBinary(
83  const CesiumAsync::AsyncSystem& asyncSystem,
84  const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
85  const std::string& url,
86  const std::vector<CesiumAsync::IAssetAccessor::THeader>& requestHeaders,
87  const gsl::span<const std::byte>& data) const noexcept;
89  loadJson(
90  const CesiumAsync::AsyncSystem& asyncSystem,
91  const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
92  const std::string& url,
93  const std::vector<CesiumAsync::IAssetAccessor::THeader>& requestHeaders,
94  const gsl::span<const std::byte>& data) const noexcept;
96  postprocess(
97  const CesiumAsync::AsyncSystem& asyncSystem,
98  const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
99  const std::string& url,
100  const std::vector<CesiumAsync::IAssetAccessor::THeader>& requestHeaders,
102  const noexcept;
103 
104  SubtreeReader _reader;
105 };
106 
107 } // namespace Cesium3DTilesReader
Reads 3D Tiles subtrees from a binary or JSON subtree file.
SubtreeFileReader()
Constructs a new instance.
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.
const CesiumJsonReader::JsonReaderOptions & getOptions() const
Gets the options controlling how the JSON is read.
CesiumJsonReader::JsonReaderOptions & getOptions()
Gets the options controlling how the JSON is read.
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
Holds options for reading statically-typed data structures from JSON.
Classes for reading 3D Tiles.
Definition: Library.h:6
The result of Reader::readJson.
Definition: JsonReader.h:23