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