X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FInterface%2FDataObject.cxx;h=0bbe13bdeb4973d0d23ee9b11c3f350aabcca5e5;hb=a89305e04527ebe2e81d0d1a62bbe34e0d35a141;hp=2acc980ce24f23def7906467feb03512d024cecb;hpb=c3a83f9e38129c9efd40de5ab09aca14c731f371;p=cpPlugins.git diff --git a/lib/cpPlugins/Interface/DataObject.cxx b/lib/cpPlugins/Interface/DataObject.cxx index 2acc980..0bbe13b 100644 --- a/lib/cpPlugins/Interface/DataObject.cxx +++ b/lib/cpPlugins/Interface/DataObject.cxx @@ -9,23 +9,26 @@ cpPlugins::Interface::ProcessObject* cpPlugins::Interface::DataObject:: GetSource( ) { - return( this->m_Source ); + auto ptr = reinterpret_cast< ProcessObject::Pointer* >( this->m_Source ); + return( ptr->GetPointer( ) ); } // ------------------------------------------------------------------------- const cpPlugins::Interface::ProcessObject* cpPlugins::Interface::DataObject:: GetSource( ) const { - return( this->m_Source ); + auto ptr = reinterpret_cast< ProcessObject::Pointer* >( this->m_Source ); + return( ptr->GetPointer( ) ); } // ------------------------------------------------------------------------- void cpPlugins::Interface::DataObject:: SetSource( cpPlugins::Interface::ProcessObject* src ) { - if( this->m_Source != src ) + auto ptr = reinterpret_cast< ProcessObject::Pointer* >( this->m_Source ); + if( ptr->GetPointer( ) != src ) { - this->m_Source = src; + *ptr = src; this->Modified( ); } // fi @@ -33,7 +36,7 @@ SetSource( cpPlugins::Interface::ProcessObject* src ) // ------------------------------------------------------------------------- void cpPlugins::Interface::DataObject:: -DisconnectPipeline( ) +DisconnectFromPipeline( ) { // Disconnect input pipelines (ITK) itk::DataObject* itk_obj = this->GetITK< itk::DataObject >( ); @@ -60,22 +63,27 @@ DisconnectPipeline( ) } // fi // Unbind source - this->m_Source = NULL; + auto ptr = reinterpret_cast< ProcessObject::Pointer* >( this->m_Source ); + *ptr = NULL; this->Modified( ); } // ------------------------------------------------------------------------- cpPlugins::Interface::DataObject:: DataObject( ) - : Superclass( ), - m_Source( NULL ) + : 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$