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