MeVisLab Toolbox Reference
CSOSelectAndMoveAction Class Reference

#include <CSOSelectAndMoveAction.h>

Inheritance diagram for CSOSelectAndMoveAction:
CSOPointingAction SoPointingAction SoInteraction

Public Member Functions

 CSOSelectAndMoveAction (SoView2DCSOExtensibleEditor *editor)
 
bool isSensitiveAt (const SoPointerPosition &pos) override
 Returns true if the gesture is startable at the given device position. More...
 
void startPressAt (const SoPointerPosition &pos) override
 Starts a drag at given device position. More...
 
void dragMoveTo (const SoPointerPosition &pos) override
 Continues the drag to given device position. More...
 
SoPointingActionendPress (int clickCount) override
 Ends the drag at last device position. More...
 
bool wantsMouseOverUpdates () override
 Override this to return true if this action should get location updates directly before rendering, so it can update its status. More...
 
void releaseGrab (StopMode) override
 This will be called by the controller if you should release the grab established by endPress. More...
 
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(). More...
 
void setInteractOnlyWithSelectedCSO (bool flag)
 Sets this action to be active only for selected CSOs or for all CSOs. More...
 
void setMode (int mode) override
 This gets called if the mode was changed and before startPressAt is called. More...
 
int getNumModes () const override
 Returns the number of different modes this action has - modes can be changed during drag and handle drag restrictions or drag result. More...
 
- Public Member Functions inherited from CSOPointingAction
 CSOPointingAction (SoView2DCSOExtensibleEditor *editor, const std::string &id)
 
- Public Member Functions inherited from SoPointingAction
 SoPointingAction (SoInteractionOwner *owner, std::string id, bool positionSensitive=true)
 Standard constructor. More...
 
virtual bool isPositionSensitive () const
 Position sensitive actions can only start at positions where isSensitiveAt() return true. More...
 
void clearTriggers ()
 remove all triggers More...
 
void setTrigger (int triggerMask, int ignoreMask=0)
 Sets the (only) default modifier/button mask for triggering this action. More...
 
void setTrigger (const Trigger &trigger)
 Same with Trigger object. More...
 
void addTrigger (const Trigger &trigger)
 Adds another default modifier/button mask as trigger. More...
 
TriggerList getTriggers () const
 Returns the list of default modifier/button mask combinations set for this action. More...
 
virtual bool triggersAction (int mask)
 Returns whether the given modifier/button combination activates this action according to the default bindings. More...
 
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. More...
 
virtual void setHighlightAt (const SoPointerPosition &)
 This method is called so that highlighting of objects under the mouse cursor can occur. More...
 
virtual void unsetHighlight ()
 Remove any highlighting if this method is called. More...
 
virtual void dragCancelled ()
 This is called if the current drag operation is cancelled, e.g. More...
 
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. More...
 
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). More...
 
- Public Member Functions inherited from SoInteraction
 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...
 
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...
 
virtual void ref ()
 
virtual void unref ()
 
int getStateVersion () const
 
void touch ()
 Increments the version number of attribute state to mark attribute changes. More...
 

Protected Member Functions

void initializeMembers ()
 
bool isAllowedToDrag (const SoPointerPosition &pos)
 
bool pointerHasMovedAtLeastByOnePixel (SbVec2f &pos) const
 
- Protected Member Functions inherited from CSOPointingAction
bool isInsideImage (const SoPointerPosition &pos)
 Returns whether the position is inside the image if needsValidVoxel is set; Otherwise, it just returns true. More...
 
void setView2DImage (const SoPointerPosition &pos)
 
void updateImageStatistics (ml::CSO *cso)
 
void setActionActive ()
 Set/unset the maskValid flag in the editor. More...
 
void unsetActionActive ()
 
- Protected Member Functions inherited from SoPointingAction
virtual SoOffsetActionproxiedOffsetAction () const
 

Protected Attributes

ml::CSOList_hitCSOList
 
ml::CSO_hitCSO
 
ml::CSOSeedPoint_hitSeedPoint
 
ml::CSOPathPoints_hitPathPoints
 
SoRef< SoCSOEditorExtension_hitEditor
 
float _hitDistance
 
SbVec3f _initialPosition
 
SbVec2f _previousDevicePosition
 
SbVec3f _sliceNormal
 
bool _interactOnlyWithSelectedCSOs
 
int _cursorShape
 
- Protected Attributes inherited from CSOPointingAction
SoView2DCSOExtensibleEditor_editor
 
SoSFMLImage_image
 

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

Detailed Description

Definition at line 24 of file CSOSelectAndMoveAction.h.

Constructor & Destructor Documentation

◆ CSOSelectAndMoveAction()

CSOSelectAndMoveAction::CSOSelectAndMoveAction ( SoView2DCSOExtensibleEditor editor)

Member Function Documentation

◆ dragMoveTo()

void CSOSelectAndMoveAction::dragMoveTo ( const SoPointerPosition pos)
overridevirtual

Continues the drag to given device position.

Implements SoPointingAction.

◆ endPress()

SoPointingAction* CSOSelectAndMoveAction::endPress ( int  clickCount)
overridevirtual

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.

◆ getCurrentCursor()

int CSOSelectAndMoveAction::getCurrentCursor ( SoViewerProxy ) const
overridevirtual

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.

◆ getNumModes()

int CSOSelectAndMoveAction::getNumModes ( ) const
overridevirtual

Returns the number of different modes this action has - modes can be changed during drag and handle drag restrictions or drag result.

Modes are normally controlled through the modifier keys.

Reimplemented from SoPointingAction.

◆ initializeMembers()

void CSOSelectAndMoveAction::initializeMembers ( )
protected

◆ isAllowedToDrag()

bool CSOSelectAndMoveAction::isAllowedToDrag ( const SoPointerPosition pos)
protected

◆ isSensitiveAt()

bool CSOSelectAndMoveAction::isSensitiveAt ( const SoPointerPosition pos)
overridevirtual

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.

◆ pointerHasMovedAtLeastByOnePixel()

bool CSOSelectAndMoveAction::pointerHasMovedAtLeastByOnePixel ( SbVec2f &  pos) const
protected

◆ releaseGrab()

void CSOSelectAndMoveAction::releaseGrab ( StopMode  )
inlineoverridevirtual

This will be called by the controller if you should release the grab established by endPress.

The SoPointingAction should be aborted/finished. (This will not be called while dragging!) There is no need to call grabReleased().

Parameters
modehow the grab should be released. See SoPointingAction::StopMode.

(Note: This is currently not implemented.)

Reimplemented from SoPointingAction.

Definition at line 38 of file CSOSelectAndMoveAction.h.

References _hitEditor.

◆ setInteractOnlyWithSelectedCSO()

void CSOSelectAndMoveAction::setInteractOnlyWithSelectedCSO ( bool  flag)
inline

Sets this action to be active only for selected CSOs or for all CSOs.

Definition at line 50 of file CSOSelectAndMoveAction.h.

References _interactOnlyWithSelectedCSOs.

◆ setMode()

void CSOSelectAndMoveAction::setMode ( int  )
overridevirtual

This gets called if the mode was changed and before startPressAt is called.

Use this value to implement different dragging modes.

Note
You must override getNumModes() to return the number of required modes.

Reimplemented from SoPointingAction.

◆ startPressAt()

void CSOSelectAndMoveAction::startPressAt ( const SoPointerPosition pos)
overridevirtual

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.

◆ wantsMouseOverUpdates()

bool CSOSelectAndMoveAction::wantsMouseOverUpdates ( )
inlineoverridevirtual

Override this to return true if this action should get location updates directly before rendering, so it can update its status.

The cursor position might be the same as in previous calls, which is normally avoided.

This is only interesting for the interactions of special Inventor nodes like those derived from SoView2DExtension, where additional position information is passed in SoPointerPosition. This information may change depending on the state of the SoView2D, even if the cursor position does not.

Reimplemented from SoPointingAction.

Definition at line 36 of file CSOSelectAndMoveAction.h.

Member Data Documentation

◆ _cursorShape

int CSOSelectAndMoveAction::_cursorShape
protected

Definition at line 75 of file CSOSelectAndMoveAction.h.

◆ _hitCSO

ml::CSO* CSOSelectAndMoveAction::_hitCSO
protected

Definition at line 63 of file CSOSelectAndMoveAction.h.

◆ _hitCSOList

ml::CSOList* CSOSelectAndMoveAction::_hitCSOList
protected

Definition at line 62 of file CSOSelectAndMoveAction.h.

◆ _hitDistance

float CSOSelectAndMoveAction::_hitDistance
protected

Definition at line 67 of file CSOSelectAndMoveAction.h.

◆ _hitEditor

SoRef<SoCSOEditorExtension> CSOSelectAndMoveAction::_hitEditor
protected

Definition at line 66 of file CSOSelectAndMoveAction.h.

Referenced by releaseGrab().

◆ _hitPathPoints

ml::CSOPathPoints* CSOSelectAndMoveAction::_hitPathPoints
protected

Definition at line 65 of file CSOSelectAndMoveAction.h.

◆ _hitSeedPoint

ml::CSOSeedPoint* CSOSelectAndMoveAction::_hitSeedPoint
protected

Definition at line 64 of file CSOSelectAndMoveAction.h.

◆ _initialPosition

SbVec3f CSOSelectAndMoveAction::_initialPosition
protected

Definition at line 69 of file CSOSelectAndMoveAction.h.

◆ _interactOnlyWithSelectedCSOs

bool CSOSelectAndMoveAction::_interactOnlyWithSelectedCSOs
protected

Definition at line 73 of file CSOSelectAndMoveAction.h.

Referenced by setInteractOnlyWithSelectedCSO().

◆ _previousDevicePosition

SbVec2f CSOSelectAndMoveAction::_previousDevicePosition
protected

Definition at line 70 of file CSOSelectAndMoveAction.h.

◆ _sliceNormal

SbVec3f CSOSelectAndMoveAction::_sliceNormal
protected

Definition at line 71 of file CSOSelectAndMoveAction.h.


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