]> Creatis software - cpPlugins.git/blobdiff - appli/ImageMPR/ImageMPR.cxx
...
[cpPlugins.git] / appli / ImageMPR / ImageMPR.cxx
index c18fcd24fad447bd2d4c5fd23f49fd1d826ec4fa..424020ef51590c1dbb624ca3e59a5c59c85436e8 100644 (file)
@@ -79,61 +79,10 @@ UpdateActualFilter( )
   {
     std::string parent = this->m_Plugins.GetParent( *oIt );
     TDataObject* dobj = this->m_Plugins.GetData< TDataObject >( *oIt );
-    this->m_UI->MPR->AddData( dobj, *oIt, parent );
-    this->m_UI->MPR->ShowData( *oIt );
+    if( this->m_UI->MPR->AddData( dobj, *oIt, parent ) )
+      this->m_UI->MPR->ShowData( *oIt );
 
   } // rof
-
-  /* TODO
-     std::vector< std::string > outputs;
-     std::string err = this->m_Plugins->UpdateActiveFilter( outputs );
-     if( err == "" )
-     {
-     for( auto oIt = outputs.begin( ); oIt != outputs.end( ); ++oIt )
-     {
-     TPlugins::TImage* image = this->m_Plugins->GetImage( *oIt );
-     if( image != NULL )
-     {
-     vtkImageData* vimage = image->GetVTK< vtkImageData >( );
-     if( vimage != NULL )
-     {
-     this->m_UI->MPR->AddImage(
-     vimage, *oIt, this->m_Plugins->GetParent( *oIt )
-     );
-     this->m_UI->MPR->ShowData( *oIt );
-
-     } // fi
-     continue;
-
-     } // fi
-
-     TPlugins::TMesh* mesh = this->m_Plugins->GetMesh( *oIt );
-     if( mesh != NULL )
-     {
-     this->m_Plugins->BlockWidget( );
-     this->m_UI->MPR->AddMesh(
-     mesh->GetVTK< vtkPolyData >( ),
-     *oIt,
-     this->m_Plugins->GetParent( *oIt )
-     );
-     this->m_UI->MPR->ShowData( *oIt );
-     this->m_Plugins->UnblockWidget( );
-
-     } // fi
-
-     } // rof
-     }
-     else
-     {
-     QMessageBox::critical(
-     this,
-     tr( "Error executing filter" ),
-     tr( ( std::string( "Error caught: " ) + err ).c_str( ) )
-     );
-     return;
-
-     } // fi
-  */
 }
 
 // -------------------------------------------------------------------------
@@ -173,6 +122,7 @@ _AssociatePluginsToMenu( )
       return;                                                           \
     TImage* image = this->m_Plugins.GetData< TImage >( name );          \
     this->m_UI->MPR->AddData( image, name, "" );                        \
+    this->m_UI->MPR->SetMainImage( name );                              \
     this->m_UI->MPR->ShowData( name );                                  \
   }                                                                     \
   catch( std::exception& err )                                          \