Salome HOME
NPAL17269: Performance pb. when creating a group with GUI.
authorjfa <jfa@opencascade.com>
Wed, 17 Oct 2007 12:17:27 +0000 (12:17 +0000)
committerjfa <jfa@opencascade.com>
Wed, 17 Oct 2007 12:17:27 +0000 (12:17 +0000)
src/GEOMGUI/GEOMGUI_OCCSelector.cxx
src/GroupGUI/GroupGUI_GroupDlg.cxx

index 1732d062424f5ceb6173c7808a48d3712bfea913..025ef33760f90f3ff66cf39c765f647e7a6dd833 100644 (file)
@@ -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();
 
index d970fc9f65f10f48c4b870da206d9ba948451791..45a98586b90722e1e6163b26cca003e0e3053083 100644 (file)
@@ -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<QString, TColStd_IndexedMapOfInteger> 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;