0029076: Visualization - implement element shrinking Shader
[occt.git] / src / ViewerTest / ViewerTest_EventManager.hxx
1 // Created on: 1998-08-27
2 // Created by: Robert COUBLANC
3 // Copyright (c) 1998-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _ViewerTest_EventManager_HeaderFile
18 #define _ViewerTest_EventManager_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <Standard_Integer.hxx>
24 #include <Standard_Transient.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <TColgp_Array1OfPnt2d.hxx>
27 class AIS_InteractiveContext;
28 class V3d_View;
29
30
31 class ViewerTest_EventManager;
32 DEFINE_STANDARD_HANDLE(ViewerTest_EventManager, Standard_Transient)
33
34 //! used to manage mouse event (move,select,shiftselect)
35 //! By default the events are transmitted to interactive context.
36 class ViewerTest_EventManager : public Standard_Transient
37 {
38
39 public:
40
41   
42   Standard_EXPORT ViewerTest_EventManager(const Handle(V3d_View)& aView, const Handle(AIS_InteractiveContext)& aCtx);
43   
44   Standard_EXPORT virtual void MoveTo (const Standard_Integer xpix, const Standard_Integer ypix);
45   
46   Standard_EXPORT virtual void Select();
47   
48   Standard_EXPORT virtual void ShiftSelect();
49   
50   Standard_EXPORT virtual void Select (const Standard_Integer theXPressed, const Standard_Integer theYPressed, const Standard_Integer theXMotion, const Standard_Integer theYMotion, const Standard_Boolean theIsAutoAllowOverlap = Standard_True);
51   
52   Standard_EXPORT virtual void ShiftSelect (const Standard_Integer theXPressed, const Standard_Integer theYPressed, const Standard_Integer theXMotion, const Standard_Integer theYMotion, const Standard_Boolean theIsAutoAllowOverlap = Standard_True);
53   
54   Standard_EXPORT virtual void Select (const TColgp_Array1OfPnt2d& thePolyline);
55   
56   Standard_EXPORT virtual void ShiftSelect (const TColgp_Array1OfPnt2d& thePolyline);
57   
58     const Handle(AIS_InteractiveContext)& Context() const;
59   
60   //! Gets current mouse position. It tracks change of mouse position
61   //! with mouse drugging or with DRAW command call (vmoveto).
62   Standard_EXPORT void GetCurrentPosition (Standard_Integer& theXPix, Standard_Integer& theYPix) const;
63
64
65
66
67   DEFINE_STANDARD_RTTIEXT(ViewerTest_EventManager,Standard_Transient)
68
69 protected:
70
71
72
73
74 private:
75
76
77   Handle(AIS_InteractiveContext) myCtx;
78   Handle(V3d_View) myView;
79   Standard_Integer myX;
80   Standard_Integer myY;
81
82
83 };
84
85
86 #include <ViewerTest_EventManager.lxx>
87
88
89
90
91
92 #endif // _ViewerTest_EventManager_HeaderFile