]> OCCT Git - occt-copy.git/commitdiff
remarks CR28642_2
authorisn <isn@opencascade.com>
Fri, 19 Jan 2018 12:58:41 +0000 (15:58 +0300)
committerisn <isn@opencascade.com>
Fri, 19 Jan 2018 12:58:41 +0000 (15:58 +0300)
src/BRepFill/BRepFill_Generator.cxx
src/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx

index 70ead961f3b8069f35e5ca2bcfce85ba5154ce6c..f17afa97df2e0edc045ac1cc890b099e76dfe3c7 100644 (file)
@@ -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);
     }
index dcf4f45f8219239d34adabcbe1925657d29a22c6..439372579e003bf1aa83646b6e813046c371c688 100644 (file)
@@ -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];