ImFusion SDK 4.3
InteractionPlotView Class Reference

#include <ImFusion/GUI/InteractionPlotView.h>

Interaction class for plot view. More...

+ Inheritance diagram for InteractionPlotView:

Detailed Description

Interaction class for plot view.

See also
PlotView, GlPlotView

Public Types

enum  SelectionMode { NoSelection = 0 , SelectionX = 1 << 0 , SelectionY = 1 << 1 }
 Bitflag enumeration for defining the set of allowed/supported selections. More...
 

Public Slots

void setPlotSelection (vec2 rangeX, vec2 rangeY)
 

Signals

void selectionChanged (vec2 rangeX, vec2 rangeY)
 

Public Member Functions

 InteractionPlotView (PlotView &pv)
 
Flags< SelectionModeselectionMode () const
 Returns the set of supported selection modes.
 
void setSelectionMode (Flags< SelectionMode > value)
 Sets the set of supported selection modes.
 
bool sceneEvent (QEvent *event) override
 Modify the translation and rotation parameters based on the mouse 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 context menu actions.
 
void updateSpectrum ()
 
void setSpectrumVisible (bool on)
 
- 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)
 
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.
 

Protected Types

enum class  InteractionMode { None , Pan , Zoom , Select }
 

Protected Attributes

PlotViewm_plotView
 
GlPlotViewm_glView = nullptr
 
QDialog * m_zoomDialog = nullptr
 
Flags< SelectionModem_selectionMode = NoSelection
 
InteractionMode m_currentInteractionMode = InteractionMode::None
 
int m_x0 = 0
 
int m_y0 = 0
 
bool m_suppressNextContextMenuEvent = false
 
- 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.
 
- 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.
 
- 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 Enumeration Documentation

◆ SelectionMode

Bitflag enumeration for defining the set of allowed/supported selections.

Enumerator
NoSelection 

No selection supported.

SelectionX 

Support selection along the X axis.

SelectionY 

Support selection along the Y axis.

Member Function Documentation

◆ sceneEvent()

bool sceneEvent ( QEvent * event)
overridevirtual

Modify the translation and rotation parameters based on the mouse events.

Implements 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 context menu actions.

Reimplemented from Interaction.


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