]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Plugins/BasicFilters/SphereMeshSource.cxx
Parameters are now part of the pipeline update process
[cpPlugins.git] / lib / cpPlugins / Plugins / BasicFilters / SphereMeshSource.cxx
index 8ba50cc7459a0a0aaccf21a01a3c817f8f73fa80..78aff5fbebf3ec19d0e5e0db59d279444a9f3c3f 100644 (file)
@@ -14,16 +14,11 @@ SphereMeshSource( )
   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;
+  double point[ 3 ] = { double( 0 ) };
+  this->m_Parameters->ConfigureAsPoint( "Center", 3, point );
+  this->m_Parameters->ConfigureAsReal( "Radius", 1 );
+  this->m_Parameters->ConfigureAsUint( "PhiResolution", 8 );
+  this->m_Parameters->ConfigureAsUint( "ThetaResolution", 8 );
 }
 
 // -------------------------------------------------------------------------
@@ -37,11 +32,11 @@ std::string cpPlugins::BasicFilters::SphereMeshSource::
 _GenerateData( )
 {
   itk::Point< double, 3 > center =
-    this->m_Parameters.GetValueAsPoint< itk::Point< double, 3 > >( "Center" );
-  center.Fill( double( 0 ) ); // TODO
-  double radius = this->m_Parameters.GetValueAsReal( "Radius" );
-  unsigned int phi = this->m_Parameters.GetValueAsUint( "PhiResolution" );
-  unsigned int theta = this->m_Parameters.GetValueAsUint( "ThetaResolution" );
+    this->m_Parameters->GetPoint< itk::Point< double, 3 > >( "Center", 3 );
+  // TODO: center.Fill( double( 0 ) ); // TODO
+  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 ] );