ImFusion SDK 4.3

#include <ImFusion/GUI/InteractionView3D.h>

Standard 2D/3D view interaction. More...

+ Inheritance diagram for InteractionView3D:

Detailed Description

Standard 2D/3D view interaction.

Public Member Functions

 InteractionView3D (ImageView3D &view)
 
void reset () override
 
void contextMenuCreate (QMenu &m) override
 Create context menu entries.
 
void contextMenuEvaluate (QAction *a) override
 Evaluate action chosen in context menu.
 
void createActions () override
 Create actions shown in context menu.
 
void setSceneCenter (const vec3 &center)
 Set scene center.
 
const vec3 & sceneCenter () const
 Get scene center.
 
bool sceneEvent (QEvent *event) override
 Modify the view parameters based on the mouse events.
 
bool sceneEventTouch (QEvent *event)
 Modify the view parameters based on the touchscreen events.
 
mat4 transformation () const
 Current transformation.
 
void setInteractionLodMode (GlVolumeView::LodMode lodMode)
 
void setInteractionLodSizeThresholdMb (int lodVolumeSizeThresholdMb)
 
void setOrientToNormalOnClick (bool orientOnClick)
 If true, the slices will be oriented to the surface normal on double click.
 
- Public Member Functions inherited from ViewInteraction
 ViewInteraction (InteractiveView &view)
 Instantiate a new ViewInteraction that contains already basic actions for the view.
 
void contextMenuCreate (QMenu &m) override
 Create context menu entries.
 
virtual void setViewActionMap (ViewActionMap *m)
 Sets the action mapping of this view. If nullptr, will default to the global one.
 
virtual ViewActionMapviewActionMap ()
 Returns the local view action map for this view interaction, if any has been set.
 
void setMouseActionSpeed (ViewActionType action, double speed)
 Setters for the speed of a mouse (touch) action.
 
void setTouchActionSpeed (ViewActionType action, double speed)
 
double mouseActionSpeed (ViewActionType action) const
 Getters for the speed of a mouse (touch) action, return the default value if the action is not found in the map.
 
double touchActionSpeed (ViewActionType action) const
 
bool matchMappedActions (ViewActionType viewAction, Qt::MouseButton button, Qt::KeyboardModifiers modifiers) const
 Returns true if the MouseAction defined by button and modifiers is registered for the viewAction.
 
virtual void createCustomViewActionMap ()
 Must be used to override the global view action mapper This method can be overridden in order to define a custom default mapping between view actions and user mouse events Example code for the overridden method:
 
- Public Member Functions inherited from Interaction
virtual void openContextMenu (QPoint pos, QPoint globalPos, Qt::KeyboardModifiers modifiers)
 
void setUseContextMenu (bool use)
 Set if the context menu must be created or not.
 
bool useContextMenu () const
 Specifies if the view creates context menu entries or not. Default value is false.
 
- Public Member Functions inherited from SignalReceiver
 SignalReceiver ()=default
 Default constructor.
 
 SignalReceiver (const SignalReceiver &other)
 Copy constructor, does not copy any existing signal connections from other.
 
SignalReceiveroperator= (SignalReceiver rhs)
 Assignment operator, disconnects all existing connections, does not copy any existing signal connections from rhs.
 
virtual ~SignalReceiver ()
 Virtual destructor disconnects from all connected signals.
 

Protected Member Functions

bool changePose (QMouseEvent *event, const vec2 &mouseDistance)
 
void addTranslation (double dx, double dy, double dz=0.0)
 Adds dx, dy, and dz to the current translation matrix (since the last mouse press event)
 
void applyIncrementalTransform ()
 Applies the current transformation from m_translation and m_rotation to m_matrix0 Sets m_translation and m_rotation to zero.
 
void handleKeyboardShortcut (int eventId)
 
- Protected Member Functions inherited from ViewInteraction
virtual void keyPressEvent (QKeyEvent *event)
 Triggers actions if the pressed key sequence matches their shortcut.
 
void createActions () override
 Creates actions shown in context menu.
 
- Protected Member Functions inherited from SignalReceiver
void disconnectAll ()
 Disconnects all existing connections.
 

Protected Attributes

ImageView3Dm_imageView3D
 
vec2i m_mouseDownPosition
 
int m_mouseDownButton
 
mat4 m_mouseDownMatrix
 
vec2 m_mouseDownWindowLevel
 
double m_mouseDownAlpha
 
bool m_dragging
 
bool m_rotateZ
 
double m_rotateZFactor
 
int m_rotateZAxis
 
Camera m_referenceCam
 View camera on mouse press.
 
vec3 m_sceneCenter
 
vec3 m_translation
 Current translation parameters since the last mouse press event.
 
vec3 m_rotation
 Current rotation parameters since the last mouse press event.
 
GlVolumeView::LodMode m_lodMode
 
int m_lodVolumeSizeThresholdMb
 
bool m_orientToNormalOnClick
 
bool m_simultaneousBlending
 
bool m_isTouch
 
int m_oldDistance
 Indicates that we are generally in a touch gesture right now.
 
QPointF m_oldPoint
 Indicates the cached distance between 2 former touchpoints.
 
QPointF m_oldCenterPoint
 Indicates the cached point of a single touch.
 
QLineF m_oldAngleReferenceLine
 Indicates the cached center between 2 former touchpoints.
 
- Protected Attributes inherited from ViewInteraction
InteractiveViewm_view
 
ViewActionMapm_viewActionMap
 Custom mapping for this specific view. This will override the global mapping if is not nullptr.
 
- Protected Attributes inherited from Interaction
QMap< QString, QAction * > m_actions
 Actions used in the context menu.
 
bool m_useContextMenu = false
 Default value is false.
 

Additional Inherited Members

static bool addMappedViewAction (ViewActionType viewAction, Qt::MouseButton button, Qt::KeyboardModifiers modifiers)
 
static bool removeMappedViewAction (ViewActionType viewAction, Qt::MouseButton button, Qt::KeyboardModifiers modifiers)
 Removes mapping from viewAction to MouseAction defined by button and modifiers Returns true if removing succeeds, or false if this mapping does not exists.
 
static void resetActionMapping ()
 Loads the default view interaction mapping.
 
static const ViewActionMapglobalViewActionMap ()
 Const access to the global view action mapper.
 
static void setGlobalViewActionMap (const ViewActionMap &map)
 Sets the global view action map.
 
static bool hasConflicts (const ViewActionMap &actionMap, std::vector< std::pair< ViewActionType, ViewActionType > > &conflictingActions)
 Checks if the mapping defined in actionMap has any conflicts.
 
- Static Public Attributes inherited from ViewInteraction
static const std::unordered_map< ViewActionType, QString > viewActionsName
 
static const std::unordered_map< Qt::MouseButton, QString > mouseButtonsName
 
- Protected Slots inherited from ViewInteraction
void contextMenuEvaluate (QAction *action) override
 Evaluate action chosen in context menu or by shortcut.
 
- Static Protected Attributes inherited from ViewInteraction
static ViewActionMap viewActionMapGlobal
 Global mapping between view actions and user mouse events (only mouse and keyboard modifiers now, touch and gestures must be supported too)
 

Member Function Documentation

◆ reset()

void reset ( )
overridevirtual

Reimplemented from Interaction.

◆ contextMenuCreate()

void contextMenuCreate ( QMenu & m)
overridevirtual

Create context menu entries.

Reimplemented from Interaction.

◆ contextMenuEvaluate()

void contextMenuEvaluate ( QAction * a)
overridevirtual

Evaluate action chosen in context menu.

Reimplemented from Interaction.

◆ createActions()

void createActions ( )
overridevirtual

Create actions shown in context menu.

Reimplemented from Interaction.

◆ sceneEvent()

bool sceneEvent ( QEvent * event)
overridevirtual

Modify the view parameters based on the mouse events.

Implements Interaction.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close