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