MeVisLab Toolbox Reference
|
SoOffsetAction is the base class for any interaction that only provides (numeric) offsets in one or two axes. More...
#include <SoOffsetAction.h>
Public Types | |
enum | { TypeId = TypeOffsetAction } |
enum | OffsetType { SINGLE_AXIS , DOUBLE_AXES } |
Type of offset action (single or double axis). More... | |
enum | { Button1Mask = ManagedMouseButtonTrigger::Button1Mask , Button2Mask = ManagedMouseButtonTrigger::Button2Mask , Button3Mask = ManagedMouseButtonTrigger::Button3Mask , AllButtonsMask = ManagedMouseButtonTrigger::AllButtonsMask } |
Configuration values for the Trigger type. More... | |
typedef ManagedOffsetTrigger | Trigger |
The trigger type for this action. More... | |
typedef std::list< Trigger > | TriggerList |
List of triggers. More... | |
Public Types inherited from SoInteraction | |
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 | |
SoOffsetAction (SoInteractionOwner *owner, std::string id, OffsetType offsetType=DOUBLE_AXES) | |
Standard constructor. More... | |
~SoOffsetAction () override | |
OffsetType | getOffsetType () const |
Returns whether one or two axes are used by this action. More... | |
void | clearTriggers () |
Clears the list of default triggers. More... | |
void | setTrigger (const Trigger &trigger) |
Sets the (only) default trigger. More... | |
void | addTrigger (const Trigger &trigger) |
Adds another default trigger. More... | |
const TriggerList & | getTriggers () const |
Returns the default triggers set for this action. More... | |
virtual void | offsetBy (double dx, double dy, void *) |
Performs offset operation with given values. More... | |
virtual void | offsetBy (double, double) |
Variant without additional information parameter. You need to override one of these methods. More... | |
virtual int | getCurrentCursor (SoViewerProxy *) const |
Returns the cursor shape ID for display, as defined in SoViewerProxy. More... | |
virtual std::string | getCurrentStatusMessage () const |
Returns a status message for display in the status bar of MeVisLab (make it short!), and is called at same time as getCurrentCursor. More... | |
Public Member Functions inherited from SoInteraction | |
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... | |
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... | |
virtual void | ref () |
virtual void | unref () |
int | getStateVersion () const |
void | touch () |
Increments the version number of attribute state to mark attribute changes. More... | |
Friends | |
class | SoInteractionHandler |
SoOffsetAction is the base class for any interaction that only provides (numeric) offsets in one or two axes.
SoOffsetActions might be mapped to dragging with the mouse, the mouse wheel, a joystick, etc.
You need to override one version of offsetBy() in derived classes!
Definition at line 30 of file SoOffsetAction.h.
The trigger type for this action.
Definition at line 57 of file SoOffsetAction.h.
typedef std::list<Trigger> SoOffsetAction::TriggerList |
List of triggers.
Definition at line 60 of file SoOffsetAction.h.
anonymous enum |
Enumerator | |
---|---|
TypeId |
Definition at line 35 of file SoOffsetAction.h.
anonymous enum |
Configuration values for the Trigger type.
You can combine these with the key modifier values from SoInteraction
Enumerator | |
---|---|
Button1Mask | Left button. |
Button2Mask | Middle button. |
Button3Mask | Right button. |
AllButtonsMask | All buttons. |
Definition at line 49 of file SoOffsetAction.h.
Type of offset action (single or double axis).
Enumerator | |
---|---|
SINGLE_AXIS | Only one offset axis is used. This effectively swaps the argument values for offsetBy() when triggered by mouse button dragging or mouse wheel rotation. This way, the vertical mouse wheel rotation and vertical mouse movement are given as the first argument. |
DOUBLE_AXES | Two offset axes are used. |
Definition at line 38 of file SoOffsetAction.h.
SoOffsetAction::SoOffsetAction | ( | SoInteractionOwner * | owner, |
std::string | id, | ||
OffsetType | offsetType = DOUBLE_AXES |
||
) |
Standard constructor.
owner | The SoInteractionOwner to which the action is added. Ownership is automatically transferred, you don't need to free this object. |
id | The name of this interaction, it should hint at its purpose |
offsetType | See description of SoOffsetAction::OffsetType |
|
override |
void SoOffsetAction::addTrigger | ( | const Trigger & | trigger | ) |
Adds another default trigger.
void SoOffsetAction::clearTriggers | ( | ) |
Clears the list of default triggers.
|
inlinevirtual |
Returns the cursor shape ID for display, as defined in SoViewerProxy.
This will only be used if the offset action is triggered by mouse movement; mouse wheel rotation and keyboard shortcuts ignore this.
The SoViewerProxy pointer is provided so one can define custom cursors when this method is called (see header file SoViewerProxy.h for instructions).
Definition at line 106 of file SoOffsetAction.h.
|
inlinevirtual |
Returns a status message for display in the status bar of MeVisLab (make it short!), and is called at same time as getCurrentCursor.
Definition at line 112 of file SoOffsetAction.h.
|
inline |
Returns whether one or two axes are used by this action.
Definition at line 72 of file SoOffsetAction.h.
|
inline |
Returns the default triggers set for this action.
Definition at line 84 of file SoOffsetAction.h.
|
inlinevirtual |
Performs offset operation with given values.
dx | Offset in first axis. |
dy | Offset in second axis. |
info | Might point to additional data depending on the type of module (e.g., for SoView2DExtension it is of type View2DPosition), and is the same as returned by SoPointerPosition.get(). |
Definition at line 93 of file SoOffsetAction.h.
References offsetBy().
Referenced by offsetBy().
|
inlinevirtual |
Variant without additional information parameter. You need to override one of these methods.
Definition at line 96 of file SoOffsetAction.h.
void SoOffsetAction::setTrigger | ( | const Trigger & | trigger | ) |
Sets the (only) default trigger.
|
friend |
Definition at line 32 of file SoOffsetAction.h.