0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / BRepFill / BRepFill_Evolved.cxx
index 5699d25..1dc613c 100644 (file)
@@ -5,8 +5,8 @@
 //
 // 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 version 2.1 as published
+// 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.
 // commercial license or contractual agreement.
 
 
-#include <BRepFill_Evolved.ixx>
-
-
+#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;
@@ -136,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() 
@@ -687,6 +671,7 @@ void BRepFill_Evolved::ElementaryPerform (const TopoDS_Face&              Sp,
 
 #ifdef DRAW
   if (AffichEdge) {      
+    char name[100];
     sprintf(name,"PROFIL_%d",++NbPROFILS);     
     DBRep::Set(name,Pr);
   }
@@ -984,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);
        }
@@ -1069,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;
  }
@@ -1134,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));
            }
@@ -1171,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));
          }
@@ -1254,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);
   }
@@ -1360,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());
       }
@@ -1463,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);
     }
@@ -1471,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());
     }
@@ -1700,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);
@@ -1732,6 +1724,7 @@ const
 
 #ifdef DRAW
   if (AffichEdge) {
+    char name[100];
     sprintf(name,"workspine"); 
     DBRep::Set(name,WorkSpine);
   }
@@ -2214,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);
@@ -2226,6 +2220,7 @@ void BRepFill_Evolved::MakePipe(const TopoDS_Edge& SE,
   
 #ifdef DRAW
   if (AffichGeom) {
+    char name[100];
     sprintf(name,"EVOL_%d",++NbFACES);
     DBRep::Set(name,Pipe.Shape());
   }
@@ -2303,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);
@@ -2407,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);    
@@ -3213,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.
     //---------------------------