Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions
ViewerTest_EventManager Class Reference

used to manage mouse event (move,select) By default the events are transmitted to interactive context. More...

#include <ViewerTest_EventManager.hxx>

Inheritance diagram for ViewerTest_EventManager:
Inheritance graph
[legend]

Public Member Functions

 ViewerTest_EventManager (const occ::handle< V3d_View > &aView, const occ::handle< AIS_InteractiveContext > &aCtx)
 Main constructor.
 
 ~ViewerTest_EventManager () override
 Destructor.
 
const occ::handle< AIS_InteractiveContext > & Context () const
 Return interactive context.
 
bool ToPickPoint () const
 Returns TRUE if picking point mode has been enabled (for VPick command).
 
void StartPickPoint (const char *theArgX, const char *theArgY, const char *theArgZ)
 Start picking point for VPick command.
 
bool UpdateMouseScroll (const Aspect_ScrollDelta &theDelta) override
 Update mouse scroll event.
 
bool UpdateMouseClick (const NCollection_Vec2< int > &thePoint, Aspect_VKeyMouse theButton, Aspect_VKeyFlags theModifiers, bool theIsDoubleClick) override
 Handle mouse button click event.
 
bool UpdateMouseButtons (const NCollection_Vec2< int > &thePoint, Aspect_VKeyMouse theButtons, Aspect_VKeyFlags theModifiers, bool theIsEmulated) override
 Handle mouse button press/release event.
 
void KeyDown (Aspect_VKey theKey, double theTime, double thePressure=1.0) override
 Release key.
 
void KeyUp (Aspect_VKey theKey, double theTime) override
 Release key.
 
void ProcessExpose () override
 Redraw the View on an Expose Event.
 
void handleViewRedraw (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView) override
 Handle redraw.
 
void ProcessConfigure (bool theIsResized=true) override
 Resize View.
 
void ProcessInput () override
 Handle window input event immediately (flush input buffer).
 
void ProcessKeyPress (Aspect_VKey theKey)
 Handle KeyPress event.
 
void OnSubviewChanged (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theOldView, const occ::handle< V3d_View > &theNewView) override
 Callback called on Selection of another (sub)view. This method is expected to be called from rendering thread.
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter.
 
virtual ~Standard_Transient ()=default
 Destructor must be virtual.
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
 
bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
 
bool IsInstance (const char *const theTypeName) const
 Returns a true value if this is an instance of TypeName.
 
bool IsKind (const opencascade::handle< Standard_Type > &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
 
bool IsKind (const char *const theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero.
 
int GetRefCount () const noexcept
 Get the reference counter of this object.
 
void IncrementRefCounter () noexcept
 Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
 
int DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
 
virtual void Delete () const
 Memory deallocator for transient classes.
 
- Public Member Functions inherited from AIS_ViewController
 AIS_ViewController ()
 Empty constructor.
 
 ~AIS_ViewController () override
 Destructor.
 
const AIS_ViewInputBufferInputBuffer (AIS_ViewInputBufferType theType) const
 Return input buffer.
 
AIS_ViewInputBufferChangeInputBuffer (AIS_ViewInputBufferType theType)
 Return input buffer.
 
const occ::handle< AIS_AnimationCamera > & ViewAnimation () const
 Return view animation; empty (but not NULL) animation by default.
 
void SetViewAnimation (const occ::handle< AIS_AnimationCamera > &theAnimation)
 Set view animation to be handled within handleViewRedraw().
 
void AbortViewAnimation ()
 Interrupt active view animation.
 
const occ::handle< AIS_Animation > & ObjectsAnimation () const
 Return objects animation; empty (but not NULL) animation by default.
 
void SetObjectsAnimation (const occ::handle< AIS_Animation > &theAnimation)
 Set object animation to be handled within handleViewRedraw().
 
bool ToPauseObjectsAnimation () const
 Return TRUE if object animation should be paused on mouse click; FALSE by default.
 
void SetPauseObjectsAnimation (bool theToPause)
 Set if object animation should be paused on mouse click.
 
bool IsContinuousRedraw () const
 Return TRUE if continuous redrawing is enabled; FALSE by default. This option would request a next viewer frame to be completely redrawn right after current frame is finished.
 
void SetContinuousRedraw (bool theToEnable)
 Enable or disable continuous updates.
 
AIS_RotationMode RotationMode () const
 Set camera rotation mode.
 
void SetRotationMode (AIS_RotationMode theMode)
 Set camera rotation mode.
 
AIS_NavigationMode NavigationMode () const
 Return camera navigation mode; AIS_NavigationMode_Orbit by default.
 
void SetNavigationMode (AIS_NavigationMode theMode)
 Set camera navigation mode.
 
float MouseAcceleration () const
 Return mouse input acceleration ratio in First Person mode; 1.0 by default.
 
void SetMouseAcceleration (float theRatio)
 Set mouse input acceleration ratio.
 
float OrbitAcceleration () const
 Return orbit rotation acceleration ratio; 1.0 by default.
 
void SetOrbitAcceleration (float theRatio)
 Set orbit rotation acceleration ratio.
 
bool ToShowPanAnchorPoint () const
 Return TRUE if panning anchor point within perspective projection should be displayed in 3D Viewer; TRUE by default.
 
void SetShowPanAnchorPoint (bool theToShow)
 Set if panning anchor point within perspective projection should be displayed in 3D Viewer.
 
bool ToShowRotateCenter () const
 Return TRUE if rotation point should be displayed in 3D Viewer; TRUE by default.
 
void SetShowRotateCenter (bool theToShow)
 Set if rotation point should be displayed in 3D Viewer.
 
bool ToLockOrbitZUp () const
 Return TRUE if camera up orientation within AIS_NavigationMode_Orbit rotation mode should be forced Z up; FALSE by default.
 
void SetLockOrbitZUp (bool theToForceUp)
 Set if camera up orientation within AIS_NavigationMode_Orbit rotation mode should be forced Z up.
 
bool ToAllowTouchZRotation () const
 Return TRUE if z-rotation via two-touches gesture is enabled; FALSE by default.
 
void SetAllowTouchZRotation (bool theToEnable)
 Set if z-rotation via two-touches gesture is enabled.
 
bool ToAllowRotation () const
 Return TRUE if camera rotation is allowed; TRUE by default.
 
void SetAllowRotation (bool theToEnable)
 Set if camera rotation is allowed.
 
bool ToAllowPanning () const
 Return TRUE if panning is allowed; TRUE by default.
 
void SetAllowPanning (bool theToEnable)
 Set if panning is allowed.
 
bool ToAllowZooming () const
 Return TRUE if zooming is allowed; TRUE by default.
 
void SetAllowZooming (bool theToEnable)
 Set if zooming is allowed.
 
bool ToAllowZFocus () const
 Return TRUE if ZFocus change is allowed; TRUE by default.
 
void SetAllowZFocus (bool theToEnable)
 Set if ZFocus change is allowed.
 
bool ToAllowHighlight () const
 Return TRUE if dynamic highlight on mouse move is allowed; TRUE by default.
 
void SetAllowHighlight (bool theToEnable)
 Set if dragging object is allowed.
 
bool ToAllowDragging () const
 Return TRUE if dragging object is allowed; TRUE by default.
 
void SetAllowDragging (bool theToEnable)
 Set if dynamic highlight on mouse move is allowed.
 
bool ToStickToRayOnZoom () const
 Return TRUE if picked point should be projected to picking ray on zooming at point; TRUE by default.
 
void SetStickToRayOnZoom (bool theToEnable)
 Set if picked point should be projected to picking ray on zooming at point.
 
bool ToStickToRayOnRotation () const
 Return TRUE if picked point should be projected to picking ray on rotating around point; TRUE by default.
 
void SetStickToRayOnRotation (bool theToEnable)
 Set if picked point should be projected to picking ray on rotating around point.
 
bool ToInvertPitch () const
 Return TRUE if pitch direction should be inverted while processing Aspect_VKey_NavLookUp/Aspect_VKey_NavLookDown; FALSE by default.
 
void SetInvertPitch (bool theToInvert)
 Set flag inverting pitch direction.
 
float WalkSpeedAbsolute () const
 Return normal walking speed, in m/s; 1.5 by default.
 
void SetWalkSpeedAbsolute (float theSpeed)
 Set normal walking speed, in m/s; 1.5 by default.
 
float WalkSpeedRelative () const
 Return walking speed relative to scene bounding box; 0.1 by default.
 
void SetWalkSpeedRelative (float theFactor)
 Set walking speed relative to scene bounding box.
 
float ThrustSpeed () const
 Return active thrust value; 0.0f by default.
 
void SetThrustSpeed (float theSpeed)
 Set active thrust value.
 
bool HasPreviousMoveTo () const
 Return TRUE if previous position of MoveTo has been defined.
 
const NCollection_Vec2< int > & PreviousMoveTo () const
 Return previous position of MoveTo event in 3D viewer.
 
void ResetPreviousMoveTo ()
 Reset previous position of MoveTo.
 
bool ToDisplayXRAuxDevices () const
 Return TRUE to display auxiliary tracked XR devices (like tracking stations).
 
void SetDisplayXRAuxDevices (bool theToDisplay)
 Set if auxiliary tracked XR devices should be displayed.
 
bool ToDisplayXRHands () const
 Return TRUE to display XR hand controllers.
 
void SetDisplayXRHands (bool theToDisplay)
 Set if tracked XR hand controllers should be displayed.
 
void KeyFromAxis (Aspect_VKey theNegative, Aspect_VKey thePositive, double theTime, double thePressure) override
 Simulate key up/down events from axis value. Default implementation updates internal cache.
 
AIS_WalkDelta FetchNavigationKeys (double theCrouchRatio, double theRunRatio)
 Fetch active navigation actions.
 
Aspect_VKeySetChangeKeys ()
 Return keyboard state.
 
const Aspect_VKeySetKeys () const
 Press key. Default implementation updates internal cache.
 
const NCollection_DataMap< unsigned int, AIS_MouseGesture > & MouseGestureMap () const
 Return map defining mouse gestures.
 
NCollection_DataMap< unsigned int, AIS_MouseGesture > & ChangeMouseGestureMap ()
 Return map defining mouse gestures.
 
const NCollection_DataMap< unsigned int, AIS_SelectionScheme > & MouseSelectionSchemes () const
 Return map defining mouse selection schemes.
 
NCollection_DataMap< unsigned int, AIS_SelectionScheme > & ChangeMouseSelectionSchemes ()
 Return map defining mouse gestures.
 
double MouseDoubleClickInterval () const
 Return double click interval in seconds; 0.4 by default.
 
void SetMouseDoubleClickInterval (double theSeconds)
 Set double click interval in seconds.
 
virtual void SelectInViewer (const NCollection_Vec2< int > &thePnt, const AIS_SelectionScheme theScheme=AIS_SelectionScheme_Replace)
 Perform selection in 3D viewer. This method is expected to be called from UI thread.
 
virtual void SelectInViewer (const NCollection_Sequence< NCollection_Vec2< int > > &thePnts, const AIS_SelectionScheme theScheme=AIS_SelectionScheme_Replace)
 Perform selection in 3D viewer. This method is expected to be called from UI thread.
 
virtual void UpdateRubberBand (const NCollection_Vec2< int > &thePntFrom, const NCollection_Vec2< int > &thePntTo)
 Update rectangle selection tool. This method is expected to be called from UI thread.
 
virtual void UpdatePolySelection (const NCollection_Vec2< int > &thePnt, bool theToAppend)
 Update polygonal selection tool. This method is expected to be called from UI thread.
 
virtual bool UpdateZoom (const Aspect_ScrollDelta &theDelta)
 Update zoom event (e.g. from mouse scroll). This method is expected to be called from UI thread.
 
virtual bool UpdateZRotation (double theAngle)
 Update Z rotation event.
 
bool UpdateMousePosition (const NCollection_Vec2< int > &thePoint, Aspect_VKeyMouse theButtons, Aspect_VKeyFlags theModifiers, bool theIsEmulated) override
 Handle mouse cursor movement event. This method is expected to be called from UI thread.
 
bool PressMouseButton (const NCollection_Vec2< int > &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 NCollection_Vec2< int > &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_VKeyFlags LastMouseFlags () const
 Return active key modifiers passed with last mouse event.
 
const NCollection_Vec2< int > & LastMousePosition () const
 Return last mouse position.
 
Aspect_VKeyMouse PressedMouseButtons () const
 Return currently pressed mouse buttons.
 
float TouchToleranceScale () const
 Set scale factor for adjusting tolerances for starting multi-touch gestures.
 
void SetTouchToleranceScale (float theTolerance)
 Set scale factor for adjusting tolerances for starting multi-touch gestures.
 
void AddTouchPoint (size_t theId, const NCollection_Vec2< double > &thePnt, bool theClearBefore=false) override
 Add touch point with the given ID. This method is expected to be called from UI thread.
 
bool RemoveTouchPoint (size_t theId, bool theClearSelectPnts=false) override
 Remove touch point with the given ID. This method is expected to be called from UI thread.
 
void UpdateTouchPoint (size_t theId, const NCollection_Vec2< double > &thePnt) override
 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.
 
bool HasTouchPoints () const
 Set scale factor for adjusting tolerances for starting multi-touch gestures.
 
bool Update3dMouse (const WNT_HIDSpaceMouse &theEvent) override
 Process 3d mouse input event (redirects to translation, rotation and keys).
 
void ProcessFocus (bool theIsActivated) override
 Handle focus event. Default implementation resets cached input state (pressed keys).
 
void ProcessClose () override
 Handle window close event. Default implementation does nothing.
 
virtual void ResetViewInput ()
 Reset input state (pressed keys, mouse buttons, etc.) e.g. on window focus loss. This method is expected to be called from UI thread.
 
virtual void UpdateViewOrientation (V3d_TypeOfOrientation theOrientation, bool theToFitAll)
 Reset view orientation. This method is expected to be called from UI thread.
 
virtual void FlushViewEvents (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView, bool theToHandle=false)
 Update buffer for rendering thread. This method is expected to be called within synchronization barrier between GUI and Rendering threads (e.g. GUI thread should be locked beforehand to avoid data races).
 
virtual void HandleViewEvents (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView)
 Process events within rendering thread.
 
virtual void OnSelectionChanged (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView)
 Callback called by handleMoveTo() on Selection in 3D Viewer. This method is expected to be called from rendering thread.
 
virtual void OnObjectDragged (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView, AIS_DragAction theAction)
 Callback called by handleMoveTo() on dragging object in 3D Viewer. This method is expected to be called from rendering thread.
 
virtual bool PickPoint (gp_Pnt &thePnt, const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView, const NCollection_Vec2< int > &theCursor, bool theToStickToPickRay)
 Pick closest point under mouse cursor. This method is expected to be called from rendering thread.
 
virtual bool PickAxis (gp_Pnt &theTopPnt, const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView, const gp_Ax1 &theAxis)
 Pick closest point by axis. This method is expected to be called from rendering thread.
 
virtual gp_Pnt GravityPoint (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView)
 Compute rotation gravity center point depending on rotation mode. This method is expected to be called from rendering thread.
 
virtual void FitAllAuto (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView)
 Modify view camera to fit all objects. Default implementation fits either all visible and all selected objects (swapped on each call).
 
virtual void handleViewOrientationKeys (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView)
 Handle hot-keys defining new camera orientation (Aspect_VKey_ViewTop and similar keys). Default implementation starts an animated transaction from the current to the target camera orientation, when specific action key was pressed. This method is expected to be called from rendering thread.
 
virtual AIS_WalkDelta handleNavigationKeys (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView)
 Perform navigation (Aspect_VKey_NavForward and similar keys). This method is expected to be called from rendering thread.
 
virtual void handleCameraActions (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView, const AIS_WalkDelta &theWalk)
 Perform immediate camera actions (rotate/zoom/pan) on gesture progress. This method is expected to be called from rendering thread.
 
virtual void handleMoveTo (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView)
 Perform moveto/selection/dragging. This method is expected to be called from rendering thread.
 
bool toAskNextFrame () const
 Return TRUE if another frame should be drawn right after this one.
 
void setAskNextFrame (bool theToDraw=true)
 Set if another frame should be drawn right after this one.
 
bool hasPanningAnchorPoint () const
 Return if panning anchor point has been defined.
 
const gp_PntpanningAnchorPoint () const
 Return active panning anchor point.
 
void setPanningAnchorPoint (const gp_Pnt &thePnt)
 Set active panning anchor point.
 
virtual void handlePanning (const occ::handle< V3d_View > &theView)
 Handle panning event myGL.Panning.
 
virtual void handleZRotate (const occ::handle< V3d_View > &theView)
 Handle Z rotation event myGL.ZRotate.
 
double MinZoomDistance () const
 Return minimal camera distance for zoom operation.
 
void SetMinZoomDistance (double theDist)
 Set minimal camera distance for zoom operation.
 
virtual void handleZoom (const occ::handle< V3d_View > &theView, const Aspect_ScrollDelta &theParams, const gp_Pnt *thePnt)
 Handle zoom event myGL.ZoomActions. This method is expected to be called from rendering thread.
 
virtual void handleZFocusScroll (const occ::handle< V3d_View > &theView, const Aspect_ScrollDelta &theParams)
 Handle ZScroll event myGL.ZoomActions. This method is expected to be called from rendering thread.
 
virtual void handleOrbitRotation (const occ::handle< V3d_View > &theView, const gp_Pnt &thePnt, bool theToLockZUp)
 Handle orbital rotation events myGL.OrbitRotation.
 
virtual void handleViewRotation (const occ::handle< V3d_View > &theView, double theYawExtra, double thePitchExtra, double theRoll, bool theToRestartOnIncrement)
 Handle view direction rotation events myGL.ViewRotation. This method is expected to be called from rendering thread.
 
virtual void handleXRInput (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView, const AIS_WalkDelta &theWalk)
 Perform XR input. This method is expected to be called from rendering thread.
 
virtual void handleXRTurnPad (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView)
 Handle trackpad view turn action.
 
virtual void handleXRTeleport (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView)
 Handle trackpad teleportation action.
 
virtual void handleXRPicking (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView)
 Handle picking on trigger click.
 
virtual void handleXRHighlight (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView)
 Perform dynamic highlighting for active hand.
 
virtual void handleXRPresentations (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView)
 Display auxiliary XR presentations.
 
virtual int handleXRMoveTo (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView, const gp_Trsf &thePose, const bool theToHighlight)
 Perform picking with/without dynamic highlighting for XR pose.
 
double EventTime () const
 Return event time (e.g. current time).
 
- Public Member Functions inherited from Aspect_WindowInputListener
virtual ~Aspect_WindowInputListener ()
 Destructor.
 
double EventTime () const
 Return event time (e.g. current time).
 
const Aspect_VKeySetKeys () const
 Return keyboard state.
 
Aspect_VKeySetChangeKeys ()
 Return keyboard state.
 
bool PressMouseButton (const NCollection_Vec2< int > &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 NCollection_Vec2< int > &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 NCollection_Vec2< int > & LastMousePosition () const
 Return last mouse position.
 
bool HasTouchPoints () const
 Return map of active touches.
 
const NCollection_IndexedDataMap< size_t, Aspect_Touch > & TouchPoints () const
 Return map of active touches.
 
float Get3dMouseTranslationScale () const
 timer for timestamping events
 
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 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.
 

Static Public Member Functions

static boolToCloseViewOnEscape ()
 Return TRUE if View should be closed on escape.
 
static boolToExitOnCloseView ()
 Return TRUE if Draw Harness should exit on closing View.
 
static const occ::handle< AIS_AnimationCamera > & GlobalViewAnimation ()
 Use global camera animation object shared across all Views in ViewerTest.
 
static void SetupWindowCallbacks (const occ::handle< Aspect_Window > &theWin)
 Setup or adjust window callbacks.
 
- Static Public Member Functions inherited from Standard_Transient
static constexpr const charget_type_name ()
 Returns a type descriptor about this object.
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class.
 

Protected Member Functions

void addActionHotKeys (Aspect_VKey theAction, unsigned int theHotKey1=0, unsigned int theHotKey2=0, unsigned int theHotKey3=0, unsigned int theHotKey4=0, unsigned int theHotKey5=0)
 Register hot-keys for specified Action.
 
bool navigationKeyModifierSwitch (unsigned int theModifOld, unsigned int theModifNew, double theTimeStamp)
 Handle modifier key changes.
 
- Protected Member Functions inherited from AIS_ViewController
virtual void flushBuffers (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView)
 Flush buffers.
 
virtual void flushGestures (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView)
 Flush touch gestures.
 
void updateEventsTime (double &thePrevTime, double &theCurrTime)
 Return current and previously fetched event times. This callback is intended to compute delta between sequentially processed events.
 
virtual void handleSelectionPick (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView)
 Perform selection via mouse click. This method is expected to be called from rendering thread.
 
virtual void handleDynamicHighlight (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView)
 Perform dynamic highlight on mouse move. This method is expected to be called from rendering thread.
 
virtual void handleSelectionPoly (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView)
 Perform rubber-band selection. This method is expected to be called from rendering thread.
 
virtual void contextLazyMoveTo (const occ::handle< AIS_InteractiveContext > &theCtx, const occ::handle< V3d_View > &theView, const NCollection_Vec2< int > &thePnt)
 Lazy AIS_InteractiveContext::MoveTo() with myPrevMoveTo check.
 
- Protected Member Functions inherited from Aspect_WindowInputListener
 Aspect_WindowInputListener ()
 Empty constructor.
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 
- Protected Attributes inherited from AIS_ViewController
NCollection_Array1< occ::handle< AIS_XRTrackedDevice > > myXRPrsDevices
 array of XR tracked devices presentations
 
Quantity_Color myXRLaserTeleColor
 color of teleport laser
 
Quantity_Color myXRLaserPickColor
 color of picking laser
 
Aspect_XRTrackedDeviceRole myXRLastTeleportHand
 active hand for teleport
 
Aspect_XRTrackedDeviceRole myXRLastPickingHand
 active hand for picking objects
 
Aspect_XRHapticActionData myXRTeleportHaptic
 vibration on picking teleport destination
 
Aspect_XRHapticActionData myXRPickingHaptic
 vibration on dynamic highlighting
 
Aspect_XRHapticActionData myXRSelectHaptic
 vibration on selection
 
double myXRLastPickDepthLeft
 last picking depth for left hand
 
double myXRLastPickDepthRight
 last picking depth for right hand
 
double myXRTurnAngle
 discrete turn angle for XR trackpad
 
bool myToDisplayXRAuxDevices
 flag to display auxiliary tracked XR devices
 
bool myToDisplayXRHands
 flag to display XR hands
 
double myMouseClickThreshold
 mouse click threshold in pixels; 3 by default
 
double myMouseDoubleClickInt
 double click interval in seconds; 0.4 by default
 
float myScrollZoomRatio
 distance ratio for mapping mouse scroll event to zoom; 15.0 by default
 
NCollection_DataMap< unsigned int, AIS_MouseGesturemyMouseGestureMap
 map defining mouse gestures
 
NCollection_DataMap< unsigned int, AIS_MouseGesturemyMouseGestureMapDrag
 secondary map defining mouse gestures for dragging
 
AIS_MouseGesture myMouseActiveGesture
 initiated mouse gesture (by pressing mouse button)
 
NCollection_DataMap< unsigned int, AIS_SelectionSchememyMouseSelectionSchemes
 map defining selection schemes bound to mouse + modifiers
 
bool myMouseActiveIdleRotation
 flag indicating view idle rotation state
 
NCollection_Vec2< intmyMousePressPoint
 mouse position where active gesture was been initiated
 
NCollection_Vec2< intmyMouseProgressPoint
 gesture progress
 
OSD_Timer myMouseClickTimer
 timer for handling double-click event
 
int myMouseClickCounter
 counter for handling double-click event
 
int myMouseSingleButton
 index of mouse button pressed alone (>0)
 
bool myMouseStopDragOnUnclick
 queue stop dragging even with at next mouse unclick
 
float myTouchToleranceScale
 tolerance scale factor; 1.0 by default
 
float myTouchClickThresholdPx
 touch click threshold in pixels; 3 by default
 
float myTouchRotationThresholdPx
 threshold for starting one-touch rotation gesture in pixels; 6 by default
 
float myTouchZRotationThreshold
 threshold for starting two-touch Z-rotation gesture in radians; 2 degrees by default
 
float myTouchPanThresholdPx
 threshold for starting two-touch panning gesture in pixels; 4 by default
 
float myTouchZoomThresholdPx
 threshold for starting two-touch zoom (pitch) gesture in pixels; 6 by default
 
float myTouchZoomRatio
 distance ratio for mapping two-touch zoom (pitch) gesture from pixels to zoom; 0.13 by default
 
float myTouchDraggingThresholdPx
 distance for starting one-touch dragging gesture in pixels; 6 by default
 
Aspect_Touch myTouchClick
 single touch position for handling clicks
 
OSD_Timer myTouchDoubleTapTimer
 timer for handling double tap
 
NCollection_Vec2< doublemyStartPanCoord
 touch coordinates at the moment of starting panning gesture
 
NCollection_Vec2< doublemyStartRotCoord
 touch coordinates at the moment of starting rotating gesture
 
int myNbTouchesLast
 number of touches within previous gesture flush to track gesture changes
 
bool myUpdateStartPointPan
 flag indicating that new anchor point should be picked for starting panning gesture
 
bool myUpdateStartPointRot
 flag indicating that new gravity point should be picked for starting rotation gesture
 
bool myUpdateStartPointZRot
 flag indicating that new gravity point should be picked for starting Z-rotation gesture
 
occ::handle< AIS_PointmyAnchorPointPrs1
 anchor point presentation (Graphic3d_ZLayerId_Top)
 
occ::handle< AIS_PointmyAnchorPointPrs2
 anchor point presentation (Graphic3d_ZLayerId_Topmost)
 
gp_Pnt myPanPnt3d
 active panning anchor point
 
gp_Pnt myRotatePnt3d
 active rotation center of gravity
 
gp_Dir myCamStartOpUp
 camera Up direction at the beginning of rotation
 
gp_Dir myCamStartOpDir
 camera View direction at the beginning of rotation
 
gp_Pnt myCamStartOpEye
 camera Eye position at the beginning of rotation
 
gp_Pnt myCamStartOpCenter
 camera Center position at the beginning of rotation
 
gp_Vec myCamStartOpToCenter
 vector from rotation gravity point to camera Center at the beginning of rotation
 
gp_Vec myCamStartOpToEye
 vector from rotation gravity point to camera Eye at the beginning of rotation
 
double myCurrentRollAngle
 current roll angle for instantaneous roll
 
AIS_ViewInputBuffer myUI
 buffer for UI thread
 
AIS_ViewInputBuffer myGL
 buffer for rendering thread
 
double myLastEventsTime
 last fetched events timer value for computing delta/progress
 
bool myToAskNextFrame
 flag indicating that another frame should be drawn right after this one
 
bool myIsContinuousRedraw
 continuous redrawing (without immediate rendering optimization)
 
double myMinCamDistance
 minimal camera distance for zoom operation
 
AIS_RotationMode myRotationMode
 rotation mode
 
AIS_NavigationMode myNavigationMode
 navigation mode (orbit rotation / first person)
 
float myMouseAccel
 mouse input acceleration ratio in First Person mode
 
float myOrbitAccel
 Orbit rotation acceleration ratio.
 
bool myToShowPanAnchorPoint
 option displaying panning anchor point
 
bool myToShowRotateCenter
 option displaying rotation center point
 
bool myToLockOrbitZUp
 force camera up orientation within AIS_NavigationMode_Orbit rotation mode
 
bool myToInvertPitch
 flag inverting pitch direction while processing Aspect_VKey_NavLookUp/Aspect_VKey_NavLookDown
 
bool myToAllowTouchZRotation
 enable z-rotation two-touches gesture; FALSE by default
 
bool myToAllowRotation
 enable rotation; TRUE by default
 
bool myToAllowPanning
 enable panning; TRUE by default
 
bool myToAllowZooming
 enable zooming; TRUE by default
 
bool myToAllowZFocus
 enable ZFocus change; TRUE by default
 
bool myToAllowHighlight
 enable dynamic highlight on mouse move; TRUE by default
 
bool myToAllowDragging
 enable dragging object; TRUE by default
 
bool myToStickToRayOnZoom
 project picked point to ray while zooming at point, TRUE by default
 
bool myToStickToRayOnRotation
 project picked point to ray while rotating around point; TRUE by default
 
float myWalkSpeedAbsolute
 normal walking speed, in m/s; 1.5 by default
 
float myWalkSpeedRelative
 walking speed relative to scene bounding box; 0.1 by default
 
float myThrustSpeed
 active thrust value
 
bool myHasThrust
 flag indicating active thrust
 
occ::handle< AIS_AnimationCameramyViewAnimation
 view animation
 
occ::handle< AIS_AnimationmyObjAnimation
 objects animation
 
bool myToPauseObjAnimation
 flag to pause objects animation on mouse click; FALSE by default
 
occ::handle< AIS_RubberBandmyRubberBand
 Rubber-band presentation.
 
occ::handle< SelectMgr_EntityOwnermyDragOwner
 detected owner of currently dragged object
 
occ::handle< AIS_InteractiveObjectmyDragObject
 currently dragged object
 
NCollection_Vec2< intmyPrevMoveTo
 previous position of MoveTo event in 3D viewer
 
bool myHasHlrOnBeforeRotation
 flag for restoring Computed mode after rotation
 
- Protected Attributes inherited from Aspect_WindowInputListener
Aspect_VKeySet myKeys
 keyboard state
 
NCollection_Vec2< intmyMousePositionLast
 last mouse position
 
Aspect_VKeyMouse myMousePressed
 active mouse buttons
 
Aspect_VKeyFlags myMouseModifiers
 active key modifiers passed with last mouse event
 
NCollection_IndexedDataMap< size_t, Aspect_TouchmyTouchPoints
 map of active touches
 
bool my3dMouseButtonState [32]
 cached button state
 
NCollection_Vec3< boolmy3dMouseNoRotate
 ignore 3d mouse rotation axes
 
NCollection_Vec3< boolmy3dMouseToReverse
 reverse 3d mouse rotation axes
 
float my3dMouseAccelTrans
 acceleration ratio for translation event
 
float my3dMouseAccelRotate
 acceleration ratio for rotation event
 
bool my3dMouseIsQuadric
 quadric acceleration
 
OSD_Timer myEventTimer
 timer for timestamping events
 

Detailed Description

used to manage mouse event (move,select) By default the events are transmitted to interactive context.

Constructor & Destructor Documentation

◆ ViewerTest_EventManager()

ViewerTest_EventManager::ViewerTest_EventManager ( const occ::handle< V3d_View > & aView,
const occ::handle< AIS_InteractiveContext > & aCtx )

Main constructor.

◆ ~ViewerTest_EventManager()

ViewerTest_EventManager::~ViewerTest_EventManager ( )
override

Destructor.

Member Function Documentation

◆ addActionHotKeys()

void ViewerTest_EventManager::addActionHotKeys ( Aspect_VKey theAction,
unsigned int theHotKey1 = 0,
unsigned int theHotKey2 = 0,
unsigned int theHotKey3 = 0,
unsigned int theHotKey4 = 0,
unsigned int theHotKey5 = 0 )
inlineprotected

Register hot-keys for specified Action.

◆ Context()

const occ::handle< AIS_InteractiveContext > & ViewerTest_EventManager::Context ( ) const
inline

Return interactive context.

◆ GlobalViewAnimation()

static const occ::handle< AIS_AnimationCamera > & ViewerTest_EventManager::GlobalViewAnimation ( )
static

Use global camera animation object shared across all Views in ViewerTest.

◆ handleViewRedraw()

void ViewerTest_EventManager::handleViewRedraw ( const occ::handle< AIS_InteractiveContext > & theCtx,
const occ::handle< V3d_View > & theView )
overridevirtual

Handle redraw.

Reimplemented from AIS_ViewController.

◆ KeyDown()

void ViewerTest_EventManager::KeyDown ( Aspect_VKey theKey,
double theTime,
double thePressure = 1.0 )
overridevirtual

Release key.

Reimplemented from AIS_ViewController.

◆ KeyUp()

void ViewerTest_EventManager::KeyUp ( Aspect_VKey theKey,
double theTime )
overridevirtual

Release key.

Reimplemented from AIS_ViewController.

◆ navigationKeyModifierSwitch()

bool ViewerTest_EventManager::navigationKeyModifierSwitch ( unsigned int theModifOld,
unsigned int theModifNew,
double theTimeStamp )
protected

Handle modifier key changes.

◆ OnSubviewChanged()

void ViewerTest_EventManager::OnSubviewChanged ( const occ::handle< AIS_InteractiveContext > & theCtx,
const occ::handle< V3d_View > & theOldView,
const occ::handle< V3d_View > & theNewView )
overridevirtual

Callback called on Selection of another (sub)view. This method is expected to be called from rendering thread.

Reimplemented from AIS_ViewController.

◆ ProcessConfigure()

void ViewerTest_EventManager::ProcessConfigure ( bool theIsResized = true)
overridevirtual

Resize View.

Reimplemented from AIS_ViewController.

◆ ProcessExpose()

void ViewerTest_EventManager::ProcessExpose ( )
overridevirtual

Redraw the View on an Expose Event.

Reimplemented from AIS_ViewController.

◆ ProcessInput()

void ViewerTest_EventManager::ProcessInput ( )
overridevirtual

Handle window input event immediately (flush input buffer).

Reimplemented from AIS_ViewController.

◆ ProcessKeyPress()

void ViewerTest_EventManager::ProcessKeyPress ( Aspect_VKey theKey)

Handle KeyPress event.

◆ SetupWindowCallbacks()

static void ViewerTest_EventManager::SetupWindowCallbacks ( const occ::handle< Aspect_Window > & theWin)
static

Setup or adjust window callbacks.

◆ StartPickPoint()

void ViewerTest_EventManager::StartPickPoint ( const char * theArgX,
const char * theArgY,
const char * theArgZ )
inline

Start picking point for VPick command.

◆ ToCloseViewOnEscape()

static bool & ViewerTest_EventManager::ToCloseViewOnEscape ( )
inlinestatic

Return TRUE if View should be closed on escape.

◆ ToExitOnCloseView()

static bool & ViewerTest_EventManager::ToExitOnCloseView ( )
inlinestatic

Return TRUE if Draw Harness should exit on closing View.

◆ ToPickPoint()

bool ViewerTest_EventManager::ToPickPoint ( ) const
inline

Returns TRUE if picking point mode has been enabled (for VPick command).

◆ UpdateMouseButtons()

bool ViewerTest_EventManager::UpdateMouseButtons ( const NCollection_Vec2< int > & thePoint,
Aspect_VKeyMouse theButtons,
Aspect_VKeyFlags theModifiers,
bool theIsEmulated )
overridevirtual

Handle mouse button press/release event.

Reimplemented from AIS_ViewController.

◆ UpdateMouseClick()

bool ViewerTest_EventManager::UpdateMouseClick ( const NCollection_Vec2< int > & thePoint,
Aspect_VKeyMouse theButton,
Aspect_VKeyFlags theModifiers,
bool theIsDoubleClick )
overridevirtual

Handle mouse button click event.

Reimplemented from AIS_ViewController.

◆ UpdateMouseScroll()

bool ViewerTest_EventManager::UpdateMouseScroll ( const Aspect_ScrollDelta & theDelta)
overridevirtual

Update mouse scroll event.

Reimplemented from AIS_ViewController.


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