cesium-native  0.41.0
Cesium3DTilesReader::SubtreeFileReader Class Reference

Reads 3D Tiles subtrees from a binary or JSON subtree file. More...

#include <Cesium3DTilesReader/SubtreeFileReader.h>

Public Member Functions

 SubtreeFileReader ()
 Constructs a new instance.
 
CesiumJsonReader::JsonReaderOptionsgetOptions ()
 Gets the options controlling how the JSON is read.
 
const CesiumJsonReader::JsonReaderOptionsgetOptions () 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. More...
 
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
 
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 gsl::span< const std::byte > &data) const noexcept
 

Detailed Description

Reads 3D Tiles subtrees from a binary or JSON subtree file.

While SubtreeReader can parse a Subtree from a binary buffer as well, SubtreeFileReader additionally supports:

  1. Loading binary subtree files.
  2. Loading external buffers asynchronously.
  3. Decoding buffers from data URIs.

The subtree file need not be an actual file on disk.

Definition at line 23 of file SubtreeFileReader.h.

Member Function Documentation

◆ load()

CesiumAsync::Future<CesiumJsonReader::ReadJsonResult<Cesium3DTiles::Subtree> > Cesium3DTilesReader::SubtreeFileReader::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.

Please note that the SubtreeFileReader instance must remain valid until the returned future resolves or rejects. Destroying it earlier will result in undefined behavior. One easy way to achieve this is to construct the reader with std::make_shared and capture the std::shared_ptr in the continuation lambda.

Parameters
asyncSystemThe AsyncSystem used to do asynchronous work.
pAssetAccessorThe accessor used to retrieve the URL and any other required resources.
urlThe URL from which to get the subtree file.
headersHeaders to include in the request for the initial subtree file and any additional resources that are required.
Returns
A future that resolves to the result of loading the subtree.

The documentation for this class was generated from the following file: