X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=bbtk_creaVtk_PKG%2Fsrc%2FbbcreaVtkCutter.cxx;h=0e4f85af50e1e4d59188d59209919b8b8d7c78b2;hb=8381c91a83a3c1d6f5c8f5bc3c7bc7a213673213;hp=d8d148c36dbf158998e04025a6083de5c36433bd;hpb=fc7c81774c8e057eb6d9a2ed428bccd35bd9633c;p=creaVtk.git diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkCutter.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkCutter.cxx index d8d148c..0e4f85a 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkCutter.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkCutter.cxx @@ -4,7 +4,6 @@ #include "bbcreaVtkCutter.h" #include "bbcreaVtkPackage.h" #include "vtkCutter.h" -#include "vtkStripper.h" namespace bbcreaVtk { @@ -31,43 +30,32 @@ void Cutter::Process() // bbSetOutputOut( bbGetInputIn() ); // std::cout << "Output value = " <SetInputData( bbGetInputIn() ); - cutter->SetCutFunction( bbGetInputImplicitFunction() ); - cutter->Update(); - - strips = vtkStripper::New(); - strips->SetInputData( cutter->GetOutput() ); - strips->Update(); - poly = vtkPolyData::New(); - poly->SetPoints( strips->GetOutput()->GetPoints() ); - poly->SetPolys( strips->GetOutput()->GetLines() ); - -// bbSetOutputOut( cutter->GetOutput() ); - bbSetOutputOut( poly ); - + if ( (bbGetInputActive()==true) && (bbGetInputIn()!=NULL) ) + { + vtkCutter *cutter; + cutter = vtkCutter::New(); + cutter->SetInputData( bbGetInputIn() ); + cutter->SetCutFunction( bbGetInputImplicitFunction() ); + cutter->Update(); + bbSetOutputOut( cutter->GetOutput() ); + } else { + bbSetOutputOut( NULL ); + } } + //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== void Cutter::bbUserSetDefaultValues() { - // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX // Here we initialize the input 'In' to 0 // bbSetInputIn(NULL); - + bbSetInputActive( true ); + bbSetOutputOut( NULL ); } //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) @@ -94,7 +82,7 @@ void Cutter::bbUserFinalizeProcessing() // if any } -} -// EO namespace bbcreaVtk + +}// EO namespace bbcreaVtk