From: vsv Date: Thu, 17 Dec 2015 15:22:34 +0000 (+0300) Subject: Correction of selection for Comp Solids X-Git-Tag: V_2.1.0~148 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=37ea2eb66476cb1129decf1146cf07902da6a63f;p=modules%2Fshaper.git Correction of selection for Comp Solids --- 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); + } + } } }