cesium-native 0.48.0
|
#include <Cesium3DTilesSelection/Tile.h>
Public Types | |
using | Pointer = CesiumUtility::IntrusivePointer<Tile> |
A reference counting pointer to a Tile . | |
typedef CesiumUtility::DoublyLinkedList< Tile, &Tile::_unusedTilesLinks > | UnusedLinkedList |
A CesiumUtility::DoublyLinkedList for tile objects. | |
Public Member Functions | |
Tile (TilesetContentLoader *pLoader, const TileID &tileID={}) 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, const TileID &tileID, 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, const TileID &tileID, 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 destructor, which clears all resources associated with this tile. | |
Tile (const Tile &rhs)=delete | |
Copy constructor. | |
Tile (Tile &&rhs) noexcept | |
Move constructor. | |
Tile & | operator= (const Tile &rhs)=delete |
Copy constructor. | |
Tile & | operator= (Tile &&rhs) noexcept=delete |
Move assignment operator. | |
Tile * | getParent () noexcept |
Returns the parent of this tile in the tile hierarchy. | |
const Tile * | getParent () const noexcept |
Returns the parent of this tile in the tile hierarchy. | |
std::span< Tile > | getChildren () noexcept |
Returns a view on the children of this tile. | |
std::span< const Tile > | getChildren () const noexcept |
Returns a view on the children of this tile. | |
void | clearChildren () noexcept |
Clears the children of this tile. | |
void | createChildTiles (std::vector< Tile > &&children) |
Assigns the given child tiles to this tile. | |
const BoundingVolume & | getBoundingVolume () 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 TileID & | getTileID () 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. | |
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 TileContent & | getContent () const noexcept |
Get the content of the tile. | |
TileContent & | getContent () 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. | |
TilesetContentLoader * | getLoader () const noexcept |
get the loader that is used to load the tile content. | |
TileLoadState | getState () const noexcept |
Returns the TileLoadState of this tile. | |
bool | needsWorkerThreadLoading () const noexcept |
Determines if this tile requires worker-thread loading. | |
bool | needsMainThreadLoading () const noexcept |
Determines if this tile requires main-thread loading. | |
void | addReference (const char *reason=nullptr) noexcept |
Adds a reference to this tile. A live reference will keep this tile from being destroyed, and it may also keep the tile's content from unloading. | |
void | releaseReference (const char *reason=nullptr) noexcept |
Removes a reference from this tile. A live reference will keep this tile from being destroyed, and it may also keep the tile's content from unloading. | |
int32_t | getReferenceCount () const noexcept |
Gets the current number of references to this tile. | |
bool | hasReferencingContent () const noexcept |
Determines if this tile's getContent counts as a reference to this tile. | |
Friends | |
class | TilesetContentManager |
class | MockTilesetContentManagerTestFixture |
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.
A reference counting pointer to a Tile
.
An instance of this pointer type will keep the Tile
from being destroyed, and it may also keep its content from unloading. See addReference
for details.
typedef CesiumUtility::DoublyLinkedList<Tile, &Tile::_unusedTilesLinks> Cesium3DTilesSelection::Tile::UnusedLinkedList |
A CesiumUtility::DoublyLinkedList
for tile objects.
|
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.
pLoader | The TilesetContentLoader that is used to load the tile. |
tileID | The ID of this tile. If not specified, the ID will initially be an empty string. |
|
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.
If the supplied TileID
is not an empty string, the tile's reference count will be incremented on account of the loaded, referencable content. Otherwise, if it is an empty string, the reference count will not be incremented. It is essential that this be accounted for later if the tile ID is changed in order to avoid reference count assertion failures at tileset destruction.
pLoader | The TilesetContentLoader that is assiocated with this tile. |
tileID | The ID of this tile. If it is an empty string, then the external content will not be unloadable. |
externalContent | External content that is associated with this tile. |
|
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.
If the supplied TileID
is not an empty string, the tile's reference count will be incremented on account of the loaded, referencable content. Otherwise, if it is an empty string, the reference count will not be incremented. It is essential that this be accounted for later if the tile ID is changed in order to avoid reference count assertion failures at tileset destruction.
pLoader | The TilesetContentLoader that is assiocated with this tile. |
tileID | The ID of this tile. If it is an empty string, then the empty content will not be unloadable. |
emptyContent | A content tag indicating that the tile has no content. |
|
delete |
Copy constructor.
rhs | The other instance. |
|
noexcept |
Move constructor.
rhs | The other instance. |
|
noexcept |
Adds a reference to this tile. A live reference will keep this tile from being destroyed, and it may also keep the tile's content from unloading.
Use CesiumUtility::IntrusivePointer
to manage references to tiles whenever possible, rather than calling this method directly.
When the first reference is added to this tile, this method will automatically add a reference to the tile's parent tile as well. This is to prevent the parent tile from being destroyed, which would implicitly destroy all of its children as well. Parent tiles should never hold references to child tiles.
A reference is also added to a tile when its content is loading or loaded. Content must finish loading, and then be unloaded, before a Tile is eligible for destruction.
Any additional added references, beyond one per referenced child and one representing this tile's content if it exists, indicate interest not just in the Tile itself but also in the Tile's content.
For example: if a Tile has loaded content (1) as well as four children, and two (2) of its children have a reference count greater than zero, it will have a total reference count of at least 1+2=3. If its reference count is exactly three, this means that the tile's content is not currently needed and may be unloaded when the unused tile cache is full. However, if the reference count is greater than 3, this means that the content is also referenced. Therefore, neither the content nor the tile will be unloaded.
reason | An optional explanation for why this reference is being added. This can help debug reference counts when compiled with CESIUM_DEBUG_TILE_UNLOADING . |
|
noexcept |
Clears the children of this tile.
This function is not supposed to be called by clients.
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.
children | The child tiles. |
`std::runtime_error` | if this tile already has children. |
|
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.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
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.
|
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.
|
inlinenoexcept |
|
inlinenoexcept |
|
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
.
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
Gets the current number of references to this tile.
See addReference
for details of when and why references are added, and how they impact a tile's eligibility to have its content unloaded.
|
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.
|
inlinenoexcept |
|
inlinenoexcept |
|
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.
|
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.
|
noexcept |
Determines if this tile's getContent
counts as a reference to this tile.
Content only counts as a reference to the tile when that content may be unloaded. This ensures that the Tile
will not be destroyed before the content is unloaded.
Content that TileContent::isUnknownContent
cannot be unloaded, so it is non-referencing. In addition, if the tile's getTileID
is a blank string, then content of any type will be non-referencing. This is because the content for a tile without an ID cannot be reloaded, and so it will never been unloaded except when the entire Tileset
is destroyed.
|
noexcept |
Determines if this tile requires main-thread loading.
|
noexcept |
Determines if this tile requires worker-thread loading.
Copy constructor.
rhs | The other instance. |
Move assignment operator.
rhs | The other instance. |
|
noexcept |
Removes a reference from this tile. A live reference will keep this tile from being destroyed, and it may also keep the tile's content from unloading.
Use CesiumUtility::IntrusivePointer
to manage references to tiles whenever possible, rather than calling this method directly.
When the last reference is removed from this tile (its count goes from 1 to 0), this method will automatically remove a reference from the tile's parent tile as well. This is the inverse of the addReference
that the child previously invoked on its parent when the child reference count went from 0 to 1. Removing it indicates that it is ok to destroy the child tile, such as by unloading an external tileset.
See addReference
for details of how references affect a tile's eligibility to have its content unloaded.
reason | An optional explanation for why this reference is being removed. This can help debug reference counts when compiled with CESIUM_DEBUG_TILE_UNLOADING . |
|
inlinenoexcept |
Set the BoundingVolume
of this tile.
This function is not supposed to be called by clients.
value | The bounding volume. |
|
inlinenoexcept |
Set the BoundingVolume
of the renderable content of this tile.
This function is not supposed to be called by clients.
value | The content bounding volume |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |