X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FPlugins%2FBasicFilters%2FMarchingCubes.cxx;h=388b75e293ef3f4f202d4351fcdf8614cde72877;hb=6ffc11d77924d6ab7e94db95d41105982ac73e00;hp=92538607d9b5b98cf2ab446b298bc5157f4e3bca;hpb=f2f39f66027a98bd8dac50bade5618e0136bbefa;p=cpPlugins.git diff --git a/lib/cpPlugins/Plugins/BasicFilters/MarchingCubes.cxx b/lib/cpPlugins/Plugins/BasicFilters/MarchingCubes.cxx index 9253860..388b75e 100644 --- a/lib/cpPlugins/Plugins/BasicFilters/MarchingCubes.cxx +++ b/lib/cpPlugins/Plugins/BasicFilters/MarchingCubes.cxx @@ -11,13 +11,10 @@ cpPlugins::BasicFilters::MarchingCubes:: MarchingCubes( ) : Superclass( ) { - this->SetNumberOfInputs( 1 ); - this->SetNumberOfOutputs( 1 ); - this->_MakeOutput< cpPlugins::Interface::Mesh >( 0 ); + this->_AddInput( "Input" ); + this->_AddOutput< cpPlugins::Interface::Mesh >( "Output" ); - using namespace cpPlugins::Interface; - this->m_DefaultParameters.Configure( Parameters::RealList, "Thresholds" ); - this->m_Parameters = this->m_DefaultParameters; + this->m_Parameters->ConfigureAsRealList( "Thresholds" ); } // ------------------------------------------------------------------------- @@ -31,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 ) { @@ -65,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( "" ); }