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)
4 #include "bbcreaMaracasVisuChInfo3Dto2DRuler.h"
5 #include "bbcreaMaracasVisuPackage.h"
6 namespace bbcreaMaracasVisu
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ChInfo3Dto2DRuler)
10 BBTK_BLACK_BOX_IMPLEMENTATION(ChInfo3Dto2DRuler,bbtk::AtomicBlackBox);
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)
14 void ChInfo3Dto2DRuler::Process()
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
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;
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;
40 rotationvector.push_back( bbGetInputAngle() ); // angle
41 if (bbGetInputDirection() == 0)
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] );
57 if (bbGetInputDirection() == 1)
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] );
73 if (bbGetInputDirection() == 2)
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] );
88 bbSetOutputRotationVector(rotationvector);
89 bbSetOutputCenterPointOut(centerpoint);
90 bbSetOutputOutPointX(outpointX);
91 bbSetOutputOutPointY(outpointY);
92 bbSetOutputOutPointZ(outpointZ);
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)
99 void ChInfo3Dto2DRuler::bbUserSetDefaultValues()
102 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
103 // Here we initialize the input 'In' to 0
106 std::vector<double> tmp;
110 bbSetInputCenterPointIn(tmp);
112 bbSetInputDirection(2);
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)
120 void ChInfo3Dto2DRuler::bbUserInitializeProcessing()
123 // THE INITIALIZATION METHOD BODY :
125 // but this is where you should allocate the internal/output pointers
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)
132 void ChInfo3Dto2DRuler::bbUserFinalizeProcessing()
135 // THE FINALIZATION METHOD BODY :
137 // but this is where you should desallocate the internal/output pointers
142 // EO namespace bbcreaMaracasVisu