1 #include "bbPackRecalageTransform2DBox.h"
2 #include "bbPackRecalagePackage.h"
3 namespace bbPackRecalage
6 BBTK_ADD_BLACK_BOX_TO_PACKAGE(PackRecalage,Transform2DBox)
7 BBTK_BLACK_BOX_IMPLEMENTATION(Transform2DBox,bbtk::AtomicBlackBox);
8 void Transform2DBox::Process()
10 if(!bbGetInputCenterPoint().empty())
12 // The inputs are set in the library transformer
13 transformer->SetCenterPoint( bbGetInputCenterPoint() );
14 transformer->SetAngle( bbGetInputAngle() );
15 transformer->SetScaleX( bbGetInputScaleX() );
16 transformer->SetScaleY( bbGetInputScaleY() );
17 transformer->SetScaleZ( bbGetInputScaleZ() );
19 //If 3D, make extra preparations
22 transformer->SetAxis(bbGetInputAxis());
25 // The calculation of the transformations are made
26 transformer->Run(_3D);
27 // We get the results of transformer and set it as result of this box
28 bbSetOutputOut( transformer->GetResult() );
32 bbSetOutputOut( NULL );
36 void Transform2DBox::bbUserSetDefaultValues()
38 //We initialize the points with an empty vector, the angle in 0 and the scales in 1
39 std::vector<int> nuevo(3,0);
41 bbSetInputCenterPoint(nuevo);
43 bbSetInputScaleX(100);
44 bbSetInputScaleY(100);
45 bbSetInputScaleZ(100);
50 void Transform2DBox::bbUserInitializeProcessing()
52 //We initialize the transformer
53 transformer=new Transformer();
57 void Transform2DBox::bbUserFinalizeProcessing()
59 //We delete the transformer
64 // EO namespace bbPackRecalage