0022627: Change OCCT memory management defaults
[occt.git] / src / Viewer2dTest / Viewer2dTest_EventManager.cxx
1 // File:        Viewer2dTest_EventManager.cxx
2
3 #include <Viewer2dTest_EventManager.ixx>
4 #include <AIS2D_InteractiveContext.hxx>
5
6 Viewer2dTest_EventManager::Viewer2dTest_EventManager (const Handle(AIS2D_InteractiveContext)& Ctx)
7      : myCtx(Ctx)
8 {
9 }
10
11 const Handle(AIS2D_InteractiveContext)& Viewer2dTest_EventManager::Context() const
12 {
13   return myCtx;
14 }
15
16 void Viewer2dTest_EventManager::MoveTo(const Standard_Integer XPix, 
17                                        const Standard_Integer YPix, 
18                                        const Handle(V2d_View)& aView)
19 {
20   if (!myCtx.IsNull())
21     myCtx->MoveTo(XPix,YPix,aView);
22 }
23
24 void Viewer2dTest_EventManager::Select(const Standard_Integer  /*XPMin*/,
25                                        const Standard_Integer  /*YPMin*/,
26                                        const Standard_Integer  /*XPMax*/,
27                                        const Standard_Integer  /*YPMax*/, 
28                                        const Handle(V2d_View)& /*aView*/)
29 {
30   cout << "Selection by rectangle is not yet implemented" << endl;
31 //  if (!myCtx.IsNull())
32 //    myCtx->Select(XPMin,YPMin,XPMax,YPMax,aView);
33 }
34
35 void Viewer2dTest_EventManager::ShiftSelect(const Standard_Integer  XPMin,
36                                             const Standard_Integer  YPMin,
37                                             const Standard_Integer  XPMax,
38                                             const Standard_Integer  YPMax, 
39                                             const Handle(V2d_View)& aView)
40
41   if (!myCtx.IsNull())
42     myCtx->ShiftSelect(XPMin,YPMin,XPMax,YPMax,aView,Standard_True);
43 }
44
45 void Viewer2dTest_EventManager::Select()
46 {
47   if (!myCtx.IsNull())
48     myCtx->Select();
49 }
50
51 void Viewer2dTest_EventManager::ShiftSelect()
52 {
53   if (!myCtx.IsNull())
54     myCtx->ShiftSelect(Standard_True);
55 }