From c718dcd8bb6878379c16412d461d9ba41c7dcd22 Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 25 Mar 2015 12:32:35 +0300 Subject: [PATCH] Union of validator and filter functionalities. Checking for edge is degenerated is performed inside attribute selection. Filters are not used anymore, but validators could not check the degenerated shape state because the attribute selection returns a compound shape for a degenerative edge set. --- src/Model/Model_AttributeSelection.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Model/Model_AttributeSelection.cpp b/src/Model/Model_AttributeSelection.cpp index 4e1f21b91..0e643036f 100644 --- a/src/Model/Model_AttributeSelection.cpp +++ b/src/Model/Model_AttributeSelection.cpp @@ -86,7 +86,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); -- 2.39.2