From: mpv Date: Tue, 13 Nov 2018 10:39:03 +0000 (+0300) Subject: Fix for the Rubick model placement X-Git-Tag: End2018~179 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6bd87b8370434bb97482f47650d538e77e07c6da;p=modules%2Fshaper.git Fix for the Rubick model placement --- 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);