cesium-native 0.64.0
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 CesiumRasterOverlays {
13}
14
15namespace Cesium3DTilesSelection {
16
17class Tile;
18
28public:
33 enum class AttachmentState {
38
44
49 };
50
62 int32_t textureCoordinateIndex);
63
74 return this->_pLoadingTile.get();
75 }
76
79 getLoadingTile() const noexcept {
80 return this->_pLoadingTile.get();
81 }
82
92 return this->_pReadyTile.get();
93 }
94
97 return this->_pReadyTile.get();
98 }
99
108 int32_t getTextureCoordinateID() const noexcept {
109 return this->_textureCoordinateID;
110 }
111
119 void setTextureCoordinateID(int32_t textureCoordinateID) noexcept {
120 this->_textureCoordinateID = textureCoordinateID;
121 }
122
132 const glm::dvec2& getTranslation() const noexcept {
133 return this->_translation;
134 }
135
145 const glm::dvec2& getScale() const noexcept { return this->_scale; }
146
156 AttachmentState getState() const noexcept { return this->_state; }
157
172 update(IPrepareRendererResources& prepareRendererResources, Tile& tile);
173
177 bool isMoreDetailAvailable() const noexcept;
178
186 IPrepareRendererResources& prepareRendererResources,
187 Tile& tile) noexcept;
188
199 bool loadThrottled() noexcept;
200
231 double maximumScreenSpaceError,
232 CesiumRasterOverlays::ActivatedRasterOverlay& activatedOverlay,
233 Tile& tile,
234 std::vector<CesiumGeospatial::Projection>& missingProjections,
235 const CesiumGeospatial::Ellipsoid& ellipsoid CESIUM_DEFAULT_ELLIPSOID);
236
237private:
238 void computeTranslationAndScale(const Tile& tile);
239
240 CesiumUtility::IntrusivePointer<CesiumRasterOverlays::RasterOverlayTile>
241 _pLoadingTile;
242 CesiumUtility::IntrusivePointer<CesiumRasterOverlays::RasterOverlayTile>
243 _pReadyTile;
244 int32_t _textureCoordinateID;
245 glm::dvec2 _translation;
246 glm::dvec2 _scale;
247 AttachmentState _state;
248 bool _originalFailed;
249};
250
251} // namespace Cesium3DTilesSelection
When implemented for a rendering engine, allows renderer resources to be created and destroyed under ...
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::ActivatedRasterOverlay &activatedOverlay, 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:123
A RasterOverlay that has been activated for use. While a RasterOverlayTileProvider can be used direct...
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.
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.