cesium-native 0.43.0
Loading...
Searching...
No Matches
QuadtreeTilingScheme.h
1#pragma once
2
3#include "Library.h"
4#include "QuadtreeTileID.h"
5#include "Rectangle.h"
6
7#include <glm/vec2.hpp>
8
9#include <optional>
10
11namespace CesiumGeometry {
12
16class CESIUMGEOMETRY_API QuadtreeTilingScheme final {
17public:
29 const CesiumGeometry::Rectangle& rectangle,
30 uint32_t rootTilesX,
31 uint32_t rootTilesY) noexcept;
32
38 const CesiumGeometry::Rectangle& getRectangle() const noexcept {
39 return this->_rectangle;
40 }
41
45 uint32_t getRootTilesX() const noexcept { return this->_rootTilesX; }
46
50 uint32_t getRootTilesY() const noexcept { return this->_rootTilesY; }
51
55 uint32_t getNumberOfXTilesAtLevel(uint32_t level) const noexcept;
56
60 uint32_t getNumberOfYTilesAtLevel(uint32_t level) const noexcept;
61
75 std::optional<CesiumGeometry::QuadtreeTileID>
76 positionToTile(const glm::dvec2& position, uint32_t level) const noexcept;
77
90 tileToRectangle(const CesiumGeometry::QuadtreeTileID& tileID) const noexcept;
91
92private:
94 uint32_t _rootTilesX;
95 uint32_t _rootTilesY;
96};
97
98} // namespace CesiumGeometry
Defines how a rectangular region is divided into quadtree tiles.
uint32_t getNumberOfYTilesAtLevel(uint32_t level) const noexcept
Returns the number of tiles, in y-direction, at the given level.
uint32_t getRootTilesY() const noexcept
Returns the number of root tiles, in y-direction.
QuadtreeTilingScheme(const CesiumGeometry::Rectangle &rectangle, uint32_t rootTilesX, uint32_t rootTilesY) noexcept
Constructs a new instance.
std::optional< CesiumGeometry::QuadtreeTileID > positionToTile(const glm::dvec2 &position, uint32_t level) const noexcept
Computes the CesiumGeometry::QuadtreeTileID for a given position and level.
uint32_t getRootTilesX() const noexcept
Returns the number of root tiles, in x-direction.
const CesiumGeometry::Rectangle & getRectangle() const noexcept
Return the overall rectangle that is tiled.
uint32_t getNumberOfXTilesAtLevel(uint32_t level) const noexcept
Returns the number of tiles, in x-direction, at the given level.
CesiumGeometry::Rectangle tileToRectangle(const CesiumGeometry::QuadtreeTileID &tileID) const noexcept
Returns the CesiumGeometry::Rectangle that is covered by the specified tile.
Basic geometry classes for Cesium.
Uniquely identifies a node in a quadtree.
A 2D rectangle.
Definition Rectangle.h:14