X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FPlugins%2FBasicFilters%2FSphereMeshSource.cxx;h=cad8eb80535cca632641a426017003274788195f;hb=da7cadeecad8bf04551591e9cb9e86977e2cbb47;hp=e3b582dfbf7bfcb788f5735e448b72bfc61fa41a;hpb=f989f3f91e2a17832652e345928eac26dcfb6d52;p=cpPlugins.git diff --git a/lib/cpPlugins/Plugins/BasicFilters/SphereMeshSource.cxx b/lib/cpPlugins/Plugins/BasicFilters/SphereMeshSource.cxx index e3b582d..cad8eb8 100644 --- a/lib/cpPlugins/Plugins/BasicFilters/SphereMeshSource.cxx +++ b/lib/cpPlugins/Plugins/BasicFilters/SphereMeshSource.cxx @@ -10,23 +10,16 @@ cpPlugins::BasicFilters::SphereMeshSource:: SphereMeshSource( ) : Superclass( ) { - this->m_ClassName = "cpPlugins::BasicFilters::SphereMeshSource"; - this->m_ClassCategory = "MeshSource"; - - this->SetNumberOfInputs( 0 ); - this->SetNumberOfOutputs( 1 ); - this->_MakeOutput< cpPlugins::Interface::Mesh >( 0 ); - - using namespace cpPlugins::Interface; - this->m_DefaultParameters.Configure( Parameters::Point, "Center" ); - this->m_DefaultParameters.Configure( Parameters::Real, "Radius" ); - this->m_DefaultParameters.Configure( Parameters::Uint, "PhiResolution" ); - this->m_DefaultParameters.Configure( Parameters::Uint, "ThetaResolution" ); - this->m_DefaultParameters.SetValueAsPoint( "Center", 3, 0, 0, 0 ); - this->m_DefaultParameters.SetValueAsReal( "Radius", 1 ); - this->m_DefaultParameters.SetValueAsUint( "PhiResolution", 10 ); - this->m_DefaultParameters.SetValueAsUint( "ThetaResolution", 10 ); - this->m_Parameters = this->m_DefaultParameters; + this->_AddInput( "Center" ); + this->_AddOutput< cpPlugins::Interface::Mesh >( "Output" ); + + this->m_Parameters->ConfigureAsReal( "Radius" ); + this->m_Parameters->ConfigureAsUint( "PhiResolution" ); + this->m_Parameters->ConfigureAsUint( "ThetaResolution" ); + + this->m_Parameters->SetReal( "Radius", 1 ); + this->m_Parameters->SetUint( "PhiResolution", 8 ); + this->m_Parameters->SetUint( "ThetaResolution", 8 ); } // ------------------------------------------------------------------------- @@ -39,11 +32,15 @@ cpPlugins::BasicFilters::SphereMeshSource:: std::string cpPlugins::BasicFilters::SphereMeshSource:: _GenerateData( ) { - itk::Point< double, 3 > center = - this->m_Parameters.GetValueAsPoint< itk::Point< double, 3 > >( "Center" ); - double radius = this->m_Parameters.GetValueAsReal( "Radius" ); - unsigned int phi = this->m_Parameters.GetValueAsUint( "PhiResolution" ); - unsigned int theta = this->m_Parameters.GetValueAsUint( "ThetaResolution" ); + itk::Point< double, 3 > center; + center.Fill( double( 0 ) ); + /* TODO + itk::Point< double, 3 > center = + this->m_Parameters->GetPoint< itk::Point< double, 3 > >( "Center", 3 ); + */ + double radius = this->m_Parameters->GetReal( "Radius" ); + unsigned int phi = this->m_Parameters->GetUint( "PhiResolution" ); + unsigned int theta = this->m_Parameters->GetUint( "ThetaResolution" ); vtkSphereSource* src = this->_CreateVTK< vtkSphereSource >( ); src->SetCenter( center[ 0 ], center[ 1 ], center[ 2 ] ); @@ -54,7 +51,7 @@ _GenerateData( ) // Execute filter cpPlugins::Interface::Mesh* out = - this->GetOutput< cpPlugins::Interface::Mesh >( 0 ); + this->GetOutput< cpPlugins::Interface::Mesh >( "Output" ); out->SetVTK( src->GetOutput( ) ); return( "" ); }