5#include <Cesium3DTilesContent/GltfConverterResult.h>
6#include <CesiumAsync/Future.h>
7#include <CesiumAsync/IAssetAccessor.h>
8#include <CesiumGeometry/Axis.h>
9#include <CesiumGltfReader/GltfReader.h>
54 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor_,
55 const std::string& baseUrl_,
56 const glm::dmat4 tileTransform_,
57 const std::vector<CesiumAsync::IAssetAccessor::THeader>& requestHeaders_,
59 : asyncSystem(asyncSystem_),
60 pAssetAccessor(pAssetAccessor_),
62 tileTransform(tileTransform_),
63 requestHeaders(requestHeaders_),
74 get(
const std::string& relativeUrl)
const;
127 const std::span<const std::byte>& content,
160 const std::string& fileExtension,
218 const std::string& filePath,
219 const std::span<const std::byte>& content,
246 const std::span<const std::byte>& content,
251 static std::string toLowerCase(
const std::string_view& str);
253 static std::string getFileExtension(
const std::string_view& filePath);
256 const std::string& filePath,
257 std::string& fileExtension);
260 const std::span<const std::byte>& content,
263 static std::unordered_map<std::string, ConverterFunction> _loadersByMagic;
264 static std::unordered_map<std::string, ConverterFunction>
265 _loadersByFileExtension;
Creates GltfConverterResult objects from a a binary content.
static void registerMagic(const std::string &magic, ConverterFunction converter)
Register the given function for the given magic header.
static CesiumAsync::Future< GltfConverterResult > convert(const std::span< const std::byte > &content, const CesiumGltfReader::GltfReaderOptions &options, const AssetFetcher &assetFetcher)
Creates the GltfConverterResult from the given binary content.
static void registerFileExtension(const std::string &fileExtension, ConverterFunction converter)
Register the given function for the given file extension.
static ConverterFunction getConverterByFileExtension(const std::string &filePath)
Retrieve the converter function that is already registered for the given file extension....
static CesiumAsync::Future< GltfConverterResult > convert(const std::string &filePath, const std::span< const std::byte > &content, const CesiumGltfReader::GltfReaderOptions &options, const AssetFetcher &assetFetcher)
Creates the GltfConverterResult from the given binary content.
CesiumAsync::Future< GltfConverterResult >(*)( const std::span< const std::byte > &content, const CesiumGltfReader::GltfReaderOptions &options, const AssetFetcher &subprocessor) ConverterFunction
A function pointer that can create a GltfConverterResult from a tile binary content.
static ConverterFunction getConverterByMagic(const std::span< const std::byte > &content)
Retrieve the converter function that is registered for the given magic header. If no such function is...
A system for managing asynchronous requests and tasks.
A value that will be available in the future, as produced by AsyncSystem.
Classes that support loading and converting 3D Tiles tile content.
Axis
An enum describing the x, y, and z axes.
The result of an AssetFetcher::get call.
CesiumUtility::ErrorList errorList
The errors and warnings reported while fetching the asset.
std::vector< std::byte > bytes
The byte buffer obtained from a URL. This will be empty if fetching the asset failed.
glm::dmat4 tileTransform
The transformation matrix applied to this tile. Used for East-North-Up transforms in i3dm.
CesiumAsync::AsyncSystem asyncSystem
The CesiumAsync::AsyncSystem used for this AssetFetcher.
CesiumGeometry::Axis upAxis
The gltfUpAxis property that will be specified for loaded assets.
std::vector< CesiumAsync::IAssetAccessor::THeader > requestHeaders
Headers that will be attached to each request made with this AssetFetcher.
CesiumAsync::Future< AssetFetcherResult > get(const std::string &relativeUrl) const
Gets a buffer of bytes from the given relative URL.
std::string baseUrl
The base URL that this AssetFetcher's requests will be relative to.
std::shared_ptr< CesiumAsync::IAssetAccessor > pAssetAccessor
The CesiumAsync::IAssetAccessor used for this AssetFetcher.
AssetFetcher(const CesiumAsync::AsyncSystem &asyncSystem_, const std::shared_ptr< CesiumAsync::IAssetAccessor > &pAssetAccessor_, const std::string &baseUrl_, const glm::dmat4 tileTransform_, const std::vector< CesiumAsync::IAssetAccessor::THeader > &requestHeaders_, CesiumGeometry::Axis upAxis_)
Creates an AssetFetcher with the given base URL and settings.
Options for how to read a glTF.
The container to store the error and warning list when loading a tile or glTF content.