cesium-native 0.43.0
Loading...
Searching...
No Matches
RasterOverlayCollection.h
1#pragma once
2
3#include "Library.h"
4#include "TilesetExternals.h"
5
6#include <CesiumGeospatial/Ellipsoid.h>
7#include <CesiumRasterOverlays/RasterOverlay.h>
8#include <CesiumRasterOverlays/RasterOverlayTileProvider.h>
9#include <CesiumUtility/IntrusivePointer.h>
10#include <CesiumUtility/ReferenceCounted.h>
11#include <CesiumUtility/Tracing.h>
12
13#include <memory>
14#include <span>
15#include <vector>
16
17namespace Cesium3DTilesSelection {
18
30class CESIUM3DTILESSELECTION_API RasterOverlayCollection final {
31public:
42 Tile::LoadedLinkedList& loadedTiles,
43 const TilesetExternals& externals,
44 const CesiumGeospatial::Ellipsoid& ellipsoid
45 CESIUM_DEFAULT_ELLIPSOID) noexcept;
46
53
60
67 operator=(const RasterOverlayCollection& rhs) = delete;
68
75 operator=(RasterOverlayCollection&& rhs) noexcept = default;
76
77 ~RasterOverlayCollection() noexcept;
78
84 void add(const CesiumUtility::IntrusivePointer<
85 CesiumRasterOverlays::RasterOverlay>& pOverlay);
86
90 void remove(const CesiumUtility::IntrusivePointer<
91 CesiumRasterOverlays::RasterOverlay>& pOverlay) noexcept;
92
96 const std::vector<
97 CesiumUtility::IntrusivePointer<CesiumRasterOverlays::RasterOverlay>>&
98 getOverlays() const;
99
105 const std::vector<CesiumUtility::IntrusivePointer<
106 CesiumRasterOverlays::RasterOverlayTileProvider>>&
107 getTileProviders() const;
108
114 const std::vector<CesiumUtility::IntrusivePointer<
115 CesiumRasterOverlays::RasterOverlayTileProvider>>&
116 getPlaceholderTileProviders() const;
117
131 CesiumRasterOverlays::RasterOverlayTileProvider* findTileProviderForOverlay(
132 CesiumRasterOverlays::RasterOverlay& overlay) noexcept;
133
137 const CesiumRasterOverlays::RasterOverlayTileProvider*
138 findTileProviderForOverlay(
139 const CesiumRasterOverlays::RasterOverlay& overlay) const noexcept;
140
155 CesiumRasterOverlays::RasterOverlayTileProvider*
156 findPlaceholderTileProviderForOverlay(
157 CesiumRasterOverlays::RasterOverlay& overlay) noexcept;
158
162 const CesiumRasterOverlays::RasterOverlayTileProvider*
163 findPlaceholderTileProviderForOverlay(
164 const CesiumRasterOverlays::RasterOverlay& overlay) const noexcept;
165
169 typedef std::vector<CesiumUtility::IntrusivePointer<
171
175 const_iterator begin() const noexcept;
176
180 const_iterator end() const noexcept;
181
185 size_t size() const noexcept;
186
187private:
188 // We store the list of overlays and tile providers in this separate class
189 // so that we can separate its lifetime from the lifetime of the
190 // RasterOverlayCollection. We need to do this because the async operations
191 // that create tile providers from overlays need to have somewhere to write
192 // the result. And we can't extend the lifetime of the entire
193 // RasterOverlayCollection until the async operations complete because the
194 // RasterOverlayCollection has a pointer to the tile LoadedLinkedList, which
195 // is owned externally and may become invalid before the async operations
196 // complete.
197 struct OverlayList
198 : public CesiumUtility::ReferenceCountedNonThreadSafe<OverlayList> {
199 std::vector<
201 overlays{};
204 tileProviders{};
207 placeholders{};
208 };
209
210 Tile::LoadedLinkedList* _pLoadedTiles;
211 TilesetExternals _externals;
214 CESIUM_TRACE_DECLARE_TRACK_SET(_loadingSlots, "Raster Overlay Loading Slot")
215};
216
217} // 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:38
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.