MeVisLabToolboxReference
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 SoView2DMarkerEditorVectorCancelCommandAction CSOLabelMoveAction CSOLabelResizeAction CSOPointingAction 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)
 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
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...
 
Memory management by reference counting.
virtual void ref ()
 
virtual void unref ()
 
Change management
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 31 of file SoInteraction.h.

Member Enumeration Documentation

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 36 of file SoInteraction.h.

Enum identifying sub-types of this class.

Enumerator
TypePointingAction 
TypeCommandAction 
TypeOffsetAction 

Definition at line 49 of file SoInteraction.h.

Constructor & Destructor Documentation

SoInteraction::SoInteraction ( InteractionType  type,
SoInteractionOwner owner,
const std::string &  id 
)

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.

virtual SoInteraction::~SoInteraction ( )
inlinevirtual

Virtual destructor.

Definition at line 62 of file SoInteraction.h.

Member Function Documentation

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

Definition at line 105 of file SoInteraction.h.

std::string SoInteraction::getFullID ( ) const

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

'.

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 100 of file SoInteraction.h.

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 77 of file SoInteraction.h.

InteractionType SoInteraction::getInteractionType ( ) const
inline

Get type of interaction object.

Definition at line 111 of file SoInteraction.h.

int SoInteraction::getMenuPriority ( ) const
inline

Returns the priority value for ordered display in menus/tool boxes - lower values come first in the menu.

Definition at line 89 of file SoInteraction.h.

SoInteractionOwner* SoInteraction::getOwner ( ) const
inline
Returns
the interaction provider of this entry.

Definition at line 65 of file SoInteraction.h.

Referenced by SoView2DMarkerEditorVectorCancelCommandAction::execute().

int SoInteraction::getStateVersion ( ) const
inline
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.

Definition at line 129 of file SoInteraction.h.

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 95 of file SoInteraction.h.

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

Definition at line 70 of file SoInteraction.h.

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

Convenience method for checking type.

Definition at line 115 of file SoInteraction.h.

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

Sets the description for user help.

Definition at line 107 of file SoInteraction.h.

virtual void SoInteraction::setEnabled ( bool  enabled)
inlinevirtual

Sets the enabled status of this interaction.

Definition at line 72 of file SoInteraction.h.

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

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

Definition at line 102 of file SoInteraction.h.

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

Sets the id of this interaction.

Definition at line 79 of file SoInteraction.h.

void SoInteraction::setMenuPriority ( int  priority)
inline

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

Definition at line 91 of file SoInteraction.h.

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

Sets the user name of this interaction entry.

Definition at line 97 of file SoInteraction.h.

void SoInteraction::touch ( )

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

virtual void SoInteraction::unref ( )
virtual

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