]> Creatis software - cpPlugins.git/blob - plugins/MeshSources/CylinderSource.cxx
47d7fc6da6d3b74a7d33937ba1b525375d66045f
[cpPlugins.git] / plugins / MeshSources / CylinderSource.cxx
1 #include <plugins/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" );
13   this->m_Parameters.ConfigureAsReal( "Radius" );
14   this->m_Parameters.ConfigureAsUint( "Resolution" );
15   this->m_Parameters.SetReal( "Height", 1 );
16   this->m_Parameters.SetReal( "Radius", 1 );
17   this->m_Parameters.SetUint( "Resolution", 8 );
18 }
19
20 // -------------------------------------------------------------------------
21 cpPluginsMeshSources::CylinderSource::
22 ~CylinderSource( )
23 {
24 }
25
26 // -------------------------------------------------------------------------
27 void cpPluginsMeshSources::CylinderSource::
28 _GenerateData( )
29 {
30   auto src = this->_CreateVTK< vtkCylinderSource >( );
31   src->SetHeight( this->m_Parameters.GetReal( "Height" ) );
32   src->SetRadius( this->m_Parameters.GetReal( "Radius" ) );
33   src->SetResolution( this->m_Parameters.GetUint( "Resolution" ) );
34   src->Update( );
35   this->GetOutput( "Output" )->SetVTK( src->GetOutput( ) );
36 }
37
38 // eof - $RCSfile$