cesium-native  0.41.0
OctreeTileID.h
1 #pragma once
2 
3 #include "Library.h"
4 
5 #include <cstdint>
6 
7 namespace CesiumGeometry {
8 
18 struct CESIUMGEOMETRY_API OctreeTileID {
19 
23  constexpr OctreeTileID() : level(0), x(0), y(0), z(0){};
24 
33  constexpr OctreeTileID(
34  uint32_t level,
35  uint32_t x,
36  uint32_t y,
37  uint32_t z) noexcept
38  : level(level), x(x), y(y), z(z) {}
39 
43  constexpr bool operator==(const OctreeTileID& other) const noexcept {
44  return this->level == other.level && this->x == other.x &&
45  this->y == other.y && this->z == other.z;
46  }
47 
51  constexpr bool operator!=(const OctreeTileID& other) const noexcept {
52  return !(*this == other);
53  }
54 
58  uint32_t level;
59 
63  uint32_t x;
64 
68  uint32_t y;
69 
73  uint32_t z;
74 };
75 
76 } // namespace CesiumGeometry
Basic geometry classes for Cesium.
A structure serving as a unique identifier for a node in an octree.
Definition: OctreeTileID.h:18
uint32_t x
The x-coordinate of this tile ID.
Definition: OctreeTileID.h:63
constexpr OctreeTileID(uint32_t level, uint32_t x, uint32_t y, uint32_t z) noexcept
Creates a new instance.
Definition: OctreeTileID.h:33
uint32_t level
The level of this tile ID, with 0 being the root tile.
Definition: OctreeTileID.h:58
uint32_t z
The z-coordinate of this tile ID.
Definition: OctreeTileID.h:73
constexpr OctreeTileID()
Creates a new instance.
Definition: OctreeTileID.h:23
uint32_t y
The y-coordinate of this tile ID.
Definition: OctreeTileID.h:68
constexpr bool operator!=(const OctreeTileID &other) const noexcept
Returns true if two identifiers are not equal.
Definition: OctreeTileID.h:51
constexpr bool operator==(const OctreeTileID &other) const noexcept
Returns true if two identifiers are equal.
Definition: OctreeTileID.h:43