1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
5 - University of LYON http://www.universite-lyon.fr/
6 - Léon Bérard cancer center http://www.centreleonberard.fr
7 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the copyright notices for more information.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18 #include "vvToolHistogramCommand.h"
19 #include "vvSlicerManager.h"
21 #include <vtkTextProperty.h>
22 #include <vtkRenderer.h>
23 #include <vtkImageActor.h>
24 #include <vtkRenderWindowInteractor.h>
25 #include <vtkPropPicker.h>
26 #include <vtkCamera.h>
27 #include <vtkImageMapToWindowLevelColors.h>
28 #include <vtkLookupTable.h>
30 #include <vtkAbstractPropPicker.h>
31 #include <vtkAssemblyPath.h>
32 #include <vtkCornerAnnotation.h>
33 #include <vtkRenderWindow.h>
35 #include <vtkImageReslice.h>
37 #include "vvInteractorStyleNavigator.h"
38 #include "vtkTransform.h"
41 //------------------------------------------------------------------------------
42 vvToolHistogramCommand::vvToolHistogramCommand()
46 //------------------------------------------------------------------------------
51 //------------------------------------------------------------------------------
52 void vvToolHistogramCommand::Execute(vtkObject *caller,
54 void *vtkNotUsed(callData))
56 if (event == vtkCommand::MouseWheelForwardEvent) {
57 mHist->expandWindow();
59 if (event == vtkCommand::MouseWheelBackwardEvent) {
60 mHist->reduceWindow();
62 if (event == vtkCommand::LeftButtonPressEvent) {
63 mFollowMouse = !mFollowMouse;
65 if (event == vtkCommand::MouseMoveEvent) {
67 vtkSmartPointer<vtkRenderWindowInteractor> interactor = mHist->GetHistogramWidget()->GetRenderWindow()->GetInteractor();
68 if (interactor->GetEventPosition()[0] != interactor->GetLastEventPosition()[0])
69 mHist->translateWindow(interactor->GetEventPosition()[0] - interactor->GetLastEventPosition()[0]);
73 //------------------------------------------------------------------------------