MeVisLab Toolbox Reference
|
SoInteraction is the base class for SoCommandAction, SoPointingAction, and SoOffsetAction. More...
#include <SoInteraction.h>
Public Types | |
enum | { NoModifier = ManagedActionTrigger::NoModifier , ShiftModifier = ManagedActionTrigger::ShiftModifier , ControlModifier = ManagedActionTrigger::ControlModifier , AltModifier = ManagedActionTrigger::AltModifier , AllModifiersMask = ManagedActionTrigger::AllModifiersMask , ShiftMask = ShiftModifier , CtrlMask = ControlModifier , AltMask = AltModifier } |
Constants to use where keyboard modifiers must be specified. More... | |
enum | InteractionType { TypePointingAction , TypeCommandAction , TypeOffsetAction } |
Enum identifying subtypes of this class. More... | |
Public Member Functions | |
SoInteraction (InteractionType type, SoInteractionOwner *owner, const std::string &id, bool registerWithOwner=true) | |
Standard constructor. More... | |
virtual | ~SoInteraction () |
Virtual destructor. More... | |
SoInteractionOwner * | getOwner () const |
Returns the interaction provider of this entry. More... | |
virtual bool | isEnabled () const |
Returns the enabled status of this interaction - if this returns false , the action is not selectable (but if a mouse action has already been started, it will not be aborted if this returns false ). More... | |
virtual void | setEnabled (bool enabled) |
Sets the enabled status of this interaction. More... | |
std::string | getID () const |
Returns the ID of this interaction. More... | |
void | setID (const std::string &id) |
Sets the ID of this interaction. More... | |
std::string | getFullID () const |
Returns the ID string consisting of the ID of the provider and this action's ID, separated by '. More... | |
InteractionType | getInteractionType () const |
Returns type of interaction object. More... | |
template<class T > | |
bool | isOfType () const |
Convenience method for checking type. More... | |
Additional information about this interaction | |
Returns the priority value for ordered display in menus/tool boxes - lower values come first in the menu. | |
int | getMenuPriority () const |
void | setMenuPriority (int priority) |
Sets the priority value for ordered display in menus/tool boxes. More... | |
virtual std::string | getUserName () const |
Returns user-visible name of this item for direct display (e.g., in tool box or menu). More... | |
virtual void | setUserName (const std::string &name) |
Sets the user name of this interaction entry. More... | |
virtual std::string | getIconFile () const |
Returns the filename of an icon (e.g., for use in a tool box or in menu). More... | |
virtual void | setIconFile (const std::string &file) |
Sets the filename of an icon used for this interaction entry. More... | |
virtual std::string | getDescription () const |
Returns the description for user help. More... | |
virtual void | setDescription (const std::string &descr) |
Sets the description for user help. More... | |
Memory management by reference counting. | |
virtual void | ref () |
virtual void | unref () |
Change management | |
This might be used by controllers that build a menu of all interactions and tells them when to recreate this menu. | |
int | getStateVersion () const |
void | touch () |
Increments the version number of attribute state to mark attribute changes. More... | |
SoInteraction is the base class for SoCommandAction, SoPointingAction, and SoOffsetAction.
The important method of this class is setEnabled(), which can be used to disable and enable an interaction. Also, getOwner() is notable because it is the object that an interaction has to communicate with.
The other properties of this class are useful for the integration of the offered interactions in menus, tool bars, etc.
Definition at line 35 of file SoInteraction.h.
anonymous enum |
Constants to use where keyboard modifiers must be specified.
Modifiers usually can be combined with the bit-wise-or operator (|).
Enumerator | |
---|---|
NoModifier | |
ShiftModifier | |
ControlModifier | |
AltModifier | |
AllModifiersMask | |
ShiftMask | |
CtrlMask | |
AltMask |
Definition at line 40 of file SoInteraction.h.
Enum identifying subtypes of this class.
Enumerator | |
---|---|
TypePointingAction | |
TypeCommandAction | |
TypeOffsetAction |
Definition at line 53 of file SoInteraction.h.
SoInteraction::SoInteraction | ( | InteractionType | type, |
SoInteractionOwner * | owner, | ||
const std::string & | id, | ||
bool | registerWithOwner = true |
||
) |
Standard constructor.
Besides the type of the interaction, this requires the owner of the interaction and an ID which will be used to discover and override this interaction. The interaction will automatically be added to the owner object.
|
virtual |
Virtual destructor.
You should not usually destroy the interaction yourself, but in some cases this can be used to dynamically remove interactions, where simply disabling the interaction is not adequate.
|
inlinevirtual |
Returns the description for user help.
Definition at line 112 of file SoInteraction.h.
std::string SoInteraction::getFullID | ( | ) | const |
Returns the ID string consisting of the ID of the provider and this action's ID, separated by '.
'.
|
inlinevirtual |
Returns the filename of an icon (e.g., for use in a tool box or in menu).
Definition at line 107 of file SoInteraction.h.
|
inline |
Returns the ID of this interaction.
The ID identifies the interaction to the controller - only letters, digits and underscore should be used.
Definition at line 84 of file SoInteraction.h.
|
inline |
Returns type of interaction object.
Definition at line 118 of file SoInteraction.h.
|
inline |
Definition at line 96 of file SoInteraction.h.
|
inline |
Returns the interaction provider of this entry.
Definition at line 72 of file SoInteraction.h.
Referenced by SoCSODrawOnSurfaceDrawAction::dragMoveTo(), SoCSODrawOnSurfaceDrawAction::endPress(), SoCSODrawOnSurfaceCancelCommandAction::execute(), SoCSODrawOnSurfaceUndoCommandAction::execute(), SoCSODrawOnSurfaceRedoCommandAction::execute(), SoCSODrawOnSurfaceDrawAction::getCurrentCursor(), SoCSODrawOnSurfaceDrawAction::isSensitiveAt(), and SoCSODrawOnSurfaceDrawAction::startPressAt().
|
inline |
Definition at line 136 of file SoInteraction.h.
|
inlinevirtual |
Returns user-visible name of this item for direct display (e.g., in tool box or menu).
Definition at line 102 of file SoInteraction.h.
|
inlinevirtual |
Returns the enabled status of this interaction - if this returns false
, the action is not selectable (but if a mouse action has already been started, it will not be aborted if this returns false
).
Reimplemented in SoOffsetPointingAction.
Definition at line 77 of file SoInteraction.h.
|
inline |
Convenience method for checking type.
Definition at line 122 of file SoInteraction.h.
|
virtual |
|
inlinevirtual |
Sets the description for user help.
Definition at line 114 of file SoInteraction.h.
|
inlinevirtual |
Sets the enabled status of this interaction.
Reimplemented in SoOffsetPointingAction.
Definition at line 79 of file SoInteraction.h.
Referenced by SoCSODrawOnSurfaceCancelCommandAction::SoCSODrawOnSurfaceCancelCommandAction(), SoCSODrawOnSurfaceRedoCommandAction::SoCSODrawOnSurfaceRedoCommandAction(), and SoCSODrawOnSurfaceUndoCommandAction::SoCSODrawOnSurfaceUndoCommandAction().
|
inlinevirtual |
Sets the filename of an icon used for this interaction entry.
Definition at line 109 of file SoInteraction.h.
|
inline |
Sets the ID of this interaction.
Definition at line 86 of file SoInteraction.h.
|
inline |
Sets the priority value for ordered display in menus/tool boxes.
Definition at line 98 of file SoInteraction.h.
|
inlinevirtual |
Sets the user name of this interaction entry.
Definition at line 104 of file SoInteraction.h.
void SoInteraction::touch | ( | ) |
Increments the version number of attribute state to mark attribute changes.
|
virtual |