Cogs.Core
Classes | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
Cogs::Core::OGC3DTilesSystem Class Reference
Inheritance diagram for Cogs::Core::OGC3DTilesSystem:
Cogs::Core::ComponentSystemWithDataPool< OGC3DTilesComponent, OGC3DTilesDataHolder > Cogs::Core::ComponentSystemWithDataPools< ComponentType, DataTypes > Cogs::Core::ComponentSystem< ComponentType > Cogs::Core::ComponentSystemBase

Classes

struct  LoadedModel
 
struct  Node
 
struct  TileCandidate
 

Public Member Functions

 OGC3DTilesSystem (Cogs::Memory::Allocator *allocator, Cogs::ComponentIndex capacity)
 
void initialize (Context *context) override
 Initialize the system.
 
void update (Context *context) override
 Provided for custom update logic in derived systems.
 
ComponentHandle createComponent () override
 
void destroyComponent (ComponentHandle component) override
 
- Public Member Functions inherited from Cogs::Core::ComponentSystemWithDataPool< OGC3DTilesComponent, OGC3DTilesDataHolder >
 ComponentSystemWithDataPool (Memory::Allocator *allocator, SizeType size=1024)
 
OGC3DTilesDataHoldergetData (const OGC3DTilesComponent *component)
 
const OGC3DTilesDataHoldergetData (const OGC3DTilesComponent *component) const
 
- Public Member Functions inherited from Cogs::Core::ComponentSystemWithDataPools< ComponentType, DataTypes >
 ComponentSystemWithDataPools (Memory::Allocator *allocator, SizeType size=1024, MemBlockType componentMemType=MemBlockType::Component, MemBlockType dataMemType=MemBlockType::ComponentData)
 
ComponentHandle createComponent () override
 
void destroyComponent (ComponentHandle component) override
 
template<typename T >
T & getData (const ComponentType *component)
 Get the data stored for the given component from the data pool storing objects of the specified template type.
 
template<typename T >
const T & getData (const ComponentType *component) const
 Get the const data stored for the given component from the data pool storing objects of the specified template type.
 
- Public Member Functions inherited from Cogs::Core::ComponentSystem< ComponentType >
 ComponentSystem (Memory::Allocator *allocator, SizeType size=16384, MemBlockType componentMemType=MemBlockType::Component)
 
void instrumentedPreUpdate () override
 Provided for tagged engine instrumentation.
 
void instrumentedUpdate () override
 Provided for tagged engine instrumentation.
 
void instrumentedPostUpdate () override
 Provided for tagged engine instrumentation.
 
ComponentHandle createComponent () override
 Create a new component instance.
 
void destroyComponent (ComponentHandle component) override
 Destroy the component held by the given handle.
 
SizeType getComponentIndex (const Component *component) const
 Get the index of the given component in the component pool.
 
size_t size ()
 Returns the number of active components.
 
void clearCarryFlags ()
 Clear carry flags of all active components.
 
void resetFlags ()
 Reset the flags of all active components.
 
void prepareUpdate (Context *) override
 
void postUpdate (Context *) override
 
ComponentHandle getHandle (const ComponentType *component)
 Get a handle to the given Component instance.
 
virtual void addEntitiesWithComponent (std::vector< EntityId > &entities, Reflection::TypeId componentTypeId) override
 Return all entities with a given.
 
- Public Member Functions inherited from Cogs::Core::ComponentSystemBase
virtual ~ComponentSystemBase ()
 Provided for destruction via pointer to base.
 
 ComponentSystemBase (Reflection::TypeId componentType)
 Constructs a ComponentSystemBase to manage components of the given componentType.
 
virtual void initialize (Context *context)
 Initialize the system.
 
void preUpdate ()
 Run the pre-update method of the system.
 
void update ()
 Updates the system state to that of the current frame.
 
void postUpdate ()
 Perform post update logic in the system.
 
virtual void preUpdate (Context *)
 Provided for custom pre update logic in derived systems.
 
virtual void prepareUpdate (Context *)
 Provided for custom update preparation logic in derived systems.
 
virtual void update (Context *)
 Provided for custom update logic in derived systems.
 
virtual void postUpdate (Context *)
 Provided for custom post update logic in derived systems.
 
virtual void instrumentedPreUpdate ()
 Provided for tagged engine instrumentation.
 
virtual void instrumentedUpdate ()
 Provided for tagged engine instrumentation.
 
virtual void instrumentedPostUpdate ()
 Provided for tagged engine instrumentation.
 
virtual void addEntitiesWithComponent (std::vector< EntityId > &, Reflection::TypeId)
 Return all entities with a given.
 
virtual void cleanup (Context *)
 Provided for custom cleanup logic in derived systems.
 
virtual ComponentHandle createComponent ()
 Create a new component instance.
 
virtual void destroyComponent (ComponentHandle)
 Destroy the component held by the given handle.
 
Reflection::TypeId getComponentType () const
 Get the reflected type of the components managed by this system.
 

Static Public Member Functions

static bool componentIsStale (Context *context, uint32_t id)
 
- Static Public Member Functions inherited from Cogs::Core::ComponentSystem< ComponentType >
static Reflection::TypeId getTypeId ()
 Get the type id of the component type used by the system.
 

Private Types

using base_type = Cogs::Core::ComponentSystem< OGC3DTilesComponent >
 

Private Member Functions

void initializeTileset (OGC3DTilesComponent *component, OGC3DTilesData *componentState)
 
void traverseTileset (const OGC3DTilesComponent *component, OGC3DTilesData *componentState, const OGC3DTilesTileset::Tileset *tileset, float gracePeriodBeforeTileRemoval)
 
uint64_t fetchAndInitializeTileset (const uint64_t tilesetGUID, const std::string &tilesetURL, OGC3DTilesComponent *component, uint32_t uniqueComponentId)
 
Cogs::Core::DataFetcherManager::FetchId fetchAndInitializeAsset (OGC3DTilesComponent *component, uint32_t uniqueComponentId)
 
Node buildExplicitTree (OGC3DTilesData *componentState, const OGC3DTilesTileset::Tileset *tileset, const OGC3DTilesTileset::Tile *tile, const std::string &tileIdStr, const glm::mat4 &currentTransform, const glm::mat4 &globalTransform, std::unordered_set< const OGC3DTilesTileset::Tileset * > &visitedTilesets) const
 
Node buildImplicitTree (OGC3DTilesData *componentState, const OGC3DTilesTileset::Tileset *tileset, const OGC3DTiles::Coord &coord, const glm::mat4 &globalTransform) const
 
void collectTileCandidates (OGC3DTilesData *componentState, const Node *node, std::unordered_map< uint64_t, TileCandidate > &target) const
 
void calculateTileVisibilities (OGC3DTilesData *componentState, const OGC3DTilesTileset::Tileset *tileset, const Node *node) const
 
bool allChildrenAreReady (OGC3DTilesData *componentState, const OGC3DTilesTileset::Tileset *tileset, const Node *node) const
 
bool tileHasReadyContent (OGC3DTilesData *componentState, const OGC3DTilesTileset::Tileset *tileset, uint64_t tileId) const
 
bool tileHasModelRequests (const OGC3DTilesData *componentState, const OGC3DTilesTileset::Tileset *tileset, uint64_t tileId) const
 
bool tileHasSubTilesetRequests (const OGC3DTilesData *componentState, uint64_t tileId) const
 
void setTileVisibility (const OGC3DTilesData *componentState, const OGC3DTilesTileset::Tileset *tileset, uint64_t tileId, bool onoff) const
 
void setVisibilityForAllTiles (const OGC3DTilesData *componentState, bool onoff) const
 
bool modelIsReady (const ModelHandle &modelhandle) const
 
size_t pruneTileCache (OGC3DTilesData *componentState, const OGC3DTilesTileset::Tileset *tileset, float gracePeriodBeforeTileRemoval) const
 
void removeTileFromScene (OGC3DTilesData *componentState, const OGC3DTilesTileset::Tileset *tileset, uint64_t tileId) const
 
void requestSubTileset (OGC3DTilesData *componentState, const std::string &fullURL, uint64_t tileId, const OGC3DTilesTileset::Tileset *parentTileset) const
 
void requestSubtree (OGC3DTilesData *componentState, const OGC3DTilesTileset::Tileset *tileset, const OGC3DTiles::Coord &coord) const
 
bool requestModel (OGC3DTilesData *componentState, const OGC3DTilesTileset::Tileset *tileset, const TileCandidate &tile, const std::string URL) const
 
void loadMissingModels (OGC3DTilesData *componentState, const OGC3DTilesTileset::Tileset *tileset, const std::unordered_map< uint64_t, TileCandidate > &toBeLoaded) const
 
void addModelToScene (const std::string &uniqueName, TileCandidate tile, ModelHandle handle, const OGC3DTilesData *componentState) const
 
void addBBoxIndicatorToScene (OGC3DTilesData *componentState, const OGC3DTilesTileset::Tileset *tileset, uint64_t tileId, Cogs::Geometry::DBoundingBox box) const
 
void removeBBoxIndicatorFromScene (OGC3DTilesData *componentState, const OGC3DTilesTileset::Tileset *tileset, uint64_t tileId) const
 
void cancelStaleModelRequests (OGC3DTilesData *componentState, const OGC3DTilesTileset::Tileset *tileset, const Node &node) const
 
void processModelRequests (OGC3DTilesData *componentState, const OGC3DTilesTileset::Tileset *tileset, uint32_t frameNumber) const
 
void processSubtreeRequests (const OGC3DTilesComponent *component, OGC3DTilesData *componentState, const OGC3DTilesTileset::Tileset *tileset)
 
void processSubTilesetRequests (const OGC3DTilesComponent *component, OGC3DTilesData *componentState)
 
bool hasPendingRequests (const OGC3DTilesData *componentState) const
 
void cleanupPendingSubtreeRequests (OGC3DTilesData *componentState, const OGC3DTilesTileset::Tileset *tileset) const
 
bool isInsideFrustum (const Cogs::Geometry::DBoundingBox &box) const
 
glm::dvec3 getCurrentCameraPosition () const
 
OGC3DTilesSubtree::SubtreegetSubtreeForTileCoord (OGC3DTilesData *componentState, const OGC3DTilesTileset::Tileset *tileset, const OGC3DTiles::Coord &coord) const
 
std::vector< OGC3DTiles::CoordgetTileCoordChildren (OGC3DTilesData *componentState, const OGC3DTilesTileset::Tileset *tileset, const OGC3DTiles::Coord &parent) const
 
std::string addOptionalURLParameters (const OGC3DTilesData *componentState, const std::string &url) const
 
bool extractAndStoreOptionalSessionKeys (OGC3DTilesData *componentState, const std::string &url) const
 
void applyMaterialToAllModels (const OGC3DTilesData *componentState, MaterialInstanceHandle materialHandle)
 
void applyMaterialToModel (const OGC3DTilesSystem::LoadedModel &model, MaterialInstanceHandle materialHandle)
 

Static Private Member Functions

static uint64_t makeCacheKey (const OGC3DTiles::Coord &coord)
 
static std::string buildSubtreeURL (const OGC3DTilesData *componentState, const OGC3DTilesTileset::Tileset *tileset, const OGC3DTiles::Coord &coord)
 
static bool modelIsEmpty (const ModelHandle handle)
 
static void printDebugStats (const OGC3DTilesData *componentState)
 
static std::string compileURL (const std::string &baseURL, const std::string &tilesetPath, const std::string &modelPath)
 

Private Attributes

OGC3DTilesBoundsbounds = nullptr
 
std::string accessToken = ""
 
double timestampOfLastCameraMovement = 0.0
 
glm::mat4 lastCameraViewProjection = glm::mat4(-1)
 

Additional Inherited Members

- Public Types inherited from Cogs::Core::ComponentSystem< ComponentType >
typedef ComponentType component_type
 
- Public Attributes inherited from Cogs::Core::ComponentSystem< ComponentType >
ComponentPool< ComponentType > pool
 Pool of components managed by the system.
 
- Public Attributes inherited from Cogs::Core::ComponentSystemBase
Reflection::TypeId componentType
 The type of components managed by this instance.
 
Contextcontext = nullptr
 Pointer to the Context instance the system lives in.
 

Detailed Description

Definition at line 38 of file OGC3DTilesSystem.h.

Member Typedef Documentation

◆ base_type

Definition at line 40 of file OGC3DTilesSystem.h.

Constructor & Destructor Documentation

◆ OGC3DTilesSystem()

OGC3DTilesSystem::OGC3DTilesSystem ( Cogs::Memory::Allocator allocator,
Cogs::ComponentIndex  capacity 
)

Definition at line 101 of file OGC3DTilesSystem.cpp.

Member Function Documentation

◆ addBBoxIndicatorToScene()

void OGC3DTilesSystem::addBBoxIndicatorToScene ( OGC3DTilesData componentState,
const OGC3DTilesTileset::Tileset tileset,
uint64_t  tileId,
Cogs::Geometry::DBoundingBox  box 
) const
private

Definition at line 1541 of file OGC3DTilesSystem.cpp.

◆ addModelToScene()

void OGC3DTilesSystem::addModelToScene ( const std::string &  uniqueName,
TileCandidate  tile,
ModelHandle  handle,
const OGC3DTilesData componentState 
) const
private

◆ addOptionalURLParameters()

std::string OGC3DTilesSystem::addOptionalURLParameters ( const OGC3DTilesData componentState,
const std::string &  url 
) const
private

Definition at line 557 of file OGC3DTilesSystem.cpp.

◆ allChildrenAreReady()

bool OGC3DTilesSystem::allChildrenAreReady ( OGC3DTilesData componentState,
const OGC3DTilesTileset::Tileset tileset,
const Node node 
) const
private

Check if all children are ready. We might have to dig several layers down. Returns TRUE if all children are ready.

Definition at line 1215 of file OGC3DTilesSystem.cpp.

References allChildrenAreReady(), and tileHasReadyContent().

Referenced by allChildrenAreReady(), and calculateTileVisibilities().

◆ applyMaterialToAllModels()

void OGC3DTilesSystem::applyMaterialToAllModels ( const OGC3DTilesData componentState,
MaterialInstanceHandle  materialHandle 
)
private

Definition at line 201 of file OGC3DTilesSystem.cpp.

◆ applyMaterialToModel()

void OGC3DTilesSystem::applyMaterialToModel ( const OGC3DTilesSystem::LoadedModel model,
MaterialInstanceHandle  materialHandle 
)
private

Definition at line 213 of file OGC3DTilesSystem.cpp.

◆ buildExplicitTree()

OGC3DTilesSystem::Node OGC3DTilesSystem::buildExplicitTree ( OGC3DTilesData componentState,
const OGC3DTilesTileset::Tileset tileset,
const OGC3DTilesTileset::Tile tile,
const std::string &  tileIdStr,
const glm::mat4 &  currentTransform,
const glm::mat4 &  globalTransform,
std::unordered_set< const OGC3DTilesTileset::Tileset * > &  visitedTilesets 
) const
private

Walk the tileset and collect all tiles which are within the view-frustrum. The distance of a tile to the camera will determine which detail level we'll use. Tiles close to the camera will be collected deeper from the tree than tiles far away (ie. at a higher resolution level).

Definition at line 1404 of file OGC3DTilesSystem.cpp.

References buildExplicitTree(), and Cogs::hash().

Referenced by buildExplicitTree().

◆ buildImplicitTree()

OGC3DTilesSystem::Node OGC3DTilesSystem::buildImplicitTree ( OGC3DTilesData componentState,
const OGC3DTilesTileset::Tileset tileset,
const OGC3DTiles::Coord coord,
const glm::mat4 &  globalTransform 
) const
private

Walk the tree (quad- or oct-tree) and collect all tiles which are within the view-frustrum. The distance of a tile to the camera will determine which detail level we'll use. Tiles close to the camera will be collected deeper from the tree than tiles far away (ie. at a higher resolution level).

Definition at line 1301 of file OGC3DTilesSystem.cpp.

References buildImplicitTree(), and getSubtreeForTileCoord().

Referenced by buildImplicitTree().

◆ buildSubtreeURL()

std::string OGC3DTilesSystem::buildSubtreeURL ( const OGC3DTilesData componentState,
const OGC3DTilesTileset::Tileset tileset,
const OGC3DTiles::Coord coord 
)
staticprivate

Definition at line 1114 of file OGC3DTilesSystem.cpp.

◆ calculateTileVisibilities()

void OGC3DTilesSystem::calculateTileVisibilities ( OGC3DTilesData componentState,
const OGC3DTilesTileset::Tileset tileset,
const Node node 
) const
private

This method will traverse the tree top down and hide tiles depending on the state of the tile's loaded data. This method assumes that all tiles are visible by default when in "waitForTileSiblings"-mode.

Definition at line 1263 of file OGC3DTilesSystem.cpp.

References allChildrenAreReady(), calculateTileVisibilities(), and tileHasReadyContent().

Referenced by calculateTileVisibilities().

◆ cancelStaleModelRequests()

void OGC3DTilesSystem::cancelStaleModelRequests ( OGC3DTilesData componentState,
const OGC3DTilesTileset::Tileset tileset,
const Node node 
) const
private

Definition at line 355 of file OGC3DTilesSystem.cpp.

◆ cleanupPendingSubtreeRequests()

void OGC3DTilesSystem::cleanupPendingSubtreeRequests ( OGC3DTilesData componentState,
const OGC3DTilesTileset::Tileset tileset 
) const
private

Some subtrees have external binary files which are loaded async. This method will go through all registered/active subtree-requests and remove those who no longer have any pending requests for external files.

Definition at line 396 of file OGC3DTilesSystem.cpp.

References Cogs::hash(), and makeCacheKey().

◆ collectTileCandidates()

void OGC3DTilesSystem::collectTileCandidates ( OGC3DTilesData componentState,
const Node node,
std::unordered_map< uint64_t, TileCandidate > &  target 
) const
private

This method will traverse the node-tree and register all tile candidates in "target".

Definition at line 1241 of file OGC3DTilesSystem.cpp.

References collectTileCandidates().

Referenced by collectTileCandidates().

◆ compileURL()

std::string OGC3DTilesSystem::compileURL ( const std::string &  baseURL,
const std::string &  tilesetPath,
const std::string &  modelPath 
)
staticprivate

Definition at line 175 of file OGC3DTilesSystem.cpp.

◆ componentIsStale()

bool OGC3DTilesSystem::componentIsStale ( Context context,
uint32_t  id 
)
static

Used for detecting if a component is valid or has been destroyed. The 'uniqueComponentId' value is autogenerated when the component is created and stored in its data-bundle.

Definition at line 159 of file OGC3DTilesSystem.cpp.

References Cogs::Core::ComponentSystemBase::context, and Cogs::Core::ComponentSystem< ComponentType >::pool.

◆ createComponent()

ComponentHandle OGC3DTilesSystem::createComponent ( )
overridevirtual

Overridden to update data pool contents in lockstep with the component pool. Any subclass overriding this method should call base class first.

Reimplemented from Cogs::Core::ComponentSystemWithDataPools< ComponentType, DataTypes >.

Definition at line 1633 of file OGC3DTilesSystem.cpp.

References Cogs::Core::Context::bounds, Cogs::Core::ComponentSystemBase::context, Cogs::Core::ComponentSystemBase::createComponent(), Cogs::Core::ComponentSystem< ComponentType >::pool, and Cogs::ComponentModel::ComponentHandle::resolve().

◆ destroyComponent()

void OGC3DTilesSystem::destroyComponent ( ComponentHandle  component)
overridevirtual

◆ extractAndStoreOptionalSessionKeys()

bool OGC3DTilesSystem::extractAndStoreOptionalSessionKeys ( OGC3DTilesData componentState,
const std::string &  url 
) const
private

Extract optional "session=" value from URL. Returns TRUE if a value was found.

Definition at line 512 of file OGC3DTilesSystem.cpp.

◆ fetchAndInitializeAsset()

Cogs::Core::DataFetcherManager::FetchId OGC3DTilesSystem::fetchAndInitializeAsset ( OGC3DTilesComponent component,
uint32_t  uniqueComponentId 
)
private

Definition at line 615 of file OGC3DTilesSystem.cpp.

◆ fetchAndInitializeTileset()

uint64_t OGC3DTilesSystem::fetchAndInitializeTileset ( const uint64_t  tilesetGUID,
const std::string &  tilesetURL,
OGC3DTilesComponent component,
uint32_t  uniqueComponentId 
)
private

Definition at line 675 of file OGC3DTilesSystem.cpp.

◆ getCurrentCameraPosition()

glm::dvec3 OGC3DTilesSystem::getCurrentCameraPosition ( ) const
private

Definition at line 1715 of file OGC3DTilesSystem.cpp.

◆ getSubtreeForTileCoord()

OGC3DTilesSubtree::Subtree * OGC3DTilesSystem::getSubtreeForTileCoord ( OGC3DTilesData componentState,
const OGC3DTilesTileset::Tileset tileset,
const OGC3DTiles::Coord coord 
) const
private

This method will first check the cache then load from URL if needed.

NOTE: This method will schedule loading of any missing subtrees, but this is an async process. It is therefore be possible that NULL is returned (for a while). Be patient.

Definition at line 1811 of file OGC3DTilesSystem.cpp.

References makeCacheKey(), and requestSubtree().

Referenced by buildImplicitTree().

◆ getTileCoordChildren()

std::vector< OGC3DTiles::Coord > OGC3DTilesSystem::getTileCoordChildren ( OGC3DTilesData componentState,
const OGC3DTilesTileset::Tileset tileset,
const OGC3DTiles::Coord parent 
) const
private

Definition at line 1756 of file OGC3DTilesSystem.cpp.

◆ hasPendingRequests()

bool OGC3DTilesSystem::hasPendingRequests ( const OGC3DTilesData componentState) const
private

Definition at line 413 of file OGC3DTilesSystem.cpp.

◆ initialize()

void OGC3DTilesSystem::initialize ( Context context)
overridevirtual

Initialize the system.

Initialization is performed after all systems are created and a renderer initialized, but before the first time anything is rendered.

Parameters
contextPointer to the context the system lives in.

Reimplemented from Cogs::Core::ComponentSystemBase.

Definition at line 109 of file OGC3DTilesSystem.cpp.

References Cogs::Core::ComponentSystemBase::context, Cogs::Core::ComponentSystemBase::initialize(), Cogs::Core::MaterialInstance::material, Cogs::Core::MaterialInstance::setVec4Property(), and Cogs::Core::Context::variables.

◆ initializeTileset()

void OGC3DTilesSystem::initializeTileset ( OGC3DTilesComponent component,
OGC3DTilesData componentState 
)
private

Definition at line 585 of file OGC3DTilesSystem.cpp.

◆ isInsideFrustum()

bool OGC3DTilesSystem::isInsideFrustum ( const Cogs::Geometry::DBoundingBox &  box) const
private

Definition at line 1721 of file OGC3DTilesSystem.cpp.

◆ loadMissingModels()

void OGC3DTilesSystem::loadMissingModels ( OGC3DTilesData componentState,
const OGC3DTilesTileset::Tileset tileset,
const std::unordered_map< uint64_t, TileCandidate > &  tilesInView 
) const
private

This method will go through all "tilesInView" and add requests for those tiles which are not already in the cache. Those who are will have their timestamp updated to prevent removal when cleanup is executed.

Definition at line 1052 of file OGC3DTilesSystem.cpp.

References Cogs::Core::ComponentSystemBase::context, requestModel(), Cogs::Core::Context::time, and Cogs::Core::Context::variables.

◆ makeCacheKey()

uint64_t OGC3DTilesSystem::makeCacheKey ( const OGC3DTiles::Coord coord)
staticprivate

Created a hash integer out of the coord's X, Y and Z + level. The Z will be omitted for Quad-trees.

NOTE: Coord-values are limited to 16bit range which should be more than enough.

Definition at line 1134 of file OGC3DTilesSystem.cpp.

References Cogs::hash().

Referenced by cleanupPendingSubtreeRequests(), getSubtreeForTileCoord(), and requestSubtree().

◆ modelIsEmpty()

bool OGC3DTilesSystem::modelIsEmpty ( const ModelHandle  handle)
staticprivate

Definition at line 1743 of file OGC3DTilesSystem.cpp.

◆ modelIsReady()

bool OGC3DTilesSystem::modelIsReady ( const ModelHandle modelhandle) const
private

Definition at line 863 of file OGC3DTilesSystem.cpp.

◆ printDebugStats()

void OGC3DTilesSystem::printDebugStats ( const OGC3DTilesData componentState)
staticprivate

Definition at line 183 of file OGC3DTilesSystem.cpp.

◆ processModelRequests()

void OGC3DTilesSystem::processModelRequests ( OGC3DTilesData componentState,
const OGC3DTilesTileset::Tileset tileset,
uint32_t  frameNumber 
) const
private

Definition at line 939 of file OGC3DTilesSystem.cpp.

◆ processSubTilesetRequests()

void OGC3DTilesSystem::processSubTilesetRequests ( const OGC3DTilesComponent component,
OGC3DTilesData componentState 
)
private

Definition at line 1837 of file OGC3DTilesSystem.cpp.

◆ processSubtreeRequests()

void OGC3DTilesSystem::processSubtreeRequests ( const OGC3DTilesComponent component,
OGC3DTilesData componentState,
const OGC3DTilesTileset::Tileset tileset 
)
private

Definition at line 1904 of file OGC3DTilesSystem.cpp.

◆ pruneTileCache()

size_t OGC3DTilesSystem::pruneTileCache ( OGC3DTilesData componentState,
const OGC3DTilesTileset::Tileset tileset,
float  gracePeriodBeforeTileRemoval 
) const
private

If the component's "enableCaching==TRUE" then pruning will be performed if the QualityService's 3DTiles variables are below certain values.

All tiles in the tileCache which have a timestamp older than "this->gracePeriodBeforeTileRemoval" will be deleted. (Along with the debug BBox – if the bbox feature is switched on)

Returns the number of tiles removed/released.

Definition at line 747 of file OGC3DTilesSystem.cpp.

References Cogs::Core::ComponentSystemBase::context, Cogs::Core::Context::engine, Cogs::ComponentModel::Component::getComponent(), Cogs::Core::EntityStore::getEntity(), Cogs::Core::Context::qualityService, Cogs::ComponentModel::Component::setChanged(), Cogs::Core::Context::store, Cogs::Core::Context::time, and Cogs::Core::SceneComponent::visible.

◆ removeBBoxIndicatorFromScene()

void OGC3DTilesSystem::removeBBoxIndicatorFromScene ( OGC3DTilesData componentState,
const OGC3DTilesTileset::Tileset tileset,
uint64_t  tileId 
) const
private

Definition at line 1613 of file OGC3DTilesSystem.cpp.

◆ removeTileFromScene()

void OGC3DTilesSystem::removeTileFromScene ( OGC3DTilesData componentState,
const OGC3DTilesTileset::Tileset tileset,
uint64_t  tileId 
) const
private

Definition at line 911 of file OGC3DTilesSystem.cpp.

◆ requestModel()

bool OGC3DTilesSystem::requestModel ( OGC3DTilesData componentState,
const OGC3DTilesTileset::Tileset tileset,
const TileCandidate tile,
const std::string  URL 
) const
private

Schedule loading of a model

Returns TRUE if a model was scheduled or already requested.

Definition at line 1015 of file OGC3DTilesSystem.cpp.

References Cogs::Core::ComponentSystemBase::context, and Cogs::Core::None.

Referenced by loadMissingModels().

◆ requestSubTileset()

void OGC3DTilesSystem::requestSubTileset ( OGC3DTilesData componentState,
const std::string &  fullURL,
uint64_t  tileId,
const OGC3DTilesTileset::Tileset parentTileset 
) const
private

Definition at line 1495 of file OGC3DTilesSystem.cpp.

◆ requestSubtree()

void OGC3DTilesSystem::requestSubtree ( OGC3DTilesData componentState,
const OGC3DTilesTileset::Tileset tileset,
const OGC3DTiles::Coord coord 
) const
private

Return a subtree from cache. If it does not exist a request will be added for the subtree. Requests are processed by the "processSubtreeRequests()" method each "update()". Only relevant for IMPLICIT trees.

Definition at line 1960 of file OGC3DTilesSystem.cpp.

References makeCacheKey().

Referenced by getSubtreeForTileCoord().

◆ setTileVisibility()

void OGC3DTilesSystem::setTileVisibility ( const OGC3DTilesData componentState,
const OGC3DTilesTileset::Tileset tileset,
uint64_t  tileId,
bool  onoff 
) const
private

Definition at line 831 of file OGC3DTilesSystem.cpp.

◆ setVisibilityForAllTiles()

void OGC3DTilesSystem::setVisibilityForAllTiles ( const OGC3DTilesData componentState,
bool  onoff 
) const
private

Definition at line 820 of file OGC3DTilesSystem.cpp.

◆ tileHasModelRequests()

bool OGC3DTilesSystem::tileHasModelRequests ( const OGC3DTilesData componentState,
const OGC3DTilesTileset::Tileset tileset,
uint64_t  tileId 
) const
private

Definition at line 1183 of file OGC3DTilesSystem.cpp.

◆ tileHasReadyContent()

bool OGC3DTilesSystem::tileHasReadyContent ( OGC3DTilesData componentState,
const OGC3DTilesTileset::Tileset tileset,
uint64_t  tileId 
) const
private

Check if tile's content is both loaded and uploaded to the GPU.

Definition at line 1150 of file OGC3DTilesSystem.cpp.

Referenced by allChildrenAreReady(), and calculateTileVisibilities().

◆ tileHasSubTilesetRequests()

bool OGC3DTilesSystem::tileHasSubTilesetRequests ( const OGC3DTilesData componentState,
uint64_t  tileId 
) const
private

Definition at line 1200 of file OGC3DTilesSystem.cpp.

◆ traverseTileset()

void OGC3DTilesSystem::traverseTileset ( const OGC3DTilesComponent component,
OGC3DTilesData componentState,
const OGC3DTilesTileset::Tileset tileset,
float  gracePeriodBeforeTileRemoval 
)
private

Definition at line 436 of file OGC3DTilesSystem.cpp.

◆ update()

void OGC3DTilesSystem::update ( Context )
overridevirtual

Member Data Documentation

◆ accessToken

std::string Cogs::Core::OGC3DTilesSystem::accessToken = ""
private

Definition at line 153 of file OGC3DTilesSystem.h.

◆ bounds

OGC3DTilesBounds* Cogs::Core::OGC3DTilesSystem::bounds = nullptr
private

Definition at line 152 of file OGC3DTilesSystem.h.

◆ lastCameraViewProjection

glm::mat4 Cogs::Core::OGC3DTilesSystem::lastCameraViewProjection = glm::mat4(-1)
private

Definition at line 156 of file OGC3DTilesSystem.h.

◆ timestampOfLastCameraMovement

double Cogs::Core::OGC3DTilesSystem::timestampOfLastCameraMovement = 0.0
private

Definition at line 155 of file OGC3DTilesSystem.h.


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