]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Interface/Object.h
92de13cb646f4823107a073628e5558dc3e5c065
[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 namespace cpPlugins
15 {
16   namespace Interface
17   {
18     /**
19      */
20     class cpPlugins_Interface_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       itkNewMacro( Self );
31       itkTypeMacro( Object, itkObject );
32       cpPlugins_Id_Macro( Object, BaseObject );
33
34       itkGetStringMacro( Name );
35       itkGetConstMacro( ViewX, float );
36       itkGetConstMacro( ViewY, float );
37
38       itkSetStringMacro( Name );
39       itkSetMacro( ViewX, float );
40       itkSetMacro( ViewY, float );
41
42     public:
43       virtual void Modified( ) const;
44       void SetViewCoords( float x, float y );
45
46       template< class T >
47         inline T* GetITK( );
48
49       template< class T >
50         inline const T* GetITK( ) const;
51
52       template< class T >
53         inline T* GetVTK( );
54
55       template< class T >
56         inline const T* GetVTK( ) const;
57
58     protected:
59       Object( );
60       virtual ~Object( );
61
62     private:
63       // Purposely not implemented
64       Object( const Self& );
65       Self& operator=( const Self& );
66
67     protected:
68       itk::LightObject::Pointer        m_ITKObject;
69       vtkSmartPointer< vtkObjectBase > m_VTKObject;
70       std::string                      m_Name;
71
72       float m_ViewX;
73       float m_ViewY;
74     };
75
76   } // ecapseman
77
78 } // ecapseman
79
80 #include <cpPlugins/Interface/Object.hxx>
81
82 #endif // __CPPLUGINS__INTERFACE__OBJECT__H__
83
84 // eof - $RCSfile$