]> OCCT Git - occt-copy.git/commit
0026329: Restore floating point signals handling in DRAW
authorifv <ifv@opencascade.com>
Tue, 9 Aug 2016 17:12:59 +0000 (20:12 +0300)
committerabv <abv@opencascade.com>
Tue, 9 Aug 2016 17:13:28 +0000 (20:13 +0300)
commit58f0ff4931de34b6377a8866267c5f45f06009a2
treea8624bf48edc3982c6f454572f731dbfbf9993c2
parent57fbfb8e7b51c55bf5cebfe79b9c696fead70d3f
0026329: Restore floating point signals handling in DRAW

Handling of FPE signals has been restored for MSVC and GCC compilers.

The test bug6143 (that checks signals handling) has been corrected accordingly.

A number of changes in the code have been done in order to fix floating point exceptions that became generated after enabling signals:

- Global functions Sinh() and Cosh() defined in Standard_Real.hxx are improved to raise Standard_NumericError exception if argument is too big (greater than 710.47586), instead of relying on system treatment of floating point overflow. These functions are used instead of sinh and cosh in ElCLib.cxx.

- Maximal value of parameter on hyperbola is restricted by 23 in order to avoid FP overflow in Extrema_GenExtCS.cxx, ShapeFix_EdgeProjAux.cxx.

- Interface of the root curve adaptor class Adaptor3d_Curve has been updated to add new virtual methods BasisCurve and OffsetValue. They complement the adaptor for the case of offset curves. They allow setting the correct limitation of domain search in the case of offset of hyperbola, in order to get rid of floating point overflow (see Extrema_GenExtCS.cxx). All classes inheriting Adaptor3d_Curve have been changed to implement the new virtual methods.

- Protection against division by zero has been implemented in ApproxInt_KnotTools.cxx, BRepClass3d_SClassifier.cxx, BRepGProp_Face.cxx, BRepMesh_FastDiscretFace.cxx, Geom2dGcc_Circ2d2TanOnIter.cxx, Geom2dInt_Geom2dCurveTool.cxx, Graphic3d_Camera.cxx, IntPolyh_MaillageAffinage.cxx.

- Protection against calling of math functions of infinite arguments has been added in BRepCheck_Edge.cxx, BRepLib.cxx, CSLib_NormalPolyDef.cxx, Extrema_FuncExtPC.gxx, Extrema_GExtPC.gxx, Extrema_GLocateExtPC.gxx, Intf_InterferencePolygonPolyhedron.gxx, ShapeAnalysis_Surface.cxx, ShapeAnalysis_TransferParametersProj.cxx, ShapeAnalysis_Wire.cxx, math_FunctionSetRoot.cxx.

- Proper initialization of local variables is done in BOPAlgo_PaveFiller_6.cxx, XSDRAWSTLVRML.cxx.

Some test cases have been updated to actual state.
45 files changed:
src/Adaptor3d/Adaptor3d_Curve.cxx
src/Adaptor3d/Adaptor3d_Curve.hxx
src/Adaptor3d/Adaptor3d_HCurve.hxx
src/Adaptor3d/Adaptor3d_HCurve.lxx
src/ApproxInt/ApproxInt_KnotTools.cxx
src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx
src/BRepAdaptor/BRepAdaptor_Curve.cxx
src/BRepAdaptor/BRepAdaptor_Curve.hxx
src/BRepCheck/BRepCheck_Edge.cxx
src/BRepClass3d/BRepClass3d_SClassifier.cxx
src/BRepGProp/BRepGProp_Face.cxx
src/BRepLib/BRepLib.cxx
src/BRepMesh/BRepMesh_FastDiscretFace.cxx
src/BRepOffset/BRepOffset_MakeOffset.cxx
src/BRepOffset/BRepOffset_Tool.cxx
src/CSLib/CSLib_NormalPolyDef.cxx
src/Draw/Draw.cxx
src/Draw/Draw_Window.cxx
src/ElCLib/ElCLib.cxx
src/Extrema/Extrema_FuncExtPC.gxx
src/Extrema/Extrema_GExtPC.gxx
src/Extrema/Extrema_GLocateExtPC.gxx
src/Extrema/Extrema_GenExtCS.cxx
src/Geom2dGcc/Geom2dGcc_Circ2d2TanOnIter.cxx
src/Geom2dInt/Geom2dInt_Geom2dCurveTool.cxx
src/GeomAdaptor/GeomAdaptor_Curve.cxx
src/GeomAdaptor/GeomAdaptor_Curve.hxx
src/IntPolyh/IntPolyh_MaillageAffinage.cxx
src/Intf/Intf_InterferencePolygonPolyhedron.gxx
src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx
src/QABugs/QABugs_11.cxx
src/ShapeAnalysis/ShapeAnalysis_Surface.cxx
src/ShapeAnalysis/ShapeAnalysis_TransferParametersProj.cxx
src/ShapeAnalysis/ShapeAnalysis_Wire.cxx
src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx
src/ShapeFix/ShapeFix_EdgeProjAux.cxx
src/Standard/Standard_Real.cxx
src/Standard/Standard_Real.hxx
src/XSDRAWSTLVRML/XSDRAWSTLVRML.cxx
src/math/math_FunctionSetRoot.cxx
tests/bugs/fclasses/bug6143
tests/bugs/moddata_1/bug22759
tests/offset/with_intersect_80/J9
tests/offset/with_intersect_80/K8
tests/v3d/mesh/B7