mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0027523: Visualization - selection owner contains obsolete shape
- remove check for selection activation in SelectMgr_SelectionManager::RecomputeSelection; - given selection mode is now handled properly and single selection mode can be recomputed; - test case for issue #27523. Small correction of test case for issue CR27523
This commit is contained in:
@@ -648,6 +648,28 @@ void SelectMgr_SelectionManager::rebuildSelectionStructures (const Handle(Select
|
||||
}
|
||||
}
|
||||
|
||||
//==================================================
|
||||
// Function: recomputeSelectionMode
|
||||
// Purpose :
|
||||
//==================================================
|
||||
void SelectMgr_SelectionManager::recomputeSelectionMode (const Handle(SelectMgr_SelectableObject)& theObject,
|
||||
const Handle(SelectMgr_Selection)& theSelection,
|
||||
const Standard_Integer theMode)
|
||||
{
|
||||
theSelection->UpdateStatus (SelectMgr_TOU_Full);
|
||||
|
||||
for (TColStd_MapIteratorOfMapOfTransient aSelectorIter (mySelectors); aSelectorIter.More(); aSelectorIter.Next())
|
||||
{
|
||||
Handle(SelectMgr_ViewerSelector) aCurSelector = Handle(SelectMgr_ViewerSelector)::DownCast (aSelectorIter.Key());
|
||||
|
||||
ClearSelectionStructures (theObject, theMode, aCurSelector);
|
||||
theObject->RecomputePrimitives (theMode);
|
||||
RestoreSelectionStructures (theObject, theMode, aCurSelector);
|
||||
theSelection->UpdateStatus (SelectMgr_TOU_None);
|
||||
theSelection->UpdateBVHStatus (SelectMgr_TBU_None);
|
||||
}
|
||||
}
|
||||
|
||||
//==================================================
|
||||
// Function: Update
|
||||
// Purpose :
|
||||
@@ -686,25 +708,23 @@ void SelectMgr_SelectionManager::RecomputeSelection (const Handle(SelectMgr_Sele
|
||||
if (!(myGlobal.Contains (theObject) || myLocal.IsBound (theObject)))
|
||||
return;
|
||||
|
||||
for(theObject->Init(); theObject->More(); theObject->Next())
|
||||
if (theMode == -1)
|
||||
{
|
||||
const Handle(SelectMgr_Selection)& aSelection = theObject->CurrentSelection();
|
||||
aSelection->UpdateStatus (SelectMgr_TOU_Full);
|
||||
Standard_Integer aSelMode = aSelection->Mode();
|
||||
|
||||
for (TColStd_MapIteratorOfMapOfTransient aSelectorIter (mySelectors); aSelectorIter.More(); aSelectorIter.Next())
|
||||
for (theObject->Init(); theObject->More(); theObject->Next())
|
||||
{
|
||||
Handle(SelectMgr_ViewerSelector) aCurSelector (Handle(SelectMgr_ViewerSelector)::DownCast (aSelectorIter.Key()));
|
||||
if (aCurSelector->Status (aSelection) == SelectMgr_SOS_Activated)
|
||||
{
|
||||
ClearSelectionStructures (theObject, aSelMode, aCurSelector);
|
||||
theObject->RecomputePrimitives(aSelMode);
|
||||
RestoreSelectionStructures (theObject, aSelMode, aCurSelector);
|
||||
aSelection->UpdateStatus (SelectMgr_TOU_None);
|
||||
aSelection->UpdateBVHStatus (SelectMgr_TBU_None);
|
||||
}
|
||||
const Handle(SelectMgr_Selection)& aSelection = theObject->CurrentSelection();
|
||||
Standard_Integer aSelMode = aSelection->Mode();
|
||||
recomputeSelectionMode (theObject, aSelection, aSelMode);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!theObject->HasSelection (theMode))
|
||||
return;
|
||||
|
||||
const Handle(SelectMgr_Selection)& aSelection = theObject->Selection (theMode);
|
||||
recomputeSelectionMode (theObject, aSelection, theMode);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -129,7 +129,10 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Recomputes given selection mode and updates BVHs in all viewer selectors
|
||||
Standard_EXPORT void recomputeSelectionMode (const Handle(SelectMgr_SelectableObject)& theObject,
|
||||
const Handle(SelectMgr_Selection)& theSelection,
|
||||
const Standard_Integer theMode);
|
||||
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user