]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Pipeline/Widget.h
...
[cpPlugins.git] / lib / cpPlugins / Pipeline / Widget.h
1 #ifndef __cpPlugins__Pipeline__Widget__h__
2 #define __cpPlugins__Pipeline__Widget__h__
3
4 #include <cpPlugins/Pipeline/ProcessObject.h>
5 #include <vtkRenderWindowInteractor.h>
6
7 // -------------------------------------------------------------------------
8 namespace cpPlugins
9 {
10   namespace Pipeline
11   {
12     /**
13      */
14     class cpPlugins_EXPORT Widget
15       : public ProcessObject
16     {
17     public:
18       typedef Widget                          Self;
19       typedef ProcessObject                   Superclass;
20       typedef itk::SmartPointer< Self >       Pointer;
21       typedef itk::SmartPointer< const Self > ConstPointer;
22
23     public:
24       itkTypeMacro( Widget, ProcessObject );
25       cpPlugins_Id_Macro( Widget, Object );
26
27     public:
28       virtual void AddInteractor( vtkRenderWindowInteractor* i ) override;
29       virtual bool IsInteractive( ) override;
30
31       virtual void EnabledOn( );
32       virtual void EnabledOff( );
33       virtual void Clear( ) = 0;
34       virtual void SetEnabled( bool v ) = 0;
35       virtual bool GetEnabled( ) const = 0;
36
37     protected:
38       Widget( );
39       virtual ~Widget( );
40
41     private:
42       // Purposely not implemented
43       Widget( const Self& );
44       Self& operator=( const Self& );
45
46     protected:
47       typedef vtkSmartPointer< vtkRenderWindowInteractor > _TInteractor;
48       struct _TInteractorCmp
49       {
50         bool operator()(
51           const _TInteractor& a, const _TInteractor& b
52           ) const
53           { return( a.GetPointer( ) < b.GetPointer( ) ); }
54       };
55       std::set< _TInteractor, _TInteractorCmp > m_Interactors;
56
57     };
58
59   } // ecapseman
60
61 } // ecapseman
62
63 #endif // __cpPlugins__Pipeline__Widget__h__
64
65 // eof - $RCSfile$