X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_Selection.cpp;h=079c30cba599938890356ce430a0cb9d2c1727d2;hb=220bd2b37119be1c65abf88a88792445cb9d99f8;hp=1b6f86542f9b2dfa79f6576a6741846e1a61b0df;hpb=24f9658d6e124a268c6a3abcf24f07aa2dc6d268;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_Selection.cpp b/src/XGUI/XGUI_Selection.cpp index 1b6f86542..079c30cba 100644 --- a/src/XGUI/XGUI_Selection.cpp +++ b/src/XGUI/XGUI_Selection.cpp @@ -10,7 +10,10 @@ #include "XGUI_ViewerProxy.h" #include "XGUI_ObjectsBrowser.h" +#include "ModuleBase_ResultPrs.h" + #include +#include #include #include @@ -166,6 +169,26 @@ void XGUI_Selection::fillPresentation(ModuleBase_ViewerPrs& thePrs, XGUI_Displayer* aDisplayer = myWorkshop->displayer(); ObjectPtr aFeature = aDisplayer->getObject(anIO); + + Handle(ModuleBase_BRepOwner) aCompSolidBRO = Handle(ModuleBase_BRepOwner)::DownCast(theOwner); + if (!aCompSolidBRO.IsNull()) { + // If ModuleBase_BRepOwner object is created then it means that TopAbs_COMPSOLID selection mode + // is On and we have to use parent result which corresponds to the CompSolid shape + ResultPtr aResult = std::dynamic_pointer_cast(aFeature); + if (aResult.get()) { + ResultCompSolidPtr aCompSolid = ModelAPI_Tools::compSolidOwner(aResult); + if (aCompSolid.get()) { + GeomShapePtr aShapePtr = aCompSolid->shape(); + if (aShapePtr.get()) { + TopoDS_Shape aShape = aShapePtr->impl(); + if (aShape.IsEqual(thePrs.shape())) { + thePrs.setObject(aCompSolid); + return; + } + } + } + } + } thePrs.setObject(aFeature); }