Salome HOME
updated copyright message
[modules/shaper.git] / src / GeomAPI / GeomAPI_Solid.cpp
index 8ac3a38624f339617430b649a155d4dfc220d174..68fa9295e4dac42a58dcfb751969996783c8b94c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-20xx  CEA/DEN, EDF R&D
+// Copyright (C) 2018-2023  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // You should have received a copy of the GNU Lesser General Public
 // License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomAPI_Solid.h"
@@ -69,8 +68,8 @@ std::shared_ptr<GeomAPI_Cylinder> GeomAPI_Solid::getCylinder() const
 
   GeomPointPtr aLocation;
   GeomDirPtr anAxis;
-  double aRadius;
-  double aHeight;
+  double aRadius = 0.0;
+  double aHeight = 0.0;
 
   GeomPlanePtr aCaps[2];
 
@@ -174,8 +173,7 @@ std::shared_ptr<GeomAPI_Cone> GeomAPI_Solid::getCone() const
 
   GeomPointPtr anApex;
   GeomDirPtr anAxis;
-  double aSemiAngle;
-  double aHeight;
+  double aSemiAngle = 0.0;
 
   GeomPlanePtr aCaps[2];
 
@@ -206,7 +204,6 @@ std::shared_ptr<GeomAPI_Cone> GeomAPI_Solid::getCone() const
         else
           anAxis = aCurCone->axis();
         aSemiAngle = aCurCone->semiAngle();
-        aHeight = aCurCone->height();
         isCone = true;
       }
     }
@@ -311,7 +308,7 @@ GeomPointPtr GeomAPI_Solid::middlePoint() const
     return anInnerPoint;
 
   GProp_GProps aProps;
-  BRepGProp::SurfaceProperties(aSolid, aProps, 1.e-4);
+  BRepGProp::VolumeProperties(aSolid, aProps, 1.e-4);
 
   gp_Pnt aPnt = aProps.CentreOfMass();
   anInnerPoint = GeomPointPtr(new GeomAPI_Pnt(aPnt.X(), aPnt.Y(), aPnt.Z()));