]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbcreaMaracasVisuChangeInformation3Dto2DforRuler.cxx
2345 creaMaracasVisu Feature Test Phase Normal Ruler01XY
[creaMaracasVisu.git] / bbtk / src / bbcreaMaracasVisuChangeInformation3Dto2DforRuler.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 "bbcreaMaracasVisuChangeInformation3Dto2DforRuler.h"
5 #include "bbcreaMaracasVisuPackage.h"
6 namespace bbcreaMaracasVisu
7 {
8
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ChangeInformation3Dto2DforRuler)
10 BBTK_BLACK_BOX_IMPLEMENTATION(ChangeInformation3Dto2DforRuler,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 ChangeInformation3Dto2DforRuler::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 //    bbSetOutputOut( bbGetInputIn() );
29 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
30   
31
32         std::vector<double> rotationvector;
33         std::vector<double> outpointX;
34         std::vector<double> outpointY;
35         std::vector<double> outpointZ;
36
37 /*
38 // RotationVector
39         rotationvector.push_back( bbGetInputAngle() );  // angle
40         if (bbGetInputDirection() == 0) 
41         {
42                 rotationvector.push_back(1);  // vx
43                 rotationvector.push_back(0);  // vy
44                 rotationvector.push_back(0);  // vz 
45         } // if direction 0
46
47         if (bbGetInputDirection() == 1) 
48         {
49                 rotationvector.push_back(0);  // vx
50                 rotationvector.push_back(1);  // vy
51                 rotationvector.push_back(0);  // vz 
52         } // if direction 1
53
54         if (bbGetInputDirection() == 2) 
55         {
56                 rotationvector.push_back(0);  // vx
57                 rotationvector.push_back(0);  // vy
58                 rotationvector.push_back(1);  // vz 
59         } // if direction 2
60         bbSetOutputNormalVector(rotationvector);
61
62
63
64         if (bbGetInputDirection() == 0) 
65         {
66                 outpointX.push_back( 900 );
67                 outpointX.push_back( 900 );
68                 outpointY.push_back( 0 );
69                 outpointY.push_back( 0+bbGetInputSize() );
70                 outpointZ.push_back( 0 );
71                 outpointZ.push_back( 0 );
72         } // if direction 0
73
74         if (bbGetInputDirection() == 1) 
75         {
76                 outpointX.push_back( 0 );
77                 outpointX.push_back( 0+bbGetInputSize() );
78                 outpointY.push_back( -900 );
79                 outpointY.push_back( -900 );
80                 outpointZ.push_back( 0 );
81                 outpointZ.push_back( 0 );
82         } // if direction 0
83
84         if (bbGetInputDirection() == 2) 
85         {
86                 outpointX.push_back( 0 );
87                 outpointX.push_back( 0+bbGetInputSize() );
88                 outpointY.push_back( 0 );
89                 outpointY.push_back( 0 );
90                 outpointZ.push_back( -900 );
91                 outpointZ.push_back( -900 );
92         } // if direction 0
93         bbSetOutputOutPointX(outpointX);
94         bbSetOutputOutPointY(outpointY);
95         bbSetOutputOutPointZ(outpointZ);
96
97 */
98 }
99 //===== 
100 // 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)
101 //===== 
102 void ChangeInformation3Dto2DforRuler::bbUserSetDefaultValues()
103 {
104
105 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
106 //    Here we initialize the input 'In' to 0
107
108 /*
109    bbSetInputDirection(2);
110    bbSetInputAngle(0);
111    bbSetInputSize(10);
112 */
113
114 }
115 //===== 
116 // 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)
117 //===== 
118 void ChangeInformation3Dto2DforRuler::bbUserInitializeProcessing()
119 {
120
121 //  THE INITIALIZATION METHOD BODY :
122 //    Here does nothing 
123 //    but this is where you should allocate the internal/output pointers 
124 //    if any 
125
126   
127 }
128 //===== 
129 // 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)
130 //===== 
131 void ChangeInformation3Dto2DforRuler::bbUserFinalizeProcessing()
132 {
133
134 //  THE FINALIZATION METHOD BODY :
135 //    Here does nothing 
136 //    but this is where you should desallocate the internal/output pointers 
137 //    if any
138   
139 }
140 }
141 // EO namespace bbcreaMaracasVisu
142
143