cesium-native 0.47.0
Loading...
Searching...
No Matches
TileSelectionState.h
1#pragma once
2
3#include <Cesium3DTilesSelection/Library.h>
4
5#include <cstdint>
6
8
19class TileSelectionState final {
20public:
24 enum class CESIUM3DTILESSELECTION_API Result {
30 None = 0,
31
35 Culled = 1,
36
40 Rendered = 2,
41
46 Refined = 3,
47
56
65 };
66
71 constexpr TileSelectionState() noexcept : _result(Result::None) {}
72
79 constexpr TileSelectionState(Result result) noexcept : _result(result) {}
80
86 constexpr Result getResult() const noexcept { return this->_result; }
87
98 constexpr bool wasKicked() const noexcept {
99 const Result result = this->getResult();
100 return result == Result::RenderedAndKicked ||
101 result == Result::RefinedAndKicked;
102 }
103
111 constexpr Result getOriginalResult() const noexcept {
112 const Result result = this->getResult();
113
114 switch (result) {
116 return Result::Refined;
118 return Result::Rendered;
119 default:
120 return result;
121 }
122 }
123
127 constexpr void kick() noexcept {
128 switch (this->_result) {
129 case Result::Rendered:
130 this->_result = Result::RenderedAndKicked;
131 break;
132 case Result::Refined:
133 this->_result = Result::RefinedAndKicked;
134 break;
135 default:
136 break;
137 }
138 }
139
140private:
141 Result _result;
142};
143
144} // namespace Cesium3DTilesSelection
A description of the selection state of a Tile during the Tileset::updateViewGroup process.
Result
Enumeration of possible results of a TileSelectionState.
@ RenderedAndKicked
This tile was rendered but then removed from the render list.
@ Culled
This tile was deemed not visible and culled.
@ Rendered
The tile was selected for rendering.
@ RefinedAndKicked
This tile was refined but then removed from the render list.
@ Refined
This tile did not meet the required screen-space error and was refined.
constexpr Result getResult() const noexcept
Gets the result of selection.
constexpr void kick() noexcept
Marks this tile as "kicked".
constexpr TileSelectionState() noexcept
Initializes a new instance with TileSelectionState::Result::None.
constexpr Result getOriginalResult() const noexcept
Gets the original selection result prior to being kicked.
constexpr TileSelectionState(Result result) noexcept
Initializes a new instance with a given TileSelectionState::Result.
constexpr bool wasKicked() const noexcept
Determines if this tile or its descendents were kicked from the render list.
Classes that implement the 3D Tiles standard.