Maria GDK 5.0.0.759
Documentation of native code in develop branch
Loading...
Searching...
No Matches
Maria::GeoRenderItemCollection Class Referencefinal

#include <MGeoRenderItemCollection.h>

Inheritance diagram for Maria::GeoRenderItemCollection:
Maria::ICollisionItemCollection

Public Member Functions

 GeoRenderItemCollection (const std::shared_ptr< ItemSelection > &selection)
 
void setGraphicsProjection (const std::shared_ptr< Maria::RasterProjector > &rp)
 Set reference projector.
 
void addItem (ItemId itemId, const std::shared_ptr< GeoRenderItem > &geoRenderItem)
 
void removeItem (ItemId itemId)
 
void clearItems ()
 Remove all active items.
 
std::shared_ptr< GeoRenderItemgetItem (ItemId itemId) const
 
bool exists (ItemId itemId)
 
void getRenderItemsBySelection (std::vector< std::shared_ptr< STK::RenderItem2D > > &selectedGraphicsItems, std::vector< std::shared_ptr< STK::RenderItem2D > > &unselectedGraphicsItems)
 Get all render items, split by selection state and sorted by depth/batch.
 
void updateRenderItems (const GeoRenderItemMap &visibleRenderItems, int64_t timestamp)
 Update the set of active graphics render items by adding any missing items, and removing any unlisted items.
 
void updateViewTransform (const Maria::RasterProjector &vp)
 Update viewport transform for all active items.
 
virtual void getCollisionItems (const std::shared_ptr< RasterProjector > &vp, std::vector< CollisionItem > &collisionItems, std::vector< CollisionItem > &alwaysVisibleItems) override
 get a list of all items to be collision detected. This method must be thread-safe as it will be called from another thread than the main/gui thread.
 
virtual void updateVisibility (const std::vector< VisibilityItem > &items) override
 Update the visibility of items according to the given list of collision items.
 
virtual bool needsCollisionUpdate (const RasterProjector &vp) const override
 Check if the collection has changed so that we need to recalculate the visibility. This can for example be if any new items have been added or removed, or if items have changed size or shape. Will be run from main thread only.
 
virtual void initCollisionUpdate () override
 Initialize collision update. This will be run after a collision update has been deemed necessary, and before the actual update thread is starting. It can be used to update generation counters, dirty flags, etc. Will be run from main thread only.
 
virtual int priority () const override
 Priority of this collection relative to other collections to be collision checked in the same grid. Higher priorities are added first and more likely to be shown.
 
virtual void getCollisionItems (const std::shared_ptr< RasterProjector > &vp, std::vector< CollisionItem > &collisionItems, std::vector< CollisionItem > &alwaysVisibleItems)=0
 get a list of all items to be collision detected. This method must be thread-safe as it will be called from another thread than the main/gui thread.
 
virtual void updateVisibility (const std::vector< VisibilityItem > &items)=0
 Update the visibility of items according to the given list of collision items.
 
virtual bool needsCollisionUpdate (const RasterProjector &vp) const =0
 Check if the collection has changed so that we need to recalculate the visibility. This can for example be if any new items have been added or removed, or if items have changed size or shape. Will be run from main thread only.
 
virtual void initCollisionUpdate ()=0
 Initialize collision update. This will be run after a collision update has been deemed necessary, and before the actual update thread is starting. It can be used to update generation counters, dirty flags, etc. Will be run from main thread only.
 
virtual int priority () const =0
 Priority of this collection relative to other collections to be collision checked in the same grid. Higher priorities are added first and more likely to be shown.
 

Detailed Description

GeoRenderItemCollection - Manages active GeoRenderItems in the draw layer This class is used for querying geo render items for rendering and collision detection (decluttering).

Member Function Documentation

◆ getCollisionItems()

void GeoRenderItemCollection::getCollisionItems ( const std::shared_ptr< RasterProjector > &  vp,
std::vector< CollisionItem > &  collisionItems,
std::vector< CollisionItem > &  alwaysVisibleItems 
)
overridevirtual

get a list of all items to be collision detected. This method must be thread-safe as it will be called from another thread than the main/gui thread.

Parameters
vpInclude items in this viewport.
collisionItems(output) vector of CollisionItems
alwaysVisibleItems(output) vector of items that should always be visible

Implements Maria::ICollisionItemCollection.

◆ initCollisionUpdate()

void Maria::GeoRenderItemCollection::initCollisionUpdate ( )
overridevirtual

Initialize collision update. This will be run after a collision update has been deemed necessary, and before the actual update thread is starting. It can be used to update generation counters, dirty flags, etc. Will be run from main thread only.

Implements Maria::ICollisionItemCollection.

◆ needsCollisionUpdate()

bool Maria::GeoRenderItemCollection::needsCollisionUpdate ( const RasterProjector vp) const
overridevirtual

Check if the collection has changed so that we need to recalculate the visibility. This can for example be if any new items have been added or removed, or if items have changed size or shape. Will be run from main thread only.

Parameters
vpOnly include items in this viewport.
Returns
True if an update is required, false if not.

Implements Maria::ICollisionItemCollection.

◆ priority()

int Maria::GeoRenderItemCollection::priority ( ) const
overridevirtual

Priority of this collection relative to other collections to be collision checked in the same grid. Higher priorities are added first and more likely to be shown.

Returns
Integer priority number. Higher numbers mean higher priority.

Implements Maria::ICollisionItemCollection.

◆ updateRenderItems()

void Maria::GeoRenderItemCollection::updateRenderItems ( const GeoRenderItemMap &  visibleRenderItems,
int64_t  timestamp 
)
inline

Update the set of active graphics render items by adding any missing items, and removing any unlisted items.

Parameters
visibleItemsThe list of currently visible items

◆ updateViewTransform()

void Maria::GeoRenderItemCollection::updateViewTransform ( const Maria::RasterProjector vp)
inline

Update viewport transform for all active items.

Parameters
vp

◆ updateVisibility()

void Maria::GeoRenderItemCollection::updateVisibility ( const std::vector< VisibilityItem > &  items)
overridevirtual

Update the visibility of items according to the given list of collision items.

Parameters
itemsItems with visibility information.

Implements Maria::ICollisionItemCollection.


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