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:
@@ -59,7 +59,7 @@
|
||||
if (aC2D.IsNull() || !aS->IsUPeriodic())
|
||||
return;
|
||||
//
|
||||
const Standard_Real aEps=Precision::PConfusion();//1.e-9
|
||||
constexpr Standard_Real aEps=Precision::PConfusion();//1.e-9
|
||||
const Standard_Real aEpsilon=Epsilon(10.);//1.77e-15
|
||||
//
|
||||
Standard_Real umin,umax,vmin,vmax;
|
||||
@@ -232,7 +232,7 @@ static Standard_Boolean isDegenerated(const Handle(GeomAdaptor_Surface)& theGAHS
|
||||
const Standard_Real theFirstPar,
|
||||
const Standard_Real theLastPar)
|
||||
{
|
||||
const Standard_Real aSqTol = Precision::Confusion()*Precision::Confusion();
|
||||
constexpr Standard_Real aSqTol = Precision::Confusion()*Precision::Confusion();
|
||||
gp_Pnt2d aP2d;
|
||||
gp_Pnt aP1, aP2;
|
||||
|
||||
@@ -1309,7 +1309,7 @@ void GeomInt_IntSS::TrimILineOnSurfBoundaries(const Handle(Geom2d_Curve)& theC2d
|
||||
}
|
||||
}
|
||||
|
||||
const Standard_Real anIntTol = 10.0*Precision::Confusion();
|
||||
constexpr Standard_Real anIntTol = 10.0*Precision::Confusion();
|
||||
|
||||
IntersectCurveAndBoundary(theC2d1, aCurS1Bounds,
|
||||
aNumberOfCurves, anIntTol, theArrayOfParameters);
|
||||
|
@@ -124,7 +124,7 @@ void GeomInt_LineConstructor::Perform(const Handle(IntPatch_Line)& L)
|
||||
{
|
||||
Standard_Integer i,nbvtx;
|
||||
Standard_Real firstp,lastp;
|
||||
const Standard_Real Tol = Precision::PConfusion() * 35.0;
|
||||
constexpr Standard_Real Tol = Precision::PConfusion() * 35.0;
|
||||
|
||||
const IntPatch_IType typl = L->ArcType();
|
||||
if(typl == IntPatch_Analytic) {
|
||||
@@ -862,7 +862,7 @@ void RejectDuplicates(NCollection_Array1<GeomInt_Vertex>& theVtxArr)
|
||||
// About the value aTolPC=1000.*Precision::PConfusion(),
|
||||
// see IntPatch_GLine::ComputeVertexParameters(...)
|
||||
// for more details;
|
||||
const Standard_Real aTolPC = 1000.*Precision::PConfusion();
|
||||
constexpr Standard_Real aTolPC = 1000.*Precision::PConfusion();
|
||||
|
||||
//Find duplicates in a slice of the array [LowerBound, UpperBound-1].
|
||||
//If a duplicate has been found, the element with greater index will be rejected.
|
||||
|
@@ -64,7 +64,7 @@ void ProjectPointOnSurf::Init ( const Handle(Geom_Surface)& Surface,
|
||||
const Standard_Real Vmin,
|
||||
const Standard_Real Vsup )
|
||||
{
|
||||
const Standard_Real Tolerance = Precision::PConfusion();
|
||||
constexpr Standard_Real Tolerance = Precision::PConfusion();
|
||||
//
|
||||
myGeomAdaptor.Load(Surface, Umin,Usup,Vmin,Vsup);
|
||||
myExtPS.Initialize(myGeomAdaptor, Umin, Usup, Vmin, Vsup, Tolerance, Tolerance);
|
||||
|
Reference in New Issue
Block a user