]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Plugins/BasicFilters/MarchingCubes.cxx
More on graph editor
[cpPlugins.git] / lib / cpPlugins / Plugins / BasicFilters / MarchingCubes.cxx
index cca186c79f44bc03ebeefc8733a4d247f2203bd5..625838c08f6d8d353e139069e713a9b230d98586 100644 (file)
@@ -11,16 +11,10 @@ cpPlugins::BasicFilters::MarchingCubes::
 MarchingCubes( )
   : Superclass( )
 {
-  this->m_ClassName = "cpPlugins::BasicFilters::MarchingCubes";
-  this->m_ClassCategory = "ImageToMeshFilter";
+  this->_AddInput( "Input" );
+  this->_MakeOutput< cpPlugins::Interface::Mesh >( "Output" );
 
-  this->SetNumberOfInputs( 1 );
-  this->SetNumberOfOutputs( 1 );
-  this->_MakeOutput< cpPlugins::Interface::Mesh >( 0 );
-
-  using namespace cpPlugins::Interface;
-  this->m_DefaultParameters.Configure( Parameters::RealList, "Thresholds" );
-  this->m_Parameters = this->m_DefaultParameters;
+  this->m_Parameters->ConfigureAsRealList( "Thresholds" );
 }
 
 // -------------------------------------------------------------------------
@@ -35,7 +29,7 @@ _GenerateData( )
 {
   // Get input
   cpPlugins::Interface::Image* image =
-    this->GetInput< cpPlugins::Interface::Image >( 0 );
+    this->GetInput< cpPlugins::Interface::Image >( "Input" );
   if( image == NULL )
     return( "MarchingCubes: Input data is not a valid image." );
   vtkImageData* vtk_image = image->GetVTK< vtkImageData >( );
@@ -43,7 +37,7 @@ _GenerateData( )
     return( "MarchingCubes: Input does not have a valid VTK conversion." );
 
   std::vector< double > values;
-  this->m_Parameters.GetValueAsRealList( values, "Thresholds" );
+  this->m_Parameters->GetRealList( values, "Thresholds" );
   vtkPolyData* pd = NULL;
   if( vtk_image->GetDataDimension( ) == 2 )
   {
@@ -69,7 +63,7 @@ _GenerateData( )
 
   // Execute filter
   cpPlugins::Interface::Mesh* out =
-    this->GetOutput< cpPlugins::Interface::Mesh >( 0 );
+    this->GetOutput< cpPlugins::Interface::Mesh >( "Output" );
   out->SetVTK( pd );
   return( "" );
 }