+
+ 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<ModelAPI_Result>(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<TopoDS_Shape>();
+ if (aShape.IsEqual(thePrs.shape())) {
+ thePrs.setObject(aCompSolid);
+ return;
+ }
+ }
+ }
+ }
+ }