Open CASCADE Technology 7.8.0
|
Defines a listener for window input events. More...
#include <Aspect_WindowInputListener.hxx>
Public Member Functions | |
virtual | ~Aspect_WindowInputListener () |
DEFINE_STANDARD_ALLOC. | |
double | EventTime () const |
Return event time (e.g. current time). | |
virtual void | ProcessExpose ()=0 |
Handle expose event (window content has been invalidation and should be redrawn). | |
virtual void | ProcessConfigure (bool theIsResized)=0 |
Handle window resize event. | |
virtual void | ProcessInput ()=0 |
Handle window input event immediately (flush input buffer or ignore). | |
virtual void | ProcessFocus (bool theIsActivated)=0 |
Handle focus event. | |
virtual void | ProcessClose ()=0 |
Handle window close event. | |
keyboard input | |
const Aspect_VKeySet & | Keys () const |
Return keyboard state. | |
Aspect_VKeySet & | ChangeKeys () |
Return keyboard state. | |
virtual void | KeyDown (Aspect_VKey theKey, double theTime, double thePressure=1.0)=0 |
Press key. Default implementation updates internal cache. | |
virtual void | KeyUp (Aspect_VKey theKey, double theTime)=0 |
Release key. Default implementation updates internal cache. | |
virtual void | KeyFromAxis (Aspect_VKey theNegative, Aspect_VKey thePositive, double theTime, double thePressure)=0 |
Simulate key up/down events from axis value. Default implementation updates internal cache. | |
mouse input | |
virtual bool | UpdateMouseScroll (const Aspect_ScrollDelta &theDelta)=0 |
Update mouse scroll event. This method is expected to be called from UI thread. | |
virtual bool | UpdateMouseButtons (const Graphic3d_Vec2i &thePoint, Aspect_VKeyMouse theButtons, Aspect_VKeyFlags theModifiers, bool theIsEmulated)=0 |
Handle mouse button press/release event. This method is expected to be called from UI thread. | |
virtual bool | UpdateMousePosition (const Graphic3d_Vec2i &thePoint, Aspect_VKeyMouse theButtons, Aspect_VKeyFlags theModifiers, bool theIsEmulated)=0 |
Handle mouse cursor movement event. This method is expected to be called from UI thread. Default implementation does nothing. | |
bool | PressMouseButton (const Graphic3d_Vec2i &thePoint, Aspect_VKeyMouse theButton, Aspect_VKeyFlags theModifiers, bool theIsEmulated) |
Handle mouse button press event. This method is expected to be called from UI thread. Default implementation redirects to UpdateMousePosition(). | |
bool | ReleaseMouseButton (const Graphic3d_Vec2i &thePoint, Aspect_VKeyMouse theButton, Aspect_VKeyFlags theModifiers, bool theIsEmulated) |
Handle mouse button release event. This method is expected to be called from UI thread. Default implementation redirects to UpdateMousePosition(). | |
Aspect_VKeyMouse | PressedMouseButtons () const |
Return currently pressed mouse buttons. | |
Aspect_VKeyFlags | LastMouseFlags () const |
Return active key modifiers passed with last mouse event. | |
const Graphic3d_Vec2i & | LastMousePosition () const |
Return last mouse position. | |
multi-touch input | |
bool | HasTouchPoints () const |
Return TRUE if touches map is not empty. | |
const Aspect_TouchMap & | TouchPoints () const |
Return map of active touches. | |
virtual void | AddTouchPoint (Standard_Size theId, const Graphic3d_Vec2d &thePnt, Standard_Boolean theClearBefore=false) |
Add touch point with the given ID. This method is expected to be called from UI thread. | |
virtual bool | RemoveTouchPoint (Standard_Size theId, Standard_Boolean theClearSelectPnts=false) |
Remove touch point with the given ID. This method is expected to be called from UI thread. | |
virtual void | UpdateTouchPoint (Standard_Size theId, const Graphic3d_Vec2d &thePnt) |
Update touch point with the given ID. If point with specified ID was not registered before, it will be added. This method is expected to be called from UI thread. | |
Protected Attributes | |
keyboard input variables | |
Aspect_VKeySet | myKeys |
keyboard state | |
mouse input variables | |
Graphic3d_Vec2i | myMousePositionLast |
last mouse position | |
Aspect_VKeyMouse | myMousePressed |
active mouse buttons | |
Aspect_VKeyFlags | myMouseModifiers |
active key modifiers passed with last mouse event | |
Aspect_TouchMap | myTouchPoints |
map of active touches | |
3d mouse input variables | |
bool | my3dMouseButtonState [32] |
cached button state | |
NCollection_Vec3< bool > | my3dMouseNoRotate |
ignore 3d mouse rotation axes | |
NCollection_Vec3< bool > | my3dMouseToReverse |
reverse 3d mouse rotation axes | |
float | my3dMouseAccelTrans |
acceleration ratio for translation event | |
float | my3dMouseAccelRotate |
acceleration ratio for rotation event | |
bool | my3dMouseIsQuadric |
quadric acceleration | |
3d mouse input | |
OSD_Timer | myEventTimer |
timer for timestamping events | |
float | Get3dMouseTranslationScale () const |
Return acceleration ratio for translation event; 2.0 by default. | |
void | Set3dMouseTranslationScale (float theScale) |
Set acceleration ratio for translation event. | |
float | Get3dMouseRotationScale () const |
Return acceleration ratio for rotation event; 4.0 by default. | |
void | Set3dMouseRotationScale (float theScale) |
Set acceleration ratio for rotation event. | |
bool | To3dMousePreciseInput () const |
Return quadric acceleration flag; TRUE by default. | |
void | Set3dMousePreciseInput (bool theIsQuadric) |
Set quadric acceleration flag. | |
const NCollection_Vec3< bool > & | Get3dMouseIsNoRotate () const |
Return 3d mouse rotation axes (tilt/roll/spin) ignore flag; (FALSE, FALSE, FALSE) by default. | |
NCollection_Vec3< bool > & | Change3dMouseIsNoRotate () |
Return 3d mouse rotation axes (tilt/roll/spin) ignore flag; (FALSE, FALSE, FALSE) by default. | |
const NCollection_Vec3< bool > & | Get3dMouseToReverse () const |
Return 3d mouse rotation axes (tilt/roll/spin) reverse flag; (TRUE, FALSE, FALSE) by default. | |
NCollection_Vec3< bool > & | Change3dMouseToReverse () |
Return 3d mouse rotation axes (tilt/roll/spin) reverse flag; (TRUE, FALSE, FALSE) by default. | |
virtual bool | Update3dMouse (const WNT_HIDSpaceMouse &theEvent)=0 |
Process 3d mouse input event (redirects to translation, rotation and keys). | |
virtual bool | update3dMouseTranslation (const WNT_HIDSpaceMouse &theEvent) |
Process 3d mouse input translation event. | |
virtual bool | update3dMouseRotation (const WNT_HIDSpaceMouse &theEvent) |
Process 3d mouse input rotation event. | |
virtual bool | update3dMouseKeys (const WNT_HIDSpaceMouse &theEvent) |
Process 3d mouse input keys event. | |
Aspect_WindowInputListener () | |
Empty constructor. | |
Defines a listener for window input events.
|
virtual |
DEFINE_STANDARD_ALLOC.
Destructor.
|
protected |
Empty constructor.
|
virtual |
Add touch point with the given ID. This method is expected to be called from UI thread.
theId | touch unique identifier |
thePnt | touch coordinates |
theClearBefore | if TRUE previously registered touches will be removed |
Reimplemented in AIS_ViewController.
|
inline |
Return 3d mouse rotation axes (tilt/roll/spin) ignore flag; (FALSE, FALSE, FALSE) by default.
|
inline |
Return 3d mouse rotation axes (tilt/roll/spin) reverse flag; (TRUE, FALSE, FALSE) by default.
|
inline |
Return keyboard state.
|
inline |
Return event time (e.g. current time).
|
inline |
Return 3d mouse rotation axes (tilt/roll/spin) ignore flag; (FALSE, FALSE, FALSE) by default.
|
inline |
Return acceleration ratio for rotation event; 4.0 by default.
|
inline |
Return 3d mouse rotation axes (tilt/roll/spin) reverse flag; (TRUE, FALSE, FALSE) by default.
|
inline |
Return acceleration ratio for translation event; 2.0 by default.
|
inline |
Return TRUE if touches map is not empty.
|
pure virtual |
Press key. Default implementation updates internal cache.
theKey | key pressed |
theTime | event timestamp |
Implemented in AIS_ViewController, and ViewerTest_EventManager.
|
pure virtual |
Simulate key up/down events from axis value. Default implementation updates internal cache.
Implemented in AIS_ViewController.
|
inline |
Return keyboard state.
|
pure virtual |
Release key. Default implementation updates internal cache.
theKey | key pressed |
theTime | event timestamp |
Implemented in AIS_ViewController, and ViewerTest_EventManager.
|
inline |
Return active key modifiers passed with last mouse event.
|
inline |
Return last mouse position.
|
inline |
Return currently pressed mouse buttons.
|
inline |
Handle mouse button press event. This method is expected to be called from UI thread. Default implementation redirects to UpdateMousePosition().
thePoint | mouse cursor position |
theButton | pressed button |
theModifiers | key modifiers |
theIsEmulated | if TRUE then mouse event comes NOT from real mouse but emulated from non-precise input like touch on screen |
|
pure virtual |
Handle window close event.
Implemented in AIS_ViewController.
Handle window resize event.
Implemented in AIS_ViewController, and ViewerTest_EventManager.
|
pure virtual |
Handle expose event (window content has been invalidation and should be redrawn).
Implemented in AIS_ViewController, and ViewerTest_EventManager.
Handle focus event.
Implemented in AIS_ViewController.
|
pure virtual |
Handle window input event immediately (flush input buffer or ignore).
Implemented in AIS_ViewController, and ViewerTest_EventManager.
|
inline |
Handle mouse button release event. This method is expected to be called from UI thread. Default implementation redirects to UpdateMousePosition().
thePoint | mouse cursor position |
theButton | released button |
theModifiers | key modifiers |
theIsEmulated | if TRUE then mouse event comes NOT from real mouse but emulated from non-precise input like touch on screen |
|
virtual |
Remove touch point with the given ID. This method is expected to be called from UI thread.
theId | touch unique identifier |
theClearSelectPnts | if TRUE will initiate clearing of selection points |
Reimplemented in AIS_ViewController.
|
inline |
Set quadric acceleration flag.
|
inline |
Set acceleration ratio for rotation event.
|
inline |
Set acceleration ratio for translation event.
|
inline |
Return quadric acceleration flag; TRUE by default.
|
inline |
Return map of active touches.
|
pure virtual |
Process 3d mouse input event (redirects to translation, rotation and keys).
Implemented in AIS_ViewController.
|
virtual |
Process 3d mouse input keys event.
|
virtual |
Process 3d mouse input rotation event.
|
virtual |
Process 3d mouse input translation event.
|
pure virtual |
Handle mouse button press/release event. This method is expected to be called from UI thread.
thePoint | mouse cursor position |
theButtons | pressed buttons |
theModifiers | key modifiers |
theIsEmulated | if TRUE then mouse event comes NOT from real mouse but emulated from non-precise input like touch on screen |
Implemented in AIS_ViewController, and ViewerTest_EventManager.
|
pure virtual |
Handle mouse cursor movement event. This method is expected to be called from UI thread. Default implementation does nothing.
thePoint | mouse cursor position |
theButtons | pressed buttons |
theModifiers | key modifiers |
theIsEmulated | if TRUE then mouse event comes NOT from real mouse but emulated from non-precise input like touch on screen |
Implemented in AIS_ViewController.
|
pure virtual |
Update mouse scroll event. This method is expected to be called from UI thread.
theDelta | mouse cursor position and delta |
Implemented in AIS_ViewController, and ViewerTest_EventManager.
|
virtual |
Update touch point with the given ID. If point with specified ID was not registered before, it will be added. This method is expected to be called from UI thread.
theId | touch unique identifier |
thePnt | touch coordinates |
Reimplemented in AIS_ViewController.
|
protected |
acceleration ratio for rotation event
|
protected |
acceleration ratio for translation event
|
protected |
cached button state
|
protected |
quadric acceleration
|
protected |
ignore 3d mouse rotation axes
|
protected |
reverse 3d mouse rotation axes
|
protected |
timer for timestamping events
|
protected |
keyboard state
|
protected |
active key modifiers passed with last mouse event
|
protected |
last mouse position
|
protected |
active mouse buttons
|
protected |
map of active touches