cesium-native 0.44.2
Loading...
Searching...
No Matches
QuantizedMeshLoader.h
1#pragma once
2
3#include <CesiumGeometry/QuadtreeTileID.h>
4#include <CesiumGeometry/QuadtreeTileRectangularRange.h>
5#include <CesiumGeospatial/BoundingRegion.h>
6#include <CesiumGeospatial/Ellipsoid.h>
7#include <CesiumGltf/Model.h>
8#include <CesiumQuantizedMeshTerrain/Library.h>
9#include <CesiumUtility/ErrorList.h>
10
11#include <rapidjson/document.h>
12
13#include <cstddef>
14#include <memory>
15#include <optional>
16#include <span>
17#include <vector>
18
19namespace CesiumAsync {
20class IAssetRequest;
21}
22
24
39 std::optional<CesiumGltf::Model> model;
40
47 std::optional<CesiumGeospatial::BoundingRegion> updatedBoundingVolume{};
48
53 std::vector<CesiumGeometry::QuadtreeTileRectangularRange>
55
61 std::shared_ptr<CesiumAsync::IAssetRequest> pRequest;
62
67};
68
77 std::vector<CesiumGeometry::QuadtreeTileRectangularRange> availability;
78
83};
84
88class CESIUMQUANTIZEDMESHTERRAIN_API QuantizedMeshLoader final {
89public:
103 const CesiumGeometry::QuadtreeTileID& tileID,
104 const CesiumGeospatial::BoundingRegion& tileBoundingVolume,
105 const std::string& url,
106 const std::span<const std::byte>& data,
107 bool enableWaterMask,
108 const CesiumGeospatial::Ellipsoid& ellipsoid CESIUM_DEFAULT_ELLIPSOID);
109
119 const std::span<const std::byte>& data,
120 const CesiumGeometry::QuadtreeTileID& tileID);
121
135 const rapidjson::Document& layerJson,
136 uint32_t startingLevel);
137};
138
139} // namespace CesiumQuantizedMeshTerrain
A bounding volume specified as a longitude/latitude bounding box and a minimum and maximum height.
A quadratic surface defined in Cartesian coordinates.
Definition Ellipsoid.h:39
Loads quantized-mesh-1.0 terrain data.
static QuantizedMeshMetadataResult loadAvailabilityRectangles(const rapidjson::Document &layerJson, uint32_t startingLevel)
Extracts tile availability information from a parsed layer.json or tile metadata extension.
static QuantizedMeshLoadResult load(const CesiumGeometry::QuadtreeTileID &tileID, const CesiumGeospatial::BoundingRegion &tileBoundingVolume, const std::string &url, const std::span< const std::byte > &data, bool enableWaterMask, const CesiumGeospatial::Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84)
Create a QuantizedMeshLoadResult from the given data.
static QuantizedMeshMetadataResult loadMetadata(const std::span< const std::byte > &data, const CesiumGeometry::QuadtreeTileID &tileID)
Parses the metadata (tile availability) from the given quantized-mesh terrain tile data.
Classes that support asynchronous operations.
Classes for accessing terrain based on layer.json and quantized-mesh-1.0.
Definition Layer.h:11
Uniquely identifies a node in a quadtree.
The results of a QuantizedMeshLoader::load operation, containing either the loaded model,...
std::optional< CesiumGltf::Model > model
The glTF model to be rendered for this tile.
std::vector< CesiumGeometry::QuadtreeTileRectangularRange > availableTileRectangles
Available quadtree tiles discovered as a result of loading this tile.
CesiumUtility::ErrorList errors
The errors and warnings reported while loading this tile.
std::optional< CesiumGeospatial::BoundingRegion > updatedBoundingVolume
An improved bounding region for this tile.
std::shared_ptr< CesiumAsync::IAssetRequest > pRequest
The request that was used to download the tile content, if any.
The metadata of a Quantized Mesh tile, returned by QuantizedMeshLoader::loadMetadata.
std::vector< CesiumGeometry::QuadtreeTileRectangularRange > availability
Information about the availability of child tiles.
CesiumUtility::ErrorList errors
The errors and warnings reported while loading this tile, if any.
The container to store the error and warning list when loading a tile or glTF content.
Definition ErrorList.h:18