]> Creatis software - clitk.git/blob - vv/vvToolCropImage.h
Debug RTStruct conversion with empty struc
[clitk.git] / vv / vvToolCropImage.h
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to: 
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
8
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.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18 #ifndef VVTOOLCROPIMAGE_H
19 #define VVTOOLCROPIMAGE_H
20
21 //qt
22 #include <QtGlobal>
23 #if QT_VERSION >= 0x050000
24 #include <QtUiPlugin/QDesignerExportWidget>
25 #else
26 #include <QtDesigner/QDesignerExportWidget>
27 #endif
28 #include <QDialog>
29 #include <QSlider>
30 // vv
31 #include "vvToolBase.h"
32 #include "vvToolWidgetBase.h"
33 #include "vvMainWindowBase.h"
34 #include "ui_vvToolCropImage.h"
35 //vtk
36 #include <vtkTransform.h>
37
38 //------------------------------------------------------------------------------
39 class vvToolCropImage:
40   public vvToolWidgetBase,
41   public vvToolBase<vvToolCropImage>, 
42   private Ui::vvToolCropImage 
43 {
44   Q_OBJECT
45     public:
46   vvToolCropImage(vvMainWindowBase * parent=0, Qt::WindowFlags f=0);
47   ~vvToolCropImage();
48
49   virtual void InputIsSelected(vvSlicerManager *m);
50
51 public slots:
52   virtual void apply();
53   virtual bool close();
54   virtual void reject();
55   void autoCropValueChanged(double v);
56   void sliderValueChanged(int id);
57
58
59   //-----------------------------------------------------
60   static void Initialize() {
61     SetToolName("Crop");
62     SetToolMenuName("Crop");
63     SetToolIconFilename(":/common/icons/crop.png");
64     SetToolTip("Crop image.");
65   }
66
67  protected:
68   Ui::vvToolCropImage ui;
69   int * mReducedExtent;
70   int * mInitialExtent;
71   int mExtentSize;
72   void UpdateExtent();
73   virtual void closeEvent(QCloseEvent *event);
74
75   std::vector<QSlider*> mSliders;
76   vtkSmartPointer<vtkMatrix4x4> mConcatenedTransform;
77 }; // end class vvToolCropImage
78 //------------------------------------------------------------------------------
79
80 #endif
81