1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +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

@ -293,7 +293,7 @@ Aspect_SequenceOfColor AIS_ColorScale::MakeUniformColors (Standard_Integer theNb
// adjust range to be within (0, 360], with sign according to theHueFrom and theHueTo
Standard_Real aHueRange = std::fmod (theHueTo - theHueFrom, 360.);
const Standard_Real aHueEps = Precision::Angular() * 180. / M_PI;
constexpr Standard_Real aHueEps = Precision::Angular() * 180. / M_PI;
if (Abs (aHueRange) <= aHueEps)
{
aHueRange = (aHueRange < 0 ? -360. : 360.);

View File

@ -147,7 +147,7 @@ static void Hunt(const TColStd_Array1OfReal& Arr,
Standard_Integer& Iloc)
{//Warning: Hunt is used to find number of knot which equals coordinate component,
// when coordinate component definitely equals a knot only.
Standard_Real Tol=Precision::PConfusion()/10;
constexpr Standard_Real Tol=Precision::PConfusion()/10;
Standard_Integer i=1;
while((i <= Arr.Upper()) && (Abs(Coord - Arr(i)) > Tol)){
i++;}
@ -204,7 +204,7 @@ static void FindBounds(const TColStd_Array1OfReal& Arr,
{
Standard_Integer N=0;
Standard_Real Tol=Precision::PConfusion()/10;
constexpr Standard_Real Tol=Precision::PConfusion()/10;
Hunt(Arr,Coord,N);
DerNull=Standard_False;
@ -243,7 +243,7 @@ static void Locate1Coord(const Standard_Integer Index,
gp_Pnt2d& LeftBot, gp_Pnt2d& RightTop)
{
Standard_Real Comp1=0, DComp1=0, cur, f = 0.0, l = 0.0;
Standard_Real Tol = Precision::PConfusion()/10;
constexpr Standard_Real Tol = Precision::PConfusion()/10;
Standard_Integer i = 1, Bnd1, Bnd2;
Standard_Boolean DIsNull= Standard_False;
TColStd_Array1OfReal Arr(1,BSplC->NbKnots()); BSplC->Knots(Arr);
@ -345,7 +345,7 @@ static void Locate1Coord(const Standard_Integer Index,
gp_Pnt2d& RightTop)
{
Standard_Real Comp1=0,DComp1=0;
Standard_Real Tol = Precision::PConfusion()/10;
constexpr Standard_Real Tol = Precision::PConfusion()/10;
Standard_Integer i=1, Up=0, Up1, Up2, Down=0, Down1, Down2;
Standard_Real cur = 0.;
@ -556,7 +556,7 @@ static void Locate2Coord(const Standard_Integer Index,
const Standard_Real I2,
gp_Pnt2d& LeftBot, gp_Pnt2d& RightTop)
{
Standard_Real Tol=Precision::PConfusion()/10;
constexpr Standard_Real Tol=Precision::PConfusion()/10;
Standard_Real Comp1=0,DComp1=0;
if(Index==1) { Comp1=UV.X();
DComp1=DUV.X();}
@ -620,7 +620,7 @@ static void Locate2Coord(const Standard_Integer Index,
gp_Pnt2d& LeftBot, gp_Pnt2d& RightTop)
{
Standard_Real Comp=0,DComp=0,Tmp1=0.0,Tmp2=0.0;
Standard_Real Tol=Precision::PConfusion()/10;
constexpr Standard_Real Tol=Precision::PConfusion()/10;
Standard_Integer N=0, NUp=0, NLo=0;
if(Index==1)
{ Comp=UV.X();
@ -893,7 +893,7 @@ Standard_Integer Adaptor3d_CurveOnSurface::NbIntervals (const GeomAbs_Shape S) c
myCurve->Intervals(TabC,S);
Standard_Real Tol= Precision::PConfusion()/10;
constexpr Standard_Real Tol= Precision::PConfusion()/10;
// sorted sequence of parameters defining continuity intervals;
// started with own intervals of curve and completed by
@ -1063,7 +1063,7 @@ void Adaptor3d_CurveOnSurface::D1(const Standard_Real U ,
Standard_Real FP = myCurve->FirstParameter();
Standard_Real LP = myCurve->LastParameter();
Standard_Real Tol= Precision::PConfusion()/10;
constexpr Standard_Real Tol= Precision::PConfusion()/10;
if( ( Abs(U-FP)<Tol)&&(!myFirstSurf.IsNull()) )
{
myCurve->D1(U,Puv,Duv);
@ -1103,7 +1103,7 @@ void Adaptor3d_CurveOnSurface::D2(const Standard_Real U,
Standard_Real FP = myCurve->FirstParameter();
Standard_Real LP = myCurve->LastParameter();
Standard_Real Tol= Precision::PConfusion()/10;
constexpr Standard_Real Tol= Precision::PConfusion()/10;
if( (Abs(U-FP)<Tol)&&(!myFirstSurf.IsNull()) )
{
myCurve->D2(U,UV,DW,D2W);
@ -1152,7 +1152,7 @@ void Adaptor3d_CurveOnSurface::D3
gp_Vec& V3) const
{
Standard_Real Tol= Precision::PConfusion()/10;
constexpr Standard_Real Tol= Precision::PConfusion()/10;
gp_Pnt2d UV;
gp_Vec2d DW,D2W,D3W;
gp_Vec D1U,D1V,D2U,D2V,D2UV,D3U,D3V,D3UUV,D3UVV;
@ -1651,7 +1651,7 @@ void Adaptor3d_CurveOnSurface::EvalFirstLastSurf()
Standard_Real FirstPar,LastPar;
gp_Pnt2d UV, LeftBot, RightTop;
gp_Vec2d DUV;
Standard_Real Tol= Precision::PConfusion()/10;
constexpr Standard_Real Tol= Precision::PConfusion()/10;
Standard_Boolean Ok = Standard_True;

View File

@ -27,7 +27,7 @@ Standard_Boolean AdvApprox_DichoCutting::Value(const Standard_Real a,
Standard_Real& cuttingvalue) const
{
// longueur minimum d'un intervalle pour F(U,V) : EPS1=1.e-9 (cf.MEPS1)
Standard_Real lgmin = 10*Precision::PConfusion();
constexpr Standard_Real lgmin = 10*Precision::PConfusion();
cuttingvalue = (a+b) / 2;
return (Abs(b-a)>=2*lgmin);
}

View File

@ -36,7 +36,7 @@ Standard_Boolean AdvApprox_PrefAndRec::Value(const Standard_Real a,
Standard_Real& cuttingvalue) const
{
// longueur minimum d'un intervalle parametrique : 10*PConfusion()
Standard_Real lgmin = 10 * Precision::PConfusion();
constexpr Standard_Real lgmin = 10 * Precision::PConfusion();
Standard_Integer i;
Standard_Real cut, mil=(a+b)/2, dist;
Standard_Boolean isfound = Standard_False;

View File

@ -30,7 +30,7 @@ Standard_Boolean AdvApprox_PrefCutting::Value(const Standard_Real a,
{
// longueur minimum d'un intervalle parametrique : PConfusion()
// pour F(U,V) : EPS1=1.e-9 (cf.MMEPS1)
Standard_Real lgmin = 10 * Precision::PConfusion();
constexpr Standard_Real lgmin = 10 * Precision::PConfusion();
Standard_Integer i;
Standard_Real cut, mil=(a+b)/2,
dist = Abs((a-b)/2);

View File

@ -2004,7 +2004,7 @@ void AppDef_Variational::InitSmoothCriterion()
void AppDef_Variational::InitParameters(Standard_Real& Length)
{
const Standard_Real Eps1 = Precision::Confusion() * .01;
constexpr Standard_Real Eps1 = Precision::Confusion() * .01;
Standard_Real aux, dist;
Standard_Integer i, i0, i1 = 0, ipoint;
@ -2052,7 +2052,7 @@ void AppDef_Variational::InitCriterionEstimations(const Standard_Real Length,
{
E1 = Length * Length;
const Standard_Real Eps1 = Precision::Confusion() * .01;
constexpr Standard_Real Eps1 = Precision::Confusion() * .01;
math_Vector VTang1(1, myDimension), VTang2(1, myDimension), VTang3(1, myDimension),
VScnd1(1, myDimension), VScnd2(1, myDimension), VScnd3(1, myDimension);
@ -2180,7 +2180,7 @@ void AppDef_Variational::EstTangent(const Standard_Integer ipnt,
{
Standard_Integer i ;
const Standard_Real Eps1 = Precision::Confusion() * .01;
constexpr Standard_Real Eps1 = Precision::Confusion() * .01;
const Standard_Real EpsNorm = 1.e-9;
Standard_Real Wpnt = 1.;

View File

@ -139,7 +139,7 @@ static Standard_Boolean CheckMultiCurve(const AppParCurves_MultiCurve& theMultiC
return Standard_True;
const Standard_Real MinScalProd = -0.9;
const Standard_Real SqTol3d = Precision::SquareConfusion();
constexpr Standard_Real SqTol3d = Precision::SquareConfusion();
theIndbad = 0;
Standard_Integer indbads [4];

View File

@ -438,7 +438,7 @@ Standard_Boolean ApproxInt_ImpPrmSvSurfaces::Compute( Standard_Real& u1,
gp_Vec2d& aPrmTg = MyImplicitFirst ? Tguv2 : Tguv1;
//for square
const Standard_Real aNullValue = Precision::Approximation()*
constexpr Standard_Real aNullValue = Precision::Approximation()*
Precision::Approximation(),
anAngTol = Precision::Angular();

View File

@ -621,7 +621,7 @@ Standard_Boolean
((TheSvSurfaces *)PtrOnmySvSurfaces)->SetUseSolver(Standard_True);
}
const Standard_Real SqTol3d = Precision::SquareConfusion();
constexpr Standard_Real SqTol3d = Precision::SquareConfusion();
math_Vector tolerance(1,2);
tolerance(1) = tolerance(2) = 1.e-8;

View File

@ -989,7 +989,7 @@ Standard_Boolean BOPTools_AlgoTools::GetFaceOff
//
// The difference between faces should be obvious enough
// to guarantee the correctness of the classification
Standard_Real anAngleCriteria = Precision::Confusion();
constexpr Standard_Real anAngleCriteria = Precision::Confusion();
bRet=Standard_True;
aIt.Initialize(theLCSOff);
@ -2181,7 +2181,7 @@ Standard_Real MinStep3D(const TopoDS_Edge& theE1,
}
//
if (aR > 100.) {
Standard_Real d = 10*Precision::PConfusion();
constexpr Standard_Real d = 10*Precision::PConfusion();
aDtMin = Max(aDtMin, sqrt(d*d + 2*d*aR));
}
}

View File

@ -698,7 +698,7 @@ void BOPTools_AlgoTools2D::IsEdgeIsoline( const TopoDS_Edge& theE,
aT /= sqrt(aSqMagn);
//sin(da) ~ da, when da->0.
const Standard_Real aTol = Precision::Angular();
constexpr Standard_Real aTol = Precision::Angular();
const gp_Vec2d aRefVDir(0.0, 1.0), aRefUDir(1.0, 0.0);
const Standard_Real aDPv = aT.CrossMagnitude(aRefVDir),

View File

@ -138,7 +138,7 @@ Standard_Real BRep_Tool::Tolerance(const TopoDS_Face& F)
{
const BRep_TFace* TF = static_cast<const BRep_TFace*>(F.TShape().get());
Standard_Real p = TF->Tolerance();
Standard_Real pMin = Precision::Confusion();
constexpr Standard_Real pMin = Precision::Confusion();
if (p > pMin) return p;
else return pMin;
}
@ -812,7 +812,7 @@ Standard_Real BRep_Tool::Tolerance(const TopoDS_Edge& E)
{
const BRep_TEdge* TE = static_cast<const BRep_TEdge*>(E.TShape().get());
Standard_Real p = TE->Tolerance();
Standard_Real pMin = Precision::Confusion();
constexpr Standard_Real pMin = Precision::Confusion();
if (p > pMin) return p;
else return pMin;
}
@ -1258,7 +1258,7 @@ Standard_Real BRep_Tool::Tolerance(const TopoDS_Vertex& V)
}
Standard_Real p = aTVert->Tolerance();
Standard_Real pMin = Precision::Confusion();
constexpr Standard_Real pMin = Precision::Confusion();
if (p > pMin) return p;
else return pMin;
}

View File

@ -256,7 +256,7 @@ static Standard_Integer PointsForOBB(const TopoDS_Shape& theS,
//=======================================================================
static Standard_Integer IsWCS(const gp_Dir& theDir)
{
const Standard_Real aToler = Precision::Angular()*Precision::Angular();
constexpr Standard_Real aToler = Precision::Angular()*Precision::Angular();
const Standard_Real aX = theDir.X(),
aY = theDir.Y(),

View File

@ -140,7 +140,7 @@ void BRepCheck_Edge::Minimum()
if (!myCref.IsNull()) {
Handle(BRep_GCurve) GCref (Handle(BRep_GCurve)::DownCast (myCref));
Standard_Real eps = Precision::PConfusion();
constexpr Standard_Real eps = Precision::PConfusion();
Standard_Real First,Last;
GCref->Range(First,Last);
if (Last<=First) {
@ -314,7 +314,7 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S)
Standard_Boolean pcurvefound = Standard_False;
BRep_ListIteratorOfListOfCurveRepresentation itcr(TE->Curves());
Standard_Real eps = Precision::PConfusion();
constexpr Standard_Real eps = Precision::PConfusion();
Standard_Boolean toRunParallel = !myMutex.IsNull();
while (itcr.More()) {
const Handle(BRep_CurveRepresentation)& cr = itcr.Value();

View File

@ -147,7 +147,7 @@ Standard_Boolean BRepClass_FaceExplorer::OtherSegment(const gp_Pnt2d& P,
Standard_Real aFPar;
Standard_Real aLPar;
Handle(Geom2d_Curve) aC2d;
Standard_Real aTolParConf2 = Precision::PConfusion() * Precision::PConfusion();
constexpr Standard_Real aTolParConf2 = Precision::PConfusion() * Precision::PConfusion();
gp_Pnt2d aPOnC;
Standard_Real aParamIn;

View File

@ -441,7 +441,7 @@ Standard_Integer BRepClass3d_SolidExplorer::OtherSegment(const gp_Pnt& P,
gp_Lin& L,
Standard_Real& _Par)
{
const Standard_Real TolU = Precision::PConfusion();
constexpr Standard_Real TolU = Precision::PConfusion();
const Standard_Real TolV = TolU;
TopoDS_Face face;
@ -500,7 +500,7 @@ Standard_Integer BRepClass3d_SolidExplorer::OtherSegment(const gp_Pnt& P,
face.Orientation(TopAbs_FORWARD);
//
//avoid process faces from uncorrected shells
const Standard_Real eps = Precision::PConfusion();
constexpr Standard_Real eps = Precision::PConfusion();
Standard_Real epsU = Max(eps * Max(Abs(U2), Abs(U1)), eps);
Standard_Real epsV = Max(eps * Max(Abs(V2), Abs(V1)), eps);
if( Abs (U2 - U1) < epsU || Abs(V2 - V1) < epsV) {

View File

@ -423,7 +423,7 @@ static void PERFORM_C0(const TopoDS_Edge& S1, const TopoDS_Edge& S2,
if (pCurv->Continuity() == GeomAbs_C0)
{
const Standard_Real epsP = Precision::PConfusion();
constexpr Standard_Real epsP = Precision::PConfusion();
GeomAdaptor_Curve aAdaptorCurve(pCurv, aFirst, aLast);
const Standard_Integer nbIntervals = aAdaptorCurve.NbIntervals(GeomAbs_C1);
@ -716,7 +716,7 @@ void BRepExtrema_DistanceSS::Perform (const TopoDS_Vertex& theS1,
if ((Dstmin < myDstRef - myEps) || (fabs(Dstmin - myDstRef) < myEps))
{
gp_Pnt Pt, P1 = BRep_Tool::Pnt(theS1);
const Standard_Real epsP = Precision::PConfusion();
constexpr Standard_Real epsP = Precision::PConfusion();
for (i = 1; i <= NbExtrema; i++)
{
@ -833,7 +833,7 @@ void BRepExtrema_DistanceSS::Perform (const TopoDS_Edge& theS1,
if ((Dstmin < myDstRef - myEps) || (fabs(Dstmin - myDstRef) < myEps))
{
gp_Pnt Pt1, Pt2;
const Standard_Real epsP = Precision::PConfusion();
constexpr Standard_Real epsP = Precision::PConfusion();
for (i = 1; i <= NbExtrema; i++)
{
@ -925,7 +925,7 @@ void BRepExtrema_DistanceSS::Perform (const TopoDS_Edge& theS1, const TopoDS_Fac
const Standard_Real tol = BRep_Tool::Tolerance(theS2);
gp_Pnt Pt1, Pt2;
const Standard_Real epsP = Precision::PConfusion();
constexpr Standard_Real epsP = Precision::PConfusion();
for (i = 1; i <= NbExtrema; i++)
{

View File

@ -400,7 +400,7 @@ Standard_Boolean BRepExtrema_ProximityValueTool::getFaceAdditionalVertices (
BVH_Array3d& theAddVertices,
NCollection_Vector<ProxPnt_Status>& theAddStatuses)
{
Standard_Real aTol = Precision::Confusion();
constexpr Standard_Real aTol = Precision::Confusion();
TopLoc_Location aLocation;
Handle(Poly_Triangulation) aTr = BRep_Tool::Triangulation (theFace, aLocation);

View File

@ -314,7 +314,7 @@ void BRepFeat::ParametricMinMax(const TopoDS_Shape& S,
static Standard_Boolean IsIn (BRepTopAdaptor_FClass2d& FC,
const Geom2dAdaptor_Curve& AC)
{
Standard_Real Def = 100*Precision::Confusion();
constexpr Standard_Real Def = 100*Precision::Confusion();
GCPnts_QuasiUniformDeflection QU(AC,Def);
for (Standard_Integer i = 1; i <= QU.NbPoints(); i++) {

View File

@ -755,7 +755,7 @@ static void Descendants(const TopoDS_Shape&,
// intersects Shapes From and Until
// case of several intersections (keep PartsOfTool according to the selection)
// position of the face of intersection in PartsOfTool (before or after)
Standard_Real delta = Precision::Confusion();
constexpr Standard_Real delta = Precision::Confusion();
if (myPerfSelection != BRepFeat_NoSelection) {
// modif of the test for cts21181 : (prbmax2 and prnmin2) -> (prbmin1 and prbmax1)

View File

@ -1078,8 +1078,8 @@ static Standard_Boolean ToFuse (const TopoDS_Face& F1, const TopoDS_Face& F2)
Handle(Geom_Surface) S1,S2;
TopLoc_Location loc1, loc2;
Handle(Standard_Type) typS1,typS2;
const Standard_Real tollin = Precision::Confusion();
const Standard_Real tolang = Precision::Angular();
constexpr Standard_Real tollin = Precision::Confusion();
constexpr Standard_Real tolang = Precision::Angular();
S1 = BRep_Tool::Surface(F1,loc1);
S2 = BRep_Tool::Surface(F2,loc2);

View File

@ -834,8 +834,8 @@ Standard_Boolean ToFuse(const TopoDS_Face& F1,
Handle(Geom_Surface) S1,S2;
TopLoc_Location loc1, loc2;
Handle(Standard_Type) typS1,typS2;
const Standard_Real tollin = Precision::Confusion();
const Standard_Real tolang = Precision::Angular();
constexpr Standard_Real tollin = Precision::Confusion();
constexpr Standard_Real tolang = Precision::Angular();
S1 = BRep_Tool::Surface(F1,loc1);
S2 = BRep_Tool::Surface(F2,loc2);

View File

@ -3071,7 +3071,7 @@ void CutEdgeProf (const TopoDS_Edge& E,
// On calcule les intersection avec Oy.
Geom2dAdaptor_Curve ALine(Line);
Standard_Real Tol = Precision::Intersection();
constexpr Standard_Real Tol = Precision::Intersection();
Standard_Real TolC = 0.;
Geom2dInt_GInter Intersector(ALine,AC2d,TolC,Tol);

View File

@ -907,7 +907,7 @@ void BRepFill_Generator::Perform()
}
// set the pcurves
Standard_Real T = Precision::Confusion();
constexpr Standard_Real T = Precision::Confusion();
if (IType != 4) //not plane
{

View File

@ -109,8 +109,8 @@ BRepFill_MultiLine::BRepFill_MultiLine(const TopoDS_Face& Face1,
myKPart(0)
{
//
const Standard_Real mult = 5.;
const Standard_Real eps = mult * Precision::Confusion();
constexpr Standard_Real mult = 5.;
constexpr Standard_Real eps = mult * Precision::Confusion();
//
myNbPnt2d = 2;
myNbPnt = 1;
@ -585,8 +585,8 @@ static gp_Pnt2d ValueOnFace(const Standard_Real U,
}
#endif
//
const Standard_Real mult = 5.;
const Standard_Real eps = mult * Precision::Confusion();
constexpr Standard_Real mult = 5.;
constexpr Standard_Real eps = mult * Precision::Confusion();
//
Standard_Real UU =0., Dist = Precision::Infinite(), D1, D2;
@ -627,7 +627,7 @@ static gp_Pnt2d ValueOnFace(const Standard_Real U,
}
}
const Standard_Real Tol = Precision::Confusion();
constexpr Standard_Real Tol = Precision::Confusion();
Standard_Real VV;
gp_Pnt2d PF = TheV.Value(TheV.FirstParameter());

View File

@ -516,7 +516,7 @@ void BRepFill_NSections::Init(const TColStd_SequenceOfReal & P,
myLaws = new (GeomFill_HArray1OfSectionLaw) (1, NbEdge);
Standard_Real tol = Precision::Confusion();
constexpr Standard_Real tol = Precision::Confusion();
mySurface = totalsurf(myEdges->Array2(),myShapes.Length(),NbEdge,
myParams,w1Point,w2Point,uclosed,vclosed,tol);

View File

@ -1913,8 +1913,8 @@ void CutCurve (const Handle(Geom2d_TrimmedCurve)& C,
Standard_Real UF,UL,UC;
Standard_Real Step;
gp_Pnt2d PF,PL,PC;
Standard_Real PTol = Precision::PConfusion()*10;
Standard_Real Tol = Precision::Confusion()*10;
constexpr Standard_Real PTol = Precision::PConfusion()*10;
constexpr Standard_Real Tol = Precision::Confusion()*10;
Standard_Boolean YaCut = Standard_False;
UF = C->FirstParameter();
@ -2141,7 +2141,7 @@ Standard_Boolean VertexFromNode (const Handle(MAT_Node)& aNode,
TopoDS_Vertex& VN)
{
Standard_Boolean Status;
Standard_Real Tol = Precision::Confusion();
constexpr Standard_Real Tol = Precision::Confusion();
BRep_Builder B;
if (!aNode->Infinite() && Abs(aNode->Distance()-Offset) < Tol) {
@ -2243,7 +2243,7 @@ void TrimEdge (const TopoDS_Edge& E,
// otherwise preserve only one of its representations.
//----------------------------------------------------------
if (!BRep_Tool::Degenerated(E)) {
Standard_Real aParTol = 2.0 * Precision::PConfusion();
constexpr Standard_Real aParTol = 2.0 * Precision::PConfusion();
for (Standard_Integer k = 1; k < TheVer.Length(); k ++) {
if (TheVer.Value(k).IsSame(TheVer.Value(k+1)) ||
Abs(ThePar.Value(k)-ThePar.Value(k+1)) <= aParTol) {
@ -2487,7 +2487,7 @@ static void CheckBadEdges(const TopoDS_Face& Spine, const Standard_Real Offset,
{
TopoDS_Face F = TopoDS::Face(Spine.Oriented(TopAbs_FORWARD));
Standard_Real eps = Precision::Confusion();
constexpr Standard_Real eps = Precision::Confusion();
Standard_Real LimCurv = 1./Offset;
TopTools_MapOfShape aMap;

View File

@ -125,7 +125,8 @@ BRepFill_SectionPlacement(const Handle(BRepFill_LocationLaw)& Law,
Ex.Next();
if( Ex.More() ) {
Standard_Real tolrac, epsV, tol = Precision::Confusion();
Standard_Real tolrac, epsV;
constexpr Standard_Real tol = Precision::Confusion();
GeomConvert_CompCurveToBSplineCurve Conv(TC);
for (; Ex.More(); Ex.Next()) {
E = TopoDS::Edge(Ex.Current());
@ -289,8 +290,8 @@ BRepFill_SectionPlacement(const Handle(BRepFill_LocationLaw)& Law,
Place.Perform(adpPath, Precision::Confusion());
Standard_Real theParam = Place.ParameterOnPath(),
eps = Precision::PConfusion();
Standard_Real theParam = Place.ParameterOnPath();
constexpr Standard_Real eps = Precision::PConfusion();
#ifdef OCCT_DEBUG
if (myDebug) {

View File

@ -177,7 +177,7 @@ static void EvalParameters(const Geom2dAdaptor_Curve& Bis,
TColgp_SequenceOfPnt& Params)
{
Geom2dInt_GInter Intersector;
Standard_Real Tol = Precision::Confusion();
constexpr Standard_Real Tol = Precision::Confusion();
// Standard_Real TolC = 1.e-9;
const Geom2dAdaptor_Curve& CBis(Bis);
@ -519,7 +519,7 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1,
// The tolerance can be eventually changed.
gp_Pnt P1,P2;
Standard_Real Tol = 4 * 100 * Precision::PConfusion();
constexpr Standard_Real Tol = 4 * 100 * Precision::PConfusion();
Standard_Integer i = 1;
Standard_Integer NbPoints = Params.Length();
@ -660,7 +660,7 @@ void BRepFill_TrimEdgeTool::AddOrConfuse(const Standard_Boolean Start,
{
Standard_Boolean ToProj = Standard_True;
gp_Pnt2d PBis;
Standard_Real Tol = 10*Precision::Confusion();
constexpr Standard_Real Tol = 10*Precision::Confusion();
// return curves associated to edges.
TopLoc_Location L;

View File

@ -548,7 +548,7 @@ static void GetRealKnots(const Standard_Real theMin,
Standard_Integer iU = theKnots->Upper();
Standard_Integer aStartI = 0;
Standard_Integer aEndI = 0;
Standard_Real aTol = Precision::Confusion();
constexpr Standard_Real aTol = Precision::Confusion();
while (++i < iU) {
if (aStartI == 0 && theKnots->Value(i) > theMin + aTol)

View File

@ -2940,7 +2940,7 @@ void BRepLib::ExtendFace(const TopoDS_Face& theF,
// Check if the periodic surface should become closed.
// In this case, use the basis surface with basis bounds.
const Standard_Real anEps = Precision::PConfusion();
constexpr Standard_Real anEps = Precision::PConfusion();
if (isUPeriodic && Abs(aFUMax - aFUMin - anUPeriod) < anEps)
{
aFUMin = aSUMin;

View File

@ -778,8 +778,8 @@ Standard_Boolean BRepLib_FuseEdges::SameSupport(const TopoDS_Edge& E1,
}
// On a presomption de confusion
const Standard_Real tollin = Precision::Confusion();
const Standard_Real tolang = Precision::Angular();
constexpr Standard_Real tollin = Precision::Confusion();
constexpr Standard_Real tolang = Precision::Angular();
if (typC1 == STANDARD_TYPE(Geom_Line)) {
gp_Lin li1( Handle(Geom_Line)::DownCast (C1)->Lin());
gp_Lin li2( Handle(Geom_Line)::DownCast (C2)->Lin());

View File

@ -781,7 +781,7 @@ void BRepLib_MakeEdge::Init(const Handle(Geom_Curve)& CC,
Standard_Real p2 = pp2;
Standard_Real cf = C->FirstParameter();
Standard_Real cl = C->LastParameter();
Standard_Real epsilon = Precision::PConfusion();
constexpr Standard_Real epsilon = Precision::PConfusion();
Standard_Boolean periodic = C->IsPeriodic();
GeomAdaptor_Curve aCA(C);
@ -1058,7 +1058,7 @@ void BRepLib_MakeEdge::Init(const Handle(Geom2d_Curve)& CC,
Standard_Real p2 = pp2;
Standard_Real cf = C->FirstParameter();
Standard_Real cl = C->LastParameter();
Standard_Real epsilon = Precision::PConfusion();
constexpr Standard_Real epsilon = Precision::PConfusion();
Standard_Boolean periodic = C->IsPeriodic();

View File

@ -593,7 +593,7 @@ void BRepLib_MakeEdge2d::Init(const Handle(Geom2d_Curve)& CC,
Standard_Real p2 = pp2;
Standard_Real cf = C->FirstParameter();
Standard_Real cl = C->LastParameter();
Standard_Real epsilon = Precision::Confusion();
constexpr Standard_Real epsilon = Precision::Confusion();
Standard_Boolean periodic = C->IsPeriodic();
@ -632,7 +632,7 @@ void BRepLib_MakeEdge2d::Init(const Handle(Geom2d_Curve)& CC,
if (!p1inf) P1 = C->Value(p1);
if (!p2inf) P2 = C->Value(p2);
Standard_Real preci = Precision::Confusion();
constexpr Standard_Real preci = Precision::Confusion();
BRep_Builder B;
// check for closed curve

View File

@ -559,7 +559,7 @@ void BRepLib_MakeFace::Init(const Handle(Geom_Surface)& SS,
// adjust periodical surface or reordonate
// check if the values are in the natural range
Standard_Real epsilon = Precision::PConfusion();
constexpr Standard_Real epsilon = Precision::PConfusion();
BS->Bounds(umin,umax,vmin,vmax);

View File

@ -96,7 +96,7 @@ void BRepLib_MakeShell::Init(const Handle(Geom_Surface)& S,
BS = RTS->BasisSurface();
}
myError = BRepLib_EmptyShell;
Standard_Real tol = Precision::Confusion();
constexpr Standard_Real tol = Precision::Confusion();
// Make a shell from a surface
GeomAdaptor_Surface GS(BS,UMin,UMax,VMin,VMax);
@ -358,7 +358,7 @@ void BRepLib_MakeShell::Init(const Handle(Geom_Surface)& S,
// Additional checking for degenerated edges
Standard_Boolean isDegenerated;
Standard_Real aFirst, aLast;
Standard_Real aTol = Precision::Confusion();
constexpr Standard_Real aTol = Precision::Confusion();
Standard_Real anActTol;
TopExp_Explorer anExp(myShape, TopAbs_EDGE);
for ( ; anExp.More(); anExp.Next())

View File

@ -46,7 +46,7 @@ void BRepLib_ToolTriangulatedShape::ComputeNormals (const TopoDS_Face& theFace,
return;
}
const Standard_Real aTol = Precision::Confusion();
constexpr Standard_Real aTol = Precision::Confusion();
Standard_Integer aTri[3];
gp_Dir aNorm;
theTris->AddNormals();

View File

@ -541,7 +541,7 @@ TopoDS_Edge MakeEdge(const Handle(Geom2d_Curve) &theCurve,
{
TopoDS_Edge aNewEdge;
BRep_Builder aBuilder;
Standard_Real aTol = Precision::Confusion();
constexpr Standard_Real aTol = Precision::Confusion();
Standard_Real aFPar = theCurve->FirstParameter();
Standard_Real aLPar = theCurve->LastParameter();

View File

@ -92,8 +92,8 @@ void BRepMesh_Classifier::RegisterWire(
aPClass(1) = *p1;
aPClass(2) = *p2;
const Standard_Real aAngTol = Precision::Angular();
const Standard_Real aSqConfusion =
constexpr Standard_Real aAngTol = Precision::Angular();
constexpr Standard_Real aSqConfusion =
Precision::PConfusion() * Precision::PConfusion();
for (Standard_Integer i = 1; i <= aNbPnts; i++)

View File

@ -126,7 +126,7 @@ void BRepMesh_CurveTessellator::init()
const Adaptor3d_CurveOnSurface& aCurve = myCurve.CurveOnSurface();
const Handle(Adaptor3d_Surface)& aSurface = aCurve.GetSurface();
const Standard_Real aTol = Precision::Confusion();
constexpr Standard_Real aTol = Precision::Confusion();
const Standard_Real aDu = aSurface->UResolution(aTol);
const Standard_Real aDv = aSurface->VResolution(aTol);

View File

@ -419,7 +419,7 @@ BRepMesh_GeomTool::IntFlag BRepMesh_GeomTool::IntSegSeg(
// Cross
// Intersection is out of segments ranges
const Standard_Real aPrec = Precision::PConfusion();
constexpr Standard_Real aPrec = Precision::PConfusion();
const Standard_Real aEndPrec = 1 - aPrec;
for (Standard_Integer i = 0; i < 2; ++i)
{
@ -492,7 +492,7 @@ Standard_Integer BRepMesh_GeomTool::classifyPoint(
gp_XY aP1 = thePoint2 - thePoint1;
gp_XY aP2 = thePointToCheck - thePoint1;
const Standard_Real aPrec = Precision::PConfusion();
constexpr Standard_Real aPrec = Precision::PConfusion();
const Standard_Real aSqPrec = aPrec * aPrec;
Standard_Real aDist = Abs(aP1 ^ aP2);
if (aDist > aPrec)

View File

@ -67,7 +67,7 @@ BRepMesh_VertexTool::BRepMesh_VertexTool(
myCellFilter(0., myAllocator),
mySelector (myAllocator)
{
const Standard_Real aTol = Precision::Confusion();
constexpr Standard_Real aTol = Precision::Confusion();
SetCellSize ( aTol + 0.05 * aTol );
SetTolerance( aTol, aTol );
}

View File

@ -49,7 +49,7 @@ Handle(Geom_Surface) BRepOffset::Surface(const Handle(Geom_Surface)& Surface,
BRepOffset_Status& theStatus,
Standard_Boolean allowC0)
{
Standard_Real Tol = Precision::Confusion();
constexpr Standard_Real Tol = Precision::Confusion();
theStatus = BRepOffset_Good;
Handle(Geom_Surface) Result;

View File

@ -1044,7 +1044,7 @@ static Standard_Boolean ExtendPCurve(const Handle(Geom2d_Curve)& aPCurve,
Handle(Geom2d_Line) aLin;
Handle(Geom2d_TrimmedCurve) aSegment;
Geom2dConvert_CompCurveToBSplineCurve aCompCurve(aTrCurve, Convert_RationalC1);
Standard_Real aTol = Precision::Confusion();
constexpr Standard_Real aTol = Precision::Confusion();
Standard_Real aDelta = Max(a2Offset, 1.);
if (FirstPar > anEf - a2Offset) {
@ -1462,7 +1462,7 @@ Standard_Boolean BRepOffset_Inter2d::ExtentEdge(const TopoDS_Edge& E,TopoDS_Edge
Handle(Geom_Line) aLin;
Handle(Geom_TrimmedCurve) aSegment;
GeomConvert_CompCurveToBSplineCurve aCompCurve(aTrCurve, Convert_RationalC1);
Standard_Real aTol = Precision::Confusion();
constexpr Standard_Real aTol = Precision::Confusion();
Standard_Real aDelta = Max(a2Offset, 1.);
if (FirstPar > anEf - a2Offset) {
@ -1523,7 +1523,7 @@ static Standard_Boolean UpdateVertex(const TopoDS_Vertex& V,
Standard_Real Of = OC.FirstParameter(); Standard_Real Ol = OC.LastParameter();
Standard_Real Nf = NC.FirstParameter(); Standard_Real Nl = NC.LastParameter();
Standard_Real U = 0.;
Standard_Real ParTol = Precision::PConfusion();
constexpr Standard_Real ParTol = Precision::PConfusion();
gp_Pnt P = BRep_Tool::Pnt(V);
Standard_Boolean OK = Standard_False;

View File

@ -4573,7 +4573,7 @@ Standard_Boolean TrimEdge(TopoDS_Edge& NE,
BOPTools_AlgoTools::MakeSplitEdge(NE, V1, aT1, V2, aT2, aSourceEdge);
//
//
Standard_Real aSameParTol = Precision::Confusion();
constexpr Standard_Real aSameParTol = Precision::Confusion();
Standard_Real U = 0.;
Standard_Real UMin = Precision::Infinite();

View File

@ -1252,7 +1252,7 @@ void BRepOffset_Offset::Init(const TopoDS_Edge& Path,
if ( IsClosed)
Edge4 = Edge3;
Standard_Real TolApp = Precision::Approximation();
constexpr Standard_Real TolApp = Precision::Approximation();
Handle(Geom2d_Line) L1,L2;
if ( IsClosed) {

View File

@ -326,7 +326,7 @@ static void BuildPCurves (const TopoDS_Edge& E,
if (!C2d.IsNull()) return;
//Standard_Real Tolerance = Max(Precision::Confusion(),BRep_Tool::Tolerance(E));
Standard_Real Tolerance = Precision::Confusion();
constexpr Standard_Real Tolerance = Precision::Confusion();
BRepAdaptor_Surface AS(F,0);
BRepAdaptor_Curve AC(E);
@ -586,7 +586,7 @@ Standard_Boolean BRepOffset_Tool::FindCommonShapes(const TopoDS_Shape& theS1,
static Standard_Boolean ToSmall (const Handle(Geom_Curve)& C)
{
Standard_Real Tol = 10*Precision::Confusion();
constexpr Standard_Real Tol = 10*Precision::Confusion();
Standard_Real m = (C->FirstParameter()*0.668 + C->LastParameter()*0.332);
gp_Pnt P1 = C->Value(C->FirstParameter());
gp_Pnt P2 = C->Value(C->LastParameter());
@ -1530,7 +1530,7 @@ void BRepOffset_Tool::Inter3D(const TopoDS_Face& F1,
}
}
Standard_Real aSameParTol = Precision::Confusion();
constexpr Standard_Real aSameParTol = Precision::Confusion();
Standard_Boolean isEl1 = Standard_False, isEl2 = Standard_False;
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(F1);
@ -2519,7 +2519,7 @@ static void MakeFace(const Handle(Geom_Surface)& S,
// compute vertices
BRep_Builder B;
Standard_Real tol = Precision::Confusion();
constexpr Standard_Real tol = Precision::Confusion();
TopoDS_Vertex V00,V10,V11,V01;
@ -3716,7 +3716,7 @@ void BRepOffset_Tool::ExtentFace (const TopoDS_Face& F,
TopoDS_Vertex NV1,NV2;
TopAbs_Orientation Or;
Standard_Real U1,U2;
Standard_Real eps = Precision::Confusion();
constexpr Standard_Real eps = Precision::Confusion();
#ifdef OCCT_DEBUG
TopLoc_Location L;
@ -3969,7 +3969,7 @@ static Standard_Boolean IsInOut (BRepTopAdaptor_FClass2d& FC,
const Geom2dAdaptor_Curve& AC,
const TopAbs_State& S )
{
Standard_Real Def = 100*Precision::Confusion();
constexpr Standard_Real Def = 100*Precision::Confusion();
GCPnts_QuasiUniformDeflection QU(AC,Def);
for (Standard_Integer i = 1; i <= QU.NbPoints(); i++) {

View File

@ -138,7 +138,7 @@ static Standard_Boolean IsValidEdge(const TopoDS_Edge& theEdge,
TopoDS_Vertex V1, V2;
TopExp::Vertices(theEdge, V1, V2);
Standard_Real Tol = Precision::Confusion();
constexpr Standard_Real Tol = Precision::Confusion();
Standard_Integer i;
TopExp_Explorer Explo(theFace, TopAbs_EDGE);

View File

@ -99,7 +99,7 @@
static Standard_Real PreciseUpar(const Standard_Real anUpar,
const Handle(Geom_BSplineSurface)& aSurface)
{
Standard_Real Tol = Precision::PConfusion();
constexpr Standard_Real Tol = Precision::PConfusion();
Standard_Integer i1, i2;
aSurface->LocateU(anUpar, Tol, i1, i2);

View File

@ -89,7 +89,7 @@ Standard_Boolean BRepSweep_Trsf::Process(const TopoDS_Shape& aGenS,
void BRepSweep_Trsf::SetContinuity(const TopoDS_Shape& aGenS,
const Sweep_NumShape& aDirS)
{
Standard_Real tl = Precision::Confusion(), tol3d;
constexpr Standard_Real tl = Precision::Confusion();
//angular etant un peu severe pour les contours sketches.
Standard_Real ta = 0.00175;//environ 0.1 degre
GeomAbs_Shape cont;
@ -103,7 +103,7 @@ void BRepSweep_Trsf::SetContinuity(const TopoDS_Shape& aGenS,
TopExp::Vertices(E,d,f);
if(d.IsSame(f)){
// tol3d = Max(tl,BRep_Tool::Tolerance(d));
tol3d = Max(tl,2.*BRep_Tool::Tolerance(d));//IFV 24.05.00 buc60684
const Standard_Real tol3d = Max(tl,2.*BRep_Tool::Tolerance(d));//IFV 24.05.00 buc60684
e.Initialize(E);
ud = BRep_Tool::Parameter(d,TopoDS::Edge(aGenS));
uf = BRep_Tool::Parameter(f,TopoDS::Edge(aGenS));
@ -155,7 +155,7 @@ void BRepSweep_Trsf::SetContinuity(const TopoDS_Shape& aGenS,
u1 = BRep_Tool::Parameter(V,E1);
u2 = BRep_Tool::Parameter(V,E2);
// tol3d = Max(tl,BRep_Tool::Tolerance(V));
tol3d = Max(tl,2.*BRep_Tool::Tolerance(V)); //IFV 24.05.00 buc60684
const Standard_Real tol3d = Max(tl,2.*BRep_Tool::Tolerance(V)); //IFV 24.05.00 buc60684
e1.Initialize(E1);
e2.Initialize(E2);
cont = BRepLProp::Continuity(e1,e2,u1,u2,tol3d,ta);

View File

@ -1743,7 +1743,7 @@ Standard_Integer edgeintersector(Draw_Interpretor& di,
BRep_Builder B;
Standard_Integer NbV = 0;
Standard_Real Tol = Precision::PConfusion();
constexpr Standard_Real Tol = Precision::PConfusion();
Standard_Boolean rejectreducedsegmentpoints = Standard_True;
EInter.InitPoint(rejectreducedsegmentpoints);

View File

@ -533,7 +533,7 @@ TopoDS_Face NextFaceForPrism (const TopoDS_Shape& shape,
if (ASI.IsDone()) {
Standard_Integer no=1, IndFrom, IndTo;
TopAbs_Orientation theOr;
Standard_Real min = 1.e-04, Tol = -Precision::Confusion();
constexpr Standard_Real min = 1.e-04, Tol = -Precision::Confusion();
if (ASI.LocalizeAfter (no, min, Tol, theOr, IndFrom, IndTo)) {
nextFace = ASI.Point(no, IndFrom).Face();
break;

View File

@ -217,7 +217,7 @@ void BRepTools::AddUVBounds(const TopoDS_Face& aF,
if (aS->DynamicType() == STANDARD_TYPE(Geom_BSplineSurface) &&
(aXmin < aUmin || aXmax > aUmax))
{
Standard_Real aTol2 = 100 * Precision::Confusion() * Precision::Confusion();
constexpr Standard_Real aTol2 = 100 * Precision::Confusion() * Precision::Confusion();
isUPeriodic = Standard_True;
gp_Pnt P1, P2;
// 1. Verify that the surface is U-closed
@ -298,7 +298,7 @@ void BRepTools::AddUVBounds(const TopoDS_Face& aF,
if (aS->DynamicType() == STANDARD_TYPE(Geom_BSplineSurface) &&
(aYmin < aVmin || aYmax > aVmax))
{
Standard_Real aTol2 = 100 * Precision::Confusion() * Precision::Confusion();
constexpr Standard_Real aTol2 = 100 * Precision::Confusion() * Precision::Confusion();
isVPeriodic = Standard_True;
gp_Pnt P1, P2;
// 1. Verify that the surface is V-closed

View File

@ -223,7 +223,7 @@ static void KPartCurve3d(const TopoDS_Edge& Edge,
// if not found call BRepLib::BuildCurve3d
TopLoc_Location Loc;
Standard_Real Tol = Precision::Confusion();
constexpr Standard_Real Tol = Precision::Confusion();
// Search only isos on analytical surfaces.
Geom2dAdaptor_Curve C(Curve);
@ -429,7 +429,7 @@ Handle(Geom_Curve) MakeCurve (const BiTgte_CurveOnEdge& HC)
MakeCurve_Function F(HC);
Standard_Integer Deg1, Deg2;
Deg1 = Deg2 = 8;
Standard_Real Tol = Precision::Approximation();
constexpr Standard_Real Tol = Precision::Approximation();
Approx_FitAndDivide Fit(F,Deg1,Deg2,Tol,Tol,Standard_True);
Standard_Integer i;
Standard_Integer NbCurves = Fit.NbMultiCurves();
@ -552,7 +552,7 @@ static TopoDS_Edge MakeDegeneratedEdge(const Handle(Geom_Curve)& CC,
const TopoDS_Vertex& VfOnE)
{
BRep_Builder B;
Standard_Real Tol = Precision::Confusion();
constexpr Standard_Real Tol = Precision::Confusion();
// kill trimmed curves
Handle(Geom_Curve) C = CC;
Handle(Geom_TrimmedCurve) CT = Handle(Geom_TrimmedCurve)::DownCast(C);

View File

@ -224,7 +224,7 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve ,
Standard_Boolean thesense = Standard_False,sense;
Standard_Real distancemini;
Standard_Integer nbsolution;
Standard_Real PreConf = Precision::Confusion();
constexpr Standard_Real PreConf = Precision::Confusion();
Handle(Standard_Type) type1 = afirstcurve->DynamicType();
Handle(Standard_Type) type2 = asecondcurve->DynamicType();

View File

@ -121,7 +121,7 @@ void Bisector_BisecCC::Perform(const Handle(Geom2d_Curve)& Cu1,
Standard_Real U,UC1,UC2,Dist,dU,USol;
gp_Pnt2d P;
Standard_Integer NbPnts = 21;
Standard_Real EpsMin = 10*Precision::Confusion();
constexpr Standard_Real EpsMin = 10*Precision::Confusion();
Standard_Boolean YaPoly = Standard_True;
Standard_Boolean OriInPoly = Standard_False;
//---------------------------------------------
@ -1626,8 +1626,8 @@ Standard_Real Bisector_BisecCC::SearchBound (const Standard_Real U1,
Standard_Real UMid,Dist1,Dist2,DistMid,U11,U22;
Standard_Real UC1,UC2;
gp_Pnt2d PBis,PBisPrec;
Standard_Real TolPnt = Precision::Confusion();
Standard_Real TolPar = Precision::PConfusion();
constexpr Standard_Real TolPnt = Precision::Confusion();
constexpr Standard_Real TolPar = Precision::PConfusion();
U11 = U1; U22 = U2;
PBisPrec = ValueByInt(U11,UC1,UC2,Dist1);
PBis = ValueByInt(U22,UC1,UC2,Dist2);

View File

@ -610,7 +610,7 @@ Standard_Real Bisector_BisecPC::SearchBound (const Standard_Real U1,
{
Standard_Real Dist1,DistMid,U11,U22;
Standard_Real UMid = 0.;
Standard_Real Tol = Precision::PConfusion();
constexpr Standard_Real Tol = Precision::PConfusion();
Standard_Real DistMax2 = distMax*distMax;
U11 = U1; U22 = U2;
Dist1 = Distance(U11);
@ -758,7 +758,7 @@ Standard_Boolean Bisector_BisecPC::IsEmpty() const
//==========================================================================
Standard_Real Bisector_BisecPC::Parameter(const gp_Pnt2d& P) const
{
Standard_Real Tol = Precision::Confusion();
constexpr Standard_Real Tol = Precision::Confusion();
if (P.IsEqual(pointStartBis,Tol)) {return startIntervals.Value(bisInterval);}
if (P.IsEqual(pointEndBis ,Tol)) {return endIntervals .Value(bisInterval);}

View File

@ -324,7 +324,7 @@ void Bisector_Inter::NeighbourPerform(const Handle(Bisector_BisecCC)& Bis1,
{
Standard_Real USol,U1,U2,Dist;
Standard_Real UMin =0.,UMax =0.;
Standard_Real Eps = Precision::PConfusion();
constexpr Standard_Real Eps = Precision::PConfusion();
gp_Pnt2d PSol;
Handle(Geom2d_Curve) Guide;

View File

@ -1144,8 +1144,8 @@ static void ComputeSphere (const gp_Sphere& Sphere,
zmin = P.Z() - R;
zmax = P.Z() + R;
Standard_Real uper = 2. * M_PI - Precision::PConfusion();
Standard_Real vper = M_PI - Precision::PConfusion();
constexpr Standard_Real uper = 2. * M_PI - Precision::PConfusion();
constexpr Standard_Real vper = M_PI - Precision::PConfusion();
if (UMax - UMin >= uper && VMax - VMin >= vper)
{
// a whole sphere
@ -1244,7 +1244,7 @@ static void computeDegeneratedTorus (const gp_Torus& theTorus,
Standard_Real aPhi = ACos (-aRa / aRi);
Standard_Real anUper = 2. * M_PI - Precision::PConfusion();
constexpr Standard_Real anUper = 2. * M_PI - Precision::PConfusion();
Standard_Real aVper = 2. * aPhi - Precision::PConfusion();
if (theUMax - theUMin >= anUper && theVMax - theVMin >= aVper)
{

View File

@ -495,7 +495,7 @@ void BndLib_Box2dCurve::PerformBSpline()
}
//
const Standard_Real eps = Precision::PConfusion();
constexpr Standard_Real eps = Precision::PConfusion();
if (fabs(aT1-aTb[0]) > eps || fabs(aT2-aTb[1]) > eps) {
aG=aCBS->Copy();
//

View File

@ -118,7 +118,7 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr,
Standard_Real UOnCyl,VOnCyl,UOnPln,VOnPln;
ElSLib::Parameters(Cyl,OrFillet,UOnCyl,VOnCyl);
Standard_Real tesp = Precision::Confusion();
constexpr Standard_Real tesp = Precision::Confusion();
if(UOnCyl < fu - tesp || UOnCyl > lu + tesp)
UOnCyl = ElCLib::InPeriod(UOnCyl,fu,fu+2*M_PI);
ElSLib::Parameters(Pln,OrFillet,UOnPln,VOnPln);

View File

@ -284,7 +284,7 @@ static void LineConstructor(Contap_TheSequenceOfLine& slin,
//-- ------------------------------------------------------------
//-- on decoupe la ligne en portions entre 2 vertex
Standard_Real Tol = Precision::PConfusion();
constexpr Standard_Real Tol = Precision::PConfusion();
Contap_IType typl = L.TypeContour();
//-- std::cout<<"\n ----------- Ligne Constructor "<<std::endl;
if(typl == Contap_Walking) {

View File

@ -481,7 +481,7 @@ Standard_Boolean Draft_Modification::NewParameter(const TopoDS_Vertex& V,
//Patch
Standard_Real FirstPar = GC->FirstParameter(), LastPar = GC->LastParameter();
Standard_Real pconf = Precision::PConfusion();
constexpr Standard_Real pconf = Precision::PConfusion();
if (Abs( paramf - LastPar ) <= pconf)
{
paramf = FirstPar;

View File

@ -1587,7 +1587,7 @@ void Draft_Modification::Perform ()
{
// pf >= pl
Standard_Real FirstPar = theCurve->FirstParameter(), LastPar = theCurve->LastParameter();
Standard_Real pconf = Precision::PConfusion();
constexpr Standard_Real pconf = Precision::PConfusion();
if (Abs( pf - LastPar ) <= pconf)
pf = FirstPar;
else if (Abs( pl - FirstPar ) <= pconf)
@ -2074,7 +2074,7 @@ static Standard_Real SmartParameter(Draft_EdgeInfo& Einf,
const Handle(Geom_Surface)& S2)
{
Handle( Geom2d_Curve ) NewC2d;
Standard_Real Tol = Precision::Confusion();
constexpr Standard_Real Tol = Precision::Confusion();
Standard_Real Etol = EdgeTol;
Handle( Geom2d_Curve ) pcu1 = Einf.FirstPC();

View File

@ -228,7 +228,7 @@ void DsgPrs::ComputeCurvilinearFacesLengthPresentation( const Standard_Real Firs
GeomAPI_ProjectPointOnCurve ProjectorOnCurve;
Standard_Real U1, V1, U2, V2;
Standard_Real LastU, LastV;
Standard_Real SquareTolerance = Precision::SquareConfusion();
constexpr Standard_Real SquareTolerance = Precision::SquareConfusion();
ProjectorOnSurface.Init( AttachmentPoint1, SecondSurf );
Standard_Integer Index(1);

View File

@ -459,7 +459,7 @@ void Extrema_ExtElCS::Perform(const gp_Circ& C,
Standard_Integer aNbExt = anExtC.NbExt();
Standard_Integer i;
Standard_Integer aCurI = 1;
Standard_Real aTolConf = Precision::Confusion();
constexpr Standard_Real aTolConf = Precision::Confusion();
Standard_Real aCylRad = S.Radius();
// Check whether two objects have intersection points

View File

@ -143,7 +143,7 @@ Method:
Standard_Real Usol[2];
Usol[0] = C.XAxis().Direction().AngleWithRef(OPp,Axe); // -M_PI<U1<M_PI
const Standard_Real aAngTol = Precision::Angular();
constexpr Standard_Real aAngTol = Precision::Angular();
if ( Usol[0] + M_PI < aAngTol )
Usol[0] = -M_PI;
else if ( Usol[0] - M_PI > -aAngTol )

View File

@ -206,7 +206,7 @@ Standard_Integer Extrema_FuncExtCS::GetStateNumber()
std::cout <<"F(1)= "<<Sol(1)<<" F(2)= "<<Sol(2)<<" F(3)= "<<Sol(3)<<std::endl;
#endif
//comparison of solution with previous solutions
Standard_Real tol2d = Precision::SquarePConfusion();
constexpr Standard_Real tol2d = Precision::SquarePConfusion();
Standard_Integer i = 1, nbSol = mySqDist.Length();
for( ; i <= nbSol; i++)
{

View File

@ -130,7 +130,7 @@ Standard_Integer Extrema_FuncPSNorm::GetStateNumber ()
if (!myPinit || !mySinit) throw Standard_TypeMismatch();
//comparison of solution with previous solutions
Standard_Integer i = 1, nbSol = mySqDist.Length();
Standard_Real tol2d = Precision::PConfusion() * Precision::PConfusion();
constexpr Standard_Real tol2d = Precision::PConfusion() * Precision::PConfusion();
for( ; i <= nbSol; i++)
{

View File

@ -44,7 +44,7 @@ void Extrema_GExtPC::Perform(const ThePoint& P)
Standard_Integer i, NbExt, n;
Standard_Real U;
mysample = 17;
Standard_Real t3d = Precision::Confusion();
constexpr Standard_Real t3d = Precision::Confusion();
if (Precision::IsInfinite(myuinf)) mydist1 = RealLast();
else {
Pf = TheCurveTool::Value(*((TheCurve*)myC), myuinf);

View File

@ -375,7 +375,7 @@ void Extrema_GenExtCS::Perform (const Adaptor3d_Curve& C,
aSqDists.Clear();
aPntsOnCrv.Clear();
aPntsOnSurf.Clear();
Standard_Real aTol = Precision::SquareConfusion();
constexpr Standard_Real aTol = Precision::SquareConfusion();
for (i = 1; i <= aSqDists1.Length(); ++i)
{
Standard_Real aDist = aSqDists1(i);

View File

@ -31,7 +31,7 @@ static void CorrectTol(const Standard_Real theU0, const Standard_Real theV0,
math_Vector& theTol)
{
//Correct tolerance for large values of UV parameters
Standard_Real aTolRef = Precision::PConfusion();
constexpr Standard_Real aTolRef = Precision::PConfusion();
Standard_Real anEpsRef = Epsilon(1.);
Standard_Real epsu = Epsilon(theU0);
const Standard_Real tolog10 = 0.43429;

View File

@ -145,7 +145,7 @@ void Extrema_GlobOptFuncCQuadric::LoadQuad( const Adaptor3d_Surface *S,
//
if (myS->IsUPeriodic())
{
Standard_Real aTMax = 2. * M_PI + Precision::PConfusion();
constexpr Standard_Real aTMax = 2. * M_PI + Precision::PConfusion();
if (myUf > aTMax || myUf < -Precision::PConfusion() ||
Abs(myUl - myUf) > aTMax)
{
@ -156,7 +156,7 @@ void Extrema_GlobOptFuncCQuadric::LoadQuad( const Adaptor3d_Surface *S,
}
if (myS->IsVPeriodic())
{
Standard_Real aTMax = 2. * M_PI + Precision::PConfusion();
constexpr Standard_Real aTMax = 2. * M_PI + Precision::PConfusion();
if (myVf > aTMax || myVf < -Precision::PConfusion() ||
Abs(myVl - myVf) > aTMax)
{

View File

@ -138,7 +138,7 @@ void Extrema_GlobOptFuncConicS::LoadConic(const Adaptor3d_Curve *C,
myTl = theTl;
if (myC->IsPeriodic())
{
Standard_Real aTMax = 2. * M_PI + Precision::PConfusion();
constexpr Standard_Real aTMax = 2. * M_PI + Precision::PConfusion();
if (myTf > aTMax || myTf < -Precision::PConfusion() ||
Abs(myTl - myTf) > aTMax)
{

View File

@ -286,7 +286,7 @@ void GCPnts_TangentialDeflection::EvaluateDu (const TheCurve& theC,
gp_Vec T, N;
D2 (theC, theU, theP, T, N);
Standard_Real Lt = T.Magnitude();
Standard_Real LTol = Precision::Confusion();
constexpr Standard_Real LTol = Precision::Confusion();
if (Lt > LTol && N.Magnitude () > LTol)
{
Standard_Real Lc = N.CrossMagnitude (T);
@ -434,7 +434,7 @@ Standard_Integer GCPnts_TangentialDeflection::AddPoint
const Standard_Real theParam,
const Standard_Boolean theIsReplace)
{
const Standard_Real tol = Precision::PConfusion();
constexpr Standard_Real tol = Precision::PConfusion();
Standard_Integer index = -1;
const Standard_Integer nb = myParameters.Length();
for ( Standard_Integer i = 1; index == -1 && i <= nb; i++ )
@ -477,7 +477,7 @@ Standard_Real GCPnts_TangentialDeflection::ArcAngularStep(
{
Standard_ConstructionError_Raise_if(theRadius < 0.0, "Negative radius");
const Standard_Real aPrecision = Precision::Confusion();
constexpr Standard_Real aPrecision = Precision::Confusion();
Standard_Real Du = 0.0, aMinSizeAng = 0.0;
if (theRadius > aPrecision)
@ -506,7 +506,7 @@ void GCPnts_TangentialDeflection::PerformCurve (const TheCurve& theC)
Standard_Real Du, Dusave, MiddleU, L1, L2;
Standard_Real U1 = myFirstu;
Standard_Real LTol = Precision::Confusion(); // protection longueur nulle
constexpr Standard_Real LTol = Precision::Confusion(); // protection longueur nulle
Standard_Real ATol = 1.e-2 * myAngularDeflection;
if (ATol > 1.e-2)
{

View File

@ -51,7 +51,7 @@ GccAna_Circ2dBisec::
//=========================================================================
WellDone = Standard_False;
Standard_Real Tol=Precision::Confusion();
constexpr Standard_Real Tol=Precision::Confusion();
Standard_Real R1 = Circ1.Radius();
Standard_Real R2 = Circ2.Radius();

View File

@ -216,7 +216,7 @@ void Geom_OffsetSurface::SetBasisSurface (const Handle(Geom_Surface)& S,
// et la mettre en champ, on pourrait utiliser par exemple pour l'extraction d'iso
// et aussi pour les singularite. Pour les surfaces osculatrices, on l'utilise pour
// detecter si une iso est degeneree.
const Standard_Real Tol = Precision::Confusion(); //0.0001;
constexpr Standard_Real Tol = Precision::Confusion(); //0.0001;
myOscSurf = new Geom_OsculatingSurface(aCheckingSurf, Tol);
}
@ -802,7 +802,7 @@ Handle(Geom_Surface) Geom_OffsetSurface::Surface() const
{
if (offsetValue == 0.0) return basisSurf; // Cas direct
Standard_Real Tol = Precision::Confusion();
constexpr Standard_Real Tol = Precision::Confusion();
Handle(Geom_Surface) Result, Base;
Result.Nullify();
Handle(Standard_Type) TheType = basisSurf->DynamicType();

View File

@ -855,7 +855,7 @@ pararg2(1,aNbSolMAX)
Intp.Perform(C1,C2,Tol,Tol);
if (Intp.IsDone()) {
if (!Intp.IsEmpty()) {
const Standard_Real aSQApproxTol = Precision::Approximation() *
constexpr Standard_Real aSQApproxTol = Precision::Approximation() *
Precision::Approximation();
for (Standard_Integer i = 1; i <= Intp.NbPoints() && NbrSol < aNbSolMAX; i++)
{

View File

@ -81,7 +81,7 @@ void GeomAPI_ExtremaCurveCurve::Init
myTotalExt = Standard_False;
Standard_Real Tol = Precision::PConfusion();
constexpr Standard_Real Tol = Precision::PConfusion();
myC1.Load(C1);
myC2.Load(C2);
@ -123,7 +123,7 @@ void GeomAPI_ExtremaCurveCurve::Init
myTotalExt = Standard_False;
Standard_Real Tol = Precision::PConfusion();
constexpr Standard_Real Tol = Precision::PConfusion();
myC1.Load(C1);
myC2.Load(C2);

View File

@ -81,7 +81,7 @@ void GeomAPI_ExtremaCurveSurface::Init
GeomAdaptor_Curve TheCurve (Curve);
GeomAdaptor_Surface TheSurface (Surface);
Standard_Real Tol = Precision::PConfusion();
constexpr Standard_Real Tol = Precision::PConfusion();
myExtCS.Initialize (TheSurface, Tol, Tol);
myExtCS.Perform (TheCurve, TheCurve.FirstParameter(), TheCurve.LastParameter());
myIsDone = myExtCS.IsDone() && (myExtCS.IsParallel() || myExtCS.NbExt() > 0);
@ -122,7 +122,7 @@ void GeomAPI_ExtremaCurveSurface::Init
GeomAdaptor_Curve TheCurve (Curve, Wmin, Wmax);
GeomAdaptor_Surface TheSurface (Surface, Umin, Umax, Vmin, Vmax);
Standard_Real Tol = Precision::PConfusion();
constexpr Standard_Real Tol = Precision::PConfusion();
myExtCS.Initialize (TheSurface,
Umin,Umax,Vmin,Vmax,Tol,Tol);
myExtCS.Perform (TheCurve, Wmin, Wmax);

View File

@ -81,7 +81,7 @@ void GeomAPI_ExtremaSurfaceSurface::Init
GeomAdaptor_Surface TheSurface1 (S1);
GeomAdaptor_Surface TheSurface2 (S2);
Standard_Real Tol = Precision::PConfusion();
constexpr Standard_Real Tol = Precision::PConfusion();
Extrema_ExtSS theExtSS(TheSurface1, TheSurface2,Tol,Tol);
myExtSS = theExtSS;
@ -126,7 +126,7 @@ void GeomAPI_ExtremaSurfaceSurface::Init
GeomAdaptor_Surface TheSurface1 (S1,U1min,U1max,V1min,V1max);
GeomAdaptor_Surface TheSurface2 (S2,U2min,U2max,V2min,V2max);
Standard_Real Tol = Precision::PConfusion();
constexpr Standard_Real Tol = Precision::PConfusion();
Extrema_ExtSS theExtSS(TheSurface1, TheSurface2,
U1min,U1max,V1min,V1max,
U2min,U2max,V2min,V2max,

View File

@ -161,7 +161,7 @@ GeomAPI_ProjectPointOnSurf::GeomAPI_ProjectPointOnSurf()
const Standard_Real Vsup,
const Extrema_ExtAlgo theProjAlgo)
{
Standard_Real Tolerance = Precision::PConfusion();
constexpr Standard_Real Tolerance = Precision::PConfusion();
//modified by NIZNHY-PKV Thu Apr 4 10:38:23 2002 f
//GeomAdaptor_Surface TheSurface (Surface,Umin,Usup,Vmin,Vsup);
//myExtPS = Extrema_ExtPS (P, TheSurface, Tol, Tol);
@ -211,7 +211,7 @@ GeomAPI_ProjectPointOnSurf::GeomAPI_ProjectPointOnSurf()
const Standard_Real Vsup,
const Extrema_ExtAlgo theProjAlgo)
{
Standard_Real Tolerance = Precision::PConfusion();
constexpr Standard_Real Tolerance = Precision::PConfusion();
//modified by NIZNHY-PKV Thu Apr 4 10:41:50 2002 f
//GeomAdaptor_Surface TheSurface (Surface,Umin,Usup,Vmin,Vsup);
myGeomAdaptor.Load(Surface, Umin,Usup,Vmin,Vsup);

View File

@ -83,7 +83,7 @@ GeomAbs_Shape LocalContinuity(Standard_Integer Degree,
Standard_Real newFirst, newLast;
BSplCLib::LocateParameter(Degree,TK,TM,PFirst,IsPeriodic,1,Nb,Index1,newFirst);
BSplCLib::LocateParameter(Degree,TK,TM,PLast, IsPeriodic,1,Nb,Index2,newLast );
const Standard_Real EpsKnot = Precision::PConfusion();
constexpr Standard_Real EpsKnot = Precision::PConfusion();
if (Abs(newFirst-TK(Index1+1))< EpsKnot) Index1++;
if (Abs(newLast -TK(Index2 ))< EpsKnot) Index2--;
// attention aux courbes peridiques.

View File

@ -307,7 +307,7 @@ void GeomAdaptor_SurfaceOfRevolution::VIntervals(TColStd_Array1OfReal& T,
Handle(Adaptor3d_Surface) GeomAdaptor_SurfaceOfRevolution::UTrim (const Standard_Real First, const Standard_Real Last, const Standard_Real Tol) const
{
const Standard_Real Eps = Precision::PConfusion();
constexpr Standard_Real Eps = Precision::PConfusion();
(void )Eps; (void )First; (void )Last; (void )Tol;
Standard_OutOfRange_Raise_if
( Abs(First) > Eps || Abs(Last - 2.*M_PI) > Eps,
@ -425,9 +425,9 @@ Standard_Real GeomAdaptor_SurfaceOfRevolution::VResolution
GeomAbs_SurfaceType GeomAdaptor_SurfaceOfRevolution::GetType() const
{
Standard_Real TolConf = Precision::Confusion();
Standard_Real TolAng = Precision::Angular();
Standard_Real TolConeSemiAng = Precision::Confusion();
constexpr Standard_Real TolConf = Precision::Confusion();
constexpr Standard_Real TolAng = Precision::Angular();
constexpr Standard_Real TolConeSemiAng = Precision::Confusion();
switch (myBasisCurve->GetType()) {
case GeomAbs_Line: {

View File

@ -482,7 +482,7 @@ Handle(Geom_Curve) GeomConvert_CurveToAnaCurve::ComputeEllipse(const Handle(Geom
}
Handle(Geom_Curve) res;
Standard_Real prec = Precision::PConfusion();
constexpr Standard_Real prec = Precision::PConfusion();
Standard_Real AF,BF,CF,DF,EF,Q1,Q2,Q3,c2n;
Standard_Integer i;

View File

@ -249,7 +249,7 @@ Standard_Boolean GeomConvert_SurfToAnaSurf::GetCylByLS(const Handle(TColgp_HArra
aLBnd(4) = aStartPoint(4) + aDR;
//
Standard_Real aTol = Precision::Confusion();
constexpr Standard_Real aTol = Precision::Confusion();
math_MultipleVarFunction* aPFunc;
GeomConvert_FuncCylinderLSDist aFuncCyl(thePoints, thePos.Direction());
aPFunc = (math_MultipleVarFunction*)&aFuncCyl;
@ -767,7 +767,7 @@ Handle(Geom_Surface) GeomConvert_SurfToAnaSurf::ConvertToAnalytical(const Standa
Standard_Real U1, U2, V1, V2;
mySurf->Bounds(U1, U2, V1, V2);
Standard_Boolean aDoSegment = Standard_False;
Standard_Real aTolBnd = Precision::PConfusion();
constexpr Standard_Real aTolBnd = Precision::PConfusion();
Standard_Integer isurf = 0;
if (Umin < U1 || Umax > U2 || Vmin < V1 || Vmax > V2)
{

View File

@ -259,7 +259,7 @@ void GeomFill_BSplineCurves::Init
// On ordonne les courbes
Handle(Geom_BSplineCurve) CC1, CC2, CC3, CC4;
Standard_Real Tol = Precision::Confusion();
constexpr Standard_Real Tol = Precision::Confusion();
#ifndef No_Exception
Standard_Boolean IsOK =
#endif
@ -517,7 +517,7 @@ void GeomFill_BSplineCurves::Init
}
}
else {
Standard_Real Eps = Precision::Confusion();
constexpr Standard_Real Eps = Precision::Confusion();
Standard_Boolean IsOK = Standard_False;
if ( CC1->StartPoint().IsEqual(CC2->StartPoint(),Eps)) {
IsOK = Standard_True;

View File

@ -47,7 +47,7 @@ static void SetSameWeights(TColStd_Array1OfReal& W1,
TColStd_Array1OfReal& W3,
TColStd_Array1OfReal& W4 )
{
Standard_Real Eps = Precision::Confusion();
constexpr Standard_Real Eps = Precision::Confusion();
Standard_Integer NU = W1.Length();
Standard_Integer NV = W2.Length();
@ -213,7 +213,7 @@ void GeomFill_BezierCurves::Init(const Handle(Geom_BezierCurve)& C1,
// On ordonne les courbes
Handle(Geom_BezierCurve) CC1, CC2, CC3, CC4;
Standard_Real Tol = Precision::Confusion();
constexpr Standard_Real Tol = Precision::Confusion();
#ifndef No_Exception
Standard_Boolean IsOK =
#endif
@ -417,7 +417,7 @@ void GeomFill_BezierCurves::Init(const Handle(Geom_BezierCurve)& C1,
TColgp_Array1OfPnt P1(1,Deg1+1);
TColgp_Array1OfPnt P2(1,Deg2+1);
Standard_Real Eps = Precision::Confusion();
constexpr Standard_Real Eps = Precision::Confusion();
Standard_Boolean IsOK = Standard_False;
if ( CC1->StartPoint().IsEqual(CC2->StartPoint(),Eps)) {
IsOK = Standard_True;

View File

@ -57,7 +57,7 @@ static void GeomFillFusInt(const TColStd_Array1OfReal& I1,
TColStd_SequenceOfReal& Seq)
{
Standard_Integer ind1=1, ind2=1;
Standard_Real Epspar = Precision::PConfusion()*0.99;
constexpr Standard_Real Epspar = Precision::PConfusion()*0.99;
// en suposant que le positionement fonctionne a PConfusion()/2
Standard_Real v1, v2;
// Initialisations : les IND1 et IND2 pointent sur le 1er element
@ -591,7 +591,7 @@ Intervals(TColStd_Array1OfReal& T, const GeomAbs_Shape S) const
void GeomFill_CircularBlendFunc::SetInterval(const Standard_Real First,
const Standard_Real Last)
{
Standard_Real Eps = Precision::PConfusion();
constexpr Standard_Real Eps = Precision::PConfusion();
myTPath = myPath->Trim(First, Last, Eps);
myTCurve1 = myCurve1->Trim(First, Last, Eps);
myTCurve2 = myCurve2->Trim(First, Last, Eps);

View File

@ -193,7 +193,7 @@ Standard_Boolean GeomFill_DiscreteTrihedron::D0(const Standard_Real Param,
{
//Locate <Param> in the sequence <myKnots>
Standard_Integer Index = -1;
Standard_Real TolPar = Precision::PConfusion();
constexpr Standard_Real TolPar = Precision::PConfusion();
//Standard_Real TolConf = Precision::Confusion();
Standard_Integer NbSamples = 10;
gp_Pnt Origin(0.,0.,0.);

View File

@ -152,8 +152,10 @@ Standard_Boolean GeomFill_Frenet::SetCurve(const Handle(Adaptor3d_Curve)& C)
{
Standard_Integer i, j;
GeomFill_SnglrFunc Func(myCurve);
Standard_Real TolF = 1.0e-10, Tol = 10*TolF, Tol2 = Tol * Tol,
PTol = Precision::PConfusion();
constexpr Standard_Real TolF = 1.0e-10;
constexpr Standard_Real Tol = 10 * TolF;
constexpr Standard_Real Tol2 = Tol * Tol;
constexpr Standard_Real PTol = Precision::PConfusion();
// We want to determine if the curve has linear segments
Standard_Integer NbIntC2 = myCurve->NbIntervals(GeomAbs_C2);

View File

@ -356,7 +356,8 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC,
}
Standard_Real ww, EpsW = 10*Precision::PConfusion();
Standard_Real ww;
constexpr Standard_Real EpsW = 10*Precision::PConfusion();
Standard_Boolean NullWeight = Standard_False;
if (!rational) DWeights.Init(0.);
Standard_Integer indice = 1, ii;
@ -449,7 +450,8 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC,
}
Standard_Real ww, EpsW = 10*Precision::PConfusion();
Standard_Real ww;
constexpr Standard_Real EpsW = 10*Precision::PConfusion();
Standard_Boolean NullWeight = Standard_False;
if (!rational) D2Weights.Init(0.);
Standard_Integer indice = 1, ii;

View File

@ -1091,8 +1091,8 @@ void GeomFill_Pipe::ApproxSurf(const Standard_Boolean WithParameters) {
Handle(GeomFill_Line) Line = new GeomFill_Line(Section.NbSections());
Standard_Integer NbIt = 0;
Standard_Real T3d = Precision::Approximation();
Standard_Real T2d = Precision::PApproximation();
constexpr Standard_Real T3d = Precision::Approximation();
constexpr Standard_Real T2d = Precision::PApproximation();
GeomFill_AppSweep App( 4, 8, T3d, T2d, NbIt, WithParameters);
App.Perform( Line, Section, 30);

View File

@ -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);

View File

@ -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.

View File

@ -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);

View File

@ -1479,7 +1479,7 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface,
Handle(Geom_BSplineSurface)::DownCast (Surface);
if (BS.IsNull()) {
//BS = GeomConvert::SurfaceToBSplineSurface(Surface);
Standard_Real Tol = Precision::Confusion(); //1.e-4;
constexpr Standard_Real Tol = Precision::Confusion(); //1.e-4;
GeomAbs_Shape UCont = GeomAbs_C1, VCont = GeomAbs_C1;
Standard_Integer degU = 14, degV = 14;
Standard_Integer nmax = 16;
@ -1509,7 +1509,7 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface,
// || ( !InU && BS->IsVRational() ) ;
Standard_Boolean rational = (BS->IsURational() || BS->IsVRational());
Standard_Boolean NullWeight;
Standard_Real EpsW = 10*Precision::PConfusion();
constexpr Standard_Real EpsW = 10*Precision::PConfusion();
Standard_Integer gap = 3;
if ( rational ) gap++;

View File

@ -40,7 +40,7 @@ static Standard_Boolean Controle(const TColgp_Array1OfPnt& Poles,
Standard_Real gx,gy,gz;
gp_Pnt Bary;
gp_Dir DX, DY;
Standard_Real aTolSingular = Precision::Confusion();
constexpr Standard_Real aTolSingular = Precision::Confusion();
GeomLib::Inertia(Poles, Bary, DX, DY, gx, gy, gz);

View File

@ -344,7 +344,7 @@ Standard_Real GeomLib_Tool::ComputeDeviation(const Geom2dAdaptor_Curve& theCurve
aFunc.GetLine(theLine);
const Standard_Real aTolDefl = Precision::PConfusion();
constexpr Standard_Real aTolDefl = Precision::PConfusion();
Standard_Real aD1 = 0.0;
Standard_Real aD2 = 0.0;

View File

@ -194,7 +194,7 @@ static Standard_Boolean ArePolesPlanar (const TColgp_Array1OfPnt& Poles,
for ( i = 1; i < Poles.Length(); i++)
Normal += Poles ( i ).XYZ() ^ Poles ( i + 1 ).XYZ();
Standard_Real tol = Precision::Confusion();
constexpr Standard_Real tol = Precision::Confusion();
Standard_Real nrm = Normal.Modulus();
if ( nrm < tol ) {
Normal.SetCoord ( 0, 0, 1 );

Some files were not shown because too many files have changed in this diff Show More