cesium-native 0.43.0
Loading...
Searching...
No Matches
CesiumRasterOverlays::QuadtreeRasterOverlayTileProvider Class Referenceabstract

A base class used for raster overlay providers that use a quadtree-based tiling scheme. This includes TileMapServiceRasterOverlay, BingMapsRasterOverlay, and WebMapServiceRasterOverlay. More...

#include <CesiumRasterOverlays/QuadtreeRasterOverlayTileProvider.h>

Inheritance diagram for CesiumRasterOverlays::QuadtreeRasterOverlayTileProvider:
CesiumRasterOverlays::RasterOverlayTileProvider CesiumUtility::ReferenceCounted< T, isThreadSafe >

Public Member Functions

 QuadtreeRasterOverlayTileProvider (const CesiumUtility::IntrusivePointer< const RasterOverlay > &pOwner, const CesiumAsync::AsyncSystem &asyncSystem, const std::shared_ptr< CesiumAsync::IAssetAccessor > &pAssetAccessor, std::optional< CesiumUtility::Credit > credit, const std::shared_ptr< IPrepareRasterOverlayRendererResources > &pPrepareRendererResources, const std::shared_ptr< spdlog::logger > &pLogger, const CesiumGeospatial::Projection &projection, const CesiumGeometry::QuadtreeTilingScheme &tilingScheme, const CesiumGeometry::Rectangle &coverageRectangle, uint32_t minimumLevel, uint32_t maximumLevel, uint32_t imageWidth, uint32_t imageHeight) noexcept
 Creates a new instance.
 
uint32_t getMinimumLevel () const noexcept
 Returns the minimum tile level of this instance.
 
uint32_t getMaximumLevel () const noexcept
 Returns the maximum tile level of this instance.
 
uint32_t getWidth () const noexcept
 Returns the image width of this instance, in pixels.
 
uint32_t getHeight () const noexcept
 Returns the image height of this instance, in pixels.
 
const CesiumGeometry::QuadtreeTilingSchemegetTilingScheme () const noexcept
 Returns the CesiumGeometry::QuadtreeTilingScheme of this instance.
 
uint32_t computeLevelFromTargetScreenPixels (const CesiumGeometry::Rectangle &rectangle, const glm::dvec2 &screenPixels)
 Computes the best quadtree level to use for an image intended to cover a given projected rectangle when it is a given size on the screen.
 
- Public Member Functions inherited from CesiumRasterOverlays::RasterOverlayTileProvider
 RasterOverlayTileProvider (const CesiumUtility::IntrusivePointer< const RasterOverlay > &pOwner, const CesiumAsync::AsyncSystem &asyncSystem, const std::shared_ptr< CesiumAsync::IAssetAccessor > &pAssetAccessor, const CesiumGeospatial::Ellipsoid &ellipsoid=CesiumGeospatial::Ellipsoid::WGS84) noexcept
 
 RasterOverlayTileProvider (const CesiumUtility::IntrusivePointer< const RasterOverlay > &pOwner, const CesiumAsync::AsyncSystem &asyncSystem, const std::shared_ptr< CesiumAsync::IAssetAccessor > &pAssetAccessor, std::optional< CesiumUtility::Credit > credit, const std::shared_ptr< IPrepareRasterOverlayRendererResources > &pPrepareRendererResources, const std::shared_ptr< spdlog::logger > &pLogger, const CesiumGeospatial::Projection &projection, const CesiumGeometry::Rectangle &coverageRectangle) noexcept
 Creates a new instance.
 
virtual ~RasterOverlayTileProvider () noexcept
 Default destructor.
 
bool isPlaceholder () const noexcept
 Returns whether this is a placeholder.
 
RasterOverlaygetOwner () noexcept
 Returns the RasterOverlay that created this instance.
 
const RasterOverlaygetOwner () const noexcept
 Returns the RasterOverlay that created this instance.
 
const std::shared_ptr< CesiumAsync::IAssetAccessor > & getAssetAccessor () const noexcept
 Get the system to use for asychronous requests and threaded work.
 
const CesiumAsync::AsyncSystemgetAsyncSystem () const noexcept
 Gets the async system used to do work in threads.
 
const std::shared_ptr< IPrepareRasterOverlayRendererResources > & getPrepareRendererResources () const noexcept
 Gets the interface used to prepare raster overlay images for rendering.
 
const std::shared_ptr< spdlog::logger > & getLogger () const noexcept
 Gets the logger to which to send messages about the tile provider and tiles.
 
const CesiumGeospatial::ProjectiongetProjection () const noexcept
 Returns the CesiumGeospatial::Projection of this instance.
 
const CesiumGeometry::RectanglegetCoverageRectangle () const noexcept
 Returns the coverage CesiumGeometry::Rectangle of this instance.
 
CesiumUtility::IntrusivePointer< 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.
 
const std::optional< CesiumUtility::Credit > & getCredit () const noexcept
 Get the per-TileProvider CesiumUtility::Credit if one exists.
 
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, 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.
 

Protected Member Functions

virtual CesiumAsync::Future< LoadedRasterOverlayImageloadQuadtreeTileImage (const CesiumGeometry::QuadtreeTileID &tileID) const =0
 Asynchronously loads a tile in the quadtree.
 
- Protected Member Functions inherited from CesiumRasterOverlays::RasterOverlayTileProvider
CesiumAsync::Future< LoadedRasterOverlayImageloadTileImageFromUrl (const std::string &url, const std::vector< CesiumAsync::IAssetAccessor::THeader > &headers={}, LoadTileImageFromUrlOptions &&options={}) const
 Loads an image from a URL and optionally some request headers.
 

Detailed Description

A base class used for raster overlay providers that use a quadtree-based tiling scheme. This includes TileMapServiceRasterOverlay, BingMapsRasterOverlay, and WebMapServiceRasterOverlay.

To implement a new raster overlay provider based on QuadtreeRasterOverlayTileProvider, use this as the base class and override loadQuadtreeTileImage with code that makes requests to your service.

Definition at line 32 of file QuadtreeRasterOverlayTileProvider.h.

Constructor & Destructor Documentation

◆ QuadtreeRasterOverlayTileProvider()

CesiumRasterOverlays::QuadtreeRasterOverlayTileProvider::QuadtreeRasterOverlayTileProvider ( const CesiumUtility::IntrusivePointer< const RasterOverlay > & pOwner,
const CesiumAsync::AsyncSystem & asyncSystem,
const std::shared_ptr< CesiumAsync::IAssetAccessor > & pAssetAccessor,
std::optional< CesiumUtility::Credit > credit,
const std::shared_ptr< IPrepareRasterOverlayRendererResources > & pPrepareRendererResources,
const std::shared_ptr< spdlog::logger > & pLogger,
const CesiumGeospatial::Projection & projection,
const CesiumGeometry::QuadtreeTilingScheme & tilingScheme,
const CesiumGeometry::Rectangle & coverageRectangle,
uint32_t minimumLevel,
uint32_t maximumLevel,
uint32_t imageWidth,
uint32_t imageHeight )
noexcept

Creates a new instance.

Parameters
pOwnerThe raster overlay that created this tile provider.
asyncSystemThe async system used to do work in threads.
pAssetAccessorThe interface used to obtain assets (tiles, etc.) for this raster overlay.
creditThe CesiumUtility::Credit for this tile provider, if it exists.
pPrepareRendererResourcesThe interface used to prepare raster images for rendering.
pLoggerThe logger to which to send messages about the tile provider and tiles.
projectionThe CesiumGeospatial::Projection.
tilingSchemeThe tiling scheme to be used by this QuadtreeRasterOverlayTileProvider.
coverageRectangleThe CesiumGeometry::Rectangle.
minimumLevelThe minimum quadtree tile level.
maximumLevelThe maximum quadtree tile level.
imageWidthThe image width.
imageHeightThe image height.

Member Function Documentation

◆ computeLevelFromTargetScreenPixels()

uint32_t CesiumRasterOverlays::QuadtreeRasterOverlayTileProvider::computeLevelFromTargetScreenPixels ( const CesiumGeometry::Rectangle & rectangle,
const glm::dvec2 & screenPixels )

Computes the best quadtree level to use for an image intended to cover a given projected rectangle when it is a given size on the screen.

Parameters
rectangleThe range of projected coordinates to cover.
screenPixelsThe number of screen pixels to be covered by the rectangle.
Returns
The level.

◆ getHeight()

uint32_t CesiumRasterOverlays::QuadtreeRasterOverlayTileProvider::getHeight ( ) const
inlinenoexcept

Returns the image height of this instance, in pixels.

Definition at line 90 of file QuadtreeRasterOverlayTileProvider.h.

◆ getMaximumLevel()

uint32_t CesiumRasterOverlays::QuadtreeRasterOverlayTileProvider::getMaximumLevel ( ) const
inlinenoexcept

Returns the maximum tile level of this instance.

Definition at line 80 of file QuadtreeRasterOverlayTileProvider.h.

◆ getMinimumLevel()

uint32_t CesiumRasterOverlays::QuadtreeRasterOverlayTileProvider::getMinimumLevel ( ) const
inlinenoexcept

Returns the minimum tile level of this instance.

Definition at line 75 of file QuadtreeRasterOverlayTileProvider.h.

◆ getTilingScheme()

const CesiumGeometry::QuadtreeTilingScheme & CesiumRasterOverlays::QuadtreeRasterOverlayTileProvider::getTilingScheme ( ) const
inlinenoexcept

Returns the CesiumGeometry::QuadtreeTilingScheme of this instance.

Definition at line 96 of file QuadtreeRasterOverlayTileProvider.h.

◆ getWidth()

uint32_t CesiumRasterOverlays::QuadtreeRasterOverlayTileProvider::getWidth ( ) const
inlinenoexcept

Returns the image width of this instance, in pixels.

Definition at line 85 of file QuadtreeRasterOverlayTileProvider.h.

◆ loadQuadtreeTileImage()

virtual CesiumAsync::Future< LoadedRasterOverlayImage > CesiumRasterOverlays::QuadtreeRasterOverlayTileProvider::loadQuadtreeTileImage ( const CesiumGeometry::QuadtreeTileID & tileID) const
protectedpure virtual

Asynchronously loads a tile in the quadtree.

Parameters
tileIDThe ID of the quadtree tile to load.
Returns
A Future that resolves to the loaded image data or error information.

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