]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
0023105: [CEA 1535] Be able to active stereo in VTK view and to choose which kind...
authorimn <imn@opencascade.com>
Thu, 16 Jul 2015 13:06:25 +0000 (16:06 +0300)
committerimn <imn@opencascade.com>
Thu, 16 Jul 2015 13:06:25 +0000 (16:06 +0300)
21 files changed:
src/LightApp/LightApp_Application.cxx
src/LightApp/LightApp_FullScreenHelper.cxx
src/LightApp/LightApp_FullScreenHelper.h
src/LightApp/resources/LightApp.xml
src/LightApp/resources/LightApp_msg_en.ts
src/LightApp/resources/LightApp_msg_fr.ts
src/LightApp/resources/LightApp_msg_ja.ts
src/Qtx/QtxWorkstack.cxx
src/Qtx/QtxWorkstack.h
src/SVTK/CMakeLists.txt
src/SVTK/SVTK_InteractorStyle.cxx
src/SVTK/SVTK_ViewModel.cxx
src/SVTK/SVTK_ViewModel.h
src/SVTK/SVTK_ViewParameterDlg.cxx
src/SVTK/SVTK_ViewWindow.cxx
src/SVTK/SVTK_ViewWindow.h
src/SVTK/resources/SVTK_images.ts
src/SVTK/resources/SVTK_msg_en.ts
src/SVTK/resources/SVTK_msg_fr.ts
src/SVTK/resources/SVTK_msg_ja.ts
src/SVTK/resources/vtk_view_stereo.png [new file with mode: 0644]

index ab27384ed9fee212d4c4351dc8c0c3ef61800b20..ed6e0e8e2d437a2e805d178155974e7d753b9afd 100644 (file)
@@ -1562,6 +1562,8 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
     if( vm )
     {
       vm->setProjectionMode( resMgr->integerValue( "VTKViewer", "projection_mode", vm->projectionMode() ) );
+      vm->setStereoType( resMgr->integerValue( "VTKViewer", "stereo_type", vm->stereoType() ) );
+      vm->setAnaglyphFilter( resMgr->integerValue( "VTKViewer", "anaglyph_filter", vm->anaglyphFilter() ) );
       vm->setBackground( resMgr->backgroundValue( "VTKViewer", "background", vm->background() ) );
       vm->setTrihedronSize( resMgr->doubleValue( "3DViewer", "trihedron_size", vm->trihedronSize() ),
                             resMgr->booleanValue( "3DViewer", "relative_size", vm->trihedronRelative() ) );
@@ -2258,6 +2260,13 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
   pref->setItemProperty( "strings", aValuesList,   mruLinkType );
   pref->setItemProperty( "indexes", anIndicesList, mruLinkType );
   // ... "MRU" preferences group <<end>>
+  // ... "Full-screen" group <<start>>
+  int fullScreenGroup = pref->addPreference( tr( "PREF_GROUP_FULL_SCREEN" ), genTab );
+  pref->setItemProperty( "columns", 2, fullScreenGroup );
+  // .... -> automatic hiding toolbars
+  pref->addPreference( tr( "PREF_FULL_SCREEN_AUTO" ), fullScreenGroup,
+                       LightApp_Preferences::Bool, "OCCViewer", "automatic_hiding" );
+  // ... "Full-screen" group <<end>>
   // .. "General" preferences tab <<end>>
 
   // .. "3D viewer" group <<start>>
@@ -2426,10 +2435,40 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
   anIndicesList << 0                       << 1;
   pref->setItemProperty( "strings", aValuesList,   vtkProjMode );
   pref->setItemProperty( "indexes", anIndicesList, vtkProjMode );
+
+  // .... -> Stereo group
+  int vtkStereoGroup = pref->addPreference( tr( "PREF_GROUP_STEREO" ), vtkGroup);
+  pref->setItemProperty( "columns", 2, vtkStereoGroup );
+  // .... -> Stereo type
+  int vtkStereoType = pref->addPreference( tr( "PREF_STEREO_TYPE" ), vtkStereoGroup,
+                                           LightApp_Preferences::Selector, "VTKViewer", "stereo_type" );
+  aValuesList.clear();
+  anIndicesList.clear();
+  idList.clear();
+  SVTK_Viewer::stereoData( aValuesList, idList);
+  foreach( int gid, idList ) anIndicesList << gid;
+  pref->setItemProperty( "strings", aValuesList,   vtkStereoType );
+  pref->setItemProperty( "indexes", anIndicesList, vtkStereoType );
+  // .... -> Anaglyph filter
+  int vtkAnaglyphFilter = pref->addPreference( tr( "PREF_ANAGLYPH_FILTER" ), vtkStereoGroup,
+                                               LightApp_Preferences::Selector, "VTKViewer", "anaglyph_filter" );
+  aValuesList.clear();
+  anIndicesList.clear();
+  aValuesList   << tr("PREF_ANAGLYPH_RED_CYAN") << tr("PREF_ANAGLYPH_YELLOW_BLUE") << tr("PREF_ANAGLYPH_GREEN_MAGENTA");
+  anIndicesList << 0                            << 1                               << 2;
+
+  pref->setItemProperty( "strings", aValuesList,   vtkAnaglyphFilter );
+  pref->setItemProperty( "indexes", anIndicesList, vtkAnaglyphFilter );
+
+  // .... -> Enable quad-buffer support
+  pref->addPreference( tr( "PREF_ENABLE_QUAD_BUFFER_SUPPORT" ), vtkStereoGroup,
+                       LightApp_Preferences::Bool, "VTKViewer", "enable_quad_buffer_support" );
+
   // .... -> background
   aValuesList.clear();
   anIndicesList.clear();
   txtList.clear();
+  idList.clear();
 #ifndef DISABLE_SALOMEOBJECT
   formats = SVTK_Viewer::backgroundData( aValuesList, idList, txtList );
 #endif
@@ -3060,6 +3099,48 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
   }
 #endif
 
+#ifndef DISABLE_VTKVIEWER
+  if ( sec == QString( "VTKViewer" ) && param == QString( "stereo_type" ) )
+  {
+    int mode = resMgr->integerValue( "VTKViewer", "stereo_type", 0 );
+    QList<SUIT_ViewManager*> lst;
+#ifndef DISABLE_SALOMEOBJECT
+    viewManagers( SVTK_Viewer::Type(), lst );
+    QListIterator<SUIT_ViewManager*> it( lst );
+    while ( it.hasNext() )
+    {
+      SUIT_ViewModel* vm = it.next()->getViewModel();
+      if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
+        continue;
+
+      SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
+      if( vtkVM ) vtkVM->setStereoType( mode );
+    }
+#endif
+  }
+#endif
+
+#ifndef DISABLE_VTKVIEWER
+  if ( sec == QString( "VTKViewer" ) && param == QString( "anaglyph_filter" ) )
+  {
+    int mode = resMgr->integerValue( "VTKViewer", "anaglyph_filter", 0 );
+    QList<SUIT_ViewManager*> lst;
+#ifndef DISABLE_SALOMEOBJECT
+    viewManagers( SVTK_Viewer::Type(), lst );
+    QListIterator<SUIT_ViewManager*> it( lst );
+    while ( it.hasNext() )
+    {
+      SUIT_ViewModel* vm = it.next()->getViewModel();
+      if ( !vm || !vm->inherits( "SVTK_Viewer" ) )
+        continue;
+
+      SVTK_Viewer* vtkVM = dynamic_cast<SVTK_Viewer*>( vm );
+      if( vtkVM ) vtkVM->setAnaglyphFilter( mode );
+    }
+#endif
+  }
+#endif
+
 #ifndef DISABLE_VTKVIEWER
   if ( sec == QString( "VTKViewer" ) && param == QString( "preselection" ) )
   {
index 2960e4edba3f7170cd8b822aa6b183a0a892e402..7ddce9822a53dbbeeb38439ef3de07f933c47baa 100644 (file)
 #include <QAction>
 #include <QMenuBar>
 #include <QStatusBar>
+#include <QToolBar>
+
+#include <QtxWorkstack.h>
 
 #include <STD_Application.h>
+#include <STD_TabDesktop.h>
 
 #include <SUIT_Session.h>
 #include <SUIT_Desktop.h>
 #include <SUIT_DataBrowser.h>
+#include <SUIT_ViewWindow.h>
+#include <SUIT_ResourceMgr.h>
 
 #include "LightApp_FullScreenHelper.h"
 #include "LightApp_Application.h"
@@ -74,6 +80,35 @@ void LightApp_FullScreenHelper::switchToFullScreen() {
   if(!desktop)
     return;
   
+  STD_TabDesktop* desk = dynamic_cast<STD_TabDesktop*>( desktop );
+
+  QtxWorkstack* wgStack = desk->workstack();
+  wgStack->showActiveTabBar(false);
+  myWindowsList.clear();
+  bool isHidding = false;
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  if ( resMgr )
+    isHidding = resMgr->booleanValue( "OCCViewer", "automatic_hiding", true );
+  //Hide all toolbars and inactive window
+  QList<SUIT_ViewWindow*> aWindowList = desk->windows();
+  SUIT_ViewWindow* anActiveWindow = desk->activeWindow();
+  QList<SUIT_ViewWindow*>::const_iterator it = aWindowList.begin();
+  for ( ; it!=aWindowList.end(); it++ ) {
+    QList<QToolBar*> lst = (*it)->findChildren<QToolBar*>();
+    if ( *it ) {
+      myWindowsList.push_back(*it);
+      ( *it )->hide();
+    }
+    if ( isHidding ) {
+      QList<QToolBar*>::const_iterator iter = lst.begin();
+      for ( ; iter!=lst.end(); iter++ ) {
+        (*iter)->hide();
+      }
+    }
+  }
+  if (anActiveWindow)
+    anActiveWindow->show();
+
   desktop->setWindowState(desktop->windowState() ^ Qt::WindowFullScreen);
 
   if(desktop->menuBar())
@@ -92,7 +127,7 @@ void LightApp_FullScreenHelper::switchToFullScreen() {
   myDocWidgetMap.clear();
 
   QWidget* ob = app->objectBrowser();
-  QObject* obParent = ob ? ob->parent() : 0;
+  QObject* obParent = (ob && !isHidding)? ob->parent() : 0;
 
   foreach(QDockWidget* aWidget, aDocWidgets) {
     if(aWidget && aWidget->parent() == desktop) {
@@ -153,6 +188,28 @@ void LightApp_FullScreenHelper::switchToNormalScreen() {
   
   desktop->setWindowState(desktop->windowState() ^ Qt::WindowFullScreen);
 
+  STD_TabDesktop* desk = dynamic_cast<STD_TabDesktop*>( desktop );
+
+  QtxWorkstack* wgStack = desk->workstack();
+  wgStack->showActiveTabBar(true);
+
+  bool isHidding = false;
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  if ( resMgr )
+    isHidding = resMgr->booleanValue( "OCCViewer", "automatic_hiding", true );
+  //Show all toolbars and windows
+  QList<SUIT_ViewWindow*>::const_iterator itr = myWindowsList.begin();
+  for ( ; itr!=myWindowsList.end(); itr++ ) {
+    QList<QToolBar*> lst = (*itr)->findChildren<QToolBar*>();
+    if (*itr && !(*itr)->isVisible())
+      (*itr)->show();
+    if ( isHidding ) {
+      QList<QToolBar*>::const_iterator iter = lst.begin();
+      for ( ; iter!=lst.end(); iter++ ) {
+        (*iter)->show();
+      }
+    }
+  }
 
   DocWidgetMap::iterator it = myDocWidgetMap.begin();
   for( ;it != myDocWidgetMap.end() ; it++ ) {
index 7cc44351451a1d718f014a1286f62f46994f7ccc..e5f4dedf45e7faed7fc94753e94811eb2a284960 100644 (file)
@@ -46,10 +46,9 @@ class LIGHTAPP_EXPORT LightApp_FullScreenHelper {
  private:
   typedef QMap<QDockWidget*,bool> DocWidgetMap;
   DocWidgetMap myDocWidgetMap;
-
   typedef QMap<QToolBar*, bool> ToolBarMap;
   ToolBarMap myToolBarMap;
-
+  QList<SUIT_ViewWindow*> myWindowsList;
 
   bool myStatusBarVisibility;
 
index c8034c4bcf412ea2996a52b318235140d0c25c6b..5af653a277b49d3e4e6438d41c685754ceb17ff1 100644 (file)
     <!-- VTK viewer preferences -->
     <parameter name="background"                       value="0, 0, 0"/>
     <parameter name="projection_mode"                  value="0"/>
+    <parameter name="stereo_type"                      value="0"/>
+    <parameter name="anaglyph_filter"                  value="0"/>
+    <parameter name="enable_quad_buffer_support"       value="false"/>
     <parameter name="preselection"                     value="0"/>
     <parameter name="enable_selection"                 value="true"/>
     <parameter name="speed_value"                      value="10"/>
index e146f865467d68e474991b38941e322c7c104d35..c35522f0246d0fb36559ef7c7e086cb04f8013f6 100644 (file)
@@ -627,6 +627,34 @@ The changes will be applied on the next application session.</translation>
         <source>PREF_GROUP_OCCVIEWER</source>
         <translation>OCC 3D Viewer</translation>
     </message>
+    <message>
+        <source>PREF_GROUP_STEREO</source>
+        <translation>Stereo render</translation>
+    </message>
+    <message>
+        <source>PREF_STEREO_TYPE</source>
+        <translation>Stereo type</translation>
+    </message>
+    <message>
+        <source>PREF_ANAGLYPH_FILTER</source>
+        <translation>Anaglyph filter</translation>
+    </message>
+    <message>
+        <source>PREF_ANAGLYPH_RED_CYAN</source>
+        <translation>Red-Cyan</translation>
+    </message>
+    <message>
+        <source>PREF_ANAGLYPH_YELLOW_BLUE</source>
+        <translation>Yellow-Blue</translation>
+    </message>
+    <message>
+        <source>PREF_ANAGLYPH_GREEN_MAGENTA</source>
+        <translation>Green-Magenta</translation>
+    </message>
+    <message>
+        <source>PREF_ENABLE_QUAD_BUFFER_SUPPORT</source>
+        <translation>Enable quad-buffer support</translation>
+    </message>
     <message>
         <source>PREF_LOGARITHMIC</source>
         <translation>Logarithmic</translation>
@@ -888,6 +916,14 @@ File does not exist</translation>
         <source>PREF_GROUP_SHORTCUTS</source>
         <translation>Shortcuts settings</translation>
     </message>
+    <message>
+        <source>PREF_GROUP_FULL_SCREEN</source>
+        <translation>Full-screen</translation>
+    </message>
+    <message>
+        <source>PREF_FULL_SCREEN_AUTO</source>
+        <translation>Hide object browser and viewers toolbars</translation>
+    </message>
   <message>
     <source>PREF_TAB_PYEDITOR</source>
     <translation>Python Viewer</translation>
index 81ca07de70aa036e3d3d2f4f3245175a8c17acc3..80af332b3b7ee3deec355fe6d24554925b992482 100755 (executable)
@@ -627,6 +627,34 @@ Les modifications seront appliquées à la prochaine session.</translation>
         <source>PREF_GROUP_OCCVIEWER</source>
         <translation>Scène OCC 3D</translation>
     </message>
+    <message>
+        <source>PREF_GROUP_STEREO</source>
+        <translation type="unfinished">Stereo render</translation>
+    </message>
+    <message>
+        <source>PREF_STEREO_TYPE</source>
+        <translation type="unfinished">Stereo type</translation>
+    </message>
+    <message>
+        <source>PREF_ANAGLYPH_FILTER</source>
+        <translation type="unfinished">Anaglyph filter</translation>
+    </message>
+    <message>
+        <source>PREF_ANAGLYPH_RED_CYAN</source>
+        <translation type="unfinished">Red-Cyan</translation>
+    </message>
+    <message>
+        <source>PREF_ANAGLYPH_YELLOW_BLUE</source>
+        <translation type="unfinished">Yellow-Blue</translation>
+    </message>
+    <message>
+        <source>PREF_ANAGLYPH_GREEN_MAGENTA</source>
+        <translation type="unfinished">Green-Magenta</translation>
+    </message>
+    <message>
+        <source>PREF_ENABLE_QUAD_BUFFER_SUPPORT</source>
+        <translation type="unfinished">Enable quad-buffer support</translation>
+    </message>
     <message>
         <source>PREF_LOGARITHMIC</source>
         <translation>Logarithmique</translation>
@@ -888,6 +916,14 @@ Le fichier n&apos;existe pas</translation>
         <source>PREF_GROUP_SHORTCUTS</source>
         <translation>Réglage des raccourcis clavier</translation>
     </message>
+    <message>
+        <source>PREF_GROUP_FULL_SCREEN</source>
+        <translation type="unfinished">Full-screen</translation>
+    </message>
+    <message>
+        <source>PREF_FULL_SCREEN_AUTO</source>
+        <translation type="unfinished">Hide object browser and viewers toolbars</translation>
+    </message>
     <message>
         <source>PREF_TAB_PYEDITOR</source>
         <translation>Editeur python</translation>
index 881dd0507f560f34b9094044e04d71221d407100..42400f42ee2939b500e043f7f0dbe66aaffa9c20 100644 (file)
@@ -627,6 +627,34 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
       <source>PREF_GROUP_OCCVIEWER</source>
       <translation>OCC 3D Viewer</translation>
     </message>
+    <message>
+      <source>PREF_GROUP_STEREO</source>
+      <translation type="unfinished">Stereo render</translation>
+    </message>
+    <message>
+      <source>PREF_STEREO_TYPE</source>
+      <translation type="unfinished">Stereo type</translation>
+    </message>
+    <message>
+      <source>PREF_ANAGLYPH_FILTER</source>
+      <translation type="unfinished">Anaglyph filter</translation>
+    </message>
+    <message>
+      <source>PREF_ANAGLYPH_RED_CYAN</source>
+      <translation type="unfinished">Red-Cyan</translation>
+    </message>
+    <message>
+      <source>PREF_ANAGLYPH_YELLOW_BLUE</source>
+      <translation type="unfinished">Yellow-Blue</translation>
+    </message>
+    <message>
+      <source>PREF_ANAGLYPH_GREEN_MAGENTA</source>
+      <translation type="unfinished">Green-Magenta</translation>
+    </message>
+    <message>
+      <source>PREF_ENABLE_QUAD_BUFFER_SUPPORT</source>
+      <translation type="unfinished">Enable quad-buffer support</translation>
+    </message>
     <message>
       <source>PREF_LOGARITHMIC</source>
       <translation>対数</translation>
@@ -887,6 +915,14 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
       <source>PREF_GROUP_SHORTCUTS</source>
       <translation>ショートカットの設定</translation>
     </message>
+    <message>
+      <source>PREF_GROUP_FULL_SCREEN</source>
+      <translation type="unfinished">Full-screen</translation>
+    </message>
+    <message>
+      <source>PREF_FULL_SCREEN_AUTO</source>
+      <translation type="unfinished">Hide object browser and viewers toolbars</translation>
+    </message>
     <message>
       <source>PREF_TAB_PYEDITOR</source>
       <translation>Python Viewer</translation>
index b4abe7b8fd5367b79cae1581b89da6083abe13cc..cd8944258b9ee22fbdf540290929486430533c4a 100644 (file)
@@ -528,16 +528,16 @@ QtxWorkstackArea::QtxWorkstackArea( QWidget* parent )
   base->setMargin( frameWidth() );
   base->setSpacing( 0 );
 
-  QWidget* top = new QWidget( this );
-  base->addWidget( top );
+  myTop = new QWidget( this );
+  base->addWidget( myTop );
 
-  QHBoxLayout* tl = new QHBoxLayout( top );
+  QHBoxLayout* tl = new QHBoxLayout( myTop );
   tl->setMargin( 0 );
 
-  myBar = new QtxWorkstackTabBar( top );
+  myBar = new QtxWorkstackTabBar( myTop );
   tl->addWidget( myBar, 1 );
 
-  CloseButton* close = new CloseButton( top );
+  CloseButton* close = new CloseButton( myTop );
   close->setIcon( style()->standardIcon( QStyle::SP_TitleBarCloseButton ) );
   myClose = close;
   tl->addWidget( myClose );
@@ -902,6 +902,16 @@ bool QtxWorkstackArea::restoreState( QDataStream& stream, QMap<QString, QtxWorks
   return true;
 }
 
+/*!
+  \brief Show/Hide tab bar.
+*/
+void QtxWorkstackArea::showTabBar( bool visible)
+{
+  myTop->setVisible(visible);
+  myBar->setVisible(visible);
+}
+
+
 /*!
   \brief Get rectangle to be drawn when highlighting drop area.
   \return area drop rectangle
@@ -3179,6 +3189,23 @@ bool QtxWorkstack::opaqueResize() const
   return mySplit->opaqueResize();
 }
 
+/*!
+  \brief Show/Hide active tab bar.
+*/
+void QtxWorkstack::showActiveTabBar( bool visible )
+{
+  QList<QtxWorkstackArea*> areaList;
+  areas( mySplit, areaList, true );
+  QList<QtxWorkstackArea*>::ConstIterator it;
+  for ( it = areaList.begin(); it != areaList.end(); ++it )
+  {
+    (*it)->showTabBar( visible );
+  }
+  QList<QSplitter*> recList;
+  splitters( mySplit, recList, true );
+  for ( QList<QSplitter*>::iterator itr = recList.begin(); itr != recList.end(); ++itr )
+    (*itr)->setVisible(visible);
+}
 
 /*!
   \fn void QtxWorkstack::windowActivated( QWidget* w )
index 8772058a5ea9cfd498e3365428b4a3350b91e9b7..6d8e89bd2d21881c0e3bbf26dba8ebefc275e8c9 100644 (file)
@@ -116,6 +116,8 @@ public:
   void                setOpaqueResize( bool = true );
   bool                opaqueResize() const;
 
+  void                showActiveTabBar( bool = true );
+
   void Split( QWidget* wid, const Qt::Orientation o, const SplitType type );
   void Attract( QWidget* wid1, QWidget* wid2, const bool all );
   void SetRelativePosition( QWidget* wid, const Qt::Orientation o, const double pos );
@@ -244,6 +246,8 @@ public:
   void                saveState( QDataStream& ) const;
   bool                restoreState( QDataStream&, QMap<QString, QtxWorkstackChild*>& );
 
+  void                showTabBar( bool = true);
+
 signals:
   void                activated( QWidget* );
   void                contextMenuRequested( QWidget*, QPoint );
@@ -294,6 +298,7 @@ private:
   typedef QList<QtxWorkstackChild*> ChildList;
 
 private:
+  QWidget*            myTop;     //!< workarea top widget
   QtxWorkstackTabBar* myBar;     //!< workarea tab bar header
   ChildList           myList;    //!< child widgets list
   QAbstractButton*    myClose;   //!< close button
index 69f99a0140f0587260e8bd9586344fdae9a7e7c8..53a802ae31b193c1b6582c3884bf46c91b87d7b8 100755 (executable)
@@ -139,6 +139,7 @@ SET(_other_RESOURCES
   resources/vtk_view_rotation_point.png
   resources/vtk_view_scaling.png
   resources/vtk_view_selection.png
+  resources/vtk_view_stereo.png
   resources/vtk_view_style_switch.png
   resources/vtk_view_update_rate.png
   resources/vtk_view_zooming_style_switch.png
index 6a94115f552edf5a341c5177025edc55473caa30..5ab2ac63ad2454251d26d628f069ade4f1653013 100644 (file)
@@ -1200,11 +1200,6 @@ void SVTK_InteractorStyle::onFinishOperation()
 
           if( anActorCollection )
           {
-           if( !myShiftState && 
-               anActorCollection->GetNumberOfItems () > 1 && 
-               myLastHighlitedActor.GetPointer() ) {
-             anActorCollection->RemoveItem ( myLastHighlitedActor.GetPointer() );
-           }         
             anActorCollection->InitTraversal();
             while( vtkActor* aVTKActor = anActorCollection->GetNextActor() )
             {
index 977da9440202d237548f10f5a280cbd83e265436..9109c2f80042c0cd43969418e747a8a50292b2b5 100644 (file)
@@ -84,6 +84,8 @@ SVTK_Viewer::SVTK_Viewer()
   myIncrementSpeed = 10;
   myIncrementMode = 0;
   myProjMode = 0;
+  myStereoType = 0;
+  myAnaglyphFilter = 0;
   myStyle = 0;
   myZoomingStyle = 0;
   mySelectionEnabled = true;
@@ -126,6 +128,21 @@ QString SVTK_Viewer::backgroundData( QStringList& gradList, QIntList& idList, QI
   return tr("BG_IMAGE_FILES");
 }
 
+/*! Get data for supported background modes: gradient types, identifiers and supported image formats */
+void SVTK_Viewer::stereoData( QStringList& typeList, QIntList& idList )
+{
+  typeList << tr("ST_CRYSTALEYES") << tr("ST_REDBLUE")      <<
+              tr("ST_INTERLACED")  << tr("ST_LEFT")         <<
+              tr("ST_RIGHT")       << tr("ST_DRESDEN")      <<
+              tr("ST_ANAGLYPH")    << tr("ST_CHECKERBOARD") <<
+              tr("ST_SPLITVIEWPORTHORIZONTAL");
+  idList   << CrystalEyesType << RedBlueType      <<
+              InterlacedType  << LeftType         <<
+              RightType       << DresdenType      <<
+              AnaglyphType    << CheckerboardType <<
+              SplitViewPortHorizontalType;
+}
+
 //! Get background color of the viewer [obsolete]
 QColor SVTK_Viewer::backgroundColor() const
 {
@@ -177,6 +194,8 @@ SUIT_ViewWindow* SVTK_Viewer::createView( SUIT_Desktop* theDesktop )
   aViewWindow->SetTrihedronSize( trihedronSize(), trihedronRelative() );
   aViewWindow->SetStaticTrihedronVisible( isStaticTrihedronVisible() );
   aViewWindow->SetProjectionMode( projectionMode() );
+  aViewWindow->SetStereoType( stereoType() );
+  aViewWindow->SetAnaglyphFilter( anaglyphFilter() );
   aViewWindow->SetInteractionStyle( interactionStyle() );
   aViewWindow->SetZoomingStyle( zoomingStyle() );
   aViewWindow->SetPreSelectionMode( preSelectionMode() );
@@ -270,8 +289,8 @@ int SVTK_Viewer::projectionMode() const
 void SVTK_Viewer::setProjectionMode( const int theMode )
 {
   if ( myProjMode != theMode ) {
-    myProjMode = theMode;
-
+    if ( theMode != SVTK_ViewWindow::Stereo )
+         myProjMode = theMode;
     if (SUIT_ViewManager* aViewManager = getViewManager()) {
       QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
       for ( uint i = 0; i < aViews.count(); i++ )
@@ -283,6 +302,62 @@ void SVTK_Viewer::setProjectionMode( const int theMode )
   }
 }
 
+/*!
+  \return stereo type
+*/
+int SVTK_Viewer::stereoType() const
+{
+  return myStereoType;
+}
+
+/*!
+  Sets stereo type
+  \param theType - new stereo type
+*/
+void SVTK_Viewer::setStereoType( const int theType )
+{
+  if ( myStereoType != theType ) {
+    myStereoType = theType;
+
+    if (SUIT_ViewManager* aViewManager = getViewManager()) {
+      QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
+      for ( uint i = 0; i < aViews.count(); i++ )
+      {
+        if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
+          aView->SetStereoType( theType );
+      }
+    }
+  }
+}
+
+/*!
+  \return anaglyph filter
+*/
+int SVTK_Viewer::anaglyphFilter() const
+{
+  return myAnaglyphFilter;
+}
+
+/*!
+  Sets anaglyph filter
+  \param theFilter - new anaglyph filter
+*/
+void SVTK_Viewer::setAnaglyphFilter( const int theFilter )
+{
+  if ( myAnaglyphFilter != theFilter ) {
+         myAnaglyphFilter = theFilter;
+
+    if (SUIT_ViewManager* aViewManager = getViewManager()) {
+      QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
+      for ( uint i = 0; i < aViews.count(); i++ )
+      {
+        if ( TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at( i )) )
+          aView->SetAnaglyphFilter( theFilter );
+      }
+    }
+  }
+}
+
 /*!
   \return interaction style
 */
index 5215a25560f82195771f625c87aa9fdec88c7d2d..b5f04839a3edf5de514ebb2fcbe4c2cb4a4156ec 100644 (file)
@@ -60,11 +60,19 @@ public:
     LastGradient = FourthCornerGradient,
   };
 
+  enum {
+    CrystalEyesType, RedBlueType,
+    InterlacedType,  LeftType,
+    RightType,       DresdenType,
+    AnaglyphType,    CheckerboardType,
+    SplitViewPortHorizontalType
+  };
   typedef SVTK_ViewWindow TViewWindow;
   
   //! Define string representation of the viewer type
   static QString           Type() { return "VTKViewer"; }
   static QString           backgroundData( QStringList&, QIntList&, QIntList& );
+  static void              stereoData( QStringList&, QIntList&);
 
   SVTK_Viewer();
   virtual ~SVTK_Viewer();
@@ -114,6 +122,18 @@ public:
   //! Sets projection mode
   void setProjectionMode( const int );
 
+  //! Gets stereo type
+  int stereoType() const;
+
+  //! Sets stereo type
+  void setStereoType( const int );
+
+  //! Gets anaglyph filter
+  int anaglyphFilter() const;
+
+  //! Sets anaglyph filter
+  void setAnaglyphFilter( const int );
+
   //! Gets interaction style
   int interactionStyle() const;
 
@@ -206,6 +226,8 @@ private:
   int                  myIncrementSpeed;
   int                  myIncrementMode;
   int                  myProjMode;
+  int                  myStereoType;
+  int                  myAnaglyphFilter;
   int                  myStyle;
   int                  myZoomingStyle;
   Preselection_Mode    myPreSelectionMode;
index f686464c3f4e60793fb81ff6602c6dcd33fd3e9f..6db03e85446a4cc374b24623009551ebbf7e2bfd 100755 (executable)
@@ -500,8 +500,8 @@ void SVTK_ViewParameterDlg::onProjectionModeChanged(int mode)
 
   vtkCamera* aCamera = myRWInteractor->getRenderer()->GetActiveCamera();
   aCamera->SetParallelProjection(aBtn == 0);
-
-  myMainWindow->activateProjectionMode(aBtn);
+  if (!myBusy)
+    myMainWindow->activateProjectionMode(!aBtn);
 
   // update view
   myRWInteractor->GetDevice()->CreateTimer(VTKI_TIMER_FIRST);
index 88bb74354f6fee0638375c19eaef443fe2d1dd7d..88bee3fc564129f013c040b977cb08d48376f1f8 100755 (executable)
 
 #include <OpenGLUtils_FrameBuffer.h>
 
+#include <GL/gl.h>
+
 namespace SVTK
 {
   int convertAction( const int accelAction )
@@ -183,6 +185,9 @@ void SVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel)
   myInteractor->setBackgroundRole( QPalette::NoRole );//NoBackground
   myInteractor->setFocusPolicy(Qt::StrongFocus);
   myInteractor->setFocus();
+  bool isSupportQuadBuffer = SUIT_Session::session()->resourceMgr()->
+    booleanValue( "VTKViewer", "enable_quad_buffer_support", false );
+  myInteractor->getRenderWindow()->SetStereoCapableWindow((int)isSupportQuadBuffer);
   setFocusProxy(myInteractor);
   
   myUpdateRateDlg = new SVTK_UpdateRateDlg( getAction( UpdateRate ), this, "SVTK_UpdateRateDlg" );
@@ -850,13 +855,145 @@ double SVTK_ViewWindow::GetTrihedronSize() const
 
 /*!
   Sets projection mode
-  \param theMode - projection mode ( 0 - orthogonal, 1 - perspective )
+  \param theMode - projection mode ( 0 - orthogonal, 1 - perspective, 2 - stereo )
 */
 void SVTK_ViewWindow::SetProjectionMode(const int theMode)
 {
-  activateProjectionMode( theMode );
+  SVTK_Viewer* aViewer = dynamic_cast<SVTK_Viewer*>(myModel);
+
+  if ( theMode != Stereo ) {
+    aViewer->setProjectionMode(theMode);
+    bool anIsParallelMode = (theMode == Parallel);
+    vtkCamera* aCamera = getRenderer()->GetActiveCamera();
+    aCamera->SetParallelProjection(anIsParallelMode);
+    GetInteractor()->GetDevice()->CreateTimer(VTKI_TIMER_FIRST);
+    getRenderWindow()->SetStereoRender(0);
+  }
+  else {
+    SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+    SetStereoType( aResMgr->integerValue( "VTKViewer", "stereo_type", 0 ) );
+    getRenderWindow()->SetStereoRender(1);
+  }
+  Repaint();
+
+  // update action state if method is called outside
+  QtxAction* aParallelAction = dynamic_cast<QtxAction*>( toolMgr()->action( ParallelModeId ) );
+  QtxAction* aProjectionAction = dynamic_cast<QtxAction*>( toolMgr()->action( ProjectionModeId ) );
+  QtxAction* aStereoAction = dynamic_cast<QtxAction*>( toolMgr()->action( StereoModeId ) );
+  QtxAction* aSwitchZoomingStyle = dynamic_cast<QtxAction*>( toolMgr()->action( SwitchZoomingStyleId ) );
+  if ( theMode == Parallel && !aParallelAction->isChecked() ) {
+      aParallelAction->setChecked( true );
+         aSwitchZoomingStyle->setEnabled(true);
+         aStereoAction->setChecked( false );
+  }
+  if ( theMode == Projection && !aProjectionAction->isChecked() ) {
+      aProjectionAction->setChecked( true );
+         aSwitchZoomingStyle->setEnabled(false);
+  }
+  if ( theMode == Stereo ) {
+    aStereoAction->setChecked( true );
+    if ( aParallelAction->isEnabled() ) {
+        aParallelAction->setEnabled( false );
+        aParallelAction->setChecked( false );
+        aStereoAction->setChecked( false );
+    }
+    else {
+      aParallelAction->setEnabled( true );
+      aStereoAction->setChecked( false );
+      aParallelAction->setChecked( aViewer->projectionMode() == Parallel );
+    }
+    if ( aProjectionAction->isEnabled() ) {
+      aProjectionAction->setEnabled( false );
+      aProjectionAction->setChecked( true );
+      if ( getRenderWindow()->GetStereoCapableWindow() == 1 && !isOpenGlStereoSupport() &&
+           strcmp( "CrystalEyes", getRenderWindow()->GetStereoTypeAsString() ) == 0 ){
+        SUIT_MessageBox::warning( 0, tr( "WRN_WARNING" ),  tr( "WRN_SUPPORT_QUAD_BUFFER" ) );
+      }
+    }
+    else {
+      aProjectionAction->setEnabled( true );
+      aStereoAction->setChecked( false );
+      aProjectionAction->setChecked( aViewer->projectionMode() == Projection );
+      onPerspectiveMode();
+    }
+  }
+  else {
+    if ( !aParallelAction->isEnabled() )
+      aParallelAction->setEnabled( true );
+    if ( !aProjectionAction->isEnabled() )
+      aProjectionAction->setEnabled( true );
+  }
+}
+
+/*!
+  Sets stereo type
+  \param theType - stereo type
+*/
+void SVTK_ViewWindow::SetStereoType(const int theType)
+{
+  vtkRenderWindow* aWindow = getRenderWindow();
+  switch (theType ) {
+  case CrystalEyes:
+    aWindow->SetStereoTypeToCrystalEyes();
+    break;
+  case RedBlue:
+    aWindow->SetStereoTypeToRedBlue();
+    break;
+  case Interlaced:
+    aWindow->SetStereoTypeToInterlaced();
+    break;
+  case Left:
+    aWindow->SetStereoTypeToLeft();
+    break;
+  case Right:
+    aWindow->SetStereoTypeToRight();
+    break;
+  case Dresden:
+    aWindow->SetStereoTypeToDresden();
+    break;
+  case Anaglyph:
+    aWindow->SetStereoTypeToAnaglyph();
+    break;
+  case Checkerboard:
+    aWindow->SetStereoTypeToCheckerboard();
+    break;
+  case SplitViewPortHorizontal:
+    aWindow->SetStereoTypeToSplitViewportHorizontal();
+    break;
+  }
+}
+
+/*!
+  Sets anaglyph filter
+  \param theFilter - anaglyph filter
+*/
+void SVTK_ViewWindow::SetAnaglyphFilter(const int theFilter)
+{
+  vtkRenderWindow* aWindow = getRenderWindow();
+  switch (theFilter ) {
+  case RedCyan:
+    aWindow->SetAnaglyphColorMask(4,3);
+    break;
+  case YellowBlue:
+    aWindow->SetAnaglyphColorMask(6,1);
+    break;
+  case GreenMagenta:
+    aWindow->SetAnaglyphColorMask(2,5);
+    break;
+  }
 }
 
+/*!
+  \return OpenGl stereo support
+*/
+bool SVTK_ViewWindow::isOpenGlStereoSupport() const
+{
+  GLboolean support[1];
+  glGetBooleanv (GL_STEREO, support);
+  if ( support[0] )
+    return true;
+  return false;
+}
 
 /*!
   Set the gravity center as a focal point
@@ -884,10 +1021,17 @@ void SVTK_ViewWindow::activateStartFocalPointSelection()
 
 void SVTK_ViewWindow::activateProjectionMode(int theMode)
 {
+  QtxAction* aParallelAction = dynamic_cast<QtxAction*>( toolMgr()->action( ParallelModeId ) );
+  QtxAction* aProjectionAction = dynamic_cast<QtxAction*>( toolMgr()->action( ProjectionModeId ) );
   if (theMode)
-    toolMgr()->action( ProjectionModeId )->setChecked( true );
+    aParallelAction->setChecked( true );
   else
-    toolMgr()->action( ParallelModeId )->setChecked( true );
+    aProjectionAction->setChecked( true );
+
+  if ( !aParallelAction->isEnabled() )
+    aParallelAction->setEnabled( true );
+  if ( !aProjectionAction->isEnabled() )
+    aProjectionAction->setEnabled( true );
 }
 
 /*!
@@ -1891,16 +2035,12 @@ void SVTK_ViewWindow::activateStartPointSelection( Selection_Mode theSelectionMo
 */
 void SVTK_ViewWindow::onPerspectiveMode()
 {
-  bool anIsParallelMode = toolMgr()->action( ParallelModeId )->isChecked();
-
-  // advanced zooming is not available in perspective mode
-  if( QtxAction* anAction = getAction( SwitchZoomingStyleId ) )
-    anAction->setEnabled( anIsParallelMode );
-
-  vtkCamera* aCamera = getRenderer()->GetActiveCamera();
-  aCamera->SetParallelProjection(anIsParallelMode);
-  GetInteractor()->GetDevice()->CreateTimer(VTKI_TIMER_FIRST);
-
+  if (toolMgr()->action( ParallelModeId )->isChecked())
+    SetProjectionMode( Parallel);
+  if (toolMgr()->action( ProjectionModeId )->isChecked())
+    SetProjectionMode( Projection);
+  if (toolMgr()->action( StereoModeId )->isChecked())
+    SetProjectionMode( Stereo);
   emit transformed( this );
 }
 
@@ -2110,7 +2250,7 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr)
                            tr( "MNU_SVTK_PARALLEL_MODE" ), 0, this);
   anAction->setStatusTip(tr("DSC_SVTK_PARALLEL_MODE"));
   anAction->setCheckable(true);
-  connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onPerspectiveMode()));
+  //connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onPerspectiveMode()));
   mgr->registerAction( anAction, ParallelModeId );
 
   anAction = new QtxAction(tr("MNU_SVTK_PERSPECTIVE_MODE"), 
@@ -2118,12 +2258,22 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr)
                            tr( "MNU_SVTK_PERSPECTIVE_MODE" ), 0, this);
   anAction->setStatusTip(tr("DSC_SVTK_PERSPECTIVE_MODE"));
   anAction->setCheckable(true);
-  connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onPerspectiveMode()));
+  //connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onPerspectiveMode()));
   mgr->registerAction( anAction, ProjectionModeId );
 
+  anAction = new QtxAction(tr("MNU_SVTK_STEREO_MODE"),
+                             theResourceMgr->loadPixmap( "VTKViewer", tr( "ICON_SVTK_VIEW_STEREO" ) ),
+                             tr( "MNU_SVTK_STEREO_MODE" ), 0, this);
+  anAction->setStatusTip(tr("DSC_SVTK_STEREO_MODE"));
+  anAction->setCheckable(true);
+  //connect(anAction, SIGNAL(toggled(bool)), this, SLOT(onPerspectiveMode()));
+  mgr->registerAction( anAction, StereoModeId );
+
   QActionGroup* aPerspectiveGroup = new QActionGroup( this );
   aPerspectiveGroup->addAction( mgr->action( ParallelModeId ) );
   aPerspectiveGroup->addAction( mgr->action( ProjectionModeId ) );
+  aPerspectiveGroup->addAction( mgr->action( StereoModeId ) );
+  connect(aPerspectiveGroup, SIGNAL(triggered(QAction*)), this, SLOT(onPerspectiveMode()));
 
   // View Parameters
   anAction = new QtxAction(tr("MNU_VIEWPARAMETERS_VIEW"), 
@@ -2298,6 +2448,7 @@ void SVTK_ViewWindow::createToolBar()
 
   mgr->append( ParallelModeId, myToolBar );
   mgr->append( ProjectionModeId, myToolBar );
+  mgr->append( StereoModeId, myToolBar );
 
   mgr->append( StartRecordingId, myRecordingToolBar );
   mgr->append( PlayRecordingId, myRecordingToolBar );
index 9d27ced4f5cf4cdde0df97e51cb6a3cb9bee39b2..b0de0c81bfd2310fd00bbc04fc77433ba1d968ef 100755 (executable)
@@ -230,6 +230,12 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow
   //! Set current projection mode
   virtual void SetProjectionMode( const int );
 
+  //! Sets stereo type
+  virtual void SetStereoType( const int );
+
+  //! Sets anaglyph filter
+  virtual void SetAnaglyphFilter( const int );
+
   //! Set interactive style
   virtual void SetInteractionStyle( const int );
 
@@ -393,6 +399,13 @@ protected slots:
   void onMouseReleased(QMouseEvent* event);
   void onMouseMoving(QMouseEvent* event);
 
+public:
+  enum ProjectionType { Parallel, Projection, Stereo };
+
+  enum StereoType { CrystalEyes, RedBlue, Interlaced, Left, Right, Dresden, Anaglyph, Checkerboard, SplitViewPortHorizontal };
+
+  enum AnaglyphFilter { RedCyan, YellowBlue, GreenMagenta };
+
 protected:
   virtual void Initialize(SVTK_View* theView,
                           SVTK_ViewModelBase* theModel);
@@ -403,6 +416,8 @@ protected:
                             void* clientdata,
                             void* calldata);
 
+  bool isOpenGlStereoSupport() const;
+
   void doSetVisualParameters( const QString&, bool = false );
   void SetEventDispatcher(vtkObject* theDispatcher);
 
@@ -420,8 +435,8 @@ protected:
   enum { DumpId, FitAllId, FitRectId, FitSelectionId, ZoomId, PanId, GlobalPanId,
          ChangeRotationPointId, RotationId,
          FrontId, BackId, TopId, BottomId, LeftId, RightId, ClockWiseId, AntiClockWiseId, ResetId,
-        ViewTrihedronId, NonIsometric, GraduatedAxes, UpdateRate,
-         ParallelModeId, ProjectionModeId, ViewParametersId, SynchronizeId, SwitchInteractionStyleId,
+         ViewTrihedronId, NonIsometric, GraduatedAxes, UpdateRate,
+         ParallelModeId, ProjectionModeId, StereoModeId, ViewParametersId, SynchronizeId, SwitchInteractionStyleId,
          SwitchZoomingStyleId, 
         PreselectionId, StandardPreselectionId, DynamicPreselectionId, DisablePreselectionId, 
         EnableSelectionId,
index f446c771825d8456bde0ff561cfcf6a8b1503f3d..5aec9190e498ce6d38bc97d8824d2520d60df81e 100644 (file)
         <source>ICON_SVTK_VIEW_PERSPECTIVE</source>
         <translation>vtk_view_perspective.png</translation>
     </message>
+    <message>
+        <source>ICON_SVTK_VIEW_STEREO</source>
+        <translation>vtk_view_stereo.png</translation>
+    </message>
     <message>
         <source>ICON_SVTK_STYLE_SWITCH</source>
         <translation>vtk_view_style_switch.png</translation>
index 614c1656082434cadfc653f719466f72c0826728..f922e9b1431e961013fcd0800e0c3b9e09800c9e 100644 (file)
         <source>DSC_SVTK_PERSPECTIVE_MODE</source>
         <translation>Set the perspective projection type</translation>
     </message>
+    <message>
+        <source>MNU_SVTK_STEREO_MODE</source>
+        <translation>Stereo Mode</translation>
+    </message>
+    <message>
+        <source>DSC_SVTK_STEREO_MODE</source>
+        <translation>Set the stereo projection type</translation>
+    </message>
     <message>
         <source>DSC_SVTK_STYLE_SWITCH</source>
         <translation>Interaction style switch</translation>
     <message>
         <source>MNU_SVTK_ENABLE_SELECTION</source>
         <translation>Enable/Disable selection</translation>
-    </message>         
+    </message>
+    <message>
+        <source>WRN_SUPPORT_QUAD_BUFFER</source>
+        <translation>Graphic driver not support quad-buffer</translation>
+    </message>
 </context>
 <context>
     <name>SVTK_FontWidget</name>
@@ -663,5 +675,41 @@ Please, refer to the documentation.</translation>
         <source>BG_IMAGE_FILES</source>
         <translation>Image files (*.png *.jpg *.jpeg *.bmp *.tif *.tiff *.mhd *.mha)</translation>
     </message>
+    <message>
+        <source>ST_CRYSTALEYES</source>
+        <translation>Crystal Eyes</translation>
+    </message>
+    <message>
+        <source>ST_REDBLUE</source>
+        <translation>Red-Blue</translation>
+    </message>
+    <message>
+        <source>ST_INTERLACED</source>
+        <translation>Interlaced</translation>
+    </message>
+    <message>
+        <source>ST_LEFT</source>
+        <translation>Left</translation>
+    </message>
+    <message>
+        <source>ST_RIGHT</source>
+        <translation>Right</translation>
+    </message>
+    <message>
+        <source>ST_DRESDEN</source>
+        <translation>Dresden</translation>
+    </message>
+    <message>
+        <source>ST_ANAGLYPH</source>
+        <translation>Anaglyph</translation>
+    </message>
+    <message>
+        <source>ST_CHECKERBOARD</source>
+        <translation>Checkerboard</translation>
+    </message>
+    <message>
+        <source>ST_SPLITVIEWPORTHORIZONTAL</source>
+        <translation>Split View Port Horizontal</translation>
+    </message>
 </context>
 </TS>
index 5ea0cdea03f741bebed3199a8ffad9d4dc65d53b..efd27894c3c866a0c85f3eae8928bd6ccf0d92a2 100755 (executable)
         <source>DSC_SVTK_PERSPECTIVE_MODE</source>
         <translation>Choisir la projection en perspective</translation>
     </message>
+    <message>
+        <source>MNU_SVTK_STEREO_MODE</source>
+        <translation type="unfinished">Stereo Mode</translation>
+    </message>
+    <message>
+        <source>DSC_SVTK_STEREO_MODE</source>
+        <translation type="unfinished">Set the stereo projection type</translation>
+    </message>
     <message>
         <source>DSC_SVTK_STYLE_SWITCH</source>
         <translation>Changer le style d&apos;intéraction</translation>
     <message>
         <source>MNU_SVTK_ENABLE_SELECTION</source>
         <translation>Enable/Disable selection</translation>
-    </message>         
+    </message>
+    <message>
+        <source>WRN_SUPPORT_QUAD_BUFFER</source>
+        <translation type="unfinished">Graphic driver not support quad-buffer</translation>
+    </message> 
 </context>
 <context>
     <name>SVTK_FontWidget</name>
@@ -663,5 +675,41 @@ Veuillez consulter la documentation.</translation>
         <source>BG_IMAGE_FILES</source>
         <translation>Fichiers images (*.png *.jpg *.jpeg *.bmp *.tif *.tiff *.mhd *.mha)</translation>
     </message>
+    <message>
+        <source>ST_CRYSTALEYES</source>
+        <translation type="unfinished">Crystal Eyes</translation>
+    </message>
+    <message>
+        <source>ST_REDBLUE</source>
+        <translation type="unfinished">Red-Blue</translation>
+    </message>
+    <message>
+        <source>ST_INTERLACED</source>
+        <translation type="unfinished">Interlaced</translation>
+    </message>
+    <message>
+        <source>ST_LEFT</source>
+        <translation type="unfinished">Left</translation>
+    </message>
+    <message>
+        <source>ST_RIGHT</source>
+        <translation type="unfinished">Right</translation>
+    </message>
+    <message>
+        <source>ST_DRESDEN</source>
+        <translation type="unfinished">Dresden</translation>
+    </message>
+    <message>
+        <source>ST_ANAGLYPH</source>
+        <translation type="unfinished">Anaglyph</translation>
+    </message>
+    <message>
+        <source>ST_CHECKERBOARD</source>
+        <translation type="unfinished">Checkerboard</translation>
+    </message>
+    <message>
+        <source>ST_SPLITVIEWPORTHORIZONTAL</source>
+        <translation type="unfinished">Split View Port Horizontal</translation>
+    </message>
 </context>
 </TS>
index 7472ff435c152c66711859876a8db14e8dcd125f..a9cc240cb0c8b516a85cb4871909c2223748bd37 100644 (file)
       <source>DSC_SVTK_PERSPECTIVE_MODE</source>
       <translation>透視投影を選択します。</translation>
     </message>
+    <message>
+      <source>MNU_SVTK_STEREO_MODE</source>
+      <translation type="unfinished">Stereo Mode</translation>
+    </message>
+    <message>
+      <source>DSC_SVTK_STEREO_MODE</source>
+      <translation type="unfinished">Set the stereo projection type</translation>
+    </message>
     <message>
       <source>DSC_SVTK_STYLE_SWITCH</source>
       <translation>相互作用のスタイルを変更します。</translation>
       <source>MNU_SVTK_ENABLE_SELECTION</source>
       <translation>選択を有効/無効にします。</translation>
     </message>
+    <message>
+      <source>WRN_SUPPORT_QUAD_BUFFER</source>
+      <translation type="unfinished">Graphic driver not support quad-buffer</translation>
+    </message> 
   </context>
   <context>
     <name>SVTK_FontWidget</name>
       <source>BG_IMAGE_FILES</source>
       <translation>ファイル (*.png *.jpg *.jpeg、*.bmp, *.tif, *.tiff *.mhd *.mha)</translation>
     </message>
+    <message>
+      <source>ST_CRYSTALEYES</source>
+      <translation type="unfinished">Crystal Eyes</translation>
+    </message>
+    <message>
+      <source>ST_REDBLUE</source>
+      <translation type="unfinished">Red-Blue</translation>
+    </message>
+    <message>
+      <source>ST_INTERLACED</source>
+      <translation type="unfinished">Interlaced</translation>
+    </message>
+    <message>
+      <source>ST_LEFT</source>
+      <translation type="unfinished">Left</translation>
+    </message>
+    <message>
+      <source>ST_RIGHT</source>
+      <translation type="unfinished">Right</translation>
+    </message>
+    <message>
+      <source>ST_DRESDEN</source>
+      <translation type="unfinished">Dresden</translation>
+    </message>
+    <message>
+      <source>ST_ANAGLYPH</source>
+      <translation type="unfinished">Anaglyph</translation>
+    </message>
+    <message>
+      <source>ST_CHECKERBOARD</source>
+      <translation type="unfinished">Checkerboard</translation>
+    </message>
+    <message>
+      <source>ST_SPLITVIEWPORTHORIZONTAL</source>
+      <translation type="unfinished">Split View Port Horizontal</translation>
+    </message>
   </context>
 </TS>
diff --git a/src/SVTK/resources/vtk_view_stereo.png b/src/SVTK/resources/vtk_view_stereo.png
new file mode 100644 (file)
index 0000000..218a2a6
Binary files /dev/null and b/src/SVTK/resources/vtk_view_stereo.png differ