MeVisLabToolboxReference
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...
 
typedef ManagedOffsetTrigger Trigger
 The trigger type for this action. More...
 
typedef std::list< TriggerTriggerList
 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 sub-types of this class. More...
 

Public Member Functions

 SoOffsetAction (SoInteractionOwner *owner, std::string id, OffsetType offsetType=DOUBLE_AXES)
 Standard constructor. More...
 
OffsetType getOffsetType () const
 
void clearTriggers ()
 Clears 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 TriggerListgetTriggers () const
 Returns the default triggers set for this action. More...
 
virtual void offsetBy (double dx, double dy, void *)
 Perform offset operation with given values. More...
 
virtual void offsetBy (double, double)
 Variant without additional info 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 status bar (make it short!), will get called at same time as getCurrentCursor. More...
 
- Public Member Functions inherited from SoInteraction
 SoInteraction (InteractionType type, SoInteractionOwner *owner, const std::string &id)
 Standard constructor. More...
 
virtual ~SoInteraction ()
 Virtual destructor. More...
 
SoInteractionOwnergetOwner () const
 
virtual bool isEnabled () const
 
virtual void setEnabled (bool enabled)
 Sets the enabled status of this interaction. More...
 
std::string getID () const
 
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
 Get type of interaction object. More...
 
template<class T >
bool isOfType () const
 Convenience method for checking type. More...
 
int getMenuPriority () const
 Returns the priority value for ordered display in menus/tool boxes - lower values come first in the menu. More...
 
void setMenuPriority (int priority)
 Sets the priority value for ordered display in menus/tool boxes. More...
 
virtual std::string getUserName () const
 
virtual void setUserName (const std::string &name)
 Sets the user name of this interaction entry. More...
 
virtual std::string getIconFile () const
 
virtual void setIconFile (const std::string &file)
 Sets the filename of an icon used for this interaction entry. More...
 
virtual std::string getDescription () const
 
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
 

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 26 of file SoOffsetAction.h.

Member Typedef Documentation

The trigger type for this action.

Definition at line 44 of file SoOffsetAction.h.

List of triggers.

Definition at line 47 of file SoOffsetAction.h.

Member Enumeration Documentation

anonymous enum
Enumerator
TypeId 

Definition at line 31 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 34 of file SoOffsetAction.h.

Constructor & Destructor Documentation

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

Member Function Documentation

void SoOffsetAction::addTrigger ( const Trigger trigger)

Adds another default trigger.

void SoOffsetAction::clearTriggers ( )

Clears list of default triggers.

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 91 of file SoOffsetAction.h.

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 97 of file SoOffsetAction.h.

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

Definition at line 57 of file SoOffsetAction.h.

const TriggerList& SoOffsetAction::getTriggers ( ) const
inline

Returns the default triggers set for this action.

Definition at line 69 of file SoOffsetAction.h.

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 78 of file SoOffsetAction.h.

References offsetBy().

Referenced by offsetBy().

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

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

Definition at line 81 of file SoOffsetAction.h.

void SoOffsetAction::setTrigger ( const Trigger trigger)

Sets the (only) default trigger.

Friends And Related Function Documentation

friend class SoInteractionHandler
friend

Definition at line 28 of file SoOffsetAction.h.


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