mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-02-09 18:03:08 +05:00
Issue "0021757: EDF 1829 : Activate bring to front action on simple selection of an object": additional patch from Renaud NEDELEC.
This commit is contained in:
parent
f5c8555cd0
commit
7cb2566ca6
@ -75,7 +75,7 @@
|
|||||||
#include <LightApp_Preferences.h>
|
#include <LightApp_Preferences.h>
|
||||||
|
|
||||||
#include <SALOME_LifeCycleCORBA.hxx>
|
#include <SALOME_LifeCycleCORBA.hxx>
|
||||||
#include <SALOME_ListIO.hxx>
|
// #include <SALOME_ListIO.hxx>
|
||||||
#include <SALOME_ListIteratorOfListIO.hxx>
|
#include <SALOME_ListIteratorOfListIO.hxx>
|
||||||
|
|
||||||
#include <SALOMEDSClient_ClientFactory.hxx>
|
#include <SALOMEDSClient_ClientFactory.hxx>
|
||||||
@ -200,7 +200,8 @@ void GeometryGUI::Modified (bool theIsUpdateActions)
|
|||||||
// purpose : Constructor
|
// purpose : Constructor
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
GeometryGUI::GeometryGUI() :
|
GeometryGUI::GeometryGUI() :
|
||||||
SalomeApp_Module( "GEOM" )
|
SalomeApp_Module( "GEOM" ),
|
||||||
|
myTopLevelIOList()
|
||||||
{
|
{
|
||||||
if ( CORBA::is_nil( myComponentGeom ) )
|
if ( CORBA::is_nil( myComponentGeom ) )
|
||||||
{
|
{
|
||||||
@ -2101,28 +2102,34 @@ void GeometryGUI::onAutoBringToFront()
|
|||||||
|
|
||||||
SALOME_ListIO selected;
|
SALOME_ListIO selected;
|
||||||
getApp()->selectionMgr()->selectedObjects( selected );
|
getApp()->selectionMgr()->selectedObjects( selected );
|
||||||
SALOME_ListIO allObjects;
|
if (!myTopLevelIOList.IsEmpty())
|
||||||
window->GetVisible( allObjects );
|
{
|
||||||
|
for( SALOME_ListIteratorOfListIO It( myTopLevelIOList ); It.More(); It.Next() )
|
||||||
for ( SALOME_ListIteratorOfListIO It( allObjects ); It.More(); It.Next() ) {
|
{
|
||||||
Handle( SALOME_InteractiveObject ) io = It.Value();
|
Handle( SALOME_InteractiveObject ) io = It.Value();
|
||||||
bool isSelected = false;
|
bool isSelected = false;
|
||||||
for( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
|
for( SALOME_ListIteratorOfListIO It_sel( selected ); It_sel.More(); It_sel.Next() )
|
||||||
Handle( SALOME_InteractiveObject ) ioSelected = It.Value();
|
{
|
||||||
if( io->isSame( ioSelected ) )
|
Handle( SALOME_InteractiveObject ) sel_io = It_sel.Value();
|
||||||
|
if( io->isSame( sel_io ) )
|
||||||
isSelected = true;
|
isSelected = true;
|
||||||
}
|
}
|
||||||
QVariant v = appStudy->getObjectProperty( aMgrId, io->getEntry(), GEOM::propertyName( GEOM::TopLevel ), QVariant() );
|
if (!isSelected && appStudy->findObjectByEntry(io->getEntry()))
|
||||||
bool isTopLevel = v.isValid() ? v.toBool() : false;
|
{
|
||||||
if( isSelected && !isTopLevel ) {
|
|
||||||
appStudy->setObjectProperty( aMgrId, io->getEntry(), GEOM::propertyName( GEOM::TopLevel ), true );
|
|
||||||
if ( window->isVisible( io ) ) displayer.Redisplay( io, false );
|
|
||||||
}
|
|
||||||
else if( !isSelected ) {
|
|
||||||
appStudy->setObjectProperty( aMgrId, io->getEntry(), GEOM::propertyName( GEOM::TopLevel ), false );
|
appStudy->setObjectProperty( aMgrId, io->getEntry(), GEOM::propertyName( GEOM::TopLevel ), false );
|
||||||
if ( window->isVisible( io ) ) displayer.Redisplay( io, false );
|
if ( window->isVisible( io ) ) displayer.Redisplay( io, false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
myTopLevelIOList.Assign(selected);
|
||||||
|
for( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() )
|
||||||
|
{
|
||||||
|
Handle( SALOME_InteractiveObject ) io = It.Value();
|
||||||
|
appStudy->setObjectProperty( aMgrId, io->getEntry(), GEOM::propertyName( GEOM::TopLevel ), true );
|
||||||
|
if ( window->isVisible( io ) ) displayer.Redisplay( io, false );
|
||||||
|
}
|
||||||
|
|
||||||
displayer.UpdateViewer();
|
displayer.UpdateViewer();
|
||||||
GeometryGUI::Modified();
|
GeometryGUI::Modified();
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,8 @@
|
|||||||
#include "SALOMEconfig.h"
|
#include "SALOMEconfig.h"
|
||||||
#include CORBA_CLIENT_HEADER(SALOMEDS)
|
#include CORBA_CLIENT_HEADER(SALOMEDS)
|
||||||
|
|
||||||
|
#include <SALOME_ListIO.hxx>
|
||||||
|
|
||||||
class QDialog;
|
class QDialog;
|
||||||
class QMenu;
|
class QMenu;
|
||||||
class QAction;
|
class QAction;
|
||||||
@ -232,6 +234,8 @@ private:
|
|||||||
|
|
||||||
GEOMGUI_CreationInfoWdg* myCreationInfoWdg;
|
GEOMGUI_CreationInfoWdg* myCreationInfoWdg;
|
||||||
|
|
||||||
|
SALOME_ListIO myTopLevelIOList;
|
||||||
|
|
||||||
friend class DisplayGUI;
|
friend class DisplayGUI;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user