2 #include "wxMaracasRenderImageTransformation.h"
7 wxMaracasRenderImageTransformation::wxMaracasRenderImageTransformation(wxMaracasMultipleVolumeRendererManager* _vol, wxMaracasSurfaceRenderingManager* _surface1,
8 wxMaracasSurfaceRenderingManager* _surface2, wxMaracasSurfaceRenderingManager* _surface3, int id)
17 transformV = vtkTransform::New();
18 transformS1 = vtkTransform::New();
19 transformS2 = vtkTransform::New();
20 transformS3 = vtkTransform::New();
27 wxMaracasRenderImageTransformation::~wxMaracasRenderImageTransformation()
32 ** Transforms a volume by the given value for the X axis
34 void wxMaracasRenderImageTransformation::Translate(int x, int y, int z)
36 transformV->Identity();
37 transformS1->Identity();
38 transformS2->Identity();
39 transformS3->Identity();
41 transformV->Translate( x, y, z );
42 transformS1->Translate( x, y, z );
43 transformS2->Translate( x, y, z );
44 transformS3->Translate( x, y, z );
50 ** Rotates a volume by the given degree for the X axis
52 void wxMaracasRenderImageTransformation::Rotate(int x, int y, int z)
54 transformV->Identity();
55 transformS1->Identity();
56 transformS2->Identity();
57 transformS3->Identity();
59 transformV->RotateX( x );
60 transformS1->RotateX( x );
61 transformS2->RotateX( x );
62 transformS3->RotateX( x );
64 transformV->RotateY( y );
65 transformS1->RotateY( y );
66 transformS2->RotateY( y );
67 transformS3->RotateY( y );
69 transformV->RotateZ( z );
70 transformS1->RotateZ( z );
71 transformS2->RotateZ( z );
72 transformS3->RotateZ( z );
78 ** Scales a volume by the given value for the X axis
80 void wxMaracasRenderImageTransformation::Scale(int x, int y, int z)
82 transformV->Identity();
83 transformS1->Identity();
84 transformS2->Identity();
85 transformS3->Identity();
87 transformV->Scale( x, y, z );
88 transformS1->Scale( x, y, z );
89 transformS2->Scale( x, y, z );
90 transformS3->Scale( x, y, z );
95 void wxMaracasRenderImageTransformation::Refresh()throw(char*)
98 transformS1->Update();
99 transformS2->Update();
100 transformS3->Update();
102 vol->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
103 vol->getRenderer()->Render();
105 surface1->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
106 surface1->getRenderer()->Render();
108 surface2->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
109 surface2->getRenderer()->Render();
111 surface3->getViewData(propID)->getProp3D()->SetUserMatrix(transformV->GetMatrix());
112 surface3->getRenderer()->Render();