]> Creatis software - clitk.git/blob - vv/vvToolCropImage.h
Merge branch 'VTK6_Qt5' into VTK6_Qt5_LineProfile
[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 #if QT_VERSION < 0x050000
23 #include <QtDesigner/QDesignerExportWidget>
24 #else
25 #include <QtUiPlugin/QDesignerExportWidget>
26 #endif
27 #include <QDialog>
28 #include <QSlider>
29 // vv
30 #include "vvToolBase.h"
31 #include "vvToolWidgetBase.h"
32 #include "vvMainWindowBase.h"
33 #include "ui_vvToolCropImage.h"
34
35 //------------------------------------------------------------------------------
36 class vvToolCropImage:
37   public vvToolWidgetBase,
38   public vvToolBase<vvToolCropImage>, 
39   private Ui::vvToolCropImage 
40 {
41   Q_OBJECT
42     public:
43   vvToolCropImage(vvMainWindowBase * parent=0, Qt::WindowFlags f=0);
44   ~vvToolCropImage();
45
46   virtual void InputIsSelected(vvSlicerManager *m);
47
48 public slots:
49   virtual void apply();
50   virtual bool close();
51   virtual void reject();
52   void autoCropValueChanged(double v);
53   void sliderValueChanged(int id);
54
55
56   //-----------------------------------------------------
57   static void Initialize() {
58     SetToolName("Crop");
59     SetToolMenuName("Crop");
60     SetToolIconFilename(":/common/icons/crop.png");
61     SetToolTip("Crop image.");
62   }
63
64  protected:
65   Ui::vvToolCropImage ui;
66   int * mReducedExtent;
67   int * mInitialExtent;
68   int mExtentSize;
69   void UpdateExtent();
70   virtual void closeEvent(QCloseEvent *event);
71
72   std::vector<QSlider*> mSliders;
73 }; // end class vvToolCropImage
74 //------------------------------------------------------------------------------
75
76 #endif
77