]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Plugins/BasicFilters/MarchingCubes.cxx
MAC compilation issues solved... Now some tests please
[cpPlugins.git] / lib / cpPlugins / Plugins / BasicFilters / MarchingCubes.cxx
index cca186c79f44bc03ebeefc8733a4d247f2203bd5..388b75e293ef3f4f202d4351fcdf8614cde72877 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->_AddOutput< 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" );
 }
 
 // -------------------------------------------------------------------------
@@ -34,16 +28,13 @@ std::string cpPlugins::BasicFilters::MarchingCubes::
 _GenerateData( )
 {
   // Get input
-  cpPlugins::Interface::Image* image =
-    this->GetInput< cpPlugins::Interface::Image >( 0 );
-  if( image == NULL )
-    return( "MarchingCubes: Input data is not a valid image." );
+  auto image = this->GetInputData< cpPlugins::Interface::Image >( "Input" );
   vtkImageData* vtk_image = image->GetVTK< vtkImageData >( );
   if( vtk_image == NULL )
     return( "MarchingCubes: Input does not have a valid VTK conversion." );
 
-  std::vector< double > values;
-  this->m_Parameters.GetValueAsRealList( values, "Thresholds" );
+  std::vector< double > values =
+    this->m_Parameters->GetRealList( "Thresholds" );
   vtkPolyData* pd = NULL;
   if( vtk_image->GetDataDimension( ) == 2 )
   {
@@ -68,8 +59,7 @@ _GenerateData( )
     return( "MarchingCubes: Input data does not have a valid dimension." );
 
   // Execute filter
-  cpPlugins::Interface::Mesh* out =
-    this->GetOutput< cpPlugins::Interface::Mesh >( 0 );
+  auto out = this->GetOutputData< cpPlugins::Interface::Mesh >( "Output" );
   out->SetVTK( pd );
   return( "" );
 }