Salome HOME
Copyright update 2021
[modules/shaper.git] / src / GeomAPI / GeomAPI_Shell.cpp
index c6a1e24f437d1f303d315206e7595df22fc00e66..3460cba6de9685a9eff5135026dbf350c40ec295 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2018-2021  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -97,8 +97,8 @@ std::shared_ptr<GeomAPI_Cylinder> GeomAPI_Shell::getCylinder() const
 
   GeomPointPtr aLocation;
   GeomDirPtr anAxis;
-  double aRadius;
-  double aHeight;
+  double aRadius = 0.0;
+  double aHeight = 0.0;
 
   for (TopExp_Explorer anExp(impl<TopoDS_Shape>(), TopAbs_FACE); anExp.More(); anExp.Next()) {
     GeomFacePtr aFace(new GeomAPI_Face);
@@ -175,8 +175,8 @@ std::shared_ptr<GeomAPI_Cone> GeomAPI_Shell::getCone() const
 
   GeomPointPtr anApex;
   GeomDirPtr anAxis;
-  double aSemiAngle, aTanSemiAngle;
-  double aHeight1, aHeight2;
+  double aSemiAngle = 0.0, aTanSemiAngle = 0.0;
+  double aHeight1 = 0.0, aHeight2 = 0.0;
 
   for (TopExp_Explorer anExp(impl<TopoDS_Shape>(), TopAbs_FACE); anExp.More(); anExp.Next()) {
     GeomFacePtr aFace(new GeomAPI_Face);
@@ -210,7 +210,7 @@ std::shared_ptr<GeomAPI_Cone> GeomAPI_Shell::getCone() const
 
       double aSign = anAxis->dot(aCurCone->axis());
       double aCurSemiAngle = aCurCone->semiAngle();
-      double aTanCurSemiAngle = Tan(aSemiAngle);
+      double aTanCurSemiAngle = Tan(aCurSemiAngle);
 
       double aH = aCurCone->radius1() / aTanCurSemiAngle * aSign;
       if (aH < aHeight1)