cesium-native 0.43.0
Loading...
Searching...
No Matches
Cesium3DTilesContent::SubtreeAvailability Class Reference

Supports querying and modifying the various types of availablity information included in a Cesium3DTiles::Subtree. More...

#include <Cesium3DTilesContent/SubtreeAvailability.h>

Classes

struct  SubtreeBufferViewAvailability
 An AvailabilityView that accesses availability information from a bitstream. More...
 
struct  SubtreeConstantAvailability
 An AvailibilityView that indicates that either all tiles are available or all tiles are unavailable. More...
 

Public Types

using AvailabilityView
 A mechanism for accessing availability information. It may be a constant value, or it may be read from a bitstream.
 

Public Member Functions

 SubtreeAvailability (ImplicitTileSubdivisionScheme subdivisionScheme, uint32_t levelsInSubtree, AvailabilityView tileAvailability, AvailabilityView subtreeAvailability, std::vector< AvailabilityView > &&contentAvailability, Cesium3DTiles::Subtree &&subtree)
 Constructs a new instance.
 
bool isTileAvailable (const CesiumGeometry::QuadtreeTileID &subtreeId, const CesiumGeometry::QuadtreeTileID &tileId) const noexcept
 Determines if a given tile in the quadtree is available.
 
bool isTileAvailable (const CesiumGeometry::OctreeTileID &subtreeId, const CesiumGeometry::OctreeTileID &tileId) const noexcept
 Determines if a given tile in the octree is available.
 
bool isTileAvailable (uint32_t relativeTileLevel, uint64_t relativeTileMortonId) const noexcept
 Determines if a given tile in the subtree is available.
 
void setTileAvailable (const CesiumGeometry::QuadtreeTileID &subtreeId, const CesiumGeometry::QuadtreeTileID &tileId, bool isAvailable) noexcept
 Sets the availability state of a given tile in the quadtree.
 
void setTileAvailable (const CesiumGeometry::OctreeTileID &subtreeId, const CesiumGeometry::OctreeTileID &tileId, bool isAvailable) noexcept
 Sets the availability state of a given tile in the octree.
 
void setTileAvailable (uint32_t relativeTileLevel, uint64_t relativeTileMortonId, bool isAvailable) noexcept
 Sets the availability state of a given tile in the subtree.
 
bool isContentAvailable (const CesiumGeometry::QuadtreeTileID &subtreeId, const CesiumGeometry::QuadtreeTileID &tileId, uint64_t contentId) const noexcept
 Determines if content for a given tile in the quadtree is available.
 
bool isContentAvailable (const CesiumGeometry::OctreeTileID &subtreeId, const CesiumGeometry::OctreeTileID &tileId, uint64_t contentId) const noexcept
 Determines if content for a given tile in the octree is available.
 
bool isContentAvailable (uint32_t relativeTileLevel, uint64_t relativeTileMortonId, uint64_t contentId) const noexcept
 Determines if content for a given tile in the subtree is available.
 
void setContentAvailable (const CesiumGeometry::QuadtreeTileID &subtreeId, const CesiumGeometry::QuadtreeTileID &tileId, uint64_t contentId, bool isAvailable) noexcept
 Sets the availability state of the content for a given tile in the quadtree.
 
void setContentAvailable (const CesiumGeometry::OctreeTileID &subtreeId, const CesiumGeometry::OctreeTileID &tileId, uint64_t contentId, bool isAvailable) noexcept
 Sets the availability state of the content for a given tile in the octree.
 
void setContentAvailable (uint32_t relativeTileLevel, uint64_t relativeTileMortonId, uint64_t contentId, bool isAvailable) noexcept
 Sets the availability state of the content for a given tile in the subtree.
 
bool isSubtreeAvailable (const CesiumGeometry::QuadtreeTileID &thisSubtreeID, const CesiumGeometry::QuadtreeTileID &checkSubtreeID) const noexcept
 Determines if the subtree rooted at the given tile is available.
 
bool isSubtreeAvailable (const CesiumGeometry::OctreeTileID &thisSubtreeID, const CesiumGeometry::OctreeTileID &checkSubtreeID) const noexcept
 Determines if the subtree rooted at the given tile is available.
 
bool isSubtreeAvailable (uint64_t relativeSubtreeMortonId) const noexcept
 Determines if the subtree rooted at the given tile is available.
 
void setSubtreeAvailable (const CesiumGeometry::QuadtreeTileID &thisSubtreeID, const CesiumGeometry::QuadtreeTileID &setSubtreeID, bool isAvailable) noexcept
 Sets the availability state of the child quadtree rooted at the given tile.
 
void setSubtreeAvailable (const CesiumGeometry::OctreeTileID &thisSubtreeID, const CesiumGeometry::OctreeTileID &setSubtreeID, bool isAvailable) noexcept
 Sets the availability state of the child octree rooted at the given tile.
 
void setSubtreeAvailable (uint64_t relativeSubtreeMortonId, bool isAvailable) noexcept
 Sets the availability state of the child subtree rooted at the given tile.
 
const Cesium3DTiles::SubtreegetSubtree () const noexcept
 Gets the subtree that this instance queries and modifies.
 

Static Public Member Functions

static std::optional< SubtreeAvailabilityfromSubtree (ImplicitTileSubdivisionScheme subdivisionScheme, uint32_t levelsInSubtree, Cesium3DTiles::Subtree &&subtree) noexcept
 Creates an instance from a Subtree.
 
static std::optional< SubtreeAvailabilitycreateEmpty (ImplicitTileSubdivisionScheme subdivisionScheme, uint32_t levelsInSubtree) noexcept
 Creates an empty instance with all tiles initially available, while all content and subtrees are initially unavailable.
 
static CesiumAsync::Future< std::optional< SubtreeAvailability > > loadSubtree (ImplicitTileSubdivisionScheme subdivisionScheme, uint32_t levelsInSubtree, const CesiumAsync::AsyncSystem &asyncSystem, const std::shared_ptr< CesiumAsync::IAssetAccessor > &pAssetAccessor, const std::shared_ptr< spdlog::logger > &pLogger, const std::string &subtreeUrl, const std::vector< CesiumAsync::IAssetAccessor::THeader > &requestHeaders)
 Asynchronously loads a subtree from a URL. The resource downloaded from the URL may be either a JSON or a binary subtree file.
 

Detailed Description

Supports querying and modifying the various types of availablity information included in a Cesium3DTiles::Subtree.

Definition at line 39 of file SubtreeAvailability.h.

Member Typedef Documentation

◆ AvailabilityView

Initial value:
std::variant<SubtreeConstantAvailability, SubtreeBufferViewAvailability>

A mechanism for accessing availability information. It may be a constant value, or it may be read from a bitstream.

Definition at line 124 of file SubtreeAvailability.h.

Constructor & Destructor Documentation

◆ SubtreeAvailability()

Cesium3DTilesContent::SubtreeAvailability::SubtreeAvailability ( ImplicitTileSubdivisionScheme subdivisionScheme,
uint32_t levelsInSubtree,
AvailabilityView tileAvailability,
AvailabilityView subtreeAvailability,
std::vector< AvailabilityView > && contentAvailability,
Cesium3DTiles::Subtree && subtree )

Constructs a new instance.

Parameters
subdivisionSchemeThe subdivision scheme of the subtree (quadtree or octree).
levelsInSubtreeThe number of levels in this subtree.
tileAvailabilityA view on the tile availability. If backed by a buffer, the buffer is expected to be in subtree.
subtreeAvailabilityA view on the subtree availability. If backed by a buffer, the buffer is expected to be in subtree.
contentAvailabilityA view on the content availability. If backed by a buffer, the buffer is expected to be in subtree.
subtreeThe subtree with which this instance queries and modifies availability information.

Member Function Documentation

◆ createEmpty()

static std::optional< SubtreeAvailability > Cesium3DTilesContent::SubtreeAvailability::createEmpty ( ImplicitTileSubdivisionScheme subdivisionScheme,
uint32_t levelsInSubtree )
staticnoexcept

Creates an empty instance with all tiles initially available, while all content and subtrees are initially unavailable.

Parameters
subdivisionSchemeThe subdivision scheme of the subtree (quadtree or octree).
levelsInSubtreeThe number of levels in this subtree.
Returns
The subtree availability, or std::nullopt if the subtree definition is invalid.

◆ fromSubtree()

static std::optional< SubtreeAvailability > Cesium3DTilesContent::SubtreeAvailability::fromSubtree ( ImplicitTileSubdivisionScheme subdivisionScheme,
uint32_t levelsInSubtree,
Cesium3DTiles::Subtree && subtree )
staticnoexcept

Creates an instance from a Subtree.

Parameters
subdivisionSchemeThe subdivision scheme of the subtree (quadtree or octree).
levelsInSubtreeThe number of levels in this subtree.
subtreeThe subtree.
Returns
The subtree availability, or std::nullopt if the subtree definition is invalid.

◆ getSubtree()

const Cesium3DTiles::Subtree & Cesium3DTilesContent::SubtreeAvailability::getSubtree ( ) const
inlinenoexcept

Gets the subtree that this instance queries and modifies.

Definition at line 409 of file SubtreeAvailability.h.

◆ isContentAvailable() [1/3]

bool Cesium3DTilesContent::SubtreeAvailability::isContentAvailable ( const CesiumGeometry::OctreeTileID & subtreeId,
const CesiumGeometry::OctreeTileID & tileId,
uint64_t contentId ) const
noexcept

Determines if content for a given tile in the octree is available.

Parameters
subtreeIdThe ID of the root tile of the subtree.
tileIdThe ID of the tile to query.
contentIdThe ID of the content to query.
Returns
True if the tile's content is available; otherwise, false.

◆ isContentAvailable() [2/3]

bool Cesium3DTilesContent::SubtreeAvailability::isContentAvailable ( const CesiumGeometry::QuadtreeTileID & subtreeId,
const CesiumGeometry::QuadtreeTileID & tileId,
uint64_t contentId ) const
noexcept

Determines if content for a given tile in the quadtree is available.

Parameters
subtreeIdThe ID of the root tile of the subtree.
tileIdThe ID of the tile to query.
contentIdThe ID of the content to query.
Returns
True if the tile's content is available; otherwise, false.

◆ isContentAvailable() [3/3]

bool Cesium3DTilesContent::SubtreeAvailability::isContentAvailable ( uint32_t relativeTileLevel,
uint64_t relativeTileMortonId,
uint64_t contentId ) const
noexcept

Determines if content for a given tile in the subtree is available.

Parameters
relativeTileLevelThe level of the tile to query, relative to the root of the subtree.
relativeTileMortonIdThe Morton ID of the tile to query. See ImplicitTilingUtilities::computeRelativeMortonIndex.
contentIdThe ID of the content to query.
Returns
True if the tile's content is available; otherwise, false.

◆ isSubtreeAvailable() [1/3]

bool Cesium3DTilesContent::SubtreeAvailability::isSubtreeAvailable ( const CesiumGeometry::OctreeTileID & thisSubtreeID,
const CesiumGeometry::OctreeTileID & checkSubtreeID ) const
noexcept

Determines if the subtree rooted at the given tile is available.

The provided checkSubtreeID must be a child of the leaves of this subtree.

Parameters
thisSubtreeIDThe ID of the root tile of this subtree.
checkSubtreeIDThe ID of the tile to query to see if its subtree is available.
Returns
True if the subtree is available; otherwise, false.

◆ isSubtreeAvailable() [2/3]

bool Cesium3DTilesContent::SubtreeAvailability::isSubtreeAvailable ( const CesiumGeometry::QuadtreeTileID & thisSubtreeID,
const CesiumGeometry::QuadtreeTileID & checkSubtreeID ) const
noexcept

Determines if the subtree rooted at the given tile is available.

The provided checkSubtreeID must be a child of the leaves of this subtree.

Parameters
thisSubtreeIDThe ID of the root tile of this subtree.
checkSubtreeIDThe ID of the tile to query to see if its subtree is available.
Returns
True if the subtree is available; otherwise, false.

◆ isSubtreeAvailable() [3/3]

bool Cesium3DTilesContent::SubtreeAvailability::isSubtreeAvailable ( uint64_t relativeSubtreeMortonId) const
noexcept

Determines if the subtree rooted at the given tile is available.

The provided relativeSubtreeMortonId must refer to a child of the leaves of this subtree.

Parameters
relativeSubtreeMortonIdThe Morton ID of the tile for which to check subtree availability. See ImplicitTilingUtilities::computeRelativeMortonIndex.
Returns
True if the subtree is available; otherwise, false.

◆ isTileAvailable() [1/3]

bool Cesium3DTilesContent::SubtreeAvailability::isTileAvailable ( const CesiumGeometry::OctreeTileID & subtreeId,
const CesiumGeometry::OctreeTileID & tileId ) const
noexcept

Determines if a given tile in the octree is available.

Parameters
subtreeIdThe ID of the root tile of the subtree.
tileIdThe ID of the tile to query.
Returns
True if the tile is available; otherwise, false.

◆ isTileAvailable() [2/3]

bool Cesium3DTilesContent::SubtreeAvailability::isTileAvailable ( const CesiumGeometry::QuadtreeTileID & subtreeId,
const CesiumGeometry::QuadtreeTileID & tileId ) const
noexcept

Determines if a given tile in the quadtree is available.

Parameters
subtreeIdThe ID of the root tile of the subtree.
tileIdThe ID of the tile to query.
Returns
True if the tile is available; otherwise, false.

◆ isTileAvailable() [3/3]

bool Cesium3DTilesContent::SubtreeAvailability::isTileAvailable ( uint32_t relativeTileLevel,
uint64_t relativeTileMortonId ) const
noexcept

Determines if a given tile in the subtree is available.

Parameters
relativeTileLevelThe level of the tile to query, relative to the root of the subtree.
relativeTileMortonIdThe Morton ID of the tile to query. See ImplicitTilingUtilities::computeRelativeMortonIndex.
Returns
True if the tile is available; otherwise, false.

◆ loadSubtree()

static CesiumAsync::Future< std::optional< SubtreeAvailability > > Cesium3DTilesContent::SubtreeAvailability::loadSubtree ( ImplicitTileSubdivisionScheme subdivisionScheme,
uint32_t levelsInSubtree,
const CesiumAsync::AsyncSystem & asyncSystem,
const std::shared_ptr< CesiumAsync::IAssetAccessor > & pAssetAccessor,
const std::shared_ptr< spdlog::logger > & pLogger,
const std::string & subtreeUrl,
const std::vector< CesiumAsync::IAssetAccessor::THeader > & requestHeaders )
static

Asynchronously loads a subtree from a URL. The resource downloaded from the URL may be either a JSON or a binary subtree file.

Parameters
subdivisionSchemeThe subdivision scheme of the subtree (quadtree or octree).
levelsInSubtreeThe number of levels in this subtree.
asyncSystemThe async system with which to do background work.
pAssetAccessorThe asset accessor to use to retrieve the subtree resource from the URL.
pLoggerThe logger to which to load errors and warnings that occur during subtree load.
subtreeUrlThe URL from which to retrieve the subtree file.
requestHeadersHTTP headers to include in the request for the subtree file.
Returns
A future that resolves to a SubtreeAvailability instance for the subtree file, or std::nullopt if something goes wrong.

◆ setContentAvailable() [1/3]

void Cesium3DTilesContent::SubtreeAvailability::setContentAvailable ( const CesiumGeometry::OctreeTileID & subtreeId,
const CesiumGeometry::OctreeTileID & tileId,
uint64_t contentId,
bool isAvailable )
noexcept

Sets the availability state of the content for a given tile in the octree.

Parameters
subtreeIdThe ID of the root tile of the subtree.
tileIdThe ID of the tile for which to set content availability.
contentIdThe ID of the content to query.
isAvailableThe new availability state for the tile's content.

◆ setContentAvailable() [2/3]

void Cesium3DTilesContent::SubtreeAvailability::setContentAvailable ( const CesiumGeometry::QuadtreeTileID & subtreeId,
const CesiumGeometry::QuadtreeTileID & tileId,
uint64_t contentId,
bool isAvailable )
noexcept

Sets the availability state of the content for a given tile in the quadtree.

Parameters
subtreeIdThe ID of the root tile of the subtree.
tileIdThe ID of the tile for which to set content availability.
contentIdThe ID of the content to query.
isAvailableThe new availability state for the tile's content.

◆ setContentAvailable() [3/3]

void Cesium3DTilesContent::SubtreeAvailability::setContentAvailable ( uint32_t relativeTileLevel,
uint64_t relativeTileMortonId,
uint64_t contentId,
bool isAvailable )
noexcept

Sets the availability state of the content for a given tile in the subtree.

Parameters
relativeTileLevelThe level of the tile for which to set content availability, relative to the root of the subtree.
relativeTileMortonIdThe Morton ID of the tile for which to set content availability. See ImplicitTilingUtilities::computeRelativeMortonIndex.
contentIdThe ID of the content to query.
isAvailableThe new availability state for the tile's content.

◆ setSubtreeAvailable() [1/3]

void Cesium3DTilesContent::SubtreeAvailability::setSubtreeAvailable ( const CesiumGeometry::OctreeTileID & thisSubtreeID,
const CesiumGeometry::OctreeTileID & setSubtreeID,
bool isAvailable )
noexcept

Sets the availability state of the child octree rooted at the given tile.

The provided setSubtreeID must be a child of the leaves of this subtree.

Parameters
thisSubtreeIDThe ID of the root tile of this subtree.
setSubtreeIDThe ID of the tile to query to see if its subtree is available.
isAvailableThe new availability state for the subtree.

◆ setSubtreeAvailable() [2/3]

void Cesium3DTilesContent::SubtreeAvailability::setSubtreeAvailable ( const CesiumGeometry::QuadtreeTileID & thisSubtreeID,
const CesiumGeometry::QuadtreeTileID & setSubtreeID,
bool isAvailable )
noexcept

Sets the availability state of the child quadtree rooted at the given tile.

The provided setSubtreeID must be a child of the leaves of this subtree.

Parameters
thisSubtreeIDThe ID of the root tile of this subtree.
setSubtreeIDThe ID of the tile to query to see if its subtree is available.
isAvailableThe new availability state for the subtree.

◆ setSubtreeAvailable() [3/3]

void Cesium3DTilesContent::SubtreeAvailability::setSubtreeAvailable ( uint64_t relativeSubtreeMortonId,
bool isAvailable )
noexcept

Sets the availability state of the child subtree rooted at the given tile.

The provided relativeSubtreeMortonId must refer to a child of the leaves of this subtree.

Parameters
relativeSubtreeMortonIdThe Morton ID of the tile for which to set subtree availability. See ImplicitTilingUtilities::computeRelativeMortonIndex.
isAvailableThe new availability state.

◆ setTileAvailable() [1/3]

void Cesium3DTilesContent::SubtreeAvailability::setTileAvailable ( const CesiumGeometry::OctreeTileID & subtreeId,
const CesiumGeometry::OctreeTileID & tileId,
bool isAvailable )
noexcept

Sets the availability state of a given tile in the octree.

Parameters
subtreeIdThe ID of the root tile of the subtree.
tileIdThe ID of the tile for which to set availability.
isAvailableThe new availability state for the tile.

◆ setTileAvailable() [2/3]

void Cesium3DTilesContent::SubtreeAvailability::setTileAvailable ( const CesiumGeometry::QuadtreeTileID & subtreeId,
const CesiumGeometry::QuadtreeTileID & tileId,
bool isAvailable )
noexcept

Sets the availability state of a given tile in the quadtree.

Parameters
subtreeIdThe ID of the root tile of the subtree.
tileIdThe ID of the tile for which to set availability.
isAvailableThe new availability state for the tile.

◆ setTileAvailable() [3/3]

void Cesium3DTilesContent::SubtreeAvailability::setTileAvailable ( uint32_t relativeTileLevel,
uint64_t relativeTileMortonId,
bool isAvailable )
noexcept

Sets the availability state of a given tile in the subtree.

Parameters
relativeTileLevelThe level of the tile for which to set availability, relative to the root of the subtree.
relativeTileMortonIdThe Morton ID of the tile for which to set availability. See ImplicitTilingUtilities::computeRelativeMortonIndex.
isAvailableThe new availability state of the tile.

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