]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface/DataObject.cxx
...
[cpPlugins.git] / lib / cpPlugins / Interface / DataObject.cxx
index 2acc980ce24f23def7906467feb03512d024cecb..0bbe13bdeb4973d0d23ee9b11c3f350aabcca5e5 100644 (file)
@@ -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$