SMILX  1.01
vtkInteractorStyleImage2.cxx
1 /*=========================================================================
2  The Software is copyright (c) Commonwealth Scientific and Industrial Research Organisation (CSIRO)
3  ABN 41 687 119 230.
4  All rights reserved.
5 
6  Licensed under the CSIRO BSD 3-Clause License
7  You may not use this file except in compliance with the License.
8  You may obtain a copy of the License in the file LICENSE.md or at
9 
10  https://stash.csiro.au/projects/SMILI/repos/smili/browse/license.txt
11 
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  See the License for the specific language governing permissions and
16  limitations under the License.
17 =========================================================================*/
18 #include "vtkInteractorStyleImage2.h"
19 
20 #include <vtkRenderWindowInteractor.h>
21 
22 //ImageViewer
23 vtkStandardNewMacro(vtkInteractorStyleImage2);
24 
25 void vtkInteractorStyleImage2::PrintSelf(ostream& os, vtkIndent indent)
26 {
27  this->Superclass::PrintSelf(os, indent);
28 }
29 
30 void vtkInteractorStyleImage2::OnMouseWheelForward()
31 {
32  if(this->Interactor->GetShiftKey())
33  {
34  this->Superclass::OnMouseWheelForward();
35  }
36  else
37  {
38  if(!viewer)
39  return;
40 
41  if(viewer->GetSlice()+1 <= viewer->GetSliceMax())
42  {
43  viewer->SetSlice(viewer->GetSlice()+1);
44  }
45 
46  this->StartState(VTKIS_NONE);
47  }
48 }
49 
50 void vtkInteractorStyleImage2::OnMouseWheelBackward()
51 {
52  if(this->Interactor->GetShiftKey())
53  {
54  this->Superclass::OnMouseWheelBackward();
55  }
56  else
57  {
58  if(!viewer)
59  return;
60 
61  if (viewer->GetSlice()-1 >= viewer->GetSliceMin())
62  {
63  viewer->SetSlice(viewer->GetSlice()-1);
64  }
65 
66  this->StartState(VTKIS_NONE);
67  }
68 }
69 
70 //~ void vtkInteractorStyleImage2::SetInteractionModeToImageSlicing()
71 //~ {
72 
73 //~ }