From: jfa Date: Tue, 20 Jan 2009 13:05:18 +0000 (+0000) Subject: Fix bug 0020096: EDF 897 GEOM MakeFilling with a compound de wires. X-Git-Tag: V4_1_5rc1~26 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f20d5f5cc0ad21ad47cb6918c00ae5a7e9719bf7;p=modules%2Fgeom.git Fix bug 0020096: EDF 897 GEOM MakeFilling with a compound de wires. --- diff --git a/src/GEOMImpl/GEOMImpl_FillingDriver.cxx b/src/GEOMImpl/GEOMImpl_FillingDriver.cxx index 7c6b48cfa..0f9c57e2a 100644 --- a/src/GEOMImpl/GEOMImpl_FillingDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_FillingDriver.cxx @@ -106,12 +106,19 @@ Standard_Integer GEOMImpl_FillingDriver::Execute(TFunction_Logbook& log) const Standard_Real First, Last; Handle(Geom_Curve) C; - if(!isApprox) { + TopoDS_Iterator It (aShape); + for (; It.More(); It.Next()) { + Scurrent = It.Value(); + if (Scurrent.ShapeType() != TopAbs_EDGE) + Standard_ConstructionError::Raise("The argument compound must contain only edges"); + } + + if (!isApprox) { // make filling as in old version of SALOME (before 4.1.1) GeomFill_SectionGenerator Section; Standard_Integer i = 0; for (Ex.Init(aShape, TopAbs_EDGE); Ex.More(); Ex.Next()) { - Scurrent = Ex.Current() ; + Scurrent = Ex.Current(); if (Scurrent.IsNull() || Scurrent.ShapeType() != TopAbs_EDGE) return 0; if (BRep_Tool::Degenerated(TopoDS::Edge(Scurrent))) continue; C = BRep_Tool::Curve(TopoDS::Edge(Scurrent), First, Last); @@ -119,14 +126,14 @@ Standard_Integer GEOMImpl_FillingDriver::Execute(TFunction_Logbook& log) const Section.AddCurve(C); i++; } - + /* a 'tolerance' is used to compare 2 knots : see GeomFill_Generator.cdl */ Section.Perform(Precision::Confusion()); Handle(GeomFill_Line) Line = new GeomFill_Line(i); - + GeomFill_AppSurf App (mindeg, maxdeg, tol3d, tol2d, nbiter); /* user parameters */ App.Perform(Line, Section); - + if (!App.IsDone()) return 0; Standard_Integer UDegree, VDegree, NbUPoles, NbVPoles, NbUKnots, NbVKnots; App.SurfShape(UDegree, VDegree, NbUPoles, NbVPoles, NbUKnots, NbVKnots); @@ -146,7 +153,7 @@ Standard_Integer GEOMImpl_FillingDriver::Execute(TFunction_Logbook& log) const // add curves from edges to sequence and find maximal // number of poles if some of them are bsplines for (Ex.Init(aShape, TopAbs_EDGE); Ex.More(); Ex.Next()) { - Scurrent = Ex.Current() ; + Scurrent = Ex.Current(); if (Scurrent.IsNull() || Scurrent.ShapeType() != TopAbs_EDGE) return 0; if (BRep_Tool::Degenerated(TopoDS::Edge(Scurrent))) continue; C = BRep_Tool::Curve(TopoDS::Edge(Scurrent), First, Last);