Salome HOME
Fixes for the issue #2375 model with dump/import script
[modules/shaper.git] / src / Selector / Selector_Selector.cpp
index f59226cc92520b3c2279151b4cc996487fb3ff03..d4b1f2319dda33d32486ca82442853d911c44858 100644 (file)
@@ -252,7 +252,7 @@ bool Selector_Selector::select(const TopoDS_Shape theContext, const TopoDS_Shape
   // 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)
   bool aIsFound = TNaming_Tool::HasLabel(myLab, theValue);
-  if (aIsFound) { // additional check for selection and delete evolution only: also could not be used
+  if (aIsFound) { // additional check for selection and delete evolution only: also could not use
     aIsFound = false;
     for(TNaming_SameShapeIterator aShapes(theValue, myLab); aShapes.More(); aShapes.Next())
     {
@@ -477,7 +477,7 @@ bool Selector_Selector::select(const TopoDS_Shape theContext, const TopoDS_Shape
           return false;
 
         // searching by neighbours
-        std::list<std::pair<TopoDS_Shape, int> > aNBs; /// neighbor sub-shape -> level of neighborhood
+        std::list<std::pair<TopoDS_Shape, int> > aNBs;//neighbor sub-shape -> level of neighborhood
         for(int aLevel = 1; true; aLevel++) {
           TopTools_MapOfShape aNewNB;
           findNeighbors(theContext, theValue, aLevel, aNewNB);
@@ -487,7 +487,7 @@ bool Selector_Selector::select(const TopoDS_Shape theContext, const TopoDS_Shape
           // check which can be named correctly, without by neighbors type
           for(TopTools_MapOfShape::Iterator aNBIter(aNewNB); aNBIter.More(); ) {
             Selector_Selector aSelector(myLab.FindChild(1));
-            if (aSelector.select(theContext, aNBIter.Value(), false)) { // add to the list of good NBs
+            if (aSelector.select(theContext, aNBIter.Value(), false)) {// add to list of good NBs
               aNBs.push_back(std::pair<TopoDS_Shape, int>(aNBIter.Value(), aLevel));
             }
             aNewNB.Remove(aNBIter.Key());
@@ -943,8 +943,11 @@ std::string Selector_Selector::name(Selector_NameGenerator* theNameGenerator) {
     std::list<Selector_Selector>::iterator aSubSel = mySubSelList.begin();
     for(; aSubSel != mySubSelList.end(); aSubSel++, aLevel++) {
       aResult += "(" + aSubSel->name(theNameGenerator) + ")";
-      if (*aLevel > 1)
-        aResult += *aLevel;
+      if (*aLevel > 1) {
+        std::ostringstream aLevelStr;
+        aLevelStr<<*aLevel;
+        aResult += aLevelStr.str();
+      }
     }
     return aResult;
   }