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 "bbcreaVtkExtrusion.h"
5 #include "bbcreaVtkPackage.h"
7 /* ------ Not exist in windows old VTK version ---------
8 #include <vtkTrimmedExtrusionFilter.h>
11 #include <vtkLinearExtrusionFilter.h>
12 #include <vtkTriangleFilter.h>
17 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,Extrusion)
18 BBTK_BLACK_BOX_IMPLEMENTATION(Extrusion,bbtk::AtomicBlackBox);
20 // 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)
22 void Extrusion::Process()
25 // THE MAIN PROCESSING METHOD BODY
26 // Here we simply set the input 'In' value to the output 'Out'
27 // And print out the output value
28 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
29 // void bbSet{Input|Output}NAME(const TYPE&)
30 // const TYPE& bbGet{Input|Output}NAME() const
32 // * NAME is the name of the input/output
33 // (the one provided in the attribute 'name' of the tag 'input')
34 // * TYPE is the C++ type of the input/output
35 // (the one provided in the attribute 'type' of the tag 'input')
36 // bbSetOutputOut( bbGetInputIn() );
37 // std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
39 if (bbGetInputIn()!=NULL)
41 if ((bbGetInputType()>=0) && (bbGetInputType()<=1))
43 /* ------ Not exist in windows old VTK version ---------
44 vtkTrimmedExtrusionFilter *extrusion = vtkTrimmedExtrusionFilter::New();
45 extrusion->SetExtrusionDirection(1,1,1);
46 extrusion->SetInputData( bbGetInputIn() );
47 extrusion->SetTrimSurfaceData( bbGetInputIn2() );
48 if (bbGetInputType()==0)
50 extrusion->SetExtrusionStrategy(vtkTrimmedExtrusionFilter::BOUNDARY_EDGES);
52 extrusion->SetExtrusionStrategy(vtkTrimmedExtrusionFilter::ALL_EDGES);
55 bbSetOutputOut( extrusion->GetTrimSurface() );
59 if (bbGetInputType()==2)
61 // Apply linear extrusion
62 vtkLinearExtrusionFilter *extrude=vtkLinearExtrusionFilter::New();
63 extrude->SetInputData( bbGetInputIn() );
64 extrude->SetExtrusionTypeToNormalExtrusion();
65 extrude->SetVector(0, -1, 0);
66 extrude->SetScaleFactor(-7);
68 vtkTriangleFilter *triangleFilter = vtkTriangleFilter::New();
69 triangleFilter->SetInputData( extrude->GetOutput() );
70 triangleFilter->Update( );
71 bbSetOutputOut( triangleFilter->GetOutput() );
78 // 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)
80 void Extrusion::bbUserSetDefaultValues()
83 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
84 // Here we initialize the input 'In' to 0
90 // 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)
92 void Extrusion::bbUserInitializeProcessing()
95 // THE INITIALIZATION METHOD BODY :
97 // but this is where you should allocate the internal/output pointers
103 // 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)
105 void Extrusion::bbUserFinalizeProcessing()
108 // THE FINALIZATION METHOD BODY :
110 // but this is where you should desallocate the internal/output pointers
115 // EO namespace bbcreaVtk