#include "PipelineEditor.h"
#include "ui_PipelineEditor.h"
+#include <QMessageBox>
+
#include <cpPipelineEditor/Editor.h>
#include <cpExtensions/QT/PropertyWidget.h>
-#include <QMessageBox>
+
+#include <vtkImageData.h>
+#include <vtkPolyData.h>
#include <vtkRenderWindowInteractor.h>
// -------------------------------------------------------------------------
const std::string& filter_name, const std::string& output_name
)
{
- typedef cpPlugins::DataObject _TDataObject;
-
// Update filter, if needed
this->_ExecFilter( filter_name );
auto filter = this->m_Workspace.GetFilter( filter_name );
if( filter != NULL )
{
- auto output = filter->GetOutputData( output_name );
- if( output != NULL )
+ auto id = filter->GetOutputData< vtkImageData >( output_name );
+ auto md = filter->GetOutputData< vtkPolyData >( output_name );
+ if( id != NULL )
{
- std::string data_name = output_name + "@" + filter_name;
- auto idata = output->GetVTK< vtkImageData >( );
- auto mdata = output->GetVTK< vtkPolyData >( );
- if( idata != NULL )
- {
- if( this->m_UI->Viewer->AddData( idata, 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->_Block( );
- this->m_UI->Viewer->ShowData( data_name );
- this->_UnBlock( );
-
- } // fi
- }
- else if( mdata != NULL )
- {
- if( this->m_UI->Viewer->AddData( mdata, data_name ) )
- {
- this->m_UI->Viewer->SetDataColor( data_name, 1, 0, 0 );
- this->_Block( );
- this->m_UI->Viewer->ShowData( data_name );
- this->_UnBlock( );
-
- } // fi
- }
- else
- QMessageBox::critical(
- this,
- QMessageBox::tr( "Error showing data" ),
- QMessageBox::tr( "No known VTK conversion!" )
- );
-
- } // fi
-
- } // fi
+ 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( );
+ }
+ 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 filter." )
+ );
}
// -------------------------------------------------------------------------
const std::string& filter_name, const std::string& output_name
)
{
+ /*
// Get output
auto filter = this->m_Workspace.GetFilter( filter_name );
if( filter != NULL )
} // fi
} // fi
+ */
}
// -------------------------------------------------------------------------
const std::string& filter_name, const std::string& output_name
)
{
+ /*
// Get output
auto filter = this->m_Workspace.GetFilter( filter_name );
if( filter != NULL )
);
} // fi
+ */
}
// eof - $RCSfile$