cesium-native 0.52.0
Loading...
Searching...
No Matches
CesiumRasterOverlays::ActivatedRasterOverlay Class Reference

A RasterOverlay that has been activated for use. While a RasterOverlayTileProvider can be used directly to load images, this class provides additional functionality for managing RasterOverlayTile lifecycle and state. More...

#include <CesiumRasterOverlays/ActivatedRasterOverlay.h>

Inheritance diagram for CesiumRasterOverlays::ActivatedRasterOverlay:
CesiumUtility::ReferenceCounted< T, false >

Public Member Functions

 ActivatedRasterOverlay (const RasterOverlayExternals &externals, const CesiumUtility::IntrusivePointer< const RasterOverlay > &pOverlay, const CesiumGeospatial::Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84) noexcept
 Constructs a new instance.
 
 ~ActivatedRasterOverlay () noexcept
 Destroys the instance. Use addReference and releaseReference instead of destroying this instance directly.
 
CesiumAsync::SharedFuture< void > & getReadyEvent ()
 Gets a shared future that resolves when this instance is ready to provide tiles.
 
const CesiumRasterOverlays::RasterOverlaygetOverlay () const noexcept
 Gets the RasterOverlay that was activated to create this instance.
 
const CesiumRasterOverlays::RasterOverlayTileProvidergetTileProvider () const noexcept
 Gets the tile provider created for this activated overlay. This will be nullptr before getReadyEvent resolves.
 
CesiumRasterOverlays::RasterOverlayTileProvidergetTileProvider () noexcept
 Gets the tile provider created for this activated overlay. This will be nullptr before getReadyEvent resolves.
 
void setTileProvider (const CesiumUtility::IntrusivePointer< RasterOverlayTileProvider > &pTileProvider)
 Sets the tile provider for this activated overlay.
 
const CesiumRasterOverlays::RasterOverlayTileProvidergetPlaceholderTileProvider () const noexcept
 Gets the placeholder tile provider.
 
CesiumRasterOverlays::RasterOverlayTileProvidergetPlaceholderTileProvider () noexcept
 Gets the placeholder tile provider.
 
const CesiumRasterOverlays::RasterOverlayTilegetPlaceholderTile () const noexcept
 Gets the placeholder tile created by the getPlaceholderTileProvider.
 
CesiumRasterOverlays::RasterOverlayTilegetPlaceholderTile () noexcept
 Gets the placeholder tile created by the getPlaceholderTileProvider.
 
CesiumUtility::IntrusivePointer< CesiumRasterOverlays::RasterOverlayTilegetTile (const CesiumGeometry::Rectangle &rectangle, const glm::dvec2 &targetScreenPixels)
 Returns a new RasterOverlayTile with the given specifications.
 
int64_t getTileDataBytes () const noexcept
 Gets the number of bytes of tile data that are currently loaded.
 
uint32_t getNumberOfTilesLoading () const noexcept
 Returns the number of tiles that are currently loading.
 
void removeTile (RasterOverlayTile *pTile) noexcept
 Removes a no-longer-referenced tile from this provider's cache and deletes it.
 
CesiumAsync::Future< TileProviderAndTileloadTile (RasterOverlayTile &tile)
 Loads a tile immediately, without throttling requests.
 
bool loadTileThrottled (RasterOverlayTile &tile)
 Loads a tile, unless there are too many tile loads already in progress.
 
- Public Member Functions inherited from CesiumUtility::ReferenceCounted< T, false >
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.
 
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.
 

Detailed Description

A RasterOverlay that has been activated for use. While a RasterOverlayTileProvider can be used directly to load images, this class provides additional functionality for managing RasterOverlayTile lifecycle and state.

To create an instance of this class, call RasterOverlay::activate.

Definition at line 80 of file ActivatedRasterOverlay.h.

Constructor & Destructor Documentation

◆ ActivatedRasterOverlay()

CesiumRasterOverlays::ActivatedRasterOverlay::ActivatedRasterOverlay ( const RasterOverlayExternals & externals,
const CesiumUtility::IntrusivePointer< const RasterOverlay > & pOverlay,
const CesiumGeospatial::Ellipsoid & ellipsoid = CesiumGeospatial::Ellipsoid::WGS84 )
noexcept

Constructs a new instance.

Consider calling RasterOverlay::activate instead of using the constructor directly.

Parameters
externalsThe external interfaces to use.
pOverlayThe overlay to activate.
ellipsoidThe CesiumGeospatial::Ellipsoid.

Member Function Documentation

◆ getPlaceholderTile()

CesiumRasterOverlays::RasterOverlayTile * CesiumRasterOverlays::ActivatedRasterOverlay::getPlaceholderTile ( )
noexcept

Gets the placeholder tile created by the getPlaceholderTileProvider.

◆ getPlaceholderTileProvider() [1/2]

const CesiumRasterOverlays::RasterOverlayTileProvider * CesiumRasterOverlays::ActivatedRasterOverlay::getPlaceholderTileProvider ( ) const
noexcept

Gets the placeholder tile provider.

The placeholder may be used prior to getReadyEvent resolving, but it will create placeholder tiles only.

◆ getPlaceholderTileProvider() [2/2]

CesiumRasterOverlays::RasterOverlayTileProvider * CesiumRasterOverlays::ActivatedRasterOverlay::getPlaceholderTileProvider ( )
noexcept

Gets the placeholder tile provider.

The placeholder may be used prior to getReadyEvent resolving, but it will create placeholder tiles only.

◆ getReadyEvent()

CesiumAsync::SharedFuture< void > & CesiumRasterOverlays::ActivatedRasterOverlay::getReadyEvent ( )

Gets a shared future that resolves when this instance is ready to provide tiles.

It is safe to call getTile before this future resolves, but the returned tile will be a placeholder.

◆ getTile()

CesiumUtility::IntrusivePointer< CesiumRasterOverlays::RasterOverlayTile > CesiumRasterOverlays::ActivatedRasterOverlay::getTile ( const CesiumGeometry::Rectangle & rectangle,
const glm::dvec2 & targetScreenPixels )

Returns a new RasterOverlayTile with the given specifications.

The returned tile will not start loading immediately. To start loading, call ActivatedRasterOverlay::loadTile or ActivatedRasterOverlay::loadTileThrottled.

Parameters
rectangleThe 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.
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.
Returns
The tile.

◆ getTileProvider()

CesiumRasterOverlays::RasterOverlayTileProvider * CesiumRasterOverlays::ActivatedRasterOverlay::getTileProvider ( )
noexcept

Gets the tile provider created for this activated overlay. This will be nullptr before getReadyEvent resolves.

◆ loadTile()

CesiumAsync::Future< TileProviderAndTile > CesiumRasterOverlays::ActivatedRasterOverlay::loadTile ( RasterOverlayTile & tile)

Loads a tile immediately, without throttling requests.

If the tile is not in the RasterOverlayTile::LoadState::Unloaded state, this method returns without doing anything. Otherwise, it puts the tile into the RasterOverlayTile::LoadState::Loading state and begins the asynchronous process to load the tile. When the process completes, the tile will be in the RasterOverlayTile::LoadState::Loaded or RasterOverlayTile::LoadState::Failed state.

Calling this method on many tiles at once can result in very slow performance. Consider using loadTileThrottled instead.

Parameters
tileThe tile to load.
Returns
A future that, when the tile is loaded, resolves to the loaded tile and the tile provider that loaded it.

◆ loadTileThrottled()

bool CesiumRasterOverlays::ActivatedRasterOverlay::loadTileThrottled ( RasterOverlayTile & tile)

Loads a tile, unless there are too many tile loads already in progress.

If the tile is not in the Tile::LoadState::Unloading state, this method returns true without doing anything. If too many tile loads are already in flight, it returns false without doing anything. Otherwise, it puts the tile into the RasterOverlayTile::LoadState::Loading state, begins the asynchronous process to load the tile, and returns true. When the process completes, the tile will be in the RasterOverlayTile::LoadState::Loaded or RasterOverlayTile::LoadState::Failed state.

The number of allowable simultaneous tile requests is provided in the RasterOverlayOptions::maximumSimultaneousTileLoads property of RasterOverlay::getOptions.

Parameters
tileThe tile to load.
Returns
True if the tile load process is started or is already complete, false if the load could not be started because too many loads are already in progress.

◆ removeTile()

void CesiumRasterOverlays::ActivatedRasterOverlay::removeTile ( RasterOverlayTile * pTile)
noexcept

Removes a no-longer-referenced tile from this provider's cache and deletes it.

This function is not supposed to be called by client. Calling this method on a tile with a reference count greater than 0 will result in undefined behavior.

Parameters
pTileThe tile, which must have no oustanding references.

◆ setTileProvider()

void CesiumRasterOverlays::ActivatedRasterOverlay::setTileProvider ( const CesiumUtility::IntrusivePointer< RasterOverlayTileProvider > & pTileProvider)

Sets the tile provider for this activated overlay.

It is usually unnecessary to call this method because RasterOverlay::activate will call it automatically at the appropriate time.

Calling this method will resolve the getReadyEvent.

Parameters
pTileProviderThe tile provider. This must not be nullptr.

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