]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracasRenderImageTransformation.cpp
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxMaracasRenderImageTransformation.cpp
index 1960caa2c9def3d9f4370af4af815ee51ce1da0d..fe9eedcb38c3ba87b5904f788f7098be01f077fe 100644 (file)
@@ -11,8 +11,6 @@ wxMaracasRenderImageTransformation::wxMaracasRenderImageTransformation(wxMaracas
        surface2 = _surface2;
        surface3 = _surface3;
 
-       propID = id;
-
        transformV = vtkTransform::New();
        transformS1 = vtkTransform::New();
        transformS2 = vtkTransform::New();
@@ -25,51 +23,66 @@ wxMaracasRenderImageTransformation::wxMaracasRenderImageTransformation(wxMaracas
 **/
 wxMaracasRenderImageTransformation::~wxMaracasRenderImageTransformation()
 {      
-       transformV->Identity();
-       transformS1->Identity();
-       transformS2->Identity();
-       transformS3->Identity();
+       
 }
 
 /**
 ** Transforms a volume by the given value for the X axis
 **/
-void wxMaracasRenderImageTransformation::Translate(int x, int y, int z)
+void wxMaracasRenderImageTransformation::Translate(int tx, int ty, int tz, int rx, int ry, int rz, int sx, int sy, int sz)
 {
-       transformV->Translate( x, y, z );
-       transformS1->Translate( x, y, z );
-       transformS2->Translate( x, y, z );
-       transformS3->Translate( x, y, z );
+       //printf("wxMaracasRenderImageManagementPanel::Rotate float:scaleX = %f \n", tx);
+       //printf("wxMaracasRenderImageManagementPanel::Rotate float:scaleY = %f \n", ty);
+       //printf("wxMaracasRenderImageManagementPanel::Rotate float:scaleZ = %f \n", tz);
 
-       Refresh();
-}
+       double volspX;
+       double volspY;
+       double volspZ;
 
-/**
-** Rotates a volume by the given degree for the X axis
-**/
-void wxMaracasRenderImageTransformation::Rotate(int x, int y, int z)
-{
-       transformV->RotateX( x );
-       transformS1->RotateX( x );
-       transformS2->RotateX( x );
-       transformS3->RotateX( x );
+       vol->getImageData()->GetSpacing(volspX, volspY, volspZ);
+
+       double surfspX;
+       double surfspY;
+       double surfspZ;
+       surface1->getImageData()->GetSpacing(surfspX, surfspY, surfspZ);
+
+       transformV->Identity();
+       transformS1->Identity();
+       transformS2->Identity();
+       transformS3->Identity();
+
+       transformV->Translate( tx/*volspX*/, ty/*volspY*/, tz/*volspZ*/ );
+       transformS1->Translate( tx/*surfspX*/, ty/*surfspY*/, tz/*surfspZ*/ );
+       transformS2->Translate( tx/*surfspX*/, ty/*surfspY*/, tz/*surfspZ*/ );
+       transformS3->Translate( tx/*surfspX*/, ty/*surfspY*/, tz/*surfspZ*/ );
+
+       transformV->RotateX( rx/*volspX*/ );
+       transformS1->RotateX( rx/*surfspX*/ );
+       transformS2->RotateX( rx/*surfspX*/ );
+       transformS3->RotateX( rx/*surfspX*/ );
 
-       transformV->RotateY( y );
-       transformS1->RotateY( y );
-       transformS2->RotateY( y );
-       transformS3->RotateY( y );
+       transformV->RotateY( ry/*volspY*/ );
+       transformS1->RotateY( ry/*surfspY*/ );
+       transformS2->RotateY( ry/*surfspY*/ );
+       transformS3->RotateY( ry/*surfspY*/ );
 
-       transformV->RotateZ( z );
-       transformS1->RotateZ( z );
-       transformS2->RotateZ( z );
-       transformS3->RotateZ( z );
+       transformV->RotateZ( rz/*volspZ*/ );
+       transformS1->RotateZ( rz/*surfspZ*/ );
+       transformS2->RotateZ( rz/*surfspZ*/ );
+       transformS3->RotateZ( rz/*surfspZ*/ );
+
+       transformV->Scale( (sx/100.0), (sy/100.0), (sz/100.0) );
+       transformS1->Scale( (sx/100.0), (sy/100.0), (sz/100.0) );
+       transformS2->Scale( (sx/100.0), (sy/100.0), (sz/100.0) );
+       transformS3->Scale( (sx/100.0), (sy/100.0), (sz/100.0) );
 
        Refresh();
 }
 
+
 /**
 ** Scales a volume by the given value for the X axis
-**/
+*
 void wxMaracasRenderImageTransformation::Scale(int x, int y, int z)
 {
        float resultX = x/100.0;
@@ -80,17 +93,8 @@ void wxMaracasRenderImageTransformation::Scale(int x, int y, int z)
        //printf("wxMaracasRenderImageManagementPanel::Rotate int:scaleY = %d \n", y);
        //printf("wxMaracasRenderImageManagementPanel::Rotate int:scaleZ = %d \n", z);
 
-       //printf("wxMaracasRenderImageManagementPanel::Rotate float:scaleX = %f \n", resultX);
-       //printf("wxMaracasRenderImageManagementPanel::Rotate float:scaleY = %f \n", resultY);
-       //printf("wxMaracasRenderImageManagementPanel::Rotate float:scaleZ = %f \n", resultZ);
-
-       transformV->Scale( (x/100.0), (y/100.0), (z/100.0) );
-       transformS1->Scale( (x/100.0), (y/100.0), (z/100.0) );
-       transformS2->Scale( (x/100.0), (y/100.0), (z/100.0) );
-       transformS3->Scale( (x/100.0), (y/100.0), (z/100.0) );
-
        Refresh();
-}
+}*/
 
 /**
 ** Updates each Matrix