From 37ea2eb66476cb1129decf1146cf07902da6a63f Mon Sep 17 00:00:00 2001 From: vsv Date: Thu, 17 Dec 2015 18:22:34 +0300 Subject: [PATCH] Correction of selection for Comp Solids --- src/ModuleBase/ModuleBase_ResultPrs.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/ModuleBase/ModuleBase_ResultPrs.cpp b/src/ModuleBase/ModuleBase_ResultPrs.cpp index f7f360422..ed92d8eb3 100755 --- a/src/ModuleBase/ModuleBase_ResultPrs.cpp +++ b/src/ModuleBase/ModuleBase_ResultPrs.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -62,7 +63,7 @@ ModuleBase_ResultPrs::ModuleBase_ResultPrs(ResultPtr theResult) // Activate individual repaintng if this is a part of compsolid ResultCompSolidPtr aCompSolid = ModelAPI_Tools::compSolidOwner(myResult); - SetAutoHilight(aCompSolid.get() == NULL); + //SetAutoHilight(aCompSolid.get() == NULL); } @@ -183,8 +184,8 @@ TopoDS_Shape ModuleBase_ResultPrs::getSelectionShape() const void ModuleBase_ResultPrs::HilightSelected(const Handle(PrsMgr_PresentationManager3d)& thePM, const SelectMgr_SequenceOfOwner& theOwners) { - TopoDS_Shape aShape = getSelectionShape(); - if (!aShape.IsNull()) { + if (hasCompSolidSelectionMode()) { + TopoDS_Shape aShape = getSelectionShape(); Handle( Prs3d_Presentation ) aSelectionPrs = GetSelectPresentation( thePM ); aSelectionPrs->Clear(); @@ -194,6 +195,15 @@ void ModuleBase_ResultPrs::HilightSelected(const Handle(PrsMgr_PresentationManag aSelectionPrs->Highlight(Aspect_TOHM_COLOR, aSelectionPrs->HighlightColor()); aSelectionPrs->Display(); thePM->Highlight(this); + } else { + Handle(SelectMgr_EntityOwner) anOwner; + for (int i = 1; i <= theOwners.Length(); i++) { + anOwner = theOwners.Value(i); + if (!anOwner->IsSelected()) { // anOwner is not selected + anOwner->SetSelected(true); + AIS_Selection::Select(anOwner); + } + } } } -- 2.39.2