cesium-native  0.41.0
Cesium3DTilesSelection::RasterMappedTo3DTile Class Referencefinal

The result of applying a RasterOverlayTile to geometry. More...

#include <Cesium3DTilesSelection/RasterMappedTo3DTile.h>

Public Types

enum class  AttachmentState { Unattached = 0 , TemporarilyAttached = 1 , Attached = 2 }
 The states indicating whether the raster tile is attached to the geometry. More...
 

Public Member Functions

 RasterMappedTo3DTile (const CesiumUtility::IntrusivePointer< CesiumRasterOverlays::RasterOverlayTile > &pRasterTile, int32_t textureCoordinateIndex)
 Creates a new instance. More...
 
CesiumRasterOverlays::RasterOverlayTilegetLoadingTile () noexcept
 Returns a RasterOverlayTile that is currently loading. More...
 
const CesiumRasterOverlays::RasterOverlayTilegetLoadingTile () const noexcept
 Returns a RasterOverlayTile that is currently loading. More...
 
CesiumRasterOverlays::RasterOverlayTilegetReadyTile () noexcept
 Returns the RasterOverlayTile that represents the imagery data that is ready to render. More...
 
const CesiumRasterOverlays::RasterOverlayTilegetReadyTile () const noexcept
 Returns the RasterOverlayTile that represents the imagery data that is ready to render. More...
 
int32_t getTextureCoordinateID () const noexcept
 Returns an identifier for the texture coordinates of this tile. More...
 
void setTextureCoordinateID (int32_t textureCoordinateID) noexcept
 Sets the texture coordinate ID. More...
 
const glm::dvec2 & getTranslation () const noexcept
 Returns the translation that converts between the geometry texture coordinates and the texture coordinates that should be used to sample this raster texture. More...
 
const glm::dvec2 & getScale () const noexcept
 Returns the scaling that converts between the geometry texture coordinates and the texture coordinates that should be used to sample this raster texture. More...
 
AttachmentState getState () const noexcept
 Indicates whether this overlay tile is currently attached to its owning geometry tile. More...
 
CesiumRasterOverlays::RasterOverlayTile::MoreDetailAvailable update (IPrepareRendererResources &prepareRendererResources, Tile &tile)
 Update this tile during the update of its owner. More...
 
bool isMoreDetailAvailable () const noexcept
 
void detachFromTile (IPrepareRendererResources &prepareRendererResources, Tile &tile) noexcept
 Detach the raster from the given tile. More...
 
bool loadThrottled () noexcept
 Does a throttled load of the mapped RasterOverlayTile. More...
 

Static Public Member Functions

static RasterMappedTo3DTilemapOverlayToTile (double maximumScreenSpaceError, CesiumRasterOverlays::RasterOverlayTileProvider &tileProvider, CesiumRasterOverlays::RasterOverlayTileProvider &placeholder, Tile &tile, std::vector< CesiumGeospatial::Projection > &missingProjections, const CesiumGeospatial::Ellipsoid &ellipsoid CESIUM_DEFAULT_ELLIPSOID)
 Creates a maping between a RasterOverlay and a Tile. More...
 

Detailed Description

The result of applying a RasterOverlayTile to geometry.

Instances of this class are used by a Tile in order to map imagery data that is given as RasterOverlayTile instances to the 2D region that is covered by the tile geometry.

Definition at line 23 of file RasterMappedTo3DTile.h.

Member Enumeration Documentation

◆ AttachmentState

The states indicating whether the raster tile is attached to the geometry.

Enumerator
Unattached 

This raster tile is not yet attached to the geometry at all.

TemporarilyAttached 

This raster tile is attached to the geometry, but it is a temporary, low-res version usable while the full-res version is loading.

Attached 

This raster tile is attached to the geometry.

Definition at line 29 of file RasterMappedTo3DTile.h.

Constructor & Destructor Documentation

◆ RasterMappedTo3DTile()

Cesium3DTilesSelection::RasterMappedTo3DTile::RasterMappedTo3DTile ( const CesiumUtility::IntrusivePointer< CesiumRasterOverlays::RasterOverlayTile > &  pRasterTile,
int32_t  textureCoordinateIndex 
)

Creates a new instance.

Parameters
pRasterTileThe RasterOverlayTile that is mapped to the geometry.
textureCoordinateIndexThe index of the texture coordinates to use with this mapped raster overlay.

Member Function Documentation

◆ detachFromTile()

void Cesium3DTilesSelection::RasterMappedTo3DTile::detachFromTile ( IPrepareRendererResources prepareRendererResources,
Tile tile 
)
noexcept

Detach the raster from the given tile.

Parameters
prepareRendererResourcesThe IPrepareRendererResources used to detach raster overlay from the tile geometry
tileThe owner tile.

◆ getLoadingTile() [1/2]

const CesiumRasterOverlays::RasterOverlayTile* Cesium3DTilesSelection::RasterMappedTo3DTile::getLoadingTile ( ) const
inlinenoexcept

Returns a RasterOverlayTile that is currently loading.

The caller has to check the exact state of this tile, using Tile::getState.

Returns
The tile that is loading, or nullptr.

Definition at line 74 of file RasterMappedTo3DTile.h.

◆ getLoadingTile() [2/2]

CesiumRasterOverlays::RasterOverlayTile* Cesium3DTilesSelection::RasterMappedTo3DTile::getLoadingTile ( )
inlinenoexcept

Returns a RasterOverlayTile that is currently loading.

The caller has to check the exact state of this tile, using Tile::getState.

Returns
The tile that is loading, or nullptr.

Definition at line 68 of file RasterMappedTo3DTile.h.

◆ getReadyTile() [1/2]

const CesiumRasterOverlays::RasterOverlayTile* Cesium3DTilesSelection::RasterMappedTo3DTile::getReadyTile ( ) const
inlinenoexcept

Returns the RasterOverlayTile that represents the imagery data that is ready to render.

This will be nullptr when the tile data has not yet been loaded.

Returns
The tile, or nullptr.

Definition at line 91 of file RasterMappedTo3DTile.h.

◆ getReadyTile() [2/2]

CesiumRasterOverlays::RasterOverlayTile* Cesium3DTilesSelection::RasterMappedTo3DTile::getReadyTile ( )
inlinenoexcept

Returns the RasterOverlayTile that represents the imagery data that is ready to render.

This will be nullptr when the tile data has not yet been loaded.

Returns
The tile, or nullptr.

Definition at line 86 of file RasterMappedTo3DTile.h.

◆ getScale()

const glm::dvec2& Cesium3DTilesSelection::RasterMappedTo3DTile::getScale ( ) const
inlinenoexcept

Returns the scaling that converts between the geometry texture coordinates and the texture coordinates that should be used to sample this raster texture.

See also
getTranslation
Returns
The scaling.

Definition at line 140 of file RasterMappedTo3DTile.h.

◆ getState()

AttachmentState Cesium3DTilesSelection::RasterMappedTo3DTile::getState ( ) const
inlinenoexcept

Indicates whether this overlay tile is currently attached to its owning geometry tile.

When a raster overlay tile is attached to a geometry tile, IPrepareRendererResources::attachRasterInMainThread is invoked. When it is detached, IPrepareRendererResources::detachRasterInMainThread is invoked.

Definition at line 151 of file RasterMappedTo3DTile.h.

◆ getTextureCoordinateID()

int32_t Cesium3DTilesSelection::RasterMappedTo3DTile::getTextureCoordinateID ( ) const
inlinenoexcept

Returns an identifier for the texture coordinates of this tile.

The texture coordinates for this raster are found in the glTF as an attribute named _CESIUMOVERLAY_n where n is this value.

Returns
The texture coordinate ID.

Definition at line 103 of file RasterMappedTo3DTile.h.

◆ getTranslation()

const glm::dvec2& Cesium3DTilesSelection::RasterMappedTo3DTile::getTranslation ( ) const
inlinenoexcept

Returns the translation that converts between the geometry texture coordinates and the texture coordinates that should be used to sample this raster texture.

rasterCoordinates = geometryCoordinates * scale + translation

Returns
The translation.

Definition at line 127 of file RasterMappedTo3DTile.h.

◆ loadThrottled()

bool Cesium3DTilesSelection::RasterMappedTo3DTile::loadThrottled ( )
noexcept

Does a throttled load of the mapped RasterOverlayTile.

Returns
If the mapped tile is already in the process of loading or it has already finished loading, this method does nothing and returns true. If too many loads are already in progress, this method does nothing and returns false. Otherwise, it begins the asynchronous process to load the tile and returns true.

◆ mapOverlayToTile()

static RasterMappedTo3DTile* Cesium3DTilesSelection::RasterMappedTo3DTile::mapOverlayToTile ( double  maximumScreenSpaceError,
CesiumRasterOverlays::RasterOverlayTileProvider tileProvider,
CesiumRasterOverlays::RasterOverlayTileProvider placeholder,
Tile tile,
std::vector< CesiumGeospatial::Projection > &  missingProjections,
const CesiumGeospatial::Ellipsoid &ellipsoid  CESIUM_DEFAULT_ELLIPSOID 
)
static

Creates a maping between a RasterOverlay and a Tile.

The returned mapping will be to a placeholder RasterOverlayTile if the overlay's tile provider is not yet ready (i.e. it's still a placeholder) or if the overlap between the tile and the raster overlay cannot yet be determined because the projected rectangle of the tile is not yet known.

Returns a pointer to the created RasterMappedTo3DTile in the Tile's Tile::getMappedRasterTiles collection. Note that this pointer may become invalid as soon as another item is added to or removed from this collection.

Parameters
maximumScreenSpaceErrorThe maximum screen space error that is used for the current tile
tileProviderThe overlay tile provider to map to the tile. This may be a placeholder if the tile provider is not yet ready.
placeholderThe placeholder tile provider for this overlay. This is always a placeholder, even if the tile provider is already ready.
tileThe tile to which to map the overlay.
missingProjectionsThe list of projections for which there are not yet any texture coordiantes. On return, the given overlay's Projection may be added to this collection if the Tile does not yet have texture coordinates for the Projection and the Projection is not already in the collection.
Returns
A pointer the created mapping, which may be to a placeholder, or nullptr if no mapping was created at all because the Tile does not overlap the raster overlay.

◆ setTextureCoordinateID()

void Cesium3DTilesSelection::RasterMappedTo3DTile::setTextureCoordinateID ( int32_t  textureCoordinateID)
inlinenoexcept

Sets the texture coordinate ID.

See also
getTextureCoordinateID
Parameters
textureCoordinateIDThe ID.

Definition at line 114 of file RasterMappedTo3DTile.h.

◆ update()

CesiumRasterOverlays::RasterOverlayTile::MoreDetailAvailable Cesium3DTilesSelection::RasterMappedTo3DTile::update ( IPrepareRendererResources prepareRendererResources,
Tile tile 
)

Update this tile during the update of its owner.

This is only supposed to be called by Tile::update. It will return whether there is a more detailed version of the raster data available.

Parameters
prepareRendererResourcesThe IPrepareRendererResources used to create render resources for raster overlay
tileThe owner tile.
Returns
The MoreDetailAvailable state.

The documentation for this class was generated from the following file: