]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx
Merge branch 'master' of ssh://git.creatis.insa-lyon.fr/creaMaracasVisu
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxVtk3DBaseView.cxx
index ecfae840fe818c084eaeddc62614cd2546649cb2..699750d2b6fcf01a33da8f9fa6c73e45662b0e14 100644 (file)
@@ -1,3 +1,28 @@
+/*# ---------------------------------------------------------------------
+#
+# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+#                        pour la Sant�)
+# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+# Previous Authors : Laurent Guigues, Jean-Pierre Roux
+# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+#
+#  This software is governed by the CeCILL-B license under French law and
+#  abiding by the rules of distribution of free software. You can  use,
+#  modify and/ or redistribute the software under the terms of the CeCILL-B
+#  license as circulated by CEA, CNRS and INRIA at the following URL
+#  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+#  or in the file LICENSE.txt.
+#
+#  As a counterpart to the access to the source code and  rights to copy,
+#  modify and redistribute granted by the license, users are provided only
+#  with a limited warranty  and the software's author,  the holder of the
+#  economic rights,  and the successive licensors  have only  limited
+#  liability.
+#
+#  The fact that you are presently reading this means that you have had
+#  knowledge of the CeCILL-B license and that you accept its terms.
+# ------------------------------------------------------------------------ */
+
 #include "wxVtk3DBaseView.h"
 
 #include "vtkInteractorStyleBaseView3D.h"
@@ -47,13 +72,44 @@ void wxVtk3DBaseView::Refresh()
        vtkRenderWindowInteractor *vri = GetWxVTKRenderWindowInteractor();
        vri->vtkRenderWindowInteractor::Render();
 }
+
+
+//-------------------------------------------------------------------
+void wxVtk3DBaseView::SetStereo(int type)
+{
+       //EED 02/06/2012  
+       
+       if (_renWin!=NULL)
+       {
+               if (type==0)
+               {
+                       _renWin->SetStereoRender(0); // OFF
+               } else {
+                       _renWin->SetStereoRender(1); // ON
+                       _renWin->SetStereoCapableWindow(1);
+                       _renWin->SetAnaglyphColorMask(4,3);
+                       _renWin->SetAnaglyphColorSaturation(0.65);
+               
+                       // VTK_STEREO_CRYSTAL_EYES 1
+                       // VTK_STEREO_RED_BLUE     2
+                       // VTK_STEREO_INTERLACED   3
+                       // VTK_STEREO_LEFT         4
+                       // VTK_STEREO_RIGHT        5
+                       // VTK_STEREO_DRESDEN      6
+                       // VTK_STEREO_ANAGLYPH     7
+                       // VTK_STEREO_CHECKERBOARD 8            
+                       _renWin->SetStereoType(type);      
+               
+               } // if type
+       } // _renWin
+}
+
+
 //-------------------------------------------------------------------
 void wxVtk3DBaseView::Configure()
 {
-       printf("EED wxVtk3DBaseView::Configure A\n");
        if (_configure==false)
        {
-       printf("EED wxVtk3DBaseView::Configure B\n");
                _configure=true;
                //wxVtkBaseView::Configure();
                _aRenderer      = vtkRenderer::New();
@@ -64,21 +120,8 @@ void wxVtk3DBaseView::Configure()
                _aRenderer->SetBackground( 0.33 , 0.33 , 0.33 );
                _aRenderer->SetBackground2( 0.66 , 0.66 , 0.66 );
                
+               SetStereo(0);
                
-//       _renWin->SetStereoCapableWindow(1);
-// //      //renderwindow->SetStereoTypeToCrystalEyes();  
-//       _renWin->SetStereoTypeToRedBlue();
-//       _renWin->SetStereoRender(1);
-
-//EED 19/10/2011 OK  EED stereo 
-//             _renWin->SetStereoCapableWindow(1);
-//             _renWin->SetAnaglyphColorMask(4,3);
-//             _renWin->SetAnaglyphColorSaturation(0.65);
-//             _renWin->SetStereoTypeToAnaglyph();         // OK 1.
-//             _renWin->SetStereoRender(1);
-               printf("EED wxVtk3DBaseView::Configure  test Stereo ...\n");
-               
-
                GetWxVTKRenderWindowInteractor()->SetRenderWindow(_renWin);
 
                vtkInteractorStyleBaseView3D *interactorStyleBaseView3D = vtkInteractorStyleBaseView3D::New();