]> Creatis software - cpPlugins.git/blob - lib/cpExtensions/Interaction/ImageSliceStyle.h
Cast image filter added. ROI filter modified.
[cpPlugins.git] / lib / cpExtensions / Interaction / ImageSliceStyle.h
1 #ifndef __cpExtensions__Interaction__ImageSliceStyle__h__
2 #define __cpExtensions__Interaction__ImageSliceStyle__h__
3
4 #include <cpExtensions/Config.h>
5 #include <vtkInteractorStyleImage.h>
6 #include <vtkSmartPointer.h>
7
8 // -------------------------------------------------------------------------
9 class vtkPropPicker;
10 class vtkTextActor;
11
12 // -------------------------------------------------------------------------
13 namespace cpExtensions
14 {
15   namespace Visualization
16   {
17     class CursorActors;
18     class LUTImageActor;
19     class WindowLevelImageActor;
20   }
21   namespace Interaction
22   {
23     /**
24      */
25     class cpExtensions_EXPORT ImageSliceStyle
26       : public vtkInteractorStyleImage
27     {
28     public:
29       typedef ImageSliceStyle Self;
30       typedef cpExtensions::Visualization::CursorActors          TCursor;
31       typedef cpExtensions::Visualization::LUTImageActor         TLUTActor;
32       typedef cpExtensions::Visualization::WindowLevelImageActor TWLActor;
33
34     public:
35       vtkTypeMacro( ImageSliceStyle, vtkInteractorStyleImage );
36       typedef vtkInteractorStyleImage::Superclass Overclass;
37
38     public:
39       static Self* New( );
40
41       int GetSliceNumber( ) const;
42       int GetOrientation( ) const;
43
44       virtual void OnMouseMove( ) cpExtensions_OVERRIDE;
45       virtual void OnMouseWheelForward( ) cpExtensions_OVERRIDE;
46       virtual void OnMouseWheelBackward( ) cpExtensions_OVERRIDE;
47       virtual void OnChar( ) cpExtensions_OVERRIDE;
48
49
50       /* TODO
51          cpExtensions::Visualization::ImageViewerActors* GetActors( );
52          const cpExtensions::Visualization::ImageViewerActors* GetActors( ) const;
53          void SetActors( cpExtensions::Visualization::ImageViewerActors* actors );
54
55          // Events
56          virtual void OnMouseMove( ) cpExtensions_OVERRIDE;
57          virtual void OnChar( ) cpExtensions_OVERRIDE;
58       */
59
60     protected:
61       ImageSliceStyle( );
62       virtual ~ImageSliceStyle( );
63
64       bool _PickPointOnImageActor( int idx[ 2 ], double pnt[ 3 ] );
65       void _CorrectPosition( double pos[ 3 ], int ijk[ 3 ] );
66       void _ShowText( double pos[ 3 ] );
67
68     private:
69       // Purposely not implemented
70       ImageSliceStyle( const Self& );
71       Self& operator=( const Self& );
72
73     protected:
74       vtkSmartPointer< vtkPropPicker > m_PropPicker;
75       vtkSmartPointer< TLUTActor >     m_LUTActor;
76       vtkSmartPointer< TWLActor >      m_WLActor;
77       vtkSmartPointer< TCursor >       m_Cursor;
78       vtkSmartPointer< vtkTextActor >  m_Text;
79       char m_TextBuffer[ 1024 ];
80     };
81
82   } // ecapseman
83
84 } // ecapseman
85
86 #endif // __cpExtensions__Interaction__ImageSliceStyle__h__
87
88 // eof - $RCSfile$