cesium-native  0.41.0
CesiumGeometry::QuadtreeTilingScheme Class Referencefinal

Defines how a rectangular region is divided into quadtree tiles. More...

#include <CesiumGeometry/QuadtreeTilingScheme.h>

Public Member Functions

 QuadtreeTilingScheme (const CesiumGeometry::Rectangle &rectangle, uint32_t rootTilesX, uint32_t rootTilesY) noexcept
 Constructs a new instance. More...
 
const CesiumGeometry::RectanglegetRectangle () const noexcept
 Return the overall rectangle that is tiled. More...
 
uint32_t getRootTilesX () const noexcept
 Returns the number of root tiles, in x-direction.
 
uint32_t getRootTilesY () const noexcept
 Returns the number of root tiles, in y-direction.
 
uint32_t getNumberOfXTilesAtLevel (uint32_t level) const noexcept
 Returns the number of tiles, in x-direction, at the given level.
 
uint32_t getNumberOfYTilesAtLevel (uint32_t level) const noexcept
 Returns the number of tiles, in y-direction, at the given level.
 
std::optional< CesiumGeometry::QuadtreeTileIDpositionToTile (const glm::dvec2 &position, uint32_t level) const noexcept
 Computes the CesiumGeometry::QuadtreeTileID for a given position and level. More...
 
CesiumGeometry::Rectangle tileToRectangle (const CesiumGeometry::QuadtreeTileID &tileID) const noexcept
 Returns the CesiumGeometry::Rectangle that is covered by the specified tile. More...
 

Detailed Description

Defines how a rectangular region is divided into quadtree tiles.

Definition at line 16 of file QuadtreeTilingScheme.h.

Constructor & Destructor Documentation

◆ QuadtreeTilingScheme()

CesiumGeometry::QuadtreeTilingScheme::QuadtreeTilingScheme ( const CesiumGeometry::Rectangle rectangle,
uint32_t  rootTilesX,
uint32_t  rootTilesY 
)
noexcept

Constructs a new instance.

Parameters
rectangleThe overall rectangle that is tiled, expressed in projected coordinates.
rootTilesXThe number of tiles at the root of the quadtree in the X direction.
rootTilesYThe number of tiles at the root of the quadtree in the Y direction.

Member Function Documentation

◆ getRectangle()

const CesiumGeometry::Rectangle& CesiumGeometry::QuadtreeTilingScheme::getRectangle ( ) const
inlinenoexcept

Return the overall rectangle that is tiled.

The rectangle is expressed in projected coordinates.

Definition at line 38 of file QuadtreeTilingScheme.h.

◆ positionToTile()

std::optional<CesiumGeometry::QuadtreeTileID> CesiumGeometry::QuadtreeTilingScheme::positionToTile ( const glm::dvec2 &  position,
uint32_t  level 
) const
noexcept

Computes the CesiumGeometry::QuadtreeTileID for a given position and level.

If the given position is within the getRectangle of this tiling scheme, then this will compute the quadtree tile ID for the tile that contains the given position at the given level. Otherwise, nullopt is returned.

Parameters
positionThe 2D position
levelThe level
Returns
The tile ID, or nullopt.

◆ tileToRectangle()

CesiumGeometry::Rectangle CesiumGeometry::QuadtreeTilingScheme::tileToRectangle ( const CesiumGeometry::QuadtreeTileID tileID) const
noexcept

Returns the CesiumGeometry::Rectangle that is covered by the specified tile.

The rectangle that is covered by the tile that is identified with the given CesiumGeometry::QuadtreeTileID will be computed, based on the getRectangle of this tiling scheme.

Parameters
tileIDThe tile ID
Returns
The rectangle

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