ImFusion C++ SDK 4.5.0
ImFusion::GUI::SliceViewDefaultEventHandler Class Reference

#include <ImFusion/GUI/SliceViewDefaultEventHandler.h>

Implementation of an input event handler providing standard mouse, touch, and keyboard interaction with a SliceView. More...

Inheritance diagram for ImFusion::GUI::SliceViewDefaultEventHandler:

Detailed Description

Implementation of an input event handler providing standard mouse, touch, and keyboard interaction with a SliceView.

See also
SliceView

Classes

struct  TouchActionConfig
 Record to define which touch events should be processed and how. More...
struct  ActionSpeed
 Record to define the speed at which a mouse/touch movement will modify the underlying view. More...

Public Types

enum class  Action {
  Pan , SweepSlice , Zoom , InPlaneRotation ,
  OutOfPlaneRotation , ChangeFocus , Windowing , Blending
}
 Enumeration of actions that can be performed based on input events. More...
enum class  CenterOfRotation { FirstImage , AllDatasets , View , MprIntersection }
 Enumeration of options for determining the center of rotation. More...

Public Member Functions

 SliceViewDefaultEventHandler (SliceView &view)
CenterOfRotation centerOfRotation () const
 Returns the center of rotation for in-plane and out-of-plane rotations.
void setCenterOfRotation (CenterOfRotation value)
 Sets the center of rotation for in-plane and out-of-plane rotations.
const TouchActionConfigtouchActionConfig () const
 Returns which touch events should be processed and how.
void setTouchActionConfig (const TouchActionConfig &value)
 Sets which touch events should be processed and how.
const std::vector< SharedImageSet * > & manualRegistrationImages () const
 Returns the list of images for which pan and rotation actions are interpreted as manual registration actions.
void setManualRegistrationImages (const std::vector< SharedImageSet * > &images)
 Sets the list of images for which pan and rotation actions are interpreted as manual registration actions.
std::optional< vec4 > manualRegistrationHighlightColor () const
 Returns the optional tint color to indicate/highlight the manualRegistrationImages() in the rendering.
void setManualRegistrationHighlightColor (std::optional< vec4 > color)
 Sets the optional tint color to indicate/highlight the manualRegistrationImages() in the rendering.
ActionSpeed actionSpeed (Action action) const
 Returns the speed at which a mouse/touch movement will modify the underlying view.
void setActionSpeed (Action action, ActionSpeed value)
 Sets the speed at which a mouse/touch movement will modify the underlying view.
InputEventMapper< Action > & inputEventMapper ()
 Access to the helper class to map an InputEvent to an Action of this view to allow for to customize the mapping from the outside.
EventResult handleInputEvent (const InputEvent &event) override
 This function is called by sources of input events in order to dispatch them to the handlers.
Public Member Functions inherited from ImFusion::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

vec3 rotationCenter () const
SharedImageSettargetImage () const
 Returns the target image for window/level, and focus actions.
virtual EventResult handleMouseEvent (const MouseEvent &event)
virtual EventResult handleTouchEvent (const TouchEvent &event)
virtual EventResult handleContextMenuEvent (const ContextMenuEvent &event)
Protected Member Functions inherited from ImFusion::SignalReceiver
void disconnectAll ()
 Disconnects all existing connections.

Protected Attributes

SliceViewm_view
InputEventMapper< Actionm_actionMapper
CenterOfRotation m_centerOfRotation = CenterOfRotation::MprIntersection
std::vector< SharedImageSet * > m_manualRegImages
std::unique_ptr< GlImageHighlighterm_manualRegHighlighter
bool m_highlightMoveImages = false
TouchActionConfig m_touchActionConfig

Member Enumeration Documentation

◆ Action

Enumeration of actions that can be performed based on input events.

Enumerator
Pan 

in-plane panning of the viewport

SweepSlice 

out-of-plane panning panning of the viewport / change the visible slice of a 3D dataset in a MPR view

Zoom 

change the zoom of the viewport

InPlaneRotation 

in-plane rotation of the viewport

OutOfPlaneRotation 

out-of-plane rotation of the viewport

ChangeFocus 

change the focus image of the current dataset

Windowing 

change the window and level of the display options of the current dataset

Blending 

change the blending factor

◆ CenterOfRotation

Enumeration of options for determining the center of rotation.

Enumerator
FirstImage 

Center of the first shown image.

AllDatasets 

Center of all shown datasets.

View 

Center of the currently visible viewport.

MprIntersection 

Intersection point of all SliceViews if it is part of a ViewGroup3D; CenterOfRotation::View otherwise.

Member Function Documentation

◆ setManualRegistrationImages()

void ImFusion::GUI::SliceViewDefaultEventHandler::setManualRegistrationImages ( const std::vector< SharedImageSet * > & images)

Sets the list of images for which pan and rotation actions are interpreted as manual registration actions.

If this list is empty pan and rotation will be applied to the view matrix. If the list is not empty pan and rotation will be applied to the images' matrices instead.

◆ handleInputEvent()

EventResult ImFusion::GUI::SliceViewDefaultEventHandler::handleInputEvent ( const InputEvent & event)
overridevirtual

This function is called by sources of input events in order to dispatch them to the handlers.

In case there are more than one InputEventHandlers dispatchers are intended call this function consecutively until the first handler indicates to stop by returning a result where EventResult::stopPropagation() is true.

Implements ImFusion::GUI::View::EventHandler.

◆ targetImage()

SharedImageSet * ImFusion::GUI::SliceViewDefaultEventHandler::targetImage ( ) const
protected

Returns the target image for window/level, and focus actions.

For 2D views, returns the first image in View::visibleData(). For MPR views, returns the first volumetric view in View::visibleData().


The documentation for this class was generated from the following file:
  • ImFusion/GUI/SliceViewDefaultEventHandler.h
Search Tab / S to search, Esc to close