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;
44 if ((XSize!=YSize) || (XSize!=ZSize) )
47 printf("ERROR. TransformVector: The size of the tree vectors are not the same!\n");
53 if (bbGetInputTransform()!=NULL) { bbGetInputTransform()->Update(); }
56 tmpA[0]=bbGetInputInX()[i];
57 tmpA[1]=bbGetInputInY()[i];
58 tmpA[2]=bbGetInputInZ()[i];
60 if (bbGetInputTransform()!=NULL)
62 tmpB=bbGetInputTransform()->TransformDoublePoint(tmpA);
63 xVec.push_back( tmpB[0] );
64 yVec.push_back( tmpB[1] );
65 zVec.push_back( tmpB[2] );
67 printf("WARNNIG. TransformVector: The Transform is not set!\n");
68 xVec.push_back( tmpA[0] );
69 yVec.push_back( tmpA[1] );
70 zVec.push_back( tmpA[2] );
74 bbSetOutputOutX(xVec);
75 bbSetOutputOutY(yVec);
76 bbSetOutputOutZ(zVec);
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 TransformVector::bbUserSetDefaultValues()
84 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
85 // Here we initialize the input 'In' to 0
86 bbSetInputTransform(NULL);
90 // 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)
92 void TransformVector::bbUserInitializeProcessing()
95 // THE INITIALIZATION METHOD BODY :
97 // but this is where you should allocate the internal/output pointers
103 // 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)
105 void TransformVector::bbUserFinalizeProcessing()
108 // THE FINALIZATION METHOD BODY :
110 // but this is where you should desallocate the internal/output pointers
115 // EO namespace bbcreaVtk