]> Creatis software - cpPlugins.git/blob - plugins/cpPluginsMeshFilters/AppendMeshesFilter.cxx
..
[cpPlugins.git] / plugins / cpPluginsMeshFilters / AppendMeshesFilter.cxx
1 #include <cpPluginsMeshFilters/AppendMeshesFilter.h>
2 #include <cpPlugins/Mesh.h>
3
4 #include <vtkAppendPolyData.h>
5
6 // -------------------------------------------------------------------------
7 cpPluginsMeshFilters::AppendMeshesFilter::
8 AppendMeshesFilter( )
9   : Superclass( )
10 {
11   this->_AddInput( "Input0" );
12   this->_AddInput( "Input1" );
13   this->_AddInput( "Input2", false );
14   this->_AddInput( "Input3", false );
15   this->_AddInput( "Input4", false );
16   this->_AddInput( "Input5", false );
17   this->_AddOutput< cpPlugins::Mesh >( "Output" );
18 }
19
20 // -------------------------------------------------------------------------
21 cpPluginsMeshFilters::AppendMeshesFilter::
22 ~AppendMeshesFilter( )
23 {
24 }
25
26 // -------------------------------------------------------------------------
27 std::string cpPluginsMeshFilters::AppendMeshesFilter::
28 _GenerateData( )
29 {
30   auto m0 = this->GetInputData( "Input0" )->GetVTK< vtkPolyData >( );
31   auto m1 = this->GetInputData( "Input1" )->GetVTK< vtkPolyData >( );
32   auto m2 = this->GetInputData( "Input2" );
33   auto m3 = this->GetInputData( "Input3" );
34   auto m4 = this->GetInputData( "Input4" );
35   auto m5 = this->GetInputData( "Input5" );
36
37   auto filter = this->_CreateVTK< vtkAppendPolyData >( );
38   filter->AddInputData( m0 );
39   filter->AddInputData( m1 );
40   if( m2 != NULL ) filter->AddInputData( m2->GetVTK< vtkPolyData >( ) );
41   if( m3 != NULL ) filter->AddInputData( m3->GetVTK< vtkPolyData >( ) );
42   if( m4 != NULL ) filter->AddInputData( m4->GetVTK< vtkPolyData >( ) );
43   if( m5 != NULL ) filter->AddInputData( m5->GetVTK< vtkPolyData >( ) );
44   filter->Update( );
45
46   this->GetOutputData( "Output" )->SetVTK( filter->GetOutput( ) );
47   return( "" );
48 }
49
50 // eof - $RCSfile$