]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for stator_ermes problem of plane created on 3 points
authormpv <mpv@opencascade.com>
Thu, 1 Nov 2018 07:10:33 +0000 (10:10 +0300)
committermpv <mpv@opencascade.com>
Mon, 19 Nov 2018 08:45:52 +0000 (11:45 +0300)
src/Model/Model_ResultConstruction.cpp

index 8fc24dd9592e97cf3d5b7b4419ba891cd71c04f1..8de3c4165aff45c0b604ab2a3db9d8e0346ae996 100644 (file)
@@ -254,6 +254,15 @@ void Model_ResultConstruction::storeShape(std::shared_ptr<GeomAPI_Shape> theShap
         TNaming_Builder aBuilder(aSubLab);
         aBuilder.Generated(anExp.Current());
         std::string aVertexName = aMyName + "_" + (anIndex == 1 ? "StartVertex" : "EndVertex");
+        // check this name is already used
+        ResultPtr aThisRes;
+        do {
+          static std::string anEmpty;
+          static bool aUnique;
+          aThisRes = aMyDoc->findByName(aVertexName, anEmpty, aUnique);
+          if (aThisRes.get() && aThisRes.get() != this)
+            aVertexName += "x";
+        } while(aThisRes.get() && aThisRes.get() != this);
         TDataStd_Name::Set(aSubLab, aVertexName.c_str());
         aMyDoc->addNamingName(aSubLab, aVertexName);
       }