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. | |
typedef std::list< Trigger > | TriggerList |
List of triggers. | |
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 sub-types of this class. More... | |
Public Member Functions | |
SoOffsetAction (SoInteractionOwner *owner, std::string id, OffsetType offsetType=DOUBLE_AXES) | |
Standard constructor. | |
~SoOffsetAction () override | |
OffsetType | getOffsetType () const |
void | clearTriggers () |
Clears list of default triggers. | |
void | setTrigger (const Trigger &trigger) |
Sets the (only) default trigger. | |
void | addTrigger (const Trigger &trigger) |
Adds another default trigger. | |
const TriggerList & | getTriggers () const |
Returns the default triggers set for this action. | |
virtual void | offsetBy (double dx, double dy, void *) |
Perform offset operation with given values. | |
virtual void | offsetBy (double, double) |
Variant without additional info parameter. You need to override one of these methods. | |
virtual int | getCurrentCursor (SoViewerProxy *) const |
Returns the cursor shape ID for display, as defined in SoViewerProxy. | |
virtual std::string | getCurrentStatusMessage () const |
Returns a status message for display in status bar (make it short!), will get called at same time as getCurrentCursor. | |
Public Member Functions inherited from SoInteraction | |
SoInteraction (InteractionType type, SoInteractionOwner *owner, const std::string &id, bool registerWithOwner=true) | |
Standard constructor. | |
virtual | ~SoInteraction () |
Virtual destructor. | |
SoInteractionOwner * | getOwner () const |
virtual bool | isEnabled () const |
virtual void | setEnabled (bool enabled) |
Sets the enabled status of this interaction. | |
std::string | getID () 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 '. | |
InteractionType | getInteractionType () const |
Get type of interaction object. | |
template<class T > | |
bool | isOfType () const |
Convenience method for checking type. | |
int | getMenuPriority () const |
void | setMenuPriority (int priority) |
Sets the priority value for ordered display in menus/tool boxes. | |
virtual std::string | getUserName () const |
virtual void | setUserName (const std::string &name) |
Sets the user name of this interaction entry. | |
virtual std::string | getIconFile () const |
virtual void | setIconFile (const std::string &file) |
Sets the filename of an icon used for this interaction entry. | |
virtual std::string | getDescription () const |
virtual void | setDescription (const std::string &descr) |
Sets the description for user help. | |
virtual void | ref () |
virtual void | unref () |
int | getStateVersion () const |
void | touch () |
Increments the version number of attribute state to mark attribute changes. | |
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.
Enumerator | |
---|---|
TypeId |
Definition at line 35 of file SoOffsetAction.h.
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 (so that 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 | is the SoInteractionOwner to which the action is added. Ownership is automatically transferred, you don't need to free this object. |
id | is the name of this interaction, it should hint at its purpose |
offsetType | see description of SoOffsetAction::OffsetType |
|
override |
void SoOffsetAction::clearTriggers | ( | ) |
Clears 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 own 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 status bar (make it short!), will get called at same time as getCurrentCursor.
Definition at line 112 of file SoOffsetAction.h.
|
inline |
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.
Perform 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 mlrange_cast(), and offsetBy().
Referenced by offsetBy().
Variant without additional info parameter. You need to override one of these methods.
Definition at line 96 of file SoOffsetAction.h.
|
friend |
Definition at line 32 of file SoOffsetAction.h.