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