cesium-native 0.44.2
Loading...
Searching...
No Matches
RasterOverlayCollection.h
1#pragma once
2
3#include <Cesium3DTilesSelection/Library.h>
4#include <Cesium3DTilesSelection/TilesetExternals.h>
5#include <CesiumGeospatial/Ellipsoid.h>
6#include <CesiumRasterOverlays/RasterOverlay.h>
7#include <CesiumRasterOverlays/RasterOverlayTileProvider.h>
8#include <CesiumUtility/IntrusivePointer.h>
9#include <CesiumUtility/ReferenceCounted.h>
10#include <CesiumUtility/Tracing.h>
11
12#include <memory>
13#include <span>
14#include <vector>
15
16namespace Cesium3DTilesSelection {
17
29class CESIUM3DTILESSELECTION_API RasterOverlayCollection final {
30public:
41 Tile::LoadedLinkedList& loadedTiles,
42 const TilesetExternals& externals,
43 const CesiumGeospatial::Ellipsoid& ellipsoid
44 CESIUM_DEFAULT_ELLIPSOID) noexcept;
45
52
59
66 operator=(const RasterOverlayCollection& rhs) = delete;
67
74 operator=(RasterOverlayCollection&& rhs) noexcept = default;
75
76 ~RasterOverlayCollection() noexcept;
77
83 void add(const CesiumUtility::IntrusivePointer<
84 CesiumRasterOverlays::RasterOverlay>& pOverlay);
85
89 void remove(const CesiumUtility::IntrusivePointer<
90 CesiumRasterOverlays::RasterOverlay>& pOverlay) noexcept;
91
95 const std::vector<
96 CesiumUtility::IntrusivePointer<CesiumRasterOverlays::RasterOverlay>>&
97 getOverlays() const;
98
104 const std::vector<CesiumUtility::IntrusivePointer<
105 CesiumRasterOverlays::RasterOverlayTileProvider>>&
106 getTileProviders() const;
107
113 const std::vector<CesiumUtility::IntrusivePointer<
114 CesiumRasterOverlays::RasterOverlayTileProvider>>&
115 getPlaceholderTileProviders() const;
116
130 CesiumRasterOverlays::RasterOverlayTileProvider* findTileProviderForOverlay(
131 CesiumRasterOverlays::RasterOverlay& overlay) noexcept;
132
136 const CesiumRasterOverlays::RasterOverlayTileProvider*
137 findTileProviderForOverlay(
138 const CesiumRasterOverlays::RasterOverlay& overlay) const noexcept;
139
154 CesiumRasterOverlays::RasterOverlayTileProvider*
155 findPlaceholderTileProviderForOverlay(
156 CesiumRasterOverlays::RasterOverlay& overlay) noexcept;
157
161 const CesiumRasterOverlays::RasterOverlayTileProvider*
162 findPlaceholderTileProviderForOverlay(
163 const CesiumRasterOverlays::RasterOverlay& overlay) const noexcept;
164
168 typedef std::vector<CesiumUtility::IntrusivePointer<
170
174 const_iterator begin() const noexcept;
175
179 const_iterator end() const noexcept;
180
184 size_t size() const noexcept;
185
186private:
187 // We store the list of overlays and tile providers in this separate class
188 // so that we can separate its lifetime from the lifetime of the
189 // RasterOverlayCollection. We need to do this because the async operations
190 // that create tile providers from overlays need to have somewhere to write
191 // the result. And we can't extend the lifetime of the entire
192 // RasterOverlayCollection until the async operations complete because the
193 // RasterOverlayCollection has a pointer to the tile LoadedLinkedList, which
194 // is owned externally and may become invalid before the async operations
195 // complete.
196 struct OverlayList
197 : public CesiumUtility::ReferenceCountedNonThreadSafe<OverlayList> {
198 std::vector<
200 overlays{};
203 tileProviders{};
206 placeholders{};
207 };
208
209 Tile::LoadedLinkedList* _pLoadedTiles;
210 TilesetExternals _externals;
213 CESIUM_TRACE_DECLARE_TRACK_SET(_loadingSlots, "Raster Overlay Loading Slot")
214};
215
216} // namespace Cesium3DTilesSelection
A collection of CesiumRasterOverlays::RasterOverlay instances that are associated with a Tileset.
RasterOverlayCollection & operator=(RasterOverlayCollection &&rhs) noexcept=default
Move assignment.
RasterOverlayCollection(Tile::LoadedLinkedList &loadedTiles, const TilesetExternals &externals, const CesiumGeospatial::Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84) noexcept
Creates a new instance.
RasterOverlayCollection(const RasterOverlayCollection &rhs)=delete
Deleted Copy constructor.
std::vector< CesiumUtility::IntrusivePointer< CesiumRasterOverlays::RasterOverlay > >::const_iterator const_iterator
A constant iterator for CesiumRasterOverlays::RasterOverlay instances.
RasterOverlayCollection & operator=(const RasterOverlayCollection &rhs)=delete
Deleted copy assignment.
RasterOverlayCollection(RasterOverlayCollection &&rhs) noexcept=default
Move constructor.
External interfaces used by a Tileset.
A quadratic surface defined in Cartesian coordinates.
Definition Ellipsoid.h:39
Provides individual tiles for a RasterOverlay on demand.
A smart pointer that calls addReference and releaseReference on the controlled object.
Classes that implement the 3D Tiles standard.
Classes for raster overlays, which allow draping massive 2D textures over a model.
Utility classes for Cesium.
STL namespace.