0032433: Visualization, TKService - introduce Wasm_Window implementing Aspect_Window...
[occt.git] / src / Aspect / Aspect_Touch.hxx
1 // Copyright (c) 2016-2019 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14 #ifndef _Aspect_Touch_HeaderFile
15 #define _Aspect_Touch_HeaderFile
16
17 #include <NCollection_Vec2.hxx>
18 #include <Standard_Boolean.hxx>
19 #include <Standard_Real.hxx>
20
21 //! Structure holding touch position - original and current location.
22 class Aspect_Touch
23 {
24 public:
25
26   NCollection_Vec2<Standard_Real> From;            //!< original touch position
27   NCollection_Vec2<Standard_Real> To;              //!< current  touch position
28   Standard_Boolean                IsPreciseDevice; //!< precise device input (e.g. mouse cursor, NOT emulated from touch screen)
29
30   //! Return values delta.
31   NCollection_Vec2<Standard_Real> Delta() const { return To - From; }
32
33   //! Empty constructor
34   Aspect_Touch()
35   : From (0.0, 0.0), To (0.0, 0.0), IsPreciseDevice (false) {}
36
37   //! Constructor with initialization.
38   Aspect_Touch (const NCollection_Vec2<Standard_Real>& thePnt,
39                 Standard_Boolean theIsPreciseDevice)
40   : From (thePnt), To (thePnt), IsPreciseDevice (theIsPreciseDevice) {}
41
42   //! Constructor with initialization.
43   Aspect_Touch (Standard_Real theX, Standard_Real theY,
44                 Standard_Boolean theIsPreciseDevice)
45   : From (theX, theY), To (theX, theY), IsPreciseDevice (theIsPreciseDevice) {}
46
47 };
48
49 #endif // _Aspect_Touch_HeaderFile