cesium-native 0.43.0
Loading...
Searching...
No Matches
OctreeTilingScheme.h
1#pragma once
2
3#include "CesiumGeometry/AxisAlignedBox.h"
4#include "CesiumGeometry/Library.h"
5#include "CesiumGeometry/OctreeTileID.h"
6
7#include <glm/vec3.hpp>
8
9#include <optional>
10
11namespace CesiumGeometry {
12
17class CESIUMGEOMETRY_API OctreeTilingScheme {
18public:
32 const AxisAlignedBox& box,
33 uint32_t rootTilesX,
34 uint32_t rootTilesY,
35 uint32_t rootTilesZ) noexcept;
36
40 const AxisAlignedBox& getBox() const noexcept { return this->_box; }
41
45 uint32_t getRootTilesX() const noexcept { return this->_rootTilesX; }
46
50 uint32_t getRootTilesY() const noexcept { return this->_rootTilesY; }
51
55 uint32_t getRootTilesZ() const noexcept { return this->_rootTilesZ; }
56
60 uint32_t getNumberOfXTilesAtLevel(uint32_t level) const noexcept;
61
65 uint32_t getNumberOfYTilesAtLevel(uint32_t level) const noexcept;
66
70 uint32_t getNumberOfZTilesAtLevel(uint32_t level) const noexcept;
71
85 std::optional<CesiumGeometry::OctreeTileID>
86 positionToTile(const glm::dvec3& position, uint32_t level) const noexcept;
87
100 tileToBox(const CesiumGeometry::OctreeTileID& tileID) const noexcept;
101
102private:
103 AxisAlignedBox _box;
104 uint32_t _rootTilesX;
105 uint32_t _rootTilesY;
106 uint32_t _rootTilesZ;
107};
108
109} // namespace CesiumGeometry
Defines how an AxisAlignedBox is divided into octree tiles.
uint32_t getNumberOfXTilesAtLevel(uint32_t level) const noexcept
Returns the number of tiles, in x-direction, at the given level.
const AxisAlignedBox & getBox() const noexcept
Return the overall box that is tiled.
std::optional< CesiumGeometry::OctreeTileID > positionToTile(const glm::dvec3 &position, uint32_t level) const noexcept
Computes the CesiumGeometry::OctreeTileID for a given position and level.
uint32_t getRootTilesX() const noexcept
Returns the number of root tiles, in x-direction.
uint32_t getRootTilesZ() const noexcept
Returns the number of root tiles, in z-direction.
OctreeTilingScheme(const AxisAlignedBox &box, uint32_t rootTilesX, uint32_t rootTilesY, uint32_t rootTilesZ) noexcept
Constructs a new instance.
AxisAlignedBox tileToBox(const CesiumGeometry::OctreeTileID &tileID) const noexcept
Returns the AxisAlignedBox that is covered by the specified tile.
uint32_t getRootTilesY() const noexcept
Returns the number of root tiles, in y-direction.
uint32_t getNumberOfYTilesAtLevel(uint32_t level) const noexcept
Returns the number of tiles, in y-direction, at the given level.
uint32_t getNumberOfZTilesAtLevel(uint32_t level) const noexcept
Returns the number of tiles, in z-direction, at the given level.
Basic geometry classes for Cesium.
An Axis-Aligned Bounding Box (AABB), where the axes of the box are aligned with the axes of the coord...
A structure serving as a unique identifier for a node in an octree.