0026585: Eliminate compile warnings obtained by building occt with vc14: 'type cast...
[occt.git] / src / BRepFeat / BRepFeat_MakeDPrism.cxx
old mode 100755 (executable)
new mode 100644 (file)
index d13d6be..1150188
 // Created on: 1996-09-03
 // Created by: Olga KOULECHOVA
 // Copyright (c) 1996-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.
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
 
 
-
-#include <BRepFeat_MakeDPrism.ixx>
-
-#include <BRepFeat.hxx>
-#include <LocOpe.hxx>
-#include <LocOpe_CSIntersector.hxx>
-#include <TColGeom_SequenceOfCurve.hxx>
-#include <LocOpe_DPrism.hxx>
-#include <LocOpe_SequenceOfLin.hxx>
-#include <LocOpe_PntFace.hxx>
-
-#include <gp_Vec.hxx>
-#include <gp_Pnt.hxx>
-#include <gp_Pnt2d.hxx>
-#include <gp_Pln.hxx>
-
-#include <Precision.hxx>
-
-#include <Geom_Surface.hxx>
-#include <Geom_Curve.hxx>
-#include <Geom_Line.hxx>
-#include <Geom2d_Curve.hxx>
-#include <Geom_Plane.hxx>
-#include <Geom_RectangularTrimmedSurface.hxx>
-#include <TColgp_SequenceOfPnt.hxx>
-#include <TColGeom_SequenceOfCurve.hxx>
 #include <Bnd_Box.hxx>
-
-#include <BRepBndLib.hxx>
 #include <BRep_Builder.hxx>
 #include <BRep_Tool.hxx>
-#include <BRepTools.hxx>
-#include <BRepPrimAPI_MakeBox.hxx>
-#include <BRepLib.hxx>
-
 #include <BRepAlgo.hxx>
-//modified by NIZNHY-PKV Thu Mar 21 17:49:46 2002 f
-//#include <BRepAlgo_Cut.hxx>
-//#include <BRepAlgo_Fuse.hxx>
 #include <BRepAlgoAPI_Cut.hxx>
 #include <BRepAlgoAPI_Fuse.hxx>
-//modified by NIZNHY-PKV Thu Mar 21 17:50:04 2002 t
-
+#include <BRepBndLib.hxx>
+#include <BRepFeat.hxx>
+#include <BRepFeat_MakeDPrism.hxx>
+#include <BRepLib.hxx>
 #include <BRepLib_MakeFace.hxx>
-
+#include <BRepPrimAPI_MakeBox.hxx>
+#include <BRepTools.hxx>
+#include <Geom2d_Curve.hxx>
+#include <Geom_Curve.hxx>
+#include <Geom_Line.hxx>
+#include <Geom_Plane.hxx>
+#include <Geom_RectangularTrimmedSurface.hxx>
+#include <Geom_Surface.hxx>
+#include <gp_Pln.hxx>
+#include <gp_Pnt.hxx>
+#include <gp_Pnt2d.hxx>
+#include <gp_Vec.hxx>
+#include <LocOpe.hxx>
+#include <LocOpe_CSIntersector.hxx>
+#include <LocOpe_DPrism.hxx>
+#include <LocOpe_PntFace.hxx>
+#include <LocOpe_SequenceOfLin.hxx>
+#include <Precision.hxx>
+#include <Standard_ConstructionError.hxx>
+#include <TColGeom_SequenceOfCurve.hxx>
+#include <TColgp_SequenceOfPnt.hxx>
+#include <TopAbs.hxx>
+#include <TopExp.hxx>
 #include <TopExp_Explorer.hxx>
-#include <TopTools_MapOfShape.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Compound.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Shell.hxx>
+#include <TopoDS_Solid.hxx>
+#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
 #include <TopTools_MapIteratorOfMapOfShape.hxx>
-#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
-#include <TopoDS_Solid.hxx>
-#include <TopoDS_Compound.hxx>
-#include <TopoDS_Shell.hxx>
-#include <TopoDS_Shape.hxx>
-#include <TopoDS_Face.hxx>
-#include <TopoDS.hxx>
-
-#include <Standard_ConstructionError.hxx>
-
-#include <TopExp.hxx>
-
-#include <BRepFeat.hxx>
-#include <TopAbs.hxx>
+#include <TopTools_MapOfShape.hxx>
 
-#ifdef DEB
-Standard_IMPORT Standard_Boolean BRepFeat_GettraceFEAT();
+//modified by NIZNHY-PKV Thu Mar 21 17:49:46 2002 f
+//#include <BRepAlgo_Cut.hxx>
+//#include <BRepAlgo_Fuse.hxx>
+//modified by NIZNHY-PKV Thu Mar 21 17:50:04 2002 t
+#ifdef OCCT_DEBUG
+extern Standard_Boolean BRepFeat_GettraceFEAT();
 #endif
 
 static void MajMap(const TopoDS_Shape&,
-                  const LocOpe_DPrism&,
-                  TopTools_DataMapOfShapeListOfShape&, // myMap
-                  TopoDS_Shape&,  // myFShape
-                  TopoDS_Shape&); // myLShape
-
-
-static void SetGluedFaces(const TopoDS_Face& theSkface,
-                         const TopoDS_Shape& theSbase,
-                         const TopoDS_Shape& thePbase,
-                         const TopTools_DataMapOfShapeListOfShape& theSlmap,
-                          LocOpe_DPrism&,
-                         TopTools_DataMapOfShapeShape&);
-
-#ifdef DEB
-static void VerifGluedFaces(const TopoDS_Face& theSkface,
-                           const TopoDS_Shape& thePbase,
-                           Handle(Geom_Curve)& theBCurve,
-                           TColGeom_SequenceOfCurve& theCurves,
-                           LocOpe_DPrism& theDPrism,
-                           TopTools_DataMapOfShapeShape& theMap);
-#endif
+  const LocOpe_DPrism&,
+  TopTools_DataMapOfShapeListOfShape&, // myMap
+  TopoDS_Shape&,  // myFShape
+  TopoDS_Shape&); // myLShape
 
 static Standard_Real HeightMax(const TopoDS_Shape& theSbase,
-                              const TopoDS_Face& theSkface,
-                              const TopoDS_Shape& theSFrom,
-                              const TopoDS_Shape& theSUntil);
+  const TopoDS_Face& theSkface,
+  const TopoDS_Shape& theSFrom,
+  const TopoDS_Shape& theSUntil);
 
 static Standard_Integer SensOfPrism(const Handle(Geom_Curve) C,
-                                   const TopoDS_Shape& Until);
+  const TopoDS_Shape& Until);
 
 static Handle(Geom_Curve) TestCurve(const TopoDS_Face&);
 
-static Standard_Boolean ToFuse(const TopoDS_Face& ,
-                              const TopoDS_Face&);
-
-
 
 //=======================================================================
 //function : Init
@@ -132,14 +94,14 @@ static Standard_Boolean ToFuse(const TopoDS_Face& ,
 //=======================================================================
 
 void BRepFeat_MakeDPrism::Init(const TopoDS_Shape&    Sbase,
-                              const TopoDS_Face&     Pbase,
-                              const TopoDS_Face&     Skface,
-                              const Standard_Real    Angle,
-                              const Standard_Integer Mode,
-                              const Standard_Boolean Modify)
-       
+  const TopoDS_Face&     Pbase,
+  const TopoDS_Face&     Skface,
+  const Standard_Real    Angle,
+  const Standard_Integer Mode,
+  const Standard_Boolean Modify)
+
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeDPrism::Init" << endl;
 #endif
@@ -184,13 +146,13 @@ void BRepFeat_MakeDPrism::Init(const TopoDS_Shape&    Sbase,
     myMap(exp.Current()).Append(exp.Current());
   }
   myAngle = Angle;
-#ifdef DEB
+#ifdef OCCT_DEBUG
   if (trc) {
     if (myJustFeat)  cout << " Just Feature" << endl;
     if (myFuse)  cout << " Fuse" << endl;
     if (!myFuse)  cout << " Cut" << endl;
     if (!myModify) cout << " Modify = 0" << endl;
-//    cout <<" Angle = " << myAngle << endl;
+    //    cout <<" Angle = " << myAngle << endl;
   }
 #endif 
 }
@@ -202,9 +164,9 @@ void BRepFeat_MakeDPrism::Init(const TopoDS_Shape&    Sbase,
 //=======================================================================
 
 void BRepFeat_MakeDPrism::Add(const TopoDS_Edge& E,
-                            const TopoDS_Face& F)
+  const TopoDS_Face& F)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeDPrism::Add(Edge,face)" << endl;
 #endif
@@ -250,7 +212,7 @@ void BRepFeat_MakeDPrism::Add(const TopoDS_Edge& E,
 
 void BRepFeat_MakeDPrism::Perform(const Standard_Real Height)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeDPrism::Perform(Height)" << endl;
 #endif
@@ -263,7 +225,7 @@ void BRepFeat_MakeDPrism::Perform(const Standard_Real Height)
   PerfSelectionValid();
 
   Standard_Real theheight = Height/cos(myAngle);
-//  myPbase.Orientation(TopAbs_FORWARD);
+  //  myPbase.Orientation(TopAbs_FORWARD);
 
   LocOpe_DPrism theDPrism(myPbase,theheight,myAngle);
   TopoDS_Shape VraiDPrism = theDPrism.Shape();
@@ -282,42 +244,9 @@ void BRepFeat_MakeDPrism::Perform(const Standard_Real Height)
     return;
   }
 
-  TopoDS_Face FFace;
-  
-  Standard_Boolean found = Standard_False;
-
-  if(!mySkface.IsNull() || !mySlface.IsEmpty()) {
-    if(myLShape.ShapeType() == TopAbs_WIRE) {
-      TopExp_Explorer ex1(VraiDPrism, TopAbs_FACE);
-      for(; ex1.More(); ex1.Next()) {
-       TopExp_Explorer ex2(ex1.Current(), TopAbs_WIRE);
-       for(; ex2.More(); ex2.Next()) {
-         if(ex2.Current().IsSame(myLShape)) {
-           FFace = TopoDS::Face(ex1.Current());
-           found = Standard_True;
-           break;
-         }
-       }
-       if(found) break;
-      }
-    }
-    
-    TopExp_Explorer exp(mySbase, TopAbs_FACE);
-    for(; exp.More(); exp.Next()) {
-      const TopoDS_Face& ff = TopoDS::Face(exp.Current());
-      if(ToFuse(ff, FFace)) {
-       TopTools_DataMapOfShapeListOfShape sl;
-       //SetGluedFaces(ff, mySbase, FFace, sl, theDPrism, myGluedF);
-       break;
-      }
-    }
-  }
-
-// management of gluing faces 
+  // management of gluing faces 
 
-  //SetGluedFaces(mySkface, mySbase, theBase, mySlface, theDPrism, myGluedF);
   GluedFacesValid();
-//  VerifGluedFaces(mySkface, theBase, myBCurve, myCurves, theDPrism, myGluedF);
 
   if(!myGluedF.IsEmpty()) {   // case gluing
     myJustGluer = Standard_True;
@@ -326,7 +255,7 @@ void BRepFeat_MakeDPrism::Perform(const Standard_Real Height)
     GlobalPerform();
   }
 
-// if there is no gluing -> call topological operations
+  // if there is no gluing -> call topological operations
   if(!myJustGluer) {
     if(myFuse == 1) {
       //modified by NIZNHY-PKV Thu Mar 21 17:32:17 2002 f
@@ -364,7 +293,7 @@ void BRepFeat_MakeDPrism::Perform(const Standard_Real Height)
 
 void BRepFeat_MakeDPrism::Perform(const TopoDS_Shape& Until)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeDPrism::Perform(Until)" << endl;
 #endif
@@ -375,7 +304,7 @@ void BRepFeat_MakeDPrism::Perform(const TopoDS_Shape& Until)
   if (!exp.More()) {
     Standard_ConstructionError::Raise();
   }
-//  myPbase.Orientation(TopAbs_FORWARD);
+  //  myPbase.Orientation(TopAbs_FORWARD);
 
   myGluedF.Clear();
   myPerfSelection = BRepFeat_SelectionU;
@@ -407,11 +336,7 @@ void BRepFeat_MakeDPrism::Perform(const TopoDS_Shape& Until)
       return;
     }
 
-    //SetGluedFaces(mySkface, mySbase, theBase, mySlface, theDPrism, myGluedF);
     GluedFacesValid();
-//    VerifGluedFaces(mySkface, theBase, myBCurve, myCurves, theDPrism, myGluedF);
-   
-
     theDPrism.Curves(myCurves);
     myBCurve = theDPrism.BarycCurve();
     GlobalPerform();
@@ -434,13 +359,13 @@ void BRepFeat_MakeDPrism::Perform(const TopoDS_Shape& Until)
     TopAbs_Orientation Or;
     if (ASI.IsDone() && ASI.NbPoints(1) >=1) { 
       if (myFuse == 1) {
-       Or = ASI.Point(1,1).Orientation();
+        Or = ASI.Point(1,1).Orientation();
       }
       else {
-       Or = ASI.Point(1,ASI.NbPoints(1)).Orientation();
+        Or = ASI.Point(1,ASI.NbPoints(1)).Orientation();
       }     
-//      Standard_Real prm = ASI.Point(1,1).Parameter();
-//      if(prm < 0) Or = TopAbs::Reverse(Or);
+      //      Standard_Real prm = ASI.Point(1,1).Parameter();
+      //      if(prm < 0) Or = TopAbs::Reverse(Or);
       TopoDS_Face FUntil = ASI.Point(1,1).Face();
       TopoDS_Shape Comp;
       bB.MakeCompound(TopoDS::Compound(Comp));
@@ -457,30 +382,30 @@ void BRepFeat_MakeDPrism::Perform(const TopoDS_Shape& Until)
       TopExp_Explorer ex(trP.Shape(), TopAbs_SOLID);
       TopoDS_Shape Cutsh = ex.Current();
       if(myFuse == 1) {
-       //modified by NIZNHY-PKV Thu Mar 21 17:34:09 2002 f
-       //BRepAlgo_Fuse f(mySbase, Cutsh);
-       //myShape = f.Shape();
-       //UpdateDescendants(f.Builder(), myShape, Standard_False);
-       BRepAlgoAPI_Fuse f(mySbase, Cutsh);
-       myShape = f.Shape();
-       UpdateDescendants(f, myShape, Standard_False);
-       //modified by NIZNHY-PKV Thu Mar 21 17:34:13 2002 t
-       Done();
+        //modified by NIZNHY-PKV Thu Mar 21 17:34:09 2002 f
+        //BRepAlgo_Fuse f(mySbase, Cutsh);
+        //myShape = f.Shape();
+        //UpdateDescendants(f.Builder(), myShape, Standard_False);
+        BRepAlgoAPI_Fuse f(mySbase, Cutsh);
+        myShape = f.Shape();
+        UpdateDescendants(f, myShape, Standard_False);
+        //modified by NIZNHY-PKV Thu Mar 21 17:34:13 2002 t
+        Done();
       }
       else if(myFuse == 0) {
-       //modified by NIZNHY-PKV Thu Mar 21 17:34:56 2002 f
-       //BRepAlgo_Cut c(mySbase, Cutsh);
-       //myShape = c.Shape();
-       //UpdateDescendants(c.Builder(), myShape, Standard_False);
-       BRepAlgoAPI_Cut c(mySbase, Cutsh);
-       myShape = c.Shape();
-       UpdateDescendants(c, myShape, Standard_False);
-       //modified by NIZNHY-PKV Thu Mar 21 17:34:59 2002 t
-       Done();
+        //modified by NIZNHY-PKV Thu Mar 21 17:34:56 2002 f
+        //BRepAlgo_Cut c(mySbase, Cutsh);
+        //myShape = c.Shape();
+        //UpdateDescendants(c.Builder(), myShape, Standard_False);
+        BRepAlgoAPI_Cut c(mySbase, Cutsh);
+        myShape = c.Shape();
+        UpdateDescendants(c, myShape, Standard_False);
+        //modified by NIZNHY-PKV Thu Mar 21 17:34:59 2002 t
+        Done();
       }
       else {
-       myShape = Cutsh;
-       Done(); 
+        myShape = Cutsh;
+        Done();        
       }
     }         
   }
@@ -502,9 +427,9 @@ void BRepFeat_MakeDPrism::Perform(const TopoDS_Shape& Until)
 //=======================================================================
 
 void BRepFeat_MakeDPrism::Perform(const TopoDS_Shape& From,
-                                 const TopoDS_Shape& Until)
+  const TopoDS_Shape& Until)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeDPrism::Perform(From,Until)" << endl;
 #endif
@@ -524,7 +449,7 @@ void BRepFeat_MakeDPrism::Perform(const TopoDS_Shape& From,
       if (myJustGluer) return;
     }
   }
-//  myPbase.Orientation(TopAbs_FORWARD);
+  //  myPbase.Orientation(TopAbs_FORWARD);
 
   myGluedF.Clear();
   myPerfSelection = BRepFeat_SelectionFU;
@@ -566,14 +491,13 @@ void BRepFeat_MakeDPrism::Perform(const TopoDS_Shape& From,
 
   if(!Trff) {
     MajMap(myPbase,theDPrism,myMap,myFShape,myLShape);
-    
+
     // Make systematically dprism 
     myGShape = VraiDPrism;
     GeneratedShapeValid();
 
-  // management of gluing faces 
-    //SetGluedFaces(TopoDS_Face(), // on ne veut pas binder mySkface
-       //        mySbase, myPbase, mySlface, theDPrism, myGluedF);
+    // management of gluing faces 
+    //   mySbase, myPbase, mySlface, theDPrism, myGluedF);
     GluedFacesValid();
     theDPrism.Curves(myCurves);
     myBCurve = theDPrism.BarycCurve();
@@ -603,13 +527,13 @@ void BRepFeat_MakeDPrism::Perform(const TopoDS_Shape& From,
     //direction of dprism
     if (ASI1.IsDone() && ASI1.NbPoints(1) >=1) {
       if (myFuse == 1) {
-       OrU = ASI1.Point(1,1).Orientation();
+        OrU = ASI1.Point(1,1).Orientation();
       }
       else {
-       OrU = ASI1.Point(1,ASI1.NbPoints(1)).Orientation();
+        OrU = ASI1.Point(1,ASI1.NbPoints(1)).Orientation();
       }
-//      Standard_Real prm = ASI1.Point(1,1).Parameter();
-//      if(prm < 0) OrU = TopAbs::Reverse(OrU);
+      //      Standard_Real prm = ASI1.Point(1,1).Parameter();
+      //      if(prm < 0) OrU = TopAbs::Reverse(OrU);
       FUntil = ASI1.Point(1,1).Face();
     }
     else {
@@ -619,7 +543,7 @@ void BRepFeat_MakeDPrism::Perform(const TopoDS_Shape& From,
     }
     if (ASI2.IsDone() && ASI2.NbPoints(1) >=1) {
       OrF = ASI2.Point(1,1).Orientation();
-//      Standard_Real prm = ASI2.Point(1,1).Parameter();
+      //      Standard_Real prm = ASI2.Point(1,1).Parameter();
       OrF = TopAbs::Reverse(OrF);
       FFrom = ASI2.Point(1,1).Face();
     }
@@ -689,7 +613,7 @@ void BRepFeat_MakeDPrism::Perform(const TopoDS_Shape& From,
 
 void BRepFeat_MakeDPrism::PerformUntilEnd()
 {  
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeDPrism::PerformUntilEnd()" << endl;
 #endif 
@@ -701,7 +625,7 @@ void BRepFeat_MakeDPrism::PerformUntilEnd()
   mySFrom.Nullify();
   ShapeFromValid();
   Standard_Real Height = HeightMax(mySbase, mySkface, mySFrom, mySUntil);
-//  myPbase.Orientation(TopAbs_FORWARD);
+  //  myPbase.Orientation(TopAbs_FORWARD);
 
   LocOpe_DPrism theDPrism(myPbase, Height, myAngle);  
   TopoDS_Shape VraiDPrism = theDPrism.Shape();
@@ -723,7 +647,7 @@ void BRepFeat_MakeDPrism::PerformUntilEnd()
 
 void BRepFeat_MakeDPrism::PerformFromEnd(const TopoDS_Shape& Until)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeDPrism::PerformFromEnd(From,Until)" << endl;
 #endif
@@ -739,7 +663,7 @@ void BRepFeat_MakeDPrism::PerformFromEnd(const TopoDS_Shape& Until)
   if (!exp.More()) {
     Standard_ConstructionError::Raise();
   }
-//  myPbase.Orientation(TopAbs_FORWARD);
+  //  myPbase.Orientation(TopAbs_FORWARD);
   myPerfSelection = BRepFeat_SelectionShU;
   PerfSelectionValid();
   mySFrom.Nullify();
@@ -802,23 +726,23 @@ void BRepFeat_MakeDPrism::PerformFromEnd(const TopoDS_Shape& Until)
       OrF = ASI2.Point(1,1).Orientation();
       OrF = TopAbs::Reverse(OrF);        
       for(Standard_Integer iii = 1; iii <= jj; iii++) {
-       if(ASI2.Point(1,iii).Parameter() < prm) {
-         prm = ASI2.Point(1,iii).Parameter();
-         FFrom = ASI2.Point(1, iii).Face(); 
-         OrF = ASI2.Point(1,iii).Orientation();
-         OrF = TopAbs::Reverse(OrF);     
-       }
+        if(ASI2.Point(1,iii).Parameter() < prm) {
+          prm = ASI2.Point(1,iii).Parameter();
+          FFrom = ASI2.Point(1, iii).Face(); 
+          OrF = ASI2.Point(1,iii).Orientation();
+          OrF = TopAbs::Reverse(OrF);    
+        }
       }
       Handle(Geom_Surface) S = BRep_Tool::Surface(FFrom);
       if (S->DynamicType() == 
-         STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
-       S = Handle(Geom_RectangularTrimmedSurface)::
-         DownCast(S)->BasisSurface();
+        STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
+          S = Handle(Geom_RectangularTrimmedSurface)::
+            DownCast(S)->BasisSurface();
       }
       BRepLib_MakeFace fac(S, Precision::Confusion());
       mySFrom = fac.Face();  
       Trf = TransformShapeFU(0);
-//      FFrom = TopoDS::Face(mySFrom);      
+      //      FFrom = TopoDS::Face(mySFrom);      
     }
 
     TopoDS_Shape Comp;
@@ -882,7 +806,7 @@ void BRepFeat_MakeDPrism::PerformFromEnd(const TopoDS_Shape& Until)
 
 void BRepFeat_MakeDPrism::PerformThruAll()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeDPrism::PerformThruAll()" << endl;
 #endif
@@ -898,7 +822,7 @@ void BRepFeat_MakeDPrism::PerformThruAll()
   }
 
   PerfSelectionValid();
-//  myPbase.Orientation(TopAbs_FORWARD);
+  //  myPbase.Orientation(TopAbs_FORWARD);
   myGluedF.Clear();
   GluedFacesValid();
 
@@ -938,9 +862,9 @@ void BRepFeat_MakeDPrism::PerformThruAll()
 //=======================================================================
 
 void BRepFeat_MakeDPrism::PerformUntilHeight(const TopoDS_Shape& Until,
-                                            const Standard_Real Height)
+  const Standard_Real Height)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeDPrism::PerformUntilHeight(Until,Height)" << endl;
 #endif
@@ -954,7 +878,7 @@ void BRepFeat_MakeDPrism::PerformUntilHeight(const TopoDS_Shape& Until,
   if (!exp.More()) {
     Standard_ConstructionError::Raise();
   }
-//  myPbase.Orientation(TopAbs_FORWARD);
+  //  myPbase.Orientation(TopAbs_FORWARD);
   myGluedF.Clear();
   myPerfSelection = BRepFeat_NoSelection;
   PerfSelectionValid();
@@ -983,10 +907,7 @@ void BRepFeat_MakeDPrism::PerformUntilHeight(const TopoDS_Shape& Until,
       return;
     }
 
-    //SetGluedFaces(mySkface, mySbase, theBase, mySlface, theDPrism, myGluedF);
     GluedFacesValid();
-//    VerifGluedFaces(mySkface, theBase, myBCurve, myCurves, theDPrism, myGluedF);
-
     theDPrism.Curves(myCurves);
     myBCurve = theDPrism.BarycCurve();
     GlobalPerform();
@@ -1008,13 +929,13 @@ void BRepFeat_MakeDPrism::PerformUntilHeight(const TopoDS_Shape& Until,
     TopAbs_Orientation Or;
     if (ASI.IsDone() && ASI.NbPoints(1) >=1) {
       if (myFuse == 1) {
-       Or = ASI.Point(1,1).Orientation();
+        Or = ASI.Point(1,1).Orientation();
       }
       else {
-       Or = ASI.Point(1,ASI.NbPoints(1)).Orientation();
+        Or = ASI.Point(1,ASI.NbPoints(1)).Orientation();
       }
-//      Standard_Real prm = ASI.Point(1,1).Parameter();
-//      if(prm < 0) Or = TopAbs::Reverse(Or);
+      //      Standard_Real prm = ASI.Point(1,1).Parameter();
+      //      if(prm < 0) Or = TopAbs::Reverse(Or);
       TopoDS_Face FUntil = ASI.Point(1,1).Face();
       TopoDS_Shape Comp;
       BRep_Builder B;
@@ -1026,30 +947,30 @@ void BRepFeat_MakeDPrism::PerformUntilHeight(const TopoDS_Shape& Until,
       BRepAlgoAPI_Cut trP(VraiDPrism,Comp);
       //modified by NIZNHY-PKV Thu Mar 21 17:47:21 2002 t
       if(myFuse == 1) {
-       //modified by NIZNHY-PKV Thu Mar 21 17:47:42 2002 f
-       //BRepAlgo_Fuse f(mySbase, trP.Shape());
-       //myShape = f.Shape();
-       //UpdateDescendants(f.Builder(), myShape, Standard_False);
-       BRepAlgoAPI_Fuse f(mySbase, trP.Shape());
-       myShape = f.Shape();
-       UpdateDescendants(f, myShape, Standard_False);
-       //modified by NIZNHY-PKV Thu Mar 21 17:47:49 2002 t
-       Done();
+        //modified by NIZNHY-PKV Thu Mar 21 17:47:42 2002 f
+        //BRepAlgo_Fuse f(mySbase, trP.Shape());
+        //myShape = f.Shape();
+        //UpdateDescendants(f.Builder(), myShape, Standard_False);
+        BRepAlgoAPI_Fuse f(mySbase, trP.Shape());
+        myShape = f.Shape();
+        UpdateDescendants(f, myShape, Standard_False);
+        //modified by NIZNHY-PKV Thu Mar 21 17:47:49 2002 t
+        Done();
       }
       else if(myFuse == 0) {
-       //modified by NIZNHY-PKV Thu Mar 21 17:48:18 2002 f
-       //BRepAlgo_Cut c(mySbase, trP.Shape());
-       //myShape = c.Shape();
-       //UpdateDescendants(c.Builder(), myShape, Standard_False);
-       BRepAlgoAPI_Cut c(mySbase, trP.Shape());
-       myShape = c.Shape();
-       UpdateDescendants(c, myShape, Standard_False);
-       //modified by NIZNHY-PKV Thu Mar 21 17:48:26 2002 t
-       Done();
+        //modified by NIZNHY-PKV Thu Mar 21 17:48:18 2002 f
+        //BRepAlgo_Cut c(mySbase, trP.Shape());
+        //myShape = c.Shape();
+        //UpdateDescendants(c.Builder(), myShape, Standard_False);
+        BRepAlgoAPI_Cut c(mySbase, trP.Shape());
+        myShape = c.Shape();
+        UpdateDescendants(c, myShape, Standard_False);
+        //modified by NIZNHY-PKV Thu Mar 21 17:48:26 2002 t
+        Done();
       }
       else {
-       myShape = trP.Shape();
-       Done(); 
+        myShape = trP.Shape();
+        Done();        
       }
     }             
   }
@@ -1074,7 +995,7 @@ void BRepFeat_MakeDPrism::Curves(TColGeom_SequenceOfCurve& scur)
 //============================================================================
 void BRepFeat_MakeDPrism::BossEdges (const Standard_Integer signature) 
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
   if (trc) cout << "BRepFeat_MakeDPrism::BossEdges (integer)" << endl;
 #endif
@@ -1100,61 +1021,60 @@ void BRepFeat_MakeDPrism::BossEdges (const Standard_Integer signature)
       myTopEdges.Append(EE);  
     }
   }
-  
+
   // Edges Bottom    
   if (signature < 0) {
-// Attention check if TgtEdges is important
+    // Attention check if TgtEdges is important
     myLatEdges = NewEdges();
   }
   else if (signature > 0) {
     if ( !myShape.IsNull() ) {
       TopTools_MapOfShape MapE;
       Standard_Boolean Found;
-      
+
       TopExp_Explorer ExpF;
       for (ExpF.Init(myShape,TopAbs_FACE);ExpF.More();ExpF.Next()) {
-       Found = Standard_False;
-       const TopoDS_Face& FF = TopoDS::Face(ExpF.Current());   
-       for (itLS.Initialize(theLastShape);itLS.More();itLS.Next()) {
-         const TopoDS_Face& TopFace = TopoDS::Face(itLS.Value());
-         if (!FF.IsSame(TopFace)) {
-           TopExp_Explorer ExpE;
-           for (ExpE.Init(FF,TopAbs_EDGE);ExpE.More() && !Found ;ExpE.Next()) {
-             const TopoDS_Edge& E1 = TopoDS::Edge(ExpE.Current());
-             TopoDS_Vertex V1,V2;
-             TopExp::Vertices (E1,V1,V2);
-             TopTools_ListIteratorOfListOfShape it(myTopEdges);
-             for (;it.More() && !Found ; it.Next()) {
-               TopoDS_Edge E2 = TopoDS::Edge(it.Value());
-               TopoDS_Vertex VT1,VT2;
-               TopExp::Vertices (E2,VT1,VT2);
-               
-               if (V1.IsSame(VT1) || V1.IsSame(VT2) || V2.IsSame(VT1) || V2.IsSame(VT2)) {
-                 Found = Standard_True;
-                 TopExp_Explorer ExpE2;
-                 for (ExpE2.Init(FF,TopAbs_EDGE);ExpE2.More();ExpE2.Next()) {
-                   const TopoDS_Edge& E3 = TopoDS::Edge(ExpE2.Current());
-                   if (MapE.Contains(E3)) { 
-                     MapE.Remove(E3); }
-                   else  {
-                     MapE.Add(E3);}
-                 }
-               }
-             }
-           }
-         }
-       }
+        Found = Standard_False;
+        const TopoDS_Face& FF = TopoDS::Face(ExpF.Current());  
+        for (itLS.Initialize(theLastShape);itLS.More();itLS.Next()) {
+          const TopoDS_Face& TopFace = TopoDS::Face(itLS.Value());
+          if (!FF.IsSame(TopFace)) {
+            for (ExpE.Init(FF,TopAbs_EDGE);ExpE.More() && !Found ;ExpE.Next()) {
+              const TopoDS_Edge& E1 = TopoDS::Edge(ExpE.Current());
+              TopoDS_Vertex V1,V2;
+              TopExp::Vertices (E1,V1,V2);
+              TopTools_ListIteratorOfListOfShape it(myTopEdges);
+              for (;it.More() && !Found ; it.Next()) {
+                TopoDS_Edge E2 = TopoDS::Edge(it.Value());
+                TopoDS_Vertex VT1,VT2;
+                TopExp::Vertices (E2,VT1,VT2);
+
+                if (V1.IsSame(VT1) || V1.IsSame(VT2) || V2.IsSame(VT1) || V2.IsSame(VT2)) {
+                  Found = Standard_True;
+                  TopExp_Explorer ExpE2;
+                  for (ExpE2.Init(FF,TopAbs_EDGE);ExpE2.More();ExpE2.Next()) {
+                    const TopoDS_Edge& E3 = TopoDS::Edge(ExpE2.Current());
+                    if (MapE.Contains(E3)) { 
+                      MapE.Remove(E3); }
+                    else  {
+                      MapE.Add(E3);}
+                  }
+                }
+              }
+            }
+          }
+        }
       }
-    
+
       TopTools_ListIteratorOfListOfShape it(myTopEdges);
       for (;it.More() ; it.Next()) {
-       if (MapE.Contains(it.Value())) {MapE.Remove(it.Value()); }
+        if (MapE.Contains(it.Value())) {MapE.Remove(it.Value()); }
       }
-      
+
       TopTools_MapIteratorOfMapOfShape itMap;
       for (itMap.Initialize(MapE);itMap.More();itMap.Next()) {
-       if (!BRep_Tool::Degenerated(TopoDS::Edge(itMap.Key())))
-         myLatEdges.Append(itMap.Key());
+        if (!BRep_Tool::Degenerated(TopoDS::Edge(itMap.Key())))
+          myLatEdges.Append(itMap.Key());
       }
     }
   }
@@ -1197,9 +1117,9 @@ Handle(Geom_Curve) BRepFeat_MakeDPrism::BarycCurve()
 //=======================================================================
 
 static Standard_Real HeightMax(const TopoDS_Shape& theSbase,  // shape initial
-                              const TopoDS_Face&  theSkface, // face de sketch
-                              const TopoDS_Shape& theSFrom,  // shape from
-                              const TopoDS_Shape& theSUntil) // shape until
+  const TopoDS_Face&  theSkface, // face de sketch
+  const TopoDS_Shape& theSFrom,  // shape from
+  const TopoDS_Shape& theSUntil) // shape until
 {
   Bnd_Box Box;
   BRepBndLib::Add(theSbase,Box);
@@ -1213,19 +1133,19 @@ static Standard_Real HeightMax(const TopoDS_Shape& theSbase,  // shape initial
   Standard_Real c[6];
 
   Box.Get(c[0],c[2],c[4],c[1],c[3],c[5]);
-//  Standard_Real parmin=c[0], parmax = c[0];
-//  for(Standard_Integer i = 0 ; i < 6; i++) {
-//    if(c[i] > parmax) parmax = c[i];
-//    if(c[i] < parmin ) parmin = c[i];    
-//  }
-//  Standard_Real Height = abs(2.*(parmax - parmin));
-//  return(2.*Height);
-//#ifndef DEB
+  //  Standard_Real parmin=c[0], parmax = c[0];
+  //  for(Standard_Integer i = 0 ; i < 6; i++) {
+  //    if(c[i] > parmax) parmax = c[i];
+  //    if(c[i] < parmin ) parmin = c[i];    
+  //  }
+  //  Standard_Real Height = abs(2.*(parmax - parmin));
+  //  return(2.*Height);
+  //#ifndef OCCT_DEBUG
   Standard_Real par = Max(  Max( fabs(c[1] - c[0]), fabs(c[3] - c[2]) ), fabs(c[5] - c[4]) );
-//#else
-//  Standard_Real par = Max(  Max( abs(c[1] - c[0]), abs(c[3] - c[2]) ), abs(c[5] - c[4]) );
-//#endif
-#ifdef DEB
+  //#else
+  //  Standard_Real par = Max(  Max( abs(c[1] - c[0]), abs(c[3] - c[2]) ), abs(c[5] - c[4]) );
+  //#endif
+#ifdef OCCT_DEBUG
   cout << "Height = > " <<  par  << endl;
 #endif
   return par;
@@ -1235,12 +1155,12 @@ static Standard_Real HeightMax(const TopoDS_Shape& theSbase,  // shape initial
 
 
 
- //=======================================================================
+//=======================================================================
 //function : SensOfPrism
 //purpose  : determine the direction of prism generation
 //=======================================================================
 Standard_Integer SensOfPrism(const Handle(Geom_Curve) C,
-                            const TopoDS_Shape& Until)
+  const TopoDS_Shape& Until)
 {
   LocOpe_CSIntersector ASI1(Until);
   TColGeom_SequenceOfCurve scur;
@@ -1256,141 +1176,22 @@ Standard_Integer SensOfPrism(const Handle(Geom_Curve) C,
     }
   }
   else if(BRepFeat::ParametricBarycenter(Until,C) < 0) {
-      sens = -1;
+    sens = -1;
   }
   else {}
   return sens;
 }
 
-
- //=======================================================================
-//function : SetGluedFaces
-//purpose  : 
-//=======================================================================
-
-static void SetGluedFaces(const TopoDS_Face& theSkface,
-                         const TopoDS_Shape& theSbase,
-                         const TopoDS_Shape& thePbase,
-                         const TopTools_DataMapOfShapeListOfShape& theSlmap,
-                         LocOpe_DPrism& theDPrism,
-                         TopTools_DataMapOfShapeShape& theMap)
-{
-  TopExp_Explorer exp;
-  if (!theSkface.IsNull() && thePbase.ShapeType() == TopAbs_FACE) {
-    for (exp.Init(theSbase,TopAbs_FACE); exp.More(); exp.Next()) {
-      if (exp.Current().IsSame(theSkface)) {
-       theMap.Bind(thePbase,theSkface);
-       break;
-      }
-    }
-  }
-  else {
-    TopExp_Explorer exp2;
-    for (exp.Init(thePbase,TopAbs_FACE);exp.More();exp.Next()) {
-      const TopoDS_Face& fac = TopoDS::Face(exp.Current());
-      for (exp2.Init(theSbase,TopAbs_FACE);exp2.More();exp2.Next()) {
-       if (exp2.Current().IsSame(fac)) {
-         theMap.Bind(fac,fac);
-         break;
-       }
-      }
-    }
-  }
-
-  // Sliding
-  TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itm(theSlmap);
-  if(!theSlmap.IsEmpty()) {
-    for (; itm.More(); itm.Next()) {
-      const TopoDS_Face& fac = TopoDS::Face(itm.Key());
-      const TopTools_ListOfShape& ledg = itm.Value();
-      for (TopTools_ListIteratorOfListOfShape it(ledg); it.More(); it.Next()) {
-       const TopTools_ListOfShape& gfac = theDPrism.Shapes(it.Value());
-       if (gfac.Extent() != 1) {
-#ifdef DEB
-         Standard_Boolean trc = BRepFeat_GettraceFEAT();
-         if (trc) cout << " BRepFeat_MakeDPrism : Pb SetGluedFace" << endl;
-#endif
-       }
-       theMap.Bind(gfac.First(),fac);
-      }
-    }
-  }
-}
-
-
-//=======================================================================
-//function : VerifGluedFaces
-//purpose  : Checking intersection Tool/theSkface = thePbase
-//           if yes -> OK if no -> case without gluing
-//=======================================================================
-#ifdef DEB
-static void VerifGluedFaces(const TopoDS_Face& theSkface,
-                           const TopoDS_Shape& thePbase,
-                           Handle(Geom_Curve)& theBCurve,
-                           TColGeom_SequenceOfCurve& theCurves,
-                           LocOpe_DPrism& theDPrism,
-                           TopTools_DataMapOfShapeShape& theMap)
-{
-  Standard_Boolean GluedFaces = Standard_True;
-  TopoDS_Shape VraiDPrism = theDPrism.Shape();
-  
-  TColGeom_SequenceOfCurve scur;
-  theDPrism.Curves(theCurves);
-  theBCurve = theDPrism.BarycCurve();    
-  scur.Clear();    
-  scur.Append(theBCurve);
-  LocOpe_CSIntersector ASI(theSkface);
-  ASI.Perform(scur);
-  if (ASI.IsDone() && ASI.NbPoints(1) >=1) {
-    TopAbs_Orientation Or = ASI.Point(1,1).Orientation();
-    TopoDS_Face FSk = ASI.Point(1,1).Face();
-    TopoDS_Shape Comp;
-    BRep_Builder B;
-    B.MakeCompound(TopoDS::Compound(Comp));
-    TopoDS_Solid S = BRepFeat::Tool(theSkface, FSk, Or);
-    if (!S.IsNull()) B.Add(Comp,S);
-    //modified by NIZNHY-PKV Thu Mar 21 17:48:45 2002 f
-    //BRepAlgo_Cut trP(VraiDPrism,Comp);
-    BRepAlgoAPI_Cut trP(VraiDPrism,Comp);
-    //modified by NIZNHY-PKV Thu Mar 21 17:48:49 2002 t
-    TopoDS_Shape Cutsh = trP.Shape();
-    TopExp_Explorer ex(Cutsh, TopAbs_SOLID);
-    for(; ex.More(); ex.Next()) {
-      TopExp_Explorer ex1(ex.Current(), TopAbs_FACE);
-      for(; ex1.More(); ex1.Next()) {
-       const TopoDS_Face& fac1 = TopoDS::Face(ex1.Current());
-       TopExp_Explorer ex2(thePbase, TopAbs_FACE);
-       for(; ex2.More(); ex2.Next()) {
-         const TopoDS_Face& fac2 = TopoDS::Face(ex2.Current());
-         if(fac1.IsSame(fac2)) break;
-       }
-       if (ex2.More()) break;
-      }
-      if (ex1.More()) continue;
-      GluedFaces = Standard_False;
-      break;
-    }
-    if (!GluedFaces) {
-#ifdef DEB
-      Standard_Boolean trc = BRepFeat_GettraceFEAT();
-      if (trc) cout << " Intersection DPrism/skface : no gluing" << endl;
-#endif
-      theMap.Clear();
-    }
-  }
-}
-#endif
-
 //=======================================================================
 //function : MajMap
 //purpose  : 
 //=======================================================================
 
 static void MajMap(const TopoDS_Shape& theB,
-                  const LocOpe_DPrism& theP,
-                  TopTools_DataMapOfShapeListOfShape& theMap, // myMap
-                  TopoDS_Shape& theFShape,  // myFShape
-                  TopoDS_Shape& theLShape) // myLShape
+  const LocOpe_DPrism& theP,
+  TopTools_DataMapOfShapeListOfShape& theMap, // myMap
+  TopoDS_Shape& theFShape,  // myFShape
+  TopoDS_Shape& theLShape) // myLShape
 {
   TopExp_Explorer exp;
   if(!theP.FirstShape().IsNull()) {    
@@ -1400,11 +1201,11 @@ static void MajMap(const TopoDS_Shape& theB,
       TopTools_ListOfShape thelist;
       theMap.Bind(theFShape, thelist);
       for (exp.Init(theP.FirstShape(),TopAbs_FACE);exp.More();exp.Next()) {
-       theMap(theFShape).Append(exp.Current());
+        theMap(theFShape).Append(exp.Current());
       }
     }
   }
-  
+
   if(!theP.LastShape().IsNull()) {    
     exp.Init(theP.LastShape(),TopAbs_WIRE);
     if (exp.More()) {
@@ -1412,7 +1213,7 @@ static void MajMap(const TopoDS_Shape& theB,
       TopTools_ListOfShape thelist1;
       theMap.Bind(theLShape, thelist1);
       for (exp.Init(theP.LastShape(),TopAbs_FACE);exp.More();exp.Next()) {
-       theMap(theLShape).Append(exp.Current());
+        theMap(theLShape).Append(exp.Current());
       }
     }
   }
@@ -1460,70 +1261,3 @@ static Handle(Geom_Curve) TestCurve(const TopoDS_Face& Base)
   return theLin;
 }
 
-
-
-
-
-//=======================================================================
-//function : ToFuse
-//purpose  : 
-//=======================================================================
-
-Standard_Boolean ToFuse(const TopoDS_Face& F1,
-                       const TopoDS_Face& F2)
-{
-  if (F1.IsNull() || F2.IsNull()) {
-    return Standard_False;
-  }
-
-  Handle(Geom_Surface) S1,S2;
-  TopLoc_Location loc1, loc2;
-  Handle(Standard_Type) typS1,typS2;
-  const Standard_Real tollin = Precision::Confusion();
-  const Standard_Real tolang = Precision::Angular();
-
-  S1 = BRep_Tool::Surface(F1,loc1);
-  S2 = BRep_Tool::Surface(F2,loc2);
-
-  typS1 = S1->DynamicType();
-  typS2 = S2->DynamicType();
-
-  if (typS1 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
-    S1 =  (*((Handle(Geom_RectangularTrimmedSurface)*)&S1))->BasisSurface();
-    typS1 = S1->DynamicType();
-  }
-
-  if (typS2 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
-    S2 =  (*((Handle(Geom_RectangularTrimmedSurface)*)&S2))->BasisSurface();
-    typS2 = S2->DynamicType();
-  }
-
-  if (typS1 != typS2) {
-    return Standard_False;
-  }
-
-
-  Standard_Boolean ValRet = Standard_False;
-  if (typS1 == STANDARD_TYPE(Geom_Plane)) {
-    S1 = BRep_Tool::Surface(F1);  // to apply the location.
-    S2 = BRep_Tool::Surface(F2);
-    gp_Pln pl1( (*((Handle(Geom_Plane)*)&S1))->Pln());
-    gp_Pln pl2( (*((Handle(Geom_Plane)*)&S2))->Pln());
-
-    if (pl1.Position().IsCoplanar(pl2.Position(),tollin,tolang)) {
-      ValRet = Standard_True;
-    }
-  }
-
-  return ValRet;
-}
-
-
-
-
-
-
-
-
-
-