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:
@@ -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;
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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();
|
||||
|
@@ -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) {
|
||||
|
@@ -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++) {
|
||||
|
Reference in New Issue
Block a user