Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/Aspect_ScrollDelta.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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   double                Delta; //!< delta in pixels
0026   Aspect_VKeyFlags      Flags; //!< key flags
0027 
0028   //! Return true if action has point defined.
0029   bool HasPoint() const { return Point.x() >= 0 && Point.y() >= 0; }
0030 
0031   //! Reset at point.
0032   void ResetPoint() { Point.SetValues(-1, -1); }
0033 
0034   //! Empty constructor.
0035   Aspect_ScrollDelta()
0036       : Point(-1, -1),
0037         Delta(0.0),
0038         Flags(Aspect_VKeyFlags_NONE)
0039   {
0040   }
0041 
0042   //! Constructor.
0043   Aspect_ScrollDelta(const NCollection_Vec2<int>& thePnt,
0044                      double                       theValue,
0045                      Aspect_VKeyFlags             theFlags = Aspect_VKeyFlags_NONE)
0046       : Point(thePnt),
0047         Delta(theValue),
0048         Flags(theFlags)
0049   {
0050   }
0051 
0052   //! Constructor with undefined point.
0053   Aspect_ScrollDelta(double theValue, Aspect_VKeyFlags theFlags = Aspect_VKeyFlags_NONE)
0054       : Point(-1, -1),
0055         Delta(theValue),
0056         Flags(theFlags)
0057   {
0058   }
0059 };
0060 
0061 #endif // _Aspect_ScrollDelta_HeaderFile