1 #include "wxMaracasRenderImageTransformation.h"
6 wxMaracasRenderImageTransformation::wxMaracasRenderImageTransformation(wxMaracasMultipleVolumeRendererManager* _vol, wxMaracasSurfaceRenderingManager* _surface1,
7 wxMaracasSurfaceRenderingManager* _surface2, wxMaracasSurfaceRenderingManager* _surface3, int id)
14 transformV = vtkTransform::New();
15 transformS1 = vtkTransform::New();
16 transformS2 = vtkTransform::New();
17 transformS3 = vtkTransform::New();
24 wxMaracasRenderImageTransformation::~wxMaracasRenderImageTransformation()
30 ** Transforms a volume by the given value for the X axis
32 void wxMaracasRenderImageTransformation::Translate(int tx, int ty, int tz, int rx, int ry, int rz, int sx, int sy, int sz)
34 //printf("wxMaracasRenderImageManagementPanel::Rotate float:scaleX = %f \n", tx);
35 //printf("wxMaracasRenderImageManagementPanel::Rotate float:scaleY = %f \n", ty);
36 //printf("wxMaracasRenderImageManagementPanel::Rotate float:scaleZ = %f \n", tz);
42 vol->getImageData()->GetSpacing(volspX, volspY, volspZ);
47 surface1->getImageData()->GetSpacing(surfspX, surfspY, surfspZ);
49 transformV->Identity();
50 transformS1->Identity();
51 transformS2->Identity();
52 transformS3->Identity();
54 transformV->Translate( tx/*volspX*/, ty/*volspY*/, tz/*volspZ*/ );
55 transformS1->Translate( tx/*surfspX*/, ty/*surfspY*/, tz/*surfspZ*/ );
56 transformS2->Translate( tx/*surfspX*/, ty/*surfspY*/, tz/*surfspZ*/ );
57 transformS3->Translate( tx/*surfspX*/, ty/*surfspY*/, tz/*surfspZ*/ );
59 transformV->RotateX( rx/*volspX*/ );
60 transformS1->RotateX( rx/*surfspX*/ );
61 transformS2->RotateX( rx/*surfspX*/ );
62 transformS3->RotateX( rx/*surfspX*/ );
64 transformV->RotateY( ry/*volspY*/ );
65 transformS1->RotateY( ry/*surfspY*/ );
66 transformS2->RotateY( ry/*surfspY*/ );
67 transformS3->RotateY( ry/*surfspY*/ );
69 transformV->RotateZ( rz/*volspZ*/ );
70 transformS1->RotateZ( rz/*surfspZ*/ );
71 transformS2->RotateZ( rz/*surfspZ*/ );
72 transformS3->RotateZ( rz/*surfspZ*/ );
74 transformV->Scale( (sx/100.0), (sy/100.0), (sz/100.0) );
75 transformS1->Scale( (sx/100.0), (sy/100.0), (sz/100.0) );
76 transformS2->Scale( (sx/100.0), (sy/100.0), (sz/100.0) );
77 transformS3->Scale( (sx/100.0), (sy/100.0), (sz/100.0) );
84 ** Scales a volume by the given value for the X axis
86 void wxMaracasRenderImageTransformation::Scale(int x, int y, int z)
88 float resultX = x/100.0;
89 float resultY = y/100.0;
90 float resultZ = z/100.0;
92 //printf("wxMaracasRenderImageManagementPanel::Rotate int:scaleX = %d \n",x);
93 //printf("wxMaracasRenderImageManagementPanel::Rotate int:scaleY = %d \n", y);
94 //printf("wxMaracasRenderImageManagementPanel::Rotate int:scaleZ = %d \n", z);
100 ** Updates each Matrix
102 void wxMaracasRenderImageTransformation::Refresh()throw(char*)
104 transformV->Update();
105 transformS1->Update();
106 transformS2->Update();
107 transformS3->Update();
109 vol->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
110 //vol->getRenderer()->Render();
112 surface1->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
113 //surface1->getRenderer()->Render();
115 surface2->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
116 //surface2->getRenderer()->Render();
118 surface3->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
119 //surface3->getRenderer()->Render();