From 5b84fb5954b885015448224713b1cf0e4b5137d5 Mon Sep 17 00:00:00 2001 From: mpv Date: Tue, 13 Nov 2018 13:39:03 +0300 Subject: [PATCH] Fix for the Rubick model placement --- src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp | 3 ++- src/Selector/Selector_Selector.cpp | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp index b17d97413..afe020112 100755 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp @@ -258,7 +258,8 @@ bool ModuleBase_WidgetMultiSelector::restoreValueCustom() myIsFirst = false; } } - myGeomCheck->setChecked(aSelectionListAttr->isGeometricalSelection()); + if (myGeomCheck) + myGeomCheck->setChecked(aSelectionListAttr->isGeometricalSelection()); updateSelectionList(); return true; } diff --git a/src/Selector/Selector_Selector.cpp b/src/Selector/Selector_Selector.cpp index 140294004..0a5c87ac3 100644 --- a/src/Selector/Selector_Selector.cpp +++ b/src/Selector/Selector_Selector.cpp @@ -269,6 +269,7 @@ static const TopoDS_Shape findNeighbor(const TopoDS_Shape theContext, TopoDS_Compound aResultCompound; // in case of geometrical name and many candidates // iterate all matches to find by other (higher level) neighbors the best candidate TopoDS_Shape aGoodCandidate; + TopTools_MapOfShape aGoodCandidates; // already added good candidates to the map for(TopoDS_ListOfShape::Iterator aCandidate(aMatches); aCandidate.More(); aCandidate.Next()) { bool aValidCadidate = true; for(int aLevel = aMinLevel + 1; true; aLevel++) { @@ -285,6 +286,8 @@ static const TopoDS_Shape findNeighbor(const TopoDS_Shape theContext, aGoodCandidate = aCandidate.Value(); } else { // another good candidate if (theGeometrical && sameGeometry(aGoodCandidate, aCandidate.Value())) { + if (!aGoodCandidates.Add(aCandidate.Value())) + break; static TopoDS_Builder aBuilder; if (aResultCompound.IsNull()) { aBuilder.MakeCompound(aResultCompound); -- 2.39.2