]> Creatis software - cpPlugins.git/blob - plugins/VTKFilters/CylinderSource.cxx
d8939cf16bab2dbaff069bede7f574f3bc622ccb
[cpPlugins.git] / plugins / VTKFilters / CylinderSource.cxx
1 #include <VTKFilters/CylinderSource.h>
2 #include <cpInstances/DataObjects/Mesh.h>
3
4 #include <vtkCylinderSource.h>
5
6 // -------------------------------------------------------------------------
7 cpPluginsVTKFilters::CylinderSource::
8 CylinderSource( )
9   : Superclass( )
10 {
11   this->_ConfigureOutput< cpInstances::DataObjects::Mesh >( "Output" );
12   this->m_Parameters.ConfigureAsReal( "Height", 1 );
13   this->m_Parameters.ConfigureAsReal( "Radius", 1 );
14   this->m_Parameters.ConfigureAsUint( "Resolution", 8 );
15 }
16
17 // -------------------------------------------------------------------------
18 cpPluginsVTKFilters::CylinderSource::
19 ~CylinderSource( )
20 {
21 }
22
23 // -------------------------------------------------------------------------
24 void cpPluginsVTKFilters::CylinderSource::
25 _GenerateData( )
26 {
27   auto src = this->_CreateVTK< vtkCylinderSource >( );
28   src->SetHeight( this->m_Parameters.GetReal( "Height" ) );
29   src->SetRadius( this->m_Parameters.GetReal( "Radius" ) );
30   src->SetResolution( this->m_Parameters.GetUint( "Resolution" ) );
31   src->Update( );
32   this->GetOutput( "Output" )->SetVTK( src->GetOutput( ) );
33 }
34
35 // eof - $RCSfile$