cesium-native  0.41.0
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. More...
 
 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. More...
 
 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. More...
 
 ~Tile () noexcept=default
 Default destructor, which clears all resources associated with this tile.
 
 Tile (const Tile &rhs)=delete
 Copy constructor. More...
 
 Tile (Tile &&rhs) noexcept
 Move constructor. More...
 
Tileoperator= (const Tile &rhs)=delete
 Copy constructor. More...
 
Tileoperator= (Tile &&rhs) noexcept
 Move assignment operator. More...
 
TilegetParent () noexcept
 Returns the parent of this tile in the tile hierarchy. More...
 
const TilegetParent () const noexcept
 Returns the parent of this tile in the tile hierarchy. More...
 
gsl::span< TilegetChildren () noexcept
 Returns a view on the children of this tile. More...
 
gsl::span< const TilegetChildren () const noexcept
 Returns a view on the children of this tile. More...
 
void createChildTiles (std::vector< Tile > &&children)
 Assigns the given child tiles to this tile. More...
 
const BoundingVolumegetBoundingVolume () const noexcept
 Returns the BoundingVolume of this tile. More...
 
void setBoundingVolume (const BoundingVolume &value) noexcept
 Set the BoundingVolume of this tile. More...
 
const std::optional< BoundingVolume > & getViewerRequestVolume () const noexcept
 Returns the viewer request volume of this tile. More...
 
void setViewerRequestVolume (const std::optional< BoundingVolume > &value) noexcept
 Set the viewer request volume of this tile. More...
 
double getGeometricError () const noexcept
 Returns the geometric error of this tile. More...
 
void setGeometricError (double value) noexcept
 Set the geometric error of the contents of this tile. More...
 
double getNonZeroGeometricError () const noexcept
 Gets the tile's geometric error as if by calling getGeometricError, except that if the error is smaller than Math::Epsilon5 the returned geometric error is instead computed as half of the parent tile's (non-zero) geometric error. More...
 
bool getUnconditionallyRefine () const noexcept
 Returns whether to unconditionally refine this tile. More...
 
void setUnconditionallyRefine () noexcept
 Marks that this tile should be unconditionally refined. More...
 
TileRefine getRefine () const noexcept
 The refinement strategy of this tile. More...
 
void setRefine (TileRefine value) noexcept
 Set the refinement strategy of this tile. More...
 
const glm::dmat4x4 & getTransform () const noexcept
 Gets the transformation matrix for this tile. More...
 
void setTransform (const glm::dmat4x4 &value) noexcept
 Set the transformation matrix for this tile. More...
 
const TileIDgetTileID () const noexcept
 Returns the TileID of this tile. More...
 
void setTileID (const TileID &id) noexcept
 Set the TileID of this tile. More...
 
const std::optional< BoundingVolume > & getContentBoundingVolume () const noexcept
 Returns the BoundingVolume of the renderable content of this tile. More...
 
void setContentBoundingVolume (const std::optional< BoundingVolume > &value) noexcept
 Set the BoundingVolume of the renderable content of this tile. More...
 
TileSelectionStategetLastSelectionState () noexcept
 Returns the TileSelectionState of this tile. More...
 
const TileSelectionStategetLastSelectionState () const noexcept
 Returns the TileSelectionState of this tile. More...
 
void setLastSelectionState (const TileSelectionState &newState) noexcept
 Set the TileSelectionState of this tile. More...
 
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. More...
 
const TileContentgetContent () const noexcept
 get the content of the tile.
 
TileContentgetContent () noexcept
 
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 TileContentLoadResult 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.

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.

◆ 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.

◆ 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
<tt>std::runtime_error</tt>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 210 of file Tile.h.

◆ getChildren() [1/2]

gsl::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 186 of file Tile.h.

◆ getChildren() [2/2]

gsl::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 181 of file Tile.h.

◆ getContent()

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

Definition at line 455 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 386 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 261 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 415 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 410 of file Tile.h.

◆ getMappedRasterTiles()

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

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

Definition at line 445 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 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 Math::Epsilon5, returns 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 172 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 169 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 324 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 363 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 343 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 300 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 236 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 221 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 398 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 270 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 426 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 333 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 372 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 352 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 309 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 248 of file Tile.h.


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