cesium-native 0.46.0
Loading...
Searching...
No Matches
TilesetContentLoaderResult.h
1#pragma once
2
3#include <Cesium3DTilesSelection/Tile.h>
4#include <CesiumAsync/IAssetAccessor.h>
5#include <CesiumGeometry/Axis.h>
6#include <CesiumUtility/ErrorList.h>
7
8#include <memory>
9#include <type_traits>
10#include <vector>
11
12namespace Cesium3DTilesSelection {
13
21 std::string creditText;
22
27};
28
34template <class TilesetContentLoaderType> struct TilesetContentLoaderResult {
36
50 std::unique_ptr<TilesetContentLoaderType>&& pLoader_,
51 std::unique_ptr<Tile>&& pRootTile_,
52 std::vector<LoaderCreditResult>&& credits_,
53 std::vector<CesiumAsync::IAssetAccessor::THeader>&& requestHeaders_,
55 : pLoader{std::move(pLoader_)},
56 pRootTile{std::move(pRootTile_)},
57 credits{std::move(credits_)},
58 requestHeaders{std::move(requestHeaders_)},
59 errors{std::move(errors_)} {}
60
65 operator=(const TilesetContentLoaderResult&) = delete;
68 operator=(TilesetContentLoaderResult&&) noexcept = default;
69
74 template <
75 class OtherLoaderType,
76 typename Enable_Type = std::enable_if_t<
77 !std::is_same_v<OtherLoaderType, TilesetContentLoaderResult> &&
78 std::is_convertible_v<
79 std::unique_ptr<OtherLoaderType>,
80 std::unique_ptr<TilesetContentLoaderType>>,
81 int>>
83 TilesetContentLoaderResult<OtherLoaderType>&& rhs) noexcept
84 : pLoader{std::move(rhs.pLoader)},
85 pRootTile{std::move(rhs.pRootTile)},
86 credits{std::move(rhs.credits)},
87 requestHeaders{std::move(rhs.requestHeaders)},
88 errors{std::move(rhs.errors)} {}
89
95 template <
96 class OtherLoaderType,
97 typename Enable_Type = std::enable_if_t<
98 !std::is_same_v<OtherLoaderType, TilesetContentLoaderResult> &&
99 std::is_convertible_v<
100 std::unique_ptr<OtherLoaderType>,
101 std::unique_ptr<TilesetContentLoaderType>>,
102 int>>
103 TilesetContentLoaderResult&
105 using std::swap;
106 swap(this->pLoader, rhs.pLoader);
107 swap(this->pRootTile, rhs.pRootTile);
108 swap(this->credits, rhs.credits);
109 swap(this->requestHeaders, rhs.requestHeaders);
110 swap(this->errors, rhs.errors);
111
112 return *this;
113 }
114
116 std::unique_ptr<TilesetContentLoaderType> pLoader;
118 std::unique_ptr<Tile> pRootTile;
120 std::vector<LoaderCreditResult> credits;
122 std::vector<CesiumAsync::IAssetAccessor::THeader> requestHeaders;
128 uint16_t statusCode{200};
129};
130} // namespace Cesium3DTilesSelection
Classes that implement the 3D Tiles standard.
STL namespace.
Credit information obtained from a TilesetContentLoader.
bool showOnScreen
Whether the credit must be shown on screen or not.
std::string creditText
The text of this credit.
The result of creating a TilesetContentLoader, including the status, request, and any errors,...
std::unique_ptr< TilesetContentLoaderType > pLoader
The TilesetContentLoader that produced this result.
TilesetContentLoaderResult(std::unique_ptr< TilesetContentLoaderType > &&pLoader_, std::unique_ptr< Tile > &&pRootTile_, std::vector< LoaderCreditResult > &&credits_, std::vector< CesiumAsync::IAssetAccessor::THeader > &&requestHeaders_, CesiumUtility::ErrorList &&errors_)
Creates a new TilesetContentLoaderResult.
uint16_t statusCode
The HTTP status code returned when attempting to create this TilesetContentLoader.
std::unique_ptr< Tile > pRootTile
The root Tile object from the created loader.
CesiumUtility::ErrorList errors
Any errors or warnings that arose while creating this TilesetContentLoader.
std::vector< LoaderCreditResult > credits
A set of LoaderCreditResult objects created by the loader.
std::vector< CesiumAsync::IAssetAccessor::THeader > requestHeaders
The request headers used to fetch the tileset.
TilesetContentLoaderResult(TilesetContentLoaderResult &&) noexcept=default
Move constructor for TilesetContentLoaderResult.
TilesetContentLoaderResult & operator=(TilesetContentLoaderResult< OtherLoaderType > &&rhs) noexcept
Move assignment operator for creating a TilesetContentLoaderResult<T> from a TilesetContentLoaderResu...
The container to store the error and warning list when loading a tile or glTF content.
Definition ErrorList.h:18
std::vector< std::string > errors
The error messages of this container.
Definition ErrorList.h:120