]> Creatis software - creaRigidRegistration.git/commitdiff
Added Transform3D Boxes
authortrillos <trillos>
Mon, 16 Nov 2009 08:52:08 +0000 (08:52 +0000)
committertrillos <trillos>
Mon, 16 Nov 2009 08:52:08 +0000 (08:52 +0000)
PackRecalage/src/bbPackRecalageTransform3DBox.cxx [new file with mode: 0644]
PackRecalage/src/bbPackRecalageTransform3DBox.h [new file with mode: 0644]

diff --git a/PackRecalage/src/bbPackRecalageTransform3DBox.cxx b/PackRecalage/src/bbPackRecalageTransform3DBox.cxx
new file mode 100644 (file)
index 0000000..3c1517a
--- /dev/null
@@ -0,0 +1,44 @@
+#include "bbPackRecalageTransform3DBox.h"
+#include "bbPackRecalagePackage.h"
+namespace bbPackRecalage
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(PackRecalage,Transform3DBox)
+BBTK_BLACK_BOX_IMPLEMENTATION(Transform3DBox,bbtk::AtomicBlackBox);
+void Transform3DBox::Process()
+{
+       if(!bbGetInputCenterPoint().empty())
+       {
+               //      The inputs are set in the library transformer 3D
+               transformer->SetCenterPoint( bbGetInputCenterPoint() );
+
+               // The calculation of the transformations are made
+               transformer->Run();
+               // We get the results of transformer and set it as result of this box
+               bbSetOutputOut( transformer->GetResult() );     
+       }
+       else
+       {
+               bbSetOutputOut( NULL );
+       }
+}
+void Transform3DBox::bbUserSetDefaultValues()
+{
+       //We initialize the points with an empty vector   
+       std::vector<int> nuevo(3,0);
+       nuevo.push_back(0);
+       bbSetInputCenterPoint(nuevo);
+       bbSetOutputOut(NULL);
+}
+void Transform3DBox::bbUserInitializeProcessing()
+{
+       //We initialize the transformer
+       transformer=new Transformer3D();   
+}
+void Transform3DBox::bbUserFinalizeProcessing()
+{
+       //We delete the transformer
+       delete transformer;
+}
+}
+// EO namespace bbPackRecalage
\ No newline at end of file
diff --git a/PackRecalage/src/bbPackRecalageTransform3DBox.h b/PackRecalage/src/bbPackRecalageTransform3DBox.h
new file mode 100644 (file)
index 0000000..98a54e3
--- /dev/null
@@ -0,0 +1,43 @@
+#ifndef __bbPackRecalageTransform3DBox_h_INCLUDED__
+#define __bbPackRecalageTransform3DBox_h_INCLUDED__
+#include "bbPackRecalage_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+#include "Transformer3D.h"
+#include "vtkLinearTransform.h"
+
+namespace bbPackRecalage
+{
+
+class bbPackRecalage_EXPORT Transform3DBox
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(Transform3DBox,bbtk::AtomicBlackBox);
+
+  /*Point(x,y) -> Rotation Center*/
+  BBTK_DECLARE_INPUT(CenterPoint,std::vector<int>);
+
+  /*Resultant vtkTransform*/
+  BBTK_DECLARE_OUTPUT(Out, vtkLinearTransform*);
+  
+  BBTK_PROCESS(Process);
+  void Process();
+
+  /*Class in charge of making the transformations*/
+  Transformer3D *transformer;
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(Transform3DBox,bbtk::AtomicBlackBox);
+BBTK_NAME("Transform3DBox");
+BBTK_AUTHOR("jn.trillos44@uniandes.edu.co");
+BBTK_DESCRIPTION("Box useful for creating matrixes for 3D transformations");
+BBTK_CATEGORY("__CATEGORY__");
+BBTK_INPUT(Transform3DBox,CenterPoint,"",std::vector<int>,"");
+BBTK_OUTPUT(Transform3DBox,Out,"First output",vtkLinearTransform*,"");
+BBTK_END_DESCRIBE_BLACK_BOX(Transform3DBox);
+}
+// EO namespace bbPackRecalage
+
+#endif // __bbPackRecalageTransform3DBox_h_INCLUDED__
+