1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-06-30 12:14:08 +03:00

0025664: Visualization - dynamic highlighting should not be discarded on re-displaying independent object

Clear list of immediate presentations in proper place - in AIS_LocalContext::manageDetected()
instead of AIS_LocalContext::Unhilight().
This commit is contained in:
kgv 2015-01-13 10:48:04 +03:00 committed by vsv
parent e168ba53aa
commit 147dfa6daa

View File

@ -153,6 +153,7 @@ AIS_StatusOfDetection AIS_LocalContext::MoveTo (const Standard_Integer theXpix,
{ {
if (mylastindex != 0 && mylastindex <= myMapOfOwner.Extent()) if (mylastindex != 0 && mylastindex <= myMapOfOwner.Extent())
{ {
myMainPM->ClearImmediateDraw();
Unhilight (myMapOfOwner (mylastindex), theView); Unhilight (myMapOfOwner (mylastindex), theView);
if (theToRedrawImmediate) if (theToRedrawImmediate)
{ {
@ -376,6 +377,7 @@ AIS_StatusOfPick AIS_LocalContext::ShiftSelect (const Standard_Boolean toUpdateV
if(myAutoHilight) if(myAutoHilight)
{ {
myMainPM->ClearImmediateDraw();
const Handle(V3d_Viewer)& aViewer = myCTX->CurrentViewer(); const Handle(V3d_Viewer)& aViewer = myCTX->CurrentViewer();
for (aViewer->InitActiveViews(); aViewer->MoreActiveViews(); aViewer->NextActiveViews()) for (aViewer->InitActiveViews(); aViewer->MoreActiveViews(); aViewer->NextActiveViews())
{ {
@ -545,7 +547,6 @@ void AIS_LocalContext::Unhilight (const Handle(SelectMgr_EntityOwner)& theOwner,
return; return;
} }
myMainPM->ClearImmediateDraw();
const Standard_Integer aHilightMode = GetHiMod (Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable())); const Standard_Integer aHilightMode = GetHiMod (Handle(AIS_InteractiveObject)::DownCast (theOwner->Selectable()));
if (IsSelected (theOwner)) if (IsSelected (theOwner))
{ {
@ -1044,6 +1045,10 @@ void AIS_LocalContext::ClearOutdatedSelection (const Handle(AIS_InteractiveObjec
myMapOfOwner.Clear(); myMapOfOwner.Clear();
myMapOfOwner.Assign (anOwnersToKeep); myMapOfOwner.Assign (anOwnersToKeep);
mylastindex = myMapOfOwner.FindIndex (aLastPicked); mylastindex = myMapOfOwner.FindIndex (aLastPicked);
if (!IsValidIndex (mylastindex))
{
myMainPM->ClearImmediateDraw();
}
if (!isAISRemainsDetected) if (!isAISRemainsDetected)
{ {
@ -1197,6 +1202,7 @@ void AIS_LocalContext::manageDetected (const Handle(SelectMgr_EntityOwner)& theP
{ {
if (thePickOwner.IsNull()) if (thePickOwner.IsNull())
{ {
myMainPM->ClearImmediateDraw();
if (theToRedrawImmediate) if (theToRedrawImmediate)
{ {
theView->RedrawImmediate(); theView->RedrawImmediate();
@ -1248,6 +1254,7 @@ void AIS_LocalContext::manageDetected (const Handle(SelectMgr_EntityOwner)& theP
if (aNewIndex != mylastindex if (aNewIndex != mylastindex
|| thePickOwner->IsForcedHilight()) || thePickOwner->IsForcedHilight())
{ {
myMainPM->ClearImmediateDraw();
if (mylastindex != 0 if (mylastindex != 0
&& mylastindex <= myMapOfOwner.Extent()) && mylastindex <= myMapOfOwner.Extent())
{ {
@ -1270,7 +1277,7 @@ void AIS_LocalContext::manageDetected (const Handle(SelectMgr_EntityOwner)& theP
mylastindex = aNewIndex; mylastindex = aNewIndex;
} }
if (mylastindex) if (mylastindex != 0)
{ {
mylastgood = mylastindex; mylastgood = mylastindex;
} }