cesium-native  0.41.0
CesiumGeometry::OctreeAvailability Class Referencefinal

Public Member Functions

 OctreeAvailability (uint32_t subtreeLevels, uint32_t maximumLevel) noexcept
 Constructs a new instance. More...
 
uint8_t computeAvailability (const OctreeTileID &tileID) const noexcept
 Determines the currently known availability status of the given tile. More...
 
bool addSubtree (const OctreeTileID &tileID, AvailabilitySubtree &&newSubtree) noexcept
 Attempts to add an availability subtree into the existing overall availability tree. More...
 
uint8_t computeAvailability (const OctreeTileID &tileID, const AvailabilityNode *pNode) const noexcept
 Determines the currently known availability status of the given tile. More...
 
AvailabilityNodeaddNode (const OctreeTileID &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 OctreeTileID &tileID, const AvailabilityNode *pParentNode) const
 Find the child node index corresponding to this tile ID and parent node. More...
 
AvailabilityNodefindChildNode (const OctreeTileID &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 OctreeAvailability.h.

Constructor & Destructor Documentation

◆ OctreeAvailability()

CesiumGeometry::OctreeAvailability::OctreeAvailability ( 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::OctreeAvailability::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::OctreeAvailability::addNode ( const OctreeTileID 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::OctreeAvailability::addSubtree ( const OctreeTileID tileID,
AvailabilitySubtree &&  newSubtree 
)
noexcept

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

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

◆ computeAvailability() [1/2]

uint8_t CesiumGeometry::OctreeAvailability::computeAvailability ( const OctreeTileID tileID) const
noexcept

Determines the currently known availability status of the given tile.

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

◆ computeAvailability() [2/2]

uint8_t CesiumGeometry::OctreeAvailability::computeAvailability ( const OctreeTileID 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::OctreeAvailability::findChildNode ( const OctreeTileID 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::OctreeAvailability::findChildNodeIndex ( const OctreeTileID 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: