cesium-native  0.41.0
Cesium3DTilesSelection::Tileset Class Referencefinal

A 3D Tiles tileset, used for streaming massive heterogeneous 3D geospatial datasets. More...

#include <Cesium3DTilesSelection/Tileset.h>

Public Member Functions

 Tileset (const TilesetExternals &externals, std::unique_ptr< TilesetContentLoader > &&pCustomLoader, std::unique_ptr< Tile > &&pRootTile, const TilesetOptions &options=TilesetOptions())
 Constructs a new instance with a given custom tileset loader. More...
 
 Tileset (const TilesetExternals &externals, const std::string &url, const TilesetOptions &options=TilesetOptions())
 Constructs a new instance with a given tileset.json URL. More...
 
 Tileset (const TilesetExternals &externals, int64_t ionAssetID, const std::string &ionAccessToken, const TilesetOptions &options=TilesetOptions(), const std::string &ionAssetEndpointUrl="https://api.cesium.com/")
 Constructs a new instance with the given asset ID on Cesium ion. More...
 
 ~Tileset () noexcept
 Destroys this tileset. More...
 
CesiumAsync::SharedFuture< void > & getAsyncDestructionCompleteEvent ()
 A future that resolves when this Tileset has been destroyed (i.e. its destructor has been called) and all async operations that it was executing have completed.
 
CesiumAsync::SharedFuture< void > & getRootTileAvailableEvent ()
 A future that resolves when the details of the root tile of this tileset are available. The root tile's content (e.g., 3D model), however, will not necessarily be loaded yet.
 
const std::vector< CesiumUtility::Credit > & getTilesetCredits () const noexcept
 Get tileset credits.
 
void setShowCreditsOnScreen (bool showCreditsOnScreen) noexcept
 Sets whether or not the tileset's credits should be shown on screen. More...
 
TilesetExternalsgetExternals () noexcept
 Gets the TilesetExternals that summarize the external interfaces used by this tileset.
 
const TilesetExternalsgetExternals () const noexcept
 Gets the TilesetExternals that summarize the external interfaces used by this tileset.
 
CesiumAsync::AsyncSystemgetAsyncSystem () noexcept
 Returns the CesiumAsync::AsyncSystem that is used for dispatching asynchronous tasks.
 
const CesiumAsync::AsyncSystemgetAsyncSystem () const noexcept
 Returns the CesiumAsync::AsyncSystem that is used for dispatching asynchronous tasks. More...
 
const TilesetOptionsgetOptions () const noexcept
 Gets the TilesetOptions of this tileset. More...
 
TilesetOptionsgetOptions () noexcept
 Gets the TilesetOptions of this tileset.
 
const CesiumGeospatial::EllipsoidgetEllipsoid () const
 Gets the CesiumGeospatial::Ellipsoid used by this tileset.
 
CesiumGeospatial::EllipsoidgetEllipsoid () noexcept
 Gets the CesiumGeospatial::Ellipsoid used by this tileset. More...
 
TilegetRootTile () noexcept
 Gets the root tile of this tileset. More...
 
const TilegetRootTile () const noexcept
 Gets the root tile of this tileset. More...
 
RasterOverlayCollectiongetOverlays () noexcept
 Returns the RasterOverlayCollection of this tileset.
 
const RasterOverlayCollectiongetOverlays () const noexcept
 Returns the RasterOverlayCollection of this tileset. More...
 
TilesetSharedAssetSystemgetSharedAssetSystem () noexcept
 Returns the TilesetSharedAssetSystem of this tileset.
 
const TilesetSharedAssetSystemgetSharedAssetSystem () const noexcept
 Returns the TilesetSharedAssetSystem of this tileset. More...
 
const ViewUpdateResultupdateViewOffline (const std::vector< ViewState > &frustums)
 Updates this view but waits for all tiles that meet sse to finish loading and ready to be rendered before returning the function. This method is significantly slower than Tileset::updateView and should only be used for capturing movie or non-realtime situation. More...
 
const ViewUpdateResultupdateView (const std::vector< ViewState > &frustums, float deltaTime=0.0f)
 Updates this view, returning the set of tiles to render in this view. More...
 
int32_t getNumberOfTilesLoaded () const
 Gets the total number of tiles that are currently loaded.
 
float computeLoadProgress () noexcept
 Estimate the percentage of the tiles for the current view that have been loaded.
 
void forEachLoadedTile (const std::function< void(Tile &tile)> &callback)
 Invokes a function for each tile that is currently loaded. More...
 
int64_t getTotalDataBytes () const noexcept
 Gets the total number of bytes of tile and raster overlay data that are currently loaded.
 
const TilesetMetadatagetMetadata (const Tile *pTile=nullptr) const
 Gets the TilesetMetadata associated with the main or external tileset.json that contains a given tile. If the metadata is not yet loaded, this method returns nullptr. More...
 
CesiumAsync::Future< const TilesetMetadata * > loadMetadata ()
 Asynchronously loads the metadata associated with the main tileset.json. More...
 
CesiumAsync::Future< SampleHeightResultsampleHeightMostDetailed (const std::vector< CesiumGeospatial::Cartographic > &positions)
 Initiates an asynchronous query for the height of this tileset at a list of cartographic positions (longitude and latitude). The most detailed available tiles are used to determine each height. More...
 

Detailed Description

A 3D Tiles tileset, used for streaming massive heterogeneous 3D geospatial datasets.

Definition at line 39 of file Tileset.h.

Constructor & Destructor Documentation

◆ Tileset() [1/3]

Cesium3DTilesSelection::Tileset::Tileset ( const TilesetExternals externals,
std::unique_ptr< TilesetContentLoader > &&  pCustomLoader,
std::unique_ptr< Tile > &&  pRootTile,
const TilesetOptions options = TilesetOptions() 
)

Constructs a new instance with a given custom tileset loader.

Parameters
externalsThe external interfaces to use.
pCustomLoaderThe custom loader used to load the tileset and tile content.
pRootTileThe root tile that is associated with the custom loader
optionsAdditional options for the tileset.

◆ Tileset() [2/3]

Cesium3DTilesSelection::Tileset::Tileset ( const TilesetExternals externals,
const std::string &  url,
const TilesetOptions options = TilesetOptions() 
)

Constructs a new instance with a given tileset.json URL.

Parameters
externalsThe external interfaces to use.
urlThe URL of the tileset.json.
optionsAdditional options for the tileset.

◆ Tileset() [3/3]

Cesium3DTilesSelection::Tileset::Tileset ( const TilesetExternals externals,
int64_t  ionAssetID,
const std::string &  ionAccessToken,
const TilesetOptions options = TilesetOptions(),
const std::string &  ionAssetEndpointUrl = "https://api.cesium.com/" 
)

Constructs a new instance with the given asset ID on Cesium ion.

Parameters
externalsThe external interfaces to use.
ionAssetIDThe ID of the Cesium ion asset to use.
ionAccessTokenThe Cesium ion access token authorizing access to the asset.
optionsAdditional options for the tileset.
ionAssetEndpointUrlThe URL of the ion asset endpoint. Defaults to Cesium ion but a custom endpoint can be specified.

◆ ~Tileset()

Cesium3DTilesSelection::Tileset::~Tileset ( )
noexcept

Destroys this tileset.

Destroying the tileset will immediately (before the destructor returns) unload as much tile content as possible. However, tiles that are currently in the process of being loaded cannot be unloaded immediately. These tiles will be unloaded asynchronously some time after this destructor returns. To be notified of completion of the async portion of the tileset destruction, subscribe to getAsyncDestructionCompleteEvent.

Member Function Documentation

◆ forEachLoadedTile()

void Cesium3DTilesSelection::Tileset::forEachLoadedTile ( const std::function< void(Tile &tile)> &  callback)

Invokes a function for each tile that is currently loaded.

Parameters
callbackThe function to invoke.

◆ getAsyncSystem()

const CesiumAsync::AsyncSystem& Cesium3DTilesSelection::Tileset::getAsyncSystem ( ) const
inlinenoexcept

Returns the CesiumAsync::AsyncSystem that is used for dispatching asynchronous tasks.

Definition at line 144 of file Tileset.h.

◆ getEllipsoid()

CesiumGeospatial::Ellipsoid& Cesium3DTilesSelection::Tileset::getEllipsoid ( )
inlinenoexcept

Gets the CesiumGeospatial::Ellipsoid used by this tileset.

Definition at line 164 of file Tileset.h.

◆ getMetadata()

const TilesetMetadata* Cesium3DTilesSelection::Tileset::getMetadata ( const Tile pTile = nullptr) const

Gets the TilesetMetadata associated with the main or external tileset.json that contains a given tile. If the metadata is not yet loaded, this method returns nullptr.

If this tileset's root tile is not yet available, this method returns nullptr.

If the tileset has a TilesetMetadata::schemaUri, it will not necessarily have been loaded yet.

If the provided tile is not the root tile of a tileset.json, this method walks up the Tile::getParent chain until it finds the closest root and then returns the metadata associated with the corresponding tileset.json.

Consider calling loadMetadata instead, which will return a future that only resolves after the root tile is loaded and the schemaUri, if any, has been resolved.

Parameters
pTileThe tile. If this parameter is nullptr, the metadata for the main tileset.json is returned.
Returns
The found metadata, or nullptr if the root tile is not yet loaded.

◆ getOptions()

const TilesetOptions& Cesium3DTilesSelection::Tileset::getOptions ( ) const
inlinenoexcept

Gets the TilesetOptions of this tileset.

Definition at line 149 of file Tileset.h.

◆ getOverlays()

const RasterOverlayCollection& Cesium3DTilesSelection::Tileset::getOverlays ( ) const
noexcept

Returns the RasterOverlayCollection of this tileset.

◆ getRootTile() [1/2]

const Tile* Cesium3DTilesSelection::Tileset::getRootTile ( ) const
noexcept

Gets the root tile of this tileset.

This may be nullptr if there is currently no root tile.

◆ getRootTile() [2/2]

Tile* Cesium3DTilesSelection::Tileset::getRootTile ( )
noexcept

Gets the root tile of this tileset.

This may be nullptr if there is currently no root tile.

◆ getSharedAssetSystem()

const TilesetSharedAssetSystem& Cesium3DTilesSelection::Tileset::getSharedAssetSystem ( ) const
noexcept

Returns the TilesetSharedAssetSystem of this tileset.

◆ loadMetadata()

CesiumAsync::Future<const TilesetMetadata*> Cesium3DTilesSelection::Tileset::loadMetadata ( )

Asynchronously loads the metadata associated with the main tileset.json.

Before the returned future resolves, the root tile of this tileset will be loaded and the TilesetMetadata::schemaUri will be loaded if one has been specified.

If the tileset or schemaUri fail to load, the returned future will reject.

Returns
A shared future that resolves to the loaded metadata. Once this future resolves, getMetadata can be used to synchronously obtain the same metadata instance.

◆ sampleHeightMostDetailed()

CesiumAsync::Future<SampleHeightResult> Cesium3DTilesSelection::Tileset::sampleHeightMostDetailed ( const std::vector< CesiumGeospatial::Cartographic > &  positions)

Initiates an asynchronous query for the height of this tileset at a list of cartographic positions (longitude and latitude). The most detailed available tiles are used to determine each height.

The height of the input positions is ignored. The output height is expressed in meters above the ellipsoid (usually WGS84), which should not be confused with a height above mean sea level.

Note that Tileset::updateView must be called periodically, or else the returned Future will never resolve. If you are not using this tileset for visualization, you can call updateView with an empty list of frustums.

Parameters
positionsThe positions for which to sample heights.
Returns
A future that asynchronously resolves to the result of the height query.

◆ setShowCreditsOnScreen()

void Cesium3DTilesSelection::Tileset::setShowCreditsOnScreen ( bool  showCreditsOnScreen)
noexcept

Sets whether or not the tileset's credits should be shown on screen.

Parameters
showCreditsOnScreenWhether the credits should be shown on screen.

◆ updateView()

const ViewUpdateResult& Cesium3DTilesSelection::Tileset::updateView ( const std::vector< ViewState > &  frustums,
float  deltaTime = 0.0f 
)

Updates this view, returning the set of tiles to render in this view.

Parameters
frustumsThe ViewStates that the view should be updated for
deltaTimeThe amount of time that has passed since the last call to updateView, in seconds.
Returns
The set of tiles to render in the updated view. This value is only valid until the next call to updateView or until the tileset is destroyed, whichever comes first.

◆ updateViewOffline()

const ViewUpdateResult& Cesium3DTilesSelection::Tileset::updateViewOffline ( const std::vector< ViewState > &  frustums)

Updates this view but waits for all tiles that meet sse to finish loading and ready to be rendered before returning the function. This method is significantly slower than Tileset::updateView and should only be used for capturing movie or non-realtime situation.

Parameters
frustumsThe ViewStates that the view should be updated for
Returns
The set of tiles to render in the updated view. This value is only valid until the next call to updateView or until the tileset is destroyed, whichever comes first.

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