From: Sergey Solomin Date: Tue, 13 Sep 2016 08:07:03 +0000 (+0300) Subject: 0027867: Visualization - AIS_InteractiveContext::HasSelectedShape() returns true... X-Git-Tag: V7_1_0_beta~135 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=4aaadad7bc42bac0f180f6f9540bc82540e3aff9;p=occt-copy.git 0027867: Visualization - AIS_InteractiveContext::HasSelectedShape() returns true if selected interactive is instance of AIS_Shape only --- diff --git a/src/AIS/AIS_InteractiveContext_1.cxx b/src/AIS/AIS_InteractiveContext_1.cxx index 56d77b7510..7eeeff4193 100644 --- a/src/AIS/AIS_InteractiveContext_1.cxx +++ b/src/AIS/AIS_InteractiveContext_1.cxx @@ -1200,9 +1200,13 @@ Standard_Boolean AIS_InteractiveContext::HasSelectedShape() const { return myLocalContexts(myCurLocalIndex)->HasSelectedShape(); } + if (!mySelection->More()) + return Standard_False; + + const Handle(StdSelect_BRepOwner) anOwner = + Handle(StdSelect_BRepOwner)::DownCast (mySelection->Value()); - Handle(AIS_Shape) aShape = Handle(AIS_Shape)::DownCast (SelectedInteractive()); - return !aShape.IsNull(); + return !anOwner.IsNull() && anOwner->HasShape(); } //=======================================================================