X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FInterface%2FDataObject.cxx;h=0bbe13bdeb4973d0d23ee9b11c3f350aabcca5e5;hb=a89305e04527ebe2e81d0d1a62bbe34e0d35a141;hp=580434548740a34c758e10bb702be2e0705363ba;hpb=dba64a6906e88d6023b2e6c9632da9fd41bfeb53;p=cpPlugins.git diff --git a/lib/cpPlugins/Interface/DataObject.cxx b/lib/cpPlugins/Interface/DataObject.cxx index 5804345..0bbe13b 100644 --- a/lib/cpPlugins/Interface/DataObject.cxx +++ b/lib/cpPlugins/Interface/DataObject.cxx @@ -1,30 +1,34 @@ #include +#include #include #include #include // ------------------------------------------------------------------------- -cpPlugins::Interface::Object* cpPlugins::Interface::DataObject:: +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::Object* cpPlugins::Interface::DataObject:: +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::Object* src ) +SetSource( cpPlugins::Interface::ProcessObject* src ) { - if( this->m_Source.GetPointer( ) != src ) + auto ptr = reinterpret_cast< ProcessObject::Pointer* >( this->m_Source ); + if( ptr->GetPointer( ) != src ) { - this->m_Source = src; + *ptr = src; this->Modified( ); } // fi @@ -32,7 +36,7 @@ SetSource( cpPlugins::Interface::Object* src ) // ------------------------------------------------------------------------- void cpPlugins::Interface::DataObject:: -DisconnectPipeline( ) +DisconnectFromPipeline( ) { // Disconnect input pipelines (ITK) itk::DataObject* itk_obj = this->GetITK< itk::DataObject >( ); @@ -59,23 +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_ITKObject( NULL ), - m_VTKObject( NULL ), - 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$