3 #include "vtkInteractorStyleBaseView2D.h"
4 #include <vtkObjectFactory.h>
6 vtkStandardNewMacro(vtkInteractorStyleBaseView2D);
8 //---------------------------------------------------------------------------
9 vtkInteractorStyleBaseView2D::vtkInteractorStyleBaseView2D()
12 // RaC 04-2010 This mechanism of adding new functionalities has to be made externally in order
13 // to maintain a plugin architecture.
14 // Remember: The manualInteractorWindowLevel changes the window level over the image
15 // The vtkInteractorScrollZ changes the slice with right click interaction
16 // This vtkInteractorStyleBaseView2D gives the minimal interaction with a 2D scene
18 // _manualinteractorwindowlevel= new manualInteractorWindowLevel();
19 // AddInteractorStyleMaracas( _manualinteractorwindowlevel );
21 // _vtkInteractorScrollZ = new vtkInteractorScrollZ();
22 // AddInteractorStyleMaracas(_vtkInteractorScrollZ);
25 //---------------------------------------------------------------------------
26 vtkInteractorStyleBaseView2D::~vtkInteractorStyleBaseView2D()
30 //---------------------------------------------------------------------------
31 void vtkInteractorStyleBaseView2D::SetInteractorScrollZ(vtkInteractorScrollZ* interactorScroll)
33 _vtkInteractorScrollZ = interactorScroll;
34 AddInteractorStyleMaracas(_vtkInteractorScrollZ);
37 //---------------------------------------------------------------------------
38 void vtkInteractorStyleBaseView2D::SetInteractorWindowLevel(manualInteractorWindowLevel* interactorWindowLevel)
40 _manualinteractorwindowlevel = interactorWindowLevel;
41 AddInteractorStyleMaracas(_manualinteractorwindowlevel);
44 //---------------------------------------------------------------------------
45 void vtkInteractorStyleBaseView2D::OnRightButtonDown() // virtual
47 vtkInteractorStyleBaseView::OnRightButtonDown();
49 if ((GetInteractor()->GetControlKey()==1) && (GetInteractor()->GetShiftKey()==0) ){
50 this->vtkInteractorStyleImage::OnRightButtonDown();
54 //---------------------------------------------------------------------------
55 void vtkInteractorStyleBaseView2D::OnRightButtonUp() // virtual
57 vtkInteractorStyleBaseView::OnRightButtonUp();
58 this->vtkInteractorStyleImage::OnRightButtonUp();
60 //---------------------------------------------------------------------------
61 void vtkInteractorStyleBaseView2D::OnMouseMove () // virtual
63 vtkInteractorStyleBaseView::OnMouseMove();
64 this->vtkInteractorStyleImage::OnMouseMove();
66 //---------------------------------------------------------------------------
67 void vtkInteractorStyleBaseView2D::OnLeftButtonDown() // virtual
69 vtkInteractorStyleBaseView::OnLeftButtonDown();
71 if ((GetInteractor()->GetControlKey()==0) && (GetInteractor()->GetShiftKey()==1) )
73 this->vtkInteractorStyleImage::OnLeftButtonDown();
76 //---------------------------------------------------------------------------
77 void vtkInteractorStyleBaseView2D::OnLeftButtonUp () // virtual
79 vtkInteractorStyleBaseView::OnLeftButtonUp();
81 this->vtkInteractorStyleImage::OnLeftButtonUp();
83 //---------------------------------------------------------------------------
84 void vtkInteractorStyleBaseView2D::OnMiddleButtonDown () // virtual
86 vtkInteractorStyleBaseView::OnMiddleButtonDown();
88 if ((GetInteractor()->GetControlKey()==1) || (GetInteractor()->GetShiftKey()==1) )
90 this->vtkInteractorStyleImage::OnLeftButtonDown();
93 //---------------------------------------------------------------------------
94 void vtkInteractorStyleBaseView2D::OnMiddleButtonUp () // virtual
96 vtkInteractorStyleBaseView::OnMiddleButtonUp();
98 if ((GetInteractor()->GetControlKey()==1) || (GetInteractor()->GetShiftKey()==1) )
100 this->vtkInteractorStyleImage::OnLeftButtonUp();
104 //---------------------------------------------------------------------------
105 void vtkInteractorStyleBaseView2D::OnMouseWheelForward () // virtual
107 vtkInteractorStyleBaseView::OnMouseWheelForward();
108 if ((GetInteractor()->GetControlKey()==0) || (GetInteractor()->GetShiftKey()==0) )
110 this->vtkInteractorStyleImage::OnMouseWheelForward();
114 //---------------------------------------------------------------------------
115 void vtkInteractorStyleBaseView2D::OnMouseWheelBackward () // virtual
117 vtkInteractorStyleBaseView::OnMouseWheelBackward();
118 if ((GetInteractor()->GetControlKey()==0) || (GetInteractor()->GetShiftKey()==0) )
120 this->vtkInteractorStyleImage::OnMouseWheelBackward();