]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
NPAL17269: Performance pb. when creating a group with GUI.
authorjfa <jfa@opencascade.com>
Wed, 17 Oct 2007 10:03:04 +0000 (10:03 +0000)
committerjfa <jfa@opencascade.com>
Wed, 17 Oct 2007 10:03:04 +0000 (10:03 +0000)
src/GEOMGUI/GEOMGUI_OCCSelector.cxx
src/GroupGUI/GroupGUI_GroupDlg.cxx

index 066a19b4271421ee3ecc2289f146860e5428c2d1..1732d062424f5ceb6173c7808a48d3712bfea913 100644 (file)
@@ -318,7 +318,10 @@ void GEOMGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList )
   vw->unHighlightAll( false );
 
   // DO the selection
-  for  ( int i = 1, n = ownersmap.Extent(); i <= n; i++ )
+  int i = 1, n = ownersmap.Extent();
+  bool isAutoHilight = ic->AutomaticHilight();
+  ic->SetAutomaticHilight(Standard_False); // for better performance
+  for  (; i <= n; i++)
   {
     Handle(SelectMgr_EntityOwner) owner = ownersmap( i );
     if ( owner->State() )
@@ -329,8 +332,10 @@ void GEOMGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList )
     else
       ic->AddOrRemoveSelected( Handle(AIS_InteractiveObject)::DownCast(owner->Selectable()), false );
   }
+  ic->SetAutomaticHilight(isAutoHilight); // restore
 
-  vw->update();
+  ic->HilightSelected(/*updateviewer*/Standard_True);
+  //vw->update();
 
   // fill extra selected
   mySelectedExternals.clear();
index 7e0e5355cdab6cfecb39780aaba0d7b461bf815b..d970fc9f65f10f48c4b870da206d9ba948451791 100644 (file)
@@ -510,11 +510,17 @@ void GroupGUI_GroupDlg::add()
 //=================================================================================
 void GroupGUI_GroupDlg::remove()
 {
+  bool isBlocked = myIdList->signalsBlocked();
+  myIdList->blockSignals( true );
+
   for ( int i = myIdList->count() - 1; i >= 0; i-- ) {
     if ( myIdList->isSelected( i ) )
       myIdList->removeItem( i );
   }
-  updateState();
+
+  myIdList->blockSignals( isBlocked );
+
+  highlightSubShapes();
 }
 
 
@@ -694,6 +700,7 @@ void GroupGUI_GroupDlg::highlightSubShapes()
     return;
 
   TColStd_MapOfInteger anIds;
+  //TColStd_IndexedMapOfInteger anIds;
 
   myBusy = true;
 
@@ -701,10 +708,16 @@ void GroupGUI_GroupDlg::highlightSubShapes()
     if ( myIdList->isSelected( ii ) )
       anIds.Add( myIdList->item( ii )->text().toInt() );
 
-  LightApp_SelectionMgr* aSelMgr =
-    ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr();
+  SalomeApp_Application* app = myGeomGUI->getApp();
+  LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
   aSelMgr->clearSelected();
-  aSelMgr->AddOrRemoveIndex( aSh->getIO(), anIds, false );
+  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;