mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-05-31 22:37:48 +05:00
NPAL17269: Performance pb. when creating a group with GUI.
This commit is contained in:
parent
c75dbe444e
commit
06656bb3f5
@ -318,7 +318,10 @@ void GEOMGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList )
|
|||||||
vw->unHighlightAll( false );
|
vw->unHighlightAll( false );
|
||||||
|
|
||||||
// DO the selection
|
// 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 );
|
Handle(SelectMgr_EntityOwner) owner = ownersmap( i );
|
||||||
if ( owner->State() )
|
if ( owner->State() )
|
||||||
@ -329,8 +332,10 @@ void GEOMGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList )
|
|||||||
else
|
else
|
||||||
ic->AddOrRemoveSelected( Handle(AIS_InteractiveObject)::DownCast(owner->Selectable()), false );
|
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
|
// fill extra selected
|
||||||
mySelectedExternals.clear();
|
mySelectedExternals.clear();
|
||||||
|
@ -510,11 +510,17 @@ void GroupGUI_GroupDlg::add()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void GroupGUI_GroupDlg::remove()
|
void GroupGUI_GroupDlg::remove()
|
||||||
{
|
{
|
||||||
|
bool isBlocked = myIdList->signalsBlocked();
|
||||||
|
myIdList->blockSignals( true );
|
||||||
|
|
||||||
for ( int i = myIdList->count() - 1; i >= 0; i-- ) {
|
for ( int i = myIdList->count() - 1; i >= 0; i-- ) {
|
||||||
if ( myIdList->isSelected( i ) )
|
if ( myIdList->isSelected( i ) )
|
||||||
myIdList->removeItem( i );
|
myIdList->removeItem( i );
|
||||||
}
|
}
|
||||||
updateState();
|
|
||||||
|
myIdList->blockSignals( isBlocked );
|
||||||
|
|
||||||
|
highlightSubShapes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -694,6 +700,7 @@ void GroupGUI_GroupDlg::highlightSubShapes()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
TColStd_MapOfInteger anIds;
|
TColStd_MapOfInteger anIds;
|
||||||
|
//TColStd_IndexedMapOfInteger anIds;
|
||||||
|
|
||||||
myBusy = true;
|
myBusy = true;
|
||||||
|
|
||||||
@ -701,10 +708,16 @@ void GroupGUI_GroupDlg::highlightSubShapes()
|
|||||||
if ( myIdList->isSelected( ii ) )
|
if ( myIdList->isSelected( ii ) )
|
||||||
anIds.Add( myIdList->item( ii )->text().toInt() );
|
anIds.Add( myIdList->item( ii )->text().toInt() );
|
||||||
|
|
||||||
LightApp_SelectionMgr* aSelMgr =
|
SalomeApp_Application* app = myGeomGUI->getApp();
|
||||||
((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr();
|
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
||||||
aSelMgr->clearSelected();
|
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;
|
myBusy = false;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user