Salome HOME
updated copyright message
[modules/gui.git] / src / GLViewer / GLViewer_Context.cxx
index c839a22f04d4ccb0977f268a31c9b7b88138452c..205458d97b51726acc5fac6dd198989653dc7a1c 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  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
+// 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_Context.cxx
 // Created:   November, 2004
@@ -181,7 +182,7 @@ int GLViewer_Context::MoveTo( int xi, int yi, bool byCircle )
     if( myLastPickedChanged || myUpdateAll )
         myGLViewer2d->updateAll();
     else
-        myGLViewer2d->activateDrawers( anUpdatedObjects, TRUE, TRUE );
+        myGLViewer2d->activateDrawers( anUpdatedObjects, true, true );
 
     return 0;
 }
@@ -210,16 +211,16 @@ int GLViewer_Context::Select( bool Append, bool byCircle )
         if ( !Append )
         {
             for( it = mySelectedObjects.begin(), itEnd = mySelectedObjects.end() ; it != itEnd; ++it )
-                   if( myLastPicked != *it )
+                    if( myLastPicked != *it )
                 {
-                       updateAll = (*it)->unselect() || updateAll;
-                       aList.append( *it );
+                        updateAll = (*it)->unselect() || updateAll;
+                        aList.append( *it );
                 }
 
             if( updateAll || myUpdateAll )
                 myGLViewer2d->updateAll();
             else
-                myGLViewer2d->activateDrawers( aList, TRUE, TRUE );
+                myGLViewer2d->activateDrawers( aList, true, true );
 
             if( mySelectedObjects.count() != 0 && status == SS_Invalid )
                 status = SS_GlobalChanged;
@@ -241,7 +242,7 @@ int GLViewer_Context::Select( bool Append, bool byCircle )
              && mySelectedObjects.indexOf( myLastPicked ) == -1 )
         {
             mySelectedObjects.append( myLastPicked );
-            myGLViewer2d->activateDrawer( myLastPicked, TRUE, TRUE );
+            myGLViewer2d->activateDrawer( myLastPicked, true, true );
 
             if( status == SS_Invalid )
                 status = SS_GlobalChanged;
@@ -257,16 +258,16 @@ int GLViewer_Context::Select( bool Append, bool byCircle )
         if ( !Append )
         {
             for( it = mySelectedObjects.begin(), itEnd = mySelectedObjects.end() ; it != itEnd; ++it )
-                   if ( myLastPicked != *it )
+                    if ( myLastPicked != *it )
                 {
-                       updateAll = (*it)->unselect() || updateAll;
-                       aList.append( *it );
+                        updateAll = (*it)->unselect() || updateAll;
+                        aList.append( *it );
                 }
 
             if( updateAll || myUpdateAll )
                 myGLViewer2d->updateAll();
             else
-                myGLViewer2d->activateDrawers( aList, TRUE, TRUE );
+                myGLViewer2d->activateDrawers( aList, true, true );
 
             if( mySelectedObjects.count() != 0 )
                 status = SS_GlobalChanged;
@@ -296,7 +297,7 @@ int GLViewer_Context::Select( bool Append, bool byCircle )
             if( updateAll || myUpdateAll )
                 myGLViewer2d->updateAll();
             else
-                myGLViewer2d->activateDrawers( aList, TRUE, TRUE );
+                myGLViewer2d->activateDrawers( aList, true, true );
 
             if( mySelectedObjects.count() != 0 )
                 status = SS_GlobalChanged;
@@ -318,7 +319,7 @@ int GLViewer_Context::Select( bool Append, bool byCircle )
             {
                 myLastPicked = *oit;
                 mySelectedObjects.append( myLastPicked );
-                myGLViewer2d->activateDrawer( myLastPicked, TRUE, TRUE );
+                myGLViewer2d->activateDrawer( myLastPicked, true, true );
                 status = SS_GlobalChanged;
                 return status;
             }
@@ -386,7 +387,7 @@ int GLViewer_Context::SelectByRect( const QRect& theRect, bool Append )
     if( updateAll || myUpdateAll )
         myGLViewer2d->updateAll();
     else
-        myGLViewer2d->activateDrawers( aList, TRUE, TRUE );
+        myGLViewer2d->activateDrawers( aList, true, true );
 
     return status;
 }
@@ -469,10 +470,10 @@ bool GLViewer_Context::NextSelected()
   if ( mySelCurIndex >= 0 && mySelCurIndex < NbSelected() )
   {
     mySelCurIndex++;
-    return TRUE;
+    return true;
   }
 
-  return FALSE;
+  return false;
 }
 
 /*!
@@ -511,7 +512,7 @@ int GLViewer_Context::insertObject( GLViewer_Object* object, bool display, bool
         {
             //QRect* rect = object->getRect()->toQRect();
             //myGLViewer2d->updateBorders( *rect );
-            myGLViewer2d->activateDrawer( object, FALSE );
+            myGLViewer2d->activateDrawer( object, false );
         }
     }
     else
@@ -599,7 +600,7 @@ void GLViewer_Context::clearSelected( bool updateViewer )
   }          
         
   if( updateViewer )
-    myGLViewer2d->activateDrawers( aList, TRUE );
+    myGLViewer2d->activateDrawers( aList, true );
   mySelectedObjects.clear();    
 }
 
@@ -614,12 +615,12 @@ void GLViewer_Context::setSelected( GLViewer_Object* object, bool updateViewer )
 
   if( myActiveObjects.contains( object ) && !mySelectedObjects.contains( object ) )
   {
-    object->setSelected( TRUE );
+    object->setSelected( true );
     mySelectedObjects.append( object );
   }
      
   if( updateViewer )
-    myGLViewer2d->activateDrawer( object, TRUE, TRUE );
+    myGLViewer2d->activateDrawer( object, true, true );
 }
 
 /*!
@@ -635,7 +636,7 @@ void GLViewer_Context::remSelected( GLViewer_Object* object, bool updateViewer )
   object->unselect();
   
   if( updateViewer )
-    myGLViewer2d->activateDrawer( object, TRUE, TRUE );
+    myGLViewer2d->activateDrawer( object, true, true );
 }
 
 /*!