]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface/ProcessObject.cxx
Merge branch 'master' of ssh://git.creatis.insa-lyon.fr/cpPlugins
[cpPlugins.git] / lib / cpPlugins / Interface / ProcessObject.cxx
index ae4a1d3e4b2cf793c8eeab4ac1255691dbb589fd..f639d7f59e3ea2b5686950a48151e98b0d05ef73 100644 (file)
@@ -45,6 +45,28 @@ GetNumberOfOutputs( ) const
   return( this->m_Outputs.size( ) );
 }
 
+// -------------------------------------------------------------------------
+std::vector< std::string > cpPlugins::Interface::ProcessObject::
+GetInputsNames( ) const
+{
+  std::vector< std::string > r;
+  auto dIt = this->m_Inputs.begin( );
+  for( ; dIt != this->m_Inputs.end( ); ++dIt )
+    r.push_back( dIt->first );
+  return( r );
+}
+
+// -------------------------------------------------------------------------
+std::vector< std::string > cpPlugins::Interface::ProcessObject::
+GetOutputsNames( ) const
+{
+  std::vector< std::string > r;
+  auto dIt = this->m_Outputs.begin( );
+  for( ; dIt != this->m_Outputs.end( ); ++dIt )
+    r.push_back( dIt->first );
+  return( r );
+}
+
 // -------------------------------------------------------------------------
 void cpPlugins::Interface::ProcessObject::
 SetInput( const std::string& id, cpPlugins::Interface::DataObject* dobj )
@@ -100,15 +122,32 @@ ExecConfigurationDialog( QWidget* parent )
 
 #ifdef cpPlugins_Interface_QT4
 
-  r = cpPlugins::Interface::ParametersQtDialog(
+  if( this->m_ParametersDialog == NULL )
+  {
+    this->m_ParametersDialog = new ParametersQtDialog( parent );
+    this->m_ParametersDialog->setTitle(
+      this->GetClassName( ) + std::string( " basic configuration" )
+      );
+    this->m_ParametersDialog->setParameters( this->m_Parameters );
+
+  } // fi
+
+  if( !( this->m_ParametersDialog->IsModal( ) ) )
+  {
+    this->m_ParametersDialog->show( );
+    r = true;
+  }
+  else
+    r = ( this->m_ParametersDialog->exec( ) == 1 );
+
+  /*
+    r = cpPlugins::Interface::ParametersQtDialog(
     this->m_Parameters,
     this->GetClassName( ) + std::string( " basic configuration" ),
     parent
     );
-  /*
     if( r )
-    // TODO: !!! this->m_Parameters = parameters;
-    */
+  */
 
 #endif // cpPlugins_Interface_QT4
 
@@ -120,7 +159,8 @@ cpPlugins::Interface::ProcessObject::
 ProcessObject( )
   : Superclass( ),
     m_ITKObject( NULL ),
-    m_VTKObject( NULL )
+    m_VTKObject( NULL ),
+    m_ParametersDialog( NULL )
 {
   this->m_Parameters = TParameters::New( );
 }
@@ -129,6 +169,8 @@ ProcessObject( )
 cpPlugins::Interface::ProcessObject::
 ~ProcessObject( )
 {
+  if( this->m_ParametersDialog == NULL )
+    delete this->m_ParametersDialog;
 }
 
 // -------------------------------------------------------------------------