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:
Dmitrii Kulikov
2025-11-17 14:20:24 +00:00
committed by GitHub
parent 1a246afa2e
commit c479f6e000
1205 changed files with 12672 additions and 11286 deletions
+2 -1
View File
@@ -28,7 +28,8 @@ if (MSVC)
# suppress C26812 on VS2019/C++20 (prefer 'enum class' over 'enum')
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:precise /wd26812")
# suppress warning on using portable non-secure functions in favor of non-portable secure ones
add_definitions (-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
# prevent min() and max() macros from Windows.h
add_definitions (-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -DNOMINMAX)
else()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions")
+5
View File
@@ -1,3 +1,8 @@
// Prevent Windows from defining min/max macros
#ifndef NOMINMAX
#define NOMINMAX
#endif
// include required OCCT headers
#include <Standard_Version.hxx>
#include <Message_ProgressIndicator.hxx>
@@ -1,3 +1,8 @@
// Prevent Windows from defining min/max macros
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <d3d9.h>
#include <windows.h>
@@ -181,9 +181,9 @@
double aPinchCenterXStart = ( myFirstTouch[0].x + myFirstTouch[1].x ) / 2.0;
double aPinchCenterYStart = ( myFirstTouch[0].y + myFirstTouch[1].y ) / 2.0;
double aStartDist = Sqrt( ( myFirstTouch[0].x - myFirstTouch[1].x ) * ( myFirstTouch[0].x - myFirstTouch[1].x ) +
double aStartDist = std::sqrt( ( myFirstTouch[0].x - myFirstTouch[1].x ) * ( myFirstTouch[0].x - myFirstTouch[1].x ) +
( myFirstTouch[0].y - myFirstTouch[1].y ) * ( myFirstTouch[0].y - myFirstTouch[1].y ) );
double anEndDist = Sqrt( ( aLastTouch[0].x - aLastTouch[1].x ) * ( aLastTouch[0].x - aLastTouch[1].x ) +
double anEndDist = std::sqrt( ( aLastTouch[0].x - aLastTouch[1].x ) * ( aLastTouch[0].x - aLastTouch[1].x ) +
( aLastTouch[0].y - aLastTouch[1].y ) * ( aLastTouch[0].y - aLastTouch[1].y ) );
double aDeltaDist = anEndDist - aStartDist;
@@ -9,6 +9,10 @@
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#ifndef NOMINMAX
#define NOMINMAX // Prevent Windows from defining min/max macros
#endif
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC OLE automation classes
@@ -9,6 +9,10 @@
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#ifndef NOMINMAX
#define NOMINMAX // Prevent Windows from defining min/max macros
#endif
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC OLE automation classes
@@ -12,6 +12,10 @@
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#ifndef NOMINMAX
#define NOMINMAX // Prevent Windows from defining min/max macros
#endif
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC OLE automation classes
+4
View File
@@ -12,6 +12,10 @@
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#ifndef NOMINMAX
#define NOMINMAX // Prevent Windows from defining min/max macros
#endif
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC OLE automation classes
+4
View File
@@ -9,6 +9,10 @@
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#ifndef NOMINMAX
#define NOMINMAX // Prevent Windows from defining min/max macros
#endif
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC OLE automation classes
File diff suppressed because it is too large Load Diff
@@ -31,35 +31,36 @@
#include <Geom2d_BSplineCurve.hxx>
#include <Geom2dLProp_CLProps2d.hxx>
AdaptorCurve2d_AIS::AdaptorCurve2d_AIS (const Handle(Geom2d_Curve)& theGeom2dCurve,
const Aspect_TypeOfLine theTypeOfLine,
const Aspect_WidthOfLine theWidthOfLine)
: myGeom2dCurve (theGeom2dCurve),
myTypeOfLine (theTypeOfLine),
myWidthOfLine (theWidthOfLine),
myDisplayPole (Standard_True),
myDisplayCurbure (Standard_False),
myDiscretisation (20),
myradiusmax (10),
myradiusratio (1)
AdaptorCurve2d_AIS::AdaptorCurve2d_AIS(const Handle(Geom2d_Curve)& theGeom2dCurve,
const Aspect_TypeOfLine theTypeOfLine,
const Aspect_WidthOfLine theWidthOfLine)
: myGeom2dCurve(theGeom2dCurve),
myTypeOfLine(theTypeOfLine),
myWidthOfLine(theWidthOfLine),
myDisplayPole(Standard_True),
myDisplayCurbure(Standard_False),
myDiscretisation(20),
myradiusmax(10),
myradiusratio(1)
{
//
}
void AdaptorCurve2d_AIS::Compute (const Handle(PrsMgr_PresentationManager)&,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
void AdaptorCurve2d_AIS::Compute(const Handle(PrsMgr_PresentationManager)&,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
if (theMode != 0)
{
return;
}
Geom2dAdaptor_Curve anAdaptor(myGeom2dCurve);
Geom2dAdaptor_Curve anAdaptor(myGeom2dCurve);
GCPnts_QuasiUniformDeflection anEdgeDistrib(anAdaptor, 1.e-2);
if (anEdgeDistrib.IsDone())
{
Handle(Graphic3d_ArrayOfPolylines) aCurve = new Graphic3d_ArrayOfPolylines(anEdgeDistrib.NbPoints());
Handle(Graphic3d_ArrayOfPolylines) aCurve =
new Graphic3d_ArrayOfPolylines(anEdgeDistrib.NbPoints());
for (Standard_Integer i = 1; i <= anEdgeDistrib.NbPoints(); ++i)
{
aCurve->AddVertex(anEdgeDistrib.Value(i));
@@ -74,8 +75,9 @@ void AdaptorCurve2d_AIS::Compute (const Handle(PrsMgr_PresentationManager)&,
{
if (anAdaptor.GetType() == GeomAbs_BezierCurve)
{
Handle(Geom2d_BezierCurve) aBezier = anAdaptor.Bezier();
Handle(Graphic3d_ArrayOfPolylines) anArrayOfVertex = new Graphic3d_ArrayOfPolylines(aBezier->NbPoles());
Handle(Geom2d_BezierCurve) aBezier = anAdaptor.Bezier();
Handle(Graphic3d_ArrayOfPolylines) anArrayOfVertex =
new Graphic3d_ArrayOfPolylines(aBezier->NbPoles());
for (int i = 1; i <= aBezier->NbPoles(); i++)
{
gp_Pnt2d CurrentPoint = aBezier->Pole(i);
@@ -89,8 +91,9 @@ void AdaptorCurve2d_AIS::Compute (const Handle(PrsMgr_PresentationManager)&,
if (anAdaptor.GetType() == GeomAbs_BSplineCurve)
{
Handle(Geom2d_BSplineCurve) aBSpline = anAdaptor.BSpline();
Handle(Graphic3d_ArrayOfPolylines) anArrayOfVertex = new Graphic3d_ArrayOfPolylines(aBSpline->NbPoles());
Handle(Geom2d_BSplineCurve) aBSpline = anAdaptor.BSpline();
Handle(Graphic3d_ArrayOfPolylines) anArrayOfVertex =
new Graphic3d_ArrayOfPolylines(aBSpline->NbPoles());
for (int i = 1; i <= aBSpline->NbPoles(); i++)
{
gp_Pnt2d CurrentPoint = aBSpline->Pole(i);
@@ -106,17 +109,17 @@ void AdaptorCurve2d_AIS::Compute (const Handle(PrsMgr_PresentationManager)&,
if (myDisplayCurbure && (anAdaptor.GetType() != GeomAbs_Line))
{
const Standard_Integer nbintv = anAdaptor.NbIntervals(GeomAbs_CN);
TColStd_Array1OfReal TI(1, nbintv + 1);
TColStd_Array1OfReal TI(1, nbintv + 1);
anAdaptor.Intervals(TI, GeomAbs_CN);
Standard_Real Resolution = 1.0e-9, Curvature;
Standard_Real Resolution = 1.0e-9, Curvature;
Geom2dLProp_CLProps2d LProp(myGeom2dCurve, 2, Resolution);
gp_Pnt2d P1, P2;
gp_Pnt2d P1, P2;
Handle(Graphic3d_Group) aPrsGroup = thePrs->NewGroup();
aPrsGroup->SetGroupPrimitivesAspect (myDrawer->LineAspect()->Aspect());
aPrsGroup->SetGroupPrimitivesAspect(myDrawer->LineAspect()->Aspect());
for (Standard_Integer intrv = 1; intrv <= nbintv; intrv++)
{
Standard_Real t = TI(intrv);
Standard_Real t = TI(intrv);
Standard_Real step = (TI(intrv + 1) - t) / GetDiscretisation();
Standard_Real LRad, ratio;
for (Standard_Integer ii = 1; ii <= myDiscretisation; ii++)
@@ -124,16 +127,16 @@ void AdaptorCurve2d_AIS::Compute (const Handle(PrsMgr_PresentationManager)&,
LProp.SetParameter(t);
if (LProp.IsTangentDefined())
{
Curvature = Abs(LProp.Curvature());
Curvature = std::abs(LProp.Curvature());
if (Curvature > Resolution)
{
myGeom2dCurve->D0(t, P1);
LRad = 1. / Curvature;
LRad = 1. / Curvature;
ratio = ((LRad > myradiusmax) ? myradiusmax / LRad : 1);
ratio *= myradiusratio;
LProp.CentreOfCurvature(P2);
gp_Vec2d V(P1, P2);
gp_Pnt2d P3 = P1.Translated(ratio*V);
gp_Vec2d V(P1, P2);
gp_Pnt2d P3 = P1.Translated(ratio * V);
Handle(Graphic3d_ArrayOfPolylines) aSegment = new Graphic3d_ArrayOfPolylines(2);
aSegment->AddVertex(P1.X(), P1.Y(), 0.);
aSegment->AddVertex(P3.X(), P3.Y(), 0.);
+41 -39
View File
@@ -28,7 +28,7 @@ IMPLEMENT_STANDARD_RTTIEXT(OcctWindow, Aspect_Window)
// purpose :
// =======================================================================
OcctWindow::OcctWindow(QWidget* theWidget, const Quantity_NameOfColor theBackColor)
: myWidget (theWidget)
: myWidget(theWidget)
{
SetBackground(theBackColor);
myXLeft = myWidget->rect().left();
@@ -85,55 +85,55 @@ Aspect_TypeOfResize OcctWindow::DoResize()
if (!myWidget->isMinimized())
{
if (Abs(myWidget->rect().left() - myXLeft) > 2)
if (std::abs(myWidget->rect().left() - myXLeft) > 2)
{
aMask |= 1;
}
if (Abs(myWidget->rect().right() - myXRight) > 2)
if (std::abs(myWidget->rect().right() - myXRight) > 2)
{
aMask |= 2;
}
if (Abs(myWidget->rect().top() - myYTop) > 2)
if (std::abs(myWidget->rect().top() - myYTop) > 2)
{
aMask |= 4;
}
if (Abs(myWidget->rect().bottom() - myYBottom) > 2)
if (std::abs(myWidget->rect().bottom() - myYBottom) > 2)
{
aMask |= 8;
}
switch (aMask)
{
case 0:
aMode = Aspect_TOR_NO_BORDER;
break;
case 1:
aMode = Aspect_TOR_LEFT_BORDER;
break;
case 2:
aMode = Aspect_TOR_RIGHT_BORDER;
break;
case 4:
aMode = Aspect_TOR_TOP_BORDER;
break;
case 5:
aMode = Aspect_TOR_LEFT_AND_TOP_BORDER;
break;
case 6:
aMode = Aspect_TOR_TOP_AND_RIGHT_BORDER;
break;
case 8:
aMode = Aspect_TOR_BOTTOM_BORDER;
break;
case 9:
aMode = Aspect_TOR_BOTTOM_AND_LEFT_BORDER;
break;
case 10:
aMode = Aspect_TOR_RIGHT_AND_BOTTOM_BORDER;
break;
default:
break;
} // end switch
case 0:
aMode = Aspect_TOR_NO_BORDER;
break;
case 1:
aMode = Aspect_TOR_LEFT_BORDER;
break;
case 2:
aMode = Aspect_TOR_RIGHT_BORDER;
break;
case 4:
aMode = Aspect_TOR_TOP_BORDER;
break;
case 5:
aMode = Aspect_TOR_LEFT_AND_TOP_BORDER;
break;
case 6:
aMode = Aspect_TOR_TOP_AND_RIGHT_BORDER;
break;
case 8:
aMode = Aspect_TOR_BOTTOM_BORDER;
break;
case 9:
aMode = Aspect_TOR_BOTTOM_AND_LEFT_BORDER;
break;
case 10:
aMode = Aspect_TOR_RIGHT_AND_BOTTOM_BORDER;
break;
default:
break;
} // end switch
myXLeft = myWidget->rect().left();
myXRight = myWidget->rect().right();
@@ -161,16 +161,18 @@ Standard_Real OcctWindow::Ratio() const
void OcctWindow::Size(Standard_Integer& theWidth, Standard_Integer& theHeight) const
{
QRect aRect = myWidget->rect();
theWidth = aRect.width();
theHeight = aRect.height();
theWidth = aRect.width();
theHeight = aRect.height();
}
// =======================================================================
// function : Position
// purpose :
// =======================================================================
void OcctWindow::Position(Standard_Integer& theX1, Standard_Integer& theY1,
Standard_Integer& theX2, Standard_Integer& theY2) const
void OcctWindow::Position(Standard_Integer& theX1,
Standard_Integer& theY1,
Standard_Integer& theX2,
Standard_Integer& theY2) const
{
theX1 = myWidget->rect().left();
theX2 = myWidget->rect().right();
@@ -104,7 +104,7 @@ Standard_OStream& BinObjMgt_Persistent::Write(Standard_OStream& theOS,
#endif
for (Standard_Integer i = 1; theOS && nbWritten < mySize && i <= myData.Length(); i++)
{
Standard_Integer nbToWrite = Min(mySize - nbWritten, BP_PIECESIZE);
Standard_Integer nbToWrite = std::min(mySize - nbWritten, BP_PIECESIZE);
theOS.write((char*)myData(i), nbToWrite);
nbWritten += nbToWrite;
}
@@ -163,7 +163,7 @@ Standard_IStream& BinObjMgt_Persistent::Read(Standard_IStream& theIS)
Standard_Address aPiece = Standard::Allocate(BP_PIECESIZE);
myData.Append(aPiece);
}
Standard_Integer nbToRead = Min(mySize - nbRead, BP_PIECESIZE);
Standard_Integer nbToRead = std::min(mySize - nbRead, BP_PIECESIZE);
char* ptr = (char*)myData(i);
if (i == 1)
{
@@ -972,7 +972,7 @@ void BinObjMgt_Persistent::putArray(const Standard_Address theArray, const Stand
myIndex++;
myOffset = 0;
}
Standard_Integer aLenInPiece = Min(aLen, BP_PIECESIZE - myOffset);
Standard_Integer aLenInPiece = std::min(aLen, BP_PIECESIZE - myOffset);
char* aData = (char*)myData(myIndex) + myOffset;
memcpy(aData, aPtr, aLenInPiece);
aLen -= aLenInPiece;
@@ -999,7 +999,7 @@ void BinObjMgt_Persistent::getArray(const Standard_Address theArray,
me->myIndex++;
me->myOffset = 0;
}
Standard_Integer aLenInPiece = Min(aLen, BP_PIECESIZE - myOffset);
Standard_Integer aLenInPiece = std::min(aLen, BP_PIECESIZE - myOffset);
char* aData = (char*)myData(myIndex) + myOffset;
memcpy(aPtr, aData, aLenInPiece);
aLen -= aLenInPiece;
@@ -1022,7 +1022,7 @@ void BinObjMgt_Persistent::inverseExtCharData(const Standard_Integer theIndex,
Standard_Integer aLen = theSize;
while (aLen > 0)
{
Standard_Integer aLenInPiece = Min(aLen, BP_PIECESIZE - anOffset);
Standard_Integer aLenInPiece = std::min(aLen, BP_PIECESIZE - anOffset);
Standard_ExtCharacter* aData = (Standard_ExtCharacter*)((char*)myData(anIndex) + anOffset);
for (Standard_Integer i = 0; i < aLenInPiece / BP_EXTCHARSIZE; i++)
aData[i] = FSD_BinaryFile::InverseExtChar(aData[i]);
@@ -1050,7 +1050,7 @@ void BinObjMgt_Persistent::inverseIntData(const Standard_Integer theIndex,
Standard_Integer aLen = theSize;
while (aLen > 0)
{
Standard_Integer aLenInPiece = Min(aLen, BP_PIECESIZE - anOffset);
Standard_Integer aLenInPiece = std::min(aLen, BP_PIECESIZE - anOffset);
Standard_Integer* aData = (Standard_Integer*)((char*)myData(anIndex) + anOffset);
for (Standard_Integer i = 0; i < aLenInPiece / BP_INTSIZE; i++)
aData[i] = FSD_BinaryFile::InverseInt(aData[i]);
@@ -1085,7 +1085,7 @@ void BinObjMgt_Persistent::inverseRealData(const Standard_Integer theIndex,
void* aPrevPtr = 0;
while (aLen > 0)
{
Standard_Integer aLenInPiece = Min(aLen, BP_PIECESIZE - anOffset);
Standard_Integer aLenInPiece = std::min(aLen, BP_PIECESIZE - anOffset);
aWrapUnion.aRealData = (Standard_Real*)((char*)myData(anIndex) + anOffset);
@@ -1126,7 +1126,7 @@ void BinObjMgt_Persistent::inverseShortRealData(const Standard_Integer theIndex,
Standard_Integer aLen = theSize;
while (aLen > 0)
{
Standard_Integer aLenInPiece = Min(aLen, BP_PIECESIZE - anOffset);
Standard_Integer aLenInPiece = std::min(aLen, BP_PIECESIZE - anOffset);
Standard_ShortReal* aData = (Standard_ShortReal*)((char*)myData(anIndex) + anOffset);
for (Standard_Integer i = 0; i < aLenInPiece / BP_INTSIZE; i++)
aData[i] = FSD_BinaryFile::InverseShortReal(aData[i]);
@@ -733,7 +733,7 @@ void CDM_Document::CreateReference(const Handle(CDM_MetaData)& aMetaData,
const Standard_Integer aToDocumentVersion,
const Standard_Boolean UseStorageConfiguration)
{
myActualReferenceIdentifier = Max(myActualReferenceIdentifier, aReferenceIdentifier);
myActualReferenceIdentifier = std::max(myActualReferenceIdentifier, aReferenceIdentifier);
if (aMetaData->IsRetrieved())
{
@@ -173,7 +173,7 @@
} \
else \
{ \
aCounter = Abs(anI - myICur); \
aCounter = std::abs(anI - myICur); \
if (anI <= aCounter) \
{ \
aCurrent = myFirst; \
@@ -114,7 +114,7 @@ std::streamsize LDOM_SBuffer::xsputn(const char* aStr, std::streamsize n)
}
else if (freeLen <= 0)
{
LDOM_StringElem* aNextElem = new (myAlloc) LDOM_StringElem(Max(aLen, myMaxBuf), myAlloc);
LDOM_StringElem* aNextElem = new (myAlloc) LDOM_StringElem(std::max(aLen, myMaxBuf), myAlloc);
myCurString->next = aNextElem;
myCurString = aNextElem;
strncpy(myCurString->buf + myCurString->len, aStr, aLen);
@@ -126,7 +126,7 @@ std::streamsize LDOM_SBuffer::xsputn(const char* aStr, std::streamsize n)
myCurString->len += freeLen;
*(myCurString->buf + myCurString->len) = '\0';
aLen -= freeLen;
LDOM_StringElem* aNextElem = new (myAlloc) LDOM_StringElem(Max(aLen, myMaxBuf), myAlloc);
LDOM_StringElem* aNextElem = new (myAlloc) LDOM_StringElem(std::max(aLen, myMaxBuf), myAlloc);
myCurString->next = aNextElem;
myCurString = aNextElem;
strncpy(myCurString->buf + myCurString->len, aStr + freeLen, aLen);
@@ -148,7 +148,7 @@ void StdStorage_TypeData::AddType(const TCollection_AsciiString& aTypeName,
const Standard_Integer aTypeNum)
{
myPt.Add(aTypeName, aTypeNum);
myTypeId = Max(aTypeNum, myTypeId);
myTypeId = std::max(aTypeNum, myTypeId);
}
Standard_Integer StdStorage_TypeData::AddType(const Handle(StdObjMgt_Persistent)& aPObj)
@@ -175,7 +175,7 @@ void TPrsStd_ConstraintTools::ComputeTextAndValue(const Handle(TDataXtd_Constrai
val = VAL->Get();
if (anIsAngle)
{
outvalue = UnitsAPI::CurrentFromLS(Abs(val), "PLANE ANGLE");
outvalue = UnitsAPI::CurrentFromLS(std::abs(val), "PLANE ANGLE");
}
else
{
@@ -1729,7 +1729,8 @@ void TPrsStd_ConstraintTools::ComputeEqualRadius(const Handle(TDataXtd_Constrain
const gp_Dir& aDir1 = anAx31.Direction();
const gp_Dir& aDir2 = anAx32.Direction();
if (Abs(D1 - D2) < Precision::Confusion() && aDir1.IsParallel(aDir2, Precision::Confusion()))
if (std::abs(D1 - D2) < Precision::Confusion()
&& aDir1.IsParallel(aDir2, Precision::Confusion()))
aplane = aPlane2;
else
{
@@ -44,7 +44,7 @@ public:
const Message_ProgressRange& theProgress,
const OSD_ThreadPool::Launcher& theThreadPool)
: myFaceList(&theFaceList),
myProgress(theProgress, "Loading glTF triangulation", Max(1, theFaceList.Size())),
myProgress(theProgress, "Loading glTF triangulation", std::max(1, theFaceList.Size())),
myThreadPool(theThreadPool)
{
//
@@ -380,7 +380,7 @@ Standard_Boolean RWGltf_CafReader::readLateData(NCollection_Vector<TopoDS_Face>&
// loaded later.
const Handle(OSD_ThreadPool)& aThreadPool = OSD_ThreadPool::DefaultPool();
const int aNbThreads =
myToParallel ? Min(theFaces.Size(), aThreadPool->NbDefaultThreadsToLaunch()) : 1;
myToParallel ? std::min(theFaces.Size(), aThreadPool->NbDefaultThreadsToLaunch()) : 1;
OSD_ThreadPool::Launcher aLauncher(*aThreadPool, aNbThreads);
CafReader_GltfStreamDataLoadingFunctor aFunctor(theFaces, theProgress, aLauncher);
aLauncher.Perform(theFaces.Lower(), theFaces.Upper() + 1, aFunctor);
@@ -392,7 +392,7 @@ Standard_Boolean RWGltf_CafReader::readLateData(NCollection_Vector<TopoDS_Face>&
const Handle(OSD_ThreadPool)& aThreadPool = OSD_ThreadPool::DefaultPool();
const int aNbThreads =
myToParallel ? Min(theFaces.Size(), aThreadPool->NbDefaultThreadsToLaunch()) : 1;
myToParallel ? std::min(theFaces.Size(), aThreadPool->NbDefaultThreadsToLaunch()) : 1;
OSD_ThreadPool::Launcher aLauncher(*aThreadPool, aNbThreads);
CafReader_GltfFullDataLoadingFunctor aFunctor(this, theFaces, theProgress, aLauncher);
@@ -176,7 +176,7 @@ public:
draco::Encoder& theDracoEncoder,
const std::vector<std::shared_ptr<RWGltf_CafWriter::Mesh>>& theMeshes,
std::vector<std::shared_ptr<draco::EncoderBuffer>>& theEncoderBuffers)
: myProgress(theProgress, "Draco compression", Max(1, int(theMeshes.size()))),
: myProgress(theProgress, "Draco compression", std::max(1, int(theMeshes.size()))),
myDracoEncoder(&theDracoEncoder),
myRanges(0, int(theMeshes.size()) - 1),
myMeshes(&theMeshes),
@@ -519,7 +519,7 @@ void RWGltf_CafWriter::saveEdgeIndices(RWGltf_GltfFace& theGltfFace,
const Standard_Integer aNodeFirst = theGltfFace.NbIndexedNodes;
theGltfFace.NbIndexedNodes += theEdgeIter.NbNodes();
const Standard_Integer numSegments = Max(0, theEdgeIter.NbNodes() - 1);
const Standard_Integer numSegments = std::max(0, theEdgeIter.NbNodes() - 1);
// each segment writes two indices
theGltfFace.Indices.Count += numSegments * 2;
@@ -2329,12 +2329,12 @@ void RWGltf_CafWriter::writeNodes(const Handle(TDocStd_Document)& theDoc
{
myCSTrsf.TransformTransformation(aTrsf);
const gp_Quaternion aQuaternion = aTrsf.GetRotation();
const bool hasRotation = Abs(aQuaternion.X()) > gp::Resolution()
|| Abs(aQuaternion.Y()) > gp::Resolution()
|| Abs(aQuaternion.Z()) > gp::Resolution()
|| Abs(aQuaternion.W() - 1.0) > gp::Resolution();
const bool hasRotation = std::abs(aQuaternion.X()) > gp::Resolution()
|| std::abs(aQuaternion.Y()) > gp::Resolution()
|| std::abs(aQuaternion.Z()) > gp::Resolution()
|| std::abs(aQuaternion.W() - 1.0) > gp::Resolution();
const Standard_Real aScaleFactor = aTrsf.ScaleFactor();
const bool hasScale = Abs(aScaleFactor - 1.0) > Precision::Confusion();
const bool hasScale = std::abs(aScaleFactor - 1.0) > Precision::Confusion();
const gp_XYZ& aTranslPart = aTrsf.TranslationPart();
const bool hasTranslation = aTranslPart.SquareModulus() > gp::Resolution();
@@ -534,8 +534,9 @@ bool RWGltf_GltfJsonParser::parseTransformationComponents(
aRotVec4[aCompIter] = aGenVal.GetDouble();
}
const gp_Quaternion aQuaternion(aRotVec4.x(), aRotVec4.y(), aRotVec4.z(), aRotVec4.w());
if (Abs(aQuaternion.X()) > gp::Resolution() || Abs(aQuaternion.Y()) > gp::Resolution()
|| Abs(aQuaternion.Z()) > gp::Resolution() || Abs(aQuaternion.W() - 1.0) > gp::Resolution())
if (std::abs(aQuaternion.X()) > gp::Resolution() || std::abs(aQuaternion.Y()) > gp::Resolution()
|| std::abs(aQuaternion.Z()) > gp::Resolution()
|| std::abs(aQuaternion.W() - 1.0) > gp::Resolution())
{
aTrsf.SetRotation(aQuaternion);
}
@@ -580,16 +581,16 @@ bool RWGltf_GltfJsonParser::parseTransformationComponents(
return false;
}
aScaleVec[aCompIter] = aGenVal.GetDouble();
if (Abs(aScaleVec[aCompIter]) <= gp::Resolution())
if (std::abs(aScaleVec[aCompIter]) <= gp::Resolution())
{
reportGltfError("Scene node '" + theSceneNodeId + "' defines invalid scale.");
return false;
}
}
if (Abs(aScaleVec.x() - aScaleVec.y()) > Precision::Confusion()
|| Abs(aScaleVec.y() - aScaleVec.z()) > Precision::Confusion()
|| Abs(aScaleVec.x() - aScaleVec.z()) > Precision::Confusion())
if (std::abs(aScaleVec.x() - aScaleVec.y()) > Precision::Confusion()
|| std::abs(aScaleVec.y() - aScaleVec.z()) > Precision::Confusion()
|| std::abs(aScaleVec.x() - aScaleVec.z()) > Precision::Confusion())
{
Graphic3d_Mat4d aMat4;
aTrsf.GetMat4(aMat4);
@@ -628,7 +629,7 @@ bool RWGltf_GltfJsonParser::parseTransformationComponents(
Message::SendWarning(aWarnMessage);
}
else if (Abs(aScaleVec.x() - 1.0) > Precision::Confusion())
else if (std::abs(aScaleVec.x() - 1.0) > Precision::Confusion())
{
aTrsf.SetScaleFactor(aScaleVec.x());
}
@@ -1010,7 +1011,7 @@ bool RWGltf_GltfJsonParser::gltfParseStdMaterial(Handle(RWGltf_MaterialCommon)&
const double aSpecular = aShinVal->GetDouble();
if (aSpecular >= 0)
{
theMat->Shininess = (float)Min(aSpecular / 1000.0, 1.0);
theMat->Shininess = (float)std::min(aSpecular / 1000.0, 1.0);
}
}
return true;
@@ -398,15 +398,15 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferEdge(
Standard_Real uShift = 0., vShift = 0.;
Standard_Real U0, U1, V0, V1;
Surf->Bounds(U0, U1, V0, V1);
if (aBSpline->IsUPeriodic() && Abs(Ufirst - U0) > Precision::PConfusion())
if (aBSpline->IsUPeriodic() && std::abs(Ufirst - U0) > Precision::PConfusion())
{
uShift = ShapeAnalysis::AdjustToPeriod(Ufirst, U0, U1);
}
if (aBSpline->IsVPeriodic() && Abs(Vfirst - V0) > Precision::PConfusion())
if (aBSpline->IsVPeriodic() && std::abs(Vfirst - V0) > Precision::PConfusion())
{
vShift = ShapeAnalysis::AdjustToPeriod(Vfirst, V0, V1);
}
if (Abs(uShift) > Precision::PConfusion() || Abs(vShift) > Precision::PConfusion())
if (std::abs(uShift) > Precision::PConfusion() || std::abs(vShift) > Precision::PConfusion())
{
gp_Trsf2d TR;
TR.SetTranslation(gp_Pnt2d(0., 0.), gp_Pnt2d(uShift, vShift));
@@ -454,7 +454,7 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferEdge(
Handle(Geom_ConicalSurface) con = Handle(Geom_ConicalSurface)::DownCast(Surf);
if (con->SemiAngle() < 0)
{
Standard_Real vApex = 2 * con->RefRadius() / Sin(con->SemiAngle());
Standard_Real vApex = 2 * con->RefRadius() / std::sin(con->SemiAngle());
Curve2d->Translate(gp_Vec2d(0, vApex));
}
}
@@ -170,7 +170,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomCurve::TransferCurve(
static gp_XYZ GetAnyNormal(gp_XYZ orig)
{
gp_XYZ Norm;
if (Abs(orig.Z()) < Precision::Confusion())
if (std::abs(orig.Z()) < Precision::Confusion())
Norm.SetCoord(0, 0, 1);
else
{
@@ -213,7 +213,7 @@ static Standard_Boolean ArePolesPlanar(const TColgp_Array1OfPnt& Poles, gp_XYZ&
Standard_Real scl = Poles(1).XYZ() * Normal;
for (i = 2; i <= Poles.Length(); i++)
if (Abs(Poles(i).XYZ() * Normal - scl) > tol)
if (std::abs(Poles(i).XYZ() * Normal - scl) > tol)
return Standard_False;
return Standard_True;
}
@@ -323,7 +323,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomCurve::TransferCurve(
Handle(Geom_BSplineCurve) bspl = Handle(Geom_BSplineCurve)::DownCast(mycurve->Copy());
if (!bspl.IsNull())
{
if (Abs(Umax - Umin) > Precision::PConfusion())
if (std::abs(Umax - Umin) > Precision::PConfusion())
bspl->Segment(Umin, Umax);
mycurve = bspl;
}
@@ -529,7 +529,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomCurve::TransferCurve(const Handle(Geo
Standard_Real U1 = Udeb;
Standard_Real U2 = Ufin;
if (Abs(Udeb) <= gp::Resolution())
if (std::abs(Udeb) <= gp::Resolution())
U1 = 0.0;
// creation du "CircularArc" (#100)
@@ -549,7 +549,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomCurve::TransferCurve(const Handle(Geo
// gka BUG 6542 1.09.04 BSpline curve was written in the IGES instead circle.
gp_Pnt pfirst, plast;
start->D0(U1, pfirst);
if (Abs(Ufin - Udeb - 2 * M_PI) <= Precision::PConfusion())
if (std::abs(Ufin - Udeb - 2 * M_PI) <= Precision::PConfusion())
plast = pfirst;
else
start->D0(U2, plast);
@@ -595,7 +595,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomCurve::TransferCurve(const Handle(Geo
// #35 rln 22.10.98 BUC60391 face 9
// Closed Conic Arc is incorrectly oriented when reading back to CAS.CADE
if (Abs(Ufin - Udeb - 2 * M_PI) <= Precision::PConfusion())
if (std::abs(Ufin - Udeb - 2 * M_PI) <= Precision::PConfusion())
{
// #53 rln 24.12.98 CCI60005
// Trimmed ellipse. To avoid huge weights in B-Spline first rotate it and then convert
@@ -621,7 +621,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomCurve::TransferCurve(const Handle(Geo
IGESConvGeom_GeomBuilder Build;
Standard_Real U1 = Udeb;
Standard_Real U2 = Ufin;
if (Abs(Udeb) <= gp::Resolution())
if (std::abs(Udeb) <= gp::Resolution())
U1 = 0.0;
// creation du "ConicArc" (#104)
@@ -250,9 +250,9 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomSurface::TransferSurface(
}
else
{
if (Abs(Umin - U0) < Precision::PConfusion())
if (std::abs(Umin - U0) < Precision::PConfusion())
Umin = U0;
if (Abs(Umax - U1) < Precision::PConfusion())
if (std::abs(Umax - U1) < Precision::PConfusion())
Umax = U1;
uShift = ShapeAnalysis::AdjustToPeriod(Umin, U0, U1);
Umin += uShift;
@@ -269,9 +269,9 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomSurface::TransferSurface(
}
else
{
if (Abs(Vmin - V0) < Precision::PConfusion())
if (std::abs(Vmin - V0) < Precision::PConfusion())
Vmin = V0;
if (Abs(Vmax - V1) < Precision::PConfusion())
if (std::abs(Vmax - V1) < Precision::PConfusion())
Vmax = V1;
vShift = ShapeAnalysis::AdjustToPeriod(Vmin, V0, V1);
Vmin += vShift;
@@ -288,7 +288,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomSurface::TransferSurface(
{
Standard_Real uMaxShift = 0;
uMaxShift = ShapeAnalysis::AdjustToPeriod(Ufin, U0, U1);
if (Abs(uShift - uMaxShift) > Precision::PConfusion())
if (std::abs(uShift - uMaxShift) > Precision::PConfusion())
{
Handle(Geom_BSplineSurface) aBspl =
Handle(Geom_BSplineSurface)::DownCast(mysurface->Copy());
@@ -308,7 +308,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomSurface::TransferSurface(
{
Standard_Real vMaxShift = 0;
vMaxShift = ShapeAnalysis::AdjustToPeriod(Vfin, V0, V1);
if (Abs(vShift - vMaxShift) > Precision::PConfusion())
if (std::abs(vShift - vMaxShift) > Precision::PConfusion())
{
Handle(Geom_BSplineSurface) aBspl =
Handle(Geom_BSplineSurface)::DownCast(mysurface->Copy());
@@ -763,8 +763,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomSurface::TransferSurface(
Handle(IGESData_IGESEntity) Generatrix = GC.TransferCurve(Ligne, V1, V2);
gp_Pnt gen1 = Ligne->Value(V1);
gp_Pnt gen2 = Ligne->Value(V2);
// TheLength = gen1.Distance(gen2)*Cos(start->Cone().SemiAngle());
TheLength = gen1.Distance(gen2);
TheLength = gen1.Distance(gen2);
// creation of the axis : Axis .
Handle(IGESGeom_Line) Axis = new IGESGeom_Line;
@@ -1023,7 +1022,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomSurface::TransferSurface(
GeomToIGES_GeomCurve GC(*this);
// commented by skl 18.07.2005 for OCC9490
Handle(Geom_Curve) CopyCurve;
if (Abs(V1) > Precision::Confusion())
if (std::abs(V1) > Precision::Confusion())
{
CopyCurve = Handle(Geom_Curve)::DownCast(
TheCurve->Translated(start->Value(U1, 0.), start->Value(U1, V1)));
@@ -47,17 +47,17 @@ Quantity_Color IGESCAFControl::DecodeColor(const Standard_Integer color)
Standard_Integer IGESCAFControl::EncodeColor(const Quantity_Color& col)
{
Standard_Integer code = 0;
if (Abs(col.Red() - 1.) <= col.Epsilon())
if (std::abs(col.Red() - 1.) <= col.Epsilon())
code |= 0x001;
else if (Abs(col.Red()) > col.Epsilon())
else if (std::abs(col.Red()) > col.Epsilon())
return 0;
if (Abs(col.Green() - 1.) <= col.Epsilon())
if (std::abs(col.Green() - 1.) <= col.Epsilon())
code |= 0x010;
else if (Abs(col.Green()) > col.Epsilon())
else if (std::abs(col.Green()) > col.Epsilon())
return 0;
if (Abs(col.Blue() - 1.) <= col.Epsilon())
if (std::abs(col.Blue() - 1.) <= col.Epsilon())
code |= 0x100;
else if (Abs(col.Blue()) > col.Epsilon())
else if (std::abs(col.Blue()) > col.Epsilon())
return 0;
switch (code)
@@ -353,7 +353,7 @@ Standard_Boolean IGESControl_IGESBoundary::Transfer(
BRep_Tool::Range(edge3d, first, last);
// pdn 08.04.99 S4135 optimizing in computation of SPTol
// choosing tolerance according to Approx_SameParameter: 50 * 22
Standard_Real SPTol = Min(precision, Abs(last - first) / 1000);
Standard_Real SPTol = std::min(precision, std::abs(last - first) / 1000);
BRep_Builder B;
B.SameParameter(edge3d, Standard_False);
sfe->FixSameParameter(edge3d, SPTol);
@@ -146,15 +146,15 @@ Standard_Boolean IGESControl_Writer::AddShape(const TopoDS_Shape& theSh
}
else if (tolmod < 0)
{ // Least
newtol = Min(Tolv, Tole);
newtol = std::min(Tolv, Tole);
if (oldnb > 0)
newtol = Min(oldtol, newtol);
newtol = std::min(oldtol, newtol);
}
else
{ // Greatest
newtol = Max(Tolv, Tole);
newtol = std::max(Tolv, Tole);
if (oldnb > 0)
newtol = Max(oldtol, newtol);
newtol = std::max(oldtol, newtol);
}
}
@@ -922,7 +922,7 @@ void IGESData_GlobalSection::SetMaxCoord(const Standard_Real val)
void IGESData_GlobalSection::MaxMaxCoord(const Standard_Real val)
{
Standard_Real aval = Abs(val);
Standard_Real aval = std::abs(val);
if (hasMaxCoord)
{
if (aval > theMaxCoord)
@@ -253,16 +253,17 @@ Standard_Boolean IGESData_ToolLocation::ConvertLocation(const Standard_Real prec
if (m1 < prec || m2 < prec || m3 < prec)
return Standard_False;
Standard_Real mm = (m1 + m2 + m3) / 3.; // here is the average Norm, see Scale
if (Abs(m1 - mm) > prec * mm || Abs(m2 - mm) > prec * mm || Abs(m3 - mm) > prec * mm)
if (std::abs(m1 - mm) > prec * mm || std::abs(m2 - mm) > prec * mm
|| std::abs(m3 - mm) > prec * mm)
return Standard_False;
v1.Divide(m1);
v2.Divide(m2);
v3.Divide(m3);
if (Abs(v1.Dot(v2)) > prec || Abs(v2.Dot(v3)) > prec || Abs(v3.Dot(v1)) > prec)
if (std::abs(v1.Dot(v2)) > prec || std::abs(v2.Dot(v3)) > prec || std::abs(v3.Dot(v1)) > prec)
return Standard_False;
// Here, Orthogonal and same norms. Plus we normalized it
// Remain the other characteristics :
if (Abs(mm - 1.) > prec)
if (std::abs(mm - 1.) > prec)
result.SetScale(gp_Pnt(0, 0, 0), mm);
gp_XYZ tp = loc.TranslationPart();
if (unit != 1.)
@@ -109,5 +109,5 @@ Standard_Real IGESDimen_FlagNote::TextWidth() const
Standard_Real IGESDimen_FlagNote::TipLength() const
{
return (0.5 * (Height() / Tan((35. / 180.) * M_PI)));
return (0.5 * (Height() / std::tan((35. / 180.) * M_PI)));
}
@@ -109,8 +109,8 @@ gp_XY IGESDraw_DrawingWithRotation::ViewToDrawing(const Standard_Integer NumView
Standard_Real theta = theOrientationAngles->Value(NumView);
Standard_Real XD = XOrigin + theScaleFactor * (XV * Cos(theta) - YV * Sin(theta));
Standard_Real YD = YOrigin + theScaleFactor * (XV * Sin(theta) + YV * Cos(theta));
Standard_Real XD = XOrigin + theScaleFactor * (XV * std::cos(theta) - YV * std::sin(theta));
Standard_Real YD = YOrigin + theScaleFactor * (XV * std::sin(theta) + YV * std::cos(theta));
return (gp_XY(XD, YD));
}
@@ -107,7 +107,7 @@ Standard_Boolean IGESGeom_BSplineCurve::IsPolynomial(const Standard_Boolean flag
Standard_Integer i, i1 = theWeights->Lower(), i2 = theWeights->Upper();
Standard_Real w0 = theWeights->Value(i1);
for (i = i1 + 1; i <= i2; i++)
if (Abs(theWeights->Value(i) - w0) > 1.e-10)
if (std::abs(theWeights->Value(i) - w0) > 1.e-10)
return Standard_False;
return Standard_True;
}
@@ -126,7 +126,7 @@ Standard_Boolean IGESGeom_BSplineSurface::IsPolynomial(const Standard_Boolean fl
*/
for (j = 0; j < (theIndexV + 1); j++)
for (i = 0; i < (theIndexU + 1); i++)
if (Abs(theWeights->Value(i, j) - w0) > 1.e-10)
if (std::abs(theWeights->Value(i, j) - w0) > 1.e-10)
return Standard_False;
return Standard_True;
}
@@ -99,7 +99,7 @@ Standard_Real IGESGeom_CircularArc::Radius() const
x2 = theCenter.X();
y2 = theCenter.Y();
Standard_Real radius = Sqrt(Square(x2 - x1) + Square(y2 - y1));
Standard_Real radius = std::sqrt(Square(x2 - x1) + Square(y2 - y1));
return radius;
}
@@ -139,6 +139,6 @@ gp_Dir IGESGeom_CircularArc::TransformedAxis() const
Standard_Boolean IGESGeom_CircularArc::IsClosed() const
{
return (Abs(theStart.X() - theEnd.X()) < Precision::PConfusion()
&& Abs(theStart.Y() - theEnd.Y()) < Precision::PConfusion());
return (std::abs(theStart.X() - theEnd.X()) < Precision::PConfusion()
&& std::abs(theStart.Y() - theEnd.Y()) < Precision::PConfusion());
}
@@ -132,9 +132,9 @@ Standard_Integer IGESGeom_ConicArc::ComputedFormNumber() const
//[Q1] = L^-4, [Q2]=L^-4, [Q3]=L^-2
if (Q2 > eps4 && Q1 * Q3 < 0)
return 1; // Ellipse
if (Q2 < -eps4 && Abs(Q1) > eps4)
if (Q2 < -eps4 && std::abs(Q1) > eps4)
return 2; // Hyperbola
if (Abs(Q2) <= eps4 && Abs(Q1) > eps4)
if (std::abs(Q2) <= eps4 && std::abs(Q1) > eps4)
return 3; // Parabola
return 0;
}
@@ -239,14 +239,14 @@ void IGESGeom_ConicArc::ComputedDefinition(Standard_Real& Xcen,
if (IsFromParabola())
{
Rmin = Rmax = -1.; // radii : there are none
if ((Abs(a) <= eps) && (Abs(b) <= eps))
if ((std::abs(a) <= eps) && (std::abs(b) <= eps))
{
Xcen = (f * c - e * e) / c / d / 2.;
Ycen = e / c;
Standard_Real focal = -d / c;
Xax = (focal >= 0 ? 1. : -1.);
Yax = 0.;
Rmin = Rmax = Abs(focal);
Rmin = Rmax = std::abs(focal);
}
else
{
@@ -261,14 +261,14 @@ void IGESGeom_ConicArc::ComputedDefinition(Standard_Real& Xcen,
Ycen = (-cc * dd - f * a) / dn;
Standard_Real teta = M_PI / 2.;
if (Abs(b) > eps)
teta = ATan(-a / b);
if (std::abs(b) > eps)
teta = std::atan(-a / b);
if (fc < 0)
teta += M_PI;
Xax = Cos(teta);
Yax = Sin(teta);
Xax = std::cos(teta);
Yax = std::sin(teta);
Rmin = Rmax = Abs(fc) / sqrt(a * a + b * b) / 2.;
Rmin = Rmax = std::abs(fc) / sqrt(a * a + b * b) / 2.;
}
}
@@ -291,7 +291,7 @@ void IGESGeom_ConicArc::ComputedDefinition(Standard_Real& Xcen,
Standard_Real cos2t;
Standard_Real auxil;
if (Abs(term1) < gp::Resolution())
if (std::abs(term1) < gp::Resolution())
{
cos2t = 1.;
auxil = term2;
@@ -122,12 +122,12 @@ void IGESGeom_ToolCircularArc::OwnCheck(const Handle(IGESGeom_CircularArc)& /*en
/*
//Standard_Real eps = 1.E-04; // Test tolerance ?? //szv#4:S4163:12Mar99 not needed
Standard_Real Rad1 = Sqrt(Square(ent->StartPoint().X() - ent->Center().X()) +
Standard_Real Rad1 = std::sqrt(Square(ent->StartPoint().X() - ent->Center().X()) +
Square(ent->StartPoint().Y() - ent->Center().Y()));
Standard_Real Rad2 = Sqrt(Square(ent->EndPoint().X() - ent->Center().X()) +
Standard_Real Rad2 = std::sqrt(Square(ent->EndPoint().X() - ent->Center().X()) +
Square(ent->EndPoint().Y() - ent->Center().Y()));
Standard_Real ratio = Abs(Rad1 - Rad2) / (Rad1+Rad2);
Standard_Real ratio = std::abs(Rad1 - Rad2) / (Rad1+Rad2);
if (ratio > eps) {
char mess[80];
Sprintf(mess,"Radius at Start & End Points, relative gap over %f",
@@ -67,10 +67,10 @@ void IGESGraph_Color::HLSPercentage(Standard_Real& Hue,
Standard_Real& Saturation) const
{
Hue = ((1.0 / (2.0 * M_PI))
* (ATan(((2 * theRed) - theGreen - theBlue) / (SQRT_3 * (theGreen - theBlue)))));
* (std::atan(((2 * theRed) - theGreen - theBlue) / (SQRT_3 * (theGreen - theBlue)))));
Lightness = ((1.0 / 3.0) * (theRed + theGreen + theBlue));
Saturation = (Sqrt((theRed * theRed) + (theGreen * theGreen) + (theBlue * theBlue)
- (theRed * theGreen) - (theRed * theBlue) - (theBlue * theGreen)));
Saturation = (std::sqrt((theRed * theRed) + (theGreen * theGreen) + (theBlue * theBlue)
- (theRed * theGreen) - (theRed * theBlue) - (theBlue * theGreen)));
}
Standard_Boolean IGESGraph_Color::HasColorName() const
@@ -76,7 +76,7 @@ static void TrimTolerances(const TopoDS_Shape& theShape, const Standard_Real the
ShapeFix_ShapeTolerance aSFST;
aSFST.LimitTolerance(theShape,
0,
Max(theTolerance, Interface_Static::RVal("read.maxprecision.val")));
std::max(theTolerance, Interface_Static::RVal("read.maxprecision.val")));
}
}
} // namespace
@@ -350,9 +350,9 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferConicArc(const Handle(IGESGeom
// small coefficients
// The dimensions should be also obliged:
//[a]=[b]=[c]=L^-2
// if ( (Abs(a-c) <= GetEpsGeom()) && (Abs(b) < GetEpsCoeff()))
// if ( (std::abs(a-c) <= GetEpsGeom()) && (std::abs(b) < GetEpsCoeff()))
constexpr Standard_Real eps2 = Precision::PConfusion() * Precision::PConfusion();
if ((Abs(a - c) <= eps2) && (Abs(b) < eps2))
if ((std::abs(a - c) <= eps2) && (std::abs(b) < eps2))
{
// =================
@@ -370,7 +370,7 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferConicArc(const Handle(IGESGeom
t2 = ElCLib::Parameter(circ, endPoint);
if (t1 > t2 && (t1 - t2) > Precision::Confusion())
t2 += 2. * M_PI;
if (Abs(t1 - t2) <= Precision::Confusion())
if (std::abs(t1 - t2) <= Precision::Confusion())
{ // t1 = t2
Message_Msg msg1160("IGES_1160");
SendWarning(st, msg1160);
@@ -402,7 +402,7 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferConicArc(const Handle(IGESGeom
t1 = ElCLib::Parameter(parab, startPoint);
t2 = ElCLib::Parameter(parab, endPoint);
if (Abs(t1 - t2) <= Precision::Confusion())
if (std::abs(t1 - t2) <= Precision::Confusion())
{ // t1 = t2
Message_Msg msg1160("IGES_1160");
SendWarning(st, msg1160);
@@ -433,7 +433,7 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferConicArc(const Handle(IGESGeom
t2 = ElCLib::Parameter(elips, endPoint);
if (t2 < t1 && (t1 - t2) > Precision::Confusion())
t2 += 2. * M_PI;
if (Abs(t1 - t2) <= Precision::Confusion())
if (std::abs(t1 - t2) <= Precision::Confusion())
{ // t1 = t2
Message_Msg msg1160("IGES_1160");
SendWarning(st, msg1160);
@@ -454,7 +454,7 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferConicArc(const Handle(IGESGeom
res = new Geom_Hyperbola(frame, majorRadius, minorRadius);
// pdn taking PConfusion for parameters.
if (Abs(t1 - t2) <= Precision::PConfusion())
if (std::abs(t1 - t2) <= Precision::PConfusion())
{ // t1 = t2
Message_Msg msg1160("IGES_1160");
SendWarning(st, msg1160);
@@ -530,9 +530,9 @@ Handle(Geom2d_Curve) IGESToBRep_BasicCurve::Transfer2dConicArc(const Handle(IGES
{
// #60 rln 29.12.98 PRO17015
// if ( (Abs(a-c) <= GetEpsGeom()) && (Abs(b) < GetEpsCoeff()))
// if ( (std::abs(a-c) <= GetEpsGeom()) && (std::abs(b) < GetEpsCoeff()))
constexpr Standard_Real eps2 = Precision::PConfusion() * Precision::PConfusion();
if ((Abs(a - c) <= eps2) && (Abs(b) < eps2))
if ((std::abs(a - c) <= eps2) && (std::abs(b) < eps2))
{
// =================
@@ -555,7 +555,7 @@ Handle(Geom2d_Curve) IGESToBRep_BasicCurve::Transfer2dConicArc(const Handle(IGES
if (t2 < t1 && (t1 - t2) > Precision::PConfusion())
t2 += 2. * M_PI;
if (Abs(t1 - t2) <= Precision::PConfusion())
if (std::abs(t1 - t2) <= Precision::PConfusion())
{ // t1 = t2
Message_Msg msg1160("IGES_1160");
SendWarning(st, msg1160);
@@ -589,7 +589,7 @@ Handle(Geom2d_Curve) IGESToBRep_BasicCurve::Transfer2dConicArc(const Handle(IGES
t1 = ElCLib::Parameter(parab, startPoint);
t2 = ElCLib::Parameter(parab, endPoint);
if (Abs(t1 - t2) <= Precision::PConfusion())
if (std::abs(t1 - t2) <= Precision::PConfusion())
{ // t1 = t2
Message_Msg msg1160("IGES_1160");
SendWarning(st, msg1160);
@@ -626,7 +626,7 @@ Handle(Geom2d_Curve) IGESToBRep_BasicCurve::Transfer2dConicArc(const Handle(IGES
t2 = ElCLib::Parameter(elips, endPoint);
if (t2 < t1 && (t1 - t2) > Precision::PConfusion())
t2 += 2. * M_PI;
if (Abs(t1 - t2) <= Precision::PConfusion())
if (std::abs(t1 - t2) <= Precision::PConfusion())
{ // t1 = t2
Message_Msg msg1160("IGES_1160");
SendWarning(st, msg1160);
@@ -650,7 +650,7 @@ Handle(Geom2d_Curve) IGESToBRep_BasicCurve::Transfer2dConicArc(const Handle(IGES
t1 = ElCLib::Parameter(hpr, startPoint);
t2 = ElCLib::Parameter(hpr, endPoint);
if (Abs(t1 - t2) <= Precision::PConfusion())
if (std::abs(t1 - t2) <= Precision::PConfusion())
{ // t1 = t2
Message_Msg msg1160("IGES_1160");
SendWarning(st, msg1160);
@@ -866,7 +866,7 @@ Handle(Geom_BSplineCurve) IGESToBRep_BasicCurve::TransferSplineCurve(
// Checking C2 and C1 continuity :
// ===============================
IGESConvGeom::IncreaseCurveContinuity(resconv,
Min(Precision::Confusion(), epsgeom),
std::min(Precision::Confusion(), epsgeom),
GetContinuity());
return resconv;
}
@@ -986,7 +986,7 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferBSplineCurve(
Standard_Real Knot2 = start->Knot(i - 1);
// Standard_Real ek = Epsilon(Knot1);
if (Abs(Knot1 - Knot2) <= Epsilon(Knot1))
if (std::abs(Knot1 - Knot2) <= Epsilon(Knot1))
TempMult.SetValue(KnotIndex, TempMult.Value(KnotIndex) + 1);
else
TempKnot.SetValue(++KnotIndex, Knot1);
@@ -1091,7 +1091,7 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferBSplineCurve(
for (i = 0; i <= start->UpperIndex(); i++)
{
polynomial =
Abs(start->Weight(i) - WeightReference) <= Epsilon(WeightReference) && polynomial;
std::abs(start->Weight(i) - WeightReference) <= Epsilon(WeightReference) && polynomial;
//: 39 by abv 15.12.97
Standard_Real weight = start->Weight(i);
if (weight < Precision::PConfusion())
@@ -1178,7 +1178,7 @@ Handle(Geom_Curve) IGESToBRep_BasicCurve::TransferBSplineCurve(
try
{
OCC_CATCH_SIGNALS
if (Abs(Ufin - Udeb) > Precision::PConfusion())
if (std::abs(Ufin - Udeb) > Precision::PConfusion())
BSplineRes->Segment(Udeb, Ufin);
res = BSplineRes;
}
@@ -1517,7 +1517,7 @@ Handle(Geom_BSplineCurve) IGESToBRep_BasicCurve::TransferCopiousData(
res = new Geom_BSplineCurve(Pole, Knot, Mult, Degree);
IGESConvGeom::IncreaseCurveContinuity(res,
Max(GetEpsGeom() / 10., Precision::Confusion()),
std::max(GetEpsGeom() / 10., Precision::Confusion()),
GetContinuity());
return res;
}
@@ -1625,7 +1625,7 @@ Handle(Geom2d_BSplineCurve) IGESToBRep_BasicCurve::Transfer2dCopiousData(
Standard_Real anUVResolution = GetUVResolution();
IGESConvGeom::IncreaseCurveContinuity(res,
Max(Precision::Confusion(), epsGeom * anUVResolution),
std::max(Precision::Confusion(), epsGeom * anUVResolution),
GetContinuity());
return res;
}
@@ -667,7 +667,7 @@ Handle(Geom_BSplineSurface) IGESToBRep_BasicSurface::TransferBSplineSurface(
Standard_Real UKnot1 = start->KnotU(i);
Standard_Real UKnot2 = start->KnotU(i - 1);
if (Abs(UKnot1 - UKnot2) <= Epsilon(UKnot2))
if (std::abs(UKnot1 - UKnot2) <= Epsilon(UKnot2))
TempUMult.SetValue(UIndex, TempUMult.Value(UIndex) + 1);
else
TempUKnot.SetValue(++UIndex, UKnot1);
@@ -739,7 +739,7 @@ Handle(Geom_BSplineSurface) IGESToBRep_BasicSurface::TransferBSplineSurface(
Standard_Real VKnot1 = start->KnotV(i);
Standard_Real VKnot2 = start->KnotV(i - 1);
if (Abs(VKnot1 - VKnot2) <= Epsilon(VKnot2))
if (std::abs(VKnot1 - VKnot2) <= Epsilon(VKnot2))
TempVMult.SetValue(VIndex, TempVMult.Value(VIndex) + 1);
else
TempVKnot.SetValue(++VIndex, VKnot1);
@@ -895,8 +895,8 @@ Handle(Geom_BSplineSurface) IGESToBRep_BasicSurface::TransferBSplineSurface(
{
for (j = 0; j <= start->UpperIndexV(); j++)
{
polynomial =
(Abs(start->Weight(i, j) - WeightReference) <= Epsilon(WeightReference)) && polynomial;
polynomial = (std::abs(start->Weight(i, j) - WeightReference) <= Epsilon(WeightReference))
&& polynomial;
//: 39 by abv 15.12.97
Standard_Real weight = start->Weight(i, j);
if (weight < Precision::PConfusion())
@@ -134,7 +134,7 @@ void IGESToBRep_CurveAndSurface::UpdateMinMaxTol()
{
// #74 rln 11.03.99 S4135: Setting maximum tolerances according to
// static parameter
myMaxTol = Max(Interface_Static::RVal("read.maxprecision.val"), myEpsGeom * myUnitFactor);
myMaxTol = std::max(Interface_Static::RVal("read.maxprecision.val"), myEpsGeom * myUnitFactor);
myMinTol = Precision::Confusion();
}
@@ -653,7 +653,7 @@ Standard_Real IGESToBRep_CurveAndSurface::GetUVResolution()
{
myIsResolCom = Standard_True;
GeomAdaptor_Surface aGAS(mySurface);
myUVResolution = Min(aGAS.UResolution(1.), aGAS.VResolution(1.));
myUVResolution = std::min(aGAS.UResolution(1.), aGAS.VResolution(1.));
}
return myUVResolution;
}
@@ -332,8 +332,8 @@ void IGESToBRep_IGESBoundary::ReverseCurves3d(const Handle(ShapeExtend_WireData)
newedge,
curve->Reversed(),
L,
Max(curve->ReversedParameter(curve->LastParameter()), curve->ReversedParameter(p2)),
Min(curve->ReversedParameter(curve->FirstParameter()), curve->ReversedParameter(p1)));
std::max(curve->ReversedParameter(curve->LastParameter()), curve->ReversedParameter(p2)),
std::min(curve->ReversedParameter(curve->FirstParameter()), curve->ReversedParameter(p1)));
newedge.Orientation(TopAbs::Reverse(oldedge.Orientation()));
// sewd->Set (newedge, i);
B.Add(W, newedge);
@@ -373,8 +373,9 @@ void IGESToBRep_IGESBoundary::ReverseCurves2d(const Handle(ShapeExtend_WireData)
newedge,
curve->Reversed(),
face,
Max(curve->FirstParameter(), curve->ReversedParameter(p2)), // BUC50001 entity 936 2DForced
Min(curve->LastParameter(), curve->ReversedParameter(p1)));
std::max(curve->FirstParameter(),
curve->ReversedParameter(p2)), // BUC50001 entity 936 2DForced
std::min(curve->LastParameter(), curve->ReversedParameter(p1)));
newedge.Orientation(oldedge.Orientation());
sewd->Set(newedge, i);
}
@@ -101,7 +101,7 @@ static void TrimTolerances(const TopoDS_Shape& theShape, const Standard_Real the
ShapeFix_ShapeTolerance SFST;
SFST.LimitTolerance(theShape,
0,
Max(theTolerance, Interface_Static::RVal("read.maxprecision.val")));
std::max(theTolerance, Interface_Static::RVal("read.maxprecision.val")));
}
}
} // namespace
@@ -605,7 +605,8 @@ TopoDS_Shape IGESToBRep_TopoSurface::TransferRuledSurface(const Handle(IGESGeom_
Standard_Real First, Last;
Handle(Geom_Curve) curve =
Handle(Geom_Curve)::DownCast(BRep_Tool::Curve(edge, L, First, Last)->Copy());
if (Abs(First) <= Precision::PConfusion() && Abs(Last - 1.) <= Precision::PConfusion())
if (std::abs(First) <= Precision::PConfusion()
&& std::abs(Last - 1.) <= Precision::PConfusion())
continue;
Handle(Geom_BSplineCurve) bscurve;
@@ -1098,7 +1099,8 @@ TopoDS_Shape IGESToBRep_TopoSurface::TransferOffsetSurface(const Handle(IGESGeom
if (geomSupport->Continuity() == GeomAbs_C0)
{
res =
ShapeAlgo::AlgoContainer()->C0ShapeToC1Shape(face, Abs(st->Distance()) * GetUnitFactor());
ShapeAlgo::AlgoContainer()->C0ShapeToC1Shape(face,
std::abs(st->Distance()) * GetUnitFactor());
if (res.ShapeType() != TopAbs_FACE)
{
Message_Msg msg1266("IGES_1266");
@@ -1922,9 +1924,9 @@ TopoDS_Shape IGESToBRep_TopoSurface::ParamSurface(const Handle(IGESData_IGESEnti
}
}
if (Abs(paramu) <= Precision::Confusion())
if (std::abs(paramu) <= Precision::Confusion())
paramu = 0.;
if (Abs(paramv) <= Precision::Confusion())
if (std::abs(paramv) <= Precision::Confusion())
paramv = 0.;
// S4181 pdn 16.04.99 computation of transformation depending on
@@ -1969,7 +1971,7 @@ TopoDS_Shape IGESToBRep_TopoSurface::ParamSurface(const Handle(IGESData_IGESEnti
Standard_Real Umin, Umax, Vmin, Vmax;
// scaling parameterization from [0,1]
Surf->Bounds(Umin, Umax, Vmin, Vmax);
uln = Abs(Umax - Umin);
uln = std::abs(Umax - Umin);
// computing shift of pcurves
uscale = uln / cscale;
paramu = Umin / uln;
@@ -206,7 +206,7 @@ bool RWObj_MtlReader::Read(const TCollection_AsciiString& theFolder,
aPos = aNext;
if (aSpecular >= 0.0)
{
aMat.Shininess = (float)Min(aSpecular / 1000.0, 1.0);
aMat.Shininess = (float)std::min(aSpecular / 1000.0, 1.0);
hasAspect = true;
}
}
@@ -539,9 +539,11 @@ Standard_Integer RWObj_Reader::triangulatePolygon(
// map polygon onto plane
gp_XYZ aXDir;
{
const double aAbsXYZ[] = {Abs(aPolygonNorm.X()), Abs(aPolygonNorm.Y()), Abs(aPolygonNorm.Z())};
Standard_Integer aMinI = (aAbsXYZ[0] < aAbsXYZ[1]) ? 0 : 1;
aMinI = (aAbsXYZ[aMinI] < aAbsXYZ[2]) ? aMinI : 2;
const double aAbsXYZ[] = {std::abs(aPolygonNorm.X()),
std::abs(aPolygonNorm.Y()),
std::abs(aPolygonNorm.Z())};
Standard_Integer aMinI = (aAbsXYZ[0] < aAbsXYZ[1]) ? 0 : 1;
aMinI = (aAbsXYZ[aMinI] < aAbsXYZ[2]) ? aMinI : 2;
const Standard_Integer aI1 = (aMinI + 1) % 3 + 1;
const Standard_Integer aI2 = (aMinI + 2) % 3 + 1;
aXDir.ChangeCoord(aMinI + 1) = 0;
@@ -91,7 +91,7 @@ protected:
// Set basic properties
aMaterial.DiffuseColor = mySurfaceColor;
aMaterial.Transparency = myTransparency;
aMaterial.Transparency = static_cast<Standard_ShortReal>(myTransparency);
// Calculate ambient color based on ambient factor
aMaterial.AmbientColor = Quantity_Color(mySurfaceColor.Red() * myAmbientFactor,
@@ -114,9 +114,9 @@ protected:
const Quantity_Color& theC2,
const Standard_Real theTol = 0.01)
{
return (Abs(theC1.Red() - theC2.Red()) <= theTol)
&& (Abs(theC1.Green() - theC2.Green()) <= theTol)
&& (Abs(theC1.Blue() - theC2.Blue()) <= theTol);
return (std::abs(theC1.Red() - theC2.Red()) <= theTol)
&& (std::abs(theC1.Green() - theC2.Green()) <= theTol)
&& (std::abs(theC1.Blue() - theC2.Blue()) <= theTol);
}
// Test member variables
@@ -342,7 +342,7 @@ TEST_F(STEPConstruct_RenderingPropertiesTest, InitWithRGBAColor)
STEPConstruct_RenderingProperties aProps;
// Create an RGBA color with alpha = 0.6 (transparency = 0.4)
Quantity_ColorRGBA aRgba(Quantity_Color(0.3, 0.6, 0.9, Quantity_TOC_RGB), 0.6);
Quantity_ColorRGBA aRgba(Quantity_Color(0.3, 0.6, 0.9, Quantity_TOC_RGB), 0.6f);
aProps.Init(aRgba);
@@ -82,7 +82,7 @@ GeomToStep_MakeRectangularTrimmedSurface::GeomToStep_MakeRectangularTrimmedSurfa
Handle(Geom_ConicalSurface) conicS = Handle(Geom_ConicalSurface)::DownCast(theSurf);
Standard_Real semAng = conicS->SemiAngle();
uFact = AngleFact;
vFact = Cos(semAng) / LengthFact;
vFact = std::cos(semAng) / LengthFact;
}
else if (theSurf->IsKind(STANDARD_TYPE(Geom_Plane)))
{
@@ -280,7 +280,7 @@ void RWStepGeom_RWBSplineCurveWithKnots::Check(const Handle(StepGeom_BSplineCurv
for (i = 2; i <= nbKno; i++)
{
Standard_Real distKn = ent->KnotsValue(i - 1) - ent->KnotsValue(i);
if (Abs(distKn) <= RealEpsilon())
if (std::abs(distKn) <= RealEpsilon())
ach->AddWarning("WARNING: Curve contains identical KnotsValues");
else if (distKn > RealEpsilon())
ach->AddFail("ERROR: Curve contains descending KnotsValues");
@@ -390,7 +390,7 @@ void RWStepGeom_RWBSplineSurfaceWithKnots::Check(
for (i = 2; i <= nbKnoU; i++)
{
Standard_Real distKn = ent->UKnotsValue(i - 1) - ent->UKnotsValue(i);
if (Abs(distKn) <= RealEpsilon())
if (std::abs(distKn) <= RealEpsilon())
ach->AddWarning("WARNING: Surface contains identical KnotsValues in U");
else if (distKn > RealEpsilon())
ach->AddFail("ERROR: Surface contains descending KnotsValues in U");
@@ -420,7 +420,7 @@ void RWStepGeom_RWBSplineSurfaceWithKnots::Check(
for (i = 2; i <= nbKnoV; i++)
{
Standard_Real distKn = ent->VKnotsValue(i - 1) - ent->VKnotsValue(i);
if (Abs(distKn) <= RealEpsilon())
if (std::abs(distKn) <= RealEpsilon())
ach->AddWarning("WARNING: Surface contains identical KnotsValues in V");
else if (distKn > RealEpsilon())
ach->AddFail("ERROR: Surface contains descending KnotsValues in V");
@@ -57,7 +57,7 @@ void RWStepGeom_RWCartesianPoint::ReadStep(const Handle(StepData_StepReaderData)
{
ach->AddWarning("More than 3 coordinates, ignored");
}
nbcoord = Min(nb2, 3);
nbcoord = std::min(nb2, 3);
for (Standard_Integer i2 = 0; i2 < nbcoord; i2++)
{
if (data->ReadReal(nsub2, i2 + 1, "coordinates", ach, aCoordinatesItem))
@@ -50,7 +50,7 @@ void RWStepGeom_RWDirection::ReadStep(const Handle(StepData_StepReaderData)& dat
{
ach->AddWarning("More than 3 direction ratios, ignored");
}
aNbCoord = Min(aNbElements, 3);
aNbCoord = std::min(aNbElements, 3);
for (Standard_Integer i2 = 0; i2 < aNbCoord; i2++)
{
if (data->ReadReal(aNSub2, i2 + 1, "direction_ratios", ach, aCoordinatesItem))
@@ -93,7 +93,7 @@ void RWStepGeom_RWDirection::Check(const Handle(StepGeom_Direction)& ent,
Standard_Integer i;
for (i = 1; i <= nbVal; i++)
{
if (Abs(ent->DirectionRatiosValue(i)) >= RealEpsilon())
if (std::abs(ent->DirectionRatiosValue(i)) >= RealEpsilon())
break;
}
if (i > nbVal)
@@ -83,7 +83,7 @@ void RWStepGeom_RWVector::Check(const Handle(StepGeom_Vector)& ent,
const Interface_ShareTool&,
Handle(Interface_Check)& ach) const
{
if (Abs(ent->Magnitude()) < RealEpsilon())
if (std::abs(ent->Magnitude()) < RealEpsilon())
{
ach->AddFail("ERROR: Magnitude of Vector = 0.0");
}
@@ -99,12 +99,12 @@ Standard_Boolean AreEndsMatch(const Handle(StepShape_EdgeCurve)& theEdgeCurve)
}
const Standard_Real aDistance =
Sqrt((aStartPoint->CoordinatesValue(1) - anEndPoint->CoordinatesValue(1))
* (aStartPoint->CoordinatesValue(1) - anEndPoint->CoordinatesValue(1))
+ (aStartPoint->CoordinatesValue(2) - anEndPoint->CoordinatesValue(2))
* (aStartPoint->CoordinatesValue(2) - anEndPoint->CoordinatesValue(2))
+ (aStartPoint->CoordinatesValue(3) - anEndPoint->CoordinatesValue(3))
* (aStartPoint->CoordinatesValue(3) - anEndPoint->CoordinatesValue(3)));
std::sqrt((aStartPoint->CoordinatesValue(1) - anEndPoint->CoordinatesValue(1))
* (aStartPoint->CoordinatesValue(1) - anEndPoint->CoordinatesValue(1))
+ (aStartPoint->CoordinatesValue(2) - anEndPoint->CoordinatesValue(2))
* (aStartPoint->CoordinatesValue(2) - anEndPoint->CoordinatesValue(2))
+ (aStartPoint->CoordinatesValue(3) - anEndPoint->CoordinatesValue(3))
* (aStartPoint->CoordinatesValue(3) - anEndPoint->CoordinatesValue(3)));
return aDistance < Precision::Confusion();
}
} // namespace
@@ -62,7 +62,7 @@ void RWStepVisual_RWCoordinatesList::ReadStep(const Handle(StepData_StepReaderDa
{
ach->AddWarning("More than 3 coordinates, ignored");
}
Standard_Integer nbcoord = Min(nb3, 3);
Standard_Integer nbcoord = std::min(nb3, 3);
for (Standard_Integer j = 1; j <= nbcoord; j++)
{
Standard_Real aVal = 0.;
@@ -4193,7 +4193,7 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt,
{
aVal = aVal * anUnitCtxLowerBound.LengthFactor();
}
aDim2 = Abs(aVal);
aDim2 = std::abs(aVal);
}
else
{
@@ -3635,7 +3635,7 @@ static Handle(StepDimTol_HArray1OfDatumSystemOrReference) WriteDatumSystem(
if (aDatumObj.IsNull())
continue;
aDatums.Append(aDatumObj);
aMaxDatumNum = Max(aMaxDatumNum, aDatumObj->GetPosition());
aMaxDatumNum = std::max(aMaxDatumNum, aDatumObj->GetPosition());
}
if (aMaxDatumNum == 0)
return NULL;
@@ -308,7 +308,7 @@ XCAFDoc_VisMaterialCommon STEPConstruct_RenderingProperties::CreateXCAFMaterial(
if (myAmbientReflectance.second)
{
// Get the reflectance factor, clamped to valid range
const Standard_Real aAmbientFactor = Max(0.0, Min(1.0, myAmbientReflectance.first));
const Standard_Real aAmbientFactor = std::max(0.0, std::min(1.0, myAmbientReflectance.first));
// Apply factor to surface color (RGB components individually)
const Standard_Real aRed = mySurfaceColor.Red() * aAmbientFactor;
@@ -328,7 +328,7 @@ XCAFDoc_VisMaterialCommon STEPConstruct_RenderingProperties::CreateXCAFMaterial(
else if (mySpecularReflectance.second)
{
// Apply specular reflectance factor to surface color
const Standard_Real aSpecularFactor = Max(0.0, Min(1.0, mySpecularReflectance.first));
const Standard_Real aSpecularFactor = std::max(0.0, std::min(1.0, mySpecularReflectance.first));
const Standard_Real aRed = mySurfaceColor.Red() * aSpecularFactor;
const Standard_Real aGreen = mySurfaceColor.Green() * aSpecularFactor;
@@ -344,7 +344,7 @@ XCAFDoc_VisMaterialCommon STEPConstruct_RenderingProperties::CreateXCAFMaterial(
// Convert STEP specular exponent to XCAF shininess using fixed scale factor
const Standard_Real kScaleFactor = 128.0;
const Standard_Real aShininess = mySpecularExponent.first / kScaleFactor;
aMaterial.Shininess = (Standard_ShortReal)Min(1.0, aShininess);
aMaterial.Shininess = (Standard_ShortReal)std::min(1.0, aShininess);
}
return aMaterial;
@@ -516,7 +516,7 @@ void STEPConstruct_RenderingProperties::Init(const XCAFDoc_VisMaterialCommon& th
const Standard_Real aDiffBlue = theMaterial.DiffuseColor.Blue();
// Find maximum diffuse component to avoid division by zero for dark colors
const Standard_Real aDiffMax = Max(aDiffRed, Max(aDiffGreen, aDiffBlue));
const Standard_Real aDiffMax = std::max(aDiffRed, std::max(aDiffGreen, aDiffBlue));
// Check if ambient color is non-default and diffuse color has non-zero components
if (aDiffMax > Precision::Confusion())
@@ -533,8 +533,8 @@ void STEPConstruct_RenderingProperties::Init(const XCAFDoc_VisMaterialCommon& th
const Standard_Real aBlue = (aDiffBlue > Precision::Confusion()) ? aAmbBlue / aDiffBlue : 0.0;
// Calculate min and max of RGB ratios
const Standard_Real aMin = Min(aRed, Min(aGreen, aBlue));
const Standard_Real aMax = Max(aRed, Max(aGreen, aBlue));
const Standard_Real aMin = std::min(aRed, std::min(aGreen, aBlue));
const Standard_Real aMax = std::max(aRed, std::max(aGreen, aBlue));
// If ratios are reasonably close, use average as ambient reflectance factor
// otherwise the ambient color isn't a simple multiplier of diffuse
@@ -545,10 +545,10 @@ void STEPConstruct_RenderingProperties::Init(const XCAFDoc_VisMaterialCommon& th
Standard_Real aAmbientFactor = (aRed + aGreen + aBlue) / 3.0;
// Check if factor is significantly different from default (0.1)
if (Abs(aAmbientFactor - 0.1) > 0.01)
if (std::abs(aAmbientFactor - 0.1) > 0.01)
{
// Clamp to valid range
aAmbientFactor = Max(0.0, Min(1.0, aAmbientFactor));
aAmbientFactor = std::max(0.0, std::min(1.0, aAmbientFactor));
myAmbientReflectance.first = aAmbientFactor;
myAmbientReflectance.second = Standard_True;
@@ -576,8 +576,8 @@ void STEPConstruct_RenderingProperties::Init(const XCAFDoc_VisMaterialCommon& th
const Standard_Real aBlue = (aDiffBlue > Precision::Confusion()) ? aSpecBlue / aDiffBlue : 0.0;
// Calculate min and max of RGB ratios
const Standard_Real aMin = Min(aRed, Min(aGreen, aBlue));
const Standard_Real aMax = Max(aRed, Max(aGreen, aBlue));
const Standard_Real aMin = std::min(aRed, std::min(aGreen, aBlue));
const Standard_Real aMax = std::max(aRed, std::max(aGreen, aBlue));
// If ratios are reasonably close, use average as specular reflectance factor
const Standard_Real kMaxRatioDeviation = 0.2; // Max allowed deviation between RGB ratios
@@ -587,10 +587,10 @@ void STEPConstruct_RenderingProperties::Init(const XCAFDoc_VisMaterialCommon& th
Standard_Real aSpecularFactor = (aRed + aGreen + aBlue) / 3.0;
// Check if factor is significantly different from default (0.2)
if (Abs(aSpecularFactor - 0.2) > 0.01)
if (std::abs(aSpecularFactor - 0.2) > 0.01)
{
// Clamp to valid range
aSpecularFactor = Max(0.0, Min(1.0, aSpecularFactor));
aSpecularFactor = std::max(0.0, std::min(1.0, aSpecularFactor));
mySpecularReflectance.first = aSpecularFactor;
mySpecularReflectance.second = Standard_True;
@@ -611,7 +611,7 @@ void STEPConstruct_RenderingProperties::Init(const XCAFDoc_VisMaterialCommon& th
}
// Convert shininess to specular exponent using fixed scale factor
if (theMaterial.Shininess >= 0.0f && Abs(theMaterial.Shininess - 1.0f) > 0.01f)
if (theMaterial.Shininess >= 0.0f && std::abs(theMaterial.Shininess - 1.0f) > 0.01f)
{
const Standard_Real kScaleFactor = 128.0;
mySpecularExponent.first = theMaterial.Shininess * kScaleFactor;
@@ -496,7 +496,7 @@ static void getSDR(const Handle(StepRepr_ProductDefinitionShape)& PDS,
listSDR->Append(sdr);
else
{
Standard_Integer iDiff = Abs(FindShapeReprType(rep) - ICS);
Standard_Integer iDiff = std::abs(FindShapeReprType(rep) - ICS);
// if more suitable representation is found, drop previous if any selected
if (iDiff < delta)
{
@@ -2104,7 +2104,7 @@ void STEPControl_ActorRead::PrepareUnits(const Handle(StepRepr_Representation)&
TP->AddWarning(theRepCont, "No Length Uncertainty, value of read.precision.val is taken");
myPrecision = aStepModel->InternalParameters.ReadPrecisionVal;
}
myMaxTol = Max(myPrecision, aStepModel->InternalParameters.ReadMaxPrecisionVal);
myMaxTol = std::max(myPrecision, aStepModel->InternalParameters.ReadMaxPrecisionVal);
// Assign uncertainty
#ifdef TRANSLOG
if (TP->TraceLevel() > 1)
@@ -2120,7 +2120,7 @@ void STEPControl_ActorRead::ResetUnits(Handle(StepData_StepModel)& theModel,
{
theLocalFactors.InitializeFactors(1, 1, 1);
myPrecision = theModel->InternalParameters.ReadPrecisionVal;
myMaxTol = Max(myPrecision, theModel->InternalParameters.ReadMaxPrecisionVal);
myMaxTol = std::max(myPrecision, theModel->InternalParameters.ReadMaxPrecisionVal);
}
//=================================================================================================
@@ -1787,7 +1787,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferSubShape(
STEPConstruct_Assembly mkitem;
// make location for assembly placement
if (Abs(aLoc.ScaleFactor() - 1.0) > Precision::Confusion())
if (std::abs(aLoc.ScaleFactor() - 1.0) > Precision::Confusion())
{
if (aStepModel->InternalParameters.WriteScalingTrsf)
FP->AddWarning(
@@ -1796,7 +1796,7 @@ Handle(Transfer_Binder) STEPControl_ActorWrite::TransferSubShape(
else
FP->AddWarning(start, "The shape has a scaling factor, skipped");
}
if (Abs(aLoc.ScaleFactor() - 1.0) < Precision::Confusion()
if (std::abs(aLoc.ScaleFactor() - 1.0) < Precision::Confusion()
|| !aStepModel->InternalParameters.WriteScalingTrsf)
{
// create a new axis2placement3d
@@ -89,7 +89,7 @@ struct StepTidy_CircleHasher
// Compare radius.
constexpr Standard_Real aTolerance = 1e-12;
if (Abs(theCircle1->Radius() - theCircle2->Radius()) > aTolerance)
if (std::abs(theCircle1->Radius() - theCircle2->Radius()) > aTolerance)
{
return false;
}
@@ -756,7 +756,7 @@ Handle(TBSplineCurve) MakeBSplineCurveCommon(
Standard_Real lastKnot = RealFirst();
for (Standard_Integer i = 1; i <= NbKnots; ++i)
{
if (aKnots->Value(i) - lastKnot > Epsilon(Abs(lastKnot)))
if (aKnots->Value(i) - lastKnot > Epsilon(std::abs(lastKnot)))
{
NbUniqueKnots++;
lastKnot = aKnots->Value(i);
@@ -774,7 +774,7 @@ Handle(TBSplineCurve) MakeBSplineCurveCommon(
Standard_Integer aKnotPosition = 1;
for (Standard_Integer i = 2; i <= NbKnots; i++)
{
if (aKnots->Value(i) - lastKnot > Epsilon(Abs(lastKnot)))
if (aKnots->Value(i) - lastKnot > Epsilon(std::abs(lastKnot)))
{
aKnotPosition++;
aUniqueKnots.SetValue(aKnotPosition, aKnots->Value(i));
@@ -977,7 +977,7 @@ Handle(Geom_BSplineSurface) StepToGeom::MakeBSplineSurface(
Standard_Integer NUKnotsUnique = 0;
for (i = 1; i <= NUKnots; i++)
{
if (aUKnots->Value(i) - lastKnot > Epsilon(Abs(lastKnot)))
if (aUKnots->Value(i) - lastKnot > Epsilon(std::abs(lastKnot)))
{
NUKnotsUnique++;
lastKnot = aUKnots->Value(i);
@@ -993,7 +993,7 @@ Handle(Geom_BSplineSurface) StepToGeom::MakeBSplineSurface(
UMult.SetValue(1, aUMultiplicities->Value(1));
for (i = 2; i <= NUKnots; i++)
{
if (aUKnots->Value(i) - lastKnot > Epsilon(Abs(lastKnot)))
if (aUKnots->Value(i) - lastKnot > Epsilon(std::abs(lastKnot)))
{
pos++;
KUn.SetValue(pos, aUKnots->Value(i));
@@ -1016,7 +1016,7 @@ Handle(Geom_BSplineSurface) StepToGeom::MakeBSplineSurface(
Standard_Integer NVKnotsUnique = 0;
for (i = 1; i <= NVKnots; i++)
{
if (aVKnots->Value(i) - lastKnot > Epsilon(Abs(lastKnot)))
if (aVKnots->Value(i) - lastKnot > Epsilon(std::abs(lastKnot)))
{
NVKnotsUnique++;
lastKnot = aVKnots->Value(i);
@@ -1032,7 +1032,7 @@ Handle(Geom_BSplineSurface) StepToGeom::MakeBSplineSurface(
VMult.SetValue(1, aVMultiplicities->Value(1));
for (i = 2; i <= NVKnots; i++)
{
if (aVKnots->Value(i) - lastKnot > Epsilon(Abs(lastKnot)))
if (aVKnots->Value(i) - lastKnot > Epsilon(std::abs(lastKnot)))
{
pos++;
KVn.SetValue(pos, aVKnots->Value(i));
@@ -1274,7 +1274,7 @@ Handle(Geom_ConicalSurface) StepToGeom::MakeConicalSurface(
const Standard_Real Ang = SS->SemiAngle() * theLocalFactors.PlaneAngleFactor();
// #2(K3-3) rln 12/02/98 ProSTEP ct_turbine-A.stp entity #518, #3571 (gp::Resolution() is too
// little)
return new Geom_ConicalSurface(A->Ax2(), Max(Ang, Precision::Angular()), R);
return new Geom_ConicalSurface(A->Ax2(), std::max(Ang, Precision::Angular()), R);
}
return 0;
}
@@ -1810,7 +1810,7 @@ Handle(Geom_RectangularTrimmedSurface) StepToGeom::MakeRectangularTrimmedSurface
{
const Handle(Geom_ConicalSurface) conicS = Handle(Geom_ConicalSurface)::DownCast(theBasis);
uFact = AngleFact;
vFact = LengthFact / Cos(conicS->SemiAngle());
vFact = LengthFact / std::cos(conicS->SemiAngle());
}
else if (theBasis->IsKind(STANDARD_TYPE(Geom_Plane)))
{
@@ -1892,7 +1892,7 @@ Handle(Geom_Surface) StepToGeom::MakeSurface(const Handle(StepGeom_Surface)& SS,
if (aBFace.IsDone())
{
const TopoDS_Shape aResult =
ShapeAlgo::AlgoContainer()->C0ShapeToC1Shape(aBFace.Face(), Abs(anOffset));
ShapeAlgo::AlgoContainer()->C0ShapeToC1Shape(aBFace.Face(), std::abs(anOffset));
if (aResult.ShapeType() == TopAbs_FACE)
{
aBasisSurface = BRep_Tool::Surface(TopoDS::Face(aResult));
@@ -2048,8 +2048,8 @@ Handle(Geom_ToroidalSurface) StepToGeom::MakeToroidalSurface(
{
const Standard_Real LF = theLocalFactors.LengthFactor();
return new Geom_ToroidalSurface(A->Ax2(),
Abs(SS->MajorRadius() * LF),
Abs(SS->MinorRadius() * LF));
std::abs(SS->MajorRadius() * LF),
std::abs(SS->MinorRadius() * LF));
}
return 0;
}
@@ -2367,7 +2367,7 @@ Handle(Geom_TrimmedCurve) StepToGeom::MakeTrimmedCurve(const Handle(StepGeom_Tri
else if (trim2 > cl)
trim2 = cl;
}
if (Abs(trim1 - trim2) < Precision::PConfusion())
if (std::abs(trim1 - trim2) < Precision::PConfusion())
{
if (theCurve->IsPeriodic())
{
@@ -2375,7 +2375,7 @@ Handle(Geom_TrimmedCurve) StepToGeom::MakeTrimmedCurve(const Handle(StepGeom_Tri
}
else if (theCurve->IsClosed())
{
if (Abs(trim1 - cf) < Precision::PConfusion())
if (std::abs(trim1 - cf) < Precision::PConfusion())
{
trim2 += cl;
}
@@ -2527,7 +2527,7 @@ Handle(TColStd_HArray1OfReal) StepToGeom::MakeYprRotation(
SR.RotationAboutDirection()->DirectionOfAxis()->DirectionRatiosValue(2),
SR.RotationAboutDirection()->DirectionOfAxis()->DirectionRatiosValue(3));
Standard_Real anAngle = SR.RotationAboutDirection()->RotationAngle();
if (Abs(anAngle) < Precision::Angular())
if (std::abs(anAngle) < Precision::Angular())
{
// a zero rotation is converted trivially
anYPRRotation = new TColStd_HArray1OfReal(1, 3);
@@ -2588,12 +2588,12 @@ Handle(TColStd_HArray1OfReal) StepToGeom::MakeYprRotation(
(!aSiUnit->HasPrefix() ? 1. : STEPConstruct_UnitContext::ConvertSiPrefix(aSiUnit->Prefix()))
* anAngle;
Standard_Real anUcf = SR.RotationAboutDirection()->RotationAngle() / anAngle;
Standard_Real aSA = Sin(anAngle);
Standard_Real aCA = Cos(anAngle);
Standard_Real aSA = std::sin(anAngle);
Standard_Real aCA = std::cos(anAngle);
Standard_Real aYaw = 0, aPitch = 0, aRoll = 0;
// axis parallel either to x-axis or to z-axis?
if (Abs(dy) < Precision::Confusion() && Abs(dx * dz) < Precision::SquareConfusion())
if (std::abs(dy) < Precision::Confusion() && std::abs(dx * dz) < Precision::SquareConfusion())
{
while (anAngle <= -M_PI)
{
@@ -2605,7 +2605,7 @@ Handle(TColStd_HArray1OfReal) StepToGeom::MakeYprRotation(
}
aYaw = anUcf * anAngle;
if (Abs(anAngle - M_PI) >= Precision::Angular())
if (std::abs(anAngle - M_PI) >= Precision::Angular())
{
aRoll = -aYaw;
}
@@ -2617,7 +2617,7 @@ Handle(TColStd_HArray1OfReal) StepToGeom::MakeYprRotation(
anYPRRotation->SetValue(1, 0.);
anYPRRotation->SetValue(2, 0.);
anYPRRotation->SetValue(3, 0.);
if (Abs(dx) >= Precision::Confusion())
if (std::abs(dx) >= Precision::Confusion())
{
if (dx > 0.)
anYPRRotation->SetValue(3, aYaw);
@@ -2635,8 +2635,8 @@ Handle(TColStd_HArray1OfReal) StepToGeom::MakeYprRotation(
}
// axis parallel to y-axis - use y-axis as pitch axis
if (Abs(dy) >= Precision::Confusion() && Abs(dx) < Precision::Confusion()
&& Abs(dz) < Precision::Confusion())
if (std::abs(dy) >= Precision::Confusion() && std::abs(dx) < Precision::Confusion()
&& std::abs(dz) < Precision::Confusion())
{
if (aCA >= 0.)
{
@@ -2648,7 +2648,7 @@ Handle(TColStd_HArray1OfReal) StepToGeom::MakeYprRotation(
aYaw = anUcf * M_PI;
aRoll = aYaw;
}
aPitch = anUcf * ATan2(aSA, Abs(aCA));
aPitch = anUcf * std::atan2(aSA, std::abs(aCA));
if (dy < 0.)
{
aPitch = -aPitch;
@@ -2669,10 +2669,10 @@ Handle(TColStd_HArray1OfReal) StepToGeom::MakeYprRotation(
{dx * dz * aCm1 - dy * aSA, dy * dz * aCm1 + dx * aSA, dz * dz * aCm1 + aCA}};
// aRotMat[1][3] equals SIN(pitch_angle)
if (Abs(Abs(aRotMat[0][2] - 1.)) < Precision::Confusion())
if (std::abs(std::abs(aRotMat[0][2] - 1.)) < Precision::Confusion())
{
// |aPitch| = PI/2
if (Abs(aRotMat[0][2] - 1.) < Precision::Confusion())
if (std::abs(aRotMat[0][2] - 1.) < Precision::Confusion())
aPitch = M_PI_2;
else
aPitch = -M_PI_2;
@@ -2681,7 +2681,7 @@ Handle(TColStd_HArray1OfReal) StepToGeom::MakeYprRotation(
// According to IP `rectangular pitch angle' for ypr_rotation,
// the roll angle is set to zero.
aRoll = 0.;
aYaw = ATan2(aRotMat[1][0], aRotMat[1][1]);
aYaw = std::atan2(aRotMat[1][0], aRotMat[1][1]);
// result of ATAN is in the range[-PI / 2, PI / 2].
// Here all four quadrants are needed.
@@ -2696,34 +2696,35 @@ Handle(TColStd_HArray1OfReal) StepToGeom::MakeYprRotation(
else
{
// COS (pitch_angle) not equal to zero
aYaw = ATan2(-aRotMat[0][1], aRotMat[0][0]);
aYaw = std::atan2(-aRotMat[0][1], aRotMat[0][0]);
if (aRotMat[0][0] < 0.)
{
if (aYaw < 0. || Abs(aYaw) < Precision::Angular())
if (aYaw < 0. || std::abs(aYaw) < Precision::Angular())
aYaw = aYaw + M_PI;
else
aYaw = aYaw - M_PI;
}
Standard_Real aSY = Sin(aYaw);
Standard_Real aCY = Cos(aYaw);
Standard_Real aSR = Sin(aRoll);
Standard_Real aCR = Cos(aRoll);
Standard_Real aSY = std::sin(aYaw);
Standard_Real aCY = std::cos(aYaw);
Standard_Real aSR = std::sin(aRoll);
Standard_Real aCR = std::cos(aRoll);
if (Abs(aSY) > Abs(aCY) && Abs(aSY) > Abs(aSR) && Abs(aSY) > Abs(aCR))
if (std::abs(aSY) > std::abs(aCY) && std::abs(aSY) > std::abs(aSR)
&& std::abs(aSY) > std::abs(aCR))
{
aCm1 = -aRotMat[0][1] / aSY;
}
else
{
if (Abs(aCY) > Abs(aSR) && Abs(aCY) > Abs(aCR))
if (std::abs(aCY) > std::abs(aSR) && std::abs(aCY) > std::abs(aCR))
aCm1 = aRotMat[0][0] / aCY;
else if (Abs(aSR) > Abs(aCR))
else if (std::abs(aSR) > std::abs(aCR))
aCm1 = -aRotMat[1][2] / aSR;
else
aCm1 = aRotMat[2][2] / aCR;
}
aPitch = ATan2(aRotMat[0][2], aCm1);
aPitch = std::atan2(aRotMat[0][2], aCm1);
}
aYaw = aYaw * anUcf;
aPitch = aPitch * anUcf;
@@ -161,14 +161,14 @@ Standard_Boolean StepToTopoDS_GeometricTool::IsLikeSeam(
// Same Origin in X OR Y && Same Vector ??
// WITHIN A given tolerance !!!
Standard_Real DeltaX =
Abs(line1->Pnt()->CoordinatesValue(1) - line2->Pnt()->CoordinatesValue(1));
std::abs(line1->Pnt()->CoordinatesValue(1) - line2->Pnt()->CoordinatesValue(1));
Standard_Real DeltaY =
Abs(line1->Pnt()->CoordinatesValue(2) - line2->Pnt()->CoordinatesValue(2));
std::abs(line1->Pnt()->CoordinatesValue(2) - line2->Pnt()->CoordinatesValue(2));
Standard_Real DeltaDirX = Abs(line1->Dir()->Orientation()->DirectionRatiosValue(1)
- line2->Dir()->Orientation()->DirectionRatiosValue(1));
Standard_Real DeltaDirY = Abs(line1->Dir()->Orientation()->DirectionRatiosValue(2)
- line2->Dir()->Orientation()->DirectionRatiosValue(2));
Standard_Real DeltaDirX = std::abs(line1->Dir()->Orientation()->DirectionRatiosValue(1)
- line2->Dir()->Orientation()->DirectionRatiosValue(1));
Standard_Real DeltaDirY = std::abs(line1->Dir()->Orientation()->DirectionRatiosValue(2)
- line2->Dir()->Orientation()->DirectionRatiosValue(2));
// clang-format off
Standard_Real preci2d = Precision::PConfusion(); //:S4136: Parametric(BRepAPI::Precision(),10);
@@ -265,12 +265,12 @@ Standard_Boolean StepToTopoDS_GeometricTool::UpdateParam3d(const Handle(Geom_Cur
// DANGER precision 3d applique a une espace 1d
// w2 = cf au lieu de w2 = cl
if (Abs(w2 - cf) < Precision::PConfusion() /*preci*/)
if (std::abs(w2 - cf) < Precision::PConfusion() /*preci*/)
{
w2 = cl;
}
// w1 = cl au lieu de w1 = cf
else if (Abs(w1 - cl) < Precision::PConfusion() /*preci*/)
else if (std::abs(w1 - cl) < Precision::PConfusion() /*preci*/)
{
w1 = cf;
}
@@ -317,12 +317,12 @@ Standard_Boolean StepToTopoDS_GeometricTool::UpdateParam3d(const Handle(Geom_Cur
// DANGER precision 3d applique a une espace 1d
// w2 = cf au lieu de w2 = cl
if (Abs(w2 - cf) < Precision::PConfusion())
if (std::abs(w2 - cf) < Precision::PConfusion())
{
w2 = cl;
}
// w1 = cl au lieu de w1 = cf
else if (Abs(w1 - cl) < Precision::PConfusion())
else if (std::abs(w1 - cl) < Precision::PConfusion())
{
w1 = cf;
}
@@ -438,7 +438,8 @@ void StepToTopoDS_TranslateEdge::MakeFromCurve3D(const Handle(StepGeom_Curve)&
// #25415: handling of special case found on some STEP files produced by FPX Expert 2013 (PCB
// design system): edge curve is line displaced from its true position but with correct
// direction; we can shift the line in this case so that it passes through vertices correctly
if (Abs(temp1 - temp2) < preci && Abs(U2 - U1 - pnt1.Distance(pnt2)) < Precision::Confusion()
if (std::abs(temp1 - temp2) < preci
&& std::abs(U2 - U1 - pnt1.Distance(pnt2)) < Precision::Confusion()
&& C1->IsKind(STANDARD_TYPE(Geom_Line)))
{
Handle(Geom_Line) aLine = Handle(Geom_Line)::DownCast(C1);
@@ -163,7 +163,11 @@ static void CheckPCurves(TopoDS_Wire& aWire,
{
Standard_Real u1, u2, v1, v2;
mySurf->Bounds(u1, u2, v1, v2);
ElCLib::AdjustPeriodic(u1, u2, Min(Abs(w2 - w1) / 2, Precision::PConfusion()), w1, w2);
ElCLib::AdjustPeriodic(u1,
u2,
std::min(std::abs(w2 - w1) / 2, Precision::PConfusion()),
w1,
w2);
B.Range(myEdge, aFace, w1, w2);
}
@@ -773,7 +777,7 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
myEdgePro->Compute(preci);
if (myEdgePro->IsFirstDone() && myEdgePro->IsLastDone())
{
if (Abs(myEdgePro->FirstParam() - myEdgePro->LastParam()) < Precision::PConfusion())
if (std::abs(myEdgePro->FirstParam() - myEdgePro->LastParam()) < Precision::PConfusion())
continue;
B.Range(edge, Face, myEdgePro->FirstParam(), myEdgePro->LastParam());
}
@@ -236,7 +236,7 @@ void TopoDSToStep_MakeStepEdge::Init(const TopoDS_Edge& aEdge
Standard_Real aDist11 = aP11.Distance(aP12);
Standard_Real aDist1m = aP11.Distance(aPm);
Standard_Real aDist2m = aP12.Distance(aPm);
Standard_Real aDistMax = Max(Max(aDist1m, aDist2m), aDist11);
Standard_Real aDistMax = std::max(std::max(aDist1m, aDist2m), aDist11);
Standard_Boolean isSmallCurve = (aDistMax <= aTolV1 || aDistMax <= aTolV2);
if (BRepTools::Compare(Vfirst, Vlast) && isSmallCurve && dpar > Precision::PConfusion()
&& dpar <= 0.1 * C->Period())
@@ -449,7 +449,7 @@ Standard_Boolean RWStl_Reader::ReadBinary(Standard_IStream& theStream
// read more data
if (aNbFacesInBuffer <= 0)
{
aNbFacesInBuffer = Min(THE_CHUNK_NBFACETS, aNbFacets - aNbFacetRead);
aNbFacesInBuffer = std::min(THE_CHUNK_NBFACETS, aNbFacets - aNbFacetRead);
const std::streamsize aDataToRead = aNbFacesInBuffer * aFaceDataLen;
if (theStream.read(aBuffer, aDataToRead).gcount() != aDataToRead)
{
@@ -98,7 +98,7 @@ Standard_OStream& Vrml_AsciiText::Print(Standard_OStream& anOStream) const
anOStream << " ]\n";
}
if (Abs(mySpacing - 1) > 0.0001)
if (std::abs(mySpacing - 1) > 0.0001)
{
anOStream << " spacing\t\t";
anOStream << mySpacing << "\n";
@@ -116,7 +116,7 @@ Standard_OStream& Vrml_AsciiText::Print(Standard_OStream& anOStream) const
break;
}
if (Abs(myWidth - 0) > 0.0001)
if (std::abs(myWidth - 0) > 0.0001)
{
anOStream << " width\t\t";
anOStream << myWidth << "\n";
+2 -2
View File
@@ -68,13 +68,13 @@ Standard_OStream& Vrml_Cone::Print(Standard_OStream& anOStream) const
break;
}
if (Abs(myBottomRadius - 1) > 0.0001)
if (std::abs(myBottomRadius - 1) > 0.0001)
{
anOStream << " bottomRadius\t";
anOStream << myBottomRadius << "\n";
}
if (Abs(myHeight - 2) > 0.0001)
if (std::abs(myHeight - 2) > 0.0001)
{
anOStream << " height\t\t";
anOStream << myHeight << "\n";
@@ -49,8 +49,9 @@ Standard_OStream& Vrml_Coordinate3::Print(Standard_OStream& anOStream) const
anOStream << "Coordinate3 {\n";
i = myPoint->Lower();
if (myPoint->Length() == 1 && Abs(myPoint->Value(i).X() - 0) < 0.0001
&& Abs(myPoint->Value(i).Y() - 0) < 0.0001 && Abs(myPoint->Value(i).Z() - 0) < 0.0001)
if (myPoint->Length() == 1 && std::abs(myPoint->Value(i).X() - 0) < 0.0001
&& std::abs(myPoint->Value(i).Y() - 0) < 0.0001
&& std::abs(myPoint->Value(i).Z() - 0) < 0.0001)
{
anOStream << "}\n";
return anOStream;
+3 -3
View File
@@ -56,19 +56,19 @@ Standard_OStream& Vrml_Cube::Print(Standard_OStream& anOStream) const
{
anOStream << "Cube {\n";
if (Abs(myWidth - 2) > 0.0001)
if (std::abs(myWidth - 2) > 0.0001)
{
anOStream << " width\t";
anOStream << myWidth << "\n";
}
if (Abs(myHeight - 2) > 0.0001)
if (std::abs(myHeight - 2) > 0.0001)
{
anOStream << " height\t";
anOStream << myHeight << "\n";
}
if (Abs(myDepth - 2) > 0.0001)
if (std::abs(myDepth - 2) > 0.0001)
{
anOStream << " depth\t";
anOStream << myDepth << "\n";
@@ -71,13 +71,13 @@ Standard_OStream& Vrml_Cylinder::Print(Standard_OStream& anOStream) const
break;
}
if (Abs(myRadius - 1) > 0.0001)
if (std::abs(myRadius - 1) > 0.0001)
{
anOStream << " radius\t";
anOStream << myRadius << "\n";
}
if (Abs(myHeight - 2) > 0.0001)
if (std::abs(myHeight - 2) > 0.0001)
{
anOStream << " height\t";
anOStream << myHeight << "\n";
@@ -91,14 +91,14 @@ Standard_OStream& Vrml_DirectionalLight::Print(Standard_OStream& anOStream) cons
// anOStream << myOnOff << "\n";
}
if (Abs(myIntensity - 1) > 0.0001)
if (std::abs(myIntensity - 1) > 0.0001)
{
anOStream << " intensity\t";
anOStream << myIntensity << "\n";
}
if (Abs(myColor.Red() - 1) > 0.0001 || Abs(myColor.Green() - 1) > 0.0001
|| Abs(myColor.Blue() - 1) > 0.0001)
if (std::abs(myColor.Red() - 1) > 0.0001 || std::abs(myColor.Green() - 1) > 0.0001
|| std::abs(myColor.Blue() - 1) > 0.0001)
{
NCollection_Vec3<Standard_Real> aColor_sRGB;
myColor.Values(aColor_sRGB.r(), aColor_sRGB.g(), aColor_sRGB.b(), Quantity_TOC_sRGB);
@@ -106,8 +106,8 @@ Standard_OStream& Vrml_DirectionalLight::Print(Standard_OStream& anOStream) cons
anOStream << aColor_sRGB.r() << " " << aColor_sRGB.g() << " " << aColor_sRGB.b() << "\n";
}
if (Abs(myDirection.X() - 0) > 0.0001 || Abs(myDirection.Y() - 0) > 0.0001
|| Abs(myDirection.Z() + 1) > 0.0001)
if (std::abs(myDirection.X() - 0) > 0.0001 || std::abs(myDirection.Y() - 0) > 0.0001
|| std::abs(myDirection.Z() + 1) > 0.0001)
{
anOStream << " direction" << '\t';
anOStream << myDirection.X() << " " << myDirection.Y() << " " << myDirection.Z() << "\n";
@@ -56,7 +56,7 @@ Standard_OStream& Vrml_FontStyle::Print(Standard_OStream& anOStream) const
{
anOStream << "FontStyle {\n";
if (Abs(mySize - 10) > 0.0001)
if (std::abs(mySize - 10) > 0.0001)
{
anOStream << " size\t";
anOStream << mySize << "\n";
+2 -2
View File
@@ -70,8 +70,8 @@ Standard_OStream& Vrml_LOD::Print(Standard_OStream& anOStream) const
anOStream << " ]\n";
}
if (Abs(myCenter.X() - 0) > 0.0001 || Abs(myCenter.Y() - 0) > 0.0001
|| Abs(myCenter.Z() - 0) > 0.0001)
if (std::abs(myCenter.X() - 0) > 0.0001 || std::abs(myCenter.Y() - 0) > 0.0001
|| std::abs(myCenter.Z() - 0) > 0.0001)
{
anOStream << " center\t";
anOStream << myCenter.X() << " " << myCenter.Y() << " " << myCenter.Z() << "\n";
@@ -144,9 +144,9 @@ Standard_OStream& Vrml_Material::Print(Standard_OStream& anOStream) const
anOStream << "Material {\n";
if (myAmbientColor->Length() != 1
|| Abs(myAmbientColor->Value(myAmbientColor->Lower()).Red() - 0.2) > 0.0001
|| Abs(myAmbientColor->Value(myAmbientColor->Lower()).Green() - 0.2) > 0.0001
|| Abs(myAmbientColor->Value(myAmbientColor->Lower()).Blue() - 0.2) > 0.0001)
|| std::abs(myAmbientColor->Value(myAmbientColor->Lower()).Red() - 0.2) > 0.0001
|| std::abs(myAmbientColor->Value(myAmbientColor->Lower()).Green() - 0.2) > 0.0001
|| std::abs(myAmbientColor->Value(myAmbientColor->Lower()).Blue() - 0.2) > 0.0001)
{
anOStream << " ambientColor [\n\t";
for (i = myAmbientColor->Lower(); i <= myAmbientColor->Upper(); i++)
@@ -163,9 +163,9 @@ Standard_OStream& Vrml_Material::Print(Standard_OStream& anOStream) const
}
if (myDiffuseColor->Length() != 1
|| Abs(myDiffuseColor->Value(myDiffuseColor->Lower()).Red() - 0.8) > 0.0001
|| Abs(myDiffuseColor->Value(myDiffuseColor->Lower()).Green() - 0.8) > 0.0001
|| Abs(myDiffuseColor->Value(myDiffuseColor->Lower()).Blue() - 0.8) > 0.0001)
|| std::abs(myDiffuseColor->Value(myDiffuseColor->Lower()).Red() - 0.8) > 0.0001
|| std::abs(myDiffuseColor->Value(myDiffuseColor->Lower()).Green() - 0.8) > 0.0001
|| std::abs(myDiffuseColor->Value(myDiffuseColor->Lower()).Blue() - 0.8) > 0.0001)
{
anOStream << " diffuseColor [\n\t";
for (i = myDiffuseColor->Lower(); i <= myDiffuseColor->Upper(); i++)
@@ -182,9 +182,9 @@ Standard_OStream& Vrml_Material::Print(Standard_OStream& anOStream) const
}
if (mySpecularColor->Length() != 1
|| Abs(mySpecularColor->Value(mySpecularColor->Lower()).Red() - 0) > 0.0001
|| Abs(mySpecularColor->Value(mySpecularColor->Lower()).Green() - 0) > 0.0001
|| Abs(mySpecularColor->Value(mySpecularColor->Lower()).Blue() - 0) > 0.0001)
|| std::abs(mySpecularColor->Value(mySpecularColor->Lower()).Red() - 0) > 0.0001
|| std::abs(mySpecularColor->Value(mySpecularColor->Lower()).Green() - 0) > 0.0001
|| std::abs(mySpecularColor->Value(mySpecularColor->Lower()).Blue() - 0) > 0.0001)
{
anOStream << " specularColor [\n\t";
for (i = mySpecularColor->Lower(); i <= mySpecularColor->Upper(); i++)
@@ -201,9 +201,9 @@ Standard_OStream& Vrml_Material::Print(Standard_OStream& anOStream) const
}
if (myEmissiveColor->Length() != 1
|| Abs(myEmissiveColor->Value(myEmissiveColor->Lower()).Red() - 0) > 0.0001
|| Abs(myEmissiveColor->Value(myEmissiveColor->Lower()).Green() - 0) > 0.0001
|| Abs(myEmissiveColor->Value(myEmissiveColor->Lower()).Blue() - 0) > 0.0001)
|| std::abs(myEmissiveColor->Value(myEmissiveColor->Lower()).Red() - 0) > 0.0001
|| std::abs(myEmissiveColor->Value(myEmissiveColor->Lower()).Green() - 0) > 0.0001
|| std::abs(myEmissiveColor->Value(myEmissiveColor->Lower()).Blue() - 0) > 0.0001)
{
anOStream << " emissiveColor [\n\t";
for (i = myEmissiveColor->Lower(); i <= myEmissiveColor->Upper(); i++)
@@ -219,7 +219,8 @@ Standard_OStream& Vrml_Material::Print(Standard_OStream& anOStream) const
anOStream << " ]\n";
}
if (myShininess->Length() != 1 || Abs(myShininess->Value(myShininess->Lower()) - 0.2) > 0.0001)
if (myShininess->Length() != 1
|| std::abs(myShininess->Value(myShininess->Lower()) - 0.2) > 0.0001)
{
anOStream << " shininess\t\t[ ";
for (i = myShininess->Lower(); i <= myShininess->Upper(); i++)
@@ -232,7 +233,7 @@ Standard_OStream& Vrml_Material::Print(Standard_OStream& anOStream) const
}
if (myTransparency->Length() != 1
|| Abs(myTransparency->Value(myTransparency->Lower()) - 0) > 0.0001)
|| std::abs(myTransparency->Value(myTransparency->Lower()) - 0) > 0.0001)
{
anOStream << " transparency\t[ ";
for (i = myTransparency->Lower(); i <= myTransparency->Upper(); i++)
@@ -50,12 +50,18 @@ Standard_OStream& Vrml_MatrixTransform::Print(Standard_OStream& anOStream) const
Standard_Integer i, j;
anOStream << "MatrixTransform {\n";
if (Abs(myMatrix.Value(1, 1) - 1) > 0.0000001 || Abs(myMatrix.Value(2, 1) - 0) > 0.0000001
|| Abs(myMatrix.Value(3, 1) - 0) > 0.0000001 || Abs(myMatrix.Value(1, 2) - 0) > 0.0000001
|| Abs(myMatrix.Value(2, 2) - 1) > 0.0000001 || Abs(myMatrix.Value(3, 2) - 0) > 0.0000001
|| Abs(myMatrix.Value(1, 3) - 0) > 0.0000001 || Abs(myMatrix.Value(2, 3) - 0) > 0.0000001
|| Abs(myMatrix.Value(3, 3) - 1) > 0.0000001 || Abs(myMatrix.Value(1, 4) - 0) > 0.0000001
|| Abs(myMatrix.Value(2, 4) - 0) > 0.0000001 || Abs(myMatrix.Value(3, 4) - 0) > 0.0000001)
if (std::abs(myMatrix.Value(1, 1) - 1) > 0.0000001
|| std::abs(myMatrix.Value(2, 1) - 0) > 0.0000001
|| std::abs(myMatrix.Value(3, 1) - 0) > 0.0000001
|| std::abs(myMatrix.Value(1, 2) - 0) > 0.0000001
|| std::abs(myMatrix.Value(2, 2) - 1) > 0.0000001
|| std::abs(myMatrix.Value(3, 2) - 0) > 0.0000001
|| std::abs(myMatrix.Value(1, 3) - 0) > 0.0000001
|| std::abs(myMatrix.Value(2, 3) - 0) > 0.0000001
|| std::abs(myMatrix.Value(3, 3) - 1) > 0.0000001
|| std::abs(myMatrix.Value(1, 4) - 0) > 0.0000001
|| std::abs(myMatrix.Value(2, 4) - 0) > 0.0000001
|| std::abs(myMatrix.Value(3, 4) - 0) > 0.0000001)
{
anOStream << " matrix\t";
@@ -48,8 +48,9 @@ Standard_OStream& Vrml_Normal::Print(Standard_OStream& anOStream) const
anOStream << "Normal {\n";
i = myVector->Lower();
if (myVector->Length() == 1 && Abs(myVector->Value(i).X() - 0) < 0.0001
&& Abs(myVector->Value(i).Y() - 0) < 0.0001 && Abs(myVector->Value(i).Z() - 1) < 0.0001)
if (myVector->Length() == 1 && std::abs(myVector->Value(i).X() - 0) < 0.0001
&& std::abs(myVector->Value(i).Y() - 0) < 0.0001
&& std::abs(myVector->Value(i).Z() - 1) < 0.0001)
{
anOStream << "}\n";
return anOStream;
@@ -80,27 +80,29 @@ Standard_Real Vrml_OrthographicCamera::Height() const
Standard_OStream& Vrml_OrthographicCamera::Print(Standard_OStream& anOStream) const
{
anOStream << "OrthographicCamera {\n";
if (Abs(myPosition.X() - 0) > 0.0001 || Abs(myPosition.Y() - 0) > 0.0001
|| Abs(myPosition.Z() - 1) > 0.0001)
if (std::abs(myPosition.X() - 0) > 0.0001 || std::abs(myPosition.Y() - 0) > 0.0001
|| std::abs(myPosition.Z() - 1) > 0.0001)
{
anOStream << " position\t\t";
anOStream << myPosition.X() << " " << myPosition.Y() << " " << myPosition.Z() << "\n";
}
if (Abs(myOrientation.RotationX() - 0) > 0.0001 || Abs(myOrientation.RotationY() - 0) > 0.0001
|| Abs(myOrientation.RotationZ() - 1) > 0.0001 || Abs(myOrientation.Angle() - 0) > 0.0001)
if (std::abs(myOrientation.RotationX() - 0) > 0.0001
|| std::abs(myOrientation.RotationY() - 0) > 0.0001
|| std::abs(myOrientation.RotationZ() - 1) > 0.0001
|| std::abs(myOrientation.Angle() - 0) > 0.0001)
{
anOStream << " orientation\t\t";
anOStream << myOrientation.RotationX() << " " << myOrientation.RotationY() << " ";
anOStream << myOrientation.RotationZ() << " " << myOrientation.Angle() << "\n";
}
if (Abs(myFocalDistance - 5) > 0.0001)
if (std::abs(myFocalDistance - 5) > 0.0001)
{
anOStream << " focalDistance\t";
anOStream << myFocalDistance << "\n";
}
if (Abs(myHeight - 2) > 0.0001)
if (std::abs(myHeight - 2) > 0.0001)
{
anOStream << " height\t\t";
anOStream << myHeight << "\n";
@@ -80,27 +80,29 @@ Standard_Real Vrml_PerspectiveCamera::Angle() const
Standard_OStream& Vrml_PerspectiveCamera::Print(Standard_OStream& anOStream) const
{
anOStream << "PerspectiveCamera {\n";
if (Abs(myPosition.X() - 0) > 0.0001 || Abs(myPosition.Y() - 0) > 0.0001
|| Abs(myPosition.Z() - 1) > 0.0001)
if (std::abs(myPosition.X() - 0) > 0.0001 || std::abs(myPosition.Y() - 0) > 0.0001
|| std::abs(myPosition.Z() - 1) > 0.0001)
{
anOStream << " position\t\t";
anOStream << myPosition.X() << " " << myPosition.Y() << " " << myPosition.Z() << "\n";
}
if (Abs(myOrientation.RotationX() - 0) > 0.0001 || Abs(myOrientation.RotationY() - 0) > 0.0001
|| Abs(myOrientation.RotationZ() - 1) > 0.0001 || Abs(myOrientation.Angle() - 0) > 0.0001)
if (std::abs(myOrientation.RotationX() - 0) > 0.0001
|| std::abs(myOrientation.RotationY() - 0) > 0.0001
|| std::abs(myOrientation.RotationZ() - 1) > 0.0001
|| std::abs(myOrientation.Angle() - 0) > 0.0001)
{
anOStream << " orientation\t\t";
anOStream << myOrientation.RotationX() << " " << myOrientation.RotationY() << " ";
anOStream << myOrientation.RotationZ() << " " << myOrientation.Angle() << "\n";
}
if (Abs(myFocalDistance - 5) > 0.0001)
if (std::abs(myFocalDistance - 5) > 0.0001)
{
anOStream << " focalDistance\t";
anOStream << myFocalDistance << "\n";
}
if (Abs(myHeightAngle - 0.785398) > 0.0000001)
if (std::abs(myHeightAngle - 0.785398) > 0.0000001)
{
anOStream << " heightAngle\t\t";
anOStream << myHeightAngle << "\n";
@@ -91,14 +91,14 @@ Standard_OStream& Vrml_PointLight::Print(Standard_OStream& anOStream) const
// anOStream << myOnOff << "\n";
}
if (Abs(myIntensity - 1) > 0.0001)
if (std::abs(myIntensity - 1) > 0.0001)
{
anOStream << " intensity\t";
anOStream << myIntensity << "\n";
}
if (Abs(myColor.Red() - 1) > 0.0001 || Abs(myColor.Green() - 1) > 0.0001
|| Abs(myColor.Blue() - 1) > 0.0001)
if (std::abs(myColor.Red() - 1) > 0.0001 || std::abs(myColor.Green() - 1) > 0.0001
|| std::abs(myColor.Blue() - 1) > 0.0001)
{
NCollection_Vec3<Standard_Real> aColor_sRGB;
myColor.Values(aColor_sRGB.r(), aColor_sRGB.g(), aColor_sRGB.b(), Quantity_TOC_sRGB);
@@ -106,8 +106,8 @@ Standard_OStream& Vrml_PointLight::Print(Standard_OStream& anOStream) const
anOStream << aColor_sRGB.r() << " " << aColor_sRGB.g() << " " << aColor_sRGB.b() << "\n";
}
if (Abs(myLocation.X() - 0) > 0.0001 || Abs(myLocation.Y() - 0) > 0.0001
|| Abs(myLocation.Z() - 1) > 0.0001)
if (std::abs(myLocation.X() - 0) > 0.0001 || std::abs(myLocation.Y() - 0) > 0.0001
|| std::abs(myLocation.Z() - 1) > 0.0001)
{
anOStream << " location\t";
anOStream << myLocation.X() << " " << myLocation.Y() << " " << myLocation.Z() << "\n";
@@ -39,8 +39,8 @@ Standard_OStream& Vrml_Rotation::Print(Standard_OStream& anOStream) const
{
anOStream << "Rotation {\n";
if (Abs(myRotation.RotationX() - 0) > 0.0001 || Abs(myRotation.RotationY() - 0) > 0.0001
|| Abs(myRotation.RotationZ() - 1) > 0.0001 || Abs(myRotation.Angle() - 0) > 0.0001)
if (std::abs(myRotation.RotationX() - 0) > 0.0001 || std::abs(myRotation.RotationY() - 0) > 0.0001
|| std::abs(myRotation.RotationZ() - 1) > 0.0001 || std::abs(myRotation.Angle() - 0) > 0.0001)
{
anOStream << " rotation\t";
anOStream << myRotation.RotationX() << " " << myRotation.RotationY() << " ";
@@ -38,8 +38,8 @@ Standard_OStream& Vrml_Scale::Print(Standard_OStream& anOStream) const
{
anOStream << "Scale {\n";
if (Abs(myScaleFactor.X() - 1) > 0.0001 || Abs(myScaleFactor.Y() - 1) > 0.0001
|| Abs(myScaleFactor.Z() - 1) > 0.0001)
if (std::abs(myScaleFactor.X() - 1) > 0.0001 || std::abs(myScaleFactor.Y() - 1) > 0.0001
|| std::abs(myScaleFactor.Z() - 1) > 0.0001)
{
anOStream << " scaleFactor\t";
anOStream << myScaleFactor.X() << " " << myScaleFactor.Y() << " " << myScaleFactor.Z() << "\n";
@@ -98,7 +98,7 @@ Standard_OStream& Vrml_ShapeHints::Print(Standard_OStream& anOStream) const
break; // anOStream << " faceType\t\tCONVEX";
}
if (Abs(myAngle - 0.5) > 0.0001)
if (std::abs(myAngle - 0.5) > 0.0001)
{
anOStream << " creaseAngle\t\t" << myAngle << "\n";
}
@@ -32,7 +32,7 @@ Standard_OStream& Vrml_Sphere::Print(Standard_OStream& anOStream) const
{
anOStream << "Sphere {\n";
if (Abs(myRadius - 1) > 0.0001)
if (std::abs(myRadius - 1) > 0.0001)
{
anOStream << " radius\t";
anOStream << myRadius << "\n";
@@ -130,14 +130,14 @@ Standard_OStream& Vrml_SpotLight::Print(Standard_OStream& anOStream) const
// anOStream << myOnOff << "\n";
}
if (Abs(myIntensity - 1) > 0.0001)
if (std::abs(myIntensity - 1) > 0.0001)
{
anOStream << " intensity\t";
anOStream << myIntensity << "\n";
}
if (Abs(myColor.Red() - 1) > 0.0001 || Abs(myColor.Green() - 1) > 0.0001
|| Abs(myColor.Blue() - 1) > 0.0001)
if (std::abs(myColor.Red() - 1) > 0.0001 || std::abs(myColor.Green() - 1) > 0.0001
|| std::abs(myColor.Blue() - 1) > 0.0001)
{
NCollection_Vec3<Standard_Real> aColor_sRGB;
myColor.Values(aColor_sRGB.r(), aColor_sRGB.g(), aColor_sRGB.b(), Quantity_TOC_sRGB);
@@ -145,27 +145,27 @@ Standard_OStream& Vrml_SpotLight::Print(Standard_OStream& anOStream) const
anOStream << aColor_sRGB.r() << " " << aColor_sRGB.g() << " " << aColor_sRGB.b() << "\n";
}
if (Abs(myLocation.X() - 0) > 0.0001 || Abs(myLocation.Y() - 0) > 0.0001
|| Abs(myLocation.Z() - 1) > 0.0001)
if (std::abs(myLocation.X() - 0) > 0.0001 || std::abs(myLocation.Y() - 0) > 0.0001
|| std::abs(myLocation.Z() - 1) > 0.0001)
{
anOStream << " location\t";
anOStream << myLocation.X() << " " << myLocation.Y() << " " << myLocation.Z() << "\n";
}
if (Abs(myDirection.X() - 0) > 0.0001 || Abs(myDirection.Y() - 0) > 0.0001
|| Abs(myDirection.Z() + 1) > 0.0001)
if (std::abs(myDirection.X() - 0) > 0.0001 || std::abs(myDirection.Y() - 0) > 0.0001
|| std::abs(myDirection.Z() + 1) > 0.0001)
{
anOStream << " direction\t";
anOStream << myDirection.X() << " " << myDirection.Y() << " " << myDirection.Z() << "\n";
}
if (Abs(myDropOffRate - 0) > 0.0001)
if (std::abs(myDropOffRate - 0) > 0.0001)
{
anOStream << " dropOffRate\t";
anOStream << myDropOffRate << "\n";
}
if (Abs(myCutOffAngle - 0.785398) > 0.0000001)
if (std::abs(myCutOffAngle - 0.785398) > 0.0000001)
{
anOStream << " cutOffAngle\t";
anOStream << myCutOffAngle << "\n";
@@ -80,25 +80,25 @@ Standard_OStream& Vrml_Texture2Transform::Print(Standard_OStream& anOStream) con
{
anOStream << "Texture2Transform {\n";
if (Abs(myTranslation.X() - 0) > 0.0001 || Abs(myTranslation.Y() - 0) > 0.0001)
if (std::abs(myTranslation.X() - 0) > 0.0001 || std::abs(myTranslation.Y() - 0) > 0.0001)
{
anOStream << " translation\t";
anOStream << myTranslation.X() << " " << myTranslation.Y() << "\n";
}
if (Abs(myRotation - 0) > 0.0001)
if (std::abs(myRotation - 0) > 0.0001)
{
anOStream << " rotation\t";
anOStream << myRotation << "\n";
}
if (Abs(myScaleFactor.X() - 0) > 0.0001 || Abs(myScaleFactor.Y() - 0) > 0.0001)
if (std::abs(myScaleFactor.X() - 0) > 0.0001 || std::abs(myScaleFactor.Y() - 0) > 0.0001)
{
anOStream << " scaleFactor\t";
anOStream << myScaleFactor.X() << " " << myScaleFactor.Y() << "\n";
}
if (Abs(myCenter.X() - 0) > 0.0001 || Abs(myCenter.Y() - 0) > 0.0001)
if (std::abs(myCenter.X() - 0) > 0.0001 || std::abs(myCenter.Y() - 0) > 0.0001)
{
anOStream << " center\t";
anOStream << myCenter.X() << " " << myCenter.Y() << "\n";
@@ -42,8 +42,8 @@ Standard_OStream& Vrml_TextureCoordinate2::Print(Standard_OStream& anOStream) co
Standard_Integer i;
anOStream << "TextureCoordinate2 {\n";
if (myPoint->Length() != 1 || Abs(myPoint->Value(myPoint->Lower()).X() - 0) > 0.0001
|| Abs(myPoint->Value(myPoint->Lower()).Y() - 0) > 0.0001)
if (myPoint->Length() != 1 || std::abs(myPoint->Value(myPoint->Lower()).X() - 0) > 0.0001
|| std::abs(myPoint->Value(myPoint->Lower()).Y() - 0) > 0.0001)
{
anOStream << " point [\n\t";
for (i = myPoint->Lower(); i <= myPoint->Upper(); i++)
@@ -105,40 +105,40 @@ Standard_OStream& Vrml_Transform::Print(Standard_OStream& anOStream) const
{
anOStream << "Transform {\n";
if (Abs(myTranslation.X() - 0) > 0.0001 || Abs(myTranslation.Y() - 0) > 0.0001
|| Abs(myTranslation.Z() - 0) > 0.0001)
if (std::abs(myTranslation.X() - 0) > 0.0001 || std::abs(myTranslation.Y() - 0) > 0.0001
|| std::abs(myTranslation.Z() - 0) > 0.0001)
{
anOStream << " translation\t\t";
anOStream << myTranslation.X() << " " << myTranslation.Y() << " " << myTranslation.Z() << "\n";
}
if (Abs(myRotation.RotationX() - 0) > 0.0001 || Abs(myRotation.RotationY() - 0) > 0.0001
|| Abs(myRotation.RotationZ() - 1) > 0.0001 || Abs(myRotation.Angle() - 0) > 0.0001)
if (std::abs(myRotation.RotationX() - 0) > 0.0001 || std::abs(myRotation.RotationY() - 0) > 0.0001
|| std::abs(myRotation.RotationZ() - 1) > 0.0001 || std::abs(myRotation.Angle() - 0) > 0.0001)
{
anOStream << " rotation\t\t";
anOStream << myRotation.RotationX() << " " << myRotation.RotationY() << " ";
anOStream << myRotation.RotationZ() << " " << myRotation.Angle() << "\n";
}
if (Abs(myScaleFactor.X() - 1) > 0.0001 || Abs(myScaleFactor.Y() - 1) > 0.0001
|| Abs(myScaleFactor.Z() - 1) > 0.0001)
if (std::abs(myScaleFactor.X() - 1) > 0.0001 || std::abs(myScaleFactor.Y() - 1) > 0.0001
|| std::abs(myScaleFactor.Z() - 1) > 0.0001)
{
anOStream << " scaleFactor\t\t";
anOStream << myTranslation.X() << " " << myTranslation.Y() << " " << myTranslation.Z() << "\n";
}
if (Abs(myScaleOrientation.RotationX() - 0) > 0.0001
|| Abs(myScaleOrientation.RotationY() - 0) > 0.0001
|| Abs(myScaleOrientation.RotationZ() - 1) > 0.0001
|| Abs(myScaleOrientation.Angle() - 0) > 0.0001)
if (std::abs(myScaleOrientation.RotationX() - 0) > 0.0001
|| std::abs(myScaleOrientation.RotationY() - 0) > 0.0001
|| std::abs(myScaleOrientation.RotationZ() - 1) > 0.0001
|| std::abs(myScaleOrientation.Angle() - 0) > 0.0001)
{
anOStream << " scaleOrientation\t";
anOStream << myScaleOrientation.RotationX() << " " << myScaleOrientation.RotationY() << " ";
anOStream << myScaleOrientation.RotationZ() << " " << myScaleOrientation.Angle() << "\n";
}
if (Abs(myCenter.X() - 0) > 0.0001 || Abs(myCenter.Y() - 0) > 0.0001
|| Abs(myCenter.Z() - 0) > 0.0001)
if (std::abs(myCenter.X() - 0) > 0.0001 || std::abs(myCenter.Y() - 0) > 0.0001
|| std::abs(myCenter.Z() - 0) > 0.0001)
{
anOStream << " center\t\t";
anOStream << myCenter.X() << " " << myCenter.Y() << " " << myCenter.Z() << "\n";
@@ -38,8 +38,8 @@ Standard_OStream& Vrml_Translation::Print(Standard_OStream& anOStream) const
{
anOStream << "Translation {\n";
if (Abs(myTranslation.X() - 0) > 0.0001 || Abs(myTranslation.Y() - 0) > 0.0001
|| Abs(myTranslation.Z() - 0) > 0.0001)
if (std::abs(myTranslation.X() - 0) > 0.0001 || std::abs(myTranslation.Y() - 0) > 0.0001
|| std::abs(myTranslation.Z() - 0) > 0.0001)
{
anOStream << " translation\t";
anOStream << myTranslation.X() << " " << myTranslation.Y() << " " << myTranslation.Z() << "\n";
@@ -71,15 +71,15 @@ Standard_OStream& Vrml_WWWInline::Print(Standard_OStream& anOStream) const
anOStream << '"' << myName << '"' << "\n";
}
if (Abs(myBboxSize.X() - 0) > 0.0001 || Abs(myBboxSize.Y() - 0) > 0.0001
|| Abs(myBboxSize.Z() - 0) > 0.0001)
if (std::abs(myBboxSize.X() - 0) > 0.0001 || std::abs(myBboxSize.Y() - 0) > 0.0001
|| std::abs(myBboxSize.Z() - 0) > 0.0001)
{
anOStream << " bboxSize\t";
anOStream << myBboxSize.X() << " " << myBboxSize.Y() << " " << myBboxSize.Z() << "\n";
}
if (Abs(myBboxCenter.X() - 0) > 0.0001 || Abs(myBboxCenter.Y() - 0) > 0.0001
|| Abs(myBboxCenter.Z() - 0) > 0.0001)
if (std::abs(myBboxCenter.X() - 0) > 0.0001 || std::abs(myBboxCenter.Y() - 0) > 0.0001
|| std::abs(myBboxCenter.Z() - 0) > 0.0001)
{
anOStream << " bboxCenter\t";
anOStream << myBboxCenter.X() << " " << myBboxCenter.Y() << " " << myBboxCenter.Z() << "\n";
@@ -90,7 +90,7 @@ static void DrawCurve(const Adaptor3d_Curve& aCurve,
{
nbintervals = aCurve.NbKnots() - 1;
// std::cout << "NbKnots "<<aCurve.NbKnots() << std::endl;
nbintervals = Max(1, nbintervals / 3);
nbintervals = std::max(1, nbintervals / 3);
}
switch (aCurve.GetType())
@@ -121,7 +121,7 @@ static void DrawCurve(const Adaptor3d_Curve& aCurve,
default: {
Standard_Real U;
Standard_Integer N = Max(2, NbP * nbintervals);
Standard_Integer N = std::max(2, NbP * nbintervals);
// std::cout << "nbintervals " << nbintervals << std::endl;
// std::cout << "N " << N << std::endl;
@@ -156,8 +156,8 @@ static void DrawCurve(Adaptor3d_Curve& aCurve,
Standard_Real Radius = aCurve.Circle().Radius();
if (!Precision::IsInfinite(Radius))
{
Standard_Real DU = Sqrt(8.0 * TheDeflection / Radius);
Standard_Integer N = Standard_Integer(Abs(U2 - U1) / DU);
Standard_Real DU = std::sqrt(8.0 * TheDeflection / Radius);
Standard_Integer N = Standard_Integer(std::abs(U2 - U1) / DU);
if (N > 0)
{
@@ -263,9 +263,9 @@ static Standard_Real GetDeflection(const Adaptor3d_Curve& aCurve,
if (!(box.IsOpenXmin() || box.IsOpenXmax() || box.IsOpenYmin() || box.IsOpenYmax()
|| box.IsOpenZmin() || box.IsOpenZmax()))
{
diagonal = Sqrt((Xmax - Xmin) * (Xmax - Xmin) + (Ymax - Ymin) * (Ymax - Ymin)
+ (Zmax - Zmin) * (Zmax - Zmin));
diagonal = Max(diagonal, Precision::Confusion());
diagonal = std::sqrt((Xmax - Xmin) * (Xmax - Xmin) + (Ymax - Ymin) * (Ymax - Ymin)
+ (Zmax - Zmin) * (Zmax - Zmin));
diagonal = std::max(diagonal, Precision::Confusion());
theRequestedDeflection = aDrawer->DeviationCoefficient() * diagonal;
}
else
@@ -51,9 +51,9 @@ void VrmlConverter_HLRShape::Add(Standard_OStream& anOStrea
|| box.IsOpenZmin() || box.IsOpenZmax()))
{
diagonal = Sqrt((Xmax - Xmin) * (Xmax - Xmin) + (Ymax - Ymin) * (Ymax - Ymin)
+ (Zmax - Zmin) * (Zmax - Zmin));
diagonal = Max(diagonal, Precision::Confusion());
diagonal = std::sqrt((Xmax - Xmin) * (Xmax - Xmin) + (Ymax - Ymin) * (Ymax - Ymin)
+ (Zmax - Zmin) * (Zmax - Zmin));
diagonal = std::max(diagonal, Precision::Confusion());
theRequestedDeflection = aDrawer->DeviationCoefficient() * diagonal;
}
else
@@ -90,7 +90,7 @@ VrmlConverter_Projector::VrmlConverter_Projector(const TopTools_Array1OfShape&
gp_Dir Zpers(DX, DY, DZ);
gp_Vec V(Zpers);
diagonal = Sqrt(xx * xx + yy * yy + zz * zz);
diagonal = std::sqrt(xx * xx + yy * yy + zz * zz);
gp_Vec aVec = V.Multiplied(0.5 * diagonal + TolMin + Focus);
@@ -237,8 +237,8 @@ VrmlConverter_Projector::VrmlConverter_Projector(const TopTools_Array1OfShape&
// std::cout << " Angle: " << V1.Angle(V2) << std::endl;
// std::cout << " ****************** " << std::endl;
if (Abs(V1.Angle(V2)) > Abs(MaxAngle))
MaxAngle = Abs(V1.Angle(V2));
if (std::abs(V1.Angle(V2)) > std::abs(MaxAngle))
MaxAngle = std::abs(V1.Angle(V2));
V2.SetX(0);
V2.SetY(P2.Y());
@@ -246,21 +246,21 @@ VrmlConverter_Projector::VrmlConverter_Projector(const TopTools_Array1OfShape&
// std::cout << " Angle: " << V1.Angle(V2) << std::endl;
// std::cout << " ****************** " << std::endl;
if (Abs(V1.Angle(V2)) > Abs(MaxAngle))
MaxAngle = Abs(V1.Angle(V2));
if (std::abs(V1.Angle(V2)) > std::abs(MaxAngle))
MaxAngle = std::abs(V1.Angle(V2));
if (Abs(P2.Y()) > Abs(MaxHeight))
if (std::abs(P2.Y()) > std::abs(MaxHeight))
{
// std::cout << " Height Y: " << P2.Y() << std::endl;
// std::cout << " ****************** " << std::endl;
MaxHeight = Abs(P2.Y());
MaxHeight = std::abs(P2.Y());
}
if (Abs(P2.X()) > Abs(MaxHeight))
if (std::abs(P2.X()) > std::abs(MaxHeight))
{
// std::cout << " Height X: " << P2.X() << std::endl;
// std::cout << " ****************** " << std::endl;
MaxHeight = Abs(P2.X());
MaxHeight = std::abs(P2.X());
}
}
Height = MaxHeight;
@@ -46,9 +46,9 @@ static Standard_Real GetDeflection(const Handle(BRepAdaptor_Surface)& aFace,
if (!(box.IsOpenXmin() || box.IsOpenXmax() || box.IsOpenYmin() || box.IsOpenYmax()
|| box.IsOpenZmin() || box.IsOpenZmax()))
{
diagonal = Sqrt((Xmax - Xmin) * (Xmax - Xmin) + (Ymax - Ymin) * (Ymax - Ymin)
+ (Zmax - Zmin) * (Zmax - Zmin));
diagonal = Max(diagonal, Precision::Confusion());
diagonal = std::sqrt((Xmax - Xmin) * (Xmax - Xmin) + (Ymax - Ymin) * (Ymax - Ymin)
+ (Zmax - Zmin) * (Zmax - Zmin));
diagonal = std::max(diagonal, Precision::Confusion());
theRequestedDeflection = aDrawer->DeviationCoefficient() * diagonal;
}
else
@@ -51,9 +51,9 @@ void VrmlConverter_WFDeflectionShape::Add(Standard_OStream& an
|| box.IsOpenZmin() || box.IsOpenZmax()))
{
diagonal = Sqrt((Xmax - Xmin) * (Xmax - Xmin) + (Ymax - Ymin) * (Ymax - Ymin)
+ (Zmax - Zmin) * (Zmax - Zmin));
diagonal = Max(diagonal, Precision::Confusion());
diagonal = std::sqrt((Xmax - Xmin) * (Xmax - Xmin) + (Ymax - Ymin) * (Ymax - Ymin)
+ (Zmax - Zmin) * (Zmax - Zmin));
diagonal = std::max(diagonal, Precision::Confusion());
theRequestedDeflection = aDrawer->DeviationCoefficient() * diagonal;
}
else
@@ -1009,7 +1009,8 @@ VrmlData_ErrorStatus VrmlData_Scene::WriteLine(const char* theLin0,
(*myOutput) << "\n";
else
{
const Standard_Integer nSpaces = Min(aCurrentIndent, sizeof(spaces) - 1);
const Standard_Integer nSpaces =
std::min(aCurrentIndent, static_cast<int>(sizeof(spaces) - 1));
(*myOutput) << &spaces[sizeof(spaces) - 1 - nSpaces];
if (theLin0)
{
@@ -423,7 +423,7 @@ Handle(VrmlData_Geometry) VrmlData_ShapeConvert::triToIndexedFaceSet(
gp_XYZ* arrVec = static_cast<gp_XYZ*>(anAlloc->Allocate(nNodes * sizeof(gp_XYZ)));
// Compute the normal vectors
Standard_Real Tol = Sqrt(aConf2);
Standard_Real Tol = std::sqrt(aConf2);
for (i = 0; i < nNodes; i++)
{
const gp_Pnt2d aUV = theTri->UVNode(i + 1);
@@ -45,7 +45,7 @@ void RWMesh_CoordinateSystemConverter::Init(const gp_Ax3& theInputSystem,
if (theInputLengthUnit > 0.0 && theOutputLengthUnit > 0.0)
{
myUnitFactor = theInputLengthUnit / theOutputLengthUnit;
myHasScale = Abs(myUnitFactor - 1.0) > gp::Resolution();
myHasScale = std::abs(myUnitFactor - 1.0) > gp::Resolution();
}
else
{

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