]> Creatis software - creaVtk.git/blob - bbtk_creaVtk_PKG/src/bbcreaVtkTrimmedExtrusionFilter.cxx
#3493 MeshManager
[creaVtk.git] / bbtk_creaVtk_PKG / src / bbcreaVtkTrimmedExtrusionFilter.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
5 #include "bbcreaVtkTrimmedExtrusionFilter.h"
6
7 #include "bbcreaVtkPackage.h"
8
9
10
11 namespace bbcreaVtk
12 {
13
14 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,TrimmedExtrusionFilter)
15 BBTK_BLACK_BOX_IMPLEMENTATION(TrimmedExtrusionFilter,bbtk::AtomicBlackBox);
16 //===== 
17 // 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 //===== 
19 void TrimmedExtrusionFilter::Process()
20 {
21
22 // THE MAIN PROCESSING METHOD BODY
23 //   Here we simply set the input 'In' value to the output 'Out'
24 //   And print out the output value
25 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
26 //    void bbSet{Input|Output}NAME(const TYPE&)
27 //    const TYPE& bbGet{Input|Output}NAME() const 
28 //    Where :
29 //    * NAME is the name of the input/output
30 //      (the one provided in the attribute 'name' of the tag 'input')
31 //    * TYPE is the C++ type of the input/output
32 //      (the one provided in the attribute 'type' of the tag 'input')
33 //    bbSetOutputOut( bbGetInputIn() );
34 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
35  
36     if ( (bbGetInputIn()!=NULL) && (bbGetInputIn2()!=NULL) )
37     {
38         if (extrusion!=NULL)
39         {
40             extrusion->Delete();
41         }
42         extrusion = vtkTrimmedExtrusionFilter::New();
43         std::vector<double> dir=bbGetInputDirection();
44         if (dir.size()==3)
45         {
46             extrusion->SetExtrusionDirection( dir[0],dir[1],dir[2] );
47         } else {
48             extrusion->SetExtrusionDirection( 1,0,0 );
49         }
50         extrusion->SetInputData( bbGetInputIn() );
51         extrusion->SetTrimSurfaceData( bbGetInputIn2() );
52         if (bbGetInputType()==0)
53         {
54             extrusion->SetExtrusionStrategy(vtkTrimmedExtrusionFilter::BOUNDARY_EDGES);
55         } else {
56             extrusion->SetExtrusionStrategy(vtkTrimmedExtrusionFilter::ALL_EDGES);
57         }
58         extrusion->Update();
59         bbSetOutputOut( extrusion->GetTrimSurface() );
60     } else {
61         printf("EED  Warning!!!  TrimmedExtrusionFilter::Process      Either In or In2 is missing \n");
62     } // if bbGetInputIn
63 }
64
65 //===== 
66 // 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)
67 //===== 
68 void TrimmedExtrusionFilter::bbUserSetDefaultValues()
69 {
70 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
71 //    Here we initialize the input 'In' to 0
72
73 // ------ Not exist in windows  old VTK 8.1 version ---------
74     extrusion=NULL;
75     bbSetInputIn(NULL);
76     bbSetInputIn2(NULL);
77     bbSetInputType(0);
78     std::vector<double> dir;
79     dir.push_back(1);
80     dir.push_back(0);
81     dir.push_back(0);
82     bbSetInputDirection( dir );
83 }
84
85 //===== 
86 // 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)
87 //===== 
88 void TrimmedExtrusionFilter::bbUserInitializeProcessing()
89 {
90 //  THE INITIALIZATION METHOD BODY :
91 //    Here does nothing 
92 //    but this is where you should allocate the internal/output pointers 
93 //    if any
94 }
95
96 //===== 
97 // 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)
98 //===== 
99 void TrimmedExtrusionFilter::bbUserFinalizeProcessing()
100 {
101 //  THE FINALIZATION METHOD BODY :
102 //    Here does nothing 
103 //    but this is where you should desallocate the internal/output pointers 
104 //    if any
105 }
106
107 } // EO namespace bbcreaVtk
108
109