]> Creatis software - cpPlugins.git/blobdiff - appli/PipelineEditor/PipelineEditor.cxx
Windows compilation is broken.
[cpPlugins.git] / appli / PipelineEditor / PipelineEditor.cxx
index b61cd14cbc5155b9c2e830ac8b5a6b216893d3af..a4cd75e79a82be20ef74ed1d545da061eda89417 100644 (file)
@@ -87,26 +87,44 @@ _ShowFilterOutput(
   auto filter = this->m_Workspace.GetFilter( filter_name );
   if( filter != NULL )
   {
-    auto id = filter->GetOutputData< vtkImageData >( output_name );
-    auto md = filter->GetOutputData< vtkPolyData >( output_name );
-    if( id != NULL )
+    auto out = filter->GetOutput( output_name );
+    if( out != 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( );
+      auto id = out->GetVTK< vtkImageData >( );
+      auto md = out->GetVTK< vtkPolyData >( );
+      if( id != NULL )
+      {
+        this->_Block( );
+        this->m_UI->Viewer->Clear( );
+        this->m_UI->Viewer->SetMainImage( id );
+        auto actors = this->m_UI->Viewer->GetMainImageActors( );
+        out->ClearVTKActors( );
+        for( auto aIt = actors.begin( ); aIt != actors.end( ); ++aIt )
+          out->AddVTKActor( aIt->first, aIt->second );
+        this->_UnBlock( );
+      }
+      else if( md != NULL )
+      {
+        this->_Block( );
+        this->m_UI->Viewer->AddMesh( md );
+        out->AddVTKActor(
+          this->m_UI->Viewer->GetActor( md ),
+          this->m_UI->Viewer->GetRenderer( 3 )
+          );
+        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( "No known VTK conversion!" )
+        QMessageBox::tr( "Unknown port name." )
         );
   }
   else