Salome HOME
Recalculate DoF when removing feature without constraints (issue #1456)
[modules/shaper.git] / src / Model / Model_AttributeSelection.cpp
index 6462c7b8489c8009ca151f2f5cbc5f598fe26bdd..be028e276f5cab1909cd0c0bdd9840588e7e1a4f 100644 (file)
@@ -181,11 +181,16 @@ void Model_AttributeSelection::setValue(const ResultPtr& theContext,
 
 std::shared_ptr<GeomAPI_Shape> Model_AttributeSelection::value()
 {
+  GeomShapePtr aResult;
   if (myTmpContext.get() || myTmpSubShape.get()) {
+    ResultConstructionPtr aResulConstruction = std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(myTmpContext);
+    if(aResulConstruction.get()) {
+      // it is just reference to construction.
+      return myTmpSubShape;
+    }
     return myTmpSubShape.get() ? myTmpSubShape : myTmpContext->shape();
   }
 
-  std::shared_ptr<GeomAPI_Shape> aResult;
   TDF_Label aSelLab = selectionLabel();
   if (aSelLab.IsAttribute(kINVALID_SELECTION))
     return aResult;
@@ -475,7 +480,7 @@ bool Model_AttributeSelection::update()
       }
 
       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 this is a wire with plane defined then it is a sketch-like object
         if (!aConstructionContext->facesNum()) // no faces, update can not work correctly
           return setInvalidIfFalse(aSelLab, false);
         // if there is no edges indexes, any face can be used: take the first