From a5ad424ba37fe8bff038d78ab19bda11efd08fc9 Mon Sep 17 00:00:00 2001 From: dbv Date: Tue, 27 Dec 2016 14:06:21 +0300 Subject: [PATCH] Issue #1920: Wrong naming of faces' edges after translation Fixed history of edges in BuildPlugin_Face. --- src/BuildPlugin/BuildPlugin_Face.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/BuildPlugin/BuildPlugin_Face.cpp b/src/BuildPlugin/BuildPlugin_Face.cpp index 774cfdf39..c03dd6182 100644 --- a/src/BuildPlugin/BuildPlugin_Face.cpp +++ b/src/BuildPlugin/BuildPlugin_Face.cpp @@ -16,6 +16,7 @@ #include #include +#include //================================================================================================= BuildPlugin_Face::BuildPlugin_Face() @@ -103,21 +104,16 @@ void BuildPlugin_Face::execute() for(ListOfShape::const_iterator anIt = aFaces.cbegin(); anIt != aFaces.cend(); ++anIt) { ResultBodyPtr aResultBody = document()->createBody(data(), anIndex); GeomShapePtr aShape = *anIt; + GeomAlgoAPI_Copy aCopy(aShape); + aShape = aCopy.shape(); aResultBody->store(aShape); + // Store edges. int anEdgeIndex = 1; - for(GeomAPI_ShapeExplorer anExp(aShape, GeomAPI_Shape::EDGE); anExp.more(); anExp.next()) { - GeomShapePtr anEdgeInResult = anExp.current(); - for(ListOfShape::const_iterator anIt = anEdges.cbegin(); anIt != anEdges.cend(); ++anIt) { - std::shared_ptr anEdgeInList(new GeomAPI_Edge(*anIt)); - if(anEdgeInList->isEqual(anEdgeInResult)) { - aResultBody->modified(anEdgeInList, anEdgeInResult, - "Edge_" + std::to_string((long long)anEdgeIndex), anEdgeIndex); - ++anEdgeIndex; - break; - } - } + GeomShapePtr anEdge = anExp.current(); + aResultBody->generated(anEdge, "Edge_" + std::to_string((long long)anEdgeIndex), anEdgeIndex); + ++anEdgeIndex; } setResult(aResultBody, anIndex); -- 2.39.2