Creates and manages Credit objects. Avoids repetitions and tracks which credits should be shown and which credits should be removed this frame.
More...
#include <CesiumUtility/CreditSystem.h>
|
|
| CreditSystem () noexcept=default |
| | Constructs a new instance.
|
| |
|
| CreditSystem (const CreditSystem &)=delete |
| |
|
CreditSystem & | operator= (const CreditSystem &)=delete |
| |
| Credit | createCredit (const CreditSource &source, std::string &&html, bool showOnScreen=false) |
| | Inserts a credit string.
|
| |
| Credit | createCredit (const CreditSource &source, const std::string &html, bool showOnScreen=false) |
| | Inserts a credit string.
|
| |
| Credit | createCredit (std::string &&html, bool showOnScreen=false) |
| | Inserts a credit string associated with the getDefaultCreditSource.
|
| |
| Credit | createCredit (const std::string &html, bool showOnScreen=false) |
| | Inserts a credit string associated with the getDefaultCreditSource.
|
| |
|
bool | shouldBeShownOnScreen (Credit credit) const noexcept |
| | Gets whether or not the credit should be shown on screen.
|
| |
|
void | setShowOnScreen (Credit credit, bool showOnScreen) noexcept |
| | Sets whether or not the credit should be shown on screen.
|
| |
|
const std::string & | getHtml (Credit credit) const noexcept |
| | Get the HTML string for this credit.
|
| |
| const CreditSource * | getCreditSource (Credit credit) const noexcept |
| | Gets the source of this credit.
|
| |
| bool | addCreditReference (Credit credit) |
| | Adds a reference to a credit, incrementing its reference count. The referenced credit will be shown until its reference count goes back down to zero.
|
| |
| bool | removeCreditReference (Credit credit) |
| | Removes a reference from a credit, decrementing its reference count. When the reference count goes to zero, this credit will no longer be shown.
|
| |
| const CreditsSnapshot & | getSnapshot (CreditFilteringMode filteringMode=CreditFilteringMode::UniqueHtml) noexcept |
| | Gets a snapshot of the credits. The returned instance is only valid until the next call to this method.
|
| |
| const CreditSource & | getDefaultCreditSource () const noexcept |
| | Gets the default credit source used when no other source is specified.
|
| |
Creates and manages Credit objects. Avoids repetitions and tracks which credits should be shown and which credits should be removed this frame.
Definition at line 155 of file CreditSystem.h.
◆ addCreditReference()
| bool CesiumUtility::CreditSystem::addCreditReference |
( |
Credit | credit | ) |
|
Adds a reference to a credit, incrementing its reference count. The referenced credit will be shown until its reference count goes back down to zero.
- Parameters
-
| credit | The credit to reference. |
- Returns
true if the credit was valid and the reference was added. false if the credit was created by a CreditSource that has been destroyed and so the reference could not be added.
◆ createCredit() [1/4]
| Credit CesiumUtility::CreditSystem::createCredit |
( |
const CreditSource & | source, |
|
|
const std::string & | html, |
|
|
bool | showOnScreen = false ) |
Inserts a credit string.
- Parameters
-
| source | The source of the credit. This should be an instance created and owned by a tileset, raster overlay, or other data source. |
| html | The HTML string for the credit. |
| showOnScreen | Whether or not the credit should be shown on screen. Credits not shown on the screen should be shown in a separate popup window. |
- Returns
- If this string already exists from the same source, returns a Credit handle to the existing entry. Otherwise returns a Credit handle to a new entry.
◆ createCredit() [2/4]
| Credit CesiumUtility::CreditSystem::createCredit |
( |
const CreditSource & | source, |
|
|
std::string && | html, |
|
|
bool | showOnScreen = false ) |
Inserts a credit string.
- Parameters
-
| source | The source of the credit. This should be an instance created and owned by a tileset, raster overlay, or other data source. |
| html | The HTML string for the credit. |
| showOnScreen | Whether or not the credit should be shown on screen. Credits not shown on the screen should be shown in a separate popup window. |
- Returns
- If this string already exists from the same source, returns a Credit handle to the existing entry. Otherwise returns a Credit handle to a new entry.
◆ createCredit() [3/4]
| Credit CesiumUtility::CreditSystem::createCredit |
( |
const std::string & | html, |
|
|
bool | showOnScreen = false ) |
◆ createCredit() [4/4]
| Credit CesiumUtility::CreditSystem::createCredit |
( |
std::string && | html, |
|
|
bool | showOnScreen = false ) |
◆ getCreditSource()
Gets the source of this credit.
- Returns
- The source of this credit, or nullptr if the credit is invalid or was created by a CreditSource that has been destroyed.
◆ getDefaultCreditSource()
| const CreditSource & CesiumUtility::CreditSystem::getDefaultCreditSource |
( |
| ) |
const |
|
noexcept |
Gets the default credit source used when no other source is specified.
- Deprecated
- Instead of using the default, create a CreditSource instance for each tileset, raster overlay, or other data source.
◆ getSnapshot()
Gets a snapshot of the credits. The returned instance is only valid until the next call to this method.
The snapshot will include a sorted list of credits that are currently active, as well as a list of credits that have been removed since the last snapshot.
- Parameters
-
| filteringMode | Specifies how multiple credits with the same HTML string should be reported in the snapshot. |
◆ removeCreditReference()
| bool CesiumUtility::CreditSystem::removeCreditReference |
( |
Credit | credit | ) |
|
Removes a reference from a credit, decrementing its reference count. When the reference count goes to zero, this credit will no longer be shown.
- Parameters
-
| credit | The credit from which to remove a reference. |
- Returns
true if the credit was valid and the reference was removed. false if the credit was created by a CreditSource that has been destroyed and so the reference could not be removed.
◆ CreditReferencer
◆ CreditSource
The documentation for this class was generated from the following file:
- /home/runner/work/cesium-native/cesium-native/CesiumUtility/include/CesiumUtility/CreditSystem.h