cesium-native 0.43.0
|
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. | |
Tileset (const TilesetExternals &externals, const std::string &url, const TilesetOptions &options=TilesetOptions()) | |
Constructs a new instance with a given tileset.json URL. | |
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. | |
~Tileset () noexcept | |
Destroys this tileset. | |
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. | |
TilesetExternals & | getExternals () noexcept |
Gets the TilesetExternals that summarize the external interfaces used by this tileset. | |
const TilesetExternals & | getExternals () const noexcept |
Gets the TilesetExternals that summarize the external interfaces used by this tileset. | |
CesiumAsync::AsyncSystem & | getAsyncSystem () noexcept |
Returns the CesiumAsync::AsyncSystem that is used for dispatching asynchronous tasks. | |
const CesiumAsync::AsyncSystem & | getAsyncSystem () const noexcept |
Returns the CesiumAsync::AsyncSystem that is used for dispatching asynchronous tasks. | |
const TilesetOptions & | getOptions () const noexcept |
Gets the TilesetOptions of this tileset. | |
TilesetOptions & | getOptions () noexcept |
Gets the TilesetOptions of this tileset. | |
const CesiumGeospatial::Ellipsoid & | getEllipsoid () const |
Gets the CesiumGeospatial::Ellipsoid used by this tileset. | |
CesiumGeospatial::Ellipsoid & | getEllipsoid () noexcept |
Gets the CesiumGeospatial::Ellipsoid used by this tileset. | |
Tile * | getRootTile () noexcept |
Gets the root tile of this tileset. | |
const Tile * | getRootTile () const noexcept |
Gets the root tile of this tileset. | |
RasterOverlayCollection & | getOverlays () noexcept |
Returns the RasterOverlayCollection of this tileset. | |
const RasterOverlayCollection & | getOverlays () const noexcept |
Returns the RasterOverlayCollection of this tileset. | |
TilesetSharedAssetSystem & | getSharedAssetSystem () noexcept |
Returns the TilesetSharedAssetSystem of this tileset. | |
const TilesetSharedAssetSystem & | getSharedAssetSystem () const noexcept |
Returns the TilesetSharedAssetSystem of this tileset. | |
const ViewUpdateResult & | 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. | |
const ViewUpdateResult & | updateView (const std::vector< ViewState > &frustums, float deltaTime=0.0f) |
Updates this view, returning the set of tiles to render in this view. | |
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. | |
void | forEachLoadedTile (const std::function< void(const Tile &tile)> &callback) const |
Invokes a function for each tile that is currently loaded. | |
int64_t | getTotalDataBytes () const noexcept |
Gets the total number of bytes of tile and raster overlay data that are currently loaded. | |
const TilesetMetadata * | 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. | |
CesiumAsync::Future< const TilesetMetadata * > | loadMetadata () |
Asynchronously loads the metadata associated with the main tileset.json. | |
CesiumAsync::Future< SampleHeightResult > | 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. | |
A 3D Tiles tileset, used for streaming massive heterogeneous 3D geospatial datasets.
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.
externals | The external interfaces to use. |
pCustomLoader | The custom loader used to load the tileset and tile content. |
pRootTile | The root tile that is associated with the custom loader |
options | Additional options for the tileset. |
Cesium3DTilesSelection::Tileset::Tileset | ( | const TilesetExternals & | externals, |
const std::string & | url, | ||
const TilesetOptions & | options = TilesetOptions() ) |
Constructs a new instance with a given tileset.json
URL.
externals | The external interfaces to use. |
url | The URL of the tileset.json . |
options | Additional options for the tileset. |
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.
externals | The external interfaces to use. |
ionAssetID | The ID of the Cesium ion asset to use. |
ionAccessToken | The Cesium ion access token authorizing access to the asset. |
options | Additional options for the tileset. |
ionAssetEndpointUrl | The URL of the ion asset endpoint. Defaults to Cesium ion but a custom endpoint can be specified. |
|
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
.
void Cesium3DTilesSelection::Tileset::forEachLoadedTile | ( | const std::function< void(const Tile &tile)> & | callback | ) | const |
Invokes a function for each tile that is currently loaded.
callback | The function to invoke. |
void Cesium3DTilesSelection::Tileset::forEachLoadedTile | ( | const std::function< void(Tile &tile)> & | callback | ) |
Invokes a function for each tile that is currently loaded.
callback | The function to invoke. |
|
inlinenoexcept |
Returns the CesiumAsync::AsyncSystem
that is used for dispatching asynchronous tasks.
|
inlinenoexcept |
Returns the CesiumAsync::AsyncSystem
that is used for dispatching asynchronous tasks.
|
inline |
Gets the CesiumGeospatial::Ellipsoid
used by this tileset.
|
inlinenoexcept |
Gets the CesiumGeospatial::Ellipsoid
used by this tileset.
|
inlinenoexcept |
Gets the TilesetExternals
that summarize the external interfaces used by this tileset.
|
inlinenoexcept |
Gets the TilesetExternals
that summarize the external interfaces used by this tileset.
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.
pTile | The tile. If this parameter is nullptr, the metadata for the main tileset.json is returned. |
|
inlinenoexcept |
Gets the TilesetOptions
of this tileset.
|
inlinenoexcept |
Gets the TilesetOptions
of this tileset.
|
noexcept |
Returns the RasterOverlayCollection
of this tileset.
|
noexcept |
Gets the root tile of this tileset.
This may be nullptr
if there is currently no root tile.
|
noexcept |
Gets the root tile of this tileset.
This may be nullptr
if there is currently no root tile.
|
noexcept |
Returns the TilesetSharedAssetSystem
of this tileset.
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.
getMetadata
can be used to synchronously obtain the same metadata instance. 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.
positions | The positions for which to sample heights. |
|
noexcept |
Sets whether or not the tileset's credits should be shown on screen.
showCreditsOnScreen | Whether the credits should be shown on screen. |
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.
frustums | The ViewState s that the view should be updated for |
deltaTime | The amount of time that has passed since the last call to updateView, in seconds. |
updateView
or until the tileset is destroyed, whichever comes first. 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.
frustums | The ViewState s that the view should be updated for |
updateView
or until the tileset is destroyed, whichever comes first.