]> Creatis software - cpPlugins.git/blob - lib/cpExtensions/QT/SimpleMPRWidget.h
Architecture updated.
[cpPlugins.git] / lib / cpExtensions / QT / SimpleMPRWidget.h
1 #ifndef __cpExtensions__QT__SimpleMPRWidget__h__
2 #define __cpExtensions__QT__SimpleMPRWidget__h__
3
4 #include <cpExtensions/Config.h>
5
6 #ifdef cpExtensions_QT4
7
8 // TODO: #include <cpExtensions/Visualization/MeshActor.h>
9 #include <QWidget>
10 #include <vtkSmartPointer.h>
11 #include <map>
12 #include <set>
13
14 // -------------------------------------------------------------------------
15 class vtkDataSet;
16 class vtkProp;
17 class vtkPropCollection;
18
19 namespace Ui { class SimpleMPRWidget; }
20
21 // -------------------------------------------------------------------------
22 namespace cpExtensions
23 {
24   namespace QT
25   {
26     class MPR3DWidget;
27     class ImageWidget;
28
29     /**
30      */
31     class cpExtensions_EXPORT SimpleMPRWidget
32       : public QWidget
33     {
34       Q_OBJECT;
35
36     public:
37       typedef SimpleMPRWidget Self;
38       typedef QWidget         Superclass;
39
40       typedef vtkSmartPointer< vtkPropCollection > TProp;
41       typedef std::set< TProp >                    TProps;
42
43       // typedef cpExtensions::Visualization::MeshActor TMeshActor;
44
45     public:
46       explicit SimpleMPRWidget( QWidget* parent = NULL, Qt::WindowFlags f = 0 );
47       virtual ~SimpleMPRWidget( );
48
49       void Configure( char q1, char q2, char q3, char q4 );
50
51       bool HasImage( ) const;
52       void SetImage( vtkImageData* image, const std::string& name );
53
54       bool Add( vtkDataSet* data, const std::string& name );
55
56       TProps GetViewProps( const std::string& name ) const;
57       TProps GetImageProps( ) const;
58
59       vtkRenderWindowInteractor* GetXInteractor( );
60       const vtkRenderWindowInteractor* GetXInteractor( ) const;
61       vtkRenderWindowInteractor* GetYInteractor( );
62       const vtkRenderWindowInteractor* GetYInteractor( ) const;
63       vtkRenderWindowInteractor* GetZInteractor( );
64       const vtkRenderWindowInteractor* GetZInteractor( ) const;
65       vtkRenderWindowInteractor* GetWInteractor( );
66       const vtkRenderWindowInteractor* GetWInteractor( ) const;
67
68       vtkRenderWindow* GetXRenderWindow( );
69       const vtkRenderWindow* GetXRenderWindow( ) const;
70       vtkRenderWindow* GetYRenderWindow( );
71       const vtkRenderWindow* GetYRenderWindow( ) const;
72       vtkRenderWindow* GetZRenderWindow( );
73       const vtkRenderWindow* GetZRenderWindow( ) const;
74       vtkRenderWindow* GetWRenderWindow( );
75       const vtkRenderWindow* GetWRenderWindow( ) const;
76
77       void GetScalarRange( double r[ 2 ] ) const;
78       void GetWindowLevel( double wl[ 2 ] ) const;
79       double GetImageOpacity( ) const;
80       unsigned char GetImageInterpolation( ) const;
81
82       void SetScalarRange( double r[ 2 ] );
83       void SetWindowLevel( double wl[ 2 ] );
84       void SetImageOpacity( double o );
85       void SetImageInterpolation( unsigned char i );
86
87       /* TODO
88          std::vector< vtkProp* > GetActors( const std::string& name ) const;
89       */
90
91       void ResetCameras( );
92       void Render( );
93
94     private slots:
95       void _SyncBottom( int a, int b );
96       void _SyncTop( int a, int b );
97       void _ConfigurationButton( );
98
99     protected:
100       Ui::SimpleMPRWidget* m_UI;
101
102       ImageWidget* m_XImage;
103       ImageWidget* m_YImage;
104       ImageWidget* m_ZImage;
105       MPR3DWidget* m_3DView;
106
107       std::string m_MainImageName;
108       vtkSmartPointer< vtkImageData > m_MainImage;
109     };
110
111   } // ecapseman
112
113 } // ecapseman
114
115 #endif // cpExtensions_QT4
116
117 #endif // __cpExtensions__QT__SimpleMPRWidget__h__
118
119 // eof - $RCSfile$