VTK  9.1.0
Public Types | Public Member Functions | Protected Attributes | List of all members
vtkContextMouseEvent Class Reference

data structure to represent mouse events. More...

#include <vtkContextMouseEvent.h>

Collaboration diagram for vtkContextMouseEvent:
[legend]

Public Types

enum  { NO_BUTTON = 0 , LEFT_BUTTON = 1 , MIDDLE_BUTTON = 2 , RIGHT_BUTTON = 4 }
 Enumeration of mouse buttons. More...
 
enum  { NO_MODIFIER = 0 , ALT_MODIFIER = 1 , SHIFT_MODIFIER = 2 , CONTROL_MODIFIER = 4 }
 Enumeration of modifier keys. More...
 

Public Member Functions

 vtkContextMouseEvent ()=default
 
void SetInteractor (vtkRenderWindowInteractor *interactor)
 Set the interactor for the mouse event.
 
vtkRenderWindowInteractorGetInteractor () const
 Get the interactor for the mouse event.
 
void SetPos (const vtkVector2f &pos)
 Set/get the position of the mouse in the item's coordinates.
 
vtkVector2f GetPos () const
 
void SetScenePos (const vtkVector2f &pos)
 Set/get the position of the mouse in scene coordinates.
 
vtkVector2f GetScenePos () const
 
void SetScreenPos (const vtkVector2i &pos)
 Set/get the position of the mouse in screen coordinates.
 
vtkVector2i GetScreenPos () const
 
void SetLastPos (const vtkVector2f &pos)
 Set/get the position of the mouse in the item's coordinates.
 
vtkVector2f GetLastPos () const
 
void SetLastScenePos (const vtkVector2f &pos)
 Set/get the position of the mouse in scene coordinates.
 
vtkVector2f GetLastScenePos () const
 
void SetLastScreenPos (const vtkVector2i &pos)
 Set/get the position of the mouse in screen coordinates.
 
vtkVector2i GetLastScreenPos () const
 
void SetButton (int button)
 Set/get the mouse button that caused the event, with possible values being NO_BUTTON, LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON.
 
int GetButton () const
 
int GetModifiers () const
 Return the modifier keys, if any, ORed together.
 

Protected Attributes

vtkVector2f Pos
 Position of the mouse in item coordinate system.
 
vtkVector2f ScenePos
 Position of the mouse the scene coordinate system.
 
vtkVector2i ScreenPos
 Position of the mouse in screen coordinates.
 
vtkVector2f LastPos
 ‘Pos’ at the previous mouse event.
 
vtkVector2f LastScenePos
 `ScenePos'at the previous mouse event.
 
vtkVector2i LastScreenPos
 ‘ScreenPos’ at the previous mouse event.
 
int Button
 Mouse button that caused the event, using the anonymous enumeration.
 
vtkRenderWindowInteractorInteractor
 

Detailed Description

data structure to represent mouse events.

Provides a convenient data structure to represent mouse events in the vtkContextScene. Passed to vtkAbstractContextItem objects.

Online Examples:

Definition at line 53 of file vtkContextMouseEvent.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Enumeration of mouse buttons.

Enumerator
NO_BUTTON 
LEFT_BUTTON 
MIDDLE_BUTTON 
RIGHT_BUTTON 

Definition at line 59 of file vtkContextMouseEvent.h.

◆ anonymous enum

anonymous enum

Enumeration of modifier keys.

Enumerator
NO_MODIFIER 
ALT_MODIFIER 
SHIFT_MODIFIER 
CONTROL_MODIFIER 

Definition at line 70 of file vtkContextMouseEvent.h.

Constructor & Destructor Documentation

◆ vtkContextMouseEvent()

vtkContextMouseEvent::vtkContextMouseEvent ( )
default

Member Function Documentation

◆ SetInteractor()

void vtkContextMouseEvent::SetInteractor ( vtkRenderWindowInteractor interactor)
inline

Set the interactor for the mouse event.

Definition at line 83 of file vtkContextMouseEvent.h.

◆ GetInteractor()

vtkRenderWindowInteractor * vtkContextMouseEvent::GetInteractor ( ) const
inline

Get the interactor for the mouse event.

This can be null, and is provided only for convenience.

Definition at line 89 of file vtkContextMouseEvent.h.

◆ SetPos()

void vtkContextMouseEvent::SetPos ( const vtkVector2f pos)
inline

Set/get the position of the mouse in the item's coordinates.

Definition at line 94 of file vtkContextMouseEvent.h.

◆ GetPos()

vtkVector2f vtkContextMouseEvent::GetPos ( ) const
inline

Definition at line 95 of file vtkContextMouseEvent.h.

◆ SetScenePos()

void vtkContextMouseEvent::SetScenePos ( const vtkVector2f pos)
inline

Set/get the position of the mouse in scene coordinates.

Definition at line 100 of file vtkContextMouseEvent.h.

◆ GetScenePos()

vtkVector2f vtkContextMouseEvent::GetScenePos ( ) const
inline

Definition at line 101 of file vtkContextMouseEvent.h.

◆ SetScreenPos()

void vtkContextMouseEvent::SetScreenPos ( const vtkVector2i pos)
inline

Set/get the position of the mouse in screen coordinates.

Definition at line 106 of file vtkContextMouseEvent.h.

◆ GetScreenPos()

vtkVector2i vtkContextMouseEvent::GetScreenPos ( ) const
inline

Definition at line 107 of file vtkContextMouseEvent.h.

◆ SetLastPos()

void vtkContextMouseEvent::SetLastPos ( const vtkVector2f pos)
inline

Set/get the position of the mouse in the item's coordinates.

Definition at line 112 of file vtkContextMouseEvent.h.

◆ GetLastPos()

vtkVector2f vtkContextMouseEvent::GetLastPos ( ) const
inline

Definition at line 113 of file vtkContextMouseEvent.h.

◆ SetLastScenePos()

void vtkContextMouseEvent::SetLastScenePos ( const vtkVector2f pos)
inline

Set/get the position of the mouse in scene coordinates.

Definition at line 118 of file vtkContextMouseEvent.h.

◆ GetLastScenePos()

vtkVector2f vtkContextMouseEvent::GetLastScenePos ( ) const
inline

Definition at line 119 of file vtkContextMouseEvent.h.

◆ SetLastScreenPos()

void vtkContextMouseEvent::SetLastScreenPos ( const vtkVector2i pos)
inline

Set/get the position of the mouse in screen coordinates.

Definition at line 124 of file vtkContextMouseEvent.h.

◆ GetLastScreenPos()

vtkVector2i vtkContextMouseEvent::GetLastScreenPos ( ) const
inline

Definition at line 125 of file vtkContextMouseEvent.h.

◆ SetButton()

void vtkContextMouseEvent::SetButton ( int  button)
inline

Set/get the mouse button that caused the event, with possible values being NO_BUTTON, LEFT_BUTTON, MIDDLE_BUTTON and RIGHT_BUTTON.

Definition at line 131 of file vtkContextMouseEvent.h.

◆ GetButton()

int vtkContextMouseEvent::GetButton ( ) const
inline

Definition at line 132 of file vtkContextMouseEvent.h.

◆ GetModifiers()

int vtkContextMouseEvent::GetModifiers ( ) const

Return the modifier keys, if any, ORed together.

Valid modifier enum values are NO_MODIFIER, ALT_MODIFIER, SHIFT_MODIFIER and/or CONTROL_MODIFIER.

Member Data Documentation

◆ Pos

vtkVector2f vtkContextMouseEvent::Pos
protected

Position of the mouse in item coordinate system.

Definition at line 144 of file vtkContextMouseEvent.h.

◆ ScenePos

vtkVector2f vtkContextMouseEvent::ScenePos
protected

Position of the mouse the scene coordinate system.

Definition at line 149 of file vtkContextMouseEvent.h.

◆ ScreenPos

vtkVector2i vtkContextMouseEvent::ScreenPos
protected

Position of the mouse in screen coordinates.

Definition at line 154 of file vtkContextMouseEvent.h.

◆ LastPos

vtkVector2f vtkContextMouseEvent::LastPos
protected

‘Pos’ at the previous mouse event.

Definition at line 159 of file vtkContextMouseEvent.h.

◆ LastScenePos

vtkVector2f vtkContextMouseEvent::LastScenePos
protected

`ScenePos'at the previous mouse event.

Definition at line 164 of file vtkContextMouseEvent.h.

◆ LastScreenPos

vtkVector2i vtkContextMouseEvent::LastScreenPos
protected

‘ScreenPos’ at the previous mouse event.

Definition at line 169 of file vtkContextMouseEvent.h.

◆ Button

int vtkContextMouseEvent::Button
protected

Mouse button that caused the event, using the anonymous enumeration.

Definition at line 174 of file vtkContextMouseEvent.h.

◆ Interactor

vtkRenderWindowInteractor* vtkContextMouseEvent::Interactor
protected

Definition at line 177 of file vtkContextMouseEvent.h.


The documentation for this class was generated from the following file: