0026150: BRepOffsetAPI_ThruSections doesn't implement history method Generated().
[occt.git] / src / BRepFill / BRepFill_CompatibleWires.cxx
index c0eab66..26c7318 100644 (file)
@@ -745,6 +745,24 @@ const TopTools_ListOfShape& BRepFill_CompatibleWires::GeneratedShapes
   }
 }
 
+//==========================================================================
+//function : IsDegeneratedFirstSection
+//purpose  : 
+//==========================================================================
+Standard_Boolean BRepFill_CompatibleWires::IsDegeneratedFirstSection() const
+{
+  return myDegen1;
+}
+
+//=========================================================================
+//function : IsDegeneratedLastSection
+//purpose  : 
+//=========================================================================
+Standard_Boolean BRepFill_CompatibleWires::IsDegeneratedLastSection() const
+{
+  return myDegen2;
+}
+
 
 //=======================================================================
 //function : Perform
@@ -851,7 +869,7 @@ void BRepFill_CompatibleWires::Perform (const Standard_Boolean WithRotation)
   else {
     // There are open and closed sections :
     // not processed
-    Standard_DomainError::Raise("Sections must be all closed or all open");
+    throw Standard_DomainError("Sections must be all closed or all open");
   }
   
 }
@@ -893,7 +911,7 @@ void BRepFill_CompatibleWires::
     //allClosed = (allClosed && myWork(i).Closed());
   }
   if (!allClosed)
-    Standard_NoSuchObject::Raise("BRepFill_CompatibleWires::SameNumberByPolarMethod : the wires must be closed");
+    throw Standard_NoSuchObject("BRepFill_CompatibleWires::SameNumberByPolarMethod : the wires must be closed");
   
   // sections ponctuelles, sections bouclantes ?
   if (myDegen1) ideb++;
@@ -974,7 +992,7 @@ void BRepFill_CompatibleWires::
     // sequence of vertices of the first wire
     SeqOfVertices(wire1,SeqV);
     if (SeqV.Length()>NbMaxV) 
-      Standard_NoSuchObject::Raise("BRepFill::SameNumberByPolarMethod failed");
+      throw Standard_NoSuchObject("BRepFill::SameNumberByPolarMethod failed");
     
     // loop on vertices of wire1
     for (ii=1;ii<=SeqV.Length();ii++) {
@@ -1049,7 +1067,7 @@ void BRepFill_CompatibleWires::
     // sequence of vertices of the first wire
     SeqOfVertices(wire1,SeqV);
     if ( SeqV.Length()>NbMaxV || SeqV.Length()>SizeMap ) 
-      Standard_NoSuchObject::Raise("BRepFill::SameNumberByPolarMethod failed");
+      throw Standard_NoSuchObject("BRepFill::SameNumberByPolarMethod failed");
     
 
     // next wire 
@@ -1171,7 +1189,7 @@ void BRepFill_CompatibleWires::
        }
       } //end of for(; itW.More(); itW.Next())
     if (Esol.IsNull())
-      Standard_ConstructionError::Raise("BRepFill :: profiles are inconsistent");
+      throw Standard_ConstructionError("BRepFill :: profiles are inconsistent");
     MW.Add(Esol);
 
     TopTools_ListOfShape ConnectedEdges;
@@ -1223,7 +1241,22 @@ void BRepFill_CompatibleWires::
   }
   
   // blocking sections?
-  if (vClosed) myWork(myWork.Length()) = myWork(1);
+  if (vClosed)
+  {
+    TopoDS_Iterator iter1(myWork(myWork.Length())), iter2(myWork(1));
+    for (; iter1.More(); iter1.Next(), iter2.Next())
+    {
+      const TopoDS_Shape& anEdge = iter1.Value();
+      const TopoDS_Shape& aNewEdge = iter2.Value();
+      if (!anEdge.IsSame(aNewEdge))
+      {
+        TopTools_SequenceOfShape aSeq;
+        aSeq.Append(aNewEdge);
+        EdgeNewEdges.Bind(anEdge, aSeq);
+      }
+    }
+    myWork(myWork.Length()) = myWork(1);
+  }
 
   // check the number of edges for debug
   Standard_Integer nbmax=0, nbmin=0;
@@ -1237,7 +1270,7 @@ void BRepFill_CompatibleWires::
     if (nbmin>nbEdges) nbmin = nbEdges;
   }
   if (nbmin!=nbmax) {
-    Standard_NoSuchObject::Raise("BRepFill_CompatibleWires::SameNumberByPolarMethod failed");
+    throw Standard_NoSuchObject("BRepFill_CompatibleWires::SameNumberByPolarMethod failed");
   }
 
   //Fill <myMap>
@@ -1442,7 +1475,8 @@ void BRepFill_CompatibleWires::SameNumberByACR(const  Standard_Boolean  report)
   }
   
   // blocking sections ?
-  if (vClosed) myWork(myWork.Length()) = myWork(1);
+  if (vClosed)
+    myWork(myWork.Length()) = myWork(1);
 
   // check the number of edges for debug
   nbmax = 0;
@@ -1456,7 +1490,7 @@ void BRepFill_CompatibleWires::SameNumberByACR(const  Standard_Boolean  report)
     if (nbmin>nbEdges(i)) nbmin = nbEdges(i);
   }
   if (nbmax!=nbmin) 
-    Standard_NoSuchObject::Raise("BRepFill_CompatibleWires::SameNumberByACR failed");
+    throw Standard_NoSuchObject("BRepFill_CompatibleWires::SameNumberByACR failed");
 }
 
 //=======================================================================
@@ -1501,7 +1535,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const  Standard_Boolean /*polar*/ )
   }
 */
   if (!allClosed) 
-    Standard_NoSuchObject::Raise("BRepFill_CompatibleWires::ComputeOrigin : the wires must be closed");
+    throw Standard_NoSuchObject("BRepFill_CompatibleWires::ComputeOrigin : the wires must be closed");
 
 /*  
   // Max number of possible cuts
@@ -1836,7 +1870,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const  Standard_Boolean /*polar*/ )
       gp_Pnt Pmini,P1,P2;
       SeqOfVertices(wire,SeqV);
       if (SeqV.Length()>NbMaxV) 
-       Standard_NoSuchObject::Raise("BRepFill::ComputeOrigin failed");
+       throw Standard_NoSuchObject("BRepFill::ComputeOrigin failed");
       if (!polar) {
        // choix du vertex le plus proche comme origine
        distmini = Precision::Infinite();
@@ -2028,7 +2062,8 @@ void BRepFill_CompatibleWires::ComputeOrigin(const  Standard_Boolean /*polar*/ )
 #endif
   
   // blocking sections ?
-  if (vClosed) myWork(myWork.Length()) = myWork(1);
+  if (vClosed)
+    myWork(myWork.Length()) = myWork(1);
 }
 
 //=======================================================================
@@ -2060,7 +2095,7 @@ void BRepFill_CompatibleWires::SearchOrigin()
     allOpen = (allOpen && !myWork(i).Closed());
   }
   if (!allOpen)
-    Standard_NoSuchObject::Raise("BRepFill_CompatibleWires::SearchOrigin : the wires must be open");
+    throw Standard_NoSuchObject("BRepFill_CompatibleWires::SearchOrigin : the wires must be open");
 
   // init
 
@@ -2190,5 +2225,6 @@ void BRepFill_CompatibleWires::SearchOrigin()
   }
   
   // blocking sections ?
-  if (vClosed) myWork(myWork.Length()) = myWork(1);
+  if (vClosed)
+    myWork(myWork.Length()) = myWork(1);
 }