Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::InteractionEvent Class Referenceabstract
Inheritance diagram for inviwo::InteractionEvent:

Public Types

using ToolTipCallback = std::function<void(std::string_view)>
using ContextMenuCallback

Public Member Functions

 InteractionEvent (KeyModifiers modifiers=KeyModifiers(flags::empty))
 InteractionEvent (const InteractionEvent &rhs)=default
InteractionEventoperator= (const InteractionEvent &that)=default
virtual InteractionEventclone () const override=0
KeyModifiers modifiers () const
void setModifiers (KeyModifiers modifiers)
std::string modifierNames () const
void setToolTip (std::string_view tooltip) const
void setToolTipCallback (ToolTipCallback callback)
const ToolTipCallback & getToolTipCallback () const
void showContextMenu (std::span< ContextMenuEntry > entries, ContextMenuCategories categories=ContextMenuCategory::Callback)
void setContextMenuCallback (ContextMenuCallback callback)
const ContextMenuCallback & getContexMenuCallback () const
Public Member Functions inherited from inviwo::Event
virtual uint64_t hash () const =0
virtual bool shouldPropagateTo (Inport *inport, Processor *processor, Outport *source)
bool markAsUsed ()
bool markAsUnused ()
bool setUsed (bool isUsed)
bool hasBeenUsed () const
bool markAsVisited (Processor *)
void markAsVisited (Event &)
bool hasVisitedProcessor (Processor *) const
const std::vector< Processor * > & getVisitedProcessors () const
template<typename EventType>
EventType * getAs ()
template<typename EventType>
const EventType * getAs () const
virtual void print (std::ostream &ss) const

Protected Attributes

KeyModifiers modifiers_
ToolTipCallback tooltip_
ContextMenuCallback contextMenuCallback_

Additional Inherited Members

Protected Member Functions inherited from inviwo::Event
 Event (const Event &rhs)=default
Eventoperator= (const Event &that)=default

Member Typedef Documentation

◆ ContextMenuCallback

using inviwo::InteractionEvent::ContextMenuCallback
Initial value:
std::function<void(std::span<ContextMenuEntry>, ContextMenuCategories, InteractionEvent*)>

Member Function Documentation

◆ clone()

virtual InteractionEvent * inviwo::InteractionEvent::clone ( ) const
overridepure virtual

Implements inviwo::Event.

◆ setToolTip()

void inviwo::InteractionEvent::setToolTip ( std::string_view tooltip) const

Display a tool tip using the optionally set tool tip callback. If no tool tip callback is set, the function does nothing. The supported formation depends on the used back end, but simple html is usually supported. Calling the function with an empty sting will hide any existing tool tip.

◆ setToolTipCallback()

void inviwo::InteractionEvent::setToolTipCallback ( ToolTipCallback callback)

Set a tool tip call back function. The function should display a tool tip with the given string at the position of the event. This function is usually called by the originating event canvas, and not any regular user code.

◆ showContextMenu()

void inviwo::InteractionEvent::showContextMenu ( std::span< ContextMenuEntry > entries,
ContextMenuCategories categories = ContextMenuCategory::Callback )

Show a context menu at the current mouse position. The custom menu entries are added before any other default actions based on categories. When any of the custom menu actions in the entries is triggered, a ContexMenuEvent with the corresponding entry ID will be propagated through the processor network.

Parameters
entrieslist of custom menu items
categoriesdetermines which menu actions should be included in the context menu
See also
ContextMenuCategories

The documentation for this class was generated from the following file:
  • interactionevent.h