From 27cb0900433265b6f49a3c991a0b9262f2d8e706 Mon Sep 17 00:00:00 2001 From: mpv Date: Mon, 22 Oct 2018 14:39:09 +0300 Subject: [PATCH] Debug the sketcher update and projections behavior basin on Test1816 --- src/Model/Model_Document.cpp | 9 +++++++-- src/Selector/Selector_Selector.cpp | 17 ++++++++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index d71b770c7..6fc16f5cf 100755 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -1493,8 +1493,13 @@ bool Model_Document::isLaterByDep(FeaturePtr theThis, FeaturePtr theOther) { if (!aRefFeat.get()) { // take feature of the result aRefFeat = feature(std::dynamic_pointer_cast(aRefObj)); } - if (aRefFeat.get() && aRefFeat == theThis) { - return false; // other references to this, so other later than this + if (aRefFeat.get()) { + if (aRefFeat == theThis) + return false; // other references to this, so other later than this + if (std::dynamic_pointer_cast(aRefFeat)) { + if (!isLaterByDep(theThis, aRefFeat)) // nested composites: recursion + return false; + } } } } diff --git a/src/Selector/Selector_Selector.cpp b/src/Selector/Selector_Selector.cpp index 8036f9d1d..54c8aca55 100644 --- a/src/Selector/Selector_Selector.cpp +++ b/src/Selector/Selector_Selector.cpp @@ -251,7 +251,22 @@ bool Selector_Selector::select(const TopoDS_Shape theContext, const TopoDS_Shape return false; // check the value shape can be named as it is, or it is needed to construct it from the // higher level shapes (like a box vertex by faces that form this vertex) - if (!TNaming_Tool::HasLabel(myLab, theValue)) { + bool aIsFound = TNaming_Tool::HasLabel(myLab, theValue); + if (aIsFound) { // additional check for selection and delete evolution only: also could not be used + aIsFound = false; + for(TNaming_SameShapeIterator aShapes(theValue, myLab); aShapes.More(); aShapes.Next()) + { + Handle(TNaming_NamedShape) aNS; + if (aShapes.Label().FindAttribute(TNaming_NamedShape::GetID(), aNS)) { + if (aNS->Evolution() == TNaming_MODIFY || aNS->Evolution() == TNaming_GENERATED || + aNS->Evolution() == TNaming_PRIMITIVE) { + aIsFound = true; + break; + } + } + } + } + if (!aIsFound) { TopAbs_ShapeEnum aSelectionType = theValue.ShapeType(); myShapeType = aSelectionType; if (aSelectionType == TopAbs_COMPOUND || aSelectionType == TopAbs_COMPSOLID || -- 2.39.2