0025664: Visualization - dynamic highlighting should not be discarded on re-displayin...
authorkgv <kgv@opencascade.com>
Tue, 13 Jan 2015 07:48:04 +0000 (10:48 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 15 Jan 2015 12:18:08 +0000 (15:18 +0300)
Clear list of immediate presentations in proper place - in AIS_LocalContext::manageDetected()
instead of AIS_LocalContext::Unhilight().

src/AIS/AIS_LocalContext_1.cxx

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