From 4f154d399366abb41efa6517997b4d42bfdd9d74 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 4 Jun 2012 22:58:37 +0200 Subject: [PATCH] 0000727: Keep faces colors on boolean operations --- src/Mod/Part/App/modelRefine.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/Mod/Part/App/modelRefine.cpp b/src/Mod/Part/App/modelRefine.cpp index 516cf0551..25bb9378a 100644 --- a/src/Mod/Part/App/modelRefine.cpp +++ b/src/Mod/Part/App/modelRefine.cpp @@ -617,6 +617,15 @@ bool FaceUniter::process() sew.Add(*sewIt); sew.Perform(); workShell = TopoDS::Shell(sew.SewedShape()); + // update the list of modifications + for (std::vector::iterator it = modifiedShapes.begin(); it != modifiedShapes.end(); ++it) + { + if (sew.IsModified(it->second)) + { + it->second = sew.Modified(it->second); + break; + } + } } else { @@ -638,13 +647,25 @@ bool FaceUniter::process() faceFixer.Perform(); } workShell = TopoDS::Shell(edgeFuse.Shape()); + // update the list of modifications + TopTools_DataMapOfShapeShape faceMap; + edgeFuse.Faces(faceMap); + for (std::vector::iterator it = modifiedShapes.begin(); it != modifiedShapes.end(); ++it) + { + if (faceMap.IsBound(it->second)) + { + const TopoDS_Shape& value = faceMap.Find(it->second); + if (!value.IsSame(it->second)) + it->second = value; + } + } } return true; } ///////////////////////////////////////////////////////////////////////////////////////////////////////// -//TODO: Implement a way to log all modifications +//BRepBuilderAPI_RefineModel implement a way to log all modifications on the faces Part::BRepBuilderAPI_RefineModel::BRepBuilderAPI_RefineModel(const TopoDS_Shape& shape) {