]> Creatis software - creaRigidRegistration.git/blob - PackRecalage/src/bbPackRecalageTransform3D1PointBox.cxx
Renamed Recalage Boxes
[creaRigidRegistration.git] / PackRecalage / src / bbPackRecalageTransform3D1PointBox.cxx
1 #include "bbPackRecalageTransform3D1PointBox.h"
2 #include "bbPackRecalagePackage.h"
3 namespace bbPackRecalage
4 {
5
6 BBTK_ADD_BLACK_BOX_TO_PACKAGE(PackRecalage,Transform3D1PointBox)
7 BBTK_BLACK_BOX_IMPLEMENTATION(Transform3D1PointBox,bbtk::AtomicBlackBox);
8 void Transform3D1PointBox::Process()
9 {
10         if(!bbGetInputCenterPoint().empty())
11         {
12                 //      The inputs are set in the library transformer
13                 transformer->SetCenterPoint( bbGetInputCenterPoint() );
14                 transformer->SetAngleX( bbGetInputAngleX() );
15                 transformer->SetAngleY( bbGetInputAngleY() );
16                 transformer->SetAngleZ( bbGetInputAngleZ() );
17                 transformer->SetScaleX( bbGetInputScaleX() );
18                 transformer->SetScaleY( bbGetInputScaleY() );
19                 transformer->SetScaleZ( bbGetInputScaleZ() );
20
21                 // The calculation of the transformations are made
22                 transformer->Run();
23                 // We get the results of transformer and set it as result of this box
24                 bbSetOutputOut( transformer->GetResult() );                     
25         }
26         else
27         {
28                 bbSetOutputOut( NULL );
29         }
30 }
31 void Transform3D1PointBox::bbUserSetDefaultValues()
32 {
33         //We initialize the points with an empty vector, the angle in 0 and the scales in 1   
34         std::vector<int> nuevo(3,0);
35         nuevo.push_back(0);
36         bbSetInputCenterPoint(nuevo); 
37         bbSetInputAngleX(0);
38         bbSetInputAngleY(0);
39         bbSetInputAngleZ(0);
40         bbSetInputScaleX(100);
41         bbSetInputScaleY(100);
42         bbSetInputScaleZ(100);
43         bbSetOutputOut(NULL);
44 }
45 void Transform3D1PointBox::bbUserInitializeProcessing()
46 {
47         //We initialize the transformer
48         transformer = new Transformer3D1Point();
49 }
50 void Transform3D1PointBox::bbUserFinalizeProcessing()
51 {
52         delete transformer;
53 }
54 }
55 // EO namespace bbPackRecalage
56
57