]> 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 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       void SetITK( itk::LightObject* o );
47       void SetVTK( vtkObjectBase* o );
48
49       template< class T >
50         inline T* GetITK( );
51
52       template< class T >
53         inline const T* GetITK( ) const;
54
55       template< class T >
56         inline T* GetVTK( );
57
58       template< class T >
59         inline const T* GetVTK( ) const;
60
61     protected:
62       Object( );
63       virtual ~Object( );
64
65     private:
66       // Purposely not implemented
67       Object( const Self& );
68       Self& operator=( const Self& );
69
70     protected:
71       itk::LightObject::Pointer        m_ITKObject;
72       vtkSmartPointer< vtkObjectBase > m_VTKObject;
73       std::string                      m_Name;
74
75       float m_ViewX;
76       float m_ViewY;
77     };
78
79   } // ecapseman
80
81 } // ecapseman
82
83 #include <cpPlugins/Interface/Object.hxx>
84
85 #endif // __CPPLUGINS__INTERFACE__OBJECT__H__
86
87 // eof - $RCSfile$