Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:02:58

0001 // Copyright (c) 2019 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef _Aspect_ScrollDelta_HeaderFile
0015 #define _Aspect_ScrollDelta_HeaderFile
0016 
0017 #include <Aspect_VKeyFlags.hxx>
0018 #include <NCollection_Vec2.hxx>
0019 
0020 //! Parameters for mouse scroll action.
0021 struct Aspect_ScrollDelta
0022 {
0023 
0024   NCollection_Vec2<int> Point; //!< scale position
0025   Standard_Real         Delta; //!< delta in pixels
0026   Aspect_VKeyFlags      Flags; //!< key flags
0027 
0028   //! Return true if action has point defined.
0029   bool HasPoint() const
0030   {
0031     return Point.x() >= 0
0032         && Point.y() >= 0;
0033   }
0034 
0035   //! Reset at point.
0036   void ResetPoint()
0037   {
0038     Point.SetValues (-1, -1);
0039   }
0040 
0041   //! Empty constructor.
0042   Aspect_ScrollDelta()
0043   : Point (-1, -1), Delta (0.0), Flags (Aspect_VKeyFlags_NONE) {}
0044 
0045   //! Constructor.
0046   Aspect_ScrollDelta (const NCollection_Vec2<int>& thePnt,
0047                       Standard_Real theValue,
0048                       Aspect_VKeyFlags theFlags = Aspect_VKeyFlags_NONE)
0049   : Point (thePnt), Delta (theValue), Flags (theFlags) {}
0050 
0051   //! Constructor with undefined point.
0052   Aspect_ScrollDelta (Standard_Real theValue,
0053                       Aspect_VKeyFlags theFlags = Aspect_VKeyFlags_NONE)
0054   : Point (-1, -1), Delta (theValue), Flags (theFlags) {}
0055 
0056 };
0057 
0058 #endif // _Aspect_ScrollDelta_HeaderFile