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