]> Creatis software - cpPlugins.git/blobdiff - plugins/cpPluginsMeshFilters/AppendMeshesFilter.cxx
...
[cpPlugins.git] / plugins / cpPluginsMeshFilters / AppendMeshesFilter.cxx
index 4029c9c9d249895dc36f3d890e59f6066265b5be..b3fd5a6f45c8cdc2c1c36ac8bf5fb135e5ecd2d8 100644 (file)
@@ -24,15 +24,18 @@ cpPluginsMeshFilters::AppendMeshesFilter::
 }
 
 // -------------------------------------------------------------------------
-std::string cpPluginsMeshFilters::AppendMeshesFilter::
+void cpPluginsMeshFilters::AppendMeshesFilter::
 _GenerateData( )
 {
-  auto m0 = this->GetInputData( "Input0" )->GetVTK< vtkPolyData >( );
-  auto m1 = this->GetInputData( "Input1" )->GetVTK< vtkPolyData >( );
-  auto m2 = this->GetInputData( "Input2" );
-  auto m3 = this->GetInputData( "Input3" );
-  auto m4 = this->GetInputData( "Input4" );
-  auto m5 = this->GetInputData( "Input5" );
+  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 );
@@ -43,8 +46,7 @@ _GenerateData( )
   if( m5 != NULL ) filter->AddInputData( m5->GetVTK< vtkPolyData >( ) );
   filter->Update( );
 
-  this->GetOutputData( "Output" )->SetVTK( filter->GetOutput( ) );
-  return( "" );
+  this->GetOutput( "Output" )->SetVTK( filter->GetOutput( ) );
 }
 
 // eof - $RCSfile$