0032433: Visualization, TKService - introduce Wasm_Window implementing Aspect_Window...
[occt.git] / src / Aspect / Aspect_WindowInputListener.hxx
index 88e8825..4ca3656 100644 (file)
@@ -15,6 +15,7 @@
 #define _Aspect_WindowInputListener_HeaderFile
 
 #include <Aspect_VKeySet.hxx>
+#include <Aspect_TouchMap.hxx>
 #include <Graphic3d_Vec.hxx>
 #include <Standard.hxx>
 #include <Standard_DefineAlloc.hxx>
@@ -159,6 +160,39 @@ public: //! @name mouse input
   //! Return last mouse position.
   const Graphic3d_Vec2i& LastMousePosition() const { return myMousePositionLast; }
 
+public: //! @name multi-touch input
+
+  //! Return TRUE if touches map is not empty.
+  bool HasTouchPoints() const { return !myTouchPoints.IsEmpty(); }
+
+  //! Return map of active touches.
+  const Aspect_TouchMap& TouchPoints() const { return myTouchPoints; }
+
+  //! Add touch point with the given ID.
+  //! This method is expected to be called from UI thread.
+  //! @param theId touch unique identifier
+  //! @param thePnt touch coordinates
+  //! @param theClearBefore if TRUE previously registered touches will be removed
+  Standard_EXPORT virtual void AddTouchPoint (Standard_Size theId,
+                                              const Graphic3d_Vec2d& thePnt,
+                                              Standard_Boolean theClearBefore = false);
+
+  //! Remove touch point with the given ID.
+  //! This method is expected to be called from UI thread.
+  //! @param theId touch unique identifier
+  //! @param theClearSelectPnts if TRUE will initiate clearing of selection points
+  //! @return TRUE if point has been removed
+  Standard_EXPORT virtual bool RemoveTouchPoint (Standard_Size theId,
+                                                 Standard_Boolean theClearSelectPnts = false);
+
+  //! 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.
+  //! @param theId touch unique identifier
+  //! @param thePnt touch coordinates
+  Standard_EXPORT virtual void UpdateTouchPoint (Standard_Size theId,
+                                                 const Graphic3d_Vec2d& thePnt);
+
 public: //! @name 3d mouse input
 
   //! Return acceleration ratio for translation event; 2.0 by default.
@@ -222,6 +256,10 @@ protected: //! @name mouse input variables
   Aspect_VKeyMouse myMousePressed;      //!< active mouse buttons
   Aspect_VKeyFlags myMouseModifiers;    //!< active key modifiers passed with last mouse event
 
+protected:
+
+  Aspect_TouchMap  myTouchPoints;       //!< map of active touches
+
 protected: //! @name 3d mouse input variables
 
   bool                   my3dMouseButtonState[32];//!< cached button state