Salome HOME
updated copyright message
[modules/gui.git] / src / OCCViewer / OCCViewer_ViewPort3d.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 46153c3..322c869
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -41,7 +41,6 @@
 #include <QTimer>
 
 #include <V3d_View.hxx>
-#include <Quantity_Ratio.hxx>
 
 #include "utilities.h"
 
@@ -64,8 +63,8 @@ static Standard_Boolean zRotation = Standard_False;
 */
 OCCViewer_ViewPort3d::OCCViewer_ViewPort3d( QWidget* parent, const Handle( V3d_Viewer)& viewer, V3d_TypeOfView  type )
   : OCCViewer_ViewPort( parent ),
-    myScale( 1.0 ),
     myBusy( true ),
+    myScale( 1.0 ),
     myIsAdvancedZoomingEnabled( false )
 {
   // VSR: 01/07/2010 commented to avoid SIGSEGV at SALOME exit
@@ -358,13 +357,13 @@ void OCCViewer_ViewPort3d::updateBackground()
       // set texture image: file name and fill mode
       switch ( textureMode ) {
       case Qtx::CenterTexture:
-       activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_CENTERED );
+       activeView()->SetBackgroundImage( fi.absoluteFilePath().toUtf8().constData(), Aspect_FM_CENTERED );
        break;
       case Qtx::TileTexture:
-       activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_TILED );
+       activeView()->SetBackgroundImage( fi.absoluteFilePath().toUtf8().constData(), Aspect_FM_TILED );
        break;
       case Qtx::StretchTexture:
-       activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_STRETCH );
+       activeView()->SetBackgroundImage( fi.absoluteFilePath().toUtf8().constData(), Aspect_FM_STRETCH );
        break;
       default:
        break;
@@ -470,7 +469,7 @@ void OCCViewer_ViewPort3d::startRotation( int x, int y,
                             theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(),
                             Standard_True );
 
-      Quantity_Ratio zRotationThreshold;
+      Standard_Real zRotationThreshold;
       zRotation = Standard_False;
       zRotationThreshold = 0.45;
       if( zRotationThreshold > 0. ) {
@@ -547,9 +546,6 @@ void OCCViewer_ViewPort3d::paintEvent( QPaintEvent* e )
     mapView( activeView() );
 #endif
   if ( !myWindow.IsNull() ) {
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-    QApplication::syncX();
-#endif
     if ( !myPaintersRedrawing ) {
       activeView()->Redraw();
     }
@@ -563,14 +559,9 @@ void OCCViewer_ViewPort3d::paintEvent( QPaintEvent* e )
 */
 void OCCViewer_ViewPort3d::resizeEvent( QResizeEvent* e )
 {
-#if defined WIN32 || QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
-  /* Win32 : map before first show to avoid flicker */
+  /* Map before first show to avoid flicker */
   if ( !mapped( activeView() ) )
     mapView( activeView() );
-#endif
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-    QApplication::syncX();
-#endif
   QTimer::singleShot( 0, this, SLOT( repaintViewAfterMove() ) );
   emit vpResizeEvent( e );
 }
@@ -588,7 +579,7 @@ void OCCViewer_ViewPort3d::repaintViewAfterMove( )
 /*!
   Fits all objects in view. [ virtual protected ]
 */
-void OCCViewer_ViewPort3d::fitAll( bool keepScale, bool withZ, bool upd )
+void OCCViewer_ViewPort3d::fitAll( bool keepScale, bool /*withZ*/, bool upd )
 {
   if ( activeView().IsNull() )
     return;