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();
55 //---------------------------------------------------------------------------
56 void vtkInteractorStyleBaseView2D::OnRightButtonUp() // virtual
58 vtkInteractorStyleBaseView::OnRightButtonUp();
59 this->vtkInteractorStyleImage::OnRightButtonUp();
61 //---------------------------------------------------------------------------
62 void vtkInteractorStyleBaseView2D::OnMouseMove () // virtual
64 vtkInteractorStyleBaseView::OnMouseMove();
65 this->vtkInteractorStyleImage::OnMouseMove();
67 //---------------------------------------------------------------------------
68 void vtkInteractorStyleBaseView2D::OnLeftButtonDown() // virtual
70 vtkInteractorStyleBaseView::OnLeftButtonDown();
72 if ((GetInteractor()->GetControlKey()==0) && (GetInteractor()->GetShiftKey()==1) )
74 this->vtkInteractorStyleImage::OnLeftButtonDown();
77 //---------------------------------------------------------------------------
78 void vtkInteractorStyleBaseView2D::OnLeftButtonUp () // virtual
80 vtkInteractorStyleBaseView::OnLeftButtonUp();
82 this->vtkInteractorStyleImage::OnLeftButtonUp();
84 //---------------------------------------------------------------------------
85 void vtkInteractorStyleBaseView2D::OnMiddleButtonDown () // virtual
87 vtkInteractorStyleBaseView::OnMiddleButtonDown();
89 if ((GetInteractor()->GetControlKey()==1) || (GetInteractor()->GetShiftKey()==1) )
91 this->vtkInteractorStyleImage::OnLeftButtonDown();
94 //---------------------------------------------------------------------------
95 void vtkInteractorStyleBaseView2D::OnMiddleButtonUp () // virtual
97 vtkInteractorStyleBaseView::OnMiddleButtonUp();
99 if ((GetInteractor()->GetControlKey()==1) || (GetInteractor()->GetShiftKey()==1) )
101 this->vtkInteractorStyleImage::OnLeftButtonUp();