]> Creatis software - cpPlugins.git/blobdiff - appli/PipelineEditor/PipelineEditor.cxx
Actors updated
[cpPlugins.git] / appli / PipelineEditor / PipelineEditor.cxx
index b61cd14cbc5155b9c2e830ac8b5a6b216893d3af..65fb82b7f816cd9c8403844a6c5e05b4bae47b7d 100644 (file)
@@ -3,8 +3,8 @@
 
 #include <QMessageBox>
 
+#include <cpPlugins/Image.h>
 #include <cpPipelineEditor/Editor.h>
-#include <cpExtensions/QT/PropertyWidget.h>
 
 #include <vtkImageData.h>
 #include <vtkPolyData.h>
@@ -84,37 +84,22 @@ _ShowFilterOutput(
   this->_ExecFilter( filter_name );
 
   // Get output
-  auto filter = this->m_Workspace.GetFilter( filter_name );
-  if( filter != NULL )
+  auto output = this->m_Workspace.GetOutput( filter_name, output_name );
+  if( output == NULL )
   {
-    auto id = filter->GetOutputData< vtkImageData >( output_name );
-    auto md = filter->GetOutputData< vtkPolyData >( output_name );
-    if( id != NULL )
-    {
-      this->_Block( );
-      this->m_UI->Viewer->Clear( );
-      this->m_UI->Viewer->SetMainImage( id );
-      this->_UnBlock( );
-    }
-    else if( md != NULL )
-    {
-      this->_Block( );
-      this->m_UI->Viewer->AddMesh( md );
-      this->_UnBlock( );
-    }
-    else
-      QMessageBox::critical(
-        this,
-        QMessageBox::tr( "Error showing data" ),
-        QMessageBox::tr( "No known VTK conversion!" )
-        );
-  }
-  else
     QMessageBox::critical(
       this,
       QMessageBox::tr( "Error showing data" ),
-      QMessageBox::tr( "Unknown filter." )
+      QMessageBox::tr( "Unknown port name." )
       );
+    return;
+
+  } // fi
+
+  // Create and associate actor
+  this->_Block( );
+  this->m_UI->Viewer->AddActor( output->GetVTKActor( ) );
+  this->_UnBlock( );
 }
 
 // -------------------------------------------------------------------------
@@ -146,34 +131,35 @@ _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< vtkPolyData >( output_name );
-    if( output != NULL )
-    {
-      auto actor = this->m_UI->Viewer->GetActor( output );
-      if( actor != NULL )
-      {
-        cpExtensions::QT::PropertyWidget* wdg =
-          new cpExtensions::QT::PropertyWidget( NULL );
-        wdg->SetProp( actor );
-        wdg->SetRenderWindow(
-          this->m_UI->Viewer->GetInteractor( 3 )->GetRenderWindow( )
-          );
-        wdg->show( );
-
-      } // fi
-    }
-    else
-      QMessageBox::critical(
-        this,
-        QMessageBox::tr( "Error showing data" ),
-        QMessageBox::tr( "No known VTK conversion!" )
-        );
+  /* TODO
+     auto filter = this->m_Workspace.GetFilter( filter_name );
+     if( filter != NULL )
+     {
+     auto output = filter->GetOutputData< vtkPolyData >( output_name );
+     if( output != NULL )
+     {
+     auto actor = this->m_UI->Viewer->GetActor( output );
+     if( actor != NULL )
+     {
+     cpExtensions::QT::PropertyWidget* wdg =
+     new cpExtensions::QT::PropertyWidget( NULL );
+     wdg->SetProp( actor );
+     wdg->SetRenderWindow(
+     this->m_UI->Viewer->GetInteractor( 3 )->GetRenderWindow( )
+     );
+     wdg->show( );
 
-  } // fi
+     } // fi
+     }
+     else
+     QMessageBox::critical(
+     this,
+     QMessageBox::tr( "Error showing data" ),
+     QMessageBox::tr( "No known VTK conversion!" )
+     );
+
+     } // fi
+  */
 }
 
 // eof - $RCSfile$