Salome HOME
Update copyrights
[modules/gui.git] / src / GLViewer / GLViewer_ViewPort2d.cxx
index 0cd5b9371a988114675d4e6494566f75d505d5b1..2acfb57fb618a76208a45fc63b2ba4bb15da0825 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  Author : OPEN CASCADE
 // File:      GLViewer_ViewPort2d.cxx
 // Created:   November, 2004
@@ -94,7 +95,7 @@ GLViewer_ViewPort2d::GLViewer_ViewPort2d( QWidget* parent, GLViewer_ViewFrame* t
   myGLWidget = new GLViewer_Widget( this, 0 ) ;
   qbl->addWidget( myGLWidget );
   myGLWidget->setFocusProxy( this );
-  setMouseTracking( TRUE );
+  setMouseTracking( true );
 
   myIsDragProcess = noDrag;
   //myCurDragMousePos = QPoint();
@@ -529,7 +530,7 @@ void GLViewer_ViewPort2d::initResize( int x, int y )
     GLfloat zoom, xzoom, yzoom;
     GLfloat w = x;
     GLfloat h = y;
-    bool max = FALSE;
+    bool max = false;
 
     xzoom = (GLfloat)x / myWidth;
     yzoom = (GLfloat)y / myHeight;
@@ -540,7 +541,7 @@ void GLViewer_ViewPort2d::initResize( int x, int y )
         zoom = yzoom;
     else
     {
-        max = TRUE;
+        max = true;
         zoom = xzoom > yzoom ? xzoom : yzoom;
     }
 
@@ -1188,12 +1189,12 @@ void GLViewer_ViewPort2d::drawSelectByRect( int x, int y )
     {
         myRectBand->hide();    /* erase */
 
-       mypLastPoint->setX( x );
+        mypLastPoint->setX( x );
         mypLastPoint->setY( y );
 
-       QRect aRect = selectionRect();
-       myRectBand->setGeometry( aRect );    /* draw */
-       myRectBand->setVisible( aRect.isValid() );
+        QRect aRect = selectionRect();
+        myRectBand->setGeometry( aRect );    /* draw */
+        myRectBand->setVisible( aRect.isValid() );
     }
 
 }
@@ -1215,8 +1216,8 @@ void GLViewer_ViewPort2d::finishSelectByRect()
         mypFirstPoint = NULL;
         mypLastPoint = NULL;
 
-       delete myRectBand;
-       myRectBand = 0;
+        delete myRectBand;
+        myRectBand = 0;
     }
 }
 
@@ -1380,13 +1381,11 @@ void GLViewer_ViewPort2d::onMaybeTip( QPoint thePoint, QString& theText, QFont&
 
     if( !aList.isEmpty() )
     {
-      int index = 0;
       int str_size = aList.first().length();
       for( int i = 1, size = aList.count(); i < size; i++ )
       {
         if ( str_size < (int)aList[i].length() )
         {
-          index = i;
           str_size = aList[i].length();
         }
       }