cesium-native 0.52.0
|
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>
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::RasterOverlay & | getOverlay () const noexcept |
Gets the RasterOverlay that was activated to create this instance. | |
const CesiumRasterOverlays::RasterOverlayTileProvider * | getTileProvider () const noexcept |
Gets the tile provider created for this activated overlay. This will be nullptr before getReadyEvent resolves. | |
CesiumRasterOverlays::RasterOverlayTileProvider * | getTileProvider () 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::RasterOverlayTileProvider * | getPlaceholderTileProvider () const noexcept |
Gets the placeholder tile provider. | |
CesiumRasterOverlays::RasterOverlayTileProvider * | getPlaceholderTileProvider () noexcept |
Gets the placeholder tile provider. | |
const CesiumRasterOverlays::RasterOverlayTile * | getPlaceholderTile () const noexcept |
Gets the placeholder tile created by the getPlaceholderTileProvider. | |
CesiumRasterOverlays::RasterOverlayTile * | getPlaceholderTile () noexcept |
Gets the placeholder tile created by the getPlaceholderTileProvider. | |
CesiumUtility::IntrusivePointer< CesiumRasterOverlays::RasterOverlayTile > | getTile (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< TileProviderAndTile > | loadTile (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. | |
![]() | |
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. | |
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.
|
noexcept |
Constructs a new instance.
Consider calling RasterOverlay::activate instead of using the constructor directly.
externals | The external interfaces to use. |
pOverlay | The overlay to activate. |
ellipsoid | The CesiumGeospatial::Ellipsoid. |
|
noexcept |
Gets the placeholder tile created by the getPlaceholderTileProvider.
|
noexcept |
Gets the placeholder tile provider.
The placeholder may be used prior to getReadyEvent resolving, but it will create placeholder tiles only.
|
noexcept |
Gets the placeholder tile provider.
The placeholder may be used prior to getReadyEvent resolving, but it will create placeholder tiles only.
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.
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.
rectangle | The 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. |
targetScreenPixels | The 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. |
|
noexcept |
Gets the tile provider created for this activated overlay. This will be nullptr
before getReadyEvent
resolves.
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.
tile | The tile to load. |
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.
tile | The tile to load. |
|
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.
pTile | The tile, which must have no oustanding references. |
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.
pTileProvider | The tile provider. This must not be nullptr . |