mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-06-06 21:07:36 +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:
@@ -1202,7 +1202,8 @@ void BRepTools::DetectClosedness(const TopoDS_Face& theFace,
|
||||
BRep_Tool::CurveOnSurface(TopoDS::Edge(anEdge.Reversed()), theFace, fpar, lpar);
|
||||
gp_Pnt2d Point1 = PCurve1->Value(fpar);
|
||||
gp_Pnt2d Point2 = PCurve2->Value(fpar);
|
||||
Standard_Boolean IsUiso = (Abs(Point1.X() - Point2.X()) > Abs(Point1.Y() - Point2.Y()));
|
||||
Standard_Boolean IsUiso =
|
||||
(std::abs(Point1.X() - Point2.X()) > std::abs(Point1.Y() - Point2.Y()));
|
||||
if (IsUiso)
|
||||
theUclosed = Standard_True;
|
||||
else
|
||||
@@ -1227,13 +1228,13 @@ Standard_Real BRepTools::EvalAndUpdateTol(const TopoDS_Edge& theE,
|
||||
//
|
||||
if (!C3d->IsPeriodic())
|
||||
{
|
||||
first = Max(first, C3d->FirstParameter());
|
||||
last = Min(last, C3d->LastParameter());
|
||||
first = std::max(first, C3d->FirstParameter());
|
||||
last = std::min(last, C3d->LastParameter());
|
||||
}
|
||||
if (!C2d->IsPeriodic())
|
||||
{
|
||||
first = Max(first, C2d->FirstParameter());
|
||||
last = Min(last, C2d->LastParameter());
|
||||
first = std::max(first, C2d->FirstParameter());
|
||||
last = std::min(last, C2d->LastParameter());
|
||||
}
|
||||
const Handle(Adaptor3d_Curve) aGeomAdaptorCurve = new GeomAdaptor_Curve(C3d, first, last);
|
||||
|
||||
@@ -1257,7 +1258,7 @@ Standard_Real BRepTools::EvalAndUpdateTol(const TopoDS_Edge& theE,
|
||||
// Try to estimate by sample points
|
||||
Standard_Integer nbint = 22;
|
||||
Standard_Real dt = (last - first) / nbint;
|
||||
dt = Max(dt, Precision::Confusion());
|
||||
dt = std::max(dt, Precision::Confusion());
|
||||
Standard_Real d, dmax = 0.;
|
||||
gp_Pnt2d aP2d;
|
||||
gp_Pnt aPC, aPS;
|
||||
@@ -1288,7 +1289,7 @@ Standard_Real BRepTools::EvalAndUpdateTol(const TopoDS_Edge& theE,
|
||||
}
|
||||
}
|
||||
|
||||
newtol = 1.2 * Sqrt(dmax);
|
||||
newtol = 1.2 * std::sqrt(dmax);
|
||||
}
|
||||
}
|
||||
Standard_Real Tol = BRep_Tool::Tolerance(theE);
|
||||
@@ -1440,7 +1441,8 @@ void BRepTools::CheckLocations(const TopoDS_Shape& theS, TopTools_ListOfShape& t
|
||||
const TopLoc_Location& aLoc = anS.Location();
|
||||
const gp_Trsf& aTrsf = aLoc.Transformation();
|
||||
Standard_Boolean isBadTrsf =
|
||||
aTrsf.IsNegative() || (Abs(Abs(aTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec());
|
||||
aTrsf.IsNegative()
|
||||
|| (std::abs(std::abs(aTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec());
|
||||
|
||||
if (isBadTrsf)
|
||||
{
|
||||
|
||||
@@ -394,8 +394,9 @@ public:
|
||||
const Standard_Boolean theForce = Standard_False);
|
||||
|
||||
//! Check all locations of shape according criterium:
|
||||
//! aTrsf.IsNegative() || (Abs(Abs(aTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec())
|
||||
//! All sub-shapes having such locations are put in list theProblemShapes
|
||||
//! aTrsf.IsNegative() || (std::abs(std::abs(aTrsf.ScaleFactor()) - 1.) >
|
||||
//! TopLoc_Location::ScalePrec()) All sub-shapes having such locations are put in list
|
||||
//! theProblemShapes
|
||||
Standard_EXPORT static void CheckLocations(const TopoDS_Shape& theS,
|
||||
TopTools_ListOfShape& theProblemShapes);
|
||||
};
|
||||
|
||||
@@ -46,17 +46,17 @@ BRepTools_GTrsfModification::BRepTools_GTrsfModification(const gp_GTrsf& T)
|
||||
// on prend comme dilatation maximale pour la tolerance la norme sup
|
||||
Standard_Real loc1, loc2, loc3, loc4;
|
||||
|
||||
loc1 = Max(Abs(T.Value(1, 1)), Abs(T.Value(1, 2)));
|
||||
loc2 = Max(Abs(T.Value(2, 1)), Abs(T.Value(2, 2)));
|
||||
loc3 = Max(Abs(T.Value(3, 1)), Abs(T.Value(3, 2)));
|
||||
loc4 = Max(Abs(T.Value(1, 3)), Abs(T.Value(2, 3)));
|
||||
loc1 = std::max(std::abs(T.Value(1, 1)), std::abs(T.Value(1, 2)));
|
||||
loc2 = std::max(std::abs(T.Value(2, 1)), std::abs(T.Value(2, 2)));
|
||||
loc3 = std::max(std::abs(T.Value(3, 1)), std::abs(T.Value(3, 2)));
|
||||
loc4 = std::max(std::abs(T.Value(1, 3)), std::abs(T.Value(2, 3)));
|
||||
|
||||
loc1 = Max(loc1, loc2);
|
||||
loc2 = Max(loc3, loc4);
|
||||
loc1 = std::max(loc1, loc2);
|
||||
loc2 = std::max(loc3, loc4);
|
||||
|
||||
loc1 = Max(loc1, loc2);
|
||||
loc1 = std::max(loc1, loc2);
|
||||
|
||||
myGScale = Max(loc1, Abs(T.Value(3, 3)));
|
||||
myGScale = std::max(loc1, std::abs(T.Value(3, 3)));
|
||||
}
|
||||
|
||||
//=================================================================================================
|
||||
@@ -260,7 +260,7 @@ Standard_Boolean BRepTools_GTrsfModification::NewTriangulation(
|
||||
|
||||
theTriangulation = theTriangulation->Copy();
|
||||
theTriangulation->SetCachedMinMax(Bnd_Box()); // clear bounding box
|
||||
theTriangulation->Deflection(theTriangulation->Deflection() * Abs(myGScale));
|
||||
theTriangulation->Deflection(theTriangulation->Deflection() * std::abs(myGScale));
|
||||
// apply transformation to 3D nodes
|
||||
for (Standard_Integer anInd = 1; anInd <= theTriangulation->NbNodes(); ++anInd)
|
||||
{
|
||||
@@ -317,7 +317,7 @@ Standard_Boolean BRepTools_GTrsfModification::NewPolygon(const TopoDS_Edge&
|
||||
aGTrsf.Multiply(aLoc.Transformation());
|
||||
|
||||
thePoly = thePoly->Copy();
|
||||
thePoly->Deflection(thePoly->Deflection() * Abs(myGScale));
|
||||
thePoly->Deflection(thePoly->Deflection() * std::abs(myGScale));
|
||||
// transform nodes
|
||||
TColgp_Array1OfPnt& aNodesArray = thePoly->ChangeNodes();
|
||||
for (Standard_Integer anId = aNodesArray.Lower(); anId <= aNodesArray.Upper(); ++anId)
|
||||
|
||||
@@ -257,24 +257,24 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewSurface(const TopoDS_Fac
|
||||
V2 = curvV2;
|
||||
S->Bounds(surfU1, surfU2, surfV1, surfV2);
|
||||
|
||||
if (Abs(U1 - surfU1) <= TolPar)
|
||||
if (std::abs(U1 - surfU1) <= TolPar)
|
||||
U1 = surfU1;
|
||||
if (Abs(U2 - surfU2) <= TolPar)
|
||||
if (std::abs(U2 - surfU2) <= TolPar)
|
||||
U2 = surfU2;
|
||||
if (Abs(V1 - surfV1) <= TolPar)
|
||||
if (std::abs(V1 - surfV1) <= TolPar)
|
||||
V1 = surfV1;
|
||||
if (Abs(V2 - surfV2) <= TolPar)
|
||||
if (std::abs(V2 - surfV2) <= TolPar)
|
||||
V2 = surfV2;
|
||||
|
||||
if (!IsUp)
|
||||
{
|
||||
U1 = Max(surfU1, curvU1);
|
||||
U2 = Min(surfU2, curvU2);
|
||||
U1 = std::max(surfU1, curvU1);
|
||||
U2 = std::min(surfU2, curvU2);
|
||||
}
|
||||
if (!IsVp)
|
||||
{
|
||||
V1 = Max(surfV1, curvV1);
|
||||
V2 = Min(surfV2, curvV2);
|
||||
V1 = std::max(surfV1, curvV1);
|
||||
V2 = std::min(surfV2, curvV2);
|
||||
}
|
||||
//<-OCC466(apo)
|
||||
|
||||
@@ -291,49 +291,8 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewSurface(const TopoDS_Fac
|
||||
V2 = V1 + Vp;
|
||||
}
|
||||
|
||||
/*
|
||||
if(IsUp && IsVp) {
|
||||
Standard_Real dU = Abs(U2 - U1), dV = Abs(V2 - V1);
|
||||
Standard_Real Up = S->UPeriod(), Vp = S->VPeriod();
|
||||
if(Abs(dU - Up) <= TolPar && U2 <= Up) {
|
||||
if(Abs(dV - Vp) <= TolPar && V2 <= Vp) { }
|
||||
else {
|
||||
SS = new Geom_RectangularTrimmedSurface(S, V1+1e-9, V2-1e-9, Standard_False);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(Abs(dV - Vp) <= TolPar && V2 <= Vp)
|
||||
SS = new Geom_RectangularTrimmedSurface(S, U1+1e-9, U2-1e-9, Standard_True);
|
||||
else
|
||||
SS = new Geom_RectangularTrimmedSurface(S, U1+1e-9, U2-1e-9, V1+1e-9, V2-1e-9);
|
||||
}
|
||||
}
|
||||
|
||||
if(IsUp && !IsVp) {
|
||||
Standard_Real dU = Abs(U2 - U1);
|
||||
Standard_Real Up = S->UPeriod();
|
||||
if(Abs(dU - Up) <= TolPar && U2 <= Up)
|
||||
SS = new Geom_RectangularTrimmedSurface(S, V1+1e-9, V2-1e-9, Standard_False);
|
||||
else
|
||||
SS = new Geom_RectangularTrimmedSurface(S, U1+1e-9, U2-1e-9, V1+1e-9, V2-1e-9);
|
||||
}
|
||||
|
||||
if(!IsUp && IsVp) {
|
||||
Standard_Real dV = Abs(V2 - V1);
|
||||
Standard_Real Vp = S->VPeriod();
|
||||
if(Abs(dV - Vp) <= TolPar && V2 <= Vp)
|
||||
SS = new Geom_RectangularTrimmedSurface(S, U1+1e-9, U2-1e-9, Standard_True);
|
||||
else
|
||||
SS = new Geom_RectangularTrimmedSurface(S, U1+1e-9, U2-1e-9, V1+1e-9, V2-1e-9);
|
||||
}
|
||||
|
||||
if(!IsUp && !IsVp) {
|
||||
SS = new Geom_RectangularTrimmedSurface(S, U1+1e-9, U2-1e-9, V1+1e-9, V2-1e-9);
|
||||
}
|
||||
*/
|
||||
|
||||
if (Abs(surfU1 - U1) > Tol || Abs(surfU2 - U2) > Tol || Abs(surfV1 - V1) > Tol
|
||||
|| Abs(surfV2 - V2) > Tol)
|
||||
if (std::abs(surfU1 - U1) > Tol || std::abs(surfU2 - U2) > Tol || std::abs(surfV1 - V1) > Tol
|
||||
|| std::abs(surfV2 - V2) > Tol)
|
||||
S = new Geom_RectangularTrimmedSurface(S, U1, U2, V1, V2);
|
||||
S->Bounds(surfU1, surfU2, surfV1, surfV2);
|
||||
|
||||
@@ -345,11 +304,11 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewSurface(const TopoDS_Fac
|
||||
// on recadre les bornes de S sinon les anciennes PCurves sont aux fraises
|
||||
//
|
||||
|
||||
if (Abs(curvU1 - surfU1) > UTol && !BS->IsUPeriodic())
|
||||
if (std::abs(curvU1 - surfU1) > UTol && !BS->IsUPeriodic())
|
||||
{
|
||||
GeomLib_ChangeUBounds(BS, U1, U2);
|
||||
}
|
||||
if (Abs(curvV1 - surfV1) > VTol && !BS->IsVPeriodic())
|
||||
if (std::abs(curvV1 - surfV1) > VTol && !BS->IsVPeriodic())
|
||||
{
|
||||
GeomLib_ChangeVBounds(BS, V1, V2);
|
||||
}
|
||||
@@ -457,8 +416,8 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve(const TopoDS_Edge&
|
||||
if (C->IsPeriodic())
|
||||
{
|
||||
Standard_Real p = C->Period();
|
||||
Standard_Real d = Abs(l - f);
|
||||
if (Abs(d - p) <= TolPar && l <= p)
|
||||
Standard_Real d = std::abs(l - f);
|
||||
if (std::abs(d - p) <= TolPar && l <= p)
|
||||
{
|
||||
}
|
||||
else
|
||||
@@ -482,7 +441,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve(const TopoDS_Edge&
|
||||
if (!BC->IsPeriodic())
|
||||
{
|
||||
BC->Resolution(Tol, UTol);
|
||||
if (Abs(f - fnew) > UTol || Abs(l - lnew) > UTol)
|
||||
if (std::abs(f - fnew) > UTol || std::abs(l - lnew) > UTol)
|
||||
{
|
||||
TColStd_Array1OfReal knots(1, BC->NbKnots());
|
||||
BC->Knots(knots);
|
||||
@@ -723,11 +682,11 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d(const TopoDS_Edg
|
||||
Standard_Real aMinDist = Precision::Infinite();
|
||||
if (S->IsUPeriodic())
|
||||
{
|
||||
aMinDist = Min(0.5 * S->UPeriod(), aMinDist);
|
||||
aMinDist = std::min(0.5 * S->UPeriod(), aMinDist);
|
||||
}
|
||||
if (S->IsVPeriodic())
|
||||
{
|
||||
aMinDist = Min(0.5 * S->VPeriod(), aMinDist);
|
||||
aMinDist = std::min(0.5 * S->VPeriod(), aMinDist);
|
||||
}
|
||||
aMinDist *= aMinDist;
|
||||
// Old domain
|
||||
@@ -938,7 +897,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewPolygonOnTriangulation(
|
||||
// update parameters of 2D polygon
|
||||
if (thePoly->HasParameters())
|
||||
{
|
||||
Standard_Real aTol = Max(BRep_Tool::Tolerance(theEdge), thePoly->Deflection());
|
||||
Standard_Real aTol = std::max(BRep_Tool::Tolerance(theEdge), thePoly->Deflection());
|
||||
TopLoc_Location aLoc;
|
||||
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(theFace, aLoc);
|
||||
Handle(Geom_Surface) aNewSurf = newSurface(myMap, theFace);
|
||||
@@ -949,7 +908,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewPolygonOnTriangulation(
|
||||
{
|
||||
// compute 2D tolerance
|
||||
GeomAdaptor_Surface aSurfAdapt(aSurf);
|
||||
Standard_Real aTol2D = Max(aSurfAdapt.UResolution(aTol), aSurfAdapt.VResolution(aTol));
|
||||
Standard_Real aTol2D = std::max(aSurfAdapt.UResolution(aTol), aSurfAdapt.VResolution(aTol));
|
||||
|
||||
for (Standard_Integer anInd = 1; anInd <= thePoly->NbNodes(); ++anInd)
|
||||
{
|
||||
|
||||
@@ -48,7 +48,8 @@ Standard_Boolean BRepTools_PurgeLocations::Perform(const TopoDS_Shape& theShape)
|
||||
|
||||
const gp_Trsf& aTrsf = aLoc.Transformation();
|
||||
Standard_Boolean isBadTrsf =
|
||||
aTrsf.IsNegative() || (Abs(Abs(aTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec());
|
||||
aTrsf.IsNegative()
|
||||
|| (std::abs(std::abs(aTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec());
|
||||
if (isBadTrsf)
|
||||
{
|
||||
aBadTrsfInds.Append(ind);
|
||||
@@ -129,7 +130,8 @@ Standard_Boolean BRepTools_PurgeLocations::PurgeLocation(const TopoDS_Shape& the
|
||||
gp_Trsf aTrsf = aFD->Trsf();
|
||||
Standard_Integer aFP = aRefLoc.FirstPower();
|
||||
Standard_Boolean isBad =
|
||||
aTrsf.IsNegative() || (Abs(Abs(aTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec());
|
||||
aTrsf.IsNegative()
|
||||
|| (std::abs(std::abs(aTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec());
|
||||
TopLoc_Location aLoc(aFD);
|
||||
aLoc = aLoc.Powered(aFP);
|
||||
aTrsf = aLoc.Transformation();
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
#include <TopTools_LocationSet.hxx>
|
||||
|
||||
//! Removes location datums, which satisfy conditions:
|
||||
//! aTrsf.IsNegative() || (Abs(Abs(aTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec())
|
||||
//! from all locations of shape and its subshapes
|
||||
//! aTrsf.IsNegative() || (std::abs(std::abs(aTrsf.ScaleFactor()) - 1.) >
|
||||
//! TopLoc_Location::ScalePrec()) from all locations of shape and its subshapes
|
||||
class BRepTools_PurgeLocations
|
||||
{
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ Standard_Boolean BRepTools_TrsfModification::NewSurface(const TopoDS_Face& F,
|
||||
}
|
||||
|
||||
Tol = BRep_Tool::Tolerance(F);
|
||||
Tol *= Abs(myTrsf.ScaleFactor());
|
||||
Tol *= std::abs(myTrsf.ScaleFactor());
|
||||
RevWires = Standard_False;
|
||||
RevFace = myTrsf.IsNegative();
|
||||
|
||||
@@ -118,7 +118,7 @@ Standard_Boolean BRepTools_TrsfModification::NewTriangulation(
|
||||
|
||||
theTriangulation = theTriangulation->Copy();
|
||||
theTriangulation->SetCachedMinMax(Bnd_Box()); // clear bounding box
|
||||
theTriangulation->Deflection(theTriangulation->Deflection() * Abs(myTrsf.ScaleFactor()));
|
||||
theTriangulation->Deflection(theTriangulation->Deflection() * std::abs(myTrsf.ScaleFactor()));
|
||||
// apply transformation to 3D nodes
|
||||
for (Standard_Integer anInd = 1; anInd <= theTriangulation->NbNodes(); ++anInd)
|
||||
{
|
||||
@@ -189,7 +189,7 @@ Standard_Boolean BRepTools_TrsfModification::NewPolygon(const TopoDS_Edge&
|
||||
}
|
||||
|
||||
theP = theP->Copy();
|
||||
theP->Deflection(theP->Deflection() * Abs(myTrsf.ScaleFactor()));
|
||||
theP->Deflection(theP->Deflection() * std::abs(myTrsf.ScaleFactor()));
|
||||
TColgp_Array1OfPnt& aNodesArray = theP->ChangeNodes();
|
||||
for (Standard_Integer anId = aNodesArray.Lower(); anId <= aNodesArray.Upper(); ++anId)
|
||||
{
|
||||
@@ -205,7 +205,7 @@ Standard_Boolean BRepTools_TrsfModification::NewPolygon(const TopoDS_Edge&
|
||||
if (!aCurve.IsNull())
|
||||
{
|
||||
Standard_Real aReparametrization = aCurve->ParametricTransformation(aTrsf);
|
||||
if (Abs(aReparametrization - 1.0) > Precision::PConfusion())
|
||||
if (std::abs(aReparametrization - 1.0) > Precision::PConfusion())
|
||||
{
|
||||
TColStd_Array1OfReal& aParams = theP->ChangeParameters();
|
||||
for (Standard_Integer anInd = aParams.Lower(); anInd <= aParams.Upper(); ++anInd)
|
||||
@@ -244,14 +244,14 @@ Standard_Boolean BRepTools_TrsfModification::NewPolygonOnTriangulation(
|
||||
return Standard_False;
|
||||
}
|
||||
theP = theP->Copy();
|
||||
theP->Deflection(theP->Deflection() * Abs(myTrsf.ScaleFactor()));
|
||||
theP->Deflection(theP->Deflection() * std::abs(myTrsf.ScaleFactor()));
|
||||
|
||||
// transform the parametrization
|
||||
Handle(Geom_Surface) aSurf = BRep_Tool::Surface(theF, aLoc);
|
||||
Standard_Real aFirst, aLast;
|
||||
Handle(Geom2d_Curve) aC2d = BRep_Tool::CurveOnSurface(theE, theF, aFirst, aLast);
|
||||
if (!aSurf.IsNull() && !aC2d.IsNull()
|
||||
&& Abs(Abs(myTrsf.ScaleFactor()) - 1.0) > TopLoc_Location::ScalePrec())
|
||||
&& std::abs(std::abs(myTrsf.ScaleFactor()) - 1.0) > TopLoc_Location::ScalePrec())
|
||||
{
|
||||
gp_GTrsf2d aGTrsf = aSurf->ParametricTransformation(myTrsf);
|
||||
if (aGTrsf.Form() != gp_Identity)
|
||||
@@ -282,7 +282,7 @@ Standard_Boolean BRepTools_TrsfModification::NewCurve(const TopoDS_Edge& E,
|
||||
C = BRep_Tool::Curve(E, L, f, l);
|
||||
|
||||
Tol = BRep_Tool::Tolerance(E);
|
||||
Tol *= Abs(myTrsf.ScaleFactor());
|
||||
Tol *= std::abs(myTrsf.ScaleFactor());
|
||||
|
||||
gp_Trsf LT = L.Transformation();
|
||||
LT.Invert();
|
||||
@@ -305,7 +305,7 @@ Standard_Boolean BRepTools_TrsfModification::NewPoint(const TopoDS_Vertex& V,
|
||||
{
|
||||
P = BRep_Tool::Pnt(V);
|
||||
Tol = BRep_Tool::Tolerance(V);
|
||||
Tol *= Abs(myTrsf.ScaleFactor());
|
||||
Tol *= std::abs(myTrsf.ScaleFactor());
|
||||
P.Transform(myTrsf);
|
||||
|
||||
return Standard_True;
|
||||
@@ -323,7 +323,7 @@ Standard_Boolean BRepTools_TrsfModification::NewCurve2d(const TopoDS_Edge& E,
|
||||
TopLoc_Location loc;
|
||||
Tol = BRep_Tool::Tolerance(E);
|
||||
Standard_Real scale = myTrsf.ScaleFactor();
|
||||
Tol *= Abs(scale);
|
||||
Tol *= std::abs(scale);
|
||||
const Handle(Geom_Surface)& S = BRep_Tool::Surface(F, loc);
|
||||
|
||||
if (S.IsNull())
|
||||
@@ -358,9 +358,9 @@ Standard_Boolean BRepTools_TrsfModification::NewCurve2d(const TopoDS_Edge& E,
|
||||
f = fc;
|
||||
if (l - lc > Precision::PConfusion())
|
||||
l = lc;
|
||||
if (Abs(l - f) < Precision::PConfusion())
|
||||
if (std::abs(l - f) < Precision::PConfusion())
|
||||
{
|
||||
if (Abs(f - fc) < Precision::PConfusion() && !Precision::IsInfinite(lc))
|
||||
if (std::abs(f - fc) < Precision::PConfusion() && !Precision::IsInfinite(lc))
|
||||
{
|
||||
l = lc;
|
||||
}
|
||||
@@ -373,7 +373,7 @@ Standard_Boolean BRepTools_TrsfModification::NewCurve2d(const TopoDS_Edge& E,
|
||||
|
||||
newf = f;
|
||||
newl = l;
|
||||
if (Abs(scale) != 1.)
|
||||
if (std::abs(scale) != 1.)
|
||||
{
|
||||
|
||||
NewC = new Geom2d_TrimmedCurve(NewC, f, l);
|
||||
@@ -415,7 +415,7 @@ Standard_Boolean BRepTools_TrsfModification::NewParameter(const TopoDS_Vertex& V
|
||||
|
||||
TopLoc_Location loc;
|
||||
Tol = BRep_Tool::Tolerance(V);
|
||||
Tol *= Abs(myTrsf.ScaleFactor());
|
||||
Tol *= std::abs(myTrsf.ScaleFactor());
|
||||
P = BRep_Tool::Parameter(V, E);
|
||||
|
||||
Standard_Real f, l;
|
||||
|
||||
@@ -142,13 +142,13 @@ void BRepTools_WireExplorer::Init(const TopoDS_Wire& W,
|
||||
for (; anExp.More(); anExp.Next())
|
||||
{
|
||||
const TopoDS_Vertex& aV = TopoDS::Vertex(anExp.Current());
|
||||
dfVertToler = Max(BRep_Tool::Tolerance(aV), dfVertToler);
|
||||
dfVertToler = std::max(BRep_Tool::Tolerance(aV), dfVertToler);
|
||||
}
|
||||
if (dfVertToler < Precision::Confusion())
|
||||
{
|
||||
// Use tolerance of edges
|
||||
for (TopoDS_Iterator it(W); it.More(); it.Next())
|
||||
dfVertToler = Max(BRep_Tool::Tolerance(TopoDS::Edge(it.Value())), dfVertToler);
|
||||
dfVertToler = std::max(BRep_Tool::Tolerance(TopoDS::Edge(it.Value())), dfVertToler);
|
||||
|
||||
if (dfVertToler < Precision::Confusion())
|
||||
// empty wire
|
||||
@@ -169,25 +169,25 @@ void BRepTools_WireExplorer::Init(const TopoDS_Wire& W,
|
||||
if (a <= Precision::Confusion())
|
||||
tol1 = maxtol;
|
||||
else
|
||||
tol1 = Min(maxtol, dfVertToler / a);
|
||||
tol1 = std::min(maxtol, dfVertToler / a);
|
||||
|
||||
aGAS.D1(UMin, VMax, aP, aD1U, aD1V);
|
||||
a = aD1U.Magnitude();
|
||||
if (a <= Precision::Confusion())
|
||||
tol2 = maxtol;
|
||||
else
|
||||
tol2 = Min(maxtol, dfVertToler / a);
|
||||
tol2 = std::min(maxtol, dfVertToler / a);
|
||||
|
||||
myTolU = 2. * Max(tol1, tol2);
|
||||
myTolU = 2. * std::max(tol1, tol2);
|
||||
}
|
||||
|
||||
if (aGAS.GetType() == GeomAbs_BSplineSurface || aGAS.GetType() == GeomAbs_BezierSurface)
|
||||
{
|
||||
Standard_Real maxTol = Max(myTolU, myTolV);
|
||||
Standard_Real maxTol = std::max(myTolU, myTolV);
|
||||
gp_Pnt aP;
|
||||
gp_Vec aDU, aDV;
|
||||
aGAS.D1((UMax - UMin) / 2., (VMax - VMin) / 2., aP, aDU, aDV);
|
||||
Standard_Real mod = Sqrt(aDU * aDU + aDV * aDV);
|
||||
Standard_Real mod = std::sqrt(aDU * aDU + aDV * aDV);
|
||||
if (mod > gp::Resolution())
|
||||
{
|
||||
if (mod * maxTol / dfVertToler < 1.5)
|
||||
@@ -572,7 +572,7 @@ void BRepTools_WireExplorer::Next()
|
||||
else
|
||||
aPCurve->D0(dfFPar, aPEb);
|
||||
|
||||
if (Abs(dfLPar - dfFPar) > Precision::PConfusion())
|
||||
if (std::abs(dfLPar - dfFPar) > Precision::PConfusion())
|
||||
{
|
||||
isrevese = (E.Orientation() == TopAbs_REVERSED);
|
||||
isrevese = !isrevese;
|
||||
@@ -598,7 +598,7 @@ void BRepTools_WireExplorer::Next()
|
||||
}
|
||||
}
|
||||
gp_Vec2d anEDir(aPEb, aPEe);
|
||||
dfCurAngle = Abs(anEDir.Angle(anERefDir));
|
||||
dfCurAngle = std::abs(anEDir.Angle(anERefDir));
|
||||
}
|
||||
|
||||
if (dfCurAngle <= dfMinAngle)
|
||||
@@ -606,7 +606,7 @@ void BRepTools_WireExplorer::Next()
|
||||
Standard_Real d = PRef.SquareDistance(aPEb);
|
||||
if (d <= Precision::PConfusion())
|
||||
d = 0.;
|
||||
if (Abs(aPEb.X() - PRef.X()) < myTolU && Abs(aPEb.Y() - PRef.Y()) < myTolV)
|
||||
if (std::abs(aPEb.X() - PRef.X()) < myTolU && std::abs(aPEb.Y() - PRef.Y()) < myTolV)
|
||||
{
|
||||
if (d <= dmin)
|
||||
{
|
||||
@@ -752,7 +752,7 @@ Standard_Real GetNextParamOnPC(const Handle(Geom2d_Curve)& aPC,
|
||||
const Standard_Boolean& reverse)
|
||||
{
|
||||
Standard_Real result = (reverse) ? fP : lP;
|
||||
Standard_Real dP = Abs(lP - fP) / 1000.; // was / 16.;
|
||||
Standard_Real dP = std::abs(lP - fP) / 1000.; // was / 16.;
|
||||
if (reverse)
|
||||
{
|
||||
Standard_Real startPar = fP;
|
||||
@@ -762,7 +762,7 @@ Standard_Real GetNextParamOnPC(const Handle(Geom2d_Curve)& aPC,
|
||||
gp_Pnt2d pnt;
|
||||
startPar += dP;
|
||||
aPC->D0(startPar, pnt);
|
||||
if (Abs(aPRef.X() - pnt.X()) < tolU && Abs(aPRef.Y() - pnt.Y()) < tolV)
|
||||
if (std::abs(aPRef.X() - pnt.X()) < tolU && std::abs(aPRef.Y() - pnt.Y()) < tolV)
|
||||
continue;
|
||||
else
|
||||
{
|
||||
@@ -787,7 +787,7 @@ Standard_Real GetNextParamOnPC(const Handle(Geom2d_Curve)& aPC,
|
||||
gp_Pnt2d pnt;
|
||||
startPar -= dP;
|
||||
aPC->D0(startPar, pnt);
|
||||
if (Abs(aPRef.X() - pnt.X()) < tolU && Abs(aPRef.Y() - pnt.Y()) < tolV)
|
||||
if (std::abs(aPRef.X() - pnt.X()) < tolU && std::abs(aPRef.Y() - pnt.Y()) < tolV)
|
||||
continue;
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user