]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface/ProcessObject.cxx
...
[cpPlugins.git] / lib / cpPlugins / Interface / ProcessObject.cxx
index 1e89c859aafdb52bebce3aa40a680694bf7c79e9..db873e9d4f854724c7606a79af4e4f00a705c5b6 100644 (file)
@@ -38,6 +38,20 @@ GetOutputsNames( std::set< std::string >& names ) const
     names.insert( dIt->first );
 }
 
+// -------------------------------------------------------------------------
+unsigned int cpPlugins::Interface::ProcessObject::
+GetNumberOfInputs( ) const
+{
+  return( this->m_Inputs.size( ) );
+}
+
+// -------------------------------------------------------------------------
+unsigned int cpPlugins::Interface::ProcessObject::
+GetNumberOfOutputs( ) const
+{
+  return( this->m_Outputs.size( ) );
+}
+
 // -------------------------------------------------------------------------
 bool cpPlugins::Interface::ProcessObject::
 SetOutputObjectName(
@@ -78,10 +92,15 @@ Update( )
   _TDataContainer::iterator i = this->m_Inputs.begin( );
   for( ; i != this->m_Inputs.end( ) && r == ""; ++i )
   {
-    Self* src = dynamic_cast< Self* >( i->second->GetSource( ) );
-    if( src != NULL )
-      r = src->Update( );
-
+    if( i->second.IsNotNull( ) )
+    {
+      Self* src = dynamic_cast< Self* >( i->second->GetSource( ) );
+      if( src != NULL )
+        r = src->Update( );
+    }
+    else
+      r = "cpPlugins::Interface::ProcessObject: No input connected.";
+    
   } // rof
 
   // Current update
@@ -121,6 +140,7 @@ AddInteractor( vtkRenderWindowInteractor* interactor )
     this->m_ParametersDialog = new ParametersQtDialog( );
   this->m_ParametersDialog->addInteractor( interactor );
 #endif // cpPlugins_Interface_QT4
+  this->m_Interactors.insert( interactor );
 }
 
 // -------------------------------------------------------------------------
@@ -136,26 +156,19 @@ ExecConfigurationDialog( QWidget* parent )
   {
     if( this->m_ParametersDialog == NULL )
       this->m_ParametersDialog = new ParametersQtDialog( );
-    this->m_ParametersDialog->setTitle(
-      this->GetClassName( ) + std::string( " basic configuration" )
-      );
+    /* TODO
+       this->m_ParametersDialog->setTitle(
+       this->GetClassName( ) + std::string( " basic configuration" )
+       );
+    */
 
     this->m_ParametersDialog->setParent( NULL );
     this->m_ParametersDialog->setParameters( this->m_Parameters );
 
-    if( !( this->m_ParametersDialog->IsModal( ) ) )
-    {
-      this->m_ParametersDialog->show( );
-      r = Self::DialogResult_Modal;
-    }
+    if( this->m_ParametersDialog->exec( ) == 1 )
+      r = Self::DialogResult_NoModal;
     else
-    {
-      if( this->m_ParametersDialog->exec( ) == 1 )
-        r = Self::DialogResult_NoModal;
-      else
-        r = Self::DialogResult_Cancel;
-
-    } // fi
+      r = Self::DialogResult_Cancel;
   }
   else
     r = Self::DialogResult_Cancel;