]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbcreaMaracasVisuChInfo3Dto2DRuler.cxx
#3481 wxVtkBaseView_Info add events mouse observer
[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 // 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)
97 //===== 
98 void ChInfo3Dto2DRuler::bbUserSetDefaultValues()
99 {
100 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
101 //    Here we initialize the input 'In' to 0
102    std::vector<double> tmp;
103    tmp.push_back( 0 );
104    tmp.push_back( 0 );
105    tmp.push_back( 0 );
106    bbSetInputCenterPointIn(tmp);
107    bbSetInputDirection(2);
108    bbSetInputAngle(0);
109    bbSetInputSize(10);
110 }
111
112 //===== 
113 // 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)
114 //===== 
115 void ChInfo3Dto2DRuler::bbUserInitializeProcessing()
116 {
117 //  THE INITIALIZATION METHOD BODY :
118 //    Here does nothing 
119 //    but this is where you should allocate the internal/output pointers 
120 //    if any
121 }
122
123 //=====
124 // 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)
125 //===== 
126 void ChInfo3Dto2DRuler::bbUserFinalizeProcessing()
127 {
128 //  THE FINALIZATION METHOD BODY :
129 //    Here does nothing 
130 //    but this is where you should desallocate the internal/output pointers 
131 //    if any
132 }
133
134 }// EO namespace bbcreaMaracasVisu
135
136