]> Creatis software - cpPlugins.git/blob - plugins/MeshSources/CylinderSource.cxx
...
[cpPlugins.git] / plugins / MeshSources / CylinderSource.cxx
1 #include <MeshSources/CylinderSource.h>
2 #include <cpPlugins/DataObjects/Mesh.h>
3
4 #include <vtkCylinderSource.h>
5
6 // -------------------------------------------------------------------------
7 cpPluginsMeshSources::CylinderSource::
8 CylinderSource( )
9   : Superclass( )
10 {
11   this->_ConfigureOutput< cpPlugins::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 cpPluginsMeshSources::CylinderSource::
19 ~CylinderSource( )
20 {
21 }
22
23 // -------------------------------------------------------------------------
24 void cpPluginsMeshSources::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$