cesium-native 0.47.0
Loading...
Searching...
No Matches
Cesium3DTilesSelection::TileLoadRequester Class Referenceabstract

The base class for something that requests loading of specific tiles from a 3D Tiles Tileset. More...

#include <Cesium3DTilesSelection/TileLoadRequester.h>

Inheritance diagram for Cesium3DTilesSelection::TileLoadRequester:
Cesium3DTilesSelection::TilesetViewGroup

Public Member Functions

virtual double getWeight () const =0
 Gets the weight of this requester relative to others.
 
virtual bool hasMoreTilesToLoadInWorkerThread () const =0
 Determines if this requester has any more tiles that need to be loaded in a worker thread. To determine if a particular Tile needs to be loaded in a worker thread, call Tile::needsWorkerThreadLoading.
 
virtual TilegetNextTileToLoadInWorkerThread ()=0
 Gets the next Tile that this requester would like loaded in a worker thread.
 
virtual bool hasMoreTilesToLoadInMainThread () const =0
 Determines if this requester has any more tiles that need to be loaded in the main thread. To determine if a particular Tile needs to be loaded in the main thread, call Tile::needsMainThreadLoading.
 
virtual TilegetNextTileToLoadInMainThread ()=0
 Gets the next Tile that this requester would like loaded in the main thread.
 
void unregister () noexcept
 Unregister this requester with the {link Tileset} with which it is currently registered. Once unregistered, it will not influence tile loads until registered again.
 

Protected Member Functions

 TileLoadRequester () noexcept
 Constructs a new instance.
 
 TileLoadRequester (const TileLoadRequester &rhs) noexcept
 Constructs a new instance as a copy of an existing one.
 
 TileLoadRequester (TileLoadRequester &&rhs) noexcept
 Moves an existing instance into a new one.
 
virtual ~TileLoadRequester () noexcept
 Destroys this instance.
 

Friends

class Tileset
 

Detailed Description

The base class for something that requests loading of specific tiles from a 3D Tiles Tileset.

When multiple requesters are registered, each is given a fair chance to load tiles in proportion with its TileLoadRequester::getWeight.

Methods of this class may only be called from the main thread.

See also
TilesetViewGroup
TilesetHeightRequest

Definition at line 22 of file TileLoadRequester.h.

Constructor & Destructor Documentation

◆ TileLoadRequester() [1/2]

Cesium3DTilesSelection::TileLoadRequester::TileLoadRequester ( const TileLoadRequester & rhs)
protectednoexcept

Constructs a new instance as a copy of an existing one.

The copy will not be registered with any Cesium3DTilesSelection::Tileset, even if the existing instance was.

Parameters
rhsThe existing instance to copy.

◆ TileLoadRequester() [2/2]

Cesium3DTilesSelection::TileLoadRequester::TileLoadRequester ( TileLoadRequester && rhs)
protectednoexcept

Moves an existing instance into a new one.

The newly-constructed instance will be registered with the same Cesium3DTilesSelection::Tileset as the rhs. After the constructor returns, the rhs will no longer be registered.

Parameters
rhsThe existing instance to move into this one.

Member Function Documentation

◆ getNextTileToLoadInMainThread()

virtual Tile * Cesium3DTilesSelection::TileLoadRequester::getNextTileToLoadInMainThread ( )
pure virtual

Gets the next Tile that this requester would like loaded in the main thread.

When hasMoreTilesToLoadInMainThread returns false, this method can and should return nullptr. However, when that method returns true, this method must return a valid Tile pointer.

The returned tile must have a reference count greater than zero. Otherwise, the Tile would be immediately eligible for unloading, so it doesn't make sense to load it. In debug builds, this is enforced with an assertion. In release builds, unreferenced tiles are silently ignored.

Returns
The next tile to load in the main thread.

Implemented in Cesium3DTilesSelection::TilesetViewGroup.

◆ getNextTileToLoadInWorkerThread()

virtual Tile * Cesium3DTilesSelection::TileLoadRequester::getNextTileToLoadInWorkerThread ( )
pure virtual

Gets the next Tile that this requester would like loaded in a worker thread.

When hasMoreTilesToLoadInWorkerThread returns false, this method can and should return nullptr. However, when that method returns true, this method must return a valid Tile pointer.

The returned tile must have a reference count greater than zero. Otherwise, the Tile would be immediately eligible for unloading, so it doesn't make sense to load it. In debug builds, this is enforced with an assertion. In release builds, unreferenced tiles are silently ignored.

Returns
The next tile to load in a worker thread.

Implemented in Cesium3DTilesSelection::TilesetViewGroup.

◆ getWeight()

virtual double Cesium3DTilesSelection::TileLoadRequester::getWeight ( ) const
pure virtual

Gets the weight of this requester relative to others.

Most requesters should return a weight of 1.0. When all requesters have the same weight, they will all have an equal opportunity to load tiles. If one requester's weight is 2.0 and the rest are 1.0, that requester will have twice as many opportunities to load tiles as the others.

A very high weight will prevent all other requesters from loading tiles until this requester has none left to load. A very low weight (but above 0.0!) will allow all other requesters to finish loading tiles before this one starts.

Returns
The weight of this requester, which must be greater than 0.0.

Implemented in Cesium3DTilesSelection::TilesetViewGroup.

◆ hasMoreTilesToLoadInMainThread()

virtual bool Cesium3DTilesSelection::TileLoadRequester::hasMoreTilesToLoadInMainThread ( ) const
pure virtual

Determines if this requester has any more tiles that need to be loaded in the main thread. To determine if a particular Tile needs to be loaded in the main thread, call Tile::needsMainThreadLoading.

Returns
true if this requester has further tiles that need loading by the main thread; otherwise, false.

Implemented in Cesium3DTilesSelection::TilesetViewGroup.

◆ hasMoreTilesToLoadInWorkerThread()

virtual bool Cesium3DTilesSelection::TileLoadRequester::hasMoreTilesToLoadInWorkerThread ( ) const
pure virtual

Determines if this requester has any more tiles that need to be loaded in a worker thread. To determine if a particular Tile needs to be loaded in a worker thread, call Tile::needsWorkerThreadLoading.

Returns
true if this requester has further tiles that need loading by a worker thread; otherwise, false.

Implemented in Cesium3DTilesSelection::TilesetViewGroup.

◆ unregister()

void Cesium3DTilesSelection::TileLoadRequester::unregister ( )
noexcept

Unregister this requester with the {link Tileset} with which it is currently registered. Once unregistered, it will not influence tile loads until registered again.

If this instance is not currently registered, this method does nothing.

To register an instance with a Tileset, call Tileset::registerLoadRequester on the tileset.

Friends And Related Symbol Documentation

◆ Tileset

friend class Tileset
friend

Definition at line 145 of file TileLoadRequester.h.


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