2 // 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)
4 #include "bbcreaVtkCutter.h"
5 #include "bbcreaVtkPackage.h"
7 #include "vtkStripper.h"
13 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,Cutter)
14 BBTK_BLACK_BOX_IMPLEMENTATION(Cutter,bbtk::AtomicBlackBox);
16 // 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)
18 void Cutter::Process()
21 // THE MAIN PROCESSING METHOD BODY
22 // Here we simply set the input 'In' value to the output 'Out'
23 // And print out the output value
24 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
25 // void bbSet{Input|Output}NAME(const TYPE&)
26 // const TYPE& bbGet{Input|Output}NAME() const
28 // * NAME is the name of the input/output
29 // (the one provided in the attribute 'name' of the tag 'input')
30 // * TYPE is the C++ type of the input/output
31 // (the one provided in the attribute 'type' of the tag 'input')
32 // bbSetOutputOut( bbGetInputIn() );
33 // std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
40 // https://kitware.github.io/vtk-examples/site/Cxx/VisualizationAlgorithms/Cutter/
47 plane = vtkPlane::New();
48 plane->SetOrigin(0,0,30);
49 plane->SetNormal(0,0,1);
51 cutter = vtkCutter::New();
52 cutter->SetInputData( bbGetInputIn() );
53 cutter->SetCutFunction( plane );
56 strips = vtkStripper::New();
57 strips->SetInputData( cutter->GetOutput() );
59 poly = vtkPolyData::New();
60 poly->SetPoints( strips->GetOutput()->GetPoints() );
61 poly->SetPolys( strips->GetOutput()->GetLines() );
63 bbSetOutputOut( poly );
64 // bbSetOutputOut( cutter->GetOutput() );
69 // 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)
71 void Cutter::bbUserSetDefaultValues()
74 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
75 // Here we initialize the input 'In' to 0
76 // bbSetInputIn(NULL);
80 // 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)
82 void Cutter::bbUserInitializeProcessing()
85 // THE INITIALIZATION METHOD BODY :
87 // but this is where you should allocate the internal/output pointers
93 // 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)
95 void Cutter::bbUserFinalizeProcessing()
98 // THE FINALIZATION METHOD BODY :
100 // but this is where you should desallocate the internal/output pointers
105 // EO namespace bbcreaVtk