]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
bos #19090: Problem of selection
authorvsv <vsv@opencascade.com>
Thu, 28 May 2020 16:41:55 +0000 (19:41 +0300)
committervsv <vsv@opencascade.com>
Thu, 28 May 2020 16:41:55 +0000 (19:41 +0300)
src/XGUI/XGUI_Displayer.cpp

index e9d1f320d96d171a4960a69f44e6d7c99441d151..b725a76ca903c45fa0413313cdcbbb2ef7874dd8 100644 (file)
@@ -1115,6 +1115,13 @@ void XGUI_Displayer::AddOrRemoveSelectedShapes(Handle(AIS_InteractiveContext) th
     Handle(StdSelect_BRepOwner) BROwnr = Handle(StdSelect_BRepOwner)::DownCast(anOwner);
     if (!BROwnr.IsNull() && BROwnr->HasShape()) {
       const TopoDS_Shape& aShape = BROwnr->Shape();
+
+      Handle(ModuleBase_ResultPrs) aResPrs = Handle(ModuleBase_ResultPrs)::DownCast(BROwnr->Selectable());
+      TopoDS_Shape aRealShape;
+      if (!aResPrs.IsNull()) {
+        aRealShape = aResPrs->originalShape();
+      }
+
       if (aShape.IsNull())
         continue;
 
@@ -1131,7 +1138,15 @@ void XGUI_Displayer::AddOrRemoveSelectedShapes(Handle(AIS_InteractiveContext) th
           // isSame should be used here as it does not check orientation of shapes
           // despite on isEqual of shapes or IsBound for shape in QMap. Orientation is
           // different for Edges shapes in model shape and owner even if this is the same shape
-        if (ModuleBase_Tools::isSameShape(aParameterShape, aShape)) {
+        bool isSame = ModuleBase_Tools::isSameShape(aParameterShape, aShape);
+        if (!isSame) {
+          // In case of using HideFaces panel we can have instead of an original shape
+          // a compaund of faces which represent original shape with hidden faces.
+          // So, we have to compare the parameter with original shape
+          if (!aRealShape.IsNull())
+            isSame = ModuleBase_Tools::isSameShape(aParameterShape, aRealShape);
+        }
+        if (isSame) {
           Handle(AIS_InteractiveObject) anOwnerPresentation =
             Handle(AIS_InteractiveObject)::DownCast(anOwner->Selectable());
           NCollection_Map<Handle(AIS_InteractiveObject)> aPresentations =