1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

Coding - Reorganize code with constexpr #68

After rework Precision.hxx some local
  variables can be marked as constexpr
This commit is contained in:
dpasukhi
2024-09-22 12:33:29 +00:00
parent 72c6d55bf2
commit 8082b955bd
171 changed files with 373 additions and 369 deletions

View File

@@ -213,7 +213,7 @@ static Standard_Integer OCC486(Draw_Interpretor& di, Standard_Integer argc, cons
if (GS.IsNull()) { di << "OCC486 FAULTY. Null surface /n";return 1;}
gp_Pnt P3D( Draw::Atof(argv[2]),Draw::Atof(argv[3]),Draw::Atof(argv[4]) );
Standard_Real Tol = Precision::PConfusion();
constexpr Standard_Real Tol = Precision::PConfusion();
Extrema_ExtPS myExtPS;
if (argc > 5) du = Draw::Atof(argv[5]);
if (argc > 6) dv = Draw::Atof(argv[6]);

View File

@@ -2648,7 +2648,7 @@ static Standard_Integer OCC8169 (Draw_Interpretor& di, Standard_Integer argc, co
Handle(Geom_Surface) thePlane = BRep_Tool::Surface(theFace);
Standard_Real aConfusion = Precision::Confusion();
constexpr Standard_Real aConfusion = Precision::Confusion();
Standard_Real aP1first, aP1last, aP2first, aP2last;
Handle(Geom_Curve) aCurve1 = BRep_Tool::Curve(theEdge1, aP1first, aP1last);
@@ -4680,7 +4680,7 @@ Standard_Integer OCC22736 (Draw_Interpretor& di, Standard_Integer argc, const ch
gp_Trsf2d Tcomp;
Tcomp = M2.Multiplied(M1);
Standard_Real aTol = Precision::Confusion();
constexpr Standard_Real aTol = Precision::Confusion();
Standard_Integer aStatus = 0;
//After applying two times the same mirror the point is located on the same location OK

View File

@@ -772,7 +772,7 @@ static Standard_Integer OCC817 (Draw_Interpretor& di, Standard_Integer argc, con
return 1;
}
Standard_Real delt = 5.0*Precision::Confusion();
constexpr Standard_Real delt = 5.0*Precision::Confusion();
Standard_Real mesh_delt = Draw::Atof(argv[2]);
if (mesh_delt <= 0.0)
{

View File

@@ -2013,7 +2013,7 @@ static Standard_Integer OCC24889 (Draw_Interpretor& theDI,
DrawTrSurf::Set("c_2", aTrim[1]);
// Intersection
const Standard_Real aTol = Precision::Confusion();
constexpr Standard_Real aTol = Precision::Confusion();
Geom2dAPI_InterCurveCurve aIntTool( aTrim[0], aTrim[1], aTol );
const IntRes2d_IntersectionPoint& aIntPnt =
@@ -3871,7 +3871,7 @@ Standard_Integer OCC26446 (Draw_Interpretor& di,
TColGeom_Array1OfBSplineCurve aCurves (0, 1);
TColStd_Array1OfReal aTolerances (0, 0);
Standard_Real aTolConf = 1.e-3;
Standard_Real aTolClosure = Precision::Confusion();
constexpr Standard_Real aTolClosure = Precision::Confusion();
Handle(TColGeom_HArray1OfBSplineCurve) aConcatCurves;
Handle(TColStd_HArray1OfInteger) anIndices;

View File

@@ -1613,8 +1613,8 @@ static Standard_Integer OCC27466(Draw_Interpretor& theDI,
return 1;
BRepAdaptor_Surface aSurf(aFace);
Standard_Real aTolU = Precision::PConfusion();
Standard_Real aTolV = Precision::PConfusion();
constexpr Standard_Real aTolU = Precision::PConfusion();
constexpr Standard_Real aTolV = Precision::PConfusion();
Extrema_GenLocateExtPS anExtrema(aSurf, aTolU, aTolV);
anExtrema.Perform(aPnt, aUV.X(), aUV.Y(), Standard_True);