]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/XGUI/XGUI_Selection.cpp
Salome HOME
Issue #2913: Make selectable original shape instead of substituting compound
[modules/shaper.git] / src / XGUI / XGUI_Selection.cpp
index 9e29e8b1b08bf729dd70ae701143b374d9bef318..09c0c1fcdeac0fed5c74afe8cb119373bcfc30a4 100644 (file)
@@ -205,9 +205,17 @@ void XGUI_Selection::fillPresentation(ModuleBase_ViewerPrsPtr& thePrs,
   // for one feature
   Handle(StdSelect_BRepOwner) aBRO = Handle(StdSelect_BRepOwner)::DownCast(theOwner);
   if( !aBRO.IsNull() && aBRO->HasShape() ) {
+    TopoDS_Shape aShape = aBRO->Shape();
+    Handle(ModuleBase_ResultPrs) aPrsObj = Handle(ModuleBase_ResultPrs)::DownCast(aBRO->Selectable());
+    if (!aPrsObj.IsNull()) {
+      if (aPrsObj->isSubstituted()) {
+        if (aPrsObj->Shape().IsSame(aShape))
+          aShape = aPrsObj->originalShape();
+      }
+    }
     // the located method is called in the context to obtain the shape by the SelectedShape()
     // method, so the shape is located by the same rules
-    TopoDS_Shape aShape = aBRO->Shape().Located (aBRO->Location() * aBRO->Shape().Location());
+    aShape = aShape.Located(aBRO->Location() * aShape.Location());
 #ifdef BEFORE_TRIHEDRON_PATCH
 #ifndef DEBUG_DELIVERY
     if (aShape.IsNull())