![]() |
ImFusion SDK 4.3
|
#include <ImFusion/GUI/InteractionOrthoView2D.h>
Ortho 2D view interaction. More...
Ortho 2D view interaction.
Public Member Functions | |
InteractionOrthoView2D (ImageView2D &view) | |
bool | sceneEvent (QEvent *event) override |
Modify the view parameters based on the mouse events. | |
bool | changePose (QMouseEvent *event) |
![]() | |
InteractionView2D (ImageView2D &view) | |
void | setInteractionTarget (InteractionTarget target) |
InteractionTarget | interactionTarget () const |
RotationReference | rotationReference () const |
Returns the reference for determining the rotation center. | |
void | setRotationReference (RotationReference value) |
Sets the reference for determining the rotation center. | |
void | setTouchActions (const TouchActions &touchActions) |
Setter/getter pair for touch action types. | |
const TouchActions & | touchActions () const |
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. | |
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. | |
ImageView2D & | view2D () |
Returns the view of this interaction. | |
std::vector< SharedImageSet * > | moveImages () const |
Returns the list of images that should be moved if interactionTarget() is InteractionTarget::Image. | |
void | addMoveImage (SharedImageSet *val) |
Adds the given image to the list of images to which the "move image" feature is applied. | |
void | removeMoveImage (const SharedImageSet *img) |
Removes the given image from the list of images to which the "move image" feature is applied. | |
void | setMoveImageHighlightColor (const vec4 &color) |
Sets the color for highlighting move images. | |
void | setMoveImageHighlightEnabled (bool enable) |
Enables/Disables highlighting of the move-image. | |
![]() | |
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 ViewActionMap * | viewActionMap () |
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: | |
![]() | |
virtual void | openContextMenu (QPoint pos, QPoint globalPos, Qt::KeyboardModifiers modifiers) |
virtual void | reset () |
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. | |
Additional Inherited Members | |
![]() | |
enum class | RotationReference { Dataset , View , Crossection } |
enum class | InteractionTarget { Slice , Image } |
Enumeration of interaction modes allowing to choose between regular view interaction and the "move image" feature. More... | |
![]() | |
void | windowingEditorRequested () |
Connected slot should open a windowing editor for this view. | |
void | moveImageStart () |
Signals when the move image interaction starts. | |
void | moveImageEnd () |
Signals when the move image interaction ends. | |
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 ViewActionMap & | globalViewActionMap () |
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 const std::unordered_map< ViewActionType, QString > | viewActionsName |
static const std::unordered_map< Qt::MouseButton, QString > | mouseButtonsName |
![]() | |
void | contextMenuEvaluate (QAction *action) override |
Evaluate action chosen in context menu or by shortcut. | |
![]() | |
bool | changePose (QMouseEvent *event) |
Changes the pose of the view using CumulativeViewManipulation2D. | |
vec3 | rotationCenter (const SharedImageSet *sis=nullptr) const |
Returns the rotation center (optionally considering the image) | |
bool | handleMouseMoveEvent (QMouseEvent *event) |
Returns true(false) if the mouse move was (not) handled. | |
bool | hasMatchingAction (int touchPointsCount, ViewActionType action) |
Returns true (false) if there is (not) a matching action for the given number of touch-points Checks that the touch points are positive and smaller than three. | |
CumulativeViewManipulation2D * | cumulativeManipulation () const |
Getters for the view manipulations. | |
ImmediateViewManipulation2D * | immediateViewManipulation () const |
![]() | |
virtual void | keyPressEvent (QKeyEvent *event) |
Triggers actions if the pressed key sequence matches their shortcut. | |
void | createActions () override |
Creates actions shown in context menu. | |
![]() | |
bool | m_dragging = false |
Qt::MouseButton | m_mouseDragButton = Qt::NoButton |
vec2 | m_mouseDownPos = vec2::Zero() |
vec2 | m_mouseDelta = vec2::Zero() |
vec3 | m_rotationCenter = vec3::Zero() |
std::optional< double > | m_oldDistance = std::nullopt |
Indicates the cached distance between 2 former touchpoints. | |
vec2 | m_oldPoint = vec2::Zero() |
Indicates the cached point of a single touch. | |
vec2 | m_oldCenterPoint = vec2::Zero() |
Indicates the cached center between 2 former touchpoints. | |
QLineF | m_oldAngleReferenceLine = {} |
Indicates the cached angle between 2 former lines (of 2 touchpoints) | |
TouchActions | m_touchActions = {{PAN}, {PAN, ROTATESLICE2D, ZOOMSLICE}} |
Standard touch actions for one/two finger touch gestures. | |
InteractionTarget | m_interactionTarget = InteractionTarget::Slice |
RotationReference | m_rotationReference = RotationReference::Crossection |
![]() | |
InteractiveView & | m_view |
ViewActionMap * | m_viewActionMap |
Custom mapping for this specific view. This will override the global mapping if is not nullptr. | |
![]() | |
QMap< QString, QAction * > | m_actions |
Actions used in the context menu. | |
bool | m_useContextMenu = false |
Default value is false. | |
![]() | |
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) | |
|
overridevirtual |
Modify the view parameters based on the mouse events.
Implements Interaction.