]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for the Rubick model placement
authormpv <mpv@opencascade.com>
Tue, 13 Nov 2018 10:39:03 +0000 (13:39 +0300)
committermpv <mpv@opencascade.com>
Mon, 19 Nov 2018 08:45:52 +0000 (11:45 +0300)
src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp
src/Selector/Selector_Selector.cpp

index b17d97413b321aafc59d465afe27464f514f355d..afe02011207e204d86fdf19b73a03c4e911a6f2e 100755 (executable)
@@ -258,7 +258,8 @@ bool ModuleBase_WidgetMultiSelector::restoreValueCustom()
       myIsFirst = false;
     }
   }
-  myGeomCheck->setChecked(aSelectionListAttr->isGeometricalSelection());
+  if (myGeomCheck)
+    myGeomCheck->setChecked(aSelectionListAttr->isGeometricalSelection());
   updateSelectionList();
   return true;
 }
index 140294004a7058bb65c2ab028dc533b1144b6328..0a5c87ac3b7cfb38d3a4f9cfe960e33b647c1211 100644 (file)
@@ -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);