]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/FeaturesPlugin/FeaturesPlugin_GeometryCalculation.cpp
Salome HOME
updated copyright message
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_GeometryCalculation.cpp
index 2f94c04da031b046e68e531f4e53923697120fdb..c8d485d1c3461784c4e78f819e494ca5fc73271f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-2020  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
@@ -29,7 +29,7 @@
 #include <Config_PropManager.h>
 
 #include <GeomAPI_Shape.h>
-#include <GeomAlgoAPI_GeometryCalculation.h>
+#include <GeomAlgoAPI_ShapeTools.h>
 
 
 #include <iomanip>
@@ -81,18 +81,13 @@ void FeaturesPlugin_GeometryCalculation::attributeChanged(const std::string& the
     }
 
     if (aShape) {
-      double aTolerance = 0.0001;
       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 +102,3 @@ void FeaturesPlugin_GeometryCalculation::attributeChanged(const std::string& the
     string(VOLUME_ID())->setValue(streamV.str());
   }
 }
-