]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx
#3472 TDx
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxVtk2DBaseView.cxx
index 4ade1682394fa7df720fd625f3bcad94066d87e0..941b3ef3ae0d5f7c1e9e1d190d80e4bf3bbe33fa 100644 (file)
@@ -31,8 +31,8 @@
 #include "vtkImageActor.h"
 
 
-wxVtk2DBaseView::wxVtk2DBaseView(wxWindow *parent)
-:wxVtkBaseView(parent)
+wxVtk2DBaseView::wxVtk2DBaseView(wxWindow *parent,bool TDxWindow)
+:wxVtkBaseView(parent,TDxWindow)
 {
    _imageViewer2XYZ   = NULL;
    _vtkIinfoTextImage = NULL;
@@ -97,7 +97,6 @@ void wxVtk2DBaseView::TransformCoordinate_spacing_ModelToView(double &X,double &
 //-------------------------------------------------------------------
 void wxVtk2DBaseView::ResetView()
 {
-       printf("EED wxVtk2DBaseView::ResetView");
        double spx = 0,spy = 0,spz = 0;
        int x1 = 1,x2 = 1,y1 = 1,y2 = 1,z1 = 1,z2 = 1;
        wxVtkBaseView::Configure();
@@ -117,14 +116,13 @@ void wxVtk2DBaseView::ResetView()
                imageData->GetSpacing (spx,spy,spz);
                imageData->GetExtent (x1,x2,y1,y2,z1,z2);
        }
-printf("//EED wxVtk2DBaseView::ResetView %d %d    %d %d     %d %d \n",x1,x2,y1,y2,z1,z2);
        _imageViewer2XYZ -> SetExtentDimension(x1,x2,y1,y2,z1,z2);
        _imageViewer2XYZ -> GetVtkImageViewer2()->SetupInteractor ( iren );
 
 //EED 24oct2010
     _imageViewer2XYZ->GetVtkImageViewer2()->GetWindowLevel()->Modified();
 
-       _imageViewer2XYZ->GetVtkImageViewer2()->Render();
+//EED2120-06-23        _imageViewer2XYZ->GetVtkImageViewer2()->Render();
 
        //////////////
        //RaC 04-2010 Look for the description of new changes in vtkInteractorStyleBaseView2D constructor.
@@ -141,11 +139,10 @@ printf("//EED wxVtk2DBaseView::ResetView %d %d    %d %d     %d %d \n",x1,x2,y1,y
        vtkInteractorScrollZ *_vtkInteractorScrollZ = new vtkInteractorScrollZ();
        style2D->SetInteractorScrollZ(_vtkInteractorScrollZ);
 
-       SetInteractorStyleImage( style2D );
-
-       // RaC
-       //////////////
+       vtkInteractorZoomCamera *_vtkInteractorZoomCamera = new vtkInteractorZoomCamera();
+       style2D->SetInteractorZoomCamera(_vtkInteractorZoomCamera);
 
+       SetInteractorStyleImage( style2D );
 }
 
 //-------------------------------------------------------------------
@@ -200,6 +197,9 @@ void wxVtk2DBaseView::Configure(bool okimage)
                vtkInteractorScrollZ *_vtkInteractorScrollZ = new vtkInteractorScrollZ();
                style2D->SetInteractorScrollZ(_vtkInteractorScrollZ);
 
+               vtkInteractorZoomCamera *_vtkInteractorZoomCamera = new vtkInteractorZoomCamera();
+               style2D->SetInteractorZoomCamera(_vtkInteractorZoomCamera);
+
                SetInteractorStyleImage( style2D );
 
                // RaC
@@ -418,3 +418,37 @@ int wxVtk2DBaseView::GetDirection() // virtual
     return 2;
 }
 
+//-------------------------------------------------------------------
+void wxVtk2DBaseView::GetNormal(double normal[3] ) // virtual
+{
+       if (GetDirection()==0 ) 
+       {
+               normal[0]=1;
+               normal[1]=0;
+               normal[2]=0;
+       } // if
+       if (GetDirection()==1 ) 
+       {
+               normal[0]=0;
+               normal[1]=1;
+               normal[2]=0;
+       } // if
+       if (GetDirection()==2 ) 
+       {
+               normal[0]=0;
+               normal[1]=0;
+               normal[2]=1;
+       } // if
+}
+
+
+//-------------------------------------------------------------------
+void wxVtk2DBaseView::SetOpacityText(double opacity)
+{
+       if (_vtkIinfoTextImage!=NULL)
+       {
+               _vtkIinfoTextImage->SetOpacity( opacity );
+       }
+}
+
+