-#include <plugins/MeshFilters/AppendMeshesFilter.h>
-#include <cpPlugins/Mesh.h>
+#include <MeshFilters/AppendMeshesFilter.h>
+#include <cpPlugins/DataObjects/Mesh.h>
#include <vtkAppendPolyData.h>
AppendMeshesFilter( )
: Superclass( )
{
- this->_AddInput( "Input0" );
- this->_AddInput( "Input1" );
- this->_AddInput( "Input2", false );
- this->_AddInput( "Input3", false );
- this->_AddInput( "Input4", false );
- this->_AddInput( "Input5", false );
- this->_AddOutput< cpPlugins::Mesh >( "Output" );
+ typedef cpPlugins::DataObjects::Mesh _TMesh;
+
+ this->_ConfigureInput< _TMesh >( "Inputs", true, true );
+ this->_ConfigureOutput< _TMesh >( "Output" );
}
// -------------------------------------------------------------------------
void cpPluginsMeshFilters::AppendMeshesFilter::
_GenerateData( )
{
- auto m0 = this->GetInputData< vtkPolyData >( "Input0" );
- auto m1 = this->GetInputData< vtkPolyData >( "Input1" );
- auto m2 = this->GetInput( "Input2" );
- auto m3 = this->GetInput( "Input3" );
- auto m4 = this->GetInput( "Input4" );
- auto m5 = this->GetInput( "Input5" );
-
- if( m0 == NULL || m1 == NULL )
- this->_Error( "Invalid inputs." );
-
auto filter = this->_CreateVTK< vtkAppendPolyData >( );
- filter->AddInputData( m0 );
- filter->AddInputData( m1 );
- if( m2 != NULL ) filter->AddInputData( m2->GetVTK< vtkPolyData >( ) );
- if( m3 != NULL ) filter->AddInputData( m3->GetVTK< vtkPolyData >( ) );
- if( m4 != NULL ) filter->AddInputData( m4->GetVTK< vtkPolyData >( ) );
- if( m5 != NULL ) filter->AddInputData( m5->GetVTK< vtkPolyData >( ) );
+ unsigned int nInputs = this->GetInputSize( "Inputs" );
+ for( unsigned int i = 0; i < nInputs; ++i )
+ filter->AddInputData( this->GetInputData< vtkPolyData >( "Inputs", i ) );
filter->Update( );
-
this->GetOutput( "Output" )->SetVTK( filter->GetOutput( ) );
}