mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +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:
@@ -729,7 +729,7 @@ void ProjLib_CompProjectedCurve::Init()
|
||||
Standard_Boolean FromLastU = Standard_False,
|
||||
isSplitsComputed = Standard_False;
|
||||
|
||||
const Standard_Real aTolExt = Precision::PConfusion();
|
||||
constexpr Standard_Real aTolExt = Precision::PConfusion();
|
||||
Extrema_ExtCS CExt (*myCurve, *mySurface, aTolExt, aTolExt);
|
||||
if (CExt.IsDone() && CExt.NbExt())
|
||||
{
|
||||
|
@@ -252,7 +252,7 @@ static void Function_SetUVBounds(Standard_Real& myU1,
|
||||
|
||||
case GeomAbs_Cone: {
|
||||
Standard_Real tol = Epsilon(1.);
|
||||
Standard_Real ptol = Precision::PConfusion();
|
||||
constexpr Standard_Real ptol = Precision::PConfusion();
|
||||
gp_Cone Cone = mySurface->Cone();
|
||||
VCouture = Standard_False;
|
||||
//Calculation of cone parameters for P == ConeApex often produces wrong
|
||||
|
@@ -673,7 +673,7 @@ Handle(Geom2d_BSplineCurve) ProjLib_ComputeApproxOnPolarSurface::Perform
|
||||
{
|
||||
//OCC217
|
||||
Standard_Real Tol3d = myTolerance;
|
||||
Standard_Real ParamTol = Precision::PApproximation();
|
||||
constexpr Standard_Real ParamTol = Precision::PApproximation();
|
||||
|
||||
Handle(Adaptor2d_Curve2d) AHC2d = InitialCurve2d;
|
||||
Handle(Adaptor3d_Curve) AHC = Curve;
|
||||
|
@@ -91,7 +91,7 @@ public:
|
||||
myNbPnt2d = 0;
|
||||
Standard_Real U = myCurve->FirstParameter();
|
||||
gp_Pnt P = myCurve->Value(U);
|
||||
Standard_Real Tol = Precision::PConfusion();
|
||||
constexpr Standard_Real Tol = Precision::PConfusion();
|
||||
myExtPS = new Extrema_ExtPS (P, *S, Tol, Tol);
|
||||
}
|
||||
|
||||
|
@@ -191,7 +191,7 @@ static void ExtendC2d (Handle(Geom2d_BSplineCurve)& aRes,
|
||||
gp_Dir2d aDBnd;
|
||||
Handle(Geom2d_TrimmedCurve) aSegment;
|
||||
Geom2dConvert_CompCurveToBSplineCurve aCompCurve(aRes, Convert_RationalC1);
|
||||
Standard_Real aTol = Precision::Confusion();
|
||||
constexpr Standard_Real aTol = Precision::Confusion();
|
||||
|
||||
aRes->D1(theParam, aPBnd, aVBnd);
|
||||
aDBnd.SetXY(aVBnd.XY());
|
||||
|
@@ -140,7 +140,7 @@ void ProjLib_Sphere::Project(const gp_Circ& C)
|
||||
Zs = mySphere.Position().Direction();
|
||||
|
||||
Standard_Boolean isIsoU, isIsoV;
|
||||
Standard_Real Tol = Precision::Confusion();
|
||||
constexpr Standard_Real Tol = Precision::Confusion();
|
||||
|
||||
isIsoU = Zc.IsNormal(Zs,Tol) && O.IsEqual(C.Location(),Tol);
|
||||
isIsoV = Xc.IsNormal(Zs,Tol) && Yc.IsNormal(Zs,Tol);
|
||||
|
Reference in New Issue
Block a user