]> Creatis software - cpPlugins.git/blob - lib/cpExtensions/QT/ImageWidget.h
c27855768d3ca8af6c8b339e5380909ae26559ae
[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 // TODO: class vtkDataSet;
9
10 namespace cpExtensions
11 {
12   namespace Visualization
13   {
14     class OutlineSource;
15     class WindowLevelImageActor;
16     class MeshActor;
17     /* TODO
18        class ImageSliceActors;
19        class ImageViewerActors;
20     */
21   }
22   namespace Interaction { class ImageSliceStyle; }
23
24   namespace QT
25   {
26     /**
27      */
28     class cpExtensions_EXPORT ImageWidget
29       : public RendererWidget
30     {
31       Q_OBJECT;
32
33     public:
34       typedef ImageWidget    Self;
35       typedef RendererWidget Superclass;
36
37       typedef cpExtensions::Visualization::OutlineSource         TOutline;
38       typedef cpExtensions::Visualization::MeshActor             TActor;
39       typedef cpExtensions::Visualization::WindowLevelImageActor TWLActor;
40       typedef cpExtensions::Interaction::ImageSliceStyle         TStyle;
41
42     public:
43       explicit ImageWidget( QWidget* parent = NULL, Qt::WindowFlags f = 0 );
44       virtual ~ImageWidget( );
45
46       void Clear( );
47       void SetImage(
48         vtkImageData* image, int orientation, const std::string& name
49         );
50       virtual void ResetCamera( ) cpExtensions_OVERRIDE;
51
52       TWLActor* GetImageActor( );
53       const TWLActor* GetImageActor( ) const;
54
55       /* TODO
56          void SetImage(
57          vtkImageData* image, int orientation, const std::string& name
58          );
59          void Add( vtkDataSet* data, const std::string& name );
60
61          // TODO: std::vector< vtkProp* > GetActors( const std::string& name ) const;
62          int GetOrientation( ) const;
63          void SetSliceNumber( int slice );
64
65
66          void GetScalarRange( double r[ 2 ] ) const;
67          void GetWindowLevel( double wl[ 2 ] ) const;
68          double GetImageOpacity( ) const;
69          unsigned char GetImageInterpolation( ) const;
70
71          void SetScalarRange( double r[ 2 ] );
72          void SetWindowLevel( double wl[ 2 ] );
73          void SetImageOpacity( double o );
74          void SetImageInterpolation( unsigned char i );
75
76          vtkProp* GetImageActor( );
77          const vtkProp* GetImageActor( ) const;
78       */
79
80     protected:
81       std::string m_ImageName;
82
83       vtkSmartPointer< TWLActor > m_WLActor;
84       vtkSmartPointer< TOutline > m_Outline;
85       TActor* m_OutlineActor;
86
87       vtkSmartPointer< TStyle > m_Style;
88
89       /* TODO
90          protected:
91          vtkSmartPointer< cpExtensions::Visualization::ImageViewerActors >
92          m_ImageViewerActors;
93          vtkSmartPointer< cpExtensions::Interaction::ImageSliceStyle >
94          m_ImageSliceStyle;
95          std::string m_ImageName;
96       */
97     };
98
99   } // ecapseman
100
101 } // ecapseman
102
103 #endif // cpExtensions_QT4
104
105 #endif // __cpExtensions__QT__ImageWidget__h__
106
107 // eof - $RCSfile$