+
+// -------------------------------------------------------------------------
+void App_cpPipelineEditor::
+_ExecFilter( const std::string& filter_name )
+{
+ if( this->m_Workspace != NULL )
+ {
+ // Update filter, if needed
+ std::string err = this->m_Workspace->Execute( filter_name );
+ if( err != "" )
+ QMessageBox::critical(
+ this,
+ QMessageBox::tr( "Error executing filter" ),
+ QMessageBox::tr( err.c_str( ) )
+ );
+
+ } // fi
+}
+
+// -------------------------------------------------------------------------
+void App_cpPipelineEditor::
+_ShowFilterOutput(
+ const std::string& filter_name, const std::string& output_name
+ )
+{
+ typedef cpPlugins::Interface::DataObject _TDataObject;
+
+ // Update filter, if needed
+ this->_ExecFilter( filter_name );
+
+ // Get output
+ auto filter = this->m_Workspace->GetFilter( filter_name );
+ if( filter != NULL )
+ {
+ auto output = filter->GetOutputData< _TDataObject >( output_name );
+ if( output != NULL )
+ {
+ std::string data_name = output_name + "@" + filter_name;
+ if( this->m_UI->Viewer->AddData( output, data_name, "" ) )
+ {
+ if( this->m_UI->Viewer->GetNumberOfData( ) > 1 )
+ this->m_UI->Viewer->SetDataColor( data_name, 1, 0, 0 );
+ else
+ this->m_UI->Viewer->SetMainImage( data_name );
+ this->m_UI->Viewer->ShowData( data_name );
+ }
+ else
+ QMessageBox::critical(
+ this,
+ QMessageBox::tr( "Error showing data" ),
+ QMessageBox::tr( "No known VTK conversion!" )
+ );
+
+ } // fi
+
+ } // fi
+}
+