]> Creatis software - cpPlugins.git/blobdiff - appli/ImageMPR/ImageMPR.cxx
MPR finished
[cpPlugins.git] / appli / ImageMPR / ImageMPR.cxx
index 70124e9827df95a02366245b0a53f1683abb0ad7..5a9e414c9de2c584bfc5a5d88e4fd3168e15c49f 100644 (file)
@@ -76,8 +76,14 @@ UpdateActualFilter( )
 
   // Show outputs
   for( auto oIt = outputs.begin( ); oIt != outputs.end( ); ++oIt )
-    std::cout << *oIt << std::endl;
-  
+  {
+    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 );
+
+  } // rof
+
   /* TODO
      std::vector< std::string > outputs;
      std::string err = this->m_Plugins->UpdateActiveFilter( outputs );
@@ -166,18 +172,9 @@ _AssociatePluginsToMenu( )
     if( name == "" )                                                    \
       return;                                                           \
     TImage* image = this->m_Plugins.GetData< TImage >( name );          \
-    vtkImageData* vimage = image->GetVTK< vtkImageData >( );            \
-    if( vimage != NULL )                                                \
-    {                                                                   \
-      this->m_UI->MPR->AddImage( vimage, name );                        \
-      this->m_UI->MPR->ShowData( name );                                \
-    }                                                                   \
-    else                                                                \
-      QMessageBox::critical(                                            \
-        this,                                                           \
-        QMessageBox::tr( "Error showing image." ),                      \
-        QMessageBox::tr( "Image read, but no valid VTK conversion found." ) \
-        );                                                              \
+    this->m_UI->MPR->AddData( image, name, "" );                        \
+    this->m_UI->MPR->SetMainImage( name );                              \
+    this->m_UI->MPR->ShowData( name );                                  \
   }                                                                     \
   catch( std::exception& err )                                          \
   {                                                                     \