From 0e5f6bb0a2864c62df1524c79653e1506ec4fee5 Mon Sep 17 00:00:00 2001 From: jfa Date: Wed, 17 Oct 2007 12:17:27 +0000 Subject: [PATCH] NPAL17269: Performance pb. when creating a group with GUI. --- src/GEOMGUI/GEOMGUI_OCCSelector.cxx | 5 ++--- src/GroupGUI/GroupGUI_GroupDlg.cxx | 14 +++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/GEOMGUI/GEOMGUI_OCCSelector.cxx b/src/GEOMGUI/GEOMGUI_OCCSelector.cxx index 1732d0624..025ef3376 100644 --- a/src/GEOMGUI/GEOMGUI_OCCSelector.cxx +++ b/src/GEOMGUI/GEOMGUI_OCCSelector.cxx @@ -320,7 +320,7 @@ void GEOMGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList ) // DO the selection int i = 1, n = ownersmap.Extent(); bool isAutoHilight = ic->AutomaticHilight(); - ic->SetAutomaticHilight(Standard_False); // for better performance + ic->SetAutomaticHilight(Standard_False); //Bug 17269: for better performance for (; i <= n; i++) { Handle(SelectMgr_EntityOwner) owner = ownersmap( i ); @@ -332,8 +332,7 @@ void GEOMGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList ) else ic->AddOrRemoveSelected( Handle(AIS_InteractiveObject)::DownCast(owner->Selectable()), false ); } - ic->SetAutomaticHilight(isAutoHilight); // restore - + ic->SetAutomaticHilight(isAutoHilight); //Bug 17269: restore mode ic->HilightSelected(/*updateviewer*/Standard_True); //vw->update(); diff --git a/src/GroupGUI/GroupGUI_GroupDlg.cxx b/src/GroupGUI/GroupGUI_GroupDlg.cxx index d970fc9f6..45a98586b 100644 --- a/src/GroupGUI/GroupGUI_GroupDlg.cxx +++ b/src/GroupGUI/GroupGUI_GroupDlg.cxx @@ -595,6 +595,7 @@ void GroupGUI_GroupDlg::updateState() if (app) { LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); if (aSelMgr) { + /* aSelMgr->selectedObjects(aSelIOs); if ( aSelIOs.Extent() == 1 ) { @@ -605,6 +606,12 @@ void GroupGUI_GroupDlg::updateState() if ( aResult && !anObj->_is_nil() ) aSelMgr->GetIndexes( aSelIOs.First(), aMapIndex ); } + */ + QMap aMap; + //MapEntryOfMapOfInteger& aMap; + aSelMgr->selectedSubOwners(aMap); + if (aMap.size() == 1) + aMapIndex = aMap.begin().data(); } } @@ -700,7 +707,6 @@ void GroupGUI_GroupDlg::highlightSubShapes() return; TColStd_MapOfInteger anIds; - //TColStd_IndexedMapOfInteger anIds; myBusy = true; @@ -712,12 +718,6 @@ void GroupGUI_GroupDlg::highlightSubShapes() LightApp_SelectionMgr* aSelMgr = app->selectionMgr(); aSelMgr->clearSelected(); aSelMgr->AddOrRemoveIndex(aSh->getIO(), anIds, false); - //SUIT_DataOwnerPtrList aList; - //Handle(SALOME_InteractiveObject) IObject = aSh->getIO(); - //for (int i = 1; i <= anIds.Extent(); i++) - // aList.append(new LightApp_DataSubOwner(QString(IObject->getEntry()), anIds(i))); - //aSelMgr->setSelected(aList, /*append*/false); - ////aSelMgr->selectObjects(aSh->getIO(), anIds, /*append*/false); myBusy = false; -- 2.39.2