#include <QMessageBox>
+#include <cpPlugins/Image.h>
#include <cpPipelineEditor/Editor.h>
-#include <cpExtensions/QT/PropertyWidget.h>
#include <vtkImageData.h>
#include <vtkPolyData.h>
this->_ExecFilter( filter_name );
// Get output
- auto filter = this->m_Workspace.GetFilter( filter_name );
- if( filter != NULL )
+ auto output = this->m_Workspace.GetOutput( filter_name, output_name );
+ if( output == NULL )
{
- auto out = filter->GetOutput( output_name );
- if( out != NULL )
- {
- 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( "Unknown port name." )
- );
- }
- else
QMessageBox::critical(
this,
QMessageBox::tr( "Error showing data" ),
- QMessageBox::tr( "Unknown filter." )
+ QMessageBox::tr( "Unknown port name." )
);
+ return;
+
+ } // fi
+
+ // Create and associate actor
+ this->_Block( );
+ this->m_UI->Viewer->AddActor( output->CreateVTKActor( ) );
+ this->_UnBlock( );
}
// -------------------------------------------------------------------------
const std::string& filter_name, const std::string& output_name
)
{
- // Get output
- auto filter = this->m_Workspace.GetFilter( filter_name );
- if( filter != NULL )
- {
- auto output = filter->GetOutputData< vtkPolyData >( output_name );
- if( output != NULL )
- {
- auto actor = this->m_UI->Viewer->GetActor( output );
- if( actor != NULL )
- {
- cpExtensions::QT::PropertyWidget* wdg =
- new cpExtensions::QT::PropertyWidget( NULL );
- wdg->SetProp( actor );
- wdg->SetRenderWindow(
- this->m_UI->Viewer->GetInteractor( 3 )->GetRenderWindow( )
- );
- wdg->show( );
-
- } // fi
- }
- else
- QMessageBox::critical(
- this,
- QMessageBox::tr( "Error showing data" ),
- QMessageBox::tr( "No known VTK conversion!" )
- );
+ /* TODO
+ auto filter = this->m_Workspace.GetFilter( filter_name );
+ if( filter != NULL )
+ {
+ auto output = filter->GetOutputData< vtkPolyData >( output_name );
+ if( output != NULL )
+ {
+ auto actor = this->m_UI->Viewer->GetActor( output );
+ if( actor != NULL )
+ {
+ cpExtensions::QT::PropertyWidget* wdg =
+ new cpExtensions::QT::PropertyWidget( NULL );
+ wdg->SetProp( actor );
+ wdg->SetRenderWindow(
+ this->m_UI->Viewer->GetInteractor( 3 )->GetRenderWindow( )
+ );
+ wdg->show( );
- } // fi
+ } // fi
+ }
+ else
+ QMessageBox::critical(
+ this,
+ QMessageBox::tr( "Error showing data" ),
+ QMessageBox::tr( "No known VTK conversion!" )
+ );
+
+ } // fi
+ */
}
// eof - $RCSfile$