]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface/ProcessObject.cxx
...
[cpPlugins.git] / lib / cpPlugins / Interface / ProcessObject.cxx
index 364816a4d094ae5c2df701dec48228ecc929ae05..e2ea0de61e79640917d122c376c24a2eed027b2f 100644 (file)
@@ -7,6 +7,20 @@
 #include <cpPlugins/Interface/SimpleMPRWidget.h>
 #endif // cpPlugins_Interface_QT4
 
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::ProcessObject::
+SetITK( itk::LightObject* o )
+{
+  // Polymorphism: do nothing -> this is a filter!!!
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::ProcessObject::
+SetVTK( vtkObjectBase* o )
+{
+  // Polymorphism: do nothing -> this is a filter!!!
+}
+
 // -------------------------------------------------------------------------
 std::set< std::string > cpPlugins::Interface::ProcessObject::
 GetInputsNames( ) const
@@ -138,7 +152,9 @@ Update( )
   bool need_to_update = false;
   for( ; i != this->m_Inputs.end( ) && r == ""; ++i )
   {
-    if( i->second.IsValid( ) )
+    bool iv = i->second.IsValid( );
+    bool ir = i->second.IsRequired( );
+    if( iv || !ir )
     {
       Self* src = dynamic_cast< Self* >( i->second->GetSource( ) );
       if( src != NULL )
@@ -147,8 +163,12 @@ Update( )
         r = src->Update( );
 
       } // fi
-
-    } // fi
+    }
+    else
+      r =
+        "ProcessObject: Required input \"" +
+        i->first + "@" + this->GetClassName( ) +
+        "\" is not valid (=NULL).";
 
   } // rof
 
@@ -202,7 +222,6 @@ cpPlugins::Interface::ProcessObject::
 void cpPlugins::Interface::ProcessObject::
 _AddInput( const std::string& name, bool required )
 {
-//  typedef typename _TInputs::value_type _TValue;
   auto i = this->m_Inputs.find( name );
   if( i == this->m_Inputs.end( ) )
   {