From cdd5ead5ad333885019ebb5dbf6cd620a57a5ece Mon Sep 17 00:00:00 2001 From: isn Date: Fri, 19 Jan 2018 15:58:41 +0300 Subject: [PATCH] remarks --- src/BRepFill/BRepFill_Generator.cxx | 22 +++++++------- .../BRepOffsetAPI_ThruSections.cxx | 29 +++++++++---------- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/src/BRepFill/BRepFill_Generator.cxx b/src/BRepFill/BRepFill_Generator.cxx index 70ead961f3..f17afa97df 100644 --- a/src/BRepFill/BRepFill_Generator.cxx +++ b/src/BRepFill/BRepFill_Generator.cxx @@ -976,11 +976,13 @@ void BRepFill_Generator::Perform() { TopoDS_Edge aREd = anOrEd1; if (degen1) - aREd = Edge1; //?? - TopTools_ListOfShape Empty; - if (!myMap.IsBound(anOrEd1)) - myMap.Bind(anOrEd1,Empty); - myMap(anOrEd1).Append(Face); + aREd = Edge1; //?? + if (!myMap.IsBound(aREd)) + { + TopTools_ListOfShape Empty; + myMap.Bind(aREd,Empty); + } + myMap(aREd).Append(Face); } tantque = ex1.More() && ex2.More(); @@ -1001,8 +1003,6 @@ void BRepFill_Generator::Perform() for (;itM.More();itM.Next()) { const TopoDS_Shape& aK = itM.Key(); - if (aK.ShapeType() != TopAbs_EDGE) - continue; //additional check, should be edge anyway const TopoDS_Shape& aVal = itM.Value(); myReshaper.Replace(aK, aVal); } @@ -1014,17 +1014,17 @@ void BRepFill_Generator::Perform() myShell.Closed(Standard_True); //update wire's history - TopExp_Explorer anExpE; + TopoDS_Iterator anItE; for (int i = 1; i <= aModifWires.Extent(); i++) { const TopoDS_Shape& aCurW = aModifWires(i); TopoDS_Wire aNewW; B.MakeWire(aNewW); - anExpE.Init(aCurW, TopAbs_EDGE); - for (;anExpE.More();anExpE.Next()) + anItE.Initialize(aCurW); + for (;anItE.More();anItE.Next()) { - const TopoDS_Shape& aCurE = anExpE.Current(); + const TopoDS_Shape& aCurE = anItE.Value(); //edges only const TopoDS_Shape& aNSEdge = ResultShape(aCurE); B.Add(aNewW, aNSEdge); } diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx b/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx index dcf4f45f82..439372579e 100644 --- a/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx @@ -344,6 +344,7 @@ void BRepOffsetAPI_ThruSections::CheckCompatibility(const Standard_Boolean check void BRepOffsetAPI_ThruSections::Build() { + myBFGenerator.Nullify(); //Check set of section for right configuration of punctual sections Standard_Integer i; TopExp_Explorer explo; @@ -512,7 +513,6 @@ void BRepOffsetAPI_ThruSections::Build() void BRepOffsetAPI_ThruSections::CreateRuled() { Standard_Integer nbSects = myWires.Length(); - //?? should we clean myBFGenerator in some other places?? myBFGenerator.Nullify(); myBFGenerator = new BRepFill_Generator(); myBFGenerator->SetMutableInput(IsMutableInput()); @@ -985,7 +985,7 @@ void BRepOffsetAPI_ThruSections::CreateSmoothed() for (;itM.More();itM.Next()) { const TopoDS_Vertex& aVert = TopoDS::Vertex(itM.Key()); - const Standard_Real& aNewToler = itM.Value(); + Standard_Real aNewToler = itM.Value(); if (BRep_Tool::Tolerance(aVert) < aNewToler) { TopoDS_Vertex aNVert = TopoDS::Vertex(aVert.EmptyCopied()); @@ -994,7 +994,6 @@ void BRepOffsetAPI_ThruSections::CreateSmoothed() } } myShape = aReshaper.Apply(myShape); - //?? Modified(shape) is not present in this class } } @@ -1358,19 +1357,8 @@ BRepOffsetAPI_ThruSections::Generated(const TopoDS_Shape& S) Standard_Integer Eindex = myVertexIndex(S); Standard_Integer Vindex = (Eindex > 0)? 0 : 1; - Eindex = Abs(Eindex); - const TopoDS_Shape& FirstSection = myWires(1); + Eindex = Abs(Eindex); TopoDS_Edge FirstEdge; - TopoDS_Iterator itw(FirstSection); - for (Standard_Integer inde = 1; itw.More(); itw.Next(),inde++) - { - FirstEdge = TopoDS::Edge(itw.Value()); - if (myIsRuled && !myBFGenerator.IsNull()) - FirstEdge = TopoDS::Edge(myBFGenerator->ResultShape(FirstEdge)); - if (inde == Eindex) - break; - } - //Find the first longitudinal edge TopoDS_Face FirstFace = TopoDS::Face(AllFaces(Eindex)); FirstFace.Orientation(TopAbs_FORWARD); @@ -1392,6 +1380,17 @@ BRepOffsetAPI_ThruSections::Generated(const TopoDS_Shape& S) } else { + const TopoDS_Shape& FirstSection = myWires(1); + TopoDS_Iterator itw(FirstSection); + for (Standard_Integer inde = 1; itw.More(); itw.Next(),inde++) + { + FirstEdge = TopoDS::Edge(itw.Value()); + if (myIsRuled && !myBFGenerator.IsNull()) + FirstEdge = TopoDS::Edge(myBFGenerator->ResultShape(FirstEdge)); + if (inde == Eindex) + break; + } + TopoDS_Shape FirstEdgeInFace; FirstEdgeInFace = Explo.Current(); TopoDS_Vertex VV [2]; -- 2.39.5