]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Plugins/BasicFilters/Cutter.cxx
...
[cpPlugins.git] / lib / cpPlugins / Plugins / BasicFilters / Cutter.cxx
index d0907b41e6429badcc34a3c3cffeb474bc9afb46..a6a916cbd48f129f92bb30ef916236473c3d161e 100644 (file)
@@ -15,7 +15,7 @@ Cutter( )
 {
   this->_AddInput( "InputMesh" );
   this->_AddInput( "InputFunction" );
-  this->_MakeOutput< cpPlugins::Interface::Mesh >( "Output" );
+  this->_AddOutput< cpPlugins::Interface::Mesh >( "Output" );
 }
 
 // -------------------------------------------------------------------------
@@ -29,15 +29,11 @@ std::string cpPlugins::BasicFilters::Cutter::
 _GenerateData( )
 {
   // Get inputs
-  cpPlugins::Interface::Mesh* mesh =
-    this->GetInput< cpPlugins::Interface::Mesh >( "InputMesh" );
-  cpPlugins::Interface::ImplicitFunction* function =
-    this->GetInput< cpPlugins::Interface::ImplicitFunction >(
+  auto mesh = this->GetInputData< cpPlugins::Interface::Mesh >( "InputMesh" );
+  auto function =
+    this->GetInputData< cpPlugins::Interface::ImplicitFunction >(
       "InputFunction"
       );
-  if( function == NULL )
-    return( "Cutter: Input data 1 is not a valid implicit function." );
-
   vtkCutter* cutter = this->_CreateVTK< vtkCutter >( );
   cutter->DebugOn( );
   cutter->SetInputData( mesh->GetVTK< vtkPolyData >( ) );
@@ -47,8 +43,7 @@ _GenerateData( )
   cutter->Update( );
 
   // Execute filter
-  cpPlugins::Interface::Mesh* out =
-    this->GetOutput< cpPlugins::Interface::Mesh >( "Output" );
+  auto out = this->GetOutputData< cpPlugins::Interface::Mesh >( "Output" );
   out->SetVTK( cutter->GetOutput( ) );
 
   return( "" );