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 "bbcreaVtkTransformVector.h"
5 #include "bbcreaVtkPackage.h"
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,TransformVector)
10 BBTK_BLACK_BOX_IMPLEMENTATION(TransformVector,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 TransformVector::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')
29 // bbSetOutputOut( bbGetInputIn() );
30 // std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
35 unsigned int XSize=bbGetInputInX().size();
36 unsigned int YSize=bbGetInputInY().size();
37 unsigned int ZSize=bbGetInputInZ().size();
39 std::vector<double> xVec;
40 std::vector<double> yVec;
41 std::vector<double> zVec;
43 printf("TransformVector::Process START\n" );
46 if ((XSize!=YSize) || (XSize!=ZSize) )
49 printf("ERROR. TransformVector: The size of the tree vectors are not the same!\n");
55 if (bbGetInputTransform()!=NULL) { bbGetInputTransform()->Update(); }
58 tmpA[0]=bbGetInputInX()[i];
59 tmpA[1]=bbGetInputInY()[i];
60 tmpA[2]=bbGetInputInZ()[i];
62 if (bbGetInputTransform()!=NULL)
64 tmpB=bbGetInputTransform()->TransformDoublePoint(tmpA);
65 xVec.push_back( tmpB[0] );
66 yVec.push_back( tmpB[1] );
67 zVec.push_back( tmpB[2] );
69 printf("WARNNIG. TransformVector: The Transform is not set!\n");
70 xVec.push_back( tmpA[0] );
71 yVec.push_back( tmpA[1] );
72 zVec.push_back( tmpA[2] );
76 bbSetOutputOutX(xVec);
77 bbSetOutputOutY(yVec);
78 bbSetOutputOutZ(zVec);
80 printf("TransformVector::Process END\n" );
84 // 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)
86 void TransformVector::bbUserSetDefaultValues()
89 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
90 // Here we initialize the input 'In' to 0
91 bbSetInputTransform(NULL);
95 // 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 void TransformVector::bbUserInitializeProcessing()
100 // THE INITIALIZATION METHOD BODY :
102 // but this is where you should allocate the internal/output pointers
108 // 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)
110 void TransformVector::bbUserFinalizeProcessing()
113 // THE FINALIZATION METHOD BODY :
115 // but this is where you should desallocate the internal/output pointers
120 // EO namespace bbcreaVtk