Salome HOME
Sources formated according to the codeing standards
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Extrusion.cpp
index d5affc09469e1bd75b92c9a6bbb1272f4a94f348..fb58d0c53b125cd1157c161405026ae463a22382 100644 (file)
@@ -15,9 +15,8 @@
 const double tolerance = Precision::Angular();
 
 boost::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_Extrusion::makeExtrusion(
-                        boost::shared_ptr<GeomAPI_Shape> theShape,
-                        boost::shared_ptr<GeomAPI_Dir>   theDir,
-                        double                           theSize)
+    boost::shared_ptr<GeomAPI_Shape> theShape, boost::shared_ptr<GeomAPI_Dir> theDir,
+    double theSize)
 {
   const TopoDS_Shape& aShape = theShape->impl<TopoDS_Shape>();
   gp_Vec aDir(theDir->impl<gp_Dir>().XYZ() * theSize);
@@ -32,37 +31,33 @@ boost::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_Extrusion::makeExtrusion(
 }
 
 boost::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_Extrusion::makeExtrusion(
-                        boost::shared_ptr<GeomAPI_Shape> theShape,
-                        double                           theSize)
+    boost::shared_ptr<GeomAPI_Shape> theShape, double theSize)
 {
   bool isFirstNorm = true;
   gp_Dir aShapeNormal;
 
   const TopoDS_Shape& aShape = theShape->impl<TopoDS_Shape>();
   TopExp_Explorer aFaceExp(aShape, TopAbs_FACE);
-  for ( ; aFaceExp.More(); aFaceExp.Next())
-  {
-    const TopoDS_Face& aFace = (const TopoDS_Face&)aFaceExp.Current();
+  for (; aFaceExp.More(); aFaceExp.Next()) {
+    const TopoDS_Face& aFace = (const TopoDS_Face&) aFaceExp.Current();
     Handle(BRep_TFace) aBFace = Handle(BRep_TFace)::DownCast(aFace.TShape());
     if (aBFace.IsNull())
       return boost::shared_ptr<GeomAPI_Shape>();
 
     Handle(Geom_Plane) aPlane = Handle(Geom_Plane)::DownCast(aBFace->Surface());
-    if (aPlane.IsNull()) // non-planar shapes is not supported for extrusion yet
+    if (aPlane.IsNull())  // non-planar shapes is not supported for extrusion yet
       continue;
 
     const gp_Dir& aNormal = aPlane->Pln().Axis().Direction();
-    if (isFirstNorm)
-    {
+    if (isFirstNorm) {
       aShapeNormal = aNormal;
       isFirstNorm = false;
-    }
-    else if (!aShapeNormal.IsEqual(aNormal, tolerance)) // non-planar shapes is not supported for extrusion yet
+    } else if (!aShapeNormal.IsEqual(aNormal, tolerance))  // non-planar shapes is not supported for extrusion yet
       return boost::shared_ptr<GeomAPI_Shape>();
   }
 
   boost::shared_ptr<GeomAPI_Dir> aDir(
-    new GeomAPI_Dir(aShapeNormal.X(), aShapeNormal.Y(), aShapeNormal.Z()));
+      new GeomAPI_Dir(aShapeNormal.X(), aShapeNormal.Y(), aShapeNormal.Z()));
 
   return GeomAlgoAPI_Extrusion::makeExtrusion(theShape, aDir, theSize);
 }