Salome HOME
refs #416: to store the open state of object browser items in the binary array
[modules/gui.git] / src / GLViewer / GLViewer_BaseObjects.cxx
index 29bff9d44fdd3df32dee8b889ad43e6753685752..86112cb7814b3cb8f11fde5c7f35d983de7cbc6c 100644 (file)
@@ -1,41 +1,35 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014  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
-//
-//  Author : OPEN CASCADE
-//#include <GLViewerAfx.h>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "GLViewer_BaseObjects.h"
 #include "GLViewer_BaseDrawers.h"
 #include "GLViewer_AspectLine.h"
 #include "GLViewer_CoordSystem.h"
 #include "GLViewer_Text.h"
 #include "GLViewer_Group.h"
-
 #include "GLViewer_Drawer.h"
 
 #include <QFile>
 
-//#include <cmath>
-//using namespace std;
-
 /*!
   Constructor
 */
@@ -373,8 +367,8 @@ GLboolean GLViewer_MarkerSet::highlight( GLfloat x, GLfloat y, GLfloat tol, GLbo
     ydist = ( myYCoord[i] - y ) * myYScale;
 
 //    if ( isCircle && ( xdist * xdist + ydist * ydist <= radius * radius ) ||
-    if ( isCircle && ( xdist * xdist + ydist * ydist <= myMarkerSize * myMarkerSize ) ||
-    !isCircle && ( fabs( xdist ) <= radius && fabs( ydist ) <= radius ) )
+    if ( ( isCircle && ( xdist * xdist + ydist * ydist <= myMarkerSize * myMarkerSize ) ) ||
+         ( !isCircle && ( fabs( xdist ) <= radius && fabs( ydist ) <= radius ) ) )
     {
       isFound = FALSE;
       count++;
@@ -462,8 +456,8 @@ GLboolean GLViewer_MarkerSet::select( GLfloat x, GLfloat y, GLfloat tol, GLViewe
     ydist = ( myYCoord[i] - y ) * myYScale;
 
     //if ( isCircle && ( xdist * xdist + ydist * ydist <= radius * radius ) ||
-    if ( isCircle && ( xdist * xdist + ydist * ydist <= myMarkerSize * myMarkerSize ) ||
-          !isCircle && ( fabs( xdist ) <= radius && fabs( ydist ) <= radius ) )
+    if ( ( isCircle && ( xdist * xdist + ydist * ydist <= myMarkerSize * myMarkerSize ) ) ||
+         ( !isCircle && ( fabs( xdist ) <= radius && fabs( ydist ) <= radius ) ) )
     {
       count++;
       if ( isShift )
@@ -1101,7 +1095,7 @@ GLboolean GLViewer_Polyline::select( GLfloat x, GLfloat y, GLfloat tol, GLViewer
         return false;
     GLfloat xa, xb, ya, yb, l;
     GLfloat rsin, rcos, r, ra, rb;
-    GLboolean update;
+    // GLboolean update;
     GLboolean selected = myIsSel;
 
     myIsSel = GL_FALSE;
@@ -1146,7 +1140,7 @@ GLboolean GLViewer_Polyline::select( GLfloat x, GLfloat y, GLfloat tol, GLViewer
     else
         myHighFlag = GL_TRUE;
 
-    update = ( GLboolean )( myIsSel != selected );
+    // update = ( GLboolean )( myIsSel != selected );
 
     //  cout << "GLViewer_Polyline::select complete with " << (int)myIsSel << endl;