]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/BuildPlugin/BuildPlugin_Wire.cpp
Salome HOME
Get rid of compilation warnings. Part II. MSVC warnings.
[modules/shaper.git] / src / BuildPlugin / BuildPlugin_Wire.cpp
index c7caa85812a46170e654e5298e309f35a53b494e..124a03abb68051ccad3c3d8ee105f8d2609af01e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2020  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -144,9 +144,9 @@ void BuildPlugin_Wire::execute()
 
     for (ListOfShape::iterator aWIt = aWires.begin(); aWIt != aWires.end(); ++aWIt) {
       ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex);
-      ListOfShape aSketches;
-      aSketches.push_back(anIt->second);
-      aResultBody->storeModified(aSketches, *aWIt, aMakeShapeList);
+      ListOfShape aSketch;
+      aSketch.push_back(anIt->second);
+      aResultBody->storeModified(aSketch, *aWIt, aMakeShapeList);
       aResultBody->loadModifiedShapes(aMakeShapeList, anIt->second, GeomAPI_Shape::EDGE);
       setResult(aResultBody, aResultIndex);
       ++aResultIndex;
@@ -386,11 +386,18 @@ bool buildSketchWires(FeaturePtr theSketchFeature, GeomShapePtr theSketchShape,
         aStartV = aEndV;
       }
       else {
-        // both vertices are found => close the loop
+        // both vertices are found
         aFoundStart->second->push_back(anEdge);
         if (aFoundStart->second != aFoundEnd->second) {
+          // different wires => merge segments
           aFoundStart->second->insert(aFoundStart->second->end(),
               aFoundEnd->second->begin(), aFoundEnd->second->end());
+          for (MapVertexWire::iterator it = aMapVW.begin(); it != aMapVW.end(); ++it)
+            if (it != aFoundEnd && it->second == aFoundEnd->second) {
+              // another boundary of the wire, change link to the whole result
+              it->second = aFoundStart->second;
+              break;
+            }
           aNewWires.erase(aFoundEnd->second);
         }
         aMapVW.erase(aFoundStart);