1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0022783: Improvement of BRepOffsetAPI_MakeFilling: keep old and new boundary edges with all pcurves

This commit is contained in:
JGV
2011-12-23 07:05:13 +00:00
committed by bugmaster
parent c2b143174b
commit 01697018a3
8 changed files with 509 additions and 216 deletions

View File

@@ -196,6 +196,9 @@ is
-- and removes all polygons on triangulations of the
-- edges.
RemoveUnusedPCurves(S: Shape from TopoDS);
---Purpose: Removes all the pcurves of the edges of <S> that
-- refer to surfaces not belonging to any face of <S>
Triangulation(S: Shape from TopoDS; deflec: Real)
returns Boolean from Standard;

View File

@@ -30,6 +30,7 @@
#include <Poly_Triangulation.hxx>
#include <Poly_PolygonOnTriangulation.hxx>
#include <TColStd_HArray1OfInteger.hxx>
#include <TColStd_MapOfTransient.hxx>
#include <gp_Lin2d.hxx>
#include <ElCLib.hxx>
@@ -747,7 +748,58 @@ void BRepTools::Clean(const TopoDS_Shape& S)
}
}
//=======================================================================
//function : RemoveUnusedPCurves
//purpose :
//=======================================================================
void BRepTools::RemoveUnusedPCurves(const TopoDS_Shape& S)
{
TColStd_MapOfTransient UsedSurfaces;
TopExp_Explorer Explo(S, TopAbs_FACE);
for (; Explo.More(); Explo.Next())
{
TopoDS_Face aFace = TopoDS::Face(Explo.Current());
TopLoc_Location aLoc;
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(aFace, aLoc);
UsedSurfaces.Add(aSurf);
}
TopTools_IndexedMapOfShape Emap;
TopExp::MapShapes(S, TopAbs_EDGE, Emap);
Standard_Integer i;
for (i = 1; i <= Emap.Extent(); i++)
{
const Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*) &Emap(i).TShape());
BRep_ListOfCurveRepresentation& lcr = TE -> ChangeCurves();
BRep_ListIteratorOfListOfCurveRepresentation itrep(lcr );
while (itrep.More())
{
Standard_Boolean ToRemove = Standard_False;
Handle(BRep_CurveRepresentation) CurveRep = itrep.Value();
if (CurveRep->IsCurveOnSurface())
{
Handle(Geom_Surface) aSurface = CurveRep->Surface();
if (!UsedSurfaces.Contains(aSurface))
ToRemove = Standard_True;
}
else if (CurveRep->IsRegularity())
{
Handle(Geom_Surface) Surf1 = CurveRep->Surface();
Handle(Geom_Surface) Surf2 = CurveRep->Surface2();
ToRemove = (!UsedSurfaces.Contains(Surf1) || !UsedSurfaces.Contains(Surf2));
}
if (ToRemove)
lcr.Remove(itrep);
else
itrep.Next();
}
}
}
//=======================================================================
//function : Triangulation