SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
11 #ifndef smtk_extension_paraview_appcomponents_GeometricVisibilityBadge_h
12 #define smtk_extension_paraview_appcomponents_GeometricVisibilityBadge_h
14 #include "smtk/extension/paraview/appcomponents/smtkPQComponentsExtModule.h"
15 #include "smtk/extension/qt/VisibilityBadge.h"
20 #include "smtk/view/Badge.h"
21 #include "smtk/view/BadgeSet.h"
22 #include "smtk/view/Configuration.h"
23 #include "smtk/view/DescriptivePhrase.h"
24 #include "smtk/view/PhraseModel.h"
31 class pqRepresentation;
39 namespace appcomponents
62 std::size_t m_numberOfVisibleChildren = 0;
63 std::size_t m_numberOfInvisibleChildren = 0;
65 bool m_isResource =
false;
76 bool decrementNumChildren =
false,
77 std::size_t offset = 0)
const;
86 bool decrementNumChildren =
false,
87 std::size_t offset = 0)
const;
93 mutable std::map<smtk::view::DescriptivePhrase*, PhraseInfo> m_phraseInfos;
103 bool okToCreate =
true);
112 bool isResource =
false);
116 void updateForRemoval(
118 std::size_t numVisibleChildrenToBeRemoved,
119 std::size_t numInvisibleChildrenToBeRemoved,
120 std::size_t numNeitherChildrenToBeRemoved);
123 void clear() { m_phraseInfos.clear(); }
132 void removeSubTreeVisibilities(
134 std::map<smtk::common::UUID, int>& uuidToRepVisibility,
135 bool isTopOfSubTree);
147 std::map<smtk::view::DescriptivePhrase*, PhraseInfo>&
phraseInfos()
const
149 return m_phraseInfos;
168 bool appliesToPhrase(
const DescriptivePhrase* phrase)
const override;
172 return std::string(
"Click to toggle this object's visibility and not its children.");
174 std::string icon(
const DescriptivePhrase* phrase,
const std::array<float, 4>&)
const override;
177 bool action(
const DescriptivePhrase* phrase,
const BadgeAction& act)
override;
181 void setPhraseVisibility(
const DescriptivePhrase* phrase,
int val);
182 bool phraseVisibility(
const DescriptivePhrase* phrase)
const;
192 static std::string convertVisibilityToString(
const VisibilityState& state);
196 void activeViewChanged(
pqView* view);
197 void representationAddedToActiveView(pqRepresentation* rep);
198 void representationRemovedFromActiveView(pqRepresentation* rep);
203 std::map<smtk::common::UUID, int> m_uuidToRepVisibility;
209 const std::vector<int>& src,
210 const std::vector<int>& dst,
211 const std::vector<int>& range);
217 std::string m_iconClosed;
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
void clear()
Clear the entire cache/.
Definition: GeometricVisibilityBadge.h:123
A base class for descriptive-phrase badges.
Definition: Badge.h:78
Definition: Observers.h:106
Definition: RespondToVTKSelection.cxx:39
A container for the badges that apply to a view.
Definition: BadgeSet.h:32
std::map< smtk::view::DescriptivePhrase *, PhraseInfo > & phraseInfos() const
Return the cache of PhaseInfos.
Definition: GeometricVisibilityBadge.h:147
VisibilityState
Represents possible visibility.
Definition: GeometricVisibilityBadge.h:49
PhraseModelEvent
Events that can be observed on an smtk::view::PhraseModel.
Definition: PhraseModelObserver.h:26
store the visibility information related to a Phrase
Definition: GeometricVisibilityBadge.h:60
#define smtkCreateMacro(...)
Add static create() methods to a class.
Definition: SharedFromThis.h:173
#define smtkSharedFromThisMacro(...)
A macro to help with derived classes whose bases enable shared_from_this().
Definition: SharedFromThis.h:250
An empty base class for badges controlling visibility of objects (in other views).
Definition: VisibilityBadge.h:44
Hold and maintain a descriptive phrase hierarchy.
Definition: PhraseModel.h:101
#define smtkTypeMacro(...)
Add typedefs to a class for identifcation.
Definition: SharedFromThis.h:128
A base class for phrases describing an SMTK model.
Definition: DescriptivePhrase.h:76
#define smtkSuperclassMacro(...)
Add a typedef to the superclass of this class.
Definition: SharedFromThis.h:147
Configure one item in a view, which may contain children.
Definition: Configuration.h:32
smtk::shared_ptr< smtk::view::DescriptivePhrase > DescriptivePhrasePtr
Definition: PublicPointerDefs.h:627
A base class for actions taken on badges.
Definition: Badge.h:34
A badge to show/toggle a Phrase's renderable geometry's visibility.
Definition: GeometricVisibilityBadge.h:43
Caches the phrase visibility information for Phrases in a Phrase Model.
Definition: GeometricVisibilityBadge.h:91
Macros for dealing with shared-pointer classes.
std::string tooltip(const DescriptivePhrase *) const override
Return a tool-tip string for the badge that is relevant to this phrase.
Definition: GeometricVisibilityBadge.h:170
smtk::shared_ptr< smtk::resource::Component > ComponentPtr
Definition: PublicPointerDefs.h:304