]> Creatis software - creaVtk.git/blob - bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataNormals.cxx
#3486 PolyDataNormals box
[creaVtk.git] / bbtk_creaVtk_PKG / src / bbcreaVtkPolyDataNormals.cxx
1 //===== 
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)
3 //===== 
4 #include "bbcreaVtkPolyDataNormals.h"
5 #include "bbcreaVtkPackage.h"
6
7 #include <vtkPolyDataNormals.h>
8
9
10 namespace bbcreaVtk
11 {
12
13 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,PolyDataNormals)
14 BBTK_BLACK_BOX_IMPLEMENTATION(PolyDataNormals,bbtk::AtomicBlackBox);
15 //===== 
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)
17 //===== 
18 void PolyDataNormals::Process()
19 {
20
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 
27 //    Where :
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;
34     if (bbGetInputIn()!=NULL)
35     {
36         vtkPolyDataNormals* normal = vtkPolyDataNormals::New();
37         normal->SetInputData( bbGetInputIn() );
38         if (bbGetInputComputeType()==0)
39         {
40             normal->ComputeCellNormalsOn();
41         } else {
42             normal->ComputePointNormalsOn();
43         }
44         //        normal->SetFeatureAngle(60.0);
45         normal->Update();
46         bbSetOutputOut( normal->GetOutput() );
47     } // In
48 }
49 //===== 
50 // 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)
51 //===== 
52 void PolyDataNormals::bbUserSetDefaultValues()
53 {
54 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
55 //    Here we initialize the input 'In' to 0
56    bbSetInputIn(NULL);
57 }
58 //===== 
59 // 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)
60 //===== 
61 void PolyDataNormals::bbUserInitializeProcessing()
62 {
63
64 //  THE INITIALIZATION METHOD BODY :
65 //    Here does nothing 
66 //    but this is where you should allocate the internal/output pointers 
67 //    if any 
68
69   
70 }
71 //===== 
72 // 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)
73 //===== 
74 void PolyDataNormals::bbUserFinalizeProcessing()
75 {
76
77 //  THE FINALIZATION METHOD BODY :
78 //    Here does nothing 
79 //    but this is where you should desallocate the internal/output pointers 
80 //    if any
81   
82 }
83 }
84 // EO namespace bbcreaVtk
85
86