X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FPlugins%2FBasicFilters%2FCutter.cxx;h=a6a916cbd48f129f92bb30ef916236473c3d161e;hb=a89305e04527ebe2e81d0d1a62bbe34e0d35a141;hp=e3f1e2b98517296be15f5685f8fb3f8f28ef4c1a;hpb=8db7a40f2ef8530457959a51a4d2a7f012d0b7a3;p=cpPlugins.git diff --git a/lib/cpPlugins/Plugins/BasicFilters/Cutter.cxx b/lib/cpPlugins/Plugins/BasicFilters/Cutter.cxx index e3f1e2b..a6a916c 100644 --- a/lib/cpPlugins/Plugins/BasicFilters/Cutter.cxx +++ b/lib/cpPlugins/Plugins/BasicFilters/Cutter.cxx @@ -13,9 +13,9 @@ cpPlugins::BasicFilters::Cutter:: Cutter( ) : Superclass( ) { - this->SetNumberOfInputs( 2 ); - this->SetNumberOfOutputs( 1 ); - this->_MakeOutput< cpPlugins::Interface::Mesh >( 0 ); + this->_AddInput( "InputMesh" ); + this->_AddInput( "InputFunction" ); + this->_AddOutput< cpPlugins::Interface::Mesh >( "Output" ); } // ------------------------------------------------------------------------- @@ -29,13 +29,11 @@ std::string cpPlugins::BasicFilters::Cutter:: _GenerateData( ) { // Get inputs - cpPlugins::Interface::Mesh* mesh = - this->GetInput< cpPlugins::Interface::Mesh >( 0 ); - cpPlugins::Interface::ImplicitFunction* function = - this->GetInput< cpPlugins::Interface::ImplicitFunction >( 1 ); - if( function == NULL ) - return( "Cutter: Input data 1 is not a valid implicit function." ); - + auto mesh = this->GetInputData< cpPlugins::Interface::Mesh >( "InputMesh" ); + auto function = + this->GetInputData< cpPlugins::Interface::ImplicitFunction >( + "InputFunction" + ); vtkCutter* cutter = this->_CreateVTK< vtkCutter >( ); cutter->DebugOn( ); cutter->SetInputData( mesh->GetVTK< vtkPolyData >( ) ); @@ -45,8 +43,7 @@ _GenerateData( ) cutter->Update( ); // Execute filter - cpPlugins::Interface::Mesh* out = - this->GetOutput< cpPlugins::Interface::Mesh >( 0 ); + auto out = this->GetOutputData< cpPlugins::Interface::Mesh >( "Output" ); out->SetVTK( cutter->GetOutput( ) ); return( "" );