1 #ifndef __cpPlugins__Pipeline__Object__h__
2 #define __cpPlugins__Pipeline__Object__h__
4 #include <cpPlugins/Config.h>
6 #include <itkLightObject.h>
8 #include <itkObjectFactory.h>
9 #include <vtkSmartPointer.h>
10 #include <vtkObjectBase.h>
18 class cpPlugins_EXPORT Object
23 typedef itk::Object Superclass;
24 typedef itk::SmartPointer< Self > Pointer;
25 typedef itk::SmartPointer< const Self > ConstPointer;
28 itkTypeMacro( Object, itk::Object );
31 virtual const char* GetClassName( ) const = 0;
32 virtual const char* GetClassCategory( ) const = 0;
34 const float& GetViewX( ) const;
35 const float& GetViewY( ) const;
36 void SetViewCoords( float x, float y );
38 virtual void Modified( ) const override;
40 virtual void SetITK( itk::LightObject* o );
41 virtual void SetVTK( vtkObjectBase* o );
43 template< class _TType = itk::LightObject >
44 inline _TType* GetITK( )
46 if( this->m_ITK.GetPointer( ) == NULL )
48 return( dynamic_cast< _TType* >( this->m_ITK.GetPointer( ) ) );
51 template< class _TType = itk::LightObject >
52 inline const _TType* GetITK( ) const
54 if( this->m_ITK.GetPointer( ) == NULL )
57 dynamic_cast< const _TType* >( this->m_ITK.GetPointer( ) )
61 template< class _TType = vtkObjectBase >
62 inline _TType* GetVTK( )
64 if( this->m_VTK.GetPointer( ) == NULL )
66 return( dynamic_cast< _TType* >( this->m_VTK.GetPointer( ) ) );
69 template< class _TType = vtkObjectBase >
70 inline const _TType* GetVTK( ) const
72 if( this->m_VTK.GetPointer( ) == NULL )
75 dynamic_cast< const _TType* >( this->m_VTK.GetPointer( ) )
83 virtual void _UpdateITK( ) const;
84 virtual void _UpdateVTK( ) const;
87 // Purposely not implemented
88 Object( const Self& );
89 Self& operator=( const Self& );
92 itk::LightObject::Pointer m_ITK;
93 vtkSmartPointer< vtkObjectBase > m_VTK;
103 #endif // __cpPlugins__Pipeline__Object__h__