]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Merge remote branch 'origin/master'
authorCédric Aguerre <cedric.aguerre@edf.fr>
Fri, 11 Sep 2015 13:11:38 +0000 (15:11 +0200)
committerCédric Aguerre <cedric.aguerre@edf.fr>
Fri, 11 Sep 2015 13:11:38 +0000 (15:11 +0200)
38 files changed:
doc/salome/gui/images/occ_view_orthographic.png [new file with mode: 0644]
doc/salome/gui/images/occ_view_perspective.png [new file with mode: 0644]
doc/salome/gui/images/occ_view_stereo.png [new file with mode: 0644]
doc/salome/gui/images/occviewer_toolbar.png
doc/salome/gui/images/pref_salome_general.png
doc/salome/gui/images/pref_salome_occviewer.png
doc/salome/gui/images/pref_salome_vtkviewer.png
doc/salome/gui/input/occ_3d_viewer.doc
doc/salome/gui/input/setting_preferences.doc
src/CAM/CAM_Application.cxx
src/CAM/CAM_Application.h
src/CAM/CAM_Module.cxx
src/CAM/CAM_Module.h
src/LightApp/LightApp_Application.cxx
src/LightApp/LightApp_ShowHideOp.cxx
src/OCCViewer/OCCViewer_ViewModel.cxx
src/OCCViewer/OCCViewer_ViewWindow.cxx
src/OCCViewer/OCCViewer_ViewWindow.h
src/PVServerService/ServiceLoader/CMakeLists.txt
src/PVServerService/ServiceLoader/PVServerServiceLoader.h [new file with mode: 0644]
src/PVServerService/ServiceLoader/PVServer_ServiceLoader.h
src/SOCC/SOCC_ViewModel.cxx
src/STD/STD_Application.cxx
src/STD/STD_Application.h
src/SVTK/SALOME_Actor.cxx
src/SVTK/SVTK_CubeAxesActor2D.cxx
src/SVTK/SVTK_NonIsometricDlg.cxx
src/SVTK/SVTK_Renderer.cxx
src/SVTK/SVTK_UpdateRateDlg.cxx
src/SVTK/SVTK_ViewModel.cxx
src/SVTK/SVTK_ViewModel.h
src/SVTK/SVTK_ViewWindow.cxx
src/SVTK/SVTK_ViewWindow.h
src/SVTK/salomevtkPVAxesActor.h
src/SalomeApp/pluginsdemo/minmax_plugin.py
src/VTKViewer/VTKViewer_Actor.cxx
src/VTKViewer/VTKViewer_Trihedron.cxx
src/VTKViewer/VTKViewer_Utilities.cxx

diff --git a/doc/salome/gui/images/occ_view_orthographic.png b/doc/salome/gui/images/occ_view_orthographic.png
new file mode 100644 (file)
index 0000000..dd7a676
Binary files /dev/null and b/doc/salome/gui/images/occ_view_orthographic.png differ
diff --git a/doc/salome/gui/images/occ_view_perspective.png b/doc/salome/gui/images/occ_view_perspective.png
new file mode 100644 (file)
index 0000000..36cdd4c
Binary files /dev/null and b/doc/salome/gui/images/occ_view_perspective.png differ
diff --git a/doc/salome/gui/images/occ_view_stereo.png b/doc/salome/gui/images/occ_view_stereo.png
new file mode 100644 (file)
index 0000000..218a2a6
Binary files /dev/null and b/doc/salome/gui/images/occ_view_stereo.png differ
index 5a16df1760acf3ab06712be44c34fce7c7497ebd..c8eefa245bcc920a9ad472db4801c3da6b28be16 100644 (file)
Binary files a/doc/salome/gui/images/occviewer_toolbar.png and b/doc/salome/gui/images/occviewer_toolbar.png differ
index 81969122e49a6d51494963b760da70f72c86be0d..33abfe513ddc03951355f93d6ca8a06afa3af45e 100644 (file)
Binary files a/doc/salome/gui/images/pref_salome_general.png and b/doc/salome/gui/images/pref_salome_general.png differ
index 8d7e26994a73b5f06b128c69cc42d516066a8a13..72eef91a10c049744e9c130b815fd37c7bfcb0fc 100644 (file)
Binary files a/doc/salome/gui/images/pref_salome_occviewer.png and b/doc/salome/gui/images/pref_salome_occviewer.png differ
index 8efa707f6b4f6a59470e90093811135695b0f8ec..e8369e36b0fd4e6a73e883bc969ce9cc1fdef18b 100644 (file)
Binary files a/doc/salome/gui/images/pref_salome_vtkviewer.png and b/doc/salome/gui/images/pref_salome_vtkviewer.png differ
index e80bab975bc6524c31022b85afd27a851bb7a418..e4694409e087a63197f79d74f5c371b3eca43448 100644 (file)
@@ -137,6 +137,28 @@ These buttons orientate the scene strictly about coordinate axes:
 <b>Rotate clockwise</b> - rotates view 90 @htmlonly &deg; @endhtmlonly clockwise.
 <hr>
 
+\image html occ_view_orthographic.png
+
+<b>Ortographic projection</b> - default OCC viewer projection mode.
+<hr>
+
+\image html occ_view_perspective.png
+
+<b>Perspective projection</b> - perspective OCC viewer projection mode.
+<hr>
+
+\image html occ_view_stereo.png
+
+<b>Stereo projection</b> - stereoscopic rendering of the view.
+\note Activation of this mode also switches the view to perpective projection 
+in case if orthographic one has been active.
+\note By default, quad-buffered stereo is activated, if it is supported by graphic card. 
+If no stereo capabilities are available, an error message is shown.
+\note Settigs of stereoscopic view take place in 
+\ref occ_preferences "OCC 3D Viewer" preferences.
+
+<hr>
+
 \image html occ_view_reset.png
 
 <b>Reset</b> - restores the default position (isometric) of objects in
index 0d9c9094f94cf48f988ae7b45393463969e77537..b1c6bea108e00e004b51986af5093012fcb8af8b 100644 (file)
@@ -101,6 +101,9 @@ items in <b>Most Recently Used</b> list and the <b>Link type</b>:
   - \b Short - shows the file name only.
   - \b Auto - shows full paths to the files only if some files from
 different locations have the same name.
+- <b>Full-screen</b> - options concerned full-screen mode:
+  - <b>Hide object browser and viewers toolbars</b> - switches automatic hiding of 
+  Object Browser and OCC viewer toolbar in full-screen mode.
 
 <h2>3D Viewer Preferences</h2>
 
@@ -136,6 +139,36 @@ different locations have the same name.
 
 \image html pref_salome_occviewer.png
 
+- <b>Projection mode</b> - sets the default projection mode for the viewers: Orthogonal or Perpective.
+- <b>Stereo render</b> - group of stereoscopic view settings:
+  - <b>Stereo type</b> - specifies a stereo pair type:
+    - Shutter glasses (OpenGL quad-buffer)
+    - Anaglyph
+    - Row-interlaced
+    - Column-interlaced
+    - Chess-board stereo for DLP TVs
+    - Horizontal-anamorphic (side-by-side)
+    - Vertical-anamorphic (Half OverUnder)
+    \note The stereo pair type selected in this combobox is applied 
+    for all existing OCC 3D views with stereo rendering already turned on 
+    within the same SALOME GUI session. It is not possible to use 
+    different stereo modes in several OCC 3D views at the same time 
+    within the same SALOME GUI session.
+  - <b>Anaglyph filter</b> - specifies format of anaglyph stereo pair:
+    - Red-Cyan (default)
+    - Yellow-Blue
+    - Green-Magenta
+  - <b>Convergence distance type</b>: Absolute or Relative (default).
+  - <b>Stereographic focus value</b> - 1 by default.
+  - <b>IOD type</b> - Absolute or Relative (default).
+  - <b>Interocular distance (IOD) value</b> - 0.05 by default.
+  - <b>Reverse stereo</b> - option to swap left and right frames.
+  - <b>Enable V-Sync</b> - activates vertical synchronization.
+  - <b>Enable quad-buffer support</b> - allows quad-buffered rendering.
+  \note It is neccessary to enable quad-buffered stereoscopic rendering 
+  manually in graphic driver settings. SALOME does not do it automatically.
+  \note All existing OCC 3D views should be re-created for quad-buffer support.
+
 - <b>Background</b> - specifies the default background for the viewers,
   separately for (for more details, refer to the \ref viewer_background
   "this page"):
@@ -168,6 +201,30 @@ different locations have the same name.
   or [-] keyboard buttons.
 - <b>Modification Mode</b> - allows choosing between \b Arithmetic
   and \b Geometrical progression used for zooming.
+- <b>Stereo render</b> - group of stereoscopic view settings:
+  - <b>Stereo type</b> - specifies a stereo pair type:
+    - Crystal Eyes
+    - Red-Blue
+    - Interlaced
+    - Left
+    - Right
+    - Dresden
+    - Anaglyph
+    - Checkerboard
+    - Split View Port Horizontal
+    \note The stereo pair type selected in this combobox is applied 
+    for all existing VTK 3D views with stereo rendering already turned on 
+    within the same SALOME GUI session. It is not possible to use 
+    different stereo modes in several VTK 3D views at the same time 
+    within the same SALOME GUI session.
+  - <b>Anaglyph filter</b> - specifies format of anaglyph stereo pair:
+    - Red-Cyan (default)
+    - Yellow-Blue
+    - Green-Magenta
+  - <b>Enable quad-buffer support</b> - allows quad-buffered rendering.
+  \note It is neccessary to enable quad-buffered stereoscopic rendering 
+  manually in graphic driver settings. SALOME does not do it automatically.
+  \note All existing VTK 3D views should be re-created for quad-buffer support.
 - <b>Selection</b>
   - <b>Preselection</b> - allows to choose among three possible preselection modes:
     - <b>Standard</b> - this mode works quickly, by checking only 
index e45d4a8cdf24950d56b0d38690062d21b45dd272..ed7260417bc28d8b2a32ca98edd2caf7828c4d61 100755 (executable)
@@ -863,3 +863,20 @@ CAM_Application::ModuleShortInfoList CAM_Application::getVersionInfo()
   }  
   return info;
 }
+
+/*!
+  \brief Abort active operations if there are any
+  Iterates through all modules and asks each of them if there are pending operations that cannot be aborted.
+  \return \c false if some operation cannot be aborted
+*/
+bool CAM_Application::abortAllOperations()
+{
+  bool aborted = true;
+  for ( QList<CAM_Module*>::const_iterator it = myModules.begin(); it != myModules.end() && aborted; ++it )
+  {
+    aborted = (*it)->abortAllOperations();
+  }
+  return aborted;
+}
index d25f4d4c25bec30afcbcc1d523bcec5244297b77..5944e55d34b8adf0a90d5448e6bbf25bd6caab12 100755 (executable)
@@ -93,6 +93,8 @@ protected:
 
   static QString      moduleLibrary( const QString&, const bool = true );
 
+  virtual bool        abortAllOperations();
+
 private:
   void                readModuleList();
 
index 5d7d569de4a9ea0170d0079bd71e953f3a454d77..d3a0ddaf156e4187b7c48dad63da1e799466bab5 100755 (executable)
@@ -1134,3 +1134,9 @@ void CAM_Module::connectToStudy( CAM_Study* camStudy )
   \fn void CAM_Module::updateCommandsStatus();
   \brief Update menu/toolbar actions.
 */
+
+
+bool CAM_Module::abortAllOperations()
+{
+  return true;
+}
index 74a2b6e75cfcc2ba1fbb26d6ed853a6ccad89746..952f1857142b39a25ea4e5af3773eb34cf5e2908 100755 (executable)
@@ -145,6 +145,8 @@ protected:
   // after activate/deactivate modules
   QMap<QPair<int, QAction*>, QKeySequence> myActionShortcutMap; //!< copy actions shortcut map
 
+  virtual bool           abortAllOperations();
+
 private:
   CAM_Application*       myApp;             //!< parent application object
   QString                myName;            //!< module title (user name)
index 0eb31709f6981ae725eb7959f6f5a4c717525167..f50576ea8d68e4be8a404d2945d9a90dcf2dbc87 100644 (file)
@@ -1576,6 +1576,7 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
       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->setQuadBufferSupport( resMgr->booleanValue( "VTKViewer", "enable_quad_buffer_support", vm->isQuadBufferSupport() ) );
       vm->setBackground( resMgr->backgroundValue( "VTKViewer", "background", vm->background() ) );
       vm->setTrihedronSize( resMgr->doubleValue( "3DViewer", "trihedron_size", vm->trihedronSize() ),
                             resMgr->booleanValue( "3DViewer", "relative_size", vm->trihedronRelative() ) );
@@ -3382,6 +3383,27 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
   }
 #endif
 
+#ifndef DISABLE_VTKVIEWER
+  if ( sec == QString( "VTKViewer" ) && param == QString( "enable_quad_buffer_support" ) )
+  {
+    int enable = resMgr->booleanValue( "VTKViewer", "enable_quad_buffer_support", false );
+    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->setQuadBufferSupport( enable );
+    }
+#endif
+  }
+#endif
+
 #ifndef DISABLE_VTKVIEWER
   if ( sec == QString( "VTKViewer" ) && param == QString( "preselection" ) )
   {
index 2b8ae4ad5539d0829a10d7e790687e581ec068eb..9c886bb7994c09b19b948834527f8edca779aa40 100644 (file)
@@ -29,6 +29,8 @@
 #include "LightApp_SelectionMgr.h"
 #include "LightApp_Selection.h"
 
+#include "SUIT_OverrideCursor.h"
+
 #ifndef DISABLE_SALOMEOBJECT
   #include <SALOME_ListIO.hxx>
 #endif
@@ -151,6 +153,7 @@ void LightApp_ShowHideOp::startOperation()
     objEntries.append( study->referencedToEntry( *it ) ); 
   
   if( myActionType==DISPLAY || myActionType==DISPLAY_ONLY ) {
+    SUIT_OverrideCursor wc;
     d->Display( objEntries, false, 0 );
     mgr->setSelectedObjects(selObjs);
   }
index afa24d3751b1bfbb5dca460b583338cc8a200e4e..1b2f96cbed45bdae5f0f0f4747e574d926857581 100755 (executable)
@@ -1238,8 +1238,13 @@ void OCCViewer_Viewer::setTrihedronShown( const bool on )
     return;
 
   if ( on ) {
-    myAISContext->Display( myTrihedron );
-    myAISContext->Deactivate(myTrihedron);
+    myAISContext->Display( myTrihedron,
+                           0 /*wireframe*/,
+                           -1 /* selection mode */,
+                           Standard_True /* update viewer*/,
+                           Standard_False /* allow decomposition */,
+                           AIS_DS_Displayed /* display status */);
+    myAISContext->Deactivate( myTrihedron );
   }
   else {
     myAISContext->Erase( myTrihedron );
index 6d03da7df0ddb8e68acd2c8b67194df9a5a9e718..de19ce9816c0b47e46adfd42ea260261d1b6a426 100755 (executable)
@@ -385,7 +385,9 @@ bool OCCViewer_ViewWindow::eventFilter( QObject* watched, QEvent* e )
               ic->HilightPreviousDetected( myViewPort->getView() );
             }
           }
-        } else {
+        }
+        else {
+          emit vpTransformationStarted ( ZOOMVIEW );
           myViewPort->startZoomAtPoint( aEvent->x(), aEvent->y() );
           double delta = (double)( aEvent->delta() ) / ( 15 * 8 );
           int x  = aEvent->x();
@@ -394,6 +396,7 @@ bool OCCViewer_ViewWindow::eventFilter( QObject* watched, QEvent* e )
           int y1 = (int)( aEvent->y() + height()*delta/100 );
           myViewPort->zoom( x, y, x1, y1 );
           myViewPort->getView()->ZFitAll();
+          emit vpTransformationFinished ( ZOOMVIEW );
         }
       }
       return true;
@@ -562,7 +565,7 @@ void OCCViewer_ViewWindow::vpMousePressEvent( QMouseEvent* theEvent )
     }
     /* notify that we start a transformation */
     if ( transformRequested() )
-            emit vpTransformationStarted ( myOperation );
+      emit vpTransformationStarted ( myOperation );
   }
   if ( transformRequested() )
     setTransformInProcess( true );
@@ -1292,7 +1295,6 @@ void OCCViewer_ViewWindow::createActions()
                           tr( "MNU_ORTHOGRAPHIC_MODE" ), 0, this);
   aAction->setStatusTip(tr("DSC_ORTHOGRAPHIC_MODE"));
   aAction->setCheckable(true);
-  //connect(aAction, SIGNAL(toggled(bool)), this, SLOT(onProjectionType()));
   toolMgr()->registerAction( aAction, OrthographicId );
 
   // - perspective projection
@@ -1300,7 +1302,6 @@ void OCCViewer_ViewWindow::createActions()
                           tr( "MNU_PERSPECTIVE_MODE" ), 0, this);
   aAction->setStatusTip(tr("DSC_PERSPECTIVE_MODE"));
   aAction->setCheckable(true);
-  //connect(aAction, SIGNAL(toggled(bool)), this, SLOT(onProjectionType()));
   toolMgr()->registerAction( aAction, PerspectiveId );
 #if OCC_VERSION_LARGE > 0x06090000
   // - stereo projection
@@ -1309,17 +1310,14 @@ void OCCViewer_ViewWindow::createActions()
   aAction->setStatusTip(tr("DSC_STEREO_MODE"));
   aAction->setCheckable(true);
   toolMgr()->registerAction( aAction, StereoId );
-  //connect(aAction, SIGNAL(toggled(bool)), this, SLOT(onProjectionType()));
+  connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onStereoType(bool)));
 #endif
   // - add exclusive action group
   QActionGroup* aProjectionGroup = new QActionGroup( this );
   aProjectionGroup->addAction( toolMgr()->action( OrthographicId ) );
   aProjectionGroup->addAction( toolMgr()->action( PerspectiveId ) );
-#if OCC_VERSION_LARGE > 0x06090000
-  aProjectionGroup->addAction( toolMgr()->action( StereoId ) );
-#endif
-  connect(aProjectionGroup, SIGNAL(triggered(QAction*)), this, SLOT(onProjectionType()));
-
+  connect(aProjectionGroup, SIGNAL(triggered(QAction*)), this, SLOT(onProjectionType(QAction*)));
+  
   // Reset
   aAction = new QtxAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_VIEW_RESET" ) ),
                            tr( "MNU_RESET_VIEW" ), 0, this, false, "Viewers:Reset view");
@@ -1502,7 +1500,9 @@ void OCCViewer_ViewWindow::createToolBar()
 
     toolMgr()->append( OrthographicId, tid );
     toolMgr()->append( PerspectiveId, tid );
+#if OCC_VERSION_LARGE > 0x06090000
     toolMgr()->append( StereoId, tid );
+#endif
 
     toolMgr()->append( ResetId, tid );
   }
@@ -1643,24 +1643,167 @@ void OCCViewer_ViewWindow::onResetView()
 }
 
 /*!
-  \brief Perform "reset view" transformation.
+  \brief Set the given projection mode.
 
-  Sets default orientation of the viewport camera.
+  Set the given projection mode: Orthographic or Perspective.
+*/
+void OCCViewer_ViewWindow::onProjectionType( QAction* theAction )
+{
+  Handle(V3d_View) aView3d = myViewPort->getView();
+  if ( !aView3d.IsNull() ) {
+    Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
+    if (theAction == toolMgr()->action( OrthographicId )) {
+      myModel->setProjectionType(Orthographic);
+      aCamera->SetProjectionType ( Graphic3d_Camera::Projection_Orthographic );
+      aCamera->SetFOVy(45.0);
+    }
+    else if (theAction == toolMgr()->action( PerspectiveId )) {
+      myModel->setProjectionType(Perspective);
+      aCamera->SetProjectionType ( Graphic3d_Camera::Projection_Perspective );
+      aCamera->SetFOVy(30.0);
+    }
+#if OCC_VERSION_LARGE > 0x06090000
+    if (toolMgr()->action( StereoId )->isChecked()) {
+      aCamera->SetProjectionType ( Graphic3d_Camera::Projection_Stereo );
+      aCamera->SetFOVy(30.0);
+    }
+#endif
+    aView3d->Redraw();
+    onViewFitAll();
+  }
+}
+
+/*!
+  \brief Sets Stereo projection mode.
+
+  Sets Stereo projection mode.
+*/
+void OCCViewer_ViewWindow::onStereoType( bool activate )
+{
+#if OCC_VERSION_LARGE > 0x06090000
+  Handle(V3d_View) aView3d = myViewPort->getView();
+  if ( !aView3d.IsNull() ) {
+    Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
+    if (activate) {
+      toolMgr()->action( PerspectiveId )->setChecked(true);
+      aCamera->SetProjectionType(Graphic3d_Camera::Projection_Perspective);
+      toolMgr()->action( PerspectiveId )->actionGroup()->setEnabled(false);
+
+      aCamera->SetProjectionType ( Graphic3d_Camera::Projection_Stereo );
+      SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+      setStereoType( aResMgr->integerValue( "OCCViewer", "stereo_type", 0 ) );
+      setAnaglyphFilter( aResMgr->integerValue( "OCCViewer", "anaglyph_filter", 0 ) );
+      setReverseStereo( aResMgr->booleanValue( "OCCViewer", "reverse_stereo", false ) );
+      setVSync( aResMgr->booleanValue( "OCCViewer", "enable_vsync", true ) );
+      setQuadBufferSupport( aResMgr->booleanValue( "OCCViewer", "enable_quad_buffer_support", false ) );
+    }
+    else {
+      toolMgr()->action( PerspectiveId )->actionGroup()->setEnabled(true);
+      if (myModel->projectionType() == Orthographic) {
+        toolMgr()->action( OrthographicId )->setChecked(true);
+        aCamera->SetProjectionType(Graphic3d_Camera::Projection_Orthographic);
+      }
+      else if (myModel->projectionType() == Perspective) {
+        toolMgr()->action( PerspectiveId )->setChecked(true);
+        aCamera->SetProjectionType(Graphic3d_Camera::Projection_Perspective);
+      }
+    }
+    aView3d->Redraw();
+    onViewFitAll();
+  }
+
+  if ( isQuadBufferSupport() && !isOpenGlStereoSupport() && stereoType() == QuadBuffer &&
+       toolMgr()->action( StereoId )->isChecked() )
+    SUIT_MessageBox::warning( 0, tr( "WRN_WARNING" ),  tr( "WRN_SUPPORT_QUAD_BUFFER" ) );
+#endif
+}
+
+/*!
+  \brief Restore the view.
+
+  Restore the projection mode based on tool-buttons states.
 */
 void OCCViewer_ViewWindow::onProjectionType()
 {
   emit vpTransformationStarted( PROJECTION );
   if (toolMgr()->action( OrthographicId )->isChecked())
-    setProjectionType( Orthographic);
+    setProjectionType( Orthographic );
   if (toolMgr()->action( PerspectiveId )->isChecked())
-    setProjectionType( Perspective);
+    setProjectionType( Perspective );
 #if OCC_VERSION_LARGE > 0x06090000
   if (toolMgr()->action( StereoId )->isChecked())
-    setProjectionType( Stereo);
+    setProjectionType( Stereo );
 #endif
   emit vpTransformationFinished( PROJECTION );
 }
 
+void OCCViewer_ViewWindow::setProjectionType( int mode )
+{
+  QtxAction* anOrthographicAction = dynamic_cast<QtxAction*>( toolMgr()->action( OrthographicId ) );
+  QtxAction* aPerspectiveAction = dynamic_cast<QtxAction*>( toolMgr()->action( PerspectiveId ) );
+#if OCC_VERSION_LARGE > 0x06090000
+  QtxAction* aStereoAction = dynamic_cast<QtxAction*>( toolMgr()->action( StereoId ) );
+#endif
+  switch ( mode ) {
+    case Orthographic:
+      onProjectionType( anOrthographicAction );
+      break;
+    case Perspective:
+      onProjectionType( aPerspectiveAction );
+      break;
+    case Stereo:
+      onStereoType( true );
+      break;
+  }
+  // update action state if method is called outside
+  if ( mode == Orthographic && !anOrthographicAction->isChecked() ) {
+         anOrthographicAction->setChecked( true );
+    #if OCC_VERSION_LARGE > 0x06090000
+         aStereoAction->setChecked( false );
+    #endif
+  }
+  if ( mode == Perspective && !aPerspectiveAction->isChecked() ) {
+         aPerspectiveAction->setChecked( true );
+    #if OCC_VERSION_LARGE > 0x06090000
+         aStereoAction->setChecked( false );
+    #endif
+  }
+#if OCC_VERSION_LARGE > 0x06090000
+  if ( mode == Stereo ) {
+    aStereoAction->setChecked( true );
+    if ( anOrthographicAction->isEnabled() ) {
+      anOrthographicAction->setEnabled( false );
+      anOrthographicAction->setChecked( false );
+      aStereoAction->setChecked( false );
+    }
+    else {
+      anOrthographicAction->setEnabled( true );
+      aStereoAction->setChecked( false );
+      anOrthographicAction->setChecked(myModel->projectionType() == Orthographic);
+    }
+    if ( aPerspectiveAction->isEnabled() ) {
+      aPerspectiveAction->setEnabled( false );
+      aPerspectiveAction->setChecked( true );
+      if ( isQuadBufferSupport() && !isOpenGlStereoSupport() && stereoType() == QuadBuffer &&
+           toolMgr()->action( StereoId )->isChecked() )
+        SUIT_MessageBox::warning( 0, tr( "WRN_WARNING" ),  tr( "WRN_SUPPORT_QUAD_BUFFER" ) );
+    }
+    else {
+      aPerspectiveAction->setEnabled( true );
+      aStereoAction->setChecked( false );
+      aPerspectiveAction->setChecked(myModel->projectionType() == Perspective);
+      onProjectionType();
+    }
+  }
+  else {
+    if ( !anOrthographicAction->isEnabled() )
+      anOrthographicAction->setEnabled( true );
+    if ( !aPerspectiveAction->isEnabled() )
+      aPerspectiveAction->setEnabled( true );
+  }
+#endif
+}
+
 /*!
   \brief Perform "fit all" transformation.
 */
@@ -2817,88 +2960,6 @@ void OCCViewer_ViewWindow::set2dMode(Mode2dType theType)
   my2dMode = theType;
 }
 
-void OCCViewer_ViewWindow::setProjectionType( int mode )
-{
-  Handle(V3d_View) aView3d = myViewPort->getView();
-  if ( !aView3d.IsNull() ) {
-    Handle(Graphic3d_Camera) aCamera = aView3d->Camera();
-    if (mode == Perspective) {
-      myModel->setProjectionType(Perspective);
-      aCamera->SetProjectionType ( Graphic3d_Camera::Projection_Perspective );
-    }
-    if (mode == Orthographic) {
-      myModel->setProjectionType(Orthographic);
-      aCamera->SetProjectionType ( Graphic3d_Camera::Projection_Orthographic );
-    }
-  #if OCC_VERSION_LARGE > 0x06090000
-    if (mode == Stereo) {
-      aCamera->SetProjectionType ( Graphic3d_Camera::Projection_Stereo );
-      SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
-      setStereoType( aResMgr->integerValue( "OCCViewer", "stereo_type", 0 ) );
-      setAnaglyphFilter( aResMgr->integerValue( "OCCViewer", "anaglyph_filter", 0 ) );
-      setReverseStereo( aResMgr->booleanValue( "OCCViewer", "reverse_stereo", false ) );
-      setVSync( aResMgr->booleanValue( "OCCViewer", "enable_vsync", true ) );
-      setQuadBufferSupport( aResMgr->booleanValue( "OCCViewer", "enable_quad_buffer_support", false ) );
-    }
-  #endif
-    aView3d->Redraw();
-    onViewFitAll();
-  }
-  // update action state if method is called outside
-  QtxAction* anOrthographicAction = dynamic_cast<QtxAction*>( toolMgr()->action( OrthographicId ) );
-  QtxAction* aPerspectiveAction = dynamic_cast<QtxAction*>( toolMgr()->action( PerspectiveId ) );
-#if OCC_VERSION_LARGE > 0x06090000
-  QtxAction* aStereoAction = dynamic_cast<QtxAction*>( toolMgr()->action( StereoId ) );
-#endif
-  if ( mode == Orthographic && !anOrthographicAction->isChecked() ) {
-         anOrthographicAction->setChecked( true );
-    #if OCC_VERSION_LARGE > 0x06090000
-         aStereoAction->setChecked( false );
-    #endif
-  }
-  if ( mode == Perspective && !aPerspectiveAction->isChecked() ) {
-         aPerspectiveAction->setChecked( true );
-    #if OCC_VERSION_LARGE > 0x06090000
-         aStereoAction->setChecked( false );
-    #endif
-  }
-#if OCC_VERSION_LARGE > 0x06090000
-  if ( mode == Stereo ) {
-    aStereoAction->setChecked( true );
-    if ( anOrthographicAction->isEnabled() ) {
-      anOrthographicAction->setEnabled( false );
-      anOrthographicAction->setChecked( false );
-      aStereoAction->setChecked( false );
-    }
-    else {
-      anOrthographicAction->setEnabled( true );
-      aStereoAction->setChecked( false );
-      anOrthographicAction->setChecked(myModel->projectionType() == Orthographic);
-    }
-    if ( aPerspectiveAction->isEnabled() ) {
-      aPerspectiveAction->setEnabled( false );
-      aPerspectiveAction->setChecked( true );
-    #if OCC_VERSION_LARGE > 0x06090000
-      if ( isQuadBufferSupport() && !isOpenGlStereoSupport() && stereoType() == QuadBuffer )
-        SUIT_MessageBox::warning( 0, tr( "WRN_WARNING" ),  tr( "WRN_SUPPORT_QUAD_BUFFER" ) );
-    #endif
-    }
-    else {
-      aPerspectiveAction->setEnabled( true );
-      aStereoAction->setChecked( false );
-      aPerspectiveAction->setChecked(myModel->projectionType() == Perspective);
-      onProjectionType();
-    }
-  }
-  else {
-    if ( !anOrthographicAction->isEnabled() )
-      anOrthographicAction->setEnabled( true );
-    if ( !aPerspectiveAction->isEnabled() )
-      aPerspectiveAction->setEnabled( true );
-  }
-#endif
-}
-
 int OCCViewer_ViewWindow::projectionType() const
 {
   int mode = Orthographic;
index 08f4202e36ebe299ccb832e69027767a49de7a94..dff660d7233df0ba2aa3ab9bc365aa9186917b33 100755 (executable)
@@ -279,6 +279,8 @@ public slots:
   virtual void onRightView();
   virtual void onClockWiseView();
   virtual void onAntiClockWiseView();
+  virtual void onProjectionType( QAction* theAction );
+  virtual void onStereoType( bool activate );
   virtual void onProjectionType();
   virtual void onResetView();
   virtual void onFitAll();
index 35c4f558e9c178e2f247782e9154212d95ea2637..1372bc5c069d00a58f26739e82f2c1db5ebbc7b9 100644 (file)
@@ -27,6 +27,7 @@ INCLUDE_DIRECTORIES(
   )
 
 ADD_DEFINITIONS(
+  ${OMNIORB_DEFINITIONS}
   ${KERNEL_DEFINITIONS}
   )
 
diff --git a/src/PVServerService/ServiceLoader/PVServerServiceLoader.h b/src/PVServerService/ServiceLoader/PVServerServiceLoader.h
new file mode 100644 (file)
index 0000000..32bd4a4
--- /dev/null
@@ -0,0 +1,33 @@
+// Copyright (C) 2010-2015  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef PVSERVERSERVICELOADER_H
+#define PVSERVERSERVICELOADER_H
+
+#ifdef WIN32
+#if defined PVServerServiceLoader_EXPORTS
+#define PVSERVERSERVICELOADER_EXPORT __declspec(dllexport)
+#else
+#define PVSERVERSERVICELOADER_EXPORT __declspec(dllimport)
+#endif
+#else
+#define PVSERVERSERVICELOADER_EXPORT
+#endif
+
+#endif //PVSERVERSERVICELOADER_H
index 7a443eb3da6f7f56dce2449aaa47918ba4233d04..2d364b04319c483e972b09482e0cb3dbc5b0d254 100644 (file)
 #ifndef PVSERVERSERVICELOADER_H_
 #define PVSERVERSERVICELOADER_H_
 
-#include "PVServerService.h"
+#include "PVServerServiceLoader.h"
 
 #include <SALOME_ContainerManager.hxx>
 
 class SALOME_LifeCycleCORBA;
 class SALOME_NamingService;
 
-class PVSERVERSERVICE_EXPORT PVServer_ServiceLoader
+class PVSERVERSERVICELOADER_EXPORT PVServer_ServiceLoader
 {
 public:
   PVServer_ServiceLoader();
index 946f574caae9e884e255be429ad2e10b0b222ce0..32ad890c90c3416c2a3612a9898364cffb000d0c 100755 (executable)
@@ -61,6 +61,8 @@
 #include <AIS_TypeOfIso.hxx>
 #include <Precision.hxx>
 
+#include <algorithm>
+
 // in order NOT TO link with SalomeApp, here the code returns SALOMEDS_Study.
 // SalomeApp_Study::studyDS() does it as well, but -- here it is retrieved from 
 // SALOMEDS::StudyManager - no linkage with SalomeApp. 
@@ -562,7 +564,7 @@ void SOCC_Viewer::LocalSelection( const SALOME_OCCPrs* thePrs, const std::list<i
   bool allObjects = thePrs == 0 || thePrs->IsNull();
   if ( !ic->HasOpenedContext() ) {
     ic->ClearCurrents( false );
-    ic->OpenLocalContext( allObjects, true, true );
+    ic->OpenLocalContext( Standard_False, Standard_True, Standard_True );
   }
 
   AIS_ListOfInteractive anObjs;
@@ -572,6 +574,11 @@ void SOCC_Viewer::LocalSelection( const SALOME_OCCPrs* thePrs, const std::list<i
   else
     anOCCPrs->GetObjects( anObjs );
 
+  std::list<int> sel_modes;
+  for ( int i = TopAbs_COMPOUND; i < TopAbs_SHAPE; i++ )
+    if ( std::find(modes.begin(), modes.end(), (int)TopAbs_SHAPE) != modes.end() || std::find(modes.begin(), modes.end(), i) != modes.end())
+      sel_modes.push_back(i);
+
   // Activate selection of objects from prs
   AIS_ListIteratorOfListOfInteractive aIter( anObjs );
   for ( ; aIter.More(); aIter.Next() ) {
@@ -582,13 +589,13 @@ void SOCC_Viewer::LocalSelection( const SALOME_OCCPrs* thePrs, const std::list<i
       if ( anAIS->IsKind( STANDARD_TYPE( AIS_Shape ) ) )
       {
         ic->Load( anAIS, -1, false );
-        for( it = modes.begin(); it != modes.end(); ++it )
+        for( it = sel_modes.begin(); it != sel_modes.end(); ++it )
           ic->Activate( anAIS, AIS_Shape::SelectionMode( (TopAbs_ShapeEnum)*it ) );
       }
       else if ( anAIS->DynamicType() != STANDARD_TYPE(AIS_Trihedron) )
       {
         ic->Load( anAIS, -1, false );
-        for( it = modes.begin(); it != modes.end(); ++it )
+        for( it = sel_modes.begin(); it != sel_modes.end(); ++it )
           ic->Activate( anAIS, *it );
       }
     }
index dee6fd199a455cc56e772c4610e5222e39b26ffd..47b3a045956daed27f92358db6175835498ac50f 100755 (executable)
@@ -324,6 +324,9 @@ void STD_Application::onOpenDoc()
 /*! \retval true, if document was opened successful, else false.*/
 bool STD_Application::onOpenDoc( const QString& aName )
 {
+  if ( !abortAllOperations() )
+    return false;
+
   QApplication::setOverrideCursor( Qt::WaitCursor );
 
   bool res = openAction( openChoice( aName ), aName );
@@ -356,8 +359,6 @@ bool STD_Application::onReopenDoc()
     // update views / windows / status bar / title
     clearViewManagers();
     setActiveStudy( 0 );
-    updateDesktopTitle();
-    updateCommandsStatus();
 
     // delete study
     delete study;
@@ -366,13 +367,21 @@ bool STD_Application::onReopenDoc()
     // post closing actions
     afterCloseDoc();
 
+    int aNbStudies = 0;
+    QList<SUIT_Application*> apps = SUIT_Session::session()->applications();
+    for ( int i = 0; i < apps.count(); i++ )
+      aNbStudies += apps.at( i )->getNbStudies();
+
     // reload study from the file
     res = useFile( studyName ) && activeStudy();
 
     // if reloading is failed, close the desktop
-    if ( !res ) {
-      setDesktop( 0 );
+    if ( aNbStudies && !res )
       closeApplication();
+    else
+    {
+      updateDesktopTitle();
+      updateCommandsStatus();
     }
   }
   return res;
@@ -558,6 +567,9 @@ void STD_Application::onSaveDoc()
   if ( !activeStudy() )
     return;
 
+  if ( !abortAllOperations() )
+    return;
+
   bool isOk = false;
   if ( activeStudy()->isSaved() )
   {
@@ -593,6 +605,9 @@ bool STD_Application::onSaveAsDoc()
   if ( !study )
     return false;
 
+  if ( !abortAllOperations() )
+    return false;
+
   bool isOk = false;
   while ( !isOk )
   {
@@ -1007,3 +1022,11 @@ int STD_Application::viewManagerId( const SUIT_ViewManager* theManager) const
   return myViewMgrs.indexOf(const_cast<SUIT_ViewManager*>(theManager));
 }
 
+/*!
+  \brief Abort active operations if there are any
+  \return \c false if some operation cannot be aborted
+*/
+bool STD_Application::abortAllOperations()
+{
+  return true;
+}
index ed3f6fed5ba9e29d527e37c3a93cfa7043237ec4..2b1f4653ca08fde49c86d20fa3c6555293052a90 100755 (executable)
@@ -170,6 +170,8 @@ protected:
   virtual bool          closeDoc( bool ask = true );
   virtual bool          closeActiveDoc( bool permanently = true );
 
+  virtual bool          abortAllOperations();
+
 private:
   ViewManagerList       myViewMgrs;
   SUIT_ViewManager*     myActiveViewMgr;
index b0741a5f20ee08992cc75744ac177b276c47a031..baa0212ad8f7ec20db423fdd9fc070968dead966 100644 (file)
@@ -468,6 +468,7 @@ SALOME_Actor
       }
       myHighlightActor->SetVisibility( GetVisibility() && theIsHighlight );
     }
+    myHighlightActor->SetMarkerEnabled( mySelectionMode == NodeSelection );
   }
 
   highlight(theIsHighlight);
@@ -672,8 +673,6 @@ SALOME_Actor
   if ( !theIsHighlight )
     return true;
 
-  myHighlightActor->SetMarkerEnabled( aSelectionMode == NodeSelection );
-
   double x = theSelectionEvent->myX;
   double y = theSelectionEvent->myY;
 
index 02748723307831ce69949f86d69429d389ba0706..874bbe8eecb30e565aad7c62dbadca63e9b1ce36 100644 (file)
@@ -286,7 +286,7 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport)
     if ( this->FlyMode == VTK_FLY_CLOSEST_TRIAD )
       {
       // Loop over points and find the closest point to the camera
-      min = VTK_LARGE_FLOAT;
+      min = VTK_FLOAT_MAX;
       for (i=0; i < 8; i++)
         {
         if ( pts[i][2] < min )
@@ -310,7 +310,7 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport)
       double e1[2], e2[2], e3[2];
 
       // Find distance to origin
-      d2Min = VTK_LARGE_FLOAT;
+      d2Min = VTK_FLOAT_MAX;
       for (i=0; i < 8; i++)
         {
         d2 = pts[i][0]*pts[i][0] + pts[i][1]*pts[i][1];
@@ -323,7 +323,7 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport)
 
       // find minimum slope point connected to closest point and on 
       // right side (in projected coordinates). This is the first edge.
-      minSlope = VTK_LARGE_FLOAT;
+      minSlope = VTK_FLOAT_MAX;
       for (xIdx=0, i=0; i<3; i++)
         {
         num = (pts[Conn[idx][i]][1] - pts[idx][1]);
index 05104b9a366a97ea7ffd15707d1476d7cf902754..009ba0c081aa869c2fb2fbab9b8f8e1fc00b43e2 100644 (file)
@@ -67,7 +67,7 @@ SVTK_NonIsometricDlg
   QLabel* TextLabelX = new QLabel (tr("LBL_X"), aGroupBox);
   TextLabelX->setObjectName("TextLabelX");
   TextLabelX->setFixedWidth(15);
-  m_sbXcoeff = new QtxDoubleSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox);
+  m_sbXcoeff = new QtxDoubleSpinBox(-VTK_FLOAT_MAX, VTK_FLOAT_MAX, 0.1, aGroupBox);
   m_sbXcoeff->setMinimumWidth(80);
   m_sbXcoeff->setValue(1.0);
 
@@ -75,7 +75,7 @@ SVTK_NonIsometricDlg
   QLabel* TextLabelY = new QLabel (tr("LBL_Y"), aGroupBox);
   TextLabelY->setObjectName("TextLabelY");
   TextLabelY->setFixedWidth(15);
-  m_sbYcoeff = new QtxDoubleSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox);
+  m_sbYcoeff = new QtxDoubleSpinBox(-VTK_FLOAT_MAX, VTK_FLOAT_MAX, 0.1, aGroupBox);
   m_sbYcoeff->setMinimumWidth(80);
   m_sbYcoeff->setValue(1.0);
 
@@ -83,7 +83,7 @@ SVTK_NonIsometricDlg
   QLabel* TextLabelZ = new QLabel (tr("LBL_Z"), aGroupBox);
   TextLabelZ->setObjectName("TextLabelZ");
   TextLabelZ->setFixedWidth(15);
-  m_sbZcoeff = new QtxDoubleSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox);
+  m_sbZcoeff = new QtxDoubleSpinBox(-VTK_FLOAT_MAX, VTK_FLOAT_MAX, 0.1, aGroupBox);
   m_sbZcoeff->setMinimumWidth(80);
   m_sbZcoeff->setValue(1.0);
 
index 1a251d9e4ebb54c142d0124c61a252fea220101a..6a6420e6fc88755712f20b4faab34970e20b00ab 100644 (file)
@@ -395,9 +395,9 @@ inline
 bool
 CheckBndBox(const double theBounds[6])
 {
-  if(theBounds[0] > -VTK_LARGE_FLOAT && theBounds[1] < VTK_LARGE_FLOAT &&
-     theBounds[2] > -VTK_LARGE_FLOAT && theBounds[3] < VTK_LARGE_FLOAT &&
-     theBounds[4] > -VTK_LARGE_FLOAT && theBounds[5] < VTK_LARGE_FLOAT)
+  if(theBounds[0] > -VTK_FLOAT_MAX && theBounds[1] < VTK_FLOAT_MAX &&
+     theBounds[2] > -VTK_FLOAT_MAX && theBounds[3] < VTK_FLOAT_MAX &&
+     theBounds[4] > -VTK_FLOAT_MAX && theBounds[5] < VTK_FLOAT_MAX)
     return true;
   return false;
 }
@@ -413,8 +413,8 @@ SVTK_Renderer
   bool aCDisplayed = IsCubeAxesDisplayed();
 
   double aNewBndBox[6];
-  aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_LARGE_FLOAT;
-  aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_LARGE_FLOAT;
+  aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_FLOAT_MAX;
+  aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_FLOAT_MAX;
 
   int aVisibleNum = myTrihedron->GetVisibleActorCount(GetDevice());
   if(aVisibleNum){
index 8a02385bee36506f52029dd86a74d99ade089495..15a8d0a24099f3a06040f7ecae4bede198cc30bb 100644 (file)
@@ -50,7 +50,7 @@
 #include <vtkDataSet.h>
 
 static double OFF_UPDATE_RATE = 0.00001;
-static double FLOAT_TOLERANCE = 1.0 / VTK_LARGE_FLOAT;
+static double FLOAT_TOLERANCE = 1.0 / VTK_FLOAT_MAX;
 
 namespace
 {
@@ -195,7 +195,7 @@ SVTK_UpdateRateDlg
       aLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
       aGridLayout->addWidget(aLabel, 0, 0);
 
-      QtxDoubleSpinBox* aDblSpinBox = new QtxDoubleSpinBox(OFF_UPDATE_RATE, VTK_LARGE_FLOAT, 2, aGroupBox);
+      QtxDoubleSpinBox* aDblSpinBox = new QtxDoubleSpinBox(OFF_UPDATE_RATE, VTK_FLOAT_MAX, 2, aGroupBox);
       aDblSpinBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
       aGridLayout->addWidget(aDblSpinBox, 0, 1);
 
@@ -209,7 +209,7 @@ SVTK_UpdateRateDlg
       aLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
       aGridLayout->addWidget(aLabel, 1, 0);
 
-      QtxDoubleSpinBox* aDblSpinBox = new QtxDoubleSpinBox(OFF_UPDATE_RATE, VTK_LARGE_FLOAT, 2, aGroupBox);
+      QtxDoubleSpinBox* aDblSpinBox = new QtxDoubleSpinBox(OFF_UPDATE_RATE, VTK_FLOAT_MAX, 2, aGroupBox);
       aDblSpinBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
       aGridLayout->addWidget(aDblSpinBox, 1, 1);
 
index 9109c2f80042c0cd43969418e747a8a50292b2b5..eb3a754e939d50f3b9fd0fcb427af1c6265eca1c 100644 (file)
@@ -94,6 +94,7 @@ SVTK_Viewer::SVTK_Viewer()
   mySpaceBtn[1] = 2;
   mySpaceBtn[2] = 9;
   myDefaultBackground = Qtx::BackgroundData( Qt::black );
+  myQuadBufferSupport = false;
 }
 
 /*!
@@ -196,6 +197,7 @@ SUIT_ViewWindow* SVTK_Viewer::createView( SUIT_Desktop* theDesktop )
   aViewWindow->SetProjectionMode( projectionMode() );
   aViewWindow->SetStereoType( stereoType() );
   aViewWindow->SetAnaglyphFilter( anaglyphFilter() );
+  aViewWindow->SetQuadBufferSupport( isQuadBufferSupport() );
   aViewWindow->SetInteractionStyle( interactionStyle() );
   aViewWindow->SetZoomingStyle( zoomingStyle() );
   aViewWindow->SetPreSelectionMode( preSelectionMode() );
@@ -290,7 +292,7 @@ void SVTK_Viewer::setProjectionMode( const int theMode )
 {
   if ( myProjMode != theMode ) {
     if ( theMode != SVTK_ViewWindow::Stereo )
-         myProjMode = theMode;
+      myProjMode = theMode;
     if (SUIT_ViewManager* aViewManager = getViewManager()) {
       QVector<SUIT_ViewWindow*> aViews = aViewManager->getViews();
       for ( uint i = 0; i < aViews.count(); i++ )
@@ -358,6 +360,33 @@ void SVTK_Viewer::setAnaglyphFilter( const int theFilter )
   }
 }
 
+/*!
+  \return support quad-buffered stereo
+*/
+bool SVTK_Viewer::isQuadBufferSupport() const
+{
+  return myQuadBufferSupport;
+}
+
+/*!
+  Set support quad-buffered stereo
+  \param theEnable - enable/disable support quad-buffered stereo
+*/
+void SVTK_Viewer::setQuadBufferSupport( const bool theEnable )
+{
+  if ( myQuadBufferSupport != theEnable ) {
+    myQuadBufferSupport = theEnable;
+
+    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->SetQuadBufferSupport( theEnable );
+      }
+    }
+  }
+}
 /*!
   \return interaction style
 */
index b5f04839a3edf5de514ebb2fcbe4c2cb4a4156ec..f3b00cc73dd1cc66cc1ca065e5da3f731614ece5 100644 (file)
@@ -134,6 +134,12 @@ public:
   //! Sets anaglyph filter
   void setAnaglyphFilter( const int );
 
+  //! Get support quad-buffered stereo
+  bool isQuadBufferSupport() const;
+
+  //! Set support quad-buffered stereo
+  void setQuadBufferSupport( const bool );
+
   //! Gets interaction style
   int interactionStyle() const;
 
@@ -228,6 +234,7 @@ private:
   int                  myProjMode;
   int                  myStereoType;
   int                  myAnaglyphFilter;
+  bool                 myQuadBufferSupport;
   int                  myStyle;
   int                  myZoomingStyle;
   Preselection_Mode    myPreSelectionMode;
index 88bee3fc564129f013c040b977cb08d48376f1f8..2d98877d6dc7bff2654dae5b3dfc1811f480f881 100755 (executable)
@@ -859,27 +859,24 @@ double SVTK_ViewWindow::GetTrihedronSize() const
 */
 void SVTK_ViewWindow::SetProjectionMode(const int theMode)
 {
-  SVTK_Viewer* aViewer = dynamic_cast<SVTK_Viewer*>(myModel);
+  QtxAction* aParallelAction = dynamic_cast<QtxAction*>( toolMgr()->action( ParallelModeId ) );
+  QtxAction* aProjectionAction = dynamic_cast<QtxAction*>( toolMgr()->action( ProjectionModeId ) );
+  QtxAction* aStereoAction = dynamic_cast<QtxAction*>( toolMgr()->action( StereoModeId ) );
 
-  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);
+  switch ( theMode ) {
+    case Parallel:
+      onProjectionMode( aParallelAction );
+      break;
+    case Projection:
+      onProjectionMode( aProjectionAction );
+      break;
+    case Stereo:
+      onStereoMode( true );
+      break;
   }
-  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 ) );
+  SVTK_Viewer* aViewer = dynamic_cast<SVTK_Viewer*>(myModel);
   QtxAction* aSwitchZoomingStyle = dynamic_cast<QtxAction*>( toolMgr()->action( SwitchZoomingStyleId ) );
   if ( theMode == Parallel && !aParallelAction->isChecked() ) {
       aParallelAction->setChecked( true );
@@ -906,7 +903,8 @@ void SVTK_ViewWindow::SetProjectionMode(const int theMode)
       aProjectionAction->setEnabled( false );
       aProjectionAction->setChecked( true );
       if ( getRenderWindow()->GetStereoCapableWindow() == 1 && !isOpenGlStereoSupport() &&
-           strcmp( "CrystalEyes", getRenderWindow()->GetStereoTypeAsString() ) == 0 ){
+           strcmp( "CrystalEyes", getRenderWindow()->GetStereoTypeAsString() ) == 0 &&
+           toolMgr()->action( StereoModeId )->isChecked() ) {
         SUIT_MessageBox::warning( 0, tr( "WRN_WARNING" ),  tr( "WRN_SUPPORT_QUAD_BUFFER" ) );
       }
     }
@@ -914,7 +912,7 @@ void SVTK_ViewWindow::SetProjectionMode(const int theMode)
       aProjectionAction->setEnabled( true );
       aStereoAction->setChecked( false );
       aProjectionAction->setChecked( aViewer->projectionMode() == Projection );
-      onPerspectiveMode();
+      onProjectionMode();
     }
   }
   else {
@@ -983,6 +981,16 @@ void SVTK_ViewWindow::SetAnaglyphFilter(const int theFilter)
   }
 }
 
+/*!
+  Set support quad-buffered stereo
+  \param theEnable - enable/disable support quad-buffered stereo
+*/
+void SVTK_ViewWindow::SetQuadBufferSupport(const bool theEnable)
+{
+  vtkRenderWindow* aWindow = getRenderWindow();
+  aWindow->SetStereoCapableWindow((int)theEnable);
+}
+
 /*!
   \return OpenGl stereo support
 */
@@ -2030,10 +2038,65 @@ void SVTK_ViewWindow::activateStartPointSelection( Selection_Mode theSelectionMo
   myEventDispatcher->InvokeEvent(SVTK::StartPointSelection,0);
 }
 
+/*!
+  \brief Set the given projection mode.
+
+  Set the given projection mode: Orthographic or Perspective.
+*/
+void SVTK_ViewWindow::onProjectionMode( QAction* theAction )
+{
+  int aMode = Parallel;
+  if (theAction == toolMgr()->action( ProjectionModeId ))
+    aMode = Projection;
+  SVTK_Viewer* aViewer = dynamic_cast<SVTK_Viewer*>(myModel);
+  aViewer->setProjectionMode(aMode);
+  bool anIsParallelMode = (aMode == Parallel);
+  vtkCamera* aCamera = getRenderer()->GetActiveCamera();
+  aCamera->SetParallelProjection(anIsParallelMode);
+  GetInteractor()->GetDevice()->CreateTimer(VTKI_TIMER_FIRST);
+  getRenderWindow()->SetStereoRender(0);
+  Repaint();
+}
+
+/*!
+  \brief Sets Stereo projection mode.
+
+  Sets Stereo projection mode.
+*/
+void SVTK_ViewWindow::onStereoMode( bool activate )
+{
+  if (activate) {
+    toolMgr()->action( ProjectionModeId )->setChecked(true);
+    vtkCamera* aCamera = getRenderer()->GetActiveCamera();
+    aCamera->SetParallelProjection(false);
+    toolMgr()->action( ProjectionModeId )->actionGroup()->setEnabled(false);
+    SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+    SetStereoType( aResMgr->integerValue( "VTKViewer", "stereo_type", 0 ) );
+    getRenderWindow()->SetStereoRender(1);
+    Repaint();
+  }
+  else {
+    toolMgr()->action( ProjectionModeId )->actionGroup()->setEnabled(true);
+    SVTK_Viewer* aViewer = dynamic_cast<SVTK_Viewer*>(myModel);
+    if (aViewer->projectionMode() == Parallel) {
+      toolMgr()->action( ParallelModeId )->setChecked(true);
+      onProjectionMode(toolMgr()->action( ParallelModeId ));
+    }
+    else if (aViewer->projectionMode() == Projection) {
+      toolMgr()->action( ProjectionModeId )->setChecked(true);
+      onProjectionMode(toolMgr()->action( ProjectionModeId ));
+    }
+  }
+  if ( getRenderWindow()->GetStereoCapableWindow() == 1 && !isOpenGlStereoSupport() &&
+       strcmp( "CrystalEyes", getRenderWindow()->GetStereoTypeAsString() ) == 0 &&
+       toolMgr()->action( StereoModeId )->isChecked() )
+    SUIT_MessageBox::warning( 0, tr( "WRN_WARNING" ),  tr( "WRN_SUPPORT_QUAD_BUFFER" ) );
+}
+
 /*!
   Set the view projection mode: orthogonal or perspective
 */
-void SVTK_ViewWindow::onPerspectiveMode()
+void SVTK_ViewWindow::onProjectionMode()
 {
   if (toolMgr()->action( ParallelModeId )->isChecked())
     SetProjectionMode( Parallel);
@@ -2250,7 +2313,6 @@ 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()));
   mgr->registerAction( anAction, ParallelModeId );
 
   anAction = new QtxAction(tr("MNU_SVTK_PERSPECTIVE_MODE"), 
@@ -2258,7 +2320,6 @@ 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()));
   mgr->registerAction( anAction, ProjectionModeId );
 
   anAction = new QtxAction(tr("MNU_SVTK_STEREO_MODE"),
@@ -2266,14 +2327,13 @@ void SVTK_ViewWindow::createActions(SUIT_ResourceMgr* theResourceMgr)
                              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()));
+  connect(anAction, SIGNAL(triggered(bool)), this, SLOT(onStereoMode(bool)));
   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()));
+  connect(aPerspectiveGroup, SIGNAL(triggered(QAction*)), this, SLOT(onProjectionMode(QAction*)));
 
   // View Parameters
   anAction = new QtxAction(tr("MNU_VIEWPARAMETERS_VIEW"), 
index b0de0c81bfd2310fd00bbc04fc77433ba1d968ef..2d236d4e32075f630f9c7a36104a256002c965f0 100755 (executable)
@@ -236,6 +236,9 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow
   //! Sets anaglyph filter
   virtual void SetAnaglyphFilter( const int );
 
+  //! Set support quad-buffered stereo
+  virtual void SetQuadBufferSupport( const bool );
+
   //! Set interactive style
   virtual void SetInteractionStyle( const int );
 
@@ -315,7 +318,9 @@ public slots:
   void activatePanning(); 
   void activateGlobalPanning(); 
 
-  void onPerspectiveMode();
+  void onProjectionMode( QAction* theAction );
+  void onStereoMode( bool activate );
+  void onProjectionMode();
 
   void activateProjectionMode(int);
 
index 6ab2edb8ea3790c4e719c79f1a9377e2d2f3ad87..04a5a9f0b54acd1a03c41671fcf8f99f3c598969 100644 (file)
@@ -148,11 +148,11 @@ public:
   
   // Description:
   // Set/get the radius of the pieces of the axes actor
-  vtkSetClampMacro(ConeRadius, float, 0, VTK_LARGE_FLOAT);
+  vtkSetClampMacro(ConeRadius, float, 0, VTK_FLOAT_MAX);
   vtkGetMacro(ConeRadius, float);
-  vtkSetClampMacro(SphereRadius, float, 0, VTK_LARGE_FLOAT);
+  vtkSetClampMacro(SphereRadius, float, 0, VTK_FLOAT_MAX);
   vtkGetMacro(SphereRadius, float);
-  vtkSetClampMacro(CylinderRadius, float, 0, VTK_LARGE_FLOAT);
+  vtkSetClampMacro(CylinderRadius, float, 0, VTK_FLOAT_MAX);
   vtkGetMacro(CylinderRadius, float);
   
   // Description:
index ee44188e578460d250ba5ea69de49ca23eb80a3d..adc7594261714fe04b48b66808d42c4a122a0236 100644 (file)
@@ -115,23 +115,20 @@ def minmax(context):
         mm = study.FindObjectID(objId).GetObject()
         mesh = None
         try:
-          mesh = mm.Load()
+          mm.Load()
+          mesh = mm
         except:
-          #print "No mesh selected"
           self.clearLineEdit()
           mesh = None
           pass
         if mesh:
+          name = smeshBuilder.GetName( mm )
           self.ui.mesh.setStyleSheet("")
-          self.ui.mesh.setText(mesh.getName())
-          #print "Mesh selected: ", mesh.getName()
+          self.ui.mesh.setText( name )
           self.mm = mm
           e = self.mm.NbEdges()
           f = self.mm.NbFaces()
           v = self.mm.NbVolumes()
-          #print "NbEdges: ",e
-          #print "NbFaces: ",f
-          #print "NbVolumes: ",v
           controls = []
           if e:
             controls += controls_1d
@@ -162,20 +159,16 @@ Inputs:
       pass
 
     def compute_minmax(self):
-      if self.mm:
-        control = self.ui.control.currentText()
-        #print "Compute control: ",control
+      control = self.ui.control.currentText()
+      if self.mm and control:
         fun = smesh.GetFunctor(controls_dict[str(control)])
-        fun.SetMesh(self.mm.GetMesh())
-        hist = fun.GetHistogram(1)
+        fun.SetMesh(self.mm)
+        hist = fun.GetHistogram(1,False)
         maxVal = hist[0].max
         minVal = hist[0].min
-        #print "Max value for %s: %f"%(control, maxVal)
-        #print "Min value for %s: %f"%(control, minVal)
         self.ui.maxvalue.setText("%f"%(maxVal))
         self.ui.minvalue.setText("%f"%(minVal))
       else:
-        print "Pas de maillage"
         pass
       pass
     pass
index 76df0121df2e987ffec40e361a369c628153d6f3..e19a2506d4587d8edcdf0a72d89c786e7cac5e2d 100755 (executable)
@@ -491,14 +491,14 @@ VTKViewer_Actor
   if(myIsInfinite)
     return true;
 
-  static double MAX_DISTANCE = 0.9*VTK_LARGE_FLOAT;
+  static double MAX_DISTANCE = 0.9*VTK_FLOAT_MAX;
   double aBounds[6];
   GetBounds(aBounds);
   for(int i = 0; i < 6; i++)
     if(fabs(aBounds[i]) > MAX_DISTANCE)
       return true;
   
-  static double MIN_DISTANCE = 1.0/VTK_LARGE_FLOAT;
+  static double MIN_DISTANCE = 1.0/VTK_FLOAT_MAX;
   if(GetLength() < MIN_DISTANCE)
     return true;
   
index 9c1dee3aa8cd5c1cc49b0b86efa040cc156ced82..e32c596f522e33a5f53765a0be7acc9138073b95 100755 (executable)
@@ -52,8 +52,8 @@ vtkStandardNewMacro(VTKViewer_UnScaledActor);
 /*!Constructor*/
 VTKViewer_UnScaledActor::VTKViewer_UnScaledActor() 
 {
-  Bounds[0] = Bounds[2] = Bounds[4] = VTK_LARGE_FLOAT;
-  Bounds[1] = Bounds[3] = Bounds[5] = -VTK_LARGE_FLOAT;
+  Bounds[0] = Bounds[2] = Bounds[4] = VTK_FLOAT_MAX;
+  Bounds[1] = Bounds[3] = Bounds[5] = -VTK_FLOAT_MAX;
 }
 
 /*!
index 235f5f9a1cad5ea9f75022b7cee5c1ff3aea3d27..ad68c7007af110654e6c61e2b293954617465502 100755 (executable)
@@ -48,7 +48,7 @@ ResetCamera(vtkRenderer* theRenderer,
   int aCount = ComputeVisiblePropBounds(theRenderer,aBounds);
 
   if(theUsingZeroFocalPoint || aCount){
-    static double MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT;
+    static double MIN_DISTANCE = 1.0 / VTK_FLOAT_MAX;
 
     double aLength = aBounds[1]-aBounds[0];
     aLength = std::max((aBounds[3]-aBounds[2]),aLength);
@@ -120,8 +120,8 @@ ComputeBounds(vtkActorCollection* theCollection, double theBounds[6])
 {
   int aCount = 0;
 
-  theBounds[0] = theBounds[2] = theBounds[4] = VTK_LARGE_FLOAT;
-  theBounds[1] = theBounds[3] = theBounds[5] = -VTK_LARGE_FLOAT;
+  theBounds[0] = theBounds[2] = theBounds[4] = VTK_FLOAT_MAX;
+  theBounds[1] = theBounds[3] = theBounds[5] = -VTK_FLOAT_MAX;
 
   // loop through all props
   theCollection->InitTraversal();
@@ -132,8 +132,8 @@ ComputeBounds(vtkActorCollection* theCollection, double theBounds[6])
         if(anActor->IsInfinitive())
           continue;
       double *aBounds = aProp->GetBounds();
-      static double MIN_DISTANCE = 1./VTK_LARGE_FLOAT;
-      static double MAX_DISTANCE = 0.9*VTK_LARGE_FLOAT;
+      static double MIN_DISTANCE = 1./VTK_FLOAT_MAX;
+      static double MAX_DISTANCE = 0.9*VTK_FLOAT_MAX;
 
       if(fabs(aBounds[1] - aBounds[0]) < MIN_DISTANCE) {
         aBounds[0]-=0.001;
@@ -248,8 +248,8 @@ bool IsBBEmpty(vtkRenderer* theRenderer)
     return false;
 
   double aNewBndBox[6];
-  aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_LARGE_FLOAT;
-  aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_LARGE_FLOAT;
+  aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_FLOAT_MAX;
+  aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_FLOAT_MAX;
   
   // iterate through displayed objects and set size if necessary
   VTK::ActorCollectionCopy aCopy(theRenderer->GetActors());
@@ -262,9 +262,9 @@ bool IsBBEmpty(vtkRenderer* theRenderer)
       if(anActor->GetVisibility() && !anActor->IsInfinitive())
       {
         double *aBounds = anActor->GetBounds();
-        if(aBounds[0] > -VTK_LARGE_FLOAT && aBounds[1] < VTK_LARGE_FLOAT &&
-           aBounds[2] > -VTK_LARGE_FLOAT && aBounds[3] < VTK_LARGE_FLOAT &&
-           aBounds[4] > -VTK_LARGE_FLOAT && aBounds[5] < VTK_LARGE_FLOAT)
+        if(aBounds[0] > -VTK_FLOAT_MAX && aBounds[1] < VTK_FLOAT_MAX &&
+           aBounds[2] > -VTK_FLOAT_MAX && aBounds[3] < VTK_FLOAT_MAX &&
+           aBounds[4] > -VTK_FLOAT_MAX && aBounds[5] < VTK_FLOAT_MAX)
           isAny = true;
       }
   
@@ -292,8 +292,8 @@ bool ComputeBBCenter(vtkRenderer* theRenderer, double theCenter[3])
     return false;
 
   double aNewBndBox[6];
-  aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_LARGE_FLOAT;
-  aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_LARGE_FLOAT;
+  aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_FLOAT_MAX;
+  aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_FLOAT_MAX;
 
   // iterate through displayed objects and set size if necessary
   VTK::ActorCollectionCopy aCopy(theRenderer->GetActors());
@@ -312,9 +312,9 @@ bool ComputeBBCenter(vtkRenderer* theRenderer, double theCenter[3])
        //Ignore invalid bounds
        if(!isBoundValid(aBounds)) continue;
 
-        if(aBounds[0] > -VTK_LARGE_FLOAT && aBounds[1] < VTK_LARGE_FLOAT &&
-           aBounds[2] > -VTK_LARGE_FLOAT && aBounds[3] < VTK_LARGE_FLOAT &&
-           aBounds[4] > -VTK_LARGE_FLOAT && aBounds[5] < VTK_LARGE_FLOAT)
+        if(aBounds[0] > -VTK_FLOAT_MAX && aBounds[1] < VTK_FLOAT_MAX &&
+           aBounds[2] > -VTK_FLOAT_MAX && aBounds[3] < VTK_FLOAT_MAX &&
+           aBounds[4] > -VTK_FLOAT_MAX && aBounds[5] < VTK_FLOAT_MAX)
         {
           for(int i = 0; i < 5; i = i + 2){
             if(aBounds[i] < aNewBndBox[i]) 
@@ -334,11 +334,11 @@ bool ComputeBBCenter(vtkRenderer* theRenderer, double theCenter[3])
     return true;
   }
 
-  if(aNewBndBox[0] > -VTK_LARGE_FLOAT && aNewBndBox[1] < VTK_LARGE_FLOAT &&
-     aNewBndBox[2] > -VTK_LARGE_FLOAT && aNewBndBox[3] < VTK_LARGE_FLOAT &&
-     aNewBndBox[4] > -VTK_LARGE_FLOAT && aNewBndBox[5] < VTK_LARGE_FLOAT)
+  if(aNewBndBox[0] > -VTK_FLOAT_MAX && aNewBndBox[1] < VTK_FLOAT_MAX &&
+     aNewBndBox[2] > -VTK_FLOAT_MAX && aNewBndBox[3] < VTK_FLOAT_MAX &&
+     aNewBndBox[4] > -VTK_FLOAT_MAX && aNewBndBox[5] < VTK_FLOAT_MAX)
   {
-    static double MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT;
+    static double MIN_DISTANCE = 1.0 / VTK_FLOAT_MAX;
     
     double aLength = aNewBndBox[1]-aNewBndBox[0];
     aLength = std::max((aNewBndBox[3]-aNewBndBox[2]),aLength);
@@ -371,7 +371,7 @@ bool ComputeBBCenter(vtkRenderer* theRenderer, double theCenter[3])
   printf("aCount = %d\n",aCount);
 
   if(aCount){
-    static double MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT;
+    static double MIN_DISTANCE = 1.0 / VTK_FLOAT_MAX;
 
     double aLength = aBounds[1]-aBounds[0];
     aLength = max((aBounds[3]-aBounds[2]),aLength);