X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=plugins%2FMeshFilters%2FAppendMeshesFilter.cxx;h=16f1f8032b7ce8830deff0354c87b3f278bdbec4;hb=db0a767418f78b371c1e4fb0db00e6b75df74ff3;hp=0d640e84cbb93fdeb01247d4c3c6859e65f5e742;hpb=49d2d7db538d60008b9a5701ea8f26bb19997a82;p=cpPlugins.git diff --git a/plugins/MeshFilters/AppendMeshesFilter.cxx b/plugins/MeshFilters/AppendMeshesFilter.cxx index 0d640e8..16f1f80 100644 --- a/plugins/MeshFilters/AppendMeshesFilter.cxx +++ b/plugins/MeshFilters/AppendMeshesFilter.cxx @@ -10,12 +10,7 @@ AppendMeshesFilter( ) { typedef cpPlugins::DataObjects::Mesh _TMesh; - this->_ConfigureInput< _TMesh >( "Input0", true, false ); - this->_ConfigureInput< _TMesh >( "Input1", true, false ); - this->_ConfigureInput< _TMesh >( "Input2", false, false ); - this->_ConfigureInput< _TMesh >( "Input3", false, false ); - this->_ConfigureInput< _TMesh >( "Input4", false, false ); - this->_ConfigureInput< _TMesh >( "Input5", false, false ); + this->_ConfigureInput< _TMesh >( "Inputs", true, true ); this->_ConfigureOutput< _TMesh >( "Output" ); } @@ -29,25 +24,11 @@ cpPluginsMeshFilters::AppendMeshesFilter:: 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( ) ); }