#include #include #include #include #include // ------------------------------------------------------------------------- cpPlugins::Interface::ProcessObject* cpPlugins::Interface::DataObject:: GetSource( ) { auto ptr = reinterpret_cast< ProcessObject::Pointer* >( this->m_Source ); return( ptr->GetPointer( ) ); } // ------------------------------------------------------------------------- const cpPlugins::Interface::ProcessObject* cpPlugins::Interface::DataObject:: GetSource( ) const { auto ptr = reinterpret_cast< ProcessObject::Pointer* >( this->m_Source ); return( ptr->GetPointer( ) ); } // ------------------------------------------------------------------------- void cpPlugins::Interface::DataObject:: SetSource( cpPlugins::Interface::ProcessObject* src ) { auto ptr = reinterpret_cast< ProcessObject::Pointer* >( this->m_Source ); if( ptr->GetPointer( ) != src ) { *ptr = src; this->Modified( ); } // fi } // ------------------------------------------------------------------------- void cpPlugins::Interface::DataObject:: DisconnectFromPipeline( ) { // Disconnect input pipelines (ITK) itk::DataObject* itk_obj = this->GetITK< itk::DataObject >( ); if( itk_obj != NULL ) itk_obj->DisconnectPipeline( ); // Disconnect input pipelines (VTK) vtkImageData* vtk_image = this->GetVTK< vtkImageData >( ); vtkPolyData* vtk_pd = this->GetVTK< vtkPolyData >( ); if( vtk_image != NULL ) { vtkSmartPointer< vtkImageData > d = vtkSmartPointer< vtkImageData >::New( ); d->ShallowCopy( vtk_image ); this->m_VTKObject = d; } else if( vtk_pd != NULL ) { vtkSmartPointer< vtkPolyData > d = vtkSmartPointer< vtkPolyData >::New( ); d->ShallowCopy( vtk_pd ); this->m_VTKObject = d; } // fi // Unbind source auto ptr = reinterpret_cast< ProcessObject::Pointer* >( this->m_Source ); *ptr = NULL; this->Modified( ); } // ------------------------------------------------------------------------- cpPlugins::Interface::DataObject:: DataObject( ) : Superclass( ) { this->m_Source = new ProcessObject::Pointer( ); } // ------------------------------------------------------------------------- cpPlugins::Interface::DataObject:: ~DataObject( ) { /* TODO auto ptr = reinterpret_cast< ProcessObject::Pointer* >( this->m_Source ); delete ptr; */ } // eof - $RCSfile$