mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-09-09 22:28:13 +08:00
Coding - Rework of Math global functions to stl (#833)
Majority of functions now simply call same functions from std namespace. Functions that duplicate std namespace functionality are declared deprecated. Calls of deprecated functions are replaced with std functions calls.
This commit is contained in:
@@ -100,25 +100,25 @@ Handle(Geom_Surface) GeomFill::Surface(const Handle(Geom_Curve)& Curve1,
|
||||
|
||||
if (D1.IsEqual(D2, Precision::Angular()))
|
||||
{
|
||||
if (Abs(a1 - proj - a2) <= Precision::Confusion()
|
||||
&& Abs(b1 - proj - b2) <= Precision::Confusion())
|
||||
if (std::abs(a1 - proj - a2) <= Precision::Confusion()
|
||||
&& std::abs(b1 - proj - b2) <= Precision::Confusion())
|
||||
{
|
||||
gp_Ax3 Ax(L1.Location(), gp_Dir(D1.Crossed(P1P2)), D1);
|
||||
Handle(Geom_Plane) P = new Geom_Plane(Ax);
|
||||
Standard_Real V = P1P2.Dot(Ax.YDirection());
|
||||
Surf = new Geom_RectangularTrimmedSurface(P, a1, b1, Min(0., V), Max(0., V));
|
||||
Surf = new Geom_RectangularTrimmedSurface(P, a1, b1, std::min(0., V), std::max(0., V));
|
||||
IsDone = Standard_True;
|
||||
}
|
||||
}
|
||||
if (D1.IsOpposite(D2, Precision::Angular()))
|
||||
{
|
||||
if (Abs(a1 - proj + b2) <= Precision::Confusion()
|
||||
&& Abs(b1 - proj + a2) <= Precision::Confusion())
|
||||
if (std::abs(a1 - proj + b2) <= Precision::Confusion()
|
||||
&& std::abs(b1 - proj + a2) <= Precision::Confusion())
|
||||
{
|
||||
gp_Ax3 Ax(L1.Location(), gp_Dir(D1.Crossed(P1P2)), D1);
|
||||
Handle(Geom_Plane) P = new Geom_Plane(Ax);
|
||||
Standard_Real V = P1P2.Dot(Ax.YDirection());
|
||||
Surf = new Geom_RectangularTrimmedSurface(P, a1, b1, Min(0., V), Max(0., V));
|
||||
Surf = new Geom_RectangularTrimmedSurface(P, a1, b1, std::min(0., V), std::max(0., V));
|
||||
IsDone = Standard_True;
|
||||
}
|
||||
}
|
||||
@@ -142,15 +142,16 @@ Handle(Geom_Surface) GeomFill::Surface(const Handle(Geom_Curve)& Curve1,
|
||||
Standard_Real V = gp_Vec(A1.Location(), A2.Location()).Dot(gp_Vec(A1.Direction()));
|
||||
if (!Trim1 && !Trim2)
|
||||
{
|
||||
if (Abs(C1.Radius() - C2.Radius()) < Precision::Confusion())
|
||||
if (std::abs(C1.Radius() - C2.Radius()) < Precision::Confusion())
|
||||
{
|
||||
Handle(Geom_CylindricalSurface) C = new Geom_CylindricalSurface(A1, C1.Radius());
|
||||
Surf = new Geom_RectangularTrimmedSurface(C, Min(0., V), Max(0., V), Standard_False);
|
||||
Surf =
|
||||
new Geom_RectangularTrimmedSurface(C, std::min(0., V), std::max(0., V), Standard_False);
|
||||
}
|
||||
else
|
||||
{
|
||||
Standard_Real Rad = C2.Radius() - C1.Radius();
|
||||
Standard_Real Ang = ATan(Rad / V);
|
||||
Standard_Real Ang = std::atan(Rad / V);
|
||||
if (Ang < 0.)
|
||||
{
|
||||
A1.ZReverse();
|
||||
@@ -158,8 +159,9 @@ Handle(Geom_Surface) GeomFill::Surface(const Handle(Geom_Curve)& Curve1,
|
||||
Ang = -Ang;
|
||||
}
|
||||
Handle(Geom_ConicalSurface) C = new Geom_ConicalSurface(A1, Ang, C1.Radius());
|
||||
V /= Cos(Ang);
|
||||
Surf = new Geom_RectangularTrimmedSurface(C, Min(0., V), Max(0., V), Standard_False);
|
||||
V /= std::cos(Ang);
|
||||
Surf =
|
||||
new Geom_RectangularTrimmedSurface(C, std::min(0., V), std::max(0., V), Standard_False);
|
||||
}
|
||||
IsDone = Standard_True;
|
||||
}
|
||||
@@ -204,7 +206,7 @@ void GeomFill::GetShape(const Standard_Real MaxAng,
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
Standard_Integer NbSpan = (Standard_Integer)(Ceiling(3. * Abs(MaxAng) / 2. / M_PI));
|
||||
Standard_Integer NbSpan = (Standard_Integer)(std::ceil(3. * std::abs(MaxAng) / 2. / M_PI));
|
||||
NbPoles = 2 * NbSpan + 1;
|
||||
NbKnots = NbSpan + 1;
|
||||
Degree = 2;
|
||||
@@ -247,7 +249,7 @@ void GeomFill::GetMinimalWeights(const Convert_ParameterisationType TConv,
|
||||
CtoBspl->Weights(Weights);
|
||||
|
||||
TColStd_Array1OfReal poids(Weights.Lower(), Weights.Upper());
|
||||
Standard_Real angle_min = Max(Precision::PConfusion(), MinAng);
|
||||
Standard_Real angle_min = std::max(Precision::PConfusion(), MinAng);
|
||||
|
||||
Handle(Geom_TrimmedCurve) Sect2 = new Geom_TrimmedCurve(new Geom_Circle(C), 0., angle_min);
|
||||
CtoBspl = GeomConvert::CurveToBSplineCurve(Sect2, TConv);
|
||||
@@ -329,7 +331,7 @@ Standard_Real GeomFill::GetTolerance(const Convert_ParameterisationType TConv,
|
||||
gp_Ax2 popAx2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z));
|
||||
gp_Circ C(popAx2, Radius);
|
||||
Handle(Geom_Circle) popCircle = new Geom_Circle(C);
|
||||
Handle(Geom_TrimmedCurve) Sect = new Geom_TrimmedCurve(popCircle, 0., Max(AngleMin, 0.02));
|
||||
Handle(Geom_TrimmedCurve) Sect = new Geom_TrimmedCurve(popCircle, 0., std::max(AngleMin, 0.02));
|
||||
// 0.02 est proche d'1 degree, en desous on ne se preocupe pas de la tngence
|
||||
// afin d'eviter des tolerances d'approximation tendant vers 0 !
|
||||
Handle(Geom_BSplineCurve) CtoBspl = GeomConvert::CurveToBSplineCurve(Sect, TConv);
|
||||
@@ -378,7 +380,7 @@ void GeomFill::GetCircle(const Convert_ParameterisationType TConv,
|
||||
Cosa = 1;
|
||||
Sina = 0;
|
||||
}
|
||||
Angle = ACos(Cosa);
|
||||
Angle = std::acos(Cosa);
|
||||
// Recadrage sur ]-pi/2, 3pi/2]
|
||||
if (Sina < 0.)
|
||||
{
|
||||
@@ -416,13 +418,13 @@ void GeomFill::GetCircle(const Convert_ParameterisationType TConv,
|
||||
np2 = nplan.Crossed(ns1);
|
||||
|
||||
Alpha = Angle / ((Standard_Real)(NbSpan));
|
||||
Cosas2 = Cos(Alpha / 2);
|
||||
Cosas2 = std::cos(Alpha / 2);
|
||||
|
||||
for (i = 1, jj = low + 2; i <= NbSpan - 1; i++, jj += 2)
|
||||
{
|
||||
lambda = ((Standard_Real)(i)) * Alpha;
|
||||
Cosa = Cos(lambda);
|
||||
Sina = Sin(lambda);
|
||||
Cosa = std::cos(lambda);
|
||||
Sina = std::sin(lambda);
|
||||
temp.SetLinearForm(Cosa - 1, ns1, Sina, np2);
|
||||
Poles(jj).SetXYZ(pts1.XYZ() + Rayon * temp.XYZ());
|
||||
Weights(jj) = 1;
|
||||
@@ -479,7 +481,7 @@ Standard_Boolean GeomFill::GetCircle(const Convert_ParameterisationType TConv,
|
||||
Cosa = 1;
|
||||
Sina = 0;
|
||||
}
|
||||
Angle = ACos(Cosa);
|
||||
Angle = std::acos(Cosa);
|
||||
// Recadrage sur ]-pi/2, 3pi/2]
|
||||
if (Sina < 0.)
|
||||
{
|
||||
@@ -489,7 +491,7 @@ Standard_Boolean GeomFill::GetCircle(const Convert_ParameterisationType TConv,
|
||||
Angle = 2. * M_PI - Angle;
|
||||
}
|
||||
|
||||
if (Abs(Sina) > Abs(Cosa))
|
||||
if (std::abs(Sina) > std::abs(Cosa))
|
||||
{
|
||||
DAngle = -(dn1w.Dot(ns2) + ns1.Dot(dn2w)) / Sina;
|
||||
}
|
||||
@@ -545,14 +547,14 @@ Standard_Boolean GeomFill::GetCircle(const Convert_ParameterisationType TConv,
|
||||
dnp2 = dnplan.Crossed(ns1).Added(nplan.Crossed(dn1w));
|
||||
|
||||
Alpha = Angle / ((Standard_Real)(NbSpan));
|
||||
Cosas2 = Cos(Alpha / 2);
|
||||
Sinas2 = Sin(Alpha / 2);
|
||||
Cosas2 = std::cos(Alpha / 2);
|
||||
Sinas2 = std::sin(Alpha / 2);
|
||||
|
||||
for (i = 1, jj = low + 2; i <= NbSpan - 1; i++, jj += 2)
|
||||
{
|
||||
lambda = ((Standard_Real)(i)) * Alpha;
|
||||
Cosa = Cos(lambda);
|
||||
Sina = Sin(lambda);
|
||||
Cosa = std::cos(lambda);
|
||||
Sina = std::sin(lambda);
|
||||
temp.SetLinearForm(Cosa - 1, ns1, Sina, np2);
|
||||
Poles(jj).SetXYZ(pts1.XYZ() + Rayon * temp.XYZ());
|
||||
|
||||
@@ -644,7 +646,7 @@ Standard_Boolean GeomFill::GetCircle(const Convert_ParameterisationType TConv,
|
||||
Cosa = 1;
|
||||
Sina = 0;
|
||||
}
|
||||
Angle = ACos(Cosa);
|
||||
Angle = std::acos(Cosa);
|
||||
// Recadrage sur ]-pi/2, 3pi/2]
|
||||
if (Sina < 0.)
|
||||
{
|
||||
@@ -654,7 +656,7 @@ Standard_Boolean GeomFill::GetCircle(const Convert_ParameterisationType TConv,
|
||||
Angle = 2. * M_PI - Angle;
|
||||
}
|
||||
|
||||
if (Abs(Sina) > Abs(Cosa))
|
||||
if (std::abs(Sina) > std::abs(Cosa))
|
||||
{
|
||||
aux = dn1w.Dot(ns2) + ns1.Dot(dn2w);
|
||||
DAngle = -aux / Sina;
|
||||
@@ -746,14 +748,14 @@ Standard_Boolean GeomFill::GetCircle(const Convert_ParameterisationType TConv,
|
||||
d2np2 += 2 * dnplan.Crossed(dn1w);
|
||||
|
||||
Alpha = Angle / ((Standard_Real)(NbSpan));
|
||||
Cosas2 = Cos(Alpha / 2);
|
||||
Sinas2 = Sin(Alpha / 2);
|
||||
Cosas2 = std::cos(Alpha / 2);
|
||||
Sinas2 = std::sin(Alpha / 2);
|
||||
|
||||
for (i = 1, jj = low + 2; i <= NbSpan - 1; i++, jj += 2)
|
||||
{
|
||||
lambda = ((Standard_Real)(i)) * Alpha;
|
||||
Cosa = Cos(lambda);
|
||||
Sina = Sin(lambda);
|
||||
Cosa = std::cos(lambda);
|
||||
Sina = std::sin(lambda);
|
||||
temp.SetLinearForm(Cosa - 1, ns1, Sina, np2);
|
||||
Poles(jj).SetXYZ(pts1.XYZ() + Rayon * temp.XYZ());
|
||||
|
||||
@@ -797,7 +799,7 @@ Standard_Boolean GeomFill::GetCircle(const Convert_ParameterisationType TConv,
|
||||
|
||||
// Les poids
|
||||
Dlambda = -Sinas2 * DAngle / (2 * NbSpan);
|
||||
D2lambda = -Sinas2 * D2Angle / (2 * NbSpan) - Cosas2 * Pow(DAngle / (2 * NbSpan), 2);
|
||||
D2lambda = -Sinas2 * D2Angle / (2 * NbSpan) - Cosas2 * std::pow(DAngle / (2 * NbSpan), 2);
|
||||
|
||||
for (i = low; i < upp; i += 2)
|
||||
{
|
||||
|
||||
@@ -177,7 +177,7 @@ static Standard_Integer SetSameDistribution(Handle(Geom_BSplineCurve)& C1,
|
||||
BSplCLib::Reparametrize(K21, K22, K1);
|
||||
C1->SetKnots(K1);
|
||||
}
|
||||
else if (Abs(K12 - K11) > Precision::PConfusion())
|
||||
else if (std::abs(K12 - K11) > Precision::PConfusion())
|
||||
{
|
||||
BSplCLib::Reparametrize(K11, K12, K2);
|
||||
C2->SetKnots(K2);
|
||||
@@ -310,8 +310,8 @@ void GeomFill_BSplineCurves::Init(const Handle(Geom_BSplineCurve)& C1,
|
||||
Standard_Integer Deg2 = CC2->Degree();
|
||||
Standard_Integer Deg3 = CC3->Degree();
|
||||
Standard_Integer Deg4 = CC4->Degree();
|
||||
Standard_Integer DegU = Max(Deg1, Deg3);
|
||||
Standard_Integer DegV = Max(Deg2, Deg4);
|
||||
Standard_Integer DegU = std::max(Deg1, Deg3);
|
||||
Standard_Integer DegV = std::max(Deg2, Deg4);
|
||||
if (Deg1 < DegU)
|
||||
CC1->IncreaseDegree(DegU);
|
||||
if (Deg2 < DegV)
|
||||
@@ -491,7 +491,7 @@ void GeomFill_BSplineCurves::Init(const Handle(Geom_BSplineCurve)& C1,
|
||||
|
||||
if (Type != GeomFill_CurvedStyle)
|
||||
{
|
||||
Standard_Integer DegU = Max(Deg1, Deg2);
|
||||
Standard_Integer DegU = std::max(Deg1, Deg2);
|
||||
|
||||
if (CC1->Degree() < DegU)
|
||||
CC1->IncreaseDegree(DegU);
|
||||
|
||||
@@ -71,9 +71,9 @@ static void SetSameWeights(TColStd_Array1OfReal& W1,
|
||||
W4(i) *= Gamma;
|
||||
}
|
||||
|
||||
if (Abs(A - B) > Eps)
|
||||
if (std::abs(A - B) > Eps)
|
||||
{
|
||||
Standard_Real w = Pow(W1(1) / W4(1), 1. / (Standard_Real)(NV - 1));
|
||||
Standard_Real w = std::pow(W1(1) / W4(1), 1. / (Standard_Real)(NV - 1));
|
||||
Standard_Real x = w;
|
||||
for (i = NV - 1; i >= 1; i--)
|
||||
{
|
||||
@@ -208,13 +208,13 @@ void GeomFill_BezierCurves::Init(const Handle(Geom_BezierCurve)& C1,
|
||||
Standard_ConstructionError_Raise_if(!IsOK, " GeomFill_BezierCurves: Courbes non jointives");
|
||||
|
||||
// Mise en conformite des degres
|
||||
Standard_Integer DegU = Max(CC1->Degree(), CC3->Degree());
|
||||
Standard_Integer DegV = Max(CC2->Degree(), CC4->Degree());
|
||||
Standard_Integer DegU = std::max(CC1->Degree(), CC3->Degree());
|
||||
Standard_Integer DegV = std::max(CC2->Degree(), CC4->Degree());
|
||||
|
||||
if (Type == GeomFill_CoonsStyle)
|
||||
{
|
||||
DegU = Max(DegU, 3);
|
||||
DegV = Max(DegV, 3);
|
||||
DegU = std::max(DegU, 3);
|
||||
DegV = std::max(DegV, 3);
|
||||
}
|
||||
|
||||
if (CC1->Degree() < DegU)
|
||||
@@ -364,7 +364,7 @@ void GeomFill_BezierCurves::Init(const Handle(Geom_BezierCurve)& C1,
|
||||
|
||||
if (Type != GeomFill_CurvedStyle)
|
||||
{
|
||||
Standard_Integer DegU = Max(Deg1, Deg2);
|
||||
Standard_Integer DegU = std::max(Deg1, Deg2);
|
||||
|
||||
if (CC1->Degree() < DegU)
|
||||
CC1->Increase(DegU);
|
||||
|
||||
@@ -117,7 +117,7 @@ void GeomFill_BoundWithSurf::D1Norm(const Standard_Real U, gp_Vec& N, gp_Vec& DN
|
||||
Standard_Real nsuu = N.Dot(Suu), nsuv = N.Dot(Suv), nsvv = N.Dot(Svv);
|
||||
Standard_Real susu = Su.Dot(Su), susv = Su.Dot(Sv), svsv = Sv.Dot(Sv);
|
||||
Standard_Real deno = (susu * svsv) - (susv * susv);
|
||||
if (Abs(deno) < 1.e-16)
|
||||
if (std::abs(deno) < 1.e-16)
|
||||
{
|
||||
// on embraye sur un calcul approche, c est mieux que rien!?!
|
||||
gp_Vec temp = Norm(U + 1.e-12);
|
||||
|
||||
@@ -70,7 +70,7 @@ static void GeomFillFusInt(const TColStd_Array1OfReal& I1,
|
||||
{
|
||||
v1 = I1(ind1);
|
||||
v2 = I2(ind2);
|
||||
if (Abs(v1 - v2) <= Epspar)
|
||||
if (std::abs(v1 - v2) <= Epspar)
|
||||
{
|
||||
// Ici les elements de I1 et I2 conviennent .
|
||||
Seq.Append((v1 + v2) / 2);
|
||||
@@ -205,12 +205,12 @@ void GeomFill_CircularBlendFunc::Discret()
|
||||
{
|
||||
Cosa = 1.;
|
||||
}
|
||||
Angle = Abs(ACos(Cosa));
|
||||
Angle = std::abs(std::acos(Cosa));
|
||||
if (Angle > maxang)
|
||||
maxang = Angle;
|
||||
if (Angle < minang)
|
||||
minang = Angle;
|
||||
distmin = Min(distmin, P1.Distance(P2));
|
||||
distmin = std::min(distmin, P1.Distance(P2));
|
||||
myBary.ChangeCoord() += (P1.XYZ() + P2.XYZ());
|
||||
}
|
||||
}
|
||||
@@ -231,13 +231,13 @@ void GeomFill_CircularBlendFunc::Discret()
|
||||
Cosa = ns1.Dot(ns2);
|
||||
if (Cosa > 1.)
|
||||
Cosa = 1.;
|
||||
Angle = Abs(ACos(Cosa));
|
||||
Angle = std::abs(std::acos(Cosa));
|
||||
|
||||
if (Angle > maxang)
|
||||
maxang = Angle;
|
||||
if (Angle < minang)
|
||||
minang = Angle;
|
||||
distmin = Min(distmin, P1.Distance(P2));
|
||||
distmin = std::min(distmin, P1.Distance(P2));
|
||||
myBary.ChangeCoord() += (P1.XYZ() + P2.XYZ());
|
||||
}
|
||||
}
|
||||
@@ -641,8 +641,8 @@ void GeomFill_CircularBlendFunc::GetTolerance(const Standard_Real BoundTol,
|
||||
|
||||
Tol = GeomFill::GetTolerance(myTConv, minang, myRadius, AngleTol, SurfTol);
|
||||
Tol3d.Init(SurfTol);
|
||||
Tol3d(low + 1) = Tol3d(up - 1) = Min(Tol, SurfTol);
|
||||
Tol3d(low) = Tol3d(up) = Min(Tol, BoundTol);
|
||||
Tol3d(low + 1) = Tol3d(up - 1) = std::min(Tol, SurfTol);
|
||||
Tol3d(low) = Tol3d(up) = std::min(Tol, BoundTol);
|
||||
}
|
||||
|
||||
void GeomFill_CircularBlendFunc::SetTolerance(const Standard_Real, const Standard_Real)
|
||||
|
||||
@@ -74,7 +74,7 @@ static Standard_Integer inqadd(const Standard_Real d1,
|
||||
m[0] = m[1] = deg - 2;
|
||||
if (d1 != 1. && d2 != 1.)
|
||||
{
|
||||
if (Abs(d1 + d2 - 1.) < tolk)
|
||||
if (std::abs(d1 + d2 - 1.) < tolk)
|
||||
{
|
||||
k[0] = 0.5 * (d1 + 1. - d2);
|
||||
nbadd = 1;
|
||||
@@ -82,8 +82,8 @@ static Standard_Integer inqadd(const Standard_Real d1,
|
||||
else
|
||||
{
|
||||
nbadd = 2;
|
||||
k[0] = Min(d1, 1. - d2);
|
||||
k[1] = Max(d1, 1. - d2);
|
||||
k[0] = std::min(d1, 1. - d2);
|
||||
k[1] = std::max(d1, 1. - d2);
|
||||
}
|
||||
}
|
||||
else if (d1 != 1.)
|
||||
@@ -220,7 +220,7 @@ static void coonscnd(const Standard_Integer nb,
|
||||
if (stat[i].HasConstraint())
|
||||
{
|
||||
Standard_Integer ip = (i - 1 + nb) % nb;
|
||||
Standard_Real tolang = Min(bound[ip]->Tolang(), bound[i]->Tolang());
|
||||
Standard_Real tolang = std::min(bound[ip]->Tolang(), bound[i]->Tolang());
|
||||
Standard_Real an = stat[i].NorAng();
|
||||
Standard_Boolean twist = Standard_False;
|
||||
if (an >= 0.5 * M_PI)
|
||||
@@ -233,7 +233,7 @@ static void coonscnd(const Standard_Integer nb,
|
||||
else
|
||||
{
|
||||
Standard_Real fact = 0.5 * 27. / 4;
|
||||
tolang *= (Min(mintg[ip], mintg[i]) * fact * fact_normalization);
|
||||
tolang *= (std::min(mintg[ip], mintg[i]) * fact * fact_normalization);
|
||||
gp_Vec tgp, dnorp, tgi, dnori, vbid;
|
||||
gp_Pnt pbid;
|
||||
Standard_Real fp, lp, fi, li;
|
||||
@@ -253,7 +253,7 @@ static void coonscnd(const Standard_Integer nb,
|
||||
Standard_Real scal2 = tgi.Dot(dnorp);
|
||||
if (!twist)
|
||||
scal2 *= -1.;
|
||||
scal1 = Abs(scal1 + scal2);
|
||||
scal1 = std::abs(scal1 + scal2);
|
||||
if (scal1 > tolang)
|
||||
{
|
||||
Standard_Real killfactor = tolang / scal1;
|
||||
@@ -408,7 +408,7 @@ void GeomFill_ConstrainedFilling::Init(const Handle(GeomFill_Boundary)& B1,
|
||||
gp_Pnt p1 = bound[1]->Value(1.);
|
||||
gp_Pnt p2 = bound[2]->Value(1.);
|
||||
gp_Pnt ppp(0.5 * (p1.XYZ() + p2.XYZ()));
|
||||
Standard_Real t3 = Max(bound[1]->Tol3d(), bound[2]->Tol3d());
|
||||
Standard_Real t3 = std::max(bound[1]->Tol3d(), bound[2]->Tol3d());
|
||||
Handle(GeomFill_DegeneratedBound) DB = new GeomFill_DegeneratedBound(ppp, 0., 1., t3, 10.);
|
||||
|
||||
ptch = new GeomFill_CoonsAlgPatch(bound[0], bound[1], DB, bound[2]);
|
||||
@@ -557,13 +557,13 @@ void GeomFill_ConstrainedFilling::SetDomain(const Standard_Real
|
||||
const Handle(GeomFill_BoundWithSurf)& B)
|
||||
{
|
||||
if (B == ptch->Bound(0))
|
||||
dom[0] = Min(1., Abs(l));
|
||||
dom[0] = std::min(1., std::abs(l));
|
||||
else if (B == ptch->Bound(1))
|
||||
dom[1] = Min(1., Abs(l));
|
||||
dom[1] = std::min(1., std::abs(l));
|
||||
else if (B == ptch->Bound(2))
|
||||
dom[2] = Min(1., Abs(l));
|
||||
dom[2] = std::min(1., std::abs(l));
|
||||
else if (B == ptch->Bound(3))
|
||||
dom[3] = Min(1., Abs(l));
|
||||
dom[3] = std::min(1., std::abs(l));
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
@@ -679,7 +679,7 @@ void GeomFill_ConstrainedFilling::PerformApprox()
|
||||
|
||||
if (app.IsDone() || app.HasResult())
|
||||
{
|
||||
Standard_Integer imk = Min(ibound[0], ibound[1]);
|
||||
Standard_Integer imk = std::min(ibound[0], ibound[1]);
|
||||
Standard_Integer nbpol = app.NbPoles();
|
||||
degree[imk] = app.Degree();
|
||||
mults[imk] = app.Multiplicities();
|
||||
@@ -735,7 +735,7 @@ void GeomFill_ConstrainedFilling::MatchKnots()
|
||||
ntpol[3] = tgtepol[3];
|
||||
Standard_Real kadd[2];
|
||||
Standard_Integer madd[2];
|
||||
Standard_Real tolk = 1. / Max(10, 2 * knots[1]->Array1().Length());
|
||||
Standard_Real tolk = 1. / std::max(10, 2 * knots[1]->Array1().Length());
|
||||
Standard_Integer nbadd = inqadd(dom[0], dom[2], kadd, madd, degree[1], tolk);
|
||||
if (nbadd)
|
||||
{
|
||||
@@ -827,7 +827,7 @@ void GeomFill_ConstrainedFilling::MatchKnots()
|
||||
{
|
||||
for (i = 2; i <= nbnk; i++)
|
||||
{
|
||||
if (Abs(dom[0] - nm[1]->Value(i)) < tolk)
|
||||
if (std::abs(dom[0] - nm[1]->Value(i)) < tolk)
|
||||
{
|
||||
ind[0] = i;
|
||||
break;
|
||||
@@ -838,7 +838,7 @@ void GeomFill_ConstrainedFilling::MatchKnots()
|
||||
{
|
||||
for (i = 1; i < nbnk; i++)
|
||||
{
|
||||
if (Abs(1. - dom[2] - nm[1]->Value(i)) < tolk)
|
||||
if (std::abs(1. - dom[2] - nm[1]->Value(i)) < tolk)
|
||||
{
|
||||
ind[2] = i;
|
||||
break;
|
||||
@@ -846,7 +846,7 @@ void GeomFill_ConstrainedFilling::MatchKnots()
|
||||
}
|
||||
}
|
||||
}
|
||||
tolk = 1. / Max(10., 2. * knots[0]->Array1().Length());
|
||||
tolk = 1. / std::max(10., 2. * knots[0]->Array1().Length());
|
||||
nbadd = inqadd(dom[1], dom[3], kadd, madd, degree[0], tolk);
|
||||
if (nbadd)
|
||||
{
|
||||
@@ -938,7 +938,7 @@ void GeomFill_ConstrainedFilling::MatchKnots()
|
||||
{
|
||||
for (i = 2; i <= nbnk; i++)
|
||||
{
|
||||
if (Abs(dom[1] - nm[0]->Value(i)) < tolk)
|
||||
if (std::abs(dom[1] - nm[0]->Value(i)) < tolk)
|
||||
{
|
||||
ind[1] = i;
|
||||
break;
|
||||
@@ -949,7 +949,7 @@ void GeomFill_ConstrainedFilling::MatchKnots()
|
||||
{
|
||||
for (i = 1; i < nbnk; i++)
|
||||
{
|
||||
if (Abs(1. - dom[3] - nm[0]->Value(i)) < tolk)
|
||||
if (std::abs(1. - dom[3] - nm[0]->Value(i)) < tolk)
|
||||
{
|
||||
ind[3] = i;
|
||||
break;
|
||||
@@ -1528,9 +1528,9 @@ void GeomFill_ConstrainedFilling::CheckTgteField(const Standard_Integer I)
|
||||
#endif
|
||||
if (vnor.Magnitude() > 1.e-15 && vtg.Magnitude() > 1.e-15)
|
||||
{
|
||||
Standard_Real alpha = Abs(M_PI / 2. - Abs(vnor.Angle(vtg)));
|
||||
if (Abs(alpha) > maxang)
|
||||
maxang = Abs(alpha);
|
||||
Standard_Real alpha = std::abs(M_PI / 2. - std::abs(vnor.Angle(vtg)));
|
||||
if (std::abs(alpha) > maxang)
|
||||
maxang = std::abs(alpha);
|
||||
}
|
||||
}
|
||||
std::cout << "KAlgo angle max sur bord " << I << " : " << maxang << std::endl;
|
||||
@@ -1577,9 +1577,9 @@ void GeomFill_ConstrainedFilling::CheckApprox(const Standard_Integer I)
|
||||
vbound = bou->Norm(uu);
|
||||
if (vapp.Magnitude() > 1.e-15 && vbound.Magnitude() > 1.e-15)
|
||||
{
|
||||
Standard_Real alpha = Abs(M_PI / 2. - Abs(vbound.Angle(vapp)));
|
||||
if (Abs(alpha) > maxang)
|
||||
maxang = Abs(alpha);
|
||||
Standard_Real alpha = std::abs(M_PI / 2. - std::abs(vbound.Angle(vapp)));
|
||||
if (std::abs(alpha) > maxang)
|
||||
maxang = std::abs(alpha);
|
||||
}
|
||||
#ifdef DRAW
|
||||
Handle(Draw_Segment3D) seg;
|
||||
@@ -1660,8 +1660,8 @@ void GeomFill_ConstrainedFilling::CheckResult(const Standard_Integer I)
|
||||
vres[k] = V1.Crossed(V2);
|
||||
if (vres[k].Magnitude() > 1.e-15 && vbound[k].Magnitude() > 1.e-15)
|
||||
{
|
||||
Standard_Real alpha = Abs(vres[k].Angle(vbound[k]));
|
||||
alpha = Min(alpha, Abs(M_PI - alpha));
|
||||
Standard_Real alpha = std::abs(vres[k].Angle(vbound[k]));
|
||||
alpha = std::min(alpha, std::abs(M_PI - alpha));
|
||||
if (alpha > maxang)
|
||||
maxang = alpha;
|
||||
#ifdef DRAW
|
||||
|
||||
@@ -149,7 +149,7 @@ static void smoothlaw(Handle(Law_BSpline)& Law,
|
||||
tol = 0.;
|
||||
for (ii = 1; ii <= Param->Length() && Ok; ii++)
|
||||
{
|
||||
d = Abs(BS->Value(Param->Value(ii)) - Points->Value(ii));
|
||||
d = std::abs(BS->Value(Param->Value(ii)) - Points->Value(ii));
|
||||
if (d > tol)
|
||||
tol = d;
|
||||
Ok = (tol <= Tol);
|
||||
@@ -186,7 +186,7 @@ static void smoothlaw(Handle(Law_BSpline)& Law,
|
||||
tol = 0.;
|
||||
for (ii = 1; ii <= Param->Length() && Ok; ii++)
|
||||
{
|
||||
d = Abs(BS->Value(Param->Value(ii)) - Points->Value(ii));
|
||||
d = std::abs(BS->Value(Param->Value(ii)) - Points->Value(ii));
|
||||
if (d > tol)
|
||||
tol = d;
|
||||
Ok = (tol <= Tol);
|
||||
@@ -319,7 +319,7 @@ static Standard_Boolean FindPlane(const Handle(Adaptor3d_Curve)& theC, Handle(Ge
|
||||
{
|
||||
const gp_XYZ& xyz = TabP->Value(ii).XYZ();
|
||||
dist = a * xyz.X() + b * xyz.Y() + c * xyz.Z() + d;
|
||||
found = (Abs(dist) <= Precision::Confusion());
|
||||
found = (std::abs(dist) <= Precision::Confusion());
|
||||
}
|
||||
return found;
|
||||
}
|
||||
@@ -438,7 +438,7 @@ void GeomFill_CorrectedFrenet::Init()
|
||||
AvStep = (myTrimmed->LastParameter() - myTrimmed->FirstParameter()) / NbStep;
|
||||
for (i = 1; i <= NbI; i++)
|
||||
{
|
||||
NbStep = Max(Standard_Integer((T(i + 1) - T(i)) / AvStep), 3);
|
||||
NbStep = std::max(Standard_Integer((T(i + 1) - T(i)) / AvStep), 3);
|
||||
Step = (T(i + 1) - T(i)) / NbStep;
|
||||
if (!InitInterval(T(i),
|
||||
T(i + 1),
|
||||
@@ -541,7 +541,7 @@ Standard_Boolean GeomFill_CorrectedFrenet::InitInterval(const Standard_Real
|
||||
{
|
||||
if (currParam > DLast)
|
||||
{
|
||||
if (Abs(DLast - Param) < Precision::SquareConfusion())
|
||||
if (std::abs(DLast - Param) < Precision::SquareConfusion())
|
||||
{
|
||||
Param = currParam;
|
||||
}
|
||||
@@ -566,7 +566,7 @@ Standard_Boolean GeomFill_CorrectedFrenet::InitInterval(const Standard_Real
|
||||
angleAT = CalcAngleAT(Tangent, Normal, prevTangent, prevNormal);
|
||||
|
||||
if (isConst && i > 1)
|
||||
if (Abs(angleAT) > Precision::PConfusion())
|
||||
if (std::abs(angleAT) > Precision::PConfusion())
|
||||
isConst = Standard_False;
|
||||
|
||||
angleAT += (i > 1) ? EvolAT(i - 1) : startAng;
|
||||
@@ -574,19 +574,23 @@ Standard_Boolean GeomFill_CorrectedFrenet::InitInterval(const Standard_Real
|
||||
prevNormal = Normal;
|
||||
|
||||
if (isZero)
|
||||
if (Abs(angleAT) > Precision::PConfusion())
|
||||
if (std::abs(angleAT) > Precision::PConfusion())
|
||||
isZero = Standard_False;
|
||||
|
||||
aT += Tangent;
|
||||
cross = Tangent.Crossed(Normal);
|
||||
aN.SetLinearForm(Sin(angleAT), cross, 1 - Cos(angleAT), Tangent.Crossed(cross), Normal + aN);
|
||||
aN.SetLinearForm(std::sin(angleAT),
|
||||
cross,
|
||||
1 - std::cos(angleAT),
|
||||
Tangent.Crossed(cross),
|
||||
Normal + aN);
|
||||
prevTangent = Tangent;
|
||||
Param = currParam;
|
||||
i++;
|
||||
|
||||
// Evaluate the Next step
|
||||
CS.D1(Param, PonC, D1);
|
||||
Standard_Real L = Max(PonC.XYZ().Modulus() / 2, LengthMin);
|
||||
Standard_Real L = std::max(PonC.XYZ().Modulus() / 2, LengthMin);
|
||||
Standard_Real norm = D1.Magnitude();
|
||||
if (norm < Precision::Confusion())
|
||||
{
|
||||
@@ -655,7 +659,7 @@ Standard_Real GeomFill_CorrectedFrenet::CalcAngleAT(const gp_Vec& Tangent,
|
||||
Standard_Real angle;
|
||||
gp_Vec Normal_rot, cross;
|
||||
angle = Tangent.Angle(prevTangent);
|
||||
if (Abs(angle) > Precision::Angular() && Abs(angle) < M_PI - Precision::Angular())
|
||||
if (std::abs(angle) > Precision::Angular() && std::abs(angle) < M_PI - Precision::Angular())
|
||||
{
|
||||
cross = Tangent.Crossed(prevTangent).Normalized();
|
||||
Normal_rot = Normal + sin(angle) * cross.Crossed(Normal)
|
||||
@@ -681,7 +685,7 @@ static Standard_Real corr2PI_PI(Standard_Real Ang)
|
||||
|
||||
static Standard_Real diffAng(Standard_Real A, Standard_Real Ao)
|
||||
{
|
||||
Standard_Real dA = (A - Ao) - Floor((A - Ao) / 2.0 / M_PI) * 2.0 * M_PI;
|
||||
Standard_Real dA = (A - Ao) - std::floor((A - Ao) / 2.0 / M_PI) * 2.0 * M_PI;
|
||||
return dA = dA >= 0 ? corr2PI_PI(dA) : -corr2PI_PI(-dA);
|
||||
}
|
||||
|
||||
@@ -718,7 +722,7 @@ Standard_Real GeomFill_CorrectedFrenet::GetAngleAT(const Standard_Real Param) co
|
||||
Standard_Real DAng = CalcAngleAT(Tangent, Normal, HArrTangent->Value(iC), HArrNormal->Value(iC));
|
||||
Standard_Real DA = diffAng(DAng, dAng);
|
||||
// The correction (there is core of OCC78 bug)
|
||||
if (Abs(DA) > M_PI / 2.0)
|
||||
if (std::abs(DA) > M_PI / 2.0)
|
||||
{
|
||||
AngP = AngPo + DAng;
|
||||
};
|
||||
@@ -743,7 +747,11 @@ Standard_Boolean GeomFill_CorrectedFrenet::D0(const Standard_Real Param,
|
||||
// rotation around Tangent
|
||||
gp_Vec cross;
|
||||
cross = Tangent.Crossed(Normal);
|
||||
Normal.SetLinearForm(Sin(angleAT), cross, (1 - Cos(angleAT)), Tangent.Crossed(cross), Normal);
|
||||
Normal.SetLinearForm(std::sin(angleAT),
|
||||
cross,
|
||||
(1 - std::cos(angleAT)),
|
||||
Tangent.Crossed(cross),
|
||||
Normal);
|
||||
BiNormal = Tangent.Crossed(Normal);
|
||||
|
||||
return Standard_True;
|
||||
@@ -770,8 +778,8 @@ Standard_Boolean GeomFill_CorrectedFrenet::D1(const Standard_Real Param,
|
||||
angleAT = GetAngleAT(Param); // OCC78
|
||||
|
||||
gp_Vec cross, dcross, tcross, dtcross, aux;
|
||||
sina = Sin(angleAT);
|
||||
cosa = Cos(angleAT);
|
||||
sina = std::sin(angleAT);
|
||||
cosa = std::cos(angleAT);
|
||||
|
||||
cross = Tangent.Crossed(Normal);
|
||||
dcross.SetLinearForm(1, DTangent.Crossed(Normal), Tangent.Crossed(DNormal));
|
||||
@@ -836,8 +844,8 @@ Standard_Boolean GeomFill_CorrectedFrenet::D2(const Standard_Real Param,
|
||||
angleAT = GetAngleAT(Param); // OCC78
|
||||
|
||||
gp_Vec cross, dcross, d2cross, tcross, dtcross, d2tcross, aux;
|
||||
sina = Sin(angleAT);
|
||||
cosa = Cos(angleAT);
|
||||
sina = std::sin(angleAT);
|
||||
cosa = std::cos(angleAT);
|
||||
cross = Tangent.Crossed(Normal);
|
||||
dcross.SetLinearForm(1, DTangent.Crossed(Normal), Tangent.Crossed(DNormal));
|
||||
d2cross.SetLinearForm(1,
|
||||
@@ -1008,7 +1016,7 @@ GeomFill_Trihedron GeomFill_CorrectedFrenet::EvaluateBestMode()
|
||||
tmin = Int(i);
|
||||
tmax = Int(i + 1);
|
||||
Standard_Real Torsion = ComputeTorsion(tmin, myTrimmed);
|
||||
if (Abs(Torsion) > MaxTorsion)
|
||||
if (std::abs(Torsion) > MaxTorsion)
|
||||
return GeomFill_IsDiscreteTrihedron; // DiscreteTrihedron
|
||||
|
||||
Handle(Law_Function) trimmedlaw = EvolAroundT->Trim(tmin, tmax, Precision::PConfusion() / 2);
|
||||
@@ -1024,7 +1032,7 @@ GeomFill_Trihedron GeomFill_CorrectedFrenet::EvaluateBestMode()
|
||||
if (k > 2)
|
||||
{
|
||||
Standard_Real theAngle = PrevVec.Angle(aVec);
|
||||
if (Abs(theAngle) > MaxAngle)
|
||||
if (std::abs(theAngle) > MaxAngle)
|
||||
return GeomFill_IsDiscreteTrihedron; // DiscreteTrihedron
|
||||
}
|
||||
PrevVec = aVec;
|
||||
|
||||
@@ -78,7 +78,7 @@ void GeomFill_CurveAndTrihedron::SetTrsf(const gp_Mat& Transfo)
|
||||
WithTrans = Standard_False; // Au cas ou Trans = I
|
||||
for (Standard_Integer ii = 1; ii <= 3 && !WithTrans; ii++)
|
||||
for (Standard_Integer jj = 1; jj <= 3 && !WithTrans; jj++)
|
||||
if (Abs(Aux.Value(ii, jj)) > 1.e-14)
|
||||
if (std::abs(Aux.Value(ii, jj)) > 1.e-14)
|
||||
WithTrans = Standard_True;
|
||||
}
|
||||
|
||||
|
||||
@@ -200,13 +200,13 @@ Standard_Boolean GeomFill_DiscreteTrihedron::D0(const Standard_Real Param,
|
||||
break;
|
||||
}
|
||||
Index = I1;
|
||||
if (Abs(Param - myKnots->Value(I2)) < TolPar)
|
||||
if (std::abs(Param - myKnots->Value(I2)) < TolPar)
|
||||
Index = I2;
|
||||
|
||||
Standard_Real PrevParam = myKnots->Value(Index);
|
||||
gp_Ax2 PrevAxis = myTrihedrons->Value(Index);
|
||||
gp_Ax2 theAxis;
|
||||
if (Abs(Param - PrevParam) < TolPar)
|
||||
if (std::abs(Param - PrevParam) < TolPar)
|
||||
theAxis = PrevAxis;
|
||||
else //<Param> is between knots
|
||||
{
|
||||
|
||||
@@ -56,7 +56,7 @@ GeomFill_DraftTrihedron::GeomFill_DraftTrihedron(const gp_Vec& BiNormal, const S
|
||||
void GeomFill_DraftTrihedron::SetAngle(const Standard_Real Angle)
|
||||
{
|
||||
myAngle = M_PI / 2 + Angle;
|
||||
myCos = Cos(myAngle);
|
||||
myCos = std::cos(myAngle);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -86,7 +86,7 @@ Standard_Boolean GeomFill_DraftTrihedron::D0(const Standard_Real Param,
|
||||
mu = myCos;
|
||||
|
||||
// La Normal est portee par la regle
|
||||
Normal.SetLinearForm(Sqrt(1 - mu * mu), b, mu, v);
|
||||
Normal.SetLinearForm(std::sqrt(1 - mu * mu), b, mu, v);
|
||||
|
||||
// Le reste suit....
|
||||
// La tangente est perpendiculaire a la normale et a la direction de depouille
|
||||
@@ -136,8 +136,8 @@ Standard_Boolean GeomFill_DraftTrihedron::D1(const Standard_Real Param,
|
||||
|
||||
Standard_Real mu = myCos;
|
||||
|
||||
Normal.SetLinearForm(Sqrt(1 - mu * mu), b, mu, v);
|
||||
DNormal.SetLinearForm(Sqrt(1 - mu * mu), db, mu, dv);
|
||||
Normal.SetLinearForm(std::sqrt(1 - mu * mu), b, mu, v);
|
||||
DNormal.SetLinearForm(std::sqrt(1 - mu * mu), db, mu, dv);
|
||||
|
||||
Tangent = Normal.Crossed(B);
|
||||
normT = Tangent.Magnitude();
|
||||
@@ -201,7 +201,7 @@ Standard_Boolean GeomFill_DraftTrihedron::D2(const Standard_Real Param,
|
||||
gp_Vec d2v = d2b.Crossed(T) + 2 * db.Crossed(DT) + b.Crossed(D2T);
|
||||
|
||||
Standard_Real mu = myCos, rac;
|
||||
rac = Sqrt(1 - mu * mu);
|
||||
rac = std::sqrt(1 - mu * mu);
|
||||
|
||||
Normal.SetLinearForm(rac, b, mu, v);
|
||||
DNormal.SetLinearForm(rac, db, mu, dv);
|
||||
|
||||
@@ -223,7 +223,7 @@ Standard_Boolean GeomFill_EvolvedSection::IsUPeriodic() const
|
||||
//=======================================================
|
||||
Standard_Boolean GeomFill_EvolvedSection::IsVPeriodic() const
|
||||
{
|
||||
return (Abs(myLaw->Value(First) - myLaw->Value(Last)) < Precision::Confusion());
|
||||
return (std::abs(myLaw->Value(First) - myLaw->Value(Last)) < Precision::Confusion());
|
||||
}
|
||||
|
||||
//=======================================================
|
||||
|
||||
@@ -173,7 +173,8 @@ void GeomFill_Frenet::Init()
|
||||
|
||||
if (IsConst->Value(i))
|
||||
{
|
||||
if (Abs(C.X() - C1.X()) > Tol || Abs(C.Y() - C1.Y()) > Tol || Abs(C.Z() - C1.Z()) > Tol)
|
||||
if (std::abs(C.X() - C1.X()) > Tol || std::abs(C.Y() - C1.Y()) > Tol
|
||||
|| std::abs(C.Z() - C1.Z()) > Tol)
|
||||
{
|
||||
IsConst->ChangeValue(i) = Standard_False;
|
||||
}
|
||||
@@ -294,9 +295,9 @@ void GeomFill_Frenet::Init()
|
||||
{
|
||||
Func.D2(mySngl->Value(i), C, SnglDer, SnglDer2);
|
||||
if ((norm = SnglDer.Magnitude()) > gp::Resolution())
|
||||
mySnglLen->ChangeValue(i) = Min(NullTol / norm, MaxSingular);
|
||||
mySnglLen->ChangeValue(i) = std::min(NullTol / norm, MaxSingular);
|
||||
else if ((norm = SnglDer2.Magnitude()) > gp::Resolution())
|
||||
mySnglLen->ChangeValue(i) = Min(Sqrt(2 * NullTol / norm), MaxSingular);
|
||||
mySnglLen->ChangeValue(i) = std::min(std::sqrt(2 * NullTol / norm), MaxSingular);
|
||||
else
|
||||
mySnglLen->ChangeValue(i) = MaxSingular;
|
||||
}
|
||||
@@ -471,8 +472,8 @@ Standard_Boolean GeomFill_Frenet::D0(const Standard_Real theParam,
|
||||
u = theParam - aDelta;
|
||||
|
||||
gp_Pnt P1, P2;
|
||||
myTrimmed->D0(Min(theParam, u), P1);
|
||||
myTrimmed->D0(Max(theParam, u), P2);
|
||||
myTrimmed->D0(std::min(theParam, u), P1);
|
||||
myTrimmed->D0(std::max(theParam, u), P2);
|
||||
|
||||
gp_Vec V1(P1, P2);
|
||||
Standard_Real aDirFactor = aTn.Dot(V1);
|
||||
@@ -808,7 +809,7 @@ Standard_Boolean GeomFill_Frenet::IsSingular(const Standard_Real U, Standard_Int
|
||||
return Standard_False;
|
||||
for (i = 1; i <= mySngl->Length(); i++)
|
||||
{
|
||||
if (Abs(U - mySngl->Value(i)) < mySnglLen->Value(i))
|
||||
if (std::abs(U - mySngl->Value(i)) < mySnglLen->Value(i))
|
||||
{
|
||||
Index = i;
|
||||
return Standard_True;
|
||||
|
||||
@@ -139,9 +139,9 @@ Standard_Boolean GeomFill_FunctionDraft::DerivT(const Handle(Adaptor3d_Curve)& C
|
||||
|
||||
C->D1(Param, P, DP); // derivee de la section
|
||||
|
||||
F(1) = DP.Coord(1) + W * dN.Coord(1) * Sin(teta);
|
||||
F(2) = DP.Coord(2) + W * dN.Coord(2) * Sin(teta);
|
||||
F(3) = DP.Coord(3) + W * dN.Coord(3) * Sin(teta);
|
||||
F(1) = DP.Coord(1) + W * dN.Coord(1) * std::sin(teta);
|
||||
F(2) = DP.Coord(2) + W * dN.Coord(2) * std::sin(teta);
|
||||
F(3) = DP.Coord(3) + W * dN.Coord(3) * std::sin(teta);
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
@@ -162,9 +162,9 @@ Standard_Boolean GeomFill_FunctionDraft::Deriv2T(const Handle(Adaptor3d_Curve)&
|
||||
|
||||
C->D2(Param, P, DP, D2P); // derivee de la section
|
||||
|
||||
F(1) = D2P.Coord(1) + W * d2N.Coord(1) * Sin(teta);
|
||||
F(2) = D2P.Coord(2) + W * d2N.Coord(2) * Sin(teta);
|
||||
F(3) = D2P.Coord(3) + W * d2N.Coord(3) * Sin(teta);
|
||||
F(1) = D2P.Coord(1) + W * d2N.Coord(1) * std::sin(teta);
|
||||
F(2) = D2P.Coord(2) + W * d2N.Coord(2) * std::sin(teta);
|
||||
F(3) = D2P.Coord(3) + W * d2N.Coord(3) * std::sin(teta);
|
||||
|
||||
return Standard_True;
|
||||
}
|
||||
@@ -183,9 +183,9 @@ Standard_Boolean GeomFill_FunctionDraft::DerivTX(const gp_Vec& dN,
|
||||
Standard_Integer i;
|
||||
for (i = 1; i <= 3; i++)
|
||||
{
|
||||
D(i, 1) = dN.Coord(i) * Sin(teta); // derivee / W
|
||||
D(i, 2) = 0.; // derivee / U
|
||||
D(i, 3) = 0.; // derivee / V
|
||||
D(i, 1) = dN.Coord(i) * std::sin(teta); // derivee / W
|
||||
D(i, 2) = 0.; // derivee / U
|
||||
D(i, 3) = 0.; // derivee / V
|
||||
}
|
||||
|
||||
return Standard_True;
|
||||
|
||||
@@ -235,8 +235,8 @@ void GeomFill_FunctionGuide::DSDT(const Standard_Real U,
|
||||
// C origine sur l'axe de revolution
|
||||
// Vdir vecteur unitaire definissant la direction de l'axe de revolution
|
||||
// Q(v) point de parametre V sur la courbe de revolution
|
||||
// OM (u,v) = OC + CQ * Cos(U) + (CQ.Vdir)(1-Cos(U)) * Vdir +
|
||||
// (Vdir^CQ)* Sin(U)
|
||||
// OM (u,v) = OC + CQ * std::cos(U) + (CQ.Vdir)(1-std::cos(U)) * Vdir +
|
||||
// (Vdir^CQ)* std::sin(U)
|
||||
|
||||
gp_Pnt Pc;
|
||||
TheCurve->D0(V, Pc); // Q(v)
|
||||
@@ -254,12 +254,15 @@ void GeomFill_FunctionGuide::DSDT(const Standard_Real U,
|
||||
gp_XYZ DVcrossCQ;
|
||||
DVcrossCQ.SetLinearForm(DDir.Crossed(Q),
|
||||
Dir.Crossed(DQ)); // Vdir^CQ
|
||||
DVcrossCQ.Multiply(Sin(U)); //(Vdir^CQ)*Sin(U)
|
||||
DVcrossCQ.Multiply(std::sin(U)); //(Vdir^CQ)*Sin(U)
|
||||
|
||||
Standard_Real CosU = Cos(U);
|
||||
Standard_Real CosU = std::cos(U);
|
||||
gp_XYZ DVdotCQ;
|
||||
DVdotCQ.SetLinearForm(DDir.Dot(Q) + Dir.Dot(DQ), Dir, Dir.Dot(Q), DDir); //(CQ.Vdir)(1-Cos(U))Vdir
|
||||
DVdotCQ.Add(DVcrossCQ); // addition des composantes
|
||||
DVdotCQ.SetLinearForm(DDir.Dot(Q) + Dir.Dot(DQ),
|
||||
Dir,
|
||||
Dir.Dot(Q),
|
||||
DDir); //(CQ.Vdir)(1-std::cos(U))Vdir
|
||||
DVdotCQ.Add(DVcrossCQ); // addition des composantes
|
||||
|
||||
DQ.Multiply(CosU);
|
||||
DQ.Add(DVdotCQ);
|
||||
|
||||
@@ -61,7 +61,7 @@ static void InGoodPeriod(const Standard_Real Prec,
|
||||
Standard_Real& Current)
|
||||
{
|
||||
Standard_Real Diff = Current - Prec;
|
||||
Standard_Integer nb = (Standard_Integer)IntegerPart(Diff / Period);
|
||||
Standard_Integer nb = (Standard_Integer)std::trunc(Diff / Period);
|
||||
Current -= nb * Period;
|
||||
Diff = Current - Prec;
|
||||
if (Diff > Period / 2)
|
||||
@@ -170,7 +170,7 @@ void GeomFill_GuideTrihedronPlan::Init()
|
||||
if (ii > 1)
|
||||
{
|
||||
Standard_Real Diff = w - Pole->Value(1, ii - 1).Y();
|
||||
if (Abs(Diff) > DeltaG)
|
||||
if (std::abs(Diff) > DeltaG)
|
||||
{
|
||||
if (myGuide->IsPeriodic())
|
||||
{
|
||||
@@ -181,7 +181,7 @@ void GeomFill_GuideTrihedronPlan::Init()
|
||||
}
|
||||
|
||||
#ifdef OCCT_DEBUG
|
||||
if (Abs(Diff) > DeltaG)
|
||||
if (std::abs(Diff) > DeltaG)
|
||||
{
|
||||
std::cout << "Trihedron Plan Diff on Guide : " << Diff << std::endl;
|
||||
}
|
||||
@@ -325,7 +325,7 @@ Standard_Boolean GeomFill_GuideTrihedronPlan::D1(const Standard_Real Param,
|
||||
/* Standard_Real h=1.e-7, e, etg, etc;
|
||||
E.Value(Res, e);
|
||||
E.Value(Res+h, etg);
|
||||
if ( Abs( (etg-e)/h - dedx) > 1.e-4) {
|
||||
if ( std::abs( (etg-e)/h - dedx) > 1.e-4) {
|
||||
std::cout << "err :" << (etg-e)/h - dedx << std::endl;
|
||||
}
|
||||
gp_Pnt pdbg;
|
||||
@@ -335,7 +335,7 @@ Standard_Boolean GeomFill_GuideTrihedronPlan::D1(const Standard_Real Param,
|
||||
|
||||
GeomFill_PlanFunc Edeb(pdbg, td, myGuide);
|
||||
Edeb.Value(Res, etc);
|
||||
if ( Abs( (etc-e)/h - dedt) > 1.e-4) {
|
||||
if ( std::abs( (etc-e)/h - dedt) > 1.e-4) {
|
||||
std::cout << "err :" << (etc-e)/h - dedt << std::endl;
|
||||
} */
|
||||
|
||||
@@ -394,73 +394,6 @@ Standard_Boolean GeomFill_GuideTrihedronPlan::D2(const Standard_Real Param,
|
||||
DBiNormal,
|
||||
D2BiNormal);
|
||||
|
||||
/*
|
||||
// plan ortho a Tangent pour trouver la pt Pprime sur le guide
|
||||
Handle(Geom_Plane) Plan = new (Geom_Plane)(P, Tangent);
|
||||
Handle(GeomAdaptor_Surface) Pl= new(GeomAdaptor_Surface)(Plan);
|
||||
|
||||
|
||||
Standard_Integer Iter = 50;
|
||||
// fonction dont il faut trouver la racine : G(W) - Pl(U,V)=0
|
||||
GeomFill_FunctionPipe E(Pl , myGuide);
|
||||
InitX(Param);
|
||||
|
||||
// resolution
|
||||
math_FunctionSetRoot Result(E, X, XTol,
|
||||
Inf, Sup, Iter);
|
||||
if (Result.IsDone())
|
||||
{
|
||||
math_Vector R(1,3);
|
||||
R = Result.Root(); // solution
|
||||
myTrimG->D2(R(1), PG, TG, DTG);
|
||||
|
||||
gp_Vec n (P, PG); // vecteur definissant la normale du triedre
|
||||
Standard_Real Norm = n.Magnitude();
|
||||
n /= Norm;
|
||||
Normal = n.Normalized();
|
||||
BiNormal = Tangent.Crossed(Normal);
|
||||
|
||||
|
||||
|
||||
// derivee premiere du triedre
|
||||
Standard_Real dtp_dt;
|
||||
dtp_dt = (To*Tangent - Norm*(n*DTangent))/(Tangent*TG);
|
||||
gp_Vec dn, d2n;
|
||||
dn.SetLinearForm(dtp_dt, TG, -1, To);
|
||||
|
||||
DNormal.SetLinearForm(-(n*dn), n, dn);
|
||||
DNormal /= Norm;
|
||||
DBiNormal = Tangent.Crossed(DNormal) + DTangent.Crossed(Normal);
|
||||
|
||||
// derivee seconde du triedre
|
||||
Standard_Real d2tp_dt2;
|
||||
d2tp_dt2 = (DTo*Tangent+To*DTangent - dn*DTangent-Norm*n*D2Tangent)/(TG*Tangent)
|
||||
- (To*Tangent-Norm*n*DTangent) * (DTG*dtp_dt*Tangent+TG*DTangent)
|
||||
/ ((TG*Tangent)*(TG*Tangent));
|
||||
|
||||
|
||||
d2n.SetLinearForm(dtp_dt*dtp_dt, DTG, d2tp_dt2, TG, -DTo);
|
||||
dn/=Norm;
|
||||
d2n/=Norm;
|
||||
|
||||
D2Normal.SetLinearForm(3*Pow(n*dn,2)- (dn.SquareMagnitude() + n*d2n), n,
|
||||
-2*(n*dn), dn,
|
||||
d2n);
|
||||
|
||||
D2BiNormal.SetLinearForm(1, D2Tangent.Crossed(Normal),
|
||||
2, DTangent.Crossed(DNormal),
|
||||
Tangent.Crossed(D2Normal));
|
||||
}
|
||||
else {// Erreur...
|
||||
#ifdef OCCT_DEBUG
|
||||
std::cout << "D2 :";
|
||||
TracePlan(Plan);
|
||||
#endif
|
||||
myStatus = GeomFill_PlaneNotIntersectGuide;
|
||||
return Standard_False;
|
||||
}
|
||||
*/
|
||||
// return Standard_True;
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ void GeomFill_LocationDraft::SetTrsf(const gp_Mat& Transfo)
|
||||
WithTrans = Standard_False; // Au cas ou Trans = I
|
||||
for (Standard_Integer ii = 1; ii <= 3 && !WithTrans; ii++)
|
||||
for (Standard_Integer jj = 1; jj <= 3 && !WithTrans; jj++)
|
||||
if (Abs(Aux.Value(ii, jj)) > 1.e-14)
|
||||
if (std::abs(Aux.Value(ii, jj)) > 1.e-14)
|
||||
WithTrans = Standard_True;
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ void GeomFill_LocationDraft::Prepare()
|
||||
myLaw->D0(t, T, N, B);
|
||||
|
||||
// Generatrice
|
||||
D = Cos(myAngle) * B + Sin(myAngle) * N;
|
||||
D = std::cos(myAngle) * B + std::sin(myAngle) * N;
|
||||
|
||||
L = new (Geom_Line)(P, D);
|
||||
|
||||
@@ -245,7 +245,7 @@ Standard_Boolean GeomFill_LocationDraft::D0(const Standard_Real Param,
|
||||
{
|
||||
// la generatrice intersecte la surface d'arret
|
||||
// la generatrice
|
||||
D = Cos(myAngle) * B + Sin(myAngle) * N;
|
||||
D = std::cos(myAngle) * B + std::sin(myAngle) * N;
|
||||
|
||||
Handle(Geom_Line) L = new (Geom_Line)(P, D);
|
||||
Handle(GeomAdaptor_Curve) G = new (GeomAdaptor_Curve)(L);
|
||||
@@ -360,7 +360,7 @@ Standard_Boolean GeomFill_LocationDraft::D1(const Standard_Real Param,
|
||||
if (Intersec == Standard_True)
|
||||
{ // la generatrice intersecte la surface d'arret
|
||||
// la generatrice
|
||||
D = Cos(myAngle) * B + Sin(myAngle) * N;
|
||||
D = std::cos(myAngle) * B + std::sin(myAngle) * N;
|
||||
|
||||
Handle(Geom_Line) L = new (Geom_Line)(P, D);
|
||||
Handle(GeomAdaptor_Curve) G = new (GeomAdaptor_Curve)(L);
|
||||
@@ -497,7 +497,7 @@ Standard_Boolean GeomFill_LocationDraft::D2(const Standard_Real Param,
|
||||
{ // la generatrice intersecte la surface d'arret
|
||||
|
||||
// la generatrice
|
||||
D = Cos(myAngle) * B + Sin(myAngle) * N;
|
||||
D = std::cos(myAngle) * B + std::sin(myAngle) * N;
|
||||
|
||||
Handle(Geom_Line) L = new (Geom_Line)(P, D);
|
||||
Handle(GeomAdaptor_Curve) G = new (GeomAdaptor_Curve)(L);
|
||||
|
||||
@@ -141,7 +141,7 @@ static void InGoodPeriod(const Standard_Real Prec,
|
||||
Standard_Real& Current)
|
||||
{
|
||||
Standard_Real Diff = Current - Prec;
|
||||
Standard_Integer nb = (Standard_Integer)IntegerPart(Diff / Period);
|
||||
Standard_Integer nb = (Standard_Integer)std::trunc(Diff / Period);
|
||||
Current -= nb * Period;
|
||||
Diff = Current - Prec;
|
||||
if (Diff > Period / 2)
|
||||
@@ -399,7 +399,7 @@ void GeomFill_LocationGuide::SetRotation(const Standard_Real PrecAngle, Standard
|
||||
jref = j;
|
||||
}
|
||||
}
|
||||
MinDist = Sqrt(MinDist);
|
||||
MinDist = std::sqrt(MinDist);
|
||||
DistMini.Points(jref, Pc, Ps);
|
||||
|
||||
Ps.Parameter(theU, theV);
|
||||
@@ -414,7 +414,7 @@ void GeomFill_LocationGuide::SetRotation(const Standard_Real PrecAngle, Standard
|
||||
if (ii > 1)
|
||||
{
|
||||
Diff = w - myPoles2d->Value(1, ii - 1).Y();
|
||||
if (Abs(Diff) > DeltaG)
|
||||
if (std::abs(Diff) > DeltaG)
|
||||
{
|
||||
if (myGuide->IsPeriodic())
|
||||
{
|
||||
@@ -424,7 +424,7 @@ void GeomFill_LocationGuide::SetRotation(const Standard_Real PrecAngle, Standard
|
||||
}
|
||||
|
||||
#ifdef OCCT_DEBUG
|
||||
if (Abs(Diff) > DeltaG)
|
||||
if (std::abs(Diff) > DeltaG)
|
||||
{
|
||||
std::cout << "Location :: Diff on Guide : " << Diff << std::endl;
|
||||
}
|
||||
@@ -436,13 +436,13 @@ void GeomFill_LocationGuide::SetRotation(const Standard_Real PrecAngle, Standard
|
||||
if (ii > 1)
|
||||
{
|
||||
Diff = Angle - OldAngle;
|
||||
if (Abs(Diff) > M_PI)
|
||||
if (std::abs(Diff) > M_PI)
|
||||
{
|
||||
InGoodPeriod(OldAngle, 2 * M_PI, Angle);
|
||||
Diff = Angle - OldAngle;
|
||||
}
|
||||
#ifdef OCCT_DEBUG
|
||||
if (Abs(Diff) > M_PI / 4)
|
||||
if (std::abs(Diff) > M_PI / 4)
|
||||
{
|
||||
std::cout << "Diff d'angle trop grand !!" << std::endl;
|
||||
}
|
||||
@@ -460,7 +460,7 @@ void GeomFill_LocationGuide::SetRotation(const Standard_Real PrecAngle, Standard
|
||||
}
|
||||
Diff = v - myPoles2d->Value(2, ii - 1).Y();
|
||||
#ifdef OCCT_DEBUG
|
||||
if (Abs(Diff) > (Ul - Uf) / (2 + NbKnots))
|
||||
if (std::abs(Diff) > (Ul - Uf) / (2 + NbKnots))
|
||||
{
|
||||
std::cout << "Diff sur section trop grand !!" << std::endl;
|
||||
}
|
||||
@@ -573,7 +573,7 @@ void GeomFill_LocationGuide::SetTrsf(const gp_Mat& Transfo)
|
||||
WithTrans = Standard_False; // Au cas ou Trans = I
|
||||
for (Standard_Integer ii = 1; ii <= 3 && !WithTrans; ii++)
|
||||
for (Standard_Integer jj = 1; jj <= 3 && !WithTrans; jj++)
|
||||
if (Abs(Aux.Value(ii, jj)) > 1.e-14)
|
||||
if (std::abs(Aux.Value(ii, jj)) > 1.e-14)
|
||||
WithTrans = Standard_True;
|
||||
}
|
||||
|
||||
@@ -845,13 +845,13 @@ Standard_Boolean GeomFill_LocationGuide::D1(const Standard_Real Param,
|
||||
Standard_Real Aprim = DSDT(2);
|
||||
|
||||
#ifdef OCCT_DEBUG
|
||||
gp_Mat M2 (Cos(A), -Sin(A),0, // rotation autour de T
|
||||
Sin(A), Cos(A),0,
|
||||
gp_Mat M2 (std::cos(A), -std::sin(A),0, // rotation autour de T
|
||||
std::sin(A), std::cos(A),0,
|
||||
0,0,1);
|
||||
#endif
|
||||
|
||||
gp_Mat M2prim (-Sin(A), -Cos(A), 0, // derivee rotation autour de T
|
||||
Cos(A), -Sin(A), 0,
|
||||
gp_Mat M2prim (-std::sin(A), -std::cos(A), 0, // derivee rotation autour de T
|
||||
std::cos(A), -std::sin(A), 0,
|
||||
0, 0, 0);
|
||||
M2prim.Multiply(Aprim);
|
||||
|
||||
@@ -1065,16 +1065,16 @@ Standard_Boolean GeomFill_LocationGuide::D2(
|
||||
Standard_Real Aprim = DSDT(2);
|
||||
Standard_Real Asec = D2SDT2(2);
|
||||
|
||||
gp_Mat M2 (Cos(A),-Sin(A),0, // rotation autour de T
|
||||
Sin(A), Cos(A),0,
|
||||
gp_Mat M2 (std::cos(A),-std::sin(A),0, // rotation autour de T
|
||||
std::sin(A), std::cos(A),0,
|
||||
0, 0, 1);
|
||||
|
||||
gp_Mat M2prim (-Sin(A),-Cos(A),0, // derivee 1ere rotation autour de T
|
||||
Cos(A), -Sin(A),0,
|
||||
gp_Mat M2prim (-std::sin(A),-std::cos(A),0, // derivee 1ere rotation autour de T
|
||||
std::cos(A), -std::sin(A),0,
|
||||
0,0,0);
|
||||
|
||||
gp_Mat M2sec (-Cos(A), Sin(A), 0, // derivee 2nde rotation autour de T
|
||||
-Sin(A), -Cos(A), 0,
|
||||
gp_Mat M2sec (-std::cos(A), std::sin(A), 0, // derivee 2nde rotation autour de T
|
||||
-std::sin(A), -std::cos(A), 0,
|
||||
0,0,0);
|
||||
M2sec.Multiply(Aprim*Aprim);
|
||||
gp_Mat M2p = M2prim.Multiplied(Asec);
|
||||
|
||||
@@ -73,7 +73,7 @@ static Standard_Boolean verifD1(const TColgp_Array1OfPnt& P1,
|
||||
for (ii = 1; ii <= L; ii++)
|
||||
{
|
||||
dw = (W2(ii) - W1(ii)) / pas;
|
||||
if (Abs(dw - DWeights(ii)) > wTol)
|
||||
if (std::abs(dw - DWeights(ii)) > wTol)
|
||||
{
|
||||
if (Affich)
|
||||
{
|
||||
@@ -119,7 +119,7 @@ static Standard_Boolean verifD2(const TColgp_Array1OfVec& DP1,
|
||||
{
|
||||
Standard_Real dw1 = DW1(ii), dw2 = DW2(ii);
|
||||
d2w = (dw2 - dw1) / pas;
|
||||
if (Abs(d2w - D2Weights(ii)) > wTol)
|
||||
if (std::abs(d2w - D2Weights(ii)) > wTol)
|
||||
{
|
||||
if (Affich)
|
||||
{
|
||||
@@ -654,14 +654,14 @@ void GeomFill_NSections::ComputeSurface()
|
||||
Ui2 = ULast;
|
||||
Standard_Integer i1, i2;
|
||||
myRefSurf->LocateU(Ui1, Precision::PConfusion(), i1, i2);
|
||||
if (Abs(Ui1 - myRefSurf->UKnot(i1)) <= Precision::PConfusion())
|
||||
if (std::abs(Ui1 - myRefSurf->UKnot(i1)) <= Precision::PConfusion())
|
||||
Ui1 = myRefSurf->UKnot(i1);
|
||||
if (Abs(Ui1 - myRefSurf->UKnot(i2)) <= Precision::PConfusion())
|
||||
if (std::abs(Ui1 - myRefSurf->UKnot(i2)) <= Precision::PConfusion())
|
||||
Ui1 = myRefSurf->UKnot(i2);
|
||||
myRefSurf->LocateU(Ui2, Precision::PConfusion(), i1, i2);
|
||||
if (Abs(Ui2 - myRefSurf->UKnot(i1)) <= Precision::PConfusion())
|
||||
if (std::abs(Ui2 - myRefSurf->UKnot(i1)) <= Precision::PConfusion())
|
||||
Ui2 = myRefSurf->UKnot(i1);
|
||||
if (Abs(Ui2 - myRefSurf->UKnot(i2)) <= Precision::PConfusion())
|
||||
if (std::abs(Ui2 - myRefSurf->UKnot(i2)) <= Precision::PConfusion())
|
||||
Ui2 = myRefSurf->UKnot(i2);
|
||||
V0 = myRefSurf->VKnot(myRefSurf->FirstVKnotIndex());
|
||||
V1 = myRefSurf->VKnot(myRefSurf->LastVKnotIndex());
|
||||
@@ -930,7 +930,7 @@ Standard_Boolean GeomFill_NSections::IsConstant(Standard_Real& Error) const
|
||||
Standard_Real Tol = 1.e-7;
|
||||
Standard_Boolean samedir, samerad, samepos;
|
||||
samedir = (C1.Axis().IsParallel(C2.Axis(), 1.e-4));
|
||||
samerad = (Abs(C1.Radius() - C2.Radius()) < Tol);
|
||||
samerad = (std::abs(C1.Radius() - C2.Radius()) < Tol);
|
||||
samepos = (C1.Location().Distance(C2.Location()) < Tol);
|
||||
if (!samepos)
|
||||
{
|
||||
@@ -948,7 +948,7 @@ Standard_Boolean GeomFill_NSections::IsConstant(Standard_Real& Error) const
|
||||
samedir = (L1.Direction().IsParallel(L2.Direction(), 1.e-4));
|
||||
gp_Pnt P11 = AC1.Value(AC1.FirstParameter()), P12 = AC1.Value(AC1.LastParameter()),
|
||||
P21 = AC2.Value(AC2.FirstParameter()), P22 = AC2.Value(AC2.LastParameter());
|
||||
samelength = (Abs(P11.Distance(P12) - P21.Distance(P22)) < Tol);
|
||||
samelength = (std::abs(P11.Distance(P12) - P21.Distance(P22)) < Tol);
|
||||
// l'ecart entre les 2 sections ne compte pas
|
||||
samepos = ((P11.Distance(P21) < Tol && P12.Distance(P22) < Tol)
|
||||
|| (P12.Distance(P21) < Tol && P11.Distance(P22) < Tol));
|
||||
@@ -1006,7 +1006,7 @@ Standard_Boolean GeomFill_NSections::IsConicalLaw(Standard_Real& Error) const
|
||||
// formule plus generale pour 3 sections au moins
|
||||
// Standard_Real param0 = C2.Radius()*myParams(1) - C1.Radius()*myParams(2);
|
||||
// param0 = param0 / (C2.Radius()-C1.Radius()) ;
|
||||
// linearrad = ( Abs( C3.Radius()*myParams(1)-C1.Radius()*myParams(3)
|
||||
// linearrad = ( std::abs( C3.Radius()*myParams(1)-C1.Radius()*myParams(3)
|
||||
// - param0*(C3.Radius()-C1.Radius()) ) < Tol);
|
||||
if (isconic)
|
||||
{
|
||||
@@ -1025,8 +1025,8 @@ Standard_Boolean GeomFill_NSections::IsConicalLaw(Standard_Real& Error) const
|
||||
//// Modified by jgv, 18.02.2009 for OCC20866 ////
|
||||
Standard_Real first1 = AC1.FirstParameter(), last1 = AC1.LastParameter();
|
||||
Standard_Real first2 = AC2.FirstParameter(), last2 = AC2.LastParameter();
|
||||
isconic = (Abs(first1 - first2) <= Precision::PConfusion()
|
||||
&& Abs(last1 - last2) <= Precision::PConfusion());
|
||||
isconic = (std::abs(first1 - first2) <= Precision::PConfusion()
|
||||
&& std::abs(last1 - last2) <= Precision::PConfusion());
|
||||
//////////////////////////////////////////////////
|
||||
}
|
||||
}
|
||||
@@ -1061,7 +1061,7 @@ Handle(Geom_Curve) GeomFill_NSections::CirclSection(const Standard_Real V) const
|
||||
const Standard_Real aParL = AC1.LastParameter();
|
||||
const Standard_Real aPeriod = AC1.IsPeriodic() ? AC1.Period() : 0.0;
|
||||
|
||||
if ((aPeriod == 0.0) || (Abs(aParL - aParF - aPeriod) > Precision::PConfusion()))
|
||||
if ((aPeriod == 0.0) || (std::abs(aParL - aParF - aPeriod) > Precision::PConfusion()))
|
||||
{
|
||||
Handle(Geom_Curve) Cbis = new Geom_TrimmedCurve(C, aParF, aParL);
|
||||
C = Cbis;
|
||||
|
||||
@@ -90,7 +90,7 @@ static Standard_Boolean CheckSense(const TColGeom_SequenceOfCurve& Seq1,
|
||||
Standard_Real f = C1->FirstParameter(), l = C1->LastParameter();
|
||||
Standard_Integer iP, NP = 21;
|
||||
TColgp_Array1OfPnt Tab(1, NP);
|
||||
Standard_Real u = f, h = Abs(f - l) / 20.;
|
||||
Standard_Real u = f, h = std::abs(f - l) / 20.;
|
||||
for (iP = 1; iP <= NP; iP++)
|
||||
{
|
||||
C1->D0(u, Tab(iP));
|
||||
@@ -163,12 +163,12 @@ static Standard_Boolean CheckSense(const TColGeom_SequenceOfCurve& Seq1,
|
||||
|
||||
// meme sens ?
|
||||
Standard_Boolean ok = Standard_True,
|
||||
pasnul1 = (Abs(alpha1) > Precision::Confusion())
|
||||
&& (Abs(beta1) > Precision::Confusion()),
|
||||
pasnul2 = (Abs(alpha2) > Precision::Confusion())
|
||||
&& (Abs(beta2) > Precision::Confusion()),
|
||||
pasnul3 = (Abs(alpha3) > Precision::Confusion())
|
||||
&& (Abs(beta3) > Precision::Confusion());
|
||||
pasnul1 = (std::abs(alpha1) > Precision::Confusion())
|
||||
&& (std::abs(beta1) > Precision::Confusion()),
|
||||
pasnul2 = (std::abs(alpha2) > Precision::Confusion())
|
||||
&& (std::abs(beta2) > Precision::Confusion()),
|
||||
pasnul3 = (std::abs(alpha3) > Precision::Confusion())
|
||||
&& (std::abs(beta3) > Precision::Confusion());
|
||||
if (pasnul1 && pasnul2 && pasnul3)
|
||||
{
|
||||
if (alpha1 * beta1 > 0.0)
|
||||
@@ -681,7 +681,7 @@ void GeomFill_Pipe::Init(const Handle(Geom_Curve)& Path, const TColGeom_Sequence
|
||||
}
|
||||
for (i = 1; i < NSections.Length(); i++)
|
||||
{
|
||||
if (Abs(SeqP.Value(i + 1) - SeqP.Value(i)) < Precision::PConfusion())
|
||||
if (std::abs(SeqP.Value(i + 1) - SeqP.Value(i)) < Precision::PConfusion())
|
||||
{
|
||||
throw Standard_ConstructionError("GeomFill_Pipe::Init with NSections : invalid parameters");
|
||||
}
|
||||
@@ -911,7 +911,7 @@ Standard_Boolean GeomFill_Pipe::KPartT4()
|
||||
Standard_Real L0 = myAdpPath->LastParameter() - myAdpPath->FirstParameter();
|
||||
Standard_Real L1 = myAdpFirstSect->LastParameter() - myAdpFirstSect->FirstParameter();
|
||||
Standard_Real L2 = myAdpLastSect->LastParameter() - myAdpLastSect->FirstParameter();
|
||||
if (Abs(L1 - L0) > Precision::Confusion() || Abs(L2 - L0) > Precision::Confusion())
|
||||
if (std::abs(L1 - L0) > Precision::Confusion() || std::abs(L2 - L0) > Precision::Confusion())
|
||||
{
|
||||
return Ok;
|
||||
}
|
||||
@@ -922,7 +922,8 @@ Standard_Boolean GeomFill_Pipe::KPartT4()
|
||||
gp_Pnt P2 = myAdpLastSect->Value(myAdpLastSect->FirstParameter());
|
||||
gp_Dir V1(gp_Vec(P0, P1));
|
||||
gp_Dir V2(gp_Vec(P0, P2));
|
||||
if (Abs(V1.Dot(D0)) > Precision::Confusion() || Abs(V2.Dot(D0)) > Precision::Confusion())
|
||||
if (std::abs(V1.Dot(D0)) > Precision::Confusion()
|
||||
|| std::abs(V2.Dot(D0)) > Precision::Confusion())
|
||||
return Ok;
|
||||
|
||||
// the result is a cylindrical surface.
|
||||
@@ -956,7 +957,8 @@ Standard_Boolean GeomFill_Pipe::KPartT4()
|
||||
Standard_Real Alp1 = myAdpFirstSect->FirstParameter() - myAdpFirstSect->LastParameter();
|
||||
Standard_Real Alp2 = myAdpLastSect->FirstParameter() - myAdpLastSect->LastParameter();
|
||||
|
||||
if (Abs(Alp0 - Alp1) > Precision::Angular() || Abs(Alp0 - Alp2) > Precision::Angular())
|
||||
if (std::abs(Alp0 - Alp1) > Precision::Angular()
|
||||
|| std::abs(Alp0 - Alp2) > Precision::Angular())
|
||||
return Ok;
|
||||
|
||||
gp_Ax2 A0 = myAdpPath->Circle().Position();
|
||||
@@ -984,7 +986,8 @@ Standard_Boolean GeomFill_Pipe::KPartT4()
|
||||
gp_Dir V2(gp_Vec(P0, P2));
|
||||
gp_Circ Ci = myAdpPath->Circle();
|
||||
gp_Vec YRef = ElCLib::CircleDN(myAdpPath->FirstParameter(), A0, Ci.Radius(), 1);
|
||||
if (Abs(V1.Dot(YRef)) > Precision::Confusion() || Abs(V2.Dot(YRef)) > Precision::Confusion())
|
||||
if (std::abs(V1.Dot(YRef)) > Precision::Confusion()
|
||||
|| std::abs(V2.Dot(YRef)) > Precision::Confusion())
|
||||
return Ok;
|
||||
|
||||
// OK it`s a Toroidal Surface !! OUF !!
|
||||
|
||||
@@ -80,9 +80,9 @@ void GeomFill_PolynomialConvertor::Init()
|
||||
for (ii = 1; ii <= Ordre; ii++)
|
||||
{
|
||||
terme = Poles1d->Value(ii, jj);
|
||||
if (Abs(terme - 1) < 1.e-9)
|
||||
if (std::abs(terme - 1) < 1.e-9)
|
||||
terme = 1; // petite retouche
|
||||
if (Abs(terme + 1) < 1.e-9)
|
||||
if (std::abs(terme + 1) < 1.e-9)
|
||||
terme = -1;
|
||||
B(ii, jj) = terme;
|
||||
}
|
||||
@@ -107,7 +107,7 @@ void GeomFill_PolynomialConvertor::Section(const gp_Pnt& FirstPnt,
|
||||
math_Vector Vx(1, Ordre), Vy(1, Ordre);
|
||||
math_Vector Px(1, Ordre), Py(1, Ordre);
|
||||
Standard_Integer ii;
|
||||
Standard_Real Cos_b = Cos(Angle), Sin_b = Sin(Angle);
|
||||
Standard_Real Cos_b = std::cos(Angle), Sin_b = std::sin(Angle);
|
||||
Standard_Real beta, beta2, beta3;
|
||||
gp_Vec V1(Center, FirstPnt), V2;
|
||||
V2 = Dir ^ V1;
|
||||
@@ -163,7 +163,7 @@ void GeomFill_PolynomialConvertor::Section(const gp_Pnt& FirstPnt,
|
||||
math_Vector Vx(1, Ordre), Vy(1, Ordre), DVx(1, Ordre), DVy(1, Ordre);
|
||||
math_Vector Px(1, Ordre), Py(1, Ordre), DPx(1, Ordre), DPy(1, Ordre);
|
||||
Standard_Integer ii;
|
||||
Standard_Real Cos_b = Cos(Angle), Sin_b = Sin(Angle);
|
||||
Standard_Real Cos_b = std::cos(Angle), Sin_b = std::sin(Angle);
|
||||
Standard_Real beta, beta2, beta3, bprim;
|
||||
gp_Vec V1(Center, FirstPnt), V1Prim, V2;
|
||||
V2 = Dir ^ V1;
|
||||
@@ -255,7 +255,7 @@ void GeomFill_PolynomialConvertor::Section(const gp_Pnt& FirstPnt,
|
||||
D2Py(1, Ordre);
|
||||
|
||||
Standard_Integer ii;
|
||||
Standard_Real aux, Cos_b = Cos(Angle), Sin_b = Sin(Angle);
|
||||
Standard_Real aux, Cos_b = std::cos(Angle), Sin_b = std::sin(Angle);
|
||||
Standard_Real beta, beta2, beta3, bprim, bprim2, bsecn;
|
||||
gp_Vec V1(Center, FirstPnt), V1Prim, V1Secn, V2;
|
||||
V2 = Dir ^ V1;
|
||||
|
||||
@@ -185,7 +185,7 @@ void GeomFill_Profiler::Perform(const Standard_Real PTol)
|
||||
}
|
||||
|
||||
// evaluate the max degree
|
||||
myDegree = Max(myDegree, C->Degree());
|
||||
myDegree = std::max(myDegree, C->Degree());
|
||||
|
||||
// Calcul de Max ( Ufin - Udeb) sur l ensemble des courbes.
|
||||
if ((U2 - U1) > EcartMax)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#define NullAngle 1.e-6
|
||||
|
||||
// QuasiAngular is rational definition of Cos(theta(t) and sin(theta)
|
||||
// QuasiAngular is rational definition of std::cos(theta(t) and sin(theta)
|
||||
// on [-alpha, +alpha] with
|
||||
// 2 2
|
||||
// U - V
|
||||
@@ -98,9 +98,9 @@ void GeomFill_QuasiAngularConvertor::Init()
|
||||
for (ii = 1; ii <= Ordre; ii++)
|
||||
{
|
||||
terme = Poles1d->Value(ii, jj);
|
||||
if (Abs(terme - 1) < 1.e-9)
|
||||
if (std::abs(terme - 1) < 1.e-9)
|
||||
terme = 1; // petite retouche
|
||||
if (Abs(terme + 1) < 1.e-9)
|
||||
if (std::abs(terme + 1) < 1.e-9)
|
||||
terme = -1;
|
||||
B(ii, jj) = terme;
|
||||
}
|
||||
@@ -148,7 +148,7 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt,
|
||||
|
||||
if ((M_PI / 2 - beta) > NullAngle)
|
||||
{
|
||||
if (Abs(beta) < NullAngle)
|
||||
if (std::abs(beta) < NullAngle)
|
||||
{
|
||||
Standard_Real cf = 2.0 / (3 * 5 * 7);
|
||||
b = -(0.2 + cf * beta2) / (1 + 0.2 * beta2);
|
||||
@@ -156,7 +156,7 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt,
|
||||
}
|
||||
else
|
||||
{
|
||||
tan_b = Tan(beta);
|
||||
tan_b = std::tan(beta);
|
||||
b = -1.0e0 / beta2;
|
||||
b += beta / (3 * (tan_b - beta));
|
||||
}
|
||||
@@ -232,8 +232,8 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt,
|
||||
// La derive s'ecrit donc :
|
||||
// AngPrim * (sin(Ang)*D*D + cos(Ang)*D)
|
||||
// + sin(Ang)*DPrim + (1. - cos(Ang)) *(DPrim*D + D*DPrim)
|
||||
Sina = Sin(Angle / 2);
|
||||
Cosa = Cos(Angle / 2);
|
||||
Sina = std::sin(Angle / 2);
|
||||
Cosa = std::cos(Angle / 2);
|
||||
D.SetCross(Dir.XYZ());
|
||||
DPrim.SetCross(DDir.XYZ());
|
||||
|
||||
@@ -263,7 +263,7 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt,
|
||||
beta5 = beta3 * beta2;
|
||||
beta6 = beta3 * beta3;
|
||||
|
||||
if (Abs(beta) < NullAngle)
|
||||
if (std::abs(beta) < NullAngle)
|
||||
{
|
||||
// On calcul b par D.L
|
||||
Standard_Real cf = 2.0 / (3 * 5 * 7);
|
||||
@@ -279,7 +279,7 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt,
|
||||
bpr = (2 * betaprim) / beta3;
|
||||
if ((M_PI / 2 - beta) > NullAngle)
|
||||
{
|
||||
tan_b = Tan(beta);
|
||||
tan_b = std::tan(beta);
|
||||
dtan_b = betaprim * (1 + tan_b * tan_b);
|
||||
b2 = tan_b - beta;
|
||||
b += beta / (3 * b2);
|
||||
@@ -388,8 +388,8 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt,
|
||||
// La derive s'ecrit donc :
|
||||
// AngPrim * (sin(Ang)*D*D + cos(Ang)*D)
|
||||
// + sin(Ang)*DPrim + (1. - cos(Ang)) *(DPrim*D + D*DPrim)
|
||||
Sina = Sin(Angle / 2);
|
||||
Cosa = Cos(Angle / 2);
|
||||
Sina = std::sin(Angle / 2);
|
||||
Cosa = std::cos(Angle / 2);
|
||||
D.SetCross(Dir.XYZ());
|
||||
DPrim.SetCross(DDir.XYZ());
|
||||
DSecn.SetCross(D2Dir.XYZ());
|
||||
@@ -453,7 +453,7 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt,
|
||||
beta6 = beta3 * beta3;
|
||||
betaprim2 = betaprim * betaprim;
|
||||
|
||||
if (Abs(beta) < NullAngle)
|
||||
if (std::abs(beta) < NullAngle)
|
||||
{
|
||||
// On calcul b par D.L
|
||||
Standard_Real cf = -2.0 / 21;
|
||||
@@ -472,7 +472,7 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt,
|
||||
bsc = (2 * betasecn - 6 * betaprim * (betaprim / beta)) / beta3;
|
||||
if ((M_PI / 2 - beta) > NullAngle)
|
||||
{
|
||||
tan_b = Tan(beta);
|
||||
tan_b = std::tan(beta);
|
||||
dtan_b = betaprim * (1 + tan_b * tan_b);
|
||||
d2tan_b = betasecn * (1 + tan_b * tan_b) + 2 * betaprim * tan_b * dtan_b;
|
||||
b2 = tan_b - beta;
|
||||
@@ -558,7 +558,7 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt,
|
||||
|
||||
D2P.SetCoord(D2Px(ii) / wi, D2Py(ii) / wi, 0);
|
||||
D2P -= 2 * (dwi / wi) * DP;
|
||||
D2P += (2 * Pow(dwi / wi, 2) - D2W(ii) / wi) * P;
|
||||
D2P += (2 * std::pow(dwi / wi, 2) - D2W(ii) / wi) * P;
|
||||
DP -= (DW(ii) / wi) * P;
|
||||
|
||||
Poles(ii).ChangeCoord() = M * P + Center.XYZ();
|
||||
|
||||
@@ -73,9 +73,9 @@ static Standard_Real Penalite(const Standard_Real angle, const Standard_Real dis
|
||||
Standard_Real penal;
|
||||
|
||||
if (dist < 1)
|
||||
penal = Sqrt(dist);
|
||||
penal = std::sqrt(dist);
|
||||
else if (dist < 2)
|
||||
penal = Pow(dist, 2);
|
||||
penal = std::pow(dist, 2);
|
||||
else
|
||||
penal = dist + 2;
|
||||
|
||||
@@ -185,7 +185,7 @@ GeomFill_SectionPlacement::GeomFill_SectionPlacement(const Handle(GeomFill_Locat
|
||||
Standard_Real DX = aXmax - aXmin;
|
||||
Standard_Real DY = aYmax - aYmin;
|
||||
Standard_Real DZ = aZmax - aZmin;
|
||||
Gabarit = Sqrt(DX * DX + DY * DY + DZ * DZ) / 2.;
|
||||
Gabarit = std::sqrt(DX * DX + DY * DY + DZ * DZ) / 2.;
|
||||
|
||||
Gabarit += Precision::Confusion(); // Cas des toute petite
|
||||
|
||||
@@ -252,11 +252,11 @@ GeomFill_SectionPlacement::GeomFill_SectionPlacement(const Handle(GeomFill_Locat
|
||||
aCurve = (Handle(Geom_TrimmedCurve)::DownCast(aCurve))->BasisCurve();
|
||||
Standard_Real Ufirst = aCurve->FirstParameter();
|
||||
Standard_Real aPeriod = aCurve->Period();
|
||||
Standard_Real U1 = Ufirst + Floor((first - Ufirst) / aPeriod) * aPeriod;
|
||||
Standard_Real U1 = Ufirst + std::floor((first - Ufirst) / aPeriod) * aPeriod;
|
||||
Standard_Real U2 = U1 + aPeriod;
|
||||
if (Abs(first - U1) <= Precision::PConfusion())
|
||||
if (std::abs(first - U1) <= Precision::PConfusion())
|
||||
first = U1;
|
||||
if (Abs(last - U2) <= Precision::PConfusion())
|
||||
if (std::abs(last - U2) <= Precision::PConfusion())
|
||||
last = U2;
|
||||
}
|
||||
Standard_Real t, delta;
|
||||
@@ -411,13 +411,13 @@ void GeomFill_SectionPlacement::Perform(const Handle(Adaptor3d_Curve)& Path,
|
||||
// (1.1) Distances Point-Plan
|
||||
Standard_Real DistPlan;
|
||||
gp_Vec V1(PonPath, TheAxe.Location());
|
||||
DistPlan = Abs(V1.Dot(VRef));
|
||||
DistPlan = std::abs(V1.Dot(VRef));
|
||||
if (DistPlan <= IntTol)
|
||||
DistCenter = V1.Magnitude();
|
||||
|
||||
gp_Pnt Plast = Path->Value(Path->LastParameter());
|
||||
V1.SetXYZ(TheAxe.Location().XYZ() - Plast.XYZ());
|
||||
DistPlan = Abs(V1.Dot(VRef));
|
||||
DistPlan = std::abs(V1.Dot(VRef));
|
||||
if (DistPlan <= IntTol)
|
||||
{
|
||||
Standard_Real aDist = V1.Magnitude();
|
||||
@@ -462,8 +462,8 @@ void GeomFill_SectionPlacement::Perform(const Handle(Adaptor3d_Curve)& Path,
|
||||
Standard_Real firstDistance = plane.SquareDistance(firstPoint);
|
||||
Standard_Real lastDistance = plane.SquareDistance(lastPoint);
|
||||
|
||||
if (((Abs(firstDistance) < Precision::SquareConfusion())
|
||||
&& Abs(lastDistance) < Precision::SquareConfusion())
|
||||
if (((std::abs(firstDistance) < Precision::SquareConfusion())
|
||||
&& std::abs(lastDistance) < Precision::SquareConfusion())
|
||||
|| firstDistance < lastDistance)
|
||||
{
|
||||
PathParam = Path->FirstParameter();
|
||||
@@ -492,13 +492,13 @@ void GeomFill_SectionPlacement::Perform(const Handle(Adaptor3d_Curve)& Path,
|
||||
// (1.1) Distances Point-Plan
|
||||
Standard_Real DistPlan;
|
||||
gp_Vec V1 (PonPath, TheAxe.Location());
|
||||
DistPlan = Abs(V1.Dot(VRef));
|
||||
DistPlan = std::abs(V1.Dot(VRef));
|
||||
|
||||
// On examine l'autre extremite
|
||||
gp_Pnt P;
|
||||
Tangente(Path->Curve(), Path->LastParameter(), P, dp1);
|
||||
V1.SetXYZ(TheAxe.Location().XYZ()-P.XYZ());
|
||||
if (Abs(V1.Dot(VRef)) <= DistPlan ) { // On prend l'autre extremite
|
||||
if (std::abs(V1.Dot(VRef)) <= DistPlan ) { // On prend l'autre extremite
|
||||
alpha = M_PI/2 - EvalAngle(VRef, dp1);
|
||||
distaux = PonPath.Distance(PonSec);
|
||||
if (distaux > Tol) {
|
||||
@@ -921,7 +921,7 @@ Standard_Boolean GeomFill_SectionPlacement::Choix(const Standard_Real dist,
|
||||
return Standard_True;
|
||||
|
||||
// (2) si l'ecart en distance est de l'ordre du gabarit
|
||||
if (Abs(evoldist) < Gabarit)
|
||||
if (std::abs(evoldist) < Gabarit)
|
||||
{
|
||||
// (2.1) si le gain en angle est important on garde
|
||||
if (evolangle > 0.5)
|
||||
|
||||
@@ -587,7 +587,7 @@ Standard_Boolean GeomFill_Sweep::BuildKPart()
|
||||
gp_Mat M;
|
||||
Standard_Real levier, error = 0;
|
||||
Standard_Real UFirst = 0, VFirst = First, ULast = 0, VLast = Last;
|
||||
Standard_Real Tol = Min(Tol3d, BoundTol);
|
||||
Standard_Real Tol = std::min(Tol3d, BoundTol);
|
||||
|
||||
// (1) Trajectoire Rectilignes -------------------------
|
||||
if (myLoc->IsTranslation(error))
|
||||
@@ -647,8 +647,8 @@ Standard_Boolean GeomFill_Sweep::BuildKPart()
|
||||
L.Transform(Tf2);
|
||||
DS.SetXYZ(L.Position().Direction().XYZ());
|
||||
DS.Normalize();
|
||||
levier = Abs(DS.Dot(DP));
|
||||
SError = error + levier * Abs(Last - First);
|
||||
levier = std::abs(DS.Dot(DP));
|
||||
SError = error + levier * std::abs(Last - First);
|
||||
if (SError <= Tol)
|
||||
{
|
||||
Ok = Standard_True;
|
||||
@@ -669,8 +669,8 @@ Standard_Boolean GeomFill_Sweep::BuildKPart()
|
||||
|
||||
DS.SetXYZ(C.Position().Direction().XYZ());
|
||||
DS.Normalize();
|
||||
levier = Abs(DS.CrossMagnitude(DP)) * C.Radius();
|
||||
SError = levier * Abs(Last - First);
|
||||
levier = std::abs(DS.CrossMagnitude(DP)) * C.Radius();
|
||||
SError = levier * std::abs(Last - First);
|
||||
if (SError <= TolProd)
|
||||
{
|
||||
Ok = Standard_True;
|
||||
@@ -760,8 +760,8 @@ Standard_Boolean GeomFill_Sweep::BuildKPart()
|
||||
gp_Ax3 Axis(Centre0, Dir, N);
|
||||
S = new (Geom_ConicalSurface)(Axis, Angle, C.Radius());
|
||||
// Calcul du glissement parametrique
|
||||
VFirst = First / Cos(Angle);
|
||||
VLast = Last / Cos(Angle);
|
||||
VFirst = First / std::cos(Angle);
|
||||
VLast = Last / std::cos(Angle);
|
||||
|
||||
// Bornes en U
|
||||
UFirst = AC.FirstParameter();
|
||||
@@ -794,7 +794,7 @@ Standard_Boolean GeomFill_Sweep::BuildKPart()
|
||||
{
|
||||
// La trajectoire
|
||||
gp_Pnt Centre;
|
||||
isVPeriodic = (Abs(Last - First - 2 * M_PI) < 1.e-15);
|
||||
isVPeriodic = (std::abs(Last - First - 2 * M_PI) < 1.e-15);
|
||||
Standard_Real RotRadius;
|
||||
gp_Vec DP, DS, DN;
|
||||
myLoc->D0(0.1, M, DS);
|
||||
@@ -866,10 +866,10 @@ Standard_Boolean GeomFill_Sweep::BuildKPart()
|
||||
gp_Vec NC;
|
||||
NC.SetXYZ(C.Position().Direction().XYZ());
|
||||
NC.Normalize();
|
||||
error = Abs(NC.Dot(DN));
|
||||
error = std::abs(NC.Dot(DN));
|
||||
// Puis on evalue l'erreur commise sur la section,
|
||||
// en pivotant son plan ( pour contenir l'axe de rotation)
|
||||
error += Abs(NC.Dot(DS));
|
||||
error += std::abs(NC.Dot(DS));
|
||||
error *= C.Radius();
|
||||
if (error <= Tol)
|
||||
{
|
||||
@@ -910,7 +910,8 @@ Standard_Boolean GeomFill_Sweep::BuildKPart()
|
||||
isUReversed = Standard_True;
|
||||
}
|
||||
|
||||
if (Abs(l - f) <= Precision::PConfusion() || Abs(UlastOnSec - UfirstOnSec) > M_PI_2)
|
||||
if (std::abs(l - f) <= Precision::PConfusion()
|
||||
|| std::abs(UlastOnSec - UfirstOnSec) > M_PI_2)
|
||||
{
|
||||
// l == f - "degenerated" surface
|
||||
// UlastOnSec - UfirstOnSec > M_PI_2 - "twisted" surface,
|
||||
@@ -964,7 +965,7 @@ Standard_Boolean GeomFill_Sweep::BuildKPart()
|
||||
myExchUV = Standard_True;
|
||||
// Attention l'arete de couture dans le cas periodique
|
||||
// n'est peut etre pas a la bonne place...
|
||||
if (isUPeriodic && Abs(UFirst) > Precision::PConfusion())
|
||||
if (isUPeriodic && std::abs(UFirst) > Precision::PConfusion())
|
||||
isUPeriodic = Standard_False; // Pour trimmer la surface...
|
||||
Ok = Standard_True;
|
||||
}
|
||||
@@ -981,9 +982,9 @@ Standard_Boolean GeomFill_Sweep::BuildKPart()
|
||||
L.Transform(Tf2);
|
||||
gp_Vec DL;
|
||||
DL.SetXYZ(L.Direction().XYZ());
|
||||
levier = Max(Abs(AC.FirstParameter()), AC.LastParameter());
|
||||
levier = std::max(std::abs(AC.FirstParameter()), AC.LastParameter());
|
||||
// si la line est ortogonale au cercle de rotation
|
||||
SError = error + levier * Abs(DL.Dot(DP));
|
||||
SError = error + levier * std::abs(DL.Dot(DP));
|
||||
if (SError <= Tol)
|
||||
{
|
||||
Standard_Boolean reverse;
|
||||
@@ -1020,7 +1021,7 @@ Standard_Boolean GeomFill_Sweep::BuildKPart()
|
||||
else
|
||||
{
|
||||
// On evalue l'angle du cone
|
||||
Standard_Real Angle = Abs(Dir.Angle(L));
|
||||
Standard_Real Angle = std::abs(Dir.Angle(L));
|
||||
if (Angle > M_PI / 2)
|
||||
Angle = M_PI - Angle;
|
||||
if (reverse)
|
||||
@@ -1030,7 +1031,7 @@ Standard_Boolean GeomFill_Sweep::BuildKPart()
|
||||
{
|
||||
Angle = -Angle;
|
||||
}
|
||||
if (Abs(Abs(Angle) - M_PI / 2) > 0.01)
|
||||
if (std::abs(std::abs(Angle) - M_PI / 2) > 0.01)
|
||||
{
|
||||
// (2.2.b) Cone
|
||||
// si les 2 droites ne sont pas orthogonales
|
||||
|
||||
@@ -507,7 +507,7 @@ Standard_Boolean GeomFill_SweepSectionGenerator::Section(const Standard_Integer
|
||||
if (DPoles(i).Magnitude() > Epsilon(1.))
|
||||
{
|
||||
DPoles(i).Normalize();
|
||||
DPoles(i) *= Sqrt(x * x + y * y);
|
||||
DPoles(i) *= std::sqrt(x * x + y * y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user