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

#include <ImFusion/GUI/VolumeViewDefaultEventHandler.h>

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

Inheritance diagram for ImFusion::GUI::VolumeViewDefaultEventHandler:

Detailed Description

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

See also
VolumeView, CameraNavigation

Classes

struct  ActionSpeed
 Record to define the speed/change rate at which a mouse/touch movement will modify the underlying view. More...

Public Types

enum class  Action {
  Pan , Zoom , Rotate , Windowing ,
  Blending , SetCameraPositiveX , SetCameraNegativeX , SetCameraPositiveY ,
  SetCameraNegativeY , SetCameraPositiveZ , SetCameraNegativeZ , PanUp ,
  PanDown , PanLeft , PanRight , ZoomIn ,
  ZoomOut , RotateUp , RotateDown , RotateLeft ,
  RotateRight
}
 Enumeration of actions that can be performed based on input events. More...

Public Member Functions

 VolumeViewDefaultEventHandler (VolumeView &view)
const vec3 & rotationCenter () const
 Returns the center of rotation used during camera navigation.
void setRotationCenter (const vec3 &value)
 Sets the center of rotation used during camera navigation.
ActionSpeed actionSpeed (Action action) const
 Returns the speed at which a mouse/touch/keyboard event will modify the underlying view.
void setActionSpeed (Action action, ActionSpeed value)
 Sets the speed at which a mouse/touch/keyboard event will modify the underlying view.
bool orientToNormalOnDoubleClick () const
 Returns the flag whether MPR slices and camera should be oriented to the local surface normal on double click.
void setOrientToNormalOnDoubleClick (bool value)
 Sets the flag whether MPR slices and camera should be oriented to the local surface normal on double click.
void setUseLowQualityRenderingDuringInteraction (bool enable, std::optional< ByteSize > volumeSizeThreshold)
 Sets whether to reduce the visual rendering quality while running interactions to improve performance.
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

virtual EventResult handleKeyEvent (const KeyEvent &event)
virtual EventResult handleMouseEvent (const MouseEvent &event)
virtual EventResult handleTouchEvent (const TouchEvent &event)
virtual EventResult handleContextMenuEvent (const ContextMenuEvent &event)
void enableLowQualityRenderingIfApplicable ()
void disableLowQualityRendering ()
Protected Member Functions inherited from ImFusion::SignalReceiver
void disconnectAll ()
 Disconnects all existing connections.

Protected Attributes

VolumeViewm_view
InputEventMapper< Actionm_actionMapper
CameraNavigation m_camNav
bool m_simultaneousBlending = true
bool m_orientToNormalOnDoubleClick = false
bool m_useLowQualityRenderingDuringInteraction = false
std::optional< ByteSizem_volumeSizeThresholdForLQRendering

Member Enumeration Documentation

◆ Action

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

Enumerator
Pan 

in-plane panning of the viewport

Zoom 

change the zoom of the viewport / move the camera along the view axis

Rotate 

Rotate the camera around the scene center.

Windowing 

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

Blending 

change the blending the visible volume by modifying their opacity

SetCameraPositiveX 

Reset the camera so that it looks onto the scene from the positive side of the world coordinates X axis.

SetCameraNegativeX 

Reset the camera so that it looks onto the scene from the negative side of the world coordinates X axis.

SetCameraPositiveY 

Reset the camera so that it looks onto the scene from the positive side of the world coordinates Y axis.

SetCameraNegativeY 

Reset the camera so that it looks onto the scene from the negative side of the world coordinates Y axis.

SetCameraPositiveZ 

Reset the camera so that it looks onto the scene from the positive side of the world coordinates Z axis.

SetCameraNegativeZ 

Reset the camera so that it looks onto the scene from the negative side of the world coordinates Z axis.

PanUp 

Pan the viewport upwards.

PanDown 

Pan the viewport downwards.

PanLeft 

Pan the viewport to the left.

PanRight 

Pan the viewport to the right.

ZoomIn 

Zoom into the viewport / move the camera towards the scene.

ZoomOut 

Zoom out of the viewport / move the camera away from the scene.

RotateUp 

Rotate the camera upwards around the scene center.

RotateDown 

Rotate the camera downwards around the scene center.

RotateLeft 

Rotate the camera left around the scene center.

RotateRight 

Rotate the camera right around the scene center.

Member Function Documentation

◆ actionSpeed()

ActionSpeed ImFusion::GUI::VolumeViewDefaultEventHandler::actionSpeed ( Action action) const

Returns the speed at which a mouse/touch/keyboard event will modify the underlying view.

action must be one of Pan, Zoom, Rotate, Windowing, or Blending.

◆ setActionSpeed()

void ImFusion::GUI::VolumeViewDefaultEventHandler::setActionSpeed ( Action action,
ActionSpeed value )

Sets the speed at which a mouse/touch/keyboard event will modify the underlying view.

action must be one of Pan, Zoom, Rotate, Windowing, or Blending.

◆ setUseLowQualityRenderingDuringInteraction()

void ImFusion::GUI::VolumeViewDefaultEventHandler::setUseLowQualityRenderingDuringInteraction ( bool enable,
std::optional< ByteSize > volumeSizeThreshold )

Sets whether to reduce the visual rendering quality while running interactions to improve performance.

Parameters
enableFlag whether to enable LQ mode while running interactions.
volumeSizeThresholdOptional minimal sum of rendered volume sizes for the LQ mode to be used.

◆ handleInputEvent()

EventResult ImFusion::GUI::VolumeViewDefaultEventHandler::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.


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