]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/FeaturesPlugin/FeaturesPlugin_GeometryCalculation.cpp
Salome HOME
Copyright update 2021
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_GeometryCalculation.cpp
index 2f94c04da031b046e68e531f4e53923697120fdb..724ce7e2e062f746163f3dea5747d897ab851b95 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-2020  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
@@ -29,7 +29,7 @@
 #include <Config_PropManager.h>
 
 #include <GeomAPI_Shape.h>
-#include <GeomAlgoAPI_GeometryCalculation.h>
+#include <GeomAlgoAPI_ShapeTools.h>
 
 
 #include <iomanip>
@@ -85,14 +85,10 @@ void FeaturesPlugin_GeometryCalculation::attributeChanged(const std::string& the
       double aLength;
       double aSurfArea;
       double aVolume;
-      std::string aError;
-      if (!getGeometryCalculation(aShape,
-                                  aTolerance,
-                                  aLength,
-                                  aSurfArea,
-                                  aVolume,
-                                  aError))
-         setError("Error in Geometry calculation :" +  aError);
+
+      aLength = GeomAlgoAPI_ShapeTools::length(aShape);
+      aSurfArea = GeomAlgoAPI_ShapeTools::area(aShape);
+      aVolume = GeomAlgoAPI_ShapeTools::volume(aShape);
 
       streamL << std::setprecision(14) << aLength;
       aValues->setValue(0, aLength);
@@ -107,4 +103,3 @@ void FeaturesPlugin_GeometryCalculation::attributeChanged(const std::string& the
     string(VOLUME_ID())->setValue(streamV.str());
   }
 }
-