]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Interface/Object.h
...
[cpPlugins.git] / lib / cpPlugins / Interface / Object.h
1 #ifndef __CPPLUGINS__INTERFACE__OBJECT__H__
2 #define __CPPLUGINS__INTERFACE__OBJECT__H__
3
4 #include <cpPlugins/Interface/Macros.h>
5
6 #include <string>
7
8 #include <itkObject.h>
9 #include <itkObjectFactory.h>
10
11 #include <vtkSmartPointer.h>
12 #include <vtkObjectBase.h>
13
14 #ifdef cpPlugins_Interface_QT4
15 #include <QPointF>
16 #endif // cpPlugins_Interface_QT4
17
18 namespace cpPlugins
19 {
20   namespace Interface
21   {
22     /**
23      */
24     class cpPlugins_Interface_EXPORT Object
25       : public itk::Object
26     {
27     public:
28       typedef Object                          Self;
29       typedef itk::Object                     Superclass;
30       typedef itk::SmartPointer< Self >       Pointer;
31       typedef itk::SmartPointer< const Self > ConstPointer;
32
33     public:
34       itkNewMacro( Self );
35       itkTypeMacro( Object, itkObject );
36       cpPlugins_Id_Macro( Object, BaseObject );
37
38       itkGetConstMacro( ViewX, float );
39       itkGetConstMacro( ViewY, float );
40
41     public:
42       void SetViewCoords( float x, float y );
43
44 #ifdef cpPlugins_Interface_QT4
45       void SetViewCoords( const QPointF& coords );
46       QPointF GetViewCoords( ) const;
47 #endif // cpPlugins_Interface_QT4
48
49       virtual void Modified( ) const;
50       virtual itk::ModifiedTimeType GetMTime( ) const;
51
52       virtual void SetITK( itk::LightObject* o );
53       virtual void SetVTK( vtkObjectBase* o );
54
55       template< class T >
56         inline T* GetITK( );
57
58       template< class T >
59         inline const T* GetITK( ) const;
60
61       template< class T >
62         inline T* GetVTK( );
63
64       template< class T >
65         inline const T* GetVTK( ) const;
66
67     protected:
68       Object( );
69       virtual ~Object( );
70
71     private:
72       // Purposely not implemented
73       Object( const Self& );
74       Self& operator=( const Self& );
75
76     protected:
77       itk::LightObject::Pointer        m_ITKObject;
78       vtkSmartPointer< vtkObjectBase > m_VTKObject;
79
80       float m_ViewX;
81       float m_ViewY;
82     };
83
84   } // ecapseman
85
86 } // ecapseman
87
88 #include <cpPlugins/Interface/Object.hxx>
89
90 #endif // __CPPLUGINS__INTERFACE__OBJECT__H__
91
92 // eof - $RCSfile$