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