0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / BRepFill / BRepFill_Evolved.cxx
old mode 100755 (executable)
new mode 100644 (file)
index bc6edb1..1dc613c
 // Created on: 1994-10-03
 // Created by: Bruno DUMORTIER
 // Copyright (c) 1994-1999 Matra Datavision
-// Copyright (c) 1999-2012 OPEN CASCADE SAS
+// Copyright (c) 1999-2014 OPEN CASCADE SAS
 //
-// The content of this file is subject to the Open CASCADE Technology Public
-// License Version 6.5 (the "License"). You may not use the content of this file
-// except in compliance with the License. Please obtain a copy of the License
-// at http://www.opencascade.org and read it completely before using this file.
+// This file is part of Open CASCADE Technology software library.
 //
-// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+// 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.
 //
-// The Original Code and all software distributed under the License is
-// distributed on an "AS IS" basis, without warranty of any kind, and the
-// Initial Developer hereby disclaims all such warranties, including without
-// limitation, any warranties of merchantability, fitness for a particular
-// purpose or non-infringement. Please see the License for the specific terms
-// and conditions governing the rights and limitations under the License.
-
-
-#include <BRepFill_Evolved.ixx>
+// 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;
@@ -140,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() 
@@ -691,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);
   }
@@ -988,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);
        }
@@ -1073,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;
  }
@@ -1138,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));
            }
@@ -1175,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));
          }
@@ -1258,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);
   }
@@ -1364,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());
       }
@@ -1467,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);
     }
@@ -1475,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());
     }
@@ -1704,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);
@@ -1736,6 +1724,7 @@ const
 
 #ifdef DRAW
   if (AffichEdge) {
+    char name[100];
     sprintf(name,"workspine"); 
     DBRep::Set(name,WorkSpine);
   }
@@ -2218,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);
@@ -2225,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());
   }
@@ -2307,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);
@@ -2411,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);    
@@ -3217,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.
     //---------------------------