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:
@@ -832,7 +832,7 @@ Standard_Boolean ShapeAnalysis_CanonicalRecognition::GetSurfaceByLS(const TopoDS
|
||||
aStartPoint, aFBnd, aLBnd, aRelDev);
|
||||
|
||||
//
|
||||
Standard_Real aTol = Precision::Confusion();
|
||||
constexpr Standard_Real aTol = Precision::Confusion();
|
||||
math_MultipleVarFunction* aPFunc;
|
||||
GeomConvert_FuncSphereLSDist aFuncSph(aPoints);
|
||||
GeomConvert_FuncCylinderLSDist aFuncCyl(aPoints, thePos.Direction());
|
||||
|
@@ -978,7 +978,7 @@ Standard_Boolean ShapeAnalysis_Edge::CheckPCurveRange (const Standard_Real theFi
|
||||
const Standard_Real theLast,
|
||||
const Handle(Geom2d_Curve)& thePC)
|
||||
{
|
||||
const Standard_Real eps = Precision::PConfusion();
|
||||
constexpr Standard_Real eps = Precision::PConfusion();
|
||||
Standard_Boolean isValid = Standard_True;
|
||||
Standard_Boolean IsPeriodic = thePC->IsPeriodic();
|
||||
Standard_Real aPeriod = RealLast();
|
||||
|
@@ -988,8 +988,8 @@ Standard_Integer ShapeAnalysis_Surface::SurfaceNewton(const gp_Pnt2d &p2dPrev,
|
||||
Standard_Real VF = vf - dv, VL = vl + dv;
|
||||
|
||||
//Standard_Integer fail = 0;
|
||||
Standard_Real Tol = Precision::Confusion();
|
||||
Standard_Real Tol2 = Tol * Tol;//, rs2p=1e10;
|
||||
constexpr Standard_Real Tol = Precision::Confusion();
|
||||
constexpr Standard_Real Tol2 = Tol * Tol;//, rs2p=1e10;
|
||||
Standard_Real U = p2dPrev.X(), V = p2dPrev.Y();
|
||||
gp_Vec rsfirst = P3D.XYZ() - Value(U, V).XYZ(); //pdn
|
||||
for (Standard_Integer i = 0; i < 25; i++) {
|
||||
@@ -1225,7 +1225,7 @@ gp_Pnt2d ShapeAnalysis_Surface::ValueOfUV(const gp_Pnt& P3D, const Standard_Real
|
||||
du = Min(myUDelt, SurfAdapt.UResolution(preci));
|
||||
dv = Min(myVDelt, SurfAdapt.VResolution(preci));
|
||||
}
|
||||
Standard_Real Tol = Precision::PConfusion();
|
||||
constexpr Standard_Real Tol = Precision::PConfusion();
|
||||
myExtPS.SetFlag(Extrema_ExtFlag_MIN);
|
||||
myExtPS.Initialize(SurfAdapt, uf - du, ul + du, vf - dv, vl + dv, Tol, Tol);
|
||||
myExtOK = Standard_True;
|
||||
@@ -1273,7 +1273,7 @@ gp_Pnt2d ShapeAnalysis_Surface::ValueOfUV(const gp_Pnt& P3D, const Standard_Real
|
||||
}
|
||||
if (disSurf < 10 * preci)
|
||||
if (mySurf->Continuity() != GeomAbs_C0) {
|
||||
Standard_Real Tol = Precision::Confusion();
|
||||
constexpr Standard_Real Tol = Precision::Confusion();
|
||||
gp_Vec D1U, D1V;
|
||||
gp_Pnt pnt;
|
||||
SurfAdapt.D1(UU, VV, pnt, D1U, D1V);
|
||||
|
@@ -123,7 +123,7 @@ Handle(TColStd_HSequenceOfReal) ShapeAnalysis_TransferParametersProj::Perform
|
||||
Handle(TColStd_HSequenceOfReal) resKnots = new TColStd_HSequenceOfReal;
|
||||
|
||||
Standard_Integer len = Knots->Length();
|
||||
Standard_Real preci = 2*Precision::PConfusion();
|
||||
constexpr Standard_Real preci = 2*Precision::PConfusion();
|
||||
|
||||
Standard_Real first = (To2d ? myAC3d.FirstParameter() : myFirst);
|
||||
Standard_Real last = (To2d ? myAC3d.LastParameter() : myLast);
|
||||
@@ -277,7 +277,7 @@ void ShapeAnalysis_TransferParametersProj::TransferRange(TopoDS_Edge& newEdge,
|
||||
gp_Pnt p1;
|
||||
gp_Pnt p2;
|
||||
Standard_Real alpha = 0, beta = 1;
|
||||
Standard_Real preci = Precision::PConfusion();
|
||||
constexpr Standard_Real preci = Precision::PConfusion();
|
||||
Standard_Real firstPar, lastPar;
|
||||
if(prevPar < currPar) {
|
||||
firstPar = prevPar;
|
||||
|
@@ -262,8 +262,8 @@ void ShapeAnalysis_WireOrder::Perform (const Standard_Boolean /*closed*/)
|
||||
TColStd_Array1OfBoolean isEdgeUsed (1, aNbEdges);
|
||||
isEdgeUsed.Init (Standard_False);
|
||||
|
||||
Standard_Real aTol2 = Precision::SquareConfusion();
|
||||
Standard_Real aTolP2 = Precision::SquarePConfusion();
|
||||
constexpr Standard_Real aTol2 = Precision::SquareConfusion();
|
||||
constexpr Standard_Real aTolP2 = Precision::SquarePConfusion();
|
||||
|
||||
// take the first edge to the constructed chain
|
||||
isEdgeUsed (1) = Standard_True;
|
||||
|
Reference in New Issue
Block a user