-// Copyright (C) 2005 OPEN CASCADE
+// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
//
-// 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.
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// 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 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.
//
-// 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
+// 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.
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// 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
//
-// Author : OPEN CASCADE
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// Author : OPEN CASCADE
// File: GLViewer_Context.cxx
// Created: November, 2004
-
+//
/*!
\class GLViewer_AspectLine
\brief Class for manage of presentations in GLViewer
#include "GLViewer_Object.h"
#include "GLViewer_Viewer2d.h"
#include "GLViewer_ViewPort2d.h"
+#include "GLViewer_ViewFrame.h"
+
+//QT includes
+#include <QRect>
#include <TColStd_SequenceOfInteger.hxx>
if( myLastPickedChanged || myUpdateAll )
myGLViewer2d->updateAll();
else
- myGLViewer2d->activateDrawers( anUpdatedObjects, TRUE, TRUE );
+ myGLViewer2d->activateDrawers( anUpdatedObjects, true, true );
return 0;
}
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;
}
else if( myLastPicked->isSelected() && status != SS_LocalChanged )
{
- mySelectedObjects.remove( myLastPicked );
+ mySelectedObjects.removeAll( myLastPicked );
myLastPicked->unselect();
myGLViewer2d->updateAll();
}
if ( myLastPicked->select( myXhigh, myYhigh, myTolerance, GLViewer_Rect(), false, byCircle, Append )
- && mySelectedObjects.findIndex( myLastPicked ) == -1 )
+ && mySelectedObjects.indexOf( myLastPicked ) == -1 )
{
mySelectedObjects.append( myLastPicked );
- myGLViewer2d->activateDrawer( myLastPicked, TRUE, TRUE );
+ myGLViewer2d->activateDrawer( myLastPicked, true, true );
if( status == SS_Invalid )
status = SS_GlobalChanged;
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;
if( updateAll || myUpdateAll )
myGLViewer2d->updateAll();
else
- myGLViewer2d->activateDrawers( aList, TRUE, TRUE );
+ myGLViewer2d->activateDrawers( aList, true, true );
if( mySelectedObjects.count() != 0 )
status = SS_GlobalChanged;
{
myLastPicked = *oit;
mySelectedObjects.append( myLastPicked );
- myGLViewer2d->activateDrawer( myLastPicked, TRUE, TRUE );
+ myGLViewer2d->activateDrawer( myLastPicked, true, true );
status = SS_GlobalChanged;
return status;
}
isSel = (*it)->isSelected();
}
- if( isSel && mySelectedObjects.findIndex( *it ) == -1 )
+ if( isSel && mySelectedObjects.indexOf( *it ) == -1 )
{
aList.append( *it );
mySelectedObjects.append( *it );
if( updateAll || myUpdateAll )
myGLViewer2d->updateAll();
else
- myGLViewer2d->activateDrawers( aList, TRUE, TRUE );
+ myGLViewer2d->activateDrawers( aList, true, true );
return status;
}
if ( mySelCurIndex >= 0 && mySelCurIndex < NbSelected() )
{
mySelCurIndex++;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/*!
{
//QRect* rect = object->getRect()->toQRect();
//myGLViewer2d->updateBorders( *rect );
- myGLViewer2d->activateDrawer( object, FALSE );
+ myGLViewer2d->activateDrawer( object, false );
}
}
else
if( myActiveObjects.contains( oldObject ) )
{
- myActiveObjects.remove( oldObject );
+ myActiveObjects.removeAll( oldObject );
myActiveObjects.append( newObject );
return true;
}
if( myInactiveObjects.contains( oldObject ) )
{
- myInactiveObjects.remove( oldObject );
+ myInactiveObjects.removeAll( oldObject );
myInactiveObjects.append( newObject );
return true;
}
}
if( updateViewer )
- myGLViewer2d->activateDrawers( aList, TRUE );
+ myGLViewer2d->activateDrawers( aList, true );
mySelectedObjects.clear();
}
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 );
}
/*!
if( !object || !mySelectedObjects.contains( object ) )
return;
- mySelectedObjects.remove( object );
+ mySelectedObjects.removeAll( object );
object->unselect();
if( updateViewer )
- myGLViewer2d->activateDrawer( object, TRUE, TRUE );
+ myGLViewer2d->activateDrawer( object, true, true );
}
/*!
return;
if( myActiveObjects.contains( theObject ) )
- myActiveObjects.remove( theObject );
+ myActiveObjects.removeAll( theObject );
else if( myInactiveObjects.contains( theObject ) )
- myInactiveObjects.remove( theObject );
+ myInactiveObjects.removeAll( theObject );
else
return;
if( mySelectedObjects.contains( theObject ) )
- mySelectedObjects.remove( theObject );
+ mySelectedObjects.removeAll( theObject );
GLViewer_Group* aGroup = theObject->getGroup();
if( aGroup )
if( !theObject || !myInactiveObjects.contains( theObject ) )
return false;
- myInactiveObjects.remove( theObject );
+ myInactiveObjects.removeAll( theObject );
myActiveObjects.append( theObject );
return true;
}
if( !theObject || !myActiveObjects.contains( theObject ) )
return false;
- myActiveObjects.remove( theObject );
+ myActiveObjects.removeAll( theObject );
myInactiveObjects.append( theObject );
return true;
}