cesium-native  0.41.0
CesiumGeometry::QuadtreeAvailability Class Referencefinal

Public Member Functions

 QuadtreeAvailability (uint32_t subtreeLevels, uint32_t maximumLevel) noexcept
 Constructs a new instance. More...
 
uint8_t computeAvailability (const QuadtreeTileID &tileID) const noexcept
 Determines the currently known availability status of the given tile. More...
 
bool addSubtree (const QuadtreeTileID &tileID, AvailabilitySubtree &&newSubtree) noexcept
 Attempts to add an availability subtree into the existing overall availability tree. More...
 
uint8_t computeAvailability (const QuadtreeTileID &tileID, const AvailabilityNode *pNode) const noexcept
 Determines the currently known availability status of the given tile. More...
 
AvailabilityNodeaddNode (const QuadtreeTileID &tileID, AvailabilityNode *pParentNode) noexcept
 Attempts to add a child subtree node onto the given parent node. More...
 
bool addLoadedSubtree (AvailabilityNode *pNode, AvailabilitySubtree &&newSubtree) noexcept
 Attempts to add a loaded subtree onto the given node. More...
 
std::optional< uint32_t > findChildNodeIndex (const QuadtreeTileID &tileID, const AvailabilityNode *pParentNode) const
 Find the child node index corresponding to this tile ID and parent node. More...
 
AvailabilityNodefindChildNode (const QuadtreeTileID &tileID, AvailabilityNode *pParentNode) const
 Find the child node corresponding to this tile ID and parent node. More...
 
constexpr uint32_t getSubtreeLevels () const noexcept
 Gets the number of levels in each subtree.
 
constexpr uint32_t getMaximumLevel () const noexcept
 Gets the index of the maximum level in this implicit tileset.
 
AvailabilityNodegetRootNode () noexcept
 Gets a pointer to the root subtree node of this implicit tileset.
 

Detailed Description

Definition at line 16 of file QuadtreeAvailability.h.

Constructor & Destructor Documentation

◆ QuadtreeAvailability()

CesiumGeometry::QuadtreeAvailability::QuadtreeAvailability ( uint32_t  subtreeLevels,
uint32_t  maximumLevel 
)
noexcept

Constructs a new instance.

Parameters
subtreeLevelsThe number of levels in each subtree.
maximumLevelThe index of the maximum level in this tileset.

Member Function Documentation

◆ addLoadedSubtree()

bool CesiumGeometry::QuadtreeAvailability::addLoadedSubtree ( AvailabilityNode pNode,
AvailabilitySubtree &&  newSubtree 
)
noexcept

Attempts to add a loaded subtree onto the given node.

The node must have been created earlier from a call to addNode.

Parameters
pNodeThe node on which to add the subtree.
newSubtreeThe new subtree to add.
Returns
Whether the insertion was successful.

◆ addNode()

AvailabilityNode* CesiumGeometry::QuadtreeAvailability::addNode ( const QuadtreeTileID tileID,
AvailabilityNode pParentNode 
)
noexcept

Attempts to add a child subtree node onto the given parent node.

Priming with a known parent subtree node avoids the need to traverse the entire availability tree so far. If the parent node is nullptr and the tile ID indicates this is the root tile, the subtree will be attached to the root.

Parameters
tileIDThe root tile's ID of the subtree we are trying to add.
pParentNodeThe parent subtree node. The tileID should fall exactly at the end of this parent subtree.
Returns
The newly created node if the insertion was successful, nullptr otherwise.

◆ addSubtree()

bool CesiumGeometry::QuadtreeAvailability::addSubtree ( const QuadtreeTileID tileID,
AvailabilitySubtree &&  newSubtree 
)
noexcept

Attempts to add an availability subtree into the existing overall availability tree.

Parameters
tileIDThe CesiumGeometry::QuadtreeTileID for the tile.
newSubtreeThe CesiumGeometry::AvailabilitySubtree to add.
Returns
Whether the insertion was successful.

◆ computeAvailability() [1/2]

uint8_t CesiumGeometry::QuadtreeAvailability::computeAvailability ( const QuadtreeTileID tileID) const
noexcept

Determines the currently known availability status of the given tile.

Parameters
tileIDThe CesiumGeometry::QuadtreeTileID for the tile.
Returns
The TileAvailabilityFlags for this tile encoded into a uint8_t.

◆ computeAvailability() [2/2]

uint8_t CesiumGeometry::QuadtreeAvailability::computeAvailability ( const QuadtreeTileID tileID,
const AvailabilityNode pNode 
) const
noexcept

Determines the currently known availability status of the given tile.

Priming with a known parent subtree node avoids the need to traverse the entire availability tree so far. The node must have a loaded subtree

Parameters
tileIDThe tile ID to get the availability for.
pNodeThe subtree node to look for the tileID in. The tileID should be within this subtree node.
Returns
The TileAvailabilityFlags for this tile encoded into a uint8_t.

◆ findChildNode()

AvailabilityNode* CesiumGeometry::QuadtreeAvailability::findChildNode ( const QuadtreeTileID tileID,
AvailabilityNode pParentNode 
) const

Find the child node corresponding to this tile ID and parent node.

Attempts to find the child node for the tile with the given ID and parent node. The parent node is used to speed up the search significantly. Note that if the given tile ID does not correspond exactly to an immediate child node of the parent node, nullptr will be returned. If a tileID outside the given parent node's subtree is given, an incorrect child index may be returned.

Parameters
tileIDThe tile ID of the child node we are looking for.
pParentNodeThe immediate parent to the child node we are looking for.
Returns
The child node if found, nullptr otherwise.

◆ findChildNodeIndex()

std::optional<uint32_t> CesiumGeometry::QuadtreeAvailability::findChildNodeIndex ( const QuadtreeTileID tileID,
const AvailabilityNode pParentNode 
) const

Find the child node index corresponding to this tile ID and parent node.

Attempts to find the child node for the tile with the given ID and parent node. The parent node is used to speed up the search significantly. Note that if the given tile ID does not correspond exactly to an immediate child node of the parent node, nullptr will be returned. If a tileID outside the given parent node's subtree is given, an incorrect child index may be returned.

Parameters
tileIDThe tile ID of the child node we are looking for.
pParentNodeThe immediate parent to the child node we are looking for.
Returns
The child node index if found, std::nullopt otherwise.

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