3 #include "BoundingVolume.h"
5 #include "RasterMappedTo3DTile.h"
6 #include "TileContent.h"
8 #include "TileRefine.h"
9 #include "TileSelectionState.h"
11 #include <CesiumUtility/DoublyLinkedList.h>
13 #include <glm/common.hpp>
24 class TilesetContentLoader;
97 class CESIUM3DTILESSELECTION_API
Tile final {
117 std::unique_ptr<TileExternalContent>&& externalContent) noexcept;
169 Tile* getParent() noexcept {
return this->_pParent; }
182 return gsl::span<Tile>(this->_children);
187 return gsl::span<const Tile>(this->_children);
211 return this->_boundingVolume;
222 this->_boundingVolume = value;
237 return this->_viewerRequestVolume;
249 this->_viewerRequestVolume = value;
271 this->_geometricError = value;
300 bool getUnconditionallyRefine() const noexcept {
301 return glm::isinf(this->_geometricError);
310 this->_geometricError = std::numeric_limits<double>::infinity();
343 const glm::dmat4x4&
getTransform() const noexcept {
return this->_transform; }
353 this->_transform = value;
385 const std::optional<BoundingVolume>&
387 return this->_contentBoundingVolume;
399 const std::optional<BoundingVolume>& value) noexcept {
400 this->_contentBoundingVolume = value;
411 return this->_lastSelectionState;
416 return this->_lastSelectionState;
427 this->_lastSelectionState = newState;
440 return this->_rasterTiles;
444 const std::vector<RasterMappedTo3DTile>&
446 return this->_rasterTiles;
465 bool isRenderContent() const noexcept;
470 bool isExternalContent() const noexcept;
475 bool isEmptyContent() const noexcept;
488 struct TileConstructorImpl {};
490 typename... TileContentArgs,
491 typename TileContentEnable = std::enable_if_t<
492 std::is_constructible_v<
TileContent, TileContentArgs&&...>,
495 TileConstructorImpl tag,
498 TileContentArgs&&... args);
500 void setParent(
Tile* pParent) noexcept;
519 bool getMightHaveLatentChildren() const noexcept;
521 void setMightHaveLatentChildren(
bool mightHaveLatentChildren) noexcept;
525 std::vector<
Tile> _children;
533 double _geometricError;
535 glm::dmat4x4 _transform;
545 bool _mightHaveLatentChildren;
550 friend class TilesetContentManager;
551 friend class MockTilesetContentManagerTestFixture;
The result of applying a RasterOverlayTile to geometry.
A tile content container that can store and query the content type that is currently being owned by t...
A description of the state of a Tile during the rendering process.
gsl::span< Tile > getChildren() noexcept
Returns a view on the children of this tile.
TileContent & getContent() noexcept
const Tile * getParent() const noexcept
Returns the parent of this tile in the tile hierarchy.
const std::vector< RasterMappedTo3DTile > & getMappedRasterTiles() const noexcept
Returns the raster overlay tiles that have been mapped to this tile.
double getNonZeroGeometricError() const noexcept
Gets the tile's geometric error as if by calling getGeometricError, except that if the error is small...
Tile(TilesetContentLoader *pLoader) noexcept
Construct a tile with unknown content and a loader that is used to load the content of this tile....
const std::optional< BoundingVolume > & getContentBoundingVolume() const noexcept
Returns the BoundingVolume of the renderable content of this tile.
const BoundingVolume & getBoundingVolume() const noexcept
Returns the BoundingVolume of this tile.
void setGeometricError(double value) noexcept
Set the geometric error of the contents of this tile.
void setLastSelectionState(const TileSelectionState &newState) noexcept
Set the TileSelectionState of this tile.
void setTileID(const TileID &id) noexcept
Set the TileID of this tile.
int64_t computeByteSize() const noexcept
Determines the number of bytes in this tile's geometry and texture data.
void createChildTiles(std::vector< Tile > &&children)
Assigns the given child tiles to this tile.
bool isRenderable() const noexcept
Determines if this tile is currently renderable.
const std::optional< BoundingVolume > & getViewerRequestVolume() const noexcept
Returns the viewer request volume of this tile.
const glm::dmat4x4 & getTransform() const noexcept
Gets the transformation matrix for this tile.
void setRefine(TileRefine value) noexcept
Set the refinement strategy of this tile.
const TileID & getTileID() const noexcept
Returns the TileID of this tile.
void setTransform(const glm::dmat4x4 &value) noexcept
Set the transformation matrix for this tile.
void setViewerRequestVolume(const std::optional< BoundingVolume > &value) noexcept
Set the viewer request volume of this tile.
TileRefine getRefine() const noexcept
The refinement strategy of this tile.
gsl::span< const Tile > getChildren() const noexcept
Returns a view on the children of this tile.
Tile(TilesetContentLoader *pLoader, TileEmptyContent emptyContent) noexcept
Construct a tile with an empty content and a loader that is associated with this tile....
TileSelectionState & getLastSelectionState() noexcept
Returns the TileSelectionState of this tile.
void setContentBoundingVolume(const std::optional< BoundingVolume > &value) noexcept
Set the BoundingVolume of the renderable content of this 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....
void setBoundingVolume(const BoundingVolume &value) noexcept
Set the BoundingVolume of this tile.
void setUnconditionallyRefine() noexcept
Marks that this tile should be unconditionally refined.
~Tile() noexcept=default
Default destructor, which clears all resources associated with this tile.
const TileSelectionState & getLastSelectionState() const noexcept
Returns the TileSelectionState of this tile.
double getGeometricError() const noexcept
Returns the geometric error of this tile.
const TileContent & getContent() const noexcept
get the content of the tile.
The loader interface to load the tile content.
Classes that implement the 3D Tiles standard.
@ ContentLoaded
The tile content has finished loading.
@ Unloading
This tile is in the process of being unloaded, but could not be fully unloaded because an asynchronou...
@ ContentLoading
The tile content is currently being loaded.
@ FailedTemporarily
Something went wrong while loading this tile, but it may be a temporary problem.
@ Unloaded
The tile is not yet loaded at all, beyond the metadata in tileset.json.
@ Failed
Something went wrong while loading this tile and it will not be retried.
@ Done
The tile is completely done loading.
std::variant< CesiumGeometry::BoundingSphere, CesiumGeometry::OrientedBoundingBox, CesiumGeospatial::BoundingRegion, CesiumGeospatial::BoundingRegionWithLooseFittingHeights, CesiumGeospatial::S2CellBoundingVolume > BoundingVolume
A bounding volume.
TileRefine
Refinement strategies for a Cesium3DTilesSelection::Tile.
std::variant< std::string, CesiumGeometry::QuadtreeTileID, CesiumGeometry::OctreeTileID, CesiumGeometry::UpsampledQuadtreeNode > TileID
An identifier for a Tile inside the tile hierarchy.
Utility classes for Cesium.
A content tag that indicates a tile has no content.