]> Creatis software - cpPlugins.git/blob - ParametersQtDialog.h
40b85141fd91efcf12233129ea62c5bc0d374ce7
[cpPlugins.git] / ParametersQtDialog.h
1 #ifndef __CPPLUGINS__INTERFACE__PARAMETERSQTDIALOG__H__
2 #define __CPPLUGINS__INTERFACE__PARAMETERSQTDIALOG__H__
3
4 #include <cpPlugins/Interface/Config.h>
5
6 #ifdef cpPlugins_Interface_QT4
7
8 #include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
9 #include <cpPlugins/Interface/Parameters.h>
10
11 #include <set>
12
13 #include <vtkInteractorObserver.h>
14 #include <vtkSmartPointer.h>
15
16 #include <QDialog>
17 #include <QDialogButtonBox>
18 #include <QGridLayout>
19 #include <QLabel>
20 #include <QVBoxLayout>
21
22 class vtkRenderWindowInteractor;
23
24 namespace cpPlugins
25 {
26   namespace Interface
27   {
28     /**
29      */
30     class cpPlugins_Interface_EXPORT ParametersQtDialog
31       : public QDialog
32     {
33       Q_OBJECT;
34
35     public:
36       typedef std::set< vtkRenderWindowInteractor* > TInteractors;
37       typedef
38         std::map< std::string, vtkSmartPointer< vtkInteractorObserver > >
39         TWidgets;
40
41     public:
42       ParametersQtDialog( QWidget* parent = 0, Qt::WindowFlags f = 0 );
43       virtual ~ParametersQtDialog( );
44
45       Parameters* getParameters( ) const;
46       void addInteractor( vtkRenderWindowInteractor* interactor );
47       TInteractors& getInteractors( );
48       const TInteractors& getInteractors( ) const;
49       bool isInteractive( ) const;
50       void setInteractive( bool i );
51       void interactiveOn( );
52       void interactiveOff( );
53       bool setParameters( Parameters* parameters );
54
55       virtual int exec( );
56       virtual void show( );
57
58       void updateParameters( );
59       void updateView( );
60
61     protected slots:
62       void _dlg_OpenSingleFile( );
63       void _dlg_SaveSingleFile( );
64       void _dlg_OpenSinglePath( );
65       void _dlg_OpenMultipleFiles( );
66       void _dlg_AddInt( );
67       void _dlg_AddUint( );
68       void _dlg_AddReal( );
69
70     protected:
71       Parameters* m_Parameters;
72       QLabel* m_Title;
73       QGridLayout* m_MainLayout;
74       QVBoxLayout* m_ToolsLayout;
75       QDialogButtonBox* m_Buttons;
76
77       TInteractors m_Interactors;
78       TWidgets m_Widgets;
79       bool m_Interactive;
80     };
81
82   } // ecapseman
83
84 } // ecapseman
85
86 #endif // cpPlugins_Interface_QT4
87
88 #endif // __CPPLUGINS__INTERFACE__PARAMETERSQTDIALOG__H__
89
90 // eof - $RCSfile$