1 #include "wxMaracasRenderImageTransformation.h"
6 wxMaracasRenderImageTransformation::wxMaracasRenderImageTransformation(wxMaracasMultipleVolumeRendererManager* _vol, wxMaracasSurfaceRenderingManager* _surface1,
7 wxMaracasSurfaceRenderingManager* _surface2, wxMaracasSurfaceRenderingManager* _surface3, int id)
16 transformV = vtkTransform::New();
17 transformS1 = vtkTransform::New();
18 transformS2 = vtkTransform::New();
19 transformS3 = vtkTransform::New();
26 wxMaracasRenderImageTransformation::~wxMaracasRenderImageTransformation()
28 transformV->Identity();
29 transformS1->Identity();
30 transformS2->Identity();
31 transformS3->Identity();
35 ** Transforms a volume by the given value for the X axis
37 void wxMaracasRenderImageTransformation::Translate(int x, int y, int z)
39 transformV->Translate( x, y, z );
40 transformS1->Translate( x, y, z );
41 transformS2->Translate( x, y, z );
42 transformS3->Translate( x, y, z );
48 ** Rotates a volume by the given degree for the X axis
50 void wxMaracasRenderImageTransformation::Rotate(int x, int y, int z)
52 transformV->RotateX( x );
53 transformS1->RotateX( x );
54 transformS2->RotateX( x );
55 transformS3->RotateX( x );
57 transformV->RotateY( y );
58 transformS1->RotateY( y );
59 transformS2->RotateY( y );
60 transformS3->RotateY( y );
62 transformV->RotateZ( z );
63 transformS1->RotateZ( z );
64 transformS2->RotateZ( z );
65 transformS3->RotateZ( z );
71 ** Scales a volume by the given value for the X axis
73 void wxMaracasRenderImageTransformation::Scale(int x, int y, int z)
75 float resultX = x/100.0;
76 float resultY = y/100.0;
77 float resultZ = z/100.0;
79 //printf("wxMaracasRenderImageManagementPanel::Rotate int:scaleX = %d \n",x);
80 //printf("wxMaracasRenderImageManagementPanel::Rotate int:scaleY = %d \n", y);
81 //printf("wxMaracasRenderImageManagementPanel::Rotate int:scaleZ = %d \n", z);
83 //printf("wxMaracasRenderImageManagementPanel::Rotate float:scaleX = %f \n", resultX);
84 //printf("wxMaracasRenderImageManagementPanel::Rotate float:scaleY = %f \n", resultY);
85 //printf("wxMaracasRenderImageManagementPanel::Rotate float:scaleZ = %f \n", resultZ);
87 transformV->Scale( (x/100.0), (y/100.0), (z/100.0) );
88 transformS1->Scale( (x/100.0), (y/100.0), (z/100.0) );
89 transformS2->Scale( (x/100.0), (y/100.0), (z/100.0) );
90 transformS3->Scale( (x/100.0), (y/100.0), (z/100.0) );
96 ** Updates each Matrix
98 void wxMaracasRenderImageTransformation::Refresh()throw(char*)
100 transformV->Update();
101 transformS1->Update();
102 transformS2->Update();
103 transformS3->Update();
105 vol->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
106 //vol->getRenderer()->Render();
108 surface1->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
109 //surface1->getRenderer()->Render();
111 surface2->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
112 //surface2->getRenderer()->Render();
114 surface3->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
115 //surface3->getRenderer()->Render();