MeVisLab Toolbox Reference
SoCSODrawOnSurfaceDrawAction Class Reference

#include <SoCSODrawOnSurfaceActions.h>

Inheritance diagram for SoCSODrawOnSurfaceDrawAction:
SoPointingAction SoInteraction

Public Member Functions

 SoCSODrawOnSurfaceDrawAction (SoCSODrawOnSurface *owner, int modifierKey)
 
void setTriggerMask (int modifierKey)
 
bool isInViewportRegion (const SoPointerPosition &pos) const
 
bool isSensitiveAt (const SoPointerPosition &pos) override
 Returns true if the gesture is startable at the given device position.
 
void startPressAt (const SoPointerPosition &pos) override
 Starts a drag at given device position.
 
void dragMoveTo (const SoPointerPosition &pos) override
 Continues the drag to given device position.
 
SoPointingActionendPress (int) override
 Ends the drag at last device position.
 
int getCurrentCursor (SoViewerProxy *) const override
 Returns the cursor ID to display for this action, as defined in SoViewerProxy.h - this gets (at least) called after setMode(), isSensitiveAt(), startPressAt(), dragMoveTo(), and endPress().
 
- Public Member Functions inherited from SoPointingAction
 SoPointingAction (SoInteractionOwner *owner, std::string id, bool positionSensitive=true)
 Standard constructor.
 
virtual bool isPositionSensitive () const
 Position sensitive actions can only start at positions where isSensitiveAt() return true.
 
void clearTriggers ()
 remove all triggers
 
void setTrigger (int triggerMask, int ignoreMask=0)
 Sets the (only) default modifier/button mask for triggering this action.
 
void setTrigger (const Trigger &trigger)
 Same with Trigger object.
 
void addTrigger (const Trigger &trigger)
 Adds another default modifier/button mask as trigger.
 
TriggerList getTriggers () const
 Returns the list of default modifier/button mask combinations set for this action.
 
virtual bool triggersAction (int mask)
 Returns whether the given modifier/button combination activates this action according to the default bindings.
 
virtual int getNumModes () const
 Returns the number of different modes this action has - modes can be changed during drag and handle drag restrictions or drag result.
 
virtual std::string getCurrentStatusMessage () const
 Returns a status message for display in status bar (make it short!), this will get called at same time as getCurrentCursor.
 
virtual void setMode (int)
 This gets called if the mode was changed and before startPressAt is called.
 
virtual void setHighlightAt (const SoPointerPosition &)
 This method is called so that highlighting of objects under the mouse cursor can occur.
 
virtual void unsetHighlight ()
 Remove any highlighting if this method is called.
 
virtual void dragCancelled ()
 This is called if the current drag operation is cancelled, e.g.
 
virtual bool wantsMouseOverUpdates ()
 Override this to return true if this action should get location updates directly before rendering, so it can update its status.
 
void grabReleased ()
 Call this to release an interaction grab that has been established by the return value of endPress(), e.g., because it was aborted through a SoCommandAction.
 
virtual void releaseGrab (StopMode)
 This will be called by the controller if you should release the grab established by endPress.
 
virtual bool wantsImmediateDragUpdates ()
 Let this method return false if you don't want dragMoveTo to be called until it is clear that the interaction will not be handled as a click (endPress will be called with a clickCount greater zero).
 
- 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.
 

Additional Inherited Members

- Public Types inherited from SoPointingAction
enum  StopMode { AbortAction , FinishAction }
 Argument type for releaseGrab() More...
 
enum  { Button1Mask = ManagedMouseButtonTrigger::Button1Mask , Button2Mask = ManagedMouseButtonTrigger::Button2Mask , Button3Mask = ManagedMouseButtonTrigger::Button3Mask , AllButtonsMask = ManagedMouseButtonTrigger::AllButtonsMask }
 Configuration values for the Trigger type. More...
 
enum  { TypeId = TypePointingAction }
 
typedef ManagedMouseButtonTrigger Trigger
 Class Trigger encapsulates the combination of required and ignored button and modifier keys that activate a pointing 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...
 
- Protected Member Functions inherited from SoPointingAction
virtual SoOffsetActionproxiedOffsetAction () const
 

Detailed Description

Definition at line 20 of file SoCSODrawOnSurfaceActions.h.

Constructor & Destructor Documentation

◆ SoCSODrawOnSurfaceDrawAction()

SoCSODrawOnSurfaceDrawAction::SoCSODrawOnSurfaceDrawAction ( SoCSODrawOnSurface * owner,
int modifierKey )
inline

Definition at line 23 of file SoCSODrawOnSurfaceActions.h.

References setTriggerMask().

Member Function Documentation

◆ dragMoveTo()

void SoCSODrawOnSurfaceDrawAction::dragMoveTo ( const SoPointerPosition & pos)
inlineoverridevirtual

Continues the drag to given device position.

Implements SoPointingAction.

Definition at line 67 of file SoCSODrawOnSurfaceActions.h.

References dragMoveTo(), SoInteraction::getOwner(), and isInViewportRegion().

Referenced by dragMoveTo().

◆ endPress()

SoPointingAction * SoCSODrawOnSurfaceDrawAction::endPress ( int clickCount)
inlineoverridevirtual

Ends the drag at last device position.

If this method returns a non-NULL SoPointingAction, the pointing device is restricted to this SoPointingAction until releaseGrab() is called or another call to endPress returns NULL. This is useful if the end user is required to click at at least one other position.

Note that locking of the returned action breaks down if the same node is used in several viewers, since each viewer usually has its own interaction controller that manages locked actions on its own.

Parameters
clickCountgives the number of clicks at the last start position. I.e. for a normal drag it is 0, for a single click it is 1, for a double click it is 2 and for a triple click it is 3. Note that for a clickCount greater zero you will not have received any dragMoveTo calls if wantsImmediateDragUpdates returns false.

Implements SoPointingAction.

Definition at line 79 of file SoCSODrawOnSurfaceActions.h.

References endPress(), and SoInteraction::getOwner().

Referenced by endPress().

◆ getCurrentCursor()

int SoCSODrawOnSurfaceDrawAction::getCurrentCursor ( SoViewerProxy * ) const
inlineoverridevirtual

Returns the cursor ID to display for this action, as defined in SoViewerProxy.h - this gets (at least) called after setMode(), isSensitiveAt(), startPressAt(), dragMoveTo(), and endPress().

The SoViewerProxy pointer is provided so one can define own cursors when this method is called (see header file SoViewerProxy.h for instructions).

Reimplemented from SoPointingAction.

Definition at line 85 of file SoCSODrawOnSurfaceActions.h.

References SoInteraction::getOwner().

◆ isInViewportRegion()

bool SoCSODrawOnSurfaceDrawAction::isInViewportRegion ( const SoPointerPosition & pos) const
inline

Definition at line 40 of file SoCSODrawOnSurfaceActions.h.

References SoPointerPosition::getAction(), and mlrange_cast().

Referenced by dragMoveTo().

◆ isSensitiveAt()

bool SoCSODrawOnSurfaceDrawAction::isSensitiveAt ( const SoPointerPosition & pos)
inlineoverridevirtual

Returns true if the gesture is startable at the given device position.

If not, a mouse click will be handed to another SoPointingAction (and the cursor shape of this action is ignored)!

Note
Only called if isPositionSensitive() returns true.

Implements SoPointingAction.

Definition at line 49 of file SoCSODrawOnSurfaceActions.h.

References SoPointerPosition::getAction(), SoInteraction::getOwner(), and mlrange_cast().

◆ setTriggerMask()

void SoCSODrawOnSurfaceDrawAction::setTriggerMask ( int modifierKey)
inline

◆ startPressAt()

void SoCSODrawOnSurfaceDrawAction::startPressAt ( const SoPointerPosition & pos)
inlineoverridevirtual

Starts a drag at given device position.

It is guaranteed that this will be followed by (possibly) dragMoveTo calls and either an endPress or dragCancelled call.

Implements SoPointingAction.

Definition at line 62 of file SoCSODrawOnSurfaceActions.h.

References SoInteraction::getOwner(), and startPressAt().

Referenced by startPressAt().


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