1 // Copyright (c) 2016-2019 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
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.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #ifndef _Aspect_Touch_HeaderFile
15 #define _Aspect_Touch_HeaderFile
17 #include <NCollection_Vec2.hxx>
18 #include <Standard_Boolean.hxx>
19 #include <Standard_Real.hxx>
21 //! Structure holding touch position - original and current location.
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)
30 //! Return values delta.
31 NCollection_Vec2<Standard_Real> Delta() const { return To - From; }
35 : From (0.0, 0.0), To (0.0, 0.0), IsPreciseDevice (false) {}
37 //! Constructor with initialization.
38 Aspect_Touch (const NCollection_Vec2<Standard_Real>& thePnt,
39 Standard_Boolean theIsPreciseDevice)
40 : From (thePnt), To (thePnt), IsPreciseDevice (theIsPreciseDevice) {}
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) {}
49 #endif // _Aspect_Touch_HeaderFile