From: nds Date: Wed, 12 Feb 2020 22:55:17 +0000 (+0300) Subject: 0030784: Visualization - check if selectable of owner in internal container in AIS_In... X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=f780c4bb50ff3ba4292f78e73a651b6e40455d60;p=occt-copy.git 0030784: Visualization - check if selectable of owner in internal container in AIS_InteractiveContext before using (cherry picked from commit 707e554dba56681d110b164cb4ea8b47723e7007) # Conflicts: # src/AIS/AIS_InteractiveContext_1.cxx --- diff --git a/src/AIS/AIS_InteractiveContext_1.cxx b/src/AIS/AIS_InteractiveContext_1.cxx index 5b73bb26c2..f448ece0b7 100644 --- a/src/AIS/AIS_InteractiveContext_1.cxx +++ b/src/AIS/AIS_InteractiveContext_1.cxx @@ -123,7 +123,12 @@ void AIS_InteractiveContext::highlightGlobal (const Handle(AIS_InteractiveObject return; } - const Standard_Integer aHiMode = getHilightMode (theObj, theStyle, theDispMode); + Handle(AIS_GlobalStatus)* aStatusPtr = myObjects.ChangeSeek (theObj); + if (!aStatusPtr) + { + return; + } + const Standard_Integer aHiMode = getHilightMode (theObj, theStyle, (*aStatusPtr)->DisplayMode()); const Handle(SelectMgr_EntityOwner)& aGlobOwner = theObj->GlobalSelOwner(); if (aGlobOwner.IsNull()) @@ -194,7 +199,7 @@ void AIS_InteractiveContext::unhighlightOwners (const AIS_NListOfEntityOwner& th { anObjToClear.Add (anInteractive); } - if (anOwner == anInteractive->GlobalSelOwner()) + if (aStatusPtr && anOwner == anInteractive->GlobalSelOwner()) { (*aStatusPtr)->SetHilightStatus (Standard_False); } @@ -575,7 +580,16 @@ AIS_StatusOfPick AIS_InteractiveContext::Select (const AIS_SelectionScheme theSe }*/ AIS_NListOfEntityOwner aPickedOwners; - aPickedOwners.Append (myLastPicked); + if (!myLastPicked.IsNull() && + myLastPicked->HasSelectable()) + { + Handle(AIS_InteractiveObject) anIO = Handle(AIS_InteractiveObject)::DownCast(myLastPicked->Selectable()); + if (!anIO.IsNull() && + myObjects.IsBound(anIO)) + { + aPickedOwners.Append (myLastPicked); + } + } return Select (aPickedOwners, theSelScheme); }