(&MagicBox::bbGetInputIn),
new MagicBoxSetFunctor (&MagicBox::bbSetInputIn) ) );
- BBTK_INPUT(MagicBox, Active, "Active True/False (default True)",bool,"");
+ BBTK_INPUT(MagicBox, Active, "(default True) Active True/False",bool,"");
AddOutputDescriptor
#include "bbvtkTransform.h"
#include "bbvtkPackage.h"
+
#include "vtkMath.h"
+#include "vtkMatrix4x4.h"
+
namespace bbvtk
{
BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,Transform);
result->RotateWXYZ( ang , v3[0], v3[1], v3[2] );
} // if rotation size >=4
+ if (bbGetInputManualMatrixIn().size()==16)
+ {
+ std::vector<double> manaulMatrixIn = bbGetInputManualMatrixIn();
+ vtkMatrix4x4* m = result->GetMatrix();
+ int i,j,ii=0;
+ for (j=0;j<4;j++)
+ {
+ for (i=0;i<4;i++)
+ {
+ m->SetElement(i,j,manaulMatrixIn[ii]);
+ ii++;
+ }// for i
+ } // for j
+ m->Modified();
+ result->Update();
+ } // ManualMatrix
+
+ vtkTransform * finalTransform;
if (bbGetInputInverse()==false)
{
- bbSetOutputOut(result);
+ finalTransform = result;
} else {
vtkMatrix4x4 *matrix;
matrix=vtkMatrix4x4::New();
result->GetInverse(matrix);
resultInverse->SetMatrix( matrix );
- bbSetOutputOut(resultInverse);
+ finalTransform = resultInverse;
} // if Inverse
+
+ bbSetOutputOut(finalTransform);
+
+ std::vector<double> manualMatrixOut;
+ vtkMatrix4x4* m = finalTransform->GetMatrix();
+ int i,j,ii=0;
+ for (j=0;j<4;j++)
+ {
+ for (i=0;i<4;i++)
+ {
+ manualMatrixOut.push_back( m->GetElement(i,j) );
+ }// for i
+ } // for j
+ bbSetOutputManualMatrixOut( manualMatrixOut );
}
}// EO namespace bbvtk
BBTK_DECLARE_INPUT(Translate,std::vector<double>);
BBTK_DECLARE_INPUT(Spacing,std::vector<double>);
BBTK_DECLARE_INPUT(RotateToNormal,std::vector<double>);
+ BBTK_DECLARE_INPUT(ManualMatrixIn,std::vector<double>);
BBTK_DECLARE_OUTPUT(Out,vtkLinearTransform *);
+ BBTK_DECLARE_OUTPUT(ManualMatrixOut,std::vector<double>);
BBTK_PROCESS(Process);
void Process();
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_INPUT(Transform,RotateToNormal,"(default is EMPTY) Normal vector [nx,ny,nz]",std::vector<double>,"");
+ BBTK_INPUT(Transform,ManualMatrixIn,"(default EMPTY) The 16 elements of a 4x4 matrix",std::vector<double>,"");
BBTK_OUTPUT(Transform,Out,"vtkTransform result",vtkLinearTransform *,"");
+ BBTK_OUTPUT(Transform,ManualMatrixOut,"The 16 elements of the 4x4 matrix",std::vector<double>,"");
BBTK_END_DESCRIBE_BLACK_BOX(Transform);
}