cesium-native  0.41.0
CesiumRasterOverlays::RasterOverlayTile Class Referencefinal

Raster image data for a tile in a quadtree. More...

#include <CesiumRasterOverlays/RasterOverlayTile.h>

Inheritance diagram for CesiumRasterOverlays::RasterOverlayTile:
CesiumUtility::ReferenceCounted< T, isThreadSafe > CesiumUtility::ThreadIdHolder< true >

Public Types

enum class  LoadState {
  Placeholder = -2 , Failed = -1 , Unloaded = 0 , Loading = 1 ,
  Loaded = 2 , Done = 3
}
 Lifecycle states of a raster overlay tile. More...
 
enum class  MoreDetailAvailable { No = 0 , Yes = 1 , Unknown = 2 }
 Tile availability states. More...
 

Public Member Functions

 RasterOverlayTile (RasterOverlayTileProvider &tileProvider) noexcept
 Constructs a placeholder tile for the tile provider. More...
 
 RasterOverlayTile (RasterOverlayTileProvider &tileProvider, const glm::dvec2 &targetScreenPixels, const CesiumGeometry::Rectangle &imageryRectangle) noexcept
 Creates a new instance. More...
 
 ~RasterOverlayTile ()
 Default destructor.
 
RasterOverlayTileProvidergetTileProvider () noexcept
 Returns the RasterOverlayTileProvider that created this instance.
 
const RasterOverlayTileProvidergetTileProvider () const noexcept
 Returns the RasterOverlayTileProvider that created this instance.
 
RasterOverlaygetOverlay () noexcept
 Returns the RasterOverlay that created this instance.
 
const RasterOverlaygetOverlay () const noexcept
 Returns the RasterOverlay that created this instance.
 
const CesiumGeometry::RectanglegetRectangle () const noexcept
 Returns the CesiumGeometry::Rectangle that defines the bounds of this tile in the raster overlay's projected coordinates.
 
glm::dvec2 getTargetScreenPixels () const noexcept
 Gets the number of screen pixels in each direction that should be covered by this tile's texture. More...
 
LoadState getState () const noexcept
 Returns the current LoadState.
 
const std::vector< CesiumUtility::Credit > & getCredits () const noexcept
 Returns the list of Credits needed for this tile.
 
CesiumUtility::IntrusivePointer< const CesiumGltf::ImageAssetgetImage () const noexcept
 Returns the image data for the tile. More...
 
CesiumUtility::IntrusivePointer< CesiumGltf::ImageAssetgetImage () noexcept
 Returns the image data for the tile. More...
 
void loadInMainThread ()
 Create the renderer resources for the loaded image. More...
 
void * getRendererResources () const noexcept
 Returns the renderer resources that have been created for this tile.
 
void setRendererResources (void *pValue) noexcept
 Set the renderer resources for this tile. More...
 
MoreDetailAvailable isMoreDetailAvailable () const noexcept
 Determines if more detailed data is available for the spatial area covered by this tile.
 
- Public Member Functions inherited from CesiumUtility::ReferenceCounted< T, isThreadSafe >
void addReference () const
 Adds a counted reference to this object. Use CesiumUtility::IntrusivePointer instead of calling this method directly.
 
void releaseReference () const
 Removes a counted reference from this object. When the last reference is removed, this method will delete this instance. Use CesiumUtility::IntrusivePointer instead of calling this method directly.
 
std::int32_t getReferenceCount () const noexcept
 Returns the current reference count of this instance.
 

Friends

class RasterOverlayTileProvider
 

Detailed Description

Raster image data for a tile in a quadtree.

Instances of this clas represent tiles of a quadtree that have an associated image, which us used as an imagery overlay for tile geometry. The connection between the imagery data and the actual tile geometry is established via the RasterMappedTo3DTile class, which combines a raster overlay tile with texture coordinates, to map the image on the geometry of a Tile.

Definition at line 32 of file RasterOverlayTile.h.

Member Enumeration Documentation

◆ LoadState

Lifecycle states of a raster overlay tile.

Enumerator
Placeholder 

Indicator for a placeholder tile.

Failed 

The image request or image creation failed.

Unloaded 

The initial state.

Loading 

The request for loading the image data is still pending.

Loaded 

The image data has been loaded and the image has been created.

Done 

The rendering resources for the image data have been created.

Definition at line 38 of file RasterOverlayTile.h.

◆ MoreDetailAvailable

Tile availability states.

Values of this enumeration are returned by RasterOverlayTile::update, which in turn is called by Tile::update. These values are used to determine whether a leaf tile has been reached, but the associated raster tiles are not yet the most detailed ones that are available.

Enumerator
No 

There are no more detailed raster tiles.

Yes 

There are more detailed raster tiles.

Unknown 

It is not known whether more detailed raster tiles are available.

Definition at line 79 of file RasterOverlayTile.h.

Constructor & Destructor Documentation

◆ RasterOverlayTile() [1/2]

CesiumRasterOverlays::RasterOverlayTile::RasterOverlayTile ( RasterOverlayTileProvider tileProvider)
noexcept

Constructs a placeholder tile for the tile provider.

The getState of this instance will always be LoadState::Placeholder.

Parameters
tileProviderThe RasterOverlayTileProvider. This object must remain valid for the entire lifetime of the tile. If the tile provider is destroyed before the tile, undefined behavior will result.

◆ RasterOverlayTile() [2/2]

CesiumRasterOverlays::RasterOverlayTile::RasterOverlayTile ( RasterOverlayTileProvider tileProvider,
const glm::dvec2 &  targetScreenPixels,
const CesiumGeometry::Rectangle imageryRectangle 
)
noexcept

Creates a new instance.

The tile will start in the Unloaded state, and will not begin loading until RasterOverlayTileProvider::loadTile or RasterOverlayTileProvider::loadTileThrottled is called.

Parameters
tileProviderThe RasterOverlayTileProvider. This object must remain valid for the entire lifetime of the tile. If the tile provider is destroyed before the tile, undefined behavior may result.
targetScreenPixelsThe maximum number of pixels on the screen that this tile is meant to cover. The overlay image should be approximately this many pixels divided by the RasterOverlayOptions::maximumScreenSpaceError in order to achieve the desired level-of-detail, but it does not need to be exactly this size.
imageryRectangleThe rectangle that the returned image must cover. It is allowed to cover a slightly larger rectangle in order to maintain pixel alignment. It may also cover a smaller rectangle when the overlay itself does not cover the entire rectangle.

Member Function Documentation

◆ getImage() [1/2]

CesiumUtility::IntrusivePointer<const CesiumGltf::ImageAsset> CesiumRasterOverlays::RasterOverlayTile::getImage ( ) const
inlinenoexcept

Returns the image data for the tile.

This will only contain valid image data if the getState of this tile is Loaded or Done.

Returns
The image data.

Definition at line 196 of file RasterOverlayTile.h.

◆ getImage() [2/2]

CesiumUtility::IntrusivePointer<CesiumGltf::ImageAsset> CesiumRasterOverlays::RasterOverlayTile::getImage ( )
inlinenoexcept

Returns the image data for the tile.

This will only contain valid image data if the getState of this tile is Loaded or Done.

Returns
The image data.

Definition at line 208 of file RasterOverlayTile.h.

◆ getTargetScreenPixels()

glm::dvec2 CesiumRasterOverlays::RasterOverlayTile::getTargetScreenPixels ( ) const
inlinenoexcept

Gets the number of screen pixels in each direction that should be covered by this tile's texture.

This is used to control which content (how highly detailed) the RasterOverlayTileProvider uses within the bounds of this tile.

Definition at line 171 of file RasterOverlayTile.h.

◆ loadInMainThread()

void CesiumRasterOverlays::RasterOverlayTile::loadInMainThread ( )

Create the renderer resources for the loaded image.

If the getState of this tile is not Loaded, then nothing will be done. Otherwise, the renderer resources will be prepared, so that they may later be obtained with getRendererResources, and the getState of this tile will change to Done.

◆ setRendererResources()

void CesiumRasterOverlays::RasterOverlayTile::setRendererResources ( void *  pValue)
inlinenoexcept

Set the renderer resources for this tile.

This function is not supposed to be called by clients.

Definition at line 235 of file RasterOverlayTile.h.


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