]> Creatis software - clitk.git/blob - vv/vvToolInputSelectorWidget.h
Ensure the compilation with Qt4 and Qt5
[clitk.git] / vv / vvToolInputSelectorWidget.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 VVTOOLINPUTSELECTORWIDGET_H
19 #define VVTOOLINPUTSELECTORWIDGET_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
29 // vv
30 #include "ui_vvToolInputSelectorWidget.h"
31
32 class vvSlicerManager;
33 class vvToolSimpleInputSelectorWidget;
34
35 //------------------------------------------------------------------------------
36 class vvToolInputSelectorWidget: public QWidget, private Ui::vvToolInputSelectorWidget 
37 {
38   Q_OBJECT
39     public:
40   vvToolInputSelectorWidget(QWidget * parent=0, Qt::WindowFlags f=0);
41   ~vvToolInputSelectorWidget() {}
42   
43   void AddInputSelector(QString & s, const std::vector<vvSlicerManager*> & l, int index, bool allowSkip=false);  
44   void Initialize();
45   std::vector<vvSlicerManager*> & GetSelectedInputs();
46   void AnImageIsBeingClosed(vvSlicerManager * m);
47   int GetNumberOfInput();
48
49  public slots:
50   void accept(); // to change ! in something like acceptOneMoreInput
51   void reject();
52   void skip();
53
54  signals:
55   void accepted();
56   void rejected();
57
58  protected:
59   void AddInputSelector(vvToolSimpleInputSelectorWidget * input, 
60                         std::vector<vvSlicerManager*> l, int index);
61   Ui::vvToolInputSelectorWidget ui;
62   std::vector<vvSlicerManager*> mSlicerManagerList;
63   int mCurrentIndex;
64   vvSlicerManager * mCurrentSliceManager;
65   int mNumberOfAcceptedInputs;
66   std::vector<vvToolSimpleInputSelectorWidget *> mListOfSimpleInputWidget;
67   std::vector<bool> mSkipInput;
68 }; // end class vvToolInputSelectorWidget
69 //------------------------------------------------------------------------------
70
71 #endif
72