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