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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _ViewerTest_EventManager_HeaderFile
18 #define _ViewerTest_EventManager_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Standard_Integer.hxx>
24 #include <MMgt_TShared.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <TColgp_Array1OfPnt2d.hxx>
27 class AIS_InteractiveContext;
31 class ViewerTest_EventManager;
32 DEFINE_STANDARD_HANDLE(ViewerTest_EventManager, MMgt_TShared)
34 //! used to manage mouse event (move,select,shiftselect)
35 //! By default the events are transmitted to interactive context.
36 class ViewerTest_EventManager : public MMgt_TShared
42 Standard_EXPORT ViewerTest_EventManager(const Handle(V3d_View)& aView, const Handle(AIS_InteractiveContext)& aCtx);
44 Standard_EXPORT virtual void MoveTo (const Standard_Integer xpix, const Standard_Integer ypix);
46 Standard_EXPORT virtual void Select();
48 Standard_EXPORT virtual void ShiftSelect();
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);
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);
54 Standard_EXPORT virtual void Select (const TColgp_Array1OfPnt2d& thePolyline);
56 Standard_EXPORT virtual void ShiftSelect (const TColgp_Array1OfPnt2d& thePolyline);
58 const Handle(AIS_InteractiveContext)& Context() const;
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;
67 DEFINE_STANDARD_RTTIEXT(ViewerTest_EventManager,MMgt_TShared)
77 Handle(AIS_InteractiveContext) myCtx;
78 Handle(V3d_View) myView;
86 #include <ViewerTest_EventManager.lxx>
92 #endif // _ViewerTest_EventManager_HeaderFile