cesium-native 0.43.0
Loading...
Searching...
No Matches
Cesium3DTilesSelection::Tile Class Referencefinal

A tile in a Tileset. More...

#include <Cesium3DTilesSelection/Tile.h>

Public Types

typedef CesiumUtility::DoublyLinkedList< Tile, &Tile::_loadedTilesLinks > LoadedLinkedList
 A CesiumUtility::DoublyLinkedList for tile objects.
 

Public Member Functions

 Tile (TilesetContentLoader *pLoader) noexcept
 Construct a tile with unknown content and a loader that is used to load the content of this tile. Tile has Unloaded status when initializing with this constructor.
 
 Tile (TilesetContentLoader *pLoader, std::unique_ptr< TileExternalContent > &&externalContent) noexcept
 Construct a tile with an external content and a loader that is associated with this tile. Tile has ContentLoaded status when initializing with this constructor.
 
 Tile (TilesetContentLoader *pLoader, TileEmptyContent emptyContent) noexcept
 Construct a tile with an empty content and a loader that is associated with this tile. Tile has ContentLoaded status when initializing with this constructor.
 
 ~Tile () noexcept=default
 Default destructor, which clears all resources associated with this tile.
 
 Tile (const Tile &rhs)=delete
 Copy constructor.
 
 Tile (Tile &&rhs) noexcept
 Move constructor.
 
Tileoperator= (const Tile &rhs)=delete
 Copy constructor.
 
Tileoperator= (Tile &&rhs) noexcept
 Move assignment operator.
 
TilegetParent () noexcept
 Returns the parent of this tile in the tile hierarchy.
 
const TilegetParent () const noexcept
 Returns the parent of this tile in the tile hierarchy.
 
std::span< TilegetChildren () noexcept
 Returns a view on the children of this tile.
 
std::span< const TilegetChildren () const noexcept
 Returns a view on the children of this tile.
 
void createChildTiles (std::vector< Tile > &&children)
 Assigns the given child tiles to this tile.
 
const BoundingVolumegetBoundingVolume () const noexcept
 Returns the BoundingVolume of this tile.
 
void setBoundingVolume (const BoundingVolume &value) noexcept
 Set the BoundingVolume of this tile.
 
const std::optional< BoundingVolume > & getViewerRequestVolume () const noexcept
 Returns the viewer request volume of this tile.
 
void setViewerRequestVolume (const std::optional< BoundingVolume > &value) noexcept
 Set the viewer request volume of this tile.
 
double getGeometricError () const noexcept
 Returns the geometric error of this tile.
 
void setGeometricError (double value) noexcept
 Set the geometric error of the contents of this tile.
 
double getNonZeroGeometricError () const noexcept
 Gets the tile's geometric error as if by calling getGeometricError, except that if the error is smaller than CesiumUtility::Math::Epsilon5 the returned geometric error is instead computed as half of the parent tile's (non-zero) geometric error.
 
bool getUnconditionallyRefine () const noexcept
 Returns whether to unconditionally refine this tile.
 
void setUnconditionallyRefine () noexcept
 Marks that this tile should be unconditionally refined.
 
TileRefine getRefine () const noexcept
 The refinement strategy of this tile.
 
void setRefine (TileRefine value) noexcept
 Set the refinement strategy of this tile.
 
const glm::dmat4x4 & getTransform () const noexcept
 Gets the transformation matrix for this tile.
 
void setTransform (const glm::dmat4x4 &value) noexcept
 Set the transformation matrix for this tile.
 
const TileIDgetTileID () const noexcept
 Returns the TileID of this tile.
 
void setTileID (const TileID &id) noexcept
 Set the TileID of this tile.
 
const std::optional< BoundingVolume > & getContentBoundingVolume () const noexcept
 Returns the BoundingVolume of the renderable content of this tile.
 
void setContentBoundingVolume (const std::optional< BoundingVolume > &value) noexcept
 Set the BoundingVolume of the renderable content of this tile.
 
TileSelectionStategetLastSelectionState () noexcept
 Returns the TileSelectionState of this tile.
 
const TileSelectionStategetLastSelectionState () const noexcept
 Returns the TileSelectionState of this tile.
 
void setLastSelectionState (const TileSelectionState &newState) noexcept
 Set the TileSelectionState of this tile.
 
int64_t computeByteSize () const noexcept
 Determines the number of bytes in this tile's geometry and texture data.
 
std::vector< RasterMappedTo3DTile > & getMappedRasterTiles () noexcept
 Returns the raster overlay tiles that have been mapped to this tile.
 
const std::vector< RasterMappedTo3DTile > & getMappedRasterTiles () const noexcept
 Returns the raster overlay tiles that have been mapped to this tile.
 
const TileContentgetContent () const noexcept
 Get the content of the tile.
 
TileContentgetContent () noexcept
 Get the content of the tile.
 
bool isRenderable () const noexcept
 Determines if this tile is currently renderable.
 
bool isRenderContent () const noexcept
 Determines if this tile has mesh content.
 
bool isExternalContent () const noexcept
 Determines if this tile has external tileset content.
 
bool isEmptyContent () const noexcept
 Determines if this tile has empty content.
 
TilesetContentLoadergetLoader () const noexcept
 get the loader that is used to load the tile content.
 
TileLoadState getState () const noexcept
 Returns the TileLoadState of this tile.
 

Friends

class TilesetContentManager
 
class MockTilesetContentManagerTestFixture
 

Detailed Description

A tile in a Tileset.

The tiles of a tileset form a hierarchy, where each tile may contain renderable content, and each tile has an associated bounding volume.

The actual hierarchy is represented with the Tile::getParent and Tile::getChildren functions.

The renderable content is provided as a TileContent from the Tile::getContent function. The Tile::getGeometricError function returns the geometric error of the representation of the renderable content of a tile.

The BoundingVolume is given by the Tile::getBoundingVolume function. This bounding volume encloses the renderable content of the tile itself, as well as the renderable content of all children, yielding a spatially coherent hierarchy of bounding volumes.

The bounding volume of the content of an individual tile is given by the Tile::getContentBoundingVolume function.

Definition at line 97 of file Tile.h.

Member Typedef Documentation

◆ LoadedLinkedList

A CesiumUtility::DoublyLinkedList for tile objects.

Definition at line 560 of file Tile.h.

Constructor & Destructor Documentation

◆ Tile() [1/5]

Cesium3DTilesSelection::Tile::Tile ( TilesetContentLoader * pLoader)
explicitnoexcept

Construct a tile with unknown content and a loader that is used to load the content of this tile. Tile has Unloaded status when initializing with this constructor.

Parameters
pLoaderThe TilesetContentLoader that is used to load the tile.

◆ Tile() [2/5]

Cesium3DTilesSelection::Tile::Tile ( TilesetContentLoader * pLoader,
std::unique_ptr< TileExternalContent > && externalContent )
noexcept

Construct a tile with an external content and a loader that is associated with this tile. Tile has ContentLoaded status when initializing with this constructor.

Parameters
pLoaderThe TilesetContentLoader that is assiocated with this tile.
externalContentExternal content that is associated with this tile.

◆ Tile() [3/5]

Cesium3DTilesSelection::Tile::Tile ( TilesetContentLoader * pLoader,
TileEmptyContent emptyContent )
noexcept

Construct a tile with an empty content and a loader that is associated with this tile. Tile has ContentLoaded status when initializing with this constructor.

Parameters
pLoaderThe TilesetContentLoader that is assiocated with this tile.
emptyContentA content tag indicating that the tile has no content.

◆ Tile() [4/5]

Cesium3DTilesSelection::Tile::Tile ( const Tile & rhs)
delete

Copy constructor.

Parameters
rhsThe other instance.

◆ Tile() [5/5]

Cesium3DTilesSelection::Tile::Tile ( Tile && rhs)
noexcept

Move constructor.

Parameters
rhsThe other instance.

Member Function Documentation

◆ createChildTiles()

void Cesium3DTilesSelection::Tile::createChildTiles ( std::vector< Tile > && children)

Assigns the given child tiles to this tile.

This function is not supposed to be called by clients.

Parameters
childrenThe child tiles.
Exceptions
`std::runtime_error`if this tile already has children.

◆ getBoundingVolume()

const BoundingVolume & Cesium3DTilesSelection::Tile::getBoundingVolume ( ) const
inlinenoexcept

Returns the BoundingVolume of this tile.

This is a bounding volume that encloses the content of this tile, as well as the content of all child tiles.

See also
Tile::getContentBoundingVolume
Returns
The bounding volume.

Definition at line 212 of file Tile.h.

◆ getChildren() [1/2]

std::span< const Tile > Cesium3DTilesSelection::Tile::getChildren ( ) const
inlinenoexcept

Returns a view on the children of this tile.

The returned span will become invalid when this tile is destroyed.

Returns
The children of this tile.

Definition at line 188 of file Tile.h.

◆ getChildren() [2/2]

std::span< Tile > Cesium3DTilesSelection::Tile::getChildren ( )
inlinenoexcept

Returns a view on the children of this tile.

The returned span will become invalid when this tile is destroyed.

Returns
The children of this tile.

Definition at line 183 of file Tile.h.

◆ getContent() [1/2]

const TileContent & Cesium3DTilesSelection::Tile::getContent ( ) const
inlinenoexcept

Get the content of the tile.

Definition at line 454 of file Tile.h.

◆ getContent() [2/2]

TileContent & Cesium3DTilesSelection::Tile::getContent ( )
inlinenoexcept

Get the content of the tile.

Definition at line 457 of file Tile.h.

◆ getContentBoundingVolume()

const std::optional< BoundingVolume > & Cesium3DTilesSelection::Tile::getContentBoundingVolume ( ) const
inlinenoexcept

Returns the BoundingVolume of the renderable content of this tile.

The content bounding volume is a bounding volume that tightly fits only the renderable content of the tile. This enables tighter view frustum culling, making it possible to exclude from rendering any content not in the view frustum.

See also
Tile::getBoundingVolume

Definition at line 388 of file Tile.h.

◆ getGeometricError()

double Cesium3DTilesSelection::Tile::getGeometricError ( ) const
inlinenoexcept

Returns the geometric error of this tile.

This is the error, in meters, introduced if this tile is rendered and its children are not. This is used to compute screen space error, i.e., the error measured in pixels.

Returns
The geometric error of this tile, in meters.

Definition at line 263 of file Tile.h.

◆ getLastSelectionState() [1/2]

const TileSelectionState & Cesium3DTilesSelection::Tile::getLastSelectionState ( ) const
inlinenoexcept

Returns the TileSelectionState of this tile.

This function is not supposed to be called by clients.

Returns
The last selection state

Definition at line 417 of file Tile.h.

◆ getLastSelectionState() [2/2]

TileSelectionState & Cesium3DTilesSelection::Tile::getLastSelectionState ( )
inlinenoexcept

Returns the TileSelectionState of this tile.

This function is not supposed to be called by clients.

Returns
The last selection state

Definition at line 412 of file Tile.h.

◆ getMappedRasterTiles() [1/2]

const std::vector< RasterMappedTo3DTile > & Cesium3DTilesSelection::Tile::getMappedRasterTiles ( ) const
inlinenoexcept

Returns the raster overlay tiles that have been mapped to this tile.

Definition at line 447 of file Tile.h.

◆ getMappedRasterTiles() [2/2]

std::vector< RasterMappedTo3DTile > & Cesium3DTilesSelection::Tile::getMappedRasterTiles ( )
inlinenoexcept

Returns the raster overlay tiles that have been mapped to this tile.

Definition at line 441 of file Tile.h.

◆ getNonZeroGeometricError()

double Cesium3DTilesSelection::Tile::getNonZeroGeometricError ( ) const
noexcept

Gets the tile's geometric error as if by calling getGeometricError, except that if the error is smaller than CesiumUtility::Math::Epsilon5 the returned geometric error is instead computed as half of the parent tile's (non-zero) geometric error.

This is useful for determining when to refine what would ordinarily be a leaf tile, for example to attach more detailed raster overlays to it.

If this tile and all of its ancestors have a geometric error less than CesiumUtility::Math::Epsilon5, returns CesiumUtility::Math::Epsilon5.

Returns
The non-zero geometric error.

◆ getParent() [1/2]

const Tile * Cesium3DTilesSelection::Tile::getParent ( ) const
inlinenoexcept

Returns the parent of this tile in the tile hierarchy.

This will be the nullptr if this is the root tile.

Returns
The parent.

Definition at line 174 of file Tile.h.

◆ getParent() [2/2]

Tile * Cesium3DTilesSelection::Tile::getParent ( )
inlinenoexcept

Returns the parent of this tile in the tile hierarchy.

This will be the nullptr if this is the root tile.

Returns
The parent.

Definition at line 171 of file Tile.h.

◆ getRefine()

TileRefine Cesium3DTilesSelection::Tile::getRefine ( ) const
inlinenoexcept

The refinement strategy of this tile.

Returns the TileRefine value that indicates the refinement strategy for this tile. This is Add when the content of the child tiles is added to the content of this tile during refinement, and Replace when the content of the child tiles replaces the content of this tile during refinement.

Returns
The refinement strategy.

Definition at line 326 of file Tile.h.

◆ getTileID()

const TileID & Cesium3DTilesSelection::Tile::getTileID ( ) const
inlinenoexcept

Returns the TileID of this tile.

This function is not supposed to be called by clients.

Returns
The tile ID.

Definition at line 365 of file Tile.h.

◆ getTransform()

const glm::dmat4x4 & Cesium3DTilesSelection::Tile::getTransform ( ) const
inlinenoexcept

Gets the transformation matrix for this tile.

This matrix does not need to be multiplied with the tile's parent's transform as this has already been done.

Returns
The transform matrix.

Definition at line 345 of file Tile.h.

◆ getUnconditionallyRefine()

bool Cesium3DTilesSelection::Tile::getUnconditionallyRefine ( ) const
inlinenoexcept

Returns whether to unconditionally refine this tile.

This is useful in cases such as with external tilesets, where instead of a tile having any content, it points to an external tileset's root. So the tile always needs to be refined otherwise the external tileset will not be displayed.

Returns
Whether to uncoditionally refine this tile.

Definition at line 302 of file Tile.h.

◆ getViewerRequestVolume()

const std::optional< BoundingVolume > & Cesium3DTilesSelection::Tile::getViewerRequestVolume ( ) const
inlinenoexcept

Returns the viewer request volume of this tile.

The viewer request volume is an optional BoundingVolume that may be associated with a tile. It allows controlling the rendering process of the tile content: If the viewer request volume is present, then the content of the tile will only be rendered when the viewer (i.e. the camera position) is inside the viewer request volume.

Returns
The viewer request volume, or an empty optional.

Definition at line 238 of file Tile.h.

◆ operator=() [1/2]

Tile & Cesium3DTilesSelection::Tile::operator= ( const Tile & rhs)
delete

Copy constructor.

Parameters
rhsThe other instance.

◆ operator=() [2/2]

Tile & Cesium3DTilesSelection::Tile::operator= ( Tile && rhs)
noexcept

Move assignment operator.

Parameters
rhsThe other instance.

◆ setBoundingVolume()

void Cesium3DTilesSelection::Tile::setBoundingVolume ( const BoundingVolume & value)
inlinenoexcept

Set the BoundingVolume of this tile.

This function is not supposed to be called by clients.

Parameters
valueThe bounding volume.

Definition at line 223 of file Tile.h.

◆ setContentBoundingVolume()

void Cesium3DTilesSelection::Tile::setContentBoundingVolume ( const std::optional< BoundingVolume > & value)
inlinenoexcept

Set the BoundingVolume of the renderable content of this tile.

This function is not supposed to be called by clients.

Parameters
valueThe content bounding volume

Definition at line 400 of file Tile.h.

◆ setGeometricError()

void Cesium3DTilesSelection::Tile::setGeometricError ( double value)
inlinenoexcept

Set the geometric error of the contents of this tile.

This function is not supposed to be called by clients.

Parameters
valueThe geometric error, in meters.

Definition at line 272 of file Tile.h.

◆ setLastSelectionState()

void Cesium3DTilesSelection::Tile::setLastSelectionState ( const TileSelectionState & newState)
inlinenoexcept

Set the TileSelectionState of this tile.

This function is not supposed to be called by clients.

Parameters
newStateThe new stace

Definition at line 428 of file Tile.h.

◆ setRefine()

void Cesium3DTilesSelection::Tile::setRefine ( TileRefine value)
inlinenoexcept

Set the refinement strategy of this tile.

This function is not supposed to be called by clients.

Parameters
valueThe refinement strategy.

Definition at line 335 of file Tile.h.

◆ setTileID()

void Cesium3DTilesSelection::Tile::setTileID ( const TileID & id)
inlinenoexcept

Set the TileID of this tile.

This function is not supposed to be called by clients.

Parameters
idThe tile ID.

Definition at line 374 of file Tile.h.

◆ setTransform()

void Cesium3DTilesSelection::Tile::setTransform ( const glm::dmat4x4 & value)
inlinenoexcept

Set the transformation matrix for this tile.

This function is not supposed to be called by clients.

Parameters
valueThe transform matrix.

Definition at line 354 of file Tile.h.

◆ setUnconditionallyRefine()

void Cesium3DTilesSelection::Tile::setUnconditionallyRefine ( )
inlinenoexcept

Marks that this tile should be unconditionally refined.

This function is not supposed to be called by clients.

Definition at line 311 of file Tile.h.

◆ setViewerRequestVolume()

void Cesium3DTilesSelection::Tile::setViewerRequestVolume ( const std::optional< BoundingVolume > & value)
inlinenoexcept

Set the viewer request volume of this tile.

This function is not supposed to be called by clients.

Parameters
valueThe viewer request volume.

Definition at line 250 of file Tile.h.

Friends And Related Symbol Documentation

◆ MockTilesetContentManagerTestFixture

friend class MockTilesetContentManagerTestFixture
friend

Definition at line 553 of file Tile.h.

◆ TilesetContentManager

friend class TilesetContentManager
friend

Definition at line 552 of file Tile.h.


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