From c6541a0c868c507721b0d34941afa4542748062f Mon Sep 17 00:00:00 2001 From: DBV <> Date: Fri, 16 Dec 2011 08:50:03 +0000 Subject: [PATCH] 0022792: Globally defined symbol PI conflicts with VTK definition (Intel compiler) --- src/AIS/AIS.cxx | 32 ++-- src/AIS/AIS_AngleDimension.cxx | 64 +++---- src/AIS/AIS_Circle.cxx | 2 +- src/AIS/AIS_ConcentricRelation.cxx | 4 +- src/AIS/AIS_DiameterDimension.cxx | 14 +- src/AIS/AIS_EllipseRadiusDimension.cxx | 8 +- src/AIS/AIS_EqualDistanceRelation.cxx | 18 +- src/AIS/AIS_EqualRadiusRelation.cxx | 8 +- src/AIS/AIS_FixRelation.cxx | 22 +-- src/AIS/AIS_IdenticRelation.cxx | 38 ++-- src/AIS/AIS_InteractiveContext.cxx | 6 +- src/AIS/AIS_LengthDimension.cxx | 2 +- src/AIS/AIS_MidPointRelation.cxx | 20 +-- src/AIS/AIS_RadiusDimension.cxx | 20 +-- src/AIS/AIS_TangentRelation.cxx | 2 +- src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx | 2 +- .../Adaptor3d_SurfaceOfRevolution.cxx | 10 +- src/Adaptor3d/Adaptor3d_TopolTool.cxx | 2 +- src/AppParCurves/AppParCurves_Variational.gxx | 4 +- src/ApproxInt/ApproxInt_ImpPrmSvSurfaces.gxx | 8 +- src/Aspect/Aspect_CircularGrid.cxx | 4 +- src/Aspect/Aspect_MarkerStyle.cxx | 18 +- src/Aspect/Aspect_RectangularGrid.cxx | 12 +- src/BOP/BOP_WireSplitter.cxx | 8 +- src/BOPTools/BOPTools_PaveFiller_3.cxx | 4 +- src/BOPTools/BOPTools_Tools2D.cxx | 2 +- src/BOPTools/BOPTools_Tools3D.cxx | 2 +- src/BRepAlgo/BRepAlgo_DSAccess.cxx | 2 +- src/BRepBlend/BRepBlend_RstRstConstRad.cxx | 4 +- src/BRepBlend/BRepBlend_RstRstEvolRad.cxx | 4 +- src/BRepBlend/BRepBlend_SurfRstConstRad.cxx | 4 +- src/BRepBlend/BRepBlend_SurfRstEvolRad.cxx | 4 +- src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx | 4 +- src/BRepCheck/BRepCheck_Wire.cxx | 2 +- src/BRepFeat/BRepFeat.cxx | 4 +- src/BRepFeat/BRepFeat_MakeLinearForm.cxx | 2 +- src/BRepFeat/BRepFeat_MakeRevol.cxx | 20 +-- src/BRepFeat/BRepFeat_MakeRevolutionForm.cxx | 12 +- src/BRepFeat/BRepFeat_RibSlot.cxx | 2 +- src/BRepFill/BRepFill.cxx | 4 +- src/BRepFill/BRepFill_CompatibleWires.cxx | 20 +-- src/BRepFill/BRepFill_Draft.cxx | 6 +- src/BRepFill/BRepFill_Evolved.cxx | 6 +- src/BRepFill/BRepFill_Filling.cxx | 2 +- src/BRepFill/BRepFill_MultiLine.cxx | 10 +- src/BRepFill/BRepFill_OffsetWire.cxx | 4 +- src/BRepFill/BRepFill_Sweep.cxx | 6 +- src/BRepFill/BRepFill_TrimShellCorner.cxx | 16 +- src/BRepFill/BRepFill_TrimSurfaceTool.cxx | 8 +- src/BRepGProp/BRepGProp_Face.cxx | 8 +- src/BRepLib/BRepLib.cxx | 2 +- src/BRepMesh/BRepMesh_Classifier.cxx | 6 +- src/BRepOffset/BRepOffset.cxx | 6 +- src/BRepOffset/BRepOffset_MakeOffset.cxx | 22 +-- src/BRepOffset/BRepOffset_Offset.cxx | 14 +- src/BRepOffset/BRepOffset_Tool.cxx | 6 +- .../BRepOffsetAPI_DraftAngle.cxx | 10 +- src/BRepPrim/BRepPrim_Cone.cxx | 8 +- src/BRepPrim/BRepPrim_Sphere.cxx | 6 +- src/BRepPrim/BRepPrim_Torus.cxx | 6 +- src/BRepSweep/BRepSweep_Revol.cxx | 14 +- src/BRepSweep/BRepSweep_Rotation.cxx | 24 +-- src/BRepTest/BRepTest_BasicCommands.cxx | 2 +- src/BRepTest/BRepTest_ChamferCommands.cxx | 4 +- src/BRepTest/BRepTest_CurveCommands.cxx | 8 +- src/BRepTest/BRepTest_DraftAngleCommands.cxx | 4 +- src/BRepTest/BRepTest_FeatureCommands.cxx | 10 +- src/BRepTest/BRepTest_Fillet2DCommands.cxx | 2 +- src/BRepTest/BRepTest_PrimitiveCommands.cxx | 32 ++-- src/BRepTest/BRepTest_SurfaceCommands.cxx | 2 +- src/BRepTest/BRepTest_SweepCommands.cxx | 2 +- src/BRepToIGES/BRepToIGES_BRWire.cxx | 8 +- src/BRepTools/BRepTools_WireExplorer.cxx | 2 +- .../BRepTopAdaptor_FClass2d.cxx | 8 +- src/BiTgte/BiTgte_Blend.cxx | 2 +- src/Bisector/Bisector_BisecAna.cxx | 18 +- src/Bisector/Bisector_BisecCC.cxx | 2 +- src/BlendFunc/BlendFunc.cxx | 2 +- src/BlendFunc/BlendFunc_CSCircular.cxx | 4 +- src/BlendFunc/BlendFunc_CSConstRad.cxx | 4 +- src/BlendFunc/BlendFunc_ConstRad.cxx | 6 +- src/BlendFunc/BlendFunc_EvolRad.cxx | 4 +- src/BndLib/BndLib.cxx | 12 +- src/BndLib/BndLib_AddSurface.cxx | 6 +- src/BndLib/BndLib_Compute.gxx | 18 +- src/CGM/CGM_Driver.cxx | 6 +- src/CGM/cgmlib.hxx | 5 - src/CGM/cgmpar.h | 4 - src/CSLib/CSLib.cxx | 48 +++-- src/ChFi2d/ChFi2d_Builder.cxx | 26 +-- src/ChFi3d/ChFi3d.cxx | 4 +- src/ChFi3d/ChFi3d_Builder_0.cxx | 14 +- src/ChFi3d/ChFi3d_Builder_1.cxx | 16 +- src/ChFi3d/ChFi3d_Builder_2.cxx | 2 +- src/ChFi3d/ChFi3d_Builder_C1.cxx | 32 ++-- src/ChFi3d/ChFi3d_Builder_CnCrn.cxx | 34 ++-- src/ChFi3d/ChFi3d_Builder_SpKP.cxx | 2 +- src/ChFi3d/ChFi3d_ChBuilder.cxx | 6 +- src/ChFi3d/ChFi3d_FilBuilder.cxx | 8 +- src/ChFi3d/ChFi3d_FilBuilder_C2.cxx | 2 +- .../ChFiKPart_ComputeData_ChAsymPlnCon.cxx | 14 +- .../ChFiKPart_ComputeData_ChAsymPlnCyl.cxx | 4 +- .../ChFiKPart_ComputeData_ChPlnCon.cxx | 4 +- .../ChFiKPart_ComputeData_ChPlnCyl.cxx | 4 +- .../ChFiKPart_ComputeData_FilPlnCon.cxx | 8 +- .../ChFiKPart_ComputeData_FilPlnCyl.cxx | 26 +-- .../ChFiKPart_ComputeData_Rotule.cxx | 8 +- .../ChFiKPart_ComputeData_Sphere.cxx | 2 +- src/Contap/Contap_ArcFunction.lxx | 4 +- src/Contap/Contap_ContAna.cxx | 4 +- src/Contap/Contap_ContourGen_2.gxx | 10 +- src/Contap/Contap_SurfFunction.lxx | 4 +- src/Convert/Convert_CircleToBSplineCurve.cxx | 4 +- src/Convert/Convert_ConeToBSplineSurface.cxx | 10 +- src/Convert/Convert_ConicToBSplineCurve.cxx | 20 +-- .../Convert_CylinderToBSplineSurface.cxx | 10 +- src/Convert/Convert_EllipseToBSplineCurve.cxx | 4 +- src/Convert/Convert_PolynomialCosAndSin.cxx | 10 +- .../Convert_SphereToBSplineSurface.cxx | 40 ++--- src/Convert/Convert_TorusToBSplineSurface.cxx | 34 ++-- src/DBRep/DBRep.cxx | 16 +- src/DDataStd/DDataStd.cxx | 2 +- src/DDataStd/DDataStd_DatumCommands.cxx | 2 +- src/DDataStd/DDataStd_DrawDriver.cxx | 2 +- src/DDataStd/DDataStd_Sample.cxx | 2 +- src/DNaming/DNaming_ModelingCommands.cxx | 4 +- src/Draft/Draft_Modification.cxx | 2 +- src/Draft/Draft_Modification_1.cxx | 18 +- src/Draw/Draw_Display.cxx | 8 +- src/Draw/Draw_GraphicCommands.cxx | 2 +- src/Draw/Draw_VariableCommands.cxx | 2 +- src/Draw/Draw_Viewer.cxx | 82 ++++----- src/DrawDim/DrawDim.cxx | 2 +- src/DrawDim/DrawDim_PlanarAngle.cxx | 10 +- src/DrawDim/DrawDim_PlanarDiameter.cxx | 2 +- src/DrawFairCurve/DrawFairCurve_Batten.cxx | 4 +- src/DrawTrSurf/DrawTrSurf.cxx | 4 +- src/DsgPrs/DsgPrs.cxx | 34 ++-- src/DsgPrs/DsgPrs_AnglePresentation.cxx | 92 +++++----- src/DsgPrs/DsgPrs_ConcentricPresentation.cxx | 2 +- src/DsgPrs/DsgPrs_DiameterPresentation.cxx | 18 +- .../DsgPrs_EllipseRadiusPresentation.cxx | 4 +- .../DsgPrs_EqualDistancePresentation.cxx | 16 +- .../DsgPrs_FilletRadiusPresentation.cxx | 2 +- src/DsgPrs/DsgPrs_FixPresentation.cxx | 2 +- src/DsgPrs/DsgPrs_IdenticPresentation.cxx | 12 +- src/DsgPrs/DsgPrs_LengthPresentation.cxx | 4 +- src/DsgPrs/DsgPrs_MidPointPresentation.cxx | 16 +- src/DsgPrs/DsgPrs_RadiusPresentation.cxx | 12 +- src/DsgPrs/DsgPrs_ShapeDirPresentation.cxx | 2 +- src/DsgPrs/DsgPrs_SymmetricPresentation.cxx | 16 +- src/DsgPrs/DsgPrs_XYZAxisPresentation.cxx | 4 +- src/ElCLib/ElCLib.cxx | 2 +- src/ElSLib/ElSLib.cxx | 6 +- src/Extrema/Extrema_ExtCS.cxx | 2 +- src/Extrema/Extrema_ExtElC.cxx | 8 +- src/Extrema/Extrema_ExtElC2d.cxx | 20 +-- src/Extrema/Extrema_ExtPElC.cxx | 18 +- src/Extrema/Extrema_ExtPElC2d.cxx | 10 +- src/Extrema/Extrema_ExtPElS.cxx | 64 +++---- src/Extrema/Extrema_ExtPExtS.cxx | 6 +- src/Extrema/Extrema_ExtPRevS.cxx | 26 +-- src/Extrema/Extrema_ExtPSOfRev.gxx | 8 +- src/Extrema/Extrema_GExtCC2d.gxx | 36 ++-- src/FairCurve/FairCurve_Batten.cxx | 12 +- src/FairCurve/FairCurve_MinimalVariation.cxx | 6 +- src/GC/GC_MakeConicalSurface.cxx | 2 +- src/GC/GC_MakeTrimmedCone.cxx | 4 +- src/GC/GC_MakeTrimmedCylinder.cxx | 6 +- src/GProp/GProp_CelGProps.cxx | 2 +- src/GccGeo/GccGeo_Circ2d2TanOn.gxx | 16 +- src/GccGeo/GccGeo_Circ2d2TanRad.gxx | 8 +- src/GccGeo/GccGeo_Circ2dTanOnRad.gxx | 12 +- src/GccIter/GccIter_Circ2d2TanOn.gxx | 14 +- src/GccIter/GccIter_Circ2d3Tan.gxx | 48 ++--- src/GccIter/GccIter_Lin2dTanObl.gxx | 6 +- src/Geom/Geom_Circle.cxx | 4 +- src/Geom/Geom_ConicalSurface.cxx | 8 +- src/Geom/Geom_CylindricalSurface.cxx | 4 +- src/Geom/Geom_Ellipse.cxx | 4 +- src/Geom/Geom_OffsetSurface.cxx | 4 +- src/Geom/Geom_SphericalSurface.cxx | 14 +- src/Geom/Geom_SurfaceOfRevolution.cxx | 4 +- src/Geom/Geom_ToroidalSurface.cxx | 12 +- src/Geom2d/Geom2d_Circle.cxx | 4 +- src/Geom2d/Geom2d_Ellipse.cxx | 4 +- src/Geom2dAdaptor/Geom2dAdaptor_Curve.cxx | 2 +- src/Geom2dAdaptor/Geom2dAdaptor_Curve.lxx | 2 +- src/GeomAdaptor/GeomAdaptor_Curve.cxx | 2 +- src/GeomAdaptor/GeomAdaptor_Surface.cxx | 4 +- src/GeomConvert/GeomConvert.cxx | 4 +- src/GeomConvert/GeomConvert_1.cxx | 6 +- src/GeomFill/GeomFill.cxx | 8 +- src/GeomFill/GeomFill_CircularBlendFunc.cxx | 2 +- src/GeomFill/GeomFill_ConstrainedFilling.cxx | 14 +- src/GeomFill/GeomFill_CorrectedFrenet.cxx | 12 +- src/GeomFill/GeomFill_DraftTrihedron.cxx | 4 +- src/GeomFill/GeomFill_Frenet.cxx | 4 +- src/GeomFill/GeomFill_GuideTrihedronPlan.cxx | 2 +- src/GeomFill/GeomFill_LocationGuide.cxx | 16 +- src/GeomFill/GeomFill_Pipe.cxx | 10 +- .../GeomFill_QuasiAngularConvertor.cxx | 6 +- src/GeomFill/GeomFill_SectionPlacement.cxx | 18 +- src/GeomFill/GeomFill_Sweep.cxx | 26 +-- .../GeomFill_SweepSectionGenerator.cxx | 6 +- src/GeomInt/GeomInt_IntSS_1.cxx | 10 +- src/GeomInt/GeomInt_LineConstructor.cxx | 16 +- src/GeomInt/GeomInt_LineTool.cxx | 2 +- src/GeomLib/GeomLib_IsPlanarSurface.cxx | 12 +- src/GeomPlate/GeomPlate_BuildAveragePlane.cxx | 6 +- src/GeomPlate/GeomPlate_BuildPlateSurface.cxx | 38 ++-- src/GeomPlate/GeomPlate_PlateG1Criterion.cxx | 6 +- src/GeomToIGES/GeomToIGES_GeomCurve.cxx | 8 +- src/GeomToIGES/GeomToIGES_GeomSurface.cxx | 12 +- .../GeomToStep_MakeConicalSurface.cxx | 2 +- ...omToStep_MakeRectangularTrimmedSurface.cxx | 2 +- .../GeometryTest_ConstraintCommands.cxx | 2 +- .../GeometryTest_FairCurveCommands.cxx | 8 +- .../GeomliteTest_SurfaceCommands.cxx | 2 +- src/Graphic2d/Graphic2d_Circle.cxx | 12 +- src/Graphic2d/Graphic2d_CircleMarker.cxx | 2 +- src/Graphic2d/Graphic2d_Drawer.cxx | 16 +- src/Graphic2d/Graphic2d_Ellips.cxx | 6 +- src/Graphic2d/Graphic2d_EllipsMarker.cxx | 6 +- .../Graphic2d_HidingGraphicObject.cxx | 6 +- src/Graphic2d/Graphic2d_Line.cxx | 2 +- src/Graphic2d/Graphic2d_Paragraph.cxx | 8 +- src/Graphic2d/Graphic2d_Primitive.pxx | 18 +- src/Graphic2d/Graphic2d_Text.cxx | 8 +- src/Graphic3d/Graphic3d_ArrayOfPrimitives.cxx | 8 +- src/HLRAlgo/HLRAlgo.cxx | 28 +-- src/HLRBRep/HLRBRep.cxx | 6 +- src/HLRBRep/HLRBRep_PolyAlgo.cxx | 4 +- src/IGESDimen/IGESDimen_FlagNote.cxx | 2 +- .../IGESDimen_ToolDimensionDisplayData.cxx | 2 +- src/IGESDimen/IGESDimen_ToolGeneralNote.cxx | 2 +- .../IGESDimen_ToolNewGeneralNote.cxx | 2 +- src/IGESDimen/IGESDimen_ToolSectionedArea.cxx | 2 +- src/IGESGeom/IGESGeom_CircularArc.cxx | 2 +- src/IGESGeom/IGESGeom_ConicArc.cxx | 4 +- src/IGESGeom/IGESGeom_ToolConicArc.cxx | 10 +- .../IGESGeom_ToolSurfaceOfRevolution.cxx | 2 +- src/IGESGraph/IGESGraph_Color.cxx | 2 +- .../IGESGraph_ToolTextDisplayTemplate.cxx | 2 +- src/IGESToBRep/IGESToBRep_BasicCurve.cxx | 16 +- src/IGESToBRep/IGESToBRep_BasicSurface.cxx | 4 +- src/IGESToBRep/IGESToBRep_TopoCurve.cxx | 2 +- src/IGESToBRep/IGESToBRep_TopoSurface.cxx | 28 +-- src/IntAna/IntAna_Curve.cxx | 2 +- src/IntAna/IntAna_IntConicQuad.cxx | 2 +- src/IntAna/IntAna_IntQuadQuad.cxx | 14 +- src/IntAna/IntAna_QuadQuadGeo.cxx | 14 +- src/IntAna2d/IntAna2d_AnaIntersection_2.cxx | 36 ++-- src/IntAna2d/IntAna2d_AnaIntersection_3.cxx | 24 +-- src/IntAna2d/IntAna2d_AnaIntersection_5.cxx | 4 +- src/IntAna2d/IntAna2d_AnaIntersection_6.cxx | 4 +- src/IntCurve/IntCurve_IConicTool.cxx | 4 +- src/IntCurve/IntCurve_IntConicConic.cxx | 22 +-- src/IntCurve/IntCurve_IntConicConic_1.cxx | 20 +-- src/IntCurve/IntCurve_IntConicConic_Tool.hxx | 2 +- src/IntCurve/IntCurve_IntConicCurveGen.gxx | 4 +- src/IntCurve/IntCurve_IntConicCurveGen.lxx | 4 +- src/IntCurve/IntCurve_IntCurveCurveGen.gxx | 2 +- src/IntCurve/IntCurve_ProjectOnPConicTool.cxx | 8 +- src/IntCurveSurface/IntCurveSurface_Inter.gxx | 8 +- src/IntImpParGen/IntImpParGen_Intersector.gxx | 2 +- src/IntPatch/IntPatch_ALine.cxx | 4 +- src/IntPatch/IntPatch_ALineToWLine.cxx | 26 +-- src/IntPatch/IntPatch_GLine.cxx | 12 +- .../IntPatch_ImpImpIntersection_0.gxx | 16 +- .../IntPatch_ImpImpIntersection_2.gxx | 6 +- .../IntPatch_ImpImpIntersection_4.gxx | 24 +-- src/IntPatch/IntPatch_ImpPrmIntersection.cxx | 142 +++++++-------- src/IntPatch/IntPatch_Intersection.cxx | 8 +- src/IntPatch/IntPatch_LineConstructor.cxx | 20 +-- src/IntPatch/IntPatch_RstInt.cxx | 40 ++--- src/IntTools/IntTools_FClass2d.cxx | 8 +- src/IntTools/IntTools_FaceFace.cxx | 22 +-- src/IntTools/IntTools_LineConstructor.cxx | 16 +- src/IntTools/IntTools_Tools.cxx | 2 +- src/IntTools/IntTools_TopolTool.cxx | 8 +- src/IntWalk/IntWalk_PWalking_1.gxx | 2 +- src/IntWalk/IntWalk_PWalking_3.gxx | 2 +- src/LProp/LProp_AnalyticCurInf.cxx | 8 +- src/LocOpe/LocOpe.cxx | 2 +- src/LocOpe/LocOpe_CSIntersector.cxx | 2 +- src/LocOpe/LocOpe_CurveShapeIntersector.cxx | 2 +- src/LocOpe/LocOpe_FindEdges.cxx | 16 +- src/LocOpe/LocOpe_Generator.cxx | 14 +- src/LocOpe/LocOpe_SplitShape.cxx | 4 +- .../LocalAnalysis_CurveContinuity.cxx | 16 +- .../LocalAnalysis_SurfaceContinuity.cxx | 10 +- src/MAT2d/MAT2d_Tool2d.cxx | 10 +- src/OpenGl/OpenGl_GraphicDriver_710.cxx | 2 +- src/OpenGl/OpenGl_LightBox.cxx | 4 - src/OpenGl/OpenGl_tgl_all.hxx | 6 - src/OpenGl/OpenGl_triedron.cxx | 4 - src/PS/PS_Driver.cxx | 6 +- src/Plate/Plate_FreeGtoCConstraint.cxx | 2 +- src/PlotMgt/PlotMgt_PlotterDriver.cxx | 20 +-- src/PlotMgt/PlotMgt_fillpolyarc.cxx | 24 +-- src/Poly/Poly_MakeLoops.cxx | 12 +- src/Primitives/Primitives_OneAxis.gxx | 4 +- src/ProjLib/ProjLib_ComputeApprox.cxx | 164 +++++++++--------- .../ProjLib_ComputeApproxOnPolarSurface.cxx | 72 ++++---- src/ProjLib/ProjLib_Cone.cxx | 6 +- src/ProjLib/ProjLib_Cylinder.cxx | 2 +- src/ProjLib/ProjLib_Sphere.cxx | 36 ++-- src/ProjLib/ProjLib_Torus.cxx | 16 +- src/Prs2d/Prs2d_Angle.cxx | 24 +-- src/Prs2d/Prs2d_Angle.lxx | 2 +- src/Prs2d/Prs2d_Angularity.cxx | 2 +- src/Prs2d/Prs2d_Arrow.cxx | 2 +- src/Prs2d/Prs2d_Axis.cxx | 6 +- src/Prs2d/Prs2d_Circularity.cxx | 2 +- src/Prs2d/Prs2d_Concentric.cxx | 4 +- src/Prs2d/Prs2d_Cylindric.cxx | 4 +- src/Prs2d/Prs2d_Diameter.cxx | 26 +-- src/Prs2d/Prs2d_Diameter.lxx | 10 +- src/Prs2d/Prs2d_DrawSymbol.cxx | 4 +- src/Prs2d/Prs2d_Length.cxx | 10 +- src/Prs2d/Prs2d_Length.lxx | 2 +- src/Prs2d/Prs2d_LineProfile.cxx | 2 +- src/Prs2d/Prs2d_Parallelism.cxx | 4 +- src/Prs2d/Prs2d_Position.cxx | 2 +- src/Prs2d/Prs2d_Radius.cxx | 26 +-- src/Prs2d/Prs2d_RadiusIndep.cxx | 2 +- src/Prs2d/Prs2d_Repere.cxx | 10 +- src/Prs2d/Prs2d_SurfProfile.cxx | 2 +- src/Prs2d/Prs2d_SymCircular.cxx | 4 +- src/Prs2d/Prs2d_SymTotal.cxx | 6 +- src/Prs2d/Prs2d_Taper.cxx | 2 +- src/Prs2d/Prs2d_ToleranceFrame.cxx | 4 +- src/Prs3d/Prs3d_AnglePresentation.cxx | 2 +- src/Prs3d/Prs3d_Arrow.cxx | 4 +- src/Prs3d/Prs3d_ArrowAspect.cxx | 4 +- src/Prs3d/Prs3d_Datum.gxx | 6 +- src/Prs3d/Prs3d_Drawer.cxx | 4 +- src/Prs3d/Prs3d_PlaneAspect.cxx | 2 +- src/Prs3d/Prs3d_Vector.gxx | 2 +- src/QABUC/QABUC.cxx | 2 +- src/QAMitutoyoUK/QAMitutoyoUK.cxx | 2 +- src/QAMitutoyoUS/QAMitutoyoUS.cxx | 2 +- src/QANIC/QANIC.cxx | 12 +- src/QAOCC/QAOCC.cxx | 14 +- src/QAQuickPen/QAQuickPen.cxx | 6 +- src/QARicardo/QARicardo.cxx | 34 ++-- src/QASamtech/QASamtech.cxx | 2 +- src/QAViewer2dTest/QAViewer2dTest.cxx | 2 +- .../QAViewer2dTest_GeneralCommands.cxx | 10 +- .../QAViewer2dTest_ObjectCommands.cxx | 6 +- .../STEPConstruct_UnitContext.cxx | 2 +- src/STEPControl/STEPControl_ActorRead.cxx | 2 +- src/STEPControl/STEPControl_ActorWrite.cxx | 2 +- src/SWDRAW/SWDRAW_ShapeFix.cxx | 2 +- src/SWDRAW/SWDRAW_ShapeUpgrade.cxx | 2 +- src/Select2D/Select2D_SensitiveArc.cxx | 2 +- src/Select2D/Select2D_SensitiveSegment.cxx | 4 +- src/Select3D/Select3D_SensitiveSegment.cxx | 4 +- .../ShapeAnalysis_CheckSmallFace.cxx | 2 +- src/ShapeAnalysis/ShapeAnalysis_Curve.cxx | 10 +- .../ShapeAnalysis_FreeBoundsProperties.cxx | 2 +- src/ShapeAnalysis/ShapeAnalysis_Surface.cxx | 22 +-- src/ShapeAnalysis/ShapeAnalysis_Wire.cxx | 4 +- .../ShapeCustom_BSplineRestriction.cxx | 8 +- .../ShapeCustom_ConvertToRevolution.cxx | 4 +- src/ShapeFix/ShapeFix_ComposeShell.cxx | 6 +- src/ShapeFix/ShapeFix_Face.cxx | 4 +- src/ShapeFix/ShapeFix_Wire_1.cxx | 12 +- src/ShapeFix/ShapeFix_Wireframe.cxx | 8 +- src/ShapeProcess/ShapeProcess_OperLibrary.cxx | 2 +- src/Standard/Standard_Real.cxx | 18 +- src/Standard/Standard_Real.hxx | 18 -- src/Standard/Standard_math.hxx | 14 +- src/StdSelect/StdSelect_BRepSelectionTool.cxx | 2 +- .../StepToGeom_MakeSurfaceOfRevolution.cxx | 2 +- .../StepToGeom_MakeTrimmedCurve.cxx | 8 +- .../StepToGeom_MakeTrimmedCurve2d.cxx | 4 +- src/StlTransfer/StlTransfer.cxx | 2 +- .../TopOpeBRep_ShapeIntersector.cxx | 10 +- src/TopOpeBRep/TopOpeBRep_vprdeg.cxx | 18 +- .../TopOpeBRepBuild_Builder1.cxx | 4 +- .../TopOpeBRepBuild_BuilderON.cxx | 10 +- .../TopOpeBRepBuild_CorrectFace2d.cxx | 14 +- .../TopOpeBRepTool_CurveTool.cxx | 8 +- .../TopOpeBRepTool_GEOMETRY.cxx | 6 +- src/TopOpeBRepTool/TopOpeBRepTool_PURGE.cxx | 2 +- src/TopOpeBRepTool/TopOpeBRepTool_REGUW.cxx | 4 +- src/TopOpeBRepTool/TopOpeBRepTool_TOOL.cxx | 16 +- .../TopOpeBRepTool_mkTondgE.cxx | 4 +- .../TopoDSToStep_MakeStepFace.cxx | 2 +- .../TopoDSToStep_WireframeBuilder.cxx | 2 +- src/V2d/V2d_CircularGraphicGrid.cxx | 8 +- src/V2d/V2d_RectangularGrid.cxx | 4 +- src/V3d/V3d.cxx | 10 +- src/V3d/V3d_Camera.cxx | 26 +-- src/V3d/V3d_CircularGrid.cxx | 6 +- src/V3d/V3d_DirectionalLight.cxx | 4 +- src/V3d/V3d_PerspectiveView.cxx | 6 +- src/V3d/V3d_PositionLight.cxx | 4 +- src/V3d/V3d_PositionalLight.cxx | 6 +- src/V3d/V3d_SpotLight.cxx | 12 +- src/V3d/V3d_View.cxx | 14 +- src/V3d/V3d_View_4.cxx | 8 +- src/V3d/V3d_Viewer.cxx | 2 +- src/Viewer2dTest/Viewer2dTest.cxx | 2 +- .../Viewer2dTest_DisplayCommands.cxx | 2 +- .../Viewer2dTest_GeneralCommands.cxx | 10 +- .../Viewer2dTest_ObjectCommands.cxx | 6 +- src/ViewerTest/ViewerTest.cxx | 20 +-- src/ViewerTest/ViewerTest_ObjectCommands.cxx | 16 +- .../ViewerTest_RelationCommands.cxx | 4 +- src/Visual3d/Visual3d_Light.cxx | 2 +- src/Visual3d/Visual3d_ViewOrientation.cxx | 6 +- src/VrmlData/VrmlData_ShapeConvert.hxx | 2 +- src/WNT/WNT_DDriver.cxx | 2 +- src/WNT/WNT_ImageManager.cxx | 1 - src/Xw/Xw_Extension.h | 6 +- src/Xw/Xw_draw_buffer.cxx | 8 +- src/Xw/Xw_draw_polytext.cxx | 4 +- src/Xw/Xw_draw_text.cxx | 4 +- src/gce/gce_MakeCone.cxx | 6 +- src/gp/gp_Circ.lxx | 4 +- src/gp/gp_Circ2d.lxx | 4 +- src/gp/gp_Cone.lxx | 6 +- src/gp/gp_Dir.cxx | 4 +- src/gp/gp_Dir.lxx | 6 +- src/gp/gp_Dir2d.cxx | 4 +- src/gp/gp_Dir2d.lxx | 6 +- src/gp/gp_Elips.lxx | 2 +- src/gp/gp_Elips2d.lxx | 2 +- src/gp/gp_Sphere.lxx | 4 +- src/gp/gp_Torus.lxx | 4 +- src/gp/gp_Vec.lxx | 6 +- src/gp/gp_Vec2d.cxx | 4 +- src/gp/gp_Vec2d.lxx | 6 +- src/math/math_DirectPolynomialRoots.cxx | 2 +- src/math/math_TrigonometricFunctionRoots.cxx | 8 +- 438 files changed, 2142 insertions(+), 2188 deletions(-) diff --git a/src/AIS/AIS.cxx b/src/AIS/AIS.cxx index 16e1e00950..115a6bc186 100755 --- a/src/AIS/AIS.cxx +++ b/src/AIS/AIS.cxx @@ -979,7 +979,7 @@ void AIS::ComputeAngleBetweenCurvilinearFaces( const TopoDS_Face & FirstFac if (! Xdirection.IsEqual( ToFirstAttach, Precision::Angular() ) && ! Xdirection.IsOpposite( ToFirstAttach, Precision::Angular() ) && (Xdirection ^ ToFirstAttach) * Cone2->Cone().Axis().Direction() < 0.0e0) - SecondU = 2*PI - SecondU ; + SecondU = 2*M_PI - SecondU ; SecondLine = Handle( Geom_Line )::DownCast( Cone2->UIso( SecondU ) ); @@ -1233,18 +1233,18 @@ Standard_Boolean AIS::InDomain(const Standard_Real fpar, if(lpar > fpar) return ((para >= fpar) && (para <= lpar)); else { // fpar > lpar - Standard_Real delta = 2*PI-fpar; + Standard_Real delta = 2*M_PI-fpar; Standard_Real lp, par, fp; lp = lpar + delta; par = para + delta; - while(lp > 2*PI) lp-=2*PI; - while(par > 2*PI) par-=2*PI; + while(lp > 2*M_PI) lp-=2*M_PI; + while(par > 2*M_PI) par-=2*M_PI; fp = 0.; return ((par >= fp) && (par <= lp)); } } - if (para >= (fpar+2*PI)) return Standard_True; + if (para >= (fpar+2*M_PI)) return Standard_True; if (para <= lpar) return Standard_True; return Standard_False; } @@ -1260,37 +1260,37 @@ Standard_Real AIS::DistanceFromApex(const gp_Elips & elips, { Standard_Real dist; Standard_Real parApex = ElCLib::Parameter ( elips, Apex ); - if(parApex == 0.0 || parApex == PI) + if(parApex == 0.0 || parApex == M_PI) {//Major case if(parApex == 0.0) //pos Apex - dist = (par < PI) ? par : (2*PI - par); + dist = (par < M_PI) ? par : (2*M_PI - par); else //neg Apex - dist = (par < PI) ? ( PI - par) : ( par - PI ); + dist = (par < M_PI) ? ( M_PI - par) : ( par - M_PI ); } else {// Minor case - if(parApex == PI / 2) //pos Apex + if(parApex == M_PI / 2) //pos Apex { - if(par <= parApex + PI && par > parApex) // 3/2*PI < par < PI/2 + if(par <= parApex + M_PI && par > parApex) // 3/2*M_PI < par < M_PI/2 dist = par - parApex; else { - if(par > parApex + PI) // 3/2*PI < par < 2*PI - dist = 2*PI - par + parApex; + if(par > parApex + M_PI) // 3/2*M_PI < par < 2*M_PI + dist = 2*M_PI - par + parApex; else dist = parApex - par; } } - else //neg Apex == 3/2*PI + else //neg Apex == 3/2*M_PI { - if(par <= parApex && par >= PI/2) // PI/2 < par < 3/2*PI + if(par <= parApex && par >= M_PI/2) // M_PI/2 < par < 3/2*M_PI dist = parApex - par; else { - if(par > parApex) // 3/2*PI < par < 2*PI + if(par > parApex) // 3/2*M_PI < par < 2*M_PI dist = par - parApex; else - dist = par + PI/2; // 0 < par < PI/2 + dist = par + M_PI/2; // 0 < par < M_PI/2 } } } diff --git a/src/AIS/AIS_AngleDimension.cxx b/src/AIS/AIS_AngleDimension.cxx index d1bbd95dd9..d8344f7ac9 100755 --- a/src/AIS/AIS_AngleDimension.cxx +++ b/src/AIS/AIS_AngleDimension.cxx @@ -592,7 +592,7 @@ void AIS_AngleDimension::ComputeConeAngle(const Handle(Prs3d_Presentation)& aPre aCurve = aSurf->VIso(midV); myCircle = Handle(Geom_Circle)::DownCast(aCurve)->Circ(); - myPosition = ElCLib::Value(Standard_PI/2.0, myCircle); + myPosition = ElCLib::Value(M_PI / 2.0, myCircle); myAutomaticPosition = Standard_False; } else { @@ -678,7 +678,7 @@ void AIS_AngleDimension::ComputeTwoCurvilinearFacesAngle(const Handle(Prs3d_Pres #endif - if (myVal <= Precision::Angular() || Abs( PI-myVal ) <= Precision::Angular()) + if (myVal <= Precision::Angular() || Abs( M_PI-myVal ) <= Precision::Angular()) DsgPrs_AnglePresentation::Add(aPresentation, myDrawer, myVal, @@ -931,7 +931,7 @@ void AIS_AngleDimension::ComputeTwoEdgesNotNullAngle(const Handle(Prs3d_Presenta Standard_Boolean In1(Standard_False); Standard_Boolean In2(Standard_False); if ( !(Abs(d1.Angle(d2) - Abs(myVal)) <= Precision::Confusion()) - && (Abs(myVal) < PI) ) { + && (Abs(myVal) < M_PI) ) { Standard_Real parcent1 = ElCLib::Parameter(l1->Lin(), myCenter); Standard_Real par11 = ElCLib::Parameter(l1->Lin(), ptat11); Standard_Real par12 = ElCLib::Parameter(l1->Lin(), ptat12); @@ -961,7 +961,7 @@ void AIS_AngleDimension::ComputeTwoEdgesNotNullAngle(const Handle(Prs3d_Presenta gp_Lin gpl2 = l2->Lin(); theaxis = gp_Lin(myCenter,myFDir^mySDir); - if (myVal > PI) { + if (myVal > M_PI) { theaxis.Reverse(); } @@ -1022,7 +1022,7 @@ void AIS_AngleDimension::ComputeTwoEdgesNotNullAngle(const Handle(Prs3d_Presenta mySAttach = ElCLib::Value(par_p2_attach,gpl2); } } - if ( myVal < PI) curpos.SetXYZ(.5*(myFAttach.XYZ()+mySAttach.XYZ())); + if ( myVal < M_PI) curpos.SetXYZ(.5*(myFAttach.XYZ()+mySAttach.XYZ())); else { curpos.SetXYZ(.5*(myFAttach.XYZ()+mySAttach.XYZ())); gp_Vec transl(curpos, myCenter); @@ -1074,9 +1074,9 @@ void AIS_AngleDimension::ComputeTwoEdgesNotNullAngle(const Handle(Prs3d_Presenta Standard_Real udeb = uc1; Standard_Real ufin = uc2; if (uco > ufin) { - if (Abs(myVal) udeb+PI && uco < ufin+PI){ + if (uco > udeb+M_PI && uco < ufin+M_PI){ dist = -dist; } } @@ -1493,7 +1493,7 @@ void AIS_AngleDimension::Compute3DSelection( const Handle( SelectMgr_Selection ) Standard_Real FirstParAngleCirc, LastParAngleCirc, FirstParAttachCirc, LastParAttachCirc; gp_Pnt EndOfArrow1, EndOfArrow2, ProjAttachPoint2; gp_Dir DirOfArrow1, DirOfArrow2; - gp_Dir axisdir = (myVal <= Precision::Angular() || Abs( PI-myVal ) <= Precision::Angular())? + gp_Dir axisdir = (myVal <= Precision::Angular() || Abs( M_PI-myVal ) <= Precision::Angular())? myPlane->Pln().Axis().Direction() : (myFDir ^ mySDir); Standard_Boolean isPlane = (myFirstSurfType == AIS_KOS_Plane)? Standard_True : Standard_False; @@ -1527,7 +1527,7 @@ void AIS_AngleDimension::Compute3DSelection( const Handle( SelectMgr_Selection ) Handle( Select3D_SensitiveCurve ) SensCurve; // Angle's arc or line - if (myVal > Precision::Angular() && Abs( PI-myVal ) > Precision::Angular()) + if (myVal > Precision::Angular() && Abs( M_PI-myVal ) > Precision::Angular()) { curve = new Geom_TrimmedCurve( new Geom_Circle( AngleCirc ), FirstParAngleCirc, LastParAngleCirc ); SensCurve = new Select3D_SensitiveCurve( own, curve ); @@ -1611,12 +1611,12 @@ void AIS_AngleDimension::Compute2DSelection(const Handle(SelectMgr_Selection)& a gp_Lin l2(cu2.Line()); // it is patch! - if (Abs( myVal ) <= Precision::Angular() || Abs( PI - myVal ) <= Precision::Angular()) + if (Abs( myVal ) <= Precision::Angular() || Abs( M_PI - myVal ) <= Precision::Angular()) /* //--------------------------------------------------------- - // Cas de droites paralleles ( <=> angle nul a PI pres) + // Cas de droites paralleles ( <=> angle nul a M_PI pres) if ((Abs(l1.Angle(l2)) < Precision::Angular()) || - (Abs((l1.Angle(l2) - PI)) < Precision::Angular()) ) + (Abs((l1.Angle(l2) - M_PI)) < Precision::Angular()) ) */ { @@ -1677,19 +1677,19 @@ void AIS_AngleDimension::Compute2DSelection(const Handle(SelectMgr_Selection)& a Standard_Real ufin = uc2; if (uco > ufin) { - if (Abs(myVal) udeb+PI && uco < ufin+PI){ - udeb = udeb + PI; - ufin = ufin + PI; + if (uco > udeb+M_PI && uco < ufin+M_PI){ + udeb = udeb + M_PI; + ufin = ufin + M_PI; uc1 = udeb; uc2 = ufin; } } } if (uco > ufin) { - if ((uco-uc2) < (uc1-uco+(2*PI))) ufin = uco; - else udeb = uco - 2*PI; + if ((uco-uc2) < (uc1-uco+(2*M_PI))) ufin = uco; + else udeb = uco - 2*M_PI; } p1 = ElCLib::Value(udeb,cer); p2 = ElCLib::Value(ufin,cer); @@ -1770,11 +1770,11 @@ void AIS_AngleDimension::ComputeNull2DSelection( Standard_Real ufin = uc2; if (uco > ufin) { - if (Abs(myVal) udeb+PI && uco < ufin+PI){ - udeb = udeb + PI; - ufin = ufin + PI; + if (uco > udeb+M_PI && uco < ufin+M_PI){ + udeb = udeb + M_PI; + ufin = ufin + M_PI; uc1 = udeb; uc2 = ufin; } @@ -1782,11 +1782,11 @@ void AIS_AngleDimension::ComputeNull2DSelection( } if (uco > ufin) { - if ((uco-uc2) < (uc1-uco+(2*PI))) { + if ((uco-uc2) < (uc1-uco+(2*M_PI))) { ufin = uco; } else { - udeb = uco - 2*PI; + udeb = uco - 2*M_PI; } } @@ -1929,7 +1929,7 @@ void AIS_AngleDimension::ComputeConeAngleSelection(const Handle(SelectMgr_Select aCurve = aSurf->VIso(midV); myCircle = Handle(Geom_Circle)::DownCast(aCurve)->Circ(); - myPosition = ElCLib::Value(Standard_PI / 2.0, myCircle); + myPosition = ElCLib::Value(M_PI / 2.0, myCircle); myAutomaticPosition = Standard_False; } else { @@ -1966,7 +1966,7 @@ void AIS_AngleDimension::ComputeConeAngleSelection(const Handle(SelectMgr_Select aPnt = Apex; gp_Pnt P1 = ElCLib::Value(0., myCircle); - gp_Pnt P2 = ElCLib::Value(Standard_PI, myCircle); + gp_Pnt P2 = ElCLib::Value(M_PI, myCircle); gce_MakePln mkPln(P1, P2, aPnt); // create a plane whitch defines plane for projection aPosition on it @@ -1994,8 +1994,8 @@ void AIS_AngleDimension::ComputeConeAngleSelection(const Handle(SelectMgr_Select Standard_Real AttParam = ElCLib::Parameter(aCircle2, AttachmentPnt); Standard_Real OppParam = ElCLib::Parameter(aCircle2, OppositePnt); - while ( AttParam >= 2*Standard_PI ) AttParam -= 2*Standard_PI; - while ( OppParam >= 2*Standard_PI ) OppParam -= 2*Standard_PI; + while ( AttParam >= 2 * M_PI ) AttParam -= 2 * M_PI; + while ( OppParam >= 2 * M_PI ) OppParam -= 2 * M_PI; if( myPosition.Distance( myCircle.Location() ) <= myCircle.Radius() ) if( 2 * myCircle.Radius() > aCircle2.Radius() * 0.4 ) IsArrowOut = Standard_False; //four times more than an arrow size @@ -2006,10 +2006,10 @@ void AIS_AngleDimension::ComputeConeAngleSelection(const Handle(SelectMgr_Select param = ElCLib::Parameter(aCircle2, tmpPnt); if(IsArrowOut) { - angle = OppParam - AttParam + Standard_PI/6; //An angle between AttParam and OppParam + 30 degrees - param = AttParam - Standard_PI/12; //out parts of dimension line are 15 degrees + angle = OppParam - AttParam + M_PI / 6; //An angle between AttParam and OppParam + 30 degrees + param = AttParam - M_PI / 12; //out parts of dimension line are 15 degrees - while ( angle > 2*Standard_PI ) angle -= 2*Standard_PI; + while ( angle > 2 * M_PI ) angle -= 2 * M_PI; for( i = 0; i <= 11; i++ ) { //calculating of arc aPnt = ElCLib::Value(param + angle/11 * i, aCircle2); aPnt.Coord(X, Y, Z); @@ -2020,7 +2020,7 @@ void AIS_AngleDimension::ComputeConeAngleSelection(const Handle(SelectMgr_Select else { angle = OppParam - AttParam; param = AttParam; - while ( angle > 2*Standard_PI ) angle -= 2*Standard_PI; + while ( angle > 2 * M_PI ) angle -= 2 * M_PI; for( i = 0; i <= 11; i++ ) { //calculating of arc aPnt = ElCLib::Value(param + angle/11 * i, aCircle2); aPnt.Coord(X, Y, Z); diff --git a/src/AIS/AIS_Circle.cxx b/src/AIS/AIS_Circle.cxx index d5e6330423..983eb90e8c 100755 --- a/src/AIS/AIS_Circle.cxx +++ b/src/AIS/AIS_Circle.cxx @@ -34,7 +34,7 @@ AIS_Circle::AIS_Circle(const Handle(Geom_Circle)& aComponent): AIS_InteractiveObject(PrsMgr_TOP_AllView), myComponent(aComponent), myUStart(0.), -myUEnd(2*PI), +myUEnd(2*M_PI), myCircleIsArc(Standard_False) { } diff --git a/src/AIS/AIS_ConcentricRelation.cxx b/src/AIS/AIS_ConcentricRelation.cxx index 83fa5dacb1..4c13d605b6 100755 --- a/src/AIS/AIS_ConcentricRelation.cxx +++ b/src/AIS/AIS_ConcentricRelation.cxx @@ -266,8 +266,8 @@ void AIS_ConcentricRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection->Add(seg); gp_Ax1 RotateAxis(myCenter, myDir); - gp_Pnt FPnt = myCenter.Rotated(RotateAxis, PI/2); - gp_Pnt SPnt = myCenter.Rotated(RotateAxis, -PI/2); + gp_Pnt FPnt = myCenter.Rotated(RotateAxis, M_PI/2); + gp_Pnt SPnt = myCenter.Rotated(RotateAxis, -M_PI/2); seg = new Select3D_SensitiveSegment(own, FPnt, SPnt); diff --git a/src/AIS/AIS_DiameterDimension.cxx b/src/AIS/AIS_DiameterDimension.cxx index 5ac2b4fe8a..600164767f 100755 --- a/src/AIS/AIS_DiameterDimension.cxx +++ b/src/AIS/AIS_DiameterDimension.cxx @@ -242,17 +242,17 @@ void AIS_DiameterDimension::ComputeArcSelection(const Handle(SelectMgr_Selection Handle(SelectMgr_EntityOwner) own = new SelectMgr_EntityOwner(this,7); gp_Pnt theCenter = myCircle.Location(); - while (lpara > 2*PI) { - fpara -= 2*PI; - lpara -= 2*PI; + while (lpara > 2*M_PI) { + fpara -= 2*M_PI; + lpara -= 2*M_PI; } Standard_Real parat = ElCLib::Parameter(myCircle,myPosition); Standard_Boolean otherside(Standard_False); gp_Pnt attpoint = myPosition; if (!AIS::InDomain(fpara,lpara,parat)) { - Standard_Real otherpar = parat + PI; - if (otherpar > 2*PI) otherpar -= 2*PI; + Standard_Real otherpar = parat + M_PI; + if (otherpar > 2*M_PI) otherpar -= 2*M_PI; if (AIS::InDomain(fpara,lpara,otherpar)) { parat = otherpar; otherside = Standard_True; @@ -530,7 +530,7 @@ void AIS_DiameterDimension::ComputeArcDiameter( myFirstPar = parfirst; myLastPar = parend; if ( parfirst > parend) { - parfirst -= 2*PI; + parfirst -= 2*M_PI; } if (myAutomaticPosition) { Standard_Real pcurpos = (parfirst + parend)/2.; @@ -667,7 +667,7 @@ void AIS_DiameterDimension::ComputeOnePlanarFaceDiameter(const Handle(Prs3d_Pres parfirst = ElCLib::Parameter(myCircle, ptfirst); parend = ElCLib::Parameter(myCircle, ptend); if ( parfirst > parend) { - parfirst -= 2*PI; + parfirst -= 2*M_PI; } Standard_Real parcurPos = (parfirst + parend) * 0.5; curPos = ElCLib::Value(parcurPos, myCircle); diff --git a/src/AIS/AIS_EllipseRadiusDimension.cxx b/src/AIS/AIS_EllipseRadiusDimension.cxx index 8e28e73feb..6c4194997d 100755 --- a/src/AIS/AIS_EllipseRadiusDimension.cxx +++ b/src/AIS/AIS_EllipseRadiusDimension.cxx @@ -79,10 +79,10 @@ void AIS_EllipseRadiusDimension::ComputeGeometry() default: break; } - while (myFirstPar > 2*PI) myFirstPar -= 2*PI; - while (myLastPar > 2*PI) myLastPar -= 2*PI; - while (myFirstPar < 0.0) myFirstPar += 2*PI; - while (myLastPar < 0.0) myLastPar += 2*PI; + while (myFirstPar > 2*M_PI) myFirstPar -= 2*M_PI; + while (myLastPar > 2*M_PI) myLastPar -= 2*M_PI; + while (myFirstPar < 0.0) myFirstPar += 2*M_PI; + while (myLastPar < 0.0) myLastPar += 2*M_PI; } //======================================================================= diff --git a/src/AIS/AIS_EqualDistanceRelation.cxx b/src/AIS/AIS_EqualDistanceRelation.cxx index 53962d471b..c1b63b6f9c 100755 --- a/src/AIS/AIS_EqualDistanceRelation.cxx +++ b/src/AIS/AIS_EqualDistanceRelation.cxx @@ -278,7 +278,7 @@ void AIS_EqualDistanceRelation::ComputeSelection( const Handle( SelectMgr_Select Handle(Geom_Circle) aCircle = Handle(Geom_Circle)::DownCast(aCurve.Curve().Curve()); Standard_Real FirstPar = ElCLib::Parameter(aCircle->Circ(), myAttachPoint1), LastPar = ElCLib::Parameter(aCircle->Circ(), myPoint1); - if (LastPar < FirstPar ) LastPar+=PI*2; + if (LastPar < FirstPar ) LastPar+=M_PI*2; //add sensetive arc Handle(Select3D_SensitiveCircle) circ = new Select3D_SensitiveCircle( own, aCircle, FirstPar, LastPar); @@ -301,7 +301,7 @@ void AIS_EqualDistanceRelation::ComputeSelection( const Handle( SelectMgr_Select Handle(Geom_Circle) aCircle = Handle(Geom_Circle)::DownCast(aCurve.Curve().Curve()); Standard_Real FirstPar = ElCLib::Parameter(aCircle->Circ(), myAttachPoint2), LastPar = ElCLib::Parameter(aCircle->Circ(), myPoint2); - if (LastPar < FirstPar ) LastPar+=PI*2; + if (LastPar < FirstPar ) LastPar+=M_PI*2; //add sensetive arc Handle(Select3D_SensitiveCircle) circ = new Select3D_SensitiveCircle( own,aCircle, FirstPar, LastPar); @@ -324,7 +324,7 @@ void AIS_EqualDistanceRelation::ComputeSelection( const Handle( SelectMgr_Select Handle(Geom_Circle) aCircle = Handle(Geom_Circle)::DownCast(aCurve.Curve().Curve()); Standard_Real FirstPar = ElCLib::Parameter(aCircle->Circ(), myAttachPoint3), LastPar = ElCLib::Parameter(aCircle->Circ(), myPoint3); - if (LastPar < FirstPar ) LastPar+=PI*2; + if (LastPar < FirstPar ) LastPar+=M_PI*2; Handle(Select3D_SensitiveCircle) circ = new Select3D_SensitiveCircle( own, aCircle, FirstPar, LastPar); aSelection->Add( circ ); @@ -350,7 +350,7 @@ void AIS_EqualDistanceRelation::ComputeSelection( const Handle( SelectMgr_Select Handle(Geom_Circle) aCircle = Handle(Geom_Circle)::DownCast(aCurve.Curve().Curve()); Standard_Real FirstPar = ElCLib::Parameter(aCircle->Circ(), myAttachPoint4), LastPar = ElCLib::Parameter(aCircle->Circ(), myPoint4); - if (LastPar < FirstPar ) LastPar+=PI*2; + if (LastPar < FirstPar ) LastPar+=M_PI*2; //add sensetive arc Handle(Select3D_SensitiveCircle) circ = new Select3D_SensitiveCircle( own,aCircle, FirstPar, LastPar); @@ -530,18 +530,18 @@ void AIS_EqualDistanceRelation::ComputeTwoEdgesLength( const Handle( Prs3d_Prese if (PrPnt12.Distance(PrCenter) >Precision::Confusion()) { gp_Dir aDir1(PrPnt12.XYZ() - PrCenter.XYZ()); - Standard_Real anAngle = aDir1.Angle(XDir); //Get the angle in range [0, PI] + Standard_Real anAngle = aDir1.Angle(XDir); //Get the angle in range [0, M_PI] if (aDir1.Dot(YDir) < 0) - anAngle = 2*Standard_PI - anAngle; + anAngle = 2 * M_PI - anAngle; par1 = anAngle; } if (PrPnt22.Distance(PrCenter) >Precision::Confusion()) { gp_Dir aDir2(PrPnt22.XYZ() - PrCenter.XYZ()); - Standard_Real anAngle = aDir2.Angle(XDir); //Get the angle in range [0, PI] + Standard_Real anAngle = aDir2.Angle(XDir); //Get the angle in range [0, M_PI] if (aDir2.Dot(YDir) < 0) - anAngle = 2*Standard_PI - anAngle; + anAngle = 2 * M_PI - anAngle; par2 = anAngle; } @@ -627,7 +627,7 @@ void AIS_EqualDistanceRelation::ComputeTwoVerticesLength( const Handle( Prs3d_Pr else { if (!samePoint) { DirAttach.SetXYZ(SecondAttach.XYZ() - FirstAttach.XYZ()); - DirAttach.Rotate(Plane->Pln().Axis(),PI/2.); + DirAttach.Rotate(Plane->Pln().Axis(),M_PI/2.); } } diff --git a/src/AIS/AIS_EqualRadiusRelation.cxx b/src/AIS/AIS_EqualRadiusRelation.cxx index 95b03eaa61..8848275e2b 100755 --- a/src/AIS/AIS_EqualRadiusRelation.cxx +++ b/src/AIS/AIS_EqualRadiusRelation.cxx @@ -84,8 +84,8 @@ void AIS_EqualRadiusRelation::Compute( const Handle( PrsMgr_PresentationManager3 } else { Standard_Real aPar = ElCLib::Parameter(FirstCirc, myFirstPoint); - if (IntegerPart(0.5*LastPar1/PI) != 0 && aPar < FirstPar1 ) - aPar +=2*PI*IntegerPart(0.5*LastPar1/PI); + if (IntegerPart(0.5*LastPar1/M_PI) != 0 && aPar < FirstPar1 ) + aPar +=2*M_PI*IntegerPart(0.5*LastPar1/M_PI); Standard_Real aRadius = FirstCirc.Radius(); if (Abs(myFirstPoint.Distance(myFirstCenter) - aRadius) >= Precision::Confusion()) @@ -104,8 +104,8 @@ void AIS_EqualRadiusRelation::Compute( const Handle( PrsMgr_PresentationManager3 aPar = ElCLib::Parameter(SecondCirc, mySecondPoint); - if (IntegerPart(0.5*LastPar2/PI) != 0 && aPar < FirstPar2 ) - aPar +=2*PI*IntegerPart(0.5*LastPar2/PI); + if (IntegerPart(0.5*LastPar2/M_PI) != 0 && aPar < FirstPar2 ) + aPar +=2*M_PI*IntegerPart(0.5*LastPar2/M_PI); aRadius = SecondCirc.Radius(); if (Abs(mySecondPoint.Distance(mySecondCenter) - aRadius) >= Precision::Confusion()) diff --git a/src/AIS/AIS_FixRelation.cxx b/src/AIS/AIS_FixRelation.cxx index 04d1fc3262..6b08049aa0 100755 --- a/src/AIS/AIS_FixRelation.cxx +++ b/src/AIS/AIS_FixRelation.cxx @@ -61,7 +61,7 @@ static Standard_Boolean InDomain(const Standard_Real fpar, if (fpar >= 0.) { return ((para >= fpar) && (para <= lpar)); } - if (para >= (fpar+2*PI)) return Standard_True; + if (para >= (fpar+2*M_PI)) return Standard_True; if (para <= lpar) return Standard_True; return Standard_False; } @@ -270,7 +270,7 @@ void AIS_FixRelation::ComputeSelection(const Handle(SelectMgr_Selection)& aSelec dirac.Normalize(); gp_Vec norac = dirac.Crossed(gp_Vec(norm)); gp_Ax1 ax(myPosition, norm); - norac.Rotate(ax, PI/8); + norac.Rotate(ax, M_PI/8); norac*=(myArrowSize/2); gp_Pnt P1 = myPosition.Translated(norac); @@ -414,7 +414,7 @@ gp_Pnt AIS_FixRelation::ComputePosition(const Handle(Geom_Curve)& curv, gp_Vec transvec = vec*myArrowSize; curpos = myPntAttach.Translated(transvec); gp_Ax1 RotAx( myPntAttach, NormPln); - curpos.Rotate(RotAx, PI/10); + curpos.Rotate(RotAx, M_PI/10); } return curpos; @@ -526,10 +526,10 @@ void AIS_FixRelation::ComputeCirclePosition( Standard_Real& plast) { // readjust parametres on the circle - if (plast > 2*PI ) { - Standard_Real nbtours = Floor(plast / (2*PI)); - plast -= nbtours*2*PI; - pfirst -= nbtours*2*PI; + if (plast > 2*M_PI ) { + Standard_Real nbtours = Floor(plast / (2*M_PI)); + plast -= nbtours*2*M_PI; + pfirst -= nbtours*2*M_PI; } if (myAutomaticPosition) { @@ -539,8 +539,8 @@ void AIS_FixRelation::ComputeCirclePosition( Standard_Real circparam = (pfirst + plast)/2.; if ( !InDomain(pfirst,plast,circparam)) { - Standard_Real otherpar = circparam + PI; - if (otherpar > 2*PI) otherpar -= 2*PI; + Standard_Real otherpar = circparam + M_PI; + if (otherpar > 2*M_PI) otherpar -= 2*M_PI; circparam = otherpar; } @@ -563,8 +563,8 @@ void AIS_FixRelation::ComputeCirclePosition( Standard_Real circparam = ElCLib::Parameter(gcirc, pos); if ( !InDomain(pfirst,plast,circparam)) { - Standard_Real otherpar = circparam + PI; - if (otherpar > 2*PI) otherpar -= 2*PI; + Standard_Real otherpar = circparam + M_PI; + if (otherpar > 2*M_PI) otherpar -= 2*M_PI; circparam = otherpar; } diff --git a/src/AIS/AIS_IdenticRelation.cxx b/src/AIS/AIS_IdenticRelation.cxx index 9c5b3d8113..c5ebc2802b 100755 --- a/src/AIS/AIS_IdenticRelation.cxx +++ b/src/AIS/AIS_IdenticRelation.cxx @@ -58,8 +58,8 @@ static Standard_Real Modulo2PI(const Standard_Real ANGLE) { - if ( ANGLE < 0 ) return Modulo2PI(ANGLE + 2*PI); - else if ( ANGLE >= 2*PI ) return Modulo2PI(ANGLE - 2*PI); + if ( ANGLE < 0 ) return Modulo2PI(ANGLE + 2*M_PI); + else if ( ANGLE >= 2*M_PI ) return Modulo2PI(ANGLE - 2*M_PI); return ANGLE; } @@ -68,7 +68,7 @@ static Standard_Boolean IsEqual2PI(const Standard_Real angle1, { Standard_Real diff = Abs(angle1-angle2); if ( diff < precision ) return Standard_True; - else if ( Abs(diff-2*PI) < precision ) return Standard_True; + else if ( Abs(diff-2*M_PI) < precision ) return Standard_True; return Standard_False; } // jfa 15/10/2000 end @@ -187,18 +187,18 @@ static Standard_Boolean ComputeAttach(const gp_Circ& thecirc, Standard_Real deltap = pSAttachM - pFAttach; if ( deltap < 0 ) { - deltap += 2*Standard_PI; - pSAttachM += 2*Standard_PI; + deltap += 2 * M_PI; + pSAttachM += 2 * M_PI; } pSAttachM -= pFAttach; - Standard_Real pmiddleout = pSAttachM/2.0 + Standard_PI; + Standard_Real pmiddleout = pSAttachM/2.0 + M_PI; Standard_Real pcurpos1 = pcurpos; // define where curpos lays if ( pcurpos1 < pFAttach ) { - pcurpos1 = pcurpos1 + 2*Standard_PI - pFAttach; + pcurpos1 = pcurpos1 + 2 * M_PI - pFAttach; if ( pcurpos1 > pSAttachM ) // out { if ( pcurpos1 > pmiddleout ) pcurpos = pFAttach; @@ -255,18 +255,18 @@ static Standard_Boolean ComputeAttach(const gp_Elips& theEll, Standard_Real deltap = pSAttachM - pFAttach; if ( deltap < 0 ) { - deltap += 2*Standard_PI; - pSAttachM += 2*Standard_PI; + deltap += 2 * M_PI; + pSAttachM += 2 * M_PI; } pSAttachM -= pFAttach; - Standard_Real pmiddleout = pSAttachM/2.0 + Standard_PI; + Standard_Real pmiddleout = pSAttachM/2.0 + M_PI; Standard_Real pcurpos1 = pcurpos; // define where curpos lays if ( pcurpos1 < pFAttach ) { - pcurpos1 = pcurpos1 + 2*Standard_PI - pFAttach; + pcurpos1 = pcurpos1 + 2 * M_PI - pFAttach; if ( pcurpos1 > pSAttachM ) // out { if ( pcurpos1 > pmiddleout ) pcurpos = pFAttach; @@ -746,7 +746,7 @@ void AIS_IdenticRelation::ComputeTwoCirclesPresentation(const Handle(Prs3d_Prese myCenter = thecirc->Location(); Standard_Real aSegSize = thecirc->Radius()/5.0; - Standard_Real rad = Standard_PI/5.0; + Standard_Real rad = M_PI / 5.0; // I. Case of 2 complete circles if ( circ1complete && circ2complete ) @@ -984,7 +984,7 @@ void AIS_IdenticRelation::ComputeAutoArcPresentation(const Handle(Geom_Circle)& const Standard_Boolean isstatic) { Standard_Real aSegSize = thecirc->Radius()/5.0; - Standard_Real rad = Standard_PI/5.0; + Standard_Real rad = M_PI / 5.0; Standard_Real pFA = ElCLib::Parameter(thecirc->Circ(),firstp); Standard_Real pSA = ElCLib::Parameter(thecirc->Circ(),lastp); @@ -1027,7 +1027,7 @@ void AIS_IdenticRelation::ComputeNotAutoCircPresentation(const Handle(Geom_Circl curpos.Translate(vprec*1e-5); } - Standard_Real rad = Standard_PI/5.0; + Standard_Real rad = M_PI / 5.0; Standard_Real pcurpos = ElCLib::Parameter(cirNotAuto->Circ(),curpos); Standard_Real pFAttach = pcurpos - rad; Standard_Real pSAttach = pcurpos + rad; @@ -1055,7 +1055,7 @@ void AIS_IdenticRelation::ComputeNotAutoArcPresentation(const Handle(Geom_Circle Standard_Real pSPnt = ElCLib::Parameter(cirNotAuto, pntlast); Standard_Real deltap = Modulo2PI(pSPnt - pFPnt)/2.0; - Standard_Real rad = Standard_PI/5; + Standard_Real rad = M_PI / 5; if ( deltap < rad ) { myFAttach = pntfirst; @@ -1101,7 +1101,7 @@ void AIS_IdenticRelation::ComputeTwoEllipsesPresentation(const Handle(Prs3d_Pres myCenter = theEll->Location(); Standard_Real aSegSize = theEll->MajorRadius()/5.0; - Standard_Real rad = Standard_PI/5.0; + Standard_Real rad = M_PI / 5.0; // I. Case of 2 complete ellipses if ( circ1complete && circ2complete ) @@ -1338,7 +1338,7 @@ void AIS_IdenticRelation::ComputeAutoArcPresentation(const Handle(Geom_Ellipse)& const Standard_Boolean isstatic) { Standard_Real aSegSize = theEll->MajorRadius()/5.0; - Standard_Real rad = Standard_PI/5.0; + Standard_Real rad = M_PI / 5.0; gp_Elips anEll = theEll->Elips(); @@ -1383,7 +1383,7 @@ void AIS_IdenticRelation::ComputeNotAutoElipsPresentation(const Handle(Geom_Elli curpos.Translate(vprec*1e-5); } - Standard_Real rad = Standard_PI/5.0; + Standard_Real rad = M_PI / 5.0; // Standard_Real pcurpos = ElCLib::Parameter(anEll,curpos); GeomAPI_ProjectPointOnCurve aProj (curpos, theEll); Standard_Real pcurpos = aProj.LowerDistanceParameter(); @@ -1414,7 +1414,7 @@ void AIS_IdenticRelation::ComputeNotAutoArcPresentation(const Handle(Geom_Ellips Standard_Real pSPnt = ElCLib::Parameter(anEll, pntlast); Standard_Real deltap = Modulo2PI(pSPnt - pFPnt)/2.0; - Standard_Real rad = Standard_PI/5; + Standard_Real rad = M_PI / 5; if ( deltap < rad ) { myFAttach = pntfirst; diff --git a/src/AIS/AIS_InteractiveContext.cxx b/src/AIS/AIS_InteractiveContext.cxx index c3ef614a3d..c20a674a05 100755 --- a/src/AIS/AIS_InteractiveContext.cxx +++ b/src/AIS/AIS_InteractiveContext.cxx @@ -1650,7 +1650,7 @@ void AIS_InteractiveContext::SetDeviationAngle(const Standard_Real anAngle) Standard_Real AIS_InteractiveContext::DeviationAngle() const { - return PI/180.0e0 ; + return M_PI/180.0e0 ; // return myDefaultDrawer->DeviationAngle(); } @@ -1963,7 +1963,7 @@ void AIS_InteractiveContext::SetColor(const Handle(AIS_InteractiveObject)& anIOb // gp_Dir D =Tr->Component()->XDirection(); // gp_Pnt O = Tr->Component()->Location(); // gp_Vec V(D);V*=Lx/5.; -// T.SetRotation(gp_Ax1(O,D),PI/6.); +// T.SetRotation(gp_Ax1(O,D),M_PI/6.); // T.SetTranslationPart(V); // TopLoc_Location L,IncLoc(T); @@ -2128,7 +2128,7 @@ void AIS_InteractiveContext::SetAngleAndDeviation( { // cout<<" Angle:"<< anAngle <HasInteractiveContext()) anIObj->SetContext(this); diff --git a/src/AIS/AIS_LengthDimension.cxx b/src/AIS/AIS_LengthDimension.cxx index d2af5e1440..d990f8e256 100755 --- a/src/AIS/AIS_LengthDimension.cxx +++ b/src/AIS/AIS_LengthDimension.cxx @@ -930,7 +930,7 @@ void AIS_LengthDimension::ComputeTwoVerticesLength( const Handle( Prs3d_Presenta else { if (!samePoint) { DirAttach = gce_MakeDir(FirstAttach,SecondAttach); - DirAttach.Rotate(Plane->Pln().Axis(),PI/2.); + DirAttach.Rotate(Plane->Pln().Axis(),M_PI/2.); } } diff --git a/src/AIS/AIS_MidPointRelation.cxx b/src/AIS/AIS_MidPointRelation.cxx index cc5f44c8ae..6984286f51 100755 --- a/src/AIS/AIS_MidPointRelation.cxx +++ b/src/AIS/AIS_MidPointRelation.cxx @@ -487,7 +487,7 @@ void AIS_MidPointRelation::ComputePointsOnCirc(const gp_Circ& aCirc, Standard_Real pcurpos = ElCLib::Parameter(aCirc,curpos); - Standard_Real rad = Standard_PI/5.0; + Standard_Real rad = M_PI / 5.0; Standard_Real segm; Standard_Real pFPnt; @@ -507,18 +507,18 @@ void AIS_MidPointRelation::ComputePointsOnCirc(const gp_Circ& aCirc, Standard_Real deltap = pSAttachM - pFAttach; if ( deltap < 0 ) { - deltap += 2*Standard_PI; - pSAttachM += 2*Standard_PI; + deltap += 2 * M_PI; + pSAttachM += 2 * M_PI; } pSAttachM -= pFAttach; - Standard_Real pmiddleout = pSAttachM/2.0 + Standard_PI; + Standard_Real pmiddleout = pSAttachM/2.0 + M_PI; Standard_Real pcurpos1 = pcurpos; // define where curpos lays if ( pcurpos1 < pFAttach ) { - pcurpos1 = pcurpos1 + 2*Standard_PI - pFAttach; + pcurpos1 = pcurpos1 + 2 * M_PI - pFAttach; if ( pcurpos1 > pSAttachM ) // out { segm = Min(rad,deltap*0.75); @@ -614,7 +614,7 @@ void AIS_MidPointRelation::ComputePointsOnElips(const gp_Elips& anEll, Standard_Real pcurpos = ElCLib::Parameter(anEll,curpos); - Standard_Real rad = Standard_PI/5.0; + Standard_Real rad = M_PI / 5.0; Standard_Real segm; Standard_Real pFPnt; @@ -634,18 +634,18 @@ void AIS_MidPointRelation::ComputePointsOnElips(const gp_Elips& anEll, Standard_Real deltap = pSAttachM - pFAttach; if ( deltap < 0 ) { - deltap += 2*Standard_PI; - pSAttachM += 2*Standard_PI; + deltap += 2 * M_PI; + pSAttachM += 2 * M_PI; } pSAttachM -= pFAttach; - Standard_Real pmiddleout = pSAttachM/2.0 + Standard_PI; + Standard_Real pmiddleout = pSAttachM / 2.0 + M_PI; Standard_Real pcurpos1 = pcurpos; // define where curpos lays if ( pcurpos1 < pFAttach ) { - pcurpos1 = pcurpos1 + 2*Standard_PI - pFAttach; + pcurpos1 = pcurpos1 + 2 * M_PI - pFAttach; if ( pcurpos1 > pSAttachM ) // out { segm = Min(rad,deltap*0.75); diff --git a/src/AIS/AIS_RadiusDimension.cxx b/src/AIS/AIS_RadiusDimension.cxx index 544c0c9b36..f38f2ceede 100755 --- a/src/AIS/AIS_RadiusDimension.cxx +++ b/src/AIS/AIS_RadiusDimension.cxx @@ -232,10 +232,10 @@ void AIS_RadiusDimension::InitFirstShape() myCenter = myCircle.Location(); myCircle.SetRadius(myVal); - while (myFirstPar > 2*PI) myFirstPar -= 2*PI; - while (myFirstPar < 0.0 ) myFirstPar += 2*PI; - while (myLastPar > 2*PI) myLastPar -= 2*PI; - while (myLastPar < 0.0 ) myLastPar += 2*PI; + while (myFirstPar > 2*M_PI) myFirstPar -= 2*M_PI; + while (myFirstPar < 0.0 ) myFirstPar += 2*M_PI; + while (myLastPar > 2*M_PI) myLastPar -= 2*M_PI; + while (myLastPar < 0.0 ) myLastPar += 2*M_PI; myPlane = new Geom_Plane(gp_Pln(gp_Ax3(myCircle.Position()))); myFirstLine = gce_MakeLin( myCenter, ElCLib::Value( myFirstPar, myCircle ) ); myLastLine = gce_MakeLin( myCenter, ElCLib::Value( myLastPar, myCircle ) ); @@ -359,18 +359,18 @@ void AIS_RadiusDimension::ComputeRadius( const Handle( Prs3d_Presentation )& aPr Standard_Real PosPar = ElCLib::Parameter( myCircle, myPosition ); if (!AIS::InDomain(myFirstPar, myLastPar, PosPar)) { // not in domain - Standard_Real otherpar = PosPar + PI; - if (otherpar > 2*PI) otherpar -= 2*PI; + Standard_Real otherpar = PosPar + M_PI; + if (otherpar > 2*M_PI) otherpar -= 2*M_PI; if (AIS::InDomain(myFirstPar, myLastPar, otherpar)){ PosPar = otherpar;// parameter on circle myEndOfArrow = ElCLib::Value( PosPar, myCircle ); } else { Standard_Real Teta1 = Abs( PosPar - myFirstPar ), Teta2 = Abs( PosPar - myLastPar ); - if (Teta1 > PI) - Teta1 = 2.0*PI - Teta1; - if (Teta2 > PI) - Teta2 = 2.0*PI - Teta2; + if (Teta1 > M_PI) + Teta1 = 2.0*M_PI - Teta1; + if (Teta2 > M_PI) + Teta2 = 2.0*M_PI - Teta2; if (Teta1 < Teta2) { if(myFirstLine.Contains(myPosition,Precision::Confusion())) diff --git a/src/AIS/AIS_TangentRelation.cxx b/src/AIS/AIS_TangentRelation.cxx index ea8f8a2289..a419723d17 100755 --- a/src/AIS/AIS_TangentRelation.cxx +++ b/src/AIS/AIS_TangentRelation.cxx @@ -227,7 +227,7 @@ static Standard_Boolean ComputeTangencyPoint(const Handle(Geom_Curve)& GC1, ElCLib::D1(par_inter,ellipse->Elips(),P2,aVector2); } // if ( aVector1.IsParallel(aVector2, 100*Precision::Angular()) ) break; - if ( aVector1.IsParallel(aVector2, Standard_PI/360.0) ) break; // 0.5 graduce + if ( aVector1.IsParallel(aVector2, M_PI / 360.0) ) break; // 0.5 graduce } } aPoint = PC1; diff --git a/src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx b/src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx index f1b6d0db76..c226db802b 100755 --- a/src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx +++ b/src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx @@ -1323,7 +1323,7 @@ void Adaptor3d_CurveOnSurface::EvalKPart() if ( D.IsParallel(gp::DX2d(),Precision::Angular())) { // Iso V. if ( STy == GeomAbs_Sphere) { gp_Pnt2d P = myCurve->Line().Location(); - if ( Abs( Abs(P.Y()) -PI/2. ) >= Precision::PConfusion()) { + if ( Abs( Abs(P.Y()) -M_PI/2. ) >= Precision::PConfusion()) { myType = GeomAbs_Circle; gp_Sphere Sph = mySurface->Sphere(); gp_Ax3 Axis = Sph.Position(); diff --git a/src/Adaptor3d/Adaptor3d_SurfaceOfRevolution.cxx b/src/Adaptor3d/Adaptor3d_SurfaceOfRevolution.cxx index 1d2b2a5b84..03846c50dc 100755 --- a/src/Adaptor3d/Adaptor3d_SurfaceOfRevolution.cxx +++ b/src/Adaptor3d/Adaptor3d_SurfaceOfRevolution.cxx @@ -160,7 +160,7 @@ Standard_Real Adaptor3d_SurfaceOfRevolution::FirstUParameter() const Standard_Real Adaptor3d_SurfaceOfRevolution::LastUParameter() const { - return 2*PI; + return 2*M_PI; } //======================================================================= @@ -236,7 +236,7 @@ void Adaptor3d_SurfaceOfRevolution::UIntervals (TColStd_Array1OfReal& T, const GeomAbs_Shape ) const { T(T.Lower() ) = 0.; - T(T.Lower()+1) = 2*PI; + T(T.Lower()+1) = 2*M_PI; } @@ -276,7 +276,7 @@ Handle(Adaptor3d_HSurface) Adaptor3d_SurfaceOfRevolution::UTrim Standard_Real Eps = Precision::PConfusion(); #endif Standard_OutOfRange_Raise_if - ( Abs(First) > Eps || Abs(Last - 2.*PI) > Eps, + ( Abs(First) > Eps || Abs(Last - 2.*M_PI) > Eps, "Adaptor3d_SurfaceOfRevolution : UTrim : Parameters out of range"); Handle(Adaptor3d_HSurfaceOfRevolution) HR = @@ -341,7 +341,7 @@ Standard_Boolean Adaptor3d_SurfaceOfRevolution::IsUPeriodic() const Standard_Real Adaptor3d_SurfaceOfRevolution::UPeriod() const { - return 2*PI; + return 2*M_PI; } //======================================================================= @@ -493,7 +493,7 @@ gp_Vec Adaptor3d_SurfaceOfRevolution::DN(const Standard_Real U, } else { Standard_Real DNR = DNv * myAxeRev.XDirection(); - gp_Vec DNu = ( myAxeRev.XDirection()).Rotated( myAxis, U + NU*PI/2); + gp_Vec DNu = ( myAxeRev.XDirection()).Rotated( myAxis, U + NU*M_PI/2); return ( DNR * DNu); } } diff --git a/src/Adaptor3d/Adaptor3d_TopolTool.cxx b/src/Adaptor3d/Adaptor3d_TopolTool.cxx index 7a73a38c0a..3c75598654 100755 --- a/src/Adaptor3d/Adaptor3d_TopolTool.cxx +++ b/src/Adaptor3d/Adaptor3d_TopolTool.cxx @@ -30,7 +30,7 @@ static void GetConeApexParam(const gp_Cone& C, Standard_Real& U, Standard_Real& else { U = atan2(Ploc.Y(),Ploc.X()); } - if (U < -1.e-16) U += (PI+PI); + if (U < -1.e-16) U += (M_PI+M_PI); else if (U < 0) U = 0; V = sin(SAngle) * ( Ploc.X() * cos(U) + Ploc.Y() * sin(U) - Radius) diff --git a/src/AppParCurves/AppParCurves_Variational.gxx b/src/AppParCurves/AppParCurves_Variational.gxx index b562acb1ab..dcc3f096ee 100755 --- a/src/AppParCurves/AppParCurves_Variational.gxx +++ b/src/AppParCurves/AppParCurves_Variational.gxx @@ -315,7 +315,7 @@ void AppParCurves_Variational::Init() Vt2d=TabV2d.Value(jp2d); Vt2d.Normalize(); Vc2d=TabV2dcurv.Value(jp2d); - if (Abs(Abs(Vc2d.Angle(Vt2d)) - PI/2.) > Precision::Angular()) + if (Abs(Abs(Vc2d.Angle(Vt2d)) - M_PI/2.) > Precision::Angular()) Standard_ConstructionError::Raise(); myTabConstraints->SetValue(jndex++,Vt2d.X()); myTabConstraints->SetValue(jndex++,Vt2d.Y()); @@ -373,7 +373,7 @@ void AppParCurves_Variational::Init() Vt2d=TabV2d.Value(jp2d); Vt2d.Normalize(); Vc2d=TabV2dcurv.Value(jp2d); - if (Abs(Abs(Vc2d.Angle(Vt2d)) - PI/2.) > Precision::Angular()) + if (Abs(Abs(Vc2d.Angle(Vt2d)) - M_PI/2.) > Precision::Angular()) Standard_ConstructionError::Raise(); myTabConstraints->SetValue(jndex++,Vt2d.X()); myTabConstraints->SetValue(jndex++,Vt2d.Y()); diff --git a/src/ApproxInt/ApproxInt_ImpPrmSvSurfaces.gxx b/src/ApproxInt/ApproxInt_ImpPrmSvSurfaces.gxx index a605b86fff..f33f1113f9 100755 --- a/src/ApproxInt/ApproxInt_ImpPrmSvSurfaces.gxx +++ b/src/ApproxInt/ApproxInt_ImpPrmSvSurfaces.gxx @@ -329,8 +329,8 @@ Standard_Boolean ApproxInt_ImpPrmSvSurfaces::Compute( Standard_Real& u1 v2 = X(2)-TranslationV; ComputeParametersOnImplicitSurface(MyISurf,P,u1,v1); if(MyISurf.TypeQuadric() != GeomAbs_Plane) { - while(u1-tu1>PI) u1-=PI+PI; - while(tu1-u1>PI) u1+=PI+PI; + while(u1-tu1>M_PI) u1-=M_PI+M_PI; + while(tu1-u1>M_PI) u1+=M_PI+M_PI; } MyParOnS1.SetCoord(tu1,tv1); MyParOnS2.SetCoord(tu2,tv2); @@ -342,8 +342,8 @@ Standard_Boolean ApproxInt_ImpPrmSvSurfaces::Compute( Standard_Real& u1 v1 = X(2)-TranslationV; ComputeParametersOnImplicitSurface(MyISurf,P,u2,v2); if(MyISurf.TypeQuadric() != GeomAbs_Plane) { - while(u2-tu2>PI) u2-=PI+PI; - while(tu2-u2>PI) u2+=PI+PI; + while(u2-tu2>M_PI) u2-=M_PI+M_PI; + while(tu2-u2>M_PI) u2+=M_PI+M_PI; } MyParOnS1.SetCoord(tu1,tv1); MyParOnS2.SetCoord(tu2,tu2); diff --git a/src/Aspect/Aspect_CircularGrid.cxx b/src/Aspect/Aspect_CircularGrid.cxx index 4f233becdf..fcfd395a60 100755 --- a/src/Aspect/Aspect_CircularGrid.cxx +++ b/src/Aspect/Aspect_CircularGrid.cxx @@ -71,7 +71,7 @@ void Aspect_CircularGrid::Compute(const Quantity_Length X, Standard_Real cosinus = (X-xo)/d; Standard_Real a = ACos(cosinus); Standard_Real ra = RotationAngle(); - if ( Y < yo ) a = 2*Standard_PI - a; + if ( Y < yo ) a = 2 * M_PI - a; #ifdef OCC192_193 n = (Standard_Integer ) ((a-ra)/myAlpha + Sign(0.5, a-ra)) ; #else @@ -149,6 +149,6 @@ return myDivisionNumber; } void Aspect_CircularGrid::Init () { - myAlpha = Standard_PI /Standard_Real(myDivisionNumber); + myAlpha = M_PI / Standard_Real(myDivisionNumber); myA1 = Cos(myAlpha); myB1=Sin(myAlpha); } diff --git a/src/Aspect/Aspect_MarkerStyle.cxx b/src/Aspect/Aspect_MarkerStyle.cxx index f2c6e8d89e..249c39d7c8 100755 --- a/src/Aspect/Aspect_MarkerStyle.cxx +++ b/src/Aspect/Aspect_MarkerStyle.cxx @@ -252,7 +252,7 @@ void Aspect_MarkerStyle::SetPredefinedStyle() { MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+1) ; { Standard_Integer i; - Standard_Real da = 2.*Standard_PI/MAX_O_POINT; + Standard_Real da = 2. * M_PI / MAX_O_POINT; Standard_Real a = 0.; for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) { MyXpoint->SetValue(i,(float ) Cos(a)); @@ -290,7 +290,7 @@ void Aspect_MarkerStyle::SetPredefinedStyle() { MyYpoint = new TShort_HArray1OfShortReal(1,MAX_O_POINT+6) ; MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+6) ; { Standard_Integer i; - Standard_Real da = 2.*Standard_PI/MAX_O_POINT; + Standard_Real da = 2. * M_PI / MAX_O_POINT; Standard_Real a = 0.; for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) { MyXpoint->SetValue(i,(float ) Cos(a)); @@ -328,7 +328,7 @@ void Aspect_MarkerStyle::SetPredefinedStyle() { MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+5) ; { Standard_Integer i; - Standard_Real da = 2.*Standard_PI/MAX_O_POINT; + Standard_Real da = 2. * M_PI / MAX_O_POINT; Standard_Real a = 0.; for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) { MyXpoint->SetValue(i,(float ) Cos(a)); @@ -362,7 +362,7 @@ void Aspect_MarkerStyle::SetPredefinedStyle() { MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+9) ; { Standard_Integer i; - Standard_Real da = 2.*Standard_PI/MAX_O_POINT; + Standard_Real da = 2. * M_PI / MAX_O_POINT; Standard_Real a = 0.; for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) { MyXpoint->SetValue(i,(float ) Cos(a)); @@ -412,7 +412,7 @@ void Aspect_MarkerStyle::SetPredefinedStyle() { MySpoint = new TColStd_HArray1OfBoolean(1,MAX_O_POINT+5) ; { Standard_Integer i; - Standard_Real da = 2.*Standard_PI/MAX_O_POINT; + Standard_Real da = 2. * M_PI / MAX_O_POINT; Standard_Real a = 0.; for( i=1 ; i<= MAX_O_POINT+1 ; i++,a += da ) { MyXpoint->SetValue(i,(float ) Cos(a)); @@ -449,7 +449,7 @@ void Aspect_MarkerStyle::SetPredefinedStyle() { MAX_BALL_LINE*(MAX_O_POINT+1)) ; { Standard_Integer i,j,n = 0; - Standard_Real da = 2.*Standard_PI/MAX_O_POINT; + Standard_Real da = 2. * M_PI / MAX_O_POINT; Standard_Real dr = 1./MAX_BALL_LINE; Standard_Real a,r = 1.; @@ -476,7 +476,7 @@ void Aspect_MarkerStyle::SetPredefinedStyle() { (MAX_BALL_LINE/4)*(MAX_O_POINT+1)) ; { Standard_Integer i,j,n = 0; - Standard_Real da = 2.*Standard_PI/MAX_O_POINT; + Standard_Real da = 2. * M_PI / MAX_O_POINT; Standard_Real dr = 1./MAX_BALL_LINE; Standard_Real a,r = 1.; @@ -503,7 +503,7 @@ void Aspect_MarkerStyle::SetPredefinedStyle() { (MAX_BALL_LINE/3)*(MAX_O_POINT+1)) ; { Standard_Integer i,j,n = 0; - Standard_Real da = 2.*Standard_PI/MAX_O_POINT; + Standard_Real da = 2. * M_PI / MAX_O_POINT; Standard_Real dr = 1./MAX_BALL_LINE; Standard_Real a,r = 1.; @@ -530,7 +530,7 @@ void Aspect_MarkerStyle::SetPredefinedStyle() { (MAX_BALL_LINE)/2*(MAX_O_POINT+1)) ; { Standard_Integer i,j,n = 0; - Standard_Real da = 2.*Standard_PI/MAX_O_POINT; + Standard_Real da = 2. * M_PI / MAX_O_POINT; Standard_Real dr = 1./MAX_BALL_LINE; Standard_Real a,r = 1.; diff --git a/src/Aspect/Aspect_RectangularGrid.cxx b/src/Aspect/Aspect_RectangularGrid.cxx index 8c166c2855..5c3f9e63ca 100755 --- a/src/Aspect/Aspect_RectangularGrid.cxx +++ b/src/Aspect/Aspect_RectangularGrid.cxx @@ -126,8 +126,8 @@ void Aspect_RectangularGrid::Init () { // b1 = Sin (myFirstAngle + RotationAngle() ); // c1 = XOrigin() * b1 - YOrigin() * a1; // -// a2 = Cos (mySecondAngle + RotationAngle() + Standard_PI/2.); -// b2 = Sin (mySecondAngle + RotationAngle() + Standard_PI/2.); +// a2 = Cos (mySecondAngle + RotationAngle() + M_PI / 2.); +// b2 = Sin (mySecondAngle + RotationAngle() + M_PI / 2.); // c2 = XOrigin() * b2 - YOrigin() * a2; #ifdef CSR577 @@ -142,7 +142,7 @@ void Aspect_RectangularGrid::Init () { } if ( angle2 != 0. ) { - angle2 += Standard_PI/2.; + angle2 += M_PI / 2.; a2 = -Sin (angle2); b2 = Cos (angle2); c2 = XOrigin() * b2 - YOrigin() * a2; @@ -154,8 +154,8 @@ void Aspect_RectangularGrid::Init () { b1 = Cos (myFirstAngle + RotationAngle()); c1 = XOrigin() * b1 - YOrigin() * a1; - a2 = -Sin (mySecondAngle + RotationAngle() + Standard_PI/2.); - b2 = Cos (mySecondAngle + RotationAngle() + Standard_PI/2.); + a2 = -Sin (mySecondAngle + RotationAngle() + M_PI / 2.); + b2 = Cos (mySecondAngle + RotationAngle() + M_PI / 2.); c2 = XOrigin() * b2 - YOrigin() * a2; #endif //-zov @@ -163,7 +163,7 @@ void Aspect_RectangularGrid::Init () { Standard_Boolean Aspect_RectangularGrid::CheckAngle(const Standard_Real alpha, const Standard_Real beta) const { - return (Abs( Sin(alpha) * Cos(beta+Standard_PI/2.) - Cos(alpha) * Sin(beta+Standard_PI/2.)) != 0) ; + return (Abs( Sin(alpha) * Cos(beta + M_PI / 2.) - Cos(alpha) * Sin(beta + M_PI / 2.)) != 0) ; } diff --git a/src/BOP/BOP_WireSplitter.cxx b/src/BOP/BOP_WireSplitter.cxx index 2ef11b4221..f520e1ccad 100755 --- a/src/BOP/BOP_WireSplitter.cxx +++ b/src/BOP/BOP_WireSplitter.cxx @@ -715,7 +715,7 @@ Standard_Real AngleIn(const TopoDS_Edge& aEIn, Standard_Real ClockWiseAngle(const Standard_Real aAngleIn, const Standard_Real aAngleOut) { - const Standard_Real aTwoPi=Standard_PI+Standard_PI; + const Standard_Real aTwoPi = M_PI + M_PI; Standard_Real dA, A1, A2, AIn, AOut ; AIn=aAngleIn; @@ -728,7 +728,7 @@ Standard_Real ClockWiseAngle(const Standard_Real aAngleIn, AOut=AOut-aTwoPi; } - A1=AIn+Standard_PI; + A1 = AIn + M_PI; if (A1 >= aTwoPi) { A1=A1-aTwoPi; @@ -815,7 +815,7 @@ Standard_Real Angle2D (const TopoDS_Vertex& aV, Standard_Real Angle (const gp_Dir2d& aDir2D) { const Standard_Real anAngle = gp_Dir2d(1.,0.).Angle(aDir2D); - return ((anAngle < 0.)? anAngle + Standard_PI + Standard_PI : anAngle); + return ((anAngle < 0.)? anAngle + M_PI + M_PI : anAngle); } //======================================================================= @@ -974,7 +974,7 @@ Standard_Boolean RecomputeAngles(const BOP_ListOfEdgeInfo& aLEInfo, bIgnore = (aD > theTol2D); } - if(!bIgnore && (theTol2D > PI)) { + if(!bIgnore && (theTol2D > M_PI)) { Standard_Real udist = fabs(aP2Dx.X() - thePb.X()); Standard_Real vdist = fabs(aP2Dx.Y() - thePb.Y()); Standard_Real aTolU = 2. * UTolerance2D(theVb, theGAS); diff --git a/src/BOPTools/BOPTools_PaveFiller_3.cxx b/src/BOPTools/BOPTools_PaveFiller_3.cxx index 3739680aea..2f2e0ba971 100755 --- a/src/BOPTools/BOPTools_PaveFiller_3.cxx +++ b/src/BOPTools/BOPTools_PaveFiller_3.cxx @@ -3304,8 +3304,8 @@ void CorrectTolR3D(BOPTools_PaveFiller& aPF, // aA=aDN[0].Angle(aDN[1]); aA=fabs(aA); - if (aA>0.5*PI) { - aA=PI-aA; + if (aA>0.5*M_PI) { + aA=M_PI-aA; } // if (aAaAmax) { diff --git a/src/BOPTools/BOPTools_Tools2D.cxx b/src/BOPTools/BOPTools_Tools2D.cxx index 6bfffa7904..0dbe868553 100755 --- a/src/BOPTools/BOPTools_Tools2D.cxx +++ b/src/BOPTools/BOPTools_Tools2D.cxx @@ -674,7 +674,7 @@ static Standard_Real BOPTools_Tools2D::IntermediatePoint (const Standard_Real aFirst, const Standard_Real aLast) { - //define parameter division number as 10*e^(-PI) = 0.43213918 + //define parameter division number as 10*e^(-M_PI) = 0.43213918 const Standard_Real PAR_T = 0.43213918; Standard_Real aParm; aParm=(1.-PAR_T)*aFirst + PAR_T*aLast; diff --git a/src/BOPTools/BOPTools_Tools3D.cxx b/src/BOPTools/BOPTools_Tools3D.cxx index dc22f7267e..a0a33922ea 100755 --- a/src/BOPTools/BOPTools_Tools3D.cxx +++ b/src/BOPTools/BOPTools_Tools3D.cxx @@ -1022,7 +1022,7 @@ static void GetApproxNormalToFaceOnEdgeEx(const TopoDS_Edge& aE, { Standard_Real d12, d1, anAlfa12, anAlfa1, aTwoPI; - aTwoPI=Standard_PI+Standard_PI; + aTwoPI = M_PI + M_PI; gp_Vec aVx1(aPx, aPx1); gp_Dir aDBx1 (aVx1); diff --git a/src/BRepAlgo/BRepAlgo_DSAccess.cxx b/src/BRepAlgo/BRepAlgo_DSAccess.cxx index ac58ca33e1..bf499b387c 100755 --- a/src/BRepAlgo/BRepAlgo_DSAccess.cxx +++ b/src/BRepAlgo/BRepAlgo_DSAccess.cxx @@ -1408,7 +1408,7 @@ void BRepAlgo_DSAccess::PntVtxOnCurve if(iMother) igoodC = iMother; //#ifndef DEB TopOpeBRepDS_PointIterator PII = myHDS->CurvePoints(igoodC); - TopOpeBRepDS_PointIterator& PIt = PII; // skl : I change "PI" to "PIt" + TopOpeBRepDS_PointIterator& PIt = PII; // skl : I change "M_PI" to "PIt" //#else // TopOpeBRepDS_PointIterator& PIt = myHDS->CurvePoints(igoodC); //#endif diff --git a/src/BRepBlend/BRepBlend_RstRstConstRad.cxx b/src/BRepBlend/BRepBlend_RstRstConstRad.cxx index cd0c3d7b2f..69152647b5 100755 --- a/src/BRepBlend/BRepBlend_RstRstConstRad.cxx +++ b/src/BRepBlend/BRepBlend_RstRstConstRad.cxx @@ -290,7 +290,7 @@ Standard_Boolean BRepBlend_RstRstConstRad::IsSolution(const math_Vector& Sol, Angle = ACos(Cosa); if (Sina < 0.) { - Angle = 2.*PI - Angle; + Angle = 2.*M_PI - Angle; } if (Angle > maxang) {maxang = Angle;} @@ -609,7 +609,7 @@ void BRepBlend_RstRstConstRad::Section(const Standard_Real Param, Pfin = ElCLib::Parameter(C, ptrst2); // Test of angles negative and almost null : Special Case - if (Pfin > 1.5 * PI) { + if (Pfin > 1.5 * M_PI) { np.Reverse(); C.SetPosition(gp_Ax2(Center, np, ns)); Pfin = ElCLib::Parameter(C, ptrst2); diff --git a/src/BRepBlend/BRepBlend_RstRstEvolRad.cxx b/src/BRepBlend/BRepBlend_RstRstEvolRad.cxx index 4a973e9172..1c928ff7c2 100755 --- a/src/BRepBlend/BRepBlend_RstRstEvolRad.cxx +++ b/src/BRepBlend/BRepBlend_RstRstEvolRad.cxx @@ -361,7 +361,7 @@ Standard_Boolean BRepBlend_RstRstEvolRad::IsSolution(const math_Vector& Sol, Angle = ACos(Cosa); if (Sina < 0.) { - Angle = 2.*PI - Angle; + Angle = 2.*M_PI - Angle; } if (Angle > maxang) {maxang = Angle;} @@ -678,7 +678,7 @@ void BRepBlend_RstRstEvolRad::Section(const Standard_Real Param, Pfin = ElCLib::Parameter(C, ptrst2); // Test negative and quasi null angles: Special case - if (Pfin > 1.5 * PI) { + if (Pfin > 1.5 * M_PI) { np.Reverse(); C.SetPosition(gp_Ax2(Center, np, ns)); Pfin = ElCLib::Parameter(C, ptrst2); diff --git a/src/BRepBlend/BRepBlend_SurfRstConstRad.cxx b/src/BRepBlend/BRepBlend_SurfRstConstRad.cxx index aa28229574..db4e9e5089 100755 --- a/src/BRepBlend/BRepBlend_SurfRstConstRad.cxx +++ b/src/BRepBlend/BRepBlend_SurfRstConstRad.cxx @@ -406,7 +406,7 @@ Standard_Boolean BRepBlend_SurfRstConstRad::IsSolution(const math_Vector& Sol, Angle = ACos(Cosa); if (Sina <0.) { - Angle = 2.*PI - Angle; + Angle = 2.*M_PI - Angle; } if (Angle>maxang) {maxang = Angle;} @@ -663,7 +663,7 @@ void BRepBlend_SurfRstConstRad::Section(const Standard_Real Param, Pfin = ElCLib::Parameter(C,ptrst); // Test negative and almost null angles : Special case - if (Pfin>1.5*PI) { + if (Pfin>1.5*M_PI) { np.Reverse(); C.SetPosition(gp_Ax2(Center,np,ns)); Pfin = ElCLib::Parameter(C,ptrst); diff --git a/src/BRepBlend/BRepBlend_SurfRstEvolRad.cxx b/src/BRepBlend/BRepBlend_SurfRstEvolRad.cxx index 8d6db066df..dc4ce52531 100755 --- a/src/BRepBlend/BRepBlend_SurfRstEvolRad.cxx +++ b/src/BRepBlend/BRepBlend_SurfRstEvolRad.cxx @@ -463,7 +463,7 @@ const Standard_Real Tol) Angle = ACos(Cosa); if (Sina <0.) { - Angle = 2.*PI - Angle; + Angle = 2.*M_PI - Angle; } if (Angle>maxang) {maxang = Angle;} @@ -708,7 +708,7 @@ gp_Circ& C) Pfin = ElCLib::Parameter(C,ptrst); // Test negative and almost null angles : Single Case - if (Pfin>1.5*PI) { + if (Pfin>1.5*M_PI) { np.Reverse(); C.SetPosition(gp_Ax2(Center,np,ns)); Pfin = ElCLib::Parameter(C,ptrst); diff --git a/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx b/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx index 6bb580eadf..763e6cbad7 100755 --- a/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx +++ b/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx @@ -196,7 +196,7 @@ static Standard_Boolean IsClosedShape(const TopoDS_Shape& theshape, if (TotLength > 0.0) { gp_Pnt p1 = BRep_Tool::Pnt(TopoDS::Vertex(v1)); gp_Pnt p2 = BRep_Tool::Pnt(TopoDS::Vertex(v2)); - return (p1.Distance(p2) < TotLength/(1.2 * PI)); + return (p1.Distance(p2) < TotLength/(1.2 * M_PI)); } return Standard_False; } @@ -983,7 +983,7 @@ void BRepBuilderAPI_Sewing::EvaluateAngulars(TopTools_SequenceOfShape& sequenceS else if ((n.Magnitude()>gp::Resolution()) && (normRef(j).Magnitude()>gp::Resolution())) { nbComputedAngle++; Standard_Real angular = n.Angle(normRef(j)); - if (angular > PI/2.) angular = PI - angular; + if (angular > M_PI/2.) angular = M_PI - angular; cumulateAngular += angular; } } diff --git a/src/BRepCheck/BRepCheck_Wire.cxx b/src/BRepCheck/BRepCheck_Wire.cxx index c2b8f4717a..1a4918551d 100755 --- a/src/BRepCheck/BRepCheck_Wire.cxx +++ b/src/BRepCheck/BRepCheck_Wire.cxx @@ -1549,7 +1549,7 @@ static TopAbs_Orientation GetOrientation(const TopTools_MapOfShape& mapE, angle = DerRef.Angle( Der ); angle *= -1.; if (angle < 0.) - angle += 2.*PI; + angle += 2.*M_PI; if (F.Orientation() == TopAbs_FORWARD) { if (angle < MinAngle) { diff --git a/src/BRepFeat/BRepFeat.cxx b/src/BRepFeat/BRepFeat.cxx index fbb9c68a58..b492bfcd17 100755 --- a/src/BRepFeat/BRepFeat.cxx +++ b/src/BRepFeat/BRepFeat.cxx @@ -511,11 +511,11 @@ void BRepFeat::FaceUntil(const TopoDS_Shape& Sbase, } else if (styp == STANDARD_TYPE(Geom_CylindricalSurface)) { str = new Geom_RectangularTrimmedSurface - (s, 0., 2.*PI, bnd, -bnd, Standard_True, Standard_True); + (s, 0., 2.*M_PI, bnd, -bnd, Standard_True, Standard_True); } else if (styp == STANDARD_TYPE(Geom_ConicalSurface)) { str = new Geom_RectangularTrimmedSurface - (s, 0., 2.*PI, bnd, -bnd, Standard_True, Standard_True); + (s, 0., 2.*M_PI, bnd, -bnd, Standard_True, Standard_True); } else { FUntil.Nullify(); diff --git a/src/BRepFeat/BRepFeat_MakeLinearForm.cxx b/src/BRepFeat/BRepFeat_MakeLinearForm.cxx index 3333096a87..a5e932d4af 100755 --- a/src/BRepFeat/BRepFeat_MakeLinearForm.cxx +++ b/src/BRepFeat/BRepFeat_MakeLinearForm.cxx @@ -199,7 +199,7 @@ void BRepFeat_MakeLinearForm::Init(const TopoDS_Shape& Sbase, gp_Vec nulldir(0, 0, 0); if(!myDir1.IsEqual(nulldir, myTol, myTol)) { Standard_Real ang = myDir1.Angle(myDir); - if(ang != PI) { + if(ang != M_PI) { #ifdef DEB if (trc) cout << " Directions must be opposite" << endl; #endif diff --git a/src/BRepFeat/BRepFeat_MakeRevol.cxx b/src/BRepFeat/BRepFeat_MakeRevol.cxx index 83dbf759eb..5afdf52311 100755 --- a/src/BRepFeat/BRepFeat_MakeRevol.cxx +++ b/src/BRepFeat/BRepFeat_MakeRevol.cxx @@ -229,7 +229,7 @@ void BRepFeat_MakeRevol::Perform(const Standard_Real Angle) myGluedF.Clear(); myPerfSelection = BRepFeat_NoSelection; PerfSelectionValid(); - Standard_Boolean RevolComp = (2*PI-Abs(Angle) <= Precision::Angular()); + Standard_Boolean RevolComp = (2*M_PI-Abs(Angle) <= Precision::Angular()); LocOpe_Revol theRevol; Standard_Real angledec = 0.; TopExp_Explorer exp; @@ -238,7 +238,7 @@ void BRepFeat_MakeRevol::Perform(const Standard_Real Angle) if (!mySkface.IsNull() || !mySlface.IsEmpty()) { for (exp.Init(mySbase,TopAbs_FACE); exp.More(); exp.Next()) { if (exp.Current().IsSame(mySkface)) { - angledec = PI/5; // pourquoi pas + angledec = M_PI/5; // pourquoi pas if (myFuse) angledec = -angledec; break; } @@ -362,7 +362,7 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& Until) Standard_ConstructionError::Raise(); } if (!mySkface.IsNull() && Until.IsSame(mySkface)) { - Angle = 2*PI; + Angle = 2*M_PI; TourComplet = Standard_True; } myGluedF.Clear(); @@ -375,10 +375,10 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& Until) ShapeUntilValid(); // Do systematically almost complete revolution -// BRepSweep_Revol theRevol(myPbase,myAxis,2.*PI-10.*Precision::Angular()); +// BRepSweep_Revol theRevol(myPbase,myAxis,2.*M_PI-10.*Precision::Angular()); LocOpe_Revol theRevol; if(!TourComplet) { - Angle = 2.*PI- 3*PI/180.; + Angle = 2.*M_PI- 3*M_PI/180.; #ifdef DEB if (trc) cout << " No complete Revolution" << endl; #endif @@ -565,7 +565,7 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& From, } LocOpe_Revol theRevol; - theRevol.Perform(myPbase, myAxis, 2*PI); + theRevol.Perform(myPbase, myAxis, 2*M_PI); TopoDS_Shape VraiRevol = theRevol.Shape(); MajMap(myPbase,theRevol,myMap,myFShape,myLShape); @@ -607,9 +607,9 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& From, } if (ASI2.IsDone() && ASI2.NbPoints(1) >=1) { Standard_Real pr1 = ASI2.Point(1,1).Parameter(); - pr1 = ElCLib::InPeriod(pr1,PrU-2*PI,PrU); + pr1 = ElCLib::InPeriod(pr1,PrU-2*M_PI,PrU); Standard_Real pr2 = ASI2.Point(1,ASI2.NbPoints(1)).Parameter(); - pr2 = ElCLib::InPeriod(pr2,PrU-2*PI,PrU); + pr2 = ElCLib::InPeriod(pr2,PrU-2*M_PI,PrU); OrF = OrU; FFrom = ASI2.Point(1,1).Face(); PrF = Max(pr1, pr2); @@ -689,7 +689,7 @@ void BRepFeat_MakeRevol::PerformThruAll() Standard_Boolean trc = BRepFeat_GettraceFEAT(); if (trc) cout << "BRepFeat_MakeRevol::PerformThruAll()" << endl; #endif - Perform(2.*PI); + Perform(2.*M_PI); } //======================================================================= @@ -728,7 +728,7 @@ void BRepFeat_MakeRevol::PerformUntilAngle(const TopoDS_Shape& Until, ShapeUntilValid(); // Produce systematicallt an almost complete revolution -// BRepSweep_Revol theRevol(myPbase,myAxis,2.*PI-10.*Precision::Angular()); +// BRepSweep_Revol theRevol(myPbase,myAxis,2.*M_PI-10.*Precision::Angular()); LocOpe_Revol theRevol; theRevol.Perform(myPbase, myAxis, Angle); TopoDS_Shape VraiRevol = theRevol.Shape(); diff --git a/src/BRepFeat/BRepFeat_MakeRevolutionForm.cxx b/src/BRepFeat/BRepFeat_MakeRevolutionForm.cxx index 4cac84ab7f..8ee1198524 100755 --- a/src/BRepFeat/BRepFeat_MakeRevolutionForm.cxx +++ b/src/BRepFeat/BRepFeat_MakeRevolutionForm.cxx @@ -221,13 +221,13 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase, if(Rad <= height) Rad = height + 0.01*height; - myAngle1 = asin(H1/Rad) + PI/10.; - myAngle2 = asin(H2/Rad) + PI/10.; + myAngle1 = asin(H1/Rad) + M_PI/10.; + myAngle2 = asin(H2/Rad) + M_PI/10.; - if((myAngle1 - PI/2) > Precision::Confusion()) - myAngle1 = PI/2; - if((myAngle2 - PI/2) > Precision::Confusion()) - myAngle2 = PI/2; + if((myAngle1 - M_PI/2) > Precision::Confusion()) + myAngle1 = M_PI/2; + if((myAngle2 - M_PI/2) > Precision::Confusion()) + myAngle2 = M_PI/2; mySkface.Nullify(); myPbase.Nullify(); diff --git a/src/BRepFeat/BRepFeat_RibSlot.cxx b/src/BRepFeat/BRepFeat_RibSlot.cxx index f13bf3643a..13f05648cf 100755 --- a/src/BRepFeat/BRepFeat_RibSlot.cxx +++ b/src/BRepFeat/BRepFeat_RibSlot.cxx @@ -1023,7 +1023,7 @@ TopoDS_Face BRepFeat_RibSlot::ChoiceOfFaces(TopTools_ListOfShape& faces, gp_Ax1 Axe(pp, Pln->Position().Direction()); for ( Standard_Integer i = 1; i <=8; i++) { Handle(Geom_Curve) L = - Handle(Geom_Curve)::DownCast(l1->Rotated(Axe, i*PI/9.)); + Handle(Geom_Curve)::DownCast(l1->Rotated(Axe, i*M_PI/9.)); scur.Append(L); Counter++; } diff --git a/src/BRepFill/BRepFill.cxx b/src/BRepFill/BRepFill.cxx index ca64d26d14..846a6114c4 100755 --- a/src/BRepFill/BRepFill.cxx +++ b/src/BRepFill/BRepFill.cxx @@ -912,8 +912,8 @@ void BRepFill::SearchOrigin(TopoDS_Wire & W, Ve *= -1; } angle = Ve.Angle(Dir); - if (angle > PI) angle = 2*PI - angle; - forward = (angle <= PI/2); + if (angle > M_PI) angle = 2*M_PI - angle; + forward = (angle <= M_PI/2); // Reconstruction MakeWire( Edges, rangdeb, forward, W); diff --git a/src/BRepFill/BRepFill_CompatibleWires.cxx b/src/BRepFill/BRepFill_CompatibleWires.cxx index 92b68db166..812e5b6a98 100755 --- a/src/BRepFill/BRepFill_CompatibleWires.cxx +++ b/src/BRepFill/BRepFill_CompatibleWires.cxx @@ -554,8 +554,8 @@ static void Transform (const Standard_Boolean WithRotation, gp_Ax1 Norm(Pos2,norm2); Standard_Real ang = axe1.AngleWithRef(axe2,norm2); if (!WithRotation) { - if (ang>PI/2) ang = ang - PI; - if (ang<-PI/2) ang = ang + PI; + if (ang>M_PI/2) ang = ang - M_PI; + if (ang<-M_PI/2) ang = ang + M_PI; } ang *= sign; Pnew = Pnew.Rotated (Norm,ang); @@ -1742,7 +1742,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean polar ) // recherche du vertex correspondant a la projection conique Standard_Real angmin, angV, eta = Precision::Angular(); TopoDS_Vertex Vopti; - angmin = PI/2; + angmin = M_PI/2; distmini = Precision::Infinite(); gp_Dir dir0(gp_Vec(Pnew,P.Location())); for (Standard_Integer ii=1;ii<=SeqV.Length();ii++) { @@ -1755,7 +1755,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean polar ) gp_Dir dir1(gp_Vec(Pnew,P1)); angV = dir1.Angle(dir0); } - if (angV>PI/2) angV = PI - angV; + if (angV>M_PI/2) angV = M_PI - angV; if (angmin>angV+eta) { distmini = dist; angmin = angV; @@ -2009,11 +2009,11 @@ void BRepFill_CompatibleWires::SearchOrigin() norm = vec1 ^ vec2; gp_Ax1 Norm(P.Location(),norm); Standard_Real ang = vec1.AngleWithRef(vec2,norm); - if (ang > PI/2.0) - ang = PI - ang; - if (ang < -PI/2.0) - ang = -PI - ang; - if (Abs(ang-PI/2.0) M_PI/2.0) + ang = M_PI - ang; + if (ang < -M_PI/2.0) + ang = -M_PI - ang; + if (Abs(ang-M_PI/2.0) PI/2) D.Reverse(); + if (ang > M_PI/2) D.Reverse(); Handle(Geom_Line) L = new (Geom_Line) (P, D); Handle(Geom_Curve) TC = new (Geom_TrimmedCurve) (L, 0, Length); @@ -534,7 +534,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B, V = V1.Crossed(V2); if (F.Orientation() == TopAbs_REVERSED) V.Reverse(); if (V.Magnitude() > 1.e-10) { - out = myDir.Angle(V) > PI/2; + out = myDir.Angle(V) > M_PI/2; } if (out == IsInternal) { myShell.Reverse(); @@ -705,7 +705,7 @@ static Standard_Boolean GoodOrientation(const Bnd_Box& B, } // Subtract State1 - if (myDir.Angle(SP.Normal()) < PI/2) State1 = TopAbs_IN; + if (myDir.Angle(SP.Normal()) < M_PI/2) State1 = TopAbs_IN; else State1 = TopAbs_OUT; } diff --git a/src/BRepFill/BRepFill_Evolved.cxx b/src/BRepFill/BRepFill_Evolved.cxx index 60a7fc7415..019d80b867 100755 --- a/src/BRepFill/BRepFill_Evolved.cxx +++ b/src/BRepFill/BRepFill_Evolved.cxx @@ -2189,7 +2189,7 @@ void BRepFill_Evolved::MakePipe(const TopoDS_Edge& SE, gp_Trsf trsf; if (Side(myProfile,BRepFill_Confusion()) > 3) { // side right - trsf.SetRotation(gp::OZ(),PI); + trsf.SetRotation(gp::OZ(),M_PI); } TopLoc_Location DumLoc (trsf); TopoDS_Shape aLocalShape = myProfile.Moved(DumLoc); @@ -2276,7 +2276,7 @@ void BRepFill_Evolved::MakeRevol(const TopoDS_Edge& SE, gp_Trsf trsf; if (Side(myProfile,BRepFill_Confusion()) > 3) { // side right - trsf.SetRotation(gp::OZ(),PI); + trsf.SetRotation(gp::OZ(),M_PI); } TopLoc_Location DumLoc (trsf); TopoDS_Shape aLocalShape = myProfile.Moved(DumLoc); @@ -2294,7 +2294,7 @@ void BRepFill_Evolved::MakeRevol(const TopoDS_Edge& SE, // Position of the sewing on the edge of the spine // so that the bissectrices didn't cross the sewings. gp_Trsf dummy; - dummy.SetRotation(AxeRev, 1.5*PI); + dummy.SetRotation(AxeRev, 1.5*M_PI); TopLoc_Location DummyLoc(dummy); GenProf.Move(DummyLoc); diff --git a/src/BRepFill/BRepFill_Filling.cxx b/src/BRepFill/BRepFill_Filling.cxx index 018cef9863..1228172851 100755 --- a/src/BRepFill/BRepFill_Filling.cxx +++ b/src/BRepFill/BRepFill_Filling.cxx @@ -396,7 +396,7 @@ void BRepFill_Filling::FindExtremitiesOfHoles( TopTools_MapOfShape& WireMap, TCo #else Standard_Boolean IsLast ; #endif - Standard_Real MinAngle = PI; + Standard_Real MinAngle = M_PI; for (MapIt.Initialize( WireMap ); MapIt.More(); MapIt.Next()) { diff --git a/src/BRepFill/BRepFill_MultiLine.cxx b/src/BRepFill/BRepFill_MultiLine.cxx index 5d852b2c94..e51bebbb46 100755 --- a/src/BRepFill/BRepFill_MultiLine.cxx +++ b/src/BRepFill/BRepFill_MultiLine.cxx @@ -215,11 +215,11 @@ myKPart(0) } if (GAS1.GetType() == GeomAbs_Sphere) { if (myIsoU1) - ElCLib::AdjustPeriodic(-PI/2.,PI/2., + ElCLib::AdjustPeriodic(-M_PI/2.,M_PI/2., Precision::PConfusion(), Umin, Umax); else - ElCLib::AdjustPeriodic(-PI/2.,PI/2., + ElCLib::AdjustPeriodic(-M_PI/2.,M_PI/2., Precision::PConfusion(), Vmin, Vmax); } @@ -331,11 +331,11 @@ myKPart(0) } if (GAS2.GetType() == GeomAbs_Sphere) { if (myIsoU2) - ElCLib::AdjustPeriodic(-PI/2.,PI/2., + ElCLib::AdjustPeriodic(-M_PI/2.,M_PI/2., Precision::PConfusion(), Umin, Umax); else - ElCLib::AdjustPeriodic(-PI/2.,PI/2., + ElCLib::AdjustPeriodic(-M_PI/2.,M_PI/2., Precision::PConfusion(), Vmin, Vmax); } @@ -612,7 +612,7 @@ static gp_Pnt2d ValueOnFace(const Standard_Real U, Standard_Real Ang = Axis.Angle(D12d); if ( !TheU.Circle().IsDirect()) Ang = -Ang; UU = ElCLib::InPeriod( Ang, TheU.FirstParameter(), - TheU.FirstParameter() + 2*PI); + TheU.FirstParameter() + 2*M_PI); Dist = TheU.Circle().Radius(); } else { diff --git a/src/BRepFill/BRepFill_OffsetWire.cxx b/src/BRepFill/BRepFill_OffsetWire.cxx index dfb7fb1c2e..079bf7e603 100755 --- a/src/BRepFill/BRepFill_OffsetWire.cxx +++ b/src/BRepFill/BRepFill_OffsetWire.cxx @@ -1601,7 +1601,7 @@ Standard_Integer CutEdge (const TopoDS_Edge& E, //if (E.Orientation() == TopAbs_REVERSED) CT2d->Reverse(); if (CT2d->BasisCurve()->IsKind(STANDARD_TYPE(Geom2d_Circle)) && - ( Abs(f-l) >= PI) ) { + ( Abs(f-l) >= M_PI) ) { return 0; //--------------------------- // Cut closed circle. @@ -1844,7 +1844,7 @@ void MakeOffset (const TopoDS_Edge& E, Adaptor3d_OffsetCurve Off(AHC,-anOffset); Handle(Geom2d_Circle) CC = new Geom2d_Circle(Off.Circle()); - Standard_Real Delta = 2*PI - l + f; + Standard_Real Delta = 2*M_PI - l + f; f -= 0.2*Delta; l += 0.2*Delta; G2dOC = new Geom2d_TrimmedCurve(CC,f,l); diff --git a/src/BRepFill/BRepFill_Sweep.cxx b/src/BRepFill/BRepFill_Sweep.cxx index 7076eec922..793f98cd3f 100755 --- a/src/BRepFill/BRepFill_Sweep.cxx +++ b/src/BRepFill/BRepFill_Sweep.cxx @@ -842,11 +842,11 @@ static Standard_Boolean Filling(const TopoDS_Shape& EF, Standard_Boolean ToReverseResult = Standard_False; gp_Vec d1u; d1u = Surf->DN(0, (f1+l1)/2, 1, 0); - if (d1u.Angle(TangentOnPart1) > PI/2) { //Invert everything + if (d1u.Angle(TangentOnPart1) > M_PI/2) { //Invert everything ToReverseResult = Standard_True; /* axe.Reverse(); - Angle = 2*PI - Angle; + Angle = 2*M_PI - Angle; Rev = new (Geom_SurfaceOfRevolution) (Prof1, axe); Surf = new (Geom_RectangularTrimmedSurface) (Rev, 0, Angle, f1, l1); @@ -1148,7 +1148,7 @@ static Standard_Boolean Filling(const TopoDS_Shape& EF, AS->D1(P2d.X(), P2d.Y(), P, D1U, D1V); N2 = D1U^D1V; - if ( (F1.Orientation() == TopAbs_REVERSED) ^ (N1.Angle(N2)>PI/2) ) + if ( (F1.Orientation() == TopAbs_REVERSED) ^ (N1.Angle(N2)>M_PI/2) ) Result.Orientation(TopAbs_REVERSED); else Result.Orientation(TopAbs_FORWARD); diff --git a/src/BRepFill/BRepFill_TrimShellCorner.cxx b/src/BRepFill/BRepFill_TrimShellCorner.cxx index 65c65e8b69..8809e4153f 100755 --- a/src/BRepFill/BRepFill_TrimShellCorner.cxx +++ b/src/BRepFill/BRepFill_TrimShellCorner.cxx @@ -2281,8 +2281,8 @@ static Standard_Boolean ChooseSection(const TopoDS_Shape& Comp, continue; Standard_Real Angle = aPln.Axis().Angle( bis.Axis() ); - if (Angle > PI/2) - Angle = PI - Angle; + if (Angle > M_PI/2) + Angle = M_PI - Angle; if (Angle < MinAngle) { @@ -2341,7 +2341,7 @@ static Standard_Boolean ChoosePlane(const TopoDS_Shape& Comp, TColgp_Array1OfPnt Origins( 0, NumberOfEdges*2-1 ); TColgp_Array1OfDir Normals( 0, NumberOfEdges*2-1 ); TColStd_Array1OfBoolean IsSingular( 0, NumberOfEdges*2-1 ); - Standard_Real MinAngle = PI/2; + Standard_Real MinAngle = M_PI/2; Standard_Integer MinInd; for (ind = 0; ind < NumberOfEdges*2; ind++) { @@ -2355,8 +2355,8 @@ static Standard_Boolean ChoosePlane(const TopoDS_Shape& Comp, Origins(ind) = Axe.Location(); Normals(ind) = Axe.Direction(); Standard_Real Angle = bis.Angle( Axe ); - if (Angle > PI/2) - Angle = PI - Angle; + if (Angle > M_PI/2) + Angle = M_PI - Angle; if (Angle < MinAngle) { MinAngle = Angle; @@ -2366,15 +2366,15 @@ static Standard_Boolean ChoosePlane(const TopoDS_Shape& Comp, } gp_Ax2 TheAxe( Origins(MinInd), Normals(MinInd) ); - Standard_Real MaxAngleWithPln = PI/16; + Standard_Real MaxAngleWithPln = M_PI/16; TColStd_SequenceOfInteger iseq; TColgp_SequenceOfPnt Pseq; for (ind = 0; ind < NumberOfEdges*2; ind++) if (!IsSingular(ind)) { Standard_Real Angle = Normals(ind).Angle( TheAxe.Direction() ); - if (Angle > PI/2) - Angle = PI - Angle; + if (Angle > M_PI/2) + Angle = M_PI - Angle; if (Angle <= MaxAngleWithPln) { iseq.Append(ind); diff --git a/src/BRepFill/BRepFill_TrimSurfaceTool.cxx b/src/BRepFill/BRepFill_TrimSurfaceTool.cxx index 0e3ce9b685..eef2a69038 100755 --- a/src/BRepFill/BRepFill_TrimSurfaceTool.cxx +++ b/src/BRepFill/BRepFill_TrimSurfaceTool.cxx @@ -166,7 +166,7 @@ static Standard_Real EvalPhase(const TopoDS_Edge& Edge, gp_Pnt P = GAS.Value(0., V); if ( gp_Vec(Axis.Location(), P).Dot(Axis.XDirection()) < 0.) - return PI; + return M_PI; else return 0.; } @@ -339,7 +339,7 @@ static void EvalParameters(const TopoDS_Edge& Edge, case GeomAbs_Cone: { //---------------------------------------------------------- // if myFace1 is not at the same side of the apex as the point - // of parameter 0 0 on the cone => phase = PI. + // of parameter 0 0 on the cone => phase = M_PI. //---------------------------------------------------------- Axis = GAS.Cone().Position(); Phase = EvalPhase(Edge,Face,GAS,Axis); @@ -352,7 +352,7 @@ static void EvalParameters(const TopoDS_Edge& Edge, case GeomAbs_SurfaceOfRevolution: { //---------------------------------------------------------- // if myFace1 is not at the same side of the apex as the point - // of parameter 0 0 on the cone => phase = PI. + // of parameter 0 0 on the cone => phase = M_PI. //---------------------------------------------------------- Handle(Geom_SurfaceOfRevolution) GSRev = Handle(Geom_SurfaceOfRevolution)::DownCast(GS); @@ -373,7 +373,7 @@ static void EvalParameters(const TopoDS_Edge& Edge, Standard_Real U = Axis.XDirection(). AngleWithRef(D1,Axis.XDirection()^Axis.YDirection()); U += Phase; - if ( U < 0.) U += 2*PI; + if ( U < 0.) U += 2*M_PI; P = gp_Pnt(Bis->FirstParameter(), U, 0.); Seq.Append(P); diff --git a/src/BRepGProp/BRepGProp_Face.cxx b/src/BRepGProp/BRepGProp_Face.cxx index afb4dfb3d6..9c48f441e1 100755 --- a/src/BRepGProp/BRepGProp_Face.cxx +++ b/src/BRepGProp/BRepGProp_Face.cxx @@ -318,7 +318,7 @@ void BRepGProp_Face::UKnots(TColStd_Array1OfReal& Knots) const case GeomAbs_Cone: case GeomAbs_Sphere: case GeomAbs_Torus: - Knots(1) = 0.0; Knots(2) = PI*2.0/3.0; Knots(3) = PI*4.0/3.0; Knots(4) = PI*6.0/3.0; + Knots(1) = 0.0; Knots(2) = M_PI*2.0/3.0; Knots(3) = M_PI*4.0/3.0; Knots(4) = M_PI*6.0/3.0; break; case GeomAbs_BSplineSurface: (*((Handle(Geom_BSplineSurface)*)&((mySurface.Surface()).Surface())))->UKnots(Knots); @@ -343,10 +343,10 @@ void BRepGProp_Face::VKnots(TColStd_Array1OfReal& Knots) const Knots(1) = mySurface.FirstUParameter(); Knots(2) = mySurface.LastUParameter(); break; case GeomAbs_Sphere: - Knots(1) = -PI/2.0; Knots(2) = 0.0; Knots(3) = +PI/2.0; + Knots(1) = -M_PI/2.0; Knots(2) = 0.0; Knots(3) = +M_PI/2.0; break; case GeomAbs_Torus: - Knots(1) = 0.0; Knots(2) = PI*2.0/3.0; Knots(3) = PI*4.0/3.0; Knots(4) = PI*6.0/3.0; + Knots(1) = 0.0; Knots(2) = M_PI*2.0/3.0; Knots(3) = M_PI*4.0/3.0; Knots(4) = M_PI*6.0/3.0; break; case GeomAbs_BSplineSurface: (*((Handle(Geom_BSplineSurface)*)&((mySurface.Surface()).Surface())))->VKnots(Knots); @@ -450,7 +450,7 @@ void BRepGProp_Face::LKnots(TColStd_Array1OfReal& Knots) const break; case GeomAbs_Circle: case GeomAbs_Ellipse: - Knots(1) = 0.0; Knots(2) = PI*2.0/3.0; Knots(3) = PI*4.0/3.0; Knots(2) = PI*6.0/3.0; + Knots(1) = 0.0; Knots(2) = M_PI*2.0/3.0; Knots(3) = M_PI*4.0/3.0; Knots(2) = M_PI*6.0/3.0; break; case GeomAbs_Parabola: case GeomAbs_Hyperbola: diff --git a/src/BRepLib/BRepLib.cxx b/src/BRepLib/BRepLib.cxx index d3a1b84bca..314f9037c7 100755 --- a/src/BRepLib/BRepLib.cxx +++ b/src/BRepLib/BRepLib.cxx @@ -1511,7 +1511,7 @@ static Standard_Boolean tgtfaces(const TopoDS_Edge& Ed, Standard_Boolean rev1 = (F1.Orientation() == TopAbs_REVERSED); Standard_Boolean rev2 = (F2.Orientation() == TopAbs_REVERSED); - Standard_Real f,l,eps, angmax = -PI; + Standard_Real f,l,eps, angmax = -M_PI; #ifndef DEB Standard_Real ang =0.; #else diff --git a/src/BRepMesh/BRepMesh_Classifier.cxx b/src/BRepMesh/BRepMesh_Classifier.cxx index c3587657b1..48e61f2ab1 100755 --- a/src/BRepMesh/BRepMesh_Classifier.cxx +++ b/src/BRepMesh/BRepMesh_Classifier.cxx @@ -48,7 +48,7 @@ static Standard_Integer debclass = 0; #endif static const Standard_Real MIN_DIST = 2.E-5; //EPA: real mesh is created in the grid 10E5x10E5, so intersection should be cheched // with double of discretization. -static const Standard_Real PARALL_COND = Sin(PI/3.0); +static const Standard_Real PARALL_COND = Sin(M_PI/3.0); static const Standard_Real RESOLUTION = 1.0E-16; //OCC319 @@ -119,7 +119,7 @@ void BRepMesh_Classifier::AnalizeWire (const TColgp_SequenceOfPnt2d& theSeqPnt2 const Standard_Real a = A.Angle(B); const Standard_Real aa = Abs(a); // Check if vectors are opposite - if (aa > Precision::Angular() && (PI - aa) > Precision::Angular()) + if (aa > Precision::Angular() && (M_PI - aa) > Precision::Angular()) { theangle += a; p1 = p2; @@ -340,7 +340,7 @@ static Standard_Boolean checkWiresIntersection(const Standard_Integer aLoopArea += triangle2Area(p2, p3); aLoopArea += triangle2Area(p3, aStartPoint); // Last triangle area - if( Abs(aLoopArea)/2 > PI*MIN_DIST ) + if( Abs(aLoopArea)/2 > M_PI*MIN_DIST ) { if ( findNextIntersection ) { diff --git a/src/BRepOffset/BRepOffset.cxx b/src/BRepOffset/BRepOffset.cxx index 1df4c51aa4..c3b1a435bf 100755 --- a/src/BRepOffset/BRepOffset.cxx +++ b/src/BRepOffset/BRepOffset.cxx @@ -60,7 +60,7 @@ Handle(Geom_Surface) BRepOffset::Surface(const Handle(Geom_Surface)& Surface, Result = new Geom_CylindricalSurface( Axis, Radius); } else if ( Radius <= -Tol ){ - Axis.Rotate(gp_Ax1(Axis.Location(),Axis.Direction()),PI); + Axis.Rotate(gp_Ax1(Axis.Location(),Axis.Direction()),M_PI); Result = new Geom_CylindricalSurface( Axis, Abs(Radius)); Status = BRepOffset_Reversed; } @@ -84,7 +84,7 @@ Handle(Geom_Surface) BRepOffset::Surface(const Handle(Geom_Surface)& Surface, gp_Vec Z( Axis.Direction()); Z *= - Offset * Sin(Alpha); Axis.Translate(Z); - Axis.Rotate(gp_Ax1(Axis.Location(),Axis.Direction()),PI); + Axis.Rotate(gp_Ax1(Axis.Location(),Axis.Direction()),M_PI); Alpha = -Alpha; } Result = new Geom_ConicalSurface(Axis, Alpha, Radius); @@ -102,7 +102,7 @@ Handle(Geom_Surface) BRepOffset::Surface(const Handle(Geom_Surface)& Surface, Result = new Geom_SphericalSurface(Axis, Radius); } else if ( Radius <= -Tol ) { - Axis.Rotate(gp_Ax1(Axis.Location(),Axis.Direction()),PI); + Axis.Rotate(gp_Ax1(Axis.Location(),Axis.Direction()),M_PI); Axis.ZReverse(); Result = new Geom_SphericalSurface(Axis, -Radius); Status = BRepOffset_Reversed; diff --git a/src/BRepOffset/BRepOffset_MakeOffset.cxx b/src/BRepOffset/BRepOffset_MakeOffset.cxx index 20b2ef7637..524c8ce323 100755 --- a/src/BRepOffset/BRepOffset_MakeOffset.cxx +++ b/src/BRepOffset/BRepOffset_MakeOffset.cxx @@ -1946,7 +1946,7 @@ void BRepOffset_MakeOffset::CorrectConicalFaces() ElSLib::Parameters( theSphere, fPnt, Uf, Vf ); ElSLib::Parameters( theSphere, lPnt, Ul, Vl ); if (Abs(Ul) <= Precision::Confusion()) - Ul = 2.*PI; + Ul = 2.*M_PI; Handle(Geom_Curve) aCurv = aSphSurf->VIso(Vf); /* if (!isFirstFace) @@ -2078,11 +2078,11 @@ void BRepOffset_MakeOffset::CorrectConicalFaces() Standard_Real Vfirst, Vlast; if (p2d1.Y() > 0.) { - Vfirst = p2d1.Y(); Vlast = PI/2.; + Vfirst = p2d1.Y(); Vlast = M_PI/2.; } else { - Vfirst = -PI/2.; Vlast = p2d1.Y(); + Vfirst = -M_PI/2.; Vlast = p2d1.Y(); } TopoDS_Face NewSphericalFace = BRepLib_MakeFace(aSphSurf, Ufirst, Ulast, Vfirst, Vlast, Precision::Confusion()); TopoDS_Edge OldEdge; @@ -2154,12 +2154,12 @@ void BRepOffset_MakeOffset::CorrectConicalFaces() apex = OffSurf->Value( Uapex, Vapex ); //Making new degenerated edge - Handle(Geom2d_Line) theLine = GCE2d_MakeLine( gp_Pnt2d( 0., Vapex ), gp_Pnt2d( 2.*PI, Vapex ) ); + Handle(Geom2d_Line) theLine = GCE2d_MakeLine( gp_Pnt2d( 0., Vapex ), gp_Pnt2d( 2.*M_PI, Vapex ) ); TopoDS_Edge NewEdge; BB.MakeEdge( NewEdge ); NewEdge.Orientation(TopAbs_FORWARD); BB.UpdateEdge( NewEdge, theLine, Cone, Precision::Confusion() ); - BB.Range( NewEdge, 0., 2.*PI ); + BB.Range( NewEdge, 0., 2.*M_PI ); BB.SameParameter( NewEdge, Standard_True ); BB.SameRange( NewEdge, Standard_True ); BB.Degenerated( NewEdge, Standard_True ); @@ -2250,12 +2250,12 @@ void BRepOffset_MakeOffset::CorrectConicalFaces() apex = OffSurf->Value( Uapex, Vapex ); //Making new degenerated edge - Handle(Geom2d_Line) theLine = GCE2d_MakeLine( gp_Pnt2d( 0., Vapex ), gp_Pnt2d( 2.*PI, Vapex ) ); + Handle(Geom2d_Line) theLine = GCE2d_MakeLine( gp_Pnt2d( 0., Vapex ), gp_Pnt2d( 2.*M_PI, Vapex ) ); TopoDS_Edge NewEdge; BB.MakeEdge( NewEdge ); NewEdge.Orientation(TopAbs_FORWARD); BB.UpdateEdge( NewEdge, theLine, Cone, BRep_Tool::Tolerance( Circ ) ); - BB.Range( NewEdge, 0., 2.*PI ); + BB.Range( NewEdge, 0., 2.*M_PI ); BB.SameParameter( NewEdge, Standard_True ); BB.SameRange( NewEdge, Standard_True ); BB.Degenerated( NewEdge, Standard_True ); @@ -2358,9 +2358,9 @@ void BRepOffset_MakeOffset::CorrectConicalFaces() ElSLib::Parameters( theSphere, OrPnt, Uor, Vor ); TopoDS_Face NewFace; if (Vor > 0.) - NewFace = BRepLib_MakeFace( theSphere, 0., 2.*PI, Vor, PI/2. ); + NewFace = BRepLib_MakeFace( theSphere, 0., 2.*M_PI, Vor, M_PI/2. ); else - NewFace = BRepLib_MakeFace( theSphere, 0., 2.*PI, -PI/2., Vor ); + NewFace = BRepLib_MakeFace( theSphere, 0., 2.*M_PI, -M_PI/2., Vor ); //Updating the bound of NewFace TopoDS_Edge Bound; @@ -2436,12 +2436,12 @@ void BRepOffset_MakeOffset::CorrectConicalFaces() apex = OffSurf->Value( Uapex, Vapex ); //Making new degenerated edge - Handle(Geom2d_Line) theLine = GCE2d_MakeLine( gp_Pnt2d( 0., Vapex ), gp_Pnt2d( 2.*PI, Vapex ) ); + Handle(Geom2d_Line) theLine = GCE2d_MakeLine( gp_Pnt2d( 0., Vapex ), gp_Pnt2d( 2.*M_PI, Vapex ) ); TopoDS_Edge NewEdge; BB.MakeEdge( NewEdge ); NewEdge.Orientation(TopAbs_FORWARD); BB.UpdateEdge( NewEdge, theLine, Cone, BRep_Tool::Tolerance( Circ ) ); - BB.Range( NewEdge, 0., 2.*PI ); + BB.Range( NewEdge, 0., 2.*M_PI ); BB.SameParameter( NewEdge, Standard_True ); BB.SameRange( NewEdge, Standard_True ); BB.Degenerated( NewEdge, Standard_True ); diff --git a/src/BRepOffset/BRepOffset_Offset.cxx b/src/BRepOffset/BRepOffset_Offset.cxx index 54bb683572..c67f9640be 100755 --- a/src/BRepOffset/BRepOffset_Offset.cxx +++ b/src/BRepOffset/BRepOffset_Offset.cxx @@ -203,7 +203,7 @@ static void ComputeCurve3d(TopoDS_Edge Edge, if ( D.IsParallel(gp::DX2d(),Precision::Angular())) { // Iso V. if ( STy == GeomAbs_Sphere) { gp_Pnt2d P = C.Line().Location(); - if ( Abs( Abs(P.Y()) -PI/2. ) < Precision::PConfusion()) { + if ( Abs( Abs(P.Y()) -M_PI/2. ) < Precision::PConfusion()) { TheBuilder.Degenerated(Edge, Standard_True); } else { @@ -1391,18 +1391,18 @@ void BRepOffset_Offset::Init(const TopoDS_Vertex& Vertex, // V` = +/- PI + 2 k` PI gp_Pnt2d P2d = PCurve->Value(f); Standard_Boolean IsToAdjust = Standard_False; - if ( P2d.Y() < -PI/2.) { + if ( P2d.Y() < -M_PI/2.) { IsToAdjust = Standard_True; - PCurve->Mirror(gp_Ax2d(gp_Pnt2d(0.,-PI/2.),gp::DX2d())); + PCurve->Mirror(gp_Ax2d(gp_Pnt2d(0.,-M_PI/2.),gp::DX2d())); } - else if ( P2d.Y() > PI/2.) { + else if ( P2d.Y() > M_PI/2.) { IsToAdjust = Standard_True; - PCurve->Mirror(gp_Ax2d(gp_Pnt2d(0., PI/2.),gp::DX2d())); + PCurve->Mirror(gp_Ax2d(gp_Pnt2d(0., M_PI/2.),gp::DX2d())); } if ( IsToAdjust) { // set the u firstpoint in [0,2*pi] - gp_Vec2d Tr( PI, 0.); - if ( P2d.X() > PI) Tr.Reverse(); + gp_Vec2d Tr( M_PI, 0.); + if ( P2d.X() > M_PI) Tr.Reverse(); PCurve->Translate(Tr); } diff --git a/src/BRepOffset/BRepOffset_Tool.cxx b/src/BRepOffset/BRepOffset_Tool.cxx index e94d7b0f67..19e162296b 100755 --- a/src/BRepOffset/BRepOffset_Tool.cxx +++ b/src/BRepOffset/BRepOffset_Tool.cxx @@ -994,7 +994,7 @@ static Standard_Boolean BSplineEdges(const TopoDS_Edge& E1, if (Der1.Magnitude() <= gp::Resolution() || Der2.Magnitude() <= gp::Resolution()) - angle = PI/2.; + angle = M_PI/2.; else angle = Der1.Angle(Der2); @@ -1031,7 +1031,7 @@ static Standard_Real AngleWireEdge(const TopoDS_Wire& aWire, if (V11.IsSame(CV) && V21.IsSame(CV)) { BSplineEdges( FirstEdge, anEdge, 0, 0, Angle ); - Angle = PI - Angle; + Angle = M_PI - Angle; } else if (V11.IsSame(CV) && V22.IsSame(CV)) BSplineEdges( FirstEdge, anEdge, 0, 1, Angle ); @@ -1040,7 +1040,7 @@ static Standard_Real AngleWireEdge(const TopoDS_Wire& aWire, else { BSplineEdges( FirstEdge, anEdge, 1, 1, Angle ); - Angle = PI - Angle; + Angle = M_PI - Angle; } return Angle; } diff --git a/src/BRepOffsetAPI/BRepOffsetAPI_DraftAngle.cxx b/src/BRepOffsetAPI/BRepOffsetAPI_DraftAngle.cxx index 5f63240ba9..958932b061 100755 --- a/src/BRepOffsetAPI/BRepOffsetAPI_DraftAngle.cxx +++ b/src/BRepOffsetAPI/BRepOffsetAPI_DraftAngle.cxx @@ -804,18 +804,18 @@ void BRepOffsetAPI_DraftAngle::CorrectWires() Pmid = bc2d.Value( (bc2d.FirstParameter()+bc2d.LastParameter())/2. ); gp_Vec2d offset; Standard_Boolean translate = Standard_False; - if (Pfirst.X()-2.*PI > Precision::Confusion() || - Plast.X()-2.*PI > Precision::Confusion() || - Pmid.X()-2.*PI > Precision::Confusion()) + if (Pfirst.X()-2.*M_PI > Precision::Confusion() || + Plast.X()-2.*M_PI > Precision::Confusion() || + Pmid.X()-2.*M_PI > Precision::Confusion()) { - offset.SetCoord( -2.*PI, 0 ); + offset.SetCoord( -2.*M_PI, 0 ); translate = Standard_True; } if (Pfirst.X() < -Precision::Confusion() || Plast.X() < -Precision::Confusion() || Pmid.X() < -Precision::Confusion()) { - offset.SetCoord( 2.*PI, 0 ); + offset.SetCoord( 2.*M_PI, 0 ); translate = Standard_True; } if (translate) diff --git a/src/BRepPrim/BRepPrim_Cone.cxx b/src/BRepPrim/BRepPrim_Cone.cxx index ae02c93e33..2517142204 100755 --- a/src/BRepPrim/BRepPrim_Cone.cxx +++ b/src/BRepPrim/BRepPrim_Cone.cxx @@ -31,7 +31,7 @@ BRepPrim_Cone::BRepPrim_Cone(const Standard_Real Angle, Standard_DomainError::Raise("cone with null height"); if (myHalfAngle*Height < Precision::Confusion()) Standard_DomainError::Raise("cone with null angle"); - if ((PI/2 - myHalfAngle)*Height < Precision::Confusion()) + if ((M_PI/2 - myHalfAngle)*Height < Precision::Confusion()) Standard_DomainError::Raise("cone with angle > PI/2"); // cut at top @@ -50,7 +50,7 @@ BRepPrim_Cone::BRepPrim_Cone(const Standard_Real Angle) : myHalfAngle(Angle), myRadius(0.) { - if ((Angle < 0) || (Angle > PI/2)) + if ((Angle < 0) || (Angle > M_PI/2)) Standard_DomainError::Raise("cone with angle <0 or > PI/2"); VMin(0.); SetMeridian(); @@ -68,7 +68,7 @@ BRepPrim_Cone::BRepPrim_Cone(const Standard_Real Angle, myHalfAngle(Angle), myRadius(0.) { - if ((Angle < 0) || (Angle > PI/2)) + if ((Angle < 0) || (Angle > M_PI/2)) Standard_DomainError::Raise("cone with angle <0 or > PI/2"); VMin(0.); SetMeridian(); @@ -84,7 +84,7 @@ BRepPrim_Cone::BRepPrim_Cone(const Standard_Real Angle, BRepPrim_Revolution( Axes, 0,RealLast()), myHalfAngle(Angle) { - if ((Angle < 0) || (Angle > PI/2)) + if ((Angle < 0) || (Angle > M_PI/2)) Standard_DomainError::Raise("cone with angle <0 or > PI/2"); VMin(0.); SetMeridian(); diff --git a/src/BRepPrim/BRepPrim_Sphere.cxx b/src/BRepPrim/BRepPrim_Sphere.cxx index 066a6b8bbd..f3bdb69dcd 100755 --- a/src/BRepPrim/BRepPrim_Sphere.cxx +++ b/src/BRepPrim/BRepPrim_Sphere.cxx @@ -16,8 +16,8 @@ // parameters on the meridian -#define PMIN (-0.5*PI) -#define PMAX (0.5*PI) +#define PMIN (-0.5*M_PI) +#define PMAX (0.5*M_PI) //======================================================================= //function : BRepPrim_Sphere @@ -82,7 +82,7 @@ void BRepPrim_Sphere::SetMeridian() // Offset the parameters on the meridian // to trim the edge in 3pi/2, 5pi/2 - SetMeridianOffset(2*PI); + SetMeridianOffset(2*M_PI); gp_Dir D = Axes().YDirection(); D.Reverse(); diff --git a/src/BRepPrim/BRepPrim_Torus.cxx b/src/BRepPrim/BRepPrim_Torus.cxx index 2da452a020..c0f4e0e8cc 100755 --- a/src/BRepPrim/BRepPrim_Torus.cxx +++ b/src/BRepPrim/BRepPrim_Torus.cxx @@ -24,7 +24,7 @@ BRepPrim_Torus::BRepPrim_Torus(const gp_Ax2& Position, const Standard_Real Major, const Standard_Real Minor) : - BRepPrim_Revolution(Position,0,2*PI), + BRepPrim_Revolution(Position,0,2*M_PI), myMajor(Major), myMinor(Minor) { @@ -38,7 +38,7 @@ BRepPrim_Torus::BRepPrim_Torus(const gp_Ax2& Position, BRepPrim_Torus::BRepPrim_Torus(const Standard_Real Major, const Standard_Real Minor) : - BRepPrim_Revolution(gp::XOY(),0,2*PI), + BRepPrim_Revolution(gp::XOY(),0,2*M_PI), myMajor(Major), myMinor(Minor) { @@ -54,7 +54,7 @@ BRepPrim_Torus::BRepPrim_Torus(const gp_Pnt& Center, const Standard_Real Major, const Standard_Real Minor) : BRepPrim_Revolution(gp_Ax2(Center,gp_Dir(0,0,1),gp_Dir(1,0,0)), - 0,2*PI), + 0,2*M_PI), myMajor(Major), myMinor(Minor) { diff --git a/src/BRepSweep/BRepSweep_Revol.cxx b/src/BRepSweep/BRepSweep_Revol.cxx index 2a32579149..fd77e0724e 100755 --- a/src/BRepSweep/BRepSweep_Revol.cxx +++ b/src/BRepSweep/BRepSweep_Revol.cxx @@ -41,10 +41,10 @@ BRepSweep_Revol::BRepSweep_Revol const gp_Ax1& Ax, const Standard_Boolean C): myRotation(S.Oriented(TopAbs_FORWARD), - NumShape(2*PI), - Location(Ax,2*PI), - Axe(Ax,2*PI), - Angle(2*PI), + NumShape(2*M_PI), + Location(Ax,2*M_PI), + Axe(Ax,2*M_PI), + Angle(2*M_PI), C) { @@ -125,7 +125,7 @@ TopoDS_Shape BRepSweep_Revol::LastShape(const TopoDS_Shape& aGenS) Sweep_NumShape BRepSweep_Revol::NumShape(const Standard_Real D)const { Sweep_NumShape N; - if (Abs(Angle(D) - 2*PI)<=Precision::Angular()){ + if (Abs(Angle(D) - 2*M_PI)<=Precision::Angular()){ N.Init(2,TopAbs_EDGE,Standard_True, Standard_False,Standard_False); } @@ -172,8 +172,8 @@ gp_Ax1 BRepSweep_Revol::Axe(const gp_Ax1& Ax, const Standard_Real D)const Standard_Real BRepSweep_Revol::Angle(const Standard_Real D)const { Standard_Real d = Abs(D); - while(d>(2*PI + Precision::Angular())){ - d = d - 2*PI; + while(d>(2*M_PI + Precision::Angular())){ + d = d - 2*M_PI; } return d; } diff --git a/src/BRepSweep/BRepSweep_Rotation.cxx b/src/BRepSweep/BRepSweep_Rotation.cxx index 20848760ae..4d2a238c41 100755 --- a/src/BRepSweep/BRepSweep_Rotation.cxx +++ b/src/BRepSweep/BRepSweep_Rotation.cxx @@ -454,7 +454,7 @@ void BRepSweep_Rotation::SetGeneratingPCurve Standard_Real U = BC.FirstParameter(); point = BC.Value(U); if (point.Distance(tor.Location()) < Precision::Confusion()) { - v = PI; + v = M_PI; // modified by NIZHNY-EAP Wed Mar 1 17:49:29 2000 ___BEGIN___ u = 0.; } @@ -463,15 +463,15 @@ void BRepSweep_Rotation::SetGeneratingPCurve tor.MinorRadius(),point,u,v); } // u = 0.; - v = ElCLib::InPeriod(v,0.,2*PI); - if((2*PI - v) <= Precision::PConfusion()) v -= 2*PI; + v = ElCLib::InPeriod(v,0.,2*M_PI); + if((2*M_PI - v) <= Precision::PConfusion()) v -= 2*M_PI; if (aDirV.Index() == 2) { Standard_Real uLeft = u-myAng; - ElCLib::AdjustPeriodic(-PI,PI,Precision::PConfusion(),uLeft,u); + ElCLib::AdjustPeriodic(-M_PI,M_PI,Precision::PConfusion(),uLeft,u); } else { Standard_Real uRight = u+myAng; - ElCLib::AdjustPeriodic(-PI,PI,Precision::PConfusion(),u,uRight); + ElCLib::AdjustPeriodic(-M_PI,M_PI,Precision::PConfusion(),u,uRight); } // modified by NIZHNY-EAP Wed Mar 1 17:49:32 2000 ___END___ pnt2d.SetCoord(u,v-U); @@ -575,7 +575,7 @@ void BRepSweep_Rotation::SetDirectingPCurve BRepAdaptor_Curve BC(TopoDS::Edge(aGenE)); p1 = BC.Value(BC.FirstParameter()); if (p1.Distance(tor.Location()) < Precision::Confusion()){ - v1 = PI; + v1 = M_PI; // modified by NIZHNY-EAP Thu Mar 2 09:43:26 2000 ___BEGIN___ u1 = 0.; // modified by NIZHNY-EAP Thu Mar 2 15:28:59 2000 ___END___ @@ -586,16 +586,16 @@ void BRepSweep_Rotation::SetDirectingPCurve } p2 = BC.Value(BC.LastParameter()); if (p2.Distance(tor.Location()) < Precision::Confusion()){ - v2 = PI; + v2 = M_PI; } else { ElSLib::TorusParameters(tor.Position(),tor.MajorRadius(), tor.MinorRadius(),p2,u2,v2); } - ElCLib::AdjustPeriodic(0.,2*PI,Precision::PConfusion(),v1,v2); + ElCLib::AdjustPeriodic(0.,2*M_PI,Precision::PConfusion(),v1,v2); // modified by NIZHNY-EAP Thu Mar 2 15:29:04 2000 ___BEGIN___ u2 = u1 + myAng; - ElCLib::AdjustPeriodic(-PI,PI,Precision::PConfusion(),u1,u2); + ElCLib::AdjustPeriodic(-M_PI,M_PI,Precision::PConfusion(),u1,u2); if (aGenV.Orientation()==TopAbs_FORWARD){ p22d.SetCoord(u1,v1); } @@ -747,7 +747,7 @@ Standard_Boolean BRepSweep_Rotation::GDDShapeIsToAdd aGenS.ShapeType() == TopAbs_FACE && aDirS.Type() == TopAbs_EDGE && aSubDirS.Type() == TopAbs_VERTEX ){ - return ( Abs(myAng - 2 * PI) > Precision::Angular() ); + return ( Abs(myAng - 2 * M_PI) > Precision::Angular() ); } else if ( aNewShape.ShapeType() == TopAbs_FACE && aNewSubShape.ShapeType() == TopAbs_EDGE && @@ -757,7 +757,7 @@ Standard_Boolean BRepSweep_Rotation::GDDShapeIsToAdd TopLoc_Location Loc; GeomAdaptor_Surface AS(BRep_Tool::Surface(TopoDS::Face(aNewShape),Loc)); if (AS.GetType()==GeomAbs_Plane){ - return ( Abs(myAng - 2 * PI) > Precision::Angular() ); + return ( Abs(myAng - 2 * M_PI) > Precision::Angular() ); } else { return Standard_True; @@ -789,7 +789,7 @@ Standard_Boolean BRepSweep_Rotation::SeparatedWires TopLoc_Location Loc; GeomAdaptor_Surface AS(BRep_Tool::Surface(TopoDS::Face(aNewShape),Loc)); if (AS.GetType()==GeomAbs_Plane){ - return (Abs(myAng-2*PI) <= Precision::Angular()); + return (Abs(myAng-2*M_PI) <= Precision::Angular()); } else{ return Standard_False; diff --git a/src/BRepTest/BRepTest_BasicCommands.cxx b/src/BRepTest/BRepTest_BasicCommands.cxx index 3d1e00fcd6..016e6b4663 100755 --- a/src/BRepTest/BRepTest_BasicCommands.cxx +++ b/src/BRepTest/BRepTest_BasicCommands.cxx @@ -105,7 +105,7 @@ static Standard_Integer transform(Draw_Interpretor& di,Standard_Integer n,const if (n < 9) return 1; T.SetRotation(gp_Ax1(gp_Pnt(atof(a[n-7]),atof(a[n-6]),atof(a[n-5])), gp_Vec(atof(a[n-4]),atof(a[n-3]),atof(a[n-2]))), - atof(a[n-1])* PI180); + atof(a[n-1])* (M_PI / 180.0)); last = n-7; } else if (!strcmp(a[0],"tmirror")) { diff --git a/src/BRepTest/BRepTest_ChamferCommands.cxx b/src/BRepTest/BRepTest_ChamferCommands.cxx index 0824120529..48086486d6 100755 --- a/src/BRepTest/BRepTest_ChamferCommands.cxx +++ b/src/BRepTest/BRepTest_ChamferCommands.cxx @@ -103,11 +103,11 @@ static Standard_Integer chamfer(Draw_Interpretor& di, if (!E.IsNull() && !F.IsNull() && (aMCh.Contour(E) == 0) ) { d1 = atof(a[i + 3]); angle = atof(a[i + 4]); - angle *= PI / 180.; + angle *= M_PI / 180.; if ( (d1 > Precision::Confusion()) && (angle > Precision::Confusion()) - && (PI / 2.- angle > Precision::Confusion()) ) + && (M_PI / 2.- angle > Precision::Confusion()) ) aMCh.AddDA(d1, angle, E, F); } i += 5; diff --git a/src/BRepTest/BRepTest_CurveCommands.cxx b/src/BRepTest/BRepTest_CurveCommands.cxx index f4a3eed06b..7c0aedaa1f 100755 --- a/src/BRepTest/BRepTest_CurveCommands.cxx +++ b/src/BRepTest/BRepTest_CurveCommands.cxx @@ -700,7 +700,7 @@ static Standard_Integer profile(Draw_Interpretor& di, case 'r': i++; if (i >= n) goto badargs; - angle = atof(a[i]) * PI180; + angle = atof(a[i]) * (M_PI / 180.0); if ((a[i-1][1] == 'R') || (a[i-1][1] == 'r')) { dx = Cos(angle); dy = Sin(angle); @@ -736,7 +736,7 @@ static Standard_Integer profile(Draw_Interpretor& di, if (i >= n) goto badargs; radius = atof(a[i-1]); if (Abs(radius) > Precision::Confusion()) { - angle = atof(a[i]) * PI180; + angle = atof(a[i]) * (M_PI / 180.0); move = circle; } break; @@ -1288,7 +1288,7 @@ static Standard_Integer profile2d(Draw_Interpretor& di, case 'r': i++; if (i >= n) goto badargs; - angle = atof(a[i]) * PI180; + angle = atof(a[i]) * (M_PI / 180.0); if ((a[i-1][1] == 'R') || (a[i-1][1] == 'r')) { dx = Cos(angle); dy = Sin(angle); @@ -1324,7 +1324,7 @@ static Standard_Integer profile2d(Draw_Interpretor& di, if (i >= n) goto badargs; radius = atof(a[i-1]); if (Abs(radius) > Precision::Confusion()) { - angle = atof(a[i]) * PI180; + angle = atof(a[i]) * (M_PI / 180.0); move = circle; } break; diff --git a/src/BRepTest/BRepTest_DraftAngleCommands.cxx b/src/BRepTest/BRepTest_DraftAngleCommands.cxx index 4ec2a217c2..7cd1f23eba 100755 --- a/src/BRepTest/BRepTest_DraftAngleCommands.cxx +++ b/src/BRepTest/BRepTest_DraftAngleCommands.cxx @@ -58,7 +58,7 @@ static Standard_Integer DEP(Draw_Interpretor& theCommands, TopoDS_Shape aLocalShape(DBRep::Get(a[8*ii+6],TopAbs_FACE)); F = TopoDS::Face(aLocalShape); // F = TopoDS::Face(DBRep::Get(a[8*ii+6],TopAbs_FACE)); - Angle = atof(a[8*ii+7])*PI/180.; + Angle = atof(a[8*ii+7])*M_PI/180.; Pax.SetCoord(atof(a[8*ii+8]),atof(a[8*ii+9]),atof(a[8*ii+10])); Dax.SetCoord(atof(a[8*ii+11]),atof(a[8*ii+12]),atof(a[8*ii+13])); drft.Add(F,Dirextract,Angle,gp_Pln(Pax,Dax)); @@ -122,7 +122,7 @@ static Standard_Integer NDEP(Draw_Interpretor& theCommands, //#else Flag = (Standard_Boolean ) atof(a[9*ii+7]); //#endif - Angle = atof(a[9*ii+8])*PI/180.; + Angle = atof(a[9*ii+8])*M_PI/180.; Pax.SetCoord(atof(a[9*ii+9]),atof(a[9*ii+10]),atof(a[9*ii+11])); Dax.SetCoord(atof(a[9*ii+12]),atof(a[9*ii+13]),atof(a[9*ii+14])); drft.Add(F,Dirextract,Angle,gp_Pln(Pax,Dax), Flag); diff --git a/src/BRepTest/BRepTest_FeatureCommands.cxx b/src/BRepTest/BRepTest_FeatureCommands.cxx index 26964eda81..397f27c5d3 100755 --- a/src/BRepTest/BRepTest_FeatureCommands.cxx +++ b/src/BRepTest/BRepTest_FeatureCommands.cxx @@ -1107,7 +1107,7 @@ static Standard_Integer ROW(Draw_Interpretor& theCommands, FFrom = DBRep::Get(a[4],TopAbs_SHAPE); if (FFrom.IsNull()) { Angle = atof(a[4]); - Angle *=PI/180.; + Angle *=M_PI/180.; i = 5; } else { @@ -1268,7 +1268,7 @@ static Standard_Integer ROF(Draw_Interpretor& theCommands, FFrom = DBRep::Get(a[4],TopAbs_SHAPE); if (FFrom.IsNull()) { Angle = atof(a[4]); - Angle *=PI/180.; + Angle *=M_PI/180.; i = 5; } else { @@ -1589,7 +1589,7 @@ static Standard_Integer DEFIN(Draw_Interpretor& theCommands, theCommands << "Invalid DPrism base"; return 1; } - Standard_Real Angle = atof(a[4])*PI/360; + Standard_Real Angle = atof(a[4])*M_PI/360; dprdef = Standard_True; theDPrism.Init(Sbase,TopoDS::Face(Pbase),Skface,Angle,Fuse,Modify); } @@ -1773,7 +1773,7 @@ static Standard_Integer PERF(Draw_Interpretor& theCommands, thePrism.Perform(Val); } else if (Kas == 2) { - Val *=(PI/180.); + Val *=(M_PI/180.); theRevol.Perform(Val); } else if (Kas == 4) { @@ -1795,7 +1795,7 @@ static Standard_Integer PERF(Draw_Interpretor& theCommands, thePrism.PerformUntilHeight(FUntil, Val); } else if (Kas == 2) { - Val *=(PI/180.); + Val *=(M_PI/180.); theRevol.PerformUntilAngle(FUntil, Val); } else if (Kas == 4) { diff --git a/src/BRepTest/BRepTest_Fillet2DCommands.cxx b/src/BRepTest/BRepTest_Fillet2DCommands.cxx index 53b2149ceb..81ab849898 100755 --- a/src/BRepTest/BRepTest_Fillet2DCommands.cxx +++ b/src/BRepTest/BRepTest_Fillet2DCommands.cxx @@ -106,7 +106,7 @@ static Standard_Integer chfi2d(Draw_Interpretor& di, Standard_Integer n, const c MF.AddChamfer(E1,E2,p1,p2); } else { - MF.AddChamfer(E1,V,p1,p2*PI180); + MF.AddChamfer(E1,V,p1,p2 * (M_PI / 180.0)); } } diff --git a/src/BRepTest/BRepTest_PrimitiveCommands.cxx b/src/BRepTest/BRepTest_PrimitiveCommands.cxx index bdf02680e9..bacca07995 100755 --- a/src/BRepTest/BRepTest_PrimitiveCommands.cxx +++ b/src/BRepTest/BRepTest_PrimitiveCommands.cxx @@ -108,7 +108,7 @@ static Standard_Integer cylinder(Draw_Interpretor& , Standard_Integer n, const c } else if (n == 5) { if (P.IsNull()) - S = BRepPrimAPI_MakeCylinder(atof(a[2]),atof(a[3]),atof(a[4]) * PI180); + S = BRepPrimAPI_MakeCylinder(atof(a[2]),atof(a[3]),atof(a[4]) * (M_PI / 180.0)); else S = BRepPrimAPI_MakeCylinder(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4])); } @@ -116,7 +116,7 @@ static Standard_Integer cylinder(Draw_Interpretor& , Standard_Integer n, const c if (P.IsNull()) return 1; else - S = BRepPrimAPI_MakeCylinder(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]),atof(a[5]) * PI180); + S = BRepPrimAPI_MakeCylinder(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]),atof(a[5]) * (M_PI / 180.0)); } else return 1; @@ -142,12 +142,12 @@ static Standard_Integer cone(Draw_Interpretor& , Standard_Integer n, const char* } else if (n == 6) { if (P.IsNull()) - S = BRepPrimAPI_MakeCone(atof(a[2]),atof(a[3]),atof(a[4]),atof(a[5]) * PI180); + S = BRepPrimAPI_MakeCone(atof(a[2]),atof(a[3]),atof(a[4]),atof(a[5]) * (M_PI / 180.0)); else S = BRepPrimAPI_MakeCone(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]),atof(a[5])); } else if (n == 7) { - S = BRepPrimAPI_MakeCone(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]),atof(a[5]),atof(a[6]) * PI180); + S = BRepPrimAPI_MakeCone(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]),atof(a[5]),atof(a[6]) * (M_PI / 180.0)); } else return 1; @@ -173,24 +173,24 @@ static Standard_Integer sphere(Draw_Interpretor& , Standard_Integer n, const cha } else if (n == 4) { if (P.IsNull()) - S = BRepPrimAPI_MakeSphere(atof(a[2]),atof(a[3]) * PI180); + S = BRepPrimAPI_MakeSphere(atof(a[2]),atof(a[3]) * (M_PI / 180.0)); else S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),atof(a[3])); } else if (n == 5) { if (P.IsNull()) - S = BRepPrimAPI_MakeSphere(atof(a[2]),atof(a[3]) * PI180,atof(a[4]) * PI180); + S = BRepPrimAPI_MakeSphere(atof(a[2]),atof(a[3]) * (M_PI / 180.0),atof(a[4]) * (M_PI / 180.0)); else - S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]) * PI180); + S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]) * (M_PI / 180.0)); } else if (n == 6) { if (P.IsNull()) - S = BRepPrimAPI_MakeSphere(atof(a[2]),atof(a[3]) * PI180,atof(a[4]) * PI180,atof(a[5]) * PI180); + S = BRepPrimAPI_MakeSphere(atof(a[2]),atof(a[3]) * (M_PI / 180.0),atof(a[4]) * (M_PI / 180.0),atof(a[5]) * (M_PI / 180.0)); else - S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]) * PI180,atof(a[5]) * PI180); + S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]) * (M_PI / 180.0),atof(a[5]) * (M_PI / 180.0)); } else if (n == 7) { - S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]) * PI180,atof(a[5]) * PI180,atof(a[6]) * PI180); + S = BRepPrimAPI_MakeSphere(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]) * (M_PI / 180.0),atof(a[5]) * (M_PI / 180.0),atof(a[6]) * (M_PI / 180.0)); } else return 1; @@ -216,29 +216,29 @@ static Standard_Integer torus(Draw_Interpretor& , Standard_Integer n, const char } else if (n == 5) { if (P.IsNull()) - S = BRepPrimAPI_MakeTorus(atof(a[2]),atof(a[3]),atof(a[4]) * PI180); + S = BRepPrimAPI_MakeTorus(atof(a[2]),atof(a[3]),atof(a[4]) * (M_PI / 180.0)); else S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4])); } else if (n == 6) { if (P.IsNull()) S = BRepPrimAPI_MakeTorus(atof(a[2]),atof(a[3]), - atof(a[4]) * PI180,atof(a[5]) * PI180); + atof(a[4]) * (M_PI / 180.0),atof(a[5]) * (M_PI / 180.0)); else S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(), - atof(a[3]),atof(a[4]),atof(a[5]) * PI180); + atof(a[3]),atof(a[4]),atof(a[5]) * (M_PI / 180.0)); } else if (n == 7) { if (P.IsNull()) S = BRepPrimAPI_MakeTorus(atof(a[2]),atof(a[3]), - atof(a[4]) * PI180,atof(a[5]) * PI180,atof(a[6]) * PI180); + atof(a[4]) * (M_PI / 180.0),atof(a[5]) * (M_PI / 180.0),atof(a[6]) * (M_PI / 180.0)); else S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),atof(a[3]), - atof(a[4]),atof(a[5]) * PI180,atof(a[6]) * PI180); + atof(a[4]),atof(a[5]) * (M_PI / 180.0),atof(a[6]) * (M_PI / 180.0)); } else if (n == 8) { S = BRepPrimAPI_MakeTorus(P->Pln().Position().Ax2(),atof(a[3]),atof(a[4]), - atof(a[5]) * PI180,atof(a[6]) * PI180,atof(a[7]) * PI180); + atof(a[5]) * (M_PI / 180.0),atof(a[6]) * (M_PI / 180.0),atof(a[7]) * (M_PI / 180.0)); } else return 1; diff --git a/src/BRepTest/BRepTest_SurfaceCommands.cxx b/src/BRepTest/BRepTest_SurfaceCommands.cxx index f512179750..e34582a052 100755 --- a/src/BRepTest/BRepTest_SurfaceCommands.cxx +++ b/src/BRepTest/BRepTest_SurfaceCommands.cxx @@ -456,7 +456,7 @@ static Standard_Integer encoderegularity (Draw_Interpretor& , BRepLib::EncodeRegularity(sh); else { Standard_Real Tol = atof(a[2]); - Tol *= PI/180.; + Tol *= M_PI/180.; BRepLib::EncodeRegularity(sh, Tol); } return 0; diff --git a/src/BRepTest/BRepTest_SweepCommands.cxx b/src/BRepTest/BRepTest_SweepCommands.cxx index 93a16765f1..118c3ae1f9 100755 --- a/src/BRepTest/BRepTest_SweepCommands.cxx +++ b/src/BRepTest/BRepTest_SweepCommands.cxx @@ -100,7 +100,7 @@ static Standard_Integer revol(Draw_Interpretor& , gp_Dir D(atof(a[6]),atof(a[7]),atof(a[8])); gp_Ax1 A(P,D); - Standard_Real angle = atof(a[9]) * PI180; + Standard_Real angle = atof(a[9]) * (M_PI / 180.0); Standard_Boolean copy = n > 10; diff --git a/src/BRepToIGES/BRepToIGES_BRWire.cxx b/src/BRepToIGES/BRepToIGES_BRWire.cxx index ad7aefe7ac..3bb75d7710 100755 --- a/src/BRepToIGES/BRepToIGES_BRWire.cxx +++ b/src/BRepToIGES/BRepToIGES_BRWire.cxx @@ -382,24 +382,24 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferEdge (const TopoDS_Edge& //#30 rln 19.10.98 transformation of pcurves for IGES Surface of Revolution Curve2d->Mirror (gp_Ax2d (gp::Origin2d(), gp_Dir2d (1.,1.))); Curve2d->Mirror (gp::OX2d()); - Curve2d->Translate (gp_Vec2d (0, 2 * PI)); + Curve2d->Translate (gp_Vec2d (0, 2 * M_PI)); } if(Surf->IsKind(STANDARD_TYPE(Geom_SurfaceOfRevolution))|| (Surf->IsKind(STANDARD_TYPE(Geom_ToroidalSurface)))){ Curve2d->Mirror (gp_Ax2d (gp::Origin2d(), gp_Dir2d (1.,1.))); Curve2d->Mirror (gp::OX2d()); - Curve2d->Translate (gp_Vec2d (0, 2 * PI)); + Curve2d->Translate (gp_Vec2d (0, 2 * M_PI)); } if (analyticMode&&(Surf->IsKind(STANDARD_TYPE(Geom_CylindricalSurface)) || Surf->IsKind(STANDARD_TYPE(Geom_ConicalSurface)))) - myLen = PI/180.; + myLen = M_PI/180.; if (analyticMode&&(Surf->IsKind(STANDARD_TYPE(Geom_SphericalSurface)) || Surf->IsKind(STANDARD_TYPE(Geom_ToroidalSurface)))) { gp_Trsf2d trans; - trans.SetScale(gp_Pnt2d(0,0),180./PI); + trans.SetScale(gp_Pnt2d(0,0),180./M_PI); Curve2d->Transform(trans); First = Curve2d->TransformedParameter(First,trans); Last = Curve2d->TransformedParameter(Last, trans); diff --git a/src/BRepTools/BRepTools_WireExplorer.cxx b/src/BRepTools/BRepTools_WireExplorer.cxx index 37b291192b..2202420916 100755 --- a/src/BRepTools/BRepTools_WireExplorer.cxx +++ b/src/BRepTools/BRepTools_WireExplorer.cxx @@ -442,7 +442,7 @@ void BRepTools_WireExplorer::Next() Standard_Integer k = 1, kMin = 0, iDone = 0; Standard_Boolean isDegenerated = Standard_True; Standard_Real dmin = RealLast(); - Standard_Real dfMinAngle = 3.0*PI, dfCurAngle = 3.0*PI; + Standard_Real dfMinAngle = 3.0*M_PI, dfCurAngle = 3.0*M_PI; for(iDone = 0; iDone < 2; iDone++) { diff --git a/src/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx b/src/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx index 324e2340c0..639604e84c 100755 --- a/src/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx +++ b/src/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx @@ -358,19 +358,19 @@ BRepTopAdaptor_FClass2d::BRepTopAdaptor_FClass2d(const TopoDS_Face& aFace,const || surf->GetType()==GeomAbs_SurfaceOfRevolution) { - Standard_Real uuu=PI+PI-(Umax-Umin); + Standard_Real uuu=M_PI+M_PI-(Umax-Umin); if(uuu<0) uuu=0; U1 = 0.0; // modified by NIZHNY-OFV Thu May 31 14:24:10 2001 ---> //Umin-uuu*0.5; - U2 = 2*PI; // modified by NIZHNY-OFV Thu May 31 14:24:35 2001 ---> //U1+PI+PI; + U2 = 2*M_PI; // modified by NIZHNY-OFV Thu May 31 14:24:35 2001 ---> //U1+M_PI+M_PI; } else { U1=U2=0.0; } if(surf->GetType()==GeomAbs_Torus) { - Standard_Real uuu=PI+PI-(Vmax-Vmin); + Standard_Real uuu=M_PI+M_PI-(Vmax-Vmin); if(uuu<0) uuu=0; V1 = 0.0; // modified by NIZHNY-OFV Thu May 31 14:24:55 2001 ---> //Vmin-uuu*0.5; - V2 = 2*PI; // modified by NIZHNY-OFV Thu May 31 14:24:59 2001 ---> //V1+PI+PI; + V2 = 2*M_PI; // modified by NIZHNY-OFV Thu May 31 14:24:59 2001 ---> //V1+M_PI+M_PI; } else { V1=V2=0.0; } } diff --git a/src/BiTgte/BiTgte_Blend.cxx b/src/BiTgte/BiTgte_Blend.cxx index 1e5daa0efe..f26c9f42a9 100755 --- a/src/BiTgte/BiTgte_Blend.cxx +++ b/src/BiTgte/BiTgte_Blend.cxx @@ -236,7 +236,7 @@ static void KPartCurve3d(TopoDS_Edge Edge, if ( D.IsParallel(gp::DX2d(),Precision::Angular())) { // Iso V. if ( STy == GeomAbs_Sphere) { gp_Pnt2d P = C.Line().Location(); - if ( Abs( Abs(P.Y()) -PI/2. ) < Precision::PConfusion()) { + if ( Abs( Abs(P.Y()) -M_PI/2. ) < Precision::PConfusion()) { TheBuilder.Degenerated(Edge, Standard_True); } else { diff --git a/src/Bisector/Bisector_BisecAna.cxx b/src/Bisector/Bisector_BisecAna.cxx index 4bd3f0361f..f29b2c0f84 100755 --- a/src/Bisector/Bisector_BisecAna.cxx +++ b/src/Bisector/Bisector_BisecAna.cxx @@ -491,10 +491,10 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve , bisectorcurve = new Geom2d_Circle(TheSol->Circle()); if (!thesense) thebisector = new Geom2d_TrimmedCurve - (bisectorcurve,firstparameter-2.0*PI,firstparameter,thesense); + (bisectorcurve,firstparameter-2.0*M_PI,firstparameter,thesense); else thebisector = new Geom2d_TrimmedCurve - (bisectorcurve,firstparameter,firstparameter+2.0*PI,thesense); + (bisectorcurve,firstparameter,firstparameter+2.0*M_PI,thesense); } else if (type == GccInt_Hpr) { bisectorcurve = new Geom2d_Hyperbola(TheSol->Hyperbola()); @@ -509,10 +509,10 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve , bisectorcurve = new Geom2d_Ellipse(TheSol->Ellipse()); if (!thesense) thebisector = new Geom2d_TrimmedCurve - (bisectorcurve,firstparameter-2.0*PI,firstparameter,thesense); + (bisectorcurve,firstparameter-2.0*M_PI,firstparameter,thesense); else thebisector = new Geom2d_TrimmedCurve - (bisectorcurve,firstparameter,firstparameter+2.0*PI,thesense); + (bisectorcurve,firstparameter,firstparameter+2.0*M_PI,thesense); } } } @@ -862,13 +862,13 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve , bisectorcurve = new Geom2d_Circle(TheSol->Circle()); if (!thesense) thebisector = new Geom2d_TrimmedCurve(bisectorcurve, - firstparameter-2.0*PI, + firstparameter-2.0*M_PI, firstparameter, thesense); else thebisector = new Geom2d_TrimmedCurve(bisectorcurve, firstparameter, - firstparameter+2.0*PI, + firstparameter+2.0*M_PI, thesense); } else if (type == GccInt_Hpr) { @@ -886,13 +886,13 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve , bisectorcurve = new Geom2d_Ellipse(TheSol->Ellipse()); if (!thesense) thebisector = new Geom2d_TrimmedCurve(bisectorcurve, - firstparameter-2.0*PI, + firstparameter-2.0*M_PI, firstparameter, thesense); else thebisector = new Geom2d_TrimmedCurve(bisectorcurve, firstparameter, - firstparameter+2.0*PI, + firstparameter+2.0*M_PI, thesense); } } @@ -1195,7 +1195,7 @@ void Bisector_BisecAna::SetTrim(const Handle(Geom2d_Curve)& ) thebisector->Value(UB2), UB2, Tolerance); if (thebisector->BasisCurve()->IsPeriodic()) { - DomainBisector.SetEquivalentParameters(0.0,2.*PI); + DomainBisector.SetEquivalentParameters(0.0,2.*M_PI); } FirstPointBisector = thebisector->Value(UB1); diff --git a/src/Bisector/Bisector_BisecCC.cxx b/src/Bisector/Bisector_BisecCC.cxx index 00ba746ad4..2b71afb40f 100755 --- a/src/Bisector/Bisector_BisecCC.cxx +++ b/src/Bisector/Bisector_BisecCC.cxx @@ -200,7 +200,7 @@ void Bisector_BisecCC::Perform(const Handle(Geom2d_Curve)& Cu1, // - one of two curves is concave. // - the curves have a common point at the beginning and/or the end // - the angle of opening at the common point between two curves - // values PI. + // values M_PI. // the extension at the beginning is taken into account if the origin is found above. // ie : the origin is not the in the polygon. //----------------------------------------------------------------------------- diff --git a/src/BlendFunc/BlendFunc.cxx b/src/BlendFunc/BlendFunc.cxx index c79dbbfcad..10ffab0f7d 100755 --- a/src/BlendFunc/BlendFunc.cxx +++ b/src/BlendFunc/BlendFunc.cxx @@ -41,7 +41,7 @@ void BlendFunc::GetShape (const BlendFunc_SectionShape SShape, case BlendFunc_Rational: { Standard_Integer NbSpan = - (Standard_Integer)(Ceiling(3.*Abs(MaxAng)/2./PI)); + (Standard_Integer)(Ceiling(3.*Abs(MaxAng)/2./M_PI)); NbPoles = 2*NbSpan+1; NbKnots = NbSpan+1; Degree = 2; diff --git a/src/BlendFunc/BlendFunc_CSCircular.cxx b/src/BlendFunc/BlendFunc_CSCircular.cxx index 2a325258e5..1a5ecbae8d 100755 --- a/src/BlendFunc/BlendFunc_CSCircular.cxx +++ b/src/BlendFunc/BlendFunc_CSCircular.cxx @@ -237,7 +237,7 @@ Standard_Boolean BlendFunc_CSCircular::IsSolution(const math_Vector& Sol, const Angle = ACos(Cosa); if (Sina <0.) { - Angle = 2.*PI - Angle; + Angle = 2.*M_PI - Angle; } if (Angle>maxang) {maxang = Angle;} @@ -686,7 +686,7 @@ Standard_Boolean BlendFunc_CSCircular::GetSection(const Standard_Real Param, Sina = nplan.Dot(ns.Crossed(ns2)); Angle = ACos(Cosa); if (Sina <0.) { - Angle = 2.*PI - Angle; + Angle = 2.*M_PI - Angle; } Dangle = -(dnw.Dot(ns2) + ns.Dot(dn2w))/Sina; ncrn = nplan.Crossed(ns); diff --git a/src/BlendFunc/BlendFunc_CSConstRad.cxx b/src/BlendFunc/BlendFunc_CSConstRad.cxx index e04080b0ec..f706712aa0 100755 --- a/src/BlendFunc/BlendFunc_CSConstRad.cxx +++ b/src/BlendFunc/BlendFunc_CSConstRad.cxx @@ -207,7 +207,7 @@ Standard_Boolean BlendFunc_CSConstRad::IsSolution(const math_Vector& Sol, const Angle = ACos(Cosa); if (Sina <0.) { - Angle = 2.*PI - Angle; + Angle = 2.*M_PI - Angle; } if (Angle>maxang) {maxang = Angle;} @@ -649,7 +649,7 @@ Standard_Boolean BlendFunc_CSConstRad::GetSection(const Standard_Real Param, Sina = nplan.Dot(ns.Crossed(ns2)); Angle = ACos(Cosa); if (Sina <0.) { - Angle = 2.*PI - Angle; + Angle = 2.*M_PI - Angle; } Dangle = -(dnw.Dot(ns2) + ns.Dot(dn2w))/Sina; ncrn = nplan.Crossed(ns); diff --git a/src/BlendFunc/BlendFunc_ConstRad.cxx b/src/BlendFunc/BlendFunc_ConstRad.cxx index 1e8b0d193b..6e2be786a1 100755 --- a/src/BlendFunc/BlendFunc_ConstRad.cxx +++ b/src/BlendFunc/BlendFunc_ConstRad.cxx @@ -902,11 +902,11 @@ Standard_Boolean BlendFunc_ConstRad::IsSolution(const math_Vector& Sol, const St // Reframing on ]-pi/2, 3pi/2] if (Sina <0.) { if (Cosa > 0.) Angle = -Angle; - else Angle = 2.*PI - Angle; + else Angle = 2.*M_PI - Angle; } // cout << "Angle : " < PI)) { +// if ((Angle < 0) || (Angle > M_PI)) { // cout << "t = " << param << endl; // } @@ -1176,7 +1176,7 @@ void BlendFunc_ConstRad::Section(const Standard_Real Param, Pdeb = 0.; Pfin = ElCLib::Parameter(C,pts2); // Test negative and almost null angles : Singular Case - if (Pfin>1.5*PI) { + if (Pfin>1.5*M_PI) { np.Reverse(); C.SetPosition(gp_Ax2(Center,np,ns1)); Pfin = ElCLib::Parameter(C,pts2); diff --git a/src/BlendFunc/BlendFunc_EvolRad.cxx b/src/BlendFunc/BlendFunc_EvolRad.cxx index f686fffebc..1e15e4ef44 100755 --- a/src/BlendFunc/BlendFunc_EvolRad.cxx +++ b/src/BlendFunc/BlendFunc_EvolRad.cxx @@ -971,7 +971,7 @@ Standard_Boolean BlendFunc_EvolRad::IsSolution(const math_Vector& Sol, // Reframing on ]-pi/2, 3pi/2] if (Sina <0.) { if (Cosa > 0.) Angle = -Angle; - else Angle = 2.*PI - Angle; + else Angle = 2.*M_PI - Angle; } if (Abs(Angle)>maxang) {maxang = Abs(Angle);} @@ -1160,7 +1160,7 @@ void BlendFunc_EvolRad::Section(const Standard_Real Param, Pdeb = 0.; Pfin = ElCLib::Parameter(C,pts2); // Test of negative and almost null angles : Single Case - if (Pfin>1.5*PI) { + if (Pfin>1.5*M_PI) { np.Reverse(); C.SetPosition(gp_Ax2(Center,np,ns1)); Pfin = ElCLib::Parameter(C,pts2); diff --git a/src/BndLib/BndLib.cxx b/src/BndLib/BndLib.cxx index d8c3b38ed2..cfc2bd796b 100755 --- a/src/BndLib/BndLib.cxx +++ b/src/BndLib/BndLib.cxx @@ -517,7 +517,7 @@ void BndLib::Add( const gp_Cylinder& S,const Standard_Real UMin, void BndLib::Add( const gp_Cylinder& S,const Standard_Real VMin, const Standard_Real VMax,const Standard_Real Tol, Bnd_Box& B) { - BndLib::Add(S,0.,2.*PI,VMin,VMax,Tol,B); + BndLib::Add(S,0.,2.*M_PI,VMin,VMax,Tol,B); } void BndLib::Add(const gp_Cone& S,const Standard_Real UMin, @@ -594,7 +594,7 @@ void BndLib::Add(const gp_Cone& S,const Standard_Real UMin, void BndLib::Add( const gp_Cone& S,const Standard_Real VMin, const Standard_Real VMax,const Standard_Real Tol, Bnd_Box& B) { - BndLib::Add(S,0.,2.*PI,VMin,VMax,Tol,B); + BndLib::Add(S,0.,2.*M_PI,VMin,VMax,Tol,B); } void BndLib::Add(const gp_Sphere& S,const Standard_Real UMin, @@ -703,12 +703,12 @@ void BndLib::Add(const gp_Torus& S,const Standard_Real UMin, Standard_Integer Fi1; Standard_Integer Fi2; if (VMax 2. * PI) { + if (Delta > 2. * M_PI) { Teta1 = 0.; - Teta2 = 2. * PI; + Teta2 = 2. * M_PI; } else { if (Teta1 < 0.) { - do { Teta1+=2.*PI;} while (Teta1< 0.); + do { Teta1+=2.*M_PI;} while (Teta1< 0.); } - else if (Teta1> 2.*PI) { - do { Teta1-=2.*PI;} while (Teta1> 2.*PI); + else if (Teta1> 2.*M_PI) { + do { Teta1-=2.*M_PI;} while (Teta1> 2.*M_PI); } Teta2 = Teta1 + Delta; @@ -46,7 +46,7 @@ void Compute(const Standard_Real P1, B.Add(Point(O +Ra*Cn2*Xd +Rb*Sn2*Yd)); Standard_Real Ram,Rbm; - if (Delta > PI/8.) { + if (Delta > M_PI/8.) { // Main radiuses to take into account only 8 points (/cos(Pi/8.)) Ram=Ra/0.92387953251128674; Rbm=Rb/0.92387953251128674; @@ -61,7 +61,7 @@ void Compute(const Standard_Real P1, B.Add(Point(O +Ram*Cn2*Xd +Rbm*Sn2*Yd)); -// cos or sin PI/4. +// cos or sin M_PI/4. #define PI4 0.70710678118654746 // 8 points of the polygon @@ -74,8 +74,8 @@ void Compute(const Standard_Real P1, #define addP6 B.Add(Point(O -Rbm*Yd)); #define addP7 B.Add(Point(O +Ram*PI4*Xd -Rbm*PI4*Yd)) - Standard_Integer deb = (Standard_Integer )( Teta1/(PI/4.)); - Standard_Integer fin = (Standard_Integer )( Teta2/(PI/4.)); + Standard_Integer deb = (Standard_Integer )( Teta1/(M_PI/4.)); + Standard_Integer fin = (Standard_Integer )( Teta2/(M_PI/4.)); deb++; if (deb>fin) return; diff --git a/src/CGM/CGM_Driver.cxx b/src/CGM/CGM_Driver.cxx index e8047222c6..a44a8da3f5 100755 --- a/src/CGM/CGM_Driver.cxx +++ b/src/CGM/CGM_Driver.cxx @@ -38,7 +38,7 @@ static Handle(Image_Image) myImage; #define TRANSFORMCOLOR(c) \ { if (TypeOfCgm == CgmCharEncoding) c = (((c+1) << 2) - 1); } -#define DRAD (PI/180.) +#define DRAD (M_PI/180.) #define DEFPLOTTER "DIRECT_CGM" //----------------------------------------------------------------- @@ -541,7 +541,7 @@ Standard_Boolean CGM_Driver::PlotArc (const Standard_ShortReal Xpos, { Standard_ShortReal san = sAngle; Standard_ShortReal fan = sAngle + oAngle; - if (oAngle >= 2*PI) { + if (oAngle >= 2*M_PI) { PlotPolyAttrib (myLineColorIndex, -1, Standard_True); if (aXradius == aYradius) { ptabreal[0] = (float)Xpos; ptabreal[1] = (float)Ypos; @@ -582,7 +582,7 @@ Standard_Boolean CGM_Driver::PlotPolyArc (const Standard_ShortReal Xpos, { Standard_ShortReal san = sAngle; Standard_ShortReal fan = sAngle + oAngle; - if (oAngle >= 2.*PI) { + if (oAngle >= 2.*M_PI) { if (aXradius == aYradius) { ptabreal[0] = (float)Xpos; ptabreal[1] = (float)Ypos; ptabreal[2] = (float)aXradius; diff --git a/src/CGM/cgmlib.hxx b/src/CGM/cgmlib.hxx index 0c5603f0c8..8d95aab2a1 100755 --- a/src/CGM/cgmlib.hxx +++ b/src/CGM/cgmlib.hxx @@ -632,11 +632,6 @@ struct flags { #define LOG2 0.30103 #define PARABIT 0x40 -#ifndef PI -#define PI 3.1415926535 -#endif - - /* All default values set within the control program */ /* with Character encoding defaults */ diff --git a/src/CGM/cgmpar.h b/src/CGM/cgmpar.h index 50996a8a56..ea36a32064 100755 --- a/src/CGM/cgmpar.h +++ b/src/CGM/cgmpar.h @@ -230,8 +230,4 @@ #define LOG2 0.30103 #define PARABIT 0x40 -#ifndef PI -#define PI 3.1415926535 -#endif - #endif /* end of cgmpar.h */ diff --git a/src/CSLib/CSLib.cxx b/src/CSLib/CSLib.cxx index c982961721..627d5322d7 100755 --- a/src/CSLib/CSLib.cxx +++ b/src/CSLib/CSLib.cxx @@ -239,8 +239,8 @@ void CSLib::Normal(const Standard_Integer MaxOrder, { //All lambda i exist Standard_Integer SP; Standard_Real inf,sup; - inf=0.0-Standard_PI; - sup=0.0+Standard_PI; + inf = 0.0 - M_PI; + sup = 0.0 + M_PI; Standard_Boolean FU,LU,FV,LV; //Creation of the domain of definition depending on the position @@ -249,29 +249,41 @@ void CSLib::Normal(const Standard_Integer MaxOrder, LU=(Abs(U-Umax) < Precision::PConfusion() ); FV=(Abs(V-Vmin) < Precision::PConfusion() ); LV=(Abs(V-Vmax) < Precision::PConfusion() ); - if(LU) + if (LU) { - inf=Standard_PI/2; - sup=3*inf; - if(LV){inf=Standard_PI;} - if(FV){sup=Standard_PI;} + inf = M_PI / 2; + sup = 3 * inf; + if (LV) + { + inf = M_PI; + } + if (FV) + { + sup = M_PI; + } } - else if(FU) + else if (FU) { - sup=Standard_PI/2; - inf=-sup; - if(LV){sup=0;} - if(FV){inf=0;} + sup = M_PI / 2; + inf = -sup; + if (LV) + { + sup = 0; + } + if (FV) + { + inf = 0; + } } - else if(LV) + else if (LV) { - inf=0.0-Standard_PI; - sup=0; + inf = 0.0 - M_PI; + sup = 0; } - else if(FV) + else if (FV) { - inf=0; - sup=Standard_PI; + inf = 0; + sup = M_PI; } Standard_Boolean CS=0; Standard_Real Vprec=0,Vsuiv; diff --git a/src/ChFi2d/ChFi2d_Builder.cxx b/src/ChFi2d/ChFi2d_Builder.cxx index 36b350d751..c57a6cc49c 100755 --- a/src/ChFi2d/ChFi2d_Builder.cxx +++ b/src/ChFi2d/ChFi2d_Builder.cxx @@ -975,13 +975,13 @@ TopoDS_Edge ChFi2d_Builder::BuildFilletEdge(const TopoDS_Vertex& V, inside = (PPU2param4) || (PPU2param3); // case of arc of circle passing on the sewing if ( ( basisC2->DynamicType() == STANDARD_TYPE(Geom2d_Circle) ) && - ( (2*PIparam4) || (2*PIparam3) ) ) { + ( (2*M_PIparam4) || (2*M_PIparam3) ) ) { // cas param3= param2) || (U2 <= param2 && U2 > param1); ///////////////////////////////////////////////////// if ( (basisC1->DynamicType() == STANDARD_TYPE(Geom2d_Circle)) - && ( (2*PIparam2) || (2*PIparam1) ) ) { + && ( (2*M_PIparam2) || (2*M_PIparam1) ) ) { // arc of circle containing the circle origin // case param1= param4) || (Vv2 <= param4 && Vv2 > param3); ///////////////////////////////////////////////////// if ( (basisC2->DynamicType() == STANDARD_TYPE(Geom2d_Circle)) - && ( (2*PIparam4) || (2*PIparam3) ) ) { + && ( (2*M_PIparam4) || (2*M_PIparam3) ) ) { // arc of circle containing the circle origin // cas param3 0.; - if (U1 > Vv1 && U1 > 2.*PI) { - ElCLib::AdjustPeriodic(0.,2.*PI,Precision::Confusion(),U1,Vv1); + if (U1 > Vv1 && U1 > 2.*M_PI) { + ElCLib::AdjustPeriodic(0.,2.*M_PI,Precision::Confusion(),U1,Vv1); } // if (U1 ... if (O1 == TopAbs_FORWARD && OE1 == TopAbs_FORWARD || O1 == TopAbs_REVERSED && OE1 == TopAbs_REVERSED ) { diff --git a/src/ChFi3d/ChFi3d.cxx b/src/ChFi3d/ChFi3d.cxx index 668ab722e4..9f60118475 100755 --- a/src/ChFi3d/ChFi3d.cxx +++ b/src/ChFi3d/ChFi3d.cxx @@ -98,7 +98,7 @@ Standard_Integer ChFi3d::ConcaveSide(const BRepAdaptor_Surface& S1, dint1 = ns1.Crossed(tgE1); dint2 = ns2.Crossed(tgE2); Standard_Real ang = ns1.CrossMagnitude(ns2); - if(ang > 0.0001*PI){ + if(ang > 0.0001*M_PI){ Standard_Real scal = ns2.Dot(dint1); if ( scal <= 0. ){ ns2.Reverse(); @@ -129,7 +129,7 @@ Standard_Integer ChFi3d::ConcaveSide(const BRepAdaptor_Surface& S1, dint1 = ns1.Crossed(tgE1); dint2 = ns2.Crossed(tgE2); ang = ns1.CrossMagnitude(ns2); - if(ang > 0.0001*PI){ + if(ang > 0.0001*M_PI){ Standard_Real scal = ns2.Dot(dint1); if ( scal <= 0. ){ ns2.Reverse(); diff --git a/src/ChFi3d/ChFi3d_Builder_0.cxx b/src/ChFi3d/ChFi3d_Builder_0.cxx index c5178140da..5c67159634 100755 --- a/src/ChFi3d/ChFi3d_Builder_0.cxx +++ b/src/ChFi3d/ChFi3d_Builder_0.cxx @@ -752,7 +752,7 @@ Handle(Geom_BezierCurve) ChFi3d_Spine(const gp_Pnt& pd, const Standard_Real R) { TColgp_Array1OfPnt pol(1,4); - const Standard_Real fac = 0.5 * tan((PI-vd.Angle(vf)) * 0.5); + const Standard_Real fac = 0.5 * tan((M_PI-vd.Angle(vf)) * 0.5); pol(1) = pd; vd.Multiply(fac*R); pol(2).SetCoord(pd.X()+vd.X(),pd.Y()+vd.Y(),pd.Z()+vd.Z()); @@ -3099,11 +3099,11 @@ Standard_Boolean ChFi3d_ComputeCurves(Handle(Adaptor3d_HSurface)& S1, Ufin = -Ufin; } else{ - Udeb = 2*PI - Udeb; - Ufin = 2*PI - Ufin; + Udeb = 2*M_PI - Udeb; + Ufin = 2*M_PI - Ufin; } } - if(!c1line) ElCLib::AdjustPeriodic(0.,2*PI,Precision::Angular(),Udeb,Ufin); + if(!c1line) ElCLib::AdjustPeriodic(0.,2*M_PI,Precision::Angular(),Udeb,Ufin); Handle(GeomAdaptor_HCurve) HC = new GeomAdaptor_HCurve(); HC->ChangeCurve().Load(C3d,Udeb,Ufin); ChFi3d_ProjectPCurv(HC,S1,Pc1,tol3d,tolr1); @@ -3629,7 +3629,7 @@ Handle(GeomAdaptor_HSurface) ChFi3d_BoundSurf(TopOpeBRepDS_DataStructure& DSt //In the case of a torus or cone, it is not necessary that the bounds create a surface with period more than 2PI. else if (styp == GeomAbs_Torus || styp == GeomAbs_Cone) { - Du = Min(PI-0.5*Du,0.1*Du); + Du = Min(M_PI-0.5*Du,0.1*Du); Dv = 0.; S1.Load(DStr.Surface(Fd1->Surf()).Surface(), mu-Du,Mu+Du,mv,Mv); @@ -4126,7 +4126,7 @@ Standard_EXPORT // caredeb = 0; carefin = 0; - Angle = PI*0.75; + Angle = M_PI*0.75; LocalWL = WL; LocalWF = WF; if (!ES.IsPeriodic() && !PDeb.IsEqual(BSpline->Pole(1), tol) ) { @@ -4748,7 +4748,7 @@ Standard_Boolean ChFi3d_IsSmooth( const Handle(Geom_Curve)& C ) LProp.CentreOfCurvature(P2); gp_Vec Vec(P1, P2); Standard_Real Angle = PrevVec.Angle( Vec ); - if (Angle > PI/3.) + if (Angle > M_PI/3.) return Standard_False; Standard_Real Ratio = Vec.Magnitude() / PrevVec.Magnitude(); if (Ratio < 1.) diff --git a/src/ChFi3d/ChFi3d_Builder_1.cxx b/src/ChFi3d/ChFi3d_Builder_1.cxx index 877089b3f1..f1377a9bee 100755 --- a/src/ChFi3d/ChFi3d_Builder_1.cxx +++ b/src/ChFi3d/ChFi3d_Builder_1.cxx @@ -700,12 +700,12 @@ Standard_Boolean ChFi3d_Builder::PerformElement(const Handle(ChFiDS_Spine)& Spin // there is no need of tolerance // to make a decision (PRO9486) the regularity is enough. // However, the abcense of turn-back is checked (PRO9810) - OnAjoute = ((!rev && av1v2 < PI/2) - ||(rev && av1v2 > PI/2)); + OnAjoute = ((!rev && av1v2 < M_PI/2) + ||(rev && av1v2 > M_PI/2)); // mate attention to the single case (cf CTS21610_1) if (OnAjoute && (degeneOnEc || TangentOnVertex(LVEc, Ev,myEFMap, ta)) ) - OnAjoute=((!rev && av1v2 < ta) || (rev && (PI - av1v2) < ta)); + OnAjoute=((!rev && av1v2 < ta) || (rev && (M_PI - av1v2) < ta)); } if (OnAjoute) { Fini = Standard_False; // If this can be useful (Cf PRO14713) @@ -729,7 +729,7 @@ Standard_Boolean ChFi3d_Builder::PerformElement(const Handle(ChFiDS_Spine)& Spin for (Jt.Initialize(myEFMap(Ev)), Nbface= 0 ;Jt.More();Jt.Next(), Nbface++) {} if (Nbface> 1) CurSt = ChFiDS_BreakPoint; - Fini = ((!rev && av1v2 < ta) || (rev && (PI - av1v2) < ta)); + Fini = ((!rev && av1v2 < ta) || (rev && (M_PI - av1v2) < ta)); } } } @@ -772,11 +772,11 @@ Standard_Boolean ChFi3d_Builder::PerformElement(const Handle(ChFiDS_Spine)& Spin Standard_Boolean rev = (Or1 != curor); Standard_Boolean OnAjoute = Standard_False; if (FaceTangency(Ec,Ev,LVEv)) { - OnAjoute = ((!rev && av1v2 < PI/2) - ||(rev && av1v2 > PI/2)); + OnAjoute = ((!rev && av1v2 < M_PI/2) + ||(rev && av1v2 > M_PI/2)); if (OnAjoute && (degeneOnEc || TangentOnVertex(FVEc, Ev,myEFMap, ta)) ) - OnAjoute=((!rev && av1v2 < ta) || (rev && (PI-av1v2) < ta)); + OnAjoute=((!rev && av1v2 < ta) || (rev && (M_PI-av1v2) < ta)); } if (OnAjoute) { Ec = Ev; @@ -791,7 +791,7 @@ Standard_Boolean ChFi3d_Builder::PerformElement(const Handle(ChFiDS_Spine)& Spin for(Jt.Initialize(myEFMap(Ev)),Nbface= 0 ;Jt.More();Jt.Next(), Nbface++) {} if (Nbface> 1) CurSt = ChFiDS_BreakPoint; - Fini = ((!rev && av1v2 < ta) || (rev && (PI - av1v2) < ta)); + Fini = ((!rev && av1v2 < ta) || (rev && (M_PI - av1v2) < ta)); } } } diff --git a/src/ChFi3d/ChFi3d_Builder_2.cxx b/src/ChFi3d/ChFi3d_Builder_2.cxx index 636a2843fb..e479bad8d3 100755 --- a/src/ChFi3d/ChFi3d_Builder_2.cxx +++ b/src/ChFi3d/ChFi3d_Builder_2.cxx @@ -853,7 +853,7 @@ void ChFi3d_Builder::StartSol(const Handle(ChFiDS_Stripe)& Stripe, // There are ponts on the border, and internal points are found if (derive.Magnitude() > Precision::PConfusion()) { derive.Normalized(); - derive.Rotate(PI/2); + derive.Rotate(M_PI/2); AS.Initialize(f1); ResU = AS.UResolution(TolE); ResV = AS.VResolution(TolE); diff --git a/src/ChFi3d/ChFi3d_Builder_C1.cxx b/src/ChFi3d/ChFi3d_Builder_C1.cxx index 656b68b6a4..b60991a231 100755 --- a/src/ChFi3d/ChFi3d_Builder_C1.cxx +++ b/src/ChFi3d/ChFi3d_Builder_C1.cxx @@ -2041,7 +2041,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) trouve=Standard_False; ChFi3d_cherche_vertex ( Edge[0],Edge[1],Vcom,trouve); if (Vcom.IsSame(Vtx)) ang1=ChFi3d_AngleEdge(Vtx,Edge[0],Edge[1]); - if (Abs(ang1-PI)<0.01) { + if (Abs(ang1-M_PI)<0.01) { oneintersection1=Standard_True; facesau=Face[0]; edgesau=Edge[1]; @@ -2054,7 +2054,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) trouve=Standard_False; ChFi3d_cherche_vertex ( Edge[1],Edge[2],Vcom,trouve); if (Vcom.IsSame(Vtx)) ang1=ChFi3d_AngleEdge(Vtx,Edge[1],Edge[2]); - if (Abs(ang1-PI)<0.01) { + if (Abs(ang1-M_PI)<0.01) { oneintersection2=Standard_True; facesau=Face[1]; edgesau=Edge[1]; @@ -2414,17 +2414,17 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) // deb=pfildeb.X(); // xx1=pfil1.X(); // xx2=pfil2.X(); -// moins2pi=Abs(deb)< Abs(Abs(deb)-2*PI); -// moins2pi1=Abs(xx1)< Abs(Abs(xx1)-2*PI); -// moins2pi2=Abs(xx2)< Abs(Abs(xx2)-2*PI); +// moins2pi=Abs(deb)< Abs(Abs(deb)-2*M_PI); +// moins2pi1=Abs(xx1)< Abs(Abs(xx1)-2*M_PI); +// moins2pi2=Abs(xx2)< Abs(Abs(xx2)-2*M_PI); // if (moins2pi1!=moins2pi2) { // if (moins2pi) { -// if (!moins2pi1) xx1=xx1-2*PI; -// if (!moins2pi2) xx2=xx2-2*PI; +// if (!moins2pi1) xx1=xx1-2*M_PI; +// if (!moins2pi2) xx2=xx2-2*M_PI; // } // else { -// if (moins2pi1) xx1=xx1+2*PI; -// if (moins2pi2) xx2=xx2+2*PI; +// if (moins2pi1) xx1=xx1+2*M_PI; +// if (moins2pi2) xx2=xx2+2*M_PI; // } // } // pfil1.SetX(xx1); @@ -2437,17 +2437,17 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) // deb=ufmin; // xx1=pfac1.X(); // xx2=pfac2.X(); -// moins2pi=Abs(deb)< Abs(Abs(deb)-2*PI); -// moins2pi1=Abs(xx1)< Abs(Abs(xx1)-2*PI); -// moins2pi2=Abs(xx2)< Abs(Abs(xx2)-2*PI); +// moins2pi=Abs(deb)< Abs(Abs(deb)-2*M_PI); +// moins2pi1=Abs(xx1)< Abs(Abs(xx1)-2*M_PI); +// moins2pi2=Abs(xx2)< Abs(Abs(xx2)-2*M_PI); // if (moins2pi1!=moins2pi2) { // if (moins2pi) { -// if (!moins2pi1) xx1=xx1-2*PI; -// if (!moins2pi2) xx2=xx2-2*PI; +// if (!moins2pi1) xx1=xx1-2*M_PI; +// if (!moins2pi2) xx2=xx2-2*M_PI; // } // else { -// if (moins2pi1) xx1=xx1+2*PI; -// if (moins2pi2) xx2=xx2+2*PI; +// if (moins2pi1) xx1=xx1+2*M_PI; +// if (moins2pi2) xx2=xx2+2*M_PI; // } // } // pfac1.SetX(xx1); diff --git a/src/ChFi3d/ChFi3d_Builder_CnCrn.cxx b/src/ChFi3d/ChFi3d_Builder_CnCrn.cxx index 70dd7385c6..890914894a 100755 --- a/src/ChFi3d/ChFi3d_Builder_CnCrn.cxx +++ b/src/ChFi3d/ChFi3d_Builder_CnCrn.cxx @@ -491,15 +491,15 @@ static void CalculBatten (const Handle (GeomAdaptor_HSurface) ASurf, Bat.SetFreeSliding (Standard_True); Standard_Real ang1,ang2; ang1=dir1.Angle(dir3); - if (dir1.Angle(dir4) >0 ) ang2=PI-dir1.Angle(dir4); - else ang2=-PI-dir1.Angle(dir4); + if (dir1.Angle(dir4) >0 ) ang2=M_PI-dir1.Angle(dir4); + else ang2=-M_PI-dir1.Angle(dir4); if (contraint1&&contraint2) anglebig=(Abs(ang1)>1.2)|| (Abs(ang2)>1.2 ); else if (contraint1) anglebig=Abs(ang1)>1.2; else if (contraint2) anglebig=Abs(ang2)>1.2; - if (isplane && (Abs(ang1)>PI/2 || Abs(ang2)>PI/2)) + if (isplane && (Abs(ang1)>M_PI/2 || Abs(ang2)>M_PI/2)) isplane=Standard_False; if (anglebig && !isplane) { CalculDroite(p2d1,xdir,ydir,pcurve); @@ -994,7 +994,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex, Standard_Boolean droit=Standard_False; if (bordlibre) {nedge=(nedge-2)/2 +2; Standard_Real angedg=Abs(ChFi3d_AngleEdge(V1,edgelibre1,edgelibre2)); - droit=Abs(angedg-PI)<0.01; + droit=Abs(angedg-M_PI)<0.01; } else nedge=nedge/2; Standard_Integer size=nedge*2; @@ -1248,7 +1248,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex, if (ind!=ic) { TopoDS_Edge ecur=TopoDS::Edge(Evive.Value(ind)); Standard_Real ang=Abs(ChFi3d_AngleEdge(V1,ecur,ereg)); - if (ang<0.01 || Abs(ang-PI) <0.01) { + if (ang<0.01 || Abs(ang-M_PI) <0.01) { regul.SetValue(ic,Standard_False); tangentregul.SetValue(ic,Standard_True); trouve=Standard_True; @@ -1290,7 +1290,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex, if ( !E1.IsSame(edgelibre1) && !E1.IsSame(edgelibre2) && !E2.IsSame(edgelibre1) && !E2.IsSame(edgelibre2)){ Standard_Real ang=Abs(ChFi3d_AngleEdge(V1 ,E1,E2)); - deuxconges=(ang<0.01 || Abs(ang-PI)<0.01); + deuxconges=(ang<0.01 || Abs(ang-M_PI)<0.01); } } } @@ -1339,7 +1339,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex, Indices(nedge,ic,icplus,icmoins); TopoDS_Edge Arc=TopoDS::Edge(Evive.Value(ic)); ChFiDS_CommonPoint cp1, cp2; - Standard_Real angedg=PI; + Standard_Real angedg=M_PI; TopoDS_Vertex Vcom; if (!sharp.Value(icplus)) { isfirst=(sens.Value(icplus)==1); @@ -1349,7 +1349,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex, if (cp1.IsOnArc()){ ChFi3d_cherche_vertex(Arc,cp1.Arc(),Vcom,trouve); if (trouve) angedg=Abs(ChFi3d_AngleEdge(Vcom,Arc,cp1.Arc())); - if (!cp1.Arc().IsSame(Arc) && Abs(angedg-PI)<0.01){ + if (!cp1.Arc().IsSame(Arc) && Abs(angedg-M_PI)<0.01){ Evive.SetValue(ic,cp1.Arc()); ChFi3d_edge_common_faces(myEFMap(cp1.Arc()),F1,F2); if (!Fvive.Value(ic,icplus).IsSame(F1) && !Fvive.Value(ic,icplus).IsSame(F2)) { @@ -1378,10 +1378,10 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex, cp2 = CD.Value(icmoins)->SetOfSurfData()->Value(Index.Value(icmoins))-> ChangeVertex (isfirst,jf.Value(icmoins)); if (cp2.IsOnArc()) { - angedg=PI; + angedg=M_PI; ChFi3d_cherche_vertex(Arc,cp2.Arc(),Vcom,trouve); if (trouve) angedg=Abs(ChFi3d_AngleEdge(Vcom,Arc,cp2.Arc())); - if (!cp2.Arc().IsSame(Arc)&&Abs(angedg-PI)<0.01) { + if (!cp2.Arc().IsSame(Arc)&&Abs(angedg-M_PI)<0.01) { Evive.SetValue(ic,cp2.Arc()); ChFi3d_edge_common_faces(myEFMap(cp2.Arc()),F1,F2); if (!Fvive.Value(ic,icmoins).IsSame(F1) && !Fvive.Value(ic,icmoins).IsSame(F2)) { @@ -1459,7 +1459,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex, Standard_Integer iface; // if two edges are tangent the intersection is not attempted (cts60046) angedg=Abs(ChFi3d_AngleEdge(V1,TopoDS::Edge(Evive.Value(ic)),TopoDS::Edge(Evive.Value(icplus)))); - if (Abs(angedg-PI)>0.01) + if (Abs(angedg-M_PI)>0.01) ok = ChFi3d_SearchFD(DStr,CD.Value(ic),CD.Value(icplus),sens.Value(ic),sens.Value(icplus), i1,i2,pa1,pa2, Index.Value(ic),Index.Value(icplus), @@ -2230,20 +2230,20 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex, if (couture) { Standard_Boolean PI1=Standard_False, PI2=Standard_False; Standard_Real xx; - PI1=0<=p2d1.X() && p2d1.X() <=PI; - PI2=0<=p2d2.X() && p2d2.X() <=PI; + PI1=0<=p2d1.X() && p2d1.X() <=M_PI; + PI2=0<=p2d2.X() && p2d2.X() <=M_PI; if (Evive.Value(ic).IsSame(edgecouture)){ xx=p2d1.X(); - if (PI2&&!PI1) xx=xx-2*PI; - if (!PI2&&PI1) xx=xx+2*PI; + if (PI2&&!PI1) xx=xx-2*M_PI; + if (!PI2&&PI1) xx=xx+2*M_PI; p2d1.SetX(xx); } if (Evive.Value(icplus).IsSame(edgecouture)){ xx=p2d2.X(); - if (PI2&&!PI1) xx=xx+2*PI; - if (!PI2&&PI1) xx=xx-2*PI; + if (PI2&&!PI1) xx=xx+2*M_PI; + if (!PI2&&PI1) xx=xx-2*M_PI; p2d2.SetX(xx); } } diff --git a/src/ChFi3d/ChFi3d_Builder_SpKP.cxx b/src/ChFi3d/ChFi3d_Builder_SpKP.cxx index 6d4ac674e5..f8ed8fbe2f 100755 --- a/src/ChFi3d/ChFi3d_Builder_SpKP.cxx +++ b/src/ChFi3d/ChFi3d_Builder_SpKP.cxx @@ -363,7 +363,7 @@ void ChFi3d_Builder::Trunc(const Handle(ChFiDS_SurfData)& SD, Standard_Real Ang = dsp.Angle(ded); Standard_Real dis1 = psp.Distance(ped); Standard_Real dis2 = p1.Distance(p2); - if(Ang > PI/18.) tron = Standard_True; + if(Ang > M_PI/18.) tron = Standard_True; if(dis1 >= 0.1*dis2) tron = Standard_True; Standard_Integer ivois; if(!tron && YaUnVoisin(Spine,iedge,ivois,isfirst)) { diff --git a/src/ChFi3d/ChFi3d_ChBuilder.cxx b/src/ChFi3d/ChFi3d_ChBuilder.cxx index 49537439fd..4423865635 100755 --- a/src/ChFi3d/ChFi3d_ChBuilder.cxx +++ b/src/ChFi3d/ChFi3d_ChBuilder.cxx @@ -746,9 +746,9 @@ void ChFi3d_ChBuilder::SimulKPart(const Handle(ChFiDS_SurfData)& SD ) const gp_Cone Co = AS.Cone(); Standard_Real rad = Co.RefRadius(), sang = Co.SemiAngle(); //#ifndef DEB - Standard_Integer n = (Standard_Integer) (36.*ang/PI + 1); + Standard_Integer n = (Standard_Integer) (36.*ang/M_PI + 1); //#else -// Standard_Integer n = 36.*ang/PI + 1; +// Standard_Integer n = 36.*ang/M_PI + 1; //#endif if(n<2) n = 2; sec = new ChFiDS_SecHArray1(1, n); @@ -2133,7 +2133,7 @@ void ChFi3d_ChBuilder::SetRegul() gp_Pnt p; gp_Vec n1,n2,du,dv; BRep_Builder B; - Standard_Real Seuil = PI/360.; + Standard_Real Seuil = M_PI/360.; Standard_Real Seuil2 = Seuil * Seuil; for (it.Initialize(myRegul); it.More(); it.Next()){ const ChFiDS_Regul& reg = it.Value(); diff --git a/src/ChFi3d/ChFi3d_FilBuilder.cxx b/src/ChFi3d/ChFi3d_FilBuilder.cxx index de057d9fc3..bfc53dc2e0 100755 --- a/src/ChFi3d/ChFi3d_FilBuilder.cxx +++ b/src/ChFi3d/ChFi3d_FilBuilder.cxx @@ -542,9 +542,9 @@ void ChFi3d_FilBuilder::SimulKPart(const Handle(ChFiDS_SurfData)& SD) const gp_Torus To = AS.Torus(); Standard_Real majr = To.MajorRadius(), minr = To.MinorRadius(); //#ifndef DEB - Standard_Integer n = (Standard_Integer) (36.*ang/PI + 1); + Standard_Integer n = (Standard_Integer) (36.*ang/M_PI + 1); //#else -// Standard_Integer n = 36.*ang/PI + 1; +// Standard_Integer n = 36.*ang/M_PI + 1; //#endif if(n<2) n = 2; sec = new ChFiDS_SecHArray1(1, n); @@ -565,9 +565,9 @@ void ChFi3d_FilBuilder::SimulKPart(const Handle(ChFiDS_SurfData)& SD) const gp_Sphere Sp = AS.Sphere(); Standard_Real rad = Sp.Radius(); //#ifndef DEB - Standard_Integer n = (Standard_Integer) (36.*ang/PI + 1); + Standard_Integer n = (Standard_Integer) (36.*ang/M_PI + 1); //#else -// Standard_Integer n = 36.*ang/PI + 1; +// Standard_Integer n = 36.*ang/M_PI + 1; //#endif if(n<2) n = 2; sec = new ChFiDS_SecHArray1(1, n); diff --git a/src/ChFi3d/ChFi3d_FilBuilder_C2.cxx b/src/ChFi3d/ChFi3d_FilBuilder_C2.cxx index ba0032fba2..643dd3e61c 100755 --- a/src/ChFi3d/ChFi3d_FilBuilder_C2.cxx +++ b/src/ChFi3d/ChFi3d_FilBuilder_C2.cxx @@ -220,7 +220,7 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index) if (Sens2==-1) dir2.Reverse(); Standard_Real ang1; ang1=Abs(dir1.Angle(dir2)); - if (ang1= 2*PI - tol && u <= 2*PI) u = 0.; + if(u >= 2*M_PI - tol && u <= 2*M_PI) u = 0.; if(u >= fu - tol && u < fu) u = fu; if(u <= lu + tol && u > lu) u = lu; - if(u < fu || u > lu) u = ElCLib::InPeriod(u,fu,fu + 2*PI); + if(u < fu || u > lu) u = ElCLib::InPeriod(u,fu,fu + 2*M_PI); ElSLib::D1(u,v,Con,Pt,deru,derv); gp_Pnt2d p2dCon(u,v); gp_Dir2d d2dCon; @@ -505,10 +505,10 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr, Or.Z()+Rad*Dx.Z()); ElSLib::Parameters(Con,Pt ,u,v); Standard_Real tol = Precision::PConfusion(); - if (u >= 2*PI - tol && u <= 2*PI) u = 0.; + if (u >= 2*M_PI - tol && u <= 2*M_PI) u = 0.; if (u >= fu - tol && u < fu) u = fu; if (u <= lu + tol && u > lu) u = lu; - if (u < fu || u > lu) u = ElCLib::InPeriod(u,fu,fu + 2*PI); + if (u < fu || u > lu) u = ElCLib::InPeriod(u,fu,fu + 2*M_PI); ElSLib::D1(u,v,Con,Pt,deru,derv); gp_Pnt2d p2dCon(u,v); gp_Dir2d d2dCon; diff --git a/src/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnCyl.cxx b/src/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnCyl.cxx index 88a5a48e73..540db6c419 100755 --- a/src/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnCyl.cxx +++ b/src/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnCyl.cxx @@ -270,10 +270,10 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr, ElSLib::Parameters(Cyl, Pt ,u, v); Standard_Real tol = Precision::PConfusion(); Standard_Boolean careaboutsens = 0; - if(Abs(lu - fu - 2 * PI) < tol) careaboutsens = 1; + if(Abs(lu - fu - 2 * M_PI) < tol) careaboutsens = 1; if(u >= fu - tol && u < fu) u = fu; if(u <= lu + tol && u > lu) u = lu; - if(u < fu || u > lu) u = ChFiKPart_InPeriod(u, fu, fu + 2 * PI, tol); + if(u < fu || u > lu) u = ChFiKPart_InPeriod(u, fu, fu + 2 * M_PI, tol); ElSLib::D1(u, v, Cyl, Pt, deru, derv); gp_Dir norcyl = deru.Crossed(derv); diff --git a/src/ChFiKPart/ChFiKPart_ComputeData_ChPlnCon.cxx b/src/ChFiKPart/ChFiKPart_ComputeData_ChPlnCon.cxx index 9c54a78eef..b6912cd2dd 100755 --- a/src/ChFiKPart/ChFiKPart_ComputeData_ChPlnCon.cxx +++ b/src/ChFiKPart/ChFiKPart_ComputeData_ChPlnCon.cxx @@ -327,10 +327,10 @@ Standard_Boolean ChFiKPart_MakeChamfer(TopOpeBRepDS_DataStructure& DStr, Or.Z()+Rad*Dx.Z()); ElSLib::Parameters(Con,Pt ,u,v); Standard_Real tol = Precision::PConfusion(); - if(u >= 2*PI - tol && u <= 2*PI) u = 0.; + if(u >= 2*M_PI - tol && u <= 2*M_PI) u = 0.; if(u >= fu - tol && u < fu) u = fu; if(u <= lu + tol && u > lu) u = lu; - if(u < fu || u > lu) u = ElCLib::InPeriod(u,fu,fu + 2*PI); + if(u < fu || u > lu) u = ElCLib::InPeriod(u,fu,fu + 2*M_PI); ElSLib::D1(u,v,Con,Pt,deru,derv); gp_Pnt2d p2dCon(u,v); gp_Dir2d d2dCon; diff --git a/src/ChFiKPart/ChFiKPart_ComputeData_ChPlnCyl.cxx b/src/ChFiKPart/ChFiKPart_ComputeData_ChPlnCyl.cxx index 1404009eae..b1897980cb 100755 --- a/src/ChFiKPart/ChFiKPart_ComputeData_ChPlnCyl.cxx +++ b/src/ChFiKPart/ChFiKPart_ComputeData_ChPlnCyl.cxx @@ -255,10 +255,10 @@ Standard_Boolean ChFiKPart_MakeChamfer(TopOpeBRepDS_DataStructure& DStr, ElSLib::Parameters(Cyl,Pt ,u,v); Standard_Real tol = Precision::PConfusion(); Standard_Boolean careaboutsens = 0; - if(Abs(lu - fu - 2*PI) < tol) careaboutsens = 1; + if(Abs(lu - fu - 2*M_PI) < tol) careaboutsens = 1; if(u >= fu - tol && u < fu) u = fu; if(u <= lu + tol && u > lu) u = lu; - if(u < fu || u > lu) u = ChFiKPart_InPeriod(u,fu,fu + 2*PI,tol); + if(u < fu || u > lu) u = ChFiKPart_InPeriod(u,fu,fu + 2*M_PI,tol); ElSLib::D1(u,v,Cyl,Pt,deru,derv); gp_Dir norcyl = deru.Crossed(derv); diff --git a/src/ChFiKPart/ChFiKPart_ComputeData_FilPlnCon.cxx b/src/ChFiKPart/ChFiKPart_ComputeData_FilPlnCon.cxx index 85685f577f..3ac0824364 100755 --- a/src/ChFiKPart/ChFiKPart_ComputeData_FilPlnCon.cxx +++ b/src/ChFiKPart/ChFiKPart_ComputeData_FilPlnCon.cxx @@ -149,7 +149,7 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr, else{ ElSLib::TorusParameters(FilAx3,Rad,Radius,P,u,v); ElSLib::TorusD1(u,v,FilAx3,Rad,Radius,PP,deru,derv); - if(!plandab && Ang < PI/2 && dedans) v = v + 2*PI; + if(!plandab && Ang < M_PI/2 && dedans) v = v + 2*M_PI; } gp_Pnt2d p2dFil(0.,v); gp_Dir norFil(deru.Crossed(derv)); @@ -211,7 +211,7 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr, else{ ElSLib::TorusParameters(FilAx3,Rad,Radius,P,u,v); ElSLib::TorusD1(u,v,FilAx3,Rad,Radius,PP,deru,derv); - if(plandab && Ang < PI/2 && dedans) v = v + 2*PI; + if(plandab && Ang < M_PI/2 && dedans) v = v + 2*M_PI; } norFil = deru.Crossed(derv); p2dFil.SetCoord(0.,v); @@ -220,10 +220,10 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr, ElSLib::Parameters(Con,P,u,v); Standard_Real tol = Precision::PConfusion(); Standard_Boolean careaboutsens = 0; - if(Abs(lu - fu - 2*PI) < tol) careaboutsens = 1; + if(Abs(lu - fu - 2*M_PI) < tol) careaboutsens = 1; if(u >= fu - tol && u < fu) u = fu; if(u <= lu + tol && u > lu) u = lu; - if(u < fu || u > lu) u = ElCLib::InPeriod(u,fu,fu + 2*PI); + if(u < fu || u > lu) u = ElCLib::InPeriod(u,fu,fu + 2*M_PI); ElSLib::D1(u,v,Con,PP,deru,derv); gp_Dir norCon = deru.Crossed(derv); gp_Dir2d d2dCon = gp::DX2d(); diff --git a/src/ChFiKPart/ChFiKPart_ComputeData_FilPlnCyl.cxx b/src/ChFiKPart/ChFiKPart_ComputeData_FilPlnCyl.cxx index affc307819..466ff0f98b 100755 --- a/src/ChFiKPart/ChFiKPart_ComputeData_FilPlnCyl.cxx +++ b/src/ChFiKPart/ChFiKPart_ComputeData_FilPlnCyl.cxx @@ -110,7 +110,7 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr, ElSLib::Parameters(Cyl,OrFillet,UOnCyl,VOnCyl); Standard_Real tesp = Precision::Confusion(); if(UOnCyl < fu - tesp || UOnCyl > lu + tesp) - UOnCyl = ElCLib::InPeriod(UOnCyl,fu,fu+2*PI); + UOnCyl = ElCLib::InPeriod(UOnCyl,fu,fu+2*M_PI); ElSLib::Parameters(Pln,OrFillet,UOnPln,VOnPln); gp_Vec XDir,OtherDir; @@ -141,7 +141,7 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr, gp_Lin C3d(POnPln,DirFillet); Standard_Real UOnFillet,V; ElSLib::CylinderParameters(AxFil,Radius,POnPln,UOnFillet,V); - if(UOnFillet > PI) UOnFillet = 0.; + if(UOnFillet > M_PI) UOnFillet = 0.; gp_Lin2d LOnFillet(gp_Pnt2d(UOnFillet,V),gp::DY2d()); Handle(Geom_Line) L3d = new Geom_Line (C3d); Handle(Geom2d_Line) LFac = new Geom2d_Line(Lin2dPln); @@ -179,7 +179,7 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr, gp_Pnt POnCyl = ElSLib::Value(UOnCyl,VOnCyl,Cyl); C3d = gp_Lin(POnCyl,DirFillet); ElSLib::CylinderParameters(AxFil,Radius,POnCyl,UOnFillet,V); - if(UOnFillet > PI) UOnFillet = 0.; + if(UOnFillet > M_PI) UOnFillet = 0.; LOnFillet = gp_Lin2d(gp_Pnt2d(UOnFillet,V),gp::DY2d()); L3d = new Geom_Line (C3d); LFac = new Geom2d_Line(Lin2dCyl); @@ -254,12 +254,12 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr, Standard_Real acote = 1e-7; ElCLib::D1(First,Spine,PtSp,DSp); ElSLib::Parameters(Cyl,PtSp,u,v); - if ((Abs(u)PI){ - u = (2*PI)-u; + if (Abs(u2-u)>M_PI){ + u = (2*M_PI)-u; PtSp = ElSLib::Value(u,v,Cyl); Standard_Real PR; PR = ElCLib::Parameter(Spine,PtSp); @@ -315,10 +315,10 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr, cPln.Z()+Rad*Dx.Z()); u = 0.; if ((dedans && plandab) || (!dedans && !plandab)){ - if (c1sphere) { v = - PI / 2; } - else { v = 3 * PI / 2; } + if (c1sphere) { v = - M_PI / 2; } + else { v = 3 * M_PI / 2; } } - else { v = PI / 2; } + else { v = M_PI / 2; } gp_Dir norFil; if(c1sphere){ ElSLib::SphereD1(u,v,FilAx3,cylrad,PP,deru,derv); @@ -388,10 +388,10 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr, Or.Z()+cylrad*Dx.Z()); u = 0.; if (dedans) { - if (plandab && !c1sphere) { v = 2 * PI; } + if (plandab && !c1sphere) { v = 2 * M_PI; } else { v = 0. ; } } - else { v = PI; } + else { v = M_PI; } p2dFil.SetCoord(u,v); if(c1sphere){ ElSLib::SphereD1(u,v,FilAx3,cylrad,PP,deru,derv); @@ -405,10 +405,10 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr, ElSLib::Parameters(Cyl,P,u,v); Standard_Real tol = Precision::PConfusion(); Standard_Boolean careaboutsens = 0; - if(Abs(lu - fu - 2*PI) < tol) careaboutsens = 1; + if(Abs(lu - fu - 2*M_PI) < tol) careaboutsens = 1; if(u >= fu - tol && u < fu) u = fu; if(u <= lu + tol && u > lu) u = lu; - if(u < fu || u > lu) u = ChFiKPart_InPeriod(u,fu,fu + 2*PI,tol); + if(u < fu || u > lu) u = ChFiKPart_InPeriod(u,fu,fu + 2*M_PI,tol); ElSLib::D1(u,v,Cyl,PP,deru,derv); gp_Dir norcyl = deru.Crossed(derv); gp_Dir2d d2dCyl = gp::DX2d(); diff --git a/src/ChFiKPart/ChFiKPart_ComputeData_Rotule.cxx b/src/ChFiKPart/ChFiKPart_ComputeData_Rotule.cxx index 078eb13ab5..1ca5319128 100755 --- a/src/ChFiKPart/ChFiKPart_ComputeData_Rotule.cxx +++ b/src/ChFiKPart/ChFiKPart_ComputeData_Rotule.cxx @@ -89,7 +89,7 @@ Standard_Boolean ChFiKPart_MakeRotule(TopOpeBRepDS_DataStructure& DStr, //------------------------------------------------------------ gp_Pnt pp; gp_Vec du,dv; - ElSLib::TorusD1(0.,PI/2,ppos,r,r,pp,du,dv); + ElSLib::TorusD1(0.,M_PI/2,ppos,r,r,pp,du,dv); gp_Dir drot(du.Crossed(dv)); Standard_Boolean reversecur = ( drot.Dot(dplnat) <= 0. ); Standard_Boolean reversefil = ( drot.Dot(dfpl) <= 0. ); @@ -113,7 +113,7 @@ Standard_Boolean ChFiKPart_MakeRotule(TopOpeBRepDS_DataStructure& DStr, ppos.YDirection().Dot(pl.Position().YDirection())); gp_Ax22d circ2dax(p2dcirc,dx2d,dy2d); Handle(Geom2d_Circle) GC2d = new Geom2d_Circle(circ2dax,r); - gp_Pnt2d p2dlin(0.,PI/2); + gp_Pnt2d p2dlin(0.,M_PI/2); Handle(Geom2d_Line) GL2d = new Geom2d_Line(p2dlin,gp::DX2d()); TopAbs_Orientation trans = TopAbs_REVERSED; if (reversecur) trans = TopAbs_FORWARD; @@ -124,7 +124,7 @@ Standard_Boolean ChFiKPart_MakeRotule(TopOpeBRepDS_DataStructure& DStr, //-------------- Handle(Geom_Curve) bid; Handle(Geom2d_Curve) bid2d; - p2dlin.SetCoord(0.,PI); + p2dlin.SetCoord(0.,M_PI); Handle(Geom2d_Line) GL2dcoin = new Geom2d_Line(p2dlin,gp::DX2d()); Data->ChangeInterferenceOnS2(). SetInterference(ChFiKPart_IndexCurveInDS(bid,DStr),trans,bid2d,GL2dcoin); @@ -132,7 +132,7 @@ Standard_Boolean ChFiKPart_MakeRotule(TopOpeBRepDS_DataStructure& DStr, //et les points //------------- Data->ChangeVertexFirstOnS1().SetPoint(pp); - ElSLib::TorusD0(alpha,PI/2,ppos,r,r,pp); + ElSLib::TorusD0(alpha,M_PI/2,ppos,r,r,pp); Data->ChangeVertexLastOnS1().SetPoint(pp); Data->ChangeInterferenceOnS1().SetFirstParameter(0.); Data->ChangeInterferenceOnS1().SetLastParameter(alpha); diff --git a/src/ChFiKPart/ChFiKPart_ComputeData_Sphere.cxx b/src/ChFiKPart/ChFiKPart_ComputeData_Sphere.cxx index f5478e408e..464eaa57ee 100755 --- a/src/ChFiKPart/ChFiKPart_ComputeData_Sphere.cxx +++ b/src/ChFiKPart/ChFiKPart_ComputeData_Sphere.cxx @@ -114,7 +114,7 @@ Standard_Boolean ChFiKPart_Sphere(TopOpeBRepDS_DataStructure& DStr, Handle(Geom_Curve) C; Handle(Geom2d_Curve) C2d; - gp_Pnt2d p2dFil(0.,-PI/2.); + gp_Pnt2d p2dFil(0.,-M_PI/2.); gp_Lin2d lin2dFil(p2dFil,gp::DX2d()); Handle(Geom2d_Curve) C2dFil = new Geom2d_Line(lin2dFil); toreverse = ( ddz.Dot(dnat1) <= 0. ); diff --git a/src/Contap/Contap_ArcFunction.lxx b/src/Contap/Contap_ArcFunction.lxx index ab3e86ae6b..ee1821ba16 100755 --- a/src/Contap/Contap_ArcFunction.lxx +++ b/src/Contap/Contap_ArcFunction.lxx @@ -8,7 +8,7 @@ inline void Contap_ArcFunction::Set(const gp_Dir& Direction, { myType = Contap_DraftStd; myDir = Direction; - myCosAng = Cos(PI/2.+Angle); + myCosAng = Cos(M_PI/2.+Angle); } inline void Contap_ArcFunction::Set(const gp_Pnt& Eye, @@ -16,7 +16,7 @@ inline void Contap_ArcFunction::Set(const gp_Pnt& Eye, { myType = Contap_DraftPrs; myEye = Eye; - myCosAng = Cos(PI/2.+Angle); + myCosAng = Cos(M_PI/2.+Angle); } inline void Contap_ArcFunction::Set(const gp_Dir& Direction) diff --git a/src/Contap/Contap_ContAna.cxx b/src/Contap/Contap_ContAna.cxx index 357dd7eb78..9fb47d7d3f 100755 --- a/src/Contap/Contap_ContAna.cxx +++ b/src/Contap/Contap_ContAna.cxx @@ -114,7 +114,7 @@ void Contap_ContAna::Perform (const gp_Cylinder& C, Standard_Real Coefcos = D.Dot(C.Position().XDirection()); Standard_Real Coefsin = D.Dot(C.Position().YDirection()); - Standard_Real Coefcst = cos(PI*0.5 + Angle); + Standard_Real Coefcst = cos(M_PI*0.5 + Angle); Standard_Real norm1 = Coefcos*Coefcos + Coefsin*Coefsin; Standard_Real norm2 = sqrt(norm1); @@ -266,7 +266,7 @@ void Contap_ContAna::Perform (const gp_Cone& C, Standard_Real Coefcos = D.Dot(C.Position().XDirection()); Standard_Real Coefsin = D.Dot(C.Position().YDirection()); - Standard_Real Coefcst1 = cos(PI*0.5 + Angle); + Standard_Real Coefcst1 = cos(M_PI*0.5 + Angle); Standard_Real norm1 = Coefcos*Coefcos + Coefsin*Coefsin; Standard_Real norm2 = Sqrt(norm1); diff --git a/src/Contap/Contap_ContourGen_2.gxx b/src/Contap/Contap_ContourGen_2.gxx index 97330488c7..ad808b04bc 100755 --- a/src/Contap/Contap_ContourGen_2.gxx +++ b/src/Contap/Contap_ContourGen_2.gxx @@ -97,14 +97,14 @@ static void Recadre(const TheSurface& myHS1, } } if(myHS1IsUPeriodic) { - lmf = PI+PI; //-- myHS1->UPeriod(); + lmf = M_PI+M_PI; //-- myHS1->UPeriod(); f = myHS1->FirstUParameter(); l = myHS1->LastUParameter(); while(u1 < f) { u1+=lmf; } while(u1 > l) { u1-=lmf; } } if(myHS1IsVPeriodic) { - lmf = PI+PI; //-- myHS1->VPeriod(); + lmf = M_PI+M_PI; //-- myHS1->VPeriod(); f = myHS1->FirstVParameter(); l = myHS1->LastVParameter(); while(v1 < f) { v1+=lmf; } @@ -205,7 +205,7 @@ static void LineConstructor(Contap_TheSequenceOfLine& slin, Standard_Boolean novtx = Standard_True; if(nbvtx) novtx=Standard_False; for(Standard_Integer i=1;i0.0000000001) { Standard_Real pmid = (firstp+lastp)*0.5; gp_Pnt Pmid = ElCLib::Value(pmid,L.Circle()); @@ -276,7 +276,7 @@ static void LineConstructor(Contap_TheSequenceOfLine& slin, Contap_ThePoint pvtx = L.Vertex(nbvtx); Line.Add(pvtx); - pvtx = L.Vertex(1); pvtx.SetParameter(pvtx.ParameterOnLine()+PI+PI); + pvtx = L.Vertex(1); pvtx.SetParameter(pvtx.ParameterOnLine()+M_PI+M_PI); Line.Add(pvtx); Line.SetTransitionOnS(L.TransitionOnS()); slin.Append(Line); diff --git a/src/Contap/Contap_SurfFunction.lxx b/src/Contap/Contap_SurfFunction.lxx index e8594fe073..963ba79dad 100755 --- a/src/Contap/Contap_SurfFunction.lxx +++ b/src/Contap/Contap_SurfFunction.lxx @@ -25,7 +25,7 @@ inline void Contap_SurfFunction::Set(const gp_Dir& Direction, myType = Contap_DraftStd; // Contour vu myDir = Direction; myAng = Angle; - myCosAng = Cos(PI/2.+Angle); + myCosAng = Cos(M_PI/2.+Angle); } inline void Contap_SurfFunction::Set(const gp_Pnt& Eye, @@ -34,7 +34,7 @@ inline void Contap_SurfFunction::Set(const gp_Pnt& Eye, myType = Contap_DraftPrs; // Contour vu "conique"... myEye = Eye; myAng = Angle; - myCosAng = Cos(PI/2.+Angle); + myCosAng = Cos(M_PI/2.+Angle); } inline void Contap_SurfFunction::Set(const Standard_Real Tolerance) diff --git a/src/Convert/Convert_CircleToBSplineCurve.cxx b/src/Convert/Convert_CircleToBSplineCurve.cxx index 4582647c23..c746e19447 100755 --- a/src/Convert/Convert_CircleToBSplineCurve.cxx +++ b/src/Convert/Convert_CircleToBSplineCurve.cxx @@ -60,7 +60,7 @@ Convert_CircleToBSplineCurve::Convert_CircleToBSplineCurve isperiodic = Standard_False; Convert_ConicToBSplineCurve:: BuildCosAndSin(Parameterisation, - 0, 2*PI, + 0, 2*M_PI, CosNumeratorPtr, SinNumeratorPtr, weights, @@ -124,7 +124,7 @@ Convert_CircleToBSplineCurve::Convert_CircleToBSplineCurve Standard_Real delta = ULast - UFirst ; Standard_Real Eps = Precision::PConfusion(); - if ( (delta > (2*PI + Eps)) || (delta <= 0.0e0) ) { + if ( (delta > (2*M_PI + Eps)) || (delta <= 0.0e0) ) { Standard_DomainError::Raise( "Convert_CircleToBSplineCurve"); } diff --git a/src/Convert/Convert_ConeToBSplineSurface.cxx b/src/Convert/Convert_ConeToBSplineSurface.cxx index cbfa2a0142..28170f750a 100755 --- a/src/Convert/Convert_ConeToBSplineSurface.cxx +++ b/src/Convert/Convert_ConeToBSplineSurface.cxx @@ -28,7 +28,7 @@ static void ComputePoles( const Standard_Real R, // Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds) Standard_Integer - nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1; + nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1; Standard_Real AlfaU = deltaU / ( nbUSpans * 2); Standard_Real x[TheNbVPoles]; @@ -78,7 +78,7 @@ Convert_ConeToBSplineSurface::Convert_ConeToBSplineSurface { Standard_Real deltaU = U2 - U1; Standard_DomainError_Raise_if( (Abs(V2-V1) <= Abs(Epsilon(V1))) || - (deltaU > 2*PI) || + (deltaU > 2*M_PI) || (deltaU < 0. ), "Convert_ConeToBSplineSurface"); @@ -90,7 +90,7 @@ Convert_ConeToBSplineSurface::Convert_ConeToBSplineSurface // Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds) Standard_Integer - nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1; + nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1; Standard_Real AlfaU = deltaU / ( nbUSpans * 2); nbUPoles = 2 * nbUSpans + 1; @@ -156,7 +156,7 @@ Convert_ConeToBSplineSurface::Convert_ConeToBSplineSurface Standard_Real R = C.RefRadius(); Standard_Real A = C.SemiAngle(); - ComputePoles( R, A, 0., 2.*PI, V1, V2, poles); + ComputePoles( R, A, 0., 2.*M_PI, V1, V2, poles); nbUPoles = 6; nbUKnots = 4; @@ -164,7 +164,7 @@ Convert_ConeToBSplineSurface::Convert_ConeToBSplineSurface nbVKnots = 2; for ( i = 1; i <= nbUKnots; i++) { - uknots(i) = ( i-1) * 2. * PI /3.; + uknots(i) = ( i-1) * 2. * M_PI /3.; umults(i) = 2; } vknots(1) = V1; vmults(1) = 2; diff --git a/src/Convert/Convert_ConicToBSplineCurve.cxx b/src/Convert/Convert_ConicToBSplineCurve.cxx index db15f5a23a..bd7db1b6f9 100755 --- a/src/Convert/Convert_ConicToBSplineCurve.cxx +++ b/src/Convert/Convert_ConicToBSplineCurve.cxx @@ -347,20 +347,20 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin( switch (Parameterisation) { case Convert_TgtThetaOver2: num_spans = - (Standard_Integer)IntegerPart( 1.2 * delta / PI) + 1; + (Standard_Integer)IntegerPart( 1.2 * delta / M_PI) + 1; tgt_theta_flag = 1 ; break ; case Convert_TgtThetaOver2_1: num_spans = 1 ; - if (delta > 0.9999 * PI) { + if (delta > 0.9999 * M_PI) { Standard_ConstructionError::Raise() ; } tgt_theta_flag = 1 ; break ; case Convert_TgtThetaOver2_2: num_spans = 2 ; - if (delta > 1.9999 * PI) { + if (delta > 1.9999 * M_PI) { Standard_ConstructionError::Raise() ; } tgt_theta_flag = 1 ; @@ -490,7 +490,7 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin( alpha_2 = alpha * 0.5e0 ; p_param = - 1.0e0 / (alpha_2 * alpha_2) ; - if (alpha_2 < PI * 0.5e0) { + if (alpha_2 < M_PI * 0.5e0) { tan_alpha_2 = Tan(alpha_2) ; value1 = 3.0e0 * (tan_alpha_2 - alpha_2) ; value1 = alpha_2 / value1 ; @@ -624,7 +624,7 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin( if (Parameterisation == Convert_TgtThetaOver2) { BuildCosAndSin(Convert_TgtThetaOver2_3, 0.0e0, - 2 * PI, + 2 * M_PI, temp_cos_ptr, temp_sin_ptr, temp_denominator_ptr, @@ -649,7 +649,7 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin( else if (Parameterisation == Convert_RationalC1) { first_param = 0.0e0 ; - last_param = PI ; + last_param = M_PI ; BuildCosAndSin(Convert_RationalC1, first_param, last_param, @@ -675,7 +675,7 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin( DenominatorPtr = new TColStd_HArray1OfReal(1,num_periodic_poles) ; - half_pi = PI * 0.5e0 ; + half_pi = M_PI * 0.5e0 ; index = 1 ; for (jj = 1 ; jj <= 2 ; jj++) { flat_knots(index) = - half_pi ; @@ -690,7 +690,7 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin( } } for (jj = 1 ; jj <= 2 ; jj++) { - flat_knots(index) = 2 * PI + half_pi ; + flat_knots(index) = 2 * M_PI + half_pi ; index += 1 ; } KnotsPtr = @@ -712,9 +712,9 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin( inverse = 1.0e0 ; for (ii = parameters.Lower() ; ii <= parameters.Upper() ; ii++) { param = parameters(ii) ; - if (param > PI) { + if (param > M_PI) { inverse = -1.0e0 ; - param -= PI ; + param -= M_PI ; } BSplCLib::D0(param, 0, diff --git a/src/Convert/Convert_CylinderToBSplineSurface.cxx b/src/Convert/Convert_CylinderToBSplineSurface.cxx index abff8bb791..84ed547382 100755 --- a/src/Convert/Convert_CylinderToBSplineSurface.cxx +++ b/src/Convert/Convert_CylinderToBSplineSurface.cxx @@ -28,7 +28,7 @@ static void ComputePoles( const Standard_Real R, // Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds) Standard_Integer - nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1; + nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1; Standard_Real AlfaU = deltaU / ( nbUSpans * 2); Standard_Real UStart = U1; @@ -70,7 +70,7 @@ Convert_CylinderToBSplineSurface::Convert_CylinderToBSplineSurface { Standard_Real deltaU = U2 - U1; Standard_DomainError_Raise_if( (Abs(V2-V1) <= Abs(Epsilon(V1))) || - (deltaU > 2*PI) || + (deltaU > 2*M_PI) || (deltaU < 0. ), "Convert_CylinderToBSplineSurface"); @@ -82,7 +82,7 @@ Convert_CylinderToBSplineSurface::Convert_CylinderToBSplineSurface // Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds) Standard_Integer - nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1; + nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1; Standard_Real AlfaU = deltaU / ( nbUSpans * 2); nbUPoles = 2 * nbUSpans + 1; @@ -146,7 +146,7 @@ Convert_CylinderToBSplineSurface::Convert_CylinderToBSplineSurface Standard_Real R = Cyl.Radius(); - ComputePoles( R, 0., 2.*PI, V1, V2, poles); + ComputePoles( R, 0., 2.*M_PI, V1, V2, poles); nbUPoles = 6; nbUKnots = 4; @@ -154,7 +154,7 @@ Convert_CylinderToBSplineSurface::Convert_CylinderToBSplineSurface nbVKnots = 2; for ( i = 1; i <= nbUKnots; i++) { - uknots(i) = ( i-1) * 2. * PI /3.; + uknots(i) = ( i-1) * 2. * M_PI /3.; umults(i) = 2; } vknots(1) = V1; vmults(1) = 2; diff --git a/src/Convert/Convert_EllipseToBSplineCurve.cxx b/src/Convert/Convert_EllipseToBSplineCurve.cxx index e3e87fcf32..04f276ae29 100755 --- a/src/Convert/Convert_EllipseToBSplineCurve.cxx +++ b/src/Convert/Convert_EllipseToBSplineCurve.cxx @@ -67,7 +67,7 @@ Convert_EllipseToBSplineCurve::Convert_EllipseToBSplineCurve isperiodic = Standard_False; Convert_ConicToBSplineCurve:: BuildCosAndSin(Parameterisation, - 0, 2*PI, + 0, 2*M_PI, CosNumeratorPtr, SinNumeratorPtr, weights, @@ -131,7 +131,7 @@ Convert_EllipseToBSplineCurve::Convert_EllipseToBSplineCurve Standard_Real Tol = Precision::PConfusion(); Standard_Real delta = ULast - UFirst; #endif - Standard_DomainError_Raise_if( (delta > (2*PI+Tol)) || (delta <= 0.0e0), + Standard_DomainError_Raise_if( (delta > (2*M_PI+Tol)) || (delta <= 0.0e0), "Convert_EllipseToBSplineCurve"); Standard_Integer ii; Standard_Real R, r, value; diff --git a/src/Convert/Convert_PolynomialCosAndSin.cxx b/src/Convert/Convert_PolynomialCosAndSin.cxx index 13fa931782..5180ed34b4 100755 --- a/src/Convert/Convert_PolynomialCosAndSin.cxx +++ b/src/Convert/Convert_PolynomialCosAndSin.cxx @@ -34,7 +34,7 @@ static Standard_Real Locate(const Standard_Real Angfin, BSplCLib::D0(ptest,TPoles,BSplCLib::NoWeights(),valP); Standard_Real theta = ATan2(valP.Y(),valP.X()); if (theta < 0.) { - theta +=2.*PI; + theta +=2.*M_PI; } if (Abs(theta - Angfin) < Ptol) { return ptest; @@ -69,7 +69,7 @@ void BuildPolynomialCosAndSin trim_max, middle, Angle, - PI2 = 2*PI ; + PI2 = 2*M_PI ; Standard_Integer ii, degree = num_poles -1 ; locUFirst = UFirst ; @@ -91,7 +91,7 @@ void BuildPolynomialCosAndSin // parametre 1/2 of Bezier was exactly a point of the bissectrice // of the required angular sector. // - Angle = middle - PI ; + Angle = middle - M_PI ; // // Circle of radius 1. See Euclid // @@ -113,10 +113,10 @@ void BuildPolynomialCosAndSin } - t_min = 1.0e0 - (Delta * 1.3e0 / PI) ; + t_min = 1.0e0 - (Delta * 1.3e0 / M_PI) ; t_min *= 0.5e0 ; t_min = Max(t_min,0.0e0) ; - t_max = 1.0e0 + (Delta * 1.3e0 / PI) ; + t_max = 1.0e0 + (Delta * 1.3e0 / M_PI) ; t_max *= 0.5e0 ; t_max = Min(t_max,1.0e0) ; trim_max = Locate(Delta, diff --git a/src/Convert/Convert_SphereToBSplineSurface.cxx b/src/Convert/Convert_SphereToBSplineSurface.cxx index ff9fe06d9f..74a9a057ac 100755 --- a/src/Convert/Convert_SphereToBSplineSurface.cxx +++ b/src/Convert/Convert_SphereToBSplineSurface.cxx @@ -28,9 +28,9 @@ static void ComputePoles ( const Standard_Real R, // Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds) Standard_Integer - nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1; + nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1; Standard_Integer - nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / PI) + 1; + nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / M_PI) + 1; Standard_Real AlfaU = deltaU / ( nbUSpans * 2); Standard_Real AlfaV = deltaV / ( nbVSpans * 2); @@ -86,8 +86,8 @@ Convert_SphereToBSplineSurface::Convert_SphereToBSplineSurface { Standard_Real deltaU = U2 - U1; Standard_Real deltaV = V2 - V1; - Standard_DomainError_Raise_if( (deltaU>2*PI) || (deltaU<0.) || - (V1 < -PI/2.0) || (V2 > PI/2), + Standard_DomainError_Raise_if( (deltaU>2*M_PI) || (deltaU<0.) || + (V1 < -M_PI/2.0) || (V2 > M_PI/2), "Convert_SphereToBSplineSurface"); isuperiodic = Standard_False; @@ -98,9 +98,9 @@ Convert_SphereToBSplineSurface::Convert_SphereToBSplineSurface // Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds) Standard_Integer - nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1; + nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1; Standard_Integer - nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / PI) + 1; + nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / M_PI) + 1; Standard_Real AlfaU = deltaU / ( nbUSpans * 2); Standard_Real AlfaV = deltaV / ( nbVSpans * 2); @@ -163,7 +163,7 @@ Convert_SphereToBSplineSurface::Convert_SphereToBSplineSurface #ifndef No_Exception Standard_Real delta = Param2 - Param1; #endif - Standard_DomainError_Raise_if( (delta>2*PI) || (delta<0.), + Standard_DomainError_Raise_if( (delta>2*M_PI) || (delta<0.), "Convert_SphereToBSplineSurface"); Standard_Integer i, j; @@ -177,20 +177,20 @@ Convert_SphereToBSplineSurface::Convert_SphereToBSplineSurface Standard_Real W1, W2, CosU, CosV; if ( isuperiodic) { - ComputePoles(R, 0., 2.*PI, Param1, Param2, poles); + ComputePoles(R, 0., 2.*M_PI, Param1, Param2, poles); nbUPoles = 6; nbUKnots = 4; deltaV = Param2 - Param1; Standard_Integer - nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / PI) + 1; + nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / M_PI) + 1; Standard_Real AlfaV = deltaV / ( nbVSpans * 2); nbVPoles = 2 * nbVSpans + 1; nbVKnots = nbVSpans + 1; for ( i = 1; i <= nbUKnots; i++) { - uknots(i) = ( i-1) * 2. * PI /3.; + uknots(i) = ( i-1) * 2. * M_PI /3.; umults(i) = 2; } for ( i = 1; i <= nbVKnots; i++) { @@ -203,21 +203,21 @@ Convert_SphereToBSplineSurface::Convert_SphereToBSplineSurface CosV = Cos(AlfaV); } else { - ComputePoles(R, Param1, Param2, -PI/2., PI/2., poles); + ComputePoles(R, Param1, Param2, -M_PI/2., M_PI/2., poles); nbVPoles = 5; nbVKnots = 3; deltaU = Param2 - Param1; Standard_Integer - nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1; + nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1; Standard_Real AlfaU = deltaU / ( nbUSpans * 2); nbUPoles = 2 * nbUSpans + 1; nbUKnots = nbUSpans + 1; - vknots(1) = -PI/2.; vmults(1) = 3; + vknots(1) = -M_PI/2.; vmults(1) = 3; vknots(2) = 0.; vmults(2) = 2; - vknots(3) = PI/2.; vmults(3) = 3; + vknots(3) = M_PI/2.; vmults(3) = 3; for ( i = 1; i <= nbUKnots; i++) { uknots(i) = Param1 + (i-1) * 2 * AlfaU; umults(i) = 2; @@ -274,15 +274,15 @@ Convert_SphereToBSplineSurface::Convert_SphereToBSplineSurface Standard_Real R = Sph.Radius(); - ComputePoles( R, 0., 2.*PI, -PI/2., PI/2., poles); + ComputePoles( R, 0., 2.*M_PI, -M_PI/2., M_PI/2., poles); uknots( 1) = 0.; - uknots( 2) = 2. * PI / 3.; - uknots( 3) = 4. * PI / 3.; - uknots( 4) = 2. * PI; - vknots( 1) = -PI/2.; + uknots( 2) = 2. * M_PI / 3.; + uknots( 3) = 4. * M_PI / 3.; + uknots( 4) = 2. * M_PI; + vknots( 1) = -M_PI/2.; vknots( 2) = 0.; - vknots( 3) = PI/2.; + vknots( 3) = M_PI/2.; for ( i = 1; i <= 4; i++) { umults( i) = 2; } diff --git a/src/Convert/Convert_TorusToBSplineSurface.cxx b/src/Convert/Convert_TorusToBSplineSurface.cxx index d8df101f02..49a2051bee 100755 --- a/src/Convert/Convert_TorusToBSplineSurface.cxx +++ b/src/Convert/Convert_TorusToBSplineSurface.cxx @@ -29,9 +29,9 @@ static void ComputePoles ( const Standard_Real R, // Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds) Standard_Integer - nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1; + nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1; Standard_Integer - nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / PI) + 1; + nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / M_PI) + 1; Standard_Real AlfaU = deltaU / ( nbUSpans * 2); Standard_Real AlfaV = deltaV / ( nbVSpans * 2); @@ -88,8 +88,8 @@ Convert_TorusToBSplineSurface::Convert_TorusToBSplineSurface { Standard_Real deltaU = U2 - U1; Standard_Real deltaV = V2 - V1; - Standard_DomainError_Raise_if( (deltaU>2*PI) || (deltaU<0.) || - (deltaV>2*PI) || (deltaV<0.), + Standard_DomainError_Raise_if( (deltaU>2*M_PI) || (deltaU<0.) || + (deltaV>2*M_PI) || (deltaV<0.), "Convert_TorusToBSplineSurface"); isuperiodic = Standard_False; @@ -100,9 +100,9 @@ Convert_TorusToBSplineSurface::Convert_TorusToBSplineSurface // Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds) Standard_Integer - nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1; + nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1; Standard_Integer - nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / PI) + 1; + nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / M_PI) + 1; Standard_Real AlfaU = deltaU / ( nbUSpans * 2); Standard_Real AlfaV = deltaV / ( nbVSpans * 2); @@ -166,7 +166,7 @@ Convert_TorusToBSplineSurface::Convert_TorusToBSplineSurface #ifndef No_Exception Standard_Real delta = Param2 - Param1; #endif - Standard_DomainError_Raise_if( (delta>2*PI) || (delta<0.), + Standard_DomainError_Raise_if( (delta>2*M_PI) || (delta<0.), "Convert_TorusToBSplineSurface"); Standard_Integer i, j; @@ -181,20 +181,20 @@ Convert_TorusToBSplineSurface::Convert_TorusToBSplineSurface Standard_Real W1, W2, CosU, CosV; if ( isuperiodic) { - ComputePoles(R, r, 0, 2.*PI, Param1, Param2, poles); + ComputePoles(R, r, 0, 2.*M_PI, Param1, Param2, poles); nbUPoles = 6; nbUKnots = 4; deltaV = Param2 - Param1; Standard_Integer - nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / PI) + 1; + nbVSpans = (Standard_Integer)IntegerPart( 1.2 * deltaV / M_PI) + 1; Standard_Real AlfaV = deltaV / ( nbVSpans * 2); nbVPoles = 2 * nbVSpans + 1; nbVKnots = nbVSpans + 1; for ( i = 1; i <= nbUKnots; i++) { - uknots(i) = ( i-1) * 2. * PI /3.; + uknots(i) = ( i-1) * 2. * M_PI /3.; umults(i) = 2; } for ( i = 1; i <= nbVKnots; i++) { @@ -207,20 +207,20 @@ Convert_TorusToBSplineSurface::Convert_TorusToBSplineSurface CosV = Cos(AlfaV); } else { - ComputePoles(R, r, Param1, Param2, 0., 2.*PI, poles); + ComputePoles(R, r, Param1, Param2, 0., 2.*M_PI, poles); nbVPoles = 6; nbVKnots = 4; deltaU = Param2 - Param1; Standard_Integer - nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / PI) + 1; + nbUSpans = (Standard_Integer)IntegerPart( 1.2 * deltaU / M_PI) + 1; Standard_Real AlfaU = deltaU / ( nbUSpans * 2); nbUPoles = 2 * nbUSpans + 1; nbUKnots = nbUSpans + 1; for ( i = 1; i <= nbVKnots; i++) { - vknots(i) = ( i-1) * 2. * PI /3.; + vknots(i) = ( i-1) * 2. * M_PI /3.; vmults(i) = 2; } for ( i = 1; i <= nbUKnots; i++) { @@ -281,12 +281,12 @@ Convert_TorusToBSplineSurface::Convert_TorusToBSplineSurface Standard_Real R = T.MajorRadius(); Standard_Real r = T.MinorRadius(); - ComputePoles( R, r, 0., 2.*PI, 0., 2.*PI, poles); + ComputePoles( R, r, 0., 2.*M_PI, 0., 2.*M_PI, poles); uknots( 1) = vknots( 1) = 0.; - uknots( 2) = vknots( 2) = 2. * PI / 3.; - uknots( 3) = vknots( 3) = 4. * PI / 3.; - uknots( 4) = vknots( 4) = 2. * PI; + uknots( 2) = vknots( 2) = 2. * M_PI / 3.; + uknots( 3) = vknots( 3) = 4. * M_PI / 3.; + uknots( 4) = vknots( 4) = 2. * M_PI; for ( i = 1; i <= 4; i++) { umults( i) = vmults( i) = 2; } diff --git a/src/DBRep/DBRep.cxx b/src/DBRep/DBRep.cxx index 4df1225f0d..5bdb9a9cba 100755 --- a/src/DBRep/DBRep.cxx +++ b/src/DBRep/DBRep.cxx @@ -97,9 +97,9 @@ static Standard_Real size = 100.; static Standard_Integer discret = 30; static Standard_Boolean disptriangles = Standard_False; static Standard_Boolean disppolygons = Standard_False; -static Standard_Real anglHLR = 35 * PI / 180; -static Standard_Real HAngMin = 1 * PI / 180; -static Standard_Real HAngMax = 35 * PI / 180; +static Standard_Real anglHLR = 35 * M_PI / 180; +static Standard_Real HAngMin = 1 * M_PI / 180; +static Standard_Real HAngMax = 35 * M_PI / 180; static Standard_Boolean withHLR = Standard_False; static Standard_Boolean withRg1 = Standard_True; static Standard_Boolean withRgN = Standard_False; @@ -172,7 +172,7 @@ static Standard_Integer hlr (Draw_Interpretor& di, di << "\n"; if (withHLR) { di << "Angle of discretization : "; - di << anglHLR * 180 / PI << " degrees" << "\n"; + di << anglHLR * 180 / M_PI << " degrees" << "\n"; } } else di << " wireframe"; @@ -207,7 +207,7 @@ static Standard_Integer hlr (Draw_Interpretor& di, } else if (!strcasecmp(a[1],"ang" )) { di << "Angle de discretisation : "; - di << anglHLR * 180 / PI << " degres" << "\n"; + di << anglHLR * 180 / M_PI << " degres" << "\n"; } else return 1; } @@ -218,12 +218,12 @@ static Standard_Integer hlr (Draw_Interpretor& di, nFirst = 3; if (n == 3) { Standard_Real ang = atof(a[2]); - anglHLR = ang * PI / 180; + anglHLR = ang * M_PI / 180; if (anglHLR < HAngMin) anglHLR = HAngMin; if (anglHLR > HAngMax) anglHLR = HAngMax; } di << "Angle of discretization : "; - di << anglHLR * 180 / PI << " degrees" << "\n"; + di << anglHLR * 180 / M_PI << " degrees" << "\n"; } if (n >= nFirst + 1) { @@ -264,7 +264,7 @@ static Standard_Integer hlr (Draw_Interpretor& di, } else if (!strcasecmp(a[1],"ang" )) { Standard_Real ang = atof(a[2]); - localAng = ang * PI / 180; + localAng = ang * M_PI / 180; } else return 1; S->DisplayHLR(localHLR, localRg1, localRgN, localHid, diff --git a/src/DDataStd/DDataStd.cxx b/src/DDataStd/DDataStd.cxx index bbdd18378b..fde44d1b84 100755 --- a/src/DDataStd/DDataStd.cxx +++ b/src/DDataStd/DDataStd.cxx @@ -60,7 +60,7 @@ void DDataStd::DumpConstraint (const Handle(TDataXtd_Constraint)& CTR, Standard_ TDataStd_RealEnum t = CTR->GetValue()->GetDimension(); TDataStd::Print(t,anOS); Standard_Real val = CTR->GetValue()->Get(); - if (t == TDataStd_ANGULAR) val = (180.*val)/PI; + if (t == TDataStd_ANGULAR) val = (180.*val)/M_PI; anOS << " "; anOS << val; } diff --git a/src/DDataStd/DDataStd_DatumCommands.cxx b/src/DDataStd/DDataStd_DatumCommands.cxx index 78bb2f8147..c69aa0a901 100755 --- a/src/DDataStd/DDataStd_DatumCommands.cxx +++ b/src/DDataStd/DDataStd_DatumCommands.cxx @@ -192,7 +192,7 @@ static Standard_Integer DDataStd_SetPlane (Draw_Interpretor& di, // Standard_Real ang = atof(arg[9]); // T.SetRotation(gp_Ax1(gp_Pnt(x,y,z), // gp_Vec(dx,dy,dz)), -// ang * PI180); +// ang * (M_PI / 180.0)); // } // Loc = T; // } diff --git a/src/DDataStd/DDataStd_DrawDriver.cxx b/src/DDataStd/DDataStd_DrawDriver.cxx index ead2555d59..84b863ab6e 100755 --- a/src/DDataStd/DDataStd_DrawDriver.cxx +++ b/src/DDataStd/DDataStd_DrawDriver.cxx @@ -355,7 +355,7 @@ Handle(Draw_Drawable3D) DDataStd_DrawDriver::DrawableConstraint (const Handle(TD if (!D.IsNull()) { if (!A->GetValue().IsNull()) { Standard_Real val = A->GetValue()->Get(); - if (A->GetValue()->GetDimension() == TDataStd_ANGULAR) val = (180.*val)/PI; + if (A->GetValue()->GetDimension() == TDataStd_ANGULAR) val = (180.*val)/M_PI; D->SetValue(val); } // unverified constraints are red (default is white) diff --git a/src/DDataStd/DDataStd_Sample.cxx b/src/DDataStd/DDataStd_Sample.cxx index 9251e51715..c06c6141b0 100755 --- a/src/DDataStd/DDataStd_Sample.cxx +++ b/src/DDataStd/DDataStd_Sample.cxx @@ -79,7 +79,7 @@ static void Sample() // Filling array for(Standard_Integer j = realarray->Lower(); j<= realarray->Upper(); j++) { - realarray->SetValue(j, Standard_PI*j); + realarray->SetValue(j, M_PI * j); } // Getting length of array diff --git a/src/DNaming/DNaming_ModelingCommands.cxx b/src/DNaming/DNaming_ModelingCommands.cxx index 1ce98cc461..6fa4b5427b 100644 --- a/src/DNaming/DNaming_ModelingCommands.cxx +++ b/src/DNaming/DNaming_ModelingCommands.cxx @@ -1103,7 +1103,7 @@ static Standard_Integer DNaming_PRotateLine(Draw_Interpretor& di, Standard_Real anAngle = 0.; anAngle = atof(a[4]); - Standard_Real aK = 2*PI/360; + Standard_Real aK = 2*M_PI/360; anAngle = anAngle * aK; DNaming::GetReal(aFun,PTRANSF_ANG)->Set(anAngle); @@ -1265,7 +1265,7 @@ static Standard_Integer DNaming_AddRevol (Draw_Interpretor& theDI, if(theNb > 4 ) { Standard_Real angle = atof(theArg[4]); - Standard_Real aK = 2*PI/360; + Standard_Real aK = 2*M_PI/360; angle = angle * aK; DNaming::GetReal(aFun,REVOL_ANGLE)->Set(angle); if( theNb == 6) { diff --git a/src/Draft/Draft_Modification.cxx b/src/Draft/Draft_Modification.cxx index 73ccdbf0a9..8d925964f6 100755 --- a/src/Draft/Draft_Modification.cxx +++ b/src/Draft/Draft_Modification.cxx @@ -409,7 +409,7 @@ Standard_Boolean Draft_Modification::NewCurve2d(const TopoDS_Edge& E, gp_Pnt2d PF,PL; BRep_Tool::UVPoints(E,F,PF,PL); gp_Pnt2d NewPF = C->Value(Fp); - gp_Vec2d vectra(2.*PI,0.); + gp_Vec2d vectra(2.*M_PI,0.); if (NewPF.Translated(vectra).SquareDistance(PF) < NewPF.SquareDistance(PF)) { diff --git a/src/Draft/Draft_Modification_1.cxx b/src/Draft/Draft_Modification_1.cxx index 5bf0d35faf..832a9df01a 100755 --- a/src/Draft/Draft_Modification_1.cxx +++ b/src/Draft/Draft_Modification_1.cxx @@ -263,7 +263,7 @@ Standard_Boolean Draft_Modification::InternalAdd(const TopoDS_Face& F, } } } - NewS = new Geom_RectangularTrimmedSurface(NewS,0.,2.*PI,vmin,vmax); + NewS = new Geom_RectangularTrimmedSurface(NewS,0.,2.*M_PI,vmin,vmax); } } } @@ -513,7 +513,7 @@ Standard_Boolean Draft_Modification::Propagate () vmin = vmin - deltav; vmax = vmax + deltav; NewS = - new Geom_RectangularTrimmedSurface(NewS,0.,2.*PI,vmin,vmax); + new Geom_RectangularTrimmedSurface(NewS,0.,2.*M_PI,vmin,vmax); } } @@ -779,7 +779,7 @@ void Draft_Modification::Perform () vmin = -300; } - NewS = new Geom_RectangularTrimmedSurface(NewS,0.,1.9*PI,vmin,vmax); + NewS = new Geom_RectangularTrimmedSurface(NewS,0.,1.9*M_PI,vmin,vmax); Finf.ChangeGeometry() = NewS; } itf.Next(); @@ -1096,14 +1096,14 @@ void Draft_Modification::Perform () GeomAPI_ProjectPointOnSurf projector( Pnt, S1, Precision::Confusion() ); Standard_Real U, V; projector.LowerDistanceParameters( U, V ); - if (Abs(U) <= Precision::Confusion() || Abs(U-2.*PI) <= Precision::Confusion()) + if (Abs(U) <= Precision::Confusion() || Abs(U-2.*M_PI) <= Precision::Confusion()) Candidates.Append( aCurve ); else { Pnt = aCurve->Value( aCurve->LastParameter() ); projector.Init( Pnt, S1, Precision::Confusion() ); projector.LowerDistanceParameters( U, V ); - if (Abs(U) <= Precision::Confusion() || Abs(U-2.*PI) <= Precision::Confusion()) + if (Abs(U) <= Precision::Confusion() || Abs(U-2.*M_PI) <= Precision::Confusion()) { aCurve->Reverse(); Candidates.Append( aCurve ); @@ -1943,13 +1943,13 @@ static Standard_Real Parameter(const Handle(Geom_Curve)& C, } else if (ctyp == STANDARD_TYPE(Geom_Circle)) { param = ElCLib::Parameter(Handle(Geom_Circle)::DownCast(cbase)->Circ(),P); - if (Abs(2.*PI-param) <=Epsilon(2.*PI)) { + if (Abs(2.*M_PI-param) <=Epsilon(2.*M_PI)) { param = 0.; } } else if (ctyp == STANDARD_TYPE(Geom_Ellipse)) { param = ElCLib::Parameter(Handle(Geom_Ellipse)::DownCast(cbase)->Elips(),P); - if (Abs(2.*PI-param) <=Epsilon(2.*PI)) { + if (Abs(2.*M_PI-param) <=Epsilon(2.*M_PI)) { param = 0.; } } @@ -2164,8 +2164,8 @@ static Standard_Boolean FindRotation(const gp_Pln& Pl, theta = -theta0 -phi; } // modified by NIZHNY-EAP Tue Nov 16 15:51:38 1999 ___BEGIN___ - while (Abs(theta)>PI) { - theta = theta + PI*(theta<0 ? 1 : -1); + while (Abs(theta)>M_PI) { + theta = theta + M_PI*(theta<0 ? 1 : -1); } // modified by NIZHNY-EAP Tue Nov 16 15:53:32 1999 ___END___ Axe = li.Position(); diff --git a/src/Draw/Draw_Display.cxx b/src/Draw/Draw_Display.cxx index e37c9449c0..a1cc1bd1a1 100755 --- a/src/Draw/Draw_Display.cxx +++ b/src/Draw/Draw_Display.cxx @@ -89,7 +89,7 @@ void Draw_Display::DrawMarker (const gp_Pnt2d& pt, // gp_Circ2d C; C.SetRadius(ISize); C.SetLocation(pt); - Draw(C, 0, 2*PI, Standard_False); + Draw(C, 0, 2*M_PI, Standard_False); break; #ifndef DEB default: @@ -144,7 +144,7 @@ void Draw_Display::DrawMarker (const gp_Pnt2d& pt, // if the circus is too small, a "plus" is drawn to mark the point Standard_Boolean b = (R * Zoom()) > 2; if(b) - Draw(C, 0, 2*PI); + Draw(C, 0, 2*M_PI); else DrawMarker(pt, Draw_Plus); } @@ -164,7 +164,7 @@ void Draw_Display::Draw(const gp_Circ& C, const Standard_Real A1,const Standard_ const Standard_Boolean ModifyWithZoom) { Standard_Real A2 = A3; - while (A2 < A1) A2 += 2*PI; + while (A2 < A1) A2 += 2*M_PI; Standard_Real angle = DEFLECTION / (C.Radius() * Zoom()); Standard_Integer n = (Standard_Integer )( (A2 - A1) / angle); @@ -213,7 +213,7 @@ void Draw_Display::Draw(const gp_Circ2d& C, const Standard_Real A1, const Standa const Standard_Boolean ModifyWithZoom) { Standard_Real A2 = A3; - while (A2 < A1) A2 += 2*PI; + while (A2 < A1) A2 += 2*M_PI; Standard_Real angle = DEFLECTION / (C.Radius() * Zoom()); Standard_Integer n = (Standard_Integer )( (A2 - A1) / angle); diff --git a/src/Draw/Draw_GraphicCommands.cxx b/src/Draw/Draw_GraphicCommands.cxx index d2dbae2c93..f82782afdb 100755 --- a/src/Draw/Draw_GraphicCommands.cxx +++ b/src/Draw/Draw_GraphicCommands.cxx @@ -33,7 +33,7 @@ extern Standard_Boolean Draw_Batch; extern Standard_Boolean Draw_BlackBackGround; -#define DEFROTATE (5 * PI/ 180.) +#define DEFROTATE (5 * M_PI/ 180.) #define DEFMAGNIFY 1.1 #define DEFPANNING 0.1 #define DEFFOCAL 1.1 diff --git a/src/Draw/Draw_VariableCommands.cxx b/src/Draw/Draw_VariableCommands.cxx index 7d5343c3aa..f2def5a0a7 100755 --- a/src/Draw/Draw_VariableCommands.cxx +++ b/src/Draw/Draw_VariableCommands.cxx @@ -1193,7 +1193,7 @@ void Draw::VariableCommands(Draw_Interpretor& theCommands) theAxes2d->Protected(Standard_True); n = "pi"; - Draw::Set(n,PI); + Draw::Set(n,M_PI); Draw::Get(n)->Protected(Standard_True); n = "pinf"; diff --git a/src/Draw/Draw_Viewer.cxx b/src/Draw/Draw_Viewer.cxx index b165bd95a5..d27270514e 100755 --- a/src/Draw/Draw_Viewer.cxx +++ b/src/Draw/Draw_Viewer.cxx @@ -180,135 +180,135 @@ Standard_Boolean Draw_View::Init (const char* typ) } else if (!strcmp("-Y+X",typ)) { - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),PI/2); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),M_PI/2); } else if (!strcmp("-X-Y",typ)) { - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),PI); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),M_PI); } else if (!strcmp("+Y-X",typ)) { - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),-PI/2); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),-M_PI/2); } else if (!strcmp("+Y+X",typ)) { - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),-PI/2); - T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),PI); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),-M_PI/2); + T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),M_PI); Matrix.Multiply(T); } else if (!strcmp("-X+Y",typ)) { - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),PI); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),M_PI); } else if (!strcmp("-Y-X",typ)) { - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),-PI/2); - T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),PI); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),-M_PI/2); + T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),M_PI); Matrix.Multiply(T); } else if (!strcmp("+X-Y",typ)) { - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),PI); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),M_PI); } else if (!strcmp("+X+Z",typ)) { - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-PI/2); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-M_PI/2); } else if (!strcmp("-Z+X",typ)) { - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-PI/2); - T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-PI/2); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-M_PI/2); + T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-M_PI/2); Matrix.Multiply(T); } else if (!strcmp("-X-Z",typ)) { - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-PI/2); - T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-PI); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-M_PI/2); + T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-M_PI); Matrix.Multiply(T); } else if (!strcmp("+Z-X",typ)) { - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-PI/2); - T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),PI/2); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-M_PI/2); + T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),M_PI/2); Matrix.Multiply(T); } else if (!strcmp("+Z+X",typ)) { - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),PI/2); - T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),PI/2); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),M_PI/2); + T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),M_PI/2); Matrix.Multiply(T); } else if (!strcmp("-X+Z",typ)) { - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),PI/2); - T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),PI); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),M_PI/2); + T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),M_PI); Matrix.Multiply(T); } else if (!strcmp("-Z-X",typ)) { - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),PI/2); - T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-PI/2); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),M_PI/2); + T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-M_PI/2); Matrix.Multiply(T); } else if (!strcmp("+X-Z",typ)) { - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),PI/2); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),M_PI/2); } else if (!strcmp("+Y+Z",typ)) { - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-PI/2); - T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-PI/2); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-M_PI/2); + T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-M_PI/2); Matrix.Multiply(T); } else if (!strcmp("-Z+Y",typ)) { - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-PI/2); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-M_PI/2); } else if (!strcmp("-Y-Z",typ)) { - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-PI/2); - T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),PI/2); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-M_PI/2); + T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),M_PI/2); Matrix.Multiply(T); } else if (!strcmp("+Z-Y",typ)) { - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-PI/2); - T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),PI); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),-M_PI/2); + T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),M_PI); Matrix.Multiply(T); } else if (!strcmp("+Z+Y",typ)) { - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),PI/2); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),M_PI/2); } else if (!strcmp("-Y+Z",typ)) { - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),PI/2); - T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-PI/2); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),M_PI/2); + T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-M_PI/2); Matrix.Multiply(T); } else if (!strcmp("-Z-Y",typ)) { - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),PI/2); - T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),PI); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),M_PI/2); + T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),M_PI); Matrix.Multiply(T); } else if (!strcmp("+Y-Z",typ)) { - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),PI/2); - T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),PI/2); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(0,1,0)),M_PI/2); + T.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),M_PI/2); Matrix.Multiply(T); } else if (!strcmp("AXON",typ)) { - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-PI/4); - T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),-PI/4); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-M_PI/4); + T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),-M_PI/4); Matrix.Multiply(T); } else if (!strcmp("PERS",typ)) { FlagPers =1; - Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-PI/4); - T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),-PI/4); + Matrix.SetRotation(gp_Ax1(Pvise,gp_Dir(1,0,0)),-M_PI/4); + T.SetRotation(gp_Ax1(Pvise,gp_Dir(0,0,1)),-M_PI/4); Matrix.Multiply(T); } else { diff --git a/src/DrawDim/DrawDim.cxx b/src/DrawDim/DrawDim.cxx index b064bdaa17..2bec010f4e 100755 --- a/src/DrawDim/DrawDim.cxx +++ b/src/DrawDim/DrawDim.cxx @@ -59,7 +59,7 @@ void DrawDim::DrawShapeName (const TopoDS_Shape& ashape, } else if (curve->IsKind(STANDARD_TYPE(Geom_Circle))) { parameter = (f+l)/2.; - if (f > l) parameter = parameter + PI; + if (f > l) parameter = parameter + M_PI; position = ElCLib::Value(parameter,Handle(Geom_Circle)::DownCast(curve)->Circ()); } } diff --git a/src/DrawDim/DrawDim_PlanarAngle.cxx b/src/DrawDim/DrawDim_PlanarAngle.cxx index e033d026b3..c1f24e92e9 100755 --- a/src/DrawDim/DrawDim_PlanarAngle.cxx +++ b/src/DrawDim/DrawDim_PlanarAngle.cxx @@ -148,15 +148,15 @@ void DrawDim_PlanarAngle::DrawOn(Draw_Display& dis) const } if (!parallel && !clockwise) { p1 = angle; - p2 = PI; + p2 = M_PI; } if (parallel && clockwise) { - p1 = PI; - p2 = PI+angle; + p1 = M_PI; + p2 = M_PI+angle; } if (!parallel && clockwise) { - p1 = PI+angle; - p2 = 2*PI; + p1 = M_PI+angle; + p2 = 2*M_PI; } // affichage dis.Draw(circle,p1,p2); diff --git a/src/DrawDim/DrawDim_PlanarDiameter.cxx b/src/DrawDim/DrawDim_PlanarDiameter.cxx index c6d3b9cfd7..a022074a6b 100755 --- a/src/DrawDim/DrawDim_PlanarDiameter.cxx +++ b/src/DrawDim/DrawDim_PlanarDiameter.cxx @@ -57,7 +57,7 @@ void DrawDim_PlanarDiameter::DrawOn(Draw_Display& dis) const TopExp::Vertices(TopoDS::Edge(myCircle),vf,vl); const gp_Pnt first = BRep_Tool::Pnt(vf); Standard_Real parfirst = ElCLib::Parameter(circle,first); - Standard_Real parlast = (parfirst + PI); + Standard_Real parlast = (parfirst + M_PI); gp_Pnt last = ElCLib::Value(parlast,circle); // dis.Draw (first,last); diff --git a/src/DrawFairCurve/DrawFairCurve_Batten.cxx b/src/DrawFairCurve/DrawFairCurve_Batten.cxx index cf23436d5b..58a310eccd 100755 --- a/src/DrawFairCurve/DrawFairCurve_Batten.cxx +++ b/src/DrawFairCurve/DrawFairCurve_Batten.cxx @@ -42,14 +42,14 @@ void DrawFairCurve_Batten::SetPoint(const Standard_Integer Side, const gp_Pnt2d& void DrawFairCurve_Batten::SetAngle(const Standard_Integer Side, const Standard_Real Angle) { if (Side == 1) { - ((FairCurve_Batten*)MyBatten)->SetAngle1(Angle*PI/180); + ((FairCurve_Batten*)MyBatten)->SetAngle1(Angle*M_PI/180); if ( ((FairCurve_Batten*)MyBatten)->GetConstraintOrder1() == 0 ) { ((FairCurve_Batten*)MyBatten)->SetConstraintOrder1(1); } } else { - ((FairCurve_Batten*)MyBatten)->SetAngle2(Angle*PI/180); + ((FairCurve_Batten*)MyBatten)->SetAngle2(Angle*M_PI/180); if ( ((FairCurve_Batten*)MyBatten)->GetConstraintOrder2() == 0 ) { ((FairCurve_Batten*)MyBatten)->SetConstraintOrder2(1); diff --git a/src/DrawTrSurf/DrawTrSurf.cxx b/src/DrawTrSurf/DrawTrSurf.cxx index ec7a5aa322..e4d9d3011c 100755 --- a/src/DrawTrSurf/DrawTrSurf.cxx +++ b/src/DrawTrSurf/DrawTrSurf.cxx @@ -445,7 +445,7 @@ static Standard_Integer transform (Draw_Interpretor& di, Standard_Integer n, con else if (!strcmp(a[0],"rotate")) { if (last < 8) return 1; - Standard_Real ang = atof(a[last]) * PI180; + Standard_Real ang = atof(a[last]) * (M_PI / 180.0); last --; gp_Dir D(atof(a[last-2]),atof(a[last-1]),atof(a[last])); last -= 3; @@ -515,7 +515,7 @@ static Standard_Integer d2transform (Draw_Interpretor& di, Standard_Integer n, c else if (!strcmp(a[0],"2drotate")) { if (last < 4) return 1; - Standard_Real ang = atof(a[last]) * PI180; + Standard_Real ang = atof(a[last]) * (M_PI / 180.0); last --; gp_Pnt2d P(atof(a[last-1]),atof(a[last])); last -= 2; diff --git a/src/DsgPrs/DsgPrs.cxx b/src/DsgPrs/DsgPrs.cxx index 6778b3c17f..50d5d9a760 100755 --- a/src/DsgPrs/DsgPrs.cxx +++ b/src/DsgPrs/DsgPrs.cxx @@ -439,7 +439,7 @@ void DsgPrs::ComputeFacesAnglePresentation( const Standard_Real ArrowLength, Standard_Real & FirstParAttachCirc, Standard_Real & LastParAttachCirc ) { - if (Value > Precision::Angular() && Abs( PI-Value ) > Precision::Angular()) + if (Value > Precision::Angular() && Abs( M_PI-Value ) > Precision::Angular()) { // Computing presentation of angle's arc gp_Ax2 ax( CenterPoint, axisdir, dir1 ); @@ -475,8 +475,8 @@ void DsgPrs::ComputeFacesAnglePresentation( const Standard_Real ArrowLength, } else if (Sign1 == -1 && Sign2 == 1) { - Par1 += PI; - Par2 += PI; + Par1 += M_PI; + Par2 += M_PI; FirstParAngleCirc = Par1; LastParAngleCirc = Par2; } @@ -541,7 +541,7 @@ void DsgPrs::ComputeFacesAnglePresentation( const Standard_Real ArrowLength, Intersection.NearestPoints( ProjAttachPoint2, ProjAttachPoint2 ); Standard_Real U2 = ElCLib::Parameter( AttachCirc, ProjAttachPoint2 ); - if (U2 <= PI) + if (U2 <= M_PI) { FirstParAttachCirc = 0; LastParAttachCirc = U2; @@ -549,7 +549,7 @@ void DsgPrs::ComputeFacesAnglePresentation( const Standard_Real ArrowLength, else { FirstParAttachCirc = U2; - LastParAttachCirc = 2*PI; + LastParAttachCirc = 2*M_PI; } } } @@ -577,7 +577,7 @@ void DsgPrs::ComputeFilletRadiusPresentation( const Standard_Real ArrowLength, gp_Dir dir1(gp_Vec(Center, FirstPoint)); gp_Dir dir2(gp_Vec(Center, SecondPoint)); Standard_Real Angle = dir1.Angle(dir2); - if(Angle <= Precision::Angular() || ( PI - Angle ) <= Precision::Angular() || + if(Angle <= Precision::Angular() || ( M_PI - Angle ) <= Precision::Angular() || Value <= Precision::Confusion()) SpecCase = Standard_True; else SpecCase = Standard_False; if ( !SpecCase ) @@ -616,7 +616,7 @@ void DsgPrs::ComputeFilletRadiusPresentation( const Standard_Real ArrowLength, gp_Dir direction(PosVec) ; Standard_Real angle = dir1.Angle(direction) ; if (( dir1 ^ direction) * NormalDir < 0.0e0) angle = -angle ; - if(Sign1 == -1) angle += PI; + if(Sign1 == -1) angle += M_PI; EndOfArrow = ElCLib::Value(angle, FilletCirc); //*** } @@ -712,37 +712,37 @@ Standard_Real DsgPrs::DistanceFromApex(const gp_Elips & elips, { Standard_Real dist; Standard_Real parApex = ElCLib::Parameter ( elips, Apex ); - if(parApex == 0.0 || parApex == PI) + if(parApex == 0.0 || parApex == M_PI) {//Major case if(parApex == 0.0) //pos Apex - dist = (par < PI) ? par : (2*PI - par); + dist = (par < M_PI) ? par : (2*M_PI - par); else //neg Apex - dist = (par < PI) ? ( PI - par) : ( par - PI ); + dist = (par < M_PI) ? ( M_PI - par) : ( par - M_PI ); } else {// Minor case - if(parApex == PI / 2) //pos Apex + if(parApex == M_PI / 2) //pos Apex { - if(par <= parApex + PI && par > parApex ) + if(par <= parApex + M_PI && par > parApex ) dist = par - parApex; else { - if(par > parApex + PI) - dist = 2*PI - par + parApex; + if(par > parApex + M_PI) + dist = 2*M_PI - par + parApex; else - dist = parApex - par; // 0 < par < PI/2 + dist = parApex - par; // 0 < par < M_PI/2 } } else //neg Apex == 3/2 PI { - if(par <= parApex && par >= PI/2) + if(par <= parApex && par >= M_PI/2) dist = parApex - par; else { if(par > parApex) dist = par - parApex; else - dist = par + PI/2; // 0 < par < PI/2 + dist = par + M_PI/2; // 0 < par < PI/2 } } } diff --git a/src/DsgPrs/DsgPrs_AnglePresentation.cxx b/src/DsgPrs/DsgPrs_AnglePresentation.cxx index 63c9864b13..20ade24216 100755 --- a/src/DsgPrs/DsgPrs_AnglePresentation.cxx +++ b/src/DsgPrs/DsgPrs_AnglePresentation.cxx @@ -96,7 +96,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat aPnt = Apex; gp_Pnt P1 = ElCLib::Value(0., myCircle); - gp_Pnt P2 = ElCLib::Value(Standard_PI, myCircle); + gp_Pnt P2 = ElCLib::Value(M_PI, myCircle); gce_MakePln mkPln(P1, P2, aPnt); // create a plane whitch defines plane for projection aPosition on it @@ -130,8 +130,8 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat Standard_Real OppParam = ElCLib::Parameter(aCircle2, OppositePnt); gp_Dir aDir, aDir2; - while ( AttParam >= 2*Standard_PI ) AttParam -= 2*Standard_PI; - while ( OppParam >= 2*Standard_PI ) OppParam -= 2*Standard_PI; + while ( AttParam >= 2 * M_PI ) AttParam -= 2 * M_PI; + while ( OppParam >= 2 * M_PI ) OppParam -= 2 * M_PI; //-------------------------- Compute angle ------------------------ if( txt.Length() == 0 ) { @@ -157,15 +157,15 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat param = AttParam; if(IsArrowOut) { - aDir = gp_Dir( ( gp_Vec( ElCLib::Value( AttParam - Standard_PI/12, aCircle2 ), AttachmentPnt) ) ); - aDir2 = gp_Dir( ( gp_Vec( ElCLib::Value( OppParam + Standard_PI/12, aCircle2 ), OppositePnt) ) ); + aDir = gp_Dir( ( gp_Vec( ElCLib::Value( AttParam - M_PI / 12, aCircle2 ), AttachmentPnt) ) ); + aDir2 = gp_Dir( ( gp_Vec( ElCLib::Value( OppParam + M_PI / 12, aCircle2 ), OppositePnt) ) ); } else { - aDir = gp_Dir( ( gp_Vec( ElCLib::Value( AttParam + Standard_PI/12, aCircle2 ), AttachmentPnt ) ) ); - aDir2 = gp_Dir( ( gp_Vec( ElCLib::Value( OppParam - Standard_PI/12, aCircle2 ), OppositePnt ) ) ); + aDir = gp_Dir( ( gp_Vec( ElCLib::Value( AttParam + M_PI / 12, aCircle2 ), AttachmentPnt ) ) ); + aDir2 = gp_Dir( ( gp_Vec( ElCLib::Value( OppParam - M_PI / 12, aCircle2 ), OppositePnt ) ) ); } - while ( angle > 2*Standard_PI ) angle -= 2*Standard_PI; + while ( angle > 2 * M_PI ) angle -= 2 * M_PI; for( i = 0; i <= 11; i++ ) { //calculating of arc ( ElCLib::Value(param + angle/11 * i, aCircle2) ).Coord(X, Y, Z); V(i+1).SetCoord(X, Y, Z); @@ -183,9 +183,9 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat tmpPnt = tmpPnt.Translated(gp_Vec(0, 0, -1)*2); Prs3d_Text::Draw(aPresentation,aLengthAspect->TextAspect(), txt, tmpPnt); //add the TCollection_ExtendedString - angle = 2*Standard_PI - param ; + angle = 2 * M_PI - param ; if( param > OppParam ) { - while ( angle > 2*Standard_PI ) angle -= 2*Standard_PI; + while ( angle > 2 * M_PI ) angle -= 2 * M_PI; for( i = 11; i >= 0; i-- ) { //calculating of arc ( ElCLib::Value(-angle/11 * i, aCircle2) ).Coord(X, Y, Z); V(i+1).SetCoord(X, Y, Z); @@ -210,7 +210,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat if ( AboveInBelowCone( VmaxCircle, VminCircle, myCircle ) == 0 ) return; Graphic3d_Array1OfVertex V3(1,2); gp_Pnt P11 = ElCLib::Value( 0., VmaxCircle ); - gp_Pnt P12 = ElCLib::Value( Standard_PI, VmaxCircle ); + gp_Pnt P12 = ElCLib::Value( M_PI, VmaxCircle ); AttachmentPnt.Coord(X, Y, Z); V3(1).SetCoord(X, Y, Z); @@ -293,11 +293,11 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat Standard_Real ufin = uc2; if (uco > ufin) { - if (Abs(theval) udeb+PI && uco < ufin+PI){ - udeb = udeb + PI; - ufin = ufin + PI; + if (uco > udeb+M_PI && uco < ufin+M_PI){ + udeb = udeb + M_PI; + ufin = ufin + M_PI; uc1 = udeb; uc2 = ufin; } @@ -305,16 +305,16 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat } if (uco > ufin) { - if ((uco-uc2) < (uc1-uco+(2*PI))) { + if ((uco-uc2) < (uc1-uco+(2*M_PI))) { ufin = uco; } else { - udeb = uco - 2*PI; + udeb = uco - 2*M_PI; } } Standard_Real alpha = Abs(ufin-udeb); - Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / PI)); + Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / M_PI)); Graphic3d_Array1OfVertex V(1,nbp); Standard_Real dteta = alpha/(nbp-1); gp_Pnt ptcur; @@ -429,10 +429,10 @@ void DsgPrs_AnglePresentation::Add( const Handle(Prs3d_Presentation)& aPresentat Graphic3d_Array1OfVertex Vrap(1,2); // Creating the angle's arc or line if null angle - if (theval > Precision::Angular() && Abs( PI-theval ) > Precision::Angular()) + if (theval > Precision::Angular() && Abs( M_PI-theval ) > Precision::Angular()) { Standard_Real Alpha = Abs( LastParAngleCirc - FirstParAngleCirc ); - Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / PI)); + Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI)); Graphic3d_Array1OfVertex ApproxArc( 0, NodeNumber-1 ); Standard_Real delta = Alpha / (Standard_Real)( NodeNumber - 1 ); gp_Pnt CurPnt; @@ -484,7 +484,7 @@ void DsgPrs_AnglePresentation::Add( const Handle(Prs3d_Presentation)& aPresentat { // Creating the arc from AttachmentPoint2 to its projection Standard_Real Alpha = Abs( LastParAttachCirc - FirstParAttachCirc ); - Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / PI)); + Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI)); Graphic3d_Array1OfVertex ApproxArc( 0, NodeNumber-1 ); Standard_Real delta = Alpha / (Standard_Real)( NodeNumber - 1 ); gp_Pnt CurPnt; @@ -536,7 +536,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat Norm = dir1.Crossed(dir2B); } - if (Abs(theval) > PI) Norm.Reverse(); + if (Abs(theval) > M_PI) Norm.Reverse(); gp_Ax2 ax(CenterPoint,Norm,dir1); gp_Circ cer(ax,CenterPoint.Distance(OffsetPoint)); @@ -558,11 +558,11 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat Standard_Real ufin = uc2; if (uco > ufin) { - if (Abs(theval) udeb+PI && uco < ufin+PI){ - udeb = udeb + PI; - ufin = ufin + PI; + if (uco > udeb+M_PI && uco < ufin+M_PI){ + udeb = udeb + M_PI; + ufin = ufin + M_PI; uc1 = udeb; uc2 = ufin; } @@ -570,16 +570,16 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat } if (uco > ufin) { - if ((uco-uc2) < (uc1-uco+(2*PI))) { + if ((uco-uc2) < (uc1-uco+(2*M_PI))) { ufin = uco; } else { - udeb = uco - 2*PI; + udeb = uco - 2*M_PI; } } Standard_Real alpha = Abs(ufin-udeb); - Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / PI)); + Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / M_PI)); Graphic3d_Array1OfVertex V(1,nbp); Standard_Real dteta = alpha/(nbp-1); gp_Pnt ptcur; @@ -660,7 +660,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect()); gp_Dir Norm = dir1.Crossed(dir2); - if (Abs(theval) > PI) Norm.Reverse(); + if (Abs(theval) > M_PI) Norm.Reverse(); gp_Ax2 ax(CenterPoint,Norm,dir1); gp_Circ cer(ax,CenterPoint.Distance(OffsetPoint)); @@ -682,11 +682,11 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat Standard_Real ufin = uc2; if (uco > ufin) { - if (Abs(theval) udeb+PI && uco < ufin+PI){ - udeb = udeb + PI; - ufin = ufin + PI; + if (uco > udeb+M_PI && uco < ufin+M_PI){ + udeb = udeb + M_PI; + ufin = ufin + M_PI; uc1 = udeb; uc2 = ufin; } @@ -694,16 +694,16 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat } if (uco > ufin) { - if ((uco-uc2) < (uc1-uco+(2*PI))) { + if ((uco-uc2) < (uc1-uco+(2*M_PI))) { ufin = uco; } else { - udeb = uco - 2*PI; + udeb = uco - 2*M_PI; } } Standard_Real alpha = Abs(ufin-udeb); - Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / PI)); + Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / M_PI)); Graphic3d_Array1OfVertex V(1,nbp); Standard_Real dteta = alpha/(nbp-1); gp_Pnt ptcur; @@ -788,7 +788,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect()); gp_Dir Norm = dir1.Crossed(dir2); - if (Abs(theval) > PI) Norm.Reverse(); + if (Abs(theval) > M_PI) Norm.Reverse(); gp_Ax2 ax(CenterPoint,Norm,dir1); gp_Circ cer(ax,CenterPoint.Distance(OffsetPoint)); @@ -810,11 +810,11 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat Standard_Real ufin = uc2; if (uco > ufin) { - if (Abs(theval) udeb+PI && uco < ufin+PI){ - udeb = udeb + PI; - ufin = ufin + PI; + if (uco > udeb+M_PI && uco < ufin+M_PI){ + udeb = udeb + M_PI; + ufin = ufin + M_PI; uc1 = udeb; uc2 = ufin; } @@ -822,16 +822,16 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat } if (uco > ufin) { - if ((uco-uc2) < (uc1-uco+(2*PI))) { + if ((uco-uc2) < (uc1-uco+(2*M_PI))) { ufin = uco; } else { - udeb = uco - 2*PI; + udeb = uco - 2*M_PI; } } Standard_Real alpha = Abs(ufin-udeb); - Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / PI)); + Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / M_PI)); Graphic3d_Array1OfVertex V(1,nbp); Standard_Real dteta = alpha/(nbp-1); gp_Pnt ptcur; @@ -904,7 +904,7 @@ void DsgPrs_AnglePresentation::Add (const Handle(Prs3d_Presentation)& aPresentat gp_Ax2 ax(CenterPoint,theAxe.Direction(),dir1); gp_Circ cer(ax,CenterPoint.Distance(AttachmentPoint1)); - Standard_Integer nbp = Max (4 , Standard_Integer (50. * theval / PI)); + Standard_Integer nbp = Max (4 , Standard_Integer (50. * theval / M_PI)); Graphic3d_Array1OfVertex V(1,nbp); Standard_Real dteta = theval/(nbp-1); gp_Pnt ptcur; diff --git a/src/DsgPrs/DsgPrs_ConcentricPresentation.cxx b/src/DsgPrs/DsgPrs_ConcentricPresentation.cxx index 3683698a31..f051b02625 100755 --- a/src/DsgPrs/DsgPrs_ConcentricPresentation.cxx +++ b/src/DsgPrs/DsgPrs_ConcentricPresentation.cxx @@ -32,7 +32,7 @@ void DsgPrs_ConcentricPresentation::Add( //Creation et discretisation du plus gros cercle gp_Circ Circ(gp_Ax2(aCenter,aNorm), aRadius); Standard_Integer nbp = 50; - Standard_Real dteta = (2 * PI)/nbp; + Standard_Real dteta = (2 * M_PI)/nbp; Graphic3d_Array1OfVertex V(1,nbp+1); gp_Pnt ptcur; Standard_Real ucur = 0; diff --git a/src/DsgPrs/DsgPrs_DiameterPresentation.cxx b/src/DsgPrs/DsgPrs_DiameterPresentation.cxx index 68f42bdda6..e0e99bc5d6 100755 --- a/src/DsgPrs/DsgPrs_DiameterPresentation.cxx +++ b/src/DsgPrs/DsgPrs_DiameterPresentation.cxx @@ -114,18 +114,18 @@ static Standard_Boolean DsgPrs_InDomain(const Standard_Real fpar, if(lpar > fpar) return ((para >= fpar) && (para <= lpar)); else { // fpar > lpar - Standard_Real delta = 2*PI-fpar; + Standard_Real delta = 2*M_PI-fpar; Standard_Real lp, par, fp; lp = lpar + delta; par = para + delta; - while(lp > 2*PI) lp-=2*PI; - while(par > 2*PI) par-=2*PI; + while(lp > 2*M_PI) lp-=2*M_PI; + while(par > 2*M_PI) par-=2*M_PI; fp = 0.; return ((par >= fp) && (par <= lp)); } } - if (para >= (fpar+2*PI)) return Standard_True; + if (para >= (fpar+2*M_PI)) return Standard_True; if (para <= lpar) return Standard_True; return Standard_False; } @@ -148,9 +148,9 @@ void DsgPrs_DiameterPresentation::Add (const Handle(Prs3d_Presentation)& aPresen { Standard_Real fpara = uFirst; Standard_Real lpara = uLast; - while (lpara > 2*PI) { - fpara -= 2*PI; - lpara -= 2*PI; + while (lpara > 2*M_PI) { + fpara -= 2*M_PI; + lpara -= 2*M_PI; } Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect(); @@ -167,8 +167,8 @@ void DsgPrs_DiameterPresentation::Add (const Handle(Prs3d_Presentation)& aPresen gp_Pnt SecondPoint = ElCLib::Value(uLast, aCircle); if ( !DsgPrs_InDomain(fpara,lpara,parEndOfArrow)) { - Standard_Real otherpar = parEndOfArrow + PI;// not in domain - if (otherpar > 2*PI) otherpar -= 2*PI; + Standard_Real otherpar = parEndOfArrow + M_PI;// not in domain + if (otherpar > 2*M_PI) otherpar -= 2*M_PI; if (DsgPrs_InDomain(fpara,lpara,otherpar)) { parEndOfArrow = otherpar; // parameter on circle EndOfArrow = ElCLib::Value(parEndOfArrow, aCircle); diff --git a/src/DsgPrs/DsgPrs_EllipseRadiusPresentation.cxx b/src/DsgPrs/DsgPrs_EllipseRadiusPresentation.cxx index db67478fba..a8663e187e 100755 --- a/src/DsgPrs/DsgPrs_EllipseRadiusPresentation.cxx +++ b/src/DsgPrs/DsgPrs_EllipseRadiusPresentation.cxx @@ -122,7 +122,7 @@ void DsgPrs_EllipseRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aP parFirst = uLast; else parFirst = uFirst; - Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / PI)); + Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI)); Graphic3d_Array1OfVertex ApproxArc( 0, NodeNumber-1 ); Standard_Real delta = Alpha / ( NodeNumber - 1 ); gp_Pnt CurPnt; @@ -181,7 +181,7 @@ void DsgPrs_EllipseRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aP parFirst = uLast; else parFirst = uFirst; - Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / PI)); + Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI)); Graphic3d_Array1OfVertex ApproxArc( 0, NodeNumber-1 ); Standard_Real delta = Alpha / ( NodeNumber - 1 ); gp_Pnt CurPnt; diff --git a/src/DsgPrs/DsgPrs_EqualDistancePresentation.cxx b/src/DsgPrs/DsgPrs_EqualDistancePresentation.cxx index 1070a6e8d7..10596b99c9 100755 --- a/src/DsgPrs/DsgPrs_EqualDistancePresentation.cxx +++ b/src/DsgPrs/DsgPrs_EqualDistancePresentation.cxx @@ -190,16 +190,16 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )& aPar12 = ElCLib::Parameter(aCirc1, aPoint2); } else { - aPar11 = PI; - aPar12 = PI; + aPar11 = M_PI; + aPar12 = M_PI; } if (aCirc2.Radius() > Precision::Confusion()){ aPar21 = ElCLib::Parameter(aCirc2, aPoint3 ); aPar22 = ElCLib::Parameter(aCirc2, aPoint4); } else { - aPar21 = PI; - aPar22 = PI; + aPar21 = M_PI; + aPar22 = M_PI; } Graphic3d_Array1OfVertex V(1,2); @@ -209,9 +209,9 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )& Standard_Integer aNodeNb; Standard_Real aDelta, aCurPar; - if(aPar12 < aPar11 ) aPar12 +=2*PI; + if(aPar12 < aPar11 ) aPar12 +=2*M_PI; if (Abs(aPar12 - aPar11) > Precision::Confusion()) { - aNodeNb = Standard_Integer(Max(Abs(aPar12 - aPar11)*50./PI + 0.5, 4.)); + aNodeNb = Standard_Integer(Max(Abs(aPar12 - aPar11)*50./M_PI + 0.5, 4.)); Graphic3d_Array1OfVertex ApproxArc1( 1, aNodeNb+1); aDelta = (aPar12 - aPar11)/aNodeNb; aCurPar= aPar11; @@ -224,9 +224,9 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )& Prs3d_Root::CurrentGroup( aPresentation )->Polyline( ApproxArc1 ); } - if (aPar22 < aPar21) aPar22 += 2*PI; + if (aPar22 < aPar21) aPar22 += 2*M_PI; if ( Abs(aPar22 - aPar21) > Precision::Confusion()){ - aNodeNb = Standard_Integer(Max(Abs(aPar22 - aPar21)*50./PI + 0.5, 4.)); + aNodeNb = Standard_Integer(Max(Abs(aPar22 - aPar21)*50./M_PI + 0.5, 4.)); Graphic3d_Array1OfVertex ApproxArc2( 1, aNodeNb+1); aDelta = (aPar22 - aPar21)/aNodeNb; aCurPar= aPar21; diff --git a/src/DsgPrs/DsgPrs_FilletRadiusPresentation.cxx b/src/DsgPrs/DsgPrs_FilletRadiusPresentation.cxx index 9e001cbd73..76618f6bb7 100755 --- a/src/DsgPrs/DsgPrs_FilletRadiusPresentation.cxx +++ b/src/DsgPrs/DsgPrs_FilletRadiusPresentation.cxx @@ -92,7 +92,7 @@ void DsgPrs_FilletRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aPr if( !SpecCase ) { Standard_Real Alpha = Abs(LastParCirc - FirstParCirc); - Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / PI)); + Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI)); Graphic3d_Array1OfVertex ApproxArc( 0, NodeNumber-1 ); Standard_Real delta = Alpha / ( NodeNumber - 1 ); gp_Pnt CurPnt; diff --git a/src/DsgPrs/DsgPrs_FixPresentation.cxx b/src/DsgPrs/DsgPrs_FixPresentation.cxx index a15666f242..0982476e87 100755 --- a/src/DsgPrs/DsgPrs_FixPresentation.cxx +++ b/src/DsgPrs/DsgPrs_FixPresentation.cxx @@ -62,7 +62,7 @@ void DsgPrs_FixPresentation::Add( dirac.Normalize(); gp_Vec norac = dirac.Crossed(gp_Vec(aNormPln)); gp_Ax1 ax(aPntEnd, aNormPln); - norac.Rotate(ax, PI/8); + norac.Rotate(ax, M_PI/8); // vecteur normal au seg. de raccord norac*=(symbsize/2); gp_Pnt P1 = aPntEnd.Translated(norac); diff --git a/src/DsgPrs/DsgPrs_IdenticPresentation.cxx b/src/DsgPrs/DsgPrs_IdenticPresentation.cxx index 22f34758c7..7026ff1467 100755 --- a/src/DsgPrs/DsgPrs_IdenticPresentation.cxx +++ b/src/DsgPrs/DsgPrs_IdenticPresentation.cxx @@ -118,8 +118,8 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta Standard_Real pFAttach = ElCLib::Parameter(CC, aFAttach); Standard_Real pSAttach = ElCLib::Parameter(CC, aSAttach); Standard_Real alpha = pSAttach - pFAttach; - if ( alpha < 0 ) alpha += 2*Standard_PI; - Standard_Integer nb = (Standard_Integer )( 50. * alpha / PI); + if ( alpha < 0 ) alpha += 2 * M_PI; + Standard_Integer nb = (Standard_Integer )( 50. * alpha / M_PI); Standard_Integer nbp = Max (4 , nb); Graphic3d_Array1OfVertex V(1,nbp); Standard_Real dteta = alpha/(nbp-1); @@ -170,8 +170,8 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta Standard_Real pFAttach = ElCLib::Parameter(CC, aFAttach); Standard_Real pSAttach = ElCLib::Parameter(CC, aSAttach); Standard_Real alpha = pSAttach - pFAttach; - if ( alpha < 0 ) alpha += 2*Standard_PI; - Standard_Integer nb = (Standard_Integer )( 50. * alpha / PI); + if ( alpha < 0 ) alpha += 2 * M_PI; + Standard_Integer nb = (Standard_Integer )( 50. * alpha / M_PI); Standard_Integer nbp = Max (4 , nb); Graphic3d_Array1OfVertex V(1,nbp); Standard_Real dteta = alpha/(nbp-1); @@ -217,8 +217,8 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta Standard_Real pFAttach = ElCLib::Parameter(anEllipse, aFAttach); Standard_Real pSAttach = ElCLib::Parameter(anEllipse, aSAttach); Standard_Real alpha = pSAttach - pFAttach; - if ( alpha < 0 ) alpha += 2*Standard_PI; - Standard_Integer nb = (Standard_Integer)(50.0*alpha/PI); + if ( alpha < 0 ) alpha += 2 * M_PI; + Standard_Integer nb = (Standard_Integer)(50.0*alpha/M_PI); Standard_Integer nbp = Max (4 , nb); Graphic3d_Array1OfVertex V(1,nbp); Standard_Real dteta = alpha/(nbp-1); diff --git a/src/DsgPrs/DsgPrs_LengthPresentation.cxx b/src/DsgPrs/DsgPrs_LengthPresentation.cxx index f5f00e4df7..58341cedb7 100755 --- a/src/DsgPrs/DsgPrs_LengthPresentation.cxx +++ b/src/DsgPrs/DsgPrs_LengthPresentation.cxx @@ -384,7 +384,7 @@ void DsgPrs_LengthPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta Alpha = Abs( deltaU ); if (Alpha > Precision::Angular() && Alpha Precision::Angular() && AlphaSetPrimitivesAspect(LA->LineAspect()->Aspect()); - Standard_Real alpha = 2*Standard_PI; + Standard_Real alpha = 2 * M_PI; Standard_Integer nbp = 100; Graphic3d_Array1OfVertex VC(1,nbp); Standard_Real dteta = alpha/(nbp-1); @@ -131,7 +131,7 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen // center of the symmetry - circle around the MidPoint Prs3d_Root::NewGroup(aPresentation); Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect()); - Standard_Real alpha = 2*Standard_PI; + Standard_Real alpha = 2 * M_PI; Standard_Integer nbp = 100; Graphic3d_Array1OfVertex VC(1,nbp); Standard_Real dteta = alpha/(nbp-1); @@ -213,7 +213,7 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen // center of the symmetry - circle around the MidPoint Prs3d_Root::NewGroup(aPresentation); Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect()); - Standard_Real alpha = 2*Standard_PI; + Standard_Real alpha = 2 * M_PI; Standard_Integer nbp = 100; Graphic3d_Array1OfVertex VC(1,nbp); Standard_Real dteta = alpha/(nbp-1); @@ -259,8 +259,8 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen Standard_Real pf = ElCLib::Parameter(aCircle,Point1); Standard_Real pl = ElCLib::Parameter(aCircle,Point2); Standard_Real alpha = pl - pf; - if ( alpha < 0 ) alpha += 2*Standard_PI; - Standard_Integer nb = (Standard_Integer)(50.0*alpha/PI); + if ( alpha < 0 ) alpha += 2 * M_PI; + Standard_Integer nb = (Standard_Integer)(50.0*alpha/M_PI); Standard_Integer nbp = Max(4,nb); Graphic3d_Array1OfVertex VC1(1,nbp); Standard_Real dteta = alpha/(nbp-1); @@ -306,7 +306,7 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen // center of the symmetry - circle around the MidPoint Prs3d_Root::NewGroup(aPresentation); Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect()); - Standard_Real alpha = 2*Standard_PI; + Standard_Real alpha = 2 * M_PI; Standard_Integer nbp = 100; Graphic3d_Array1OfVertex VC(1,nbp); Standard_Real dteta = alpha/(nbp-1); @@ -352,8 +352,8 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen Standard_Real pf = ElCLib::Parameter(aCircle,Point1); Standard_Real pl = ElCLib::Parameter(aCircle,Point2); Standard_Real alpha = pl - pf; - if ( alpha < 0 ) alpha += 2*Standard_PI; - Standard_Integer nb = (Standard_Integer)(50.0*alpha/PI); + if ( alpha < 0 ) alpha += 2 * M_PI; + Standard_Integer nb = (Standard_Integer)(50.0*alpha/M_PI); Standard_Integer nbp = Max(4,nb); Graphic3d_Array1OfVertex VC1(1,nbp); Standard_Real dteta = alpha/(nbp-1); diff --git a/src/DsgPrs/DsgPrs_RadiusPresentation.cxx b/src/DsgPrs/DsgPrs_RadiusPresentation.cxx index 0206bfb598..44d8be4de5 100755 --- a/src/DsgPrs/DsgPrs_RadiusPresentation.cxx +++ b/src/DsgPrs/DsgPrs_RadiusPresentation.cxx @@ -38,7 +38,7 @@ static Standard_Boolean DsgPrs_InDomain(const Standard_Real fpar, if (fpar >= 0.) { return ((para >= fpar) && (para <= lpar)); } - if (para >= (fpar+2*PI)) return Standard_True; + if (para >= (fpar+2*M_PI)) return Standard_True; if (para <= lpar) return Standard_True; return Standard_False; } @@ -60,9 +60,9 @@ void DsgPrs_RadiusPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta { Standard_Real fpara = firstparam; Standard_Real lpara = lastparam; - while (lpara > 2*PI) { - fpara -= 2*PI; - lpara -= 2*PI; + while (lpara > 2*M_PI) { + fpara -= 2*M_PI; + lpara -= 2*M_PI; } Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect(); Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect()); @@ -70,8 +70,8 @@ void DsgPrs_RadiusPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta gp_Pnt attpoint = AttachmentPoint; Standard_Boolean otherside = Standard_False; if ( !DsgPrs_InDomain(fpara,lpara,parat)) { - Standard_Real otherpar = parat + PI; - if (otherpar > 2*PI) otherpar -= 2*PI; + Standard_Real otherpar = parat + M_PI; + if (otherpar > 2*M_PI) otherpar -= 2*M_PI; if (DsgPrs_InDomain(fpara,lpara,otherpar)) { parat = otherpar; otherside = Standard_True; diff --git a/src/DsgPrs/DsgPrs_ShapeDirPresentation.cxx b/src/DsgPrs/DsgPrs_ShapeDirPresentation.cxx index 18e374adf1..dbce5f5e63 100755 --- a/src/DsgPrs/DsgPrs_ShapeDirPresentation.cxx +++ b/src/DsgPrs/DsgPrs_ShapeDirPresentation.cxx @@ -268,7 +268,7 @@ void DsgPrs_ShapeDirPresentation::Add(const Handle(Prs3d_Presentation)& prs, Prs3d_Root::CurrentGroup(prs)->SetPrimitivesAspect(drawer->LineAspect()->Aspect()); Prs3d_Root::CurrentGroup(prs)->Polyline(line); - Prs3d_Arrow::Draw(prs, pt2, dir, PI/180.*10., leng*0.3); + Prs3d_Arrow::Draw(prs, pt2, dir, M_PI/180.*10., leng*0.3); } diff --git a/src/DsgPrs/DsgPrs_SymmetricPresentation.cxx b/src/DsgPrs/DsgPrs_SymmetricPresentation.cxx index 99b8bcb975..7aa453ebea 100755 --- a/src/DsgPrs/DsgPrs_SymmetricPresentation.cxx +++ b/src/DsgPrs/DsgPrs_SymmetricPresentation.cxx @@ -577,8 +577,8 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese alpha = fabs(ParamP1 - ParamPAttach1); if(ParamP1 < ParamPAttach1){ - if(alpha > PI){ - alpha = (2*PI) - alpha; + if(alpha > M_PI){ + alpha = (2*M_PI) - alpha; nbp = (Standard_Integer ) IntegerPart(alpha/(alpha*.02)); Dalpha = alpha/(nbp - 1); } @@ -588,8 +588,8 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese } } else{ - if(alpha > PI){ - alpha = (2*PI) - alpha; + if(alpha > M_PI){ + alpha = (2*M_PI) - alpha; nbp = (Standard_Integer ) IntegerPart(alpha/(alpha*.02)); Dalpha = -alpha/(nbp - 1); } @@ -630,8 +630,8 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese alpha = fabs(ParamP2 - ParamPAttach2); if (alpha <= Precision::Confusion()) alpha = 1.e-5; if(ParamP2 < ParamPAttach2){ - if(alpha > PI){ - alpha = (2*PI) - alpha; + if(alpha > M_PI){ + alpha = (2*M_PI) - alpha; nbp = (Standard_Integer ) IntegerPart(alpha/(alpha*.02)); Dalpha = alpha/(nbp - 1); } @@ -641,8 +641,8 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese } } else{ - if(alpha > PI){ - alpha = (2*PI) - alpha; + if(alpha > M_PI){ + alpha = (2*M_PI) - alpha; nbp = (Standard_Integer ) IntegerPart(alpha/(alpha*.02)); Dalpha = -alpha/(nbp - 1); } diff --git a/src/DsgPrs/DsgPrs_XYZAxisPresentation.cxx b/src/DsgPrs/DsgPrs_XYZAxisPresentation.cxx index d517e36613..004c227698 100755 --- a/src/DsgPrs/DsgPrs_XYZAxisPresentation.cxx +++ b/src/DsgPrs/DsgPrs_XYZAxisPresentation.cxx @@ -43,7 +43,7 @@ void DsgPrs_XYZAxisPresentation::Add( G->SetPrimitivesAspect(aLineAspect->Aspect()); G->Polyline(A); - Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),aDir,PI/180.*10.,aVal/10.); + Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),aDir,M_PI/180.*10.,aVal/10.); Prs3d_Root::CurrentGroup(aPresentation)->Text(aText,A(2),1./81.); } @@ -79,7 +79,7 @@ void DsgPrs_XYZAxisPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta G->SetPrimitivesAspect(aLineAspect->Aspect()); G->Polyline(A); G->SetPrimitivesAspect( anArrowAspect->Aspect() ); - Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),aDir,PI/180.*10.,aVal/10.); + Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),aDir,M_PI/180.*10.,aVal/10.); G->SetPrimitivesAspect(aTextAspect->Aspect()); Prs3d_Root::CurrentGroup(aPresentation)->Text(aText,A(2),1./81.); #endif diff --git a/src/ElCLib/ElCLib.cxx b/src/ElCLib/ElCLib.cxx index e9d32f6d70..ffb8106827 100755 --- a/src/ElCLib/ElCLib.cxx +++ b/src/ElCLib/ElCLib.cxx @@ -10,7 +10,7 @@ #include #include -static Standard_Real PIPI = PI + PI; +static Standard_Real PIPI = M_PI + M_PI; //======================================================================= //function : InPeriod diff --git a/src/ElSLib/ElSLib.cxx b/src/ElSLib/ElSLib.cxx index 80bee3639e..c0d4290562 100755 --- a/src/ElSLib/ElSLib.cxx +++ b/src/ElSLib/ElSLib.cxx @@ -14,7 +14,7 @@ #include #include -static Standard_Real PIPI = PI + PI; +static Standard_Real PIPI = M_PI + M_PI; gp_Pnt ElSLib::PlaneValue (const Standard_Real U, const Standard_Real V, @@ -147,7 +147,7 @@ gp_Vec ElSLib::ConeDN (const Standard_Real U, { gp_XYZ Xdir = Pos.XDirection().XYZ(); gp_XYZ Ydir = Pos.YDirection().XYZ(); - Standard_Real Um = U + Nu * M_PI_2; // PI * 0.5 + Standard_Real Um = U + Nu * M_PI_2; // M_PI * 0.5 Xdir.Multiply(cos(Um)); Ydir.Multiply(sin(Um)); Xdir.Add(Ydir); @@ -1450,7 +1450,7 @@ void ElSLib::TorusParameters(const gp_Ax3& Pos, if (AD1 < 0) AD1 = - AD1; Standard_Real AD2 = D2; if (AD2 < 0) AD2 = - AD2; - if (AD2 < AD1) U += PI; + if (AD2 < AD1) U += M_PI; } if (U < -1.e-16) U += PIPI; else if (U < 0) U = 0; diff --git a/src/Extrema/Extrema_ExtCS.cxx b/src/Extrema/Extrema_ExtCS.cxx index cba4ff969e..7c17e03915 100755 --- a/src/Extrema/Extrema_ExtCS.cxx +++ b/src/Extrema/Extrema_ExtCS.cxx @@ -297,7 +297,7 @@ void Extrema_ExtCS::Perform(const Adaptor3d_Curve& C, PS.Parameter(U, V); if((myStype == GeomAbs_Sphere) || (myStype == GeomAbs_Cylinder)) { - U = ElCLib::InPeriod(U, myuinf, myuinf+2.*PI); + U = ElCLib::InPeriod(U, myuinf, myuinf+2.*M_PI); } if ((myuinf-U) <= mytolS && (U-myusup) <= mytolS && diff --git a/src/Extrema/Extrema_ExtElC.cxx b/src/Extrema/Extrema_ExtElC.cxx index 169dc72c6c..1e29282473 100755 --- a/src/Extrema/Extrema_ExtElC.cxx +++ b/src/Extrema/Extrema_ExtElC.cxx @@ -57,7 +57,7 @@ class ExtremaExtElC_TrigonometricRoots { Standard_Real PIpPI, aEps; // aEps=RealEpsilon(); - PIpPI=Standard_PI+Standard_PI; + PIpPI = M_PI + M_PI; for(Standard_Integer i=0 ; i -TolU)) Usol[0] = Uinf; - if (((Usol[1]-2*PI-Uinf) < TolU) && ((Usol[1]-2*PI-Uinf) > -TolU)) Usol[1] = Uinf; + ElCLib::AdjustPeriodic(Uinf, Uinf+2*M_PI, TolU, myuinf, Usol[0]); + ElCLib::AdjustPeriodic(Uinf, Uinf+2*M_PI, TolU, myuinf, Usol[1]); + if (((Usol[0]-2*M_PI-Uinf) < TolU) && ((Usol[0]-2*M_PI-Uinf) > -TolU)) Usol[0] = Uinf; + if (((Usol[1]-2*M_PI-Uinf) < TolU) && ((Usol[1]-2*M_PI-Uinf) > -TolU)) Usol[1] = Uinf; // 3- Calculate extrema in [Umin,Umax] ... diff --git a/src/Extrema/Extrema_ExtPElC2d.cxx b/src/Extrema/Extrema_ExtPElC2d.cxx index d735a28da4..abff2fb5b5 100755 --- a/src/Extrema/Extrema_ExtPElC2d.cxx +++ b/src/Extrema/Extrema_ExtPElC2d.cxx @@ -84,13 +84,13 @@ void Extrema_ExtPElC2d::Perform(const gp_Pnt2d& P, radius = C.Radius(); P1 = OC.Translated(radius*V); U1 = ElCLib::Parameter(C, P1); - U2 = U1 + PI; + U2 = U1 + M_PI; P2 = OC.Translated(-radius*V); Standard_Real myuinf = Uinf; - ElCLib::AdjustPeriodic(Uinf, Uinf+2*PI, Precision::PConfusion(), myuinf, U1); - ElCLib::AdjustPeriodic(Uinf, Uinf+2*PI, Precision::PConfusion(), myuinf, U2); - if (((U1-2*PI-Uinf) < Tol) && ((U1-2*PI-Uinf) > -Tol)) U1 = Uinf; - if (((U2-2*PI-Uinf) < Tol) && ((U2-2*PI-Uinf) > -Tol)) U2 = Uinf; + ElCLib::AdjustPeriodic(Uinf, Uinf+2*M_PI, Precision::PConfusion(), myuinf, U1); + ElCLib::AdjustPeriodic(Uinf, Uinf+2*M_PI, Precision::PConfusion(), myuinf, U2); + if (((U1-2*M_PI-Uinf) < Tol) && ((U1-2*M_PI-Uinf) > -Tol)) U1 = Uinf; + if (((U2-2*M_PI-Uinf) < Tol) && ((U2-2*M_PI-Uinf) > -Tol)) U2 = Uinf; if (((Uinf-U1) < Tol) && ((U1-Usup) < Tol)) { Extrema_POnCurv2d MyPOnCurve(U1, P1); diff --git a/src/Extrema/Extrema_ExtPElS.cxx b/src/Extrema/Extrema_ExtPElS.cxx index de973f37e0..49b48289fc 100755 --- a/src/Extrema/Extrema_ExtPElS.cxx +++ b/src/Extrema/Extrema_ExtPElS.cxx @@ -27,8 +27,8 @@ Method: There are infinite solutions; IsDone() = Standard_False. 2- distance(Pp,O) > Tol: let V = OP.OZ, - U1 = angle(OX,OPp) with 0 < U1 < 2.*PI - U2 = U1 + PI with 0 < U2 < 2.*PI; + U1 = angle(OX,OPp) with 0 < U1 < 2.*M_PI + U2 = U1 + M_PI with 0 < U2 < 2.*M_PI; then (U1,V) corresponds to the min distance. and (U2,V) corresponds to the max distance. -----------------------------------------------------------------------------*/ @@ -51,9 +51,9 @@ void Extrema_ExtPElS::Perform(const gp_Pnt& P, gp_Vec OPp (O,Pp); if (OPp.Magnitude() < Tol) { return; } gp_Vec myZ = Pos.XDirection()^Pos.YDirection(); - Standard_Real U1 = gp_Vec(Pos.XDirection()).AngleWithRef(OPp,myZ); //-PI Vm ) - -angle(OX,OPp) otherwise ) with 0. < U1 < 2*PI, - U2 = U1 + PI with 0. < U2 < 2*PI; + -angle(OX,OPp) otherwise ) with 0. < U1 < 2*M_PI, + U2 = U1 + M_PI with 0. < U2 < 2*M_PI; We are in plane PpOZ. Let A the angle of the cone, - B = angle(MP,MO) with 0. < B < PI, + B = angle(MP,MO) with 0. < B < M_PI, L = longueur(MP), V1 = (L * cos(B-A)) + Vm, V2 = (L * cos(B+A)) + Vm; @@ -150,17 +150,17 @@ void Extrema_ExtPElS::Perform(const gp_Pnt& P, if (OPp.SquareMagnitude() < Tol * Tol) return; Standard_Real B, U1, V1, U2, V2; Standard_Boolean Same = DirZ.Dot(MP) >= 0.0; - U1 = gp_Vec(Pos.XDirection()).AngleWithRef(OPp,myZ); //-PI 2.*PI) { U2 -= 2. * PI; } + if (!Same) { U1 += M_PI; } + U2 = U1 + M_PI; + if (U1 < 0.) { U1 += 2. * M_PI; } + if (U2 > 2.*M_PI) { U2 -= 2. * M_PI; } B = MP.Angle(DirZ); A = Abs(A); Standard_Real L = sqrt(L2); if (!Same) { - B = PI-B; + B = M_PI-B; V1 = -L*cos(B-A); V2 = -L*cos(B+A); } @@ -204,11 +204,11 @@ Method: Let Pp be the projection of point P in the plane XOY of the sphere; 2 cases are considered: 1- distance(Pp,O) < Tol: - 2 solutions are: (0,-PI/2.) and (0.,PI/2.) + 2 solutions are: (0,-M_PI/2.) and (0.,M_PI/2.) 2- distance(Pp,O) > Tol: - Let U1 = angle(OX,OPp) with 0. < U1 < 2.*PI, - U2 = U1 + PI avec 0. < U2 < 2*PI, - V1 = angle(OPp,OP) with -PI/2. < V1 < PI/2. , + Let U1 = angle(OX,OPp) with 0. < U1 < 2.*M_PI, + U2 = U1 + M_PI avec 0. < U2 < 2*M_PI, + V1 = angle(OPp,OP) with -M_PI/2. < V1 < M_PI/2. , then (U1, V1) corresponds to the min distance and (U2,-V1) corresponds to the max distance. -----------------------------------------------------------------------------*/ @@ -238,14 +238,14 @@ void Extrema_ExtPElS::Perform(const gp_Pnt& P, if (OPp.SquareMagnitude() < Tol * Tol) { U1 = 0.; U2 = 0.; - if (Zp < 0.) { V = -PI / 2.; } - else { V = PI / 2.; } + if (Zp < 0.) { V = -M_PI / 2.; } + else { V = M_PI / 2.; } } else { gp_Vec myZ = Pos.XDirection()^Pos.YDirection(); U1 = gp_Vec(Pos.XDirection()).AngleWithRef(OPp,myZ); - U2 = U1 + PI; - if (U1 < 0.) { U1 += 2. * PI; } + U2 = U1 + M_PI; + if (U1 < 0.) { U1 += 2. * M_PI; } V = OP.Angle(OPp); if (Zp < 0.) { V = -V; } } @@ -280,8 +280,8 @@ Function: There is an infinite number of solutions; IsDone() = Standard_False. 2- distance(Pp,O) > Tol: One is located in plane PpOZ; - Let V1 = angle(OX,OPp) with 0. < V1 < 2.*PI, - V2 = V1 + PI with 0. < V2 < 2.*PI, + Let V1 = angle(OX,OPp) with 0. < V1 < 2.*M_PI, + V2 = V1 + M_PI with 0. < V2 < 2.*M_PI, O1 and O2 centers of circles (O1 on coord. posit.) U1 = angle(OPp,O1P), U2 = angle(OPp,PO2); @@ -308,8 +308,8 @@ void Extrema_ExtPElS::Perform(const gp_Pnt& P, gp_Vec myZ = Pos.XDirection()^Pos.YDirection(); Standard_Real U1 = gp_Vec(Pos.XDirection()).AngleWithRef(OPp,myZ); - Standard_Real U2 = U1 + PI; - if (U1 < 0.) { U1 += 2. * PI; } + Standard_Real U2 = U1 + M_PI; + if (U1 < 0.) { U1 += 2. * M_PI; } Standard_Real R = sqrt(R2); gp_Vec OO1 = OPp.Divided(R).Multiplied(S.MajorRadius()); gp_Vec OO2 = OO1.Multiplied(-1.); @@ -321,25 +321,25 @@ void Extrema_ExtPElS::Perform(const gp_Pnt& P, Standard_Real V1 = OO1.AngleWithRef(gp_Vec(O1,P),OO1.Crossed(OZ)); Standard_Real V2 = OO2.AngleWithRef(gp_Vec(P,O2),OO2.Crossed(OZ)); - if (V1 < 0.) { V1 += 2. * PI; } - if (V2 < 0.) { V2 += 2. * PI; } + if (V1 < 0.) { V1 += 2. * M_PI; } + if (V2 < 0.) { V2 += 2. * M_PI; } gp_Pnt Ps; Ps = ElSLib::Value(U1,V1,S); mySqDist[0] = Ps.SquareDistance(P); myPoint[0] = Extrema_POnSurf(U1,V1,Ps); - Ps = ElSLib::Value(U1,V1+PI,S); + Ps = ElSLib::Value(U1,V1+M_PI,S); mySqDist[1] = Ps.SquareDistance(P); - myPoint[1] = Extrema_POnSurf(U1,V1+PI,Ps); + myPoint[1] = Extrema_POnSurf(U1,V1+M_PI,Ps); Ps = ElSLib::Value(U2,V2,S); mySqDist[2] = Ps.SquareDistance(P); myPoint[2] = Extrema_POnSurf(U2,V2,Ps); - Ps = ElSLib::Value(U2,V2+PI,S); + Ps = ElSLib::Value(U2,V2+M_PI,S); mySqDist[3] = Ps.SquareDistance(P); - myPoint[3] = Extrema_POnSurf(U2,V2+PI,Ps); + myPoint[3] = Extrema_POnSurf(U2,V2+M_PI,Ps); myNbExt = 4; myDone = Standard_True; diff --git a/src/Extrema/Extrema_ExtPExtS.cxx b/src/Extrema/Extrema_ExtPExtS.cxx index fa48fb2f65..dee406bd9d 100755 --- a/src/Extrema/Extrema_ExtPExtS.cxx +++ b/src/Extrema/Extrema_ExtPExtS.cxx @@ -247,7 +247,7 @@ void Extrema_ExtPExtS::Perform (const gp_Pnt& P) if (myC->IsPeriodic()) { Standard_Real U2 = U; - ElCLib::AdjustPeriodic(myuinf, myuinf + 2.*PI, Precision::PConfusion(), U, U2); + ElCLib::AdjustPeriodic(myuinf, myuinf + 2.*M_PI, Precision::PConfusion(), U, U2); } ////////////////////////////////////////////////// gp_Pnt E = POC.Value(); @@ -398,10 +398,10 @@ static void PerformExtPElC (Extrema_ExtPElC& E, E.Perform(P, C->Line(), Tol, -Precision::Infinite(),Precision::Infinite()); return; case GeomAbs_Circle: - E.Perform(P, C->Circle(), Tol, 0.0, 2.0 * PI); + E.Perform(P, C->Circle(), Tol, 0.0, 2.0 * M_PI); return; case GeomAbs_Ellipse: - E.Perform(P, C->Ellipse(), Tol, 0.0, 2.0 * PI); + E.Perform(P, C->Ellipse(), Tol, 0.0, 2.0 * M_PI); return; case GeomAbs_Parabola: E.Perform(P, C->Parabola(), Tol, -Precision::Infinite(),Precision::Infinite()); diff --git a/src/Extrema/Extrema_ExtPRevS.cxx b/src/Extrema/Extrema_ExtPRevS.cxx index 32ea418f05..bbda10dcfc 100755 --- a/src/Extrema/Extrema_ExtPRevS.cxx +++ b/src/Extrema/Extrema_ExtPRevS.cxx @@ -96,10 +96,10 @@ static void PerformExtPElC (Extrema_ExtPElC& E, E.Perform(P, C->Line(), Tol, -Precision::Infinite(),Precision::Infinite()); return; case GeomAbs_Circle: - E.Perform(P, C->Circle(), Tol, 0.0, 2.0 * PI); + E.Perform(P, C->Circle(), Tol, 0.0, 2.0 * M_PI); return; case GeomAbs_Ellipse: - E.Perform(P, C->Ellipse(), Tol, 0.0, 2.0 * PI); + E.Perform(P, C->Ellipse(), Tol, 0.0, 2.0 * M_PI); return; case GeomAbs_Parabola: E.Perform(P, C->Parabola(), Tol, -Precision::Infinite(),Precision::Infinite()); @@ -309,18 +309,18 @@ void Extrema_ExtPRevS::Perform(const gp_Pnt& P) else { Ppp = Pp.Translated(Z.Multiplied(-OPpz)); if (O.IsEqual(Ppp,Precision::Confusion())) - U = PI/2; + U = M_PI/2; else { U = gp_Vec(O,Ppp).AngleWithRef(gp_Vec(O,Pp),Dir); } } - gp_Vec OPpp (O,Ppp), OPq (O, myS->Value(PI/2,0)); - if (U != PI/2) { + gp_Vec OPpp (O,Ppp), OPq (O, myS->Value(M_PI/2,0)); + if (U != M_PI/2) { if (Abs(OPq.Magnitude()) <= gp::Resolution()) - OPq = gp_Vec(O, myS->Value(PI/2,anACurve->LastParameter()/10)); + OPq = gp_Vec(O, myS->Value(M_PI/2,anACurve->LastParameter()/10)); if (OPpp.AngleWithRef(OPq,Dir) < 0) - U += PI; + U += M_PI; } gp_Trsf T; @@ -346,7 +346,7 @@ void Extrema_ExtPRevS::Perform(const gp_Pnt& P) if((anACurve->GetType() == GeomAbs_Circle) || (anACurve->GetType() == GeomAbs_Ellipse)) { - newV = ElCLib::InPeriod(V, myvinf, myvinf + 2. * PI); + newV = ElCLib::InPeriod(V, myvinf, myvinf + 2. * M_PI); if (newV > myvsup) { newV = myvsup; @@ -366,7 +366,7 @@ void Extrema_ExtPRevS::Perform(const gp_Pnt& P) if((anACurve->GetType() == GeomAbs_Circle) || (anACurve->GetType() == GeomAbs_Ellipse)) { - newV = ElCLib::InPeriod(V, myvsup - 2. * PI, myvsup); + newV = ElCLib::InPeriod(V, myvsup - 2. * M_PI, myvsup); if(newV < myvinf) newV = myvinf; @@ -385,14 +385,14 @@ void Extrema_ExtPRevS::Perform(const gp_Pnt& P) } } } - T.SetRotation(Ax, PI); + T.SetRotation(Ax, M_PI); P1.Transform(T); PerformExtPElC(anExt, P1, anACurve, mytolv); if (anExt.IsDone()) { myDone = Standard_True; - U += PI; + U += M_PI; for (i=1; i<=anExt.NbExt(); i++) { Extrema_POnCurv POC=anExt.Point(i); @@ -405,7 +405,7 @@ void Extrema_ExtPRevS::Perform(const gp_Pnt& P) if((anACurve->GetType() == GeomAbs_Circle) || (anACurve->GetType() == GeomAbs_Ellipse)) { - newV = ElCLib::InPeriod(V, myvinf, myvinf + 2. * PI); + newV = ElCLib::InPeriod(V, myvinf, myvinf + 2. * M_PI); if (newV > myvsup) { newV = myvsup; @@ -422,7 +422,7 @@ void Extrema_ExtPRevS::Perform(const gp_Pnt& P) if((anACurve->GetType() == GeomAbs_Circle) || (anACurve->GetType() == GeomAbs_Ellipse)) { - newV = ElCLib::InPeriod(V, myvsup - 2. * PI, myvsup); + newV = ElCLib::InPeriod(V, myvsup - 2. * M_PI, myvsup); if(newV < myvinf) newV = myvinf; diff --git a/src/Extrema/Extrema_ExtPSOfRev.gxx b/src/Extrema/Extrema_ExtPSOfRev.gxx index 647708a70e..97fa098317 100755 --- a/src/Extrema/Extrema_ExtPSOfRev.gxx +++ b/src/Extrema/Extrema_ExtPSOfRev.gxx @@ -17,8 +17,8 @@ Methode: 1- distance(Pp,O) < Tol: Il existe 0 ou une infinite de solutions; IsDone() = Standard_False; 2- distance(Pp,O) > Tol: - Soit U1 = angle(OX,OPp) avec 0. < U1 < 2.*PI, - U2 = U1 + PI avec 0. < U2 < 2.*PI, + Soit U1 = angle(OX,OPp) avec 0. < U1 < 2.*M_PI, + U2 = U1 + M_PI avec 0. < U2 < 2.*M_PI, M1 le meridien S(U1), M2 le meridien S(U2); On recherche les distances minimales entre P et M1 et les distances @@ -38,8 +38,8 @@ Methode: if (OPp.Magnitude() < Tol) { return; } Standard_Real U1 = gp_Vec(Pos.XDirection()).AngleWithRef(OPp,OZ); - Standard_Real U2 = U1 + PI; - if (U1 < 0.) { U1 += 2. * PI; } + Standard_Real U2 = U1 + M_PI; + if (U1 < 0.) { U1 += 2. * M_PI; } Curve M1 = Tool::Meridian(S, U1); Curve M2 = Tool::Meridian(S, U2); TheExtPC ExtPM1 (P,M1,NbV,TolV,Tol); diff --git a/src/Extrema/Extrema_GExtCC2d.gxx b/src/Extrema/Extrema_GExtCC2d.gxx index 9e77906a18..01397e47d8 100755 --- a/src/Extrema/Extrema_GExtCC2d.gxx +++ b/src/Extrema/Extrema_GExtCC2d.gxx @@ -99,22 +99,22 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1, switch(type2) { case GeomAbs_Circle: { Extrema_ExtElC2d Xtrem(Tool1::Circle(C1), Tool2::Circle(*((Curve2*)myC))); - Results(Xtrem, U11, U12, U21, U22, 2*PI, 2*PI); + Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 2*M_PI); } break; case GeomAbs_Ellipse: { Extrema_ExtElC2d Xtrem(Tool1::Circle(C1), Tool2::Ellipse(*((Curve2*)myC))); - Results(Xtrem, U11, U12, U21, U22, 2*PI, 2*PI ); + Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 2*M_PI ); } break; case GeomAbs_Parabola: { Extrema_ExtElC2d Xtrem(Tool1::Circle(C1), Tool2::Parabola(*((Curve2*)myC))); - Results(Xtrem, U11, U12, U21, U22, 2*PI, 0.); + Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 0.); } break; case GeomAbs_Hyperbola: { Extrema_ExtElC2d Xtrem(Tool1::Circle(C1), Tool2::Hyperbola(*((Curve2*)myC))); - Results(Xtrem, U11, U12, U21, U22, 2*PI, 0. ); + Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 0. ); } break; case GeomAbs_BezierCurve: @@ -124,13 +124,13 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1, NbU, NbV, mytolc1, mytolc2); Standard_Real Period2 = 0.; if (Tool2::IsPeriodic(*((Curve2*)myC))) Period2 = Tool2::Period(*((Curve2*)myC)); - Results(Xtrem, C1, U11, U12, U21, U22, 2*PI,Period2); + Results(Xtrem, C1, U11, U12, U21, U22, 2*M_PI,Period2); } break; case GeomAbs_Line: { inverse = Standard_True; Extrema_ExtElC2d Xtrem(Tool2::Line(*((Curve2*)myC)), Tool1::Circle(C1), Tol); - Results(Xtrem, U11, U12, U21, U22, 2*PI, 0.); + Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 0.); } break; }; // switch(type2) @@ -146,28 +146,28 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1, case GeomAbs_Circle: { inverse = Standard_True; Extrema_ExtElC2d Xtrem(Tool2::Circle(*((Curve2*)myC)), Tool1::Ellipse(C1)); - Results(Xtrem, U11, U12, U21, U22, 2*PI, 2*PI); + Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 2*M_PI); } break; case GeomAbs_Ellipse: { //Extrema_ExtElC2d Xtrem(Tool1::Ellipse(C1), Tool2::Ellipse(*((Curve2*)myC))); Extrema_ECC2d Xtrem(C1, *((Curve2*)myC), NbU, NbV, mytolc1, mytolc2); - Results(Xtrem, C1, U11, U12, U21, U22,2*PI, 2*PI); + Results(Xtrem, C1, U11, U12, U21, U22,2*M_PI, 2*M_PI); } break; case GeomAbs_Parabola: { //Extrema_ExtElC2d Xtrem(Tool1::Ellipse(C1), Tool2::Parabola(*((Curve2*)myC))); Extrema_ECC2d Xtrem(C1, *((Curve2*)myC), NbU, NbV, mytolc1, mytolc2); - Results(Xtrem, C1, U11, U12, U21, U22, 2*PI, 0.); + Results(Xtrem, C1, U11, U12, U21, U22, 2*M_PI, 0.); } break; case GeomAbs_Hyperbola: { //Extrema_ExtElC2d Xtrem(Tool1::Ellipse(C1), Tool2::Hyperbola(*((Curve2*)myC))); Extrema_ECC2d Xtrem(C1, *((Curve2*)myC), NbU, NbV, mytolc1, mytolc2); - Results(Xtrem, C1, U11, U12, U21, U22, 2*PI, 0.); + Results(Xtrem, C1, U11, U12, U21, U22, 2*M_PI, 0.); } break; case GeomAbs_BezierCurve: @@ -177,13 +177,13 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1, NbU, NbV, mytolc1, mytolc2); Standard_Real Period2 = 0.; if (Tool2::IsPeriodic(*((Curve2*)myC))) Period2 = Tool2::Period(*((Curve2*)myC)); - Results(Xtrem, C1, U11, U12, U21, U22, 2*PI,Period2); + Results(Xtrem, C1, U11, U12, U21, U22, 2*M_PI,Period2); } break; case GeomAbs_Line: { inverse = Standard_True; Extrema_ExtElC2d Xtrem(Tool2::Line(*((Curve2*)myC)), Tool1::Ellipse(C1)); - Results(Xtrem, U11, U12, U21, U22, 2*PI, 0.); + Results(Xtrem, U11, U12, U21, U22, 2*M_PI, 0.); } break; }; // switch(type2) @@ -199,7 +199,7 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1, case GeomAbs_Circle: { inverse = Standard_True; Extrema_ExtElC2d Xtrem(Tool2::Circle(*((Curve2*)myC)), Tool1::Parabola(C1)); - Results(Xtrem, U11, U12, U21, U22, 0., 2*PI); + Results(Xtrem, U11, U12, U21, U22, 0., 2*M_PI); } break; case GeomAbs_Ellipse: { @@ -207,7 +207,7 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1, //Extrema_ExtElC2d Xtrem(Tool2::Ellipse(*((Curve2*)myC)), Tool1::Parabola(C1)); Extrema_ECC2d Xtrem(C1, *((Curve2*)myC), NbU, NbV, mytolc1, mytolc2); - Results(Xtrem, C1, U11, U12, U21, U22, 0., 2*PI); + Results(Xtrem, C1, U11, U12, U21, U22, 0., 2*M_PI); } break; case GeomAbs_Parabola: { @@ -254,7 +254,7 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1, case GeomAbs_Circle: { inverse = Standard_True; Extrema_ExtElC2d Xtrem(Tool2::Circle(*((Curve2*)myC)), Tool1::Hyperbola(C1)); - Results(Xtrem, U11, U12, U21, U22, 0., 2*PI); + Results(Xtrem, U11, U12, U21, U22, 0., 2*M_PI); } break; case GeomAbs_Ellipse: { @@ -262,7 +262,7 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1, //Extrema_ExtElC2d Xtrem(Tool2::Ellipse(*((Curve2*)myC)), Tool1::Hyperbola(C1)); Extrema_ECC2d Xtrem(C1, *((Curve2*)myC), NbU, NbV, mytolc1, mytolc2); - Results(Xtrem, C1, U11, U12, U21, U22, 0., 2*PI ); + Results(Xtrem, C1, U11, U12, U21, U22, 0., 2*M_PI ); } break; case GeomAbs_Parabola: { @@ -323,12 +323,12 @@ void Extrema_GExtCC2d::Perform (const Curve1& C1, switch(type2) { case GeomAbs_Circle: { Extrema_ExtElC2d Xtrem(Tool1::Line(C1), Tool2::Circle(*((Curve2*)myC)), Tol); - Results(Xtrem, U11, U12, U21, U22, 0., 2*PI); + Results(Xtrem, U11, U12, U21, U22, 0., 2*M_PI); } break; case GeomAbs_Ellipse: { Extrema_ExtElC2d Xtrem(Tool1::Line(C1), Tool2::Ellipse(*((Curve2*)myC))); - Results(Xtrem, U11, U12, U21, U22, 0., 2*PI); + Results(Xtrem, U11, U12, U21, U22, 0., 2*M_PI); } break; case GeomAbs_Parabola: { diff --git a/src/FairCurve/FairCurve_Batten.cxx b/src/FairCurve/FairCurve_Batten.cxx index 3b9ce1acdd..47e121bfbc 100755 --- a/src/FairCurve/FairCurve_Batten.cxx +++ b/src/FairCurve/FairCurve_Batten.cxx @@ -145,7 +145,7 @@ Standard_Boolean FairCurve_Batten::Compute(FairCurve_AnalysisCode& ACode, { Standard_Boolean Ok=Standard_True, End=Standard_False; Standard_Real AngleMax = 0.7; // parameter ruling the function of increment ( 40 degrees ) - Standard_Real AngleMin = 2*PI/100; // parameter ruling the function of increment + Standard_Real AngleMin = 2*M_PI/100; // parameter ruling the function of increment // full passage should not cost more than 100 steps. Standard_Real DAngle1, DAngle2, Ratio, Fraction, Toler; Standard_Real OldDist, NewDist; @@ -451,10 +451,10 @@ Standard_Real FairCurve_Batten::SlidingOfReference(const Standard_Real Dist, // case of angle without constraints if ( (NewConstraintOrder1 == 0) && (NewConstraintOrder2 == 0)) return Dist; - if (NewConstraintOrder1 == 0) a1 = Abs( Abs(NewAngle2) PI/2) AngleMilieu = PI/2; + if (AngleMilieu > M_PI/2) AngleMilieu = M_PI/2; return Ratio * Compute(Dist, a1, AngleMilieu ) + (1-Ratio) * Compute(Dist, a2, AngleMilieu ); @@ -496,8 +496,8 @@ Standard_Real FairCurve_Batten::Compute(const Standard_Real Dist, // ================================================================== { if (Angle < Precision::Angular() ) { return Dist; } // length of segment P1P2 - if (Angle < PI/2) { return Angle*Dist / sin(Angle); } // length of circle P1P2 respecting ANGLE - if (Angle > PI) { return Sqrt(Angle*PI) * Dist;} + if (Angle < M_PI/2) { return Angle*Dist / sin(Angle); } // length of circle P1P2 respecting ANGLE + if (Angle > M_PI) { return Sqrt(Angle*M_PI) * Dist;} else { return Angle * Dist; } // linear interpolation } diff --git a/src/FairCurve/FairCurve_MinimalVariation.cxx b/src/FairCurve/FairCurve_MinimalVariation.cxx index 3452ece64a..25a5a95f43 100755 --- a/src/FairCurve/FairCurve_MinimalVariation.cxx +++ b/src/FairCurve/FairCurve_MinimalVariation.cxx @@ -45,7 +45,7 @@ Standard_Boolean FairCurve_MinimalVariation::Compute(FairCurve_AnalysisCode& ACo { Standard_Boolean Ok=Standard_True, End=Standard_False; Standard_Real AngleMax = 0.7; // parameter regulating the function of increment ( 40 degrees ) - Standard_Real AngleMin = 2*PI/100; // parameter regulating the function of increment + Standard_Real AngleMin = 2*M_PI/100; // parameter regulating the function of increment // full passage should not contain more than 100 steps. Standard_Real DAngle1, DAngle2, DRho1, DRho2, Ratio, Fraction, Toler; Standard_Real OldDist, NewDist; @@ -182,7 +182,7 @@ Standard_Boolean FairCurve_MinimalVariation::Compute(const gp_Vec2d& DeltaP1, / pow (Knots->Value(Knots->Lower()+1)-Knots->Value(Knots->Lower()), 2); Standard_Real CPrim = OldDerive.Magnitude(); ADelta(kk) = ( OldSeconde.Rotated(DAngle1) - OldSeconde - + DeltaCurvature1*CPrim*OldDerive.Rotated(PI/2+DAngle1) ).XY(); + + DeltaCurvature1*CPrim*OldDerive.Rotated(M_PI/2+DAngle1) ).XY(); kk += 1; } } @@ -202,7 +202,7 @@ Standard_Boolean FairCurve_MinimalVariation::Compute(const gp_Vec2d& DeltaP1, / pow (Knots->Value(Knots->Upper())-Knots->Value(Knots->Upper()-1), 2); Standard_Real CPrim = OldDerive.Magnitude(); ADelta(kk) = ( OldSeconde.Rotated(DAngle2) - OldSeconde - + DeltaCurvature2*CPrim*OldDerive.Rotated(PI/2+DAngle2) ).XY(); + + DeltaCurvature2*CPrim*OldDerive.Rotated(M_PI/2+DAngle2) ).XY(); kk += 1; } } diff --git a/src/GC/GC_MakeConicalSurface.cxx b/src/GC/GC_MakeConicalSurface.cxx index a4efe588a1..4a5a6cdd54 100755 --- a/src/GC/GC_MakeConicalSurface.cxx +++ b/src/GC/GC_MakeConicalSurface.cxx @@ -14,7 +14,7 @@ GC_MakeConicalSurface::GC_MakeConicalSurface(const gp_Ax2& A2 , const Standard_Real Radius) { if (Radius < 0.) { TheError = gce_NegativeRadius; } - else if (Ang <= gp::Resolution() || Ang >= PI/2. - gp::Resolution()) { + else if (Ang <= gp::Resolution() || Ang >= M_PI/2. - gp::Resolution()) { TheError = gce_BadAngle; } else { diff --git a/src/GC/GC_MakeTrimmedCone.cxx b/src/GC/GC_MakeTrimmedCone.cxx index a1597f0f14..e85ed9265e 100755 --- a/src/GC/GC_MakeTrimmedCone.cxx +++ b/src/GC/GC_MakeTrimmedCone.cxx @@ -34,7 +34,7 @@ GC_MakeTrimmedCone::GC_MakeTrimmedCone(const gp_Pnt& P1 , gp_Pnt P5 = ext1.Point(1).Value(); gp_Pnt P6 = ext2.Point(1).Value(); Standard_Real D = P6.Distance(P5)/cos((Cone.Value())->SemiAngle()); - TheCone=new Geom_RectangularTrimmedSurface(Cone.Value(),0.,2.*PI,0.,D,Standard_True,Standard_True); + TheCone=new Geom_RectangularTrimmedSurface(Cone.Value(),0.,2.*M_PI,0.,D,Standard_True,Standard_True); } } @@ -50,7 +50,7 @@ GC_MakeTrimmedCone::GC_MakeTrimmedCone(const gp_Pnt& P1 , TheError = Cone.Status(); if (TheError == gce_Done) { Standard_Real D = (P2.Distance(P1))/cos((Cone.Value())->SemiAngle()); - TheCone=new Geom_RectangularTrimmedSurface(Cone.Value(),0.,2.*PI,0.,D,Standard_True,Standard_True); + TheCone=new Geom_RectangularTrimmedSurface(Cone.Value(),0.,2.*M_PI,0.,D,Standard_True,Standard_True); } } diff --git a/src/GC/GC_MakeTrimmedCylinder.cxx b/src/GC/GC_MakeTrimmedCylinder.cxx index a28933e5ae..e51a32ca03 100755 --- a/src/GC/GC_MakeTrimmedCylinder.cxx +++ b/src/GC/GC_MakeTrimmedCylinder.cxx @@ -21,7 +21,7 @@ GC_MakeTrimmedCylinder::GC_MakeTrimmedCylinder(const gp_Pnt& P1 , GC_MakeCylindricalSurface Cyl(P1,P2,P3); TheError = Cyl.Status(); if (TheError == gce_Done) { - TheCyl = new Geom_RectangularTrimmedSurface(Cyl.Value(),0.,2.*PI,0., + TheCyl = new Geom_RectangularTrimmedSurface(Cyl.Value(),0.,2.*M_PI,0., P2.Distance(P1),Standard_True,Standard_True); } } @@ -35,7 +35,7 @@ GC_MakeTrimmedCylinder::GC_MakeTrimmedCylinder(const gp_Circ& Circ , GC_MakeCylindricalSurface Cyl(Circ); TheError = Cyl.Status(); if (TheError == gce_Done) { - TheCyl = new Geom_RectangularTrimmedSurface(Cyl.Value(),0.,2.*PI,0., + TheCyl = new Geom_RectangularTrimmedSurface(Cyl.Value(),0.,2.*M_PI,0., Height,Standard_True,Standard_True); } } @@ -49,7 +49,7 @@ GC_MakeTrimmedCylinder::GC_MakeTrimmedCylinder(const gp_Ax1& A1 , GC_MakeCylindricalSurface Cyl(A1,Radius); TheError = Cyl.Status(); if (TheError == gce_Done) { - TheCyl = new Geom_RectangularTrimmedSurface(Cyl.Value(),0.,2.*PI,0., + TheCyl = new Geom_RectangularTrimmedSurface(Cyl.Value(),0.,2.*M_PI,0., Height,Standard_True,Standard_True); } } diff --git a/src/GProp/GProp_CelGProps.cxx b/src/GProp/GProp_CelGProps.cxx index dcedbf8be7..52768c4750 100755 --- a/src/GProp/GProp_CelGProps.cxx +++ b/src/GProp/GProp_CelGProps.cxx @@ -120,7 +120,7 @@ void GProp_CelGProps::Perform(const gp_Lin& C, GProp_CelGProps::GProp_CelGProps (const gp_Circ& C, const gp_Pnt& CLocation) { SetLocation(CLocation); - Perform(C,0.,2.*PI); + Perform(C,0.,2.*M_PI); } GProp_CelGProps::GProp_CelGProps (const gp_Circ& C, diff --git a/src/GccGeo/GccGeo_Circ2d2TanOn.gxx b/src/GccGeo/GccGeo_Circ2d2TanOn.gxx index 4fe7b908b0..70a7f9293b 100755 --- a/src/GccGeo/GccGeo_Circ2d2TanOn.gxx +++ b/src/GccGeo/GccGeo_Circ2d2TanOn.gxx @@ -100,8 +100,8 @@ GccGeo_Circ2d2TanOn:: { gp_Circ2d Circ(Sol->Circle()); IntRes2d_Domain D1(ElCLib::Value(0.,Circ), 0.,Tol1, - ElCLib::Value(2.*PI,Circ),2.*PI,Tol2); - D1.SetEquivalentParameters(0.,2.*PI); + ElCLib::Value(2.*M_PI,Circ),2.*M_PI,Tol2); + D1.SetEquivalentParameters(0.,2.*M_PI); Intp.Perform(Circ,D1,Cu2,D2,Tol1,Tol2); } break; @@ -109,8 +109,8 @@ GccGeo_Circ2d2TanOn:: { gp_Elips2d Elips(Sol->Ellipse()); IntRes2d_Domain D1(ElCLib::Value(0.,Elips), 0.,Tol1, - ElCLib::Value(2.*PI,Elips),2.*PI,Tol2); - D1.SetEquivalentParameters(0.,2.*PI); + ElCLib::Value(2.*M_PI,Elips),2.*M_PI,Tol2); + D1.SetEquivalentParameters(0.,2.*M_PI); Intp.Perform(Elips,D1,Cu2,D2,Tol1,Tol2); } break; @@ -657,8 +657,8 @@ GccGeo_Circ2d2TanOn:: { gp_Circ2d Circ(Sol->Circle()); IntRes2d_Domain D1(ElCLib::Value(0.,Circ), 0.,Tol1, - ElCLib::Value(2.*PI,Circ),2.*PI,Tol2); - D1.SetEquivalentParameters(0.,2.*PI); + ElCLib::Value(2.*M_PI,Circ),2.*M_PI,Tol2); + D1.SetEquivalentParameters(0.,2.*M_PI); Intp.Perform(Circ,D1,C2,D2,Tol1,Tol2); } break; @@ -673,8 +673,8 @@ GccGeo_Circ2d2TanOn:: { gp_Elips2d Elips(Sol->Ellipse()); IntRes2d_Domain D1(ElCLib::Value(0.,Elips), 0.,Tol1, - ElCLib::Value(2.*PI,Elips),2.*PI,Tol2); - D1.SetEquivalentParameters(0.,2.*PI); + ElCLib::Value(2.*M_PI,Elips),2.*M_PI,Tol2); + D1.SetEquivalentParameters(0.,2.*M_PI); Intp.Perform(Elips,D1,C2,D2,Tol1,Tol2); } break; diff --git a/src/GccGeo/GccGeo_Circ2d2TanRad.gxx b/src/GccGeo/GccGeo_Circ2d2TanRad.gxx index 74eb5f691a..f2e6b90642 100755 --- a/src/GccGeo/GccGeo_Circ2d2TanRad.gxx +++ b/src/GccGeo/GccGeo_Circ2d2TanRad.gxx @@ -339,8 +339,8 @@ GccGeo_Circ2d2TanRad:: for (Standard_Integer jcote1 = 1 ; jcote1 <= nbrcote1 ; jcote1++) { gp_Circ2d Circ(C1.XAxis(),R1+cote1(jcote1)); IntRes2d_Domain D1(ElCLib::Value(0.,Circ), 0.,Tol, - ElCLib::Value(2.*PI,Circ),2.*PI,Tol); - D1.SetEquivalentParameters(0.,2.*PI); + ElCLib::Value(2.*M_PI,Circ),2.*M_PI,Tol); + D1.SetEquivalentParameters(0.,2.*M_PI); for (Standard_Integer jcote2 = 1 ; jcote2 <= nbrcote2 ; jcote2++) { Handle(TheHParGenCurve) HCu2 = new TheHParGenCurve(Cu2); TheParGenCurve C2(HCu2,cote2(jcote2)); @@ -470,8 +470,8 @@ GccGeo_Circ2d2TanRad:: } gp_Circ2d Circ(gp_Ax2d(Point2,gp_Dir2d(1.,0.)),Radius); IntRes2d_Domain D1(ElCLib::Value(0.,Circ), 0.,Tol, - ElCLib::Value(PI+PI,Circ),PI+PI,Tol); - D1.SetEquivalentParameters(0.,PI+PI); + ElCLib::Value(M_PI+M_PI,Circ),M_PI+M_PI,Tol); + D1.SetEquivalentParameters(0.,M_PI+M_PI); TheIntConicCurve Intp; for (Standard_Integer jcote1 = 1 ; jcote1 <= nbrcote1 ; jcote1++) { Handle(TheHParGenCurve) HCu1 = new TheHParGenCurve(Cu1); diff --git a/src/GccGeo/GccGeo_Circ2dTanOnRad.gxx b/src/GccGeo/GccGeo_Circ2dTanOnRad.gxx index fc3b7a77d1..a37b959828 100755 --- a/src/GccGeo/GccGeo_Circ2dTanOnRad.gxx +++ b/src/GccGeo/GccGeo_Circ2dTanOnRad.gxx @@ -208,8 +208,8 @@ GccGeo_Circ2dTanOnRad:: cote1(2) = -Radius; } IntRes2d_Domain D1(ElCLib::Value(0.,OnCirc), 0.,Tol, - ElCLib::Value(2.*PI,OnCirc),2.*PI,Tol); - D1.SetEquivalentParameters(0.,2.*PI); + ElCLib::Value(2.*M_PI,OnCirc),2.*M_PI,Tol); + D1.SetEquivalentParameters(0.,2.*M_PI); TheIntConicCurve Intp; for (Standard_Integer jcote1 = 1 ; jcote1 <= nbrcote1 ; jcote1++) { Handle(TheHParGenCurve) HCu1 = new TheHParGenCurve(Cu1); @@ -326,8 +326,8 @@ GccGeo_Circ2dTanOnRad:: for (Standard_Integer jcote1 = 1 ; jcote1 <= nbrcote1 ; jcote1++) { gp_Circ2d Circ(C1.XAxis(),R1 + cote1(jcote1)); IntRes2d_Domain D1(ElCLib::Value(0.,Circ), 0.,Tol, - ElCLib::Value(2.*PI,Circ),2.*PI,Tol); - D1.SetEquivalentParameters(0.,2.*PI); + ElCLib::Value(2.*M_PI,Circ),2.*M_PI,Tol); + D1.SetEquivalentParameters(0.,2.*M_PI); firstparam = Max(TheTool::FirstParameter(OnCurv),thefirst); lastparam = Min(TheTool::LastParameter(OnCurv),thelast); IntRes2d_Domain D2(TheTool::Value(OnCurv,firstparam),firstparam,Tol, @@ -672,8 +672,8 @@ GccGeo_Circ2dTanOnRad:: // gp_Dir2d Dir(-y1dir,x1dir); gp_Circ2d Circ(gp_Ax2d(Point1,gp_Dir2d(1.,0.)),Radius); IntRes2d_Domain D1(ElCLib::Value(0.,Circ), 0.,Tol, - ElCLib::Value(2.*PI,Circ),2*PI,Tol); - D1.SetEquivalentParameters(0.,2.*PI); + ElCLib::Value(2.*M_PI,Circ),2*M_PI,Tol); + D1.SetEquivalentParameters(0.,2.*M_PI); firstparam = Max(TheTool::FirstParameter(OnCurv),thefirst); lastparam = Min(TheTool::LastParameter(OnCurv),thelast); IntRes2d_Domain D2(TheTool::Value(OnCurv,firstparam),firstparam,Tol, diff --git a/src/GccIter/GccIter_Circ2d2TanOn.gxx b/src/GccIter/GccIter_Circ2d2TanOn.gxx index 3d49d1f678..1ce82f9c5c 100755 --- a/src/GccIter/GccIter_Circ2d2TanOn.gxx +++ b/src/GccIter/GccIter_Circ2d2TanOn.gxx @@ -374,7 +374,7 @@ GccIter_Circ2d2TanOn:: Ufirst(1) = Param1; Ufirst(2) = Param2; Ufirst(3) = Param3; - tol(1) = 2.e-15*PI; + tol(1) = 2.e-15*M_PI; tol(2) = TheCurveTool::EpsX(Cu2,Abs(Tolerance)); tol(3) = 1.e-15; tol(4) = Tol/10.; @@ -491,9 +491,9 @@ GccIter_Circ2d2TanOn:: Ufirst(1) = Param1; Ufirst(2) = Param2; Ufirst(3) = Param3; - tol(1) = 2.e-15*PI; + tol(1) = 2.e-15*M_PI; tol(2) = TheCurveTool::EpsX(Cu2,Abs(Tolerance)); - tol(3) = 2.e-15*PI; + tol(3) = 2.e-15*M_PI; tol(4) = Tol/10.; gp_Pnt2d point1 = ElCLib::Value(Param1,C1); gp_Pnt2d point2 = TheCurveTool::Value(Cu2,Param2); @@ -607,7 +607,7 @@ GccIter_Circ2d2TanOn:: Ufirst(3) = Param3; tol(1) = 1.e-15; tol(2) = TheCurveTool::EpsX(Cu2,Abs(Tolerance)); - tol(3) = 2.e-15*PI; + tol(3) = 2.e-15*M_PI; tol(4) = Tol/10.; gp_Pnt2d point1 = ElCLib::Value(Param1,L1); gp_Pnt2d point2 = TheCurveTool::Value(Cu2,Param2); @@ -720,7 +720,7 @@ GccIter_Circ2d2TanOn:: Ufirst(3) = Param3; tol(1) = TheCurveTool::EpsX(Cu1,Abs(Tolerance)); tol(2) = TheCurveTool::EpsX(Cu2,Abs(Tolerance)); - tol(3) = 2.e-15*PI; + tol(3) = 2.e-15*M_PI; tol(4) = Tol/10.; gp_Pnt2d point1 = TheCurveTool::Value(Cu1,Param1); gp_Pnt2d point2 = TheCurveTool::Value(Cu2,Param2); @@ -826,7 +826,7 @@ GccIter_Circ2d2TanOn:: Ufirst(1) = Param1; Ufirst(2) = Param2; tol(1) = TheCurveTool::EpsX(Cu1,Abs(Tolerance)); - tol(2) = 2.e-15*PI; + tol(2) = 2.e-15*M_PI; tol(3) = Tol/10.; gp_Pnt2d point1 = TheCurveTool::Value(Cu1,Param1); gp_Pnt2d point3 = ElCLib::Value(Param2,OnCirc); @@ -1029,7 +1029,7 @@ GccIter_Circ2d2TanOn:: Ufirst(1) = Param1; Ufirst(2) = Param2; Ufirst(3) = ParamOn; - tol(1) = 2.e-15*PI; + tol(1) = 2.e-15*M_PI; tol(2) = TheCurveTool::EpsX(Cu2,Abs(Tolerance)); tol(3) = TheCurveTool::EpsX(OnCurv,Abs(Tolerance)); tol(4) = Tol/10.;; diff --git a/src/GccIter/GccIter_Circ2d3Tan.gxx b/src/GccIter/GccIter_Circ2d3Tan.gxx index 051ff7cb2c..54c3fbce19 100755 --- a/src/GccIter/GccIter_Circ2d3Tan.gxx +++ b/src/GccIter/GccIter_Circ2d3Tan.gxx @@ -191,13 +191,13 @@ GccIter_Circ2d3Tan:: Umin(1) = 0.; Umin(2) = TheCurveTool::FirstParameter(Cu2); Umin(3) = TheCurveTool::FirstParameter(Cu3); - Umax(1) = 2*PI; + Umax(1) = 2*M_PI; Umax(2) = TheCurveTool::LastParameter(Cu2); Umax(3) = TheCurveTool::LastParameter(Cu3); Ufirst(1) = Param1; Ufirst(2) = Param2; Ufirst(3) = Param3; - tol(1) = 2.e-15*PI; + tol(1) = 2.e-15*M_PI; tol(2) = TheCurveTool::EpsX(Cu2,Abs(Tolerance)); tol(3) = TheCurveTool::EpsX(Cu3,Abs(Tolerance)); math_FunctionSetRoot Root(Func,Ufirst,tol,Umin,Umax); @@ -323,14 +323,14 @@ GccIter_Circ2d3Tan:: Umin(1) = 0.; Umin(2) = 0.; Umin(3) = TheCurveTool::FirstParameter(Cu3); - Umax(1) = 2*PI; - Umax(2) = 2*PI; + Umax(1) = 2*M_PI; + Umax(2) = 2*M_PI; Umax(3) = TheCurveTool::LastParameter(Cu3); Ufirst(1) = Param1; Ufirst(2) = Param2; Ufirst(3) = Param3; - tol(1) = 2.e-15*PI; - tol(2) = 2.e-15*PI; + tol(1) = 2.e-15*M_PI; + tol(2) = 2.e-15*M_PI; tol(3) = TheCurveTool::EpsX(Cu3,Abs(Tolerance)); math_FunctionSetRoot Root(Func,Ufirst,tol,Umin,Umax); if (Root.IsDone()) { @@ -721,13 +721,13 @@ GccIter_Circ2d3Tan:: Umin(1) = 0.; Umin(2) = TheCurveTool::FirstParameter(Cu1); Umin(3) = TheCurveTool::FirstParameter(Cu2); - Umax(1) = 2*PI; + Umax(1) = 2*M_PI; Umax(2) = TheCurveTool::LastParameter(Cu1); Umax(3) = TheCurveTool::LastParameter(Cu2); - Ufirst(1) = PI; + Ufirst(1) = M_PI; Ufirst(2) = Param1; Ufirst(3) = Param2; - tol(1) = 2.e-15*PI; + tol(1) = 2.e-15*M_PI; tol(2) = TheCurveTool::EpsX(Cu1,Abs(Tolerance)); tol(3) = TheCurveTool::EpsX(Cu2,Abs(Tolerance)); math_FunctionSetRoot Root(Func,Ufirst,tol,Umin,Umax); @@ -838,14 +838,14 @@ GccIter_Circ2d3Tan:: Umin(1) = 0.; Umin(2) = 0.; Umin(3) = TheCurveTool::FirstParameter(Cu1); - Umax(1) = 2*PI; - Umax(2) = 2*PI; + Umax(1) = 2*M_PI; + Umax(2) = 2*M_PI; Umax(3) = TheCurveTool::LastParameter(Cu1); - Ufirst(1) = PI; - Ufirst(2) = PI; + Ufirst(1) = M_PI; + Ufirst(2) = M_PI; Ufirst(3) = Param1; - tol(1) = 2.e-15*PI; - tol(2) = 2.e-15*PI; + tol(1) = 2.e-15*M_PI; + tol(2) = 2.e-15*M_PI; tol(3) = TheCurveTool::EpsX(Cu1,Abs(Tolerance)); math_FunctionSetRoot Root(Func,Ufirst,tol,Umin,Umax); if (Root.IsDone()) { @@ -954,10 +954,10 @@ GccIter_Circ2d3Tan:: Umin(1) = 0.; Umax(2) = RealLast(); Umax(3) = TheCurveTool::LastParameter(Cu2); - Umax(1) = 2*PI; + Umax(1) = 2*M_PI; Ufirst(2) = Param1; Ufirst(3) = Param2; - Ufirst(1) = PI; + Ufirst(1) = M_PI; tol(1) = 2.e-15; tol(2) = 1.e-15; tol(3) = TheCurveTool::EpsX(Cu2,Abs(Tolerance)); @@ -1075,13 +1075,13 @@ GccIter_Circ2d3Tan:: Umin(1) = 0.; Umin(2) = RealFirst(); Umin(3) = TheCurveTool::FirstParameter(Cu3); - Umax(1) = 2*PI; + Umax(1) = 2*M_PI; Umax(2) = RealLast(); Umax(3) = TheCurveTool::LastParameter(Cu3); Ufirst(1) = Param1; Ufirst(2) = Param2; Ufirst(3) = Param3; - tol(1) = 2.e-15*PI; + tol(1) = 2.e-15*M_PI; tol(2) = 1.e-15; tol(3) = TheCurveTool::EpsX(Cu3,Abs(Tolerance)); math_FunctionSetRoot Root(Func,Ufirst,tol,Umin,Umax); @@ -1206,14 +1206,14 @@ GccIter_Circ2d3Tan:: Umin(1) = 0.; Umin(3) = TheCurveTool::FirstParameter(Cu2); Umin(2) = 0.; - Umax(1) = 2*PI; + Umax(1) = 2*M_PI; Umax(3) = TheCurveTool::LastParameter(Cu2); - Umax(2) = 2*PI; + Umax(2) = 2*M_PI; Ufirst(1) = Param1; - Ufirst(2) = PI; + Ufirst(2) = M_PI; Ufirst(3) = Param2; - tol(1) = 2.e-15*PI; - tol(2) = 2.e-15*PI; + tol(1) = 2.e-15*M_PI; + tol(2) = 2.e-15*M_PI; tol(3) = TheCurveTool::EpsX(Cu2,Abs(Tolerance)); math_FunctionSetRoot Root(Func,Ufirst,tol,Umin,Umax); if (Root.IsDone()) { diff --git a/src/GccIter/GccIter_Lin2dTanObl.gxx b/src/GccIter/GccIter_Lin2dTanObl.gxx index c6ae864852..1dcce061d9 100755 --- a/src/GccIter/GccIter_Lin2dTanObl.gxx +++ b/src/GccIter/GccIter_Lin2dTanObl.gxx @@ -42,12 +42,12 @@ GccIter_Lin2dTanObl:: Standard_Real B = Dir.Y(); gp_Dir2d TheDirection(Dir); if (Abs(Angle) > Abs(TolAng)) { - if (Abs(Abs(Angle)-PI) <= Abs(TolAng)) { + if (Abs(Abs(Angle)-M_PI) <= Abs(TolAng)) { Paral2 = Standard_True; TheDirection = Dir.Reversed(); } - else if (Abs(Angle-PI/2) <= Abs(TolAng)) { TheDirection=gp_Dir2d(-B,A); } - else if (Abs(Angle+PI/2) <= Abs(TolAng)) { TheDirection=gp_Dir2d(B,-A); } + else if (Abs(Angle-M_PI/2) <= Abs(TolAng)) { TheDirection=gp_Dir2d(-B,A); } + else if (Abs(Angle+M_PI/2) <= Abs(TolAng)) { TheDirection=gp_Dir2d(B,-A); } else { TheDirection=gp_Dir2d(A*Cos(Angle)-B*Sin(Angle), A*Sin(Angle)+B*Cos(Angle)); diff --git a/src/Geom/Geom_Circle.cxx b/src/Geom/Geom_Circle.cxx index c14ed94403..36d61f1c67 100755 --- a/src/Geom/Geom_Circle.cxx +++ b/src/Geom/Geom_Circle.cxx @@ -82,7 +82,7 @@ Standard_Boolean Geom_Circle::IsPeriodic () const { return Standard_True; } Standard_Real Geom_Circle::ReversedParameter( const Standard_Real U) const { - return ( 2. * PI - U); + return ( 2. * M_PI - U); } //======================================================================= @@ -106,7 +106,7 @@ Standard_Real Geom_Circle::FirstParameter () const { return 0.0; } //purpose : //======================================================================= -Standard_Real Geom_Circle::LastParameter () const { return 2.0 * PI; } +Standard_Real Geom_Circle::LastParameter () const { return 2.0 * M_PI; } //======================================================================= diff --git a/src/Geom/Geom_ConicalSurface.cxx b/src/Geom/Geom_ConicalSurface.cxx index 71959c2cfa..15c9653552 100755 --- a/src/Geom/Geom_ConicalSurface.cxx +++ b/src/Geom/Geom_ConicalSurface.cxx @@ -63,7 +63,7 @@ Geom_ConicalSurface::Geom_ConicalSurface ( const Ax3& A3 , radius(R), semiAngle (Ang) { - if (R < 0.0 || Abs(Ang) <= gp::Resolution() || Abs(Ang) >= PI/2.0 - gp::Resolution()) + if (R < 0.0 || Abs(Ang) <= gp::Resolution() || Abs(Ang) >= M_PI/2.0 - gp::Resolution()) Standard_ConstructionError::Raise(); pos = A3; @@ -89,7 +89,7 @@ Geom_ConicalSurface::Geom_ConicalSurface ( const gp_Cone& C ) Standard_Real Geom_ConicalSurface::UReversedParameter( const Standard_Real U) const { - return ( 2.*PI - U); + return ( 2.*M_PI - U); } @@ -205,7 +205,7 @@ void Geom_ConicalSurface::SetRadius (const Standard_Real R) { void Geom_ConicalSurface::SetSemiAngle (const Standard_Real Ang) { - if (Abs(Ang) <= gp::Resolution() || Abs(Ang) >= PI/2.0 - gp::Resolution()) { + if (Abs(Ang) <= gp::Resolution() || Abs(Ang) >= M_PI/2.0 - gp::Resolution()) { Standard_ConstructionError::Raise(); } semiAngle = Ang; @@ -235,7 +235,7 @@ Pnt Geom_ConicalSurface::Apex () const void Geom_ConicalSurface::Bounds (Standard_Real& U1, Standard_Real& U2, Standard_Real& V1, Standard_Real& V2) const { - U1 = 0.0; U2 = 2.0 * PI; + U1 = 0.0; U2 = 2.0 * M_PI; V1 = -Precision::Infinite(); V2 = Precision::Infinite(); } diff --git a/src/Geom/Geom_CylindricalSurface.cxx b/src/Geom/Geom_CylindricalSurface.cxx index fde3e489b8..7bc5311445 100755 --- a/src/Geom/Geom_CylindricalSurface.cxx +++ b/src/Geom/Geom_CylindricalSurface.cxx @@ -84,7 +84,7 @@ Geom_CylindricalSurface::Geom_CylindricalSurface ( const Ax3& A3, Standard_Real Geom_CylindricalSurface::UReversedParameter( const Standard_Real U) const { - return (2.*PI - U); + return (2.*M_PI - U); } //======================================================================= @@ -164,7 +164,7 @@ void Geom_CylindricalSurface::SetRadius (const Standard_Real R) { void Geom_CylindricalSurface::Bounds (Standard_Real& U1, Standard_Real& U2, Standard_Real& V1, Standard_Real& V2) const { - U1 = 0.0; U2 = 2.0 * PI; + U1 = 0.0; U2 = 2.0 * M_PI; V1 = - Precision::Infinite(); V2 = Precision::Infinite(); } diff --git a/src/Geom/Geom_Ellipse.cxx b/src/Geom/Geom_Ellipse.cxx index 51f46ebbc2..4d43d8f4e4 100755 --- a/src/Geom/Geom_Ellipse.cxx +++ b/src/Geom/Geom_Ellipse.cxx @@ -95,7 +95,7 @@ Standard_Real Geom_Ellipse::FirstParameter () const { return 0.0; } //purpose : //======================================================================= -Standard_Real Geom_Ellipse::LastParameter () const { return 2.0 * PI; } +Standard_Real Geom_Ellipse::LastParameter () const { return 2.0 * M_PI; } //======================================================================= //function : MajorRadius @@ -168,7 +168,7 @@ gp_Elips Geom_Ellipse::Elips () const { Standard_Real Geom_Ellipse::ReversedParameter( const Standard_Real U) const { - return ( 2. * PI - U); + return ( 2. * M_PI - U); } diff --git a/src/Geom/Geom_OffsetSurface.cxx b/src/Geom/Geom_OffsetSurface.cxx index 81fee45c9a..a0df5944b0 100755 --- a/src/Geom/Geom_OffsetSurface.cxx +++ b/src/Geom/Geom_OffsetSurface.cxx @@ -1497,7 +1497,7 @@ Handle(Geom_Surface) Geom_OffsetSurface::Surface() const Result = new Geom_CylindricalSurface( Axis, Radius); } else if ( Radius <= -Tol ){ - Axis.Rotate(gp_Ax1(Axis.Location(),Axis.Direction()),PI); + Axis.Rotate(gp_Ax1(Axis.Location(),Axis.Direction()),M_PI); Result = new Geom_CylindricalSurface( Axis, Abs(Radius)); Result->UReverse(); } @@ -1537,7 +1537,7 @@ Handle(Geom_Surface) Geom_OffsetSurface::Surface() const Result = new Geom_SphericalSurface(Axis, Radius); } else if ( Radius <= -Tol ) { - Axis.Rotate(gp_Ax1(Axis.Location(),Axis.Direction()),PI); + Axis.Rotate(gp_Ax1(Axis.Location(),Axis.Direction()),M_PI); Axis.ZReverse(); Result = new Geom_SphericalSurface(Axis, -Radius); Result->UReverse(); diff --git a/src/Geom/Geom_SphericalSurface.cxx b/src/Geom/Geom_SphericalSurface.cxx index 4863e78cfd..3993730787 100755 --- a/src/Geom/Geom_SphericalSurface.cxx +++ b/src/Geom/Geom_SphericalSurface.cxx @@ -80,7 +80,7 @@ Geom_SphericalSurface::Geom_SphericalSurface (const gp_Sphere& S) Standard_Real Geom_SphericalSurface::UReversedParameter( const Standard_Real U) const { - return (2.*PI - U); + return (2.*M_PI - U); } //======================================================================= @@ -100,7 +100,7 @@ Standard_Real Geom_SphericalSurface::VReversedParameter( const Standard_Real V) //======================================================================= Standard_Real Geom_SphericalSurface::Area () const -{return 4.0 * PI * radius * radius;} +{return 4.0 * M_PI * radius * radius;} //======================================================================= //function : Radius @@ -175,9 +175,9 @@ void Geom_SphericalSurface::Bounds (Standard_Real& U1, Standard_Real& U2, Standard_Real& V1, Standard_Real& V2) const { U1 = 0.0; - U2 = PI * 2.0; - V1 = -PI / 2.0; - V2 = PI / 2.0; + U2 = M_PI * 2.0; + V1 = -M_PI / 2.0; + V2 = M_PI / 2.0; } @@ -308,7 +308,7 @@ gp_Sphere Geom_SphericalSurface::Sphere () const { Handle(Curve) Geom_SphericalSurface::UIso (const Standard_Real U) const { Handle(Geom_Circle) GC = new Geom_Circle(ElSLib::SphereUIso(pos,radius,U)); - Handle(Geom_TrimmedCurve) iso = new Geom_TrimmedCurve(GC,-PI/2.,PI/2); + Handle(Geom_TrimmedCurve) iso = new Geom_TrimmedCurve(GC,-M_PI/2.,M_PI/2); return iso; } @@ -333,7 +333,7 @@ Handle(Curve) Geom_SphericalSurface::VIso (const Standard_Real V) const Standard_Real Geom_SphericalSurface::Volume () const { - return (4.0 * PI * radius * radius * radius)/3.0; + return (4.0 * M_PI * radius * radius * radius)/3.0; } diff --git a/src/Geom/Geom_SurfaceOfRevolution.cxx b/src/Geom/Geom_SurfaceOfRevolution.cxx index 41cc1fc03b..72410b1f23 100755 --- a/src/Geom/Geom_SurfaceOfRevolution.cxx +++ b/src/Geom/Geom_SurfaceOfRevolution.cxx @@ -155,7 +155,7 @@ void Geom_SurfaceOfRevolution::UReverse () { Standard_Real Geom_SurfaceOfRevolution::UReversedParameter (const Standard_Real U) const { - return ( 2.*PI - U); + return ( 2.*M_PI - U); } @@ -322,7 +322,7 @@ void Geom_SurfaceOfRevolution::Bounds ( Standard_Real& U1, Standard_Real& V2 ) const { U1 = 0.0; - U2 = 2.0 * PI; + U2 = 2.0 * M_PI; V1 = basisCurve->FirstParameter(); V2 = basisCurve->LastParameter(); } diff --git a/src/Geom/Geom_ToroidalSurface.cxx b/src/Geom/Geom_ToroidalSurface.cxx index 362e43cb1f..6b4c0011f9 100755 --- a/src/Geom/Geom_ToroidalSurface.cxx +++ b/src/Geom/Geom_ToroidalSurface.cxx @@ -112,7 +112,7 @@ Standard_Real Geom_ToroidalSurface::MinorRadius () const { Standard_Real Geom_ToroidalSurface::UReversedParameter( const Standard_Real U) const { - return (2.*PI - U); + return (2.*M_PI - U); } @@ -123,7 +123,7 @@ Standard_Real Geom_ToroidalSurface::UReversedParameter( const Standard_Real U) c Standard_Real Geom_ToroidalSurface::VReversedParameter( const Standard_Real V) const { - return (2.*PI - V); + return (2.*M_PI - V); } @@ -215,7 +215,7 @@ void Geom_ToroidalSurface::SetTorus (const gp_Torus& T) { //======================================================================= Standard_Real Geom_ToroidalSurface::Area () const { - return 4.0 * PI * PI * minorRadius * majorRadius; + return 4.0 * M_PI * M_PI * minorRadius * majorRadius; } @@ -231,8 +231,8 @@ void Geom_ToroidalSurface::Bounds (Standard_Real& U1, U1 = 0.0; V1 = 0.0; - U2 = 2*PI; - V2 = 2*PI; + U2 = 2*M_PI; + V2 = 2*M_PI; } @@ -366,7 +366,7 @@ Handle(Geom_Curve) Geom_ToroidalSurface::VIso (const Standard_Real V) const Standard_Real Geom_ToroidalSurface::Volume () const { - return (PI * minorRadius * minorRadius) * (2.0 * PI * majorRadius); + return (M_PI * minorRadius * minorRadius) * (2.0 * M_PI * majorRadius); } diff --git a/src/Geom2d/Geom2d_Circle.cxx b/src/Geom2d/Geom2d_Circle.cxx index 263aeddfc3..b946217fe4 100755 --- a/src/Geom2d/Geom2d_Circle.cxx +++ b/src/Geom2d/Geom2d_Circle.cxx @@ -130,7 +130,7 @@ gp_Circ2d Geom2d_Circle::Circ2d () const Standard_Real Geom2d_Circle::ReversedParameter( const Standard_Real U) const { - return (2. * PI - U); + return (2. * M_PI - U); } //======================================================================= @@ -160,7 +160,7 @@ Standard_Real Geom2d_Circle::FirstParameter () const Standard_Real Geom2d_Circle::LastParameter () const { - return 2.0 * PI; + return 2.0 * M_PI; } //======================================================================= diff --git a/src/Geom2d/Geom2d_Ellipse.cxx b/src/Geom2d/Geom2d_Ellipse.cxx index 6c501f1c79..af23aede9d 100755 --- a/src/Geom2d/Geom2d_Ellipse.cxx +++ b/src/Geom2d/Geom2d_Ellipse.cxx @@ -149,7 +149,7 @@ gp_Elips2d Geom2d_Ellipse::Elips2d () const Standard_Real Geom2d_Ellipse::ReversedParameter( const Standard_Real U) const { - return (2. * PI - U); + return (2. * M_PI - U); } //======================================================================= @@ -279,7 +279,7 @@ Standard_Real Geom2d_Ellipse::FirstParameter () const Standard_Real Geom2d_Ellipse::LastParameter () const { - return 2.0 * PI; + return 2.0 * M_PI; } //======================================================================= diff --git a/src/Geom2dAdaptor/Geom2dAdaptor_Curve.cxx b/src/Geom2dAdaptor/Geom2dAdaptor_Curve.cxx index c95302ff33..d6ffca8229 100755 --- a/src/Geom2dAdaptor/Geom2dAdaptor_Curve.cxx +++ b/src/Geom2dAdaptor/Geom2dAdaptor_Curve.cxx @@ -685,7 +685,7 @@ Standard_Real Geom2dAdaptor_Curve::Resolution(const Standard_Real Ruv) const { if ( R > Ruv/2.) return 2*ASin(Ruv/(2*R)); else - return 2*PI; + return 2*M_PI; } case GeomAbs_Ellipse: { return Ruv / (*((Handle(Geom2d_Ellipse)*)&myCurve))->MajorRadius(); diff --git a/src/Geom2dAdaptor/Geom2dAdaptor_Curve.lxx b/src/Geom2dAdaptor/Geom2dAdaptor_Curve.lxx index 7a044593cd..b1c601d700 100755 --- a/src/Geom2dAdaptor/Geom2dAdaptor_Curve.lxx +++ b/src/Geom2dAdaptor/Geom2dAdaptor_Curve.lxx @@ -75,4 +75,4 @@ inline void Geom2dAdaptor_Curve::Load(const Handle(Geom2d_Curve)& C, if ( UFirst > ULast) Standard_ConstructionError::Raise(); load(C,UFirst,ULast); -} \ No newline at end of file +} diff --git a/src/GeomAdaptor/GeomAdaptor_Curve.cxx b/src/GeomAdaptor/GeomAdaptor_Curve.cxx index 3c65a4998c..902f1018c3 100755 --- a/src/GeomAdaptor/GeomAdaptor_Curve.cxx +++ b/src/GeomAdaptor/GeomAdaptor_Curve.cxx @@ -673,7 +673,7 @@ Standard_Real GeomAdaptor_Curve::Resolution(const Standard_Real R3D) const if ( R > R3D/2. ) return 2*ASin(R3D/(2*R)); else - return 2*PI; + return 2*M_PI; } case GeomAbs_Ellipse: { return R3D / (*((Handle(Geom_Ellipse)*)&myCurve))->MajorRadius(); diff --git a/src/GeomAdaptor/GeomAdaptor_Surface.cxx b/src/GeomAdaptor/GeomAdaptor_Surface.cxx index 595637dc31..22815fb4ea 100755 --- a/src/GeomAdaptor/GeomAdaptor_Surface.cxx +++ b/src/GeomAdaptor/GeomAdaptor_Surface.cxx @@ -858,7 +858,7 @@ Standard_Real GeomAdaptor_Surface::UResolution(const Standard_Real R3d) const if ( Res <= 1.) return 2.*ASin(Res); - return 2.*PI; + return 2.*M_PI; } //======================================================================= @@ -925,7 +925,7 @@ Standard_Real GeomAdaptor_Surface::VResolution(const Standard_Real R3d) const if ( Res <= 1.) return 2.*ASin(Res); - return 2.*PI; + return 2.*M_PI; } //======================================================================= diff --git a/src/GeomConvert/GeomConvert.cxx b/src/GeomConvert/GeomConvert.cxx index 1c3755efed..836b4b164f 100755 --- a/src/GeomConvert/GeomConvert.cxx +++ b/src/GeomConvert/GeomConvert.cxx @@ -393,7 +393,7 @@ Handle(Geom_BSplineCurve) GeomConvert::CurveToBSplineCurve else if ( Parameterisation == Convert_QuasiAngular) { Convert_EllipseToBSplineCurve Convert (E2d, 0.0e0, - 2.0e0 * PI, + 2.0e0 * M_PI, Parameterisation); TheCurve = BSplineCurveBuilder (TheConic, Convert); @@ -417,7 +417,7 @@ Handle(Geom_BSplineCurve) GeomConvert::CurveToBSplineCurve else if ( Parameterisation == Convert_QuasiAngular) { Convert_CircleToBSplineCurve Convert (C2d, 0.0e0, - 2.0e0 * PI, + 2.0e0 * M_PI, Parameterisation); TheCurve = BSplineCurveBuilder (TheConic, Convert); diff --git a/src/GeomConvert/GeomConvert_1.cxx b/src/GeomConvert/GeomConvert_1.cxx index 1b91a5c304..ee59edc70d 100755 --- a/src/GeomConvert/GeomConvert_1.cxx +++ b/src/GeomConvert/GeomConvert_1.cxx @@ -525,14 +525,14 @@ Handle(BSplineSurface) GeomConvert::SplitBSplineSurface if (Strim->IsUPeriodic()) { NbUKnots = 4; nbUSpans = 3; - AlfaU = PI / 3.; + AlfaU = M_PI / 3.; NbUPoles = 6; periodic = Standard_True; } else { // Nombre de spans : ouverture maximale = 150 degres ( = PI / 1.2 rds) nbUSpans = - (Standard_Integer)IntegerPart( 1.2 * (ULast - UFirst) / PI) + 1; + (Standard_Integer)IntegerPart( 1.2 * (ULast - UFirst) / M_PI) + 1; AlfaU = (ULast - UFirst) / ( nbUSpans * 2); NbUPoles = 2 * nbUSpans + 1; NbUKnots = nbUSpans + 1; @@ -756,7 +756,7 @@ Handle(BSplineSurface) GeomConvert::SplitBSplineSurface Standard_Real AlfaU; NbUKnots = 4; nbUSpans = 3; - AlfaU = PI / 3.; + AlfaU = M_PI / 3.; NbUPoles = 6; // Compute Knots and Mults diff --git a/src/GeomFill/GeomFill.cxx b/src/GeomFill/GeomFill.cxx index 44cf0e0712..25d4a6db60 100755 --- a/src/GeomFill/GeomFill.cxx +++ b/src/GeomFill/GeomFill.cxx @@ -203,7 +203,7 @@ void GeomFill::GetShape (const Standard_Real MaxAng, default: { Standard_Integer NbSpan = - (Standard_Integer)(Ceiling(3.*Abs(MaxAng)/2./PI)); + (Standard_Integer)(Ceiling(3.*Abs(MaxAng)/2./M_PI)); NbPoles = 2*NbSpan+1; NbKnots = NbSpan+1; Degree = 2; @@ -380,7 +380,7 @@ void GeomFill::GetCircle( const Convert_ParameterisationType TConv, // Recadrage sur ]-pi/2, 3pi/2] if (Sina <0.) { if (Cosa > 0.) Angle = -Angle; - else Angle = 2.*PI - Angle; + else Angle = 2.*M_PI - Angle; } switch (TConv) { @@ -466,7 +466,7 @@ Standard_Boolean GeomFill::GetCircle(const Convert_ParameterisationType TConv, // Recadrage sur ]-pi/2, 3pi/2] if (Sina <0.) { if (Cosa > 0.) Angle = -Angle; - else Angle = 2.*PI - Angle; + else Angle = 2.*M_PI - Angle; } if (Abs(Sina)>Abs(Cosa)) { @@ -606,7 +606,7 @@ Standard_Boolean GeomFill::GetCircle(const Convert_ParameterisationType TConv, // Recadrage sur ]-pi/2, 3pi/2] if (Sina <0.) { if (Cosa > 0.) Angle = -Angle; - else Angle = 2.*PI - Angle; + else Angle = 2.*M_PI - Angle; } if (Abs(Sina)>Abs(Cosa)) { diff --git a/src/GeomFill/GeomFill_CircularBlendFunc.cxx b/src/GeomFill/GeomFill_CircularBlendFunc.cxx index 7eeadeeb42..e90ce22049 100755 --- a/src/GeomFill/GeomFill_CircularBlendFunc.cxx +++ b/src/GeomFill/GeomFill_CircularBlendFunc.cxx @@ -112,7 +112,7 @@ GeomFill_CircularBlendFunc(const Handle(Adaptor3d_HCurve)& Path, // Type de convertion ? if (Polynomial) myTConv=Convert_Polynomial; - else if(maxang > 0.65*PI) + else if(maxang > 0.65*M_PI) myTConv=Convert_QuasiAngular; //car c'est Continue else myTConv = Convert_TgtThetaOver2; //car c'est le plus performant diff --git a/src/GeomFill/GeomFill_ConstrainedFilling.cxx b/src/GeomFill/GeomFill_ConstrainedFilling.cxx index ad83294d25..2b54af83bb 100755 --- a/src/GeomFill/GeomFill_ConstrainedFilling.cxx +++ b/src/GeomFill/GeomFill_ConstrainedFilling.cxx @@ -155,7 +155,7 @@ static void sortbounds(const Standard_Integer nb, else bound[next]->Bounds(ln,fn); bound[next]->D1(fn,pbid,tgn); if(rev[next]) tgn.Reverse(); - Standard_Real ang = PI - tgi.Angle(tgn); + Standard_Real ang = M_PI - tgi.Angle(tgn); stat[next].TgtAng(ang); if(bound[i]->HasNormals() && bound[next]->HasNormals()){ stat[next].Constraint(); @@ -183,7 +183,7 @@ static void coonscnd(const Standard_Integer nb, Standard_Real tolang = Min(bound[ip]->Tolang(),bound[i]->Tolang()); Standard_Real an = stat[i].NorAng(); Standard_Boolean twist = Standard_False; - if(an >= 0.5*PI) { twist = Standard_True; an = PI-an; } + if(an >= 0.5*M_PI) { twist = Standard_True; an = M_PI-an; } if(an > tolang) stat[i].DoKill(0.); else{ Standard_Real fact = 0.5*27./4; @@ -1312,7 +1312,7 @@ void GeomFill_ConstrainedFilling::CheckTgteField(const Standard_Integer I) dout << seg; #endif if(vnor.Magnitude() > 1.e-15 && vtg.Magnitude() > 1.e-15){ - Standard_Real alpha = Abs(PI/2.-Abs(vnor.Angle(vtg))); + Standard_Real alpha = Abs(M_PI/2.-Abs(vnor.Angle(vtg))); if(Abs(alpha) > maxang) maxang = Abs(alpha); } } @@ -1346,7 +1346,7 @@ void GeomFill_ConstrainedFilling::CheckApprox(const Standard_Integer I) vapp.SetXYZ(pbid.XYZ()); vbound = bou->Norm(uu); if(vapp.Magnitude() > 1.e-15 && vbound.Magnitude() > 1.e-15){ - Standard_Real alpha = Abs(PI/2.-Abs(vbound.Angle(vapp))); + Standard_Real alpha = Abs(M_PI/2.-Abs(vbound.Angle(vapp))); if(Abs(alpha) > maxang) maxang = Abs(alpha); } #ifdef DRAW @@ -1365,7 +1365,7 @@ void GeomFill_ConstrainedFilling::CheckApprox(const Standard_Integer I) cout<<"Controle approx/contrainte sur bord "< 1.e-15 && vbound[k].Magnitude() > 1.e-15){ Standard_Real alpha = Abs(vres[k].Angle(vbound[k])); - alpha = Min(alpha,Abs(PI-alpha)); + alpha = Min(alpha,Abs(M_PI-alpha)); if(alpha > maxang) maxang = alpha; ang[k] = alpha; hasang[k] = 1; @@ -1439,7 +1439,7 @@ void GeomFill_ConstrainedFilling::CheckResult(const Standard_Integer I) cout<<"Controle resultat/contrainte sur bord "<D0(currParam, Tangent, Normal, BN); - if (prevTangent.Angle(Tangent) < PI/3 || i == 1) { + if (prevTangent.Angle(Tangent) < M_PI/3 || i == 1) { parameters.Append(currParam); //OCC78 SeqPoles.Append(Param); @@ -556,7 +556,7 @@ Standard_Real GeomFill_CorrectedFrenet::CalcAngleAT(const gp_Vec& Tangent, const else Normal_rot = Normal; Standard_Real angleAT = Normal_rot.Angle(prevNormal); - if(angleAT > Precision::Angular() && PI - angleAT > Precision::Angular()) + if(angleAT > Precision::Angular() && M_PI - angleAT > Precision::Angular()) if (Normal_rot.Crossed(prevNormal).IsOpposite(prevTangent, Precision::Angular())) angleAT = -angleAT; return angleAT; @@ -566,13 +566,13 @@ Standard_Real GeomFill_CorrectedFrenet::CalcAngleAT(const gp_Vec& Tangent, const // Purpose : This family of functions produce conversion of angle utility //=============================================================== static Standard_Real corrPI_2PI(Standard_Real Ang){ - return Ang = (Ang >= 0.0? Ang: 2*PI+Ang); + return Ang = (Ang >= 0.0? Ang: 2*M_PI+Ang); }; static Standard_Real corr2PI_PI(Standard_Real Ang){ - return Ang = (Ang < PI? Ang: Ang-2*PI); + return Ang = (Ang < M_PI? Ang: Ang-2*M_PI); }; static Standard_Real diffAng(Standard_Real A, Standard_Real Ao){ - Standard_Real dA = (A-Ao) - Floor((A-Ao)/2.0/PI)*2.0*PI; + Standard_Real dA = (A-Ao) - Floor((A-Ao)/2.0/M_PI)*2.0*M_PI; return dA = dA >= 0? corr2PI_PI(dA): -corr2PI_PI(-dA); }; //=============================================================== @@ -603,7 +603,7 @@ Standard_Real GeomFill_CorrectedFrenet::GetAngleAT(const Standard_Real Param) co Standard_Real DAng = CalcAngleAT(Tangent, Normal, HArrTangent->Value(iC), HArrNormal->Value(iC)); Standard_Real DA = diffAng(DAng,dAng); // The correction (there is core of OCC78 bug) - if(Abs(DA) > PI/2.0){ + if(Abs(DA) > M_PI/2.0){ AngP = AngPo + DAng; }; return AngP; diff --git a/src/GeomFill/GeomFill_DraftTrihedron.cxx b/src/GeomFill/GeomFill_DraftTrihedron.cxx index 361e69ef38..f8bff6ad75 100755 --- a/src/GeomFill/GeomFill_DraftTrihedron.cxx +++ b/src/GeomFill/GeomFill_DraftTrihedron.cxx @@ -47,7 +47,7 @@ static gp_Vec DDeriv(const gp_Vec& F, const gp_Vec& DF, const gp_Vec& D2F) //======================================================================= void GeomFill_DraftTrihedron::SetAngle(const Standard_Real Angle) { - myAngle = PI/2 + Angle; + myAngle = M_PI/2 + Angle; myCos = Cos(myAngle); } @@ -229,7 +229,7 @@ Standard_Boolean GeomFill_DraftTrihedron::D2(const Standard_Real Param, Handle(GeomFill_TrihedronLaw) GeomFill_DraftTrihedron::Copy() const { Handle(GeomFill_DraftTrihedron) copy = - new (GeomFill_DraftTrihedron) (B,myAngle-PI/2); + new (GeomFill_DraftTrihedron) (B,myAngle-M_PI/2); copy->SetCurve(myCurve); return copy; } diff --git a/src/GeomFill/GeomFill_Frenet.cxx b/src/GeomFill/GeomFill_Frenet.cxx index 43912f07eb..eb8dfb57eb 100755 --- a/src/GeomFill/GeomFill_Frenet.cxx +++ b/src/GeomFill/GeomFill_Frenet.cxx @@ -631,8 +631,8 @@ Standard_Boolean GeomFill_Frenet::DoSingular(const Standard_Real U, D0(U + h, T, N, BN); - if(Tangent.Angle(T) > PI/2) TFlag = -1; - if(BiNormal.Angle(BN) > PI/2) BNFlag = -1; + if(Tangent.Angle(T) > M_PI/2) TFlag = -1; + if(BiNormal.Angle(BN) > M_PI/2) BNFlag = -1; return Standard_True; } diff --git a/src/GeomFill/GeomFill_GuideTrihedronPlan.cxx b/src/GeomFill/GeomFill_GuideTrihedronPlan.cxx index fc894683bc..3b0568b56e 100755 --- a/src/GeomFill/GeomFill_GuideTrihedronPlan.cxx +++ b/src/GeomFill/GeomFill_GuideTrihedronPlan.cxx @@ -558,7 +558,7 @@ void GeomFill_GuideTrihedronPlan::SetInterval(const Standard_Real First, (myGuide->GetType() == GeomAbs_Line)) { Standard_Real Angle; Angle = myCurve->Line().Angle(myGuide->Line()); - if ((Angle<1.e-12) || ((2*PI-Angle)<1.e-12) ) + if ((Angle<1.e-12) || ((2*M_PI-Angle)<1.e-12) ) return Standard_True; } diff --git a/src/GeomFill/GeomFill_LocationGuide.cxx b/src/GeomFill/GeomFill_LocationGuide.cxx index cb50d9d6ad..607b38ed5f 100755 --- a/src/GeomFill/GeomFill_LocationGuide.cxx +++ b/src/GeomFill/GeomFill_LocationGuide.cxx @@ -264,8 +264,8 @@ static void InGoodPeriod(const Standard_Real Prec, Inf(1) = myGuide->FirstParameter() - Delta/10; Sup(1) = myGuide->LastParameter() + Delta/10; - Inf(2) = -PI; - Sup(2) = 3*PI; + Inf(2) = -M_PI; + Sup(2) = 3*M_PI; Delta = Ul - Uf; Inf(3) = Uf - Delta/10; @@ -371,11 +371,11 @@ static void InGoodPeriod(const Standard_Real Prec, // d'angle le plus proche de P PInt = Int.Point(1); a1 = PInt.U(); - InGoodPeriod (CurAngle, 2*PI, a1); + InGoodPeriod (CurAngle, 2*M_PI, a1); Standard_Real Dmin = Abs(a1-CurAngle); for (Standard_Integer jj=2;jj<=Int.NbPoints();jj++) { a2 = Int.Point(jj).U(); - InGoodPeriod (CurAngle, 2*PI, a2); + InGoodPeriod (CurAngle, 2*M_PI, a2); if (Abs(a2-CurAngle) < Dmin) { PInt = Int.Point(jj); Dmin = Abs(a2-CurAngle); @@ -406,12 +406,12 @@ static void InGoodPeriod(const Standard_Real Prec, Angle = PInt.U(); if (ii > 1) { Diff = Angle - OldAngle; - if (Abs(Diff) > PI) { - InGoodPeriod (OldAngle, 2*PI, Angle); + if (Abs(Diff) > M_PI) { + InGoodPeriod (OldAngle, 2*M_PI, Angle); Diff = Angle - OldAngle; } #if DEB - if (Abs(Diff) > PI/4) { + if (Abs(Diff) > M_PI/4) { cout << "Diff d'angle trop grand !!" << endl; } #endif @@ -1419,7 +1419,7 @@ void GeomFill_LocationGuide::InitX(const Standard_Real Param) const X(1) = ElCLib::InPeriod(X(1), myGuide->FirstParameter(), myGuide->LastParameter()); } - X(2) = ElCLib::InPeriod(X(2), 0, 2*PI); + X(2) = ElCLib::InPeriod(X(2), 0, 2*M_PI); if (mySec->IsUPeriodic()) { X(3) = ElCLib::InPeriod(X(3), Uf, Ul); } diff --git a/src/GeomFill/GeomFill_Pipe.cxx b/src/GeomFill/GeomFill_Pipe.cxx index f4040aba20..ff622968eb 100755 --- a/src/GeomFill/GeomFill_Pipe.cxx +++ b/src/GeomFill/GeomFill_Pipe.cxx @@ -446,7 +446,7 @@ void GeomFill_Pipe::Init(const Handle(Geom_Curve)& Path, // Nouvelle methode myAdpPath = new (GeomAdaptor_HCurve) (Path); Handle(Geom_Circle) C = new (Geom_Circle) (gp::XOY(), Radius); - C->Rotate(gp::OZ(),PI/2.); + C->Rotate(gp::OZ(),M_PI/2.); mySec = new (GeomFill_UniformSection) (C, Path->FirstParameter(), Path->LastParameter()); @@ -964,14 +964,14 @@ Standard_Boolean GeomFill_Pipe::KPartT4() Axis.YReverse(); // rotate the surface to set the iso U = 0 not in the result. - Axis.Rotate(gp_Ax1(P0,ZRef),-PI/2.); + Axis.Rotate(gp_Ax1(P0,ZRef),-M_PI/2.); mySurface = new Geom_CylindricalSurface( Axis, myRadius); Standard_Real Alpha = V1.AngleWithRef(V2,ZRef); mySurface = new Geom_RectangularTrimmedSurface(mySurface, - PI/2. , - PI/2. + Alpha, + M_PI/2. , + M_PI/2. + Alpha, myAdpPath->FirstParameter(), myAdpPath->LastParameter()); Ok = Standard_True; //C'est bien un cylindre @@ -1030,7 +1030,7 @@ Standard_Boolean GeomFill_Pipe::KPartT4() if (deltaV < 0.) { T.VReverse(); VV1 = -VV1; - VV2 = 2*PI + VV1 - deltaV; + VV2 = 2*M_PI + VV1 - deltaV; } mySurface = new Geom_RectangularTrimmedSurface (new Geom_ToroidalSurface(T), diff --git a/src/GeomFill/GeomFill_QuasiAngularConvertor.cxx b/src/GeomFill/GeomFill_QuasiAngularConvertor.cxx index e50201f732..dd31696679 100755 --- a/src/GeomFill/GeomFill_QuasiAngularConvertor.cxx +++ b/src/GeomFill/GeomFill_QuasiAngularConvertor.cxx @@ -145,7 +145,7 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt, beta5 = beta3*beta2; beta6 = beta3*beta3; - if ((PI/2 - beta)> NullAngle) { + if ((M_PI/2 - beta)> NullAngle) { if (Abs(beta) < NullAngle) { Standard_Real cf = 2.0/(3*5*7); b = - (0.2+cf*beta2) / (1+ 0.2*beta2); @@ -273,7 +273,7 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt, else { b = ((Standard_Real) -1)/beta2; bpr = (2*betaprim) / beta3; - if ((PI/2 - beta)> NullAngle) { + if ((M_PI/2 - beta)> NullAngle) { tan_b = Tan(beta); dtan_b = betaprim * (1 + tan_b*tan_b); b2 = tan_b - beta; @@ -473,7 +473,7 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt, b = ((Standard_Real) -1)/beta2; bpr = (2*betaprim) / beta3; bsc = (2*betasecn - 6*betaprim*(betaprim/beta)) / beta3; - if ((PI/2 - beta)> NullAngle) { + if ((M_PI/2 - beta)> NullAngle) { tan_b = Tan(beta); dtan_b = betaprim * (1 + tan_b*tan_b); d2tan_b = betasecn * (1 + tan_b*tan_b) diff --git a/src/GeomFill/GeomFill_SectionPlacement.cxx b/src/GeomFill/GeomFill_SectionPlacement.cxx index f55a8c2af2..af5963b8ec 100755 --- a/src/GeomFill/GeomFill_SectionPlacement.cxx +++ b/src/GeomFill/GeomFill_SectionPlacement.cxx @@ -72,7 +72,7 @@ static Standard_Real Penalite(const Standard_Real angle, penal = dist + 2; if (angle > 1.e-3) { - penal += 1./angle -2./PI; + penal += 1./angle -2./M_PI; } else { penal += 1.e3; @@ -86,7 +86,7 @@ static Standard_Real EvalAngle(const gp_Vec& V1, { Standard_Real angle; angle = V1.Angle(V2); - if (angle > PI/2) angle = PI - angle; + if (angle > M_PI/2) angle = M_PI - angle; return angle; } @@ -393,7 +393,7 @@ void GeomFill_SectionPlacement::Perform(const Handle(Adaptor3d_HCurve)& Path, { Extrema_ExtPC Projector(myPoint, Path->Curve(), Precision::Confusion()); DistMini( Projector, Path->Curve(), Dist, PathParam ); - AngleMax = PI/2; + AngleMax = M_PI/2; } else { @@ -416,7 +416,7 @@ void GeomFill_SectionPlacement::Perform(const Handle(Adaptor3d_HCurve)& Path, } } AngleMax = EvalAngle(VRef, dp1); - if (isplan) AngleMax = PI/2 - AngleMax; + if (isplan) AngleMax = M_PI/2 - AngleMax; Standard_Boolean Trouve = Standard_False; Standard_Integer ii; @@ -498,7 +498,7 @@ void GeomFill_SectionPlacement::Perform(const Handle(Adaptor3d_HCurve)& Path, } } AngleMax = EvalAngle(VRef, dp1); - AngleMax = PI/2 - AngleMax; + AngleMax = M_PI/2 - AngleMax; } } @@ -513,7 +513,7 @@ void GeomFill_SectionPlacement::Perform(const Handle(Adaptor3d_HCurve)& Path, Tangente(Path->Curve(), Path->LastParameter(), P, dp1); V1.SetXYZ(TheAxe.Location().XYZ()-P.XYZ()); if (Abs(V1.Dot(VRef)) <= DistPlan ) { // On prend l'autre extremite - alpha = PI/2 - EvalAngle(VRef, dp1); + alpha = M_PI/2 - EvalAngle(VRef, dp1); distaux = PonPath.Distance(PonSec); if (distaux > Tol) { myExt.Perform(P); @@ -545,7 +545,7 @@ void GeomFill_SectionPlacement::Perform(const Handle(Adaptor3d_HCurve)& Path, w = Intersector.Point(ii).W(); //(1.3) test d'angle Tangente( Path->Curve(), w, P, V); - alpha = PI/2 - EvalAngle(V, VRef); + alpha = M_PI/2 - EvalAngle(V, VRef); //(1.4) Test de distance Point-Courbe myExt.Perform(P); if ( myExt.IsDone() ) { @@ -683,7 +683,7 @@ void GeomFill_SectionPlacement::Perform(const Standard_Real Param, { gp_Pnt PonPath = Path->Value( PathParam ); Dist = PonPath.Distance(myPoint); - AngleMax = PI/2; + AngleMax = M_PI/2; } else { @@ -706,7 +706,7 @@ void GeomFill_SectionPlacement::Perform(const Standard_Real Param, } } AngleMax = EvalAngle(VRef, dp1); - if (isplan) AngleMax = PI/2 - AngleMax; + if (isplan) AngleMax = M_PI/2 - AngleMax; } done = Standard_True; diff --git a/src/GeomFill/GeomFill_Sweep.cxx b/src/GeomFill/GeomFill_Sweep.cxx index 4d357c7afa..4cc94cb443 100755 --- a/src/GeomFill/GeomFill_Sweep.cxx +++ b/src/GeomFill/GeomFill_Sweep.cxx @@ -596,8 +596,8 @@ static Standard_Boolean IsSweepParallelSpine (const Handle(GeomFill_LocationLaw) IsOpposite(axe.Direction(), 0.1) ) { Standard_Real f, l; // L'orientation parametrique est inversee - l = 2*PI - UFirst; - f = 2*PI - ULast; + l = 2*M_PI - UFirst; + f = 2*M_PI - ULast; UFirst = f; ULast = l; isUReversed = Standard_True; @@ -665,7 +665,7 @@ static Standard_Boolean IsSweepParallelSpine (const Handle(GeomFill_LocationLaw) gp_Vec L(P1, P2), Dir(Centre1,Centre2); Angle = L.Angle(Dir); - if ((Angle > 0.01) && (Angle < PI/2-0.01)) { + if ((Angle > 0.01) && (Angle < M_PI/2-0.01)) { if (R2IsConstant(error)) { // La trajectoire gp_Pnt Centre; - isVPeriodic = (Abs(Last-First -2*PI) < 1.e-15); + isVPeriodic = (Abs(Last-First -2*M_PI) < 1.e-15); Standard_Real RotRadius; gp_Vec DP, DS, DN; myLoc->D0(0.1, M, DS); @@ -784,8 +784,8 @@ static Standard_Boolean IsSweepParallelSpine (const Handle(GeomFill_LocationLaw) if (C.Position().Direction(). IsOpposite(AxisOfSphere.YDirection(), 0.1) ) { // L'orientation parametrique est inversee - l = 2*PI - UFirst; - f = 2*PI - ULast; + l = 2*M_PI - UFirst; + f = 2*M_PI - ULast; isUReversed = Standard_True; } // On calcul le "glissement" parametrique. @@ -795,7 +795,7 @@ static Standard_Boolean IsSweepParallelSpine (const Handle(GeomFill_LocationLaw) f -= rot; l -= rot; - if ( (f >= -PI/2) && (l <= PI/2)) { + if ( (f >= -M_PI/2) && (l <= M_PI/2)) { Ok = Standard_True; myExchUV = Standard_True; UFirst = f; @@ -823,8 +823,8 @@ static Standard_Boolean IsSweepParallelSpine (const Handle(GeomFill_LocationLaw) IsOpposite(axeiso.Direction(), 0.1) ) { Standard_Real f, l; // L'orientation parametrique est inversee - l = 2*PI - UFirst; - f = 2*PI - ULast; + l = 2*M_PI - UFirst; + f = 2*M_PI - ULast; UFirst = f; ULast = l; isUReversed = Standard_True; @@ -887,13 +887,13 @@ static Standard_Boolean IsSweepParallelSpine (const Handle(GeomFill_LocationLaw) else { // On evalue l'angle du cone Standard_Real Angle = Abs(Dir.Angle(L)); - if (Angle > PI/2) Angle = PI -Angle; + if (Angle > M_PI/2) Angle = M_PI -Angle; if (reverse) Angle = -Angle; aux = DS.Dot(DL); if (aux < 0) { Angle = - Angle; } - if (Abs(Abs(Angle) - PI/2) > 0.01) { + if (Abs(Abs(Angle) - M_PI/2) > 0.01) { // (2.2.b) Cone // si les 2 droites ne sont pas orthogonales Standard_Real Radius = CentreOfSurf.Distance(L.Location()); diff --git a/src/GeomFill/GeomFill_SweepSectionGenerator.cxx b/src/GeomFill/GeomFill_SweepSectionGenerator.cxx index f745050873..25892e3ce7 100755 --- a/src/GeomFill/GeomFill_SweepSectionGenerator.cxx +++ b/src/GeomFill/GeomFill_SweepSectionGenerator.cxx @@ -319,11 +319,11 @@ void GeomFill_SweepSectionGenerator::Perform(const Standard_Boolean Polynomial) myFirstSect = GeomConvert::CurveToBSplineCurve(Circ); // le cercle est segmente car AppBlend_AppSurf ne gere // pas les courbes periodiques. - myFirstSect->Segment(0., 2.*PI); + myFirstSect->Segment(0., 2.*M_PI); */ Handle(Geom_TrimmedCurve) Circ = new Geom_TrimmedCurve(new Geom_Circle( CircleAxis, myRadius), - 0., 2.*PI); + 0., 2.*M_PI); myFirstSect = GeomConvert::CurveToBSplineCurve(Circ,Convert_QuasiAngular); } @@ -414,7 +414,7 @@ void GeomFill_SweepSectionGenerator::Knots(TColStd_Array1OfReal& TKnots) const { /* if (myType == 1) { - Standard_Real U = 2.*PI/3.; + Standard_Real U = 2.*M_PI/3.; for ( Standard_Integer i = 1; i <= 4; i++) TKnots(i) = ( i-1) * U; } diff --git a/src/GeomInt/GeomInt_IntSS_1.cxx b/src/GeomInt/GeomInt_IntSS_1.cxx index 4b0f978e32..15fc28f713 100755 --- a/src/GeomInt/GeomInt_IntSS_1.cxx +++ b/src/GeomInt/GeomInt_IntSS_1.cxx @@ -395,7 +395,7 @@ Standard_Real ProjectPointOnSurf::LowerDistance() const // aRealEpsilon=RealEpsilon(); aNul=0.; - aPeriod=PI+PI; + aPeriod=M_PI+M_PI; // aNbParts=myLConstruct.NbParts(); // @@ -435,12 +435,12 @@ Standard_Real ProjectPointOnSurf::LowerDistance() const slineS2.Append(H1); } //============================================== - } //if (Abs(fprm) > RealEpsilon() || Abs(lprm-2.*PI) > RealEpsilon()) + } //if (Abs(fprm) > RealEpsilon() || Abs(lprm-2.*M_PI) > RealEpsilon()) // else {// on regarde si on garde // if (aNbParts==1) { - if (Abs(fprm) < RealEpsilon() && Abs(lprm-2.*PI) < RealEpsilon()) { + if (Abs(fprm) < RealEpsilon() && Abs(lprm-2.*M_PI) < RealEpsilon()) { Handle(Geom_TrimmedCurve) aTC3D=new Geom_TrimmedCurve(newc,fprm,lprm); // sline.Append(aTC3D); @@ -476,7 +476,7 @@ Standard_Real ProjectPointOnSurf::LowerDistance() const // Standard_Real aTwoPIdiv17, u1, v1, u2, v2, TolX; // - aTwoPIdiv17=2.*PI/17.; + aTwoPIdiv17=2.*M_PI/17.; // for (j=0; j<=17; j++) { gp_Pnt ptref (newc->Value (j*aTwoPIdiv17)); @@ -1518,7 +1518,7 @@ Standard_Boolean DecompositionOfWLine(const Handle(IntPatch_WLine)& theWLine, else { Standard_Real anAngle = aNewVec.Angle(aVecOld); - if((fabs(anAngle) < (Standard_PI * 0.25)) && (aNewVec.Dot(aVecOld) > 0.)) { + if((fabs(anAngle) < (M_PI * 0.25)) && (aNewVec.Dot(aVecOld) > 0.)) { if(bCheckAngle1) { Standard_Real U1, U2, V1, V2; diff --git a/src/GeomInt/GeomInt_LineConstructor.cxx b/src/GeomInt/GeomInt_LineConstructor.cxx index ba3af3751f..3b16da1fb9 100755 --- a/src/GeomInt/GeomInt_LineConstructor.cxx +++ b/src/GeomInt/GeomInt_LineConstructor.cxx @@ -88,28 +88,28 @@ static void Recadre(const Handle(GeomAdaptor_HSurface)& myHS1, } } if(myHS1IsUPeriodic) { - const Standard_Real lmf = PI+PI; //-- myHS1->UPeriod(); + const Standard_Real lmf = M_PI+M_PI; //-- myHS1->UPeriod(); const Standard_Real f = myHS1->FirstUParameter(); const Standard_Real l = myHS1->LastUParameter(); while(u1 < f) { u1+=lmf; } while(u1 > l) { u1-=lmf; } } if(myHS1IsVPeriodic) { - const Standard_Real lmf = PI+PI; //-- myHS1->VPeriod(); + const Standard_Real lmf = M_PI+M_PI; //-- myHS1->VPeriod(); const Standard_Real f = myHS1->FirstVParameter(); const Standard_Real l = myHS1->LastVParameter(); while(v1 < f) { v1+=lmf; } while(v1 > l) { v1-=lmf; } } if(myHS2IsUPeriodic) { - const Standard_Real lmf = PI+PI; //-- myHS2->UPeriod(); + const Standard_Real lmf = M_PI+M_PI; //-- myHS2->UPeriod(); const Standard_Real f = myHS2->FirstUParameter(); const Standard_Real l = myHS2->LastUParameter(); while(u2 < f) { u2+=lmf; } while(u2 > l) { u2-=lmf; } } if(myHS2IsVPeriodic) { - const Standard_Real lmf = PI+PI; //-- myHS2->VPeriod(); + const Standard_Real lmf = M_PI+M_PI; //-- myHS2->VPeriod(); const Standard_Real f = myHS2->FirstVParameter(); const Standard_Real l = myHS2->LastVParameter(); while(v2 < f) { v2+=lmf; } @@ -260,12 +260,12 @@ void GeomInt_LineConstructor::Perform(const Handle(IntPatch_Line)& L) if(typl == IntPatch_Circle || typl == IntPatch_Ellipse) { firstp = GeomInt_LineTool::Vertex(L,nbvtx).ParameterOnLine(); - lastp = PI + PI + GeomInt_LineTool::Vertex(L,1).ParameterOnLine(); + lastp = M_PI + M_PI + GeomInt_LineTool::Vertex(L,1).ParameterOnLine(); const Standard_Real cadrinf = GeomInt_LineTool::FirstParameter(L); const Standard_Real cadrsup = GeomInt_LineTool::LastParameter(L); Standard_Real acadr = (firstp+lastp)*0.5; - while(acadr < cadrinf) { acadr+=PI+PI; } - while(acadr > cadrsup) { acadr-=PI+PI; } + while(acadr < cadrinf) { acadr+=M_PI+M_PI; } + while(acadr > cadrsup) { acadr-=M_PI+M_PI; } if(acadr>=cadrinf && acadr<=cadrsup) { if(Abs(firstp-lastp)>Precision::PConfusion()) @@ -605,7 +605,7 @@ void GeomInt_LineConstructor::PeriodicLine (const Handle(IntPatch_Line)& L) cons } } if (changevtx) { - thevtx.SetParameter(prm + 2.*PI); + thevtx.SetParameter(prm + 2.*M_PI); glin->Replace(i,thevtx); } } diff --git a/src/GeomInt/GeomInt_LineTool.cxx b/src/GeomInt/GeomInt_LineTool.cxx index 57fe27b720..d74631dd87 100755 --- a/src/GeomInt/GeomInt_LineTool.cxx +++ b/src/GeomInt/GeomInt_LineTool.cxx @@ -145,7 +145,7 @@ Standard_Real GeomInt_LineTool::LastParameter (const Handle(IntPatch_Line)& L) return Precision::Infinite(); case IntPatch_Circle: case IntPatch_Ellipse: - return 2.*PI; + return 2.*M_PI; default: break; } } diff --git a/src/GeomLib/GeomLib_IsPlanarSurface.cxx b/src/GeomLib/GeomLib_IsPlanarSurface.cxx index 017fafadbe..331428f5bd 100755 --- a/src/GeomLib/GeomLib_IsPlanarSurface.cxx +++ b/src/GeomLib/GeomLib_IsPlanarSurface.cxx @@ -74,13 +74,13 @@ static Standard_Boolean Controle(const TColgp_Array1OfPnt& Poles, gp_Dir du(DU); Standard_Real Angle1 = du.Angle(DX); Standard_Real Angle2 = du.Angle(DY); - if (Angle1 > PI/2) Angle1 = PI-Angle1; - if (Angle2 > PI/2) Angle2 = PI-Angle2; + if (Angle1 > M_PI/2) Angle1 = M_PI-Angle1; + if (Angle2 > M_PI/2) Angle2 = M_PI-Angle2; if (Angle2 < Angle1) { du = DY; DY = DX; DX = du; } - if (DX.Angle(DU) > PI/2) DX.Reverse(); - if (DY.Angle(DV) > PI/2) DY.Reverse(); + if (DX.Angle(DU) > M_PI/2) DX.Reverse(); + if (DY.Angle(DV) > M_PI/2) DY.Reverse(); gp_Ax3 axe(Bary, DX^DY, DX); Plan.SetPosition(axe); @@ -227,8 +227,8 @@ GeomLib_IsPlanarSurface::GeomLib_IsPlanarSurface(const Handle(Geom_Surface)& S, Dn = DU^DV; if (Dn.Magnitude() > 1.e-7) { Standard_Real angle = Dir.Angle(Dn); - if (angle > PI/2) { - angle = PI - angle; + if (angle > M_PI/2) { + angle = M_PI - angle; Dir.Reverse(); } Essai = (angle < 0.1); diff --git a/src/GeomPlate/GeomPlate_BuildAveragePlane.cxx b/src/GeomPlate/GeomPlate_BuildAveragePlane.cxx index 9c0023c3e1..9ccf5b9fb6 100755 --- a/src/GeomPlate/GeomPlate_BuildAveragePlane.cxx +++ b/src/GeomPlate/GeomPlate_BuildAveragePlane.cxx @@ -288,9 +288,9 @@ gp_Vec GeomPlate_BuildAveragePlane::DefPlan(const Standard_Integer NOption) } gp_Vec OZ1 = A; Standard_Real theAngle = OZ.Angle( OZ1 ); - if (theAngle > PI/2) - theAngle = PI - theAngle; - if (theAngle > PI/3) + if (theAngle > M_PI/2) + theAngle = M_PI - theAngle; + if (theAngle > M_PI/3) OZ = OZ1; } } diff --git a/src/GeomPlate/GeomPlate_BuildPlateSurface.cxx b/src/GeomPlate/GeomPlate_BuildPlateSurface.cxx index 72a5b6f049..6c55b42e91 100755 --- a/src/GeomPlate/GeomPlate_BuildPlateSurface.cxx +++ b/src/GeomPlate/GeomPlate_BuildPlateSurface.cxx @@ -752,8 +752,8 @@ EcartContraintesMil ( const Standard_Integer c, d->ChangeValue(i) = Pf.Distance(Pi); v3i = v1i^v2i; v3f=v1f^v2f; Standard_Real angle=v3f.Angle(v3i); - if (angle>(PI/2)) - an->ChangeValue(i) = PI -angle; + if (angle>(M_PI/2)) + an->ChangeValue(i) = M_PI -angle; else an->ChangeValue(i) = angle; courb->Init(0); @@ -1791,8 +1791,8 @@ Intersect(Handle(GeomPlate_HArray1OfSequenceOfReal)& PntInter, myLinCont->Value(j)->D2( int2d.ParamOnSecond(), P2, v21, v22, v23, v24, v25 ); v16=v11^v12;v26=v21^v22; Standard_Real ant=v16.Angle(v26); - if (ant>(PI/2)) - ant= PI -ant; + if (ant>(M_PI/2)) + ant= M_PI -ant; if ((Abs(v16*v15-v16*v25)>(myTol3d/1000)) ||(Abs(ant)>myTol3d/1000)) // Pas compatible ==> on enleve une zone en @@ -1806,12 +1806,12 @@ Intersect(Handle(GeomPlate_HArray1OfSequenceOfReal)& PntInter, myLinCont->Value(i)->Curve2dOnSurf()->D1( int2d.ParamOnFirst(), P1, V1); myLinCont->Value(j)->Curve2dOnSurf()->D1( int2d.ParamOnSecond(), P2, V2); A1 = V1.Angle(V2); - if (A1>(PI/2)) - A1= PI - A1; - if (Abs(Abs(A1)-PI)(M_PI/2)) + A1= M_PI - A1; + if (Abs(Abs(A1)-M_PI) myTolAng/10.) //????????? //if (Abs( scal ) > myTol3d/100) { // Pas compatible ==> on enleve une zone en // contrainte G0 et G1 correspondant @@ -1860,12 +1860,12 @@ Intersect(Handle(GeomPlate_HArray1OfSequenceOfReal)& PntInter, myLinCont->Value(i)->Curve2dOnSurf()->D1( int2d.ParamOnFirst(), P1, V1); myLinCont->Value(j)->Curve2dOnSurf()->D1( int2d.ParamOnSecond(), P2, V2); A1 = V1.Angle( V2 ); - if (A1 > PI/2) - A1= PI - A1; - if (Abs(Abs(A1) - PI) < myTolAng) Tol = 100000 * myTol3d; + if (A1 > M_PI/2) + A1= M_PI - A1; + if (Abs(Abs(A1) - M_PI) < myTolAng) Tol = 100000 * myTol3d; #if PLATE_DEB if (Affich) cout <<"Angle entre Courbe "<Value(i)->Order() == 1) { @@ -1998,7 +1998,7 @@ Discretise(const Handle(GeomPlate_HArray1OfSequenceOfReal)& PntInter, tabP2d(Nbint+1).SetX(Length2d); for (ii = 2; ii<= Nbint; ii++) { - U = Uinit + (Ufinal-Uinit)*((1-Cos((ii-1)*PI/(Nbint)))/2); + U = Uinit + (Ufinal-Uinit)*((1-Cos((ii-1)*M_PI/(Nbint)))/2); tabP2d(ii).SetY(U); /* if (!HC2d.IsNull()) { Standard_Real L = GCPnts_AbscissaPoint::Length(HC2d->Curve2d(), Uinit, U); @@ -2024,15 +2024,15 @@ Discretise(const Handle(GeomPlate_HArray1OfSequenceOfReal)& PntInter, for (Standard_Integer j=1; j<=NbPnt_i; j++) { // repartition des points en cosinus selon l'ACR 2d // Afin d'eviter les points d'acumulation dans le 2d - //Inter=Uinit+(Uif)*((-cos(PI*((j-1)/(NbPnt_i-1)))+1)/2); + //Inter=Uinit+(Uif)*((-cos(M_PI*((j-1)/(NbPnt_i-1)))+1)/2); if (j==NbPnt_i) Inter=Ufinal;//pour parer au bug sur sun else if (ACR) { - CurLength = Length2d*(1-Cos((j-1)*PI/(NbPnt_i-1)))/2; + CurLength = Length2d*(1-Cos((j-1)*M_PI/(NbPnt_i-1)))/2; Inter = acrlaw->Value(CurLength); } else { - Inter=Uinit+(Ufinal-Uinit)*((1-Cos((j-1)*PI/(NbPnt_i-1)))/2); + Inter=Uinit+(Ufinal-Uinit)*((1-Cos((j-1)*M_PI/(NbPnt_i-1)))/2); } myParCont->ChangeValue(i).Append(Inter);// on ajoute le point if (NbPtInter!=0) @@ -2509,8 +2509,8 @@ void GeomPlate_BuildPlateSurface:: Dist = Pf.Distance(Pi); v3i = v1i^v2i; v3f=v1f^v2f; Ang=v3f.Angle(v3i); - if (Ang>(PI/2)) - Ang = PI -Ang; + if (Ang>(M_PI/2)) + Ang = M_PI -Ang; break; case 2 : Handle(Geom_Surface) Splate; diff --git a/src/GeomPlate/GeomPlate_PlateG1Criterion.cxx b/src/GeomPlate/GeomPlate_PlateG1Criterion.cxx index af880cf850..2743297dbb 100755 --- a/src/GeomPlate/GeomPlate_PlateG1Criterion.cxx +++ b/src/GeomPlate/GeomPlate_PlateG1Criterion.cxx @@ -120,9 +120,9 @@ void GeomPlate_PlateG1Criterion::Value(AdvApp2Var_Patch& P, v2s.SetCoord(3,Digit[2]); v3s=v1s^v2s; - if( v3s.Angle(v3h)>(PI/2)) { - if ((PI-v3s.Angle(v3h))>ang) { - ang=(PI-v3s.Angle(v3h)); + if( v3s.Angle(v3h)>(M_PI/2)) { + if ((M_PI-v3s.Angle(v3h))>ang) { + ang=(M_PI-v3s.Angle(v3h)); } } else { diff --git a/src/GeomToIGES/GeomToIGES_GeomCurve.cxx b/src/GeomToIGES/GeomToIGES_GeomCurve.cxx index 123aec1c37..8271e87c92 100755 --- a/src/GeomToIGES/GeomToIGES_GeomCurve.cxx +++ b/src/GeomToIGES/GeomToIGES_GeomCurve.cxx @@ -522,7 +522,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomCurve::TransferCurve //gka BUG 6542 1.09.04 BSpline curve was written in the IGES instead circle. gp_Pnt pfirst,plast; start->D0(U1,pfirst); - if(Abs (Ufin - Udeb - 2 * PI) <= Precision::PConfusion()) + if(Abs (Ufin - Udeb - 2 * M_PI) <= Precision::PConfusion()) plast = pfirst; else start->D0(U2,plast); @@ -568,12 +568,12 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomCurve::TransferCurve //#35 rln 22.10.98 BUC60391 face 9 //Closed Conic Arc is incorrectly oriented when reading back to CAS.CADE - if (Abs (Ufin - Udeb - 2 * PI) <= Precision::PConfusion()) { + if (Abs (Ufin - Udeb - 2 * M_PI) <= Precision::PConfusion()) { //#53 rln 24.12.98 CCI60005 //Trimmed ellipse. To avoid huge weights in B-Spline first rotate it and then convert Handle(Geom_Ellipse) copystart = Handle(Geom_Ellipse)::DownCast (start->Copy()); gp_Ax2 pos = copystart->Position(); - copystart->SetPosition (pos.Rotated (pos.Axis(), gp_Ax3 (pos).Direct() ? Udeb : 2 * PI - Udeb)); + copystart->SetPosition (pos.Rotated (pos.Axis(), gp_Ax3 (pos).Direct() ? Udeb : 2 * M_PI - Udeb)); Handle(Geom_BSplineCurve) Bspline; //:q3 abv 17 Mar 99: use GeomConvert_ApproxCurve for precise conversion GeomConvert_ApproxCurve approx (copystart, Precision::Approximation(), @@ -583,7 +583,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomCurve::TransferCurve GeomConvert::CurveToBSplineCurve (copystart, Convert_QuasiAngular); TColStd_Array1OfReal Knots(1, Bspline->NbKnots()); Bspline->Knots (Knots); - BSplCLib::Reparametrize (Udeb, Udeb + 2 * PI, Knots); + BSplCLib::Reparametrize (Udeb, Udeb + 2 * M_PI, Knots); Bspline->SetKnots (Knots); return TransferCurve (Bspline, Udeb, Ufin); } diff --git a/src/GeomToIGES/GeomToIGES_GeomSurface.cxx b/src/GeomToIGES/GeomToIGES_GeomSurface.cxx index c0169feeb0..6bc7849716 100755 --- a/src/GeomToIGES/GeomToIGES_GeomSurface.cxx +++ b/src/GeomToIGES/GeomToIGES_GeomSurface.cxx @@ -582,7 +582,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomSurface::TransferSurface //Axis->Init(gp_XYZ(0.0, 0.0, 0.0), gp_XYZ(0.0, 0.0, 1.0/GetUnit())); //Surf->Init (Axis, Generatrix, U1, U2); Axis->Init(gp_XYZ (0, 0, 1. / GetUnit()), gp_XYZ (0, 0, 0)); - Surf->Init (Axis, Generatrix, 2 * PI - U2, 2 * PI - U1); + Surf->Init (Axis, Generatrix, 2 * M_PI - U2, 2 * M_PI - U1); // creation de la Trsf (#124) @@ -660,7 +660,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomSurface::TransferSurface //Axis->Init(gp_XYZ(0.0, 0.0, 0.0), gp_XYZ(0.0, 0.0, 1.0/GetUnit())); //Surf->Init (Axis, Generatrix, U1, U2); Axis->Init(gp_XYZ (0, 0, 1. / GetUnit()), gp_XYZ (0, 0, 0)); - Surf->Init (Axis, Generatrix, 2 * PI - U2, 2 * PI - U1); + Surf->Init (Axis, Generatrix, 2 * M_PI - U2, 2 * M_PI - U1); // creation de la Trsf (#124) @@ -735,7 +735,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomSurface::TransferSurface if ( Gen->IsKind(STANDARD_TYPE(IGESGeom_CircularArc))) { //#30 rln 19.10.98 Surf->Init (Axis, Gen, U1, U2); - Surf->Init (Axis, Gen, 2 * PI - U2, 2 * PI - U1); + Surf->Init (Axis, Gen, 2 * M_PI - U2, 2 * M_PI - U1); IGESConvGeom_GeomBuilder Build; Standard_Real xloc,yloc,zloc; start->Sphere().Location().Coord(xloc,yloc,zloc); @@ -807,7 +807,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomSurface::TransferSurface //:l6 abv: CTS22022: writing full tori: if ( Gen->IsKind(STANDARD_TYPE(IGESGeom_CircularArc))) { //#30 rln 19.10.98 Surf->Init (Axis, Gen, U1, U2); - Surf->Init (Axis, Gen, 2 * PI - U2, 2 * PI - U1); + Surf->Init (Axis, Gen, 2 * M_PI - U2, 2 * M_PI - U1); IGESConvGeom_GeomBuilder Build; /* //:l6: useless Standard_Real xloc,yloc,zloc; @@ -994,7 +994,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomSurface::TransferSurface Axis->Init(gp_XYZ(X1/GetUnit(),Y1/GetUnit(),Z1/GetUnit()), gp_XYZ( (X1 - X2) / GetUnit(), (Y1 - Y2) / GetUnit(), (Z1 - Z2) / GetUnit())); - Surf->Init (Axis, Generatrix, 2 * PI - U2, 2 * PI - U1); + Surf->Init (Axis, Generatrix, 2 * M_PI - U2, 2 * M_PI - U1); res = Surf; return res; @@ -1178,7 +1178,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomSurface::TransferConicalSurface(const Handle(Geom_Direction) rdir = new Geom_Direction(XDir);//XAxe.Direction()); Handle(IGESGeom_Direction) refdir = GV.TransferVector(rdir); - ConSurf->Init (aLocation, Axis, radius, angle*180./PI, refdir); + ConSurf->Init (aLocation, Axis, radius, angle*180./M_PI, refdir); res = ConSurf; return res; } diff --git a/src/GeomToStep/GeomToStep_MakeConicalSurface.cxx b/src/GeomToStep/GeomToStep_MakeConicalSurface.cxx index b40e67e9c4..bf18831158 100755 --- a/src/GeomToStep/GeomToStep_MakeConicalSurface.cxx +++ b/src/GeomToStep/GeomToStep_MakeConicalSurface.cxx @@ -31,7 +31,7 @@ GeomToStep_MakeConicalSurface::GeomToStep_MakeConicalSurface aPosition = MkAxis.Value(); aRadius = CS->RefRadius(); aSemiAngle = CS->SemiAngle(); - if (aSemiAngle < 0. || aSemiAngle > PI/2.) { + if (aSemiAngle < 0. || aSemiAngle > M_PI/2.) { Standard_DomainError::Raise("Conicalsurface not STEP conformant"); } diff --git a/src/GeomToStep/GeomToStep_MakeRectangularTrimmedSurface.cxx b/src/GeomToStep/GeomToStep_MakeRectangularTrimmedSurface.cxx index fe70c89ccb..07af5a27ef 100755 --- a/src/GeomToStep/GeomToStep_MakeRectangularTrimmedSurface.cxx +++ b/src/GeomToStep/GeomToStep_MakeRectangularTrimmedSurface.cxx @@ -47,7 +47,7 @@ GeomToStep_MakeRectangularTrimmedSurface:: // Modification of the Trimming Parameters ? // ----------------------------------------- - Standard_Real AngleFact = 180./PI; + Standard_Real AngleFact = 180./M_PI; Standard_Real uFact = 1.; Standard_Real vFact = 1.; Standard_Real LengthFact = UnitsMethods::LengthFactor(); diff --git a/src/GeometryTest/GeometryTest_ConstraintCommands.cxx b/src/GeometryTest/GeometryTest_ConstraintCommands.cxx index 00c1c184f0..d537aa96a1 100755 --- a/src/GeometryTest/GeometryTest_ConstraintCommands.cxx +++ b/src/GeometryTest/GeometryTest_ConstraintCommands.cxx @@ -395,7 +395,7 @@ static Standard_Integer lintang (Draw_Interpretor& di,Standard_Integer n, const di << "Second argument must be a line"; return 1; } - Standard_Real ang = atof(a[4]) * PI180; + Standard_Real ang = atof(a[4]) * (M_PI / 180.0); Geom2dGcc_Lin2dTanObl ct3(Geom2dGcc::Unqualified(C1), L->Lin2d(), Precision::Angular(), diff --git a/src/GeometryTest/GeometryTest_FairCurveCommands.cxx b/src/GeometryTest/GeometryTest_FairCurveCommands.cxx index 64c89ba81c..50a9c82cd5 100755 --- a/src/GeometryTest/GeometryTest_FairCurveCommands.cxx +++ b/src/GeometryTest/GeometryTest_FairCurveCommands.cxx @@ -58,8 +58,8 @@ BattenCurve(Draw_Interpretor& di, Standard_Integer argc, const char** argv) if (! DrawTrSurf::GetPoint2d(cp2, P2) ) return 1; FairCurve_Batten* Bat = new FairCurve_Batten (P1, P2, h); - Bat->SetAngle1(a1*PI/180); - Bat->SetAngle2(a2*PI/180); + Bat->SetAngle1(a1*M_PI/180); + Bat->SetAngle2(a2*M_PI/180); Ok = Bat->Compute(Iana); @@ -102,8 +102,8 @@ MVCurve(Draw_Interpretor& di, Standard_Integer argc, const char** argv) if (! DrawTrSurf::GetPoint2d(cp2, P2) ) return 1; FairCurve_MinimalVariation* MVC = new FairCurve_MinimalVariation (P1, P2, h); - MVC->SetAngle1(a1*PI/180); - MVC->SetAngle2(a2*PI/180); + MVC->SetAngle1(a1*M_PI/180); + MVC->SetAngle2(a2*M_PI/180); Ok = MVC->Compute(Iana); diff --git a/src/GeomliteTest/GeomliteTest_SurfaceCommands.cxx b/src/GeomliteTest/GeomliteTest_SurfaceCommands.cxx index 0d134c1708..34d1e67896 100755 --- a/src/GeomliteTest/GeomliteTest_SurfaceCommands.cxx +++ b/src/GeomliteTest/GeomliteTest_SurfaceCommands.cxx @@ -206,7 +206,7 @@ static Standard_Integer anasurface (Draw_Interpretor& , Standard_Real par2 = atof(a[i+1]); if (!strcasecmp(a[0],"cone")) { - par1 *= PI180; + par1 *= (M_PI / 180.0); Handle(Geom_ConicalSurface) C = new Geom_ConicalSurface(loc,par1,par2); result = C; diff --git a/src/Graphic2d/Graphic2d_Circle.cxx b/src/Graphic2d/Graphic2d_Circle.cxx index 30c9c318fa..062fbbaec2 100755 --- a/src/Graphic2d/Graphic2d_Circle.cxx +++ b/src/Graphic2d/Graphic2d_Circle.cxx @@ -39,7 +39,7 @@ Graphic2d_Circle::Graphic2d_Circle DoMinMax(); myFirstAngle = 0.; - mySecondAngle = Standard_ShortReal(2.*Standard_PI); + mySecondAngle = Standard_ShortReal(2. * M_PI); myisArc = Standard_False; myNumOfElem = MAXPOINTS + 1; myNumOfVert = 3; @@ -61,13 +61,13 @@ Graphic2d_Circle::Graphic2d_Circle myNumOfElem = MAXPOINTS + 1; myNumOfVert = 3; #ifdef PRO3730 - Standard_ShortReal TwoPI = Standard_ShortReal(2.*Standard_PI); + Standard_ShortReal TwoPI = Standard_ShortReal(2. * M_PI); myFirstAngle = Standard_ShortReal (Alpha); mySecondAngle = Standard_ShortReal (Beta); while( myFirstAngle < 0. ) myFirstAngle += TwoPI; - while( myFirstAngle > 2.*Standard_PI ) myFirstAngle -= TwoPI; + while( myFirstAngle > 2. * M_PI ) myFirstAngle -= TwoPI; while( mySecondAngle < 0. ) mySecondAngle += TwoPI; - while( mySecondAngle > 2.*Standard_PI ) mySecondAngle -= TwoPI; + while( mySecondAngle > 2. * M_PI ) mySecondAngle -= TwoPI; if( mySecondAngle < myFirstAngle ) mySecondAngle += TwoPI; if ( (mySecondAngle - myFirstAngle < ShortRealEpsilon()) || (mySecondAngle - myFirstAngle >= TwoPI) ) { @@ -86,7 +86,7 @@ Graphic2d_Circle::Graphic2d_Circle myMaxY = myMaxY < Ycur ? Ycur : myMaxY; for( Acur = 0.,Xcur = 1.,Ycur = 0.; - Acur < mySecondAngle; Acur += Standard_ShortReal(Standard_PI/2.) ) { + Acur < mySecondAngle; Acur += Standard_ShortReal(M_PI / 2.) ) { if( Acur > myFirstAngle ) { myMinX = ( myMinX < Xcur ? myMinX : Xcur ); myMaxX = ( myMaxX < Xcur ? Xcur : myMaxX ); @@ -177,7 +177,7 @@ void Graphic2d_Circle::Draw (const Handle(Graphic2d_Drawer)& aDrawer) { E = Standard_Real (e); F = Standard_Real (f); aTrsf.Transforms (A, B); a = Standard_ShortReal (A); b = Standard_ShortReal (B); - if( Abs(f-e) < Standard_ShortReal(2.*Standard_PI) ) { + if( Abs(f-e) < Standard_ShortReal(2. * M_PI) ) { // To calculate new aperture angles // the calculation is done on the trigonometric circle // and in this case the translation is not taken into account diff --git a/src/Graphic2d/Graphic2d_CircleMarker.cxx b/src/Graphic2d/Graphic2d_CircleMarker.cxx index 12245d4cda..f9f02d5146 100755 --- a/src/Graphic2d/Graphic2d_CircleMarker.cxx +++ b/src/Graphic2d/Graphic2d_CircleMarker.cxx @@ -24,7 +24,7 @@ Graphic2d_CircleMarker::Graphic2d_CircleMarker ( myY (Standard_ShortReal (Y)), myRadius (Standard_ShortReal (Radius)), myFirstAngle (0.0), - mySecondAngle (Standard_ShortReal (2.*Standard_PI)) { + mySecondAngle (Standard_ShortReal (2. * M_PI)) { if (myRadius <= RealEpsilon ()) Graphic2d_CircleDefinitionError::Raise ("The radius = 0."); diff --git a/src/Graphic2d/Graphic2d_Drawer.cxx b/src/Graphic2d/Graphic2d_Drawer.cxx index 2a9a515c4b..1b90a16287 100755 --- a/src/Graphic2d/Graphic2d_Drawer.cxx +++ b/src/Graphic2d/Graphic2d_Drawer.cxx @@ -868,14 +868,14 @@ void Graphic2d_Drawer::DrawArc( Standard_ShortReal mx,my,a1,a2,da; mx = Standard_ShortReal(aDeltaX); my = Standard_ShortReal(aDeltaY); - a1 = (Angle1 >= 0.) ? Angle1 : Angle1 + Standard_ShortReal(2.*Standard_PI); - a2 = (Angle2 >= 0.) ? Angle2 : Angle2 + Standard_ShortReal(2.*Standard_PI); + a1 = (Angle1 >= 0.) ? Angle1 : Angle1 + Standard_ShortReal(2. * M_PI); + a2 = (Angle2 >= 0.) ? Angle2 : Angle2 + Standard_ShortReal(2. * M_PI); if( a2 > a1 ) { da = a2 - a1; } else if( a2 < a1 ) { - da = Standard_ShortReal(2.*Standard_PI + a2 - a1); + da = Standard_ShortReal(2. * M_PI + a2 - a1); } else { - a1 = 0.; da = Standard_ShortReal(2.*Standard_PI); + a1 = 0.; da = Standard_ShortReal(2. * M_PI); } if( aRadius > 0. ) { // Try to use hardware first @@ -959,14 +959,14 @@ void Graphic2d_Drawer::DrawPolyArc( Standard_ShortReal mx,my,a1,a2,da; mx = Standard_ShortReal(aDeltaX); my = Standard_ShortReal(aDeltaY); - a1 = (Angle1 >= 0.) ? Angle1 : Angle1 + Standard_ShortReal(2.*Standard_PI); - a2 = (Angle2 >= 0.) ? Angle2 : Angle2 + Standard_ShortReal(2.*Standard_PI); + a1 = (Angle1 >= 0.) ? Angle1 : Angle1 + Standard_ShortReal(2. * M_PI); + a2 = (Angle2 >= 0.) ? Angle2 : Angle2 + Standard_ShortReal(2. * M_PI); if( a2 > a1 ) { da = a2 - a1; } else if( a2 < a1 ) { - da = Standard_ShortReal(2.*Standard_PI + a2 - a1); + da = Standard_ShortReal(2. * M_PI + a2 - a1); } else { - a1 = 0.; da = Standard_ShortReal(2.*Standard_PI); + a1 = 0.; da = Standard_ShortReal(2. * M_PI); } if( aRadius > 0. ) { // Try to use hardware first diff --git a/src/Graphic2d/Graphic2d_Ellips.cxx b/src/Graphic2d/Graphic2d_Ellips.cxx index 25e219f946..20aa8ab5df 100755 --- a/src/Graphic2d/Graphic2d_Ellips.cxx +++ b/src/Graphic2d/Graphic2d_Ellips.cxx @@ -61,7 +61,7 @@ Graphic2d_Ellips::Graphic2d_Ellips else { Standard_ShortReal X1, Y1, X2, Y2; Standard_Integer nbpoints = 360; // fobenselitmiter - Standard_ShortReal teta = Standard_ShortReal(2 * Standard_PI / nbpoints); + Standard_ShortReal teta = Standard_ShortReal(2 * M_PI / nbpoints); Standard_ShortReal x1 = Standard_ShortReal(myMajorRadius * Cos (myAngle)); Standard_ShortReal y1 = Standard_ShortReal(myMajorRadius * Sin (myAngle)); Standard_ShortReal x2, y2; @@ -126,10 +126,10 @@ Standard_Boolean IsIn = Standard_False; val = Max( 0.0044 , Min (0.7854 , 2. * ACos(1.-Def/myMajorRadius))); else val = 0.7854; // = PI/4. - Standard_Integer nbpoints = Min(MAXPOINTS,Standard_Integer(2*Standard_PI/val)+2); + Standard_Integer nbpoints = Min(MAXPOINTS,Standard_Integer(2 * M_PI / val) + 2); // Standard_Integer nbpoints = Max ( 8 ,Standard_Integer ( myMajorRadius / Def)); - Standard_ShortReal teta = Standard_ShortReal(2*Standard_PI /nbpoints); + Standard_ShortReal teta = Standard_ShortReal(2 * M_PI / nbpoints); Standard_ShortReal x1 = Standard_ShortReal(myMajorRadius *Cos (myAngle)), y1 = Standard_ShortReal(myMajorRadius *Sin (myAngle)); Standard_ShortReal x2,y2; diff --git a/src/Graphic2d/Graphic2d_EllipsMarker.cxx b/src/Graphic2d/Graphic2d_EllipsMarker.cxx index 3fda9668b8..ca22624607 100755 --- a/src/Graphic2d/Graphic2d_EllipsMarker.cxx +++ b/src/Graphic2d/Graphic2d_EllipsMarker.cxx @@ -71,11 +71,11 @@ void Graphic2d_EllipsMarker::Draw (const Handle(Graphic2d_Drawer)& aDrawer) { if(myMajorRadius > Def) val = Max( 0.0044 , Min (0.7854 , 2. * ACos(1.-Def/myMajorRadius))); else - val = 0.7854; // = Standard_PI/4. - Standard_Integer nbpoints = Min(MAXPOINTS,Standard_Integer(2*Standard_PI/val)+2); + val = 0.7854; // = PI/4. + Standard_Integer nbpoints = Min(MAXPOINTS,Standard_Integer(2 * M_PI / val)+2); // Standard_Integer nbpoints = Max ( 8 ,Standard_Integer ( myMajorRadius / Def)); - Standard_ShortReal teta = Standard_ShortReal( 2*Standard_PI /nbpoints); + Standard_ShortReal teta = Standard_ShortReal(2 * M_PI / nbpoints); Standard_ShortReal x1 = Standard_ShortReal( myMajorRadius *Cos (myAngle)), y1 = Standard_ShortReal( myMajorRadius *Sin (myAngle)); Standard_ShortReal x2,y2; diff --git a/src/Graphic2d/Graphic2d_HidingGraphicObject.cxx b/src/Graphic2d/Graphic2d_HidingGraphicObject.cxx index 69ee6a7023..7dc0a8958c 100755 --- a/src/Graphic2d/Graphic2d_HidingGraphicObject.cxx +++ b/src/Graphic2d/Graphic2d_HidingGraphicObject.cxx @@ -146,13 +146,13 @@ void Graphic2d_HidingGraphicObject::Draw (const Handle(Graphic2d_Drawer)& aDrawe if( type == Aspect_TOD_RELATIVE) { precis = radius * coef; } - Standard_ShortReal value = Standard_ShortReal(Standard_PI/4.); + Standard_ShortReal value = Standard_ShortReal(M_PI / 4.); if( radius > precis ) value = Standard_ShortReal(Max( 0.0044 , Min (0.7854 , 2. * ACos(1.-precis/radius)))); Standard_Integer n = Min(MAX_POINTS, - Standard_Integer(2.*Standard_PI/value)+2); - Standard_ShortReal da = Standard_ShortReal(2.*Standard_PI/n); + Standard_Integer(2. * M_PI / value)+2); + Standard_ShortReal da = Standard_ShortReal(2. * M_PI / n); Standard_ShortReal cosin = Standard_ShortReal(Cos(da)); Standard_ShortReal x1 = radius; Standard_ShortReal y1 = 0.; diff --git a/src/Graphic2d/Graphic2d_Line.cxx b/src/Graphic2d/Graphic2d_Line.cxx index 54ae7737bf..9935c87c69 100755 --- a/src/Graphic2d/Graphic2d_Line.cxx +++ b/src/Graphic2d/Graphic2d_Line.cxx @@ -154,7 +154,7 @@ Standard_Boolean Graphic2d_Line::IsIn ( const Standard_ShortReal aX, cosin = prosca / norme1 / norme2; if ( cosin >= 1 ) angle = 0.; else { - if ( cosin <= -1) angle = - Standard_PI; + if ( cosin <= -1) angle = - M_PI; else angle = Sign ( ACos ( cosin ) , provec ); } diff --git a/src/Graphic2d/Graphic2d_Paragraph.cxx b/src/Graphic2d/Graphic2d_Paragraph.cxx index 4a6346ba0a..d55991d1b9 100755 --- a/src/Graphic2d/Graphic2d_Paragraph.cxx +++ b/src/Graphic2d/Graphic2d_Paragraph.cxx @@ -84,8 +84,8 @@ Graphic2d_Paragraph::Graphic2d_Paragraph myTextHScaleList(), myTextWScaleList() { - while (myAngle < 0.) myAngle += Standard_ShortReal( 2.*Standard_PI ); - while (myAngle >= 2.*Standard_PI) myAngle -= Standard_ShortReal( 2.*Standard_PI ); + while (myAngle < 0.) myAngle += Standard_ShortReal( 2. * M_PI ); + while (myAngle >= 2. * M_PI) myAngle -= Standard_ShortReal( 2. * M_PI ); SetZoomable() ; SetSlant() ; @@ -148,8 +148,8 @@ void Graphic2d_Paragraph::SetCurrentUnderline (const Standard_Boolean isUnderlin void Graphic2d_Paragraph::SetSlant (const Quantity_PlaneAngle aSlant) { mySlant = Standard_ShortReal( aSlant ); - while (mySlant < 0.) mySlant += Standard_ShortReal( 2.*Standard_PI ); - while (mySlant >= 2.*Standard_PI) mySlant -= Standard_ShortReal( 2.*Standard_PI ); + while (mySlant < 0.) mySlant += Standard_ShortReal( 2. * M_PI ); + while (mySlant >= 2. * M_PI) mySlant -= Standard_ShortReal( 2. * M_PI ); } void Graphic2d_Paragraph::SetSpacing (const Quantity_Ratio aSpacing) { diff --git a/src/Graphic2d/Graphic2d_Primitive.pxx b/src/Graphic2d/Graphic2d_Primitive.pxx index bdb0793d18..8848799f3d 100755 --- a/src/Graphic2d/Graphic2d_Primitive.pxx +++ b/src/Graphic2d/Graphic2d_Primitive.pxx @@ -3,8 +3,8 @@ #define PRIMITIVE_PXX_INCLUDED #define NEW_ANGLE(a) { \ - int quot = (int) (a/(2.*Standard_PI)); \ - if (Abs(quot) >= 1) a = a - 2.*Standard_PI*quot; \ + int quot = (int) (a/(2. * M_PI)); \ + if (Abs(quot) >= 1) a = a - 2. * M_PI * quot; \ } #define REALEPSILON() (0.0001) @@ -20,17 +20,17 @@ double a; \ if (y < 0.) \ if (-y <= REALEPSILON ()) y = 0.; \ if (x == 0.) { \ - if (y > 0.) z = Standard_PI/2.; \ - else z = - Standard_PI/2.; \ + if (y > 0.) z = M_PI / 2.; \ + else z = - M_PI / 2.; \ } \ if (y == 0.) { \ if (x > 0.) z = 0.; \ - else z = Standard_PI; \ + else z = M_PI; \ } \ if ((x < 0.) && (y > 0.)) { \ a = acos (x); \ - if ((a >= Standard_PI/2.-REALEPSILON ()) && \ - (a <= Standard_PI+REALEPSILON ())) \ + if ((a >= M_PI / 2.-REALEPSILON ()) && \ + (a <= M_PI + REALEPSILON ())) \ z = a; \ else \ z = - a; \ @@ -38,7 +38,7 @@ double a; \ if ((x >= 0.) && (y > 0.)) { \ a = acos (x); \ if ((a >= 0.) && \ - (a <= Standard_PI/2.+REALEPSILON ())) \ + (a <= M_PI / 2. + REALEPSILON ())) \ z = a; \ else \ z = - a; \ @@ -50,7 +50,7 @@ double a; \ if ((x > 0.) && (y < 0.)) { \ a = acos (x); \ if ((a >= 0.) && \ - (a <= Standard_PI/2.+REALEPSILON ())) \ + (a <= M_PI / 2. + REALEPSILON ())) \ z = - a; \ else \ z = a; \ diff --git a/src/Graphic2d/Graphic2d_Text.cxx b/src/Graphic2d/Graphic2d_Text.cxx index dceef76117..fd22dc9949 100755 --- a/src/Graphic2d/Graphic2d_Text.cxx +++ b/src/Graphic2d/Graphic2d_Text.cxx @@ -43,8 +43,8 @@ Graphic2d_Text::Graphic2d_Text SetFamily(Graphic2d_TOP_TEXT); - while (myAngle < 0.) myAngle += Standard_ShortReal(2.*Standard_PI); - while (myAngle >= 2.*Standard_PI) myAngle -= Standard_ShortReal(2.*Standard_PI); + while (myAngle < 0.) myAngle += Standard_ShortReal(2. * M_PI); + while (myAngle >= 2. * M_PI) myAngle -= Standard_ShortReal(2. * M_PI); #ifndef PERF this->ComputeMinMax(); @@ -68,8 +68,8 @@ void Graphic2d_Text::SetFontIndex (const Standard_Integer anIndex) { void Graphic2d_Text::SetSlant (const Quantity_PlaneAngle aSlant) { mySlant = Standard_ShortReal(aSlant); - while (mySlant < 0.) mySlant += Standard_ShortReal(2.*Standard_PI); - while (mySlant >= 2.*Standard_PI) mySlant -= Standard_ShortReal(2.*Standard_PI); + while (mySlant < 0.) mySlant += Standard_ShortReal(2. * M_PI); + while (mySlant >= 2. * M_PI) mySlant -= Standard_ShortReal(2. * M_PI); #ifdef PERF myMinX = myMinY = ShortRealLast (); myMaxX = myMaxY = ShortRealFirst (); diff --git a/src/Graphic3d/Graphic3d_ArrayOfPrimitives.cxx b/src/Graphic3d/Graphic3d_ArrayOfPrimitives.cxx index dac65a3283..cec6f296cb 100755 --- a/src/Graphic3d/Graphic3d_ArrayOfPrimitives.cxx +++ b/src/Graphic3d/Graphic3d_ArrayOfPrimitives.cxx @@ -419,7 +419,7 @@ Standard_Boolean Graphic3d_ArrayOfPrimitives::Orientate( myPrimitiveArray->vertices[i3].xyz[1], myPrimitiveArray->vertices[i3].xyz[2]); gp_Vec v21(p1,p2),v31(p1,p3),fn = v21.Crossed(v31); - if( aNormal.IsOpposite(fn,Standard_PI/4.) ) { + if( aNormal.IsOpposite(fn, M_PI / 4.) ) { Standard_Integer e; char v; for( i=0,j=k-1 ; iedges[n+i]; @@ -436,7 +436,7 @@ Standard_Boolean Graphic3d_ArrayOfPrimitives::Orientate( y = myPrimitiveArray->vnormals[e].xyz[1]; z = myPrimitiveArray->vnormals[e].xyz[2]; gp_Vec vn(x,y,z); - if( aNormal.IsOpposite(vn,Standard_PI/4.) ) { + if( aNormal.IsOpposite(vn, M_PI / 4.) ) { myPrimitiveArray->vnormals[e].xyz[0] = -x; myPrimitiveArray->vnormals[e].xyz[1] = -y; myPrimitiveArray->vnormals[e].xyz[2] = -z; @@ -462,7 +462,7 @@ Standard_Boolean Graphic3d_ArrayOfPrimitives::Orientate( myPrimitiveArray->vertices[n+2].xyz[1], myPrimitiveArray->vertices[n+2].xyz[2]); gp_Vec v21(p1,p2),v31(p1,p3),fn = v21.Crossed(v31); - if( aNormal.IsOpposite(fn,Standard_PI/4.) ) { + if( aNormal.IsOpposite(fn, M_PI / 4.) ) { for( i=0,j=k-1 ; ivertices[n+i].xyz[0]; y = myPrimitiveArray->vertices[n+i].xyz[1]; @@ -488,7 +488,7 @@ Standard_Boolean Graphic3d_ArrayOfPrimitives::Orientate( y = myPrimitiveArray->vnormals[n+i].xyz[1]; z = myPrimitiveArray->vnormals[n+i].xyz[2]; gp_Vec vn(x,y,z); - if( aNormal.IsOpposite(vn,Standard_PI/4.) ) { + if( aNormal.IsOpposite(vn, M_PI / 4.) ) { myPrimitiveArray->vnormals[n+i].xyz[0] = -x; myPrimitiveArray->vnormals[n+i].xyz[1] = -y; myPrimitiveArray->vnormals[n+i].xyz[2] = -z; diff --git a/src/HLRAlgo/HLRAlgo.cxx b/src/HLRAlgo/HLRAlgo.cxx index 727edc2bcf..a5e7ddaa01 100755 --- a/src/HLRAlgo/HLRAlgo.cxx +++ b/src/HLRAlgo/HLRAlgo.cxx @@ -5,20 +5,20 @@ #include -static const Standard_Real cosu0 = cos(0.*PI/14.); -static const Standard_Real sinu0 = sin(0.*PI/14.); -static const Standard_Real cosu1 = cos(1.*PI/14.); -static const Standard_Real sinu1 = sin(1.*PI/14.); -static const Standard_Real cosu2 = cos(2.*PI/14.); -static const Standard_Real sinu2 = sin(2.*PI/14.); -static const Standard_Real cosu3 = cos(3.*PI/14.); -static const Standard_Real sinu3 = sin(3.*PI/14.); -static const Standard_Real cosu4 = cos(4.*PI/14.); -static const Standard_Real sinu4 = sin(4.*PI/14.); -static const Standard_Real cosu5 = cos(5.*PI/14.); -static const Standard_Real sinu5 = sin(5.*PI/14.); -static const Standard_Real cosu6 = cos(6.*PI/14.); -static const Standard_Real sinu6 = sin(6.*PI/14.); +static const Standard_Real cosu0 = cos(0.*M_PI/14.); +static const Standard_Real sinu0 = sin(0.*M_PI/14.); +static const Standard_Real cosu1 = cos(1.*M_PI/14.); +static const Standard_Real sinu1 = sin(1.*M_PI/14.); +static const Standard_Real cosu2 = cos(2.*M_PI/14.); +static const Standard_Real sinu2 = sin(2.*M_PI/14.); +static const Standard_Real cosu3 = cos(3.*M_PI/14.); +static const Standard_Real sinu3 = sin(3.*M_PI/14.); +static const Standard_Real cosu4 = cos(4.*M_PI/14.); +static const Standard_Real sinu4 = sin(4.*M_PI/14.); +static const Standard_Real cosu5 = cos(5.*M_PI/14.); +static const Standard_Real sinu5 = sin(5.*M_PI/14.); +static const Standard_Real cosu6 = cos(6.*M_PI/14.); +static const Standard_Real sinu6 = sin(6.*M_PI/14.); //======================================================================= //function : UpdateMinMax diff --git a/src/HLRBRep/HLRBRep.cxx b/src/HLRBRep/HLRBRep.cxx index cb5f4fddd0..44b9cdb45a 100755 --- a/src/HLRBRep/HLRBRep.cxx +++ b/src/HLRBRep/HLRBRep.cxx @@ -105,9 +105,9 @@ HLRBRep::PolyHLRAngleAndDeflection (const Standard_Real InAngl, Standard_Real& OutAngl, Standard_Real& OutDefl) { - static Standard_Real HAngMin = 1*PI/180; - static Standard_Real HAngLim = 5*PI/180; - static Standard_Real HAngMax = 35*PI/180; + static Standard_Real HAngMin = 1*M_PI/180; + static Standard_Real HAngLim = 5*M_PI/180; + static Standard_Real HAngMax = 35*M_PI/180; OutAngl = InAngl; if (OutAngl < HAngMin) OutAngl = HAngMin; diff --git a/src/HLRBRep/HLRBRep_PolyAlgo.cxx b/src/HLRBRep/HLRBRep_PolyAlgo.cxx index efaeedb27a..356877b41b 100755 --- a/src/HLRBRep/HLRBRep_PolyAlgo.cxx +++ b/src/HLRBRep/HLRBRep_PolyAlgo.cxx @@ -439,7 +439,7 @@ static Standard_Integer IndexPlusOnePerCentThree [] = { 1 , 2 , 0 }; HLRBRep_PolyAlgo::HLRBRep_PolyAlgo () : myDebug (Standard_False), -myAngle (5 * PI / 180.), +myAngle (5 * M_PI / 180.), myTolSta (0.1), myTolEnd (0.9), myTolAngular(0.001) @@ -475,7 +475,7 @@ HLRBRep_PolyAlgo::HLRBRep_PolyAlgo (const Handle(HLRBRep_PolyAlgo)& A) HLRBRep_PolyAlgo::HLRBRep_PolyAlgo (const TopoDS_Shape& S) : myDebug (Standard_False), -myAngle (5 * PI / 180.), +myAngle (5 * M_PI / 180.), myTolSta (0.1), myTolEnd (0.9), myTolAngular(0.001) diff --git a/src/IGESDimen/IGESDimen_FlagNote.cxx b/src/IGESDimen/IGESDimen_FlagNote.cxx index b4d849fbcb..81b64c6a4c 100755 --- a/src/IGESDimen/IGESDimen_FlagNote.cxx +++ b/src/IGESDimen/IGESDimen_FlagNote.cxx @@ -94,5 +94,5 @@ Standard_Real IGESDimen_FlagNote::TipLength () const { - return (0.5 * (Height()/Tan((35./180.)*PI))); + return (0.5 * (Height()/Tan((35./180.)*M_PI))); } diff --git a/src/IGESDimen/IGESDimen_ToolDimensionDisplayData.cxx b/src/IGESDimen/IGESDimen_ToolDimensionDisplayData.cxx index 491c2bccb0..5850da4c50 100755 --- a/src/IGESDimen/IGESDimen_ToolDimensionDisplayData.cxx +++ b/src/IGESDimen/IGESDimen_ToolDimensionDisplayData.cxx @@ -54,7 +54,7 @@ void IGESDimen_ToolDimensionDisplayData::ReadOwnParams if (PR.DefinedElseSkip()) PR.ReadReal(PR.Current(),"Witness Line Angle",tempWitLineAng); //szv#4:S4163:12Mar99 `st=` not needed else - tempWitLineAng = PI / 2; + tempWitLineAng = M_PI / 2; PR.ReadInteger(PR.Current(),"Text Alignment",tempTextAlign); //szv#4:S4163:12Mar99 `st=` not needed if (PR.DefinedElseSkip()) diff --git a/src/IGESDimen/IGESDimen_ToolGeneralNote.cxx b/src/IGESDimen/IGESDimen_ToolGeneralNote.cxx index 79844be0b4..d9be153913 100755 --- a/src/IGESDimen/IGESDimen_ToolGeneralNote.cxx +++ b/src/IGESDimen/IGESDimen_ToolGeneralNote.cxx @@ -116,7 +116,7 @@ void IGESDimen_ToolGeneralNote::ReadOwnParams slantAngles->SetValue(i, slantAngle); } else - slantAngles->SetValue(i, PI/2); + slantAngles->SetValue(i, M_PI/2); //st = PR.ReadReal(PR.Current(), "Rotation Angle", rotationAngle); //szv#4:S4163:12Mar99 moved in if if (PR.ReadReal(PR.Current(), "Rotation Angle", rotationAngle)) diff --git a/src/IGESDimen/IGESDimen_ToolNewGeneralNote.cxx b/src/IGESDimen/IGESDimen_ToolNewGeneralNote.cxx index 9aaf830838..f0f95b9b00 100755 --- a/src/IGESDimen/IGESDimen_ToolNewGeneralNote.cxx +++ b/src/IGESDimen/IGESDimen_ToolNewGeneralNote.cxx @@ -187,7 +187,7 @@ void IGESDimen_ToolNewGeneralNote::ReadOwnParams slantAngles->SetValue(i, slantAngle); } else - slantAngles->SetValue(i, PI/2); + slantAngles->SetValue(i, M_PI/2); //st = PR.ReadReal(PR.Current(), "Rotation Angle", rotationAngle); //szv#4:S4163:12Mar99 moved in if if (PR.ReadReal(PR.Current(), "Rotation Angle", rotationAngle)) diff --git a/src/IGESDimen/IGESDimen_ToolSectionedArea.cxx b/src/IGESDimen/IGESDimen_ToolSectionedArea.cxx index db035fd9d4..836cf7d0db 100755 --- a/src/IGESDimen/IGESDimen_ToolSectionedArea.cxx +++ b/src/IGESDimen/IGESDimen_ToolSectionedArea.cxx @@ -41,7 +41,7 @@ void IGESDimen_ToolSectionedArea::ReadOwnParams if (PR.DefinedElseSkip()) PR.ReadReal(PR.Current(), "Angle between line and X axis", tempAngle); //szv#4:S4163:12Mar99 `st=` not needed else - tempAngle = PI / 4.0; + tempAngle = M_PI / 4.0; Standard_Boolean st = PR.ReadInteger(PR.Current(), "Number of island curves", nbislands); if (st && nbislands > 0) diff --git a/src/IGESGeom/IGESGeom_CircularArc.cxx b/src/IGESGeom/IGESGeom_CircularArc.cxx index eae8619646..19d463e22a 100755 --- a/src/IGESGeom/IGESGeom_CircularArc.cxx +++ b/src/IGESGeom/IGESGeom_CircularArc.cxx @@ -99,7 +99,7 @@ gp_Dir2d dir2(x2-xc, y2-yc); // After shifting the centre of // arc to the origin Standard_Real t = dir1.Angle(dir2); - return t + (t > 0 ? 0 : 2*PI); + return t + (t > 0 ? 0 : 2*M_PI); } gp_Dir IGESGeom_CircularArc::Axis () const diff --git a/src/IGESGeom/IGESGeom_ConicArc.cxx b/src/IGESGeom/IGESGeom_ConicArc.cxx index 45bcea6141..410730e61e 100755 --- a/src/IGESGeom/IGESGeom_ConicArc.cxx +++ b/src/IGESGeom/IGESGeom_ConicArc.cxx @@ -219,9 +219,9 @@ Xcen = ( cc*ee + f*b) / dn; Ycen = (-cc*dd - f*a) / dn; - Standard_Real teta = PI/2.; + Standard_Real teta = M_PI/2.; if (Abs(b) > eps) teta = ATan (-a/b); - if (fc < 0) teta += PI; + if (fc < 0) teta += M_PI; Xax = Cos(teta); Yax = Sin(teta); diff --git a/src/IGESGeom/IGESGeom_ToolConicArc.cxx b/src/IGESGeom/IGESGeom_ToolConicArc.cxx index d8af477b2b..0e80ee5c53 100755 --- a/src/IGESGeom/IGESGeom_ToolConicArc.cxx +++ b/src/IGESGeom/IGESGeom_ToolConicArc.cxx @@ -230,10 +230,10 @@ void IGESGeom_ToolConicArc::OwnCheck(const Handle(IGESGeom_ConicArc)& ent, gp_Dir2d d2(ent->EndPoint().X() - xc, ent->EndPoint().Y() - yc); Standard_Real t1 = d0.Angle(d1); Standard_Real t2 = d0.Angle(d2); - t1 += (t1 > 0 ? 0 : 2*PI); - t2 += (t2 > 0 ? 0 : 2*PI); - t2 += (t1 <= t2 ? 0 : 2*PI); - if ( !(0 <= t1 && t1 <= 2*PI) || !(0 <= t2-t1 && t2-t1 <= 2*PI) ) + t1 += (t1 > 0 ? 0 : 2*M_PI); + t2 += (t2 > 0 ? 0 : 2*M_PI); + t2 += (t1 <= t2 ? 0 : 2*M_PI); + if ( !(0 <= t1 && t1 <= 2*M_PI) || !(0 <= t2-t1 && t2-t1 <= 2*M_PI) ) ach.AddFail("Parameter Error for Hyperbola"); } else if (ent->FormNumber() == 3) @@ -245,7 +245,7 @@ void IGESGeom_ToolConicArc::OwnCheck(const Handle(IGESGeom_ConicArc)& ent, gp_Dir2d d2(ent->EndPoint().X() - xc, ent->EndPoint().Y() - yc); Standard_Real t1 = d0.Angle(d1); Standard_Real t2 = d0.Angle(d2); - if ( !(-PI/2 < t1 && t1 < PI/2) || !(-PI/2 < t2 && t2 < PI/2) ) + if ( !(-M_PI/2 < t1 && t1 < M_PI/2) || !(-M_PI/2 < t2 && t2 < M_PI/2) ) ach.AddFail("Parameter Error for Parabola"); } */ diff --git a/src/IGESGeom/IGESGeom_ToolSurfaceOfRevolution.cxx b/src/IGESGeom/IGESGeom_ToolSurfaceOfRevolution.cxx index 8824eadb1f..469e483397 100755 --- a/src/IGESGeom/IGESGeom_ToolSurfaceOfRevolution.cxx +++ b/src/IGESGeom/IGESGeom_ToolSurfaceOfRevolution.cxx @@ -139,7 +139,7 @@ void IGESGeom_ToolSurfaceOfRevolution::OwnCheck const Interface_ShareTool& , Handle(Interface_Check)& /*ach*/) const { // Standard_Real diffang = ent->EndAngle() - ent->StartAngle(); -// if (diffang <= 0.0 || diffang > 2.0 * PI) +// if (diffang <= 0.0 || diffang > 2.0 * M_PI) // ach.AddFail("0 < TA - SA <= 2Pi is not satisfied"); } diff --git a/src/IGESGraph/IGESGraph_Color.cxx b/src/IGESGraph/IGESGraph_Color.cxx index 6e3134d710..394558ddee 100755 --- a/src/IGESGraph/IGESGraph_Color.cxx +++ b/src/IGESGraph/IGESGraph_Color.cxx @@ -47,7 +47,7 @@ void IGESGraph_Color::HLSPercentage (Standard_Real& Hue, Standard_Real& Lightness, Standard_Real& Saturation) const { - Hue = ((1.0 / (2.0 * PI)) * + Hue = ((1.0 / (2.0 * M_PI)) * (ATan(((2 * theRed) - theGreen - theBlue) / (Sqrt(3) * (theGreen - theBlue))))); Lightness = ((1.0 / 3.0) * (theRed + theGreen + theBlue)); diff --git a/src/IGESGraph/IGESGraph_ToolTextDisplayTemplate.cxx b/src/IGESGraph/IGESGraph_ToolTextDisplayTemplate.cxx index 092dd67c68..550e0c8919 100755 --- a/src/IGESGraph/IGESGraph_ToolTextDisplayTemplate.cxx +++ b/src/IGESGraph/IGESGraph_ToolTextDisplayTemplate.cxx @@ -60,7 +60,7 @@ void IGESGraph_ToolTextDisplayTemplate::ReadOwnParams // Reading slantAngle(Real) PR.ReadReal (PR.Current(), "Slant Angle", slantAngle); //szv#4:S4163:12Mar99 `st=` not needed else - slantAngle = PI/2.0; // Default Value + slantAngle = M_PI/2.0; // Default Value // Reading rotationAngle(Real) PR.ReadReal (PR.Current(), "Rotation Angle", rotationAngle); //szv#4:S4163:12Mar99 `st=` not needed diff --git a/src/IGESToBRep/IGESToBRep_BasicCurve.cxx b/src/IGESToBRep/IGESToBRep_BasicCurve.cxx index da4ca00c2c..b5acf6e4cd 100755 --- a/src/IGESToBRep/IGESToBRep_BasicCurve.cxx +++ b/src/IGESToBRep/IGESToBRep_BasicCurve.cxx @@ -365,7 +365,7 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferConicArc t1 = ElCLib::Parameter(circ, startPoint); t2 = ElCLib::Parameter(circ, endPoint); - if (t1 > t2 && (t1 - t2) > Precision::Confusion()) t2 += 2.*PI; + if (t1 > t2 && (t1 - t2) > Precision::Confusion()) t2 += 2.*M_PI; if (Abs(t1 - t2) <= Precision::Confusion()) { // t1 = t2 Message_Msg msg1160("IGES_1160"); SendWarning(st, msg1160); @@ -422,7 +422,7 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferConicArc t1 = ElCLib::Parameter(elips, startPoint); t2 = ElCLib::Parameter(elips, endPoint); - if (t2 < t1 && (t1 -t2) > Precision::Confusion()) t2 += 2.*PI; + if (t2 < t1 && (t1 -t2) > Precision::Confusion()) t2 += 2.*M_PI; if (Abs(t1 - t2) <= Precision::Confusion()) { // t1 = t2 Message_Msg msg1160("IGES_1160"); SendWarning(st, msg1160); @@ -538,7 +538,7 @@ Handle(Geom2d_Curve) IGESToBRep_BasicCurve::Transfer2dConicArc t1 = ElCLib::Parameter(circ, startPoint); t2 = ElCLib::Parameter(circ, endPoint); - if (t2 < t1 && (t1 -t2) > Precision::PConfusion()) t2 += 2.*PI; + if (t2 < t1 && (t1 -t2) > Precision::PConfusion()) t2 += 2.*M_PI; if (Abs(t1 - t2) <= Precision::PConfusion()) { // t1 = t2 Message_Msg msg1160("IGES_1160"); SendWarning(st, msg1160); @@ -600,7 +600,7 @@ Handle(Geom2d_Curve) IGESToBRep_BasicCurve::Transfer2dConicArc t1 = ElCLib::Parameter(elips, startPoint); t2 = ElCLib::Parameter(elips, endPoint); - if (t2 < t1 && (t1 - t2) > Precision::PConfusion()) t2 += 2.*PI; + if (t2 < t1 && (t1 - t2) > Precision::PConfusion()) t2 += 2.*M_PI; if (Abs(t1 - t2) <= Precision::PConfusion()) { // t1 = t2 Message_Msg msg1160("IGES_1160"); SendWarning(st, msg1160); @@ -690,14 +690,14 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferCircularArc t1 = ElCLib::Parameter(circ, startPoint); t2 = ElCLib::Parameter(circ, endPoint); - if ( st->IsClosed() && t1>=GetEpsGeom()) t2 = t1 + 2.*PI; + if ( st->IsClosed() && t1>=GetEpsGeom()) t2 = t1 + 2.*M_PI; if (!st->IsClosed() && fabs(t1 - t2) <=Precision::PConfusion()) { // micro-arc // cky 27 Aout 1996 : t2-t1 vaut distance(start,end)/rayon t2 = t1 + startPoint.Distance(endPoint)/st->Radius(); } if (!st->IsClosed() || t1>=GetEpsGeom()) { - if (t2 < t1) t2 += 2.*PI; + if (t2 < t1) t2 += 2.*M_PI; res = new Geom_TrimmedCurve(res, t1, t2); } @@ -763,14 +763,14 @@ Handle(Geom2d_Curve) IGESToBRep_BasicCurve::Transfer2dCircularArc t1 = ElCLib::Parameter(circ, startPoint); t2 = ElCLib::Parameter(circ, endPoint); - if ( st->IsClosed() && t1>=GetEpsGeom()) t2 = t1 + 2.*PI; + if ( st->IsClosed() && t1>=GetEpsGeom()) t2 = t1 + 2.*M_PI; if (!st->IsClosed() && fabs(t1 -t2) <= Precision::PConfusion()) { // micro-arc // cky 27 Aout 1996 : t2-t1 vaut distance(start,end)/rayon t2 = t1 + startPoint.Distance(endPoint)/st->Radius(); } if (!st->IsClosed() || t1>= GetEpsGeom()) { - if (t2 < t1) t2 += 2.*PI; + if (t2 < t1) t2 += 2.*M_PI; res = new Geom2d_TrimmedCurve(res, t1, t2); } return res; diff --git a/src/IGESToBRep/IGESToBRep_BasicSurface.cxx b/src/IGESToBRep/IGESToBRep_BasicSurface.cxx index 74121df3f1..3bf08a4e7b 100755 --- a/src/IGESToBRep/IGESToBRep_BasicSurface.cxx +++ b/src/IGESToBRep/IGESToBRep_BasicSurface.cxx @@ -345,7 +345,7 @@ Handle(Geom_ConicalSurface) IGESToBRep_BasicSurface::TransferRigthConicalSurface Handle(IGESGeom_Point) Point = start->LocationPoint(); Handle(IGESGeom_Direction) Axis = start->Axis(); Standard_Real radius = start->Radius(); - Standard_Real angle = start->SemiAngle()/180.*PI; + Standard_Real angle = start->SemiAngle()/180.*M_PI; if (Point.IsNull()) { Message_Msg msg174("XSTEP_174"); @@ -359,7 +359,7 @@ Handle(Geom_ConicalSurface) IGESToBRep_BasicSurface::TransferRigthConicalSurface // Direction Reading Error : Null IGESEntity return res; } - if (angle < Precision::Confusion()||angle > PI/2.) { + if (angle < Precision::Confusion()||angle > M_PI/2.) { return res; } if (radius < 0) { diff --git a/src/IGESToBRep/IGESToBRep_TopoCurve.cxx b/src/IGESToBRep/IGESToBRep_TopoCurve.cxx index 652cab03f9..b89fa053cf 100755 --- a/src/IGESToBRep/IGESToBRep_TopoCurve.cxx +++ b/src/IGESToBRep/IGESToBRep_TopoCurve.cxx @@ -1122,7 +1122,7 @@ TopoDS_Shape IGESToBRep_TopoCurve::Transfer2dTopoBasicCurve //(taken from Compute2d3d and Compute2d) /* if (isrev) { //#30 rln 19.10.98 transformation of pcurves for IGES Surface of Revolution - mycurve2d ->Translate (gp_Vec2d (0, -2 * PI)); + mycurve2d ->Translate (gp_Vec2d (0, -2 * M_PI)); mycurve2d->Mirror (gp::OX2d()); mycurve2d->Mirror (gp_Ax2d (gp::Origin2d(), gp_Dir2d (1.,1.))); diff --git a/src/IGESToBRep/IGESToBRep_TopoSurface.cxx b/src/IGESToBRep/IGESToBRep_TopoSurface.cxx index 647953f4aa..1c4a8bbe4b 100755 --- a/src/IGESToBRep/IGESToBRep_TopoSurface.cxx +++ b/src/IGESToBRep/IGESToBRep_TopoSurface.cxx @@ -733,11 +733,11 @@ TopoDS_Shape IGESToBRep_TopoSurface::TransferSurfaceOfRevolution //Standard_Real startAngle = st->StartAngle(); //Standard_Real endAngle = st->EndAngle(); gp_Ax1 revolAxis(pt1, gp_Dir( gp_Vec (pt2, pt1))); - Standard_Real startAngle = 2 * PI - st->EndAngle(); - Standard_Real endAngle = 2 * PI - st->StartAngle(); + Standard_Real startAngle = 2 * M_PI - st->EndAngle(); + Standard_Real endAngle = 2 * M_PI - st->StartAngle(); Standard_Real deltaAngle = endAngle - startAngle; - Standard_Boolean IsFullAngle = ( deltaAngle > 2.*PI-Precision::PConfusion() ); - if (IsFullAngle) deltaAngle = 2.*PI; // ** CKY 18-SEP-1996 + Standard_Boolean IsFullAngle = ( deltaAngle > 2.*M_PI-Precision::PConfusion() ); + if (IsFullAngle) deltaAngle = 2.*M_PI; // ** CKY 18-SEP-1996 // il faudra translater les courbes 2d de startAngle pour // etre en phase IGES et BRep startLoc.SetRotation(revolAxis, startAngle); @@ -890,7 +890,7 @@ TopoDS_Shape IGESToBRep_TopoSurface::TransferTabulatedCylinder tmpF = aBasisCurve->FirstParameter(); tmpL = aBasisCurve->LastParameter(); tmpToler = Precision::PConfusion(); - if ( (fabs(tmpF) >= tmpToler) && (fabs(tmpL - 2*PI) >= tmpToler) ) + if ( (fabs(tmpF) >= tmpToler) && (fabs(tmpL - 2*M_PI) >= tmpToler) ) reparamBSpline (aBasisCurve, tmpF, tmpL); } gp_Vec dir (pt1, pt2); @@ -1736,9 +1736,9 @@ TopoDS_Shape IGESToBRep_TopoSurface::ParamSurface(const Handle(IGESData_IGESEnti gp_Pnt2d startpoint = circ->StartPoint(); paramv -= ElCLib::Parameter (gp_Circ2d (gp_Ax2d (circ->Center(), gp_Dir2d(1,0)), circ->Radius()), startpoint); if (Surf->IsKind (STANDARD_TYPE(Geom_SphericalSurface))) - paramv += ShapeAnalysis::AdjustToPeriod(paramv, - PI, PI); + paramv += ShapeAnalysis::AdjustToPeriod(paramv, - M_PI, M_PI); else if (Surf->IsKind (STANDARD_TYPE(Geom_ToroidalSurface))) - paramv += ShapeAnalysis::AdjustToPeriod(paramv, 0, PI * 2); + paramv += ShapeAnalysis::AdjustToPeriod(paramv, 0, M_PI * 2); } } else if (st->IsKind (STANDARD_TYPE (IGESGeom_TabulatedCylinder))) { @@ -1748,7 +1748,7 @@ TopoDS_Shape IGESToBRep_TopoSurface::ParamSurface(const Handle(IGESData_IGESEnti DeclareAndCast (IGESGeom_CircularArc, circ, directrix); gp_Pnt2d startpoint = circ->StartPoint(); paramu -= ElCLib::Parameter (gp_Circ2d (gp_Ax2d (circ->Center(), gp_Dir2d(1,0)), circ->Radius()), startpoint); - paramu += ShapeAnalysis::AdjustToPeriod(paramu, 0, PI * 2); + paramu += ShapeAnalysis::AdjustToPeriod(paramu, 0, M_PI * 2); } } @@ -1768,7 +1768,7 @@ TopoDS_Shape IGESToBRep_TopoSurface::ParamSurface(const Handle(IGESData_IGESEnti DeclareAndCast(IGESGeom_SurfaceOfRevolution, st120, isrf); //S4181 pdn 19.04.99 defining transformation matrix gp_Trsf2d tmp; - tmp.SetTranslation(gp_Vec2d (0, -2 * PI)); + tmp.SetTranslation(gp_Vec2d (0, -2 * M_PI)); trans.PreMultiply(tmp); tmp.SetMirror(gp::OX2d()); trans.PreMultiply(tmp); @@ -1778,7 +1778,7 @@ TopoDS_Shape IGESToBRep_TopoSurface::ParamSurface(const Handle(IGESData_IGESEnti //#30 rln 19.10.98 //CAS.CADE SA = 2*PI - IGES TA //paramu = st120->StartAngle(); - paramu = -(2 * PI - st120->EndAngle()); + paramu = -(2 * M_PI - st120->EndAngle()); } else paramu = 0.; @@ -1805,11 +1805,11 @@ TopoDS_Shape IGESToBRep_TopoSurface::ParamSurface(const Handle(IGESData_IGESEnti if (isrf->IsKind(STANDARD_TYPE(IGESSolid_CylindricalSurface))|| isrf->IsKind(STANDARD_TYPE(IGESSolid_ConicalSurface))) { - uscale = PI/180.; + uscale = M_PI/180.; } if (isrf->IsKind(STANDARD_TYPE(IGESSolid_SphericalSurface))) { - cscale = PI/180.; + cscale = M_PI/180.; uscale = 1.; } @@ -1822,8 +1822,8 @@ TopoDS_Shape IGESToBRep_TopoSurface::ParamSurface(const Handle(IGESData_IGESEnti tmp.SetMirror(gp_Ax2d (gp::Origin2d(), gp_Dir2d (1.,1.))); trans.PreMultiply(tmp); if(paramv > 0) - paramv = paramv*180./PI; - cscale = PI/180.; + paramv = paramv*180./M_PI; + cscale = M_PI/180.; uscale = 1.; } diff --git a/src/IntAna/IntAna_Curve.cxx b/src/IntAna/IntAna_Curve.cxx index db6ac274d4..d565c2e929 100755 --- a/src/IntAna/IntAna_Curve.cxx +++ b/src/IntAna/IntAna_Curve.cxx @@ -389,7 +389,7 @@ Standard_Real& Para) const { Standard_Real theta,z, aTolPrecision=0.0001; - Standard_Real PIpPI = Standard_PI+Standard_PI; + Standard_Real PIpPI = M_PI + M_PI; // switch (typequadric) { diff --git a/src/IntAna/IntAna_IntConicQuad.cxx b/src/IntAna/IntAna_IntConicQuad.cxx index ee39720892..d78d4a747d 100755 --- a/src/IntAna/IntAna_IntConicQuad.cxx +++ b/src/IntAna/IntAna_IntConicQuad.cxx @@ -31,7 +31,7 @@ #include -static Standard_Real PIpPI = Standard_PI+Standard_PI; +static Standard_Real PIpPI = M_PI + M_PI; //============================================================================= //== E m p t y C o n s t r u c t o r //== diff --git a/src/IntAna/IntAna_IntQuadQuad.cxx b/src/IntAna/IntAna_IntQuadQuad.cxx index b8ef2bfb6a..b8402cdb4f 100755 --- a/src/IntAna/IntAna_IntQuadQuad.cxx +++ b/src/IntAna/IntAna_IntQuadQuad.cxx @@ -55,7 +55,7 @@ class TrigonometricRoots { Standard_Boolean IsARoot(Standard_Real u) { Standard_Integer i; Standard_Real aEps=RealEpsilon(); - Standard_Real PIpPI = Standard_PI+Standard_PI; + Standard_Real PIpPI = M_PI + M_PI; // for(i=0 ; i 2 Courbes //-- Sinon ---> Pas de solution //-------------------------------------------------------------- - if(MTF.Value(PI) >= -aRealEpsilon) { + if(MTF.Value(M_PI) >= -aRealEpsilon) { TheCurve[0].SetCylinderQuadValues(Cyl,Qxx,Qyy,Qzz,Qxy,Qxz,Qyz,Qx,Qy,Qz,Q1, myEpsilon,0.0,PIpPI, @@ -404,7 +404,7 @@ void IntAna_IntQuadQuad::Perform(const gp_Cylinder& Cyl, //-- entre les 2 racines ( Ici Tout le domaine ) //-- Sinon Seulement un point Tangent //------------------------------------------------------------ - if(MTF.Value(PolDIS.Value(1)+PI) >= -aRealEpsilon ) { + if(MTF.Value(PolDIS.Value(1)+M_PI) >= -aRealEpsilon ) { //------------------------------------------------------------ //-- On a Un Point de Tangence + Une Courbe Solution //------------------------------------------------------------ @@ -582,7 +582,7 @@ void IntAna_IntQuadQuad::Perform(const gp_Cone& Cone, Standard_Integer i; Standard_Real Qxx,Qyy,Qzz,Qxy,Qxz,Qyz,Qx,Qy,Qz,Q1; Standard_Real Theta1, Theta2, TgAngle; - Standard_Real PIpPI = Standard_PI+Standard_PI; + Standard_Real PIpPI = M_PI + M_PI; // done=Standard_True; identical = Standard_False; @@ -745,7 +745,7 @@ void IntAna_IntQuadQuad::Perform(const gp_Cone& Cone, // 2 // f(z,t)=A(t)*z + B(t)*z + C(t) Discriminant(t) != 0 // - if(!nbsol && (MTF.Value(PI)<0.) ) { + if(!nbsol && (MTF.Value(M_PI)<0.) ) { //-- Discriminant signe constant negatif return; } diff --git a/src/IntAna/IntAna_QuadQuadGeo.cxx b/src/IntAna/IntAna_QuadQuadGeo.cxx index 21c2304b36..c065453d9b 100755 --- a/src/IntAna/IntAna_QuadQuadGeo.cxx +++ b/src/IntAna/IntAna_QuadQuadGeo.cxx @@ -387,9 +387,9 @@ gp_Ax2 DirToAx2(const gp_Pnt& P,const gp_Dir& D) gp_Vec ldv( axec.Direction() ); gp_Vec npv( normp ); Standard_Real dA = Abs( ldv.Angle( npv ) ); - if( dA > (PI/4.) ) + if( dA > (M_PI/4.) ) { - Standard_Real dang = Abs( ldv.Angle( npv ) ) - PI/2.; + Standard_Real dang = Abs( ldv.Angle( npv ) ) - M_PI/2.; Standard_Real dangle = Abs( dang ); if( dangle > Tolang ) { @@ -947,7 +947,7 @@ gp_Ax2 DirToAx2(const gp_Pnt& P,const gp_Dir& D) Standard_Real A=DirCyl1.Angle(DirCyl2); Standard_Real B; - B=Abs(Sin(0.5*(PI-A))); + B=Abs(Sin(0.5*(M_PI-A))); A=Abs(Sin(0.5*A)); if(A==0.0 || B==0.0) { @@ -1308,7 +1308,7 @@ gp_Ax2 DirToAx2(const gp_Pnt& P,const gp_Dir& D) // Preliminary analysis. Determination of iRet // iRet=0; - aHalfPI=0.5*PI; + aHalfPI=0.5*M_PI; aD1=1.; aPA1.SetCoord(aD1, 0.); aP0.SetCoord(0., 0.); @@ -1317,7 +1317,7 @@ gp_Ax2 DirToAx2(const gp_Pnt& P,const gp_Dir& D) aAx2=Con2.Axis(); aGamma=aAx1.Angle(aAx2); if (aGamma>aHalfPI){ - aGamma=PI-aGamma; + aGamma=M_PI-aGamma; } aCosGamma=Cos(aGamma); aSinGamma=Sin(aGamma); @@ -1485,8 +1485,8 @@ gp_Ax2 DirToAx2(const gp_Pnt& P,const gp_Dir& D) //Other generatrixes of cones laying in maximal plane - gp_Lin aGen1 = aGen.Rotated(Con1.Axis(), Standard_PI); - gp_Lin aGen2 = aGen.Rotated(Con2.Axis(), Standard_PI); + gp_Lin aGen1 = aGen.Rotated(Con1.Axis(), M_PI); + gp_Lin aGen2 = aGen.Rotated(Con2.Axis(), M_PI); // //Intersection point of generatrixes gp_Dir aN; //solution plane normal diff --git a/src/IntAna2d/IntAna2d_AnaIntersection_2.cxx b/src/IntAna2d/IntAna2d_AnaIntersection_2.cxx index 5fc149a26b..272690893e 100755 --- a/src/IntAna2d/IntAna2d_AnaIntersection_2.cxx +++ b/src/IntAna2d/IntAna2d_AnaIntersection_2.cxx @@ -44,8 +44,8 @@ void IntAna2d_AnaIntersection::Perform (const gp_Circ2d& C1, Standard_Real XS = ( C1.Location().X()*R2 + C2.Location().X()*R1 ) / sum; Standard_Real YS = ( C1.Location().Y()*R2 + C2.Location().Y()*R1 ) / sum; Standard_Real ang1=Ox1.Angle(ax); // Resultat entre -PI et +PI - Standard_Real ang2=Ox2.Angle(ax) + PI; - if (ang1<0) {ang1=2*PI+ang1;} // On revient entre 0 et 2PI + Standard_Real ang2=Ox2.Angle(ax) + M_PI; + if (ang1<0) {ang1=2*M_PI+ang1;} // On revient entre 0 et 2PI lpnt[0].SetValue(XS,YS,ang1,ang2); } else if (((sum-d)>Epsilon(d)) && ((d-dif)>Epsilon(d))) { @@ -85,42 +85,42 @@ void IntAna2d_AnaIntersection::Perform (const gp_Circ2d& C1, } else { ang1=ASin(sint1); - if (cost1<0.0) {ang1=PI-ang1;} + if (cost1<0.0) {ang1=M_PI-ang1;} } if (Abs(cost2)<=0.707) { ang2=ACos(cost2); } else { ang2=ASin(sint2); - if (cost2<0.0) {ang2=PI-ang2;} + if (cost2<0.0) {ang2=M_PI-ang2;} } Standard_Real ang11=ref1+ang1; Standard_Real ang21=ref2+ang2; Standard_Real ang12=ref1-ang1; Standard_Real ang22=ref2-ang2; if (ang11<0.) { - ang11=2*PI+ang11; + ang11=2*M_PI+ang11; } - else if (ang11>=2*PI) { - ang11=ang11-2*PI; + else if (ang11>=2*M_PI) { + ang11=ang11-2*M_PI; } if (ang21<0.) { - ang21=2*PI+ang21; + ang21=2*M_PI+ang21; } - else if (ang21>=2*PI) { - ang21=ang21-2*PI; + else if (ang21>=2*M_PI) { + ang21=ang21-2*M_PI; } if (ang12<0.) { - ang12=2*PI+ang12; + ang12=2*M_PI+ang12; } - else if (ang12>=2*PI) { - ang12=ang12-2*PI; + else if (ang12>=2*M_PI) { + ang12=ang12-2*M_PI; } if (ang22<0.) { - ang22=2*PI+ang22; + ang22=2*M_PI+ang22; } - else if (ang22>=2*PI) { - ang22=ang22-2*PI; + else if (ang22>=2*M_PI) { + ang22=ang22-2*M_PI; } lpnt[0].SetValue(XS1,YS1,ang11,ang21); lpnt[1].SetValue(XS2,YS2,ang12,ang22); @@ -135,8 +135,8 @@ void IntAna2d_AnaIntersection::Perform (const gp_Circ2d& C1, gp_Vec2d Ox2(C2.XAxis().Direction()); Standard_Real ang1=Ox1.Angle(ax); // Resultat entre -PI et +PI Standard_Real ang2=Ox2.Angle(ax); - if (ang1<0) {ang1=2*PI+ang1;} // On revient entre 0 et 2PI - if (ang2<0) {ang2=2*PI+ang2;} // On revient entre 0 et 2PI + if (ang1<0) {ang1=2*M_PI+ang1;} // On revient entre 0 et 2PI + if (ang2<0) {ang2=2*M_PI+ang2;} // On revient entre 0 et 2PI Standard_Real XS = ( C1.Location().X()*R2 - C2.Location().X()*R1 ) / (R2 - R1); Standard_Real YS = ( C1.Location().Y()*R2 - C2.Location().Y()*R1 ) / (R2 - R1); lpnt[0].SetValue(XS,YS,ang1,ang2); diff --git a/src/IntAna2d/IntAna2d_AnaIntersection_3.cxx b/src/IntAna2d/IntAna2d_AnaIntersection_3.cxx index 8977a67da9..287dcbba1f 100755 --- a/src/IntAna2d/IntAna2d_AnaIntersection_3.cxx +++ b/src/IntAna2d/IntAna2d_AnaIntersection_3.cxx @@ -30,7 +30,7 @@ void IntAna2d_AnaIntersection::Perform(const gp_Lin2d& L, //modified by NIZNHY-PKV Fri Jun 15 09:55:00 2007f //Standard_Real ang; //ang = C.XAxis().Direction().Angle(L.Direction()); - //ang = ang + PI / 2.0; + //ang = ang + M_PI / 2.0; //modified by NIZNHY-PKV Fri Jun 15 09:55:29 2007t if (Abs(Abs(d)-C.Radius())<=Epsilon(C.Radius())) { // Cas de tangence @@ -47,12 +47,12 @@ void IntAna2d_AnaIntersection::Perform(const gp_Lin2d& L, /* u=B*(L.Location().X()-C.Location().X()) - A*(L.Location().Y()-C.Location().Y()); - if (d<0.0) {ang=ang+PI;} - if (ang>=2.0*PI) { - ang=ang-2.0*PI; + if (d<0.0) {ang=ang+M_PI;} + if (ang>=2.0*M_PI) { + ang=ang-2.0*M_PI; } else if (ang<0.0) { - ang=ang+2.0*PI; + ang=ang+2.0*M_PI; } */ //modified by NIZNHY-PKV Fri Jun 15 09:55:41 2007t @@ -85,22 +85,22 @@ void IntAna2d_AnaIntersection::Perform(const gp_Lin2d& L, } else { angt=ASin(sint); - if (cost<0) {angt=PI-angt;} + if (cost<0) {angt=M_PI-angt;} } ang1=ang-angt; ang2=ang+angt; if (ang1<0.0) { - ang1=ang1+2.0*PI; + ang1=ang1+2.0*M_PI; } - else if (ang1>=2.0*PI) { - ang1=ang1-2.0*PI; + else if (ang1>=2.0*M_PI) { + ang1=ang1-2.0*M_PI; } if (ang2<0.0) { - ang2=ang2+2.0*PI; + ang2=ang2+2.0*M_PI; } - else if (ang2>=2.0*PI) { - ang2=ang2-2.0*PI; + else if (ang2>=2.0*M_PI) { + ang2=ang2-2.0*M_PI; } u1=B*(L.Location().X()-C.Location().X()) - diff --git a/src/IntAna2d/IntAna2d_AnaIntersection_5.cxx b/src/IntAna2d/IntAna2d_AnaIntersection_5.cxx index 4d682845d6..9b023191d1 100755 --- a/src/IntAna2d/IntAna2d_AnaIntersection_5.cxx +++ b/src/IntAna2d/IntAna2d_AnaIntersection_5.cxx @@ -35,7 +35,7 @@ void IntAna2d_AnaIntersection::Perform(const gp_Circ2d& Circle, ps = 2.0*E*radius; // SIN pcte= F + pss; // 1 - math_TrigonometricFunctionRoots Sol(pcc,p2sc,pc,ps,pcte,0.0,2.0*PI); + math_TrigonometricFunctionRoots Sol(pcc,p2sc,pc,ps,pcte,0.0,2.0*M_PI); if(!Sol.IsDone()) { cout << "\n\nmath_TrigonometricFunctionRoots -> NotDone\n\n"< PI) + if(C2Inter.Length() > M_PI) C2Inter.Complement(); } else { @@ -102,7 +102,7 @@ void ProjectOnC2AndIntersectWithC2Domain(const gp_Circ2d& Circle1 SolutionC1[NbSolTotal]=PeriodicInterval(C1inf,C1sup); if(!IdentCircles) { - if(SolutionC1[NbSolTotal].Length() > PI) + if(SolutionC1[NbSolTotal].Length() > M_PI) SolutionC1[NbSolTotal].Complement(); } else { @@ -282,12 +282,12 @@ void CircleCircleGeometricIntersection(const gp_Circ2d& C1 //-- (permet de ne pas gerer trop de cas differents) C1_Res1.SetValues(C1_binf1,C1_bsup1); - if(C1_Res1.Length() > PI) C1_Res1.Complement(); + if(C1_Res1.Length() > M_PI) C1_Res1.Complement(); if(nbsol==2) { C1_binf2+=dAngle1; C1_bsup2+=dAngle1; C1_Res2.SetValues(C1_binf2,C1_bsup2); - if(C1_Res2.Length() > PI) C1_Res2.Complement(); + if(C1_Res2.Length() > M_PI) C1_Res2.Complement(); } else { C1_Res2.SetNull(); @@ -371,7 +371,7 @@ void ProjectOnLAndIntersectWithLDomain(const gp_Circ2d& Circle #endif if(Cinf>=Csup) { Cinf = CDomainAndRes.Binf; Csup = CDomainAndRes.Bsup; } CircleSolution[NbSolTotal]=PeriodicInterval(Cinf,Csup); - if(CircleSolution[NbSolTotal].Length() > PI) + if(CircleSolution[NbSolTotal].Length() > M_PI) CircleSolution[NbSolTotal].Complement(); LineSolution[NbSolTotal]=LInterAndDomain; @@ -514,7 +514,7 @@ void LineCircleGeometricIntersection(const gp_Lin2d& Line, CInt1.SetValues(binf1,bsup1); - if(CInt1.Length() > PI) CInt1.Complement(); + if(CInt1.Length() > M_PI) CInt1.Complement(); if(nbsol==2) { @@ -527,7 +527,7 @@ void LineCircleGeometricIntersection(const gp_Lin2d& Line, } CInt2.SetValues(binf2,bsup2); - if(CInt2.Length() > PI) CInt2.Complement(); + if(CInt2.Length() > M_PI) CInt2.Complement(); } // Modified by Sergey KHROMOV - Thu Oct 26 17:51:05 2000 Begin else { @@ -537,9 +537,9 @@ void LineCircleGeometricIntersection(const gp_Lin2d& Line, bsup2 = PIpPI; binf1 = 0.; CInt1.SetValues(binf1,CInt1.Bsup - PIpPI); - if(CInt1.Length() > PI) CInt1.Complement(); + if(CInt1.Length() > M_PI) CInt1.Complement(); CInt2.SetValues(binf2,bsup2); - if(CInt2.Length() > PI) CInt2.Complement(); + if(CInt2.Length() > M_PI) CInt2.Complement(); } } // Modified by Sergey KHROMOV - Thu Oct 26 17:51:13 2000 End diff --git a/src/IntCurve/IntCurve_IntConicConic_Tool.hxx b/src/IntCurve/IntCurve_IntConicConic_Tool.hxx index 6e598168ea..c705b6ab83 100755 --- a/src/IntCurve/IntCurve_IntConicConic_Tool.hxx +++ b/src/IntCurve/IntCurve_IntConicConic_Tool.hxx @@ -20,7 +20,7 @@ #include -static Standard_Real PIpPI = Standard_PI+Standard_PI; +static Standard_Real PIpPI = M_PI + M_PI; //====================================================================== //========== P R O T O T Y P E S ============ diff --git a/src/IntCurve/IntCurve_IntConicCurveGen.gxx b/src/IntCurve/IntCurve_IntConicCurveGen.gxx index 02581b2803..4720fae4cf 100755 --- a/src/IntCurve/IntCurve_IntConicCurveGen.gxx +++ b/src/IntCurve/IntCurve_IntConicCurveGen.gxx @@ -17,7 +17,7 @@ IntCurve_IntConicCurveGen::IntCurve_IntConicCurveGen (const gp_Circ2d& C, const Standard_Real Tol) { if(!D1.IsClosed()) { IntRes2d_Domain D(D1); - D.SetEquivalentParameters(D1.FirstParameter(),D1.FirstParameter()+PI+PI); + D.SetEquivalentParameters(D1.FirstParameter(),D1.FirstParameter()+M_PI+M_PI); Perform(IntCurve_IConicTool(C),D,PCurve,D2,TolConf,Tol); //-- Standard_ConstructionError::Raise("Domaine incorrect"); } @@ -34,7 +34,7 @@ IntCurve_IntConicCurveGen::IntCurve_IntConicCurveGen (const gp_Elips2d& E, const Standard_Real Tol) { if(!D1.IsClosed()) { IntRes2d_Domain D(D1); - D.SetEquivalentParameters(D1.FirstParameter(),D1.FirstParameter()+PI+PI); + D.SetEquivalentParameters(D1.FirstParameter(),D1.FirstParameter()+M_PI+M_PI); Perform(IntCurve_IConicTool(E),D,PCurve,D2,TolConf,Tol); //-- Standard_ConstructionError::Raise("Domaine incorrect"); } diff --git a/src/IntCurve/IntCurve_IntConicCurveGen.lxx b/src/IntCurve/IntCurve_IntConicCurveGen.lxx index 463eea81f7..e6d068f2d6 100755 --- a/src/IntCurve/IntCurve_IntConicCurveGen.lxx +++ b/src/IntCurve/IntCurve_IntConicCurveGen.lxx @@ -50,7 +50,7 @@ inline void IntCurve_IntConicCurveGen::Perform (const gp_Circ2d& C, const Standard_Real Tol) { if(!D1.IsClosed()) { IntRes2d_Domain D(D1); - D.SetEquivalentParameters(D1.FirstParameter(),D1.FirstParameter()+PI+PI); + D.SetEquivalentParameters(D1.FirstParameter(),D1.FirstParameter()+M_PI+M_PI); Perform(IntCurve_IConicTool(C),D,PCurve,D2,TolConf,Tol); //-- Standard_ConstructionError::Raise("Domaine incorrect"); } @@ -67,7 +67,7 @@ inline void IntCurve_IntConicCurveGen::Perform (const gp_Elips2d& E, const Standard_Real Tol) { if(!D1.IsClosed()) { IntRes2d_Domain D(D1); - D.SetEquivalentParameters(D1.FirstParameter(),D1.FirstParameter()+PI+PI); + D.SetEquivalentParameters(D1.FirstParameter(),D1.FirstParameter()+M_PI+M_PI); Perform(IntCurve_IConicTool(E),D,PCurve,D2,TolConf,Tol); } else { diff --git a/src/IntCurve/IntCurve_IntCurveCurveGen.gxx b/src/IntCurve/IntCurve_IntCurveCurveGen.gxx index ac4b127556..d63e5024da 100755 --- a/src/IntCurve/IntCurve_IntCurveCurveGen.gxx +++ b/src/IntCurve/IntCurve_IntCurveCurveGen.gxx @@ -125,7 +125,7 @@ IntRes2d_Domain IntCurve_IntCurveCurveGen::ComputeDomain(const TheCurve& C1, gp_Pnt2d P2(TheCurveTool::Value(C1,lastparameter)); D1.SetValues(P1,firstparameter ,TolDomain, P2,lastparameter ,TolDomain); - D1.SetEquivalentParameters(firstparameter,firstparameter+PI+PI); + D1.SetEquivalentParameters(firstparameter,firstparameter+M_PI+M_PI); break; } default: { diff --git a/src/IntCurve/IntCurve_ProjectOnPConicTool.cxx b/src/IntCurve/IntCurve_ProjectOnPConicTool.cxx index 9dcb9dbdad..6a72a59e94 100755 --- a/src/IntCurve/IntCurve_ProjectOnPConicTool.cxx +++ b/src/IntCurve/IntCurve_ProjectOnPConicTool.cxx @@ -32,7 +32,7 @@ Standard_Real IntCurve_ProjectOnPConicTool::FindParameter case GeomAbs_Circle: Param=ElCLib::CircleParameter(ThePConic.Axis2(),P); - if(Param<0.0) { Param+=PI+PI; } + if(Param<0.0) { Param+=M_PI+M_PI; } break; case GeomAbs_Ellipse: { @@ -40,7 +40,7 @@ Standard_Real IntCurve_ProjectOnPConicTool::FindParameter ,ThePConic.Param1() ,ThePConic.Param2() ,P); - if (Param < 0.0) { Param+=PI+PI; } + if (Param < 0.0) { Param+=M_PI+M_PI; } break; } @@ -84,7 +84,7 @@ Standard_Real IntCurve_ProjectOnPConicTool::FindParameter case GeomAbs_Circle: Param=ElCLib::CircleParameter(ThePConic.Axis2(),P); - if(Param<0.0) { Param+=PI+PI; } + if(Param<0.0) { Param+=M_PI+M_PI; } break; case GeomAbs_Ellipse: { @@ -92,7 +92,7 @@ Standard_Real IntCurve_ProjectOnPConicTool::FindParameter ,ThePConic.Param1() ,ThePConic.Param2() ,P); - if (Param < 0.0) { Param+=PI+PI; } + if (Param < 0.0) { Param+=M_PI+M_PI; } break; } diff --git a/src/IntCurveSurface/IntCurveSurface_Inter.gxx b/src/IntCurveSurface/IntCurveSurface_Inter.gxx index 1e7fe2a960..3c1a7d74b0 100755 --- a/src/IntCurveSurface/IntCurveSurface_Inter.gxx +++ b/src/IntCurveSurface/IntCurveSurface_Inter.gxx @@ -1197,7 +1197,7 @@ void IntCurveSurface_Inter::PerformConicSurf(const gp_Lin& Line, //OCC516(apo)-> static Standard_Real correction = 1.E+5*Precision::Angular(); gp_Cone cn = TheSurfaceTool::Cone(surface); - if(Abs(cn.SemiAngle()) < PI/2.0 - correction){ + if(Abs(cn.SemiAngle()) < M_PI/2.0 - correction){ IntAna_IntConicQuad LinCone(Line,cn); AppendIntAna(curve,surface,LinCone); break; @@ -2009,7 +2009,7 @@ static void EstLimForInfRevl(const gp_Lin& Line, if (U1inf) U1new = Max (0., U1new); else - U2new = Min (2 * PI, U2new); + U2new = Min (2 * M_PI, U2new); if (! V1inf && !V2inf) return; } @@ -2065,7 +2065,7 @@ static void EstLimForInfRevl(const gp_Lin& Line, aPln = gp_Pln (gp_Ax3 (O, aNVec ,aXVec)); // make a second plane perpendicular to the first one, rotated around aXVec - gp_Pln aPlnPrp = aPln.Rotated (gp_Ax1 (O,aXVec), PI/2.); + gp_Pln aPlnPrp = aPln.Rotated (gp_Ax1 (O,aXVec), M_PI/2.); // project Line and it's X-axe symmetric one to plane and intersect // resulting curve with projection of Basic Curev @@ -2154,7 +2154,7 @@ static void EstLimForInfOffs(const gp_Lin& Line, aCyl.SetRadius(aR); } else if ( aR <= -TOLTANGENCY ){ - anA.Rotate(gp_Ax1(anA.Location(), anA.Direction()), PI); + anA.Rotate(gp_Ax1(anA.Location(), anA.Direction()), M_PI); aCyl.SetPosition(anA); // modified by NIZHNY-MKK Mon Oct 3 17:37:54 2005 // aCyl.SetRadius(Abs(aR)); diff --git a/src/IntImpParGen/IntImpParGen_Intersector.gxx b/src/IntImpParGen/IntImpParGen_Intersector.gxx index 5154df32be..28e1c12be0 100755 --- a/src/IntImpParGen/IntImpParGen_Intersector.gxx +++ b/src/IntImpParGen/IntImpParGen_Intersector.gxx @@ -29,7 +29,7 @@ #define EPSX ParTool::EpsX(TheParCurve) #define NB_ECHANTILLONS -static Standard_Real PIpPI = Standard_PI+Standard_PI; +static Standard_Real PIpPI = M_PI + M_PI; diff --git a/src/IntPatch/IntPatch_ALine.cxx b/src/IntPatch/IntPatch_ALine.cxx index 1a84e89297..35da104491 100755 --- a/src/IntPatch/IntPatch_ALine.cxx +++ b/src/IntPatch/IntPatch_ALine.cxx @@ -240,7 +240,7 @@ void IntPatch_ALine::ComputeVertexParameters(const Standard_Real Tol) { for(i=1; i<=nbvtx; i++) { IntPatch_Point& VTX = svtx.ChangeValue(i); Standard_Real p=VTX.ParameterOnLine(); - Standard_Real pmpimpi=p-PI-PI; + Standard_Real pmpimpi=p-M_PI-M_PI; if(pmpimpi >= ParamMinOnLine) { gp_Pnt P1 = Value(pmpimpi); Standard_Real d1 = P1.Distance(VTX.Value()); @@ -250,7 +250,7 @@ void IntPatch_ALine::ComputeVertexParameters(const Standard_Real Tol) { svtx.Append(OVTX); } } - pmpimpi=p+PI+PI; + pmpimpi=p+M_PI+M_PI; if(pmpimpi <= ParamMaxOnLine) { gp_Pnt P1 = Value(pmpimpi); Standard_Real d1 = P1.Distance(VTX.Value()); diff --git a/src/IntPatch/IntPatch_ALineToWLine.cxx b/src/IntPatch/IntPatch_ALineToWLine.cxx index 3454d260a1..730cce1bdc 100755 --- a/src/IntPatch/IntPatch_ALineToWLine.cxx +++ b/src/IntPatch/IntPatch_ALineToWLine.cxx @@ -845,7 +845,7 @@ static case GeomAbs_Cylinder: case GeomAbs_Cone: case GeomAbs_Sphere: - pu1=PI+PI; + pu1=M_PI+M_PI; break; default: break; @@ -854,7 +854,7 @@ static case GeomAbs_Cylinder: case GeomAbs_Cone: case GeomAbs_Sphere: - pu2=PI+PI; + pu2=M_PI+M_PI; break; default: break; @@ -928,7 +928,7 @@ void RecadreMemePeriode(const IntSurf_Quadric aQuad1, bBothCylinders=(aType1==GeomAbs_Cylinder && aType2==GeomAbs_Cylinder); // while(anu1-u1 > 5.0) { - u1+=PI+PI; + u1+=M_PI+M_PI; } while(u1-anu1 > 5.0) { // @@ -942,28 +942,28 @@ void RecadreMemePeriode(const IntSurf_Quadric aQuad1, // // In any case the pb does not deal with apex problem. // - if (u1-PI-PI<0.) { + if (u1-M_PI-M_PI<0.) { break; } } */ // - u1-=PI+PI; + u1-=M_PI+M_PI; } while(anu2-u2 > 5.0) { - u2+=PI+PI; + u2+=M_PI+M_PI; } while(u2-anu2 > 5.0) { // /* if (!bBothCylinders) {//cfe900/H6 - if (u2-PI-PI<0.) { + if (u2-M_PI-M_PI<0.) { break; } } */ // - u2-=PI+PI; + u2-=M_PI+M_PI; } } @@ -1028,7 +1028,7 @@ Standard_Boolean IsApex(const IntSurf_Quadric& aQuadric, // // apex on the Sphere if(aType==GeomAbs_Sphere) { - aHalfPi=0.5*PI; + aHalfPi=0.5*M_PI; if (fabs(aVx-aHalfPi)Value(aT1); aQuadric.Parameters(aP1, aU1, aV1); - if(fabs(aU1) > fabs(aU1 - 2.*PI)) { - aUx = 2.*PI; + if(fabs(aU1) > fabs(aU1 - 2.*M_PI)) { + aUx = 2.*M_PI; } else { aUx = 0.; diff --git a/src/IntPatch/IntPatch_GLine.cxx b/src/IntPatch/IntPatch_GLine.cxx index d231a3829d..dafa6b498a 100755 --- a/src/IntPatch/IntPatch_GLine.cxx +++ b/src/IntPatch/IntPatch_GLine.cxx @@ -327,8 +327,8 @@ void IntPatch_GLine::AddVertex (const IntPatch_Point& Pnt) if(ArcType()==IntPatch_Circle || ArcType()==IntPatch_Ellipse) { if(fipt && lapt) { - while(parpl) par-=PI+PI; + while(parpl) par-=M_PI+M_PI; if(parPrecisionPConfusion) { @@ -640,7 +640,7 @@ void IntPatch_GLine::ComputeVertexParameters(const Standard_Real /*Tol*/) Standard_Real ponline = VTX.ParameterOnLine(); // eap, =>> Standard_Real newParam = ponline; - const Standard_Real PiPi = PI+PI; + const Standard_Real PiPi = M_PI+M_PI; Standard_Boolean is2PI = ( Abs(ponline-PiPi) <= PrecisionPConfusion ); if (nbvtx > 2 && // do this check if seam edge only gives vertices @@ -654,7 +654,7 @@ void IntPatch_GLine::ComputeVertexParameters(const Standard_Real /*Tol*/) else newParam -= PiPi; // if( (Abs(ponline)<=PrecisionPConfusion) -// ||(Abs(ponline-PI-PI) <=PrecisionPConfusion)) +// ||(Abs(ponline-M_PI-M_PI) <=PrecisionPConfusion)) // eap, <<= Standard_Real u1a,v1a,u2a,v2a,u1b,v1b,u2b,v2b; VTXM1.Parameters(u1a,v1a,u2a,v2a); @@ -701,7 +701,7 @@ void IntPatch_GLine::ComputeVertexParameters(const Standard_Real /*Tol*/) /////////////////////////////////////////////// // eap, =>> // if (Abs(ponline) <= PrecisionPConfusion) { -// const Standard_Real PiPi = PI+PI; +// const Standard_Real PiPi = M_PI+M_PI; if(newParam >= ParamMinOnLine && newParam <= ParamMaxOnLine /*PiPi >= ParamMinOnLine && PiPi<=ParamMaxOnLine*/) { SortAgain = Standard_True; @@ -743,7 +743,7 @@ void IntPatch_GLine::ComputeVertexParameters(const Standard_Real /*Tol*/) /////////////////////////////////////////////// // eap, =>> // if (Abs(ponline) <= PrecisionPConfusion) { -// const Standard_Real PiPi = PI+PI; +// const Standard_Real PiPi = M_PI+M_PI; if(newParam >= ParamMinOnLine && newParam <= ParamMaxOnLine /*PiPi >= ParamMinOnLine && PiPi<=ParamMaxOnLine*/) { SortAgain = Standard_True; diff --git a/src/IntPatch/IntPatch_ImpImpIntersection_0.gxx b/src/IntPatch/IntPatch_ImpImpIntersection_0.gxx index 76773ff36d..32705947f4 100755 --- a/src/IntPatch/IntPatch_ImpImpIntersection_0.gxx +++ b/src/IntPatch/IntPatch_ImpImpIntersection_0.gxx @@ -300,7 +300,7 @@ static void Recadre(const Handle(Adaptor3d_HSurface)& myHS1, } } if(myHS1IsUPeriodic) { - lmf = PI+PI; //-- myHS1->UPeriod(); + lmf = M_PI+M_PI; //-- myHS1->UPeriod(); f = myHS1->FirstUParameter(); l = myHS1->LastUParameter(); fpls2=0.5*(f+l); @@ -309,7 +309,7 @@ static void Recadre(const Handle(Adaptor3d_HSurface)& myHS1, } if(myHS1IsVPeriodic) { - lmf = PI+PI; //-- myHS1->VPeriod(); + lmf = M_PI+M_PI; //-- myHS1->VPeriod(); f = myHS1->FirstVParameter(); l = myHS1->LastVParameter(); fpls2=0.5*(f+l); @@ -319,7 +319,7 @@ static void Recadre(const Handle(Adaptor3d_HSurface)& myHS1, //-- while(v1 > l) { v1-=lmf; } } if(myHS2IsUPeriodic) { - lmf = PI+PI; //-- myHS2->UPeriod(); + lmf = M_PI+M_PI; //-- myHS2->UPeriod(); f = myHS2->FirstUParameter(); l = myHS2->LastUParameter(); fpls2=0.5*(f+l); @@ -329,7 +329,7 @@ static void Recadre(const Handle(Adaptor3d_HSurface)& myHS1, //-- while(u2 > l) { u2-=lmf; } } if(myHS2IsVPeriodic) { - lmf = PI+PI; //-- myHS2->VPeriod(); + lmf = M_PI+M_PI; //-- myHS2->VPeriod(); f = myHS2->FirstVParameter(); l = myHS2->LastVParameter(); fpls2=0.5*(f+l); @@ -957,8 +957,8 @@ Standard_Boolean FindLine (gp_Pnt& Psurf, { para = ElCLib::Parameter((*((Handle(IntPatch_GLine)*)&lin))->Circle(),Psurf); if ((para <= upper && para >= lower) || - (para + 2.*PI <=upper && para + 2.*PI >= lower) || - (para - 2.*PI <=upper && para - 2.*PI >= lower)) { + (para + 2.*M_PI <=upper && para + 2.*M_PI >= lower) || + (para - 2.*M_PI <=upper && para - 2.*M_PI >= lower)) { pt = ElCLib::Value(para,(*((Handle(IntPatch_GLine)*)&lin))->Circle()); dist = Psurf.Distance(pt); if (dist< distmin) { @@ -973,8 +973,8 @@ Standard_Boolean FindLine (gp_Pnt& Psurf, { para = ElCLib::Parameter((*((Handle(IntPatch_GLine)*)&lin))->Ellipse(),Psurf); if ((para <= upper && para >= lower) || - (para + 2.*PI <=upper && para + 2.*PI >= lower) || - (para - 2.*PI <=upper && para - 2.*PI >= lower)) { + (para + 2.*M_PI <=upper && para + 2.*M_PI >= lower) || + (para - 2.*M_PI <=upper && para - 2.*M_PI >= lower)) { pt = ElCLib::Value(para,(*((Handle(IntPatch_GLine)*)&lin))->Ellipse()); dist = Psurf.Distance(pt); if (dist< distmin) { diff --git a/src/IntPatch/IntPatch_ImpImpIntersection_2.gxx b/src/IntPatch/IntPatch_ImpImpIntersection_2.gxx index da1aac68c8..c5801c2bf1 100755 --- a/src/IntPatch/IntPatch_ImpImpIntersection_2.gxx +++ b/src/IntPatch/IntPatch_ImpImpIntersection_2.gxx @@ -432,7 +432,7 @@ void IntPatch_ImpImpIntersection::Perform(const Handle(Adaptor3d_HSurface)& S1, } break; case GeomAbs_Sphere: { - Ptreference = ElSLib::Value(PI/4.,PI/4.,S1->Sphere()); + Ptreference = ElSLib::Value(M_PI/4.,M_PI/4.,S1->Sphere()); } break; case GeomAbs_Cone: { @@ -558,7 +558,7 @@ void IntPatch_ImpImpIntersection::Perform(const Handle(Adaptor3d_HSurface)& S1, quad2.Parameters(P,u2,v2); point.SetValue(P,TolArc,Standard_False); point.SetParameters(u1,v1,u2,v2); - point.SetParameter(PI+PI); + point.SetParameter(M_PI+M_PI); glin->AddVertex(point); } } @@ -581,7 +581,7 @@ void IntPatch_ImpImpIntersection::Perform(const Handle(Adaptor3d_HSurface)& S1, quad2.Parameters(P,u2,v2); point.SetValue(P,TolArc,Standard_False); point.SetParameters(u1,v1,u2,v2); - point.SetParameter(PI+PI); + point.SetParameter(M_PI+M_PI); glin->AddVertex(point); } } diff --git a/src/IntPatch/IntPatch_ImpImpIntersection_4.gxx b/src/IntPatch/IntPatch_ImpImpIntersection_4.gxx index bedbf7f6d9..e496d03a10 100755 --- a/src/IntPatch/IntPatch_ImpImpIntersection_4.gxx +++ b/src/IntPatch/IntPatch_ImpImpIntersection_4.gxx @@ -311,8 +311,8 @@ Standard_Boolean IntCyCy(const IntSurf_Quadric& Quad1, IntPatch_Point pmult1; IntPatch_Point pmult2; elipsol = inter.Ellipse(1); - gp_Pnt pttang1(ElCLib::Value(PI*0.5,elipsol)); - gp_Pnt pttang2(ElCLib::Value(1.5*PI,elipsol)); + gp_Pnt pttang1(ElCLib::Value(M_PI*0.5,elipsol)); + gp_Pnt pttang2(ElCLib::Value(1.5*M_PI,elipsol)); Multpoint = Standard_True; pmult1.SetValue(pttang1,Tol,Standard_True); @@ -349,17 +349,17 @@ Standard_Boolean IntCyCy(const IntSurf_Quadric& Quad1, //-- Transition calculee au point 0 -> Trans2 , Trans1 //-- car ici, on devarit calculer en PI Handle(IntPatch_GLine) glig = new IntPatch_GLine(elipsol,Standard_False,trans2,trans1); - pmult1.SetParameter(PI/2.); + pmult1.SetParameter(M_PI/2.); glig->AddVertex(pmult1); glig->SetFirstPoint(1); - pmult2.SetParameter(1.5*PI); + pmult2.SetParameter(1.5*M_PI); glig->AddVertex(pmult2); glig->SetLastPoint(2); slin.Append(glig); //-- Transitions calculee au point 0 OK glig = new IntPatch_GLine(elipsol,Standard_False,trans1,trans2); - pmult2.SetParameter(-PI/2.); + pmult2.SetParameter(-M_PI/2.); glig->AddVertex(pmult2); glig->SetFirstPoint(1); glig->AddVertex(pmult1); @@ -375,13 +375,13 @@ Standard_Boolean IntCyCy(const IntSurf_Quadric& Quad1, Standard_Real param2 = ElCLib::Parameter(elipsol,pttang2); Standard_Real parampourtransition; if (param1 < param2) { - pmult1.SetParameter(PI*0.5); - pmult2.SetParameter(1.5*PI); - parampourtransition = PI; + pmult1.SetParameter(M_PI*0.5); + pmult2.SetParameter(1.5*M_PI); + parampourtransition = M_PI; } else { - pmult1.SetParameter(-PI*0.5); - pmult2.SetParameter(PI*0.5); + pmult1.SetParameter(-M_PI*0.5); + pmult2.SetParameter(M_PI*0.5); parampourtransition = 0.0; } @@ -408,10 +408,10 @@ Standard_Boolean IntCyCy(const IntSurf_Quadric& Quad1, slin.Append(glig); if (param1 < param2) { - pmult2.SetParameter(-PI*0.5); + pmult2.SetParameter(-M_PI*0.5); } else { - pmult1.SetParameter(1.5*PI); + pmult1.SetParameter(1.5*M_PI); } //-- Sur l'autre ligne, on invertse la transition diff --git a/src/IntPatch/IntPatch_ImpPrmIntersection.cxx b/src/IntPatch/IntPatch_ImpPrmIntersection.cxx index 2d83c18093..3d2e28bd93 100755 --- a/src/IntPatch/IntPatch_ImpPrmIntersection.cxx +++ b/src/IntPatch/IntPatch_ImpPrmIntersection.cxx @@ -352,24 +352,24 @@ void Recadre(const Standard_Boolean , switch(typeS1) { case GeomAbs_Torus: - while(V1<(V1p-1.5*PI)) V1+=PI+PI; - while(V1>(V1p+1.5*PI)) V1-=PI+PI; + while(V1<(V1p-1.5*M_PI)) V1+=M_PI+M_PI; + while(V1>(V1p+1.5*M_PI)) V1-=M_PI+M_PI; case GeomAbs_Cylinder: case GeomAbs_Cone: case GeomAbs_Sphere: - while(U1<(U1p-1.5*PI)) U1+=PI+PI; - while(U1>(U1p+1.5*PI)) U1-=PI+PI; + while(U1<(U1p-1.5*M_PI)) U1+=M_PI+M_PI; + while(U1>(U1p+1.5*M_PI)) U1-=M_PI+M_PI; } switch(typeS2) { case GeomAbs_Torus: - while(V2<(V2p-1.5*PI)) V2+=PI+PI; - while(V2>(V2p+1.5*PI)) V2-=PI+PI; + while(V2<(V2p-1.5*M_PI)) V2+=M_PI+M_PI; + while(V2>(V2p+1.5*M_PI)) V2-=M_PI+M_PI; case GeomAbs_Cylinder: case GeomAbs_Cone: case GeomAbs_Sphere: - while(U2<(U2p-1.5*PI)) U2+=PI+PI; - while(U2>(U2p+1.5*PI)) U2-=PI+PI; + while(U2<(U2p-1.5*M_PI)) U2+=M_PI+M_PI; + while(U2>(U2p+1.5*M_PI)) U2-=M_PI+M_PI; } pt.SetParameters(U1,V1,U2,V2); } @@ -629,26 +629,26 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur Standard_Real aCf, aTwoPI; // aCf=0.; - aTwoPI=PI+PI; - if ((U1-AnU1) > 1.5*PI) { - while ((U1-AnU1) > (1.5*PI+aCf*aTwoPI)) { + aTwoPI=M_PI+M_PI; + if ((U1-AnU1) > 1.5*M_PI) { + while ((U1-AnU1) > (1.5*M_PI+aCf*aTwoPI)) { aCf=aCf+1.; } U1=U1-aCf*aTwoPI; } // else { - while ((U1-AnU1) < (-1.5*PI-aCf*aTwoPI)) { + while ((U1-AnU1) < (-1.5*M_PI-aCf*aTwoPI)) { aCf=aCf+1.; } U1=U1+aCf*aTwoPI; } // was: - //if ((U1-AnU1) > 1.5*PI) { - // U1-=PI+PI; + //if ((U1-AnU1) > 1.5*M_PI) { + // U1-=M_PI+M_PI; //} - //else if ((U1-AnU1) < -1.5*PI) { - // U1+=PI+PI; + //else if ((U1-AnU1) < -1.5*M_PI) { + // U1+=M_PI+M_PI; //} //modified by NIZNHY-PKV Fri Mar 28 15:06:11 2008t } @@ -662,15 +662,15 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur case GeomAbs_Cone: case GeomAbs_Sphere: case GeomAbs_Torus: - while(U2<(AnU2-1.5*PI)) U2+=PI+PI; - while(U2>(AnU2+1.5*PI)) U2-=PI+PI; + while(U2<(AnU2-1.5*M_PI)) U2+=M_PI+M_PI; + while(U2>(AnU2+1.5*M_PI)) U2-=M_PI+M_PI; break; default: break; } if(typeS2==GeomAbs_Torus) { - while(V2<(AnV2-1.5*PI)) V2+=PI+PI; - while(V2>(AnV2+1.5*PI)) V2-=PI+PI; + while(V2<(AnV2-1.5*M_PI)) V2+=M_PI+M_PI; + while(V2>(AnV2+1.5*M_PI)) V2-=M_PI+M_PI; } thelin->SetUV(k,Standard_True,U2,V2); } @@ -683,15 +683,15 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur case GeomAbs_Cone: case GeomAbs_Sphere: case GeomAbs_Torus: - while(U2<(AnU2-1.5*PI)) U2+=PI+PI; - while(U2>(AnU2+1.5*PI)) U2-=PI+PI; + while(U2<(AnU2-1.5*M_PI)) U2+=M_PI+M_PI; + while(U2>(AnU2+1.5*M_PI)) U2-=M_PI+M_PI; break; default: break; } if(typeS2==GeomAbs_Torus) { - while(V2<(AnV2-1.5*PI)) V2+=PI+PI; - while(V2>(AnV2+1.5*PI)) V2-=PI+PI; + while(V2<(AnV2-1.5*M_PI)) V2+=M_PI+M_PI; + while(V2>(AnV2+1.5*M_PI)) V2-=M_PI+M_PI; } thelin->SetUV(k,Standard_False,U2,V2); @@ -1333,49 +1333,49 @@ static Standard_Real AdjustUFirst(Standard_Real U1,Standard_Real U2) Standard_Real u = U1; // case: no adjustment - if( U1 > 0. && U1 < (2.*PI) ) + if( U1 > 0. && U1 < (2.*M_PI) ) return u; // case: near '0' if( U1 == 0. || fabs(U1) <= 1.e-9 ) { - if( U2 > 0. && U2 < (2.*PI) ) - u = ( U2 < ((2.*PI)-U2) ) ? 0. : (2.*PI); + if( U2 > 0. && U2 < (2.*M_PI) ) + u = ( U2 < ((2.*M_PI)-U2) ) ? 0. : (2.*M_PI); else { Standard_Real uu = U2; - if( U2 > (2.*PI) ) - while( uu > (2.*PI) ) - uu -= (2.*PI); + if( U2 > (2.*M_PI) ) + while( uu > (2.*M_PI) ) + uu -= (2.*M_PI); else while( uu < 0.) - uu += (2.*PI); + uu += (2.*M_PI); - u = ( uu < ((2.*PI)-uu) ) ? 0. : (2.*PI); + u = ( uu < ((2.*M_PI)-uu) ) ? 0. : (2.*M_PI); } } // case: near '2PI' - else if( U1 == (2.*PI) || fabs((2.*PI)-fabs(U1)) <= 1.e-9 ) { - if( U2 > 0. && U2 < (2.*PI) ) - u = ( U2 < ((2.*PI)-U2) ) ? 0. : (2.*PI); + else if( U1 == (2.*M_PI) || fabs((2.*M_PI)-fabs(U1)) <= 1.e-9 ) { + if( U2 > 0. && U2 < (2.*M_PI) ) + u = ( U2 < ((2.*M_PI)-U2) ) ? 0. : (2.*M_PI); else { Standard_Real uu = U2; - if( U2 > (2.*PI) ) - while( uu > (2.*PI) ) - uu -= (2.*PI); + if( U2 > (2.*M_PI) ) + while( uu > (2.*M_PI) ) + uu -= (2.*M_PI); else while( uu < 0.) - uu += (2.*PI); + uu += (2.*M_PI); - u = ( uu < ((2.*PI)-uu) ) ? 0. : (2.*PI); + u = ( uu < ((2.*M_PI)-uu) ) ? 0. : (2.*M_PI); } } // case: '<0. || >2PI' else { if(U1 < 0.) while(u < 0.) - u += 2.*PI; - if(U1 > (2.*PI)) - while(u > (2.*PI)) - u -= (2.*PI); + u += 2.*M_PI; + if(U1 > (2.*M_PI)) + while(u > (2.*M_PI)) + u -= (2.*M_PI); } return u; @@ -1387,15 +1387,15 @@ static Standard_Real AdjustUNext(Standard_Real Un,Standard_Real Up) Standard_Real u = Un; if( Un < 0. ) while(u < 0.) - u += (2.*PI); - else if( Un > (2.*PI) ) - while( u > (2.*PI) ) - u -= (2.*PI); + u += (2.*M_PI); + else if( Un > (2.*M_PI) ) + while( u > (2.*M_PI) ) + u -= (2.*M_PI); else if(Un == 0. || fabs(Un) <= 1.e-9) - u = (fabs(Up) < fabs(2.*PI-Up)) ? 0. : (2.*PI); - else if(Un == (2.*PI) || fabs(Un-(2.*PI)) <= 1.e-9) - u = (fabs(Up) < fabs(2.*PI-Up)) ? 0. : (2.*PI); - else //( Un > 0. && Un < (2.*PI) ) + u = (fabs(Up) < fabs(2.*M_PI-Up)) ? 0. : (2.*M_PI); + else if(Un == (2.*M_PI) || fabs(Un-(2.*M_PI)) <= 1.e-9) + u = (fabs(Up) < fabs(2.*M_PI-Up)) ? 0. : (2.*M_PI); + else //( Un > 0. && Un < (2.*M_PI) ) return u; return u; } @@ -1514,7 +1514,7 @@ static void ForcedPurgePoints(Handle(IntSurf_LineOn2S)& Result, } if(Quad.TypeQuadric() == GeomAbs_Sphere) { - Standard_Real Vapx1 = PI/2., Vapx2 = -PI/2.; + Standard_Real Vapx1 = M_PI/2., Vapx2 = -M_PI/2.; Standard_Real U1 = 0., V1 = 0., U2 = 0., V2 = 0.; if(IsReversed) { Result->Value(1).ParametersOnS2(U1,V1); @@ -1588,12 +1588,12 @@ static void SearchVertices(const Handle(IntSurf_LineOn2S)& Line, static inline Standard_Boolean IsSeamParameter(const Standard_Real U, const Standard_Real TOL2D) { - return (fabs(U) <= TOL2D || fabs(2.*PI - U) <= TOL2D); + return (fabs(U) <= TOL2D || fabs(2.*M_PI - U) <= TOL2D); } static inline Standard_Real AdjustU(const Standard_Real U) { - Standard_Real u = U, DBLPI = 2.*PI; + Standard_Real u = U, DBLPI = 2.*M_PI; if(u < 0. || u > DBLPI) { if(u < 0.) while(u < 0.) @@ -1679,7 +1679,7 @@ static Standard_Boolean InsertSeamVertices(Handle(IntSurf_LineOn2S)& Line, else Line->Value(ipp).ParametersOnS1(U1,V1); // S1 - quadric Standard_Real u = AdjustUFirst(U,U1); - if(fabs(u-U) >= 1.5*PI) { + if(fabs(u-U) >= 1.5*M_PI) { Standard_Real U2 = 0., V2 = 0.; if(IsReversed) { Line->Value(ip).ParametersOnS1(U2,V2); // prm @@ -1707,11 +1707,11 @@ static Standard_Boolean InsertSeamVertices(Handle(IntSurf_LineOn2S)& Line, } U1 = AdjustU(U1); U2 = AdjustU(U2); - Standard_Boolean pnearZero = (fabs(U1) < fabs(2.*PI-U1)) ? Standard_True : Standard_False; - Standard_Boolean cnearZero = (fabs(U) < fabs(2.*PI-U)) ? Standard_True : Standard_False; + Standard_Boolean pnearZero = (fabs(U1) < fabs(2.*M_PI-U1)) ? Standard_True : Standard_False; + Standard_Boolean cnearZero = (fabs(U) < fabs(2.*M_PI-U)) ? Standard_True : Standard_False; if(pnearZero == cnearZero) { if(!IsSeamParameter(U2,TOL2D) && !IsSeamParameter(U1,TOL2D)) { - Standard_Real nU = (cnearZero) ? (2.*PI) : 0.; + Standard_Real nU = (cnearZero) ? (2.*M_PI) : 0.; IntSurf_PntOn2S nP; nP.SetValue(aP.Value()); Standard_Real U3 = 0., V3 = 0.; @@ -1733,7 +1733,7 @@ static Standard_Boolean InsertSeamVertices(Handle(IntSurf_LineOn2S)& Line, } else { if(!IsSeamParameter(U2,TOL2D) && !IsSeamParameter(U1,TOL2D)) { - Standard_Real nU = (cnearZero) ? (2.*PI) : 0.; + Standard_Real nU = (cnearZero) ? (2.*M_PI) : 0.; IntSurf_PntOn2S nP; nP.SetValue(aP.Value()); Standard_Real U3 = 0., V3 = 0.; @@ -1829,10 +1829,10 @@ static void ToSmooth(Handle(IntSurf_LineOn2S)& Line, } if(!doU && Quad.TypeQuadric() == GeomAbs_Sphere) { - if(fabs(fabs(U1)-fabs(U2)) > (PI/16.)) doU = Standard_True; + if(fabs(fabs(U1)-fabs(U2)) > (M_PI/16.)) doU = Standard_True; - if(doU && (fabs(U1) <= 1.e-9 || fabs(U1-2.*PI) <= 1.e-9)) { - if(fabs(V1-PI/2.) <= 1.e-9 || fabs(V1+PI/2.) <= 1.e-9) {} + if(doU && (fabs(U1) <= 1.e-9 || fabs(U1-2.*M_PI) <= 1.e-9)) { + if(fabs(V1-M_PI/2.) <= 1.e-9 || fabs(V1+M_PI/2.) <= 1.e-9) {} else { doU = Standard_False; } @@ -1843,9 +1843,9 @@ static void ToSmooth(Handle(IntSurf_LineOn2S)& Line, Standard_Real Uapx = 0., Vapx = 0.; Quad.Parameters(Quad.Cone().Apex(),Uapx,Vapx); - if(fabs(fabs(U1)-fabs(U2)) > PI/32.) doU = Standard_True; + if(fabs(fabs(U1)-fabs(U2)) > M_PI/32.) doU = Standard_True; - if(doU && (fabs(U1) <= 1.e-9 || fabs(U1-2.*PI) <= 1.e-9)) { + if(doU && (fabs(U1) <= 1.e-9 || fabs(U1-2.*M_PI) <= 1.e-9)) { if(fabs(V1-Vapx) <= 1.e-9) {} else { doU = Standard_False; @@ -1957,7 +1957,7 @@ static void VerifyVertices(Handle(IntSurf_LineOn2S)& Line, FConjugated = 0; } if(IsSeamParameter(Uv,TOL2D)) { - Standard_Real Ucv = (fabs(Uv) < fabs(2.*PI-Uv)) ? (2.*PI) : 0.; + Standard_Real Ucv = (fabs(Uv) < fabs(2.*M_PI-Uv)) ? (2.*M_PI) : 0.; gp_Pnt2d a2DCV(Ucv,Vv); Standard_Real CDist = a2DCV.Distance(a2DPF); if(CDist < DistMinF) { @@ -1990,7 +1990,7 @@ static void VerifyVertices(Handle(IntSurf_LineOn2S)& Line, LConjugated = 0; } if(IsSeamParameter(Uv,TOL2D)) { - Standard_Real Ucv = (fabs(Uv) < fabs(2.*PI-Uv)) ? (2.*PI) : 0.; + Standard_Real Ucv = (fabs(Uv) < fabs(2.*M_PI-Uv)) ? (2.*M_PI) : 0.; gp_Pnt2d a2DCV(Ucv,Vv); Standard_Real CDist = a2DCV.Distance(a2DPL); if(CDist < DistMinL) { @@ -2014,7 +2014,7 @@ static void VerifyVertices(Handle(IntSurf_LineOn2S)& Line, else aV.ParametersOnS1(Uv,Vv); if(IsSeamParameter(Uv,TOL2D)) { - Standard_Real Ucv = (fabs(Uv) < fabs(2.*PI-Uv)) ? (2.*PI) : 0.; + Standard_Real Ucv = (fabs(Uv) < fabs(2.*M_PI-Uv)) ? (2.*M_PI) : 0.; Standard_Boolean test = TestMiddleOnPrm(aPF,aV,IsReversed,ArcTol,PDomain); if(test) { VrtF.SetValue(aV.Value()); @@ -2057,7 +2057,7 @@ static void VerifyVertices(Handle(IntSurf_LineOn2S)& Line, else aV.ParametersOnS1(Uv,Vv); if(IsSeamParameter(Uv,TOL2D)) { - Standard_Real Ucv = (fabs(Uv) < fabs(2.*PI-Uv)) ? (2.*PI) : 0.; + Standard_Real Ucv = (fabs(Uv) < fabs(2.*M_PI-Uv)) ? (2.*M_PI) : 0.; Standard_Boolean test = TestMiddleOnPrm(aPL,aV,IsReversed,ArcTol,PDomain); if(test) { VrtL.SetValue(aV.Value()); @@ -2334,8 +2334,8 @@ void DecomposeResult(Handle(IntPatch_Line)& Line, Standard_Integer NbPnts = SSLine->NbPoints(); - Standard_Real BSEAM = 1.5*PI; // delta U crossing seam - Standard_Real BAPEX = PI/16.; // delta U crossing apex + Standard_Real BSEAM = 1.5*M_PI; // delta U crossing seam + Standard_Real BAPEX = M_PI/16.; // delta U crossing apex Standard_Integer i = 0, k = 0; Standard_Real U1 = 0., U2 = 0., V1 = 0., V2 = 0., AnU1 = 0., AnV1 = 0., DU1 = 0., DV1 = 0.; diff --git a/src/IntPatch/IntPatch_Intersection.cxx b/src/IntPatch/IntPatch_Intersection.cxx index 43b5c04f92..c647e58136 100755 --- a/src/IntPatch/IntPatch_Intersection.cxx +++ b/src/IntPatch/IntPatch_Intersection.cxx @@ -285,7 +285,7 @@ static void FUN_GetUiso(const Handle(Geom_Surface)& GS, if(T != GeomAbs_OffsetSurface) { Handle(Geom_Curve) gc = GS->UIso(U); - if(IsVP && (FirstV == 0.0 && LastV == (2.*PI))) I = gc; + if(IsVP && (FirstV == 0.0 && LastV == (2.*M_PI))) I = gc; else { Handle(Geom_TrimmedCurve) gtc = new Geom_TrimmedCurve(gc,FirstV,LastV); @@ -303,7 +303,7 @@ static void FUN_GetUiso(const Handle(Geom_Surface)& GS, if(IsVP || IsVC || GACT == GeomAbs_BSplineCurve || GACT == GeomAbs_BezierCurve || Abs(LastV - FirstV) < 1.e+5) { Handle(Geom_Curve) gc = gos->UIso(U); - if(IsVP && (FirstV == 0.0 && LastV == (2*PI))) I = gc; + if(IsVP && (FirstV == 0.0 && LastV == (2*M_PI))) I = gc; else { Handle(Geom_TrimmedCurve) gtc = new Geom_TrimmedCurve(gc,FirstV,LastV); @@ -355,7 +355,7 @@ static void FUN_GetViso(const Handle(Geom_Surface)& GS, if(T != GeomAbs_OffsetSurface) { Handle(Geom_Curve) gc = GS->VIso(V); - if(IsUP && (FirstU == 0.0 && LastU == (2*PI))) I = gc; + if(IsUP && (FirstU == 0.0 && LastU == (2*M_PI))) I = gc; else { Handle(Geom_TrimmedCurve) gtc = new Geom_TrimmedCurve(gc,FirstU,LastU); @@ -373,7 +373,7 @@ static void FUN_GetViso(const Handle(Geom_Surface)& GS, if(IsUP || IsUC || GACT == GeomAbs_BSplineCurve || GACT == GeomAbs_BezierCurve || Abs(LastU - FirstU) < 1.e+5) { Handle(Geom_Curve) gc = gos->VIso(V); - if(IsUP && (FirstU == 0.0 && LastU == (2*PI))) I = gc; + if(IsUP && (FirstU == 0.0 && LastU == (2*M_PI))) I = gc; else { Handle(Geom_TrimmedCurve) gtc = new Geom_TrimmedCurve(gc,FirstU,LastU); diff --git a/src/IntPatch/IntPatch_LineConstructor.cxx b/src/IntPatch/IntPatch_LineConstructor.cxx index c152abc4d3..b24e020dd3 100755 --- a/src/IntPatch/IntPatch_LineConstructor.cxx +++ b/src/IntPatch/IntPatch_LineConstructor.cxx @@ -88,28 +88,28 @@ static void Recadre(const Handle(Adaptor3d_HSurface)& myHS1, } } if(myHS1IsUPeriodic) { - lmf = PI+PI; //-- myHS1->UPeriod(); + lmf = M_PI+M_PI; //-- myHS1->UPeriod(); f = myHS1->FirstUParameter(); l = myHS1->LastUParameter(); while(u1 < f) { u1+=lmf; } while(u1 > l) { u1-=lmf; } } if(myHS1IsVPeriodic) { - lmf = PI+PI; //-- myHS1->VPeriod(); + lmf = M_PI+M_PI; //-- myHS1->VPeriod(); f = myHS1->FirstVParameter(); l = myHS1->LastVParameter(); while(v1 < f) { v1+=lmf; } while(v1 > l) { v1-=lmf; } } if(myHS2IsUPeriodic) { - lmf = PI+PI; //-- myHS2->UPeriod(); + lmf = M_PI+M_PI; //-- myHS2->UPeriod(); f = myHS2->FirstUParameter(); l = myHS2->LastUParameter(); while(u2 < f) { u2+=lmf; } while(u2 > l) { u2-=lmf; } } if(myHS2IsVPeriodic) { - lmf = PI+PI; //-- myHS2->VPeriod(); + lmf = M_PI+M_PI; //-- myHS2->VPeriod(); f = myHS2->FirstVParameter(); l = myHS2->LastVParameter(); while(v2 < f) { v2+=lmf; } @@ -318,7 +318,7 @@ static Standard_Real LocalLastParameter (const Handle(IntPatch_Line)& L) case IntPatch_Circle: case IntPatch_Ellipse: - lastp = PI+PI; + lastp = M_PI+M_PI; break; default: { @@ -694,9 +694,9 @@ static void AddLine(const Handle(IntPatch_Line)& L, if(i!=j) { if ((typl == IntPatch_Circle || typl == IntPatch_Ellipse) && i>j) { IntPatch_Point Vtx=GLine->Vertex(j); - Vtx.SetParameter(GLine->Vertex(j).ParameterOnLine()+PI+PI); + Vtx.SetParameter(GLine->Vertex(j).ParameterOnLine()+M_PI+M_PI); glig->AddVertex(Vtx); - IndexLastVertex+=AppendSameVertexG(glig,GLine,j,PI+PI,TabIndex); + IndexLastVertex+=AppendSameVertexG(glig,GLine,j,M_PI+M_PI,TabIndex); } else { glig->AddVertex(GLine->Vertex(j)); @@ -1468,12 +1468,12 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinref, } if(typl == IntPatch_Circle || typl == IntPatch_Ellipse) { firstp = GLine->Vertex(nbvtx).ParameterOnLine(); - lastp = PI + PI + GLine->Vertex(1).ParameterOnLine(); + lastp = M_PI + M_PI + GLine->Vertex(1).ParameterOnLine(); Standard_Real cadrinf = LocalFirstParameter(L); Standard_Real cadrsup = LocalLastParameter(L); Standard_Real acadr = (firstp+lastp)*0.5; - while(acadr < cadrinf) { acadr+=PI+PI; } - while(acadr > cadrsup) { acadr-=PI+PI; } + while(acadr < cadrinf) { acadr+=M_PI+M_PI; } + while(acadr > cadrsup) { acadr-=M_PI+M_PI; } if(acadr>=cadrinf && acadr<=cadrsup) { if(Abs(firstp-lastp)>Precision::PConfusion()) { intrvtested = Standard_True; diff --git a/src/IntPatch/IntPatch_RstInt.cxx b/src/IntPatch/IntPatch_RstInt.cxx index c480bb8b8f..a90b6af1fc 100755 --- a/src/IntPatch/IntPatch_RstInt.cxx +++ b/src/IntPatch/IntPatch_RstInt.cxx @@ -56,15 +56,15 @@ static void Recadre(GeomAbs_SurfaceType typeS1, case GeomAbs_Cone: case GeomAbs_Sphere: case GeomAbs_Torus: - while(U1<(U1p-1.5*PI)) U1+=PI+PI; - while(U1>(U1p+1.5*PI)) U1-=PI+PI; + while(U1<(U1p-1.5*M_PI)) U1+=M_PI+M_PI; + while(U1>(U1p+1.5*M_PI)) U1-=M_PI+M_PI; break; default: break; } if(typeS1==GeomAbs_Torus) { - while(V1<(V1p-1.5*PI)) V1+=PI+PI; - while(V1>(V1p+1.5*PI)) V1-=PI+PI; + while(V1<(V1p-1.5*M_PI)) V1+=M_PI+M_PI; + while(V1>(V1p+1.5*M_PI)) V1-=M_PI+M_PI; } switch(typeS2) { @@ -72,15 +72,15 @@ static void Recadre(GeomAbs_SurfaceType typeS1, case GeomAbs_Cone: case GeomAbs_Sphere: case GeomAbs_Torus: - while(U2<(U2p-1.5*PI)) U2+=PI+PI; - while(U2>(U2p+1.5*PI)) U2-=PI+PI; + while(U2<(U2p-1.5*M_PI)) U2+=M_PI+M_PI; + while(U2>(U2p+1.5*M_PI)) U2-=M_PI+M_PI; break; default: break; } if(typeS2==GeomAbs_Torus) { - while(V2<(V1p-1.5*PI)) V2+=PI+PI; - while(V2>(V2p+1.5*PI)) V2-=PI+PI; + while(V2<(V1p-1.5*M_PI)) V2+=M_PI+M_PI; + while(V2>(V2p+1.5*M_PI)) V2-=M_PI+M_PI; } } @@ -579,8 +579,8 @@ void IntPatch_RstInt::PutVertexOnLine (Handle(IntPatch_Line)& L, BPLin.Get(xmin,ymin,xmax,ymax); g = BPLin.GetGap(); BPLin.SetVoid(); - BPLin.Update(xmin-PI-PI,ymin, - xmax+PI+PI,ymax); + BPLin.Update(xmin-M_PI-M_PI,ymin, + xmax+M_PI+M_PI,ymax); BPLin.SetGap(g); } if(SurfaceIsBiPeriodic) { @@ -588,8 +588,8 @@ void IntPatch_RstInt::PutVertexOnLine (Handle(IntPatch_Line)& L, BPLin.Get(xmin,ymin,xmax,ymax); g = BPLin.GetGap(); BPLin.SetVoid(); - BPLin.Update(xmin,ymin-PI-PI, - xmax,ymax+PI+PI); + BPLin.Update(xmin,ymin-M_PI-M_PI, + xmax,ymax+M_PI+M_PI); BPLin.SetGap(g); } @@ -627,15 +627,15 @@ void IntPatch_RstInt::PutVertexOnLine (Handle(IntPatch_Line)& L, do { if(IndiceOffsetBiPeriodic == 1) - OffsetV = -PI-PI; + OffsetV = -M_PI-M_PI; else if(IndiceOffsetBiPeriodic == 2) - OffsetV = PI+PI; + OffsetV = M_PI+M_PI; do { if(IndiceOffsetPeriodic == 1) - OffsetU = -PI-PI; + OffsetU = -M_PI-M_PI; else if(IndiceOffsetPeriodic == 2) - OffsetU = PI+PI; + OffsetU = M_PI+M_PI; Brise.SetOffset(OffsetU,OffsetV); @@ -1134,10 +1134,10 @@ void IntPatch_RstInt::PutVertexOnLine (Handle(IntPatch_Line)& L, case GeomAbs_Cylinder: case GeomAbs_Cone: case GeomAbs_Sphere: - pu1=PI+PI; + pu1=M_PI+M_PI; break; case GeomAbs_Torus: - pu1=pv1=PI+PI; + pu1=pv1=M_PI+M_PI; break; default: { @@ -1165,10 +1165,10 @@ void IntPatch_RstInt::PutVertexOnLine (Handle(IntPatch_Line)& L, case GeomAbs_Cone: case GeomAbs_Sphere: - pu2=PI+PI; + pu2=M_PI+M_PI; break; case GeomAbs_Torus: - pu2=pv2=PI+PI; + pu2=pv2=M_PI+M_PI; break; default: { diff --git a/src/IntTools/IntTools_FClass2d.cxx b/src/IntTools/IntTools_FClass2d.cxx index 59e8dcb8b2..9c3d67c06d 100755 --- a/src/IntTools/IntTools_FClass2d.cxx +++ b/src/IntTools/IntTools_FClass2d.cxx @@ -473,21 +473,21 @@ || surf->GetType()==GeomAbs_Torus || surf->GetType()==GeomAbs_Sphere || surf->GetType()==GeomAbs_SurfaceOfRevolution) { - Standard_Real uuu=PI+PI-(Umax-Umin); + Standard_Real uuu=M_PI+M_PI-(Umax-Umin); if(uuu<0) uuu=0; U1 = Umin-uuu*0.5; - U2 = U1+PI+PI; + U2 = U1+M_PI+M_PI; } else { U1=U2=0.0; } if(surf->GetType()==GeomAbs_Torus) { - Standard_Real uuu=PI+PI-(Vmax-Vmin); + Standard_Real uuu=M_PI+M_PI-(Vmax-Vmin); if(uuu<0) uuu=0; V1 = Vmin-uuu*0.5; - V2 = V1+PI+PI; + V2 = V1+M_PI+M_PI; } else { V1=V2=0.0; diff --git a/src/IntTools/IntTools_FaceFace.cxx b/src/IntTools/IntTools_FaceFace.cxx index a70db802c3..3ceb05ffda 100755 --- a/src/IntTools/IntTools_FaceFace.cxx +++ b/src/IntTools/IntTools_FaceFace.cxx @@ -756,8 +756,8 @@ void IntTools_FaceFace::SetList(IntSurf_ListOfPntOn2S& aListOfPnts) Standard_Real eps = 1.e-14; if(!aPlDir.IsEqual(aCirDir, eps)) { Standard_Integer aNbP = 11; - Standard_Real dt = 2.*PI / (aNbP - 1), t; - for(t = 0.; t < 2.*PI; t += dt) { + Standard_Real dt = 2.*M_PI / (aNbP - 1), t; + for(t = 0.; t < 2.*M_PI; t += dt) { Standard_Real d = aPln.Distance(ElCLib::Value(t, aCir)); if(myTolReached3d < d) myTolReached3d = d; } @@ -1134,7 +1134,7 @@ void IntTools_FaceFace::SetList(IntSurf_ListOfPntOn2S& aListOfPnts) TColStd_SequenceOfReal aSeqFprm, aSeqLprm; aNul=0.; - aPeriod=PI+PI; + aPeriod=M_PI+M_PI; for (i=1; i<=aNbParts; i++) { myLConstruct.Part(i, fprm, lprm); @@ -1201,7 +1201,7 @@ void IntTools_FaceFace::SetList(IntSurf_ListOfPntOn2S& aListOfPnts) lprm=aSeqLprm(i); // Standard_Real aRealEpsilon=RealEpsilon(); - if (Abs(fprm) > aRealEpsilon || Abs(lprm-2.*PI) > aRealEpsilon) { + if (Abs(fprm) > aRealEpsilon || Abs(lprm-2.*M_PI) > aRealEpsilon) { //============================================== //// IntTools_Curve aCurve; @@ -1248,14 +1248,14 @@ void IntTools_FaceFace::SetList(IntSurf_ListOfPntOn2S& aListOfPnts) } mySeqOfCurve.Append(aCurve); //============================================== - } //if (Abs(fprm) > RealEpsilon() || Abs(lprm-2.*PI) > RealEpsilon()) + } //if (Abs(fprm) > RealEpsilon() || Abs(lprm-2.*M_PI) > RealEpsilon()) else { // on regarde si on garde // if (aNbParts==1) { -// if (Abs(fprm) < RealEpsilon() && Abs(lprm-2.*PI) < RealEpsilon()) { - if (Abs(fprm) <= aRealEpsilon && Abs(lprm-2.*PI) <= aRealEpsilon) { +// if (Abs(fprm) < RealEpsilon() && Abs(lprm-2.*M_PI) < RealEpsilon()) { + if (Abs(fprm) <= aRealEpsilon && Abs(lprm-2.*M_PI) <= aRealEpsilon) { IntTools_Curve aCurve; Handle(Geom_TrimmedCurve) aTC3D=new Geom_TrimmedCurve(newc,fprm,lprm); aCurve.SetCurve(aTC3D); @@ -1296,7 +1296,7 @@ void IntTools_FaceFace::SetList(IntSurf_ListOfPntOn2S& aListOfPnts) // Standard_Real aTwoPIdiv17, u1, v1, u2, v2, Tol; - aTwoPIdiv17=2.*PI/17.; + aTwoPIdiv17=2.*M_PI/17.; for (j=0; j<=17; j++) { gp_Pnt ptref (newc->Value (j*aTwoPIdiv17)); @@ -3125,7 +3125,7 @@ Standard_Integer ComputeTangentZones( const Handle(GeomAdaptor_HSurface)& theSur GeomAdaptor_Curve aC1( new Geom_Circle(aCircle1) ); GeomAdaptor_Curve aC2( new Geom_Circle(aCircle2) ); - Extrema_ExtCC anExtrema(aC1, aC2, 0, 2.*Standard_PI, 0, 2.*Standard_PI, + Extrema_ExtCC anExtrema(aC1, aC2, 0, 2. * M_PI, 0, 2. * M_PI, Precision::PConfusion(), Precision::PConfusion()); if ( anExtrema.IsDone() ) { @@ -3170,7 +3170,7 @@ Standard_Integer ComputeTangentZones( const Handle(GeomAdaptor_HSurface)& theSur aSeqResultRad.Append( aCriteria ); // torus is u and v periodic - const Standard_Real twoPI = Standard_PI + Standard_PI; + const Standard_Real twoPI = M_PI + M_PI; Standard_Real arr1tmp[2] = {pr1.X(), pr1.Y()}; Standard_Real arr2tmp[2] = {pr2.X(), pr2.Y()}; @@ -3622,7 +3622,7 @@ Standard_Boolean DecompositionOfWLine(const Handle(IntPatch_WLine)& theWLine, else { Standard_Real anAngle = aNewVec.Angle(aVecOld); - if((fabs(anAngle) < (Standard_PI * 0.25)) && (aNewVec.Dot(aVecOld) > 0.)) { + if((fabs(anAngle) < (M_PI * 0.25)) && (aNewVec.Dot(aVecOld) > 0.)) { if(bCheckAngle1) { Standard_Real U1, U2, V1, V2; diff --git a/src/IntTools/IntTools_LineConstructor.cxx b/src/IntTools/IntTools_LineConstructor.cxx index 302485f711..d61733cfa1 100755 --- a/src/IntTools/IntTools_LineConstructor.cxx +++ b/src/IntTools/IntTools_LineConstructor.cxx @@ -93,28 +93,28 @@ static void Recadre(const Handle(GeomAdaptor_HSurface)& myHS1, } } if(myHS1IsUPeriodic) { - const Standard_Real lmf = PI+PI; //-- myHS1->UPeriod(); + const Standard_Real lmf = M_PI+M_PI; //-- myHS1->UPeriod(); const Standard_Real f = myHS1->FirstUParameter(); const Standard_Real l = myHS1->LastUParameter(); while(u1 < f) { u1+=lmf; } while(u1 > l) { u1-=lmf; } } if(myHS1IsVPeriodic) { - const Standard_Real lmf = PI+PI; //-- myHS1->VPeriod(); + const Standard_Real lmf = M_PI+M_PI; //-- myHS1->VPeriod(); const Standard_Real f = myHS1->FirstVParameter(); const Standard_Real l = myHS1->LastVParameter(); while(v1 < f) { v1+=lmf; } while(v1 > l) { v1-=lmf; } } if(myHS2IsUPeriodic) { - const Standard_Real lmf = PI+PI; //-- myHS2->UPeriod(); + const Standard_Real lmf = M_PI+M_PI; //-- myHS2->UPeriod(); const Standard_Real f = myHS2->FirstUParameter(); const Standard_Real l = myHS2->LastUParameter(); while(u2 < f) { u2+=lmf; } while(u2 > l) { u2-=lmf; } } if(myHS2IsVPeriodic) { - const Standard_Real lmf = PI+PI; //-- myHS2->VPeriod(); + const Standard_Real lmf = M_PI+M_PI; //-- myHS2->VPeriod(); const Standard_Real f = myHS2->FirstVParameter(); const Standard_Real l = myHS2->LastVParameter(); while(v2 < f) { v2+=lmf; } @@ -340,12 +340,12 @@ void IntTools_LineConstructor::Perform(const Handle(IntPatch_Line)& L) if(typl == IntPatch_Circle || typl == IntPatch_Ellipse) { firstp = GeomInt_LineTool::Vertex(L,nbvtx).ParameterOnLine(); - lastp = PI + PI + GeomInt_LineTool::Vertex(L,1).ParameterOnLine(); + lastp = M_PI + M_PI + GeomInt_LineTool::Vertex(L,1).ParameterOnLine(); const Standard_Real cadrinf = GeomInt_LineTool::FirstParameter(L); const Standard_Real cadrsup = GeomInt_LineTool::LastParameter(L); Standard_Real acadr = (firstp+lastp)*0.5; - while(acadr < cadrinf) { acadr+=PI+PI; } - while(acadr > cadrsup) { acadr-=PI+PI; } + while(acadr < cadrinf) { acadr+=M_PI+M_PI; } + while(acadr > cadrsup) { acadr-=M_PI+M_PI; } if(acadr>=cadrinf && acadr<=cadrsup) { if(Abs(firstp-lastp)>Precision::PConfusion()) @@ -747,7 +747,7 @@ void IntTools_LineConstructor::PeriodicLine (const Handle(IntPatch_Line)& L) con } } if (changevtx) { - thevtx.SetParameter(prm + 2.*PI); + thevtx.SetParameter(prm + 2.*M_PI); glin->Replace(i,thevtx); } } diff --git a/src/IntTools/IntTools_Tools.cxx b/src/IntTools/IntTools_Tools.cxx index d416fc9e12..aad794629e 100755 --- a/src/IntTools/IntTools_Tools.cxx +++ b/src/IntTools/IntTools_Tools.cxx @@ -270,7 +270,7 @@ static Standard_Real IntTools_Tools::IntermediatePoint (const Standard_Real aFirst, const Standard_Real aLast) { - //define parameter division number as 10*e^(-PI) = 0.43213918 + //define parameter division number as 10*e^(-M_PI) = 0.43213918 const Standard_Real PAR_T = 0.43213918; Standard_Real aParm; aParm=(1.-PAR_T)*aFirst + PAR_T*aLast; diff --git a/src/IntTools/IntTools_TopolTool.cxx b/src/IntTools/IntTools_TopolTool.cxx index 51c01d70ef..beb68cbff4 100755 --- a/src/IntTools/IntTools_TopolTool.cxx +++ b/src/IntTools/IntTools_TopolTool.cxx @@ -104,7 +104,7 @@ void IntTools_TopolTool::ComputeSamplePoints() break; case GeomAbs_Cylinder: { Standard_Real aRadius = myS->Cylinder().Radius(); - Standard_Real aMaxAngle = Standard_PI * 0.5; + Standard_Real aMaxAngle = M_PI * 0.5; Standard_Real aDeflection = 1.e-02; if(aRadius > aDeflection) { @@ -133,7 +133,7 @@ void IntTools_TopolTool::ComputeSamplePoints() if(aRadius < aCircle.Radius()) aRadius = aCircle.Radius(); - Standard_Real aMaxAngle = Standard_PI * 0.5; + Standard_Real aMaxAngle = M_PI * 0.5; Standard_Real aDeflection = 1.e-02; if(aRadius > aDeflection) { @@ -177,7 +177,7 @@ void IntTools_TopolTool::ComputeSamplePoints() aRadius1 = aSphere.Radius(); aRadius2 = aSphere.Radius(); } - Standard_Real aMaxAngle = Standard_PI * 0.5; + Standard_Real aMaxAngle = M_PI * 0.5; Standard_Real aDeflection = 1.e-02; if(aRadius1 > aDeflection) { @@ -187,7 +187,7 @@ void IntTools_TopolTool::ComputeSamplePoints() if(aMaxAngle > Precision::Angular()) { nbsu = Standard_Integer((usup - uinf) / aMaxAngle); } - aMaxAngle = Standard_PI * 0.5; + aMaxAngle = M_PI * 0.5; if(aRadius2 > aDeflection) { aMaxAngle = ACos(1. - aDeflection / aRadius2) * 2.; diff --git a/src/IntWalk/IntWalk_PWalking_1.gxx b/src/IntWalk/IntWalk_PWalking_1.gxx index 6e9913923a..8cb1a63151 100755 --- a/src/IntWalk/IntWalk_PWalking_1.gxx +++ b/src/IntWalk/IntWalk_PWalking_1.gxx @@ -1359,7 +1359,7 @@ Standard_Boolean IntWalk_PWalking::ExtendLineInCommonZone(const IntImp_ConstIsop anIsoDir = gp_Dir2d(1, 0); if(aTangentZoneDir.SquareMagnitude() > gp::Resolution()) { - Standard_Real piquota = PI*0.25; + Standard_Real piquota = M_PI*0.25; if(fabs(aTangentZoneDir.Angle(anIsoDir)) > piquota) { Standard_Integer ii = 1, nextii = 2; diff --git a/src/IntWalk/IntWalk_PWalking_3.gxx b/src/IntWalk/IntWalk_PWalking_3.gxx index f4ea8e7015..be205011a5 100755 --- a/src/IntWalk/IntWalk_PWalking_3.gxx +++ b/src/IntWalk/IntWalk_PWalking_3.gxx @@ -109,7 +109,7 @@ } //================================================================================== //OCC431(apo): modified -> - static Standard_Real CosRef2D = Cos(PI/9.0), AngRef2D = PI/2.0; + static Standard_Real CosRef2D = Cos(M_PI/9.0), AngRef2D = M_PI/2.0; static Standard_Real /*tolArea = 100.0,*/ d = 7.0; Standard_Real tolArea = 100.0; diff --git a/src/LProp/LProp_AnalyticCurInf.cxx b/src/LProp/LProp_AnalyticCurInf.cxx index 9957754e3a..1f50ff8fef 100755 --- a/src/LProp/LProp_AnalyticCurInf.cxx +++ b/src/LProp/LProp_AnalyticCurInf.cxx @@ -35,12 +35,12 @@ void LProp_AnalyticCurInf::Perform (const GeomAbs_CurveType CType, case GeomAbs_Ellipse: { Standard_Real U1,U2,U3,U4; - Standard_Real UFPlus2PI = UFirst + 2*PI; + Standard_Real UFPlus2PI = UFirst + 2*M_PI; U1 = ElCLib::InPeriod(0.0 ,UFirst,UFPlus2PI); - U2 = ElCLib::InPeriod(PI/2. ,UFirst,UFPlus2PI); - U3 = ElCLib::InPeriod(PI ,UFirst,UFPlus2PI); - U4 = ElCLib::InPeriod(3.*PI/2.,UFirst,UFPlus2PI); + U2 = ElCLib::InPeriod(M_PI/2. ,UFirst,UFPlus2PI); + U3 = ElCLib::InPeriod(M_PI ,UFirst,UFPlus2PI); + U4 = ElCLib::InPeriod(3.*M_PI/2.,UFirst,UFPlus2PI); if (UFirst <= U1 && U1 <= ULast) {Result.AddExtCur(U1, IsMin);} if (UFirst <= U2 && U2 <= ULast) {Result.AddExtCur(U2, IsMax);} diff --git a/src/LocOpe/LocOpe.cxx b/src/LocOpe/LocOpe.cxx index 6e68ef76b2..7ca861b3c3 100755 --- a/src/LocOpe/LocOpe.cxx +++ b/src/LocOpe/LocOpe.cxx @@ -143,7 +143,7 @@ Standard_Boolean LocOpe::TgtFaces(const TopoDS_Edge& E, Standard_Boolean rev1 = (F1.Orientation() == TopAbs_REVERSED); Standard_Boolean rev2 = (F2.Orientation() == TopAbs_REVERSED); - Standard_Real f,l,eps,angmin = PI,angmax = -PI,ang; + Standard_Real f,l,eps,angmin = M_PI,angmax = -M_PI,ang; BRep_Tool::Range(e,f,l); eps = (l - f)/100.; diff --git a/src/LocOpe/LocOpe_CSIntersector.cxx b/src/LocOpe/LocOpe_CSIntersector.cxx index 8737a311bd..3b3e8e9a1c 100755 --- a/src/LocOpe/LocOpe_CSIntersector.cxx +++ b/src/LocOpe/LocOpe_CSIntersector.cxx @@ -131,7 +131,7 @@ void LocOpe_CSIntersector::Perform(const LocOpe_SequenceOfCirc& Scir) TopExp_Explorer exp(myShape,TopAbs_FACE); Handle(GeomAdaptor_HCurve) HC = new GeomAdaptor_HCurve (); Standard_Real binf = 0.; - Standard_Real bsup = 2.*PI; + Standard_Real bsup = 2.*M_PI; for (; exp.More(); exp.Next()) { diff --git a/src/LocOpe/LocOpe_CurveShapeIntersector.cxx b/src/LocOpe/LocOpe_CurveShapeIntersector.cxx index 19626d1c1c..fecfa8181e 100755 --- a/src/LocOpe/LocOpe_CurveShapeIntersector.cxx +++ b/src/LocOpe/LocOpe_CurveShapeIntersector.cxx @@ -57,7 +57,7 @@ void LocOpe_CurveShapeIntersector::Init(const gp_Circ& C, Standard_Real Tol = Precision::Confusion(); Handle(Geom_Circle) GC = new Geom_Circle(C); - GeomAdaptor_Curve AC(GC,0.,2.*PI); + GeomAdaptor_Curve AC(GC,0.,2.*M_PI); BRepIntCurveSurface_Inter theInt; theInt.Init(S,AC,Tol); diff --git a/src/LocOpe/LocOpe_FindEdges.cxx b/src/LocOpe/LocOpe_FindEdges.cxx index 1ccfc40c7d..5f531b46b5 100755 --- a/src/LocOpe/LocOpe_FindEdges.cxx +++ b/src/LocOpe/LocOpe_FindEdges.cxx @@ -116,21 +116,21 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom, Standard_Real prm1 = ElCLib::Parameter(cit,p1); Standard_Real Tol2d = Precision::PConfusion(); if (Abs(prm1-ft) <= Tol2d) prm1 = ft; - prm1 = ElCLib::InPeriod(prm1,ft,ft+2.*PI); + prm1 = ElCLib::InPeriod(prm1,ft,ft+2.*M_PI); ElCLib::D1(prm1,cit,p1,tgt); Standard_Real prm2 = ElCLib::Parameter(cit,p2); if (tgt.Dot(tgf) > 0.) { // meme sens while (prm2 <= prm1) { - prm2 += 2.*PI; + prm2 += 2.*M_PI; } } else { if (Abs(prm1-ft) <= Precision::Angular()) { - prm1 += 2.*PI; + prm1 += 2.*M_PI; } while (prm2 >= prm1) { - prm2 -= 2.*PI; + prm2 -= 2.*M_PI; } } @@ -168,21 +168,21 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom, p2 = ElCLib::Value(lf,cif); Standard_Real prm1 = ElCLib::Parameter(cit,p1); - prm1 = ElCLib::InPeriod(prm1,ft,ft+2.*PI); + prm1 = ElCLib::InPeriod(prm1,ft,ft+2.*M_PI); ElCLib::D1(prm1,cit,p1,tgt); Standard_Real prm2 = ElCLib::Parameter(cit,p2); if (tgt.Dot(tgf) > 0.) { // meme sens while (prm2 <= prm1) { - prm2 += 2.*PI; + prm2 += 2.*M_PI; } } else { if (Abs(prm1-ft) <= Precision::Angular()) { - prm1 += 2.*PI; + prm1 += 2.*M_PI; } while (prm2 >= prm1) { - prm2 -= 2.*PI; + prm2 -= 2.*M_PI; } } diff --git a/src/LocOpe/LocOpe_Generator.cxx b/src/LocOpe/LocOpe_Generator.cxx index 15986e21f3..6838b8ae7d 100755 --- a/src/LocOpe/LocOpe_Generator.cxx +++ b/src/LocOpe/LocOpe_Generator.cxx @@ -558,13 +558,13 @@ void LocOpe_Generator::Perform(const Handle(LocOpe_GeneratedShape)& G) pl = C2d->Value(l); Standard_Real tttol = Precision::Angular(); while (Min(pf.X(),pl.X()) >= Umaxc-tttol) { - C2d->Translate(gp_Vec2d(-2.*PI,0)); + C2d->Translate(gp_Vec2d(-2.*M_PI,0)); pf = C2d->Value(f); pl = C2d->Value(l); } while (Max(pf.X(),pl.X()) <= Uminc+tttol) { - C2d->Translate(gp_Vec2d(2.*PI,0)); + C2d->Translate(gp_Vec2d(2.*M_PI,0)); pf = C2d->Value(f); pl = C2d->Value(l); } @@ -880,13 +880,13 @@ void LocOpe_Generator::Perform(const Handle(LocOpe_GeneratedShape)& G) pl = C2d->Value(l); Standard_Real tttol = Precision::Angular(); while (Min(pf.X(),pl.X()) >= Umaxc - tttol) { - C2d->Translate(gp_Vec2d(-2.*PI,0)); + C2d->Translate(gp_Vec2d(-2.*M_PI,0)); pf = C2d->Value(f); pl = C2d->Value(l); } while (Max(pf.X(),pl.X()) <= Uminc + tttol) { - C2d->Translate(gp_Vec2d(2.*PI,0)); + C2d->Translate(gp_Vec2d(2.*M_PI,0)); pf = C2d->Value(f); pl = C2d->Value(l); } @@ -1251,12 +1251,12 @@ Standard_Real NewParameter(const TopoDS_Edge& Edg, if (exp.More()) { Standard_Real prmmax = BRep_Tool::Parameter (TopoDS::Vertex(exp.Current()),NewEdg); - if (Abs(prmmax - prm) <= Epsilon(2.*PI)) { + if (Abs(prmmax - prm) <= Epsilon(2.*M_PI)) { if (orient == TopAbs_REVERSED) { - prm -= 2.*PI; + prm -= 2.*M_PI; } else { - prm += 2.*PI; + prm += 2.*M_PI; } } } diff --git a/src/LocOpe/LocOpe_SplitShape.cxx b/src/LocOpe/LocOpe_SplitShape.cxx index d6c8a9e1ef..8b26897e67 100755 --- a/src/LocOpe/LocOpe_SplitShape.cxx +++ b/src/LocOpe/LocOpe_SplitShape.cxx @@ -1095,7 +1095,7 @@ static void ChoixUV(const TopoDS_Edge& Last, Handle(Geom2d_Curve) C2d; Standard_Integer index = 0, imin=0; - Standard_Real angmax = -PI, dist, ang; + Standard_Real angmax = -M_PI, dist, ang; for (It.Initialize(Poss); It.More(); It.Next()) { @@ -1139,7 +1139,7 @@ static void ChoixUV(const TopoDS_Edge& Last, ang = ref2d.Angle(gp_Dir2d(v2d)); } else { - ang = -PI; + ang = -M_PI; } //if ((dist < dmin - tol) || diff --git a/src/LocalAnalysis/LocalAnalysis_CurveContinuity.cxx b/src/LocalAnalysis/LocalAnalysis_CurveContinuity.cxx index fbf89d6cdd..b6bd22e88f 100755 --- a/src/LocalAnalysis/LocalAnalysis_CurveContinuity.cxx +++ b/src/LocalAnalysis/LocalAnalysis_CurveContinuity.cxx @@ -30,7 +30,7 @@ void LocalAnalysis_CurveContinuity::CurvC1( GeomLProp_CLProps& Curv1, { myLambda1 = norm2 / norm1;} else { myLambda1 = norm1 / norm2;} ang= V1.Angle(V2); - if (ang>PI/2) myContC1=PI-ang; + if (ang>M_PI/2) myContC1=M_PI-ang; else myContC1=ang; } else {myIsDone= Standard_False; @@ -62,7 +62,7 @@ void LocalAnalysis_CurveContinuity::CurvC2(GeomLProp_CLProps& Curv1, else {myLambda1 = norm1 / norm2; myLambda2 = norm12 / norm22;} ang=V12.Angle(V22); - if (ang>PI/2) myContC2=PI-ang; + if (ang>M_PI/2) myContC2=M_PI-ang; else myContC2=ang; } else{myIsDone= Standard_False ; @@ -82,7 +82,7 @@ void LocalAnalysis_CurveContinuity::CurvG1 ( GeomLProp_CLProps& Curv1, { Curv1.Tangent(Tang1); Curv2.Tangent(Tang2); ang=Tang1.Angle(Tang2); - if (ang>PI/2) myContG1=PI-ang; + if (ang>M_PI/2) myContG1=M_PI-ang; else myContG1=ang; } else {myIsDone= Standard_False ; @@ -107,7 +107,7 @@ void LocalAnalysis_CurveContinuity::CurvG2( GeomLProp_CLProps& Curv1, Curv1.Normal(D1); Curv2.Normal(D2); ang =D1.Angle(D2); - if (ang>PI/2) myContG2=PI-ang; + if (ang>M_PI/2) myContG2=M_PI-ang; else myContG2=ang; myCourbC1= Curv1.Curvature(); myCourbC2 = Curv2.Curvature(); @@ -197,7 +197,7 @@ Standard_Boolean LocalAnalysis_CurveContinuity::IsC0() const Standard_Boolean LocalAnalysis_CurveContinuity::IsC1() const { if (!myIsDone) { StdFail_NotDone::Raise();} - if ( IsC0() && ( (myContC1 <= myepsC1)||(Abs(myContC1-PI)<=myepsC1))) + if ( IsC0() && ( (myContC1 <= myepsC1)||(Abs(myContC1-M_PI)<=myepsC1))) return Standard_True; else return Standard_False; } @@ -209,7 +209,7 @@ Standard_Boolean LocalAnalysis_CurveContinuity::IsC2() const if (!myIsDone) { StdFail_NotDone::Raise();} if ( IsC1()) - { if ((myContC2 <= myepsC2)||(Abs(myContC2-PI)<=myepsC2)) + { if ((myContC2 <= myepsC2)||(Abs(myContC2-M_PI)<=myepsC2)) { epsil1 = 0.5*myepsC1*myepsC1*myLambda1; epsil2 = 0.5*myepsC2*myepsC2*myLambda2; if ( (Abs(myLambda1*myLambda1-myLambda2)) <= (epsil1*epsil1+epsil2)) @@ -226,7 +226,7 @@ Standard_Boolean LocalAnalysis_CurveContinuity::IsC2() const Standard_Boolean LocalAnalysis_CurveContinuity::IsG1() const { if (!myIsDone) { StdFail_NotDone::Raise();} - if ( IsC0() && (( myContG1 <= myepsG1||(Abs(myContG1-PI)<=myepsG1)))) + if ( IsC0() && (( myContG1 <= myepsG1||(Abs(myContG1-M_PI)<=myepsG1)))) return Standard_True; else return Standard_False; } @@ -253,7 +253,7 @@ Standard_Boolean LocalAnalysis_CurveContinuity::IsG2()const else IETA2=1; if (IETA1 == IETA2) { if (IETA1 == 1) - { Standard_Real eps= RealPart( (myContG2+myepsG2)/PI) * PI; + { Standard_Real eps= RealPart( (myContG2+myepsG2)/M_PI) * M_PI; if (Abs( eps - myepsG2) < myepsG2) {if (myG2Variation < myperce ) return Standard_True; diff --git a/src/LocalAnalysis/LocalAnalysis_SurfaceContinuity.cxx b/src/LocalAnalysis/LocalAnalysis_SurfaceContinuity.cxx index ac1ddb67c9..2bfb74a808 100755 --- a/src/LocalAnalysis/LocalAnalysis_SurfaceContinuity.cxx +++ b/src/LocalAnalysis/LocalAnalysis_SurfaceContinuity.cxx @@ -51,10 +51,10 @@ void LocalAnalysis_SurfaceContinuity::SurfC1( GeomLProp_SLProps& Surf1, myLambda1V= norm2v / norm1v; else myLambda1V = norm2v / norm1v; angu= V1u.Angle(V2u); - if (angu>PI/2) myContC1U=PI-angu; + if (angu>M_PI/2) myContC1U=M_PI-angu; else myContC1U=angu; angv= V1v.Angle(V2v); - if (angv>PI/2) myContC1V=PI-angv; + if (angv>M_PI/2) myContC1V=M_PI-angv; else myContC1V=angv; } else {myIsDone = Standard_False; myErrorStatus=LocalAnalysis_NullFirstDerivative;} @@ -85,7 +85,7 @@ void LocalAnalysis_SurfaceContinuity::SurfC2( GeomLProp_SLProps& Surf1, else {myLambda1U = norm11u / norm12u; myLambda2U = norm21u / norm22u;} ang=V21u.Angle(V22u); - if(ang>PI/2) myContC2U=PI-ang; + if(ang>M_PI/2) myContC2U=M_PI-ang; else myContC2U=ang; } else { myIsDone=Standard_False; @@ -112,7 +112,7 @@ void LocalAnalysis_SurfaceContinuity::SurfC2( GeomLProp_SLProps& Surf1, else{ myLambda1V = norm11v / norm12v; myLambda2V = norm21v / norm22v;} ang= V21v.Angle(V22v); - if (ang>PI/2) myContC2V=PI-ang; + if (ang>M_PI/2) myContC2V=M_PI-ang; else myContC2V=ang; } else{ myIsDone= Standard_False; @@ -129,7 +129,7 @@ void LocalAnalysis_SurfaceContinuity::SurfG1( GeomLProp_SLProps& Surf1, { gp_Dir D1 = Surf1.Normal(); gp_Dir D2 = Surf2.Normal(); Standard_Real ang=D1.Angle(D2); - if (ang>PI/2) myContG1= PI-ang; + if (ang>M_PI/2) myContG1= M_PI-ang; else myContG1=ang; } else{ myIsDone=Standard_False; diff --git a/src/MAT2d/MAT2d_Tool2d.cxx b/src/MAT2d/MAT2d_Tool2d.cxx index 019dad58f4..85ed625b24 100755 --- a/src/MAT2d/MAT2d_Tool2d.cxx +++ b/src/MAT2d/MAT2d_Tool2d.cxx @@ -469,7 +469,7 @@ Standard_Boolean MAT2d_Tool2d::TrimBisector ::DownCast(ChangeGeomBis(abisector->BisectorNumber()).ChangeValue()); if(bisector->BasisCurve()->IsPeriodic() && param == Precision::Infinite()) { - param = bisector->FirstParameter() + 2*PI; + param = bisector->FirstParameter() + 2*M_PI; } if (param > bisector->BasisCurve()->LastParameter()) { param = bisector->BasisCurve()->LastParameter(); @@ -500,7 +500,7 @@ Standard_Boolean MAT2d_Tool2d::TrimBisector Param = Bis->Parameter(GeomPnt (apoint)); if (Bisector->BasisCurve()->IsPeriodic()) { - if (Bisector->FirstParameter() > Param) Param = Param + 2*PI; + if (Bisector->FirstParameter() > Param) Param = Param + 2*M_PI; } if(Bisector->FirstParameter() >= Param)return Standard_False; if(Bisector->LastParameter() < Param)return Standard_False; @@ -552,7 +552,7 @@ Standard_Boolean MAT2d_Tool2d::Projection (const Standard_Integer IEdge , if (theCircuit->ConnexionOn(INext)) { ParamMax = theCircuit->Connexion(INext)->ParameterOnFirst(); if (Curve->BasisCurve()->IsPeriodic()){ - ElCLib::AdjustPeriodic(0.,2*PI,Eps,ParamMin,ParamMax); + ElCLib::AdjustPeriodic(0.,2*M_PI,Eps,ParamMin,ParamMax); } } //--------------------------------------------------------------------- @@ -564,7 +564,7 @@ Standard_Boolean MAT2d_Tool2d::Projection (const Standard_Integer IEdge , Standard_Real R = C1.Circle().Radius(); Standard_Real EpsCirc = Eps; if ( R < 1.) EpsCirc = Eps/R; - if (!((ParamMax - ParamMin + 2*EpsCirc) < 2*PI)) { + if (!((ParamMax - ParamMin + 2*EpsCirc) < 2*M_PI)) { ParamMax = ParamMax + EpsCirc; ParamMin = ParamMin - EpsCirc; } } @@ -1186,7 +1186,7 @@ IntRes2d_Domain Domain(const Handle(Geom2d_TrimmedCurve)& Bisector1, IntRes2d_Domain Domain1(Bisector1->Value(Param1),Param1,Tolerance, Bisector1->Value(Param2),Param2,Tolerance); if(Bisector1->BasisCurve()->IsPeriodic()) { - Domain1.SetEquivalentParameters(0.,2.*PI); + Domain1.SetEquivalentParameters(0.,2.*M_PI); } return Domain1; } diff --git a/src/OpenGl/OpenGl_GraphicDriver_710.cxx b/src/OpenGl/OpenGl_GraphicDriver_710.cxx index e7dcf0941d..cac27443c7 100755 --- a/src/OpenGl/OpenGl_GraphicDriver_710.cxx +++ b/src/OpenGl/OpenGl_GraphicDriver_710.cxx @@ -122,7 +122,7 @@ void OpenGl_GraphicDriver::Text atext.Height = float (AHeight); if (atext.Height < 0) atext.Height = DefaultTextHeight(); - atext.Angle = float (Standard_PI / 2.); + atext.Angle = float (M_PI / 2.); atext.Path = int (Graphic3d_TP_RIGHT); atext.HAlign = int (Graphic3d_HTA_LEFT); atext.VAlign = int (Graphic3d_VTA_BOTTOM); diff --git a/src/OpenGl/OpenGl_LightBox.cxx b/src/OpenGl/OpenGl_LightBox.cxx index eb45de9b78..630d815ffb 100755 --- a/src/OpenGl/OpenGl_LightBox.cxx +++ b/src/OpenGl/OpenGl_LightBox.cxx @@ -65,10 +65,6 @@ HISTORIQUE DES MODIFICATIONS : #define GROW_SIZE_WKS 10 #define GROW_SIZE_LIGHT 8 -#ifndef M_PI -# define M_PI 3.14159265358979323846 -#endif - /*----------------------------------------------------------------------*/ /* * Types definis diff --git a/src/OpenGl/OpenGl_tgl_all.hxx b/src/OpenGl/OpenGl_tgl_all.hxx index 2b3c8408d3..6bad6c5a43 100755 --- a/src/OpenGl/OpenGl_tgl_all.hxx +++ b/src/OpenGl/OpenGl_tgl_all.hxx @@ -34,12 +34,6 @@ xx-xx-xx : xxx ; Creation. #include #include - -#ifdef WNT -// CAL : pas trouve de definition de PI dans les includes WNT -#define M_PI 3.14159265358979323846 -#endif - #include #include diff --git a/src/OpenGl/OpenGl_triedron.cxx b/src/OpenGl/OpenGl_triedron.cxx index 23b05d836c..6860bfce92 100755 --- a/src/OpenGl/OpenGl_triedron.cxx +++ b/src/OpenGl/OpenGl_triedron.cxx @@ -79,10 +79,6 @@ from higher API */ #define NO_PRINT #define NO_PRINT_MATRIX -#ifndef M_PI -# define M_PI 3.14159265358979323846 -#endif - /* on trouve que 10 vues sera suffisant */ #define GROW_SIZE_NZ_WKS 10 diff --git a/src/PS/PS_Driver.cxx b/src/PS/PS_Driver.cxx index 92f11255ea..e5e37051f3 100755 --- a/src/PS/PS_Driver.cxx +++ b/src/PS/PS_Driver.cxx @@ -924,7 +924,7 @@ Standard_Boolean PS_Driver::PlotArc (const Standard_ShortReal Xpos, << Ypos + aYradius*Sin(san) << " " << MOVETO; (*Cout()) << GSAVE << Xpos << " " << Ypos << " " << aXradius << " "; - if (Abs(fan)-Abs(san) >= 2.*PI) { + if (Abs(fan)-Abs(san) >= 2.*M_PI) { (*Cout()) << " 0 360 " << ARC << STROKE << GRESTORE << endl; } else { Standard_Real a1 = san/DRAD; @@ -949,14 +949,14 @@ Standard_Boolean PS_Driver::PlotPolyArc (const Standard_ShortReal Xpos, if (Abs(aXradius-aYradius) <= 1.) { PLOT_PCOLOR (myPolyColorIndex); - if (Abs(oAngle) < 2.*PI) + if (Abs(oAngle) < 2.*M_PI) (*Cout()) << Xpos << " " << Ypos << " " << MOVETO; else (*Cout()) << Xpos + aXradius*Cos(san) << " " << Ypos + aXradius*Sin(san) << " " << MOVETO; (*Cout()) << GSAVE << Xpos << " " << Ypos << " " << aXradius << " "; - if (Abs(fan) - Abs(san) >= 2.*PI) { + if (Abs(fan) - Abs(san) >= 2.*M_PI) { (*Cout()) << " 0 360 " << ARC << FILL << GRESTORE << endl; } else { Standard_Real a1 = san/DRAD; diff --git a/src/Plate/Plate_FreeGtoCConstraint.cxx b/src/Plate/Plate_FreeGtoCConstraint.cxx index 0c266cd652..d5969c27f4 100755 --- a/src/Plate/Plate_FreeGtoCConstraint.cxx +++ b/src/Plate/Plate_FreeGtoCConstraint.cxx @@ -53,7 +53,7 @@ Plate_FreeGtoCConstraint::Plate_FreeGtoCConstraint(const gp_XY& point2d,const Pl Standard_Real s = N0.CrossMagnitude(N1); if((s < 1.e-2)&&(c<0.)) return; Standard_Real angle = atan2(c,s); - //if (angle < 0.) angle += PI; + //if (angle < 0.) angle += M_PI; gp_XYZ d = N0^N1; d.Normalize(); diff --git a/src/PlotMgt/PlotMgt_PlotterDriver.cxx b/src/PlotMgt/PlotMgt_PlotterDriver.cxx index b71692c7b8..d6dee95f9e 100755 --- a/src/PlotMgt/PlotMgt_PlotterDriver.cxx +++ b/src/PlotMgt/PlotMgt_PlotterDriver.cxx @@ -624,10 +624,10 @@ Standard_Boolean PlotMgt_PlotterDriver::DrawArc (const Standard_ShortReal X, { Standard_Boolean Done = Standard_False; float san, oan; - if (anOpenAngle == 0.F || anOpenAngle > 2*PI) { - san = 0.F; oan = 2.*PI; + if (anOpenAngle == 0.F || anOpenAngle > 2*M_PI) { + san = 0.F; oan = 2.*M_PI; } else if (anOpenAngle < 0.F) { - san = 2.*PI + aStartAngle + anOpenAngle; + san = 2.*M_PI + aStartAngle + anOpenAngle; oan = -anOpenAngle; } else { san = aStartAngle; oan = anOpenAngle; @@ -646,7 +646,7 @@ Standard_Boolean PlotMgt_PlotterDriver::DrawArc (const Standard_ShortReal X, if (aRadius > precis) value = Max (0.0044, Min (0.7854, 2. * ACos(1.-precis/aRadius))); else - value = PI/4.; + value = M_PI/4.; Standard_Integer nbpoints = Min(MAXPOINT, Standard_Integer(Abs(oan)/value)+2); @@ -675,10 +675,10 @@ Standard_Boolean PlotMgt_PlotterDriver::DrawPolyArc (const Standard_ShortReal X, { Standard_Boolean Done = Standard_False; float san, oan; - if (anOpenAngle == 0.F || anOpenAngle > 2*PI) { - san = 0.F; oan = 2.*PI; + if (anOpenAngle == 0.F || anOpenAngle > 2*M_PI) { + san = 0.F; oan = 2.*M_PI; } else if (anOpenAngle < 0.F) { - san = 2.*PI + aStartAngle + anOpenAngle; + san = 2.*M_PI + aStartAngle + anOpenAngle; oan = -anOpenAngle; } else { san = aStartAngle; oan = anOpenAngle; @@ -698,7 +698,7 @@ Standard_Boolean PlotMgt_PlotterDriver::DrawPolyArc (const Standard_ShortReal X, if (aRadius > precis) value = Max (0.0044, Min (0.7854, 2. * ACos(1.-precis/aRadius))); else - value = PI/4.; + value = M_PI/4.; Standard_Integer nbpoints = Min(MAXPOINT, Standard_Integer(Abs(oan)/value)+2); @@ -741,8 +741,8 @@ void PlotMgt_PlotterDriver::DrawMarker (const Standard_Integer aMarker, const TColStd_Array1OfBoolean& ams = MarkMap ()->Entry(aMarker+1).Style().SValues(); Standard_Integer i, sl, su; - Standard_ShortReal Ca = (float)Cos((3*Standard_PI)/2+Angle), - Sa = (float)Sin((3*Standard_PI)/2+Angle); + Standard_ShortReal Ca = (float)Cos((3 * M_PI) / 2 + Angle), + Sa = (float)Sin((3 * M_PI) / 2 + Angle); Standard_ShortReal dx, dy, Cx, Cy; // Remember the old attributes diff --git a/src/PlotMgt/PlotMgt_fillpolyarc.cxx b/src/PlotMgt/PlotMgt_fillpolyarc.cxx index 8b21898fba..4dad00d1d2 100755 --- a/src/PlotMgt/PlotMgt_fillpolyarc.cxx +++ b/src/PlotMgt/PlotMgt_fillpolyarc.cxx @@ -26,9 +26,11 @@ //-------------------------------------------------------- #include #include +#ifndef __MATH_WNT_H +# include +#endif /* __MATH_WNT_H */ #include #include -#define Standard_PI (3.14159) #define maxDouble ((double)1.E+30) //-------------------------------------------------------- @@ -109,12 +111,12 @@ double fsqrt(double a) // Determine is angle a is between b and b+c (c>0) int mpo_inside(double a, double b, double c) { - while (b<0) {b += 2*Standard_PI;}; b -= 2*Standard_PI*ftrunc(b/(2*Standard_PI)); - c -= 2*Standard_PI*ftrunc(c/(2*Standard_PI)); - while (a<0) {a+=2*Standard_PI;}; a -= 2*Standard_PI*ftrunc(a/(2*Standard_PI)); -// while(c<0) {c+=2*Standard_PI;}; c-=2*Standard_PI*ftrunc(c/(2*Standard_PI)); + while (b<0) {b += 2*M_PI;}; b -= 2*M_PI*ftrunc(b/(2*M_PI)); + c -= 2*M_PI*ftrunc(c/(2*M_PI)); + while (a<0) {a+=2*M_PI;}; a -= 2*M_PI*ftrunc(a/(2*M_PI)); +// while(c<0) {c+=2*M_PI;}; c-=2*M_PI*ftrunc(c/(2*M_PI)); if ((a > b) && (a < b+c)) return 1; - else if ((2*Standard_PI+a > b) && (2*Standard_PI+a < b+c)) return 1; + else if ((2*M_PI+a > b) && (2*M_PI+a < b+c)) return 1; return 0; } @@ -122,7 +124,7 @@ int __InitFillArc(double X, double Y, double a, double b, double alpha, double beta, double gamma, double delta, double step) { int i ; - alpha -= 2*Standard_PI*ftrunc(alpha/(2*Standard_PI)); beta -= 2*Standard_PI*ftrunc(beta/(2*Standard_PI)); + alpha -= 2*M_PI*ftrunc(alpha/(2*M_PI)); beta -= 2*M_PI*ftrunc(beta/(2*M_PI)); if (beta < 0.0) { alpha += beta; beta = -beta; @@ -137,16 +139,16 @@ int __InitFillArc(double X, double Y, double a, double b, double alpha, int size = int( ftrunc(2*Ys/step) + 1 ); // cout << "Ysize = " << Ys << endl << flush; // cout << "Size = " << size << endl << flush; -// cout << "Alpha = " << alpha*180/Standard_PI << endl << flush; -// cout << "Beta = " << beta*180/Standard_PI << endl << flush; +// cout << "Alpha = " << alpha*180/M_PI << endl << flush; +// cout << "Beta = " << beta*180/M_PI << endl << flush; mpo_lines = (mpo_one_line*)malloc(sizeof(mpo_one_line)*size); for ( i = 0; i < size; i++) { double Yt = Ys - i*step; (mpo_lines+i)->X1 = (-C2*Yt - fsqrt(C2*C2*Yt*Yt - C1*(C3*Yt*Yt - a*a*b*b)))/C1; (mpo_lines+i)->X2 = (-C2*Yt + fsqrt(C2*C2*Yt*Yt - C1*(C3*Yt*Yt - a*a*b*b)))/C1; -// cout << "alpha = " << alpha*180/Standard_PI << " alpha+beta = " << (alpha+beta)*180/Standard_PI << endl << flush; -// cout << "" << fatan2(Yt, (mpo_lines+i)->X2)*180/Standard_PI << " type " << (mpo_lines+i)->type << endl << flush;; +// cout << "alpha = " << alpha*180/M_PI << " alpha+beta = " << (alpha+beta)*180/M_PI << endl << flush; +// cout << "" << fatan2(Yt, (mpo_lines+i)->X2)*180/M_PI << " type " << (mpo_lines+i)->type << endl << flush;; // cout << "Xleft = " << (mpo_lines+i)->X1 << " Xright = " << (mpo_lines+i)->X2 << endl << flush; // cout << "C2*C2 - C1*(C3*Yt*Yt - a*a*b*b) = " << C2*C2 - C1*(C3*Yt*Yt - a*a*b*b) << endl << flush; // cout << "C1*(C3*Yt*Yt - a*a*b*b) = " << C1*(C3*Yt*Yt - a*a*b*b) << endl << flush; diff --git a/src/Poly/Poly_MakeLoops.cxx b/src/Poly/Poly_MakeLoops.cxx index dae17d882f..c80a65bf32 100755 --- a/src/Poly/Poly_MakeLoops.cxx +++ b/src/Poly/Poly_MakeLoops.cxx @@ -584,7 +584,7 @@ Standard_Integer Poly_MakeLoops3D::chooseLeftWay const Standard_Integer theSegIndex, const NCollection_List& theLstIndS) const { - Standard_Real aAngleMin = ::PI * 2; + Standard_Real aAngleMin = M_PI * 2; gp_Dir aNormal; const Helper* aHelper = getHelper(); if (!aHelper->GetNormal (theNode, aNormal)) @@ -623,8 +623,8 @@ Standard_Integer Poly_MakeLoops3D::chooseLeftWay aTgt = aTgtXYZ; Standard_Real aAngle = aTgt.AngleWithRef(aTgtRef, aNormal); - if (aAngle < 1e-4 - ::PI) - aAngle = ::PI; + if (aAngle < 1e-4 - M_PI) + aAngle = M_PI; if (aAngle < aAngleMin) { aAngleMin = aAngle; @@ -657,7 +657,7 @@ Standard_Integer Poly_MakeLoops2D::chooseLeftWay const Standard_Integer theSegIndex, const NCollection_List& theLstIndS) const { - Standard_Real aAngleMin = ::PI * 2; + Standard_Real aAngleMin = M_PI * 2; const Helper* aHelper = getHelper(); Link aLink = getLink(theSegIndex); gp_Dir2d aTgtRef; @@ -682,8 +682,8 @@ Standard_Integer Poly_MakeLoops2D::chooseLeftWay Standard_Real aAngle = aTgt.Angle(aTgtRef); if (myRightWay) aAngle = -aAngle; - if (aAngle < 1e-4 - ::PI) - aAngle = ::PI; + if (aAngle < 1e-4 - M_PI) + aAngle = M_PI; if (aAngle < aAngleMin) { aAngleMin = aAngle; diff --git a/src/Primitives/Primitives_OneAxis.gxx b/src/Primitives/Primitives_OneAxis.gxx index 3f329b03c8..40aa8ec207 100755 --- a/src/Primitives/Primitives_OneAxis.gxx +++ b/src/Primitives/Primitives_OneAxis.gxx @@ -88,7 +88,7 @@ Primitives_OneAxis::Primitives_OneAxis(const TheBuilder& B, const Standard_Real VMax) : myBuilder(B), myAxes(A), - myAngle(2*PI), + myAngle(2*M_PI), myVMin(VMin), myVMax(VMax), myMeridianOffset(0) @@ -247,7 +247,7 @@ Standard_Boolean Primitives_OneAxis::HasBottom() const Standard_Boolean Primitives_OneAxis::HasSides() const { - return 2*PI - myAngle > Precision::Angular(); + return 2*M_PI - myAngle > Precision::Angular(); } //======================================================================= diff --git a/src/ProjLib/ProjLib_ComputeApprox.cxx b/src/ProjLib/ProjLib_ComputeApprox.cxx index 5c131d73a4..bfe23b84ae 100755 --- a/src/ProjLib/ProjLib_ComputeApprox.cxx +++ b/src/ProjLib/ProjLib_ComputeApprox.cxx @@ -122,9 +122,9 @@ static gp_Pnt2d Function_Value(const Standard_Real U, if ( VCouture) { if(SType == GeomAbs_Sphere) { - if ( Abs( S - U1 ) > PI ) { - T = PI - T; - S = PI + S; + if ( Abs( S - U1 ) > M_PI ) { + T = M_PI - T; + S = M_PI + S; } S = ElCLib::InPeriod(S, U1, U2); } @@ -236,7 +236,7 @@ static void Function_SetUVBounds(Standard_Real& myU1, } else { UCouture = Standard_True; - myU2 = myU1 + 2*PI; + myU2 = myU1 + 2*M_PI; } } @@ -257,17 +257,17 @@ static void Function_SetUVBounds(Standard_Real& myU1, ElSLib::Parameters( Cone, P, U, V); U += Delta; d = U - U1; - if(d > PI) { - if( ( (IsEqual(U,(2*PI),1.e-10) && (U1 >= 0. && U1 <= PI)) && + if(d > M_PI) { + if( ( (IsEqual(U,(2*M_PI),1.e-10) && (U1 >= 0. && U1 <= M_PI)) && (IsEqual(U,Ul,1.e-10) && !IsEqual(Uf,0.,1.e-10)) ) && isclandper ) U = 0.; - else Delta -= 2*PI; + else Delta -= 2*M_PI; U += Delta; d = U - U1; } - else if(d < -PI) { - if( ( (IsEqual(U,0.,1.e-10) && (U1 >= PI && U1 <= (2*PI))) && - (IsEqual(U,Ul,1.e-10) && !IsEqual(Uf,(2*PI),1.e-10)) ) && isclandper ) U = 2*PI; - else Delta += 2*PI; + else if(d < -M_PI) { + if( ( (IsEqual(U,0.,1.e-10) && (U1 >= M_PI && U1 <= (2*M_PI))) && + (IsEqual(U,Ul,1.e-10) && !IsEqual(Uf,(2*M_PI),1.e-10)) ) && isclandper ) U = 2*M_PI; + else Delta += 2*M_PI; U += Delta; d = U - U1; } @@ -280,11 +280,11 @@ static void Function_SetUVBounds(Standard_Real& myU1, if(!(Abs(pmin - W1) <= Precision::PConfusion() || Abs(pmin - W2) <= Precision::PConfusion()) ) myU1 -= dmax*.5; if(!(Abs(pmax - W1) <= Precision::PConfusion() || Abs(pmax - W2) <= Precision::PConfusion()) ) myU2 += dmax*.5; - if((myU1 >=0. && myU1 <= 2*PI) && (myU2 >=0. && myU2 <= 2*PI) ) UCouture = Standard_False; + if((myU1 >=0. && myU1 <= 2*M_PI) && (myU2 >=0. && myU2 <= 2*M_PI) ) UCouture = Standard_False; else{ U = ( myU1 + myU2 ) /2.; - myU1 = U - PI; - myU2 = U + PI; + myU1 = U - M_PI; + myU2 = U + M_PI; UCouture = Standard_True; } } @@ -309,18 +309,18 @@ static void Function_SetUVBounds(Standard_Real& myU1, if ( !myCurve->IsClosed()) { if ( myU1 < U && U < myU2) { U = ( myU1 + myU2 ) /2.; - myU1 = U - PI; - myU2 = U + PI; + myU1 = U - M_PI; + myU2 = U + M_PI; } else { U = ( myU1 + myU2 ) /2.; if ( myU1 < U) { - myU1 = U - 2*PI; + myU1 = U - 2*M_PI; myU2 = U; } else { myU1 = U; - myU2 = U + 2*PI; + myU2 = U + 2*M_PI; } } UCouture = Standard_True; @@ -335,11 +335,11 @@ static void Function_SetUVBounds(Standard_Real& myU1, UCouture = Standard_True; if ( dU > 0.) { - myU2 = myU1 + 2*PI; + myU2 = myU1 + 2*M_PI; } else { myU2 = myU1; - myU1 -= 2*PI; + myU1 -= 2*M_PI; } } } @@ -347,7 +347,7 @@ static void Function_SetUVBounds(Standard_Real& myU1, Standard_Real U1, V1, U , V; ElSLib::Parameters( Cylinder, P1, U1, V1); Standard_Real Step = .1, Delta = 0.; - Standard_Real eps = PI, dmax = 0., d = 0.; + Standard_Real eps = M_PI, dmax = 0., d = 0.; Standard_Integer nbp = (Standard_Integer)((W2 - W1) / Step + 1); nbp = Max(nbp, 3); Step = (W2 - W1) / (nbp - 1); @@ -360,13 +360,13 @@ static void Function_SetUVBounds(Standard_Real& myU1, d = U - U1; if(d > eps) { U -= Delta; - Delta -= 2*PI; + Delta -= 2*M_PI; U += Delta; d = U - U1; } else if(d < -eps) { U -= Delta; - Delta += 2*PI; + Delta += 2*M_PI; U += Delta; d = U - U1; } @@ -381,14 +381,14 @@ static void Function_SetUVBounds(Standard_Real& myU1, if(!(Abs(pmax - W1) <= Precision::PConfusion() || Abs(pmax - W2) <= Precision::PConfusion()) ) myU2 += dmax*.5; - if((myU1 >=0. && myU1 <= 2*PI) && - (myU2 >=0. && myU2 <= 2*PI) ) { + if((myU1 >=0. && myU1 <= 2*M_PI) && + (myU2 >=0. && myU2 <= 2*M_PI) ) { UCouture = Standard_False; } else { U = ( myU1 + myU2 ) /2.; - myU1 = U - PI; - myU2 = U + PI; + myU1 = U - M_PI; + myU2 = U + M_PI; UCouture = Standard_True; } } @@ -465,7 +465,7 @@ static void Function_SetUVBounds(Standard_Real& myU1, ElSLib::Parameters(SP, P, UU, V1); Standard_Real UUmi = Min(Min(U1,UU),Min(UU,U2)); Standard_Real UUma = Max(Max(U1,UU),Max(UU,U2)); - Standard_Boolean reCalc = ((UUmi >= 0. && UUmi <= PI) && (UUma >= 0. && UUma <= PI)); + Standard_Boolean reCalc = ((UUmi >= 0. && UUmi <= M_PI) && (UUma >= 0. && UUma <= M_PI)); // box+sphere << ElSLib::Parameters(SP, P1, U1, V1);//* @@ -473,28 +473,28 @@ static void Function_SetUVBounds(Standard_Real& myU1, Parameters(myCurve, mySurface, P1, 1, aTPC, U1, V1); // // - P2 = myCurve->Value(W1+PI/8); + P2 = myCurve->Value(W1+M_PI/8); ElSLib::Parameters(SP,P2,U2,V2); // if ( NbSolutions == 1) { - if ( Abs(U1-U2) > PI) { // on traverse la couture - if ( U1 > PI) { + if ( Abs(U1-U2) > M_PI) { // on traverse la couture + if ( U1 > M_PI) { myU1 = U1; - myU2 = U1+2*PI; + myU2 = U1+2*M_PI; } else { myU2 = U1; - myU1 = U1-2*PI; + myU1 = U1-2*M_PI; } } else { // on ne traverse pas la couture if ( U1 > U2) { myU2 = U1; - myU1 = U1-2*PI; + myU1 = U1-2*M_PI; } else { myU1 = U1; - myU2 = U1+2*PI; + myU2 = U1+2*M_PI; } } } @@ -502,8 +502,8 @@ static void Function_SetUVBounds(Standard_Real& myU1, gp_Pnt Center = Circle.Location(); Standard_Real U,V; ElSLib::SphereParameters(gp_Ax3(gp::XOY()),1,Center, U, V); - myU1 = U-PI; - myU2 = U+PI; + myU1 = U-M_PI; + myU2 = U+M_PI; } // // eval the VCouture. @@ -515,12 +515,12 @@ static void Function_SetUVBounds(Standard_Real& myU1, UCouture = Standard_True; if ( D/C < 0.) { - myV1 = - PI / 2.; - myV2 = 3 * PI / 2.; + myV1 = - M_PI / 2.; + myV2 = 3 * M_PI / 2.; } else { - myV1 = -3 * PI / 2.; - myV2 = PI / 2.; + myV1 = -3 * M_PI / 2.; + myV2 = M_PI / 2.; } // si P1.Z() vaut +/- R on est sur le sommet : pas significatif. @@ -530,8 +530,8 @@ static void Function_SetUVBounds(Standard_Real& myU1, gp_Pnt Center = Circle.Location(); Standard_Real U,V; ElSLib::SphereParameters(gp_Ax3(gp::XOY()),1,Center, U, V); - myU1 = U-PI; - myU2 = U+PI; + myU1 = U-M_PI; + myU2 = U+M_PI; VCouture = Standard_False; } else { @@ -539,27 +539,27 @@ static void Function_SetUVBounds(Standard_Real& myU1, // Parameters(myCurve, mySurface, P1, 1, aTPC, U1, V1); // - P2 = myCurve->Value(W1+PI/8); + P2 = myCurve->Value(W1+M_PI/8); ElSLib::Parameters(SP,P2,U2,V2); - if ( Abs(U1-U2) > PI) { // on traverse la couture - if ( U1 > PI) { + if ( Abs(U1-U2) > M_PI) { // on traverse la couture + if ( U1 > M_PI) { myU1 = U1; - myU2 = U1+2*PI; + myU2 = U1+2*M_PI; } else { myU2 = U1; - myU1 = U1-2*PI; + myU1 = U1-2*M_PI; } } else { // on ne traverse pas la couture if ( U1 > U2) { myU2 = U1; - myU1 = U1-2*PI; + myU1 = U1-2*M_PI; } else { myU1 = U1; - myU2 = U1+2*PI; + myU2 = U1+2*M_PI; } } } @@ -568,12 +568,12 @@ static void Function_SetUVBounds(Standard_Real& myU1, // box+sphere >> myV1 = -1.e+100; myV2 = 1.e+100; Standard_Real UU1 = myU1, UU2 = myU2; - if((Abs(UU1) <= (2.*PI) && Abs(UU2) <= (2.*PI)) && NbSolutions == 1 && reCalc) { + if((Abs(UU1) <= (2.*M_PI) && Abs(UU2) <= (2.*M_PI)) && NbSolutions == 1 && reCalc) { gp_Pnt Center = Circle.Location(); Standard_Real U,V; ElSLib::SphereParameters(gp_Ax3(gp::XOY()),1,Center, U, V); - myU1 = U-PI; - myU2 = U+PI; + myU1 = U-M_PI; + myU2 = U+M_PI; myU1 = Min(UU1,myU1); myU2 = Max(UU2,myU2); } @@ -585,7 +585,7 @@ static void Function_SetUVBounds(Standard_Real& myU1, Standard_Real U1, V1, U , V; ElSLib::Parameters( SP, P1, U1, V1); Standard_Real Step = .1, Delta = 0.; - Standard_Real eps = PI, dmax = 0., d = 0.; + Standard_Real eps = M_PI, dmax = 0., d = 0.; Standard_Integer nbp = (Standard_Integer)((W2 - W1) / Step + 1); nbp = Max(nbp, 3); Step = (W2 - W1) / (nbp - 1); @@ -598,13 +598,13 @@ static void Function_SetUVBounds(Standard_Real& myU1, d = U - U1; if(d > eps) { U -= Delta; - Delta -= 2*PI; + Delta -= 2*M_PI; U += Delta; d = U - U1; } else if(d < -eps) { U -= Delta; - Delta += 2*PI; + Delta += 2*M_PI; U += Delta; d = U - U1; } @@ -619,16 +619,16 @@ static void Function_SetUVBounds(Standard_Real& myU1, if(!(Abs(pmax - W1) <= Precision::PConfusion() || Abs(pmax - W2) <= Precision::PConfusion()) ) myU2 += dmax*.5; - if((myU1 >=0. && myU1 <= 2*PI) && - (myU2 >=0. && myU2 <= 2*PI) ) { + if((myU1 >=0. && myU1 <= 2*M_PI) && + (myU2 >=0. && myU2 <= 2*M_PI) ) { myU1 = 0.; - myU2 = 2.*PI; + myU2 = 2.*M_PI; UCouture = Standard_False; } else { U = ( myU1 + myU2 ) /2.; - myU1 = U - PI; - myU2 = U + PI; + myU1 = U - M_PI; + myU2 = U + M_PI; UCouture = Standard_True; } @@ -642,7 +642,7 @@ static void Function_SetUVBounds(Standard_Real& myU1, Standard_Real U1, V1, U , V; ElSLib::Parameters( TR, P1, U1, V1); Standard_Real Step = .1, DeltaU = 0., DeltaV = 0.; - Standard_Real eps = PI, dmaxU = 0., dU = 0., dmaxV = 0., dV = 0.; + Standard_Real eps = M_PI, dmaxU = 0., dU = 0., dmaxV = 0., dV = 0.; Standard_Integer nbp = (Standard_Integer)((W2 - W1) / Step + 1); nbp = Max(nbp, 3); Step = (W2 - W1) / (nbp - 1); @@ -659,25 +659,25 @@ static void Function_SetUVBounds(Standard_Real& myU1, dV = V - V1; if(dU > eps) { U -= DeltaU; - DeltaU -= 2*PI; + DeltaU -= 2*M_PI; U += DeltaU; dU = U - U1; } else if(dU < -eps) { U -= DeltaU; - DeltaU += 2*PI; + DeltaU += 2*M_PI; U += DeltaU; dU = U - U1; } if(dV > eps) { V -= DeltaV; - DeltaV -= 2*PI; + DeltaV -= 2*M_PI; V += DeltaV; dV = V - V1; } else if(dV < -eps) { V -= DeltaV; - DeltaV += 2*PI; + DeltaV += 2*M_PI; V += DeltaV; dV = V - V1; } @@ -700,26 +700,26 @@ static void Function_SetUVBounds(Standard_Real& myU1, if(!(Abs(pmaxV - W1) <= Precision::PConfusion() || Abs(pmaxV - W2) <= Precision::PConfusion()) ) myV2 += dmaxV*.5; - if((myU1 >=0. && myU1 <= 2*PI) && - (myU2 >=0. && myU2 <= 2*PI) ) { + if((myU1 >=0. && myU1 <= 2*M_PI) && + (myU2 >=0. && myU2 <= 2*M_PI) ) { myU1 = 0.; - myU2 = 2.*PI; + myU2 = 2.*M_PI; UCouture = Standard_False; } else { U = ( myU1 + myU2 ) /2.; - myU1 = U - PI; - myU2 = U + PI; + myU1 = U - M_PI; + myU2 = U + M_PI; UCouture = Standard_True; } - if((myV1 >=0. && myV1 <= 2*PI) && - (myV2 >=0. && myV2 <= 2*PI) ) { + if((myV1 >=0. && myV1 <= 2*M_PI) && + (myV2 >=0. && myV2 <= 2*M_PI) ) { VCouture = Standard_False; } else { V = ( myV1 + myV2 ) /2.; - myV1 = V - PI; - myV2 = V + PI; + myV1 = V - M_PI; + myV2 = V + M_PI; VCouture = Standard_True; } @@ -753,7 +753,7 @@ void Parameters(const Handle(Adaptor3d_HCurve)& myCurve, GeomAbs_CurveType aCType; gp_Pnt aP2; // - aTwoPI=2.*PI; + aTwoPI=2.*M_PI; // aSType=mySurface->GetType(); aCType=myCurve->GetType(); @@ -779,7 +779,7 @@ void Parameters(const Handle(Adaptor3d_HCurve)& myCurve, ElSLib::Parameters(aSp, aP2, aU2, aV2); // aU1=0.; - if (aU2>PI) { + if (aU2>M_PI) { aU1=aTwoPI; } } @@ -1097,11 +1097,11 @@ ProjLib_ComputeApprox::ProjLib_ComputeApprox Standard_Integer number; if (F.VCouture) { - if (SType == GeomAbs_Sphere && Abs(u-F.myU1) > PI) + if (SType == GeomAbs_Sphere && Abs(u-F.myU1) > M_PI) { ToMirror = Standard_True; - dv = -PI; - v = PI - v; + dv = -M_PI; + v = M_PI - v; } Standard_Real newV = ElCLib::InPeriod( v, F.myV1, F.myV2 ); number = (Standard_Integer) (Floor((newV-v)/(F.myV2-F.myV1))); @@ -1110,8 +1110,8 @@ ProjLib_ComputeApprox::ProjLib_ComputeApprox if (F.UCouture || F.VCouture && SType == GeomAbs_Sphere) { gp_Pnt2d P2d = F.Value( UFirst ); - number = (Standard_Integer) (Floor((P2d.X()-u)/PI + Epsilon(PI))); - du = -number*PI; + number = (Standard_Integer) (Floor((P2d.X()-u)/M_PI + Epsilon(M_PI))); + du = -number*M_PI; } if (!myBSpline.IsNull()) diff --git a/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx b/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx index 989f262c5e..c6c33a8b8b 100755 --- a/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx +++ b/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx @@ -114,36 +114,36 @@ static gp_Pnt2d Function_Value(const Standard_Real U, { gp_Cylinder Cylinder = Surf->Cylinder(); ElSLib::Parameters( Cylinder, p, S, T); - if(U0 < Uinf) decalU = -int((Uinf - U0)/(2*PI))-1; - if(U0 > Usup) decalU = int((U0 - Usup)/(2*PI))+1; - S += decalU*2*PI; + if(U0 < Uinf) decalU = -int((Uinf - U0)/(2*M_PI))-1; + if(U0 > Usup) decalU = int((U0 - Usup)/(2*M_PI))+1; + S += decalU*2*M_PI; break; } case GeomAbs_Cone: { gp_Cone Cone = Surf->Cone(); ElSLib::Parameters( Cone, p, S, T); - if(U0 < Uinf) decalU = -int((Uinf - U0)/(2*PI))-1; - if(U0 > Usup) decalU = int((U0 - Usup)/(2*PI))+1; - S += decalU*2*PI; + if(U0 < Uinf) decalU = -int((Uinf - U0)/(2*M_PI))-1; + if(U0 > Usup) decalU = int((U0 - Usup)/(2*M_PI))+1; + S += decalU*2*M_PI; break; } case GeomAbs_Sphere: { gp_Sphere Sphere = Surf->Sphere(); ElSLib::Parameters( Sphere, p, S, T); - if(U0 < Uinf) decalU = -int((Uinf - U0)/(2*PI))-1; - if(U0 > Usup) decalU = int((U0 - Usup)/(2*PI))+1; - S += decalU*2*PI; - if(V0 < Vinf) decalV = -int((Vinf - V0)/(2*PI))-1; - if(V0 > (Vsup+(Vsup-Vinf))) decalV = int((V0 - Vsup+(Vsup-Vinf))/(2*PI))+1; - T += decalV*2*PI; - if(0.4*PI < Abs(U0 - S) && Abs(U0 - S) < 1.6*PI) { - T = PI - T; + if(U0 < Uinf) decalU = -int((Uinf - U0)/(2*M_PI))-1; + if(U0 > Usup) decalU = int((U0 - Usup)/(2*M_PI))+1; + S += decalU*2*M_PI; + if(V0 < Vinf) decalV = -int((Vinf - V0)/(2*M_PI))-1; + if(V0 > (Vsup+(Vsup-Vinf))) decalV = int((V0 - Vsup+(Vsup-Vinf))/(2*M_PI))+1; + T += decalV*2*M_PI; + if(0.4*M_PI < Abs(U0 - S) && Abs(U0 - S) < 1.6*M_PI) { + T = M_PI - T; if(U0 < S) - S -= PI; + S -= M_PI; else - S += PI; + S += M_PI; } break; } @@ -151,11 +151,11 @@ static gp_Pnt2d Function_Value(const Standard_Real U, { gp_Torus Torus = Surf->Torus(); ElSLib::Parameters( Torus, p, S, T); - if(U0 < Uinf) decalU = -int((Uinf - U0)/(2*PI))-1; - if(U0 > Usup) decalU = int((U0 - Usup)/(2*PI))+1; - if(V0 < Vinf) decalV = -int((Vinf - V0)/(2*PI))-1; - if(V0 > Vsup) decalV = int((V0 - Vsup)/(2*PI))+1; - S += decalU*2*PI; T += decalV*2*PI; + if(U0 < Uinf) decalU = -int((Uinf - U0)/(2*M_PI))-1; + if(U0 > Usup) decalU = int((U0 - Usup)/(2*M_PI))+1; + if(V0 < Vinf) decalV = -int((Vinf - V0)/(2*M_PI))-1; + if(V0 > Vsup) decalV = int((V0 - Vsup)/(2*M_PI))+1; + S += decalU*2*M_PI; T += decalV*2*M_PI; break; } default: @@ -740,12 +740,12 @@ Handle(Adaptor2d_HCurve2d) for ( i = 2 ; i <= NbOfPnts ; i++) { Sloc = S; ElSLib::Parameters( Cylinder, Pts(i), S, T); - if(Abs(Sloc - S) > PI) + if(Abs(Sloc - S) > M_PI) if(Sloc > S) usens++; else usens--; - Pts2d(i).SetCoord(S+usens*2*PI,T); + Pts2d(i).SetCoord(S+usens*2*M_PI,T); } myProjIsDone = Standard_True; break; @@ -761,12 +761,12 @@ Handle(Adaptor2d_HCurve2d) for ( i = 2 ; i <= NbOfPnts ; i++) { Sloc = S; ElSLib::Parameters( Cone, Pts(i), S, T); - if(Abs(Sloc - S) > PI) + if(Abs(Sloc - S) > M_PI) if(Sloc > S) usens++; else usens--; - Pts2d(i).SetCoord(S+usens*2*PI,T); + Pts2d(i).SetCoord(S+usens*2*M_PI,T); } myProjIsDone = Standard_True; break; @@ -782,12 +782,12 @@ Handle(Adaptor2d_HCurve2d) for ( i = 2 ; i <= NbOfPnts ; i++) { Sloc = S;Tloc = T; ElSLib::Parameters( Sphere, Pts(i), S, T); - if(1.6*PI < Abs(Sloc - S)) + if(1.6*M_PI < Abs(Sloc - S)) if(Sloc > S) usens += 2; else usens -= 2; - if(1.6*PI > Abs(Sloc - S) && Abs(Sloc - S) > 0.4*PI) { + if(1.6*M_PI > Abs(Sloc - S) && Abs(Sloc - S) > 0.4*M_PI) { vparit = !vparit; if(Sloc > S) usens++; @@ -799,10 +799,10 @@ Handle(Adaptor2d_HCurve2d) vsens--; } if(vparit) { - Pts2d(i).SetCoord(S+usens*PI,(PI - T)*(vsens-1)); + Pts2d(i).SetCoord(S+usens*M_PI,(M_PI - T)*(vsens-1)); } else { - Pts2d(i).SetCoord(S+usens*PI,T+vsens*PI); + Pts2d(i).SetCoord(S+usens*M_PI,T+vsens*M_PI); } } @@ -819,17 +819,17 @@ Handle(Adaptor2d_HCurve2d) for ( i = 2 ; i <= NbOfPnts ; i++) { Sloc = S; Tloc = T; ElSLib::Parameters( Torus, Pts(i), S, T); - if(Abs(Sloc - S) > PI) + if(Abs(Sloc - S) > M_PI) if(Sloc > S) usens++; else usens--; - if(Abs(Tloc - T) > PI) + if(Abs(Tloc - T) > M_PI) if(Tloc > T) vsens++; else vsens--; - Pts2d(i).SetCoord(S+usens*2*PI,T+vsens*2*PI); + Pts2d(i).SetCoord(S+usens*2*M_PI,T+vsens*2*M_PI); } myProjIsDone = Standard_True; break; @@ -1259,8 +1259,8 @@ Handle(Geom2d_BSplineCurve) gp_Pnt p22 = BSS->Pole(2,2); gp_Vec V1(p11,p12); gp_Vec V2(p21,p22); - if(V1.IsEqual(V2,Tol3d,Tol3d/(p11.Distance(p12)*180/PI))){ //OCC217 - //if(V1.IsEqual(V2,myTolerance,myTolerance/(p11.Distance(p12)*180/PI))){ + if(V1.IsEqual(V2,Tol3d,Tol3d/(p11.Distance(p12)*180/M_PI))){ //OCC217 + //if(V1.IsEqual(V2,myTolerance,myTolerance/(p11.Distance(p12)*180/M_PI))){ // so the polar surface is plane // and if it is enough to projet the poles of Curve Standard_Integer Dist2Min = IntegerLast(); @@ -1360,8 +1360,8 @@ Handle(Geom2d_BSplineCurve) gp_Pnt p22 = BS->Pole(2,2); gp_Vec V1(p11,p12); gp_Vec V2(p21,p22); - if(V1.IsEqual(V2,Tol3d,Tol3d/(p11.Distance(p12)*180/PI))){ //OCC217 - //if (V1.IsEqual(V2,myTolerance,myTolerance/(p11.Distance(p12)*180/PI))){ + if(V1.IsEqual(V2,Tol3d,Tol3d/(p11.Distance(p12)*180/M_PI))){ //OCC217 + //if (V1.IsEqual(V2,myTolerance,myTolerance/(p11.Distance(p12)*180/M_PI))){ // and if it is enough to project the poles of Curve Standard_Integer Dist2Min = IntegerLast(); Standard_Real u,v; diff --git a/src/ProjLib/ProjLib_Cone.cxx b/src/ProjLib/ProjLib_Cone.cxx index 5864723c47..59dbed57e7 100755 --- a/src/ProjLib/ProjLib_Cone.cxx +++ b/src/ProjLib/ProjLib_Cone.cxx @@ -136,9 +136,9 @@ void ProjLib_Cone::Project(const gp_Lin& L) (ZCone.IsEqual(CPos.Direction(), Precision::Angular())) ? 1 : -1; Standard_Integer a2 = (myCone.SemiAngle() > 0) ? 1 : -1; - if ( ( a1 * a2) == -1) U -= PI; + if ( ( a1 * a2) == -1) U -= M_PI; - if ( U < 0.) U += 2.*PI; + if ( U < 0.) U += 2.*M_PI; gp_Pnt P; gp_Vec Vu, Vv; @@ -196,7 +196,7 @@ void ProjLib_Cone::Project(const gp_Circ& C) else { U = ATan2( y, x); } - if ( U < 0.) U += 2*PI; + if ( U < 0.) U += 2*M_PI; V = z / Cos(myCone.SemiAngle()); diff --git a/src/ProjLib/ProjLib_Cylinder.cxx b/src/ProjLib/ProjLib_Cylinder.cxx index fff6f4b616..65c31307bd 100755 --- a/src/ProjLib/ProjLib_Cylinder.cxx +++ b/src/ProjLib/ProjLib_Cylinder.cxx @@ -122,7 +122,7 @@ void ProjLib_Cylinder::Project(const gp_Lin& L) gp_Pnt2d P2d = EvalPnt2d(L.Location(),myCylinder); if ( P2d.X() < 0.) { - P2d.SetX(P2d.X()+2*PI); + P2d.SetX(P2d.X()+2*M_PI); } Standard_Real Signe = L.Direction().Dot(myCylinder.Position().Direction()); diff --git a/src/ProjLib/ProjLib_Sphere.cxx b/src/ProjLib/ProjLib_Sphere.cxx index a8f6d6458c..31ad63d80f 100755 --- a/src/ProjLib/ProjLib_Sphere.cxx +++ b/src/ProjLib/ProjLib_Sphere.cxx @@ -88,7 +88,7 @@ static gp_Pnt2d EvalPnt2d( const gp_Vec P, const gp_Sphere& Sp) if ( Abs(X) > Precision::PConfusion() || Abs(Y) > Precision::PConfusion() ) { Standard_Real UU = ATan2(Y,X); - U = ElCLib::InPeriod(UU, 0., 2*PI); + U = ElCLib::InPeriod(UU, 0., 2*M_PI); } else { U = 0.; @@ -142,21 +142,21 @@ void ProjLib_Sphere::Project(const gp_Circ& C) P2d1 = EvalPnt2d(gp_Vec(Xc),mySphere); P2d2 = EvalPnt2d(gp_Vec(Yc),mySphere); - if (isIsoU && (Abs(P2d1.Y()-PI/2.) < Precision::PConfusion() || - Abs(P2d1.Y()+PI/2.) < Precision::PConfusion() )) { + if (isIsoU && (Abs(P2d1.Y()-M_PI/2.) < Precision::PConfusion() || + Abs(P2d1.Y()+M_PI/2.) < Precision::PConfusion() )) { // then P1 is on the apex of the sphere and U is undefined // The value of U is given by P2d2.Y() . P2d1.SetX(P2d2.X()); } - else if ( Abs( Abs(P2d1.X()-P2d2.X()) - PI) < Precision::PConfusion()) { + else if ( Abs( Abs(P2d1.X()-P2d2.X()) - M_PI) < Precision::PConfusion()) { // then we have U2 = U1 + PI; V2; // we have to assume that U1 = U2 // so V2 = PI - V2; P2d2.SetX( P2d1.X()); if (P2d2.Y() < 0.) - P2d2.SetY( -PI - P2d2.Y()); + P2d2.SetY( -M_PI - P2d2.Y()); else - P2d2.SetY( PI - P2d2.Y()); + P2d2.SetY( M_PI - P2d2.Y()); } else { P2d2.SetX( P2d1.X()); @@ -171,7 +171,7 @@ void ProjLib_Sphere::Project(const gp_Circ& C) //P2d(U,V) :first point of the PCurve. Standard_Real U = Xs.AngleWithRef(Xc, Xs^Ys); if (U<0) - U += 2*PI; + U += 2*M_PI; Standard_Real Z = gp_Vec(O,C.Location()).Dot(Zs); Standard_Real V = ASin(Z/mySphere.Radius()); P2d1 = gp_Pnt2d(U,V); @@ -214,7 +214,7 @@ void ProjLib_Sphere::SetInBounds(const Standard_Real U) // first set the y of the first point in -pi/2 pi/2 Standard_Real newY, Y = ElCLib::Value(U,myLin).Y(); - newY = ElCLib::InPeriod( Y, -PI, PI); + newY = ElCLib::InPeriod( Y, -M_PI, M_PI); myLin.Translate(gp_Vec2d(0.,newY-Y)); @@ -224,18 +224,18 @@ void ProjLib_Sphere::SetInBounds(const Standard_Real U) Standard_Real Tol = 1.e-7; gp_Dir2d D2d = myLin.Direction(); // Modified by skv - Tue Aug 1 16:29:59 2006 OCC13116 Begin -// if ((P.Y() > PI/2) || - if ((P.Y() - PI/2 > Tol) || +// if ((P.Y() > M_PI/2) || + if ((P.Y() - M_PI/2 > Tol) || // Modified by skv - Tue Aug 1 16:29:59 2006 OCC13116 End - (Abs(P.Y()-PI/2) 1.) { - V = PI/2.; // protection stupide + V = M_PI/2.; // protection stupide } // contre les erreurs de calcul else if ( Z < -1.) { // il arrive que Z soit legerement - V = -PI/2; // superieur a 1. + V = -M_PI/2; // superieur a 1. } else { V = ASin(Z); } if (C.Radius() < myTorus.MajorRadius()) { - V = PI - V; + V = M_PI - V; } else if ( V < 0.) { - V += 2*PI; + V += 2*M_PI; } P1.SetY(V); P2.SetY(V); gp_Vec2d V2d ( P1, P2); // Normalement Abs( P1.X() - P2.X()) = PI/2 // Si != PI/2, on a traverse la periode => On reverse la Direction - if ( Abs( P1.X() - P2.X()) > PI) V2d.Reverse(); + if ( Abs( P1.X() - P2.X()) > M_PI) V2d.Reverse(); gp_Dir2d D2( V2d); if ( P1.X() < 0) - P1.SetX( 2*PI + P1.X()); + P1.SetX( 2*M_PI + P1.X()); myLin = gp_Lin2d( P1, D2); } else { // Iso U -> U = angle( Xt, OC) Standard_Real U = Xt.AngleWithRef( OC, Xt^Yt); if ( U < 0.) - U += 2*PI; + U += 2*M_PI; // Origine de la droite Standard_Real V1 = OC.AngleWithRef(Xc, OC^Zt); if ( V1 < 0.) - V1 += 2*PI; + V1 += 2*M_PI; gp_Pnt2d P1( U, V1); diff --git a/src/Prs2d/Prs2d_Angle.cxx b/src/Prs2d/Prs2d_Angle.cxx index 1c05f32c6f..39871aa76c 100755 --- a/src/Prs2d/Prs2d_Angle.cxx +++ b/src/Prs2d/Prs2d_Angle.cxx @@ -38,11 +38,11 @@ Prs2d_Angle::Prs2d_Angle( const Handle(Graphic2d_GraphicObject)& aGO, if ( myRad <= ShortRealEpsilon ()) Graphic2d_CircleDefinitionError::Raise ("The radius = 0." ); - Standard_ShortReal TwoPI = Standard_ShortReal(2.* Standard_PI); + Standard_ShortReal TwoPI = Standard_ShortReal(2. * M_PI); while( myFAngle < 0. ) myFAngle += TwoPI; - while( myFAngle > 2.* Standard_PI ) myFAngle -= TwoPI; + while( myFAngle > 2. * M_PI ) myFAngle -= TwoPI; while( mySAngle < 0. ) mySAngle += TwoPI; - while( mySAngle > 2.* Standard_PI ) mySAngle -= TwoPI; + while( mySAngle > 2. * M_PI ) mySAngle -= TwoPI; if ( mySAngle < myFAngle ) mySAngle += TwoPI; if ( ( mySAngle - myFAngle < ShortRealEpsilon() ) || @@ -65,7 +65,7 @@ Prs2d_Angle::Prs2d_Angle( const Handle(Graphic2d_GraphicObject)& aGO, myMaxY = myMaxY > Ycur ? myMaxY : Ycur; for ( Acur = 0., Xcur = 1., Ycur = 0.; - Acur < mySAngle; Acur += Standard_ShortReal(Standard_PI/2.)) { + Acur < mySAngle; Acur += Standard_ShortReal(M_PI / 2.)) { if ( Acur > myFAngle ) { myMinX = ( myMinX < Xcur ? myMinX : Xcur ); myMaxX = ( myMaxX < Xcur ? Xcur : myMaxX ); @@ -82,7 +82,7 @@ Prs2d_Angle::Prs2d_Angle( const Handle(Graphic2d_GraphicObject)& aGO, // Arrows - Standard_Real ArrAngle = PI/180.*anArrAngle; + Standard_Real ArrAngle = M_PI/180.*anArrAngle; gp_Pnt2d theOrigine(0.,0.); gp_Pnt2d P1, P2, P3; @@ -96,7 +96,7 @@ Prs2d_Angle::Prs2d_Angle( const Handle(Graphic2d_GraphicObject)& aGO, P2 = gp_Pnt2d( anArrLength, anArrLength*Tan( ArrAngle/2. ) ); P3 = gp_Pnt2d( anArrLength, -anArrLength*Tan( ArrAngle/2. ) ); - VDir = V1.Rotated(PI/2); + VDir = V1.Rotated(M_PI/2); theAngle = VX.Angle( VDir ); P2.Rotate( theOrigine, theAngle ); P3.Rotate( theOrigine, theAngle ); @@ -127,7 +127,7 @@ Prs2d_Angle::Prs2d_Angle( const Handle(Graphic2d_GraphicObject)& aGO, P2 = gp_Pnt2d( anArrLength, anArrLength*Tan( ArrAngle/2. ) ); P3 = gp_Pnt2d( anArrLength, -anArrLength*Tan( ArrAngle/2. ) ); - VDir = V2.Rotated(-PI/2); + VDir = V2.Rotated(-M_PI/2); theAngle = VX.Angle( VDir ); P2.Rotate( theOrigine, theAngle ); @@ -206,7 +206,7 @@ void Prs2d_Angle::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) { gp_Pnt2d pntText = theCent.Translated(textV1); Standard_Real txtX, txtY; pntText.Coord(txtX, txtY); - Standard_ShortReal txtAngle = Standard_ShortReal( theAngle + 3*PI/2); + Standard_ShortReal txtAngle = Standard_ShortReal( theAngle + 3*M_PI/2); Standard_ShortReal ws, hs; aDrawer->GetTextSize( myText, ws, hs ); @@ -279,7 +279,7 @@ void Prs2d_Angle::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) { ts1 = Standard_ShortReal( A ); ts2 = Standard_ShortReal( B ); - if ( Abs(f-e) < Standard_ShortReal(2.*Standard_PI) ) { + if ( Abs(f-e) < Standard_ShortReal(2. * M_PI) ) { aTrsf.SetValue( 1, 3, 0.0 ); aTrsf.SetValue( 2, 3, 0.0 ); @@ -384,7 +384,7 @@ void Prs2d_Angle::DrawElement( const Handle(Graphic2d_Drawer)& aDrawer, gp_Pnt2d pntText = theCent.Translated(textV1); Standard_Real txtX, txtY; pntText.Coord(txtX, txtY); - Standard_ShortReal txtAngle = Standard_ShortReal( theAngle + 3*PI/2);*/ + Standard_ShortReal txtAngle = Standard_ShortReal( theAngle + 3*M_PI/2);*/ //correct by enk Mon Dec 2 11:39 2002 @@ -440,7 +440,7 @@ void Prs2d_Angle::DrawElement( const Handle(Graphic2d_Drawer)& aDrawer, a = Standard_ShortReal( A ); b = Standard_ShortReal( B ); - if ( Abs(f-e) < Standard_ShortReal(2.*Standard_PI) ) { + if ( Abs(f-e) < Standard_ShortReal(2. * M_PI) ) { aTrsf.SetValue( 1, 3, 0.0 ); aTrsf.SetValue( 2, 3, 0.0 ); X1 = Cos(E); @@ -617,7 +617,7 @@ Standard_Boolean Prs2d_Angle::Pick( const Standard_ShortReal X, gp_Pnt2d pntText = theCent.Translated(textV1); Standard_Real txtX, txtY; pntText.Coord(txtX, txtY); - Standard_ShortReal txtAngle = Standard_ShortReal( theAngle + 3*PI/2);*/ + Standard_ShortReal txtAngle = Standard_ShortReal( theAngle + 3*M_PI/2);*/ //correct by enk Mon Dec 2 11:41 2002 ///////////////////////////////////////// diff --git a/src/Prs2d/Prs2d_Angle.lxx b/src/Prs2d/Prs2d_Angle.lxx index 868b2cfe82..369ada4446 100755 --- a/src/Prs2d/Prs2d_Angle.lxx +++ b/src/Prs2d/Prs2d_Angle.lxx @@ -15,7 +15,7 @@ inline void Prs2d_Angle::CalcTxtPos(const Standard_Boolean theFromAbs) { gp_Vec2d textV1 = V1.Rotated( delta/2 ); theVecJ = textV1/myRad; - theVecI = textV1.Rotated(-PI/2.)/myRad; + theVecI = textV1.Rotated(-M_PI/2.)/myRad; gp_Pnt2d pntText = diff --git a/src/Prs2d/Prs2d_Angularity.cxx b/src/Prs2d/Prs2d_Angularity.cxx index e2a054d2f4..f24c6cdb23 100755 --- a/src/Prs2d/Prs2d_Angularity.cxx +++ b/src/Prs2d/Prs2d_Angularity.cxx @@ -30,7 +30,7 @@ void Prs2d_Angularity::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) { Y1 = Standard_ShortReal( myY - myLength/2 ), X2 = Standard_ShortReal( myX + myLength/2 ), Y2 = Y1, - X3 = Standard_ShortReal( X1 + myLength * Cos( Standard_PI / 4 ) ), + X3 = Standard_ShortReal( X1 + myLength * Cos( M_PI / 4 ) ), Y3 = Standard_ShortReal( myY + myLength/2 ); gp_Pnt2d P1( X1, Y1 ), diff --git a/src/Prs2d/Prs2d_Arrow.cxx b/src/Prs2d/Prs2d_Arrow.cxx index c53d6060f3..d56af6721b 100755 --- a/src/Prs2d/Prs2d_Arrow.cxx +++ b/src/Prs2d/Prs2d_Arrow.cxx @@ -20,7 +20,7 @@ Prs2d_Arrow::Prs2d_Arrow( const Handle(Graphic2d_GraphicObject)& aGraphicObject, gp_Pnt2d P1( aLocation.Location() ); gp_Dir2d AxeX( 1., 0. ); Standard_Real theAngle = AxeX.Angle( aLocation.Direction() ); - theAngle += Standard_PI; + theAngle += M_PI; gp_Pnt2d P2( aLength, aLength*Tan( anAngle/2. ) ); gp_Pnt2d P3( aLength, -aLength*Tan( anAngle/2. ) ); P2.Rotate( theOrigine, theAngle ); diff --git a/src/Prs2d/Prs2d_Axis.cxx b/src/Prs2d/Prs2d_Axis.cxx index 70f8bfe6f4..1568fde02c 100755 --- a/src/Prs2d/Prs2d_Axis.cxx +++ b/src/Prs2d/Prs2d_Axis.cxx @@ -58,7 +58,7 @@ Prs2d_Axis::Prs2d_Axis( const Handle(Graphic2d_GraphicObject)& aGO, if ( myX2 > myMaxX ) myMaxX = myX2; if ( myY2 > myMaxY ) myMaxY = myY2; - Standard_Real ArrAngle = PI/180.*anArrAngle, theAngle; + Standard_Real ArrAngle = M_PI/180.*anArrAngle, theAngle; gp_Pnt2d theOrigine( 0., 0.), P1, P2, P3; gp_Vec2d VX( 1., 0. ), VDir; @@ -167,7 +167,7 @@ Prs2d_Axis::Prs2d_Axis( const Handle(Graphic2d_GraphicObject)& aGO, if ( myX1 > myMaxX ) myMaxX = myX1; if ( myY1 > myMaxY ) myMaxY = myY1; - Standard_Real ArrAngle = PI/180.*anArrAngle, theAngle; + Standard_Real ArrAngle = M_PI/180.*anArrAngle, theAngle; gp_Pnt2d theOrigine( 0., 0.), P1, P2, P3; gp_Vec2d VX( 1., 0. ), VDir; @@ -246,7 +246,7 @@ Prs2d_Axis::Prs2d_Axis( const Handle(Graphic2d_GraphicObject)& aGO, if ( myX1 > myMaxX ) myMaxX = myX1; if ( myY1 > myMaxY ) myMaxY = myY1; - Standard_Real ArrAngle = PI/180.*anArrAngle, theAngle; + Standard_Real ArrAngle = M_PI/180.*anArrAngle, theAngle; gp_Pnt2d theOrigine( 0., 0.), P1, P2, P3; gp_Vec2d VX( 1., 0. ), VDir; diff --git a/src/Prs2d/Prs2d_Circularity.cxx b/src/Prs2d/Prs2d_Circularity.cxx index 5ccb0a62dd..dd8815bbc1 100755 --- a/src/Prs2d/Prs2d_Circularity.cxx +++ b/src/Prs2d/Prs2d_Circularity.cxx @@ -42,7 +42,7 @@ void Prs2d_Circularity::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) { X1 = Standard_ShortReal( a1 ); Y1 = Standard_ShortReal( b1 ); } - aDrawer->MapArcFromTo( X1, Y1, myLength/2, 0.0, Standard_ShortReal( 2. * Standard_PI ) ); + aDrawer->MapArcFromTo( X1, Y1, myLength/2, 0.0, Standard_ShortReal( 2. * M_PI ) ); } } diff --git a/src/Prs2d/Prs2d_Concentric.cxx b/src/Prs2d/Prs2d_Concentric.cxx index 9453c9263e..bf4af2b5b0 100755 --- a/src/Prs2d/Prs2d_Concentric.cxx +++ b/src/Prs2d/Prs2d_Concentric.cxx @@ -42,8 +42,8 @@ void Prs2d_Concentric::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) { X1 = Standard_ShortReal( a1 ); Y1 = Standard_ShortReal( b1 ); } - aDrawer->MapArcFromTo( X1, Y1, myLength/2, 0.0, Standard_ShortReal( 2. * Standard_PI ) ); - aDrawer->MapArcFromTo( X1, Y1, myLength/3, 0.0, Standard_ShortReal( 2. * Standard_PI ) ); + aDrawer->MapArcFromTo( X1, Y1, myLength/2, 0.0, Standard_ShortReal( 2. * M_PI ) ); + aDrawer->MapArcFromTo( X1, Y1, myLength/3, 0.0, Standard_ShortReal( 2. * M_PI ) ); } } diff --git a/src/Prs2d/Prs2d_Cylindric.cxx b/src/Prs2d/Prs2d_Cylindric.cxx index 54bc83b0f6..f45f72dbb7 100755 --- a/src/Prs2d/Prs2d_Cylindric.cxx +++ b/src/Prs2d/Prs2d_Cylindric.cxx @@ -38,7 +38,7 @@ void Prs2d_Cylindric::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) { gp_Vec2d theVec( thePnt1, gp_Pnt2d( X3, Y3 ) ); theVec /= 2; thePnt1.Translate( theVec ); - Standard_ShortReal theRad = Standard_ShortReal( myLength/2*Sin(Standard_PI / 3) ); + Standard_ShortReal theRad = Standard_ShortReal( myLength/2*Sin(M_PI / 3) ); Standard_ShortReal Xc = Standard_ShortReal(thePnt1.X()), Yc = Standard_ShortReal(thePnt1.Y()); @@ -94,7 +94,7 @@ void Prs2d_Cylindric::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) { } aDrawer->MapSegmentFromTo( X1, Y1, X2, Y2 ); aDrawer->MapSegmentFromTo( X4, Y4, X3, Y3 ); - aDrawer->MapArcFromTo( Xc, Yc, theRad, 0.0, Standard_ShortReal( 2. * Standard_PI ) ); + aDrawer->MapArcFromTo( Xc, Yc, theRad, 0.0, Standard_ShortReal( 2. * M_PI ) ); } } diff --git a/src/Prs2d/Prs2d_Diameter.cxx b/src/Prs2d/Prs2d_Diameter.cxx index 35ba8511d9..0f95b3eaf4 100755 --- a/src/Prs2d/Prs2d_Diameter.cxx +++ b/src/Prs2d/Prs2d_Diameter.cxx @@ -140,7 +140,7 @@ Prs2d_Diameter::Prs2d_Diameter( const Handle(Graphic2d_GraphicObject)& aGO, if ( myX2 > myMaxX ) myMaxX = myX2; if ( myY2 > myMaxY ) myMaxY = myY2; - Standard_Real ArrAngle = PI/180.* anArrAngle, theAngle; + Standard_Real ArrAngle = M_PI/180.* anArrAngle, theAngle; gp_Pnt2d theOrigine( 0., 0.), P1, P2, P3; if ( ( myArrow == Prs2d_AS_FIRSTAR ) || ( myArrow == Prs2d_AS_BOTHAR ) ) { @@ -249,14 +249,14 @@ void Prs2d_Diameter::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) { gp_Vec2d VX( 1., 0. ), theVec(thePnt2, thePnt1); Standard_Real theTxtAngle = VX.Angle( theVec ); gp_Pnt2d pntText; - if ( theTxtAngle >= 0 && theTxtAngle <= PI/2 ) + if ( theTxtAngle >= 0 && theTxtAngle <= M_PI/2 ) pntText = thePnt2.Translated( (myArrowLen+dxx)*theVec/(thePnt1.Distance(thePnt2)) ); - else if ( theTxtAngle > PI/2 && theTxtAngle <= PI ) { + else if ( theTxtAngle > M_PI/2 && theTxtAngle <= M_PI ) { pntText = thePnt1.Translated( (myArrowLen+dxx)*theVec.Reversed()/(thePnt1.Distance(thePnt2)) ); theTxtAngle = VX.Angle( theVec.Reversed() ); - } else if ( theTxtAngle >= -PI/2 && theTxtAngle < 0 ) + } else if ( theTxtAngle >= -M_PI/2 && theTxtAngle < 0 ) pntText = thePnt2.Translated( (myArrowLen+dxx)*theVec/(thePnt1.Distance(thePnt2)) ); - else if ( theTxtAngle >= -PI && theTxtAngle < -PI/2 ) { + else if ( theTxtAngle >= -M_PI && theTxtAngle < -M_PI/2 ) { pntText = thePnt1.Translated( (myArrowLen+dxx)*theVec.Reversed()/(thePnt1.Distance(thePnt2)) ); theTxtAngle = VX.Angle( theVec.Reversed() ); } @@ -389,14 +389,14 @@ void Prs2d_Diameter::DrawElement( const Handle(Graphic2d_Drawer)& aDrawer, gp_Vec2d VX( 1., 0. ), theVec(thePnt2, thePnt1); Standard_Real theTxtAngle = VX.Angle( theVec ); gp_Pnt2d pntText; - if ( theTxtAngle >= 0 && theTxtAngle <= PI/2 ) + if ( theTxtAngle >= 0 && theTxtAngle <= M_PI/2 ) pntText = thePnt2.Translated( (myArrowLen+dxx)*theVec/(thePnt1.Distance(thePnt2)) ); - else if ( theTxtAngle > PI/2 && theTxtAngle <= PI ) { + else if ( theTxtAngle > M_PI/2 && theTxtAngle <= M_PI ) { pntText = thePnt1.Translated( (myArrowLen+dxx)*theVec.Reversed()/(thePnt1.Distance(thePnt2)) ); theTxtAngle = VX.Angle( theVec.Reversed() ); - } else if ( theTxtAngle >= -PI/2 && theTxtAngle < 0 ) + } else if ( theTxtAngle >= -M_PI/2 && theTxtAngle < 0 ) pntText = thePnt2.Translated( (myArrowLen+dxx)*theVec/(thePnt1.Distance(thePnt2)) ); - else if ( theTxtAngle >= -PI && theTxtAngle < -PI/2 ) { + else if ( theTxtAngle >= -M_PI && theTxtAngle < -M_PI/2 ) { pntText = thePnt1.Translated( (myArrowLen+dxx)*theVec.Reversed()/(thePnt1.Distance(thePnt2)) ); theTxtAngle = VX.Angle( theVec.Reversed() ); } @@ -593,14 +593,14 @@ Standard_Boolean Prs2d_Diameter::Pick( const Standard_ShortReal X, gp_Vec2d VX( 1., 0. ), theVec(thePnt2, thePnt1); Standard_Real theTxtAngle = VX.Angle( theVec ); gp_Pnt2d pntText; - if ( theTxtAngle >= 0 && theTxtAngle <= PI/2 ) + if ( theTxtAngle >= 0 && theTxtAngle <= M_PI/2 ) pntText = thePnt2.Translated( (myArrowLen+dxx)*theVec/(thePnt1.Distance(thePnt2)) ); - else if ( theTxtAngle > PI/2 && theTxtAngle <= PI ) { + else if ( theTxtAngle > M_PI/2 && theTxtAngle <= M_PI ) { pntText = thePnt1.Translated( (myArrowLen+dxx)*theVec.Reversed()/(thePnt1.Distance(thePnt2)) ); theTxtAngle = VX.Angle( theVec.Reversed() ); - } else if ( theTxtAngle >= -PI/2 && theTxtAngle < 0 ) + } else if ( theTxtAngle >= -M_PI/2 && theTxtAngle < 0 ) pntText = thePnt2.Translated( (myArrowLen+dxx)*theVec/(thePnt1.Distance(thePnt2)) ); - else if ( theTxtAngle >= -PI && theTxtAngle < -PI/2 ) { + else if ( theTxtAngle >= -M_PI && theTxtAngle < -M_PI/2 ) { pntText = thePnt1.Translated( (myArrowLen+dxx)*theVec.Reversed()/(thePnt1.Distance(thePnt2)) ); theTxtAngle = VX.Angle( theVec.Reversed() ); } diff --git a/src/Prs2d/Prs2d_Diameter.lxx b/src/Prs2d/Prs2d_Diameter.lxx index a3a59e01a9..6ea19ad217 100755 --- a/src/Prs2d/Prs2d_Diameter.lxx +++ b/src/Prs2d/Prs2d_Diameter.lxx @@ -16,7 +16,7 @@ inline void Prs2d_Diameter::CalcTxtPos(const Standard_Boolean theFromAbs) { theVec.Normalized(); theVecI = theVec.Reversed()*myTextPosH/theDist; - theVecJ = theVec.Reversed().Rotated(PI/2)*myTextPosV/theDist; + theVecJ = theVec.Reversed().Rotated(M_PI/2)*myTextPosV/theDist; theVec.Rotate(-myTextAngle); @@ -29,14 +29,14 @@ inline void Prs2d_Diameter::CalcTxtPos(const Standard_Boolean theFromAbs) { gp_Pnt2d pntText; - if ( theTxtAngle >= 0 && theTxtAngle <= PI/2 ) + if ( theTxtAngle >= 0 && theTxtAngle <= M_PI/2 ) pntText = thePnt2.Translated(theVec/theDist); - else if ( theTxtAngle > PI/2 && theTxtAngle <= PI ) { + else if ( theTxtAngle > M_PI/2 && theTxtAngle <= M_PI ) { pntText = thePnt1.Translated(theVec.Reversed()/theDist) ; theTxtAngle = VX.Angle( theVec.Reversed() ); - } else if ( theTxtAngle >= -PI/2 && theTxtAngle < 0 ) + } else if ( theTxtAngle >= -M_PI/2 && theTxtAngle < 0 ) pntText = thePnt2.Translated(theVec/theDist); - else if ( theTxtAngle >= -PI && theTxtAngle < -PI/2 ) { + else if ( theTxtAngle >= -M_PI && theTxtAngle < -M_PI/2 ) { pntText = thePnt1.Translated(theVec.Reversed()/theDist); theTxtAngle = VX.Angle( theVec.Reversed() ); } diff --git a/src/Prs2d/Prs2d_DrawSymbol.cxx b/src/Prs2d/Prs2d_DrawSymbol.cxx index 4451e60573..e7970c8387 100755 --- a/src/Prs2d/Prs2d_DrawSymbol.cxx +++ b/src/Prs2d/Prs2d_DrawSymbol.cxx @@ -53,7 +53,7 @@ void Prs2d_DrawSymbol::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) { Standard_ShortReal theRad = ( myWidth < myHeight) ? myWidth : myHeight; gp_Pnt2d theCent( myX, myY ); gp_Vec2d theVec( theCent, gp_Pnt2d( myX + 13 * theRad/ 10, myY ) ); - theVec.Rotate( Standard_PI / 4 ); + theVec.Rotate( M_PI / 4 ); gp_Pnt2d P1 = theCent.Translated( theVec ); gp_Pnt2d P2 = theCent.Translated( theVec.Reversed() ); @@ -81,7 +81,7 @@ void Prs2d_DrawSymbol::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) { } DrawLineAttrib( aDrawer ); - aDrawer->MapArcFromTo( a, b, theRad, 0., Standard_ShortReal( 2 * Standard_PI ) ); + aDrawer->MapArcFromTo( a, b, theRad, 0., Standard_ShortReal( 2 * M_PI ) ); aDrawer->MapSegmentFromTo( c, d, e, f ); }// end TOS_DIAMETER diff --git a/src/Prs2d/Prs2d_Length.cxx b/src/Prs2d/Prs2d_Length.cxx index be53f67ce8..4990e81577 100755 --- a/src/Prs2d/Prs2d_Length.cxx +++ b/src/Prs2d/Prs2d_Length.cxx @@ -754,8 +754,8 @@ void Prs2d_Length::GetPntProject( const Standard_Real aLength ) DirLin2.Normalize(); DirLin1 *= aLength; DirLin2 *= aLength; - DirLin1.Rotate( PI/2. ); - DirLin2.Rotate( -PI/2. ); + DirLin1.Rotate( M_PI/2. ); + DirLin2.Rotate( -M_PI/2. ); aPntProj1 = myPntAttach1.Translated( DirLin1 ); aPntProj2 = myPntAttach2.Translated( DirLin2 );; break; @@ -771,8 +771,8 @@ void Prs2d_Length::GetPntProject( const Standard_Real aLength ) DirLin2.Normalize(); DirLin1 *= aLength; DirLin2 *= aLength; - DirLin1.Rotate( PI/2. ); - DirLin2.Rotate( -PI/2. ); + DirLin1.Rotate( M_PI/2. ); + DirLin2.Rotate( -M_PI/2. ); aPntProj1 = myPntAttach1.Translated( DirLin1 ); aPntProj2 = myPntAttach2.Translated( DirLin2 );; break; @@ -808,7 +808,7 @@ void Prs2d_Length::GetPntProject( const Standard_Real aLength ) void Prs2d_Length::ComputeArrows( const Standard_Boolean /*isnotPoints*/ ) { - Standard_Real ArrAngle = PI/180. * ArrowAngle(), theAngle; + Standard_Real ArrAngle = M_PI/180. * ArrowAngle(), theAngle; gp_Pnt2d aPnt1( myX1, myY1 ), aPnt2( myX2, myY2 ); gp_Pnt2d theOrigine( 0., 0.), P1, P2, P3; gp_Vec2d VX( 1., 0. ), VDir; diff --git a/src/Prs2d/Prs2d_Length.lxx b/src/Prs2d/Prs2d_Length.lxx index 0447f62126..9bcc71bdbe 100755 --- a/src/Prs2d/Prs2d_Length.lxx +++ b/src/Prs2d/Prs2d_Length.lxx @@ -19,7 +19,7 @@ inline void Prs2d_Length::CalcTxtPos(const Standard_Boolean theFromAbs) { theVecI = theVec*(theDist/2-theTextLen/2+myTextPosH); tmpVec = theVec*(theDist/2+myTextPosH); - theVecJ = theVec.Rotated(PI/2)*myTextPosV; + theVecJ = theVec.Rotated(M_PI/2)*myTextPosV; theOrigine=thePnt1; theOrigine.Translate(tmpVec); diff --git a/src/Prs2d/Prs2d_LineProfile.cxx b/src/Prs2d/Prs2d_LineProfile.cxx index 74596e9707..09e4a78b4c 100755 --- a/src/Prs2d/Prs2d_LineProfile.cxx +++ b/src/Prs2d/Prs2d_LineProfile.cxx @@ -44,7 +44,7 @@ void Prs2d_LineProfile::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) { Y1 = Standard_ShortReal( b1 ); } - aDrawer->MapArcFromTo( X1, Y1, myLength/2, myAngle, Standard_ShortReal( Standard_PI + myAngle ) ); + aDrawer->MapArcFromTo( X1, Y1, myLength/2, myAngle, Standard_ShortReal( M_PI + myAngle ) ); } } diff --git a/src/Prs2d/Prs2d_Parallelism.cxx b/src/Prs2d/Prs2d_Parallelism.cxx index 4d835ab421..04d7a5f323 100755 --- a/src/Prs2d/Prs2d_Parallelism.cxx +++ b/src/Prs2d/Prs2d_Parallelism.cxx @@ -27,9 +27,9 @@ void Prs2d_Parallelism::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) { Standard_ShortReal X1 = myX - myLength/2, Y1 = myY - myLength/2, - X2 = Standard_ShortReal( X1 + myLength * Cos( Standard_PI / 4 ) ), + X2 = Standard_ShortReal( X1 + myLength * Cos( M_PI / 4 ) ), Y2 = myY + myLength/2, - X3 = Standard_ShortReal(myX + myLength* Cos( Standard_PI / 4 ) ), + X3 = Standard_ShortReal(myX + myLength* Cos( M_PI / 4 ) ), Y3 = Y2, X4 = myX, Y4 = Y1; diff --git a/src/Prs2d/Prs2d_Position.cxx b/src/Prs2d/Prs2d_Position.cxx index 00a594c1bb..9c6051d24a 100755 --- a/src/Prs2d/Prs2d_Position.cxx +++ b/src/Prs2d/Prs2d_Position.cxx @@ -89,7 +89,7 @@ void Prs2d_Position::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) { } aDrawer->MapSegmentFromTo( X1, Y1, X2, Y2 ); aDrawer->MapSegmentFromTo( X4, Y4, X3, Y3 ); - aDrawer->MapArcFromTo( Xc, Yc, myLength/2, 0.0, Standard_ShortReal( 2. * Standard_PI ) ); + aDrawer->MapArcFromTo( Xc, Yc, myLength/2, 0.0, Standard_ShortReal( 2. * M_PI ) ); } } diff --git a/src/Prs2d/Prs2d_Radius.cxx b/src/Prs2d/Prs2d_Radius.cxx index 358d450107..0b826c551a 100755 --- a/src/Prs2d/Prs2d_Radius.cxx +++ b/src/Prs2d/Prs2d_Radius.cxx @@ -60,7 +60,7 @@ Prs2d_Radius::Prs2d_Radius( const Handle(Graphic2d_GraphicObject) & aGO, if ( myX2 > myMaxX ) myMaxX = myX2; if ( myY2 > myMaxY ) myMaxY = myY2; - Standard_Real ArrAngle = PI/180.* anArrAngle, theAngle; + Standard_Real ArrAngle = M_PI/180.* anArrAngle, theAngle; gp_Pnt2d theOrigine( 0., 0. ), P1, P2, P3; gp_Vec2d VX( 1., 0. ), VDir; @@ -161,14 +161,14 @@ void Prs2d_Radius::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) { gp_Vec2d VX( 1., 0. ), theVec(thePnt2, thePnt1); Standard_Real theTxtAngle = VX.Angle( theVec ); gp_Pnt2d pntText; - if ( theTxtAngle >= 0 && theTxtAngle <= PI/2 ) + if ( theTxtAngle >= 0 && theTxtAngle <= M_PI/2 ) pntText = thePnt2.Translated( (myArrowLen+d1)*theVec/(thePnt1.Distance(thePnt2)) ); - else if ( theTxtAngle > PI/2 && theTxtAngle <= PI ) { + else if ( theTxtAngle > M_PI/2 && theTxtAngle <= M_PI ) { pntText = thePnt1.Translated( (myArrowLen+d1)*theVec.Reversed()/(thePnt1.Distance(thePnt2)) ); theTxtAngle = VX.Angle( theVec.Reversed() ); - } else if ( theTxtAngle >= -PI/2 && theTxtAngle < 0 ) + } else if ( theTxtAngle >= -M_PI/2 && theTxtAngle < 0 ) pntText = thePnt2.Translated( (myArrowLen+d1)*theVec/(thePnt1.Distance(thePnt2)) ); - else if ( theTxtAngle >= -PI && theTxtAngle < -PI/2 ) { + else if ( theTxtAngle >= -M_PI && theTxtAngle < -M_PI/2 ) { pntText = thePnt1.Translated( (myArrowLen+d1)*theVec.Reversed()/(thePnt1.Distance(thePnt2)) ); theTxtAngle = VX.Angle( theVec.Reversed() ); } @@ -326,14 +326,14 @@ void Prs2d_Radius::DrawElement( const Handle(Graphic2d_Drawer)& aDrawer, gp_Vec2d VX( 1., 0. ), theVec(thePnt2, thePnt1); Standard_Real theTxtAngle = VX.Angle( theVec ); gp_Pnt2d pntText; - if ( theTxtAngle >= 0 && theTxtAngle <= PI/2 ) + if ( theTxtAngle >= 0 && theTxtAngle <= M_PI/2 ) pntText = thePnt2.Translated( (myArrowLen+d1)*theVec/(thePnt1.Distance(thePnt2)) ); - else if ( theTxtAngle > PI/2 && theTxtAngle <= PI ) { + else if ( theTxtAngle > M_PI/2 && theTxtAngle <= M_PI ) { pntText = thePnt1.Translated( (myArrowLen+d1)*theVec.Reversed()/(thePnt1.Distance(thePnt2)) ); theTxtAngle = VX.Angle( theVec.Reversed() ); - } else if ( theTxtAngle >= -PI/2 && theTxtAngle < 0 ) + } else if ( theTxtAngle >= -M_PI/2 && theTxtAngle < 0 ) pntText = thePnt2.Translated( (myArrowLen+d1)*theVec/(thePnt1.Distance(thePnt2)) ); - else if ( theTxtAngle >= -PI && theTxtAngle < -PI/2 ) { + else if ( theTxtAngle >= -M_PI && theTxtAngle < -M_PI/2 ) { pntText = thePnt1.Translated( (myArrowLen+d1)*theVec.Reversed()/(thePnt1.Distance(thePnt2)) ); theTxtAngle = VX.Angle( theVec.Reversed() ); } @@ -510,14 +510,14 @@ Standard_Boolean Prs2d_Radius::Pick( const Standard_ShortReal X, gp_Vec2d VX( 1., 0. ), theVec(thePnt2, thePnt1); Standard_Real theTxtAngle = VX.Angle( theVec ); gp_Pnt2d pntText; - if ( theTxtAngle >= 0 && theTxtAngle <= PI/2 ) + if ( theTxtAngle >= 0 && theTxtAngle <= M_PI/2 ) pntText = thePnt2.Translated( (myArrowLen+d1)*theVec/(thePnt1.Distance(thePnt2)) ); - else if ( theTxtAngle > PI/2 && theTxtAngle <= PI ) { + else if ( theTxtAngle > M_PI/2 && theTxtAngle <= M_PI ) { pntText = thePnt1.Translated( (myArrowLen+d1)*theVec.Reversed()/(thePnt1.Distance(thePnt2)) ); theTxtAngle = VX.Angle( theVec.Reversed() ); - } else if ( theTxtAngle >= -PI/2 && theTxtAngle < 0 ) + } else if ( theTxtAngle >= -M_PI/2 && theTxtAngle < 0 ) pntText = thePnt2.Translated( (myArrowLen+d1)*theVec/(thePnt1.Distance(thePnt2)) ); - else if ( theTxtAngle >= -PI && theTxtAngle < -PI/2 ) { + else if ( theTxtAngle >= -M_PI && theTxtAngle < -M_PI/2 ) { pntText = thePnt1.Translated( (myArrowLen+d1)*theVec.Reversed()/(thePnt1.Distance(thePnt2)) ); theTxtAngle = VX.Angle( theVec.Reversed() ); } diff --git a/src/Prs2d/Prs2d_RadiusIndep.cxx b/src/Prs2d/Prs2d_RadiusIndep.cxx index 7fb77a674c..2f35f0cd3a 100755 --- a/src/Prs2d/Prs2d_RadiusIndep.cxx +++ b/src/Prs2d/Prs2d_RadiusIndep.cxx @@ -113,7 +113,7 @@ Prs2d_RadiusIndep::Prs2d_RadiusIndep( const Handle(Graphic2d_GraphicObject) & aG if ( myX2 > myMaxX ) myMaxX = myX2; if ( myY2 > myMaxY ) myMaxY = myY2; - Standard_Real ArrANG = Standard_PI/6., theArrLN = aRad/5., theANG; + Standard_Real ArrANG = M_PI / 6., theArrLN = aRad/5., theANG; gp_Pnt2d theOrig( 0., 0. ), P2, P3; gp_Vec2d VX( 1., 0. ); diff --git a/src/Prs2d/Prs2d_Repere.cxx b/src/Prs2d/Prs2d_Repere.cxx index 17e8b1737b..07756b7176 100755 --- a/src/Prs2d/Prs2d_Repere.cxx +++ b/src/Prs2d/Prs2d_Repere.cxx @@ -39,7 +39,7 @@ Prs2d_Repere::Prs2d_Repere( const Handle(Graphic2d_GraphicObject)& aGO, gp_Pnt2d theOrig( 0., 0. ), P1, P2, P3; gp_Vec2d VX( 1., 0. ), VDir( aPnt1, aPnt2 ); - Standard_Real alpha = Standard_PI - anArrAngle; + Standard_Real alpha = M_PI - anArrAngle; P1 = aPnt1; P2 = gp_Pnt2d( anArrLength, anArrLength*Tan( alpha/2. ) ); P3 = gp_Pnt2d( anArrLength, -anArrLength*Tan( alpha/2. ) ); @@ -71,15 +71,15 @@ Prs2d_Repere::Prs2d_Repere( const Handle(Graphic2d_GraphicObject)& aGO, } - if ( theAng >= 0. && theAng < PI/2) { + if ( theAng >= 0. && theAng < M_PI/2) { nX -= aLenBase; - } else if ( theAng >= PI/2 && theAng <= PI ) { + } else if ( theAng >= M_PI/2 && theAng <= M_PI ) { nX += aLenBase; myObtuse = Standard_True; - } else if ( theAng >= -PI && theAng < -PI/2) { + } else if ( theAng >= -M_PI && theAng < -M_PI/2) { nX += aLenBase; myObtuse = Standard_True; - } else if ( theAng >= -PI/2 && theAng < 0. ) + } else if ( theAng >= -M_PI/2 && theAng < 0. ) nX -= aLenBase; myXVert(3) = Standard_ShortReal( nX ); diff --git a/src/Prs2d/Prs2d_SurfProfile.cxx b/src/Prs2d/Prs2d_SurfProfile.cxx index eb8a1b596c..4de0a8a65c 100755 --- a/src/Prs2d/Prs2d_SurfProfile.cxx +++ b/src/Prs2d/Prs2d_SurfProfile.cxx @@ -66,7 +66,7 @@ void Prs2d_SurfProfile::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) { Yc = Standard_ShortReal( b1 ); } aDrawer->MapSegmentFromTo( X1, Y1, X2, Y2 ); - aDrawer->MapArcFromTo( Xc, Yc, myLength/2, myAngle, Standard_ShortReal( Standard_PI + myAngle ) ); + aDrawer->MapArcFromTo( Xc, Yc, myLength/2, myAngle, Standard_ShortReal( M_PI + myAngle ) ); } } diff --git a/src/Prs2d/Prs2d_SymCircular.cxx b/src/Prs2d/Prs2d_SymCircular.cxx index 3fb72df511..c63e4348b8 100755 --- a/src/Prs2d/Prs2d_SymCircular.cxx +++ b/src/Prs2d/Prs2d_SymCircular.cxx @@ -24,11 +24,11 @@ void Prs2d_SymCircular::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) { if ( IsIn ) { DrawLineAttrib( aDrawer ); - const Standard_Real alpha = Standard_PI / 12; + const Standard_Real alpha = M_PI / 12; Standard_ShortReal X1 = myX - myLength/2, Y1 = myY - myLength/2, - X2 = Standard_ShortReal(X1 + myLength * Cos( Standard_PI / 4 ) ), + X2 = Standard_ShortReal(X1 + myLength * Cos( M_PI / 4 ) ), Y2 = myY + myLength/2; diff --git a/src/Prs2d/Prs2d_SymTotal.cxx b/src/Prs2d/Prs2d_SymTotal.cxx index 64bdc3e7d4..09319630ae 100755 --- a/src/Prs2d/Prs2d_SymTotal.cxx +++ b/src/Prs2d/Prs2d_SymTotal.cxx @@ -24,16 +24,16 @@ void Prs2d_SymTotal::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) { if ( IsIn ) { DrawLineAttrib( aDrawer ); - const Standard_Real alpha = Standard_PI / 12; + const Standard_Real alpha = M_PI / 12; Standard_ShortReal X1 = myX - myLength/2, Y1 = myY - myLength/2, - X2 = Standard_ShortReal(X1 + myLength * Cos( Standard_PI / 4 ) ), + X2 = Standard_ShortReal(X1 + myLength * Cos( M_PI / 4 ) ), Y2 = myY + myLength/2, X5 = myX, Y5 = myY - myLength/2, - X6 = Standard_ShortReal(X5 + myLength * Cos( Standard_PI / 4 ) ), + X6 = Standard_ShortReal(X5 + myLength * Cos( M_PI / 4 ) ), Y6 = myY + myLength/2; gp_Pnt2d P1( X2, Y2 ); diff --git a/src/Prs2d/Prs2d_Taper.cxx b/src/Prs2d/Prs2d_Taper.cxx index 0a21a1e8ba..ecde3b0892 100755 --- a/src/Prs2d/Prs2d_Taper.cxx +++ b/src/Prs2d/Prs2d_Taper.cxx @@ -28,7 +28,7 @@ void Prs2d_Taper::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) { if ( IsIn ) { DrawLineAttrib( aDrawer ); - const Standard_Real alpha = Standard_PI / 10; + const Standard_Real alpha = M_PI / 10; Standard_ShortReal X1 = myX - myLength/2, Y1 = myY, diff --git a/src/Prs2d/Prs2d_ToleranceFrame.cxx b/src/Prs2d/Prs2d_ToleranceFrame.cxx index e1c58dc680..47dfa16551 100755 --- a/src/Prs2d/Prs2d_ToleranceFrame.cxx +++ b/src/Prs2d/Prs2d_ToleranceFrame.cxx @@ -49,7 +49,7 @@ Prs2d_ToleranceFrame::Prs2d_ToleranceFrame( const Handle(Graphic2d_GraphicObject gp_Pnt2d Pnt0 = PntP.Translated( theV1 ); gp_Vec2d theVecG( Pnt0, gp_Pnt2d( Pnt0.X() + 1.0, Pnt0.Y() ) ); theVecG.Rotate( myAngle ); - gp_Vec2d theVecV = theVecG.Rotated( Standard_PI / 2 ); + gp_Vec2d theVecV = theVecG.Rotated( M_PI / 2 ); theVecG.Normalize(); theVecV.Normalize(); @@ -187,7 +187,7 @@ void Prs2d_ToleranceFrame::Draw( const Handle(Graphic2d_Drawer)& aDrawer ) { theVecT.Normalize(); gp_Vec2d theVecG( Pnt0, gp_Pnt2d( Pnt0.X() + 1.0, Pnt0.Y() ) ); theVecG.Rotate( myAngle ); - gp_Vec2d theVecV = theVecG.Rotated( Standard_PI / 2 ); + gp_Vec2d theVecV = theVecG.Rotated( M_PI / 2 ); theVecG.Normalize(); theVecV.Normalize(); diff --git a/src/Prs3d/Prs3d_AnglePresentation.cxx b/src/Prs3d/Prs3d_AnglePresentation.cxx index 1f258cd018..a281de0876 100755 --- a/src/Prs3d/Prs3d_AnglePresentation.cxx +++ b/src/Prs3d/Prs3d_AnglePresentation.cxx @@ -41,7 +41,7 @@ void Prs3d_AnglePresentation::Draw ( Standard_Real x1,y1,z1,x2,y2,z2; AttachmentPoint2.Coord(x1,y1,z1); AttachmentPoint3.Coord(x2,y2,z2); - Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / PI)); + Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / M_PI)); Standard_Real dteta = alpha/(nbp-1); Standard_Real x,y,z; gp_Vec u; diff --git a/src/Prs3d/Prs3d_Arrow.cxx b/src/Prs3d/Prs3d_Arrow.cxx index af4814a109..0ca101df81 100755 --- a/src/Prs3d/Prs3d_Arrow.cxx +++ b/src/Prs3d/Prs3d_Arrow.cxx @@ -51,8 +51,8 @@ void Prs3d_Arrow::Draw(const Handle(Prs3d_Presentation)& aPresentation, for (Standard_Integer i = 1 ; i <= NbPoints ; i++) { - cosinus = cos ( 2 * PI / NbPoints * (i-1) ); - sinus = sin ( 2 * PI / NbPoints * (i-1) ); + cosinus = cos ( 2 * M_PI / NbPoints * (i-1) ); + sinus = sin ( 2 * M_PI / NbPoints * (i-1) ); x = xc + (cosinus * xi + sinus * xj) * aLength * Tg; y = yc + (cosinus * yi + sinus * yj) * aLength * Tg; diff --git a/src/Prs3d/Prs3d_ArrowAspect.cxx b/src/Prs3d/Prs3d_ArrowAspect.cxx index 32bd93931f..1eac3784fb 100755 --- a/src/Prs3d/Prs3d_ArrowAspect.cxx +++ b/src/Prs3d/Prs3d_ArrowAspect.cxx @@ -3,7 +3,7 @@ #include Prs3d_ArrowAspect::Prs3d_ArrowAspect () - : myAngle(PI/180.*10), myLength(1.) { + : myAngle(M_PI/180.*10), myLength(1.) { #ifdef IMP120100 myArrowAspect = new Graphic3d_AspectLine3d ( @@ -24,7 +24,7 @@ Prs3d_ArrowAspect::Prs3d_ArrowAspect (const Quantity_PlaneAngle anAngle, void Prs3d_ArrowAspect::SetAngle ( const Quantity_PlaneAngle anAngle) { Prs3d_InvalidAngle_Raise_if ( anAngle <= 0. || - anAngle >= PI /2. , ""); + anAngle >= M_PI /2. , ""); myAngle = anAngle; } Quantity_PlaneAngle Prs3d_ArrowAspect::Angle () const diff --git a/src/Prs3d/Prs3d_Datum.gxx b/src/Prs3d/Prs3d_Datum.gxx index eb0293f126..8f25b74c2c 100755 --- a/src/Prs3d/Prs3d_Datum.gxx +++ b/src/Prs3d/Prs3d_Datum.gxx @@ -68,7 +68,7 @@ void Prs3d_Datum::Add( const Handle(Prs3d_Presentation)& aPresentation, G->SetPrimitivesAspect(aDrawer->TextAspect()->Aspect()); G->Text(Standard_CString("X"),A(2),16.); #else - Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),oX,PI/180.*10.,DS/10.); + Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),oX,M_PI/180.*10.,DS/10.); Prs3d_Root::CurrentGroup(aPresentation)->Text(Standard_CString("X"),A(2),1./81.); #endif } @@ -85,7 +85,7 @@ void Prs3d_Datum::Add( const Handle(Prs3d_Presentation)& aPresentation, G->SetPrimitivesAspect(aDrawer->TextAspect()->Aspect()); G->Text(Standard_CString("Y"),A(2),16.); #else - Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),oY,PI/180.*10.,DS/10.); + Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),oY,M_PI/180.*10.,DS/10.); Prs3d_Root::CurrentGroup(aPresentation)->Text(Standard_CString("Y"),A(2),1./81.); #endif } @@ -103,7 +103,7 @@ void Prs3d_Datum::Add( const Handle(Prs3d_Presentation)& aPresentation, G->Text(Standard_CString("Z"),A(2),16.); #else Prs3d_Root::CurrentGroup(aPresentation)->Text(Standard_CString("Z"),A(2),1./81.); - Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),oZ,PI/180.*10.,DS/10.); + Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),oZ,M_PI/180.*10.,DS/10.); #endif } } diff --git a/src/Prs3d/Prs3d_Drawer.cxx b/src/Prs3d/Prs3d_Drawer.cxx index 8f88615876..e5e70e92f4 100755 --- a/src/Prs3d/Prs3d_Drawer.cxx +++ b/src/Prs3d/Prs3d_Drawer.cxx @@ -15,8 +15,8 @@ Prs3d_Drawer::Prs3d_Drawer(): myNbPoints(30),myIsoOnPlane(Standard_False), myMaximalParameterValue(500000.), myDeviationCoefficient(0.001), myHLRDeviationCoefficient(0.02), - myDeviationAngle(12*PI/180), - myHLRAngle(20*PI/180), + myDeviationAngle(12*M_PI/180), + myHLRAngle(20*M_PI/180), myLineDrawArrow(Standard_False), myDrawHiddenLine(Standard_False) { diff --git a/src/Prs3d/Prs3d_PlaneAspect.cxx b/src/Prs3d/Prs3d_PlaneAspect.cxx index 837993dc5d..671b59e1e4 100755 --- a/src/Prs3d/Prs3d_PlaneAspect.cxx +++ b/src/Prs3d/Prs3d_PlaneAspect.cxx @@ -14,7 +14,7 @@ Prs3d_PlaneAspect::Prs3d_PlaneAspect() myPlaneYLength= 1.; myArrowsLength= 0.02; myArrowsSize=0.1; - myArrowsAngle=PI/8.; + myArrowsAngle=M_PI/8.; } Handle(Prs3d_LineAspect) Prs3d_PlaneAspect::EdgesAspect() const diff --git a/src/Prs3d/Prs3d_Vector.gxx b/src/Prs3d/Prs3d_Vector.gxx index 340119fe99..fdc4931aa0 100755 --- a/src/Prs3d/Prs3d_Vector.gxx +++ b/src/Prs3d/Prs3d_Vector.gxx @@ -40,7 +40,7 @@ void Prs3d_Vector::Add(const Handle(Prs3d_Presentation)& aPresentation, A(2).SetCoord(x1+dx,y1+dy,z1+dz); G->Polyline(A); Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x1+dx,y1+dy,z1+dz),gp_Dir(Vec), - PI/180.*10.,Sqrt(dx*dx+dy*dy+dz*dz)/10.); + M_PI/180.*10.,Sqrt(dx*dx+dy*dy+dz*dz)/10.); } diff --git a/src/QABUC/QABUC.cxx b/src/QABUC/QABUC.cxx index c5362a0ba0..f19775054c 100755 --- a/src/QABUC/QABUC.cxx +++ b/src/QABUC/QABUC.cxx @@ -1373,7 +1373,7 @@ static Standard_Integer BUC60856(Draw_Interpretor& di, Standard_Integer /*argc*/ double R1=8, R2=16, H1=20, H2=40, angle; gp_Pnt P0(0,0,0), P1(0,0,20), P2(0,0,45); - angle = 2*PI; + angle = 2*M_PI; Handle(Geom_RectangularTrimmedSurface) S = GC_MakeTrimmedCone (P1, P2, R1, R2).Value(); TopoDS_Shape myshape = BRepBuilderAPI_MakeFace(S, Precision::Confusion()).Shape(); Handle(AIS_Shape) ais1 = new AIS_Shape(myshape); diff --git a/src/QAMitutoyoUK/QAMitutoyoUK.cxx b/src/QAMitutoyoUK/QAMitutoyoUK.cxx index c81f217e3d..138edc2b1c 100755 --- a/src/QAMitutoyoUK/QAMitutoyoUK.cxx +++ b/src/QAMitutoyoUK/QAMitutoyoUK.cxx @@ -39,7 +39,7 @@ static Standard_Integer BUC60753 (Draw_Interpretor& di, Standard_Integer argc, c return 1; } - Standard_Real Alpha = Standard_PI/10.; + Standard_Real Alpha = M_PI/10.; Standard_Real CosAlpha = Cos (Alpha); Standard_Real SinAlpha = Sin (Alpha); Standard_Real MoinsCosAlpha = Cos (-Alpha); diff --git a/src/QAMitutoyoUS/QAMitutoyoUS.cxx b/src/QAMitutoyoUS/QAMitutoyoUS.cxx index b8d54e4598..c30bc24e53 100755 --- a/src/QAMitutoyoUS/QAMitutoyoUS.cxx +++ b/src/QAMitutoyoUS/QAMitutoyoUS.cxx @@ -25,7 +25,7 @@ static Standard_Integer BUC60857 (Draw_Interpretor& di, Standard_Integer /*argc* gp_Ax2 Cone_Ax; double R1=8, R2=16, H1=20, H2=40, angle; gp_Pnt P0(0,0,0), P1(0,0,20), P2(0,0,45); - angle = 2*PI; + angle = 2*M_PI; Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); if(aContext.IsNull()) { diff --git a/src/QANIC/QANIC.cxx b/src/QANIC/QANIC.cxx index 0a9146e9e5..b755ea357b 100755 --- a/src/QANIC/QANIC.cxx +++ b/src/QANIC/QANIC.cxx @@ -68,7 +68,7 @@ static Standard_Integer OCC426 (Draw_Interpretor& di, Standard_Integer argc, con gp_Pnt P1(0, 0, 0); gp_Dir D1(0, 0, 30); gp_Ax1 A1(P1,D1); - Standard_Real angle1 = 360 * PI180; + Standard_Real angle1 = 360 * (M_PI / 180.0); TopoDS_Shape rs1 = BRepPrimAPI_MakeRevol(F1, A1, angle1); BRepBuilderAPI_MakePolygon W2; @@ -86,7 +86,7 @@ static Standard_Integer OCC426 (Draw_Interpretor& di, Standard_Integer argc, con gp_Pnt P2(0, 0, 0); gp_Dir D2(0, 0, 30); gp_Ax1 A2(P2,D2); - Standard_Real angle2 = 270 * PI180; + Standard_Real angle2 = 270 * (M_PI / 180.0); TopoDS_Shape rs2 = BRepPrimAPI_MakeRevol(F2, A2, angle2); BRepBuilderAPI_MakePolygon W3; @@ -102,7 +102,7 @@ static Standard_Integer OCC426 (Draw_Interpretor& di, Standard_Integer argc, con gp_Pnt P3(0, 0, 0); gp_Dir D3(0, 0, 30); gp_Ax1 A3(P3,D3); - Standard_Real angle3 = 360 * PI180; + Standard_Real angle3 = 360 * (M_PI / 180.0); TopoDS_Shape rs3 = BRepPrimAPI_MakeRevol(F3, A3, angle3); TopoDS_Shape fuse32, fuse321; @@ -357,7 +357,7 @@ static Standard_Integer OCC712 (Draw_Interpretor& di, Standard_Integer argc, con TopoDS_Shape slabShape = slab.Shape(); if (fabs(draftAngle) > 0.01) { - Standard_Real angle = draftAngle*PI180; + Standard_Real angle = draftAngle*(M_PI / 180.0); BRepOffsetAPI_DraftAngle draftSlab(slabShape); TopoDS_Shape fShape = slab.FirstShape(); @@ -880,7 +880,7 @@ static Standard_Integer OCC826 (Draw_Interpretor& di,Standard_Integer argc, cons gp_Pnt P1(0, 0, 0); gp_Dir D1(0, 30, 0); gp_Ax1 A1(P1,D1); - Standard_Real angle1 = 360 * PI180; + Standard_Real angle1 = 360 * (M_PI / 180.0); TopoDS_Shape rev = BRepPrimAPI_MakeRevol(F1, A1, angle1); if (index < argc) DBRep::Set(argv[index++], rev); @@ -954,7 +954,7 @@ static Standard_Integer OCC827 (Draw_Interpretor& di,Standard_Integer argc, cons gp_Pnt P1(0, 0, 0); gp_Dir D1(0, 0, 30); gp_Ax1 A1(P1,D1); - Standard_Real angle1 = 360 * PI180; + Standard_Real angle1 = 360 * (M_PI / 180.0); TopoDS_Shape rev = BRepPrimAPI_MakeRevol(F1, A1, angle1); if (index < argc) DBRep::Set(argv[index++], rev); diff --git a/src/QAOCC/QAOCC.cxx b/src/QAOCC/QAOCC.cxx index 5375081598..45763f7c65 100755 --- a/src/QAOCC/QAOCC.cxx +++ b/src/QAOCC/QAOCC.cxx @@ -1280,7 +1280,7 @@ static Standard_Integer OCC22 (Draw_Interpretor& di, Standard_Integer argc, cons else aConsiderLocation = Standard_True; // 2. Iniitialize aShapeUpgrade - ShapeUpgrade_ShapeDivideAngle aShapeUpgrade(PI/2.); + ShapeUpgrade_ShapeDivideAngle aShapeUpgrade(M_PI/2.); // precision aShapeUpgrade.SetPrecision (Precision::Confusion()); // tolerance @@ -1384,7 +1384,7 @@ static Standard_Integer OCC369(Draw_Interpretor& di, Standard_Integer argc, cons if(aShape.IsNull()) {di << "OCC369 FAULTY. Entry shape is NULL \n"; return 0;} // 3. Build mesh - BRepMesh_IncrementalMesh aMesh(aShape, 0.2, Standard_True, PI/6); + BRepMesh_IncrementalMesh aMesh(aShape, 0.2, Standard_True, M_PI/6); } catch (Standard_Failure) {di << "OCC369 Exception \n" ;return 0;} @@ -2221,8 +2221,8 @@ static Standard_Integer OCC1487 (Draw_Interpretor& di, Standard_Integer argc, co TopoDS_Shape cyl2; TopoDS_Shape o_cut_shape; if (CaseNumber == 1) { - //BRepPrimAPI_MakeCylinder o_mc2 (gp_Ax2 (gp_Pnt(21.65064, -50.0, 127.5),gp_Dir(-sin(PI/3), 0.0, 0.5)), 5, 150); - gp_Dir myDir_mc2(-sin(PI/3), 0.0, 0.5); + //BRepPrimAPI_MakeCylinder o_mc2 (gp_Ax2 (gp_Pnt(21.65064, -50.0, 127.5),gp_Dir(-sin(M_PI/3), 0.0, 0.5)), 5, 150); + gp_Dir myDir_mc2(-sin(M_PI/3), 0.0, 0.5); gp_Pnt myPnt_mc2(21.65064, -50.0, 127.5); gp_Ax2 myAx2_mc2(myPnt_mc2, myDir_mc2); BRepPrimAPI_MakeCylinder o_mc2 (myAx2_mc2, 5, 150); @@ -2241,8 +2241,8 @@ static Standard_Integer OCC1487 (Draw_Interpretor& di, Standard_Integer argc, co o_cut_shape = BRepAlgo_Cut (o_mc1.Solid (), o_mc2.Solid ()); } } else { - //BRepPrimAPI_MakeCylinder o_mc2 (gp_Ax2 (gp_Pnt(978.34936, -50.0, 127.5),gp_Dir(sin(PI/3), 0.0, 0.5)), 5, 150); - gp_Dir myDir_mc2(-sin(PI/3), 0.0, 0.5); + //BRepPrimAPI_MakeCylinder o_mc2 (gp_Ax2 (gp_Pnt(978.34936, -50.0, 127.5),gp_Dir(sin(M_PI/3), 0.0, 0.5)), 5, 150); + gp_Dir myDir_mc2(-sin(M_PI/3), 0.0, 0.5); gp_Pnt myPnt_mc2(21.65064, -50.0, 127.5); gp_Ax2 myAx2_mc2(myPnt_mc2, myDir_mc2); BRepPrimAPI_MakeCylinder o_mc2 (myAx2_mc2, 5, 150); @@ -3361,7 +3361,7 @@ Standard_Integer OCC14376(Draw_Interpretor& di, Standard_Integer argc, const cha } di<<"deflection="<< aDeflection << "\n"; - BRepMesh_IncrementalMesh aIMesh(aShape, aDeflection, Standard_False, PI/9.); + BRepMesh_IncrementalMesh aIMesh(aShape, aDeflection, Standard_False, M_PI/9.); TopLoc_Location aLocation; Handle(Poly_Triangulation) aTriang = BRep_Tool::Triangulation(TopoDS::Face(aShape), aLocation); diff --git a/src/QAQuickPen/QAQuickPen.cxx b/src/QAQuickPen/QAQuickPen.cxx index 993d7f305a..27c451ea71 100755 --- a/src/QAQuickPen/QAQuickPen.cxx +++ b/src/QAQuickPen/QAQuickPen.cxx @@ -52,12 +52,12 @@ static Standard_Integer OCC895 (Draw_Interpretor& di, Standard_Integer argc, con gp_Ax2 axis1 = reverse? gp_Ax2(center1, gp::DY(), gp::DZ()) : gp_Ax2(center1, -gp::DY(), gp::DX()); if (Abs(angle) > gp::Resolution()) - axis1.Rotate(gp_Ax1(center1, gp::DZ()), angle*PI/180.0); + axis1.Rotate(gp_Ax1(center1, gp::DZ()), angle*M_PI/180.0); gce_MakeCirc makeCirc1(axis1, rad); if(!makeCirc1.IsDone()) return 1; gp_Circ circ1 = makeCirc1.Value(); - GC_MakeArcOfCircle makeArc1(circ1, 0, PI/2, Standard_True); + GC_MakeArcOfCircle makeArc1(circ1, 0, M_PI/2, Standard_True); if(!makeArc1.IsDone()) return 1; Handle_Geom_TrimmedCurve arc1 = makeArc1.Value(); @@ -77,7 +77,7 @@ static Standard_Integer OCC895 (Draw_Interpretor& di, Standard_Integer argc, con gce_MakeCirc makeCirc2(axis2, rad); if(!makeCirc2.IsDone()) return 1; gp_Circ circ2 = makeCirc2.Value(); - GC_MakeArcOfCircle makeArc2(circ2, 0, PI/2, Standard_True); + GC_MakeArcOfCircle makeArc2(circ2, 0, M_PI/2, Standard_True); if(!makeArc2.IsDone()) return 1; Handle_Geom_TrimmedCurve arc2 = makeArc2.Value(); diff --git a/src/QARicardo/QARicardo.cxx b/src/QARicardo/QARicardo.cxx index efc986392a..eb85447064 100755 --- a/src/QARicardo/QARicardo.cxx +++ b/src/QARicardo/QARicardo.cxx @@ -65,15 +65,9 @@ static Standard_Integer OCC332bug (Draw_Interpretor& di, Standard_Integer argc, if (argc>4) major_radius = atof(argv[4]); if (argc>5) length = atof(argv[5]); double bend_angle = length/major_radius; - double PI; -#ifdef M_PI - PI = M_PI; -#else - PI = 2. * asin(1.0); -#endif //if ((bend_angle >= M_PI)) { - if ((bend_angle >= PI)) { + if ((bend_angle >= M_PI)) { di << "The arguments are invalid." << "\n"; return(TCL_ERROR); } @@ -426,13 +420,7 @@ static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, con double radius_l = 20.0; double radius_r = 80.0; // mkv 15.07.03 double bend_angle = M_PI/2.0; - double PI; -#ifdef M_PI - PI = M_PI; -#else - PI = 2. * asin(1.0); -#endif - double bend_angle = PI/2.0; + double bend_angle = M_PI/2.0; double major_rad = 280.0; double wall_thickness = 10.0; @@ -446,7 +434,7 @@ static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, con if (argc>5) wall_thickness = atof(argv[5]); // mkv 15.07.03 if ((bend_angle >= 2.0*M_PI)) { - if ((bend_angle >= 2.0*PI)) { + if ((bend_angle >= 2.0*M_PI)) { di << "The arguments are invalid." << "\n"; return(TCL_ERROR); } @@ -486,22 +474,22 @@ static Standard_Integer OCC544 (Draw_Interpretor& di, Standard_Integer argc, con gp_Circ faceCircle2(circ2axis,radius_r); gp_Circ outFaceCircle2(circ2axis,radius_r+wall_thickness); - TopoDS_Edge E1_1 = BRepBuilderAPI_MakeEdge(faceCircle, 0, PI); - TopoDS_Edge E1_2 = BRepBuilderAPI_MakeEdge(faceCircle, PI, 2.*PI); + TopoDS_Edge E1_1 = BRepBuilderAPI_MakeEdge(faceCircle, 0, M_PI); + TopoDS_Edge E1_2 = BRepBuilderAPI_MakeEdge(faceCircle, M_PI, 2.*M_PI); TopoDS_Wire Wire1_ = BRepBuilderAPI_MakeWire(E1_1, E1_2); // Create the face at the near end for the wall solid, an annular ring. - TopoDS_Edge Eout1_1 = BRepBuilderAPI_MakeEdge(outFaceCircle, 0, PI); - TopoDS_Edge Eout1_2 = BRepBuilderAPI_MakeEdge(outFaceCircle, PI, 2.*PI); + TopoDS_Edge Eout1_1 = BRepBuilderAPI_MakeEdge(outFaceCircle, 0, M_PI); + TopoDS_Edge Eout1_2 = BRepBuilderAPI_MakeEdge(outFaceCircle, M_PI, 2.*M_PI); TopoDS_Wire outerWire1_ = BRepBuilderAPI_MakeWire(Eout1_1, Eout1_2); - TopoDS_Edge E2_1 = BRepBuilderAPI_MakeEdge(faceCircle2, 0, PI); - TopoDS_Edge E2_2 = BRepBuilderAPI_MakeEdge(faceCircle2, PI, 2.*PI); + TopoDS_Edge E2_1 = BRepBuilderAPI_MakeEdge(faceCircle2, 0, M_PI); + TopoDS_Edge E2_2 = BRepBuilderAPI_MakeEdge(faceCircle2, M_PI, 2.*M_PI); TopoDS_Wire Wire2_ = BRepBuilderAPI_MakeWire(E2_1, E2_2); // Create the face at the far end for the wall solid, an annular ring. - TopoDS_Edge Eout2_1 = BRepBuilderAPI_MakeEdge(outFaceCircle2, 0, PI); - TopoDS_Edge Eout2_2 = BRepBuilderAPI_MakeEdge(outFaceCircle2, PI, 2.*PI); + TopoDS_Edge Eout2_1 = BRepBuilderAPI_MakeEdge(outFaceCircle2, 0, M_PI); + TopoDS_Edge Eout2_2 = BRepBuilderAPI_MakeEdge(outFaceCircle2, M_PI, 2.*M_PI); TopoDS_Wire outerWire2_ = BRepBuilderAPI_MakeWire(Eout2_1, Eout2_2); BRepBuilderAPI_MakeFace mkFace; diff --git a/src/QASamtech/QASamtech.cxx b/src/QASamtech/QASamtech.cxx index 656bb3caf4..20cd979939 100755 --- a/src/QASamtech/QASamtech.cxx +++ b/src/QASamtech/QASamtech.cxx @@ -634,7 +634,7 @@ static Standard_Integer OCC394 (Draw_Interpretor& di, Standard_Integer argc, con Standard_Integer k = 3; Standard_Real tol = 100000; Standard_Integer mode = 2; - Standard_Real tolang = PI/2; + Standard_Real tolang = M_PI/2; if(argc > k) tol = atof(argv[k++]); diff --git a/src/QAViewer2dTest/QAViewer2dTest.cxx b/src/QAViewer2dTest/QAViewer2dTest.cxx index b4b8ba9fda..6f7f4f6976 100755 --- a/src/QAViewer2dTest/QAViewer2dTest.cxx +++ b/src/QAViewer2dTest/QAViewer2dTest.cxx @@ -482,7 +482,7 @@ static Standard_Integer TDraft2d (Draw_Interpretor& di, Standard_Integer argc, c return 1; } anAngle = atof(argv[4]); - anAngle = 2*PI * anAngle / 360.0; + anAngle = 2*M_PI * anAngle / 360.0; gp_Pln aPln; Handle(Geom_Surface) aSurf; // AIS2D_KindOfSurface aSurfType; diff --git a/src/QAViewer2dTest/QAViewer2dTest_GeneralCommands.cxx b/src/QAViewer2dTest/QAViewer2dTest_GeneralCommands.cxx index d708c8738b..418fce1d32 100755 --- a/src/QAViewer2dTest/QAViewer2dTest_GeneralCommands.cxx +++ b/src/QAViewer2dTest/QAViewer2dTest_GeneralCommands.cxx @@ -461,7 +461,7 @@ static char *GetTypeNameFromShape2d (const TopoDS_Shape& aShape) OSD_Timer myTimer; TheAIS2DContext()->CloseLocalContext(); - Standard_Real Step = 4*PI/180; + Standard_Real Step = 4*M_PI/180; Standard_Real Angle = 0; Handle(AIS2D_InteractiveObject) aIO; @@ -483,7 +483,7 @@ static char *GetTypeNameFromShape2d (const TopoDS_Shape& aShape) if (atoi(argv[2]) == 1) { cout << " Calcul par Transformation" << endl; - for (Standard_Real myAngle = 0; Angle < 10*2*PI; myAngle++) + for (Standard_Real myAngle = 0; Angle < 10*2*M_PI; myAngle++) { Angle = Step*myAngle; gp_Trsf myTransfo; @@ -500,7 +500,7 @@ static char *GetTypeNameFromShape2d (const TopoDS_Shape& aShape) TopLoc_Location myDeltaAngle (myAngleTrsf); TopLoc_Location myTrueLoc; - for (Standard_Real myAngle = 0; Angle < 10*2*PI; myAngle++) + for (Standard_Real myAngle = 0; Angle < 10*2*M_PI; myAngle++) { Angle = Step*myAngle; myTrueLoc = myTrueLoc*myDeltaAngle; @@ -580,9 +580,9 @@ static char *GetTypeNameFromShape2d (const TopoDS_Shape& aShape) // TheAIS2DContext()->Deactivate(myAisPropeller ); // Boucle de mouvement - for (Standard_Real myAngle = 0; angleA < 2*PI*10.175; myAngle++) + for (Standard_Real myAngle = 0; angleA < 2*M_PI*10.175; myAngle++) { - angleA = thread*myAngle*PI/180; + angleA = thread*myAngle*M_PI/180; X = Sin(angleA)*3/8; angleB = atan(X / Sqrt(-X * X + 1)); // Standard_Real decal(25*0.6); diff --git a/src/QAViewer2dTest/QAViewer2dTest_ObjectCommands.cxx b/src/QAViewer2dTest/QAViewer2dTest_ObjectCommands.cxx index ccfaf62f1d..971df3b7bb 100755 --- a/src/QAViewer2dTest/QAViewer2dTest_ObjectCommands.cxx +++ b/src/QAViewer2dTest/QAViewer2dTest_ObjectCommands.cxx @@ -240,7 +240,7 @@ static int V2dTrihedron2D (Draw_Interpretor& , Standard_Integer argc, char** arg gp_Dir TheZVector (coord[3],coord[4],coord[5]); gp_Dir TheXVector (coord[6],coord[7],coord[8]); - if (!TheZVector.IsNormal(TheXVector,PI/180)) + if (!TheZVector.IsNormal(TheXVector,M_PI/180)) { cout << argv[0] << " VectorX is not normal to VectorZ" << endl; return 1; @@ -1121,7 +1121,7 @@ static int V2dPlaneBuilder (Draw_Interpretor& , Standard_Integer argc, char** ar if (mySurface.GetType() == GeomAbs_Plane) { gp_Pln myPlane = mySurface.Plane(); - myPlane.Rotate(myRotAxis, PI/2); + myPlane.Rotate(myRotAxis, M_PI/2); Handle(Geom_Plane) theGeomPlane = new Geom_Plane(myPlane); gp_Pnt theMiddle ((Aa.X()+Ab.X())/2, (Aa.Y()+Ab.Y())/2, (Aa.Z()+Ab.Z())/2); @@ -1169,7 +1169,7 @@ static int V2dPlaneBuilder (Draw_Interpretor& , Standard_Integer argc, char** ar if (mySurface.GetType() == GeomAbs_Plane) { gp_Pln myPlane = mySurface.Plane(); - myPlane.Rotate(myRotAxis, PI/2); + myPlane.Rotate(myRotAxis, M_PI/2); Handle(Geom_Plane) theGeomPlane = new Geom_Plane(myPlane); gp_Pnt theMiddle ((Ba.X()+Bb.X())/2, (Ba.Y()+Bb.Y())/2, (Ba.Z()+Bb.Z())/2); Handle(AIS2D_Plane) myAIS2DPlane = new AIS2D_Plane(theGeomPlane, theMiddle); diff --git a/src/STEPConstruct/STEPConstruct_UnitContext.cxx b/src/STEPConstruct/STEPConstruct_UnitContext.cxx index 2e86d13842..7f0c96929b 100755 --- a/src/STEPConstruct/STEPConstruct_UnitContext.cxx +++ b/src/STEPConstruct/STEPConstruct_UnitContext.cxx @@ -239,7 +239,7 @@ Standard_Integer STEPConstruct_UnitContext::ComputeFactors(const Handle(StepRepr // Initialise the default value // status : 0 if OK, else 1 2 3 lengthFactor = solidAngleFactor = 1.; - planeAngleFactor = PI/180.; + planeAngleFactor = M_PI/180.; // Standard_Real theLExp = 1.; // Standard_Real thePAExp = 0.; // Standard_Real theSAExp = 0.; diff --git a/src/STEPControl/STEPControl_ActorRead.cxx b/src/STEPControl/STEPControl_ActorRead.cxx index 34eb9725b3..50b92ca29c 100755 --- a/src/STEPControl/STEPControl_ActorRead.cxx +++ b/src/STEPControl/STEPControl_ActorRead.cxx @@ -1551,7 +1551,7 @@ void STEPControl_ActorRead::PrepareUnits(const Handle(StepRepr_Representation)& stat1 = myUnit.ComputeFactors(theGUAC); Standard_Integer anglemode = Interface_Static::IVal("step.angleunit.mode"); Standard_Real angleFactor = ( anglemode == 0 ? myUnit.PlaneAngleFactor() : - anglemode == 1 ? 1. : PI/180. ); + anglemode == 1 ? 1. : M_PI/180. ); UnitsMethods::InitializeFactors(myUnit.LengthFactor(), angleFactor, myUnit.SolidAngleFactor()); diff --git a/src/STEPControl/STEPControl_ActorWrite.cxx b/src/STEPControl/STEPControl_ActorWrite.cxx index fba328abb5..6c50114658 100755 --- a/src/STEPControl/STEPControl_ActorWrite.cxx +++ b/src/STEPControl/STEPControl_ActorWrite.cxx @@ -447,7 +447,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::Transfer (const Handle(Transfer_ Standard_Real lFactor = UnitsMethods::GetLengthFactorValue ( Interface_Static::IVal ( "write.step.unit" ) ); lFactor /= UnitsMethods::GetCasCadeLengthUnit(); Standard_Integer anglemode = Interface_Static::IVal("step.angleunit.mode"); - UnitsMethods::InitializeFactors ( lFactor, ( anglemode <= 1 ? 1. : PI/180. ), 1. ); + UnitsMethods::InitializeFactors ( lFactor, ( anglemode <= 1 ? 1. : M_PI/180. ), 1. ); // create SDR STEPConstruct_Part SDRTool; diff --git a/src/SWDRAW/SWDRAW_ShapeFix.cxx b/src/SWDRAW/SWDRAW_ShapeFix.cxx index 13a4493e15..451087bb67 100755 --- a/src/SWDRAW/SWDRAW_ShapeFix.cxx +++ b/src/SWDRAW/SWDRAW_ShapeFix.cxx @@ -537,7 +537,7 @@ static Standard_Integer fixsmalledges(Draw_Interpretor& di, Standard_Integer n, Standard_Integer k = 3; Standard_Real tol = 100000; Standard_Integer mode = 2; - Standard_Real tolang = PI/2; + Standard_Real tolang = M_PI/2; if(n > k) tol = atof(a[k++]); diff --git a/src/SWDRAW/SWDRAW_ShapeUpgrade.cxx b/src/SWDRAW/SWDRAW_ShapeUpgrade.cxx index 1bfa4d96c6..893d4f0d32 100755 --- a/src/SWDRAW/SWDRAW_ShapeUpgrade.cxx +++ b/src/SWDRAW/SWDRAW_ShapeUpgrade.cxx @@ -447,7 +447,7 @@ static Standard_Integer DT_SplitAngle(Draw_Interpretor& di, if ( maxangle <1 ) maxangle = 1; } - ShapeUpgrade_ShapeDivideAngle tool(maxangle*PI/180,inputShape); + ShapeUpgrade_ShapeDivideAngle tool(maxangle*M_PI/180,inputShape); tool.Perform(); TopoDS_Shape res = tool.Result(); diff --git a/src/Select2D/Select2D_SensitiveArc.cxx b/src/Select2D/Select2D_SensitiveArc.cxx index 65f2bf08b3..4ea8d6ae57 100755 --- a/src/Select2D/Select2D_SensitiveArc.cxx +++ b/src/Select2D/Select2D_SensitiveArc.cxx @@ -34,7 +34,7 @@ myangle(Angle), mynbpt(NbPoints) { - if(myangle<=Precision::Confusion()) myangle=2*PI; + if(myangle<=Precision::Confusion()) myangle=2*M_PI; } diff --git a/src/Select2D/Select2D_SensitiveSegment.cxx b/src/Select2D/Select2D_SensitiveSegment.cxx index b224892561..8747d5f417 100755 --- a/src/Select2D/Select2D_SensitiveSegment.cxx +++ b/src/Select2D/Select2D_SensitiveSegment.cxx @@ -45,10 +45,10 @@ Areas(SelectBasics_ListOfBox2d& boxes) Standard_Real theangle = (VAxx.Angle(MyVec)); theangle = Abs(theangle); - if(theangle>=PI/2.) theangle-=PI/2; + if(theangle>=M_PI/2.) theangle-=M_PI/2; - if(theangle>=PI/12. && theangle <=5*PI/12.) + if(theangle>=M_PI/12. && theangle <=5*M_PI/12.) { TColgp_Array1OfPnt2d BoxPoint (1,mymaxrect+1); BoxPoint (1) = mystart;BoxPoint(mymaxrect+1)=myend; diff --git a/src/Select3D/Select3D_SensitiveSegment.cxx b/src/Select3D/Select3D_SensitiveSegment.cxx index c8a0ac8cd5..d852b2a2c8 100755 --- a/src/Select3D/Select3D_SensitiveSegment.cxx +++ b/src/Select3D/Select3D_SensitiveSegment.cxx @@ -82,8 +82,8 @@ void Select3D_SensitiveSegment else { gp_Vec2d MyVec(myprojstart,myprojend);//,VAxx(gp_Dir2d(0.,1.)); Standard_Real theangle = Abs(gp_Dir2d(0.,1.).Angle(gp_Vec2d(myprojstart,myprojend))); - if(theangle>=PI/2.) theangle-=PI/2; - if(theangle>=PI/12. && theangle <=5*PI/12.) + if(theangle>=M_PI/2.) theangle-=M_PI/2; + if(theangle>=M_PI/12. && theangle <=5*M_PI/12.) { TColgp_Array1OfPnt2d BoxPoint (1,mymaxrect+1); BoxPoint (1) = myprojstart; diff --git a/src/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx b/src/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx index b2b1dab787..80b1ccc066 100755 --- a/src/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx @@ -918,7 +918,7 @@ Standard_Boolean ShapeAnalysis_CheckSmallFace::CheckTwisted (const TopoDS_Face& } // cout << "angle1 " << angle1<< endl; // cout << "angle2 " << angle2<< endl; - if ((angle1<=0.001 && angle2<=0.01) || ((PI-angle2)<= 0.001 && (PI-angle2)<= 0.01)) return Standard_True; + if ((angle1<=0.001 && angle2<=0.01) || ((M_PI-angle2)<= 0.001 && (M_PI-angle2)<= 0.01)) return Standard_True; else return Standard_False; } diff --git a/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx b/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx index 3030cf9e87..9ba14d6f7c 100755 --- a/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx @@ -338,7 +338,7 @@ Standard_Real ShapeAnalysis_Curve::ProjectAct(const Adaptor3d_Curve& C3D, proj = ElCLib::Value(param, aCirc); } closed = Standard_True; - valclosed = 2.*PI; + valclosed = 2.*M_PI; } break; case GeomAbs_Hyperbola: @@ -364,7 +364,7 @@ Standard_Real ShapeAnalysis_Curve::ProjectAct(const Adaptor3d_Curve& C3D, param = ElCLib::Parameter(C3D.Ellipse(), P3D); proj = ElCLib::Value(param, C3D.Ellipse()); closed = Standard_True; - valclosed = 2.*PI; + valclosed = 2.*M_PI; } break; @@ -802,8 +802,8 @@ static void AppendControlPoles (TColgp_SequenceOfPnt& seq, seq.Append(curve->Value(1)); } else if ( curve->IsKind(STANDARD_TYPE(Geom_Conic))) { seq.Append(curve->Value(0)); - seq.Append(curve->Value(PI/2)); - seq.Append(curve->Value(PI)); + seq.Append(curve->Value(M_PI/2)); + seq.Append(curve->Value(M_PI)); } else if ( curve->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) { //DeclareAndCast(Geom_TrimmedCurve, Trimmed, curve); Handle(Geom_TrimmedCurve) Trimmed = *((Handle(Geom_TrimmedCurve) *) &curve); @@ -1087,7 +1087,7 @@ Standard_Boolean ShapeAnalysis_Curve::GetSamplePoints (const Handle(Geom2d_Curve return Standard_True; } else if(curve->IsKind(STANDARD_TYPE(Geom2d_Conic))) { - step = Min ( PI, last-first ) / 19; //:abv 05.06.02 TUBE.stp #19209...: PI/16 + step = Min ( M_PI, last-first ) / 19; //:abv 05.06.02 TUBE.stp #19209...: M_PI/16 // if( step>(last-first) ) { // seq.Append(curve->Value(first)); // seq.Append(curve->Value((last+first)/2)); diff --git a/src/ShapeAnalysis/ShapeAnalysis_FreeBoundsProperties.cxx b/src/ShapeAnalysis/ShapeAnalysis_FreeBoundsProperties.cxx index 14dd52c1c9..fb74de9fd0 100755 --- a/src/ShapeAnalysis/ShapeAnalysis_FreeBoundsProperties.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_FreeBoundsProperties.cxx @@ -329,7 +329,7 @@ Standard_Boolean ShapeAnalysis_FreeBoundsProperties::CheckNotches(const TopoDS_W if ( E2.Orientation() == TopAbs_REVERSED ) vec2.Reverse(); Standard_Real angl = Abs( vec1.Angle(vec2)); - if (angl > 0.95*PI) { + if (angl > 0.95*M_PI) { distMax = .0; for (Standard_Integer i = 0; i < NbControl; i++) { Standard_Real prm = ((NbControl-1-i)*First1 + i*Last1)/(NbControl-1); diff --git a/src/ShapeAnalysis/ShapeAnalysis_Surface.cxx b/src/ShapeAnalysis/ShapeAnalysis_Surface.cxx index f99ea52b38..89cdbb60a9 100755 --- a/src/ShapeAnalysis/ShapeAnalysis_Surface.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_Surface.cxx @@ -146,12 +146,12 @@ void ShapeAnalysis_Surface::ComputeSingularities() //szv#4:S4163:12Mar99 warning - possible div by zero Standard_Real Ang = ACos (Min (1., majorR / minorR)); myPreci [0] = myPreci[1] = Max (0., majorR - minorR); - myP3d [0] = mySurf->Value (0., PI-Ang); - myFirstP2d[0].SetCoord (su1, PI-Ang); - myLastP2d [0].SetCoord (su2, PI-Ang); - myP3d [1] = mySurf->Value (0., PI+Ang); - myFirstP2d[1].SetCoord (su2, PI+Ang); - myLastP2d [1].SetCoord (su1, PI+Ang); + myP3d [0] = mySurf->Value (0., M_PI-Ang); + myFirstP2d[0].SetCoord (su1, M_PI-Ang); + myLastP2d [0].SetCoord (su2, M_PI-Ang); + myP3d [1] = mySurf->Value (0., M_PI+Ang); + myFirstP2d[1].SetCoord (su2, M_PI+Ang); + myLastP2d [1].SetCoord (su1, M_PI+Ang); myFirstPar[0] = myFirstPar[1] = su1; myLastPar [0] = myLastPar [1] = su2; myUIsoDeg [0] = myUIsoDeg [1] = Standard_False; @@ -917,29 +917,29 @@ gp_Pnt2d ShapeAnalysis_Surface::ValueOfUV(const gp_Pnt& P3D,const Standard_Real { gp_Cylinder Cylinder = SurfAdapt.Cylinder(); ElSLib::Parameters( Cylinder, P3D, S, T); - S += ShapeAnalysis::AdjustByPeriod(S,0.5*(uf+ul),2*PI); + S += ShapeAnalysis::AdjustByPeriod(S,0.5*(uf+ul),2*M_PI); break; } case GeomAbs_Cone : { gp_Cone Cone = SurfAdapt.Cone(); ElSLib::Parameters( Cone, P3D, S, T); - S += ShapeAnalysis::AdjustByPeriod(S,0.5*(uf+ul),2*PI); + S += ShapeAnalysis::AdjustByPeriod(S,0.5*(uf+ul),2*M_PI); break; } case GeomAbs_Sphere : { gp_Sphere Sphere = SurfAdapt.Sphere(); ElSLib::Parameters( Sphere, P3D, S, T); - S += ShapeAnalysis::AdjustByPeriod(S,0.5*(uf+ul),2*PI); + S += ShapeAnalysis::AdjustByPeriod(S,0.5*(uf+ul),2*M_PI); break; } case GeomAbs_Torus : { gp_Torus Torus = SurfAdapt.Torus(); ElSLib::Parameters( Torus, P3D, S, T); - S += ShapeAnalysis::AdjustByPeriod(S,0.5*(uf+ul),2*PI); - T += ShapeAnalysis::AdjustByPeriod(T,0.5*(vf+vl),2*PI); + S += ShapeAnalysis::AdjustByPeriod(S,0.5*(uf+ul),2*M_PI); + T += ShapeAnalysis::AdjustByPeriod(T,0.5*(vf+vl),2*M_PI); break; } case GeomAbs_BezierSurface : diff --git a/src/ShapeAnalysis/ShapeAnalysis_Wire.cxx b/src/ShapeAnalysis/ShapeAnalysis_Wire.cxx index e823f82c1b..c62b08d048 100755 --- a/src/ShapeAnalysis/ShapeAnalysis_Wire.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_Wire.cxx @@ -1476,8 +1476,8 @@ Standard_Boolean ShapeAnalysis_Wire::CheckLacking (const Standard_Integer num, myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE1 ); if ( myMax2d < Precision::PConfusion() || //:abv 03.06.02 CTS21866.stp - ( v1.SquareMagnitude() > gp::Resolution() && Abs ( v12.Angle ( v1 ) ) > 0.9 * PI ) || - ( v2.SquareMagnitude() > gp::Resolution() && Abs ( v12.Angle ( v2 ) ) > 0.9 * PI ) ) + ( v1.SquareMagnitude() > gp::Resolution() && Abs ( v12.Angle ( v1 ) ) > 0.9 * M_PI ) || + ( v2.SquareMagnitude() > gp::Resolution() && Abs ( v12.Angle ( v2 ) ) > 0.9 * M_PI ) ) myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE2 ); return Standard_True; } diff --git a/src/ShapeCustom/ShapeCustom_BSplineRestriction.cxx b/src/ShapeCustom/ShapeCustom_BSplineRestriction.cxx index 20d0b1a63b..5777a1e16e 100755 --- a/src/ShapeCustom/ShapeCustom_BSplineRestriction.cxx +++ b/src/ShapeCustom/ShapeCustom_BSplineRestriction.cxx @@ -594,8 +594,8 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface(const Handle(Geo Abs(v1-VF) > Precision::PConfusion() || Abs(v2- VL) > Precision::PConfusion()) { /*if(aSurf->IsUPeriodic() ) { Standard_Real aDelta = (UL > UF ? UL - UF : UF - UL ); - u1 = (aDelta > 2.*PI ? 0. : UF + ShapeAnalysis::AdjustByPeriod(UF,0.5*(UL+UF),2*PI)); - u2 = (aDelta > 2.*PI ? 2.*PI : u1 + aDelta); + u1 = (aDelta > 2.*M_PI ? 0. : UF + ShapeAnalysis::AdjustByPeriod(UF,0.5*(UL+UF),2*M_PI)); + u2 = (aDelta > 2.*M_PI ? 2.*M_PI : u1 + aDelta); }*/ Standard_Boolean isTrim = Standard_False; if(!aSurf->IsUPeriodic() ) { //else { @@ -605,8 +605,8 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface(const Handle(Geo /*if(aSurf->IsVPeriodic()) { Standard_Real aDelta = (VL > VF ? VL - VF : VF - VL ); - v1 = (aDelta > 2.*PI ? 0. : VF + ShapeAnalysis::AdjustByPeriod(VF,0.5*(UL+UF),2*PI)); ; - v2 = (aDelta > 2.*PI ? 2.* PI : v1 + aDelta); + v1 = (aDelta > 2.*M_PI ? 0. : VF + ShapeAnalysis::AdjustByPeriod(VF,0.5*(UL+UF),2*M_PI)); ; + v2 = (aDelta > 2.*M_PI ? 2.* M_PI : v1 + aDelta); }*/ if(!aSurf->IsVPeriodic()) {//else v1 = Max(v1,VF); v2 = Min(v2,VL); diff --git a/src/ShapeCustom/ShapeCustom_ConvertToRevolution.cxx b/src/ShapeCustom/ShapeCustom_ConvertToRevolution.cxx index 47ee417efa..4b05524aad 100755 --- a/src/ShapeCustom/ShapeCustom_ConvertToRevolution.cxx +++ b/src/ShapeCustom/ShapeCustom_ConvertToRevolution.cxx @@ -93,7 +93,7 @@ Standard_Boolean ShapeCustom_ConvertToRevolution::NewSurface (const TopoDS_Face& Handle(Geom_SphericalSurface) SS = Handle(Geom_SphericalSurface)::DownCast(ES); gp_Ax2 Ax2 ( pos, X ^ dir, X ); Handle(Geom_Circle) Circ = new Geom_Circle ( Ax2, SS->Radius() ); - BasisCurve = new Geom_TrimmedCurve ( Circ, -PI/2., PI/2. ); + BasisCurve = new Geom_TrimmedCurve ( Circ, -M_PI/2., M_PI/2. ); } else if ( ES->IsKind(STANDARD_TYPE(Geom_ToroidalSurface)) ) { Handle(Geom_ToroidalSurface) TS = Handle(Geom_ToroidalSurface)::DownCast(ES); @@ -221,7 +221,7 @@ Standard_Boolean ShapeCustom_ConvertToRevolution::NewCurve2d (const TopoDS_Edge& // for spherical surface, surface of revolution since based on TrimmedCurve // has V parametrisation shifted on 2PI; translate pcurve accordingly if ( ! ES.IsNull() && ES->IsKind(STANDARD_TYPE(Geom_SphericalSurface)) ) { - gp_Vec2d shift ( 0., 2*PI ); + gp_Vec2d shift ( 0., 2*M_PI ); C->Translate ( shift ); } } diff --git a/src/ShapeFix/ShapeFix_ComposeShell.cxx b/src/ShapeFix/ShapeFix_ComposeShell.cxx index 5adcf9767d..2fc09cb523 100755 --- a/src/ShapeFix/ShapeFix_ComposeShell.cxx +++ b/src/ShapeFix/ShapeFix_ComposeShell.cxx @@ -1992,7 +1992,7 @@ void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires, Standard_Integer index = 0; Standard_Boolean misoriented = Standard_True, samepatch = Standard_False; Standard_Boolean reverse = Standard_False, connected = Standard_False; - Standard_Real angle = -PI, mindist = RealLast(); + Standard_Real angle = -M_PI, mindist = RealLast(); Standard_Integer weigth = 0; Standard_Real shiftu=0., shiftv=0.; @@ -2083,8 +2083,8 @@ void ShapeFix_ComposeShell::CollectWires (ShapeFix_SequenceOfWireSegment &wires, } // short segment is to be taken with highest priority by angle - Standard_Real ang = ( shorts(i) >0 ? PI : endTan.Angle ( lVec ) ); - if ( myClosedMode && shorts(i) <=0 && PI-ang < ::Precision::Angular() ) + Standard_Real ang = ( shorts(i) >0 ? M_PI : endTan.Angle ( lVec ) ); + if ( myClosedMode && shorts(i) <=0 && M_PI-ang < ::Precision::Angular() ) ang = 0.; // abv 21 Mar 00: trj3_s1-md-214.stp #2471: avoid going back // abv 05 Feb 02: face from Parasolid: use tolerance of edges for check // for coincidence (instead of vertex tolerance) in order diff --git a/src/ShapeFix/ShapeFix_Face.cxx b/src/ShapeFix/ShapeFix_Face.cxx index e79f769244..5cc19873f4 100755 --- a/src/ShapeFix/ShapeFix_Face.cxx +++ b/src/ShapeFix/ShapeFix_Face.cxx @@ -1442,14 +1442,14 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam() // this means that degenerated edge should be added to one of poles, and // then usual procedure applied if ( ismodeu && mySurf->Surface()->IsKind(STANDARD_TYPE(Geom_SphericalSurface)) ) { - gp_Pnt2d p ( ( ismodeu < 0 ? 0. : 2.*PI ), ismodeu * 0.5 * PI ); + gp_Pnt2d p ( ( ismodeu < 0 ? 0. : 2.*M_PI ), ismodeu * 0.5 * M_PI ); gp_Dir2d d ( -ismodeu, 0. ); Handle(Geom2d_Line) line = new Geom2d_Line ( p, d ); TopoDS_Edge edge; B.MakeEdge ( edge ); B.Degenerated ( edge, Standard_True ); B.UpdateEdge ( edge, line, myFace, ::Precision::Confusion() ); - B.Range ( edge, myFace, 0., 2*PI ); + B.Range ( edge, myFace, 0., 2*M_PI ); TopoDS_Vertex V; B.MakeVertex ( V, mySurf->Value ( p.X(), p.Y() ), ::Precision::Confusion() ); V.Orientation(TopAbs_FORWARD); diff --git a/src/ShapeFix/ShapeFix_Wire_1.cxx b/src/ShapeFix/ShapeFix_Wire_1.cxx index e91bf3a6a9..b3b91634b3 100755 --- a/src/ShapeFix/ShapeFix_Wire_1.cxx +++ b/src/ShapeFix/ShapeFix_Wire_1.cxx @@ -395,7 +395,7 @@ static Standard_Real AdjustOnPeriodic3d (const Handle(Geom_Curve)& c, if (c1->IsKind(STANDARD_TYPE(Geom_Circle)) || c1->IsKind(STANDARD_TYPE(Geom_Ellipse))) { - Standard_Real diff = PI - Abs(clast1-cfirst2)*0.5; + Standard_Real diff = M_PI - Abs(clast1-cfirst2)*0.5; first1 -= diff; last1 += diff; done1 = Standard_True; } @@ -422,7 +422,7 @@ static Standard_Real AdjustOnPeriodic3d (const Handle(Geom_Curve)& c, else if (c1->IsKind(STANDARD_TYPE(Geom_Circle)) || c1->IsKind(STANDARD_TYPE(Geom_Ellipse))) { - domfirst1 = 0.; domlast1 = 2*PI; + domfirst1 = 0.; domlast1 = 2*M_PI; } Standard_Real domfirst2 = first2, domlast2 = last2; if (c2->IsKind(STANDARD_TYPE(Geom_BSplineCurve)) || @@ -442,7 +442,7 @@ static Standard_Real AdjustOnPeriodic3d (const Handle(Geom_Curve)& c, else if (c2->IsKind(STANDARD_TYPE(Geom_Circle)) || c2->IsKind(STANDARD_TYPE(Geom_Ellipse))) { - domfirst2 = 0.; domlast2 = 2*PI; + domfirst2 = 0.; domlast2 = 2*M_PI; } Standard_Real ipar1 = clast1, ipar2 = cfirst2; @@ -979,7 +979,7 @@ static Standard_Real AdjustOnPeriodic2d (const Handle(Geom2d_Curve)& pc, if (pc1->IsKind(STANDARD_TYPE(Geom2d_Circle)) || pc1->IsKind(STANDARD_TYPE(Geom2d_Ellipse))) { - Standard_Real diff = PI - Abs(clast1-cfirst2)*0.5; + Standard_Real diff = M_PI - Abs(clast1-cfirst2)*0.5; first1 -= diff; last1 += diff; done1 = Standard_True; } @@ -1006,7 +1006,7 @@ static Standard_Real AdjustOnPeriodic2d (const Handle(Geom2d_Curve)& pc, else if (pc1->IsKind(STANDARD_TYPE(Geom2d_Circle)) || pc1->IsKind(STANDARD_TYPE(Geom2d_Ellipse))) { - domfirst1 = 0.; domlast1 = 2*PI; + domfirst1 = 0.; domlast1 = 2*M_PI; } Standard_Real domfirst2 = first2, domlast2 = last2; if (pc2->IsKind(STANDARD_TYPE(Geom2d_BSplineCurve)) || @@ -1026,7 +1026,7 @@ static Standard_Real AdjustOnPeriodic2d (const Handle(Geom2d_Curve)& pc, else if (pc2->IsKind(STANDARD_TYPE(Geom2d_Circle)) || pc2->IsKind(STANDARD_TYPE(Geom2d_Ellipse))) { - domfirst2 = 0.; domlast2 = 2*PI; + domfirst2 = 0.; domlast2 = 2*M_PI; } Standard_Real ipar1 = clast1, ipar2 = cfirst2; diff --git a/src/ShapeFix/ShapeFix_Wireframe.cxx b/src/ShapeFix/ShapeFix_Wireframe.cxx index 728aad6ed2..8f56d28d16 100755 --- a/src/ShapeFix/ShapeFix_Wireframe.cxx +++ b/src/ShapeFix/ShapeFix_Wireframe.cxx @@ -685,14 +685,14 @@ Standard_Boolean ShapeFix_Wireframe::MergeSmallEdges(TopTools_MapOfShape& theSma if ( edge2.Orientation() == TopAbs_REVERSED ) Vec2.Reverse(); Standard_Real tol2 = Precision::Confusion() * Precision::Confusion(); if ( Vec1.SquareMagnitude() < tol2 || - Vec2.SquareMagnitude() < tol2 ) Ang1 = PI/2.; + Vec2.SquareMagnitude() < tol2 ) Ang1 = M_PI/2.; else Ang1 = Abs(Vec1.Angle(Vec2)); C2->D1(last2,P,Vec1); C3->D1(first3,P,Vec2); if ( edge2.Orientation() == TopAbs_REVERSED ) Vec1.Reverse(); if ( edge3.Orientation() == TopAbs_REVERSED ) Vec2.Reverse(); if ( Vec1.SquareMagnitude() < tol2 || - Vec2.SquareMagnitude() < tol2 ) Ang2 = PI/2.; + Vec2.SquareMagnitude() < tol2 ) Ang2 = M_PI/2.; else Ang2 = Abs(Vec1.Angle(Vec2)); //isLimAngle = (theLimitAngle != -1 && Min(Ang1,Ang2) > theLimitAngle); //take_next = (Ang2D1(last2,P,Vec1); C3->D1(first3,P,Vec2); if ( edge2.Orientation() == TopAbs_REVERSED ) Vec1.Reverse(); if ( edge3.Orientation() == TopAbs_REVERSED ) Vec2.Reverse(); if ( Vec1.SquareMagnitude() < tol2 || - Vec2.SquareMagnitude() < tol2 ) Ang2 = PI/2.; + Vec2.SquareMagnitude() < tol2 ) Ang2 = M_PI/2.; else Ang2 = Abs(Vec1.Angle(Vec2)); //isLimAngle = (theLimitAngle != -1 && Min(Ang1,Ang2) > theLimitAngle); //take_next = (Ang2RealVal ( "Angle", 2*PI ), ctx->Result() ); + ShapeUpgrade_ShapeDivideAngle SDA ( ctx->RealVal ( "Angle", 2*M_PI ), ctx->Result() ); SDA.SetMaxTolerance ( ctx->RealVal ( "MaxTolerance", 1. ) ); if ( ! SDA.Perform() && SDA.Status (ShapeExtend_FAIL) ) { diff --git a/src/Standard/Standard_Real.cxx b/src/Standard/Standard_Real.cxx index c3f7a83310..a777a8de21 100755 --- a/src/Standard/Standard_Real.cxx +++ b/src/Standard/Standard_Real.cxx @@ -11,20 +11,6 @@ #include #endif -#if defined(WNT) && !defined(__CYGWIN32__) && !defined(__MINGW32__) -Standard_Real PI = 3.14159265358979324; -Standard_Real PI180 = 0.017453292519943296; - -Standard_Real Standard_PI = 3.14159265358979324; -Standard_Real Standard_PI180 = 0.017453292519943296; -#else -const Standard_Real PI = 3.14159265358979324; -const Standard_Real PI180 = 0.017453292519943296; - -const Standard_Real Standard_PI = 3.14159265358979324; -const Standard_Real Standard_PI180 = 0.017453292519943296; -#endif - Handle_Standard_Type& Standard_Real_Type_() { static Handle_Standard_Type _aType = @@ -93,7 +79,7 @@ Standard_Real ACosApprox (const Standard_Real Value) XX = 1.+Value; if (XX < RealSmall()) return 0.; - return PI - apx_for_ACosApprox(XX); + return M_PI - apx_for_ACosApprox(XX); } XX = 1.-Value; if (XX < RealSmall()) @@ -106,7 +92,7 @@ Standard_Real ACosApprox (const Standard_Real Value) // if (xp < RealSmall() || xn < RealSmall()) // return 0.; // if (Value < 0.) -// return PI - apx_for_ACosApprox (xn); +// return M_PI - apx_for_ACosApprox (xn); // return apx_for_ACosApprox (xp); } diff --git a/src/Standard/Standard_Real.hxx b/src/Standard/Standard_Real.hxx index 5e86efa4ff..cbda7ec408 100755 --- a/src/Standard/Standard_Real.hxx +++ b/src/Standard/Standard_Real.hxx @@ -19,24 +19,6 @@ class Handle_Standard_Type; __Standard_API Handle_Standard_Type& Standard_Real_Type_(); -//==== In this version "PI" is a global variables. -#ifdef PI -#undef PI -#endif - -#if defined(WNT) && !defined(__CYGWIN32__) && !defined(__MINGW32__) -extern "C" __Standard_API Standard_Real PI; -extern "C" __Standard_API Standard_Real PI180; -extern "C" __Standard_API Standard_Real Standard_PI; -extern "C" __Standard_API Standard_Real Standard_PI180; -#else - -extern const Standard_Real PI; -extern const Standard_Real PI180; - -extern const Standard_Real Standard_PI; -extern const Standard_Real Standard_PI180; -#endif /* WNT */ // =============================================== // Methods from Standard_Entity class which are redefined: // - Hascode diff --git a/src/Standard/Standard_math.hxx b/src/Standard/Standard_math.hxx index ba1629d877..b44dd261b8 100755 --- a/src/Standard/Standard_math.hxx +++ b/src/Standard/Standard_math.hxx @@ -29,9 +29,21 @@ __Standard_API double __cdecl acosh ( double ); __Standard_API double __cdecl asinh ( double ); __Standard_API double __cdecl atanh ( double ); -# define M_SQRT1_2 7.0710678118654752440E-1 +# ifdef M_SQRT1_2 +# undef M_SQRT1_2 +# endif +# define M_SQRT1_2 0.707106781186547524401 + +# ifdef M_PI_2 +# undef M_PI_2 +# endif # define M_PI_2 1.57079632679489661923 +# ifdef M_PI +# undef M_PI +# endif +# define M_PI 3.14159265358979323846 + # endif /* __MATH_WNT_H */ #endif /* WNT */ diff --git a/src/StdSelect/StdSelect_BRepSelectionTool.cxx b/src/StdSelect/StdSelect_BRepSelectionTool.cxx index 520fcf2a92..54fd5df33a 100755 --- a/src/StdSelect/StdSelect_BRepSelectionTool.cxx +++ b/src/StdSelect/StdSelect_BRepSelectionTool.cxx @@ -689,7 +689,7 @@ Standard_Boolean StdSelect_BRepSelectionTool } case GeomAbs_Circle: { - if (2 * PI - Abs (wl - wf) <= Precision::Confusion()) + if (2 * M_PI - Abs (wl - wf) <= Precision::Confusion()) { if (BS.GetType() == GeomAbs_Cylinder || BS.GetType() == GeomAbs_Torus || diff --git a/src/StepToGeom/StepToGeom_MakeSurfaceOfRevolution.cxx b/src/StepToGeom/StepToGeom_MakeSurfaceOfRevolution.cxx index d4ab62ae68..7cba36bf88 100755 --- a/src/StepToGeom/StepToGeom_MakeSurfaceOfRevolution.cxx +++ b/src/StepToGeom/StepToGeom_MakeSurfaceOfRevolution.cxx @@ -44,7 +44,7 @@ Standard_Boolean StepToGeom_MakeSurfaceOfRevolution::Convert (const Handle(StepG //change parametrization for trimming gp_Ax2 axnew(pc,norm,dirline.Reversed()); conic->SetPosition(axnew); - C = new Geom_TrimmedCurve(conic, 0., PI); + C = new Geom_TrimmedCurve(conic, 0., M_PI); } } } diff --git a/src/StepToGeom/StepToGeom_MakeTrimmedCurve.cxx b/src/StepToGeom/StepToGeom_MakeTrimmedCurve.cxx index edc831e684..0a7b6b45b7 100755 --- a/src/StepToGeom/StepToGeom_MakeTrimmedCurve.cxx +++ b/src/StepToGeom/StepToGeom_MakeTrimmedCurve.cxx @@ -185,12 +185,12 @@ Standard_Boolean StepToGeom_MakeTrimmedCurve::Convert (const Handle(StepGeom_Tri } else if (theSTEPCurve->IsKind(STANDARD_TYPE(StepGeom_Circle)) || theSTEPCurve->IsKind(STANDARD_TYPE(StepGeom_Ellipse))) { -// if (trim1 > 2.1*PI || trim2 > 2.1*PI) fact = PI / 180.; +// if (trim1 > 2.1*M_PI || trim2 > 2.1*M_PI) fact = M_PI / 180.; fact = UnitsMethods::PlaneAngleFactor(); //:p3 abv 23 Feb 99: shift on pi/2 on ellipse with R1 < R2 const Handle(StepGeom_Ellipse) ellipse = Handle(StepGeom_Ellipse)::DownCast(theSTEPCurve); if ( !ellipse.IsNull() && ellipse->SemiAxis1() - ellipse->SemiAxis2() < 0. ) - shift = 0.5 * PI; + shift = 0.5 * M_PI; // skl 04.02.2002 for OCC133: we can not make TrimmedCurve if // there is no X-direction in StepGeom_Axis2Placement3d @@ -207,9 +207,9 @@ Standard_Boolean StepToGeom_MakeTrimmedCurve::Convert (const Handle(StepGeom_Tri MasterRep =1; else { if ( SC->SenseAgreement() ) - CC = new Geom_TrimmedCurve(theCurve, 0., 2.*PI, Standard_True); + CC = new Geom_TrimmedCurve(theCurve, 0., 2.*M_PI, Standard_True); else - CC = new Geom_TrimmedCurve(theCurve, 2.*PI, 0., Standard_False); + CC = new Geom_TrimmedCurve(theCurve, 2.*M_PI, 0., Standard_False); return Standard_True; } } diff --git a/src/StepToGeom/StepToGeom_MakeTrimmedCurve2d.cxx b/src/StepToGeom/StepToGeom_MakeTrimmedCurve2d.cxx index 8fd3af5b70..51e4bbe180 100755 --- a/src/StepToGeom/StepToGeom_MakeTrimmedCurve2d.cxx +++ b/src/StepToGeom/StepToGeom_MakeTrimmedCurve2d.cxx @@ -62,12 +62,12 @@ Standard_Boolean StepToGeom_MakeTrimmedCurve2d::Convert (const Handle(StepGeom_T } else if (BasisCurve->IsKind(STANDARD_TYPE(StepGeom_Circle)) || BasisCurve->IsKind(STANDARD_TYPE(StepGeom_Ellipse))) { -// if (u1 > 2.1*PI || u2 > 2.1*PI) fact = PI / 180.; +// if (u1 > 2.1*M_PI || u2 > 2.1*M_PI) fact = M_PI / 180.; fact = UnitsMethods::PlaneAngleFactor(); //:p3 abv 23 Feb 99: shift on pi/2 on ellipse with R1 < R2 const Handle(StepGeom_Ellipse) ellipse = Handle(StepGeom_Ellipse)::DownCast(BasisCurve); if ( !ellipse.IsNull() && ellipse->SemiAxis1() - ellipse->SemiAxis2() < 0. ) - shift = 0.5 * PI; + shift = 0.5 * M_PI; } else if (BasisCurve->IsKind(STANDARD_TYPE(StepGeom_Parabola)) || BasisCurve->IsKind(STANDARD_TYPE(StepGeom_Hyperbola))) { diff --git a/src/StlTransfer/StlTransfer.cxx b/src/StlTransfer/StlTransfer.cxx index b974b66d1d..92d503abc2 100755 --- a/src/StlTransfer/StlTransfer.cxx +++ b/src/StlTransfer/StlTransfer.cxx @@ -160,7 +160,7 @@ void StlTransfer::BuildIncrementalMesh (const TopoDS_Shape& Shape, // vec.Transform(loc); if (modul1>Precision::Confusion () && modul2>Precision::Confusion ()) { Standard_Real an = vec.Angle(average); - if ( an > PI/2) { + if ( an > M_PI/2) { A = V3;B=V2;C=V1; } else { diff --git a/src/TopOpeBRep/TopOpeBRep_ShapeIntersector.cxx b/src/TopOpeBRep/TopOpeBRep_ShapeIntersector.cxx index 031bcacda1..a46397b7ae 100755 --- a/src/TopOpeBRep/TopOpeBRep_ShapeIntersector.cxx +++ b/src/TopOpeBRep/TopOpeBRep_ShapeIntersector.cxx @@ -1113,10 +1113,10 @@ static Standard_Integer OneShapeIsHalfSpace(const TopoDS_Shape& S1,const TopoDS_ Standard_Real maxU = FSurf.LastUParameter(); Standard_Real minV = FSurf.FirstVParameter(); Standard_Real maxV = FSurf.LastVParameter(); - Standard_Boolean yesU = ( Abs(minU - 0.) < 1.e-9 && Abs(maxU - 2*PI) < 1.e-9 ); + Standard_Boolean yesU = ( Abs(minU - 0.) < 1.e-9 && Abs(maxU - 2*M_PI) < 1.e-9 ); Standard_Boolean yesV = ( FSurf.GetType() == GeomAbs_Sphere ) ? - ( Abs(minV - (-PI/2.)) < 1.e-9 && Abs(maxV - PI/2.) < 1.e-9 ) : - ( Abs(minV - 0.) < 1.e-9 && Abs(maxV - 2*PI) < 1.e-9 ); + ( Abs(minV - (-M_PI/2.)) < 1.e-9 && Abs(maxV - M_PI/2.) < 1.e-9 ) : + ( Abs(minV - 0.) < 1.e-9 && Abs(maxV - 2*M_PI) < 1.e-9 ); SolidIsSphereOrTorus = ( yesU && yesV ); } @@ -1125,8 +1125,8 @@ static Standard_Integer OneShapeIsHalfSpace(const TopoDS_Shape& S1,const TopoDS_ Standard_Boolean areBothPeriodic = ( FSurf.IsUPeriodic() && FSurf.IsVPeriodic() ); if( areBothPeriodic ) { - Standard_Boolean yesU = ( Abs(FSurf.UPeriod() - PI) < 1.e-9 || Abs(FSurf.UPeriod() - 2*PI) < 1.e-9 ); - Standard_Boolean yesV = ( Abs(FSurf.VPeriod() - PI) < 1.e-9 || Abs(FSurf.VPeriod() - 2*PI) < 1.e-9 ); + Standard_Boolean yesU = ( Abs(FSurf.UPeriod() - M_PI) < 1.e-9 || Abs(FSurf.UPeriod() - 2*M_PI) < 1.e-9 ); + Standard_Boolean yesV = ( Abs(FSurf.VPeriod() - M_PI) < 1.e-9 || Abs(FSurf.VPeriod() - 2*M_PI) < 1.e-9 ); SolidIsSphereOrTorus = ( yesU && yesV ); } } diff --git a/src/TopOpeBRep/TopOpeBRep_vprdeg.cxx b/src/TopOpeBRep/TopOpeBRep_vprdeg.cxx index 8fe8db88cf..3f9b583f77 100755 --- a/src/TopOpeBRep/TopOpeBRep_vprdeg.cxx +++ b/src/TopOpeBRep/TopOpeBRep_vprdeg.cxx @@ -168,19 +168,19 @@ static Standard_Real FUN_getpar(const gp_Dir& a, const gp_Dir& x, const gp_Dir& Standard_Boolean x1null = (Abs(x1) <= tol); Standard_Boolean x2null = (Abs(x2) <= tol); - if (x1null) par = (x2 > 0.) ? 3.*PI*.5 : PI*.5; - else if (x2null) par = (x1 > 0.) ? 2.*PI : PI; + if (x1null) par = (x2 > 0.) ? 3.*M_PI*.5 : M_PI*.5; + else if (x2null) par = (x1 > 0.) ? 2.*M_PI : M_PI; else { Standard_Real ac = ACos(Abs(x1)); Standard_Boolean x1pos = (x1 > tol); Standard_Boolean x2pos = (x2 > tol); - if (x1pos && x2pos) par = 2.*PI-ac; + if (x1pos && x2pos) par = 2.*M_PI-ac; if (x1pos && !x2pos) par = ac; - if (!x1pos && x2pos) par = PI+ac; - if (!x1pos && !x2pos) par = PI-ac; + if (!x1pos && x2pos) par = M_PI+ac; + if (!x1pos && !x2pos) par = M_PI-ac; } - if (complement) par = 2.*PI - par; + if (complement) par = 2.*M_PI - par; return par; } @@ -418,9 +418,9 @@ static Standard_Boolean FUN_0or2PI(Standard_Real& paronEd, const Standard_Boolea { Standard_Real tol = Precision::Parametric(Precision::Confusion()); Standard_Boolean extre = (Abs(paronEd) < tol); - extre = extre && (Abs(2.*PI-paronEd) < tol); + extre = extre && (Abs(2.*M_PI-paronEd) < tol); if (!extre) return Standard_False; - paronEd = (inout) ? 2.*PI : 0.; + paronEd = (inout) ? 2.*M_PI : 0.; return Standard_True; } @@ -501,7 +501,7 @@ static Standard_Integer FUN_parondgEINFi(const TopOpeBRep_VPointInter& VP, Standard_Real par = FUN_getpar(a,x,y,complement); par1OnEd = par; - par2OnEd = (par > PI) ? par-PI : par+PI; + par2OnEd = (par > M_PI) ? par-M_PI : par+M_PI; // kpart Ec on Fi : Standard_Boolean changedpar1 = FUN_0or2PI(par1OnEd,T1inout); diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_Builder1.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_Builder1.cxx index aca1bcadae..1059e2623b 100755 --- a/src/TopOpeBRepBuild/TopOpeBRepBuild_Builder1.cxx +++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_Builder1.cxx @@ -1814,10 +1814,10 @@ Standard_Integer TopOpeBRepBuild_Builder1::IsSame2d (const TopTools_SequenceOfSh Standard_Boolean IsTrFirst = Standard_True; if(parOri < f ) { - parOri = 2*PI + parOri; + parOri = 2*M_PI + parOri; } if(parOri > l ) { - parOri = parOri - 2*PI; + parOri = parOri - 2*M_PI; } gp_Pnt2d aUV2; diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_BuilderON.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_BuilderON.cxx index 5defc9eb9b..f2f348a331 100755 --- a/src/TopOpeBRepBuild/TopOpeBRepBuild_BuilderON.cxx +++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_BuilderON.cxx @@ -1548,12 +1548,12 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter if (!ok2) return; Standard_Real sum = matfs+matfor; - Standard_Boolean sumisPI = (Abs(sum-PI) < tola1); - Standard_Boolean fsinfPI = (matfs < PI); - Standard_Boolean forinfPI = (matfor < PI); + Standard_Boolean sumisPI = (Abs(sum-M_PI) < tola1); + Standard_Boolean fsinfPI = (matfs < M_PI); + Standard_Boolean forinfPI = (matfor < M_PI); if (sumisPI) b = Standard_False; - else if (sum < PI) b = Standard_True; - else { //sum > PI + else if (sum < M_PI) b = Standard_True; + else { //sum > M_PI if (fsinfPI && forinfPI) b = Standard_False; else { // (!fsinfPI) || (!forinfPI) Standard_Boolean sammat = (Abs(matfs-matfor) 1e-7 && (2*PI - dU > 1e-7)) ? Standard_True : Standard_False; + Standard_Real dU = fmod(fabs(U), 2*M_PI); + nonPU = (dU > 1e-7 && (2*M_PI - dU > 1e-7)) ? Standard_True : Standard_False; } if(!nonPV && VP) { - Standard_Real dV = fmod(fabs(V), 2*PI); - nonPV = (dV > 1e-7 && (2*PI - dV > 1e-7)) ? Standard_True : Standard_False; + Standard_Real dV = fmod(fabs(V), 2*M_PI); + nonPV = (dV > 1e-7 && (2*M_PI - dV > 1e-7)) ? Standard_True : Standard_False; } -// printf("(fmod(fabs(U), 2*PI) =%lf\n", (fmod(fabs(U), 2*PI))); -// printf(" (fmod(fabs(V), 2*PI) > 1e-7)=%lf\n", (fmod(fabs(V), 2*PI))); +// printf("(fmod(fabs(U), 2*M_PI) =%lf\n", (fmod(fabs(U), 2*M_PI))); +// printf(" (fmod(fabs(V), 2*M_PI) > 1e-7)=%lf\n", (fmod(fabs(V), 2*M_PI))); if(nonPU && nonPV && !BRep_Tool::Degenerated(anEdge)) return 1; @@ -904,7 +904,7 @@ Standard_Integer b, k; gp_Vec2d aTrV; - TwoPI=2.*PI; + TwoPI=2.*M_PI; BndBoxWire(anOuterWire, B2dOuterWire); B2dOuterWire.Get(OuterU1,OuterV1,OuterU2,OuterV2); diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_CurveTool.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_CurveTool.cxx index ae3888810d..f8bd81f523 100755 --- a/src/TopOpeBRepTool/TopOpeBRepTool_CurveTool.cxx +++ b/src/TopOpeBRepTool/TopOpeBRepTool_CurveTool.cxx @@ -908,14 +908,14 @@ Handle(Geom2d_Curve) TopOpeBRepTool_CurveTool::MakePCurveOnFace Handle(Geom2d_Curve) PCT = Handle(Geom2d_Curve)::DownCast(C2D->Copy()); // make mirror relative to the isoline of apex -PI/2 or PI/2 gp_Trsf2d aTrsf; - gp_Pnt2d po(0,-PI/2); - if (maxcond) po.SetY(PI/2); + gp_Pnt2d po(0,-M_PI/2); + if (maxcond) po.SetY(M_PI/2); aTrsf.SetMirror(gp_Ax2d(po, gp_Dir2d(1,0))); PCT->Transform(aTrsf); // add translation along U direction on PI - gp_Vec2d vec(PI,0); + gp_Vec2d vec(M_PI,0); Standard_Real UFirst = BAS.FirstUParameter(); - if (u2-UFirst-PI > -1e-7) vec.Reverse(); + if (u2-UFirst-M_PI > -1e-7) vec.Reverse(); PCT->Translate(vec); C2D = PCT; // recompute the test point diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_GEOMETRY.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_GEOMETRY.cxx index 02298d6788..d7d5278455 100755 --- a/src/TopOpeBRepTool/TopOpeBRepTool_GEOMETRY.cxx +++ b/src/TopOpeBRepTool/TopOpeBRepTool_GEOMETRY.cxx @@ -78,7 +78,7 @@ Standard_EXPORT Standard_Boolean FUN_tool_onapex(const gp_Pnt2d& p2d,const Handl isapex = (dist < tol); } if (ST == GeomAbs_Sphere) { - Standard_Real pisur2 = PI*.5; + Standard_Real pisur2 = M_PI*.5; #ifdef DEB Standard_Real u = #endif @@ -134,8 +134,8 @@ Standard_EXPORT gp_Dir FUN_tool_ngS(const gp_Pnt2d& p2d,const Handle(Geom_Surfac } } if (ST == GeomAbs_Sphere) { -// Standard_Real deuxpi = 2*PI; - Standard_Real pisur2 = PI*.5; +// Standard_Real deuxpi = 2*M_PI; + Standard_Real pisur2 = M_PI*.5; Standard_Real u = p2d.X(),v = p2d.Y(); // Standard_Boolean u0 =(Abs(u) < toluv); // Standard_Boolean u2pi=(Abs(u-deuxpi) < toluv); diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_PURGE.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_PURGE.cxx index 13fa5083ba..ca817bc289 100755 --- a/src/TopOpeBRepTool/TopOpeBRepTool_PURGE.cxx +++ b/src/TopOpeBRepTool/TopOpeBRepTool_PURGE.cxx @@ -315,7 +315,7 @@ Standard_Boolean TopOpeBRepTool::PurgeClosingEdges(const TopoDS_Face& Fin, const Standard_Boolean uviso = FUN_tool_IsUViso(PC,isuiso,isviso,d2d,O2d); if (!uviso) return Standard_False; - Standard_Real period = 2*PI; + Standard_Real period = 2*M_PI; Standard_Real piso = isuiso? O2d.X(): O2d.Y(); Standard_Real tol2d = 1.e-6; Standard_Boolean is0 = Abs(piso) < tol2d; diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_REGUW.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_REGUW.cxx index 9502935aaf..9328d5724e 100755 --- a/src/TopOpeBRepTool/TopOpeBRepTool_REGUW.cxx +++ b/src/TopOpeBRepTool/TopOpeBRepTool_REGUW.cxx @@ -542,7 +542,7 @@ Standard_Boolean TopOpeBRepTool_REGUW::NearestE(const TopTools_ListOfShape& loe, if (M_REVERSED(efound.Orientation())) tg2dfound.Reverse(); Standard_Real angfound = 1.e7; if (iStep == 1) angfound = TopOpeBRepTool_TOOL::Matter(mytg2d,tg2dfound); - else angfound = 2.*PI - TopOpeBRepTool_TOOL::Matter(tg2dfound,mytg2d); + else angfound = 2.*M_PI - TopOpeBRepTool_TOOL::Matter(tg2dfound,mytg2d); #ifdef DEB if (trc) cout<<"ang(e"<= M_PI ,"V3d_Camera::SetAperture, bad angle"); MyAperture = Angle ; } @@ -200,7 +200,7 @@ void V3d_Camera::Symbol (const Handle(Graphic3d_Group)& gsymbol, Standard_Real Xc1,Yc1,Zc1,Xc2,Yc2,Zc2,Xi,Yi,Zi,Xj,Yj,Zj; Standard_Real Xn,Yn,Zn,X,Y,Z,Norme; Standard_Real cosinus,sinus; - Standard_Real Alpha = Standard_PI/4.; + Standard_Real Alpha = M_PI / 4.; Standard_Integer NbPoints = 4, i; Graphic3d_Array1OfVertex VN1(1,NbPoints+1); Graphic3d_Array1OfVertex VN2(1,NbPoints+1); @@ -236,8 +236,8 @@ void V3d_Camera::Symbol (const Handle(Graphic3d_Group)& gsymbol, // Scheme of the case for (i = 1 ; i <= NbPoints ; i++) { - cosinus = Cos ( Alpha + (i - 1) * Standard_PI/2. ); - sinus = Sin ( Alpha + (i - 1) * Standard_PI/2. ); + cosinus = Cos ( Alpha + (i - 1) * M_PI / 2. ); + sinus = Sin ( Alpha + (i - 1) * M_PI/2. ); // First base square X = Xc1 + (cosinus * Xi + sinus * Xj) * Lng / 2.; @@ -263,8 +263,8 @@ void V3d_Camera::Symbol (const Handle(Graphic3d_Group)& gsymbol, // Scheme of the objective for (i = 1 ; i <= NbPoints ; i++) { - cosinus = Cos ( Alpha + (i - 1) * Standard_PI/2. ); - sinus = Sin ( Alpha + (i - 1) * Standard_PI/2. ); + cosinus = Cos ( Alpha + (i - 1) * M_PI / 2. ); + sinus = Sin ( Alpha + (i - 1) * M_PI / 2. ); // Premier carre de base X = Xc2 + (cosinus * Xi + sinus * Xj) * Lng / 6.; @@ -387,8 +387,8 @@ void V3d_Camera::Display( const Handle(V3d_View)& aView, gnopick->Polyline(PRadius); V3d::ArrowOfRadius(gExtArrow,X-(X-X0)/10., Y-(Y-Y0)/10., - Z-(Z-Z0)/10.,X-X0,Y-Y0,Z-Z0,Standard_PI/15.,Rayon/20.); - V3d::ArrowOfRadius(gIntArrow,X0,Y0,Z0,X0-X,Y0-Y,Z0-Z,Standard_PI/15., + Z-(Z-Z0)/10., X-X0, Y-Y0, Z-Z0, M_PI / 15., Rayon / 20.); + V3d::ArrowOfRadius(gIntArrow, X0, Y0, Z0, X0-X, Y0-Y, Z0-Z, M_PI / 15., Rayon/20.); TCollection_AsciiString ValOfRadius(Rayon); PText.SetCoord( (X0+X)/2., (Y0+Y)/2. , (Z0+Z)/2. ); @@ -643,7 +643,7 @@ void V3d_Camera::AerialPilot( const Handle(V3d_View)& aView, if ( Ypix != IPY ) { aView->Size(Width,Height); IHeight = aView->Convert(Height); - Beta = ((IPY - Ypix)*Standard_PI)/(IHeight*2.); + Beta = ((IPY - Ypix) * M_PI) / (IHeight * 2.); aView->Proj(VX,VY,VZ); aView->Up(DXH,DYH,DZH); A = VY*DZH - VZ*DYH; @@ -676,7 +676,7 @@ void V3d_Camera::AerialPilot( const Handle(V3d_View)& aView, // Find the rolling determined by Xpix if ( Xpix != IPX ) { IWidth = aView->Convert(Width); - Beta = ((IPX - Xpix)*Standard_PI)/(IWidth*2.); + Beta = ((IPX - Xpix) * M_PI) / (IWidth * 2.); MyAngle = MyAngle + Beta; } } @@ -706,7 +706,7 @@ void V3d_Camera::EarthPilot( const Handle(V3d_View)& aView, if ( Ypix != IPY ) { aView->Size(Width,Height); IHeight = aView->Convert(Height); - Beta = ((IPY - Ypix)*Standard_PI)/(IHeight*2.); + Beta = ((IPY - Ypix) * M_PI) / (IHeight * 2.); aView->Proj(VX,VY,VZ); aView->Up(DXH,DYH,DZH); A = VY*DZH - VZ*DYH; @@ -739,7 +739,7 @@ void V3d_Camera::EarthPilot( const Handle(V3d_View)& aView, // an axis // a vector above passing through the eye if ( Xpix != IPX ) { IWidth = aView->Convert(Width); - Beta = ((IPX - Xpix)*Standard_PI)/(IWidth*2.); + Beta = ((IPX - Xpix) * M_PI) / (IWidth * 2.); aView->Up(A,B,C); Dist = Sqrt( A*A + B*B + C*C); A = A/Dist; B = B/Dist; C = C/Dist; diff --git a/src/V3d/V3d_CircularGrid.cxx b/src/V3d/V3d_CircularGrid.cxx index 9a272817a7..7542888181 100755 --- a/src/V3d/V3d_CircularGrid.cxx +++ b/src/V3d/V3d_CircularGrid.cxx @@ -240,7 +240,7 @@ Handle(Graphic3d_AspectLine3d) LineAttrib = new Graphic3d_AspectLine3d (); Standard_Real r; Standard_Real aStep = RadiusStep (); Standard_Real aDivision = DivisionNumber (); -Standard_Real alpha = Standard_PI / aDivision; +Standard_Real alpha = M_PI / aDivision; Standard_Integer Division = (Standard_Integer )( (aDivision >= DIVISION ? aDivision : DIVISION)); Graphic3d_Array1OfVertex Cercle (0, 2*Division); @@ -302,7 +302,7 @@ Standard_Boolean MakeCercles = Standard_False; myGroup2->SetGroupPrimitivesAspect (LineAttrib); #endif myGroup2->BeginPrimitives (); - alpha = Standard_PI / Division; + alpha = M_PI / Division; for (r=aStep; r<=myRadius; r+=aStep) { for (i=0; i<=2*Division; i++) { xl = Cos (alpha*i)*r; @@ -341,7 +341,7 @@ Handle(Graphic3d_AspectMarker3d) MarkerAttrib = new Graphic3d_AspectMarker3d (); Standard_Real r; Standard_Real aStep = RadiusStep (); Standard_Real aDivision = DivisionNumber (); -Standard_Real alpha = Standard_PI / aDivision; +Standard_Real alpha = M_PI / aDivision; Graphic3d_Array1OfVertex Cercle (0,(Standard_Integer )(2*aDivision)); Standard_Real xl, yl, zl = myOffSet; diff --git a/src/V3d/V3d_DirectionalLight.cxx b/src/V3d/V3d_DirectionalLight.cxx index 7b6d33f880..f1b3acda4d 100755 --- a/src/V3d/V3d_DirectionalLight.cxx +++ b/src/V3d/V3d_DirectionalLight.cxx @@ -147,7 +147,7 @@ void V3d_DirectionalLight::Symbol (const Handle(Graphic3d_Group)& gsymbol, const // A sphere is drawn V3d::CircleInPlane(gsymbol,Xi,Yi,Zi,VX,VY,VZ,Rayon/40.); for( j=1 ; j<=3 ; j++ ) { - Beta = j * Standard_PI/4.; + Beta = j * M_PI / 4.; CosBeta = Cos(Beta); SinBeta = Sin(Beta); Coef = 1. - CosBeta; @@ -178,7 +178,7 @@ void V3d_DirectionalLight::Symbol (const Handle(Graphic3d_Group)& gsymbol, const Line(0).SetCoord(Xi,Yi,Zi); Line(1).SetCoord(X,Y,Z); gsymbol->Polyline(Line); - V3d::ArrowOfRadius(gsymbol,X,Y,Z,DX,DY,DZ,Standard_PI/15.,Rayon/20.); + V3d::ArrowOfRadius(gsymbol, X, Y, Z, DX, DY, DZ, M_PI / 15., Rayon / 20.); } void V3d_DirectionalLight::Display( const Handle(V3d_View)& aView, diff --git a/src/V3d/V3d_PerspectiveView.cxx b/src/V3d/V3d_PerspectiveView.cxx index 906b4b1901..46adfbee6a 100755 --- a/src/V3d/V3d_PerspectiveView.cxx +++ b/src/V3d/V3d_PerspectiveView.cxx @@ -64,7 +64,7 @@ void V3d_PerspectiveView::SetAngle(const Standard_Real Angle) { Standard_Real focale,Umin,Vmin,Umax,Vmax,Dxv,Dyv,Rap,Xrp,Yrp; - Viewer_BadValue_Raise_if ( Angle <= 0. || Angle >= Standard_PI, "V3d_PerspectiveView::SetAngle, bad angle"); + Viewer_BadValue_Raise_if ( Angle <= 0. || Angle >= M_PI, "V3d_PerspectiveView::SetAngle, bad angle"); MyViewMapping.WindowLimit(Umin,Vmin,Umax,Vmax) ; Dxv = Abs(Umax - Umin)/2. ; Dyv = Abs(Vmax - Vmin)/2.; @@ -89,7 +89,7 @@ Standard_Real V3d_PerspectiveView::Angle()const { // Graphic3d_Vertex Prp ; Standard_Real focale,Umin,Vmin,Umax,Vmax,Dxv,Dyv ; - Standard_Real angle = Standard_PI ; + Standard_Real angle = M_PI ; MyViewMapping.WindowLimit(Umin,Vmin,Umax,Vmax) ; focale = Focale() ; @@ -111,7 +111,7 @@ void V3d_PerspectiveView::SetPerspective(const Standard_Real Angle, const Standa Standard_Real Umin,Vmin,Umax,Vmax,Xrp,Yrp,Zrp,du,dv; Viewer_BadValue_Raise_if ( ZNear <= 0. || ZFar <= 0. || ZNear >= ZFar, "V3d_PerspectiveView::SetPerspective, bad distances"); - Viewer_BadValue_Raise_if ( Angle <= 0. || Angle >= Standard_PI, "V3d_PerspectiveView::SetAngle, bad angle"); + Viewer_BadValue_Raise_if ( Angle <= 0. || Angle >= M_PI, "V3d_PerspectiveView::SetAngle, bad angle"); Graphic3d_Vertex PRP = MyViewMapping.ProjectionReferencePoint() ; Xrp = Yrp = Zrp = 0.; diff --git a/src/V3d/V3d_PositionLight.cxx b/src/V3d/V3d_PositionLight.cxx index 8100b83997..4187c9fe0c 100755 --- a/src/V3d/V3d_PositionLight.cxx +++ b/src/V3d/V3d_PositionLight.cxx @@ -217,8 +217,8 @@ void V3d_PositionLight::Display( const Handle(V3d_View)& aView, gnopick->Polyline(PRadius); V3d::ArrowOfRadius(gExtArrow,X-(X-X0)/10., Y-(Y-Y0)/10., - Z-(Z-Z0)/10.,X-X0,Y-Y0,Z-Z0,PI/15.,Rayon/20.); - V3d::ArrowOfRadius(gIntArrow,X0,Y0,Z0,X0-X,Y0-Y,Z0-Z,PI/15.,Rayon/20.); + Z-(Z-Z0)/10.,X-X0,Y-Y0,Z-Z0,M_PI/15.,Rayon/20.); + V3d::ArrowOfRadius(gIntArrow,X0,Y0,Z0,X0-X,Y0-Y,Z0-Z,M_PI/15.,Rayon/20.); TCollection_AsciiString ValOfRadius(Rayon); PText.SetCoord( (X0+X)/2., (Y0+Y)/2. , (Z0+Z)/2. ); gradius->Text(ValOfRadius.ToCString(),PText,0.01); diff --git a/src/V3d/V3d_PositionalLight.cxx b/src/V3d/V3d_PositionalLight.cxx index fabfc17f3b..3c1394e5d7 100755 --- a/src/V3d/V3d_PositionalLight.cxx +++ b/src/V3d/V3d_PositionalLight.cxx @@ -141,7 +141,7 @@ void V3d_PositionalLight::Symbol (const Handle(Graphic3d_Group)& gsymbol, const // A sphere is drawn V3d::CircleInPlane(gsymbol,Xi,Yi,Zi,VX,VY,VZ,Rayon/40.); for( j=1 ; j<=3 ; j++ ) { - Beta = j * Standard_PI/4.; + Beta = j * M_PI / 4.; CosBeta = Cos(Beta); SinBeta = Sin(Beta); Coef = 1. - CosBeta; @@ -253,8 +253,8 @@ void V3d_PositionalLight::Display( const Handle(V3d_View)& aView, gnopick->Polyline(PRadius); V3d::ArrowOfRadius(gExtArrow,X-(X-X0)/10., Y-(Y-Y0)/10., - Z-(Z-Z0)/10.,X-X0,Y-Y0,Z-Z0,Standard_PI/15.,Rayon/20.); - V3d::ArrowOfRadius(gIntArrow,X0,Y0,Z0,X0-X,Y0-Y,Z0-Z,Standard_PI/15.,Rayon/20.); + Z-(Z-Z0) / 10., X-X0, Y-Y0, Z-Z0, M_PI / 15., Rayon / 20.); + V3d::ArrowOfRadius(gIntArrow, X0, Y0, Z0, X0-X, Y0-Y, Z0-Z, M_PI / 15., Rayon / 20.); TCollection_AsciiString ValOfRadius(Rayon); PText.SetCoord( (X0+X)/2., (Y0+Y)/2. , (Z0+Z)/2. ); gradius->Text(ValOfRadius.ToCString(),PText,0.01); diff --git a/src/V3d/V3d_SpotLight.cxx b/src/V3d/V3d_SpotLight.cxx index 7201213192..e621fd430c 100755 --- a/src/V3d/V3d_SpotLight.cxx +++ b/src/V3d/V3d_SpotLight.cxx @@ -51,7 +51,7 @@ V3d_SpotLight::V3d_SpotLight(const Handle(V3d_Viewer)& VM, const Standard_Real X, const Standard_Real Y, const Standard_Real Z, const V3d_TypeOfOrientation Direction, const Quantity_NameOfColor Name, const Standard_Real A1, const Standard_Real A2, const Standard_Real CN, const Standard_Real AN):V3d_PositionLight(VM) { Viewer_BadValue_Raise_if( A1 < 0 || A1 > 1. || A2 < 0 || A2 > 1 - || AN < 0. || AN > PI, "V3d_SpotLight, bad coefficient or angle"); + || AN < 0. || AN > M_PI, "V3d_SpotLight, bad coefficient or angle"); Quantity_Color C(Name) ; Graphic3d_Vector D = V3d::GetProjAxis(Direction) ; @@ -68,7 +68,7 @@ V3d_SpotLight::V3d_SpotLight(const Handle(V3d_Viewer)& VM, const Standard_Real X V3d_SpotLight::V3d_SpotLight(const Handle(V3d_Viewer)& VM, const Standard_Real Xt, const Standard_Real Yt, const Standard_Real Zt, const Standard_Real Xp, const Standard_Real Yp, const Standard_Real Zp, const Quantity_NameOfColor Name, const Standard_Real A1, const Standard_Real A2, const Standard_Real CN, const Standard_Real AN):V3d_PositionLight(VM) { Viewer_BadValue_Raise_if( A1 < 0 || A1 > 1. || A2 < 0 || A2 > 1 - || AN < 0. || AN > PI, "V3d_SpotLight, bad coefficient or angle"); + || AN < 0. || AN > M_PI, "V3d_SpotLight, bad coefficient or angle"); Quantity_Color C(Name) ; Graphic3d_Vertex T(Xt,Yt,Zt) ; @@ -122,7 +122,7 @@ void V3d_SpotLight::SetConcentration(const Standard_Real C) { void V3d_SpotLight::SetAngle(const Standard_Real Angle) { - Viewer_BadValue_Raise_if( Angle <= 0. || Angle >= PI, + Viewer_BadValue_Raise_if( Angle <= 0. || Angle >= M_PI, "V3d_SpotLight::SetAngle, bad angle"); MyLight->SetAngle(Angle) ; @@ -191,7 +191,7 @@ void V3d_SpotLight::Symbol (const Handle(Graphic3d_Group)& gsymbol, this->Position(X,Y,Z); this->Direction(DX,DY,DZ); Rayon = this->Radius(); - V3d::ArrowOfRadius(gsymbol,X,Y,Z,-DX,-DY,-DZ,PI/8.,Rayon/15.); + V3d::ArrowOfRadius(gsymbol,X,Y,Z,-DX,-DY,-DZ,M_PI/8.,Rayon/15.); } void V3d_SpotLight::Display( const Handle(V3d_View)& aView, @@ -280,8 +280,8 @@ void V3d_SpotLight::Display( const Handle(V3d_View)& aView, gnopick->Polyline(PRadius); V3d::ArrowOfRadius(gExtArrow,X-(X-X0)/10., Y-(Y-Y0)/10., - Z-(Z-Z0)/10.,X-X0,Y-Y0,Z-Z0,Standard_PI/15.,Rayon/20.); - V3d::ArrowOfRadius(gIntArrow,X0,Y0,Z0,X0-X,Y0-Y,Z0-Z,Standard_PI/15.,Rayon/20.); + Z-(Z-Z0) / 10., X-X0, Y-Y0, Z-Z0, M_PI / 15., Rayon / 20.); + V3d::ArrowOfRadius(gIntArrow, X0, Y0, Z0, X0-X, Y0-Y, Z0-Z, M_PI / 15., Rayon / 20.); TCollection_AsciiString ValOfRadius(Rayon); PText.SetCoord( (X0+X)/2., (Y0+Y)/2. , (Z0+Z)/2. ); gradius->Text(ValOfRadius.ToCString(),PText,0.01); diff --git a/src/V3d/V3d_View.cxx b/src/V3d/V3d_View.cxx index 5ceacc9f69..8798e4c020 100755 --- a/src/V3d/V3d_View.cxx +++ b/src/V3d/V3d_View.cxx @@ -187,7 +187,7 @@ static OSD_Timer FullTimer; */ #define Zmargin 1. -#define DEUXPI (2.*Standard_PI) +#define DEUXPI (2. * M_PI) // in case of NO_TRACE_ECHO and NO_TRACE_POINTS, in V3d_View_4.cxx and in // V3d_View.cxx, change MyGridEchoStructure and MyGridEchoGroup in cdl @@ -2560,8 +2560,8 @@ Standard_Real V3d_View::Twist()const { if( angle > 1. ) angle = 1. ; else if( angle < -1. ) angle = -1. ; angle = asin(angle) ; - if( sca < 0. ) angle = Standard_PI - angle ; - if( angle > 0. && angle < Standard_PI ) { + if( sca < 0. ) angle = M_PI - angle ; + if( angle > 0. && angle < M_PI ) { sca = pvx*Xpn + pvy*Ypn + pvz*Zpn ; if( sca < 0. ) angle = DEUXPI - angle ; } @@ -3134,13 +3134,13 @@ void V3d_View::Rotation(const Standard_Integer X, dz = atan2(Standard_Real(X)-rx/2., ry/2.-Standard_Real(Y)) - atan2(sx-rx/2.,ry/2.-sy); } else { - dx = (Standard_Real(X) - sx) * Standard_PI/rx; - dy = (sy - Standard_Real(Y)) * Standard_PI/ry; + dx = (Standard_Real(X) - sx) * M_PI / rx; + dy = (sy - Standard_Real(Y)) * M_PI / ry; } Rotate(dx, dy, dz, gx, gy, gz, Standard_False); #else - Standard_Real dx = (Standard_Real(X - sx)) * Standard_PI; - Standard_Real dy = (Standard_Real(sy - Y)) * Standard_PI; + Standard_Real dx = (Standard_Real(X - sx)) * M_PI; + Standard_Real dy = (Standard_Real(sy - Y)) * M_PI; Rotate(dx/rx, dy/ry, 0., gx, gy, gz, Standard_False); #endif #ifdef IMP020300 diff --git a/src/V3d/V3d_View_4.cxx b/src/V3d/V3d_View_4.cxx index 48d0108652..486acb4478 100755 --- a/src/V3d/V3d_View_4.cxx +++ b/src/V3d/V3d_View_4.cxx @@ -50,7 +50,7 @@ #define NO_TRACE_POINTS #define MYEPSILON1 0.0001 // Comparison with 0.0 -#define MYEPSILON2 Standard_PI / 180. // Delta between 2 angles +#define MYEPSILON2 M_PI / 180. // Delta between 2 angles #ifdef TRACE_POINTS #include @@ -230,7 +230,7 @@ gp_Dir GPN (X2, Y2, Z2); // Casw when the plane of the grid and the plane of the view // are perpendicular to MYEPSILON2 close radians - if (Abs (VPN.Angle (GPN) - Standard_PI / 2.) < MYEPSILON2) { + if (Abs (VPN.Angle (GPN) - M_PI / 2.) < MYEPSILON2) { NewPoint.SetCoord (X1, Y1, Z1); #ifdef TRACE_POINTS TextAttrib->SetColor (Quantity_Color (Quantity_NOC_RED)); @@ -378,7 +378,7 @@ Handle(Aspect_CircularGrid) theGrid = *(Handle(Aspect_CircularGrid) *) &MyGrid; RS = theGrid->RadiusStep (); DN = theGrid->DivisionNumber (); - Alpha = Standard_PI / Standard_Real (DN); + Alpha = M_PI / Standard_Real (DN); Standard_Real DistOP = Sqrt (XPp*XPp + YPp*YPp); @@ -386,7 +386,7 @@ Standard_Integer i, ICur=0; Standard_Real Angle, AngleCur; Standard_Real XCurp=0, YCurp=0; gp_Dir2d OP (XPp, YPp); - AngleCur = 2 * Standard_PI; + AngleCur = 2 * M_PI; for (i=1; i<=DN*2; i++) { X1 = XO + Cos (Alpha * i) * RS, Y1 = YO + Sin (Alpha * i) * RS, diff --git a/src/V3d/V3d_Viewer.cxx b/src/V3d/V3d_Viewer.cxx index 42318edc10..ea76711aa8 100755 --- a/src/V3d/V3d_Viewer.cxx +++ b/src/V3d/V3d_Viewer.cxx @@ -74,7 +74,7 @@ myDisplayPlaneLength(ViewSize) SetDefaultVisualization(Visualization) ; SetDefaultShadingModel(ShadingModel) ; SetDefaultSurfaceDetail(SurfaceDetail) ; - SetDefaultAngle(Standard_PI/2.); + SetDefaultAngle(M_PI / 2.); SetDefaultTypeOfView(V3d_ORTHOGRAPHIC); Quantity_Color Color1 (Quantity_NOC_GRAY50); diff --git a/src/Viewer2dTest/Viewer2dTest.cxx b/src/Viewer2dTest/Viewer2dTest.cxx index cd5b8c9344..d02427dc55 100755 --- a/src/Viewer2dTest/Viewer2dTest.cxx +++ b/src/Viewer2dTest/Viewer2dTest.cxx @@ -468,7 +468,7 @@ static Standard_Integer TDraft2d (Draw_Interpretor& , Standard_Integer argc, con return 1; } anAngle = atof(argv[4]); - anAngle = 2*PI * anAngle / 360.0; + anAngle = 2*M_PI * anAngle / 360.0; gp_Pln aPln; Handle(Geom_Surface) aSurf; // AIS2D_KindOfSurface aSurfType; diff --git a/src/Viewer2dTest/Viewer2dTest_DisplayCommands.cxx b/src/Viewer2dTest/Viewer2dTest_DisplayCommands.cxx index e55035b576..2756abaad3 100755 --- a/src/Viewer2dTest/Viewer2dTest_DisplayCommands.cxx +++ b/src/Viewer2dTest/Viewer2dTest_DisplayCommands.cxx @@ -1915,7 +1915,7 @@ static int drawFinishSymbol( Draw_Interpretor& , Standard_Integer argc, const ch gp_Pnt2d rightTopPoint(location.X() + length/2, location.Y() + length); gp_Trsf2d trsf; - trsf.SetRotation(location, angle*PI/180); + trsf.SetRotation(location, angle*M_PI/180); startPoint.Transform(trsf); leftTopPoint.Transform(trsf); diff --git a/src/Viewer2dTest/Viewer2dTest_GeneralCommands.cxx b/src/Viewer2dTest/Viewer2dTest_GeneralCommands.cxx index 60933b5d91..4028f23dbd 100755 --- a/src/Viewer2dTest/Viewer2dTest_GeneralCommands.cxx +++ b/src/Viewer2dTest/Viewer2dTest_GeneralCommands.cxx @@ -361,7 +361,7 @@ static int V2dDebug (Draw_Interpretor& di, Standard_Integer , const char** ) OSD_Timer myTimer; TheAIS2DContext()->CloseLocalContext(); - Standard_Real Step = 4*PI/180; + Standard_Real Step = 4*M_PI/180; Standard_Real Angle = 0; Handle(AIS2D_InteractiveObject) aIO; @@ -383,7 +383,7 @@ static int V2dDebug (Draw_Interpretor& di, Standard_Integer , const char** ) if (atoi(argv[2]) == 1) { cout << " Calcul par Transformation" << endl; - for (Standard_Real myAngle = 0; Angle < 10*2*PI; myAngle++) + for (Standard_Real myAngle = 0; Angle < 10*2*M_PI; myAngle++) { Angle = Step*myAngle; gp_Trsf myTransfo; @@ -400,7 +400,7 @@ static int V2dDebug (Draw_Interpretor& di, Standard_Integer , const char** ) TopLoc_Location myDeltaAngle (myAngleTrsf); TopLoc_Location myTrueLoc; - for (Standard_Real myAngle = 0; Angle < 10*2*PI; myAngle++) + for (Standard_Real myAngle = 0; Angle < 10*2*M_PI; myAngle++) { Angle = Step*myAngle; myTrueLoc = myTrueLoc*myDeltaAngle; @@ -480,9 +480,9 @@ static int V2dDebug (Draw_Interpretor& di, Standard_Integer , const char** ) // TheAIS2DContext()->Deactivate(myAisPropeller ); // Boucle de mouvement - for (Standard_Real myAngle = 0; angleA < 2*PI*10.175; myAngle++) + for (Standard_Real myAngle = 0; angleA < 2*M_PI*10.175; myAngle++) { - angleA = thread*myAngle*PI/180; + angleA = thread*myAngle*M_PI/180; X = Sin(angleA)*3/8; angleB = atan(X / Sqrt(-X * X + 1)); // Standard_Real decal(25*0.6); diff --git a/src/Viewer2dTest/Viewer2dTest_ObjectCommands.cxx b/src/Viewer2dTest/Viewer2dTest_ObjectCommands.cxx index 950914b2db..36b2abcc99 100755 --- a/src/Viewer2dTest/Viewer2dTest_ObjectCommands.cxx +++ b/src/Viewer2dTest/Viewer2dTest_ObjectCommands.cxx @@ -239,7 +239,7 @@ static int V2dTrihedron2D (Draw_Interpretor& , Standard_Integer argc, const char gp_Dir TheZVector (coord[3],coord[4],coord[5]); gp_Dir TheXVector (coord[6],coord[7],coord[8]); - if (!TheZVector.IsNormal(TheXVector,PI/180)) + if (!TheZVector.IsNormal(TheXVector,M_PI/180)) { cout << argv[0] << " VectorX is not normal to VectorZ" << endl; return 1; @@ -1120,7 +1120,7 @@ static int V2dPlaneBuilder (Draw_Interpretor& , Standard_Integer argc, const cha if (mySurface.GetType() == GeomAbs_Plane) { gp_Pln myPlane = mySurface.Plane(); - myPlane.Rotate(myRotAxis, PI/2); + myPlane.Rotate(myRotAxis, M_PI/2); Handle(Geom_Plane) theGeomPlane = new Geom_Plane(myPlane); gp_Pnt theMiddle ((Aa.X()+Ab.X())/2, (Aa.Y()+Ab.Y())/2, (Aa.Z()+Ab.Z())/2); @@ -1168,7 +1168,7 @@ static int V2dPlaneBuilder (Draw_Interpretor& , Standard_Integer argc, const cha if (mySurface.GetType() == GeomAbs_Plane) { gp_Pln myPlane = mySurface.Plane(); - myPlane.Rotate(myRotAxis, PI/2); + myPlane.Rotate(myRotAxis, M_PI/2); Handle(Geom_Plane) theGeomPlane = new Geom_Plane(myPlane); gp_Pnt theMiddle ((Ba.X()+Bb.X())/2, (Ba.Y()+Bb.Y())/2, (Ba.Z()+Bb.Z())/2); Handle(AIS2D_Plane) myAIS2DPlane = new AIS2D_Plane(theGeomPlane, theMiddle); diff --git a/src/ViewerTest/ViewerTest.cxx b/src/ViewerTest/ViewerTest.cxx index 8a847b8e9f..7db57af7dc 100755 --- a/src/ViewerTest/ViewerTest.cxx +++ b/src/ViewerTest/ViewerTest.cxx @@ -1950,7 +1950,7 @@ static int VMoveA (Draw_Interpretor& di, Standard_Integer argc, const char** arg if (TheAISContext()->HasOpenedContext()) TheAISContext()->CloseLocalContext(); - Standard_Real Step=2*PI/180; + Standard_Real Step=2*M_PI/180; Standard_Real Angle=0; // R est le rayon de l'hellicoide Standard_Real R=50; @@ -1971,10 +1971,10 @@ static int VMoveA (Draw_Interpretor& di, Standard_Integer argc, const char** arg // boucle generant le mouvement if(argc==3) { di<<" Transformations"<<"\n"; - for (Standard_Real myAngle=0;Angle<5*2*PI; myAngle++) { + for (Standard_Real myAngle=0;Angle<5*2*M_PI; myAngle++) { Angle=Step*myAngle; - gp_Ax3 newBase(gp_Pnt(R*cos(Angle), R*sin(Angle), D*Angle/(2*PI) ), gp_Vec(0,0,1), gp_Vec(1,0,0) ); + gp_Ax3 newBase(gp_Pnt(R*cos(Angle), R*sin(Angle), D*Angle/(2*M_PI) ), gp_Vec(0,0,1), gp_Vec(1,0,0) ); gp_Trsf myTransfo; myTransfo.SetTransformation(newBase.Rotated(gp_Ax1(gp_Pnt(R*cos(Angle),R*sin(Angle),0), gp_Dir(0,0,1) ),Angle ) ); TheAISContext()->SetLocation(aIO,myTransfo); @@ -1993,7 +1993,7 @@ static int VMoveA (Draw_Interpretor& di, Standard_Integer argc, const char** arg TopLoc_Location myDeltaDist (myDistTrsf); TopLoc_Location myTrueLoc; - for (Standard_Real myAngle=0;Angle<5*2*PI; myAngle++) { + for (Standard_Real myAngle=0;Angle<5*2*M_PI; myAngle++) { Angle=Step*myAngle; myTrueLoc=myTrueLoc*myDeltaAngle*myDeltaDist; @@ -2053,7 +2053,7 @@ static int VPerf(Draw_Interpretor& di, Standard_Integer , const char** argv) { if (TheAISContext()->HasOpenedContext()) TheAISContext()->CloseLocalContext(); - Standard_Real Step=4*PI/180; + Standard_Real Step=4*M_PI/180; Standard_Real Angle=0; Handle(AIS_InteractiveObject) aIO; @@ -2076,7 +2076,7 @@ static int VPerf(Draw_Interpretor& di, Standard_Integer , const char** argv) { // Movement par transformation if(atoi(argv[2]) ==1) { di<<" Calcul par Transformation"<<"\n"; - for (Standard_Real myAngle=0;Angle<10*2*PI; myAngle++) { + for (Standard_Real myAngle=0;Angle<10*2*M_PI; myAngle++) { Angle=Step*myAngle; gp_Trsf myTransfo; @@ -2093,7 +2093,7 @@ static int VPerf(Draw_Interpretor& di, Standard_Integer , const char** argv) { TopLoc_Location myDeltaAngle (myAngleTrsf); TopLoc_Location myTrueLoc; - for (Standard_Real myAngle=0;Angle<10*2*PI; myAngle++) { + for (Standard_Real myAngle=0;Angle<10*2*M_PI; myAngle++) { Angle=Step*myAngle; myTrueLoc=myTrueLoc*myDeltaAngle; @@ -2174,9 +2174,9 @@ static int VAnimation (Draw_Interpretor& di, Standard_Integer argc, const char** TheAISContext()->Deactivate(myAisPropeller ); // Boucle de mouvement - for (Standard_Real myAngle = 0;angleA<2*PI*10.175 ;myAngle++) { + for (Standard_Real myAngle = 0;angleA<2*M_PI*10.175 ;myAngle++) { - angleA = thread*myAngle*PI/180; + angleA = thread*myAngle*M_PI/180; X = Sin(angleA)*3/8; angleB = atan(X / Sqrt(-X * X + 1)); Standard_Real decal(25*0.6); @@ -3678,7 +3678,7 @@ static Standard_Integer TDraft(Draw_Interpretor& di, Standard_Integer argc, cons return 1; } anAngle = atof(argv[4]); - anAngle = 2*PI * anAngle / 360.0; + anAngle = 2*M_PI * anAngle / 360.0; gp_Pln aPln; Handle( Geom_Surface )aSurf; AIS_KindOfSurface aSurfType; diff --git a/src/ViewerTest/ViewerTest_ObjectCommands.cxx b/src/ViewerTest/ViewerTest_ObjectCommands.cxx index 83cacf0cb3..48a879c775 100755 --- a/src/ViewerTest/ViewerTest_ObjectCommands.cxx +++ b/src/ViewerTest/ViewerTest_ObjectCommands.cxx @@ -250,7 +250,7 @@ static int VTrihedron (Draw_Interpretor& di, Standard_Integer argc, const char** gp_Dir TheZVector(coord[3],coord[4],coord[5]); gp_Dir TheXVector(coord[6],coord[7],coord[8]); - if ( !TheZVector.IsNormal(TheXVector,PI/180)) {di< localStartTheta ? localEndTheta : localStartTheta); - endTheta *= Standard_PI / 180.0; + endTheta *= M_PI / 180.0; startPhi = ( mStartPhi < mEndPhi ? mStartPhi : mEndPhi); - startPhi *= Standard_PI / 180.0; + startPhi *= M_PI / 180.0; endPhi = ( mEndPhi > mStartPhi ? mEndPhi : mStartPhi); - endPhi *= Standard_PI / 180.0; + endPhi *= M_PI / 180.0; phiResolution = mPhiResolution - numPoles; deltaPhi = (endPhi - startPhi) / ( mPhiResolution - 1); @@ -2562,7 +2562,7 @@ Handle( Poly_Triangulation ) CalculationOfSphere( double X , double Y , double Z number_point = 3; for ( i=0; i < localThetaResolution; i++){ - theta = localStartTheta * Standard_PI / 180.0 + i*deltaTheta; + theta = localStartTheta * M_PI / 180.0 + i*deltaTheta; for ( j = jStart; j < jEnd; j++){ phi = startPhi + j*deltaPhi; radius = mRadius * sin((double)phi); diff --git a/src/ViewerTest/ViewerTest_RelationCommands.cxx b/src/ViewerTest/ViewerTest_RelationCommands.cxx index a9d1b44eb9..6234fe0676 100755 --- a/src/ViewerTest/ViewerTest_RelationCommands.cxx +++ b/src/ViewerTest/ViewerTest_RelationCommands.cxx @@ -242,7 +242,7 @@ static int VAngleDimBuilder(Draw_Interpretor& di, Standard_Integer argc, const c TheAISContext()->CloseLocalContext(myCurrentIndex); // Construction de l'AIS dimension - Handle (AIS_AngleDimension) myAISDim= new AIS_AngleDimension (TopoDS::Edge(ShapeA) ,TopoDS::Edge(ShapeB) ,theGeomPlane ,PI/2.0 ,TheMessage_Str ); + Handle (AIS_AngleDimension) myAISDim= new AIS_AngleDimension (TopoDS::Edge(ShapeA) ,TopoDS::Edge(ShapeB) ,theGeomPlane ,M_PI/2.0 ,TheMessage_Str ); GetMapOfAIS().Bind (myAISDim,argv[1]); TheAISContext()->Display(myAISDim ); @@ -1671,7 +1671,7 @@ static int VPerpendicularBuilder(Draw_Interpretor& di, Standard_Integer argc, co // on verifie si les edges sont orthogonaux. //gp_Lin theLineA=theCurveA.Line(); //gp_Lin theLineB=theCurveB.Line(); - //if (abs(theLineA.Angle(theLineB) ) != PI/2 ) {cout<<"vperpendicular error: Edges are not othogonals."<= 0.0) ); + return ( (AAngle < M_PI) && (AAngle >= 0.0) ); } diff --git a/src/Visual3d/Visual3d_ViewOrientation.cxx b/src/Visual3d/Visual3d_ViewOrientation.cxx index 24c4b72c79..99cdb95ecc 100755 --- a/src/Visual3d/Visual3d_ViewOrientation.cxx +++ b/src/Visual3d/Visual3d_ViewOrientation.cxx @@ -208,7 +208,7 @@ Standard_Real pvn, sca, angle; /* Compute Angle */ if (angle > 1.) angle = 1. ; else if ( angle < -1. ) angle = -1. ; - angle = asin (angle)/Standard_PI180 ; + angle = asin (angle) / (M_PI / 180.0); sca = a1*a2 + b1*b2 + c1*c2 ; if (sca < 0.) angle = 180. - angle ; if ( (angle > 0.) && (angle < 180.) ) { @@ -216,9 +216,9 @@ Standard_Real pvn, sca, angle; if (sca > 0.) angle = 360. - angle ; } - return (angle*Standard_PI/180.0); + return (angle * M_PI / 180.0); #else - return (Standard_PI/180.0); + return (M_PI / 180.0); #endif } diff --git a/src/VrmlData/VrmlData_ShapeConvert.hxx b/src/VrmlData/VrmlData_ShapeConvert.hxx index 442eb0b8ba..6e3d5fa4cd 100755 --- a/src/VrmlData/VrmlData_ShapeConvert.hxx +++ b/src/VrmlData/VrmlData_ShapeConvert.hxx @@ -72,7 +72,7 @@ class VrmlData_ShapeConvert Standard_EXPORT void Convert (const Standard_Boolean theExtractFaces, const Standard_Boolean theExtractEdges, const Standard_Real theDeflection = 0.01, - const Standard_Real theDeflAngle = 20.*PI/180.); + const Standard_Real theDeflAngle = 20.*M_PI/180.); //this value of theDeflAngle is used by default //for tesselation while shading (Drawer->HLRAngle()) diff --git a/src/WNT/WNT_DDriver.cxx b/src/WNT/WNT_DDriver.cxx index 9c98336977..2e87569305 100755 --- a/src/WNT/WNT_DDriver.cxx +++ b/src/WNT/WNT_DDriver.cxx @@ -298,7 +298,7 @@ void WNT_DDriver::BeginDraw() Quantity_Length width, height; WorkSpace (width, height); if (myFlags & FLAG_ROTATE) { - a -> myAngle = Standard_PI / 2; + a -> myAngle = M_PI / 2; a -> myPivot.x = Convert (height / 2); a -> myPivot.y = Convert (width / 2); a -> myMove.x = diff --git a/src/WNT/WNT_ImageManager.cxx b/src/WNT/WNT_ImageManager.cxx index fde2614b3a..96aecbcd62 100755 --- a/src/WNT/WNT_ImageManager.cxx +++ b/src/WNT/WNT_ImageManager.cxx @@ -15,7 +15,6 @@ #include -#define M_PI 3.1415 #define TRASH_SIZE 8 #define PWND ( ( WNT_WindowPtr )myWindow ) diff --git a/src/Xw/Xw_Extension.h b/src/Xw/Xw_Extension.h index 57023a8a4c..e95c333730 100755 --- a/src/Xw/Xw_Extension.h +++ b/src/Xw/Xw_Extension.h @@ -34,11 +34,7 @@ #define max(a,b) (aupoints[i].y = (short int )( yp + YROTATE(x,y) ); a = pltextlist->rangles[i] + angle ; if( a > 0. ) { - while( a > 2.*PI ) a -= 2.*PI ; + while( a > 2.*M_PI ) a -= 2.*M_PI ; } else if( a < 0. ) { - while( a < -2.*PI ) a += 2.*PI ; + while( a < -2.*M_PI ) a += 2.*M_PI ; } pltextlist->uangles[i] = a ; pltextlist->uscalex[i] = pltextlist->rscalex[i] ; @@ -1661,9 +1661,9 @@ float a,cosa,sina ; pptextlist->upoints[i].y = (short int )( yp + YROTATE(x,y) ); a = pptextlist->rangles[i] + angle ; if( a > 0. ) { - while( a > 2.*PI ) a -= 2.*PI ; + while( a > 2.*M_PI ) a -= 2.*M_PI ; } else if( a < 0. ) { - while( a < -2.*PI ) a += 2.*PI ; + while( a < -2.*M_PI ) a += 2.*M_PI ; } pptextlist->uangles[i] = a ; pptextlist->uscalex[i] = pptextlist->rscalex[i] ; diff --git a/src/Xw/Xw_draw_polytext.cxx b/src/Xw/Xw_draw_polytext.cxx index 459bf2b4c9..f4680c14ae 100755 --- a/src/Xw/Xw_draw_polytext.cxx +++ b/src/Xw/Xw_draw_polytext.cxx @@ -126,9 +126,9 @@ XW_ATTRIB textcode; ptextlist->slants[ntext] = 0. ; strcpy(ptextlist->ptexts[ntext],text) ; if( angle > 0. ) { - while( angle > 2.*PI ) angle -= 2.*PI ; + while( angle > 2.*M_PI ) angle -= 2.*M_PI ; } else if( angle < 0. ) { - while( angle < -2.*PI ) angle += 2.*PI ; + while( angle < -2.*M_PI ) angle += 2.*M_PI ; } ptextlist->rangles[ntext] = angle ; ptextlist->marges[ntext] = marge ; diff --git a/src/Xw/Xw_draw_text.cxx b/src/Xw/Xw_draw_text.cxx index 8d9421a1ce..63c101ecc5 100755 --- a/src/Xw/Xw_draw_text.cxx +++ b/src/Xw/Xw_draw_text.cxx @@ -117,9 +117,9 @@ XW_ATTRIB textcode; ptextlist->slants[ntext] = 0. ; strcpy(ptextlist->ptexts[ntext],text) ; if( angle > 0. ) { - while( angle > 2.*PI ) angle -= 2.*PI ; + while( angle > 2.*M_PI ) angle -= 2.*M_PI ; } else if( angle < 0. ) { - while( angle < -2.*PI ) angle += 2.*PI ; + while( angle < -2.*M_PI ) angle += 2.*M_PI ; } ptextlist->rangles[ntext] = angle ; diff --git a/src/gce/gce_MakeCone.cxx b/src/gce/gce_MakeCone.cxx index 566bdd715e..696e440521 100755 --- a/src/gce/gce_MakeCone.cxx +++ b/src/gce/gce_MakeCone.cxx @@ -18,7 +18,7 @@ gce_MakeCone::gce_MakeCone(const gp_Ax2& A2 , { if (Radius < 0.0) { TheError = gce_NegativeRadius; } else { - if (Ang <= gp::Resolution() || PI/2-Ang <= gp::Resolution()) { + if (Ang <= gp::Resolution() || M_PI/2-Ang <= gp::Resolution()) { TheError = gce_BadAngle; } else { @@ -58,7 +58,7 @@ gce_MakeCone::gce_MakeCone(const gp_Pnt& P1 , Standard_Real Dist4 = L1.Distance(P4); Standard_Real DifRad = Dist3-Dist4; Standard_Real angle = Abs(ATan(DifRad/(Dist13-Dist14))); - if(Abs(PI/2.-angle) < RealEpsilon() || Abs(angle) < RealEpsilon()) { TheError = gce_NullRadius; return; } + if(Abs(M_PI/2.-angle) < RealEpsilon() || Abs(angle) < RealEpsilon()) { TheError = gce_NullRadius; return; } Standard_Real R1 = PP3.Distance(P3); Standard_Real R2 = PP4.Distance(P4); if (R1 < 0.0 || R2 < 0.0) { TheError = gce_NegativeRadius; return; } @@ -165,7 +165,7 @@ gce_MakeCone::gce_MakeCone(const gp_Pnt& P1 , } else { Standard_Real Angle = Abs(atan((R1-R2)/dist)); - if (Abs(PI/2.-Angle) -0.70710678118655 && Cosinus < 0.70710678118655) Ang = acos (Cosinus); else { - if(Cosinus < 0.0) Ang = Standard_PI - asin (Sinus); + if(Cosinus < 0.0) Ang = M_PI - asin (Sinus); else Ang = asin (Sinus); } if (XYZ.Dot (Vref.coord) >= 0.0) return Ang; diff --git a/src/gp/gp_Dir.lxx b/src/gp/gp_Dir.lxx index 07a1ecd010..c143459590 100755 --- a/src/gp/gp_Dir.lxx +++ b/src/gp/gp_Dir.lxx @@ -146,7 +146,7 @@ inline Standard_Boolean gp_Dir::IsNormal (const gp_Dir& Other, const Standard_Real AngularTolerance) const { - Standard_Real Ang = Standard_PI / 2.0 - Angle (Other); + Standard_Real Ang = M_PI / 2.0 - Angle (Other); if (Ang < 0) Ang = - Ang; return Ang <= AngularTolerance; } @@ -154,14 +154,14 @@ inline Standard_Boolean gp_Dir::IsNormal inline Standard_Boolean gp_Dir::IsOpposite (const gp_Dir& Other, const Standard_Real AngularTolerance) const -{ return Standard_PI - Angle (Other) <= AngularTolerance; } +{ return M_PI - Angle (Other) <= AngularTolerance; } inline Standard_Boolean gp_Dir::IsParallel (const gp_Dir& Other, const Standard_Real AngularTolerance) const { Standard_Real Ang = Angle (Other); - return Ang <= AngularTolerance || Standard_PI - Ang <= AngularTolerance; + return Ang <= AngularTolerance || M_PI - Ang <= AngularTolerance; } inline void gp_Dir::Cross (const gp_Dir& Right) diff --git a/src/gp/gp_Dir2d.cxx b/src/gp/gp_Dir2d.cxx index d37063533a..2ce634f21a 100755 --- a/src/gp/gp_Dir2d.cxx +++ b/src/gp/gp_Dir2d.cxx @@ -20,8 +20,8 @@ Standard_Real gp_Dir2d::Angle (const gp_Dir2d& Other) const else { if (Cosinus > 0.0) return asin (Sinus); else { - if (Sinus > 0.0) return Standard_PI - asin (Sinus); - else return -Standard_PI - asin (Sinus); + if (Sinus > 0.0) return M_PI - asin (Sinus); + else return -M_PI - asin (Sinus); } } } diff --git a/src/gp/gp_Dir2d.lxx b/src/gp/gp_Dir2d.lxx index 37efe6ae2b..9618c1e144 100755 --- a/src/gp/gp_Dir2d.lxx +++ b/src/gp/gp_Dir2d.lxx @@ -122,7 +122,7 @@ inline Standard_Boolean gp_Dir2d::IsNormal { Standard_Real Ang = Angle(Other); if (Ang < 0) Ang = - Ang; - Ang = Standard_PI / 2.0 - Ang; + Ang = M_PI / 2.0 - Ang; if (Ang < 0) Ang = - Ang; return Ang <= AngularTolerance; } @@ -133,7 +133,7 @@ inline Standard_Boolean gp_Dir2d::IsOpposite { Standard_Real Ang = Angle(Other); if (Ang < 0) Ang = - Ang; - return Standard_PI - Ang <= AngularTolerance; + return M_PI - Ang <= AngularTolerance; } inline Standard_Boolean gp_Dir2d::IsParallel @@ -142,7 +142,7 @@ inline Standard_Boolean gp_Dir2d::IsParallel { Standard_Real Ang = Angle(Other); if (Ang < 0) Ang = - Ang; - return Ang <= AngularTolerance || Standard_PI - Ang <= AngularTolerance; + return Ang <= AngularTolerance || M_PI - Ang <= AngularTolerance; } inline Standard_Real gp_Dir2d::Crossed (const gp_Dir2d& Right) const diff --git a/src/gp/gp_Elips.lxx b/src/gp/gp_Elips.lxx index e959863f3d..fac2996360 100755 --- a/src/gp/gp_Elips.lxx +++ b/src/gp/gp_Elips.lxx @@ -23,7 +23,7 @@ inline gp_Elips::gp_Elips (const gp_Ax2& A2, } inline Standard_Real gp_Elips::Area() const -{ return Standard_PI * majorRadius * minorRadius; } +{ return M_PI * majorRadius * minorRadius; } inline Standard_Real gp_Elips::MajorRadius() const { return majorRadius; } diff --git a/src/gp/gp_Elips2d.lxx b/src/gp/gp_Elips2d.lxx index 0ca5c9b413..bde25932e3 100755 --- a/src/gp/gp_Elips2d.lxx +++ b/src/gp/gp_Elips2d.lxx @@ -58,7 +58,7 @@ inline void gp_Elips2d::SetYAxis (const gp_Ax2d& A) { pos.SetYAxis(A); } inline Standard_Real gp_Elips2d::Area() const -{ return Standard_PI * majorRadius * minorRadius; } +{ return M_PI * majorRadius * minorRadius; } inline gp_Ax2d gp_Elips2d::Directrix1() const { diff --git a/src/gp/gp_Sphere.lxx b/src/gp/gp_Sphere.lxx index 17cbc0ffb3..aed076df11 100755 --- a/src/gp/gp_Sphere.lxx +++ b/src/gp/gp_Sphere.lxx @@ -22,7 +22,7 @@ inline void gp_Sphere::SetRadius (const Standard_Real R) } inline Standard_Real gp_Sphere::Area () const -{ return 4.0 * Standard_PI * radius * radius; } +{ return 4.0 * M_PI * radius * radius; } inline void gp_Sphere::UReverse() { pos.YReverse(); } @@ -43,7 +43,7 @@ inline Standard_Real gp_Sphere::Radius () const { return radius; } inline Standard_Real gp_Sphere::Volume () const -{ return (4.0 * Standard_PI * radius * radius * radius) / 3.0; } +{ return (4.0 * M_PI * radius * radius * radius) / 3.0; } inline gp_Ax1 gp_Sphere::XAxis () const { return gp_Ax1(pos.Location(), pos.XDirection()); } diff --git a/src/gp/gp_Torus.lxx b/src/gp/gp_Torus.lxx index 14b343d580..413f9234ed 100755 --- a/src/gp/gp_Torus.lxx +++ b/src/gp/gp_Torus.lxx @@ -40,7 +40,7 @@ inline void gp_Torus::SetPosition (const gp_Ax3& A3) { pos = A3; } inline Standard_Real gp_Torus::Area () const -{ return 4.0 * Standard_PI * Standard_PI * minorRadius * majorRadius; } +{ return 4.0 * M_PI * M_PI * minorRadius * majorRadius; } inline void gp_Torus::UReverse() { pos.YReverse(); } @@ -67,7 +67,7 @@ inline Standard_Real gp_Torus::MinorRadius () const { return minorRadius; } inline Standard_Real gp_Torus::Volume () const -{ return (Standard_PI * minorRadius * minorRadius) * (2.0 * Standard_PI * majorRadius); } +{ return (M_PI * minorRadius * minorRadius) * (2.0 * M_PI * majorRadius); } inline gp_Ax1 gp_Torus::XAxis () const { return gp_Ax1(pos.Location(), pos.XDirection()); } diff --git a/src/gp/gp_Vec.lxx b/src/gp/gp_Vec.lxx index 65333fc516..61d52e3c99 100755 --- a/src/gp/gp_Vec.lxx +++ b/src/gp/gp_Vec.lxx @@ -77,7 +77,7 @@ inline Standard_Boolean gp_Vec::IsNormal (const gp_Vec& Other, const Standard_Real AngularTolerance) const { - Standard_Real Ang = Standard_PI / 2.0 - Angle(Other); + Standard_Real Ang = M_PI / 2.0 - Angle(Other); if (Ang < 0) Ang = - Ang; return Ang <= AngularTolerance; } @@ -86,7 +86,7 @@ inline Standard_Boolean gp_Vec::IsOpposite (const gp_Vec& Other, const Standard_Real AngularTolerance) const { - Standard_Real Ang = Standard_PI - Angle(Other); + Standard_Real Ang = M_PI - Angle(Other); return Ang <= AngularTolerance; } @@ -95,7 +95,7 @@ inline Standard_Boolean gp_Vec::IsParallel const Standard_Real AngularTolerance) const { Standard_Real Ang = Angle (Other); - return Ang <= AngularTolerance || Standard_PI - Ang <= AngularTolerance; + return Ang <= AngularTolerance || M_PI - Ang <= AngularTolerance; } inline Standard_Real gp_Vec::Angle (const gp_Vec& Other) const diff --git a/src/gp/gp_Vec2d.cxx b/src/gp/gp_Vec2d.cxx index cd17ca89da..9e7a43e308 100755 --- a/src/gp/gp_Vec2d.cxx +++ b/src/gp/gp_Vec2d.cxx @@ -56,8 +56,8 @@ Standard_Real gp_Vec2d::Angle (const gp_Vec2d& Other) const if (Cosinus > 0.0) return asin (Sinus); else { - if (Sinus > 0.0) return PI - asin (Sinus); - else return - PI - asin (Sinus); + if (Sinus > 0.0) return M_PI - asin (Sinus); + else return - M_PI - asin (Sinus); } } } diff --git a/src/gp/gp_Vec2d.lxx b/src/gp/gp_Vec2d.lxx index 43951a5dbb..af04ce5ef3 100755 --- a/src/gp/gp_Vec2d.lxx +++ b/src/gp/gp_Vec2d.lxx @@ -62,7 +62,7 @@ inline Standard_Boolean gp_Vec2d::IsNormal { Standard_Real Ang = Angle(Other); if (Ang < 0) Ang = - Ang; - Ang = Standard_PI / 2.0 - Angle(Other); + Ang = M_PI / 2.0 - Angle(Other); if (Ang < 0) Ang = - Ang; return Ang <= AngularTolerance; } @@ -73,7 +73,7 @@ inline Standard_Boolean gp_Vec2d::IsOpposite { Standard_Real Ang = Angle(Other); if (Ang < 0) Ang = - Ang; - return Standard_PI - Ang <= AngularTolerance; + return M_PI - Ang <= AngularTolerance; } inline Standard_Boolean gp_Vec2d::IsParallel @@ -82,7 +82,7 @@ inline Standard_Boolean gp_Vec2d::IsParallel { Standard_Real Ang = Angle(Other); if (Ang < 0) Ang = - Ang; - return Ang <= AngularTolerance || Standard_PI - Ang <= AngularTolerance; + return Ang <= AngularTolerance || M_PI - Ang <= AngularTolerance; } inline Standard_Real gp_Vec2d::Magnitude() const diff --git a/src/math/math_DirectPolynomialRoots.cxx b/src/math/math_DirectPolynomialRoots.cxx index be0732c3e4..308b7d48f4 100755 --- a/src/math/math_DirectPolynomialRoots.cxx +++ b/src/math/math_DirectPolynomialRoots.cxx @@ -375,7 +375,7 @@ void math_DirectPolynomialRoots::Solve(const Standard_Real a, else { Omega = atan(0.5 * Q / sqrt(- Discr)); Sp3 = sqrt(-P / 3.0); - Y1 = -2.0 * Sb * Sp3 * cos(PI / 6.0 - Sb * Omega / 3.0); + Y1 = -2.0 * Sb * Sp3 * cos(M_PI / 6.0 - Sb * Omega / 3.0); TheRoots[0] = - Beta / 3.0 + Y1; if(Beta * Q <= 0.0) { TheRoots[1] = - Beta / 3.0 + 2.0 * Sp3 * sin(Omega / 3.0); diff --git a/src/math/math_TrigonometricFunctionRoots.cxx b/src/math/math_TrigonometricFunctionRoots.cxx index 2e707775d4..5d94c729df 100755 --- a/src/math/math_TrigonometricFunctionRoots.cxx +++ b/src/math/math_TrigonometricFunctionRoots.cxx @@ -129,7 +129,7 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A, Eps = 1.e-12; - Depi = PI+PI; + Depi = M_PI+M_PI; if (InfBound <= RealFirst() && SupBound >= RealLast()) { MyBorneInf = 0.0; Delta = Depi; @@ -174,7 +174,7 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A, } Zer(1) = ASin(AA); - Zer(2) = PI - Zer(1); + Zer(2) = M_PI - Zer(1); NZer = 2; for (i = 1; i <= NZer; i++) { if (Zer(i) <= -Eps) { @@ -211,7 +211,7 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A, } // On rend les solutions entre InfBound et SupBound: // ================================================= - Zer(i) += IntegerPart(Mod)*2.*PI; + Zer(i) += IntegerPart(Mod)*2.*M_PI; X = Zer(i)-MyBorneInf; if ((X >= (-Epsilon(Delta))) && (X <= Delta+ Epsilon(Delta))) { NbSol++; @@ -380,7 +380,7 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A, if(NbSol<4) { Standard_Integer startIndex = NbSol + 1; for( Standard_Integer solIt = startIndex; solIt <= 4; solIt++) { - Teta = PI + IntegerPart(Mod)*2.0*PI;; + Teta = M_PI + IntegerPart(Mod)*2.0*M_PI;; X = Teta - MyBorneInf; if ((X >= (-Epsilon(Delta))) && (X <= Delta + Epsilon(Delta))) { if (Abs(A-C+E) <= Eps) {