0031035: Coding - uninitialized class fields reported by Visual Studio Code Analysis
[occt.git] / src / BRepFeat / BRepFeat_MakeRevol.cxx
index b2f4c29..1f93310 100644 (file)
 // Alternatively, this file may be used under the terms of Open CASCADE
 // commercial license or contractual agreement.
 
-#include <BRepFeat_MakeRevol.ixx>
 
-#include <BRepFeat.hxx>
-#include <LocOpe.hxx>
-#include <LocOpe_Revol.hxx>
-#include <LocOpe_Gluer.hxx>
-#include <LocOpe_FindEdges.hxx>
-#include <LocOpe_SequenceOfCirc.hxx>
-#include <LocOpe_BuildShape.hxx>
-#include <LocOpe_CSIntersector.hxx>
-#include <LocOpe_PntFace.hxx>
-
-#include <gp_Vec.hxx>
-#include <gp_Pnt.hxx>
-#include <gp_Ax1.hxx>
-#include <gp_Pnt2d.hxx>
-#include <TColgp_SequenceOfPnt.hxx>
-#include <Geom_Surface.hxx>
-#include <Geom_Curve.hxx>
-#include <Geom_Circle.hxx>
-#include <Geom2d_Curve.hxx>
-#include <Geom_RectangularTrimmedSurface.hxx>
 #include <Bnd_Box.hxx>
-
-#include <BRepSweep_Revol.hxx>
 #include <BRep_Builder.hxx>
 #include <BRep_Tool.hxx>
-#include <TopExp_Explorer.hxx>
-#include <TopTools_MapOfShape.hxx>
-#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
-#include <TopTools_MapIteratorOfMapOfShape.hxx>
-#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
-
 #include <BRepAlgoAPI_Cut.hxx>
 #include <BRepAlgoAPI_Fuse.hxx>
-
+#include <BRepBndLib.hxx>
+#include <BRepBuilderAPI.hxx>
+#include <BRepFeat.hxx>
+#include <BRepFeat_MakeRevol.hxx>
 #include <BRepLib_MakeFace.hxx>
+#include <BRepSweep_Revol.hxx>
 #include <BRepTools_Modifier.hxx>
 #include <BRepTools_TrsfModification.hxx>
-
+#include <ElCLib.hxx>
+#include <Geom2d_Curve.hxx>
+#include <Geom_Circle.hxx>
+#include <Geom_Curve.hxx>
+#include <Geom_Plane.hxx>
+#include <Geom_RectangularTrimmedSurface.hxx>
+#include <Geom_Surface.hxx>
+#include <gp_Ax1.hxx>
+#include <gp_Pln.hxx>
+#include <gp_Pnt.hxx>
+#include <gp_Pnt2d.hxx>
+#include <gp_Vec.hxx>
+#include <LocOpe.hxx>
+#include <LocOpe_BuildShape.hxx>
+#include <LocOpe_CSIntersector.hxx>
+#include <LocOpe_FindEdges.hxx>
+#include <LocOpe_Gluer.hxx>
+#include <LocOpe_PntFace.hxx>
+#include <LocOpe_Revol.hxx>
+#include <LocOpe_SequenceOfCirc.hxx>
+#include <Precision.hxx>
 #include <Standard_ConstructionError.hxx>
-
-#include <TopoDS_Solid.hxx>
+#include <TColgp_SequenceOfPnt.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.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_MapOfShape.hxx>
 
-#include <gp_Pln.hxx>
-#include <Geom_Plane.hxx>
-
-
-#include <TopExp.hxx>
-#include <Precision.hxx>
-#include <BRepBndLib.hxx>
-#include <BRepBuilderAPI.hxx>
-#include <BRepFeat.hxx>
-
-#include <ElCLib.hxx>
-
-#ifdef DEB
+#ifdef OCCT_DEBUG
 extern Standard_Boolean BRepFeat_GettraceFEAT();
 #endif
 
 static void MajMap(const TopoDS_Shape&, // base
-                  const LocOpe_Revol&,
-                  TopTools_DataMapOfShapeListOfShape&, // myMap
-                  TopoDS_Shape&,  // myFShape
-                  TopoDS_Shape&); // myLShape
+  const LocOpe_Revol&,
+  TopTools_DataMapOfShapeListOfShape&, // myMap
+  TopoDS_Shape&,  // myFShape
+  TopoDS_Shape&); // myLShape
 
 
 static void VerifGluedFaces(const TopoDS_Face& theSkface,
-                           const TopoDS_Shape& thePbase,
-                           Handle(Geom_Curve)& theBCurve,
-                           TColGeom_SequenceOfCurve& theCurves,
-                           LocOpe_Revol& theRevol,
-                           TopTools_DataMapOfShapeShape& theMap);
+  const TopoDS_Shape& thePbase,
+  Handle(Geom_Curve)& theBCurve,
+  TColGeom_SequenceOfCurve& theCurves,
+  LocOpe_Revol& theRevol,
+  TopTools_DataMapOfShapeShape& theMap);
 
 
 static Standard_Boolean ToFuse(const TopoDS_Face& ,
-                              const TopoDS_Face&);
+  const TopoDS_Face&);
 
 
 
@@ -104,15 +96,15 @@ static Standard_Boolean ToFuse(const TopoDS_Face& ,
 //=======================================================================
 
 void BRepFeat_MakeRevol::Init(const TopoDS_Shape& Sbase,
-                             const TopoDS_Shape& Pbase,
-                             const TopoDS_Face& Skface,
-                             const gp_Ax1& Axis,
-                             const Standard_Integer Mode,
-                             const Standard_Boolean Modify)
+  const TopoDS_Shape& Pbase,
+  const TopoDS_Face& Skface,
+  const gp_Ax1& Axis,
+  const Standard_Integer Mode,
+  const Standard_Boolean Modify)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
-  if (trc) cout << "BRepFeat_MakeRevol::Init" << endl;
+  if (trc) std::cout << "BRepFeat_MakeRevol::Init" << std::endl;
 #endif
   myAxis   = Axis;
   myPbase  = Pbase;
@@ -140,7 +132,7 @@ void BRepFeat_MakeRevol::Init(const TopoDS_Shape& Sbase,
   myJustGluer = Standard_False;
 
   //-------------- ifv
-//  mySkface.Nullify();
+  //  mySkface.Nullify();
   //-------------- ifv
 
 
@@ -154,12 +146,12 @@ void BRepFeat_MakeRevol::Init(const TopoDS_Shape& Sbase,
     myMap.Bind(exp.Current(), thelist);
     myMap(exp.Current()).Append(exp.Current());
   }
-#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;
+    if (myJustFeat)  std::cout << " Just Feature" << std::endl;
+    if (myFuse)  std::cout << " Fuse" << std::endl;
+    if (!myFuse)  std::cout << " Cut" << std::endl;
+    if (!myModify) std::cout << " Modify = 0" << std::endl;
   }
 #endif 
 }
@@ -171,11 +163,11 @@ void BRepFeat_MakeRevol::Init(const TopoDS_Shape& Sbase,
 //=======================================================================
 
 void BRepFeat_MakeRevol::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_MakeRevol::Add(Edge,face)" << endl;
+  if (trc) std::cout << "BRepFeat_MakeRevol::Add(Edge,face)" << std::endl;
 #endif
   TopExp_Explorer exp;
   for (exp.Init(mySbase,TopAbs_FACE);exp.More();exp.Next()) {
@@ -184,7 +176,7 @@ void BRepFeat_MakeRevol::Add(const TopoDS_Edge& E,
     }
   }
   if (!exp.More()) {
-    Standard_ConstructionError::Raise();
+    throw Standard_ConstructionError();
   }
 
   for (exp.Init(myPbase,TopAbs_EDGE);exp.More();exp.Next()) {
@@ -193,7 +185,7 @@ void BRepFeat_MakeRevol::Add(const TopoDS_Edge& E,
     }
   }
   if (!exp.More()) {
-    Standard_ConstructionError::Raise();
+    throw Standard_ConstructionError();
   }
 
   if (!mySlface.IsBound(F)) {
@@ -219,9 +211,9 @@ void BRepFeat_MakeRevol::Add(const TopoDS_Edge& E,
 
 void BRepFeat_MakeRevol::Perform(const Standard_Real Angle)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
-  if (trc) cout << "BRepFeat_MakeRevol::Perform(Angle)" << endl;
+  if (trc) std::cout << "BRepFeat_MakeRevol::Perform(Angle)" << std::endl;
 #endif
   mySFrom.Nullify();
   ShapeFromValid();
@@ -237,13 +229,13 @@ void BRepFeat_MakeRevol::Perform(const Standard_Real Angle)
   if(RevolComp) {
     /*
     if (!mySkface.IsNull() || !mySlface.IsEmpty()) {
-      for (exp.Init(mySbase,TopAbs_FACE); exp.More(); exp.Next()) {
-       if (exp.Current().IsSame(mySkface)) {
-         angledec = M_PI/5; // pourquoi pas
-         if (myFuse) angledec = -angledec;
-         break;
-       }
-      }
+    for (exp.Init(mySbase,TopAbs_FACE); exp.More(); exp.Next()) {
+    if (exp.Current().IsSame(mySkface)) {
+    angledec = M_PI/5; // pourquoi pas
+    if (myFuse) angledec = -angledec;
+    break;
+    }
+    }
     }
     */
     mySkface.Nullify();
@@ -252,7 +244,7 @@ void BRepFeat_MakeRevol::Perform(const Standard_Real Angle)
   else theRevol.Perform(myPbase, myAxis, Angle, angledec);
 
   TopoDS_Shape VraiRevol = theRevol.Shape();
-  
+
   MajMap(myPbase,theRevol,myMap,myFShape,myLShape);
 
   myGShape = VraiRevol;
@@ -268,32 +260,32 @@ void BRepFeat_MakeRevol::Perform(const Standard_Real Angle)
   }
 
   TopoDS_Face FFace;
-  
+
   Standard_Boolean found = Standard_False;
 
   if(!mySkface.IsNull() || !mySlface.IsEmpty()) {
     if(myLShape.ShapeType() == TopAbs_WIRE) {
       TopExp_Explorer ex1(VraiRevol, 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 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());
+
+    TopExp_Explorer anExp(mySbase, TopAbs_FACE);
+    for(; anExp.More(); anExp.Next()) {
+      const TopoDS_Face& ff = TopoDS::Face(anExp.Current());
       if(ToFuse(ff, FFace)) {
-       TopTools_DataMapOfShapeListOfShape sl;
-       if(!FFace.IsSame(myPbase) && BRepFeat::IsInside(ff, FFace)) 
-       break;
+        TopTools_DataMapOfShapeListOfShape sl;
+        if(!FFace.IsSame(myPbase) && BRepFeat::IsInside(ff, FFace)) 
+          break;
       }
     }
   }
@@ -304,25 +296,15 @@ void BRepFeat_MakeRevol::Perform(const Standard_Real Angle)
 
   if(myGluedF.IsEmpty()) {
     if(myFuse == 1) {
-      //modified by NIZNHY-PKV Thu Mar 21 18:15:06 2002 f
-      //BRepAlgo_Fuse f(mySbase, myGShape);
-      //myShape = f.Shape();
-      //UpdateDescendants(f.Builder(), myShape, Standard_False);
       BRepAlgoAPI_Fuse f(mySbase, myGShape);
       myShape = f.Shape();
       UpdateDescendants(f, myShape, Standard_False);
-      //modified by NIZNHY-PKV Thu Mar 21 18:15:11 2002 t
       Done();
     }
     else if(myFuse == 0) {
-      //modified by NIZNHY-PKV Thu Mar 21 18:15:37 2002 f
-      //BRepAlgo_Cut c(mySbase, myGShape);
-      //myShape = c.Shape();
-      //UpdateDescendants(c.Builder(), myShape, Standard_False);
       BRepAlgoAPI_Cut c(mySbase, myGShape);
       myShape = c.Shape();
       UpdateDescendants(c, myShape, Standard_False);
-      //modified by NIZNHY-PKV Thu Mar 21 18:15:47 2002 t
       Done();
     }
     else {
@@ -345,19 +327,19 @@ void BRepFeat_MakeRevol::Perform(const Standard_Real Angle)
 
 void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& Until)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
-  if (trc) cout << "BRepFeat_MakeRevol::Perform(Until)" << endl;
+  if (trc) std::cout << "BRepFeat_MakeRevol::Perform(Until)" << std::endl;
 #endif
   Standard_Real Angle = 0.;
   Standard_Boolean TourComplet = Standard_False;
 
   if (Until.IsNull()) {
-    Standard_ConstructionError::Raise();
+    throw Standard_ConstructionError();
   }
   TopExp_Explorer exp(Until, TopAbs_FACE);
   if (!exp.More()) {
-    Standard_ConstructionError::Raise();
+    throw Standard_ConstructionError();
   }
   if (!mySkface.IsNull() && Until.IsSame(mySkface)) {
     Angle = 2*M_PI;
@@ -372,13 +354,13 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& Until)
   Standard_Boolean Trf = TransformShapeFU(1);
   ShapeUntilValid();
 
-// Do systematically almost complete revolution
-// BRepSweep_Revol theRevol(myPbase,myAxis,2.*M_PI-10.*Precision::Angular());
+  // Do systematically almost complete revolution
+  // BRepSweep_Revol theRevol(myPbase,myAxis,2.*M_PI-10.*Precision::Angular());
   LocOpe_Revol theRevol;
   if(!TourComplet) {
     Angle = 2.*M_PI- 3*M_PI/180.;
-#ifdef DEB
-    if (trc) cout << " No complete Revolution" << endl;
+#ifdef OCCT_DEBUG
+    if (trc) std::cout << " No complete Revolution" << std::endl;
 #endif
   }
   theRevol.Perform(myPbase, myAxis, Angle);
@@ -387,10 +369,10 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& Until)
 
 
   if(!Trf) {
-    
+
     myGShape = VraiRevol;
     GeneratedShapeValid();
-    
+
     TopoDS_Shape Base = theRevol.FirstShape();
     exp.Init(Base, TopAbs_FACE);
     TopoDS_Face theBase = TopoDS::Face(exp.Current());
@@ -423,86 +405,38 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& Until)
       B.MakeCompound(TopoDS::Compound(Comp));
       TopoDS_Solid S = BRepFeat::Tool(mySUntil, FUntil, Or);
       if (!S.IsNull()) B.Add(Comp,S);
-      //modified by NIZNHY-PKV Thu Mar 21 18:17:31 2002 f
-      //BRepAlgo_Cut trP(VraiRevol,Comp);
       BRepAlgoAPI_Cut trP(VraiRevol,Comp);
-      //modified by NIZNHY-PKV Thu Mar 21 18:17:37 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& fac = TopoDS::Face(ex1.Current());
-         if(fac.IsSame(myPbase)) {
-           VraiRevol = ex.Current();
-           break;
-         }
-       }
+        TopExp_Explorer ex1(ex.Current(), TopAbs_FACE);
+        for(; ex1.More(); ex1.Next()) {
+          const TopoDS_Face& fac = TopoDS::Face(ex1.Current());
+          if(fac.IsSame(myPbase)) {
+            VraiRevol = ex.Current();
+            break;
+          }
+        }
       }
       if(myFuse == 1) {
-       //modified by NIZNHY-PKV Thu Mar 21 18:17:53 2002 f
-       //BRepAlgo_Fuse f(mySbase, VraiRevol);
-       //myShape = f.Shape();
-       //UpdateDescendants(f.Builder(), myShape, Standard_False);
-       BRepAlgoAPI_Fuse f(mySbase, VraiRevol);
-       myShape = f.Shape();
-       UpdateDescendants(f, myShape, Standard_False);
-       //modified by NIZNHY-PKV Thu Mar 21 18:17:57 2002 t
-       Done();
+        BRepAlgoAPI_Fuse f(mySbase, VraiRevol);
+        myShape = f.Shape();
+        UpdateDescendants(f, myShape, Standard_False);
+        Done();
       }
       else if(myFuse == 0) {
-       //modified by NIZNHY-PKV Thu Mar 21 18:18:23 2002 f
-       //BRepAlgo_Cut c(mySbase, VraiRevol);
-       //myShape = c.Shape();
-       //UpdateDescendants(c.Builder(), myShape, Standard_False);
-       BRepAlgoAPI_Cut c(mySbase, VraiRevol);
-       myShape = c.Shape();
-       UpdateDescendants(c, myShape, Standard_False);
-       //modified by NIZNHY-PKV Thu Mar 21 18:18:28 2002 t
-       Done();
+        BRepAlgoAPI_Cut c(mySbase, VraiRevol);
+        myShape = c.Shape();
+        UpdateDescendants(c, myShape, Standard_False);
+        Done();
       }
       else {
-       myShape = VraiRevol;
-       Done(); 
+        myShape = VraiRevol;
+        Done();        
       }
     }         
   }
-   // Loop of control of descendance
-/*
-  TopExp_Explorer expr(mySbase, TopAbs_FACE);
-  char nom1[20], nom2[20];
-  Standard_Integer ii = 0;
-  for(; expr.More(); expr.Next()) {
-    ii++;
-    sprintf(nom1, "faceinitial_%d", ii);
-    DBRep::Set(nom1, expr.Current());
-    Standard_Integer jj = 0;
-    const TopTools_ListOfShape& list = Modified(expr.Current());
-    TopTools_ListIteratorOfListOfShape ite(list);
-    for(; ite.More(); ite.Next()) {
-      jj++;
-      sprintf(nom2, "facemodifie_%d_%d", ii, jj);
-      DBRep::Set(nom2, ite.Value());
-    }
-  }
-  expr.Init(myPbase, TopAbs_EDGE); 
-  ii=0; 
-  for(; expr.More(); expr.Next()) {
-    ii++;
-    sprintf(nom1, "edgeinitial_%d", ii); 
-    DBRep::Set(nom1, expr.Current()); 
-    Standard_Integer jj = 0;
-    const TopTools_ListOfShape& list = Generated(expr.Current());
-    TopTools_ListIteratorOfListOfShape ite(list);
-    for(; ite.More(); ite.Next()) {
-      jj++;
-      sprintf(nom2, "facegeneree_%d_%d", ii, jj);
-      DBRep::Set(nom2, ite.Value());
-    }
-  }
-*/
- }
+}
 
 
 //=======================================================================
@@ -511,14 +445,14 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& Until)
 //=======================================================================
 
 void BRepFeat_MakeRevol::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_MakeRevol::Perform(From,Until)" << endl;
+  if (trc) std::cout << "BRepFeat_MakeRevol::Perform(From,Until)" << std::endl;
 #endif
   if (From.IsNull() || Until.IsNull()) {
-    Standard_ConstructionError::Raise();
+    throw Standard_ConstructionError();
   }
   if (!mySkface.IsNull()) {
     if (From.IsSame(mySkface)) {
@@ -540,11 +474,11 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& From,
 
   TopExp_Explorer exp(From, TopAbs_FACE);
   if (!exp.More()) {
-    Standard_ConstructionError::Raise();
+    throw Standard_ConstructionError();
   }
   exp.Init(Until, TopAbs_FACE);
   if (!exp.More()) {
-    Standard_ConstructionError::Raise();
+    throw Standard_ConstructionError();
   }
 
   mySFrom = From;
@@ -553,7 +487,7 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& From,
   mySUntil = Until;
   Standard_Boolean Trfu = TransformShapeFU(1);
   ShapeUntilValid();  
-  
+
   if(Trfu != Trff) {
     NotDone();
     myStatusError = BRepFeat_IncTypes;
@@ -570,7 +504,7 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& From,
     myGShape = VraiRevol;
     GeneratedShapeValid();
     GluedFacesValid();
-//    VerifGluedFaces(mySkface, theBase, myBCurve, myCurves, theRevol, myGluedF);
+    //    VerifGluedFaces(mySkface, theBase, myBCurve, myCurves, theRevol, myGluedF);
 
     theRevol.Curves(myCurves);
     myBCurve = theRevol.BarycCurve();
@@ -604,7 +538,8 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& From,
       pr1 = ElCLib::InPeriod(pr1,PrU-2*M_PI,PrU);
       Standard_Real pr2 = ASI2.Point(1,ASI2.NbPoints(1)).Parameter();
       pr2 = ElCLib::InPeriod(pr2,PrU-2*M_PI,PrU);
-      OrF = OrU;
+      //OrF = OrU;
+      OrF = TopAbs::Reverse(OrU);
       FFrom = ASI2.Point(1,1).Face();
       PrF = Max(pr1, pr2);
     }
@@ -625,43 +560,28 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& From,
     if (!SF.IsNull()) B.Add(Comp,SF);
     TopoDS_Solid SU = BRepFeat::Tool(mySUntil, FUntil, OrU);
     if (!SU.IsNull()) B.Add(Comp,SU);
-    //modified by NIZNHY-PKV Thu Mar 21 18:18:54 2002 f
-    //BRepAlgo_Cut trP(VraiRevol,Comp);
     BRepAlgoAPI_Cut trP(VraiRevol,Comp);
-    //modified by NIZNHY-PKV Thu Mar 21 18:18:57 2002 t
     TopoDS_Shape Cutsh = trP.Shape();
     TopExp_Explorer ex(Cutsh, TopAbs_SOLID);
-//    Standard_Real PrF = BRepFeat::ParametricBarycenter(mySFrom, myBCurve);
-//    Standard_Real PrU = BRepFeat::ParametricBarycenter(mySUntil, myBCurve);
     VraiRevol = ex.Current();
     for(; ex.More(); ex.Next()) {
       Standard_Real PrCur = BRepFeat::
-       ParametricBarycenter(ex.Current(), myBCurve);
+        ParametricBarycenter(ex.Current(), myBCurve);
       if(PrF <= PrCur && PrU >= PrCur) {
-       VraiRevol = ex.Current();
-       break;
+        VraiRevol = ex.Current();
+        break;
       }
     }
-    if(myFuse == 1) {
-      //modified by NIZNHY-PKV Thu Mar 21 18:19:14 2002 f
-      //BRepAlgo_Fuse f(mySbase, VraiRevol);
-      //myShape = f.Shape();
-      //UpdateDescendants(f.Builder(), myShape, Standard_False);
+    if(myFuse == 1 && !myJustFeat) {
       BRepAlgoAPI_Fuse f(mySbase, VraiRevol);
       myShape = f.Shape();
       UpdateDescendants(f, myShape, Standard_False);
-      //modified by NIZNHY-PKV Thu Mar 21 18:19:18 2002 t
       Done();
     }
-    else if(myFuse == 0) {
-      //modified by NIZNHY-PKV Thu Mar 21 18:19:46 2002 f
-      //BRepAlgo_Cut c(mySbase, VraiRevol);
-      //myShape = c.Shape();
-      //UpdateDescendants(c.Builder(), myShape, Standard_False);
+    else if(myFuse == 0 && !myJustFeat) {
       BRepAlgoAPI_Cut c(mySbase, VraiRevol);
       myShape = c.Shape();
       UpdateDescendants(c, myShape, Standard_False);
-      //modified by NIZNHY-PKV Thu Mar 21 18:19:50 2002 t
       Done();
     }
     else {
@@ -679,9 +599,9 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& From,
 
 void BRepFeat_MakeRevol::PerformThruAll()
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
-  if (trc) cout << "BRepFeat_MakeRevol::PerformThruAll()" << endl;
+  if (trc) std::cout << "BRepFeat_MakeRevol::PerformThruAll()" << std::endl;
 #endif
   Perform(2.*M_PI);
 }
@@ -692,11 +612,11 @@ void BRepFeat_MakeRevol::PerformThruAll()
 //=======================================================================
 
 void BRepFeat_MakeRevol::PerformUntilAngle(const TopoDS_Shape& Until,
-                                           const Standard_Real Angle)
+  const Standard_Real Angle)
 {
-#ifdef DEB
+#ifdef OCCT_DEBUG
   Standard_Boolean trc = BRepFeat_GettraceFEAT();
-  if (trc) cout << "BRepFeat_MakeRevol::PerformUntilAngle(Until,Angle)" << endl;
+  if (trc) std::cout << "BRepFeat_MakeRevol::PerformUntilAngle(Until,Angle)" << std::endl;
 #endif
   if (Until.IsNull()) {
     Perform(Angle);
@@ -706,7 +626,7 @@ void BRepFeat_MakeRevol::PerformUntilAngle(const TopoDS_Shape& Until,
   }
   TopExp_Explorer exp(Until, TopAbs_FACE);
   if (!exp.More()) {
-    Standard_ConstructionError::Raise();
+    throw Standard_ConstructionError();
   }
   if (!mySkface.IsNull() && Until.IsSame(mySkface)) {
     Perform(Angle);
@@ -721,8 +641,8 @@ void BRepFeat_MakeRevol::PerformUntilAngle(const TopoDS_Shape& Until,
   Standard_Boolean Trf = TransformShapeFU(1);
   ShapeUntilValid();
 
-// Produce systematicallt an almost complete revolution
-//  BRepSweep_Revol theRevol(myPbase,myAxis,2.*M_PI-10.*Precision::Angular());
+  // Produce systematicallt an almost complete revolution
+  //  BRepSweep_Revol theRevol(myPbase,myAxis,2.*M_PI-10.*Precision::Angular());
   LocOpe_Revol theRevol;
   theRevol.Perform(myPbase, myAxis, Angle);
   TopoDS_Shape VraiRevol = theRevol.Shape();
@@ -732,7 +652,7 @@ void BRepFeat_MakeRevol::PerformUntilAngle(const TopoDS_Shape& Until,
   if(Trf) {
     myGShape = VraiRevol;
     GeneratedShapeValid();
-    
+
     TopoDS_Shape Base = theRevol.FirstShape();
     exp.Init(Base, TopAbs_FACE);
     TopoDS_Face theBase = TopoDS::Face(exp.Current());
@@ -766,47 +686,34 @@ void BRepFeat_MakeRevol::PerformUntilAngle(const TopoDS_Shape& Until,
       B.MakeCompound(TopoDS::Compound(Comp));
       TopoDS_Solid S = BRepFeat::Tool(mySUntil, FUntil, Or);
       if (!S.IsNull()) B.Add(Comp,S);
-      //modified by NIZNHY-PKV Thu Mar 21 18:20:14 2002 f
-      //BRepAlgo_Cut trP(VraiRevol,Comp);
       BRepAlgoAPI_Cut trP(VraiRevol,Comp);
-      //modified by NIZNHY-PKV Thu Mar 21 18:20:19 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& fac = TopoDS::Face(ex1.Current());
-         if(fac.IsSame(myPbase)) {
-           VraiRevol = ex.Current();
-           break;
-         }
-       }
+        TopExp_Explorer ex1(ex.Current(), TopAbs_FACE);
+        for(; ex1.More(); ex1.Next()) {
+          const TopoDS_Face& fac = TopoDS::Face(ex1.Current());
+          if(fac.IsSame(myPbase)) {
+            VraiRevol = ex.Current();
+            break;
+          }
+        }
       }
       if(myFuse == 1) {
-       //modified by NIZNHY-PKV Thu Mar 21 18:20:36 2002 f
-       //BRepAlgo_Fuse f(mySbase, VraiRevol);
-       //myShape = f.Shape();
-       //UpdateDescendants(f.Builder(), myShape, Standard_False);
-       BRepAlgoAPI_Fuse f(mySbase, VraiRevol);
-       myShape = f.Shape();
-       UpdateDescendants(f, myShape, Standard_False);
-       //modified by NIZNHY-PKV Thu Mar 21 18:20:40 2002 t
-       Done();
+        BRepAlgoAPI_Fuse f(mySbase, VraiRevol);
+        myShape = f.Shape();
+        UpdateDescendants(f, myShape, Standard_False);
+        Done();
       }
       else if(myFuse == 0) {
-       //modified by NIZNHY-PKV Thu Mar 21 18:21:07 2002 f
-       //BRepAlgo_Cut c(mySbase, VraiRevol);
-       //myShape = c.Shape();
-       //UpdateDescendants(c.Builder(), myShape, Standard_False);
-       BRepAlgoAPI_Cut c(mySbase, VraiRevol);
-       myShape = c.Shape();
-       UpdateDescendants(c, myShape, Standard_False);
-       //modified by NIZNHY-PKV Thu Mar 21 18:21:26 2002 t
-       Done();
+        BRepAlgoAPI_Cut c(mySbase, VraiRevol);
+        myShape = c.Shape();
+        UpdateDescendants(c, myShape, Standard_False);
+        Done();
       }
       else {
-       myShape = VraiRevol;
-       Done(); 
+        myShape = VraiRevol;
+        Done();        
       }
     }         
   }
@@ -838,15 +745,15 @@ Handle(Geom_Curve) BRepFeat_MakeRevol::BarycCurve()
 //=======================================================================
 
 static void VerifGluedFaces(const TopoDS_Face& theSkface,
-                           const TopoDS_Shape& thePbase,
-                           Handle(Geom_Curve)& theBCurve,
-                           TColGeom_SequenceOfCurve& theCurves,
-                           LocOpe_Revol& theRevol,
-                           TopTools_DataMapOfShapeShape& theMap)
+  const TopoDS_Shape& thePbase,
+  Handle(Geom_Curve)& theBCurve,
+  TColGeom_SequenceOfCurve& theCurves,
+  LocOpe_Revol& theRevol,
+  TopTools_DataMapOfShapeShape& theMap)
 {
   Standard_Boolean GluedFaces = Standard_True;
   TopoDS_Shape VraiRevol = theRevol.Shape();
-  
+
   TColGeom_SequenceOfCurve scur;
   theRevol.Curves(theCurves);
   theBCurve = theRevol.BarycCurve();    
@@ -862,31 +769,28 @@ static void VerifGluedFaces(const TopoDS_Face& theSkface,
     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 18:21:54 2002 f
-    //BRepAlgo_Cut trP(VraiRevol,Comp);
     BRepAlgoAPI_Cut trP(VraiRevol,Comp);
-    //modified by NIZNHY-PKV Thu Mar 21 18:21:58 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;
+        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
+#ifdef OCCT_DEBUG
       Standard_Boolean trc = BRepFeat_GettraceFEAT();
-      if (trc) cout << " Intersection Revol/skface : no gluing" << endl;
+      if (trc) std::cout << " Intersection Revol/skface : no gluing" << std::endl;
 #endif
       theMap.Clear();
     }
@@ -899,10 +803,10 @@ static void VerifGluedFaces(const TopoDS_Face& theSkface,
 //=======================================================================
 
 static void MajMap(const TopoDS_Shape& theB,
-                  const LocOpe_Revol& theP,
-                  TopTools_DataMapOfShapeListOfShape& theMap, // myMap
-                  TopoDS_Shape& theFShape,  // myFShape
-                  TopoDS_Shape& theLShape) // myLShape
+  const LocOpe_Revol& theP,
+  TopTools_DataMapOfShapeListOfShape& theMap, // myMap
+  TopoDS_Shape& theFShape,  // myFShape
+  TopoDS_Shape& theLShape) // myLShape
 {
   TopExp_Explorer exp(theP.FirstShape(),TopAbs_WIRE);
   if (exp.More()) {
@@ -913,7 +817,7 @@ static void MajMap(const TopoDS_Shape& theB,
       theMap(theFShape).Append(exp.Current());
     }
   }
-  
+
   exp.Init(theP.LastShape(),TopAbs_WIRE);
   if (exp.More()) {
     theLShape = exp.Current();
@@ -941,7 +845,7 @@ static void MajMap(const TopoDS_Shape& theB,
 //=======================================================================
 
 Standard_Boolean ToFuse(const TopoDS_Face& F1,
-                       const TopoDS_Face& F2)
+  const TopoDS_Face& F2)
 {
   if (F1.IsNull() || F2.IsNull()) {
     return Standard_False;
@@ -960,12 +864,12 @@ Standard_Boolean ToFuse(const TopoDS_Face& F1,
   typS2 = S2->DynamicType();
 
   if (typS1 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
-    S1 =  (*((Handle(Geom_RectangularTrimmedSurface)*)&S1))->BasisSurface();
+    S1 =  Handle(Geom_RectangularTrimmedSurface)::DownCast (S1)->BasisSurface();
     typS1 = S1->DynamicType();
   }
 
   if (typS2 == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
-    S2 =  (*((Handle(Geom_RectangularTrimmedSurface)*)&S2))->BasisSurface();
+    S2 =  Handle(Geom_RectangularTrimmedSurface)::DownCast (S2)->BasisSurface();
     typS2 = S2->DynamicType();
   }
 
@@ -978,8 +882,8 @@ Standard_Boolean ToFuse(const TopoDS_Face& F1,
   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());
+    gp_Pln pl1( Handle(Geom_Plane)::DownCast (S1)->Pln());
+    gp_Pln pl2( Handle(Geom_Plane)::DownCast (S2)->Pln());
 
     if (pl1.Position().IsCoplanar(pl2.Position(),tollin,tolang)) {
       ValRet = Standard_True;