]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Interface/ProcessObject.cxx
...
[cpPlugins.git] / lib / cpPlugins / Interface / ProcessObject.cxx
index 1db1a61cb44db76ac27f40400912feab3523d21a..7ed9dfc01732f45c1b51c985a416e27334f683ed 100644 (file)
@@ -8,34 +8,25 @@
 #include <vtkRenderWindowInteractor.h>
 
 // -------------------------------------------------------------------------
-void cpPlugins::Interface::ProcessObject::
-Modified( ) const
-{
-  if( this->m_ITKObject.IsNotNull( ) )
-    this->m_ITKObject->Modified( );
-  if( this->m_VTKObject.GetPointer( ) != NULL )
-    this->m_VTKObject->Modified( );
-  this->Superclass::Modified( );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::ProcessObject::
-GetInputsNames( std::set< std::string >& names ) const
+std::set< std::string > cpPlugins::Interface::ProcessObject::
+GetInputsNames( ) const
 {
-  names.clear( );
+  std::set< std::string > names;
   auto dIt = this->m_Inputs.begin( );
   for( ; dIt != this->m_Inputs.end( ); ++dIt )
     names.insert( dIt->first );
+  return( names );
 }
 
 // -------------------------------------------------------------------------
-void cpPlugins::Interface::ProcessObject::
-GetOutputsNames( std::set< std::string >& names ) const
+std::set< std::string > cpPlugins::Interface::ProcessObject::
+GetOutputsNames( ) const
 {
-  names.clear( );
+  std::set< std::string > names;
   auto dIt = this->m_Outputs.begin( );
   for( ; dIt != this->m_Outputs.end( ); ++dIt )
     names.insert( dIt->first );
+  return( names );
 }
 
 // -------------------------------------------------------------------------
@@ -54,23 +45,6 @@ GetNumberOfOutputs( ) const
 
 // -------------------------------------------------------------------------
 bool cpPlugins::Interface::ProcessObject::
-SetOutputObjectName(
-  const std::string& new_object_name, const std::string& output_name
-  )
-{
-  auto oIt = this->m_Outputs.find( output_name );
-  if( oIt != this->m_Outputs.end( ) )
-  {
-    this->m_OutputObjectsNames[ output_name ] = new_object_name;
-    this->Modified( );
-    return( true );
-  }
-  else
-    return( false );
-}
-
-// -------------------------------------------------------------------------
-void cpPlugins::Interface::ProcessObject::
 SetInput( const std::string& id, cpPlugins::Interface::DataObject* dobj )
 {
   _TDataContainer::iterator i = this->m_Inputs.find( id );
@@ -78,8 +52,10 @@ SetInput( const std::string& id, cpPlugins::Interface::DataObject* dobj )
   {
     i->second = dobj;
     this->Modified( );
-
-  } // fi
+    return( true );
+  }
+  else
+    return( false );
 }
 
 // -------------------------------------------------------------------------
@@ -107,16 +83,6 @@ Update( )
   if( r == "" )
     r = this->_GenerateData( );
 
-  // Configure output names
-  auto oIt = this->m_Outputs.begin( );
-  for( ; oIt != this->m_Outputs.end( ); ++oIt )
-  {
-    auto nIt = this->m_OutputObjectsNames.find( oIt->first );
-    if( nIt != this->m_OutputObjectsNames.end( ) )
-      oIt->second->SetName( nIt->second );
-
-  } // rof
-
   // Return error description, if any
   return( r );
 }
@@ -143,12 +109,10 @@ GetInteractors( ) const
 void cpPlugins::Interface::ProcessObject::
 AddInteractor( vtkRenderWindowInteractor* interactor )
 {
+  this->m_Interactors.insert( interactor );
 #ifdef cpPlugins_Interface_QT4
-  if( this->m_ParametersDialog == NULL )
-    this->m_ParametersDialog = new ParametersQtDialog( );
   this->m_ParametersDialog->addInteractor( interactor );
 #endif // cpPlugins_Interface_QT4
-  this->m_Interactors.insert( interactor );
 }
 
 // -------------------------------------------------------------------------
@@ -156,29 +120,16 @@ bool cpPlugins::Interface::ProcessObject::
 ExecConfigurationDialog( QWidget* parent )
 {
   bool r = false;
-
 #ifdef cpPlugins_Interface_QT4
-
-  if( QApplication::instance( ) != NULL )
+  if( this->m_ParametersDialog != NULL )
   {
-    if( this->m_ParametersDialog == NULL )
-      this->m_ParametersDialog = new ParametersQtDialog( );
-    /* TODO
-       this->m_ParametersDialog->setTitle(
-       this->GetClassName( ) + std::string( " basic configuration" )
-       );
-    */
-
     this->m_ParametersDialog->setParent( NULL );
     this->m_ParametersDialog->setParameters( this->m_Parameters );
-
     r = ( this->m_ParametersDialog->exec( ) == 1 );
   }
   else
     r = false;
-  
 #endif // cpPlugins_Interface_QT4
-
   return( r );
 }
 
@@ -186,21 +137,25 @@ ExecConfigurationDialog( QWidget* parent )
 cpPlugins::Interface::ProcessObject::
 ProcessObject( )
   : Superclass( ),
-    m_ITKObject( NULL ),
-    m_VTKObject( NULL ),
-    m_ParametersDialog( NULL ),
-    m_Plugins( NULL )
+    m_ParametersDialog( NULL )
 {
   this->m_Parameters = TParameters::New( );
   this->m_Parameters->SetProcessObject( this );
+
+#ifdef cpPlugins_Interface_QT4
+  if( QApplication::instance( ) != NULL )
+    this->m_ParametersDialog = new ParametersQtDialog( );
+#endif // cpPlugins_Interface_QT4
 }
 
 // -------------------------------------------------------------------------
 cpPlugins::Interface::ProcessObject::
 ~ProcessObject( )
 {
+#ifdef cpPlugins_Interface_QT4
   if( this->m_ParametersDialog != NULL )
     delete this->m_ParametersDialog;
+#endif // cpPlugins_Interface_QT4
 }
 
 // -------------------------------------------------------------------------