X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_AttributeSelection.cpp;h=9133794ae94460375cf53c75b966de982345e221;hb=223db274e2083c0289eb8d8043344ae421e524a8;hp=64cac941dc5820cb461ce53e434431ecbcc67894;hpb=5d27391a70a0ffff95f70d048747a01d3ebf663d;p=modules%2Fshaper.git diff --git a/src/Model/Model_AttributeSelection.cpp b/src/Model/Model_AttributeSelection.cpp index 64cac941d..9133794ae 100644 --- a/src/Model/Model_AttributeSelection.cpp +++ b/src/Model/Model_AttributeSelection.cpp @@ -85,7 +85,15 @@ void Model_AttributeSelection::setValue(const ResultPtr& theContext, TDF_Label aSelLab = selectionLabel(); aSelLab.ForgetAttribute(kSIMPLE_REF_ID); aSelLab.ForgetAttribute(kCONSTUCTION_SIMPLE_REF_ID); - if (!theContext.get()) { + + bool isDegeneratedEdge = false; + // do not use the degenerated edge as a shape, a null context and shape is used in the case + if (theSubShape.get() && !theSubShape->isNull() && theSubShape->isEdge()) { + const TopoDS_Shape& aSubShape = theSubShape->impl(); + if (aSubShape.ShapeType() == TopAbs_EDGE) + isDegeneratedEdge = BRep_Tool::Degenerated(TopoDS::Edge(aSubShape)); + } + if (!theContext.get() || isDegeneratedEdge) { // to keep the reference attribute label TDF_Label aRefLab = myRef.myRef->Label(); aSelLab.ForgetAllAttributes(true);