![]() |
Inviwo 0.9.12-pre
Inviwo documentation
|
Public Types | |
| using | MouseCursorCallback = std::function<void(MouseCursor)> |
| Public Types inherited from inviwo::InteractionEvent | |
| using | ContextMenuCallback |
| using | ToolTipCallback = std::function<void(std::string_view)> |
Public Member Functions | |
| std::string | buttonName () const |
| MouseButtons | buttonState () const |
| uvec2 | canvasSize () const |
| virtual MouseInteractionEvent * | clone () const override=0 |
| double | depth () const |
| const MouseCursorCallback & | getMouseCursorCallback () const |
| MouseInteractionEvent (const MouseInteractionEvent &rhs)=default | |
| MouseInteractionEvent (MouseButtons buttonState=MouseButtons(flags::empty), KeyModifiers modifiers=KeyModifiers(flags::empty), dvec2 normalizedPosition=dvec2(0), uvec2 canvasSize=uvec2(1), double depth=1.0) | |
| dvec3 | ndc () const |
| MouseInteractionEvent & | operator= (const MouseInteractionEvent &that)=default |
| dvec2 | pos () const |
| dvec2 | posNormalized () const |
| void | setButtonState (MouseButtons buttonState) |
| void | setCanvasSize (uvec2 size) |
| void | setDepth (double depth) |
| void | setMouseCursor (MouseCursor cursor) const |
| void | setMouseCursorCallback (MouseCursorCallback callback) |
| void | setPos (dvec2 pos) |
| void | setPosNormalized (dvec2 pos) |
| double | x () const |
| double | y () const |
| Public Member Functions inherited from inviwo::InteractionEvent | |
| const ContextMenuCallback & | getContexMenuCallback () const |
| const ToolTipCallback & | getToolTipCallback () const |
| InteractionEvent (const InteractionEvent &rhs)=default | |
| InteractionEvent (KeyModifiers modifiers=KeyModifiers(flags::empty)) | |
| std::string | modifierNames () const |
| KeyModifiers | modifiers () const |
| InteractionEvent & | operator= (const InteractionEvent &that)=default |
| void | setContextMenuCallback (ContextMenuCallback callback) |
| void | setModifiers (KeyModifiers modifiers) |
| void | setToolTip (std::string_view tooltip) const |
| void | setToolTipCallback (ToolTipCallback callback) |
| void | showContextMenu (std::span< ContextMenuEntry > entries, ContextMenuCategories categories=ContextMenuCategory::Callback) |
| Public Member Functions inherited from inviwo::Event | |
| template<typename EventType> | |
| EventType * | getAs () |
| template<typename EventType> | |
| const EventType * | getAs () const |
| const std::vector< Processor * > & | getVisitedProcessors () const |
| bool | hasBeenUsed () const |
| virtual uint64_t | hash () const =0 |
| bool | hasVisitedProcessor (Processor *) const |
| bool | markAsUnused () |
| bool | markAsUsed () |
| void | markAsVisited (Event &) |
| bool | markAsVisited (Processor *) |
| virtual void | print (std::ostream &ss) const |
| bool | setUsed (bool isUsed) |
| virtual bool | shouldPropagateTo (Inport *inport, Processor *processor, Outport *source) |
Additional Inherited Members | |
| Protected Member Functions inherited from inviwo::Event | |
| Event (const Event &rhs)=default | |
| Event & | operator= (const Event &that)=default |
| Protected Attributes inherited from inviwo::InteractionEvent | |
| ContextMenuCallback | contextMenuCallback_ |
| KeyModifiers | modifiers_ |
| ToolTipCallback | tooltip_ |
| MouseButtons inviwo::MouseInteractionEvent::buttonState | ( | ) | const |
Get all the pressed buttons.
| uvec2 inviwo::MouseInteractionEvent::canvasSize | ( | ) | const |
The size of the canvas where the event occurred.
|
overridepure virtual |
Implements inviwo::InteractionEvent.
| double inviwo::MouseInteractionEvent::depth | ( | ) | const |
Retrieve depth value in normalized device coordinates at mouse position. Defined in [-1 1], where -1 is the near plane and 1 is the far plane. Will be 1 if no depth value is available. The depth is then defined to be positive inwards by default, resulting in a left handed coordinate system together with the position.
| dvec3 inviwo::MouseInteractionEvent::ndc | ( | ) | const |
Returns the normalized device coordinates. Position and depth normalized to the range of (-1,1) In in a left handed coordinate system. The lower left near will be (-1,-1,-1) And the upper right far (1,1,1)
| dvec2 inviwo::MouseInteractionEvent::pos | ( | ) | const |
Position of the mouse in the canvas. The lower left corner is (0,0) the upper right corner is (canvasSize.x, canvasSize.y) This is in accordance with the positioning within an Inviwo Layer and an OpenGL texture. But opposite to QT which has (0,0) at the top left corner. The depth is then defined to be positive inwards by default, resulting in a left handed coordinate system.
| dvec2 inviwo::MouseInteractionEvent::posNormalized | ( | ) | const |
Returns the position normalized to the range (0,1). The lower left will be (0,0) And the upper right (1,1)
| void inviwo::MouseInteractionEvent::setMouseCursor | ( | MouseCursor | cursor | ) | const |
Change the current mouse cursor using the optionally set mouse cursor callback. If no mouse cursor callback is set, the function does nothing.
| void inviwo::MouseInteractionEvent::setMouseCursorCallback | ( | MouseCursorCallback | callback | ) |
Set a mouse cursor call back function. The function should change the mouse cursor with the one given cursor. This function is usually called by the originating event canvas, and not any regular user code.