]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface/ProcessObject.cxx
...
[cpPlugins.git] / lib / cpPlugins / Interface / ProcessObject.cxx
index 1128fe10444ab89c454748101ccfeec30da93e27..f012f5701d3131a7b86d5f5acedf615a59137d99 100644 (file)
@@ -77,8 +77,12 @@ SetInput( const std::string& id, const ProcessObjectPort& port )
   auto i = this->m_Inputs.find( id );
   if( i != this->m_Inputs.end( ) )
   {
-    i->second = port;
-    this->Modified( );
+    if( i->second.GetPointer( ) != port.GetPointer( ) )
+    {
+      i->second = port;
+      this->Modified( );
+
+    } // fi
     return( true );
   }
   else
@@ -120,27 +124,17 @@ GetMTime( ) const
 {
   auto params_time = this->m_Parameters->GetMTime( );
   auto filter_time = this->Superclass::GetMTime( );
-  auto ipobj = this->GetITK< itk::ProcessObject >( );
-  if( ipobj == NULL )
-  {
-    auto vpobj = this->GetVTK< vtkAlgorithm >( );
-    if( vpobj != NULL )
-      filter_time = ( const_cast< vtkAlgorithm* >( vpobj ) )->GetMTime( );
-  }
-  else
-    filter_time = ipobj->GetMTime( );
-  return( ( params_time < filter_time )? filter_time: params_time );
+  return( ( params_time < filter_time )? params_time: filter_time );
 }
 
 // -------------------------------------------------------------------------
 std::string cpPlugins::Interface::ProcessObject::
 Update( )
 {
-  static 
   std::string r = "";
 
   // Force upstream updates
-  _TDataContainer::iterator i = this->m_Inputs.begin( );
+  auto i = this->m_Inputs.begin( );
   bool need_to_update = false;
   for( ; i != this->m_Inputs.end( ) && r == ""; ++i )
   {
@@ -153,9 +147,8 @@ Update( )
         r = src->Update( );
 
       } // fi
-    }
-    else
-      r = "cpPlugins::Interface::ProcessObject: No input connected.";
+
+    } // fi
 
   } // rof
 
@@ -212,7 +205,11 @@ _AddInput( const std::string& name )
   typedef typename _TDataContainer::value_type _TValue;
   auto i = this->m_Inputs.find( name );
   if( i == this->m_Inputs.end( ) )
+  {
     i = this->m_Inputs.insert( _TValue( name, NULL ) ).first;
+    this->Modified( );
+
+  } // fi
 }
 
 // eof - $RCSfile$