SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
A badge to show/toggle a Phrase's renderable geometry's visibility. More...
#include <GeometricVisibilityBadge.h>
Classes | |
struct | PhraseCache |
Caches the phrase visibility information for Phrases in a Phrase Model. More... | |
struct | PhraseInfo |
store the visibility information related to a Phrase More... | |
Public Types | |
enum | VisibilityState { VisibilityState::Neither, VisibilityState::Invisible = 0, VisibilityState::Visible = 1 } |
Represents possible visibility. More... | |
using | DescriptivePhrase = smtk::view::DescriptivePhrase |
using | BadgeAction = smtk::view::BadgeAction |
Public Member Functions | |
smtkTypeMacro (smtk::extension::paraview::appcomponents::GeometricVisibilityBadge) | |
smtkSuperclassMacro (smtk::extension::qt::VisibilityBadge) | |
smtkSharedFromThisMacro (smtk::view::Badge) | |
smtkCreateMacro (smtk::view::Badge) | |
GeometricVisibilityBadge (smtk::view::BadgeSet &parent, const smtk::view::Configuration::Component &) | |
bool | appliesToPhrase (const DescriptivePhrase *phrase) const override |
Returns true if the badge should appear next to the given phrase: | |
std::string | tooltip (const DescriptivePhrase *) const override |
Return a tool-tip string for the badge that is relevant to this phrase. More... | |
std::string | icon (const DescriptivePhrase *phrase, const std::array< float, 4 > &) const override |
Returns a string for rendering the badge icon. More... | |
bool | action (const DescriptivePhrase *phrase, const BadgeAction &act) override |
take an action when the badge is clicked. | |
void | setPhraseVisibility (const DescriptivePhrase *phrase, int val) |
Set and get the visibility for this phrase. | |
bool | phraseVisibility (const DescriptivePhrase *phrase) const |
Set and get the visibility for this phrase. | |
GeometricVisibilityBadge::PhraseCache & | phraseCache () |
Get the visibility cache. | |
const GeometricVisibilityBadge::PhraseCache & | phraseCache () const |
Get the visibility cache. | |
Public Member Functions inherited from smtk::view::Badge | |
smtkTypeMacroBase (Badge) | |
Badge (const Badge &)=delete | |
Badge & | operator= (const Badge &)=delete |
bool | isDefault () const |
Return whether this badge be invoked by non-specific user gestures. More... | |
void | setIsDefault (bool isDefault) |
Set this badge as a default. | |
Static Public Member Functions | |
static std::string | convertVisibilityToString (const VisibilityState &state) |
Class method for returning a string representation of a visibility emum value. | |
Protected Slots | |
void | activeViewChanged (pqView *view) |
handle the active view changing, change the visible icons. | |
void | representationAddedToActiveView (pqRepresentation *rep) |
void | representationRemovedFromActiveView (pqRepresentation *rep) |
void | componentVisibilityChanged (const smtk::resource::ComponentPtr &comp, bool visible) |
Protected Member Functions | |
smtk::view::PhraseModel * | phraseModel () const |
void | updateObserver (smtk::view::DescriptivePhrasePtr phrase, smtk::view::PhraseModelEvent event, const std::vector< int > &src, const std::vector< int > &dst, const std::vector< int > &range) |
Observer handler method. | |
Protected Attributes | |
std::map< smtk::common::UUID, int > | m_uuidToRepVisibility |
smtk::view::PhraseModel::Observers::Key | m_key |
Protected Attributes inherited from smtk::view::Badge | |
bool | m_isDefault { false } |
Should this badge be invoked by non-specific user gestures when it is applicable? | |
A badge to show/toggle a Phrase's renderable geometry's visibility.
|
overridevirtual |
Returns a string for rendering the badge icon.
The string is currently interpreted by qtDescriptivePhraseDelegate::paint() as scalable vector graphics (SVG).
The icon may change depending on (1) the state of the phrase or its parent view, (2) the background color of the phrase.
Implements smtk::view::Badge.
|
inlineoverridevirtual |
Return a tool-tip string for the badge that is relevant to this phrase.
An empty string (the default) indicates that no tooltip should be shown. If a non-empty string is returned, it should describe the meaning of the badge to the user. If the badge changes its SVG based on application state, the tip should be specific to its current state.
For example, a badge that controls visibility of a phrase's subject in a render-window should say either "Click to show <title>" when the phrase's subject is hidden or "Click to hide <title>" when the phrase's subject is visible.
Reimplemented from smtk::view::Badge.