MeVisLab Toolbox Reference
SoOffsetAction Class Reference

SoOffsetAction is the base class for any interaction that only provides (numeric) offsets in one or two axes. More...

#include <SoOffsetAction.h>

Inheritance diagram for SoOffsetAction:
SoInteraction

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< TriggerTriggerList
 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 TriggerListgetTriggers () 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.
 
SoInteractionOwnergetOwner () 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
 

Detailed Description

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.

Member Typedef Documentation

◆ Trigger

The trigger type for this action.

Definition at line 57 of file SoOffsetAction.h.

◆ TriggerList

List of triggers.

Definition at line 60 of file SoOffsetAction.h.

Member Enumeration Documentation

◆ 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.

◆ OffsetType

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.

Constructor & Destructor Documentation

◆ SoOffsetAction()

SoOffsetAction::SoOffsetAction ( SoInteractionOwner * owner,
std::string id,
OffsetType offsetType = DOUBLE_AXES )

Standard constructor.

Parameters
owneris the SoInteractionOwner to which the action is added. Ownership is automatically transferred, you don't need to free this object.
idis the name of this interaction, it should hint at its purpose
offsetTypesee description of SoOffsetAction::OffsetType

◆ ~SoOffsetAction()

SoOffsetAction::~SoOffsetAction ( )
override

Member Function Documentation

◆ addTrigger()

void SoOffsetAction::addTrigger ( const Trigger & trigger)

Adds another default trigger.

◆ clearTriggers()

void SoOffsetAction::clearTriggers ( )

Clears list of default triggers.

◆ getCurrentCursor()

virtual int SoOffsetAction::getCurrentCursor ( SoViewerProxy * ) const
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.

◆ getCurrentStatusMessage()

virtual std::string SoOffsetAction::getCurrentStatusMessage ( ) const
inlinevirtual

Returns a status message for display in status bar (make it short!), will get called at same time as getCurrentCursor.

Note
This is currently unused.

Definition at line 112 of file SoOffsetAction.h.

◆ getOffsetType()

OffsetType SoOffsetAction::getOffsetType ( ) const
inline
Returns
if one or two axes are used by this action

Definition at line 72 of file SoOffsetAction.h.

◆ getTriggers()

const TriggerList & SoOffsetAction::getTriggers ( ) const
inline

Returns the default triggers set for this action.

Definition at line 84 of file SoOffsetAction.h.

◆ offsetBy() [1/2]

virtual void SoOffsetAction::offsetBy ( double dx,
double dy,
void *  )
inlinevirtual

Perform offset operation with given values.

Parameters
dxoffset in first axis.
dyoffset in second axis.
infomight 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().

◆ offsetBy() [2/2]

virtual void SoOffsetAction::offsetBy ( double ,
double  )
inlinevirtual

Variant without additional info parameter. You need to override one of these methods.

Definition at line 96 of file SoOffsetAction.h.

◆ setTrigger()

void SoOffsetAction::setTrigger ( const Trigger & trigger)

Sets the (only) default trigger.

Friends And Related Symbol Documentation

◆ SoInteractionHandler

Definition at line 32 of file SoOffsetAction.h.


The documentation for this class was generated from the following file: