--- /dev/null
+#include "bbvtkTransform.h"
+#include "bbvtkPackage.h"
+
+
+namespace bbvtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,Transform)
+BBTK_BLACK_BOX_IMPLEMENTATION(Transform,bbtk::AtomicBlackBox);
+void Transform::Process()
+{
+ if (result!=NULL)
+ {
+ result->Delete();
+ }
+ result = vtkTransform::New();
+
+
+ if (bbGetInputIn()!=NULL)
+ {
+ result->Concatenate( bbGetInputIn()->GetMatrix() );
+ }
+
+
+ if (bbGetInputScale().size()>=3)
+ {
+ result->Scale(bbGetInputScale()[0], bbGetInputScale()[1], bbGetInputScale()[2]);
+ }
+
+ if ((bbGetInputTranslate().size()>=3) && (bbGetInputSpacing().size()>=3))
+ {
+ double tx = bbGetInputTranslate()[0] * bbGetInputSpacing()[0];
+ double ty = bbGetInputTranslate()[1] * bbGetInputSpacing()[1];
+ double tz = bbGetInputTranslate()[2] * bbGetInputSpacing()[2];
+ result->Translate(tx,ty,tz);
+ }
+
+ if (bbGetInputRotateWXYZ().size()>=4)
+ {
+ result->RotateWXYZ(bbGetInputRotateWXYZ()[0],bbGetInputRotateWXYZ()[1], bbGetInputRotateWXYZ()[2], bbGetInputRotateWXYZ()[3]);
+ }
+
+ result->Update();
+
+ bbSetOutputOut(result);
+}
+
+
+void Transform::bbUserConstructor()
+{
+ bbSetInputIn(NULL);
+
+ vecScale.push_back(1); // scale x
+ vecScale.push_back(1); // scale y
+ vecScale.push_back(1); // scale z
+ bbSetInputScale(vecScale);
+
+ vecRotateWXYZ.push_back(0); //angle
+ vecRotateWXYZ.push_back(1); //vx
+ vecRotateWXYZ.push_back(0); //vy
+ vecRotateWXYZ.push_back(0); //vz
+ bbSetInputRotateWXYZ(vecRotateWXYZ);
+
+ vecTranslate.push_back(0); //tx
+ vecTranslate.push_back(0); //ty
+ vecTranslate.push_back(0); //tz
+ bbSetInputTranslate(vecTranslate);
+
+ vecSpacing.push_back(1); //spacing x
+ vecSpacing.push_back(1); //spacing y
+ vecSpacing.push_back(1); //spacing z
+ bbSetInputTranslate(vecSpacing);
+
+ result = NULL;
+}
+void Transform::bbUserCopyConstructor()
+{
+
+
+}
+void Transform::bbUserDestructor()
+{
+
+
+}
+}
+// EO namespace bbvtk
+
+
--- /dev/null
+#ifndef __bbvtkTransform_h_INCLUDED__
+#define __bbvtkTransform_h_INCLUDED__
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include <vtkTransform.h>
+#include <vtkLinearTransform.h>
+
+namespace bbvtk
+{
+
+class /*BBTK_EXPORT*/ Transform
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(Transform,bbtk::AtomicBlackBox);
+//==================================================================
+/// User callback called in the box contructor
+virtual void bbUserConstructor();
+/// User callback called in the box copy constructor
+virtual void bbUserCopyConstructor();
+/// User callback called in the box destructor
+virtual void bbUserDestructor();
+//==================================================================
+ BBTK_DECLARE_INPUT(In,vtkLinearTransform *);
+ BBTK_DECLARE_INPUT(Scale,std::vector<double>);
+ BBTK_DECLARE_INPUT(RotateWXYZ,std::vector<double>);
+ BBTK_DECLARE_INPUT(Translate,std::vector<double>);
+ BBTK_DECLARE_INPUT(Spacing,std::vector<double>);
+ BBTK_DECLARE_OUTPUT(Out,vtkLinearTransform *);
+ BBTK_PROCESS(Process);
+ void Process();
+
+ std::vector<double> vecScale;
+ std::vector<double> vecRotateWXYZ;
+ std::vector<double> vecTranslate;
+ std::vector<double> vecSpacing;
+ vtkTransform *result;
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(Transform,bbtk::AtomicBlackBox);
+BBTK_NAME("Transform");
+BBTK_AUTHOR("InfoTeam CREATIS-LRMN");
+BBTK_DESCRIPTION("vtkTransform");
+BBTK_CATEGORY("math");
+BBTK_INPUT(Transform,In,"vtkTransform to be concatenate",vtkLinearTransform *,"");
+BBTK_INPUT(Transform,Scale,"vector with sx sy sz",std::vector<double>,"");
+BBTK_INPUT(Transform,Translate,"vector with x y z",std::vector<double>,"");
+BBTK_INPUT(Transform,Spacing,"vector with spacingX spacingY spacingZ",std::vector<double>,"");
+BBTK_INPUT(Transform,RotateWXYZ,"vector with Angle Vx Vy Vz",std::vector<double>,"");
+BBTK_OUTPUT(Transform,Out,"vtkTransform result",vtkLinearTransform *,"");
+BBTK_END_DESCRIBE_BLACK_BOX(Transform);
+}
+// EO namespace bbvtk
+
+#endif // __bbvtkTransform_h_INCLUDED__
+