1 #include <cpPlugins/BaseObjects/DataObject.h>
3 #include <itkDataObject.h>
4 #include <vtkImageData.h>
5 #include <vtkPolyData.h>
6 #include <vtkUnstructuredGrid.h>
8 // -------------------------------------------------------------------------
9 bool cpPlugins::BaseObjects::DataObject::
10 IsCompatible( const Self* other ) const
15 // -------------------------------------------------------------------------
16 cpPlugins::BaseObjects::ProcessObject*
17 cpPlugins::BaseObjects::DataObject::
20 return( this->m_Source );
23 // -------------------------------------------------------------------------
24 const cpPlugins::BaseObjects::ProcessObject*
25 cpPlugins::BaseObjects::DataObject::
28 return( this->m_Source );
31 // -------------------------------------------------------------------------
32 void cpPlugins::BaseObjects::DataObject::
33 SetSource( cpPlugins::BaseObjects::ProcessObject* src )
35 if( this->m_Source != src )
43 // -------------------------------------------------------------------------
44 void cpPlugins::BaseObjects::DataObject::
45 DisconnectFromPipeline( )
47 // Disconnect input pipelines (ITK)
48 itk::DataObject* itk_obj = this->GetITK< itk::DataObject >( );
50 itk_obj->DisconnectPipeline( );
52 // Disconnect input pipelines (VTK)
53 bool ok = this->_DisconnectVTK< vtkImageData >( );
54 if( !ok ) ok = this->_DisconnectVTK< vtkUnstructuredGrid >( );
55 if( !ok ) ok = this->_DisconnectVTK< vtkPolyData >( );
58 this->m_Source = NULL;
62 // -------------------------------------------------------------------------
63 cpPlugins::BaseObjects::DataObject::
70 // -------------------------------------------------------------------------
71 cpPlugins::BaseObjects::DataObject::
76 // -------------------------------------------------------------------------
77 template< class _TType >
78 bool cpPlugins::BaseObjects::DataObject::
81 _TType* v = this->GetVTK< _TType >( );
84 vtkSmartPointer< _TType > d = vtkSmartPointer< _TType >::New( );