summaryrefslogtreecommitdiff
path: root/src/Viewer2dTest/Viewer2dTest_EventManager.cxx
blob: 5524f46b5a9b7566149dc01201abdb61517f35ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// File:	Viewer2dTest_EventManager.cxx

#include <Viewer2dTest_EventManager.ixx>
#include <AIS2D_InteractiveContext.hxx>

Viewer2dTest_EventManager::Viewer2dTest_EventManager (const Handle(AIS2D_InteractiveContext)& Ctx)
     : myCtx(Ctx)
{
}

const Handle(AIS2D_InteractiveContext)& Viewer2dTest_EventManager::Context() const
{
  return myCtx;
}

void Viewer2dTest_EventManager::MoveTo(const Standard_Integer XPix, 
                                       const Standard_Integer YPix, 
                                       const Handle(V2d_View)& aView)
{
  if (!myCtx.IsNull())
    myCtx->MoveTo(XPix,YPix,aView);
}

void Viewer2dTest_EventManager::Select(const Standard_Integer  /*XPMin*/,
                                       const Standard_Integer  /*YPMin*/,
                                       const Standard_Integer  /*XPMax*/,
                                       const Standard_Integer  /*YPMax*/, 
                                       const Handle(V2d_View)& /*aView*/)
{
  cout << "Selection by rectangle is not yet implemented" << endl;
//  if (!myCtx.IsNull())
//    myCtx->Select(XPMin,YPMin,XPMax,YPMax,aView);
}

void Viewer2dTest_EventManager::ShiftSelect(const Standard_Integer  XPMin,
                                            const Standard_Integer  YPMin,
                                            const Standard_Integer  XPMax,
                                            const Standard_Integer  YPMax, 
                                            const Handle(V2d_View)& aView)
{ 
  if (!myCtx.IsNull())
    myCtx->ShiftSelect(XPMin,YPMin,XPMax,YPMax,aView,Standard_True);
}

void Viewer2dTest_EventManager::Select()
{
  if (!myCtx.IsNull())
    myCtx->Select();
}

void Viewer2dTest_EventManager::ShiftSelect()
{
  if (!myCtx.IsNull())
    myCtx->ShiftSelect(Standard_True);
}