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
9a422453df
commit
942885daf4
@ -333,8 +333,10 @@ void GEOMGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList )
|
|||||||
ic->AddOrRemoveSelected( Handle(AIS_InteractiveObject)::DownCast(owner->Selectable()), false );
|
ic->AddOrRemoveSelected( Handle(AIS_InteractiveObject)::DownCast(owner->Selectable()), false );
|
||||||
}
|
}
|
||||||
ic->SetAutomaticHilight(isAutoHilight); //Bug 17269: restore mode
|
ic->SetAutomaticHilight(isAutoHilight); //Bug 17269: restore mode
|
||||||
ic->HilightSelected(/*updateviewer*/Standard_True);
|
if (n < 3000)
|
||||||
//vw->update();
|
ic->HilightSelected(/*updateviewer*/Standard_True);
|
||||||
|
else
|
||||||
|
vw->update();
|
||||||
|
|
||||||
// fill extra selected
|
// fill extra selected
|
||||||
mySelectedExternals.clear();
|
mySelectedExternals.clear();
|
||||||
|
@ -313,14 +313,16 @@ void GroupGUI_GroupDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
TColStd_IndexedMapOfInteger aMapIndex;
|
TColStd_IndexedMapOfInteger aMapIndex;
|
||||||
|
|
||||||
if ( IObjectCount() == 1 ) {
|
SALOME_ListIO aSelIOs;
|
||||||
Standard_Boolean aResult = Standard_False;
|
SalomeApp_Application* app = myGeomGUI->getApp();
|
||||||
GEOM::GEOM_Object_var anObj =
|
if (app) {
|
||||||
GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
|
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
||||||
|
if (aSelMgr) {
|
||||||
if ( aResult && !anObj->_is_nil() )
|
QMap<QString, TColStd_IndexedMapOfInteger> aMap;
|
||||||
((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->
|
aSelMgr->selectedSubOwners(aMap);
|
||||||
selectionMgr()->GetIndexes( firstIObject(), aMapIndex );
|
if (aMap.size() == 1)
|
||||||
|
aMapIndex = aMap.begin().data();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// try to find out and process the object browser selection
|
// try to find out and process the object browser selection
|
||||||
@ -438,14 +440,16 @@ void GroupGUI_GroupDlg::add()
|
|||||||
|
|
||||||
TColStd_IndexedMapOfInteger aMapIndex;
|
TColStd_IndexedMapOfInteger aMapIndex;
|
||||||
|
|
||||||
if ( IObjectCount() == 1 ) {
|
SALOME_ListIO aSelIOs;
|
||||||
Standard_Boolean aResult = Standard_False;
|
SalomeApp_Application* app = myGeomGUI->getApp();
|
||||||
GEOM::GEOM_Object_var anObj =
|
if (app) {
|
||||||
GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
|
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
||||||
|
if (aSelMgr) {
|
||||||
if ( aResult && !anObj->_is_nil() )
|
QMap<QString, TColStd_IndexedMapOfInteger> aMap;
|
||||||
((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->
|
aSelMgr->selectedSubOwners(aMap);
|
||||||
selectionMgr()->GetIndexes( firstIObject(), aMapIndex );
|
if (aMap.size() == 1)
|
||||||
|
aMapIndex = aMap.begin().data();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// try to find out and process the object browser selection
|
// try to find out and process the object browser selection
|
||||||
@ -595,20 +599,7 @@ void GroupGUI_GroupDlg::updateState()
|
|||||||
if (app) {
|
if (app) {
|
||||||
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
||||||
if (aSelMgr) {
|
if (aSelMgr) {
|
||||||
/*
|
|
||||||
aSelMgr->selectedObjects(aSelIOs);
|
|
||||||
|
|
||||||
if ( aSelIOs.Extent() == 1 ) {
|
|
||||||
Standard_Boolean aResult = Standard_False;
|
|
||||||
GEOM::GEOM_Object_var anObj =
|
|
||||||
GEOMBase::ConvertIOinGEOMObject( aSelIOs.First(), aResult );
|
|
||||||
|
|
||||||
if ( aResult && !anObj->_is_nil() )
|
|
||||||
aSelMgr->GetIndexes( aSelIOs.First(), aMapIndex );
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
QMap<QString, TColStd_IndexedMapOfInteger> aMap;
|
QMap<QString, TColStd_IndexedMapOfInteger> aMap;
|
||||||
//MapEntryOfMapOfInteger& aMap;
|
|
||||||
aSelMgr->selectedSubOwners(aMap);
|
aSelMgr->selectedSubOwners(aMap);
|
||||||
if (aMap.size() == 1)
|
if (aMap.size() == 1)
|
||||||
aMapIndex = aMap.begin().data();
|
aMapIndex = aMap.begin().data();
|
||||||
@ -710,18 +701,27 @@ void GroupGUI_GroupDlg::highlightSubShapes()
|
|||||||
|
|
||||||
myBusy = true;
|
myBusy = true;
|
||||||
|
|
||||||
for ( int ii = 0, nn = myIdList->count(); ii < nn; ii++ )
|
int ii = 0, nn = myIdList->count();
|
||||||
|
for ( ; ii < nn; ii++ )
|
||||||
if ( myIdList->isSelected( ii ) )
|
if ( myIdList->isSelected( ii ) )
|
||||||
anIds.Add( myIdList->item( ii )->text().toInt() );
|
anIds.Add( myIdList->item( ii )->text().toInt() );
|
||||||
|
|
||||||
SalomeApp_Application* app = myGeomGUI->getApp();
|
SalomeApp_Application* app = myGeomGUI->getApp();
|
||||||
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
||||||
aSelMgr->clearSelected();
|
aSelMgr->clearSelected();
|
||||||
|
//if (nn < 3000) aSelMgr->AddOrRemoveIndex(aSh->getIO(), anIds, false);
|
||||||
aSelMgr->AddOrRemoveIndex(aSh->getIO(), anIds, false);
|
aSelMgr->AddOrRemoveIndex(aSh->getIO(), anIds, false);
|
||||||
|
|
||||||
myBusy = false;
|
myBusy = false;
|
||||||
|
|
||||||
updateState();
|
//updateState();
|
||||||
|
if (nn < 3000) {
|
||||||
|
updateState();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
myAddBtn->setEnabled( true );
|
||||||
|
myRemBtn->setEnabled( true );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
|
Loading…
x
Reference in New Issue
Block a user