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 "bbcreaVtkPointRotation.h"
5 #include "bbcreaVtkPackage.h"
7 #define _USE_MATH_DEFINES // for C
13 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,PointRotation)
14 BBTK_BLACK_BOX_IMPLEMENTATION(PointRotation,bbtk::AtomicBlackBox);
16 // 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)
18 void PointRotation::Process()
21 // THE MAIN PROCESSING METHOD BODY
22 // Here we simply set the input 'In' value to the output 'Out'
23 // And print out the output value
24 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
25 // void bbSet{Input|Output}NAME(const TYPE&)
26 // const TYPE& bbGet{Input|Output}NAME() const
28 // * NAME is the name of the input/output
29 // (the one provided in the attribute 'name' of the tag 'input')
30 // * TYPE is the C++ type of the input/output
31 // (the one provided in the attribute 'type' of the tag 'input')
34 printf("EED PointRotation::Process Start\n");
36 if (bbGetInputCenter().size()==3)
38 std::vector<double> newpoint;
39 double nx,cx = bbGetInputCenter()[0];
40 double ny,cy = bbGetInputCenter()[1];
41 double nz,cz = bbGetInputCenter()[2];
42 double angRad = bbGetInputAngle()*M_PI/180;
43 nx = bbGetInputSize() * cos( angRad ) + cx;
44 ny = bbGetInputSize() * sin( angRad ) + cy;
46 newpoint.push_back(nx);
47 newpoint.push_back(ny);
48 newpoint.push_back(nz);
49 bbSetOutputOut( newpoint );
51 printf("EED PointRotation::Process End\n");
55 // 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)
57 void PointRotation::bbUserSetDefaultValues()
60 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
61 // Here we initialize the input 'In' to 0
63 std::vector<double> point;
68 std::vector<double> center;
74 bbSetInputCenter(center);
76 bbSetOutputOut(point);
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)
81 void PointRotation::bbUserInitializeProcessing()
84 // THE INITIALIZATION METHOD BODY :
86 // but this is where you should allocate the internal/output pointers
92 // 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)
94 void PointRotation::bbUserFinalizeProcessing()
97 // THE FINALIZATION METHOD BODY :
99 // but this is where you should desallocate the internal/output pointers
104 // EO namespace bbcreaVtk