]> Creatis software - cpPlugins.git/commitdiff
...
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Wed, 25 Nov 2015 00:20:19 +0000 (19:20 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Wed, 25 Nov 2015 00:20:19 +0000 (19:20 -0500)
appli/ImageMPR/ImageMPR.cxx
lib/cpPlugins/Interface/Plugins.cxx

index 5a9e414c9de2c584bfc5a5d88e4fd3168e15c49f..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
-  */
 }
 
 // -------------------------------------------------------------------------
index 614fddbda124a315d7e2ddb93fd3e51e84a915e5..62227a9d57115f4cf3380d9d863faf45e8ce6d4a 100644 (file)
@@ -549,6 +549,8 @@ ActivateFilter( const std::string& name )
 void cpPlugins::Interface::Plugins::
 DeactivateFilter( )
 {
+  if( this->m_ActiveFilter.IsNotNull( ) )
+    this->m_ActiveFilter->DisconnectOutputs( );
   this->m_ActiveFilter = NULL;
 }
 
@@ -685,7 +687,7 @@ UpdateActiveFilter( TStringContainer& outputs, const std::string& parent )
       outputs.insert( dobj->GetName( ) );
 
     } // rof
-    this->m_ActiveFilter->DisconnectOutputs( );
+    // this->m_ActiveFilter->DisconnectOutputs( );
     return( true );
   }
   else