0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / BRepFill / BRepFill_Evolved.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 0fc0b78..1dc613c
-// File:       BRepFill_Evolved.cxx
-// Created:    Mon Oct  3 14:36:06 1994
-// Author:     Bruno DUMORTIER
-//             <dub@fuegox>
-
-#include <BRepFill_Evolved.ixx>
+// Created on: 1994-10-03
+// Created by: Bruno DUMORTIER
+// Copyright (c) 1994-1999 Matra Datavision
+// Copyright (c) 1999-2014 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
 
 
+#include <Bisector_Bisec.hxx>
+#include <Bisector_BisecAna.hxx>
 #include <Bnd_Box2d.hxx>
 #include <BndLib_Add2dCurve.hxx>
-#include <BRepFill_OffsetWire.hxx>
-#include <BRepAdaptor_Curve.hxx>
 #include <BRep_Builder.hxx>
+#include <BRep_Tool.hxx>
+#include <BRepAdaptor_Curve.hxx>
+#include <BRepAlgo_FaceRestrictor.hxx>
+#include <BRepAlgo_Loop.hxx>
 #include <BRepClass3d_SolidClassifier.hxx>
-#include <BRepLib.hxx>
-#include <BRepMAT2d_Explorer.hxx>
-#include <BRepFill_Pipe.hxx>
+#include <BRepFill_DataMapIteratorOfDataMapOfShapeDataMapOfShapeListOfShape.hxx>
+#include <BRepFill_DataMapOfNodeDataMapOfShapeShape.hxx>
+#include <BRepFill_DataMapOfShapeDataMapOfShapeListOfShape.hxx>
+#include <BRepFill_DataMapOfShapeSequenceOfPnt.hxx>
+#include <BRepFill_DataMapOfShapeSequenceOfReal.hxx>
+#include <BRepFill_Evolved.hxx>
 #include <BRepFill_OffsetAncestors.hxx>
-#include <BRepAlgo_FaceRestrictor.hxx>
+#include <BRepFill_OffsetWire.hxx>
+#include <BRepFill_Pipe.hxx>
+#include <BRepFill_TrimSurfaceTool.hxx>
+#include <BRepLib.hxx>
 #include <BRepLib_FindSurface.hxx>
-#include <BRepLib_MakeFace.hxx>
-#include <BRepLib_MakeWire.hxx>
 #include <BRepLib_MakeEdge.hxx>
+#include <BRepLib_MakeFace.hxx>
 #include <BRepLib_MakeVertex.hxx>
-#include <BRepAlgo_Loop.hxx>
-#include <BRepSweep_Revol.hxx>
-#include <BRepSweep_Prism.hxx>
-#include <BRepTools.hxx>
-#include <BRepTools_WireExplorer.hxx>
-#include <BRepTools_TrsfModification.hxx>
-#include <BRepTools_Modifier.hxx>
-#include <BRep_Tool.hxx>
-#include <BRepAdaptor_Curve.hxx>
+#include <BRepLib_MakeWire.hxx>
 #include <BRepLProp.hxx>
-
-#include <BRepMAT2d_LinkTopoBilo.hxx>
 #include <BRepMAT2d_BisectingLocus.hxx>
 #include <BRepMAT2d_Explorer.hxx>
-
-#include <GeomAPI.hxx>
-#include <Geom2dAdaptor_Curve.hxx>
-#include <Geom_Surface.hxx>
-#include <Geom_Plane.hxx>
-#include <Geom_Curve.hxx>
-#include <Geom_Line.hxx>
-#include <Geom_TrimmedCurve.hxx>
+#include <BRepMAT2d_LinkTopoBilo.hxx>
+#include <BRepSweep_Prism.hxx>
+#include <BRepSweep_Revol.hxx>
+#include <BRepTools.hxx>
+#include <BRepTools_Modifier.hxx>
+#include <BRepTools_Quilt.hxx>
+#include <BRepTools_TrsfModification.hxx>
+#include <BRepTools_WireExplorer.hxx>
 #include <Geom2d_CartesianPoint.hxx>
+#include <Geom2d_Circle.hxx>
 #include <Geom2d_Curve.hxx>
+#include <Geom2d_Geometry.hxx>
 #include <Geom2d_Line.hxx>
-#include <Geom2d_Circle.hxx>
 #include <Geom2d_TrimmedCurve.hxx>
-#include <Geom2d_Geometry.hxx>
-#include <GeomProjLib.hxx>
-#include <Geom_RectangularTrimmedSurface.hxx>
 #include <Geom2dAdaptor_Curve.hxx>
-
 #include <Geom2dAPI_ExtremaCurveCurve.hxx>
-#include <IntRes2d_IntersectionPoint.hxx>
 #include <Geom2dInt_GInter.hxx>
-
-#include <MAT2d_CutCurve.hxx>
-
-#include <MAT_Graph.hxx>
-#include <MAT_BasicElt.hxx>
-#include <MAT_Side.hxx>
-#include <MAT_Arc.hxx>
-#include <MAT_Node.hxx>
-#include <Bisector_Bisec.hxx>
-#include <Bisector_BisecAna.hxx>
-
-#include <TopoDS.hxx>
-#include <TopoDS_Wire.hxx>
-#include <TopoDS_Edge.hxx>
-#include <TopoDS_Compound.hxx>
-#include <TopoDS_Solid.hxx>
-#include <TopoDS_Iterator.hxx>
-#include <TopExp.hxx>
-#include <TopExp_Explorer.hxx>
-#include <TopTools_DataMapOfShapeShape.hxx>
-#include <TopTools_SequenceOfShape.hxx>
-#include <TopTools_DataMapIteratorOfDataMapOfShapeShape.hxx>
-#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx> 
-#include <TopTools_DataMapOfShapeSequenceOfShape.hxx>
-#include <TopLoc_Location.hxx>
-#include <TopAbs.hxx>
-
+#include <Geom_Curve.hxx>
+#include <Geom_Line.hxx>
+#include <Geom_Plane.hxx>
+#include <Geom_RectangularTrimmedSurface.hxx>
+#include <Geom_Surface.hxx>
+#include <Geom_TrimmedCurve.hxx>
+#include <GeomAPI.hxx>
+#include <GeomProjLib.hxx>
 #include <gp.hxx>
 #include <gp_Ax1.hxx>
 #include <gp_Ax3.hxx>
+#include <gp_Circ2d.hxx>
 #include <gp_Dir.hxx>
-#include <gp_Pnt.hxx>
 #include <gp_Pln.hxx>
+#include <gp_Pnt.hxx>
 #include <gp_Pnt2d.hxx>
 #include <gp_Trsf.hxx>
 #include <gp_Vec.hxx>
 #include <gp_Vec2d.hxx>
-#include <gp_Circ2d.hxx>
-
-#include <TColgp_SequenceOfPnt.hxx>
-#include <TColStd_SequenceOfReal.hxx>
-#include <BRepFill_TrimSurfaceTool.hxx>
-#include <BRepFill_DataMapOfNodeDataMapOfShapeShape.hxx>
-#include <BRepFill_DataMapOfShapeDataMapOfShapeListOfShape.hxx>
-#include <BRepFill_DataMapOfShapeSequenceOfReal.hxx>       
-#include <BRepFill_DataMapOfShapeSequenceOfPnt.hxx>       
-#include <BRepFill_DataMapIteratorOfDataMapOfShapeDataMapOfShapeListOfShape.hxx>
+#include <IntRes2d_IntersectionPoint.hxx>
+#include <MAT2d_CutCurve.hxx>
+#include <MAT_Arc.hxx>
+#include <MAT_BasicElt.hxx>
+#include <MAT_Graph.hxx>
+#include <MAT_Node.hxx>
+#include <MAT_Side.hxx>
 #include <Precision.hxx>
-
 #include <Standard_ConstructionError.hxx>
+#include <Standard_NoSuchObject.hxx>
 #include <Standard_NotImplemented.hxx>
+#include <TColgp_SequenceOfPnt.hxx>
+#include <TColStd_SequenceOfReal.hxx>
+#include <TopAbs.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopLoc_Location.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Compound.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Iterator.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Solid.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Wire.hxx>
+#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
+#include <TopTools_DataMapIteratorOfDataMapOfShapeShape.hxx>
+#include <TopTools_DataMapOfShapeSequenceOfShape.hxx>
+#include <TopTools_DataMapOfShapeShape.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopTools_SequenceOfShape.hxx>
 
 #ifdef DRAW
 #include <DBRep.hxx>
 #include <DrawTrSurf.hxx>
 #include <stdio.h>
-#endif
-
-#ifdef DEB
 static Standard_Boolean AffichGeom = Standard_False;
 static Standard_Boolean AffichEdge = Standard_False;
 static Standard_Integer NbFACES       = 0;
@@ -124,10 +124,6 @@ static Standard_Integer NbTRIMFACES   = 0;
 static Standard_Integer NbVEVOS       = 0;
 static Standard_Integer NbPROFILS     = 0;
 static Standard_Integer NbEDGES       = 0;
-// POP for NT
-#ifndef WNT
-static char name[100];
-#endif
 #endif
 
 static const Standard_Real BRepFill_Confusion() 
@@ -670,11 +666,12 @@ void BRepFill_Evolved::ElementaryPerform (const TopoDS_Face&              Sp,
                                          const TopoDS_Wire&              Pr,
                                          const BRepMAT2d_BisectingLocus& Locus,
                                                BRepMAT2d_LinkTopoBilo&   Link,
-                                         const GeomAbs_JoinType          Join)
+                                         const GeomAbs_JoinType          /*Join*/)
 {
 
 #ifdef DRAW
   if (AffichEdge) {      
+    char name[100];
     sprintf(name,"PROFIL_%d",++NbPROFILS);     
     DBRep::Set(name,Pr);
   }
@@ -972,6 +969,7 @@ void BRepFill_Evolved::ElementaryPerform (const TopoDS_Face&              Sp,
        
 #ifdef DRAW
        if (AffichEdge) {
+          char name[100];
          sprintf(name,"ARCEDGE_%d_%d_%d",i,vv,Ti);     
          DBRep::Set(name,CurrentEdge);
        }
@@ -1057,7 +1055,7 @@ void BRepFill_Evolved::ElementaryPerform (const TopoDS_Face&              Sp,
     }
   }
 
-#ifdef DEB
+#ifdef DRAW
  if (AffichEdge) {
    cout << " End of Construction of edges and vertices on bissectrices"<<endl;
  }
@@ -1122,6 +1120,7 @@ void BRepFill_Evolved::ElementaryPerform (const TopoDS_Face&              Sp,
            
 #ifdef DRAW        
            if (AffichEdge) {
+              char name[100];
              sprintf(name,"PAREDGE_%d_%d",++NbEDGES,k);        
              DBRep::Set(name,S.Value(k));
            }
@@ -1159,6 +1158,7 @@ void BRepFill_Evolved::ElementaryPerform (const TopoDS_Face&              Sp,
          
 #ifdef DRAW        
          if (AffichEdge) {       
+            char name[100];
            sprintf(name,"PAREDGE_%d_%d",++NbEDGES,k);  
            DBRep::Set(name,S.Value(k));
          }
@@ -1242,6 +1242,7 @@ void BRepFill_Evolved::ElementaryPerform (const TopoDS_Face&              Sp,
 #ifdef DRAW  
   if (AffichEdge) {      
     cout <<" End of construction of an elementary volevo."<<endl;          
+    char name[100];
     sprintf(name,"VEVO_%d",++NbVEVOS); 
     DBRep::Set(name,myShape);
   }
@@ -1348,6 +1349,7 @@ void BRepFill_Evolved::PlanarPerform (const TopoDS_Face&              Sp,
       TopTools_DataMapIteratorOfDataMapOfShapeShape it(MapVP);
       Standard_Integer k = 0;
       for (; it.More(); it.Next()) {
+        char name[100];
        sprintf(name,"PARALI_%d",++k);  
        DBRep::Set(name,it.Value());
       }
@@ -1451,6 +1453,7 @@ void BRepFill_Evolved::VerticalPerform (const TopoDS_Face&              Sp,
     
 #ifdef DRAW  
     if (AffichEdge) {    
+      char name[100];
       sprintf(name,"PARALI_%d",++NbVEVOS);     
       DBRep::Set(name,Base);
     }
@@ -1459,6 +1462,7 @@ void BRepFill_Evolved::VerticalPerform (const TopoDS_Face&              Sp,
     BRepSweep_Prism PS(Base,gp_Vec(0,0,Alt2 - Alt1),Standard_False);
 #ifdef DRAW  
     if (AffichEdge) {    
+      char name[100];
       sprintf(name,"PRISM_%d",NbVEVOS);        
       DBRep::Set(name,PS.Shape());
     }
@@ -1688,7 +1692,7 @@ const
 
     for (TopoDS_Iterator IteW(IteF.Value()); IteW.More(); IteW.Next()) {
       
-      const TopoDS_Edge& E = TopoDS::Edge(IteW.Value());
+      TopoDS_Edge E = TopoDS::Edge(IteW.Value());
       EdgeVertices(E,V1,V2);
       MapSpine.Bind(V1,V1);
       MapSpine.Bind(V2,V2);
@@ -1720,6 +1724,7 @@ const
 
 #ifdef DRAW
   if (AffichEdge) {
+    char name[100];
     sprintf(name,"workspine"); 
     DBRep::Set(name,WorkSpine);
   }
@@ -2202,6 +2207,7 @@ void BRepFill_Evolved::MakePipe(const TopoDS_Edge& SE,
 
 #ifdef DRAW
   if (AffichGeom) {
+    char name[100];
     sprintf(name,"EVOLBASE_%d",++NbFACES);
     DBRep::Set(name,SE);
     sprintf(name,"EVOLPROF_%d",NbFACES);
@@ -2209,11 +2215,12 @@ void BRepFill_Evolved::MakePipe(const TopoDS_Edge& SE,
   }
 #endif
 
-//  BRepFill_Pipe Pipe(BRepLib_MakeWire(SE),GenProf);  
-  BRepFill_Pipe Pipe = BRepFill_Pipe(BRepLib_MakeWire(SE),GenProf);    
+  BRepFill_Pipe Pipe(BRepLib_MakeWire(SE), GenProf);   
+  //BRepFill_Pipe Pipe = BRepFill_Pipe(BRepLib_MakeWire(SE),GenProf);  
   
 #ifdef DRAW
   if (AffichGeom) {
+    char name[100];
     sprintf(name,"EVOL_%d",++NbFACES);
     DBRep::Set(name,Pipe.Shape());
   }
@@ -2291,9 +2298,9 @@ void BRepFill_Evolved::MakeRevol(const TopoDS_Edge&   SE,
   
 #ifdef DRAW  
   if (AffichGeom) {
+    char name[100];
     sprintf(name,"EVOLBASE_%d",++NbFACES);
-    char* Temp = name ;
-    DrawTrSurf::Set(Temp,new Geom_Line(AxeRev));
+    DrawTrSurf::Set(name,new Geom_Line(AxeRev));
 //    DrawTrSurf::Set(name,new Geom_Line(AxeRev));
     sprintf(name,"EVOLPROF_%d",NbFACES);
     DBRep::Set(name,GenProf);
@@ -2395,6 +2402,7 @@ void BRepFill_Evolved::TransformInitWork(const TopLoc_Location& LS,
 
 #ifdef DRAW
   if (AffichEdge) {
+    char name[100];
     sprintf(name,"movedspine");
     TopoDS_Face SL = mySpine;
     DBRep::Set(name,SL);    
@@ -2411,7 +2419,7 @@ void BRepFill_Evolved::TransformInitWork(const TopLoc_Location& LS,
 //purpose  : Coding of regularities on edges parallel to CutVevo
 //           common to left and right parts of volevo.
 //=======================================================================
-void  BRepFill_Evolved::ContinuityOnOffsetEdge (const TopTools_ListOfShape& WorkProf) 
+void  BRepFill_Evolved::ContinuityOnOffsetEdge (const TopTools_ListOfShape&) 
 {
   BRepTools_WireExplorer WExp ; 
   BRepFill_DataMapIteratorOfDataMapOfShapeDataMapOfShapeListOfShape iteS;
@@ -2810,7 +2818,7 @@ void ComputeIntervals (const TopTools_SequenceOfShape& VOnF,
                             TopTools_SequenceOfShape& LastV )
 {
   Standard_Integer IOnF    = 1,IOnL = 1;
-  Standard_Real    U1,U2;
+  Standard_Real    U1 = 0.,U2;
   TopoDS_Shape     V1,V2;
   
   if (!VS.IsNull()) {
@@ -3201,7 +3209,7 @@ void CutEdge (const TopoDS_Edge& E,
   CT2d = new Geom2d_TrimmedCurve(C2d,f,l);
 
   if (CT2d->BasisCurve()->IsKind(STANDARD_TYPE(Geom2d_Circle)) &&
-      E.Closed()) {
+      BRep_Tool::IsClosed(E)) {
     //---------------------------
     // Cut closed circle.
     //---------------------------