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