SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Member Functions | List of all members
smtk::geometry::SelectionFootprint Struct Referenceabstract

An API for determining which components to render to display a selection. More...

#include <SelectionFootprint.h>

Inheritance diagram for smtk::geometry::SelectionFootprint:
[legend]
Collaboration diagram for smtk::geometry::SelectionFootprint:
[legend]

Public Member Functions

virtual bool operator() (smtk::resource::PersistentObject &selectedObject, std::unordered_set< smtk::resource::PersistentObject * > &footprint, const smtk::geometry::Backend &backend) const =0
 Add the "selection footprint" of selectedObject to the footprint set. More...
 
bool hasGeometry (smtk::resource::PersistentObject &object, const smtk::geometry::Backend &backend) const
 Returns true iff the given object has geometry for backend .
 
bool addAllComponentsIfResource (smtk::resource::PersistentObject &object, std::unordered_set< smtk::resource::PersistentObject * > &footprint, const smtk::geometry::Backend &backend) const
 If object is a Resource, add all the components it owns that have geometry. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from smtk::resource::query::DerivedFrom< SelectionFootprint, smtk::resource::query::Query >
static std::size_t typeIndex ()
 
- Static Public Member Functions inherited from smtk::resource::query::Query
static std::size_t typeIndex ()
 
- Protected Types inherited from smtk::resource::query::DerivedFrom< SelectionFootprint, smtk::resource::query::Query >
typedef smtk::resource::query::Query Parent
 
- Static Protected Member Functions inherited from smtk::resource::query::DerivedFrom< SelectionFootprint, smtk::resource::query::Query >
static int numberOfGenerationsFromType (const std::size_t index)
 Return the number of generations from this instance to the type index of a parent, or return a large negative number if the two types are unrelated.
 
- Static Protected Member Functions inherited from smtk::resource::query::Query
static int numberOfGenerationsFromType (const std::size_t index)
 

Detailed Description

An API for determining which components to render to display a selection.

Some components may not have any renderable geometry. However, users might still wish to select them. Examples include groups and volume cells in the smtk::model::Resource; they typically do not have geometry but their members or boundary faces do. When a group or volume is selected, we need a way to fetch the objects that should be highlighted in the stead of the group or volume.

This query allows SMTK's geometry representation to choose which components to render with the "selection" appearance. Normally, it will return the component itself if it has renderable geometry but otherwise will look for related components that might be highlighted to indicate the selection.

Member Function Documentation

◆ addAllComponentsIfResource()

bool smtk::geometry::SelectionFootprint::addAllComponentsIfResource ( smtk::resource::PersistentObject object,
std::unordered_set< smtk::resource::PersistentObject * > &  footprint,
const smtk::geometry::Backend backend 
) const
inline

If object is a Resource, add all the components it owns that have geometry.

Return false when object is not a Resource or when none of its components have any geometry for the given backend.

◆ operator()()

virtual bool smtk::geometry::SelectionFootprint::operator() ( smtk::resource::PersistentObject selectedObject,
std::unordered_set< smtk::resource::PersistentObject * > &  footprint,
const smtk::geometry::Backend backend 
) const
pure virtual

Add the "selection footprint" of selectedObject to the footprint set.

The footprint set is a container of persistent objects that should be rendered as "selected" instead of the input selectedObject, usually because selectedObject has no visual representation itself.

Returns true if at least one persistent object was added to (or was already in) the footprint set — either selectedObject itself or some other object.


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