]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Additional fix for issue 0020938: EDF 1450 GEOM: center of zoom
authorouv <ouv@opencascade.com>
Tue, 12 Oct 2010 14:56:26 +0000 (14:56 +0000)
committerouv <ouv@opencascade.com>
Tue, 12 Oct 2010 14:56:26 +0000 (14:56 +0000)
src/LightApp/LightApp_Application.cxx
src/OCCViewer/OCCViewer_ViewPort3d.cxx
src/OCCViewer/OCCViewer_ViewWindow.cxx

index f6c5c1752765e1358ed823663e6b8df9f9b61d7d..8ad007ba55c0b4d0ae2068c5a1e7ed0b58f450c9 100644 (file)
   #include <SALOME_ListIO.hxx>
 #endif
 
+#include <Standard_Version.hxx>
+
+#ifdef OCC_VERSION_SERVICEPACK
+#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8 | OCC_VERSION_SERVICEPACK)
+#else
+#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8)
+#endif
+
 #define ToolBarMarker    0
 #define DockWidgetMarker 1
 
@@ -1970,14 +1978,16 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
   pref->setItemProperty( "strings", aStyleModeList, occStyleMode );
   pref->setItemProperty( "indexes", aModeIndexesList, occStyleMode );
 
+#if OCC_VERSION_LARGE > 0x06030010 // available only with OCC-6.3-sp11 and higher version
   int occZoomingStyleMode = pref->addPreference( tr( "PREF_ZOOMING" ), occGroup,
                                                  LightApp_Preferences::Selector, "OCCViewer", "zooming_mode" );
-  QStringList aZoomingStyleModeList;
-  aZoomingStyleModeList.append( tr("PREF_ZOOMING_AT_CENTER") );
-  aZoomingStyleModeList.append( tr("PREF_ZOOMING_AT_CURSOR") );
+  QStringList anOCCZoomingStyleModeList;
+  anOCCZoomingStyleModeList.append( tr("PREF_ZOOMING_AT_CENTER") );
+  anOCCZoomingStyleModeList.append( tr("PREF_ZOOMING_AT_CURSOR") );
 
-  pref->setItemProperty( "strings", aZoomingStyleModeList, occZoomingStyleMode );
+  pref->setItemProperty( "strings", anOCCZoomingStyleModeList, occZoomingStyleMode );
   pref->setItemProperty( "indexes", aModeIndexesList, occZoomingStyleMode );
+#endif
 
   // VTK Viewer
   int vtkGen = pref->addPreference( "", vtkGroup, LightApp_Preferences::Frame );
@@ -2012,7 +2022,11 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
   int vtkZoomingStyleMode = pref->addPreference( tr( "PREF_ZOOMING" ), vtkGen,
                                                  LightApp_Preferences::Selector, "VTKViewer", "zooming_mode" );
 
-  pref->setItemProperty( "strings", aZoomingStyleModeList, vtkZoomingStyleMode );
+  QStringList aVTKZoomingStyleModeList;
+  aVTKZoomingStyleModeList.append( tr("PREF_ZOOMING_AT_CENTER") );
+  aVTKZoomingStyleModeList.append( tr("PREF_ZOOMING_AT_CURSOR") );
+
+  pref->setItemProperty( "strings", aVTKZoomingStyleModeList, vtkZoomingStyleMode );
   pref->setItemProperty( "indexes", aModeIndexesList, vtkZoomingStyleMode );
 
   int vtkSpeed = pref->addPreference( tr( "PREF_INCREMENTAL_SPEED" ), vtkGen,
index e49b93b51d82b27266a6af7283395d0bc50f92f7..ef78fa84c70129e152f0f5843827f6b581fa0a72 100755 (executable)
@@ -51,6 +51,14 @@ static int sx = 0;
 static int sy = 0;
 static Standard_Boolean zRotation = Standard_False;
 
+#include <Standard_Version.hxx>
+
+#ifdef OCC_VERSION_SERVICEPACK
+#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8 | OCC_VERSION_SERVICEPACK)
+#else
+#define OCC_VERSION_LARGE (OCC_VERSION_MAJOR << 24 | OCC_VERSION_MINOR << 16 | OCC_VERSION_MAINTENANCE << 8)
+#endif
+
 /*!
   Constructor
 */
@@ -314,8 +322,10 @@ void OCCViewer_ViewPort3d::fitRect( const QRect& rect )
 */
 void OCCViewer_ViewPort3d::startZoomAtPoint( int x, int y )
 {
+#if OCC_VERSION_LARGE > 0x06030010 // available only with OCC-6.3-sp11 and higher version
   if ( !activeView().IsNull() && isAdvancedZoomingEnabled() )
     activeView()->StartZoomAtPoint( x, y );
+#endif
 }
 
 /*!
index c52efe0caf6c3dafc37bca2610881de99bfd509d..a1200fd76555fb58e39ac83a344b09e5cc374b01 100755 (executable)
@@ -1192,7 +1192,9 @@ void OCCViewer_ViewWindow::createToolBar()
 
   toolMgr()->append( DumpId, tid );
   toolMgr()->append( SwitchInteractionStyleId, tid );
+#if OCC_VERSION_LARGE > 0x06030010 // available only with OCC-6.3-sp11 and higher version
   toolMgr()->append( SwitchZoomingStyleId, tid );
+#endif
   if( myModel->trihedronActivated() ) 
     toolMgr()->append( TrihedronShowId, tid );