]> Creatis software - cpPlugins.git/blobdiff - appli/PipelineEditor/PipelineEditor.cxx
MPR objects updated
[cpPlugins.git] / appli / PipelineEditor / PipelineEditor.cxx
index eeaee071237b6a810e4f67c2f2e15ce12dbe6ddc..7c06aac5af584e0432a6264c967e55e090fab3bc 100644 (file)
@@ -2,7 +2,9 @@
 #include "ui_PipelineEditor.h"
 
 #include <cpPipelineEditor/Editor.h>
+#include <cpExtensions/QT/PropertyWidget.h>
 #include <QMessageBox>
+#include <vtkRenderWindowInteractor.h>
 
 // -------------------------------------------------------------------------
 PipelineEditor::
@@ -47,6 +49,18 @@ PipelineEditor( int argc, char* argv[], QApplication* app, QWidget* parent )
     this,
     SLOT( _ShowFilterOutput( const std::string&, const std::string& ) )
     );
+  this->connect(
+    this->m_UI->Canvas->editor( ),
+    SIGNAL( hideFilterOutput( const std::string&, const std::string& ) ),
+    this,
+    SLOT( _HideFilterOutput( const std::string&, const std::string& ) )
+    );
+  this->connect(
+    this->m_UI->Canvas->editor( ),
+    SIGNAL( visualPropertiesFilterOutput( const std::string&, const std::string& ) ),
+    this,
+    SLOT( _PropertiesFilterOutput( const std::string&, const std::string& ) )
+    );
 }
 
 // -------------------------------------------------------------------------
@@ -114,4 +128,57 @@ _ShowFilterOutput(
   } // fi
 }
 
+// -------------------------------------------------------------------------
+void PipelineEditor::
+_HideFilterOutput(
+  const std::string& filter_name, const std::string& output_name
+  )
+{
+  // Get output
+  auto filter = this->m_Workspace.GetFilter( filter_name );
+  if( filter != NULL )
+  {
+    auto output = filter->GetOutputData( output_name );
+    if( output != NULL )
+    {
+      std::string data_name = output_name + "@" + filter_name;
+      this->m_UI->Viewer->HideData( data_name );
+
+    } // fi
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void PipelineEditor::
+_PropertiesFilterOutput(
+  const std::string& filter_name, const std::string& output_name
+  )
+{
+  // Get output
+  auto filter = this->m_Workspace.GetFilter( filter_name );
+  if( filter != NULL )
+  {
+    auto output = filter->GetOutputData( output_name );
+    if( output != NULL )
+    {
+      std::string data_name = output_name + "@" + filter_name;
+      auto prop = this->m_UI->Viewer->GetProp( data_name );
+
+      cpExtensions::QT::PropertyWidget* wdg =
+        new cpExtensions::QT::PropertyWidget( NULL );
+      wdg->SetProp( prop );
+      wdg->SetRenderWindow( this->m_UI->Viewer->GetInteractor( 3 )->GetRenderWindow( ) );
+      wdg->show( );
+    }
+    else
+      QMessageBox::critical(
+        this,
+        QMessageBox::tr( "Error showing data" ),
+        QMessageBox::tr( "No known VTK conversion!" )
+        );
+
+  } // fi
+}
+
 // eof - $RCSfile$