1 // File: ViewerTest_EventManager.cxx
2 // Created: Thu Aug 27 14:20:19 1998
3 // Author: Robert COUBLANC
4 // <rob@robox.paris1.matra-dtv.fr>
7 #include <ViewerTest_EventManager.ixx>
8 #include <AIS_InteractiveContext.hxx>
9 #include <NIS_View.hxx>
11 //=======================================================================
12 //function : ViewerTest_EventManager
14 //=======================================================================
16 ViewerTest_EventManager::ViewerTest_EventManager
17 (const Handle(V3d_View)& aView,
18 const Handle(AIS_InteractiveContext)& Ctx)
25 //=======================================================================
28 //=======================================================================
30 void ViewerTest_EventManager::MoveTo(const Standard_Integer XPix,
31 const Standard_Integer YPix)
33 if(!myCtx.IsNull() && !myView.IsNull())
34 myCtx->MoveTo(XPix,YPix,myView);
37 const Handle(NIS_View) aView = Handle(NIS_View)::DownCast(myView);
39 aView->DynamicHilight (XPix, YPix);
42 //=======================================================================
45 //=======================================================================
47 void ViewerTest_EventManager::Select(const Standard_Integer XPMin,
48 const Standard_Integer YPMin,
49 const Standard_Integer XPMax,
50 const Standard_Integer YPMax)
52 #define IS_FULL_INCLUSION Standard_True
53 if(!myCtx.IsNull() && !myView.IsNull())
54 myCtx->Select(XPMin,YPMin,XPMax,YPMax,myView);
55 const Handle(NIS_View) aView = Handle(NIS_View)::DownCast(myView);
57 aView->Select(XPMin,YPMin,XPMax,YPMax, Standard_False, IS_FULL_INCLUSION);
60 //=======================================================================
61 //function : ShiftSelect
63 //=======================================================================
65 void ViewerTest_EventManager::ShiftSelect(const Standard_Integer XPMin,
66 const Standard_Integer YPMin,
67 const Standard_Integer XPMax,
68 const Standard_Integer YPMax)
70 if(!myCtx.IsNull() && !myView.IsNull())
71 myCtx->AIS_InteractiveContext::ShiftSelect(XPMin,YPMin,XPMax,YPMax,myView,
73 const Handle(NIS_View) aView = Handle(NIS_View)::DownCast(myView);
75 aView->Select(XPMin,YPMin,XPMax,YPMax, Standard_True, IS_FULL_INCLUSION);
78 //=======================================================================
81 //=======================================================================
83 void ViewerTest_EventManager::Select()
85 if (!myCtx.IsNull() && !myView.IsNull())
87 const Handle(NIS_View) aView = Handle(NIS_View)::DownCast(myView);
89 aView->Select(myX, myY);
92 //=======================================================================
93 //function : ShiftSelect
95 //=======================================================================
97 void ViewerTest_EventManager::ShiftSelect()
99 if(!myCtx.IsNull() && !myView.IsNull())
100 myCtx->ShiftSelect(Standard_True);
101 const Handle(NIS_View) aView = Handle(NIS_View)::DownCast(myView);
103 aView->Select(myX, myY, Standard_True);