13 #ifndef SO_INTERACTION_H
14 #define SO_INTERACTION_H
17 #include <ThirdPartyWarningsDisable.h>
20 #include <ThirdPartyWarningsRestore.h>
47 ShiftMask = ShiftModifier,
48 CtrlMask = ControlModifier,
79 virtual void setEnabled(
bool enabled) { _enabled = enabled; touch(); }
84 std::string
getID()
const {
return _id; }
86 void setID(
const std::string&
id) { _id = id; touch(); }
104 virtual void setUserName(
const std::string& name) { _userName = name; touch(); }
109 virtual void setIconFile(
const std::string& file) { _iconFile = file; touch(); }
114 virtual void setDescription(
const std::string& descr) { _description = descr; touch(); }
122 inline bool isOfType()
const {
return static_cast<int>(_interactionType) == T::TypeId; }
149 std::string _userName;
150 std::string _iconFile;
151 std::string _description;
SoInteraction SoInteractionEntry
Provide deprecated old class name.
#define SOMANAGEDINTERACTION_API
File to resolve system dependencies in View2D library.
@ NoModifier
No modifier key.
@ ShiftModifier
Shift modifier key.
@ AllModifiersMask
All modifier keys.
@ ControlModifier
Control modifier key.
@ AltModifier
Alt modifier key.
SoInteractionOwner is a mix-in class for instances of SoNode that should have interaction objects.
SoInteraction is the base class for SoCommandAction, SoPointingAction, and SoOffsetAction.
virtual std::string getUserName() const
Returns user-visible name of this item for direct display (e.g., in tool box or menu).
virtual ~SoInteraction()
Virtual destructor.
bool isOfType() const
Convenience method for checking type.
virtual bool isEnabled() const
Returns the enabled status of this interaction - if this returns false, the action is not selectable ...
int getStateVersion() const
virtual void setEnabled(bool enabled)
Sets the enabled status of this interaction.
virtual std::string getIconFile() const
Returns the filename of an icon (e.g., for use in a tool box or in menu).
InteractionType
Enum identifying subtypes of this class.
SoInteraction(InteractionType type, SoInteractionOwner *owner, const std::string &id, bool registerWithOwner=true)
Standard constructor.
SoInteractionOwner * getOwner() const
Returns the interaction provider of this entry.
virtual void setUserName(const std::string &name)
Sets the user name of this interaction entry.
void setMenuPriority(int priority)
Sets the priority value for ordered display in menus/tool boxes.
virtual void setIconFile(const std::string &file)
Sets the filename of an icon used for this interaction entry.
void touch()
Increments the version number of attribute state to mark attribute changes.
InteractionType getInteractionType() const
Returns type of interaction object.
int getMenuPriority() const
void setID(const std::string &id)
Sets the ID of this interaction.
std::string getFullID() const
Returns the ID string consisting of the ID of the provider and this action's ID, separated by '.
std::string getID() const
Returns the ID of this interaction.
virtual std::string getDescription() const
Returns the description for user help.
virtual void setDescription(const std::string &descr)
Sets the description for user help.