From 2cc2bfdd2721a129c4ca76cbb26ab14ee0b39a8c Mon Sep 17 00:00:00 2001 From: Pasukhin Dmitry Date: Tue, 4 Nov 2025 16:21:59 +0000 Subject: [PATCH] Foundation Classes, gp - Add constexpr/noexcept constructors and standard direction enums (#803) - Addition of `gp_Dir::D` and `gp_Dir2d::D` enums for standard directions (X, Y, Z, NX, NY, NZ) - Constexpr/noexcept constructors for geometric primitives (circles, cones, cylinders, etc.) - Enhanced axis placement classes with enum-based constructors - Replacement of hardcoded direction values throughout the codebase --- .../BRepToIGES/BRepToIGES_BRShell.cxx | 2 +- .../GeomToIGES/GeomToIGES_GeomSurface.cxx | 2 +- .../IGESGeom/IGESGeom_CircularArc.cxx | 2 +- .../TKDEIGES/IGESGeom/IGESGeom_ConicArc.cxx | 2 +- .../IGESGeom/IGESGeom_ToolConicArc.cxx | 4 +- .../IGESToBRep/IGESToBRep_TopoSurface.cxx | 12 +- .../GeomToStep_MakeAxis2Placement3d.cxx | 4 +- .../STEPControl/STEPControl_ActorRead.cxx | 2 +- .../TKDESTEP/StepToGeom/StepToGeom.cxx | 12 +- .../TKDESTL/GTests/DESTL_Provider_Test.cxx | 4 +- .../TKDEVRML/GTests/DEVRML_Provider_Test.cxx | 2 +- .../VrmlConverter/VrmlConverter_Projector.cxx | 4 +- .../TKDEVRML/VrmlData/VrmlData_Geometry.cxx | 4 +- .../TKDCAF/DNaming/DNaming_SphereDriver.cxx | 2 +- src/Draw/TKDraw/DBRep/DBRep_IsoBuilder.cxx | 4 +- src/Draw/TKDraw/Draw/Draw_Axis2D.cxx | 4 +- src/Draw/TKDraw/Draw/Draw_View.cxx | 82 +++++----- src/Draw/TKQADraw/QABugs/QABugs_10.cxx | 14 +- src/Draw/TKQADraw/QABugs/QABugs_11.cxx | 16 +- src/Draw/TKQADraw/QABugs/QABugs_14.cxx | 2 +- src/Draw/TKQADraw/QABugs/QABugs_16.cxx | 4 +- src/Draw/TKQADraw/QABugs/QABugs_17.cxx | 14 +- src/Draw/TKQADraw/QABugs/QABugs_19.cxx | 22 +-- src/Draw/TKQADraw/QABugs/QABugs_20.cxx | 14 +- src/Draw/TKQADraw/QABugs/QABugs_3.cxx | 13 +- src/Draw/TKQADraw/QABugs/QABugs_9.cxx | 1 - .../QABugs/QABugs_PresentableObject.cxx | 4 +- .../BRepTest/BRepTest_CurveCommands.cxx | 4 +- .../BRepTest/BRepTest_HelixCommands.cxx | 2 +- .../GeometryTest_CurveCommands.cxx | 4 +- .../GeometryTest_CurveTanCommands.cxx | 7 +- .../GeomliteTest_CurveCommands.cxx | 36 ++--- .../GeomliteTest_SurfaceCommands.cxx | 6 +- .../ViewerTest/ViewerTest_ObjectCommands.cxx | 7 +- .../ViewerTest_RelationCommands.cxx | 1 - .../ViewerTest/ViewerTest_ViewerCommands.cxx | 2 +- src/FoundationClasses/TKMath/Bnd/Bnd_OBB.cxx | 6 +- .../TKMath/GTests/Bnd_BoundSortBox_Test.cxx | 2 +- .../TKMath/GTests/Bnd_Box_Test.cxx | 20 +-- .../TKMath/GTests/ElCLib_Test.cxx | 24 +-- src/FoundationClasses/TKMath/gp/gp.cxx | 61 +++---- src/FoundationClasses/TKMath/gp/gp.hxx | 39 +++-- src/FoundationClasses/TKMath/gp/gp_Ax1.hxx | 19 ++- src/FoundationClasses/TKMath/gp/gp_Ax2.hxx | 150 +++++++++++++++++- src/FoundationClasses/TKMath/gp/gp_Ax22d.hxx | 6 +- src/FoundationClasses/TKMath/gp/gp_Ax2d.hxx | 15 ++ src/FoundationClasses/TKMath/gp/gp_Ax3.hxx | 149 ++++++++++++++++- src/FoundationClasses/TKMath/gp/gp_Circ.hxx | 2 +- src/FoundationClasses/TKMath/gp/gp_Circ2d.hxx | 2 +- src/FoundationClasses/TKMath/gp/gp_Cone.hxx | 2 +- .../TKMath/gp/gp_Cylinder.hxx | 5 +- src/FoundationClasses/TKMath/gp/gp_Dir.hxx | 25 +++ src/FoundationClasses/TKMath/gp/gp_Dir2d.hxx | 20 +++ src/FoundationClasses/TKMath/gp/gp_Elips.hxx | 2 +- .../TKMath/gp/gp_Elips2d.hxx | 2 +- src/FoundationClasses/TKMath/gp/gp_Hypr.hxx | 2 +- src/FoundationClasses/TKMath/gp/gp_Hypr2d.hxx | 2 +- src/FoundationClasses/TKMath/gp/gp_Lin.hxx | 4 +- src/FoundationClasses/TKMath/gp/gp_Parab.hxx | 2 +- .../TKMath/gp/gp_Parab2d.hxx | 2 +- src/FoundationClasses/TKMath/gp/gp_Pln.hxx | 4 +- src/FoundationClasses/TKMath/gp/gp_Sphere.hxx | 2 +- src/FoundationClasses/TKMath/gp/gp_Torus.hxx | 2 +- .../TKernel/GTests/Standard_Dump_Test.cxx | 2 +- .../TKBO/BOPAlgo/BOPAlgo_WireSplitter_1.cxx | 2 +- .../TKBO/BOPTools/BOPTools_AlgoTools3D.cxx | 4 +- .../TKBO/GTests/BOPTest_Utilities.pxx | 13 +- .../TKBO/GTests/BRepAlgoAPI_Cut_Test.cxx | 92 +++++------ .../TKBO/GTests/BRepAlgoAPI_Cut_Test_1.cxx | 78 ++++----- .../TKBO/GTests/BRepAlgoAPI_Fuse_Test.cxx | 50 +++--- .../TKBO/IntTools/IntTools_FaceFace.cxx | 4 +- .../TKBool/BRepFill/BRepFill.cxx | 32 ++-- .../TKBool/BRepFill/BRepFill_Evolved.cxx | 4 +- .../TKBool/BRepFill/BRepFill_Generator.cxx | 16 +- .../TKBool/BRepFill/BRepFill_ShapeLaw.cxx | 2 +- .../TopOpeBRepBuild_GridSS.cxx | 2 +- .../TopOpeBRepBuild_WireEdgeSet.cxx | 4 +- .../TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx | 4 +- .../TopOpeBRepDS_FaceInterferenceTool.cxx | 6 +- .../TopOpeBRepTool_CurveTool.cxx | 2 +- .../TopOpeBRepTool_GEOMETRY.cxx | 2 +- .../TopOpeBRepTool_ShapeTool.cxx | 4 +- .../TopOpeBRepTool/TopOpeBRepTool_matter.cxx | 2 +- .../TKFeat/BRepFeat/BRepFeat_RibSlot.cxx | 2 +- .../TKFillet/BlendFunc/BlendFunc.cxx | 2 +- .../TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn.cxx | 2 +- .../GccAna/GccAna_Circ2d2TanOn_1.cxx | 2 +- .../GccAna/GccAna_Circ2d2TanOn_10.cxx | 2 +- .../GccAna/GccAna_Circ2d2TanOn_11.cxx | 2 +- .../GccAna/GccAna_Circ2d2TanOn_2.cxx | 2 +- .../GccAna/GccAna_Circ2d2TanOn_3.cxx | 2 +- .../GccAna/GccAna_Circ2d2TanOn_4.cxx | 2 +- .../GccAna/GccAna_Circ2d2TanOn_5.cxx | 2 +- .../GccAna/GccAna_Circ2d2TanOn_6.cxx | 2 +- .../GccAna/GccAna_Circ2d2TanOn_7.cxx | 2 +- .../GccAna/GccAna_Circ2d2TanOn_8.cxx | 2 +- .../GccAna/GccAna_Circ2d2TanOn_9.cxx | 2 +- .../GccAna/GccAna_Circ2d2TanRad.cxx | 2 +- .../GccAna/GccAna_Circ2d2TanRad_1.cxx | 2 +- .../GccAna/GccAna_Circ2d2TanRad_2.cxx | 2 +- .../GccAna/GccAna_Circ2d2TanRad_3.cxx | 2 +- .../GccAna/GccAna_Circ2d2TanRad_4.cxx | 2 +- .../GccAna/GccAna_Circ2d2TanRad_5.cxx | 2 +- .../TKGeomAlgo/GccAna/GccAna_Circ2d3Tan.cxx | 2 +- .../TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_1.cxx | 2 +- .../TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_2.cxx | 2 +- .../TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_3.cxx | 2 +- .../TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_4.cxx | 2 +- .../TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_5.cxx | 2 +- .../TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_6.cxx | 2 +- .../TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_7.cxx | 2 +- .../TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_8.cxx | 2 +- .../TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_9.cxx | 2 +- .../TKGeomAlgo/GccAna/GccAna_Circ2dBisec.cxx | 2 +- .../TKGeomAlgo/GccAna/GccAna_Circ2dTanCen.cxx | 6 +- .../GccAna/GccAna_Circ2dTanOnRad.cxx | 2 +- .../GccAna/GccAna_Circ2dTanOnRad_1.cxx | 2 +- .../GccAna/GccAna_Circ2dTanOnRad_2.cxx | 2 +- .../GccAna/GccAna_Circ2dTanOnRad_3.cxx | 2 +- .../GccAna/GccAna_Circ2dTanOnRad_4.cxx | 2 +- .../GccAna/GccAna_Circ2dTanOnRad_5.cxx | 2 +- .../GccAna/GccAna_CircPnt2dBisec.cxx | 2 +- .../Geom2dGcc/Geom2dGcc_Circ2d2TanOnGeo.cxx | 12 +- .../Geom2dGcc/Geom2dGcc_Circ2d2TanOnIter.cxx | 24 +-- .../Geom2dGcc/Geom2dGcc_Circ2d2TanRadGeo.cxx | 10 +- .../Geom2dGcc/Geom2dGcc_Circ2d3TanIter.cxx | 13 +- .../Geom2dGcc/Geom2dGcc_Circ2dTanCenGeo.cxx | 2 +- .../Geom2dGcc/Geom2dGcc_Circ2dTanOnRadGeo.cxx | 14 +- .../Geom2dHatch/Geom2dHatch_Elements.cxx | 2 +- .../TKGeomAlgo/GeomFill/GeomFill.cxx | 4 +- .../TKGeomAlgo/GeomFill/GeomFill_Sweep.cxx | 6 +- .../TKGeomAlgo/GeomInt/GeomInt_IntSS_1.cxx | 16 +- .../TKGeomAlgo/Hatch/Hatch_Hatcher.cxx | 4 +- .../TKGeomAlgo/IntWalk/IntWalk_PWalking.cxx | 4 +- .../TKGeomAlgo/Intf/Intf_Tool.cxx | 16 +- .../TKHLR/Contap/Contap_ArcFunction.cxx | 2 +- .../TKHLR/Contap/Contap_SurfFunction.cxx | 2 +- .../TKHLR/HLRAlgo/HLRAlgo_Projector.cxx | 2 +- .../TKHLR/HLRBRep/HLRBRep_Data.cxx | 4 +- .../HLRTopoBRep/HLRTopoBRep_FaceIsoLiner.cxx | 4 +- ...elixBRep_BuilderHelix_Integration_Test.cxx | 2 +- .../GTests/HelixBRep_BuilderHelix_Test.cxx | 6 +- .../GTests/HelixGeom_BuilderHelix_Test.cxx | 6 +- .../BRepOffset/BRepOffset_Inter2d.cxx | 8 +- .../BRepOffset/BRepOffset_MakeOffset.cxx | 12 +- .../BRepOffset_MakeSimpleOffset.cxx | 8 +- .../TKOffset/BRepOffset/BRepOffset_Offset.cxx | 24 +-- .../TKOffset/BRepOffset/BRepOffset_Tool.cxx | 8 +- .../BRepOffsetAPI_ThruSections.cxx | 16 +- .../TKPrim/BRepPrim/BRepPrim_Cone.cxx | 4 +- .../TKPrim/BRepPrim/BRepPrim_Cylinder.cxx | 6 +- .../TKPrim/BRepPrim/BRepPrim_FaceBuilder.cxx | 8 +- .../TKPrim/BRepPrim/BRepPrim_OneAxis.cxx | 58 ++++--- .../TKPrim/BRepPrim/BRepPrim_Sphere.cxx | 7 +- .../TKPrim/BRepPrim/BRepPrim_Torus.cxx | 4 +- .../BRepPrimAPI/BRepPrimAPI_MakeBox.cxx | 27 ++-- .../BRepPrimAPI_MakeRevolution.cxx | 6 +- .../BRepPrimAPI/BRepPrimAPI_MakeSphere.cxx | 8 +- .../BRepPrimAPI/BRepPrimAPI_MakeWedge.cxx | 4 +- .../BRepSweep/BRepSweep_Translation.cxx | 4 +- ...hapeAnalysis_CanonicalRecognition_Test.cxx | 28 ++-- .../ShapeBuild/ShapeBuild_Edge.cxx | 2 +- .../ShapeFix/ShapeFix_ComposeShell.cxx | 4 +- .../ShapeFix/ShapeFix_EdgeProjAux.cxx | 4 +- .../TKShHealing/ShapeFix/ShapeFix_Face.cxx | 4 +- .../TKShHealing/ShapeFix/ShapeFix_Wire.cxx | 2 +- .../BRepBuilderAPI_FastSewing.cxx | 40 ++--- .../BRepClass/BRepClass_FaceExplorer.cxx | 2 +- .../TKTopAlgo/BRepLib/BRepLib_MakeFace.cxx | 8 +- .../TKTopAlgo/BRepLib/BRepLib_MakeShell.cxx | 4 +- .../TKTopAlgo/Bisector/Bisector_BisecAna.cxx | 2 +- .../TKBRep/BinTools/BinTools_Curve2dSet.cxx | 10 +- .../TKBRep/BinTools/BinTools_CurveSet.cxx | 12 +- .../TKBRep/BinTools/BinTools_SurfaceSet.cxx | 6 +- .../TKG2d/GTests/Geom2d_OffsetCurve_Test.cxx | 2 +- .../TKG3d/Adaptor3d/Adaptor3d_TopolTool.cxx | 28 ++-- .../TKG3d/GTests/Geom_OffsetCurve_Test.cxx | 4 +- .../TKG3d/GTests/Geom_OffsetSurface_Test.cxx | 2 +- src/ModelingData/TKGeomBase/BndLib/BndLib.cxx | 30 ++-- .../TKGeomBase/Extrema/Extrema_ExtElC.cxx | 2 +- .../GTests/IntAna_IntQuadQuad_Test.cxx | 8 +- .../Geom2dConvert_ApproxArcsSegments.cxx | 2 +- .../GeomConvert/GeomConvert_Units.cxx | 2 +- .../GeomTools/GeomTools_Curve2dSet.cxx | 10 +- .../GeomTools/GeomTools_CurveSet.cxx | 12 +- .../GeomTools/GeomTools_SurfaceSet.cxx | 6 +- .../TKGeomBase/IntAna/IntAna_IntConicQuad.cxx | 2 +- .../ProjLib/ProjLib_CompProjectedCurve.cxx | 8 +- .../ProjLib/ProjLib_ComputeApprox.cxx | 2 +- .../TKGeomBase/gce/gce_MakeCirc.cxx | 8 +- .../TKGeomBase/gce/gce_MakeCirc2d.cxx | 6 +- .../MeshVS/MeshVS_NodalColorPrsBuilder.cxx | 2 +- .../MeshVS/MeshVS_VectorPrsBuilder.cxx | 2 +- .../GTests/Graphic3d_BndBox_Test.cxx | 2 +- .../TKService/Graphic3d/Graphic3d_Camera.cxx | 6 +- .../TKV3d/AIS/AIS_Manipulator.cxx | 4 +- src/Visualization/TKV3d/AIS/AIS_TextLabel.cxx | 2 +- .../DsgPrs_EqualDistancePresentation.cxx | 2 +- .../TKV3d/Prs3d/Prs3d_ToolDisk.hxx | 2 +- .../TKV3d/Prs3d/Prs3d_ToolSector.hxx | 2 +- .../SelectMgr_TriangularFrustumSet.cxx | 2 +- src/Visualization/TKV3d/V3d/V3d_Viewer.cxx | 2 +- tests/lowalgos/intss/bug24676 | 6 +- 203 files changed, 1169 insertions(+), 793 deletions(-) diff --git a/src/DataExchange/TKDEIGES/BRepToIGES/BRepToIGES_BRShell.cxx b/src/DataExchange/TKDEIGES/BRepToIGES/BRepToIGES_BRShell.cxx index d2e8a29502..14f60ca10c 100644 --- a/src/DataExchange/TKDEIGES/BRepToIGES/BRepToIGES_BRShell.cxx +++ b/src/DataExchange/TKDEIGES/BRepToIGES/BRepToIGES_BRShell.cxx @@ -172,7 +172,7 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRShell ::TransferFace(const TopoDS_Face& aSurf->Bounds(U1, U2, V1, V2); Standard_Real aCenter = 0.5 * (U1 + U2); gp_Trsf2d T; - gp_Ax2d axis(gp_Pnt2d(aCenter, V1), gp_Dir2d(0., 1.)); + gp_Ax2d axis(gp_Pnt2d(aCenter, V1), gp_Dir2d(gp_Dir2d::D::Y)); T.SetMirror(axis); NCollection_Map aMap(101, new NCollection_IncAllocator); for (ex.Init(start, TopAbs_EDGE); ex.More(); ex.Next()) diff --git a/src/DataExchange/TKDEIGES/GeomToIGES/GeomToIGES_GeomSurface.cxx b/src/DataExchange/TKDEIGES/GeomToIGES/GeomToIGES_GeomSurface.cxx index 3c34365c74..70733574b3 100644 --- a/src/DataExchange/TKDEIGES/GeomToIGES/GeomToIGES_GeomSurface.cxx +++ b/src/DataExchange/TKDEIGES/GeomToIGES/GeomToIGES_GeomSurface.cxx @@ -680,7 +680,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomSurface::TransferSurface( // creation of the generatrix : Generatrix Handle(Geom_Line) Ligne = - new Geom_Line(gp_Pnt(start->Cylinder().Radius(), 0.0, 0.0), gp_Dir(0.0, 0.0, 1.0)); + new Geom_Line(gp_Pnt(start->Cylinder().Radius(), 0.0, 0.0), gp_Dir(gp_Dir::D::Z)); GeomToIGES_GeomCurve GC(*this); Handle(IGESData_IGESEntity) Generatrix = GC.TransferCurve(Ligne, V1, V2); gp_Pnt gen1 = Ligne->Value(V1); diff --git a/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_CircularArc.cxx b/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_CircularArc.cxx index acbcfa7f9d..46a47ca9f4 100644 --- a/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_CircularArc.cxx +++ b/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_CircularArc.cxx @@ -122,7 +122,7 @@ Standard_Real IGESGeom_CircularArc::Angle() const gp_Dir IGESGeom_CircularArc::Axis() const { - gp_Dir axis(0.0, 0.0, 1.0); + gp_Dir axis(gp_Dir::D::Z); return axis; } diff --git a/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_ConicArc.cxx b/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_ConicArc.cxx index 0bbc19c46c..94006e0775 100644 --- a/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_ConicArc.cxx +++ b/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_ConicArc.cxx @@ -170,7 +170,7 @@ Standard_Boolean IGESGeom_ConicArc::IsClosed() const gp_Dir IGESGeom_ConicArc::Axis() const { - gp_Dir axis(0.0, 0.0, 1.0); + gp_Dir axis(gp_Dir::D::Z); return axis; } diff --git a/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_ToolConicArc.cxx b/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_ToolConicArc.cxx index b8f84d8128..8f3f4b5a9a 100644 --- a/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_ToolConicArc.cxx +++ b/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_ToolConicArc.cxx @@ -222,7 +222,7 @@ void IGESGeom_ToolConicArc::OwnCheck(const Handle(IGESGeom_ConicArc)& ent, { Standard_Real xc = -D / (2 * A); Standard_Real yc = -E / (2 * C); - gp_Dir2d d0(1, 0); + gp_Dir2d d0(gp_Dir2d::D::X); gp_Dir2d d1(ent->StartPoint().X() - xc, ent->StartPoint().Y() - yc); gp_Dir2d d2(ent->EndPoint().X() - xc, ent->EndPoint().Y() - yc); Standard_Real t1 = d0.Angle(d1); @@ -237,7 +237,7 @@ void IGESGeom_ToolConicArc::OwnCheck(const Handle(IGESGeom_ConicArc)& ent, { Standard_Real xc = -D / (2 * A); Standard_Real yc = -E / (2 * C); - gp_Dir2d d0(1, 0); + gp_Dir2d d0(gp_Dir2d::D::X); gp_Dir2d d1(ent->StartPoint().X() - xc, ent->StartPoint().Y() - yc); gp_Dir2d d2(ent->EndPoint().X() - xc, ent->EndPoint().Y() - yc); Standard_Real t1 = d0.Angle(d1); diff --git a/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_TopoSurface.cxx b/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_TopoSurface.cxx index b988f556a0..c386bff76f 100644 --- a/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_TopoSurface.cxx +++ b/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_TopoSurface.cxx @@ -1897,9 +1897,9 @@ TopoDS_Shape IGESToBRep_TopoSurface::ParamSurface(const Handle(IGESData_IGESEnti { DeclareAndCast(IGESGeom_CircularArc, circ, generatrix); gp_Pnt2d startpoint = circ->StartPoint(); - paramv -= - ElCLib::Parameter(gp_Circ2d(gp_Ax2d(circ->Center(), gp_Dir2d(1, 0)), circ->Radius()), - startpoint); + paramv -= ElCLib::Parameter( + gp_Circ2d(gp_Ax2d(circ->Center(), gp_Dir2d(gp_Dir2d::D::X)), circ->Radius()), + startpoint); if (Surf->IsKind(STANDARD_TYPE(Geom_SphericalSurface))) paramv += ShapeAnalysis::AdjustToPeriod(paramv, -M_PI, M_PI); else if (Surf->IsKind(STANDARD_TYPE(Geom_ToroidalSurface))) @@ -1914,9 +1914,9 @@ 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 -= ElCLib::Parameter( + gp_Circ2d(gp_Ax2d(circ->Center(), gp_Dir2d(gp_Dir2d::D::X)), circ->Radius()), + startpoint); paramu += ShapeAnalysis::AdjustToPeriod(paramu, 0, M_PI * 2); } } diff --git a/src/DataExchange/TKDESTEP/GeomToStep/GeomToStep_MakeAxis2Placement3d.cxx b/src/DataExchange/TKDESTEP/GeomToStep/GeomToStep_MakeAxis2Placement3d.cxx index 9a79ff4624..f3dd5f019d 100644 --- a/src/DataExchange/TKDESTEP/GeomToStep/GeomToStep_MakeAxis2Placement3d.cxx +++ b/src/DataExchange/TKDESTEP/GeomToStep/GeomToStep_MakeAxis2Placement3d.cxx @@ -61,7 +61,7 @@ static Handle(StepGeom_Axis2Placement3d) MakeAxis2Placement3d(const gp_Pnt& GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d( const StepData_Factors& theLocalFactors) { - gp_Ax2 A(gp_Pnt(0., 0., 0.), gp_Dir(0., 0., 1.), gp_Dir(1., 0., 0.)); + gp_Ax2 A(gp_Pnt(0., 0., 0.), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)); // le reste inchange Handle(StepGeom_Axis2Placement3d) Axe = MakeAxis2Placement3d(A.Location(), @@ -115,7 +115,7 @@ GeomToStep_MakeAxis2Placement3d::GeomToStep_MakeAxis2Placement3d( const gp_Trsf& T, const StepData_Factors& theLocalFactors) { - gp_Ax2 A(gp_Pnt(0., 0., 0.), gp_Dir(0., 0., 1.), gp_Dir(1., 0., 0.)); + gp_Ax2 A(gp_Pnt(0., 0., 0.), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)); A.Transform(T); // le reste inchange diff --git a/src/DataExchange/TKDESTEP/STEPControl/STEPControl_ActorRead.cxx b/src/DataExchange/TKDESTEP/STEPControl/STEPControl_ActorRead.cxx index 0f713e1c7f..91bb61904f 100644 --- a/src/DataExchange/TKDESTEP/STEPControl/STEPControl_ActorRead.cxx +++ b/src/DataExchange/TKDESTEP/STEPControl/STEPControl_ActorRead.cxx @@ -954,7 +954,7 @@ Handle(TransferBRep_ShapeBinder) STEPControl_ActorRead::TransferEntity( Handle(Geom_Axis2Placement) aTargAP = StepToGeom::MakeAxis2Placement(aCS, aLocalFactors); if (!aTargAP.IsNull()) { - const gp_Ax3 ax3Orig(gp_Pnt(0., 0., 0), gp_Vec(0., 0., 1.), gp_Vec(1., 0., 0.)); + const gp_Ax3 ax3Orig(gp_Pnt(0., 0., 0), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)); const gp_Ax3 ax3Targ(aTargAP->Ax2()); if (ax3Targ.Location().SquareDistance(ax3Orig.Location()) < Precision::SquareConfusion() && ax3Targ.Direction().IsEqual(ax3Orig.Direction(), Precision::Angular()) diff --git a/src/DataExchange/TKDESTEP/StepToGeom/StepToGeom.cxx b/src/DataExchange/TKDESTEP/StepToGeom/StepToGeom.cxx index 132d82aa1b..4a41610022 100644 --- a/src/DataExchange/TKDESTEP/StepToGeom/StepToGeom.cxx +++ b/src/DataExchange/TKDESTEP/StepToGeom/StepToGeom.cxx @@ -148,7 +148,7 @@ Handle(Geom_Axis1Placement) StepToGeom::MakeAxis1Placement( { // sln 22.10.2001. CTS23496: If problems with creation of axis direction occur default direction // is used - gp_Dir D(0., 0., 1.); + gp_Dir D(gp_Dir::D::Z); if (SA->HasAxis()) { Handle(Geom_Direction) D1 = MakeDirection(SA->Axis()); @@ -175,7 +175,7 @@ Handle(Geom_Axis2Placement) StepToGeom::MakeAxis2Placement( // sln 22.10.2001. CTS23496: If problems with creation of direction occur default direction is // used (MakeLine(...) function) - gp_Dir Ngp(0., 0., 1.); + gp_Dir Ngp(gp_Dir::D::Z); if (SA->HasAxis()) { Handle(Geom_Direction) D = MakeDirection(SA->Axis()); @@ -246,7 +246,7 @@ Handle(Geom2d_AxisPlacement) StepToGeom::MakeAxisPlacement( { // sln 23.10.2001. CTS23496: If problems with creation of direction occur default direction is // used - gp_Dir2d Vxgp(1., 0.); + gp_Dir2d Vxgp(gp_Dir2d::D::X); if (SA->HasRefDirection()) { Handle(Geom2d_Direction) Vx = MakeDirection2d(SA->RefDirection()); @@ -2065,7 +2065,7 @@ Standard_Boolean StepToGeom::MakeTransformation2d( Handle(Geom2d_CartesianPoint) CP = MakeCartesianPoint2d(SCTO->LocalOrigin(), theLocalFactors); if (!CP.IsNull()) { - gp_Dir2d D1(1., 0.); + gp_Dir2d D1(gp_Dir2d::D::X); // sln 23.10.2001. CTS23496: If problems with creation of direction occur default direction is // used const Handle(StepGeom_Direction) A = SCTO->Axis1(); @@ -2097,7 +2097,7 @@ Standard_Boolean StepToGeom::MakeTransformation3d( // sln 23.10.2001. CTS23496: If problems with creation of direction occur default direction is // used - gp_Dir D1(1., 0., 0.); + gp_Dir D1(gp_Dir::D::X); const Handle(StepGeom_Direction) A1 = SCTO->Axis1(); if (!A1.IsNull()) { @@ -2106,7 +2106,7 @@ Standard_Boolean StepToGeom::MakeTransformation3d( D1 = D->Dir(); } - gp_Dir D2(0., 1., 0.); + gp_Dir D2(gp_Dir::D::Y); const Handle(StepGeom_Direction) A2 = SCTO->Axis2(); if (!A2.IsNull()) { diff --git a/src/DataExchange/TKDESTL/GTests/DESTL_Provider_Test.cxx b/src/DataExchange/TKDESTL/GTests/DESTL_Provider_Test.cxx index 7a0422530c..15a018ac90 100644 --- a/src/DataExchange/TKDESTL/GTests/DESTL_Provider_Test.cxx +++ b/src/DataExchange/TKDESTL/GTests/DESTL_Provider_Test.cxx @@ -94,7 +94,7 @@ protected: Handle(Poly_Triangulation) aTriangulation = new Poly_Triangulation(aNodes, aTriangles); // Create a simple planar face - gp_Pln aPlane(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(0, 0, 1)); + gp_Pln aPlane(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(gp_Dir::D::Z)); BRepBuilderAPI_MakeFace aFaceBuilder(aPlane, 0.0, 10.0, 0.0, 10.0); if (!aFaceBuilder.IsDone()) @@ -510,7 +510,7 @@ TEST_F(DESTL_ProviderTest, MultipleTriangulatedFaces) Handle(Poly_Triangulation) aTriangulation = new Poly_Triangulation(aNodes, aTriangles); - gp_Pln aPlane(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(0, 0, 1)); + gp_Pln aPlane(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(gp_Dir::D::Z)); BRepBuilderAPI_MakeFace aFaceBuilder(aPlane, 0.0, 5.0, 0.0, 5.0); TopoDS_Face aTriangleFace = aFaceBuilder.Face(); diff --git a/src/DataExchange/TKDEVRML/GTests/DEVRML_Provider_Test.cxx b/src/DataExchange/TKDEVRML/GTests/DEVRML_Provider_Test.cxx index 1328e61dce..50f25a8ecd 100644 --- a/src/DataExchange/TKDEVRML/GTests/DEVRML_Provider_Test.cxx +++ b/src/DataExchange/TKDEVRML/GTests/DEVRML_Provider_Test.cxx @@ -95,7 +95,7 @@ protected: Handle(Poly_Triangulation) aTriangulation = new Poly_Triangulation(aNodes, aTriangles); // Create a simple planar face - gp_Pln aPlane(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(0, 0, 1)); + gp_Pln aPlane(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(gp_Dir::D::Z)); BRepBuilderAPI_MakeFace aFaceBuilder(aPlane, 0.0, 10.0, 0.0, 10.0); if (!aFaceBuilder.IsDone()) diff --git a/src/DataExchange/TKDEVRML/VrmlConverter/VrmlConverter_Projector.cxx b/src/DataExchange/TKDEVRML/VrmlConverter/VrmlConverter_Projector.cxx index 2796122b2f..13168e2356 100644 --- a/src/DataExchange/TKDEVRML/VrmlConverter/VrmlConverter_Projector.cxx +++ b/src/DataExchange/TKDEVRML/VrmlConverter/VrmlConverter_Projector.cxx @@ -170,8 +170,8 @@ VrmlConverter_Projector::VrmlConverter_Projector(const TopTools_Array1OfShape& { /* - gp_Dir Zmain (0,0,1); - gp_Dir Xmain (1,0,0); + gp_Dir Zmain (gp_Dir::D::Z); + gp_Dir Xmain (gp_Dir::D::X); gp_Dir Dturn; diff --git a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Geometry.cxx b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Geometry.cxx index 52832b38b4..28969a0100 100644 --- a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Geometry.cxx +++ b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Geometry.cxx @@ -127,7 +127,7 @@ const Handle(TopoDS_TShape)& VrmlData_Cone::TShape() { try { - gp_Ax2 aLocalAxis(gp_Pnt(0., -0.5 * myHeight, 0.), gp_Dir(0., 1., 0.)); + gp_Ax2 aLocalAxis(gp_Pnt(0., -0.5 * myHeight, 0.), gp_Dir(gp_Dir::D::Y)); BRepPrim_Cone aBuilder(aLocalAxis, myBottomRadius, 0., myHeight); if (!myHasBottom) myTShape = aBuilder.LateralFace().TShape(); @@ -241,7 +241,7 @@ const Handle(TopoDS_TShape)& VrmlData_Cylinder::TShape() { try { - gp_Ax2 aLocalAxis(gp_Pnt(0., -0.5 * myHeight, 0.), gp_Dir(0., 1., 0.)); + gp_Ax2 aLocalAxis(gp_Pnt(0., -0.5 * myHeight, 0.), gp_Dir(gp_Dir::D::Y)); BRepPrim_Cylinder aBuilder(aLocalAxis, myRadius, myHeight); BRepPrim_Builder aShapeBuilder; TopoDS_Shell aShell; diff --git a/src/Draw/TKDCAF/DNaming/DNaming_SphereDriver.cxx b/src/Draw/TKDCAF/DNaming/DNaming_SphereDriver.cxx index 665613c478..353052a648 100644 --- a/src/Draw/TKDCAF/DNaming/DNaming_SphereDriver.cxx +++ b/src/Draw/TKDCAF/DNaming/DNaming_SphereDriver.cxx @@ -105,7 +105,7 @@ Standard_Integer DNaming_SphereDriver::Execute(Handle(TFunction_Logbook)& theLog { aCenter = BRep_Tool::Pnt(TopoDS::Vertex(aCntShape)); } - gp_Ax2 anAxis = gp_Ax2(aCenter, gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)); + gp_Ax2 anAxis = gp_Ax2(aCenter, gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)); BRepPrimAPI_MakeSphere aMakeSphere(anAxis, aRadius); aMakeSphere.Build(); diff --git a/src/Draw/TKDraw/DBRep/DBRep_IsoBuilder.cxx b/src/Draw/TKDraw/DBRep/DBRep_IsoBuilder.cxx index 9b06e44855..2d8ac4582b 100644 --- a/src/Draw/TKDraw/DBRep/DBRep_IsoBuilder.cxx +++ b/src/Draw/TKDraw/DBRep/DBRep_IsoBuilder.cxx @@ -226,7 +226,7 @@ DBRep_IsoBuilder::DBRep_IsoBuilder(const TopoDS_Face& TopologicalFace, if (StepU > confusion) { Standard_Real UPrm = myUMin + StepU / 2.; - gp_Dir2d Dir(0., 1.); + gp_Dir2d Dir(gp_Dir2d::D::Y); for (IIso = 1; IIso <= NbIsos; IIso++) { myUPrm(IIso) = UPrm; @@ -241,7 +241,7 @@ DBRep_IsoBuilder::DBRep_IsoBuilder(const TopoDS_Face& TopologicalFace, if (StepV > confusion) { Standard_Real VPrm = myVMin + StepV / 2.; - gp_Dir2d Dir(1., 0.); + gp_Dir2d Dir(gp_Dir2d::D::X); for (IIso = 1; IIso <= NbIsos; IIso++) { myVPrm(IIso) = VPrm; diff --git a/src/Draw/TKDraw/Draw/Draw_Axis2D.cxx b/src/Draw/TKDraw/Draw/Draw_Axis2D.cxx index 3b09cf39eb..562433b236 100644 --- a/src/Draw/TKDraw/Draw/Draw_Axis2D.cxx +++ b/src/Draw/TKDraw/Draw/Draw_Axis2D.cxx @@ -29,7 +29,7 @@ extern Standard_Boolean Draw_Bounds; //================================================================================================= Draw_Axis2D::Draw_Axis2D(const Draw_Color& col, const Standard_Integer Size) - : myAxes(gp_Pnt2d(0, 0), gp_Dir2d(1, 0)), + : myAxes(gp_Pnt2d(0, 0), gp_Dir2d(gp_Dir2d::D::X)), myColor(col), mySize(Size) { @@ -38,7 +38,7 @@ Draw_Axis2D::Draw_Axis2D(const Draw_Color& col, const Standard_Integer Size) //================================================================================================= Draw_Axis2D::Draw_Axis2D(const gp_Pnt2d& p, const Draw_Color& col, const Standard_Integer Size) - : myAxes(p, gp_Dir2d(1, 0)), + : myAxes(p, gp_Dir2d(gp_Dir2d::D::X)), myColor(col), mySize(Size) { diff --git a/src/Draw/TKDraw/Draw/Draw_View.cxx b/src/Draw/TKDraw/Draw/Draw_View.cxx index ea3aaf001f..3fd50f709d 100644 --- a/src/Draw/TKDraw/Draw/Draw_View.cxx +++ b/src/Draw/TKDraw/Draw/Draw_View.cxx @@ -111,23 +111,23 @@ Standard_Boolean Draw_View::Init(const char* theType) } else if (!strcmp("-Y+X", theType)) { - const gp_Dir aD(0., 0., 1.); + const gp_Dir aD(gp_Dir::D::Z); myMatrix.SetRotation(gp_Ax1(Pvise, aD), 0.5 * M_PI); } else if (!strcmp("-X-Y", theType)) { - const gp_Dir aD(0., 0., 1.); + const gp_Dir aD(gp_Dir::D::Z); myMatrix.SetRotation(gp_Ax1(Pvise, aD), M_PI); } else if (!strcmp("+Y-X", theType)) { - const gp_Dir aD(0., 0., 1.); + const gp_Dir aD(gp_Dir::D::Z); myMatrix.SetRotation(gp_Ax1(Pvise, aD), -0.5 * M_PI); } else if (!strcmp("+Y+X", theType)) { - const gp_Dir aD1(0., 0., 1.); - const gp_Dir aD2(0., 1., 0.); + const gp_Dir aD1(gp_Dir::D::Z); + const gp_Dir aD2(gp_Dir::D::Y); myMatrix.SetRotation(gp_Ax1(Pvise, aD1), -0.5 * M_PI); aRotation.SetRotation(gp_Ax1(Pvise, aD2), M_PI); @@ -135,13 +135,13 @@ Standard_Boolean Draw_View::Init(const char* theType) } else if (!strcmp("-X+Y", theType)) { - const gp_Dir aD(0., 1., 0.); + const gp_Dir aD(gp_Dir::D::Y); myMatrix.SetRotation(gp_Ax1(Pvise, aD), M_PI); } else if (!strcmp("-Y-X", theType)) { - const gp_Dir aD1(0., 0., 1.); - const gp_Dir aD2(1., 0., 0.); + const gp_Dir aD1(gp_Dir::D::Z); + const gp_Dir aD2(gp_Dir::D::X); myMatrix.SetRotation(gp_Ax1(Pvise, aD1), -0.5 * M_PI); aRotation.SetRotation(gp_Ax1(Pvise, aD2), M_PI); @@ -149,18 +149,18 @@ Standard_Boolean Draw_View::Init(const char* theType) } else if (!strcmp("+X-Y", theType)) { - const gp_Dir aD(1., 0., 0.); + const gp_Dir aD(gp_Dir::D::X); myMatrix.SetRotation(gp_Ax1(Pvise, aD), M_PI); } else if (!strcmp("+X+Z", theType)) { - const gp_Dir aD(1., 0., 0.); + const gp_Dir aD(gp_Dir::D::X); myMatrix.SetRotation(gp_Ax1(Pvise, aD), -0.5 * M_PI); } else if (!strcmp("-Z+X", theType)) { - const gp_Dir aD1(1., 0., 0.); - const gp_Dir aD2(0., 1., 0.); + const gp_Dir aD1(gp_Dir::D::X); + const gp_Dir aD2(gp_Dir::D::Y); myMatrix.SetRotation(gp_Ax1(Pvise, aD1), -0.5 * M_PI); aRotation.SetRotation(gp_Ax1(Pvise, aD2), -0.5 * M_PI); @@ -168,8 +168,8 @@ Standard_Boolean Draw_View::Init(const char* theType) } else if (!strcmp("-X-Z", theType)) { - const gp_Dir aD1(1., 0., 0.); - const gp_Dir aD2(0., 1., 0.); + const gp_Dir aD1(gp_Dir::D::X); + const gp_Dir aD2(gp_Dir::D::Y); myMatrix.SetRotation(gp_Ax1(Pvise, aD1), -0.5 * M_PI); aRotation.SetRotation(gp_Ax1(Pvise, aD2), -M_PI); @@ -177,8 +177,8 @@ Standard_Boolean Draw_View::Init(const char* theType) } else if (!strcmp("+Z-X", theType)) { - const gp_Dir aD1(1., 0., 0.); - const gp_Dir aD2(0., 1., 0.); + const gp_Dir aD1(gp_Dir::D::X); + const gp_Dir aD2(gp_Dir::D::Y); myMatrix.SetRotation(gp_Ax1(Pvise, aD1), -0.5 * M_PI); aRotation.SetRotation(gp_Ax1(Pvise, aD2), 0.5 * M_PI); @@ -186,8 +186,8 @@ Standard_Boolean Draw_View::Init(const char* theType) } else if (!strcmp("+Z+X", theType)) { - const gp_Dir aD1(1., 0., 0.); - const gp_Dir aD2(0., 1., 0.); + const gp_Dir aD1(gp_Dir::D::X); + const gp_Dir aD2(gp_Dir::D::Y); myMatrix.SetRotation(gp_Ax1(Pvise, aD1), 0.5 * M_PI); aRotation.SetRotation(gp_Ax1(Pvise, aD2), 0.5 * M_PI); @@ -195,8 +195,8 @@ Standard_Boolean Draw_View::Init(const char* theType) } else if (!strcmp("-X+Z", theType)) { - const gp_Dir aD1(1., 0., 0.); - const gp_Dir aD2(0., 1., 0.); + const gp_Dir aD1(gp_Dir::D::X); + const gp_Dir aD2(gp_Dir::D::Y); myMatrix.SetRotation(gp_Ax1(Pvise, aD1), 0.5 * M_PI); aRotation.SetRotation(gp_Ax1(Pvise, aD2), M_PI); @@ -204,8 +204,8 @@ Standard_Boolean Draw_View::Init(const char* theType) } else if (!strcmp("-Z-X", theType)) { - const gp_Dir aD1(1., 0., 0.); - const gp_Dir aD2(0., 1., 0.); + const gp_Dir aD1(gp_Dir::D::X); + const gp_Dir aD2(gp_Dir::D::Y); myMatrix.SetRotation(gp_Ax1(Pvise, aD1), 0.5 * M_PI); aRotation.SetRotation(gp_Ax1(Pvise, aD2), -0.5 * M_PI); @@ -213,13 +213,13 @@ Standard_Boolean Draw_View::Init(const char* theType) } else if (!strcmp("+X-Z", theType)) { - const gp_Dir aD(1., 0., 0.); + const gp_Dir aD(gp_Dir::D::X); myMatrix.SetRotation(gp_Ax1(Pvise, aD), 0.5 * M_PI); } else if (!strcmp("+Y+Z", theType)) { - const gp_Dir aD1(0., 1., 0.); - const gp_Dir aD2(1., 0., 0.); + const gp_Dir aD1(gp_Dir::D::Y); + const gp_Dir aD2(gp_Dir::D::X); myMatrix.SetRotation(gp_Ax1(Pvise, aD1), -0.5 * M_PI); aRotation.SetRotation(gp_Ax1(Pvise, aD2), -0.5 * M_PI); @@ -227,13 +227,13 @@ Standard_Boolean Draw_View::Init(const char* theType) } else if (!strcmp("-Z+Y", theType)) { - const gp_Dir aD(0., 1., 0.); + const gp_Dir aD(gp_Dir::D::Y); myMatrix.SetRotation(gp_Ax1(Pvise, aD), -0.5 * M_PI); } else if (!strcmp("-Y-Z", theType)) { - const gp_Dir aD1(0., 1., 0.); - const gp_Dir aD2(1., 0., 0.); + const gp_Dir aD1(gp_Dir::D::Y); + const gp_Dir aD2(gp_Dir::D::X); myMatrix.SetRotation(gp_Ax1(Pvise, aD1), -0.5 * M_PI); aRotation.SetRotation(gp_Ax1(Pvise, aD2), 0.5 * M_PI); @@ -241,8 +241,8 @@ Standard_Boolean Draw_View::Init(const char* theType) } else if (!strcmp("+Z-Y", theType)) { - const gp_Dir aD1(0., 1., 0.); - const gp_Dir aD2(1., 0., 0.); + const gp_Dir aD1(gp_Dir::D::Y); + const gp_Dir aD2(gp_Dir::D::X); myMatrix.SetRotation(gp_Ax1(Pvise, aD1), -0.5 * M_PI); aRotation.SetRotation(gp_Ax1(Pvise, aD2), M_PI); @@ -250,13 +250,13 @@ Standard_Boolean Draw_View::Init(const char* theType) } else if (!strcmp("+Z+Y", theType)) { - const gp_Dir aD(0., 1., 0.); + const gp_Dir aD(gp_Dir::D::Y); myMatrix.SetRotation(gp_Ax1(Pvise, aD), 0.5 * M_PI); } else if (!strcmp("-Y+Z", theType)) { - const gp_Dir aD1(0., 1., 0.); - const gp_Dir aD2(1., 0., 0.); + const gp_Dir aD1(gp_Dir::D::Y); + const gp_Dir aD2(gp_Dir::D::X); myMatrix.SetRotation(gp_Ax1(Pvise, aD1), 0.5 * M_PI); aRotation.SetRotation(gp_Ax1(Pvise, aD2), -0.5 * M_PI); @@ -264,8 +264,8 @@ Standard_Boolean Draw_View::Init(const char* theType) } else if (!strcmp("-Z-Y", theType)) { - const gp_Dir aD1(0., 1., 0.); - const gp_Dir aD2(1., 0., 0.); + const gp_Dir aD1(gp_Dir::D::Y); + const gp_Dir aD2(gp_Dir::D::X); myMatrix.SetRotation(gp_Ax1(Pvise, aD1), 0.5 * M_PI); aRotation.SetRotation(gp_Ax1(Pvise, aD2), M_PI); @@ -273,8 +273,8 @@ Standard_Boolean Draw_View::Init(const char* theType) } else if (!strcmp("+Y-Z", theType)) { - const gp_Dir aD1(0., 1., 0.); - const gp_Dir aD2(1., 0., 0.); + const gp_Dir aD1(gp_Dir::D::Y); + const gp_Dir aD2(gp_Dir::D::X); myMatrix.SetRotation(gp_Ax1(Pvise, aD1), 0.5 * M_PI); aRotation.SetRotation(gp_Ax1(Pvise, aD2), 0.5 * M_PI); @@ -282,8 +282,8 @@ Standard_Boolean Draw_View::Init(const char* theType) } else if (!strcmp("AXON", theType)) { - const gp_Dir aD1(1., 0., 0.); - const gp_Dir aD2(0., 0., 1.); + const gp_Dir aD1(gp_Dir::D::X); + const gp_Dir aD2(gp_Dir::D::Z); myMatrix.SetRotation(gp_Ax1(Pvise, aD1), -0.25 * M_PI); aRotation.SetRotation(gp_Ax1(Pvise, aD2), -0.25 * M_PI); @@ -291,8 +291,8 @@ Standard_Boolean Draw_View::Init(const char* theType) } else if (!strcmp("PERS", theType)) { - const gp_Dir aD1(1., 0., 0.); - const gp_Dir aD2(0., 0., 1.); + const gp_Dir aD1(gp_Dir::D::X); + const gp_Dir aD2(gp_Dir::D::Z); myMatrix.SetRotation(gp_Ax1(Pvise, aD1), -0.25 * M_PI); aRotation.SetRotation(gp_Ax1(Pvise, aD2), -0.25 * M_PI); diff --git a/src/Draw/TKQADraw/QABugs/QABugs_10.cxx b/src/Draw/TKQADraw/QABugs/QABugs_10.cxx index 278320935e..4a79b9ec88 100644 --- a/src/Draw/TKQADraw/QABugs/QABugs_10.cxx +++ b/src/Draw/TKQADraw/QABugs/QABugs_10.cxx @@ -382,7 +382,7 @@ static Standard_Integer OCC712(Draw_Interpretor& di, Standard_Integer argc, cons try { OCC_CATCH_SIGNALS - gp_Dir slabDir(0, 0, 1); + gp_Dir slabDir(gp_Dir::D::Z); gp_Vec slabVect(slabDir); slabVect *= slabThick; @@ -494,7 +494,7 @@ static Standard_Integer OCC822_1(Draw_Interpretor& di, Standard_Integer argc, co int index = 1; gp_Pnt P1(0, 0, 0); - gp_Dir D1(0, 0, 1); + gp_Dir D1(gp_Dir::D::Z); gp_Ax2 A1(P1, D1); BRepPrimAPI_MakeCylinder cylMakerIn(A1, 40, 110); @@ -503,7 +503,7 @@ static Standard_Integer OCC822_1(Draw_Interpretor& di, Standard_Integer argc, co TopoDS_Shape cylOut = cylMakerOut.Shape(); gp_Pnt P2(0, 0, 0); - gp_Dir D2(0, 0, -1); + gp_Dir D2(gp_Dir::D::NZ); gp_Ax2 A2(P2, D2); BRepPrimAPI_MakeCone conMakerIn(A2, 40, 60, 110); @@ -563,8 +563,8 @@ static Standard_Integer OCC822_2(Draw_Interpretor& di, Standard_Integer argc, co int index = 1; - gp_Dir xDir(1, 0, 0); - gp_Dir zDir(0, 0, 1); + gp_Dir xDir(gp_Dir::D::X); + gp_Dir zDir(gp_Dir::D::Z); gp_Pnt cen1(0, 0, 0); gp_Ax2 cor1(cen1, zDir, xDir); BRepPrimAPI_MakeBox boxMaker(cor1, 100, 100, 100); @@ -678,7 +678,7 @@ static Standard_Integer OCC824(Draw_Interpretor& di, Standard_Integer argc, cons int index = 1; gp_Pnt P1(100, 0, 0); - gp_Dir D1(-1, 0, 0); + gp_Dir D1(gp_Dir::D::NX); gp_Ax2 A1(P1, D1); BRepPrimAPI_MakeCylinder mkCyl(A1, 20, 100); TopoDS_Shape cyl = mkCyl.Shape(); @@ -1091,7 +1091,7 @@ static Standard_Integer OCC828(Draw_Interpretor& di, Standard_Integer argc, cons try { OCC_CATCH_SIGNALS - gp_Dir slabDir(0, 0, 1); + gp_Dir slabDir(gp_Dir::D::Z); gp_Vec slabVect(slabDir); slabVect *= slabThick; diff --git a/src/Draw/TKQADraw/QABugs/QABugs_11.cxx b/src/Draw/TKQADraw/QABugs/QABugs_11.cxx index 28a14f40b8..a99f686e4e 100644 --- a/src/Draw/TKQADraw/QABugs/QABugs_11.cxx +++ b/src/Draw/TKQADraw/QABugs/QABugs_11.cxx @@ -605,8 +605,6 @@ static Standard_Integer OCC297(Draw_Interpretor& di, Standard_Integer /*argc*/, DBRep::Set("Face", sol1_); - gp_Ax1 ax1_(gp_Pnt(0., 0., -100.), gp_Dir(0., 0., 1.)); - Standard_Real x = 0., y = 0., z = -80.; BRepPrimAPI_MakeBox box(gp_Pnt(x, y, z), gp_Pnt(x + 150, y + 200, z + 200)); @@ -1422,7 +1420,7 @@ static Standard_Integer OCC578(Draw_Interpretor& di, Standard_Integer argc, cons // 0.1, 0.1 , 0.4, 0.4 ); TopoDS_Shape wedge1 = BRepPrimAPI_MakeWedge(0.5, 0.05, 0.5, 0.1, 0.1, 0.4, 0.4).Shape(); - gp_Trsf rotate = gce_MakeRotation(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(1.0, 0.0, 0.0), 1.570795); + gp_Trsf rotate = gce_MakeRotation(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(gp_Dir::D::X), 1.570795); gp_Trsf translate = gce_MakeTranslation(gp_Pnt(0.0, -0.5, 0.0), gp_Pnt(0.25, 0.25, 0.5)); @@ -1444,7 +1442,7 @@ static Standard_Integer OCC578(Draw_Interpretor& di, Standard_Integer argc, cons // 0.1, 0.1 , 0.4, 0.4 ); TopoDS_Shape wedge2 = BRepPrimAPI_MakeWedge(0.5, 0.3, 0.5, 0.1, 0.1, 0.4, 0.4).Shape(); - gp_Trsf rotate2 = gce_MakeRotation(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(1.0, 0.0, 0.0), 1.570795 * 3.0); + gp_Trsf rotate2 = gce_MakeRotation(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(gp_Dir::D::X), 1.570795 * 3.0); gp_Trsf translate2 = gce_MakeTranslation(gp_Pnt(0.0, 0.0, 0.0), gp_Pnt(0.25, 0.25, 0.5)); @@ -1971,8 +1969,8 @@ static Standard_Integer OCC1487(Draw_Interpretor& di, Standard_Integer argc, con Standard_Integer CaseNumber = Draw::Atoi(argv[1]); - // BRepPrimAPI_MakeCylinder o_mc1 (gp_Ax2 (gp_Pnt(0,-50,140), gp_Dir(1,0,0)), 50,1000); - gp_Dir myDir(1, 0, 0); + // BRepPrimAPI_MakeCylinder o_mc1 (gp_Ax2 (gp_Pnt(0,-50,140), gp_Dir(gp_Dir::D::X)), 50,1000); + gp_Dir myDir(gp_Dir::D::X); gp_Pnt myPnt(0, -50, 140); gp_Ax2 myAx2(myPnt, myDir); BRepPrimAPI_MakeCylinder o_mc1(myAx2, 50, 1000); @@ -2090,11 +2088,11 @@ TopoDS_Shape OCC1077_Bug() TopoDS_Shape theCommon = BRepAlgoAPI_Common(theBox, theSphere); TopoDS_Shape theCylinder1 = - BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(0, 0, -10), gp_Dir(0, 0, 1)), 3, 20).Shape(); + BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(0, 0, -10), gp_Dir(gp_Dir::D::Z)), 3, 20).Shape(); TopoDS_Shape theCylinder2 = - BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(-10, 0, 0), gp_Dir(1, 0, 0)), 3, 20).Shape(); + BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(-10, 0, 0), gp_Dir(gp_Dir::D::X)), 3, 20).Shape(); TopoDS_Shape theCylinder3 = - BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(0, -10, 0), gp_Dir(0, 1, 0)), 3, 20).Shape(); + BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(0, -10, 0), gp_Dir(gp_Dir::D::Y)), 3, 20).Shape(); TopoDS_Shape theTmp1 = OCC1077_cut_blend(theCommon, theCylinder1, 0.7); Handle(ShapeFix_Shape) fixer = new ShapeFix_Shape(theTmp1); fixer->Perform(); diff --git a/src/Draw/TKQADraw/QABugs/QABugs_14.cxx b/src/Draw/TKQADraw/QABugs/QABugs_14.cxx index 0a74b58bdb..9b7f99d8aa 100644 --- a/src/Draw/TKQADraw/QABugs/QABugs_14.cxx +++ b/src/Draw/TKQADraw/QABugs/QABugs_14.cxx @@ -66,7 +66,7 @@ static Standard_Integer BUC60897(Draw_Interpretor& di, { Standard_Character abuf[16]; - Handle(Geom2d_Line) aLine = new Geom2d_Line(gp_Pnt2d(100, 0), gp_Dir2d(-1, 0)); + Handle(Geom2d_Line) aLine = new Geom2d_Line(gp_Pnt2d(100, 0), gp_Dir2d(gp_Dir2d::D::NX)); Sprintf(abuf, "line"); Standard_CString st = abuf; DrawTrSurf::Set(st, aLine); diff --git a/src/Draw/TKQADraw/QABugs/QABugs_16.cxx b/src/Draw/TKQADraw/QABugs/QABugs_16.cxx index bfc0beac36..50d39e7ca4 100644 --- a/src/Draw/TKQADraw/QABugs/QABugs_16.cxx +++ b/src/Draw/TKQADraw/QABugs/QABugs_16.cxx @@ -140,7 +140,7 @@ static Standard_Integer BUC60814(Draw_Interpretor& di, Standard_Integer argc, co // Circle gp_Pnt P(10, 10, 10); - gp_Dir V(1, 0, 0); + gp_Dir V(gp_Dir::D::X); gp_Ax2 aAx2(P, V); Handle(Geom_Circle) ahCircle = new Geom_Circle(aAx2, 20); @@ -676,7 +676,7 @@ static Standard_Integer OCC301(Draw_Interpretor& di, Standard_Integer argc, cons context->Display(new AIS_Shape(E2), Standard_True); gp_Pnt plnpt(0, 0, 0); - gp_Dir plndir(0, 0, 1); + gp_Dir plndir(gp_Dir::D::Z); Handle(Geom_Plane) pln = new Geom_Plane(plnpt, plndir); Handle(PrsDim_AngleDimension) anAngleDimension = diff --git a/src/Draw/TKQADraw/QABugs/QABugs_17.cxx b/src/Draw/TKQADraw/QABugs/QABugs_17.cxx index 092a74705e..1a56be126a 100644 --- a/src/Draw/TKQADraw/QABugs/QABugs_17.cxx +++ b/src/Draw/TKQADraw/QABugs/QABugs_17.cxx @@ -294,7 +294,7 @@ static Standard_Integer BUC60915_1(Draw_Interpretor& di, Standard_Integer argc, TopoDS_Vertex V7 = BRepBuilderAPI_MakeVertex(p7); TopoDS_Vertex V8 = BRepBuilderAPI_MakeVertex(p8); gp_Pnt plnpt(0, 0, 0); - gp_Dir plndir(0, 0, 1); + gp_Dir plndir(gp_Dir::D::Z); Handle(Geom_Plane) pln = new Geom_Plane(plnpt, plndir); Handle(Prs3d_DimensionAspect) anAspect = new Prs3d_DimensionAspect(); anAspect->MakeArrows3d(Standard_True); @@ -323,7 +323,7 @@ static Standard_Integer BUC60915_1(Draw_Interpretor& di, Standard_Integer argc, /***************************************/ // dimension "R 88.58" /***************************************/ - gp_Circ cir = gp_Circ(gp_Ax2(gp_Pnt(191.09, -88.58, 0), gp_Dir(0, 0, 1)), 88.58); + gp_Circ cir = gp_Circ(gp_Ax2(gp_Pnt(191.09, -88.58, 0), gp_Dir(gp_Dir::D::Z)), 88.58); TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(cir, gp_Pnt(191.09, 0, 0.), gp_Pnt(191.09, -177.16, 0.)); Handle(PrsDim_RadiusDimension) dim1 = new PrsDim_RadiusDimension(E1); dim1->SetDimensionAspect(anAspect); @@ -331,7 +331,7 @@ static Standard_Integer BUC60915_1(Draw_Interpretor& di, Standard_Integer argc, /***************************************/ // dimension "R 43.80" /***************************************/ - gp_Circ cir1 = gp_Circ(gp_Ax2(gp_Pnt(191.09, -88.58, 0), gp_Dir(0, 0, 1)), 43.80); + gp_Circ cir1 = gp_Circ(gp_Ax2(gp_Pnt(191.09, -88.58, 0), gp_Dir(gp_Dir::D::Z)), 43.80); TopoDS_Edge E_cir1 = BRepBuilderAPI_MakeEdge(cir1); dim1 = new PrsDim_RadiusDimension(E_cir1); anAspect->ArrowAspect()->SetLength(60.0); @@ -340,7 +340,7 @@ static Standard_Integer BUC60915_1(Draw_Interpretor& di, Standard_Integer argc, /***************************************/ // dimension "R 17.86" /***************************************/ - gp_Circ cir2 = gp_Circ(gp_Ax2(gp_Pnt(566.11, -88.58, 0), gp_Dir(0, 0, -1)), 17.86); + gp_Circ cir2 = gp_Circ(gp_Ax2(gp_Pnt(566.11, -88.58, 0), gp_Dir(gp_Dir::D::NZ)), 17.86); TopoDS_Edge E_cir2 = BRepBuilderAPI_MakeEdge(cir2); dim1 = new PrsDim_RadiusDimension(E_cir2); anAspect->ArrowAspect()->SetLength(40.0); @@ -416,13 +416,13 @@ static int geom_get_2Dpt_from_3Dpt(const gp_Pnt& pnt3d, const gp_Pln& pln, gp_Pn static Standard_Integer OCC353(Draw_Interpretor& di, Standard_Integer, const char**) { - gp_Ax2 ax21(gp_Pnt(100, 0, 0), gp_Dir(0, 0, 1)); + gp_Ax2 ax21(gp_Pnt(100, 0, 0), gp_Dir(gp_Dir::D::Z)); Handle(Geom_Circle) h_cir1 = new Geom_Circle(ax21, 25); - gp_Ax2 ax22(gp_Pnt(-100, 0, 0), gp_Dir(0, 0, 1)); + gp_Ax2 ax22(gp_Pnt(-100, 0, 0), gp_Dir(gp_Dir::D::Z)); Handle(Geom_Circle) h_cir2 = new Geom_Circle(ax22, 25); - gp_Pln refpln(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + gp_Pln refpln(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); Handle(Geom2d_Curve) cir2d1 = GeomAPI::To2d(h_cir1, refpln); Handle(Geom2d_Curve) cir2d2 = GeomAPI::To2d(h_cir2, refpln); diff --git a/src/Draw/TKQADraw/QABugs/QABugs_19.cxx b/src/Draw/TKQADraw/QABugs/QABugs_19.cxx index 4d5983eac7..c66fb04928 100644 --- a/src/Draw/TKQADraw/QABugs/QABugs_19.cxx +++ b/src/Draw/TKQADraw/QABugs/QABugs_19.cxx @@ -111,8 +111,8 @@ static Standard_Integer OCC23361(Draw_Interpretor& di, gp_Pnt p(0, 0, 2); gp_Trsf t1, t2; - t1.SetRotation(gp_Ax1(p, gp_Dir(0, 1, 0)), -0.49328285294022267); - t2.SetRotation(gp_Ax1(p, gp_Dir(0, 0, 1)), 0.87538474718473880); + t1.SetRotation(gp_Ax1(p, gp_Dir(gp_Dir::D::Y)), -0.49328285294022267); + t2.SetRotation(gp_Ax1(p, gp_Dir(gp_Dir::D::Z)), 0.87538474718473880); gp_Trsf tComp = t2 * t1; @@ -1348,7 +1348,7 @@ static Standard_Integer OCC24945(Draw_Interpretor& di, Standard_Integer argc, co } gp_Pnt aP3D(-1725.97, 843.257, -4.22741e-013); - gp_Ax2 aAxis(gp_Pnt(0, 843.257, 0), gp_Dir(0, -1, 0), gp::DX()); + gp_Ax2 aAxis(gp_Pnt(0, 843.257, 0), gp_Dir(gp_Dir::D::NY), gp::DX()); Handle(Geom_Circle) aCircle = new Geom_Circle(aAxis, 1725.9708621929999); GeomAdaptor_Curve aC3D(aCircle); @@ -2054,10 +2054,10 @@ static Standard_Integer OCC24889(Draw_Interpretor& theDI, { // Curves Handle(Geom2d_Circle) aCircle1 = - new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(25, -25), gp_Dir2d(1, 0), gp_Dir2d(-0, 1)), 155); + new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(25, -25), gp_Dir2d(gp_Dir2d::D::X), gp_Dir2d(-0, 1)), 155); Handle(Geom2d_Circle) aCircle2 = - new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(25, 25), gp_Dir2d(1, 0), gp_Dir2d(-0, 1)), 155); + new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(25, 25), gp_Dir2d(gp_Dir2d::D::X), gp_Dir2d(-0, 1)), 155); Handle(Geom2d_TrimmedCurve) aTrim[2] = { new Geom2d_TrimmedCurve(aCircle1, 1.57079632679490, 2.97959469729228), @@ -2955,7 +2955,7 @@ static Standard_Integer OCC25413(Draw_Interpretor& di, Standard_Integer narg, co Bnd_Box aBndBox; BRepBndLib::Add(aShape, aBndBox); - gp_Dir aDir(0., 1., 0.); + gp_Dir aDir(gp_Dir::D::Y); const int N = 250; Standard_Real xMin = aBndBox.CornerMin().X(); Standard_Real zMin = aBndBox.CornerMin().Z(); @@ -4706,7 +4706,7 @@ static TopoDS_Shape taper(const TopoDS_Shape& shape, Standard_Real angle) { // Use maximum face-to-taper z-offset. - const gp_Pln neutral_plane(gp_Ax3(gp_Pnt(0.0, 0.0, 140.0), gp_Dir(0.0, 0.0, 1.0))); + const gp_Pln neutral_plane(gp_Ax3(gp_Pnt(0.0, 0.0, 140.0), gp_Dir(gp_Dir::D::Z))); // Draft angle needs to be in radians, and flipped to adhere to our own (arbitrary) draft // angle definition. @@ -4715,8 +4715,8 @@ static TopoDS_Shape taper(const TopoDS_Shape& shape, // Add face to draft. The first argument indicates that all material added/removed during // drafting is located below the neutral plane BRepOffsetAPI_DraftAngle drafter(shape); - drafter.Add(face_a, gp_Dir(0.0, 0.0, -1.0), draft_angle, neutral_plane); - drafter.Add(face_b, gp_Dir(0.0, 0.0, -1.0), draft_angle, neutral_plane); + drafter.Add(face_a, gp_Dir(gp_Dir::D::NZ), draft_angle, neutral_plane); + drafter.Add(face_b, gp_Dir(gp_Dir::D::NZ), draft_angle, neutral_plane); drafter.Build(); return drafter.Shape(); @@ -4810,8 +4810,8 @@ static Standard_Integer OCC26750(Draw_Interpretor& theDI, theDI << "Error in gp_Vec2d. Vectors should be normal.\n"; } - const gp_Dir2d aD1(1.0, 0.0); - const gp_Dir2d aD2(0.0, -1.0); + const gp_Dir2d aD1(gp_Dir2d::D::X); + const gp_Dir2d aD2(gp_Dir2d::D::NY); if (aD1.IsNormal(aD2, Precision::Angular())) { diff --git a/src/Draw/TKQADraw/QABugs/QABugs_20.cxx b/src/Draw/TKQADraw/QABugs/QABugs_20.cxx index 15098f9e8f..7590b2f1a6 100644 --- a/src/Draw/TKQADraw/QABugs/QABugs_20.cxx +++ b/src/Draw/TKQADraw/QABugs/QABugs_20.cxx @@ -2327,7 +2327,7 @@ static Standard_Integer OCC26747_1(Draw_Interpretor& theDI, // OR // 0 * X^2 + 1 * Y^2 + 2*0*X*Y + 2*(-1)*X + 2*(-3)*Y + 10 = 0. - Parab2d_Bug26747::Axes = gp_Ax2d(gp_Pnt2d(0.0, 3.0), gp_Dir2d(0.0, 1.0)); + Parab2d_Bug26747::Axes = gp_Ax2d(gp_Pnt2d(0.0, 3.0), gp_Dir2d(gp_Dir2d::D::Y)); Parab2d_Bug26747::FocusPoint.SetCoord(1.0, 3.0); Parab2d_Bug26747::FocalLength = 0.5; @@ -2391,7 +2391,7 @@ static Standard_Integer OCC26747_2(Draw_Interpretor& theDI, // A * X^2 + B * (Y^2) + 2*C*(X*Y) + 2*D*X + 2*E*Y + F = 0. // 0 * X^2 + 1 * (Y^2) + 2*0*(X*Y) + 2*1*X + 2*(-3)*Y + 10 = 0. - Parab2d_Bug26747::Axes = gp_Ax2d(gp_Pnt2d(0.0, 0.0), gp_Dir2d(0.0, 1.0)); + Parab2d_Bug26747::Axes = gp_Ax2d(gp_Pnt2d(0.0, 0.0), gp_Dir2d(gp_Dir2d::D::Y)); Parab2d_Bug26747::FocusPoint.SetCoord(-1.0, 3.0); Parab2d_Bug26747::FocalLength = 0.5; @@ -2456,7 +2456,7 @@ static Standard_Integer OCC26747_3(Draw_Interpretor& theDI, // A * X^2 + B * (Y^2) + 2*C*(X*Y) + 2*D*X + 2*E*Y + F = 0. // 0 * X^2 + 1 * (Y^2) + 2*0*(X*Y) + 2*0*X + 2*(-3)*Y + 9 = 0. - Parab2d_Bug26747::Axes = gp_Ax2d(gp_Pnt2d(0.0, 0.0), gp_Dir2d(0.0, 1.0)); + Parab2d_Bug26747::Axes = gp_Ax2d(gp_Pnt2d(0.0, 0.0), gp_Dir2d(gp_Dir2d::D::Y)); Parab2d_Bug26747::FocusPoint.SetCoord(0.0, 3.0); Parab2d_Bug26747::FocalLength = 0.0; @@ -3022,7 +3022,7 @@ static Standard_Integer OCC28131(Draw_Interpretor&, Handle(Geom2d_BSplineCurve) c = anInterpolation.Curve(); - gp_Pln pln(gp_Ax3(gp_Pnt(), gp_Dir(1, 0, 0), gp_Dir(0, -1, 0))); + gp_Pln pln{gp_Ax3(gp_Pnt(), gp_Dir(gp_Dir::D::X), gp_Dir(gp_Dir::D::NY))}; Handle(Geom_BSplineCurve) c3d = Handle(Geom_BSplineCurve)::DownCast(GeomAPI::To3d(c, pln)); curve1 = c3d; @@ -3039,7 +3039,7 @@ static Standard_Integer OCC28131(Draw_Interpretor&, anInterpolation.Perform(); Handle(Geom2d_BSplineCurve) c = anInterpolation.Curve(); - gp_Pln pln(gp_Ax3(gp_Pnt(), gp_Dir(0, -1, 0), gp_Dir(-1, 0, 0))); + gp_Pln pln{gp_Ax3(gp_Pnt(), gp_Dir(gp_Dir::D::NY), gp_Dir(gp_Dir::D::NX))}; Handle(Geom_BSplineCurve) c3d = Handle(Geom_BSplineCurve)::DownCast(GeomAPI::To3d(c, pln)); curve2 = c3d; } @@ -3080,7 +3080,7 @@ static Standard_Integer OCC28131(Draw_Interpretor&, static Standard_Integer OCC29289(Draw_Interpretor&, Standard_Integer, const char**) { - gp_Elips2d e1(gp_Ax2d(gp_Pnt2d(0., 0.), gp_Dir2d(1., 0)), 2., 1.); + gp_Elips2d e1(gp_Ax2d(gp_Pnt2d(0., 0.), gp_Dir2d(gp_Dir2d::D::X)), 2., 1.); Handle(Geom2d_Ellipse) Ge1 = new Geom2d_Ellipse(e1); gp_Elips2d e2(gp_Ax2d(gp_Pnt2d(0.5, 0.5), gp_Dir2d(1., 1.)), 2., 1.); Handle(Geom2d_Ellipse) Ge2 = new Geom2d_Ellipse(e2); @@ -3402,7 +3402,7 @@ static Standard_Integer OCC29430(Draw_Interpretor& theDI, const Standard_Real r45 = M_PI / 4.0, r225 = 3.0 * M_PI / 4.0; GC_MakeArcOfCircle arcMaker( - gp_Circ(gp_Ax2(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(0.0, 0.0, 1.0), gp_Dir(1.0, 0.0, 0.0)), 1.0), + gp_Circ(gp_Ax2(gp_Pnt(0.0, 0.0, 0.0), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), 1.0), r45, r225, Standard_True); diff --git a/src/Draw/TKQADraw/QABugs/QABugs_3.cxx b/src/Draw/TKQADraw/QABugs/QABugs_3.cxx index 7a394f16ad..939628ac1b 100644 --- a/src/Draw/TKQADraw/QABugs/QABugs_3.cxx +++ b/src/Draw/TKQADraw/QABugs/QABugs_3.cxx @@ -93,7 +93,7 @@ static Standard_Integer BUC60632(Draw_Interpretor& di, Standard_Integer /*n*/, c myAIScontext->Display(Ve1, Standard_False); myAIScontext->Display(Ve2, Standard_False); - Handle(Geom_Plane) Plane1 = new Geom_Plane(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + Handle(Geom_Plane) Plane1 = new Geom_Plane(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); TCollection_ExtendedString Ext1("Dim1"); Handle(PrsDim_LengthDimension) Dim1 = new PrsDim_LengthDimension(V1, V2, Plane1->Pln()); Dim1->SetCustomValue(Draw::Atof(a[2])); @@ -215,10 +215,10 @@ static Standard_Integer BUC60792(Draw_Interpretor& di, Standard_Integer /*argc*/ } gp_Pnt pt3d(0, 20, 150); - gp_Ax2 anAx2(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0), gp_Dir(0, 0, 1)); + gp_Ax2 anAx2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::X), gp_Dir(gp_Dir::D::Z)); gp_Circ circ(anAx2, 50.0); Handle(Geom_Circle) gcir = new Geom_Circle(circ); - Handle(Geom_Plane) pln = new Geom_Plane(gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0))); + Handle(Geom_Plane) pln = new Geom_Plane(gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::X))); Handle(Geom2d_Curve) gcir1 = GeomAPI::To2d(gcir, pln->Pln()); TopoDS_Shape sh1 = BRepBuilderAPI_MakeEdge(gcir1, pln).Shape(); Handle(AIS_Shape) ais1 = new AIS_Shape(sh1); @@ -504,7 +504,6 @@ static Standard_Integer BUC60856(Draw_Interpretor& di, Standard_Integer /*argc*/ return -1; } - gp_Ax2 Cone_Ax; double R1 = 8, R2 = 16; gp_Pnt P1(0, 0, 20), P2(0, 0, 45); Handle(Geom_RectangularTrimmedSurface) S = GC_MakeTrimmedCone(P1, P2, R1, R2).Value(); @@ -798,9 +797,9 @@ static Standard_Integer BUC60841(Draw_Interpretor& di, Standard_Integer argc, co return 1; } - gp_Ax2 Ax2 = gp_Ax2(gp_Pnt(0, 621, 78), gp_Dir(0, 1, 0)); + gp_Ax2 Ax2 = gp_Ax2(gp_Pnt(0, 621, 78), gp_Dir(gp_Dir::D::Y)); BRepPrimAPI_MakeCylinder cyl(Ax2, 260, 150); - // BRepPrimAPI_MakeCylinder cyl(gp_Ax2(gp_Pnt(0, 621, 78), gp_Dir(0, 1,0)), 260, 150); + // BRepPrimAPI_MakeCylinder cyl(gp_Ax2(gp_Pnt(0, 621, 78), gp_Dir(gp_Dir::D::Y)), 260, 150); TopoDS_Shape sh1 = cyl.Shape(); DBRep::Set("sh1", sh1); @@ -1398,7 +1397,7 @@ static Standard_Integer BUC60951_(Draw_Interpretor& di, Standard_Integer argc, c BRepPrimAPI_MakeHalfSpace half(shell, gp_Pnt(0, 0, 20)); const TopoDS_Solid& sol = half.Solid(); - gp_Ax2 anAx2(gp_Pnt(-800.0, 0.0, 0), gp_Dir(0, 0, -1)); + gp_Ax2 anAx2(gp_Pnt(-800.0, 0.0, 0), gp_Dir(gp_Dir::D::NZ)); BRepPrimAPI_MakeCylinder cyl(anAx2, 50, 300); TopoDS_Shape sh = cyl.Shape(); diff --git a/src/Draw/TKQADraw/QABugs/QABugs_9.cxx b/src/Draw/TKQADraw/QABugs/QABugs_9.cxx index 6537e1c342..45cefb35ad 100644 --- a/src/Draw/TKQADraw/QABugs/QABugs_9.cxx +++ b/src/Draw/TKQADraw/QABugs/QABugs_9.cxx @@ -31,7 +31,6 @@ static Standard_Integer BUC60857(Draw_Interpretor& di, Standard_Integer /*argc*/, const char** argv) { - gp_Ax2 Cone_Ax; double R1 = 8, R2 = 16; gp_Pnt P1(0, 0, 20), P2(0, 0, 45); diff --git a/src/Draw/TKQADraw/QABugs/QABugs_PresentableObject.cxx b/src/Draw/TKQADraw/QABugs/QABugs_PresentableObject.cxx index 0ed2025c73..10e6f9d0f0 100644 --- a/src/Draw/TKQADraw/QABugs/QABugs_PresentableObject.cxx +++ b/src/Draw/TKQADraw/QABugs/QABugs_PresentableObject.cxx @@ -60,7 +60,7 @@ void QABugs_PresentableObject::Compute(const Handle(PrsMgr_PresentationManager)& } case 1: { aPrims->AddVertex(gp_Pnt(5.0, 0.0, 0.0), - gp_Dir(0.0, 0.0, 1.0), + gp_Dir(gp_Dir::D::Z), Quantity_Color(Quantity_NOC_RED)); aPrims->AddVertex(gp_Pnt(5.0, 5.0, 1.0), gp_Dir(1.0, 1.0, 1.0), @@ -73,7 +73,7 @@ void QABugs_PresentableObject::Compute(const Handle(PrsMgr_PresentationManager)& gp_Dir(1.0, 1.0, 1.0), Quantity_Color(Quantity_NOC_BLUE1)); aPrims->AddVertex(gp_Pnt(10.0, 5.0, -1.0), - gp_Dir(0.0, 0.0, -1.0), + gp_Dir(gp_Dir::D::NZ), Quantity_Color(Quantity_NOC_GREEN)); aPrims->AddVertex(gp_Pnt(10.0, 0.0, 1.0), gp_Dir(0.0, 1.0, 1.0), diff --git a/src/Draw/TKTopTest/BRepTest/BRepTest_CurveCommands.cxx b/src/Draw/TKTopTest/BRepTest/BRepTest_CurveCommands.cxx index d112c963b7..b569dc31bf 100644 --- a/src/Draw/TKTopTest/BRepTest/BRepTest_CurveCommands.cxx +++ b/src/Draw/TKTopTest/BRepTest/BRepTest_CurveCommands.cxx @@ -576,12 +576,12 @@ static Standard_Integer isoedge(Draw_Interpretor&, Standard_Integer n, const cha if (uiso) { C = TS->UIso(p); - L = new Geom2d_Line(gp_Pnt2d(p, 0), gp_Dir2d(0, 1)); + L = new Geom2d_Line(gp_Pnt2d(p, 0), gp_Dir2d(gp_Dir2d::D::Y)); } else { C = TS->VIso(p); - L = new Geom2d_Line(gp_Pnt2d(0, p), gp_Dir2d(1, 0)); + L = new Geom2d_Line(gp_Pnt2d(0, p), gp_Dir2d(gp_Dir2d::D::X)); } TopoDS_Edge E = BRepBuilderAPI_MakeEdge(C, p1, p2); diff --git a/src/Draw/TKTopTest/BRepTest/BRepTest_HelixCommands.cxx b/src/Draw/TKTopTest/BRepTest/BRepTest_HelixCommands.cxx index ecb8ae8f78..4d80f2cf19 100644 --- a/src/Draw/TKTopTest/BRepTest/BRepTest_HelixCommands.cxx +++ b/src/Draw/TKTopTest/BRepTest/BRepTest_HelixCommands.cxx @@ -47,7 +47,7 @@ #include Standard_IMPORT Draw_Viewer dout; -static gp_Ax3 theHelixAxis(gp_Pnt(0., 0., 0), gp_Dir(0., 0., 1.), gp_Dir(1., 0., 0.)); +static gp_Ax3 theHelixAxis(gp_Pnt(0., 0., 0), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)); static Standard_Integer comphelix(Draw_Interpretor&, Standard_Integer, const char**); static Standard_Integer helix(Draw_Interpretor&, Standard_Integer, const char**); diff --git a/src/Draw/TKTopTest/GeometryTest/GeometryTest_CurveCommands.cxx b/src/Draw/TKTopTest/GeometryTest/GeometryTest_CurveCommands.cxx index b5dde85e52..43388b8f36 100644 --- a/src/Draw/TKTopTest/GeometryTest/GeometryTest_CurveCommands.cxx +++ b/src/Draw/TKTopTest/GeometryTest/GeometryTest_CurveCommands.cxx @@ -1158,9 +1158,9 @@ static Standard_Integer EllipsUniformAbscissa(Draw_Interpretor& di, { gp_Pnt location; location = gp_Pnt(0.0, 0.0, 0.0); - gp_Dir main_direction(0.0, 0.0, 1.0); + gp_Dir main_direction(gp_Dir::D::Z); - gp_Dir x_direction(1.0, 0.0, 0.0); + gp_Dir x_direction(gp_Dir::D::X); gp_Ax2 mainaxis(location, main_direction); mainaxis.SetXDirection(x_direction); diff --git a/src/Draw/TKTopTest/GeometryTest/GeometryTest_CurveTanCommands.cxx b/src/Draw/TKTopTest/GeometryTest/GeometryTest_CurveTanCommands.cxx index 76fa3049d1..ceaac8f396 100644 --- a/src/Draw/TKTopTest/GeometryTest/GeometryTest_CurveTanCommands.cxx +++ b/src/Draw/TKTopTest/GeometryTest/GeometryTest_CurveTanCommands.cxx @@ -50,9 +50,10 @@ static Standard_Integer qcurve(Draw_Interpretor&, if (!strcmp(theArgVec[0], "qcircle")) { if (theArgsNb == 5 || theArgsNb == 6) - aResult2d = new Geom2d_Circle( - gp_Ax22d(gp_Pnt2d(Draw::Atof(theArgVec[2]), Draw::Atof(theArgVec[3])), gp_Dir2d(1, 0)), - Draw::Atof(theArgVec[4])); + aResult2d = + new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(Draw::Atof(theArgVec[2]), Draw::Atof(theArgVec[3])), + gp_Dir2d(gp_Dir2d::D::X)), + Draw::Atof(theArgVec[4])); else if (theArgsNb == 7 || theArgsNb == 8) aResult2d = new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(Draw::Atof(theArgVec[2]), Draw::Atof(theArgVec[3])), diff --git a/src/Draw/TKTopTest/GeomliteTest/GeomliteTest_CurveCommands.cxx b/src/Draw/TKTopTest/GeomliteTest/GeomliteTest_CurveCommands.cxx index 31c53ab91d..ea4a0d2e02 100644 --- a/src/Draw/TKTopTest/GeomliteTest/GeomliteTest_CurveCommands.cxx +++ b/src/Draw/TKTopTest/GeomliteTest/GeomliteTest_CurveCommands.cxx @@ -153,12 +153,12 @@ static Standard_Integer anacurve(Draw_Interpretor&, Standard_Integer n, const ch else if (!strcmp(a[0], "circle")) { if (n == 5) - result2d = - new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]), Draw::Atof(a[3])), gp_Dir2d(1, 0)), - Draw::Atof(a[4])); + result2d = new Geom2d_Circle( + gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]), Draw::Atof(a[3])), gp_Dir2d(gp_Dir2d::D::X)), + Draw::Atof(a[4])); else if (n == 6) result = new Geom_Circle( - gp_Ax2(gp_Pnt(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4])), gp_Dir(0, 0, 1)), + gp_Ax2(gp_Pnt(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4])), gp_Dir(gp_Dir::D::Z)), Draw::Atof(a[5])); else if (n == 7) result2d = new Geom2d_Circle(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]), Draw::Atof(a[3])), @@ -181,12 +181,12 @@ static Standard_Integer anacurve(Draw_Interpretor&, Standard_Integer n, const ch else if (!strcmp(a[0], "parabola")) { if (n == 5) - result2d = - new Geom2d_Parabola(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]), Draw::Atof(a[3])), gp_Dir2d(1, 0)), - Draw::Atof(a[4])); + result2d = new Geom2d_Parabola( + gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]), Draw::Atof(a[3])), gp_Dir2d(gp_Dir2d::D::X)), + Draw::Atof(a[4])); else if (n == 6) result = new Geom_Parabola( - gp_Ax2(gp_Pnt(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4])), gp_Dir(0, 0, 1)), + gp_Ax2(gp_Pnt(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4])), gp_Dir(gp_Dir::D::Z)), Draw::Atof(a[5])); else if (n == 7) result2d = new Geom2d_Parabola(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]), Draw::Atof(a[3])), @@ -210,13 +210,13 @@ static Standard_Integer anacurve(Draw_Interpretor&, Standard_Integer n, const ch else if (!strcmp(a[0], "ellipse")) { if (n == 6) - result2d = - new Geom2d_Ellipse(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]), Draw::Atof(a[3])), gp_Dir2d(1, 0)), - Draw::Atof(a[4]), - Draw::Atof(a[5])); + result2d = new Geom2d_Ellipse( + gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]), Draw::Atof(a[3])), gp_Dir2d(gp_Dir2d::D::X)), + Draw::Atof(a[4]), + Draw::Atof(a[5])); else if (n == 7) result = new Geom_Ellipse( - gp_Ax2(gp_Pnt(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4])), gp_Dir(0, 0, 1)), + gp_Ax2(gp_Pnt(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4])), gp_Dir(gp_Dir::D::Z)), Draw::Atof(a[5]), Draw::Atof(a[6])); else if (n == 8) @@ -244,13 +244,13 @@ static Standard_Integer anacurve(Draw_Interpretor&, Standard_Integer n, const ch else if (!strcmp(a[0], "hyperbola")) { if (n == 6) - result2d = - new Geom2d_Hyperbola(gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]), Draw::Atof(a[3])), gp_Dir2d(1, 0)), - Draw::Atof(a[4]), - Draw::Atof(a[5])); + result2d = new Geom2d_Hyperbola( + gp_Ax22d(gp_Pnt2d(Draw::Atof(a[2]), Draw::Atof(a[3])), gp_Dir2d(gp_Dir2d::D::X)), + Draw::Atof(a[4]), + Draw::Atof(a[5])); else if (n == 7) result = new Geom_Hyperbola( - gp_Ax2(gp_Pnt(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4])), gp_Dir(0, 0, 1)), + gp_Ax2(gp_Pnt(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4])), gp_Dir(gp_Dir::D::Z)), Draw::Atof(a[5]), Draw::Atof(a[6])); else if (n == 8) diff --git a/src/Draw/TKTopTest/GeomliteTest/GeomliteTest_SurfaceCommands.cxx b/src/Draw/TKTopTest/GeomliteTest/GeomliteTest_SurfaceCommands.cxx index fc06a20e44..3c07436fa2 100644 --- a/src/Draw/TKTopTest/GeomliteTest/GeomliteTest_SurfaceCommands.cxx +++ b/src/Draw/TKTopTest/GeomliteTest/GeomliteTest_SurfaceCommands.cxx @@ -145,14 +145,14 @@ static Standard_Integer anasurface(Draw_Interpretor&, Standard_Integer n, const if (n < 5) { - loc = gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)); + loc = gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)); i = 2; } else if (n < 8) { loc = gp_Ax3(gp_Pnt(Draw::Atof(a[2]), Draw::Atof(a[3]), Draw::Atof(a[4])), - gp_Dir(0, 0, 1), - gp_Dir(1, 0, 0)); + gp_Dir(gp_Dir::D::Z), + gp_Dir(gp_Dir::D::X)); i = 5; } else if (n < 11) diff --git a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ObjectCommands.cxx b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ObjectCommands.cxx index b5bdabb50b..5819883a7b 100644 --- a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ObjectCommands.cxx +++ b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ObjectCommands.cxx @@ -698,7 +698,6 @@ static int VTrihedron(Draw_Interpretor&, Standard_Integer theArgsNb, const char* } TCollection_AsciiString aName(theArgVec[1]); - gp_Pln aWorkingPlane; Standard_Boolean toUpdate = Standard_True; NCollection_DataMap aRealParams; @@ -2967,7 +2966,7 @@ Handle(Poly_Triangulation) CalculationOfSphere(double X, double Y, double Z, int if (modmax > Tol) Nor = gp_Dir(eqPlan); else - Nor = gp_Dir(0., 0., 1.); + Nor = gp_Dir(gp_Dir::D::Z); polyTriangulation->SetNormal(i, Nor.XYZ()); } @@ -5678,8 +5677,8 @@ static int TextToBRep(Draw_Interpretor& /*theDI*/, Font_FontAspect aFontAspect = Font_FA_Regular; Standard_Boolean anIsCompositeCurve = Standard_False; gp_Ax3 aPenAx3(gp::XOY()); - gp_Dir aNormal(0.0, 0.0, 1.0); - gp_Dir aDirection(1.0, 0.0, 0.0); + gp_Dir aNormal(gp_Dir::D::Z); + gp_Dir aDirection(gp_Dir::D::X); gp_Pnt aPenLoc; Graphic3d_HorizontalTextAlignment aHJustification = Graphic3d_HTA_LEFT; diff --git a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_RelationCommands.cxx b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_RelationCommands.cxx index 01b65679d2..fe55880ac2 100644 --- a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_RelationCommands.cxx +++ b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_RelationCommands.cxx @@ -1730,7 +1730,6 @@ static int VAngleParam(Draw_Interpretor& theDi, Standard_Integer theArgNum, cons } TCollection_AsciiString aName(theArgVec[1]); - gp_Pln aWorkingPlane; Standard_Boolean toUpdate = Standard_True; NCollection_DataMap aStringParams; diff --git a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ViewerCommands.cxx b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ViewerCommands.cxx index 24749e6b88..2c1ca12cc8 100644 --- a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ViewerCommands.cxx +++ b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ViewerCommands.cxx @@ -5797,7 +5797,7 @@ public: myDrawer->SetTextAspect(aTextAspect); } { - const gp_Dir aNorm(0.0, 0.0, 1.0); + const gp_Dir aNorm(gp_Dir::D::Z); myTris = new Graphic3d_ArrayOfTriangles(4, 6, true, false, true); myTris->AddVertex(gp_Pnt(-myWidth * 0.5, -myHeight * 0.5, 0.0), aNorm, gp_Pnt2d(0.0, 0.0)); myTris->AddVertex(gp_Pnt(myWidth * 0.5, -myHeight * 0.5, 0.0), aNorm, gp_Pnt2d(1.0, 0.0)); diff --git a/src/FoundationClasses/TKMath/Bnd/Bnd_OBB.cxx b/src/FoundationClasses/TKMath/Bnd/Bnd_OBB.cxx index 64bd9adb73..8930befcc8 100644 --- a/src/FoundationClasses/TKMath/Bnd/Bnd_OBB.cxx +++ b/src/FoundationClasses/TKMath/Bnd/Bnd_OBB.cxx @@ -695,9 +695,9 @@ void OBBTool::BuildBox(Bnd_OBB& theBox) const Standard_Boolean isOBB = myAxes[0].SquareModulus() * myAxes[1].SquareModulus() * myAxes[2].SquareModulus() > 1.0e-14; - const gp_Dir aXDir = isOBB ? myAxes[0] : gp_Dir(1, 0, 0); - const gp_Dir aYDir = isOBB ? myAxes[1] : gp_Dir(0, 1, 0); - const gp_Dir aZDir = isOBB ? myAxes[2] : gp_Dir(0, 0, 1); + const gp_Dir aXDir = isOBB ? myAxes[0] : gp_Dir(gp_Dir::D::X); + const gp_Dir aYDir = isOBB ? myAxes[1] : gp_Dir(gp_Dir::D::Y); + const gp_Dir aZDir = isOBB ? myAxes[2] : gp_Dir(gp_Dir::D::Z); const Standard_Integer aNbPoints = 6; Standard_Real aParams[aNbPoints]; diff --git a/src/FoundationClasses/TKMath/GTests/Bnd_BoundSortBox_Test.cxx b/src/FoundationClasses/TKMath/GTests/Bnd_BoundSortBox_Test.cxx index 0eb33950ca..e39981e58c 100644 --- a/src/FoundationClasses/TKMath/GTests/Bnd_BoundSortBox_Test.cxx +++ b/src/FoundationClasses/TKMath/GTests/Bnd_BoundSortBox_Test.cxx @@ -157,7 +157,7 @@ TEST_F(Bnd_BoundSortBoxTest, CompareWithPlane) // Create a plane that intersects the large box but not others gp_Pnt point(0.0, 0.0, 9.0); - gp_Dir direction(0.0, 0.0, 1.0); + gp_Dir direction(gp_Dir::D::Z); gp_Pln plane(point, direction); const TColStd_ListOfInteger& result = sortBox.Compare(plane); diff --git a/src/FoundationClasses/TKMath/GTests/Bnd_Box_Test.cxx b/src/FoundationClasses/TKMath/GTests/Bnd_Box_Test.cxx index cd1464d60f..5be9ca4c45 100644 --- a/src/FoundationClasses/TKMath/GTests/Bnd_Box_Test.cxx +++ b/src/FoundationClasses/TKMath/GTests/Bnd_Box_Test.cxx @@ -86,7 +86,7 @@ TEST(Bnd_BoxTest, SetWithPointAndDirection) { Bnd_Box aBox; gp_Pnt aPnt(1.0, 2.0, 3.0); - gp_Dir aDir(1.0, 0.0, 0.0); + gp_Dir aDir(gp_Dir::D::X); aBox.Set(aPnt, aDir); @@ -322,7 +322,7 @@ TEST(Bnd_BoxTest, TransformationVoidBox) { Bnd_Box aVoidBox; gp_Trsf aRotation; - aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), M_PI / 4); + aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), M_PI / 4); Bnd_Box aTransformed = aVoidBox.Transformed(aRotation); @@ -414,7 +414,7 @@ TEST(Bnd_BoxTest, AddDirection) Bnd_Box aBox; aBox.Update(0.0, 0.0, 0.0, 1.0, 1.0, 1.0); - gp_Dir aDir(1.0, 0.0, 0.0); + gp_Dir aDir(gp_Dir::D::X); aBox.Add(aDir); EXPECT_TRUE(aBox.IsOpenXmax()) << "Positive X direction should open Xmax"; @@ -427,7 +427,7 @@ TEST(Bnd_BoxTest, AddPointWithDirection) { Bnd_Box aBox; gp_Pnt aPnt(1.0, 2.0, 3.0); - gp_Dir aDir(-1.0, 0.0, 0.0); + gp_Dir aDir(gp_Dir::D::NX); aBox.Add(aPnt, aDir); @@ -510,10 +510,10 @@ TEST(Bnd_BoxTest, IsOutPlane) aBox.Update(-1.0, -1.0, -1.0, 1.0, 1.0, 1.0); // Plane that intersects the box - gp_Pln anIntersectingPln(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0)); + gp_Pln anIntersectingPln(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::X)); // Plane that doesn't intersect the box - gp_Pln aSeparatePln(gp_Pnt(2, 0, 0), gp_Dir(1, 0, 0)); + gp_Pln aSeparatePln(gp_Pnt(2, 0, 0), gp_Dir(gp_Dir::D::X)); EXPECT_FALSE(aBox.IsOut(anIntersectingPln)) << "Intersecting plane should not be out"; EXPECT_TRUE(aBox.IsOut(aSeparatePln)) << "Separate plane should be out"; @@ -525,10 +525,10 @@ TEST(Bnd_BoxTest, IsOutLine) aBox.Update(0.0, 0.0, 0.0, 2.0, 2.0, 2.0); // Line that passes through the box - gp_Lin anIntersectingLin(gp_Pnt(-1, 1, 1), gp_Dir(1, 0, 0)); + gp_Lin anIntersectingLin(gp_Pnt(-1, 1, 1), gp_Dir(gp_Dir::D::X)); // Line that misses the box - gp_Lin aSeparateLin(gp_Pnt(-1, 3, 1), gp_Dir(1, 0, 0)); + gp_Lin aSeparateLin(gp_Pnt(-1, 3, 1), gp_Dir(gp_Dir::D::X)); EXPECT_FALSE(aBox.IsOut(anIntersectingLin)) << "Intersecting line should not be out"; EXPECT_TRUE(aBox.IsOut(aSeparateLin)) << "Separate line should be out"; @@ -641,7 +641,7 @@ TEST(Bnd_BoxTest, TransformationWithOpenBox) aBox.OpenXmax(); gp_Trsf aRotation; - aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), M_PI / 2); + aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), M_PI / 2); Bnd_Box aTransformed = aBox.Transformed(aRotation); @@ -744,7 +744,7 @@ TEST(Bnd_BoxTest, IsOutLineSegment) // Line segment that passes through box gp_Pnt aP1(-1.0, 1.0, 1.0); gp_Pnt aP2(3.0, 1.0, 1.0); - gp_Dir aDir(1.0, 0.0, 0.0); + gp_Dir aDir(gp_Dir::D::X); EXPECT_FALSE(aBox.IsOut(aP1, aP2, aDir)) << "Line segment through box should not be out"; diff --git a/src/FoundationClasses/TKMath/GTests/ElCLib_Test.cxx b/src/FoundationClasses/TKMath/GTests/ElCLib_Test.cxx index b7305d938c..c1961cb701 100644 --- a/src/FoundationClasses/TKMath/GTests/ElCLib_Test.cxx +++ b/src/FoundationClasses/TKMath/GTests/ElCLib_Test.cxx @@ -123,7 +123,7 @@ TEST(ElClibTests, AdjustPeriodic) TEST(ElClibTests, Line3D) { const gp_Pnt aLoc(1.0, 2.0, 3.0); - const gp_Dir aDir(0.0, 0.0, 1.0); + const gp_Dir aDir(gp_Dir::D::Z); const gp_Lin aLin(aLoc, aDir); const Standard_Real aParam = 5.0; @@ -154,8 +154,8 @@ TEST(ElClibTests, Line3D) TEST(ElClibTests, Circle3D) { const gp_Pnt aLoc(0.0, 0.0, 0.0); - const gp_Dir aDirZ(0.0, 0.0, 1.0); - const gp_Dir aDirX(1.0, 0.0, 0.0); + const gp_Dir aDirZ(gp_Dir::D::Z); + const gp_Dir aDirX(gp_Dir::D::X); const gp_Ax2 anAxis(aLoc, aDirZ, aDirX); const Standard_Real aRadius = 2.0; const gp_Circ aCircle(anAxis, aRadius); @@ -211,8 +211,8 @@ TEST(ElClibTests, Circle3D) TEST(ElClibTests, Ellipse3D) { const gp_Pnt aLoc(0.0, 0.0, 0.0); - const gp_Dir aDirZ(0.0, 0.0, 1.0); - const gp_Dir aDirX(1.0, 0.0, 0.0); + const gp_Dir aDirZ(gp_Dir::D::Z); + const gp_Dir aDirX(gp_Dir::D::X); const gp_Ax2 anAxis(aLoc, aDirZ, aDirX); const Standard_Real aMajorRadius = 3.0; const Standard_Real aMinorRadius = 2.0; @@ -240,8 +240,8 @@ TEST(ElClibTests, Ellipse3D) TEST(ElClibTests, Hyperbola3D) { const gp_Pnt aLoc(0.0, 0.0, 0.0); - const gp_Dir aDirZ(0.0, 0.0, 1.0); - const gp_Dir aDirX(1.0, 0.0, 0.0); + const gp_Dir aDirZ(gp_Dir::D::Z); + const gp_Dir aDirX(gp_Dir::D::X); const gp_Ax2 anAxis(aLoc, aDirZ, aDirX); const Standard_Real aMajorRadius = 3.0; const Standard_Real aMinorRadius = 2.0; @@ -269,8 +269,8 @@ TEST(ElClibTests, Hyperbola3D) TEST(ElClibTests, Parabola3D) { const gp_Pnt aLoc(0.0, 0.0, 0.0); - const gp_Dir aDirZ(0.0, 0.0, 1.0); - const gp_Dir aDirX(1.0, 0.0, 0.0); + const gp_Dir aDirZ(gp_Dir::D::Z); + const gp_Dir aDirX(gp_Dir::D::X); const gp_Ax2 anAxis(aLoc, aDirZ, aDirX); const Standard_Real aFocal = 2.0; const gp_Parab aParabola(anAxis, aFocal); @@ -297,8 +297,8 @@ TEST(ElClibTests, Parabola3D) TEST(ElClibTests, To3dConversion) { const gp_Pnt aLoc(1.0, 2.0, 3.0); - const gp_Dir aDirZ(0.0, 0.0, 1.0); - const gp_Dir aDirX(1.0, 0.0, 0.0); + const gp_Dir aDirZ(gp_Dir::D::Z); + const gp_Dir aDirX(gp_Dir::D::X); const gp_Ax2 anAxis(aLoc, aDirZ, aDirX); // Test conversion of a point @@ -321,7 +321,7 @@ TEST(ElClibTests, To3dConversion) // Test conversion of a circle const gp_Pnt2d aLoc2d(0.0, 0.0); - const gp_Dir2d aDir2dX(1.0, 0.0); + const gp_Dir2d aDir2dX(gp_Dir2d::D::X); const gp_Ax22d anAxis2d(aLoc2d, aDir2dX, true); const Standard_Real aRadius = 2.0; const gp_Circ2d aCirc2d(anAxis2d, aRadius); diff --git a/src/FoundationClasses/TKMath/gp/gp.cxx b/src/FoundationClasses/TKMath/gp/gp.cxx index bb98f685ba..58e7499976 100644 --- a/src/FoundationClasses/TKMath/gp/gp.cxx +++ b/src/FoundationClasses/TKMath/gp/gp.cxx @@ -14,6 +14,7 @@ #include +#include #include #include #include @@ -23,120 +24,120 @@ //================================================================================================= -const gp_Pnt& gp::Origin() +const gp_Pnt& gp::Origin() noexcept { - static gp_Pnt gp_Origin(0, 0, 0); + static const gp_Pnt gp_Origin(0, 0, 0); return gp_Origin; } //================================================================================================= -const gp_Dir& gp::DX() +const gp_Dir& gp::DX() noexcept { - static gp_Dir gp_DX(1, 0, 0); + static const gp_Dir gp_DX(gp_Dir::D::X); return gp_DX; } //================================================================================================= -const gp_Dir& gp::DY() +const gp_Dir& gp::DY() noexcept { - static gp_Dir gp_DY(0, 1, 0); + static const gp_Dir gp_DY(gp_Dir::D::Y); return gp_DY; } //================================================================================================= -const gp_Dir& gp::DZ() +const gp_Dir& gp::DZ() noexcept { - static gp_Dir gp_DZ(0, 0, 1); + static const gp_Dir gp_DZ(gp_Dir::D::Z); return gp_DZ; } //================================================================================================= -const gp_Ax1& gp::OX() +const gp_Ax1& gp::OX() noexcept { - static gp_Ax1 gp_OX(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0)); + static const gp_Ax1 gp_OX(gp_Pnt(0, 0, 0), gp_Dir::D::X); return gp_OX; } //================================================================================================= -const gp_Ax1& gp::OY() +const gp_Ax1& gp::OY() noexcept { - static gp_Ax1 gp_OY(gp_Pnt(0, 0, 0), gp_Dir(0, 1, 0)); + static const gp_Ax1 gp_OY(gp_Pnt(0, 0, 0), gp_Dir::D::Y); return gp_OY; } //================================================================================================= -const gp_Ax1& gp::OZ() +const gp_Ax1& gp::OZ() noexcept { - static gp_Ax1 gp_OZ(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + static const gp_Ax1 gp_OZ(gp_Pnt(0, 0, 0), gp_Dir::D::Z); return gp_OZ; } //================================================================================================= -const gp_Ax2& gp::XOY() +const gp_Ax2& gp::XOY() noexcept { - static gp_Ax2 gp_XOY(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)); + static const gp_Ax2 gp_XOY(gp_Pnt(0, 0, 0), gp_Dir::D::Z); return gp_XOY; } //================================================================================================= -const gp_Ax2& gp::ZOX() +const gp_Ax2& gp::ZOX() noexcept { - static gp_Ax2 gp_ZOX(gp_Pnt(0, 0, 0), gp_Dir(0, 1, 0), gp_Dir(0, 0, 1)); + static const gp_Ax2 gp_ZOX(gp_Pnt(0, 0, 0), gp_Dir::D::Y); return gp_ZOX; } //================================================================================================= -const gp_Ax2& gp::YOZ() +const gp_Ax2& gp::YOZ() noexcept { - static gp_Ax2 gp_YOZ(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0), gp_Dir(0, 1, 0)); + static const gp_Ax2 gp_YOZ(gp_Pnt(0, 0, 0), gp_Dir::D::X); return gp_YOZ; } //================================================================================================= -const gp_Pnt2d& gp::Origin2d() +const gp_Pnt2d& gp::Origin2d() noexcept { - static gp_Pnt2d gp_Origin2d(0, 0); + static const gp_Pnt2d gp_Origin2d(0, 0); return gp_Origin2d; } //================================================================================================= -const gp_Dir2d& gp::DX2d() +const gp_Dir2d& gp::DX2d() noexcept { - static gp_Dir2d gp_DX2d(1, 0); + static const gp_Dir2d gp_DX2d(gp_Dir2d::D::X); return gp_DX2d; } //================================================================================================= -const gp_Dir2d& gp::DY2d() +const gp_Dir2d& gp::DY2d() noexcept { - static gp_Dir2d gp_DY2d(0, 1); + static const gp_Dir2d gp_DY2d(gp_Dir2d::D::Y); return gp_DY2d; } //================================================================================================= -const gp_Ax2d& gp::OX2d() +const gp_Ax2d& gp::OX2d() noexcept { - static gp_Ax2d gp_OX2d(gp_Pnt2d(0, 0), gp_Dir2d(1, 0)); + static const gp_Ax2d gp_OX2d(gp_Pnt2d(0, 0), gp_Dir2d::D::X); return gp_OX2d; } //================================================================================================= -const gp_Ax2d& gp::OY2d() +const gp_Ax2d& gp::OY2d() noexcept { - static gp_Ax2d gp_OY2d(gp_Pnt2d(0, 0), gp_Dir2d(0, 1)); + static const gp_Ax2d gp_OY2d(gp_Pnt2d(0, 0), gp_Dir2d::D::Y); return gp_OY2d; } diff --git a/src/FoundationClasses/TKMath/gp/gp.hxx b/src/FoundationClasses/TKMath/gp/gp.hxx index 025fdb082b..12bacb2018 100644 --- a/src/FoundationClasses/TKMath/gp/gp.hxx +++ b/src/FoundationClasses/TKMath/gp/gp.hxx @@ -39,11 +39,16 @@ class gp_Ax2d; //! surfaces. //! These entities are defined in 2d and 3d space. //! All the classes of this package are non-persistent. +//! This is a utility class that cannot be instantiated. class gp { -public: - DEFINE_STANDARD_ALLOC +private: + // Non-instantiable utility class + gp() = delete; + gp(const gp&) = delete; + gp& operator=(const gp&) = delete; +public: //! Method of package gp //! //! In geometric computations, defines the tolerance criterion @@ -55,61 +60,61 @@ public: static constexpr Standard_Real Resolution() { return RealSmall(); } //! Identifies a Cartesian point with coordinates X = Y = Z = 0.0.0 - Standard_EXPORT static const gp_Pnt& Origin(); + Standard_EXPORT static const gp_Pnt& Origin() noexcept; //! Returns a unit vector with the combination (1,0,0) - Standard_EXPORT static const gp_Dir& DX(); + Standard_EXPORT static const gp_Dir& DX() noexcept; //! Returns a unit vector with the combination (0,1,0) - Standard_EXPORT static const gp_Dir& DY(); + Standard_EXPORT static const gp_Dir& DY() noexcept; //! Returns a unit vector with the combination (0,0,1) - Standard_EXPORT static const gp_Dir& DZ(); + Standard_EXPORT static const gp_Dir& DZ() noexcept; //! Identifies an axis where its origin is Origin //! and its unit vector coordinates X = 1.0, Y = Z = 0.0 - Standard_EXPORT static const gp_Ax1& OX(); + Standard_EXPORT static const gp_Ax1& OX() noexcept; //! Identifies an axis where its origin is Origin //! and its unit vector coordinates Y = 1.0, X = Z = 0.0 - Standard_EXPORT static const gp_Ax1& OY(); + Standard_EXPORT static const gp_Ax1& OY() noexcept; //! Identifies an axis where its origin is Origin //! and its unit vector coordinates Z = 1.0, Y = X = 0.0 - Standard_EXPORT static const gp_Ax1& OZ(); + Standard_EXPORT static const gp_Ax1& OZ() noexcept; //! Identifies a coordinate system where its origin is Origin, //! and its "main Direction" and "X Direction" coordinates //! Z = 1.0, X = Y =0.0 and X direction coordinates X = 1.0, Y = Z = 0.0 - Standard_EXPORT static const gp_Ax2& XOY(); + Standard_EXPORT static const gp_Ax2& XOY() noexcept; //! Identifies a coordinate system where its origin is Origin, //! and its "main Direction" and "X Direction" coordinates //! Y = 1.0, X = Z =0.0 and X direction coordinates Z = 1.0, X = Y = 0.0 - Standard_EXPORT static const gp_Ax2& ZOX(); + Standard_EXPORT static const gp_Ax2& ZOX() noexcept; //! Identifies a coordinate system where its origin is Origin, //! and its "main Direction" and "X Direction" coordinates //! X = 1.0, Z = Y =0.0 and X direction coordinates Y = 1.0, X = Z = 0.0 //! In 2D space - Standard_EXPORT static const gp_Ax2& YOZ(); + Standard_EXPORT static const gp_Ax2& YOZ() noexcept; //! Identifies a Cartesian point with coordinates X = Y = 0.0 - Standard_EXPORT static const gp_Pnt2d& Origin2d(); + Standard_EXPORT static const gp_Pnt2d& Origin2d() noexcept; //! Returns a unit vector with the combinations (1,0) - Standard_EXPORT static const gp_Dir2d& DX2d(); + Standard_EXPORT static const gp_Dir2d& DX2d() noexcept; //! Returns a unit vector with the combinations (0,1) - Standard_EXPORT static const gp_Dir2d& DY2d(); + Standard_EXPORT static const gp_Dir2d& DY2d() noexcept; //! Identifies an axis where its origin is Origin2d //! and its unit vector coordinates are: X = 1.0, Y = 0.0 - Standard_EXPORT static const gp_Ax2d& OX2d(); + Standard_EXPORT static const gp_Ax2d& OX2d() noexcept; //! Identifies an axis where its origin is Origin2d //! and its unit vector coordinates are Y = 1.0, X = 0.0 - Standard_EXPORT static const gp_Ax2d& OY2d(); + Standard_EXPORT static const gp_Ax2d& OY2d() noexcept; }; #endif // _gp_HeaderFile diff --git a/src/FoundationClasses/TKMath/gp/gp_Ax1.hxx b/src/FoundationClasses/TKMath/gp/gp_Ax1.hxx index 1853d5b50a..5e6c47fac5 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Ax1.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Ax1.hxx @@ -41,9 +41,9 @@ public: //! Creates an axis object representing Z axis of //! the reference coordinate system. - gp_Ax1() + constexpr gp_Ax1() noexcept : loc(0., 0., 0.), - vdir(0., 0., 1.) + vdir(gp_Dir::D::Z) { } @@ -54,6 +54,21 @@ public: { } + //! Creates an axis with the given location point and standard direction. + constexpr gp_Ax1(const gp_Pnt& theP, const gp_Dir::D theDir) noexcept + : loc(theP), + vdir(theDir) + { + } + + //! Creates an axis at the origin with the given standard direction. + //! Replaces gp::OX(), gp::OY(), gp::OZ() static functions. + constexpr explicit gp_Ax1(const gp_Dir::D theDir) noexcept + : loc(0., 0., 0.), + vdir(theDir) + { + } + //! Assigns V as the "Direction" of this axis. constexpr void SetDirection(const gp_Dir& theV) noexcept { vdir = theV; } diff --git a/src/FoundationClasses/TKMath/gp/gp_Ax2.hxx b/src/FoundationClasses/TKMath/gp/gp_Ax2.hxx index 77bb2837d5..65259e26ac 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Ax2.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Ax2.hxx @@ -57,9 +57,10 @@ public: //! Creates an object corresponding to the reference //! coordinate system (OXYZ). - gp_Ax2() - : vydir(0., 1., 0.) - // vxdir(1.,0.,0.) use default ctor of gp_Dir, as it creates the same dir(1,0,0) + constexpr gp_Ax2() noexcept + : vydir(gp_Dir::D::Y), + vxdir(gp_Dir::D::X) + // axis uses default ctor which creates Z axis at origin { } @@ -78,11 +79,38 @@ public: vydir.Cross(vxdir); } + //! Creates an axis placement with standard directions. + constexpr gp_Ax2(const gp_Pnt& theP, const gp_Dir::D theN, const gp_Dir::D theVx) noexcept + : axis(theP, theN), + vydir(crossStandardDir(theN, theVx)), // Y = Z x X (right-handed) + vxdir(theVx) + { + // Note: For standard directions, cross product is computed at compile time + // This constructor assumes theN and theVx are orthogonal standard directions + } + //! Creates - a coordinate system with an origin P, where V //! gives the "main Direction" (here, "X Direction" and "Y //! Direction" are defined automatically). Standard_EXPORT gp_Ax2(const gp_Pnt& P, const gp_Dir& V); + //! Creates a coordinate system with an origin P and standard main direction. + constexpr gp_Ax2(const gp_Pnt& theP, const gp_Dir::D theV) noexcept + : axis(theP, theV), + vydir(getPerpendicularYDir(theV)), + vxdir(getPerpendicularXDir(theV)) + { + } + + //! Creates a coordinate system at the origin with the given standard main direction. + //! Replaces gp::XOY(), gp::YOZ(), gp::ZOX() static functions. + constexpr explicit gp_Ax2(const gp_Dir::D theV) noexcept + : axis(gp_Pnt(0., 0., 0.), theV), + vydir(getPerpendicularYDir(theV)), + vxdir(getPerpendicularXDir(theV)) + { + } + //! Assigns the origin and "main Direction" of the axis A1 to //! this coordinate system, then recomputes its "X Direction" and "Y Direction". //! Note: The new "X Direction" is computed as follows: @@ -367,6 +395,16 @@ public: Standard_EXPORT Standard_Boolean InitFromJson(const Standard_SStream& theSStream, Standard_Integer& theStreamPos); +protected: + //! Helper to compute perpendicular X direction for standard main directions + static constexpr gp_Dir::D getPerpendicularXDir(const gp_Dir::D theMainDir) noexcept; + + //! Helper to compute Y direction (main x X) for standard directions + static constexpr gp_Dir::D getPerpendicularYDir(const gp_Dir::D theMainDir) noexcept; + + //! Helper to compute cross product of two standard directions (right-handed: A x B) + static constexpr gp_Dir::D crossStandardDir(const gp_Dir::D theA, const gp_Dir::D theB) noexcept; + private: gp_Ax1 axis; gp_Dir vydir; @@ -375,6 +413,112 @@ private: //================================================================================================= +inline constexpr gp_Dir::D gp_Ax2::getPerpendicularXDir(const gp_Dir::D theMainDir) noexcept +{ + return (theMainDir == gp_Dir::D::X || theMainDir == gp_Dir::D::NX) ? gp_Dir::D::Y + : (theMainDir == gp_Dir::D::Y || theMainDir == gp_Dir::D::NY) ? gp_Dir::D::Z + : gp_Dir::D::X; +} + +//================================================================================================= + +inline constexpr gp_Dir::D gp_Ax2::getPerpendicularYDir(const gp_Dir::D theMainDir) noexcept +{ + return (theMainDir == gp_Dir::D::Z) ? gp_Dir::D::Y + : (theMainDir == gp_Dir::D::NZ) ? gp_Dir::D::NY + : (theMainDir == gp_Dir::D::X) ? gp_Dir::D::Z + : (theMainDir == gp_Dir::D::NX) ? gp_Dir::D::NZ + : (theMainDir == gp_Dir::D::Y) ? gp_Dir::D::X + : gp_Dir::D::NX; // NY case +} + +//================================================================================================= + +inline constexpr gp_Dir::D gp_Ax2::crossStandardDir(const gp_Dir::D theA, + const gp_Dir::D theB) noexcept +{ + // Handle positive directions first + if (theA == gp_Dir::D::X) + { + if (theB == gp_Dir::D::Y) + return gp_Dir::D::Z; + if (theB == gp_Dir::D::Z) + return gp_Dir::D::NY; + if (theB == gp_Dir::D::NY) + return gp_Dir::D::NZ; + if (theB == gp_Dir::D::NZ) + return gp_Dir::D::Y; + // X x X = 0, X x NX = 0 (parallel, should not happen) + return gp_Dir::D::Z; // fallback + } + if (theA == gp_Dir::D::Y) + { + if (theB == gp_Dir::D::Z) + return gp_Dir::D::X; + if (theB == gp_Dir::D::X) + return gp_Dir::D::NZ; + if (theB == gp_Dir::D::NX) + return gp_Dir::D::Z; + if (theB == gp_Dir::D::NZ) + return gp_Dir::D::NX; + // Y x Y = 0, Y x NY = 0 (parallel, should not happen) + return gp_Dir::D::X; // fallback + } + if (theA == gp_Dir::D::Z) + { + if (theB == gp_Dir::D::X) + return gp_Dir::D::Y; + if (theB == gp_Dir::D::Y) + return gp_Dir::D::NX; + if (theB == gp_Dir::D::NX) + return gp_Dir::D::NY; + if (theB == gp_Dir::D::NY) + return gp_Dir::D::X; + // Z x Z = 0, Z x NZ = 0 (parallel, should not happen) + return gp_Dir::D::Y; // fallback + } + // Handle negative directions: -A x B = -(A x B) + if (theA == gp_Dir::D::NX) + { + if (theB == gp_Dir::D::Y) + return gp_Dir::D::NZ; + if (theB == gp_Dir::D::Z) + return gp_Dir::D::Y; + if (theB == gp_Dir::D::NY) + return gp_Dir::D::Z; + if (theB == gp_Dir::D::NZ) + return gp_Dir::D::NY; + return gp_Dir::D::NZ; // fallback + } + if (theA == gp_Dir::D::NY) + { + if (theB == gp_Dir::D::Z) + return gp_Dir::D::NX; + if (theB == gp_Dir::D::X) + return gp_Dir::D::Z; + if (theB == gp_Dir::D::NX) + return gp_Dir::D::NZ; + if (theB == gp_Dir::D::NZ) + return gp_Dir::D::X; + return gp_Dir::D::NX; // fallback + } + if (theA == gp_Dir::D::NZ) + { + if (theB == gp_Dir::D::X) + return gp_Dir::D::NY; + if (theB == gp_Dir::D::Y) + return gp_Dir::D::X; + if (theB == gp_Dir::D::NX) + return gp_Dir::D::Y; + if (theB == gp_Dir::D::NY) + return gp_Dir::D::NX; + return gp_Dir::D::NY; // fallback + } + return gp_Dir::D::Z; // fallback +} + +//================================================================================================= + inline void gp_Ax2::SetAxis(const gp_Ax1& theA1) { Standard_Real a = theA1.Direction() * vxdir; diff --git a/src/FoundationClasses/TKMath/gp/gp_Ax22d.hxx b/src/FoundationClasses/TKMath/gp/gp_Ax22d.hxx index 1690deaf00..faa4662691 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Ax22d.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Ax22d.hxx @@ -45,9 +45,9 @@ public: //! Creates an object representing the reference //! coordinate system (OXY). - gp_Ax22d() - : vydir(0., 1.) - // vxdir(1.,0.) use default ctor of gp_Dir2d, as it creates the same dir(1, 0) + constexpr gp_Ax22d() noexcept + : vydir(gp_Dir2d::D::Y) + // vxdir default ctor creates X direction (1, 0) { } diff --git a/src/FoundationClasses/TKMath/gp/gp_Ax2d.hxx b/src/FoundationClasses/TKMath/gp/gp_Ax2d.hxx index 87b0c1db47..b7fbfcdfae 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Ax2d.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Ax2d.hxx @@ -60,6 +60,21 @@ public: { } + //! Creates an axis with the given location point and standard direction. + constexpr gp_Ax2d(const gp_Pnt2d& theP, const gp_Dir2d::D theDir) noexcept + : loc(theP), + vdir(theDir) + { + } + + //! Creates an axis at the origin with the given standard direction. + //! Replaces gp::OX2d(), gp::OY2d() static functions. + constexpr explicit gp_Ax2d(const gp_Dir2d::D theDir) noexcept + : loc(0., 0.), + vdir(theDir) + { + } + //! Changes the "Location" point (origin) of . constexpr void SetLocation(const gp_Pnt2d& theP) noexcept { loc = theP; } diff --git a/src/FoundationClasses/TKMath/gp/gp_Ax3.hxx b/src/FoundationClasses/TKMath/gp/gp_Ax3.hxx index 96208eb8c7..e77b69f772 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Ax3.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Ax3.hxx @@ -66,9 +66,10 @@ public: //! Creates an object corresponding to the reference //! coordinate system (OXYZ). - gp_Ax3() - : vydir(0., 1., 0.) - // vxdir(1.,0.,0.) use default ctor of gp_Dir, as it creates the same dir(1,0,0) + constexpr gp_Ax3() noexcept + : vydir(gp_Dir::D::Y), + vxdir(gp_Dir::D::X) + // axis uses default ctor which creates Z axis at origin { } @@ -89,10 +90,37 @@ public: vydir.Cross(vxdir); } + //! Creates an axis placement with standard directions. + //! This constructor allows constexpr and noexcept construction when using standard directions. + constexpr gp_Ax3(const gp_Pnt& theP, const gp_Dir::D theN, const gp_Dir::D theVx) noexcept + : axis(theP, theN), + vydir(crossStandardDir(theN, theVx)), // Y = Z x X (right-handed) + vxdir(theVx) + { + // Note: For standard directions, cross product is computed at compile time + // This constructor assumes theN and theVx are orthogonal standard directions + } + //! Creates an axis placement with the "Location" point //! and the normal direction . Standard_EXPORT gp_Ax3(const gp_Pnt& theP, const gp_Dir& theV); + //! Creates an axis placement with the given location point and standard direction. + constexpr gp_Ax3(const gp_Pnt& theP, const gp_Dir::D theV) noexcept + : axis(theP, theV), + vydir(getPerpendicularYDir(theV)), + vxdir(getPerpendicularXDir(theV)) + { + } + + //! Creates an axis placement at the origin with the given standard direction. + constexpr explicit gp_Ax3(const gp_Dir::D theV) noexcept + : axis(gp_Pnt(0., 0., 0.), theV), + vydir(getPerpendicularYDir(theV)), + vxdir(getPerpendicularXDir(theV)) + { + } + //! Reverses the X direction of . constexpr void XReverse() noexcept { vxdir.Reverse(); } @@ -322,6 +350,15 @@ public: Standard_Integer& theStreamPos); private: + //! Helper to compute perpendicular X direction for standard main directions + static constexpr gp_Dir::D getPerpendicularXDir(const gp_Dir::D theMainDir) noexcept; + + //! Helper to compute Y direction (main x X) for standard directions + static constexpr gp_Dir::D getPerpendicularYDir(const gp_Dir::D theMainDir) noexcept; + + //! Helper to compute cross product of two standard directions (right-handed: A x B) + static constexpr gp_Dir::D crossStandardDir(const gp_Dir::D theA, const gp_Dir::D theB) noexcept; + gp_Ax1 axis; gp_Dir vydir; gp_Dir vxdir; @@ -329,6 +366,112 @@ private: //================================================================================================= +inline constexpr gp_Dir::D gp_Ax3::getPerpendicularXDir(const gp_Dir::D theMainDir) noexcept +{ + return (theMainDir == gp_Dir::D::X || theMainDir == gp_Dir::D::NX) ? gp_Dir::D::Y + : (theMainDir == gp_Dir::D::Y || theMainDir == gp_Dir::D::NY) ? gp_Dir::D::Z + : gp_Dir::D::X; +} + +//================================================================================================= + +inline constexpr gp_Dir::D gp_Ax3::getPerpendicularYDir(const gp_Dir::D theMainDir) noexcept +{ + return (theMainDir == gp_Dir::D::Z) ? gp_Dir::D::Y + : (theMainDir == gp_Dir::D::NZ) ? gp_Dir::D::NY + : (theMainDir == gp_Dir::D::X) ? gp_Dir::D::Z + : (theMainDir == gp_Dir::D::NX) ? gp_Dir::D::NZ + : (theMainDir == gp_Dir::D::Y) ? gp_Dir::D::X + : gp_Dir::D::NX; // NY case +} + +//================================================================================================= + +inline constexpr gp_Dir::D gp_Ax3::crossStandardDir(const gp_Dir::D theA, + const gp_Dir::D theB) noexcept +{ + // Handle positive directions first + if (theA == gp_Dir::D::X) + { + if (theB == gp_Dir::D::Y) + return gp_Dir::D::Z; + if (theB == gp_Dir::D::Z) + return gp_Dir::D::NY; + if (theB == gp_Dir::D::NY) + return gp_Dir::D::NZ; + if (theB == gp_Dir::D::NZ) + return gp_Dir::D::Y; + // X x X = 0, X x NX = 0 (parallel, should not happen) + return gp_Dir::D::Z; // fallback + } + if (theA == gp_Dir::D::Y) + { + if (theB == gp_Dir::D::Z) + return gp_Dir::D::X; + if (theB == gp_Dir::D::X) + return gp_Dir::D::NZ; + if (theB == gp_Dir::D::NX) + return gp_Dir::D::Z; + if (theB == gp_Dir::D::NZ) + return gp_Dir::D::NX; + // Y x Y = 0, Y x NY = 0 (parallel, should not happen) + return gp_Dir::D::X; // fallback + } + if (theA == gp_Dir::D::Z) + { + if (theB == gp_Dir::D::X) + return gp_Dir::D::Y; + if (theB == gp_Dir::D::Y) + return gp_Dir::D::NX; + if (theB == gp_Dir::D::NX) + return gp_Dir::D::NY; + if (theB == gp_Dir::D::NY) + return gp_Dir::D::X; + // Z x Z = 0, Z x NZ = 0 (parallel, should not happen) + return gp_Dir::D::Y; // fallback + } + // Handle negative directions: -A x B = -(A x B) + if (theA == gp_Dir::D::NX) + { + if (theB == gp_Dir::D::Y) + return gp_Dir::D::NZ; + if (theB == gp_Dir::D::Z) + return gp_Dir::D::Y; + if (theB == gp_Dir::D::NY) + return gp_Dir::D::Z; + if (theB == gp_Dir::D::NZ) + return gp_Dir::D::NY; + return gp_Dir::D::NZ; // fallback + } + if (theA == gp_Dir::D::NY) + { + if (theB == gp_Dir::D::Z) + return gp_Dir::D::NX; + if (theB == gp_Dir::D::X) + return gp_Dir::D::Z; + if (theB == gp_Dir::D::NX) + return gp_Dir::D::NZ; + if (theB == gp_Dir::D::NZ) + return gp_Dir::D::X; + return gp_Dir::D::NX; // fallback + } + if (theA == gp_Dir::D::NZ) + { + if (theB == gp_Dir::D::X) + return gp_Dir::D::NY; + if (theB == gp_Dir::D::Y) + return gp_Dir::D::X; + if (theB == gp_Dir::D::NX) + return gp_Dir::D::Y; + if (theB == gp_Dir::D::NY) + return gp_Dir::D::NX; + return gp_Dir::D::NY; // fallback + } + return gp_Dir::D::Z; // fallback +} + +//================================================================================================= + inline gp_Ax3::gp_Ax3(const gp_Ax2& theA) : axis(theA.Axis()), vydir(theA.YDirection()), diff --git a/src/FoundationClasses/TKMath/gp/gp_Circ.hxx b/src/FoundationClasses/TKMath/gp/gp_Circ.hxx index b4c136b0cf..d5d4cf4b9e 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Circ.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Circ.hxx @@ -54,7 +54,7 @@ public: DEFINE_STANDARD_ALLOC //! Creates an indefinite circle. - gp_Circ() + constexpr gp_Circ() noexcept : radius(RealLast()) { } diff --git a/src/FoundationClasses/TKMath/gp/gp_Circ2d.hxx b/src/FoundationClasses/TKMath/gp/gp_Circ2d.hxx index df9686bdeb..ba096d346b 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Circ2d.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Circ2d.hxx @@ -52,7 +52,7 @@ public: DEFINE_STANDARD_ALLOC //! creates an indefinite circle. - gp_Circ2d() noexcept + constexpr gp_Circ2d() noexcept : radius(RealLast()) { } diff --git a/src/FoundationClasses/TKMath/gp/gp_Cone.hxx b/src/FoundationClasses/TKMath/gp/gp_Cone.hxx index aa63968e08..5899e422f8 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Cone.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Cone.hxx @@ -54,7 +54,7 @@ public: DEFINE_STANDARD_ALLOC //! Creates an indefinite Cone. - gp_Cone() + constexpr gp_Cone() noexcept : radius(RealLast()), semiAngle(M_PI * 0.25) { diff --git a/src/FoundationClasses/TKMath/gp/gp_Cylinder.hxx b/src/FoundationClasses/TKMath/gp/gp_Cylinder.hxx index 48eb53651a..1edfca19ed 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Cylinder.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Cylinder.hxx @@ -44,7 +44,10 @@ public: DEFINE_STANDARD_ALLOC //! Creates a indefinite cylinder. - gp_Cylinder() { radius = RealLast(); } + constexpr gp_Cylinder() noexcept + : radius(RealLast()) + { + } //! Creates a cylinder of radius Radius, whose axis is the "main //! Axis" of theA3. theA3 is the local coordinate system of the cylinder. Raises diff --git a/src/FoundationClasses/TKMath/gp/gp_Dir.hxx b/src/FoundationClasses/TKMath/gp/gp_Dir.hxx index 904aefe38b..88cb431572 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Dir.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Dir.hxx @@ -35,6 +35,17 @@ class gp_Trsf; class gp_Dir { public: + //! Standard directions in 3D space for optimized constexpr construction + enum class D + { + X, //!< Direction along positive X axis (1, 0, 0) + Y, //!< Direction along positive Y axis (0, 1, 0) + Z, //!< Direction along positive Z axis (0, 0, 1) + NX, //!< Direction along negative X axis (-1, 0, 0) + NY, //!< Direction along negative Y axis (0, -1, 0) + NZ //!< Direction along negative Z axis (0, 0, -1) + }; + DEFINE_STANDARD_ALLOC //! Creates a direction corresponding to X axis. @@ -43,6 +54,20 @@ public: { } + //! Creates a direction from a standard direction enumeration. + constexpr explicit gp_Dir(const D theDir) noexcept + : coord(theDir == D::X ? 1.0 + : theDir == D::NX ? -1.0 + : 0.0, + theDir == D::Y ? 1.0 + : theDir == D::NY ? -1.0 + : 0.0, + theDir == D::Z ? 1.0 + : theDir == D::NZ ? -1.0 + : 0.0) + { + } + //! Normalizes the vector theV and creates a direction. Raises ConstructionError if //! theV.Magnitude() <= Resolution. gp_Dir(const gp_Vec& theV); diff --git a/src/FoundationClasses/TKMath/gp/gp_Dir2d.hxx b/src/FoundationClasses/TKMath/gp/gp_Dir2d.hxx index 86faacec32..4f041b2071 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Dir2d.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Dir2d.hxx @@ -35,6 +35,15 @@ class gp_Trsf2d; class gp_Dir2d { public: + //! Standard directions in 2D space for optimized constexpr construction + enum class D + { + X, //!< Direction along positive X axis (1, 0) + Y, //!< Direction along positive Y axis (0, 1) + NX, //!< Direction along negative X axis (-1, 0) + NY //!< Direction along negative Y axis (0, -1) + }; + DEFINE_STANDARD_ALLOC //! Creates a direction corresponding to X axis. @@ -43,6 +52,17 @@ public: { } + //! Creates a direction from a standard direction enumeration. + constexpr explicit gp_Dir2d(const D theDir) noexcept + : coord(theDir == D::X ? 1.0 + : theDir == D::NX ? -1.0 + : 0.0, + theDir == D::Y ? 1.0 + : theDir == D::NY ? -1.0 + : 0.0) + { + } + //! Normalizes the vector theV and creates a Direction. Raises ConstructionError if //! theV.Magnitude() <= Resolution from gp. gp_Dir2d(const gp_Vec2d& theV); diff --git a/src/FoundationClasses/TKMath/gp/gp_Elips.hxx b/src/FoundationClasses/TKMath/gp/gp_Elips.hxx index acb60181e3..28e2bd2bee 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Elips.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Elips.hxx @@ -52,7 +52,7 @@ public: DEFINE_STANDARD_ALLOC //! Creates an indefinite ellipse. - gp_Elips() + constexpr gp_Elips() noexcept : majorRadius(RealLast()), minorRadius(RealSmall()) { diff --git a/src/FoundationClasses/TKMath/gp/gp_Elips2d.hxx b/src/FoundationClasses/TKMath/gp/gp_Elips2d.hxx index a15620c97d..08901c43ea 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Elips2d.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Elips2d.hxx @@ -47,7 +47,7 @@ public: DEFINE_STANDARD_ALLOC //! Creates an indefinite ellipse. - gp_Elips2d() noexcept + constexpr gp_Elips2d() noexcept : majorRadius(RealLast()), minorRadius(RealSmall()) { diff --git a/src/FoundationClasses/TKMath/gp/gp_Hypr.hxx b/src/FoundationClasses/TKMath/gp/gp_Hypr.hxx index 6450c20407..824edb760d 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Hypr.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Hypr.hxx @@ -74,7 +74,7 @@ public: DEFINE_STANDARD_ALLOC //! Creates of an indefinite hyperbola. - gp_Hypr() + constexpr gp_Hypr() noexcept : majorRadius(RealLast()), minorRadius(RealFirst()) { diff --git a/src/FoundationClasses/TKMath/gp/gp_Hypr2d.hxx b/src/FoundationClasses/TKMath/gp/gp_Hypr2d.hxx index b58de0c8bd..cf029932d0 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Hypr2d.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Hypr2d.hxx @@ -68,7 +68,7 @@ public: DEFINE_STANDARD_ALLOC //! Creates of an indefinite hyperbola. - gp_Hypr2d() noexcept + constexpr gp_Hypr2d() noexcept : majorRadius(RealLast()), minorRadius(RealLast()) { diff --git a/src/FoundationClasses/TKMath/gp/gp_Lin.hxx b/src/FoundationClasses/TKMath/gp/gp_Lin.hxx index a3762b9e94..7028ae46e4 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Lin.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Lin.hxx @@ -43,10 +43,10 @@ public: //! Creates a Line corresponding to Z axis of the //! reference coordinate system. - gp_Lin() {} + constexpr gp_Lin() noexcept {} //! Creates a line defined by axis theA1. - gp_Lin(const gp_Ax1& theA1) + constexpr gp_Lin(const gp_Ax1& theA1) noexcept : pos(theA1) { } diff --git a/src/FoundationClasses/TKMath/gp/gp_Parab.hxx b/src/FoundationClasses/TKMath/gp/gp_Parab.hxx index f822ab40c3..d63e543a8b 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Parab.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Parab.hxx @@ -53,7 +53,7 @@ public: DEFINE_STANDARD_ALLOC //! Creates an indefinite Parabola. - gp_Parab() + constexpr gp_Parab() noexcept : focalLength(RealLast()) { } diff --git a/src/FoundationClasses/TKMath/gp/gp_Parab2d.hxx b/src/FoundationClasses/TKMath/gp/gp_Parab2d.hxx index b3c7eea544..8d95030919 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Parab2d.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Parab2d.hxx @@ -50,7 +50,7 @@ public: DEFINE_STANDARD_ALLOC //! Creates an indefinite parabola. - gp_Parab2d() noexcept + constexpr gp_Parab2d() noexcept : focalLength(RealLast()) { } diff --git a/src/FoundationClasses/TKMath/gp/gp_Pln.hxx b/src/FoundationClasses/TKMath/gp/gp_Pln.hxx index 14d2992963..f95de8a9db 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Pln.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Pln.hxx @@ -50,7 +50,7 @@ public: //! Creates a plane coincident with OXY plane of the //! reference coordinate system. - gp_Pln() {} + constexpr gp_Pln() noexcept {} //! The coordinate system of the plane is defined with the axis //! placement theA3. @@ -58,7 +58,7 @@ public: //! The "Location" of theA3 defines the location (origin) of the plane. //! The "XDirection" and "YDirection" of theA3 define the "XAxis" and //! the "YAxis" of the plane used to parametrize the plane. - gp_Pln(const gp_Ax3& theA3) + constexpr gp_Pln(const gp_Ax3& theA3) noexcept : pos(theA3) { } diff --git a/src/FoundationClasses/TKMath/gp/gp_Sphere.hxx b/src/FoundationClasses/TKMath/gp/gp_Sphere.hxx index 142de87258..51bb797e95 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Sphere.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Sphere.hxx @@ -45,7 +45,7 @@ public: DEFINE_STANDARD_ALLOC //! Creates an indefinite sphere. - gp_Sphere() + constexpr gp_Sphere() noexcept : radius(RealLast()) { } diff --git a/src/FoundationClasses/TKMath/gp/gp_Torus.hxx b/src/FoundationClasses/TKMath/gp/gp_Torus.hxx index eb7de67d76..133400d062 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Torus.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Torus.hxx @@ -58,7 +58,7 @@ public: DEFINE_STANDARD_ALLOC //! creates an indefinite Torus. - gp_Torus() + constexpr gp_Torus() noexcept : majorRadius(RealLast()), minorRadius(RealSmall()) { diff --git a/src/FoundationClasses/TKernel/GTests/Standard_Dump_Test.cxx b/src/FoundationClasses/TKernel/GTests/Standard_Dump_Test.cxx index bab8cfc278..97bbf8dbb4 100644 --- a/src/FoundationClasses/TKernel/GTests/Standard_Dump_Test.cxx +++ b/src/FoundationClasses/TKernel/GTests/Standard_Dump_Test.cxx @@ -129,7 +129,7 @@ TEST(Standard_DumpTest, gp_Pnt_DumpAndInit) TEST(Standard_DumpTest, gp_Ax3_DumpAndInit_MultipleSeparators) { // Test gp_Ax3 which has multiple fields requiring separators - gp_Ax3 anAxis(gp_Pnt(1, 2, 3), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)); + gp_Ax3 anAxis(gp_Pnt(1, 2, 3), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)); // Serialize std::ostringstream anOStream; diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_WireSplitter_1.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_WireSplitter_1.cxx index 6e57ce88d0..06836f7881 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_WireSplitter_1.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_WireSplitter_1.cxx @@ -833,7 +833,7 @@ Standard_Real Angle2D(const TopoDS_Vertex& aV, Standard_Real Angle(const gp_Dir2d& aDir2D) { - gp_Dir2d aRefDir(1., 0.); + gp_Dir2d aRefDir(gp_Dir2d::D::X); Standard_Real anAngle; anAngle = aRefDir.Angle(aDir2D); diff --git a/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools3D.cxx b/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools3D.cxx index 7102d97b85..fa741c49e5 100644 --- a/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools3D.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools3D.cxx @@ -144,7 +144,7 @@ Standard_Boolean BOPTools_AlgoTools3D::DoSplitSEAMOnFace(const TopoDS_Edge& aSpl // aT = BOPTools_AlgoTools2D::IntermediatePoint(a, b); C2D1->D1(aT, aP2D, aVec2D); - gp_Dir2d aDir2D1(aVec2D), aDOX(-1., 0.), aDOY(0., 1.); + gp_Dir2d aDir2D1(aVec2D), aDOX(gp_Dir2d::D::NX), aDOY(gp_Dir2d::D::Y); // anU = aP2D.X(); anV = aP2D.Y(); @@ -892,7 +892,7 @@ Standard_Integer BOPTools_AlgoTools3D::PointInFace(const TopoDS_Face& // theContext->UVBounds(theF, aUMin, aUMax, aVMin, aVMax); // - gp_Dir2d aD2D(0., 1.); + gp_Dir2d aD2D(gp_Dir2d::D::Y); aUx = IntTools_Tools::IntermediatePoint(aUMin, aUMax); // for (i = 0; i < 2; ++i) diff --git a/src/ModelingAlgorithms/TKBO/GTests/BOPTest_Utilities.pxx b/src/ModelingAlgorithms/TKBO/GTests/BOPTest_Utilities.pxx index e42692323f..5fcf071d8d 100644 --- a/src/ModelingAlgorithms/TKBO/GTests/BOPTest_Utilities.pxx +++ b/src/ModelingAlgorithms/TKBO/GTests/BOPTest_Utilities.pxx @@ -567,7 +567,7 @@ public: const std::vector& theOperations) { // Use default plane (XY plane) - const gp_Pln aPlane(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + const gp_Pln aPlane(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); return CreateProfile(aPlane, theOperations); } @@ -649,7 +649,8 @@ public: static TopoDS_Shape RotateZ(const TopoDS_Shape& theShape, Standard_Real theAngleDeg) { gp_Trsf aRotation; - aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), theAngleDeg * M_PI / 180.0); + aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), + theAngleDeg * M_PI / 180.0); BRepBuilderAPI_Transform aTransform(theShape, aRotation); return aTransform.Shape(); } @@ -658,7 +659,8 @@ public: static TopoDS_Shape RotateY(const TopoDS_Shape& theShape, Standard_Real theAngleDeg) { gp_Trsf aRotation; - aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 1, 0)), theAngleDeg * M_PI / 180.0); + aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Y)), + theAngleDeg * M_PI / 180.0); BRepBuilderAPI_Transform aTransform(theShape, aRotation); return aTransform.Shape(); } @@ -667,7 +669,8 @@ public: static TopoDS_Shape RotateX(const TopoDS_Shape& theShape, Standard_Real theAngleDeg) { gp_Trsf aRotation; - aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0)), theAngleDeg * M_PI / 180.0); + aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::X)), + theAngleDeg * M_PI / 180.0); BRepBuilderAPI_Transform aTransform(theShape, aRotation); return aTransform.Shape(); } @@ -695,7 +698,7 @@ public: static TopoDS_Shape RotateY90(const TopoDS_Shape& theShape) { gp_Trsf aRotation; - aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 1), gp_Dir(0, 1, 0)), 90.0 * M_PI / 180.0); + aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 1), gp_Dir(gp_Dir::D::Y)), 90.0 * M_PI / 180.0); BRepBuilderAPI_Transform aTransform(theShape, aRotation); return aTransform.Shape(); } diff --git a/src/ModelingAlgorithms/TKBO/GTests/BRepAlgoAPI_Cut_Test.cxx b/src/ModelingAlgorithms/TKBO/GTests/BRepAlgoAPI_Cut_Test.cxx index 947632b1c8..62544ccdb9 100644 --- a/src/ModelingAlgorithms/TKBO/GTests/BRepAlgoAPI_Cut_Test.cxx +++ b/src/ModelingAlgorithms/TKBO/GTests/BRepAlgoAPI_Cut_Test.cxx @@ -629,7 +629,7 @@ TEST_F(BCutSimpleTest, NurbsBoxMinusRotatedRectangularBox_F1) constexpr Standard_Real r = M_SQRT2; TopoDS_Shape aRectangularBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), r, r / 2.0, 1.0); aRectangularBox = BOPTest_Utilities::RotateShape(aRectangularBox, - gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), + gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), 45.0 * M_PI / 180.0); const TopoDS_Shape aResult = PerformCut(aNurbsBox, aRectangularBox); ValidateResult(aResult, 4.41421); @@ -643,7 +643,7 @@ TEST_F(BCutSimpleTest, RotatedRectangularBoxMinusNurbsBox_F2) constexpr Standard_Real r = M_SQRT2; TopoDS_Shape aRectangularBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), r, r / 2.0, 1.0); aRectangularBox = BOPTest_Utilities::RotateShape(aRectangularBox, - gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), + gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), 45.0 * M_PI / 180.0); const TopoDS_Shape aResult = PerformCut(aRectangularBox, aNurbsBox); ValidateResult(aResult, 5.82843); @@ -657,7 +657,7 @@ TEST_F(BCutSimpleTest, NurbsBoxMinusRotatedSquareBox_F3) const Standard_Real r = sqrt(2.0) / 2.0; TopoDS_Shape aSquareBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), r, r, 1.0); aSquareBox = BOPTest_Utilities::RotateShape(aSquareBox, - gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), + gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), 45.0 * M_PI / 180.0); const TopoDS_Shape aResult = PerformCut(aNurbsBox, aSquareBox); ValidateResult(aResult, 5.91421); @@ -671,7 +671,7 @@ TEST_F(BCutSimpleTest, RotatedSquareBoxMinusNurbsBox_F4) const Standard_Real r = sqrt(2.0) / 2.0; TopoDS_Shape aSquareBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), r, r, 1.0); aSquareBox = BOPTest_Utilities::RotateShape(aSquareBox, - gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), + gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), 45.0 * M_PI / 180.0); const TopoDS_Shape aResult = PerformCut(aSquareBox, aNurbsBox); ValidateResult(aResult, 2.91421); @@ -685,7 +685,7 @@ TEST_F(BCutSimpleTest, NurbsBoxMinusRotatedThinBox_F5) constexpr Standard_Real r = M_SQRT2; TopoDS_Shape aThinBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), r, 0.25, 1.0); aThinBox = BOPTest_Utilities::RotateShape(aThinBox, - gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), + gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), 45.0 * M_PI / 180.0); const TopoDS_Shape aResult = PerformCut(aNurbsBox, aThinBox); ValidateResult(aResult, 7.03921); @@ -699,7 +699,7 @@ TEST_F(BCutSimpleTest, RotatedThinBoxMinusNurbsBox_F6) constexpr Standard_Real r = M_SQRT2; TopoDS_Shape aThinBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), r, 0.25, 1.0); aThinBox = BOPTest_Utilities::RotateShape(aThinBox, - gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), + gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), 45.0 * M_PI / 180.0); const TopoDS_Shape aResult = PerformCut(aThinBox, aNurbsBox); ValidateResult(aResult, 1.83211); @@ -713,7 +713,7 @@ TEST_F(BCutSimpleTest, NurbsBoxMinusRotatedNarrowBox_F7) constexpr Standard_Real r = 5.5677643628300219; // sqrt(31.0) TopoDS_Shape aNarrowBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), r / 4.0, 0.25, 1.0); aNarrowBox = BOPTest_Utilities::RotateShape(aNarrowBox, - gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), + gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), 34.73 * M_PI / 180.0); const TopoDS_Shape aResult = PerformCut(aNurbsBox, aNarrowBox); ValidateResult(aResult, 7.21677); @@ -727,7 +727,7 @@ TEST_F(BCutSimpleTest, RotatedNarrowBoxMinusNurbsBox_F8) constexpr Standard_Real r = 5.5677643628300219; TopoDS_Shape aNarrowBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), r / 4.0, 0.25, 1.0); aNarrowBox = BOPTest_Utilities::RotateShape(aNarrowBox, - gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), + gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), 34.73 * M_PI / 180.0); const TopoDS_Shape aResult = PerformCut(aNarrowBox, aNurbsBox); ValidateResult(aResult, 1.54631); @@ -756,10 +756,10 @@ TEST_F(BCutSimpleTest, RotatedSphereMinusBox_G2) { TopoDS_Shape aSphere = BOPTest_Utilities::CreateSphere(gp_Pnt(0, 0, 0), 1.0); aSphere = BOPTest_Utilities::RotateShape(aSphere, - gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), + gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), -90.0 * M_PI / 180.0); aSphere = BOPTest_Utilities::RotateShape(aSphere, - gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 1, 0)), + gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Y)), -45.0 * M_PI / 180.0); const TopoDS_Shape aBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), 1.0, 1.0, 1.0); const TopoDS_Shape aResult = PerformCut(aSphere, aBox); @@ -771,10 +771,10 @@ TEST_F(BCutSimpleTest, BoxMinusRotatedSphere_G3) { TopoDS_Shape aSphere = BOPTest_Utilities::CreateSphere(gp_Pnt(0, 0, 0), 1.0); aSphere = BOPTest_Utilities::RotateShape(aSphere, - gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), + gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), -90.0 * M_PI / 180.0); aSphere = BOPTest_Utilities::RotateShape(aSphere, - gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 1, 0)), + gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Y)), -45.0 * M_PI / 180.0); const TopoDS_Shape aBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), 1.0, 1.0, 1.0); const TopoDS_Shape aResult = PerformCut(aBox, aSphere); @@ -787,7 +787,7 @@ TEST_F(BCutSimpleTest, SphereMinusRotatedBox_G4) const TopoDS_Shape aSphere = BOPTest_Utilities::CreateSphere(gp_Pnt(0, 0, 0), 1.0); TopoDS_Shape aBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), 1.0, 1.0, 1.0); aBox = BOPTest_Utilities::RotateShape(aBox, - gp_Ax1(gp_Pnt(0, 0, 1), gp_Dir(0, 1, 0)), + gp_Ax1(gp_Pnt(0, 0, 1), gp_Dir(gp_Dir::D::Y)), 90.0 * M_PI / 180.0); const TopoDS_Shape aResult = PerformCut(aSphere, aBox); ValidateResult(aResult, 13.3517); @@ -799,7 +799,7 @@ TEST_F(BCutSimpleTest, RotatedBoxMinusSphere_G5) const TopoDS_Shape aSphere = BOPTest_Utilities::CreateSphere(gp_Pnt(0, 0, 0), 1.0); TopoDS_Shape aBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), 1.0, 1.0, 1.0); aBox = BOPTest_Utilities::RotateShape(aBox, - gp_Ax1(gp_Pnt(0, 0, 1), gp_Dir(0, 1, 0)), + gp_Ax1(gp_Pnt(0, 0, 1), gp_Dir(gp_Dir::D::Y)), 90.0 * M_PI / 180.0); const TopoDS_Shape aResult = PerformCut(aBox, aSphere); ValidateResult(aResult, 5.2146); @@ -812,7 +812,7 @@ TEST_F(BCutSimpleTest, ComplexProfileRevolOperation_G6) const TopoDS_Shape aBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), 100.0, 100.0, 40.0); // Create exact G6 profile: "profile rev S b_4 F 50 20 Y 50 C 10 180 Y -50 C 10 180" - gp_Pln aPlane(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1)); // Face b_4 of box (top face at Z=40) + gp_Pln aPlane(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z)); // Face b_4 of box (top face at Z=40) std::vector aProfileOps = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::F, 50.0, 20.0), // F 50 20 BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::Y, 50.0), // Y 50 @@ -825,7 +825,7 @@ TEST_F(BCutSimpleTest, ComplexProfileRevolOperation_G6) // Create revolution: "revol rev2 rev 0 0 50 0 1 0 360" (around Y-axis at Z=50) const TopoDS_Shape aRevolution = BOPTest_Utilities::CreateRevolution(aProfile, - gp_Ax1(gp_Pnt(0, 0, 50), gp_Dir(0, 1, 0)), + gp_Ax1(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Y)), 2.0 * M_PI); // Perform boolean cut operation: "bcut result b rev2" @@ -964,7 +964,7 @@ TEST_F(BCutSimpleTest, ComplexCylinderConeOperationPro13307_H3) TEST_F(BCutSimpleTest, ComplexProfileForwardForward_H4) { // Create profile p1: "profile p1 o 0 0 40 x 150 y 200 x -150" - gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1)); + gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps1 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -978,7 +978,7 @@ TEST_F(BCutSimpleTest, ComplexProfileForwardForward_H4) const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40)); // Create profile p2: "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1022,7 +1022,7 @@ TEST_F(BCutSimpleTest, ComplexProfileForwardForwardVariation_H5) // H5 has same profiles as H4, but p3 has different sequence: "f 50 -75 y -100 x 75 y 100" // Create profile p1: same as H4 "profile p1 o 0 0 40 x 150 y 200 x -150" - gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1)); + gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps1 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1036,7 +1036,7 @@ TEST_F(BCutSimpleTest, ComplexProfileForwardForwardVariation_H5) const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40)); // Create profile p2: same as H4 "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1076,7 +1076,7 @@ TEST_F(BCutSimpleTest, ComplexProfileForwardForwardVariation_H5) TEST_F(BCutSimpleTest, ComplexProfileForwardReversed_H6) { // Create profile p1: same as H4/H5 "profile p1 o 0 0 40 x 150 y 200 x -150" - gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1)); + gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps1 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1090,7 +1090,7 @@ TEST_F(BCutSimpleTest, ComplexProfileForwardReversed_H6) const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40)); // Create profile p2: same as H4/H5 "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1130,7 +1130,7 @@ TEST_F(BCutSimpleTest, ComplexProfileForwardReversed_H6) TEST_F(BCutSimpleTest, ComplexProfileForwardReversedVariation_H7) { // Create profile p1: same as other H tests "profile p1 o 0 0 40 x 150 y 200 x -150" - gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1)); + gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps1 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1144,7 +1144,7 @@ TEST_F(BCutSimpleTest, ComplexProfileForwardReversedVariation_H7) const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40)); // Create profile p2: same as other H tests "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1184,7 +1184,7 @@ TEST_F(BCutSimpleTest, ComplexProfileForwardReversedVariation_H7) TEST_F(BCutSimpleTest, ComplexProfileReversedForward_H8) { // Create profile p1: "profile p1 p 0 0 -1 1 0 0 o 0 0 40 y -200 x 150 y 200" - gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1)); // Use same approach as working H4/H5 + gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z)); // Use same approach as working H4/H5 std::vector aProfileOps1 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1198,7 +1198,7 @@ TEST_F(BCutSimpleTest, ComplexProfileReversedForward_H8) const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40)); // Create profile p2: "profile p2 p 0 0 -1 1 0 0 o 0 0 50 f 25 -25 x 75 y -100 x -75" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1238,7 +1238,7 @@ TEST_F(BCutSimpleTest, ComplexProfileReversedForward_H8) TEST_F(BCutSimpleTest, ComplexProfileReversedForwardVariation_H9) { // Create profile p1: same as H8 "profile p1 p 0 0 -1 1 0 0 o 0 0 40 y -200 x 150 y 200" - gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1)); + gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps1 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1252,7 +1252,7 @@ TEST_F(BCutSimpleTest, ComplexProfileReversedForwardVariation_H9) const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40)); // Create profile p2: same as H8 "profile p2 p 0 0 -1 1 0 0 o 0 0 50 f 25 -25 x 75 y -100 x -75" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1292,7 +1292,7 @@ TEST_F(BCutSimpleTest, ComplexProfileReversedForwardVariation_H9) TEST_F(BCutSimpleTest, ComplexProfileReversedReversed_I1) { // Create profile p1: same as H8/H9 "profile p1 p 0 0 -1 1 0 0 o 0 0 40 y -200 x 150 y 200" - gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1)); + gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps1 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1307,7 +1307,7 @@ TEST_F(BCutSimpleTest, ComplexProfileReversedReversed_I1) // Create profile p2: same as H8/H9 "profile p2 p 0 0 -1 1 0 0 o 0 0 50 f 25 -25 x 75 y -100 x // -75" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1347,7 +1347,7 @@ TEST_F(BCutSimpleTest, ComplexProfileReversedReversed_I1) TEST_F(BCutSimpleTest, ComplexProfileReversedReversedVariation_I2) { // Create profile p1: same as I1 "profile p1 p 0 0 -1 1 0 0 o 0 0 40 y -200 x 150 y 200" - gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1)); + gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps1 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1361,7 +1361,7 @@ TEST_F(BCutSimpleTest, ComplexProfileReversedReversedVariation_I2) const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40)); // Create profile p2: same as I1 "profile p2 p 0 0 -1 1 0 0 o 0 0 50 f 25 -25 x 75 y -100 x -75" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1401,7 +1401,7 @@ TEST_F(BCutSimpleTest, ComplexProfileReversedReversedVariation_I2) TEST_F(BCutSimpleTest, ComplexProfileForwardForwardVariation2_I3) { // Create profile p1: "profile p1 o 0 0 40 f 0 50 x 150 y 100 x -150" - gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1)); + gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps1 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1417,7 +1417,7 @@ TEST_F(BCutSimpleTest, ComplexProfileForwardForwardVariation2_I3) // Create profile p2: same as I1/I2 but different plane "profile p2 o 0 0 50 f 25 25 y 100 x 75 y // -100" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1457,7 +1457,7 @@ TEST_F(BCutSimpleTest, ComplexProfileForwardForwardVariation2_I3) TEST_F(BCutSimpleTest, ComplexProfileForwardForwardVariation3_I4) { // Create profile p1: same as I3 "profile p1 o 0 0 40 f 0 50 x 150 y 100 x -150" - gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1)); + gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps1 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1472,7 +1472,7 @@ TEST_F(BCutSimpleTest, ComplexProfileForwardForwardVariation3_I4) const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40)); // Create profile p2: same as I3 "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1514,7 +1514,7 @@ TEST_F(BCutSimpleTest, ComplexProfileForwardForwardVariation3_I4) TEST_F(BCutSimpleTest, ComplexProfileForwardReversedVariation2_I5) { // Create profile p1: same as I3/I4 "profile p1 o 0 0 40 f 0 50 x 150 y 100 x -150" - gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1)); + gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps1 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1529,7 +1529,7 @@ TEST_F(BCutSimpleTest, ComplexProfileForwardReversedVariation2_I5) const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40)); // Create profile p2: same as I3/I4 "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1569,7 +1569,7 @@ TEST_F(BCutSimpleTest, ComplexProfileForwardReversedVariation2_I5) TEST_F(BCutSimpleTest, ComplexProfileForwardReversedVariation3_I6) { // Same profiles as I5 but different p3 - "profile p3 o 0 0 50 f 50 75 y 100 x 75 y -100" - gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1)); + gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps1 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, 0.0, 40.0), BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::F, 0.0, 50.0), @@ -1579,7 +1579,7 @@ TEST_F(BCutSimpleTest, ComplexProfileForwardReversedVariation3_I6) const TopoDS_Shape aProfile1 = BOPTest_Utilities::CreateProfile(aPlane1, aProfileOps1); const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40)); - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, 0.0, 50.0), BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::F, 25.0, 25.0), @@ -1610,7 +1610,7 @@ TEST_F(BCutSimpleTest, ComplexProfileForwardReversedVariation3_I6) TEST_F(BCutSimpleTest, ComplexProfileReversedForwardVariation2_I7) { // Create profile p1: "profile p1 p 0 0 -1 1 0 0 o 0 0 40 f 0 -50 y -100 x 150 y 100" - gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1)); + gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps1 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1625,7 +1625,7 @@ TEST_F(BCutSimpleTest, ComplexProfileReversedForwardVariation2_I7) const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40)); // Create profile p2: "profile p2 p 0 0 -1 1 0 0 o 0 0 50 f 25 -25 x 75 y -100 x -75" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1665,7 +1665,7 @@ TEST_F(BCutSimpleTest, ComplexProfileReversedForwardVariation2_I7) TEST_F(BCutSimpleTest, ComplexProfileReversedForwardVariation3_I8) { // Create profile p1: "profile p1 p 0 0 -1 1 0 0 o 0 0 40 f 0 -50 y -100 x 150 y 100" - gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1)); + gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps1 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1680,7 +1680,7 @@ TEST_F(BCutSimpleTest, ComplexProfileReversedForwardVariation3_I8) const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40)); // Create profile p2: "profile p2 p 0 0 -1 1 0 0 o 0 0 50 f 25 -25 x 75 y -100 x -75" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1720,7 +1720,7 @@ TEST_F(BCutSimpleTest, ComplexProfileReversedForwardVariation3_I8) TEST_F(BCutSimpleTest, ComplexProfileReversedReversedVariation2_I9) { // Create profile p1: "profile p1 p 0 0 -1 1 0 0 o 0 0 40 f 0 -50 y -100 x 150 y 100" - gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1)); + gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps1 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1735,7 +1735,7 @@ TEST_F(BCutSimpleTest, ComplexProfileReversedReversedVariation2_I9) const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40)); // Create profile p2: "profile p2 p 0 0 -1 1 0 0 o 0 0 50 f 25 -25 x 75 y -100 x -75" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, diff --git a/src/ModelingAlgorithms/TKBO/GTests/BRepAlgoAPI_Cut_Test_1.cxx b/src/ModelingAlgorithms/TKBO/GTests/BRepAlgoAPI_Cut_Test_1.cxx index 74a2a66b3d..d511d7b8e4 100644 --- a/src/ModelingAlgorithms/TKBO/GTests/BRepAlgoAPI_Cut_Test_1.cxx +++ b/src/ModelingAlgorithms/TKBO/GTests/BRepAlgoAPI_Cut_Test_1.cxx @@ -26,7 +26,7 @@ class BCutSimpleTest1 : public BRepAlgoAPI_TestBase TEST_F(BCutSimpleTest1, ComplexProfileReversedReversedVariation3_J1) { // Create profile p1: "profile p1 p 0 0 -1 1 0 0 o 0 0 40 f 0 -50 y -100 x 150 y 100" - gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(0, 0, 1)); + gp_Pln aPlane1(gp_Pnt(0, 0, 40), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps1 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -41,7 +41,7 @@ TEST_F(BCutSimpleTest1, ComplexProfileReversedReversedVariation3_J1) const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40)); // Create profile p2: "profile p2 p 0 0 -1 1 0 0 o 0 0 50 f 25 -25 x 75 y -100 x -75" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -120,7 +120,7 @@ TEST_F(BCutSimpleTest1, ComplexProfileWithTranslationForwardReversedForward_J3) BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 175, 250, -40); // Create profile p2: "profile p2 o 0 0 50 f 25 25 y 75 x 50 y -75" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -204,7 +204,7 @@ TEST_F(BCutSimpleTest1, ComplexProfileReversedReversedForward_J4) BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 175, 250, -40); // Create profile p2: "profile p2 p 0 0 -1 1 0 0 o 0 0 50 f 25 -25 y -75 x 50 y 75" - gp_Pln aPlane2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::P, 0.0, @@ -292,7 +292,7 @@ TEST_F(BCutSimpleTest1, ComplexProfileForwardForwardForwardVariation_J5) BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 175, 250, -40); // Create profile p2: "profile p2 o 0 0 50 f 25 25 y 75 x 50 y -75" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -359,7 +359,7 @@ TEST_F(BCutSimpleTest1, ComplexProfileForwardReversedForwardVariation_J6) BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 175, 250, -40); // Create profile p2: "profile p2 o 0 0 50 f 25 25 y 75 x 50 y -75" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -426,7 +426,7 @@ TEST_F(BCutSimpleTest1, ComplexProfileReversedReversedForwardVariation_J7) BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 175, 250, -40); // Create profile p2: "profile p2 p 0 0 -1 1 0 0 o 0 0 50 f 25 -25 y -75 x 50 y 75" - gp_Pln aPlane2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::P, 0.0, @@ -500,7 +500,7 @@ TEST_F(BCutSimpleTest1, SameOrientedProfileForwardForward_J8) BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 150, 200, -40); // Create profile p2: "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -520,7 +520,7 @@ TEST_F(BCutSimpleTest1, SameOrientedProfileForwardForward_J8) const TopoDS_Shape aIntermediate = aCutOp1.Shape(); // Create profile p3: "profile p3 o 0 0 -10 f 50 75 y 100 x 75 y -100" - gp_Pln aPlane3(gp_Pnt(0, 0, -10), gp_Dir(0, 0, 1)); + gp_Pln aPlane3(gp_Pnt(0, 0, -10), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps3 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -547,7 +547,7 @@ TEST_F(BCutSimpleTest1, SameOrientedProfileForwardForwardWithReversed_J9) BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 150, 200, -40); // Create profile p2: "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -567,7 +567,7 @@ TEST_F(BCutSimpleTest1, SameOrientedProfileForwardForwardWithReversed_J9) const TopoDS_Shape aIntermediate = aCutOp1.Shape(); // Create profile p3: "profile p3 o 0 0 -10 f 50 75 x 75 y 100 x -75" - gp_Pln aPlane3(gp_Pnt(0, 0, -10), gp_Dir(0, 0, 1)); + gp_Pln aPlane3(gp_Pnt(0, 0, -10), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps3 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -594,7 +594,7 @@ TEST_F(BCutSimpleTest1, SameOrientedProfileForwardReversed_K1) BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 150, 200, -40); // Create profile p2: "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -614,7 +614,7 @@ TEST_F(BCutSimpleTest1, SameOrientedProfileForwardReversed_K1) const TopoDS_Shape aIntermediate = aCutOp1.Shape(); // Create profile p3: "profile p3 p 0 0 -1 1 0 0 o 0 0 -10 f 50 -75 y -100 x 75 y 100" - gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(1, 0, 0)); + gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(gp_Dir::D::X)); std::vector aProfileOps3 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -641,7 +641,7 @@ TEST_F(BCutSimpleTest1, SameOrientedProfileForwardObjectReversedTool_K2) BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 150, 200, -40); // Create profile p2: "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -661,7 +661,7 @@ TEST_F(BCutSimpleTest1, SameOrientedProfileForwardObjectReversedTool_K2) const TopoDS_Shape aIntermediate = aCutOp1.Shape(); // Create profile p3: "profile p3 p 0 0 -1 1 0 0 o 0 0 -10 f 50 -75 x 75 y -100 x -75" - gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(1, 0, 0)); + gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(gp_Dir::D::X)); std::vector aProfileOps3 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -684,7 +684,7 @@ TEST_F(BCutSimpleTest1, SameOrientedProfileForwardObjectReversedTool_K2) TEST_F(BCutSimpleTest1, SameOrientedProfileReversedObjectForwardTool_K3) { // Create profile p1: "profile p1 p 0 0 -1 1 0 0 o 0 0 40 y -200 x 150 y 200" - gp_Pln aPlane1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + gp_Pln aPlane1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps1 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::P, 0.0, @@ -705,7 +705,7 @@ TEST_F(BCutSimpleTest1, SameOrientedProfileReversedObjectForwardTool_K3) const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40)); // Create profile p2: "profile p2 p 0 0 -1 1 0 0 o 0 0 50 f 25 -25 x 75 y -100 x -75" - gp_Pln aPlane2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::P, 0.0, @@ -732,7 +732,7 @@ TEST_F(BCutSimpleTest1, SameOrientedProfileReversedObjectForwardTool_K3) const TopoDS_Shape aIntermediate = aCutOp1.Shape(); // Create profile p3: "profile p3 o 0 0 -10 f 50 75 y 100 x 75 y -100" - gp_Pln aPlane3(gp_Pnt(0, 0, -10), gp_Dir(0, 0, 1)); + gp_Pln aPlane3(gp_Pnt(0, 0, -10), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps3 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -755,7 +755,7 @@ TEST_F(BCutSimpleTest1, SameOrientedProfileReversedObjectForwardTool_K3) TEST_F(BCutSimpleTest1, SameOrientedProfileReversedObjectReversedTool_K4) { // Create profile p1: "profile p1 p 0 0 -1 1 0 0 o 0 0 40 y -200 x 150 y 200" - gp_Pln aPlane1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + gp_Pln aPlane1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps1 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::P, 0.0, @@ -776,7 +776,7 @@ TEST_F(BCutSimpleTest1, SameOrientedProfileReversedObjectReversedTool_K4) const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, -40)); // Create profile p2: "profile p2 p 0 0 -1 1 0 0 o 0 0 50 f 25 -25 x 75 y -100 x -75" - gp_Pln aPlane2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::P, 0.0, @@ -803,7 +803,7 @@ TEST_F(BCutSimpleTest1, SameOrientedProfileReversedObjectReversedTool_K4) const TopoDS_Shape aIntermediate = aCutOp1.Shape(); // Create profile p3: "profile p3 o 0 0 -10 f 50 75 x 75 y 100 x -75" - gp_Pln aPlane3(gp_Pnt(0, 0, -10), gp_Dir(0, 0, 1)); + gp_Pln aPlane3(gp_Pnt(0, 0, -10), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps3 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -830,7 +830,7 @@ TEST_F(BCutSimpleTest1, SameOrientedProfileForwardReversedRepeated_K5) BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 150, 200, -40); // Create profile p2: "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -850,7 +850,7 @@ TEST_F(BCutSimpleTest1, SameOrientedProfileForwardReversedRepeated_K5) const TopoDS_Shape aIntermediate = aCutOp1.Shape(); // Create profile p3: "profile p3 p 0 0 -1 1 0 0 o 0 0 -10 f 50 -75 y -100 x 75 y 100" - gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(1, 0, 0)); + gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(gp_Dir::D::X)); std::vector aProfileOps3 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -877,7 +877,7 @@ TEST_F(BCutSimpleTest1, SameOrientedProfileForwardObjectReversedToolVar_K6) BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 150, 200, -40); // Create profile p2: "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -897,7 +897,7 @@ TEST_F(BCutSimpleTest1, SameOrientedProfileForwardObjectReversedToolVar_K6) const TopoDS_Shape aIntermediate = aCutOp1.Shape(); // Create profile p3: "profile p3 p 0 0 -1 1 0 0 o 0 0 -10 f 50 -75 x 75 y -100 x -75" - gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(1, 0, 0)); + gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(gp_Dir::D::X)); std::vector aProfileOps3 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -924,7 +924,7 @@ TEST_F(BCutSimpleTest1, ComplexMultiStepProfileAllForward_K7) BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 175, 250, -40); // Create profile p2: "profile p2 o 0 0 50 f 25 25 y 75 x 50 y -75" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -944,7 +944,7 @@ TEST_F(BCutSimpleTest1, ComplexMultiStepProfileAllForward_K7) const TopoDS_Shape aIntermediate1 = aCutOp1.Shape(); // Create profile p3: "profile p3 p 0 0 -1 1 0 0 o 0 0 20 f 100 -150 y -75 x 50 y 75" - gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(1, 0, 0)); + gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(gp_Dir::D::X)); std::vector aProfileOps3 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -966,7 +966,7 @@ TEST_F(BCutSimpleTest1, ComplexMultiStepProfileAllForward_K7) const TopoDS_Shape aIntermediate2 = aCutOp2.Shape(); // Create profile p4: "profile p4 o 0 0 25 f 50 75 x 75 y 100 x -75" - gp_Pln aPlane4(gp_Pnt(0, 0, 25), gp_Dir(0, 0, 1)); + gp_Pln aPlane4(gp_Pnt(0, 0, 25), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps4 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -993,7 +993,7 @@ TEST_F(BCutSimpleTest1, DiffOrientedProfileAllForward_K8) BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 150, 200, -40); // Create profile p2: "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1013,7 +1013,7 @@ TEST_F(BCutSimpleTest1, DiffOrientedProfileAllForward_K8) const TopoDS_Shape aIntermediate = aCutOp1.Shape(); // Create profile p3: "profile p3 p 0 0 -1 1 0 0 o 0 0 50 f 50 -125 x 75 y -50 x -75" - gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(1, 0, 0)); + gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(gp_Dir::D::X)); std::vector aProfileOps3 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1042,7 +1042,7 @@ TEST_F(BCutSimpleTest1, DiffOrientedProfileAllForwardVar_K9) BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 150, 200, -40); // Create profile p2: "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1062,7 +1062,7 @@ TEST_F(BCutSimpleTest1, DiffOrientedProfileAllForwardVar_K9) const TopoDS_Shape aIntermediate = aCutOp1.Shape(); // Create profile p3: "profile p3 p 0 0 -1 1 0 0 o 0 0 50 f 25 -125 x 50 y -50 x -50" - gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(1, 0, 0)); + gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(gp_Dir::D::X)); std::vector aProfileOps3 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1091,7 +1091,7 @@ TEST_F(BCutSimpleTest1, DiffOrientedProfileAllForward_L1) BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 150, 200, -40); // Create profile p2: "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1111,7 +1111,7 @@ TEST_F(BCutSimpleTest1, DiffOrientedProfileAllForward_L1) const TopoDS_Shape aIntermediate = aCutOp1.Shape(); // Create profile p3: "profile p3 p 0 0 -1 1 0 0 o 0 0 50 f 50 25 x 25 y -280 x -25" - gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(1, 0, 0)); + gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(gp_Dir::D::X)); std::vector aProfileOps3 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1138,7 +1138,7 @@ TEST_F(BCutSimpleTest1, DiffOrientedProfileForwardObjectReversedTool_L2) BOPTest_Utilities::CreateRectangularPrism(gp_Pnt(0, 0, 40), 150, 200, -40); // Create profile p2: "profile p2 o 0 0 50 f 25 25 y 100 x 75 y -100" - gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 50), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1158,7 +1158,7 @@ TEST_F(BCutSimpleTest1, DiffOrientedProfileForwardObjectReversedTool_L2) const TopoDS_Shape aIntermediate = aCutOp1.Shape(); // Create profile p3: "profile p3 o 0 0 20 f 50 255 y -280 x 25 y 280" - gp_Pln aPlane3(gp_Pnt(0, 0, 20), gp_Dir(0, 0, 1)); + gp_Pln aPlane3(gp_Pnt(0, 0, 20), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps3 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1181,7 +1181,7 @@ TEST_F(BCutSimpleTest1, DiffOrientedProfileForwardObjectReversedTool_L2) TEST_F(BCutSimpleTest1, RolexCaseForwardForward_L3) { // Create profile f1: "profile f1 c 60 360" - gp_Pln aPlane1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + gp_Pln aPlane1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps1 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::C, 60.0, 360.0) // c 60 360 }; @@ -1189,7 +1189,7 @@ TEST_F(BCutSimpleTest1, RolexCaseForwardForward_L3) const TopoDS_Shape aPrism1 = BOPTest_Utilities::CreatePrism(aProfile1, gp_Vec(0, 0, 20)); // Create profile f2: "profile f2 o 0 0 20 f 10 -20 c 40 360" - gp_Pln aPlane2(gp_Pnt(0, 0, 20), gp_Dir(0, 0, 1)); + gp_Pln aPlane2(gp_Pnt(0, 0, 20), gp_Dir(gp_Dir::D::Z)); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, @@ -1207,7 +1207,7 @@ TEST_F(BCutSimpleTest1, RolexCaseForwardForward_L3) const TopoDS_Shape aIntermediate = aCutOp1.Shape(); // Create profile f3: "profile f3 p 0 0 -1 1 0 0 o 0 0 23 f 50 -10 c -30 360" - gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(1, 0, 0)); + gp_Pln aPlane3(gp_Pnt(0, 0, -1), gp_Dir(gp_Dir::D::X)); std::vector aProfileOps3 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::O, 0.0, diff --git a/src/ModelingAlgorithms/TKBO/GTests/BRepAlgoAPI_Fuse_Test.cxx b/src/ModelingAlgorithms/TKBO/GTests/BRepAlgoAPI_Fuse_Test.cxx index 80fec7e4ff..0162fe8e08 100644 --- a/src/ModelingAlgorithms/TKBO/GTests/BRepAlgoAPI_Fuse_Test.cxx +++ b/src/ModelingAlgorithms/TKBO/GTests/BRepAlgoAPI_Fuse_Test.cxx @@ -387,7 +387,7 @@ TEST_F(BFuseSimpleTest, NurbsBoxPlusRotatedNarrowBox_D1) constexpr Standard_Real r = M_SQRT2; TopoDS_Shape aBox2 = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), r, 0.25, 1.0); gp_Trsf aTrsf; - aTrsf.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), M_PI / 4.0); // 45 degrees + aTrsf.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), M_PI / 4.0); // 45 degrees aBox2.Move(aTrsf); const TopoDS_Shape aResult = PerformFuse(aBox2, aBox1); @@ -404,7 +404,7 @@ TEST_F(BFuseSimpleTest, NurbsBoxPlusRotatedNarrowBoxVariation_D2) constexpr Standard_Real r = 5.5677643628300219; TopoDS_Shape aBox2 = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), r / 4.0, 0.25, 1.0); gp_Trsf aTrsf; - aTrsf.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), 34.73 * M_PI / 180.0); + aTrsf.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), 34.73 * M_PI / 180.0); aBox2.Move(aTrsf); const TopoDS_Shape aResult = PerformFuse(aBox2, aBox1); @@ -438,8 +438,8 @@ TEST_F(BFuseSimpleTest, RotatedSpherePlusBox_D5) // Apply rotations: -90 degrees around Z, then -45 degrees around Y gp_Trsf aTrsf1, aTrsf2, aTrsfCombined; - aTrsf1.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), -M_PI / 2.0); // -90 degrees Z - aTrsf2.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 1, 0)), -M_PI / 4.0); // -45 degrees Y + aTrsf1.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), -M_PI / 2.0); // -90 degrees Z + aTrsf2.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Y)), -M_PI / 4.0); // -45 degrees Y aTrsfCombined = aTrsf2 * aTrsf1; aSphere.Move(aTrsfCombined); @@ -455,8 +455,8 @@ TEST_F(BFuseSimpleTest, BoxPlusRotatedSphere_D6) // Apply rotations: -90 degrees around Z, then -45 degrees around Y gp_Trsf aTrsf1, aTrsf2, aTrsfCombined; - aTrsf1.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), -M_PI / 2.0); - aTrsf2.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 1, 0)), -M_PI / 4.0); + aTrsf1.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), -M_PI / 2.0); + aTrsf2.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Y)), -M_PI / 4.0); aTrsfCombined = aTrsf2 * aTrsf1; aSphere.Move(aTrsfCombined); @@ -473,7 +473,7 @@ TEST_F(BFuseSimpleTest, SpherePlusRotatedBox_D7) TopoDS_Shape aBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), 1.0, 1.0, 1.0); // Rotate box 90 degrees around Y axis: "trotate b 0 0 1 0 1 0 90" gp_Trsf aTrsf; - aTrsf.SetRotation(gp_Ax1(gp_Pnt(0, 0, 1), gp_Dir(0, 1, 0)), M_PI / 2.0); // 90 degrees Y + aTrsf.SetRotation(gp_Ax1(gp_Pnt(0, 0, 1), gp_Dir(gp_Dir::D::Y)), M_PI / 2.0); // 90 degrees Y aBox.Move(aTrsf); const TopoDS_Shape aResult = PerformFuse(aSphere, aBox); @@ -488,7 +488,7 @@ TEST_F(BFuseSimpleTest, RotatedBoxPlusSphere_D8) TopoDS_Shape aBox = BOPTest_Utilities::CreateBox(gp_Pnt(0, 0, 0), 1.0, 1.0, 1.0); // Rotate box 90 degrees around Y axis: "trotate b 0 0 1 0 1 0 90" gp_Trsf aTrsf; - aTrsf.SetRotation(gp_Ax1(gp_Pnt(0, 0, 1), gp_Dir(0, 1, 0)), M_PI / 2.0); // 90 degrees Y + aTrsf.SetRotation(gp_Ax1(gp_Pnt(0, 0, 1), gp_Dir(gp_Dir::D::Y)), M_PI / 2.0); // 90 degrees Y aBox.Move(aTrsf); const TopoDS_Shape aResult = PerformFuse(aBox, aSphere); @@ -500,7 +500,7 @@ TEST_F(BFuseSimpleTest, ProfileBasedPrisms_D9) { // Create first profile: "profile f1 x 100 y 100 x -200 y -200 x 100" // This creates a closed rectangular profile starting at origin - gp_Pln aPlane1(gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1))); + gp_Pln aPlane1(gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z))); std::vector aProfileOps1 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::X, 100.0), // move to (100, 0) @@ -518,7 +518,7 @@ TEST_F(BFuseSimpleTest, ProfileBasedPrisms_D9) // Create second profile: "profile f2 x -100 y 100 x 100; ttranslate f2 0 0 100" // This creates a triangular profile translated to z=100 - gp_Pln aPlane2(gp_Ax3(gp_Pnt(0, 0, 100), gp_Dir(0, 0, 1))); + gp_Pln aPlane2(gp_Ax3(gp_Pnt(0, 0, 100), gp_Dir(gp_Dir::D::Z))); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::X, -100.0), // move to (-100, 0) @@ -540,7 +540,7 @@ TEST_F(BFuseSimpleTest, ComplexProfileWithScaling_E1) const Standard_Real SCALE = 100.0; // Create first profile: "profile f1 c 50*SCALE 180 x -100*SCALE c 50*SCALE 180" - gp_Pln aPlane1(gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1))); + gp_Pln aPlane1(gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z))); std::vector aProfileOps1 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::C, 50.0 * SCALE, 180.0), BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::X, -100.0 * SCALE), @@ -551,7 +551,7 @@ TEST_F(BFuseSimpleTest, ComplexProfileWithScaling_E1) // Create second profile: "profile f2 x 300*SCALE y 200*SCALE x -300*SCALE; ttranslate f2 // -200*SCALE -50*SCALE 0" - gp_Pln aPlane2(gp_Ax3(gp_Pnt(-200.0 * SCALE, -50.0 * SCALE, 0), gp_Dir(0, 0, 1))); + gp_Pln aPlane2(gp_Ax3(gp_Pnt(-200.0 * SCALE, -50.0 * SCALE, 0), gp_Dir(gp_Dir::D::Z))); std::vector aProfileOps2 = { BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::X, 300.0 * SCALE), BOPTest_Utilities::ProfileOperation(BOPTest_Utilities::ProfileCmd::Y, 200.0 * SCALE), @@ -595,7 +595,7 @@ TEST_F(BFuseSimpleTest, ComplexVertexEdgeWireRevolution_E3) // Create revolution: "revol cyla pa 0 0 0 0 0 1 360" const TopoDS_Shape aRevolution = BOPTest_Utilities::CreateRevolution(aFace, - gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), + gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), 2.0 * M_PI); // Create cylinder: "pcylinder cylb 1 9; ttranslate cylb 5 0 -2" @@ -627,7 +627,7 @@ TEST_F(BFuseSimpleTest, CylinderWithComplexWireRevolution_E4) // Create revolution: "revol ring f 0 0 0 0 0 1 269" const TopoDS_Shape aRing = BOPTest_Utilities::CreateRevolution(aFace, - gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), + gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), 269.0 * M_PI / 180.0); const TopoDS_Shape aResult = PerformFuse(aCylinder, aRing); @@ -1844,7 +1844,7 @@ TEST_F(BFuseSimpleTest, CylinderWithRevolutionRing_J9) const TopoDS_Shape aRingFace = BOPTest_Utilities::CreateFaceFromWire(aRingWire); // Create revolution: revol ring f 0 0 0 0 0 1 269 - const gp_Ax1 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + const gp_Ax1 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); const TopoDS_Shape aRing = BOPTest_Utilities::CreateRevolution(aRingFace, aAxis, 269.0 * M_PI / 180.0); @@ -1868,11 +1868,11 @@ TEST_F(BFuseSimpleTest, ComplexProfileWithRevolution_K1) {BOPTest_Utilities::ProfileCmd::Y, -25}, {BOPTest_Utilities::ProfileCmd::X, -60}, {BOPTest_Utilities::ProfileCmd::W, {}}}; - const gp_Pln aPlane(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0)); // pl 1 0 0 0 0 1 (normal 1,0,0) + const gp_Pln aPlane(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::X)); // pl 1 0 0 0 0 1 (normal 1,0,0) const TopoDS_Shape aProfile = BOPTest_Utilities::CreateProfile(aPlane, aOps); // Create revolution: revol rv wr 50 100 50 0 0 1 360 - const gp_Ax1 aRevAxis(gp_Pnt(50, 100, 50), gp_Dir(0, 0, 1)); + const gp_Ax1 aRevAxis(gp_Pnt(50, 100, 50), gp_Dir(gp_Dir::D::Z)); const TopoDS_Shape aRevolution = BOPTest_Utilities::CreateRevolution(aProfile, aRevAxis, 2 * M_PI); @@ -1893,7 +1893,7 @@ TEST_F(BFuseSimpleTest, BlendBoxWithCylinder_K2) const TopoDS_Shape aCylinder = BOPTest_Utilities::CreateCylinder(100.0, 50.0); // Create plane and cylinder: plane pl1 100 100 100 0 0 1 1 0 0, pcylinder pc pl1 100 50 - // const gp_Ax3 anAx3(gp_Pnt(100, 100, 100), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)); + // const gp_Ax3 anAx3(gp_Pnt(100, 100, 100), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)); // const gp_Pln aPlane(anAx3); // const TopoDS_Shape aCylinder = BOPTest_Utilities::CreateCylinderOnPlane(aPlane, 100.0, 50.0); @@ -1912,7 +1912,7 @@ TEST_F(BFuseSimpleTest, BlendBoxWithCylinderNegX_K3) EXPECT_FALSE(aBlendedBox.IsNull()) << "Blend operation failed"; // Create plane and cylinder: plane pl1 100 100 100 0 0 1 -1 0 0, pcylinder pc pl1 100 50 - const gp_Ax3 anAx3(gp_Pnt(100, 100, 100), gp_Dir(0, 0, 1), gp_Dir(-1, 0, 0)); + const gp_Ax3 anAx3(gp_Pnt(100, 100, 100), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::NX)); const gp_Pln aPlane(anAx3); const TopoDS_Shape aCylinder = BOPTest_Utilities::CreateCylinderOnPlane(aPlane, 100.0, 50.0); EXPECT_FALSE(aCylinder.IsNull()) << "Cylinder creation failed"; @@ -1931,7 +1931,7 @@ TEST_F(BFuseSimpleTest, BlendBoxWithCylinderY_K4) const TopoDS_Shape aBlendedBox = BOPTest_Utilities::CreateBlend(aBox, 1, 100.0); // Create plane and cylinder: plane pl1 100 100 100 0 0 1 0 1 0, pcylinder pc pl1 100 50 - const gp_Ax3 anAx3(gp_Pnt(100, 100, 100), gp_Dir(0, 0, 1), gp_Dir(0, 1, 0)); + const gp_Ax3 anAx3(gp_Pnt(100, 100, 100), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::Y)); const gp_Pln aPlane(anAx3); const TopoDS_Shape aCylinder = BOPTest_Utilities::CreateCylinderOnPlane(aPlane, 100.0, 50.0); @@ -1949,7 +1949,7 @@ TEST_F(BFuseSimpleTest, BlendBoxWithCylinderNegY_K5) const TopoDS_Shape aBlendedBox = BOPTest_Utilities::CreateBlend(aBox, 1, 100.0); // Create plane and cylinder: plane pl1 100 100 100 0 0 1 0 -1 0, pcylinder pc pl1 100 50 - const gp_Ax3 anAx3(gp_Pnt(100, 100, 100), gp_Dir(0, 0, 1), gp_Dir(0, -1, 0)); + const gp_Ax3 anAx3(gp_Pnt(100, 100, 100), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::NY)); const gp_Pln aPlane(anAx3); const TopoDS_Shape aCylinder = BOPTest_Utilities::CreateCylinderOnPlane(aPlane, 100.0, 50.0); @@ -1967,7 +1967,7 @@ TEST_F(BFuseSimpleTest, BlendBoxWithCylinderBottomX_K6) const TopoDS_Shape aBlendedBox = BOPTest_Utilities::CreateBlend(aBox, 1, 100.0); // Create plane and cylinder: plane pl1 100 100 0 0 0 -1 1 0 0, pcylinder pc pl1 100 50 - const gp_Ax3 anAx3(gp_Pnt(100, 100, 0), gp_Dir(0, 0, -1), gp_Dir(1, 0, 0)); + const gp_Ax3 anAx3(gp_Pnt(100, 100, 0), gp_Dir(gp_Dir::D::NZ), gp_Dir(gp_Dir::D::X)); const gp_Pln aPlane(anAx3); const TopoDS_Shape aCylinder = BOPTest_Utilities::CreateCylinderOnPlane(aPlane, 100.0, 50.0); @@ -1985,7 +1985,7 @@ TEST_F(BFuseSimpleTest, BlendBoxWithCylinderBottomNegX_K7) const TopoDS_Shape aBlendedBox = BOPTest_Utilities::CreateBlend(aBox, 1, 100.0); // Create plane and cylinder: plane pl1 100 100 0 0 0 -1 -1 0 0, pcylinder pc pl1 100 50 - const gp_Ax3 anAx3(gp_Pnt(100, 100, 0), gp_Dir(0, 0, -1), gp_Dir(-1, 0, 0)); + const gp_Ax3 anAx3(gp_Pnt(100, 100, 0), gp_Dir(gp_Dir::D::NZ), gp_Dir(gp_Dir::D::NX)); const gp_Pln aPlane(anAx3); const TopoDS_Shape aCylinder = BOPTest_Utilities::CreateCylinderOnPlane(aPlane, 100.0, 50.0); @@ -2003,7 +2003,7 @@ TEST_F(BFuseSimpleTest, BlendBoxWithCylinderBottomY_K8) const TopoDS_Shape aBlendedBox = BOPTest_Utilities::CreateBlend(aBox, 1, 100.0); // Create plane and cylinder: plane pl1 100 100 0 0 0 -1 0 1 0, pcylinder pc pl1 100 50 - const gp_Ax3 anAx3(gp_Pnt(100, 100, 0), gp_Dir(0, 0, -1), gp_Dir(0, 1, 0)); + const gp_Ax3 anAx3(gp_Pnt(100, 100, 0), gp_Dir(gp_Dir::D::NZ), gp_Dir(gp_Dir::D::Y)); const gp_Pln aPlane(anAx3); const TopoDS_Shape aCylinder = BOPTest_Utilities::CreateCylinderOnPlane(aPlane, 100.0, 50.0); @@ -2021,7 +2021,7 @@ TEST_F(BFuseSimpleTest, BlendBoxWithCylinderBottomNegY_K9) const TopoDS_Shape aBlendedBox = BOPTest_Utilities::CreateBlend(aBox, 1, 100.0); // Create plane and cylinder: plane pl1 100 100 0 0 0 -1 0 -1 0, pcylinder pc pl1 100 50 - const gp_Ax3 anAx3(gp_Pnt(100, 100, 0), gp_Dir(0, 0, -1), gp_Dir(0, -1, 0)); + const gp_Ax3 anAx3(gp_Pnt(100, 100, 0), gp_Dir(gp_Dir::D::NZ), gp_Dir(gp_Dir::D::NY)); const gp_Pln aPlane(anAx3); const TopoDS_Shape aCylinder = BOPTest_Utilities::CreateCylinderOnPlane(aPlane, 100.0, 50.0); diff --git a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_FaceFace.cxx b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_FaceFace.cxx index fc4f18c7ab..8bf6885ce6 100644 --- a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_FaceFace.cxx +++ b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_FaceFace.cxx @@ -2121,8 +2121,8 @@ void CorrectSurfaceBoundaries(const TopoDS_Face& theFace, correct = Standard_False; break; } - gp_Dir2d anUDir(1., 0.); - gp_Dir2d aVDir(0., 1.); + gp_Dir2d anUDir(gp_Dir2d::D::X); + gp_Dir2d aVDir(gp_Dir2d::D::Y); Standard_Real anAngularTolerance = Precision::Angular(); correctU = diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill.cxx index 2630d31b78..efd4fe4b59 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill.cxx @@ -367,38 +367,38 @@ TopoDS_Face BRepFill::Face(const TopoDS_Edge& Edge1, const TopoDS_Edge& Edge2) if (Edge1.Orientation() == TopAbs_REVERSED) { - B.UpdateEdge(Edge1, new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(-1, 0)), Face, T); + B.UpdateEdge(Edge1, new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(gp_Dir2d::D::NX)), Face, T); B.Range(Edge1, Face, -l1, -f1); } else { - B.UpdateEdge(Edge1, new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(1, 0)), Face, T); + B.UpdateEdge(Edge1, new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(gp_Dir2d::D::X)), Face, T); B.Range(Edge1, Face, f1, l1); } if (Edge2.Orientation() == TopAbs_REVERSED) { - B.UpdateEdge(Edge2, new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(-1, 0)), Face, T); + B.UpdateEdge(Edge2, new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(gp_Dir2d::D::NX)), Face, T); B.Range(Edge2, Face, -l1, -f1); } else { - B.UpdateEdge(Edge2, new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(1, 0)), Face, T); + B.UpdateEdge(Edge2, new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(gp_Dir2d::D::X)), Face, T); B.Range(Edge2, Face, f1, l1); } if (Closed) { B.UpdateEdge(Edge3, - new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(0, 1)), - new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(0, 1)), + new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(gp_Dir2d::D::Y)), + new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(gp_Dir2d::D::Y)), Face, T); } else { - B.UpdateEdge(Edge3, new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(0, 1)), Face, T); - B.UpdateEdge(Edge4, new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(0, 1)), Face, T); + B.UpdateEdge(Edge3, new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(gp_Dir2d::D::Y)), Face, T); + B.UpdateEdge(Edge4, new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(gp_Dir2d::D::Y)), Face, T); } // Set the non parameter flag; @@ -608,38 +608,38 @@ TopoDS_Shell BRepFill::Shell(const TopoDS_Wire& Wire1, const TopoDS_Wire& Wire2) if (Edge1.Orientation() == TopAbs_REVERSED) { - B.UpdateEdge(Edge1, new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(-1, 0)), Face, T); + B.UpdateEdge(Edge1, new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(gp_Dir2d::D::NX)), Face, T); B.Range(Edge1, Face, -l1, -f1); } else { - B.UpdateEdge(Edge1, new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(1, 0)), Face, T); + B.UpdateEdge(Edge1, new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(gp_Dir2d::D::X)), Face, T); B.Range(Edge1, Face, f1, l1); } if (Edge2.Orientation() == TopAbs_REVERSED) { - B.UpdateEdge(Edge2, new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(-1, 0)), Face, T); + B.UpdateEdge(Edge2, new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(gp_Dir2d::D::NX)), Face, T); B.Range(Edge2, Face, -l1, -f1); } else { - B.UpdateEdge(Edge2, new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(1, 0)), Face, T); + B.UpdateEdge(Edge2, new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(gp_Dir2d::D::X)), Face, T); B.Range(Edge2, Face, f1, l1); } if (Periodic) { B.UpdateEdge(Edge3, - new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(0, 1)), - new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(0, 1)), + new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(gp_Dir2d::D::Y)), + new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(gp_Dir2d::D::Y)), Face, T); } else { - B.UpdateEdge(Edge3, new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(0, 1)), Face, T); - B.UpdateEdge(Edge4, new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(0, 1)), Face, T); + B.UpdateEdge(Edge3, new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(gp_Dir2d::D::Y)), Face, T); + B.UpdateEdge(Edge4, new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(gp_Dir2d::D::Y)), Face, T); } // Set the non parameter flag; diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Evolved.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Evolved.cxx index 31350e8dd1..b9f01f76e1 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Evolved.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Evolved.cxx @@ -682,7 +682,7 @@ void BRepFill_Evolved::ElementaryPerform(const TopoDS_Face& Sp, TColStd_SequenceOfReal EmptySeqOfReal; // mark of the profile. - gp_Ax3 AxeRef(gp_Pnt(0., 0., 0.), gp_Dir(0., 0., 1.), gp_Dir(1., 0., 0.)); + gp_Ax3 AxeRef(gp_Pnt(0., 0., 0.), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)); //--------------------------------------------------------------- // Construction of revolutions and tubes. @@ -2446,7 +2446,7 @@ TopLoc_Location BRepFill_Evolved::FindLocation(const TopoDS_Face& Face) const gp_Ax3 Axis = P->Position(); gp_Trsf T; - gp_Ax3 AxeRef(gp_Pnt(0., 0., 0.), gp_Dir(0., 0., 1.), gp_Dir(1., 0., 0.)); + gp_Ax3 AxeRef(gp_Pnt(0., 0., 0.), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)); T.SetTransformation(AxeRef, Axis); return TopLoc_Location(T); diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Generator.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Generator.cxx index 3880a25750..b74d9bc43e 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Generator.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Generator.cxx @@ -983,23 +983,23 @@ void BRepFill_Generator::Perform() { if (Edge1.Orientation() == TopAbs_REVERSED) { - B.UpdateEdge(Edge1, new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(-1, 0)), Face, T); + B.UpdateEdge(Edge1, new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(gp_Dir2d::D::NX)), Face, T); B.Range(Edge1, Face, -l1, -f1); } else { - B.UpdateEdge(Edge1, new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(1, 0)), Face, T); + B.UpdateEdge(Edge1, new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(gp_Dir2d::D::X)), Face, T); B.Range(Edge1, Face, f1, l1); } if (Edge2.Orientation() == TopAbs_REVERSED) { - B.UpdateEdge(Edge2, new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(-1, 0)), Face, T); + B.UpdateEdge(Edge2, new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(gp_Dir2d::D::NX)), Face, T); B.Range(Edge2, Face, -l1, -f1); } else { - B.UpdateEdge(Edge2, new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(1, 0)), Face, T); + B.UpdateEdge(Edge2, new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(gp_Dir2d::D::X)), Face, T); B.Range(Edge2, Face, f1, l1); } } @@ -1009,15 +1009,15 @@ void BRepFill_Generator::Perform() if (Periodic) { B.UpdateEdge(Edge3, - new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(0, 1)), - new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(0, 1)), + new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(gp_Dir2d::D::Y)), + new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(gp_Dir2d::D::Y)), Face, T); } else { - B.UpdateEdge(Edge3, new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(0, 1)), Face, T); - B.UpdateEdge(Edge4, new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(0, 1)), Face, T); + B.UpdateEdge(Edge3, new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(gp_Dir2d::D::Y)), Face, T); + B.UpdateEdge(Edge4, new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(gp_Dir2d::D::Y)), Face, T); } } else diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_ShapeLaw.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_ShapeLaw.cxx index 46fccaee32..822c0bebbb 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_ShapeLaw.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_ShapeLaw.cxx @@ -63,7 +63,7 @@ BRepFill_ShapeLaw::BRepFill_ShapeLaw(const TopoDS_Vertex& V, const Standard_Bool { myLaws = new (GeomFill_HArray1OfSectionLaw)(1, 1); // gp_Pnt Origine; - gp_Dir D(1, 0, 0); // Following the normal + gp_Dir D(gp_Dir::D::X); // Following the normal Handle(Geom_Line) L = new (Geom_Line)(BRep_Tool::Pnt(V), D); Standard_Real Last = 2 * BRep_Tool::Tolerance(V) + Precision::PConfusion(); Handle(Geom_TrimmedCurve) TC = new (Geom_TrimmedCurve)(L, 0, Last); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_GridSS.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_GridSS.cxx index e8b2b71897..8278f73cb8 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_GridSS.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_GridSS.cxx @@ -216,7 +216,7 @@ TopTools_ListOfShape& losplits) Vl.Orientation(oriVsup); BB.Add(Esup2pi,Vl); BT.Parameter(Esup2pi,Vl,pl); gp_Pnt2d tmp = PC->Value(pf); Standard_Real v = tmp.Y(); Handle(Geom2d_Line) L2d = - new Geom2d_Line(gp_Pnt2d(-paronE,v),gp_Dir2d(1.,0.)); + new Geom2d_Line(gp_Pnt2d(-paronE,v),gp_Dir2d(gp_Dir2d::D::X)); Handle(Geom2d_TrimmedCurve) PCsup2pi = new Geom2d_TrimmedCurve(L2d,paronE,pl); TopOpeBRepDS_SetThePCurve(BB,Esup2pi,F,oriE,PCsup2pi); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_WireEdgeSet.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_WireEdgeSet.cxx index 6adf125d4c..3034a8760d 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_WireEdgeSet.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_WireEdgeSet.cxx @@ -593,9 +593,9 @@ void TopOpeBRepBuild_WireEdgeSet::IsUVISO(const TopoDS_Edge& E, const gp_Dir2d& D = HL->Direction(); Standard_Real tol = Precision::Angular(); - if (D.IsParallel(gp_Dir2d(0., 1.), tol)) + if (D.IsParallel(gp_Dir2d(gp_Dir2d::D::Y), tol)) uiso = Standard_True; - else if (D.IsParallel(gp_Dir2d(1., 0.), tol)) + else if (D.IsParallel(gp_Dir2d(gp_Dir2d::D::X), tol)) viso = Standard_True; } } diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx index ceffed582d..c417cf3485 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx @@ -608,9 +608,9 @@ Standard_Boolean FUN_makeUisoLineOnSphe(const TopoDS_Face& F, // with geometry t Standard_Boolean isvgrowing = (vsup - vinf > -tol); gp_Dir2d vdir; if (isvgrowing) - vdir = gp_Dir2d(0, 1); + vdir = gp_Dir2d(gp_Dir2d::D::Y); else - vdir = gp_Dir2d(0, -1); + vdir = gp_Dir2d(gp_Dir2d::D::NY); gp_Pnt2d origin(uinf, vinf); origin.Translate(gp_Vec2d(vdir).Scaled(p3df - par3dinf)); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_FaceInterferenceTool.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_FaceInterferenceTool.cxx index 74ae08f96f..8df22650e2 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_FaceInterferenceTool.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_FaceInterferenceTool.cxx @@ -130,11 +130,11 @@ Standard_EXPORT void FUN_ComputeGeomData(const TopoDS_Shape& F, Standard_Real x = D1.X(), y = D1.Y(), z = D1.Z(), tol = Precision::Confusion(); Standard_Boolean nullx = (Abs(x) < tol), nully = (Abs(y) < tol), nullz = (Abs(z) < tol); if (nullx && nully) - D2 = gp_Dir(1, 0, 0); + D2 = gp_Dir(gp_Dir::D::X); else if (nullx && nullz) - D2 = gp_Dir(1, 0, 0); + D2 = gp_Dir(gp_Dir::D::X); else if (nully && nullz) - D2 = gp_Dir(0, 1, 0); + D2 = gp_Dir(gp_Dir::D::Y); else D2 = gp_Dir(y * z, x * z, -2. * x * y); } diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_CurveTool.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_CurveTool.cxx index 8a1cc6dd50..d554bc21a3 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_CurveTool.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_CurveTool.cxx @@ -1020,7 +1020,7 @@ Handle(Geom2d_Curve) TopOpeBRepTool_CurveTool::MakePCurveOnFace(const TopoDS_Sha gp_Pnt2d po(0, -M_PI / 2); if (maxcond) po.SetY(M_PI / 2); - aTrsf.SetMirror(gp_Ax2d(po, gp_Dir2d(1, 0))); + aTrsf.SetMirror(gp_Ax2d(po, gp_Dir2d(gp_Dir2d::D::X))); PCT->Transform(aTrsf); // add translation along U direction on PI gp_Vec2d vec(M_PI, 0); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_GEOMETRY.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_GEOMETRY.cxx index 815f1662a0..5709ae358f 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_GEOMETRY.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_GEOMETRY.cxx @@ -172,7 +172,7 @@ Standard_EXPORT gp_Dir FUN_tool_ngS(const gp_Pnt2d& p2d, const Handle(Geom_Surfa #ifdef OCCT_DEBUG std::cout << "FUN_tool_nggeomF NYI" << std::endl; #endif - return gp_Dir(0, 0, 1); + return gp_Dir(gp_Dir::D::Z); } gp_Dir udir(d1u); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_ShapeTool.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_ShapeTool.cxx index 38bd671423..b2f2e5d052 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_ShapeTool.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_ShapeTool.cxx @@ -331,9 +331,9 @@ Standard_Real TopOpeBRepTool_ShapeTool::PeriodizeParameter(const Standard_Real p Standard_Real tol = Precision::Angular(); Standard_Boolean isoU = Standard_False, isoV = Standard_False; - if (D.IsParallel(gp_Dir2d(0., 1.), tol)) + if (D.IsParallel(gp_Dir2d(gp_Dir2d::D::Y), tol)) isoU = Standard_True; - else if (D.IsParallel(gp_Dir2d(1., 0.), tol)) + else if (D.IsParallel(gp_Dir2d(gp_Dir2d::D::X), tol)) isoV = Standard_True; if (isoU) { diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_matter.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_matter.cxx index d2fc113927..c707c86165 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_matter.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_matter.cxx @@ -52,7 +52,7 @@ Standard_EXPORT gp_Dir2d FUN_tool_nC2dINSIDES(const gp_Dir2d& tgC2d) // X = (tgC2d,0),Y = (xx,0),Z =(0,0,1) // ------------------------------------------------------------ gp_Dir X, Y, Z; - Z = gp_Dir(0., 0., 1.); + Z = gp_Dir(gp_Dir::D::Z); X = gp_Dir(tgC2d.X(), tgC2d.Y(), 0.); Y = Z ^ X; gp_Dir2d xx(Y.X(), Y.Y()); diff --git a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_RibSlot.cxx b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_RibSlot.cxx index a245a74f6b..d900029730 100644 --- a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_RibSlot.cxx +++ b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_RibSlot.cxx @@ -496,7 +496,7 @@ gp_Dir BRepFeat_RibSlot::Normal(const TopoDS_Face& F, const gp_Pnt& P) break; default: { - return gp_Dir(1., 0., 0.); + return gp_Dir(gp_Dir::D::X); } } diff --git a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc.cxx b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc.cxx index 1196db0068..998c9f1ac4 100644 --- a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc.cxx +++ b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc.cxx @@ -109,7 +109,7 @@ void BlendFunc::GetMinimalWeights(const BlendFunc_SectionShape SShape, break; case BlendFunc_Rational: case BlendFunc_QuasiAngular: { - gp_Ax2 popAx2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + gp_Ax2 popAx2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); gp_Circ C(popAx2, 1); Handle(Geom_TrimmedCurve) Sect1 = new Geom_TrimmedCurve(new Geom_Circle(C), 0., MaxAng); Handle(Geom_BSplineCurve) CtoBspl = GeomConvert::CurveToBSplineCurve(Sect1, TConv); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn.cxx index 644458cb76..8c5a0237ed 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn.cxx @@ -79,7 +79,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, gp_Circ2d C2 = Qualified2.Qualified(); Standard_Real R1 = C1.Radius(); Standard_Real R2 = C2.Radius(); - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); gp_Pnt2d center1(C1.Location()); gp_Pnt2d center2(C2.Location()); TColStd_Array1OfReal Radius(1, 2); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_1.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_1.cxx index fb04e65809..e38300ffb1 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_1.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_1.cxx @@ -77,7 +77,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, Standard_Real Tol = Abs(Tolerance); Standard_Real Radius = 0; Standard_Boolean ok = Standard_False; - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); gp_Circ2d C1 = Qualified1.Qualified(); gp_Lin2d L2 = Qualified2.Qualified(); Standard_Real R1 = C1.Radius(); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_10.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_10.cxx index 5629a7d713..0f306b6cb7 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_10.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_10.cxx @@ -73,7 +73,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedLin& Qualified1, return; } Standard_Real Tol = Abs(Tolerance); - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); gp_Lin2d L1 = Qualified1.Qualified(); gp_Pnt2d originL1(L1.Location()); gp_Dir2d dirL1(L1.Direction()); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_11.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_11.cxx index e9ea2dc0cb..da449bbd73 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_11.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_11.cxx @@ -66,7 +66,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const gp_Pnt2d& Point1, TheSame2.Init(0); WellDone = Standard_False; NbrSol = 0; - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real Tol = Abs(Tolerance); Standard_Real dist = Point1.Distance(Point2); Standard_Real dp1cen = Point1.Distance(OnCirc.Location()); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_2.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_2.cxx index 290310c721..dd6b958feb 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_2.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_2.cxx @@ -58,7 +58,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedLin& Qualified1, return; } - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real Tol = Abs(Tolerance); // calculation of bisectrices of L1 and L2 diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_3.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_3.cxx index 70d44c0881..0d9345f319 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_3.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_3.cxx @@ -75,7 +75,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, return; } TColStd_Array1OfReal Radius(1, 2); - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); gp_Circ2d C1 = Qualified1.Qualified(); Standard_Real R1 = C1.Radius(); gp_Pnt2d center1(C1.Location()); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_4.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_4.cxx index addb6845bb..585076dbe0 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_4.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_4.cxx @@ -76,7 +76,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedLin& Qualified1, return; } Standard_Real Tol = Abs(Tolerance); - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); gp_Lin2d L1 = Qualified1.Qualified(); gp_Pnt2d originL1(L1.Location()); gp_Dir2d dirL1(L1.Direction()); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_5.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_5.cxx index f70912c3ae..14e4887a35 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_5.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_5.cxx @@ -59,7 +59,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const gp_Pnt2d& Point1, WellDone = Standard_False; NbrSol = 0; - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real dist = Point1.Distance(Point2); if (dist < Abs(Tolerance)) { diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_6.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_6.cxx index f4ca305c67..e37a16e15b 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_6.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_6.cxx @@ -75,7 +75,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, Standard_Real Tol = Abs(Tolerance); gp_Circ2d C1 = Qualified1.Qualified(); gp_Circ2d C2 = Qualified2.Qualified(); - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); TColStd_Array1OfReal Radius(1, 2); TColStd_Array1OfReal Rradius(1, 2); gp_Pnt2d center1(C1.Location()); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_7.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_7.cxx index 934b6db4dd..91908a4ae2 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_7.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_7.cxx @@ -62,7 +62,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, return; } Standard_Real Radius = 0; - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); gp_Circ2d C1 = Qualified1.Qualified(); gp_Lin2d L2 = Qualified2.Qualified(); Standard_Real R1 = C1.Radius(); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_8.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_8.cxx index 3f859e07fa..1ac5a9ea4a 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_8.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_8.cxx @@ -69,7 +69,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, } Standard_Real Tol = Abs(Tolerance); TColStd_Array1OfReal Radius(1, 2); - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); gp_Circ2d C1 = Qualified1.Qualified(); Standard_Real R1 = C1.Radius(); gp_Pnt2d center1(C1.Location()); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_9.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_9.cxx index 76031224b6..baf14d2bf6 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_9.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_9.cxx @@ -51,7 +51,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedLin& Qualified1, WellDone = Standard_False; NbrSol = 0; - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsOutside() || Qualified2.IsUnqualified())) { diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad.cxx index e5df29f234..7899f5330e 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad.cxx @@ -57,7 +57,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified { Standard_Real Tol = Abs(Tolerance); - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); WellDone = Standard_False; NbrSol = 0; if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_1.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_1.cxx index bd9377b600..524bf2764b 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_1.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_1.cxx @@ -58,7 +58,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified { Standard_Real Tol = Abs(Tolerance); - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); NbrSol = 0; WellDone = Standard_False; if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_2.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_2.cxx index c98e7d5eb2..1c683fb0c3 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_2.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_2.cxx @@ -56,7 +56,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified pararg2(1, 4) { - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real Tol = Abs(Tolerance); NbrSol = 0; WellDone = Standard_False; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_3.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_3.cxx index 84df6783ad..1970ce987b 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_3.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_3.cxx @@ -60,7 +60,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedLin& Qualified1 pararg2(1, 2) { - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real Tol = Abs(Tolerance); NbrSol = 0; WellDone = Standard_False; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_4.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_4.cxx index 7ca4b06a4b..d592736c23 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_4.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_4.cxx @@ -56,7 +56,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedLin& Qualified1 pararg2(1, 4) { - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); TColStd_Array1OfReal cote1(1, 2); TColStd_Array1OfReal cote2(1, 2); Standard_Integer nbrcote1 = 0; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_5.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_5.cxx index 9fc878a1aa..f46e92d9f4 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_5.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_5.cxx @@ -47,7 +47,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const gp_Pnt2d& Point1, pararg2(1, 2) { - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real Tol = Abs(Tolerance); NbrSol = 0; WellDone = Standard_False; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan.cxx index 42ba3f78f5..920c80a08d 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan.cxx @@ -56,7 +56,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, pararg3(1, 16) { - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real Tol = Abs(Tolerance); WellDone = Standard_False; NbrSol = 0; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_1.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_1.cxx index 414cbca75f..72f6d5319d 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_1.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_1.cxx @@ -61,7 +61,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, pararg3(1, 16) { - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real Tol = Abs(Tolerance); WellDone = Standard_False; NbrSol = 0; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_2.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_2.cxx index 234ea01a3a..270fbf705c 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_2.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_2.cxx @@ -62,7 +62,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, TheSame1.Init(0); - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real Tol = Abs(Tolerance); WellDone = Standard_False; NbrSol = 0; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_3.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_3.cxx index cdae803945..d2cb20d113 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_3.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_3.cxx @@ -65,7 +65,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedLin& Qualified1, TheSame1.Init(0); TheSame2.Init(0); TheSame3.Init(0); - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); WellDone = Standard_False; NbrSol = 0; if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_4.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_4.cxx index 35b31d8523..7f3b8625e0 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_4.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_4.cxx @@ -65,7 +65,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, pararg3(1, MaxSol) { - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real Tol = Abs(Tolerance); WellDone = Standard_False; NbrSol = 0; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_5.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_5.cxx index e1ecf0e456..1174f42423 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_5.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_5.cxx @@ -63,7 +63,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, pararg3(1, 4) { - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real Tol = Abs(Tolerance); Standard_Real MaxRad = 1e10, MinRad = 1e-6; WellDone = Standard_False; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_6.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_6.cxx index b26f29878b..0db34a8b1a 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_6.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_6.cxx @@ -55,7 +55,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedLin& Qualified1, pararg3(1, 2) { - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); WellDone = Standard_False; Standard_Real Tol = Abs(Tolerance); NbrSol = 0; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_7.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_7.cxx index 324cd6fde8..9ca28597ac 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_7.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_7.cxx @@ -57,7 +57,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, pararg3(1, 2) { - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real Tol = Abs(Tolerance); WellDone = Standard_False; NbrSol = 0; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_8.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_8.cxx index 53035a902c..b434e2eacb 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_8.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_8.cxx @@ -58,7 +58,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedLin& Qualified1, WellDone = Standard_False; Standard_Real Tol = Abs(Tolerance); - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); NbrSol = 0; if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_9.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_9.cxx index 50647c9320..3babc84bca 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_9.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_9.cxx @@ -65,7 +65,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const gp_Pnt2d& Point1, pararg3(1, 1) { - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); WellDone = Standard_False; NbrSol = 0; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dBisec.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dBisec.cxx index 351b92b0e1..027aba5735 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dBisec.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dBisec.cxx @@ -175,7 +175,7 @@ Handle(GccInt_Bisec) GccAna_Circ2dBisec::ThisSolution(const Standard_Integer Ind dircen.SetCoord(xcencir2 - xcencir1, ycencir2 - ycencir1); medcen.SetCoord(ycencir2 - ycencir1, xcencir1 - xcencir2); } - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); gp_Ax2d acenx(pcen, dirx); gp_Ax2d acencen(pcen, dircen); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanCen.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanCen.cxx index 68edf26155..7842841ee5 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanCen.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanCen.cxx @@ -65,7 +65,7 @@ GccAna_Circ2dTanCen::GccAna_Circ2dTanCen(const GccEnt_QualifiedCirc& Qualified1, throw GccEnt_BadQualifier(); return; } - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real Tol = Abs(Tolerance); gp_Circ2d C1 = Qualified1.Qualified(); Standard_Real R1 = C1.Radius(); @@ -210,7 +210,7 @@ GccAna_Circ2dTanCen::GccAna_Circ2dTanCen(const gp_Lin2d& Linetan, const gp_Pnt2d pararg1(1, 1) { - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real rayon = Linetan.Distance(Pcenter); cirsol(1) = gp_Circ2d(gp_Ax2d(Pcenter, dirx), rayon); // ================================================== @@ -258,7 +258,7 @@ GccAna_Circ2dTanCen::GccAna_Circ2dTanCen(const gp_Pnt2d& Point1, const gp_Pnt2d& pararg1(1, 1) { - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real rayon = Point1.Distance(Pcenter); cirsol(1) = gp_Circ2d(gp_Ax2d(Pcenter, dirx), rayon); // ================================================= diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad.cxx index 0f386347e7..ad0782b387 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad.cxx @@ -68,7 +68,7 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedCirc& Qualifi { TheSame1.Init(0); - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real Tol = Abs(Tolerance); WellDone = Standard_False; NbrSol = 0; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_1.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_1.cxx index 46154d830d..ce9647647c 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_1.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_1.cxx @@ -54,7 +54,7 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedLin& Qualifie { Standard_Real Tol = Abs(Tolerance); - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); WellDone = Standard_False; NbrSol = 0; if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_2.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_2.cxx index b16ee4617e..e51b267b17 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_2.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_2.cxx @@ -55,7 +55,7 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const gp_Pnt2d& Point1, parcen3(1, 2) { - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real Tol = Abs(Tolerance); WellDone = Standard_False; NbrSol = 0; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_3.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_3.cxx index 3c7d4dcf2e..e22eec901e 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_3.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_3.cxx @@ -52,7 +52,7 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedCirc& Qualifi { TheSame1.Init(0); - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real Tol = Abs(Tolerance); Standard_Integer signe[5]; signe[0] = 0; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_4.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_4.cxx index 0686860257..9e3b5adc6a 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_4.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_4.cxx @@ -57,7 +57,7 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedLin& Qualifie { TheSame1.Init(0); - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real Tol = Abs(Tolerance); WellDone = Standard_False; NbrSol = 0; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_5.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_5.cxx index ce5ccf403c..a0112af763 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_5.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_5.cxx @@ -49,7 +49,7 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const gp_Pnt2d& Point1, parcen3(1, 2) { - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real Tol = Abs(Tolerance); WellDone = Standard_False; NbrSol = 0; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_CircPnt2dBisec.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_CircPnt2dBisec.cxx index 8c54815796..d9d630f880 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_CircPnt2dBisec.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_CircPnt2dBisec.cxx @@ -107,7 +107,7 @@ Handle(GccInt_Bisec) GccAna_CircPnt2dBisec::ThisSolution(const Standard_Integer if (dist < myTolerance) { - gp_Circ2d biscirpnt1(gp_Ax2d(point, gp_Dir2d(1.0, 0.0)), R1 / 2.); + gp_Circ2d biscirpnt1(gp_Ax2d(point, gp_Dir2d(gp_Dir2d::D::X)), R1 / 2.); bissol = new GccInt_BCirc(biscirpnt1); // ========================================================== } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanOnGeo.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanOnGeo.cxx index f8817923e3..84fae67d25 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanOnGeo.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanOnGeo.cxx @@ -87,7 +87,7 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedCirc& gp_Circ2d C2 = Qualified2.Qualified(); Standard_Real R1 = C1.Radius(); Standard_Real R2 = C2.Radius(); - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); gp_Pnt2d center1(C1.Location()); gp_Pnt2d center2(C2.Location()); GccAna_Circ2dBisec Bis(C1, C2); @@ -354,7 +354,7 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedCirc& throw GccEnt_BadQualifier(); return; } - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); gp_Circ2d C1 = Qualified1.Qualified(); gp_Lin2d L2 = Qualified2.Qualified(); Standard_Real R1 = C1.Radius(); @@ -566,7 +566,7 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedLin& } Standard_Real Tol = Abs(Tolerance); Standard_Real Radius = 0; - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); gp_Lin2d L1 = Qualified1.Qualified(); gp_Lin2d L2 = Qualified2.Qualified(); gp_Dir2d dir1(L1.Direction()); @@ -748,7 +748,7 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedCirc& } Standard_Real Tol = Abs(Tolerance); Standard_Real Radius; - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); gp_Circ2d C1 = Qualified1.Qualified(); Standard_Real R1 = C1.Radius(); gp_Pnt2d center1(C1.Location()); @@ -941,7 +941,7 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedLin& throw GccEnt_BadQualifier(); return; } - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); gp_Lin2d L1 = Qualified1.Qualified(); gp_Pnt2d origin1(L1.Location()); gp_Dir2d dir1(L1.Direction()); @@ -1090,7 +1090,7 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const gp_Pnt2d& Standard_Real lastparam; Standard_Real Tol = Abs(Tolerance); NbrSol = 0; - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); GccAna_Pnt2dBisec Bis(Point1, Point2); if (Bis.IsDone()) { diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanOnIter.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanOnIter.cxx index f92b36b2a3..703b336cde 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanOnIter.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanOnIter.cxx @@ -69,7 +69,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const GccEnt_QualifiedLin throw GccEnt_BadQualifier(); return; } - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); gp_Lin2d L1 = Qualified1.Qualified(); Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified(); math_Vector Umin(1, 4); @@ -178,7 +178,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const Geom2dGcc_QCurve& Q return; } Standard_Real Tol = Abs(Tolerance); - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified(); Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified(); math_Vector Umin(1, 4); @@ -296,7 +296,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const Geom2dGcc_QCurve& Q return; } Standard_Real Tol = Abs(Tolerance); - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified(); math_Vector Umin(1, 3); math_Vector Umax(1, 3); @@ -391,7 +391,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const GccEnt_QualifiedCir return; } Standard_Real Tol = Abs(Tolerance); - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); gp_Circ2d C1 = Qualified1.Qualified(); Standard_Real R1 = C1.Radius(); Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified(); @@ -507,7 +507,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const GccEnt_QualifiedCir return; } Standard_Real Tol = Abs(Tolerance); - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); gp_Circ2d C1 = Qualified1.Qualified(); Standard_Real R1 = C1.Radius(); Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified(); @@ -620,7 +620,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const GccEnt_QualifiedLin return; } Standard_Real Tol = Abs(Tolerance); - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); gp_Lin2d L1 = Qualified1.Qualified(); Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified(); math_Vector Umin(1, 4); @@ -731,7 +731,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const Geom2dGcc_QCurve& Q return; } Standard_Real Tol = Abs(Tolerance); - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified(); Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified(); math_Vector Umin(1, 4); @@ -849,7 +849,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const Geom2dGcc_QCurve& Q return; } Standard_Real Tol = Abs(Tolerance); - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified(); math_Vector Umin(1, 3); math_Vector Umax(1, 3); @@ -944,7 +944,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const Geom2dGcc_QCurve& throw GccEnt_BadQualifier(); return; } - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified(); Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified(); math_Vector Umin(1, 4); @@ -1102,7 +1102,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const GccEnt_QualifiedCir Standard_Real dist2 = point3.Distance(point2); if (Abs(dist1 - dist2) / 2. <= Tol) { - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); cirsol = gp_Circ2d(gp_Ax2d(point3, dirx), (dist1 + dist2) / 2.); Standard_Real normetan2 = Tan2.Magnitude(); gp_Vec2d Vec1(point1.XY(), point3.XY()); @@ -1170,7 +1170,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const GccEnt_QualifiedLin return; } Standard_Real Tol = Abs(Tolerance); - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); gp_Lin2d L1 = Qualified1.Qualified(); Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified(); math_Vector Umin(1, 4); @@ -1274,7 +1274,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const Geom2dGcc_QCurve& return; } Standard_Real Tol = Abs(Tolerance); - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified(); math_Vector Umin(1, 3); math_Vector Umax(1, 3); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanRadGeo.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanRadGeo.cxx index b4e25117c3..b87d684a8a 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanRadGeo.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanRadGeo.cxx @@ -80,7 +80,7 @@ Geom2dGcc_Circ2d2TanRadGeo::Geom2dGcc_Circ2d2TanRadGeo(const GccEnt_QualifiedLin Standard_Real thelast = 100000.; Standard_Real firstparam; Standard_Real lastparam; - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); TColStd_Array1OfReal cote1(1, 2); TColStd_Array1OfReal cote2(1, 2); Standard_Integer nbrcote1 = 0; @@ -294,7 +294,7 @@ Geom2dGcc_Circ2d2TanRadGeo::Geom2dGcc_Circ2d2TanRadGeo(const GccEnt_QualifiedCir Standard_Real thelast = 100000.; Standard_Real firstparam; Standard_Real lastparam; - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); TColStd_Array1OfReal cote1(1, 2); TColStd_Array1OfReal cote2(1, 2); Standard_Integer nbrcote1 = 0; @@ -519,7 +519,7 @@ Geom2dGcc_Circ2d2TanRadGeo::Geom2dGcc_Circ2d2TanRadGeo(const Geom2dGcc_QCurve& Q Standard_Real thelast = 100000.; Standard_Real firstparam; Standard_Real lastparam; - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); TColStd_Array1OfReal cote1(1, 2); Standard_Integer nbrcote1 = 0; WellDone = Standard_False; @@ -556,7 +556,7 @@ Geom2dGcc_Circ2d2TanRadGeo::Geom2dGcc_Circ2d2TanRadGeo(const Geom2dGcc_QCurve& Q cote1(1) = Radius; cote1(2) = -Radius; } - gp_Circ2d Circ(gp_Ax2d(Point2, gp_Dir2d(1., 0.)), Radius); + gp_Circ2d Circ(gp_Ax2d(Point2, gp_Dir2d(gp_Dir2d::D::X)), Radius); IntRes2d_Domain D1(ElCLib::Value(0., Circ), 0., Tol, @@ -812,7 +812,7 @@ Geom2dGcc_Circ2d2TanRadGeo::Geom2dGcc_Circ2d2TanRadGeo(const Geom2dGcc_QCurve& Q const Standard_Real thefirst = -100000.; const Standard_Real thelast = 100000.; #endif - gp_Dir2d dirx(1., 0.); + gp_Dir2d dirx(gp_Dir2d::D::X); TColStd_Array1OfReal cote1(1, 2); TColStd_Array1OfReal cote2(1, 2); Standard_Integer nbrcote1 = 0; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d3TanIter.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d3TanIter.cxx index 3463051eff..a63df35da5 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d3TanIter.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d3TanIter.cxx @@ -806,7 +806,7 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const Geom2dGcc_QCurve& Quali throw GccEnt_BadQualifier(); return; } - gp_Circ2d C1(gp_Ax2d(Point3, gp_Dir2d(1., 0.)), 0.); + gp_Circ2d C1(gp_Ax2d(Point3, gp_Dir2d(gp_Dir2d::D::X)), 0.); Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified(); Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified(); Geom2dGcc_FunctionTanCuCuCu Func(C1, Cu1, Cu2); @@ -937,9 +937,8 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const Geom2dGcc_QCurve& Quali throw GccEnt_BadQualifier(); return; } - gp_Dir2d dirx(1., 0.); - gp_Circ2d C1(gp_Ax2d(Point2, dirx), 0.); - gp_Circ2d C2(gp_Ax2d(Point3, dirx), 0.); + gp_Circ2d C1(gp_Ax2d(Point2, gp_Dir2d(gp_Dir2d::D::X)), 0.); + gp_Circ2d C2(gp_Ax2d(Point3, gp_Dir2d(gp_Dir2d::D::X)), 0.); Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified(); Geom2dGcc_FunctionTanCuCuCu Func(C1, C2, Cu1); math_Vector Umin(1, 3); @@ -1065,10 +1064,9 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const GccEnt_QualifiedLin& Qu throw GccEnt_BadQualifier(); return; } - gp_Dir2d dirx(1., 0.); gp_Lin2d L1 = Qualified1.Qualified(); Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified(); - gp_Circ2d C3(gp_Ax2d(Point3, dirx), 0.); + gp_Circ2d C3(gp_Ax2d(Point3, gp_Dir2d(gp_Dir2d::D::X)), 0.); Geom2dGcc_FunctionTanCuCuCu Func(C3, L1, Cu2); math_Vector Umin(1, 3); math_Vector Umax(1, 3); @@ -1350,8 +1348,7 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const GccEnt_QualifiedCirc& Q } gp_Circ2d C1 = Qualified1.Qualified(); Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified(); - gp_Dir2d dirx(1., 0.); - gp_Circ2d C3(gp_Ax2d(Point3, dirx), 0.); + gp_Circ2d C3(gp_Ax2d(Point3, gp_Dir2d(gp_Dir2d::D::X)), 0.); Geom2dGcc_FunctionTanCuCuCu Func(C1, C3, Cu2); math_Vector Umin(1, 3); math_Vector Umax(1, 3); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2dTanCenGeo.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2dTanCenGeo.cxx index a4344b53df..7c17bea9cf 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2dTanCenGeo.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2dTanCenGeo.cxx @@ -57,7 +57,7 @@ Geom2dGcc_Circ2dTanCenGeo::Geom2dGcc_Circ2dTanCenGeo(const Geom2dGcc_QCurve& Qua theDist2(2) = 0.; Standard_Integer i = 1; Standard_Integer nbsol = 0; - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real thePar; Geom2dAdaptor_Curve curve = Qualified1.Qualified(); Extrema_ExtPC2d distmin(Pcenter, diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2dTanOnRadGeo.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2dTanOnRadGeo.cxx index bd13e9dd5e..b842e36b0d 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2dTanOnRadGeo.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2dTanOnRadGeo.cxx @@ -83,7 +83,7 @@ Geom2dGcc_Circ2dTanOnRadGeo::Geom2dGcc_Circ2dTanOnRadGeo(const Geom2dGcc_QCurve& // Traitement. + //========================================================================= - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real Tol = Abs(Tolerance); Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; @@ -208,7 +208,7 @@ Geom2dGcc_Circ2dTanOnRadGeo::Geom2dGcc_Circ2dTanOnRadGeo(const Geom2dGcc_QCurve& // Traitement. + //========================================================================= - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; Standard_Real firstparam; @@ -339,7 +339,7 @@ Geom2dGcc_Circ2dTanOnRadGeo::Geom2dGcc_Circ2dTanOnRadGeo(const GccEnt_QualifiedC // Traitement. + //========================================================================= - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; Standard_Real firstparam; @@ -486,7 +486,7 @@ Geom2dGcc_Circ2dTanOnRadGeo::Geom2dGcc_Circ2dTanOnRadGeo(const GccEnt_QualifiedL // Traitement. + //========================================================================= - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; Standard_Real firstparam; @@ -624,7 +624,7 @@ Geom2dGcc_Circ2dTanOnRadGeo::Geom2dGcc_Circ2dTanOnRadGeo(const Geom2dGcc_QCurve& // Traitement. + //========================================================================= - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; Standard_Real firstparam; @@ -758,7 +758,7 @@ Geom2dGcc_Circ2dTanOnRadGeo::Geom2dGcc_Circ2dTanOnRadGeo(const gp_Pnt2d& // Traitement. + //========================================================================= - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; Standard_Real firstparam; @@ -774,7 +774,7 @@ Geom2dGcc_Circ2dTanOnRadGeo::Geom2dGcc_Circ2dTanOnRadGeo(const gp_Pnt2d& else { // gp_Dir2d Dir(-y1dir,x1dir); - gp_Circ2d Circ(gp_Ax2d(Point1, gp_Dir2d(1., 0.)), Radius); + gp_Circ2d Circ(gp_Ax2d(Point1, gp_Dir2d(gp_Dir2d::D::X)), Radius); IntRes2d_Domain D1(ElCLib::Value(0., Circ), 0., Tol, diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dHatch/Geom2dHatch_Elements.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dHatch/Geom2dHatch_Elements.cxx index 5169c0af6c..943f7abbeb 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dHatch/Geom2dHatch_Elements.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dHatch/Geom2dHatch_Elements.cxx @@ -184,7 +184,7 @@ Standard_Boolean Geom2dHatch_Elements::OtherSegment(const gp_Pnt2d& P, } Par = RealLast(); - L = gp_Lin2d(P, gp_Dir2d(1, 0)); + L = gp_Lin2d(P, gp_Dir2d(gp_Dir2d::D::X)); return Standard_False; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill.cxx index 3f9611392a..045315f896 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill.cxx @@ -240,7 +240,7 @@ void GeomFill::GetMinimalWeights(const Convert_ParameterisationType TConv, Weights.Init(1); else { - gp_Ax2 popAx2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + gp_Ax2 popAx2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); gp_Circ C(popAx2, 1); Handle(Geom_TrimmedCurve) Sect1 = new Geom_TrimmedCurve(new Geom_Circle(C), 0., MaxAng); Handle(Geom_BSplineCurve) CtoBspl = GeomConvert::CurveToBSplineCurve(Sect1, TConv); @@ -326,7 +326,7 @@ Standard_Real GeomFill::GetTolerance(const Convert_ParameterisationType TConv, const Standard_Real AngularTol, const Standard_Real SpatialTol) { - gp_Ax2 popAx2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + gp_Ax2 popAx2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); gp_Circ C(popAx2, Radius); Handle(Geom_Circle) popCircle = new Geom_Circle(C); Handle(Geom_TrimmedCurve) Sect = new Geom_TrimmedCurve(popCircle, 0., Max(AngleMin, 0.02)); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Sweep.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Sweep.cxx index 619c911589..d5598b28d4 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Sweep.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Sweep.cxx @@ -306,7 +306,7 @@ Standard_Boolean GeomFill_Sweep::BuildAll(const GeomAbs_Shape Continuity, Handle(Geom_BSplineSurface) BSplSurf(Handle(Geom_BSplineSurface)::DownCast(mySurface)); - gp_Dir2d D(0., 1.); + gp_Dir2d D(gp_Dir2d::D::Y); gp_Pnt2d P(BSplSurf->UKnot(1), 0); Handle(Geom2d_Line) LC1 = new (Geom2d_Line)(P, D); Handle(Geom2d_TrimmedCurve) TC1 = @@ -363,7 +363,7 @@ Standard_Boolean GeomFill_Sweep::BuildAll(const GeomAbs_Shape Continuity, // les iso Bords. if (!myLoc->HasFirstRestriction()) { - gp_Dir2d D(0., 1.); + gp_Dir2d D(gp_Dir2d::D::Y); gp_Pnt2d P(UKnots(UKnots.Lower()), 0); Handle(Geom2d_Line) LC = new (Geom2d_Line)(P, D); Handle(Geom2d_TrimmedCurve) TC = new (Geom2d_TrimmedCurve)(LC, First, Last); @@ -375,7 +375,7 @@ Standard_Boolean GeomFill_Sweep::BuildAll(const GeomAbs_Shape Continuity, if (!myLoc->HasLastRestriction()) { - gp_Dir2d D(0., 1.); + gp_Dir2d D(gp_Dir2d::D::Y); gp_Pnt2d P(UKnots(UKnots.Upper()), 0); Handle(Geom2d_Line) LC = new (Geom2d_Line)(P, D); Handle(Geom2d_TrimmedCurve) TC = new (Geom2d_TrimmedCurve)(LC, First, Last); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS_1.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS_1.cxx index 35c07aea8c..d08caa9818 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS_1.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS_1.cxx @@ -1321,7 +1321,7 @@ void GeomInt_IntSS::TrimILineOnSurfBoundaries(const Handle(Geom2d_Curve)& theC2d { if (!Precision::IsInfinite(aU1f)) { - aCurS1Bounds[0] = new Geom2d_Line(gp_Pnt2d(aU1f, aV1f), gp_Dir2d(0.0, 1.0)); + aCurS1Bounds[0] = new Geom2d_Line(gp_Pnt2d(aU1f, aV1f), gp_Dir2d(gp_Dir2d::D::Y)); if (!Precision::IsInfinite(aDelta)) aCurS1Bounds[0] = new Geom2d_TrimmedCurve(aCurS1Bounds[0], 0, aDelta); @@ -1329,7 +1329,7 @@ void GeomInt_IntSS::TrimILineOnSurfBoundaries(const Handle(Geom2d_Curve)& theC2d if (!Precision::IsInfinite(aU1l)) { - aCurS1Bounds[1] = new Geom2d_Line(gp_Pnt2d(aU1l, aV1f), gp_Dir2d(0.0, 1.0)); + aCurS1Bounds[1] = new Geom2d_Line(gp_Pnt2d(aU1l, aV1f), gp_Dir2d(gp_Dir2d::D::Y)); if (!Precision::IsInfinite(aDelta)) aCurS1Bounds[1] = new Geom2d_TrimmedCurve(aCurS1Bounds[1], 0, aDelta); } @@ -1340,14 +1340,14 @@ void GeomInt_IntSS::TrimILineOnSurfBoundaries(const Handle(Geom2d_Curve)& theC2d { if (!Precision::IsInfinite(aV1f)) { - aCurS1Bounds[2] = new Geom2d_Line(gp_Pnt2d(aU1f, aV1f), gp_Dir2d(1.0, 0.0)); + aCurS1Bounds[2] = new Geom2d_Line(gp_Pnt2d(aU1f, aV1f), gp_Dir2d(gp_Dir2d::D::X)); if (!Precision::IsInfinite(aDelta)) aCurS1Bounds[2] = new Geom2d_TrimmedCurve(aCurS1Bounds[2], 0, aDelta); } if (!Precision::IsInfinite(aV1l)) { - aCurS1Bounds[3] = new Geom2d_Line(gp_Pnt2d(aU1l, aV1l), gp_Dir2d(1.0, 0.0)); + aCurS1Bounds[3] = new Geom2d_Line(gp_Pnt2d(aU1f, aV1l), gp_Dir2d(gp_Dir2d::D::X)); if (!Precision::IsInfinite(aDelta)) aCurS1Bounds[3] = new Geom2d_TrimmedCurve(aCurS1Bounds[3], 0, aDelta); } @@ -1358,14 +1358,14 @@ void GeomInt_IntSS::TrimILineOnSurfBoundaries(const Handle(Geom2d_Curve)& theC2d { if (!Precision::IsInfinite(aU2f)) { - aCurS2Bounds[0] = new Geom2d_Line(gp_Pnt2d(aU2f, aV2f), gp_Dir2d(0.0, 1.0)); + aCurS2Bounds[0] = new Geom2d_Line(gp_Pnt2d(aU2f, aV2f), gp_Dir2d(gp_Dir2d::D::Y)); if (!Precision::IsInfinite(aDelta)) aCurS2Bounds[0] = new Geom2d_TrimmedCurve(aCurS2Bounds[0], 0, aDelta); } if (!Precision::IsInfinite(aU2l)) { - aCurS2Bounds[1] = new Geom2d_Line(gp_Pnt2d(aU2l, aV2f), gp_Dir2d(0.0, 1.0)); + aCurS2Bounds[1] = new Geom2d_Line(gp_Pnt2d(aU2l, aV2f), gp_Dir2d(gp_Dir2d::D::Y)); if (!Precision::IsInfinite(aDelta)) aCurS2Bounds[1] = new Geom2d_TrimmedCurve(aCurS2Bounds[1], 0, aDelta); } @@ -1376,14 +1376,14 @@ void GeomInt_IntSS::TrimILineOnSurfBoundaries(const Handle(Geom2d_Curve)& theC2d { if (!Precision::IsInfinite(aV2f)) { - aCurS2Bounds[2] = new Geom2d_Line(gp_Pnt2d(aU2f, aV2f), gp_Dir2d(1.0, 0.0)); + aCurS2Bounds[2] = new Geom2d_Line(gp_Pnt2d(aU2f, aV2f), gp_Dir2d(gp_Dir2d::D::X)); if (!Precision::IsInfinite(aDelta)) aCurS2Bounds[2] = new Geom2d_TrimmedCurve(aCurS2Bounds[2], 0, aDelta); } if (!Precision::IsInfinite(aV2l)) { - aCurS2Bounds[3] = new Geom2d_Line(gp_Pnt2d(aU2l, aV2l), gp_Dir2d(1.0, 0.0)); + aCurS2Bounds[3] = new Geom2d_Line(gp_Pnt2d(aU2f, aV2l), gp_Dir2d(gp_Dir2d::D::X)); if (!Precision::IsInfinite(aDelta)) aCurS2Bounds[3] = new Geom2d_TrimmedCurve(aCurS2Bounds[3], 0, aDelta); } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Hatch/Hatch_Hatcher.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Hatch/Hatch_Hatcher.cxx index d6b71a3607..373de0d988 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Hatch/Hatch_Hatcher.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Hatch/Hatch_Hatcher.cxx @@ -56,7 +56,7 @@ void Hatch_Hatcher::AddLine(const gp_Dir2d& D, const Standard_Real Dist) void Hatch_Hatcher::AddXLine(const Standard_Real X) { gp_Pnt2d O(X, 0); - gp_Dir2d D(0, 1); + gp_Dir2d D(gp_Dir2d::D::Y); gp_Lin2d L(O, D); AddLine(L, Hatch_XLINE); } @@ -66,7 +66,7 @@ void Hatch_Hatcher::AddXLine(const Standard_Real X) void Hatch_Hatcher::AddYLine(const Standard_Real Y) { gp_Pnt2d O(0, Y); - gp_Dir2d D(1, 0); + gp_Dir2d D(gp_Dir2d::D::X); gp_Lin2d L(O, D); AddLine(L, Hatch_YLINE); } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_PWalking.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_PWalking.cxx index e436f3e25f..70f4bbcc30 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_PWalking.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_PWalking.cxx @@ -2171,10 +2171,10 @@ Standard_Boolean IntWalk_PWalking::ExtendLineInCommonZone( gp_Pnt2d(FirstParams.Value(afirstindex), FirstParams.Value(afirstindex + 1)), gp_Pnt2d(LastParams.Value(afirstindex), LastParams.Value(afirstindex + 1))); - gp_Dir2d anIsoDir(0, 1); + gp_Dir2d anIsoDir(gp_Dir2d::D::Y); if ((indexofiso == 1) || (indexofiso == 3)) - anIsoDir = gp_Dir2d(1, 0); + anIsoDir = gp_Dir2d(gp_Dir2d::D::X); if (aTangentZoneDir.SquareMagnitude() > gp::Resolution()) { diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_Tool.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_Tool.cxx index 0f2a926907..8501d74707 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_Tool.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_Tool.cxx @@ -313,7 +313,7 @@ Standard_Integer Intf_Tool::Inters2d(const gp_Hypr2d& theCurv, const Bnd_Box2d& if (!Domain.IsOpenYmax()) { - gp_Lin2d L1(gp_Pnt2d(0., ymax), gp_Dir2d(-1., 0.)); + gp_Lin2d L1(gp_Pnt2d(0., ymax), gp_Dir2d(gp_Dir2d::D::NX)); IntAna2d_AnaIntersection Inters1(theCurv, IntAna2d_Conic(L1)); if (Inters1.IsDone()) { @@ -336,7 +336,7 @@ Standard_Integer Intf_Tool::Inters2d(const gp_Hypr2d& theCurv, const Bnd_Box2d& if (!Domain.IsOpenXmin()) { - gp_Lin2d L2(gp_Pnt2d(xmin, 0.), gp_Dir2d(0., -1.)); + gp_Lin2d L2(gp_Pnt2d(xmin, 0.), gp_Dir2d(gp_Dir2d::D::NY)); IntAna2d_AnaIntersection Inters2(theCurv, IntAna2d_Conic(L2)); if (Inters2.IsDone()) { @@ -359,7 +359,7 @@ Standard_Integer Intf_Tool::Inters2d(const gp_Hypr2d& theCurv, const Bnd_Box2d& if (!Domain.IsOpenYmin()) { - gp_Lin2d L3(gp_Pnt2d(0., ymin), gp_Dir2d(1., 0.)); + gp_Lin2d L3(gp_Pnt2d(0., ymin), gp_Dir2d(gp_Dir2d::D::X)); IntAna2d_AnaIntersection Inters3(theCurv, IntAna2d_Conic(L3)); if (Inters3.IsDone()) { @@ -382,7 +382,7 @@ Standard_Integer Intf_Tool::Inters2d(const gp_Hypr2d& theCurv, const Bnd_Box2d& if (!Domain.IsOpenXmax()) { - gp_Lin2d L4(gp_Pnt2d(xmax, 0.), gp_Dir2d(0., 1.)); + gp_Lin2d L4(gp_Pnt2d(xmax, 0.), gp_Dir2d(gp_Dir2d::D::Y)); IntAna2d_AnaIntersection Inters4(theCurv, IntAna2d_Conic(L4)); if (Inters4.IsDone()) { @@ -554,7 +554,7 @@ Standard_Integer Intf_Tool::Inters2d(const gp_Parab2d& theCurv, const Bnd_Box2d& if (!Domain.IsOpenYmax()) { - gp_Lin2d L1(gp_Pnt2d(0., ymax), gp_Dir2d(-1., 0.)); + gp_Lin2d L1(gp_Pnt2d(0., ymax), gp_Dir2d(gp_Dir2d::D::NX)); IntAna2d_AnaIntersection Inters1(theCurv, IntAna2d_Conic(L1)); if (Inters1.IsDone()) { @@ -577,7 +577,7 @@ Standard_Integer Intf_Tool::Inters2d(const gp_Parab2d& theCurv, const Bnd_Box2d& if (!Domain.IsOpenXmin()) { - gp_Lin2d L2(gp_Pnt2d(xmin, 0.), gp_Dir2d(0., -1.)); + gp_Lin2d L2(gp_Pnt2d(xmin, 0.), gp_Dir2d(gp_Dir2d::D::NY)); IntAna2d_AnaIntersection Inters2(theCurv, IntAna2d_Conic(L2)); if (Inters2.IsDone()) { @@ -600,7 +600,7 @@ Standard_Integer Intf_Tool::Inters2d(const gp_Parab2d& theCurv, const Bnd_Box2d& if (!Domain.IsOpenYmin()) { - gp_Lin2d L3(gp_Pnt2d(0., ymin), gp_Dir2d(1., 0.)); + gp_Lin2d L3(gp_Pnt2d(0., ymin), gp_Dir2d(gp_Dir2d::D::X)); IntAna2d_AnaIntersection Inters3(theCurv, IntAna2d_Conic(L3)); if (Inters3.IsDone()) { @@ -623,7 +623,7 @@ Standard_Integer Intf_Tool::Inters2d(const gp_Parab2d& theCurv, const Bnd_Box2d& if (!Domain.IsOpenXmax()) { - gp_Lin2d L4(gp_Pnt2d(xmax, 0.), gp_Dir2d(0., 1.)); + gp_Lin2d L4(gp_Pnt2d(xmax, 0.), gp_Dir2d(gp_Dir2d::D::Y)); IntAna2d_AnaIntersection Inters4(theCurv, IntAna2d_Conic(L4)); if (Inters4.IsDone()) { diff --git a/src/ModelingAlgorithms/TKHLR/Contap/Contap_ArcFunction.cxx b/src/ModelingAlgorithms/TKHLR/Contap/Contap_ArcFunction.cxx index 646d9c92b4..70ed1ece9e 100644 --- a/src/ModelingAlgorithms/TKHLR/Contap/Contap_ArcFunction.cxx +++ b/src/ModelingAlgorithms/TKHLR/Contap/Contap_ArcFunction.cxx @@ -24,7 +24,7 @@ Contap_ArcFunction::Contap_ArcFunction() : myMean(1.), myType(Contap_ContourStd), - myDir(0., 0., 1.), + myDir(gp_Dir::D::Z), myCosAng(0.0) { } diff --git a/src/ModelingAlgorithms/TKHLR/Contap/Contap_SurfFunction.cxx b/src/ModelingAlgorithms/TKHLR/Contap/Contap_SurfFunction.cxx index 456b2c5db8..8ad04e5267 100644 --- a/src/ModelingAlgorithms/TKHLR/Contap/Contap_SurfFunction.cxx +++ b/src/ModelingAlgorithms/TKHLR/Contap/Contap_SurfFunction.cxx @@ -29,7 +29,7 @@ Contap_SurfFunction::Contap_SurfFunction() : myMean(1.), myType(Contap_ContourStd), - myDir(0., 0., 1.), + myDir(gp_Dir::D::Z), myAng(0.0), myCosAng(0.), // PI/2 - Angle de depouille tol(1.e-6), diff --git a/src/ModelingAlgorithms/TKHLR/HLRAlgo/HLRAlgo_Projector.cxx b/src/ModelingAlgorithms/TKHLR/HLRAlgo/HLRAlgo_Projector.cxx index e8faf68d2c..bf12239c2a 100644 --- a/src/ModelingAlgorithms/TKHLR/HLRAlgo/HLRAlgo_Projector.cxx +++ b/src/ModelingAlgorithms/TKHLR/HLRAlgo/HLRAlgo_Projector.cxx @@ -353,7 +353,7 @@ gp_Lin HLRAlgo_Projector::Shoot(const Standard_Real X, const Standard_Real Y) co } else { - L = gp_Lin(gp_Pnt(X, Y, 0), gp_Dir(0, 0, -1)); + L = gp_Lin(gp_Pnt(X, Y, 0), gp_Dir(gp_Dir::D::NZ)); } L.Transform(myInvTrsf); return L; diff --git a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_Data.cxx b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_Data.cxx index a14c1e322a..fb0f977d07 100644 --- a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_Data.cxx +++ b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_Data.cxx @@ -1536,7 +1536,7 @@ void HLRBRep_Data::EdgeState(const Standard_Real p1, } else { - V = gp_Dir(0, 0, -1); + V = gp_Dir(gp_Dir::D::NZ); } V.Transform(TI); if (NrmFace.Dot(V) > 0.) @@ -1717,7 +1717,7 @@ Standard_Boolean HLRBRep_Data::OrientOutLine(const Standard_Integer I, HLRBRep_F } else { - V = gp_Dir(0, 0, -1); + V = gp_Dir(gp_Dir::D::NZ); } V.Transform(TI); if (mySLProps.IsNormalDefined()) diff --git a/src/ModelingAlgorithms/TKHLR/HLRTopoBRep/HLRTopoBRep_FaceIsoLiner.cxx b/src/ModelingAlgorithms/TKHLR/HLRTopoBRep/HLRTopoBRep_FaceIsoLiner.cxx index 4106bf5006..5b70e60a8a 100644 --- a/src/ModelingAlgorithms/TKHLR/HLRTopoBRep/HLRTopoBRep_FaceIsoLiner.cxx +++ b/src/ModelingAlgorithms/TKHLR/HLRTopoBRep/HLRTopoBRep_FaceIsoLiner.cxx @@ -182,7 +182,7 @@ void HLRTopoBRep_FaceIsoLiner::Perform(const Standard_Integer FI, if (StepU > Confusion) { Standard_Real UPrm = UMin + StepU / 2.; - gp_Dir2d Dir(0., 1.); + gp_Dir2d Dir(gp_Dir2d::D::Y); for (IIso = 1; IIso <= nbIsos; IIso++) { @@ -286,7 +286,7 @@ void HLRTopoBRep_FaceIsoLiner::Perform(const Standard_Integer FI, if (StepV > Confusion) { Standard_Real VPrm = VMin + StepV / 2.; - gp_Dir2d Dir(1., 0.); + gp_Dir2d Dir(gp_Dir2d::D::X); for (IIso = 1; IIso <= nbIsos; IIso++) { diff --git a/src/ModelingAlgorithms/TKHelix/GTests/HelixBRep_BuilderHelix_Integration_Test.cxx b/src/ModelingAlgorithms/TKHelix/GTests/HelixBRep_BuilderHelix_Integration_Test.cxx index 3aeb0e9ff6..a2b4cb55ee 100644 --- a/src/ModelingAlgorithms/TKHelix/GTests/HelixBRep_BuilderHelix_Integration_Test.cxx +++ b/src/ModelingAlgorithms/TKHelix/GTests/HelixBRep_BuilderHelix_Integration_Test.cxx @@ -34,7 +34,7 @@ protected: void SetUp() override { // Standard axis aligned with Z - myAxis = gp_Ax3(gp_Pnt(0., 0., 0.), gp_Dir(0., 0., 1.), gp_Dir(1., 0., 0.)); + myAxis = gp_Ax3(gp_Pnt(0., 0., 0.), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)); myTolerance = 1.e-4; } diff --git a/src/ModelingAlgorithms/TKHelix/GTests/HelixBRep_BuilderHelix_Test.cxx b/src/ModelingAlgorithms/TKHelix/GTests/HelixBRep_BuilderHelix_Test.cxx index 9c34cddde5..e17d390a4e 100644 --- a/src/ModelingAlgorithms/TKHelix/GTests/HelixBRep_BuilderHelix_Test.cxx +++ b/src/ModelingAlgorithms/TKHelix/GTests/HelixBRep_BuilderHelix_Test.cxx @@ -45,7 +45,7 @@ protected: void SetUp() override { // Default axis setup - myAxis = gp_Ax3(gp_Pnt(0., 0., 0.), gp_Dir(0., 0., 1.), gp_Dir(1., 0., 0.)); + myAxis = gp_Ax3(gp_Pnt(0., 0., 0.), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)); myTolerance = 1.e-4; } @@ -167,7 +167,7 @@ TEST_F(TKHelixTest, HelixGeomBuilderHelix_SingleCoil) { HelixGeom_BuilderHelix aBuilder; - gp_Ax2 aPosition(gp_Pnt(0., 0., 0.), gp_Dir(0., 0., 1.), gp_Dir(1., 0., 0.)); + gp_Ax2 aPosition(gp_Pnt(0., 0., 0.), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)); aBuilder.SetPosition(aPosition); aBuilder.SetTolerance(myTolerance); aBuilder.SetCurveParameters(0.0, 2.0 * M_PI, 10.0, 5.0, 0.0, Standard_True); @@ -184,7 +184,7 @@ TEST_F(TKHelixTest, HelixGeomBuilderHelix_MultipleCoils) { HelixGeom_BuilderHelix aBuilder; - gp_Ax2 aPosition(gp_Pnt(0., 0., 0.), gp_Dir(0., 0., 1.), gp_Dir(1., 0., 0.)); + gp_Ax2 aPosition(gp_Pnt(0., 0., 0.), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)); aBuilder.SetPosition(aPosition); aBuilder.SetTolerance(myTolerance); diff --git a/src/ModelingAlgorithms/TKHelix/GTests/HelixGeom_BuilderHelix_Test.cxx b/src/ModelingAlgorithms/TKHelix/GTests/HelixGeom_BuilderHelix_Test.cxx index 0d6d44caff..240beac5be 100644 --- a/src/ModelingAlgorithms/TKHelix/GTests/HelixGeom_BuilderHelix_Test.cxx +++ b/src/ModelingAlgorithms/TKHelix/GTests/HelixGeom_BuilderHelix_Test.cxx @@ -31,7 +31,7 @@ TEST_F(HelixGeom_BuilderHelix_Test, SingleCoil) { HelixGeom_BuilderHelix aBuilder; - gp_Ax2 aPosition(gp_Pnt(0., 0., 0.), gp_Dir(0., 0., 1.), gp_Dir(1., 0., 0.)); + gp_Ax2 aPosition(gp_Pnt(0., 0., 0.), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)); aBuilder.SetPosition(aPosition); aBuilder.SetTolerance(myTolerance); aBuilder.SetCurveParameters(0.0, 2.0 * M_PI, 10.0, 5.0, 0.0, Standard_True); @@ -48,7 +48,7 @@ TEST_F(HelixGeom_BuilderHelix_Test, MultipleCoils) { HelixGeom_BuilderHelix aBuilder; - gp_Ax2 aPosition(gp_Pnt(0., 0., 0.), gp_Dir(0., 0., 1.), gp_Dir(1., 0., 0.)); + gp_Ax2 aPosition(gp_Pnt(0., 0., 0.), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)); aBuilder.SetPosition(aPosition); aBuilder.SetTolerance(myTolerance); @@ -67,7 +67,7 @@ TEST_F(HelixGeom_BuilderHelix_Test, PositionGetterSetter) { HelixGeom_BuilderHelix aBuilder; - gp_Ax2 aTestPosition(gp_Pnt(10., 20., 30.), gp_Dir(1., 0., 0.), gp_Dir(0., 1., 0.)); + gp_Ax2 aTestPosition(gp_Pnt(10., 20., 30.), gp_Dir(gp_Dir::D::X), gp_Dir(gp_Dir::D::Y)); aBuilder.SetPosition(aTestPosition); const gp_Ax2& aRetrievedPosition = aBuilder.Position(); diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Inter2d.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Inter2d.cxx index 4bf7912bfe..5a024fda04 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Inter2d.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Inter2d.cxx @@ -1206,22 +1206,22 @@ Standard_Boolean BRepOffset_Inter2d::ExtentEdge(const TopoDS_Edge& E, TColGeom2d_SequenceOfCurve BoundLines; if (!Precision::IsInfinite(Vmin)) { - Handle(Geom2d_Line) aLine = new Geom2d_Line(gp_Pnt2d(0., Vmin), gp_Dir2d(1., 0.)); + Handle(Geom2d_Line) aLine = new Geom2d_Line(gp_Pnt2d(0., Vmin), gp_Dir2d(gp_Dir2d::D::X)); BoundLines.Append(aLine); } if (!Precision::IsInfinite(Umin)) { - Handle(Geom2d_Line) aLine = new Geom2d_Line(gp_Pnt2d(Umin, 0.), gp_Dir2d(0., 1.)); + Handle(Geom2d_Line) aLine = new Geom2d_Line(gp_Pnt2d(Umin, 0.), gp_Dir2d(gp_Dir2d::D::Y)); BoundLines.Append(aLine); } if (!Precision::IsInfinite(Vmax)) { - Handle(Geom2d_Line) aLine = new Geom2d_Line(gp_Pnt2d(0., Vmax), gp_Dir2d(1., 0.)); + Handle(Geom2d_Line) aLine = new Geom2d_Line(gp_Pnt2d(0., Vmax), gp_Dir2d(gp_Dir2d::D::X)); BoundLines.Append(aLine); } if (!Precision::IsInfinite(Umax)) { - Handle(Geom2d_Line) aLine = new Geom2d_Line(gp_Pnt2d(Umax, 0.), gp_Dir2d(0., 1.)); + Handle(Geom2d_Line) aLine = new Geom2d_Line(gp_Pnt2d(Umax, 0.), gp_Dir2d(gp_Dir2d::D::Y)); BoundLines.Append(aLine); } diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset.cxx index cc58452d18..65c8085dcf 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset.cxx @@ -3340,10 +3340,10 @@ void BRepOffset_MakeOffset::MakeMissingWalls(const Message_ProgressRange& theRan if (!IsPlanar) { TopLoc_Location Loc; - EdgeLine2d = new Geom2d_Line(gp_Pnt2d(0., 0.), gp_Dir2d(1., 0.)); + EdgeLine2d = new Geom2d_Line(gp_Pnt2d(0., 0.), gp_Dir2d(gp_Dir2d::D::X)); BB.UpdateEdge(anEdge, EdgeLine2d, theSurf, Loc, Precision::Confusion()); Standard_Real Coeff = (OffsetDir * CircAxisDir > 0.) ? 1. : -1.; - OELine2d = new Geom2d_Line(gp_Pnt2d(0., OffsetVal * Coeff), gp_Dir2d(1., 0.)); + OELine2d = new Geom2d_Line(gp_Pnt2d(0., OffsetVal * Coeff), gp_Dir2d(gp_Dir2d::D::X)); BB.UpdateEdge(OE, OELine2d, theSurf, Loc, Precision::Confusion()); aLine2d = new Geom2d_Line(gp_Pnt2d(ParV2, 0.), gp_Dir2d(0., Coeff)); aLine2d2 = new Geom2d_Line(gp_Pnt2d(ParV1, 0.), gp_Dir2d(0., Coeff)); @@ -3427,14 +3427,14 @@ void BRepOffset_MakeOffset::MakeMissingWalls(const Message_ProgressRange& theRan Standard_Real Uf, Ul, Vf, Vl; theSurf->Bounds(Uf, Ul, Vf, Vl); TopLoc_Location Loc; - EdgeLine2d = new Geom2d_Line(gp_Pnt2d(0., Vf), gp_Dir2d(1., 0.)); + EdgeLine2d = new Geom2d_Line(gp_Pnt2d(0., Vf), gp_Dir2d(gp_Dir2d::D::X)); BB.UpdateEdge(anEdge, EdgeLine2d, theSurf, Loc, Precision::Confusion()); - OELine2d = new Geom2d_Line(gp_Pnt2d(0., Vl), gp_Dir2d(1., 0.)); + OELine2d = new Geom2d_Line(gp_Pnt2d(0., Vl), gp_Dir2d(gp_Dir2d::D::X)); BB.UpdateEdge(OE, OELine2d, theSurf, Loc, Precision::Confusion()); Standard_Real UonV1 = (ToReverse) ? Ul : Uf; Standard_Real UonV2 = (ToReverse) ? Uf : Ul; - aLine2d = new Geom2d_Line(gp_Pnt2d(UonV2, 0.), gp_Dir2d(0., 1.)); - aLine2d2 = new Geom2d_Line(gp_Pnt2d(UonV1, 0.), gp_Dir2d(0., 1.)); + aLine2d = new Geom2d_Line(gp_Pnt2d(UonV2, 0.), gp_Dir2d(gp_Dir2d::D::Y)); + aLine2d2 = new Geom2d_Line(gp_Pnt2d(UonV1, 0.), gp_Dir2d(gp_Dir2d::D::Y)); if (E3.IsSame(E4)) { BB.UpdateEdge(E3, aLine2d, aLine2d2, theSurf, Loc, Precision::Confusion()); diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeSimpleOffset.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeSimpleOffset.cxx index bfeca12a84..7a540114aa 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeSimpleOffset.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeSimpleOffset.cxx @@ -582,14 +582,14 @@ TopoDS_Face BRepOffset_MakeSimpleOffset::BuildWallFace(const TopoDS_Edge& theOri theSurf->Bounds(Uf, Ul, Vf, Vl); TopLoc_Location Loc; Handle(Geom2d_Line) EdgeLine2d, OELine2d, aLine2d, aLine2d2; - EdgeLine2d = new Geom2d_Line(gp_Pnt2d(0., Vf), gp_Dir2d(1., 0.)); + EdgeLine2d = new Geom2d_Line(gp_Pnt2d(0., Vf), gp_Dir2d(gp_Dir2d::D::X)); aBB.UpdateEdge(theOrigEdge, EdgeLine2d, theSurf, Loc, Precision::Confusion()); - OELine2d = new Geom2d_Line(gp_Pnt2d(0., Vl), gp_Dir2d(1., 0.)); + OELine2d = new Geom2d_Line(gp_Pnt2d(0., Vl), gp_Dir2d(gp_Dir2d::D::X)); aBB.UpdateEdge(aNewEdge, OELine2d, theSurf, Loc, Precision::Confusion()); Standard_Real UonV1 = (ToReverse) ? Ul : Uf; Standard_Real UonV2 = (ToReverse) ? Uf : Ul; - aLine2d = new Geom2d_Line(gp_Pnt2d(UonV2, 0.), gp_Dir2d(0., 1.)); - aLine2d2 = new Geom2d_Line(gp_Pnt2d(UonV1, 0.), gp_Dir2d(0., 1.)); + aLine2d = new Geom2d_Line(gp_Pnt2d(UonV2, 0.), gp_Dir2d(gp_Dir2d::D::Y)); + aLine2d2 = new Geom2d_Line(gp_Pnt2d(UonV1, 0.), gp_Dir2d(gp_Dir2d::D::Y)); if (aWall1.IsSame(aWall2)) { aBB.UpdateEdge(aWall1, aLine2d, aLine2d2, theSurf, Loc, Precision::Confusion()); diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Offset.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Offset.cxx index fdad28d107..4dcc45b44e 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Offset.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Offset.cxx @@ -1125,7 +1125,7 @@ void BRepOffset_Offset::Init(const TopoDS_Edge& Path, Handle(Geom2d_Curve) PC; if (ExchUV) { - PC = new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(1, 0)); + PC = new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(gp_Dir2d::D::X)); U1 = f1; U2 = l1; if (!C1is3D) @@ -1133,7 +1133,7 @@ void BRepOffset_Offset::Init(const TopoDS_Edge& Path, } else { - PC = new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(0, 1)); + PC = new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(gp_Dir2d::D::Y)); U1 = f2; U2 = l2; if (!C1is3D) @@ -1172,7 +1172,7 @@ void BRepOffset_Offset::Init(const TopoDS_Edge& Path, // Update de edge2. (Rem : has already a 3d curve) if (ExchUV) { - PC = new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(1, 0)); + PC = new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(gp_Dir2d::D::X)); U1 = f1; U2 = l1; if (!C2is3D) @@ -1180,7 +1180,7 @@ void BRepOffset_Offset::Init(const TopoDS_Edge& Path, } else { - PC = new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(0, 1)); + PC = new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(gp_Dir2d::D::Y)); U1 = f2; U2 = l2; if (!C2is3D) @@ -1275,15 +1275,15 @@ void BRepOffset_Offset::Init(const TopoDS_Edge& Path, { // rem : si ExchUv, il faut reverser le Wire. // donc l'edge Forward dans la face sera E4 : d'ou L1 et L2 - L2 = new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(0, 1)); - L1 = new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(0, 1)); + L2 = new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(gp_Dir2d::D::Y)); + L1 = new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(gp_Dir2d::D::Y)); U1 = f2; U2 = l2; } else { - L1 = new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(1, 0)); - L2 = new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(1, 0)); + L1 = new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(gp_Dir2d::D::X)); + L2 = new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(gp_Dir2d::D::X)); U1 = f1; U2 = l1; } @@ -1340,13 +1340,13 @@ void BRepOffset_Offset::Init(const TopoDS_Edge& Path, if (ExchUV) { - L1 = new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(0, 1)); + L1 = new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(gp_Dir2d::D::Y)); U1 = f2; U2 = l2; } else { - L1 = new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(1, 0)); + L1 = new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(gp_Dir2d::D::X)); U1 = f1; U2 = l1; } @@ -1366,13 +1366,13 @@ void BRepOffset_Offset::Init(const TopoDS_Edge& Path, if (ExchUV) { - L2 = new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(0, 1)); + L2 = new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(gp_Dir2d::D::Y)); U1 = f2; U2 = l2; } else { - L2 = new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(1, 0)); + L2 = new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(gp_Dir2d::D::X)); U1 = f1; U2 = l1; } diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Tool.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Tool.cxx index 54705e0175..cdc8b78694 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Tool.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Tool.cxx @@ -2618,13 +2618,13 @@ static void MakeFace(const Handle(Geom_Surface)& S, // make the lines Handle(Geom2d_Line) Lumin, Lumax, Lvmin, Lvmax; if (!umininf) - Lumin = new Geom2d_Line(gp_Pnt2d(UMin, 0), gp_Dir2d(0, 1)); + Lumin = new Geom2d_Line(gp_Pnt2d(UMin, 0), gp_Dir2d(gp_Dir2d::D::Y)); if (!umaxinf) - Lumax = new Geom2d_Line(gp_Pnt2d(UMax, 0), gp_Dir2d(0, 1)); + Lumax = new Geom2d_Line(gp_Pnt2d(UMax, 0), gp_Dir2d(gp_Dir2d::D::Y)); if (!vmininf) - Lvmin = new Geom2d_Line(gp_Pnt2d(0, VMin), gp_Dir2d(1, 0)); + Lvmin = new Geom2d_Line(gp_Pnt2d(0, VMin), gp_Dir2d(gp_Dir2d::D::X)); if (!vmaxinf) - Lvmax = new Geom2d_Line(gp_Pnt2d(0, VMax), gp_Dir2d(1, 0)); + Lvmax = new Geom2d_Line(gp_Pnt2d(0, VMax), gp_Dir2d(gp_Dir2d::D::X)); Handle(Geom_Curve) Cumin, Cumax, Cvmin, Cvmax; Standard_Real TolApex = 1.e-5; diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx index 8e25ffd144..078376c0e8 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx @@ -906,8 +906,8 @@ void BRepOffsetAPI_ThruSections::CreateSmoothed() if (vClosed) { B.UpdateEdge(edge1, - new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(1, 0)), - new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(1, 0)), + new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(gp_Dir2d::D::X)), + new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(gp_Dir2d::D::X)), face, Precision::Confusion()); B.Range(edge1, face, f1, l1); @@ -915,12 +915,12 @@ void BRepOffsetAPI_ThruSections::CreateSmoothed() else { B.UpdateEdge(edge1, - new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(1, 0)), + new Geom2d_Line(gp_Pnt2d(0, f2), gp_Dir2d(gp_Dir2d::D::X)), face, Precision::Confusion()); B.Range(edge1, face, f1, l1); B.UpdateEdge(edge2, - new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(1, 0)), + new Geom2d_Line(gp_Pnt2d(0, l2), gp_Dir2d(gp_Dir2d::D::X)), face, Precision::Confusion()); B.Range(edge2, face, f1, l1); @@ -929,8 +929,8 @@ void BRepOffsetAPI_ThruSections::CreateSmoothed() if (uClosed && nbEdges == 1) { B.UpdateEdge(edge3, - new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(0, 1)), - new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(0, 1)), + new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(gp_Dir2d::D::Y)), + new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(gp_Dir2d::D::Y)), face, Precision::Confusion()); B.Range(edge3, face, f2, l2); @@ -938,12 +938,12 @@ void BRepOffsetAPI_ThruSections::CreateSmoothed() else { B.UpdateEdge(edge3, - new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(0, 1)), + new Geom2d_Line(gp_Pnt2d(f1, 0), gp_Dir2d(gp_Dir2d::D::Y)), face, Precision::Confusion()); B.Range(edge3, face, f2, l2); B.UpdateEdge(edge4, - new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(0, 1)), + new Geom2d_Line(gp_Pnt2d(l1, 0), gp_Dir2d(gp_Dir2d::D::Y)), face, Precision::Confusion()); B.Range(edge4, face, f2, l2); diff --git a/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_Cone.cxx b/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_Cone.cxx index c9f5a92594..c125bd5e85 100644 --- a/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_Cone.cxx +++ b/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_Cone.cxx @@ -65,7 +65,7 @@ BRepPrim_Cone::BRepPrim_Cone(const Standard_Real Angle) //================================================================================================= BRepPrim_Cone::BRepPrim_Cone(const Standard_Real Angle, const gp_Pnt& Apex) - : BRepPrim_Revolution(gp_Ax2(Apex, gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), 0, RealLast()), + : BRepPrim_Revolution(gp_Ax2(Apex, gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), 0, RealLast()), myHalfAngle(Angle), myRadius(0.) { @@ -102,7 +102,7 @@ BRepPrim_Cone::BRepPrim_Cone(const gp_Pnt& Center, const Standard_Real R1, const Standard_Real R2, const Standard_Real H) - : BRepPrim_Revolution(gp_Ax2(Center, gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), 0, 0) + : BRepPrim_Revolution(gp_Ax2(Center, gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), 0, 0) { SetParameters(R1, R2, H); SetMeridian(); diff --git a/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_Cylinder.cxx b/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_Cylinder.cxx index 6226e6ffaa..6eb81894a7 100644 --- a/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_Cylinder.cxx +++ b/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_Cylinder.cxx @@ -48,7 +48,7 @@ BRepPrim_Cylinder::BRepPrim_Cylinder(const Standard_Real Radius) //================================================================================================= BRepPrim_Cylinder::BRepPrim_Cylinder(const gp_Pnt& Center, const Standard_Real Radius) - : BRepPrim_Revolution(gp_Ax2(Center, gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), + : BRepPrim_Revolution(gp_Ax2(Center, gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), RealFirst(), RealLast()), myRadius(Radius) @@ -79,7 +79,7 @@ BRepPrim_Cylinder::BRepPrim_Cylinder(const Standard_Real R, const Standard_Real BRepPrim_Cylinder::BRepPrim_Cylinder(const gp_Pnt& Center, const Standard_Real R, const Standard_Real H) - : BRepPrim_Revolution(gp_Ax2(Center, gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), 0, H), + : BRepPrim_Revolution(gp_Ax2(Center, gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), 0, H), myRadius(R) { SetMeridian(); @@ -104,6 +104,6 @@ void BRepPrim_Cylinder::SetMeridian() gp_Ax1 A = Axes().Axis(); A.Translate(V); Handle(Geom_Line) L = new Geom_Line(A); - Handle(Geom2d_Line) L2d = new Geom2d_Line(gp_Pnt2d(myRadius, 0), gp_Dir2d(0, 1)); + Handle(Geom2d_Line) L2d = new Geom2d_Line(gp_Pnt2d(myRadius, 0), gp_Dir2d(gp_Dir2d::D::Y)); Meridian(L, L2d); } diff --git a/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_FaceBuilder.cxx b/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_FaceBuilder.cxx index e05ee19933..fb2891c201 100644 --- a/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_FaceBuilder.cxx +++ b/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_FaceBuilder.cxx @@ -102,13 +102,13 @@ void BRepPrim_FaceBuilder::Init(const BRep_Builder& B, // set the pcurves Handle(Geom2d_Line) L; - L = new Geom2d_Line(gp_Pnt2d(UMin, VMin), gp_Dir2d(1, 0)); + L = new Geom2d_Line(gp_Pnt2d(UMin, VMin), gp_Dir2d(gp_Dir2d::D::X)); B.UpdateEdge(myEdges[0], L, myFace, Precision::Confusion()); - L = new Geom2d_Line(gp_Pnt2d(UMax, VMin), gp_Dir2d(0, 1)); + L = new Geom2d_Line(gp_Pnt2d(UMax, VMin), gp_Dir2d(gp_Dir2d::D::Y)); B.UpdateEdge(myEdges[1], L, myFace, Precision::Confusion()); - L = new Geom2d_Line(gp_Pnt2d(UMax, VMax), gp_Dir2d(-1, 0)); + L = new Geom2d_Line(gp_Pnt2d(UMax, VMax), gp_Dir2d(gp_Dir2d::D::NX)); B.UpdateEdge(myEdges[2], L, myFace, Precision::Confusion()); - L = new Geom2d_Line(gp_Pnt2d(UMin, VMax), gp_Dir2d(0, -1)); + L = new Geom2d_Line(gp_Pnt2d(UMin, VMax), gp_Dir2d(gp_Dir2d::D::NY)); B.UpdateEdge(myEdges[3], L, myFace, Precision::Confusion()); // set the parameters diff --git a/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_OneAxis.cxx b/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_OneAxis.cxx index 73ad9b5098..0f92085e0a 100644 --- a/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_OneAxis.cxx +++ b/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_OneAxis.cxx @@ -296,8 +296,8 @@ const TopoDS_Face& BRepPrim_OneAxis::LateralFace() // closed edge myBuilder.SetPCurve(myEdges[ETOP], myFaces[FLATERAL], - gp_Lin2d(gp_Pnt2d(0, myVMin), gp_Dir2d(1, 0)), - gp_Lin2d(gp_Pnt2d(0, myVMax), gp_Dir2d(1, 0))); + gp_Lin2d(gp_Pnt2d(0, myVMin), gp_Dir2d(gp_Dir2d::D::X)), + gp_Lin2d(gp_Pnt2d(0, myVMax), gp_Dir2d(gp_Dir2d::D::X))); } else { @@ -305,7 +305,7 @@ const TopoDS_Face& BRepPrim_OneAxis::LateralFace() { myBuilder.SetPCurve(myEdges[ETOP], myFaces[FLATERAL], - gp_Lin2d(gp_Pnt2d(0, myVMax), gp_Dir2d(1, 0))); + gp_Lin2d(gp_Pnt2d(0, myVMax), gp_Dir2d(gp_Dir2d::D::X))); if (!HasSides() || MeridianOnAxis(myVMax)) { // closed edge set parameters @@ -316,7 +316,7 @@ const TopoDS_Face& BRepPrim_OneAxis::LateralFace() { myBuilder.SetPCurve(myEdges[EBOTTOM], myFaces[FLATERAL], - gp_Lin2d(gp_Pnt2d(0, myVMin), gp_Dir2d(1, 0))); + gp_Lin2d(gp_Pnt2d(0, myVMin), gp_Dir2d(gp_Dir2d::D::X))); if (!HasSides() || MeridianOnAxis(myVMin)) { // closed edge set parameters @@ -328,19 +328,19 @@ const TopoDS_Face& BRepPrim_OneAxis::LateralFace() { myBuilder.SetPCurve(myEdges[ESTART], myFaces[FLATERAL], - gp_Lin2d(gp_Pnt2d(0, -myMeridianOffset), gp_Dir2d(0, 1))); + gp_Lin2d(gp_Pnt2d(0, -myMeridianOffset), gp_Dir2d(gp_Dir2d::D::Y))); myBuilder.SetPCurve(myEdges[EEND], myFaces[FLATERAL], - gp_Lin2d(gp_Pnt2d(myAngle, -myMeridianOffset), gp_Dir2d(0, 1))); + gp_Lin2d(gp_Pnt2d(myAngle, -myMeridianOffset), gp_Dir2d(gp_Dir2d::D::Y))); } else { // closed edge myBuilder.SetPCurve(myEdges[ESTART], myFaces[FLATERAL], - gp_Lin2d(gp_Pnt2d(myAngle, -myMeridianOffset), gp_Dir2d(0, 1)), - gp_Lin2d(gp_Pnt2d(0, -myMeridianOffset), gp_Dir2d(0, 1))); + gp_Lin2d(gp_Pnt2d(myAngle, -myMeridianOffset), gp_Dir2d(gp_Dir2d::D::Y)), + gp_Lin2d(gp_Pnt2d(0, -myMeridianOffset), gp_Dir2d(gp_Dir2d::D::Y))); } myBuilder.CompleteFace(myFaces[FLATERAL]); FacesBuilt[FLATERAL] = Standard_True; @@ -373,12 +373,12 @@ const TopoDS_Face& BRepPrim_OneAxis::TopFace() myBuilder.SetPCurve( myEdges[ETOP], myFaces[FTOP], - gp_Circ2d(gp_Ax2d(gp_Pnt2d(0, 0), gp_Dir2d(1, 0)), MeridianValue(myVMax).X())); + gp_Circ2d(gp_Ax2d(gp_Pnt2d(0, 0), gp_Dir2d(gp_Dir2d::D::X)), MeridianValue(myVMax).X())); if (HasSides()) { myBuilder.SetPCurve(myEdges[ETOPSTART], myFaces[FTOP], - gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(1, 0))); + gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(gp_Dir2d::D::X))); myBuilder.SetPCurve(myEdges[ETOPEND], myFaces[FTOP], gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(Cos(myAngle), Sin(myAngle)))); @@ -414,12 +414,12 @@ const TopoDS_Face& BRepPrim_OneAxis::BottomFace() myBuilder.SetPCurve( myEdges[EBOTTOM], myFaces[FBOTTOM], - gp_Circ2d(gp_Ax2d(gp_Pnt2d(0, 0), gp_Dir2d(1, 0)), MeridianValue(myVMin).X())); + gp_Circ2d(gp_Ax2d(gp_Pnt2d(0, 0), gp_Dir2d(gp_Dir2d::D::X)), MeridianValue(myVMin).X())); if (HasSides()) { myBuilder.SetPCurve(myEdges[EBOTSTART], myFaces[FBOTTOM], - gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(1, 0))); + gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(gp_Dir2d::D::X))); myBuilder.SetPCurve(myEdges[EBOTEND], myFaces[FBOTTOM], gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(Cos(myAngle), Sin(myAngle)))); @@ -456,15 +456,17 @@ const TopoDS_Face& BRepPrim_OneAxis::StartFace() if (EdgesBuilt[EAXIS]) myBuilder.SetPCurve(myEdges[EAXIS], myFaces[FSTART], - gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(0, 1))); + gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(gp_Dir2d::D::Y))); if (EdgesBuilt[ETOPSTART]) - myBuilder.SetPCurve(myEdges[ETOPSTART], - myFaces[FSTART], - gp_Lin2d(gp_Pnt2d(0, MeridianValue(myVMax).Y()), gp_Dir2d(1, 0))); + myBuilder.SetPCurve( + myEdges[ETOPSTART], + myFaces[FSTART], + gp_Lin2d(gp_Pnt2d(0, MeridianValue(myVMax).Y()), gp_Dir2d(gp_Dir2d::D::X))); if (EdgesBuilt[EBOTSTART]) - myBuilder.SetPCurve(myEdges[EBOTSTART], - myFaces[FSTART], - gp_Lin2d(gp_Pnt2d(0, MeridianValue(myVMin).Y()), gp_Dir2d(1, 0))); + myBuilder.SetPCurve( + myEdges[EBOTSTART], + myFaces[FSTART], + gp_Lin2d(gp_Pnt2d(0, MeridianValue(myVMin).Y()), gp_Dir2d(gp_Dir2d::D::X))); myBuilder.CompleteFace(myFaces[FSTART]); FacesBuilt[FSTART] = Standard_True; @@ -496,15 +498,19 @@ const TopoDS_Face& BRepPrim_OneAxis::EndFace() // parametric curves SetMeridianPCurve(myEdges[EEND], myFaces[FEND]); if (EdgesBuilt[EAXIS]) - myBuilder.SetPCurve(myEdges[EAXIS], myFaces[FEND], gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(0, 1))); - if (EdgesBuilt[ETOPEND]) - myBuilder.SetPCurve(myEdges[ETOPEND], + myBuilder.SetPCurve(myEdges[EAXIS], myFaces[FEND], - gp_Lin2d(gp_Pnt2d(0, MeridianValue(myVMax).Y()), gp_Dir2d(1, 0))); + gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(gp_Dir2d::D::Y))); + if (EdgesBuilt[ETOPEND]) + myBuilder.SetPCurve( + myEdges[ETOPEND], + myFaces[FEND], + gp_Lin2d(gp_Pnt2d(0, MeridianValue(myVMax).Y()), gp_Dir2d(gp_Dir2d::D::X))); if (EdgesBuilt[EBOTEND]) - myBuilder.SetPCurve(myEdges[EBOTEND], - myFaces[FEND], - gp_Lin2d(gp_Pnt2d(0, MeridianValue(myVMin).Y()), gp_Dir2d(1, 0))); + myBuilder.SetPCurve( + myEdges[EBOTEND], + myFaces[FEND], + gp_Lin2d(gp_Pnt2d(0, MeridianValue(myVMin).Y()), gp_Dir2d(gp_Dir2d::D::X))); myBuilder.CompleteFace(myFaces[FEND]); FacesBuilt[FEND] = Standard_True; diff --git a/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_Sphere.cxx b/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_Sphere.cxx index a15a72cb34..8ed310d5b4 100644 --- a/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_Sphere.cxx +++ b/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_Sphere.cxx @@ -41,7 +41,7 @@ BRepPrim_Sphere::BRepPrim_Sphere(const Standard_Real Radius) //================================================================================================= BRepPrim_Sphere::BRepPrim_Sphere(const gp_Pnt& Center, const Standard_Real Radius) - : BRepPrim_Revolution(gp_Ax2(Center, gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), PMIN, PMAX), + : BRepPrim_Revolution(gp_Ax2(Center, gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), PMIN, PMAX), myRadius(Radius) { SetMeridian(); @@ -78,7 +78,8 @@ void BRepPrim_Sphere::SetMeridian() gp_Dir D = Axes().YDirection(); D.Reverse(); gp_Ax2 A(Axes().Location(), D, Axes().XDirection()); - Handle(Geom_Circle) C = new Geom_Circle(A, myRadius); - Handle(Geom2d_Circle) C2d = new Geom2d_Circle(gp_Ax2d(gp_Pnt2d(0, 0), gp_Dir2d(1, 0)), myRadius); + Handle(Geom_Circle) C = new Geom_Circle(A, myRadius); + Handle(Geom2d_Circle) C2d = + new Geom2d_Circle(gp_Ax2d(gp_Pnt2d(0, 0), gp_Dir2d(gp_Dir2d::D::X)), myRadius); Meridian(C, C2d); } diff --git a/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_Torus.cxx b/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_Torus.cxx index 9d6b1c0e46..95737d5f72 100644 --- a/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_Torus.cxx +++ b/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_Torus.cxx @@ -53,7 +53,7 @@ BRepPrim_Torus::BRepPrim_Torus(const Standard_Real Major, const Standard_Real Mi 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 * M_PI), + : BRepPrim_Revolution(gp_Ax2(Center, gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), 0, 2 * M_PI), myMajor(Major), myMinor(Minor) { @@ -82,6 +82,6 @@ void BRepPrim_Torus::SetMeridian() A.Translate(V); Handle(Geom_Circle) C = new Geom_Circle(A, myMinor); Handle(Geom2d_Circle) C2d = - new Geom2d_Circle(gp_Ax2d(gp_Pnt2d(myMajor, 0), gp_Dir2d(1, 0)), myMinor); + new Geom2d_Circle(gp_Ax2d(gp_Pnt2d(myMajor, 0), gp_Dir2d(gp_Dir2d::D::X)), myMinor); Meridian(C, C2d); } diff --git a/src/ModelingAlgorithms/TKPrim/BRepPrimAPI/BRepPrimAPI_MakeBox.cxx b/src/ModelingAlgorithms/TKPrim/BRepPrimAPI/BRepPrimAPI_MakeBox.cxx index 2cee33b9dd..4d98a42eea 100644 --- a/src/ModelingAlgorithms/TKPrim/BRepPrimAPI/BRepPrimAPI_MakeBox.cxx +++ b/src/ModelingAlgorithms/TKPrim/BRepPrimAPI/BRepPrimAPI_MakeBox.cxx @@ -42,7 +42,7 @@ inline gp_Pnt pmin(const gp_Pnt& p, BRepPrimAPI_MakeBox::BRepPrimAPI_MakeBox(const Standard_Real dx, const Standard_Real dy, const Standard_Real dz) - : myWedge(gp_Ax2(pmin(gp_Pnt(0, 0, 0), dx, dy, dz), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), + : myWedge(gp_Ax2(pmin(gp_Pnt(0, 0, 0), dx, dy, dz), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), Abs(dx), Abs(dy), Abs(dz)) @@ -55,7 +55,7 @@ BRepPrimAPI_MakeBox::BRepPrimAPI_MakeBox(const gp_Pnt& P, const Standard_Real dx, const Standard_Real dy, const Standard_Real dz) - : myWedge(gp_Ax2(pmin(P, dx, dy, dz), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), + : myWedge(gp_Ax2(pmin(P, dx, dy, dz), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), Abs(dx), Abs(dy), Abs(dz)) @@ -70,7 +70,7 @@ inline gp_Pnt pmin(const gp_Pnt& p1, const gp_Pnt& p2) } BRepPrimAPI_MakeBox::BRepPrimAPI_MakeBox(const gp_Pnt& P1, const gp_Pnt& P2) - : myWedge(gp_Ax2(pmin(P1, P2), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), + : myWedge(gp_Ax2(pmin(P1, P2), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), Abs(P2.X() - P1.X()), Abs(P2.Y() - P1.Y()), Abs(P2.Z() - P1.Z())) @@ -94,7 +94,7 @@ void BRepPrimAPI_MakeBox::Init(const Standard_Real theDX, const Standard_Real theDZ) { myWedge = BRepPrim_Wedge( - gp_Ax2(pmin(gp_Pnt(0, 0, 0), theDX, theDY, theDZ), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), + gp_Ax2(pmin(gp_Pnt(0, 0, 0), theDX, theDY, theDZ), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), Abs(theDX), Abs(theDY), Abs(theDZ)); @@ -107,21 +107,22 @@ void BRepPrimAPI_MakeBox::Init(const gp_Pnt& thePnt, const Standard_Real theDY, const Standard_Real theDZ) { - myWedge = - BRepPrim_Wedge(gp_Ax2(pmin(thePnt, theDX, theDY, theDZ), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), - Abs(theDX), - Abs(theDY), - Abs(theDZ)); + myWedge = BRepPrim_Wedge( + gp_Ax2(pmin(thePnt, theDX, theDY, theDZ), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), + Abs(theDX), + Abs(theDY), + Abs(theDZ)); } //================================================================================================= void BRepPrimAPI_MakeBox::Init(const gp_Pnt& thePnt1, const gp_Pnt& thePnt2) { - myWedge = BRepPrim_Wedge(gp_Ax2(pmin(thePnt1, thePnt2), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), - Abs(thePnt2.X() - thePnt1.X()), - Abs(thePnt2.Y() - thePnt1.Y()), - Abs(thePnt2.Z() - thePnt1.Z())); + myWedge = + BRepPrim_Wedge(gp_Ax2(pmin(thePnt1, thePnt2), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), + Abs(thePnt2.X() - thePnt1.X()), + Abs(thePnt2.Y() - thePnt1.Y()), + Abs(thePnt2.Z() - thePnt1.Z())); } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKPrim/BRepPrimAPI/BRepPrimAPI_MakeRevolution.cxx b/src/ModelingAlgorithms/TKPrim/BRepPrimAPI/BRepPrimAPI_MakeRevolution.cxx index feab9a5887..4be6566e62 100644 --- a/src/ModelingAlgorithms/TKPrim/BRepPrimAPI/BRepPrimAPI_MakeRevolution.cxx +++ b/src/ModelingAlgorithms/TKPrim/BRepPrimAPI/BRepPrimAPI_MakeRevolution.cxx @@ -52,7 +52,7 @@ BRepPrimAPI_MakeRevolution::BRepPrimAPI_MakeRevolution(const Handle(Geom_Curve)& BRepPrimAPI_MakeRevolution::BRepPrimAPI_MakeRevolution(const Handle(Geom_Curve)& Meridian, const Standard_Real angle) - : myRevolution(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), + : myRevolution(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), Meridian->FirstParameter(), Meridian->LastParameter(), Meridian, @@ -66,7 +66,7 @@ BRepPrimAPI_MakeRevolution::BRepPrimAPI_MakeRevolution(const Handle(Geom_Curve)& BRepPrimAPI_MakeRevolution::BRepPrimAPI_MakeRevolution(const Handle(Geom_Curve)& Meridian, const Standard_Real VMin, const Standard_Real VMax) - : myRevolution(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), + : myRevolution(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), VMin, VMax, Meridian, @@ -80,7 +80,7 @@ BRepPrimAPI_MakeRevolution::BRepPrimAPI_MakeRevolution(const Handle(Geom_Curve)& const Standard_Real VMin, const Standard_Real VMax, const Standard_Real angle) - : myRevolution(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), + : myRevolution(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), VMin, VMax, Meridian, diff --git a/src/ModelingAlgorithms/TKPrim/BRepPrimAPI/BRepPrimAPI_MakeSphere.cxx b/src/ModelingAlgorithms/TKPrim/BRepPrimAPI/BRepPrimAPI_MakeSphere.cxx index 18d58b5d13..a30282bdcc 100644 --- a/src/ModelingAlgorithms/TKPrim/BRepPrimAPI/BRepPrimAPI_MakeSphere.cxx +++ b/src/ModelingAlgorithms/TKPrim/BRepPrimAPI/BRepPrimAPI_MakeSphere.cxx @@ -63,7 +63,7 @@ BRepPrimAPI_MakeSphere::BRepPrimAPI_MakeSphere(const Standard_Real R, //================================================================================================= BRepPrimAPI_MakeSphere::BRepPrimAPI_MakeSphere(const gp_Pnt& Center, const Standard_Real R) - : mySphere(gp_Ax2(Center, gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), R) + : mySphere(gp_Ax2(Center, gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), R) { } @@ -72,7 +72,7 @@ BRepPrimAPI_MakeSphere::BRepPrimAPI_MakeSphere(const gp_Pnt& Center, const Stand BRepPrimAPI_MakeSphere::BRepPrimAPI_MakeSphere(const gp_Pnt& Center, const Standard_Real R, const Standard_Real angle) - : mySphere(gp_Ax2(Center, gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), R) + : mySphere(gp_Ax2(Center, gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), R) { mySphere.Angle(angle); } @@ -83,7 +83,7 @@ BRepPrimAPI_MakeSphere::BRepPrimAPI_MakeSphere(const gp_Pnt& Center, const Standard_Real R, const Standard_Real angle1, const Standard_Real angle2) - : mySphere(gp_Ax2(Center, gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), R) + : mySphere(gp_Ax2(Center, gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), R) { mySphere.VMin(angle1); mySphere.VMax(angle2); @@ -96,7 +96,7 @@ BRepPrimAPI_MakeSphere::BRepPrimAPI_MakeSphere(const gp_Pnt& Center, const Standard_Real angle1, const Standard_Real angle2, const Standard_Real angle3) - : mySphere(gp_Ax2(Center, gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), R) + : mySphere(gp_Ax2(Center, gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), R) { mySphere.VMin(angle1); mySphere.VMax(angle2); diff --git a/src/ModelingAlgorithms/TKPrim/BRepPrimAPI/BRepPrimAPI_MakeWedge.cxx b/src/ModelingAlgorithms/TKPrim/BRepPrimAPI/BRepPrimAPI_MakeWedge.cxx index b705dfcf34..93890143fa 100644 --- a/src/ModelingAlgorithms/TKPrim/BRepPrimAPI/BRepPrimAPI_MakeWedge.cxx +++ b/src/ModelingAlgorithms/TKPrim/BRepPrimAPI/BRepPrimAPI_MakeWedge.cxx @@ -26,7 +26,7 @@ BRepPrimAPI_MakeWedge::BRepPrimAPI_MakeWedge(const Standard_Real dx, const Standard_Real dy, const Standard_Real dz, const Standard_Real ltx) - : myWedge(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), dx, dy, dz, ltx) + : myWedge(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), dx, dy, dz, ltx) { } @@ -50,7 +50,7 @@ BRepPrimAPI_MakeWedge::BRepPrimAPI_MakeWedge(const Standard_Real dx, const Standard_Real zmin, const Standard_Real xmax, const Standard_Real zmax) - : myWedge(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)), + : myWedge(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), 0, 0, 0, diff --git a/src/ModelingAlgorithms/TKPrim/BRepSweep/BRepSweep_Translation.cxx b/src/ModelingAlgorithms/TKPrim/BRepSweep/BRepSweep_Translation.cxx index 127c9744d8..b13e08a430 100644 --- a/src/ModelingAlgorithms/TKPrim/BRepSweep/BRepSweep_Translation.cxx +++ b/src/ModelingAlgorithms/TKPrim/BRepSweep/BRepSweep_Translation.cxx @@ -350,7 +350,7 @@ void BRepSweep_Translation::SetGeneratingPCurve(const TopoDS_Shape& aNewFace, if (aDirV.Index() == 2) v = -myVec.Magnitude(); L.SetLocation(gp_Pnt2d(0, v)); - L.SetDirection(gp_Dir2d(1, 0)); + L.SetDirection(gp_Dir2d(gp_Dir2d::D::X)); // } Handle(Geom2d_Line) GL = new Geom2d_Line(L); SetThePCurve(myBuilder.Builder(), TopoDS::Edge(aNewEdge), TopoDS::Face(aNewFace), orien, GL); @@ -372,7 +372,7 @@ void BRepSweep_Translation::SetDirectingPCurve(const TopoDS_Shape& aNewFace, if (AS.GetType() != GeomAbs_Plane) { L.SetLocation(gp_Pnt2d(BRep_Tool::Parameter(TopoDS::Vertex(aGenV), TopoDS::Edge(aGenE)), 0)); - L.SetDirection(gp_Dir2d(0, -1)); + L.SetDirection(gp_Dir2d(gp_Dir2d::D::NY)); /* JAG } else{ diff --git a/src/ModelingAlgorithms/TKShHealing/GTests/ShapeAnalysis_CanonicalRecognition_Test.cxx b/src/ModelingAlgorithms/TKShHealing/GTests/ShapeAnalysis_CanonicalRecognition_Test.cxx index f19720ceb9..5d816d928a 100644 --- a/src/ModelingAlgorithms/TKShHealing/GTests/ShapeAnalysis_CanonicalRecognition_Test.cxx +++ b/src/ModelingAlgorithms/TKShHealing/GTests/ShapeAnalysis_CanonicalRecognition_Test.cxx @@ -141,7 +141,7 @@ TEST_F(CanonicalRecognitionApproxTest, ConicalSurfaceRecognition_A3) { // Create conical face: cone with half angle 30 degrees const Standard_Real aHalfAngle = M_PI / 6.0; // 30 degrees - gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); Handle(Geom_ConicalSurface) aConeSurf = new Geom_ConicalSurface(aAxis, aHalfAngle, 2.0); BRepBuilderAPI_MakeFace aFaceMaker(aConeSurf, 0, 2 * M_PI, 0, 3, Precision::Confusion()); @@ -167,7 +167,7 @@ TEST_F(CanonicalRecognitionApproxTest, ConicalSurfaceRecognition_A3) TEST_F(CanonicalRecognitionApproxTest, SphericalSurfaceRecognition_A4) { // Create spherical face - gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); Handle(Geom_SphericalSurface) aSphereSurf = new Geom_SphericalSurface(aAxis, 1.0); BRepBuilderAPI_MakeFace aFaceMaker(aSphereSurf, 0, 2 * M_PI, 0, M_PI / 2, Precision::Confusion()); @@ -262,7 +262,7 @@ TEST_F(CanonicalRecognitionBaseCurveTest, BezierToCircleRecognition_A2) TEST_F(CanonicalRecognitionBaseCurveTest, EllipseToEllipseRecognition_A3) { // Create ellipse with major radius 1, minor radius 0.5 - gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)); + gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)); Handle(Geom_Ellipse) aEllipse = new Geom_Ellipse(aAxis, 1.0, 0.5); // Convert to B-spline curve @@ -322,7 +322,7 @@ TEST_F(CanonicalRecognitionBaseCurveTest, MultiSegmentWireToLineRecognition_A4) TEST_F(CanonicalRecognitionBaseCurveTest, MultiSegmentCircleWireRecognition_A5) { // Create circle and convert to B-spline - gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); Handle(Geom_Circle) aCircle = new Geom_Circle(aAxis, 1.0); // Convert to B-spline curve @@ -358,7 +358,7 @@ TEST_F(CanonicalRecognitionBaseCurveTest, MultiSegmentCircleWireRecognition_A5) TEST_F(CanonicalRecognitionBaseCurveTest, MultiSegmentEllipseWireRecognition_A6) { // Create ellipse and convert to B-spline - gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1), gp_Dir(1, 0, 0)); + gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)); Handle(Geom_Ellipse) aEllipse = new Geom_Ellipse(aAxis, 1.0, 0.5); // Convert to B-spline curve @@ -440,7 +440,7 @@ TEST_F(CanonicalRecognitionBaseSurfaceTest, TrimmedPlaneRecognition_B1) TEST_F(CanonicalRecognitionBaseSurfaceTest, TrimmedCylinderRecognition_B2) { // Create cylindrical surface - gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); Handle(Geom_CylindricalSurface) aCylSurf = new Geom_CylindricalSurface(aAxis, 1.0); // Create face from cylinder @@ -467,7 +467,7 @@ TEST_F(CanonicalRecognitionBaseSurfaceTest, TrimmedConeRecognition_B3) { // Create conical surface (30 degree half-angle) const Standard_Real aSemiAngle = M_PI / 6.0; // 30 degrees - gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); Handle(Geom_ConicalSurface) aConeSurf = new Geom_ConicalSurface(aAxis, aSemiAngle, 0); // Create face from cone @@ -493,7 +493,7 @@ TEST_F(CanonicalRecognitionBaseSurfaceTest, TrimmedConeRecognition_B3) TEST_F(CanonicalRecognitionBaseSurfaceTest, ConvertedSphereRecognition_B4) { // Create spherical surface and convert to B-spline - gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); Handle(Geom_SphericalSurface) aSphereSurf = new Geom_SphericalSurface(aAxis, 1.0); // Convert to B-spline surface @@ -559,7 +559,7 @@ TEST_F(CanonicalRecognitionBaseSurfaceTest, SewnPlanarSurfaceRecognition_B5) TEST_F(CanonicalRecognitionBaseSurfaceTest, SewnCylindricalSurfaceRecognition_B6) { // Create 4 cylindrical face segments to be sewn together - gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); Handle(Geom_CylindricalSurface) aCylSurf = new Geom_CylindricalSurface(aAxis, 1.0); BRepBuilderAPI_MakeFace aFaceMaker1(aCylSurf, 0, 3, -1, 0, Precision::Confusion()); @@ -601,7 +601,7 @@ TEST_F(CanonicalRecognitionBaseSurfaceTest, SewnConicalSurfaceRecognition_B7) { // Create 4 conical face segments to be sewn together const Standard_Real aSemiAngle = M_PI / 6.0; // 30 degrees - gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); Handle(Geom_ConicalSurface) aConeSurf = new Geom_ConicalSurface(aAxis, aSemiAngle, 0); BRepBuilderAPI_MakeFace aFaceMaker1(aConeSurf, 0, 3, 0, 1, Precision::Confusion()); @@ -642,7 +642,7 @@ TEST_F(CanonicalRecognitionBaseSurfaceTest, SewnConicalSurfaceRecognition_B7) TEST_F(CanonicalRecognitionBaseSurfaceTest, SewnSphericalSurfaceRecognition_B8) { // Create 4 spherical face segments to be sewn together, converted to B-spline - gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); Handle(Geom_SphericalSurface) aSphereSurf = new Geom_SphericalSurface(aAxis, 1.0); // Convert to B-spline surface @@ -681,7 +681,7 @@ TEST_F(CanonicalRecognitionBaseSurfaceTest, SewnSphericalSurfaceRecognition_B8) TEST_F(CanonicalRecognitionBaseSurfaceTest, ComplexCylindricalRecognitionWithSection_B9) { // Create 4 cylindrical face segments and sew them together - gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); Handle(Geom_CylindricalSurface) aCylSurf = new Geom_CylindricalSurface(aAxis, 1.0); // Create 4 face segments with parameter ranges matching the original test @@ -726,7 +726,7 @@ TEST_F(CanonicalRecognitionBaseSurfaceTest, ComplexCylindricalRecognitionWithSec TEST_F(CanonicalRecognitionBaseSurfaceTest, ExtrudedCylindricalSurfaceRecognition_B10) { // Create cylindrical surface (radius 1) - gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)); + gp_Ax2 aAxis(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); Handle(Geom_CylindricalSurface) aCylSurf = new Geom_CylindricalSurface(aAxis, 1.0); // Create plane for intersection: plane at origin with normal (1, 0, 1) normalized @@ -745,7 +745,7 @@ TEST_F(CanonicalRecognitionBaseSurfaceTest, ExtrudedCylindricalSurfaceRecognitio ASSERT_FALSE(anIntCurve.IsNull()) << "Intersection curve is null"; // Create a surface of linear extrusion from the intersection curve - gp_Dir anExtrusionDir(0, 0, 1); + gp_Dir anExtrusionDir(gp_Dir::D::Z); Handle(Geom_SurfaceOfLinearExtrusion) anExtSurf = new Geom_SurfaceOfLinearExtrusion(anIntCurve, anExtrusionDir); diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeBuild/ShapeBuild_Edge.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeBuild/ShapeBuild_Edge.cxx index da7624b054..8104574bbc 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeBuild/ShapeBuild_Edge.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeBuild/ShapeBuild_Edge.cxx @@ -585,7 +585,7 @@ Handle(Geom2d_Curve) ShapeBuild_Edge::TransformPCurve(const Handle(Geom2d_Curve) Handle(Geom2d_BSplineCurve) aBSpline2d; if (result->IsKind(STANDARD_TYPE(Geom2d_Conic))) { - // gp_Pln pln(gp_Pnt(0,0,0),gp_Dir(0,0,1)); + // gp_Pln pln(gp_Pnt(0,0,0),gp_Dir(gp_Dir::D::Z)); // Handle(Geom_Curve) curve = GeomAPI::To3d(result,pln); // clang-format off Handle(Geom2d_Curve) tcurve = new Geom2d_TrimmedCurve(result,aFirst,aLast); //protection against parabols ets diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_ComposeShell.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_ComposeShell.cxx index 0a498cebc7..d7c5ebf67b 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_ComposeShell.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_ComposeShell.cxx @@ -2031,7 +2031,7 @@ void ShapeFix_ComposeShell::SplitByGrid(ShapeFix_SequenceOfWireSegment& seqw) // clang-format off gp_Pnt2d pos ( myGrid->UJointValue(i), 0. ); // 0. - for infinite ranges: myGrid->VJointValue(1) ; // clang-format on - gp_Lin2d line(pos, gp_Dir2d(0., 1.)); + gp_Lin2d line(pos, gp_Dir2d(gp_Dir2d::D::Y)); if (!myClosedMode && myUClosed) { Standard_Real period = Umax - Umin; @@ -2053,7 +2053,7 @@ void ShapeFix_ComposeShell::SplitByGrid(ShapeFix_SequenceOfWireSegment& seqw) for (i = (myVClosed ? 1 : 2); i <= myGrid->NbVPatches(); i++) { gp_Pnt2d pos(0., myGrid->VJointValue(i)); - gp_Lin2d line(pos, gp_Dir2d(1., 0.)); + gp_Lin2d line(pos, gp_Dir2d(gp_Dir2d::D::X)); if (!myClosedMode && myVClosed) { Standard_Real period = Vmax - Vmin; diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_EdgeProjAux.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_EdgeProjAux.cxx index b56c7d03ec..6f1844a3b6 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_EdgeProjAux.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_EdgeProjAux.cxx @@ -140,8 +140,8 @@ Standard_Boolean ShapeFix_EdgeProjAux::IsIso(const Handle(Geom2d_Curve)& /*theCu Handle(Geom2d_Line) theLine2d = Handle(Geom2d_Line)::DownCast(theCurve2d); gp_Dir2d theDir2d = theLine2d->Direction(); - gp_Dir2d dir1(0.,1.); - gp_Dir2d dir2(0.,-1.); + gp_Dir2d dir1(gp_Dir2d::D::Y); + gp_Dir2d dir2(gp_Dir2d::D::NY); return (theDir2d.IsEqual(dir1,Precision::Angular()) || theDir2d.IsEqual(dir2,Precision::Angular()) || diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Face.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Face.cxx index acee21dbaf..0286d5afd8 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Face.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Face.cxx @@ -2853,7 +2853,7 @@ Standard_Boolean ShapeFix_Face::FixPeriodicDegenerated() // Apex curve below the wire if (anApexV < aMinLoopV) { - anApexCurve2d = new Geom2d_Line(gp_Pnt2d(aMinLoopU, anApexV), gp_Dir2d(1, 0)); + anApexCurve2d = new Geom2d_Line(gp_Pnt2d(aMinLoopU, anApexV), gp_Dir2d(gp_Dir2d::D::X)); if (!isUDecrease) aSoleWire.Reverse(); } @@ -2861,7 +2861,7 @@ Standard_Boolean ShapeFix_Face::FixPeriodicDegenerated() // Apex curve above the wire if (anApexV > aMaxLoopV) { - anApexCurve2d = new Geom2d_Line(gp_Pnt2d(aMaxLoopU, anApexV), gp_Dir2d(-1, 0)); + anApexCurve2d = new Geom2d_Line(gp_Pnt2d(aMaxLoopU, anApexV), gp_Dir2d(gp_Dir2d::D::NX)); if (isUDecrease) aSoleWire.Reverse(); } diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Wire.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Wire.cxx index eddea48d79..6824376cfa 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Wire.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Wire.cxx @@ -2012,7 +2012,7 @@ static Standard_Boolean RemoveLoop(TopoDS_Edge& E, // direct construction causes error on osf system. gp_Pnt p(0, 0, 0); - gp_Dir d(0, 0, 1); + gp_Dir d(gp_Dir::D::Z); gp_Ax3 ax(p, d); gp_Pln Pln(ax); diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx index 6bca83da0d..995f7b995b 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx @@ -87,28 +87,28 @@ static Handle(Geom2d_Curve) Get2DCurve(const Standard_Integer theIndex, switch (theIndex) { case 0: - a2dCurv = - new Geom2d_TrimmedCurve(new Geom2d_Line(gp_Pnt2d(0.0, theVfirst), gp_Dir2d(1.0, 0.0)), - theUfirst, - theUlast); + a2dCurv = new Geom2d_TrimmedCurve( + new Geom2d_Line(gp_Pnt2d(0.0, theVfirst), gp_Dir2d(gp_Dir2d::D::X)), + theUfirst, + theUlast); break; case 1: - a2dCurv = - new Geom2d_TrimmedCurve(new Geom2d_Line(gp_Pnt2d(theUlast, 0.0), gp_Dir2d(0.0, 1.0)), - theVfirst, - theVlast); + a2dCurv = new Geom2d_TrimmedCurve( + new Geom2d_Line(gp_Pnt2d(theUlast, 0.0), gp_Dir2d(gp_Dir2d::D::Y)), + theVfirst, + theVlast); break; case 2: - a2dCurv = - new Geom2d_TrimmedCurve(new Geom2d_Line(gp_Pnt2d(0.0, theVlast), gp_Dir2d(1.0, 0.0)), - theUfirst, - theUlast); + a2dCurv = new Geom2d_TrimmedCurve( + new Geom2d_Line(gp_Pnt2d(0.0, theVlast), gp_Dir2d(gp_Dir2d::D::X)), + theUfirst, + theUlast); break; case 3: - a2dCurv = - new Geom2d_TrimmedCurve(new Geom2d_Line(gp_Pnt2d(theUfirst, 0.0), gp_Dir2d(0.0, 1.0)), - theVfirst, - theVlast); + a2dCurv = new Geom2d_TrimmedCurve( + new Geom2d_Line(gp_Pnt2d(theUfirst, 0.0), gp_Dir2d(gp_Dir2d::D::Y)), + theVfirst, + theVlast); break; default: break; @@ -120,25 +120,25 @@ static Handle(Geom2d_Curve) Get2DCurve(const Standard_Integer theIndex, { case 0: a2dCurv = new Geom2d_TrimmedCurve( - new Geom2d_Line(gp_Pnt2d(theUfirst + theUlast, theVfirst), gp_Dir2d(-1.0, 0.0)), + new Geom2d_Line(gp_Pnt2d(theUfirst + theUlast, theVfirst), gp_Dir2d(gp_Dir2d::D::NX)), theUfirst, theUlast); break; case 1: a2dCurv = new Geom2d_TrimmedCurve( - new Geom2d_Line(gp_Pnt2d(theUlast, theVfirst + theVlast), gp_Dir2d(0.0, -1.0)), + new Geom2d_Line(gp_Pnt2d(theUlast, theVfirst + theVlast), gp_Dir2d(gp_Dir2d::D::NY)), theVfirst, theVlast); break; case 2: a2dCurv = new Geom2d_TrimmedCurve( - new Geom2d_Line(gp_Pnt2d(theUfirst + theUlast, theVlast), gp_Dir2d(-1.0, 0.0)), + new Geom2d_Line(gp_Pnt2d(theUfirst + theUlast, theVlast), gp_Dir2d(gp_Dir2d::D::NX)), theUfirst, theUlast); break; case 3: a2dCurv = new Geom2d_TrimmedCurve( - new Geom2d_Line(gp_Pnt2d(theUfirst, theVfirst + theVlast), gp_Dir2d(0.0, -1.0)), + new Geom2d_Line(gp_Pnt2d(theUfirst, theVfirst + theVlast), gp_Dir2d(gp_Dir2d::D::NY)), theVfirst, theVlast); break; diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepClass/BRepClass_FaceExplorer.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepClass/BRepClass_FaceExplorer.cxx index a2c37c5157..2ec75d68af 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepClass/BRepClass_FaceExplorer.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepClass/BRepClass_FaceExplorer.cxx @@ -268,7 +268,7 @@ Standard_Boolean BRepClass_FaceExplorer::OtherSegment(const gp_Pnt2d& P, // nothing found, return an horizontal line Par = RealLast(); - L = gp_Lin2d(P, gp_Dir2d(1, 0)); + L = gp_Lin2d(P, gp_Dir2d(gp_Dir2d::D::X)); return Standard_False; } diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_MakeFace.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_MakeFace.cxx index f8f58e7ddb..a62e9987a0 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_MakeFace.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_MakeFace.cxx @@ -612,13 +612,13 @@ void BRepLib_MakeFace::Init(const Handle(Geom_Surface)& SS, // make the lines Handle(Geom2d_Line) Lumin, Lumax, Lvmin, Lvmax; if (!umininf) - Lumin = new Geom2d_Line(gp_Pnt2d(UMin, 0), gp_Dir2d(0, 1)); + Lumin = new Geom2d_Line(gp_Pnt2d(UMin, 0), gp_Dir2d(gp_Dir2d::D::Y)); if (!umaxinf) - Lumax = new Geom2d_Line(gp_Pnt2d(UMax, 0), gp_Dir2d(0, 1)); + Lumax = new Geom2d_Line(gp_Pnt2d(UMax, 0), gp_Dir2d(gp_Dir2d::D::Y)); if (!vmininf) - Lvmin = new Geom2d_Line(gp_Pnt2d(0, VMin), gp_Dir2d(1, 0)); + Lvmin = new Geom2d_Line(gp_Pnt2d(0, VMin), gp_Dir2d(gp_Dir2d::D::X)); if (!vmaxinf) - Lvmax = new Geom2d_Line(gp_Pnt2d(0, VMax), gp_Dir2d(1, 0)); + Lvmax = new Geom2d_Line(gp_Pnt2d(0, VMax), gp_Dir2d(gp_Dir2d::D::X)); // make the face TopoDS_Face& F = TopoDS::Face(myShape); diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_MakeShell.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_MakeShell.cxx index 3f4191bf83..62205a3613 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_MakeShell.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_MakeShell.cxx @@ -104,7 +104,7 @@ void BRepLib_MakeShell::Init(const Handle(Geom_Surface)& S, Standard_Integer iu, iv; GS.UIntervals(upars, GeomAbs_C2); - gp_Dir2d dv(0, 1); + gp_Dir2d dv(gp_Dir2d::D::Y); for (iu = 1; iu <= nu + 1; iu++) { Standard_Real u = upars(iu); @@ -113,7 +113,7 @@ void BRepLib_MakeShell::Init(const Handle(Geom_Surface)& S, } GS.VIntervals(vpars, GeomAbs_C2); - gp_Dir2d du(1, 0); + gp_Dir2d du(gp_Dir2d::D::X); for (iv = 1; iv <= nv + 1; iv++) { Standard_Real v = vpars(iv); diff --git a/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_BisecAna.cxx b/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_BisecAna.cxx index fed74f8934..2edde16625 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_BisecAna.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_BisecAna.cxx @@ -373,7 +373,7 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve, else { // radius is equal to 0. No matter what direction to chose. - line = gp_Lin2d(circle1.Location(), gp_Dir2d(1., 0.)); + line = gp_Lin2d(circle1.Location(), gp_Dir2d(gp_Dir2d::D::X)); } // Modified by skv - Fri Jul 1 16:23:32 2005 IDEM(Airbus) End Handle(GccInt_Bisec) solution = new GccInt_BLine(line); diff --git a/src/ModelingData/TKBRep/BinTools/BinTools_Curve2dSet.cxx b/src/ModelingData/TKBRep/BinTools/BinTools_Curve2dSet.cxx index ffdf3e7546..bd3c00bc40 100644 --- a/src/ModelingData/TKBRep/BinTools/BinTools_Curve2dSet.cxx +++ b/src/ModelingData/TKBRep/BinTools/BinTools_Curve2dSet.cxx @@ -345,7 +345,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, gp_Dir2d& D) static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Line)& L) { gp_Pnt2d P(0., 0.); - gp_Dir2d AX(1., 0.); + gp_Dir2d AX(gp_Dir2d::D::X); IS >> P >> AX; L = new Geom2d_Line(P, AX); return IS; @@ -356,7 +356,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Line)& L static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Circle)& C) { gp_Pnt2d P(0., 0.); - gp_Dir2d AX(1., 0.), AY(1., 0.); + gp_Dir2d AX(gp_Dir2d::D::X), AY(gp_Dir2d::D::X); Standard_Real R = 0.; IS >> P >> AX >> AY; BinTools::GetReal(IS, R); @@ -369,7 +369,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Circle)& static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Ellipse)& E) { gp_Pnt2d P(0., 0.); - gp_Dir2d AX(1., 0.), AY(1., 0.); + gp_Dir2d AX(gp_Dir2d::D::X), AY(gp_Dir2d::D::X); Standard_Real R1 = 0., R2 = 0.; IS >> P >> AX >> AY; BinTools::GetReal(IS, R1); @@ -383,7 +383,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Ellipse) static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Parabola)& C) { gp_Pnt2d P(0., 0.); - gp_Dir2d AX(1., 0.), AY(1., 0.); + gp_Dir2d AX(gp_Dir2d::D::X), AY(gp_Dir2d::D::X); Standard_Real R1 = 0.; IS >> P >> AX >> AY; BinTools::GetReal(IS, R1); @@ -396,7 +396,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Parabola static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Hyperbola)& H) { gp_Pnt2d P(0., 0.); - gp_Dir2d AX(1., 0.), AY(1., 0.); + gp_Dir2d AX(gp_Dir2d::D::X), AY(gp_Dir2d::D::X); Standard_Real R1 = 0., R2 = 0.; IS >> P >> AX >> AY; BinTools::GetReal(IS, R1); diff --git a/src/ModelingData/TKBRep/BinTools/BinTools_CurveSet.cxx b/src/ModelingData/TKBRep/BinTools/BinTools_CurveSet.cxx index 09d0035cb5..fff94030d7 100644 --- a/src/ModelingData/TKBRep/BinTools/BinTools_CurveSet.cxx +++ b/src/ModelingData/TKBRep/BinTools/BinTools_CurveSet.cxx @@ -355,7 +355,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, gp_Dir& D) static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Line)& L) { gp_Pnt P(0., 0., 0.); - gp_Dir AX(1., 0., 0.); + gp_Dir AX(gp_Dir::D::X); IS >> P >> AX; L = new Geom_Line(P, AX); return IS; @@ -366,7 +366,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Line)& L) static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Circle)& C) { gp_Pnt P(0., 0., 0.); - gp_Dir A(1., 0., 0.), AX(1., 0., 0.), AY(1., 0., 0.); + gp_Dir A(gp_Dir::D::X), AX(gp_Dir::D::X), AY(gp_Dir::D::X); Standard_Real R = 0.; IS >> P >> A >> AX >> AY; BinTools::GetReal(IS, R); @@ -379,7 +379,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Circle)& C static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Ellipse)& E) { gp_Pnt P(0., 0., 0.); - gp_Dir A(1., 0., 0.), AX(1., 0., 0.), AY(1., 0., 0.); + gp_Dir A(gp_Dir::D::X), AX(gp_Dir::D::X), AY(gp_Dir::D::X); Standard_Real R1 = 0., R2 = 0.; IS >> P >> A >> AX >> AY; BinTools::GetReal(IS, R1); @@ -393,7 +393,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Ellipse)& static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Parabola)& C) { gp_Pnt P(0., 0., 0.); - gp_Dir A(1., 0., 0.), AX(1., 0., 0.), AY(1., 0., 0.); + gp_Dir A(gp_Dir::D::X), AX(gp_Dir::D::X), AY(gp_Dir::D::X); Standard_Real R1 = 0.; IS >> P >> A >> AX >> AY; BinTools::GetReal(IS, R1); @@ -406,7 +406,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Parabola)& static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Hyperbola)& H) { gp_Pnt P(0., 0., 0.); - gp_Dir A(1., 0., 0.), AX(1., 0., 0.), AY(1., 0., 0); + gp_Dir A(gp_Dir::D::X), AX(gp_Dir::D::X), AY(gp_Dir::D::X); Standard_Real R1 = 0., R2 = 0.; IS >> P >> A >> AX >> AY; BinTools::GetReal(IS, R1); @@ -513,7 +513,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_OffsetCurv { Standard_Real p = 0.; BinTools::GetReal(IS, p); // Offset - gp_Dir D(1., 0., 0.); + gp_Dir D(gp_Dir::D::X); IS >> D; Handle(Geom_Curve) BC; BinTools_CurveSet::ReadCurve(IS, BC); diff --git a/src/ModelingData/TKBRep/BinTools/BinTools_SurfaceSet.cxx b/src/ModelingData/TKBRep/BinTools/BinTools_SurfaceSet.cxx index 52e9aee2b7..076ea6fa9d 100644 --- a/src/ModelingData/TKBRep/BinTools/BinTools_SurfaceSet.cxx +++ b/src/ModelingData/TKBRep/BinTools/BinTools_SurfaceSet.cxx @@ -425,7 +425,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, gp_Dir& D) static Standard_IStream& operator>>(Standard_IStream& IS, gp_Ax3& A3) { gp_Pnt P(0., 0., 0.); - gp_Dir A(1., 0., 0.), AX(1., 0., 0.), AY(1., 0., 0.); + gp_Dir A(gp_Dir::D::X), AX(gp_Dir::D::X), AY(gp_Dir::D::X); IS >> P >> A >> AX >> AY; gp_Ax3 ax3(P, A, AX); if (AY.DotCross(A, AX) < 0) @@ -516,7 +516,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_ToroidalSu static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_SurfaceOfLinearExtrusion)& S) { - gp_Dir D(1., 0., 0.); + gp_Dir D(gp_Dir::D::X); Handle(Geom_Curve) C; IS >> D; BinTools_CurveSet::ReadCurve(IS, C); @@ -532,7 +532,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_SurfaceOfL static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_SurfaceOfRevolution)& S) { gp_Pnt P(0., 0., 0.); - gp_Dir D(1., 0., 0.); + gp_Dir D(gp_Dir::D::X); Handle(Geom_Curve) C; IS >> P >> D; BinTools_CurveSet::ReadCurve(IS, C); diff --git a/src/ModelingData/TKG2d/GTests/Geom2d_OffsetCurve_Test.cxx b/src/ModelingData/TKG2d/GTests/Geom2d_OffsetCurve_Test.cxx index 362122c37c..1807dec826 100644 --- a/src/ModelingData/TKG2d/GTests/Geom2d_OffsetCurve_Test.cxx +++ b/src/ModelingData/TKG2d/GTests/Geom2d_OffsetCurve_Test.cxx @@ -26,7 +26,7 @@ protected: void SetUp() override { // Create a circle as basis curve - gp_Circ2d aCircle(gp_Ax2d(gp_Pnt2d(0, 0), gp_Dir2d(1, 0)), 5.0); + gp_Circ2d aCircle(gp_Ax2d(gp_Pnt2d(0, 0), gp_Dir2d(gp_Dir2d::D::X)), 5.0); Handle(Geom2d_Circle) aBasisCurve = new Geom2d_Circle(aCircle); // Create offset curve diff --git a/src/ModelingData/TKG3d/Adaptor3d/Adaptor3d_TopolTool.cxx b/src/ModelingData/TKG3d/Adaptor3d/Adaptor3d_TopolTool.cxx index 24e5d9f93f..824f01fd34 100644 --- a/src/ModelingData/TKG3d/Adaptor3d/Adaptor3d_TopolTool.cxx +++ b/src/ModelingData/TKG3d/Adaptor3d/Adaptor3d_TopolTool.cxx @@ -91,10 +91,10 @@ void Adaptor3d_TopolTool::Initialize(const Handle(Adaptor3d_Surface)& S) psup = myInfinite; } - // Line2dPtr = new Adaptor2d_Line2d(gp_Pnt2d(0.,Vinf),gp_Dir2d(1.,0.),pinf,psup); + // Line2dPtr = new Adaptor2d_Line2d(gp_Pnt2d(0.,Vinf),gp_Dir2d(gp_Dir2d::D::X),pinf,psup); // myRestr[nbRestr] = new Adaptor2d_Line2d(*Line2dPtr); - myRestr[nbRestr] = - new Adaptor2d_Line2d(Adaptor2d_Line2d(gp_Pnt2d(0., Vinf), gp_Dir2d(1., 0.), pinf, psup)); + myRestr[nbRestr] = new Adaptor2d_Line2d( + Adaptor2d_Line2d(gp_Pnt2d(0., Vinf), gp_Dir2d(gp_Dir2d::D::X), pinf, psup)); nbRestr++; } @@ -117,10 +117,10 @@ void Adaptor3d_TopolTool::Initialize(const Handle(Adaptor3d_Surface)& S) psup = myInfinite; } - // Line2dPtr = new Adaptor2d_Line2d(gp_Pnt2d(Usup,0.),gp_Dir2d(0.,1.),pinf,psup); + // Line2dPtr = new Adaptor2d_Line2d(gp_Pnt2d(Usup,0.),gp_Dir2d(gp_Dir2d::D::Y),pinf,psup); // myRestr[nbRestr] = new Adaptor2d_Line2d(*Line2dPtr); - myRestr[nbRestr] = - new Adaptor2d_Line2d(Adaptor2d_Line2d(gp_Pnt2d(Usup, 0.), gp_Dir2d(0., 1.), pinf, psup)); + myRestr[nbRestr] = new Adaptor2d_Line2d( + Adaptor2d_Line2d(gp_Pnt2d(Usup, 0.), gp_Dir2d(gp_Dir2d::D::Y), pinf, psup)); nbRestr++; } @@ -143,10 +143,10 @@ void Adaptor3d_TopolTool::Initialize(const Handle(Adaptor3d_Surface)& S) psup = myInfinite; } - // Line2dPtr = new Adaptor2d_Line2d(gp_Pnt2d(0.,Vsup),gp_Dir2d(-1.,0.),pinf,psup); + // Line2dPtr = new Adaptor2d_Line2d(gp_Pnt2d(0.,Vsup),gp_Dir2d(gp_Dir2d::D::NX),pinf,psup); // myRestr[nbRestr] = new Adaptor2d_Line2d(*Line2dPtr); - myRestr[nbRestr] = - new Adaptor2d_Line2d(Adaptor2d_Line2d(gp_Pnt2d(0., Vsup), gp_Dir2d(-1., 0.), pinf, psup)); + myRestr[nbRestr] = new Adaptor2d_Line2d( + Adaptor2d_Line2d(gp_Pnt2d(0., Vsup), gp_Dir2d(gp_Dir2d::D::NX), pinf, psup)); nbRestr++; } @@ -169,10 +169,10 @@ void Adaptor3d_TopolTool::Initialize(const Handle(Adaptor3d_Surface)& S) psup = myInfinite; } - // Line2dPtr = new Adaptor2d_Line2d(gp_Pnt2d(Uinf,0.),gp_Dir2d(0.,-1),pinf,psup); + // Line2dPtr = new Adaptor2d_Line2d(gp_Pnt2d(Uinf,0.),gp_Dir2d(gp_Dir2d::D::NY),pinf,psup); // myRestr[nbRestr] = new Adaptor2d_Line2d(*Line2dPtr); - myRestr[nbRestr] = - new Adaptor2d_Line2d(Adaptor2d_Line2d(gp_Pnt2d(Uinf, 0.), gp_Dir2d(0., -1), pinf, psup)); + myRestr[nbRestr] = new Adaptor2d_Line2d( + Adaptor2d_Line2d(gp_Pnt2d(Uinf, 0.), gp_Dir2d(gp_Dir2d::D::NY), pinf, psup)); nbRestr++; } @@ -200,10 +200,10 @@ void Adaptor3d_TopolTool::Initialize(const Handle(Adaptor3d_Surface)& S) psup = myInfinite; } - // Line2dPtr = new Adaptor2d_Line2d(gp_Pnt2d(U,V),gp_Dir2d(1.,0.),pinf,psup); + // Line2dPtr = new Adaptor2d_Line2d(gp_Pnt2d(U,V),gp_Dir2d(gp_Dir2d::D::X),pinf,psup); // myRestr[nbRestr] = new Adaptor2d_Line2d(*Line2dPtr); myRestr[nbRestr] = - new Adaptor2d_Line2d(Adaptor2d_Line2d(gp_Pnt2d(U, V), gp_Dir2d(1., 0.), pinf, psup)); + new Adaptor2d_Line2d(Adaptor2d_Line2d(gp_Pnt2d(U, V), gp_Dir2d(gp_Dir2d::D::X), pinf, psup)); nbRestr++; } } diff --git a/src/ModelingData/TKG3d/GTests/Geom_OffsetCurve_Test.cxx b/src/ModelingData/TKG3d/GTests/Geom_OffsetCurve_Test.cxx index 0de247ebe3..e48bc82ad4 100644 --- a/src/ModelingData/TKG3d/GTests/Geom_OffsetCurve_Test.cxx +++ b/src/ModelingData/TKG3d/GTests/Geom_OffsetCurve_Test.cxx @@ -26,11 +26,11 @@ protected: void SetUp() override { // Create a circle as basis curve - gp_Circ aCircle(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), 5.0); + gp_Circ aCircle(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), 5.0); Handle(Geom_Circle) aBasisCurve = new Geom_Circle(aCircle); // Create offset curve - gp_Dir anOffsetDir(0, 0, 1); + gp_Dir anOffsetDir(gp_Dir::D::Z); Standard_Real anOffsetValue = 2.0; myOriginalCurve = new Geom_OffsetCurve(aBasisCurve, anOffsetValue, anOffsetDir); diff --git a/src/ModelingData/TKG3d/GTests/Geom_OffsetSurface_Test.cxx b/src/ModelingData/TKG3d/GTests/Geom_OffsetSurface_Test.cxx index f812902963..78ab8fa705 100644 --- a/src/ModelingData/TKG3d/GTests/Geom_OffsetSurface_Test.cxx +++ b/src/ModelingData/TKG3d/GTests/Geom_OffsetSurface_Test.cxx @@ -26,7 +26,7 @@ protected: void SetUp() override { // Create a plane as basis surface - gp_Pln aPlane(gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1))); + gp_Pln aPlane(gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z))); Handle(Geom_Plane) aBasisSurface = new Geom_Plane(aPlane); // Create offset surface diff --git a/src/ModelingData/TKGeomBase/BndLib/BndLib.cxx b/src/ModelingData/TKGeomBase/BndLib/BndLib.cxx index 5533dd9547..ba3079a523 100644 --- a/src/ModelingData/TKGeomBase/BndLib/BndLib.cxx +++ b/src/ModelingData/TKGeomBase/BndLib/BndLib.cxx @@ -238,9 +238,9 @@ void Compute(const Standard_Real theP1, static void OpenMin(const gp_Dir& V, Bnd_Box& B) { - gp_Dir OX(1., 0., 0.); - gp_Dir OY(0., 1., 0.); - gp_Dir OZ(0., 0., 1.); + gp_Dir OX(gp_Dir::D::X); + gp_Dir OY(gp_Dir::D::Y); + gp_Dir OZ(gp_Dir::D::Z); if (V.IsParallel(OX, Precision::Angular())) B.OpenXmin(); else if (V.IsParallel(OY, Precision::Angular())) @@ -257,9 +257,9 @@ static void OpenMin(const gp_Dir& V, Bnd_Box& B) static void OpenMax(const gp_Dir& V, Bnd_Box& B) { - gp_Dir OX(1., 0., 0.); - gp_Dir OY(0., 1., 0.); - gp_Dir OZ(0., 0., 1.); + gp_Dir OX(gp_Dir::D::X); + gp_Dir OY(gp_Dir::D::Y); + gp_Dir OZ(gp_Dir::D::Z); if (V.IsParallel(OX, Precision::Angular())) B.OpenXmax(); else if (V.IsParallel(OY, Precision::Angular())) @@ -276,9 +276,9 @@ static void OpenMax(const gp_Dir& V, Bnd_Box& B) static void OpenMinMax(const gp_Dir& V, Bnd_Box& B) { - gp_Dir OX(1., 0., 0.); - gp_Dir OY(0., 1., 0.); - gp_Dir OZ(0., 0., 1.); + gp_Dir OX(gp_Dir::D::X); + gp_Dir OY(gp_Dir::D::Y); + gp_Dir OZ(gp_Dir::D::Z); if (V.IsParallel(OX, Precision::Angular())) { B.OpenXmax(); @@ -307,8 +307,8 @@ static void OpenMinMax(const gp_Dir& V, Bnd_Box& B) static void OpenMin(const gp_Dir2d& V, Bnd_Box2d& B) { - gp_Dir2d OX(1., 0.); - gp_Dir2d OY(0., 1.); + gp_Dir2d OX(gp_Dir2d::D::X); + gp_Dir2d OY(gp_Dir2d::D::Y); if (V.IsParallel(OX, Precision::Angular())) B.OpenXmin(); else if (V.IsParallel(OY, Precision::Angular())) @@ -322,8 +322,8 @@ static void OpenMin(const gp_Dir2d& V, Bnd_Box2d& B) static void OpenMax(const gp_Dir2d& V, Bnd_Box2d& B) { - gp_Dir2d OX(1., 0.); - gp_Dir2d OY(0., 1.); + gp_Dir2d OX(gp_Dir2d::D::X); + gp_Dir2d OY(gp_Dir2d::D::Y); if (V.IsParallel(OX, Precision::Angular())) B.OpenXmax(); else if (V.IsParallel(OY, Precision::Angular())) @@ -337,8 +337,8 @@ static void OpenMax(const gp_Dir2d& V, Bnd_Box2d& B) static void OpenMinMax(const gp_Dir2d& V, Bnd_Box2d& B) { - gp_Dir2d OX(1., 0.); - gp_Dir2d OY(0., 1.); + gp_Dir2d OX(gp_Dir2d::D::X); + gp_Dir2d OY(gp_Dir2d::D::Y); if (V.IsParallel(OX, Precision::Angular())) { B.OpenXmax(); diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtElC.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtElC.cxx index 43b1c800bd..a5e7e5921c 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtElC.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtElC.cxx @@ -384,7 +384,7 @@ Standard_Boolean Extrema_ExtElC::PlanarLineCircleExtrema(const gp_Lin& theLin, // Center of 2D-circle const gp_Pnt2d aPC(0.0, 0.0); - gp_Ax22d aCircAxis(aPC, gp_Dir2d(1.0, 0.0), gp_Dir2d(0.0, 1.0)); + gp_Ax22d aCircAxis(aPC, gp_Dir2d(gp_Dir2d::D::X), gp_Dir2d(gp_Dir2d::D::Y)); gp_Circ2d aCirc2d(aCircAxis, theCirc.Radius()); gp_Pnt2d aPL(aVecCL.Dot(aDCx), aVecCL.Dot(aDCy)); diff --git a/src/ModelingData/TKGeomBase/GTests/IntAna_IntQuadQuad_Test.cxx b/src/ModelingData/TKGeomBase/GTests/IntAna_IntQuadQuad_Test.cxx index aba169b87f..411fd3f82f 100644 --- a/src/ModelingData/TKGeomBase/GTests/IntAna_IntQuadQuad_Test.cxx +++ b/src/ModelingData/TKGeomBase/GTests/IntAna_IntQuadQuad_Test.cxx @@ -28,8 +28,8 @@ protected: { // Set up common geometric objects for tests gp_Pnt anOrigin(0, 0, 0); - gp_Dir aZDir(0, 0, 1); - gp_Dir anXDir(1, 0, 0); + gp_Dir aZDir(gp_Dir::D::Z); + gp_Dir anXDir(gp_Dir::D::X); gp_Ax3 anAxis(anOrigin, aZDir, anXDir); // Create sphere at origin with radius 5 @@ -132,8 +132,8 @@ TEST_F(IntAna_IntQuadQuad_Test, ConnectedCurvesScenario) // Create two spheres that intersect in a circle gp_Pnt aCenter1(0, 0, 0); gp_Pnt aCenter2(3, 0, 0); // Overlapping spheres - gp_Dir aZDir(0, 0, 1); - gp_Dir anXDir(1, 0, 0); + gp_Dir aZDir(gp_Dir::D::Z); + gp_Dir anXDir(gp_Dir::D::X); gp_Ax3 anAxis1(aCenter1, aZDir, anXDir); gp_Ax3 anAxis2(aCenter2, aZDir, anXDir); diff --git a/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert_ApproxArcsSegments.cxx b/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert_ApproxArcsSegments.cxx index 586de2d53f..dc5d2f3b52 100644 --- a/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert_ApproxArcsSegments.cxx +++ b/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert_ApproxArcsSegments.cxx @@ -174,7 +174,7 @@ Standard_Boolean Geom2dConvert_ApproxArcsSegments::makeArc( const gp_Pnt2d aCenter((prodP1V * aDelta.Y() - prodDeM * aVec.Y()) / vprodVD, (prodDeM * aVec.X() - prodP1V * aDelta.X()) / vprodVD); const Standard_Real aRad = (aCenter.Distance(aP1) + aCenter.Distance(aP2)) * 0.5; - const gp_Ax22d ax22d(aCenter, gp_Dir2d(1., 0.), gp_Dir2d(0., 1.)); + const gp_Ax22d ax22d(aCenter, gp_Dir2d(gp_Dir2d::D::X), gp_Dir2d(gp_Dir2d::D::Y)); const gp_Circ2d aCir(ax22d, aRad); const Handle(Geom2d_Circle) Circ = new Geom2d_Circle(aCir); diff --git a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_Units.cxx b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_Units.cxx index 55d9be55d6..38229bcd31 100644 --- a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_Units.cxx +++ b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_Units.cxx @@ -307,7 +307,7 @@ Handle(Geom2d_Curve) GeomConvert_Units::MirrorPCurve(const Handle(Geom2d_Curve)& Handle(Geom2d_Curve) theMirrored = Handle(Geom2d_Curve)::DownCast(theCurve->Copy()); gp_Trsf2d T; gp_Pnt2d Loc(0., 0.); - gp_Dir2d Dir(1., 0.); + gp_Dir2d Dir(gp_Dir2d::D::X); gp_Ax2d ax2(Loc, Dir); T.SetMirror(ax2); theMirrored->Transform(T); diff --git a/src/ModelingData/TKGeomBase/GeomTools/GeomTools_Curve2dSet.cxx b/src/ModelingData/TKGeomBase/GeomTools/GeomTools_Curve2dSet.cxx index d46a7f1ff0..4e210a564b 100644 --- a/src/ModelingData/TKGeomBase/GeomTools/GeomTools_Curve2dSet.cxx +++ b/src/ModelingData/TKGeomBase/GeomTools/GeomTools_Curve2dSet.cxx @@ -526,7 +526,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, gp_Dir2d& D) static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Line)& L) { gp_Pnt2d P(0., 0.); - gp_Dir2d AX(1., 0.); + gp_Dir2d AX(gp_Dir2d::D::X); IS >> P >> AX; L = new Geom2d_Line(P, AX); return IS; @@ -537,7 +537,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Line)& L static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Circle)& C) { gp_Pnt2d P(0., 0.); - gp_Dir2d AX(1., 0.), AY(1., 0.); + gp_Dir2d AX(gp_Dir2d::D::X), AY(gp_Dir2d::D::X); Standard_Real R = 0.; IS >> P >> AX >> AY; GeomTools::GetReal(IS, R); @@ -550,7 +550,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Circle)& static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Ellipse)& E) { gp_Pnt2d P(0., 0.); - gp_Dir2d AX(1., 0.), AY(1., 0.); + gp_Dir2d AX(gp_Dir2d::D::X), AY(gp_Dir2d::D::X); Standard_Real R1 = 0., R2 = 0.; IS >> P >> AX >> AY; GeomTools::GetReal(IS, R1); @@ -564,7 +564,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Ellipse) static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Parabola)& C) { gp_Pnt2d P(0., 0.); - gp_Dir2d AX(1., 0.), AY(1., 0.); + gp_Dir2d AX(gp_Dir2d::D::X), AY(gp_Dir2d::D::X); Standard_Real R1 = 0.; IS >> P >> AX >> AY; GeomTools::GetReal(IS, R1); @@ -577,7 +577,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Parabola static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom2d_Hyperbola)& H) { gp_Pnt2d P(0., 0.); - gp_Dir2d AX(1., 0.), AY(1., 0.); + gp_Dir2d AX(gp_Dir2d::D::X), AY(gp_Dir2d::D::X); Standard_Real R1 = 0., R2 = 0.; IS >> P >> AX >> AY; GeomTools::GetReal(IS, R1); diff --git a/src/ModelingData/TKGeomBase/GeomTools/GeomTools_CurveSet.cxx b/src/ModelingData/TKGeomBase/GeomTools/GeomTools_CurveSet.cxx index 49d7382fdd..95c3e7312b 100644 --- a/src/ModelingData/TKGeomBase/GeomTools/GeomTools_CurveSet.cxx +++ b/src/ModelingData/TKGeomBase/GeomTools/GeomTools_CurveSet.cxx @@ -547,7 +547,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, gp_Dir& D) static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Line)& L) { gp_Pnt P(0., 0., 0.); - gp_Dir AX(1., 0., 0.); + gp_Dir AX(gp_Dir::D::X); IS >> P >> AX; L = new Geom_Line(P, AX); return IS; @@ -558,7 +558,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Line)& L) static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Circle)& C) { gp_Pnt P(0., 0., 0.); - gp_Dir A(1., 0., 0.), AX(1., 0., 0.), AY(1., 0., 0.); + gp_Dir A(gp_Dir::D::X), AX(gp_Dir::D::X), AY(gp_Dir::D::X); Standard_Real R = 0.; IS >> P >> A >> AX >> AY; GeomTools::GetReal(IS, R); @@ -571,7 +571,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Circle)& C static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Ellipse)& E) { gp_Pnt P(0., 0., 0.); - gp_Dir A(1., 0., 0.), AX(1., 0., 0.), AY(1., 0., 0.); + gp_Dir A(gp_Dir::D::X), AX(gp_Dir::D::X), AY(gp_Dir::D::X); Standard_Real R1 = 0., R2 = 0.; IS >> P >> A >> AX >> AY; GeomTools::GetReal(IS, R1); @@ -585,7 +585,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Ellipse)& static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Parabola)& C) { gp_Pnt P(0., 0., 0.); - gp_Dir A(1., 0., 0.), AX(1., 0., 0.), AY(1., 0., 0.); + gp_Dir A(gp_Dir::D::X), AX(gp_Dir::D::X), AY(gp_Dir::D::X); Standard_Real R1 = 0.; IS >> P >> A >> AX >> AY; GeomTools::GetReal(IS, R1); @@ -598,7 +598,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Parabola)& static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_Hyperbola)& H) { gp_Pnt P(0., 0., 0.); - gp_Dir A(1., 0., 0.), AX(1., 0., 0.), AY(1., 0., 0.); + gp_Dir A(gp_Dir::D::X), AX(gp_Dir::D::X), AY(gp_Dir::D::X); Standard_Real R1 = 0., R2 = 0.; IS >> P >> A >> AX >> AY; GeomTools::GetReal(IS, R1); @@ -693,7 +693,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_OffsetCurv { Standard_Real p = 0.; GeomTools::GetReal(IS, p); - gp_Dir D(1., 0., 0.); + gp_Dir D(gp_Dir::D::X); IS >> D; Handle(Geom_Curve) BC = GeomTools_CurveSet::ReadCurve(IS); C = new Geom_OffsetCurve(BC, p, D); diff --git a/src/ModelingData/TKGeomBase/GeomTools/GeomTools_SurfaceSet.cxx b/src/ModelingData/TKGeomBase/GeomTools/GeomTools_SurfaceSet.cxx index 25c81ac841..1ff31f6f38 100644 --- a/src/ModelingData/TKGeomBase/GeomTools/GeomTools_SurfaceSet.cxx +++ b/src/ModelingData/TKGeomBase/GeomTools/GeomTools_SurfaceSet.cxx @@ -664,7 +664,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, gp_Dir& D) static Standard_IStream& operator>>(Standard_IStream& IS, gp_Ax3& A3) { gp_Pnt P(0., 0., 0.); - gp_Dir A(1., 0., 0.), AX(1., 0., 0.), AY(1., 0., 0.); + gp_Dir A(gp_Dir::D::X), AX(gp_Dir::D::X), AY(gp_Dir::D::X); IS >> P >> A >> AX >> AY; gp_Ax3 ax3(P, A, AX); if (AY.DotCross(A, AX) < 0) @@ -755,7 +755,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_ToroidalSu static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_SurfaceOfLinearExtrusion)& S) { - gp_Dir D(1., 0., 0.); + gp_Dir D(gp_Dir::D::X); IS >> D; Handle(Geom_Curve) C = GeomTools_CurveSet::ReadCurve(IS); S = new Geom_SurfaceOfLinearExtrusion(C, D); @@ -770,7 +770,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_SurfaceOfL static Standard_IStream& operator>>(Standard_IStream& IS, Handle(Geom_SurfaceOfRevolution)& S) { gp_Pnt P(0., 0., 0.); - gp_Dir D(1., 0., 0.); + gp_Dir D(gp_Dir::D::X); IS >> P >> D; Handle(Geom_Curve) C = GeomTools_CurveSet::ReadCurve(IS); S = new Geom_SurfaceOfRevolution(C, gp_Ax1(P, D)); diff --git a/src/ModelingData/TKGeomBase/IntAna/IntAna_IntConicQuad.cxx b/src/ModelingData/TKGeomBase/IntAna/IntAna_IntConicQuad.cxx index 9d05c5383f..04a5022cd5 100644 --- a/src/ModelingData/TKGeomBase/IntAna/IntAna_IntConicQuad.cxx +++ b/src/ModelingData/TKGeomBase/IntAna/IntAna_IntConicQuad.cxx @@ -551,7 +551,7 @@ void IntAna_IntConicQuad::Perform(const gp_Circ& C, gp_Lin2d Ligs(Orig, Dire); gp_Pnt2d Pnt2dBid(0.0, 0.0); - gp_Dir2d Dir2dBid(1.0, 0.0); + gp_Dir2d Dir2dBid(gp_Dir2d::D::X); gp_Ax2d Ax2dBid(Pnt2dBid, Dir2dBid); gp_Circ2d Cir(Ax2dBid, C.Radius()); diff --git a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_CompProjectedCurve.cxx b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_CompProjectedCurve.cxx index f92e8a70cf..c3c7b6d434 100644 --- a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_CompProjectedCurve.cxx +++ b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_CompProjectedCurve.cxx @@ -1287,12 +1287,12 @@ void ProjLib_CompProjectedCurve::Perform() Ufin = Pfin.Y(); if (Udeb > Ufin) { - Dir = gp_Dir2d(0, -1); + Dir = gp_Dir2d(gp_Dir2d::D::NY); Udeb = -Udeb; Ufin = -Ufin; } else - Dir = gp_Dir2d(0, 1); + Dir = gp_Dir2d(gp_Dir2d::D::Y); PCur2d = new Geom2d_TrimmedCurve(new Geom2d_Line(gp_Pnt2d(UIso, 0), Dir), Udeb, Ufin); HPCur = new Geom2dAdaptor_Curve(PCur2d); } @@ -1306,12 +1306,12 @@ void ProjLib_CompProjectedCurve::Perform() Ufin = Pfin.X(); if (Udeb > Ufin) { - Dir = gp_Dir2d(-1, 0); + Dir = gp_Dir2d(gp_Dir2d::D::NX); Udeb = -Udeb; Ufin = -Ufin; } else - Dir = gp_Dir2d(1, 0); + Dir = gp_Dir2d(gp_Dir2d::D::X); PCur2d = new Geom2d_TrimmedCurve(new Geom2d_Line(gp_Pnt2d(0, VIso), Dir), Udeb, Ufin); HPCur = new Geom2dAdaptor_Curve(PCur2d); } diff --git a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ComputeApprox.cxx b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ComputeApprox.cxx index 2603413402..0035112e5a 100644 --- a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ComputeApprox.cxx +++ b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ComputeApprox.cxx @@ -1407,7 +1407,7 @@ void ProjLib_ComputeApprox::Perform(const Handle(Adaptor3d_Curve)& C, myBSpline->Translate(gp_Vec2d(du, dv)); if (ToMirror) { - gp_Ax2d Axe(gp_Pnt2d(0., 0.), gp_Dir2d(1., 0.)); + gp_Ax2d Axe(gp_Pnt2d(0., 0.), gp_Dir2d(gp_Dir2d::D::X)); myBSpline->Mirror(Axe); } } diff --git a/src/ModelingData/TKGeomBase/gce/gce_MakeCirc.cxx b/src/ModelingData/TKGeomBase/gce/gce_MakeCirc.cxx index c286583233..d7706a7419 100644 --- a/src/ModelingData/TKGeomBase/gce/gce_MakeCirc.cxx +++ b/src/ModelingData/TKGeomBase/gce/gce_MakeCirc.cxx @@ -59,8 +59,8 @@ gce_MakeCirc::gce_MakeCirc(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3) // if ((dist1 < aResolution) && (dist2 < aResolution) && (dist3 < aResolution)) { - gp_Dir Dirx(1., 0., 0.); - gp_Dir Dirz(0., 0., 1.); + gp_Dir Dirx(gp_Dir::D::X); + gp_Dir Dirz(gp_Dir::D::Z); TheCirc = gp_Circ(gp_Ax2(P1, Dirx, Dirz), 0.); return; } @@ -151,8 +151,8 @@ gce_MakeCirc::gce_MakeCirc(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3) pInt.Coord(x3, y3, z3); if (dist1 < aResolution) { - gp_Dir Dirx(1., 0., 0.); - gp_Dir Dirz(0., 0., 1.); + gp_Dir Dirx(gp_Dir::D::X); + gp_Dir Dirz(gp_Dir::D::Z); TheCirc = gp_Circ(gp_Ax2(pInt, Dirx, Dirz), 0.); return; } diff --git a/src/ModelingData/TKGeomBase/gce/gce_MakeCirc2d.cxx b/src/ModelingData/TKGeomBase/gce/gce_MakeCirc2d.cxx index bd83ee0e68..fa4bf9d835 100644 --- a/src/ModelingData/TKGeomBase/gce/gce_MakeCirc2d.cxx +++ b/src/ModelingData/TKGeomBase/gce/gce_MakeCirc2d.cxx @@ -46,7 +46,7 @@ //========================================================================= gce_MakeCirc2d::gce_MakeCirc2d(const gp_Pnt2d& P1, const gp_Pnt2d& P2, const gp_Pnt2d& P3) { - gp_Dir2d dirx(1.0, 0.0); + gp_Dir2d dirx(gp_Dir2d::D::X); //========================================================================= // Traitement. + @@ -169,7 +169,7 @@ gce_MakeCirc2d::gce_MakeCirc2d(const gp_Pnt2d& Center, { if (Radius >= 0.) { - TheCirc2d = gp_Circ2d(gp_Ax2d(Center, gp_Dir2d(1.0, 0.0)), Radius, Sense); + TheCirc2d = gp_Circ2d(gp_Ax2d(Center, gp_Dir2d(gp_Dir2d::D::X)), Radius, Sense); TheError = gce_Done; } else @@ -187,7 +187,7 @@ gce_MakeCirc2d::gce_MakeCirc2d(const gp_Pnt2d& Center, const gp_Pnt2d& Point, const Standard_Boolean Sense) { - TheCirc2d = gp_Circ2d(gp_Ax2d(Center, gp_Dir2d(1.0, 0.0)), Point.Distance(Center), Sense); + TheCirc2d = gp_Circ2d(gp_Ax2d(Center, gp_Dir2d(gp_Dir2d::D::X)), Point.Distance(Center), Sense); TheError = gce_Done; } diff --git a/src/Visualization/TKMeshVS/MeshVS/MeshVS_NodalColorPrsBuilder.cxx b/src/Visualization/TKMeshVS/MeshVS/MeshVS_NodalColorPrsBuilder.cxx index 075e94f436..8ee45fb2c9 100644 --- a/src/Visualization/TKMeshVS/MeshVS/MeshVS_NodalColorPrsBuilder.cxx +++ b/src/Visualization/TKMeshVS/MeshVS/MeshVS_NodalColorPrsBuilder.cxx @@ -269,7 +269,7 @@ void MeshVS_NodalColorPrsBuilder::Build(const Handle(Prs3d_Presentation)& Prs, new Graphic3d_ArrayOfSegments(aNbEdgePrimitives * 2); Standard_Real aMin = gp::Resolution() * gp::Resolution(); - gp_Dir aDefNorm(0., 0., 1.); + gp_Dir aDefNorm(gp_Dir::D::Z); // Prepare for scaling the incoming colors const Standard_Real anColorRatio = 1.0; diff --git a/src/Visualization/TKMeshVS/MeshVS/MeshVS_VectorPrsBuilder.cxx b/src/Visualization/TKMeshVS/MeshVS/MeshVS_VectorPrsBuilder.cxx index a386108947..08fd017607 100644 --- a/src/Visualization/TKMeshVS/MeshVS/MeshVS_VectorPrsBuilder.cxx +++ b/src/Visualization/TKMeshVS/MeshVS/MeshVS_VectorPrsBuilder.cxx @@ -272,7 +272,7 @@ void MeshVS_VectorPrsBuilder::Build(const Handle(Prs3d_Presentation)& Prs, continue; } - aTrsf.SetDisplacement(gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), + aTrsf.SetDisplacement(gp_Ax3(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), gp_Ax3(gp_Pnt(X, Y, Z), aVec)); DrawVector(aTrsf, diff --git a/src/Visualization/TKService/GTests/Graphic3d_BndBox_Test.cxx b/src/Visualization/TKService/GTests/Graphic3d_BndBox_Test.cxx index e5b44b8b3f..9cc8b25cc8 100644 --- a/src/Visualization/TKService/GTests/Graphic3d_BndBox_Test.cxx +++ b/src/Visualization/TKService/GTests/Graphic3d_BndBox_Test.cxx @@ -245,7 +245,7 @@ TEST(Graphic3d_BndBox3dTest, TransformationInvalidBox) Graphic3d_BndBox3d aBox; // Invalid box gp_Trsf aRotation; - aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), M_PI / 4); + aRotation.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)), M_PI / 4); Graphic3d_Mat4d aMat; aRotation.GetMat4(aMat); diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_Camera.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_Camera.cxx index 7640c1347a..eb2dcd92f6 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_Camera.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_Camera.cxx @@ -74,7 +74,7 @@ gp_Ax3 cameraToAx3(const Graphic3d_Camera& theCamera) Graphic3d_Camera::Graphic3d_Camera() : myUp(0.0, 1.0, 0.0), - myDirection(0.0, 0.0, 1.0), + myDirection(gp_Dir::D::Z), myEye(0.0, 0.0, -1500.0), myDistance(1500.0), myAxialScale(1.0, 1.0, 1.0), @@ -103,7 +103,7 @@ Graphic3d_Camera::Graphic3d_Camera() Graphic3d_Camera::Graphic3d_Camera(const Handle(Graphic3d_Camera)& theOther) : myUp(0.0, 1.0, 0.0), - myDirection(0.0, 0.0, 1.0), + myDirection(gp_Dir::D::Z), myEye(0.0, 0.0, -1500.0), myDistance(1500.0), myAxialScale(1.0, 1.0, 1.0), @@ -193,7 +193,7 @@ void Graphic3d_Camera::Copy(const Handle(Graphic3d_Camera)& theOther) void Graphic3d_Camera::SetIdentityOrientation() { SetEyeAndCenter(gp_Pnt(0.0, 0.0, 0.0), gp_Pnt(0.0, 0.0, -1.0)); - SetUp(gp_Dir(0.0, 1.0, 0.0)); + SetUp(gp_Dir(gp_Dir::D::Y)); } //================================================================================================= diff --git a/src/Visualization/TKV3d/AIS/AIS_Manipulator.cxx b/src/Visualization/TKV3d/AIS/AIS_Manipulator.cxx index 89e6ad4efa..fad803f7e5 100644 --- a/src/Visualization/TKV3d/AIS/AIS_Manipulator.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_Manipulator.cxx @@ -1747,7 +1747,7 @@ void AIS_Manipulator::Sector::Init(const Standard_ShortReal theRadius, gp_Pnt aV2 = gp_Pnt(anIndent, anIndent * 2.0, 0.0).Transformed(aTrsf); gp_Pnt aV3 = gp_Pnt(anIndent * 2.0, anIndent * 2.0, 0.0).Transformed(aTrsf); gp_Pnt aV4 = gp_Pnt(anIndent * 2.0, anIndent, 0.0).Transformed(aTrsf); - gp_Dir aNormal = gp_Dir(0.0, 0.0, -1.0).Transformed(aTrsf); + gp_Dir aNormal = gp_Dir(gp_Dir::D::NZ).Transformed(aTrsf); myArray->AddVertex(aV1, aNormal); myArray->AddVertex(aV2, aNormal); @@ -1836,7 +1836,7 @@ void AIS_Manipulator::Axis::Compute(const Handle(PrsMgr_PresentationManager)& th gp_Trsf aTrsf; aTrsf.SetTransformation(aSystem, gp_Ax3()); - gp_Dir aNormal = gp_Dir(1.0, 0.0, 0.0).Transformed(aTrsf); + gp_Dir aNormal = gp_Dir(gp_Dir::D::X).Transformed(aTrsf); Standard_Real aLength = myLength + myIndent * 4.0f; const Standard_Real aStepV = 1.0f / aStripsNb; diff --git a/src/Visualization/TKV3d/AIS/AIS_TextLabel.cxx b/src/Visualization/TKV3d/AIS/AIS_TextLabel.cxx index d7c234bd78..4f27b35c63 100644 --- a/src/Visualization/TKV3d/AIS/AIS_TextLabel.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_TextLabel.cxx @@ -402,7 +402,7 @@ Standard_Boolean AIS_TextLabel::calculateLabelParams(const gp_Pnt& thePosition, gp_Trsf AIS_TextLabel::calculateLabelTrsf(const gp_Pnt& thePosition, gp_Pnt& theCenterOfLabel) const { const Standard_Real anAngle = myDrawer->TextAspect()->Aspect()->TextAngle() * M_PI / 180.0; - const gp_Ax1 aRotAxis(thePosition, gp_Dir(0.0, 0.0, 1.0)); + const gp_Ax1 aRotAxis(thePosition, gp_Dir(gp_Dir::D::Z)); gp_Ax2 anOrientation = myOrientation3D; anOrientation.Rotate(aRotAxis, anAngle); diff --git a/src/Visualization/TKV3d/DsgPrs/DsgPrs_EqualDistancePresentation.cxx b/src/Visualization/TKV3d/DsgPrs/DsgPrs_EqualDistancePresentation.cxx index b0fddafef5..e4e53cc95f 100644 --- a/src/Visualization/TKV3d/DsgPrs/DsgPrs_EqualDistancePresentation.cxx +++ b/src/Visualization/TKV3d/DsgPrs/DsgPrs_EqualDistancePresentation.cxx @@ -58,7 +58,7 @@ void DsgPrs_EqualDistancePresentation::Add(const Handle(Prs3d_Presentation)& aPr aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims); // Add presentation of arrows (points) - gp_Dir aDir(0, 0, 1); + gp_Dir aDir(gp_Dir::D::Z); DsgPrs::ComputeSymbol(aPresentation, LA, Middle12, Middle34, aDir, aDir, DsgPrs_AS_BOTHPT); // ota -- begin -- // Two small lines in the middle of this line diff --git a/src/Visualization/TKV3d/Prs3d/Prs3d_ToolDisk.hxx b/src/Visualization/TKV3d/Prs3d/Prs3d_ToolDisk.hxx index eeab4f7086..40d463a986 100644 --- a/src/Visualization/TKV3d/Prs3d/Prs3d_ToolDisk.hxx +++ b/src/Visualization/TKV3d/Prs3d/Prs3d_ToolDisk.hxx @@ -64,7 +64,7 @@ protected: //! Computes normal at given parameter location of the surface. virtual gp_Dir Normal(const Standard_Real, const Standard_Real) const Standard_OVERRIDE { - return gp_Dir(0.0, 0.0, -1.0); + return gp_Dir(gp_Dir::D::NZ); } protected: diff --git a/src/Visualization/TKV3d/Prs3d/Prs3d_ToolSector.hxx b/src/Visualization/TKV3d/Prs3d/Prs3d_ToolSector.hxx index 039be99402..485c7badd7 100644 --- a/src/Visualization/TKV3d/Prs3d/Prs3d_ToolSector.hxx +++ b/src/Visualization/TKV3d/Prs3d/Prs3d_ToolSector.hxx @@ -51,7 +51,7 @@ protected: //! Computes normal at given parameter location of the surface. virtual gp_Dir Normal(const Standard_Real, const Standard_Real) const Standard_OVERRIDE { - return gp_Dir(0.0, 0.0, -1.0); + return gp_Dir(gp_Dir::D::NZ); } protected: diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustumSet.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustumSet.cxx index 4cb2661b3b..4463a975e0 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustumSet.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustumSet.cxx @@ -859,7 +859,7 @@ Standard_Boolean SelectMgr_TriangularFrustumSet::isIntersectBoundary( anAxis.Transform(theTrsf); Handle(Geom_Circle) aCirc = new Geom_Circle(anAxis, theRadius); - gp_Dir aCircNorm = gp_Dir(0, 0, 1).Transformed(theTrsf); + gp_Dir aCircNorm = gp_Dir(gp_Dir::D::Z).Transformed(theTrsf); Handle(Geom_Surface) aCircPlane = new Geom_Plane(aCircCenter, aCircNorm); for (Standard_Integer anIdx = myBoundaryPoints.Lower(); diff --git a/src/Visualization/TKV3d/V3d/V3d_Viewer.cxx b/src/Visualization/TKV3d/V3d/V3d_Viewer.cxx index c15b334cdc..b4c70ad1a5 100644 --- a/src/Visualization/TKV3d/V3d/V3d_Viewer.cxx +++ b/src/Visualization/TKV3d/V3d/V3d_Viewer.cxx @@ -46,7 +46,7 @@ V3d_Viewer::V3d_Viewer(const Handle(Graphic3d_GraphicDriver)& theDriver) myDefaultTypeOfView(V3d_ORTHOGRAPHIC), myComputedMode(Standard_True), myDefaultComputedMode(Standard_False), - myPrivilegedPlane(gp_Ax3(gp_Pnt(0., 0., 0), gp_Dir(0., 0., 1.), gp_Dir(1., 0., 0.))), + myPrivilegedPlane(gp_Ax3(gp_Pnt(0., 0., 0), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X))), myDisplayPlane(Standard_False), myDisplayPlaneLength(1000.0), myGridType(Aspect_GT_Rectangular), diff --git a/tests/lowalgos/intss/bug24676 b/tests/lowalgos/intss/bug24676 index 4f5630c07a..8c4a5cde51 100644 --- a/tests/lowalgos/intss/bug24676 +++ b/tests/lowalgos/intss/bug24676 @@ -7,7 +7,9 @@ restore [locate_data_file bug24676_b2.brep] b2 for {set i 1} { $i <= 6} {incr i} { restore [locate_data_file bug24676_b1_${i}.brep] b1_$i - if {![regexp "no 3d curves\n has no 3d points" [ bopcurves b1_$i b2 ]]} { - puts "Error: Non-empty intersection result between b1_$i and b2, while empty is expected" + set log [bopcurves b1_$i b2] + regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} $log full Toler NbCurv + if {$NbCurv != 1} { + puts "Error: Number of curves is wrong" } } -- 2.39.5