cesium-native 0.44.2
Loading...
Searching...
No Matches
UrlTemplateRasterOverlay.h
1#pragma once
2
3#include "IPrepareRasterOverlayRendererResources.h"
4#include "Library.h"
5#include "RasterOverlayTileProvider.h"
6
7#include <CesiumAsync/AsyncSystem.h>
8#include <CesiumAsync/Future.h>
9#include <CesiumAsync/IAssetAccessor.h>
10#include <CesiumAsync/SharedAssetDepot.h>
11#include <CesiumGeometry/QuadtreeTileID.h>
12#include <CesiumGeometry/QuadtreeTilingScheme.h>
13#include <CesiumRasterOverlays/RasterOverlay.h>
14#include <CesiumUtility/CreditSystem.h>
15#include <CesiumUtility/Result.h>
16#include <CesiumUtility/SharedAsset.h>
17
18#include <list>
19#include <memory>
20#include <optional>
21#include <string>
22
23namespace CesiumRasterOverlays {
24
32 std::optional<std::string> credit;
33
37 std::optional<CesiumGeospatial::Projection> projection;
38
43 std::optional<CesiumGeometry::QuadtreeTilingScheme> tilingScheme;
44
52 uint32_t minimumLevel = 0;
53
57 uint32_t maximumLevel = 25;
58
62 uint32_t tileWidth = 256;
63
67 uint32_t tileHeight = 256;
68
73 std::optional<CesiumGeometry::Rectangle> coverageRectangle;
74};
75
79class CESIUMRASTEROVERLAYS_API UrlTemplateRasterOverlay final
80 : public RasterOverlay {
81public:
111 const std::string& name,
112 const std::string& url,
113 const std::vector<CesiumAsync::IAssetAccessor::THeader>& headers = {},
114 const UrlTemplateRasterOverlayOptions& urlTemplateOptions = {},
115 const RasterOverlayOptions& overlayOptions = {})
116 : RasterOverlay(name, overlayOptions),
117 _url(url),
118 _headers(headers),
119 _options(urlTemplateOptions) {}
120
122 const CesiumAsync::AsyncSystem& asyncSystem,
123 const std::shared_ptr<CesiumAsync::IAssetAccessor>& pAssetAccessor,
124 const std::shared_ptr<CesiumUtility::CreditSystem>& pCreditSystem,
125 const std::shared_ptr<IPrepareRasterOverlayRendererResources>&
126 pPrepareRendererResources,
127 const std::shared_ptr<spdlog::logger>& pLogger,
129 const override;
130
131private:
132 std::string _url;
133 std::vector<CesiumAsync::IAssetAccessor::THeader> _headers;
135};
136} // namespace CesiumRasterOverlays
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 Promise.h:12
The base class for a rasterized image that can be draped over a Cesium3DTilesSelection::Tileset....
A RasterOverlay accessing images from a templated URL.
UrlTemplateRasterOverlay(const std::string &name, const std::string &url, const std::vector< CesiumAsync::IAssetAccessor::THeader > &headers={}, const UrlTemplateRasterOverlayOptions &urlTemplateOptions={}, const RasterOverlayOptions &overlayOptions={})
Creates a new instance.
virtual CesiumAsync::Future< CreateTileProviderResult > createTileProvider(const CesiumAsync::AsyncSystem &asyncSystem, const std::shared_ptr< CesiumAsync::IAssetAccessor > &pAssetAccessor, const std::shared_ptr< CesiumUtility::CreditSystem > &pCreditSystem, const std::shared_ptr< IPrepareRasterOverlayRendererResources > &pPrepareRendererResources, const std::shared_ptr< spdlog::logger > &pLogger, CesiumUtility::IntrusivePointer< const RasterOverlay > pOwner) const override
Begins asynchronous creation of a tile provider for this overlay and eventually returns it via a Futu...
A smart pointer that calls addReference and releaseReference on the controlled object.
Classes for raster overlays, which allow draping massive 2D textures over a model.
std::optional< CesiumGeometry::Rectangle > coverageRectangle
The CesiumGeometry::Rectangle, in radians, covered by the image.
std::optional< std::string > credit
A credit for the data source, which is displayed on the canvas.
uint32_t minimumLevel
The minimum level-of-detail supported by the imagery provider.
std::optional< CesiumGeospatial::Projection > projection
The CesiumGeospatial::Projection that is used.
std::optional< CesiumGeometry::QuadtreeTilingScheme > tilingScheme
The CesiumGeometry::QuadtreeTilingScheme specifying how the ellipsoidal surface is broken into tiles.
uint32_t maximumLevel
The maximum level-of-detail supported by the imagery provider.