]> Creatis software - cpPlugins.git/blob - lib/cpExtensions/QT/ImageWidget.h
cbf3885699cac00ca0ec0071ab3d8d3fc8b6c476
[cpPlugins.git] / lib / cpExtensions / QT / ImageWidget.h
1 #ifndef __cpExtensions__QT__ImageWidget__h__
2 #define __cpExtensions__QT__ImageWidget__h__
3
4 #include <cpExtensions/QT/RendererWidget.h>
5
6 #ifdef cpExtensions_QT4
7
8 class vtkDataSet;
9
10 namespace cpExtensions
11 {
12   namespace Visualization
13   {
14     class ImageSliceActors;
15     class ImageViewerActors;
16   }
17   namespace Interaction { class ImageSliceStyle; }
18
19   namespace QT
20   {
21     /**
22      */
23     class cpExtensions_EXPORT ImageWidget
24       : public RendererWidget
25     {
26       Q_OBJECT;
27
28     public:
29       typedef ImageWidget    Self;
30       typedef RendererWidget Superclass;
31
32     public:
33       explicit ImageWidget( QWidget* parent = NULL, Qt::WindowFlags f = 0 );
34       virtual ~ImageWidget( );
35
36       vtkInteractorStyle* GetInteractorStyle( );
37       const vtkInteractorStyle* GetInteractorStyle( ) const;
38
39       void SetImage(
40         vtkImageData* image, int orientation, const std::string& name
41         );
42       void Add( vtkDataSet* data, const std::string& name );
43
44       // TODO: std::vector< vtkProp* > GetActors( const std::string& name ) const;
45       int GetOrientation( ) const;
46       void SetSliceNumber( int slice );
47
48       virtual void ResetCamera( ) cpExtensions_OVERRIDE;
49
50       void GetScalarRange( double r[ 2 ] ) const;
51       void GetWindowLevel( double wl[ 2 ] ) const;
52       double GetImageOpacity( ) const;
53       unsigned char GetImageInterpolation( ) const;
54
55       void SetScalarRange( double r[ 2 ] );
56       void SetWindowLevel( double wl[ 2 ] );
57       void SetImageOpacity( double o );
58       void SetImageInterpolation( unsigned char i );
59
60     protected:
61       vtkSmartPointer< cpExtensions::Visualization::ImageViewerActors >
62         m_ImageViewerActors;
63       vtkSmartPointer< cpExtensions::Interaction::ImageSliceStyle >
64         m_ImageSliceStyle;
65       std::string m_ImageName;
66     };
67
68   } // ecapseman
69
70 } // ecapseman
71
72 #endif // cpExtensions_QT4
73
74 #endif // __cpExtensions__QT__ImageWidget__h__
75
76 // eof - $RCSfile$