0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / BRepFeat / BRepFeat_MakeRevol.cxx
index b93279d..f9decdf 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 <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>
+#include <TopoDS_Solid.hxx>
+#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
+#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopTools_MapIteratorOfMapOfShape.hxx>
+#include <TopTools_MapOfShape.hxx>
 
 #ifdef OCCT_DEBUG
 extern Standard_Boolean BRepFeat_GettraceFEAT();
@@ -961,12 +953,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();
   }
 
@@ -979,8 +971,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;