MeVisLab Toolbox Reference
SoInteraction Class Reference

SoInteraction is the base class for SoCommandAction, SoPointingAction, and SoOffsetAction. More...

#include <SoInteraction.h>

Inheritance diagram for SoInteraction:
SoCommandAction SoOffsetAction SoPointingAction CSOCancelCommandAction CSOCopyCommandAction CSOCutCommandAction CSODeleteCSOCommandAction CSODeleteSeedPointCommandAction CSOPasteCommandAction CSORedoCommandAction CSORemoveAllCommandAction CSOUndoCommandAction SoCSODrawOnSurfaceCancelCommandAction SoCSODrawOnSurfaceRedoCommandAction SoCSODrawOnSurfaceUndoCommandAction SoView2DKeyboardAction CSOLabelMoveAction CSOLabelResizeAction CSOPointingAction SoCSODrawOnSurfaceDrawAction SoOffsetPointingAction

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 sub-types 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...
 
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...
 
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
 
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...
 
Memory management by reference counting.
virtual void ref ()
 
virtual void unref ()
 
Change management
Returns
version number of current attribute state, should change with every attribute change.

This might be used by controllers that build a menu of all interactions and tells them when to re-create this menu.

int getStateVersion () const
 
void touch ()
 Increments the version number of attribute state to mark attribute changes. More...
 

Detailed Description

SoInteraction is the base class for SoCommandAction, SoPointingAction, and SoOffsetAction.

The import method of this class is setEnabled(), which can be used to disable and enable an interaction. Well, and perhaps getOwner(), because that is the object that an interaction has to talk to anyways.

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.

Member Enumeration Documentation

◆ anonymous enum

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.

◆ InteractionType

Enum identifying sub-types of this class.

Enumerator
TypePointingAction 
TypeCommandAction 
TypeOffsetAction 

Definition at line 53 of file SoInteraction.h.

Constructor & Destructor Documentation

◆ SoInteraction()

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.

◆ ~SoInteraction()

virtual SoInteraction::~SoInteraction ( )
virtual

Virtual destructor.

You shouldn't usually destroy the interaction yourself, but in some cases this can be used to dynamically remove interactions, where simply disabling the interaction isn't adequate.

Member Function Documentation

◆ getDescription()

virtual std::string SoInteraction::getDescription ( ) const
inlinevirtual
Returns
the description for user help.

Definition at line 112 of file SoInteraction.h.

◆ getFullID()

std::string SoInteraction::getFullID ( ) const

Returns the ID string consisting of the id of the provider and this action's id, separated by '.

'.

◆ getIconFile()

virtual std::string SoInteraction::getIconFile ( ) const
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.

◆ getID()

std::string SoInteraction::getID ( ) const
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.

◆ getInteractionType()

InteractionType SoInteraction::getInteractionType ( ) const
inline

Get type of interaction object.

Definition at line 118 of file SoInteraction.h.

◆ getMenuPriority()

int SoInteraction::getMenuPriority ( ) const
inline

Definition at line 96 of file SoInteraction.h.

◆ getOwner()

◆ getStateVersion()

int SoInteraction::getStateVersion ( ) const
inline

Definition at line 136 of file SoInteraction.h.

◆ getUserName()

virtual std::string SoInteraction::getUserName ( ) const
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.

◆ isEnabled()

virtual bool SoInteraction::isEnabled ( ) const
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.

◆ isOfType()

template<class T >
bool SoInteraction::isOfType ( ) const
inline

Convenience method for checking type.

Definition at line 122 of file SoInteraction.h.

◆ ref()

virtual void SoInteraction::ref ( )
virtual

◆ setDescription()

virtual void SoInteraction::setDescription ( const std::string &  descr)
inlinevirtual

Sets the description for user help.

Definition at line 114 of file SoInteraction.h.

◆ setEnabled()

virtual void SoInteraction::setEnabled ( bool  enabled)
inlinevirtual

◆ setIconFile()

virtual void SoInteraction::setIconFile ( const std::string &  file)
inlinevirtual

Sets the filename of an icon used for this interaction entry.

Definition at line 109 of file SoInteraction.h.

◆ setID()

void SoInteraction::setID ( const std::string &  id)
inline

Sets the id of this interaction.

Definition at line 86 of file SoInteraction.h.

◆ setMenuPriority()

void SoInteraction::setMenuPriority ( int  priority)
inline

Sets the priority value for ordered display in menus/tool boxes.

Definition at line 98 of file SoInteraction.h.

◆ setUserName()

virtual void SoInteraction::setUserName ( const std::string &  name)
inlinevirtual

Sets the user name of this interaction entry.

Definition at line 104 of file SoInteraction.h.

◆ touch()

void SoInteraction::touch ( )

Increments the version number of attribute state to mark attribute changes.

◆ unref()

virtual void SoInteraction::unref ( )
virtual

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