cesium-native 0.44.2
Loading...
Searching...
No Matches
RasterMappedTo3DTile.h
1#pragma once
2
3#include <Cesium3DTilesSelection/IPrepareRendererResources.h>
4#include <CesiumGeometry/Rectangle.h>
5#include <CesiumGeospatial/Projection.h>
6#include <CesiumRasterOverlays/RasterOverlayTile.h>
7#include <CesiumUtility/IntrusivePointer.h>
8
9#include <memory>
10
11namespace Cesium3DTilesSelection {
12
13class Tile;
14
23public:
28 enum class AttachmentState {
32 Unattached = 0,
33
39
43 Attached = 2
44 };
45
57 int32_t textureCoordinateIndex);
58
68 return this->_pLoadingTile.get();
69 }
70
73 getLoadingTile() const noexcept {
74 return this->_pLoadingTile.get();
75 }
76
86 return this->_pReadyTile.get();
87 }
88
91 return this->_pReadyTile.get();
92 }
93
102 int32_t getTextureCoordinateID() const noexcept {
103 return this->_textureCoordinateID;
104 }
105
113 void setTextureCoordinateID(int32_t textureCoordinateID) noexcept {
114 this->_textureCoordinateID = textureCoordinateID;
115 }
116
126 const glm::dvec2& getTranslation() const noexcept {
127 return this->_translation;
128 }
129
139 const glm::dvec2& getScale() const noexcept { return this->_scale; }
140
150 AttachmentState getState() const noexcept { return this->_state; }
151
165 update(IPrepareRendererResources& prepareRendererResources, Tile& tile);
166
170 bool isMoreDetailAvailable() const noexcept;
171
179 IPrepareRendererResources& prepareRendererResources,
180 Tile& tile) noexcept;
181
191 bool loadThrottled() noexcept;
192
225 double maximumScreenSpaceError,
226 CesiumRasterOverlays::RasterOverlayTileProvider& tileProvider,
227 CesiumRasterOverlays::RasterOverlayTileProvider& placeholder,
228 Tile& tile,
229 std::vector<CesiumGeospatial::Projection>& missingProjections,
230 const CesiumGeospatial::Ellipsoid& ellipsoid CESIUM_DEFAULT_ELLIPSOID);
231
232private:
233 void computeTranslationAndScale(const Tile& tile);
234
235 CesiumUtility::IntrusivePointer<CesiumRasterOverlays::RasterOverlayTile>
236 _pLoadingTile;
237 CesiumUtility::IntrusivePointer<CesiumRasterOverlays::RasterOverlayTile>
238 _pReadyTile;
239 int32_t _textureCoordinateID;
240 glm::dvec2 _translation;
241 glm::dvec2 _scale;
242 AttachmentState _state;
243 bool _originalFailed;
244};
245
246} // namespace Cesium3DTilesSelection
When implemented for a rendering engine, allows renderer resources to be created and destroyed under ...
The result of applying a CesiumRasterOverlays::RasterOverlayTile to geometry.
const CesiumRasterOverlays::RasterOverlayTile * getReadyTile() const noexcept
Returns the CesiumRasterOverlays::RasterOverlayTile that represents the imagery data that is ready to...
CesiumRasterOverlays::RasterOverlayTile * getLoadingTile() noexcept
Returns a CesiumRasterOverlays::RasterOverlayTile that is currently loading.
AttachmentState
The states indicating whether the raster tile is attached to the geometry.
@ Attached
This raster tile is attached to the geometry.
@ TemporarilyAttached
This raster tile is attached to the geometry, but it is a temporary, low-res version usable while the...
@ Unattached
This raster tile is not yet attached to the geometry at all.
AttachmentState getState() const noexcept
Indicates whether this overlay tile is currently attached to its owning geometry tile.
static RasterMappedTo3DTile * mapOverlayToTile(double maximumScreenSpaceError, CesiumRasterOverlays::RasterOverlayTileProvider &tileProvider, CesiumRasterOverlays::RasterOverlayTileProvider &placeholder, Tile &tile, std::vector< CesiumGeospatial::Projection > &missingProjections, const CesiumGeospatial::Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84)
Creates a maping between a CesiumRasterOverlays::RasterOverlay and a Tile.
const glm::dvec2 & getScale() const noexcept
Returns the scaling that converts between the geometry texture coordinates and the texture coordinate...
int32_t getTextureCoordinateID() const noexcept
Returns an identifier for the texture coordinates of this tile.
const glm::dvec2 & getTranslation() const noexcept
Returns the translation that converts between the geometry texture coordinates and the texture coordi...
RasterMappedTo3DTile(const CesiumUtility::IntrusivePointer< CesiumRasterOverlays::RasterOverlayTile > &pRasterTile, int32_t textureCoordinateIndex)
Creates a new instance.
void setTextureCoordinateID(int32_t textureCoordinateID) noexcept
Sets the texture coordinate ID.
bool loadThrottled() noexcept
Does a throttled load of the mapped CesiumRasterOverlays::RasterOverlayTile.
bool isMoreDetailAvailable() const noexcept
Determines if more detailed data is available for the spatial area covered by this tile.
CesiumRasterOverlays::RasterOverlayTile::MoreDetailAvailable update(IPrepareRendererResources &prepareRendererResources, Tile &tile)
Update this tile during the update of its owner.
CesiumRasterOverlays::RasterOverlayTile * getReadyTile() noexcept
Returns the CesiumRasterOverlays::RasterOverlayTile that represents the imagery data that is ready to...
void detachFromTile(IPrepareRendererResources &prepareRendererResources, Tile &tile) noexcept
Detach the raster from the given tile.
const CesiumRasterOverlays::RasterOverlayTile * getLoadingTile() const noexcept
Returns a CesiumRasterOverlays::RasterOverlayTile that is currently loading.
A tile in a Tileset.
Definition Tile.h:96
Raster image data for a tile in a quadtree.
MoreDetailAvailable
Tile availability states.
A smart pointer that calls addReference and releaseReference on the controlled object.
T * get() const noexcept
Returns the internal pointer.
Classes that implement the 3D Tiles standard.
Classes for geospatial computations in Cesium.
Classes for raster overlays, which allow draping massive 2D textures over a model.
Utility classes for Cesium.
STL namespace.