]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Make wires selection on sketch result updated correctly
authormpv <mpv@opencascade.com>
Fri, 25 Mar 2016 14:02:32 +0000 (17:02 +0300)
committerdbv <dbv@opencascade.com>
Wed, 6 Apr 2016 10:24:34 +0000 (13:24 +0300)
src/Model/Model_AttributeSelection.cpp

index da94a1206428e9e90a3039d00457b778cc6f2dc5..6462c7b8489c8009ca151f2f5cbc5f598fe26bdd 100644 (file)
@@ -474,7 +474,7 @@ bool Model_AttributeSelection::update()
         return setInvalidIfFalse(aSelLab, false);
       }
 
-      if (aShapeType == TopAbs_FACE) { // compound is for the whole sketch selection
+      if (aShapeType == TopAbs_FACE || aShapeType == TopAbs_WIRE) { // compound is for the whole sketch selection
         // If this is a wire with plane defined thin it is a sketch-like object
         if (!aConstructionContext->facesNum()) // no faces, update can not work correctly
           return setInvalidIfFalse(aSelLab, false);
@@ -552,6 +552,13 @@ bool Model_AttributeSelection::update()
           }
         }
         if (aNewSelected) { // store this new selection
+          if (aShapeType == TopAbs_WIRE) { // just get a wire from face to have wire
+            TopExp_Explorer aWireExp(aNewSelected->impl<TopoDS_Shape>(), TopAbs_WIRE);
+            if (aWireExp.More()) {
+              aNewSelected.reset(new GeomAPI_Shape);
+              aNewSelected->setImpl<TopoDS_Shape>(new TopoDS_Shape(aWireExp.Current()));
+            }
+          }
           selectConstruction(aContext, aNewSelected);
           owner()->data()->sendAttributeUpdated(this);
           return setInvalidIfFalse(aSelLab, true);