]> Creatis software - creaRigidRegistration.git/blob - PackRecalage/src/bbPackRecalageTransform2DBox.cxx
788bca6532a0c86cd6518429553aab2b1070c182
[creaRigidRegistration.git] / PackRecalage / src / bbPackRecalageTransform2DBox.cxx
1 #include "bbPackRecalageTransform2DBox.h"
2 #include "bbPackRecalagePackage.h"
3 namespace bbPackRecalage
4 {
5
6 BBTK_ADD_BLACK_BOX_TO_PACKAGE(PackRecalage,Transform2DBox)
7 BBTK_BLACK_BOX_IMPLEMENTATION(Transform2DBox,bbtk::AtomicBlackBox);
8 void Transform2DBox::Process()
9 {
10                 if(bbGetInputCenterPoint()[0] != NULL)
11                 {
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() );
18                         // The calculation of the transformations are made
19                         transformer->Run();
20                         // We get the results of transformer and set it as result of this box
21                         bbSetOutputOut( transformer->GetResult() );                     
22                 }
23                 else
24                 {
25                         bbSetOutputOut( NULL );
26                 }
27   
28 }
29 void Transform2DBox::bbUserSetDefaultValues()
30 {
31                 //We initialize the points with an empty vector, the angle in 0 and the scales in 1   
32                 std::vector<int> nuevo(3,0);
33                 nuevo.push_back(0);
34                 bbSetInputCenterPoint(nuevo); 
35                 bbSetInputAngle(0); 
36                 bbSetInputScaleX(100);
37                 bbSetInputScaleY(100);
38                 bbSetInputScaleZ(100);
39                 bbSetOutputOut(NULL);   
40   
41 }
42 void Transform2DBox::bbUserInitializeProcessing()
43 {
44                 //We initialize the transformer
45                 transformer=new Transformer();
46  
47   
48 }
49 void Transform2DBox::bbUserFinalizeProcessing()
50 {
51                 //We delete the transformer
52                 delete transformer;
53   
54 }
55 }
56 // EO namespace bbPackRecalage
57
58