From 0201c0a6fdcc87cf36afba738a9daf68ad81e739 Mon Sep 17 00:00:00 2001 From: Viktor UZLOV Date: Mon, 7 Sep 2020 08:15:45 +0300 Subject: [PATCH] fight warnings, c++17. Fix throw() --- src/GeomAlgoAPI/GeomAlgoAPI_Exception.cpp | 6 +- src/GeomAlgoAPI/GeomAlgoAPI_Exception.h | 6 +- src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp | 58 ++++++++-------- src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h | 59 +++++++--------- src/XAO/XAO_BooleanField.cxx | 8 +-- src/XAO/XAO_BooleanField.hxx | 9 ++- src/XAO/XAO_BooleanStep.cxx | 18 ++--- src/XAO/XAO_BooleanStep.hxx | 18 ++--- src/XAO/XAO_BrepGeometry.cxx | 18 ++--- src/XAO/XAO_BrepGeometry.hxx | 21 +++--- src/XAO/XAO_DoubleField.cxx | 8 +-- src/XAO/XAO_DoubleField.hxx | 8 +-- src/XAO/XAO_DoubleStep.cxx | 18 ++--- src/XAO/XAO_DoubleStep.hxx | 18 ++--- src/XAO/XAO_Exception.hxx | 4 +- src/XAO/XAO_Field.cxx | 12 ++-- src/XAO/XAO_Field.hxx | 15 ++-- src/XAO/XAO_GeometricElement.cxx | 16 ++--- src/XAO/XAO_GeometricElement.hxx | 16 ++--- src/XAO/XAO_Geometry.cxx | 40 +++++------ src/XAO/XAO_Geometry.hxx | 85 +++++++++++------------ src/XAO/XAO_Group.cxx | 4 +- src/XAO/XAO_Group.hxx | 6 +- src/XAO/XAO_IntegerField.cxx | 8 +-- src/XAO/XAO_IntegerField.hxx | 8 +-- src/XAO/XAO_IntegerStep.cxx | 18 ++--- src/XAO/XAO_IntegerStep.hxx | 18 ++--- src/XAO/XAO_Step.cxx | 10 +-- src/XAO/XAO_Step.hxx | 10 +-- src/XAO/XAO_StringField.cxx | 8 +-- src/XAO/XAO_StringField.hxx | 8 +-- src/XAO/XAO_StringStep.cxx | 18 ++--- src/XAO/XAO_StringStep.hxx | 18 ++--- src/XAO/XAO_Xao.cxx | 34 ++++----- src/XAO/XAO_Xao.hxx | 37 +++++----- src/XAO/XAO_XaoExporter.cxx | 8 +-- src/XAO/XAO_XaoExporter.hxx | 12 ++-- src/XAO/XAO_XaoUtils.cxx | 18 ++--- src/XAO/XAO_XaoUtils.hxx | 18 ++--- 39 files changed, 352 insertions(+), 370 deletions(-) diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Exception.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Exception.cpp index 558e3fd90..8a70c92b8 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Exception.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Exception.cpp @@ -26,12 +26,12 @@ GeomAlgoAPI_Exception::GeomAlgoAPI_Exception(std::string theMessageError) } //================================================================================================= -GeomAlgoAPI_Exception::~GeomAlgoAPI_Exception() throw() +GeomAlgoAPI_Exception::~GeomAlgoAPI_Exception() noexcept { } //================================================================================================= -const char* GeomAlgoAPI_Exception::what() const throw() +const char* GeomAlgoAPI_Exception::what() const noexcept { return myMessageError.c_str(); -} \ No newline at end of file +} diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Exception.h b/src/GeomAlgoAPI/GeomAlgoAPI_Exception.h index 669d30962..023ced1a7 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Exception.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Exception.h @@ -35,13 +35,13 @@ class GeomAlgoAPI_Exception : public std::exception /// \param theMessageError Error message to be displayed GEOMALGOAPI_EXPORT GeomAlgoAPI_Exception(std::string theMessageError); /// Destroyer - GEOMALGOAPI_EXPORT ~GeomAlgoAPI_Exception() throw(); + GEOMALGOAPI_EXPORT ~GeomAlgoAPI_Exception() noexcept; /// Allows to collet the error - GEOMALGOAPI_EXPORT const char* what() const throw(); + GEOMALGOAPI_EXPORT const char* what() const noexcept; private: std::string myMessageError; /// Error message to be displayed. }; -#endif \ No newline at end of file +#endif diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp index d6b736d3a..e6e091f2f 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.cpp @@ -36,7 +36,7 @@ #include -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,7 @@ 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 +68,7 @@ namespace GeomAlgoAPI_ShapeAPI //=============================================================================================== std::shared_ptr 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 +78,7 @@ namespace GeomAlgoAPI_ShapeAPI //=============================================================================================== std::shared_ptr GeomAlgoAPI_ShapeAPI::makeBox( std::shared_ptr theFirstPoint, - std::shared_ptr theSecondPoint) throw (GeomAlgoAPI_Exception) + std::shared_ptr theSecondPoint) { static const std::string aMsg("Box builder with two points"); GeomAlgoAPI_Box aBoxAlgo(theFirstPoint, theSecondPoint); @@ -88,7 +88,7 @@ namespace GeomAlgoAPI_ShapeAPI //=============================================================================================== std::shared_ptr GeomAlgoAPI_ShapeAPI::makeCylinder( std::shared_ptr theBasePoint, std::shared_ptr theEdge, - double theRadius, double theHeight) throw (GeomAlgoAPI_Exception) + double theRadius, double theHeight) { // Check if the base point is OK if (!theBasePoint) { @@ -112,7 +112,7 @@ namespace GeomAlgoAPI_ShapeAPI //=============================================================================================== std::shared_ptr GeomAlgoAPI_ShapeAPI::makeCylinder( std::shared_ptr theBasePoint, std::shared_ptr 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 +135,7 @@ namespace GeomAlgoAPI_ShapeAPI //=============================================================================================== std::shared_ptr GeomAlgoAPI_ShapeAPI::makeCylinder( - double theRadius, double theHeight) throw (GeomAlgoAPI_Exception) + double theRadius, double theHeight) { std::shared_ptr aBasePoint = std::shared_ptr(new GeomAPI_Pnt(0.,0.,0.)); @@ -152,7 +152,7 @@ namespace GeomAlgoAPI_ShapeAPI //=============================================================================================== std::shared_ptr GeomAlgoAPI_ShapeAPI::makeCylinder( - double theRadius, double theHeight, double theAngle) throw (GeomAlgoAPI_Exception) + double theRadius, double theHeight, double theAngle) { std::shared_ptr aBasePoint = std::shared_ptr(new GeomAPI_Pnt(0.,0.,0.)); @@ -169,7 +169,7 @@ namespace GeomAlgoAPI_ShapeAPI //=============================================================================================== std::shared_ptr GeomAlgoAPI_ShapeAPI::makeSphere( - std::shared_ptr theCenterPoint, double theRadius) throw (GeomAlgoAPI_Exception) + std::shared_ptr theCenterPoint, double theRadius) { static const std::string aMsg("Sphere builder"); GeomAlgoAPI_Sphere aSphereAlgo(theCenterPoint, theRadius); @@ -178,7 +178,7 @@ namespace GeomAlgoAPI_ShapeAPI //=============================================================================================== std::shared_ptr GeomAlgoAPI_ShapeAPI::makeSphere(double theRadius) - throw (GeomAlgoAPI_Exception) + { std::shared_ptr aCenterPoint = std::shared_ptr(new GeomAPI_Pnt(0.,0.,0.)); @@ -193,7 +193,7 @@ namespace GeomAlgoAPI_ShapeAPI std::shared_ptr GeomAlgoAPI_ShapeAPI::makeTorus( std::shared_ptr theBasePoint, std::shared_ptr theEdge,double theRadius, double theRingRadius) - throw (GeomAlgoAPI_Exception) + { // Check if the base point is OK if (!theBasePoint) { @@ -216,7 +216,7 @@ namespace GeomAlgoAPI_ShapeAPI //=============================================================================================== std::shared_ptr GeomAlgoAPI_ShapeAPI::makeTorus(double theRadius, - double theRingRadius) throw (GeomAlgoAPI_Exception) + double theRingRadius) { std::shared_ptr aBasePoint = std::shared_ptr(new GeomAPI_Pnt(0.,0.,0.)); @@ -236,7 +236,7 @@ namespace GeomAlgoAPI_ShapeAPI std::shared_ptr theBasePoint, std::shared_ptr theEdge, double theBaseRadius, double theTopRadius, - double theHeight) throw (GeomAlgoAPI_Exception) + double theHeight) { // Check if the base point is OK if (!theBasePoint) { @@ -260,7 +260,7 @@ namespace GeomAlgoAPI_ShapeAPI //=============================================================================================== std::shared_ptr GeomAlgoAPI_ShapeAPI::makeCone( double theBaseRadius, double theTopRadius, - double theHeight) throw (GeomAlgoAPI_Exception) + double theHeight) { std::shared_ptr aBasePoint = std::shared_ptr(new GeomAPI_Pnt(0.,0.,0.)); @@ -279,7 +279,7 @@ namespace GeomAlgoAPI_ShapeAPI std::shared_ptr GeomAlgoAPI_ShapeAPI::makeTranslation( std::shared_ptr theSourceShape, std::shared_ptr theAxis, - const double theDistance) throw (GeomAlgoAPI_Exception) + const double theDistance) { GeomAlgoAPI_Translation aTranslationAlgo(theSourceShape, theAxis, theDistance); return runAlgo(aTranslationAlgo); @@ -290,7 +290,7 @@ namespace GeomAlgoAPI_ShapeAPI std::shared_ptr 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 +300,7 @@ namespace GeomAlgoAPI_ShapeAPI std::shared_ptr GeomAlgoAPI_ShapeAPI::makeTranslation( std::shared_ptr theSourceShape, std::shared_ptr theStartPoint, - std::shared_ptr theEndPoint) throw (GeomAlgoAPI_Exception) + std::shared_ptr theEndPoint) { GeomAlgoAPI_Translation aTranslationAlgo(theSourceShape, theStartPoint, theEndPoint); return runAlgo(aTranslationAlgo); @@ -310,7 +310,7 @@ namespace GeomAlgoAPI_ShapeAPI std::shared_ptr GeomAlgoAPI_ShapeAPI::makeRotation( std::shared_ptr theSourceShape, std::shared_ptr theAxis, - const double theAngle) throw (GeomAlgoAPI_Exception) + const double theAngle) { GeomAlgoAPI_Rotation aRotationAlgo(theSourceShape, theAxis, theAngle); return runAlgo(aRotationAlgo); @@ -321,7 +321,7 @@ namespace GeomAlgoAPI_ShapeAPI std::shared_ptr theSourceShape, std::shared_ptr theCenterPoint, std::shared_ptr theStartPoint, - std::shared_ptr theEndPoint) throw (GeomAlgoAPI_Exception) + std::shared_ptr theEndPoint) { GeomAlgoAPI_Rotation aRotationAlgo(theSourceShape, theCenterPoint, theStartPoint, theEndPoint); return runAlgo(aRotationAlgo); @@ -330,7 +330,7 @@ namespace GeomAlgoAPI_ShapeAPI //=============================================================================================== std::shared_ptr GeomAlgoAPI_ShapeAPI::makeSymmetry( std::shared_ptr theSourceShape, - std::shared_ptr thePoint) throw (GeomAlgoAPI_Exception) + std::shared_ptr thePoint) { GeomAlgoAPI_Symmetry aSymmetryAlgo(theSourceShape, thePoint); return runAlgo(aSymmetryAlgo); @@ -339,7 +339,7 @@ namespace GeomAlgoAPI_ShapeAPI //=============================================================================================== std::shared_ptr GeomAlgoAPI_ShapeAPI::makeSymmetry( std::shared_ptr theSourceShape, - std::shared_ptr theAxis) throw (GeomAlgoAPI_Exception) + std::shared_ptr theAxis) { GeomAlgoAPI_Symmetry aSymmetryAlgo(theSourceShape, theAxis); return runAlgo(aSymmetryAlgo); @@ -348,7 +348,7 @@ namespace GeomAlgoAPI_ShapeAPI //=============================================================================================== std::shared_ptr GeomAlgoAPI_ShapeAPI::makeSymmetry( std::shared_ptr theSourceShape, - std::shared_ptr thePlane) throw (GeomAlgoAPI_Exception) + std::shared_ptr thePlane) { GeomAlgoAPI_Symmetry aSymmetryAlgo(theSourceShape, thePlane); return runAlgo(aSymmetryAlgo); @@ -358,7 +358,7 @@ namespace GeomAlgoAPI_ShapeAPI std::shared_ptr GeomAlgoAPI_ShapeAPI::makeScale( std::shared_ptr theSourceShape, std::shared_ptr theCenterPoint, - const double theScaleFactor) throw (GeomAlgoAPI_Exception) + const double theScaleFactor) { GeomAlgoAPI_Scale aScaleAlgo(theSourceShape, theCenterPoint, theScaleFactor); return runAlgo(aScaleAlgo); @@ -370,7 +370,7 @@ namespace GeomAlgoAPI_ShapeAPI std::shared_ptr 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 +382,7 @@ namespace GeomAlgoAPI_ShapeAPI std::shared_ptr theSourceShape, std::shared_ptr theAxis, const double theStep, - const int theNumber) throw (GeomAlgoAPI_Exception) + const int theNumber) { if (!theAxis) { std::string aError = "Multitranslation builder "; @@ -412,7 +412,7 @@ namespace GeomAlgoAPI_ShapeAPI const int theFirstNumber, std::shared_ptr theSecondAxis, const double theSecondStep, - const int theSecondNumber) throw (GeomAlgoAPI_Exception) + const int theSecondNumber) { if (!theFirstAxis) { std::string aError = "Multitranslation builder "; @@ -466,7 +466,7 @@ namespace GeomAlgoAPI_ShapeAPI std::shared_ptr GeomAlgoAPI_ShapeAPI::makeMultiRotation( std::shared_ptr theSourceShape, std::shared_ptr theAxis, - const int theNumber) throw (GeomAlgoAPI_Exception) + const int theNumber) { if (!theAxis) { std::string aError = "Multirotation builder "; @@ -495,7 +495,7 @@ namespace GeomAlgoAPI_ShapeAPI std::shared_ptr theSourceShape, std::shared_ptr theAxis, const double theStep, - const int theNumber) throw (GeomAlgoAPI_Exception) + const int theNumber) { if (!theAxis) { std::string aError = "Multirotation builder "; @@ -522,7 +522,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); diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h index 145abb5d6..dadc42a7c 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h @@ -47,14 +47,14 @@ public: /// \param theDz The dimension on Z /// \return a shape static std::shared_ptr makeBox(const double theDx, const double theDy, - const double theDz) throw (GeomAlgoAPI_Exception); + const double theDz) ; /// Creates a box using the two points that defined a diagonal. /// \param theFirstPoint One extermity of the diagonal /// \param theSecondPoint The other extremity of the diagonal /// \return a shape static std::shared_ptr makeBox(std::shared_ptr theFirstPoint, - std::shared_ptr theSecondPoint) throw (GeomAlgoAPI_Exception); + std::shared_ptr theSecondPoint) ; /// Creates a cylinder using a center, an axis, a radius and a height. /// \param theBasePoint The center of the lower base of the cylinder @@ -62,8 +62,7 @@ public: /// \param theRadius The radius of the cylinder /// \param theHeight The heigth of the cylinder static std::shared_ptr makeCylinder(std::shared_ptr theBasePoint, - std::shared_ptr theEdge, double theRadius, double theHeight) - throw (GeomAlgoAPI_Exception); + std::shared_ptr theEdge, double theRadius, double theHeight); /// Creates a portion of cylinder using a center, an axis, a radius, a height and an angle. /// \param theBasePoint The center of the lower base of the cylinder @@ -73,31 +72,29 @@ public: /// \param theAngle The angle defining the portion static std::shared_ptr makeCylinder(std::shared_ptr theBasePoint, std::shared_ptr theEdge, double theRadius, double theHeight, - double theAngle) throw (GeomAlgoAPI_Exception); + double theAngle); /// Creates a cylinder using the origin, the OZ axis, a radius and a height. /// \param theRadius The radius of the cylinder /// \param theHeight The heigth of the cylinder - static std::shared_ptr makeCylinder(double theRadius, double theHeight) - throw (GeomAlgoAPI_Exception); + static std::shared_ptr makeCylinder(double theRadius, double theHeight); /// Creates a portion of cylinder using the origin, the OZ axis, a radius, a height and an angle. /// \param theRadius The radius of the cylinder /// \param theHeight The heigth of the cylinder /// \param theAngle The angle defining the portion static std::shared_ptr makeCylinder(double theRadius, double theHeight, - double theAngle) throw (GeomAlgoAPI_Exception); + double theAngle) ; /// Creates a sphere using a center and a radius. /// \param theCenterPoint The center of the sphere /// \param theRadius The radius of the sphere static std::shared_ptr makeSphere(std::shared_ptr theCenterPoint, - double theRadius) throw (GeomAlgoAPI_Exception); + double theRadius) ; /// Creates a sphere using the origin and a radius. /// \param theRadius The radius of the sphere - static std::shared_ptr makeSphere(double theRadius) - throw (GeomAlgoAPI_Exception); + static std::shared_ptr makeSphere(double theRadius); /// Creates a torus using a base point, an axis, a radius and a ring radius. /// \param theBasePoint The center of the torus @@ -105,14 +102,12 @@ public: /// \param theRadius The radius of the torus /// \param theRingRadius The ring radius of the torus static std::shared_ptr makeTorus(std::shared_ptr theBasePoint, - std::shared_ptr theEdge, double theRadius, double theRingRadius) - throw (GeomAlgoAPI_Exception); + std::shared_ptr theEdge, double theRadius, double theRingRadius); /// Creates a torus using a radius and a ring radius. /// \param theRadius The radius of the torus /// \param theRingRadius The ring radius of the torus - static std::shared_ptr makeTorus(double theRadius, double theRingRadius) - throw (GeomAlgoAPI_Exception); + static std::shared_ptr makeTorus(double theRadius, double theRingRadius); /// Creates a cone using a base point, an axis, a base radius, a top radius and a height. /// \param theBasePoint The center of the lower base of the cone @@ -122,14 +117,14 @@ public: /// \param theHeight The height of the cone static std::shared_ptr makeCone(std::shared_ptr theBasePoint, std::shared_ptr theEdge, double theBaseRadius, - double theTopRadius, double theHeight) throw (GeomAlgoAPI_Exception); + double theTopRadius, double theHeight) ; /// Creates a cone using a base radius, a top radius and a height. /// \param theBaseRadius The base radius of the cone /// \param theTopRadius The top radius of the cone /// \param theHeight The height of the cone static std::shared_ptr makeCone(double theBaseRadius, double theTopRadius, - double theHeight) throw (GeomAlgoAPI_Exception); + double theHeight) ; /// Performs a translation from an axis and a distance. /// \param theSourceShape Shape to be moved @@ -139,7 +134,7 @@ public: static std::shared_ptr makeTranslation( std::shared_ptr theSourceShape, std::shared_ptr theAxis, - const double theDistance) throw (GeomAlgoAPI_Exception); + const double theDistance); /// Performs a translation from dimensions. /// \param theSourceShape Shape to be moved @@ -151,7 +146,7 @@ public: std::shared_ptr theSourceShape, const double theDx, const double theDy, - const double theDz) throw (GeomAlgoAPI_Exception); + const double theDz) ; /// Performs a translation from two points. /// \param theSourceShape Shape to be moved @@ -161,7 +156,7 @@ public: static std::shared_ptr makeTranslation( std::shared_ptr theSourceShape, std::shared_ptr theStartPoint, - std::shared_ptr theEndPoint) throw (GeomAlgoAPI_Exception); + std::shared_ptr theEndPoint) ; /// Performs a rotation from an axis and an angle. /// \param theSourceShape Shape to be rotated @@ -171,7 +166,7 @@ public: static std::shared_ptr makeRotation( std::shared_ptr theSourceShape, std::shared_ptr theAxis, - const double theAngle) throw (GeomAlgoAPI_Exception); + const double theAngle) ; /// Performs a rotation from three points. /// \param theSourceShape Shape to be rotated @@ -183,28 +178,28 @@ public: std::shared_ptr theSourceShape, std::shared_ptr theCenterPoint, std::shared_ptr theStartPoint, - std::shared_ptr theEndPoint) throw (GeomAlgoAPI_Exception); + std::shared_ptr theEndPoint) ; /// Performs a symmetry by a point. /// \param theSourceShape Shape be symmetrized /// \param thePoint Point of symmetry static std::shared_ptr makeSymmetry( std::shared_ptr theSourceShape, - std::shared_ptr thePoint) throw (GeomAlgoAPI_Exception); + std::shared_ptr thePoint) ; /// Performs a symmetry by an axis. /// \param theSourceShape Shape be symmetrized /// \param theAxis Axis of symmetry static std::shared_ptr makeSymmetry( std::shared_ptr theSourceShape, - std::shared_ptr theAxis) throw (GeomAlgoAPI_Exception); + std::shared_ptr theAxis) ; /// Performs a symmetry by a plane. /// \param theSourceShape Shape be symmetrized /// \param thePlane Plane of symmetry static std::shared_ptr makeSymmetry( std::shared_ptr theSourceShape, - std::shared_ptr thePlane) throw (GeomAlgoAPI_Exception); + std::shared_ptr thePlane) ; /// Performs a scale by a scale factor. /// \param theSourceShape Shape be scaled @@ -213,7 +208,7 @@ public: static std::shared_ptr makeScale( std::shared_ptr theSourceShape, std::shared_ptr theCenterPoint, - const double theScaleFactor) throw (GeomAlgoAPI_Exception); + const double theScaleFactor) ; /// Performs a scale by dimensions. /// \param theSourceShape Shape be scaled @@ -226,7 +221,7 @@ public: std::shared_ptr theCenterPoint, const double theScaleFactorX, const double theScaleFactorY, - const double theScaleFactorZ) throw (GeomAlgoAPI_Exception); + const double theScaleFactorZ) ; /// Performs a multi translation along one axis, at a distance and a number of times /// \param theSourceShape Shape to be moved @@ -238,7 +233,7 @@ public: std::shared_ptr theSourceShape, std::shared_ptr theAxis, const double theStep, - const int theNumber) throw (GeomAlgoAPI_Exception); + const int theNumber) ; /// Performs a multi translation along two axis : a different distance on each axis /// and a different number of times for each axis @@ -257,7 +252,7 @@ public: const int theFirstNumber, std::shared_ptr theSecondAxis, const double theSecondStep, - const int theSecondNumber) throw (GeomAlgoAPI_Exception); + const int theSecondNumber) ; /// Performs a multi rotation along one axis and a number of times /// \param[in] theSourceShape Shape to be rotated @@ -266,7 +261,7 @@ public: static std::shared_ptr makeMultiRotation( std::shared_ptr theSourceShape, std::shared_ptr theAxis, - const int theNumber) throw (GeomAlgoAPI_Exception); + const int theNumber); /// Performs a multi rotation along one axis, at a step and a number of times /// \param theSourceShape Shape to be moved @@ -277,7 +272,7 @@ public: std::shared_ptr theSourceShape, std::shared_ptr theAxis, const double theStep, - const int theNumber) throw (GeomAlgoAPI_Exception); + const int theNumber) ; /// Creates a cone segment using standard GDML parameters. /// \param theRMin1 Inner radius at base of cone @@ -294,7 +289,7 @@ public: const double theRMax2, const double theZ, const double theStartPhi, - const double theDeltaPhi) throw (GeomAlgoAPI_Exception); + const double theDeltaPhi) ; }; } #endif diff --git a/src/XAO/XAO_BooleanField.cxx b/src/XAO/XAO_BooleanField.cxx index 7e9239ea0..95d51e7f9 100644 --- a/src/XAO/XAO_BooleanField.cxx +++ b/src/XAO/XAO_BooleanField.cxx @@ -31,19 +31,19 @@ BooleanField::BooleanField(const XAO::Dimension& dimension, } Step* BooleanField::addNewStep(const int& step) -throw (XAO_Exception) + { return addStep(step, 0); } BooleanStep* BooleanField::addStep(const int& step) -throw (XAO_Exception) + { return addStep(step, 0); } BooleanStep* BooleanField::addStep(const int& step, const int& stamp) -throw (XAO_Exception) + { if (hasStep(step)) throw XAO_Exception(MsgBuilder() << "Step with number " << step << " already exists."); @@ -54,7 +54,7 @@ throw (XAO_Exception) } BooleanStep* BooleanField::getStep(const int& index) -throw (XAO_Exception) + { checkStepIndex(index); return (BooleanStep*)m_steps[index]; diff --git a/src/XAO/XAO_BooleanField.hxx b/src/XAO/XAO_BooleanField.hxx index 083fc73ca..db54e0ddc 100644 --- a/src/XAO/XAO_BooleanField.hxx +++ b/src/XAO/XAO_BooleanField.hxx @@ -53,14 +53,14 @@ namespace XAO virtual const XAO::Type getType() { return XAO::BOOLEAN; } - virtual Step* addNewStep(const int& step) throw (XAO_Exception); + virtual Step* addNewStep(const int& step); /** * Adds a new step. * @param step the number of the step. * @return the newly created step. */ - BooleanStep* addStep(const int& step) throw (XAO_Exception); + BooleanStep* addStep(const int& step); /** * Adds a new step. @@ -68,15 +68,14 @@ namespace XAO * @param stamp the stamp of the step. * @return the newly created step. */ - BooleanStep* addStep(const int& step, const int& stamp) - throw (XAO_Exception); + BooleanStep* addStep(const int& step, const int& stamp); /** * Gets the step of given index. * @param index the index. * @return the step for the given index. */ - BooleanStep* getStep(const int& index) throw (XAO_Exception); + BooleanStep* getStep(const int& index); }; } diff --git a/src/XAO/XAO_BooleanStep.cxx b/src/XAO/XAO_BooleanStep.cxx index 46b75ae69..20bdbd4e1 100644 --- a/src/XAO/XAO_BooleanStep.cxx +++ b/src/XAO/XAO_BooleanStep.cxx @@ -57,7 +57,7 @@ std::vector BooleanStep::getValues() } std::vector BooleanStep::getElement(const int& element) -throw (XAO_Exception) + { checkElementIndex(element); @@ -66,7 +66,7 @@ throw (XAO_Exception) } std::vector BooleanStep::getComponent(const int& component) -throw (XAO_Exception) + { checkComponentIndex(component); @@ -84,7 +84,7 @@ throw (XAO_Exception) } const bool BooleanStep::getValue(const int& element, const int& component) -throw (XAO_Exception) + { checkElementIndex(element); checkComponentIndex(component); @@ -93,13 +93,13 @@ throw (XAO_Exception) } const std::string BooleanStep::getStringValue(const int& element, const int& component) -throw (XAO_Exception) + { return XaoUtils::booleanToString(getValue(element, component)); } void BooleanStep::setValues(const std::vector& values) -throw (XAO_Exception) + { checkNbValues((int)values.size()); @@ -113,7 +113,7 @@ throw (XAO_Exception) } void BooleanStep::setElement(const int& element, const std::vector& elements) -throw (XAO_Exception) + { checkElementIndex(element); checkNbComponents((int)elements.size()); @@ -123,7 +123,7 @@ throw (XAO_Exception) } void BooleanStep::setComponent(const int& component, const std::vector& components) -throw (XAO_Exception) + { checkComponentIndex(component); checkNbElements((int)components.size()); @@ -133,7 +133,7 @@ throw (XAO_Exception) } void BooleanStep::setValue(const int& element, const int& component, const bool& value) -throw (XAO_Exception) + { checkElementIndex(element); checkComponentIndex(component); @@ -142,7 +142,7 @@ throw (XAO_Exception) } void BooleanStep::setStringValue(const int& element, const int& component, const std::string& value) -throw (XAO_Exception) + { setValue(element, component, XaoUtils::stringToBoolean(value)); } diff --git a/src/XAO/XAO_BooleanStep.hxx b/src/XAO/XAO_BooleanStep.hxx index bde926ff4..97fcf290a 100644 --- a/src/XAO/XAO_BooleanStep.hxx +++ b/src/XAO/XAO_BooleanStep.hxx @@ -64,14 +64,14 @@ namespace XAO * @param element the index of the element to get. * @return a vector containing all the values for the given element. */ - std::vector getElement(const int& element) throw (XAO_Exception); + std::vector getElement(const int& element); /** * Gets all the values for a component. * @param component the index of the component to get. * @return a vector containing all the values for the given component. */ - std::vector getComponent(const int& component) throw (XAO_Exception); + std::vector getComponent(const int& component); /** * Gets a value for an element and a component. @@ -79,27 +79,27 @@ namespace XAO * @param component the index of the component. * @return the value. */ - const bool getValue(const int& element, const int& component) throw (XAO_Exception); + const bool getValue(const int& element, const int& component); /** * Sets all the values from a list. * @param values the list of values to set. */ - void setValues(const std::vector& values) throw (XAO_Exception); + void setValues(const std::vector& values); /** * Sets the values for an element. * @param element the index of the element to set. * @param elements the values to set. */ - void setElement(const int& element, const std::vector& elements) throw (XAO_Exception); + void setElement(const int& element, const std::vector& elements); /** * Sets the values for a component. * @param component the index of the component to set. * @param components the values to set. */ - void setComponent(const int& component, const std::vector& components) throw (XAO_Exception); + void setComponent(const int& component, const std::vector& components); /** * Sets the value for an element and a component. @@ -107,10 +107,10 @@ namespace XAO * @param component the index of the component. * @param value the value. */ - void setValue(const int& element, const int& component, const bool& value) throw (XAO_Exception); + void setValue(const int& element, const int& component, const bool& value); - virtual const std::string getStringValue(const int& element, const int& component) throw (XAO_Exception); - virtual void setStringValue(const int& element, const int& component, const std::string& value) throw (XAO_Exception); + virtual const std::string getStringValue(const int& element, const int& component); + virtual void setStringValue(const int& element, const int& component, const std::string& value); private: std::vector< std::vector > m_values; diff --git a/src/XAO/XAO_BrepGeometry.cxx b/src/XAO/XAO_BrepGeometry.cxx index 1dccf451a..4039b37b6 100644 --- a/src/XAO/XAO_BrepGeometry.cxx +++ b/src/XAO/XAO_BrepGeometry.cxx @@ -66,7 +66,7 @@ void BrepGeometry::setShapeString(const std::string& shape) } void BrepGeometry::writeShapeFile(const std::string& fileName) -throw (XAO_Exception) + { bool res = BRepTools::Write(m_shape, fileName.c_str()); if (!res) @@ -74,7 +74,7 @@ throw (XAO_Exception) } void BrepGeometry::readShapeFile(const std::string& fileName) -throw (XAO_Exception) + { BRep_Builder builder; bool res = BRepTools::Read(m_shape, fileName.c_str(), builder); @@ -137,7 +137,7 @@ void BrepGeometry::initListIds(const TopAbs_ShapeEnum& shapeType, GeometricEleme } TopoDS_Shape BrepGeometry::getSubShape(const TopoDS_Shape& mainShape, const TopAbs_ShapeEnum& shapeType, const int& shapeIndex) -throw (XAO_Exception) + { TopTools_MapOfShape mapShape; TopTools_ListOfShape listShape; @@ -247,7 +247,7 @@ std::vector BrepGeometry::getSolidFaces(const int& solidIndex, const int& s } void BrepGeometry::getVertexXYZ(const int& vertexIndex, double& xCoord, double& yCoord, double& zCoord) -throw (XAO_Exception) + { xCoord = 0.; yCoord = 0.; @@ -336,7 +336,7 @@ void BrepGeometry::setSolidID(const int& index, const int& id) // ----------------------------- const int BrepGeometry::findElement(const XAO::Dimension& dim, const int& id) -throw (XAO_Exception) + { if (dim == XAO::VERTEX) return findVertex(id); @@ -393,25 +393,25 @@ const std::string BrepGeometry::findSolidName(const int& id) // ----------------------------- void BrepGeometry::changeVertexName(const int& id, const std::string& name) -throw (XAO_Exception) + { setVertexName(findVertex(id), name); } void BrepGeometry::changeEdgeName(const int& id, const std::string& name) -throw (XAO_Exception) + { setEdgeName(findEdge(id), name); } void BrepGeometry::changeFaceName(const int& id, const std::string& name) -throw (XAO_Exception) + { setFaceName(findFace(id), name); } void BrepGeometry::changeSolidName(const int& id, const std::string& name) -throw (XAO_Exception) + { setSolidName(findSolid(id), name); } diff --git a/src/XAO/XAO_BrepGeometry.hxx b/src/XAO/XAO_BrepGeometry.hxx index 5e02757ab..bb046c045 100644 --- a/src/XAO/XAO_BrepGeometry.hxx +++ b/src/XAO/XAO_BrepGeometry.hxx @@ -79,13 +79,13 @@ namespace XAO * Writes shape to a file * @param fileName the path to the file */ - virtual void writeShapeFile(const std::string& fileName) throw (XAO_Exception); + virtual void writeShapeFile(const std::string& fileName) ; /** * Reads shape from a file * @param fileName the path to the file */ - virtual void readShapeFile(const std::string& fileName) throw (XAO_Exception); + virtual void readShapeFile(const std::string& fileName) ; #ifdef SWIG %pythoncode %{ @@ -154,8 +154,7 @@ namespace XAO * @param yCoord the Y coordinate. * @param zCoord the Z coordinate. */ - void getVertexXYZ(const int& vertexIndex, double& xCoord, double& yCoord, double& zCoord) - throw (XAO_Exception); + void getVertexXYZ(const int& vertexIndex, double& xCoord, double& yCoord, double& zCoord); /** * Gets the length of an edge. @@ -295,38 +294,36 @@ namespace XAO * @param id the ID of the vertex. * @param name the name to set. */ - void changeVertexName(const int& id, const std::string& name) throw (XAO_Exception); + void changeVertexName(const int& id, const std::string& name); /** * Changes the name of an edge. * @param id the ID of the edge * @param name the name to set. */ - void changeEdgeName(const int& id, const std::string& name) throw (XAO_Exception); + void changeEdgeName(const int& id, const std::string& name); /** * Changes the name of a face. * @param id the ID of the face. * @param name the name to set. */ - void changeFaceName(const int& id, const std::string& name) throw (XAO_Exception); + void changeFaceName(const int& id, const std::string& name); /** * Changes the name of a solid. * @param id the ID of the solid. * @param name the name to set. */ - void changeSolidName(const int& id, const std::string& name) throw (XAO_Exception); + void changeSolidName(const int& id, const std::string& name); private: void initIds(); void initListIds(const TopAbs_ShapeEnum& shapeType, GeometricElementList& eltList); - TopoDS_Shape getSubShape(const TopoDS_Shape& mainShape, const TopAbs_ShapeEnum& shapeType, const int& shapeIndex) - throw (XAO_Exception); + TopoDS_Shape getSubShape(const TopoDS_Shape& mainShape, const TopAbs_ShapeEnum& shapeType, const int& shapeIndex); const int countGeometricalElements(const TopoDS_Shape& shape, const TopAbs_ShapeEnum& shapeType); std::vector getGeometricalElements(const TopoDS_Shape& shape, const TopAbs_ShapeEnum& shapeType, const XAO::Dimension& dim); - const int findElement(const XAO::Dimension& dim, const int& id) - throw (XAO_Exception); + const int findElement(const XAO::Dimension& dim, const int& id); private: TopoDS_Shape m_shape; diff --git a/src/XAO/XAO_DoubleField.cxx b/src/XAO/XAO_DoubleField.cxx index e6544525e..d1e0bab96 100644 --- a/src/XAO/XAO_DoubleField.cxx +++ b/src/XAO/XAO_DoubleField.cxx @@ -30,19 +30,19 @@ DoubleField::DoubleField(const XAO::Dimension& dimension, const int& nbElements, } Step* DoubleField::addNewStep(const int& step) -throw (XAO_Exception) + { return addStep(step, 0); } DoubleStep* DoubleField::addStep(const int& step) -throw (XAO_Exception) + { return addStep(step, 0); } DoubleStep* DoubleField::addStep(const int& step, const int& stamp) -throw (XAO_Exception) + { if (hasStep(step)) throw XAO_Exception(MsgBuilder() << "Step with number " << step << " already exists."); @@ -53,7 +53,7 @@ throw (XAO_Exception) } DoubleStep* DoubleField::getStep(const int& index) -throw (XAO_Exception) + { checkStepIndex(index); return (DoubleStep*)m_steps[index]; diff --git a/src/XAO/XAO_DoubleField.hxx b/src/XAO/XAO_DoubleField.hxx index ee055c534..54f214df2 100644 --- a/src/XAO/XAO_DoubleField.hxx +++ b/src/XAO/XAO_DoubleField.hxx @@ -53,14 +53,14 @@ namespace XAO virtual const XAO::Type getType() { return XAO::DOUBLE; } - virtual Step* addNewStep(const int& step) throw (XAO_Exception); + virtual Step* addNewStep(const int& step); /** * Adds a new step. * @param step the number of the step. * @return the newly created step. */ - DoubleStep* addStep(const int& step) throw (XAO_Exception); + DoubleStep* addStep(const int& step); /** * Adds a new step. @@ -68,14 +68,14 @@ namespace XAO * @param stamp the stamp of the step. * @return the newly created step. */ - DoubleStep* addStep(const int& step, const int& stamp) throw (XAO_Exception); + DoubleStep* addStep(const int& step, const int& stamp); /** * Gets the step of given index. * @param index the index. * @return the step for the given index. */ - DoubleStep* getStep(const int& index) throw (XAO_Exception); + DoubleStep* getStep(const int& index); }; } diff --git a/src/XAO/XAO_DoubleStep.cxx b/src/XAO/XAO_DoubleStep.cxx index 787155320..bc34091aa 100644 --- a/src/XAO/XAO_DoubleStep.cxx +++ b/src/XAO/XAO_DoubleStep.cxx @@ -57,7 +57,7 @@ std::vector DoubleStep::getValues() } std::vector DoubleStep::getElement(const int& element) -throw (XAO_Exception) + { checkElementIndex(element); @@ -66,7 +66,7 @@ throw (XAO_Exception) } std::vector DoubleStep::getComponent(const int& component) -throw (XAO_Exception) + { checkComponentIndex(component); @@ -84,7 +84,7 @@ throw (XAO_Exception) } const double DoubleStep::getValue(const int& element, const int& component) -throw (XAO_Exception) + { checkElementIndex(element); checkComponentIndex(component); @@ -93,13 +93,13 @@ throw (XAO_Exception) } const std::string DoubleStep::getStringValue(const int& element, const int& component) -throw (XAO_Exception) + { return XaoUtils::doubleToString(getValue(element, component)); } void DoubleStep::setValues(const std::vector& values) -throw (XAO_Exception) + { checkNbValues((int)values.size()); @@ -113,7 +113,7 @@ throw (XAO_Exception) } void DoubleStep::setElement(const int& element, const std::vector& elements) -throw (XAO_Exception) + { checkElementIndex(element); checkNbComponents((int)elements.size()); @@ -123,7 +123,7 @@ throw (XAO_Exception) } void DoubleStep::setComponent(const int& component, const std::vector& components) -throw (XAO_Exception) + { checkElementIndex(component); checkNbElements((int)components.size()); @@ -133,7 +133,7 @@ throw (XAO_Exception) } void DoubleStep::setValue(const int& element, const int& component, const double& value) -throw (XAO_Exception) + { checkElementIndex(element); checkComponentIndex(component); @@ -142,7 +142,7 @@ throw (XAO_Exception) } void DoubleStep::setStringValue(const int& element, const int& component, const std::string& value) -throw (XAO_Exception) + { setValue(element, component, XaoUtils::stringToDouble(value)); } diff --git a/src/XAO/XAO_DoubleStep.hxx b/src/XAO/XAO_DoubleStep.hxx index 18cb9c073..02da69c90 100644 --- a/src/XAO/XAO_DoubleStep.hxx +++ b/src/XAO/XAO_DoubleStep.hxx @@ -64,14 +64,14 @@ namespace XAO * @param element the index of the element. * @return a vector containing all the values for the given element. */ - std::vector getElement(const int& element) throw (XAO_Exception); + std::vector getElement(const int& element); /** * Gets all the values for a given component. * @param component the index of the component. * @return a vector containing all the values for the given component. */ - std::vector getComponent(const int& component) throw (XAO_Exception); + std::vector getComponent(const int& component); /** * Gets the value for an element and a component. @@ -79,27 +79,27 @@ namespace XAO * @param component the index of the component. * @return the value for the given element and component. */ - const double getValue(const int& element, const int& component) throw (XAO_Exception); + const double getValue(const int& element, const int& component); /** * Sets all the values from a list. * @param values the list of values to set. */ - void setValues(const std::vector& values) throw (XAO_Exception); + void setValues(const std::vector& values); /** * Sets the values for an element. * @param element the index of the element to set. * @param elements the values to set. */ - void setElement(const int& element, const std::vector& elements) throw (XAO_Exception); + void setElement(const int& element, const std::vector& elements); /** * Sets the values for a component. * @param component the index of the component to set. * @param components the values to set. */ - void setComponent(const int& component, const std::vector& components) throw (XAO_Exception); + void setComponent(const int& component, const std::vector& components); /** * Sets the value for an element and a component. @@ -107,10 +107,10 @@ namespace XAO * @param component the index of the component. * @param value the value. */ - void setValue(const int& element, const int& component, const double& value) throw (XAO_Exception); + void setValue(const int& element, const int& component, const double& value); - virtual const std::string getStringValue(const int& element, const int& component) throw (XAO_Exception); - virtual void setStringValue(const int& element, const int& component, const std::string& value) throw (XAO_Exception); + virtual const std::string getStringValue(const int& element, const int& component); + virtual void setStringValue(const int& element, const int& component, const std::string& value); private: std::vector< std::vector > m_values; diff --git a/src/XAO/XAO_Exception.hxx b/src/XAO/XAO_Exception.hxx index 3c99bb7a5..e3d91ebf2 100644 --- a/src/XAO/XAO_Exception.hxx +++ b/src/XAO/XAO_Exception.hxx @@ -45,13 +45,13 @@ namespace XAO { } - virtual ~XAO_Exception() throw() {}; + virtual ~XAO_Exception() noexcept {}; /** * Returns the error message. * @return the error message. */ - virtual const char* what() const throw () + virtual const char* what() const noexcept { return m_message; } diff --git a/src/XAO/XAO_Field.cxx b/src/XAO/XAO_Field.cxx index cc7087c7b..bca803524 100644 --- a/src/XAO/XAO_Field.cxx +++ b/src/XAO/XAO_Field.cxx @@ -49,7 +49,7 @@ Field::~Field() Field* Field::createField(const XAO::Type& type, const XAO::Dimension& dimension, const int& nbElements, const int& nbComponents, const std::string& name) -throw (XAO_Exception) + { if (type == XAO::BOOLEAN) return new BooleanField(dimension, nbElements, nbComponents, name); @@ -64,21 +64,21 @@ throw (XAO_Exception) } const std::string Field::getComponentName(const int& index) -throw (XAO_Exception) + { checkComponent(index); return m_components[index]; } void Field::setComponentName(const int& index, const std::string& name) -throw (XAO_Exception) + { checkComponent(index); m_components[index] = name; } void Field::setComponentsNames(const std::vector& names) -throw (XAO_Exception) + { for (unsigned int i = 0; i < names.size(); ++i) { @@ -117,7 +117,7 @@ bool Field::hasStep(const int& step) } void Field::checkComponent(const int& component) -throw (XAO_Exception) + { if (component < m_nbComponents && component >= 0) return; @@ -127,7 +127,7 @@ throw (XAO_Exception) } void Field::checkStepIndex(const int& step) -throw (XAO_Exception) + { if (step < (int)m_steps.size() && step >= 0) return; diff --git a/src/XAO/XAO_Field.hxx b/src/XAO/XAO_Field.hxx index 22cd0ae09..90aa0be5e 100644 --- a/src/XAO/XAO_Field.hxx +++ b/src/XAO/XAO_Field.hxx @@ -67,8 +67,7 @@ namespace XAO */ static Field* createField(const XAO::Type& type, const XAO::Dimension& dimension, const int& nbElements, const int& nbComponents, - const std::string& name = std::string("")) - throw (XAO_Exception); + const std::string& name = std::string("")); /** * Destructor. @@ -146,27 +145,27 @@ namespace XAO * @param index the index of the component to get. * @return the name of the component for the given index. */ - const std::string getComponentName(const int& index) throw (XAO_Exception); + const std::string getComponentName(const int& index); /** * Sets the name of a component. * @param componentIndex the index of the component to set. * @param name the name to set. */ - void setComponentName(const int& componentIndex, const std::string& name) throw (XAO_Exception); + void setComponentName(const int& componentIndex, const std::string& name); /** * Sets the name of the components. * @param names the names to set. */ - void setComponentsNames(const std::vector& names) throw (XAO_Exception); + void setComponentsNames(const std::vector& names); /** * Adds a new step of the same type than the field. * @param number the numer of the step. * @return the new create step. */ - virtual Step* addNewStep(const int& number) throw (XAO_Exception) = 0; + virtual Step* addNewStep(const int& number) = 0; /** * Remove a step. @@ -195,8 +194,8 @@ namespace XAO stepIterator end() { return m_steps.end(); } protected: - void checkComponent(const int& component) throw (XAO_Exception); - void checkStepIndex(const int& step) throw (XAO_Exception); + void checkComponent(const int& component); + void checkStepIndex(const int& step); protected: /** The name of the Field. */ diff --git a/src/XAO/XAO_GeometricElement.cxx b/src/XAO/XAO_GeometricElement.cxx index 82cd85048..ec29a73fa 100644 --- a/src/XAO/XAO_GeometricElement.cxx +++ b/src/XAO/XAO_GeometricElement.cxx @@ -66,7 +66,7 @@ void GeometricElementList::setSize(const int& nb) } void GeometricElementList::checkElementIndex(const int& index) const -throw (XAO_Exception) + { if (m_count >= 0 && index < m_count) return; @@ -76,7 +76,7 @@ throw (XAO_Exception) } void GeometricElementList::setElement(const int& index, const std::string& name, const std::string& reference) -throw (XAO_Exception) + { checkElementIndex(index); m_elements[index].setName(name); @@ -84,42 +84,42 @@ throw (XAO_Exception) } const std::string GeometricElementList::getName(const int& index) -throw (XAO_Exception) + { checkElementIndex(index); return m_elements[index].getName(); } void GeometricElementList::setName(const int& index, const std::string& name) -throw (XAO_Exception) + { checkElementIndex(index); m_elements[index].setName(name); } const bool GeometricElementList::hasName(const int& index) -throw (XAO_Exception) + { checkElementIndex(index); return m_elements[index].hasName(); } const std::string GeometricElementList::getReference(const int& index) -throw (XAO_Exception) + { checkElementIndex(index); return m_elements[index].getReference(); } void GeometricElementList::setReference(const int& index, const std::string& name) -throw (XAO_Exception) + { checkElementIndex(index); m_elements[index].setReference(name); } const int GeometricElementList::getIndexByReference(const std::string& ref) -throw (XAO_Exception) + { for (int index = 0; index < m_count; ++index) { diff --git a/src/XAO/XAO_GeometricElement.hxx b/src/XAO/XAO_GeometricElement.hxx index 234f63bf7..7a1a76b16 100644 --- a/src/XAO/XAO_GeometricElement.hxx +++ b/src/XAO/XAO_GeometricElement.hxx @@ -147,28 +147,28 @@ namespace XAO * \param reference the reference to set. * \throw XAO_Exception if index is bigger than the size of the list. */ - void setElement(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception); + void setElement(const int& index, const std::string& name, const std::string& reference) ; /** * Gets the name of an element. * \param index the index of the element to set. * \return the name of the element with the given index. * \throw XAO_Exception if index is bigger than the size of the list. */ - const std::string getName(const int& index) throw (XAO_Exception); + const std::string getName(const int& index); /** * Sets the name of an element. * \param index the index of the element. * \param name the name to set. * \throw XAO_Exception if index is bigger than the size of the list. */ - void setName(const int& index, const std::string& name) throw (XAO_Exception); + void setName(const int& index, const std::string& name) ; /** * Checks if an element has a name. * @param index the index of the element. * @return true if the element has a name, false otherwise. */ - const bool hasName(const int& index) throw (XAO_Exception); + const bool hasName(const int& index); /** * Gets the reference of an element. @@ -176,21 +176,21 @@ namespace XAO * \return the reference of the element. * \throw XAO_Exception if index is bigger than the size of the list. */ - const std::string getReference(const int& index) throw (XAO_Exception); + const std::string getReference(const int& index); /** * Sets the reference of an element. * \param index the index of the element to set. * \param reference the reference to set. * \throw XAO_Exception if index is bigger than the size of the list. */ - void setReference(const int& index, const std::string& reference) throw (XAO_Exception); + void setReference(const int& index, const std::string& reference) ; /** * Gets the index of an element using its reference. * \param reference the searched reference. * \return the index of the element or -1 if no element found. */ - const int getIndexByReference(const std::string& reference) throw (XAO_Exception); + const int getIndexByReference(const std::string& reference) ; /** * Iterator on the element of the list. @@ -210,7 +210,7 @@ namespace XAO iterator end() { return m_elements.end(); } private: - void checkElementIndex(const int& index) const throw (XAO_Exception); + void checkElementIndex(const int& index) const ; private: int m_count; diff --git a/src/XAO/XAO_Geometry.cxx b/src/XAO/XAO_Geometry.cxx index 22031582e..61bbcafe9 100644 --- a/src/XAO/XAO_Geometry.cxx +++ b/src/XAO/XAO_Geometry.cxx @@ -31,13 +31,13 @@ Geometry::Geometry(const std::string& name) } Geometry* Geometry::createGeometry(const XAO::Format& format) -throw (XAO_Exception) + { return createGeometry(format, ""); } Geometry* Geometry::createGeometry(const XAO::Format& format, const std::string& name) -throw (XAO_Exception) + { if (format == XAO::BREP) return new BrepGeometry(name); @@ -50,14 +50,14 @@ Geometry::~Geometry() } void Geometry::checkReadOnly() -throw (XAO_Exception) + { if (m_readOnly) throw XAO_Exception("Geometry is read only."); } const int Geometry::countElements(const XAO::Dimension& dim) const -throw (XAO_Exception) + { if (dim == XAO::VERTEX) return countVertices(); @@ -74,7 +74,7 @@ throw (XAO_Exception) } const std::string Geometry::getElementReference(const XAO::Dimension& dim, const int& index) -throw (XAO_Exception) + { if (dim == XAO::VERTEX) return getVertexReference(index); @@ -89,7 +89,7 @@ throw (XAO_Exception) } const int Geometry::getElementIndexByReference(const XAO::Dimension& dim, const std::string& reference) -throw (XAO_Exception) + { if (dim == XAO::VERTEX) return getVertexIndexByReference(reference); @@ -104,7 +104,7 @@ throw (XAO_Exception) } GeometricElementList::iterator Geometry::begin(const XAO::Dimension& dim) -throw (XAO_Exception) + { if (dim == XAO::VERTEX) return m_vertices.begin(); @@ -119,7 +119,7 @@ throw (XAO_Exception) } GeometricElementList::iterator Geometry::end(const XAO::Dimension& dim) -throw (XAO_Exception) + { if (dim == XAO::VERTEX) return m_vertices.end(); @@ -133,64 +133,64 @@ throw (XAO_Exception) throw XAO_Exception(MsgBuilder() << "Unknown dimension:" << dim); } -void Geometry::setCountVertices(const int& nb) throw (XAO_Exception) +void Geometry::setCountVertices(const int& nb) { checkReadOnly(); m_vertices.setSize(nb); } -void Geometry::setCountEdges(const int& nb) throw (XAO_Exception) +void Geometry::setCountEdges(const int& nb) { checkReadOnly(); m_edges.setSize(nb); } -void Geometry::setCountFaces(const int& nb) throw (XAO_Exception) +void Geometry::setCountFaces(const int& nb) { checkReadOnly(); m_faces.setSize(nb); } -void Geometry::setCountSolids(const int& nb) throw (XAO_Exception) +void Geometry::setCountSolids(const int& nb) { checkReadOnly(); m_solids.setSize(nb); } -void Geometry::setVertexReference(const int& index, const std::string& reference) throw (XAO_Exception) +void Geometry::setVertexReference(const int& index, const std::string& reference) { checkReadOnly(); m_vertices.setReference(index, reference); } -void Geometry::setEdgeReference(const int& index, const std::string& reference) throw (XAO_Exception) +void Geometry::setEdgeReference(const int& index, const std::string& reference) { checkReadOnly(); m_edges.setReference(index, reference); } -void Geometry::setFaceReference(const int& index, const std::string& reference) throw (XAO_Exception) +void Geometry::setFaceReference(const int& index, const std::string& reference) { checkReadOnly(); m_faces.setReference(index, reference); } -void Geometry::setSolidReference(const int& index, const std::string& reference) throw (XAO_Exception) +void Geometry::setSolidReference(const int& index, const std::string& reference) { checkReadOnly(); m_solids.setReference(index, reference); } -void Geometry::setVertex(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception) +void Geometry::setVertex(const int& index, const std::string& name, const std::string& reference) { checkReadOnly(); m_vertices.setElement(index, name, reference); } -void Geometry::setEdge(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception) +void Geometry::setEdge(const int& index, const std::string& name, const std::string& reference) { checkReadOnly(); m_edges.setElement(index, name, reference); } -void Geometry::setFace(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception) +void Geometry::setFace(const int& index, const std::string& name, const std::string& reference) { checkReadOnly(); m_faces.setElement(index, name, reference); } -void Geometry::setSolid(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception) +void Geometry::setSolid(const int& index, const std::string& name, const std::string& reference) { checkReadOnly(); m_solids.setElement(index, name, reference); diff --git a/src/XAO/XAO_Geometry.hxx b/src/XAO/XAO_Geometry.hxx index e7a42a482..1dab4d315 100644 --- a/src/XAO/XAO_Geometry.hxx +++ b/src/XAO/XAO_Geometry.hxx @@ -55,7 +55,7 @@ namespace XAO * @param format the format of the geometry. * @return the created geometry. */ - static Geometry* createGeometry(const XAO::Format& format) throw (XAO_Exception); + static Geometry* createGeometry(const XAO::Format& format); /** * Constructor. @@ -63,8 +63,7 @@ namespace XAO * @name name the name of the geometry. * @return the created geometry. */ - static Geometry* createGeometry(const XAO::Format& format, const std::string& name) - throw (XAO_Exception); + static Geometry* createGeometry(const XAO::Format& format, const std::string& name); /** Destructor. */ virtual ~Geometry(); @@ -97,56 +96,56 @@ namespace XAO virtual void writeShapeFile(const std::string& fileName) = 0; virtual void readShapeFile(const std::string& fileName) = 0; - const int countElements(const XAO::Dimension& dim) const throw (XAO_Exception); + const int countElements(const XAO::Dimension& dim) const ; const int countVertices() const { return m_vertices.getSize(); } const int countEdges() const { return m_edges.getSize(); } const int countFaces() const { return m_faces.getSize(); } const int countSolids() const { return m_solids.getSize(); } - void setCountVertices(const int& nb) throw (XAO_Exception); - void setCountEdges(const int& nb) throw (XAO_Exception); - void setCountFaces(const int& nb) throw (XAO_Exception); - void setCountSolids(const int& nb) throw (XAO_Exception); - - const std::string getVertexName(const int& index) throw (XAO_Exception) { return m_vertices.getName(index); } - const std::string getEdgeName(const int& index) throw (XAO_Exception) { return m_edges.getName(index); } - const std::string getFaceName(const int& index) throw (XAO_Exception) { return m_faces.getName(index); } - const std::string getSolidName(const int& index) throw (XAO_Exception) { return m_solids.getName(index); } - - void setVertexName(const int& index, const std::string& name) throw (XAO_Exception) { m_vertices.setName(index, name); } - void setEdgeName(const int& index, const std::string& name) throw (XAO_Exception) { m_edges.setName(index, name); } - void setFaceName(const int& index, const std::string& name) throw (XAO_Exception) { m_faces.setName(index, name); } - void setSolidName(const int& index, const std::string& name) throw (XAO_Exception) { m_solids.setName(index, name); } - - const bool hasVertexName(const int& index) throw (XAO_Exception) { return m_vertices.hasName(index); } - const bool hasEdgeName(const int& index) throw (XAO_Exception) { return m_edges.hasName(index); } - const bool hasFaceName(const int& index) throw (XAO_Exception) { return m_faces.hasName(index); } - const bool hasSolidName(const int& index) throw (XAO_Exception) { return m_solids.hasName(index); } - - const std::string getVertexReference(const int& index) throw (XAO_Exception) { return m_vertices.getReference(index); } - const std::string getEdgeReference(const int& index) throw (XAO_Exception) { return m_edges.getReference(index); } - const std::string getFaceReference(const int& index) throw (XAO_Exception) { return m_faces.getReference(index); } - const std::string getSolidReference(const int& index) throw (XAO_Exception) { return m_solids.getReference(index); } - const std::string getElementReference(const XAO::Dimension& dim, const int& index) throw (XAO_Exception); - - void setVertexReference(const int& index, const std::string& reference) throw (XAO_Exception); - void setEdgeReference(const int& index, const std::string& reference) throw (XAO_Exception); - void setFaceReference(const int& index, const std::string& reference) throw (XAO_Exception); - void setSolidReference(const int& index, const std::string& reference) throw (XAO_Exception); - - void setVertex(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception); - void setEdge(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception); - void setFace(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception); - void setSolid(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception); + void setCountVertices(const int& nb) ; + void setCountEdges(const int& nb) ; + void setCountFaces(const int& nb) ; + void setCountSolids(const int& nb) ; + + const std::string getVertexName(const int& index) { return m_vertices.getName(index); } + const std::string getEdgeName(const int& index) { return m_edges.getName(index); } + const std::string getFaceName(const int& index) { return m_faces.getName(index); } + const std::string getSolidName(const int& index) { return m_solids.getName(index); } + + void setVertexName(const int& index, const std::string& name) { m_vertices.setName(index, name); } + void setEdgeName(const int& index, const std::string& name) { m_edges.setName(index, name); } + void setFaceName(const int& index, const std::string& name) { m_faces.setName(index, name); } + void setSolidName(const int& index, const std::string& name) { m_solids.setName(index, name); } + + const bool hasVertexName(const int& index) { return m_vertices.hasName(index); } + const bool hasEdgeName(const int& index) { return m_edges.hasName(index); } + const bool hasFaceName(const int& index) { return m_faces.hasName(index); } + const bool hasSolidName(const int& index) { return m_solids.hasName(index); } + + const std::string getVertexReference(const int& index) { return m_vertices.getReference(index); } + const std::string getEdgeReference(const int& index) { return m_edges.getReference(index); } + const std::string getFaceReference(const int& index) { return m_faces.getReference(index); } + const std::string getSolidReference(const int& index) { return m_solids.getReference(index); } + const std::string getElementReference(const XAO::Dimension& dim, const int& index) ; + + void setVertexReference(const int& index, const std::string& reference) ; + void setEdgeReference(const int& index, const std::string& reference) ; + void setFaceReference(const int& index, const std::string& reference) ; + void setSolidReference(const int& index, const std::string& reference) ; + + void setVertex(const int& index, const std::string& name, const std::string& reference) ; + void setEdge(const int& index, const std::string& name, const std::string& reference) ; + void setFace(const int& index, const std::string& name, const std::string& reference) ; + void setSolid(const int& index, const std::string& name, const std::string& reference) ; const int getVertexIndexByReference(const std::string& reference) { return m_vertices.getIndexByReference(reference); } const int getEdgeIndexByReference(const std::string& reference) { return m_edges.getIndexByReference(reference); } const int getFaceIndexByReference(const std::string& reference) { return m_faces.getIndexByReference(reference); } const int getSolidIndexByReference(const std::string& reference) { return m_solids.getIndexByReference(reference); } - const int getElementIndexByReference(const XAO::Dimension& dim, const std::string& reference) throw (XAO_Exception); + const int getElementIndexByReference(const XAO::Dimension& dim, const std::string& reference) ; - GeometricElementList::iterator begin(const XAO::Dimension& dim) throw (XAO_Exception); - GeometricElementList::iterator end(const XAO::Dimension& dim) throw (XAO_Exception); + GeometricElementList::iterator begin(const XAO::Dimension& dim); + GeometricElementList::iterator end(const XAO::Dimension& dim); /** * Verifies if the geometry is read only. @@ -160,7 +159,7 @@ namespace XAO void setReadOnly() { m_readOnly = true; } protected: - void checkReadOnly() throw (XAO_Exception); + void checkReadOnly(); protected: std::string m_name; diff --git a/src/XAO/XAO_Group.cxx b/src/XAO/XAO_Group.cxx index fe66b47cb..854c94dd1 100644 --- a/src/XAO/XAO_Group.cxx +++ b/src/XAO/XAO_Group.cxx @@ -25,7 +25,7 @@ using namespace XAO; Group::Group(const XAO::Dimension& dim, const int& nbElements, const std::string& name) -throw (XAO_Exception) + { if (dim == XAO::WHOLE) throw XAO_Exception("Dimension WHOLE is not valid for group."); @@ -41,7 +41,7 @@ Group::~Group() } void Group::checkIndex(const int& element) -throw (XAO_Exception) + { if (element < (int)m_elements.size() && element >= 0) return; diff --git a/src/XAO/XAO_Group.hxx b/src/XAO/XAO_Group.hxx index c0279d2d6..4260f1f82 100644 --- a/src/XAO/XAO_Group.hxx +++ b/src/XAO/XAO_Group.hxx @@ -44,8 +44,7 @@ namespace XAO * @param nbElements the number of geometrical elements for the dimension in the geometry. * @param name the name of the group. */ - Group(const XAO::Dimension& dim, const int& nbElements, const std::string& name = std::string("")) - throw (XAO_Exception); + Group(const XAO::Dimension& dim, const int& nbElements, const std::string& name = std::string("")); /** * Destructor. @@ -140,8 +139,7 @@ namespace XAO * @param element * @throw XAO_Exception if element is bigger than the number of elements. */ - void checkIndex(const int& element) - throw (XAO_Exception); + void checkIndex(const int& element); private: /** The name of the group. */ diff --git a/src/XAO/XAO_IntegerField.cxx b/src/XAO/XAO_IntegerField.cxx index 1e1bcdd65..d18582e4c 100644 --- a/src/XAO/XAO_IntegerField.cxx +++ b/src/XAO/XAO_IntegerField.cxx @@ -30,19 +30,19 @@ IntegerField::IntegerField(const XAO::Dimension& dimension, const int& nbElement } Step* IntegerField::addNewStep(const int& step) -throw (XAO_Exception) + { return addStep(step, 0); } IntegerStep* IntegerField::addStep(const int& step) -throw (XAO_Exception) + { return addStep(step, 0); } IntegerStep* IntegerField::addStep(const int& step, const int& stamp) -throw (XAO_Exception) + { if (hasStep(step)) throw XAO_Exception(MsgBuilder() << "Step with number " << step << " already exists."); @@ -53,7 +53,7 @@ throw (XAO_Exception) } IntegerStep* IntegerField::getStep(const int& index) -throw (XAO_Exception) + { checkStepIndex(index); return (IntegerStep*)m_steps[index]; diff --git a/src/XAO/XAO_IntegerField.hxx b/src/XAO/XAO_IntegerField.hxx index 2d9cac221..2f153a430 100644 --- a/src/XAO/XAO_IntegerField.hxx +++ b/src/XAO/XAO_IntegerField.hxx @@ -53,14 +53,14 @@ namespace XAO virtual const XAO::Type getType() { return XAO::INTEGER; } - virtual Step* addNewStep(const int& step) throw (XAO_Exception); + virtual Step* addNewStep(const int& step); /** * Adds a new step. * @param step the number of the step. * @return the newly created step. */ - IntegerStep* addStep(const int& step) throw (XAO_Exception); + IntegerStep* addStep(const int& step) ; /** * Adds a new step. @@ -68,14 +68,14 @@ namespace XAO * @param stamp the stamp of the step. * @return the newly created step. */ - IntegerStep* addStep(const int& step, const int& stamp) throw (XAO_Exception); + IntegerStep* addStep(const int& step, const int& stamp); /** * Gets the step of given index. * @param index the index of the step. * @return the step for the given index. */ - IntegerStep* getStep(const int& index) throw (XAO_Exception); + IntegerStep* getStep(const int& index) ; }; } diff --git a/src/XAO/XAO_IntegerStep.cxx b/src/XAO/XAO_IntegerStep.cxx index 67a377034..6f0b386aa 100644 --- a/src/XAO/XAO_IntegerStep.cxx +++ b/src/XAO/XAO_IntegerStep.cxx @@ -57,7 +57,7 @@ std::vector IntegerStep::getValues() } std::vector IntegerStep::getElement(const int& element) -throw (XAO_Exception) + { checkElementIndex(element); @@ -66,7 +66,7 @@ throw (XAO_Exception) } std::vector IntegerStep::getComponent(const int& component) -throw (XAO_Exception) + { checkComponentIndex(component); @@ -84,7 +84,7 @@ throw (XAO_Exception) } const int IntegerStep::getValue(const int& element, const int& component) -throw (XAO_Exception) + { checkElementIndex(element); checkComponentIndex(component); @@ -93,13 +93,13 @@ throw (XAO_Exception) } const std::string IntegerStep::getStringValue(const int& element, const int& component) -throw (XAO_Exception) + { return XaoUtils::intToString(getValue(element, component)); } void IntegerStep::setValues(const std::vector& values) -throw (XAO_Exception) + { checkNbValues((int)values.size()); @@ -113,7 +113,7 @@ throw (XAO_Exception) } void IntegerStep::setElement(const int& element, const std::vector& elements) -throw (XAO_Exception) + { checkElementIndex(element); checkNbComponents((int)elements.size()); @@ -123,7 +123,7 @@ throw (XAO_Exception) } void IntegerStep::setComponent(const int& component, const std::vector& components) -throw (XAO_Exception) + { checkElementIndex(component); checkNbElements((int)components.size()); @@ -133,7 +133,7 @@ throw (XAO_Exception) } void IntegerStep::setValue(const int& element, const int& component, const int& value) -throw (XAO_Exception) + { checkElementIndex(element); checkComponentIndex(component); @@ -142,7 +142,7 @@ throw (XAO_Exception) } void IntegerStep::setStringValue(const int& element, const int& component, const std::string& value) -throw (XAO_Exception) + { setValue(element, component, XaoUtils::stringToInt(value)); } diff --git a/src/XAO/XAO_IntegerStep.hxx b/src/XAO/XAO_IntegerStep.hxx index 26b02f283..340962be3 100644 --- a/src/XAO/XAO_IntegerStep.hxx +++ b/src/XAO/XAO_IntegerStep.hxx @@ -64,14 +64,14 @@ namespace XAO * @param element the index of the element. * @return a vector containing all the values for the given element. */ - std::vector getElement(const int& element) throw (XAO_Exception); + std::vector getElement(const int& element) ; /** * Gets all the values for a given component. * @param component the index of the component. * @return a vector containing all the values for the given component. */ - std::vector getComponent(const int& component) throw (XAO_Exception); + std::vector getComponent(const int& component) ; /** * Gets the value for an element and a component. @@ -79,27 +79,27 @@ namespace XAO * @param component the index of the component. * @return the value for the given element and component. */ - const int getValue(const int& element, const int& component) throw (XAO_Exception); + const int getValue(const int& element, const int& component) ; /** * Sets all the values from a list. * @param values the list of values to set. */ - void setValues(const std::vector& values) throw (XAO_Exception); + void setValues(const std::vector& values) ; /** * Sets the values for an element. * @param element the index of the element to set. * @param elements the values to set. */ - void setElement(const int& element, const std::vector& elements) throw (XAO_Exception); + void setElement(const int& element, const std::vector& elements) ; /** * Sets the values for a component. * @param component the index of the component to set. * @param components the values to set. */ - void setComponent(const int& component, const std::vector& components) throw (XAO_Exception); + void setComponent(const int& component, const std::vector& components) ; /** * Sets the value for an element and a component. @@ -107,10 +107,10 @@ namespace XAO * @param component the index of the component. * @param value the value. */ - void setValue(const int& element, const int& component, const int& value) throw (XAO_Exception); + void setValue(const int& element, const int& component, const int& value); - virtual const std::string getStringValue(const int& element, const int& component) throw (XAO_Exception); - virtual void setStringValue(const int& element, const int& component, const std::string& value) throw (XAO_Exception); + virtual const std::string getStringValue(const int& element, const int& component) ; + virtual void setStringValue(const int& element, const int& component, const std::string& value) ; private: std::vector< std::vector > m_values; diff --git a/src/XAO/XAO_Step.cxx b/src/XAO/XAO_Step.cxx index c2353170f..fbf2a2772 100644 --- a/src/XAO/XAO_Step.cxx +++ b/src/XAO/XAO_Step.cxx @@ -29,7 +29,7 @@ using namespace XAO; void Step::checkElementIndex(const int& element) -throw (XAO_Exception) + { if (element < m_nbElements && element >= 0) return; @@ -39,7 +39,7 @@ throw (XAO_Exception) } void Step::checkComponentIndex(const int& component) -throw (XAO_Exception) + { if (component < m_nbComponents && component >= 0) return; @@ -49,7 +49,7 @@ throw (XAO_Exception) } void Step::checkNbElements(const int& nbElements) -throw (XAO_Exception) + { if (nbElements == m_nbElements) return; @@ -59,7 +59,7 @@ throw (XAO_Exception) } void Step::checkNbComponents(const int& nbComponents) -throw (XAO_Exception) + { if (nbComponents == m_nbComponents) return; @@ -69,7 +69,7 @@ throw (XAO_Exception) } void Step::checkNbValues(const int& nbValues) -throw (XAO_Exception) + { if (nbValues == m_nbElements * m_nbComponents) return; diff --git a/src/XAO/XAO_Step.hxx b/src/XAO/XAO_Step.hxx index 071722370..1dddac7cf 100644 --- a/src/XAO/XAO_Step.hxx +++ b/src/XAO/XAO_Step.hxx @@ -117,30 +117,30 @@ namespace XAO * Checks that given element index is in the range of element indexes. * @param element the index to check. */ - void checkElementIndex(const int& element) throw (XAO_Exception); + void checkElementIndex(const int& element); /** * Checks that given component index is in the range of component indexes. * @param component the index to check. */ - void checkComponentIndex(const int& component)throw (XAO_Exception); + void checkComponentIndex(const int& component); /** * Checks that the given number of elements is correct. * @param nbElements the number of elements to check. */ - void checkNbElements(const int& nbElements)throw (XAO_Exception); + void checkNbElements(const int& nbElements); /** * Checks that the given number of components is correct. * @param nbComponents the number of components to check. */ - void checkNbComponents(const int& nbComponents)throw (XAO_Exception); + void checkNbComponents(const int& nbComponents); /** * checks that the given number of values is correct. * @param nbValues the number of values to check. */ - void checkNbValues(const int& nbValues)throw (XAO_Exception); + void checkNbValues(const int& nbValues); protected: /** the index of the step. */ diff --git a/src/XAO/XAO_StringField.cxx b/src/XAO/XAO_StringField.cxx index 81b7a8bea..d0ebda63d 100644 --- a/src/XAO/XAO_StringField.cxx +++ b/src/XAO/XAO_StringField.cxx @@ -30,19 +30,19 @@ StringField::StringField(const XAO::Dimension& dimension, const int& nbElements, } Step* StringField::addNewStep(const int& step) -throw (XAO_Exception) + { return addStep(step, 0); } StringStep* StringField::addStep(const int& step) -throw (XAO_Exception) + { return addStep(step, 0); } StringStep* StringField::addStep(const int& step, const int& stamp) -throw (XAO_Exception) + { if (hasStep(step)) throw XAO_Exception(MsgBuilder() << "Step with number " << step << " already exists."); @@ -53,7 +53,7 @@ throw (XAO_Exception) } StringStep* StringField::getStep(const int& index) -throw (XAO_Exception) + { checkStepIndex(index); return (StringStep*)m_steps[index]; diff --git a/src/XAO/XAO_StringField.hxx b/src/XAO/XAO_StringField.hxx index 56c3eebf7..a0a3ed887 100644 --- a/src/XAO/XAO_StringField.hxx +++ b/src/XAO/XAO_StringField.hxx @@ -52,14 +52,14 @@ namespace XAO virtual const XAO::Type getType() { return XAO::STRING; } - virtual Step* addNewStep(const int& step) throw (XAO_Exception); + virtual Step* addNewStep(const int& step); /** * Adds a new step. * @param step the number of the step. * @return the newly created step. */ - StringStep* addStep(const int& step) throw (XAO_Exception); + StringStep* addStep(const int& step) ; /** * Adds a new step. @@ -67,14 +67,14 @@ namespace XAO * @param stamp the stamp of the step. * @return the newly created step. */ - StringStep* addStep(const int& step, const int& stamp) throw (XAO_Exception); + StringStep* addStep(const int& step, const int& stamp) ; /** * Gets the step of given index. * @param index the index of the step. * @return the step for the given index. */ - StringStep* getStep(const int& index) throw (XAO_Exception); + StringStep* getStep(const int& index) ; }; } diff --git a/src/XAO/XAO_StringStep.cxx b/src/XAO/XAO_StringStep.cxx index e1a5915ce..001eb8c72 100644 --- a/src/XAO/XAO_StringStep.cxx +++ b/src/XAO/XAO_StringStep.cxx @@ -56,7 +56,7 @@ std::vector StringStep::getValues() } std::vector StringStep::getElement(const int& element) -throw (XAO_Exception) + { checkElementIndex(element); @@ -65,7 +65,7 @@ throw (XAO_Exception) } std::vector StringStep::getComponent(const int& component) -throw (XAO_Exception) + { checkComponentIndex(component); @@ -83,7 +83,7 @@ throw (XAO_Exception) } const std::string StringStep::getValue(const int& element, const int& component) -throw (XAO_Exception) + { checkElementIndex(element); checkComponentIndex(component); @@ -92,13 +92,13 @@ throw (XAO_Exception) } const std::string StringStep::getStringValue(const int& element, const int& component) -throw (XAO_Exception) + { return getValue(element, component); } void StringStep::setValues(const std::vector& values) -throw (XAO_Exception) + { checkNbValues((int)values.size()); @@ -112,7 +112,7 @@ throw (XAO_Exception) } void StringStep::setElement(const int& element, const std::vector& elements) -throw (XAO_Exception) + { checkElementIndex(element); checkNbComponents((int)elements.size()); @@ -122,7 +122,7 @@ throw (XAO_Exception) } void StringStep::setComponent(const int& component, const std::vector& components) -throw (XAO_Exception) + { checkElementIndex(component); checkNbElements((int)components.size()); @@ -132,7 +132,7 @@ throw (XAO_Exception) } void StringStep::setValue(const int& element, const int& component, const std::string& value) -throw (XAO_Exception) + { checkElementIndex(element); checkComponentIndex(component); @@ -141,7 +141,7 @@ throw (XAO_Exception) } void StringStep::setStringValue(const int& element, const int& component, const std::string& value) -throw (XAO_Exception) + { setValue(element, component, value); } diff --git a/src/XAO/XAO_StringStep.hxx b/src/XAO/XAO_StringStep.hxx index 8f73b3a02..2ea34e57f 100644 --- a/src/XAO/XAO_StringStep.hxx +++ b/src/XAO/XAO_StringStep.hxx @@ -64,14 +64,14 @@ namespace XAO * @param element the index of the element. * @return a vector containing all the values for the given element. */ - std::vector getElement(const int& element) throw (XAO_Exception); + std::vector getElement(const int& element) ; /** * Gets all the values for a given component. * @param component the index of the component. * @return a vector containing all the values for the given component. */ - std::vector getComponent(const int& component) throw (XAO_Exception); + std::vector getComponent(const int& component) ; /** * Gets the value for an element and a component. @@ -79,27 +79,27 @@ namespace XAO * @param component the index of the component. * @return the value for the given element and component. */ - const std::string getValue(const int& element, const int& component) throw (XAO_Exception); + const std::string getValue(const int& element, const int& component) ; /** * Sets all the values from a list. * @param values the list of values to set. */ - void setValues(const std::vector& values) throw (XAO_Exception); + void setValues(const std::vector& values) ; /** * Sets the values for an element. * @param element the index of the element to set. * @param elements the values to set. */ - void setElement(const int& element, const std::vector& elements) throw (XAO_Exception); + void setElement(const int& element, const std::vector& elements) ; /** * Sets the values for a component. * @param component the index of the component to set. * @param components the values to set. */ - void setComponent(const int& component, const std::vector& components) throw (XAO_Exception); + void setComponent(const int& component, const std::vector& components) ; /** * Sets the value for an element and a component. @@ -107,10 +107,10 @@ namespace XAO * @param component the index of the component. * @param value the value. */ - void setValue(const int& element, const int& component, const std::string& value) throw (XAO_Exception); + void setValue(const int& element, const int& component, const std::string& value) ; - virtual const std::string getStringValue(const int& element, const int& component) throw (XAO_Exception); - virtual void setStringValue(const int& element, const int& component, const std::string& value) throw (XAO_Exception); + virtual const std::string getStringValue(const int& element, const int& component) ; + virtual void setStringValue(const int& element, const int& component, const std::string& value) ; private: std::vector< std::vector > m_values; diff --git a/src/XAO/XAO_Xao.cxx b/src/XAO/XAO_Xao.cxx index 3fb767f06..548e47dc2 100644 --- a/src/XAO/XAO_Xao.cxx +++ b/src/XAO/XAO_Xao.cxx @@ -75,7 +75,7 @@ const int Xao::countGroups() const } Group* Xao::getGroup(const int& index) -throw (XAO_Exception) + { checkGroupIndex(index); @@ -90,7 +90,7 @@ throw (XAO_Exception) } Group* Xao::addGroup(const XAO::Dimension& dim, const std::string& name) -throw (XAO_Exception) + { checkGeometry(); checkGroupDimension(dim); @@ -121,13 +121,13 @@ const int Xao::countFields() const } const XAO::Type Xao::getFieldType(const int& index) -throw (XAO_Exception) + { return getField(index)->getType(); } Field* Xao::getField(const int& index) -throw (XAO_Exception) + { checkFieldIndex(index); @@ -142,7 +142,7 @@ throw (XAO_Exception) } BooleanField* Xao::getBooleanField(const int& index) -throw (XAO_Exception) + { Field* field = getField(index); if (field->getType() != XAO::BOOLEAN) @@ -151,7 +151,7 @@ throw (XAO_Exception) } DoubleField* Xao::getDoubleField(const int& index) -throw (XAO_Exception) + { Field* field = getField(index); if (field->getType() != XAO::DOUBLE) @@ -160,7 +160,7 @@ throw (XAO_Exception) } IntegerField* Xao::getIntegerField(const int& index) -throw (XAO_Exception) + { Field* field = getField(index); if (field->getType() != XAO::INTEGER) @@ -169,7 +169,7 @@ throw (XAO_Exception) } StringField* Xao::getStringField(const int& index) -throw (XAO_Exception) + { Field* field = getField(index); if (field->getType() != XAO::STRING) @@ -178,7 +178,7 @@ throw (XAO_Exception) } Field* Xao::addField(const XAO::Type& type, const XAO::Dimension& dim, const int& nbComponents, const std::string& name) -throw (XAO_Exception) + { checkGeometry(); int nbElts = m_geometry->countElements(dim); @@ -188,7 +188,7 @@ throw (XAO_Exception) } IntegerField* Xao::addIntegerField(const XAO::Dimension& dim, const int& nbComponents, const std::string& name) -throw (XAO_Exception) + { checkGeometry(); int nbElts = m_geometry->countElements(dim); @@ -197,7 +197,7 @@ throw (XAO_Exception) return field; } BooleanField* Xao::addBooleanField(const XAO::Dimension& dim, const int& nbComponents, const std::string& name) -throw (XAO_Exception) + { checkGeometry(); int nbElts = m_geometry->countElements(dim); @@ -206,7 +206,7 @@ throw (XAO_Exception) return field; } DoubleField* Xao::addDoubleField(const XAO::Dimension& dim, const int& nbComponents, const std::string& name) -throw (XAO_Exception) + { checkGeometry(); int nbElts = m_geometry->countElements(dim); @@ -215,7 +215,7 @@ throw (XAO_Exception) return field; } StringField* Xao::addStringField(const XAO::Dimension& dim, const int& nbComponents, const std::string& name) -throw (XAO_Exception) + { checkGeometry(); int nbElts = m_geometry->countElements(dim); @@ -262,14 +262,14 @@ const bool Xao::setXML(const std::string& xml) } void Xao::checkGeometry() const -throw(XAO_Exception) + { if (m_geometry == NULL) throw XAO_Exception("Geometry is null"); } void Xao::checkGroupIndex(const int& index) const -throw(XAO_Exception) + { if (index >= 0 && index < countGroups()) return; @@ -279,7 +279,7 @@ throw(XAO_Exception) } void Xao::checkFieldIndex(const int& index) const -throw(XAO_Exception) + { if (index >= 0 && index < countFields()) return; @@ -289,7 +289,7 @@ throw(XAO_Exception) } void Xao::checkGroupDimension(const XAO::Dimension& dim) const -throw(XAO_Exception) + { if (dim == XAO::WHOLE) throw XAO_Exception(MsgBuilder() << "Invalid dimension for group: " << dim); diff --git a/src/XAO/XAO_Xao.hxx b/src/XAO/XAO_Xao.hxx index 5354fc98c..71922be07 100644 --- a/src/XAO/XAO_Xao.hxx +++ b/src/XAO/XAO_Xao.hxx @@ -115,7 +115,7 @@ namespace XAO * Sets the geometry. * \param geometry the geometry to set. */ - void setGeometry(Geometry* geometry) throw (XAO_Exception) + void setGeometry(Geometry* geometry) { if (m_geometry != NULL) throw XAO_Exception("Geometry already set."); @@ -137,14 +137,14 @@ namespace XAO * \param index the index of the wanted group. * \return the group. */ - Group* getGroup(const int& index) throw (XAO_Exception); + Group* getGroup(const int& index) ; /** * Adds a group. * \param dim the dimension of the group. * \param name the name of the group. * \return the created group. */ - Group* addGroup(const XAO::Dimension& dim, const std::string& name = std::string("")) throw (XAO_Exception); + Group* addGroup(const XAO::Dimension& dim, const std::string& name = std::string("")) ; /** * Removes a group. * \param group the group to remove. @@ -167,19 +167,19 @@ namespace XAO * \param index the index of the wanted field. * \return the type of the field. */ - const XAO::Type getFieldType(const int& index) throw (XAO_Exception); + const XAO::Type getFieldType(const int& index) ; /** * Gets a field. * \param index the index of the wanted field. * \return the field. */ - Field* getField(const int& index) throw (XAO_Exception); + Field* getField(const int& index) ; - BooleanField* getBooleanField(const int& index) throw (XAO_Exception); - DoubleField* getDoubleField(const int& index) throw (XAO_Exception); - IntegerField* getIntegerField(const int& index) throw (XAO_Exception); - StringField* getStringField(const int& index) throw (XAO_Exception); + BooleanField* getBooleanField(const int& index) ; + DoubleField* getDoubleField(const int& index) ; + IntegerField* getIntegerField(const int& index) ; + StringField* getStringField(const int& index) ; /** * Adds a field. @@ -190,17 +190,16 @@ namespace XAO * \return the created field. */ Field* addField(const XAO::Type& type, const XAO::Dimension& dim, const int& nbComponents, - const std::string& name = std::string("")) - throw (XAO_Exception); + const std::string& name = std::string("")); BooleanField* addBooleanField(const XAO::Dimension& dim, const int& nbComponents, - const std::string& name = std::string("")) throw (XAO_Exception); + const std::string& name = std::string("")) ; IntegerField* addIntegerField(const XAO::Dimension& dim, const int& nbComponents, - const std::string& name = std::string("")) throw (XAO_Exception); + const std::string& name = std::string("")) ; DoubleField* addDoubleField(const XAO::Dimension& dim, const int& nbComponents, - const std::string& name = std::string("")) throw (XAO_Exception); + const std::string& name = std::string("")) ; StringField* addStringField(const XAO::Dimension& dim, const int& nbComponents, - const std::string& name = std::string("")) throw (XAO_Exception); + const std::string& name = std::string("")) ; /** * Removes a field. @@ -239,10 +238,10 @@ namespace XAO const bool setXML(const std::string& xml); private: - void checkGeometry() const throw (XAO_Exception); - void checkGroupIndex(const int& index) const throw (XAO_Exception); - void checkFieldIndex(const int& index) const throw (XAO_Exception); - void checkGroupDimension(const XAO::Dimension& dim) const throw (XAO_Exception); + void checkGeometry() const ; + void checkGroupIndex(const int& index) const ; + void checkFieldIndex(const int& index) const ; + void checkGroupDimension(const XAO::Dimension& dim) const ; private: /** The author of the file. */ diff --git a/src/XAO/XAO_XaoExporter.cxx b/src/XAO/XAO_XaoExporter.cxx index cddabd7c3..771dc8472 100644 --- a/src/XAO/XAO_XaoExporter.cxx +++ b/src/XAO/XAO_XaoExporter.cxx @@ -639,7 +639,7 @@ namespace { } const bool XaoExporter::saveToFile(Xao* xaoObject, const std::string& fileName, const std::string& shapeFileName) -throw (XAO_Exception) + { xmlDocPtr doc = exportXMLDoc(xaoObject, shapeFileName); xmlSaveFormatFileEnc(fileName.c_str(), doc, "UTF-8", 1); // format = 1 for node indentation @@ -649,7 +649,7 @@ throw (XAO_Exception) } const std::string XaoExporter::saveToXml(Xao* xaoObject) -throw (XAO_Exception) + { xmlDocPtr doc = exportXMLDoc(xaoObject, ""); @@ -663,7 +663,7 @@ throw (XAO_Exception) } const bool XaoExporter::readFromFile(const std::string& fileName, Xao* xaoObject) -throw (XAO_Exception) + { // parse the file and get the DOM int options = XML_PARSE_HUGE | XML_PARSE_NOCDATA; @@ -678,7 +678,7 @@ throw (XAO_Exception) } const bool XaoExporter::setXML(const std::string& xml, Xao* xaoObject) -throw (XAO_Exception) + { int options = XML_PARSE_HUGE | XML_PARSE_NOCDATA; xmlDocPtr doc = xmlReadDoc(BAD_CAST xml.c_str(), "", NULL, options); diff --git a/src/XAO/XAO_XaoExporter.hxx b/src/XAO/XAO_XaoExporter.hxx index af90b8b1c..291b5d33e 100644 --- a/src/XAO/XAO_XaoExporter.hxx +++ b/src/XAO/XAO_XaoExporter.hxx @@ -47,16 +47,14 @@ namespace XAO * @param shapeFileName if not empty save the shape in an this external file. * @return true if the export was successful, false otherwise. */ - static const bool saveToFile(Xao* xaoObject, const std::string& fileName, const std::string& shapeFileName) - throw (XAO_Exception); + static const bool saveToFile(Xao* xaoObject, const std::string& fileName, const std::string& shapeFileName); /** * Saves the XAO object to a XML string. * @param xaoObject the object to export. * @return the XML string. */ - static const std::string saveToXml(Xao* xaoObject) - throw (XAO_Exception); + static const std::string saveToXml(Xao* xaoObject); /** * Reads a XAO object from a file. @@ -64,8 +62,7 @@ namespace XAO * @param xaoObject the XAO object. * @return true if the XAO object was read successful, false otherwise. */ - static const bool readFromFile(const std::string& fileName, Xao* xaoObject) - throw (XAO_Exception); + static const bool readFromFile(const std::string& fileName, Xao* xaoObject); /** * Reads a XAO object from an XML string. @@ -73,8 +70,7 @@ namespace XAO * @param xaoObject the XAO object. * @return true if the XAO object was read successful, false otherwise. */ - static const bool setXML(const std::string& xml, Xao* xaoObject) - throw (XAO_Exception); + static const bool setXML(const std::string& xml, Xao* xaoObject); }; } diff --git a/src/XAO/XAO_XaoUtils.cxx b/src/XAO/XAO_XaoUtils.cxx index 144548269..a756993ba 100644 --- a/src/XAO/XAO_XaoUtils.cxx +++ b/src/XAO/XAO_XaoUtils.cxx @@ -35,7 +35,7 @@ const std::string XaoUtils::intToString(const int& value) } const int XaoUtils::stringToInt(const std::string& value) -throw(XAO_Exception) + { int res; std::istringstream convert(value); @@ -52,7 +52,7 @@ const std::string XaoUtils::doubleToString(const double& value) } const double XaoUtils::stringToDouble(const std::string& value) -throw(XAO_Exception) + { double res; std::istringstream convert(value); @@ -69,7 +69,7 @@ const std::string XaoUtils::booleanToString(const bool& value) } const bool XaoUtils::stringToBoolean(const std::string& value) -throw(XAO_Exception) + { if (value == "true" || value == "1") return true; @@ -80,7 +80,7 @@ throw(XAO_Exception) } const std::string XaoUtils::dimensionToString(const XAO::Dimension& dimension) -throw(XAO_Exception) + { if (dimension == XAO::VERTEX) return "vertex"; @@ -97,7 +97,7 @@ throw(XAO_Exception) } const XAO::Dimension XaoUtils::stringToDimension(const std::string& dimension) -throw(XAO_Exception) + { if (dimension == "vertex") return XAO::VERTEX; @@ -114,7 +114,7 @@ throw(XAO_Exception) } const std::string XaoUtils::fieldTypeToString(const XAO::Type& type) -throw(XAO_Exception) + { if (type ==XAO:: BOOLEAN) return "boolean"; @@ -129,7 +129,7 @@ throw(XAO_Exception) } const XAO::Type XaoUtils::stringToFieldType(const std::string& type) -throw(XAO_Exception) + { if (type == "boolean") return XAO::BOOLEAN; @@ -144,7 +144,7 @@ throw(XAO_Exception) } const std::string XaoUtils::shapeFormatToString(const XAO::Format& format) -throw(XAO_Exception) + { if (format == XAO::BREP) return "BREP"; @@ -155,7 +155,7 @@ throw(XAO_Exception) } const XAO::Format XaoUtils::stringToShapeFormat(const std::string& format) -throw(XAO_Exception) + { if (format == "BREP") return XAO::BREP; diff --git a/src/XAO/XAO_XaoUtils.hxx b/src/XAO/XAO_XaoUtils.hxx index 524e056ae..99442e4d7 100644 --- a/src/XAO/XAO_XaoUtils.hxx +++ b/src/XAO/XAO_XaoUtils.hxx @@ -86,7 +86,7 @@ namespace XAO * \return the integer value. * \throw XAO_Exception if value cannot be converted to string. */ - static const int stringToInt(const std::string& value) throw(XAO_Exception); + static const int stringToInt(const std::string& value); /** * Converts a double into a string. @@ -100,7 +100,7 @@ namespace XAO * \return the double value. * \throw XAO_Exception if value cannot be converted to string. */ - static const double stringToDouble(const std::string& value) throw(XAO_Exception); + static const double stringToDouble(const std::string& value); /** * Converts a boolean into a string. @@ -115,7 +115,7 @@ namespace XAO * \throw XAO_Exception if value cannot be converted to boolean. * \note accepted values are "true", "1", "false", "0". */ - static const bool stringToBoolean(const std::string& value) throw(XAO_Exception); + static const bool stringToBoolean(const std::string& value); /** * Converts a Dimension to string. @@ -123,7 +123,7 @@ namespace XAO * \return the dimension as a string. * \throw XAO_Exception */ - static const std::string dimensionToString(const XAO::Dimension& dimension) throw(XAO_Exception); + static const std::string dimensionToString(const XAO::Dimension& dimension); /** * Converts a string into a Dimension. @@ -131,7 +131,7 @@ namespace XAO * \return the converted Dimension. * \throw XAO_Exception if dimension cannot be converted. */ - static const XAO::Dimension stringToDimension(const std::string& dimension) throw(XAO_Exception); + static const XAO::Dimension stringToDimension(const std::string& dimension); /** * Converts a Type to string. @@ -139,7 +139,7 @@ namespace XAO * \return the Type as a string. * \throw XAO_Exception */ - static const std::string fieldTypeToString(const XAO::Type& type) throw(XAO_Exception); + static const std::string fieldTypeToString(const XAO::Type& type); /** * Converts a string into a Type. @@ -147,7 +147,7 @@ namespace XAO * \return the converted Type. * \throw XAO_Exception if type cannot be converted. */ - static const XAO::Type stringToFieldType(const std::string& type) throw(XAO_Exception); + static const XAO::Type stringToFieldType(const std::string& type); /** * Converts a Format to string. @@ -155,7 +155,7 @@ namespace XAO * \return the Format as a string. * \throw XAO_Exception */ - static const std::string shapeFormatToString(const XAO::Format& format) throw(XAO_Exception); + static const std::string shapeFormatToString(const XAO::Format& format); /** * Converts a string into a Format. @@ -163,7 +163,7 @@ namespace XAO * \return the converted Format. * \throw XAO_Exception if format cannot be converted. */ - static const XAO::Format stringToShapeFormat(const std::string& format) throw(XAO_Exception); + static const XAO::Format stringToShapeFormat(const std::string& format); }; /** -- 2.39.2