X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_Chamfer.cpp;h=e482e088fc0ebac79dce57a849abab4591addcb9;hb=06e7f5859095193fc7f498bd89a7d28009794f53;hp=ecba849a963d651c901a41e7e6173b83a969e7a7;hpb=a1232c4299921155bf0ffa5ed4d94681975a6ec5;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Chamfer.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Chamfer.cpp index ecba849a9..e482e088f 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Chamfer.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Chamfer.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2017-2019 CEA/DEN, EDF R&D +// Copyright (C) 2017-2023 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -18,6 +18,7 @@ // #include "GeomAlgoAPI_Chamfer.h" +#include "GeomAlgoAPI_DFLoader.h" #include #include @@ -30,21 +31,21 @@ //================================================================================================= GeomAlgoAPI_Chamfer::GeomAlgoAPI_Chamfer(const GeomShapePtr& theBaseSolid, const ListOfShape& theChamferShapes, - const std::map aMapEdgeFace, + const std::map theMapEdgeFace, const bool performDistances, - const double aVal1, - const double aVal2) + const double theVal1, + const double theVal2) { - build(theBaseSolid, theChamferShapes, aMapEdgeFace, performDistances, aVal1, aVal2); + build(theBaseSolid, theChamferShapes, theMapEdgeFace, performDistances, theVal1, theVal2); } //================================================================================================= void GeomAlgoAPI_Chamfer::build(const GeomShapePtr& theBaseSolid, const ListOfShape& theChamferShapes, - const std::map aMapEdgeFace, + const std::map theMapEdgeFace, const bool performDistances, - const double aVal1, - const double aVal2) + const double theVal1, + const double theVal2) { TopoDS_Shape aShapeBase = theBaseSolid->impl(); TopTools_IndexedDataMapOfShapeListOfShape M; @@ -60,24 +61,24 @@ void GeomAlgoAPI_Chamfer::build(const GeomShapePtr& theBaseSolid, anIt != theChamferShapes.end(); ++anIt) { if ((*anIt)->isEdge()) { TopoDS_Edge E = (*anIt)->impl(); - if (aMapEdgeFace.find(*anIt) != aMapEdgeFace.end()) { - //TopoDS_Face F = (aMapEdgeFace[*anIt])->impl(); - TopoDS_Face F = (aMapEdgeFace.at(*anIt))->impl(); + if (theMapEdgeFace.find(*anIt) != theMapEdgeFace.end()) { + //TopoDS_Face F = (theMapEdgeFace[*anIt])->impl(); + TopoDS_Face F = (theMapEdgeFace.at(*anIt))->impl(); if (!BRepTools::IsReallyClosed(E,F) && !BRep_Tool::Degenerated(E) && M.FindFromKey(E).Extent() == 2) { if (performDistances) { - aChamferBuilder->Add(aVal1, aVal2, E, F); + aChamferBuilder->Add(theVal1, theVal2, E, F); } else { - aChamferBuilder->AddDA(aVal1, aVal2 * M_PI / 180., E, F); + aChamferBuilder->AddDA(theVal1, theVal2 * M_PI / 180., E, F); } } } else { const TopTools_ListOfShape& aFacesList = M.FindFromKey(E); TopoDS_Face F = TopoDS::Face(aFacesList.First()); if (performDistances) { - aChamferBuilder->Add(aVal1, aVal2, E, F); + aChamferBuilder->Add(theVal1, theVal2, E, F); } else { - aChamferBuilder->AddDA(aVal1, aVal2 * M_PI / 180., E, F); + aChamferBuilder->AddDA(theVal1, theVal2 * M_PI / 180., E, F); } } } @@ -87,7 +88,7 @@ void GeomAlgoAPI_Chamfer::build(const GeomShapePtr& theBaseSolid, aChamferBuilder->Build(); if (!aChamferBuilder->IsDone()) return; - const TopoDS_Shape& aResult = aChamferBuilder->Shape(); + TopoDS_Shape aResult = GeomAlgoAPI_DFLoader::refineResult(aChamferBuilder->Shape()); std::shared_ptr aShape(new GeomAPI_Shape()); aShape->setImpl(new TopoDS_Shape(aResult));