]> Creatis software - cpPlugins.git/blobdiff - appli/PipelineEditor/PipelineEditor.cxx
Cast image filter added. ROI filter modified.
[cpPlugins.git] / appli / PipelineEditor / PipelineEditor.cxx
index 5751a904d68f776f9a632fff29ea7a7a1da9819f..32a4546eb595f42aef59ca177847a71b5eda2f1f 100644 (file)
@@ -15,7 +15,6 @@ PipelineEditor( int argc, char* argv[], QWidget* parent )
     m_UI( new Ui::PipelineEditor )
 {
   // Basic configuration
-  this->m_SingleWorkspace = true;
   this->m_BaseWindowTitle = "PipelineEditor - ";
   this->m_UI->setupUi( this );
   this->setCanvas( this->m_UI->Canvas );
@@ -32,16 +31,14 @@ PipelineEditor( int argc, char* argv[], QWidget* parent )
   this->m_UI->Canvas->connectOutputPortSlot(
     this, SLOT( _slotView( const std::string&, bool ) )
     );
+  this->connect(
+    this->m_UI->actionPrintExecutionInformation, SIGNAL( triggered( bool ) ),
+    this, SLOT( _slotPrintExecutionInformation( bool ) )
+    );
 
   // Load command-line given workspace (if any)
-  this->m_ActiveWS = "empty";
   if( argc > 1 )
-  {
     this->_loadWorkspace( argv[ 1 ] );
-    this->m_ActiveWS = argv[ 1 ];
-  }
-  else
-    this->_addWorkspace( this->m_ActiveWS );
 }
 
 // -------------------------------------------------------------------------
@@ -70,7 +67,7 @@ _slotView( const std::string& name, bool show )
   {
     try
     {
-      auto ws = this->workspace( this->m_ActiveWS );
+      auto ws = this->workspace( );
       auto filter = ws->GetFilter( filter_name );
       cpBaseQtApplication_Execute( filter->Update( ) );
       auto image = filter->GetOutputData< vtkImageData >( output_name );
@@ -100,7 +97,8 @@ _slotView( const std::string& name, bool show )
       } // fi
       if(
         dynamic_cast< QWidget* >( viewer ) !=
-        dynamic_cast< QWidget* >( this->m_UI->Viewer )
+        dynamic_cast< QWidget* >( this->m_UI->Viewer ) &&
+        viewer != NULL
         )
       {
         delete this->m_UI->Viewer;
@@ -143,6 +141,14 @@ _slotView( const std::string& name, bool show )
   } // fi
 }
 
+// -------------------------------------------------------------------------
+void PipelineEditor::
+_slotPrintExecutionInformation( bool show )
+{
+  if( this->m_Workspace.IsNotNull( ) )
+    this->m_Workspace->SetPrintExecution( show );
+}
+
 // -------------------------------------------------------------------------
 #include <cpBaseQtApplication/MainHelper.h>
 cpBaseQtApplication_Main( PipelineEditor );