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