]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbcreaMaracasVisuChangeInformationPoint3Dto2D.cxx
#3262 creaMaracasVisu Feature New Normal - Export LookupTable fron ColorLayerImageV...
[creaMaracasVisu.git] / bbtk / src / bbcreaMaracasVisuChangeInformationPoint3Dto2D.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 "bbcreaMaracasVisuChangeInformationPoint3Dto2D.h"
5 #include "bbcreaMaracasVisuPackage.h"
6 namespace bbcreaMaracasVisu
7 {
8
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ChangeInformationPoint3Dto2D)
10 BBTK_BLACK_BOX_IMPLEMENTATION(ChangeInformationPoint3Dto2D,bbtk::AtomicBlackBox);
11 //===== 
12 // 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)
13 //===== 
14 void ChangeInformationPoint3Dto2D::Process()
15 {
16
17 // THE MAIN PROCESSING METHOD BODY
18 //   Here we simply set the input 'In' value to the output 'Out'
19 //   And print out the output value
20 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
21 //    void bbSet{Input|Output}NAME(const TYPE&)
22 //    const TYPE& bbGet{Input|Output}NAME() const 
23 //    Where :
24 //    * NAME is the name of the input/output
25 //      (the one provided in the attribute 'name' of the tag 'input')
26 //    * TYPE is the C++ type of the input/output
27 //      (the one provided in the attribute 'type' of the tag 'input')
28
29
30 //    bbSetOutputOut( bbGetInputIn() );
31 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
32
33         std::vector<double> normal;
34         std::vector<double> outpoint;
35
36         if ( bbGetInputInPoint().size()==3 )
37         {
38
39                 if (bbGetInputDirection() == 0) 
40                 {
41                         normal.push_back(1);
42                         normal.push_back(0);
43                         normal.push_back(0);
44                         bbSetOutputNormalVector(normal);
45                         outpoint.push_back( bbGetInputInPoint()[1] );
46                         outpoint.push_back( bbGetInputInPoint()[2] );
47                         outpoint.push_back( bbGetInputInPoint()[0] );
48                         bbSetOutputOutPoint(outpoint);
49                 } // if direction 0
50
51                 if (bbGetInputDirection() == 1) 
52                 {
53                         normal.push_back(0);
54                         normal.push_back(1);
55                         normal.push_back(0);
56                         bbSetOutputNormalVector(normal);
57                         outpoint.push_back( bbGetInputInPoint()[0] );
58                         outpoint.push_back( bbGetInputInPoint()[2] );
59                         outpoint.push_back( bbGetInputInPoint()[1] );
60                         bbSetOutputOutPoint(outpoint);
61                 } // if direction 0
62
63                 if (bbGetInputDirection() == 2) 
64                 {
65                         normal.push_back(0);
66                         normal.push_back(0);
67                         normal.push_back(1);
68                         bbSetOutputNormalVector(normal);
69                         outpoint.push_back( bbGetInputInPoint()[0] );
70                         outpoint.push_back( bbGetInputInPoint()[1] );
71                         outpoint.push_back( bbGetInputInPoint()[2] );
72                         bbSetOutputOutPoint(outpoint);
73                 } // if direction 0
74
75         } // if bbGetInputInPoint  Size
76
77 }
78 //===== 
79 // 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 //===== 
81 void ChangeInformationPoint3Dto2D::bbUserSetDefaultValues()
82 {
83
84 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
85 //    Here we initialize the input 'In' to 0
86
87     bbSetInputDirection(2);
88   
89 }
90 //===== 
91 // 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 //===== 
93 void ChangeInformationPoint3Dto2D::bbUserInitializeProcessing()
94 {
95
96 //  THE INITIALIZATION METHOD BODY :
97 //    Here does nothing 
98 //    but this is where you should allocate the internal/output pointers 
99 //    if any 
100
101   
102 }
103 //===== 
104 // 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 //===== 
106 void ChangeInformationPoint3Dto2D::bbUserFinalizeProcessing()
107 {
108
109 //  THE FINALIZATION METHOD BODY :
110 //    Here does nothing 
111 //    but this is where you should desallocate the internal/output pointers 
112 //    if any
113   
114 }
115 }
116 // EO namespace bbcreaMaracasVisu
117
118