Salome HOME
Copyright update 2022
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_ShapeAPI.cpp
index d6b736d3a2d05ae643053ea67595809c81fee147..e213403006f3d3e7907d0f1f55de3f90b868b9ec 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2020  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2022  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
@@ -36,7 +36,7 @@
 
 #include <math.h>
 
-static GeomShapePtr runAlgo(GeomAlgoAPI_MakeShape& theAlgo)  throw (GeomAlgoAPI_Exception)
+static GeomShapePtr runAlgo(GeomAlgoAPI_MakeShape& theAlgo)
 {
   if (!theAlgo.check())
     throw GeomAlgoAPI_Exception(theAlgo.getError());
@@ -50,7 +50,6 @@ static GeomShapePtr runAlgo(GeomAlgoAPI_MakeShape& theAlgo)  throw (GeomAlgoAPI_
 }
 
 static GeomShapePtr runAlgoAndCheckShape(GeomAlgoAPI_MakeShape& theAlgo, const std::string& theMsg)
-throw (GeomAlgoAPI_Exception)
 {
   if (!theAlgo.check())
     throw GeomAlgoAPI_Exception(theAlgo.getError());
@@ -68,7 +67,7 @@ namespace GeomAlgoAPI_ShapeAPI
   //===============================================================================================
   std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeBox(
     const double theDx, const double theDy,
-    const double theDz) throw (GeomAlgoAPI_Exception)
+    const double theDz)
   {
     static const std::string aMsg("Box builder with dimensions");
     GeomAlgoAPI_Box aBoxAlgo(theDx,theDy,theDz);
@@ -78,7 +77,7 @@ namespace GeomAlgoAPI_ShapeAPI
   //===============================================================================================
   std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeBox(
     std::shared_ptr<GeomAPI_Pnt> theFirstPoint,
-    std::shared_ptr<GeomAPI_Pnt> theSecondPoint) throw (GeomAlgoAPI_Exception)
+    std::shared_ptr<GeomAPI_Pnt> theSecondPoint)
   {
     static const std::string aMsg("Box builder with two points");
     GeomAlgoAPI_Box aBoxAlgo(theFirstPoint, theSecondPoint);
@@ -88,7 +87,7 @@ namespace GeomAlgoAPI_ShapeAPI
   //===============================================================================================
   std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeCylinder(
     std::shared_ptr<GeomAPI_Pnt> theBasePoint, std::shared_ptr<GeomAPI_Edge> theEdge,
-    double theRadius, double theHeight) throw (GeomAlgoAPI_Exception)
+    double theRadius, double theHeight)
   {
     // Check if the base point is OK
     if (!theBasePoint) {
@@ -112,7 +111,7 @@ namespace GeomAlgoAPI_ShapeAPI
   //===============================================================================================
   std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeCylinder(
     std::shared_ptr<GeomAPI_Pnt> theBasePoint, std::shared_ptr<GeomAPI_Edge> theEdge,
-    double theRadius, double theHeight, double theAngle) throw (GeomAlgoAPI_Exception)
+    double theRadius, double theHeight, double theAngle)
   {
     // Check if the base point is OK
     if (!theBasePoint) {
@@ -135,7 +134,7 @@ namespace GeomAlgoAPI_ShapeAPI
 
   //===============================================================================================
   std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeCylinder(
-    double theRadius, double theHeight) throw (GeomAlgoAPI_Exception)
+    double theRadius, double theHeight)
   {
     std::shared_ptr<GeomAPI_Pnt> aBasePoint =
       std::shared_ptr<GeomAPI_Pnt>(new GeomAPI_Pnt(0.,0.,0.));
@@ -152,7 +151,7 @@ namespace GeomAlgoAPI_ShapeAPI
 
   //===============================================================================================
   std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeCylinder(
-    double theRadius, double theHeight, double theAngle) throw (GeomAlgoAPI_Exception)
+    double theRadius, double theHeight, double theAngle)
   {
     std::shared_ptr<GeomAPI_Pnt> aBasePoint =
       std::shared_ptr<GeomAPI_Pnt>(new GeomAPI_Pnt(0.,0.,0.));
@@ -169,7 +168,7 @@ namespace GeomAlgoAPI_ShapeAPI
 
   //===============================================================================================
   std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeSphere(
-      std::shared_ptr<GeomAPI_Pnt> theCenterPoint, double theRadius) throw (GeomAlgoAPI_Exception)
+      std::shared_ptr<GeomAPI_Pnt> theCenterPoint, double theRadius)
   {
     static const std::string aMsg("Sphere builder");
     GeomAlgoAPI_Sphere aSphereAlgo(theCenterPoint, theRadius);
@@ -178,7 +177,6 @@ namespace GeomAlgoAPI_ShapeAPI
 
   //===============================================================================================
   std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeSphere(double theRadius)
-      throw (GeomAlgoAPI_Exception)
   {
     std::shared_ptr<GeomAPI_Pnt> aCenterPoint =
       std::shared_ptr<GeomAPI_Pnt>(new GeomAPI_Pnt(0.,0.,0.));
@@ -193,7 +191,6 @@ namespace GeomAlgoAPI_ShapeAPI
   std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeTorus(
       std::shared_ptr<GeomAPI_Pnt> theBasePoint,
       std::shared_ptr<GeomAPI_Edge> theEdge,double theRadius, double theRingRadius)
-      throw (GeomAlgoAPI_Exception)
   {
     // Check if the base point is OK
     if (!theBasePoint) {
@@ -216,7 +213,7 @@ namespace GeomAlgoAPI_ShapeAPI
 
   //===============================================================================================
   std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeTorus(double theRadius,
-      double theRingRadius) throw (GeomAlgoAPI_Exception)
+      double theRingRadius)
   {
     std::shared_ptr<GeomAPI_Pnt> aBasePoint =
       std::shared_ptr<GeomAPI_Pnt>(new GeomAPI_Pnt(0.,0.,0.));
@@ -236,7 +233,7 @@ namespace GeomAlgoAPI_ShapeAPI
       std::shared_ptr<GeomAPI_Pnt> theBasePoint,
       std::shared_ptr<GeomAPI_Edge> theEdge,
       double theBaseRadius, double theTopRadius,
-      double theHeight) throw (GeomAlgoAPI_Exception)
+      double theHeight)
   {
     // Check if the base point is OK
     if (!theBasePoint) {
@@ -260,7 +257,7 @@ namespace GeomAlgoAPI_ShapeAPI
   //===============================================================================================
   std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeCone(
       double theBaseRadius, double theTopRadius,
-      double theHeight) throw (GeomAlgoAPI_Exception)
+      double theHeight)
   {
     std::shared_ptr<GeomAPI_Pnt> aBasePoint =
       std::shared_ptr<GeomAPI_Pnt>(new GeomAPI_Pnt(0.,0.,0.));
@@ -279,7 +276,7 @@ namespace GeomAlgoAPI_ShapeAPI
   std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeTranslation(
     std::shared_ptr<GeomAPI_Shape> theSourceShape,
     std::shared_ptr<GeomAPI_Ax1>   theAxis,
-    const double theDistance) throw (GeomAlgoAPI_Exception)
+    const double theDistance)
   {
     GeomAlgoAPI_Translation aTranslationAlgo(theSourceShape, theAxis, theDistance);
     return runAlgo(aTranslationAlgo);
@@ -290,7 +287,7 @@ namespace GeomAlgoAPI_ShapeAPI
     std::shared_ptr<GeomAPI_Shape> theSourceShape,
     const double theDx,
     const double theDy,
-    const double theDz) throw (GeomAlgoAPI_Exception)
+    const double theDz)
   {
     GeomAlgoAPI_Translation aTranslationAlgo(theSourceShape, theDx, theDy, theDz);
     return runAlgo(aTranslationAlgo);
@@ -300,7 +297,7 @@ namespace GeomAlgoAPI_ShapeAPI
   std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeTranslation(
     std::shared_ptr<GeomAPI_Shape> theSourceShape,
     std::shared_ptr<GeomAPI_Pnt>   theStartPoint,
-    std::shared_ptr<GeomAPI_Pnt>   theEndPoint) throw (GeomAlgoAPI_Exception)
+    std::shared_ptr<GeomAPI_Pnt>   theEndPoint)
   {
     GeomAlgoAPI_Translation aTranslationAlgo(theSourceShape, theStartPoint, theEndPoint);
     return runAlgo(aTranslationAlgo);
@@ -310,7 +307,7 @@ namespace GeomAlgoAPI_ShapeAPI
   std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeRotation(
     std::shared_ptr<GeomAPI_Shape> theSourceShape,
     std::shared_ptr<GeomAPI_Ax1> theAxis,
-    const double theAngle) throw (GeomAlgoAPI_Exception)
+    const double theAngle)
   {
     GeomAlgoAPI_Rotation aRotationAlgo(theSourceShape, theAxis, theAngle);
     return runAlgo(aRotationAlgo);
@@ -321,7 +318,7 @@ namespace GeomAlgoAPI_ShapeAPI
     std::shared_ptr<GeomAPI_Shape> theSourceShape,
     std::shared_ptr<GeomAPI_Pnt> theCenterPoint,
     std::shared_ptr<GeomAPI_Pnt> theStartPoint,
-    std::shared_ptr<GeomAPI_Pnt> theEndPoint) throw (GeomAlgoAPI_Exception)
+    std::shared_ptr<GeomAPI_Pnt> theEndPoint)
   {
     GeomAlgoAPI_Rotation aRotationAlgo(theSourceShape, theCenterPoint, theStartPoint, theEndPoint);
     return runAlgo(aRotationAlgo);
@@ -330,7 +327,7 @@ namespace GeomAlgoAPI_ShapeAPI
   //===============================================================================================
   std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeSymmetry(
     std::shared_ptr<GeomAPI_Shape> theSourceShape,
-    std::shared_ptr<GeomAPI_Pnt>   thePoint) throw (GeomAlgoAPI_Exception)
+    std::shared_ptr<GeomAPI_Pnt>   thePoint)
   {
     GeomAlgoAPI_Symmetry aSymmetryAlgo(theSourceShape, thePoint);
     return runAlgo(aSymmetryAlgo);
@@ -339,7 +336,7 @@ namespace GeomAlgoAPI_ShapeAPI
   //===============================================================================================
   std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeSymmetry(
     std::shared_ptr<GeomAPI_Shape> theSourceShape,
-    std::shared_ptr<GeomAPI_Ax1>   theAxis) throw (GeomAlgoAPI_Exception)
+    std::shared_ptr<GeomAPI_Ax1>   theAxis)
   {
     GeomAlgoAPI_Symmetry aSymmetryAlgo(theSourceShape, theAxis);
     return runAlgo(aSymmetryAlgo);
@@ -348,7 +345,7 @@ namespace GeomAlgoAPI_ShapeAPI
   //===============================================================================================
   std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeSymmetry(
     std::shared_ptr<GeomAPI_Shape> theSourceShape,
-    std::shared_ptr<GeomAPI_Ax2>   thePlane) throw (GeomAlgoAPI_Exception)
+    std::shared_ptr<GeomAPI_Ax2>   thePlane)
   {
     GeomAlgoAPI_Symmetry aSymmetryAlgo(theSourceShape, thePlane);
     return runAlgo(aSymmetryAlgo);
@@ -358,7 +355,7 @@ namespace GeomAlgoAPI_ShapeAPI
   std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeScale(
     std::shared_ptr<GeomAPI_Shape> theSourceShape,
     std::shared_ptr<GeomAPI_Pnt>   theCenterPoint,
-    const double                   theScaleFactor) throw (GeomAlgoAPI_Exception)
+    const double                   theScaleFactor)
   {
     GeomAlgoAPI_Scale aScaleAlgo(theSourceShape, theCenterPoint, theScaleFactor);
     return runAlgo(aScaleAlgo);
@@ -370,7 +367,7 @@ namespace GeomAlgoAPI_ShapeAPI
     std::shared_ptr<GeomAPI_Pnt>   theCenterPoint,
     const double                   theScaleFactorX,
     const double                   theScaleFactorY,
-    const double                   theScaleFactorZ) throw (GeomAlgoAPI_Exception)
+    const double                   theScaleFactorZ)
   {
     GeomAlgoAPI_Scale aScaleAlgo(theSourceShape, theCenterPoint,
                                  theScaleFactorX, theScaleFactorY, theScaleFactorZ);
@@ -382,7 +379,7 @@ namespace GeomAlgoAPI_ShapeAPI
     std::shared_ptr<GeomAPI_Shape> theSourceShape,
     std::shared_ptr<GeomAPI_Ax1> theAxis,
     const double theStep,
-    const int theNumber) throw (GeomAlgoAPI_Exception)
+    const int theNumber)
   {
     if (!theAxis) {
       std::string aError = "Multitranslation builder ";
@@ -412,7 +409,7 @@ namespace GeomAlgoAPI_ShapeAPI
     const int theFirstNumber,
     std::shared_ptr<GeomAPI_Ax1> theSecondAxis,
     const double theSecondStep,
-    const int theSecondNumber) throw (GeomAlgoAPI_Exception)
+    const int theSecondNumber)
   {
     if (!theFirstAxis) {
       std::string aError = "Multitranslation builder ";
@@ -466,7 +463,7 @@ namespace GeomAlgoAPI_ShapeAPI
   std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeMultiRotation(
     std::shared_ptr<GeomAPI_Shape> theSourceShape,
     std::shared_ptr<GeomAPI_Ax1> theAxis,
-    const int theNumber) throw (GeomAlgoAPI_Exception)
+    const int theNumber)
   {
     if (!theAxis) {
       std::string aError = "Multirotation builder ";
@@ -495,7 +492,7 @@ namespace GeomAlgoAPI_ShapeAPI
     std::shared_ptr<GeomAPI_Shape> theSourceShape,
     std::shared_ptr<GeomAPI_Ax1> theAxis,
     const double theStep,
-    const int theNumber) throw (GeomAlgoAPI_Exception)
+    const int theNumber)
   {
     if (!theAxis) {
       std::string aError = "Multirotation builder ";
@@ -522,7 +519,7 @@ namespace GeomAlgoAPI_ShapeAPI
     const double theRMin1, const double theRMax1,
     const double theRMin2, const double theRMax2,
     const double theZ,
-    const double theStartPhi, const double theDeltaPhi) throw (GeomAlgoAPI_Exception)
+    const double theStartPhi, const double theDeltaPhi)
   {
     GeomAlgoAPI_ConeSegment aConeSegmentAlgo(theRMin1, theRMax1, theRMin2, theRMax2,
                                              theZ, theStartPhi, theDeltaPhi);