From: Dmitrii Kulikov <164657232+AtheneNoctuaPt@users.noreply.github.com> Date: Mon, 17 Nov 2025 14:20:24 +0000 (+0000) Subject: Coding - Rework of Math global functions to stl (#833) X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=c479f6e0008e99c01cf2115b4e3e9529d17287b7;p=occt.git 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. --- diff --git a/adm/cmake/occt_defs_flags.cmake b/adm/cmake/occt_defs_flags.cmake index 5bd3313d3c..51f14f9f81 100644 --- a/adm/cmake/occt_defs_flags.cmake +++ b/adm/cmake/occt_defs_flags.cmake @@ -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") diff --git a/samples/CSharp/OCCTProxy/OCCTProxy.cpp b/samples/CSharp/OCCTProxy/OCCTProxy.cpp index 52bda2ee32..ce6afca7ed 100644 --- a/samples/CSharp/OCCTProxy/OCCTProxy.cpp +++ b/samples/CSharp/OCCTProxy/OCCTProxy.cpp @@ -1,3 +1,8 @@ +// Prevent Windows from defining min/max macros +#ifndef NOMINMAX + #define NOMINMAX +#endif + // include required OCCT headers #include #include diff --git a/samples/CSharp/OCCTProxy_D3D/OCCTProxyD3D.cpp b/samples/CSharp/OCCTProxy_D3D/OCCTProxyD3D.cpp index 7f79725147..446d1fabf2 100644 --- a/samples/CSharp/OCCTProxy_D3D/OCCTProxyD3D.cpp +++ b/samples/CSharp/OCCTProxy_D3D/OCCTProxyD3D.cpp @@ -1,3 +1,8 @@ +// Prevent Windows from defining min/max macros +#ifndef NOMINMAX + #define NOMINMAX +#endif + #include #include diff --git a/samples/ios/UIKitSample/UIKitSample/GLViewController.mm b/samples/ios/UIKitSample/UIKitSample/GLViewController.mm index 2021a81a2d..6827f68352 100644 --- a/samples/ios/UIKitSample/UIKitSample/GLViewController.mm +++ b/samples/ios/UIKitSample/UIKitSample/GLViewController.mm @@ -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; diff --git a/samples/mfc/standard/01_Geometry/src/StdAfx.h b/samples/mfc/standard/01_Geometry/src/StdAfx.h index c86a3c90b7..971fdc2cea 100755 --- a/samples/mfc/standard/01_Geometry/src/StdAfx.h +++ b/samples/mfc/standard/01_Geometry/src/StdAfx.h @@ -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 // MFC core and standard components #include // MFC extensions #include // MFC OLE automation classes diff --git a/samples/mfc/standard/02_Modeling/src/StdAfx.h b/samples/mfc/standard/02_Modeling/src/StdAfx.h index 47650a2bbd..679ce6dad5 100755 --- a/samples/mfc/standard/02_Modeling/src/StdAfx.h +++ b/samples/mfc/standard/02_Modeling/src/StdAfx.h @@ -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 // MFC core and standard components #include // MFC extensions #include // MFC OLE automation classes diff --git a/samples/mfc/standard/03_ImportExport/src/StdAfx.h b/samples/mfc/standard/03_ImportExport/src/StdAfx.h index 8f0a7a06ae..df014d2419 100644 --- a/samples/mfc/standard/03_ImportExport/src/StdAfx.h +++ b/samples/mfc/standard/03_ImportExport/src/StdAfx.h @@ -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 // MFC core and standard components #include // MFC extensions #include // MFC OLE automation classes diff --git a/samples/mfc/standard/04_HLR/src/StdAfx.h b/samples/mfc/standard/04_HLR/src/StdAfx.h index 7250bcb2f4..b936aa11c6 100644 --- a/samples/mfc/standard/04_HLR/src/StdAfx.h +++ b/samples/mfc/standard/04_HLR/src/StdAfx.h @@ -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 // MFC core and standard components #include // MFC extensions #include // MFC OLE automation classes diff --git a/samples/mfc/standard/Common/StdAfx.h b/samples/mfc/standard/Common/StdAfx.h index 7faa086a6a..80f1b06ba9 100755 --- a/samples/mfc/standard/Common/StdAfx.h +++ b/samples/mfc/standard/Common/StdAfx.h @@ -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 // MFC core and standard components #include // MFC extensions #include // MFC OLE automation classes diff --git a/samples/qt/Common/src/View.cxx b/samples/qt/Common/src/View.cxx index 60e11610db..ec4ab702e9 100755 --- a/samples/qt/Common/src/View.cxx +++ b/samples/qt/Common/src/View.cxx @@ -1,5 +1,5 @@ #if !defined _WIN32 -#define QT_CLEAN_NAMESPACE /* avoid definition of INT32 and INT8 */ + #define QT_CLEAN_NAMESPACE /* avoid definition of INT32 and INT8 */ #endif #include "View.h" @@ -22,7 +22,6 @@ #endif #include - #include #include @@ -31,44 +30,44 @@ namespace { - //! Map Qt buttons bitmask to virtual keys. - Aspect_VKeyMouse qtMouseButtons2VKeys (Qt::MouseButtons theButtons) +//! Map Qt buttons bitmask to virtual keys. +Aspect_VKeyMouse qtMouseButtons2VKeys(Qt::MouseButtons theButtons) +{ + Aspect_VKeyMouse aButtons = Aspect_VKeyMouse_NONE; + if ((theButtons & Qt::LeftButton) != 0) { - Aspect_VKeyMouse aButtons = Aspect_VKeyMouse_NONE; - if ((theButtons & Qt::LeftButton) != 0) - { - aButtons |= Aspect_VKeyMouse_LeftButton; - } - if ((theButtons & Qt::MiddleButton) != 0) - { - aButtons |= Aspect_VKeyMouse_MiddleButton; - } - if ((theButtons & Qt::RightButton) != 0) - { - aButtons |= Aspect_VKeyMouse_RightButton; - } - return aButtons; + aButtons |= Aspect_VKeyMouse_LeftButton; } + if ((theButtons & Qt::MiddleButton) != 0) + { + aButtons |= Aspect_VKeyMouse_MiddleButton; + } + if ((theButtons & Qt::RightButton) != 0) + { + aButtons |= Aspect_VKeyMouse_RightButton; + } + return aButtons; +} - //! Map Qt mouse modifiers bitmask to virtual keys. - Aspect_VKeyFlags qtMouseModifiers2VKeys (Qt::KeyboardModifiers theModifiers) +//! Map Qt mouse modifiers bitmask to virtual keys. +Aspect_VKeyFlags qtMouseModifiers2VKeys(Qt::KeyboardModifiers theModifiers) +{ + Aspect_VKeyFlags aFlags = Aspect_VKeyFlags_NONE; + if ((theModifiers & Qt::ShiftModifier) != 0) { - Aspect_VKeyFlags aFlags = Aspect_VKeyFlags_NONE; - if ((theModifiers & Qt::ShiftModifier) != 0) - { - aFlags |= Aspect_VKeyFlags_SHIFT; - } - if ((theModifiers & Qt::ControlModifier) != 0) - { - aFlags |= Aspect_VKeyFlags_CTRL; - } - if ((theModifiers & Qt::AltModifier) != 0) - { - aFlags |= Aspect_VKeyFlags_ALT; - } - return aFlags; + aFlags |= Aspect_VKeyFlags_SHIFT; + } + if ((theModifiers & Qt::ControlModifier) != 0) + { + aFlags |= Aspect_VKeyFlags_CTRL; } + if ((theModifiers & Qt::AltModifier) != 0) + { + aFlags |= Aspect_VKeyFlags_ALT; + } + return aFlags; } +} // namespace static QCursor* defCursor = NULL; static QCursor* handCursor = NULL; @@ -77,18 +76,18 @@ static QCursor* globPanCursor = NULL; static QCursor* zoomCursor = NULL; static QCursor* rotCursor = NULL; -View::View( Handle(AIS_InteractiveContext) theContext, QWidget* parent ) -: QWidget( parent ), - myIsRaytracing( false ), - myIsShadowsEnabled (true), - myIsReflectionsEnabled (false), - myIsAntialiasingEnabled (false), - myViewActions( 0 ), - myRaytraceActions( 0 ), - myBackMenu( NULL ) +View::View(Handle(AIS_InteractiveContext) theContext, QWidget* parent) + : QWidget(parent), + myIsRaytracing(false), + myIsShadowsEnabled(true), + myIsReflectionsEnabled(false), + myIsAntialiasingEnabled(false), + myViewActions(0), + myRaytraceActions(0), + myBackMenu(NULL) { #if !defined(_WIN32) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX)) && QT_VERSION < 0x050000 - XSynchronize(x11Info().display(),true); + XSynchronize(x11Info().display(), true); #endif myContext = theContext; @@ -98,15 +97,15 @@ View::View( Handle(AIS_InteractiveContext) theContext, QWidget* parent ) setAttribute(Qt::WA_NativeWindow); myDefaultGestures = myMouseGestureMap; - myCurrentMode = CurAction3d_Nothing; - setMouseTracking( true ); + myCurrentMode = CurAction3d_Nothing; + setMouseTracking(true); initViewActions(); initCursors(); - setBackgroundRole( QPalette::NoRole );//NoBackground ); - // set focus policy to threat QContextMenuEvent from keyboard - setFocusPolicy( Qt::StrongFocus ); + setBackgroundRole(QPalette::NoRole); // NoBackground ); + // set focus policy to threat QContextMenuEvent from keyboard + setFocusPolicy(Qt::StrongFocus); init(); } @@ -117,40 +116,39 @@ View::~View() void View::init() { - if ( myView.IsNull() ) + if (myView.IsNull()) myView = myContext->CurrentViewer()->CreateView(); - Handle(OcctWindow) hWnd = new OcctWindow ( this ); - myView->SetWindow (hWnd); - if ( !hWnd->IsMapped() ) + Handle(OcctWindow) hWnd = new OcctWindow(this); + myView->SetWindow(hWnd); + if (!hWnd->IsMapped()) { hWnd->Map(); } - myView->SetBackgroundColor (Quantity_NOC_BLACK); + myView->SetBackgroundColor(Quantity_NOC_BLACK); myView->MustBeResized(); if (myIsRaytracing) myView->ChangeRenderingParams().Method = Graphic3d_RM_RAYTRACING; } -void View::paintEvent( QPaintEvent * ) +void View::paintEvent(QPaintEvent*) { -// QApplication::syncX(); + // QApplication::syncX(); myView->InvalidateImmediate(); - FlushViewEvents (myContext, myView, true); + FlushViewEvents(myContext, myView, true); } -void View::resizeEvent( QResizeEvent * ) +void View::resizeEvent(QResizeEvent*) { -// QApplication::syncX(); - if( !myView.IsNull() ) + // QApplication::syncX(); + if (!myView.IsNull()) { myView->MustBeResized(); } } -void View::OnSelectionChanged (const Handle(AIS_InteractiveContext)& , - const Handle(V3d_View)& ) +void View::OnSelectionChanged(const Handle(AIS_InteractiveContext)&, const Handle(V3d_View)&) { ApplicationCommonWindow::getApplication()->onSelectionChanged(); } @@ -164,22 +162,22 @@ void View::fitAll() void View::fitArea() { - setCurrentAction (CurAction3d_WindowZooming); + setCurrentAction(CurAction3d_WindowZooming); } void View::zoom() { - setCurrentAction (CurAction3d_DynamicZooming); + setCurrentAction(CurAction3d_DynamicZooming); } void View::pan() { - setCurrentAction (CurAction3d_DynamicPanning); + setCurrentAction(CurAction3d_DynamicPanning); } void View::rotation() { - setCurrentAction (CurAction3d_DynamicRotation); + setCurrentAction(CurAction3d_DynamicRotation); } void View::globalPan() @@ -189,42 +187,42 @@ void View::globalPan() // Do a Global Zoom myView->FitAll(); // Set the mode - setCurrentAction (CurAction3d_GlobalPanning); + setCurrentAction(CurAction3d_GlobalPanning); } void View::front() { - myView->SetProj( V3d_Yneg ); + myView->SetProj(V3d_Yneg); } void View::back() { - myView->SetProj( V3d_Ypos ); + myView->SetProj(V3d_Ypos); } void View::top() { - myView->SetProj( V3d_Zpos ); + myView->SetProj(V3d_Zpos); } void View::bottom() { - myView->SetProj( V3d_Zneg ); + myView->SetProj(V3d_Zneg); } void View::left() { - myView->SetProj( V3d_Xneg ); + myView->SetProj(V3d_Xneg); } void View::right() { - myView->SetProj( V3d_Xpos ); + myView->SetProj(V3d_Xpos); } void View::axo() { - myView->SetProj( V3d_XposYnegZpos ); + myView->SetProj(V3d_XposYnegZpos); } void View::reset() @@ -234,21 +232,21 @@ void View::reset() void View::hlrOff() { - QApplication::setOverrideCursor( Qt::WaitCursor ); - myView->SetComputedMode (false); + QApplication::setOverrideCursor(Qt::WaitCursor); + myView->SetComputedMode(false); myView->Redraw(); QApplication::restoreOverrideCursor(); } void View::hlrOn() { - QApplication::setOverrideCursor( Qt::WaitCursor ); - myView->SetComputedMode (true); + QApplication::setOverrideCursor(Qt::WaitCursor); + myView->SetComputedMode(true); myView->Redraw(); QApplication::restoreOverrideCursor(); } -void View::SetRaytracedShadows (bool theState) +void View::SetRaytracedShadows(bool theState) { myView->ChangeRenderingParams().IsShadowEnabled = theState; @@ -257,7 +255,7 @@ void View::SetRaytracedShadows (bool theState) myContext->UpdateCurrentViewer(); } -void View::SetRaytracedReflections (bool theState) +void View::SetRaytracedReflections(bool theState) { myView->ChangeRenderingParams().IsReflectionEnabled = theState; @@ -269,12 +267,12 @@ void View::SetRaytracedReflections (bool theState) void View::onRaytraceAction() { QAction* aSentBy = (QAction*)sender(); - - if (aSentBy == myRaytraceActions->at (ToolRaytracingId)) + + if (aSentBy == myRaytraceActions->at(ToolRaytracingId)) { - bool aState = myRaytraceActions->at (ToolRaytracingId)->isChecked(); + bool aState = myRaytraceActions->at(ToolRaytracingId)->isChecked(); - QApplication::setOverrideCursor (Qt::WaitCursor); + QApplication::setOverrideCursor(Qt::WaitCursor); if (aState) EnableRaytracing(); else @@ -282,26 +280,26 @@ void View::onRaytraceAction() QApplication::restoreOverrideCursor(); } - if (aSentBy == myRaytraceActions->at (ToolShadowsId)) + if (aSentBy == myRaytraceActions->at(ToolShadowsId)) { - bool aState = myRaytraceActions->at (ToolShadowsId)->isChecked(); - SetRaytracedShadows (aState); + bool aState = myRaytraceActions->at(ToolShadowsId)->isChecked(); + SetRaytracedShadows(aState); } - if (aSentBy == myRaytraceActions->at (ToolReflectionsId)) + if (aSentBy == myRaytraceActions->at(ToolReflectionsId)) { - bool aState = myRaytraceActions->at (ToolReflectionsId)->isChecked(); - SetRaytracedReflections (aState); + bool aState = myRaytraceActions->at(ToolReflectionsId)->isChecked(); + SetRaytracedReflections(aState); } - if (aSentBy == myRaytraceActions->at (ToolAntialiasingId)) + if (aSentBy == myRaytraceActions->at(ToolAntialiasingId)) { - bool aState = myRaytraceActions->at (ToolAntialiasingId)->isChecked(); - SetRaytracedAntialiasing (aState); + bool aState = myRaytraceActions->at(ToolAntialiasingId)->isChecked(); + SetRaytracedAntialiasing(aState); } } -void View::SetRaytracedAntialiasing (bool theState) +void View::SetRaytracedAntialiasing(bool theState) { myView->ChangeRenderingParams().IsAntialiasingEnabled = theState; @@ -330,44 +328,43 @@ void View::DisableRaytracing() myContext->UpdateCurrentViewer(); } -void View::updateToggled( bool isOn ) +void View::updateToggled(bool isOn) { QAction* sentBy = (QAction*)sender(); - if( !isOn ) + if (!isOn) return; - for ( int i = ViewFitAllId; i < ViewHlrOffId; i++ ) + for (int i = ViewFitAllId; i < ViewHlrOffId; i++) { - QAction* anAction = myViewActions->at( i ); - - if ( ( anAction == myViewActions->at( ViewFitAreaId ) ) || - ( anAction == myViewActions->at( ViewZoomId ) ) || - ( anAction == myViewActions->at( ViewPanId ) ) || - ( anAction == myViewActions->at( ViewGlobalPanId ) ) || - ( anAction == myViewActions->at( ViewRotationId ) ) ) + QAction* anAction = myViewActions->at(i); + + if ((anAction == myViewActions->at(ViewFitAreaId)) + || (anAction == myViewActions->at(ViewZoomId)) || (anAction == myViewActions->at(ViewPanId)) + || (anAction == myViewActions->at(ViewGlobalPanId)) + || (anAction == myViewActions->at(ViewRotationId))) { - if ( anAction && ( anAction != sentBy ) ) + if (anAction && (anAction != sentBy)) { - anAction->setCheckable( true ); - anAction->setChecked( false ); + anAction->setCheckable(true); + anAction->setChecked(false); } else { - if ( sentBy == myViewActions->at( ViewFitAreaId ) ) - setCursor( *handCursor ); - else if ( sentBy == myViewActions->at( ViewZoomId ) ) - setCursor( *zoomCursor ); - else if ( sentBy == myViewActions->at( ViewPanId ) ) - setCursor( *panCursor ); - else if ( sentBy == myViewActions->at( ViewGlobalPanId ) ) - setCursor( *globPanCursor ); - else if ( sentBy == myViewActions->at( ViewRotationId ) ) - setCursor( *rotCursor ); + if (sentBy == myViewActions->at(ViewFitAreaId)) + setCursor(*handCursor); + else if (sentBy == myViewActions->at(ViewZoomId)) + setCursor(*zoomCursor); + else if (sentBy == myViewActions->at(ViewPanId)) + setCursor(*panCursor); + else if (sentBy == myViewActions->at(ViewGlobalPanId)) + setCursor(*globPanCursor); + else if (sentBy == myViewActions->at(ViewRotationId)) + setCursor(*rotCursor); else - setCursor( *defCursor ); + setCursor(*defCursor); - sentBy->setCheckable( false ); + sentBy->setCheckable(false); } } } @@ -375,18 +372,20 @@ void View::updateToggled( bool isOn ) void View::initCursors() { - if ( !defCursor ) - defCursor = new QCursor( Qt::ArrowCursor ); - if ( !handCursor ) - handCursor = new QCursor( Qt::PointingHandCursor ); - if ( !panCursor ) - panCursor = new QCursor( Qt::SizeAllCursor ); - if ( !globPanCursor ) - globPanCursor = new QCursor( Qt::CrossCursor ); - if ( !zoomCursor ) - zoomCursor = new QCursor( QPixmap( ApplicationCommonWindow::getResourceDir() + QString( "/" ) + QObject::tr( "ICON_CURSOR_ZOOM" ) ) ); - if ( !rotCursor ) - rotCursor = new QCursor( QPixmap( ApplicationCommonWindow::getResourceDir() + QString( "/" ) + QObject::tr( "ICON_CURSOR_ROTATE" ) ) ); + if (!defCursor) + defCursor = new QCursor(Qt::ArrowCursor); + if (!handCursor) + handCursor = new QCursor(Qt::PointingHandCursor); + if (!panCursor) + panCursor = new QCursor(Qt::SizeAllCursor); + if (!globPanCursor) + globPanCursor = new QCursor(Qt::CrossCursor); + if (!zoomCursor) + zoomCursor = new QCursor(QPixmap(ApplicationCommonWindow::getResourceDir() + QString("/") + + QObject::tr("ICON_CURSOR_ZOOM"))); + if (!rotCursor) + rotCursor = new QCursor(QPixmap(ApplicationCommonWindow::getResourceDir() + QString("/") + + QObject::tr("ICON_CURSOR_ROTATE"))); } QList* View::getViewActions() @@ -411,265 +410,270 @@ QPaintEngine* View::paintEngine() const void View::initViewActions() { - if ( myViewActions ) + if (myViewActions) return; myViewActions = new QList(); - QString dir = ApplicationCommonWindow::getResourceDir() + QString( "/" ); + QString dir = ApplicationCommonWindow::getResourceDir() + QString("/"); QAction* a; - a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_FITALL") ), QObject::tr("MNU_FITALL"), this ); - a->setToolTip( QObject::tr("TBR_FITALL") ); - a->setStatusTip( QObject::tr("TBR_FITALL") ); - connect( a, SIGNAL( triggered() ) , this, SLOT( fitAll() ) ); + a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_FITALL")), QObject::tr("MNU_FITALL"), this); + a->setToolTip(QObject::tr("TBR_FITALL")); + a->setStatusTip(QObject::tr("TBR_FITALL")); + connect(a, SIGNAL(triggered()), this, SLOT(fitAll())); myViewActions->insert(ViewFitAllId, a); - a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_FITAREA") ), QObject::tr("MNU_FITAREA"), this ); - a->setToolTip( QObject::tr("TBR_FITAREA") ); - a->setStatusTip( QObject::tr("TBR_FITAREA") ); - connect( a, SIGNAL( triggered() ) , this, SLOT( fitArea() ) ); - - a->setCheckable( true ); - connect( a, SIGNAL( toggled( bool ) ) , this, SLOT( updateToggled( bool ) ) ); - myViewActions->insert( ViewFitAreaId, a ); - - a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_ZOOM") ), QObject::tr("MNU_ZOOM"), this ); - a->setToolTip( QObject::tr("TBR_ZOOM") ); - a->setStatusTip( QObject::tr("TBR_ZOOM") ); - connect( a, SIGNAL( triggered() ) , this, SLOT( zoom() ) ); - - a->setCheckable( true ); - connect( a, SIGNAL( toggled(bool) ) , this, SLOT( updateToggled(bool) ) ); - myViewActions->insert( ViewZoomId, a ); - - a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_PAN") ), QObject::tr("MNU_PAN"), this ); - a->setToolTip( QObject::tr("TBR_PAN") ); - a->setStatusTip( QObject::tr("TBR_PAN") ); - connect( a, SIGNAL( triggered() ) , this, SLOT( pan() ) ); - - a->setCheckable( true ); - connect( a, SIGNAL( toggled(bool) ) , this, SLOT( updateToggled(bool) ) ); - myViewActions->insert( ViewPanId, a ); - - a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_GLOBALPAN") ), QObject::tr("MNU_GLOBALPAN"), this ); - a->setToolTip( QObject::tr("TBR_GLOBALPAN") ); - a->setStatusTip( QObject::tr("TBR_GLOBALPAN") ); - connect( a, SIGNAL( triggered() ) , this, SLOT( globalPan() ) ); - - a->setCheckable( true ); - connect( a, SIGNAL( toggled(bool) ) , this, SLOT( updateToggled(bool) ) ); - myViewActions->insert( ViewGlobalPanId, a ); - - a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_FRONT") ), QObject::tr("MNU_FRONT"), this ); - a->setToolTip( QObject::tr("TBR_FRONT") ); - a->setStatusTip( QObject::tr("TBR_FRONT") ); - connect( a, SIGNAL( triggered() ) , this, SLOT( front() ) ); - myViewActions->insert( ViewFrontId, a ); - - a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_BACK") ), QObject::tr("MNU_BACK"), this ); - a->setToolTip( QObject::tr("TBR_BACK") ); - a->setStatusTip( QObject::tr("TBR_BACK") ); - connect( a, SIGNAL( triggered() ) , this, SLOT( back() ) ); + a = + new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_FITAREA")), QObject::tr("MNU_FITAREA"), this); + a->setToolTip(QObject::tr("TBR_FITAREA")); + a->setStatusTip(QObject::tr("TBR_FITAREA")); + connect(a, SIGNAL(triggered()), this, SLOT(fitArea())); + + a->setCheckable(true); + connect(a, SIGNAL(toggled(bool)), this, SLOT(updateToggled(bool))); + myViewActions->insert(ViewFitAreaId, a); + + a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_ZOOM")), QObject::tr("MNU_ZOOM"), this); + a->setToolTip(QObject::tr("TBR_ZOOM")); + a->setStatusTip(QObject::tr("TBR_ZOOM")); + connect(a, SIGNAL(triggered()), this, SLOT(zoom())); + + a->setCheckable(true); + connect(a, SIGNAL(toggled(bool)), this, SLOT(updateToggled(bool))); + myViewActions->insert(ViewZoomId, a); + + a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_PAN")), QObject::tr("MNU_PAN"), this); + a->setToolTip(QObject::tr("TBR_PAN")); + a->setStatusTip(QObject::tr("TBR_PAN")); + connect(a, SIGNAL(triggered()), this, SLOT(pan())); + + a->setCheckable(true); + connect(a, SIGNAL(toggled(bool)), this, SLOT(updateToggled(bool))); + myViewActions->insert(ViewPanId, a); + + a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_GLOBALPAN")), + QObject::tr("MNU_GLOBALPAN"), + this); + a->setToolTip(QObject::tr("TBR_GLOBALPAN")); + a->setStatusTip(QObject::tr("TBR_GLOBALPAN")); + connect(a, SIGNAL(triggered()), this, SLOT(globalPan())); + + a->setCheckable(true); + connect(a, SIGNAL(toggled(bool)), this, SLOT(updateToggled(bool))); + myViewActions->insert(ViewGlobalPanId, a); + + a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_FRONT")), QObject::tr("MNU_FRONT"), this); + a->setToolTip(QObject::tr("TBR_FRONT")); + a->setStatusTip(QObject::tr("TBR_FRONT")); + connect(a, SIGNAL(triggered()), this, SLOT(front())); + myViewActions->insert(ViewFrontId, a); + + a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_BACK")), QObject::tr("MNU_BACK"), this); + a->setToolTip(QObject::tr("TBR_BACK")); + a->setStatusTip(QObject::tr("TBR_BACK")); + connect(a, SIGNAL(triggered()), this, SLOT(back())); myViewActions->insert(ViewBackId, a); - a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_TOP") ), QObject::tr("MNU_TOP"), this ); - a->setToolTip( QObject::tr("TBR_TOP") ); - a->setStatusTip( QObject::tr("TBR_TOP") ); - connect( a, SIGNAL( triggered() ) , this, SLOT( top() ) ); - myViewActions->insert( ViewTopId, a ); - - a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_BOTTOM") ), QObject::tr("MNU_BOTTOM"), this ); - a->setToolTip( QObject::tr("TBR_BOTTOM") ); - a->setStatusTip( QObject::tr("TBR_BOTTOM") ); - connect( a, SIGNAL( triggered() ) , this, SLOT( bottom() ) ); - myViewActions->insert( ViewBottomId, a ); - - a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_LEFT") ), QObject::tr("MNU_LEFT"), this ); - a->setToolTip( QObject::tr("TBR_LEFT") ); - a->setStatusTip( QObject::tr("TBR_LEFT") ); - connect( a, SIGNAL( triggered() ) , this, SLOT( left() ) ); - myViewActions->insert( ViewLeftId, a ); - - a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_RIGHT") ), QObject::tr("MNU_RIGHT"), this ); - a->setToolTip( QObject::tr("TBR_RIGHT") ); - a->setStatusTip( QObject::tr("TBR_RIGHT") ); - connect( a, SIGNAL( triggered() ) , this, SLOT( right() ) ); - myViewActions->insert( ViewRightId, a ); - - a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_AXO") ), QObject::tr("MNU_AXO"), this ); - a->setToolTip( QObject::tr("TBR_AXO") ); - a->setStatusTip( QObject::tr("TBR_AXO") ); - connect( a, SIGNAL( triggered() ) , this, SLOT( axo() ) ); - myViewActions->insert( ViewAxoId, a ); - - a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_ROTATION") ), QObject::tr("MNU_ROTATION"), this ); - a->setToolTip( QObject::tr("TBR_ROTATION") ); - a->setStatusTip( QObject::tr("TBR_ROTATION") ); - connect( a, SIGNAL( triggered() ) , this, SLOT( rotation() ) ); - a->setCheckable( true ); - connect( a, SIGNAL( toggled(bool) ) , this, SLOT( updateToggled(bool) ) ); - myViewActions->insert( ViewRotationId, a ); - - a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_RESET") ), QObject::tr("MNU_RESET"), this ); - a->setToolTip( QObject::tr("TBR_RESET") ); - a->setStatusTip( QObject::tr("TBR_RESET") ); - connect( a, SIGNAL( triggered() ) , this, SLOT( reset() ) ); - myViewActions->insert( ViewResetId, a ); - - QActionGroup* ag = new QActionGroup( this ); - - a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_HLROFF") ), QObject::tr("MNU_HLROFF"), this ); - a->setToolTip( QObject::tr("TBR_HLROFF") ); - a->setStatusTip( QObject::tr("TBR_HLROFF") ); - connect( a, SIGNAL( triggered() ) , this, SLOT( hlrOff() ) ); - a->setCheckable( true ); + a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_TOP")), QObject::tr("MNU_TOP"), this); + a->setToolTip(QObject::tr("TBR_TOP")); + a->setStatusTip(QObject::tr("TBR_TOP")); + connect(a, SIGNAL(triggered()), this, SLOT(top())); + myViewActions->insert(ViewTopId, a); + + a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_BOTTOM")), QObject::tr("MNU_BOTTOM"), this); + a->setToolTip(QObject::tr("TBR_BOTTOM")); + a->setStatusTip(QObject::tr("TBR_BOTTOM")); + connect(a, SIGNAL(triggered()), this, SLOT(bottom())); + myViewActions->insert(ViewBottomId, a); + + a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_LEFT")), QObject::tr("MNU_LEFT"), this); + a->setToolTip(QObject::tr("TBR_LEFT")); + a->setStatusTip(QObject::tr("TBR_LEFT")); + connect(a, SIGNAL(triggered()), this, SLOT(left())); + myViewActions->insert(ViewLeftId, a); + + a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_RIGHT")), QObject::tr("MNU_RIGHT"), this); + a->setToolTip(QObject::tr("TBR_RIGHT")); + a->setStatusTip(QObject::tr("TBR_RIGHT")); + connect(a, SIGNAL(triggered()), this, SLOT(right())); + myViewActions->insert(ViewRightId, a); + + a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_AXO")), QObject::tr("MNU_AXO"), this); + a->setToolTip(QObject::tr("TBR_AXO")); + a->setStatusTip(QObject::tr("TBR_AXO")); + connect(a, SIGNAL(triggered()), this, SLOT(axo())); + myViewActions->insert(ViewAxoId, a); + + a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_ROTATION")), + QObject::tr("MNU_ROTATION"), + this); + a->setToolTip(QObject::tr("TBR_ROTATION")); + a->setStatusTip(QObject::tr("TBR_ROTATION")); + connect(a, SIGNAL(triggered()), this, SLOT(rotation())); + a->setCheckable(true); + connect(a, SIGNAL(toggled(bool)), this, SLOT(updateToggled(bool))); + myViewActions->insert(ViewRotationId, a); + + a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_RESET")), QObject::tr("MNU_RESET"), this); + a->setToolTip(QObject::tr("TBR_RESET")); + a->setStatusTip(QObject::tr("TBR_RESET")); + connect(a, SIGNAL(triggered()), this, SLOT(reset())); + myViewActions->insert(ViewResetId, a); + + QActionGroup* ag = new QActionGroup(this); + + a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_HLROFF")), QObject::tr("MNU_HLROFF"), this); + a->setToolTip(QObject::tr("TBR_HLROFF")); + a->setStatusTip(QObject::tr("TBR_HLROFF")); + connect(a, SIGNAL(triggered()), this, SLOT(hlrOff())); + a->setCheckable(true); ag->addAction(a); myViewActions->insert(ViewHlrOffId, a); - a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_HLRON") ), QObject::tr("MNU_HLRON"), this ); - a->setToolTip( QObject::tr("TBR_HLRON") ); - a->setStatusTip( QObject::tr("TBR_HLRON") ); - connect( a, SIGNAL( triggered() ) ,this, SLOT( hlrOn() ) ); - - a->setCheckable( true ); + a = new QAction(QPixmap(dir + QObject::tr("ICON_VIEW_HLRON")), QObject::tr("MNU_HLRON"), this); + a->setToolTip(QObject::tr("TBR_HLRON")); + a->setStatusTip(QObject::tr("TBR_HLRON")); + connect(a, SIGNAL(triggered()), this, SLOT(hlrOn())); + + a->setCheckable(true); ag->addAction(a); - myViewActions->insert( ViewHlrOnId, a ); + myViewActions->insert(ViewHlrOnId, a); } void View::initRaytraceActions() { - if ( myRaytraceActions ) + if (myRaytraceActions) return; myRaytraceActions = new QList(); - QString dir = ApplicationCommonWindow::getResourceDir() + QString( "/" ); + QString dir = ApplicationCommonWindow::getResourceDir() + QString("/"); QAction* a; - a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_RAYTRACING") ), QObject::tr("MNU_TOOL_RAYTRACING"), this ); - a->setToolTip( QObject::tr("TBR_TOOL_RAYTRACING") ); - a->setStatusTip( QObject::tr("TBR_TOOL_RAYTRACING") ); - a->setCheckable( true ); - a->setChecked( false ); - connect( a, SIGNAL( triggered() ) , this, SLOT( onRaytraceAction() ) ); - myRaytraceActions->insert( ToolRaytracingId, a ); - - a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_SHADOWS") ), QObject::tr("MNU_TOOL_SHADOWS"), this ); - a->setToolTip( QObject::tr("TBR_TOOL_SHADOWS") ); - a->setStatusTip( QObject::tr("TBR_TOOL_SHADOWS") ); - a->setCheckable( true ); - a->setChecked( true ); - connect( a, SIGNAL( triggered() ) , this, SLOT( onRaytraceAction() ) ); - myRaytraceActions->insert( ToolShadowsId, a ); - - a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_REFLECTIONS") ), QObject::tr("MNU_TOOL_REFLECTIONS"), this ); - a->setToolTip( QObject::tr("TBR_TOOL_REFLECTIONS") ); - a->setStatusTip( QObject::tr("TBR_TOOL_REFLECTIONS") ); - a->setCheckable( true ); - a->setChecked( false ); - connect( a, SIGNAL( triggered() ) , this, SLOT( onRaytraceAction() ) ); - myRaytraceActions->insert( ToolReflectionsId, a ); - - a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_ANTIALIASING") ), QObject::tr("MNU_TOOL_ANTIALIASING"), this ); - a->setToolTip( QObject::tr("TBR_TOOL_ANTIALIASING") ); - a->setStatusTip( QObject::tr("TBR_TOOL_ANTIALIASING") ); - a->setCheckable( true ); - a->setChecked( false ); - connect( a, SIGNAL( triggered() ) , this, SLOT( onRaytraceAction() ) ); - myRaytraceActions->insert( ToolAntialiasingId, a ); -} - -void View::activateCursor( const CurrentAction3d mode ) -{ - switch( mode ) + a = new QAction(QPixmap(dir + QObject::tr("ICON_TOOL_RAYTRACING")), + QObject::tr("MNU_TOOL_RAYTRACING"), + this); + a->setToolTip(QObject::tr("TBR_TOOL_RAYTRACING")); + a->setStatusTip(QObject::tr("TBR_TOOL_RAYTRACING")); + a->setCheckable(true); + a->setChecked(false); + connect(a, SIGNAL(triggered()), this, SLOT(onRaytraceAction())); + myRaytraceActions->insert(ToolRaytracingId, a); + + a = new QAction(QPixmap(dir + QObject::tr("ICON_TOOL_SHADOWS")), + QObject::tr("MNU_TOOL_SHADOWS"), + this); + a->setToolTip(QObject::tr("TBR_TOOL_SHADOWS")); + a->setStatusTip(QObject::tr("TBR_TOOL_SHADOWS")); + a->setCheckable(true); + a->setChecked(true); + connect(a, SIGNAL(triggered()), this, SLOT(onRaytraceAction())); + myRaytraceActions->insert(ToolShadowsId, a); + + a = new QAction(QPixmap(dir + QObject::tr("ICON_TOOL_REFLECTIONS")), + QObject::tr("MNU_TOOL_REFLECTIONS"), + this); + a->setToolTip(QObject::tr("TBR_TOOL_REFLECTIONS")); + a->setStatusTip(QObject::tr("TBR_TOOL_REFLECTIONS")); + a->setCheckable(true); + a->setChecked(false); + connect(a, SIGNAL(triggered()), this, SLOT(onRaytraceAction())); + myRaytraceActions->insert(ToolReflectionsId, a); + + a = new QAction(QPixmap(dir + QObject::tr("ICON_TOOL_ANTIALIASING")), + QObject::tr("MNU_TOOL_ANTIALIASING"), + this); + a->setToolTip(QObject::tr("TBR_TOOL_ANTIALIASING")); + a->setStatusTip(QObject::tr("TBR_TOOL_ANTIALIASING")); + a->setCheckable(true); + a->setChecked(false); + connect(a, SIGNAL(triggered()), this, SLOT(onRaytraceAction())); + myRaytraceActions->insert(ToolAntialiasingId, a); +} + +void View::activateCursor(const CurrentAction3d mode) +{ + switch (mode) { case CurAction3d_DynamicPanning: - setCursor( *panCursor ); + setCursor(*panCursor); break; case CurAction3d_DynamicZooming: - setCursor( *zoomCursor ); + setCursor(*zoomCursor); break; case CurAction3d_DynamicRotation: - setCursor( *rotCursor ); + setCursor(*rotCursor); break; case CurAction3d_GlobalPanning: - setCursor( *globPanCursor ); + setCursor(*globPanCursor); break; case CurAction3d_WindowZooming: - setCursor( *handCursor ); + setCursor(*handCursor); break; case CurAction3d_Nothing: default: - setCursor( *defCursor ); + setCursor(*defCursor); break; } } -void View::mousePressEvent (QMouseEvent* theEvent) +void View::mousePressEvent(QMouseEvent* theEvent) { - const Graphic3d_Vec2i aPnt (theEvent->pos().x(), theEvent->pos().y()); - const Aspect_VKeyFlags aFlags = qtMouseModifiers2VKeys (theEvent->modifiers()); + const Graphic3d_Vec2i aPnt(theEvent->pos().x(), theEvent->pos().y()); + const Aspect_VKeyFlags aFlags = qtMouseModifiers2VKeys(theEvent->modifiers()); if (!myView.IsNull() - && UpdateMouseButtons (aPnt, - qtMouseButtons2VKeys (theEvent->buttons()), - aFlags, - false)) + && UpdateMouseButtons(aPnt, qtMouseButtons2VKeys(theEvent->buttons()), aFlags, false)) { updateView(); } myClickPos = aPnt; } -void View::mouseReleaseEvent (QMouseEvent* theEvent) +void View::mouseReleaseEvent(QMouseEvent* theEvent) { - const Graphic3d_Vec2i aPnt (theEvent->pos().x(), theEvent->pos().y()); - const Aspect_VKeyFlags aFlags = qtMouseModifiers2VKeys (theEvent->modifiers()); + const Graphic3d_Vec2i aPnt(theEvent->pos().x(), theEvent->pos().y()); + const Aspect_VKeyFlags aFlags = qtMouseModifiers2VKeys(theEvent->modifiers()); if (!myView.IsNull() - && UpdateMouseButtons (aPnt, - qtMouseButtons2VKeys (theEvent->buttons()), - aFlags, - false)) + && UpdateMouseButtons(aPnt, qtMouseButtons2VKeys(theEvent->buttons()), aFlags, false)) { updateView(); } if (myCurrentMode == CurAction3d_GlobalPanning) { - myView->Place (aPnt.x(), aPnt.y(), myCurZoom); + myView->Place(aPnt.x(), aPnt.y(), myCurZoom); } if (myCurrentMode != CurAction3d_Nothing) { - setCurrentAction (CurAction3d_Nothing); + setCurrentAction(CurAction3d_Nothing); } - if (theEvent->button() == Qt::RightButton - && (aFlags & Aspect_VKeyFlags_CTRL) == 0 - && (myClickPos - aPnt).cwiseAbs().maxComp() <= 4) + if (theEvent->button() == Qt::RightButton && (aFlags & Aspect_VKeyFlags_CTRL) == 0 + && (myClickPos - aPnt).cwiseAbs().maxComp() <= 4) { - Popup (aPnt.x(), aPnt.y()); + Popup(aPnt.x(), aPnt.y()); } } -void View::mouseMoveEvent (QMouseEvent* theEvent) +void View::mouseMoveEvent(QMouseEvent* theEvent) { - const Graphic3d_Vec2i aNewPos (theEvent->pos().x(), theEvent->pos().y()); + const Graphic3d_Vec2i aNewPos(theEvent->pos().x(), theEvent->pos().y()); if (!myView.IsNull() - && UpdateMousePosition (aNewPos, - qtMouseButtons2VKeys (theEvent->buttons()), - qtMouseModifiers2VKeys (theEvent->modifiers()), - false)) + && UpdateMousePosition(aNewPos, + qtMouseButtons2VKeys(theEvent->buttons()), + qtMouseModifiers2VKeys(theEvent->modifiers()), + false)) { updateView(); } } //============================================================================== -//function : wheelEvent -//purpose : +// function : wheelEvent +// purpose : //============================================================================== -void View::wheelEvent (QWheelEvent* theEvent) +void View::wheelEvent(QWheelEvent* theEvent) { - const Graphic3d_Vec2i aPos (theEvent->pos().x(), theEvent->pos().y()); - if (!myView.IsNull() - && UpdateZoom (Aspect_ScrollDelta (aPos, theEvent->delta() / 8))) + const Graphic3d_Vec2i aPos(theEvent->pos().x(), theEvent->pos().y()); + if (!myView.IsNull() && UpdateZoom(Aspect_ScrollDelta(aPos, theEvent->delta() / 8))) { updateView(); } @@ -688,158 +692,156 @@ void View::defineMouseGestures() { myMouseGestureMap.Clear(); AIS_MouseGesture aRot = AIS_MouseGesture_RotateOrbit; - activateCursor (myCurrentMode); + activateCursor(myCurrentMode); switch (myCurrentMode) { - case CurAction3d_Nothing: - { + case CurAction3d_Nothing: { noActiveActions(); myMouseGestureMap = myDefaultGestures; break; } - case CurAction3d_DynamicZooming: - { - myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton, AIS_MouseGesture_Zoom); + case CurAction3d_DynamicZooming: { + myMouseGestureMap.Bind(Aspect_VKeyMouse_LeftButton, AIS_MouseGesture_Zoom); break; } - case CurAction3d_GlobalPanning: - { + case CurAction3d_GlobalPanning: { break; } - case CurAction3d_WindowZooming: - { - myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton, AIS_MouseGesture_ZoomWindow); + case CurAction3d_WindowZooming: { + myMouseGestureMap.Bind(Aspect_VKeyMouse_LeftButton, AIS_MouseGesture_ZoomWindow); break; } - case CurAction3d_DynamicPanning: - { - myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton, AIS_MouseGesture_Pan); + case CurAction3d_DynamicPanning: { + myMouseGestureMap.Bind(Aspect_VKeyMouse_LeftButton, AIS_MouseGesture_Pan); break; } - case CurAction3d_DynamicRotation: - { - myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton, aRot); + case CurAction3d_DynamicRotation: { + myMouseGestureMap.Bind(Aspect_VKeyMouse_LeftButton, aRot); break; } } } -void View::Popup( const int /*x*/, const int /*y*/ ) +void View::Popup(const int /*x*/, const int /*y*/) { ApplicationCommonWindow* stApp = ApplicationCommonWindow::getApplication(); - QMdiArea* ws = ApplicationCommonWindow::getWorkspace(); - QMdiSubWindow* w = ws->activeSubWindow(); - if ( myContext->NbSelected() ) + QMdiArea* ws = ApplicationCommonWindow::getWorkspace(); + QMdiSubWindow* w = ws->activeSubWindow(); + if (myContext->NbSelected()) { - QList* aList = stApp->getToolActions(); - QMenu* myToolMenu = new QMenu( 0 ); - myToolMenu->addAction( aList->at( ApplicationCommonWindow::ToolWireframeId ) ); - myToolMenu->addAction( aList->at( ApplicationCommonWindow::ToolShadingId ) ); - myToolMenu->addAction( aList->at( ApplicationCommonWindow::ToolColorId ) ); - - QMenu* myMaterMenu = new QMenu( myToolMenu ); - - QList* aMeterActions = ApplicationCommonWindow::getApplication()->getMaterialActions(); - - QString dir = ApplicationCommonWindow::getResourceDir() + QString( "/" ); - myMaterMenu = myToolMenu->addMenu( QPixmap( dir+QObject::tr("ICON_TOOL_MATER")), QObject::tr("MNU_MATER") ); - for ( int i = 0; i < aMeterActions->size(); i++ ) - myMaterMenu->addAction( aMeterActions->at( i ) ); - - myToolMenu->addAction( aList->at( ApplicationCommonWindow::ToolTransparencyId ) ); - myToolMenu->addAction( aList->at( ApplicationCommonWindow::ToolDeleteId ) ); + QList* aList = stApp->getToolActions(); + QMenu* myToolMenu = new QMenu(0); + myToolMenu->addAction(aList->at(ApplicationCommonWindow::ToolWireframeId)); + myToolMenu->addAction(aList->at(ApplicationCommonWindow::ToolShadingId)); + myToolMenu->addAction(aList->at(ApplicationCommonWindow::ToolColorId)); + + QMenu* myMaterMenu = new QMenu(myToolMenu); + + QList* aMeterActions = + ApplicationCommonWindow::getApplication()->getMaterialActions(); + + QString dir = ApplicationCommonWindow::getResourceDir() + QString("/"); + myMaterMenu = + myToolMenu->addMenu(QPixmap(dir + QObject::tr("ICON_TOOL_MATER")), QObject::tr("MNU_MATER")); + for (int i = 0; i < aMeterActions->size(); i++) + myMaterMenu->addAction(aMeterActions->at(i)); + + myToolMenu->addAction(aList->at(ApplicationCommonWindow::ToolTransparencyId)); + myToolMenu->addAction(aList->at(ApplicationCommonWindow::ToolDeleteId)); addItemInPopup(myToolMenu); - myToolMenu->exec( QCursor::pos() ); + myToolMenu->exec(QCursor::pos()); delete myToolMenu; } else { if (!myBackMenu) { - myBackMenu = new QMenu( 0 ); + myBackMenu = new QMenu(0); - QAction* a = new QAction( QObject::tr("MNU_CH_BACK"), this ); - a->setToolTip( QObject::tr("TBR_CH_BACK") ); - connect( a, SIGNAL( triggered() ), this, SLOT( onBackground() ) ); - myBackMenu->addAction( a ); + QAction* a = new QAction(QObject::tr("MNU_CH_BACK"), this); + a->setToolTip(QObject::tr("TBR_CH_BACK")); + connect(a, SIGNAL(triggered()), this, SLOT(onBackground())); + myBackMenu->addAction(a); addItemInPopup(myBackMenu); - a = new QAction( QObject::tr("MNU_CH_ENV_MAP"), this ); - a->setToolTip( QObject::tr("TBR_CH_ENV_MAP") ); - connect( a, SIGNAL( triggered() ), this, SLOT( onEnvironmentMap() ) ); - a->setCheckable( true ); - a->setChecked( false ); - myBackMenu->addAction( a ); + a = new QAction(QObject::tr("MNU_CH_ENV_MAP"), this); + a->setToolTip(QObject::tr("TBR_CH_ENV_MAP")); + connect(a, SIGNAL(triggered()), this, SLOT(onEnvironmentMap())); + a->setCheckable(true); + a->setChecked(false); + myBackMenu->addAction(a); addItemInPopup(myBackMenu); } - myBackMenu->exec( QCursor::pos() ); + myBackMenu->exec(QCursor::pos()); } - if ( w ) + if (w) w->setFocus(); } -void View::addItemInPopup( QMenu* /*theMenu*/) -{ -} +void View::addItemInPopup(QMenu* /*theMenu*/) {} void View::noActiveActions() { - for ( int i = ViewFitAllId; i < ViewHlrOffId ; i++ ) + for (int i = ViewFitAllId; i < ViewHlrOffId; i++) + { + QAction* anAction = myViewActions->at(i); + if ((anAction == myViewActions->at(ViewFitAreaId)) + || (anAction == myViewActions->at(ViewZoomId)) || (anAction == myViewActions->at(ViewPanId)) + || (anAction == myViewActions->at(ViewGlobalPanId)) + || (anAction == myViewActions->at(ViewRotationId))) { - QAction* anAction = myViewActions->at( i ); - if( ( anAction == myViewActions->at( ViewFitAreaId ) ) || - ( anAction == myViewActions->at( ViewZoomId ) ) || - ( anAction == myViewActions->at( ViewPanId ) ) || - ( anAction == myViewActions->at( ViewGlobalPanId ) ) || - ( anAction == myViewActions->at( ViewRotationId ) ) ) - { - setCursor( *defCursor ); - anAction->setCheckable( true ); - anAction->setChecked( false ); - } + setCursor(*defCursor); + anAction->setCheckable(true); + anAction->setChecked(false); } + } } void View::onBackground() { - QColor aColor ; - Standard_Real R1; - Standard_Real G1; - Standard_Real B1; - myView->BackgroundColor(Quantity_TOC_RGB,R1,G1,B1); - aColor.setRgb((Standard_Integer)(R1 * 255), (Standard_Integer)(G1 * 255), (Standard_Integer)(B1 * 255)); + QColor aColor; + Standard_Real R1; + Standard_Real G1; + Standard_Real B1; + myView->BackgroundColor(Quantity_TOC_RGB, R1, G1, B1); + aColor.setRgb((Standard_Integer)(R1 * 255), + (Standard_Integer)(G1 * 255), + (Standard_Integer)(B1 * 255)); - QColor aRetColor = QColorDialog::getColor(aColor); + QColor aRetColor = QColorDialog::getColor(aColor); - if( aRetColor.isValid() ) - { - R1 = aRetColor.red()/255.; - G1 = aRetColor.green()/255.; - B1 = aRetColor.blue()/255.; - myView->SetBackgroundColor(Quantity_TOC_RGB,R1,G1,B1); - } - myView->Redraw(); + if (aRetColor.isValid()) + { + R1 = aRetColor.red() / 255.; + G1 = aRetColor.green() / 255.; + B1 = aRetColor.blue() / 255.; + myView->SetBackgroundColor(Quantity_TOC_RGB, R1, G1, B1); + } + myView->Redraw(); } void View::onEnvironmentMap() { if (myBackMenu->actions().at(1)->isChecked()) { - QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "", - tr("All Image Files (*.bmp *.gif *.jpg *.jpeg *.png *.tga)")); - - const TCollection_AsciiString anUtf8Path (fileName.toUtf8().data()); - - Handle(Graphic3d_TextureEnv) aTexture = new Graphic3d_TextureEnv( anUtf8Path ); - - myView->SetTextureEnv (aTexture); + QString fileName = + QFileDialog::getOpenFileName(this, + tr("Open File"), + "", + tr("All Image Files (*.bmp *.gif *.jpg *.jpeg *.png *.tga)")); + + const TCollection_AsciiString anUtf8Path(fileName.toUtf8().data()); + + Handle(Graphic3d_TextureEnv) aTexture = new Graphic3d_TextureEnv(anUtf8Path); + + myView->SetTextureEnv(aTexture); } else { - myView->SetTextureEnv (Handle(Graphic3d_TextureEnv)()); + myView->SetTextureEnv(Handle(Graphic3d_TextureEnv)()); } - + myView->Redraw(); } diff --git a/samples/qt/OCCTOverview/code/AdaptorCurve2d_AIS.cxx b/samples/qt/OCCTOverview/code/AdaptorCurve2d_AIS.cxx index 0fa262ba39..488bf10c89 100644 --- a/samples/qt/OCCTOverview/code/AdaptorCurve2d_AIS.cxx +++ b/samples/qt/OCCTOverview/code/AdaptorCurve2d_AIS.cxx @@ -31,35 +31,36 @@ #include #include -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.); diff --git a/samples/qt/OCCTOverview/src/OcctWindow.cxx b/samples/qt/OCCTOverview/src/OcctWindow.cxx index 81c7b0035e..6a5adf9571 100644 --- a/samples/qt/OCCTOverview/src/OcctWindow.cxx +++ b/samples/qt/OCCTOverview/src/OcctWindow.cxx @@ -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(); diff --git a/src/ApplicationFramework/TKBinL/BinObjMgt/BinObjMgt_Persistent.cxx b/src/ApplicationFramework/TKBinL/BinObjMgt/BinObjMgt_Persistent.cxx index c3fe03701d..5b0051bcbf 100644 --- a/src/ApplicationFramework/TKBinL/BinObjMgt/BinObjMgt_Persistent.cxx +++ b/src/ApplicationFramework/TKBinL/BinObjMgt/BinObjMgt_Persistent.cxx @@ -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]); diff --git a/src/ApplicationFramework/TKCDF/CDM/CDM_Document.cxx b/src/ApplicationFramework/TKCDF/CDM/CDM_Document.cxx index b025804d26..e94275e38a 100644 --- a/src/ApplicationFramework/TKCDF/CDM/CDM_Document.cxx +++ b/src/ApplicationFramework/TKCDF/CDM/CDM_Document.cxx @@ -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()) { diff --git a/src/ApplicationFramework/TKCDF/LDOM/LDOM_DeclareSequence.hxx b/src/ApplicationFramework/TKCDF/LDOM/LDOM_DeclareSequence.hxx index 65cebf39bd..c83bc35d40 100644 --- a/src/ApplicationFramework/TKCDF/LDOM/LDOM_DeclareSequence.hxx +++ b/src/ApplicationFramework/TKCDF/LDOM/LDOM_DeclareSequence.hxx @@ -173,7 +173,7 @@ } \ else \ { \ - aCounter = Abs(anI - myICur); \ + aCounter = std::abs(anI - myICur); \ if (anI <= aCounter) \ { \ aCurrent = myFirst; \ diff --git a/src/ApplicationFramework/TKCDF/LDOM/LDOM_OSStream.cxx b/src/ApplicationFramework/TKCDF/LDOM/LDOM_OSStream.cxx index 55b50475c0..206dcc300e 100644 --- a/src/ApplicationFramework/TKCDF/LDOM/LDOM_OSStream.cxx +++ b/src/ApplicationFramework/TKCDF/LDOM/LDOM_OSStream.cxx @@ -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); diff --git a/src/ApplicationFramework/TKStd/StdStorage/StdStorage_TypeData.cxx b/src/ApplicationFramework/TKStd/StdStorage/StdStorage_TypeData.cxx index 2e5ed07628..89367e403b 100644 --- a/src/ApplicationFramework/TKStd/StdStorage/StdStorage_TypeData.cxx +++ b/src/ApplicationFramework/TKStd/StdStorage/StdStorage_TypeData.cxx @@ -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) diff --git a/src/ApplicationFramework/TKVCAF/TPrsStd/TPrsStd_ConstraintTools.cxx b/src/ApplicationFramework/TKVCAF/TPrsStd/TPrsStd_ConstraintTools.cxx index aff0661348..34e71bb584 100644 --- a/src/ApplicationFramework/TKVCAF/TPrsStd/TPrsStd_ConstraintTools.cxx +++ b/src/ApplicationFramework/TKVCAF/TPrsStd/TPrsStd_ConstraintTools.cxx @@ -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 { diff --git a/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_CafReader.cxx b/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_CafReader.cxx index 7b7bafd42a..b84851ae6c 100644 --- a/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_CafReader.cxx +++ b/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_CafReader.cxx @@ -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& // 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& 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); diff --git a/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_CafWriter.cxx b/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_CafWriter.cxx index 630eca3d5a..f5f50d0fa4 100644 --- a/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_CafWriter.cxx +++ b/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_CafWriter.cxx @@ -176,7 +176,7 @@ public: draco::Encoder& theDracoEncoder, const std::vector>& theMeshes, std::vector>& 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(); diff --git a/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_GltfJsonParser.cxx b/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_GltfJsonParser.cxx index 8eedcef27e..74c18f9dea 100644 --- a/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_GltfJsonParser.cxx +++ b/src/DataExchange/TKDEGLTF/RWGltf/RWGltf_GltfJsonParser.cxx @@ -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; diff --git a/src/DataExchange/TKDEIGES/BRepToIGES/BRepToIGES_BRWire.cxx b/src/DataExchange/TKDEIGES/BRepToIGES/BRepToIGES_BRWire.cxx index ab8e89b37e..f446b61874 100644 --- a/src/DataExchange/TKDEIGES/BRepToIGES/BRepToIGES_BRWire.cxx +++ b/src/DataExchange/TKDEIGES/BRepToIGES/BRepToIGES_BRWire.cxx @@ -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)); } } diff --git a/src/DataExchange/TKDEIGES/GeomToIGES/GeomToIGES_GeomCurve.cxx b/src/DataExchange/TKDEIGES/GeomToIGES/GeomToIGES_GeomCurve.cxx index 3083d8f0e9..8b53a648d2 100644 --- a/src/DataExchange/TKDEIGES/GeomToIGES/GeomToIGES_GeomCurve.cxx +++ b/src/DataExchange/TKDEIGES/GeomToIGES/GeomToIGES_GeomCurve.cxx @@ -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) diff --git a/src/DataExchange/TKDEIGES/GeomToIGES/GeomToIGES_GeomSurface.cxx b/src/DataExchange/TKDEIGES/GeomToIGES/GeomToIGES_GeomSurface.cxx index 70733574b3..8706eb149d 100644 --- a/src/DataExchange/TKDEIGES/GeomToIGES/GeomToIGES_GeomSurface.cxx +++ b/src/DataExchange/TKDEIGES/GeomToIGES/GeomToIGES_GeomSurface.cxx @@ -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))); diff --git a/src/DataExchange/TKDEIGES/IGESCAFControl/IGESCAFControl.cxx b/src/DataExchange/TKDEIGES/IGESCAFControl/IGESCAFControl.cxx index af69c95bf2..f47feb1a44 100644 --- a/src/DataExchange/TKDEIGES/IGESCAFControl/IGESCAFControl.cxx +++ b/src/DataExchange/TKDEIGES/IGESCAFControl/IGESCAFControl.cxx @@ -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) diff --git a/src/DataExchange/TKDEIGES/IGESControl/IGESControl_IGESBoundary.cxx b/src/DataExchange/TKDEIGES/IGESControl/IGESControl_IGESBoundary.cxx index 4d8315ba06..867ffdb70d 100644 --- a/src/DataExchange/TKDEIGES/IGESControl/IGESControl_IGESBoundary.cxx +++ b/src/DataExchange/TKDEIGES/IGESControl/IGESControl_IGESBoundary.cxx @@ -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); diff --git a/src/DataExchange/TKDEIGES/IGESControl/IGESControl_Writer.cxx b/src/DataExchange/TKDEIGES/IGESControl/IGESControl_Writer.cxx index 38d25e933f..b36ae6af3d 100644 --- a/src/DataExchange/TKDEIGES/IGESControl/IGESControl_Writer.cxx +++ b/src/DataExchange/TKDEIGES/IGESControl/IGESControl_Writer.cxx @@ -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); } } diff --git a/src/DataExchange/TKDEIGES/IGESData/IGESData_GlobalSection.cxx b/src/DataExchange/TKDEIGES/IGESData/IGESData_GlobalSection.cxx index 61849ee43b..f89a2a189b 100644 --- a/src/DataExchange/TKDEIGES/IGESData/IGESData_GlobalSection.cxx +++ b/src/DataExchange/TKDEIGES/IGESData/IGESData_GlobalSection.cxx @@ -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) diff --git a/src/DataExchange/TKDEIGES/IGESData/IGESData_ToolLocation.cxx b/src/DataExchange/TKDEIGES/IGESData/IGESData_ToolLocation.cxx index 8ff0d61272..09983d85d2 100644 --- a/src/DataExchange/TKDEIGES/IGESData/IGESData_ToolLocation.cxx +++ b/src/DataExchange/TKDEIGES/IGESData/IGESData_ToolLocation.cxx @@ -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.) diff --git a/src/DataExchange/TKDEIGES/IGESDimen/IGESDimen_FlagNote.cxx b/src/DataExchange/TKDEIGES/IGESDimen/IGESDimen_FlagNote.cxx index e8dc33d82f..d4d405b534 100644 --- a/src/DataExchange/TKDEIGES/IGESDimen/IGESDimen_FlagNote.cxx +++ b/src/DataExchange/TKDEIGES/IGESDimen/IGESDimen_FlagNote.cxx @@ -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))); } diff --git a/src/DataExchange/TKDEIGES/IGESDraw/IGESDraw_DrawingWithRotation.cxx b/src/DataExchange/TKDEIGES/IGESDraw/IGESDraw_DrawingWithRotation.cxx index ecb91abbe5..8082ac7faf 100644 --- a/src/DataExchange/TKDEIGES/IGESDraw/IGESDraw_DrawingWithRotation.cxx +++ b/src/DataExchange/TKDEIGES/IGESDraw/IGESDraw_DrawingWithRotation.cxx @@ -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)); } diff --git a/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_BSplineCurve.cxx b/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_BSplineCurve.cxx index ffa6d7a080..4f84ac4f2d 100644 --- a/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_BSplineCurve.cxx +++ b/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_BSplineCurve.cxx @@ -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; } diff --git a/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_BSplineSurface.cxx b/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_BSplineSurface.cxx index 73ab24cf9d..1159bd1266 100644 --- a/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_BSplineSurface.cxx +++ b/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_BSplineSurface.cxx @@ -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; } diff --git a/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_CircularArc.cxx b/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_CircularArc.cxx index 46a47ca9f4..cded3a6e5d 100644 --- a/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_CircularArc.cxx +++ b/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_CircularArc.cxx @@ -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()); } diff --git a/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_ConicArc.cxx b/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_ConicArc.cxx index 94006e0775..80f6250618 100644 --- a/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_ConicArc.cxx +++ b/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_ConicArc.cxx @@ -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; diff --git a/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_ToolCircularArc.cxx b/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_ToolCircularArc.cxx index d666f3ad45..6760038996 100644 --- a/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_ToolCircularArc.cxx +++ b/src/DataExchange/TKDEIGES/IGESGeom/IGESGeom_ToolCircularArc.cxx @@ -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", diff --git a/src/DataExchange/TKDEIGES/IGESGraph/IGESGraph_Color.cxx b/src/DataExchange/TKDEIGES/IGESGraph/IGESGraph_Color.cxx index f3ac88903b..c4c1e423e8 100644 --- a/src/DataExchange/TKDEIGES/IGESGraph/IGESGraph_Color.cxx +++ b/src/DataExchange/TKDEIGES/IGESGraph/IGESGraph_Color.cxx @@ -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 diff --git a/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_Actor.cxx b/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_Actor.cxx index 563c89cbdc..f00b079744 100644 --- a/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_Actor.cxx +++ b/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_Actor.cxx @@ -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 diff --git a/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_BasicCurve.cxx b/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_BasicCurve.cxx index cc61083c51..be203056f7 100644 --- a/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_BasicCurve.cxx +++ b/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_BasicCurve.cxx @@ -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; } diff --git a/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_BasicSurface.cxx b/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_BasicSurface.cxx index d7b8c0dfc0..11bbe2537e 100644 --- a/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_BasicSurface.cxx +++ b/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_BasicSurface.cxx @@ -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()) diff --git a/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_CurveAndSurface.cxx b/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_CurveAndSurface.cxx index a18e26e184..4ac8b547db 100644 --- a/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_CurveAndSurface.cxx +++ b/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_CurveAndSurface.cxx @@ -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; } diff --git a/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_IGESBoundary.cxx b/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_IGESBoundary.cxx index 8aaf4b47cb..5bf1f789e6 100644 --- a/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_IGESBoundary.cxx +++ b/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_IGESBoundary.cxx @@ -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); } diff --git a/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_Reader.cxx b/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_Reader.cxx index a8ead9f574..b4da361c27 100644 --- a/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_Reader.cxx +++ b/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_Reader.cxx @@ -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 diff --git a/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_TopoSurface.cxx b/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_TopoSurface.cxx index c386bff76f..7cfbe73de2 100644 --- a/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_TopoSurface.cxx +++ b/src/DataExchange/TKDEIGES/IGESToBRep/IGESToBRep_TopoSurface.cxx @@ -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; diff --git a/src/DataExchange/TKDEOBJ/RWObj/RWObj_MtlReader.cxx b/src/DataExchange/TKDEOBJ/RWObj/RWObj_MtlReader.cxx index e79d02a4a5..cd7721edd3 100644 --- a/src/DataExchange/TKDEOBJ/RWObj/RWObj_MtlReader.cxx +++ b/src/DataExchange/TKDEOBJ/RWObj/RWObj_MtlReader.cxx @@ -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; } } diff --git a/src/DataExchange/TKDEOBJ/RWObj/RWObj_Reader.cxx b/src/DataExchange/TKDEOBJ/RWObj/RWObj_Reader.cxx index fc7f943630..4214a23b8d 100644 --- a/src/DataExchange/TKDEOBJ/RWObj/RWObj_Reader.cxx +++ b/src/DataExchange/TKDEOBJ/RWObj/RWObj_Reader.cxx @@ -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; diff --git a/src/DataExchange/TKDESTEP/GTests/STEPConstruct_RenderingProperties_Test.cxx b/src/DataExchange/TKDESTEP/GTests/STEPConstruct_RenderingProperties_Test.cxx index eb7053d5ba..90e4999d09 100644 --- a/src/DataExchange/TKDESTEP/GTests/STEPConstruct_RenderingProperties_Test.cxx +++ b/src/DataExchange/TKDESTEP/GTests/STEPConstruct_RenderingProperties_Test.cxx @@ -91,7 +91,7 @@ protected: // Set basic properties aMaterial.DiffuseColor = mySurfaceColor; - aMaterial.Transparency = myTransparency; + aMaterial.Transparency = static_cast(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); diff --git a/src/DataExchange/TKDESTEP/GeomToStep/GeomToStep_MakeRectangularTrimmedSurface.cxx b/src/DataExchange/TKDESTEP/GeomToStep/GeomToStep_MakeRectangularTrimmedSurface.cxx index 2948d8a9d1..700c905727 100644 --- a/src/DataExchange/TKDESTEP/GeomToStep/GeomToStep_MakeRectangularTrimmedSurface.cxx +++ b/src/DataExchange/TKDESTEP/GeomToStep/GeomToStep_MakeRectangularTrimmedSurface.cxx @@ -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))) { diff --git a/src/DataExchange/TKDESTEP/RWStepGeom/RWStepGeom_RWBSplineCurveWithKnots.cxx b/src/DataExchange/TKDESTEP/RWStepGeom/RWStepGeom_RWBSplineCurveWithKnots.cxx index 1f3a941729..32cec8815f 100644 --- a/src/DataExchange/TKDESTEP/RWStepGeom/RWStepGeom_RWBSplineCurveWithKnots.cxx +++ b/src/DataExchange/TKDESTEP/RWStepGeom/RWStepGeom_RWBSplineCurveWithKnots.cxx @@ -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"); diff --git a/src/DataExchange/TKDESTEP/RWStepGeom/RWStepGeom_RWBSplineSurfaceWithKnots.cxx b/src/DataExchange/TKDESTEP/RWStepGeom/RWStepGeom_RWBSplineSurfaceWithKnots.cxx index e796240f11..d586db158d 100644 --- a/src/DataExchange/TKDESTEP/RWStepGeom/RWStepGeom_RWBSplineSurfaceWithKnots.cxx +++ b/src/DataExchange/TKDESTEP/RWStepGeom/RWStepGeom_RWBSplineSurfaceWithKnots.cxx @@ -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"); diff --git a/src/DataExchange/TKDESTEP/RWStepGeom/RWStepGeom_RWCartesianPoint.cxx b/src/DataExchange/TKDESTEP/RWStepGeom/RWStepGeom_RWCartesianPoint.cxx index 5e7852dfcc..6ce32588b1 100644 --- a/src/DataExchange/TKDESTEP/RWStepGeom/RWStepGeom_RWCartesianPoint.cxx +++ b/src/DataExchange/TKDESTEP/RWStepGeom/RWStepGeom_RWCartesianPoint.cxx @@ -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)) diff --git a/src/DataExchange/TKDESTEP/RWStepGeom/RWStepGeom_RWDirection.cxx b/src/DataExchange/TKDESTEP/RWStepGeom/RWStepGeom_RWDirection.cxx index cee5472fe9..424058b888 100644 --- a/src/DataExchange/TKDESTEP/RWStepGeom/RWStepGeom_RWDirection.cxx +++ b/src/DataExchange/TKDESTEP/RWStepGeom/RWStepGeom_RWDirection.cxx @@ -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) diff --git a/src/DataExchange/TKDESTEP/RWStepGeom/RWStepGeom_RWVector.cxx b/src/DataExchange/TKDESTEP/RWStepGeom/RWStepGeom_RWVector.cxx index 7c1ab7695a..4029948a3a 100644 --- a/src/DataExchange/TKDESTEP/RWStepGeom/RWStepGeom_RWVector.cxx +++ b/src/DataExchange/TKDESTEP/RWStepGeom/RWStepGeom_RWVector.cxx @@ -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"); } diff --git a/src/DataExchange/TKDESTEP/RWStepShape/RWStepShape_RWEdgeCurve.cxx b/src/DataExchange/TKDESTEP/RWStepShape/RWStepShape_RWEdgeCurve.cxx index 408de87909..65faae2ede 100644 --- a/src/DataExchange/TKDESTEP/RWStepShape/RWStepShape_RWEdgeCurve.cxx +++ b/src/DataExchange/TKDESTEP/RWStepShape/RWStepShape_RWEdgeCurve.cxx @@ -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 diff --git a/src/DataExchange/TKDESTEP/RWStepVisual/RWStepVisual_RWCoordinatesList.cxx b/src/DataExchange/TKDESTEP/RWStepVisual/RWStepVisual_RWCoordinatesList.cxx index 98105998a9..f327e3083a 100644 --- a/src/DataExchange/TKDESTEP/RWStepVisual/RWStepVisual_RWCoordinatesList.cxx +++ b/src/DataExchange/TKDESTEP/RWStepVisual/RWStepVisual_RWCoordinatesList.cxx @@ -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.; diff --git a/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Reader.cxx b/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Reader.cxx index a7b5a44f56..06853ff373 100644 --- a/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Reader.cxx +++ b/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Reader.cxx @@ -4193,7 +4193,7 @@ static void setDimObjectToXCAF(const Handle(Standard_Transient)& theEnt, { aVal = aVal * anUnitCtxLowerBound.LengthFactor(); } - aDim2 = Abs(aVal); + aDim2 = std::abs(aVal); } else { diff --git a/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Writer.cxx b/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Writer.cxx index 9d89fd2d3d..dbbd1a4780 100644 --- a/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Writer.cxx +++ b/src/DataExchange/TKDESTEP/STEPCAFControl/STEPCAFControl_Writer.cxx @@ -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; diff --git a/src/DataExchange/TKDESTEP/STEPConstruct/STEPConstruct_RenderingProperties.cxx b/src/DataExchange/TKDESTEP/STEPConstruct/STEPConstruct_RenderingProperties.cxx index 521b2399dd..3ca1641d15 100644 --- a/src/DataExchange/TKDESTEP/STEPConstruct/STEPConstruct_RenderingProperties.cxx +++ b/src/DataExchange/TKDESTEP/STEPConstruct/STEPConstruct_RenderingProperties.cxx @@ -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; diff --git a/src/DataExchange/TKDESTEP/STEPControl/STEPControl_ActorRead.cxx b/src/DataExchange/TKDESTEP/STEPControl/STEPControl_ActorRead.cxx index 91bb61904f..077706940c 100644 --- a/src/DataExchange/TKDESTEP/STEPControl/STEPControl_ActorRead.cxx +++ b/src/DataExchange/TKDESTEP/STEPControl/STEPControl_ActorRead.cxx @@ -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); } //================================================================================================= diff --git a/src/DataExchange/TKDESTEP/STEPControl/STEPControl_ActorWrite.cxx b/src/DataExchange/TKDESTEP/STEPControl/STEPControl_ActorWrite.cxx index f0b87d325c..eb76093a4f 100644 --- a/src/DataExchange/TKDESTEP/STEPControl/STEPControl_ActorWrite.cxx +++ b/src/DataExchange/TKDESTEP/STEPControl/STEPControl_ActorWrite.cxx @@ -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 diff --git a/src/DataExchange/TKDESTEP/StepTidy/StepTidy_CircleHasher.pxx b/src/DataExchange/TKDESTEP/StepTidy/StepTidy_CircleHasher.pxx index ae890b200f..a95de03b2d 100644 --- a/src/DataExchange/TKDESTEP/StepTidy/StepTidy_CircleHasher.pxx +++ b/src/DataExchange/TKDESTEP/StepTidy/StepTidy_CircleHasher.pxx @@ -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; } diff --git a/src/DataExchange/TKDESTEP/StepToGeom/StepToGeom.cxx b/src/DataExchange/TKDESTEP/StepToGeom/StepToGeom.cxx index 4a41610022..1e23f48b5e 100644 --- a/src/DataExchange/TKDESTEP/StepToGeom/StepToGeom.cxx +++ b/src/DataExchange/TKDESTEP/StepToGeom/StepToGeom.cxx @@ -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; diff --git a/src/DataExchange/TKDESTEP/StepToTopoDS/StepToTopoDS_GeometricTool.cxx b/src/DataExchange/TKDESTEP/StepToTopoDS/StepToTopoDS_GeometricTool.cxx index 8e94b5ab98..68e6e1b536 100644 --- a/src/DataExchange/TKDESTEP/StepToTopoDS/StepToTopoDS_GeometricTool.cxx +++ b/src/DataExchange/TKDESTEP/StepToTopoDS/StepToTopoDS_GeometricTool.cxx @@ -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; } diff --git a/src/DataExchange/TKDESTEP/StepToTopoDS/StepToTopoDS_TranslateEdge.cxx b/src/DataExchange/TKDESTEP/StepToTopoDS/StepToTopoDS_TranslateEdge.cxx index 9192190bcb..c033adf866 100644 --- a/src/DataExchange/TKDESTEP/StepToTopoDS/StepToTopoDS_TranslateEdge.cxx +++ b/src/DataExchange/TKDESTEP/StepToTopoDS/StepToTopoDS_TranslateEdge.cxx @@ -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); diff --git a/src/DataExchange/TKDESTEP/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx b/src/DataExchange/TKDESTEP/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx index 62865d7e99..9ee9520077 100644 --- a/src/DataExchange/TKDESTEP/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx +++ b/src/DataExchange/TKDESTEP/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx @@ -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()); } diff --git a/src/DataExchange/TKDESTEP/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx b/src/DataExchange/TKDESTEP/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx index 5df74481d2..75dcb2808b 100644 --- a/src/DataExchange/TKDESTEP/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx +++ b/src/DataExchange/TKDESTEP/TopoDSToStep/TopoDSToStep_MakeStepEdge.cxx @@ -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()) diff --git a/src/DataExchange/TKDESTL/RWStl/RWStl_Reader.cxx b/src/DataExchange/TKDESTL/RWStl/RWStl_Reader.cxx index 296fe7b75b..3649b42aa3 100644 --- a/src/DataExchange/TKDESTL/RWStl/RWStl_Reader.cxx +++ b/src/DataExchange/TKDESTL/RWStl/RWStl_Reader.cxx @@ -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) { diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_AsciiText.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_AsciiText.cxx index cb13ccf4d9..b5a8cceace 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_AsciiText.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_AsciiText.cxx @@ -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"; diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_Cone.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_Cone.cxx index 89efbc9f94..c58cd8b0e3 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_Cone.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_Cone.cxx @@ -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"; diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_Coordinate3.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_Coordinate3.cxx index 8c85d2fe2e..ccb1d5591f 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_Coordinate3.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_Coordinate3.cxx @@ -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; diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_Cube.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_Cube.cxx index 91a2fa9c71..29709ef2d7 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_Cube.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_Cube.cxx @@ -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"; diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_Cylinder.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_Cylinder.cxx index c1eb9b73eb..47dcaea977 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_Cylinder.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_Cylinder.cxx @@ -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"; diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_DirectionalLight.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_DirectionalLight.cxx index 7358686ee2..9cdf5c4207 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_DirectionalLight.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_DirectionalLight.cxx @@ -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 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"; diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_FontStyle.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_FontStyle.cxx index e62cb35ce1..8461da4f4b 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_FontStyle.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_FontStyle.cxx @@ -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"; diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_LOD.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_LOD.cxx index 762e586ee6..04a6f0f818 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_LOD.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_LOD.cxx @@ -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"; diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_Material.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_Material.cxx index dd821b0f48..42a8a5b13e 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_Material.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_Material.cxx @@ -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++) diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_MatrixTransform.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_MatrixTransform.cxx index 11ef6fb48a..efaf50e932 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_MatrixTransform.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_MatrixTransform.cxx @@ -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"; diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_Normal.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_Normal.cxx index 33c01a2190..6cc505449e 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_Normal.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_Normal.cxx @@ -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; diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_OrthographicCamera.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_OrthographicCamera.cxx index 05065b0f6a..3a62ed3de9 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_OrthographicCamera.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_OrthographicCamera.cxx @@ -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"; diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_PerspectiveCamera.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_PerspectiveCamera.cxx index 1ff12e514e..fbd33612f7 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_PerspectiveCamera.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_PerspectiveCamera.cxx @@ -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"; diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_PointLight.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_PointLight.cxx index efc2be6390..4e9af1941e 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_PointLight.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_PointLight.cxx @@ -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 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"; diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_Rotation.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_Rotation.cxx index b83b7a97aa..147dd85500 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_Rotation.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_Rotation.cxx @@ -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() << " "; diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_Scale.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_Scale.cxx index a0f23452fc..5a26c28cdb 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_Scale.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_Scale.cxx @@ -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"; diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_ShapeHints.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_ShapeHints.cxx index c4418319ae..ea4fad8171 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_ShapeHints.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_ShapeHints.cxx @@ -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"; } diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_Sphere.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_Sphere.cxx index 9125fa7ef7..8de8335b0e 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_Sphere.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_Sphere.cxx @@ -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"; diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_SpotLight.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_SpotLight.cxx index a022c3b2f0..d38c695c70 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_SpotLight.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_SpotLight.cxx @@ -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 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"; diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_Texture2Transform.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_Texture2Transform.cxx index 6d7480a5f0..c8225d2ce8 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_Texture2Transform.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_Texture2Transform.cxx @@ -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"; diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_TextureCoordinate2.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_TextureCoordinate2.cxx index 5297b60ac7..e49dc3d293 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_TextureCoordinate2.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_TextureCoordinate2.cxx @@ -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++) diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_Transform.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_Transform.cxx index d793c58662..a331690cbf 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_Transform.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_Transform.cxx @@ -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"; diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_Translation.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_Translation.cxx index 6e543d71ec..b09088b3b7 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_Translation.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_Translation.cxx @@ -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"; diff --git a/src/DataExchange/TKDEVRML/Vrml/Vrml_WWWInline.cxx b/src/DataExchange/TKDEVRML/Vrml/Vrml_WWWInline.cxx index 5ccec68e19..7d913a045c 100644 --- a/src/DataExchange/TKDEVRML/Vrml/Vrml_WWWInline.cxx +++ b/src/DataExchange/TKDEVRML/Vrml/Vrml_WWWInline.cxx @@ -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"; diff --git a/src/DataExchange/TKDEVRML/VrmlConverter/VrmlConverter_Curve.cxx b/src/DataExchange/TKDEVRML/VrmlConverter/VrmlConverter_Curve.cxx index 72ddb1f267..bd4cba0c7d 100644 --- a/src/DataExchange/TKDEVRML/VrmlConverter/VrmlConverter_Curve.cxx +++ b/src/DataExchange/TKDEVRML/VrmlConverter/VrmlConverter_Curve.cxx @@ -90,7 +90,7 @@ static void DrawCurve(const Adaptor3d_Curve& aCurve, { nbintervals = aCurve.NbKnots() - 1; // std::cout << "NbKnots "< 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 diff --git a/src/DataExchange/TKDEVRML/VrmlConverter/VrmlConverter_HLRShape.cxx b/src/DataExchange/TKDEVRML/VrmlConverter/VrmlConverter_HLRShape.cxx index f4e56579a8..5753d7e55c 100644 --- a/src/DataExchange/TKDEVRML/VrmlConverter/VrmlConverter_HLRShape.cxx +++ b/src/DataExchange/TKDEVRML/VrmlConverter/VrmlConverter_HLRShape.cxx @@ -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 diff --git a/src/DataExchange/TKDEVRML/VrmlConverter/VrmlConverter_Projector.cxx b/src/DataExchange/TKDEVRML/VrmlConverter/VrmlConverter_Projector.cxx index 13168e2356..b119a6fbee 100644 --- a/src/DataExchange/TKDEVRML/VrmlConverter/VrmlConverter_Projector.cxx +++ b/src/DataExchange/TKDEVRML/VrmlConverter/VrmlConverter_Projector.cxx @@ -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; diff --git a/src/DataExchange/TKDEVRML/VrmlConverter/VrmlConverter_WFDeflectionRestrictedFace.cxx b/src/DataExchange/TKDEVRML/VrmlConverter/VrmlConverter_WFDeflectionRestrictedFace.cxx index f2aa975942..2c1a63ee4e 100644 --- a/src/DataExchange/TKDEVRML/VrmlConverter/VrmlConverter_WFDeflectionRestrictedFace.cxx +++ b/src/DataExchange/TKDEVRML/VrmlConverter/VrmlConverter_WFDeflectionRestrictedFace.cxx @@ -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 diff --git a/src/DataExchange/TKDEVRML/VrmlConverter/VrmlConverter_WFDeflectionShape.cxx b/src/DataExchange/TKDEVRML/VrmlConverter/VrmlConverter_WFDeflectionShape.cxx index f5166f1b4e..c668f14e52 100644 --- a/src/DataExchange/TKDEVRML/VrmlConverter/VrmlConverter_WFDeflectionShape.cxx +++ b/src/DataExchange/TKDEVRML/VrmlConverter/VrmlConverter_WFDeflectionShape.cxx @@ -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 diff --git a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Scene.cxx b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Scene.cxx index 182015177b..1359074ef9 100644 --- a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Scene.cxx +++ b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_Scene.cxx @@ -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(sizeof(spaces) - 1)); (*myOutput) << &spaces[sizeof(spaces) - 1 - nSpaces]; if (theLin0) { diff --git a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_ShapeConvert.cxx b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_ShapeConvert.cxx index bd8539f04a..903bfacbee 100644 --- a/src/DataExchange/TKDEVRML/VrmlData/VrmlData_ShapeConvert.cxx +++ b/src/DataExchange/TKDEVRML/VrmlData/VrmlData_ShapeConvert.cxx @@ -423,7 +423,7 @@ Handle(VrmlData_Geometry) VrmlData_ShapeConvert::triToIndexedFaceSet( gp_XYZ* arrVec = static_cast(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); diff --git a/src/DataExchange/TKRWMesh/RWMesh/RWMesh_CoordinateSystemConverter.cxx b/src/DataExchange/TKRWMesh/RWMesh/RWMesh_CoordinateSystemConverter.cxx index 6c68b6c700..5f624362b0 100644 --- a/src/DataExchange/TKRWMesh/RWMesh/RWMesh_CoordinateSystemConverter.cxx +++ b/src/DataExchange/TKRWMesh/RWMesh/RWMesh_CoordinateSystemConverter.cxx @@ -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 { diff --git a/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_DimTolTool.cxx b/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_DimTolTool.cxx index fa5d26523f..a8404dee73 100644 --- a/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_DimTolTool.cxx +++ b/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_DimTolTool.cxx @@ -191,13 +191,13 @@ Standard_Boolean XCAFDoc_DimTolTool::FindDimTol( { // dimension for (Standard_Integer i = 1; i <= aVal->Length(); i++) { - if (Abs(aVal->Value(i) - aVal1->Value(i)) > Precision::Confusion()) + if (std::abs(aVal->Value(i) - aVal1->Value(i)) > Precision::Confusion()) IsEqual = Standard_False; } } else if (kind < 50) { // tolerance - if (Abs(aVal->Value(1) - aVal1->Value(1)) > Precision::Confusion()) + if (std::abs(aVal->Value(1) - aVal1->Value(1)) > Precision::Confusion()) IsEqual = Standard_False; } if (IsEqual) diff --git a/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_Editor.cxx b/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_Editor.cxx index 57417d09ed..2db218119f 100644 --- a/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_Editor.cxx +++ b/src/DataExchange/TKXCAF/XCAFDoc/XCAFDoc_Editor.cxx @@ -705,7 +705,7 @@ Standard_Boolean XCAFDoc_Editor::RescaleGeometry(const TDF_Label& theLabel return Standard_False; } - if (Abs(theScaleFactor) <= gp::Resolution()) + if (std::abs(theScaleFactor) <= gp::Resolution()) { Message::SendFail("Scale factor is too small."); return Standard_False; diff --git a/src/DataExchange/TKXSBase/MoniTool/MoniTool_Timer.cxx b/src/DataExchange/TKXSBase/MoniTool/MoniTool_Timer.cxx index f7f8dd2bb2..c0e86e2986 100644 --- a/src/DataExchange/TKXSBase/MoniTool/MoniTool_Timer.cxx +++ b/src/DataExchange/TKXSBase/MoniTool/MoniTool_Timer.cxx @@ -149,8 +149,8 @@ void MoniTool_Timer::ComputeAmendments() MT0->Start(); for (i = 1; i <= NBTESTS; i++) { - for (int k = 1; k <= 100; k++) - Sqrt(i + k); + for (int k = 1; k <= 100; k++) [[maybe_unused]] + const double aDummy = std::sqrt(i + k); } MT0->Stop(); @@ -160,8 +160,8 @@ void MoniTool_Timer::ComputeAmendments() for (i = 1; i <= NBTESTS; i++) { MT->Start(); - for (int k = 1; k <= 100; k++) - Sqrt(i + k); + for (int k = 1; k <= 100; k++) [[maybe_unused]] + const double aDummy = std::sqrt(i + k); MT->Stop(); } MT1->Stop(); @@ -172,7 +172,9 @@ void MoniTool_Timer::ComputeAmendments() { MoniTool_TimerSentry TS("_mt_amend_t2_"); for (int k = 1; k <= 100; k++) - Sqrt(i + k); + { + [[maybe_unused]] double aVal = std::sqrt(i + k); + } } MT2->Stop(); @@ -182,7 +184,9 @@ void MoniTool_Timer::ComputeAmendments() { MoniTool_Timer::Start("_mt_amend_t3_"); for (int k = 1; k <= 100; k++) - Sqrt(i + k); + { + [[maybe_unused]] double aVal = std::sqrt(i + k); + } MoniTool_Timer::Stop("_mt_amend_t3_"); } MT3->Stop(); @@ -200,7 +204,7 @@ void MoniTool_Timer::ComputeAmendments() amExternal += (cpu1 - cpu0) / NBTESTS; amInternal += (cput1 - cpu0) / NBTESTS; amAccess += (0.5 * (cpu3 - cpu1)) / NBTESTS; - amError = Abs(cpu1 + cpu3 - 2 * cpu2) / NBTESTS; + amError = std::abs(cpu1 + cpu3 - 2 * cpu2) / NBTESTS; std::cout << "CPU 0: " << cpu0 << std::endl; std::cout << "CPU 1: " << cpu1 << " INTERNAL: " << cput1 << std::endl; diff --git a/src/DataExchange/TKXSBase/XSAlgo/XSAlgo_ShapeProcessor.cxx b/src/DataExchange/TKXSBase/XSAlgo/XSAlgo_ShapeProcessor.cxx index 511bb08b3a..5f1504f35e 100644 --- a/src/DataExchange/TKXSBase/XSAlgo/XSAlgo_ShapeProcessor.cxx +++ b/src/DataExchange/TKXSBase/XSAlgo/XSAlgo_ShapeProcessor.cxx @@ -363,8 +363,8 @@ Standard_Boolean XSAlgo_ShapeProcessor::CheckPCurve(const TopoDS_Edge& theEd const gp_Pnt2d aCurve2DPoint1 = aCurve2D->Value(aCurve2DParam1); const gp_Pnt2d aCurve2DPoint2 = aCurve2D->Value(aCurve2DParam2); // Multi-periodic? Better to discard (beware of infinite values) - const Standard_Real anEdgeSpanX = Abs(aCurve2DPoint1.X() - aCurve2DPoint2.X()); - const Standard_Real anEdgeSpanY = Abs(aCurve2DPoint1.Y() - aCurve2DPoint2.Y()); + const Standard_Real anEdgeSpanX = std::abs(aCurve2DPoint1.X() - aCurve2DPoint2.X()); + const Standard_Real anEdgeSpanY = std::abs(aCurve2DPoint1.Y() - aCurve2DPoint2.Y()); // So if span of pcurve along U or V is longer than 6/8 of the surface span, discard it. // Why exactly 6/8? No idea, but it's the same as in the original code. if (anEdgeSpanX / 8. > (aFaceSurfaceU2 / 6. - aFaceSurfaceU1 / 6.) @@ -449,7 +449,7 @@ Standard_Boolean XSAlgo_ShapeProcessor::CheckPCurve(const TopoDS_Edge& theEd Standard_Boolean aSameParameterFlag = BRep_Tool::SameParameter(aTmpEdge); // if result is not nice, try to call projection and take the best - if (aTolerance > Min(1., 2. * thePrecision) || !aSameRangeFlag) + if (aTolerance > std::min(1., 2. * thePrecision) || !aSameRangeFlag) { // pdn trying to recompute pcurve TopoDS_Edge anEdgePr = MakeEdgeOnCurve(theEdge); diff --git a/src/Draw/TKDCAF/DrawDim/DrawDim_PlanarAngle.cxx b/src/Draw/TKDCAF/DrawDim/DrawDim_PlanarAngle.cxx index 771a834269..1ec4ac615c 100644 --- a/src/Draw/TKDCAF/DrawDim/DrawDim_PlanarAngle.cxx +++ b/src/Draw/TKDCAF/DrawDim/DrawDim_PlanarAngle.cxx @@ -122,7 +122,7 @@ void DrawDim_PlanarAngle::DrawOn(Draw_Display& dis) const gp_Pnt2d pinter = inter.Point(1).Value(); // Standard_Real angle; - angle = Abs(l1.Direction().Angle(l2.Direction())); + angle = std::abs(l1.Direction().Angle(l2.Direction())); gp_Circ2d c(gp_Ax2d(pinter, l1.Direction()), myPosition); // retour au plan @@ -130,7 +130,7 @@ void DrawDim_PlanarAngle::DrawOn(Draw_Display& dis) const gp_Circ circle = Handle(Geom_Circle)::DownCast(C)->Circ(); // Standard_Real p1 = 0., p2 = 0.; - angle = Abs(angle); + angle = std::abs(angle); if (parallel && !clockwise) { p1 = 0.0; diff --git a/src/Draw/TKDraw/DBRep/DBRep.cxx b/src/Draw/TKDraw/DBRep/DBRep.cxx index 271231a7f5..fe49f2ed82 100644 --- a/src/Draw/TKDraw/DBRep/DBRep.cxx +++ b/src/Draw/TKDraw/DBRep/DBRep.cxx @@ -1307,7 +1307,7 @@ static Standard_Integer normals(Draw_Interpretor& theDI, if (anArgIter == 2 && aParam.IsRealValue()) { aLength = aParam.RealValue(); - if (Abs(aLength) <= gp::Resolution()) + if (std::abs(aLength) <= gp::Resolution()) { std::cout << "Syntax error: length should not be zero\n"; return 1; @@ -1321,7 +1321,7 @@ static Standard_Integer normals(Draw_Interpretor& theDI, { ++anArgIter; aLength = anArgIter < theArgNum ? Draw::Atof(theArgs[anArgIter]) : 0.0; - if (Abs(aLength) <= gp::Resolution()) + if (std::abs(aLength) <= gp::Resolution()) { std::cout << "Syntax error: length should not be zero\n"; return 1; diff --git a/src/Draw/TKDraw/DBRep/DBRep_DrawableShape.cxx b/src/Draw/TKDraw/DBRep/DBRep_DrawableShape.cxx index e52e6b9374..67324728a9 100644 --- a/src/Draw/TKDraw/DBRep/DBRep_DrawableShape.cxx +++ b/src/Draw/TKDraw/DBRep/DBRep_DrawableShape.cxx @@ -436,7 +436,7 @@ void DBRep_DrawableShape::DrawOn(Draw_Display& dis) const Standard_Integer Intrv, nbIntv; Standard_Integer nbUIntv = S.NbUIntervals(GeomAbs_CN); Standard_Integer nbVIntv = S.NbVIntervals(GeomAbs_CN); - TColStd_Array1OfReal TI(1, Max(nbUIntv, nbVIntv) + 1); + TColStd_Array1OfReal TI(1, std::max(nbUIntv, nbVIntv) + 1); for (i = 1; i <= N; i++) { @@ -445,8 +445,8 @@ void DBRep_DrawableShape::DrawOn(Draw_Display& dis) const if (T == GeomAbs_IsoU) { S.VIntervals(TI, GeomAbs_CN); - V1 = Max(T1, TI(1)); - V2 = Min(T2, TI(2)); + V1 = std::max(T1, TI(1)); + V2 = std::min(T2, TI(2)); U1 = Par; U2 = Par; stepU = 0; @@ -455,8 +455,8 @@ void DBRep_DrawableShape::DrawOn(Draw_Display& dis) const else { S.UIntervals(TI, GeomAbs_CN); - U1 = Max(T1, TI(1)); - U2 = Min(T2, TI(2)); + U1 = std::max(T1, TI(1)); + U2 = std::min(T2, TI(2)); V1 = Par; V2 = Par; stepV = 0; @@ -475,14 +475,14 @@ void DBRep_DrawableShape::DrawOn(Draw_Display& dis) const continue; if (T == GeomAbs_IsoU) { - V1 = Max(T1, TI(Intrv)); - V2 = Min(T2, TI(Intrv + 1)); + V1 = std::max(T1, TI(Intrv)); + V2 = std::min(T2, TI(Intrv + 1)); stepV = (V2 - V1) / myDiscret; } else { - U1 = Max(T1, TI(Intrv)); - U2 = Min(T2, TI(Intrv + 1)); + U1 = std::max(T1, TI(Intrv)); + U2 = std::min(T2, TI(Intrv + 1)); stepU = (U2 - U1) / myDiscret; } @@ -1143,7 +1143,7 @@ void DBRep_DrawableShape::display(const Handle(Poly_Triangulation)& T, } // allocate the arrays - TColStd_Array1OfInteger Free(1, Max(1, 2 * nFree)); + TColStd_Array1OfInteger Free(1, std::max(1, 2 * nFree)); NCollection_Vector> anInternal; Standard_Integer fr = 1; diff --git a/src/Draw/TKDraw/DBRep/DBRep_IsoBuilder.cxx b/src/Draw/TKDraw/DBRep/DBRep_IsoBuilder.cxx index 2d8ac4582b..66c2a30b54 100644 --- a/src/Draw/TKDraw/DBRep/DBRep_IsoBuilder.cxx +++ b/src/Draw/TKDraw/DBRep/DBRep_IsoBuilder.cxx @@ -133,8 +133,8 @@ DBRep_IsoBuilder::DBRep_IsoBuilder(const TopoDS_Face& TopologicalFace, } //-- Test if a TrimmedCurve is necessary - if (Abs(PCurve->FirstParameter() - U1) <= Precision::PConfusion() - && Abs(PCurve->LastParameter() - U2) <= Precision::PConfusion()) + if (std::abs(PCurve->FirstParameter() - U1) <= Precision::PConfusion() + && std::abs(PCurve->LastParameter() - U2) <= Precision::PConfusion()) { anEdgePCurveMap.Add(TopologicalEdge, PCurve); } @@ -196,7 +196,7 @@ DBRep_IsoBuilder::DBRep_IsoBuilder(const TopoDS_Face& TopologicalFace, } // if U1 and U2 coincide-->do nothing - if (Abs(U1 - U2) <= Precision::PConfusion()) + if (std::abs(U1 - U2) <= Precision::PConfusion()) continue; Handle(Geom2d_TrimmedCurve) TrimPCurve = new Geom2d_TrimmedCurve(PCurve, U1, U2); anEdgePCurveMap.Add(TopologicalEdge, TrimPCurve); @@ -217,9 +217,9 @@ DBRep_IsoBuilder::DBRep_IsoBuilder(const TopoDS_Face& TopologicalFace, //----------------------------------------------------------------------- Standard_Integer IIso; - Standard_Real DeltaU = Abs(myUMax - myUMin); - Standard_Real DeltaV = Abs(myVMax - myVMin); - Standard_Real confusion = Min(DeltaU, DeltaV) * HatcherConfusion3d; + Standard_Real DeltaU = std::abs(myUMax - myUMin); + Standard_Real DeltaV = std::abs(myVMax - myVMin); + Standard_Real confusion = std::min(DeltaU, DeltaV) * HatcherConfusion3d; Confusion3d(confusion); Standard_Real StepU = DeltaU / (Standard_Real)NbIsos; @@ -580,8 +580,8 @@ void DBRep_IsoBuilder::FillGaps(const TopoDS_Face& theFace, DataMapOfEdgePCurve& continue; } - Standard_Real aDelta1 = Abs(aTIntPrev - aTPrev); - Standard_Real aDelta2 = Abs(aTIntCurr - aTCurr); + Standard_Real aDelta1 = std::abs(aTIntPrev - aTPrev); + Standard_Real aDelta2 = std::abs(aTIntCurr - aTCurr); if (aDelta1 < aDeltaPrev || aDelta2 < aDeltaCurr) { aTPrevClosest = aTIntPrev; @@ -613,8 +613,8 @@ void DBRep_IsoBuilder::FillGaps(const TopoDS_Face& theFace, DataMapOfEdgePCurve& // Trim PCurves only if the intersection belongs to current parameter Standard_Boolean bTrim = (aNbCV == 1 - || (Abs(aTPrev - aTPrevClosest) < (lp - fp) / 2. - || Abs(aTCurr - aTCurrClosest) < (lc - fc) / 2.)); + || (std::abs(aTPrev - aTPrevClosest) < (lp - fp) / 2. + || std::abs(aTCurr - aTCurrClosest) < (lc - fc) / 2.)); if (bTrim) { @@ -628,7 +628,7 @@ void DBRep_IsoBuilder::FillGaps(const TopoDS_Face& theFace, DataMapOfEdgePCurve& // Trim the curves with found parameters // Prepare trimming parameters for previous curve - if (Abs(fp - aTPrev) < Abs(lp - aTPrev)) + if (std::abs(fp - aTPrev) < std::abs(lp - aTPrev)) { f = aTPrevClosest; l = lp; @@ -644,7 +644,7 @@ void DBRep_IsoBuilder::FillGaps(const TopoDS_Face& theFace, DataMapOfEdgePCurve& aPrevC2d = new Geom2d_TrimmedCurve(aPrevC2d, f, l); // Prepare trimming parameters for current p-curve - if (Abs(fc - aTCurr) < Abs(lc - aTCurr)) + if (std::abs(fc - aTCurr) < std::abs(lc - aTCurr)) { f = aTCurrClosest; l = lc; diff --git a/src/Draw/TKDraw/Draw/Draw.cxx b/src/Draw/TKDraw/Draw/Draw.cxx index f9e6640105..8d3e430927 100644 --- a/src/Draw/TKDraw/Draw/Draw.cxx +++ b/src/Draw/TKDraw/Draw/Draw.cxx @@ -935,8 +935,9 @@ Standard_Integer Draw::parseColor(const Standard_Integer theArgNb, } if (theArgNb >= 3) { - const Standard_Integer aNumberOfColorComponentsToParse = Min(theArgNb, theToParseAlpha ? 4 : 3); - Standard_Integer aNumberOfColorComponentsParsed = aNumberOfColorComponentsToParse; + const Standard_Integer aNumberOfColorComponentsToParse = + std::min(theArgNb, theToParseAlpha ? 4 : 3); + Standard_Integer aNumberOfColorComponentsParsed = aNumberOfColorComponentsToParse; if (parseIntegerColor(aNumberOfColorComponentsParsed, theArgVec, theColor)) { return aNumberOfColorComponentsParsed; diff --git a/src/Draw/TKDraw/Draw/Draw_Display.cxx b/src/Draw/TKDraw/Draw/Draw_Display.cxx index 5d4d3ebada..3435bb0483 100644 --- a/src/Draw/TKDraw/Draw/Draw_Display.cxx +++ b/src/Draw/TKDraw/Draw/Draw_Display.cxx @@ -175,7 +175,7 @@ void Draw_Display::Draw(const gp_Circ& C, angle = (A2 - A1) / 6; n = 6; } - Standard_Real c = 2 * Cos(angle); + Standard_Real c = 2 * std::cos(angle); gp_Circ Cloc(C); if (!ModifyWithZoom) @@ -228,7 +228,7 @@ void Draw_Display::Draw(const gp_Circ2d& C, angle = (A2 - A1) / 6; n = 6; } - Standard_Real c = 2 * Cos(angle); + Standard_Real c = 2 * std::cos(angle); gp_Circ2d Cloc(C); if (!ModifyWithZoom) diff --git a/src/Draw/TKDraw/Draw/Draw_GraphicCommands.cxx b/src/Draw/TKDraw/Draw/Draw_GraphicCommands.cxx index 4203175aba..ed2a377f73 100644 --- a/src/Draw/TKDraw/Draw/Draw_GraphicCommands.cxx +++ b/src/Draw/TKDraw/Draw/Draw_GraphicCommands.cxx @@ -230,8 +230,8 @@ static Standard_Integer wzoom(Draw_Interpretor& di, Standard_Integer argc, const if ((X1 == X2) || (Y1 == Y2)) return 0; - zx = (Standard_Real)Abs(X2 - X1) / (Standard_Real)W; - zy = (Standard_Real)Abs(Y2 - Y1) / (Standard_Real)H; + zx = (Standard_Real)std::abs(X2 - X1) / (Standard_Real)W; + zy = (Standard_Real)std::abs(Y2 - Y1) / (Standard_Real)H; if (zy > zx) zx = zy; zx = 1 / zx; @@ -711,7 +711,7 @@ static Standard_Integer hardcopy(Draw_Interpretor&, Standard_Integer n, const ch Standard_Real rap = 28.4; Standard_Real cad = 3; Standard_Real dx = 210; - Standard_Real dy = 210 * Sqrt(2.); + Standard_Real dy = 210 * std::sqrt(2.); Standard_Integer iview = 1; const char* file = "a4.ps"; @@ -791,7 +791,7 @@ static Standard_Integer hardcopy(Draw_Interpretor&, Standard_Integer n, const ch dout.GetFrame(iview, vxmin, vymin, vxmax, vymax); Standard_Real kx = (Standard_Real)(pxmax - pxmin) / (vxmax - vxmin); Standard_Real ky = (Standard_Real)(pymax - pymin) / (vymax - vymin); - Standard_Real k = Min(Abs(kx), Abs(ky)); + Standard_Real k = std::min(std::abs(kx), std::abs(ky)); kx = (kx > 0) ? k : -k; ky = (ky > 0) ? k : -k; pxmax = (Standard_Integer)(pxmin + kx * (vxmax - vxmin)); @@ -920,19 +920,19 @@ static Standard_Integer grid(Draw_Interpretor&, Standard_Integer NbArg, const ch StepZ = DefaultGridStep; break; case 2: - StepX = Abs(Draw::Atof(Arg[1])); - StepY = Abs(Draw::Atof(Arg[1])); - StepZ = Abs(Draw::Atof(Arg[1])); + StepX = std::abs(Draw::Atof(Arg[1])); + StepY = std::abs(Draw::Atof(Arg[1])); + StepZ = std::abs(Draw::Atof(Arg[1])); break; case 3: - StepX = Abs(Draw::Atof(Arg[1])); - StepY = Abs(Draw::Atof(Arg[2])); - StepZ = Abs(Draw::Atof(Arg[2])); + StepX = std::abs(Draw::Atof(Arg[1])); + StepY = std::abs(Draw::Atof(Arg[2])); + StepZ = std::abs(Draw::Atof(Arg[2])); break; case 4: - StepX = Abs(Draw::Atof(Arg[1])); - StepY = Abs(Draw::Atof(Arg[2])); - StepZ = Abs(Draw::Atof(Arg[3])); + StepX = std::abs(Draw::Atof(Arg[1])); + StepY = std::abs(Draw::Atof(Arg[2])); + StepZ = std::abs(Draw::Atof(Arg[3])); break; default: return 1; diff --git a/src/Draw/TKDraw/Draw/Draw_Grid.cxx b/src/Draw/TKDraw/Draw/Draw_Grid.cxx index ad5c699f36..bea8bc079b 100644 --- a/src/Draw/TKDraw/Draw/Draw_Grid.cxx +++ b/src/Draw/TKDraw/Draw/Draw_Grid.cxx @@ -49,9 +49,9 @@ void Draw_Grid::Steps(const Standard_Real StepX, const Standard_Real StepY, const Standard_Real StepZ) { - myStepX = Abs(StepX); - myStepY = Abs(StepY); - myStepZ = Abs(StepZ); + myStepX = std::abs(StepX); + myStepY = std::abs(StepY); + myStepZ = std::abs(StepZ); myIsActive = myStepX > MinimumStep && myStepY > MinimumStep && myStepZ > MinimumStep; } @@ -122,7 +122,7 @@ void Draw_Grid::DrawOn(Draw_Display& Out) const Ymin = ((Standard_Real)ymin) / zoom; Ymax = ((Standard_Real)ymax) / zoom; - Offset = Min(Xmax - Xmin, Ymax - Ymin) / Ratio; + Offset = std::min(Xmax - Xmin, Ymax - Ymin) / Ratio; MinIndexX = (Standard_Integer)(Xmin / StepX); MaxIndexX = (Standard_Integer)(Xmax / StepX); diff --git a/src/Draw/TKDraw/Draw/Draw_ProgressIndicator.cxx b/src/Draw/TKDraw/Draw/Draw_ProgressIndicator.cxx index 70efeefcdb..ae0f35054a 100644 --- a/src/Draw/TKDraw/Draw/Draw_ProgressIndicator.cxx +++ b/src/Draw/TKDraw/Draw/Draw_ProgressIndicator.cxx @@ -93,7 +93,7 @@ void Draw_ProgressIndicator::Show(const Message_ProgressScope& theScope, // the last update Standard_Real aPosition = GetPosition(); if (!force && (1. - aPosition) > Precision::Confusion() - && Abs(aPosition - myLastPosition) < myUpdateThreshold) + && std::abs(aPosition - myLastPosition) < myUpdateThreshold) return; // return if update interval has not elapsed myLastPosition = aPosition; diff --git a/src/Draw/TKDraw/Draw/Draw_VariableCommands.cxx b/src/Draw/TKDraw/Draw/Draw_VariableCommands.cxx index a18527b96b..2b02ced184 100644 --- a/src/Draw/TKDraw/Draw/Draw_VariableCommands.cxx +++ b/src/Draw/TKDraw/Draw/Draw_VariableCommands.cxx @@ -863,19 +863,19 @@ static Standard_Integer trigo(Draw_Interpretor& di, Standard_Integer, const char Standard_Real x = Draw::Atof(a[1]); if (!strcasecmp(a[0], "cos")) - di << Cos(x); + di << std::cos(x); else if (!strcasecmp(a[0], "sin")) - di << Sin(x); + di << std::sin(x); else if (!strcasecmp(a[0], "tan")) - di << Tan(x); + di << std::tan(x); else if (!strcasecmp(a[0], "sqrt")) - di << Sqrt(x); + di << std::sqrt(x); else if (!strcasecmp(a[0], "acos")) - di << ACos(x); + di << std::acos(x); else if (!strcasecmp(a[0], "asin")) - di << ASin(x); + di << std::asin(x); else if (!strcasecmp(a[0], "atan2")) - di << ATan2(x, Draw::Atof(a[2])); + di << std::atan2(x, Draw::Atof(a[2])); return 0; } diff --git a/src/Draw/TKDraw/Draw/Draw_Viewer.cxx b/src/Draw/TKDraw/Draw/Draw_Viewer.cxx index cb83f4d609..d446591741 100644 --- a/src/Draw/TKDraw/Draw/Draw_Viewer.cxx +++ b/src/Draw/TKDraw/Draw/Draw_Viewer.cxx @@ -1697,16 +1697,16 @@ void Draw_Display::DrawTo(const gp_Pnt2d& pp2) found = found || inside; if (found) { - if (Abs(x2 - x1) > Abs(y2 - y1)) + if (std::abs(x2 - x1) > std::abs(y2 - y1)) { - if (Abs(x2 - x1) < 1e-5) + if (std::abs(x2 - x1) < 1e-5) lastPickParam = 0; else lastPickParam = (Standard_Real)(xpick - x1) / (Standard_Real)(x2 - x1); } else { - if (Abs(y2 - y1) < 1e-5) + if (std::abs(y2 - y1) < 1e-5) lastPickParam = 0; else lastPickParam = (Standard_Real)(ypick - y1) / (Standard_Real)(y2 - y1); diff --git a/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_BSplineCurve.cxx b/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_BSplineCurve.cxx index 6b8d3715b7..b833f188ea 100644 --- a/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_BSplineCurve.cxx +++ b/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_BSplineCurve.cxx @@ -137,8 +137,8 @@ void DrawTrSurf_BSplineCurve::DrawOn(Draw_Display& dis, const Standard_Boolean ShowKnots) const { Handle(Geom_BSplineCurve) C = Handle(Geom_BSplineCurve)::DownCast(curv); - Standard_Real Eps1 = Abs(Epsilon(U1)); - Standard_Real Eps2 = Abs(Epsilon(U2)); + Standard_Real Eps1 = std::abs(Epsilon(U1)); + Standard_Real Eps2 = std::abs(Epsilon(U2)); Standard_Integer I1, J1, I2, J2; C->LocateU(U1, Eps1, I1, J1); C->LocateU(U2, Eps2, I2, J2); @@ -200,8 +200,8 @@ void DrawTrSurf_BSplineCurve::DrawOn(Draw_Display& dis, else { U = U1; - NbPoints = (Standard_Integer)Abs(Discret * (U1 - Ustart) / (Ustart - Uend)); - NbPoints = Max(NbPoints, 30); + NbPoints = (Standard_Integer)std::abs(Discret * (U1 - Ustart) / (Ustart - Uend)); + NbPoints = std::max(NbPoints, 30); Du = (Ustart - U1) / NbPoints; dis.MoveTo(C->Value(U)); for (Standard_Integer i = 1; i <= NbPoints - 2; i++) @@ -222,8 +222,8 @@ void DrawTrSurf_BSplineCurve::DrawOn(Draw_Display& dis, { Uk2 = Uend; U = Uend; - NbPoints = (Standard_Integer)Abs(Discret * (U2 - Uend) / (Ustart - Uend)); - NbPoints = Max(NbPoints, 30); + NbPoints = (Standard_Integer)std::abs(Discret * (U2 - Uend) / (Ustart - Uend)); + NbPoints = std::max(NbPoints, 30); Du = (U2 - Uend) / NbPoints; dis.MoveTo(C->Value(U)); for (Standard_Integer i = 1; i <= NbPoints - 2; i++) @@ -252,8 +252,8 @@ void DrawTrSurf_BSplineCurve::DrawOn(Draw_Display& dis, Ub = C->Knot(k + 1); } U = Ua; - NbPoints = (Standard_Integer)Abs(Discret * (Ua - Ub) / (Ustart - Uend)); - NbPoints = Max(NbPoints, 30); + NbPoints = (Standard_Integer)std::abs(Discret * (Ua - Ub) / (Ustart - Uend)); + NbPoints = std::max(NbPoints, 30); Du = (Ub - Ua) / NbPoints; dis.MoveTo(C->Value(U)); for (Standard_Integer i = 1; i <= NbPoints - 2; i++) diff --git a/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_BSplineSurface.cxx b/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_BSplineSurface.cxx index c22d36409c..a48c3dacf5 100644 --- a/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_BSplineSurface.cxx +++ b/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_BSplineSurface.cxx @@ -94,8 +94,8 @@ DrawTrSurf_BSplineSurface::DrawTrSurf_BSplineSurface(const Handle(Geom_BSplineSu const Standard_Real Deflection, const Standard_Integer DrawMode) : DrawTrSurf_Surface(S, - Abs(NbUIsos), - Abs(NbVIsos), + std::abs(NbUIsos), + std::abs(NbVIsos), BoundsColor, IsosColor, Discret, @@ -221,8 +221,8 @@ void DrawTrSurf_BSplineSurface::ClearIsos() void DrawTrSurf_BSplineSurface::ShowIsos(const Standard_Integer Nu, const Standard_Integer Nv) { knotsIsos = Standard_False; - nbUIsos = Abs(Nu); - nbVIsos = Abs(Nv); + nbUIsos = std::abs(Nu); + nbVIsos = std::abs(Nv); } void DrawTrSurf_BSplineSurface::FindPole(const Standard_Real X, diff --git a/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Curve.cxx b/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Curve.cxx index 082f108835..9a02484378 100644 --- a/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Curve.cxx +++ b/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Curve.cxx @@ -166,7 +166,7 @@ void DrawTrSurf_Curve::DrawOn(Draw_Display& dis) const LProp.SetParameter(t); if (LProp.IsTangentDefined()) { - Curvature = Abs(LProp.Curvature()); + Curvature = std::abs(LProp.Curvature()); if (Curvature > Resolution) { curv->D0(t, P1); diff --git a/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Curve2d.cxx b/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Curve2d.cxx index 5258c5bc84..838d68354e 100644 --- a/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Curve2d.cxx +++ b/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Curve2d.cxx @@ -162,7 +162,7 @@ void DrawTrSurf_Curve2d::DrawOn(Draw_Display& dis) const LProp.SetParameter(t); if (LProp.IsTangentDefined()) { - Curvature = Abs(LProp.Curvature()); + Curvature = std::abs(LProp.Curvature()); if (Curvature > Resolution) { curv->D0(t, P1); diff --git a/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Surface.cxx b/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Surface.cxx index 1992209da6..fdc17caf6e 100644 --- a/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Surface.cxx +++ b/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Surface.cxx @@ -55,8 +55,8 @@ DrawTrSurf_Surface::DrawTrSurf_Surface(const Handle(Geom_Surface)& S, surf = S; boundsLook = BoundsColor; isosLook = IsosColor; - nbUIsos = Abs(Nu); - nbVIsos = Abs(Nv); + nbUIsos = std::abs(Nu); + nbVIsos = std::abs(Nv); } //================================================================================================= diff --git a/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Surface.hxx b/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Surface.hxx index e8eaf616c1..2fe2a2af47 100644 --- a/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Surface.hxx +++ b/src/Draw/TKDraw/DrawTrSurf/DrawTrSurf_Surface.hxx @@ -75,8 +75,8 @@ public: //! change the number of isoparametric curves to be drawn. virtual void ShowIsos(const Standard_Integer theNu, const Standard_Integer theNv) { - nbUIsos = Abs(theNu); - nbVIsos = Abs(theNv); + nbUIsos = std::abs(theNu); + nbVIsos = std::abs(theNv); } //! For variable copy. diff --git a/src/Draw/TKQADraw/QABugs/QABugs_11.cxx b/src/Draw/TKQADraw/QABugs/QABugs_11.cxx index 9856cb0781..c11c5b2573 100644 --- a/src/Draw/TKQADraw/QABugs/QABugs_11.cxx +++ b/src/Draw/TKQADraw/QABugs/QABugs_11.cxx @@ -4753,23 +4753,23 @@ Standard_Integer OCC22736(Draw_Interpretor& di, Standard_Integer argc, const cha // After applying two times the same mirror the point is located on the same location OK gp_Pnt2d p1MirrorM1 = p1.Transformed(M1); - if (Abs(p2.X() - p1MirrorM1.X()) > aTol) + if (std::abs(p2.X() - p1MirrorM1.X()) > aTol) aStatus = 2; - if (Abs(p2.Y() - p1MirrorM1.Y()) > aTol) + if (std::abs(p2.Y() - p1MirrorM1.Y()) > aTol) aStatus = 3; gp_Pnt2d p1MirrorM1M2 = p1MirrorM1.Transformed(M2); - if (Abs(p1.X() - p1MirrorM1M2.X()) > aTol) + if (std::abs(p1.X() - p1MirrorM1M2.X()) > aTol) aStatus = 4; - if (Abs(p1.Y() - p1MirrorM1M2.Y()) > aTol) + if (std::abs(p1.Y() - p1MirrorM1M2.Y()) > aTol) aStatus = 5; // If we apply the composed transformation of the same two mirrors to a point the result is //not // located on the initial position.-->>ERROR gp_Pnt2d p1MirrorComp = p1.Transformed(Tcomp); - if (Abs(p1.X() - p1MirrorComp.X()) > aTol) + if (std::abs(p1.X() - p1MirrorComp.X()) > aTol) aStatus = 6; - if (Abs(p1.Y() - p1MirrorComp.Y()) > aTol) + if (std::abs(p1.Y() - p1MirrorComp.Y()) > aTol) aStatus = 7; di << "Status = " << aStatus << "\n"; diff --git a/src/Draw/TKQADraw/QABugs/QABugs_12.cxx b/src/Draw/TKQADraw/QABugs/QABugs_12.cxx index d2db4101e6..b1d95ff7f3 100644 --- a/src/Draw/TKQADraw/QABugs/QABugs_12.cxx +++ b/src/Draw/TKQADraw/QABugs/QABugs_12.cxx @@ -58,7 +58,7 @@ static Standard_Integer OCC895(Draw_Interpretor& di, Standard_Integer argc, cons gp_Pnt center1(0, 10, 0); gp_Ax2 axis1 = reverse ? gp_Ax2(center1, gp::DY(), gp::DZ()) : gp_Ax2(center1, -gp::DY(), gp::DX()); - if (Abs(angle) > gp::Resolution()) + if (std::abs(angle) > gp::Resolution()) axis1.Rotate(gp_Ax1(center1, gp::DZ()), angle * M_PI / 180.0); gce_MakeCirc makeCirc1(axis1, rad); diff --git a/src/Draw/TKQADraw/QABugs/QABugs_19.cxx b/src/Draw/TKQADraw/QABugs/QABugs_19.cxx index c729a6d8f2..1c7f5cf8d5 100644 --- a/src/Draw/TKQADraw/QABugs/QABugs_19.cxx +++ b/src/Draw/TKQADraw/QABugs/QABugs_19.cxx @@ -1382,7 +1382,7 @@ static Standard_Integer OCC25004(Draw_Interpretor& theDI, aCurrPnt1.Add(-aCurrPnt2); Standard_Real dist = aCurrPnt1.Norm(); - Standard_Real C = Abs(aFuncValues(idx1) - aFuncValues(idx2)) / dist; + Standard_Real C = std::abs(aFuncValues(idx1) - aFuncValues(idx2)) / dist; if (C > aLipConst) aLipConst = C; } @@ -1757,7 +1757,7 @@ public: NCollection_Array1& theY, Standard_Real theScalar) : ParallelTest_Saxpy(theX, theY, theScalar), - myNbBatches((int)Ceiling((double)theX.Size() / THE_BATCH_SIZE)) + myNbBatches((int)std::ceil((double)theX.Size() / THE_BATCH_SIZE)) { } @@ -1768,7 +1768,7 @@ public: void operator()(int theBatchIndex) const { const int aLower = theBatchIndex * THE_BATCH_SIZE; - const int anUpper = Min(aLower + THE_BATCH_SIZE - 1, myX.Upper()); + const int anUpper = std::min(aLower + THE_BATCH_SIZE - 1, myX.Upper()); for (int i = aLower; i <= anUpper; ++i) { myY(i) = myScalar * myX(i) + myY(i); @@ -2721,7 +2721,8 @@ static Standard_Integer OCC25574(Draw_Interpretor& theDI, aQuat.SetEulerAngles(pairs[i][0], alpha, beta, gamma); aQuat.GetEulerAngles(pairs[i][1], gamma2, beta2, alpha2); - if (Abs(alpha - alpha2) > 1e-5 || Abs(beta - beta2) > 1e-5 || Abs(gamma - gamma2) > 1e-5) + if (std::abs(alpha - alpha2) > 1e-5 || std::abs(beta - beta2) > 1e-5 + || std::abs(gamma - gamma2) > 1e-5) { theDI << "Error: intrinsic and extrinsic conversion incorrect for sequence " << names[i] << "\n"; @@ -2767,7 +2768,7 @@ static Standard_Integer OCC25574(Draw_Interpretor& theDI, { // avoid reporting small coordinates for (int k = 1; k <= 3; k++) - if (Abs(v2.Coord(k)) < Precision::Confusion()) + if (std::abs(v2.Coord(k)) < Precision::Confusion()) v2.SetCoord(k, 0.); isTestOk = Standard_False; @@ -2869,8 +2870,8 @@ static Standard_Integer OCC25574(Draw_Interpretor& theDI, computedGamma); // We expect now to get the same angles as we have used for our rotations - if (Abs(alpha - computedAlpha) > 1e-5 || Abs(beta - computedBeta) > 1e-5 - || Abs(gamma - computedGamma) > 1e-5) + if (std::abs(alpha - computedAlpha) > 1e-5 || std::abs(beta - computedBeta) > 1e-5 + || std::abs(gamma - computedGamma) > 1e-5) { theDI << "Error: unexpected values of Euler angles for YawPitchRoll sequence:\n"; theDI << "alpha: " << alpha / M_PI * 180.0 @@ -2893,7 +2894,8 @@ static Standard_Integer OCC25574(Draw_Interpretor& theDI, // gp_Intrinsic_ZYX and gp_Extrinsic_XYZ should produce the same values of angles but in // opposite order - if (Abs(alpha - gamma2) > 1e-5 || Abs(beta - beta2) > 1e-5 || Abs(gamma - alpha2) > 1e-5) + if (std::abs(alpha - gamma2) > 1e-5 || std::abs(beta - beta2) > 1e-5 + || std::abs(gamma - alpha2) > 1e-5) { theDI << "Error: Euler angles computed for gp_Intrinsic_ZYX and gp_Extrinsic_XYZ do not match:\n"; @@ -3758,7 +3760,7 @@ static Standard_Integer OCC26396(Draw_Interpretor& theDI, break; } for (size_t j = 0; j < coords.size(); j++) - if (Abs(ref_coords[j] - coords[j]) > RealEpsilon()) + if (std::abs(ref_coords[j] - coords[j]) > RealEpsilon()) { Stat = Standard_False; break; @@ -3892,7 +3894,7 @@ static Standard_Integer OCC26746(Draw_Interpretor& theDI, aDelta += anArrCoeffs(i++) * aZ1; // 34 aDelta += anArrCoeffs(i++); // 35 - if (Abs(aDelta) > aToler) + if (std::abs(aDelta) > aToler) { theDI << "(" << aUpar << ", " << aVpar << "): Error in torus coefficients computation (Delta = " << aDelta << ").\n"; diff --git a/src/Draw/TKQADraw/QABugs/QABugs_20.cxx b/src/Draw/TKQADraw/QABugs/QABugs_20.cxx index 57dce3f526..14ec451a98 100644 --- a/src/Draw/TKQADraw/QABugs/QABugs_20.cxx +++ b/src/Draw/TKQADraw/QABugs/QABugs_20.cxx @@ -2193,19 +2193,19 @@ static void OCC26747_CheckParabola(Draw_Interpretor& theDI, theDI << "A = " << aF[0] << ", B = " << aF[1] << ", C = " << aF[2] << ", D = " << aF[3] << ", E = " << aF[4] << ", F = " << aF[5] << "\n"; - if (Abs(aPrb.Value()->Parab2d().Focal() - Parab2d_Bug26747::FocalLength) > aCompareTol) + if (std::abs(aPrb.Value()->Parab2d().Focal() - Parab2d_Bug26747::FocalLength) > aCompareTol) theDI << "Error in focal length computation!\n"; - if ((Abs(aVert.X() - Parab2d_Bug26747::VertX) > aCompareTol) - || (Abs(aVert.Y() - Parab2d_Bug26747::VertY) > aCompareTol)) + if ((std::abs(aVert.X() - Parab2d_Bug26747::VertX) > aCompareTol) + || (std::abs(aVert.Y() - Parab2d_Bug26747::VertY) > aCompareTol)) theDI << "Error in vertex computation!\n"; - if (Abs(aPrb.Value()->Parab2d().Parameter() - Parab2d_Bug26747::Parameter) > aCompareTol) + if (std::abs(aPrb.Value()->Parab2d().Parameter() - Parab2d_Bug26747::Parameter) > aCompareTol) theDI << "Error in parameter computation!\n"; for (int i = 0; i < 6; i++) { - if (Abs(aF[i] - Parab2d_Bug26747::Coeffs[i]) > aCompareTol) + if (std::abs(aF[i] - Parab2d_Bug26747::Coeffs[i]) > aCompareTol) { theDI << "Error in " << i << "-th coefficient computation!\n"; } @@ -3574,7 +3574,7 @@ static Standard_Integer OCC30435(Draw_Interpretor& di, Standard_Integer, const c for (i = 1; i <= NbCurves; i++) { anAppro.Error(i, tol3d, tol2d); - tolreached = Max(tolreached, tol3d); + tolreached = std::max(tolreached, tol3d); AppParCurves_MultiCurve MC = anAppro.Value(i); TColgp_Array1OfPnt Poles(1, MC.Degree() + 1); MC.Curve(1, Poles); @@ -3735,7 +3735,8 @@ static Standard_Integer OCC30880(Draw_Interpretor& theDI, if (anExtCF.IsParallel()) { - theDI << "Infinite number of solutions, distance - " << Sqrt(anExtCF.SquareDistance(1)) << "\n"; + theDI << "Infinite number of solutions, distance - " << std::sqrt(anExtCF.SquareDistance(1)) + << "\n"; return 0; } @@ -3758,7 +3759,7 @@ static Standard_Integer OCC30880(Draw_Interpretor& theDI, return 0; } - theDI << "Minimal distance - " << Sqrt(aDistMin) << "\n"; + theDI << "Minimal distance - " << std::sqrt(aDistMin) << "\n"; return 0; } diff --git a/src/Draw/TKTopTest/BRepTest/BRepTest_BasicCommands.cxx b/src/Draw/TKTopTest/BRepTest/BRepTest_BasicCommands.cxx index 8f89fda76a..18dfc7b74d 100644 --- a/src/Draw/TKTopTest/BRepTest/BRepTest_BasicCommands.cxx +++ b/src/Draw/TKTopTest/BRepTest/BRepTest_BasicCommands.cxx @@ -1203,15 +1203,15 @@ static Standard_Integer vecdc(Draw_Interpretor& di, Standard_Integer, const char P2.SetCoord((Standard_Real)X / z, (Standard_Real)Y / z, 0.0); P2.Transform(T); Standard_Real xa, ya, za; - if (Abs(P1.X()) > Abs(P2.X())) + if (std::abs(P1.X()) > std::abs(P2.X())) xa = P1.X(); else xa = P2.X(); - if (Abs(P1.Y()) > Abs(P2.Y())) + if (std::abs(P1.Y()) > std::abs(P2.Y())) ya = P1.Y(); else ya = P2.Y(); - if (Abs(P1.Z()) > Abs(P2.Z())) + if (std::abs(P1.Z()) > std::abs(P2.Z())) za = P1.Z(); else za = P2.Z(); @@ -1234,15 +1234,15 @@ static Standard_Integer vecdc(Draw_Interpretor& di, Standard_Integer, const char z = dout.Zoom(id); PP2.SetCoord((Standard_Real)X / z, (Standard_Real)Y / z, 0.0); PP2.Transform(T); - if (Abs(PP1.X()) > Abs(PP2.X())) + if (std::abs(PP1.X()) > std::abs(PP2.X())) xa = PP1.X(); else xa = PP2.X(); - if (Abs(PP1.Y()) > Abs(PP2.Y())) + if (std::abs(PP1.Y()) > std::abs(PP2.Y())) ya = PP1.Y(); else ya = PP2.Y(); - if (Abs(PP1.Z()) > Abs(PP2.Z())) + if (std::abs(PP1.Z()) > std::abs(PP2.Z())) za = PP1.Z(); else za = PP2.Z(); @@ -1256,17 +1256,18 @@ static Standard_Integer vecdc(Draw_Interpretor& di, Standard_Integer, const char static Standard_Integer nboxvecdp = 0; // std::cout<<"\nbox b"<<++nboxvecdp<<" "< arg) { - Tol = Max(Draw::Atof(a[arg++]), 1.e-10); + Tol = std::max(Draw::Atof(a[arg++]), 1.e-10); } if (n > arg) @@ -1348,7 +1349,7 @@ static Standard_Integer nproject(Draw_Interpretor& di, Standard_Integer n, const if (n > arg) MaxSeg = Draw::Atoi(a[arg]); - Tol2d = Pow(Tol, 2. / 3); + Tol2d = std::pow(Tol, 2. / 3); OrtProj.SetParams(Tol, Tol2d, Continuity, MaxDeg, MaxSeg); OrtProj.Build(); diff --git a/src/Draw/TKTopTest/BRepTest/BRepTest_CheckCommands.cxx b/src/Draw/TKTopTest/BRepTest/BRepTest_CheckCommands.cxx index 216a391c22..6b2aecceb3 100644 --- a/src/Draw/TKTopTest/BRepTest/BRepTest_CheckCommands.cxx +++ b/src/Draw/TKTopTest/BRepTest/BRepTest_CheckCommands.cxx @@ -1166,10 +1166,10 @@ static Standard_Integer shapeG1continuity(Draw_Interpretor& di, Standard_Integer pard1 = curv1->FirstParameter(); parf1 = curv1->LastParameter(); Standard_Real MaxG0Value = 0, MaxG1Angle = 0; - U = Min(pard1, parf1); - Uf = Max(pard1, parf1); + U = std::min(pard1, parf1); + Uf = std::max(pard1, parf1); - deltaU = Abs(parf1 - pard1) / nbeval; + deltaU = std::abs(parf1 - pard1) / nbeval; do { @@ -1362,10 +1362,10 @@ static Standard_Integer shapeG0continuity(Draw_Interpretor& di, Standard_Integer pard1 = curv1->FirstParameter(); parf1 = curv1->LastParameter(); Standard_Real MaxG0Value = 0; - U = Min(pard1, parf1); - Uf = Max(pard1, parf1); + U = std::min(pard1, parf1); + Uf = std::max(pard1, parf1); - deltaU = Abs(parf1 - pard1) / nbeval; + deltaU = std::abs(parf1 - pard1) / nbeval; ISG0 = Standard_True; do { @@ -1560,10 +1560,10 @@ static Standard_Integer shapeG2continuity(Draw_Interpretor& di, Standard_Integer Standard_Boolean isdone = Standard_True; pard1 = curv1->FirstParameter(); parf1 = curv1->LastParameter(); - U = Min(pard1, parf1); - Uf = Max(pard1, parf1); + U = std::min(pard1, parf1); + Uf = std::max(pard1, parf1); - deltaU = Abs(parf1 - pard1) / nbeval; + deltaU = std::abs(parf1 - pard1) / nbeval; do { diff --git a/src/Draw/TKTopTest/BRepTest/BRepTest_CurveCommands.cxx b/src/Draw/TKTopTest/BRepTest/BRepTest_CurveCommands.cxx index b569dc31bf..7124b5d4bd 100644 --- a/src/Draw/TKTopTest/BRepTest/BRepTest_CurveCommands.cxx +++ b/src/Draw/TKTopTest/BRepTest/BRepTest_CurveCommands.cxx @@ -560,13 +560,13 @@ static Standard_Integer isoedge(Draw_Interpretor&, Standard_Integer n, const cha BRepTools::UVBounds(TopoDS::Face(Sh), UMin, UMax, VMin, VMax); if (uiso) { - VMin = Min(VMin, Min(p1, p2)); - VMax = Max(VMax, Max(p1, p2)); + VMin = std::min(VMin, std::min(p1, p2)); + VMax = std::max(VMax, std::max(p1, p2)); } else { - UMin = Min(UMin, Min(p1, p2)); - UMax = Max(VMax, Max(p1, p2)); + UMin = std::min(UMin, std::min(p1, p2)); + UMax = std::max(VMax, std::max(p1, p2)); } Handle(Geom_RectangularTrimmedSurface) TS = @@ -843,7 +843,7 @@ static Standard_Integer profile(Draw_Interpretor& di, Standard_Integer n, const vx -= x; vy -= y; } - length = Sqrt(vx * vx + vy * vy); + length = std::sqrt(vx * vx + vy * vy); if (length > Precision::Confusion()) { move = line; @@ -861,13 +861,13 @@ static Standard_Integer profile(Draw_Interpretor& di, Standard_Integer n, const angle = Draw::Atof(a[i]) * (M_PI / 180.0); if ((a[i - 1][1] == 'R') || (a[i - 1][1] == 'r')) { - dx = Cos(angle); - dy = Sin(angle); + dx = std::cos(angle); + dy = std::sin(angle); } else { - Standard_Real c = Cos(angle); - Standard_Real s = Sin(angle); + Standard_Real c = std::cos(angle); + Standard_Real s = std::sin(angle); Standard_Real t = c * dx - s * dy; dy = s * dx + c * dy; dx = t; @@ -882,7 +882,7 @@ static Standard_Integer profile(Draw_Interpretor& di, Standard_Integer n, const { Standard_Real vx = Draw::Atof(a[i - 1]); Standard_Real vy = Draw::Atof(a[i]); - length = Sqrt(vx * vx + vy * vy); + length = std::sqrt(vx * vx + vy * vy); if (length > Precision::Confusion()) { // move = line; DUB @@ -898,7 +898,7 @@ static Standard_Integer profile(Draw_Interpretor& di, Standard_Integer n, const if (i >= n) goto badargs; radius = Draw::Atof(a[i - 1]); - if (Abs(radius) > Precision::Confusion()) + if (std::abs(radius) > Precision::Confusion()) { angle = Draw::Atof(a[i]) * (M_PI / 180.0); move = circle; @@ -913,7 +913,7 @@ static Standard_Integer profile(Draw_Interpretor& di, Standard_Integer n, const length = Draw::Atof(a[i]); if ((a[i - 1][1] == 'X') || (a[i - 1][1] == 'x')) { - if (Abs(dx) < Precision::Confusion()) + if (std::abs(dx) < Precision::Confusion()) { di << "Profile : cannot intersect, arg " << i - 1; return 1; @@ -923,7 +923,7 @@ static Standard_Integer profile(Draw_Interpretor& di, Standard_Integer n, const } else if ((a[i - 1][1] == 'Y') || (a[i - 1][1] == 'y')) { - if (Abs(dy) < Precision::Confusion()) + if (std::abs(dy) < Precision::Confusion()) { di << "Profile : cannot intersect, arg " << i - 1; return 1; @@ -1016,7 +1016,7 @@ static Standard_Integer profile(Draw_Interpretor& di, Standard_Integer n, const // the closing segment dx = x0 - x; dy = y0 - y; - length = Sqrt(dx * dx + dy * dy); + length = std::sqrt(dx * dx + dy * dy); if (length > Precision::Confusion()) { move = line; @@ -1463,7 +1463,7 @@ static Standard_Integer profile2d(Draw_Interpretor& di, Standard_Integer n, cons vx -= x; vy -= y; } - length = Sqrt(vx * vx + vy * vy); + length = std::sqrt(vx * vx + vy * vy); if (length > Precision::Confusion()) { move = line; @@ -1481,13 +1481,13 @@ static Standard_Integer profile2d(Draw_Interpretor& di, Standard_Integer n, cons angle = Draw::Atof(a[i]) * (M_PI / 180.0); if ((a[i - 1][1] == 'R') || (a[i - 1][1] == 'r')) { - dx = Cos(angle); - dy = Sin(angle); + dx = std::cos(angle); + dy = std::sin(angle); } else { - Standard_Real c = Cos(angle); - Standard_Real s = Sin(angle); + Standard_Real c = std::cos(angle); + Standard_Real s = std::sin(angle); Standard_Real t = c * dx - s * dy; dy = s * dx + c * dy; dx = t; @@ -1502,7 +1502,7 @@ static Standard_Integer profile2d(Draw_Interpretor& di, Standard_Integer n, cons { Standard_Real vx = Draw::Atof(a[i - 1]); Standard_Real vy = Draw::Atof(a[i]); - length = Sqrt(vx * vx + vy * vy); + length = std::sqrt(vx * vx + vy * vy); if (length > Precision::Confusion()) { // move = line; DUB @@ -1518,7 +1518,7 @@ static Standard_Integer profile2d(Draw_Interpretor& di, Standard_Integer n, cons if (i >= n) goto badargs; radius = Draw::Atof(a[i - 1]); - if (Abs(radius) > Precision::Confusion()) + if (std::abs(radius) > Precision::Confusion()) { angle = Draw::Atof(a[i]) * (M_PI / 180.0); move = circle; @@ -1533,7 +1533,7 @@ static Standard_Integer profile2d(Draw_Interpretor& di, Standard_Integer n, cons length = Draw::Atof(a[i]); if ((a[i - 1][1] == 'X') || (a[i - 1][1] == 'x')) { - if (Abs(dx) < Precision::Confusion()) + if (std::abs(dx) < Precision::Confusion()) { di << "Profile : cannot intersect, arg " << i - 1; return 1; @@ -1543,7 +1543,7 @@ static Standard_Integer profile2d(Draw_Interpretor& di, Standard_Integer n, cons } else if ((a[i - 1][1] == 'Y') || (a[i - 1][1] == 'y')) { - if (Abs(dy) < Precision::Confusion()) + if (std::abs(dy) < Precision::Confusion()) { di << "Profile : cannot intersect, arg " << i - 1; return 1; @@ -1634,7 +1634,7 @@ static Standard_Integer profile2d(Draw_Interpretor& di, Standard_Integer n, cons // the closing segment dx = x0 - x; dy = y0 - y; - length = Sqrt(dx * dx + dy * dy); + length = std::sqrt(dx * dx + dy * dy); if (length > Precision::Confusion()) { move = line; diff --git a/src/Draw/TKTopTest/BRepTest/BRepTest_FeatureCommands.cxx b/src/Draw/TKTopTest/BRepTest/BRepTest_FeatureCommands.cxx index dcb955f6cc..3465940ea3 100644 --- a/src/Draw/TKTopTest/BRepTest/BRepTest_FeatureCommands.cxx +++ b/src/Draw/TKTopTest/BRepTest/BRepTest_FeatureCommands.cxx @@ -2706,7 +2706,7 @@ static Standard_Integer ComputeSimpleOffset(Draw_Interpretor& theCommands, return 0; } const Standard_Real anOffsetValue = Draw::Atof(a[3]); - if (Abs(anOffsetValue) < gp::Resolution()) + if (std::abs(anOffsetValue) < gp::Resolution()) { theCommands << "Null offset value"; return 0; diff --git a/src/Draw/TKTopTest/BRepTest/BRepTest_FilletCommands.cxx b/src/Draw/TKTopTest/BRepTest/BRepTest_FilletCommands.cxx index a097057e99..9495ca4d49 100644 --- a/src/Draw/TKTopTest/BRepTest/BRepTest_FilletCommands.cxx +++ b/src/Draw/TKTopTest/BRepTest/BRepTest_FilletCommands.cxx @@ -92,7 +92,7 @@ static Standard_Integer contblend(Draw_Interpretor& di, Standard_Integer narg, c return 1; if (narg == 3) { - tapp_angle = Abs(Draw::Atof(a[2])); + tapp_angle = std::abs(Draw::Atof(a[2])); } char c = a[1][1]; switch (c) diff --git a/src/Draw/TKTopTest/BRepTest/BRepTest_FillingCommands.cxx b/src/Draw/TKTopTest/BRepTest/BRepTest_FillingCommands.cxx index a120c0e1b4..6cdb91ab06 100644 --- a/src/Draw/TKTopTest/BRepTest/BRepTest_FillingCommands.cxx +++ b/src/Draw/TKTopTest/BRepTest/BRepTest_FillingCommands.cxx @@ -307,7 +307,7 @@ static Standard_Integer gplate(Draw_Interpretor& di, Standard_Integer n, const c S3d.Clear(); Henri.Disc2dContour(4, S2d); Henri.Disc3dContour(4, 0, S3d); - seuil = Max(0.0001, 10 * Henri.G0Error()); + seuil = std::max(0.0001, 10 * Henri.G0Error()); GeomPlate_PlateG0Criterion critere(S2d, S3d, seuil); GeomPlate_MakeApprox Mapp(gpPlate, critere, 0.0001, nbcarreau, degmax); Handle(Geom_Surface) Surf(Mapp.Surface()); @@ -401,7 +401,7 @@ static Standard_Integer approxplate(Draw_Interpretor& di, Standard_Integer n, co { Henri.Disc2dContour(4, S2d); Henri.Disc3dContour(4, 0, S3d); - seuil = Max(Tol3d, dmax * 10); + seuil = std::max(Tol3d, dmax * 10); GeomPlate_PlateG0Criterion Crit0(S2d, S3d, seuil); GeomPlate_MakeApprox MApp(surf, Crit0, Tol3d, Nbmax, degmax); support = MApp.Surface(); @@ -410,7 +410,7 @@ static Standard_Integer approxplate(Draw_Interpretor& di, Standard_Integer n, co { Henri.Disc2dContour(4, S2d); Henri.Disc3dContour(4, 1, S3d); - seuil = Max(Tol3d, anmax * 10); + seuil = std::max(Tol3d, anmax * 10); GeomPlate_PlateG1Criterion Crit1(S2d, S3d, seuil); GeomPlate_MakeApprox MApp(surf, Crit1, Tol3d, Nbmax, degmax); support = MApp.Surface(); diff --git a/src/Draw/TKTopTest/BRepTest/BRepTest_GPropCommands.cxx b/src/Draw/TKTopTest/BRepTest/BRepTest_GPropCommands.cxx index be535d95d5..3874dbdc94 100644 --- a/src/Draw/TKTopTest/BRepTest/BRepTest_GPropCommands.cxx +++ b/src/Draw/TKTopTest/BRepTest/BRepTest_GPropCommands.cxx @@ -87,7 +87,7 @@ Standard_Integer props(Draw_Interpretor& di, Standard_Integer n, const char** a) if (witheps) { - if (Abs(eps) < Precision::Angular()) + if (std::abs(eps) < Precision::Angular()) return 2; if (*a[0] == 'l') BRepGProp::LinearProperties(S, G, SkipShared); diff --git a/src/Draw/TKTopTest/BRepTest/BRepTest_MatCommands.cxx b/src/Draw/TKTopTest/BRepTest/BRepTest_MatCommands.cxx index 84c24fe9f3..798fa0badf 100644 --- a/src/Draw/TKTopTest/BRepTest/BRepTest_MatCommands.cxx +++ b/src/Draw/TKTopTest/BRepTest/BRepTest_MatCommands.cxx @@ -234,8 +234,8 @@ void DrawCurve(const Handle(Geom2d_Curve)& aCurve, const Standard_Integer Indice { gpParabola = Handle(Geom2d_Parabola)::DownCast(curve)->Parab2d(); Focus = gpParabola.Focal(); - Standard_Real Val1 = Sqrt(Limit * Focus); - Standard_Real Val2 = Sqrt(Limit * Limit); + Standard_Real Val1 = std::sqrt(Limit * Focus); + Standard_Real Val2 = std::sqrt(Limit * Limit); delta = (Val1 <= Val2 ? Val1 : Val2); } else if (type == STANDARD_TYPE(Geom2d_Hyperbola)) @@ -245,8 +245,8 @@ void DrawCurve(const Handle(Geom2d_Curve)& aCurve, const Standard_Integer Indice Standard_Real Minr = gpHyperbola.MinorRadius(); Standard_Real Valu1 = Limit / Majr; Standard_Real Valu2 = Limit / Minr; - Standard_Real Val1 = Log(Valu1 + Sqrt(Valu1 * Valu1 - 1)); - Standard_Real Val2 = Log(Valu2 + Sqrt(Valu2 * Valu2 + 1)); + Standard_Real Val1 = std::log(Valu1 + std::sqrt(Valu1 * Valu1 - 1)); + Standard_Real Val2 = std::log(Valu2 + std::sqrt(Valu2 * Valu2 + 1)); delta = (Val1 <= Val2 ? Val1 : Val2); } if (aCurve->FirstParameter() == -Precision::Infinite()) diff --git a/src/Draw/TKTopTest/BRepTest/BRepTest_SweepCommands.cxx b/src/Draw/TKTopTest/BRepTest/BRepTest_SweepCommands.cxx index 88efe88c1d..90b8cb2ab9 100644 --- a/src/Draw/TKTopTest/BRepTest/BRepTest_SweepCommands.cxx +++ b/src/Draw/TKTopTest/BRepTest/BRepTest_SweepCommands.cxx @@ -842,7 +842,8 @@ static Standard_Integer addsweep(Draw_Interpretor& di, Standard_Integer n, const ParAndRad(ii).SetY(Draw::Atof(a[cur + 1])); } thelaw = new (Law_Interpol)(); - thelaw->Set(ParAndRad, Abs(ParAndRad(1).Y() - ParAndRad(L).Y()) < Precision::Confusion()); + thelaw->Set(ParAndRad, + std::abs(ParAndRad(1).Y() - ParAndRad(L).Y()) < Precision::Confusion()); } } } diff --git a/src/Draw/TKTopTest/GeometryTest/GeometryTest_ConstraintCommands.cxx b/src/Draw/TKTopTest/GeometryTest/GeometryTest_ConstraintCommands.cxx index 534c9cf767..acdecfd068 100644 --- a/src/Draw/TKTopTest/GeometryTest/GeometryTest_ConstraintCommands.cxx +++ b/src/Draw/TKTopTest/GeometryTest/GeometryTest_ConstraintCommands.cxx @@ -636,8 +636,8 @@ static Standard_Integer tanginterpol(Draw_Interpretor& di, Standard_Integer n, c Handle(TColgp_HArray1OfPnt) PointsArrayPtr = new TColgp_HArray1OfPnt(1, num_parameters); num_tangents = ((n - num_read) / 3) - num_parameters; - num_tangents = Max(0, num_tangents); - num_tangents = Min(num_parameters, num_tangents); + num_tangents = std::max(0, num_tangents); + num_tangents = std::min(num_parameters, num_tangents); ii = 1; num_start = num_read; num_read += 1; diff --git a/src/Draw/TKTopTest/GeometryTest/GeometryTest_CurveCommands.cxx b/src/Draw/TKTopTest/GeometryTest/GeometryTest_CurveCommands.cxx index 43388b8f36..31bd818337 100644 --- a/src/Draw/TKTopTest/GeometryTest/GeometryTest_CurveCommands.cxx +++ b/src/Draw/TKTopTest/GeometryTest/GeometryTest_CurveCommands.cxx @@ -784,8 +784,8 @@ static Standard_Integer movelaw(Draw_Interpretor& di, Standard_Integer n, const tx = Draw::Atof(a[4]); if (n == 6) { - condition = Max(Draw::Atoi(a[5]), -1); - condition = Min(condition, G2->Degree() - 1); + condition = std::max(Draw::Atoi(a[5]), -1); + condition = std::min(condition, G2->Degree() - 1); } TColgp_Array1OfPnt2d curve_poles(1, G2->NbPoles()); TColStd_Array1OfReal law_poles(1, G2->NbPoles()); @@ -889,22 +889,22 @@ Standard_Real CompLocalDev(const Adaptor3d_Curve& theCurve, Standard_Real d = 0.; Standard_Real d1, d2; - Standard_Real x1 = Max(u1, aT(1) - aSteps(1)); + Standard_Real x1 = std::max(u1, aT(1) - aSteps(1)); Standard_Boolean Ok = aFunc1.Value(x1, d1); if (!Ok) { - return Sqrt(-aValue); + return std::sqrt(-aValue); } - Standard_Real x2 = Min(u2, aT(1) + aSteps(1)); + Standard_Real x2 = std::min(u2, aT(1) + aSteps(1)); Ok = aFunc1.Value(x2, d2); if (!Ok) { - return Sqrt(-aValue); + return std::sqrt(-aValue); } if (!(d1 > aValue && d2 > aValue)) { - Standard_Real dmin = Min(d1, Min(aValue, d2)); - return Sqrt(-dmin); + Standard_Real dmin = std::min(d1, std::min(aValue, d2)); + return std::sqrt(-dmin); } math_BrentMinimum anOptLoc(Precision::PConfusion()); @@ -918,7 +918,7 @@ Standard_Real CompLocalDev(const Adaptor3d_Curve& theCurve, { d = -aValue; } - return Sqrt(d); + return std::sqrt(d); } //================================================================================================= diff --git a/src/Draw/TKTopTest/GeomliteTest/GeomliteTest_ApproxCommands.cxx b/src/Draw/TKTopTest/GeomliteTest/GeomliteTest_ApproxCommands.cxx index 2bd0e25549..49def83be2 100644 --- a/src/Draw/TKTopTest/GeomliteTest/GeomliteTest_ApproxCommands.cxx +++ b/src/Draw/TKTopTest/GeomliteTest/GeomliteTest_ApproxCommands.cxx @@ -367,7 +367,7 @@ static Standard_Integer smoothing(Draw_Interpretor& di, Standard_Integer n, cons if (n == 3) { Tolerance = Draw::Atof(a[2]); - if (Abs(Tolerance) < Precision::Confusion() * 1.e-7) + if (std::abs(Tolerance) < Precision::Confusion() * 1.e-7) { Constraint = AppParCurves_PassPoint; } @@ -382,7 +382,7 @@ static Standard_Integer smoothing(Draw_Interpretor& di, Standard_Integer n, cons { Standard_Integer ific = 3; Tolerance = Draw::Atof(a[2]); - if (Abs(Tolerance) < Precision::Confusion() * 1.e-7) + if (std::abs(Tolerance) < Precision::Confusion() * 1.e-7) { Constraint = AppParCurves_PassPoint; } @@ -447,7 +447,7 @@ static Standard_Integer smoothing(Draw_Interpretor& di, Standard_Integer n, cons Variation.SetContinuity(GeomAbs_C1); Variation.SetMaxDegree(DegMax); } - Variation.SetTolerance(Abs(Tolerance)); + Variation.SetTolerance(std::abs(Tolerance)); if (Tolerance > 0) { Variation.SetWithMinMax(Standard_True); @@ -497,7 +497,7 @@ static Standard_Integer smoothing(Draw_Interpretor& di, Standard_Integer n, cons Variation.SetContinuity(GeomAbs_C1); Variation.SetMaxDegree(DegMax); } - Variation.SetTolerance(Abs(Tolerance)); + Variation.SetTolerance(std::abs(Tolerance)); if (Tolerance > 0) { Variation.SetWithMinMax(Standard_True); @@ -577,7 +577,7 @@ static Standard_Integer smoothingbybezier(Draw_Interpretor& di, Standard_Integer methode = 3; } - if (Abs(Tolerance) < Precision::Confusion() * 1.e-7) + if (std::abs(Tolerance) < Precision::Confusion() * 1.e-7) { Constraint = AppParCurves_PassPoint; } @@ -638,15 +638,15 @@ static Standard_Integer smoothingbybezier(Draw_Interpretor& di, Standard_Integer Standard_Integer NbIteration = 5; if (Degree < 4) - degmin = Max(1, Degree - 1); - degmin = - Max(degmin, - NbConstraint(TABofCC->Value(1).Constraint(), TABofCC->Value(NbPoints).Constraint())); + degmin = std::max(1, Degree - 1); + degmin = std::max( + degmin, + NbConstraint(TABofCC->Value(1).Constraint(), TABofCC->Value(NbPoints).Constraint())); AppDef_Compute Appr(degmin, Degree, - Abs(Tolerance), - Abs(Tolerance), + std::abs(Tolerance), + std::abs(Tolerance), NbIteration, Standard_False, Approx_ChordLength, @@ -670,7 +670,7 @@ static Standard_Integer smoothingbybezier(Draw_Interpretor& di, Standard_Integer else { AppDef_Variational Varia(AML, 1, NbPoints, TABofCC, Degree, 1); - Varia.SetTolerance(Abs(Tolerance)); + Varia.SetTolerance(std::abs(Tolerance)); Varia.Approximate(); if (!Varia.IsDone()) @@ -720,15 +720,15 @@ static Standard_Integer smoothingbybezier(Draw_Interpretor& di, Standard_Integer Standard_Integer degmin = 4; Standard_Integer NbIteration = 5; if (Degree < 4) - degmin = Max(1, Degree - 1); - degmin = - Max(degmin, - NbConstraint(TABofCC->Value(1).Constraint(), TABofCC->Value(NbPoints).Constraint())); + degmin = std::max(1, Degree - 1); + degmin = std::max( + degmin, + NbConstraint(TABofCC->Value(1).Constraint(), TABofCC->Value(NbPoints).Constraint())); AppDef_Compute Appr(degmin, Degree, - Abs(Tolerance), - Abs(Tolerance), + std::abs(Tolerance), + std::abs(Tolerance), NbIteration, Standard_False, Approx_ChordLength, @@ -753,7 +753,7 @@ static Standard_Integer smoothingbybezier(Draw_Interpretor& di, Standard_Integer { AppDef_Variational Varia(AML, 1, NbPoints, TABofCC, Degree, 1); - Varia.SetTolerance(Abs(Tolerance)); + Varia.SetTolerance(std::abs(Tolerance)); Varia.Approximate(); if (!Varia.IsDone()) { diff --git a/src/Draw/TKTopTest/GeomliteTest/GeomliteTest_CurveCommands.cxx b/src/Draw/TKTopTest/GeomliteTest/GeomliteTest_CurveCommands.cxx index ea4a0d2e02..f86cbab43b 100644 --- a/src/Draw/TKTopTest/GeomliteTest/GeomliteTest_CurveCommands.cxx +++ b/src/Draw/TKTopTest/GeomliteTest/GeomliteTest_CurveCommands.cxx @@ -587,8 +587,8 @@ static Standard_Integer cmovetangent(Draw_Interpretor& di, Standard_Integer n, c tz = Draw::Atof(a[8]); if (n == 10) { - condition = Max(Draw::Atoi(a[9]), -1); - condition = Min(condition, G2->Degree() - 1); + condition = std::max(Draw::Atoi(a[9]), -1); + condition = std::min(condition, G2->Degree() - 1); } gp_Pnt p; gp_Vec tangent; @@ -617,8 +617,8 @@ static Standard_Integer cmovetangent(Draw_Interpretor& di, Standard_Integer n, c ty = Draw::Atof(a[6]); if (n == 8) { - condition = Max(Draw::Atoi(a[7]), -1); - condition = Min(condition, G2->Degree() - 1); + condition = std::max(Draw::Atoi(a[7]), -1); + condition = std::min(condition, G2->Degree() - 1); } gp_Pnt2d p; gp_Vec2d tangent; @@ -1390,9 +1390,9 @@ static Standard_Integer localprop(Draw_Interpretor& di, Standard_Integer argc, c Standard_Real K = Prop.Curvature(); di << " Curvature : " << K << "\n"; - if (Abs(K) > Precision::Confusion()) + if (std::abs(K) > Precision::Confusion()) { - Standard_Real R = 1 / Abs(K); + Standard_Real R = 1 / std::abs(K); gp_Pnt Center; Prop.CentreOfCurvature(Center); gp_Dir Tang; @@ -1424,9 +1424,9 @@ static Standard_Integer localprop(Draw_Interpretor& di, Standard_Integer argc, c di << " Curvature : " << K << "\n"; - if (Abs(K) > Precision::Confusion()) + if (std::abs(K) > Precision::Confusion()) { - Standard_Real R = 1 / Abs(K); + Standard_Real R = 1 / std::abs(K); Prop.CentreOfCurvature(Center); gp_Ax2d Axe(Center, gp::DX2d()); Handle(Geom2d_Circle) Cir2d = new Geom2d_Circle(Axe, R); @@ -1517,7 +1517,7 @@ static Standard_Integer approxcurveonsurf(Draw_Interpretor& di, Standard_Integer return 1; if (n > 4) - Tol = Max(Draw::Atof(a[4]), 1.e-10); + Tol = std::max(Draw::Atof(a[4]), 1.e-10); if (n > 5) { @@ -1646,7 +1646,7 @@ static Standard_Integer approxcurve(Draw_Interpretor& di, Standard_Integer n, co } if (n > shift) - Tol = Max(Draw::Atof(a[shift]), 1.e-10); + Tol = std::max(Draw::Atof(a[shift]), 1.e-10); if (n > shift + 1) { @@ -1808,7 +1808,7 @@ static Standard_Integer fitcurve(Draw_Interpretor& di, Standard_Integer n, const for (i = 1; i <= NbCurves; i++) { anAppro.Error(i, tol3d, tol2d); - tolreached = Max(tolreached, tol3d); + tolreached = std::max(tolreached, tol3d); AppParCurves_MultiCurve MC = anAppro.Value(i); TColgp_Array1OfPnt Poles(1, MC.Degree() + 1); MC.Curve(1, Poles); diff --git a/src/Draw/TKTopTest/GeomliteTest/GeomliteTest_SurfaceCommands.cxx b/src/Draw/TKTopTest/GeomliteTest/GeomliteTest_SurfaceCommands.cxx index 3c07436fa2..4e0bdbd522 100644 --- a/src/Draw/TKTopTest/GeomliteTest/GeomliteTest_SurfaceCommands.cxx +++ b/src/Draw/TKTopTest/GeomliteTest/GeomliteTest_SurfaceCommands.cxx @@ -100,7 +100,7 @@ static Standard_Integer surface_radius(Draw_Interpretor& di, Standard_Integer n, if (report_curvature) Draw::Set(a[4], radius); - if (Abs(radius) > tolerance) + if (std::abs(radius) > tolerance) { radius = 1.0e0 / radius; di << "Min Radius of Curvature : " << radius << "\n"; @@ -113,7 +113,7 @@ static Standard_Integer surface_radius(Draw_Interpretor& di, Standard_Integer n, radius = myProperties.MaxCurvature(); if (report_curvature) Draw::Set(a[5], radius); - if (Abs(radius) > tolerance) + if (std::abs(radius) > tolerance) { radius = 1.0e0 / radius; di << "Max Radius of Curvature : " << radius << "\n"; @@ -893,7 +893,7 @@ static Standard_Integer approxsurf(Draw_Interpretor& di, Standard_Integer n, con return 1; if (n > 3) - Tol = Max(Draw::Atof(a[3]), 1.e-10); + Tol = std::max(Draw::Atof(a[3]), 1.e-10); if (n == 5) return 1; @@ -1644,11 +1644,11 @@ static Standard_Integer compBsplSur(Draw_Interpretor&, Standard_Integer n, const Standard_Real aU21, aU22, aV21, aV22; GBs2->Bounds(aU21, aU22, aV21, aV22); - Standard_Real aUmin = Max(aU11, aU21); - Standard_Real aUmax = Min(aU12, aU22); + Standard_Real aUmin = std::max(aU11, aU21); + Standard_Real aUmax = std::min(aU12, aU22); - Standard_Real aVmin = Max(aV11, aV21); - Standard_Real aVmax = Min(aV12, aV22); + Standard_Real aVmin = std::max(aV11, aV21); + Standard_Real aVmax = std::min(aV12, aV22); Standard_Integer nbP = 100; Standard_Real aStepU = (aUmax - aUmin) / nbP; diff --git a/src/Draw/TKTopTest/MeshTest/MeshTest.cxx b/src/Draw/TKTopTest/MeshTest/MeshTest.cxx index 9e15db89ea..ac5a5538f2 100644 --- a/src/Draw/TKTopTest/MeshTest/MeshTest.cxx +++ b/src/Draw/TKTopTest/MeshTest/MeshTest.cxx @@ -60,7 +60,7 @@ Standard_IMPORT Draw_Viewer dout; #endif -#define MAX2(X, Y) (Abs(X) > Abs(Y) ? Abs(X) : Abs(Y)) +#define MAX2(X, Y) (std::abs(X) > std::abs(Y) ? std::abs(X) : std::abs(Y)) #define MAX3(X, Y, Z) (MAX2(MAX2(X, Y), Z)) #define ONETHIRD 0.333333333333333333333333333333333333333333333333333333333333 @@ -207,7 +207,7 @@ static Standard_Integer incrementalmesh(Draw_Interpretor& theDI, } else if (aNameCase.IsRealValue(true) && !hasDefl) { - aMeshParams.Deflection = Max(Draw::Atof(theArgVec[anArgIter]), Precision::Confusion()); + aMeshParams.Deflection = std::max(Draw::Atof(theArgVec[anArgIter]), Precision::Confusion()); if (aMeshParams.DeflectionInterior < Precision::Confusion()) { aMeshParams.DeflectionInterior = aMeshParams.Deflection; @@ -449,7 +449,7 @@ static Standard_Integer tessellate(Draw_Interpretor& /*di*/, Handle(Geom2d_Curve) aC = BRep_Tool::CurveOnSurface(anEdge, aFace, aFirst, aLast); gp_Pnt2d aPFirst = aC->Value(aFirst); gp_Pnt2d aPLast = aC->Value(aLast); - if (Abs(aPFirst.X() - aPLast.X()) < 0.1 * (aUMax - aUMin)) // U=const + if (std::abs(aPFirst.X() - aPLast.X()) < 0.1 * (aUMax - aUMin)) // U=const { if (BRep_Tool::IsClosed(anEdge, aFace)) B.UpdateEdge(anEdge, aUMinPoly, aUMaxPoly, aTriangulation); @@ -767,12 +767,12 @@ static Standard_Integer trianglesinfo(Draw_Interpretor& theDI, { aNbTriangles += aTriangulation->NbTriangles(); aNbNodes += aTriangulation->NbNodes(); - aMaxDeflection = Max(aMaxDeflection, aTriangulation->Deflection()); + aMaxDeflection = std::max(aMaxDeflection, aTriangulation->Deflection()); if (!aTriangulation->Parameters().IsNull()) { - aMeshingDefl = Max(aMeshingDefl, aTriangulation->Parameters()->Deflection()); - aMeshingAngDefl = Max(aMeshingAngDefl, aTriangulation->Parameters()->Angle()); - aMeshingMinSize = Max(aMeshingMinSize, aTriangulation->Parameters()->MinSize()); + aMeshingDefl = std::max(aMeshingDefl, aTriangulation->Parameters()->Deflection()); + aMeshingAngDefl = std::max(aMeshingAngDefl, aTriangulation->Parameters()->Angle()); + aMeshingMinSize = std::max(aMeshingMinSize, aTriangulation->Parameters()->MinSize()); } } else @@ -1156,45 +1156,45 @@ static Standard_Integer veriftriangles(Draw_Interpretor& di, Standard_Integer n, S->D0(mi2d1.X(), mi2d1.Y(), PP); PP = PP.Transformed(L.Transformation()); - defle = Abs((equa * PP.XYZ()) - dipo); - deflemax = Max(deflemax, defle); - deflemin = Min(deflemin, defle); + defle = std::abs((equa * PP.XYZ()) - dipo); + deflemax = std::max(deflemax, defle); + deflemin = std::min(deflemin, defle); S->D0(mi2d2.X(), mi2d2.Y(), PP); PP = PP.Transformed(L.Transformation()); - defle = Abs((equa * PP.XYZ()) - dipo); - deflemax = Max(deflemax, defle); - deflemin = Min(deflemin, defle); + defle = std::abs((equa * PP.XYZ()) - dipo); + deflemax = std::max(deflemax, defle); + deflemin = std::min(deflemin, defle); S->D0(mi2d3.X(), mi2d3.Y(), PP); PP = PP.Transformed(L.Transformation()); - defle = Abs((equa * PP.XYZ()) - dipo); - deflemax = Max(deflemax, defle); - deflemin = Min(deflemin, defle); + defle = std::abs((equa * PP.XYZ()) - dipo); + deflemax = std::max(deflemax, defle); + deflemin = std::min(deflemin, defle); S->D0(v1.X(), v1.Y(), PP); PP = PP.Transformed(L.Transformation()); - defle = Abs((equa * PP.XYZ()) - dipo); - deflemax = Max(deflemax, defle); - deflemin = Min(deflemin, defle); + defle = std::abs((equa * PP.XYZ()) - dipo); + deflemax = std::max(deflemax, defle); + deflemin = std::min(deflemin, defle); S->D0(v2.X(), v2.Y(), PP); PP = PP.Transformed(L.Transformation()); - defle = Abs((equa * PP.XYZ()) - dipo); - deflemax = Max(deflemax, defle); - deflemin = Min(deflemin, defle); + defle = std::abs((equa * PP.XYZ()) - dipo); + deflemax = std::max(deflemax, defle); + deflemin = std::min(deflemin, defle); S->D0(v3.X(), v3.Y(), PP); PP = PP.Transformed(L.Transformation()); - defle = Abs((equa * PP.XYZ()) - dipo); - deflemax = Max(deflemax, defle); - deflemin = Min(deflemin, defle); + defle = std::abs((equa * PP.XYZ()) - dipo); + deflemax = std::max(deflemax, defle); + deflemin = std::min(deflemin, defle); S->D0(mitri.X(), mitri.Y(), PP); PP = PP.Transformed(L.Transformation()); - defle = Abs((equa * PP.XYZ()) - dipo); - deflemax = Max(deflemax, defle); - deflemin = Min(deflemin, defle); + defle = std::abs((equa * PP.XYZ()) - dipo); + deflemax = std::max(deflemax, defle); + deflemin = std::min(deflemin, defle); if (defle > defstock) { diff --git a/src/Draw/TKTopTest/MeshTest/MeshTest_CheckTopology.cxx b/src/Draw/TKTopTest/MeshTest/MeshTest_CheckTopology.cxx index 5f86eccb75..5d306fec46 100644 --- a/src/Draw/TKTopTest/MeshTest/MeshTest_CheckTopology.cxx +++ b/src/Draw/TKTopTest/MeshTest/MeshTest_CheckTopology.cxx @@ -43,7 +43,7 @@ static Standard_Real ComputeArea(const gp_XYZ& theP1, const gp_XYZ& theP2, const //======================================================================= static Standard_Real ComputeArea(const gp_XY& theP1, const gp_XY& theP2, const gp_XY& theP3) { - return 0.5 * Abs((theP3 - theP1).Crossed(theP2 - theP1)); + return 0.5 * std::abs((theP3 - theP1).Crossed(theP2 - theP1)); } //================================================================================================= @@ -125,7 +125,7 @@ void MeshTest_CheckTopology::Perform(Draw_Interpretor& di) myErrors.Append(i1); myErrors.Append(iF2); myErrors.Append(i2); - myErrorsVal.Append(Sqrt(aSqDist)); + myErrorsVal.Append(std::sqrt(aSqDist)); } } } diff --git a/src/Draw/TKTopTest/SWDRAW/SWDRAW_ShapeAnalysis.cxx b/src/Draw/TKTopTest/SWDRAW/SWDRAW_ShapeAnalysis.cxx index f631cdff25..564a2dc167 100644 --- a/src/Draw/TKTopTest/SWDRAW/SWDRAW_ShapeAnalysis.cxx +++ b/src/Draw/TKTopTest/SWDRAW/SWDRAW_ShapeAnalysis.cxx @@ -230,8 +230,8 @@ static Standard_Integer projface(Draw_Interpretor& di, Standard_Integer argc, co vf = -1000; if (Precision::IsInfinite(vl)) vl = 1000; - Standard_Real du = Abs(ul - uf) / 10; - Standard_Real dv = Abs(vl - vf) / 10; + Standard_Real du = std::abs(ul - uf) / 10; + Standard_Real dv = std::abs(vl - vf) / 10; GeomAPI_ProjectPointOnSurf proj(P3D, thesurf, uf - du, ul + du, vf - dv, vl + dv); Standard_Integer sol, nPSurf = proj.NbPoints(); @@ -527,19 +527,19 @@ static Standard_Integer anaface(Draw_Interpretor& di, Standard_Integer argc, con surface->D0(fuv.X(), fuv.Y(), fxyz); surface->D0(luv.X(), luv.Y(), lxyz); df3d = fp.Distance(fxyz); - maxp3d = Max(maxp3d, df3d); + maxp3d = std::max(maxp3d, df3d); dl3d = lp.Distance(lxyz); - maxp3d = Max(maxp3d, dl3d); + maxp3d = std::max(maxp3d, dl3d); if (nbe > 1) { duv = finuv.Distance(fuv); - maxuv = Max(maxuv, duv); + maxuv = std::max(maxuv, duv); } // et les min-max - u1 = Min(fuv.X(), luv.X()); - u2 = Max(fuv.X(), luv.X()); - v1 = Min(fuv.Y(), luv.Y()); - v2 = Max(fuv.Y(), luv.Y()); + u1 = std::min(fuv.X(), luv.X()); + u2 = std::max(fuv.X(), luv.X()); + v1 = std::min(fuv.Y(), luv.Y()); + v2 = std::max(fuv.Y(), luv.Y()); if (nbe == 1) { umin = u1; @@ -549,10 +549,10 @@ static Standard_Integer anaface(Draw_Interpretor& di, Standard_Integer argc, con } else { - umin = Min(umin, u1); - umax = Max(umax, u2); - vmin = Min(vmin, v1); - vmax = Max(vmax, v2); + umin = std::min(umin, u1); + umax = std::max(umax, u2); + vmin = std::min(vmin, v1); + vmax = std::max(vmax, v2); } // et la classification directe if (nbe == 1) @@ -577,9 +577,9 @@ static Standard_Integer anaface(Draw_Interpretor& di, Standard_Integer argc, con else { duv = finuv.Distance(fuv); - maxuv = Max(maxuv, duv); + maxuv = std::max(maxuv, duv); dvtx = fin.Distance(fxyz); - maxvtx = Max(maxvtx, dvtx); + maxvtx = std::max(maxvtx, dvtx); di << " Fin(" << nbe - 1 << ")-Debut(" << nbe << "): DISTANCE=" << dvtx; if (ia2d) di << " DeltaUV=" << duv; @@ -596,11 +596,11 @@ static Standard_Integer anaface(Draw_Interpretor& di, Standard_Integer argc, con << "\n UV=" << luv.X() << " , " << luv.Y() << " -- D.UV/3D=" << dl3d << "\n"; } dvtx = fin.Distance(debut); - maxvtx = Max(maxvtx, dvtx); + maxvtx = std::max(maxvtx, dvtx); if (iaw2d) { duv = finuv.Distance(debuv); - maxuv = Max(maxuv, duv); + maxuv = std::max(maxuv, duv); } di << " Fin(" << nbe << ")-Debut(1): DISTANCE=" << dvtx; if (iaw2d) diff --git a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_EventManager.cxx b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_EventManager.cxx index 118170e7f9..4f19ba1256 100644 --- a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_EventManager.cxx +++ b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_EventManager.cxx @@ -603,7 +603,7 @@ void ViewerTest_EventManager::ProcessKeyPress(Aspect_VKey theKey) : myWalkSpeedRelative * 2.0f; if (aNewSpeed >= 0.00001f && aNewSpeed <= 10.0f) { - if (Abs(aNewSpeed - 0.1f) < 0.001f) + if (std::abs(aNewSpeed - 0.1f) < 0.001f) { aNewSpeed = 0.1f; } diff --git a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ObjectCommands.cxx b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ObjectCommands.cxx index 4f031a991c..7212119dd0 100644 --- a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ObjectCommands.cxx +++ b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ObjectCommands.cxx @@ -1278,25 +1278,25 @@ static Standard_Integer VPlaneBuilder(Draw_Interpretor& /*di*/, Handle(Geom_CartesianPoint)::DownCast(anAISPointC->Component()); // Verification that the three points are different - if (Abs(aCartPointB->X() - aCartPointA->X()) <= Precision::Confusion() - && Abs(aCartPointB->Y() - aCartPointA->Y()) <= Precision::Confusion() - && Abs(aCartPointB->Z() - aCartPointA->Z()) <= Precision::Confusion()) + if (std::abs(aCartPointB->X() - aCartPointA->X()) <= Precision::Confusion() + && std::abs(aCartPointB->Y() - aCartPointA->Y()) <= Precision::Confusion() + && std::abs(aCartPointB->Z() - aCartPointA->Z()) <= Precision::Confusion()) { // B=A Message::SendFail("Error: same points"); return 1; } - if (Abs(aCartPointC->X() - aCartPointA->X()) <= Precision::Confusion() - && Abs(aCartPointC->Y() - aCartPointA->Y()) <= Precision::Confusion() - && Abs(aCartPointC->Z() - aCartPointA->Z()) <= Precision::Confusion()) + if (std::abs(aCartPointC->X() - aCartPointA->X()) <= Precision::Confusion() + && std::abs(aCartPointC->Y() - aCartPointA->Y()) <= Precision::Confusion() + && std::abs(aCartPointC->Z() - aCartPointA->Z()) <= Precision::Confusion()) { // C=A Message::SendFail("Error: same points"); return 1; } - if (Abs(aCartPointC->X() - aCartPointB->X()) <= Precision::Confusion() - && Abs(aCartPointC->Y() - aCartPointB->Y()) <= Precision::Confusion() - && Abs(aCartPointC->Z() - aCartPointB->Z()) <= Precision::Confusion()) + if (std::abs(aCartPointC->X() - aCartPointB->X()) <= Precision::Confusion() + && std::abs(aCartPointC->Y() - aCartPointB->Y()) <= Precision::Confusion() + && std::abs(aCartPointC->Z() - aCartPointB->Z()) <= Precision::Confusion()) { // C=B Message::SendFail("Error: same points"); @@ -2011,7 +2011,7 @@ TopoDS_Face FilledCircle::ComputeFace() // Create wire from anEdge BRepBuilderAPI_MakeWire aWireMaker; - if (Abs(Abs(myUEnd - myUStart) - 2.0 * M_PI) > gp::Resolution()) + if (std::abs(std::abs(myUEnd - myUStart) - 2.0 * M_PI) > gp::Resolution()) { TopoDS_Edge anEndCenterEdge = BRepBuilderAPI_MakeEdge(myCircle->Value(myUEnd), myCircle->Location()).Edge(); @@ -2054,7 +2054,7 @@ void FilledCircle::ComputeSelection(const Handle(SelectMgr_Selection)& theSelect Handle(SelectMgr_EntityOwner) anEntityOwner = new SelectMgr_EntityOwner(this); Handle(Select3D_SensitiveEntity) aSensitiveCircle; - if (Abs(Abs(myUEnd - myUStart) - 2.0 * M_PI) > gp::Resolution()) + if (std::abs(std::abs(myUEnd - myUStart) - 2.0 * M_PI) > gp::Resolution()) { aSensitiveCircle = new Select3D_SensitivePoly(anEntityOwner, myCircle->Circ(), myUStart, myUEnd, myFilledStatus); @@ -2164,25 +2164,25 @@ static int VCircleBuilder(Draw_Interpretor& /*di*/, Standard_Integer argc, const Handle(Geom_CartesianPoint) aCartPointC = Handle(Geom_CartesianPoint)::DownCast(anAISPointC->Component()); // Test A=B - if (Abs(aCartPointA->X() - aCartPointB->X()) <= Precision::Confusion() - && Abs(aCartPointA->Y() - aCartPointB->Y()) <= Precision::Confusion() - && Abs(aCartPointA->Z() - aCartPointB->Z()) <= Precision::Confusion()) + if (std::abs(aCartPointA->X() - aCartPointB->X()) <= Precision::Confusion() + && std::abs(aCartPointA->Y() - aCartPointB->Y()) <= Precision::Confusion() + && std::abs(aCartPointA->Z() - aCartPointB->Z()) <= Precision::Confusion()) { Message::SendFail("Error: Same points"); return 1; } // Test A=C - if (Abs(aCartPointA->X() - aCartPointC->X()) <= Precision::Confusion() - && Abs(aCartPointA->Y() - aCartPointC->Y()) <= Precision::Confusion() - && Abs(aCartPointA->Z() - aCartPointC->Z()) <= Precision::Confusion()) + if (std::abs(aCartPointA->X() - aCartPointC->X()) <= Precision::Confusion() + && std::abs(aCartPointA->Y() - aCartPointC->Y()) <= Precision::Confusion() + && std::abs(aCartPointA->Z() - aCartPointC->Z()) <= Precision::Confusion()) { Message::SendFail("Error: Same points"); return 1; } // Test B=C - if (Abs(aCartPointB->X() - aCartPointC->X()) <= Precision::Confusion() - && Abs(aCartPointB->Y() - aCartPointC->Y()) <= Precision::Confusion() - && Abs(aCartPointB->Z() - aCartPointC->Z()) <= Precision::Confusion()) + if (std::abs(aCartPointB->X() - aCartPointC->X()) <= Precision::Confusion() + && std::abs(aCartPointB->Y() - aCartPointC->Y()) <= Precision::Confusion() + && std::abs(aCartPointB->Z() - aCartPointC->Z()) <= Precision::Confusion()) { Message::SendFail("Error: Same points"); return 1; @@ -5149,8 +5149,8 @@ static Standard_Integer VTorus(Draw_Interpretor& /*di*/, aPipeAngle = aPipeAngle * (M_PI / 180.0); if (aMajorRad <= 0 || aMinorRad <= 0 || aNbSlices <= 0 || aNbStacks <= 0 - || Abs(aSegAngle2 - aSegAngle1) <= Precision::Angular() - || Abs(aPipeAngle) <= Precision::Angular()) + || std::abs(aSegAngle2 - aSegAngle1) <= Precision::Angular() + || std::abs(aPipeAngle) <= Precision::Angular()) { Message::SendFail("Syntax error: wrong parameters"); return 1; @@ -5495,7 +5495,7 @@ void ViewerTest_MarkersArrayObject::Compute(const Handle(PrsMgr_PresentationMana const Standard_Integer) { Handle(Graphic3d_ArrayOfPrimitives) anArray = - new Graphic3d_ArrayOfPoints((Standard_Integer)Pow(myPointsOnSide, 3), myPointsOnSide != 1); + new Graphic3d_ArrayOfPoints((Standard_Integer)std::pow(myPointsOnSide, 3), myPointsOnSide != 1); if (myPointsOnSide == 1) { anArray->AddVertex(myStartPoint); @@ -6298,7 +6298,7 @@ static Standard_Integer VPointCloud(Draw_Interpretor& theDI, theDI << "Syntax error: -distance value should be >= 0.0"; return 1; } - aDist = Max(aDist, Precision::Confusion()); + aDist = std::max(aDist, Precision::Confusion()); } else if ((aFlag == "-dens" || aFlag == "-density") && anArgIter + 1 < theArgNum && Draw::ParseReal(theArgs[anArgIter + 1], aDensity)) @@ -6437,7 +6437,9 @@ static Standard_Integer VPointCloud(Draw_Interpretor& theDI, Standard_Real aBeta = aBetaDistrib(aRandomGenerator); Standard_Real aDistance = isSurface ? aDistRadius : aRadiusDistrib(aRandomGenerator); - gp_Dir aDir(Cos(anAlpha) * Sin(aBeta), Sin(anAlpha), Cos(anAlpha) * Cos(aBeta)); + gp_Dir aDir(std::cos(anAlpha) * std::sin(aBeta), + std::sin(anAlpha), + std::cos(anAlpha) * std::cos(aBeta)); gp_Pnt aPoint = aDistCenter.Translated(aDir.XYZ() * aDistance); const Standard_Integer anIndexOfPoint = anArrayPoints->AddVertex(aPoint); @@ -6681,7 +6683,7 @@ static int VNormals(Draw_Interpretor& theDI, Standard_Integer theArgNum, const c { ++anArgIter; aLength = anArgIter < theArgNum ? Draw::Atof(theArgs[anArgIter]) : 0.0; - if (Abs(aLength) <= gp::Resolution()) + if (std::abs(aLength) <= gp::Resolution()) { Message::SendFail("Syntax error: length should not be zero"); return 1; diff --git a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_OpenGlCommands.cxx b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_OpenGlCommands.cxx index 394fcf38e4..f23fa9478b 100644 --- a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_OpenGlCommands.cxx +++ b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_OpenGlCommands.cxx @@ -893,8 +893,8 @@ static Standard_Integer VListColors(Draw_Interpretor& theDI, aColIter.Next()) { aMaxNameLen = - Max(aMaxNameLen, - TCollection_AsciiString(Quantity_Color::StringName(aColIter.Value())).Length()); + std::max(aMaxNameLen, + TCollection_AsciiString(Quantity_Color::StringName(aColIter.Value())).Length()); } V3d_ImageDumpOptions anImgParams; diff --git a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_RelationCommands.cxx b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_RelationCommands.cxx index fe55880ac2..2e78564d5d 100644 --- a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_RelationCommands.cxx +++ b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_RelationCommands.cxx @@ -1306,7 +1306,7 @@ static int VRelationBuilder(Draw_Interpretor& /*theDi*/, return 1; } - Standard_Real aDist = Round(sqrt(aDelta.SquareDistance(1)) * 10.0) / 10.0; + Standard_Real aDist = std::round(sqrt(aDelta.SquareDistance(1)) * 10.0) / 10.0; TCollection_ExtendedString aMessage(TCollection_ExtendedString("offset=") + TCollection_ExtendedString(aDist)); aRelation = new PrsDim_OffsetDimension(aFace1, aFace2, aDist, aMessage); diff --git a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ViewerCommands.cxx b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ViewerCommands.cxx index 2c1ca12cc8..f371cd1719 100644 --- a/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ViewerCommands.cxx +++ b/src/Draw/TKViewerTest/ViewerTest/ViewerTest_ViewerCommands.cxx @@ -2507,8 +2507,10 @@ static int VFitArea(Draw_Interpretor& theDI, Standard_Integer theArgNb, const ch gp_Pnt aViewPnt2 = aCamera->ConvertWorld2View(aWorldPnt2); // Determine fit area - gp_Pnt2d aMinCorner(Min(aViewPnt1.X(), aViewPnt2.X()), Min(aViewPnt1.Y(), aViewPnt2.Y())); - gp_Pnt2d aMaxCorner(Max(aViewPnt1.X(), aViewPnt2.X()), Max(aViewPnt1.Y(), aViewPnt2.Y())); + gp_Pnt2d aMinCorner(std::min(aViewPnt1.X(), aViewPnt2.X()), + std::min(aViewPnt1.Y(), aViewPnt2.Y())); + gp_Pnt2d aMaxCorner(std::max(aViewPnt1.X(), aViewPnt2.X()), + std::max(aViewPnt1.Y(), aViewPnt2.Y())); Standard_Real aDiagonal = aMinCorner.Distance(aMaxCorner); @@ -7771,7 +7773,7 @@ static Standard_Integer VAnimation(Draw_Interpretor& theDI, int64_t aNbFrames = 0; Message_ProgressScope aPS(Message_ProgressIndicator::Start(aProgress), "Video recording, sec", - Max(1, Standard_Integer(aPlayDuration / aPlaySpeed))); + std::max(1, Standard_Integer(aPlayDuration / aPlaySpeed))); Standard_Integer aSecondsProgress = 0; for (; aPts <= anUpperPts && aPS.More();) { @@ -9977,11 +9979,11 @@ static int VLight(Draw_Interpretor& theDi, Standard_Integer theArgsNb, const cha { aSmoothness = Standard_ShortReal(aSmoothness * M_PI / 180.0); } - if (Abs(aSmoothness) <= ShortRealEpsilon()) + if (std::abs(aSmoothness) <= ShortRealEpsilon()) { aLightNew->SetIntensity(1.f); } - else if (Abs(aLightNew->Smoothness()) <= ShortRealEpsilon()) + else if (std::abs(aLightNew->Smoothness()) <= ShortRealEpsilon()) { aLightNew->SetIntensity((aSmoothness * aSmoothness) / 3.f); } @@ -11204,7 +11206,7 @@ static Standard_Integer VRenderParams(Draw_Interpretor& theDI, aParams.IsGlobalIlluminationEnabled = toEnable; if (!toEnable) { - aParams.RaytracingDepth = Min(aParams.RaytracingDepth, 10); + aParams.RaytracingDepth = std::min(aParams.RaytracingDepth, 10); } } else if (aFlag == "-blockedrng" || aFlag == "-brng") @@ -13526,7 +13528,7 @@ static int VSelBvhBuild(Draw_Interpretor& /*theDI*/, aThreadsNb = Draw::Atoi(theArgVec[++anArgIter]); if (aThreadsNb < 1) { - aThreadsNb = Max(1, OSD_Parallel::NbLogicalProcessors() - 1); + aThreadsNb = std::max(1, OSD_Parallel::NbLogicalProcessors() - 1); } } else if (anArg == "-wait") diff --git a/src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW_Notes.cxx b/src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW_Notes.cxx index 35c9458fcc..7297f48027 100644 --- a/src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW_Notes.cxx +++ b/src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW_Notes.cxx @@ -1246,7 +1246,7 @@ static Standard_Integer noteDump(Draw_Interpretor& di, Standard_Integer argc, co if (!aData.IsNull()) { di << "Data : "; - Standard_Integer aLen = Min(aData->Length(), theMaxLen); + Standard_Integer aLen = std::min(aData->Length(), theMaxLen); for (Standard_Integer i = 1; i <= aLen; ++i) { Standard_SStream ss; diff --git a/src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW_Props.cxx b/src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW_Props.cxx index 2077b0b83f..869056cb84 100644 --- a/src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW_Props.cxx +++ b/src/Draw/TKXDEDRAW/XDEDRAW/XDEDRAW_Props.cxx @@ -619,7 +619,7 @@ static Standard_Integer CheckProps(Draw_Interpretor& di, Standard_Integer argc, "%s%9.1f (%3d%%)%s", (wholeDoc ? "" : " Area defect: "), aArea->Get() - G.Mass(), - (Standard_Integer)(Abs(G.Mass()) > 1e-10 + (Standard_Integer)(std::abs(G.Mass()) > 1e-10 ? 100. * (aArea->Get() - G.Mass()) / G.Mass() : 999.), (wholeDoc ? "" : "\n")); @@ -678,7 +678,7 @@ static Standard_Integer CheckProps(Draw_Interpretor& di, Standard_Integer argc, "%s%9.1f (%3d%%)%s", (wholeDoc ? "" : " Volume defect: "), aVolume->Get() - localVolume, - (Standard_Integer)(Abs(localVolume) > 1e-10 + (Standard_Integer)(std::abs(localVolume) > 1e-10 ? 100. * (aVolume->Get() - localVolume) / localVolume : 999.), (wholeDoc ? "" : "\n")); diff --git a/src/Draw/TKXSDRAWPLY/XSDRAWPLY/XSDRAWPLY.cxx b/src/Draw/TKXSDRAWPLY/XSDRAWPLY/XSDRAWPLY.cxx index aeee1734dc..b7d54564c2 100644 --- a/src/Draw/TKXSDRAWPLY/XSDRAWPLY/XSDRAWPLY.cxx +++ b/src/Draw/TKXSDRAWPLY/XSDRAWPLY/XSDRAWPLY.cxx @@ -100,7 +100,7 @@ static Standard_Integer WritePly(Draw_Interpretor& theDI, theDI << "Syntax error: -distance value should be >= 0.0"; return 1; } - aDist = Max(aDist, Precision::Confusion()); + aDist = std::max(aDist, Precision::Confusion()); } else if ((anArg == "-dens" || anArg == "-density") && anArgIter + 1 < theNbArgs && Draw::ParseReal(theArgVec[anArgIter + 1], aDens)) diff --git a/src/Draw/TKXSDRAWVRML/XSDRAWVRML/XSDRAWVRML.cxx b/src/Draw/TKXSDRAWVRML/XSDRAWVRML/XSDRAWVRML.cxx index f7dbe04202..ca5e010d29 100644 --- a/src/Draw/TKXSDRAWVRML/XSDRAWVRML/XSDRAWVRML.cxx +++ b/src/Draw/TKXSDRAWVRML/XSDRAWVRML/XSDRAWVRML.cxx @@ -382,10 +382,10 @@ static Standard_Integer writevrml(Draw_Interpretor& di, Standard_Integer argc, c } // Bound parameters - aVersion = Max(1, aVersion); - aVersion = Min(2, aVersion); - aType = Max(0, aType); - aType = Min(2, aType); + aVersion = std::max(1, aVersion); + aVersion = std::min(2, aVersion); + aType = std::max(0, aType); + aType = std::min(2, aType); VrmlAPI_Writer writer; diff --git a/src/FoundationClasses/TKMath/BSplCLib/BSplCLib.cxx b/src/FoundationClasses/TKMath/BSplCLib/BSplCLib.cxx index e3b0590956..01c6b3b462 100644 --- a/src/FoundationClasses/TKMath/BSplCLib/BSplCLib.cxx +++ b/src/FoundationClasses/TKMath/BSplCLib/BSplCLib.cxx @@ -264,7 +264,7 @@ void BSplCLib::LocateParameter(const TColStd_Array1OfReal& Knots, Standard_Real val; const Standard_Integer KLower = Knots.Lower(), KUpper = Knots.Upper(); - const Standard_Real Eps = Epsilon(Min(Abs(Knots(KUpper)), Abs(U))); + const Standard_Real Eps = Epsilon(std::min(std::abs(Knots(KUpper)), std::abs(U))); const Standard_Real* knots = &Knots(KLower); knots -= KLower; @@ -743,7 +743,7 @@ void BSplCLib::KnotAnalysis(const Standard_Integer Degree, for (Standard_Integer i = FirstKM + 1; i < LastKM; i++) { Multi = CMults(i); - MaxKnotMult = Max(MaxKnotMult, Multi); + MaxKnotMult = std::max(MaxKnotMult, Multi); } } } @@ -754,8 +754,8 @@ void BSplCLib::Reparametrize(const Standard_Real U1, const Standard_Real U2, Arr { Standard_Integer Lower = Knots.Lower(); Standard_Integer Upper = Knots.Upper(); - Standard_Real UFirst = Min(U1, U2); - Standard_Real ULast = Max(U1, U2); + Standard_Real UFirst = std::min(U1, U2); + Standard_Real ULast = std::max(U1, U2); Standard_Real NewLength = ULast - UFirst; BSplCLib_KnotDistribution KSet = BSplCLib::KnotForm(Knots, Lower, Upper); if (KSet == BSplCLib_Uniform) @@ -783,9 +783,9 @@ void BSplCLib::Reparametrize(const Standard_Real U1, const Standard_Real U2, Arr Knots(i) = Knots(i - 1) + (NewLength * Ratio); // for CheckCurveData - Standard_Real Eps = Epsilon(Abs(Knots(i - 1))); + Standard_Real Eps = Epsilon(std::abs(Knots(i - 1))); if (Knots(i) - Knots(i - 1) <= Eps) - Knots(i) = NextAfter(Knots(i - 1) + Eps, RealLast()); + Knots(i) = std::nextafter(Knots(i - 1) + Eps, RealLast()); K1 = K2; } @@ -1115,7 +1115,7 @@ Standard_Boolean BSplCLib::AntiBoorScheme(const Standard_Real U, for (k = 0; k < Dimension; k++) { z = X * firstpole[k] + Y * firstpole[k + 2 * Dimension]; - if (Abs(z - firstpole[k + Dimension]) > Tolerance) + if (std::abs(z - firstpole[k + Dimension]) > Tolerance) return Standard_False; } return Standard_True; @@ -1162,7 +1162,7 @@ Standard_Boolean BSplCLib::AntiBoorScheme(const Standard_Real U, for (k = 0; k < Dimension; k++) { z = (pole[k] - Y * pole[k + Dimension]) / X; - if (Abs(z - pole[k - Dimension]) > Tolerance) + if (std::abs(z - pole[k - Dimension]) > Tolerance) return Standard_False; pole[k - Dimension] += z; pole[k - Dimension] /= 2.; @@ -1894,7 +1894,7 @@ Standard_Boolean BSplCLib::PrepareInsertKnots(const Standard_Integer Deg return Standard_False; oldau = au; - Eps = Max(Tolerance, Epsilon(au)); + Eps = std::max(Tolerance, Epsilon(au)); while ((k < Knots.Upper()) && (Knots(k + 1) - au <= Eps)) { @@ -1906,9 +1906,9 @@ Standard_Boolean BSplCLib::PrepareInsertKnots(const Standard_Integer Deg if (addflat) amult = 1; else - amult = Max(0, (*AddMults)(ak)); + amult = std::max(0, (*AddMults)(ak)); - while ((ak < AddKnots.Upper()) && (Abs(au - AddKnots(ak + 1)) <= Eps)) + while ((ak < AddKnots.Upper()) && (std::abs(au - AddKnots(ak + 1)) <= Eps)) { ak++; if (Add) @@ -1916,18 +1916,18 @@ Standard_Boolean BSplCLib::PrepareInsertKnots(const Standard_Integer Deg if (addflat) amult++; else - amult += Max(0, (*AddMults)(ak)); + amult += std::max(0, (*AddMults)(ak)); } } - if (Abs(au - Knots(k)) <= Eps) + if (std::abs(au - Knots(k)) <= Eps) { // identic to existing knot mult = Mults(k); if (Add) { if (mult + amult > Degree) - amult = Max(0, Degree - mult); + amult = std::max(0, Degree - mult); sigma += amult; } else if (amult > mult) @@ -1936,7 +1936,7 @@ Standard_Boolean BSplCLib::PrepareInsertKnots(const Standard_Integer Deg amult = Degree; if (k == Knots.Upper() && Periodic) { - aLastKnotMult = Max(amult, mult); + aLastKnotMult = std::max(amult, mult); sigma += 2 * (aLastKnotMult - mult); } else @@ -2100,7 +2100,7 @@ void BSplCLib::InsertKnots(const Standard_Integer Degree, { u = AddKnots(kn); - Eps = Max(Tolerance, Epsilon(u)); + Eps = std::max(Tolerance, Epsilon(u)); //----------------------------------- // find the position in the old knots @@ -2163,17 +2163,17 @@ void BSplCLib::InsertKnots(const Standard_Integer Degree, // to insert the new knot //------------------------------------ - Standard_Boolean sameknot = (Abs(u - NewKnots(curnk)) <= Eps); + Standard_Boolean sameknot = (std::abs(u - NewKnots(curnk)) <= Eps); if (sameknot) - length = Max(0, Degree - NewMults(curnk)); + length = std::max(0, Degree - NewMults(curnk)); else length = Degree; if (addflat) depth = 1; else - depth = Min(Degree, (*AddMults)(kn)); + depth = std::min(Degree, (*AddMults)(kn)); if (sameknot) { @@ -2184,7 +2184,7 @@ void BSplCLib::InsertKnots(const Standard_Integer Degree, } else { - depth = Max(0, depth - NewMults(curnk)); + depth = std::max(0, depth - NewMults(curnk)); } if (Periodic) @@ -2206,7 +2206,7 @@ void BSplCLib::InsertKnots(const Standard_Integer Degree, // copy the poles need = NewPoles.Lower() + (index + length + 1) * Dimension - curnp; - need = Min(need, Poles.Upper() - curp + 1); + need = std::min(need, Poles.Upper() - curp + 1); p = curp; np = curnp; @@ -3002,7 +3002,7 @@ void BSplCLib::PrepareTrimming(const Standard_Integer Degree, LocateParameter(Degree, Knots, Mults, U1, Periodic, Knots.Lower(), Knots.Upper(), index1, NewU1); LocateParameter(Degree, Knots, Mults, U2, Periodic, Knots.Lower(), Knots.Upper(), index2, NewU2); index1++; - if (Abs(Knots(index2) - U2) <= Epsilon(U1)) + if (std::abs(Knots(index2) - U2) <= Epsilon(U1)) index2--; // eval NbKnots: @@ -3083,8 +3083,8 @@ void BSplCLib::Trimming(const Standard_Integer Degree, NewKnots(i) = TempKnots(Kindex + i - 1); NewMults(i) = TempMults(Kindex + i - 1); } - NewMults(1) = Min(Degree, NewMults(1)) + 1; - NewMults(NewMults.Length()) = Min(Degree, NewMults(NewMults.Length())) + 1; + NewMults(1) = std::min(Degree, NewMults(1)) + 1; + NewMults(NewMults.Length()) = std::min(Degree, NewMults(NewMults.Length())) + 1; } //================================================================================================= @@ -3139,7 +3139,7 @@ Standard_Integer BSplCLib::SolveBandedSystem(const math_Matrix& Matrix, Standard_Real divizor = Matrix(ii, LowerBandWidth + 1); Standard_Real Toler = 1.0e-16; - if (Abs(divizor) > Toler) + if (std::abs(divizor) > Toler) Inverse = 1.0e0 / divizor; else { @@ -3745,7 +3745,7 @@ void BSplCLib::TangExtendToConstraint(const TColStd_Array1OfReal& FlatKnots, Tbord = FlatKnots(FlatKnots.Lower() + CDegree); } Standard_Boolean periodic_flag = Standard_False; - Standard_Integer ipos, extrap_mode[2], derivative_request = Max(Continuity, 1); + Standard_Integer ipos, extrap_mode[2], derivative_request = std::max(Continuity, 1); extrap_mode[0] = extrap_mode[1] = CDegree; TColStd_Array1OfReal EvalBS(1, CDimension * (derivative_request + 1)); Standard_Real* Eadr = (Standard_Real*)&EvalBS(1); @@ -3778,9 +3778,9 @@ void BSplCLib::TangExtendToConstraint(const TColStd_Array1OfReal& FlatKnots, Contraintes(1, ipos) = EvalBS(ipos); Contraintes(2, ipos) = C1Coefficient * EvalBS(ipos + CDimension); if (Continuity >= 2) - Contraintes(3, ipos) = EvalBS(ipos + 2 * CDimension) * Pow(C1Coefficient, 2); + Contraintes(3, ipos) = EvalBS(ipos + 2 * CDimension) * std::pow(C1Coefficient, 2); if (Continuity >= 3) - Contraintes(4, ipos) = EvalBS(ipos + 3 * CDimension) * Pow(C1Coefficient, 3); + Contraintes(4, ipos) = EvalBS(ipos + 3 * CDimension) * std::pow(C1Coefficient, 3); Contraintes(Continuity + 2, ipos) = ConstraintPoint(ipos); } } @@ -3794,9 +3794,9 @@ void BSplCLib::TangExtendToConstraint(const TColStd_Array1OfReal& FlatKnots, if (Continuity >= 1) Contraintes(3, ipos) = C1Coefficient * EvalBS(ipos + CDimension); if (Continuity >= 2) - Contraintes(4, ipos) = EvalBS(ipos + 2 * CDimension) * Pow(C1Coefficient, 2); + Contraintes(4, ipos) = EvalBS(ipos + 2 * CDimension) * std::pow(C1Coefficient, 2); if (Continuity >= 3) - Contraintes(5, ipos) = EvalBS(ipos + 3 * CDimension) * Pow(C1Coefficient, 3); + Contraintes(5, ipos) = EvalBS(ipos + 3 * CDimension) * std::pow(C1Coefficient, 3); } } @@ -4686,12 +4686,12 @@ Standard_Integer BSplCLib::Intervals(const TColStd_Array1OfReal& theKnots, anIndex2, aDummyDouble); // the case when the beginning of the range coincides with the next knot - if (anIndex1 < aNbNewKnots && Abs(aNewKnots[anIndex1 + 1] - aCurFirst) < theTolerance) + if (anIndex1 < aNbNewKnots && std::abs(aNewKnots[anIndex1 + 1] - aCurFirst) < theTolerance) { anIndex1 += 1; } // the case when the ending of the range coincides with the current knot - if (aNbNewKnots && Abs(aNewKnots[anIndex2] - aCurLast) < theTolerance) + if (aNbNewKnots && std::abs(aNewKnots[anIndex2] - aCurLast) < theTolerance) { anIndex2 -= 1; } diff --git a/src/FoundationClasses/TKMath/BSplCLib/BSplCLib_2.cxx b/src/FoundationClasses/TKMath/BSplCLib/BSplCLib_2.cxx index 417b275b62..1e457055e3 100644 --- a/src/FoundationClasses/TKMath/BSplCLib/BSplCLib_2.cxx +++ b/src/FoundationClasses/TKMath/BSplCLib/BSplCLib_2.cxx @@ -379,7 +379,7 @@ Standard_Integer BSplCLib::FactorBandedMatrix(math_Matrix& Matrix, { Index = ii - LowerBandWidth + jj - 1; Inverse = Matrix(Index, LowerBandWidth + 1); - if (Abs(Inverse) > RealSmall()) + if (std::abs(Inverse) > RealSmall()) { Inverse = -1.0e0 / Inverse; } @@ -486,7 +486,7 @@ Standard_Integer BSplCLib::EvalBsplineBasis(const Standard_Integer Derivati // this should be always invertible if ii is correctly computed // const Standard_Real aScale = (FlatKnots(ii + pp) - FlatKnots(ii - qq + pp + 1)); - if (Abs(aScale) < gp::Resolution()) + if (std::abs(aScale) < gp::Resolution()) { return 2; } @@ -516,7 +516,7 @@ Standard_Integer BSplCLib::EvalBsplineBasis(const Standard_Integer Derivati for (pp = 1; pp <= qq - 1; pp++) { const Standard_Real aScale = (FlatKnots(ii + pp) - FlatKnots(ii - qq + pp + 1)); - if (Abs(aScale) < gp::Resolution()) + if (std::abs(aScale) < gp::Resolution()) { return 2; } @@ -1138,7 +1138,7 @@ void BSplCLib::MergeBSplineKnots(const Standard_Real Tolerance, while (jj <= knots2.Length() && knots2(jj) <= knots1(ii) + Tolerance) { - continuity = Min(Degree1 - Mults1(ii), Degree2 - Mults2(jj)); + continuity = std::min(Degree1 - Mults1(ii), Degree2 - Mults2(jj)); set_mults_flag = 1; NewMults->ChangeArray1()(num_knots) = degree - continuity; jj += 1; diff --git a/src/FoundationClasses/TKMath/BSplCLib/BSplCLib_CacheParams.hxx b/src/FoundationClasses/TKMath/BSplCLib/BSplCLib_CacheParams.hxx index e3193e40bd..5b74077323 100644 --- a/src/FoundationClasses/TKMath/BSplCLib/BSplCLib_CacheParams.hxx +++ b/src/FoundationClasses/TKMath/BSplCLib/BSplCLib_CacheParams.hxx @@ -65,13 +65,13 @@ struct BSplCLib_CacheParams if (theParameter < FirstParameter) { Standard_Real aPeriod = LastParameter - FirstParameter; - Standard_Real aScale = IntegerPart((FirstParameter - theParameter) / aPeriod); + Standard_Real aScale = std::trunc((FirstParameter - theParameter) / aPeriod); return theParameter + aPeriod * (aScale + 1.0); } if (theParameter > LastParameter) { Standard_Real aPeriod = LastParameter - FirstParameter; - Standard_Real aScale = IntegerPart((theParameter - LastParameter) / aPeriod); + Standard_Real aScale = std::trunc((theParameter - LastParameter) / aPeriod); return theParameter - aPeriod * (aScale + 1.0); } } diff --git a/src/FoundationClasses/TKMath/BSplCLib/BSplCLib_CurveComputation.gxx b/src/FoundationClasses/TKMath/BSplCLib/BSplCLib_CurveComputation.gxx new file mode 100644 index 0000000000..33b71588c2 --- /dev/null +++ b/src/FoundationClasses/TKMath/BSplCLib/BSplCLib_CurveComputation.gxx @@ -0,0 +1,1483 @@ +// Copyright (c) 1995-1999 Matra Datavision +// Copyright (c) 1999-2014 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +// xab : modified 15-Mar-94 added EvalBSplineMatrix, FactorBandedMatrix, SolveBandedSystem +// Eval, BuildCache, cacheD0, cacheD1, cacheD2, cacheD3, LocalMatrix, +// EvalPolynomial, RationalDerivatives. +// xab : 22-Mar-94 : fixed rational problem in BuildCache +// xab : 12-Mar-96 : added MovePointAndTangent +#include +#include +#include +#include +#include +#include +#include + +//======================================================================= +// struct : BSplCLib_DataContainer +// purpose: Auxiliary structure providing buffers for poles and knots used in +// evaluation of bspline (allocated in the stack) +//======================================================================= + +struct BSplCLib_DataContainer +{ + BSplCLib_DataContainer(Standard_Integer Degree) + { + (void)Degree; // avoid compiler warning + Standard_OutOfRange_Raise_if(Degree > BSplCLib::MaxDegree() || BSplCLib::MaxDegree() > 25, + "BSplCLib: bspline degree is greater than maximum supported"); + } + + Standard_Real poles[(25 + 1) * (Dimension_gen + 1)]; + Standard_Real knots[2 * 25]; + Standard_Real ders[Dimension_gen * 4]; +}; + +//================================================================================================= + +void BSplCLib::Reverse(Array1OfPoints& Poles, const Standard_Integer L) +{ + Standard_Integer i, l = L; + l = Poles.Lower() + (l - Poles.Lower()) % (Poles.Upper() - Poles.Lower() + 1); + + Array1OfPoints temp(0, Poles.Length() - 1); + + for (i = Poles.Lower(); i <= l; i++) + temp(l - i) = Poles(i); + + for (i = l + 1; i <= Poles.Upper(); i++) + temp(l - Poles.Lower() + Poles.Upper() - i + 1) = Poles(i); + + for (i = Poles.Lower(); i <= Poles.Upper(); i++) + Poles(i) = temp(i - Poles.Lower()); +} + +// +// CURVES MODIFICATIONS +// + +//================================================================================================= + +Standard_Boolean BSplCLib::RemoveKnot(const Standard_Integer Index, + const Standard_Integer Mult, + const Standard_Integer Degree, + const Standard_Boolean Periodic, + const Array1OfPoints& Poles, + const TColStd_Array1OfReal* Weights, + const TColStd_Array1OfReal& Knots, + const TColStd_Array1OfInteger& Mults, + Array1OfPoints& NewPoles, + TColStd_Array1OfReal* NewWeights, + TColStd_Array1OfReal& NewKnots, + TColStd_Array1OfInteger& NewMults, + const Standard_Real Tolerance) +{ + Standard_Boolean rational = Weights != NULL; + Standard_Integer dim; + dim = Dimension_gen; + if (rational) + dim++; + + TColStd_Array1OfReal poles(1, dim * Poles.Length()); + TColStd_Array1OfReal newpoles(1, dim * NewPoles.Length()); + + if (rational) + PLib::SetPoles(Poles, *Weights, poles); + else + PLib::SetPoles(Poles, poles); + + if (!RemoveKnot(Index, + Mult, + Degree, + Periodic, + dim, + poles, + Knots, + Mults, + newpoles, + NewKnots, + NewMults, + Tolerance)) + return Standard_False; + + if (rational) + PLib::GetPoles(newpoles, NewPoles, *NewWeights); + else + PLib::GetPoles(newpoles, NewPoles); + return Standard_True; +} + +//======================================================================= +// function : InsertKnots +// purpose : insert an array of knots and multiplicities +//======================================================================= + +void BSplCLib::InsertKnots(const Standard_Integer Degree, + const Standard_Boolean Periodic, + const Array1OfPoints& Poles, + const TColStd_Array1OfReal* Weights, + const TColStd_Array1OfReal& Knots, + const TColStd_Array1OfInteger& Mults, + const TColStd_Array1OfReal& AddKnots, + const TColStd_Array1OfInteger* AddMults, + Array1OfPoints& NewPoles, + TColStd_Array1OfReal* NewWeights, + TColStd_Array1OfReal& NewKnots, + TColStd_Array1OfInteger& NewMults, + const Standard_Real Epsilon, + const Standard_Boolean Add) +{ + Standard_Boolean rational = Weights != NULL; + Standard_Integer dim; + dim = Dimension_gen; + if (rational) + dim++; + + TColStd_Array1OfReal poles(1, dim * Poles.Length()); + TColStd_Array1OfReal newpoles(1, dim * NewPoles.Length()); + + if (rational) + PLib::SetPoles(Poles, *Weights, poles); + else + PLib::SetPoles(Poles, poles); + + InsertKnots(Degree, + Periodic, + dim, + poles, + Knots, + Mults, + AddKnots, + AddMults, + newpoles, + NewKnots, + NewMults, + Epsilon, + Add); + + if (rational) + PLib::GetPoles(newpoles, NewPoles, *NewWeights); + else + PLib::GetPoles(newpoles, NewPoles); +} + +//================================================================================================= + +void BSplCLib::InsertKnot(const Standard_Integer, + const Standard_Real U, + const Standard_Integer UMult, + const Standard_Integer Degree, + const Standard_Boolean Periodic, + const Array1OfPoints& Poles, + const TColStd_Array1OfReal* Weights, + const TColStd_Array1OfReal& Knots, + const TColStd_Array1OfInteger& Mults, + Array1OfPoints& NewPoles, + TColStd_Array1OfReal* NewWeights) +{ + TColStd_Array1OfReal k(1, 1); + k(1) = U; + TColStd_Array1OfInteger m(1, 1); + m(1) = UMult; + TColStd_Array1OfReal nk(1, Knots.Length() + 1); + TColStd_Array1OfInteger nm(1, Knots.Length() + 1); + InsertKnots(Degree, + Periodic, + Poles, + Weights, + Knots, + Mults, + k, + &m, + NewPoles, + NewWeights, + nk, + nm, + Epsilon(U)); +} + +//================================================================================================= + +void BSplCLib::RaiseMultiplicity(const Standard_Integer KnotIndex, + const Standard_Integer Mult, + const Standard_Integer Degree, + const Standard_Boolean Periodic, + const Array1OfPoints& Poles, + const TColStd_Array1OfReal* Weights, + const TColStd_Array1OfReal& Knots, + const TColStd_Array1OfInteger& Mults, + Array1OfPoints& NewPoles, + TColStd_Array1OfReal* NewWeights) +{ + TColStd_Array1OfReal k(1, 1); + k(1) = Knots(KnotIndex); + TColStd_Array1OfInteger m(1, 1); + m(1) = Mult - Mults(KnotIndex); + TColStd_Array1OfReal nk(1, Knots.Length()); + TColStd_Array1OfInteger nm(1, Knots.Length()); + InsertKnots(Degree, + Periodic, + Poles, + Weights, + Knots, + Mults, + k, + &m, + NewPoles, + NewWeights, + nk, + nm, + Epsilon(k(1))); +} + +//================================================================================================= + +void BSplCLib::IncreaseDegree(const Standard_Integer Degree, + const Standard_Integer NewDegree, + const Standard_Boolean Periodic, + const Array1OfPoints& Poles, + const TColStd_Array1OfReal* Weights, + const TColStd_Array1OfReal& Knots, + const TColStd_Array1OfInteger& Mults, + Array1OfPoints& NewPoles, + TColStd_Array1OfReal* NewWeights, + TColStd_Array1OfReal& NewKnots, + TColStd_Array1OfInteger& NewMults) +{ + Standard_Boolean rational = Weights != NULL; + Standard_Integer dim; + dim = Dimension_gen; + if (rational) + dim++; + + TColStd_Array1OfReal poles(1, dim * Poles.Length()); + TColStd_Array1OfReal newpoles(1, dim * NewPoles.Length()); + + if (rational) + PLib::SetPoles(Poles, *Weights, poles); + else + PLib::SetPoles(Poles, poles); + + IncreaseDegree(Degree, + NewDegree, + Periodic, + dim, + poles, + Knots, + Mults, + newpoles, + NewKnots, + NewMults); + + if (rational) + PLib::GetPoles(newpoles, NewPoles, *NewWeights); + else + PLib::GetPoles(newpoles, NewPoles); +} + +//================================================================================================= + +void BSplCLib::Unperiodize(const Standard_Integer Degree, + const TColStd_Array1OfInteger& Mults, + const TColStd_Array1OfReal& Knots, + const Array1OfPoints& Poles, + const TColStd_Array1OfReal* Weights, + TColStd_Array1OfInteger& NewMults, + TColStd_Array1OfReal& NewKnots, + Array1OfPoints& NewPoles, + TColStd_Array1OfReal* NewWeights) +{ + Standard_Boolean rational = Weights != NULL; + Standard_Integer dim; + dim = Dimension_gen; + if (rational) + dim++; + + TColStd_Array1OfReal poles(1, dim * Poles.Length()); + TColStd_Array1OfReal newpoles(1, dim * NewPoles.Length()); + + if (rational) + PLib::SetPoles(Poles, *Weights, poles); + else + PLib::SetPoles(Poles, poles); + + Unperiodize(Degree, dim, Mults, Knots, poles, NewMults, NewKnots, newpoles); + + if (rational) + PLib::GetPoles(newpoles, NewPoles, *NewWeights); + else + PLib::GetPoles(newpoles, NewPoles); +} + +//================================================================================================= + +void BSplCLib::Trimming(const Standard_Integer Degree, + const Standard_Boolean Periodic, + const TColStd_Array1OfReal& Knots, + const TColStd_Array1OfInteger& Mults, + const Array1OfPoints& Poles, + const TColStd_Array1OfReal* Weights, + const Standard_Real U1, + const Standard_Real U2, + TColStd_Array1OfReal& NewKnots, + TColStd_Array1OfInteger& NewMults, + Array1OfPoints& NewPoles, + TColStd_Array1OfReal* NewWeights) +{ + Standard_Boolean rational = Weights != NULL; + Standard_Integer dim; + dim = Dimension_gen; + if (rational) + dim++; + + TColStd_Array1OfReal poles(1, dim * Poles.Length()); + TColStd_Array1OfReal newpoles(1, dim * NewPoles.Length()); + + if (rational) + PLib::SetPoles(Poles, *Weights, poles); + else + PLib::SetPoles(Poles, poles); + + Trimming(Degree, Periodic, dim, Knots, Mults, poles, U1, U2, NewKnots, NewMults, newpoles); + + if (rational) + PLib::GetPoles(newpoles, NewPoles, *NewWeights); + else + PLib::GetPoles(newpoles, NewPoles); +} + +//================================================================================================= + +// +// All the following methods are methods of low level used in BSplCLib +// but also in BSplSLib (but not in Geom) +// At the creation time of this package there is no possibility +// to declare private methods of package and to declare friend +// methods of package. It could interesting to declare that BSplSLib +// is a package friend to BSplCLib because it uses all the basis methods +// of BSplCLib. +//-------------------------------------------------------------------------- + +//======================================================================= +// function : BuildEval +// purpose : builds the local array for evaluation +//======================================================================= + +void BSplCLib::BuildEval(const Standard_Integer Degree, + const Standard_Integer Index, + const Array1OfPoints& Poles, + const TColStd_Array1OfReal* Weights, + Standard_Real& LP) +{ + Standard_Real w, *pole = &LP; + Standard_Integer PLower = Poles.Lower(); + Standard_Integer PUpper = Poles.Upper(); + Standard_Integer i; + Standard_Integer ip = PLower + Index - 1; + if (Weights == NULL) + { + for (i = 0; i <= Degree; i++) + { + ip++; + if (ip > PUpper) + ip = PLower; + const Point& P = Poles(ip); + PointToCoords(pole, P, +0); + pole += Dimension_gen; + } + } + else + { + for (i = 0; i <= Degree; i++) + { + ip++; + if (ip > PUpper) + ip = PLower; + const Point& P = Poles(ip); + pole[Dimension_gen] = w = (*Weights)(ip); + PointToCoords(pole, P, *w); + pole += Dimension_gen + 1; + } + } +} + +//======================================================================= +// function : PrepareEval +// purpose : stores data for Eval in the local arrays +// dc.poles and dc.knots +//======================================================================= + +static void PrepareEval(Standard_Real& u, + Standard_Integer& index, + Standard_Integer& dim, + Standard_Boolean& rational, + const Standard_Integer Degree, + const Standard_Boolean Periodic, + const Array1OfPoints& Poles, + const TColStd_Array1OfReal* Weights, + const TColStd_Array1OfReal& Knots, + const TColStd_Array1OfInteger* Mults, + BSplCLib_DataContainer& dc) +{ + // Set the Index + BSplCLib::LocateParameter(Degree, Knots, Mults, u, Periodic, index, u); + + // make the knots + BSplCLib::BuildKnots(Degree, index, Periodic, Knots, Mults, *dc.knots); + if (Mults == NULL) + index -= Knots.Lower() + Degree; + else + index = BSplCLib::PoleIndex(Degree, index, Periodic, *Mults); + + // check truly rational + rational = (Weights != NULL); + if (rational) + { + Standard_Integer WLower = Weights->Lower() + index; + rational = BSplCLib::IsRational(*Weights, WLower, WLower + Degree); + } + + // make the poles + if (rational) + { + dim = Dimension_gen + 1; + BSplCLib::BuildEval(Degree, index, Poles, Weights, *dc.poles); + } + else + { + dim = Dimension_gen; + BSplCLib::BuildEval(Degree, index, Poles, BSplCLib::NoWeights(), *dc.poles); + } +} + +//================================================================================================= + +void BSplCLib::D0(const Standard_Real U, + const Standard_Integer Index, + const Standard_Integer Degree, + const Standard_Boolean Periodic, + const Array1OfPoints& Poles, + const TColStd_Array1OfReal* Weights, + const TColStd_Array1OfReal& Knots, + const TColStd_Array1OfInteger* Mults, + Point& P) +{ + // Standard_Integer k,dim,index = Index; + Standard_Integer dim, index = Index; + Standard_Real u = U; + Standard_Boolean rational; + BSplCLib_DataContainer dc(Degree); + PrepareEval(u, index, dim, rational, Degree, Periodic, Poles, Weights, Knots, Mults, dc); + BSplCLib::Eval(u, Degree, *dc.knots, dim, *dc.poles); + + if (rational) + { + Standard_Real w = dc.poles[Dimension_gen]; + CoordsToPoint(P, dc.poles, / w); + } + else + CoordsToPoint(P, dc.poles, ); +} + +//================================================================================================= + +void BSplCLib::D1(const Standard_Real U, + const Standard_Integer Index, + const Standard_Integer Degree, + const Standard_Boolean Periodic, + const Array1OfPoints& Poles, + const TColStd_Array1OfReal* Weights, + const TColStd_Array1OfReal& Knots, + const TColStd_Array1OfInteger* Mults, + Point& P, + Vector& V) +{ + Standard_Integer dim, index = Index; + Standard_Real u = U; + Standard_Boolean rational; + BSplCLib_DataContainer dc(Degree); + PrepareEval(u, index, dim, rational, Degree, Periodic, Poles, Weights, Knots, Mults, dc); + BSplCLib::Bohm(u, Degree, 1, *dc.knots, dim, *dc.poles); + Standard_Real* result = dc.poles; + if (rational) + { + PLib::RationalDerivative(Degree, 1, Dimension_gen, *dc.poles, *dc.ders); + result = dc.ders; + } + + CoordsToPoint(P, result, ); + CoordsToPoint(V, result + Dimension_gen, ); +} + +//================================================================================================= + +void BSplCLib::D2(const Standard_Real U, + const Standard_Integer Index, + const Standard_Integer Degree, + const Standard_Boolean Periodic, + const Array1OfPoints& Poles, + const TColStd_Array1OfReal* Weights, + const TColStd_Array1OfReal& Knots, + const TColStd_Array1OfInteger* Mults, + Point& P, + Vector& V1, + Vector& V2) +{ + Standard_Integer dim, index = Index; + Standard_Real u = U; + Standard_Boolean rational; + BSplCLib_DataContainer dc(Degree); + PrepareEval(u, index, dim, rational, Degree, Periodic, Poles, Weights, Knots, Mults, dc); + BSplCLib::Bohm(u, Degree, 2, *dc.knots, dim, *dc.poles); + Standard_Real* result = dc.poles; + if (rational) + { + PLib::RationalDerivative(Degree, 2, Dimension_gen, *dc.poles, *dc.ders); + result = dc.ders; + } + + CoordsToPoint(P, result, ); + CoordsToPoint(V1, result + Dimension_gen, ); + if (!rational && (Degree < 2)) + NullifyPoint(V2); + else + CoordsToPoint(V2, result + 2 * Dimension_gen, ); +} + +//================================================================================================= + +void BSplCLib::D3(const Standard_Real U, + const Standard_Integer Index, + const Standard_Integer Degree, + const Standard_Boolean Periodic, + const Array1OfPoints& Poles, + const TColStd_Array1OfReal* Weights, + const TColStd_Array1OfReal& Knots, + const TColStd_Array1OfInteger* Mults, + Point& P, + Vector& V1, + Vector& V2, + Vector& V3) +{ + Standard_Integer dim, index = Index; + Standard_Real u = U; + Standard_Boolean rational; + BSplCLib_DataContainer dc(Degree); + PrepareEval(u, index, dim, rational, Degree, Periodic, Poles, Weights, Knots, Mults, dc); + BSplCLib::Bohm(u, Degree, 3, *dc.knots, dim, *dc.poles); + Standard_Real* result = dc.poles; + if (rational) + { + PLib::RationalDerivative(Degree, 3, Dimension_gen, *dc.poles, *dc.ders); + result = dc.ders; + } + + CoordsToPoint(P, result, ); + CoordsToPoint(V1, result + Dimension_gen, ); + if (!rational && (Degree < 2)) + NullifyPoint(V2); + else + CoordsToPoint(V2, result + 2 * Dimension_gen, ); + if (!rational && (Degree < 3)) + NullifyPoint(V3); + else + CoordsToPoint(V3, result + 3 * Dimension_gen, ); +} + +//================================================================================================= + +void BSplCLib::DN(const Standard_Real U, + const Standard_Integer N, + const Standard_Integer Index, + const Standard_Integer Degree, + const Standard_Boolean Periodic, + const Array1OfPoints& Poles, + const TColStd_Array1OfReal* Weights, + const TColStd_Array1OfReal& Knots, + const TColStd_Array1OfInteger* Mults, + Vector& VN) +{ + Standard_Integer dim, index = Index; + Standard_Real u = U; + Standard_Boolean rational; + BSplCLib_DataContainer dc(Degree); + PrepareEval(u, index, dim, rational, Degree, Periodic, Poles, Weights, Knots, Mults, dc); + BSplCLib::Bohm(u, Degree, N, *dc.knots, dim, *dc.poles); + + if (rational) + { + Standard_Real v[Dimension_gen]; + PLib::RationalDerivative(Degree, N, Dimension_gen, *dc.poles, v[0], Standard_False); + CoordsToPoint(VN, v, ); + } + else + { + if (N > Degree) + NullifyPoint(VN); + else + { + Standard_Real* DN = dc.poles + N * Dimension_gen; + CoordsToPoint(VN, DN, ); + } + } +} + +//================================================================================================= + +Standard_Integer BSplCLib::SolveBandedSystem(const math_Matrix& Matrix, + const Standard_Integer UpperBandWidth, + const Standard_Integer LowerBandWidth, + Array1OfPoints& PolesArray) +{ + Standard_Real* PArray; + PArray = (Standard_Real*)&PolesArray(PolesArray.Lower()); + + return BSplCLib::SolveBandedSystem(Matrix, + UpperBandWidth, + LowerBandWidth, + Dimension_gen, + PArray[0]); +} + +//======================================================================= +// function : Solves a LU factored Matrix +// purpose : if HomogeneousFlag is 1 then the input and the output +// will be homogeneous that is no division or multiplication +// by weights will happen. On the contrary if HomogeneousFlag +// is 0 then the poles will be multiplied first by the weights +// and after interpolation they will be divided by the weights +//======================================================================= + +Standard_Integer BSplCLib::SolveBandedSystem(const math_Matrix& Matrix, + const Standard_Integer UpperBandWidth, + const Standard_Integer LowerBandWidth, + const Standard_Boolean HomogeneousFlag, + Array1OfPoints& PolesArray, + TColStd_Array1OfReal& WeightsArray) +{ + Standard_Real *PArray, *WArray; + PArray = (Standard_Real*)&PolesArray(PolesArray.Lower()); + WArray = (Standard_Real*)&WeightsArray(WeightsArray.Lower()); + return BSplCLib::SolveBandedSystem(Matrix, + UpperBandWidth, + LowerBandWidth, + HomogeneousFlag, + Dimension_gen, + PArray[0], + WArray[0]); +} + +//======================================================================= +// function : Evaluates a Bspline function : uses the ExtrapMode +// purpose : the function is extrapolated using the Taylor expansion +// of degree ExtrapMode[0] to the left and the Taylor +// expansion of degree ExtrapMode[1] to the right +// if the HomogeneousFlag == True than the Poles are supposed +// to be stored homogeneously and the result will also be homogeneous +// Valid only if Weights +//======================================================================= +void BSplCLib::Eval(const Standard_Real Parameter, + const Standard_Boolean PeriodicFlag, + const Standard_Boolean HomogeneousFlag, + Standard_Integer& ExtrapMode, + const Standard_Integer Degree, + const TColStd_Array1OfReal& FlatKnots, + const Array1OfPoints& PolesArray, + const TColStd_Array1OfReal& WeightsArray, + Point& aPoint, + Standard_Real& aWeight) +{ + Standard_Real Inverse, P[Dimension_gen], *PArray, *WArray; + Standard_Integer kk; + PArray = (Standard_Real*)&PolesArray(PolesArray.Lower()); + WArray = (Standard_Real*)&WeightsArray(WeightsArray.Lower()); + if (HomogeneousFlag) + { + BSplCLib::Eval(Parameter, + PeriodicFlag, + 0, + ExtrapMode, + Degree, + FlatKnots, + Dimension_gen, + PArray[0], + P[0]); + BSplCLib::Eval(Parameter, + PeriodicFlag, + 0, + ExtrapMode, + Degree, + FlatKnots, + 1, + WArray[0], + aWeight); + } + else + { + BSplCLib::Eval(Parameter, + PeriodicFlag, + 0, + ExtrapMode, + Degree, + FlatKnots, + Dimension_gen, + PArray[0], + WArray[0], + P[0], + aWeight); + Inverse = 1.0e0 / aWeight; + + for (kk = 0; kk < Dimension_gen; kk++) + { + P[kk] *= Inverse; + } + } + + for (kk = 0; kk < Dimension_gen; kk++) + aPoint.SetCoord(kk + 1, P[kk]); +} + +//======================================================================= +// function : CacheD0 +// purpose : Evaluates the polynomial cache of the Bspline Curve +// +//======================================================================= +void BSplCLib::CacheD0(const Standard_Real Parameter, + const Standard_Integer Degree, + const Standard_Real CacheParameter, + const Standard_Real SpanLenght, + const Array1OfPoints& PolesArray, + const TColStd_Array1OfReal* WeightsArray, + Point& aPoint) +{ + // + // the CacheParameter is where the cache polynomial was evaluated in homogeneous + // form + // the SpanLenght is the normalizing factor so that the polynomial is between + // 0 and 1 + Standard_Real NewParameter, Inverse; + Standard_Real* PArray = (Standard_Real*)&(PolesArray(PolesArray.Lower())); + Standard_Real* myPoint = (Standard_Real*)&aPoint; + NewParameter = (Parameter - CacheParameter) / SpanLenght; + PLib::NoDerivativeEvalPolynomial(NewParameter, + Degree, + Dimension_gen, + Degree * Dimension_gen, + PArray[0], + myPoint[0]); + if (WeightsArray != NULL) + { + const TColStd_Array1OfReal& refWeights = *WeightsArray; + Standard_Real* WArray = (Standard_Real*)&refWeights(refWeights.Lower()); + PLib::NoDerivativeEvalPolynomial(NewParameter, Degree, 1, Degree, WArray[0], Inverse); + + Inverse = 1.0e0 / Inverse; + ModifyCoords(myPoint, *= Inverse); + } +} + +//======================================================================= +// function : CacheD1 +// purpose : Evaluates the polynomial cache of the Bspline Curve +// +//======================================================================= +void BSplCLib::CacheD1(const Standard_Real Parameter, + const Standard_Integer Degree, + const Standard_Real CacheParameter, + const Standard_Real SpanLenght, + const Array1OfPoints& PolesArray, + const TColStd_Array1OfReal* WeightsArray, + Point& aPoint, + Vector& aVector) +{ + // + // the CacheParameter is where the cache polynomial was evaluated in homogeneous + // form + // the SpanLenght is the normalizing factor so that the polynomial is between + // 0 and 1 + Standard_Real LocalPDerivatives[Dimension_gen << 1]; + // Standard_Real LocalWDerivatives[2], NewParameter, Inverse ; + Standard_Real LocalWDerivatives[2], NewParameter; + + Standard_Real* PArray = (Standard_Real*)&(PolesArray(PolesArray.Lower())); + Standard_Real* myPoint = (Standard_Real*)&aPoint; + Standard_Real* myVector = (Standard_Real*)&aVector; + NewParameter = (Parameter - CacheParameter) / SpanLenght; + PLib::EvalPolynomial(NewParameter, 1, Degree, Dimension_gen, PArray[0], LocalPDerivatives[0]); + // + // unormalize derivatives since those are computed normalized + // + + ModifyCoords(LocalPDerivatives + Dimension_gen, /= SpanLenght); + + if (WeightsArray != NULL) + { + const TColStd_Array1OfReal& refWeights = *WeightsArray; + Standard_Real* WArray = (Standard_Real*)&refWeights(refWeights.Lower()); + PLib::EvalPolynomial(NewParameter, 1, Degree, 1, WArray[0], LocalWDerivatives[0]); + // + // unormalize the result since the polynomial stored in the cache + // is normalized between 0 and 1 + // + LocalWDerivatives[1] /= SpanLenght; + + PLib::RationalDerivatives(1, + Dimension_gen, + LocalPDerivatives[0], + LocalWDerivatives[0], + LocalPDerivatives[0]); + } + + CopyCoords(myPoint, LocalPDerivatives); + CopyCoords(myVector, LocalPDerivatives + Dimension_gen); +} + +//======================================================================= +// function : CacheD2 +// purpose : Evaluates the polynomial cache of the Bspline Curve +// +//======================================================================= +void BSplCLib::CacheD2(const Standard_Real Parameter, + const Standard_Integer Degree, + const Standard_Real CacheParameter, + const Standard_Real SpanLenght, + const Array1OfPoints& PolesArray, + const TColStd_Array1OfReal* WeightsArray, + Point& aPoint, + Vector& aVector1, + Vector& aVector2) +{ + // + // the CacheParameter is where the cache polynomial was evaluated in homogeneous + // form + // the SpanLenght is the normalizing factor so that the polynomial is between + // 0 and 1 + Standard_Integer ii, Index, EndIndex; + Standard_Real LocalPDerivatives[(Dimension_gen << 1) + Dimension_gen]; + // Standard_Real LocalWDerivatives[3], NewParameter, Factor, Inverse ; + Standard_Real LocalWDerivatives[3], NewParameter, Factor; + Standard_Real* PArray = (Standard_Real*)&(PolesArray(PolesArray.Lower())); + Standard_Real* myPoint = (Standard_Real*)&aPoint; + Standard_Real* myVector1 = (Standard_Real*)&aVector1; + Standard_Real* myVector2 = (Standard_Real*)&aVector2; + NewParameter = (Parameter - CacheParameter) / SpanLenght; + PLib::EvalPolynomial(NewParameter, 2, Degree, Dimension_gen, PArray[0], LocalPDerivatives[0]); + // + // unormalize derivatives since those are computed normalized + // + Factor = 1.0e0 / SpanLenght; + Index = Dimension_gen; + EndIndex = std::min(2, Degree); + + for (ii = 1; ii <= EndIndex; ii++) + { + ModifyCoords(LocalPDerivatives + Index, *= Factor); + Factor /= SpanLenght; + Index += Dimension_gen; + } + + Index = (Degree + 1) * Dimension_gen; + for (ii = Degree; ii < 2; ii++) + { + NullifyCoords(LocalPDerivatives + Index); + Index += Dimension_gen; + } + + if (WeightsArray != NULL) + { + const TColStd_Array1OfReal& refWeights = *WeightsArray; + Standard_Real* WArray = (Standard_Real*)&refWeights(refWeights.Lower()); + + PLib::EvalPolynomial(NewParameter, 2, Degree, 1, WArray[0], LocalWDerivatives[0]); + + for (ii = Degree + 1; ii <= 2; ii++) + { + LocalWDerivatives[ii] = 0.0e0; + } + // + // unormalize the result since the polynomial stored in the cache + // is normalized between 0 and 1 + // + Factor = 1.0e0 / SpanLenght; + + for (ii = 1; ii <= EndIndex; ii++) + { + LocalWDerivatives[ii] *= Factor; + Factor /= SpanLenght; + } + PLib::RationalDerivatives(2, + Dimension_gen, + LocalPDerivatives[0], + LocalWDerivatives[0], + LocalPDerivatives[0]); + } + + CopyCoords(myPoint, LocalPDerivatives); + CopyCoords(myVector1, LocalPDerivatives + Dimension_gen); + CopyCoords(myVector2, LocalPDerivatives + Dimension_gen * 2); +} + +//======================================================================= +// function : CacheD3 +// purpose : Evaluates the polynomial cache of the Bspline Curve +// +//======================================================================= +void BSplCLib::CacheD3(const Standard_Real Parameter, + const Standard_Integer Degree, + const Standard_Real CacheParameter, + const Standard_Real SpanLenght, + const Array1OfPoints& PolesArray, + const TColStd_Array1OfReal* WeightsArray, + Point& aPoint, + Vector& aVector1, + Vector& aVector2, + Vector& aVector3) +{ + // + // the CacheParameter is where the cache polynomial was evaluated in homogeneous + // form + // the SpanLenght is the normalizing factor so that the polynomial is between + // 0 and 1 + Standard_Integer ii, Index, EndIndex; + Standard_Real LocalPDerivatives[Dimension_gen << 2]; + // Standard_Real LocalWDerivatives[4], Factor, NewParameter, Inverse ; + Standard_Real LocalWDerivatives[4], Factor, NewParameter; + Standard_Real* PArray = (Standard_Real*)&(PolesArray(PolesArray.Lower())); + Standard_Real* myPoint = (Standard_Real*)&aPoint; + Standard_Real* myVector1 = (Standard_Real*)&aVector1; + Standard_Real* myVector2 = (Standard_Real*)&aVector2; + Standard_Real* myVector3 = (Standard_Real*)&aVector3; + NewParameter = (Parameter - CacheParameter) / SpanLenght; + PLib::EvalPolynomial(NewParameter, 3, Degree, Dimension_gen, PArray[0], LocalPDerivatives[0]); + + Index = (Degree + 1) * Dimension_gen; + for (ii = Degree; ii < 3; ii++) + { + NullifyCoords(LocalPDerivatives + Index); + Index += Dimension_gen; + } + + // + // unormalize derivatives since those are computed normalized + // + Factor = 1.0e0 / SpanLenght; + Index = Dimension_gen; + EndIndex = std::min(3, Degree); + + for (ii = 1; ii <= EndIndex; ii++) + { + ModifyCoords(LocalPDerivatives + Index, *= Factor); + Factor /= SpanLenght; + Index += Dimension_gen; + } + + if (WeightsArray != NULL) + { + const TColStd_Array1OfReal& refWeights = *WeightsArray; + Standard_Real* WArray = (Standard_Real*)&refWeights(refWeights.Lower()); + + PLib::EvalPolynomial(NewParameter, 3, Degree, 1, WArray[0], LocalWDerivatives[0]); + // + // unormalize the result since the polynomial stored in the cache + // is normalized between 0 and 1 + // + Factor = 1.0e0 / SpanLenght; + + for (ii = 1; ii <= EndIndex; ii++) + { + LocalWDerivatives[ii] *= Factor; + Factor /= SpanLenght; + } + + for (ii = (Degree + 1); ii <= 3; ii++) + { + LocalWDerivatives[ii] = 0.0e0; + } + PLib::RationalDerivatives(3, + Dimension_gen, + LocalPDerivatives[0], + LocalWDerivatives[0], + LocalPDerivatives[0]); + } + + CopyCoords(myPoint, LocalPDerivatives); + CopyCoords(myVector1, LocalPDerivatives + Dimension_gen); + CopyCoords(myVector2, LocalPDerivatives + Dimension_gen * 2); + CopyCoords(myVector3, LocalPDerivatives + Dimension_gen * 3); +} + +//======================================================================= +// function : BuildCache +// purpose : Stores theTaylor expansion normalized between 0,1 in the +// Cache : in case of a rational function the Poles are +// stored in homogeneous form +//======================================================================= + +void BSplCLib::BuildCache(const Standard_Real U, + const Standard_Real SpanDomain, + const Standard_Boolean Periodic, + const Standard_Integer Degree, + const TColStd_Array1OfReal& FlatKnots, + const Array1OfPoints& Poles, + const TColStd_Array1OfReal* Weights, + Array1OfPoints& CachePoles, + TColStd_Array1OfReal* CacheWeights) +{ + Standard_Integer ii, Dimension, LocalIndex, index = 0; + Standard_Real u = U, LocalValue; + Standard_Boolean rational; + + BSplCLib_DataContainer dc(Degree); + PrepareEval(u, + index, + Dimension, + rational, + Degree, + Periodic, + Poles, + Weights, + FlatKnots, + (BSplCLib::NoMults()), + dc); + // + // Watch out : PrepareEval checks if locally the Bspline is polynomial + // therefore rational flag could be set to False even if there are + // Weights. The Dimension is set accordingly. + // + + BSplCLib::Bohm(u, Degree, Degree, *dc.knots, Dimension, *dc.poles); + + LocalValue = 1.0e0; + LocalIndex = 0; + + if (rational) + { + + for (ii = 1; ii <= Degree + 1; ii++) + { + CoordsToPoint(CachePoles(ii), dc.poles + LocalIndex, *LocalValue); + LocalIndex += Dimension_gen + 1; + LocalValue *= SpanDomain / (Standard_Real)ii; + } + + LocalIndex = Dimension_gen; + LocalValue = 1.0e0; + for (ii = 1; ii <= Degree + 1; ii++) + { + (*CacheWeights)(ii) = dc.poles[LocalIndex] * LocalValue; + LocalIndex += Dimension_gen + 1; + LocalValue *= SpanDomain / (Standard_Real)ii; + } + } + else + { + + for (ii = 1; ii <= Degree + 1; ii++) + { + CoordsToPoint(CachePoles(ii), dc.poles + LocalIndex, *LocalValue); + LocalIndex += Dimension_gen; + LocalValue *= SpanDomain / (Standard_Real)ii; + } + + if (Weights != NULL) + { + for (ii = 1; ii <= Degree + 1; ii++) + (*CacheWeights)(ii) = 0.0e0; + (*CacheWeights)(1) = 1.0e0; + } + } +} + +void BSplCLib::BuildCache(const Standard_Real theParameter, + const Standard_Real theSpanDomain, + const Standard_Boolean thePeriodicFlag, + const Standard_Integer theDegree, + const Standard_Integer theSpanIndex, + const TColStd_Array1OfReal& theFlatKnots, + const Array1OfPoints& thePoles, + const TColStd_Array1OfReal* theWeights, + TColStd_Array2OfReal& theCacheArray) +{ + Standard_Real aParam = theParameter; + Standard_Integer anIndex = theSpanIndex; + Standard_Integer aDimension; + Standard_Boolean isRational; + + BSplCLib_DataContainer dc(theDegree); + PrepareEval(aParam, + anIndex, + aDimension, + isRational, + theDegree, + thePeriodicFlag, + thePoles, + theWeights, + theFlatKnots, + (BSplCLib::NoMults()), + dc); + // + // Watch out : PrepareEval checks if locally the Bspline is polynomial + // therefore rational flag could be set to False even if there are + // Weights. The Dimension is set accordingly. + // + + Standard_Integer aCacheShift = // helps to store weights when PrepareEval did not found that the + // curve is locally polynomial + (theWeights != NULL && !isRational) ? aDimension + 1 : aDimension; + + BSplCLib::Bohm(aParam, theDegree, theDegree, *dc.knots, aDimension, *dc.poles); + + Standard_Real aCoeff = 1.0; + Standard_Real* aCache = + (Standard_Real*)&(theCacheArray(theCacheArray.LowerRow(), theCacheArray.LowerCol())); + Standard_Real* aPolyCoeffs = dc.poles; + + for (Standard_Integer i = 0; i <= theDegree; i++) + { + for (Standard_Integer j = 0; j < aDimension; j++) + aCache[j] = aPolyCoeffs[j] * aCoeff; + aCoeff *= theSpanDomain / (i + 1); + aPolyCoeffs += aDimension; + aCache += aDimension; + if (aCacheShift > aDimension) + { + aCache[0] = 0.0; + aCache++; + } + } + + if (aCacheShift > aDimension) + theCacheArray.SetValue(theCacheArray.LowerRow(), + theCacheArray.LowerCol() + aCacheShift - 1, + 1.0); +} + +//================================================================================================= + +void BSplCLib::Interpolate(const Standard_Integer Degree, + const TColStd_Array1OfReal& FlatKnots, + const TColStd_Array1OfReal& Parameters, + const TColStd_Array1OfInteger& ContactOrderArray, + Array1OfPoints& Poles, + Standard_Integer& InversionProblem) + +{ + Standard_Real* PArray; + + PArray = (Standard_Real*)&Poles(Poles.Lower()); + + BSplCLib::Interpolate(Degree, + FlatKnots, + Parameters, + ContactOrderArray, + Dimension_gen, + PArray[0], + InversionProblem); +} + +//================================================================================================= + +void BSplCLib::Interpolate(const Standard_Integer Degree, + const TColStd_Array1OfReal& FlatKnots, + const TColStd_Array1OfReal& Parameters, + const TColStd_Array1OfInteger& ContactOrderArray, + Array1OfPoints& Poles, + TColStd_Array1OfReal& Weights, + Standard_Integer& InversionProblem) +{ + Standard_Real *PArray, *WArray; + PArray = (Standard_Real*)&Poles(Poles.Lower()); + WArray = (Standard_Real*)&Weights(Weights.Lower()); + BSplCLib::Interpolate(Degree, + FlatKnots, + Parameters, + ContactOrderArray, + Dimension_gen, + PArray[0], + WArray[0], + InversionProblem); +} + +//======================================================================= +// function : MovePoint +// purpose : Find the new poles which allows an old point (with a +// given u as parameter) to reach a new position +//======================================================================= + +void BSplCLib::MovePoint(const Standard_Real U, + const Vector& Displ, + const Standard_Integer Index1, + const Standard_Integer Index2, + const Standard_Integer Degree, + const Array1OfPoints& Poles, + const TColStd_Array1OfReal* Weights, + const TColStd_Array1OfReal& FlatKnots, + Standard_Integer& FirstIndex, + Standard_Integer& LastIndex, + Array1OfPoints& NewPoles) +{ + // calculate the BSplineBasis in the parameter U + Standard_Integer FirstNonZeroBsplineIndex; + math_Matrix BSplineBasis(1, 1, 1, Degree + 1); + Standard_Integer ErrorCode = + BSplCLib::EvalBsplineBasis(0, Degree + 1, FlatKnots, U, FirstNonZeroBsplineIndex, BSplineBasis); + if (ErrorCode != 0) + { + FirstIndex = 0; + LastIndex = 0; + + for (Standard_Integer i = Poles.Lower(); i <= Poles.Upper(); i++) + { + NewPoles(i) = Poles(i); + } + return; + } + + // find the span which is predominant for parameter U + FirstIndex = FirstNonZeroBsplineIndex; + LastIndex = FirstNonZeroBsplineIndex + Degree; + if (FirstIndex < Index1) + FirstIndex = Index1; + if (LastIndex > Index2) + LastIndex = Index2; + + Standard_Real maxValue = 0.0; + Standard_Integer i, kk1 = 0, kk2, ii; + + for (i = FirstIndex - FirstNonZeroBsplineIndex + 1; i <= LastIndex - FirstNonZeroBsplineIndex + 1; + i++) + { + if (BSplineBasis(1, i) > maxValue) + { + kk1 = i + FirstNonZeroBsplineIndex - 1; + maxValue = BSplineBasis(1, i); + } + } + + // find a kk2 if symmetry + kk2 = kk1; + i = kk1 - FirstNonZeroBsplineIndex + 2; + if ((kk1 + 1) <= LastIndex) + { + if (std::abs(BSplineBasis(1, kk1 - FirstNonZeroBsplineIndex + 2) - maxValue) < 1.e-10) + { + kk2 = kk1 + 1; + } + } + + // compute the vector of displacement + Standard_Real D1 = 0.0; + Standard_Real D2 = 0.0; + Standard_Real hN, Coef, Dval; + + for (i = 1; i <= Degree + 1; i++) + { + ii = i + FirstNonZeroBsplineIndex - 1; + if (Weights != NULL) + { + hN = Weights->Value(ii) * BSplineBasis(1, i); + D2 += hN; + } + else + { + hN = BSplineBasis(1, i); + } + if (ii >= FirstIndex && ii <= LastIndex) + { + if (ii < kk1) + { + Dval = kk1 - ii; + } + else if (ii > kk2) + { + Dval = ii - kk2; + } + else + { + Dval = 0.0; + } + D1 += 1. / (Dval + 1.) * hN; + } + } + + if (Weights != NULL) + { + Coef = D2 / D1; + } + else + { + Coef = 1. / D1; + } + + // compute the new poles + + for (i = Poles.Lower(); i <= Poles.Upper(); i++) + { + if (i >= FirstIndex && i <= LastIndex) + { + if (i < kk1) + { + Dval = kk1 - i; + } + else if (i > kk2) + { + Dval = i - kk2; + } + else + { + Dval = 0.0; + } + NewPoles(i) = Poles(i).Translated((Coef / (Dval + 1.)) * Displ); + } + else + { + NewPoles(i) = Poles(i); + } + } +} + +//======================================================================= +// function : MovePoint +// purpose : Find the new poles which allows an old point (with a +// given u as parameter) to reach a new position +//======================================================================= + +//================================================================================================= + +void BSplCLib::MovePointAndTangent(const Standard_Real U, + const Vector& Delta, + const Vector& DeltaDerivatives, + const Standard_Real Tolerance, + const Standard_Integer Degree, + const Standard_Integer StartingCondition, + const Standard_Integer EndingCondition, + const Array1OfPoints& Poles, + const TColStd_Array1OfReal* Weights, + const TColStd_Array1OfReal& FlatKnots, + Array1OfPoints& NewPoles, + Standard_Integer& ErrorStatus) +{ + Standard_Real *delta_array, *delta_derivative_array, *poles_array, *new_poles_array; + + Standard_Integer num_poles; + num_poles = Poles.Length(); + + if (NewPoles.Length() != num_poles) + { + throw Standard_ConstructionError(); + } + delta_array = (Standard_Real*)Δ + delta_derivative_array = (Standard_Real*)&DeltaDerivatives; + poles_array = (Standard_Real*)&Poles(Poles.Lower()); + + new_poles_array = (Standard_Real*)&NewPoles(NewPoles.Lower()); + MovePointAndTangent(U, + Dimension_gen, + delta_array[0], + delta_derivative_array[0], + Tolerance, + Degree, + StartingCondition, + EndingCondition, + poles_array[0], + Weights, + FlatKnots, + new_poles_array[0], + ErrorStatus); +} + +//================================================================================================= + +void BSplCLib::Resolution(const Array1OfPoints& Poles, + const TColStd_Array1OfReal* Weights, + const Standard_Integer NumPoles, + const TColStd_Array1OfReal& FlatKnots, + const Standard_Integer Degree, + const Standard_Real Tolerance3D, + Standard_Real& UTolerance) +{ + Standard_Real* PolesArray; + PolesArray = (Standard_Real*)&Poles(Poles.Lower()); + BSplCLib::Resolution(PolesArray[0], + Dimension_gen, + NumPoles, + Weights, + FlatKnots, + Degree, + Tolerance3D, + UTolerance); +} + +//================================================================================================= + +void BSplCLib::FunctionMultiply(const BSplCLib_EvaluatorFunction& FunctionPtr, + const Standard_Integer BSplineDegree, + const TColStd_Array1OfReal& BSplineFlatKnots, + const Array1OfPoints& Poles, + const TColStd_Array1OfReal& FlatKnots, + const Standard_Integer NewDegree, + Array1OfPoints& NewPoles, + Standard_Integer& theStatus) +{ + Standard_Integer num_bspline_poles = BSplineFlatKnots.Length() - BSplineDegree - 1; + Standard_Integer num_new_poles = FlatKnots.Length() - NewDegree - 1; + + if (Poles.Length() != num_bspline_poles || NewPoles.Length() != num_new_poles) + { + throw Standard_ConstructionError(); + } + Standard_Real* array_of_poles = (Standard_Real*)&Poles(Poles.Lower()); + Standard_Real* array_of_new_poles = (Standard_Real*)&NewPoles(NewPoles.Lower()); + BSplCLib::FunctionMultiply(FunctionPtr, + BSplineDegree, + BSplineFlatKnots, + Dimension_gen, + array_of_poles[0], + FlatKnots, + NewDegree, + array_of_new_poles[0], + theStatus); +} + +//================================================================================================= + +void BSplCLib::FunctionReparameterise(const BSplCLib_EvaluatorFunction& FunctionPtr, + const Standard_Integer BSplineDegree, + const TColStd_Array1OfReal& BSplineFlatKnots, + const Array1OfPoints& Poles, + const TColStd_Array1OfReal& FlatKnots, + const Standard_Integer NewDegree, + Array1OfPoints& NewPoles, + Standard_Integer& theStatus) +{ + Standard_Integer num_bspline_poles = BSplineFlatKnots.Length() - BSplineDegree - 1; + Standard_Integer num_new_poles = FlatKnots.Length() - NewDegree - 1; + + if (Poles.Length() != num_bspline_poles || NewPoles.Length() != num_new_poles) + { + throw Standard_ConstructionError(); + } + Standard_Real* array_of_poles = (Standard_Real*)&Poles(Poles.Lower()); + Standard_Real* array_of_new_poles = (Standard_Real*)&NewPoles(NewPoles.Lower()); + BSplCLib::FunctionReparameterise(FunctionPtr, + BSplineDegree, + BSplineFlatKnots, + Dimension_gen, + array_of_poles[0], + FlatKnots, + NewDegree, + array_of_new_poles[0], + theStatus); +} diff --git a/src/FoundationClasses/TKMath/BSplCLib/BSplCLib_CurveComputation.pxx b/src/FoundationClasses/TKMath/BSplCLib/BSplCLib_CurveComputation.pxx index 5104fd7f41..d37217e7c9 100644 --- a/src/FoundationClasses/TKMath/BSplCLib/BSplCLib_CurveComputation.pxx +++ b/src/FoundationClasses/TKMath/BSplCLib/BSplCLib_CurveComputation.pxx @@ -1259,7 +1259,7 @@ void BSplCLib_CacheD2(const Standard_Real Parameter, Factor = 1.0e0 / SpanLenght; Index = Dimension; - EndIndex = Min(2, Degree); + EndIndex = std::min(2, Degree); for (ii = 1; ii <= EndIndex; ii++) { @@ -1351,7 +1351,7 @@ void BSplCLib_CacheD3(const Standard_Real Parameter, Factor = 1.0e0 / SpanLenght; Index = Dimension; - EndIndex = Min(3, Degree); + EndIndex = std::min(3, Degree); for (ii = 1; ii <= EndIndex; ii++) { @@ -1670,7 +1670,7 @@ void BSplCLib_MovePoint(const Standard_Real U, i = kk1 - FirstNonZeroBsplineIndex + 2; if ((kk1 + 1) <= LastIndex) { - if (Abs(BSplineBasis(1, kk1 - FirstNonZeroBsplineIndex + 2) - maxValue) < 1.e-10) + if (std::abs(BSplineBasis(1, kk1 - FirstNonZeroBsplineIndex + 2) - maxValue) < 1.e-10) { kk2 = kk1 + 1; } diff --git a/src/FoundationClasses/TKMath/BSplSLib/BSplSLib.cxx b/src/FoundationClasses/TKMath/BSplSLib/BSplSLib.cxx index 7a2cf1086e..ddf377e492 100644 --- a/src/FoundationClasses/TKMath/BSplSLib/BSplSLib.cxx +++ b/src/FoundationClasses/TKMath/BSplSLib/BSplSLib.cxx @@ -1419,7 +1419,7 @@ void BSplSLib::DN(const Standard_Real U, BSplCLib::Bohm(u1, d1, n1, *dc.knots1, dim * (d2 + 1), *dc.poles); - for (k = 0; k <= Min(n1, d1); k++) + for (k = 0; k <= std::min(n1, d1); k++) BSplCLib::Bohm(u2, d2, n2, *dc.knots2, dim, *(dc.poles + k * dim * (d2 + 1))); Standard_Real* result; @@ -1725,7 +1725,8 @@ Standard_Boolean BSplSLib::IsRational(const TColStd_Array2OfReal& Weights, for (j = J1 - fj; j < J2 - fj; j++) { - if (Abs(Weights(fi + i % li, fj + j % lj) - Weights(fi + (i + 1) % li, fj + j % lj)) > eps) + if (std::abs(Weights(fi + i % li, fj + j % lj) - Weights(fi + (i + 1) % li, fj + j % lj)) + > eps) return Standard_True; } } @@ -3093,7 +3094,7 @@ void BSplSLib::MovePoint(const Standard_Real U, i = ukk1 - UFirstNonZeroBsplineIndex + 2; if ((ukk1 + 1) <= ULastIndex) { - if (Abs(UBSplineBasis(1, ukk1 - UFirstNonZeroBsplineIndex + 2) - maxValue) < 1.e-10) + if (std::abs(UBSplineBasis(1, ukk1 - UFirstNonZeroBsplineIndex + 2) - maxValue) < 1.e-10) { ukk2 = ukk1 + 1; } @@ -3127,7 +3128,7 @@ void BSplSLib::MovePoint(const Standard_Real U, j = vkk1 - VFirstNonZeroBsplineIndex + 2; if ((vkk1 + 1) <= VLastIndex) { - if (Abs(VBSplineBasis(1, vkk1 - VFirstNonZeroBsplineIndex + 2) - maxValue) < 1.e-10) + if (std::abs(VBSplineBasis(1, vkk1 - VFirstNonZeroBsplineIndex + 2) - maxValue) < 1.e-10) { vkk2 = vkk1 + 1; } diff --git a/src/FoundationClasses/TKMath/BSplSLib/BSplSLib.hxx b/src/FoundationClasses/TKMath/BSplSLib/BSplSLib.hxx index 1a83028bb1..fc090e3053 100644 --- a/src/FoundationClasses/TKMath/BSplSLib/BSplSLib.hxx +++ b/src/FoundationClasses/TKMath/BSplSLib/BSplSLib.hxx @@ -106,8 +106,8 @@ public: //! , x(u,v) is a vector in dimension <3>. //! //! is an array containing the values of the - //! input derivatives from 0 to Min(,), 0 to - //! Min(,). For orders higher than + //! input derivatives from 0 to std::min(,), 0 to + //! std::min(,). For orders higher than //! the input derivatives are assumed to //! be 0. //! @@ -152,7 +152,7 @@ public: //! //! If is true multiples derivatives are //! computed. All the derivatives (i,j) with 0 <= i+j - //! <= Max(N,M) are computed. is an array of + //! <= std::max(N,M) are computed. is an array of //! length 3 * (+1) * (+1) which will contains: //! //! x(1)/w , x(2)/w , ... diff --git a/src/FoundationClasses/TKMath/BSplSLib/BSplSLib_Cache.cxx b/src/FoundationClasses/TKMath/BSplSLib/BSplSLib_Cache.cxx index a8dab7fba5..68c0da511f 100644 --- a/src/FoundationClasses/TKMath/BSplSLib/BSplSLib_Cache.cxx +++ b/src/FoundationClasses/TKMath/BSplSLib/BSplSLib_Cache.cxx @@ -39,8 +39,8 @@ BSplSLib_Cache::BSplSLib_Cache(const Standard_Integer& theDegreeU, myParamsU(theDegreeU, thePeriodicU, theFlatKnotsU), myParamsV(theDegreeV, thePeriodicV, theFlatKnotsV) { - Standard_Integer aMinDegree = Min(theDegreeU, theDegreeV); - Standard_Integer aMaxDegree = Max(theDegreeU, theDegreeV); + Standard_Integer aMinDegree = std::min(theDegreeU, theDegreeV); + Standard_Integer aMaxDegree = std::max(theDegreeU, theDegreeV); Standard_Integer aPWColNumber = (myIsRational ? 4 : 3); myPolesWeights = new TColStd_HArray2OfReal(1, aMaxDegree + 1, 1, aPWColNumber * (aMinDegree + 1)); } @@ -114,8 +114,8 @@ void BSplSLib_Cache::D0(const Standard_Real& theU, Standard_Integer aDimension = myIsRational ? 4 : 3; Standard_Integer aCacheCols = myPolesWeights->RowLength(); - Standard_Integer aMinMaxDegree[2] = {Min(myParamsU.Degree, myParamsV.Degree), - Max(myParamsU.Degree, myParamsV.Degree)}; + Standard_Integer aMinMaxDegree[2] = {std::min(myParamsU.Degree, myParamsV.Degree), + std::max(myParamsU.Degree, myParamsV.Degree)}; Standard_Real aParameters[2]; if (myParamsU.Degree > myParamsV.Degree) { @@ -182,8 +182,8 @@ void BSplSLib_Cache::D1(const Standard_Real& theU, Standard_Integer aDimension = myIsRational ? 4 : 3; Standard_Integer aCacheCols = myPolesWeights->RowLength(); - Standard_Integer aMinMaxDegree[2] = {Min(myParamsU.Degree, myParamsV.Degree), - Max(myParamsU.Degree, myParamsV.Degree)}; + Standard_Integer aMinMaxDegree[2] = {std::min(myParamsU.Degree, myParamsV.Degree), + std::max(myParamsU.Degree, myParamsV.Degree)}; Standard_Real aParameters[2]; if (myParamsU.Degree > myParamsV.Degree) @@ -284,8 +284,8 @@ void BSplSLib_Cache::D2(const Standard_Real& theU, Standard_Integer aDimension = myIsRational ? 4 : 3; Standard_Integer aCacheCols = myPolesWeights->RowLength(); - Standard_Integer aMinMaxDegree[2] = {Min(myParamsU.Degree, myParamsV.Degree), - Max(myParamsU.Degree, myParamsV.Degree)}; + Standard_Integer aMinMaxDegree[2] = {std::min(myParamsU.Degree, myParamsV.Degree), + std::max(myParamsU.Degree, myParamsV.Degree)}; Standard_Real aParameters[2]; if (myParamsU.Degree > myParamsV.Degree) @@ -304,7 +304,7 @@ void BSplSLib_Cache::D2(const Standard_Real& theU, // Calculating derivative to be evaluate and // nulling transient coefficients when max or min derivative is less than 2 // clang-format on - Standard_Integer aMinMaxDeriv[2] = {Min(2, aMinMaxDegree[0]), Min(2, aMinMaxDegree[1])}; + Standard_Integer aMinMaxDeriv[2] = {std::min(2, aMinMaxDegree[0]), std::min(2, aMinMaxDegree[1])}; for (Standard_Integer i = aMinMaxDeriv[1] + 1; i < 3; i++) { Standard_Integer index = i * aCacheCols; diff --git a/src/FoundationClasses/TKMath/BVH/BVH_BinaryTree.hxx b/src/FoundationClasses/TKMath/BVH/BVH_BinaryTree.hxx index b35bca87df..3946275d8f 100644 --- a/src/FoundationClasses/TKMath/BVH/BVH_BinaryTree.hxx +++ b/src/FoundationClasses/TKMath/BVH/BVH_BinaryTree.hxx @@ -273,7 +273,7 @@ BVH_Tree* BVH_Tree::CollapseToQuadTree aGrandChildNodes.Size() - 1, std::get<1>(aNode) /* level */); - aQBVH->myDepth = Max(aQBVH->myDepth, std::get<1>(aNode) + 1); + aQBVH->myDepth = (std::max)(aQBVH->myDepth, std::get<1>(aNode) + 1); aNbNodes += aGrandChildNodes.Size(); } diff --git a/src/FoundationClasses/TKMath/BVH/BVH_BinnedBuilder.hxx b/src/FoundationClasses/TKMath/BVH/BVH_BinnedBuilder.hxx index e7b88d493b..ca5dde4134 100644 --- a/src/FoundationClasses/TKMath/BVH/BVH_BinnedBuilder.hxx +++ b/src/FoundationClasses/TKMath/BVH/BVH_BinnedBuilder.hxx @@ -242,7 +242,7 @@ typename BVH_QueueBuilder::BVH_ChildNodes BVH_BinnedBuilder::b // Find best split for (Standard_Integer anAxis = myUseMainAxis ? aMainAxis : 0; - anAxis <= (myUseMainAxis ? aMainAxis : Min(N - 1, 2)); + anAxis <= (myUseMainAxis ? aMainAxis : (std::min)(N - 1, 2)); ++anAxis) { if (BVH::VecComp::Get(aSize, anAxis) <= BVH::THE_NODE_MIN_SIZE) @@ -301,8 +301,8 @@ typename BVH_QueueBuilder::BVH_ChildNodes BVH_BinnedBuilder::b aMinSplitBoxRgh.Clear(); aMiddle = - std::max(aNodeBegPrimitive + 1, - static_cast((aNodeBegPrimitive + aNodeEndPrimitive) / 2.f)); + (std::max)(aNodeBegPrimitive + 1, + static_cast((aNodeBegPrimitive + aNodeEndPrimitive) / 2.f)); aMinSplitNumLft = aMiddle - aNodeBegPrimitive; for (Standard_Integer anIndex = aNodeBegPrimitive; anIndex < aMiddle; ++anIndex) diff --git a/src/FoundationClasses/TKMath/BVH/BVH_Box.hxx b/src/FoundationClasses/TKMath/BVH/BVH_Box.hxx index 3d8542e6ba..cbf6ca1722 100644 --- a/src/FoundationClasses/TKMath/BVH/BVH_Box.hxx +++ b/src/FoundationClasses/TKMath/BVH/BVH_Box.hxx @@ -104,8 +104,8 @@ public: Standard_Real anOffset1 = aMatValue * anOldMinPnt.GetData()[aCol]; Standard_Real anOffset2 = aMatValue * anOldMaxPnt.GetData()[aCol]; - aNewMinPnt.ChangeData()[aRow] += Min(anOffset1, anOffset2); - aNewMaxPnt.ChangeData()[aRow] += Max(anOffset1, anOffset2); + aNewMinPnt.ChangeData()[aRow] += (std::min)(anOffset1, anOffset2); + aNewMaxPnt.ChangeData()[aRow] += (std::max)(anOffset1, anOffset2); } } @@ -203,7 +203,7 @@ public: (void)theDepth; OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, myIsInited) - int n = Min(N, 3); + int n = (std::min)(N, 3); if (n == 1) { OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, myMinPoint[0]) @@ -242,7 +242,7 @@ public: OCCT_INIT_FIELD_VALUE_INTEGER(aStreamStr, aPos, anIsInited); myIsInited = anIsInited != 0; - int n = Min(N, 3); + int n = (std::min)(N, 3); if (n == 1) { Standard_Real aValue; @@ -294,7 +294,7 @@ public: if (!IsValid()) return Standard_True; - int n = Min(N, 3); + int n = (std::min)(N, 3); for (int i = 0; i < n; ++i) { if (myMinPoint[i] > theMaxPoint[i] || myMaxPoint[i] < theMinPoint[i]) @@ -324,7 +324,7 @@ public: Standard_Boolean isInside = Standard_True; - int n = Min(N, 3); + int n = (std::min)(N, 3); for (int i = 0; i < n; ++i) { hasOverlap = (myMinPoint[i] <= theMaxPoint[i] && myMaxPoint[i] >= theMinPoint[i]); @@ -342,7 +342,7 @@ public: if (!IsValid()) return Standard_True; - int n = Min(N, 3); + int n = (std::min)(N, 3); for (int i = 0; i < n; ++i) { if (thePoint[i] < myMinPoint[i] || thePoint[i] > myMaxPoint[i]) @@ -499,16 +499,16 @@ struct BoxMinMax static void CwiseMin(BVH_VecNt& theVec1, const BVH_VecNt& theVec2) { - theVec1.x() = Min(theVec1.x(), theVec2.x()); - theVec1.y() = Min(theVec1.y(), theVec2.y()); - theVec1.z() = Min(theVec1.z(), theVec2.z()); + theVec1.x() = (std::min)(theVec1.x(), theVec2.x()); + theVec1.y() = (std::min)(theVec1.y(), theVec2.y()); + theVec1.z() = (std::min)(theVec1.z(), theVec2.z()); } static void CwiseMax(BVH_VecNt& theVec1, const BVH_VecNt& theVec2) { - theVec1.x() = Max(theVec1.x(), theVec2.x()); - theVec1.y() = Max(theVec1.y(), theVec2.y()); - theVec1.z() = Max(theVec1.z(), theVec2.z()); + theVec1.x() = (std::max)(theVec1.x(), theVec2.x()); + theVec1.y() = (std::max)(theVec1.y(), theVec2.y()); + theVec1.z() = (std::max)(theVec1.z(), theVec2.z()); } }; @@ -519,14 +519,14 @@ struct BoxMinMax static void CwiseMin(BVH_VecNt& theVec1, const BVH_VecNt& theVec2) { - theVec1.x() = Min(theVec1.x(), theVec2.x()); - theVec1.y() = Min(theVec1.y(), theVec2.y()); + theVec1.x() = (std::min)(theVec1.x(), theVec2.x()); + theVec1.y() = (std::min)(theVec1.y(), theVec2.y()); } static void CwiseMax(BVH_VecNt& theVec1, const BVH_VecNt& theVec2) { - theVec1.x() = Max(theVec1.x(), theVec2.x()); - theVec1.y() = Max(theVec1.y(), theVec2.y()); + theVec1.x() = (std::max)(theVec1.x(), theVec2.x()); + theVec1.y() = (std::max)(theVec1.y(), theVec2.y()); } }; } // namespace BVH diff --git a/src/FoundationClasses/TKMath/BVH/BVH_DistanceField.lxx b/src/FoundationClasses/TKMath/BVH/BVH_DistanceField.lxx index a61c5ae236..bdb2f86a05 100644 --- a/src/FoundationClasses/TKMath/BVH/BVH_DistanceField.lxx +++ b/src/FoundationClasses/TKMath/BVH/BVH_DistanceField.lxx @@ -65,9 +65,9 @@ T DistanceToBox(const typename VectorType::Type& thePnt, { Standard_STATIC_ASSERT(N == 3 || N == 4); - T aNearestX = Min(Max(thePnt.x(), theMin.x()), theMax.x()); - T aNearestY = Min(Max(thePnt.y(), theMin.y()), theMax.y()); - T aNearestZ = Min(Max(thePnt.z(), theMin.z()), theMax.z()); + T aNearestX = std::min(std::max(thePnt.x(), theMin.x()), theMax.x()); + T aNearestY = std::min(std::max(thePnt.y(), theMin.y()), theMax.y()); + T aNearestZ = std::min(std::max(thePnt.z(), theMin.z()), theMax.z()); if (aNearestX == thePnt.x() && aNearestY == thePnt.y() && aNearestZ == thePnt.z()) { @@ -423,15 +423,16 @@ Standard_Boolean BVH_DistanceField::Build(BVH_Geometry& theGeometry) const BVH_VecNt aGlobalBoxSize = theGeometry.Box().Size(); - const T aMaxBoxSide = Max(Max(aGlobalBoxSize.x(), aGlobalBoxSize.y()), aGlobalBoxSize.z()); + const T aMaxBoxSide = + std::max(std::max(aGlobalBoxSize.x(), aGlobalBoxSize.y()), aGlobalBoxSize.z()); myDimensionX = static_cast(myMaximumSize * aGlobalBoxSize.x() / aMaxBoxSide); myDimensionY = static_cast(myMaximumSize * aGlobalBoxSize.y() / aMaxBoxSide); myDimensionZ = static_cast(myMaximumSize * aGlobalBoxSize.z() / aMaxBoxSide); - myDimensionX = Min(myMaximumSize, Max(myDimensionX, 16)); - myDimensionY = Min(myMaximumSize, Max(myDimensionY, 16)); - myDimensionZ = Min(myMaximumSize, Max(myDimensionZ, 16)); + myDimensionX = std::min(myMaximumSize, std::max(myDimensionX, 16)); + myDimensionY = std::min(myMaximumSize, std::max(myDimensionY, 16)); + myDimensionZ = std::min(myMaximumSize, std::max(myDimensionZ, 16)); const BVH_VecNt aGlobalBoxMin = theGeometry.Box().CornerMin(); const BVH_VecNt aGlobalBoxMax = theGeometry.Box().CornerMax(); diff --git a/src/FoundationClasses/TKMath/BVH/BVH_LinearBuilder.hxx b/src/FoundationClasses/TKMath/BVH/BVH_LinearBuilder.hxx index 3a7eed183e..1777830c67 100644 --- a/src/FoundationClasses/TKMath/BVH/BVH_LinearBuilder.hxx +++ b/src/FoundationClasses/TKMath/BVH/BVH_LinearBuilder.hxx @@ -187,7 +187,7 @@ Standard_Integer UpdateBounds(BVH_Set* theSet, theTree->MinPointBuffer()[theNode] = aLftMinPoint; theTree->MaxPointBuffer()[theNode] = aLftMaxPoint; - return Max(aLftDepth, aRghDepth) + 1; + return (std::max)(aLftDepth, aRghDepth) + 1; } else { @@ -295,7 +295,7 @@ public: theData.myBVH->MinPointBuffer()[theData.myNode] = aLftMinPoint; theData.myBVH->MaxPointBuffer()[theData.myNode] = aLftMaxPoint; - *theData.myHeight = Max(aLftHeight, aRghHeight) + 1; + *theData.myHeight = (std::max)(aLftHeight, aRghHeight) + 1; } } diff --git a/src/FoundationClasses/TKMath/BVH/BVH_RadixSorter.hxx b/src/FoundationClasses/TKMath/BVH/BVH_RadixSorter.hxx index cfd8388fba..6d4f63572f 100644 --- a/src/FoundationClasses/TKMath/BVH/BVH_RadixSorter.hxx +++ b/src/FoundationClasses/TKMath/BVH/BVH_RadixSorter.hxx @@ -211,7 +211,8 @@ void BVH_RadixSorter::Perform(BVH_Set* theSet, { const Standard_Integer aVoxelI = BVH::IntFloor(BVH::VecComp::Get(aVoxelF, aCompIter)); - unsigned int aVoxel = static_cast(Max(0, Min(aVoxelI, aDimension - 1))); + unsigned int aVoxel = + static_cast((std::max)(0, (std::min)(aVoxelI, aDimension - 1))); aVoxel = (aVoxel | (aVoxel << 16)) & 0x030000FF; aVoxel = (aVoxel | (aVoxel << 8)) & 0x0300F00F; diff --git a/src/FoundationClasses/TKMath/BVH/BVH_Tools.hxx b/src/FoundationClasses/TKMath/BVH/BVH_Tools.hxx index 811e5de679..54d4bc0e26 100644 --- a/src/FoundationClasses/TKMath/BVH/BVH_Tools.hxx +++ b/src/FoundationClasses/TKMath/BVH/BVH_Tools.hxx @@ -335,12 +335,12 @@ public: //! @name Ray-Box Intersection BVH_VecNt aTimeMin, aTimeMax; for (int i = 0; i < N; ++i) { - aTimeMin[i] = Min(aNodeMin[i], aNodeMax[i]); - aTimeMax[i] = Max(aNodeMin[i], aNodeMax[i]); + aTimeMin[i] = (std::min)(aNodeMin[i], aNodeMax[i]); + aTimeMax[i] = (std::max)(aNodeMin[i], aNodeMax[i]); } - T aTimeEnter = Max(aTimeMin[0], Max(aTimeMin[1], aTimeMin[2])); - T aTimeLeave = Min(aTimeMax[0], Min(aTimeMax[1], aTimeMax[2])); + T aTimeEnter = (std::max)(aTimeMin[0], (std::max)(aTimeMin[1], aTimeMin[2])); + T aTimeLeave = (std::min)(aTimeMax[0], (std::min)(aTimeMax[1], aTimeMax[2])); Standard_Boolean hasIntersection = aTimeEnter <= aTimeLeave && aTimeLeave >= 0; if (hasIntersection) diff --git a/src/FoundationClasses/TKMath/Bnd/Bnd_B2.hxx b/src/FoundationClasses/TKMath/Bnd/Bnd_B2.hxx index 243e60c542..00c52813df 100644 --- a/src/FoundationClasses/TKMath/Bnd/Bnd_B2.hxx +++ b/src/FoundationClasses/TKMath/Bnd/Bnd_B2.hxx @@ -127,12 +127,12 @@ public: protected: static Standard_Boolean compareDist(const RealType aHSize[2], const RealType aDist[2]) { - return (Abs(aDist[0]) > aHSize[0] || Abs(aDist[1]) > aHSize[1]); + return (std::abs(aDist[0]) > aHSize[0] || std::abs(aDist[1]) > aHSize[1]); } static Standard_Boolean compareDistD(const gp_XY& aHSize, const gp_XY& aDist) { - return (Abs(aDist.X()) > aHSize.X() || Abs(aDist.Y()) > aHSize.Y()); + return (std::abs(aDist.X()) > aHSize.X() || std::abs(aDist.Y()) > aHSize.Y()); } //! Constant representing a very large value for void box initialization @@ -248,7 +248,7 @@ inline void Bnd_B2::SetHSize(const gp_XY& theHSize) template inline void Bnd_B2::Enlarge(const Standard_Real aDiff) { - const RealType aD = RealType(Abs(aDiff)); + const RealType aD = RealType(std::abs(aDiff)); myHSize[0] += aD; myHSize[1] += aD; } @@ -258,8 +258,8 @@ inline void Bnd_B2::Enlarge(const Standard_Real aDiff) template inline Standard_Boolean Bnd_B2::IsOut(const gp_XY& thePnt) const { - return (Abs(RealType(thePnt.X()) - myCenter[0]) > myHSize[0] - || Abs(RealType(thePnt.Y()) - myCenter[1]) > myHSize[1]); + return (std::abs(RealType(thePnt.X()) - myCenter[0]) > myHSize[0] + || std::abs(RealType(thePnt.Y()) - myCenter[1]) > myHSize[1]); } //================================================================================================= @@ -267,8 +267,8 @@ inline Standard_Boolean Bnd_B2::IsOut(const gp_XY& thePnt) const template inline Standard_Boolean Bnd_B2::IsOut(const Bnd_B2& theBox) const { - return (Abs(theBox.myCenter[0] - myCenter[0]) > theBox.myHSize[0] + myHSize[0] - || Abs(theBox.myCenter[1] - myCenter[1]) > theBox.myHSize[1] + myHSize[1]); + return (std::abs(theBox.myCenter[0] - myCenter[0]) > theBox.myHSize[0] + myHSize[0] + || std::abs(theBox.myCenter[1] - myCenter[1]) > theBox.myHSize[1] + myHSize[1]); } //================================================================================================= @@ -276,8 +276,8 @@ inline Standard_Boolean Bnd_B2::IsOut(const Bnd_B2& theBox) template inline Standard_Boolean Bnd_B2::IsIn(const Bnd_B2& theBox) const { - return (Abs(theBox.myCenter[0] - myCenter[0]) < theBox.myHSize[0] - myHSize[0] - && Abs(theBox.myCenter[1] - myCenter[1]) < theBox.myHSize[1] - myHSize[1]); + return (std::abs(theBox.myCenter[0] - myCenter[0]) < theBox.myHSize[0] - myHSize[0] + && std::abs(theBox.myCenter[1] - myCenter[1]) < theBox.myHSize[1] - myHSize[1]); } //================================================================================================= @@ -372,7 +372,7 @@ Bnd_B2 Bnd_B2::Transformed(const gp_Trsf2d& theTrsf) const Bnd_B2 aResult; const gp_TrsfForm aForm = theTrsf.Form(); const Standard_Real aScale = theTrsf.ScaleFactor(); - const Standard_Real aScaleAbs = Abs(aScale); + const Standard_Real aScaleAbs = std::abs(aScale); if (aForm == gp_Identity) aResult = *this; else if (aForm == gp_Translation || aForm == gp_PntMirror || aForm == gp_Scale) @@ -391,9 +391,9 @@ Bnd_B2 Bnd_B2::Transformed(const gp_Trsf2d& theTrsf) const const Standard_Real* aMat = &theTrsf.HVectorialPart().Value(1, 1); aResult.myHSize[0] = - (RealType)(aScaleAbs * (Abs(aMat[0]) * myHSize[0] + Abs(aMat[1]) * myHSize[1])); + (RealType)(aScaleAbs * (std::abs(aMat[0]) * myHSize[0] + std::abs(aMat[1]) * myHSize[1])); aResult.myHSize[1] = - (RealType)(aScaleAbs * (Abs(aMat[2]) * myHSize[0] + Abs(aMat[3]) * myHSize[1])); + (RealType)(aScaleAbs * (std::abs(aMat[2]) * myHSize[0] + std::abs(aMat[3]) * myHSize[1])); } return aResult; } @@ -410,8 +410,8 @@ Standard_Boolean Bnd_B2::IsOut(const gp_XY& theCenter, { // vector from the center of the circle to the nearest box face const Standard_Real aDist[2] = { - Abs(theCenter.X() - Standard_Real(myCenter[0])) - Standard_Real(myHSize[0]), - Abs(theCenter.Y() - Standard_Real(myCenter[1])) - Standard_Real(myHSize[1])}; + std::abs(theCenter.X() - Standard_Real(myCenter[0])) - Standard_Real(myHSize[0]), + std::abs(theCenter.Y() - Standard_Real(myCenter[1])) - Standard_Real(myHSize[1])}; Standard_Real aD(0.); if (aDist[0] > 0.) aD = aDist[0] * aDist[0]; @@ -421,8 +421,8 @@ Standard_Boolean Bnd_B2::IsOut(const gp_XY& theCenter, } else { - const Standard_Real aDistC[2] = {Abs(theCenter.X() - Standard_Real(myCenter[0])), - Abs(theCenter.Y() - Standard_Real(myCenter[1]))}; + const Standard_Real aDistC[2] = {std::abs(theCenter.X() - Standard_Real(myCenter[0])), + std::abs(theCenter.Y() - Standard_Real(myCenter[1]))}; // vector from the center of the circle to the nearest box face Standard_Real aDist[2] = {aDistC[0] - Standard_Real(myHSize[0]), aDistC[1] - Standard_Real(myHSize[1])}; @@ -453,13 +453,14 @@ Standard_Boolean Bnd_B2::IsOut(const Bnd_B2& theBox, Standard_Boolean aResult(Standard_False); const gp_TrsfForm aForm = theTrsf.Form(); const Standard_Real aScale = theTrsf.ScaleFactor(); - const Standard_Real aScaleAbs = Abs(aScale); + const Standard_Real aScaleAbs = std::abs(aScale); if (aForm == gp_Translation || aForm == gp_Identity || aForm == gp_PntMirror || aForm == gp_Scale) { aResult = - (Abs(RealType(theBox.myCenter[0] * aScale + theTrsf.TranslationPart().X()) - myCenter[0]) + (std::abs(RealType(theBox.myCenter[0] * aScale + theTrsf.TranslationPart().X()) - myCenter[0]) > RealType(theBox.myHSize[0] * aScaleAbs) + myHSize[0] - || Abs(RealType(theBox.myCenter[1] * aScale + theTrsf.TranslationPart().Y()) - myCenter[1]) + || std::abs(RealType(theBox.myCenter[1] * aScale + theTrsf.TranslationPart().Y()) + - myCenter[1]) > RealType(theBox.myHSize[1] * aScaleAbs) + myHSize[1]); } else @@ -472,11 +473,14 @@ Standard_Boolean Bnd_B2::IsOut(const Bnd_B2& theBox, theTrsf.Transforms(aCenter); const Standard_Real aDist[2] = {aCenter.X() - (Standard_Real)myCenter[0], aCenter.Y() - (Standard_Real)myCenter[1]}; - const Standard_Real aMatAbs[4] = {Abs(aMat[0]), Abs(aMat[1]), Abs(aMat[2]), Abs(aMat[3])}; - if (Abs(aDist[0]) + const Standard_Real aMatAbs[4] = {std::abs(aMat[0]), + std::abs(aMat[1]), + std::abs(aMat[2]), + std::abs(aMat[3])}; + if (std::abs(aDist[0]) > (aScaleAbs * (aMatAbs[0] * theBox.myHSize[0] + aMatAbs[1] * theBox.myHSize[1]) + (Standard_Real)myHSize[0]) - || Abs(aDist[1]) + || std::abs(aDist[1]) > (aScaleAbs * (aMatAbs[2] * theBox.myHSize[0] + aMatAbs[3] * theBox.myHSize[1]) + (Standard_Real)myHSize[1])) aResult = Standard_True; @@ -485,9 +489,9 @@ Standard_Boolean Bnd_B2::IsOut(const Bnd_B2& theBox, { // theBox is rotated, scaled and translated. We apply the reverse // translation and scaling then check against the rotated box 'this' - if ((Abs(aMat[0] * aDist[0] + aMat[2] * aDist[1]) + if ((std::abs(aMat[0] * aDist[0] + aMat[2] * aDist[1]) > theBox.myHSize[0] * aScaleAbs + (aMatAbs[0] * myHSize[0] + aMatAbs[2] * myHSize[1])) - || (Abs(aMat[1] * aDist[0] + aMat[3] * aDist[1]) + || (std::abs(aMat[1] * aDist[0] + aMat[3] * aDist[1]) > theBox.myHSize[1] * aScaleAbs + (aMatAbs[1] * myHSize[0] + aMatAbs[3] * myHSize[1]))) aResult = Standard_True; @@ -509,7 +513,7 @@ Standard_Boolean Bnd_B2::IsOut(const gp_Ax2d& theLine) const ^ (gp_XY(myCenter[0] - theLine.Location().X(), myCenter[1] - theLine.Location().Y())), theLine.Direction().X() * Standard_Real(myHSize[1]), theLine.Direction().Y() * Standard_Real(myHSize[0])}; - return (Abs(aProd[0]) > (Abs(aProd[1]) + Abs(aProd[2]))); + return (std::abs(aProd[0]) > (std::abs(aProd[1]) + std::abs(aProd[2]))); } //================================================================================================= @@ -525,11 +529,11 @@ Standard_Boolean Bnd_B2::IsOut(const gp_XY& theP0, const gp_XY& theP1) const Standard_Real aProd[3] = {aSegDelta ^ (gp_XY(myCenter[0], myCenter[1]) - theP0), aSegDelta.X() * Standard_Real(myHSize[1]), aSegDelta.Y() * Standard_Real(myHSize[0])}; - if (Abs(aProd[0]) < (Abs(aProd[1]) + Abs(aProd[2]))) + if (std::abs(aProd[0]) < (std::abs(aProd[1]) + std::abs(aProd[2]))) { // Intersection with line detected; check the segment as bounding box const gp_XY aHSeg(0.5 * aSegDelta.X(), 0.5 * aSegDelta.Y()); - const gp_XY aHSegAbs(Abs(aHSeg.X()), Abs(aHSeg.Y())); + const gp_XY aHSegAbs(std::abs(aHSeg.X()), std::abs(aHSeg.Y())); aResult = compareDistD(gp_XY((Standard_Real)myHSize[0], (Standard_Real)myHSize[1]) + aHSegAbs, theP0 + aHSeg - gp_XY((Standard_Real)myCenter[0], (Standard_Real)myCenter[1])); @@ -547,13 +551,14 @@ Standard_Boolean Bnd_B2::IsIn(const Bnd_B2& theBox, Standard_Boolean aResult(Standard_False); const gp_TrsfForm aForm = theTrsf.Form(); const Standard_Real aScale = theTrsf.ScaleFactor(); - const Standard_Real aScaleAbs = Abs(aScale); + const Standard_Real aScaleAbs = std::abs(aScale); if (aForm == gp_Translation || aForm == gp_Identity || aForm == gp_PntMirror || aForm == gp_Scale) { aResult = - (Abs(RealType(theBox.myCenter[0] * aScale + theTrsf.TranslationPart().X()) - myCenter[0]) + (std::abs(RealType(theBox.myCenter[0] * aScale + theTrsf.TranslationPart().X()) - myCenter[0]) < RealType(theBox.myHSize[0] * aScaleAbs) - myHSize[0] - && Abs(RealType(theBox.myCenter[1] * aScale + theTrsf.TranslationPart().Y()) - myCenter[1]) + && std::abs(RealType(theBox.myCenter[1] * aScale + theTrsf.TranslationPart().Y()) + - myCenter[1]) < RealType(theBox.myHSize[1] * aScaleAbs) - myHSize[1]); } else @@ -565,11 +570,12 @@ Standard_Boolean Bnd_B2::IsIn(const Bnd_B2& theBox, theTrsf.Transforms(aCenter); const Standard_Real aDist[2] = {aCenter.X() - (Standard_Real)myCenter[0], aCenter.Y() - (Standard_Real)myCenter[1]}; - if ((Abs(aMat[0] * aDist[0] + aMat[2] * aDist[1]) - < theBox.myHSize[0] * aScaleAbs - (Abs(aMat[0]) * myHSize[0] + Abs(aMat[2]) * myHSize[1])) - && (Abs(aMat[1] * aDist[0] + aMat[3] * aDist[1]) + if ((std::abs(aMat[0] * aDist[0] + aMat[2] * aDist[1]) + < theBox.myHSize[0] * aScaleAbs + - (std::abs(aMat[0]) * myHSize[0] + std::abs(aMat[2]) * myHSize[1])) + && (std::abs(aMat[1] * aDist[0] + aMat[3] * aDist[1]) < theBox.myHSize[1] * aScaleAbs - - (Abs(aMat[1]) * myHSize[0] + Abs(aMat[3]) * myHSize[1]))) + - (std::abs(aMat[1]) * myHSize[0] + std::abs(aMat[3]) * myHSize[1]))) aResult = Standard_True; } return aResult; diff --git a/src/FoundationClasses/TKMath/Bnd/Bnd_B3.hxx b/src/FoundationClasses/TKMath/Bnd/Bnd_B3.hxx index b42e4238e9..bbd8749c48 100644 --- a/src/FoundationClasses/TKMath/Bnd/Bnd_B3.hxx +++ b/src/FoundationClasses/TKMath/Bnd/Bnd_B3.hxx @@ -137,13 +137,14 @@ public: protected: static Standard_Boolean compareDist(const RealType aHSize[3], const RealType aDist[3]) { - return (Abs(aDist[0]) > aHSize[0] || Abs(aDist[1]) > aHSize[1] || Abs(aDist[2]) > aHSize[2]); + return (std::abs(aDist[0]) > aHSize[0] || std::abs(aDist[1]) > aHSize[1] + || std::abs(aDist[2]) > aHSize[2]); } static Standard_Boolean compareDistD(const gp_XYZ& aHSize, const gp_XYZ& aDist) { - return (Abs(aDist.X()) > aHSize.X() || Abs(aDist.Y()) > aHSize.Y() - || Abs(aDist.Z()) > aHSize.Z()); + return (std::abs(aDist.X()) > aHSize.X() || std::abs(aDist.Y()) > aHSize.Y() + || std::abs(aDist.Z()) > aHSize.Z()); } //! Constant representing a very large value for void box initialization @@ -265,7 +266,7 @@ inline void Bnd_B3::SetHSize(const gp_XYZ& theHSize) template inline void Bnd_B3::Enlarge(const Standard_Real aDiff) { - const Standard_Real aD = Abs(aDiff); + const Standard_Real aD = std::abs(aDiff); myHSize[0] += RealType(aD); myHSize[1] += RealType(aD); myHSize[2] += RealType(aD); @@ -276,9 +277,9 @@ inline void Bnd_B3::Enlarge(const Standard_Real aDiff) template inline Standard_Boolean Bnd_B3::IsOut(const gp_XYZ& thePnt) const { - return (Abs(RealType(thePnt.X()) - myCenter[0]) > myHSize[0] - || Abs(RealType(thePnt.Y()) - myCenter[1]) > myHSize[1] - || Abs(RealType(thePnt.Z()) - myCenter[2]) > myHSize[2]); + return (std::abs(RealType(thePnt.X()) - myCenter[0]) > myHSize[0] + || std::abs(RealType(thePnt.Y()) - myCenter[1]) > myHSize[1] + || std::abs(RealType(thePnt.Z()) - myCenter[2]) > myHSize[2]); } //================================================================================================= @@ -286,9 +287,9 @@ inline Standard_Boolean Bnd_B3::IsOut(const gp_XYZ& thePnt) const template inline Standard_Boolean Bnd_B3::IsOut(const Bnd_B3& theBox) const { - return (Abs(theBox.myCenter[0] - myCenter[0]) > theBox.myHSize[0] + myHSize[0] - || Abs(theBox.myCenter[1] - myCenter[1]) > theBox.myHSize[1] + myHSize[1] - || Abs(theBox.myCenter[2] - myCenter[2]) > theBox.myHSize[2] + myHSize[2]); + return (std::abs(theBox.myCenter[0] - myCenter[0]) > theBox.myHSize[0] + myHSize[0] + || std::abs(theBox.myCenter[1] - myCenter[1]) > theBox.myHSize[1] + myHSize[1] + || std::abs(theBox.myCenter[2] - myCenter[2]) > theBox.myHSize[2] + myHSize[2]); } //================================================================================================= @@ -296,9 +297,9 @@ inline Standard_Boolean Bnd_B3::IsOut(const Bnd_B3& theBox) template inline Standard_Boolean Bnd_B3::IsIn(const Bnd_B3& theBox) const { - return (Abs(theBox.myCenter[0] - myCenter[0]) < theBox.myHSize[0] - myHSize[0] - && Abs(theBox.myCenter[1] - myCenter[1]) < theBox.myHSize[1] - myHSize[1] - && Abs(theBox.myCenter[2] - myCenter[2]) < theBox.myHSize[2] - myHSize[2]); + return (std::abs(theBox.myCenter[0] - myCenter[0]) < theBox.myHSize[0] - myHSize[0] + && std::abs(theBox.myCenter[1] - myCenter[1]) < theBox.myHSize[1] - myHSize[1] + && std::abs(theBox.myCenter[2] - myCenter[2]) < theBox.myHSize[2] - myHSize[2]); } //================================================================================================= @@ -426,7 +427,7 @@ Bnd_B3 Bnd_B3::Transformed(const gp_Trsf& theTrsf) const Bnd_B3 aResult; const gp_TrsfForm aForm = theTrsf.Form(); const Standard_Real aScale = theTrsf.ScaleFactor(); - const Standard_Real aScaleAbs = Abs(aScale); + const Standard_Real aScaleAbs = std::abs(aScale); if (aForm == gp_Identity) aResult = *this; else if (aForm == gp_Translation || aForm == gp_PntMirror || aForm == gp_Scale) @@ -449,15 +450,18 @@ Bnd_B3 Bnd_B3::Transformed(const gp_Trsf& theTrsf) const aResult.myCenter[2] = (RealType)aCenter.Z(); const Standard_Real* aMat = &theTrsf.HVectorialPart().Value(1, 1); - aResult.myHSize[0] = (RealType)(aScaleAbs - * (Abs(aMat[0]) * myHSize[0] + Abs(aMat[1]) * myHSize[1] - + Abs(aMat[2]) * myHSize[2])); - aResult.myHSize[1] = (RealType)(aScaleAbs - * (Abs(aMat[3]) * myHSize[0] + Abs(aMat[4]) * myHSize[1] - + Abs(aMat[5]) * myHSize[2])); - aResult.myHSize[2] = (RealType)(aScaleAbs - * (Abs(aMat[6]) * myHSize[0] + Abs(aMat[7]) * myHSize[1] - + Abs(aMat[8]) * myHSize[2])); + aResult.myHSize[0] = + (RealType)(aScaleAbs + * (std::abs(aMat[0]) * myHSize[0] + std::abs(aMat[1]) * myHSize[1] + + std::abs(aMat[2]) * myHSize[2])); + aResult.myHSize[1] = + (RealType)(aScaleAbs + * (std::abs(aMat[3]) * myHSize[0] + std::abs(aMat[4]) * myHSize[1] + + std::abs(aMat[5]) * myHSize[2])); + aResult.myHSize[2] = + (RealType)(aScaleAbs + * (std::abs(aMat[6]) * myHSize[0] + std::abs(aMat[7]) * myHSize[1] + + std::abs(aMat[8]) * myHSize[2])); } return aResult; } @@ -474,9 +478,9 @@ Standard_Boolean Bnd_B3::IsOut(const gp_XYZ& theCenter, { // vector from the center of the sphere to the nearest box face const Standard_Real aDist[3] = { - Abs(theCenter.X() - Standard_Real(myCenter[0])) - Standard_Real(myHSize[0]), - Abs(theCenter.Y() - Standard_Real(myCenter[1])) - Standard_Real(myHSize[1]), - Abs(theCenter.Z() - Standard_Real(myCenter[2])) - Standard_Real(myHSize[2])}; + std::abs(theCenter.X() - Standard_Real(myCenter[0])) - Standard_Real(myHSize[0]), + std::abs(theCenter.Y() - Standard_Real(myCenter[1])) - Standard_Real(myHSize[1]), + std::abs(theCenter.Z() - Standard_Real(myCenter[2])) - Standard_Real(myHSize[2])}; Standard_Real aD(0.); if (aDist[0] > 0.) aD = aDist[0] * aDist[0]; @@ -488,9 +492,9 @@ Standard_Boolean Bnd_B3::IsOut(const gp_XYZ& theCenter, } else { - const Standard_Real aDistC[3] = {Abs(theCenter.X() - Standard_Real(myCenter[0])), - Abs(theCenter.Y() - Standard_Real(myCenter[1])), - Abs(theCenter.Z() - Standard_Real(myCenter[2]))}; + const Standard_Real aDistC[3] = {std::abs(theCenter.X() - Standard_Real(myCenter[0])), + std::abs(theCenter.Y() - Standard_Real(myCenter[1])), + std::abs(theCenter.Z() - Standard_Real(myCenter[2]))}; // vector from the center of the sphere to the nearest box face Standard_Real aDist[3] = {aDistC[0] - Standard_Real(myHSize[0]), aDistC[1] - Standard_Real(myHSize[1]), @@ -525,15 +529,17 @@ Standard_Boolean Bnd_B3::IsOut(const Bnd_B3& theBox, Standard_Boolean aResult(Standard_False); const gp_TrsfForm aForm = theTrsf.Form(); const Standard_Real aScale = theTrsf.ScaleFactor(); - const Standard_Real aScaleAbs = Abs(aScale); + const Standard_Real aScaleAbs = std::abs(aScale); if (aForm == gp_Translation || aForm == gp_Identity || aForm == gp_PntMirror || aForm == gp_Scale) { aResult = - (Abs(RealType(theBox.myCenter[0] * aScale + theTrsf.TranslationPart().X()) - myCenter[0]) + (std::abs(RealType(theBox.myCenter[0] * aScale + theTrsf.TranslationPart().X()) - myCenter[0]) > RealType(theBox.myHSize[0] * aScaleAbs) + myHSize[0] - || Abs(RealType(theBox.myCenter[1] * aScale + theTrsf.TranslationPart().Y()) - myCenter[1]) + || std::abs(RealType(theBox.myCenter[1] * aScale + theTrsf.TranslationPart().Y()) + - myCenter[1]) > RealType(theBox.myHSize[1] * aScaleAbs) + myHSize[1] - || Abs(RealType(theBox.myCenter[2] * aScale + theTrsf.TranslationPart().Z()) - myCenter[2]) + || std::abs(RealType(theBox.myCenter[2] * aScale + theTrsf.TranslationPart().Z()) + - myCenter[2]) > RealType(theBox.myHSize[2] * aScaleAbs) + myHSize[2]); } else @@ -549,40 +555,42 @@ Standard_Boolean Bnd_B3::IsOut(const Bnd_B3& theBox, const Standard_Real aDist[3] = {aCenter.X() - (Standard_Real)myCenter[0], aCenter.Y() - (Standard_Real)myCenter[1], aCenter.Z() - (Standard_Real)myCenter[2]}; - const Standard_Real aMatAbs[9] = {Abs(aMat[0]), - Abs(aMat[1]), - Abs(aMat[2]), - Abs(aMat[3]), - Abs(aMat[4]), - Abs(aMat[5]), - Abs(aMat[6]), - Abs(aMat[7]), - Abs(aMat[8])}; - if (Abs(aDist[0]) > (aScaleAbs - * (aMatAbs[0] * theBox.myHSize[0] + aMatAbs[1] * theBox.myHSize[1] - + aMatAbs[2] * theBox.myHSize[2]) - + (Standard_Real)myHSize[0]) - || Abs(aDist[1]) > (aScaleAbs - * (aMatAbs[3] * theBox.myHSize[0] + aMatAbs[4] * theBox.myHSize[1] - + aMatAbs[5] * theBox.myHSize[2]) - + (Standard_Real)myHSize[1]) - || Abs(aDist[2]) > (aScaleAbs - * (aMatAbs[6] * theBox.myHSize[0] + aMatAbs[7] * theBox.myHSize[1] - + aMatAbs[8] * theBox.myHSize[2]) - + (Standard_Real)myHSize[2])) + const Standard_Real aMatAbs[9] = {std::abs(aMat[0]), + std::abs(aMat[1]), + std::abs(aMat[2]), + std::abs(aMat[3]), + std::abs(aMat[4]), + std::abs(aMat[5]), + std::abs(aMat[6]), + std::abs(aMat[7]), + std::abs(aMat[8])}; + if (std::abs(aDist[0]) > (aScaleAbs + * (aMatAbs[0] * theBox.myHSize[0] + aMatAbs[1] * theBox.myHSize[1] + + aMatAbs[2] * theBox.myHSize[2]) + + (Standard_Real)myHSize[0]) + || std::abs(aDist[1]) + > (aScaleAbs + * (aMatAbs[3] * theBox.myHSize[0] + aMatAbs[4] * theBox.myHSize[1] + + aMatAbs[5] * theBox.myHSize[2]) + + (Standard_Real)myHSize[1]) + || std::abs(aDist[2]) + > (aScaleAbs + * (aMatAbs[6] * theBox.myHSize[0] + aMatAbs[7] * theBox.myHSize[1] + + aMatAbs[8] * theBox.myHSize[2]) + + (Standard_Real)myHSize[2])) aResult = Standard_True; else { // theBox is rotated, scaled and translated. We apply the reverse // translation and scaling then check against the rotated box 'this' - if ((Abs(aMat[0] * aDist[0] + aMat[3] * aDist[1] + aMat[6] * aDist[2]) + if ((std::abs(aMat[0] * aDist[0] + aMat[3] * aDist[1] + aMat[6] * aDist[2]) > theBox.myHSize[0] * aScaleAbs + (aMatAbs[0] * myHSize[0] + aMatAbs[3] * myHSize[1] + aMatAbs[6] * myHSize[2])) - || (Abs(aMat[1] * aDist[0] + aMat[4] * aDist[1] + aMat[7] * aDist[2]) + || (std::abs(aMat[1] * aDist[0] + aMat[4] * aDist[1] + aMat[7] * aDist[2]) > theBox.myHSize[1] * aScaleAbs + (aMatAbs[1] * myHSize[0] + aMatAbs[4] * myHSize[1] + aMatAbs[7] * myHSize[2])) - || (Abs(aMat[2] * aDist[0] + aMat[5] * aDist[1] + aMat[8] * aDist[2]) + || (std::abs(aMat[2] * aDist[0] + aMat[5] * aDist[1] + aMat[8] * aDist[2]) > theBox.myHSize[2] * aScaleAbs + (aMatAbs[2] * myHSize[0] + aMatAbs[5] * myHSize[1] + aMatAbs[8] * myHSize[2]))) aResult = Standard_True; @@ -607,8 +615,8 @@ Standard_Boolean Bnd_B3::IsOut(const gp_Ax3& thePlane) const // Find the signed distances from two opposite corners of the box to the plane // If the distances are not the same sign, then the plane crosses the box const Standard_Real aDist1 = // proj of HSize on aDir - Standard_Real(myHSize[0]) * Abs(aDir.X()) + Standard_Real(myHSize[1]) * Abs(aDir.Y()) - + Standard_Real(myHSize[2]) * Abs(aDir.Z()); + Standard_Real(myHSize[0]) * std::abs(aDir.X()) + Standard_Real(myHSize[1]) * std::abs(aDir.Y()) + + Standard_Real(myHSize[2]) * std::abs(aDir.Z()); return ((aDist0 + aDist1) * (aDist0 - aDist1) > 0.); } @@ -642,7 +650,7 @@ Standard_Boolean Bnd_B3::IsOut(const gp_Ax1& theLine, } else // the line is orthogonal to OX axis. Test for inclusion in box limits - if (Abs(aDiff.X()) > aHSize) + if (std::abs(aDiff.X()) > aHSize) return Standard_True; // Find the parameter interval in Y dimension @@ -659,7 +667,7 @@ Standard_Boolean Bnd_B3::IsOut(const gp_Ax1& theLine, } else // the line is orthogonal to OY axis. Test for inclusion in box limits - if (Abs(aDiff.Y()) > aHSize) + if (std::abs(aDiff.Y()) > aHSize) return Standard_True; // Intersect Y-interval with X-interval @@ -686,7 +694,7 @@ Standard_Boolean Bnd_B3::IsOut(const gp_Ax1& theLine, } else // the line is orthogonal to OZ axis. Test for inclusion in box limits - return (Abs(aDiff.Z()) > aHSize); + return (std::abs(aDiff.Z()) > aHSize); if (isRay && anInter1[1] < -aRes) return Standard_True; @@ -702,15 +710,17 @@ Standard_Boolean Bnd_B3::IsIn(const Bnd_B3& theBox, Standard_Boolean aResult(Standard_False); const gp_TrsfForm aForm = theTrsf.Form(); const Standard_Real aScale = theTrsf.ScaleFactor(); - const Standard_Real aScaleAbs = Abs(aScale); + const Standard_Real aScaleAbs = std::abs(aScale); if (aForm == gp_Translation || aForm == gp_Identity || aForm == gp_PntMirror || aForm == gp_Scale) { aResult = - (Abs(RealType(theBox.myCenter[0] * aScale + theTrsf.TranslationPart().X()) - myCenter[0]) + (std::abs(RealType(theBox.myCenter[0] * aScale + theTrsf.TranslationPart().X()) - myCenter[0]) < RealType(theBox.myHSize[0] * aScaleAbs) - myHSize[0] - && Abs(RealType(theBox.myCenter[1] * aScale + theTrsf.TranslationPart().Y()) - myCenter[1]) + && std::abs(RealType(theBox.myCenter[1] * aScale + theTrsf.TranslationPart().Y()) + - myCenter[1]) < RealType(theBox.myHSize[1] * aScaleAbs) - myHSize[1] - && Abs(RealType(theBox.myCenter[2] * aScale + theTrsf.TranslationPart().Z()) - myCenter[2]) + && std::abs(RealType(theBox.myCenter[2] * aScale + theTrsf.TranslationPart().Z()) + - myCenter[2]) < RealType(theBox.myHSize[2] * aScaleAbs) - myHSize[2]); } else @@ -725,17 +735,18 @@ Standard_Boolean Bnd_B3::IsIn(const Bnd_B3& theBox, const Standard_Real aDist[3] = {aCenter.X() - (Standard_Real)myCenter[0], aCenter.Y() - (Standard_Real)myCenter[1], aCenter.Z() - (Standard_Real)myCenter[2]}; - if ((Abs(aMat[0] * aDist[0] + aMat[3] * aDist[1] + aMat[6] * aDist[2]) + if ((std::abs(aMat[0] * aDist[0] + aMat[3] * aDist[1] + aMat[6] * aDist[2]) < theBox.myHSize[0] * aScaleAbs - - (Abs(aMat[0]) * myHSize[0] + Abs(aMat[3]) * myHSize[1] + Abs(aMat[6]) * myHSize[2])) - && (Abs(aMat[1] * aDist[0] + aMat[4] * aDist[1] + aMat[7] * aDist[2]) + - (std::abs(aMat[0]) * myHSize[0] + std::abs(aMat[3]) * myHSize[1] + + std::abs(aMat[6]) * myHSize[2])) + && (std::abs(aMat[1] * aDist[0] + aMat[4] * aDist[1] + aMat[7] * aDist[2]) < theBox.myHSize[1] * aScaleAbs - - (Abs(aMat[1]) * myHSize[0] + Abs(aMat[4]) * myHSize[1] - + Abs(aMat[7]) * myHSize[2])) - && (Abs(aMat[2] * aDist[0] + aMat[5] * aDist[1] + aMat[8] * aDist[2]) + - (std::abs(aMat[1]) * myHSize[0] + std::abs(aMat[4]) * myHSize[1] + + std::abs(aMat[7]) * myHSize[2])) + && (std::abs(aMat[2] * aDist[0] + aMat[5] * aDist[1] + aMat[8] * aDist[2]) < theBox.myHSize[2] * aScaleAbs - - (Abs(aMat[2]) * myHSize[0] + Abs(aMat[5]) * myHSize[1] - + Abs(aMat[8]) * myHSize[2]))) + - (std::abs(aMat[2]) * myHSize[0] + std::abs(aMat[5]) * myHSize[1] + + std::abs(aMat[8]) * myHSize[2]))) aResult = Standard_True; } return aResult; diff --git a/src/FoundationClasses/TKMath/Bnd/Bnd_Box.cxx b/src/FoundationClasses/TKMath/Bnd/Bnd_Box.cxx index 7f6860ce6b..48912ac8c9 100644 --- a/src/FoundationClasses/TKMath/Bnd/Bnd_Box.cxx +++ b/src/FoundationClasses/TKMath/Bnd/Bnd_Box.cxx @@ -160,7 +160,7 @@ void Bnd_Box::SetGap(const Standard_Real Tol) void Bnd_Box::Enlarge(const Standard_Real Tol) { - Gap = Max(Gap, Abs(Tol)); + Gap = std::max(Gap, std::abs(Tol)); } //================================================================================================= @@ -432,7 +432,7 @@ void Bnd_Box::Add(const Bnd_Box& Other) Zmin = Other.Zmin; if (Zmax < Other.Zmax) Zmax = Other.Zmax; - Gap = Max(Gap, Other.Gap); + Gap = std::max(Gap, Other.Gap); if (IsWhole()) { @@ -577,12 +577,12 @@ Standard_Boolean Bnd_Box::IsOut(const gp_Lin& L) const Standard_Real myXmin, myYmin, myZmin, myXmax, myYmax, myZmax; Get(myXmin, myYmin, myZmin, myXmax, myYmax, myZmax); - if (Abs(L.Direction().XYZ().X()) > 0.) + if (std::abs(L.Direction().XYZ().X()) > 0.) { par1 = (myXmin - L.Location().XYZ().X()) / L.Direction().XYZ().X(); par2 = (myXmax - L.Location().XYZ().X()) / L.Direction().XYZ().X(); - parmin = Min(par1, par2); - parmax = Max(par1, par2); + parmin = std::min(par1, par2); + parmax = std::max(par1, par2); xToSet = Standard_True; } else @@ -598,16 +598,16 @@ Standard_Boolean Bnd_Box::IsOut(const gp_Lin& L) const xToSet = Standard_False; } - if (Abs(L.Direction().XYZ().Y()) > 0.) + if (std::abs(L.Direction().XYZ().Y()) > 0.) { par1 = (myYmin - L.Location().XYZ().Y()) / L.Direction().XYZ().Y(); par2 = (myYmax - L.Location().XYZ().Y()) / L.Direction().XYZ().Y(); //=================DET change 06/03/01==================== - if (parmax < Min(par1, par2) || parmin > Max(par1, par2)) + if (parmax < std::min(par1, par2) || parmin > std::max(par1, par2)) return Standard_True; //======================================================== - parmin = Max(parmin, Min(par1, par2)); - parmax = Min(parmax, Max(par1, par2)); + parmin = std::max(parmin, std::min(par1, par2)); + parmax = std::min(parmax, std::max(par1, par2)); yToSet = Standard_True; } else @@ -621,20 +621,20 @@ Standard_Boolean Bnd_Box::IsOut(const gp_Lin& L) const yToSet = Standard_False; } - if (Abs(L.Direction().XYZ().Z()) > 0.) + if (std::abs(L.Direction().XYZ().Z()) > 0.) { par1 = (myZmin - L.Location().XYZ().Z()) / L.Direction().XYZ().Z(); par2 = (myZmax - L.Location().XYZ().Z()) / L.Direction().XYZ().Z(); //=================DET change 06/03/01==================== - if (parmax < Min(par1, par2) || parmin > Max(par1, par2)) + if (parmax < std::min(par1, par2) || parmin > std::max(par1, par2)) return Standard_True; //======================================================== - parmin = Max(parmin, Min(par1, par2)); - parmax = Min(parmax, Max(par1, par2)); + parmin = std::max(parmin, std::min(par1, par2)); + parmax = std::min(parmax, std::max(par1, par2)); par1 = L.Location().XYZ().Z() + parmin * L.Direction().XYZ().Z(); par2 = L.Location().XYZ().Z() + parmax * L.Direction().XYZ().Z(); - zmin = Min(par1, par2); - zmax = Max(par1, par2); + zmin = std::min(par1, par2); + zmax = std::max(par1, par2); } else { @@ -650,8 +650,8 @@ Standard_Boolean Bnd_Box::IsOut(const gp_Lin& L) const { par1 = L.Location().XYZ().X() + parmin * L.Direction().XYZ().X(); par2 = L.Location().XYZ().X() + parmax * L.Direction().XYZ().X(); - xmin = Min(par1, par2); - xmax = Max(par1, par2); + xmin = std::min(par1, par2); + xmax = std::max(par1, par2); } if (xmax < myXmin || myXmax < xmin) return Standard_True; @@ -660,8 +660,8 @@ Standard_Boolean Bnd_Box::IsOut(const gp_Lin& L) const { par1 = L.Location().XYZ().Y() + parmin * L.Direction().XYZ().Y(); par2 = L.Location().XYZ().Y() + parmax * L.Direction().XYZ().Y(); - ymin = Min(par1, par2); - ymax = Max(par1, par2); + ymin = std::min(par1, par2); + ymax = std::max(par1, par2); } if (ymax < myYmin || myYmax < ymin) return Standard_True; @@ -747,10 +747,10 @@ static Standard_Boolean IsSegmentOut(Standard_Real x1, Standard_Real ys2) { constexpr Standard_Real eps = RealSmall(); - Standard_Real xsmin = Min(xs1, xs2); - Standard_Real xsmax = Max(xs1, xs2); - Standard_Real ysmin = Min(ys1, ys2); - Standard_Real ysmax = Max(ys1, ys2); + Standard_Real xsmin = std::min(xs1, xs2); + Standard_Real xsmax = std::max(xs1, xs2); + Standard_Real ysmin = std::min(ys1, ys2); + Standard_Real ysmax = std::max(ys1, ys2); if (ysmax - ysmin < eps && (y1 - ys1 < eps && ys1 - y2 < eps) && ((xsmin - x1 < eps && x1 - xsmax < eps) || (xsmin - x2 < eps && x2 - xsmax < eps) @@ -765,17 +765,17 @@ static Standard_Boolean IsSegmentOut(Standard_Real x1, || (ys1 > y2 && ys2 > y2)) return Standard_True; - if (Abs(xs2 - xs1) > eps) + if (std::abs(xs2 - xs1) > eps) { - Standard_Real ya = (Min(x1, x2) - xs1) * (ys2 - ys1) / (xs2 - xs1) + ys1; - Standard_Real yb = (Max(x1, x2) - xs1) * (ys2 - ys1) / (xs2 - xs1) + ys1; + Standard_Real ya = (std::min(x1, x2) - xs1) * (ys2 - ys1) / (xs2 - xs1) + ys1; + Standard_Real yb = (std::max(x1, x2) - xs1) * (ys2 - ys1) / (xs2 - xs1) + ys1; if ((ya < y1 && yb < y1) || (ya > y2 && yb > y2)) return Standard_True; } - else if (Abs(ys2 - ys1) > eps) + else if (std::abs(ys2 - ys1) > eps) { - Standard_Real xa = (Min(y1, y2) - ys1) * (xs2 - xs1) / (ys2 - ys1) + xs1; - Standard_Real xb = (Max(y1, y2) - ys1) * (xs2 - xs1) / (ys2 - ys1) + xs1; + Standard_Real xa = (std::min(y1, y2) - ys1) * (xs2 - xs1) / (ys2 - ys1) + xs1; + Standard_Real xb = (std::max(y1, y2) - ys1) * (xs2 - xs1) / (ys2 - ys1) + xs1; if ((xa < x1 && xb < x1) || (xa > x2 && xb > x2)) return Standard_True; } @@ -797,16 +797,16 @@ Standard_Boolean Bnd_Box::IsOut(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Dir Standard_Real myXmin, myYmin, myZmin, myXmax, myYmax, myZmax; Get(myXmin, myYmin, myZmin, myXmax, myYmax, myZmax); - if (Abs(D.X()) < eps && Abs(D.Y()) < eps) + if (std::abs(D.X()) < eps && std::abs(D.Y()) < eps) return IsSegmentOut(myXmin, myYmin, myXmax, myYmax, P1.X(), P1.Y(), P2.X(), P2.Y()); - if (Abs(D.X()) < eps && Abs(D.Z()) < eps) + if (std::abs(D.X()) < eps && std::abs(D.Z()) < eps) return IsSegmentOut(myXmin, myZmin, myXmax, myZmax, P1.X(), P1.Z(), P2.X(), P2.Z()); - if (Abs(D.Y()) < eps && Abs(D.Z()) < eps) + if (std::abs(D.Y()) < eps && std::abs(D.Z()) < eps) return IsSegmentOut(myYmin, myZmin, myYmax, myZmax, P1.Y(), P1.Z(), P2.Y(), P2.Z()); - if (Abs(D.X()) < eps) + if (std::abs(D.X()) < eps) { if (!IsSegmentOut(myXmin, myZmin, @@ -851,7 +851,7 @@ Standard_Boolean Bnd_Box::IsOut(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Dir return Standard_True; } // if(D.X() == 0) - if (Abs(D.Y()) < eps) + if (std::abs(D.Y()) < eps) { if (!IsSegmentOut(myYmin, myZmin, @@ -896,7 +896,7 @@ Standard_Boolean Bnd_Box::IsOut(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Dir return Standard_True; } // if(D.Y() == 0) - if (Abs(D.Z()) < eps) + if (std::abs(D.Z()) < eps) { if (!IsSegmentOut(myZmin, myXmin, @@ -1018,7 +1018,7 @@ static Standard_Real DistMini2Box(const Standard_Real r1min, r1 = Square(r1min - r2max); r2 = Square(r1max - r2min); - return (Min(r1, r2)); + return std::min(r1, r2); } Standard_Real Bnd_Box::Distance(const Bnd_Box& Other) const @@ -1055,7 +1055,7 @@ Standard_Real Bnd_Box::Distance(const Bnd_Box& Other) const dist_z = DistMini2Box(zminB1, zmaxB1, zminB2, zmaxB2); } dist_t = dist_x + dist_y + dist_z; - return (Sqrt(dist_t)); + return (std::sqrt(dist_t)); } //================================================================================================= diff --git a/src/FoundationClasses/TKMath/Bnd/Bnd_Box.hxx b/src/FoundationClasses/TKMath/Bnd/Bnd_Box.hxx index 76ce6080ef..5dcf314682 100644 --- a/src/FoundationClasses/TKMath/Bnd/Bnd_Box.hxx +++ b/src/FoundationClasses/TKMath/Bnd/Bnd_Box.hxx @@ -121,7 +121,7 @@ public: Standard_EXPORT void SetGap(const Standard_Real Tol); //! Enlarges the box with a tolerance value. - //! (minvalues-Abs() and maxvalues+Abs()) + //! (minvalues-std::abs() and maxvalues+std::abs()) //! This means that the minimum values of its X, Y and Z //! intervals of definition, when they are finite, are reduced by //! the absolute value of Tol, while the maximum values are diff --git a/src/FoundationClasses/TKMath/Bnd/Bnd_Box2d.cxx b/src/FoundationClasses/TKMath/Bnd/Bnd_Box2d.cxx index a48211ec8d..004c3ff9e2 100644 --- a/src/FoundationClasses/TKMath/Bnd/Bnd_Box2d.cxx +++ b/src/FoundationClasses/TKMath/Bnd/Bnd_Box2d.cxx @@ -240,7 +240,7 @@ void Bnd_Box2d::Add(const Bnd_Box2d& Other) else if (Ymax < Other.Ymax) Ymax = Other.Ymax; } - Gap = Max(Gap, Other.Gap); + Gap = std::max(Gap, Other.Gap); } } @@ -303,12 +303,12 @@ Standard_Boolean Bnd_Box2d::IsOut(const gp_Lin2d& theL) const Get(aXMin, aYMin, aXMax, aYMax); gp_XY aCenter((aXMin + aXMax) / 2, (aYMin + aYMax) / 2); - gp_XY aHeigh(Abs(aXMax - aCenter.X()), Abs(aYMax - aCenter.Y())); + gp_XY aHeigh(std::abs(aXMax - aCenter.X()), std::abs(aYMax - aCenter.Y())); const Standard_Real aProd[3] = {theL.Direction().XY() ^ (aCenter - theL.Location().XY()), theL.Direction().X() * aHeigh.Y(), theL.Direction().Y() * aHeigh.X()}; - Standard_Boolean aStatus = (Abs(aProd[0]) > (Abs(aProd[1]) + Abs(aProd[2]))); + Standard_Boolean aStatus = (std::abs(aProd[0]) > (std::abs(aProd[1]) + std::abs(aProd[2]))); return aStatus; } @@ -333,19 +333,19 @@ Standard_Boolean Bnd_Box2d::IsOut(const gp_Pnt2d& theP0, const gp_Pnt2d& theP1) const gp_XY aSegDelta(theP1.XY() - theP0.XY()); gp_XY aCenter((aLocXMin + aLocXMax) / 2, (aLocYMin + aLocYMax) / 2); - gp_XY aHeigh(Abs(aLocXMax - aCenter.X()), Abs(aLocYMax - aCenter.Y())); + gp_XY aHeigh(std::abs(aLocXMax - aCenter.X()), std::abs(aLocYMax - aCenter.Y())); const Standard_Real aProd[3] = {aSegDelta ^ (aCenter - theP0.XY()), aSegDelta.X() * aHeigh.Y(), aSegDelta.Y() * aHeigh.X()}; - if ((Abs(aProd[0]) <= (Abs(aProd[1]) + Abs(aProd[2])))) + if ((std::abs(aProd[0]) <= (std::abs(aProd[1]) + std::abs(aProd[2])))) { // Intersection with line detected; check the segment as bounding box const gp_XY aHSeg(0.5 * aSegDelta.X(), 0.5 * aSegDelta.Y()); - const gp_XY aHSegAbs(Abs(aHSeg.X()), Abs(aHSeg.Y())); - aStatus = ((Abs((theP0.XY() + aHSeg - aCenter).X()) > (aHeigh + aHSegAbs).X()) - || (Abs((theP0.XY() + aHSeg - aCenter).Y()) > (aHeigh + aHSegAbs).Y())); + const gp_XY aHSegAbs(std::abs(aHSeg.X()), std::abs(aHSeg.Y())); + aStatus = ((std::abs((theP0.XY() + aHSeg - aCenter).X()) > (aHeigh + aHSegAbs).X()) + || (std::abs((theP0.XY() + aHSeg - aCenter).Y()) > (aHeigh + aHSegAbs).Y())); } return aStatus; } diff --git a/src/FoundationClasses/TKMath/Bnd/Bnd_OBB.cxx b/src/FoundationClasses/TKMath/Bnd/Bnd_OBB.cxx index 8930befcc8..b96035fa03 100644 --- a/src/FoundationClasses/TKMath/Bnd/Bnd_OBB.cxx +++ b/src/FoundationClasses/TKMath/Bnd/Bnd_OBB.cxx @@ -600,7 +600,7 @@ void OBBTool::ProcessTriangle(const Standard_Integer theIdx1, if (aSqMod < Precision::SquareConfusion()) return; - aZAxis /= Sqrt(aSqMod); + aZAxis /= std::sqrt(aSqMod); gp_XYZ aXAxis[aNbAxes]; for (Standard_Integer i = 0; i < aNbAxes; i++) @@ -734,12 +734,12 @@ void OBBTool::BuildBox(Bnd_OBB& theBox) else { const Standard_Real aTol = myListOfTolers->Value(i); - aParams[0] = Min(aParams[0], aDx - aTol); - aParams[1] = Max(aParams[1], aDx + aTol); - aParams[2] = Min(aParams[2], aDy - aTol); - aParams[3] = Max(aParams[3], aDy + aTol); - aParams[4] = Min(aParams[4], aDz - aTol); - aParams[5] = Max(aParams[5], aDz + aTol); + aParams[0] = std::min(aParams[0], aDx - aTol); + aParams[1] = std::max(aParams[1], aDx + aTol); + aParams[2] = std::min(aParams[2], aDy - aTol); + aParams[3] = std::max(aParams[3], aDy + aTol); + aParams[4] = std::min(aParams[4], aDz - aTol); + aParams[5] = std::max(aParams[5], aDz + aTol); } } @@ -784,7 +784,7 @@ void Bnd_OBB::ReBuild(const TColgp_Array1OfPnt& theListOfPoints, const gp_XYZ aDP = aP2 - aP1; const Standard_Real aDPm = aDP.Modulus(); myIsAABox = Standard_False; - myHDims[1] = myHDims[2] = Max(aTol1, aTol2); + myHDims[1] = myHDims[2] = std::max(aTol1, aTol2); if (aDPm < Precision::Confusion()) { @@ -795,7 +795,7 @@ void Bnd_OBB::ReBuild(const TColgp_Array1OfPnt& theListOfPoints, myHDims[0] = 0.5 * (aDPm + aTol1 + aTol2); myAxes[0] = aDP / aDPm; - if (Abs(myAxes[0].X()) > Abs(myAxes[0].Y())) + if (std::abs(myAxes[0].X()) > std::abs(myAxes[0].Y())) { // Z-coord. is maximal or X-coord. is maximal myAxes[1].SetCoord(-myAxes[0].Z(), 0.0, myAxes[0].X()); @@ -828,9 +828,9 @@ Standard_Boolean Bnd_OBB::IsOut(const Bnd_OBB& theOther) const if (myIsAABox && theOther.myIsAABox) { - return ((Abs(theOther.myCenter.X() - myCenter.X()) > theOther.myHDims[0] + myHDims[0]) - || (Abs(theOther.myCenter.Y() - myCenter.Y()) > theOther.myHDims[1] + myHDims[1]) - || (Abs(theOther.myCenter.Z() - myCenter.Z()) > theOther.myHDims[2] + myHDims[2])); + return ((std::abs(theOther.myCenter.X() - myCenter.X()) > theOther.myHDims[0] + myHDims[0]) + || (std::abs(theOther.myCenter.Y() - myCenter.Y()) > theOther.myHDims[1] + myHDims[1]) + || (std::abs(theOther.myCenter.Z() - myCenter.Z()) > theOther.myHDims[2] + myHDims[2])); } // According to the Separating Axis Theorem for Oriented Bounding Boxes @@ -841,7 +841,7 @@ Standard_Boolean Bnd_OBB::IsOut(const Bnd_OBB& theOther) const // The algorithm is following: // 1. Compute the "length" for j-th BndBox (j=1...2) according to the formula: - // L(j)=Sum(myHDims[i]*Abs(myAxes[i].Dot(Ls))) + // L(j)=Sum(myHDims[i]*std::abs(myAxes[i].Dot(Ls))) // 2. If (theCenter2 - theCenter1).Dot(Ls) > (L(1) + L(2)) // then the considered OBBs are not interfered in terms of the axis Ls. // @@ -860,10 +860,10 @@ Standard_Boolean Bnd_OBB::IsOut(const Bnd_OBB& theOther) const // Length of the second segment Standard_Real aLSegm2 = 0; for (Standard_Integer j = 0; j < 3; ++j) - aLSegm2 += theOther.myHDims[j] * Abs(theOther.myAxes[j].Dot(myAxes[i])); + aLSegm2 += theOther.myHDims[j] * std::abs(theOther.myAxes[j].Dot(myAxes[i])); // Distance between projected centers - Standard_Real aDistCC = Abs(D.Dot(myAxes[i])); + Standard_Real aDistCC = std::abs(D.Dot(myAxes[i])); if (aDistCC > myHDims[i] + aLSegm2) return Standard_True; @@ -876,10 +876,10 @@ Standard_Boolean Bnd_OBB::IsOut(const Bnd_OBB& theOther) const // Length of the first segment Standard_Real aLSegm1 = 0.; for (Standard_Integer j = 0; j < 3; ++j) - aLSegm1 += myHDims[j] * Abs(myAxes[j].Dot(theOther.myAxes[i])); + aLSegm1 += myHDims[j] * std::abs(myAxes[j].Dot(theOther.myAxes[i])); // Distance between projected centers - Standard_Real aDistCC = Abs(D.Dot(theOther.myAxes[i])); + Standard_Real aDistCC = std::abs(D.Dot(theOther.myAxes[i])); if (aDistCC > aLSegm1 + theOther.myHDims[i]) return Standard_True; @@ -904,15 +904,15 @@ Standard_Boolean Bnd_OBB::IsOut(const Bnd_OBB& theOther) const // Length of the first segment Standard_Real aLSegm1 = 0.; for (Standard_Integer k = 0; k < 3; ++k) - aLSegm1 += myHDims[k] * Abs(myAxes[k].Dot(aLAxe)); + aLSegm1 += myHDims[k] * std::abs(myAxes[k].Dot(aLAxe)); // Length of the second segment Standard_Real aLSegm2 = 0.; for (Standard_Integer k = 0; k < 3; ++k) - aLSegm2 += theOther.myHDims[k] * Abs(theOther.myAxes[k].Dot(aLAxe)); + aLSegm2 += theOther.myHDims[k] * std::abs(theOther.myAxes[k].Dot(aLAxe)); // Distance between projected centers - Standard_Real aDistCC = Abs(D.Dot(aLAxe)); + Standard_Real aDistCC = std::abs(D.Dot(aLAxe)); if (aDistCC > aLSegm1 + aLSegm2) return Standard_True; @@ -933,8 +933,8 @@ Standard_Boolean Bnd_OBB::IsOut(const gp_Pnt& theP) const const gp_XYZ aRV = theP.XYZ() - myCenter; - return ((Abs(myAxes[0].Dot(aRV)) > myHDims[0]) || (Abs(myAxes[1].Dot(aRV)) > myHDims[1]) - || (Abs(myAxes[2].Dot(aRV)) > myHDims[2])); + return ((std::abs(myAxes[0].Dot(aRV)) > myHDims[0]) || (std::abs(myAxes[1].Dot(aRV)) > myHDims[1]) + || (std::abs(myAxes[2].Dot(aRV)) > myHDims[2])); } // ======================================================================= diff --git a/src/FoundationClasses/TKMath/Bnd/Bnd_OBB.hxx b/src/FoundationClasses/TKMath/Bnd/Bnd_OBB.hxx index ce7cb03b9a..0591c122be 100644 --- a/src/FoundationClasses/TKMath/Bnd/Bnd_OBB.hxx +++ b/src/FoundationClasses/TKMath/Bnd/Bnd_OBB.hxx @@ -191,7 +191,7 @@ public: //! Enlarges the box with the given value void Enlarge(const Standard_Real theGapAdd) { - const Standard_Real aGap = Abs(theGapAdd); + const Standard_Real aGap = std::abs(theGapAdd); myHDims[0] += aGap; myHDims[1] += aGap; myHDims[2] += aGap; diff --git a/src/FoundationClasses/TKMath/Bnd/Bnd_Range.cxx b/src/FoundationClasses/TKMath/Bnd/Bnd_Range.cxx index fa8eac9053..839ae44ad1 100644 --- a/src/FoundationClasses/TKMath/Bnd/Bnd_Range.cxx +++ b/src/FoundationClasses/TKMath/Bnd/Bnd_Range.cxx @@ -30,8 +30,8 @@ void Bnd_Range::Common(const Bnd_Range& theOther) return; } - myFirst = Max(myFirst, theOther.myFirst); - myLast = Min(myLast, theOther.myLast); + myFirst = std::max(myFirst, theOther.myFirst); + myLast = std::min(myLast, theOther.myLast); } //================================================================================================= @@ -47,8 +47,8 @@ Standard_Boolean Bnd_Range::Union(const Bnd_Range& theOther) if (myFirst > theOther.myLast) return Standard_False; - myFirst = Min(myFirst, theOther.myFirst); - myLast = Max(myLast, theOther.myLast); + myFirst = std::min(myFirst, theOther.myFirst); + myLast = std::max(myLast, theOther.myLast); return Standard_True; } @@ -61,7 +61,7 @@ Standard_Integer Bnd_Range::IsIntersected(const Standard_Real theVal, if (IsVoid()) return Standard_False; - const Standard_Real aPeriod = Abs(thePeriod); + const Standard_Real aPeriod = std::abs(thePeriod); const Standard_Real aDF = myFirst - theVal, aDL = myLast - theVal; if (aPeriod <= RealSmall()) @@ -82,18 +82,18 @@ Standard_Integer Bnd_Range::IsIntersected(const Standard_Real theVal, // ((myFirst-theVal)/aPeriod <= N <= (myLast-theVal)/aPeriod). // I.e. the interval [aDF/aPeriod, aDL/aPeriod] must contain at least one // integer number. - // In this case, Floor(aDF/aPeriod) and Floor(aDL/aPeriod) + // In this case, std::floor(aDF/aPeriod) and std::floor(aDL/aPeriod) // return different values or aDF/aPeriod (aDL/aPeriod) // is strictly integer number. // Examples: // 1. (aDF/aPeriod==2.8, aDL/aPeriod==3.5 => - // Floor(aDF/aPeriod) == 2, Floor(aDL/aPeriod) == 3. + // std::floor(aDF/aPeriod) == 2, std::floor(aDL/aPeriod) == 3. // 2. aDF/aPeriod==2.0, aDL/aPeriod==2.6 => - // Floor(aDF/aPeriod) == Floor(aDL/aPeriod) == 2. + // std::floor(aDF/aPeriod) == std::floor(aDL/aPeriod) == 2. const Standard_Real aVal1 = aDF / aPeriod, aVal2 = aDL / aPeriod; - const Standard_Integer aPar1 = static_cast(Floor(aVal1)); - const Standard_Integer aPar2 = static_cast(Floor(aVal2)); + const Standard_Integer aPar1 = static_cast(std::floor(aVal1)); + const Standard_Integer aPar2 = static_cast(std::floor(aVal2)); if (aPar1 != aPar2) { // Interval (myFirst, myLast] intersects seam-edge if (IsEqual(aVal2, static_cast(aPar2))) @@ -129,7 +129,7 @@ void Bnd_Range::Split(const Standard_Real theVal, NCollection_List& theList, const Standard_Real thePeriod) const { - const Standard_Real aPeriod = Abs(thePeriod); + const Standard_Real aPeriod = std::abs(thePeriod); if (IsIntersected(theVal, aPeriod) != 1) { theList.Append(*this); @@ -145,7 +145,7 @@ void Bnd_Range::Split(const Standard_Real theVal, return; } - Standard_Real aValPrev = theVal + aPeriod * Ceiling((myFirst - theVal) / aPeriod); + Standard_Real aValPrev = theVal + aPeriod * std::ceil((myFirst - theVal) / aPeriod); // Now, (myFirst <= aValPrev < myFirst+aPeriod). diff --git a/src/FoundationClasses/TKMath/Bnd/Bnd_Range.hxx b/src/FoundationClasses/TKMath/Bnd/Bnd_Range.hxx index aece46a78a..df70351903 100644 --- a/src/FoundationClasses/TKMath/Bnd/Bnd_Range.hxx +++ b/src/FoundationClasses/TKMath/Bnd/Bnd_Range.hxx @@ -87,8 +87,8 @@ public: return; } - myFirst = Min(myFirst, theParameter); - myLast = Max(myLast, theParameter); + myFirst = (std::min)(myFirst, theParameter); + myLast = (std::max)(myLast, theParameter); } //! Extends this range to include both ranges. @@ -103,8 +103,8 @@ public: { *this = theRange; } - myFirst = Min(myFirst, theRange.myFirst); - myLast = Max(myLast, theRange.myLast); + myFirst = (std::min)(myFirst, theRange.myFirst); + myLast = (std::max)(myLast, theRange.myLast); } //! Obtain MIN boundary of . @@ -214,7 +214,7 @@ public: { if (!IsVoid()) { - myFirst = Max(myFirst, theValLower); + myFirst = (std::max)(myFirst, theValLower); } } @@ -224,7 +224,7 @@ public: { if (!IsVoid()) { - myLast = Min(myLast, theValUpper); + myLast = (std::min)(myLast, theValUpper); } } diff --git a/src/FoundationClasses/TKMath/CSLib/CSLib.cxx b/src/FoundationClasses/TKMath/CSLib/CSLib.cxx index 1079d35a71..a09170d751 100644 --- a/src/FoundationClasses/TKMath/CSLib/CSLib.cxx +++ b/src/FoundationClasses/TKMath/CSLib/CSLib.cxx @@ -259,10 +259,10 @@ void CSLib::Normal(const Standard_Integer MaxOrder, // Creation of the domain of definition depending on the position // of a single point (medium, border, corner). - FU = (Abs(U - Umin) < Precision::PConfusion()); - LU = (Abs(U - Umax) < Precision::PConfusion()); - FV = (Abs(V - Vmin) < Precision::PConfusion()); - LV = (Abs(V - Vmax) < Precision::PConfusion()); + FU = (std::abs(U - Umin) < Precision::PConfusion()); + LU = (std::abs(U - Umax) < Precision::PConfusion()); + FV = (std::abs(V - Vmin) < Precision::PConfusion()); + LV = (std::abs(V - Vmax) < Precision::PConfusion()); if (LU) { inf = M_PI / 2; @@ -334,7 +334,7 @@ void CSLib::Normal(const Standard_Integer MaxOrder, Standard_Integer ifirst = 0; for (i = 0; i <= FindRoots.NbSolutions(); i++) { - if (Abs(Sol0(i + 1) - Sol0(i)) > Precision::PConfusion()) + if (std::abs(Sol0(i + 1) - Sol0(i)) > Precision::PConfusion()) { Poly.Value((Sol0(i) + Sol0(i + 1)) / 2.0, Vsuiv); if (ifirst == 0) diff --git a/src/FoundationClasses/TKMath/CSLib/CSLib_NormalPolyDef.cxx b/src/FoundationClasses/TKMath/CSLib/CSLib_NormalPolyDef.cxx index 8b296651cf..7169018244 100644 --- a/src/FoundationClasses/TKMath/CSLib/CSLib_NormalPolyDef.cxx +++ b/src/FoundationClasses/TKMath/CSLib/CSLib_NormalPolyDef.cxx @@ -36,7 +36,7 @@ Standard_Boolean CSLib_NormalPolyDef::Value(const Standard_Real X, Standard_Real co = cos(X); si = sin(X); - if (Abs(co) <= RealSmall() || Abs(si) <= RealSmall()) + if (std::abs(co) <= RealSmall() || std::abs(si) <= RealSmall()) { F = 0.; return Standard_True; @@ -56,7 +56,7 @@ Standard_Boolean CSLib_NormalPolyDef::Derivative(const Standard_Real X, Standard Standard_Real co, si; co = cos(X); si = sin(X); - if (Abs(co) <= RealSmall() || Abs(si) <= RealSmall()) + if (std::abs(co) <= RealSmall() || std::abs(si) <= RealSmall()) { D = 0.; return Standard_True; @@ -79,7 +79,7 @@ Standard_Boolean CSLib_NormalPolyDef::Values(const Standard_Real X, Standard_Real co, si; co = cos(X); si = sin(X); - if (Abs(co) <= RealSmall() || Abs(si) <= RealSmall()) + if (std::abs(co) <= RealSmall() || std::abs(si) <= RealSmall()) { F = 0.; D = 0.; diff --git a/src/FoundationClasses/TKMath/Convert/Convert_CircleToBSplineCurve.cxx b/src/FoundationClasses/TKMath/Convert/Convert_CircleToBSplineCurve.cxx index 7ec69864e2..8a487dd8c4 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_CircleToBSplineCurve.cxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_CircleToBSplineCurve.cxx @@ -39,8 +39,8 @@ // Wayne Tiller CADG September 1983 // x(t) = (1 - t^2) / (1 + t^2) // y(t) = 2 t / (1 + t^2) -// then t = Sqrt(2) u / ((Sqrt(2) - 2) u + 2) -// => u = 2 t / (Sqrt(2) + (2 - Sqrt(2)) t) +// then t = std::sqrt(2) u / ((std::sqrt(2) - 2) u + 2) +// => u = 2 t / (std::sqrt(2) + (2 - std::sqrt(2)) t) //======================================================================= // function : Convert_CircleToBSplineCurve // purpose : this constructs a periodic circle diff --git a/src/FoundationClasses/TKMath/Convert/Convert_CircleToBSplineCurve.hxx b/src/FoundationClasses/TKMath/Convert/Convert_CircleToBSplineCurve.hxx index 5850a6069c..e14b1e22ec 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_CircleToBSplineCurve.hxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_CircleToBSplineCurve.hxx @@ -27,7 +27,7 @@ class gp_Circ2d; //! This algorithm converts a circle into a rational B-spline curve. //! The circle is a Circ2d from package gp and its parametrization is : -//! P (U) = Loc + R * (Cos(U) * Xdir + Sin(U) * YDir) where Loc is the +//! P (U) = Loc + R * (std::cos(U) * Xdir + std::sin(U) * YDir) where Loc is the //! center of the circle Xdir and Ydir are the normalized directions //! of the local cartesian coordinate system of the circle. //! The parametrization range for the circle is U [0, 2Pi]. diff --git a/src/FoundationClasses/TKMath/Convert/Convert_CompBezierCurves2dToBSplineCurve2d.cxx b/src/FoundationClasses/TKMath/Convert/Convert_CompBezierCurves2dToBSplineCurve2d.cxx index 140300b776..6955e86a3e 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_CompBezierCurves2dToBSplineCurve2d.cxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_CompBezierCurves2dToBSplineCurve2d.cxx @@ -123,7 +123,7 @@ void Convert_CompBezierCurves2dToBSplineCurve2d::Perform() myDegree = 0; for (i = 1; i <= mySequence.Length(); i++) { - myDegree = Max(myDegree, (mySequence(i))->Length() - 1); + myDegree = std::max(myDegree, (mySequence(i))->Length() - 1); } Standard_Real Det = 0; @@ -176,7 +176,7 @@ void Convert_CompBezierCurves2dToBSplineCurve2d::Perform() if (MaxDegree > 1 && // rln 20.06.99 work-around D1 > gp::Resolution() && D2 > gp::Resolution() && V1.IsParallel(V2, myAngular)) { - Standard_Real Lambda = Sqrt(D2 / D1); + Standard_Real Lambda = std::sqrt(D2 / D1); KnotsMultiplicities.Append(MaxDegree - 1); CurveKnVals(i) = CurveKnVals(i - 1) * Lambda; } diff --git a/src/FoundationClasses/TKMath/Convert/Convert_CompBezierCurvesToBSplineCurve.cxx b/src/FoundationClasses/TKMath/Convert/Convert_CompBezierCurvesToBSplineCurve.cxx index 2537075167..4a50f14371 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_CompBezierCurvesToBSplineCurve.cxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_CompBezierCurvesToBSplineCurve.cxx @@ -123,7 +123,7 @@ void Convert_CompBezierCurvesToBSplineCurve::Perform() myDegree = 0; for (i = 1; i <= mySequence.Length(); i++) { - myDegree = Max(myDegree, (mySequence(i))->Length() - 1); + myDegree = std::max(myDegree, (mySequence(i))->Length() - 1); } Standard_Real Det = 0; @@ -177,7 +177,7 @@ void Convert_CompBezierCurvesToBSplineCurve::Perform() if (MaxDegree > 1 && // rln 20.06.99 work-around D1 > gp::Resolution() && D2 > gp::Resolution() && V1.IsParallel(V2, myAngular)) { - Standard_Real Lambda = Sqrt(D2 / D1); + Standard_Real Lambda = std::sqrt(D2 / D1); if (CurveKnVals(i - 1) * Lambda > 10. * Epsilon(Det)) { KnotsMultiplicities.Append(MaxDegree - 1); diff --git a/src/FoundationClasses/TKMath/Convert/Convert_CompPolynomialToPoles.cxx b/src/FoundationClasses/TKMath/Convert/Convert_CompPolynomialToPoles.cxx index 6e84978054..55efff32d0 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_CompPolynomialToPoles.cxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_CompPolynomialToPoles.cxx @@ -58,7 +58,7 @@ Convert_CompPolynomialToPoles::Convert_CompPolynomialToPoles( delta = NumCurves - 1; for (ii = NumCoeffPerCurve->Lower(); ii <= NumCoeffPerCurve->Lower() + delta; ii++) { - myDegree = Max(NumCoeffPerCurve->Value(ii) - 1, myDegree); + myDegree = std::max(NumCoeffPerCurve->Value(ii) - 1, myDegree); } if ((Continuity > myDegree) && (NumCurves > 1)) { @@ -114,7 +114,7 @@ Convert_CompPolynomialToPoles::Convert_CompPolynomialToPoles( delta = NumCurves - 1; for (ii = NumCoeffPerCurve.Lower(); ii <= NumCoeffPerCurve.Lower() + delta; ii++) { - myDegree = Max(NumCoeffPerCurve.Value(ii) - 1, myDegree); + myDegree = std::max(NumCoeffPerCurve.Value(ii) - 1, myDegree); } // // prepare output @@ -245,7 +245,8 @@ void Convert_CompPolynomialToPoles::Perform(const Standard_Integer NumCu normalized_value = (1.0e0 - normalized_value) * PolynomialIntervals(Pindex, PolynomialIntervals.LowerCol()) + normalized_value * PolynomialIntervals(Pindex, PolynomialIntervals.UpperCol()); - coeff_index = ((index - 2) * Dimension * (Max(MaxDegree, myDegree) + 1)) + Coefficients.Lower(); + coeff_index = + ((index - 2) * Dimension * (std::max(MaxDegree, myDegree) + 1)) + Coefficients.Lower(); coefficient_array = (Standard_Real*)&(Coefficients(coeff_index)); Standard_Integer Deg = NumCoeffPerCurve(NumCoeffPerCurve.Lower() + index - 2) - 1; diff --git a/src/FoundationClasses/TKMath/Convert/Convert_ConeToBSplineSurface.cxx b/src/FoundationClasses/TKMath/Convert/Convert_ConeToBSplineSurface.cxx index 5a31e01c57..1c07e99e3b 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_ConeToBSplineSurface.cxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_ConeToBSplineSurface.cxx @@ -40,33 +40,33 @@ static void ComputePoles(const Standard_Real R, Standard_Integer i; // Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds) - Standard_Integer nbUSpans = (Standard_Integer)IntegerPart(1.2 * deltaU / M_PI) + 1; + Standard_Integer nbUSpans = (Standard_Integer)std::trunc(1.2 * deltaU / M_PI) + 1; Standard_Real AlfaU = deltaU / (nbUSpans * 2); Standard_Real x[TheNbVPoles]; Standard_Real z[TheNbVPoles]; - x[0] = R + V1 * Sin(A); - z[0] = V1 * Cos(A); - x[1] = R + V2 * Sin(A); - z[1] = V2 * Cos(A); + x[0] = R + V1 * std::sin(A); + z[0] = V1 * std::cos(A); + x[1] = R + V2 * std::sin(A); + z[1] = V2 * std::cos(A); Standard_Real UStart = U1; - Poles(1, 1) = gp_Pnt(x[0] * Cos(UStart), x[0] * Sin(UStart), z[0]); - Poles(1, 2) = gp_Pnt(x[1] * Cos(UStart), x[1] * Sin(UStart), z[1]); + Poles(1, 1) = gp_Pnt(x[0] * std::cos(UStart), x[0] * std::sin(UStart), z[0]); + Poles(1, 2) = gp_Pnt(x[1] * std::cos(UStart), x[1] * std::sin(UStart), z[1]); for (i = 1; i <= nbUSpans; i++) { - Poles(2 * i, 1) = gp_Pnt(x[0] * Cos(UStart + AlfaU) / Cos(AlfaU), - x[0] * Sin(UStart + AlfaU) / Cos(AlfaU), + Poles(2 * i, 1) = gp_Pnt(x[0] * std::cos(UStart + AlfaU) / std::cos(AlfaU), + x[0] * std::sin(UStart + AlfaU) / std::cos(AlfaU), z[0]); - Poles(2 * i, 2) = gp_Pnt(x[1] * Cos(UStart + AlfaU) / Cos(AlfaU), - x[1] * Sin(UStart + AlfaU) / Cos(AlfaU), + Poles(2 * i, 2) = gp_Pnt(x[1] * std::cos(UStart + AlfaU) / std::cos(AlfaU), + x[1] * std::sin(UStart + AlfaU) / std::cos(AlfaU), z[1]); Poles(2 * i + 1, 1) = - gp_Pnt(x[0] * Cos(UStart + 2 * AlfaU), x[0] * Sin(UStart + 2 * AlfaU), z[0]); + gp_Pnt(x[0] * std::cos(UStart + 2 * AlfaU), x[0] * std::sin(UStart + 2 * AlfaU), z[0]); Poles(2 * i + 1, 2) = - gp_Pnt(x[1] * Cos(UStart + 2 * AlfaU), x[1] * Sin(UStart + 2 * AlfaU), z[1]); + gp_Pnt(x[1] * std::cos(UStart + 2 * AlfaU), x[1] * std::sin(UStart + 2 * AlfaU), z[1]); UStart += 2 * AlfaU; } } @@ -86,7 +86,7 @@ Convert_ConeToBSplineSurface::Convert_ConeToBSplineSurface(const gp_Cone& C TheVDegree) { Standard_Real deltaU = U2 - U1; - Standard_DomainError_Raise_if((Abs(V2 - V1) <= Abs(Epsilon(V1))) || (deltaU > 2 * M_PI) + Standard_DomainError_Raise_if((std::abs(V2 - V1) <= std::abs(Epsilon(V1))) || (deltaU > 2 * M_PI) || (deltaU < 0.), "Convert_ConeToBSplineSurface"); @@ -97,7 +97,7 @@ Convert_ConeToBSplineSurface::Convert_ConeToBSplineSurface(const gp_Cone& C // construction of cone in the reference mark xOy. // Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds) - Standard_Integer nbUSpans = (Standard_Integer)IntegerPart(1.2 * deltaU / M_PI) + 1; + Standard_Integer nbUSpans = (Standard_Integer)std::trunc(1.2 * deltaU / M_PI) + 1; Standard_Real AlfaU = deltaU / (nbUSpans * 2); nbUPoles = 2 * nbUSpans + 1; @@ -132,7 +132,7 @@ Convert_ConeToBSplineSurface::Convert_ConeToBSplineSurface(const gp_Cone& C for (i = 1; i <= nbUPoles; i++) { if (i % 2 == 0) - W1 = Cos(AlfaU); + W1 = std::cos(AlfaU); else W1 = 1.; @@ -156,7 +156,8 @@ Convert_ConeToBSplineSurface::Convert_ConeToBSplineSurface(const gp_Cone& C TheUDegree, TheVDegree) { - Standard_DomainError_Raise_if(Abs(V2 - V1) <= Abs(Epsilon(V1)), "Convert_ConeToBSplineSurface"); + Standard_DomainError_Raise_if(std::abs(V2 - V1) <= std::abs(Epsilon(V1)), + "Convert_ConeToBSplineSurface"); Standard_Integer i, j; @@ -194,7 +195,7 @@ Convert_ConeToBSplineSurface::Convert_ConeToBSplineSurface(const gp_Cone& C for (i = 1; i <= nbUPoles; i++) { if (i % 2 == 0) - W = 0.5; // = Cos(pi /3) + W = 0.5; // = std::cos(pi /3) else W = 1.; diff --git a/src/FoundationClasses/TKMath/Convert/Convert_ConeToBSplineSurface.hxx b/src/FoundationClasses/TKMath/Convert/Convert_ConeToBSplineSurface.hxx index 50a341a076..f44c545dc2 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_ConeToBSplineSurface.hxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_ConeToBSplineSurface.hxx @@ -28,7 +28,7 @@ class gp_Cone; //! B-spline surface. //! The cone a Cone from package gp. Its parametrization is: //! P (U, V) = Loc + V * Zdir + -//! (R + V*Tan(Ang)) * (Cos(U)*Xdir + Sin(U)*Ydir) +//! (R + V*Tan(Ang)) * (std::cos(U)*Xdir + std::sin(U)*Ydir) //! where Loc is the location point of the cone, Xdir, Ydir and Zdir //! are the normalized directions of the local cartesian coordinate //! system of the cone (Zdir is the direction of the Cone's axis), diff --git a/src/FoundationClasses/TKMath/Convert/Convert_ConicToBSplineCurve.cxx b/src/FoundationClasses/TKMath/Convert/Convert_ConicToBSplineCurve.cxx index 1ed3b4076c..3e928b02a8 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_ConicToBSplineCurve.cxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_ConicToBSplineCurve.cxx @@ -280,7 +280,7 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin( switch (Parameterisation) { case Convert_TgtThetaOver2: - num_spans = (Standard_Integer)IntegerPart(1.2 * delta / M_PI) + 1; + num_spans = (Standard_Integer)std::trunc(1.2 * delta / M_PI) + 1; tgt_theta_flag = 1; break; @@ -348,20 +348,20 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin( { param = UFirst; - CosNumeratorPtr->SetValue(1, Cos(UFirst)); - SinNumeratorPtr->SetValue(1, Sin(UFirst)); + CosNumeratorPtr->SetValue(1, std::cos(UFirst)); + SinNumeratorPtr->SetValue(1, std::sin(UFirst)); DenominatorPtr->SetValue(1, 1.0e0); KnotsPtr->SetValue(1, param); MultsPtr->SetValue(1, Degree + 1); - direct = Cos(alpha); + direct = std::cos(alpha); inverse = 1.0e0 / direct; for (ii = 1; ii <= num_spans; ii++) { - CosNumeratorPtr->SetValue(2 * ii, inverse * Cos(param + alpha)); - SinNumeratorPtr->SetValue(2 * ii, inverse * Sin(param + alpha)); + CosNumeratorPtr->SetValue(2 * ii, inverse * std::cos(param + alpha)); + SinNumeratorPtr->SetValue(2 * ii, inverse * std::sin(param + alpha)); DenominatorPtr->SetValue(2 * ii, direct); - CosNumeratorPtr->SetValue(2 * ii + 1, Cos(param + 2 * alpha)); - SinNumeratorPtr->SetValue(2 * ii + 1, Sin(param + 2 * alpha)); + CosNumeratorPtr->SetValue(2 * ii + 1, std::cos(param + 2 * alpha)); + SinNumeratorPtr->SetValue(2 * ii + 1, std::sin(param + 2 * alpha)); DenominatorPtr->SetValue(2 * ii + 1, 1.0e0); KnotsPtr->SetValue(ii + 1, param + 2 * alpha); MultsPtr->SetValue(ii + 1, 2); @@ -375,8 +375,8 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin( alpha *= 0.5e0; beta = ULast + UFirst; beta *= 0.5e0; - cos_beta = Cos(beta); - sin_beta = Sin(beta); + cos_beta = std::cos(beta); + sin_beta = std::sin(beta); num_flat_knots = num_poles + order; num_temp_poles = 4; @@ -436,7 +436,7 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin( } else { - tan_alpha_2 = Tan(alpha_2); + tan_alpha_2 = std::tan(alpha_2); value1 = 3.0e0 * (tan_alpha_2 - alpha_2); value1 = alpha_2 / value1; p_param += value1; @@ -466,7 +466,7 @@ void Convert_ConicToBSplineCurve::BuildCosAndSin( temp_degree = 2; alpha_2 = alpha * 0.5e0; alpha_4 = alpha * 0.25e0; - tan_alpha_2 = Tan(alpha_2); + tan_alpha_2 = std::tan(alpha_2); jj = 1; for (ii = 1; ii <= 2; ii++) { diff --git a/src/FoundationClasses/TKMath/Convert/Convert_CylinderToBSplineSurface.cxx b/src/FoundationClasses/TKMath/Convert/Convert_CylinderToBSplineSurface.cxx index ee88de250d..bc03cdaeb8 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_CylinderToBSplineSurface.cxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_CylinderToBSplineSurface.cxx @@ -39,21 +39,25 @@ static void ComputePoles(const Standard_Real R, Standard_Integer i; // Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds) - Standard_Integer nbUSpans = (Standard_Integer)IntegerPart(1.2 * deltaU / M_PI) + 1; + Standard_Integer nbUSpans = (Standard_Integer)std::trunc(1.2 * deltaU / M_PI) + 1; Standard_Real AlfaU = deltaU / (nbUSpans * 2); Standard_Real UStart = U1; - Poles(1, 1) = gp_Pnt(R * Cos(UStart), R * Sin(UStart), V1); - Poles(1, 2) = gp_Pnt(R * Cos(UStart), R * Sin(UStart), V2); + Poles(1, 1) = gp_Pnt(R * std::cos(UStart), R * std::sin(UStart), V1); + Poles(1, 2) = gp_Pnt(R * std::cos(UStart), R * std::sin(UStart), V2); for (i = 1; i <= nbUSpans; i++) { - Poles(2 * i, 1) = - gp_Pnt(R * Cos(UStart + AlfaU) / Cos(AlfaU), R * Sin(UStart + AlfaU) / Cos(AlfaU), V1); - Poles(2 * i, 2) = - gp_Pnt(R * Cos(UStart + AlfaU) / Cos(AlfaU), R * Sin(UStart + AlfaU) / Cos(AlfaU), V2); - Poles(2 * i + 1, 1) = gp_Pnt(R * Cos(UStart + 2 * AlfaU), R * Sin(UStart + 2 * AlfaU), V1); - Poles(2 * i + 1, 2) = gp_Pnt(R * Cos(UStart + 2 * AlfaU), R * Sin(UStart + 2 * AlfaU), V2); + Poles(2 * i, 1) = gp_Pnt(R * std::cos(UStart + AlfaU) / std::cos(AlfaU), + R * std::sin(UStart + AlfaU) / std::cos(AlfaU), + V1); + Poles(2 * i, 2) = gp_Pnt(R * std::cos(UStart + AlfaU) / std::cos(AlfaU), + R * std::sin(UStart + AlfaU) / std::cos(AlfaU), + V2); + Poles(2 * i + 1, 1) = + gp_Pnt(R * std::cos(UStart + 2 * AlfaU), R * std::sin(UStart + 2 * AlfaU), V1); + Poles(2 * i + 1, 2) = + gp_Pnt(R * std::cos(UStart + 2 * AlfaU), R * std::sin(UStart + 2 * AlfaU), V2); UStart += 2 * AlfaU; } } @@ -73,7 +77,7 @@ Convert_CylinderToBSplineSurface::Convert_CylinderToBSplineSurface(const gp_Cyli TheVDegree) { Standard_Real deltaU = U2 - U1; - Standard_DomainError_Raise_if((Abs(V2 - V1) <= Abs(Epsilon(V1))) || (deltaU > 2 * M_PI) + Standard_DomainError_Raise_if((std::abs(V2 - V1) <= std::abs(Epsilon(V1))) || (deltaU > 2 * M_PI) || (deltaU < 0.), "Convert_CylinderToBSplineSurface"); @@ -84,7 +88,7 @@ Convert_CylinderToBSplineSurface::Convert_CylinderToBSplineSurface(const gp_Cyli // construction of the cylinder in the reference mark xOy. // Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds) - Standard_Integer nbUSpans = (Standard_Integer)IntegerPart(1.2 * deltaU / M_PI) + 1; + Standard_Integer nbUSpans = (Standard_Integer)std::trunc(1.2 * deltaU / M_PI) + 1; Standard_Real AlfaU = deltaU / (nbUSpans * 2); nbUPoles = 2 * nbUSpans + 1; @@ -118,7 +122,7 @@ Convert_CylinderToBSplineSurface::Convert_CylinderToBSplineSurface(const gp_Cyli for (i = 1; i <= nbUPoles; i++) { if (i % 2 == 0) - W1 = Cos(AlfaU); + W1 = std::cos(AlfaU); else W1 = 1.; @@ -142,7 +146,7 @@ Convert_CylinderToBSplineSurface::Convert_CylinderToBSplineSurface(const gp_Cyli TheUDegree, TheVDegree) { - Standard_DomainError_Raise_if(Abs(V2 - V1) <= Abs(Epsilon(V1)), + Standard_DomainError_Raise_if(std::abs(V2 - V1) <= std::abs(Epsilon(V1)), "Convert_CylinderToBSplineSurface"); Standard_Integer i, j; @@ -180,7 +184,7 @@ Convert_CylinderToBSplineSurface::Convert_CylinderToBSplineSurface(const gp_Cyli for (i = 1; i <= nbUPoles; i++) { if (i % 2 == 0) - W = 0.5; // = Cos(pi /3) + W = 0.5; // = std::cos(pi /3) else W = 1.; diff --git a/src/FoundationClasses/TKMath/Convert/Convert_CylinderToBSplineSurface.hxx b/src/FoundationClasses/TKMath/Convert/Convert_CylinderToBSplineSurface.hxx index 8253626c88..a1b5522669 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_CylinderToBSplineSurface.hxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_CylinderToBSplineSurface.hxx @@ -27,7 +27,7 @@ class gp_Cylinder; //! This algorithm converts a bounded cylinder into a rational //! B-spline surface. The cylinder is a Cylinder from package gp. //! The parametrization of the cylinder is: -//! P (U, V) = Loc + V * Zdir + Radius * (Xdir*Cos(U) + Ydir*Sin(U)) +//! P (U, V) = Loc + V * Zdir + Radius * (Xdir*std::cos(U) + Ydir*Sin(U)) //! where Loc is the location point of the cylinder, Xdir, Ydir and //! Zdir are the normalized directions of the local cartesian //! coordinate system of the cylinder (Zdir is the direction of the diff --git a/src/FoundationClasses/TKMath/Convert/Convert_EllipseToBSplineCurve.cxx b/src/FoundationClasses/TKMath/Convert/Convert_EllipseToBSplineCurve.cxx index 7d166b1724..60d87833da 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_EllipseToBSplineCurve.cxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_EllipseToBSplineCurve.cxx @@ -39,8 +39,8 @@ // Wayne Tiller CADG September 1983 // x(t) = (1 - t^2) / (1 + t^2) // y(t) = 2 t / (1 + t^2) -// then t = Sqrt(2) u / ((Sqrt(2) - 2) u + 2) -// => u = 2 t / (Sqrt(2) + (2 - Sqrt(2)) t) +// then t = std::sqrt(2) u / ((std::sqrt(2) - 2) u + 2) +// => u = 2 t / (std::sqrt(2) + (2 - std::sqrt(2)) t) //======================================================================= // function : Convert_EllipseToBSplineCurve // purpose : this constructs a periodic Ellipse diff --git a/src/FoundationClasses/TKMath/Convert/Convert_EllipseToBSplineCurve.hxx b/src/FoundationClasses/TKMath/Convert/Convert_EllipseToBSplineCurve.hxx index 67e54f05e7..b1cb4f70e4 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_EllipseToBSplineCurve.hxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_EllipseToBSplineCurve.hxx @@ -29,7 +29,7 @@ class gp_Elips2d; //! The ellipse is represented an Elips2d from package gp with //! the parametrization : //! P (U) = -//! Loc + (MajorRadius * Cos(U) * Xdir + MinorRadius * Sin(U) * Ydir) +//! Loc + (MajorRadius * std::cos(U) * Xdir + MinorRadius * std::sin(U) * Ydir) //! where Loc is the center of the ellipse, Xdir and Ydir are the //! normalized directions of the local cartesian coordinate system of //! the ellipse. The parametrization range is U [0, 2PI]. diff --git a/src/FoundationClasses/TKMath/Convert/Convert_GridPolynomialToPoles.cxx b/src/FoundationClasses/TKMath/Convert/Convert_GridPolynomialToPoles.cxx index c6a08010b2..377c76c3ce 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_GridPolynomialToPoles.cxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_GridPolynomialToPoles.cxx @@ -87,8 +87,8 @@ Convert_GridPolynomialToPoles::Convert_GridPolynomialToPoles( : myDone(Standard_False) { Standard_Integer ii; - Standard_Integer RealUDegree = Max(MaxUDegree, 2 * UContinuity + 1); - Standard_Integer RealVDegree = Max(MaxVDegree, 2 * VContinuity + 1); + Standard_Integer RealUDegree = std::max(MaxUDegree, 2 * UContinuity + 1); + Standard_Integer RealVDegree = std::max(MaxVDegree, 2 * VContinuity + 1); myUDegree = 0; myVDegree = 0; diff --git a/src/FoundationClasses/TKMath/Convert/Convert_HyperbolaToBSplineCurve.cxx b/src/FoundationClasses/TKMath/Convert/Convert_HyperbolaToBSplineCurve.cxx index aacebfb4ba..f53fef0e1b 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_HyperbolaToBSplineCurve.cxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_HyperbolaToBSplineCurve.cxx @@ -36,10 +36,10 @@ Convert_HyperbolaToBSplineCurve::Convert_HyperbolaToBSplineCurve(const gp_Hypr2d : Convert_ConicToBSplineCurve(MaxNbPoles, MaxNbKnots, TheDegree) { - Standard_DomainError_Raise_if(Abs(U2 - U1) < Epsilon(0.), "Convert_ParabolaToBSplineCurve"); + Standard_DomainError_Raise_if(std::abs(U2 - U1) < Epsilon(0.), "Convert_ParabolaToBSplineCurve"); - Standard_Real UF = Min(U1, U2); - Standard_Real UL = Max(U1, U2); + Standard_Real UF = std::min(U1, U2); + Standard_Real UL = std::max(U1, U2); nbPoles = 3; nbKnots = 2; @@ -60,18 +60,18 @@ Convert_HyperbolaToBSplineCurve::Convert_HyperbolaToBSplineCurve(const gp_Hypr2d // poles expressed in the reference mark // the 2nd pole is at the intersection of 2 tangents to the curve // at points P(UF), P(UL) - // the weight of this pole is equal to : Cosh((UL-UF)/2) + // the weight of this pole is equal to : std::cosh((UL-UF)/2) weights->ChangeArray1()(1) = 1.; - weights->ChangeArray1()(2) = Cosh((UL - UF) / 2); + weights->ChangeArray1()(2) = std::cosh((UL - UF) / 2); weights->ChangeArray1()(3) = 1.; - Standard_Real delta = Sinh(UL - UF); - Standard_Real x = R * (Sinh(UL) - Sinh(UF)) / delta; - Standard_Real y = S * r * (Cosh(UL) - Cosh(UF)) / delta; - poles->ChangeArray1()(1) = gp_Pnt2d(R * Cosh(UF), S * r * Sinh(UF)); + Standard_Real delta = std::sinh(UL - UF); + Standard_Real x = R * (std::sinh(UL) - std::sinh(UF)) / delta; + Standard_Real y = S * r * (std::cosh(UL) - std::cosh(UF)) / delta; + poles->ChangeArray1()(1) = gp_Pnt2d(R * std::cosh(UF), S * r * std::sinh(UF)); poles->ChangeArray1()(2) = gp_Pnt2d(x, y); - poles->ChangeArray1()(3) = gp_Pnt2d(R * Cosh(UL), S * r * Sinh(UL)); + poles->ChangeArray1()(3) = gp_Pnt2d(R * std::cosh(UL), S * r * std::sinh(UL)); // replace the bspline in the mark of the hyperbola gp_Trsf2d Trsf; diff --git a/src/FoundationClasses/TKMath/Convert/Convert_HyperbolaToBSplineCurve.hxx b/src/FoundationClasses/TKMath/Convert/Convert_HyperbolaToBSplineCurve.hxx index e9e3efb7ec..1bd8fbdc2f 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_HyperbolaToBSplineCurve.hxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_HyperbolaToBSplineCurve.hxx @@ -28,7 +28,7 @@ class gp_Hypr2d; //! The hyperbola is an Hypr2d from package gp with the //! parametrization : //! P (U) = -//! Loc + (MajorRadius * Cosh(U) * Xdir + MinorRadius * Sinh(U) * Ydir) +//! Loc + (MajorRadius * std::cosh(U) * Xdir + MinorRadius * std::sinh(U) * Ydir) //! where Loc is the location point of the hyperbola, Xdir and Ydir are //! the normalized directions of the local cartesian coordinate system //! of the hyperbola. diff --git a/src/FoundationClasses/TKMath/Convert/Convert_ParabolaToBSplineCurve.cxx b/src/FoundationClasses/TKMath/Convert/Convert_ParabolaToBSplineCurve.cxx index 56517c96ad..f5b138548e 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_ParabolaToBSplineCurve.cxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_ParabolaToBSplineCurve.cxx @@ -35,10 +35,10 @@ Convert_ParabolaToBSplineCurve::Convert_ParabolaToBSplineCurve(const gp_Parab2d& const Standard_Real U2) : Convert_ConicToBSplineCurve(MaxNbPoles, MaxNbKnots, TheDegree) { - Standard_DomainError_Raise_if(Abs(U2 - U1) < Epsilon(0.), "Convert_ParabolaToBSplineCurve"); + Standard_DomainError_Raise_if(std::abs(U2 - U1) < Epsilon(0.), "Convert_ParabolaToBSplineCurve"); - Standard_Real UF = Min(U1, U2); - Standard_Real UL = Max(U1, U2); + Standard_Real UF = std::min(U1, U2); + Standard_Real UL = std::max(U1, U2); Standard_Real p = Prb.Parameter(); diff --git a/src/FoundationClasses/TKMath/Convert/Convert_PolynomialCosAndSin.cxx b/src/FoundationClasses/TKMath/Convert/Convert_PolynomialCosAndSin.cxx index a3386e5440..9d889b8181 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_PolynomialCosAndSin.cxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_PolynomialCosAndSin.cxx @@ -33,17 +33,17 @@ static Standard_Real Locate(const Standard_Real Angfin, Standard_Real umax = Umax; Standard_Real Ptol = Precision::Angular(); Standard_Real Utol = Precision::PConfusion(); - while (Abs(umax - umin) >= Utol) + while (std::abs(umax - umin) >= Utol) { Standard_Real ptest = (umax + umin) / 2.; gp_Pnt2d valP; BSplCLib::D0(ptest, TPoles, BSplCLib::NoWeights(), valP); - Standard_Real theta = ATan2(valP.Y(), valP.X()); + Standard_Real theta = std::atan2(valP.Y(), valP.X()); if (theta < 0.) { theta += 2. * M_PI; } - if (Abs(theta - Angfin) < Ptol) + if (std::abs(theta - Angfin) < Ptol) { return ptest; } @@ -117,10 +117,10 @@ void BuildPolynomialCosAndSin(const Standard_Real UFirst, t_min = 1.0e0 - (Delta * 1.3e0 / M_PI); t_min *= 0.5e0; - t_min = Max(t_min, 0.0e0); + t_min = std::max(t_min, 0.0e0); t_max = 1.0e0 + (Delta * 1.3e0 / M_PI); t_max *= 0.5e0; - t_max = Min(t_max, 1.0e0); + t_max = std::min(t_max, 1.0e0); trim_max = Locate(Delta, TPoles, t_min, t_max); // // as Bezier is symmetric correspondingly to the bissector @@ -152,7 +152,7 @@ void BuildPolynomialCosAndSin(const Standard_Real UFirst, BSplCLib::NoWeights()); // readjustment is obviously redundant - Standard_Real SinD = Sin(Delta), CosD = Cos(Delta); + Standard_Real SinD = std::sin(Delta), CosD = std::cos(Delta); gp_Pnt2d Pdeb(1., 0.); gp_Pnt2d Pfin(CosD, SinD); @@ -200,10 +200,10 @@ void BuildHermitePolynomialCosAndSin Standard_Integer ii; Standard_Integer ordre_deriv = num_poles/2; Standard_Real ang = ULast - UFirst; - Standard_Real Cd = Cos(UFirst); - Standard_Real Sd = Sin(UFirst); - Standard_Real Cf = Cos(ULast); - Standard_Real Sf = Sin(ULast); + Standard_Real Cd = std::cos(UFirst); + Standard_Real Sd = std::sin(UFirst); + Standard_Real Cf = std::cos(ULast); + Standard_Real Sf = std::sin(ULast); Standard_Integer Degree = num_poles-1; TColStd_Array1OfReal FlatKnots(1,2*num_poles); diff --git a/src/FoundationClasses/TKMath/Convert/Convert_SphereToBSplineSurface.cxx b/src/FoundationClasses/TKMath/Convert/Convert_SphereToBSplineSurface.cxx index 98fb539bf7..cae65817ed 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_SphereToBSplineSurface.cxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_SphereToBSplineSurface.cxx @@ -40,8 +40,8 @@ static void ComputePoles(const Standard_Real R, Standard_Integer i, j; // Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds) - Standard_Integer nbUSpans = (Standard_Integer)IntegerPart(1.2 * deltaU / M_PI) + 1; - Standard_Integer nbVSpans = (Standard_Integer)IntegerPart(1.2 * deltaV / M_PI) + 1; + Standard_Integer nbUSpans = (Standard_Integer)std::trunc(1.2 * deltaU / M_PI) + 1; + Standard_Integer nbVSpans = (Standard_Integer)std::trunc(1.2 * deltaV / M_PI) + 1; Standard_Real AlfaU = deltaU / (nbUSpans * 2); Standard_Real AlfaV = deltaV / (nbVSpans * 2); @@ -50,34 +50,34 @@ static void ComputePoles(const Standard_Real R, Standard_Real x[MaxNbVPoles]; Standard_Real z[MaxNbVPoles]; - x[0] = R * Cos(V1); - z[0] = R * Sin(V1); + x[0] = R * std::cos(V1); + z[0] = R * std::sin(V1); Standard_Real VStart = V1; for (i = 1; i <= nbVSpans; i++) { - x[2 * i - 1] = R * Cos(VStart + AlfaV) / Cos(AlfaV); - z[2 * i - 1] = R * Sin(VStart + AlfaV) / Cos(AlfaV); - x[2 * i] = R * Cos(VStart + 2 * AlfaV); - z[2 * i] = R * Sin(VStart + 2 * AlfaV); + x[2 * i - 1] = R * std::cos(VStart + AlfaV) / std::cos(AlfaV); + z[2 * i - 1] = R * std::sin(VStart + AlfaV) / std::cos(AlfaV); + x[2 * i] = R * std::cos(VStart + 2 * AlfaV); + z[2 * i] = R * std::sin(VStart + 2 * AlfaV); VStart += 2 * AlfaV; } Standard_Real UStart = U1; for (j = 0; j <= nbVP - 1; j++) { - Poles(1, j + 1) = gp_Pnt(x[j] * Cos(UStart), x[j] * Sin(UStart), z[j]); + Poles(1, j + 1) = gp_Pnt(x[j] * std::cos(UStart), x[j] * std::sin(UStart), z[j]); } for (i = 1; i <= nbUSpans; i++) { for (j = 0; j <= nbVP - 1; j++) { - Poles(2 * i, j + 1) = gp_Pnt(x[j] * Cos(UStart + AlfaU) / Cos(AlfaU), - x[j] * Sin(UStart + AlfaU) / Cos(AlfaU), + Poles(2 * i, j + 1) = gp_Pnt(x[j] * std::cos(UStart + AlfaU) / std::cos(AlfaU), + x[j] * std::sin(UStart + AlfaU) / std::cos(AlfaU), z[j]); Poles(2 * i + 1, j + 1) = - gp_Pnt(x[j] * Cos(UStart + 2 * AlfaU), x[j] * Sin(UStart + 2 * AlfaU), z[j]); + gp_Pnt(x[j] * std::cos(UStart + 2 * AlfaU), x[j] * std::sin(UStart + 2 * AlfaU), z[j]); } UStart += 2 * AlfaU; } @@ -110,8 +110,8 @@ Convert_SphereToBSplineSurface::Convert_SphereToBSplineSurface(const gp_Sphere& // construction of the sphere in the reference mark xOy. // Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds) - Standard_Integer nbUSpans = (Standard_Integer)IntegerPart(1.2 * deltaU / M_PI) + 1; - Standard_Integer nbVSpans = (Standard_Integer)IntegerPart(1.2 * deltaV / M_PI) + 1; + Standard_Integer nbUSpans = (Standard_Integer)std::trunc(1.2 * deltaU / M_PI) + 1; + Standard_Integer nbVSpans = (Standard_Integer)std::trunc(1.2 * deltaV / M_PI) + 1; Standard_Real AlfaU = deltaU / (nbUSpans * 2); Standard_Real AlfaV = deltaV / (nbVSpans * 2); @@ -148,14 +148,14 @@ Convert_SphereToBSplineSurface::Convert_SphereToBSplineSurface(const gp_Sphere& for (i = 1; i <= nbUPoles; i++) { if (i % 2 == 0) - W1 = Cos(AlfaU); + W1 = std::cos(AlfaU); else W1 = 1.; for (j = 1; j <= nbVPoles; j++) { if (j % 2 == 0) - W2 = Cos(AlfaV); + W2 = std::cos(AlfaV); else W2 = 1.; @@ -202,7 +202,7 @@ Convert_SphereToBSplineSurface::Convert_SphereToBSplineSurface(const gp_Sphere& nbUKnots = 4; deltaV = Param2 - Param1; - Standard_Integer nbVSpans = (Standard_Integer)IntegerPart(1.2 * deltaV / M_PI) + 1; + Standard_Integer nbVSpans = (Standard_Integer)std::trunc(1.2 * deltaV / M_PI) + 1; Standard_Real AlfaV = deltaV / (nbVSpans * 2); nbVPoles = 2 * nbVSpans + 1; nbVKnots = nbVSpans + 1; @@ -220,8 +220,8 @@ Convert_SphereToBSplineSurface::Convert_SphereToBSplineSurface(const gp_Sphere& vmults(1)++; vmults(nbVKnots)++; - CosU = 0.5; // = Cos(pi /3) - CosV = Cos(AlfaV); + CosU = 0.5; // = std::cos(pi /3) + CosV = std::cos(AlfaV); } else { @@ -231,7 +231,7 @@ Convert_SphereToBSplineSurface::Convert_SphereToBSplineSurface(const gp_Sphere& nbVKnots = 3; deltaU = Param2 - Param1; - Standard_Integer nbUSpans = (Standard_Integer)IntegerPart(1.2 * deltaU / M_PI) + 1; + Standard_Integer nbUSpans = (Standard_Integer)std::trunc(1.2 * deltaU / M_PI) + 1; Standard_Real AlfaU = deltaU / (nbUSpans * 2); nbUPoles = 2 * nbUSpans + 1; nbUKnots = nbUSpans + 1; @@ -250,8 +250,8 @@ Convert_SphereToBSplineSurface::Convert_SphereToBSplineSurface(const gp_Sphere& umults(1)++; umults(nbUKnots)++; - CosV = 0.5; // = Cos(pi /3) - CosU = Cos(AlfaU); + CosV = 0.5; // = std::cos(pi /3) + CosU = std::cos(AlfaU); } // Replace the bspline in the mark of the sphere. @@ -335,7 +335,7 @@ Convert_SphereToBSplineSurface::Convert_SphereToBSplineSurface(const gp_Sphere& for (j = 1; j <= nbVPoles; j++) { if (j % 2 == 0) - W2 = Sqrt(2.) / 2.; + W2 = std::sqrt(2.) / 2.; else W2 = 1.; diff --git a/src/FoundationClasses/TKMath/Convert/Convert_SphereToBSplineSurface.hxx b/src/FoundationClasses/TKMath/Convert/Convert_SphereToBSplineSurface.hxx index 2283a8bcfc..26961564d0 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_SphereToBSplineSurface.hxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_SphereToBSplineSurface.hxx @@ -28,8 +28,8 @@ class gp_Sphere; //! This algorithm converts a bounded Sphere into a rational //! B-spline surface. The sphere is a Sphere from package gp. //! The parametrization of the sphere is: -//! P (U, V) = Loc + Radius * Sin(V) * Zdir + -//! Radius * Cos(V) * (Cos(U)*Xdir + Sin(U)*Ydir) +//! P (U, V) = Loc + Radius * std::sin(V) * Zdir + +//! Radius * std::cos(V) * (std::cos(U)*Xdir + std::sin(U)*Ydir) //! where Loc is the center of the sphere Xdir, Ydir and Zdir are the //! normalized directions of the local cartesian coordinate system of //! the sphere. The parametrization range is U [0, 2PI] and diff --git a/src/FoundationClasses/TKMath/Convert/Convert_TorusToBSplineSurface.cxx b/src/FoundationClasses/TKMath/Convert/Convert_TorusToBSplineSurface.cxx index b3ea5a6cd6..cbd22c8bcb 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_TorusToBSplineSurface.cxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_TorusToBSplineSurface.cxx @@ -41,8 +41,8 @@ static void ComputePoles(const Standard_Real R, Standard_Integer i, j; // Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds) - Standard_Integer nbUSpans = (Standard_Integer)IntegerPart(1.2 * deltaU / M_PI) + 1; - Standard_Integer nbVSpans = (Standard_Integer)IntegerPart(1.2 * deltaV / M_PI) + 1; + Standard_Integer nbUSpans = (Standard_Integer)std::trunc(1.2 * deltaU / M_PI) + 1; + Standard_Integer nbVSpans = (Standard_Integer)std::trunc(1.2 * deltaV / M_PI) + 1; Standard_Real AlfaU = deltaU / (nbUSpans * 2); Standard_Real AlfaV = deltaV / (nbVSpans * 2); @@ -51,34 +51,34 @@ static void ComputePoles(const Standard_Real R, Standard_Real x[MaxNbVPoles]; Standard_Real z[MaxNbVPoles]; - x[0] = R + r * Cos(V1); - z[0] = r * Sin(V1); + x[0] = R + r * std::cos(V1); + z[0] = r * std::sin(V1); Standard_Real VStart = V1; for (i = 1; i <= nbVSpans; i++) { - x[2 * i - 1] = R + r * Cos(VStart + AlfaV) / Cos(AlfaV); - z[2 * i - 1] = r * Sin(VStart + AlfaV) / Cos(AlfaV); - x[2 * i] = R + r * Cos(VStart + 2 * AlfaV); - z[2 * i] = r * Sin(VStart + 2 * AlfaV); + x[2 * i - 1] = R + r * std::cos(VStart + AlfaV) / std::cos(AlfaV); + z[2 * i - 1] = r * std::sin(VStart + AlfaV) / std::cos(AlfaV); + x[2 * i] = R + r * std::cos(VStart + 2 * AlfaV); + z[2 * i] = r * std::sin(VStart + 2 * AlfaV); VStart += 2 * AlfaV; } Standard_Real UStart = U1; for (j = 0; j <= nbVP - 1; j++) { - Poles(1, j + 1) = gp_Pnt(x[j] * Cos(UStart), x[j] * Sin(UStart), z[j]); + Poles(1, j + 1) = gp_Pnt(x[j] * std::cos(UStart), x[j] * std::sin(UStart), z[j]); } for (i = 1; i <= nbUSpans; i++) { for (j = 0; j <= nbVP - 1; j++) { - Poles(2 * i, j + 1) = gp_Pnt(x[j] * Cos(UStart + AlfaU) / Cos(AlfaU), - x[j] * Sin(UStart + AlfaU) / Cos(AlfaU), + Poles(2 * i, j + 1) = gp_Pnt(x[j] * std::cos(UStart + AlfaU) / std::cos(AlfaU), + x[j] * std::sin(UStart + AlfaU) / std::cos(AlfaU), z[j]); Poles(2 * i + 1, j + 1) = - gp_Pnt(x[j] * Cos(UStart + 2 * AlfaU), x[j] * Sin(UStart + 2 * AlfaU), z[j]); + gp_Pnt(x[j] * std::cos(UStart + 2 * AlfaU), x[j] * std::sin(UStart + 2 * AlfaU), z[j]); } UStart += 2 * AlfaU; } @@ -111,8 +111,8 @@ Convert_TorusToBSplineSurface::Convert_TorusToBSplineSurface(const gp_Torus& // construction of the torus in the reference mark xOy. // Number of spans : maximum opening = 150 degrees ( = PI / 1.2 rds) - Standard_Integer nbUSpans = (Standard_Integer)IntegerPart(1.2 * deltaU / M_PI) + 1; - Standard_Integer nbVSpans = (Standard_Integer)IntegerPart(1.2 * deltaV / M_PI) + 1; + Standard_Integer nbUSpans = (Standard_Integer)std::trunc(1.2 * deltaU / M_PI) + 1; + Standard_Integer nbVSpans = (Standard_Integer)std::trunc(1.2 * deltaV / M_PI) + 1; Standard_Real AlfaU = deltaU / (nbUSpans * 2); Standard_Real AlfaV = deltaV / (nbVSpans * 2); @@ -150,14 +150,14 @@ Convert_TorusToBSplineSurface::Convert_TorusToBSplineSurface(const gp_Torus& for (i = 1; i <= nbUPoles; i++) { if (i % 2 == 0) - W1 = Cos(AlfaU); + W1 = std::cos(AlfaU); else W1 = 1.; for (j = 1; j <= nbVPoles; j++) { if (j % 2 == 0) - W2 = Cos(AlfaV); + W2 = std::cos(AlfaV); else W2 = 1.; @@ -205,7 +205,7 @@ Convert_TorusToBSplineSurface::Convert_TorusToBSplineSurface(const gp_Torus& nbUKnots = 4; deltaV = Param2 - Param1; - Standard_Integer nbVSpans = (Standard_Integer)IntegerPart(1.2 * deltaV / M_PI) + 1; + Standard_Integer nbVSpans = (Standard_Integer)std::trunc(1.2 * deltaV / M_PI) + 1; Standard_Real AlfaV = deltaV / (nbVSpans * 2); nbVPoles = 2 * nbVSpans + 1; nbVKnots = nbVSpans + 1; @@ -223,8 +223,8 @@ Convert_TorusToBSplineSurface::Convert_TorusToBSplineSurface(const gp_Torus& vmults(1)++; vmults(nbVKnots)++; - CosU = 0.5; // = Cos(pi /3) - CosV = Cos(AlfaV); + CosU = 0.5; // = std::cos(pi /3) + CosV = std::cos(AlfaV); } else { @@ -234,7 +234,7 @@ Convert_TorusToBSplineSurface::Convert_TorusToBSplineSurface(const gp_Torus& nbVKnots = 4; deltaU = Param2 - Param1; - Standard_Integer nbUSpans = (Standard_Integer)IntegerPart(1.2 * deltaU / M_PI) + 1; + Standard_Integer nbUSpans = (Standard_Integer)std::trunc(1.2 * deltaU / M_PI) + 1; Standard_Real AlfaU = deltaU / (nbUSpans * 2); nbUPoles = 2 * nbUSpans + 1; nbUKnots = nbUSpans + 1; @@ -252,8 +252,8 @@ Convert_TorusToBSplineSurface::Convert_TorusToBSplineSurface(const gp_Torus& umults(1)++; umults(nbUKnots)++; - CosV = 0.5; // = Cos(pi /3) - CosU = Cos(AlfaU); + CosV = 0.5; // = std::cos(pi /3) + CosU = std::cos(AlfaU); } // Replace the bspline in the reference of the torus. diff --git a/src/FoundationClasses/TKMath/Convert/Convert_TorusToBSplineSurface.hxx b/src/FoundationClasses/TKMath/Convert/Convert_TorusToBSplineSurface.hxx index c6c5c1919d..28da223c2b 100644 --- a/src/FoundationClasses/TKMath/Convert/Convert_TorusToBSplineSurface.hxx +++ b/src/FoundationClasses/TKMath/Convert/Convert_TorusToBSplineSurface.hxx @@ -29,8 +29,8 @@ class gp_Torus; //! B-spline surface. The torus is a Torus from package gp. //! The parametrization of the torus is : //! P (U, V) = -//! Loc + MinorRadius * Sin(V) * Zdir + -//! (MajorRadius+MinorRadius*Cos(V)) * (Cos(U)*Xdir + Sin(U)*Ydir) +//! Loc + MinorRadius * std::sin(V) * Zdir + +//! (MajorRadius+MinorRadius*std::cos(V)) * (std::cos(U)*Xdir + std::sin(U)*Ydir) //! where Loc is the center of the torus, Xdir, Ydir and Zdir are the //! normalized directions of the local cartesian coordinate system of //! the Torus. The parametrization range is U [0, 2PI], V [0, 2PI]. diff --git a/src/FoundationClasses/TKMath/ElCLib/ElCLib.cxx b/src/FoundationClasses/TKMath/ElCLib/ElCLib.cxx index a3fc21f1ac..8cbbaa60c6 100644 --- a/src/FoundationClasses/TKMath/ElCLib/ElCLib.cxx +++ b/src/FoundationClasses/TKMath/ElCLib/ElCLib.cxx @@ -42,6 +42,7 @@ #include #include #include +#include namespace { @@ -108,7 +109,7 @@ Standard_Real ElCLib::InPeriod(const Standard_Real theU, return theU; } - return Max(theUFirst, theU + aPeriod * Ceiling((theUFirst - theU) / aPeriod)); + return std::max(theUFirst, theU + aPeriod * std::ceil((theUFirst - theU) / aPeriod)); } //================================================================================================= @@ -137,12 +138,12 @@ void ElCLib::AdjustPeriodic(const Standard_Real UFirst, return; } - U1 -= Floor((U1 - UFirst) / aPeriod) * aPeriod; + U1 -= std::floor((U1 - UFirst) / aPeriod) * aPeriod; if (ULast - U1 < Preci) { U1 -= aPeriod; } - U2 -= Floor((U2 - U1) / aPeriod) * aPeriod; + U2 -= std::floor((U2 - U1) / aPeriod) * aPeriod; if (U2 - U1 < Preci) { U2 += aPeriod; @@ -199,8 +200,8 @@ gp_Pnt ElCLib::HyperbolaValue(const Standard_Real U, const gp_XYZ& XDir = Pos.XDirection().XYZ(); const gp_XYZ& YDir = Pos.YDirection().XYZ(); const gp_XYZ& PLoc = Pos.Location().XYZ(); - const Standard_Real A1 = MajorRadius * Cosh(U); - const Standard_Real A2 = MinorRadius * Sinh(U); + const Standard_Real A1 = MajorRadius * std::cosh(U); + const Standard_Real A2 = MinorRadius * std::sinh(U); return gp_Pnt(A1 * XDir.X() + A2 * YDir.X() + PLoc.X(), A1 * XDir.Y() + A2 * YDir.Y() + PLoc.Y(), A1 * XDir.Z() + A2 * YDir.Z() + PLoc.Z()); @@ -243,8 +244,8 @@ void ElCLib::CircleD1(const Standard_Real U, gp_Pnt& P, gp_Vec& V1) { - const Standard_Real Xc = Radius * Cos(U); - const Standard_Real Yc = Radius * Sin(U); + const Standard_Real Xc = Radius * std::cos(U); + const Standard_Real Yc = Radius * std::sin(U); const gp_XYZ& Coord1(Pos.XDirection().XYZ()); const gp_XYZ& Coord2(Pos.YDirection().XYZ()); gp_XYZ Coord0; @@ -265,8 +266,8 @@ void ElCLib::EllipseD1(const Standard_Real U, gp_Pnt& P, gp_Vec& V1) { - const Standard_Real Xc = Cos(U); - const Standard_Real Yc = Sin(U); + const Standard_Real Xc = std::cos(U); + const Standard_Real Yc = std::sin(U); const gp_XYZ& Coord1(Pos.XDirection().XYZ()); const gp_XYZ& Coord2(Pos.YDirection().XYZ()); gp_XYZ Coord0; @@ -287,8 +288,8 @@ void ElCLib::HyperbolaD1(const Standard_Real U, gp_Pnt& P, gp_Vec& V1) { - const Standard_Real Xc = Cosh(U); - const Standard_Real Yc = Sinh(U); + const Standard_Real Xc = std::cosh(U); + const Standard_Real Yc = std::sinh(U); const gp_XYZ& Coord1(Pos.XDirection().XYZ()); const gp_XYZ& Coord2(Pos.YDirection().XYZ()); gp_XYZ Coord0; @@ -388,8 +389,8 @@ void ElCLib::HyperbolaD2(const Standard_Real U, gp_Vec& V1, gp_Vec& V2) { - const Standard_Real Xc = Cosh(U); - const Standard_Real Yc = Sinh(U); + const Standard_Real Xc = std::cosh(U); + const Standard_Real Yc = std::sinh(U); const gp_XYZ& Coord1(Pos.XDirection().XYZ()); const gp_XYZ& Coord2(Pos.YDirection().XYZ()); gp_XYZ Coord0; @@ -505,8 +506,8 @@ void ElCLib::HyperbolaD3(const Standard_Real U, gp_Vec& V2, gp_Vec& V3) { - const Standard_Real Xc = Cosh(U); - const Standard_Real Yc = Sinh(U); + const Standard_Real Xc = std::cosh(U); + const Standard_Real Yc = std::sinh(U); const gp_XYZ& Coord1(Pos.XDirection().XYZ()); const gp_XYZ& Coord2(Pos.YDirection().XYZ()); gp_XYZ Coord0; @@ -569,8 +570,8 @@ gp_Pnt2d ElCLib::HyperbolaValue(const Standard_Real U, const gp_XY& XDir = Pos.XDirection().XY(); const gp_XY& YDir = Pos.YDirection().XY(); const gp_XY& PLoc = Pos.Location().XY(); - const Standard_Real A1 = MajorRadius * Cosh(U); - const Standard_Real A2 = MinorRadius * Sinh(U); + const Standard_Real A1 = MajorRadius * std::cosh(U); + const Standard_Real A2 = MinorRadius * std::sinh(U); return gp_Pnt2d(A1 * XDir.X() + A2 * YDir.X() + PLoc.X(), A1 * XDir.Y() + A2 * YDir.Y() + PLoc.Y()); } @@ -657,8 +658,8 @@ void ElCLib::HyperbolaD1(const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1) { - const Standard_Real Xc = Cosh(U); - const Standard_Real Yc = Sinh(U); + const Standard_Real Xc = std::cosh(U); + const Standard_Real Yc = std::sinh(U); const gp_XY& Xdir((Pos.XDirection()).XY()); const gp_XY& Ydir((Pos.YDirection()).XY()); gp_XY Vxy; @@ -764,8 +765,8 @@ void ElCLib::HyperbolaD2(const Standard_Real U, { const gp_XY& Xdir(Pos.XDirection().XY()); const gp_XY& Ydir(Pos.YDirection().XY()); - const Standard_Real Xc = Cosh(U); - const Standard_Real Yc = Sinh(U); + const Standard_Real Xc = std::cosh(U); + const Standard_Real Yc = std::sinh(U); gp_XY Vxy; // V2 : @@ -893,8 +894,8 @@ void ElCLib::HyperbolaD3(const Standard_Real U, { const gp_XY& Xdir(Pos.XDirection().XY()); const gp_XY& Ydir(Pos.YDirection().XY()); - const Standard_Real Xc = Cosh(U); - const Standard_Real Yc = Sinh(U); + const Standard_Real Xc = std::cosh(U); + const Standard_Real Yc = std::sinh(U); gp_XY Vxy; // V2 : @@ -1012,13 +1013,13 @@ gp_Vec ElCLib::HyperbolaDN(const Standard_Real U, Standard_Real Xc = 0, Yc = 0; if (IsOdd(N)) { - Xc = MajorRadius * Sinh(U); - Yc = MinorRadius * Cosh(U); + Xc = MajorRadius * std::sinh(U); + Yc = MinorRadius * std::cosh(U); } else if (IsEven(N)) { - Xc = MajorRadius * Cosh(U); - Yc = MinorRadius * Sinh(U); + Xc = MajorRadius * std::cosh(U); + Yc = MinorRadius * std::sinh(U); } gp_XYZ Coord1(Pos.XDirection().XYZ()); Coord1.SetLinearForm(Xc, Coord1, Yc, Pos.YDirection().XYZ()); @@ -1158,13 +1159,13 @@ gp_Vec2d ElCLib::HyperbolaDN(const Standard_Real U, Standard_Real Xc = 0, Yc = 0; if (IsOdd(N)) { - Xc = MajorRadius * Sinh(U); - Yc = MinorRadius * Cosh(U); + Xc = MajorRadius * std::sinh(U); + Yc = MinorRadius * std::cosh(U); } else if (IsEven(N)) { - Xc = MajorRadius * Cosh(U); - Yc = MinorRadius * Sinh(U); + Xc = MajorRadius * std::cosh(U); + Yc = MinorRadius * std::sinh(U); } gp_XY Xdir(Pos.XDirection().XY()); const gp_XY& Ydir(Pos.YDirection().XY()); @@ -1249,7 +1250,7 @@ Standard_Real ElCLib::EllipseParameter(const gp_Ax2& Pos, const Standard_Real NY = OP.Dot(yaxis); const Standard_Real NX = OP.Dot(xaxis); - if ((Abs(NX) <= gp::Resolution()) && (Abs(NY) <= gp::Resolution())) + if ((std::abs(NX) <= gp::Resolution()) && (std::abs(NY) <= gp::Resolution())) //-- The point P is on the Axis of the Ellipse. return (0.0); diff --git a/src/FoundationClasses/TKMath/ElCLib/ElCLib.hxx b/src/FoundationClasses/TKMath/ElCLib/ElCLib.hxx index 51bd8baae8..bcebd07c82 100644 --- a/src/FoundationClasses/TKMath/ElCLib/ElCLib.hxx +++ b/src/FoundationClasses/TKMath/ElCLib/ElCLib.hxx @@ -548,8 +548,8 @@ public: //! equation of the curve is given by the following: //! - for the line L: P(U) = Po + U*Vo //! where Po is the origin and Vo the unit vector of its positioning axis. - //! - for the circle C: X(U) = Radius*Cos(U), Y(U) = Radius*Sin(U) - //! - for the ellipse E: X(U) = MajorRadius*Cos(U). Y(U) = MinorRadius*Sin(U) + //! - for the circle C: X(U) = Radius*std::cos(U), Y(U) = Radius*Sin(U) + //! - for the ellipse E: X(U) = MajorRadius*std::cos(U). Y(U) = MinorRadius*Sin(U) //! - for the hyperbola H: X(U) = MajorRadius*Ch(U), Y(U) = MinorRadius*Sh(U) //! - for the parabola Prb: //! X(U) = U**2 / (2*p) @@ -677,7 +677,6 @@ public: //! "X Axis" and "Y Axis" of the 3D coordinate system, Pos. Standard_EXPORT static gp_Parab To3d(const gp_Ax2& Pos, const gp_Parab2d& Prb); -protected: private: }; diff --git a/src/FoundationClasses/TKMath/ElSLib/ElSLib.cxx b/src/FoundationClasses/TKMath/ElSLib/ElSLib.cxx index cfc6fed965..1cd60d041c 100644 --- a/src/FoundationClasses/TKMath/ElSLib/ElSLib.cxx +++ b/src/FoundationClasses/TKMath/ElSLib/ElSLib.cxx @@ -92,7 +92,7 @@ gp_Pnt ElSLib::CylinderValue(const Standard_Real U, const gp_Ax3& Pos, const Standard_Real Radius) { - // M(u,v) = C + Radius * ( Xdir * Cos(u) + Ydir * Sin(u)) + V * Zdir + // M(u,v) = C + Radius * ( Xdir * std::cos(u) + Ydir * std::sin(u)) + V * Zdir // where C is the location point of the Axis2placement // Xdir, Ydir ,Zdir are the directions of the local coordinates system @@ -137,8 +137,8 @@ gp_Pnt ElSLib::TorusValue(const Standard_Real U, { // M(U,V) = // Location + - // (MajRadius+MinRadius*Cos(V)) * (Cos(U)*XDirection + Sin(U)*YDirection) + - // MinorRadius * Sin(V) * Direction + // (MajRadius+MinRadius*std::cos(V)) * (std::cos(U)*XDirection + std::sin(U)*YDirection) + + // MinorRadius * std::sin(V) * Direction const gp_XYZ& XDir = Pos.XDirection().XYZ(); const gp_XYZ& YDir = Pos.YDirection().XYZ(); @@ -151,13 +151,13 @@ gp_Pnt ElSLib::TorusValue(const Standard_Real U, // Modified by skv - Tue Sep 9 15:10:34 2003 OCC620 Begin Standard_Real eps = 10. * (MinorRadius + MajorRadius) * RealEpsilon(); - if (Abs(A1) <= eps) + if (std::abs(A1) <= eps) A1 = 0.; - if (Abs(A2) <= eps) + if (std::abs(A2) <= eps) A2 = 0.; - if (Abs(A3) <= eps) + if (std::abs(A3) <= eps) A3 = 0.; // Modified by skv - Tue Sep 9 15:10:35 2003 OCC620 End @@ -395,10 +395,10 @@ gp_Vec ElSLib::TorusDN(const Standard_Real U, A2 = -R * SinU; } // Modified by skv - Tue Sep 9 15:10:34 2003 OCC620 Begin - if (Abs(A1) <= eps) + if (std::abs(A1) <= eps) A1 = 0.; - if (Abs(A2) <= eps) + if (std::abs(A2) <= eps) A2 = 0.; // Modified by skv - Tue Sep 9 15:10:35 2003 OCC620 End X = A1 * XDir.X() + A2 * YDir.X(); @@ -428,13 +428,13 @@ gp_Vec ElSLib::TorusDN(const Standard_Real U, A3 = -RSinV; } // Modified by skv - Tue Sep 9 15:10:34 2003 OCC620 Begin - if (Abs(A1) <= eps) + if (std::abs(A1) <= eps) A1 = 0.; - if (Abs(A2) <= eps) + if (std::abs(A2) <= eps) A2 = 0.; - if (Abs(A3) <= eps) + if (std::abs(A3) <= eps) A3 = 0.; // Modified by skv - Tue Sep 9 15:10:35 2003 OCC620 End X = A1 * XDir.X() + A2 * YDir.X() + A3 * ZDir.X(); @@ -455,10 +455,10 @@ gp_Vec ElSLib::TorusDN(const Standard_Real U, A1 = RSinV * SinU; A2 = -RSinV * CosU; // Modified by skv - Tue Sep 9 15:10:34 2003 OCC620 Begin - if (Abs(A1) <= eps) + if (std::abs(A1) <= eps) A1 = 0.; - if (Abs(A2) <= eps) + if (std::abs(A2) <= eps) A2 = 0.; // Modified by skv - Tue Sep 9 15:10:35 2003 OCC620 End X = A1 * XDir.X() + A2 * YDir.X(); @@ -471,10 +471,10 @@ gp_Vec ElSLib::TorusDN(const Standard_Real U, A1 = RCosV * CosU; A2 = RCosV * SinU; // Modified by skv - Tue Sep 9 15:10:34 2003 OCC620 Begin - if (Abs(A1) <= eps) + if (std::abs(A1) <= eps) A1 = 0.; - if (Abs(A2) <= eps) + if (std::abs(A2) <= eps) A2 = 0.; // Modified by skv - Tue Sep 9 15:10:35 2003 OCC620 End X = A1 * XDir.X() + A2 * YDir.X(); @@ -487,10 +487,10 @@ gp_Vec ElSLib::TorusDN(const Standard_Real U, A1 = RCosV * SinU; A2 = -RCosV * CosU; // Modified by skv - Tue Sep 9 15:10:34 2003 OCC620 Begin - if (Abs(A1) <= eps) + if (std::abs(A1) <= eps) A1 = 0.; - if (Abs(A2) <= eps) + if (std::abs(A2) <= eps) A2 = 0.; // Modified by skv - Tue Sep 9 15:10:35 2003 OCC620 End X = A1 * XDir.X() + A2 * YDir.X(); @@ -509,10 +509,10 @@ gp_Vec ElSLib::TorusDN(const Standard_Real U, A1 = RSinV * CosU; A2 = RSinV * SinU; // Modified by skv - Tue Sep 9 15:10:34 2003 OCC620 Begin - if (Abs(A1) <= eps) + if (std::abs(A1) <= eps) A1 = 0.; - if (Abs(A2) <= eps) + if (std::abs(A2) <= eps) A2 = 0.; // Modified by skv - Tue Sep 9 15:10:35 2003 OCC620 End X = A1 * XDir.X() + A2 * YDir.X(); @@ -613,13 +613,13 @@ void ElSLib::TorusD0(const Standard_Real U, // Modified by skv - Tue Sep 9 15:10:34 2003 OCC620 Begin Standard_Real eps = 10. * (MinorRadius + MajorRadius) * RealEpsilon(); - if (Abs(A1) <= eps) + if (std::abs(A1) <= eps) A1 = 0.; - if (Abs(A2) <= eps) + if (std::abs(A2) <= eps) A2 = 0.; - if (Abs(A3) <= eps) + if (std::abs(A3) <= eps) A3 = 0.; // Modified by skv - Tue Sep 9 15:10:35 2003 OCC620 End P.SetX(A1 * XDir.X() + A2 * YDir.X() + A3 * ZDir.X() + PLoc.X()); @@ -657,16 +657,16 @@ void ElSLib::ConeD1(const Standard_Real U, gp_Vec& Vu, gp_Vec& Vv) { - // Z = V * Cos(SAngle) - // M(U,V) = Location() + V * Cos(SAngle) * ZDirection() + - // (Radius + V*Sin(SAng)) * (Cos(U) * XDirection() + Sin(U) * YDirection()) + // Z = V * std::cos(SAngle) + // M(U,V) = Location() + V * std::cos(SAngle) * ZDirection() + + // (Radius + V*Sin(SAng)) * (std::cos(U) * XDirection() + std::sin(U) * YDirection()) // D1U = - //(Radius + V*Sin(SAng)) * (-Sin(U) * XDirection() + Cos(U) * YDirection()) + //(Radius + V*Sin(SAng)) * (-std::sin(U) * XDirection() + std::cos(U) * YDirection()) // D1V = - // Direction() *Cos(SAngle) + Sin(SAng) * (Cos(U) * XDirection() + - // Sin(U) * YDirection()) + // Direction() *std::cos(SAngle) + std::sin(SAng) * (std::cos(U) * XDirection() + + // std::sin(U) * YDirection()) const gp_XYZ& XDir = Pos.XDirection().XYZ(); const gp_XYZ& YDir = Pos.YDirection().XYZ(); @@ -770,16 +770,16 @@ void ElSLib::TorusD1(const Standard_Real U, // P(U,V) = // Location + - // (MajorRadius+MinorRadius*Cos(V)) * - // (Cos(U)*XDirection + Sin(U)*YDirection) + - // MinorRadius * Sin(V) * Direction + // (MajorRadius+MinorRadius*std::cos(V)) * + // (std::cos(U)*XDirection + std::sin(U)*YDirection) + + // MinorRadius * std::sin(V) * Direction - // Vv = -MinorRadius * Sin(V) * (Cos(U)*XDirection + Sin(U)*YDirection) + - // MinorRadius * Cos(V) * Direction + // Vv = -MinorRadius * std::sin(V) * (std::cos(U)*XDirection + std::sin(U)*YDirection) + + // MinorRadius * std::cos(V) * Direction // Vu = - // (MajorRadius+MinorRadius*Cos(V)) * - // (-Sin(U)*XDirection + Cos(U)*YDirection) + // (MajorRadius+MinorRadius*std::cos(V)) * + // (-std::sin(U)*XDirection + std::cos(U)*YDirection) const gp_XYZ& XDir = Pos.XDirection().XYZ(); const gp_XYZ& YDir = Pos.YDirection().XYZ(); @@ -797,16 +797,16 @@ void ElSLib::TorusD1(const Standard_Real U, // Modified by skv - Tue Sep 9 15:10:34 2003 OCC620 Begin Standard_Real eps = 10. * (MinorRadius + MajorRadius) * RealEpsilon(); - if (Abs(A1) <= eps) + if (std::abs(A1) <= eps) A1 = 0.; - if (Abs(A2) <= eps) + if (std::abs(A2) <= eps) A2 = 0.; - if (Abs(A3) <= eps) + if (std::abs(A3) <= eps) A3 = 0.; - if (Abs(A4) <= eps) + if (std::abs(A4) <= eps) A4 = 0.; // Modified by skv - Tue Sep 9 15:10:35 2003 OCC620 End P.SetX(A1 * XDir.X() + A2 * YDir.X() + R2 * ZDir.X() + PLoc.X()); @@ -832,24 +832,24 @@ void ElSLib::ConeD2(const Standard_Real U, gp_Vec& Vvv, gp_Vec& Vuv) { - // Z = V * Cos(SAngle) - // M(U,V) = Location() + V * Cos(SAngle) * Direction() + - // (Radius + V*Sin(SAng)) * (Cos(U) * XDirection() + Sin(U) * YDirection()) + // Z = V * std::cos(SAngle) + // M(U,V) = Location() + V * std::cos(SAngle) * Direction() + + // (Radius + V*Sin(SAng)) * (std::cos(U) * XDirection() + std::sin(U) * YDirection()) // DU = - //(Radius + V*Sin(SAng)) * (-Sin(U) * XDirection() + Cos(U) * YDirection()) + //(Radius + V*Sin(SAng)) * (-std::sin(U) * XDirection() + std::cos(U) * YDirection()) // DV = - // Direction() *Cos(SAngle) + Sin(SAng) * (Cos(U) * XDirection() + - // Sin(U) * YDirection()) + // Direction() *std::cos(SAngle) + std::sin(SAng) * (std::cos(U) * XDirection() + + // std::sin(U) * YDirection()) // D2U = - //(Radius + V*Sin(SAng)) * (-Cos(U) * XDirection() - Sin(U) * YDirection()) + //(Radius + V*Sin(SAng)) * (-std::cos(U) * XDirection() - std::sin(U) * YDirection()) // D2V = 0.0 // DUV = - // Sin(SAng) * (-Sin(U) * XDirection() + Cos(U) * YDirection()) + // std::sin(SAng) * (-std::sin(U) * XDirection() + std::cos(U) * YDirection()) const gp_XYZ& XDir = Pos.XDirection().XYZ(); const gp_XYZ& YDir = Pos.YDirection().XYZ(); @@ -1006,25 +1006,25 @@ void ElSLib::TorusD2(const Standard_Real U, { // P(U,V) = // Location + - // (MajorRadius+MinorRadius*Cos(V)) * - // (Cos(U)*XDirection + Sin(U)*YDirection) + - // MinorRadius * Sin(V) * Direction + // (MajorRadius+MinorRadius*std::cos(V)) * + // (std::cos(U)*XDirection + std::sin(U)*YDirection) + + // MinorRadius * std::sin(V) * Direction - // Vv = -MinorRadius * Sin(V) * (Cos(U)*XDirection + Sin(U)*YDirection) + - // MinorRadius * Cos(V) * Direction + // Vv = -MinorRadius * std::sin(V) * (std::cos(U)*XDirection + std::sin(U)*YDirection) + + // MinorRadius * std::cos(V) * Direction // Vu = - // (MajorRadius+MinorRadius*Cos(V)) * - // (-Sin(U)*XDirection + Cos(U)*YDirection) + // (MajorRadius+MinorRadius*std::cos(V)) * + // (-std::sin(U)*XDirection + std::cos(U)*YDirection) - // Vvv = -MinorRadius * Cos(V) * (Cos(U)*XDirection + Sin(U)*YDirection) - // -MinorRadius * Sin(V) * Direction + // Vvv = -MinorRadius * std::cos(V) * (std::cos(U)*XDirection + std::sin(U)*YDirection) + // -MinorRadius * std::sin(V) * Direction // Vuu = - // -(MajorRadius+MinorRadius*Cos(V)) * - // (Cos(U)*XDirection + Sin(U)*YDirection) + // -(MajorRadius+MinorRadius*std::cos(V)) * + // (std::cos(U)*XDirection + std::sin(U)*YDirection) - // Vuv = MinorRadius * Sin(V) * (Sin(U)*XDirection - Cos(U)*YDirection) + // Vuv = MinorRadius * std::sin(V) * (std::sin(U)*XDirection - std::cos(U)*YDirection) const gp_XYZ& XDir = Pos.XDirection().XYZ(); const gp_XYZ& YDir = Pos.YDirection().XYZ(); @@ -1044,22 +1044,22 @@ void ElSLib::TorusD2(const Standard_Real U, // Modified by skv - Tue Sep 9 15:10:34 2003 OCC620 Begin Standard_Real eps = 10. * (MinorRadius + MajorRadius) * RealEpsilon(); - if (Abs(A1) <= eps) + if (std::abs(A1) <= eps) A1 = 0.; - if (Abs(A2) <= eps) + if (std::abs(A2) <= eps) A2 = 0.; - if (Abs(A3) <= eps) + if (std::abs(A3) <= eps) A3 = 0.; - if (Abs(A4) <= eps) + if (std::abs(A4) <= eps) A4 = 0.; - if (Abs(A5) <= eps) + if (std::abs(A5) <= eps) A5 = 0.; - if (Abs(A6) <= eps) + if (std::abs(A6) <= eps) A6 = 0.; // Modified by skv - Tue Sep 9 15:10:35 2003 OCC620 End Standard_Real Som1X = A1 * XDir.X() + A2 * YDir.X(); @@ -1104,33 +1104,33 @@ void ElSLib::ConeD3(const Standard_Real U, gp_Vec& Vuuv, gp_Vec& Vuvv) { - // Z = V * Cos(SAngle) - // M(U,V) = Location() + V * Cos(SAngle) * Direction() + - // (Radius + V*Sin(SAng)) * (Cos(U) * XDirection() + Sin(U) * YDirection()) + // Z = V * std::cos(SAngle) + // M(U,V) = Location() + V * std::cos(SAngle) * Direction() + + // (Radius + V*Sin(SAng)) * (std::cos(U) * XDirection() + std::sin(U) * YDirection()) // DU = - //(Radius + V*Sin(SAng)) * (-Sin(U) * XDirection() + Cos(U) * YDirection()) + //(Radius + V*Sin(SAng)) * (-std::sin(U) * XDirection() + std::cos(U) * YDirection()) // DV = - // Direction() *Cos(SAngle) + Sin(SAng) * (Cos(U) * XDirection() + - // Sin(U) * YDirection()) + // Direction() *std::cos(SAngle) + std::sin(SAng) * (std::cos(U) * XDirection() + + // std::sin(U) * YDirection()) // D2U = - //(Radius + V*Sin(SAng)) * (-Cos(U) * XDirection() - Sin(U) * YDirection()) + //(Radius + V*Sin(SAng)) * (-std::cos(U) * XDirection() - std::sin(U) * YDirection()) // D2V = 0.0 // DUV = - // Sin(SAng) * (-Sin(U) * XDirection() + Cos(U) * YDirection()) + // std::sin(SAng) * (-std::sin(U) * XDirection() + std::cos(U) * YDirection()) // D3U = - //(Radius + V*Sin(SAng)) * (Sin(U) * XDirection() - Cos(U) * YDirection()) + //(Radius + V*Sin(SAng)) * (std::sin(U) * XDirection() - std::cos(U) * YDirection()) // DUVV = 0.0 // D3V = 0.0 - // DUUV = Sin(SAng) * (-Cos(U)*XDirection()-Sin(U) * YDirection()) + + // DUUV = std::sin(SAng) * (-std::cos(U)*XDirection()-std::sin(U) * YDirection()) + const gp_XYZ& XDir = Pos.XDirection().XYZ(); const gp_XYZ& YDir = Pos.YDirection().XYZ(); @@ -1363,33 +1363,33 @@ void ElSLib::TorusD3(const Standard_Real U, // P(U,V) = // Location + - // (MajorRadius+MinorRadius*Cos(V)) * - // (Cos(U)*XDirection + Sin(U)*YDirection) + - // MinorRadius * Sin(V) * Direction + // (MajorRadius+MinorRadius*std::cos(V)) * + // (std::cos(U)*XDirection + std::sin(U)*YDirection) + + // MinorRadius * std::sin(V) * Direction - // Vv = -MinorRadius * Sin(V) * (Cos(U)*XDirection + Sin(U)*YDirection) + - // MinorRadius * Cos(V) * Direction + // Vv = -MinorRadius * std::sin(V) * (std::cos(U)*XDirection + std::sin(U)*YDirection) + + // MinorRadius * std::cos(V) * Direction - // Vvv = -MinorRadius * Cos(V) * (Cos(U)*XDirection + Sin(U)*YDirection) - // -MinorRadius * Sin(V) * Direction + // Vvv = -MinorRadius * std::cos(V) * (std::cos(U)*XDirection + std::sin(U)*YDirection) + // -MinorRadius * std::sin(V) * Direction // Vvvv = - Vv // Vu = - // (MajorRadius+MinorRadius*Cos(V)) * - // (-Sin(U)*XDirection + Cos(U)*YDirection) + // (MajorRadius+MinorRadius*std::cos(V)) * + // (-std::sin(U)*XDirection + std::cos(U)*YDirection) // Vuu = - // -(MajorRadius+MinorRadius*Cos(V)) * - // (Cos(U)*XDirection + Sin(U)*YDirection) + // -(MajorRadius+MinorRadius*std::cos(V)) * + // (std::cos(U)*XDirection + std::sin(U)*YDirection) // Vuuu = -Vu - // Vuv = MinorRadius * Sin(V) * (Sin(U)*XDirection - Cos(U)*YDirection) + // Vuv = MinorRadius * std::sin(V) * (std::sin(U)*XDirection - std::cos(U)*YDirection) - // Vuvv = MinorRadius * Cos(V) * (Sin(U)*XDirection - Cos(U)*YDirection) + // Vuvv = MinorRadius * std::cos(V) * (std::sin(U)*XDirection - std::cos(U)*YDirection) - // Vuuv = MinorRadius * Sin(V) * (Cos(U)*XDirection + Sin(U)*YDirection) + // Vuuv = MinorRadius * std::sin(V) * (std::cos(U)*XDirection + std::sin(U)*YDirection) const gp_XYZ& XDir = Pos.XDirection().XYZ(); const gp_XYZ& YDir = Pos.YDirection().XYZ(); @@ -1409,22 +1409,22 @@ void ElSLib::TorusD3(const Standard_Real U, // Modified by skv - Tue Sep 9 15:10:34 2003 OCC620 Begin Standard_Real eps = 10. * (MinorRadius + MajorRadius) * RealEpsilon(); - if (Abs(A1) <= eps) + if (std::abs(A1) <= eps) A1 = 0.; - if (Abs(A2) <= eps) + if (std::abs(A2) <= eps) A2 = 0.; - if (Abs(A3) <= eps) + if (std::abs(A3) <= eps) A3 = 0.; - if (Abs(A4) <= eps) + if (std::abs(A4) <= eps) A4 = 0.; - if (Abs(A5) <= eps) + if (std::abs(A5) <= eps) A5 = 0.; - if (Abs(A6) <= eps) + if (std::abs(A6) <= eps) A6 = 0.; // Modified by skv - Tue Sep 9 15:10:35 2003 OCC620 End Standard_Real Som1X = A1 * XDir.X() + A2 * YDir.X(); @@ -1515,11 +1515,11 @@ void ElSLib::ConeParameters(const gp_Ax3& Pos, gp_Pnt Ploc = P.Transformed(T); // Check if point is at the apex - if (Abs(Ploc.X()) < gp::Resolution() && Abs(Ploc.Y()) < gp::Resolution()) + if (std::abs(Ploc.X()) < gp::Resolution() && std::abs(Ploc.Y()) < gp::Resolution()) { U = 0.0; } - else if (-Radius > Ploc.Z() * Tan(SAngle)) + else if (-Radius > Ploc.Z() * std::tan(SAngle)) { // the point is at the wrong side of the apex U = atan2(-Ploc.Y(), -Ploc.X()); @@ -1535,7 +1535,7 @@ void ElSLib::ConeParameters(const gp_Ax3& Pos, // P1 = Cone.Value(U,1) // V = P0 P1 . P0 Ploc // After simplification obtain: - // V = Sin(Sang) * ( x cosU + y SinU - R) + z * Cos(Sang) + // V = std::sin(Sang) * ( x cosU + y SinU - R) + z * std::cos(Sang) // Method that permits to find V of the projected point if the point // is not actually on the cone. @@ -1603,8 +1603,8 @@ void ElSLib::TorusParameters(const gp_Ax3& Pos, const Standard_Real yp = y + RSinU; const Standard_Real D1 = xm * xm + ym * ym + z2 - MinR2; const Standard_Real D2 = xp * xp + yp * yp + z2 - MinR2; - const Standard_Real AD1 = Abs(D1); - const Standard_Real AD2 = Abs(D2); + const Standard_Real AD1 = std::abs(D1); + const Standard_Real AD2 = std::abs(D2); if (AD2 < AD1) U += M_PI; } diff --git a/src/FoundationClasses/TKMath/ElSLib/ElSLib.hxx b/src/FoundationClasses/TKMath/ElSLib/ElSLib.hxx index e1d514e923..cdc145c309 100644 --- a/src/FoundationClasses/TKMath/ElSLib/ElSLib.hxx +++ b/src/FoundationClasses/TKMath/ElSLib/ElSLib.hxx @@ -529,13 +529,13 @@ public: //! parametrization //! P (U, V) = Location + V * ZDirection + - //! Radius * (Cos(U) * XDirection + Sin (U) * YDirection) + //! Radius * (std::cos(U) * XDirection + Sin (U) * YDirection) static void Parameters(const gp_Cylinder& C, const gp_Pnt& P, Standard_Real& U, Standard_Real& V); //! parametrization //! P (U, V) = Location + V * ZDirection + //! (Radius + V * Tan (SemiAngle)) * - //! (Cos(U) * XDirection + Sin(U) * YDirection) + //! (std::cos(U) * XDirection + std::sin(U) * YDirection) static void Parameters(const gp_Cone& C, const gp_Pnt& P, Standard_Real& U, Standard_Real& V); //! parametrization @@ -546,9 +546,9 @@ public: //! parametrization //! P (U, V) = Location + - //! (MajorRadius + MinorRadius * Cos(U)) * - //! (Cos(V) * XDirection - Sin(V) * YDirection) + - //! MinorRadius * Sin(U) * ZDirection + //! (MajorRadius + MinorRadius * std::cos(U)) * + //! (std::cos(V) * XDirection - std::sin(V) * YDirection) + + //! MinorRadius * std::sin(U) * ZDirection static void Parameters(const gp_Torus& T, const gp_Pnt& P, Standard_Real& U, Standard_Real& V); //! parametrization @@ -561,7 +561,7 @@ public: //! parametrization //! P (U, V) = Location + V * ZDirection + - //! Radius * (Cos(U) * XDirection + Sin (U) * YDirection) + //! Radius * (std::cos(U) * XDirection + Sin (U) * YDirection) Standard_EXPORT static void CylinderParameters(const gp_Ax3& Pos, const Standard_Real Radius, const gp_Pnt& P, @@ -571,7 +571,7 @@ public: //! parametrization //! P (U, V) = Location + V * ZDirection + //! (Radius + V * Tan (SemiAngle)) * - //! (Cos(U) * XDirection + Sin(U) * YDirection) + //! (std::cos(U) * XDirection + std::sin(U) * YDirection) Standard_EXPORT static void ConeParameters(const gp_Ax3& Pos, const Standard_Real Radius, const Standard_Real SAngle, @@ -591,9 +591,9 @@ public: //! parametrization //! P (U, V) = Location + - //! (MajorRadius + MinorRadius * Cos(U)) * - //! (Cos(V) * XDirection - Sin(V) * YDirection) + - //! MinorRadius * Sin(U) * ZDirection + //! (MajorRadius + MinorRadius * std::cos(U)) * + //! (std::cos(V) * XDirection - std::sin(V) * YDirection) + + //! MinorRadius * std::sin(U) * ZDirection Standard_EXPORT static void TorusParameters(const gp_Ax3& Pos, const Standard_Real MajorRadius, const Standard_Real MinorRadius, diff --git a/src/FoundationClasses/TKMath/GTests/PLib_HermitJacobi_Test.cxx b/src/FoundationClasses/TKMath/GTests/PLib_HermitJacobi_Test.cxx index 99bf0be1f2..9c2cf28424 100644 --- a/src/FoundationClasses/TKMath/GTests/PLib_HermitJacobi_Test.cxx +++ b/src/FoundationClasses/TKMath/GTests/PLib_HermitJacobi_Test.cxx @@ -133,7 +133,7 @@ TEST_F(PLibHermitJacobiTest, CoefficientConversion) TColStd_Array1OfReal aHermJacCoeff(0, aHermJacSize - 1); for (Standard_Integer i = aHermJacCoeff.Lower(); i <= aHermJacCoeff.Upper(); i++) { - aHermJacCoeff(i) = Sin(i * 0.3); // Some test values + aHermJacCoeff(i) = std::sin(i * 0.3); // Some test values } TColStd_Array1OfReal aCoefficients(0, aCoeffSize - 1); diff --git a/src/FoundationClasses/TKMath/GTests/PLib_JacobiPolynomial_Test.cxx b/src/FoundationClasses/TKMath/GTests/PLib_JacobiPolynomial_Test.cxx index fccf5a6298..d794373465 100644 --- a/src/FoundationClasses/TKMath/GTests/PLib_JacobiPolynomial_Test.cxx +++ b/src/FoundationClasses/TKMath/GTests/PLib_JacobiPolynomial_Test.cxx @@ -259,7 +259,7 @@ TEST_F(PLibJacobiPolynomialTest, CoefficientConversion) TColStd_Array1OfReal aJacCoeff(0, aJacSize - 1); for (Standard_Integer i = aJacCoeff.Lower(); i <= aJacCoeff.Upper(); i++) { - aJacCoeff(i) = Sin(i * 0.1); // Some test values + aJacCoeff(i) = std::sin(i * 0.1); // Some test values } TColStd_Array1OfReal aCoefficients(0, aCoeffSize - 1); diff --git a/src/FoundationClasses/TKMath/GTests/math_EigenValuesSearcher_Test.cxx b/src/FoundationClasses/TKMath/GTests/math_EigenValuesSearcher_Test.cxx index 9e80297c8c..fd8c30ee7f 100644 --- a/src/FoundationClasses/TKMath/GTests/math_EigenValuesSearcher_Test.cxx +++ b/src/FoundationClasses/TKMath/GTests/math_EigenValuesSearcher_Test.cxx @@ -69,7 +69,7 @@ Standard_Boolean verifyEigenPair(const math_Matrix& theMatrix, for (Standard_Integer i = 1; i <= aN; i++) { const Standard_Real aExpected = theEigenValue * theEigenVector(i); - if (Abs(aResult(i) - aExpected) > theTolerance) + if (std::abs(aResult(i) - aExpected) > theTolerance) return Standard_False; } @@ -85,7 +85,7 @@ Standard_Boolean areOrthogonal(const math_Vector& theVec1, for (Standard_Integer i = 1; i <= theVec1.Length(); i++) aDotProduct += theVec1(i) * theVec2(i); - return Abs(aDotProduct) < theTolerance; + return std::abs(aDotProduct) < theTolerance; } // Helper function to compute vector norm @@ -94,7 +94,7 @@ Standard_Real vectorNorm(const math_Vector& theVector) Standard_Real aNorm = 0.0; for (Standard_Integer i = 1; i <= theVector.Length(); i++) aNorm += theVector(i) * theVector(i); - return Sqrt(aNorm); + return std::sqrt(aNorm); } } // namespace @@ -159,8 +159,8 @@ TEST(math_EigenValuesSearcherTest, TwoByTwoMatrix) std::vector eigenvals = {searcher.EigenValue(1), searcher.EigenValue(2)}; std::sort(eigenvals.begin(), eigenvals.end()); - const Standard_Real lambda1 = 2.5 - 0.5 * Sqrt(5.0); // ~= 0.382 - const Standard_Real lambda2 = 2.5 + 0.5 * Sqrt(5.0); // ~= 4.618 + const Standard_Real lambda1 = 2.5 - 0.5 * std::sqrt(5.0); // ~= 0.382 + const Standard_Real lambda2 = 2.5 + 0.5 * std::sqrt(5.0); // ~= 4.618 EXPECT_NEAR(eigenvals[0], lambda1, 1e-10); EXPECT_NEAR(eigenvals[1], lambda2, 1e-10); @@ -431,9 +431,9 @@ TEST(math_EigenValuesSearcherTest, ZeroDiagonalElements) std::sort(eigenvals.begin(), eigenvals.end()); - EXPECT_NEAR(eigenvals[0], -Sqrt(2.0), 1e-10); + EXPECT_NEAR(eigenvals[0], -std::sqrt(2.0), 1e-10); EXPECT_NEAR(eigenvals[1], 0.0, 1e-10); - EXPECT_NEAR(eigenvals[2], Sqrt(2.0), 1e-10); + EXPECT_NEAR(eigenvals[2], std::sqrt(2.0), 1e-10); } // Test with large diagonal elements (numerical stability) @@ -616,7 +616,7 @@ TEST(math_EigenValuesSearcherTest, WilkinsonMatrix) const Standard_Integer m = (n - 1) / 2; for (Standard_Integer i = 1; i <= n; i++) { - aDiagonal.SetValue(i, static_cast(Abs(i - 1 - m))); + aDiagonal.SetValue(i, static_cast(std::abs(i - 1 - m))); } aSubdiagonal.SetValue(1, 0.0); @@ -700,7 +700,7 @@ TEST(math_EigenValuesSearcherTest, LargerMatrix) for (Standard_Integer i = 2; i <= n; i++) { Standard_Real val = static_cast(i % 3 == 0 ? -1.0 : 1.0); - aSubdiagonal.SetValue(i, val * Sqrt(static_cast(i))); + aSubdiagonal.SetValue(i, val * std::sqrt(static_cast(i))); } math_EigenValuesSearcher searcher(aDiagonal, aSubdiagonal); @@ -1117,7 +1117,7 @@ TEST(math_EigenValuesSearcherTest, DeflationConditionSemantics) aSubdiagonal.SetValue(3, machEpsilonLevel * 0.5); // Even smaller, should definitely deflate // Verify the mathematical behavior that the deflation condition tests - const Standard_Real diagSum = Abs(largeDiag1) + Abs(largeDiag2); + const Standard_Real diagSum = std::abs(largeDiag1) + std::abs(largeDiag2); const Standard_Real testCondition = machEpsilonLevel + diagSum; // This should be true in floating-point arithmetic due to precision limits @@ -1158,15 +1158,15 @@ TEST(math_EigenValuesSearcherTest, DeflationBoundaryCondition) const Standard_Real eps = std::numeric_limits::epsilon(); // For first pair: should deflate - const Standard_Real sum1 = Abs(aDiagonal(1)) + Abs(aDiagonal(2)); + const Standard_Real sum1 = std::abs(aDiagonal(1)) + std::abs(aDiagonal(2)); aSubdiagonal.SetValue(2, sum1 * eps * 0.1); // Below machine epsilon relative to sum // For second pair: should deflate - const Standard_Real sum2 = Abs(aDiagonal(2)) + Abs(aDiagonal(3)); + const Standard_Real sum2 = std::abs(aDiagonal(2)) + std::abs(aDiagonal(3)); aSubdiagonal.SetValue(3, sum2 * eps * 0.1); // For third pair: should deflate - const Standard_Real sum3 = Abs(aDiagonal(3)) + Abs(aDiagonal(4)); + const Standard_Real sum3 = std::abs(aDiagonal(3)) + std::abs(aDiagonal(4)); aSubdiagonal.SetValue(4, sum3 * eps * 0.1); math_EigenValuesSearcher searcher(aDiagonal, aSubdiagonal); diff --git a/src/FoundationClasses/TKMath/GTests/math_FunctionRoot_Test.cxx b/src/FoundationClasses/TKMath/GTests/math_FunctionRoot_Test.cxx index 084ce6d563..9a7a13ac45 100644 --- a/src/FoundationClasses/TKMath/GTests/math_FunctionRoot_Test.cxx +++ b/src/FoundationClasses/TKMath/GTests/math_FunctionRoot_Test.cxx @@ -295,7 +295,7 @@ TEST(MathFunctionRootTest, OutOfBoundsGuess) // If the algorithm reports Done but the function value is not near zero, // it might have stopped due to bounds rather than finding a true root Standard_Real aFunctionValue = aRootFinder.Value(); - if (Abs(aFunctionValue) > 1.0e-3) + if (std::abs(aFunctionValue) > 1.0e-3) { // This is acceptable - the algorithm stopped due to bounds, not convergence to root EXPECT_GE(aRoot, aLowerBound) << "Should still respect bounds"; @@ -351,7 +351,8 @@ TEST(MathFunctionRootTest, ConstrainedConvergenceState) { // If it succeeds, verify the results are reasonable EXPECT_GT(aRootFinder.NbIterations(), 0) << "Should have done at least one iteration"; - EXPECT_TRUE(Abs(aRootFinder.Root() - 2.0) < 0.5 || Abs(aRootFinder.Root() - (-2.0)) < 0.5) + EXPECT_TRUE(std::abs(aRootFinder.Root() - 2.0) < 0.5 + || std::abs(aRootFinder.Root() - (-2.0)) < 0.5) << "Root should be reasonably close to one of the expected roots"; } }) << "Function root finding should not throw exceptions"; diff --git a/src/FoundationClasses/TKMath/GTests/math_Vector_Test.cxx b/src/FoundationClasses/TKMath/GTests/math_Vector_Test.cxx index 4bc8b1e667..6bdee08fcb 100644 --- a/src/FoundationClasses/TKMath/GTests/math_Vector_Test.cxx +++ b/src/FoundationClasses/TKMath/GTests/math_Vector_Test.cxx @@ -136,7 +136,7 @@ TEST(MathVectorTest, VectorProperties) aVec(4) = -2.0; // Test Norm (should be sqrt(3^2 + 4^2 + 0^2 + (-2)^2) = sqrt(29)) - Standard_Real anExpectedNorm = Sqrt(29.0); + Standard_Real anExpectedNorm = std::sqrt(29.0); EXPECT_NEAR(aVec.Norm(), anExpectedNorm, Precision::Confusion()); // Test Norm2 (should be 29) diff --git a/src/FoundationClasses/TKMath/PLib/PLib.cxx b/src/FoundationClasses/TKMath/PLib/PLib.cxx index 511c953e2d..da9d8df4a1 100644 --- a/src/FoundationClasses/TKMath/PLib/PLib.cxx +++ b/src/FoundationClasses/TKMath/PLib/PLib.cxx @@ -1211,7 +1211,7 @@ Standard_Integer PLib::EvalLagrange(const Standard_Real Parameter, divided_differences_array[Index + kk] -= divided_differences_array[Index1 + kk]; } difference = ParameterArray[jj] - ParameterArray[jj - Degree - 1 + ii]; - if (Abs(difference) < RealSmall()) + if (std::abs(difference) < RealSmall()) { ReturnCode = 1; goto FINISH; @@ -2128,7 +2128,7 @@ void PLib::JacobiParameters(const GeomAbs_Shape ConstraintOrder, //--> NbGaussPoints est le nombre de points de discretisation de la fonction, // il ne peut prendre que les valeurs 8,10,15,20,25,30,40,50 ou 61. // NbGaussPoints doit etre superieur strictement a WorkDegree. - NbGaussPoints = Max(IPMIN, IWANT); + NbGaussPoints = std::max(IPMIN, IWANT); // NbGaussPoints +=2; } @@ -2196,7 +2196,7 @@ void PLib::EvalLength(const Standard_Integer Degree, Standard_Real* PolynomialArray = &PolynomialCoeff; - Standard_Integer NbGaussPoints = 4 * Min((Degree / 4) + 1, 10); + Standard_Integer NbGaussPoints = 4 * std::min((Degree / 4) + 1, 10); math_Vector GaussPoints(1, NbGaussPoints); math::GaussPoints(NbGaussPoints, GaussPoints); @@ -2239,7 +2239,7 @@ void PLib::EvalLength(const Standard_Integer Degree, //****** Integration ** - Sum += GaussWeights(j) * C2 * (Sqrt(Der1) + Sqrt(Der2)); + Sum += GaussWeights(j) * C2 * (std::sqrt(Der1) + std::sqrt(Der2)); //****** Fin de boucle dur les intervalles de GAUSS ** } @@ -2277,6 +2277,6 @@ void PLib::EvalLength(const Standard_Integer Degree, Length += LenI; } NbIter++; - Error = Abs(OldLen - Length); + Error = std::abs(OldLen - Length); } while (Error > Tol && NbIter <= MaxNbIter); } diff --git a/src/FoundationClasses/TKMath/PLib/PLib.hxx b/src/FoundationClasses/TKMath/PLib/PLib.hxx index 30a45b2636..1c0a52bd4b 100644 --- a/src/FoundationClasses/TKMath/PLib/PLib.hxx +++ b/src/FoundationClasses/TKMath/PLib/PLib.hxx @@ -86,7 +86,7 @@ public: //! in dimension . //! //! is an array containing the values of the - //! input derivatives from 0 to Min(,). + //! input derivatives from 0 to std::min(,). //! For orders higher than the inputcd /s2d1/BMDL/ //! derivatives are assumed to be 0. //! diff --git a/src/FoundationClasses/TKMath/PLib/PLib_HermitJacobi.cxx b/src/FoundationClasses/TKMath/PLib/PLib_HermitJacobi.cxx index e3d66ba53d..b571e49dd4 100644 --- a/src/FoundationClasses/TKMath/PLib/PLib_HermitJacobi.cxx +++ b/src/FoundationClasses/TKMath/PLib/PLib_HermitJacobi.cxx @@ -212,7 +212,7 @@ void PLib_HermitJacobi::D0123(const Standard_Integer NDeriv, const math_Matrix& aHermiteMatrix = GetHermiteMatrix(aNivConstr); - TColStd_Array1OfReal JacValue0(jac0[0], 0, Max(0, aJacDegree)); + TColStd_Array1OfReal JacValue0(jac0[0], 0, std::max(0, aJacDegree)); TColStd_Array1OfReal WValues(wvalues[0], 0, NDeriv); WValues.Init(0.); diff --git a/src/FoundationClasses/TKMath/PLib/PLib_JacobiPolynomial.cxx b/src/FoundationClasses/TKMath/PLib/PLib_JacobiPolynomial.cxx index 44934aaf4e..22829b6b46 100644 --- a/src/FoundationClasses/TKMath/PLib/PLib_JacobiPolynomial.cxx +++ b/src/FoundationClasses/TKMath/PLib/PLib_JacobiPolynomial.cxx @@ -214,7 +214,7 @@ Standard_Real PLib_JacobiPolynomial::MaxError(const Standard_Integer theDimensio MaxValue(aTabMax); const Standard_Integer aBegIdx = 2 * (myNivConstr + 1); - const Standard_Integer aCutIdx = Max(aBegIdx, theNewDegree + 1); + const Standard_Integer aCutIdx = std::max(aBegIdx, theNewDegree + 1); math_Vector aMaxErrDim(1, theDimension, 0.); Standard_Real* aJacArray = &theJacCoeff; @@ -225,7 +225,7 @@ Standard_Real PLib_JacobiPolynomial::MaxError(const Standard_Integer theDimensio { const Standard_Real aCoeffValue = aJacArray[aCoeffIdx * theDimension + aDimIdx - 1]; const Standard_Real aBasisMax = aTabMax(aCoeffIdx - aBegIdx); - aMaxErrDim(aDimIdx) += Abs(aCoeffValue) * aBasisMax; + aMaxErrDim(aDimIdx) += std::abs(aCoeffValue) * aBasisMax; } } @@ -259,7 +259,7 @@ void PLib_JacobiPolynomial::ReduceDegree(const Standard_Integer theDimension, const Standard_Integer iOffset = i * theDimension; for (Standard_Integer idim = 1; idim <= theDimension; idim++) { - aMaxErrDim(idim) += Abs(aJacArray[iOffset + idim - 1]) * aTabMax(i - aCutIdx); + aMaxErrDim(idim) += std::abs(aJacArray[iOffset + idim - 1]) * aTabMax(i - aCutIdx); } const Standard_Real anError = aMaxErrDim.Norm(); @@ -283,7 +283,7 @@ void PLib_JacobiPolynomial::ReduceDegree(const Standard_Integer theDimension, const Standard_Integer iOffset = i * theDimension; for (Standard_Integer idim = 1; idim <= theDimension; idim++) { - aBid += Abs(aJacArray[iOffset + idim - 1]); + aBid += std::abs(aJacArray[iOffset + idim - 1]); } if (aBid > anEps) { @@ -300,7 +300,7 @@ Standard_Real PLib_JacobiPolynomial::AverageError(const Standard_Integer theDime Standard_Real& theJacCoeff, const Standard_Integer theNewDegree) const { - const Standard_Integer aCutIdx = Max(2 * (myNivConstr + 1) + 1, theNewDegree + 1); + const Standard_Integer aCutIdx = std::max(2 * (myNivConstr + 1) + 1, theNewDegree + 1); Standard_Real* const aJacArray = &theJacCoeff; Standard_Real anAverageErr = 0.; diff --git a/src/FoundationClasses/TKMath/Poly/Poly.cxx b/src/FoundationClasses/TKMath/Poly/Poly.cxx index fad3c852e2..af748c0a9c 100644 --- a/src/FoundationClasses/TKMath/Poly/Poly.cxx +++ b/src/FoundationClasses/TKMath/Poly/Poly.cxx @@ -479,7 +479,7 @@ Standard_Real Poly::PointOnTriangle(const gp_XY& theP1, Standard_Real aDet = aDU ^ aDV; // case of non-degenerated triangle - if (Abs(aDet) > gp::Resolution()) + if (std::abs(aDet) > gp::Resolution()) { Standard_Real aU = (aDP ^ aDV) / aDet; Standard_Real aV = -(aDP ^ aDU) / aDet; @@ -497,11 +497,11 @@ Standard_Real Poly::PointOnTriangle(const gp_XY& theP1, // project on side U=0 aU = 0.; - aV = Min(1., Max(0., (aDP * aDV) / aDV.SquareModulus())); + aV = std::min(1., std::max(0., (aDP * aDV) / aDV.SquareModulus())); Standard_Real aD = (aV * aDV - aDP).SquareModulus(); // project on side V=0 - Standard_Real u = Min(1., Max(0., (aDP * aDU) / aDU.SquareModulus())); + Standard_Real u = std::min(1., std::max(0., (aDP * aDU) / aDU.SquareModulus())); Standard_Real d = (u * aDU - aDP).SquareModulus(); if (d < aD) { @@ -512,7 +512,7 @@ Standard_Real Poly::PointOnTriangle(const gp_XY& theP1, // project on side U+V=1 gp_XY aDUV = aDV - aDU; - Standard_Real v = Min(1., Max(0., ((aDP - aDU) * aDUV) / aDUV.SquareModulus())); + Standard_Real v = std::min(1., std::max(0., ((aDP - aDU) * aDUV) / aDUV.SquareModulus())); d = (theP2 + v * aDUV - theP).SquareModulus(); if (d < aD) { @@ -549,8 +549,8 @@ Standard_Real Poly::PointOnTriangle(const gp_XY& theP1, else // sides 1-2 and 1-3 are collinear { // select parameter on one of sides so as to have points closer to picked - Standard_Real aU = Min(1., Max(0., (aDP * aDU) / aL2U)); - Standard_Real aV = Min(1., Max(0., (aDP * aDV) / aL2V)); + Standard_Real aU = std::min(1., std::max(0., (aDP * aDU) / aL2U)); + Standard_Real aV = std::min(1., std::max(0., (aDP * aDV) / aL2V)); Standard_Real aD1 = (aDP - aU * aDU).SquareModulus(); Standard_Real aD2 = (aDP - aV * aDV).SquareModulus(); if (aD1 < aD2) diff --git a/src/FoundationClasses/TKMath/Poly/Poly_MakeLoops.cxx b/src/FoundationClasses/TKMath/Poly/Poly_MakeLoops.cxx index 0d5f65cb6c..a751cd7aaa 100644 --- a/src/FoundationClasses/TKMath/Poly/Poly_MakeLoops.cxx +++ b/src/FoundationClasses/TKMath/Poly/Poly_MakeLoops.cxx @@ -238,7 +238,7 @@ Standard_Integer Poly_MakeLoops::findContour( theContour.Add(aIndexS); aNodeLink.Bind(getFirstNode(aIndexS), aIndexS); - Standard_Integer aIndex = Abs(aIndexS); + Standard_Integer aIndex = std::abs(aIndexS); // collect the list of links from this node able to participate // in this contour @@ -332,7 +332,7 @@ void Poly_MakeLoops::acceptContour(const NCollection_IndexedMap 0) return aLink.node1; @@ -366,7 +366,7 @@ Standard_Integer Poly_MakeLoops::getFirstNode(Standard_Integer theIndexS) const Standard_Integer Poly_MakeLoops::getLastNode(int theIndexS) const { - Standard_Integer aIndex = Abs(theIndexS); + Standard_Integer aIndex = std::abs(theIndexS); const Link& aLink = myMapLink(aIndex); if (theIndexS > 0) return aLink.node2; @@ -383,7 +383,7 @@ void Poly_MakeLoops::markHangChain(Standard_Integer theNode, Standard_Integer th { Standard_Integer aNode1 = theNode; Standard_Integer aIndexS = theIndexS; - Standard_Integer aIndex = Abs(aIndexS); + Standard_Integer aIndex = std::abs(aIndexS); Standard_Boolean isOut = (aNode1 == getFirstNode(aIndexS)); for (;;) { @@ -443,7 +443,7 @@ void Poly_MakeLoops::markHangChain(Standard_Integer theNode, Standard_Integer th if (aNextIndexS == 0) break; aIndexS = aNextIndexS; - aIndex = Abs(aIndexS); + aIndex = std::abs(aIndexS); } } @@ -539,7 +539,7 @@ void Poly_MakeLoops::GetHangingLinks(ListOfLink& theLinks) const for (; it.More(); it.Next()) { Standard_Integer aIndexS = it.Key(); - Link aLink = myMapLink(Abs(aIndexS)); + Link aLink = myMapLink(std::abs(aIndexS)); if (aIndexS < 0) aLink.Reverse(); theLinks.Append(aLink); diff --git a/src/FoundationClasses/TKMath/Poly/Poly_MakeLoops.hxx b/src/FoundationClasses/TKMath/Poly/Poly_MakeLoops.hxx index dd68fd489e..5be1fded43 100644 --- a/src/FoundationClasses/TKMath/Poly/Poly_MakeLoops.hxx +++ b/src/FoundationClasses/TKMath/Poly/Poly_MakeLoops.hxx @@ -232,7 +232,7 @@ protected: Link getLink(const Standard_Integer theSegIndex) const { - Link aLink = myMapLink(Abs(theSegIndex)); + Link aLink = myMapLink(std::abs(theSegIndex)); if (theSegIndex < 0) aLink.Reverse(); return aLink; diff --git a/src/FoundationClasses/TKMath/Poly/Poly_MergeNodesTool.hxx b/src/FoundationClasses/TKMath/Poly/Poly_MergeNodesTool.hxx index f775cc475f..bb10db8b70 100644 --- a/src/FoundationClasses/TKMath/Poly/Poly_MergeNodesTool.hxx +++ b/src/FoundationClasses/TKMath/Poly/Poly_MergeNodesTool.hxx @@ -229,7 +229,7 @@ private: void SetMergeAngle(double theAngleRad) { myAngle = (float)theAngleRad; - myAngleCos = (float)Cos(theAngleRad); + myAngleCos = (float)std::cos(theAngleRad); } //! Return TRUE if merge angle is non-zero. diff --git a/src/FoundationClasses/TKMath/gp/gp_Ax2.hxx b/src/FoundationClasses/TKMath/gp/gp_Ax2.hxx index aba0e55ea6..0e08effe59 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Ax2.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Ax2.hxx @@ -522,7 +522,7 @@ inline constexpr gp_Dir::D gp_Ax2::crossStandardDir(const gp_Dir::D theA, inline void gp_Ax2::SetAxis(const gp_Ax1& theA1) { Standard_Real a = theA1.Direction() * vxdir; - if (Abs(Abs(a) - 1.) <= Precision::Angular()) + if (std::abs(std::abs(a) - 1.) <= Precision::Angular()) { if (a > 0.) { @@ -549,7 +549,7 @@ inline void gp_Ax2::SetAxis(const gp_Ax1& theA1) inline void gp_Ax2::SetDirection(const gp_Dir& theV) { Standard_Real a = theV * vxdir; - if (Abs(Abs(a) - 1.) <= Precision::Angular()) + if (std::abs(std::abs(a) - 1.) <= Precision::Angular()) { if (a > 0.) { diff --git a/src/FoundationClasses/TKMath/gp/gp_Ax3.hxx b/src/FoundationClasses/TKMath/gp/gp_Ax3.hxx index 8bb70df099..4e48abe5cf 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Ax3.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Ax3.hxx @@ -504,7 +504,7 @@ inline void gp_Ax3::SetAxis(const gp_Ax1& theA1) inline void gp_Ax3::SetDirection(const gp_Dir& theV) { Standard_Real aDot = theV.Dot(vxdir); - if (1. - Abs(aDot) <= Precision::Angular()) + if (1. - std::abs(aDot) <= Precision::Angular()) { if (aDot > 0) { @@ -538,7 +538,7 @@ inline void gp_Ax3::SetDirection(const gp_Dir& theV) inline void gp_Ax3::SetXDirection(const gp_Dir& theVx) { Standard_Real aDot = theVx.Dot(axis.Direction()); - if (1. - Abs(aDot) <= Precision::Angular()) + if (1. - std::abs(aDot) <= Precision::Angular()) { if (aDot > 0) { @@ -571,7 +571,7 @@ inline void gp_Ax3::SetXDirection(const gp_Dir& theVx) inline void gp_Ax3::SetYDirection(const gp_Dir& theVy) { Standard_Real aDot = theVy.Dot(axis.Direction()); - if (1. - Abs(aDot) <= Precision::Angular()) + if (1. - std::abs(aDot) <= Precision::Angular()) { if (aDot > 0) { diff --git a/src/FoundationClasses/TKMath/gp/gp_Cone.cxx b/src/FoundationClasses/TKMath/gp/gp_Cone.cxx index ffb1e82a68..a29ed0a573 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Cone.cxx +++ b/src/FoundationClasses/TKMath/gp/gp_Cone.cxx @@ -35,10 +35,10 @@ void gp_Cone::Coefficients(Standard_Real& A1, Standard_Real& D) const { // Dans le repere du cone : - // X**2 + Y**2 - (radius + Z * Tan(semiAngle))**2 = 0.0 + // X**2 + Y**2 - (radius + Z * std::tan(semiAngle))**2 = 0.0 gp_Trsf T; T.SetTransformation(pos); - Standard_Real KAng = Tan(semiAngle); + Standard_Real KAng = std::tan(semiAngle); Standard_Real T11 = T.Value(1, 1); Standard_Real T12 = T.Value(1, 2); Standard_Real T13 = T.Value(1, 3); diff --git a/src/FoundationClasses/TKMath/gp/gp_Cone.hxx b/src/FoundationClasses/TKMath/gp/gp_Cone.hxx index 1c04e1f0b1..9bd890e4cf 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Cone.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Cone.hxx @@ -68,7 +68,7 @@ public: //! the cone. //! theRaises ConstructionError //! * if theRadius is lower than 0.0 - //! * Abs(theAng) < Resolution from gp or Abs(theAng) >= (PI/2) - Resolution. + //! * std::abs(theAng) < Resolution from gp or std::abs(theAng) >= (PI/2) - Resolution. gp_Cone(const gp_Ax3& theA3, const Standard_Real theAng, const Standard_Real theRadius); //! Changes the symmetry axis of the cone. Raises ConstructionError @@ -95,9 +95,9 @@ public: //! Changes the semi-angle of the cone. //! Semi-angle can be negative. Its absolute value - //! Abs(theAng) is in range ]0,PI/2[. - //! Raises ConstructionError if Abs(theAng) < Resolution from gp or Abs(theAng) >= PI/2 - - //! Resolution + //! std::abs(theAng) is in range ]0,PI/2[. + //! Raises ConstructionError if std::abs(theAng) < Resolution from gp or std::abs(theAng) >= PI/2 + //! - Resolution void SetSemiAngle(const Standard_Real theAng); //! Computes the cone's top. The Apex of the cone is on the @@ -105,7 +105,7 @@ public: gp_Pnt Apex() const { gp_XYZ aCoord = pos.Direction().XYZ(); - aCoord.Multiply(-radius / Tan(semiAngle)); + aCoord.Multiply(-radius / std::tan(semiAngle)); aCoord.Add(pos.Location().XYZ()); return gp_Pnt(aCoord); } diff --git a/src/FoundationClasses/TKMath/gp/gp_Dir.hxx b/src/FoundationClasses/TKMath/gp/gp_Dir.hxx index 94da0b16ab..22b01e3f33 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Dir.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Dir.hxx @@ -77,11 +77,10 @@ public: gp_Dir(const gp_XYZ& theCoord); //! Creates a direction with its 3 cartesian coordinates. Raises ConstructionError if - //! Sqrt(theXv*theXv + theYv*theYv + theZv*theZv) <= Resolution Modification of the direction's - //! coordinates If Sqrt (theXv*theXv + theYv*theYv + theZv*theZv) <= Resolution from gp where - //! theXv, theYv ,theZv are the new coordinates it is not possible to - //! construct the direction and the method raises the - //! exception ConstructionError. + //! std::sqrt(theXv*theXv + theYv*theYv + theZv*theZv) <= Resolution Modification of the + //! direction's coordinates If std::sqrt (theXv*theXv + theYv*theYv + theZv*theZv) <= Resolution + //! from gp where theXv, theYv ,theZv are the new coordinates it is not possible to construct the + //! direction and the method raises the exception ConstructionError. gp_Dir(const Standard_Real theXv, const Standard_Real theYv, const Standard_Real theZv); //! For this unit vector, assigns the value Xi to: @@ -96,7 +95,7 @@ public: //! Standard_OutOfRange if theIndex is not 1, 2, or 3. //! Standard_ConstructionError if either of the following //! is less than or equal to gp::Resolution(): - //! - Sqrt(Xv*Xv + Yv*Yv + Zv*Zv), or + //! - std::sqrt(Xv*Xv + Yv*Yv + Zv*Zv), or //! - the modulus of the number triple formed by the new //! value theXi and the two other coordinates of this vector //! that were not directly modified. diff --git a/src/FoundationClasses/TKMath/gp/gp_Dir2d.hxx b/src/FoundationClasses/TKMath/gp/gp_Dir2d.hxx index a98872e9f2..d3e7bb5f8f 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Dir2d.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Dir2d.hxx @@ -72,7 +72,7 @@ public: gp_Dir2d(const gp_XY& theCoord); //! Creates a Direction with its 2 cartesian coordinates. Raises ConstructionError if - //! Sqrt(theXv*theXv + theYv*theYv) <= Resolution from gp. + //! std::sqrt(theXv*theXv + theYv*theYv) <= Resolution from gp. gp_Dir2d(const Standard_Real theXv, const Standard_Real theYv); //! For this unit vector, assigns: @@ -86,7 +86,7 @@ public: //! Standard_OutOfRange if theIndex is not 1 or 2. //! Standard_ConstructionError if either of the following //! is less than or equal to gp::Resolution(): - //! - Sqrt(theXv*theXv + theYv*theYv), or + //! - std::sqrt(theXv*theXv + theYv*theYv), or //! - the modulus of the number pair formed by the new //! value theXi and the other coordinate of this vector that //! was not directly modified. @@ -102,7 +102,7 @@ public: //! Standard_OutOfRange if theIndex is not 1 or 2. //! Standard_ConstructionError if either of the following //! is less than or equal to gp::Resolution(): - //! - Sqrt(theXv*theXv + theYv*theYv), or + //! - std::sqrt(theXv*theXv + theYv*theYv), or //! - the modulus of the number pair formed by the new //! value Xi and the other coordinate of this vector that //! was not directly modified. @@ -183,20 +183,20 @@ public: //! Returns True if the angle between this unit vector and the //! unit vector theOther is equal to Pi/2 or -Pi/2 (normal) - //! i.e. Abs(Abs(.Angle(theOther)) - PI/2.) <= theAngularTolerance + //! i.e. std::abs(std::abs(.Angle(theOther)) - PI/2.) <= theAngularTolerance Standard_Boolean IsNormal(const gp_Dir2d& theOther, const Standard_Real theAngularTolerance) const; //! Returns True if the angle between this unit vector and the //! unit vector theOther is equal to Pi or -Pi (opposite). - //! i.e. PI - Abs(.Angle(theOther)) <= theAngularTolerance + //! i.e. PI - std::abs(.Angle(theOther)) <= theAngularTolerance Standard_Boolean IsOpposite(const gp_Dir2d& theOther, const Standard_Real theAngularTolerance) const; //! Returns True if the angle between this unit vector and unit //! vector theOther is equal to 0, Pi or -Pi. - //! i.e. Abs(Angle(, theOther)) <= theAngularTolerance or - //! PI - Abs(Angle(, theOther)) <= theAngularTolerance + //! i.e. std::abs(Angle(, theOther)) <= theAngularTolerance or + //! PI - std::abs(Angle(, theOther)) <= theAngularTolerance Standard_Boolean IsParallel(const gp_Dir2d& theOther, const Standard_Real theAngularTolerance) const; diff --git a/src/FoundationClasses/TKMath/gp/gp_GTrsf.cxx b/src/FoundationClasses/TKMath/gp/gp_GTrsf.cxx index fc16f71056..8e10a76f4d 100644 --- a/src/FoundationClasses/TKMath/gp/gp_GTrsf.cxx +++ b/src/FoundationClasses/TKMath/gp/gp_GTrsf.cxx @@ -159,13 +159,13 @@ void gp_GTrsf::SetForm() gp_Mat M(matrix); Standard_Real s = M.Determinant(); - if (Abs(s) < gp::Resolution()) + if (std::abs(s) < gp::Resolution()) throw Standard_ConstructionError("gp_GTrsf::SetForm, null determinant"); if (s > 0) - s = Pow(s, 1. / 3.); + s = std::pow(s, 1. / 3.); else - s = -Pow(-s, 1. / 3.); + s = -std::pow(-s, 1. / 3.); M.Divide(s); // check if the matrix is an uniform matrix @@ -181,7 +181,7 @@ void gp_GTrsf::SetForm() for (Standard_Integer i = 1; i <= 3; i++) for (Standard_Integer j = 1; j <= 3; j++) - if (Abs(TM.Value(i, j)) > tol) + if (std::abs(TM.Value(i, j)) > tol) { shape = gp_Other; return; diff --git a/src/FoundationClasses/TKMath/gp/gp_GTrsf2d.cxx b/src/FoundationClasses/TKMath/gp/gp_GTrsf2d.cxx index a8f1f1177e..bb50c6d565 100644 --- a/src/FoundationClasses/TKMath/gp/gp_GTrsf2d.cxx +++ b/src/FoundationClasses/TKMath/gp/gp_GTrsf2d.cxx @@ -177,15 +177,15 @@ gp_Trsf2d gp_GTrsf2d::Trsf2d() const Standard_Real value = (matrix.Value(1, 1) * matrix.Value(1, 1) + matrix.Value(2, 1) * matrix.Value(2, 1)); - if (Abs(value - 1.) > aTolerance2) + if (std::abs(value - 1.) > aTolerance2) throw Standard_ConstructionError("gp_GTrsf2d::Trsf2d() - non-orthogonal GTrsf2d(1)"); value = (matrix.Value(1, 2) * matrix.Value(1, 2) + matrix.Value(2, 2) * matrix.Value(2, 2)); - if (Abs(value - 1.) > aTolerance2) + if (std::abs(value - 1.) > aTolerance2) throw Standard_ConstructionError("gp_GTrsf2d::Trsf2d() - non-orthogonal GTrsf2d(2)"); value = (matrix.Value(1, 1) * matrix.Value(1, 2) + matrix.Value(2, 1) * matrix.Value(2, 2)); - if (Abs(value) > aTolerance) + if (std::abs(value) > aTolerance) throw Standard_ConstructionError("gp_GTrsf2d::Trsf2d() - non-orthogonal GTrsf2d(3)"); gp_Trsf2d aTransformation; diff --git a/src/FoundationClasses/TKMath/gp/gp_Lin2d.hxx b/src/FoundationClasses/TKMath/gp/gp_Lin2d.hxx index 9b556edb1c..a7c5c0978a 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Lin2d.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Lin2d.hxx @@ -58,8 +58,8 @@ public: } //! Creates the line from the equation theA*X + theB*Y + theC = 0.0 Raises ConstructionError if - //! Sqrt(theA*theA + theB*theB) <= Resolution from gp. Raised if Sqrt(theA*theA + theB*theB) <= - //! Resolution from gp. + //! std::sqrt(theA*theA + theB*theB) <= Resolution from gp. Raised if std::sqrt(theA*theA + + //! theB*theB) <= Resolution from gp. Standard_EXPORT gp_Lin2d(const Standard_Real theA, const Standard_Real theB, const Standard_Real theC); diff --git a/src/FoundationClasses/TKMath/gp/gp_Mat.cxx b/src/FoundationClasses/TKMath/gp/gp_Mat.cxx index 6203999c9e..522f3b9ecb 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Mat.cxx +++ b/src/FoundationClasses/TKMath/gp/gp_Mat.cxx @@ -252,7 +252,7 @@ void gp_Mat::Invert() // Compute determinant using first row expansion (reuse computed cofactors) const Standard_Real aDet = a00 * adj00 + a01 * adj10 + a02 * adj20; - Standard_ConstructionError_Raise_if(Abs(aDet) <= gp::Resolution(), + Standard_ConstructionError_Raise_if(std::abs(aDet) <= gp::Resolution(), "gp_Mat::Invert() - matrix has zero determinant"); // Compute inverse: inv(A) = adj(A) / det(A) diff --git a/src/FoundationClasses/TKMath/gp/gp_Mat2d.cxx b/src/FoundationClasses/TKMath/gp/gp_Mat2d.cxx index 245eb713b2..8d960ec214 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Mat2d.cxx +++ b/src/FoundationClasses/TKMath/gp/gp_Mat2d.cxx @@ -130,7 +130,7 @@ void gp_Mat2d::Invert() aNewMat[1][0] = -myMat[1][0]; aNewMat[1][1] = myMat[0][0]; Standard_Real aDet = aNewMat[0][0] * aNewMat[1][1] - aNewMat[0][1] * aNewMat[1][0]; - Standard_ConstructionError_Raise_if(Abs(aDet) <= gp::Resolution(), + Standard_ConstructionError_Raise_if(std::abs(aDet) <= gp::Resolution(), "gp_Mat2d::Invert() - matrix has zero determinant"); aDet = 1.0 / aDet; myMat[0][0] = aNewMat[0][0] * aDet; diff --git a/src/FoundationClasses/TKMath/gp/gp_Pln.hxx b/src/FoundationClasses/TKMath/gp/gp_Pln.hxx index 1038de1ed0..41aa2c7f3e 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Pln.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Pln.hxx @@ -71,7 +71,8 @@ public: //! @code //! theA * X + theB * Y + theC * Z + theD = 0.0 //! @endcode - //! Raises ConstructionError if Sqrt (theA*theA + theB*theB + theC*theC) <= Resolution from gp. + //! Raises ConstructionError if std::sqrt (theA*theA + theB*theB + theC*theC) <= Resolution from + //! gp. Standard_EXPORT gp_Pln(const Standard_Real theA, const Standard_Real theB, const Standard_Real theC, diff --git a/src/FoundationClasses/TKMath/gp/gp_Pnt.hxx b/src/FoundationClasses/TKMath/gp/gp_Pnt.hxx index ee63d32760..0c34454894 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Pnt.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Pnt.hxx @@ -251,11 +251,11 @@ struct equal_to { bool operator()(const gp_Pnt& thePnt1, const gp_Pnt& thePnt2) const noexcept { - if (Abs(thePnt1.X() - thePnt2.X()) > Epsilon(thePnt2.X())) + if (std::abs(thePnt1.X() - thePnt2.X()) > Epsilon(thePnt2.X())) return false; - if (Abs(thePnt1.Y() - thePnt2.Y()) > Epsilon(thePnt2.Y())) + if (std::abs(thePnt1.Y() - thePnt2.Y()) > Epsilon(thePnt2.Y())) return false; - if (Abs(thePnt1.Z() - thePnt2.Z()) > Epsilon(thePnt2.Z())) + if (std::abs(thePnt1.Z() - thePnt2.Z()) > Epsilon(thePnt2.Z())) return false; return true; } diff --git a/src/FoundationClasses/TKMath/gp/gp_Quaternion.cxx b/src/FoundationClasses/TKMath/gp/gp_Quaternion.cxx index f3432f560b..358f038c6e 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Quaternion.cxx +++ b/src/FoundationClasses/TKMath/gp/gp_Quaternion.cxx @@ -28,8 +28,10 @@ Standard_Boolean gp_Quaternion::IsEqual(const gp_Quaternion& theOther) const { if (this == &theOther) return Standard_True; - return Abs(x - theOther.x) <= gp::Resolution() && Abs(y - theOther.y) <= gp::Resolution() - && Abs(z - theOther.z) <= gp::Resolution() && Abs(w - theOther.w) <= gp::Resolution(); + return std::abs(x - theOther.x) <= gp::Resolution() + && std::abs(y - theOther.y) <= gp::Resolution() + && std::abs(z - theOther.z) <= gp::Resolution() + && std::abs(w - theOther.w) <= gp::Resolution(); } //================================================================================================= @@ -74,26 +76,26 @@ void gp_Quaternion::SetVectorAndAngle(const gp_Vec& theAxis, const Standard_Real { gp_Vec anAxis = theAxis.Normalized(); Standard_Real anAngleHalf = 0.5 * theAngle; - Standard_Real sin_a = Sin(anAngleHalf); - Set(anAxis.X() * sin_a, anAxis.Y() * sin_a, anAxis.Z() * sin_a, Cos(anAngleHalf)); + Standard_Real sin_a = std::sin(anAngleHalf); + Set(anAxis.X() * sin_a, anAxis.Y() * sin_a, anAxis.Z() * sin_a, std::cos(anAngleHalf)); } //================================================================================================= void gp_Quaternion::GetVectorAndAngle(gp_Vec& theAxis, Standard_Real& theAngle) const { - Standard_Real vl = Sqrt(x * x + y * y + z * z); + Standard_Real vl = std::sqrt(x * x + y * y + z * z); if (vl > gp::Resolution()) { Standard_Real ivl = 1.0 / vl; theAxis.SetCoord(x * ivl, y * ivl, z * ivl); if (w < 0.0) { - theAngle = 2.0 * ATan2(-vl, -w); // [-PI, 0] + theAngle = 2.0 * std::atan2(-vl, -w); // [-PI, 0] } else { - theAngle = 2.0 * ATan2(vl, w); // [ 0, PI] + theAngle = 2.0 * std::atan2(vl, w); // [ 0, PI] } } else @@ -114,7 +116,7 @@ void gp_Quaternion::SetMatrix(const gp_Mat& theMat) theMat(1, 3) - theMat(3, 1), theMat(2, 1) - theMat(1, 2), tr + 1.0); - Scale(0.5 / Sqrt(w)); // "w" contain the "norm * 4" + Scale(0.5 / std::sqrt(w)); // "w" contain the "norm * 4" } else if ((theMat(1, 1) > theMat(2, 2)) && (theMat(1, 1) > theMat(3, 3))) { // Some of vector components is bigger @@ -122,7 +124,7 @@ void gp_Quaternion::SetMatrix(const gp_Mat& theMat) theMat(1, 2) + theMat(2, 1), theMat(1, 3) + theMat(3, 1), theMat(3, 2) - theMat(2, 3)); - Scale(0.5 / Sqrt(x)); + Scale(0.5 / std::sqrt(x)); } else if (theMat(2, 2) > theMat(3, 3)) { @@ -130,7 +132,7 @@ void gp_Quaternion::SetMatrix(const gp_Mat& theMat) 1.0 + theMat(2, 2) - theMat(1, 1) - theMat(3, 3), theMat(2, 3) + theMat(3, 2), theMat(1, 3) - theMat(3, 1)); - Scale(0.5 / Sqrt(y)); + Scale(0.5 / std::sqrt(y)); } else { @@ -138,7 +140,7 @@ void gp_Quaternion::SetMatrix(const gp_Mat& theMat) theMat(2, 3) + theMat(3, 2), 1.0 + theMat(3, 3) - theMat(1, 1) - theMat(2, 2), theMat(2, 1) - theMat(1, 2)); - Scale(0.5 / Sqrt(z)); + Scale(0.5 / std::sqrt(z)); } } @@ -313,12 +315,12 @@ void gp_Quaternion::SetEulerAngles(const gp_EulerSequence theOrder, Standard_Real ti = 0.5 * a; Standard_Real tj = 0.5 * b; Standard_Real th = 0.5 * c; - Standard_Real ci = Cos(ti); - Standard_Real cj = Cos(tj); - Standard_Real ch = Cos(th); - Standard_Real si = Sin(ti); - Standard_Real sj = Sin(tj); - Standard_Real sh = Sin(th); + Standard_Real ci = std::cos(ti); + Standard_Real cj = std::cos(tj); + Standard_Real ch = std::cos(th); + Standard_Real si = std::sin(ti); + Standard_Real sj = std::sin(tj); + Standard_Real sh = std::sin(th); Standard_Real cc = ci * ch; Standard_Real cs = ci * sh; Standard_Real sc = si * ch; @@ -363,30 +365,30 @@ void gp_Quaternion::GetEulerAngles(const gp_EulerSequence theOrder, double sy = sqrt(M(o.i, o.j) * M(o.i, o.j) + M(o.i, o.k) * M(o.i, o.k)); if (sy > 16 * DBL_EPSILON) { - theAlpha = ATan2(M(o.i, o.j), M(o.i, o.k)); - theGamma = ATan2(M(o.j, o.i), -M(o.k, o.i)); + theAlpha = std::atan2(M(o.i, o.j), M(o.i, o.k)); + theGamma = std::atan2(M(o.j, o.i), -M(o.k, o.i)); } else { - theAlpha = ATan2(-M(o.j, o.k), M(o.j, o.j)); + theAlpha = std::atan2(-M(o.j, o.k), M(o.j, o.j)); theGamma = 0.; } - theBeta = ATan2(sy, M(o.i, o.i)); + theBeta = std::atan2(sy, M(o.i, o.i)); } else { double cy = sqrt(M(o.i, o.i) * M(o.i, o.i) + M(o.j, o.i) * M(o.j, o.i)); if (cy > 16 * DBL_EPSILON) { - theAlpha = ATan2(M(o.k, o.j), M(o.k, o.k)); - theGamma = ATan2(M(o.j, o.i), M(o.i, o.i)); + theAlpha = std::atan2(M(o.k, o.j), M(o.k, o.k)); + theGamma = std::atan2(M(o.j, o.i), M(o.i, o.i)); } else { - theAlpha = ATan2(-M(o.j, o.k), M(o.j, o.j)); + theAlpha = std::atan2(-M(o.j, o.k), M(o.j, o.j)); theGamma = 0.; } - theBeta = ATan2(-M(o.k, o.i), cy); + theBeta = std::atan2(-M(o.k, o.i), cy); } if (o.isOdd) { @@ -406,7 +408,7 @@ void gp_Quaternion::GetEulerAngles(const gp_EulerSequence theOrder, void gp_Quaternion::StabilizeLength() { - Standard_Real cs = Abs(x) + Abs(y) + Abs(z) + Abs(w); + Standard_Real cs = std::abs(x) + std::abs(y) + std::abs(z) + std::abs(w); if (cs > 0.0) { x /= cs; @@ -439,11 +441,11 @@ Standard_Real gp_Quaternion::GetRotationAngle() const { if (w < 0.0) { - return 2.0 * ATan2(-Sqrt(x * x + y * y + z * z), -w); + return 2.0 * std::atan2(-std::sqrt(x * x + y * y + z * z), -w); } else { - return 2.0 * ATan2(Sqrt(x * x + y * y + z * z), w); + return 2.0 * std::atan2(std::sqrt(x * x + y * y + z * z), w); } } diff --git a/src/FoundationClasses/TKMath/gp/gp_Quaternion.hxx b/src/FoundationClasses/TKMath/gp/gp_Quaternion.hxx index ab49cc0339..7fe053599e 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Quaternion.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Quaternion.hxx @@ -182,7 +182,7 @@ public: constexpr Standard_Real SquareNorm() const noexcept { return x * x + y * y + z * z + w * w; } //! Returns norm of quaternion - Standard_Real Norm() const { return Sqrt(SquareNorm()); } + Standard_Real Norm() const { return std::sqrt(SquareNorm()); } //! Scale all components by quaternion by theScale; note that //! rotation is not changed by this operation (except 0-scaling) diff --git a/src/FoundationClasses/TKMath/gp/gp_QuaternionSLerp.hxx b/src/FoundationClasses/TKMath/gp/gp_QuaternionSLerp.hxx index 72bd8a0900..2aad600d9d 100644 --- a/src/FoundationClasses/TKMath/gp/gp_QuaternionSLerp.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_QuaternionSLerp.hxx @@ -67,8 +67,8 @@ public: { cosOmega = 0.9999; } - myOmega = ACos(cosOmega); - Standard_Real invSinOmega = (1.0 / Sin(myOmega)); + myOmega = std::acos(cosOmega); + Standard_Real invSinOmega = (1.0 / std::sin(myOmega)); myQStart.Scale(invSinOmega); myQEnd.Scale(invSinOmega); } @@ -76,7 +76,7 @@ public: //! Set interpolated quaternion for theT position (from 0.0 to 1.0) void Interpolate(Standard_Real theT, gp_Quaternion& theResultQ) const { - theResultQ = myQStart * Sin((1.0 - theT) * myOmega) + myQEnd * Sin(theT * myOmega); + theResultQ = myQStart * std::sin((1.0 - theT) * myOmega) + myQEnd * std::sin(theT * myOmega); } private: diff --git a/src/FoundationClasses/TKMath/gp/gp_Trsf.cxx b/src/FoundationClasses/TKMath/gp/gp_Trsf.cxx index bf6d2abcfa..b8c89f3548 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Trsf.cxx +++ b/src/FoundationClasses/TKMath/gp/gp_Trsf.cxx @@ -362,9 +362,9 @@ void gp_Trsf::SetValues(const Standard_Real a11, Standard_ConstructionError_Raise_if(As < gp::Resolution(), "gp_Trsf::SetValues, null determinant"); if (s > 0) - s = Pow(s, 1. / 3.); + s = std::pow(s, 1. / 3.); else - s = -Pow(-s, 1. / 3.); + s = -std::pow(-s, 1. / 3.); M.Divide(s); scale = s; @@ -413,14 +413,14 @@ void gp_Trsf::Invert() loc.Reverse(); else if (shape == gp_Scale) { - Standard_ConstructionError_Raise_if(Abs(scale) <= gp::Resolution(), + Standard_ConstructionError_Raise_if(std::abs(scale) <= gp::Resolution(), "gp_Trsf::Invert() - transformation has zero scale"); scale = 1.0 / scale; loc.Multiply(-scale); } else { - Standard_ConstructionError_Raise_if(Abs(scale) <= gp::Resolution(), + Standard_ConstructionError_Raise_if(std::abs(scale) <= gp::Resolution(), "gp_Trsf::Invert() - transformation has zero scale"); scale = 1.0 / scale; matrix.Transpose(); diff --git a/src/FoundationClasses/TKMath/gp/gp_Trsf2d.cxx b/src/FoundationClasses/TKMath/gp/gp_Trsf2d.cxx index b565610e95..0ad01da1a8 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Trsf2d.cxx +++ b/src/FoundationClasses/TKMath/gp/gp_Trsf2d.cxx @@ -211,7 +211,7 @@ gp_Mat2d gp_Trsf2d::VectorialPart() const Standard_Real gp_Trsf2d::RotationPart() const { - return ATan2(matrix.Value(2, 1), matrix.Value(1, 1)); + return std::atan2(matrix.Value(2, 1), matrix.Value(1, 1)); } void gp_Trsf2d::Invert() diff --git a/src/FoundationClasses/TKMath/gp/gp_TrsfNLerp.hxx b/src/FoundationClasses/TKMath/gp/gp_TrsfNLerp.hxx index 9e30d04c3c..4b0348dbec 100644 --- a/src/FoundationClasses/TKMath/gp/gp_TrsfNLerp.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_TrsfNLerp.hxx @@ -55,12 +55,12 @@ public: //! @param[out] theResult interpolated value void Interpolate(double theT, gp_Trsf& theResult) const { - if (Abs(theT - 0.0) < Precision::Confusion()) + if (std::abs(theT - 0.0) < Precision::Confusion()) { theResult = myTrsfStart; return; } - else if (Abs(theT - 1.0) < Precision::Confusion()) + else if (std::abs(theT - 1.0) < Precision::Confusion()) { theResult = myTrsfEnd; return; diff --git a/src/FoundationClasses/TKMath/gp/gp_Vec.cxx b/src/FoundationClasses/TKMath/gp/gp_Vec.cxx index 67ee824662..202ea34ef4 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Vec.cxx +++ b/src/FoundationClasses/TKMath/gp/gp_Vec.cxx @@ -38,12 +38,12 @@ Standard_Boolean gp_Vec::IsEqual(const gp_Vec& theOther, if (aMagnitude <= theLinearTolerance || anOtherMagnitude <= theLinearTolerance) { - const Standard_Real aVal = Abs(aMagnitude - anOtherMagnitude); + const Standard_Real aVal = std::abs(aMagnitude - anOtherMagnitude); return aVal <= theLinearTolerance; } else { - const Standard_Real aVal = Abs(aMagnitude - anOtherMagnitude); + const Standard_Real aVal = std::abs(aMagnitude - anOtherMagnitude); return aVal <= theLinearTolerance && Angle(theOther) <= theAngularTolerance; } } diff --git a/src/FoundationClasses/TKMath/gp/gp_Vec.hxx b/src/FoundationClasses/TKMath/gp/gp_Vec.hxx index 5523d3f5d4..47dd86f328 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Vec.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Vec.hxx @@ -489,7 +489,7 @@ inline gp_Vec::gp_Vec(const gp_Pnt& theP1, const gp_Pnt& theP2) inline Standard_Boolean gp_Vec::IsNormal(const gp_Vec& theOther, const Standard_Real theAngularTolerance) const { - const Standard_Real anAng = Abs(M_PI_2 - Angle(theOther)); + const Standard_Real anAng = std::abs(M_PI_2 - Angle(theOther)); return anAng <= theAngularTolerance; } diff --git a/src/FoundationClasses/TKMath/gp/gp_Vec2d.cxx b/src/FoundationClasses/TKMath/gp/gp_Vec2d.cxx index c8027c165f..f975019e3d 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Vec2d.cxx +++ b/src/FoundationClasses/TKMath/gp/gp_Vec2d.cxx @@ -31,13 +31,13 @@ Standard_Boolean gp_Vec2d::IsEqual(const gp_Vec2d& theOther, { const Standard_Real aNorm = Magnitude(); const Standard_Real anOtherNorm = theOther.Magnitude(); - const Standard_Real aVal = Abs(aNorm - anOtherNorm); + const Standard_Real aVal = std::abs(aNorm - anOtherNorm); // Check for equal lengths const Standard_Boolean isEqualLength = (aVal <= theLinearTolerance); // Check for small vectors if (aNorm > theLinearTolerance && anOtherNorm > theLinearTolerance) { - const Standard_Real anAng = Abs(Angle(theOther)); + const Standard_Real anAng = std::abs(Angle(theOther)); // Check for zero angle return isEqualLength && (anAng <= theAngularTolerance); } diff --git a/src/FoundationClasses/TKMath/gp/gp_Vec2d.hxx b/src/FoundationClasses/TKMath/gp/gp_Vec2d.hxx index 916549d313..f750bcdb6e 100644 --- a/src/FoundationClasses/TKMath/gp/gp_Vec2d.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_Vec2d.hxx @@ -101,24 +101,24 @@ public: const Standard_Real theLinearTolerance, const Standard_Real theAngularTolerance) const; - //! Returns True if abs(Abs(.Angle(theOther)) - PI/2.) + //! Returns True if abs(std::abs(.Angle(theOther)) - PI/2.) //! <= theAngularTolerance //! Raises VectorWithNullMagnitude if .Magnitude() <= Resolution or //! theOther.Magnitude() <= Resolution from gp. Standard_Boolean IsNormal(const gp_Vec2d& theOther, const Standard_Real theAngularTolerance) const { - const Standard_Real anAng = Abs(M_PI_2 - Abs(Angle(theOther))); + const Standard_Real anAng = std::abs(M_PI_2 - std::abs(Angle(theOther))); return !(anAng > theAngularTolerance); } - //! Returns True if PI - Abs(.Angle(theOther)) <= theAngularTolerance + //! Returns True if PI - std::abs(.Angle(theOther)) <= theAngularTolerance //! Raises VectorWithNullMagnitude if .Magnitude() <= Resolution or //! theOther.Magnitude() <= Resolution from gp. Standard_Boolean IsOpposite(const gp_Vec2d& theOther, const Standard_Real theAngularTolerance) const; - //! Returns true if Abs(Angle(, theOther)) <= theAngularTolerance or - //! PI - Abs(Angle(, theOther)) <= theAngularTolerance + //! Returns true if std::abs(Angle(, theOther)) <= theAngularTolerance or + //! PI - std::abs(Angle(, theOther)) <= theAngularTolerance //! Two vectors with opposite directions are considered as parallel. //! Raises VectorWithNullMagnitude if .Magnitude() <= Resolution or //! theOther.Magnitude() <= Resolution from gp @@ -376,7 +376,7 @@ inline gp_Vec2d::gp_Vec2d(const gp_Pnt2d& theP1, const gp_Pnt2d& theP2) inline Standard_Boolean gp_Vec2d::IsOpposite(const gp_Vec2d& theOther, const Standard_Real theAngularTolerance) const { - const Standard_Real anAng = Abs(Angle(theOther)); + const Standard_Real anAng = std::abs(Angle(theOther)); return M_PI - anAng <= theAngularTolerance; } @@ -385,7 +385,7 @@ inline Standard_Boolean gp_Vec2d::IsOpposite(const gp_Vec2d& theOther, inline Standard_Boolean gp_Vec2d::IsParallel(const gp_Vec2d& theOther, const Standard_Real theAngularTolerance) const { - const Standard_Real anAng = Abs(Angle(theOther)); + const Standard_Real anAng = std::abs(Angle(theOther)); return anAng <= theAngularTolerance || M_PI - anAng <= theAngularTolerance; } diff --git a/src/FoundationClasses/TKMath/gp/gp_XY.hxx b/src/FoundationClasses/TKMath/gp/gp_XY.hxx index 7c13df7a0d..fe46a7ff44 100644 --- a/src/FoundationClasses/TKMath/gp/gp_XY.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_XY.hxx @@ -98,7 +98,7 @@ public: //! Returns the Y coordinate of this number pair. constexpr Standard_Real Y() const noexcept { return y; } - //! Computes Sqrt (X*X + Y*Y) where X and Y are the two coordinates of this number pair. + //! Computes std::sqrt(X*X + Y*Y) where X and Y are the two coordinates of this number pair. Standard_Real Modulus() const { return sqrt(SquareModulus()); } //! Computes X*X + Y*Y where X and Y are the two coordinates of this number pair. @@ -109,7 +109,7 @@ public: //! theOther, within the specified tolerance theTolerance. Standard_Boolean IsEqual(const gp_XY& theOther, const Standard_Real theTolerance) const { - return (Abs(x - theOther.x) < theTolerance) && (Abs(y - theOther.y) < theTolerance); + return (std::abs(x - theOther.x) < theTolerance) && (std::abs(y - theOther.y) < theTolerance); } //! Computes the sum of this number pair and number pair theOther @@ -157,7 +157,7 @@ public: //! theRight. Returns || ^ theRight || Standard_Real CrossMagnitude(const gp_XY& theRight) const { - return Abs(x * theRight.y - y * theRight.x); + return std::abs(x * theRight.y - y * theRight.x); } //! computes the square magnitude of the cross product between and diff --git a/src/FoundationClasses/TKMath/gp/gp_XYZ.hxx b/src/FoundationClasses/TKMath/gp/gp_XYZ.hxx index effe029156..4d6f4b0935 100644 --- a/src/FoundationClasses/TKMath/gp/gp_XYZ.hxx +++ b/src/FoundationClasses/TKMath/gp/gp_XYZ.hxx @@ -126,7 +126,8 @@ public: //! Returns the Z coordinate constexpr Standard_Real Z() const noexcept { return z; } - //! computes Sqrt (X*X + Y*Y + Z*Z) where X, Y and Z are the three coordinates of this XYZ object. + //! computes std::sqrt(X*X + Y*Y + Z*Z) where X, Y and Z are the three coordinates of this XYZ + //! object. Standard_Real Modulus() const { return sqrt(x * x + y * y + z * z); } //! Computes X*X + Y*Y + Z*Z where X, Y and Z are the three coordinates of this XYZ object. @@ -138,8 +139,8 @@ public: Standard_Boolean IsEqual(const gp_XYZ& theOther, const Standard_Real theTolerance) const { - return (Abs(x - theOther.x) < theTolerance) && (Abs(y - theOther.y) < theTolerance) - && (Abs(z - theOther.z) < theTolerance); + return (std::abs(x - theOther.x) < theTolerance) && (std::abs(y - theOther.y) < theTolerance) + && (std::abs(z - theOther.z) < theTolerance); } //! @code diff --git a/src/FoundationClasses/TKMath/math/math_BFGS.cxx b/src/FoundationClasses/TKMath/math/math_BFGS.cxx index 79cdf481f0..94f5614a03 100644 --- a/src/FoundationClasses/TKMath/math/math_BFGS.cxx +++ b/src/FoundationClasses/TKMath/math/math_BFGS.cxx @@ -118,12 +118,12 @@ static Standard_Boolean ComputeInitScale(const Standard_Real theF0, Standard_Real& theScale) { const Standard_Real dy1 = theGr * theDir; - if (Abs(dy1) < RealSmall()) + if (std::abs(dy1) < RealSmall()) return Standard_False; const Standard_Real aHnr1 = theDir.Norm2(); const Standard_Real alfa = 0.7 * (-theF0) / dy1; - theScale = 0.015 / Sqrt(aHnr1); + theScale = 0.015 / std::sqrt(aHnr1); if (theScale > alfa) theScale = alfa; @@ -148,29 +148,29 @@ static Standard_Boolean ComputeMinMaxScale(const math_Vector& thePoint, { const Standard_Real aLeft = theLeft(anIdx) - thePoint(anIdx); const Standard_Real aRight = theRight(anIdx) - thePoint(anIdx); - if (Abs(theDir(anIdx)) > RealSmall()) + if (std::abs(theDir(anIdx)) > RealSmall()) { // Use PConfusion to get off a little from the bounds to prevent // possible refuse in Value function. const Standard_Real aLScale = (aLeft + Precision::PConfusion()) / theDir(anIdx); const Standard_Real aRScale = (aRight - Precision::PConfusion()) / theDir(anIdx); - if (Abs(aLeft) < Precision::PConfusion()) + if (std::abs(aLeft) < Precision::PConfusion()) { // Point is on the left border. - theMaxScale = Min(theMaxScale, Max(0., aRScale)); - theMinScale = Max(theMinScale, Min(0., aRScale)); + theMaxScale = std::min(theMaxScale, std::max(0., aRScale)); + theMinScale = std::max(theMinScale, std::min(0., aRScale)); } - else if (Abs(aRight) < Precision::PConfusion()) + else if (std::abs(aRight) < Precision::PConfusion()) { // Point is on the right border. - theMaxScale = Min(theMaxScale, Max(0., aLScale)); - theMinScale = Max(theMinScale, Min(0., aLScale)); + theMaxScale = std::min(theMaxScale, std::max(0., aLScale)); + theMinScale = std::max(theMinScale, std::min(0., aLScale)); } else if (aLeft * aRight < 0) { // Point is inside allowed range. - theMaxScale = Min(theMaxScale, Max(aLScale, aRScale)); - theMinScale = Max(theMinScale, Min(aLScale, aRScale)); + theMaxScale = std::min(theMaxScale, std::max(aLScale, aRScale)); + theMinScale = std::max(theMinScale, std::min(aLScale, aRScale)); } else // point is out of bounds @@ -223,8 +223,8 @@ static Standard_Boolean MinimizeDirection(math_Vector& P, // Make direction to go along the border for (Standard_Integer anIdx = 1; anIdx <= theLeft.Upper(); anIdx++) { - if ((Abs(P(anIdx) - theRight(anIdx)) < Precision::PConfusion() && Dir(anIdx) > 0.0) - || (Abs(P(anIdx) - theLeft(anIdx)) < Precision::PConfusion() && Dir(anIdx) < 0.0)) + if ((std::abs(P(anIdx) - theRight(anIdx)) < Precision::PConfusion() && Dir(anIdx) > 0.0) + || (std::abs(P(anIdx) - theLeft(anIdx)) < Precision::PConfusion() && Dir(anIdx) < 0.0)) { Dir(anIdx) = 0.0; } @@ -236,8 +236,8 @@ static Standard_Boolean MinimizeDirection(math_Vector& P, if (!ComputeMinMaxScale(P, Dir, theLeft, theRight, aMinLambda, aMaxLambda)) return Standard_False; } - lambda = Min(lambda, aMaxLambda); - lambda = Max(lambda, aMinLambda); + lambda = std::min(lambda, aMaxLambda); + lambda = std::max(lambda, aMinLambda); } F.Initialize(P, Dir); diff --git a/src/FoundationClasses/TKMath/math/math_BissecNewton.cxx b/src/FoundationClasses/TKMath/math/math_BissecNewton.cxx index 081204945b..49438ff8d9 100644 --- a/src/FoundationClasses/TKMath/math/math_BissecNewton.cxx +++ b/src/FoundationClasses/TKMath/math/math_BissecNewton.cxx @@ -98,7 +98,7 @@ void math_BissecNewton::Perform(math_FunctionWithDerivative& F, dxold = dx; dx = 0.5 * (xh - xl); x = xl + dx; - if (Abs(dx) < XTol) + if (std::abs(dx) < XTol) { TheStatus = math_OK; Done = Standard_True; diff --git a/src/FoundationClasses/TKMath/math/math_BissecNewton.lxx b/src/FoundationClasses/TKMath/math/math_BissecNewton.lxx index 62ce19a3e3..e63cb55248 100644 --- a/src/FoundationClasses/TKMath/math/math_BissecNewton.lxx +++ b/src/FoundationClasses/TKMath/math/math_BissecNewton.lxx @@ -16,7 +16,7 @@ inline Standard_Boolean math_BissecNewton::IsSolutionReached(math_FunctionWithDerivative&) { - return Abs(dx) <= XTol; + return std::abs(dx) <= XTol; } inline Standard_OStream& operator<<(Standard_OStream& o, const math_BissecNewton& Bi) diff --git a/src/FoundationClasses/TKMath/math/math_BracketMinimum.cxx b/src/FoundationClasses/TKMath/math/math_BracketMinimum.cxx index c4a530412c..d0f6f7bfef 100644 --- a/src/FoundationClasses/TKMath/math/math_BracketMinimum.cxx +++ b/src/FoundationClasses/TKMath/math/math_BracketMinimum.cxx @@ -39,7 +39,7 @@ Standard_Boolean math_BracketMinimum::LimitAndMayBeSwap(math_Function& F, Standard_Real& theFC) const { theC = Limited(theC); - if (Abs(theB - theC) < Precision::PConfusion()) + if (std::abs(theB - theC) < Precision::PConfusion()) return Standard_False; Standard_Boolean OK = F.Value(theC, theFC); if (!OK) diff --git a/src/FoundationClasses/TKMath/math/math_BracketedRoot.cxx b/src/FoundationClasses/TKMath/math/math_BracketedRoot.cxx index ece084c5a4..12d200271a 100644 --- a/src/FoundationClasses/TKMath/math/math_BracketedRoot.cxx +++ b/src/FoundationClasses/TKMath/math/math_BracketedRoot.cxx @@ -50,7 +50,7 @@ math_BracketedRoot::math_BracketedRoot(math_Function& F, d = TheRoot - a; e = d; } - if (Abs(Fc) < Abs(Fa)) + if (std::abs(Fc) < std::abs(Fa)) { a = TheRoot; TheRoot = c; @@ -59,14 +59,14 @@ math_BracketedRoot::math_BracketedRoot(math_Function& F, TheError = Fc; Fc = Fa; } - tol1 = 2. * ZEPS * Abs(TheRoot) + 0.5 * Tolerance; // convergence check + tol1 = 2. * ZEPS * std::abs(TheRoot) + 0.5 * Tolerance; // convergence check xm = 0.5 * (c - TheRoot); - if (Abs(xm) <= tol1 || TheError == 0.) + if (std::abs(xm) <= tol1 || TheError == 0.) { Done = Standard_True; return; } - if (Abs(e) >= tol1 && Abs(Fa) > Abs(TheError)) + if (std::abs(e) >= tol1 && std::abs(Fa) > std::abs(TheError)) { s = TheError / Fa; // attempt inverse quadratic interpolation if (a == c) @@ -85,9 +85,9 @@ math_BracketedRoot::math_BracketedRoot(math_Function& F, { q = -q; } // check whether in bounds - p = Abs(p); - min1 = 3. * xm * q - Abs(tol1 * q); - min2 = Abs(e * q); + p = std::abs(p); + min1 = 3. * xm * q - std::abs(tol1 * q); + min2 = std::abs(e * q); if (2. * p < (min1 < min2 ? min1 : min2)) { e = d; // accept interpolation @@ -106,13 +106,13 @@ math_BracketedRoot::math_BracketedRoot(math_Function& F, } a = TheRoot; // move last best guess to a Fa = TheError; - if (Abs(d) > tol1) + if (std::abs(d) > tol1) { // evaluate new trial root TheRoot += d; } else { - TheRoot += (xm > 0. ? Abs(tol1) : -Abs(tol1)); + TheRoot += (xm > 0. ? std::abs(tol1) : -std::abs(tol1)); } F.Value(TheRoot, TheError); } diff --git a/src/FoundationClasses/TKMath/math/math_BrentMinimum.cxx b/src/FoundationClasses/TKMath/math/math_BrentMinimum.cxx index 93c8565049..e7b2ced3b7 100644 --- a/src/FoundationClasses/TKMath/math/math_BrentMinimum.cxx +++ b/src/FoundationClasses/TKMath/math/math_BrentMinimum.cxx @@ -126,7 +126,7 @@ void math_BrentMinimum::Perform(math_Function& F, d = p / q; u = x + d; if (u - a < tol2 || b - u < tol2) - d = Sign(tol1, xm - x); + d = std::copysign(tol1, xm - x); } } else @@ -134,7 +134,7 @@ void math_BrentMinimum::Perform(math_Function& F, e = (x >= xm ? a - x : b - x); d = CGOLD * e; } - u = (fabs(d) >= tol1 ? x + d : x + Sign(tol1, d)); + u = (fabs(d) >= tol1 ? x + d : x + std::copysign(tol1, d)); OK = F.Value(u, fu); if (!OK) return; diff --git a/src/FoundationClasses/TKMath/math/math_ComputeGaussPointsAndWeights.cxx b/src/FoundationClasses/TKMath/math/math_ComputeGaussPointsAndWeights.cxx index a9b57d611a..746e272b87 100644 --- a/src/FoundationClasses/TKMath/math/math_ComputeGaussPointsAndWeights.cxx +++ b/src/FoundationClasses/TKMath/math/math_ComputeGaussPointsAndWeights.cxx @@ -47,7 +47,7 @@ math_ComputeGaussPointsAndWeights::math_ComputeGaussPointsAndWeights(const Stand { Standard_Integer sqrIm1 = (i - 1) * (i - 1); aSubDiag(i) = sqrIm1 / (4. * sqrIm1 - 1); - aSubDiag(i) = Sqrt(aSubDiag(i)); + aSubDiag(i) = std::sqrt(aSubDiag(i)); } } diff --git a/src/FoundationClasses/TKMath/math/math_ComputeKronrodPointsAndWeights.cxx b/src/FoundationClasses/TKMath/math/math_ComputeKronrodPointsAndWeights.cxx index 0645b2d4b6..6d6911ed59 100644 --- a/src/FoundationClasses/TKMath/math/math_ComputeKronrodPointsAndWeights.cxx +++ b/src/FoundationClasses/TKMath/math/math_ComputeKronrodPointsAndWeights.cxx @@ -39,7 +39,7 @@ math_ComputeKronrodPointsAndWeights::math_ComputeKronrodPointsAndWeights( // Initialize symmetric tridiagonal matrix. Standard_Integer n = Number; Standard_Integer aKronrodN = 2 * Number + 1; - Standard_Integer a3KN2p1 = Min(3 * (Number + 1) / 2 + 1, aKronrodN); + Standard_Integer a3KN2p1 = std::min(3 * (Number + 1) / 2 + 1, aKronrodN); for (i = 1; i <= a3KN2p1; i++) { aDiag(i) = 0.; @@ -157,7 +157,7 @@ math_ComputeKronrodPointsAndWeights::math_ComputeKronrodPointsAndWeights( delete[] bb; for (i = 1; i <= a2NP1; i++) - aSubDiag(i) = Sqrt(aSubDiag(i)); + aSubDiag(i) = std::sqrt(aSubDiag(i)); // Compute eigen values. math_EigenValuesSearcher EVsearch(aDiag, aSubDiag); diff --git a/src/FoundationClasses/TKMath/math/math_Crout.cxx b/src/FoundationClasses/TKMath/math/math_Crout.cxx index e6777d49db..1e5051c710 100644 --- a/src/FoundationClasses/TKMath/math/math_Crout.cxx +++ b/src/FoundationClasses/TKMath/math/math_Crout.cxx @@ -60,7 +60,7 @@ math_Crout::math_Crout(const math_Matrix& A, const Standard_Real MinPivot) } Diag(i) = A(i + lowr - 1, i + lowc - 1) - scale; Det *= Diag(i); - if (Abs(Diag(i)) <= MinPivot) + if (std::abs(Diag(i)) <= MinPivot) { Done = Standard_False; return; diff --git a/src/FoundationClasses/TKMath/math/math_DirectPolynomialRoots.cxx b/src/FoundationClasses/TKMath/math/math_DirectPolynomialRoots.cxx index c0b9ef964a..cb5faa0d5b 100644 --- a/src/FoundationClasses/TKMath/math/math_DirectPolynomialRoots.cxx +++ b/src/FoundationClasses/TKMath/math/math_DirectPolynomialRoots.cxx @@ -72,16 +72,16 @@ static Standard_Real Improve(const Standard_Integer N, for (Index = 1; Index < 10; Index++) { Values(N, Poly, Sol, Val, Der); - if (Abs(Der) <= ZERO) + if (std::abs(Der) <= ZERO) break; Delta = -Val / Der; - if (Abs(Delta) <= EPSILON * Abs(Sol)) + if (std::abs(Delta) <= EPSILON * std::abs(Sol)) break; Sol = Sol + Delta; // std::cout << " Iter = " << Index << " Delta = " << Delta // << " Val = " << Val << " Der = " << Der << "\n"; } - if (Abs(Val) <= Abs(IniVal)) + if (std::abs(Val) <= std::abs(IniVal)) { return Sol; } @@ -196,7 +196,7 @@ void math_DirectPolynomialRoots::Solve(const Standard_Real a, const Standard_Real d, const Standard_Real e) { - if (Abs(a) <= ZERO) + if (std::abs(a) <= ZERO) { Solve(b, c, d, e); return; @@ -204,7 +204,7 @@ void math_DirectPolynomialRoots::Solve(const Standard_Real a, //// modified by jgv, 22.01.09 //// Standard_Real aZero = ZERO; - Standard_Real Abs_b = Abs(b), Abs_c = Abs(c), Abs_d = Abs(d), Abs_e = Abs(e); + Standard_Real Abs_b = std::abs(b), Abs_c = std::abs(c), Abs_d = std::abs(d), Abs_e = std::abs(e); if (Abs_b > aZero) aZero = Abs_b; @@ -217,7 +217,7 @@ void math_DirectPolynomialRoots::Solve(const Standard_Real a, if (aZero > ZERO) aZero = Epsilon(100. * aZero); - if (Abs(a) <= aZero) + if (std::abs(a) <= aZero) { Standard_Real aZero1000 = 1000. * aZero; Standard_Boolean with_a = Standard_False; @@ -309,14 +309,14 @@ void math_DirectPolynomialRoots::Solve(const Standard_Real a, // Standard_Real anEps = 100 * EPSILON; - if (Abs(P) <= anEps) + if (std::abs(P) <= anEps) P = 0.; - if (Abs(P1) <= anEps) + if (std::abs(P1) <= anEps) P1 = 0.; - if (Abs(Q) <= anEps) + if (std::abs(Q) <= anEps) Q = 0.; - if (Abs(Q1) <= anEps) + if (std::abs(Q1) <= anEps) Q1 = 0.; // Ademi = 1.0; @@ -360,7 +360,7 @@ void math_DirectPolynomialRoots::Solve(const Standard_Real A, const Standard_Real D) { - if (Abs(A) <= ZERO) + if (std::abs(A) <= ZERO) { Solve(B, C, D); return; @@ -389,15 +389,15 @@ void math_DirectPolynomialRoots::Solve(const Standard_Real A, P1 = Gamma; P2 = -(Beta * Beta) / 3.0; P = P1 + P2; - Ep = 5.0 * EPSILON * (Abs(P1) + Abs(P2)); - if (Abs(P) <= Ep) + Ep = 5.0 * EPSILON * (std::abs(P1) + std::abs(P2)); + if (std::abs(P) <= Ep) P = 0.0; Q1 = Del; Q2 = -Beta * Gamma / 3.0; Q3 = 2.0 * (Beta * Beta * Beta) / 27.0; Q = Q1 + Q2 + Q3; - Eq = 10.0 * EPSILON * (Abs(Q1) + Abs(Q2) + Abs(Q3)); - if (Abs(Q) <= Eq) + Eq = 10.0 * EPSILON * (std::abs(Q1) + std::abs(Q2) + std::abs(Q3)); + if (std::abs(Q) <= Eq) Q = 0.0; //-- ############################################################ Standard_Real AbsP = P; @@ -426,8 +426,8 @@ void math_DirectPolynomialRoots::Solve(const Standard_Real A, } D2 = Psi / D1; Discr = 0.0; - if (Abs(Del - D1) >= 18.0 * EPSILON * (Abs(Del) + Abs(D1)) - && Abs(Del - D2) >= 24.0 * EPSILON * (Abs(Del) + Abs(D2))) + if (std::abs(Del - D1) >= 18.0 * EPSILON * (std::abs(Del) + std::abs(D1)) + && std::abs(Del - D2) >= 24.0 * EPSILON * (std::abs(Del) + std::abs(D2))) { Discr = (Del - D1) * (Del - D2) / 4.0; } @@ -480,14 +480,14 @@ void math_DirectPolynomialRoots::Solve(const Standard_Real A, else if (Discr > 0.0) { NbSol = 1; - U = sqrt(Discr) + Abs(Q / 2.0); + U = sqrt(Discr) + std::abs(Q / 2.0); if (U >= 0.0) { U = pow(U, 1.0 / 3.0); } else { - U = -pow(Abs(U), 1.0 / 3.0); + U = -pow(std::abs(U), 1.0 / 3.0); } if (P >= 0.0) { @@ -495,11 +495,11 @@ void math_DirectPolynomialRoots::Solve(const Standard_Real A, } else { - H = U * Abs(Q) / (U * U - P / 3.0); + H = U * std::abs(Q) / (U * U - P / 3.0); } if (Beta * Q >= 0.0) { - if (Abs(H) <= RealSmall() && Abs(Q) <= RealSmall()) + if (std::abs(H) <= RealSmall() && std::abs(Q) <= RealSmall()) { TheRoots[0] = -Beta / 3.0 - U + P / (3.0 * U); } @@ -557,16 +557,16 @@ void math_DirectPolynomialRoots::Solve(const Standard_Real A, const Standard_Real C) { - if (Abs(A) <= ZERO) + if (std::abs(A) <= ZERO) { Solve(B, C); return; } - Standard_Real EpsD = 3.0 * EPSILON * (B * B + Abs(4.0 * A * C)); + Standard_Real EpsD = 3.0 * EPSILON * (B * B + std::abs(4.0 * A * C)); Standard_Real Discrim = B * B - 4.0 * A * C; - if (Abs(Discrim) <= EpsD) + if (std::abs(Discrim) <= EpsD) Discrim = 0.0; if (Discrim < 0.0) { @@ -599,9 +599,9 @@ void math_DirectPolynomialRoots::Solve(const Standard_Real A, void math_DirectPolynomialRoots::Solve(const Standard_Real A, const Standard_Real B) { - if (Abs(A) <= ZERO) + if (std::abs(A) <= ZERO) { - if (Abs(B) <= ZERO) + if (std::abs(B) <= ZERO) { InfiniteStatus = Standard_True; return; diff --git a/src/FoundationClasses/TKMath/math/math_EigenValuesSearcher.cxx b/src/FoundationClasses/TKMath/math/math_EigenValuesSearcher.cxx index c627e5a87e..d4827ed48d 100644 --- a/src/FoundationClasses/TKMath/math/math_EigenValuesSearcher.cxx +++ b/src/FoundationClasses/TKMath/math/math_EigenValuesSearcher.cxx @@ -25,7 +25,7 @@ const Standard_Integer MAX_ITERATIONS = 30; // Computes sqrt(x*x + y*y) avoiding overflow and underflow Standard_Real computeHypotenuseLength(const Standard_Real theX, const Standard_Real theY) { - return Sqrt(theX * theX + theY * theY); + return std::sqrt(theX * theX + theY * theY); } // Shifts subdiagonal elements for QL algorithm initialization @@ -47,7 +47,7 @@ Standard_Integer findSubmatrixEnd(const NCollection_Array1& theDi for (aSubmatrixEnd = theStart; aSubmatrixEnd <= theSize - 1; aSubmatrixEnd++) { const Standard_Real aDiagSum = - Abs(theDiagWork(aSubmatrixEnd)) + Abs(theDiagWork(aSubmatrixEnd + 1)); + std::abs(theDiagWork(aSubmatrixEnd)) + std::abs(theDiagWork(aSubmatrixEnd + 1)); // Deflation test: Check if subdiagonal element is negligible // The condition |e[i]| + (|d[i]| + |d[i+1]|) == |d[i]| + |d[i+1]| @@ -56,7 +56,7 @@ Standard_Integer findSubmatrixEnd(const NCollection_Array1& theDi // checking e[i] == 0.0 because it accounts for finite precision arithmetic. // When this condition is true in floating-point arithmetic, the subdiagonal // element can be treated as zero for convergence purposes. - if (Abs(theSubdiagWork(aSubmatrixEnd)) + aDiagSum == aDiagSum) + if (std::abs(theSubdiagWork(aSubmatrixEnd)) + aDiagSum == aDiagSum) break; } return aSubmatrixEnd; diff --git a/src/FoundationClasses/TKMath/math/math_FunctionAllRoots.cxx b/src/FoundationClasses/TKMath/math/math_FunctionAllRoots.cxx index 006451747c..3ed1988352 100644 --- a/src/FoundationClasses/TKMath/math/math_FunctionAllRoots.cxx +++ b/src/FoundationClasses/TKMath/math/math_FunctionAllRoots.cxx @@ -43,7 +43,7 @@ math_FunctionAllRoots::math_FunctionAllRoots(math_FunctionWithDerivative& F, Nbp = S.NbPoints(); F.Value(S.GetParameter(1), val); - PNul = Abs(val) <= EpsNul; + PNul = std::abs(val) <= EpsNul; if (!PNul) { valsav = val; @@ -59,7 +59,7 @@ math_FunctionAllRoots::math_FunctionAllRoots(math_FunctionWithDerivative& F, { F.Value(S.GetParameter(i), val); - Nul = Abs(val) <= EpsNul; + Nul = std::abs(val) <= EpsNul; if (!Nul) { valsav = val; @@ -183,10 +183,11 @@ math_FunctionAllRoots::math_FunctionAllRoots(math_FunctionWithDerivative& F, { // Recherche des solutions entre S.GetParameter(1) // et le debut du 1er intervalle nul - Nbrpt = (Standard_Integer)IntegerPart( - Abs((pdeb.Value(1) - S.GetParameter(1)) / (S.GetParameter(Nbp) - S.GetParameter(1))) * Nbp); + Nbrpt = (Standard_Integer)std::trunc( + std::abs((pdeb.Value(1) - S.GetParameter(1)) / (S.GetParameter(Nbp) - S.GetParameter(1))) + * Nbp); math_FunctionRoots - Res(F, S.GetParameter(1), pdeb.Value(1), Max(Nbrpt, NbpMin), EpsX, EpsF, 0.0); + Res(F, S.GetParameter(1), pdeb.Value(1), std::max(Nbrpt, NbpMin), EpsX, EpsF, 0.0); Standard_NumericError_Raise_if((!Res.IsDone()) || (Res.IsAllNull()), " "); for (Standard_Integer j = 1; j <= Res.NbSolutions(); j++) @@ -197,10 +198,11 @@ math_FunctionAllRoots::math_FunctionAllRoots(math_FunctionWithDerivative& F, } for (Standard_Integer k = 2; k <= pdeb.Length(); k++) { - Nbrpt = (Standard_Integer)IntegerPart( - Abs((pdeb.Value(k) - pfin.Value(k - 1)) / (S.GetParameter(Nbp) - S.GetParameter(1))) * Nbp); + Nbrpt = (Standard_Integer)std::trunc( + std::abs((pdeb.Value(k) - pfin.Value(k - 1)) / (S.GetParameter(Nbp) - S.GetParameter(1))) + * Nbp); math_FunctionRoots - Res(F, pfin.Value(k - 1), pdeb.Value(k), Max(Nbrpt, NbpMin), EpsX, EpsF, 0.0); + Res(F, pfin.Value(k - 1), pdeb.Value(k), std::max(Nbrpt, NbpMin), EpsX, EpsF, 0.0); Standard_NumericError_Raise_if((!Res.IsDone()) || (Res.IsAllNull()), " "); for (Standard_Integer j = 1; j <= Res.NbSolutions(); j++) @@ -213,11 +215,17 @@ math_FunctionAllRoots::math_FunctionAllRoots(math_FunctionWithDerivative& F, { // Recherche des solutions entre la fin du // dernier intervalle nul et Value(Nbp). - Nbrpt = (Standard_Integer)IntegerPart(Abs((S.GetParameter(Nbp) - pfin.Value(pdeb.Length())) - / (S.GetParameter(Nbp) - S.GetParameter(1))) - * Nbp); - math_FunctionRoots - Res(F, pfin.Value(pdeb.Length()), S.GetParameter(Nbp), Max(Nbrpt, NbpMin), EpsX, EpsF, 0.0); + Nbrpt = + (Standard_Integer)std::trunc(std::abs((S.GetParameter(Nbp) - pfin.Value(pdeb.Length())) + / (S.GetParameter(Nbp) - S.GetParameter(1))) + * Nbp); + math_FunctionRoots Res(F, + pfin.Value(pdeb.Length()), + S.GetParameter(Nbp), + std::max(Nbrpt, NbpMin), + EpsX, + EpsF, + 0.0); Standard_NumericError_Raise_if((!Res.IsDone()) || (Res.IsAllNull()), " "); for (Standard_Integer j = 1; j <= Res.NbSolutions(); j++) diff --git a/src/FoundationClasses/TKMath/math/math_FunctionRoots.cxx b/src/FoundationClasses/TKMath/math/math_FunctionRoots.cxx index 7b3684b203..2cc0c640e2 100644 --- a/src/FoundationClasses/TKMath/math/math_FunctionRoots.cxx +++ b/src/FoundationClasses/TKMath/math/math_FunctionRoots.cxx @@ -88,7 +88,7 @@ static void AppendRoot(TColStd_SequenceOfReal& Sol, pl = i; i = n; } - if (Abs(X - t) <= dX) + if (std::abs(X - t) <= dX) { pl = 0; i = n; @@ -145,7 +145,7 @@ static void Solve(math_FunctionWithDerivative& F, fc = fa; e = d = b - a; } - if (Abs(fc) < Abs(fb)) + if (std::abs(fc) < std::abs(fb)) { a = b; b = c; @@ -154,9 +154,9 @@ static void Solve(math_FunctionWithDerivative& F, fb = fc; fc = fa; } - tol1 = EPSEPS * Abs(b) + tols2; + tol1 = EPSEPS * std::abs(b) + tols2; xm = 0.5 * (c - b); - if (Abs(xm) < tol1 || fb == 0) + if (std::abs(xm) < tol1 || fb == 0) { //-- On tente une iteration de newton Standard_Real Xp, Yp, Dp; @@ -177,7 +177,7 @@ static void Solve(math_FunctionWithDerivative& F, { F.Value(Xp, Yp); Yp -= K; - if (Abs(Yp) < Abs(fb)) + if (std::abs(Yp) < std::abs(fb)) { b = Xp; fb = Yp; @@ -190,7 +190,7 @@ static void Solve(math_FunctionWithDerivative& F, AppendRoot(Sol, NbStateSol, b, F, K, dX); return; } - if (Abs(e) >= tol1 && Abs(fa) > Abs(fb)) + if (std::abs(e) >= tol1 && std::abs(fa) > std::abs(fb)) { s = fb / fa; if (a == c) @@ -210,9 +210,9 @@ static void Solve(math_FunctionWithDerivative& F, { q = -q; } - p = Abs(p); - min1 = 3.0 * xm * q - Abs(tol1 * q); - min2 = Abs(e * q); + p = std::abs(p); + min1 = 3.0 * xm * q - std::abs(tol1 * q); + min2 = std::abs(e * q); if ((p + p) < ((min1 < min2) ? min1 : min2)) { e = d; @@ -231,16 +231,16 @@ static void Solve(math_FunctionWithDerivative& F, } a = b; fa = fb; - if (Abs(d) > tol1) + if (std::abs(d) > tol1) { b += d; } else { if (xm >= 0) - b += Abs(tol1); + b += std::abs(tol1); else - b += -Abs(tol1); + b += -std::abs(tol1); } F.Value(b, fb); fb -= K; @@ -299,7 +299,7 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, } //-- On teste si EpsX est trop petit (ie : U+Nn*EpsX == U ) Standard_Real EpsX = _EpsX; - Standard_Real DeltaU = Abs(X0) + Abs(XN); + Standard_Real DeltaU = std::abs(X0) + std::abs(XN); Standard_Real NEpsX = 0.0000000001 * DeltaU; if (EpsX < NEpsX) { @@ -550,7 +550,7 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, { aSolX1 = aBR.Root(); F.Value(aSolX1, aVal1); - aVal1 = Abs(aVal1); + aVal1 = std::abs(aVal1); if (aVal1 < EpsF) { isSol1 = Standard_True; @@ -572,7 +572,7 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, f3 = ptrval(ip1); Standard_Boolean recherche_minimum = (f0 > 0.0); - if (Abs(x3 - xm) > Abs(x0 - xm)) + if (std::abs(x3 - xm) > std::abs(x0 - xm)) { x1 = xm; x2 = xm + C * (x3 - xm); @@ -589,7 +589,8 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, f2 -= K; //-- printf("\n *************** RECHERCHE MINIMUM **********\n"); Standard_Real tolX = 0.001 * NEpsX; - while (Abs(x3 - x0) > tolCR * (Abs(x1) + Abs(x2)) && (Abs(x1 - x2) > tolX)) + while (std::abs(x3 - x0) > tolCR * (std::abs(x1) + std::abs(x2)) + && (std::abs(x1 - x2) > tolX)) { //-- printf("\n (%10.5g,%10.5g) (%10.5g,%10.5g) (%10.5g,%10.5g) (%10.5g,%10.5g) ", //-- x0,f0,x1,f1,x2,f2,x3,f3); @@ -655,21 +656,21 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, if ((recherche_minimum && f1 < f2) || (!recherche_minimum && f1 > f2)) { //-- x1,f(x1) minimum - if (Abs(f1) < EpsF) + if (std::abs(f1) < EpsF) { isSol2 = Standard_True; aSolX2 = x1; - aVal2 = Abs(f1); + aVal2 = std::abs(f1); } } else { //-- x2.f(x2) minimum - if (Abs(f2) < EpsF) + if (std::abs(f2) < EpsF) { isSol2 = Standard_True; aSolX2 = x2; - aVal2 = Abs(f2); + aVal2 = std::abs(f2); } } // Choose the best solution between aSolX1, aSolX2 @@ -681,9 +682,9 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, AppendRoot(Sol, NbStateSol, aSolX2, F, K, NEpsX); else { - aDer1 = Abs(aDer1); + aDer1 = std::abs(aDer1); F.Derivative(aSolX2, aDer2); - aDer2 = Abs(aDer2); + aDer2 = std::abs(aDer2); if (aDer1 < aDer2) AppendRoot(Sol, NbStateSol, aSolX1, F, K, NEpsX); else @@ -769,7 +770,7 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, StdFail_NotDone_Raise_if(Increment < EpsX, " "); Done = Standard_True; //-- On teste si EpsX est trop petit (ie : U+Nn*EpsX == U ) - Standard_Real DeltaU = Abs(Upp) + Abs(Lowr); + Standard_Real DeltaU = std::abs(Upp) + std::abs(Lowr); Standard_Real NEpsX = 0.0000000001 * DeltaU; if (EpsX < NEpsX) { @@ -894,7 +895,7 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, { Finish = Standard_True; - FFi = Min(FFxu, FFyu); // pour ne pas recalculer yu + FFi = std::min(FFxu, FFyu); // pour ne pas recalculer yu } else if ((DFFxu <= Standard_Underflow && -DFFxu <= Standard_Underflow) || (FFxu <= Standard_Underflow && -FFxu <= Standard_Underflow)) @@ -938,7 +939,7 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, BB = -2 * (Ambda * (DFFyu + 2. * DFFxu) + 3. * (FFxu - FFyu)); CC = Ambda * DFFxu; - if (Abs(AA) < 1e-14 && Abs(BB) < 1e-14 && Abs(CC) < 1e-14) + if (std::abs(AA) < 1e-14 && std::abs(BB) < 1e-14 && std::abs(CC) < 1e-14) { AA = BB = CC = 0; } @@ -1094,7 +1095,7 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, DFxu = BB; FFxu = FFi; DFFxu = CC; - FFi = Min(FFxu, FFyu); + FFi = std::min(FFxu, FFyu); T = Alfa1 * 0.5; Ambda = Alfa1 * 0.5; U = Xu; @@ -1161,7 +1162,7 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, DFyu = BB; Ambda = (Ambda - Alfa1) * 0.5; T = 0.; - FFi = Min(FFxu, FFyu); + FFi = std::min(FFxu, FFyu); U = Xu; } else @@ -1177,21 +1178,21 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, } } // tests d arrets - if (Abs(FFxu) <= Standard_Underflow - || (Abs(DFFxu) <= Standard_Underflow && Fxu * Fyu > 0.)) + if (std::abs(FFxu) <= Standard_Underflow + || (std::abs(DFFxu) <= Standard_Underflow && Fxu * Fyu > 0.)) { Finish = Standard_True; - if (Abs(FFxu) <= Standard_Underflow) + if (std::abs(FFxu) <= Standard_Underflow) { FFxu = 0.0; } FFi = FFyu; } - else if (Abs(FFyu) <= Standard_Underflow - || (Abs(DFFyu) <= Standard_Underflow && Fxu * Fyu > 0.)) + else if (std::abs(FFyu) <= Standard_Underflow + || (std::abs(DFFyu) <= Standard_Underflow && Fxu * Fyu > 0.)) { Finish = Standard_True; - if (Abs(FFyu) <= Standard_Underflow) + if (std::abs(FFyu) <= Standard_Underflow) { FFyu = 0.0; } @@ -1219,17 +1220,17 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, if (U >= (Lowr - EpsX) && U <= (Upp + EpsX)) { - U = Max(Lowr, Min(U, Upp)); + U = std::max(Lowr, std::min(U, Upp)); Ok = F.Value(U, FFi); FFi = FFi - K; - if (Abs(FFi) < EpsF) + if (std::abs(FFi) < EpsF) { // coherence - if (Abs(Fxu) <= Standard_Underflow) + if (std::abs(Fxu) <= Standard_Underflow) { AA = DFxu; } - else if (Abs(Fyu) <= Standard_Underflow) + else if (std::abs(Fyu) <= Standard_Underflow) { AA = DFyu; } @@ -1243,7 +1244,8 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, } if (!Sol.IsEmpty()) { - if (Abs(Sol.Last() - U) > 5. * EpsX || (OldDF != RealLast() && OldDF * AA < 0.)) + if (std::abs(Sol.Last() - U) > 5. * EpsX + || (OldDF != RealLast() && OldDF * AA < 0.)) { Sol.Append(U); NbStateSol.Append(F.GetStateNumber()); @@ -1327,7 +1329,7 @@ math_FunctionRoots::math_FunctionRoots(math_FunctionWithDerivative& F, for (Standard_Integer i = 1; i <= n; i++) { Standard_Real t = Sol(i) - StaticSol(i); - if (Abs(t) > NEpsX) + if (std::abs(t) > NEpsX) { printf("\n mathFunctionRoots : i:%d/%d delta: %g", i, n, t); } diff --git a/src/FoundationClasses/TKMath/math/math_FunctionSetRoot.cxx b/src/FoundationClasses/TKMath/math/math_FunctionSetRoot.cxx index 848b15c4c6..6a09c05ce9 100644 --- a/src/FoundationClasses/TKMath/math/math_FunctionSetRoot.cxx +++ b/src/FoundationClasses/TKMath/math/math_FunctionSetRoot.cxx @@ -164,9 +164,6 @@ Standard_Boolean MyDirFunction::Value(const math_Vector& Sol, if (aVal < 0.) { if (aVal <= -1.e+100) // Precision::HalfInfinite() later - // if(Precision::IsInfinite(Abs(FF.Value(i)))) { - // F2 = Precision::Infinite(); - // Gnr1 = Precision::Infinite(); return Standard_False; } else if (aVal >= 1.e+100) // Precision::HalfInfinite() later @@ -207,9 +204,9 @@ static Standard_Boolean MinimizeDirection(const math_Vector& P0, for (Standard_Integer ii = 1; ii <= Tol.Length(); ii++) { - invnorme = Abs(Delta(ii)); + invnorme = std::abs(Delta(ii)); if (invnorme > Eps) - tol1d = Min(tol1d, Tol(ii) / invnorme); + tol1d = std::min(tol1d, Tol(ii) / invnorme); } if (tol1d > 1.9) return Standard_False; // Pas la peine de se fatiguer @@ -274,9 +271,9 @@ static Standard_Boolean MinimizeDirection(const math_Vector& P, for (Standard_Integer ii = 1; ii <= Tol.Length(); ii++) { - absdir = Abs(Dir(ii)); + absdir = std::abs(Dir(ii)); if (absdir > Eps) - tol1d = Min(tol1d, Tol(ii) / absdir); + tol1d = std::min(tol1d, Tol(ii) / absdir); } if (tol1d > 0.9) return Standard_False; @@ -298,9 +295,9 @@ static Standard_Boolean MinimizeDirection(const math_Vector& P, bx = df1; ax = PDirValue - (bx + cx); - if (Abs(ax) <= Eps) + if (std::abs(ax) <= Eps) { // cas lineaire - if ((Abs(bx) >= Eps)) + if (std::abs(bx) >= Eps) tsol = -cx / bx; else tsol = 0; @@ -311,10 +308,10 @@ static Standard_Boolean MinimizeDirection(const math_Vector& P, if (Delta > 1.e-9) { // il y a des racines, on prend la plus proche de 0 - Delta = Sqrt(Delta); + Delta = std::sqrt(Delta); tsol = -(bx + Delta); tsolbis = (Delta - bx); - if (Abs(tsolbis) < Abs(tsol)) + if (std::abs(tsolbis) < std::abs(tsol)) tsol = tsolbis; tsol /= 2 * ax; } @@ -326,7 +323,7 @@ static Standard_Boolean MinimizeDirection(const math_Vector& P, } } - if (Abs(tsol) >= 1) + if (std::abs(tsol) >= 1) return Standard_False; // resultat sans interet F.Initialize(P, Dir); @@ -465,11 +462,11 @@ static void SearchDirection(const math_Matrix& DF, // PMN 12/05/97 Traitement des singularite dans les conges // Sur des surfaces periodiques - Standard_Real ratio = Abs(Direction(Direction.Lower()) * InvLengthMax(Direction.Lower())); + Standard_Real ratio = std::abs(Direction(Direction.Lower()) * InvLengthMax(Direction.Lower())); Standard_Integer i; for (i = Direction.Lower() + 1; i <= Direction.Upper(); i++) { - ratio = Max(ratio, Abs(Direction(i) * InvLengthMax(i))); + ratio = std::max(ratio, std::abs(Direction(i) * InvLengthMax(i))); } if (ratio > 1) { @@ -615,7 +612,7 @@ Standard_Boolean Bounds(const math_Vector& InfBound, Out = Standard_True; // Delta(i) is negative if (-Delta(i) > Tol(i)) // Afin d'eviter des ratio nulles pour rien - monratio = Min(monratio, (InfBound(i) - SolSave(i)) / Delta(i)); + monratio = std::min(monratio, (InfBound(i) - SolSave(i)) / Delta(i)); } else if (Sol(i) > SupBound(i)) { @@ -623,7 +620,7 @@ Standard_Boolean Bounds(const math_Vector& InfBound, Out = Standard_True; // Delta(i) is positive if (Delta(i) > Tol(i)) - monratio = Min(monratio, (SupBound(i) - SolSave(i)) / Delta(i)); + monratio = std::min(monratio, (SupBound(i) - SolSave(i)) / Delta(i)); } } @@ -770,9 +767,9 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F, math_IntegerVector aConstraints(1, Ninc); // Pour savoir sur quels bord on se trouve for (i = 1; i <= Ninc; i++) { - const Standard_Real aSupBound = Min(theSupBound(i), Precision::Infinite()); - const Standard_Real anInfBound = Max(theInfBound(i), -Precision::Infinite()); - InvLengthMax(i) = 1. / Max((aSupBound - anInfBound) / 4, 1.e-9); + const Standard_Real aSupBound = std::min(theSupBound(i), Precision::Infinite()); + const Standard_Real anInfBound = std::max(theInfBound(i), -Precision::Infinite()); + InvLengthMax(i) = 1. / std::max((aSupBound - anInfBound) / 4, 1.e-9); } MyDirFunction F_Dir(Temp1, Temp2, Temp3, Temp4, F); @@ -817,7 +814,7 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F, // Le rang 0 de Save ne doit servir q'au test accelarteur en fin de boucle // s'il on est dejas sur la solution, il faut leurer ce test pour eviter // de faire une seconde iteration... - Save(0) = Max(F2, EpsSqrt); + Save(0) = std::max(F2, EpsSqrt); Standard_Real aTol_Func = Epsilon(F2); FSR_DEBUG("=== Mode Debug de Function Set Root" << std::endl); FSR_DEBUG(" F2 Initial = " << F2); @@ -841,7 +838,7 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F, SolSave = Sol; SearchDirection(DF, GH, FF, ChangeDirection, InvLengthMax, DH, Dy); - if (Abs(Dy) <= Eps) + if (std::abs(Dy) <= Eps) { Done = Standard_False; if (!theStopOnDivergent || !myIsDivergent) @@ -856,7 +853,7 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F, } if (ChangeDirection) { - Ambda = Ambda2 / Sqrt(Abs(Dy)); + Ambda = Ambda2 / std::sqrt(std::abs(Dy)); if (Ambda > 1.0) Ambda = 1.0; } @@ -1022,7 +1019,7 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F, } } Dy = GH * DH; - if (Abs(Dy) <= Eps) + if (std::abs(Dy) <= Eps) { if (F2 > OldF) Sol = SolSave; @@ -1065,9 +1062,7 @@ void math_FunctionSetRoot::Perform(math_FunctionSetWithDerivatives& F, { // Pour eviter des calculs inutiles et des /0... if (ChangeDirection) { - - // Ambda = Ambda2 / Sqrt(Abs(Dy)); - Ambda = Ambda2 / Sqrt(-Dy); + Ambda = Ambda2 / std::sqrt(-Dy); if (Ambda > 1.0) Ambda = 1.0; } diff --git a/src/FoundationClasses/TKMath/math/math_FunctionSetRoot.hxx b/src/FoundationClasses/TKMath/math/math_FunctionSetRoot.hxx index a2a027143f..51f991f9de 100644 --- a/src/FoundationClasses/TKMath/math/math_FunctionSetRoot.hxx +++ b/src/FoundationClasses/TKMath/math/math_FunctionSetRoot.hxx @@ -70,7 +70,7 @@ public: { for (Standard_Integer i = 1; i <= Sol.Length(); ++i) { - if (Abs(Delta(i)) > Tol(i)) + if (std::abs(Delta(i)) > Tol(i)) { return Standard_False; } diff --git a/src/FoundationClasses/TKMath/math/math_GaussSingleIntegration.cxx b/src/FoundationClasses/TKMath/math/math_GaussSingleIntegration.cxx index eb9840b594..e5be9d4c23 100644 --- a/src/FoundationClasses/TKMath/math/math_GaussSingleIntegration.cxx +++ b/src/FoundationClasses/TKMath/math/math_GaussSingleIntegration.cxx @@ -59,7 +59,7 @@ math_GaussSingleIntegration::math_GaussSingleIntegration(math_Function& const Standard_Real Upper, const Standard_Integer Order) { - Standard_Integer theOrder = Min(math::GaussPointsMax(), Order); + Standard_Integer theOrder = std::min(math::GaussPointsMax(), Order); Perform(F, Lower, Upper, theOrder); } @@ -69,7 +69,7 @@ math_GaussSingleIntegration::math_GaussSingleIntegration(math_Function& const Standard_Integer Order, const Standard_Real Tol) { - Standard_Integer theOrder = Min(math::GaussPointsMax(), Order); + Standard_Integer theOrder = std::min(math::GaussPointsMax(), Order); const Standard_Integer IterMax = 13; // Max number of iteration Standard_Integer NIter = 1; // current number of iteration diff --git a/src/FoundationClasses/TKMath/math/math_GlobOptMin.cxx b/src/FoundationClasses/TKMath/math/math_GlobOptMin.cxx index f317d16016..bd86916978 100644 --- a/src/FoundationClasses/TKMath/math/math_GlobOptMin.cxx +++ b/src/FoundationClasses/TKMath/math/math_GlobOptMin.cxx @@ -37,10 +37,10 @@ static Standard_Real DistanceToBorder(const math_Vector& theX, for (Standard_Integer anIdx = theMin.Lower(); anIdx <= theMin.Upper(); ++anIdx) { - const Standard_Real aDist1 = Abs(theX(anIdx) - theMin(anIdx)); - const Standard_Real aDist2 = Abs(theX(anIdx) - theMax(anIdx)); + const Standard_Real aDist1 = std::abs(theX(anIdx) - theMin(anIdx)); + const Standard_Real aDist2 = std::abs(theX(anIdx) - theMax(anIdx)); - aDist = Min(aDist, Min(aDist1, aDist2)); + aDist = std::min(aDist, std::min(aDist1, aDist2)); } return aDist; @@ -97,8 +97,8 @@ math_GlobOptMin::math_GlobOptMin(math_MultipleVarFunction* theFunc, mySameTol = theSameTol; const Standard_Integer aMaxSquareSearchSol = 200; - Standard_Integer aSolNb = Standard_Integer(Pow(3.0, Standard_Real(myN))); - myMinCellFilterSol = Max(2 * aSolNb, aMaxSquareSearchSol); + Standard_Integer aSolNb = Standard_Integer(std::pow(3.0, Standard_Real(myN))); + myMinCellFilterSol = std::max(2 * aSolNb, aMaxSquareSearchSol); initCellSize(); ComputeInitSol(); @@ -356,22 +356,22 @@ void math_GlobOptMin::computeInitialValues() // Walk over diagonal. myFunc->Value(aCurrPnt, aCurrVal); - aLipConst = Max(Abs(aCurrVal - aPrevValDiag), aLipConst); + aLipConst = std::max(std::abs(aCurrVal - aPrevValDiag), aLipConst); aPrevValDiag = aCurrVal; // Walk over diag in projected space aPnt(1) = myA(1) = const. aCurrPnt(1) = myA(1); myFunc->Value(aCurrPnt, aCurrVal); - aLipConst = Max(Abs(aCurrVal - aPrevValProj), aLipConst); + aLipConst = std::max(std::abs(aCurrVal - aPrevValProj), aLipConst); aPrevValProj = aCurrVal; } myC = myInitC; - aLipConst *= Sqrt(myN) / aStep; + aLipConst *= std::sqrt(myN) / aStep; if (aLipConst < myC * aMinEps) - myC = Max(aLipConst * aMinEps, aMinLC); + myC = std::max(aLipConst * aMinEps, aMinLC); else if (aLipConst > myC * aMaxEps) - myC = Min(myC * aMaxEps, aMaxLC); + myC = std::min(myC * aMaxEps, aMaxLC); } //================================================================================================= @@ -407,7 +407,7 @@ void math_GlobOptMin::computeGlobalExtremum(Standard_Integer j) // clang-format off r2 = ((d + aPrevVal - myC * myLastStep) * 0.5 - myF) * myZ; // Shubert / Piyavsky estimation. // clang-format on - r = Min(r1, r2); + r = std::min(r1, r2); if (r > myE3) { Standard_Real aSaveParam = myX(1); @@ -438,7 +438,7 @@ void math_GlobOptMin::computeGlobalExtremum(Standard_Integer j) if (CheckFunctionalStopCriteria()) return; // Best possible value is obtained. - myV(1) = Min(myE2 + Abs(myF - d) / myC, myMaxV(1)); + myV(1) = std::min(myE2 + std::abs(myF - d) / myC, myMaxV(1)); myLastStep = myV(1); } else @@ -452,7 +452,7 @@ void math_GlobOptMin::computeGlobalExtremum(Standard_Integer j) } if (j < myN) { - Standard_Real aUpperDimStep = Max(myV(j), myE2); + Standard_Real aUpperDimStep = std::max(myV(j), myE2); if (myV(j + 1) > aUpperDimStep) { if (aUpperDimStep > myMaxV(j + 1)) // Case of too big step. @@ -496,7 +496,7 @@ Standard_Boolean math_GlobOptMin::isStored(const math_Vector& thePnt) isSame = Standard_True; for (j = 1; j <= myN; j++) { - if ((Abs(thePnt(j) - myY(i * myN + j))) > aTol(j)) + if ((std::abs(thePnt(j) - myY(i * myN + j))) > aTol(j)) { isSame = Standard_False; break; @@ -567,7 +567,7 @@ void math_GlobOptMin::initCellSize() Standard_Boolean math_GlobOptMin::CheckFunctionalStopCriteria() { // Search single solution and current solution in its neighborhood. - if (myIsFindSingleSolution && Abs(myF - myFunctionalMinimalValue) < mySameTol * 0.01) + if (myIsFindSingleSolution && std::abs(myF - myFunctionalMinimalValue) < mySameTol * 0.01) return Standard_True; return Standard_False; @@ -601,8 +601,8 @@ void math_GlobOptMin::ComputeInitSol() void math_GlobOptMin::checkAddCandidate(const math_Vector& thePnt, const Standard_Real theValue) { - if (Abs(theValue - myF) < mySameTol * 0.01 && // Value in point is close to optimal value. - !myIsFindSingleSolution) // Several optimal solutions are allowed. + if (std::abs(theValue - myF) < mySameTol * 0.01 && // Value in point is close to optimal value. + !myIsFindSingleSolution) // Several optimal solutions are allowed. { if (!isStored(thePnt)) { diff --git a/src/FoundationClasses/TKMath/math/math_Householder.cxx b/src/FoundationClasses/TKMath/math/math_Householder.cxx index 74a9b1e2a5..c795e38e52 100644 --- a/src/FoundationClasses/TKMath/math/math_Householder.cxx +++ b/src/FoundationClasses/TKMath/math/math_Householder.cxx @@ -123,7 +123,7 @@ void math_Householder::Perform(const math_Matrix& A, const math_Matrix& B, const h += qki * qki; // = ||a||*||a|| = EUAI } f = Q(i, i); // = a1 = AII - g = f < 1.e-15 ? Sqrt(h) : -Sqrt(h); + g = f < 1.e-15 ? std::sqrt(h) : -std::sqrt(h); if (fabs(g) <= EPS) { Done = Standard_False; diff --git a/src/FoundationClasses/TKMath/math/math_KronrodSingleIntegration.cxx b/src/FoundationClasses/TKMath/math/math_KronrodSingleIntegration.cxx index 6ae2231e6b..0bc48b3c01 100644 --- a/src/FoundationClasses/TKMath/math/math_KronrodSingleIntegration.cxx +++ b/src/FoundationClasses/TKMath/math/math_KronrodSingleIntegration.cxx @@ -128,7 +128,7 @@ void math_KronrodSingleIntegration::Perform(math_Function& theFunction, if (!myIsDone) return; - // Standard_Real anAbsVal = Abs(myValue); + // Standard_Real anAbsVal = std::abs(myValue); myAbsolutError = myErrorReached; @@ -186,7 +186,7 @@ void math_KronrodSingleIntegration::Perform(math_Function& theFunction, if (!myIsDone) return; - Standard_Real anAbsVal = Abs(myValue); + Standard_Real anAbsVal = std::abs(myValue); myAbsolutError = myErrorReached; if (anAbsVal > aMinVol) @@ -249,16 +249,16 @@ void math_KronrodSingleIntegration::Perform(math_Function& theFunction, Standard_Real deltav = v1 + v2 - aValues(nint); myValue += deltav; - if (Abs(deltav) <= Epsilon(Abs(myValue))) + if (std::abs(deltav) <= Epsilon(std::abs(myValue))) ++count; Standard_Real deltae = e1 + e2 - anErrors(nint); myAbsolutError += deltae; - if (myAbsolutError <= Epsilon(Abs(myValue))) + if (myAbsolutError <= Epsilon(std::abs(myValue))) ++count; - if (Abs(myValue) > aMinVol) - myErrorReached = myAbsolutError / Abs(myValue); + if (std::abs(myValue) > aMinVol) + myErrorReached = myAbsolutError / std::abs(myValue); else myErrorReached = myAbsolutError; @@ -356,10 +356,10 @@ Standard_Boolean math_KronrodSingleIntegration::GKRule(math_Function& theFu Standard_Real mean = 0.5 * theValue; - Standard_Real asc = Abs(fc - mean) * theKronrodW.Value(aNPnt2); + Standard_Real asc = std::abs(fc - mean) * theKronrodW.Value(aNPnt2); for (i = 1; i < aNPnt2; ++i) { - asc += theKronrodW.Value(i) * (Abs(f1(i) - mean) + Abs(f2(i) - mean)); + asc += theKronrodW.Value(i) * (std::abs(f1(i) - mean) + std::abs(f2(i) - mean)); } asc *= aXr; @@ -368,13 +368,13 @@ Standard_Boolean math_KronrodSingleIntegration::GKRule(math_Function& theFu // Compute the error and the new number of Kronrod points. - theError = Abs(theValue - aGaussVal); + theError = std::abs(theValue - aGaussVal); Standard_Real scale = 1.; if (asc != 0. && theError != 0.) - scale = Pow((200. * theError / asc), 1.5); + scale = std::pow((200. * theError / asc), 1.5); if (scale < 1.) - theError = Min(theError, asc * scale); + theError = std::min(theError, asc * scale); // theFunction.GetStateNumber(); diff --git a/src/FoundationClasses/TKMath/math/math_KronrodSingleIntegration.hxx b/src/FoundationClasses/TKMath/math/math_KronrodSingleIntegration.hxx index eeb37862ee..7dac65f736 100644 --- a/src/FoundationClasses/TKMath/math/math_KronrodSingleIntegration.hxx +++ b/src/FoundationClasses/TKMath/math/math_KronrodSingleIntegration.hxx @@ -68,7 +68,7 @@ public: //! theNbPnts should be odd and greater then or equal to 3. //! Note that theTolerance is relative, i.e. the criterion of //! solution reaching is: - //! Abs(Kronrod - Gauss)/Abs(Kronrod) < theTolerance. + //! std::abs(Kronrod - Gauss)/std::abs(Kronrod) < theTolerance. //! theTolerance should be positive. Standard_EXPORT void Perform(math_Function& theFunction, const Standard_Real theLower, diff --git a/src/FoundationClasses/TKMath/math/math_Matrix.lxx b/src/FoundationClasses/TKMath/math/math_Matrix.lxx index 8d2539a13f..68e1638259 100644 --- a/src/FoundationClasses/TKMath/math/math_Matrix.lxx +++ b/src/FoundationClasses/TKMath/math/math_Matrix.lxx @@ -227,7 +227,7 @@ inline math_Matrix math_Matrix::TMultiplied(const Standard_Real Right) const noe inline void math_Matrix::Divide(const Standard_Real Right) { - Standard_DivideByZero_Raise_if(Abs(Right) <= RealEpsilon(), + Standard_DivideByZero_Raise_if(std::abs(Right) <= RealEpsilon(), "math_Matrix::Divide() - zero divisor"); const Standard_Integer aLowerRow = Array.LowerRow(); @@ -248,7 +248,7 @@ inline void math_Matrix::Divide(const Standard_Real Right) inline math_Matrix math_Matrix::Divided(const Standard_Real Right) const { - Standard_DivideByZero_Raise_if(Abs(Right) <= RealEpsilon(), + Standard_DivideByZero_Raise_if(std::abs(Right) <= RealEpsilon(), "math_Matrix::Divided() - zero divisor"); math_Matrix temp = Multiplied(1. / Right); return temp; diff --git a/src/FoundationClasses/TKMath/math/math_NewtonFunctionRoot.cxx b/src/FoundationClasses/TKMath/math/math_NewtonFunctionRoot.cxx index bf124d70d0..9c32aa0f77 100644 --- a/src/FoundationClasses/TKMath/math/math_NewtonFunctionRoot.cxx +++ b/src/FoundationClasses/TKMath/math/math_NewtonFunctionRoot.cxx @@ -104,7 +104,7 @@ void math_NewtonFunctionRoot::Perform(math_FunctionWithDerivative& F, const Stan Fx = RealLast(); X = Guess; It = 1; - while ((It <= Itermax) && ((Abs(Dx) > EpsilonX) || (Abs(Fx) > EpsilonF))) + while ((It <= Itermax) && ((std::abs(Dx) > EpsilonX) || (std::abs(Fx) > EpsilonF))) { Ok = F.Values(X, Fx, DFx); diff --git a/src/FoundationClasses/TKMath/math/math_NewtonFunctionSetRoot.lxx b/src/FoundationClasses/TKMath/math/math_NewtonFunctionSetRoot.lxx index d99a50637f..1a97fe0b46 100644 --- a/src/FoundationClasses/TKMath/math/math_NewtonFunctionSetRoot.lxx +++ b/src/FoundationClasses/TKMath/math/math_NewtonFunctionSetRoot.lxx @@ -18,7 +18,7 @@ inline Standard_Boolean math_NewtonFunctionSetRoot::IsSolutionReached( math_FunctionSetWithDerivatives&) { for (Standard_Integer i = DeltaX.Lower(); i <= DeltaX.Upper(); ++i) - if (Abs(DeltaX(i)) > TolX(i) || Abs(FValues(i)) > TolF) + if (std::abs(DeltaX(i)) > TolX(i) || std::abs(FValues(i)) > TolF) return Standard_False; return Standard_True; diff --git a/src/FoundationClasses/TKMath/math/math_NewtonMinimum.cxx b/src/FoundationClasses/TKMath/math/math_NewtonMinimum.cxx index e14b2b02cc..8030af99c7 100644 --- a/src/FoundationClasses/TKMath/math/math_NewtonMinimum.cxx +++ b/src/FoundationClasses/TKMath/math/math_NewtonMinimum.cxx @@ -124,10 +124,10 @@ void math_NewtonMinimum::Perform(math_MultipleVarFunctionWithHessian& F, if (MinEigenValue < CTol) { Convex = Standard_False; - if (NoConvexTreatement && // Treatment is allowed. - Abs(MinEigenValue) > CTol) // Treatment will have effect. + if (NoConvexTreatement && // Treatment is allowed. + std::abs(MinEigenValue) > CTol) // Treatment will have effect. { - Standard_Real Delta = CTol + 0.1 * Abs(MinEigenValue) - MinEigenValue; + Standard_Real Delta = CTol + 0.1 * std::abs(MinEigenValue) - MinEigenValue; for (ii = 1; ii <= TheGradient.Length(); ii++) TheHessian(ii, ii) += Delta; } @@ -158,20 +158,20 @@ void math_NewtonMinimum::Perform(math_MultipleVarFunctionWithHessian& F, Standard_Real aMult = RealLast(); for (Standard_Integer anIdx = 1; anIdx <= myLeft.Upper(); anIdx++) { - const Standard_Real anAbsStep = Abs(TheStep(anIdx)); + const Standard_Real anAbsStep = std::abs(TheStep(anIdx)); if (anAbsStep < gp::Resolution()) continue; if (suivant->Value(anIdx) < myLeft(anIdx)) { - Standard_Real aValue = Abs(precedent->Value(anIdx) - myLeft(anIdx)) / anAbsStep; - aMult = Min(aValue, aMult); + Standard_Real aValue = std::abs(precedent->Value(anIdx) - myLeft(anIdx)) / anAbsStep; + aMult = std::min(aValue, aMult); } if (suivant->Value(anIdx) > myRight(anIdx)) { - Standard_Real aValue = Abs(precedent->Value(anIdx) - myRight(anIdx)) / anAbsStep; - aMult = Min(aValue, aMult); + Standard_Real aValue = std::abs(precedent->Value(anIdx) - myRight(anIdx)) / anAbsStep; + aMult = std::min(aValue, aMult); } } @@ -188,9 +188,9 @@ void math_NewtonMinimum::Perform(math_MultipleVarFunctionWithHessian& F, // Nullify corresponding TheStep indexes. for (Standard_Integer anIdx = 1; anIdx <= myLeft.Upper(); anIdx++) { - if ((Abs(precedent->Value(anIdx) - myRight(anIdx)) < Precision::PConfusion() + if ((std::abs(precedent->Value(anIdx) - myRight(anIdx)) < Precision::PConfusion() && TheStep(anIdx) < 0.0) - || (Abs(precedent->Value(anIdx) - myLeft(anIdx)) < Precision::PConfusion() + || (std::abs(precedent->Value(anIdx) - myLeft(anIdx)) < Precision::PConfusion() && TheStep(anIdx) > 0.0)) { TheStep(anIdx) = 0.0; diff --git a/src/FoundationClasses/TKMath/math/math_NewtonMinimum.lxx b/src/FoundationClasses/TKMath/math/math_NewtonMinimum.lxx index dadc7d40e4..edca8f3083 100644 --- a/src/FoundationClasses/TKMath/math/math_NewtonMinimum.lxx +++ b/src/FoundationClasses/TKMath/math/math_NewtonMinimum.lxx @@ -19,7 +19,7 @@ inline Standard_Boolean math_NewtonMinimum::IsConverged() const { return ((TheStep.Norm() <= XTol) - || (Abs(TheMinimum - PreviousMinimum) <= XTol * Abs(PreviousMinimum))); + || (std::abs(TheMinimum - PreviousMinimum) <= XTol * std::abs(PreviousMinimum))); } inline Standard_Boolean math_NewtonMinimum::IsDone() const diff --git a/src/FoundationClasses/TKMath/math/math_PSO.cxx b/src/FoundationClasses/TKMath/math/math_PSO.cxx index d8c8e0854f..c79b563ea0 100644 --- a/src/FoundationClasses/TKMath/math/math_PSO.cxx +++ b/src/FoundationClasses/TKMath/math/math_PSO.cxx @@ -96,7 +96,7 @@ void math_PSO::Perform(const math_Vector& theSteps, } // Step. - aCurrPoint(1) += Max(mySteps(1), 1.0e-15); // Avoid too small step + aCurrPoint(1) += std::max(mySteps(1), 1.0e-15); // Avoid too small step for (Standard_Integer aDimIdx = 1; aDimIdx < myN; ++aDimIdx) { if (aCurrPoint(aDimIdx) > aMaxUV(aDimIdx)) @@ -186,11 +186,12 @@ void math_PSO::performPSOWithGivenParticles(math_PSOParticlesPool& theParticles, aParticle->Position[aDimIdx] += aParticle->Velocity[aDimIdx]; aParticle->Position[aDimIdx] = - Min(Max(aParticle->Position[aDimIdx], aMinUV(aDimIdx + 1)), aMaxUV(aDimIdx + 1)); + std::min(std::max(aParticle->Position[aDimIdx], aMinUV(aDimIdx + 1)), + aMaxUV(aDimIdx + 1)); aCurrPoint(aDimIdx + 1) = aParticle->Position[aDimIdx]; aMinimalVelocity(aDimIdx + 1) = - Min(Abs(aParticle->Velocity[aDimIdx]), aMinimalVelocity(aDimIdx + 1)); + std::min(std::abs(aParticle->Velocity[aDimIdx]), aMinimalVelocity(aDimIdx + 1)); } myFunc->Value(aCurrPoint, aParticle->Distance); diff --git a/src/FoundationClasses/TKMath/math/math_SVD.cxx b/src/FoundationClasses/TKMath/math/math_SVD.cxx index 384aea6eef..ee7c4fb790 100644 --- a/src/FoundationClasses/TKMath/math/math_SVD.cxx +++ b/src/FoundationClasses/TKMath/math/math_SVD.cxx @@ -27,7 +27,7 @@ #include math_SVD::math_SVD(const math_Matrix& A) - : U(1, Max(A.RowNumber(), A.ColNumber()), 1, A.ColNumber()), + : U(1, std::max(A.RowNumber(), A.ColNumber()), 1, A.ColNumber()), V(1, A.ColNumber(), 1, A.ColNumber()), Diag(1, A.ColNumber()) { diff --git a/src/FoundationClasses/TKMath/math/math_TrigonometricEquationFunction.hxx b/src/FoundationClasses/TKMath/math/math_TrigonometricEquationFunction.hxx index 400e40404f..a6439bec62 100644 --- a/src/FoundationClasses/TKMath/math/math_TrigonometricEquationFunction.hxx +++ b/src/FoundationClasses/TKMath/math/math_TrigonometricEquationFunction.hxx @@ -20,7 +20,7 @@ #include //! This is function, which corresponds trigonometric equation -//! a*Cos(x)*Cos(x) + 2*b*Cos(x)*Sin(x) + c*Cos(x) + d*Sin(x) + e = 0 +//! a*std::cos(x)*std::cos(x) + 2*b*std::cos(x)*Sin(x) + c*std::cos(x) + d*Sin(x) + e = 0 //! See class math_TrigonometricFunctionRoots class math_TrigonometricEquationFunction : public math_FunctionWithDerivative { @@ -54,7 +54,7 @@ public: Standard_Boolean Derivative(const Standard_Real X, Standard_Real& D) { - Standard_Real CN = Cos(X), SN = Sin(X); + Standard_Real CN = std::cos(X), SN = std::sin(X); //-- D = -2*AA*CN*SN+2*BB*(CN*CN-SN*SN)-CC*SN+DD*CN; D = -myAA * CN * SN + myBB * (CN * CN - SN * SN); D += D; @@ -64,7 +64,7 @@ public: Standard_Boolean Values(const Standard_Real X, Standard_Real& F, Standard_Real& D) { - Standard_Real CN = Cos(X), SN = Sin(X); + Standard_Real CN = std::cos(X), SN = std::sin(X); //-- F= AA*CN*CN+2*BB*CN*SN+CC*CN+DD*SN+EE; //-- D = -2*AA*CN*SN+2*BB*(CN*CN-SN*SN)-CC*SN+DD*CN; Standard_Real AACN = myAA * CN; diff --git a/src/FoundationClasses/TKMath/math/math_TrigonometricFunctionRoots.cxx b/src/FoundationClasses/TKMath/math/math_TrigonometricFunctionRoots.cxx index fb256d9f21..6da110c3d2 100644 --- a/src/FoundationClasses/TKMath/math/math_TrigonometricFunctionRoots.cxx +++ b/src/FoundationClasses/TKMath/math/math_TrigonometricFunctionRoots.cxx @@ -122,13 +122,13 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A, } } - if ((Abs(A) <= Eps) && (Abs(B) <= Eps)) + if ((std::abs(A) <= Eps) && (std::abs(B) <= Eps)) { - if (Abs(C) <= Eps) + if (std::abs(C) <= Eps) { - if (Abs(D) <= Eps) + if (std::abs(D) <= Eps) { - if (Abs(E) <= Eps) + if (std::abs(E) <= Eps) { InfiniteStatus = Standard_True; // infinite de solutions. return; @@ -145,23 +145,23 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A, // ================================= NbSol = 0; AA = -E / D; - if (Abs(AA) > 1.) + if (std::abs(AA) > 1.) { return; } - Zer(1) = ASin(AA); + Zer(1) = std::asin(AA); Zer(2) = M_PI - Zer(1); NZer = 2; for (i = 1; i <= NZer; i++) { if (Zer(i) <= -Eps) { - Zer(i) = Depi - Abs(Zer(i)); + Zer(i) = Depi - std::abs(Zer(i)); } // On rend les solutions entre InfBound et SupBound: // ================================================= - Zer(i) += IntegerPart(Mod) * Depi; + Zer(i) += std::trunc(Mod) * Depi; X = Zer(i) - MyBorneInf; if ((X > (-Epsilon(Delta))) && (X < Delta + Epsilon(Delta))) { @@ -172,18 +172,18 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A, } return; } - else if (Abs(D) <= Eps) + else if (std::abs(D) <= Eps) { // Equation du premier degre de la forme c*cos(x) + e = 0 // ====================================================== NbSol = 0; AA = -E / C; - if (Abs(AA) > 1.) + if (std::abs(AA) > 1.) { return; } - Zer(1) = ACos(AA); + Zer(1) = std::acos(AA); Zer(2) = -Zer(1); NZer = 2; @@ -191,11 +191,11 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A, { if (Zer(i) <= -Eps) { - Zer(i) = Depi - Abs(Zer(i)); + Zer(i) = Depi - std::abs(Zer(i)); } // On rend les solutions entre InfBound et SupBound: // ================================================= - Zer(i) += IntegerPart(Mod) * 2. * M_PI; + Zer(i) += std::trunc(Mod) * 2. * M_PI; X = Zer(i) - MyBorneInf; if ((X >= (-Epsilon(Delta))) && (X <= Delta + Epsilon(Delta))) { @@ -238,9 +238,9 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A, else { // Two additional analytical cases. - if ((Abs(A) <= Eps) && (Abs(E) <= Eps)) + if ((std::abs(A) <= Eps) && (std::abs(E) <= Eps)) { - if (Abs(C) <= Eps) + if (std::abs(C) <= Eps) { // 2 * B * sin * cos + D * sin = 0 NZer = 2; @@ -248,7 +248,7 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A, Zer(2) = M_PI; AA = -D / (B * 2); - if (Abs(AA) <= 1.0 + Precision::PConfusion()) + if (std::abs(AA) <= 1.0 + Precision::PConfusion()) { NZer = 4; if (AA >= 1.0) @@ -263,7 +263,7 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A, } else { - Zer(3) = ACos(AA); + Zer(3) = std::acos(AA); Zer(4) = Depi - Zer(3); } } @@ -277,7 +277,7 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A, } // On rend les solutions entre InfBound et SupBound: // ================================================= - Zer(i) += IntegerPart(Mod) * 2. * M_PI; + Zer(i) += std::trunc(Mod) * 2. * M_PI; X = Zer(i) - MyBorneInf; if ((X >= (-Precision::PConfusion())) && (X <= Delta + Precision::PConfusion())) { @@ -291,7 +291,7 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A, } return; } - if (Abs(D) <= Eps) + if (std::abs(D) <= Eps) { // 2 * B * sin * cos + C * cos = 0 NZer = 2; @@ -299,7 +299,7 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A, Zer(2) = M_PI * 3.0 / 2.0; AA = -C / (B * 2); - if (Abs(AA) <= 1.0 + Precision::PConfusion()) + if (std::abs(AA) <= 1.0 + Precision::PConfusion()) { NZer = 4; if (AA >= 1.0) @@ -315,7 +315,7 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A, } else { - Zer(3) = ASin(AA); + Zer(3) = std::asin(AA); Zer(4) = M_PI - Zer(3); } } @@ -329,7 +329,7 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A, } // On rend les solutions entre InfBound et SupBound: // ================================================= - Zer(i) += IntegerPart(Mod) * 2. * M_PI; + Zer(i) += std::trunc(Mod) * 2. * M_PI; X = Zer(i) - MyBorneInf; if ((X >= (-Precision::PConfusion())) && (X <= Delta + Precision::PConfusion())) { @@ -393,13 +393,13 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A, for (i = 1; i < NZer; i++) { - if (Abs(Zer(i + 1) - Zer(i)) < Eps) + if (std::abs(Zer(i + 1) - Zer(i)) < Eps) { //-- est ce une racine double ou une erreur numerique ? Standard_Real qw = Zer(i + 1); Standard_Real va = ko(4) + qw * (2.0 * ko(3) + qw * (3.0 * ko(2) + qw * (4.0 * ko(1)))); //-- std::cout<<" Val Double ("< Eps) + if (std::abs(va) > Eps) { bko = Standard_True; #ifdef OCCT_DEBUG @@ -436,9 +436,9 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A, Teta += Teta; if (Zer(i) <= (-Eps)) { - Teta = Depi - Abs(Teta); + Teta = Depi - std::abs(Teta); } - Teta += IntegerPart(Mod) * Depi; + Teta += std::trunc(Mod) * Depi; if (Teta - MyBorneInf < 0) Teta += Depi; @@ -498,11 +498,11 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A, Standard_Integer startIndex = NbSol + 1; for (Standard_Integer solIt = startIndex; solIt <= 4; solIt++) { - Teta = M_PI + IntegerPart(Mod) * 2.0 * M_PI; + Teta = M_PI + std::trunc(Mod) * 2.0 * M_PI; X = Teta - MyBorneInf; if ((X >= (-Epsilon(Delta))) && (X <= Delta + Epsilon(Delta))) { - if (Abs(A - C + E) <= Eps) + if (std::abs(A - C + E) <= Eps) { Flag4 = Standard_False; for (k = 1; k <= NbSol; k++) @@ -513,7 +513,7 @@ void math_TrigonometricFunctionRoots::Perform(const Standard_Real A, Flag4 = Standard_True; break; } - if ((solIt == startIndex) && (Abs(Teta - Sol(k)) <= Eps)) + if ((solIt == startIndex) && (std::abs(Teta - Sol(k)) <= Eps)) { return; } diff --git a/src/FoundationClasses/TKMath/math/math_TrigonometricFunctionRoots.hxx b/src/FoundationClasses/TKMath/math/math_TrigonometricFunctionRoots.hxx index 6842c7c6e8..3ba1278897 100644 --- a/src/FoundationClasses/TKMath/math/math_TrigonometricFunctionRoots.hxx +++ b/src/FoundationClasses/TKMath/math/math_TrigonometricFunctionRoots.hxx @@ -26,7 +26,7 @@ #include //! This class implements the solutions of the equation -//! a*Cos(x)*Cos(x) + 2*b*Cos(x)*Sin(x) + c*Cos(x) + d*Sin(x) + e +//! a*std::cos(x)*std::cos(x) + 2*b*std::cos(x)*Sin(x) + c*std::cos(x) + d*Sin(x) + e //! The degree of this equation can be 4, 3 or 2. class math_TrigonometricFunctionRoots { @@ -55,7 +55,7 @@ public: const Standard_Real SupBound); //! Given the three coefficients c, d and e, it performs - //! the resolution of c*Cos(x) + d*sin(x) + e = 0. + //! the resolution of c*std::cos(x) + d*sin(x) + e = 0. //! The solutions must be contained in [InfBound, SupBound]. //! InfBound and SupBound can be set by default to 0 and 2*PI. Standard_EXPORT math_TrigonometricFunctionRoots(const Standard_Real C, diff --git a/src/FoundationClasses/TKMath/math/math_Uzawa.cxx b/src/FoundationClasses/TKMath/math/math_Uzawa.cxx index 82762afa71..bd58720499 100644 --- a/src/FoundationClasses/TKMath/math/math_Uzawa.cxx +++ b/src/FoundationClasses/TKMath/math/math_Uzawa.cxx @@ -87,7 +87,7 @@ void math_Uzawa::Perform(const math_Matrix& Cont, Standard_Integer i, j, k; Standard_Real scale; Standard_Real Normat, Normli, Xian, Xmax = 0, Xmuian; - Standard_Real Rho, Err, Err1, ErrMax = 0, Coef = 1. / Sqrt(2.); + Standard_Real Rho, Err, Err1, ErrMax = 0, Coef = 1. / std::sqrt(2.); Standard_Integer Nlig = Cont.RowNumber(); Standard_Integer Ncol = Cont.ColNumber(); @@ -201,9 +201,9 @@ void math_Uzawa::Perform(const math_Matrix& Cont, { if (i == 1) { - Xmax = Abs(Erruza(i) - Xian); + Xmax = std::abs(Erruza(i) - Xian); } - Xmax = Max(Xmax, Abs(Erruza(i) - Xian)); + Xmax = std::max(Xmax, std::abs(Erruza(i) - Xian)); } } @@ -220,19 +220,19 @@ void math_Uzawa::Perform(const math_Matrix& Cont, if (i <= Nce) { Vardua(i) += Rho * Err; - Err1 = Abs(Rho * Err); + Err1 = std::abs(Rho * Err); } else { Xmuian = Vardua(i); - Vardua(i) = Max(0.0, Vardua(i) + Rho * Err); - Err1 = Abs(Vardua(i) - Xmuian); + Vardua(i) = std::max(0.0, Vardua(i) + Rho * Err); + Err1 = std::abs(Vardua(i) - Xmuian); } if (i == 1) { ErrMax = Err1; } - ErrMax = Max(ErrMax, Err1); + ErrMax = std::max(ErrMax, Err1); } if (NbIter > 1) diff --git a/src/FoundationClasses/TKMath/math/math_VectorBase.lxx b/src/FoundationClasses/TKMath/math/math_VectorBase.lxx index 2a652cfbeb..fbd83f37bf 100644 --- a/src/FoundationClasses/TKMath/math/math_VectorBase.lxx +++ b/src/FoundationClasses/TKMath/math/math_VectorBase.lxx @@ -90,7 +90,7 @@ Standard_Real math_VectorBase::Norm() const { Result = Result + Array(Index) * Array(Index); } - return Sqrt(Result); + return std::sqrt(Result); } template @@ -231,7 +231,7 @@ void math_VectorBase::Multiply(const TheItemType theRight) template void math_VectorBase::Divide(const TheItemType theRight) { - Standard_DivideByZero_Raise_if(Abs(theRight) <= RealEpsilon(), + Standard_DivideByZero_Raise_if(std::abs(theRight) <= RealEpsilon(), "math_VectorBase::Divide() - devisor is zero"); for (Standard_Integer Index = Lower(); Index <= Upper(); Index++) @@ -243,7 +243,7 @@ void math_VectorBase::Divide(const TheItemType theRight) template math_VectorBase math_VectorBase::Divided(const TheItemType theRight) const { - Standard_DivideByZero_Raise_if(Abs(theRight) <= RealEpsilon(), + Standard_DivideByZero_Raise_if(std::abs(theRight) <= RealEpsilon(), "math_VectorBase::Divided() - devisor is zero"); math_VectorBase temp = Multiplied(1. / theRight); return temp; diff --git a/src/FoundationClasses/TKernel/Message/Message_AttributeMeter.cxx b/src/FoundationClasses/TKernel/Message/Message_AttributeMeter.cxx index e0d803380b..6cbd1c1b90 100644 --- a/src/FoundationClasses/TKernel/Message/Message_AttributeMeter.cxx +++ b/src/FoundationClasses/TKernel/Message/Message_AttributeMeter.cxx @@ -39,8 +39,8 @@ Standard_Boolean Message_AttributeMeter::HasMetric(const Message_MetricType& the Standard_Boolean Message_AttributeMeter::IsMetricValid(const Message_MetricType& theMetric) const { - return Abs(StartValue(theMetric) - UndefinedMetricValue()) > Precision::Confusion() - && Abs(StopValue(theMetric) - UndefinedMetricValue()) > Precision::Confusion(); + return std::abs(StartValue(theMetric) - UndefinedMetricValue()) > Precision::Confusion() + && std::abs(StopValue(theMetric) - UndefinedMetricValue()) > Precision::Confusion(); } //================================================================================================= diff --git a/src/FoundationClasses/TKernel/Message/Message_Msg.cxx b/src/FoundationClasses/TKernel/Message/Message_Msg.cxx index c329bb02ed..ff3799daa6 100644 --- a/src/FoundationClasses/TKernel/Message/Message_Msg.cxx +++ b/src/FoundationClasses/TKernel/Message/Message_Msg.cxx @@ -143,7 +143,7 @@ Message_Msg& Message_Msg::Arg(const Standard_CString theString) return *this; // print string according to format - char* sStringBuffer = new char[Max((Standard_Integer)strlen(theString) + 1, 1024)]; + char* sStringBuffer = new char[std::max(static_cast(strlen(theString) + 1), 1024)]; Sprintf(sStringBuffer, aFormat.ToCString(), theString); TCollection_ExtendedString aStr(sStringBuffer, Standard_True); delete[] sStringBuffer; diff --git a/src/FoundationClasses/TKernel/Message/Message_ProgressIndicator.hxx b/src/FoundationClasses/TKernel/Message/Message_ProgressIndicator.hxx index 1a5a7c42c8..92ce750845 100644 --- a/src/FoundationClasses/TKernel/Message/Message_ProgressIndicator.hxx +++ b/src/FoundationClasses/TKernel/Message/Message_ProgressIndicator.hxx @@ -156,7 +156,7 @@ inline void Message_ProgressIndicator::Increment(const Standard_Real th // protect incrementation by mutex to avoid problems in multithreaded scenarios std::lock_guard aLock(myMutex); - myPosition = Min(myPosition + theStep, 1.); + myPosition = (std::min)(myPosition + theStep, 1.); // show progress indicator; note that this call is protected by // the same mutex to avoid concurrency and ensure that this call diff --git a/src/FoundationClasses/TKernel/Message/Message_ProgressScope.hxx b/src/FoundationClasses/TKernel/Message/Message_ProgressScope.hxx index ddfaf0ea08..6118ed2610 100644 --- a/src/FoundationClasses/TKernel/Message/Message_ProgressScope.hxx +++ b/src/FoundationClasses/TKernel/Message/Message_ProgressScope.hxx @@ -431,7 +431,7 @@ inline Message_ProgressScope::Message_ProgressScope(const Message_ProgressRange& myName(NULL), myStart(theRange.myStart), myPortion(theRange.myDelta), - myMax(Max(1.e-6, theMax)), // protection against zero range + myMax((std::max)(1.e-6, theMax)), // protection against zero range myValue(0.), myIsActive(myProgress != NULL && !theRange.myWasUsed), myIsOwnName(false), @@ -455,7 +455,7 @@ Message_ProgressScope::Message_ProgressScope(const Message_ProgressRange& theRan myName(theName), myStart(theRange.myStart), myPortion(theRange.myDelta), - myMax(Max(1.e-6, theMax)), // protection against zero range + myMax((std::max)(1.e-6, theMax)), // protection against zero range myValue(0.), myIsActive(myProgress != NULL && !theRange.myWasUsed), myIsOwnName(false), @@ -477,7 +477,7 @@ inline Message_ProgressScope::Message_ProgressScope(const Message_ProgressRange& myName(NULL), myStart(theRange.myStart), myPortion(theRange.myDelta), - myMax(Max(1.e-6, theMax)), // protection against zero range + myMax((std::max)(1.e-6, theMax)), // protection against zero range myValue(0.), myIsActive(myProgress != NULL && !theRange.myWasUsed), myIsOwnName(false), diff --git a/src/FoundationClasses/TKernel/NCollection/NCollection_AliasedArray.hxx b/src/FoundationClasses/TKernel/NCollection/NCollection_AliasedArray.hxx index 34b72affea..58c441de2c 100644 --- a/src/FoundationClasses/TKernel/NCollection/NCollection_AliasedArray.hxx +++ b/src/FoundationClasses/TKernel/NCollection/NCollection_AliasedArray.hxx @@ -220,7 +220,7 @@ public: return; } - const size_t aLenCopy = size_t(Min(anOldLen, theLength)) * size_t(myStride); + const size_t aLenCopy = size_t((std::min)(anOldLen, theLength)) * size_t(myStride); memcpy(myData, anOldData, aLenCopy); if (myDeletable) { diff --git a/src/FoundationClasses/TKernel/NCollection/NCollection_Array1.hxx b/src/FoundationClasses/TKernel/NCollection/NCollection_Array1.hxx index 3f141f5fdc..fc979cac30 100644 --- a/src/FoundationClasses/TKernel/NCollection/NCollection_Array1.hxx +++ b/src/FoundationClasses/TKernel/NCollection/NCollection_Array1.hxx @@ -362,7 +362,7 @@ public: myLowerBound = theLower; if (theToCopyData) { - const size_t aMinSize = std::min(aNewSize, mySize); + const size_t aMinSize = (std::min)(aNewSize, mySize); if (myIsOwner) { myPointer = myAllocator.reallocate(myPointer, aNewSize); diff --git a/src/FoundationClasses/TKernel/NCollection/NCollection_Array2.hxx b/src/FoundationClasses/TKernel/NCollection/NCollection_Array2.hxx index b7519be731..323acf4cc4 100644 --- a/src/FoundationClasses/TKernel/NCollection/NCollection_Array2.hxx +++ b/src/FoundationClasses/TKernel/NCollection/NCollection_Array2.hxx @@ -346,8 +346,8 @@ public: } const size_t aNewNbRows = theRowUpper - theRowLower + 1; const size_t aNewNbCols = theColUpper - theColLower + 1; - const size_t aNbRowsToCopy = std::min(mySizeRow, aNewNbRows); - const size_t aNbColsToCopy = std::min(mySizeCol, aNewNbCols); + const size_t aNbRowsToCopy = (std::min)(mySizeRow, aNewNbRows); + const size_t aNbColsToCopy = (std::min)(mySizeCol, aNewNbCols); NCollection_Array2 aTmpMovedCopy(std::move(*this)); TheItemType* anOldPointer = &aTmpMovedCopy.ChangeFirst(); diff --git a/src/FoundationClasses/TKernel/OSD/OSD_Parallel_Threads.cxx b/src/FoundationClasses/TKernel/OSD/OSD_Parallel_Threads.cxx index 5fff7d7ce2..b5896ecf0f 100644 --- a/src/FoundationClasses/TKernel/OSD/OSD_Parallel_Threads.cxx +++ b/src/FoundationClasses/TKernel/OSD/OSD_Parallel_Threads.cxx @@ -142,7 +142,7 @@ void OSD_Parallel::forEachOcct(UniversalIterator& theBegin, { const Handle(OSD_ThreadPool)& aThreadPool = OSD_ThreadPool::DefaultPool(); const Standard_Integer aNbThreads = - theNbItems != -1 ? Min(theNbItems, aThreadPool->NbDefaultThreadsToLaunch()) : -1; + theNbItems != -1 ? std::min(theNbItems, aThreadPool->NbDefaultThreadsToLaunch()) : -1; OSD_Parallel_Threads::UniversalLauncher aLauncher(*aThreadPool, aNbThreads); aLauncher.Perform(theBegin, theEnd, theFunctor); } diff --git a/src/FoundationClasses/TKernel/OSD/OSD_ThreadPool.cxx b/src/FoundationClasses/TKernel/OSD/OSD_ThreadPool.cxx index f0de6d0b6f..1d0298c2da 100644 --- a/src/FoundationClasses/TKernel/OSD/OSD_ThreadPool.cxx +++ b/src/FoundationClasses/TKernel/OSD/OSD_ThreadPool.cxx @@ -109,7 +109,7 @@ bool OSD_ThreadPool::IsInUse() void OSD_ThreadPool::Init(int theNbThreads) { const int aNbThreads = - Max(0, (theNbThreads > 0 ? theNbThreads : OSD_Parallel::NbLogicalProcessors()) - 1); + std::max(0, (theNbThreads > 0 ? theNbThreads : OSD_Parallel::NbLogicalProcessors()) - 1); if (myThreads.Size() == aNbThreads) { return; @@ -320,9 +320,9 @@ OSD_ThreadPool::Launcher::Launcher(OSD_ThreadPool& thePool, Standard_Integer the : mySelfThread(true), myNbThreads(0) { - const int aNbThreads = theMaxThreads > 0 - ? Min(theMaxThreads, thePool.NbThreads()) - : (theMaxThreads < 0 ? Max(thePool.NbDefaultThreadsToLaunch(), 1) : 1); + const int aNbThreads = + theMaxThreads > 0 ? std::min(theMaxThreads, thePool.NbThreads()) + : (theMaxThreads < 0 ? std::max(thePool.NbDefaultThreadsToLaunch(), 1) : 1); myThreads.Resize(0, aNbThreads - 1, false); myThreads.Init(NULL); if (aNbThreads > 1) diff --git a/src/FoundationClasses/TKernel/OSD/OSD_signal.cxx b/src/FoundationClasses/TKernel/OSD/OSD_signal.cxx index 85c4920d74..738042cc44 100644 --- a/src/FoundationClasses/TKernel/OSD/OSD_signal.cxx +++ b/src/FoundationClasses/TKernel/OSD/OSD_signal.cxx @@ -266,7 +266,7 @@ static LONG CallHandler(DWORD theExceptionCode, EXCEPTION_POINTERS* theExcPtr) } const int aStackLength = OSD_SignalStackTraceLength; - const int aStackBufLen = Max(aStackLength * 200, 2048); + const int aStackBufLen = std::max(aStackLength * 200, 2048); char* aStackBuffer = aStackLength != 0 ? (char*)alloca(aStackBufLen) : NULL; if (aStackBuffer != NULL) { @@ -936,7 +936,7 @@ static void SegvHandler(const int theSignal, Sprintf(aMsg, "SIGSEGV 'segmentation violation' detected. Address %lx.", (long)anAddress); const int aStackLength = OSD_SignalStackTraceLength; - const int aStackBufLen = Max(aStackLength * 200, 2048); + const int aStackBufLen = std::max(aStackLength * 200, 2048); char* aStackBuffer = aStackLength != 0 ? (char*)alloca(aStackBufLen) : NULL; if (aStackBuffer != NULL) { diff --git a/src/FoundationClasses/TKernel/Precision/Precision.hxx b/src/FoundationClasses/TKernel/Precision/Precision.hxx index b66e46b0ef..c505ddc320 100644 --- a/src/FoundationClasses/TKernel/Precision/Precision.hxx +++ b/src/FoundationClasses/TKernel/Precision/Precision.hxx @@ -104,7 +104,7 @@ public: //! Returns the recommended precision value //! when checking the equality of two angles (given in radians). //! Standard_Real Angle1 = ... , Angle2 = ... ; - //! If ( Abs( Angle2 - Angle1 ) < Precision::Angular() ) ... + //! If ( std::abs( Angle2 - Angle1 ) < Precision::Angular() ) ... //! The tolerance of angular equality may be used to check the parallelism of two vectors : //! gp_Vec V1, V2 ; //! V1 = ... @@ -118,7 +118,7 @@ public: //! D1 = ... //! D2 = ... //! you can use : - //! If ( Abs( D1.D2 ) < Precision::Angular() ) ... + //! If ( std::abs( D1.D2 ) < Precision::Angular() ) ... //! (although the function IsNormal does exist). static constexpr Standard_Real Angular() { return 1.e-12; } @@ -358,10 +358,10 @@ public: static constexpr Standard_Real PApproximation() { return Approximation() * 0.01; } //! Returns True if R may be considered as an infinite - //! number. Currently Abs(R) > 1e100 + //! number. Currently std::abs(R) > 1e100 static inline Standard_Boolean IsInfinite(const Standard_Real R) { - return Abs(R) >= (0.5 * Precision::Infinite()); + return std::abs(R) >= (0.5 * Precision::Infinite()); } //! Returns True if R may be considered as a positive diff --git a/src/FoundationClasses/TKernel/Quantity/Quantity_Color.cxx b/src/FoundationClasses/TKernel/Quantity/Quantity_Color.cxx index fde68e2cd0..2269a7a1a5 100644 --- a/src/FoundationClasses/TKernel/Quantity/Quantity_Color.cxx +++ b/src/FoundationClasses/TKernel/Quantity/Quantity_Color.cxx @@ -399,27 +399,27 @@ Standard_Real Quantity_Color::DeltaE2000(const Quantity_Color& theOther) const Standard_Real aLx_mean = 0.5 * (aL1 + aL2); // mean C - Standard_Real aC1 = Sqrt(aa1 * aa1 + ab1 * ab1); - Standard_Real aC2 = Sqrt(aa2 * aa2 + ab2 * ab2); + Standard_Real aC1 = std::sqrt(aa1 * aa1 + ab1 * ab1); + Standard_Real aC2 = std::sqrt(aa2 * aa2 + ab2 * ab2); Standard_Real aC_mean = 0.5 * (aC1 + aC2); - Standard_Real aC_mean_pow7 = Pow(aC_mean, 7); - Standard_Real aG = 0.5 * (1. - Sqrt(aC_mean_pow7 / (aC_mean_pow7 + POW_25_7))); + Standard_Real aC_mean_pow7 = std::pow(aC_mean, 7); + Standard_Real aG = 0.5 * (1. - std::sqrt(aC_mean_pow7 / (aC_mean_pow7 + POW_25_7))); Standard_Real aa1x = aa1 * (1. + aG); Standard_Real aa2x = aa2 * (1. + aG); - Standard_Real aC1x = Sqrt(aa1x * aa1x + ab1 * ab1); - Standard_Real aC2x = Sqrt(aa2x * aa2x + ab2 * ab2); + Standard_Real aC1x = std::sqrt(aa1x * aa1x + ab1 * ab1); + Standard_Real aC2x = std::sqrt(aa2x * aa2x + ab2 * ab2); Standard_Real aCx_mean = 0.5 * (aC1x + aC2x); // mean H - Standard_Real ah1x = (aC1x > Epsilon() ? ATan2(ab1, aa1x) * RAD_TO_DEG : 270.); - Standard_Real ah2x = (aC2x > Epsilon() ? ATan2(ab2, aa2x) * RAD_TO_DEG : 270.); + Standard_Real ah1x = (aC1x > Epsilon() ? std::atan2(ab1, aa1x) * RAD_TO_DEG : 270.); + Standard_Real ah2x = (aC2x > Epsilon() ? std::atan2(ab2, aa2x) * RAD_TO_DEG : 270.); if (ah1x < 0.) ah1x += 360.; if (ah2x < 0.) ah2x += 360.; Standard_Real aHx_mean = 0.5 * (ah1x + ah2x); Standard_Real aDeltahx = ah2x - ah1x; - if (Abs(aDeltahx) > 180.) + if (std::abs(aDeltahx) > 180.) { aHx_mean += (aHx_mean < 180. ? 180. : -180.); aDeltahx += (ah1x >= ah2x ? 360. : -360.); @@ -428,29 +428,29 @@ Standard_Real Quantity_Color::DeltaE2000(const Quantity_Color& theOther) const // deltas Standard_Real aDeltaLx = aL2 - aL1; Standard_Real aDeltaCx = aC2x - aC1x; - Standard_Real aDeltaHx = 2. * Sqrt(aC1x * aC2x) * Sin(0.5 * aDeltahx * DEG_TO_RAD); + Standard_Real aDeltaHx = 2. * std::sqrt(aC1x * aC2x) * std::sin(0.5 * aDeltahx * DEG_TO_RAD); // factors - Standard_Real aT = 1. - 0.17 * Cos((aHx_mean - 30.) * DEG_TO_RAD) - + 0.24 * Cos((2. * aHx_mean) * DEG_TO_RAD) - + 0.32 * Cos((3. * aHx_mean + 6.) * DEG_TO_RAD) - - 0.20 * Cos((4. * aHx_mean - 63.) * DEG_TO_RAD); + Standard_Real aT = 1. - 0.17 * std::cos((aHx_mean - 30.) * DEG_TO_RAD) + + 0.24 * std::cos((2. * aHx_mean) * DEG_TO_RAD) + + 0.32 * std::cos((3. * aHx_mean + 6.) * DEG_TO_RAD) + - 0.20 * std::cos((4. * aHx_mean - 63.) * DEG_TO_RAD); Standard_Real aLx_mean50_2 = (aLx_mean - 50.) * (aLx_mean - 50.); - Standard_Real aS_L = 1. + 0.015 * aLx_mean50_2 / Sqrt(20. + aLx_mean50_2); + Standard_Real aS_L = 1. + 0.015 * aLx_mean50_2 / std::sqrt(20. + aLx_mean50_2); Standard_Real aS_C = 1. + 0.045 * aCx_mean; Standard_Real aS_H = 1. + 0.015 * aCx_mean * aT; - Standard_Real aDelta_theta = 30. * Exp(-(aHx_mean - 275.) * (aHx_mean - 275.) / 625.); - Standard_Real aCx_mean_pow7 = Pow(aCx_mean, 7); - Standard_Real aR_C = 2. * Sqrt(aCx_mean_pow7 / (aCx_mean_pow7 + POW_25_7)); - Standard_Real aR_T = -aR_C * Sin(2. * aDelta_theta * DEG_TO_RAD); + Standard_Real aDelta_theta = 30. * std::exp(-(aHx_mean - 275.) * (aHx_mean - 275.) / 625.); + Standard_Real aCx_mean_pow7 = std::pow(aCx_mean, 7); + Standard_Real aR_C = 2. * std::sqrt(aCx_mean_pow7 / (aCx_mean_pow7 + POW_25_7)); + Standard_Real aR_T = -aR_C * std::sin(2. * aDelta_theta * DEG_TO_RAD); // finally, the difference Standard_Real aDL = aDeltaLx / aS_L; Standard_Real aDC = aDeltaCx / aS_C; Standard_Real aDH = aDeltaHx / aS_H; - Standard_Real aDeltaE2000 = Sqrt(aDL * aDL + aDC * aDC + aDH * aDH + aR_T * aDC * aDH); + Standard_Real aDeltaE2000 = std::sqrt(aDL * aDL + aDC * aDC + aDH * aDH + aR_T * aDC * aDH); return aDeltaE2000; } @@ -628,7 +628,7 @@ NCollection_Vec3 Quantity_Color::Convert_sRGB_To_HLS( // ======================================================================= static inline double CIELab_f(double theValue) noexcept { - return theValue > CIELAB_EPSILON ? Pow(theValue, 1. / 3.) + return theValue > CIELAB_EPSILON ? std::pow(theValue, 1. / 3.) : (CIELAB_KAPPA * theValue) + CIELAB_OFFSET; } @@ -729,8 +729,8 @@ NCollection_Vec3 Quantity_Color::Convert_Lab_To_Lch( double aa = theLab[1]; double ab = theLab[2]; - double aC = Sqrt(aa * aa + ab * ab); - double aH = (aC > Epsilon() ? ATan2(ab, aa) * RAD_TO_DEG : 0.); + double aC = std::sqrt(aa * aa + ab * ab); + double aH = (aC > Epsilon() ? std::atan2(ab, aa) * RAD_TO_DEG : 0.); if (aH < 0.) aH += 360.; @@ -751,8 +751,8 @@ NCollection_Vec3 Quantity_Color::Convert_Lch_To_Lab( aH *= DEG_TO_RAD; - double aa = aC * Cos(aH); - double ab = aC * Sin(aH); + double aa = aC * std::cos(aH); + double ab = aC * std::sin(aH); return NCollection_Vec3(theLch[0], (float)aa, (float)ab); } diff --git a/src/FoundationClasses/TKernel/Quantity/Quantity_Color.hxx b/src/FoundationClasses/TKernel/Quantity/Quantity_Color.hxx index 6e818833d4..3d364131dc 100644 --- a/src/FoundationClasses/TKernel/Quantity/Quantity_Color.hxx +++ b/src/FoundationClasses/TKernel/Quantity/Quantity_Color.hxx @@ -316,7 +316,7 @@ public: static Standard_Real Convert_LinearRGB_To_sRGB(Standard_Real theLinearValue) noexcept { return theLinearValue <= 0.0031308 ? theLinearValue * 12.92 - : Pow(theLinearValue, 1.0 / 2.4) * 1.055 - 0.055; + : std::pow(theLinearValue, 1.0 / 2.4) * 1.055 - 0.055; } //! Convert linear RGB component into sRGB using OpenGL specs formula (single precision), also @@ -332,7 +332,7 @@ public: static Standard_Real Convert_sRGB_To_LinearRGB(Standard_Real thesRGBValue) noexcept { return thesRGBValue <= 0.04045 ? thesRGBValue / 12.92 - : Pow((thesRGBValue + 0.055) / 1.055, 2.4); + : std::pow((thesRGBValue + 0.055) / 1.055, 2.4); } //! Convert sRGB component into linear RGB using OpenGL specs formula (single precision), also diff --git a/src/FoundationClasses/TKernel/Quantity/Quantity_ColorRGBA.hxx b/src/FoundationClasses/TKernel/Quantity/Quantity_ColorRGBA.hxx index 7b877e7926..805ffec6b8 100644 --- a/src/FoundationClasses/TKernel/Quantity/Quantity_ColorRGBA.hxx +++ b/src/FoundationClasses/TKernel/Quantity/Quantity_ColorRGBA.hxx @@ -87,7 +87,7 @@ public: bool IsDifferent(const Quantity_ColorRGBA& theOther) const noexcept { return myRgb.IsDifferent(theOther.GetRGB()) - || Abs(myAlpha - theOther.myAlpha) > (float)Quantity_Color::Epsilon(); + || std::abs(myAlpha - theOther.myAlpha) > (float)Quantity_Color::Epsilon(); } //! Returns true if the distance between colors is greater than Epsilon(). @@ -100,7 +100,7 @@ public: bool IsEqual(const Quantity_ColorRGBA& theOther) const noexcept { return myRgb.IsEqual(theOther.GetRGB()) - && Abs(myAlpha - theOther.myAlpha) <= (float)Quantity_Color::Epsilon(); + && std::abs(myAlpha - theOther.myAlpha) <= (float)Quantity_Color::Epsilon(); } //! Two colors are considered to be equal if their distance is no greater than Epsilon(). diff --git a/src/FoundationClasses/TKernel/Quantity/Quantity_Period.cxx b/src/FoundationClasses/TKernel/Quantity/Quantity_Period.cxx index 6e91c0719f..d608906d9c 100644 --- a/src/FoundationClasses/TKernel/Quantity/Quantity_Period.cxx +++ b/src/FoundationClasses/TKernel/Quantity/Quantity_Period.cxx @@ -161,7 +161,7 @@ Quantity_Period Quantity_Period::Subtract(const Quantity_Period& OtherPeriod) co // Note: after normalization, myUSec is always in [0, 999999] if (result.mySec < 0) { - result.mySec = Abs(result.mySec); + result.mySec = std::abs(result.mySec); if (result.myUSec > 0) { result.mySec--; diff --git a/src/FoundationClasses/TKernel/Standard/Standard_Failure.cxx b/src/FoundationClasses/TKernel/Standard/Standard_Failure.cxx index 7e4c670cff..4fc97b9e80 100644 --- a/src/FoundationClasses/TKernel/Standard/Standard_Failure.cxx +++ b/src/FoundationClasses/TKernel/Standard/Standard_Failure.cxx @@ -87,7 +87,7 @@ Standard_Failure::Standard_Failure() const Standard_Integer aStackLength = Standard_Failure_DefaultStackTraceLength; if (aStackLength > 0) { - int aStackBufLen = Max(aStackLength * 200, 2048); + int aStackBufLen = std::max(aStackLength * 200, 2048); char* aStackBuffer = (char*)alloca(aStackBufLen); if (aStackBuffer != NULL) { @@ -110,7 +110,7 @@ Standard_Failure::Standard_Failure(const Standard_CString theDesc) const Standard_Integer aStackLength = Standard_Failure_DefaultStackTraceLength; if (aStackLength > 0) { - int aStackBufLen = Max(aStackLength * 200, 2048); + int aStackBufLen = std::max(aStackLength * 200, 2048); char* aStackBuffer = (char*)alloca(aStackBufLen); if (aStackBuffer != NULL) { diff --git a/src/FoundationClasses/TKernel/Standard/Standard_Integer.hxx b/src/FoundationClasses/TKernel/Standard/Standard_Integer.hxx index b86ca902b5..d943597be4 100755 --- a/src/FoundationClasses/TKernel/Standard/Standard_Integer.hxx +++ b/src/FoundationClasses/TKernel/Standard/Standard_Integer.hxx @@ -18,90 +18,78 @@ #include #include +#include #include +#include -// =============== -// Inline methods -// =============== - -// ------------------------------------------------------------------ -// Abs : Returns the absolute value of an Integer -// ------------------------------------------------------------------ -constexpr Standard_Integer Abs(const Standard_Integer Value) +//! Returns the absolute value of a int @p Value. +//! Equivalent to std::abs. +[[nodiscard]] constexpr int Abs(const int theValue) { - return Value >= 0 ? Value : -Value; + return theValue < 0 ? -theValue : theValue; } -// ------------------------------------------------------------------ -// IsEven : Returns Standard_True if an integer is even -// ------------------------------------------------------------------ -constexpr Standard_Boolean IsEven(const Standard_Integer Value) +//! Returns true if @p theValue is even. +[[nodiscard]] constexpr bool IsEven(const int theValue) { - return Value % 2 == 0; + return theValue % 2 == 0; } -// ------------------------------------------------------------------ -// IsOdd : Returns Standard_True if an integer is odd -// ------------------------------------------------------------------ -constexpr Standard_Boolean IsOdd(const Standard_Integer Value) +//! Returns true if @p theValue is odd. +[[nodiscard]] constexpr bool IsOdd(const int theValue) { - return Value % 2 == 1; + return theValue % 2 == 1; } -// ------------------------------------------------------------------ -// Max : Returns the maximum integer between two integers -// ------------------------------------------------------------------ -constexpr Standard_Integer Max(const Standard_Integer Val1, const Standard_Integer Val2) +//! Returns the maximum value of two integers. +//! Equivalent to std::max. +Standard_DEPRECATED("This function duplicates std::max and will be removed in future releases. " + "Use std::max instead.") + +[[nodiscard]] constexpr int Max(const int theValue1, const int theValue2) { - return Val1 >= Val2 ? Val1 : Val2; + return (std::max)(theValue1, theValue2); } -// ------------------------------------------------------------------ -// Min : Returns the minimum integer between two integers -// ------------------------------------------------------------------ -constexpr Standard_Integer Min(const Standard_Integer Val1, const Standard_Integer Val2) +//! Returns the minimum value of two integers. +//! Equivalent to std::min. +Standard_DEPRECATED("This function duplicates std::min and will be removed in future releases. " + "Use std::min instead.") + +[[nodiscard]] constexpr int Min(const int theValue1, const int theValue2) { - return Val1 <= Val2 ? Val1 : Val2; + return (std::min)(theValue1, theValue2); } -// ------------------------------------------------------------------ -// Modulus : Returns the remainder of division between two integers -// ------------------------------------------------------------------ -constexpr Standard_Integer Modulus(const Standard_Integer Value, const Standard_Integer Divisor) +//! Returns the modulus of @p theValue by @p theDivisor. +[[nodiscard]] constexpr int Modulus(const int theValue, const int theDivisor) { - return Value % Divisor; + return theValue % theDivisor; } -// ------------------------------------------------------------------ -// Square : Returns the square of an integer -// ------------------------------------------------------------------ -constexpr Standard_Integer Square(const Standard_Integer Value) +//! Returns the square of a int @p theValue. +//! Note that behavior is undefined in case of overflow. +[[nodiscard]] constexpr int Square(const int theValue) { - return Value * Value; + return theValue * theValue; } -// ------------------------------------------------------------------ -// IntegerFirst : Returns the minimum value of an integer -// ------------------------------------------------------------------ -constexpr Standard_Integer IntegerFirst() +//! Returns the minimum value of an integer. +[[nodiscard]] constexpr int IntegerFirst() { return INT_MIN; } -// ------------------------------------------------------------------ -// IntegerLast : Returns the maximum value of an integer -// ------------------------------------------------------------------ -constexpr Standard_Integer IntegerLast() +//! Returns the maximum value of an integer. +[[nodiscard]] constexpr int IntegerLast() { return INT_MAX; } -// ------------------------------------------------------------------ -// IntegerSize : Returns the size in digits of an integer -// ------------------------------------------------------------------ -constexpr Standard_Integer IntegerSize() +//! Returns the size in bits of an integer. +[[nodiscard]] constexpr int IntegerSize() { - return CHAR_BIT * sizeof(Standard_Integer); + return CHAR_BIT * sizeof(int); } -#endif +#endif // _Standard_Integer_HeaderFile diff --git a/src/FoundationClasses/TKernel/Standard/Standard_Real.cxx b/src/FoundationClasses/TKernel/Standard/Standard_Real.cxx index 024e380f37..121d52d20b 100644 --- a/src/FoundationClasses/TKernel/Standard/Standard_Real.cxx +++ b/src/FoundationClasses/TKernel/Standard/Standard_Real.cxx @@ -14,340 +14,35 @@ #include #include -#include -#include -#include -static const Standard_Real ACosLimit = 1. + Epsilon(1.); +//================================================================================================== -//------------------------------------------------------------------- -// ACos : Returns the value of the arc cosine of a real -//------------------------------------------------------------------- -Standard_Real ACos(const Standard_Real Value) -{ - if ((Value < -ACosLimit) || (Value > ACosLimit)) - { - throw Standard_RangeError(); - } - else if (Value > 1.) - { - return 0.; // acos(1.) - } - else if (Value < -1.) - { - return M_PI; // acos(-1.) - } - return acos(Value); -} - -//------------------------------------------------------------------- -// ACosApprox : Returns the approximate value of the arc cosine of a real. -// The max error is about 1 degree near Value=0. -//------------------------------------------------------------------- - -inline Standard_Real apx_for_ACosApprox(const Standard_Real x) +inline double apx_for_ACosApprox(const double theValue) { return (-0.000007239283986332 - + x + + theValue * (2.000291665285952400 - + x + + theValue * (0.163910606547823220 - + x + + theValue * (0.047654245891495528 - - x * (0.005516443930088506 + 0.015098965761299077 * x))))) - / sqrt(2 * x); -} - -Standard_Real ACosApprox(const Standard_Real Value) -{ - double XX; - if (Value < 0.) - { - XX = 1. + Value; - if (XX < RealSmall()) - return 0.; - return M_PI - apx_for_ACosApprox(XX); - } - XX = 1. - Value; - if (XX < RealSmall()) - return 0.; - return apx_for_ACosApprox(XX); - - // The code above is the same but includes 2 comparisons instead of 3 - // Standard_Real xn = 1.+Value; - // Standard_Real xp = 1.-Value; - // if (xp < RealSmall() || xn < RealSmall()) - // return 0.; - // if (Value < 0.) - // return M_PI - apx_for_ACosApprox (xn); - // return apx_for_ACosApprox (xp); + - theValue + * (0.005516443930088506 + 0.015098965761299077 * theValue))))) + / sqrt(2 * theValue); } -//------------------------------------------------------------------- -// ASin : Returns the value of the arc sine of a real -//------------------------------------------------------------------- -Standard_Real ASin(const Standard_Real Value) -{ - if ((Value < -ACosLimit) || (Value > ACosLimit)) - { - throw Standard_RangeError(); - } - else if (Value > 1.) - { - return M_PI_2; // asin(1.) - } - else if (Value < -1.) - { - return -M_PI_2; // asin(-1.) - } - return asin(Value); -} +//================================================================================================== -//------------------------------------------------------------------- -// ATan2 : Returns the arc tangent of a real divide by an another real -//------------------------------------------------------------------- -Standard_Real ATan2(const Standard_Real Value, const Standard_Real Other) +double ACosApprox(const double theValue) { - if (Value == 0. && Other == 0.) + if (theValue < 0.) { - throw Standard_NullValue(); - } - return atan2(Value, Other); -} - -//------------------------------------------------------------------- -// Sign : Returns |a| if B >= 0; -|a| if b < 0. -//------------------------------------------------------------------- -Standard_Real Sign(const Standard_Real a, const Standard_Real b) -{ - if (b >= 0.0) - { - return Abs(a); + const double theX = 1. + theValue; + return theX < RealSmall() ? 0. : M_PI - apx_for_ACosApprox(theX); } else { - return (-1.0 * Abs(a)); - } -} - -//========================================================================== -//===== The special routines for "IEEE" and different hardware ============= -//========================================================================== -union RealMap { - double real; - unsigned int map[2]; -}; - -//-------------------------------------------------------------------- -// HardwareHighBitsOfDouble : -// Returns 1 if the low bits are at end. (example: decmips and ALPHA ) -// Returns 0 if the low bits are at begin. (example: sun, sgi, ...) -//-------------------------------------------------------------------- -static int HardwareHighBitsOfDouble() -{ - RealMap MaxDouble{}; - MaxDouble.real = DBL_MAX; - //========================================================= - // representation of the max double in IEEE is - // "7fef ffff ffff ffff" for the big endians. - // "ffff ffff 7fef ffff" for the little endians. - //========================================================= - - if (MaxDouble.map[1] != 0xffffffff) - { - return 1; - } - else - { - return 0; - } -} - -//-------------------------------------------------------------------- -// HardwareLowBitsOfDouble : -// Returns 0 if the low bits are at end. (example: decmips ) -// Returns 1 if the low bits are at begin. (example: sun, sgi, ...) -//-------------------------------------------------------------------- -static int HardwareLowBitsOfDouble() -{ - RealMap MaxDouble{}; - MaxDouble.real = DBL_MAX; - //========================================================= - // representation of the max double in IEEE is - // "7fef ffff ffff ffff" for the big endians. - // "ffff ffff 7fef ffff" for the little endians. - //========================================================= - - if (MaxDouble.map[1] != 0xffffffff) - { - return 0; - } - else - { - return 1; - } -} - -static const int HighBitsOfDouble = HardwareHighBitsOfDouble(); -static const int LowBitsOfDouble = HardwareLowBitsOfDouble(); - -double NextAfter(const double x, const double y) -{ - RealMap res{}; - - res.real = x; - - if (x == 0.0) - { - return DBL_MIN; - } - if (x == y) - { - //========================================= - // -oo__________0___________+oo - // x=y - // The direction is "Null", so there is nothing after - //========================================= - } - else if (((x < y) && (x >= 0.0)) || ((x > y) && (x < 0.0))) - { - //========================================= - // -oo__________0___________+oo - // y <- x x -> y - // - //========================================= - if (res.map[LowBitsOfDouble] == 0xffffffff) - { - res.map[LowBitsOfDouble] = 0; - res.map[HighBitsOfDouble]++; - } - else - { - res.map[LowBitsOfDouble]++; - } - } - else - { - //========================================= - // -oo__________0___________+oo - // x -> y y <- x - // - //========================================= - if (res.map[LowBitsOfDouble] == 0) - { - if (res.map[HighBitsOfDouble] == 0) - { - res.map[HighBitsOfDouble] = 0x80000000; - res.map[LowBitsOfDouble] = 0x00000001; - } - else - { - res.map[LowBitsOfDouble] = 0xffffffff; - res.map[HighBitsOfDouble]--; - } - } - else - { - res.map[LowBitsOfDouble]--; - } - } - return res.real; -} - -//------------------------------------------------------------------- -// ATanh : Returns the value of the hyperbolic arc tangent of a real -//------------------------------------------------------------------- -Standard_Real ATanh(const Standard_Real Value) -{ - if ((Value <= -1.) || (Value >= 1.)) - { -#ifdef OCCT_DEBUG - std::cout << "Illegal argument in ATanh" << std::endl; -#endif - throw Standard_NumericError("Illegal argument in ATanh"); - } -#if defined(__QNX__) - return std::atanh(Value); -#else - return atanh(Value); -#endif -} - -//------------------------------------------------------------------- -// ACosh : Returns the hyperbolic Arc cosine of a real -//------------------------------------------------------------------- -Standard_Real ACosh(const Standard_Real Value) -{ - if (Value < 1.) - { -#ifdef OCCT_DEBUG - std::cout << "Illegal argument in ACosh" << std::endl; -#endif - throw Standard_NumericError("Illegal argument in ACosh"); - } -#if defined(__QNX__) - return std::acosh(Value); -#else - return acosh(Value); -#endif -} - -//------------------------------------------------------------------- -// Cosh : Returns the hyperbolic cosine of a real -//------------------------------------------------------------------- -Standard_Real Cosh(const Standard_Real Value) -{ - if (Abs(Value) > 0.71047586007394394e+03) - { -#ifdef OCCT_DEBUG - std::cout << "Result of Cosh exceeds the maximum value Standard_Real" << std::endl; -#endif - throw Standard_NumericError("Result of Cosh exceeds the maximum value Standard_Real"); - } - return cosh(Value); -} - -//------------------------------------------------------------------- -// Sinh : Returns the hyperbolicsine of a real -//------------------------------------------------------------------- -Standard_Real Sinh(const Standard_Real Value) -{ - if (Abs(Value) > 0.71047586007394394e+03) - { -#ifdef OCCT_DEBUG - std::cout << "Result of Sinh exceeds the maximum value Standard_Real" << std::endl; -#endif - throw Standard_NumericError("Result of Sinh exceeds the maximum value Standard_Real"); - } - return sinh(Value); -} - -//------------------------------------------------------------------- -// Log : Returns the naturaOPl logarithm of a real -//------------------------------------------------------------------- -Standard_Real Log(const Standard_Real Value) -{ - if (Value <= 0.) - { -#ifdef OCCT_DEBUG - std::cout << "Illegal argument in Log" << std::endl; -#endif - throw Standard_NumericError("Illegal argument in Log"); - } - return log(Value); -} - -//------------------------------------------------------------------- -// Sqrt : Returns the square root of a real -//------------------------------------------------------------------- -Standard_Real Sqrt(const Standard_Real Value) -{ - if (Value < 0.) - { -#ifdef OCCT_DEBUG - std::cout << "Illegal argument in Sqrt" << std::endl; -#endif - throw Standard_NumericError("Illegal argument in Sqrt"); + const double theX = 1. - theValue; + return theX < RealSmall() ? 0. : apx_for_ACosApprox(theX); } - return sqrt(Value); } diff --git a/src/FoundationClasses/TKernel/Standard/Standard_Real.hxx b/src/FoundationClasses/TKernel/Standard/Standard_Real.hxx index 981c8e36c2..caba059587 100644 --- a/src/FoundationClasses/TKernel/Standard/Standard_Real.hxx +++ b/src/FoundationClasses/TKernel/Standard/Standard_Real.hxx @@ -15,6 +15,7 @@ #ifndef _Standard_Real_HeaderFile #define _Standard_Real_HeaderFile +#include #include #include #include @@ -28,335 +29,390 @@ #include -// =============================================== -// Methods from Standard_Entity class which are redefined: -// - Hascode -// - IsEqual -// =============================================== - -// ================================== -// Methods implemented in Standard_Real.cxx -// ================================== - -Standard_EXPORT Standard_Real ACos(const Standard_Real); -Standard_EXPORT Standard_Real ACosApprox(const Standard_Real); -Standard_EXPORT Standard_Real ASin(const Standard_Real); -Standard_EXPORT Standard_Real ATan2(const Standard_Real, const Standard_Real); -Standard_EXPORT Standard_Real NextAfter(const Standard_Real, const Standard_Real); - -//! Returns |a| if b >= 0; -|a| if b < 0. -Standard_EXPORT Standard_Real Sign(const Standard_Real a, const Standard_Real b); - -Standard_EXPORT Standard_Real ATanh(const Standard_Real); -Standard_EXPORT Standard_Real ACosh(const Standard_Real); -Standard_EXPORT Standard_Real Sinh(const Standard_Real); -Standard_EXPORT Standard_Real Cosh(const Standard_Real); -Standard_EXPORT Standard_Real Log(const Standard_Real); -Standard_EXPORT Standard_Real Sqrt(const Standard_Real); - -//------------------------------------------------------------------- -// RealSmall : Returns the smallest positive real -//------------------------------------------------------------------- -constexpr Standard_Real RealSmall() +//! Returns the value of the arc cosine of a @p theValue. +Standard_DEPRECATED("This function duplicates std::acos and will be removed in future releases. " + "Use std::acos instead.") + +[[nodiscard]] inline double ACos(const double theValue) { - return DBL_MIN; + return std::acos(theValue); +} + +//! Returns the approximate value of the arc cosine @p theValue. +//! The max error is about 1 degree near Value=0. +//! NOTE: Avoid using this function in new code, it presumably slower then std::acos. +Standard_DEPRECATED("Deprecated, use std::acos instead") +Standard_EXPORT [[nodiscard]] double ACosApprox(const double theValue); + +//! Returns the value of the arc sine of a @p theValue. +Standard_DEPRECATED("This function duplicates std::asin and will be removed in future releases. " + "Use std::asin instead.") + +[[nodiscard]] inline double ASin(const double theValue) +{ + return std::asin(theValue); +} + +//! Computes the arc tangent of @p theX divided by @p theY using the signs of both +//! arguments to determine the quadrant of the return value. +Standard_DEPRECATED("This function duplicates std::atan2 and will be removed in future releases. " + "Use std::atan2 instead.") + +[[nodiscard]] inline double ATan2(const double theX, const double theY) +{ + return std::atan2(theX, theY); +} + +//! Returns the value of the hyperbolic arc tangent of @p theValue. +Standard_DEPRECATED("This function duplicates std::atanh and will be removed in future releases. " + "Use std::atanh instead.") + +[[nodiscard]] inline double ATanh(const double theValue) +{ + return std::atanh(theValue); +} + +//! Returns the value of the hyperbolic arc cosine of @p theValue. +Standard_DEPRECATED("This function duplicates std::acosh and will be removed in future releases. " + "Use std::acosh instead.") + +[[nodiscard]] inline double ACosh(const double theValue) +{ + return std::acosh(theValue); } -//------------------------------------------------------------------- -// Abs : Returns the absolute value of a real -//------------------------------------------------------------------- -inline Standard_Real Abs(const Standard_Real Value) +//! Returns the hyperbolic cosine of a double @p theValue. +Standard_DEPRECATED("This function duplicates std::cosh and will be removed in future releases. " + "Use std::cosh instead.") + +[[nodiscard]] inline double Cosh(const double theValue) { - return fabs(Value); + return std::cosh(theValue); } -//------------------------------------------------------------------- -// IsEqual : Returns Standard_True if two reals are equal -//------------------------------------------------------------------- -inline Standard_Boolean IsEqual(const Standard_Real Value1, const Standard_Real Value2) +//! Returns the hyperbolic sine of a double @p theValue. +Standard_DEPRECATED("This function duplicates std::sinh and will be removed in future releases. " + "Use std::sinh instead.") + +[[nodiscard]] inline double Sinh(const double theValue) { - return Abs((Value1 - Value2)) < RealSmall(); + return std::sinh(theValue); } -// *********************************** // -// Class methods // -// // -// Machine-dependent values // -// Should be taken from include file // -// *********************************** // +//! Computes the natural (base-e) logarithm of number @p theValue. +Standard_DEPRECATED("This function duplicates std::log and will be removed in future releases. " + "Use std::log instead.") -//------------------------------------------------------------------- -// RealDigit : Returns the number of digits of precision in a real -//------------------------------------------------------------------- -constexpr Standard_Integer RealDigits() +[[nodiscard]] inline double Log(const double theValue) +{ + return std::log(theValue); +} + +//! Returns the square root of a double @p theValue. +Standard_DEPRECATED("This function duplicates std::sqrt and will be removed in future releases. " + "Use std::sqrt instead.") + +[[nodiscard]] inline double Sqrt(const double theValue) +{ + return std::sqrt(theValue); +} + +//! Returns the next representable value of a double @p theValue +//! in the direction of @p theDirection. Equivalent to std::nextafter. +Standard_DEPRECATED( + "This function duplicates std::nextafter and will be removed in future releases. " + "Use std::nextafter instead.") + +[[nodiscard]] inline double NextAfter(const double theValue, const double theDirection) +{ + return std::nextafter(theValue, theDirection); +} + +//! Composes a floating point value with the magnitude of @p theMagnitude +//! and the sign of @p theSign. Equivalent to std::copysign. +Standard_DEPRECATED( + "This function duplicates std::copysign and will be removed in future releases. " + "Use std::copysign instead.") + +[[nodiscard]] inline double Sign(const double theMagnitude, const double theSign) +{ + return std::copysign(theMagnitude, theSign); +} + +//! Returns the minimum positive double value greater than zero. +[[nodiscard]] constexpr double RealSmall() +{ + return DBL_MIN; +} + +//! Returns the absolute value of a double @p Value. +//! Equivalent to std::abs. +Standard_DEPRECATED("This function duplicates std::abs and will be removed in future releases. " + "Use std::abs instead.") + +[[nodiscard]] inline double Abs(const double theValue) +{ + return std::abs(theValue); +} + +//! Returns Standard_True if two doubles are equal within the precision +//! defined by RealSmall(). +[[nodiscard]] inline bool IsEqual(const double theValue1, const double theValue2) +{ + return std::abs(theValue1 - theValue2) < RealSmall(); +} + +//! Returns the number of digits of precision in a double. +[[nodiscard]] constexpr int RealDigits() { return DBL_DIG; } -//------------------------------------------------------------------- -// RealEpsilon : Returns the minimum positive real such that -// 1.0 + x is not equal to 1.0 -//------------------------------------------------------------------- -constexpr Standard_Real RealEpsilon() +//! Returns the minimum positive double such that +//! 1.0 + RealEpsilon() != 1.0. +[[nodiscard]] constexpr double RealEpsilon() { return DBL_EPSILON; } -//------------------------------------------------------------------- -// RealFirst : Returns the minimum negative value of a real -//------------------------------------------------------------------- -constexpr Standard_Real RealFirst() +//! Returns the minimum value of a double. +[[nodiscard]] constexpr double RealFirst() { return -DBL_MAX; } -//------------------------------------------------------------------- -// RealFirst10Exp : Returns the minimum value of exponent(base 10) of -// a real. -//------------------------------------------------------------------- -constexpr Standard_Integer RealFirst10Exp() +//! Returns the minimum value of exponent(base 10) of a double. +[[nodiscard]] constexpr int RealFirst10Exp() { return DBL_MIN_10_EXP; } -//------------------------------------------------------------------- -// RealLast : Returns the maximum value of a real -//------------------------------------------------------------------- -constexpr Standard_Real RealLast() +//! Returns the maximum value of a double. +[[nodiscard]] constexpr double RealLast() { return DBL_MAX; } -//------------------------------------------------------------------- -// RealLast10Exp : Returns the maximum value of exponent(base 10) of -// a real. -//------------------------------------------------------------------- -constexpr Standard_Integer RealLast10Exp() +//! Returns the maximum value of exponent(base 10) of a double. +[[nodiscard]] constexpr int RealLast10Exp() { return DBL_MAX_10_EXP; } -//------------------------------------------------------------------- -// RealMantissa : Returns the size in bits of the matissa part of a -// real. -//------------------------------------------------------------------- -constexpr Standard_Integer RealMantissa() +//! Returns the size in bits of the mantissa part of a double. +[[nodiscard]] constexpr int RealMantissa() { return DBL_MANT_DIG; } -//------------------------------------------------------------------- -// RealRadix : Returns the radix of exponent representation -//------------------------------------------------------------------- -constexpr Standard_Integer RealRadix() +//! Returns the radix of a double. +[[nodiscard]] constexpr int RealRadix() { return FLT_RADIX; } -//------------------------------------------------------------------- -// RealSize : Returns the size in bits of an integer -//------------------------------------------------------------------- -constexpr Standard_Integer RealSize() +//! Returns the size in bits of a double. +[[nodiscard]] constexpr int RealSize() { - return CHAR_BIT * sizeof(Standard_Real); + return CHAR_BIT * sizeof(double); } -//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// -// End of machine-dependent values // -//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// - -//------------------------------------------------------------------- -// IntToReal : Converts an integer in a real -//------------------------------------------------------------------- -inline Standard_Real IntToReal(const Standard_Integer Value) +//! Converts a int @p theValue to a double. +[[nodiscard]] constexpr double IntToReal(const int theValue) { - return Value; + return theValue; } -//------------------------------------------------------------------- -// ATan : Returns the value of the arc tangent of a real -//------------------------------------------------------------------- -inline Standard_Real ATan(const Standard_Real Value) +//! Returns the value of the arc tangent of a double @p theValue. +Standard_DEPRECATED("This function duplicates std::atan and will be removed in future releases. " + "Use std::atan instead.") + +[[nodiscard]] inline double ATan(const double theValue) { - return atan(Value); + return std::atan(theValue); } -//------------------------------------------------------------------- -// Ceiling : Returns the smallest integer not less than a real -//------------------------------------------------------------------- -inline Standard_Real Ceiling(const Standard_Real Value) +//! Returns the next integer greater than or equal to a double @p theValue. +Standard_DEPRECATED("This function duplicates std::ceil and will be removed in future releases. " + "Use std::ceil instead.") + +[[nodiscard]] inline double Ceiling(const double theValue) { - return ceil(Value); + return std::ceil(theValue); } -//------------------------------------------------------------------- -// Cos : Returns the cosine of a real -//------------------------------------------------------------------- -inline Standard_Real Cos(const Standard_Real Value) +//! Returns the cosine of a double @p theValue. +//! Equivalent to std::cos. +Standard_DEPRECATED("This function duplicates std::cos and will be removed in future releases. " + "Use std::cos instead.") + +[[nodiscard]] inline double Cos(const double theValue) { - return cos(Value); + return std::cos(theValue); } -//------------------------------------------------------------------- -// Epsilon : The function returns absolute value of difference -// between 'Value' and other nearest value of -// Standard_Real type. -// Nearest value is chosen in direction of infinity -// the same sign as 'Value'. -// If 'Value' is 0 then returns minimal positive value -// of Standard_Real type. -//------------------------------------------------------------------- -inline Standard_Real Epsilon(const Standard_Real Value) +//! The function returns absolute value of difference between @p theValue and other nearest value of +//! double type. Nearest value is chosen in direction of infinity the same sign as @p theValue. +//! If @p theValue is 0 then returns minimal positive value of double type. +[[nodiscard]] inline double Epsilon(const double theValue) { - return Value >= 0.0 ? (NextAfter(Value, RealLast()) - Value) - : (Value - NextAfter(Value, RealFirst())); + return theValue >= 0.0 ? (std::nextafter(theValue, RealLast()) - theValue) + : (theValue - std::nextafter(theValue, RealFirst())); } -//------------------------------------------------------------------- -// Exp : Returns the exponential function of a real -//------------------------------------------------------------------- -inline Standard_Real Exp(const Standard_Real Value) +//! Returns the exponential of a double @p theValue. +//! Equivalent to std::exp. +Standard_DEPRECATED("This function duplicates std::exp and will be removed in future releases. " + "Use std::exp instead.") + +[[nodiscard]] inline double Exp(const double theValue) { - return exp(Value); + return std::exp(theValue); } -//------------------------------------------------------------------- -// Floor : Return the largest integer not greater than a real -//------------------------------------------------------------------- -inline Standard_Real Floor(const Standard_Real Value) +//! Returns the nearest integer less than or equal to a double @p theValue. +//! Equivalent to std::floor. +Standard_DEPRECATED("This function duplicates std::floor and will be removed in future releases. " + "Use std::floor instead.") + +[[nodiscard]] inline double Floor(const double theValue) { - return floor(Value); + return std::floor(theValue); } -//------------------------------------------------------------------- -// IntegerPart : Returns the integer part of a real -//------------------------------------------------------------------- -inline Standard_Real IntegerPart(const Standard_Real Value) +//! Returns the integer part of a double @p theValue. +//! Equivalent to std::trunc. +Standard_DEPRECATED("This function duplicates std::trunc and will be removed in future releases. " + "Use std::trunc instead.") + +[[nodiscard]] inline double IntegerPart(const double theValue) { - return ((Value > 0) ? floor(Value) : ceil(Value)); + return std::trunc(theValue); } -//------------------------------------------------------------------- -// Log10 : Returns the base-10 logarithm of a real -//------------------------------------------------------------------- -inline Standard_Real Log10(const Standard_Real Value) +//! Returns the logarithm to base 10 of a double @p theValue. +//! Equivalent to std::log10. +Standard_DEPRECATED("This function duplicates std::log10 and will be removed in future releases. " + "Use std::log10 instead.") + +[[nodiscard]] inline double Log10(const double theValue) { - return log10(Value); + return std::log10(theValue); } -//------------------------------------------------------------------- -// Max : Returns the maximum value of two reals -//------------------------------------------------------------------- -constexpr Standard_Real Max(const Standard_Real Val1, const Standard_Real Val2) +//! Returns the maximum value of two doubles. +//! Equivalent to std::max. +Standard_DEPRECATED("This function duplicates std::max and will be removed in future releases. " + "Use std::max instead.") + +[[nodiscard]] constexpr double Max(const double theValue1, const double theValue2) { - return Val1 >= Val2 ? Val1 : Val2; + return (std::max)(theValue1, theValue2); } -//------------------------------------------------------------------- -// Min : Returns the minimum value of two reals -//------------------------------------------------------------------- -constexpr Standard_Real Min(const Standard_Real Val1, const Standard_Real Val2) +//! Returns the minimum value of two doubles. +//! Equivalent to std::min. +Standard_DEPRECATED("This function duplicates std::min and will be removed in future releases. " + "Use std::min instead.") + +[[nodiscard]] constexpr double Min(const double theValue1, const double theValue2) { - return Val1 <= Val2 ? Val1 : Val2; + return (std::min)(theValue1, theValue2); } -//------------------------------------------------------------------- -// Pow : Returns a real to a given power -//------------------------------------------------------------------- -inline Standard_Real Pow(const Standard_Real Value, const Standard_Real P) +//! Returns a double @p theValue raised to the power of @p thePower. +Standard_DEPRECATED("This function duplicates std::pow and will be removed in future releases. " + "Use std::pow instead.") + +[[nodiscard]] inline double Pow(const double theValue, const double thePower) { - return pow(Value, P); + return std::pow(theValue, thePower); } -//------------------------------------------------------------------- -// RealPart : Returns the fractional part of a real. -//------------------------------------------------------------------- -inline Standard_Real RealPart(const Standard_Real Value) +//! Returns the fractional part of a double @p theValue. +//! Always non-negative. +[[nodiscard]] inline double RealPart(const double theValue) { - return fabs(IntegerPart(Value) - Value); + return std::abs(std::trunc(theValue) - theValue); } -//------------------------------------------------------------------- -// RealToInt : Returns the real converted to nearest valid integer. -// If input value is out of valid range for integers, -// minimal or maximal possible integer is returned. -//------------------------------------------------------------------- -constexpr Standard_Integer RealToInt(const Standard_Real theValue) +//! Converts a double @p theValue to the nearest valid int. +//! If input value is out of valid range for int, minimal or maximal possible int is returned. +[[nodiscard]] constexpr int RealToInt(const double theValue) { // Note that on WNT under MS VC++ 8.0 conversion of double value less // than INT_MIN or greater than INT_MAX to integer will cause signal // "Floating point multiple trap" (OCC17861) - return theValue < static_cast(INT_MIN) - ? static_cast(INT_MIN) - : (theValue > static_cast(INT_MAX) - ? static_cast(INT_MAX) - : static_cast(theValue)); + return theValue < static_cast(INT_MIN) + ? static_cast(INT_MIN) + : (theValue > static_cast(INT_MAX) ? static_cast(INT_MAX) + : static_cast(theValue)); } -// ======================================================================= -// function : RealToShortReal -// purpose : Converts Standard_Real value to the nearest valid -// Standard_ShortReal. If input value is out of valid range -// for Standard_ShortReal, minimal or maximal -// Standard_ShortReal is returned. -// ======================================================================= -constexpr Standard_ShortReal RealToShortReal(const Standard_Real theVal) +//! Converts a double @p theValue to the nearest valid float. +//! If input value is out of valid range for float, minimal or maximal +//! possible float is returned. +[[nodiscard]] constexpr float RealToShortReal(const double theValue) { - return theVal < -FLT_MAX ? -FLT_MAX : theVal > FLT_MAX ? FLT_MAX : (Standard_ShortReal)theVal; + return theValue < -FLT_MAX ? -FLT_MAX + : theValue > FLT_MAX ? FLT_MAX + : static_cast(theValue); } -//------------------------------------------------------------------- -// Round : Returns the nearest integer of a real -//------------------------------------------------------------------- -inline Standard_Real Round(const Standard_Real Value) -{ - return IntegerPart(Value + (Value > 0 ? 0.5 : -0.5)); -} +//! Returns the nearest integer of a double @p theValue. +//! Equivalent to std::round. +Standard_DEPRECATED("This function duplicates std::round and will be removed in future releases. " + "Use std::round instead.") -//------------------------------------------------------------------- -// Sin : Returns the sine of a real -//------------------------------------------------------------------- -inline Standard_Real Sin(const Standard_Real Value) +[[nodiscard]] inline double Round(const double theValue) { - return sin(Value); + return std::round(theValue); } -//------------------------------------------------------------------- -// ASinh : Returns the hyperbolic arc sine of a real -//------------------------------------------------------------------- -inline Standard_Real ASinh(const Standard_Real Value) -#if defined(__QNX__) +//! Returns the sine of a double @p theValue. +//! Equivalent to std::sin. +Standard_DEPRECATED("This function duplicates std::sin and will be removed in future releases. " + "Use std::sin instead.") + +[[nodiscard]] inline double Sin(const double theValue) { - return std::asinh(Value); + return std::sin(theValue); } -#else + +//! Returns the hyperbolic arc sine of a double @p theValue. +//! Equivalent to std::asinh. +Standard_DEPRECATED("This function duplicates std::asinh and will be removed in future releases. " + "Use std::asinh instead.") + +[[nodiscard]] inline double ASinh(const double theValue) { - return asinh(Value); + return std::asinh(theValue); } -#endif -//------------------------------------------------------------------- -// Square : Returns a real to the power 2 -//------------------------------------------------------------------- -constexpr Standard_Real Square(const Standard_Real Value) +//! Returns the square of a double @p theValue. +[[nodiscard]] constexpr double Square(const double theValue) { - return Value * Value; + return theValue * theValue; } -//------------------------------------------------------------------- -// Tan : Returns the tangent of a real -//------------------------------------------------------------------- -inline Standard_Real Tan(const Standard_Real Value) +//! Returns the tangent of a double @p theValue. +//! Equivalent to std::tan. +Standard_DEPRECATED("This function duplicates std::tan and will be removed in future releases. " + "Use std::tan instead.") + +[[nodiscard]] inline double Tan(const double theValue) { - return tan(Value); + return std::tan(theValue); } -//------------------------------------------------------------------- -// Tanh : Returns the hyperbolic tangent of a real -//------------------------------------------------------------------- -inline Standard_Real Tanh(const Standard_Real Value) +//! Returns the hyperbolic tangent of a double @p theValue. +//! Equivalent to std::tanh. +Standard_DEPRECATED("This function duplicates std::tanh and will be removed in future releases. " + "Use std::tanh instead.") + +[[nodiscard]] inline double Tanh(const double theValue) { - return tanh(Value); + return std::tanh(theValue); } -#endif +#endif // _Standard_Real_HeaderFile diff --git a/src/FoundationClasses/TKernel/Standard/Standard_ShortReal.hxx b/src/FoundationClasses/TKernel/Standard/Standard_ShortReal.hxx index 709a3585e7..28915cdc37 100644 --- a/src/FoundationClasses/TKernel/Standard/Standard_ShortReal.hxx +++ b/src/FoundationClasses/TKernel/Standard/Standard_ShortReal.hxx @@ -15,131 +15,101 @@ #ifndef _Standard_ShortReal_HeaderFile #define _Standard_ShortReal_HeaderFile +#include #include #include #include #include -// *********************************** // -// Class methods // -// // -// Machine-dependent values // -// Should be taken from include file // -// *********************************** // - -//------------------------------------------------------------------- -// ShortRealSmall : Returns the smallest positive ShortReal -//------------------------------------------------------------------- -constexpr Standard_ShortReal ShortRealSmall() +//! Returns the minimum positive float value. +[[nodiscard]] constexpr float ShortRealSmall() { return FLT_MIN; } -//------------------------------------------------------------------- -// Abs : Returns the absolute value of a ShortReal -//------------------------------------------------------------------- -inline Standard_ShortReal Abs(const Standard_ShortReal Value) -#if defined(__alpha) || defined(DECOSF1) -{ - return fabsf(Value); -} -#else +//! Returns the absolute value of a float @p Value. +//! Equivalent to std::abs. +Standard_DEPRECATED("This function duplicates std::abs and will be removed in future releases. " + "Use std::abs instead.") + +[[nodiscard]] inline float Abs(const float theValue) { - return float(fabs(Value)); + return std::abs(theValue); } -#endif -//------------------------------------------------------------------- -// ShortRealDigit : Returns the number of digits of precision in a ShortReal -//------------------------------------------------------------------- -constexpr Standard_Integer ShortRealDigits() +//! Returns the number of digits of precision in a float. +[[nodiscard]] constexpr int ShortRealDigits() { return FLT_DIG; } -//------------------------------------------------------------------- -// ShortRealEpsilon : Returns the minimum positive ShortReal such that -// 1.0 + x is not equal to 1.0 -//------------------------------------------------------------------- -constexpr Standard_ShortReal ShortRealEpsilon() +//! Returns the minimum positive float such that 1.0f + ShortRealEpsilon() != 1.0f. +[[nodiscard]] constexpr float ShortRealEpsilon() { return FLT_EPSILON; } -//------------------------------------------------------------------- -// ShortRealFirst : Returns the minimum negative value of a ShortReal -//------------------------------------------------------------------- -constexpr Standard_ShortReal ShortRealFirst() +//! Returns the minimum negative value of a float. +[[nodiscard]] constexpr float ShortRealFirst() { return -FLT_MAX; } -//------------------------------------------------------------------- -// ShortRealFirst10Exp : Returns the minimum value of exponent(base 10) of -// a ShortReal. -//------------------------------------------------------------------- -constexpr Standard_Integer ShortRealFirst10Exp() +//! Returns the minimum value of exponent(base 10) of a float. +[[nodiscard]] constexpr int ShortRealFirst10Exp() { return FLT_MIN_10_EXP; } -//------------------------------------------------------------------- -// ShortRealLast : Returns the maximum value of a ShortReal -//------------------------------------------------------------------- -constexpr Standard_ShortReal ShortRealLast() +//! Returns the maximum value of a float. +[[nodiscard]] constexpr float ShortRealLast() { return FLT_MAX; } -//------------------------------------------------------------------- -// ShortRealLast10Exp : Returns the maximum value of exponent(base 10) of -// a ShortReal. -//------------------------------------------------------------------- -constexpr Standard_Integer ShortRealLast10Exp() +//! Returns the maximum value of exponent(base 10) of a float. +[[nodiscard]] constexpr int ShortRealLast10Exp() { return FLT_MAX_10_EXP; } -//------------------------------------------------------------------- -// ShortRealMantissa : Returns the size in bits of the matissa part of a -// ShortReal. -//------------------------------------------------------------------- -constexpr Standard_Integer ShortRealMantissa() +//! Returns the mantissa (number of bits in the significand) of a float. +[[nodiscard]] constexpr int ShortRealMantissa() { return FLT_MANT_DIG; } -//------------------------------------------------------------------- -// ShortRealRadix : Returns the radix of exponent representation -//------------------------------------------------------------------- -constexpr Standard_Integer ShortRealRadix() +//! Returns the radix (base) of a float. +[[nodiscard]] constexpr int ShortRealRadix() { return FLT_RADIX; } -//------------------------------------------------------------------- -// ShortRealSize : Returns the size in bits of an integer -//------------------------------------------------------------------- -constexpr Standard_Integer ShortRealSize() +//! Returns the size in bits of a float. +[[nodiscard]] constexpr int ShortRealSize() { - return CHAR_BIT * sizeof(Standard_ShortReal); + return CHAR_BIT * sizeof(float); } -//------------------------------------------------------------------- -// Max : Returns the maximum value of two ShortReals -//------------------------------------------------------------------- -constexpr Standard_ShortReal Max(const Standard_ShortReal Val1, const Standard_ShortReal Val2) +//! Returns the maximum value of two floats. +//! Equivalent to std::max. +Standard_DEPRECATED("This function duplicates std::max and will be removed in future releases. " + "Use std::max instead.") + +[[nodiscard]] constexpr float Max(const float theValue1, const float theValue2) { - return Val1 >= Val2 ? Val1 : Val2; + return (std::max)(theValue1, theValue2); } -//------------------------------------------------------------------- -// Min : Returns the minimum value of two ShortReals -//------------------------------------------------------------------- -constexpr Standard_ShortReal Min(const Standard_ShortReal Val1, const Standard_ShortReal Val2) +//! Returns the minimum value of two floats. +//! Equivalent to std::min. +Standard_DEPRECATED("This function duplicates std::min and will be removed in future releases. " + "Use std::min instead.") + +[[nodiscard]] constexpr float Min(const float theValue1, const float theValue2) { - return Val1 <= Val2 ? Val1 : Val2; + return (std::min)(theValue1, theValue2); } -#endif +#endif // _Standard_ShortReal_HeaderFile diff --git a/src/FoundationClasses/TKernel/UnitsMethods/UnitsMethods.cxx b/src/FoundationClasses/TKernel/UnitsMethods/UnitsMethods.cxx index 509a81d673..2c16795ec4 100644 --- a/src/FoundationClasses/TKernel/UnitsMethods/UnitsMethods.cxx +++ b/src/FoundationClasses/TKernel/UnitsMethods/UnitsMethods.cxx @@ -91,43 +91,43 @@ UnitsMethods_LengthUnit UnitsMethods::GetLengthUnitByFactorValue( const Standard_Real aPreci = 1.e-6; const Standard_Real aValue = theFactorValue * GetLengthUnitScale(theBaseUnit, UnitsMethods_LengthUnit_Millimeter); - if (Abs(1. - aValue) < aPreci) + if (std::abs(1. - aValue) < aPreci) { return UnitsMethods_LengthUnit_Millimeter; } - else if (Abs(25.4 - aValue) < aPreci) + else if (std::abs(25.4 - aValue) < aPreci) { return UnitsMethods_LengthUnit_Inch; } - else if (Abs(304.8 - aValue) < aPreci) + else if (std::abs(304.8 - aValue) < aPreci) { return UnitsMethods_LengthUnit_Foot; } - else if (Abs(1609344. - aValue) < aPreci) + else if (std::abs(1609344. - aValue) < aPreci) { return UnitsMethods_LengthUnit_Mile; } - else if (Abs(1000. - aValue) < aPreci) + else if (std::abs(1000. - aValue) < aPreci) { return UnitsMethods_LengthUnit_Meter; } - else if (Abs(1000000. - aValue) < aPreci) + else if (std::abs(1000000. - aValue) < aPreci) { return UnitsMethods_LengthUnit_Kilometer; } - else if (Abs(0.0254 - aValue) < aPreci) + else if (std::abs(0.0254 - aValue) < aPreci) { return UnitsMethods_LengthUnit_Mil; } - else if (Abs(0.001 - aValue) < aPreci) + else if (std::abs(0.001 - aValue) < aPreci) { return UnitsMethods_LengthUnit_Micron; } - else if (Abs(10. - aValue) < aPreci) + else if (std::abs(10. - aValue) < aPreci) { return UnitsMethods_LengthUnit_Centimeter; } - else if (Abs(0.0000254 - aValue) < aPreci) + else if (std::abs(0.0000254 - aValue) < aPreci) { return UnitsMethods_LengthUnit_Microinch; } diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_BOP.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_BOP.cxx index c3cab3efd4..c75833e8bd 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_BOP.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_BOP.cxx @@ -693,7 +693,7 @@ void BOPAlgo_BOP::BuildRC(const Message_ProgressRange& theRange) // Standard_Integer iDimMin, iDimMax; // - iDimMin = Min(myDims[0], myDims[1]); + iDimMin = std::min(myDims[0], myDims[1]); bCommon = (myOperation == BOPAlgo_COMMON); bCut21 = (myOperation == BOPAlgo_CUT21); // diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_MakePeriodic.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_MakePeriodic.cxx index 8beedf589a..1487c09f48 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_MakePeriodic.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_MakePeriodic.cxx @@ -471,7 +471,7 @@ const TopoDS_Shape& BOPAlgo_MakePeriodic::RepeatShape(const Standard_Integer the } // Create translated copies of the shape - for (Standard_Integer i = 1; i <= Abs(theTimes); ++i) + for (Standard_Integer i = 1; i <= std::abs(theTimes); ++i) { gp_Trsf aTrsf; aTrsf.SetTranslationPart(iDir * i * aPeriod * MY_DIRECTIONS[id]); @@ -515,7 +515,7 @@ const TopoDS_Shape& BOPAlgo_MakePeriodic::RepeatShape(const Standard_Integer the myRepeatedShape = aGluer.Shape(); // Update repetition period for the next repetitions - myRepeatPeriod[id] += Abs(theTimes) * myRepeatPeriod[id]; + myRepeatPeriod[id] += std::abs(theTimes) * myRepeatPeriod[id]; // Update history with the Gluing history BRepTools_History aGluingHistory(aShapes, aGluer); diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_MakePeriodic.hxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_MakePeriodic.hxx index 5a34101d84..44d9f743ce 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_MakePeriodic.hxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_MakePeriodic.hxx @@ -460,7 +460,7 @@ public: //! @name Conversion of the integer to ID of periodic direction //! Converts the integer to ID of periodic direction static Standard_Integer ToDirectionID(const Standard_Integer theDirectionID) { - return Abs(theDirectionID % 3); + return std::abs(theDirectionID % 3); } protected: //! @name Protected methods performing the operation diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Options.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Options.cxx index b73ac4f875..74f19cfd24 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Options.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Options.cxx @@ -102,7 +102,7 @@ Standard_Boolean BOPAlgo_Options::GetParallelMode() void BOPAlgo_Options::SetFuzzyValue(const Standard_Real theFuzz) { - myFuzzyValue = Max(theFuzz, Precision::Confusion()); + myFuzzyValue = std::max(theFuzz, Precision::Confusion()); } Standard_Boolean BOPAlgo_Options::UserBreak(const Message_ProgressScope& thePS) diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_10.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_10.cxx index e81dc5479d..028f58a76d 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_10.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_10.cxx @@ -128,7 +128,7 @@ Standard_Integer BOPAlgo_PaveFiller::UpdateVertex(const Standard_Integer nV, // create new vertex TopoDS_Vertex aVNew; gp_Pnt aPV = BRep_Tool::Pnt(aV); - aBB.MakeVertex(aVNew, aPV, Max(aTolV, aTolNew)); + aBB.MakeVertex(aVNew, aPV, std::max(aTolV, aTolNew)); // // append new vertex to DS BOPDS_ShapeInfo aSIV; diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_3.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_3.cxx index 70a61a6282..bdc51019f3 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_3.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_3.cxx @@ -1068,7 +1068,8 @@ void BOPAlgo_PaveFiller::ForceInterfEE(const Message_ProgressRange& theRange) // intersections only, so use only the real tolerance of edges, // no need to use the extended tolerance. Standard_Real aTolAdd = - (bSICheckMode ? myFuzzyValue : 2 * Max(BRep_Tool::Tolerance(aV1), BRep_Tool::Tolerance(aV2))); + (bSICheckMode ? myFuzzyValue + : 2 * std::max(BRep_Tool::Tolerance(aV1), BRep_Tool::Tolerance(aV2))); // All possible pairs combined from the list should be checked BOPDS_ListIteratorOfListOfPaveBlock aItLPB1(aLPB); @@ -1140,7 +1141,7 @@ void BOPAlgo_PaveFiller::ForceInterfEE(const Message_ProgressRange& theRange) // The angle should be close to zero Standard_Real aCos = aVTgt1.Dot(aVTgt2.Normalized()); - if (Abs(aCos) < 0.9063) + if (std::abs(aCos) < 0.9063) bUseAddTol = Standard_False; } } diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_5.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_5.cxx index 2f6cee3b55..4411e6a35b 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_5.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_5.cxx @@ -481,7 +481,7 @@ void BOPAlgo_PaveFiller::PerformEF(const Message_ProgressRange& theRange) Standard_Real aMaxDist = 1.e4 * aTol; if (aTol < .01) { - aMaxDist = Min(aMaxDist, 0.1); + aMaxDist = std::min(aMaxDist, 0.1); } if (aDistPP < aMaxDist) { @@ -499,14 +499,14 @@ void BOPAlgo_PaveFiller::PerformEF(const Message_ProgressRange& theRange) } // Standard_Real aTolVnew = BRep_Tool::Tolerance(aVnew); - aTolVnew = Max(aTolVnew, Max(aTolE, aTolF)); + aTolVnew = std::max(aTolVnew, std::max(aTolE, aTolF)); BRep_Builder().UpdateVertex(aVnew, aTolVnew); if (bLinePlane) { // increase tolerance for Line/Plane intersection, but do not update // the vertex till its intersection with some other shape IntTools_Range aCR = aCPart.Range1(); - aTolVnew = Max(aTolVnew, (aCR.Last() - aCR.First()) / 2.); + aTolVnew = std::max(aTolVnew, (aCR.Last() - aCR.First()) / 2.); } // const gp_Pnt& aPnew = BRep_Tool::Pnt(aVnew); @@ -984,7 +984,7 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB // no need to use the extended tolerance. Standard_Real aTolCheck = (bSICheckMode ? myFuzzyValue - : 2 * Max(BRep_Tool::Tolerance(aV1), BRep_Tool::Tolerance(aV2))); + : 2 * std::max(BRep_Tool::Tolerance(aV1), BRep_Tool::Tolerance(aV2))); if (aProjPS.LowerDistance() > aTolCheck + myFuzzyValue) continue; @@ -1003,7 +1003,7 @@ void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB // Angle between vectors should be close to 90 degrees. // We allow deviation of 25 degrees. Standard_Real aCos = aVFNorm.Normalized().Dot(aVETgt.Normalized()); - if (Abs(aCos) > 0.4226) + if (std::abs(aCos) > 0.4226) bUseAddTol = Standard_False; } } diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_6.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_6.cxx index fe3e05a30a..f46963026c 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_6.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_6.cxx @@ -497,7 +497,7 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange) aFaceFace.SetFaces(aFShifted1, aFShifted2); aFaceFace.SetBoxes(myDS->ShapeInfo(nF1).Box(), myDS->ShapeInfo(nF2).Box()); // Note: in case of faces with closed edges it should not be less than value of the shift - Standard_Real aTolFF = Max(aShiftValue, ToleranceFF(aBAS1, aBAS2)); + Standard_Real aTolFF = std::max(aShiftValue, ToleranceFF(aBAS1, aBAS2)); aFaceFace.SetTolFF(aTolFF); // IntSurf_ListOfPntOn2S aListOfPnts; @@ -587,8 +587,9 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange) { // Modify geometric expanding coefficient by topology value, // since this bounding box used in sharing (vertex or edge). - Standard_Real aMaxVertexTol = Max(BRep_Tool::MaxTolerance(aFaceFace.Face1(), TopAbs_VERTEX), - BRep_Tool::MaxTolerance(aFaceFace.Face2(), TopAbs_VERTEX)); + Standard_Real aMaxVertexTol = + std::max(BRep_Tool::MaxTolerance(aFaceFace.Face1(), TopAbs_VERTEX), + BRep_Tool::MaxTolerance(aFaceFace.Face2(), TopAbs_VERTEX)); aBoxExpandValue += aMaxVertexTol; } // @@ -609,7 +610,7 @@ void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange) // make sure that the bounding box has the maximal gap aBox.Enlarge(aBoxExpandValue); aNC.SetBox(aBox); - aNC.SetTolerance(Max(aIC.Tolerance(), aTolFF)); + aNC.SetTolerance(std::max(aIC.Tolerance(), aTolFF)); } } // @@ -727,7 +728,7 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange) const TopoDS_Face& aF1 = (*(TopoDS_Face*)(&myDS->Shape(nF1))); const TopoDS_Face& aF2 = (*(TopoDS_Face*)(&myDS->Shape(nF2))); // - Standard_Real aTolFF = Max(BRep_Tool::Tolerance(aF1), BRep_Tool::Tolerance(aF2)); + Standard_Real aTolFF = std::max(BRep_Tool::Tolerance(aF1), BRep_Tool::Tolerance(aF2)); // BOPDS_FaceInfo& aFI1 = myDS->ChangeFaceInfo(nF1); BOPDS_FaceInfo& aFI2 = myDS->ChangeFaceInfo(nF2); @@ -854,7 +855,7 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange) { BOPDS_Curve& aNC = aVC.ChangeValue(j); const IntTools_Curve& aIC = aNC.Curve(); - Standard_Real aTolR3D = Max(aNC.Tolerance(), aNC.TangentialTolerance()); + Standard_Real aTolR3D = std::max(aNC.Tolerance(), aNC.TangentialTolerance()); // BOPDS_ListOfPaveBlock& aLPBC = aNC.ChangePaveBlocks(); Handle(BOPDS_PaveBlock)& aPB1 = aNC.ChangePaveBlock1(); @@ -909,10 +910,10 @@ void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange) aTolR3D, aT1, BRep_Tool::Pnt(aV1), - Max(aTolR3D, BRep_Tool::Tolerance(aV1)), + std::max(aTolR3D, BRep_Tool::Tolerance(aV1)), aT2, BRep_Tool::Pnt(aV2), - Max(aTolR3D, BRep_Tool::Tolerance(aV2)), + std::max(aTolR3D, BRep_Tool::Tolerance(aV2)), aFirst, aLast)) { @@ -1926,7 +1927,7 @@ Standard_Boolean BOPAlgo_PaveFiller::IsExistingPaveBlock(const Handle(BOPDS_Pave &aV2 = TopoDS::Vertex(myDS->Shape(nV2)); const Standard_Real aTolV1 = BRep_Tool::Tolerance(aV1), aTolV2 = BRep_Tool::Tolerance(aV2); - aTol = Max(aTolV1, aTolV2); + aTol = std::max(aTolV1, aTolV2); aTm = IntTools_Tools::IntermediatePoint(aT1, aT2); theNC.Curve().D0(aTm, aPm); @@ -1945,7 +1946,7 @@ Standard_Boolean BOPAlgo_PaveFiller::IsExistingPaveBlock(const Handle(BOPDS_Pave { const TopoDS_Edge& aE = (*(TopoDS_Edge*)(&aSIE.Shape())); aTolE = BRep_Tool::Tolerance(aE); - aTolCheck = Max(aTolE, aTol) + myFuzzyValue; + aTolCheck = std::max(aTolE, aTol) + myFuzzyValue; iFlag = myContext->ComputePE(aPm, aTolCheck, aE, aTx, aDist); if (!iFlag) { @@ -2013,7 +2014,7 @@ Standard_Boolean BOPAlgo_PaveFiller::IsExistingPaveBlock( const Standard_Real aTolV12 = BRep_Tool::Tolerance(TopoDS::Vertex(myDS->Shape(nV12))); aBoxP2.Enlarge(aTolV12); - const Standard_Real aTolV1 = Max(aTolV11, aTolV12) + myFuzzyValue; + const Standard_Real aTolV1 = std::max(aTolV11, aTolV12) + myFuzzyValue; Standard_Real aTolCheck = theTolR3D + myFuzzyValue; @@ -2021,7 +2022,7 @@ Standard_Boolean BOPAlgo_PaveFiller::IsExistingPaveBlock( // edge has no common block with any face Standard_Real aMaxTolAdd = 0.001; // Maximal tolerance of edge allowed const Standard_Real aCoeffTolAdd = 10.; // Coeff to define max. tolerance with help of aTolCheck - aMaxTolAdd = Min(aMaxTolAdd, aCoeffTolAdd * aTolCheck); + aMaxTolAdd = std::min(aMaxTolAdd, aCoeffTolAdd * aTolCheck); // Look for the existing pave block closest to the section curve Standard_Boolean bFound = Standard_False; @@ -2036,7 +2037,7 @@ Standard_Boolean BOPAlgo_PaveFiller::IsExistingPaveBlock( const Standard_Real aTolV21 = BRep_Tool::Tolerance(TopoDS::Vertex(myDS->Shape(nV21))); const Standard_Real aTolV22 = BRep_Tool::Tolerance(TopoDS::Vertex(myDS->Shape(nV22))); - const Standard_Real aTolV2 = Max(aTolV21, aTolV22) + myFuzzyValue; + const Standard_Real aTolV2 = std::max(aTolV21, aTolV22) + myFuzzyValue; const BOPDS_ShapeInfo& aSISp = myDS->ChangeShapeInfo(aPB->Edge()); const TopoDS_Edge& aSp = (*(TopoDS_Edge*)(&aSISp.Shape())); @@ -2056,7 +2057,7 @@ Standard_Boolean BOPAlgo_PaveFiller::IsExistingPaveBlock( Standard_Real aRealTol = aTolCheck; if (myDS->IsCommonBlock(aPB)) { - aRealTol = Max(aRealTol, Max(aTolV1, aTolV2)); + aRealTol = std::max(aRealTol, std::max(aTolV1, aTolV2)); if (theMPBCommon.Contains(aPB)) // for an edge, which is a common block with a face, // increase the chance to coincide with section curve @@ -2080,8 +2081,9 @@ Standard_Boolean BOPAlgo_PaveFiller::IsExistingPaveBlock( if (aIC.Type() != GeomAbs_Line || aBAC2.GetType() != GeomAbs_Line) { Standard_Real aTldp; - Standard_Real aTolAdd = 2. * Min(aMaxTolAdd, Max(aRealTol, Max(aTolV1, aTolV2))); - aPEStatus = myContext->ComputePE(aPm, aTolAdd, aSp, aTldp, aDistm1m2); + Standard_Real aTolAdd = + 2. * std::min(aMaxTolAdd, std::max(aRealTol, std::max(aTolV1, aTolV2))); + aPEStatus = myContext->ComputePE(aPm, aTolAdd, aSp, aTldp, aDistm1m2); if (aPEStatus == 0) { @@ -2092,7 +2094,7 @@ Standard_Boolean BOPAlgo_PaveFiller::IsExistingPaveBlock( { // The angle should be close to zero Standard_Real aCos = aVTgt1.Dot(aVTgt2.Normalized()); - if (Abs(aCos) >= 0.9063) + if (std::abs(aCos) >= 0.9063) { aRealTol = aTolAdd; aCoeff = 2.; @@ -2190,7 +2192,7 @@ static void getBoundPaves(const BOPDS_DS* theDS, Standard_Real aT[2]; gp_Pnt aP[2]; aIC.Bounds(aT[0], aT[1], aP[0], aP[1]); - Standard_Real aTol = Max(theNC.Tolerance(), theNC.TangentialTolerance()); + Standard_Real aTol = std::max(theNC.Tolerance(), theNC.TangentialTolerance()); aTol += Precision::Confusion(); for (Standard_Integer j = 0; j < 2; ++j) { @@ -2213,7 +2215,7 @@ void BOPAlgo_PaveFiller::PutBoundPaveOnCurve(const TopoDS_Face& aF1, Standard_Real aT[2]; gp_Pnt aP[2]; aIC.Bounds(aT[0], aT[1], aP[0], aP[1]); - Standard_Real aTolR3D = Max(aNC.Tolerance(), aNC.TangentialTolerance()); + Standard_Real aTolR3D = std::max(aNC.Tolerance(), aNC.TangentialTolerance()); Handle(BOPDS_PaveBlock)& aPB = aNC.ChangePaveBlock1(); // Get numbers of vertices assigned to the ends of the curve Standard_Integer aBndNV[2]; @@ -2278,7 +2280,7 @@ void BOPAlgo_PaveFiller::PutPavesOnCurve(const TColStd_MapOfInteger& TColStd_MapIteratorOfMapOfInteger aIt; // const Bnd_Box& aBoxC = theNC.Box(); - const Standard_Real aTolR3D = Max(theNC.Tolerance(), theNC.TangentialTolerance()); + const Standard_Real aTolR3D = std::max(theNC.Tolerance(), theNC.TangentialTolerance()); // // Put EF vertices first aIt.Initialize(theMVEF); @@ -2343,7 +2345,7 @@ void BOPAlgo_PaveFiller::FilterPavesOnCurves(const BOPDS_VectorOfCurve& theVN { const BOPDS_Curve& aNC = theVNC(i); const IntTools_Curve& aIC = aNC.Curve(); - const Standard_Real aTolR3D = Max(aNC.Tolerance(), aNC.TangentialTolerance()); + const Standard_Real aTolR3D = std::max(aNC.Tolerance(), aNC.TangentialTolerance()); GeomAdaptor_Curve aGAC(aIC.Curve()); const Handle(BOPDS_PaveBlock)& aPB = aNC.PaveBlocks().First(); const BOPDS_ListOfPave& aPaves = aPB->ExtPaves(); @@ -2405,7 +2407,7 @@ void BOPAlgo_PaveFiller::FilterPavesOnCurves(const BOPDS_VectorOfCurve& theVN for (itL.Init(aList); itL.More(); itL.Next()) { const PaveBlockDist& aPBD = itL.Value(); - Standard_Real aCheckDist = 100. * Max(aPBD.Tolerance * aPBD.Tolerance, aMinDist); + Standard_Real aCheckDist = 100. * std::max(aPBD.Tolerance * aPBD.Tolerance, aMinDist); if (aPBD.SquareDist > aCheckDist && aPBD.SinAngle < aSinAngleMin) { aPBD.PB->RemoveExtPave(nV); @@ -2420,8 +2422,8 @@ void BOPAlgo_PaveFiller::FilterPavesOnCurves(const BOPDS_VectorOfCurve& theVN const Standard_Real* pTol = theMVTol.Seek(nV); if (pTol) { - const TopoDS_Vertex& aV = *(TopoDS_Vertex*)&myDS->Shape(nV); - const Standard_Real aRealTol = Max(*pTol, sqrt(aMaxDistKept) + Precision::Confusion()); + const TopoDS_Vertex& aV = *(TopoDS_Vertex*)&myDS->Shape(nV); + const Standard_Real aRealTol = std::max(*pTol, sqrt(aMaxDistKept) + Precision::Confusion()); (*(Handle(BRep_TVertex)*)&aV.TShape())->Tolerance(aRealTol); } } @@ -2887,7 +2889,7 @@ void BOPAlgo_PaveFiller::PutPaveOnCurve(const Standard_Integer n aDTol = BOPTools_AlgoTools::DTolerance(); // GeomAdaptor_Curve aGAC(aIC.Curve()); - aPTol = aGAC.Resolution(Max(aTolR3D, aTolV)); + aPTol = aGAC.Resolution(std::max(aTolR3D, aTolV)); // bExist = aPB->ContainsParameter(aT, aPTol, nVUsed); if (bExist) @@ -3402,7 +3404,7 @@ void BOPAlgo_PaveFiller::PutClosingPaveOnCurve(BOPDS_Curve& aNC) Standard_Real aTC = aPave.Parameter(); for (Standard_Integer j = 0; j < 2; ++j) { - if (Abs(aTC - aT[j]) < Precision::PConfusion()) + if (std::abs(aTC - aT[j]) < Precision::PConfusion()) { nV = aPave.Index(); aTOp = (!j) ? aT[1] : aT[0]; @@ -3422,7 +3424,7 @@ void BOPAlgo_PaveFiller::PutClosingPaveOnCurve(BOPDS_Curve& aNC) Standard_Real aTolV = BRep_Tool::Tolerance(aV); gp_Pnt aPV = BRep_Tool::Pnt(aV); // Tolerance for the point on the curve - Standard_Real aTolP = Max(aNC.Tolerance(), aNC.TangentialTolerance()); + Standard_Real aTolP = std::max(aNC.Tolerance(), aNC.TangentialTolerance()); aTolP += Precision::Confusion(); const Standard_Real aDistVP = aPV.Distance(aPOp); @@ -3434,7 +3436,7 @@ void BOPAlgo_PaveFiller::PutClosingPaveOnCurve(BOPDS_Curve& aNC) // Check if there will be valid range on the curve Standard_Real aFirst, aLast; - Standard_Real aNewTolV = Max(aTolV, aDistVP + BOPTools_AlgoTools::DTolerance()); + Standard_Real aNewTolV = std::max(aTolV, aDistVP + BOPTools_AlgoTools::DTolerance()); if (!BRepLib::FindValidRange(GeomAdaptor_Curve(aIC.Curve()), aIC.Tolerance(), aT[0], @@ -3758,7 +3760,7 @@ Standard_Real ToleranceFF(const BRepAdaptor_Surface& aBAS1, const BRepAdaptor_Su { Standard_Real aTol1 = aBAS1.Tolerance(); Standard_Real aTol2 = aBAS2.Tolerance(); - Standard_Real aTolFF = Max(aTol1, aTol2); + Standard_Real aTolFF = std::max(aTol1, aTol2); // Standard_Boolean isAna1, isAna2; isAna1 = (aBAS1.GetType() == GeomAbs_Plane || aBAS1.GetType() == GeomAbs_Cylinder @@ -3771,7 +3773,7 @@ Standard_Real ToleranceFF(const BRepAdaptor_Surface& aBAS1, const BRepAdaptor_Su // if (!isAna1 || !isAna2) { - aTolFF = Max(aTolFF, 5.e-6); + aTolFF = std::max(aTolFF, 5.e-6); } return aTolFF; } @@ -3855,7 +3857,7 @@ void BOPAlgo_PaveFiller::UpdateBlocksWithSharedVertices() for (j = 0; j < aNbC; ++j) { BOPDS_Curve& aNC = aVC.ChangeValue(j); - Standard_Real aTolR3D = Max(aNC.Tolerance(), aNC.TangentialTolerance()); + Standard_Real aTolR3D = std::max(aNC.Tolerance(), aNC.TangentialTolerance()); // aItMI.Initialize(aMI); for (; aItMI.More(); aItMI.Next()) diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_8.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_8.cxx index 1d8584e4e3..d28a0070f1 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_8.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_8.cxx @@ -270,7 +270,7 @@ void BOPAlgo_PaveFiller::FillPaves(const Standard_Integer nVD, // VResolution from the tolerance of the vertex Standard_Real aVRes = aBAS.VResolution(aTolV); // - aTolInt = Max(aTolInt, Max(aURes, aVRes)); + aTolInt = std::max(aTolInt, std::max(aURes, aVRes)); // // Parametric tolerance to compare intersection point with boundaries // should be computed as a resolution from the tolerance of vertex @@ -281,9 +281,9 @@ void BOPAlgo_PaveFiller::FillPaves(const Standard_Integer nVD, Handle(Geom2d_Curve) aC2DDE = BRep_Tool::CurveOnSurface(aDE, aDF, aTD1, aTD2); // Get direction of the curve Standard_Boolean bUDir = - Abs(aC2DDE->Value(aTD1).Y() - aC2DDE->Value(aTD2).Y()) < Precision::PConfusion(); + std::abs(aC2DDE->Value(aTD1).Y() - aC2DDE->Value(aTD2).Y()) < Precision::PConfusion(); // - aTolCmp = Max(aTolCmp, (bUDir ? aURes : aVRes)); + aTolCmp = std::max(aTolCmp, (bUDir ? aURes : aVRes)); // // Prepare adaptor for the degenerated edge for intersection Geom2dAdaptor_Curve aGAC1; diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Tools.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Tools.cxx index c8716d9310..265a658f66 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Tools.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_Tools.cxx @@ -1803,7 +1803,7 @@ Standard_Boolean BOPAlgo_Tools::TrsfToPoint(const Bnd_Box& theBox1, if (aPBDist < theCriteria) return Standard_False; - Standard_Real aBSize = Sqrt(aBox.SquareExtent()); + Standard_Real aBSize = std::sqrt(aBox.SquareExtent()); if ((aBSize / aPBDist) > (1. / theCriteria)) return Standard_False; diff --git a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_WireSplitter_1.cxx b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_WireSplitter_1.cxx index 06836f7881..27ff1f8339 100644 --- a/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_WireSplitter_1.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_WireSplitter_1.cxx @@ -779,7 +779,7 @@ Standard_Real Angle2D(const TopoDS_Vertex& aV, GeomAbs_CurveType aType; Geom2dAdaptor_Curve aGAC2D(aC2D); // - dt = Max(aGAC2D.Resolution(tol2d), Precision::PConfusion()); + dt = std::max(aGAC2D.Resolution(tol2d), Precision::PConfusion()); // aType = aGAC2D.GetType(); if (aType != GeomAbs_Line) @@ -792,7 +792,7 @@ Standard_Real Angle2D(const TopoDS_Vertex& aV, { R = 1. / R; Standard_Real cosphi = R / (R + tol2d); - dt = Max(dt, ACos(cosphi)); // to avoid small dt for big R. + dt = std::max(dt, std::acos(cosphi)); // to avoid small dt for big R. } } } @@ -800,7 +800,7 @@ Standard_Real Angle2D(const TopoDS_Vertex& aV, aTX = 0.05 * (aLast - aFirst); // aTX=0.25*(aLast - aFirst); if (aTX < 5.e-5) { - aTX = Min(5.e-5, (aLast - aFirst) / 2.); + aTX = std::min(5.e-5, (aLast - aFirst) / 2.); } if (dt > aTX) { @@ -1081,7 +1081,7 @@ Standard_Boolean RefineAngle2D(const TopoDS_Vertex& aV, aT1j = aIPj.ParamOnFirst(); aT2j = aIPj.ParamOnSecond(); // - if (aT2j > aT2max && Abs(aT1j - aTV) < MaxDT) + if (aT2j > aT2max && std::abs(aT1j - aTV) < MaxDT) { aT2max = aT2j; aT1max = aT1j; @@ -1091,7 +1091,7 @@ Standard_Boolean RefineAngle2D(const TopoDS_Vertex& aV, if (aT2max > 0) { dT = aTOp - aT1max; - if (Abs(dT) < aTolInt) + if (std::abs(dT) < aTolInt) { continue; } diff --git a/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_DS.cxx b/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_DS.cxx index deb09c4b06..bd69bf47b3 100644 --- a/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_DS.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_DS.cxx @@ -344,7 +344,7 @@ void BOPDS_DS::Init(const Standard_Real theFuzz) i1 = i2 + 1; } // - aTolAdd = Max(theFuzz, Precision::Confusion()) * 0.5; + aTolAdd = std::max(theFuzz, Precision::Confusion()) * 0.5; myNbSourceShapes = NbShapes(); // // 2 Bounding Boxes @@ -1845,8 +1845,8 @@ Standard_Boolean BOPDS_DS::CheckCoincidence(const Handle(BOPDS_PaveBlock)& aPB1, aD = aPPC.LowerDistance(); // aTol = BRep_Tool::MaxTolerance(aE1, TopAbs_VERTEX); - aTol = - aTol + BRep_Tool::MaxTolerance(aE2, TopAbs_VERTEX) + Max(theFuzz, Precision::Confusion()); + aTol = aTol + BRep_Tool::MaxTolerance(aE2, TopAbs_VERTEX) + + std::max(theFuzz, Precision::Confusion()); if (aD < aTol) { aT2x = aPPC.LowerDistanceParameter(); diff --git a/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_Iterator.cxx b/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_Iterator.cxx index 45fea212bf..dd2f0c72c2 100644 --- a/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_Iterator.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_Iterator.cxx @@ -343,7 +343,8 @@ void BOPDS_Iterator::Intersect(const Handle(IntTools_Context)& theCtx, } Standard_Integer iX = BOPDS_Tools::TypeToInteger(aType1, aType2); - myLists(iX).Append(BOPDS_Pair(Min(aPair.ID1, aPair.ID2), Max(aPair.ID1, aPair.ID2))); + myLists(iX).Append( + BOPDS_Pair(std::min(aPair.ID1, aPair.ID2), std::max(aPair.ID1, aPair.ID2))); } } } diff --git a/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_IteratorSI.cxx b/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_IteratorSI.cxx index 14e9b17bee..a95ace44d4 100644 --- a/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_IteratorSI.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_IteratorSI.cxx @@ -119,6 +119,6 @@ void BOPDS_IteratorSI::Intersect(const Handle(IntTools_Context)& theCtx, } Standard_Integer iX = BOPDS_Tools::TypeToInteger(aType1, aType2); - myLists(iX).Append(BOPDS_Pair(Min(aPair.ID1, aPair.ID2), Max(aPair.ID1, aPair.ID2))); + myLists(iX).Append(BOPDS_Pair(std::min(aPair.ID1, aPair.ID2), std::max(aPair.ID1, aPair.ID2))); } } diff --git a/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_PaveBlock.cxx b/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_PaveBlock.cxx index 1ddc0ae7f8..b844395bb9 100755 --- a/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_PaveBlock.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_PaveBlock.cxx @@ -232,7 +232,7 @@ Standard_Boolean BOPDS_PaveBlock::ContainsParameter(const Standard_Real theT, for (; aIt.More(); aIt.Next()) { const BOPDS_Pave& aPave = aIt.Value(); - bRet = (Abs(aPave.Parameter() - theT) < theTol); + bRet = (std::abs(aPave.Parameter() - theT) < theTol); if (bRet) { theInd = aPave.Index(); diff --git a/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_SubIterator.cxx b/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_SubIterator.cxx index 6a0a3963ca..17c0a7b3c7 100644 --- a/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_SubIterator.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPDS/BOPDS_SubIterator.cxx @@ -140,7 +140,7 @@ void BOPDS_SubIterator::Intersect() if (aPair.ID1 == aPair.ID2) continue; - BOPDS_Pair aDSPair(Min(aPair.ID1, aPair.ID2), Max(aPair.ID1, aPair.ID2)); + BOPDS_Pair aDSPair(std::min(aPair.ID1, aPair.ID2), std::max(aPair.ID1, aPair.ID2)); if (!aMPKFence.Add(aDSPair)) continue; diff --git a/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools.cxx b/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools.cxx index e96c6b6315..96d7434760 100644 --- a/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools.cxx @@ -1030,7 +1030,7 @@ Standard_Boolean BOPTools_AlgoTools::GetFaceOff(const TopoDS_Edge& // Angle aAngle = AngleWithRef(aDBF, aDBF2, aDTF); // - if (Abs(aAngle) < Precision::Angular()) + if (std::abs(aAngle) < Precision::Angular()) { if (aF2 == theF1) { @@ -1042,7 +1042,7 @@ Standard_Boolean BOPTools_AlgoTools::GetFaceOff(const TopoDS_Edge& } } // - if (Abs(aAngle) < anAngleCriteria || Abs(aAngle - aAngleMin) < anAngleCriteria) + if (std::abs(aAngle) < anAngleCriteria || std::abs(aAngle - aAngleMin) < anAngleCriteria) { // the minimal angle can not be found bRet = Standard_False; @@ -1150,7 +1150,7 @@ Standard_Boolean BOPTools_AlgoTools::AreFacesSameDomain(const TopoDS_Face& } // Checking criteria - Standard_Real aTol = aTolF1 + aTolF2 + Max(theFuzz, Precision::Confusion()); + Standard_Real aTol = aTolF1 + aTolF2 + std::max(theFuzz, Precision::Confusion()); // Project and classify the point on second face bFacesSD = theContext->IsValidPointForFace(aP1, theF2, aTol); @@ -2226,7 +2226,7 @@ Standard_Real MinStep3D(const TopoDS_Edge& theE1, break; } case GeomAbs_Sphere: { - aDtMin = Max(aDtMin, 5.e-4); + aDtMin = std::max(aDtMin, 5.e-4); aR = aBAS.Sphere().Radius(); break; } @@ -2235,14 +2235,14 @@ Standard_Real MinStep3D(const TopoDS_Edge& theE1, break; } default: - aDtMin = Max(aDtMin, 5.e-4); + aDtMin = std::max(aDtMin, 5.e-4); break; } // if (aR > 100.) { constexpr Standard_Real d = 10 * Precision::PConfusion(); - aDtMin = Max(aDtMin, sqrt(d * d + 2 * d * aR)); + aDtMin = std::max(aDtMin, sqrt(d * d + 2 * d * aR)); } } // diff --git a/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools2D.cxx b/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools2D.cxx index f71f5c30a6..848fa72a6a 100644 --- a/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools2D.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools2D.cxx @@ -64,7 +64,7 @@ void BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(const TopoDS_Edge& aTolEdge = BRep_Tool::Tolerance(aE); - aTolFact = Max(aTolEdge, aTolPC); + aTolFact = std::max(aTolEdge, aTolPC); aBB.UpdateEdge(aE, aC2D, aF, aTolFact); return; @@ -553,7 +553,7 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace(const TopoDS_Face& aF, Standard_Boolean isExtendSurf = Standard_False; if ((TolReached2d >= 10. * aTR) && (TolReached2d <= aMaxTol || isAnaSurf)) { - aTR = Min(aMaxTol, 0.1 * TolReached2d); + aTR = std::min(aMaxTol, 0.1 * TolReached2d); aMaxSegments = 100; aMaxDist = 1.e3 * TolReached2d; if (!isAnaSurf || TolReached2d > 1.) @@ -564,7 +564,7 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace(const TopoDS_Face& aF, } else if (TolReached2d > aMaxTol) { - aTR = Min(TolReached2d, 1.e3 * aMaxTol); + aTR = std::min(TolReached2d, 1.e3 * aMaxTol); aMaxDist = 1.e2 * aTR; aMaxSegments = 100; isExtendSurf = Standard_True; @@ -573,13 +573,13 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace(const TopoDS_Face& aF, { Handle(Adaptor3d_Surface) anA3dSurf; Standard_Real dt = (aBAHS->LastUParameter() - aBAHS->FirstUParameter()); - if (!aBAHS->IsUPeriodic() || Abs(dt - aBAHS->UPeriod()) > 0.01 * dt) + if (!aBAHS->IsUPeriodic() || std::abs(dt - aBAHS->UPeriod()) > 0.01 * dt) { dt *= 0.01; anA3dSurf = aBAHS->UTrim(aBAHS->FirstUParameter() - dt, aBAHS->LastUParameter() + dt, 0.); } dt = (aBAHS->LastVParameter() - aBAHS->FirstVParameter()); - if (!aBAHS->IsVPeriodic() || Abs(dt - aBAHS->VPeriod()) > 0.01 * dt) + if (!aBAHS->IsVPeriodic() || std::abs(dt - aBAHS->VPeriod()) > 0.01 * dt) { dt *= 0.01; anA3dSurf = aBAHS->VTrim(aBAHS->FirstVParameter() - dt, aBAHS->LastVParameter() + dt, 0.); @@ -601,7 +601,7 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace(const TopoDS_Face& aF, // if (aC2D.IsNull() && (aTR < aMaxTol || aTR < TolReached2d)) { - aTR = Max(TolReached2d, aMaxTol); + aTR = std::max(TolReached2d, aMaxTol); ProjLib_ProjectedCurve aProjCurvAgain(aBAHS, aBAHC, aTR); // 2 ProjLib::MakePCurveOfType(aProjCurvAgain, aC2D); aTolR = aProjCurvAgain.GetTolerance(); diff --git a/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools3D.cxx b/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools3D.cxx index fa741c49e5..2037e0ac71 100644 --- a/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools3D.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools3D.cxx @@ -120,12 +120,14 @@ Standard_Boolean BOPTools_AlgoTools3D::DoSplitSEAMOnFace(const TopoDS_Edge& aSpl Standard_Real aGlobalUmin, aGlobalUmax, aGlobalVmin, aGlobalVmax; aSB->Bounds(aGlobalUmin, aGlobalUmax, aGlobalVmin, aGlobalVmax); - if (bIsUClosed && Abs(aUmin - aGlobalUmin) < aTol && Abs(aUmax - aGlobalUmax) < aTol) + if (bIsUClosed && std::abs(aUmin - aGlobalUmin) < aTol + && std::abs(aUmax - aGlobalUmax) < aTol) { bIsUPeriodic = Standard_True; anUPeriod = aUmax - aUmin; } - if (bIsVClosed && Abs(aVmin - aGlobalVmin) < aTol && Abs(aVmax - aGlobalVmax) < aTol) + if (bIsVClosed && std::abs(aVmin - aGlobalVmin) < aTol + && std::abs(aVmax - aGlobalVmax) < aTol) { bIsVPeriodic = Standard_True; anVPeriod = aVmax - aVmin; diff --git a/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools_1.cxx b/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools_1.cxx index b773937a1d..61039cd74a 100644 --- a/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools_1.cxx +++ b/src/ModelingAlgorithms/TKBO/BOPTools/BOPTools_AlgoTools_1.cxx @@ -431,7 +431,7 @@ void CheckEdge(const TopoDS_Edge& Ed, const gp_Pnt& aPV = TV->Pnt(); // Standard_Real aTol = BRep_Tool::Tolerance(aV); - aTol = Max(aTol, aTolE); + aTol = std::max(aTol, aTolE); Standard_Real dd = 0.1 * aTol; aTol *= aTol; // @@ -609,7 +609,7 @@ static Standard_Real IntersectCurves2d( Standard_Real aLen1 = MapEdgeLength(*theEData1.Edge, theMapEdgeLen); Standard_Real aLen2 = MapEdgeLength(*theEData1.Edge, theMapEdgeLen); const Standard_Real MaxEdgePartCoveredByVertex = 0.3; - Standard_Real aMaxThresDist = Min(aLen1, aLen2) * MaxEdgePartCoveredByVertex; + Standard_Real aMaxThresDist = std::min(aLen1, aLen2) * MaxEdgePartCoveredByVertex; aMaxThresDist *= aMaxThresDist; aItLP.Initialize(aLP); for (; aItLP.More(); aItLP.Next()) @@ -625,8 +625,8 @@ static Standard_Real IntersectCurves2d( continue; } // - if ((!theEData1.IsClosed && Abs(aTint1 - aT1) > aHalfR1) - || (!theEData2.IsClosed && Abs(aTint2 - aT2) > aHalfR2)) + if ((!theEData1.IsClosed && std::abs(aTint1 - aT1) > aHalfR1) + || (!theEData2.IsClosed && std::abs(aTint2 - aT2) > aHalfR2)) { // intersection is on the other end of the edge continue; diff --git a/src/ModelingAlgorithms/TKBO/GTests/BOPTest_Utilities.pxx b/src/ModelingAlgorithms/TKBO/GTests/BOPTest_Utilities.pxx index 5fcf071d8d..53a7b568e8 100644 --- a/src/ModelingAlgorithms/TKBO/GTests/BOPTest_Utilities.pxx +++ b/src/ModelingAlgorithms/TKBO/GTests/BOPTest_Utilities.pxx @@ -470,12 +470,12 @@ public: case ProfileCmd::C: // Arc if (op.params.size() >= 2) { - Standard_Real aRadius = Abs(op.params[0]); + Standard_Real aRadius = std::abs(op.params[0]); Standard_Real aAngleDeg = op.params[1]; Standard_Real aAngleRad = aAngleDeg * M_PI / 180.0; // Handle full circle case (360 degrees) - if (Abs(aAngleDeg) >= 360.0) + if (std::abs(aAngleDeg) >= 360.0) { // Create a full circle centered at current point (0,0 if not set) gp_Pnt2d aCenter2D = aFirstSet ? aCurrentPt : gp_Pnt2d(0, 0); diff --git a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_BeanFaceIntersector.cxx b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_BeanFaceIntersector.cxx index 46fe4a9e04..e3b9c862a3 100644 --- a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_BeanFaceIntersector.cxx +++ b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_BeanFaceIntersector.cxx @@ -365,7 +365,7 @@ void IntTools_BeanFaceIntersector::Perform() if (iLastRange > 0) { IntTools_Range& aLastRange = myResults.ChangeValue(iLastRange); - if (Abs(aRange.First() - aLastRange.Last()) > Precision::PConfusion()) + if (std::abs(aRange.First() - aLastRange.Last()) > Precision::PConfusion()) { myResults.Append(aRange); } @@ -764,7 +764,7 @@ Standard_Boolean IntTools_BeanFaceIntersector::FastComputeAnalytic() hasIntersection = Standard_False; - Standard_Real aDist = Abs(aLin.Distance(aCylAxis.Location()) - aCylRadius); + Standard_Real aDist = std::abs(aLin.Distance(aCylAxis.Location()) - aCylRadius); isCoincide = (aDist < myCriteria); } @@ -777,12 +777,12 @@ Standard_Boolean IntTools_BeanFaceIntersector::FastComputeAnalytic() return Standard_False; Standard_Real aDistLoc = gp_Lin(aCylAxis).Distance(aCircle.Location()); - Standard_Real aDist = aDistLoc + Abs(aCircle.Radius() - aCylRadius); + Standard_Real aDist = aDistLoc + std::abs(aCircle.Radius() - aCylRadius); isCoincide = (aDist < myCriteria); if (!isCoincide) hasIntersection = (aDistLoc - (aCircle.Radius() + aCylRadius)) < myCriteria - && (Abs(aCircle.Radius() - aCylRadius) - aDistLoc) < myCriteria; + && (std::abs(aCircle.Radius() - aCylRadius) - aDistLoc) < myCriteria; } } @@ -830,10 +830,10 @@ void IntTools_BeanFaceIntersector::ComputeLinePlane() Dis = A * Orig.X() + B * Orig.Y() + C * Orig.Z() + D; Standard_Boolean parallel = Standard_False, inplane = Standard_False; - if (Abs(Direc) < Tolang) + if (std::abs(Direc) < Tolang) { parallel = Standard_True; - if (Abs(Dis) < myCriteria) + if (std::abs(Dis) < myCriteria) { inplane = Standard_True; } @@ -891,12 +891,12 @@ void IntTools_BeanFaceIntersector::ComputeLinePlane() // aDL = L.Position().Direction(); aDP = P.Position().Direction(); - anAngle = Abs(M_PI_2 - aDL.Angle(aDP)); + anAngle = std::abs(M_PI_2 - aDL.Angle(aDP)); // aDt = IntTools_Tools::ComputeIntRange(myBeanTolerance, myFaceTolerance, anAngle); // - Standard_Real t1 = Max(myFirstParameter, t - aDt); - Standard_Real t2 = Min(myLastParameter, t + aDt); + Standard_Real t1 = std::max(myFirstParameter, t - aDt); + Standard_Real t2 = std::min(myLastParameter, t + aDt); IntTools_Range aRange(t1, t2); myResults.Append(aRange); @@ -961,7 +961,7 @@ void IntTools_BeanFaceIntersector::ComputeUsingExtremum() if (anExtCS.IsParallel()) { const Standard_Real aSqDist = anExtCS.SquareDistance(1); - myMinSqDistance = Min(myMinSqDistance, aSqDist); + myMinSqDistance = std::min(myMinSqDistance, aSqDist); if (aSqDist < myCriteria * myCriteria) { Standard_Real U1, V1, U2, V2; @@ -1063,7 +1063,7 @@ void IntTools_BeanFaceIntersector::ComputeUsingExtremum() } } - myMinSqDistance = Min(myMinSqDistance, anExtCS.SquareDistance(j)); + myMinSqDistance = std::min(myMinSqDistance, anExtCS.SquareDistance(j)); } if (!solutionfound) @@ -2422,32 +2422,32 @@ void ComputeGridPoints(const Handle(Geom_BSplineSurface)& theSurf, Standard_Integer anExtCount = 0; if (xmin1 < xmin) { - aDef = Max(xmin - xmin1, aDef); + aDef = std::max(xmin - xmin1, aDef); anExtCount++; } if (ymin1 < ymin) { - aDef = Max(ymin - ymin1, aDef); + aDef = std::max(ymin - ymin1, aDef); anExtCount++; } if (zmin1 < zmin) { - aDef = Max(zmin - zmin1, aDef); + aDef = std::max(zmin - zmin1, aDef); anExtCount++; } if (xmax1 > xmax) { - aDef = Max(xmax1 - xmax, aDef); + aDef = std::max(xmax1 - xmax, aDef); anExtCount++; } if (ymax1 > ymax) { - aDef = Max(ymax1 - ymax, aDef); + aDef = std::max(ymax1 - ymax, aDef); anExtCount++; } if (zmax1 > zmax) { - aDef = Max(zmax1 - zmax, aDef); + aDef = std::max(zmax1 - zmax, aDef); anExtCount++; } if (anExtCount < 3) diff --git a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_Context.cxx b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_Context.cxx index f21157d0b1..8707a97104 100644 --- a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_Context.cxx +++ b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_Context.cxx @@ -530,7 +530,7 @@ Standard_Integer IntTools_Context::ComputeVE(const TopoDS_Vertex& theV, // aTolV = BRep_Tool::Tolerance(theV); aTolE = BRep_Tool::Tolerance(theE); - aTolSum = aTolV + aTolE + Max(theFuzz, Precision::Confusion()); + aTolSum = aTolV + aTolE + std::max(theFuzz, Precision::Confusion()); // theTol = aDist + aTolE; theT = aProjector.LowerDistanceParameter(); @@ -571,7 +571,7 @@ Standard_Integer IntTools_Context::ComputeVF(const TopoDS_Vertex& theVertex, aTolV = BRep_Tool::Tolerance(theVertex); aTolF = BRep_Tool::Tolerance(theFace); // - aTolSum = aTolV + aTolF + Max(theFuzz, Precision::Confusion()); + aTolSum = aTolV + aTolF + std::max(theFuzz, Precision::Confusion()); theTol = aDist + aTolF; aProjector.LowerDistanceParameters(theU, theV); // diff --git a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_EdgeEdge.cxx b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_EdgeEdge.cxx index 39191d765a..f2874b0d6e 100644 --- a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_EdgeEdge.cxx +++ b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_EdgeEdge.cxx @@ -166,14 +166,14 @@ void IntTools_EdgeEdge::Prepare() myRes2 = Resolution(myCurve2.Curve().Curve(), myCurve2.GetType(), myResCoeff2, myTol2); // myPTol1 = 5.e-13; - aTM = Max(fabs(myRange1.First()), fabs(myRange1.Last())); + aTM = std::max(fabs(myRange1.First()), fabs(myRange1.Last())); if (aTM > 999.) { myPTol1 = 5.e-16 * aTM; } // myPTol2 = 5.e-13; - aTM = Max(fabs(myRange2.First()), fabs(myRange2.Last())); + aTM = std::max(fabs(myRange2.First()), fabs(myRange2.Last())); if (aTM > 999.) { myPTol2 = 5.e-16 * aTM; @@ -593,7 +593,7 @@ Standard_Boolean IntTools_EdgeEdge::FindParameters(const BRepAdaptor_Curve& theB if (aDistP > 0.) { Standard_Boolean toGrow = Standard_False; - if (Abs(aDistP - aDist) / aDistP < 0.1) + if (std::abs(aDistP - aDist) / aDistP < 0.1) { aDt = Resolution(aCurve, aCurveType, theResCoeff, k * aDist); if (aDt < aMaxDt) @@ -731,17 +731,18 @@ void IntTools_EdgeEdge::MergeSolutions(const IntTools_SequenceOfRanges& theRange || (aTi11 > aTj11 && aTi11 < aTj12) || (bSplit2 && (fabs(aTj12 - aTi11) < dTR1)); if (bCond && bSplit2) { - bCond = (fabs((Max(aTi22, aTj22) - Min(aTi21, aTj21)) - ((aTi22 - aTi21) + (aTj22 - aTj21))) + bCond = (fabs((std::max(aTi22, aTj22) - std::min(aTi21, aTj21)) + - ((aTi22 - aTi21) + (aTj22 - aTj21))) < dTR2) || (aTj21 > aTi21 && aTj21 < aTi22) || (aTi21 > aTj21 && aTi21 < aTj22); } // if (bCond) { - aTi11 = Min(aTi11, aTj11); - aTi12 = Max(aTi12, aTj12); - aTi21 = Min(aTi21, aTj21); - aTi22 = Max(aTi22, aTj22); + aTi11 = std::min(aTi11, aTj11); + aTi12 = std::max(aTi12, aTj12); + aTi21 = std::min(aTi21, aTj21); + aTi22 = std::max(aTi22, aTj22); aMI.Add(j); } else if (!bSplit2) @@ -990,7 +991,7 @@ void IntTools_EdgeEdge::ComputeLineLine() gp_Vec O1O2(aL1.Location(), aL2.Location()); gp_XYZ aCross = aD1.XYZ().Crossed(aD2.XYZ()); Standard_Real aDistLL = O1O2.Dot(gp_Vec(aCross.Normalized())); - if (Abs(aDistLL) > myTol) + if (std::abs(aDistLL) > myTol) return; { @@ -1060,7 +1061,7 @@ Standard_Boolean IntTools_EdgeEdge::IsIntersection(const Standard_Real aT11, } else { - Standard_Real aTRMin = Min((aT12 - aT11) / myRes1, (aT22 - aT21) / myRes2); + Standard_Real aTRMin = std::min((aT12 - aT11) / myRes1, (aT22 - aT21) / myRes2); aCoef = aTRMin / 100.; if (aCoef < 1.) { @@ -1242,7 +1243,7 @@ Standard_Integer FindDistPC(const Standard_Real aT1A, return iErr; } // - Standard_Real anEps = Max(theEps, Epsilon(Max(Abs(aA), Abs(aB))) * 10.); + Standard_Real anEps = std::max(theEps, Epsilon(std::max(std::abs(aA), std::abs(aB))) * 10.); for (;;) { if (iC * (aYP - aYL) > 0) @@ -1432,7 +1433,7 @@ Standard_Real PointBoxDistance(const Bnd_Box& aB, const gp_Pnt& aP) } } // - aDist = Sqrt(aDist); + aDist = std::sqrt(aDist); return aDist; } @@ -1557,7 +1558,7 @@ Standard_Real Resolution(const Handle(Geom_Curve)& theCurve, break; case GeomAbs_Circle: { Standard_Real aDt = theResCoeff * theR3D; - aRes = (aDt <= 1.) ? 2 * ASin(aDt) : 2 * M_PI; + aRes = (aDt <= 1.) ? 2 * std::asin(aDt) : 2 * M_PI; break; } case GeomAbs_BezierCurve: @@ -1578,7 +1579,7 @@ Standard_Real Resolution(const Handle(Geom_Curve)& theCurve, else if (aBCType == GeomAbs_Circle) { Standard_Real aDt = theResCoeff * theR3D; - aRes = (aDt <= 1.) ? 2 * ASin(aDt) : 2 * M_PI; + aRes = (aDt <= 1.) ? 2 * std::asin(aDt) : 2 * M_PI; break; } } @@ -1630,7 +1631,7 @@ Standard_Boolean IsClosed(const Handle(Geom_Curve)& theCurve, const Standard_Real theTol, const Standard_Real theRes) { - if (Abs(aT1 - aT2) < theRes) + if (std::abs(aT1 - aT2) < theRes) { return Standard_False; } diff --git a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_EdgeEdge.lxx b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_EdgeEdge.lxx index 54a7c366c7..a9b62043f2 100644 --- a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_EdgeEdge.lxx +++ b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_EdgeEdge.lxx @@ -160,7 +160,7 @@ inline void IntTools_EdgeEdge::SetEdge2(const TopoDS_Edge& theEdge, inline void IntTools_EdgeEdge::SetFuzzyValue(const Standard_Real theFuzz) { - myFuzzyValue = Max(theFuzz, Precision::Confusion()); + myFuzzyValue = std::max(theFuzz, Precision::Confusion()); } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_EdgeFace.cxx b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_EdgeFace.cxx index 9454a68d56..9036c77c86 100644 --- a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_EdgeFace.cxx +++ b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_EdgeFace.cxx @@ -309,8 +309,8 @@ Standard_Integer IntTools_EdgeFace::MakeType(IntTools_CommonPrt& aCommonPrt) df1 = aPF.Distance(aPL); Standard_Boolean isWholeRange = Standard_False; - if ((Abs(af1 - myRange.First()) < myC.Resolution(myCriteria)) - && (Abs(al1 - myRange.Last()) < myC.Resolution(myCriteria))) + if ((std::abs(af1 - myRange.First()) < myC.Resolution(myCriteria)) + && (std::abs(al1 - myRange.Last()) < myC.Resolution(myCriteria))) isWholeRange = Standard_True; if ((df1 > myCriteria * 2.) && isWholeRange) @@ -355,7 +355,7 @@ Standard_Boolean IntTools_EdgeFace::CheckTouch(const IntTools_CommonPrt& aCP, St // Standard_Real aCR; aCR = myC.Resolution(myCriteria); - if ((Abs(aTF - myRange.First()) < aCR) && (Abs(aTL - myRange.Last()) < aCR)) + if ((std::abs(aTF - myRange.First()) < aCR) && (std::abs(aTL - myRange.Last()) < aCR)) { return theflag; // EDGE } @@ -520,7 +520,7 @@ void IntTools_EdgeFace::Perform() Standard_Real diff2 = (aTolF / aTolE); if (diff1 > 100 || diff2 > 100) { - myCriteria = Max(aTolE, aTolF); + myCriteria = std::max(aTolE, aTolF); } else //--- 5112 myCriteria = 1.5 * aTolE + aTolF; @@ -552,7 +552,7 @@ void IntTools_EdgeFace::Perform() anIntersector.Perform(); if (anIntersector.MinimalSquareDistance() < RealLast()) - myMinDistance = Sqrt(anIntersector.MinimalSquareDistance()); + myMinDistance = std::sqrt(anIntersector.MinimalSquareDistance()); if (!anIntersector.IsDone()) { diff --git a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_EdgeFace.hxx b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_EdgeFace.hxx index 873f65f7d4..aff219e5ea 100644 --- a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_EdgeFace.hxx +++ b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_EdgeFace.hxx @@ -83,7 +83,7 @@ public: //! @name Setters/Getters //! Sets the Fuzzy value void SetFuzzyValue(const Standard_Real theFuzz) { - myFuzzyValue = Max(theFuzz, Precision::Confusion()); + myFuzzyValue = (std::max)(theFuzz, Precision::Confusion()); } //! Returns the Fuzzy value diff --git a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_FClass2d.cxx b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_FClass2d.cxx index 774b950273..214f9d15b9 100644 --- a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_FClass2d.cxx +++ b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_FClass2d.cxx @@ -342,8 +342,8 @@ void IntTools_FClass2d::Init(const TopoDS_Face& aFace, const Standard_Real TolUV gp_Lin2d Lin(SeqPnt2d(ii - 2), gp_Dir2d(gp_Vec2d(SeqPnt2d(ii - 2), SeqPnt2d(ii)))); ul = ElCLib::Parameter(Lin, SeqPnt2d(ii - 1)); Pp = ElCLib::Value(ul, Lin); - dU = Abs(Pp.X() - SeqPnt2d(ii - 1).X()); - dV = Abs(Pp.Y() - SeqPnt2d(ii - 1).Y()); + dU = std::abs(Pp.X() - SeqPnt2d(ii - 1).X()); + dV = std::abs(Pp.Y() - SeqPnt2d(ii - 1).Y()); if (dU > FlecheU) { FlecheU = dU; @@ -432,9 +432,9 @@ void IntTools_FClass2d::Init(const TopoDS_Face& aFace, const Standard_Real TolUV Standard_Real aPer = 0.; Poly::PolygonProperties(SeqPnt2d, aS, aPer); - Standard_Real anExpThick = Max(2. * Abs(aS) / aPer, 1e-7); - Standard_Real aDefl = Max(FlecheU, FlecheV); - Standard_Real aDiscrDefl = Min(aDefl * 0.1, anExpThick * 10.); + Standard_Real anExpThick = std::max(2. * std::abs(aS) / aPer, 1e-7); + Standard_Real aDefl = std::max(FlecheU, FlecheV); + Standard_Real aDiscrDefl = std::min(aDefl * 0.1, anExpThick * 10.); Standard_Boolean isChanged = Standard_False; while (aDefl > anExpThick && aDiscrDefl > 1e-7) { @@ -453,7 +453,7 @@ void IntTools_FClass2d::Init(const TopoDS_Face& aFace, const Standard_Real TolUV if (Or == TopAbs_FORWARD || Or == TopAbs_REVERSED) { BRep_Tool::Range(edge, Face, pfbid, plbid); - if (Abs(plbid - pfbid) < 1.e-9) + if (std::abs(plbid - pfbid) < 1.e-9) continue; BRepAdaptor_Curve2d C(edge, Face); GCPnts_QuasiUniformDeflection aDiscr(C, aDiscrDefl); @@ -480,8 +480,8 @@ void IntTools_FClass2d::Init(const TopoDS_Face& aFace, const Standard_Real TolUV gp_Lin2d Lin(SeqPnt2d(ii - 2), gp_Dir2d(gp_Vec2d(SeqPnt2d(ii - 2), SeqPnt2d(ii)))); Standard_Real ul = ElCLib::Parameter(Lin, SeqPnt2d(ii - 1)); gp_Pnt2d Pp = ElCLib::Value(ul, Lin); - Standard_Real dU = Abs(Pp.X() - SeqPnt2d(ii - 1).X()); - Standard_Real dV = Abs(Pp.Y() - SeqPnt2d(ii - 1).Y()); + Standard_Real dU = std::abs(Pp.X() - SeqPnt2d(ii - 1).X()); + Standard_Real dV = std::abs(Pp.Y() - SeqPnt2d(ii - 1).Y()); if (dU > FlecheU) FlecheU = dU; if (dV > FlecheV) @@ -490,9 +490,9 @@ void IntTools_FClass2d::Init(const TopoDS_Face& aFace, const Standard_Real TolUV firstpoint = 2; } } - anExpThick = Max(2. * Abs(aS) / aPer, 1e-7); - aDefl = Max(FlecheU, FlecheV); - aDiscrDefl = Min(aDiscrDefl * 0.1, anExpThick * 10.); + anExpThick = std::max(2. * std::abs(aS) / aPer, 1e-7); + aDefl = std::max(FlecheU, FlecheV); + aDiscrDefl = std::min(aDiscrDefl * 0.1, anExpThick * 10.); } if (isChanged) @@ -509,7 +509,7 @@ void IntTools_FClass2d::Init(const TopoDS_Face& aFace, const Standard_Real TolUV TabClass.Append( (void*)new CSLib_Class2d(SeqPnt2d, FlecheU, FlecheV, Umin, Vmin, Umax, Vmax)); // - if (Abs(aS) < Precision::SquareConfusion()) + if (std::abs(aS) < Precision::SquareConfusion()) { BadWire = 1; TabOrien.Append(-1); @@ -699,7 +699,7 @@ TopAbs_State IntTools_FClass2d::Perform(const gp_Pnt2d& _Puv, // if (bUIn == bVIn) { - aFCTol = Min(aURes, aVRes); + aFCTol = std::min(aURes, aVRes); } else { diff --git a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_FaceFace.cxx b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_FaceFace.cxx index 8bf6885ce6..8172c42850 100644 --- a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_FaceFace.cxx +++ b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_FaceFace.cxx @@ -235,7 +235,7 @@ void IntTools_FaceFace::SetParameters(const Standard_Boolean ToApproxC3d, void IntTools_FaceFace::SetFuzzyValue(const Standard_Real theFuzz) { - myFuzzyValue = Max(theFuzz, Precision::Confusion()); + myFuzzyValue = std::max(theFuzz, Precision::Confusion()); } //================================================================================================= @@ -614,7 +614,7 @@ void IntTools_FaceFace::ComputeTolReached3d(const Standard_Boolean theToRunParal } // // Minimal tangential tolerance for the curve - Standard_Real aTolFMax = Max(myTolF1, myTolF2); + Standard_Real aTolFMax = std::max(myTolF1, myTolF2); // const Handle(Geom_Surface)& aS1 = myHS1->Surface(); const Handle(Geom_Surface)& aS2 = myHS2->Surface(); @@ -1002,7 +1002,7 @@ reapprox:; lprm = aSeqLprm(i); // constexpr Standard_Real aRealEpsilon = RealEpsilon(); - if (Abs(fprm) > aRealEpsilon || Abs(lprm - 2. * M_PI) > aRealEpsilon) + if (std::abs(fprm) > aRealEpsilon || std::abs(lprm - 2. * M_PI) > aRealEpsilon) { //============================================== //// @@ -1049,7 +1049,7 @@ reapprox:; // mySeqOfCurve.Append(aCurve); //============================================== - } // if (Abs(fprm) > RealEpsilon() || Abs(lprm-2.*M_PI) > RealEpsilon()) + } // if (std::abs(fprm) > RealEpsilon() || std::abs(lprm-2.*M_PI) > RealEpsilon()) else { @@ -1057,8 +1057,9 @@ reapprox:; // if (aNbParts == 1) { - // if (Abs(fprm) < RealEpsilon() && Abs(lprm-2.*M_PI) < RealEpsilon()) { - if (Abs(fprm) <= aRealEpsilon && Abs(lprm - 2. * M_PI) <= aRealEpsilon) + // if (std::abs(fprm) < RealEpsilon() && std::abs(lprm-2.*M_PI) < + // RealEpsilon()) { + if (std::abs(fprm) <= aRealEpsilon && std::abs(lprm - 2. * M_PI) <= aRealEpsilon) { IntTools_Curve aCurve; Handle(Geom_TrimmedCurve) aTC3D = new Geom_TrimmedCurve(newc, fprm, lprm); @@ -2342,7 +2343,7 @@ Standard_Boolean ApproxWithPCurves(const gp_Cylinder& theCyl, const gp_Sphere& t gp_Lin anCylAx(theCyl.Axis()); Standard_Real aDist = anCylAx.Distance(theSph.Location()); - Standard_Real aDRel = Abs(aDist - R1) / R2; + Standard_Real aDRel = std::abs(aDist - R1) / R2; if (aDRel > .2) return bRes; @@ -2432,8 +2433,8 @@ void PerformPlanes(const Handle(GeomAdaptor_Surface)& theS1, return; Standard_Real pmin, pmax; - pmin = Max(P11, P21); - pmax = Min(P12, P22); + pmin = std::max(P11, P21); + pmax = std::min(P12, P22); if (pmax - pmin <= TolTang) return; @@ -2468,7 +2469,7 @@ void PerformPlanes(const Handle(GeomAdaptor_Surface)& theS1, // // Valid tolerance for the intersection curve between planar faces // is the maximal tolerance between tolerances of faces - Standard_Real aTolC = Max(TolF1, TolF2); + Standard_Real aTolC = std::max(TolF1, TolF2); aCurve.SetTolerance(aTolC); // // Computation of the tangential tolerance @@ -2547,8 +2548,8 @@ Standard_Boolean ClassifyLin2d(const Handle(GeomAdaptor_Surface)& theS, if (fabs(par[0] - par[1]) > theTol) { - theP1 = Min(par[0], par[1]); - theP2 = Max(par[0], par[1]); + theP1 = std::min(par[0], par[1]); + theP2 = std::max(par[0], par[1]); return Standard_True; } else @@ -2581,8 +2582,8 @@ Standard_Boolean ClassifyLin2d(const Handle(GeomAdaptor_Surface)& theS, if (fabs(par[0] - par[1]) > theTol) { - theP1 = Min(par[0], par[1]); - theP2 = Max(par[0], par[1]); + theP1 = std::min(par[0], par[1]); + theP2 = std::max(par[0], par[1]); return Standard_True; } else @@ -2613,8 +2614,8 @@ Standard_Boolean ClassifyLin2d(const Handle(GeomAdaptor_Surface)& theS, { if (fabs(par[0] - par[1]) > theTol) { - theP1 = Min(par[0], par[1]); - theP2 = Max(par[0], par[1]); + theP1 = std::min(par[0], par[1]); + theP2 = std::max(par[0], par[1]); return Standard_True; } else @@ -2645,8 +2646,8 @@ Standard_Boolean ClassifyLin2d(const Handle(GeomAdaptor_Surface)& theS, { if (fabs(par[0] - par[1]) > theTol) { - theP1 = Min(par[0], par[1]); - theP2 = Max(par[0], par[1]); + theP1 = std::min(par[0], par[1]); + theP2 = std::max(par[0], par[1]); return Standard_True; } else @@ -2877,7 +2878,7 @@ Standard_Real FindMaxDistance(const Handle(Geom_Curve)& theC, aX2 = aA + aCf * (aB - aA); aF2 = MaxDistance(theC, aX2, theProjPS); - while (Abs(aX1 - aX2) > theEps) + while (std::abs(aX1 - aX2) > theEps) { if (aF1 > aF2) { @@ -2942,8 +2943,8 @@ Standard_Boolean CheckPCurve(const Handle(Geom2d_Curve)& aPC, Standard_Real umin, umax, vmin, vmax; theCtx->UVBounds(aFace, umin, umax, vmin, vmax); - Standard_Real tolU = Max((umax - umin) * 0.01, Precision::Confusion()); - Standard_Real tolV = Max((vmax - vmin) * 0.01, Precision::Confusion()); + Standard_Real tolU = std::max((umax - umin) * 0.01, Precision::Confusion()); + Standard_Real tolV = std::max((vmax - vmin) * 0.01, Precision::Confusion()); Standard_Real fp = aPC->FirstParameter(); Standard_Real lp = aPC->LastParameter(); diff --git a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_MarkedRangeSet.cxx b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_MarkedRangeSet.cxx index c7d6e4de07..b7a1845097 100644 --- a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_MarkedRangeSet.cxx +++ b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_MarkedRangeSet.cxx @@ -141,7 +141,7 @@ Standard_Boolean IntTools_MarkedRangeSet::InsertRange(const Standard_Real the if ((theFirstBoundary < myRangeSetStorer(theIndex)) || (theLastBoundary > myRangeSetStorer(theIndex + 1)) - || (Abs(theFirstBoundary - theLastBoundary) < aTolerance)) + || (std::abs(theFirstBoundary - theLastBoundary) < aTolerance)) { return InsertRange(theFirstBoundary, theLastBoundary, theFlag); } @@ -149,8 +149,8 @@ Standard_Boolean IntTools_MarkedRangeSet::InsertRange(const Standard_Real the { Standard_Integer aPrevFlag = myFlags(anIndex); - if ((Abs(theFirstBoundary - myRangeSetStorer(anIndex)) > aTolerance) - && (Abs(theFirstBoundary - myRangeSetStorer(anIndex + 1)) > aTolerance)) + if ((std::abs(theFirstBoundary - myRangeSetStorer(anIndex)) > aTolerance) + && (std::abs(theFirstBoundary - myRangeSetStorer(anIndex + 1)) > aTolerance)) { myRangeSetStorer.InsertAfter(anIndex, theFirstBoundary); myFlags.InsertAfter(anIndex, theFlag); @@ -162,8 +162,8 @@ Standard_Boolean IntTools_MarkedRangeSet::InsertRange(const Standard_Real the myFlags.SetValue(anIndex, theFlag); } - if ((Abs(theLastBoundary - myRangeSetStorer(anIndex)) > aTolerance) - && (Abs(theLastBoundary - myRangeSetStorer(anIndex + 1)) > aTolerance)) + if ((std::abs(theLastBoundary - myRangeSetStorer(anIndex)) > aTolerance) + && (std::abs(theLastBoundary - myRangeSetStorer(anIndex + 1)) > aTolerance)) { myRangeSetStorer.InsertAfter(anIndex, theLastBoundary); myRangeNumber = myRangeSetStorer.Length() - 1; diff --git a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_Tools.cxx b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_Tools.cxx index 1ae36ba90f..42d6d2ef90 100644 --- a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_Tools.cxx +++ b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_Tools.cxx @@ -574,7 +574,7 @@ Standard_Boolean IntTools_Tools::CheckCurve(const IntTools_Curve& theCurve, Bnd_ // // Build bounding box for the curve BndLib_Add3dCurve::Add(GeomAdaptor_Curve(aC3D), - Max(theCurve.Tolerance(), theCurve.TangentialTolerance()), + std::max(theCurve.Tolerance(), theCurve.TangentialTolerance()), theBox); // // Estimate the bounding box of the curve comparing it with the @@ -599,8 +599,8 @@ Standard_Boolean IntTools_Tools::IsOnPave(const Standard_Real aT1, { Standard_Boolean firstisonpave1, firstisonpave2, bIsOnPave; // - firstisonpave1 = (Abs(aRange.First() - aT1) < aTolerance); - firstisonpave2 = (Abs(aRange.Last() - aT1) < aTolerance); + firstisonpave1 = (std::abs(aRange.First() - aT1) < aTolerance); + firstisonpave2 = (std::abs(aRange.Last() - aT1) < aTolerance); bIsOnPave = (firstisonpave1 || firstisonpave2); return bIsOnPave; } @@ -658,8 +658,8 @@ Standard_Boolean IntTools_Tools::IsOnPave1(const Standard_Real aTR, return bIsOnPave; } // - dT1 = Abs(aTR - aT1); - dT2 = Abs(aTR - aT2); + dT1 = std::abs(aTR - aT1); + dT2 = std::abs(aTR - aT2); bIsOnPave = (dT1 <= aTolerance || dT2 <= aTolerance); return bIsOnPave; } @@ -805,7 +805,7 @@ Standard_Real IntTools_Tools::ComputeIntRange(const Standard_Real theTol1, { Standard_Real aDt; // - if (Abs(M_PI_2 - theAngle) < Precision::Angular()) + if (std::abs(M_PI_2 - theAngle) < Precision::Angular()) { aDt = theTol2; } diff --git a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_TopolTool.cxx b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_TopolTool.cxx index d0ade9bd78..89efac848a 100644 --- a/src/ModelingAlgorithms/TKBO/IntTools/IntTools_TopolTool.cxx +++ b/src/ModelingAlgorithms/TKBO/IntTools/IntTools_TopolTool.cxx @@ -148,7 +148,7 @@ void IntTools_TopolTool::ComputeSamplePoints() if (aRadius > aDeflection) { - aMaxAngle = ACos(1. - aDeflection / aRadius) * 2.; + aMaxAngle = std::acos(1. - aDeflection / aRadius) * 2.; } if (aMaxAngle > Precision::Angular()) { @@ -184,7 +184,7 @@ void IntTools_TopolTool::ComputeSamplePoints() if (aRadius > aDeflection) { - aMaxAngle = ACos(1. - aDeflection / aRadius) * 2.; + aMaxAngle = std::acos(1. - aDeflection / aRadius) * 2.; } if (aMaxAngle > Precision::Angular()) @@ -240,7 +240,7 @@ void IntTools_TopolTool::ComputeSamplePoints() if (aRadius1 > aDeflection) { - aMaxAngle = ACos(1. - aDeflection / aRadius1) * 2.; + aMaxAngle = std::acos(1. - aDeflection / aRadius1) * 2.; } if (aMaxAngle > Precision::Angular()) @@ -251,7 +251,7 @@ void IntTools_TopolTool::ComputeSamplePoints() if (aRadius2 > aDeflection) { - aMaxAngle = ACos(1. - aDeflection / aRadius2) * 2.; + aMaxAngle = std::acos(1. - aDeflection / aRadius2) * 2.; } if (aMaxAngle > Precision::Angular()) @@ -312,12 +312,12 @@ void IntTools_TopolTool::ComputeSamplePoints() if (aRatio >= 10.) { nbsu *= 2; - nbsu = Min(nbsu, aMaxNbSample); + nbsu = std::min(nbsu, aMaxNbSample); } else if (aRatio <= 0.1) { nbsv *= 2; - nbsv = Min(nbsv, aMaxNbSample); + nbsv = std::min(nbsv, aMaxNbSample); } } break; diff --git a/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo.cxx b/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo.cxx index 332d420f1f..c7435bab62 100644 --- a/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo.cxx @@ -286,7 +286,7 @@ TopoDS_Wire BRepAlgo::ConcatenateWire(const TopoDS_Wire& W, tab(index)->Reverse(); tolleft = BRep_Tool::Tolerance(TopExp::LastVertex(edge)); tolright = BRep_Tool::Tolerance(TopExp::FirstVertex(edge)); - tabtolvertex(index - 1) = Max(tolleft, tolright); + tabtolvertex(index - 1) = std::max(tolleft, tolright); } if (index == 0) @@ -478,7 +478,7 @@ TopoDS_Edge BRepAlgo::ConcatenateWireC0(const TopoDS_Wire& aWire) gp_Circ PrevCircle = GAprevcurve.Circle(); if (aCircle.Location().Distance(PrevCircle.Location()) <= LinTol - && Abs(aCircle.Radius() - PrevCircle.Radius()) <= LinTol + && std::abs(aCircle.Radius() - PrevCircle.Radius()) <= LinTol && aCircle.Axis().IsParallel(PrevCircle.Axis(), AngTol)) { gp_Pnt P1 = ElCLib::Value(fpar, aCircle); @@ -496,8 +496,8 @@ TopoDS_Edge BRepAlgo::ConcatenateWireC0(const TopoDS_Wire& aWire) if (anEllipse.Focus1().Distance(PrevEllipse.Focus1()) <= LinTol && anEllipse.Focus2().Distance(PrevEllipse.Focus2()) <= LinTol - && Abs(anEllipse.MajorRadius() - PrevEllipse.MajorRadius()) <= LinTol - && Abs(anEllipse.MinorRadius() - PrevEllipse.MinorRadius()) <= LinTol + && std::abs(anEllipse.MajorRadius() - PrevEllipse.MajorRadius()) <= LinTol + && std::abs(anEllipse.MinorRadius() - PrevEllipse.MinorRadius()) <= LinTol && anEllipse.Axis().IsParallel(PrevEllipse.Axis(), AngTol)) { gp_Pnt P1 = ElCLib::Value(fpar, anEllipse); @@ -515,8 +515,8 @@ TopoDS_Edge BRepAlgo::ConcatenateWireC0(const TopoDS_Wire& aWire) if (aHypr.Focus1().Distance(PrevHypr.Focus1()) <= LinTol && aHypr.Focus2().Distance(PrevHypr.Focus2()) <= LinTol - && Abs(aHypr.MajorRadius() - PrevHypr.MajorRadius()) <= LinTol - && Abs(aHypr.MinorRadius() - PrevHypr.MinorRadius()) <= LinTol + && std::abs(aHypr.MajorRadius() - PrevHypr.MajorRadius()) <= LinTol + && std::abs(aHypr.MinorRadius() - PrevHypr.MinorRadius()) <= LinTol && aHypr.Axis().IsParallel(PrevHypr.Axis(), AngTol)) { gp_Pnt P1 = ElCLib::Value(fpar, aHypr); @@ -534,7 +534,7 @@ TopoDS_Edge BRepAlgo::ConcatenateWireC0(const TopoDS_Wire& aWire) if (aParab.Location().Distance(PrevParab.Location()) <= LinTol && aParab.Focus().Distance(PrevParab.Focus()) <= LinTol - && Abs(aParab.Focal() - PrevParab.Focal()) <= LinTol + && std::abs(aParab.Focal() - PrevParab.Focal()) <= LinTol && aParab.Axis().IsParallel(PrevParab.Axis(), AngTol)) { gp_Pnt P1 = ElCLib::Value(fpar, aParab); diff --git a/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo_Loop.cxx b/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo_Loop.cxx index 67e250d795..fa088d10d4 100644 --- a/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo_Loop.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo_Loop.cxx @@ -1039,7 +1039,7 @@ void BRepAlgo_Loop::UpdateVEmap(TopTools_IndexedDataMapOfShapeListOfShape& theVE { const TopoDS_Vertex& aVertex = TopoDS::Vertex(itl.Value()); Standard_Real aTol = BRep_Tool::Tolerance(aVertex); - aMaxTol = Max(aMaxTol, aTol); + aMaxTol = std::max(aMaxTol, aTol); gp_Pnt aPnt = BRep_Tool::Pnt(aVertex); Points(++jj) = aPnt; } @@ -1052,10 +1052,10 @@ void BRepAlgo_Loop::UpdateVEmap(TopTools_IndexedDataMapOfShapeListOfShape& theVE for (jj = 1; jj <= Points.Upper(); jj++) { Standard_Real aSqDist = aCentre.SquareDistance(Points(jj)); - aMaxDist = Max(aMaxDist, aSqDist); + aMaxDist = std::max(aMaxDist, aSqDist); } - aMaxDist = Sqrt(aMaxDist); - aMaxTol = Max(aMaxTol, aMaxDist); + aMaxDist = std::sqrt(aMaxDist); + aMaxTol = std::max(aMaxTol, aMaxDist); // Find constant vertex TopoDS_Vertex aConstVertex; diff --git a/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo_NormalProjection.cxx b/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo_NormalProjection.cxx index 6453a8d41c..dcc80af69a 100644 --- a/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo_NormalProjection.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepAlgo/BRepAlgo_NormalProjection.cxx @@ -130,7 +130,7 @@ void BRepAlgo_NormalProjection::SetParams(const Standard_Real Tol3D, void BRepAlgo_NormalProjection::SetDefaultParams() { myTol3d = 1.e-4; - myTol2d = Pow(myTol3d, 2. / 3); + myTol2d = std::pow(myTol3d, 2. / 3); myContinuity = GeomAbs_C1; myMaxDegree = 14; myMaxSeg = 16; diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill.cxx index efd4fe4b59..ed80a880ac 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill.cxx @@ -237,8 +237,8 @@ TopoDS_Face BRepFill::Face(const TopoDS_Edge& Edge1, const TopoDS_Edge& Edge2) TopoDS_Vertex V1f, V1l, V2f, V2l; // create a new Handle - if (Abs(f1 - C1->FirstParameter()) > Precision::PConfusion() - || Abs(l1 - C1->LastParameter()) > Precision::PConfusion()) + if (std::abs(f1 - C1->FirstParameter()) > Precision::PConfusion() + || std::abs(l1 - C1->LastParameter()) > Precision::PConfusion()) { C1 = new Geom_TrimmedCurve(C1, f1, l1); } @@ -263,8 +263,8 @@ TopoDS_Face BRepFill::Face(const TopoDS_Edge& Edge1, const TopoDS_Edge& Edge2) } // a new Handle is created - if (Abs(f2 - C2->FirstParameter()) > Precision::PConfusion() - || Abs(l2 - C2->LastParameter()) > Precision::PConfusion()) + if (std::abs(f2 - C2->FirstParameter()) > Precision::PConfusion() + || std::abs(l2 - C2->LastParameter()) > Precision::PConfusion()) { C2 = new Geom_TrimmedCurve(C2, f2, l2); } @@ -307,7 +307,7 @@ TopoDS_Face BRepFill::Face(const TopoDS_Edge& Edge1, const TopoDS_Edge& Edge2) TopoDS_Edge Edge3, Edge4; Iso = Surf->UIso(f1); - Tol = Max(BRep_Tool::Tolerance(V1f), BRep_Tool::Tolerance(V2f)); + Tol = std::max(BRep_Tool::Tolerance(V1f), BRep_Tool::Tolerance(V2f)); if (Iso->Value(f2).Distance(Iso->Value(l2)) > Tol) { B.MakeEdge(Edge3, Iso, Precision::Confusion()); @@ -330,7 +330,7 @@ TopoDS_Face BRepFill::Face(const TopoDS_Edge& Edge1, const TopoDS_Edge& Edge2) else { Iso = Surf->UIso(l1); - Tol = Max(BRep_Tool::Tolerance(V1l), BRep_Tool::Tolerance(V2l)); + Tol = std::max(BRep_Tool::Tolerance(V1l), BRep_Tool::Tolerance(V2l)); if (Iso->Value(l2).Distance(Iso->Value(f2)) > Tol) { B.MakeEdge(Edge4, Iso, Precision::Confusion()); @@ -472,8 +472,8 @@ TopoDS_Shell BRepFill::Shell(const TopoDS_Wire& Wire1, const TopoDS_Wire& Wire2) TopoDS_Vertex V1f, V1l, V2f, V2l; - if (Abs(f1 - C1->FirstParameter()) > Precision::PConfusion() - || Abs(l1 - C1->LastParameter()) > Precision::PConfusion()) + if (std::abs(f1 - C1->FirstParameter()) > Precision::PConfusion() + || std::abs(l1 - C1->LastParameter()) > Precision::PConfusion()) { C1 = new Geom_TrimmedCurve(C1, f1, l1); } @@ -493,8 +493,8 @@ TopoDS_Shell BRepFill::Shell(const TopoDS_Wire& Wire1, const TopoDS_Wire& Wire2) else TopExp::Vertices(Edge1, V1f, V1l); - if (Abs(f2 - C2->FirstParameter()) > Precision::PConfusion() - || Abs(l2 - C2->LastParameter()) > Precision::PConfusion()) + if (std::abs(f2 - C2->FirstParameter()) > Precision::PConfusion() + || std::abs(l2 - C2->LastParameter()) > Precision::PConfusion()) { C2 = new Geom_TrimmedCurve(C2, f2, l2); } @@ -530,8 +530,8 @@ TopoDS_Shell BRepFill::Shell(const TopoDS_Wire& Wire1, const TopoDS_Wire& Wire2) if (thefirst) { Iso = Surf->UIso(f1); - // Tol = Max(BT.Tolerance(V1f), BT.Tolerance(V2f)); - Tol = Max(BRep_Tool::Tolerance(V1f), BRep_Tool::Tolerance(V2f)); + // Tol = std::max(BT.Tolerance(V1f), BT.Tolerance(V2f)); + Tol = std::max(BRep_Tool::Tolerance(V1f), BRep_Tool::Tolerance(V2f)); if (Iso->Value(f2).Distance(Iso->Value(l2)) > Tol) { B.MakeEdge(Edge3, Iso, Precision::Confusion()); @@ -566,8 +566,8 @@ TopoDS_Shell BRepFill::Shell(const TopoDS_Wire& Wire1, const TopoDS_Wire& Wire2) else { Iso = Surf->UIso(l1); - // Tol = Max(BT.Tolerance(V1l), BT.Tolerance(V2l)); - Tol = Max(BRep_Tool::Tolerance(V1l), BRep_Tool::Tolerance(V2l)); + // Tol = std::max(BT.Tolerance(V1l), BT.Tolerance(V2l)); + Tol = std::max(BRep_Tool::Tolerance(V1l), BRep_Tool::Tolerance(V2l)); if (Iso->Value(l2).Distance(Iso->Value(f2)) > Tol) { B.MakeEdge(Edge4, Iso, Precision::Confusion()); @@ -790,12 +790,12 @@ void BRepFill::Axe(const TopoDS_Shape& Spine, P1 = BRep_Tool::Pnt(V1); P2 = BRep_Tool::Pnt(V2); gp_Vec vec(P1, P2); - sca1 += Abs(Tang1.Dot(vec)); - sca2 += Abs(Tang2.Dot(vec)); + sca1 += std::abs(Tang1.Dot(vec)); + sca2 += std::abs(Tang2.Dot(vec)); } // modified by NIZHNY-EAP Wed Feb 2 15:38:44 2000 ___END___ - if (Abs(sca1) < Abs(sca2)) + if (std::abs(sca1) < std::abs(sca2)) { Loc = Loc1; Tang = Tang1; diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_AdvancedEvolved.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_AdvancedEvolved.cxx index 45b2ba3dcf..51b4beecf9 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_AdvancedEvolved.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_AdvancedEvolved.cxx @@ -213,8 +213,8 @@ void BRepFill_AdvancedEvolved::GetSpineAndProfile(const TopoDS_Wire& theSpine, anAC1.D1(aPar2, aP, aT2); // Find minimal sine - const Standard_Real aSqT1 = Max(aT1.SquareMagnitude(), 1.0 / Precision::Infinite()); - const Standard_Real aSqT2 = Max(aT2.SquareMagnitude(), 1.0 / Precision::Infinite()); + const Standard_Real aSqT1 = std::max(aT1.SquareMagnitude(), 1.0 / Precision::Infinite()); + const Standard_Real aSqT2 = std::max(aT2.SquareMagnitude(), 1.0 / Precision::Infinite()); const Standard_Real aSqSin1 = aT1.CrossSquareMagnitude(aN2) / aSqT1; const Standard_Real aSqSin2 = aT2.CrossSquareMagnitude(aN2) / aSqT2; @@ -512,7 +512,7 @@ void BRepFill_AdvancedEvolved::GetLids() return; } - Standard_Real aTol = Max(aFS.Tolerance(), aFS.ToleranceReached()); + Standard_Real aTol = std::max(aFS.Tolerance(), aFS.ToleranceReached()); aTol += myFuzzyValue; Bnd_Box aProfBox; BRepBndLib::Add(myProfile, aProfBox); @@ -558,8 +558,8 @@ void BRepFill_AdvancedEvolved::GetLids() continue; const Standard_Real aDP = aTan.XYZ().Dot(aNormal.XYZ()); - if (Abs(aDP) > aDPMax) - aDPMax = Abs(aDP); + if (std::abs(aDP) > aDPMax) + aDPMax = std::abs(aDP); if (aDP * aDP > aSqModulus * aSqAnguarTol) { // Only planar edges are considered @@ -590,7 +590,7 @@ void BRepFill_AdvancedEvolved::GetLids() aBB.MakeCompound(aCompW); aBB.MakeCompound(aCompF); aBB.MakeCompound(myTopBottom); - Standard_Real anAngTol = Sqrt(aSqAnguarTol); + Standard_Real anAngTol = std::sqrt(aSqAnguarTol); BOPAlgo_Tools::EdgesToWires(aFreeEdges, aCompW, Standard_True, anAngTol); BOPAlgo_Tools::WiresToFaces(aCompW, aCompF, anAngTol); @@ -1274,7 +1274,7 @@ static Standard_Boolean MakeEdgeDegenerated(const TopoDS_Vertex& theV, const Standard_Real aTol = 2.0 * BRep_Tool::Tolerance(theV); const Standard_Real aTolU = anAS.UResolution(aTol), aTolV = anAS.VResolution(aTol); - if ((Abs(thePf.X() - thePl.X()) < aTolU) && (Abs(thePf.Y() - thePl.Y()) < aTolV)) + if ((std::abs(thePf.X() - thePl.X()) < aTolU) && (std::abs(thePf.Y() - thePl.Y()) < aTolV)) return Standard_False; const TopoDS_Vertex aVf = TopoDS::Vertex(theV.Oriented(TopAbs_FORWARD)), diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_CompatibleWires.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_CompatibleWires.cxx index 99a2c7c035..0e32aea986 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_CompatibleWires.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_CompatibleWires.cxx @@ -89,7 +89,7 @@ static void EdgesFromVertex(const TopoDS_Wire& W, } } - if (Abs(I2 - I1) == 1) + if (std::abs(I2 - I1) == 1) { // consecutive numbers if (I2 == I1 + 1) @@ -238,10 +238,10 @@ static Standard_Boolean PlaneOfWire(const TopoDS_Wire& W, gp_Pln& P) gp_Vec Vec; Standard_Real R1, R2, R3, Tol = Precision::Confusion(); Pp.RadiusOfGyration(R1, R2, R3); - Standard_Real RMax = Max(Max(R1, R2), R3); - if ((Abs(RMax - R1) < Tol && Abs(RMax - R2) < Tol) - || (Abs(RMax - R1) < Tol && Abs(RMax - R3) < Tol) - || (Abs(RMax - R2) < Tol && Abs(RMax - R3) < Tol)) + Standard_Real RMax = std::max(std::max(R1, R2), R3); + if ((std::abs(RMax - R1) < Tol && std::abs(RMax - R2) < Tol) + || (std::abs(RMax - R1) < Tol && std::abs(RMax - R3) < Tol) + || (std::abs(RMax - R2) < Tol && std::abs(RMax - R3) < Tol)) isplane = Standard_False; else { @@ -367,7 +367,7 @@ static void TrimEdge(const TopoDS_Edge& CurrentEdge, { // piece of edge m1 = (CutValues.Value(j) - t0) * (last - first) / (t1 - t0) + first; - if (Abs(m0 - m1) < Precision::Confusion()) + if (std::abs(m0 - m1) < Precision::Confusion()) { return; } @@ -379,7 +379,7 @@ static void TrimEdge(const TopoDS_Edge& CurrentEdge, if (j == ndec) { // last piece - if (Abs(m0 - last) < Precision::Confusion()) + if (std::abs(m0 - last) < Precision::Confusion()) { return; } @@ -398,7 +398,7 @@ static void TrimEdge(const TopoDS_Edge& CurrentEdge, { // piece of edge m0 = (CutValues.Value(j) - t0) * (last - first) / (t1 - t0) + first; - if (Abs(m0 - m1) < Precision::Confusion()) + if (std::abs(m0 - m1) < Precision::Confusion()) { return; } @@ -410,7 +410,7 @@ static void TrimEdge(const TopoDS_Edge& CurrentEdge, if (j == 1) { // last piece - if (Abs(first - m1) < Precision::Confusion()) + if (std::abs(first - m1) < Precision::Confusion()) { return; } @@ -553,14 +553,14 @@ static Standard_Boolean EdgeIntersectOnWire(const gp_Pnt& Standard_Real tol = Precision::PConfusion(); Standard_Real first, last, param; BRep_Tool::Range(E, first, last); - tol = Max(tol, percent * Abs(last - first)); + tol = std::max(tol, percent * std::abs(last - first)); DSS.ParOnEdgeS2(isol, param); - if (Abs(first - param) < tol) + if (std::abs(first - param) < tol) { NewVertex = Standard_False; Vsol = TopExp::FirstVertex(E); } - else if (Abs(last - param) < tol) + else if (std::abs(last - param) < tol) { NewVertex = Standard_False; Vsol = TopExp::LastVertex(E); @@ -666,7 +666,7 @@ static void Transform(const Standard_Boolean WithRotation, Vsign.SetLinearForm(Vtrans.Dot(axe1), axe2, -Vtrans.Dot(axe2), axe1); alpha = Vsign.Dot(axe1); beta = Vsign.Dot(axe2); - Standard_Boolean pasnul = (Abs(alpha) > 1.e-4 && Abs(beta) > 1.e-4); + Standard_Boolean pasnul = (std::abs(alpha) > 1.e-4 && std::abs(beta) > 1.e-4); if (alpha * beta > 0.0 && pasnul) sign = -1; gp_Ax1 Norm(Pos2, norm2); @@ -2116,7 +2116,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean /*polar*/) angmin = angV; Vopti = TopoDS::Vertex(SeqV.Value(ii)); } - else if (Abs(angmin - angV) < eta) + else if (std::abs(angmin - angV) < eta) { if (dist < distmini) { @@ -2205,7 +2205,7 @@ void BRepFill_CompatibleWires::ComputeOrigin(const Standard_Boolean /*polar*/) U2 = 0.25 * (3 * BRep_Tool::Parameter(V1, E2) + BRep_Tool::Parameter(V2, E2)); } - if (Abs(Pbout.Distance(P1) - Pbout.Distance(P2)) < Precision::Confusion()) + if (std::abs(Pbout.Distance(P1) - Pbout.Distance(P2)) < Precision::Confusion()) { // cas limite ; on se decale un peu Pbout = PPn; @@ -2402,14 +2402,14 @@ void BRepFill_CompatibleWires::SearchOrigin() ang = M_PI - ang; if (ang < -M_PI/2.0) ang = -M_PI - ang; - if (Abs(ang-M_PI/2.0)1.e-4 && Abs(beta)>1.e-4); + Standard_Boolean pasnul = (std::abs(alpha)>1.e-4 && std::abs(beta)>1.e-4); if ( alpha*beta>0.0 && pasnul ) sign=-1; ang *= sign; } diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Draft.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Draft.cxx index 0070f23b2c..b72b9f32e5 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Draft.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Draft.cxx @@ -279,7 +279,7 @@ BRepFill_Draft::BRepFill_Draft(const TopoDS_Shape& S, const gp_Dir& Dir, const S } #endif - myAngle = Abs(Angle); + myAngle = std::abs(Angle); myDir = Dir; myTop = S; myDone = Standard_False; @@ -348,7 +348,7 @@ void BRepFill_Draft::Perform(const Handle(Geom_Surface)& Surface, // calculate the maximum length of the rule. L = Longueur(WBox, SBox, myDir, Pt); - L /= Abs(Cos(myAngle)); + L /= std::abs(std::cos(myAngle)); // Construction Init(Surface, L, WBox); @@ -398,7 +398,7 @@ void BRepFill_Draft::Perform(const TopoDS_Shape& StopShape, const Standard_Boole // calculate the maximum length of the rule. L = Longueur(WBox, SBox, myDir, Pt); - L /= Abs(Cos(myAngle)); + L /= std::abs(std::cos(myAngle)); // surface of stop gp_Trsf Inv; diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Evolved.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Evolved.cxx index b9f01f76e1..cb86416f98 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Evolved.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Evolved.cxx @@ -237,7 +237,7 @@ static Standard_Boolean IsVertical(const TopoDS_Edge& E) gp_Pnt P1 = BRep_Tool::Pnt(V1); gp_Pnt P2 = BRep_Tool::Pnt(V2); - if (Abs(P1.Y() - P2.Y()) < BRepFill_Confusion()) + if (std::abs(P1.Y() - P2.Y()) < BRepFill_Confusion()) { // It is a Line ? TopLoc_Location Loc; @@ -258,7 +258,7 @@ static Standard_Boolean IsPlanar(const TopoDS_Edge& E) gp_Pnt P1 = BRep_Tool::Pnt(V1); gp_Pnt P2 = BRep_Tool::Pnt(V2); - if (Abs(P1.Z() - P2.Z()) < BRepFill_Confusion()) + if (std::abs(P1.Z() - P2.Z()) < BRepFill_Confusion()) { // It is a Line ? TopLoc_Location Loc; @@ -1470,7 +1470,7 @@ void BRepFill_Evolved::VerticalPerform(const TopoDS_Face& Sp, if (First) { Standard_Real Offset = DistanceToOZ(V1); - if (Abs(Offset) < BRepFill_Confusion()) + if (std::abs(Offset) < BRepFill_Confusion()) { Offset = 0.; } @@ -3034,9 +3034,9 @@ static TopAbs_Orientation Relative(const TopoDS_Wire& W1, Standard_Integer PosOnFace(Standard_Real d1, Standard_Real d2, Standard_Real d3) { - if (Abs(d1 - d2) <= BRepFill_Confusion()) + if (std::abs(d1 - d2) <= BRepFill_Confusion()) return 1; - if (Abs(d1 - d3) <= BRepFill_Confusion()) + if (std::abs(d1 - d3) <= BRepFill_Confusion()) return 3; if (d2 < d3) @@ -3092,7 +3092,7 @@ Standard_Boolean DoubleOrNotInFace(const TopTools_SequenceOfShape& EC, const Top Standard_Real DistanceToOZ(const TopoDS_Vertex& V) { gp_Pnt PV3d = BRep_Tool::Pnt(V); - return Abs(PV3d.Y()); + return std::abs(PV3d.Y()); } //================================================================================================= @@ -3234,7 +3234,8 @@ void CutEdgeProf(const TopoDS_Edge& E, Param = Seq.First(); Seq.Remove(1); Empty = Seq.IsEmpty(); - if (Abs(Param - CurParam) > BRepFill_Confusion() && Abs(Param - l) > BRepFill_Confusion()) + if (std::abs(Param - CurParam) > BRepFill_Confusion() + && std::abs(Param - l) > BRepFill_Confusion()) { VV = BRepLib_MakeVertex(C->Value(Param)); diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Filling.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Filling.cxx index ccf7c57a66..c1af57c4d1 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Filling.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Filling.cxx @@ -679,7 +679,7 @@ void BRepFill_Filling::Build() TColgp_SequenceOfXYZ S3d; myBuilder->Disc2dContour(4, S2d); myBuilder->Disc3dContour(4, 0, S3d); - seuil = Max(myTol3d, 10 * myBuilder->G0Error()); //???????? + seuil = std::max(myTol3d, 10 * myBuilder->G0Error()); //???????? GeomPlate_PlateG0Criterion Criterion(S2d, S3d, seuil); GeomPlate_MakeApprox Approx(GPlate, Criterion, myTol3d, myMaxSegments, myMaxDeg); Surface = Approx.Surface(); diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Generator.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Generator.cxx index b74d9bc43e..e8270f51ff 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Generator.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Generator.cxx @@ -195,12 +195,12 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1, const TopoDS_Edge& Edge2) if (AdC.Circle().Axis().IsCoaxial(axe1, Precision::Angular(), Precision::Confusion())) { // same axis - if (Abs(AdC.Circle().Radius() - dist1) < Precision::Confusion()) + if (std::abs(AdC.Circle().Radius() - dist1) < Precision::Confusion()) { // possibility of cylinder or a piece of cylinder - Standard_Real h1 = Abs(last1 - first1), h2 = Abs(last2 - first2); + Standard_Real h1 = std::abs(last1 - first1), h2 = std::abs(last2 - first2); Standard_Boolean Same, - SameParametricLength = (Abs(h1 - h2) < Precision::PConfusion()); + SameParametricLength = (std::abs(h1 - h2) < Precision::PConfusion()); Standard_Real m1 = (first1 + last1) / 2., m2 = (first2 + last2) / 2.; gp_Pnt P1, P2; gp_Vec DU; @@ -221,9 +221,9 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1, const TopoDS_Edge& Edge2) else { // possibility of cone truncation - Standard_Real h1 = Abs(last1 - first1), h2 = Abs(last2 - first2); + Standard_Real h1 = std::abs(last1 - first1), h2 = std::abs(last2 - first2); Standard_Boolean Same, - SameParametricLength = (Abs(h1 - h2) < Precision::PConfusion()); + SameParametricLength = (std::abs(h1 - h2) < Precision::PConfusion()); Standard_Real m1 = (first1 + last1) / 2., m2 = (first2 + last2) / 2.; gp_Pnt P1, P2; gp_Vec DU; @@ -280,7 +280,7 @@ Standard_Integer DetectKPart(const TopoDS_Edge& Edge1, const TopoDS_Edge& Edge2) if (axe.IsParallel(axe1, Precision::Angular())) { // parallel straight line - if (Abs(dist - dist1) < Precision::Confusion()) + if (std::abs(dist - dist1) < Precision::Confusion()) { gp_Dir dir(gp_Vec(AdC1.Value(first1), AdC.Value(first2))); if (dir.IsNormal(gp_Dir(vec), Precision::Angular())) @@ -469,7 +469,7 @@ Standard_Boolean CreateKPart(const TopoDS_Edge& Edge1, V = -V; } Handle(Geom_CylindricalSurface) Cyl = new Geom_CylindricalSurface(Ac1, c1.Radius()); - surface = new Geom_RectangularTrimmedSurface(Cyl, aa, bb, Min(0., V), Max(0., V)); + surface = new Geom_RectangularTrimmedSurface(Cyl, aa, bb, std::min(0., V), std::max(0., V)); } else if (IType == 2) { @@ -493,10 +493,10 @@ Standard_Boolean CreateKPart(const TopoDS_Edge& Edge1, Ak1.ZReverse(); V = -V; } - Standard_Real Ang = ATan(Rad / V); + Standard_Real Ang = std::atan(Rad / V); Handle(Geom_ConicalSurface) Cone = new Geom_ConicalSurface(Ak1, Ang, k1.Radius()); - V /= Cos(Ang); - surface = new Geom_RectangularTrimmedSurface(Cone, aa, bb, Min(0., V), Max(0., V)); + V /= std::cos(Ang); + surface = new Geom_RectangularTrimmedSurface(Cone, aa, bb, std::min(0., V), std::max(0., V)); } else if (IType == -2) { @@ -511,10 +511,10 @@ Standard_Boolean CreateKPart(const TopoDS_Edge& Edge1, Ak2.ZReverse(); V = -V; } - Standard_Real Ang = ATan(Rad / V); + Standard_Real Ang = std::atan(Rad / V); Handle(Geom_ConicalSurface) Cone = new Geom_ConicalSurface(Ak2, Ang, 0.); - V /= Cos(Ang); - surface = new Geom_RectangularTrimmedSurface(Cone, aa, bb, Min(0., V), Max(0., V)); + V /= std::cos(Ang); + surface = new Geom_RectangularTrimmedSurface(Cone, aa, bb, std::min(0., V), std::max(0., V)); } else if (IType == 3) { @@ -545,7 +545,7 @@ Standard_Boolean CreateKPart(const TopoDS_Edge& Edge1, V = P1P2.Dot(Ax.YDirection()); surface = Plan; // surface = new Geom_RectangularTrimmedSurface - //( Plan, aa, bb, Min(0.,V), Max(0.,V) ); + //( Plan, aa, bb, std::min(0.,V), std::max(0.,V) ); } else if (IType == 5) { @@ -790,8 +790,8 @@ void BRepFill_Generator::Perform() // transform and trim the curves - if (Abs(f1 - C1->FirstParameter()) > Precision::PConfusion() - || Abs(l1 - C1->LastParameter()) > Precision::PConfusion()) + if (std::abs(f1 - C1->FirstParameter()) > Precision::PConfusion() + || std::abs(l1 - C1->LastParameter()) > Precision::PConfusion()) { C1 = new Geom_TrimmedCurve(C1, f1, l1); } @@ -806,8 +806,8 @@ void BRepFill_Generator::Perform() C1->Reverse(); } - if (Abs(f2 - C2->FirstParameter()) > Precision::PConfusion() - || Abs(l2 - C2->LastParameter()) > Precision::PConfusion()) + if (std::abs(f2 - C2->FirstParameter()) > Precision::PConfusion() + || std::abs(l2 - C2->LastParameter()) > Precision::PConfusion()) { C2 = new Geom_TrimmedCurve(C2, f2, l2); } diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_LocationLaw.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_LocationLaw.cxx index 83225c59b9..7a1d770fe5 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_LocationLaw.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_LocationLaw.cxx @@ -47,13 +47,13 @@ static Standard_Real Norm(const gp_Mat& M) Standard_Real R, Norme; gp_XYZ Coord; Coord = M.Row(1); - Norme = Abs(Coord.X()) + Abs(Coord.Y()) + Abs(Coord.Z()); + Norme = std::abs(Coord.X()) + std::abs(Coord.Y()) + std::abs(Coord.Z()); Coord = M.Row(2); - R = Abs(Coord.X()) + Abs(Coord.Y()) + Abs(Coord.Z()); + R = std::abs(Coord.X()) + std::abs(Coord.Y()) + std::abs(Coord.Z()); if (R > Norme) Norme = R; Coord = M.Row(3); - R = Abs(Coord.X()) + Abs(Coord.Y()) + Abs(Coord.Z()); + R = std::abs(Coord.X()) + std::abs(Coord.Y()) + std::abs(Coord.Z()); if (R > Norme) Norme = R; diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_MultiLine.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_MultiLine.cxx index 95a3ed9d0b..dc23401c63 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_MultiLine.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_MultiLine.cxx @@ -69,7 +69,7 @@ static Standard_Boolean isIsoU(const TopoDS_Face& Face, const TopoDS_Edge& Edge) gp_Dir2d D = C->DN(f, 1); - if (Abs(D.Dot(gp::DX2d())) < Abs(D.Dot(gp::DY2d()))) + if (std::abs(D.Dot(gp::DX2d())) < std::abs(D.Dot(gp::DY2d()))) return Standard_True; else return Standard_False; @@ -128,23 +128,23 @@ BRepFill_MultiLine::BRepFill_MultiLine(const TopoDS_Face& Face1, if (First) { First = Standard_False; - Umin = Min(P1.X(), P2.X()); - Umax = Max(P1.X(), P2.X()); + Umin = std::min(P1.X(), P2.X()); + Umax = std::max(P1.X(), P2.X()); - Vmin = Min(P1.Y(), P2.Y()); - Vmax = Max(P1.Y(), P2.Y()); + Vmin = std::min(P1.Y(), P2.Y()); + Vmax = std::max(P1.Y(), P2.Y()); } else { - U = Min(P1.X(), P2.X()); - Umin = Min(Umin, U); - U = Max(P1.X(), P2.X()); - Umax = Max(Umax, U); - - V = Min(P1.Y(), P2.Y()); - Vmin = Min(Vmin, V); - V = Max(P1.Y(), P2.Y()); - Vmax = Max(Vmax, V); + U = std::min(P1.X(), P2.X()); + Umin = std::min(Umin, U); + U = std::max(P1.X(), P2.X()); + Umax = std::max(Umax, U); + + V = std::min(P1.Y(), P2.Y()); + Vmin = std::min(Vmin, V); + V = std::max(P1.Y(), P2.Y()); + Vmax = std::max(Vmax, V); } } @@ -246,23 +246,23 @@ BRepFill_MultiLine::BRepFill_MultiLine(const TopoDS_Face& Face1, if (First) { First = Standard_False; - Umin = Min(P1.X(), P2.X()); - Umax = Max(P1.X(), P2.X()); + Umin = std::min(P1.X(), P2.X()); + Umax = std::max(P1.X(), P2.X()); - Vmin = Min(P1.Y(), P2.Y()); - Vmax = Max(P1.Y(), P2.Y()); + Vmin = std::min(P1.Y(), P2.Y()); + Vmax = std::max(P1.Y(), P2.Y()); } else { - U = Min(P1.X(), P2.X()); - Umin = Min(Umin, U); - U = Max(P1.X(), P2.X()); - Umax = Max(Umax, U); - - V = Min(P1.Y(), P2.Y()); - Vmin = Min(Vmin, V); - V = Max(P1.Y(), P2.Y()); - Vmax = Max(Vmax, V); + U = std::min(P1.X(), P2.X()); + Umin = std::min(Umin, U); + U = std::max(P1.X(), P2.X()); + Umax = std::max(Umax, U); + + V = std::min(P1.Y(), P2.Y()); + Vmin = std::min(Vmin, V); + V = std::max(P1.Y(), P2.Y()); + Vmax = std::max(Vmax, V); } } @@ -370,12 +370,12 @@ BRepFill_MultiLine::BRepFill_MultiLine(const TopoDS_Face& Face1, gp_Pnt2d aPnt2 = ValueOnF1(myBis.FirstParameter() + 0.9 * DeltaU); if (myIsoU1) { - if (Abs(aPnt1.Y() - aPnt2.Y()) < eps) + if (std::abs(aPnt1.Y() - aPnt2.Y()) < eps) myKPart = 1; } else { - if (Abs(aPnt1.X() - aPnt2.X()) < eps) + if (std::abs(aPnt1.X() - aPnt2.X()) < eps) myKPart = 1; } @@ -594,9 +594,9 @@ static gp_Pnt2d ValueOnFace(const Standard_Real U, D1 = P.Distance(TheU.Value(TheU.FirstParameter())); D2 = P.Distance(TheU.Value(TheU.LastParameter())); - if (D1 < Dist || D2 < Dist || Abs(D1 - Dist) < eps || Abs(D2 - Dist) < eps) + if (D1 < Dist || D2 < Dist || std::abs(D1 - Dist) < eps || std::abs(D2 - Dist) < eps) { - if (Abs(D1 - D2) < eps) + if (std::abs(D1 - D2) < eps) { if (TheU.GetType() == GeomAbs_Circle) { @@ -635,18 +635,18 @@ static gp_Pnt2d ValueOnFace(const Standard_Real U, gp_Pnt2d PF = TheV.Value(TheV.FirstParameter()); gp_Pnt2d PL = TheV.Value(TheV.LastParameter()); - if (Abs(Dist - Abs(PF.Y())) < Tol) + if (std::abs(Dist - std::abs(PF.Y())) < Tol) { VV = TheV.FirstParameter(); } - else if (Abs(Dist - Abs(PL.Y())) < Tol) + else if (std::abs(Dist - std::abs(PL.Y())) < Tol) { VV = TheV.LastParameter(); } else { // test if the curve is at the side `negative Y`. - if (Min(PF.Y(), PL.Y()) < -Tol) + if (std::min(PF.Y(), PL.Y()) < -Tol) Dist = -Dist; Handle(Geom2d_Line) Line = new Geom2d_Line(gp_Pnt2d(0., Dist), gp::DX2d()); @@ -698,7 +698,7 @@ static gp_Pnt2d ValueOnFace(const Standard_Real U, std::cout << "Intersector done, but no points found" << std::endl; std::cout << " ---> ValueonFace failed at parameter U = " << U << std::endl; #endif - if (Abs(Dist - PL.Y()) < Abs(Dist - PF.Y())) + if (std::abs(Dist - PL.Y()) < std::abs(Dist - PF.Y())) VV = TheV.LastParameter(); else VV = TheV.FirstParameter(); diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_NSections.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_NSections.cxx index 19a02959cb..ca0df350d4 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_NSections.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_NSections.cxx @@ -296,8 +296,8 @@ static Handle(Geom_BSplineSurface) totalsurf(const TopTools_Array2OfShape& shape for (i = 1; i <= weights.UpperRow() - 1; i++) { // Standard_Real signeddelta = weights(i,j) - weights(i+1,j); - Standard_Real delta = Abs(weights(i, j) - weights(i + 1, j)); - // Standard_Real eps = Epsilon( Abs(weights(i,j)) ); + Standard_Real delta = std::abs(weights(i, j) - weights(i + 1, j)); + // Standard_Real eps = Epsilon( std::abs(weights(i,j)) ); if (delta > TolEps /* || delta > 3.*eps*/) { Vrational = Standard_True; @@ -309,8 +309,8 @@ static Handle(Geom_BSplineSurface) totalsurf(const TopTools_Array2OfShape& shape for (j = 1; j <= weights.UpperCol() - 1; j++) { // Standard_Real signeddelta = weights(i,j) - weights(i,j+1); - Standard_Real delta = Abs(weights(i, j) - weights(i, j + 1)); - // Standard_Real eps = Epsilon( Abs(weights(i,j)) ); + Standard_Real delta = std::abs(weights(i, j) - weights(i, j + 1)); + // Standard_Real eps = Epsilon( std::abs(weights(i,j)) ); if (delta > TolEps /* || delta > 3.*eps*/) { Urational = Standard_True; diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_OffsetWire.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_OffsetWire.cxx index e29885a1e7..04ba09211b 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_OffsetWire.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_OffsetWire.cxx @@ -264,7 +264,7 @@ static Standard_Boolean KPartCircle(const TopoDS_Face& anOffset *= -1; } gp_Circ2d theCirc = AHC->Circle(); - if (anOffset > 0. || Abs(anOffset) < theCirc.Radius()) + if (anOffset > 0. || std::abs(anOffset) < theCirc.Radius()) OC = new Geom2d_Circle(theCirc.Position(), theCirc.Radius() + anOffset); else { @@ -475,7 +475,7 @@ void BRepFill_OffsetWire::Perform(const Standard_Real Offset, const Standard_Rea BRepTools_Substitution aSubst; TopTools_ListIteratorOfListOfShape it(BadEdges); TopTools_ListOfShape aL; - Standard_Real aDefl = .01 * Abs(Offset); + Standard_Real aDefl = .01 * std::abs(Offset); TColStd_SequenceOfReal Parameters; TColgp_SequenceOfPnt Points; @@ -690,7 +690,7 @@ void BRepFill_OffsetWire::PerformWithBiLo(const TopoDS_Face& Spine, } myMap.Clear(); - if (Abs(myOffset) < Precision::Confusion()) + if (std::abs(myOffset) < Precision::Confusion()) { Compute(mySpine, myShape, myMap, Alt); myIsDone = Standard_True; @@ -1683,7 +1683,7 @@ void BRepFill_OffsetWire::FixHoles() BB.Add(Base, anEdge); } theVertex = (IsFirstF) ? V1 : V2; - CommonTol = Max(BRep_Tool::Tolerance(Vf), BRep_Tool::Tolerance(theVertex)); + CommonTol = std::max(BRep_Tool::Tolerance(Vf), BRep_Tool::Tolerance(theVertex)); if (DistF <= CommonTol) { theEdge.Free(Standard_True); @@ -1724,7 +1724,7 @@ void BRepFill_OffsetWire::FixHoles() BB.Add(Base, anEdge); } theVertex = (IsFirstL) ? V1 : V2; - CommonTol = Max(BRep_Tool::Tolerance(Vl), BRep_Tool::Tolerance(theVertex)); + CommonTol = std::max(BRep_Tool::Tolerance(Vl), BRep_Tool::Tolerance(theVertex)); if (DistL <= CommonTol) { theEdge.Free(Standard_True); @@ -1750,7 +1750,7 @@ void BRepFill_OffsetWire::FixHoles() if (TryToClose) { TopExp::Vertices(Base, Vf, Vl); - CommonTol = Max(BRep_Tool::Tolerance(Vf), BRep_Tool::Tolerance(Vl)); + CommonTol = std::max(BRep_Tool::Tolerance(Vf), BRep_Tool::Tolerance(Vl)); TopTools_IndexedDataMapOfShapeListOfShape VEmap; TopExp::MapShapesAndAncestors(Base, TopAbs_VERTEX, TopAbs_EDGE, VEmap); TopoDS_Edge Efirst, Elast; @@ -1853,7 +1853,7 @@ Standard_Integer CutEdge(const TopoDS_Edge& E, CT2d = new Geom2d_TrimmedCurve(C2d, f, l); // if (E.Orientation() == TopAbs_REVERSED) CT2d->Reverse(); - if (CT2d->BasisCurve()->IsKind(STANDARD_TYPE(Geom2d_Circle)) && (Abs(f - l) >= M_PI)) + if (CT2d->BasisCurve()->IsKind(STANDARD_TYPE(Geom2d_Circle)) && (std::abs(f - l) >= M_PI)) { return 0; } @@ -2038,7 +2038,7 @@ void MakeCircle(const TopoDS_Edge& E, GC->D1(f, P, DX); gp_Ax2d Axis(P, gp_Dir2d(DX)); - Handle(Geom2d_Circle) Circ = new Geom2d_Circle(Axis, Abs(Offset), Offset < 0.); + Handle(Geom2d_Circle) Circ = new Geom2d_Circle(Axis, std::abs(Offset), Offset < 0.); // Bind the edges in my Map. TopoDS_Edge OE = BRepLib_MakeEdge(Circ, RefPlane); @@ -2203,7 +2203,7 @@ Standard_Boolean VertexFromNode(const Handle(MAT_Node)& aNode, constexpr Standard_Real Tol = Precision::Confusion(); BRep_Builder B; - if (!aNode->Infinite() && Abs(aNode->Distance() - Offset) < Tol) + if (!aNode->Infinite() && std::abs(aNode->Distance() - Offset) < Tol) { //------------------------------------------------ // the Node gives a vertex on the offset @@ -2309,7 +2309,7 @@ void TrimEdge(const TopoDS_Edge& E, for (Standard_Integer k = 1; k < TheVer.Length(); k++) { if (TheVer.Value(k).IsSame(TheVer.Value(k + 1)) - || Abs(ThePar.Value(k) - ThePar.Value(k + 1)) <= aParTol) + || std::abs(ThePar.Value(k) - ThePar.Value(k + 1)) <= aParTol) { if (k + 1 == TheVer.Length()) @@ -2675,8 +2675,8 @@ static Standard_Boolean PerformCurve(TColStd_SequenceOfReal& Parameters, const Standard_Real EPSILON, const Standard_Integer Nbmin) { - Standard_Real UU1 = Min(U1, U2); - Standard_Real UU2 = Max(U1, U2); + Standard_Real UU1 = std::min(U1, U2); + Standard_Real UU2 = std::max(U1, U2); gp_Pnt Pdeb, Pfin; gp_Vec Ddeb, Dfin; @@ -2818,7 +2818,7 @@ Standard_Boolean CheckSmallParamOnEdge(const TopoDS_Edge& anEdge) ((Handle(BRep_TEdge)::DownCast(anEdge.TShape()))->Curves()).First(); Standard_Real f = (Handle(BRep_GCurve)::DownCast(CRep))->First(); Standard_Real l = (Handle(BRep_GCurve)::DownCast(CRep))->Last(); - if (Abs(l - f) < Precision::PConfusion()) + if (std::abs(l - f) < Precision::PConfusion()) return Standard_False; } return Standard_True; diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Pipe.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Pipe.cxx index 74113cfdd3..c64437ad8c 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Pipe.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Pipe.cxx @@ -125,7 +125,7 @@ static void UpdateTolFromTopOrBottomPCurve(const TopoDS_Face& aFace, TopoDS_Edge if (sqdist > TolTol) TolTol = sqdist; } - Tol = 1.00005 * Sqrt(TolTol); + Tol = 1.00005 * std::sqrt(TolTol); if (Tol >= InitTol) { BRep_Builder BB; diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_PipeShell.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_PipeShell.cxx index b1766a1dd3..8305c82080 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_PipeShell.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_PipeShell.cxx @@ -510,7 +510,7 @@ void BRepFill_PipeShell::Add(const TopoDS_Shape& Profile, myLaw = new Law_Interpol(); Standard_Boolean IsPeriodic = - (Abs(ParAndRad->Value(1).Y() - ParAndRad->Value(NbParRad).Y()) < Precision::Confusion()); + (std::abs(ParAndRad->Value(1).Y() - ParAndRad->Value(NbParRad).Y()) < Precision::Confusion()); (Handle(Law_Interpol)::DownCast(myLaw))->Set(ParAndRad->Array1(), IsPeriodic); } @@ -1054,8 +1054,8 @@ void BRepFill_PipeShell::Prepare() } // medium section between Wmin and Wmax TopoDS_Wire Wres; - Standard_Real dmin = Abs(pmin - V1); - Standard_Real dmax = Abs(pmax - V2); + Standard_Real dmin = std::abs(pmin - V1); + Standard_Real dmax = std::abs(pmax - V2); if (ComputeSection(Wmin, Wmax, dmin, dmax, Wres)) { // impose section Wres at the beginning and the end @@ -1290,7 +1290,7 @@ void BRepFill_PipeShell::BuildHistory(const BRepFill_Sweep& theSweep) SignOfANewEdge = (aNewEdge.Orientation() == TopAbs_FORWARD) ? 1 : -1; Standard_Integer anIndE = mySection->IndexOfEdge(aNewEdge); SignOfIndex = (anIndE > 0) ? 1 : -1; - anIndE = Abs(anIndE); + anIndE = std::abs(anIndE); // For an edge generated shape is a "tape" - // a shell usually containing this edge and // passing from beginning of path to its end @@ -1305,8 +1305,8 @@ void BRepFill_PipeShell::BuildHistory(const BRepFill_Sweep& theSweep) // for each vertex of edge Standard_Integer ToReverse = SignOfAnEdge * SignOfANewEdge * SignOfIndex; Standard_Integer UIndex[2]; - UIndex[0] = Abs(mySection->IndexOfEdge(NewEdges.First())); - UIndex[1] = Abs(mySection->IndexOfEdge(NewEdges.Last())) + ToReverse; + UIndex[0] = std::abs(mySection->IndexOfEdge(NewEdges.First())); + UIndex[1] = std::abs(mySection->IndexOfEdge(NewEdges.Last())) + ToReverse; if (ToReverse == -1) { UIndex[0]++; diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_SectionPlacement.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_SectionPlacement.cxx index c9d5950069..6990a093f8 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_SectionPlacement.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_SectionPlacement.cxx @@ -140,12 +140,12 @@ void BRepFill_SectionPlacement::Perform(const Standard_Boolean WithContact, TopoDS_Vertex aLastVertex; TopExp::Vertices(anEdge, aFirstVertex, aLastVertex); const Standard_Real aVertexTolerance = - Max(BRep_Tool::Tolerance(aFirstVertex), BRep_Tool::Tolerance(aLastVertex)); + std::max(BRep_Tool::Tolerance(aFirstVertex), BRep_Tool::Tolerance(aLastVertex)); aTrimmedCurve = new Geom_TrimmedCurve(aCurve, anEdgeStartParam, anEdgeEndParam); - if (!aBSplineConverter.Add(aTrimmedCurve, Min(aPrecisionTolerance, aVertexTolerance))) + if (!aBSplineConverter.Add(aTrimmedCurve, std::min(aPrecisionTolerance, aVertexTolerance))) { - aBSplineConverter.Add(aTrimmedCurve, Max(aPrecisionTolerance, aVertexTolerance)); + aBSplineConverter.Add(aTrimmedCurve, std::max(aPrecisionTolerance, aVertexTolerance)); } } aCurve = aBSplineConverter.BSplineCurve(); @@ -183,11 +183,11 @@ void BRepFill_SectionPlacement::Perform(const Standard_Boolean WithContact, } aLawIndex1 = aLawIndex; - if ((Abs(aSectionParam - aCurrKnotParam) < aParamConfusion) && (aLawIndex > 1)) + if ((std::abs(aSectionParam - aCurrKnotParam) < aParamConfusion) && (aLawIndex > 1)) { aLawIndex2 = aLawIndex - 1; } - else if ((Abs(aSectionParam - aNextKnotParam) < aParamConfusion) + else if ((std::abs(aSectionParam - aNextKnotParam) < aParamConfusion) && (aLawIndex < myLaw->NbLaw())) { aLawIndex2 = aLawIndex + 1; diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_ShapeLaw.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_ShapeLaw.cxx index 822c0bebbb..3d83a8f541 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_ShapeLaw.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_ShapeLaw.cxx @@ -156,7 +156,7 @@ void BRepFill_ShapeLaw::Init(const Standard_Boolean Build) } Standard_Boolean IsClosed = BRep_Tool::IsClosed(E); - if (IsClosed && Abs(C->FirstParameter() - First) > Precision::PConfusion()) + if (IsClosed && std::abs(C->FirstParameter() - First) > Precision::PConfusion()) IsClosed = Standard_False; // trimmed curve differs if ((ii > 1) || !IsClosed) diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Sweep.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Sweep.cxx index 1e4b561a03..d958c6f0c4 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Sweep.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_Sweep.cxx @@ -270,7 +270,7 @@ static Standard_Boolean CheckSameParameter(const Handle(Adaptor3d_Curve)& C3d, gp_Pnt pS = S->Value(u, v); gp_Pnt pC = C3d->Value(t); Standard_Real d2 = pS.SquareDistance(pC); - tolreached = Max(tolreached, d2); + tolreached = std::max(tolreached, d2); } tolreached = sqrt(tolreached); if (tolreached > tol3d) @@ -279,7 +279,7 @@ static Standard_Boolean CheckSameParameter(const Handle(Adaptor3d_Curve)& C3d, return Standard_False; } tolreached *= 2.; - tolreached = Max(tolreached, Precision::Confusion()); + tolreached = std::max(tolreached, Precision::Confusion()); return Standard_True; } @@ -306,7 +306,7 @@ static Standard_Boolean CheckSameParameterExact( } else { - tolreached = Max(tolreached, Precision::Confusion()); + tolreached = std::max(tolreached, Precision::Confusion()); tolreached *= 1.05; } return Standard_True; @@ -458,13 +458,13 @@ static void Oriente(const Handle(Geom_Surface)& S, TopoDS_Edge& E) if (isuiso) { - isfirst = (Abs(P.X() - UFirst) < Precision::Confusion()); + isfirst = (std::abs(P.X() - UFirst) < Precision::Confusion()); isopposite = D.IsOpposite(VRef, 0.1); E.Orientation(TopAbs_REVERSED); } else { - isfirst = (Abs(P.Y() - VFirst) < Precision::Confusion()); + isfirst = (std::abs(P.Y() - VFirst) < Precision::Confusion()); isopposite = D.IsOpposite(URef, 0.1); E.Orientation(TopAbs_FORWARD); } @@ -485,7 +485,7 @@ static void UpdateEdgeOnPlane(const TopoDS_Face& F, const TopoDS_Edge& E, const Standard_Real Tol = BRep_Tool::Tolerance(E); BB.UpdateEdge(E, C2d, S, Loc, Tol); BRepCheck_Edge Check(E); - Tol = Max(Tol, Check.Tolerance()); + Tol = std::max(Tol, Check.Tolerance()); BB.UpdateEdge(E, Tol); TopoDS_Vertex V; Tol *= 1.01; @@ -531,10 +531,10 @@ static void BuildFace(const Handle(Geom_Surface)& S, Tol2 = BRep_Tool::Tolerance(E2); Tol3 = BRep_Tool::Tolerance(E3); Tol4 = BRep_Tool::Tolerance(E4); - // Tol = Min( BT.Tolerance(E1), BT.Tolerance(E2)); - Tol = Min(Tol1, Tol2); - // Tol = Min(Tol, Min(BT.Tolerance(E3),BT.Tolerance(E4))); - Tol = Min(Tol, Min(Tol3, Tol4)); + // Tol = std::min( BT.Tolerance(E1), BT.Tolerance(E2)); + Tol = std::min(Tol1, Tol2); + // Tol = std::min(Tol, std::min(BT.Tolerance(E3),BT.Tolerance(E4))); + Tol = std::min(Tol, std::min(Tol3, Tol4)); Standard_Boolean IsPlan = Standard_False; Handle(Geom_Plane) thePlane; @@ -753,7 +753,7 @@ static TopoDS_Edge BuildEdge(Handle(Geom_Curve)& C3d, const gp_Pnt P2 = BRep_Tool::Pnt(VL); // Tol2 = BT.Tolerance(VF); Tol2 = BRep_Tool::Tolerance(VL); - Tol = Max(Tol1, Tol2); + Tol = std::max(Tol1, Tol2); if (VF.IsSame(VL) || (P1.Distance(P2) < Tol)) { @@ -1977,8 +1977,8 @@ void BRepFill_Sweep::SetTolerance(const Standard_Real Tol3d, void BRepFill_Sweep::SetAngularControl(const Standard_Real MinAngle, const Standard_Real MaxAngle) { - myAngMin = Max(MinAngle, Precision::Angular()); - myAngMax = Min(MaxAngle, 6.28); + myAngMin = std::max(MinAngle, Precision::Angular()); + myAngMax = std::min(MaxAngle, 6.28); } //======================================================================= @@ -2693,7 +2693,8 @@ Standard_Boolean BRepFill_Sweep::BuildShell(const BRepFill_TransitionStyle /*Tra if (singu || singv) { - Degenerated(isec, ipath) = IsDegen(TabS(isec, ipath), Max(myTol3d, TabErr(isec, ipath))); + Degenerated(isec, ipath) = + IsDegen(TabS(isec, ipath), std::max(myTol3d, TabErr(isec, ipath))); } if (Degenerated(isec, ipath)) { @@ -3742,14 +3743,15 @@ Standard_Real BRepFill_Sweep::EvalExtrapol(const Standard_Integer Index, Box(Sec, U, box); box.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); - R = Max(Max(Abs(Xmin), Abs(Xmax)), Max(Abs(Ymin), Abs(Ymax))); + R = + std::max(std::max(std::abs(Xmin), std::abs(Xmax)), std::max(std::abs(Ymin), std::abs(Ymax))); // R *= 1.1; // modified by NIZHNY-MKK Fri Oct 31 18:57:51 2003 // Standard_Real coef = 1.2; Standard_Real coef = 2.; R *= coef; - Extrap = Max(Abs(Zmin), Abs(Zmax)) + 100 * myTol3d; - Extrap += R * Tan(alpha / 2); + Extrap = std::max(std::abs(Zmin), std::abs(Zmax)) + 100 * myTol3d; + Extrap += R * std::tan(alpha / 2); } return Extrap; } @@ -3765,8 +3767,8 @@ Standard_Boolean BRepFill_Sweep::MergeVertex(const TopoDS_Shape& V1, TopoDS_Shap const TopoDS_Vertex& v1 = TopoDS::Vertex(V1); const TopoDS_Vertex& v2 = TopoDS::Vertex(V2); Standard_Real tol; - // tol = Max(BT.Tolerance(v1), BT.Tolerance(v2)); - tol = Max(BRep_Tool::Tolerance(v1), BRep_Tool::Tolerance(v2)); + // tol = std::max(BT.Tolerance(v1), BT.Tolerance(v2)); + tol = std::max(BRep_Tool::Tolerance(v1), BRep_Tool::Tolerance(v2)); if (tol < myTol3d) tol = myTol3d; // if (BT.Pnt(v1).Distance(BT.Pnt(v2)) <= tol ){ diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_TrimEdgeTool.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_TrimEdgeTool.cxx index a15db88eca..7cbefcf01e 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_TrimEdgeTool.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_TrimEdgeTool.cxx @@ -205,7 +205,8 @@ static void EvalParameters(const Geom2dAdaptor_Curve& Bis, Seg = Intersector.Segment(i); U1 = Seg.FirstPoint().ParamOnSecond(); Standard_Real Ulast = Seg.LastPoint().ParamOnSecond(); - if (Abs(U1 - CBis.FirstParameter()) <= Tol && Abs(Ulast - CBis.LastParameter()) <= Tol) + if (std::abs(U1 - CBis.FirstParameter()) <= Tol + && std::abs(Ulast - CBis.LastParameter()) <= Tol) { P = gp_Pnt(U1, Seg.FirstPoint().ParamOnFirst(), 0.); Params.Append(P); @@ -274,7 +275,8 @@ static void EvalParametersBis(const Geom2dAdaptor_Curve& Bis, Seg = Intersector.Segment(i); U1 = Seg.FirstPoint().ParamOnSecond(); Standard_Real Ulast = Seg.LastPoint().ParamOnSecond(); - if (Abs(U1 - CBis.FirstParameter()) <= Tol && Abs(Ulast - CBis.LastParameter()) <= Tol) + if (std::abs(U1 - CBis.FirstParameter()) <= Tol + && std::abs(Ulast - CBis.LastParameter()) <= Tol) { P = gp_Pnt(U1, Seg.FirstPoint().ParamOnFirst(), 0.); Params.Append(P); @@ -398,7 +400,7 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1, par = ElCLib::Parameter(anL, aP); if (par >= myBis.FirstParameter() && par <= myBis.LastParameter()) { - d = Min(anL.SquareDistance(aP), d); + d = std::min(anL.SquareDistance(aP), d); } isFar1 = d > dmax; // @@ -413,7 +415,7 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1, par = ElCLib::Parameter(anL, aP); if (par >= myBis.FirstParameter() && par <= myBis.LastParameter()) { - d = Min(anL.SquareDistance(aP), d); + d = std::min(anL.SquareDistance(aP), d); } isFar2 = d > dmax; // @@ -535,11 +537,11 @@ void BRepFill_TrimEdgeTool::IntersectWith(const TopoDS_Edge& Edge1, } i = 1; - while (i <= Min(Params.Length(), Points2.Length())) + while (i <= std::min(Params.Length(), Points2.Length())) { P1 = Params(i); P2 = Points2(i); - Standard_Real P1xP2x = Abs(P1.X() - P2.X()); + Standard_Real P1xP2x = std::abs(P1.X() - P2.X()); if (P1xP2x > Tol) { @@ -778,14 +780,14 @@ Standard_Boolean BRepFill_TrimEdgeTool::IsInside(const gp_Pnt2d& P) const // should be performed in any case, despite of the results of projection. gp_Pnt2d PF = myC1->Value(myC1->FirstParameter()); gp_Pnt2d PL = myC1->Value(myC1->LastParameter()); - Standard_Real aDistMin = Min(P.Distance(PF), P.Distance(PL)); + Standard_Real aDistMin = std::min(P.Distance(PF), P.Distance(PL)); if (Dist > aDistMin) Dist = aDistMin; // Modified by Sergey KHROMOV - Fri Sep 27 11:43:44 2002 End } - // return (Dist < Abs(myOffset); - // return (Dist < Abs(myOffset) + Precision::Confusion()); - return (Dist < Abs(myOffset) - Precision::Confusion()); + // return (Dist < std::abs(myOffset); + // return (Dist < std::abs(myOffset) + Precision::Confusion()); + return (Dist < std::abs(myOffset) - Precision::Confusion()); } diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_TrimShellCorner.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_TrimShellCorner.cxx index 8b930898ff..56d169de8d 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_TrimShellCorner.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_TrimShellCorner.cxx @@ -281,13 +281,13 @@ void BRepFill_TrimShellCorner::Perform() TopExp_Explorer anExp(myShape1, TopAbs_VERTEX); for (; anExp.More(); anExp.Next()) { - aMaxTol = Max(aMaxTol, BRep_Tool::Tolerance(TopoDS::Vertex(anExp.Current()))); + aMaxTol = std::max(aMaxTol, BRep_Tool::Tolerance(TopoDS::Vertex(anExp.Current()))); } anExp.Init(myShape2, TopAbs_VERTEX); for (; anExp.More(); anExp.Next()) { - aMaxTol = Max(aMaxTol, BRep_Tool::Tolerance(TopoDS::Vertex(anExp.Current()))); + aMaxTol = std::max(aMaxTol, BRep_Tool::Tolerance(TopoDS::Vertex(anExp.Current()))); } Standard_Real aFuzzy = 4. * Precision::Confusion(); @@ -298,7 +298,7 @@ void BRepFill_TrimShellCorner::Perform() aPF.SetArguments(aLS); if (aMaxTol < 1.005 * Precision::Confusion()) { - aFuzzy = Max(aPF.FuzzyValue(), aFuzzy); + aFuzzy = std::max(aPF.FuzzyValue(), aFuzzy); aPF.SetFuzzyValue(aFuzzy); } // diff --git a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_TrimSurfaceTool.cxx b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_TrimSurfaceTool.cxx index f28ae362dd..bb9a767bed 100644 --- a/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_TrimSurfaceTool.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepFill/BRepFill_TrimSurfaceTool.cxx @@ -159,7 +159,7 @@ static Standard_Real EvalPhase(const TopoDS_Edge& Edge, if (!TopoDS::Edge(Exp.Current()).IsSame(Edge)) { BRep_Tool::UVPoints(TopoDS::Edge(Exp.Current()), Face, PF1, PF2); - V = (Abs(PF1.Y() - VDeg) > Abs(PF2.Y() - VDeg)) ? PF1.Y() : PF2.Y(); + V = (std::abs(PF1.Y() - VDeg) > std::abs(PF2.Y() - VDeg)) ? PF1.Y() : PF2.Y(); break; } } @@ -323,8 +323,8 @@ static void EvalParameters(const TopoDS_Edge& Edge, // Infinite * Infinite => Exception: DefaultNumericError // Case encounered: UBis < Precision::Infinite() // but PBis.X() > Precision::Infinite() - if (Precision::IsPositiveInfinite(Abs(PBis.X())) || Precision::IsPositiveInfinite(Abs(PBis.Y())) - || PBis.Distance(P2d) > Tol) + if (Precision::IsPositiveInfinite(std::abs(PBis.X())) + || Precision::IsPositiveInfinite(std::abs(PBis.Y())) || PBis.Distance(P2d) > Tol) { // modified by NIZHNY-EAP Wed Jan 12 11:41:40 2000 ___END___ UBis = Bis->LastParameter(); diff --git a/src/ModelingAlgorithms/TKBool/BRepProj/BRepProj_Projection.cxx b/src/ModelingAlgorithms/TKBool/BRepProj/BRepProj_Projection.cxx index 29eca18ac6..580c535f10 100644 --- a/src/ModelingAlgorithms/TKBool/BRepProj/BRepProj_Projection.cxx +++ b/src/ModelingAlgorithms/TKBool/BRepProj/BRepProj_Projection.cxx @@ -222,7 +222,7 @@ BRepProj_Projection::BRepProj_Projection(const TopoDS_Shape& Wire, // compute the ratio of the scale transformation Standard_Real Scale = PC.Distance(P); - if (Abs(Scale) < Precision::Confusion()) + if (std::abs(Scale) < Precision::Confusion()) throw Standard_ConstructionError("Projection"); Scale = 1. + mdis / Scale; diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_DSFiller.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_DSFiller.cxx index de01eb0b1a..99772622e5 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_DSFiller.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_DSFiller.cxx @@ -374,7 +374,7 @@ static Standard_Boolean FUN_shareNOG(const Handle(TopOpeBRepDS_HDataStructure)& gp_Vec tge1 = FUN_tool_tggeomE(par1, e1); gp_Vec tge2 = FUN_tool_tggeomE(par2, e2); Standard_Real dot = gp_Dir(tge1).Dot(gp_Dir(tge2)); - Standard_Real x = Abs(1 - Abs(dot)); + Standard_Real x = std::abs(1 - std::abs(dot)); if (x > tola) return Standard_False; // e1,e2 not tangent diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_EdgesIntersector.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_EdgesIntersector.cxx index 1b7a60193a..17c6334257 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_EdgesIntersector.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_EdgesIntersector.cxx @@ -271,8 +271,8 @@ static Standard_Boolean IsTangentSegment(const IntRes2d_IntersectionPoint& P1, if (aSqrDistPP <= aTolConf) { - Standard_Real aParDist1 = Abs(P1.ParamOnFirst() - P2.ParamOnFirst()); - Standard_Real aParDist2 = Abs(P1.ParamOnSecond() - P2.ParamOnSecond()); + Standard_Real aParDist1 = std::abs(P1.ParamOnFirst() - P2.ParamOnFirst()); + Standard_Real aParDist2 = std::abs(P1.ParamOnSecond() - P2.ParamOnSecond()); Standard_Real aResol1 = aC1.Resolution(aTolConf); Standard_Real aResol2 = aC2.Resolution(aTolConf); @@ -597,7 +597,7 @@ void TopOpeBRep_EdgesIntersector::Perform(const TopoDS_Shape& E1, nbp--; } // Modified by Sergey KHROMOV - Fri Jan 11 10:31:38 2002 Begin - else if (IsTangentSegment(P1, P2, myCurve1, myCurve2, Max(tol1, tol2))) + else if (IsTangentSegment(P1, P2, myCurve1, myCurve2, std::max(tol1, tol2))) { const IntRes2d_Transition& aTrans = P2.TransitionOfFirst(); @@ -746,7 +746,7 @@ Standard_Boolean TopOpeBRep_EdgesIntersector::ComputeSameDomain() Standard_Real r2 = c2.Radius(); // Standard_Boolean rr = (r1 == r2); // clang-format off - Standard_Boolean rr = (Abs(r1-r2) < Precision::Confusion()); //xpu281098 (cto019D2) tolerance a revoir + Standard_Boolean rr = (std::abs(r1-r2) < Precision::Confusion()); //xpu281098 (cto019D2) tolerance a revoir if (!rr) return SetSameDomain(Standard_False); const gp_Pnt2d& p1 = c1.Location(); @@ -1089,7 +1089,7 @@ const TopOpeBRep_Point2d& TopOpeBRep_EdgesIntersector::Point(const Standard_Inte Standard_Real TopOpeBRep_EdgesIntersector::ToleranceMax() const { - Standard_Real tol = Max(myTol1, myTol2); + Standard_Real tol = std::max(myTol1, myTol2); return tol; } diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_EdgesIntersector_1.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_EdgesIntersector_1.cxx index ad5cc981ed..5cf52b0e12 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_EdgesIntersector_1.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_EdgesIntersector_1.cxx @@ -373,7 +373,7 @@ Standard_Boolean TopOpeBRep_EdgesIntersector::IsVertex1(const Standard_Integer I if (V.Orientation() == TopAbs_INTERNAL) { Standard_Real parV = BRep_Tool::Parameter(V, E, myFace1); - if (Abs(par - parV) <= Precision::PConfusion()) + if (std::abs(par - parV) <= Precision::PConfusion()) { myIsVertexValue = Standard_True; myIsVertexVertex = V; diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_FaceEdgeIntersector.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_FaceEdgeIntersector.cxx index cf444dbcf8..554751647d 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_FaceEdgeIntersector.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_FaceEdgeIntersector.cxx @@ -359,7 +359,7 @@ Standard_Integer TopOpeBRep_FaceEdgeIntersector::Index() const void TopOpeBRep_FaceEdgeIntersector::ShapeTolerances(const TopoDS_Shape& S1, const TopoDS_Shape& S2) { - myTol = Max(ToleranceMax(S1, TopAbs_EDGE), ToleranceMax(S2, TopAbs_EDGE)); + myTol = std::max(ToleranceMax(S1, TopAbs_EDGE), ToleranceMax(S2, TopAbs_EDGE)); myForceTolerance = Standard_False; #ifdef OCCT_DEBUG @@ -386,7 +386,7 @@ Standard_Real TopOpeBRep_FaceEdgeIntersector::ToleranceMax(const TopoDS_Shape& { Standard_Real tol = RealFirst(); for (; e.More(); e.Next()) - tol = Max(tol, TopOpeBRepTool_ShapeTool::Tolerance(e.Current())); + tol = std::max(tol, TopOpeBRepTool_ShapeTool::Tolerance(e.Current())); return tol; } } diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_FacesFiller_1.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_FacesFiller_1.cxx index 8583206965..41d632d98c 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_FacesFiller_1.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_FacesFiller_1.cxx @@ -620,7 +620,7 @@ static Standard_Boolean FUN_brep_ONfirstP(const TopOpeBRep_VPointInter& vpf, Standard_Real parcur = VP.ParameterOnLine(); Standard_Real d = parcur - parfirst; Standard_Real tol = Precision::Confusion(); // nyixpu051098 : see lbr... - Standard_Boolean ONfirstP = (Abs(d) < tol); + Standard_Boolean ONfirstP = (std::abs(d) < tol); return ONfirstP; } @@ -1232,7 +1232,7 @@ void TopOpeBRep_FacesFiller::AddShapesLine() Standard_Real pmin, pmax; myHDS->MinMaxOnParameter(myDSCIL, pmin, pmax); - Standard_Real d = Abs(pmin - pmax); + Standard_Real d = std::abs(pmin - pmax); Standard_Boolean id = (d <= Precision::PConfusion()); Standard_Boolean isper = myLine->IsPeriodic(); id = (id && !isper); @@ -1273,7 +1273,7 @@ void TopOpeBRep_FacesFiller::AddShapesLine() toll = BRep_Tool::Tolerance(vl); } - tol = Max(tolf, toll); + tol = std::max(tolf, toll); Standard_Boolean onsampt = Standard_True; for (Standard_Integer ii = 1; ii <= myLine->NbWPoint(); ii++) { @@ -1305,8 +1305,8 @@ void TopOpeBRep_FacesFiller::AddShapesLine() BndLib_Add3dCurve::Add(theCurve, 0., theBox); Standard_Real Xmin, Ymin, Zmin, Xmax, Ymax, Zmax, MaxSide; theBox.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); - MaxSide = Max(Max(Xmax - Xmin, Ymax - Ymin), Zmax - Zmin); - Standard_Real MinTol = Min(BRep_Tool::Tolerance(myF1), BRep_Tool::Tolerance(myF2)); + MaxSide = std::max(std::max(Xmax - Xmin, Ymax - Ymin), Zmax - Zmin); + Standard_Real MinTol = std::min(BRep_Tool::Tolerance(myF1), BRep_Tool::Tolerance(myF2)); if (MaxSide < MinTol) { DSC.ChangeKeep(Standard_False); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_FacesIntersector.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_FacesIntersector.cxx index c4602b16ca..083e19087b 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_FacesIntersector.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_FacesIntersector.cxx @@ -214,7 +214,7 @@ void TopOpeBRep_FacesIntersector::Perform(const TopoDS_Shape& F1, Standard_Real tol1 = myTol1; Standard_Real tol2 = myTol2; - GLOBAL_tolFF = Max(tol1, tol2); + GLOBAL_tolFF = std::max(tol1, tol2); #ifdef OCCT_DEBUG if (TopOpeBRep_GettraceFITOL()) @@ -595,7 +595,7 @@ void TopOpeBRep_FacesIntersector::ShapeTolerances(const TopoDS_Shape& S1, const void TopOpeBRep_FacesIntersector::ShapeTolerances(const TopoDS_Shape&, const TopoDS_Shape&) #endif { - // myTol1 = Max(ToleranceMax(S1,TopAbs_EDGE),ToleranceMax(S2,TopAbs_EDGE)); + // myTol1 = std::max(ToleranceMax(S1,TopAbs_EDGE),ToleranceMax(S2,TopAbs_EDGE)); myTol1 = Precision::Confusion(); myTol2 = myTol1; myForceTolerances = Standard_False; @@ -623,7 +623,7 @@ Standard_Real TopOpeBRep_FacesIntersector::ToleranceMax(const TopoDS_Shape& S { Standard_Real tol = RealFirst(); for (; e.More(); e.Next()) - tol = Max(tol, TopOpeBRepTool_ShapeTool::Tolerance(e.Current())); + tol = std::max(tol, TopOpeBRepTool_ShapeTool::Tolerance(e.Current())); return tol; } } @@ -722,7 +722,7 @@ static Handle(IntPatch_RLine) BuildRLineBasedOnWLine(const Handle(IntPatch_WLine Standard_Real tol = (Vtx1.Tolerance() > Vtx2.Tolerance()) ? Vtx1.Tolerance() : Vtx2.Tolerance(); - if (Abs(par1 - par2) < theArc->Resolution(tol)) + if (std::abs(par1 - par2) < theArc->Resolution(tol)) return anRLine; Standard_Boolean IsOnFirst = (theRank == 1); @@ -1400,14 +1400,14 @@ static Standard_Integer GetArc(IntPatch_SequenceOfLine& theSlin, TopoDS_Edge* anE = (TopoDS_Edge*)anEAddress; TopoDS_Vertex V1, V2; TopExp::Vertices(*anE, V1, V2); - Standard_Real MaxVertexTol = Max(BRep_Tool::Tolerance(V1), BRep_Tool::Tolerance(V2)); + Standard_Real MaxVertexTol = std::max(BRep_Tool::Tolerance(V1), BRep_Tool::Tolerance(V2)); theVrtxTol = MaxVertexTol; Standard_Real EdgeTol = BRep_Tool::Tolerance(*anE); - CheckTol = Max(MaxVertexTol, EdgeTol); + CheckTol = std::max(MaxVertexTol, EdgeTol); Handle(Geom_Curve) aCEdge = BRep_Tool::Curve(*anE, firstES1, lastES1); // classification gaps // a. min - first - if (Abs(firstES1 - WLVertexParameters.Value(1)) > arc->Resolution(MaxVertexTol)) + if (std::abs(firstES1 - WLVertexParameters.Value(1)) > arc->Resolution(MaxVertexTol)) { Standard_Real param = (firstES1 + WLVertexParameters.Value(1)) / 2.; gp_Pnt point; @@ -1419,7 +1419,7 @@ static Standard_Integer GetArc(IntPatch_SequenceOfLine& theSlin, } } // b. max - last - if (Abs(lastES1 - WLVertexParameters.Value(WLVertexParameters.Length())) + if (std::abs(lastES1 - WLVertexParameters.Value(WLVertexParameters.Length())) > arc->Resolution(MaxVertexTol)) { Standard_Real param = (lastES1 + WLVertexParameters.Value(WLVertexParameters.Length())) / 2.; @@ -1435,7 +1435,7 @@ static Standard_Integer GetArc(IntPatch_SequenceOfLine& theSlin, Standard_Integer NbChkPnts = WLVertexParameters.Length() / 2 - 1; for (i = 1; i <= NbChkPnts; i++) { - if (Abs(WLVertexParameters.Value(i * 2 + 1) - WLVertexParameters.Value(i * 2)) + if (std::abs(WLVertexParameters.Value(i * 2 + 1) - WLVertexParameters.Value(i * 2)) > arc->Resolution(MaxVertexTol)) { Standard_Real param = @@ -1456,7 +1456,7 @@ static Standard_Integer GetArc(IntPatch_SequenceOfLine& theSlin, // if classification gaps OK, fill sequence by the points from arc (edge) Standard_Real ParamFirst = WLVertexParameters.Value(1); Standard_Real ParamLast = WLVertexParameters.Value(WLVertexParameters.Length()); - Standard_Real dParam = Abs(ParamLast - ParamFirst) / 100.; + Standard_Real dParam = std::abs(ParamLast - ParamFirst) / 100.; Standard_Real cParam = ParamFirst; for (i = 0; i < 100; i++) { diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_Hctxff2d.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_Hctxff2d.cxx index d5cfc20bb8..f06bdc74c5 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_Hctxff2d.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_Hctxff2d.cxx @@ -157,7 +157,7 @@ void TopOpeBRep_Hctxff2d::GetTolerances(Standard_Real& Tol1, Standard_Real& Tol2 Standard_Real TopOpeBRep_Hctxff2d::GetMaxTolerance() const { - Standard_Real tol = Max(myTol1, myTol2); + Standard_Real tol = std::max(myTol1, myTol2); return tol; } diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_LineInter.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_LineInter.cxx index 743fcfdae4..9a5ac770c4 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_LineInter.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_LineInter.cxx @@ -297,7 +297,7 @@ void TopOpeBRep_LineInter::SetIsVClosed() const Standard_Real tol1 = P1.Tolerance(); const Standard_Real tol2 = P2.Tolerance(); - const Standard_Real tol = Max(tol1, tol2); + const Standard_Real tol = std::max(tol1, tol2); myIsVClosed = pp1.IsEqual(pp2, tol); } diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_PointGeomTool.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_PointGeomTool.cxx index cb2cb41a92..987c6ec66a 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_PointGeomTool.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_PointGeomTool.cxx @@ -50,14 +50,14 @@ TopOpeBRepDS_Point TopOpeBRep_PointGeomTool::MakePoint(const TopOpeBRep_VPointIn const TopoDS_Edge& E2 = TopoDS::Edge(IP.Edge(2)); Standard_Real t1 = BRep_Tool::Tolerance(E1); Standard_Real t2 = BRep_Tool::Tolerance(E2); - // tolout = Max(t1,t2); + // tolout = std::max(t1,t2); if (t1 > 0.9) t1 = 0.9; if (t1 > 0.9) t1 = 0.9; tolout = 2.5 * (t1 + t2); } - tolout = Max(tolout, tolip); + tolout = std::max(tolout, tolip); return TopOpeBRepDS_Point(IP.Value(), tolout); } diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_ProcessGR.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_ProcessGR.cxx index 162662dc21..5816822dbd 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_ProcessGR.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_ProcessGR.cxx @@ -226,10 +226,10 @@ void TopOpeBRep_FacesFiller::Lminmax(const TopOpeBRep_LineInter& L, { const TopOpeBRep_VPointInter& VP = VPI.CurrentVP(); Standard_Real p = VP.ParameterOnLine(); - pmin = Min(pmin, p); - pmax = Max(pmax, p); + pmin = std::min(pmin, p); + pmax = std::max(pmax, p); } - Standard_Real d = Abs(pmin - pmax); + Standard_Real d = std::abs(pmin - pmax); Standard_Boolean id = (d <= Precision::PConfusion()); Standard_Boolean isper = L.IsPeriodic(); Standard_Integer n = L.NbVPoint(); @@ -264,7 +264,7 @@ Standard_Boolean TopOpeBRep_FacesFiller::LSameDomainERL(const TopOpeBRep_LineInt Standard_Real f, l; TopOpeBRep_FacesFiller::Lminmax(L, f, l); - Standard_Real d = Abs(f - l); + Standard_Real d = std::abs(f - l); { Standard_Boolean idINL = (L.INL() && (d == 0)); // null length line, made of VPoints only @@ -288,7 +288,7 @@ Standard_Boolean TopOpeBRep_FacesFiller::LSameDomainERL(const TopOpeBRep_LineInt { const TopoDS_Edge& E = TopoDS::Edge(it.Value()); Standard_Real tolE = BRep_Tool::Tolerance(E); - Standard_Real maxtol = Max(tolE, GLOBAL_tolFF); + Standard_Real maxtol = std::max(tolE, GLOBAL_tolFF); BRepAdaptor_Curve BAC(E); f = BAC.FirstParameter(); l = BAC.LastParameter(); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_ProcessSectionEdges.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_ProcessSectionEdges.cxx index 520cfd1a7f..be9eaeef3f 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_ProcessSectionEdges.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_ProcessSectionEdges.cxx @@ -194,7 +194,7 @@ Standard_Boolean TopOpeBRep_FacesFiller::KeepRLine(const TopOpeBRep_LineInter& L Standard_Real tolf = vpf.Tolerance(); gp_Pnt ptf = vpf.Value(); Standard_Real d = ptf.Distance(ptclo); - Standard_Boolean sameclo = (d < Max(tolvclo, tolf)); + Standard_Boolean sameclo = (d < std::max(tolvclo, tolf)); if (!sameclo) return Standard_False; } @@ -276,7 +276,7 @@ Standard_EXPORT Standard_Boolean FUN_brep_sdmRE(const TopoDS_Edge& E1, const Top Standard_Real tol1 = BRep_Tool::Tolerance(E1); Standard_Real tol2 = BRep_Tool::Tolerance(v3); Standard_Real tol3 = BRep_Tool::Tolerance(v4); - Standard_Real tol4 = Max(tol1, Max(tol2, tol3)); + Standard_Real tol4 = std::max(tol1, std::max(tol2, tol3)); if (!ok) { const gp_Pnt& P3 = BRep_Tool::Pnt(v3); @@ -294,7 +294,7 @@ Standard_EXPORT Standard_Boolean FUN_brep_sdmRE(const TopoDS_Edge& E1, const Top Standard_Real tol1 = BRep_Tool::Tolerance(E2); Standard_Real tol2 = BRep_Tool::Tolerance(v1); Standard_Real tol3 = BRep_Tool::Tolerance(v2); - Standard_Real tol4 = Max(tol1, Max(tol2, tol3)); + Standard_Real tol4 = std::max(tol1, std::max(tol2, tol3)); if (!ok) { const gp_Pnt& P1 = BRep_Tool::Pnt(v1); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_ShapeIntersector.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_ShapeIntersector.cxx index f5f0e2b257..b715136125 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_ShapeIntersector.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_ShapeIntersector.cxx @@ -675,8 +675,8 @@ void TopOpeBRep_ShapeIntersector::FindFFIntersection() { Standard_Real tol1, tol2; myFFIntersector.GetTolerances(tol1, tol2); - myTol1 = Max(myTol1, tol1); - myTol2 = Max(myTol2, tol2); + myTol1 = std::max(myTol1, tol1); + myTol2 = std::max(myTol2, tol2); } if (myFFDone) @@ -1103,11 +1103,11 @@ static Standard_Integer OneShapeIsHalfSpace(const TopoDS_Shape& S1, const TopoDS Standard_Real maxU = FSurf.LastUParameter(); Standard_Real minV = FSurf.FirstVParameter(); Standard_Real maxV = FSurf.LastVParameter(); - Standard_Boolean yesU = (Abs(minU - 0.) < 1.e-9 && Abs(maxU - 2 * M_PI) < 1.e-9); + Standard_Boolean yesU = (std::abs(minU - 0.) < 1.e-9 && std::abs(maxU - 2 * M_PI) < 1.e-9); Standard_Boolean yesV = (FSurf.GetType() == GeomAbs_Sphere) - ? (Abs(minV - (-M_PI / 2.)) < 1.e-9 && Abs(maxV - M_PI / 2.) < 1.e-9) - : (Abs(minV - 0.) < 1.e-9 && Abs(maxV - 2 * M_PI) < 1.e-9); + ? (std::abs(minV - (-M_PI / 2.)) < 1.e-9 && std::abs(maxV - M_PI / 2.) < 1.e-9) + : (std::abs(minV - 0.) < 1.e-9 && std::abs(maxV - 2 * M_PI) < 1.e-9); SolidIsSphereOrTorus = (yesU && yesV); } @@ -1116,11 +1116,11 @@ static Standard_Integer OneShapeIsHalfSpace(const TopoDS_Shape& S1, const TopoDS Standard_Boolean areBothPeriodic = (FSurf.IsUPeriodic() && FSurf.IsVPeriodic()); if (areBothPeriodic) { - Standard_Boolean yesU = - (Abs(FSurf.UPeriod() - M_PI) < 1.e-9 || Abs(FSurf.UPeriod() - 2 * M_PI) < 1.e-9); - Standard_Boolean yesV = - (Abs(FSurf.VPeriod() - M_PI) < 1.e-9 || Abs(FSurf.VPeriod() - 2 * M_PI) < 1.e-9); - SolidIsSphereOrTorus = (yesU && yesV); + Standard_Boolean yesU = (std::abs(FSurf.UPeriod() - M_PI) < 1.e-9 + || std::abs(FSurf.UPeriod() - 2 * M_PI) < 1.e-9); + Standard_Boolean yesV = (std::abs(FSurf.VPeriod() - M_PI) < 1.e-9 + || std::abs(FSurf.VPeriod() - 2 * M_PI) < 1.e-9); + SolidIsSphereOrTorus = (yesU && yesV); } } @@ -1224,10 +1224,10 @@ static TopoDS_Solid GetNewSolid(const TopoDS_Shape& S, TopoDS_Face& F) else Normal *= 1.e+10; - Standard_Real Pu1 = MinU + Abs((MaxU - MinU) / 4.); - Standard_Real Pu2 = MinU + Abs((MaxU - MinU) / 4. * 3.); - Standard_Real Pv1 = MinV + Abs((MaxV - MinV) / 4.); - Standard_Real Pv2 = MinV + Abs((MaxV - MinV) / 4. * 3.); + Standard_Real Pu1 = MinU + std::abs((MaxU - MinU) / 4.); + Standard_Real Pu2 = MinU + std::abs((MaxU - MinU) / 4. * 3.); + Standard_Real Pv1 = MinV + std::abs((MaxV - MinV) / 4.); + Standard_Real Pv2 = MinV + std::abs((MaxV - MinV) / 4. * 3.); gp_Pnt P1, P2, P3, P4; ASurf.D0(Pu1, Pv1, P1); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_VPointInterClassifier.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_VPointInterClassifier.cxx index ad1e3ec4da..00c408b9fc 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_VPointInterClassifier.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_VPointInterClassifier.cxx @@ -242,7 +242,7 @@ static TopAbs_State SlowClassifyOnBoundary(const gp_Pnt& thePointToC for (Standard_Integer i = 1; i <= aProjTool.NbPoints(); i++) { - Standard_Real curparamdiff = Abs(aProjTool.Parameter(i) - aParameterOnEdge); + Standard_Real curparamdiff = std::abs(aProjTool.Parameter(i) - aParameterOnEdge); if (curparamdiff < minparameterdiff) { minparameterdiff = curparamdiff; diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_kpart.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_kpart.cxx index 818e5fadfc..73dd6a9401 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_kpart.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_kpart.cxx @@ -59,8 +59,8 @@ static void FUNBREP_Periodize(const TopOpeBRep_LineInter& L, { Standard_Real f, l; L.Bounds(f, l); - Standard_Boolean onf = Abs(parline - f) < Precision::PConfusion(); - Standard_Boolean onl = Abs(parline - l) < Precision::PConfusion(); + Standard_Boolean onf = std::abs(parline - f) < Precision::PConfusion(); + Standard_Boolean onl = std::abs(parline - l) < Precision::PConfusion(); Standard_Boolean onfl = onf || onl; if (onfl) { @@ -81,12 +81,12 @@ static void FUNBREP_Periodize(const TopOpeBRep_LineInter& L, } // onfl else { - parline = PIfound = Min(parline, PIfound); + parline = PIfound = std::min(parline, PIfound); } } // IsPeriodic else { - parline = PIfound = Min(parline, PIfound); + parline = PIfound = std::min(parline, PIfound); } } @@ -747,7 +747,7 @@ static Standard_Boolean TopoParameter(const TopOpeBRep_LineInter& L Standard_Boolean samepar = Standard_False; Standard_Real pCPI = TopOpeBRepDS_InterferenceTool::Parameter(I); if (!closingedge) - samepar = (Abs(parline - pCPI) < Precision::PConfusion()); + samepar = (std::abs(parline - pCPI) < Precision::PConfusion()); else { // trouve et couture et courbe periodique : @@ -761,7 +761,7 @@ static Standard_Boolean TopoParameter(const TopOpeBRep_LineInter& L } else { - samepar = (Abs(parline - pCPI) < Precision::PConfusion()); + samepar = (std::abs(parline - pCPI) < Precision::PConfusion()); } } return samepar; diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_vpr.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_vpr.cxx index 89f7383f69..469c5b368b 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_vpr.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRep/TopOpeBRep_vpr.cxx @@ -140,7 +140,7 @@ Standard_EXPORT Standard_Boolean it.Next(); continue; } - Standard_Boolean samepar = (Abs(par - ipar) < tolp); + Standard_Boolean samepar = (std::abs(par - ipar) < tolp); if (!samepar) { it.Next(); @@ -719,7 +719,7 @@ static void FUN_processCPI(TopOpeBRep_FacesFiller& FF, if (!DSCIL.IsEmpty()) { Standard_Real par = FDS_Parameter(DSCIL.Last()); // parameter on curve - Standard_Real dd = Abs(par - parline); // en fait, ce sont des entiers + Standard_Real dd = std::abs(par - parline); // en fait, ce sont des entiers if (dd == 0) return; } @@ -757,7 +757,7 @@ static Standard_Boolean FUN_onedge(const TopOpeBRepDS_Point& PDS, const TopoDS_E gp_Pnt P = PDS.Point(); Standard_Real tolP = PDS.Tolerance(); Standard_Real tolE = BRep_Tool::Tolerance(E); - Standard_Real tol = Max(tolP, tolE); + Standard_Real tol = std::max(tolP, tolE); TopoDS_Vertex vf, vl; TopExp::Vertices(E, vf, vl); gp_Pnt pf = BRep_Tool::Pnt(vf); @@ -875,7 +875,7 @@ void TopOpeBRep_FacesFiller::ProcessVPonR(const TopOpeBRep_VPointInter& VP, { // xpu171198, FRA61896 (f7,f13-> null DSC1) Standard_Real parline = VP.ParameterOnLine(); Standard_Real par = FDS_Parameter(myDSCIL.Last()); // parameter on curve - Standard_Real dd = Abs(par - parline); // en fait, ce sont des entiers + Standard_Real dd = std::abs(par - parline); // en fait, ce sont des entiers if (dd == 0) setlastonwl = Standard_False; } @@ -1173,7 +1173,7 @@ void TopOpeBRep_FacesFiller::ProcessVPonR(const TopOpeBRep_VPointInter& VP, Handle(Geom_Surface) su = BRep_Tool::Surface(OOFace); Standard_Boolean apex = FUN_tool_onapex(OOuv, su); TopOpeBRepDS_Transition T; - if (!apex && ok && (Abs(dot) > tolang)) + if (!apex && ok && (std::abs(dot) > tolang)) { TopAbs_Orientation ori = (dot < 0.) ? TopAbs_FORWARD : TopAbs_REVERSED; T.Set(ori); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Builder1_1.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Builder1_1.cxx index c24d1695b2..d0b5a9dbac 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Builder1_1.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Builder1_1.cxx @@ -870,9 +870,9 @@ void TopOpeBRepBuild_Builder1::SplitEdge(const TopoDS_Shape& anEdg Standard_Real tolV1 = BRep_Tool::Tolerance(aV1); Standard_Real tolV2 = BRep_Tool::Tolerance(aV2); - Standard_Real tolMax = Max(tolEdge, Max(tolV1, tolV2)); + Standard_Real tolMax = std::max(tolEdge, std::max(tolV1, tolV2)); Standard_Real resol = aCurveAdaptor.Resolution(tolMax); - Standard_Real delta = Abs(aPar1 - aPar2); + Standard_Real delta = std::abs(aPar1 - aPar2); if (delta < resol) { diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_BuilderON.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_BuilderON.cxx index c2c087ff95..b0154a475b 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_BuilderON.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_BuilderON.cxx @@ -833,13 +833,13 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter if (!ok) return; // ngFS, ngFOR, xxFOR : - Standard_Real tolON = Max(tolFS, tolEG); + Standard_Real tolON = std::max(tolFS, tolEG); tolON *= 1.e2; //*****CAREFUL***** : xpu040998, cto 904 A3 gp_Vec ngFS; ok = FUN_tool_nggeomF(parEG, EG, FS, ngFS, tolON); if (!ok) return; - tolON = Max(tolFOR, tolEG); + tolON = std::max(tolFOR, tolEG); tolON *= 1.e2; //*****CAREFUL***** : xpu040998, cto 904 A3 gp_Vec ngFOR; ok = FUN_tool_nggeomF(parEG, EG, FOR, ngFOR, tolON); @@ -862,7 +862,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter Standard_Boolean Kpart = (OTFE == TopAbs_EXTERNAL) || (OTFE == TopAbs_INTERNAL); if (Kpart) { - Standard_Boolean Ktg = (Abs(1 - Abs(ntdot)) < tola * 1.e2); + Standard_Boolean Ktg = (std::abs(1 - std::abs(ntdot)) < tola * 1.e2); Kpart = Ktg; } if (Kpart) @@ -873,7 +873,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter return; gp_Pnt Pfor, Pfs; FUN_tool_value(UVfor, FOR, Pfor); - tolON = Max(Max(tolFOR, tolFS), tolEG) * 10.; + tolON = std::max(std::max(tolFOR, tolFS), tolEG) * 10.; Standard_Real d; BRepAdaptor_Surface BSfor(FOR); @@ -900,14 +900,14 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter if (ntdot < 0.) crvFS = -crvFS; Standard_Real eps = Precision::Confusion(); - Standard_Real absCrvFOR = Abs(crvFOR), absCrvFS = Abs(crvFS); + Standard_Real absCrvFOR = std::abs(crvFOR), absCrvFS = std::abs(crvFS); if (absCrvFOR <= eps && absCrvFS <= eps) return; if (absCrvFOR > eps && absCrvFS > eps) { Standard_Real tolR = tolON; Standard_Real rcrvFOR = 1. / crvFOR, rcrvFS = 1. / crvFS; - if (Abs(rcrvFOR - rcrvFS) <= tolR) + if (std::abs(rcrvFOR - rcrvFS) <= tolR) return; } // if we are here the curvatures are different @@ -1304,7 +1304,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter ntFOR.Reverse(); Standard_Real dot = ntFOR.Dot(ntFS); - Standard_Boolean nulldot = (Abs(dot) < tola); + Standard_Boolean nulldot = (std::abs(dot) < tola); if (nulldot) { // xxFS : @@ -1464,10 +1464,10 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter gp_Pnt2d uvFOR; ok = FUN_tool_projPonboundedF(ptON, FOR, uvFOR, d); if (!ok) - return; // nyiRAISE - Standard_Real tolON = Max(tolEG, tolFOR); // xpu291098 cto900L7(f7,e7on) - // xpu051198 PRO12953(f6,e4on) - tolON *= 1.e2; //*****CAREFUL***** : xpu040998, cto 904 A3 + return; // nyiRAISE + Standard_Real tolON = std::max(tolEG, tolFOR); // xpu291098 cto900L7(f7,e7on) + // xpu051198 PRO12953(f6,e4on) + tolON *= 1.e2; //*****CAREFUL***** : xpu040998, cto 904 A3 Standard_Boolean eONFOR = (d < tolON); if (!eONFOR) return; @@ -1908,7 +1908,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter Standard_Real dot = xxFS.Dot(ntFOR); // xpu040698 : FS tg to FCX at EG - CTS20578 (FOR=F8,EG=E6,FS=F4) - - Standard_Boolean nulldot = (Abs(dot) < tola); + Standard_Boolean nulldot = (std::abs(dot) < tola); if (nulldot) { // approximate xxFS : gp_Pnt2d newuvFS; @@ -2168,7 +2168,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter return; Standard_Real sum = matfs + matfor; - Standard_Boolean sumisPI = (Abs(sum - M_PI) < tola1); + Standard_Boolean sumisPI = (std::abs(sum - M_PI) < tola1); Standard_Boolean fsinfPI = (matfs < M_PI); Standard_Boolean forinfPI = (matfor < M_PI); if (sumisPI) @@ -2181,7 +2181,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter b = Standard_False; else { // (!fsinfPI) || (!forinfPI) - Standard_Boolean sammat = (Abs(matfs - matfor) < tola1); + Standard_Boolean sammat = (std::abs(matfs - matfor) < tola1); if (sammat) b = Standard_False; else @@ -2204,7 +2204,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter if (M_REVERSED(oFS)) ntFS.Reverse(); Standard_Real dot = ntFS.Dot(xxFCX); - if (Abs(dot) < tola) b = Standard_False; // xpu231198nyi tangent config + if (std::abs(dot) < tola) b = Standard_False; // xpu231198nyi tangent config else {b = (dot <0.); if (b) forcekeep=Standard_True;} }//!shareG*/ } @@ -2283,7 +2283,7 @@ void TopOpeBRepBuild_BuilderON::GFillONPartsWES2(const Handle(TopOpeBRepDS_Inter return; // dot : Standard_Real dot = ntOOFOR.Dot(xxFCX); - if (Abs(dot) < tola) + if (std::abs(dot) < tola) binou = Standard_True; // nyixpu181198 else if (dot < 0.) binou = Standard_False; diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_End.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_End.cxx index 3c9f5422d0..365235b95d 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_End.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_End.cxx @@ -250,7 +250,7 @@ void TopOpeBRepBuild_Builder::End() if (C2D.IsNull()) throw Standard_ProgramError("TopOpeBRepBuild_Builder::End 1"); Standard_Real tolE = BRep_Tool::Tolerance(E); - Standard_Real tol = Max(tolE, tolpc); + Standard_Real tol = std::max(tolE, tolpc); B.UpdateEdge(E, C2D, F, tol); } C2D = FC2D_CurveOnSurface(E, F, f, l, tolpc); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_FuseFace.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_FuseFace.cxx index 776daef1e5..4184c0dda9 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_FuseFace.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_FuseFace.cxx @@ -1223,7 +1223,7 @@ Standard_Boolean SameSupport(const TopoDS_Edge& E1, const TopoDS_Edge& E2) gp_Lin li1(Handle(Geom_Line)::DownCast(C1)->Lin()); gp_Lin li2(Handle(Geom_Line)::DownCast(C2)->Lin()); - if (Abs(li1.Angle(li2)) <= tolang + if (std::abs(li1.Angle(li2)) <= tolang && li1.Location().SquareDistance(li2.Location()) <= tollin * tollin) { return Standard_True; @@ -1234,7 +1234,7 @@ Standard_Boolean SameSupport(const TopoDS_Edge& E1, const TopoDS_Edge& E2) { gp_Circ ci1 = Handle(Geom_Circle)::DownCast(C1)->Circ(); gp_Circ ci2 = Handle(Geom_Circle)::DownCast(C2)->Circ(); - if (Abs(ci1.Radius() - ci2.Radius()) <= tollin + if (std::abs(ci1.Radius() - ci2.Radius()) <= tollin && ci1.Location().SquareDistance(ci2.Location()) <= tollin * tollin) { // Point debut, calage dans periode, et detection meme sens @@ -1247,8 +1247,8 @@ Standard_Boolean SameSupport(const TopoDS_Edge& E1, const TopoDS_Edge& E2) gp_Elips ci1 = Handle(Geom_Ellipse)::DownCast(C1)->Elips(); gp_Elips ci2 = Handle(Geom_Ellipse)::DownCast(C2)->Elips(); - if (Abs(ci1.MajorRadius() - ci2.MajorRadius()) <= tollin - && Abs(ci1.MinorRadius() - ci2.MinorRadius()) <= tollin + if (std::abs(ci1.MajorRadius() - ci2.MajorRadius()) <= tollin + && std::abs(ci1.MinorRadius() - ci2.MinorRadius()) <= tollin && ci1.Location().SquareDistance(ci2.Location()) <= tollin * tollin) { // Point debut, calage dans periode, et detection meme sens @@ -1300,7 +1300,7 @@ Standard_Boolean SameSupport(const TopoDS_Edge& E1, const TopoDS_Edge& E2) { return Standard_False; } - if (Abs(M1(k) - M2(k)) > tollin) + if (std::abs(M1(k) - M2(k)) > tollin) { return Standard_False; } @@ -1329,7 +1329,7 @@ Standard_Boolean SameSupport(const TopoDS_Edge& E1, const TopoDS_Edge& E2) for (Standard_Integer w = 1; w <= nbpoles; w++) { - if (Abs(W1(w) - W2(w)) > tollin) + if (std::abs(W1(w) - W2(w)) > tollin) { return Standard_False; } @@ -1383,7 +1383,7 @@ Standard_Boolean SameSupport(const TopoDS_Edge& E1, const TopoDS_Edge& E2) for (Standard_Integer w = 1; w <= nbpoles; w++) { - if (Abs(W1(w) - W2(w)) > tollin) + if (std::abs(W1(w) - W2(w)) > tollin) { return Standard_False; } diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_GridSS.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_GridSS.cxx index 8278f73cb8..5a1a107015 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_GridSS.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_GridSS.cxx @@ -1527,7 +1527,7 @@ static Standard_Boolean AreFacesCoincideInArea(const TopoDS_Shape& theBa BRepClass_Intersector anInter; BRepClass_Edge aBCE; aBCE.Face() = aBaseFace; - Standard_Real maxDist = Max(BRep_Tool::Tolerance(aBaseFace), BRep_Tool::Tolerance(aFace)); + Standard_Real maxDist = std::max(BRep_Tool::Tolerance(aBaseFace), BRep_Tool::Tolerance(aFace)); Standard_Boolean isError = Standard_False; TopTools_ListIteratorOfListOfShape it(allEdges); @@ -1622,7 +1622,7 @@ static Standard_Boolean AreFacesCoincideInArea(const TopoDS_Shape& theBa // check normales Standard_Real dot = aNormBase * aNorm; const Standard_Real minDot = 0.9999; - if (Abs(dot) < minDot) + if (std::abs(dot) < minDot) return Standard_False; isSameOri = (dot > 0.); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_PaveClassifier.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_PaveClassifier.cxx index 9fb99dab8a..bea72252f9 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_PaveClassifier.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_PaveClassifier.cxx @@ -174,7 +174,7 @@ Standard_Real TopOpeBRepBuild_PaveClassifier::AdjustCase(const Standard_Real Standard_Integer& cas) { Standard_Real p2; - if (Abs(p1 - first) < tol) + if (std::abs(p1 - first) < tol) { // p1 is first if (o == TopAbs_REVERSED) { @@ -190,7 +190,7 @@ Standard_Real TopOpeBRepBuild_PaveClassifier::AdjustCase(const Standard_Real else { // p1 is not on first Standard_Real last = first + period; - if (Abs(p1 - last) < tol) + if (std::abs(p1 - last) < tol) { // p1 is on last p2 = p1; cas = 3; diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_PaveSet.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_PaveSet.cxx index ea0202c349..259f9e9a62 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_PaveSet.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_PaveSet.cxx @@ -130,7 +130,7 @@ static Standard_Boolean FUN_islook(const TopoDS_Edge& e) gp_Pnt p1 = BRep_Tool::Pnt(v1); gp_Pnt p2 = BRep_Tool::Pnt(v2); Standard_Real dp1p2 = p1.Distance(p2); - Standard_Boolean islook = (Abs(dp1p2) > 1.e-8) ? Standard_True : Standard_False; + Standard_Boolean islook = (std::abs(dp1p2) > 1.e-8) ? Standard_True : Standard_False; return islook; } @@ -364,7 +364,7 @@ Standard_Boolean TopOpeBRepBuild_PaveSet::HasEqualParameters() continue; p2 = it2.Value()->Parameter(); - Standard_Real d = Abs(p1 - p2); + Standard_Real d = std::abs(p1 - p2); #ifdef OCCT_DEBUG if (TopOpeBRepTool_GettraceVC()) { @@ -403,7 +403,7 @@ Standard_Boolean TopOpeBRepBuild_PaveSet::HasEqualParameters() // const TopoDS_Shape& v1 = it1.Value()->Vertex(); #endif p1 = it1.Value()->Parameter(); - Standard_Real d = Abs(p1 - f); + Standard_Real d = std::abs(p1 - f); if (d < Precision::PConfusion()) { myHasEqualParameters = Standard_True; diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Section.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Section.cxx index 1f26a9b7a6..cbf2fd9ae5 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Section.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Section.cxx @@ -131,17 +131,17 @@ static Standard_Boolean FUN_onboundsper(const gp_Pnt2d& uv, const TopoDS_Face& F Standard_Real toluv = 1.e-8 * 1.e-2; // nyinyitol if (uclo) { - Standard_Real d1 = Abs(u1 - uv.X()); + Standard_Real d1 = std::abs(u1 - uv.X()); Standard_Boolean on1 = (d1 < toluv); - Standard_Real d2 = Abs(u2 - uv.X()); + Standard_Real d2 = std::abs(u2 - uv.X()); Standard_Boolean on2 = (d2 < toluv); return (on1 || on2); } if (vclo) { - Standard_Real d1 = Abs(v1 - uv.Y()); + Standard_Real d1 = std::abs(v1 - uv.Y()); Standard_Boolean on1 = (d1 < toluv); - Standard_Real d2 = Abs(v2 - uv.Y()); + Standard_Real d2 = std::abs(v2 - uv.Y()); Standard_Boolean on2 = (d2 < toluv); return (on1 || on2); } @@ -658,7 +658,7 @@ void TopOpeBRepBuild_Builder::SplitSectionEdges() hasPC = (!PC.IsNull()); if (!hasPC) throw Standard_ProgramError("TopOpeBRepBuild_Builder::SSE null PC on F"); - Standard_Real tol = Max(tolE, tolpc); + Standard_Real tol = std::max(tolE, tolpc); BB.UpdateEdge(eon, PC, F, tol); } } diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_ShapeSet.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_ShapeSet.cxx index d8fb9b0fd6..a3f7180121 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_ShapeSet.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_ShapeSet.cxx @@ -339,7 +339,7 @@ Standard_Integer TopOpeBRepBuild_ShapeSet::MaxNumberSubShape(const TopoDS_Shape& for (i = 0; LI.More(); LI.Next(), i++) { } - m = Max(m, i); + m = std::max(m, i); SE.Next(); } return m; diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Tools.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Tools.cxx index 6e7c5227c8..82952d0820 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Tools.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Tools.cxx @@ -648,7 +648,7 @@ void TopOpeBRepBuild_Tools::UpdateEdgeOnFace(const TopoDS_Edge& aEdgeToUpdate, // so we take as it was on old face and after (in CorrectFace2D) // we will adjust this PCurve C2D = FC2D_CurveOnSurface(aEdgeToUpdate, fromFace, f2, l2, tolpc, Standard_True); - Standard_Real tol = Max(tolE, tolpc); + Standard_Real tol = std::max(tolE, tolpc); Handle(Geom2d_Curve) C2Dn = Handle(Geom2d_Curve)::DownCast(C2D->Copy()); Handle(Geom2d_TrimmedCurve) newC2D = new Geom2d_TrimmedCurve(C2Dn, f2, l2); BB.UpdateEdge(aEdgeToUpdate, newC2D, toFace, tol); @@ -663,7 +663,7 @@ void TopOpeBRepBuild_Tools::UpdateEdgeOnFace(const TopoDS_Edge& aEdgeToUpdate, else { C2D = FC2D_CurveOnSurface(aEdgeToUpdate, toFace, f2, l2, tolpc, Standard_True); - Standard_Real tol = Max(tolE, tolpc); + Standard_Real tol = std::max(tolE, tolpc); BB.UpdateEdge(aEdgeToUpdate, C2D, toFace, tol); } } @@ -708,7 +708,7 @@ void TopOpeBRepBuild_Tools::UpdateEdgeOnPeriodicalFace(const TopoDS_Edge& aEdgeT // first PCurve Handle(Geom2d_Curve) C2D = FC2D_CurveOnSurface(newE, tFace, f2, l2, tolpc, Standard_True); - tol = Max(tolpc, tolE); + tol = std::max(tolpc, tolE); BRepAdaptor_Surface aBAS(fFace); gp_Vec2d aTrV; diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Tools_1.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Tools_1.cxx index 66c2772fa7..3f7d9727df 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Tools_1.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_Tools_1.cxx @@ -464,7 +464,7 @@ void CheckEdge(const TopoDS_Edge& Ed, const Standard_Real aMaxTol) Standard_Real Tol, aD2, aNewTolerance, dd; Tol = BRep_Tool::Tolerance(aVertex); - Tol = Max(Tol, BRep_Tool::Tolerance(E)); + Tol = std::max(Tol, BRep_Tool::Tolerance(E)); dd = 0.1 * Tol; Tol *= Tol; diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_WireEdgeClassifier.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_WireEdgeClassifier.cxx index 40865d7e91..5519a2706f 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_WireEdgeClassifier.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_WireEdgeClassifier.cxx @@ -185,7 +185,7 @@ TopoDS_Shape TopOpeBRepBuild_WireEdgeClassifier::LoopToShape(const Handle(TopOpe C2D = FC2D_CurveOnSurface(E, F, f, l, tolpc); if (!C2D.IsNull()) { - Standard_Real tol = Max(tolpc, tolE); + Standard_Real tol = std::max(tolpc, tolE); BB.UpdateEdge(E, C2D, F, tol); } } @@ -272,7 +272,7 @@ TopAbs_State TopOpeBRepBuild_WireEdgeClassifier::CompareShapes(const TopoDS_Shap gp_Vec tg = FUN_tgINE(vshared, vl, E); Standard_Real dot = tg1.Dot(tg); Standard_Real tol = Precision::Angular() * 1.e4; // nyixpu - Standard_Boolean undecided = (Abs(1 + dot) < tol); + Standard_Boolean undecided = (std::abs(1 + dot) < tol); if (undecided) { indy = Standard_True; @@ -411,7 +411,7 @@ void TopOpeBRepBuild_WireEdgeClassifier::ResetElement(const TopoDS_Shape& EE) Standard_Boolean trim3d = Standard_True; C2D = FC2D_CurveOnSurface(E,F,f2,l2,tolpc,trim3d); //jyl980406+ // clang-format on Standard_Real tolE = BRep_Tool::Tolerance(E); // jyl980406+ - Standard_Real tol = Max(tolE, tolpc); // jyl980406+ + Standard_Real tol = std::max(tolE, tolpc); // jyl980406+ BRep_Builder BB; BB.UpdateEdge(E, C2D, F, tol); // jyl980406+ } // jyl980406+ @@ -453,7 +453,7 @@ Standard_Boolean TopOpeBRepBuild_WireEdgeClassifier::CompareElement(const TopoDS // C2D = FC2D_CurveOnSurface(E,F,f2,l2,tolpc,trim3d); //jyl980406- // clang-format on Standard_Real tolE = BRep_Tool::Tolerance(E); // jyl980402+ - Standard_Real tol = Max(tolE, tolpc); // jyl980402+ + Standard_Real tol = std::max(tolE, tolpc); // jyl980402+ BRep_Builder BB; BB.UpdateEdge(E, C2D, F, tol); // jyl980402+ } // jyl980402+ diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_fctwes.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_fctwes.cxx index 5f9eb90081..7f4740d031 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_fctwes.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_fctwes.cxx @@ -224,7 +224,7 @@ void TopOpeBRepBuild_Builder::GFillCurveTopologyWES(const TopOpeBRepDS_CurveIter if (C2D.IsNull()) throw Standard_ProgramError("GFillCurveTopologyWES"); #ifdef OCCT_DEBUG -// Standard_Real tol = Max(tolE,tolpc); +// Standard_Real tol = std::max(tolE,tolpc); #endif myBuildTool.PCurve(WESF, E, C2D); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_makefaces.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_makefaces.cxx index 9ca2c19a04..c5e9fa1e2e 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_makefaces.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepBuild/TopOpeBRepBuild_makefaces.cxx @@ -485,7 +485,7 @@ void TopOpeBRepBuild_Builder::GFABUMakeFaces(const TopoDS_Shape& FF, //C2D = FC2D_CurveOnSurface(newEdge,newFace,f2,l2,tolpc); // jyl980402+ C2D = FC2D_CurveOnSurface(newEdge,newFace,f2,l2,tolpc, Standard_True); // xpu051198 (CTS21701) if(C2D.IsNull()) throw Standard_ProgramError("TopOpeBRepBuild_Builder::GFABUMakeFaces null PC"); // jyl980402+ - Standard_Real tol = Max(tolE,tolpc); // jyl980402+ + Standard_Real tol = std::max(tolE,tolpc); // jyl980402+ BRep_Builder BB_PC; BB_PC.UpdateEdge(newEdge,C2D,newFace,tol); // jyl980402+ } // jyl980402+ } // FABU.MoreEdge() diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx index c417cf3485..4c896afe3e 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx @@ -78,7 +78,7 @@ Standard_Boolean FUN_UisoLineOnSphe(const TopoDS_Shape& F, const Handle(Geom2d_C { Handle(Geom2d_Line) L = Handle(Geom2d_Line)::DownCast(LLL); const gp_Dir2d& d = L->Direction(); - isisoU = (Abs(d.X()) < Precision::Parametric(Precision::Confusion())); + isisoU = (std::abs(d.X()) < Precision::Parametric(Precision::Confusion())); } return isisoU; } @@ -602,7 +602,7 @@ Standard_Boolean FUN_makeUisoLineOnSphe(const TopoDS_Face& F, // with geometry t if (!FUN_getUV(surf, C3D, par3dsup, usup, vsup)) return Standard_False; Standard_Real tol = Precision::Parametric(tol3d); - if (Abs(uinf - usup) > tol) + if (std::abs(uinf - usup) > tol) return Standard_False; Standard_Boolean isvgrowing = (vsup - vinf > -tol); @@ -654,8 +654,8 @@ void TopOpeBRepDS_BuildTool::ComputePCurves(const TopOpeBRepDS_Curve& C, Standard_Real r1 = TopOpeBRepTool_ShapeTool::Resolution3d(F1, tolreached2d1); Standard_Real r2 = TopOpeBRepTool_ShapeTool::Resolution3d(F2, tolreached2d2); - tol = Max(tol, r1); - tol = Max(tol, r2); + tol = std::max(tol, r1); + tol = std::max(tol, r2); newC.Tolerance(tol); if (!PC1new.IsNull()) @@ -1028,7 +1028,7 @@ void TopOpeBRepDS_BuildTool::TranslateOnPeriodic(TopoDS_Shape& F, if (C3D->IsPeriodic()) { if (last < first) - last += Abs(first - last); + last += std::abs(first - last); } // jyl-xpu : 13-06-97 : @@ -1175,7 +1175,7 @@ void TopOpeBRepDS_BuildTool::PCurve(TopoDS_Shape& F, if (!C.IsNull()) { - Standard_Boolean deca = (Abs(Cf - CDSmin) > Precision::PConfusion()); + Standard_Boolean deca = (std::abs(Cf - CDSmin) > Precision::PConfusion()); Handle(Geom2d_Line) line2d = Handle(Geom2d_Line)::DownCast(PCT); Standard_Boolean isline2d = !line2d.IsNull(); Standard_Boolean tran = (rangedef && deca && C->IsPeriodic() && isline2d); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_EXPORT.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_EXPORT.cxx index bc5c19f3ee..f54161ab56 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_EXPORT.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_EXPORT.cxx @@ -283,7 +283,7 @@ Standard_EXPORT Standard_Boolean FDS_aresamdom(const TopOpeBRepDS_DataStructure& gp_Dir d2 = FUN_tool_ngS(p2d2, su2); Standard_Real tola = Precision::Angular(); Standard_Real dot = d1.Dot(d2); - trfa_samdom = (Abs(1. - Abs(dot)) < tola); + trfa_samdom = (std::abs(1. - std::abs(dot)) < tola); } } return trfa_samdom; @@ -1433,7 +1433,7 @@ Standard_EXPORT Standard_Boolean FUN_ds_mkTonFsdm(const Handle(TopOpeBRepDS_HDat Standard_Real prod = beafter.Dot(nxx2); Standard_Real tola = Precision::Angular() * 1.e3; - ok = (Abs(1 - Abs(prod)) < tola); + ok = (std::abs(1 - std::abs(prod)) < tola); if (!ok) return Standard_False; @@ -3055,8 +3055,8 @@ Standard_EXPORT Standard_Boolean FDS_LOIinfsup(const TopOpeBRepDS_DataStructure& tolv = Precision::Parametric(tolv); if (tolv > tol) tol = tolv; - Standard_Boolean pEisEf = (Abs(pE - f) <= tol); - Standard_Boolean pEisEl = (Abs(pE - l) <= tol); + Standard_Boolean pEisEf = (std::abs(pE - f) <= tol); + Standard_Boolean pEisEl = (std::abs(pE - l) <= tol); isonboundper = pEisEf || pEisEl; } @@ -3333,7 +3333,7 @@ Standard_EXPORT void FUN_ds_complete1dForSESDM(const Handle(TopOpeBRepDS_HDataSt if (!ok) continue; - Standard_Real tolEsd = Max(BRep_Tool::Tolerance(Esd), tolSE); + Standard_Real tolEsd = std::max(BRep_Tool::Tolerance(Esd), tolSE); // prepare the list of interferences of SE with Esd const TopOpeBRepDS_ListOfInterference& LIall = BDS.ShapeInterferences(iSE); TopOpeBRepDS_ListOfInterference LI, LI1; @@ -3398,7 +3398,7 @@ Standard_EXPORT void FUN_ds_complete1dForSESDM(const Handle(TopOpeBRepDS_HDataSt // make new interference Standard_Real par = 0.0; - Standard_Real tol = Max(BRep_Tool::Tolerance(aV), tolEsd); + Standard_Real tol = std::max(BRep_Tool::Tolerance(aV), tolEsd); Standard_Real parEsd = BRep_Tool::Parameter(aV, Esd); ok = FUN_tool_parE(Esd, parEsd, SE, par, tol); if (!ok) diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_Edge3dInterferenceTool.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_Edge3dInterferenceTool.cxx index 813176dbf5..cbfd652abf 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_Edge3dInterferenceTool.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_Edge3dInterferenceTool.cxx @@ -119,16 +119,16 @@ static Standard_Boolean FUN_keepIonF(const gp_Vec& tgref, if (!ok) return Standard_False; gp_Dir tgE = gp_Dir(tmp); - Standard_Real prod = Abs(tgref.Dot(tgE)); - if (Abs(1 - prod) < tola) + Standard_Real prod = std::abs(tgref.Dot(tgE)); + if (std::abs(1 - prod) < tola) return Standard_False; // & are tangent edges gp_Vec dd; ok = FUN_tool_nggeomF(parE, E, F, dd); gp_Dir ngF(dd); if (!ok) return Standard_False; - prod = Abs((tgref ^ tgE).Dot(ngF)); - if (Abs(1 - prod) < tola) + prod = std::abs((tgref ^ tgE).Dot(ngF)); + if (std::abs(1 - prod) < tola) return Standard_False; return Standard_True; } @@ -218,9 +218,9 @@ void TopOpeBRepDS_Edge3dInterferenceTool::Init(const TopoDS_Shape& gp_Dir tgOO(tmp); Standard_Real dot = tgref.Dot(tgOO); - dot = 1 - Abs(dot); + dot = 1 - std::abs(dot); Standard_Real tola = Precision::Confusion(); - Standard_Boolean Esdm = (Abs(dot) < tola); + Standard_Boolean Esdm = (std::abs(dot) < tola); if (Esdm) return; // NYI : il faut rejeter les interf I = (T,G,S=E) / E sdm with Eref diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_FaceInterferenceTool.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_FaceInterferenceTool.cxx index 8df22650e2..45746b155c 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_FaceInterferenceTool.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_FaceInterferenceTool.cxx @@ -111,7 +111,7 @@ Standard_EXPORT void FUN_ComputeGeomData(const TopoDS_Shape& F, // xpu030998 : cto901A3 Standard_Real toll = 1.e-8; - Standard_Boolean ooplane = (Abs(Cur1) < toll) && (Abs(Cur2) < toll); + Standard_Boolean ooplane = (std::abs(Cur1) < toll) && (std::abs(Cur2) < toll); plane = plane || ooplane; if (plane) @@ -128,7 +128,8 @@ Standard_EXPORT void FUN_ComputeGeomData(const TopoDS_Shape& F, D1 = Norm; Standard_Real x = D1.X(), y = D1.Y(), z = D1.Z(), tol = Precision::Confusion(); - Standard_Boolean nullx = (Abs(x) < tol), nully = (Abs(y) < tol), nullz = (Abs(z) < tol); + Standard_Boolean nullx = (std::abs(x) < tol), nully = (std::abs(y) < tol), + nullz = (std::abs(z) < tol); if (nullx && nully) D2 = gp_Dir(gp_Dir::D::X); else if (nullx && nullz) diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_GapFiller.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_GapFiller.cxx index 557f88f797..597412be3d 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_GapFiller.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_GapFiller.cxx @@ -440,11 +440,11 @@ void TopOpeBRepDS_GapFiller::ReBuildGeom(const Handle(TopOpeBRepDS_Interference) for (it.Initialize(LI); it.More(); it.Next()) { TopOpeBRepDS_Point PP = myHDS->Point(it.Value()->Geometry()); - TolMax = Max(TolMax, PP.Tolerance()); + TolMax = std::max(TolMax, PP.Tolerance()); if (myGapTool->ParameterOnEdge(it.Value(), E, U)) { - UMin = Min(UMin, U); - UMax = Max(UMax, U); + UMin = std::min(UMin, U); + UMax = std::max(UMax, U); } myGapTool->EdgeSupport(it.Value(), CE); if (!CE.IsSame(E)) diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_HDataStructure.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_HDataStructure.cxx index cbb49559da..93e83d87c8 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_HDataStructure.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_HDataStructure.cxx @@ -567,8 +567,8 @@ void TopOpeBRepDS_HDataStructure::MinMaxOnParameter(const TopOpeBRepDS_ListOfInt for (; it.More(); it.Next()) { parline = it.Parameter(); - parmin = Min(parmin, parline); - parmax = Max(parmax, parline); + parmin = std::min(parmin, parline); + parmax = std::max(parmax, parline); } } } diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_Point.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_Point.cxx index d2d45a3884..bd8295518e 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_Point.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_Point.cxx @@ -46,7 +46,7 @@ TopOpeBRepDS_Point::TopOpeBRepDS_Point(const TopoDS_Shape& S) Standard_Boolean TopOpeBRepDS_Point::IsEqual(const TopOpeBRepDS_Point& P) const { - Standard_Real t = Max(myTolerance, P.Tolerance()); + Standard_Real t = std::max(myTolerance, P.Tolerance()); Standard_Boolean b = myPoint.IsEqual(P.Point(), t); return b; } diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_ProcessEdgeInterferences.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_ProcessEdgeInterferences.cxx index cf94ef6024..c4c464a833 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_ProcessEdgeInterferences.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_ProcessEdgeInterferences.cxx @@ -117,7 +117,7 @@ static Standard_Boolean FUN_keepEinterference Standard_Real par = aCPI->Parameter(); Standard_Real f, l; BRep_Tool::Range(TopoDS::Edge(E), f, l); - if (Abs(par - f) < eps || Abs(par - l) < eps) + if (std::abs(par - f) < eps || std::abs(par - l) < eps) res = Standard_False; } diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_ProcessFaceInterferences.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_ProcessFaceInterferences.cxx index 226e719f74..c3125e038d 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_ProcessFaceInterferences.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_ProcessFaceInterferences.cxx @@ -99,8 +99,8 @@ Standard_EXPORT Standard_Boolean FUN_mkTonF(const TopoDS_Face& F, return Standard_False; gp_Dir ngF = FUN_tool_nggeomF(uvF, F); - Standard_Real xx = Abs(ngF.Dot(tgE)); - Standard_Boolean tgt = (Abs(1 - xx) < tola); + Standard_Real xx = std::abs(ngF.Dot(tgE)); + Standard_Boolean tgt = (std::abs(1 - xx) < tola); if (tgt) return Standard_False; @@ -110,7 +110,7 @@ Standard_EXPORT Standard_Boolean FUN_mkTonF(const TopoDS_Face& F, return Standard_False; gp_Dir beafter = ngF ^ tgE; Standard_Real yy = beafter.Dot(ntFS); - Standard_Boolean unk = (Abs(yy) < tola); + Standard_Boolean unk = (std::abs(yy) < tola); if (unk) return Standard_False; diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_ProcessInterferencesTool.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_ProcessInterferencesTool.cxx index 4bbd75cf13..1b80484eee 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_ProcessInterferencesTool.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepDS/TopOpeBRepDS_ProcessInterferencesTool.cxx @@ -446,7 +446,7 @@ Standard_EXPORT void FUN_reducedoublons Standard_Real t1 = EVI1->Parameter(); Standard_Real t2 = EVI2->Parameter(); Standard_Real dd = t1 - t2; - Standard_Boolean samepar = (Abs(dd) <= t); + Standard_Boolean samepar = (std::abs(dd) <= t); idT = samepar; } } // evi diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_2d.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_2d.cxx index ddd8d9dcbd..45baf8e4b1 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_2d.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_2d.cxx @@ -404,7 +404,7 @@ static void FC2D_translate(Handle(Geom2d_Curve) C2D, Standard_Real pEF = isuiso ? p1.X() : p1.Y(); Standard_Real pC2D = isuiso ? O2d.X() : O2d.Y(); Standard_Real factor = pEF - pC2D; - Standard_Boolean b = (Abs(factor) > 1.e-6); + Standard_Boolean b = (std::abs(factor) > 1.e-6); if (b) { gp_Vec2d transl(1., 0.); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_CLASSI.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_CLASSI.cxx index 814c973e44..3cb68830d2 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_CLASSI.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_CLASSI.cxx @@ -168,7 +168,7 @@ Standard_Integer TopOpeBRepTool_CLASSI::ClassiBnd2d(const TopoDS_Shape& S1, // diff = Vmin - Vmin : k = 3 Standard_Real diff = UV(ii, k) - UV(jj, k); smaller = chklarge ? (smaller && (diff > -tol)) : (smaller && (diff > 0.)); - same = same && (Abs(diff) <= tol); + same = same && (std::abs(diff) <= tol); } for (k = 2; k <= 4; k += 2) { @@ -176,7 +176,7 @@ Standard_Integer TopOpeBRepTool_CLASSI::ClassiBnd2d(const TopoDS_Shape& S1, // diff = Vmax - Vmax : k = 4 Standard_Real diff = UV(ii, k) - UV(jj, k); smaller = chklarge ? (smaller && (diff < tol)) : (smaller && (diff < 0.)); - same = same && (Abs(diff) <= tol); + same = same && (std::abs(diff) <= tol); } if (same) diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_CORRISO.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_CORRISO.cxx index 896e93f5ab..f5925fbe14 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_CORRISO.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_CORRISO.cxx @@ -313,7 +313,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::PurgeFyClosingE(const TopTools_ListOfSh Standard_Real tttol = 1.e-8; Standard_Real tttolS = BRep_Tool::Tolerance(myFref); Standard_Real tolu = Tol(1, tttolS), tolv = Tol(2, tttolS); - Standard_Real tttuvF = Max(tolu, tolv); + Standard_Real tttuvF = std::max(tolu, tolv); TopTools_IndexedMapOfOrientedShape mapcl; TopTools_ListIteratorOfListOfShape itce(ClEds); @@ -345,7 +345,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::PurgeFyClosingE(const TopTools_ListOfSh TopOpeBRepTool_TOOL::Vertices(cE, vcE); TopAbs_Orientation ocE = cE.Orientation(); Standard_Real tttolcE = BRep_Tool::Tolerance(cE); - Standard_Real tttuvcE = Max(Tol(1, tttolcE), Tol(2, tttolcE)); + Standard_Real tttuvcE = std::max(Tol(1, tttolcE), Tol(2, tttolcE)); TopOpeBRepTool_C2DF cE2d; Standard_Boolean isb = UVRep(cE, cE2d); if (!isb) @@ -360,7 +360,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::PurgeFyClosingE(const TopTools_ListOfSh TopTools_Array1OfShape vOcE(1, 2); TopOpeBRepTool_TOOL::Vertices(OcE, vOcE); Standard_Real tttolOcE = BRep_Tool::Tolerance(OcE); - Standard_Real tttuvOcE = Max(Tol(1, tttolOcE), Tol(2, tttolOcE)); + Standard_Real tttuvOcE = std::max(Tol(1, tttolOcE), Tol(2, tttolOcE)); TopOpeBRepTool_C2DF OcE2d; Standard_Boolean isOb = UVRep(OcE, OcE2d); if (!isOb) @@ -371,7 +371,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::PurgeFyClosingE(const TopTools_ListOfSh Standard_Real parvOcE2 = TopOpeBRepTool_TOOL::ParE(2, OcE); gp_Pnt2d UVvOcE2 = TopOpeBRepTool_TOOL::UVF(parvOcE2, OcE2d); - Standard_Real tol = Max(tttuvcE, tttuvOcE); + Standard_Real tol = std::max(tttuvcE, tttuvOcE); isoncE = (UVvce1.Distance(UVvOcE2) < tol); if (isoncE && (nfy != 1)) { // cto009L2 @@ -433,12 +433,12 @@ Standard_Boolean TopOpeBRepTool_CORRISO::PurgeFyClosingE(const TopTools_ListOfSh if (isou && isoux) { Standard_Real du = o2d.X() - o2dx.X(); - onsamline = (Abs(du) < tolu); + onsamline = (std::abs(du) < tolu); } if (isov && isovx) { Standard_Real dv = o2d.Y() - o2dx.Y(); - onsamline = (Abs(dv) < tolv); + onsamline = (std::abs(dv) < tolv); } if (!onsamline) return Standard_False; @@ -483,7 +483,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::PurgeFyClosingE(const TopTools_ListOfSh TopAbs_Orientation ocE = cE.Orientation(); Standard_Real tttolcE = BRep_Tool::Tolerance(cE); - Standard_Real tttuvcE = Max(Tol(1, tttolcE), Tol(2, tttolcE)); + Standard_Real tttuvcE = std::max(Tol(1, tttolcE), Tol(2, tttolcE)); TopOpeBRepTool_C2DF cE2d; Standard_Boolean isb = UVRep(cE, cE2d); if (!isb) @@ -508,7 +508,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::PurgeFyClosingE(const TopTools_ListOfSh if (!hasOcE) continue; // closing edge appears twice Standard_Real tttolOcE = BRep_Tool::Tolerance(OcE); - Standard_Real tttuvOcE = Max(Tol(1, tttolOcE), Tol(2, tttolOcE)); + Standard_Real tttuvOcE = std::max(Tol(1, tttolOcE), Tol(2, tttolOcE)); TopOpeBRepTool_C2DF OcE2d; Standard_Boolean isOb = UVRep(OcE, OcE2d); if (!isOb) @@ -519,7 +519,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::PurgeFyClosingE(const TopTools_ListOfSh Standard_Real parvOcE2 = TopOpeBRepTool_TOOL::ParE(2, OcE); gp_Pnt2d UVvOcE2 = TopOpeBRepTool_TOOL::UVF(parvOcE2, OcE2d); - Standard_Real tol = Max(tttuvcE, tttuvOcE); + Standard_Real tol = std::max(tttuvcE, tttuvOcE); isonOcE2d = (UVvce1.Distance(UVvOcE2) < tol); } if (!isonOcE2d) @@ -562,7 +562,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::PurgeFyClosingE(const TopTools_ListOfSh #endif #endif Standard_Real tttolvce = BRep_Tool::Tolerance(vce); - Standard_Real tttuvvce = Max(Tol(1, tttolvce), Tol(2, tttolvce)); + Standard_Real tttuvvce = std::max(Tol(1, tttolvce), Tol(2, tttolvce)); Standard_Boolean vceok = Standard_False; for (TopTools_ListIteratorOfListOfShape ite(loe); ite.More(); ite.Next()) @@ -587,7 +587,7 @@ Standard_Boolean TopOpeBRepTool_CORRISO::PurgeFyClosingE(const TopTools_ListOfSh return Standard_False; // NYIRAISE Standard_Real tttolE = BRep_Tool::Tolerance(E); - Standard_Real tttuvE = Max(Tol(1, tttolE), Tol(2, tttolE)); + Standard_Real tttuvE = std::max(Tol(1, tttolE), Tol(2, tttolE)); TopTools_Array1OfShape vE(1, 2); TopOpeBRepTool_TOOL::Vertices(E, vE); @@ -610,25 +610,27 @@ Standard_Boolean TopOpeBRepTool_CORRISO::PurgeFyClosingE(const TopTools_ListOfSh if (ive == ivce) continue; // vertex FORWARD connexed to REVERSED one Standard_Real tttolve = BRep_Tool::Tolerance(ve); - Standard_Real tttuvve = Max(Tol(1, tttolve), Tol(2, tttolve)); + Standard_Real tttuvve = std::max(Tol(1, tttolve), Tol(2, tttolve)); - tttol = Max(tttol, Max(tttuvF, Max(tttuvE, Max(tttuvcE, Max(tttuvve, tttuvvce))))); + tttol = std::max( + tttol, + std::max(tttuvF, std::max(tttuvE, std::max(tttuvcE, std::max(tttuvve, tttuvvce))))); // Standard_Real dd = myUclosed ? (UVve.X()-UVvce.X()) : (UVve.Y()-UVvce.Y()); - // Standard_Boolean xok = (Abs(dd)FirstParameter(); Standard_Real lp = aPC->LastParameter(); Standard_Real step = (lp - fp) / (NPoints + 1); @@ -355,7 +355,7 @@ Standard_Boolean TopOpeBRepTool_CurveTool::MakeCurves(const Standard_Real TColgp_Array1OfPnt2d PolPC2(1, nbpol); TColStd_Array1OfBoolean IsValid(1, nbpol); IsValid.Init(Standard_True); - Standard_Real tol = Max(1.e-10, 100. * tol3d * tol3d); // tol *= tol; - square distance + Standard_Real tol = std::max(1.e-10, 100. * tol3d * tol3d); // tol *= tol; - square distance Standard_Real tl2d = tol * (tol2d * tol2d) / (tol3d * tol3d); Standard_Real def = tol; Standard_Real def2d = tol2d; @@ -620,7 +620,7 @@ Standard_Boolean TopOpeBRepTool_CurveTool::MakeCurves(const Standard_Real d2x = d2t * (dx1 - dx); d2y = d2t * (dy1 - dy); d2z = d2t * (dz1 - dz); - Curvature(ip) = Sqrt(d2x * d2x + d2y * d2y + d2z * d2z); + Curvature(ip) = std::sqrt(d2x * d2x + d2y * d2y + d2z * d2z); dx = dx1; dy = dy1; dz = dz1; @@ -634,7 +634,7 @@ Standard_Boolean TopOpeBRepTool_CurveTool::MakeCurves(const Standard_Real { dt = par(ip + 1) - par(ip); kc = (Curvature(ip + 1) - Curvature(ip)) / dt; - ksi = ksi + Abs(kc - kcprev); + ksi = ksi + std::abs(kc - kcprev); if (ksi > crit) { IsBad = Standard_True; @@ -648,7 +648,7 @@ Standard_Boolean TopOpeBRepTool_CurveTool::MakeCurves(const Standard_Real if (IsBad) { - Standard_Real tt = Min(10. * tol3d, Precision::Approximation()); + Standard_Real tt = std::min(10. * tol3d, Precision::Approximation()); tol2d = tt * tol2d / tol3d; tol3d = tt; NbPntMax = 40; diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_DRAW.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_DRAW.cxx index 583fa1be7a..d1e80967b5 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_DRAW.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_DRAW.cxx @@ -249,7 +249,7 @@ Standard_EXPORT void FUN_tool_draw(const TCollection_AsciiString aa, { Standard_Real tol = 1.e-7; Handle(Geom2d_Curve) cc2d; - if (Abs(f) <= tol && Abs(l) <= tol) + if (std::abs(f) <= tol && std::abs(l) <= tol) cc2d = c2d; else cc2d = new Geom2d_TrimmedCurve(c2d, f, l); @@ -269,7 +269,7 @@ Standard_EXPORT void FUN_tool_draw(const TCollection_AsciiString aa, { Standard_Real tol = 1.e-7; Handle(Geom_Curve) cc; - if (Abs(f) <= tol && Abs(l) <= tol) + if (std::abs(f) <= tol && std::abs(l) <= tol) cc = c; else cc = new Geom_TrimmedCurve(c, f, l); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_FuseEdges.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_FuseEdges.cxx index 9d3b364c33..47e8a22931 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_FuseEdges.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_FuseEdges.cxx @@ -704,7 +704,7 @@ Standard_Boolean TopOpeBRepTool_FuseEdges::SameSupport(const TopoDS_Edge& E1, { gp_Circ ci1 = Handle(Geom_Circle)::DownCast(C1)->Circ(); gp_Circ ci2 = Handle(Geom_Circle)::DownCast(C2)->Circ(); - if (Abs(ci1.Radius() - ci2.Radius()) <= tollin + if (std::abs(ci1.Radius() - ci2.Radius()) <= tollin && ci1.Location().SquareDistance(ci2.Location()) <= tollin * tollin && ci1.Axis().IsParallel(ci2.Axis(), tolang)) { @@ -718,8 +718,8 @@ Standard_Boolean TopOpeBRepTool_FuseEdges::SameSupport(const TopoDS_Edge& E1, gp_Elips ci1 = Handle(Geom_Ellipse)::DownCast(C1)->Elips(); gp_Elips ci2 = Handle(Geom_Ellipse)::DownCast(C2)->Elips(); - if (Abs(ci1.MajorRadius() - ci2.MajorRadius()) <= tollin - && Abs(ci1.MinorRadius() - ci2.MinorRadius()) <= tollin + if (std::abs(ci1.MajorRadius() - ci2.MajorRadius()) <= tollin + && std::abs(ci1.MinorRadius() - ci2.MinorRadius()) <= tollin && ci1.Location().SquareDistance(ci2.Location()) <= tollin * tollin && ci1.Axis().IsParallel(ci2.Axis(), tolang)) { @@ -734,7 +734,7 @@ Standard_Boolean TopOpeBRepTool_FuseEdges::SameSupport(const TopoDS_Edge& E1, // we must ensure that before fuse two bsplines, the end of one curve does not // corresponds to the beginning of the second. // we could add a special treatment for periodic bspline. This is not done for the moment. - if (Abs(f2 - l1) > tollin && Abs(f1 - l2) > tollin) + if (std::abs(f2 - l1) > tollin && std::abs(f1 - l2) > tollin) { return Standard_False; } @@ -781,7 +781,7 @@ Standard_Boolean TopOpeBRepTool_FuseEdges::SameSupport(const TopoDS_Edge& E1, { return Standard_False; } - if (Abs(M1(k) - M2(k)) > tollin) + if (std::abs(M1(k) - M2(k)) > tollin) { return Standard_False; } @@ -810,7 +810,7 @@ Standard_Boolean TopOpeBRepTool_FuseEdges::SameSupport(const TopoDS_Edge& E1, for (Standard_Integer w = 1; w <= nbpoles; w++) { - if (Abs(W1(w) - W2(w)) > tollin) + if (std::abs(W1(w) - W2(w)) > tollin) { return Standard_False; } @@ -823,7 +823,7 @@ Standard_Boolean TopOpeBRepTool_FuseEdges::SameSupport(const TopoDS_Edge& E1, // we must ensure that before fuse two bezier, the end of one curve does not // corresponds to the beginning of the second. - if (Abs(f2 - l1) > tollin && Abs(f1 - l2) > tollin) + if (std::abs(f2 - l1) > tollin && std::abs(f1 - l2) > tollin) { return Standard_False; } @@ -872,7 +872,7 @@ Standard_Boolean TopOpeBRepTool_FuseEdges::SameSupport(const TopoDS_Edge& E1, for (Standard_Integer w = 1; w <= nbpoles; w++) { - if (Abs(W1(w) - W2(w)) > tollin) + if (std::abs(W1(w) - W2(w)) > tollin) { return Standard_False; } @@ -985,7 +985,8 @@ Standard_Boolean TopOpeBRepTool_FuseEdges::UpdatePCurve(const TopoDS_Edge& // check that new curve 2d is same range Standard_Real first = Curv2d->FirstParameter(); Standard_Real last = Curv2d->LastParameter(); - if (Abs(first - ef) > Precision::PConfusion() || Abs(last - el) > Precision::PConfusion()) + if (std::abs(first - ef) > Precision::PConfusion() + || std::abs(last - el) > Precision::PConfusion()) { Handle(Geom2d_BSplineCurve) bc = Handle(Geom2d_BSplineCurve)::DownCast(Curv2d); TColStd_Array1OfReal Knots(1, bc->NbKnots()); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_GEOMETRY.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_GEOMETRY.cxx index 5709ae358f..065194e28e 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_GEOMETRY.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_GEOMETRY.cxx @@ -56,8 +56,8 @@ Standard_EXPORT Standard_Boolean FUN_tool_IsUViso(const Handle(Geom2d_Curve)& PC Handle(Geom2d_Line) L = Handle(Geom2d_Line)::DownCast(LLL); d2d = L->Direction(); - isoU = (Abs(d2d.X()) < Precision::Parametric(Precision::Confusion())); - isoV = (Abs(d2d.Y()) < Precision::Parametric(Precision::Confusion())); + isoU = (std::abs(d2d.X()) < Precision::Parametric(Precision::Confusion())); + isoV = (std::abs(d2d.Y()) < Precision::Parametric(Precision::Confusion())); Standard_Boolean isoUV = isoU || isoV; if (!isoUV) return Standard_False; @@ -95,8 +95,8 @@ Standard_EXPORT Standard_Boolean FUN_tool_onapex(const gp_Pnt2d& p2d, const Hand { Standard_Real pisur2 = M_PI * .5; Standard_Real v = p2d.Y(); - Standard_Boolean vpisur2 = (Abs(v - pisur2) < toluv); - Standard_Boolean vmoinspisur2 = (Abs(v + pisur2) < toluv); + Standard_Boolean vpisur2 = (std::abs(v - pisur2) < toluv); + Standard_Boolean vmoinspisur2 = (std::abs(v + pisur2) < toluv); isapex = vpisur2 || vmoinspisur2; } return isapex; @@ -123,8 +123,8 @@ Standard_EXPORT gp_Dir FUN_tool_ngS(const gp_Pnt2d& p2d, const Handle(Geom_Surfa Standard_Real toluv = 1.e-8; if (ST == GeomAbs_Cone) { - Standard_Boolean nullx = (Abs(p2d.X()) < toluv); - Standard_Boolean apex = nullx && (Abs(p2d.Y()) < toluv); + Standard_Boolean nullx = (std::abs(p2d.X()) < toluv); + Standard_Boolean apex = nullx && (std::abs(p2d.Y()) < toluv); if (apex) { gp_Dir axis = GS.Cone().Axis().Direction(); @@ -135,7 +135,7 @@ Standard_EXPORT gp_Dir FUN_tool_ngS(const gp_Pnt2d& p2d, const Handle(Geom_Surfa else if (du < tol) { Standard_Real vf = GS.FirstVParameter(); - Standard_Boolean onvf = Abs(p2d.Y() - vf) < toluv; + Standard_Boolean onvf = std::abs(p2d.Y() - vf) < toluv; Standard_Real x = p2d.X(); Standard_Real y = p2d.Y(); @@ -154,11 +154,11 @@ Standard_EXPORT gp_Dir FUN_tool_ngS(const gp_Pnt2d& p2d, const Handle(Geom_Surfa // Standard_Real deuxpi = 2*M_PI; Standard_Real pisur2 = M_PI * .5; Standard_Real u = p2d.X(), v = p2d.Y(); - // Standard_Boolean u0 =(Abs(u) < toluv); - // Standard_Boolean u2pi=(Abs(u-deuxpi) < toluv); + // Standard_Boolean u0 =(std::abs(u) < toluv); + // Standard_Boolean u2pi=(std::abs(u-deuxpi) < toluv); // Standard_Boolean apex = u0 || u2pi; - Standard_Boolean vpisur2 = (Abs(v - pisur2) < toluv); - Standard_Boolean vmoinspisur2 = (Abs(v + pisur2) < toluv); + Standard_Boolean vpisur2 = (std::abs(v - pisur2) < toluv); + Standard_Boolean vmoinspisur2 = (std::abs(v + pisur2) < toluv); Standard_Boolean apex = vpisur2 || vmoinspisur2; if (apex) { diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_HBoxTool.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_HBoxTool.cxx index f58b6ed671..b6993326b5 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_HBoxTool.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_HBoxTool.cxx @@ -125,7 +125,7 @@ void TopOpeBRepTool_HBoxTool::ComputeBoxOnVertices(const TopoDS_Shape& S, Bnd_Bo Standard_Real x, y, z; BRep_Tool::Pnt(TopoDS::Vertex(ex.Current())).Coord(x, y, z); B.Update(x, y, z); - tol = Max(tol, BRep_Tool::Tolerance(TopoDS::Vertex(ex.Current()))); + tol = std::max(tol, BRep_Tool::Tolerance(TopoDS::Vertex(ex.Current()))); } B.Enlarge(tol); } diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_PROJECT.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_PROJECT.cxx index 0e6a247065..ffbc78bbe2 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_PROJECT.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_PROJECT.cxx @@ -266,10 +266,10 @@ Standard_EXPORT Standard_Boolean FUN_tool_projPonE(const gp_Pnt& P, Standard_Real f, l; FUN_tool_bounds(E, f, l); Standard_Real tolp = Precision::Parametric(Precision::Confusion()); - Standard_Boolean onf = Abs(f - param) < tolp; + Standard_Boolean onf = std::abs(f - param) < tolp; if (onf) param = f; - Standard_Boolean onl = Abs(l - param) < tolp; + Standard_Boolean onl = std::abs(l - param) < tolp; if (onl) param = l; return Standard_True; diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_PURGE.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_PURGE.cxx index 3ccfb12f31..f560e19b48 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_PURGE.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_PURGE.cxx @@ -369,8 +369,8 @@ Standard_Boolean TopOpeBRepTool::PurgeClosingEdges(const TopoDS_Face& Standard_Real period = 2*M_PI; Standard_Real piso = isuiso? O2d.X(): O2d.Y(); Standard_Real tol2d = 1.e-6; - Standard_Boolean is0 = Abs(piso) < tol2d; - Standard_Boolean is2PI = Abs(period-piso) < tol2d; + Standard_Boolean is0 = std::abs(piso) < tol2d; + Standard_Boolean is2PI = std::abs(period-piso) < tol2d; // -------------------------------------------------- // prequesitory : Closed Surfaces have period 2PI if (!is0 && !is2PI) return Standard_False; @@ -466,11 +466,11 @@ FUN_correctDegeneratedE : no 2d curve e2"); Standard_Real d1 = (c1 - cv1); Standard_Real d2 = (c2 - cv2); - Standard_Real adc = Abs(c1 - c2); - Standard_Real adcv = Abs(cv1 - cv2); + Standard_Real adc = std::abs(c1 - c2); + Standard_Real adcv = std::abs(cv1 - cv2); Standard_Real tol2d = 1.e-6; - Standard_Boolean mmd = (Abs(adc-adcv) < tol2d); + Standard_Boolean mmd = (std::abs(adc-adcv) < tol2d); if (mmd) { // correction de CTS20973 gp_Vec2d transl(0.,1.); if (isviso) transl = gp_Vec2d(1.,0.); transl.Multiply(d1); // ou d2 @@ -579,8 +579,8 @@ FUN_correctDegeneratedE : no 2d curve e2"); Standard_Real du = uvfe.X()-uvtt.X(); Standard_Real dv = uvfe.Y()-uvtt.Y(); Standard_Boolean tru=Standard_False, trv=Standard_False; - if (uclosed) tru = (Abs(Abs(du)-uperiod) < tolu); - if (vclosed) trv = (Abs(Abs(dv)-vperiod) < tolv); + if (uclosed) tru = (std::abs(std::abs(du)-uperiod) < tolu); + if (vclosed) trv = (std::abs(std::abs(dv)-vperiod) < tolv); if (!tru && !trv) return Standard_False; gp_Vec2d tt; @@ -671,7 +671,7 @@ static Standard_Boolean FUN_connexX(const Standard_Boolean onU, // xxtrsl : Standard_Real dxx = onU ? uve.X() - uvff.X() : uve.Y() - uvff.Y(); - Standard_Boolean isper = (Abs(xperiod - Abs(dxx)) < xtol); + Standard_Boolean isper = (std::abs(xperiod - std::abs(dxx)) < xtol); if (!isper) continue; diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_REGUW.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_REGUW.cxx index 3d0ae203e8..3fa1103bc5 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_REGUW.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_REGUW.cxx @@ -682,7 +682,7 @@ Standard_Boolean TopOpeBRepTool_REGUW::NearestE(const TopTools_ListOfShape& loe, angi = TopOpeBRepTool_TOOL::Matter(mytg2d, tg2di); else angi = 2. * M_PI - TopOpeBRepTool_TOOL::Matter(tg2di, mytg2d); - Standard_Boolean eq = Abs(angi - angfound) < tola; + Standard_Boolean eq = std::abs(angi - angfound) < tola; #ifdef OCCT_DEBUG if (trc) std::cout << "ang(e" << FUN_adds(myed) << ",e" << FUN_adds(ei) << ")=" << angi << std::endl; diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_RegularizeW.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_RegularizeW.cxx index 8ccc628066..c13bb98876 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_RegularizeW.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_RegularizeW.cxx @@ -246,14 +246,14 @@ Standard_Boolean TopOpeBRepTool::Regularize(const TopoDS_Face& // diff = Vmin - Vmin : k = 3 Standard_Real diff = UV(ii,k) - UV(jj,k); smaller = chklarge ? (smaller && (diff > -tol)) : (smaller && (diff > 0.)); - same = same && (Abs(diff) <= tol); + same = same && (std::abs(diff) <= tol); } for (k = 2; k <= 4; k +=2){ // diff = Umax - Umax : k = 2 // diff = Vmax - Vmax : k = 4 Standard_Real diff = UV(ii,k) - UV(jj,k); smaller = chklarge ? (smaller && (diff < tol)) : (smaller && (diff < 0.)); - same = same && (Abs(diff) <= tol); + same = same && (std::abs(diff) <= tol); } if (same) return TopAbs_ON; diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_ShapeTool.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_ShapeTool.cxx index b2f2e5d052..1b13dc99a4 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_ShapeTool.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_ShapeTool.cxx @@ -214,7 +214,7 @@ void TopOpeBRepTool_ShapeTool::AdjustOnPeriodic(const TopoDS_Shape& F, // Standard_Real ubid = UFfirst; // ElCLib::AdjustPeriodic(UFfirst,UFfirst + Uperiod,tol,ubid,u); - if (Abs(u - UFfirst - Uperiod) > tol) + if (std::abs(u - UFfirst - Uperiod) > tol) u = ElCLib::InPeriod(u, UFfirst, UFfirst + Uperiod); } if (isVperio) @@ -224,7 +224,7 @@ void TopOpeBRepTool_ShapeTool::AdjustOnPeriodic(const TopoDS_Shape& F, // Standard_Real vbid = VFfirst; // ElCLib::AdjustPeriodic(VFfirst,VFfirst + Vperiod,tol,vbid,v); - if (Abs(v - VFfirst - Vperiod) > tol) + if (std::abs(v - VFfirst - Vperiod) > tol) v = ElCLib::InPeriod(v, VFfirst, VFfirst + Vperiod); } } @@ -594,9 +594,9 @@ Standard_Real TopOpeBRepTool_ShapeTool::EdgeData(const BRepAdaptor_Curve& BAC, // xpu150399 cto900R4 const Standard_Real tol1 = Epsilon(0.); constexpr Standard_Real tol2 = RealLast(); - Standard_Real tolm = Max(tol, Max(tol1, tol2)); + Standard_Real tolm = std::max(tol, std::max(tol1, tol2)); - if (Abs(C) > tolm) + if (std::abs(C) > tolm) BL.Normal(N); return tol; } @@ -645,7 +645,7 @@ Standard_Real TopOpeBRepTool_ShapeTool::Resolution3d(const Handle(Geom_Surface)& { Standard_Real ru = Resolution3dU(SU, Tol2d); Standard_Real rv = Resolution3dV(SU, Tol2d); - Standard_Real r = Max(ru, rv); + Standard_Real r = std::max(ru, rv); return r; } diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_TOOL.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_TOOL.cxx index 0d41617542..724a22d36b 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_TOOL.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_TOOL.cxx @@ -76,7 +76,7 @@ static Standard_Boolean FUN_nullprodv(const Standard_Real prodv) { // Standard_Real tola = Precision::Angular()*1.e+1; // NYI Standard_Real tola = 1.e-6; // NYI NYI NYI : for case cto 012 I2 - return (Abs(prodv) < tola); + return (std::abs(prodv) < tola); } // modified by NIZNHY-PKV Fri Aug 4 11:22:57 2000 from @@ -339,8 +339,8 @@ Standard_Integer TopOpeBRepTool_TOOL::OnBoundary(const Standard_Real par, const Standard_Real tole = bc.Tolerance(); Standard_Real tolp = bc.Resolution(tole); - Standard_Boolean onf = Abs(par - first) < tolp; - Standard_Boolean onl = Abs(par - last) < tolp; + Standard_Boolean onf = std::abs(par - first) < tolp; + Standard_Boolean onl = std::abs(par - last) < tolp; Standard_Boolean onfl = (onf || onl); if (onfl && closed) return CLOSING; @@ -505,12 +505,12 @@ Standard_Boolean TopOpeBRepTool_TOOL::ParE2d(const gp_Pnt2d& p2d, if (isoU) { par = p2d.Y() - Loc.Y(); - dist = Abs(p2d.X() - Loc.X()); + dist = std::abs(p2d.X() - Loc.X()); } if (isoV) { par = p2d.X() - Loc.X(); - dist = Abs(p2d.Y() - Loc.Y()); + dist = std::abs(p2d.Y() - Loc.Y()); } if (isoU || isoV) return Standard_True; @@ -572,8 +572,8 @@ Standard_Boolean TopOpeBRepTool_TOOL::TggeomE(const Standard_Real par, Standard_Real tolE = BC.Tolerance(); Standard_Real tolp = BC.Resolution(tolE); - Standard_Boolean onf = Abs(f - par) < tolp; - Standard_Boolean onl = Abs(l - par) < tolp; + Standard_Boolean onf = std::abs(f - par) < tolp; + Standard_Boolean onl = std::abs(l - par) < tolp; Standard_Boolean inbounds = (f < par) && (par < l); if ((!inbounds) && (!onf) && (!onl)) @@ -845,7 +845,7 @@ Standard_Boolean TopOpeBRepTool_TOOL::CurvE(const TopoDS_Edge& E, { gp_Dir dir = BAC.Line().Direction(); Standard_Real dot = dir.Dot(tg0); - if (Abs(1 - dot) < tola) + if (std::abs(1 - dot) < tola) return Standard_False; return Standard_True; } @@ -854,7 +854,7 @@ Standard_Boolean TopOpeBRepTool_TOOL::CurvE(const TopoDS_Edge& E, Standard_Boolean tgdef = clprops.IsTangentDefined(); if (!tgdef) return Standard_False; - curv = Abs(clprops.Curvature()); + curv = std::abs(clprops.Curvature()); Standard_Real tol = Precision::Confusion() * 1.e+2; // NYITOLXPU Standard_Boolean nullcurv = (curv < tol); @@ -869,9 +869,9 @@ Standard_Boolean TopOpeBRepTool_TOOL::CurvE(const TopoDS_Edge& E, gp_Dir T; clprops.Tangent(T); gp_Dir axis = N ^ T; - Standard_Real dot = Abs(axis.Dot(tg0)); + Standard_Real dot = std::abs(axis.Dot(tg0)); nullcurv = dot < tola; - Standard_Boolean maxcurv = Abs(1 - dot) < tola; + Standard_Boolean maxcurv = std::abs(1 - dot) < tola; if (nullcurv) { curv = 0.; @@ -955,12 +955,12 @@ static Standard_Boolean FUN_analyticcS(const gp_Pnt2d& uv0, direct = toto.Direct(); } Standard_Real prod = axis.Dot(tg0); - Standard_Boolean isMaxAcurv = FUN_nullprodv(1 - Abs(prod)); + Standard_Boolean isMaxAcurv = FUN_nullprodv(1 - std::abs(prod)); Standard_Boolean nullcurv = FUN_nullprodv(prod); Standard_Real prod2 = ngS.Dot(tg0); if (cyl || cone) - nullcurv = nullcurv || FUN_nullprodv(1 - Abs(prod2)); + nullcurv = nullcurv || FUN_nullprodv(1 - std::abs(prod2)); if (nullcurv) { @@ -973,8 +973,8 @@ static Standard_Boolean FUN_analyticcS(const gp_Pnt2d& uv0, Standard_Boolean curdef = slprops.IsCurvatureDefined(); if (curdef) { - Standard_Real minAcurv = Abs(slprops.MinCurvature()); - Standard_Real maxAcurv = Abs(slprops.MaxCurvature()); + Standard_Real minAcurv = std::abs(slprops.MinCurvature()); + Standard_Real maxAcurv = std::abs(slprops.MaxCurvature()); Standard_Boolean isAmax = (maxAcurv > minAcurv); curv = isAmax ? maxAcurv : minAcurv; } @@ -1027,18 +1027,18 @@ Standard_Boolean TopOpeBRepTool_TOOL::CurvF(const TopoDS_Face& F, gp_Vec Dmax = ngS ^ MaxD, Dmin = ngS ^ MinD; // xpu180898 : cto015G2 Standard_Real dotmax = Dmax.Dot(npl); // MaxD.Dot(npl); -xpu180898 - Standard_Boolean iscurmax = Abs(1 - dotmax) < tola; + Standard_Boolean iscurmax = std::abs(1 - dotmax) < tola; if (iscurmax) { direct = (maxcurv < 0.); - curv = Abs(maxcurv); + curv = std::abs(maxcurv); } Standard_Real dotmin = Dmin.Dot(npl); // MinD.Dot(npl); -xpu180898 - Standard_Boolean iscurmin = Abs(1 - dotmin) < tola; + Standard_Boolean iscurmin = std::abs(1 - dotmin) < tola; if (iscurmin) { direct = (mincurv < 0.); - curv = Abs(mincurv); + curv = std::abs(mincurv); } curdef = iscurmax || iscurmin; // ------------- @@ -1067,8 +1067,8 @@ Standard_Boolean TopOpeBRepTool_TOOL::UVISO(const Handle(Geom2d_Curve)& PC, Handle(Geom2d_Line) L = Handle(Geom2d_Line)::DownCast(LLL); d2d = L->Direction(); - isoU = (Abs(d2d.X()) < Precision::Parametric(Precision::Confusion())); - isoV = (Abs(d2d.Y()) < Precision::Parametric(Precision::Confusion())); + isoU = (std::abs(d2d.X()) < Precision::Parametric(Precision::Confusion())); + isoV = (std::abs(d2d.Y()) < Precision::Parametric(Precision::Confusion())); Standard_Boolean isoUV = isoU || isoV; if (!isoUV) return Standard_False; @@ -1131,12 +1131,12 @@ Standard_Boolean TopOpeBRepTool_TOOL::IsonCLO(const Handle(Geom2d_Curve)& PC, return Standard_False; Standard_Real dxx = 0; if (onU) - dxx = Abs(o2d.X() - xfirst); + dxx = std::abs(o2d.X() - xfirst); else - dxx = Abs(o2d.Y() - xfirst); + dxx = std::abs(o2d.Y() - xfirst); Standard_Boolean onclo = (dxx < xtol); - onclo = onclo || (Abs(xperiod - dxx) < xtol); + onclo = onclo || (std::abs(xperiod - dxx) < xtol); return onclo; } @@ -1250,7 +1250,7 @@ Standard_Boolean TopOpeBRepTool_TOOL::Matter(const gp_Dir& xx1, // => zi = xxi^nti gives the opposite sense for the compute of the matter angle z1.Reverse(); ang = xx1.AngleWithRef(xx2, z1); - if (Abs(ang) < tola) + if (std::abs(ang) < tola) { ang = 0.; return Standard_True; @@ -1291,7 +1291,7 @@ Standard_Boolean TopOpeBRepTool_TOOL::Getduv(const TopoDS_Face& f, gp_Vec2d DUV(uv, uvtr); Handle(Geom_Surface) S = TopOpeBRepTool_ShapeTool::BASISSURFACE(f); - if ((S->IsUPeriodic()) && (Abs(DUV.X()) > S->UPeriod() / 2.)) + if ((S->IsUPeriodic()) && (std::abs(DUV.X()) > S->UPeriod() / 2.)) { Standard_Real U1 = uv.X(), U2 = uvtr.X(), period = S->UPeriod(); ElCLib::AdjustPeriodic(0., period, Precision::PConfusion(), U1, U2); @@ -1300,7 +1300,7 @@ Standard_Boolean TopOpeBRepTool_TOOL::Getduv(const TopoDS_Face& f, dx -= period; DUV.SetX(dx); } - if ((S->IsVPeriodic()) && (Abs(DUV.Y()) > S->VPeriod() / 2.)) + if ((S->IsVPeriodic()) && (std::abs(DUV.Y()) > S->VPeriod() / 2.)) { Standard_Real V1 = uv.Y(), V2 = uvtr.Y(), period = S->VPeriod(); ElCLib::AdjustPeriodic(0., period, Precision::PConfusion(), V1, V2); @@ -1402,8 +1402,8 @@ static Standard_Boolean FUN_ngF(const gp_Pnt2d& uv, const TopoDS_Face& F, gp_Vec GeomAbs_SurfaceType ST = bs.GetType(); if (ST == GeomAbs_Cone) { - Standard_Boolean nullx = (Abs(uv.X()) < tolu); - Standard_Boolean apex = nullx && (Abs(uv.Y()) < tolv); + Standard_Boolean nullx = (std::abs(uv.X()) < tolu); + Standard_Boolean apex = nullx && (std::abs(uv.Y()) < tolv); if (apex) { const gp_Dir axis = bs.Cone().Axis().Direction(); @@ -1419,7 +1419,7 @@ static Standard_Boolean FUN_ngF(const gp_Pnt2d& uv, const TopoDS_Face& F, gp_Vec Standard_Real y = uv.Y(); Standard_Real vf = bs.FirstVParameter(); - if (Abs(vf - y) < tolu) + if (std::abs(vf - y) < tolu) vf += delta; else vf -= delta; @@ -1437,8 +1437,8 @@ static Standard_Boolean FUN_ngF(const gp_Pnt2d& uv, const TopoDS_Face& F, gp_Vec { Standard_Real pisur2 = M_PI * .5; Standard_Real u = uv.X(), v = uv.Y(); - Standard_Boolean vpisur2 = (Abs(v - pisur2) < tolv); - Standard_Boolean vmoinspisur2 = (Abs(v + pisur2) < tolv); + Standard_Boolean vpisur2 = (std::abs(v - pisur2) < tolv); + Standard_Boolean vmoinspisur2 = (std::abs(v + pisur2) < tolv); Standard_Boolean apex = vpisur2 || vmoinspisur2; if (apex) { @@ -1557,8 +1557,8 @@ Standard_Boolean TopOpeBRepTool_TOOL::MatterKPtg(const TopoDS_Face& f1, // gp_Dir xx2; ok2 = TopOpeBRepTool_TOOL::XX(uv2,f2,pare,e,xx2); // if (!ok2) return Standard_False; // Standard_Real angapp; Standard_Boolean ok = TopOpeBRepTool_TOOL::Matter(xx1,nt1, - // xx2,nt2,tola,angapp); if (!ok) return Standard_False; Standard_Boolean is0 = (Abs(angapp) < - // Abs(2.*M_PI-angapp)); ang = is0 ? 0. : 2.*M_PI; + // xx2,nt2,tola,angapp); if (!ok) return Standard_False; Standard_Boolean is0 = (std::abs(angapp) + // < std::abs(2.*M_PI-angapp)); ang = is0 ? 0. : 2.*M_PI; return Standard_True; } @@ -1660,8 +1660,8 @@ void TopOpeBRepTool_TOOL::stuvF(const gp_Pnt2d& uv, Standard_Real u = uv.X(), v = uv.Y(); Standard_Real uf = bs.FirstUParameter(), ul = bs.LastUParameter(), vf = bs.FirstVParameter(), vl = bs.LastVParameter(); - Standard_Boolean onuf = (Abs(uf - u) < tolu), onul = (Abs(ul - u) < tolu); - Standard_Boolean onvf = (Abs(vf - v) < tolv), onvl = (Abs(vl - v) < tolv); + Standard_Boolean onuf = (std::abs(uf - u) < tolu), onul = (std::abs(ul - u) < tolu); + Standard_Boolean onvf = (std::abs(vf - v) < tolv), onvl = (std::abs(vl - v) < tolv); if (onuf) onU = ONFIRST; if (onul) @@ -1696,7 +1696,7 @@ Standard_Real TopOpeBRepTool_TOOL::TolUV(const TopoDS_Face& F, const Standard_Re { BRepAdaptor_Surface bs(F); Standard_Real tol2d = bs.UResolution(tol3d); - tol2d = Max(tol2d, bs.VResolution(tol3d)); + tol2d = std::max(tol2d, bs.VResolution(tol3d)); return tol2d; } @@ -1762,7 +1762,7 @@ Standard_Boolean TopOpeBRepTool_TOOL::EdgeONFace(const Standard_Real par, return Standard_False; gp_Vec ngf = FUN_tool_nggeomF(uv, fa); Standard_Real aProdDot = tge.Dot(ngf); - Standard_Boolean etgf = Abs(aProdDot) < tola; + Standard_Boolean etgf = std::abs(aProdDot) < tola; if (!etgf) return Standard_True; @@ -1779,7 +1779,7 @@ Standard_Boolean TopOpeBRepTool_TOOL::EdgeONFace(const Standard_Real par, Standard_Real tole = bc.Tolerance(); Standard_Real tol1de = bc.Resolution(tole); Standard_Real tolf = bs.Tolerance(); - Standard_Real tol3d = Max(tole, tolf) * 1.e2; // NYITOLXPU + Standard_Real tol3d = std::max(tole, tolf) * 1.e2; // NYITOLXPU // NYIxpu100299 : for other analytic geometries if (plane && line) @@ -1804,7 +1804,7 @@ Standard_Boolean TopOpeBRepTool_TOOL::EdgeONFace(const Standard_Real par, if (det) { Standard_Real prod = ne.Dot(ngf); - isonfa = (Abs(1 - Abs(prod)) < tola); + isonfa = (std::abs(1 - std::abs(prod)) < tola); return Standard_True; } } // plane @@ -1823,12 +1823,12 @@ Standard_Boolean TopOpeBRepTool_TOOL::EdgeONFace(const Standard_Real par, if (det) { Standard_Real prod = ne.Dot(axicy); - isonfa = (Abs(1 - Abs(prod)) < tola); + isonfa = (std::abs(1 - std::abs(prod)) < tola); if (isonfa && circle) { Standard_Real radci = bc.Circle().Radius(); Standard_Real radcy = bs.Cylinder().Radius(); - isonfa = (Abs(radci - radcy) < tol3d); + isonfa = (std::abs(radci - radcy) < tol3d); } return Standard_True; } @@ -1839,7 +1839,7 @@ Standard_Boolean TopOpeBRepTool_TOOL::EdgeONFace(const Standard_Real par, Standard_Real x = 0.12345; Standard_Real f, l; FUN_tool_bounds(ed, f, l); - Standard_Boolean onf = (Abs(par - f) < tol1de); + Standard_Boolean onf = (std::abs(par - f) < tol1de); Standard_Real opar = onf ? ((1 - x) * f + x * l) : ((1 - x) * f + x * par); gp_Pnt opc = bc.Value(opar); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_TOPOLOGY.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_TOPOLOGY.cxx index b3418b217a..c8892e63de 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_TOPOLOGY.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_TOPOLOGY.cxx @@ -195,14 +195,14 @@ Standard_EXPORT Standard_Boolean FUN_tool_isobounds(const TopoDS_Shape& Sh, { gp_Pnt2d p2df = PC->Value(f); gp_Pnt2d p2dl = PC->Value(l); - u1 = Min(p2df.X(), u1); - u2 = Max(p2df.X(), u2); - v1 = Min(p2df.Y(), v1); - v2 = Max(p2df.Y(), v2); - u1 = Min(p2dl.X(), u1); - u2 = Max(p2dl.X(), u2); - v1 = Min(p2dl.Y(), v1); - v2 = Max(p2dl.Y(), v2); + u1 = std::min(p2df.X(), u1); + u2 = std::max(p2df.X(), u2); + v1 = std::min(p2df.Y(), v1); + v2 = std::max(p2df.Y(), v2); + u1 = std::min(p2dl.X(), u1); + u2 = std::max(p2dl.X(), u2); + v1 = std::min(p2dl.Y(), v1); + v2 = std::max(p2dl.Y(), v2); } if (!isouv) return Standard_False; @@ -521,7 +521,7 @@ Standard_EXPORT Standard_Boolean FUN_tool_EtgF(const Standard_Real& paronE, gp_Vec ngF = FUN_tool_nggeomF(p2d, F); Standard_Real prod = tgE.Dot(ngF); - Standard_Boolean tgt = Abs(prod) < tola; + Standard_Boolean tgt = std::abs(prod) < tola; return tgt; } @@ -541,7 +541,7 @@ Standard_EXPORT Standard_Boolean FUN_tool_EtgOOE(const Standard_Real& paronE, if (!ok) return Standard_False; // NYIRAISE Standard_Real prod = tgOOE.Dot(tgE); - Standard_Boolean tg = (Abs(1 - Abs(prod)) < tola); + Standard_Boolean tg = (std::abs(1 - std::abs(prod)) < tola); return tg; } @@ -558,9 +558,9 @@ Standard_EXPORT Standard_Boolean FUN_nearestISO(const TopoDS_Face& F, // smaller xsup : xpar <=xsup Standard_Real tol2d = 1.e-6; Standard_Real df = xpar - xinf; - Standard_Boolean onf = (Abs(df) < tol2d); + Standard_Boolean onf = (std::abs(df) < tol2d); Standard_Real dl = xpar - xsup; - Standard_Boolean onl = (Abs(dl) < tol2d); + Standard_Boolean onl = (std::abs(dl) < tol2d); if (onf || onl) return Standard_True; @@ -605,7 +605,7 @@ Standard_EXPORT Standard_Boolean FUN_tool_EitangenttoFe(const gp_Dir& ngFe Standard_Real prod = ngFe.Dot(tgEi); Standard_Real tol = Precision::Parametric(Precision::Confusion()); - Standard_Boolean tangent = (Abs(prod) <= tol); + Standard_Boolean tangent = (std::abs(prod) <= tol); return tangent; } @@ -707,7 +707,7 @@ Standard_EXPORT void FUN_tool_mkBnd2d(const TopoDS_Shape& W, const TopoDS_Shape& { Standard_Real tolE = BRep_Tool::Tolerance(E); pc = FC2D_CurveOnSurface(E, F, f, l, tolpc); - Standard_Real newtol = Max(tolE, tolpc); + Standard_Real newtol = std::max(tolE, tolpc); BRep_Builder BB; BB.UpdateEdge(E, pc, F, newtol); } @@ -1148,7 +1148,7 @@ Standard_EXPORT Standard_Integer FUN_tool_comparebndkole(const TopoDS_Shape& sh1 for (i = 1; i <= 3; i++) { Standard_Real d = xyz2(i) - xyz1(i); - Standard_Boolean eq = (Abs(d) < tol); + Standard_Boolean eq = (std::abs(d) < tol); if (eq) { neq++; @@ -1160,7 +1160,7 @@ Standard_EXPORT Standard_Integer FUN_tool_comparebndkole(const TopoDS_Shape& sh1 for (i = 4; i <= 6; i++) { Standard_Real d = xyz2(i) - xyz1(i); - Standard_Boolean eq = (Abs(d) < tol); + Standard_Boolean eq = (std::abs(d) < tol); if (eq) { neq++; @@ -1202,7 +1202,7 @@ Standard_EXPORT Standard_Boolean FUN_tool_SameOri(const TopoDS_Edge& E1, const T ok = FUN_tool_projPonE(Pmid, E1, pE1, dist); Standard_Real tol1 = BRep_Tool::Tolerance(E1); Standard_Real tol2 = BRep_Tool::Tolerance(E2); - Standard_Real tol = Max(tol1, tol2) * 10.; + Standard_Real tol = std::max(tol1, tol2) * 10.; if (dist > tol) return Standard_False; if (!ok) diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_makeTransition.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_makeTransition.cxx index 93816176da..2599d1f8c3 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_makeTransition.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_makeTransition.cxx @@ -160,7 +160,7 @@ static Standard_Integer FUN_mkT2dquad(const Standard_Real curvC1, const Standard if (nullc1) return isINifh2; // is IN if (dot=tg2(pt after).xx2 < 0) - Standard_Boolean samec = (Abs(curvC2 - curvC1) < 1.e-2); // NYITOLXPU kpartkoletge + Standard_Boolean samec = (std::abs(curvC2 - curvC1) < 1.e-2); // NYITOLXPU kpartkoletge if (samec) return isON2ifss; // is ON if curves are on same side/tg line if (curvC1 > curvC2) @@ -181,8 +181,8 @@ static Standard_Boolean FUN_getnearpar(const TopoDS_Edge& e, // hyp : f < par < l BRepAdaptor_Curve bc(e); Standard_Real tol1d = bc.Resolution(bc.Tolerance()); - Standard_Boolean onf = (Abs(par - f) < tol1d); - Standard_Boolean onl = (Abs(par - l) < tol1d); + Standard_Boolean onf = (std::abs(par - f) < tol1d); + Standard_Boolean onl = (std::abs(par - l) < tol1d); if (onf && (sta == BEFORE)) return Standard_False; if (onl && (sta == AFTER)) @@ -358,7 +358,7 @@ Standard_Boolean TopOpeBRepTool_makeTransition::MkT2donE(TopAbs_State& Stb, TopA Standard_Real dot = tgE.Dot(xxES); // E and ES are not tangent at interference point : - Standard_Boolean tgts = (Abs(dot) < tola); + Standard_Boolean tgts = (std::abs(dot) < tola); if (!tgts) { Standard_Boolean dotpos = (dot > 0.); @@ -555,7 +555,7 @@ static TopAbs_State FUN_stawithES(const gp_Dir& tgE, const gp_Dir& xxES, const S TopAbs_State sta; Standard_Real prod = tgE.Dot(xxES); Standard_Real tola = FUN_tolang(); - if (Abs(prod) < tola) + if (std::abs(prod) < tola) return TopAbs_UNKNOWN; Standard_Boolean positive = (prod > 0.); if (positive) @@ -655,7 +655,7 @@ Standard_Boolean TopOpeBRepTool_makeTransition::MkT3onE(TopAbs_State& Stb, TopAb Standard_Real tola = FUN_tolang(); Standard_Real dot = tgE.Dot(ntFS); - if (Abs(dot) > tola) + if (std::abs(dot) > tola) { Stb = (dot > 0) ? TopAbs_IN : TopAbs_OUT; Sta = (dot > 0) ? TopAbs_OUT : TopAbs_IN; diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_mkTondgE.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_mkTondgE.cxx index ce6561e031..93967fb771 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_mkTondgE.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_mkTondgE.cxx @@ -88,7 +88,7 @@ Standard_Boolean TopOpeBRepTool_mkTondgE::Initialize(const TopoDS_Edge& dgE, return Standard_False; Standard_Real dot = myngf.Dot(myngfi); - isT2d = (Abs(1 - Abs(dot)) < FUN_tola()); + isT2d = (std::abs(1 - std::abs(dot)) < FUN_tola()); return Standard_True; } @@ -157,9 +157,9 @@ Standard_Integer TopOpeBRepTool_mkTondgE::GetAllRest(TopTools_ListOfShape& lEi) Standard_Boolean ok = Standard_False; if (isou) - ok = Abs(o2d.X() - myuvi.X()) < tolu; + ok = std::abs(o2d.X() - myuvi.X()) < tolu; if (isov) - ok = Abs(o2d.Y() - myuvi.Y()) < tolv; + ok = std::abs(o2d.Y() - myuvi.Y()) < tolv; if (!ok) continue; @@ -210,7 +210,7 @@ static Standard_Boolean FUN_MkTonE(const gp_Vec& faxis, // at par2 : tr(dge, ei/fi) = forward Standard_Real tola = FUN_tola(); Standard_Real dot1 = dirINcle.Dot(xxi); - Standard_Boolean isONi = (Abs(dot1) < tola); + Standard_Boolean isONi = (std::abs(dot1) < tola); // par1 = ang -> inout // par2 = Cang -> outin @@ -320,7 +320,7 @@ Standard_Boolean TopOpeBRepTool_mkTondgE::MkTonE(const TopoDS_Edge& ei, Standard_Real pfi, pli; FUN_tool_bounds(ei, pfi, pli); Standard_Real tolpi = TopOpeBRepTool_TOOL::TolP(ei, myFi); - Standard_Boolean onfi = (Abs(pari - pfi) < tolpi), onli = (Abs(pari - pli) < tolpi); + Standard_Boolean onfi = (std::abs(pari - pfi) < tolpi), onli = (std::abs(pari - pli) < tolpi); gp_Vec tgin1di; Standard_Boolean ok = TopOpeBRepTool_TOOL::TggeomE(pari, ei, tgin1di); if (!ok) @@ -411,7 +411,7 @@ Standard_Boolean TopOpeBRepTool_mkTondgE::MkTonE(const TopoDS_Edge& ei, mkT = MKI12; // without restrictions. gp_Vec tgi = xxi.Crossed(faxis); // tgi /(tgi,xxi,faxis) is direct : Standard_Real dot = tgi.Dot(xxri); - if (Abs(dot) < FUN_tola()) + if (std::abs(dot) < FUN_tola()) { if ((!onfi && !onli) || closedi) { @@ -432,8 +432,8 @@ Standard_Boolean TopOpeBRepTool_mkTondgE::MkTonE(const TopoDS_Edge& ei, // xxri : Standard_Real ddot = tgin1di.Dot(faxis); // clang-format off - Standard_Boolean tgaxis = Abs(1-(Abs(ddot))) < FUN_tola(); //=true : edge is tangent to - sphere's axis + Standard_Boolean tgaxis = std::abs(1-(std::abs(ddot))) < FUN_tola(); //=true : edge is + tangent to sphere's axis // clang-format on if (tgaxis) { ok = TopOpeBRepTool_TOOL::XX(myuvi,myFi, pari,ei, xxri); diff --git a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_tol.cxx b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_tol.cxx index 4b6a95bfb6..cb44e473ad 100644 --- a/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_tol.cxx +++ b/src/ModelingAlgorithms/TKBool/TopOpeBRepTool/TopOpeBRepTool_tol.cxx @@ -224,7 +224,7 @@ Standard_EXPORT void FTOL_FaceTolerances3d(const TopoDS_Face& myFace1, MaxUV); myTol1 = (myTol1 > 1.e-4) ? 1.e-4 : myTol1; myTol2 = (myTol2 > 1.e-4) ? 1.e-4 : myTol2; - Tol = Max(myTol1, myTol2); + Tol = std::max(myTol1, myTol2); } Standard_EXPORT void FTOL_FaceTolerances3d(const Bnd_Box& B1, diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr.cxx index d5cd3e179f..4a82d48ef9 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr.cxx @@ -61,5 +61,5 @@ Standard_Integer Expr::NbOfFreeVariables(const Handle(Expr_GeneralExpression)& e Standard_Real Expr::Sign(const Standard_Real val) { - return ::Sign(1.0, val); + return std::copysign(1.0, val); } diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_Absolute.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_Absolute.cxx index fae5363754..2f941b8021 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_Absolute.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_Absolute.cxx @@ -38,7 +38,7 @@ Handle(Expr_GeneralExpression) Expr_Absolute::ShallowSimplified() const if (op->IsKind(STANDARD_TYPE(Expr_NumericValue))) { Handle(Expr_NumericValue) valop = Handle(Expr_NumericValue)::DownCast(op); - return new Expr_NumericValue(Abs(valop->GetValue())); + return new Expr_NumericValue(std::abs(valop->GetValue())); } if (op->IsKind(STANDARD_TYPE(Expr_UnaryMinus))) { @@ -80,7 +80,7 @@ Handle(Expr_GeneralExpression) Expr_Absolute::Derivative(const Handle(Expr_Named Standard_Real Expr_Absolute::Evaluate(const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const { - return ::Abs(Operand()->Evaluate(vars, vals)); + return std::abs(Operand()->Evaluate(vars, vals)); } TCollection_AsciiString Expr_Absolute::String() const diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArcCosine.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArcCosine.cxx index cd7ff8dbdf..831e1b9cd8 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArcCosine.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArcCosine.cxx @@ -40,7 +40,7 @@ Handle(Expr_GeneralExpression) Expr_ArcCosine::ShallowSimplified() const if (op->IsKind(STANDARD_TYPE(Expr_NumericValue))) { Handle(Expr_NumericValue) valop = Handle(Expr_NumericValue)::DownCast(op); - return new Expr_NumericValue(ACos(valop->GetValue())); + return new Expr_NumericValue(std::acos(valop->GetValue())); } if (op->IsKind(STANDARD_TYPE(Expr_Cosine))) { @@ -101,7 +101,7 @@ Handle(Expr_GeneralExpression) Expr_ArcCosine::Derivative(const Handle(Expr_Name Standard_Real Expr_ArcCosine::Evaluate(const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const { - return ::ACos(Operand()->Evaluate(vars, vals)); + return std::acos(Operand()->Evaluate(vars, vals)); } TCollection_AsciiString Expr_ArcCosine::String() const diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArcSine.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArcSine.cxx index de7b06a604..2eff03c71a 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArcSine.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArcSine.cxx @@ -38,7 +38,7 @@ Handle(Expr_GeneralExpression) Expr_ArcSine::ShallowSimplified() const if (op->IsKind(STANDARD_TYPE(Expr_NumericValue))) { Handle(Expr_NumericValue) valop = Handle(Expr_NumericValue)::DownCast(op); - return new Expr_NumericValue(ASin(valop->GetValue())); + return new Expr_NumericValue(std::asin(valop->GetValue())); } if (op->IsKind(STANDARD_TYPE(Expr_Sine))) { @@ -97,7 +97,7 @@ Handle(Expr_GeneralExpression) Expr_ArcSine::Derivative(const Handle(Expr_NamedU Standard_Real Expr_ArcSine::Evaluate(const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const { - return ::ASin(Operand()->Evaluate(vars, vals)); + return std::asin(Operand()->Evaluate(vars, vals)); } TCollection_AsciiString Expr_ArcSine::String() const diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArcTangent.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArcTangent.cxx index c92d753b35..e2d4429be3 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArcTangent.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArcTangent.cxx @@ -38,7 +38,7 @@ Handle(Expr_GeneralExpression) Expr_ArcTangent::ShallowSimplified() const if (op->IsKind(STANDARD_TYPE(Expr_NumericValue))) { Handle(Expr_NumericValue) valop = Handle(Expr_NumericValue)::DownCast(op); - return new Expr_NumericValue(ATan(valop->GetValue())); + return new Expr_NumericValue(std::atan(valop->GetValue())); } if (op->IsKind(STANDARD_TYPE(Expr_Tangent))) { @@ -94,7 +94,7 @@ Handle(Expr_GeneralExpression) Expr_ArcTangent::Derivative(const Handle(Expr_Nam Standard_Real Expr_ArcTangent::Evaluate(const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const { - return ::ATan(Operand()->Evaluate(vars, vals)); + return std::atan(Operand()->Evaluate(vars, vals)); } TCollection_AsciiString Expr_ArcTangent::String() const diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArgCosh.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArgCosh.cxx index ab957bb3bd..c80302a3d7 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArgCosh.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArgCosh.cxx @@ -38,7 +38,7 @@ Handle(Expr_GeneralExpression) Expr_ArgCosh::ShallowSimplified() const if (op->IsKind(STANDARD_TYPE(Expr_NumericValue))) { Handle(Expr_NumericValue) valop = Handle(Expr_NumericValue)::DownCast(op); - return new Expr_NumericValue(ACosh(valop->GetValue())); + return new Expr_NumericValue(std::acosh(valop->GetValue())); } if (op->IsKind(STANDARD_TYPE(Expr_Cosh))) { @@ -98,7 +98,7 @@ Standard_Real Expr_ArgCosh::Evaluate(const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const { Standard_Real val = Operand()->Evaluate(vars, vals); - return ::Log(val + ::Sqrt(::Square(val) - 1.0)); + return std::log(val + std::sqrt(::Square(val) - 1.0)); } TCollection_AsciiString Expr_ArgCosh::String() const diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArgSinh.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArgSinh.cxx index 3788576033..1ee299af20 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArgSinh.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArgSinh.cxx @@ -39,7 +39,7 @@ Handle(Expr_GeneralExpression) Expr_ArgSinh::ShallowSimplified() const if (op->IsKind(STANDARD_TYPE(Expr_NumericValue))) { Handle(Expr_NumericValue) valop = Handle(Expr_NumericValue)::DownCast(op); - return new Expr_NumericValue(ASinh(valop->GetValue())); + return new Expr_NumericValue(std::asinh(valop->GetValue())); } if (op->IsKind(STANDARD_TYPE(Expr_Sinh))) { @@ -99,7 +99,7 @@ Standard_Real Expr_ArgSinh::Evaluate(const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const { Standard_Real val = Operand()->Evaluate(vars, vals); - return ::Log(val + ::Sqrt(::Square(val) + 1.0)); + return std::log(val + std::sqrt(::Square(val) + 1.0)); } TCollection_AsciiString Expr_ArgSinh::String() const diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArgTanh.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArgTanh.cxx index fa8821ce32..3a7be4bde4 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArgTanh.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_ArgTanh.cxx @@ -37,7 +37,7 @@ Handle(Expr_GeneralExpression) Expr_ArgTanh::ShallowSimplified() const if (op->IsKind(STANDARD_TYPE(Expr_NumericValue))) { Handle(Expr_NumericValue) valop = Handle(Expr_NumericValue)::DownCast(op); - return new Expr_NumericValue(ATanh(valop->GetValue())); + return new Expr_NumericValue(std::atanh(valop->GetValue())); } if (op->IsKind(STANDARD_TYPE(Expr_Tanh))) { @@ -96,7 +96,7 @@ Standard_Real Expr_ArgTanh::Evaluate(const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const { Standard_Real val = Operand()->Evaluate(vars, vals); - return ::Log((1.0 + val) / (1.0 - val)) / 2.0; + return std::log((1.0 + val) / (1.0 - val)) / 2.0; } TCollection_AsciiString Expr_ArgTanh::String() const diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_Cosh.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_Cosh.cxx index 3fdc091001..4bce351f57 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_Cosh.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_Cosh.cxx @@ -38,7 +38,7 @@ Handle(Expr_GeneralExpression) Expr_Cosh::ShallowSimplified() const if (myexp->IsKind(STANDARD_TYPE(Expr_NumericValue))) { Handle(Expr_NumericValue) myNVexp = Handle(Expr_NumericValue)::DownCast(myexp); - return new Expr_NumericValue(Cosh(myNVexp->GetValue())); + return new Expr_NumericValue(std::cosh(myNVexp->GetValue())); } if (myexp->IsKind(STANDARD_TYPE(Expr_ArgCosh))) { @@ -86,7 +86,7 @@ Standard_Real Expr_Cosh::Evaluate(const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const { Standard_Real val = Operand()->Evaluate(vars, vals); - return (::Exp(val) + ::Exp(-val)) / 2.0; + return (std::exp(val) + std::exp(-val)) / 2.0; } TCollection_AsciiString Expr_Cosh::String() const diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_Cosine.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_Cosine.cxx index f1ed362684..079771f7ac 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_Cosine.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_Cosine.cxx @@ -39,7 +39,7 @@ Handle(Expr_GeneralExpression) Expr_Cosine::ShallowSimplified() const if (myexp->IsKind(STANDARD_TYPE(Expr_NumericValue))) { Handle(Expr_NumericValue) myNVexp = Handle(Expr_NumericValue)::DownCast(myexp); - return new Expr_NumericValue(Cos(myNVexp->GetValue())); + return new Expr_NumericValue(std::cos(myNVexp->GetValue())); } if (myexp->IsKind(STANDARD_TYPE(Expr_ArcCosine))) { @@ -86,7 +86,7 @@ Handle(Expr_GeneralExpression) Expr_Cosine::Derivative(const Handle(Expr_NamedUn Standard_Real Expr_Cosine::Evaluate(const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const { - return ::Cos(Operand()->Evaluate(vars, vals)); + return std::cos(Operand()->Evaluate(vars, vals)); } TCollection_AsciiString Expr_Cosine::String() const diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_Exponential.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_Exponential.cxx index 2149e5a09e..6468fc42ee 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_Exponential.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_Exponential.cxx @@ -37,7 +37,7 @@ Handle(Expr_GeneralExpression) Expr_Exponential::ShallowSimplified() const if (myexp->IsKind(STANDARD_TYPE(Expr_NumericValue))) { Handle(Expr_NumericValue) myNVexp = Handle(Expr_NumericValue)::DownCast(myexp); - return new Expr_NumericValue(Exp(myNVexp->GetValue())); + return new Expr_NumericValue(std::exp(myNVexp->GetValue())); } if (myexp->IsKind(STANDARD_TYPE(Expr_LogOfe))) { @@ -83,7 +83,7 @@ Handle(Expr_GeneralExpression) Expr_Exponential::Derivative( Standard_Real Expr_Exponential::Evaluate(const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const { - return ::Exp(Operand()->Evaluate(vars, vals)); + return std::exp(Operand()->Evaluate(vars, vals)); } TCollection_AsciiString Expr_Exponential::String() const diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_Exponentiate.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_Exponentiate.cxx index 9323b0baa4..ef98854890 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_Exponentiate.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_Exponentiate.cxx @@ -58,7 +58,7 @@ Handle(Expr_GeneralExpression) Expr_Exponentiate::ShallowSimplified() const if (myfirst->IsKind(STANDARD_TYPE(Expr_NumericValue))) { Handle(Expr_NumericValue) myNVf = Handle(Expr_NumericValue)::DownCast(myfirst); - return new Expr_NumericValue(Pow(myNVf->GetValue(), myvals)); + return new Expr_NumericValue(std::pow(myNVf->GetValue(), myvals)); } } if (myfirst->IsKind(STANDARD_TYPE(Expr_NumericValue))) @@ -151,7 +151,7 @@ Standard_Real Expr_Exponentiate::Evaluate(const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const { Standard_Real res = FirstOperand()->Evaluate(vars, vals); - return ::Pow(res, SecondOperand()->Evaluate(vars, vals)); + return std::pow(res, SecondOperand()->Evaluate(vars, vals)); } TCollection_AsciiString Expr_Exponentiate::String() const diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_LogOf10.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_LogOf10.cxx index 5eecc95805..585f344fef 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_LogOf10.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_LogOf10.cxx @@ -37,7 +37,7 @@ Handle(Expr_GeneralExpression) Expr_LogOf10::ShallowSimplified() const if (myexp->IsKind(STANDARD_TYPE(Expr_NumericValue))) { Handle(Expr_NumericValue) myNVexp = Handle(Expr_NumericValue)::DownCast(myexp); - return new Expr_NumericValue(Log10(myNVexp->GetValue())); + return new Expr_NumericValue(std::log10(myNVexp->GetValue())); } Handle(Expr_LogOf10) me = this; return me; @@ -71,7 +71,7 @@ Handle(Expr_GeneralExpression) Expr_LogOf10::Derivative(const Handle(Expr_NamedU } Handle(Expr_GeneralExpression) myexp = Operand(); Handle(Expr_GeneralExpression) myder = myexp->Derivative(X); - Standard_Real vlog = Log(10.0); + Standard_Real vlog = std::log(10.0); Handle(Expr_NumericValue) vallog = new Expr_NumericValue(vlog); Handle(Expr_Product) theprod = Expr::CopyShare(myexp) * vallog; Handle(Expr_Division) thediv = myder / theprod->ShallowSimplified(); @@ -81,7 +81,7 @@ Handle(Expr_GeneralExpression) Expr_LogOf10::Derivative(const Handle(Expr_NamedU Standard_Real Expr_LogOf10::Evaluate(const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const { - return ::Log10(Operand()->Evaluate(vars, vals)); + return std::log10(Operand()->Evaluate(vars, vals)); } TCollection_AsciiString Expr_LogOf10::String() const diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_LogOfe.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_LogOfe.cxx index 58334073f3..48f88e7a65 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_LogOfe.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_LogOfe.cxx @@ -37,7 +37,7 @@ Handle(Expr_GeneralExpression) Expr_LogOfe::ShallowSimplified() const if (myexp->IsKind(STANDARD_TYPE(Expr_NumericValue))) { Handle(Expr_NumericValue) myNVexp = Handle(Expr_NumericValue)::DownCast(myexp); - return new Expr_NumericValue(Log(myNVexp->GetValue())); + return new Expr_NumericValue(std::log(myNVexp->GetValue())); } if (myexp->IsKind(STANDARD_TYPE(Expr_Exponential))) { @@ -82,7 +82,7 @@ Handle(Expr_GeneralExpression) Expr_LogOfe::Derivative(const Handle(Expr_NamedUn Standard_Real Expr_LogOfe::Evaluate(const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const { - return ::Log(Operand()->Evaluate(vars, vals)); + return std::log(Operand()->Evaluate(vars, vals)); } TCollection_AsciiString Expr_LogOfe::String() const diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_Sine.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_Sine.cxx index 3aae96bd3e..241e1e812e 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_Sine.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_Sine.cxx @@ -38,7 +38,7 @@ Handle(Expr_GeneralExpression) Expr_Sine::ShallowSimplified() const if (myexp->IsKind(STANDARD_TYPE(Expr_NumericValue))) { Handle(Expr_NumericValue) myNVexp = Handle(Expr_NumericValue)::DownCast(myexp); - return new Expr_NumericValue(Sin(myNVexp->GetValue())); + return new Expr_NumericValue(std::sin(myNVexp->GetValue())); } if (myexp->IsKind(STANDARD_TYPE(Expr_ArcSine))) { @@ -84,7 +84,7 @@ Handle(Expr_GeneralExpression) Expr_Sine::Derivative(const Handle(Expr_NamedUnkn Standard_Real Expr_Sine::Evaluate(const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const { - return ::Sin(Operand()->Evaluate(vars, vals)); + return std::sin(Operand()->Evaluate(vars, vals)); } TCollection_AsciiString Expr_Sine::String() const diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_Sinh.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_Sinh.cxx index 21635c43f5..113f8503fb 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_Sinh.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_Sinh.cxx @@ -38,7 +38,7 @@ Handle(Expr_GeneralExpression) Expr_Sinh::ShallowSimplified() const if (myexp->IsKind(STANDARD_TYPE(Expr_NumericValue))) { Handle(Expr_NumericValue) myNVexp = Handle(Expr_NumericValue)::DownCast(myexp); - return new Expr_NumericValue(Sinh(myNVexp->GetValue())); + return new Expr_NumericValue(std::sinh(myNVexp->GetValue())); } if (myexp->IsKind(STANDARD_TYPE(Expr_ArgSinh))) { @@ -85,7 +85,7 @@ Standard_Real Expr_Sinh::Evaluate(const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const { Standard_Real val = Operand()->Evaluate(vars, vals); - return (::Exp(val) - ::Exp(-val)) / 2.0; + return (std::exp(val) - std::exp(-val)) / 2.0; } TCollection_AsciiString Expr_Sinh::String() const diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_SquareRoot.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_SquareRoot.cxx index 2a59caa70e..6e07d6b9f5 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_SquareRoot.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_SquareRoot.cxx @@ -38,7 +38,7 @@ Handle(Expr_GeneralExpression) Expr_SquareRoot::ShallowSimplified() const if (myexp->IsKind(STANDARD_TYPE(Expr_NumericValue))) { Handle(Expr_NumericValue) myNVexp = Handle(Expr_NumericValue)::DownCast(myexp); - return new Expr_NumericValue(Sqrt(myNVexp->GetValue())); + return new Expr_NumericValue(std::sqrt(myNVexp->GetValue())); } if (myexp->IsKind(STANDARD_TYPE(Expr_Square))) { @@ -84,7 +84,7 @@ Handle(Expr_GeneralExpression) Expr_SquareRoot::Derivative(const Handle(Expr_Nam Standard_Real Expr_SquareRoot::Evaluate(const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const { - return ::Sqrt(Operand()->Evaluate(vars, vals)); + return std::sqrt(Operand()->Evaluate(vars, vals)); } TCollection_AsciiString Expr_SquareRoot::String() const diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_Tangent.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_Tangent.cxx index 1f1be725c6..b0c9b4468b 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_Tangent.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_Tangent.cxx @@ -38,7 +38,7 @@ Handle(Expr_GeneralExpression) Expr_Tangent::ShallowSimplified() const if (myexp->IsKind(STANDARD_TYPE(Expr_NumericValue))) { Handle(Expr_NumericValue) myNVexp = Handle(Expr_NumericValue)::DownCast(myexp); - return new Expr_NumericValue(Tan(myNVexp->GetValue())); + return new Expr_NumericValue(std::tan(myNVexp->GetValue())); } if (myexp->IsKind(STANDARD_TYPE(Expr_ArcTangent))) { @@ -85,7 +85,7 @@ Handle(Expr_GeneralExpression) Expr_Tangent::Derivative(const Handle(Expr_NamedU Standard_Real Expr_Tangent::Evaluate(const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const { - return ::Tan(Operand()->Evaluate(vars, vals)); + return std::tan(Operand()->Evaluate(vars, vals)); } TCollection_AsciiString Expr_Tangent::String() const diff --git a/src/ModelingAlgorithms/TKExpress/Expr/Expr_Tanh.cxx b/src/ModelingAlgorithms/TKExpress/Expr/Expr_Tanh.cxx index 182d226bbf..4a8e87130b 100644 --- a/src/ModelingAlgorithms/TKExpress/Expr/Expr_Tanh.cxx +++ b/src/ModelingAlgorithms/TKExpress/Expr/Expr_Tanh.cxx @@ -38,7 +38,7 @@ Handle(Expr_GeneralExpression) Expr_Tanh::ShallowSimplified() const if (myexp->IsKind(STANDARD_TYPE(Expr_NumericValue))) { Handle(Expr_NumericValue) myNVexp = Handle(Expr_NumericValue)::DownCast(myexp); - return new Expr_NumericValue(Tanh(myNVexp->GetValue())); + return new Expr_NumericValue(std::tanh(myNVexp->GetValue())); } if (myexp->IsKind(STANDARD_TYPE(Expr_ArgTanh))) { @@ -86,7 +86,7 @@ Standard_Real Expr_Tanh::Evaluate(const Expr_Array1OfNamedUnknown& vars, const TColStd_Array1OfReal& vals) const { Standard_Real val = Operand()->Evaluate(vars, vals); - return (::Exp(val) - ::Exp(-val)) / (::Exp(val) + ::Exp(-val)); + return (std::exp(val) - std::exp(-val)) / (std::exp(val) + std::exp(-val)); } TCollection_AsciiString Expr_Tanh::String() const diff --git a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat.cxx b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat.cxx index bf0815e747..a9743da33d 100644 --- a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat.cxx +++ b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat.cxx @@ -215,8 +215,8 @@ void BRepFeat::ParametricMinMax(const TopoDS_Shape& S, { if (!theOri) { - prmin = Min(ASI.Point(1, 1).Parameter(), ASI.Point(1, ASI.NbPoints(1)).Parameter()); - prmax = Max(ASI.Point(1, 1).Parameter(), ASI.Point(1, ASI.NbPoints(1)).Parameter()); + prmin = std::min(ASI.Point(1, 1).Parameter(), ASI.Point(1, ASI.NbPoints(1)).Parameter()); + prmax = std::max(ASI.Point(1, 1).Parameter(), ASI.Point(1, ASI.NbPoints(1)).Parameter()); } else { @@ -368,10 +368,10 @@ static void PutInBoundsU(Standard_Real umin, gp_Pnt2d Pf = C2d->Value(f); gp_Pnt2d Pl = C2d->Value(l); gp_Pnt2d Pm = C2d->Value(0.34 * f + 0.66 * l); - Standard_Real minC = Min(Pf.X(), Pl.X()); - minC = Min(minC, Pm.X()); - Standard_Real maxC = Max(Pf.X(), Pl.X()); - maxC = Max(maxC, Pm.X()); + Standard_Real minC = std::min(Pf.X(), Pl.X()); + minC = std::min(minC, Pm.X()); + Standard_Real maxC = std::max(Pf.X(), Pl.X()); + maxC = std::max(maxC, Pm.X()); Standard_Real du = 0.; if (minC < umin - eps) { @@ -422,10 +422,10 @@ static void PutInBoundsV(Standard_Real vmin, gp_Pnt2d Pf = C2d->Value(f); gp_Pnt2d Pl = C2d->Value(l); gp_Pnt2d Pm = C2d->Value(0.34 * f + 0.66 * l); - Standard_Real minC = Min(Pf.Y(), Pl.Y()); - minC = Min(minC, Pm.Y()); - Standard_Real maxC = Max(Pf.Y(), Pl.Y()); - maxC = Max(maxC, Pm.Y()); + Standard_Real minC = std::min(Pf.Y(), Pl.Y()); + minC = std::min(minC, Pm.Y()); + Standard_Real maxC = std::max(Pf.Y(), Pl.Y()); + maxC = std::max(maxC, Pm.Y()); Standard_Real dv = 0.; if (minC < vmin - eps) { @@ -518,7 +518,7 @@ void BRepFeat::FaceUntil(const TopoDS_Shape& Sbase, TopoDS_Face& FUntil) BRepBndLib::Add(Sbase, B); Standard_Real x[2], y[2], z[2]; B.Get(x[0], y[0], z[0], x[1], y[1], z[1]); - Standard_Real diam = 10. * Sqrt(B.SquareExtent()); + Standard_Real diam = 10. * std::sqrt(B.SquareExtent()); Handle(Geom_Surface) s = BRep_Tool::Surface(FUntil); Handle(Standard_Type) styp = s->DynamicType(); diff --git a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_Form.cxx b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_Form.cxx index a0fdc23f60..0631f2004e 100644 --- a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_Form.cxx +++ b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_Form.cxx @@ -824,17 +824,17 @@ void BRepFeat_Form::GlobalPerform() } else { - prmin = Min(prmin1, prmin2); + prmin = std::min(prmin1, prmin2); } pbmax = prbmax2; pbmin = ElCLib::InPeriod(prbmin1, pbmax - period, pbmax); } else { - prmin = Min(prmin1, prmin2); - prmax = Max(prmax1, prmax2); - pbmin = Min(prbmin1, prbmin2); - pbmax = Max(prbmax1, prbmax2); + prmin = std::min(prmin1, prmin2); + prmax = std::max(prmax1, prmax2); + pbmin = std::min(prbmin1, prbmin2); + pbmax = std::max(prbmax1, prbmax2); } } else if (myPerfSelection == BRepFeat_SelectionShU) diff --git a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeCylindricalHole.cxx b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeCylindricalHole.cxx index 650db7931b..36a47328a1 100644 --- a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeCylindricalHole.cxx +++ b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeCylindricalHole.cxx @@ -609,9 +609,9 @@ void BRepFeat_MakeCylindricalHole::PerformBlind(const Standard_Real Radius, { Baryc(its.Value(), Barycentre); parbar = ElCLib::LineParameter(myAxis, Barycentre); - if (Abs(First - parbar) < dmin) + if (std::abs(First - parbar) < dmin) { - dmin = Abs(First - parbar); + dmin = std::abs(First - parbar); tokeep = its.Value(); } } @@ -744,8 +744,8 @@ void BoxParameters(const TopoDS_Shape& S, { P.SetZ(c[k]); param = ElCLib::LineParameter(Axis, P); - parmin = Min(param, parmin); - parmax = Max(param, parmax); + parmin = std::min(param, parmin); + parmax = std::max(param, parmax); } } } @@ -770,9 +770,9 @@ Standard_Boolean GetOffset(const LocOpe_PntFace& PntInfo, if (stat != CSLib_Defined) return Standard_False; Standard_Real angle = Axis.Direction().Angle(NormF); - if (Abs(M_PI / 2. - angle) < Precision::Angular()) + if (std::abs(M_PI / 2. - angle) < Precision::Angular()) return Standard_False; - outOff = Radius * Abs(tan(angle)); + outOff = Radius * std::abs(tan(angle)); return Standard_True; } diff --git a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeDPrism.cxx b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeDPrism.cxx index 183bf52a6c..0117835d75 100644 --- a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeDPrism.cxx +++ b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeDPrism.cxx @@ -1173,9 +1173,10 @@ static Standard_Real HeightMax(const TopoDS_Shape& theSbase, // shape initial // Standard_Real Height = abs(2.*(parmax - parmin)); // return(2.*Height); // #ifndef OCCT_DEBUG - Standard_Real par = Max(Max(fabs(c[1] - c[0]), fabs(c[3] - c[2])), fabs(c[5] - c[4])); + Standard_Real par = std::max(std::max(fabs(c[1] - c[0]), fabs(c[3] - c[2])), fabs(c[5] - c[4])); // #else - // Standard_Real par = Max( Max( abs(c[1] - c[0]), abs(c[3] - c[2]) ), abs(c[5] - c[4]) ); + // Standard_Real par = std::max( std::max( abs(c[1] - c[0]), abs(c[3] - c[2]) ), abs(c[5] - + // c[4]) ); // #endif #ifdef OCCT_DEBUG std::cout << "Height = > " << par << std::endl; diff --git a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakePrism.cxx b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakePrism.cxx index b81615dafa..6c58635586 100644 --- a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakePrism.cxx +++ b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakePrism.cxx @@ -571,7 +571,7 @@ void BRepFeat_MakePrism::Perform(const TopoDS_Shape& From, const TopoDS_Shape& U myStatusError = BRepFeat_NoIntersectF; return; } - if (tran > 0 && (Abs(ParU) < Abs(ParF))) + if (tran > 0 && (std::abs(ParU) < std::abs(ParF))) { TopAbs_Orientation Or; Or = OrU; diff --git a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeRevol.cxx b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeRevol.cxx index ae706c1ed8..b64164e96c 100644 --- a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeRevol.cxx +++ b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeRevol.cxx @@ -208,7 +208,7 @@ void BRepFeat_MakeRevol::Perform(const Standard_Real Angle) myGluedF.Clear(); myPerfSelection = BRepFeat_NoSelection; PerfSelectionValid(); - Standard_Boolean RevolComp = (2 * M_PI - Abs(Angle) <= Precision::Angular()); + Standard_Boolean RevolComp = (2 * M_PI - std::abs(Angle) <= Precision::Angular()); LocOpe_Revol theRevol; Standard_Real angledec = 0.; TopExp_Explorer exp; @@ -573,7 +573,7 @@ void BRepFeat_MakeRevol::Perform(const TopoDS_Shape& From, const TopoDS_Shape& U // OrF = OrU; OrF = TopAbs::Reverse(OrU); FFrom = ASI2.Point(1, 1).Face(); - PrF = Max(pr1, pr2); + PrF = std::max(pr1, pr2); } else { diff --git a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeRevolutionForm.cxx b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeRevolutionForm.cxx index 4f5516ccf3..afd501b7a3 100644 --- a/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeRevolutionForm.cxx +++ b/src/ModelingAlgorithms/TKFeat/BRepFeat/BRepFeat_MakeRevolutionForm.cxx @@ -168,14 +168,14 @@ void BRepFeat_MakeRevolutionForm::Init(const TopoDS_Shape& Sbase, } Standard_Real par1 = proj1.Distance(1); Standard_Real par2 = proj2.Distance(1); - Standard_Real Par = Min(par1, par2); + Standard_Real Par = std::min(par1, par2); if (Par < L) L = Par; if (L < Rad && L > 0.) Rad = L; } - Standard_Real height = Min(H1, H2); + Standard_Real height = std::min(H1, H2); if (Rad <= height) Rad = height + 0.01 * height; diff --git a/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_DPrism.cxx b/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_DPrism.cxx index 587bc6201e..7b8de1ac6d 100644 --- a/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_DPrism.cxx +++ b/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_DPrism.cxx @@ -85,7 +85,7 @@ LocOpe_DPrism::LocOpe_DPrism(const TopoDS_Face& Spine, Vmax = 0.; BRepTools::UVBounds(Spine, Umin, Umax, Vmin, Vmax); - Standard_Real Deltay = Max(Umax - Umin, Vmax - Vmin) + Abs(y); + Standard_Real Deltay = std::max(Umax - Umin, Vmax - Vmin) + std::abs(y); Deltay *= 2; TopoDS_Vertex Vert3 = BRepLib_MakeVertex(gp_Pnt(0, y + Deltay, z)); @@ -97,7 +97,7 @@ LocOpe_DPrism::LocOpe_DPrism(const TopoDS_Face& Spine, Vmax = 0.; BRepTools::UVBounds(Spine, Umin, Umax, Vmin, Vmax); - Standard_Real Deltay1 = Max(Umax - Umin, Vmax - Vmin) + Abs(y1); + Standard_Real Deltay1 = std::max(Umax - Umin, Vmax - Vmin) + std::abs(y1); Deltay1 *= 2; TopoDS_Vertex Vert4 = BRepLib_MakeVertex(gp_Pnt(0, y1 + Deltay1, z1)); @@ -368,7 +368,7 @@ LocOpe_DPrism::LocOpe_DPrism(const TopoDS_Face& Spine, Standard_Real Umin, Umax, Vmin, Vmax; BRepTools::UVBounds(Spine, Umin, Umax, Vmin, Vmax); - Standard_Real Deltay = Max(Umax - Umin, Vmax - Vmin) + Abs(y); + Standard_Real Deltay = std::max(Umax - Umin, Vmax - Vmin) + std::abs(y); Deltay *= 2; TopoDS_Vertex Vert3 = BRepLib_MakeVertex(gp_Pnt(0, y + Deltay, z)); @@ -648,8 +648,8 @@ void LocOpe_DPrism::Curves(TColGeom_SequenceOfCurve& Scurves) const { C = BRep_Tool::Curve(edg, Loc, f, l); C = Handle(Geom_Curve)::DownCast(C->Transformed(Loc.Transformation())); - Standard_Real u1 = -2 * Abs(myHeight); - Standard_Real u2 = 2 * Abs(myHeight); + Standard_Real u1 = -2 * std::abs(myHeight); + Standard_Real u2 = 2 * std::abs(myHeight); for (i = 0; i <= NECHANT; i++) { diff --git a/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_FindEdges.cxx b/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_FindEdges.cxx index a945ed881d..051aa75082 100644 --- a/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_FindEdges.cxx +++ b/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_FindEdges.cxx @@ -117,7 +117,7 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom, const TopoDS_Shape& FTo) { gp_Circ cif = Handle(Geom_Circle)::DownCast(Cf)->Circ(); gp_Circ cit = Handle(Geom_Circle)::DownCast(Ct)->Circ(); - if (Abs(cif.Radius() - cit.Radius()) <= Tol + if (std::abs(cif.Radius() - cit.Radius()) <= Tol && cif.Location().SquareDistance(cit.Location()) <= Tol * Tol) { // Point debut, calage dans periode, et detection meme sens @@ -129,7 +129,7 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom, const TopoDS_Shape& FTo) Standard_Real prm1 = ElCLib::Parameter(cit, p1); Standard_Real Tol2d = Precision::PConfusion(); - if (Abs(prm1 - ft) <= Tol2d) + if (std::abs(prm1 - ft) <= Tol2d) prm1 = ft; prm1 = ElCLib::InPeriod(prm1, ft, ft + 2. * M_PI); ElCLib::D1(prm1, cit, p1, tgt); @@ -144,7 +144,7 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom, const TopoDS_Shape& FTo) } else { - if (Abs(prm1 - ft) <= Precision::Angular()) + if (std::abs(prm1 - ft) <= Precision::Angular()) { prm1 += 2. * M_PI; } @@ -178,8 +178,8 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom, const TopoDS_Shape& FTo) gp_Elips cif = Handle(Geom_Ellipse)::DownCast(Cf)->Elips(); gp_Elips cit = Handle(Geom_Ellipse)::DownCast(Ct)->Elips(); - if (Abs(cif.MajorRadius() - cit.MajorRadius()) <= Tol - && Abs(cif.MinorRadius() - cit.MinorRadius()) <= Tol + if (std::abs(cif.MajorRadius() - cit.MajorRadius()) <= Tol + && std::abs(cif.MinorRadius() - cit.MinorRadius()) <= Tol && cif.Location().SquareDistance(cit.Location()) <= Tol * Tol) { // Point debut, calage dans periode, et detection meme sens @@ -203,7 +203,7 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom, const TopoDS_Shape& FTo) } else { - if (Abs(prm1 - ft) <= Precision::Angular()) + if (std::abs(prm1 - ft) <= Precision::Angular()) { prm1 += 2. * M_PI; } @@ -284,7 +284,7 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom, const TopoDS_Shape& FTo) IsSame = Standard_False; break; } - if (Abs(Mf(k) - Mt(k)) > Tol) + if (std::abs(Mf(k) - Mt(k)) > Tol) { IsSame = Standard_False; break; @@ -314,7 +314,7 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom, const TopoDS_Shape& FTo) for (Standard_Integer w = 1; w <= nbpoles; w++) { - if (Abs(Wf(w) - Wt(w)) > Tol) + if (std::abs(Wf(w) - Wt(w)) > Tol) { IsSame = Standard_False; break; @@ -388,7 +388,7 @@ void LocOpe_FindEdges::Set(const TopoDS_Shape& FFrom, const TopoDS_Shape& FTo) for (Standard_Integer w = 1; w <= nbpoles; w++) { - if (Abs(Wf(w) - Wt(w)) > Tol) + if (std::abs(Wf(w) - Wt(w)) > Tol) { IsSame = Standard_False; break; diff --git a/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_FindEdgesInFace.cxx b/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_FindEdgesInFace.cxx index 876326cfa6..f985e1a12b 100644 --- a/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_FindEdgesInFace.cxx +++ b/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_FindEdgesInFace.cxx @@ -131,7 +131,7 @@ void LocOpe_FindEdgesInFace::Set(const TopoDS_Shape& Sh, const TopoDS_Face& F) else { // Ts == STANDARD_TYPE(Geom_CylindricalSurface) if (cy.Axis().IsParallel(li.Position(), TolAng) - && Abs(li.Distance(cy.Location()) - cy.Radius()) < Tol) + && std::abs(li.Distance(cy.Location()) - cy.Radius()) < Tol) { ToAdd = Standard_True; } @@ -149,7 +149,8 @@ void LocOpe_FindEdgesInFace::Set(const TopoDS_Shape& Sh, const TopoDS_Face& F) } else { - if (Abs(cy.Radius() - ci.Radius()) < Tol && cy.Axis().IsCoaxial(ci.Axis(), TolAng, Tol)) + if (std::abs(cy.Radius() - ci.Radius()) < Tol + && cy.Axis().IsCoaxial(ci.Axis(), TolAng, Tol)) { ToAdd = Standard_True; } diff --git a/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_Generator.cxx b/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_Generator.cxx index ec840a256a..27a662debe 100644 --- a/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_Generator.cxx +++ b/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_Generator.cxx @@ -638,14 +638,14 @@ void LocOpe_Generator::Perform(const Handle(LocOpe_GeneratedShape)& G) pf = C2d->Value(f); pl = C2d->Value(l); constexpr Standard_Real tttol = Precision::Angular(); - while (Min(pf.X(), pl.X()) >= Umaxc - tttol) + while (std::min(pf.X(), pl.X()) >= Umaxc - tttol) { C2d->Translate(gp_Vec2d(-2. * M_PI, 0)); pf = C2d->Value(f); pl = C2d->Value(l); } - while (Max(pf.X(), pl.X()) <= Uminc + tttol) + while (std::max(pf.X(), pl.X()) <= Uminc + tttol) { C2d->Translate(gp_Vec2d(2. * M_PI, 0)); pf = C2d->Value(f); @@ -1021,14 +1021,14 @@ void LocOpe_Generator::Perform(const Handle(LocOpe_GeneratedShape)& G) pf = C2d->Value(f); pl = C2d->Value(l); constexpr Standard_Real tttol = Precision::Angular(); - while (Min(pf.X(), pl.X()) >= Umaxc - tttol) + while (std::min(pf.X(), pl.X()) >= Umaxc - tttol) { C2d->Translate(gp_Vec2d(-2. * M_PI, 0)); pf = C2d->Value(f); pl = C2d->Value(l); } - while (Max(pf.X(), pl.X()) <= Uminc + tttol) + while (std::max(pf.X(), pl.X()) <= Uminc + tttol) { C2d->Translate(gp_Vec2d(2. * M_PI, 0)); pf = C2d->Value(f); @@ -1409,7 +1409,7 @@ Standard_Real NewParameter(const TopoDS_Edge& Edg, if (exp.More()) { Standard_Real prmmax = BRep_Tool::Parameter(TopoDS::Vertex(exp.Current()), NewEdg); - if (Abs(prmmax - prm) <= Epsilon(2. * M_PI)) + if (std::abs(prmmax - prm) <= Epsilon(2. * M_PI)) { if (orient == TopAbs_REVERSED) { diff --git a/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_Gluer.cxx b/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_Gluer.cxx index fb17ed094b..a3c14e903c 100644 --- a/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_Gluer.cxx +++ b/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_Gluer.cxx @@ -508,7 +508,7 @@ void LocOpe_Gluer::AddEdges() Standard_Real dist2min = ext.SquareDistance(1); for (i = 2; i <= ext.NbExt(); i++) { - dist2min = Min(dist2min, ext.SquareDistance(i)); + dist2min = std::min(dist2min, ext.SquareDistance(i)); } if (dist2min >= BRep_Tool::Tolerance(v) * BRep_Tool::Tolerance(v)) { diff --git a/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_Pipe.cxx b/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_Pipe.cxx index f7b64016f2..0fe5c5e8fa 100644 --- a/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_Pipe.cxx +++ b/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_Pipe.cxx @@ -345,7 +345,7 @@ const TColGeom_SequenceOfCurve& LocOpe_Pipe::Curves(const TColgp_SequenceOfPnt& { continue; } - MaxDeg = Max(MaxDeg, C->Degree()); + MaxDeg = std::max(MaxDeg, C->Degree()); P1 = C->Value(p2); if (p1 != C->FirstParameter() || p2 != C->LastParameter()) { @@ -474,7 +474,7 @@ Handle(Geom_Curve) LocOpe_Pipe::BarycCurve() { continue; } - MaxDeg = Max(MaxDeg, C->Degree()); + MaxDeg = std::max(MaxDeg, C->Degree()); P1 = C->Value(p2); if (p1 != C->FirstParameter() || p2 != C->LastParameter()) { diff --git a/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_Prism.cxx b/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_Prism.cxx index 7d14ba9018..6a0162cf07 100644 --- a/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_Prism.cxx +++ b/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_Prism.cxx @@ -260,7 +260,7 @@ void LocOpe_Prism::Curves(TColGeom_SequenceOfCurve& Scurves) const TColgp_SequenceOfPnt spt; LocOpe::SampleEdges(myFirstShape, spt); Standard_Real height = - Sqrt(myVec.X() * myVec.X() + myVec.Y() * myVec.Y() + myVec.Z() * myVec.Z()); + std::sqrt(myVec.X() * myVec.X() + myVec.Y() * myVec.Y() + myVec.Z() * myVec.Z()); Standard_Real u1 = -2 * height; Standard_Real u2 = 2 * height; diff --git a/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_SplitDrafts.cxx b/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_SplitDrafts.cxx index ff5978ed55..0c4bbd79c8 100644 --- a/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_SplitDrafts.cxx +++ b/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_SplitDrafts.cxx @@ -728,10 +728,10 @@ void LocOpe_SplitDrafts::Perform(const TopoDS_Face& F, return; // voir ce qu`on peut faire de mieux } Standard_Integer imin = 1; - Standard_Real delta = Abs(knownp - intcs.Point(1).W()); + Standard_Real delta = std::abs(knownp - intcs.Point(1).W()); for (Standard_Integer i = 2; i <= intcs.NbPoints(); i++) { - Standard_Real newdelta = Abs(knownp - intcs.Point(i).W()); + Standard_Real newdelta = std::abs(knownp - intcs.Point(i).W()); if (newdelta < delta) { imin = i; @@ -750,7 +750,7 @@ void LocOpe_SplitDrafts::Perform(const TopoDS_Face& F, p2 = intcs.Point(imin).W(); } } - if (Abs(p1 - p2) > Precision::PConfusion()) + if (std::abs(p1 - p2) > Precision::PConfusion()) { TopoDS_Edge NewEdge; B.MakeEdge(NewEdge, Newc, Precision::Confusion()); @@ -1035,7 +1035,7 @@ void LocOpe_SplitDrafts::Perform(const TopoDS_Face& F, Standard_Real prmd = (fd + ld) / 2.; gp_Pnt pg = Cg->Value(prmg); gp_Pnt pd = Cd->Value(prmd); - Standard_Real Tol = Max(BRep_Tool::Tolerance(NewEdgg), BRep_Tool::Tolerance(NewEdgg)); + Standard_Real Tol = std::max(BRep_Tool::Tolerance(NewEdgg), BRep_Tool::Tolerance(NewEdgg)); if (pg.SquareDistance(pd) <= Tol * Tol) { isedg = Standard_True; @@ -1047,7 +1047,7 @@ void LocOpe_SplitDrafts::Perform(const TopoDS_Face& F, Cd = BRep_Tool::Curve(edg, fd, ld); prmd = (fd + ld) / 2.; pd = Cd->Value(prmd); - Tol = Max(BRep_Tool::Tolerance(NewEdgg), BRep_Tool::Tolerance(edg)); + Tol = std::max(BRep_Tool::Tolerance(NewEdgg), BRep_Tool::Tolerance(edg)); if (pg.SquareDistance(pd) <= Tol * Tol) { modified = Standard_False; @@ -1493,7 +1493,7 @@ static Standard_Boolean NewPlane(const TopoDS_Face& F, NormalF = Plorig.Axis(); gp_Dir ny = NormalF.Direction().Crossed(nx); Standard_Real a = Extr.Dot(nx); - if (Abs(a) <= 1 - Precision::Angular()) + if (std::abs(a) <= 1 - Precision::Angular()) { Standard_Real b = Extr.Dot(ny); Standard_Real c = Extr.Dot(NormalF.Direction()); @@ -1505,14 +1505,14 @@ static Standard_Boolean NewPlane(const TopoDS_Face& F, c = -c; NormalF.Reverse(); } - Standard_Real denom = Sqrt(1 - a * a); - Standard_Real Sina = Sin(Ang); - if (denom > Abs(Sina)) + Standard_Real denom = std::sqrt(1 - a * a); + Standard_Real Sina = std::sin(Ang); + if (denom > std::abs(Sina)) { - Standard_Real phi = ATan2(b / denom, c / denom); - Standard_Real theta0 = ACos(Sina / denom); + Standard_Real phi = std::atan2(b / denom, c / denom); + Standard_Real theta0 = std::acos(Sina / denom); Theta = theta0 - phi; - if (Cos(Theta) < 0.) + if (std::cos(Theta) < 0.) { Theta = -theta0 - phi; } @@ -1826,8 +1826,8 @@ static TopoDS_Edge NewEdge(const TopoDS_Edge& edg, Standard_Real f, l; BRep_Tool::Range(edg, f, l); Standard_Real delt = l - f; - Standard_Real delt1 = Abs(prml - prmf); - Standard_Real delt2 = Abs(period - delt1); + Standard_Real delt1 = std::abs(prml - prmf); + Standard_Real delt2 = std::abs(period - delt1); if (delt1 == 0 || delt2 == 0) { @@ -1838,7 +1838,7 @@ static TopoDS_Edge NewEdge(const TopoDS_Edge& edg, } else { - if (Abs(delt1 - delt) > Abs(delt2 - delt)) + if (std::abs(delt1 - delt) > std::abs(delt2 - delt)) { // le bon ecart est delt2... if (prml > prmf) @@ -1864,7 +1864,7 @@ static TopoDS_Edge NewEdge(const TopoDS_Edge& edg, } } } - else if (Abs(delt1 - delt) < Abs(delt2 - delt)) + else if (std::abs(delt1 - delt) < std::abs(delt2 - delt)) { if (prmf >= iml && prml >= iml) { @@ -1917,7 +1917,7 @@ static TopoDS_Edge NewEdge(const TopoDS_Edge& edg, Standard_Real Ul = pl.X(); Standard_Real ptra = 0.0; - Standard_Real Ustart = Min(Uf, Ul); + Standard_Real Ustart = std::min(Uf, Ul); while (Ustart < -Precision::PConfusion()) { Ustart += speriod; diff --git a/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_SplitShape.cxx b/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_SplitShape.cxx index c075d0ff28..f30f0e1d97 100644 --- a/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_SplitShape.cxx +++ b/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_SplitShape.cxx @@ -194,7 +194,7 @@ void LocOpe_SplitShape::Add(const TopoDS_Vertex& V, const Standard_Real P, const // for degenerated edges tolerance of vertices should be set to maximal value // from tolerance of the vertex of the edge and tolerance of splitting vertex Standard_Real aTolV1 = - (BRep_Tool::Degenerated(edg) ? Max(BRep_Tool::Tolerance(aCurV1), aTolSplitV) + (BRep_Tool::Degenerated(edg) ? std::max(BRep_Tool::Tolerance(aCurV1), aTolSplitV) : BRep_Tool::Tolerance(aCurV1)); B.UpdateVertex(aCurV1, aPar1, E1, aTolV1); @@ -685,7 +685,7 @@ static Standard_Boolean checkOverlapping(const TopoDS_Edge& theEdge1, Standard_Real MaxTol = (BRep_Tool::Tolerance(theEdge1) + BRep_Tool::Tolerance(theEdge2)); - Standard_Real aMaxTol2d = Max(anAdS.UResolution(MaxTol), anAdS.VResolution(MaxTol)); + Standard_Real aMaxTol2d = std::max(anAdS.UResolution(MaxTol), anAdS.VResolution(MaxTol)); Standard_Real aTolAng = M_PI / 180.; Geom2dAPI_ProjectPointOnCurve proj; Standard_Real aF1, aL1, aF2, aL2; @@ -734,7 +734,7 @@ Standard_Boolean LocOpe_SplitShape::AddOpenWire(const TopoDS_Wire& W, const Topo tolf = BRep_Tool::Tolerance(Vfirst); toll = BRep_Tool::Tolerance(Vlast); - tol1 = Max(tolf, toll); + tol1 = std::max(tolf, toll); TopExp_Explorer exp, exp2; @@ -794,7 +794,7 @@ Standard_Boolean LocOpe_SplitShape::AddOpenWire(const TopoDS_Wire& W, const Topo Standard_Boolean IsPeriodic = BAS.IsUPeriodic() || BAS.IsVPeriodic(); - tol1 = Max(BAS.UResolution(tol1), BAS.VResolution(tol1)); + tol1 = std::max(BAS.UResolution(tol1), BAS.VResolution(tol1)); if (wfirst.IsSame(wlast)) { @@ -967,7 +967,7 @@ Standard_Boolean LocOpe_SplitShape::AddOpenWire(const TopoDS_Wire& W, const Topo } toll = BRep_Tool::Tolerance(Vlast); - tol1 = Max(tolf, toll); + tol1 = std::max(tolf, toll); } // MODIFICATION PIERRE SMEYERS : si pas de possibilite, on sort avec erreur else @@ -977,7 +977,7 @@ Standard_Boolean LocOpe_SplitShape::AddOpenWire(const TopoDS_Wire& W, const Topo } // fin MODIF. - tol1 = Max(BAS.UResolution(tol1), BAS.VResolution(tol1)); + tol1 = std::max(BAS.UResolution(tol1), BAS.VResolution(tol1)); } Standard_Integer nbAddBound = 0; diff --git a/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_WiresOnShape.cxx b/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_WiresOnShape.cxx index 38b53994d1..a5b1611656 100644 --- a/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_WiresOnShape.cxx +++ b/src/ModelingAlgorithms/TKFeat/LocOpe/LocOpe_WiresOnShape.cxx @@ -316,8 +316,8 @@ void LocOpe_WiresOnShape::BindAll() Standard_Real aF1, aL1; BRep_Tool::Range(Epro, fac, aF1, aL1); if (!BRep_Tool::Degenerated(Epro) - && (Abs(prm - aF1) <= Precision::PConfusion() - || Abs(prm - aL1) <= Precision::PConfusion())) + && (std::abs(prm - aF1) <= Precision::PConfusion() + || std::abs(prm - aL1) <= Precision::PConfusion())) { myMap.Bind(vtx, vtx2); theMap.Add(vtx); @@ -558,8 +558,8 @@ Standard_Boolean Project(const TopoDS_Vertex& V, Standard_Real dvmax = 0.01 * (adSurf.LastVParameter() - adSurf.FirstVParameter()); gp_Pnt2d aPcur = p2d; - Standard_Real dumin = Abs(aPcur.X() - aPBound2d.X()); - Standard_Real dvmin = Abs(aPcur.Y() - aPBound2d.Y()); + Standard_Real dumin = std::abs(aPcur.X() - aPBound2d.X()); + Standard_Real dvmin = std::abs(aPcur.Y() - aPBound2d.Y()); if (dumin > dumax && adSurf.IsUPeriodic()) { Standard_Real aX1 = aPBound2d.X(); @@ -571,8 +571,8 @@ Standard_Boolean Project(const TopoDS_Vertex& V, aShift = ShapeAnalysis::AdjustToPeriod(aX2, adSurf.FirstUParameter(), adSurf.LastUParameter()); aX2 += aShift; - dumin = Abs(aX2 - aX1); - if (dumin > dumax && (Abs(dumin - adSurf.UPeriod()) < Precision::PConfusion())) + dumin = std::abs(aX2 - aX1); + if (dumin > dumax && (std::abs(dumin - adSurf.UPeriod()) < Precision::PConfusion())) { aX2 = aX1; dumin = 0.; @@ -591,8 +591,8 @@ Standard_Boolean Project(const TopoDS_Vertex& V, aShift = ShapeAnalysis::AdjustToPeriod(aY2, adSurf.FirstVParameter(), adSurf.LastVParameter()); aY2 += aShift; - dvmin = Abs(aY1 - aY2); - if (dvmin > dvmax && (Abs(dvmin - adSurf.VPeriod()) < Precision::Confusion())) + dvmin = std::abs(aY1 - aY2); + if (dvmin > dvmax && (std::abs(dvmin - adSurf.VPeriod()) < Precision::Confusion())) { aY2 = aY1; dvmin = 0.; @@ -605,12 +605,12 @@ Standard_Boolean Project(const TopoDS_Vertex& V, dumax = adSurf.UResolution(aTolV); dvmax = adSurf.VResolution(aTolV); - Standard_Real aTol2d = 2. * Max(dumax, dvmax); - Standard_Real aDist2d = Max(dumin, dvmin); + Standard_Real aTol2d = 2. * std::max(dumax, dvmax); + Standard_Real aDist2d = std::max(dumin, dvmin); if (aDist2d > aTol2d) { - Standard_Real aDist3d1 = aDist2d / Max(anUResolution, aVResolution); + Standard_Real aDist3d1 = aDist2d / std::max(anUResolution, aVResolution); if (aDist3d1 > aDist3d) aDist3d = aDist3d1; } @@ -622,7 +622,7 @@ Standard_Boolean Project(const TopoDS_Vertex& V, gp_Pnt aPV2d; aSurf->D0(p2d.X(), p2d.Y(), aPV2d); Standard_Real aDistPoints_3D = aPV2d.SquareDistance(aPBound); - Standard_Real aMaxDist = Max(aDistPoints_3D, aDist3d * aDist3d); + Standard_Real aMaxDist = std::max(aDistPoints_3D, aDist3d * aDist3d); BRep_Builder B; if (aTolV * aTolV < aMaxDist) @@ -794,8 +794,8 @@ void PutPCurve(const TopoDS_Edge& Edg, const TopoDS_Face& Fac) gp_Pnt pnt2 = BRep_Tool::Pnt(V2); Standard_Real tol1 = pnt1.Distance(PF); Standard_Real tol2 = pnt2.Distance(PL); - B.UpdateVertex(V1, Max(old1, tol1)); - B.UpdateVertex(V2, Max(old2, tol2)); + B.UpdateVertex(V1, std::max(old1, tol1)); + B.UpdateVertex(V2, std::max(old2, tol2)); } if (S->IsUPeriodic()) @@ -803,8 +803,8 @@ void PutPCurve(const TopoDS_Edge& Edg, const TopoDS_Face& Fac) Standard_Real up = S->UPeriod(); constexpr Standard_Real tolu = Precision::PConfusion(); // Epsilon(up); Standard_Integer nbtra = 0; - Standard_Real theUmin = Min(pf.X(), pl.X()); - Standard_Real theUmax = Max(pf.X(), pl.X()); + Standard_Real theUmin = std::min(pf.X(), pl.X()); + Standard_Real theUmax = std::max(pf.X(), pl.X()); if (theUmin < Umin - tolu) { @@ -834,8 +834,8 @@ void PutPCurve(const TopoDS_Edge& Edg, const TopoDS_Face& Fac) Standard_Real vp = S->VPeriod(); constexpr Standard_Real tolv = Precision::PConfusion(); // Epsilon(vp); Standard_Integer nbtra = 0; - Standard_Real theVmin = Min(pf.Y(), pl.Y()); - Standard_Real theVmax = Max(pf.Y(), pl.Y()); + Standard_Real theVmin = std::min(pf.Y(), pl.Y()); + Standard_Real theVmax = std::max(pf.Y(), pl.Y()); if (theVmin < Vmin - tolv) { @@ -945,11 +945,11 @@ void PutPCurves(const TopoDS_Edge& Efrom, const TopoDS_Edge& Eto, const TopoDS_S S = BRep_Tool::Surface(Fac); // Compute the tol2d - Standard_Real tol3d = Max(BRep_Tool::Tolerance(Efrom), BRep_Tool::Tolerance(Fac)); + Standard_Real tol3d = std::max(BRep_Tool::Tolerance(Efrom), BRep_Tool::Tolerance(Fac)); GeomAdaptor_Surface Gas(S, Umin, Umax, Vmin, Vmax); Standard_Real TolU = Gas.UResolution(tol3d); Standard_Real TolV = Gas.VResolution(tol3d); - Standard_Real tol2d = Max(TolU, TolV); + Standard_Real tol2d = std::max(TolU, TolV); Handle(Geom2d_Curve) C2d = GeomProjLib::Curve2d(C, S, Umin, Umax, Vmin, Vmax, tol2d); if (C2d.IsNull()) @@ -963,8 +963,8 @@ void PutPCurves(const TopoDS_Edge& Efrom, const TopoDS_Edge& Eto, const TopoDS_S Standard_Real up = S->UPeriod(); constexpr Standard_Real tolu = Precision::PConfusion(); // Epsilon(up); Standard_Integer nbtra = 0; - Standard_Real theUmin = Min(pf.X(), pl.X()); - Standard_Real theUmax = Max(pf.X(), pl.X()); + Standard_Real theUmin = std::min(pf.X(), pl.X()); + Standard_Real theUmax = std::max(pf.X(), pl.X()); if (theUmin < Umin - tolu) { @@ -1009,8 +1009,8 @@ void PutPCurves(const TopoDS_Edge& Efrom, const TopoDS_Edge& Eto, const TopoDS_S Standard_Real vp = S->VPeriod(); constexpr Standard_Real tolv = Precision::PConfusion(); // Epsilon(vp); Standard_Integer nbtra = 0; - Standard_Real theVmin = Min(pf.Y(), pl.Y()); - Standard_Real theVmax = Max(pf.Y(), pl.Y()); + Standard_Real theVmin = std::min(pf.Y(), pl.Y()); + Standard_Real theVmax = std::max(pf.Y(), pl.Y()); if (theVmin < Vmin - tolv) { @@ -1101,7 +1101,7 @@ void PutPCurves(const TopoDS_Edge& Efrom, const TopoDS_Edge& Eto, const TopoDS_S gp_Pnt2d ptf(c2dtf->Value(f)); // sur courbe frw gp_Pnt2d ptr(c2dtr->Value(f)); // sur courbe rev - Standard_Boolean isoU = (Abs(ptf.Y() - ptr.Y()) < Epsilon(ptf.X())); // meme V + Standard_Boolean isoU = (std::abs(ptf.Y() - ptr.Y()) < Epsilon(ptf.X())); // meme V // Efrom et Eto dans le meme sens??? @@ -1160,11 +1160,11 @@ void PutPCurves(const TopoDS_Edge& Efrom, const TopoDS_Edge& Eto, const TopoDS_S // Compute the tol2d BRepTools::UVBounds(Fac, Umin, Umax, Vmin, Vmax); - Standard_Real tol3d = Max(BRep_Tool::Tolerance(Efrom), BRep_Tool::Tolerance(Fac)); + Standard_Real tol3d = std::max(BRep_Tool::Tolerance(Efrom), BRep_Tool::Tolerance(Fac)); GeomAdaptor_Surface Gas(S, Umin, Umax, Vmin, Vmax); Standard_Real TolU = Gas.UResolution(tol3d); Standard_Real TolV = Gas.VResolution(tol3d); - Standard_Real tol2d = Max(TolU, TolV); + Standard_Real tol2d = std::max(TolU, TolV); Handle(Geom2d_Curve) C2d = GeomProjLib::Curve2d(C, S, Umin, Umax, Vmin, Vmax, tol2d); c2dff = C2d; @@ -1188,12 +1188,12 @@ void PutPCurves(const TopoDS_Edge& Efrom, const TopoDS_Edge& Eto, const TopoDS_S { if (SameOri) { - if (Abs(ptf.X() - p2f.X()) > Epsilon(ptf.X())) + if (std::abs(ptf.X() - p2f.X()) > Epsilon(ptf.X())) { c2dff = Handle(Geom2d_Curve)::DownCast(c2dff->Translated(gp_Vec2d(ptf.X() - p2f.X(), 0.))); } - if (Abs(ptr.X() - p2r.X()) > Epsilon(ptr.X())) + if (std::abs(ptr.X() - p2r.X()) > Epsilon(ptr.X())) { c2dfr = Handle(Geom2d_Curve)::DownCast(c2dfr->Translated(gp_Vec2d(ptr.X() - p2r.X(), 0.))); @@ -1201,13 +1201,13 @@ void PutPCurves(const TopoDS_Edge& Efrom, const TopoDS_Edge& Eto, const TopoDS_S } else { - if (Abs(ptr.X() - p2f.X()) > Epsilon(ptr.X())) + if (std::abs(ptr.X() - p2f.X()) > Epsilon(ptr.X())) { c2dff = Handle(Geom2d_Curve)::DownCast(c2dff->Translated(gp_Vec2d(ptr.X() - p2f.X(), 0.))); } - if (Abs(ptf.X() - p2r.X()) > Epsilon(ptf.X())) + if (std::abs(ptf.X() - p2r.X()) > Epsilon(ptf.X())) { c2dfr = Handle(Geom2d_Curve)::DownCast(c2dfr->Translated(gp_Vec2d(ptf.X() - p2r.X(), 0.))); @@ -1221,12 +1221,12 @@ void PutPCurves(const TopoDS_Edge& Efrom, const TopoDS_Edge& Eto, const TopoDS_S { // !isoU soit isoV if (SameOri) { - if (Abs(ptf.Y() - p2f.Y()) > Epsilon(ptf.Y())) + if (std::abs(ptf.Y() - p2f.Y()) > Epsilon(ptf.Y())) { c2dff = Handle(Geom2d_Curve)::DownCast(c2dff->Translated(gp_Vec2d(0., ptf.Y() - p2f.Y()))); } - if (Abs(ptr.Y() - p2r.Y()) > Epsilon(ptr.Y())) + if (std::abs(ptr.Y() - p2r.Y()) > Epsilon(ptr.Y())) { c2dfr = Handle(Geom2d_Curve)::DownCast(c2dfr->Translated(gp_Vec2d(0., ptr.Y() - p2r.Y()))); @@ -1234,12 +1234,12 @@ void PutPCurves(const TopoDS_Edge& Efrom, const TopoDS_Edge& Eto, const TopoDS_S } else { - if (Abs(ptr.Y() - p2f.Y()) > Epsilon(ptr.Y())) + if (std::abs(ptr.Y() - p2f.Y()) > Epsilon(ptr.Y())) { c2dff = Handle(Geom2d_Curve)::DownCast(c2dff->Translated(gp_Vec2d(0., ptr.Y() - p2f.Y()))); } - if (Abs(ptf.Y() - p2r.Y()) > Epsilon(ptf.Y())) + if (std::abs(ptf.Y() - p2r.Y()) > Epsilon(ptf.Y())) { c2dfr = Handle(Geom2d_Curve)::DownCast(c2dfr->Translated(gp_Vec2d(0., ptf.Y() - p2r.Y()))); @@ -1288,8 +1288,8 @@ void FindInternalIntersections(const TopoDS_Edge& theEdg const Handle(Geom_Curve)& theCurve = BRep_Tool::Curve(theEdge, thePar[0], thePar[1]); GeomAdaptor_Curve theGAcurve(theCurve, thePar[0], thePar[1]); Standard_Real aTolV2d[2] = {theGAcurve.Resolution(aTolV[0]), theGAcurve.Resolution(aTolV[1])}; - aTolV2d[0] = Max(aTolV2d[0], Precision::PConfusion()); - aTolV2d[1] = Max(aTolV2d[1], Precision::PConfusion()); + aTolV2d[0] = std::max(aTolV2d[0], Precision::PConfusion()); + aTolV2d[1] = std::max(aTolV2d[1], Precision::PConfusion()); Standard_Real aDistMax = Precision::Confusion() * Precision::Confusion(); TopExp_Explorer Explo(theFace, TopAbs_EDGE); for (; Explo.More(); Explo.Next()) @@ -1345,7 +1345,7 @@ void FindInternalIntersections(const TopoDS_Edge& theEdg Standard_Real anIntPar = aPOnC2.Parameter(); for (j = 0; j < 2; j++) // try to find intersection on an extremity of "theEdge" { - if (Abs(theIntPar - thePar[j]) <= aTolV2d[j]) + if (std::abs(theIntPar - thePar[j]) <= aTolV2d[j]) break; } // intersection found in the middle of the edge diff --git a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_AppFuncRoot.cxx b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_AppFuncRoot.cxx index 4f272c63bd..b53eee3149 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_AppFuncRoot.cxx +++ b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_AppFuncRoot.cxx @@ -61,12 +61,12 @@ BRepBlend_AppFuncRoot::BRepBlend_AppFuncRoot(Handle(BRepBlend_Line)& Line, for (ii = 1; ii <= myLine->NbPoints(); ii++) { P = myLine->Point(ii); - Xmax = Max(Max(P.PointOnS1().X(), P.PointOnS2().X()), Xmax); - Xmin = Min(Min(P.PointOnS1().X(), P.PointOnS2().X()), Xmin); - Ymax = Max(Max(P.PointOnS1().Y(), P.PointOnS2().Y()), Ymax); - Ymin = Min(Min(P.PointOnS1().Y(), P.PointOnS2().Y()), Ymin); - Zmax = Max(Max(P.PointOnS1().Z(), P.PointOnS2().Z()), Zmax); - Zmin = Min(Min(P.PointOnS1().Z(), P.PointOnS2().Z()), Zmin); + Xmax = std::max(std::max(P.PointOnS1().X(), P.PointOnS2().X()), Xmax); + Xmin = std::min(std::min(P.PointOnS1().X(), P.PointOnS2().X()), Xmin); + Ymax = std::max(std::max(P.PointOnS1().Y(), P.PointOnS2().Y()), Ymax); + Ymin = std::min(std::min(P.PointOnS1().Y(), P.PointOnS2().Y()), Ymin); + Zmax = std::max(std::max(P.PointOnS1().Z(), P.PointOnS2().Z()), Zmax); + Zmin = std::min(std::min(P.PointOnS1().Z(), P.PointOnS2().Z()), Zmin); myBary.SetCoord((Xmax + Xmin) / 2, (Ymax + Ymin) / 2, (Zmax + Zmin) / 2); } diff --git a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_AppSurface.cxx b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_AppSurface.cxx index 0416571d12..304ca0590a 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_AppSurface.cxx +++ b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_AppSurface.cxx @@ -128,7 +128,7 @@ void BRepBlend_AppSurface::TolReached(Standard_Real& Tol3d, Standard_Real& Tol2d Tol2d = 0; for (Standard_Integer ii = 1; ii <= approx.NbCurves2d(); ii++) { - Tol2d = Max(Tol2d, approx.Max2dError(ii)); + Tol2d = std::max(Tol2d, approx.Max2dError(ii)); } } diff --git a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_BlendTool.hxx b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_BlendTool.hxx index c56c30b21c..870092c273 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_BlendTool.hxx +++ b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_BlendTool.hxx @@ -54,7 +54,7 @@ public: //! Returns the parametric tolerance on the arc A //! used to consider that the vertex and another point meet, - //! i-e if Abs(Parameter(Vertex)-Parameter(OtherPnt))<= + //! i-e if std::abs(Parameter(Vertex)-Parameter(OtherPnt))<= //! Tolerance, the points are "merged". static Standard_Real Tolerance(const Handle(Adaptor3d_HVertex)& V, const Handle(Adaptor2d_Curve2d)& A); diff --git a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_CSWalking.cxx b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_CSWalking.cxx index d02162dd76..ac0ff40fc5 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_CSWalking.cxx +++ b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_CSWalking.cxx @@ -120,10 +120,10 @@ void BRepBlend_CSWalking::Perform(Blend_CSFunction& Func, line = new BRepBlend_Line(); Standard_Integer Nbvar = Func.NbVariables(); tolpoint3d = Tol3d; - tolgui = Abs(TolGuide); - fleche = Abs(Fleche); + tolgui = std::abs(TolGuide); + fleche = std::abs(Fleche); rebrou = Standard_False; - pasmax = Abs(MaxStep); + pasmax = std::abs(MaxStep); math_Vector sol(1, Nbvar); firstsol = new TColStd_HArray1OfReal(1, Nbvar); @@ -162,14 +162,14 @@ void BRepBlend_CSWalking::Perform(Blend_CSFunction& Func, rsnld.Root(sol); // situ1 = Adaptor3d_TopolTool::Classify(surf1,gp_Pnt2d(sol(1),sol(2)), - // Max(tolerance(1),tolerance(2))); + // std::max(tolerance(1),tolerance(2))); // situ2 = Adaptor3d_TopolTool::Classify(surf2,gp_Pnt2d(sol(3),sol(4)), - // Max(tolerance(3),tolerance(4))); + // std::max(tolerance(3),tolerance(4))); /* situ = domain->Classify(gp_Pnt2d(sol(1),sol(2)), - Min(tolerance(1),tolerance(2))); + std::min(tolerance(1),tolerance(2))); */ - situ = domain->Classify(Func.Pnt2d(), Min(tolerance(1), tolerance(2))); + situ = domain->Classify(Func.Pnt2d(), std::min(tolerance(1), tolerance(2))); if (situ != TopAbs_IN) { @@ -343,7 +343,7 @@ Blend_Status BRepBlend_CSWalking::TestArret(Blend_CSFunction& Function, // Function.Tangent(sol(1),sol(2),Tgp1,Nor1); Function.Tangent(pt2d.X(), pt2d.Y(), Tgp1, Nor1); Standard_Real testra = Tgp1.Dot(Nor1.Crossed(V1)); - if (Abs(testra) > Precision::Confusion()) + if (std::abs(testra) > Precision::Confusion()) { if (testra < 0.) { @@ -465,8 +465,8 @@ Blend_Status BRepBlend_CSWalking::CheckDeflectionOnSurf(const gp_Pnt& Psurf, Du = Ponsurf.X() - paramu; Dv = Ponsurf.Y() - paramv; Duv = Du * Du + Dv * Dv; - if ((Abs(Du) < tolu && Abs(Dv) < tolv) || // JAG MODIF 25.04.94 - (Abs(previousd2d.X()) < tolu && Abs(previousd2d.Y()) < tolv)) + if ((std::abs(Du) < tolu && std::abs(Dv) < tolv) || // JAG MODIF 25.04.94 + (std::abs(previousd2d.X()) < tolu && std::abs(previousd2d.Y()) < tolv)) { // il faudra peut etre forcer meme point JAG MODIF 25.04.94 return Blend_SamePoints; // point confondu 2d @@ -493,19 +493,6 @@ Blend_Status BRepBlend_CSWalking::CheckDeflectionOnSurf(const gp_Pnt& Psurf, return Blend_StepTooLarge; } - // Estimation de la fleche courante - /* -Norme = Sqrt(Norme)/3.; -Poles(1) = prevP; -Poles(4) = Psurf; -Poles(2) = Poles(1).XYZ() + sens*Norme* prevTg.Normalized().XYZ(); -Poles(3) = Poles(4).XYZ() - sens*Norme* Tgsurf.Normalized().XYZ(); -BzCLib::PntPole(0.5,Poles,POnCurv); -Milieu = (Poles(1).XYZ() + Poles(4).XYZ())*0.5; -FlecheCourante = Milieu.Distance(POnCurv); - -if (FlecheCourante <= 0.5*fleche) { -*/ FlecheCourante = (prevTg.Normalized().XYZ() - Tgsurf.Normalized().XYZ()).SquareModulus() * Norme / 64.; @@ -569,7 +556,7 @@ Blend_Status BRepBlend_CSWalking::CheckDeflectionOnCurv(const gp_Pnt& Pcur paramu = previousP.ParameterOnC(); Du = Param - paramu; - if (Abs(Du) < tolu) + if (std::abs(Du) < tolu) { // il faudra peut etre forcer meme point JAG MODIF 25.04.94 return Blend_SamePoints; // point confondu 2d @@ -591,18 +578,6 @@ Blend_Status BRepBlend_CSWalking::CheckDeflectionOnCurv(const gp_Pnt& Pcur if (prevNorme > toler3d * toler3d) { - // Estimation de la fleche courante - /* -Norme = Sqrt(Norme)/3.; -Poles(1) = prevP; -Poles(4) = Pcurv; -Poles(2) = Poles(1).XYZ() + sens*Norme* prevTg.Normalized().XYZ(); -Poles(3) = Poles(4).XYZ() - sens*Norme* Tgcurv.Normalized().XYZ(); -BzCLib::PntPole(0.5,Poles,POnCurv); -Milieu = (Poles(1).XYZ() + Poles(4).XYZ())*0.5; -FlecheCourante = Milieu.Distance(POnCurv); -if (FlecheCourante <= 0.5*fleche) { -*/ FlecheCourante = (prevTg.Normalized().XYZ() - Tgcurv.Normalized().XYZ()).SquareModulus() * Norme / 64.; @@ -725,22 +700,22 @@ Standard_Boolean BRepBlend_CSWalking::Recadre(Blend_FuncInv& FuncInv, // if (OnFirst) { // situ = Adaptor3d_TopolTool::Classify(surf2,gp_Pnt2d(solrst(3),solrst(4)), -// Max(toler(3),toler(4))); +// std::max(toler(3),toler(4))); // // } // else { // situ = Adaptor3d_TopolTool::Classify(surf1,gp_Pnt2d(solrst(3),solrst(4)), -// Max(toler(3),toler(4))); +// std::max(toler(3),toler(4))); // } if (OnFirst) { situ = domain2->Classify(gp_Pnt2d(solrst(3),solrst(4)), - Min(toler(3),toler(4))); + std::min(toler(3),toler(4))); } else { situ = domain1->Classify(gp_Pnt2d(solrst(3),solrst(4)), - Min(toler(3),toler(4))); + std::min(toler(3),toler(4))); } @@ -753,7 +728,7 @@ Standard_Boolean BRepBlend_CSWalking::Recadre(Blend_FuncInv& FuncInv, IsVtx = !Iter->MoreVertex(); while (!IsVtx) { Vtx = Iter->Vertex(); - if (Abs(BRepBlend_BlendTool::Parameter(Vtx,thearc)-solrst(1)) <= + if (std::abs(BRepBlend_BlendTool::Parameter(Vtx,thearc)-solrst(1)) <= BRepBlend_BlendTool::Tolerance(Vtx,thearc)) { IsVtx = Standard_True; } @@ -910,14 +885,14 @@ void BRepBlend_CSWalking::InternalPerform(Blend_CSFunction& Func, rsnld.Root(sol); // situ1 = Adaptor3d_TopolTool::Classify(surf1,gp_Pnt2d(sol(1),sol(2)), - // Max(tolerance(1),tolerance(2))); + // std::max(tolerance(1),tolerance(2))); // situ2 = Adaptor3d_TopolTool::Classify(surf2,gp_Pnt2d(sol(3),sol(4)), - // Max(tolerance(3),tolerance(4))); + // std::max(tolerance(3),tolerance(4))); /* situ = domain->Classify(gp_Pnt2d(sol(1),sol(2)), - Min(tolerance(1),tolerance(2))); + std::min(tolerance(1),tolerance(2))); */ - situ = domain->Classify(Func.Pnt2d(), Min(tolerance(1), tolerance(2))); + situ = domain->Classify(Func.Pnt2d(), std::min(tolerance(1), tolerance(2))); w = Bound; recad = Standard_False; @@ -1020,7 +995,7 @@ void BRepBlend_CSWalking::InternalPerform(Blend_CSFunction& Func, case Blend_StepTooLarge: { stepw = stepw / 2.; - if (Abs(stepw) < tolgui) + if (std::abs(stepw) < tolgui) { /* Exts.SetValue(previousP.PointOnS(),sol(1),sol(2),tolesp); @@ -1067,7 +1042,7 @@ void BRepBlend_CSWalking::InternalPerform(Blend_CSFunction& Func, parinit = sol; parprec = param; - stepw = Min(1.5 * stepw, pasmax); + stepw = std::min(1.5 * stepw, pasmax); if (param == Bound) { Arrive = Standard_True; diff --git a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_CurvPointRadInv.cxx b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_CurvPointRadInv.cxx index 770a6da4ac..d8a1d47c98 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_CurvPointRadInv.cxx +++ b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_CurvPointRadInv.cxx @@ -129,7 +129,7 @@ Standard_Boolean BRepBlend_CurvPointRadInv::IsSolution(const math_Vector& Sol, { math_Vector valsol(1, 2); Value(Sol, valsol); - if (Abs(valsol(1)) <= Tol && Abs(valsol(2)) <= Tol) + if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol) { return Standard_True; } diff --git a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_RstRstConstRad.cxx b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_RstRstConstRad.cxx index 25d1f9f75b..4632024095 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_RstRstConstRad.cxx +++ b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_RstRstConstRad.cxx @@ -203,7 +203,7 @@ Standard_Boolean BRepBlend_RstRstConstRad::IsSolution(const math_Vector& Sol, Values(Sol, valsol, gradsol); - if (Abs(valsol(1)) <= Tol && Abs(valsol(2)) <= Tol) + if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol) { // Calculation of tangents @@ -280,7 +280,7 @@ Standard_Boolean BRepBlend_RstRstConstRad::IsSolution(const math_Vector& Sol, Sina = -Sina; // nplan is changed into -nplan } - Angle = ACos(Cosa); + Angle = std::acos(Cosa); if (Sina < 0.) { Angle = 2. * M_PI - Angle; @@ -294,7 +294,7 @@ Standard_Boolean BRepBlend_RstRstConstRad::IsSolution(const math_Vector& Sol, { minang = Angle; } - distmin = Min(distmin, ptrst1.Distance(ptrst2)); + distmin = std::min(distmin, ptrst1.Distance(ptrst2)); return Standard_True; } @@ -485,7 +485,7 @@ Blend_DecrochStatus BRepBlend_RstRstConstRad::Decroch(const math_Vector& Sol, void BRepBlend_RstRstConstRad::Set(const Standard_Real Radius, const Standard_Integer Choix) { choix = Choix; - ray = Abs(Radius); + ray = std::abs(Radius); } //================================================================================================= @@ -557,7 +557,7 @@ void BRepBlend_RstRstConstRad::Section(const Standard_Real Param, CenterCircleRst1Rst2(ptrst1, ptrst2, np, Center, NotUsed); - C.SetRadius(Abs(ray)); + C.SetRadius(std::abs(ray)); ns = gp_Vec(Center, ptrst1).Normalized(); if (choix % 2 != 0) @@ -591,7 +591,7 @@ Standard_Boolean BRepBlend_RstRstConstRad::IsRational() const Standard_Real BRepBlend_RstRstConstRad::GetSectionSize() const { - return maxang * Abs(ray); + return maxang * std::abs(ray); } //================================================================================================= @@ -640,11 +640,11 @@ void BRepBlend_RstRstConstRad::GetTolerance(const Standard_Real BoundTol, { Standard_Integer low = Tol3d.Lower(), up = Tol3d.Upper(); Standard_Real Tol; - Tol = GeomFill::GetTolerance(myTConv, minang, Abs(ray), AngleTol, SurfTol); + Tol = GeomFill::GetTolerance(myTConv, minang, std::abs(ray), AngleTol, SurfTol); Tol1d.Init(SurfTol); Tol3d.Init(SurfTol); - Tol3d(low + 1) = Tol3d(up - 1) = Min(Tol, SurfTol); - Tol3d(low) = Tol3d(up) = Min(Tol, BoundTol); + Tol3d(low + 1) = Tol3d(up - 1) = std::min(Tol, SurfTol); + Tol3d(low) = Tol3d(up) = std::min(Tol, BoundTol); } //================================================================================================= @@ -687,7 +687,7 @@ void BRepBlend_RstRstConstRad::Section(const Blend_Point& P, ptrst1 = cons1.Value(u); ptrst2 = cons2.Value(v); - distmin = Min(distmin, ptrst1.Distance(ptrst2)); + distmin = std::min(distmin, ptrst1.Distance(ptrst2)); Poles2d(Poles2d.Lower()).SetCoord(pt2d1.X(), pt2d1.Y()); Poles2d(Poles2d.Upper()).SetCoord(pt2d2.X(), pt2d2.Y()); @@ -714,7 +714,16 @@ void BRepBlend_RstRstConstRad::Section(const Blend_Point& P, nplan.Reverse(); } - GeomFill::GetCircle(myTConv, ns, ns2, nplan, ptrst1, ptrst2, Abs(ray), Center, Poles, Weights); + GeomFill::GetCircle(myTConv, + ns, + ns2, + nplan, + ptrst1, + ptrst2, + std::abs(ray), + Center, + Poles, + Weights); } //================================================================================================= @@ -907,7 +916,7 @@ Standard_Boolean BRepBlend_RstRstConstRad::Section(const Blend_Point& P, ptrst2, tgrst1, tgrst2, - Abs(ray), + std::abs(ray), 0, Center, tgct, @@ -918,7 +927,16 @@ Standard_Boolean BRepBlend_RstRstConstRad::Section(const Blend_Point& P, } else { - GeomFill::GetCircle(myTConv, n1, n2, nplan, ptrst1, ptrst2, Abs(ray), Center, Poles, Weights); + GeomFill::GetCircle(myTConv, + n1, + n2, + nplan, + ptrst1, + ptrst2, + std::abs(ray), + Center, + Poles, + Weights); return Standard_False; } } diff --git a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_RstRstEvolRad.cxx b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_RstRstEvolRad.cxx index 719e1617c9..74d0621d54 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_RstRstEvolRad.cxx +++ b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_RstRstEvolRad.cxx @@ -74,7 +74,7 @@ static void FusionneIntervalles(const TColStd_Array1OfReal& I1, { v1 = I1(ind1); v2 = I2(ind2); - if (Abs(v1 - v2) <= Epspar) + if (std::abs(v1 - v2) <= Epspar) { // elements of I1 and I2 fit here Seq.Append((v1 + v2) / 2); @@ -271,7 +271,7 @@ Standard_Boolean BRepBlend_RstRstEvolRad::IsSolution(const math_Vector& Sol, Values(Sol, valsol, gradsol); - if (Abs(valsol(1)) <= Tol && Abs(valsol(2)) <= Tol) + if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol) { // Calculation of tangents @@ -348,7 +348,7 @@ Standard_Boolean BRepBlend_RstRstEvolRad::IsSolution(const math_Vector& Sol, Sina = -Sina; // nplan is changed into -nplan } - Angle = ACos(Cosa); + Angle = std::acos(Cosa); if (Sina < 0.) { Angle = 2. * M_PI - Angle; @@ -362,7 +362,7 @@ Standard_Boolean BRepBlend_RstRstEvolRad::IsSolution(const math_Vector& Sol, { minang = Angle; } - distmin = Min(distmin, ptrst1.Distance(ptrst2)); + distmin = std::min(distmin, ptrst1.Distance(ptrst2)); return Standard_True; } @@ -625,7 +625,7 @@ void BRepBlend_RstRstEvolRad::Section(const Standard_Real Param, CenterCircleRst1Rst2(ptrst1, ptrst2, np, Center, NotUsed); - C.SetRadius(Abs(ray)); + C.SetRadius(std::abs(ray)); ns = gp_Vec(Center, ptrst1).Normalized(); if (choix % 2 != 0) @@ -659,7 +659,7 @@ Standard_Boolean BRepBlend_RstRstEvolRad::IsRational() const Standard_Real BRepBlend_RstRstEvolRad::GetSectionSize() const { - return maxang * Abs(ray); + return maxang * std::abs(ray); } //================================================================================================= @@ -745,11 +745,11 @@ void BRepBlend_RstRstEvolRad::GetTolerance(const Standard_Real BoundTol, { Standard_Integer low = Tol3d.Lower(), up = Tol3d.Upper(); Standard_Real Tol; - Tol = GeomFill::GetTolerance(myTConv, minang, Abs(ray), AngleTol, SurfTol); + Tol = GeomFill::GetTolerance(myTConv, minang, std::abs(ray), AngleTol, SurfTol); Tol1d.Init(SurfTol); Tol3d.Init(SurfTol); - Tol3d(low + 1) = Tol3d(up - 1) = Min(Tol, SurfTol); - Tol3d(low) = Tol3d(up) = Min(Tol, BoundTol); + Tol3d(low + 1) = Tol3d(up - 1) = std::min(Tol, SurfTol); + Tol3d(low) = Tol3d(up) = std::min(Tol, BoundTol); } //================================================================================================= @@ -793,7 +793,7 @@ void BRepBlend_RstRstEvolRad::Section(const Blend_Point& P, ptrst1 = cons1.Value(u); ptrst2 = cons2.Value(v); - distmin = Min(distmin, ptrst1.Distance(ptrst2)); + distmin = std::min(distmin, ptrst1.Distance(ptrst2)); Poles2d(Poles2d.Lower()).SetCoord(pt2d1.X(), pt2d1.Y()); Poles2d(Poles2d.Upper()).SetCoord(pt2d2.X(), pt2d2.Y()); @@ -820,7 +820,16 @@ void BRepBlend_RstRstEvolRad::Section(const Blend_Point& P, nplan.Reverse(); } - GeomFill::GetCircle(myTConv, n1, n2, nplan, ptrst1, ptrst2, Abs(ray), Center, Poles, Weights); + GeomFill::GetCircle(myTConv, + n1, + n2, + nplan, + ptrst1, + ptrst2, + std::abs(ray), + Center, + Poles, + Weights); } //================================================================================================= @@ -1018,7 +1027,7 @@ Standard_Boolean BRepBlend_RstRstEvolRad::Section(const Blend_Point& P, ptrst2, tgrst1, tgrst2, - Abs(ray), + std::abs(ray), dray, Center, tgct, @@ -1029,7 +1038,16 @@ Standard_Boolean BRepBlend_RstRstEvolRad::Section(const Blend_Point& P, } else { - GeomFill::GetCircle(myTConv, n1, n2, nplan, ptrst1, ptrst2, Abs(ray), Center, Poles, Weights); + GeomFill::GetCircle(myTConv, + n1, + n2, + nplan, + ptrst1, + ptrst2, + std::abs(ray), + Center, + Poles, + Weights); return Standard_False; } } diff --git a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_RstRstLineBuilder.cxx b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_RstRstLineBuilder.cxx index 44182a2982..63ad45b22f 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_RstRstLineBuilder.cxx +++ b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_RstRstLineBuilder.cxx @@ -210,10 +210,10 @@ void BRepBlend_RstRstLineBuilder::Perform(Blend_RstRstFunction& Func, comptra = Standard_False; line = new BRepBlend_Line(); tolpoint3d = Tol3d; - tolgui = Abs(TolGuide); - fleche = Abs(Fleche); + tolgui = std::abs(TolGuide); + fleche = std::abs(Fleche); rebrou = Standard_False; - pasmax = Abs(MaxStep); + pasmax = std::abs(MaxStep); if (Pmax - Pdep >= 0.) { @@ -319,7 +319,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::PerformFirstSection(Blend_RstRstFu comptra = Standard_False; line = new BRepBlend_Line(); tolpoint3d = Tol3d; - tolgui = Abs(TolGuide); + tolgui = std::abs(TolGuide); rebrou = Standard_False; if (Pmax - Pdep >= 0.) @@ -448,7 +448,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::PerformFirstSection(Blend_RstRstFu // it is checked on which curve the contact is lost earlier if (recadrst1 && recadrst2) { - if (Abs(wrst1 - wrst2) < tolgui) + if (std::abs(wrst1 - wrst2) < tolgui) { State = Blend_OnRst12; param = 0.5 * (wrst1 + wrst2); @@ -494,7 +494,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::PerformFirstSection(Blend_RstRstFu // it is checked on which curves one leaves first else if (recadp1 && recadp2) { - if (Abs(wrst1 - wrst2) < tolgui) + if (std::abs(wrst1 - wrst2) < tolgui) { State = Blend_OnRst12; param = 0.5 * (wrst1 + wrst2); @@ -603,7 +603,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func, { stepw = (line->Point(nbp).Parameter() - line->Point(nbp - 1).Parameter()); } - stepw = Max(stepw, 100. * tolgui); + stepw = std::max(stepw, 100. * tolgui); } Standard_Real parprec = param; if (sens * (parprec - Bound) >= -tolgui) @@ -821,7 +821,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func, // it is checked on which curve the contact is lost earlier if (recadrst1 && recadrst2) { - if (Abs(wrst1 - wrst2) < tolgui) + if (std::abs(wrst1 - wrst2) < tolgui) { State = Blend_OnRst12; decroch = Blend_DecrochBoth; @@ -872,7 +872,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func, // it is checked on which curve the contact is lost earlier else if (recadp1 && recadp2) { - if (Abs(wrst1 - wrst2) < tolgui) + if (std::abs(wrst1 - wrst2) < tolgui) { State = Blend_OnRst12; param = 0.5 * (wrst1 + wrst2); @@ -976,7 +976,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func, case Blend_StepTooLarge: { stepw = stepw / 2.; - if (Abs(stepw) < tolgui) + if (std::abs(stepw) < tolgui) { Extrst1.SetValue(previousP.PointOnC1(), previousP.ParameterOnC1(), @@ -1021,7 +1021,7 @@ void BRepBlend_RstRstLineBuilder::InternalPerform(Blend_RstRstFunction& Func, parinit = sol; parprec = param; - stepw = Min(1.5 * stepw, pasmax); + stepw = std::min(1.5 * stepw, pasmax); if (param == Bound) { Arrive = Standard_True; @@ -1188,7 +1188,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre1(Blend_RstRstFunction& while (!IsVtx) { Vtx = domain1->Vertex(); - if (Abs(BRepBlend_BlendTool::Parameter(Vtx, rst1) - Solinv(3)) + if (std::abs(BRepBlend_BlendTool::Parameter(Vtx, rst1) - Solinv(3)) <= BRepBlend_BlendTool::Tolerance(Vtx, rst1)) { IsVtx = Standard_True; @@ -1268,7 +1268,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre2(Blend_RstRstFunction& while (!IsVtx) { Vtx = domain2->Vertex(); - if (Abs(BRepBlend_BlendTool::Parameter(Vtx, rst2) - Solinv(3)) + if (std::abs(BRepBlend_BlendTool::Parameter(Vtx, rst2) - Solinv(3)) <= BRepBlend_BlendTool::Tolerance(Vtx, rst2)) { IsVtx = Standard_True; @@ -1360,7 +1360,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre1(Blend_CurvPointFuncInv& while (!IsVtx) { Vtx = domain1->Vertex(); - if (Abs(BRepBlend_BlendTool::Parameter(Vtx, rst1) - upoint) + if (std::abs(BRepBlend_BlendTool::Parameter(Vtx, rst1) - upoint) <= BRepBlend_BlendTool::Tolerance(Vtx, rst1)) { IsVtx = Standard_True; @@ -1434,7 +1434,7 @@ Standard_Boolean BRepBlend_RstRstLineBuilder::Recadre2(Blend_CurvPointFuncInv& while (!IsVtx) { Vtx = domain2->Vertex(); - if (Abs(BRepBlend_BlendTool::Parameter(Vtx, rst2) - vpoint) + if (std::abs(BRepBlend_BlendTool::Parameter(Vtx, rst2) - vpoint) <= BRepBlend_BlendTool::Tolerance(Vtx, rst2)) { IsVtx = Standard_True; @@ -1843,7 +1843,7 @@ Blend_Status BRepBlend_RstRstLineBuilder::TestArret(Blend_RstRstFunction& Func, Standard_Real testra = tg2drst1.Dot(tg2drstref); TopAbs_Orientation Or = domain1->Orientation(rst1); - if (Abs(testra) > tolpoint3d) + if (std::abs(testra) > tolpoint3d) { if (testra < 0.) { @@ -1858,7 +1858,7 @@ Blend_Status BRepBlend_RstRstLineBuilder::TestArret(Blend_RstRstFunction& Func, testra = tg2drst2.Dot(tg2drstref); Or = domain2->Orientation(rst2); - if (Abs(testra) > tolpoint3d) + if (std::abs(testra) > tolpoint3d) { if (testra < 0.) { diff --git a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfCurvConstRadInv.cxx b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfCurvConstRadInv.cxx index 304b0bac3a..623683c7fc 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfCurvConstRadInv.cxx +++ b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfCurvConstRadInv.cxx @@ -40,16 +40,16 @@ void BRepBlend_SurfCurvConstRadInv::Set(const Standard_Real R, const Standard_In { case 1: case 2: { - ray = -Abs(R); + ray = -std::abs(R); } break; case 3: case 4: { - ray = Abs(R); + ray = std::abs(R); } break; default: { - ray = -Abs(R); + ray = -std::abs(R); } } } @@ -260,7 +260,7 @@ void BRepBlend_SurfCurvConstRadInv::GetTolerance(math_Vector& Tolerance, Standard_Real ru, rv; ru = surf->UResolution(Tol); rv = surf->VResolution(Tol); - Tolerance(3) = rst->Resolution(Min(ru, rv)); + Tolerance(3) = rst->Resolution(std::min(ru, rv)); } //================================================================================================= @@ -282,7 +282,8 @@ Standard_Boolean BRepBlend_SurfCurvConstRadInv::IsSolution(const math_Vector& S { math_Vector valsol(1, 3); Value(Sol, valsol); - if (Abs(valsol(1)) <= Tol && Abs(valsol(2)) <= Tol && Abs(valsol(3)) <= 2 * Tol * Abs(ray)) + if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol + && std::abs(valsol(3)) <= 2 * Tol * std::abs(ray)) { return Standard_True; } diff --git a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfCurvEvolRadInv.cxx b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfCurvEvolRadInv.cxx index bcff5c0d77..53233daec9 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfCurvEvolRadInv.cxx +++ b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfCurvEvolRadInv.cxx @@ -280,7 +280,7 @@ void BRepBlend_SurfCurvEvolRadInv::GetTolerance(math_Vector& Tolerance, Standard_Real ru, rv; ru = surf->UResolution(Tol); rv = surf->VResolution(Tol); - Tolerance(3) = rst->Resolution(Min(ru, rv)); + Tolerance(3) = rst->Resolution(std::min(ru, rv)); } //================================================================================================= @@ -302,7 +302,8 @@ Standard_Boolean BRepBlend_SurfCurvEvolRadInv::IsSolution(const math_Vector& So { math_Vector valsol(1, 3); Value(Sol, valsol); - if (Abs(valsol(1)) <= Tol && Abs(valsol(2)) <= Tol && Abs(valsol(3)) <= 2 * Tol * Abs(ray)) + if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol + && std::abs(valsol(3)) <= 2 * Tol * std::abs(ray)) { return Standard_True; } diff --git a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfPointConstRadInv.cxx b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfPointConstRadInv.cxx index 3cea08f2d7..5f0777e819 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfPointConstRadInv.cxx +++ b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfPointConstRadInv.cxx @@ -38,16 +38,16 @@ void BRepBlend_SurfPointConstRadInv::Set(const Standard_Real R, const Standard_I { case 1: case 2: { - ray = -Abs(R); + ray = -std::abs(R); } break; case 3: case 4: { - ray = Abs(R); + ray = std::abs(R); } break; default: { - ray = -Abs(R); + ray = -std::abs(R); } } } @@ -274,7 +274,8 @@ Standard_Boolean BRepBlend_SurfPointConstRadInv::IsSolution(const math_Vector& { math_Vector valsol(1, 3); Value(Sol, valsol); - if (Abs(valsol(1)) <= Tol && Abs(valsol(2)) <= Tol && Abs(valsol(3)) <= 2 * Tol * Abs(ray)) + if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol + && std::abs(valsol(3)) <= 2 * Tol * std::abs(ray)) { return Standard_True; } diff --git a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfPointEvolRadInv.cxx b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfPointEvolRadInv.cxx index a2e3bd0e4c..b62a8405cf 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfPointEvolRadInv.cxx +++ b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfPointEvolRadInv.cxx @@ -267,7 +267,8 @@ Standard_Boolean BRepBlend_SurfPointEvolRadInv::IsSolution(const math_Vector& S { math_Vector valsol(1, 3); Value(Sol, valsol); - if (Abs(valsol(1)) <= Tol && Abs(valsol(2)) <= Tol && Abs(valsol(3)) <= 2 * Tol * Abs(ray)) + if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol + && std::abs(valsol(3)) <= 2 * Tol * std::abs(ray)) { return Standard_True; } diff --git a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfRstConstRad.cxx b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfRstConstRad.cxx index 8e7a1a713a..dd5796038a 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfRstConstRad.cxx +++ b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfRstConstRad.cxx @@ -327,7 +327,8 @@ Standard_Boolean BRepBlend_SurfRstConstRad::IsSolution(const math_Vector& Sol, Standard_Real Cosa, Sina, Angle; Values(Sol, valsol, gradsol); - if (Abs(valsol(1)) <= Tol && Abs(valsol(2)) <= Tol && Abs(valsol(3)) <= 2 * Tol * Abs(ray)) + if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol + && std::abs(valsol(3)) <= 2 * Tol * std::abs(ray)) { // Calculation of tangents @@ -405,7 +406,7 @@ Standard_Boolean BRepBlend_SurfRstConstRad::IsSolution(const math_Vector& Sol, Sina = -Sina; // nplan is changed to -nplan } - Angle = ACos(Cosa); + Angle = std::acos(Cosa); if (Sina < 0.) { Angle = 2. * M_PI - Angle; @@ -419,7 +420,7 @@ Standard_Boolean BRepBlend_SurfRstConstRad::IsSolution(const math_Vector& Sol, { minang = Angle; } - distmin = Min(distmin, pts.Distance(ptrst)); + distmin = std::min(distmin, pts.Distance(ptrst)); return Standard_True; } @@ -564,7 +565,7 @@ Standard_Boolean BRepBlend_SurfRstConstRad::Decroch(const math_Vector& Sol, Standard_Real dot, NT = NRstInPlane.Magnitude(); NT *= TgRst.Magnitude(); - if (Abs(NT) < 1.e-7) + if (std::abs(NT) < 1.e-7) { return Standard_False; // Singularity or Incoherence. } @@ -583,14 +584,14 @@ void BRepBlend_SurfRstConstRad::Set(const Standard_Real Radius, const Standard_I { case 1: case 2: - ray = -Abs(Radius); + ray = -std::abs(Radius); break; case 3: case 4: - ray = Abs(Radius); + ray = std::abs(Radius); break; default: - ray = -Abs(Radius); + ray = -std::abs(Radius); break; } } @@ -628,7 +629,7 @@ void BRepBlend_SurfRstConstRad::Section(const Standard_Real Param, norm = nplan.Crossed(ns).Magnitude(); ns.SetLinearForm(nplan.Dot(ns) / norm, nplan, -1. / norm, ns); Center.SetXYZ(pts.XYZ() + ray * ns.XYZ()); - C.SetRadius(Abs(ray)); + C.SetRadius(std::abs(ray)); if (ray > 0) { @@ -666,7 +667,7 @@ Standard_Boolean BRepBlend_SurfRstConstRad::IsRational() const Standard_Real BRepBlend_SurfRstConstRad::GetSectionSize() const { - return maxang * Abs(ray); + return maxang * std::abs(ray); } //================================================================================================= @@ -715,11 +716,11 @@ void BRepBlend_SurfRstConstRad::GetTolerance(const Standard_Real BoundTol, { Standard_Integer low = Tol3d.Lower(), up = Tol3d.Upper(); Standard_Real Tol; - Tol = GeomFill::GetTolerance(myTConv, minang, Abs(ray), AngleTol, SurfTol); + Tol = GeomFill::GetTolerance(myTConv, minang, std::abs(ray), AngleTol, SurfTol); Tol1d.Init(SurfTol); Tol3d.Init(SurfTol); - Tol3d(low + 1) = Tol3d(up - 1) = Min(Tol, SurfTol); - Tol3d(low) = Tol3d(up) = Min(Tol, BoundTol); + Tol3d(low + 1) = Tol3d(up - 1) = std::min(Tol, SurfTol); + Tol3d(low) = Tol3d(up) = std::min(Tol, BoundTol); } //================================================================================================= @@ -762,7 +763,7 @@ void BRepBlend_SurfRstConstRad::Section(const Blend_Point& P, surf->D1(u1, v1, pts, d1u1, d1v1); ptrst = cons.Value(w); - distmin = Min(distmin, pts.Distance(ptrst)); + distmin = std::min(distmin, pts.Distance(ptrst)); Poles2d(Poles2d.Lower()).SetCoord(u1, v1); Poles2d(Poles2d.Upper()).SetCoord(pt2d.X(), pt2d.Y()); @@ -792,7 +793,7 @@ void BRepBlend_SurfRstConstRad::Section(const Blend_Point& P, nplan.Reverse(); } - GeomFill::GetCircle(myTConv, ns, ns2, nplan, pts, ptrst, Abs(ray), Center, Poles, Weights); + GeomFill::GetCircle(myTConv, ns, ns2, nplan, pts, ptrst, std::abs(ray), Center, Poles, Weights); } //================================================================================================= @@ -994,7 +995,7 @@ Standard_Boolean BRepBlend_SurfRstConstRad::Section(const Blend_Point& P, ptrst, tgs, tgrst, - Abs(ray), + std::abs(ray), 0, Center, tgct, @@ -1005,7 +1006,7 @@ Standard_Boolean BRepBlend_SurfRstConstRad::Section(const Blend_Point& P, } else { - GeomFill::GetCircle(myTConv, ns, ns2, nplan, pts, ptrst, Abs(ray), Center, Poles, Weights); + GeomFill::GetCircle(myTConv, ns, ns2, nplan, pts, ptrst, std::abs(ray), Center, Poles, Weights); return Standard_False; } } diff --git a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfRstEvolRad.cxx b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfRstEvolRad.cxx index 5cfaf7533b..089c8e8ea6 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfRstEvolRad.cxx +++ b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfRstEvolRad.cxx @@ -71,7 +71,7 @@ static void FusionneIntervalles(const TColStd_Array1OfReal& I1, { v1 = I1(ind1); v2 = I2(ind2); - if (Abs(v1 - v2) <= Epspar) + if (std::abs(v1 - v2) <= Epspar) { // Here the elements of I1 and I2 fit. Seq.Append((v1 + v2) / 2); @@ -387,7 +387,8 @@ Standard_Boolean BRepBlend_SurfRstEvolRad::IsSolution(const math_Vector& Sol, Standard_Real Cosa, Sina, Angle; Values(Sol, valsol, gradsol); - if (Abs(valsol(1)) <= Tol && Abs(valsol(2)) <= Tol && Abs(valsol(3)) <= 2 * Tol * Abs(ray)) + if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol + && std::abs(valsol(3)) <= 2 * Tol * std::abs(ray)) { // Calculation of tangents @@ -470,7 +471,7 @@ Standard_Boolean BRepBlend_SurfRstEvolRad::IsSolution(const math_Vector& Sol, Sina = -Sina; // nplan is changed into -nplan } - Angle = ACos(Cosa); + Angle = std::acos(Cosa); if (Sina < 0.) { Angle = 2. * M_PI - Angle; @@ -484,7 +485,7 @@ Standard_Boolean BRepBlend_SurfRstEvolRad::IsSolution(const math_Vector& Sol, { minang = Angle; } - distmin = Min(distmin, pts.Distance(ptrst)); + distmin = std::min(distmin, pts.Distance(ptrst)); return Standard_True; } @@ -629,7 +630,7 @@ Standard_Boolean BRepBlend_SurfRstEvolRad::Decroch(const math_Vector& Sol, Standard_Real dot, NT = NRstInPlane.Magnitude(); NT *= TgRst.Magnitude(); - if (Abs(NT) < 1.e-7) + if (std::abs(NT) < 1.e-7) { return Standard_False; // Singularity or Incoherence. } @@ -694,7 +695,7 @@ void BRepBlend_SurfRstEvolRad::Section(const Standard_Real Param, norm = nplan.Crossed(ns).Magnitude(); ns.SetLinearForm(nplan.Dot(ns) / norm, nplan, -1. / norm, ns); Center.SetXYZ(pts.XYZ() + ray * ns.XYZ()); - C.SetRadius(Abs(ray)); + C.SetRadius(std::abs(ray)); if (ray > 0) { @@ -731,7 +732,7 @@ Standard_Boolean BRepBlend_SurfRstEvolRad::IsRational() const Standard_Real BRepBlend_SurfRstEvolRad::GetSectionSize() const { - return maxang * Abs(ray); + return maxang * std::abs(ray); } //================================================================================================= @@ -814,11 +815,11 @@ void BRepBlend_SurfRstEvolRad::GetTolerance(const Standard_Real BoundTol, { Standard_Integer low = Tol3d.Lower(), up = Tol3d.Upper(); Standard_Real Tol; - Tol = GeomFill::GetTolerance(myTConv, minang, Abs(ray), AngleTol, SurfTol); + Tol = GeomFill::GetTolerance(myTConv, minang, std::abs(ray), AngleTol, SurfTol); Tol1d.Init(SurfTol); Tol3d.Init(SurfTol); - Tol3d(low + 1) = Tol3d(up - 1) = Min(Tol, SurfTol); - Tol3d(low) = Tol3d(up) = Min(Tol, BoundTol); + Tol3d(low + 1) = Tol3d(up - 1) = std::min(Tol, SurfTol); + Tol3d(low) = Tol3d(up) = std::min(Tol, BoundTol); } //================================================================================================= @@ -1032,7 +1033,7 @@ Standard_Boolean BRepBlend_SurfRstEvolRad::Section(const Blend_Point& P, if (!istgt) { if (ray < 0.) - { // to avoid Abs(dray) some lines below + { // to avoid std::abs(dray) some lines below rayprim = -aDray; } else @@ -1049,7 +1050,7 @@ Standard_Boolean BRepBlend_SurfRstEvolRad::Section(const Blend_Point& P, ptrst, tgs, tgrst, - Abs(ray), + std::abs(ray), rayprim, Center, tgct, @@ -1060,7 +1061,7 @@ Standard_Boolean BRepBlend_SurfRstEvolRad::Section(const Blend_Point& P, } else { - GeomFill::GetCircle(myTConv, ns, ns2, nplan, pts, ptrst, Abs(ray), Center, Poles, Weigths); + GeomFill::GetCircle(myTConv, ns, ns2, nplan, pts, ptrst, std::abs(ray), Center, Poles, Weigths); return Standard_False; } } @@ -1110,7 +1111,7 @@ void BRepBlend_SurfRstEvolRad::Section(const Blend_Point& P, surf->D1(u1, v1, pts, d1u1, d1v1); ptrst = cons.Value(w); - distmin = Min(distmin, pts.Distance(ptrst)); + distmin = std::min(distmin, pts.Distance(ptrst)); Poles2d(Poles2d.Lower()).SetCoord(u1, v1); Poles2d(Poles2d.Upper()).SetCoord(pt2d.X(), pt2d.Y()); @@ -1140,7 +1141,7 @@ void BRepBlend_SurfRstEvolRad::Section(const Blend_Point& P, nplan.Reverse(); } - GeomFill::GetCircle(myTConv, ns, ns2, nplan, pts, ptrst, Abs(ray), Center, Poles, Weigths); + GeomFill::GetCircle(myTConv, ns, ns2, nplan, pts, ptrst, std::abs(ray), Center, Poles, Weigths); } void BRepBlend_SurfRstEvolRad::Resolution(const Standard_Integer IC2d, diff --git a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfRstLineBuilder.cxx b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfRstLineBuilder.cxx index dfce93b2c6..bfcde42e1c 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfRstLineBuilder.cxx +++ b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_SurfRstLineBuilder.cxx @@ -249,10 +249,10 @@ void BRepBlend_SurfRstLineBuilder::Perform(Blend_SurfRstFunction& Func, line = new BRepBlend_Line(); tolpoint3d = Tol3d; tolpoint2d = Tol2d; - tolgui = Abs(TolGuide); - fleche = Abs(Fleche); + tolgui = std::abs(TolGuide); + fleche = std::abs(Fleche); rebrou = Standard_False; - pasmax = Abs(MaxStep); + pasmax = std::abs(MaxStep); if (Pmax - Pdep >= 0.) { @@ -354,7 +354,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::PerformFirstSection(Blend_SurfRst line = new BRepBlend_Line(); tolpoint3d = Tol3d; tolpoint2d = Tol2d; - tolgui = Abs(TolGuide); + tolgui = std::abs(TolGuide); rebrou = Standard_False; if (Pmax - Pdep >= 0.) @@ -440,7 +440,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::PerformFirstSection(Blend_SurfRst } if (recads && recadrst) { - if (Abs(ws - wrst) < tolgui) + if (std::abs(ws - wrst) < tolgui) { State = Blend_OnRst12; param = 0.5 * (ws + wrst); @@ -550,7 +550,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func, { stepw = (line->Point(nbp).Parameter() - line->Point(nbp - 1).Parameter()); } - stepw = Max(stepw, 100. * tolgui); + stepw = std::max(stepw, 100. * tolgui); } Standard_Real parprec = param; if (sens * (parprec - Bound) >= -tolgui) @@ -729,7 +729,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func, } if (recads && recadrst) { - if (Abs(ws - wrst) < tolgui) + if (std::abs(ws - wrst) < tolgui) { State = Blend_OnRst12; param = 0.5 * (ws + wrst); @@ -837,7 +837,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func, case Blend_StepTooLarge: { stepw = stepw / 2.; - if (Abs(stepw) < tolgui) + if (std::abs(stepw) < tolgui) { previousP.ParametersOnS(U, V); Exts.SetValue(previousP.PointOnS(), U, V, previousP.Parameter(), tolpoint3d); @@ -880,7 +880,7 @@ void BRepBlend_SurfRstLineBuilder::InternalPerform(Blend_SurfRstFunction& Func, parinit = sol; parprec = param; - stepw = Min(1.5 * stepw, pasmax); + stepw = std::min(1.5 * stepw, pasmax); if (param == Bound) { Arrive = Standard_True; @@ -1114,7 +1114,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfCurvFuncInv& while (!IsVtx) { Vtx = domain1->Vertex(); - if (Abs(BRepBlend_BlendTool::Parameter(Vtx, Arc) - Solinv(3)) + if (std::abs(BRepBlend_BlendTool::Parameter(Vtx, Arc) - Solinv(3)) <= BRepBlend_BlendTool::Tolerance(Vtx, Arc)) { IsVtx = Standard_True; @@ -1175,7 +1175,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfRstFunction& while (!IsVtx) { Vtx = domain2->Vertex(); - if (Abs(BRepBlend_BlendTool::Parameter(Vtx, rst) - Solinv(1)) + if (std::abs(BRepBlend_BlendTool::Parameter(Vtx, rst) - Solinv(1)) <= BRepBlend_BlendTool::Tolerance(Vtx, rst)) { IsVtx = Standard_True; @@ -1265,7 +1265,7 @@ Standard_Boolean BRepBlend_SurfRstLineBuilder::Recadre(Blend_SurfPointFuncInv& while (!IsVtx) { Vtx = domain2->Vertex(); - if (Abs(BRepBlend_BlendTool::Parameter(Vtx, rst) - wpoint) + if (std::abs(BRepBlend_BlendTool::Parameter(Vtx, rst) - wpoint) <= BRepBlend_BlendTool::Tolerance(Vtx, rst)) { IsVtx = Standard_True; @@ -1658,7 +1658,7 @@ Blend_Status BRepBlend_SurfRstLineBuilder::TestArret(Blend_SurfRstFunction& Func Func.Decroch(sol, nors, tgsecs); nors.Normalize(); Standard_Real testra = tgsecs.Dot(nors.Crossed(tgs)); - if (Abs(testra) > tolpoint3d) + if (std::abs(testra) > tolpoint3d) { if (testra < 0.) { @@ -1673,7 +1673,7 @@ Blend_Status BRepBlend_SurfRstLineBuilder::TestArret(Blend_SurfRstFunction& Func rst->D1(sol(3), p2drstref, tg2drstref); testra = tg2drst.Dot(tg2drstref); TopAbs_Orientation Or = domain2->Orientation(rst); - if (Abs(testra) > 1.e-8) + if (std::abs(testra) > 1.e-8) { if (testra < 0.) { diff --git a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_Walking.cxx b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_Walking.cxx index a893565674..d4ffeb749c 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_Walking.cxx +++ b/src/ModelingAlgorithms/TKFillet/BRepBlend/BRepBlend_Walking.cxx @@ -210,10 +210,10 @@ void BRepBlend_Walking::Perform(Blend_Function& Func, doextremities = 0; } tolpoint3d = Tol3d; - tolgui = Abs(TolGuide); - fleche = Abs(Fleche); + tolgui = std::abs(TolGuide); + fleche = std::abs(Fleche); rebrou = Standard_False; - pasmax = Abs(MaxStep); + pasmax = std::abs(MaxStep); if (Pmax - Pdep >= 0.) { sens = 1.; @@ -245,11 +245,11 @@ void BRepBlend_Walking::Perform(Blend_Function& Func, rsnld.Root(sol); if (clasonS1) - situ1 = domain1->Classify(gp_Pnt2d(sol(1), sol(2)), Min(tolerance(1), tolerance(2)), 0); + situ1 = domain1->Classify(gp_Pnt2d(sol(1), sol(2)), std::min(tolerance(1), tolerance(2)), 0); else situ1 = TopAbs_IN; if (clasonS2) - situ2 = domain2->Classify(gp_Pnt2d(sol(3), sol(4)), Min(tolerance(3), tolerance(4)), 0); + situ2 = domain2->Classify(gp_Pnt2d(sol(3), sol(4)), std::min(tolerance(3), tolerance(4)), 0); else situ2 = TopAbs_IN; @@ -321,7 +321,7 @@ Standard_Boolean BRepBlend_Walking::PerformFirstSection(Blend_Function& Func comptra = Standard_False; line = new BRepBlend_Line(); tolpoint3d = Tol3d; - tolgui = Abs(TolGuide); + tolgui = std::abs(TolGuide); Pos1 = Pos2 = TopAbs_UNKNOWN; @@ -341,8 +341,8 @@ Standard_Boolean BRepBlend_Walking::PerformFirstSection(Blend_Function& Func } rsnld.Root(sol); ParDep = sol; - Pos1 = domain1->Classify(gp_Pnt2d(sol(1), sol(2)), Min(tolerance(1), tolerance(2)), 0); - Pos2 = domain2->Classify(gp_Pnt2d(sol(3), sol(4)), Min(tolerance(3), tolerance(4)), 0); + Pos1 = domain1->Classify(gp_Pnt2d(sol(1), sol(2)), std::min(tolerance(1), tolerance(2)), 0); + Pos2 = domain2->Classify(gp_Pnt2d(sol(3), sol(4)), std::min(tolerance(3), tolerance(4)), 0); if (Pos1 != TopAbs_IN || Pos2 != TopAbs_IN) { return Standard_False; @@ -379,7 +379,7 @@ Standard_Boolean BRepBlend_Walking::PerformFirstSection(Blend_Function& F Standard_Boolean recad1, recad2; tolpoint3d = Tol3d; - tolgui = Abs(TolGuide); + tolgui = std::abs(TolGuide); if (Pmax - Pdep >= 0.0) { sens = 1.; @@ -388,7 +388,7 @@ Standard_Boolean BRepBlend_Walking::PerformFirstSection(Blend_Function& F { sens = -1.; } - extrapol = Abs(Pmax - Pdep) / 50.0; // 2% + extrapol = std::abs(Pmax - Pdep) / 50.0; // 2% Blend_Status State; @@ -439,7 +439,7 @@ Standard_Boolean BRepBlend_Walking::PerformFirstSection(Blend_Function& F if (recad1 && recad2) { - if (Abs(w1 - w2) <= tolgui) + if (std::abs(w1 - w2) <= tolgui) { // sol sur 1 et 2 a la fois State = Blend_OnRst12; @@ -846,15 +846,15 @@ Blend_Status BRepBlend_Walking::TestArret(Blend_Function& Function, curpoint.ParametersOnS1(curparamu, curparamv); previousP.ParametersOnS1(prevparamu, prevparamv); - if (Abs(curparamu - prevparamu) > sup(1)) + if (std::abs(curparamu - prevparamu) > sup(1)) State1 = Blend_StepTooLarge; - if (Abs(curparamv - prevparamv) > sup(2)) + if (std::abs(curparamv - prevparamv) > sup(2)) State1 = Blend_StepTooLarge; curpoint.ParametersOnS2(curparamu, curparamv); previousP.ParametersOnS2(prevparamu, prevparamv); - if (Abs(curparamu - prevparamu) > sup(3)) + if (std::abs(curparamu - prevparamu) > sup(3)) State2 = Blend_StepTooLarge; - if (Abs(curparamv - prevparamv) > sup(4)) + if (std::abs(curparamv - prevparamv) > sup(4)) State2 = Blend_StepTooLarge; } } @@ -889,7 +889,7 @@ Blend_Status BRepBlend_Walking::TestArret(Blend_Function& Function, Nor1.Normalize(); Nor2.Normalize(); Standard_Real testra = Tgp1.Dot(Nor1.Crossed(V1)); - if (Abs(testra) > Precision::Confusion()) + if (std::abs(testra) > Precision::Confusion()) { tras1 = IntSurf_In; if ((testra > 0. && !loctwist1) || (testra < 0. && loctwist1)) @@ -898,7 +898,7 @@ Blend_Status BRepBlend_Walking::TestArret(Blend_Function& Function, } testra = Tgp2.Dot(Nor2.Crossed(V2)); - if (Abs(testra) > Precision::Confusion()) + if (std::abs(testra) > Precision::Confusion()) { tras2 = IntSurf_Out; if ((testra > 0. && !loctwist2) || (testra < 0. && loctwist2)) @@ -1068,15 +1068,14 @@ Blend_Status BRepBlend_Walking::CheckDeflection(const Standard_Boolean OnFirst, Du = curparamu - prevparamu; Dv = curparamv - prevparamv; Duv = Du * Du + Dv * Dv; - // SqrtDuv = Sqrt(Duv); - if (Abs(Du) < tolu && Abs(Dv) < tolv) + if (std::abs(Du) < tolu && std::abs(Dv) < tolv) { // il faudra peut etre forcer meme point return Blend_SamePoints; // point confondu 2d } if (!prevpointistangent) { - if (Abs(previousd2d.X()) < tolu && Abs(previousd2d.Y()) < tolv) + if (std::abs(previousd2d.X()) < tolu && std::abs(previousd2d.Y()) < tolv) { // il faudra peut etre forcer meme point return Blend_SamePoints; // point confondu 2d @@ -1254,11 +1253,11 @@ Standard_Boolean BRepBlend_Walking::Recadre(Blend_FuncInv& FuncInv, Standard_Real ufirst, ulast; BRepBlend_BlendTool::Bounds(thecur, ufirst, ulast); // Pour aider a trouver les coins singuliers on recadre eventuelement le paramtere - if (Abs(pmin - ufirst) < Abs(ulast - ufirst) / 1000) + if (std::abs(pmin - ufirst) < std::abs(ulast - ufirst) / 1000) { pmin = ufirst; } - if (Abs(pmin - ulast) < Abs(ulast - ufirst) / 1000) + if (std::abs(pmin - ulast) < std::abs(ulast - ufirst) / 1000) { pmin = ulast; } @@ -1444,7 +1443,7 @@ Standard_Boolean BRepBlend_Walking::Recadre(Blend_FuncInv& FuncInv, // En cas d'echecs, on regarde si un autre arc // peut faire l'affaire (cas des sorties a proximite d'un vertex) dist = (ulast - ufirst) / 100; - if ((!recadre) && ((Abs(pmin - ulast) < dist) || (Abs(pmin - ufirst) < dist))) + if ((!recadre) && ((std::abs(pmin - ulast) < dist) || (std::abs(pmin - ufirst) < dist))) { Indexsol = ArcToRecadre(OnFirst, theSol, Indexsol, lastpt2d, pt2d, pmin); if (Indexsol == 0) @@ -1512,10 +1511,10 @@ Standard_Boolean BRepBlend_Walking::Recadre(Blend_FuncInv& FuncInv, while (!IsVtx) { Vtx = Iter->Vertex(); - vtol = 0.4 * Abs(ulast - ufirst); // Un majorant de la tolerance - if (vtol > Max(BRepBlend_BlendTool::Tolerance(Vtx, thearc), toler(1))) - vtol = Max(BRepBlend_BlendTool::Tolerance(Vtx, thearc), toler(1)); - if (Abs(BRepBlend_BlendTool::Parameter(Vtx, thearc) - solrst(1)) <= vtol) + vtol = 0.4 * std::abs(ulast - ufirst); // Un majorant de la tolerance + if (vtol > std::max(BRepBlend_BlendTool::Tolerance(Vtx, thearc), toler(1))) + vtol = std::max(BRepBlend_BlendTool::Tolerance(Vtx, thearc), toler(1)); + if (std::abs(BRepBlend_BlendTool::Parameter(Vtx, thearc) - solrst(1)) <= vtol) { IsVtx = Standard_True; // On est dans la boule du vertex ou // le vertex est dans la "boule" du recadrage @@ -1729,13 +1728,13 @@ static void RecadreIfPeriodic(Standard_Real& NewU, if (UPeriod > 0.) { Standard_Real sign = (NewU < OldU) ? 1 : -1; - while (Abs(NewU - OldU) > UPeriod / 2) + while (std::abs(NewU - OldU) > UPeriod / 2) NewU += sign * UPeriod; } if (VPeriod > 0.) { Standard_Real sign = (NewV < OldV) ? 1 : -1; - while (Abs(NewV - OldV) > VPeriod / 2) + while (std::abs(NewV - OldV) > VPeriod / 2) NewV += sign * VPeriod; } } @@ -1816,7 +1815,7 @@ void BRepBlend_Walking::InternalPerform(Blend_Function& Func, { stepw = (line->Point(nbp).Parameter() - line->Point(nbp - 1).Parameter()); } - stepw = Max(stepw, 100. * tolgui); + stepw = std::max(stepw, 100. * tolgui); } Standard_Real parprec = param; gp_Vec TgOnGuide, PrevTgOnGuide; @@ -1877,7 +1876,7 @@ void BRepBlend_Walking::InternalPerform(Blend_Function& Func, State = Blend_StepTooLarge; stepw = stepw / 2.; param = parprec + sens * stepw; // on ne risque pas de depasser Bound. - if (Abs(stepw) < tolgui) + if (std::abs(stepw) < tolgui) { Ext1.SetValue(previousP.PointOnS1(), sol(1), sol(2), previousP.Parameter(), tolpoint3d); Ext2.SetValue(previousP.PointOnS2(), sol(3), sol(4), previousP.Parameter(), tolpoint3d); @@ -1907,11 +1906,13 @@ void BRepBlend_Walking::InternalPerform(Blend_Function& Func, rsnld.Root(sol); if (clasonS1) - situ1 = domain1->Classify(gp_Pnt2d(sol(1), sol(2)), Min(tolerance(1), tolerance(2)), 0); + situ1 = + domain1->Classify(gp_Pnt2d(sol(1), sol(2)), std::min(tolerance(1), tolerance(2)), 0); else situ1 = TopAbs_IN; if (clasonS2) - situ2 = domain2->Classify(gp_Pnt2d(sol(3), sol(4)), Min(tolerance(3), tolerance(4)), 0); + situ2 = + domain2->Classify(gp_Pnt2d(sol(3), sol(4)), std::min(tolerance(3), tolerance(4)), 0); else situ2 = TopAbs_IN; } @@ -1992,7 +1993,7 @@ void BRepBlend_Walking::InternalPerform(Blend_Function& Func, // Que faut il controler if (recad1 && recad2) { - if (Abs(w1 - w2) <= 10 * tolgui) + if (std::abs(w1 - w2) <= 10 * tolgui) { // pas besoin de controler les recadrage // Le control pouvant se planter (cf model blend10) @@ -2018,8 +2019,8 @@ void BRepBlend_Walking::InternalPerform(Blend_Function& Func, TopAbs_State situ; if (recad1 && clasonS2) { - situ = - recdomain2->Classify(gp_Pnt2d(solrst1(3), solrst1(4)), Min(tolerance(3), tolerance(4))); + situ = recdomain2->Classify(gp_Pnt2d(solrst1(3), solrst1(4)), + std::min(tolerance(3), tolerance(4))); if (situ == TopAbs_OUT) { recad1 = Standard_False; @@ -2028,8 +2029,8 @@ void BRepBlend_Walking::InternalPerform(Blend_Function& Func, } else if (recad2 && clasonS1) { - situ = - recdomain1->Classify(gp_Pnt2d(solrst2(3), solrst2(4)), Min(tolerance(1), tolerance(1))); + situ = recdomain1->Classify(gp_Pnt2d(solrst2(3), solrst2(4)), + std::min(tolerance(1), tolerance(1))); if (situ == TopAbs_OUT) { recad2 = Standard_False; @@ -2096,8 +2097,9 @@ void BRepBlend_Walking::InternalPerform(Blend_Function& Func, Standard_Real theParam = Precision::Infinite(); // Choose the closest parameter if (SameDirs[0] && SameDirs[1]) - theParam = (Abs(param - SavedParams[0]) < Abs(param - SavedParams[1])) ? SavedParams[0] - : SavedParams[1]; + theParam = (std::abs(param - SavedParams[0]) < std::abs(param - SavedParams[1])) + ? SavedParams[0] + : SavedParams[1]; else if (SameDirs[0]) theParam = SavedParams[0]; else if (SameDirs[1]) @@ -2109,7 +2111,7 @@ void BRepBlend_Walking::InternalPerform(Blend_Function& Func, CorrectExtremityOnOneRst(1, sol(3), sol(4), param, Pnt1, NewU, NewV, NewPnt, NewParam); if (Corrected) { - if (Abs(param - NewParam) < Abs(param - theParam)) + if (std::abs(param - NewParam) < std::abs(param - theParam)) theParam = NewParam; } @@ -2204,7 +2206,7 @@ void BRepBlend_Walking::InternalPerform(Blend_Function& Func, // Il vaut mieux un pas non orthodoxe que pas de recadrage!! PMN State = TestArret(Func, State, - (testdefl && (Abs(stepw) > 3 * tolgui)), + (testdefl && (std::abs(stepw) > 3 * tolgui)), Standard_False, Standard_True); } @@ -2288,7 +2290,7 @@ void BRepBlend_Walking::InternalPerform(Blend_Function& Func, case Blend_StepTooLarge: { stepw = stepw / 2.; - if (Abs(stepw) < tolgui) + if (std::abs(stepw) < tolgui) { Ext1.SetValue(previousP.PointOnS1(), sol(1), sol(2), previousP.Parameter(), tolpoint3d); Ext2.SetValue(previousP.PointOnS2(), sol(3), sol(4), previousP.Parameter(), tolpoint3d); @@ -2337,7 +2339,7 @@ void BRepBlend_Walking::InternalPerform(Blend_Function& Func, parprec = param; - stepw = Min(1.5 * stepw, pasmax); + stepw = std::min(1.5 * stepw, pasmax); if (param == Bound) { Arrive = Standard_True; @@ -2567,7 +2569,7 @@ Standard_Boolean BRepBlend_Walking::CorrectExtremityOnOneRst(const Standard_Inte { Standard_Real Period = hguide->Period(); Standard_Real sign = (NewParam < theParam) ? 1 : -1; - while (Abs(NewParam - theParam) > Period / 2) + while (std::abs(NewParam - theParam) > Period / 2) NewParam += sign * Period; } diff --git a/src/ModelingAlgorithms/TKFillet/BRepFilletAPI/BRepFilletAPI_MakeFillet.cxx b/src/ModelingAlgorithms/TKFillet/BRepFilletAPI/BRepFilletAPI_MakeFillet.cxx index 93d3a677dd..4a3337ac22 100644 --- a/src/ModelingAlgorithms/TKFillet/BRepFilletAPI/BRepFilletAPI_MakeFillet.cxx +++ b/src/ModelingAlgorithms/TKFillet/BRepFilletAPI/BRepFilletAPI_MakeFillet.cxx @@ -130,7 +130,7 @@ void BRepFilletAPI_MakeFillet::SetRadius(const Standard_Real R1, { Standard_Real r1, r2; - if (Abs(R1 - R2) < Precision::Confusion()) + if (std::abs(R1 - R2) < Precision::Confusion()) r1 = r2 = (R1 + R2) * 0.5; else { diff --git a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc.cxx b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc.cxx index 998c9f1ac4..416019aaf3 100644 --- a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc.cxx +++ b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc.cxx @@ -47,7 +47,7 @@ void BlendFunc::GetShape(const BlendFunc_SectionShape SShape, switch (SShape) { case BlendFunc_Rational: { - Standard_Integer NbSpan = (Standard_Integer)(Ceiling(3. * Abs(MaxAng) / 2. / M_PI)); + Standard_Integer NbSpan = (Standard_Integer)(std::ceil(3. * std::abs(MaxAng) / 2. / M_PI)); NbPoles = 2 * NbSpan + 1; NbKnots = NbSpan + 1; Degree = 2; @@ -116,7 +116,7 @@ void BlendFunc::GetMinimalWeights(const BlendFunc_SectionShape SShape, CtoBspl->Weights(Weights); TColStd_Array1OfReal poids(Weights.Lower(), Weights.Upper()); - Standard_Real angle_min = Max(Precision::PConfusion(), MinAng); + Standard_Real angle_min = std::max(Precision::PConfusion(), MinAng); Handle(Geom_TrimmedCurve) Sect2 = new Geom_TrimmedCurve(new Geom_Circle(C), 0., angle_min); CtoBspl = GeomConvert::CurveToBSplineCurve(Sect2, TConv); diff --git a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_CSCircular.cxx b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_CSCircular.cxx index 5a6e6cafea..691020b399 100644 --- a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_CSCircular.cxx +++ b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_CSCircular.cxx @@ -81,10 +81,10 @@ void BlendFunc_CSCircular::Set(const Standard_Real Radius, const Standard_Intege { case 3: case 4: - ray = Abs(Radius); + ray = std::abs(Radius); break; default: - ray = -Abs(Radius); + ray = -std::abs(Radius); break; } } @@ -159,7 +159,7 @@ Standard_Boolean BlendFunc_CSCircular::IsSolution(const math_Vector& Sol, const Values(Sol, valsol, gradsol); - if (Abs(valsol(1)) <= Tol && Abs(valsol(2)) <= Tol * Tol) + if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol * Tol) { // Calcul des tangentes @@ -225,7 +225,7 @@ Standard_Boolean BlendFunc_CSCircular::IsSolution(const math_Vector& Sol, const Sina = -Sina; // nplan est change en -nplan } - Angle = ACos(Cosa); + Angle = std::acos(Cosa); if (Sina < 0.) { Angle = 2. * M_PI - Angle; @@ -503,7 +503,7 @@ void BlendFunc_CSCircular::Section(const Standard_Real Param, ns.SetLinearForm(nplan.Dot(ns) / norm, nplan, -1. / norm, ns); Center.SetXYZ(pts.XYZ() + ray * ns.XYZ()); - C.SetRadius(Abs(ray)); + C.SetRadius(std::abs(ray)); if (ray > 0.) ns.Reverse(); @@ -666,7 +666,7 @@ Standard_Boolean BlendFunc_CSCircular::GetSection(const Standard_Real Param, Cosa = ns.Dot(ns2); Sina = nplan.Dot(ns.Crossed(ns2)); - Angle = ACos(Cosa); + Angle = std::acos(Cosa); if (Sina < 0.) { Angle = 2. * M_PI - Angle; @@ -679,14 +679,15 @@ Standard_Boolean BlendFunc_CSCircular::GetSection(const Standard_Real Param, for (i = 2; i <= NbPoint - 1; i++) { lambda = (Standard_Real)(i - 1) / (Standard_Real)(NbPoint - 1); - Cosa = Cos(lambda * Angle); - Sina = Sin(lambda * Angle); - tabP(lowp + i - 1).SetXYZ(pts.XYZ() + Abs(ray) * ((Cosa - 1) * ns.XYZ() + Sina * ncrn.XYZ())); + Cosa = std::cos(lambda * Angle); + Sina = std::sin(lambda * Angle); + tabP(lowp + i - 1) + .SetXYZ(pts.XYZ() + std::abs(ray) * ((Cosa - 1) * ns.XYZ() + Sina * ncrn.XYZ())); temp.SetLinearForm(-Sina, ns, Cosa, ncrn); temp.Multiply(lambda * Dangle); temp.Add(((Cosa - 1) * dnw).Added(Sina * dncrn)); - temp.Multiply(Abs(ray)); + temp.Multiply(std::abs(ray)); temp.Add(tgs); tabV(lowv + i - 1) = temp; } @@ -706,7 +707,7 @@ Standard_Boolean BlendFunc_CSCircular::IsRational() const Standard_Real BlendFunc_CSCircular::GetSectionSize() const { - return maxang * Abs(ray); + return maxang * std::abs(ray); } //================================================================================================= @@ -757,8 +758,8 @@ void BlendFunc_CSCircular::GetTolerance(const Standard_Real BoundTol, const Standard_Real Tol = GeomFill::GetTolerance(myTConv, minang, ray, AngleTol, SurfTol); Tol1d.Init(SurfTol); Tol3d.Init(SurfTol); - Tol3d(low + 1) = Tol3d(up - 1) = Min(Tol, SurfTol); - Tol3d(low) = Tol3d(up) = Min(Tol, BoundTol); + Tol3d(low + 1) = Tol3d(up - 1) = std::min(Tol, SurfTol); + Tol3d(low) = Tol3d(up) = std::min(Tol, BoundTol); } //================================================================================================= @@ -826,7 +827,7 @@ void BlendFunc_CSCircular::Section(const Blend_Point& P, nplan.Reverse(); } - GeomFill::GetCircle(myTConv, ns, ns2, nplan, pts, ptc, Abs(ray), Center, Poles, Weights); + GeomFill::GetCircle(myTConv, ns, ns2, nplan, pts, ptc, std::abs(ray), Center, Poles, Weights); } //================================================================================================= @@ -995,7 +996,7 @@ Standard_Boolean BlendFunc_CSCircular::Section(const Blend_Point& P, ptc, tgs, tgc, - Abs(ray), + std::abs(ray), 0, Center, tgct, @@ -1006,7 +1007,7 @@ Standard_Boolean BlendFunc_CSCircular::Section(const Blend_Point& P, } else { - GeomFill::GetCircle(myTConv, ns, ns2, nplan, pts, ptc, Abs(ray), Center, Poles, Weights); + GeomFill::GetCircle(myTConv, ns, ns2, nplan, pts, ptc, std::abs(ray), Center, Poles, Weights); return Standard_False; } } diff --git a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_CSConstRad.cxx b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_CSConstRad.cxx index 7434652b63..2293def65e 100644 --- a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_CSConstRad.cxx +++ b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_CSConstRad.cxx @@ -69,7 +69,7 @@ Standard_Integer BlendFunc_CSConstRad::NbEquations() const void BlendFunc_CSConstRad::Set(const Standard_Real Radius, const Standard_Integer Choix) { choix = Choix; - ray = -Abs(Radius); + ray = -std::abs(Radius); } //================================================================================================= @@ -142,7 +142,7 @@ Standard_Boolean BlendFunc_CSConstRad::IsSolution(const math_Vector& Sol, const Standard_Real Cosa, Sina, Angle; Values(Sol, valsol, gradsol); - if (Abs(valsol(1)) <= Tol && Abs(valsol(2)) <= Tol && Abs(valsol(3)) <= Tol * Tol) + if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol && std::abs(valsol(3)) <= Tol * Tol) { // Calcul des tangentes @@ -202,7 +202,7 @@ Standard_Boolean BlendFunc_CSConstRad::IsSolution(const math_Vector& Sol, const Sina = -Sina; // nplan est change en -nplan } - Angle = ACos(Cosa); + Angle = std::acos(Cosa); if (Sina < 0.) { Angle = 2. * M_PI - Angle; @@ -484,7 +484,7 @@ void BlendFunc_CSConstRad::Section(const Standard_Real Param, norm = nplan.Crossed(ns).Magnitude(); ns.SetLinearForm(nplan.Dot(ns) / norm, nplan, -1. / norm, ns); Center.SetXYZ(pts.XYZ() + ray * ns.XYZ()); - C.SetRadius(Abs(ray)); + C.SetRadius(std::abs(ray)); if (choix % 2 == 0) { @@ -634,7 +634,7 @@ Standard_Boolean BlendFunc_CSConstRad::GetSection(const Standard_Real Param, Cosa = ns.Dot(ns2); Sina = nplan.Dot(ns.Crossed(ns2)); - Angle = ACos(Cosa); + Angle = std::acos(Cosa); if (Sina < 0.) { Angle = 2. * M_PI - Angle; @@ -647,14 +647,15 @@ Standard_Boolean BlendFunc_CSConstRad::GetSection(const Standard_Real Param, for (i = 2; i <= NbPoint - 1; i++) { lambda = (Standard_Real)(i - 1) / (Standard_Real)(NbPoint - 1); - Cosa = Cos(lambda * Angle); - Sina = Sin(lambda * Angle); - tabP(lowp + i - 1).SetXYZ(pts.XYZ() + Abs(ray) * ((Cosa - 1) * ns.XYZ() + Sina * ncrn.XYZ())); + Cosa = std::cos(lambda * Angle); + Sina = std::sin(lambda * Angle); + tabP(lowp + i - 1) + .SetXYZ(pts.XYZ() + std::abs(ray) * ((Cosa - 1) * ns.XYZ() + Sina * ncrn.XYZ())); temp.SetLinearForm(-Sina, ns, Cosa, ncrn); temp.Multiply(lambda * Dangle); temp.Add(((Cosa - 1) * dnw).Added(Sina * dncrn)); - temp.Multiply(Abs(ray)); + temp.Multiply(std::abs(ray)); temp.Add(tgs); tabV(lowv + i - 1) = temp; } @@ -674,7 +675,7 @@ Standard_Boolean BlendFunc_CSConstRad::IsRational() const Standard_Real BlendFunc_CSConstRad::GetSectionSize() const { - return maxang * Abs(ray); + return maxang * std::abs(ray); } //================================================================================================= @@ -722,11 +723,12 @@ void BlendFunc_CSConstRad::GetTolerance(const Standard_Real BoundTol, { const Standard_Integer low = Tol3d.Lower(); const Standard_Integer up = Tol3d.Upper(); - const Standard_Real Tol = GeomFill::GetTolerance(myTConv, minang, Abs(ray), AngleTol, SurfTol); + const Standard_Real Tol = + GeomFill::GetTolerance(myTConv, minang, std::abs(ray), AngleTol, SurfTol); Tol1d.Init(SurfTol); Tol3d.Init(SurfTol); - Tol3d(low + 1) = Tol3d(up - 1) = Min(Tol, SurfTol); - Tol3d(low) = Tol3d(up) = Min(Tol, BoundTol); + Tol3d(low + 1) = Tol3d(up - 1) = std::min(Tol, SurfTol); + Tol3d(low) = Tol3d(up) = std::min(Tol, BoundTol); } //================================================================================================= @@ -795,7 +797,7 @@ void BlendFunc_CSConstRad::Section(const Blend_Point& P, nplan.Reverse(); } - GeomFill::GetCircle(myTConv, ns, ns2, nplan, pts, ptc, Abs(ray), Center, Poles, Weights); + GeomFill::GetCircle(myTConv, ns, ns2, nplan, pts, ptc, std::abs(ray), Center, Poles, Weights); } //================================================================================================= @@ -962,7 +964,7 @@ Standard_Boolean BlendFunc_CSConstRad::Section(const Blend_Point& P, ptc, tgs, tgc, - Abs(ray), + std::abs(ray), 0, Center, tgct, @@ -973,7 +975,7 @@ Standard_Boolean BlendFunc_CSConstRad::Section(const Blend_Point& P, } else { - GeomFill::GetCircle(myTConv, ns, ns2, nplan, pts, ptc, Abs(ray), Center, Poles, Weights); + GeomFill::GetCircle(myTConv, ns, ns2, nplan, pts, ptc, std::abs(ray), Center, Poles, Weights); return Standard_False; } } diff --git a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ChAsym.cxx b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ChAsym.cxx index f5ede8d9cc..1b6eb2c631 100644 --- a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ChAsym.cxx +++ b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ChAsym.cxx @@ -149,8 +149,9 @@ Standard_Boolean BlendFunc_ChAsym::IsSolution(const math_Vector& Sol, const Stan Values(Sol, valsol, gradsol); - if (Abs(valsol(1)) < Tol && Abs(valsol(2)) < Tol && Abs(valsol(3)) < 2. * dist1 * Tol - && Abs(valsol(4)) < Tol * (1. + tgang) * Abs(PScaInv) * temp) + if (std::abs(valsol(1)) < Tol && std::abs(valsol(2)) < Tol + && std::abs(valsol(3)) < 2. * dist1 * Tol + && std::abs(valsol(4)) < Tol * (1. + tgang) * std::abs(PScaInv) * temp) { secmember(1) = Normg - dnp.Dot(pguis1); @@ -193,7 +194,7 @@ Standard_Boolean BlendFunc_ChAsym::IsSolution(const math_Vector& Sol, const Stan tg22d.SetCoord(secmember(3), secmember(4)); } - distmin = Min(distmin, pt1.Distance(pt2)); + distmin = std::min(distmin, pt1.Distance(pt2)); return Standard_True; } @@ -682,7 +683,7 @@ Standard_Boolean BlendFunc_ChAsym::Section(const Blend_Point& P, tg22d.SetCoord(secmember(3), secmember(4)); } - distmin = Min(distmin, pt1.Distance(pt2)); + distmin = std::min(distmin, pt1.Distance(pt2)); if (!istangent) { @@ -739,8 +740,8 @@ void BlendFunc_ChAsym::Set(const Standard_Real Dist1, const Standard_Real Angle, const Standard_Integer Choix) { - dist1 = Abs(Dist1); + dist1 = std::abs(Dist1); angle = Angle; - tgang = Tan(Angle); + tgang = std::tan(Angle); choix = Choix; } diff --git a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ChAsymInv.cxx b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ChAsymInv.cxx index 65285ee771..7f1bae5417 100644 --- a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ChAsymInv.cxx +++ b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ChAsymInv.cxx @@ -44,9 +44,9 @@ void BlendFunc_ChAsymInv::Set(const Standard_Real Dist1, const Standard_Real Angle, const Standard_Integer Choix) { - dist1 = Abs(Dist1); + dist1 = std::abs(Dist1); angle = Angle; - tgang = Tan(Angle); + tgang = std::tan(Angle); choix = Choix; } @@ -168,8 +168,9 @@ Standard_Boolean BlendFunc_ChAsymInv::IsSolution(const math_Vector& Sol, const S Value(Sol, valsol); - if (Abs(valsol(1)) < Tol && Abs(valsol(2)) < Tol && Abs(valsol(3)) < 2. * dist1 * Tol - && Abs(valsol(4)) < Tol * (1. + tgang) * Abs(PScaInv) * temp) + if (std::abs(valsol(1)) < Tol && std::abs(valsol(2)) < Tol + && std::abs(valsol(3)) < 2. * dist1 * Tol + && std::abs(valsol(4)) < Tol * (1. + tgang) * std::abs(PScaInv) * temp) { return Standard_True; diff --git a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_Chamfer.cxx b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_Chamfer.cxx index 206dc6c115..bb87bb40b6 100644 --- a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_Chamfer.cxx +++ b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_Chamfer.cxx @@ -69,7 +69,7 @@ Standard_Boolean BlendFunc_Chamfer::IsSolution(const math_Vector& Sol, const Sta issol = issol && corde2.IsSolution(Sol2, Tol); tol = Tol; if (issol) - distmin = Min(distmin, corde1.PointOnS().Distance(corde2.PointOnS())); + distmin = std::min(distmin, corde1.PointOnS().Distance(corde2.PointOnS())); return issol; } diff --git a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstRad.cxx b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstRad.cxx index b498a80b77..d14b527056 100644 --- a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstRad.cxx +++ b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstRad.cxx @@ -824,7 +824,7 @@ Standard_Boolean BlendFunc_ConstRad::IsSolution(const math_Vector& Sol, const St Ok = ComputeValues(Sol, 1, Standard_True, param); - if (Abs(E(1)) <= Tol && E(2) * E(2) + E(3) * E(3) + E(4) * E(4) <= Tol * Tol) + if (std::abs(E(1)) <= Tol && E(2) * E(2) + E(3) * E(3) + E(4) * E(4) <= Tol * Tol) { // ns1, ns2 and np are copied locally to avoid crushing the fields ! @@ -858,8 +858,8 @@ Standard_Boolean BlendFunc_ConstRad::IsSolution(const math_Vector& Sol, const St Resol.Solve(-DEDT, solution); istangent = Standard_False; controle = DEDT.Added(DEDX.Multiplied(solution)); - if (Abs(controle(1)) > tolerances(1) || Abs(controle(2)) > tolerances(2) - || Abs(controle(3)) > tolerances(3) || Abs(controle(4)) > tolerances(4)) + if (std::abs(controle(1)) > tolerances(1) || std::abs(controle(2)) > tolerances(2) + || std::abs(controle(3)) > tolerances(3) || std::abs(controle(4)) > tolerances(4)) { istangent = Standard_True; } @@ -873,8 +873,8 @@ Standard_Boolean BlendFunc_ConstRad::IsSolution(const math_Vector& Sol, const St SingRS.Solve(-DEDT, solution, 1.e-6); istangent = Standard_False; controle = DEDT.Added(DEDX.Multiplied(solution)); - if (Abs(controle(1)) > tolerances(1) || Abs(controle(2)) > tolerances(2) - || Abs(controle(3)) > tolerances(3) || Abs(controle(4)) > tolerances(4)) + if (std::abs(controle(1)) > tolerances(1) || std::abs(controle(2)) > tolerances(2) + || std::abs(controle(3)) > tolerances(3) || std::abs(controle(4)) > tolerances(4)) { #ifdef OCCT_DEBUG std::cout << "Cheminement : echec calcul des derivees" << std::endl; @@ -914,7 +914,7 @@ Standard_Boolean BlendFunc_ConstRad::IsSolution(const math_Vector& Sol, const St Cosa = 1.; Sina = 0.; } - Angle = ACos(Cosa); + Angle = std::acos(Cosa); // Reframing on ]-pi/2, 3pi/2] if (Sina < 0.) @@ -930,15 +930,15 @@ Standard_Boolean BlendFunc_ConstRad::IsSolution(const math_Vector& Sol, const St // std::cout << "t = " << param << std::endl; // } - if (Abs(Angle) > maxang) + if (std::abs(Angle) > maxang) { - maxang = Abs(Angle); + maxang = std::abs(Angle); } - if (Abs(Angle) < minang) + if (std::abs(Angle) < minang) { - minang = Abs(Angle); + minang = std::abs(Angle); } - distmin = Min(distmin, pts1.Distance(pts2)); + distmin = std::min(distmin, pts1.Distance(pts2)); return Ok; } @@ -1149,7 +1149,7 @@ void BlendFunc_ConstRad::Section(const Standard_Real Param, { np.Reverse(); } - C.SetRadius(Abs(ray1)); + C.SetRadius(std::abs(ray1)); C.SetPosition(gp_Ax2(Center, np, ns1)); Pdeb = 0.; Pfin = ElCLib::Parameter(C, pts2); @@ -1175,7 +1175,7 @@ Standard_Boolean BlendFunc_ConstRad::IsRational() const Standard_Real BlendFunc_ConstRad::GetSectionSize() const { - return maxang * Abs(ray1); + return maxang * std::abs(ray1); } //================================================================================================= @@ -1223,11 +1223,11 @@ void BlendFunc_ConstRad::GetTolerance(const Standard_Real BoundTol, { Standard_Integer low = Tol3d.Lower(), up = Tol3d.Upper(); Standard_Real Tol; - Tol = GeomFill::GetTolerance(myTConv, minang, Abs(ray1), AngleTol, SurfTol); + Tol = GeomFill::GetTolerance(myTConv, minang, std::abs(ray1), AngleTol, SurfTol); Tol1d.Init(SurfTol); Tol3d.Init(SurfTol); - Tol3d(low + 1) = Tol3d(up - 1) = Min(Tol, SurfTol); - Tol3d(low) = Tol3d(up) = Min(Tol, BoundTol); + Tol3d(low + 1) = Tol3d(up - 1) = std::min(Tol, SurfTol); + Tol3d(low) = Tol3d(up) = std::min(Tol, BoundTol); } //================================================================================================= @@ -1264,7 +1264,7 @@ void BlendFunc_ConstRad::Section(const Blend_Point& P, P.ParametersOnS2(X(3), X(4)); ComputeValues(X, 0, Standard_True, prm); - distmin = Min(distmin, pts1.Distance(pts2)); + distmin = std::min(distmin, pts1.Distance(pts2)); // ns1, ns2, np are copied locally to avoid crushing the fields ! ns1 = nsurf1; @@ -1316,7 +1316,7 @@ void BlendFunc_ConstRad::Section(const Blend_Point& P, np.Reverse(); } - GeomFill::GetCircle(myTConv, ns1, ns2, np, pts1, pts2, Abs(ray1), Center, Poles, Weights); + GeomFill::GetCircle(myTConv, ns1, ns2, np, pts1, pts2, std::abs(ray1), Center, Poles, Weights); } //================================================================================================= @@ -1345,7 +1345,7 @@ Standard_Boolean BlendFunc_ConstRad::Section(const Blend_Point& P, // Calculation of equations ComputeValues(sol, 1, Standard_True, prm); - distmin = Min(distmin, pts1.Distance(pts2)); + distmin = std::min(distmin, pts1.Distance(pts2)); // ns1, ns2, np are copied locally to avoid crushing the fields ! ns1 = nsurf1; @@ -1476,7 +1476,7 @@ Standard_Boolean BlendFunc_ConstRad::Section(const Blend_Point& P, pts2, tg1, tg2, - Abs(ray1), + std::abs(ray1), 0, Center, tgc, @@ -1487,7 +1487,7 @@ Standard_Boolean BlendFunc_ConstRad::Section(const Blend_Point& P, } else { - GeomFill::GetCircle(myTConv, ns1, ns2, np, pts1, pts2, Abs(ray1), Center, Poles, Weights); + GeomFill::GetCircle(myTConv, ns1, ns2, np, pts1, pts2, std::abs(ray1), Center, Poles, Weights); return Standard_False; } } @@ -1565,7 +1565,7 @@ Standard_Boolean BlendFunc_ConstRad::Section(const Blend_Point& P, // Calculation of equations ComputeValues(X, 2, Standard_True, prm); - distmin = Min(distmin, pts1.Distance(pts2)); + distmin = std::min(distmin, pts1.Distance(pts2)); /* #ifdef OCCT_DEBUG @@ -1597,14 +1597,14 @@ Standard_Boolean BlendFunc_ConstRad::Section(const Blend_Point& P, for ( ii=1; ii<=4; ii++) { - if (Abs(VDiff(ii)-D2EDT2(ii)) > seuil*(Abs(D2EDT2(ii))+1)) + if (std::abs(VDiff(ii)-D2EDT2(ii)) > seuil*(std::abs(D2EDT2(ii))+1)) { std::cout << "erreur sur D2EDT2 : "<< ii << std::endl; std::cout << D2EDT2(ii) << " D.F = " << VDiff(ii) << std::endl; } for (jj=1; jj<=4; jj++) { - if (Abs(MDiff(ii,jj)-D2EDXDT(ii, jj)) > - 1.e-3*(Abs(D2EDXDT(ii, jj))+1.e-2)) + if (std::abs(MDiff(ii,jj)-D2EDXDT(ii, jj)) > + 1.e-3*(std::abs(D2EDXDT(ii, jj))+1.e-2)) { std::cout << "erreur sur D2EDXDT : "<< ii << " , " << jj << std::endl; std::cout << D2EDXDT(ii,jj) << " D.F = " << MDiff(ii,jj) << std::endl; @@ -1615,8 +1615,8 @@ Standard_Boolean BlendFunc_ConstRad::Section(const Blend_Point& P, MDiff = (Mu1 - DEDX)/deltaX; for (ii=1; ii<=4; ii++) { for (jj=1; jj<=4; jj++) { - if (Abs(MDiff(ii,jj)-D2EDX2(ii, jj, 1)) > - seuil*(Abs(D2EDX2(ii, jj, 1))+1)) + if (std::abs(MDiff(ii,jj)-D2EDX2(ii, jj, 1)) > + seuil*(std::abs(D2EDX2(ii, jj, 1))+1)) { std::cout << "erreur sur D2EDX2 : "<< ii << " , " << jj << " , " << 1 << std::endl; std::cout << D2EDX2(ii,jj, 1) << " D.F = " << MDiff(ii,jj) << std::endl; @@ -1628,8 +1628,8 @@ Standard_Boolean BlendFunc_ConstRad::Section(const Blend_Point& P, MDiff = (Mv1 - DEDX)/deltaX; for (ii=1; ii<=4; ii++) { for (jj=1; jj<=4; jj++) { - if (Abs(MDiff(ii,jj)-D2EDX2(ii, jj, 2)) > - seuil*(Abs(D2EDX2(ii, jj, 2))+1)) + if (std::abs(MDiff(ii,jj)-D2EDX2(ii, jj, 2)) > + seuil*(std::abs(D2EDX2(ii, jj, 2))+1)) { std::cout << "erreur sur D2EDX2 : "<< ii << " , " << jj << " , " << 2 << std::endl; std::cout << D2EDX2(ii,jj, 2) << " D.F = " << MDiff(ii,jj) << std::endl; @@ -1640,8 +1640,8 @@ Standard_Boolean BlendFunc_ConstRad::Section(const Blend_Point& P, MDiff = (Mu2 - DEDX)/deltaX; for (ii=1; ii<=4; ii++) { for (jj=1; jj<=4; jj++) { - if (Abs(MDiff(ii,jj)-D2EDX2(ii, jj, 3)) > - seuil*(Abs(D2EDX2(ii, jj, 3))+1)) + if (std::abs(MDiff(ii,jj)-D2EDX2(ii, jj, 3)) > + seuil*(std::abs(D2EDX2(ii, jj, 3))+1)) { std::cout << "erreur sur D2EDX2 : "<< ii << " , " << jj << " , " << 3 << std::endl; std::cout << D2EDX2(ii,jj, 3) << " D.F = " << MDiff(ii,jj) << std::endl; @@ -1653,8 +1653,8 @@ Standard_Boolean BlendFunc_ConstRad::Section(const Blend_Point& P, MDiff = (Mv2 - DEDX)/deltaX; for (ii=1; ii<=4; ii++) { for (jj=1; jj<=4; jj++) { - if (Abs(MDiff(ii,jj)-D2EDX2(ii, jj, 4)) > - seuil*(Abs(D2EDX2(ii, jj, 4))+1)) + if (std::abs(MDiff(ii,jj)-D2EDX2(ii, jj, 4)) > + seuil*(std::abs(D2EDX2(ii, jj, 4))+1)) { std::cout << "erreur sur D2EDX2 : "<< ii << " , " << jj << " , " << 4 << std::endl; std::cout << D2EDX2(ii,jj, 4) << " D.F = " << MDiff(ii,jj) << std::endl; @@ -1843,7 +1843,7 @@ Standard_Boolean BlendFunc_ConstRad::Section(const Blend_Point& P, tg2, dtg1, dtg2, - Abs(ray1), + std::abs(ray1), 0, 0, Center, @@ -1858,7 +1858,16 @@ Standard_Boolean BlendFunc_ConstRad::Section(const Blend_Point& P, } else { - GeomFill::GetCircle(myTConv, ns1, ns2, nplan, pts1, pts2, Abs(ray1), Center, Poles, Weights); + GeomFill::GetCircle(myTConv, + ns1, + ns2, + nplan, + pts1, + pts2, + std::abs(ray1), + Center, + Poles, + Weights); return Standard_False; } } diff --git a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstRadInv.cxx b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstRadInv.cxx index ef49041c91..3006a3dfbe 100644 --- a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstRadInv.cxx +++ b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstRadInv.cxx @@ -148,7 +148,7 @@ Standard_Boolean BlendFunc_ConstRadInv::IsSolution(const math_Vector& Sol, const { math_Vector valsol(1, 4); Value(Sol, valsol); - if (Abs(valsol(1)) <= Tol + if (std::abs(valsol(1)) <= Tol && valsol(2) * valsol(2) + valsol(3) * valsol(3) + valsol(4) * valsol(4) <= Tol * Tol) { return Standard_True; diff --git a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstThroat.cxx b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstThroat.cxx index 39772dbe07..90336a0b80 100644 --- a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstThroat.cxx +++ b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstThroat.cxx @@ -71,8 +71,8 @@ Standard_Boolean BlendFunc_ConstThroat::IsSolution(const math_Vector& Sol, const gp_Vec dnplan, temp1, temp2, tempmid; - if (Abs(valsol(1)) <= Tol && Abs(valsol(2)) <= Tol && Abs(valsol(3)) <= Tol * Tol - && Abs(valsol(4)) <= Tol * Tol) + if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol && std::abs(valsol(3)) <= Tol * Tol + && std::abs(valsol(4)) <= Tol * Tol) { dnplan.SetLinearForm(1. / normtg, d2gui, -1. / normtg * (nplan.Dot(d2gui)), nplan); @@ -102,7 +102,7 @@ Standard_Boolean BlendFunc_ConstThroat::IsSolution(const math_Vector& Sol, const istangent = Standard_True; } - distmin = Min(distmin, pts1.Distance(pts2)); + distmin = std::min(distmin, pts1.Distance(pts2)); return Standard_True; } diff --git a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstThroatInv.cxx b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstThroatInv.cxx index 1057dd1d72..a1da8d3a13 100644 --- a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstThroatInv.cxx +++ b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstThroatInv.cxx @@ -83,8 +83,8 @@ Standard_Boolean BlendFunc_ConstThroatInv::IsSolution(const math_Vector& Sol, math_Vector valsol(1, 4); Value(Sol, valsol); - if (Abs(valsol(1)) <= Tol && Abs(valsol(2)) <= Tol && Abs(valsol(3)) <= Tol * Tol - && Abs(valsol(4)) <= Tol * Tol) + if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol && std::abs(valsol(3)) <= Tol * Tol + && std::abs(valsol(4)) <= Tol * Tol) return Standard_True; return Standard_False; diff --git a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstThroatWithPenetration.cxx b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstThroatWithPenetration.cxx index 42b5bb7520..f25d1d33db 100644 --- a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstThroatWithPenetration.cxx +++ b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstThroatWithPenetration.cxx @@ -47,8 +47,8 @@ Standard_Boolean BlendFunc_ConstThroatWithPenetration::IsSolution(const math_Vec gp_Vec dnplan, temp1, temp2, temp3; - if (Abs(valsol(1)) <= Tol && Abs(valsol(2)) <= Tol && Abs(valsol(3)) <= Tol * Tol - && Abs(valsol(4)) <= Tol) + if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol && std::abs(valsol(3)) <= Tol * Tol + && std::abs(valsol(4)) <= Tol) { dnplan.SetLinearForm(1. / normtg, d2gui, -1. / normtg * (nplan.Dot(d2gui)), nplan); @@ -78,7 +78,7 @@ Standard_Boolean BlendFunc_ConstThroatWithPenetration::IsSolution(const math_Vec istangent = Standard_True; } - distmin = Min(distmin, pts1.Distance(pts2)); + distmin = std::min(distmin, pts1.Distance(pts2)); return Standard_True; } diff --git a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstThroatWithPenetrationInv.cxx b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstThroatWithPenetrationInv.cxx index 556c254ec1..6a31449a47 100644 --- a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstThroatWithPenetrationInv.cxx +++ b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_ConstThroatWithPenetrationInv.cxx @@ -35,8 +35,8 @@ Standard_Boolean BlendFunc_ConstThroatWithPenetrationInv::IsSolution(const math_ math_Vector valsol(1, 4); Value(Sol, valsol); - if (Abs(valsol(1)) <= Tol && Abs(valsol(2)) <= Tol && Abs(valsol(3)) <= Tol * Tol - && Abs(valsol(4)) <= Tol) + if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol && std::abs(valsol(3)) <= Tol * Tol + && std::abs(valsol(4)) <= Tol) return Standard_True; return Standard_False; diff --git a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_Corde.cxx b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_Corde.cxx index ec2433bac9..8a9c75676b 100644 --- a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_Corde.cxx +++ b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_Corde.cxx @@ -163,7 +163,7 @@ Standard_Boolean BlendFunc_Corde::IsSolution(const math_Vector& Sol, const Stand Value(Sol, valsol); Derivatives(Sol, gradsol); - if (Abs(valsol(1)) <= Tol && Abs(valsol(2)) <= Tol * Tol) + if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol * Tol) { surf->D1(Sol(1), Sol(2), pts, d1u, d1v); diff --git a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_EvolRad.cxx b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_EvolRad.cxx index 7b6590c298..ddc755d37d 100644 --- a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_EvolRad.cxx +++ b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_EvolRad.cxx @@ -55,7 +55,7 @@ static void FusionneIntervalles(const TColStd_Array1OfReal& I1, { v1 = I1(ind1); v2 = I2(ind2); - if (Abs(v1 - v2) <= Epspar) + if (std::abs(v1 - v2) <= Epspar) { // Here elements of I1 and I2 are suitable. Seq.Append((v1 + v2) / 2); @@ -893,7 +893,7 @@ Standard_Boolean BlendFunc_EvolRad::IsSolution(const math_Vector& Sol, const Sta Ok = ComputeValues(Sol, 1, Standard_True, param); - if (Abs(E(1)) <= Tol && E(2) * E(2) + E(3) * E(3) + E(4) * E(4) <= Tol * Tol) + if (std::abs(E(1)) <= Tol && E(2) * E(2) + E(3) * E(3) + E(4) * E(4) <= Tol * Tol) { // ns1, ns2, np are copied locally to avoid crushing the fields ! @@ -925,8 +925,8 @@ Standard_Boolean BlendFunc_EvolRad::IsSolution(const math_Vector& Sol, const Sta GetTolerance(tolerances, Tol); Resol.Solve(-DEDT, solution); controle = DEDT.Added(DEDX.Multiplied(solution)); - if (Abs(controle(1)) > tolerances(1) || Abs(controle(2)) > tolerances(2) - || Abs(controle(3)) > tolerances(3) || Abs(controle(4)) > tolerances(4)) + if (std::abs(controle(1)) > tolerances(1) || std::abs(controle(2)) > tolerances(2) + || std::abs(controle(3)) > tolerances(3) || std::abs(controle(4)) > tolerances(4)) { #ifdef OCCT_DEBUG std::cout << "Cheminement : echec calcul des derivees" << std::endl; @@ -967,7 +967,7 @@ Standard_Boolean BlendFunc_EvolRad::IsSolution(const math_Vector& Sol, const Sta Cosa = 1.; Sina = 0.; } - Angle = ACos(Cosa); + Angle = std::acos(Cosa); // Reframing on ]-pi/2, 3pi/2] if (Sina < 0.) { @@ -977,23 +977,23 @@ Standard_Boolean BlendFunc_EvolRad::IsSolution(const math_Vector& Sol, const Sta Angle = 2. * M_PI - Angle; } - if (Abs(Angle) > maxang) + if (std::abs(Angle) > maxang) { - maxang = Abs(Angle); + maxang = std::abs(Angle); } - if (Abs(Angle) < minang) + if (std::abs(Angle) < minang) { - minang = Abs(Angle); + minang = std::abs(Angle); } - if (Abs(Angle * ray) < lengthmin) + if (std::abs(Angle * ray) < lengthmin) { - lengthmin = Abs(Angle * ray); + lengthmin = std::abs(Angle * ray); } - if (Abs(Angle * ray) > lengthmax) + if (std::abs(Angle * ray) > lengthmax) { - lengthmax = Abs(Angle * ray); + lengthmax = std::abs(Angle * ray); } - distmin = Min(distmin, pts1.Distance(pts2)); + distmin = std::min(distmin, pts1.Distance(pts2)); return Ok; } @@ -1155,7 +1155,7 @@ void BlendFunc_EvolRad::Section(const Standard_Real Param, { np.Reverse(); } - C.SetRadius(Abs(ray)); + C.SetRadius(std::abs(ray)); C.SetPosition(gp_Ax2(Center, np, ns1)); Pdeb = 0.; Pfin = ElCLib::Parameter(C, pts2); @@ -1334,8 +1334,8 @@ void BlendFunc_EvolRad::GetTolerance(const Standard_Real BoundTol, Tol = GeomFill::GetTolerance(myTConv, maxang, rayon, AngleTol, SurfTol); Tol1d.Init(SurfTol); Tol3d.Init(SurfTol); - Tol3d(low + 1) = Tol3d(up - 1) = Min(Tol, SurfTol); - Tol3d(low) = Tol3d(up) = Min(Tol, BoundTol); + Tol3d(low + 1) = Tol3d(up - 1) = std::min(Tol, SurfTol); + Tol3d(low) = Tol3d(up) = std::min(Tol, BoundTol); } //================================================================================================= @@ -1373,7 +1373,7 @@ void BlendFunc_EvolRad::Section(const Blend_Point& P, // Calculation and storage of distmin ComputeValues(X, 0, Standard_True, prm); - distmin = Min(distmin, pts1.Distance(pts2)); + distmin = std::min(distmin, pts1.Distance(pts2)); // ns1, ns2, np are copied locally to avoid crashing the fields ! ns1 = nsurf1; @@ -1431,7 +1431,7 @@ void BlendFunc_EvolRad::Section(const Blend_Point& P, np.Reverse(); } - GeomFill::GetCircle(myTConv, ns1, ns2, np, pts1, pts2, Abs(ray), Center, Poles, Weights); + GeomFill::GetCircle(myTConv, ns1, ns2, np, pts1, pts2, std::abs(ray), Center, Poles, Weights); } //================================================================================================= @@ -1460,7 +1460,7 @@ Standard_Boolean BlendFunc_EvolRad::Section(const Blend_Point& P, // Calculation of equations ComputeValues(sol, 1, Standard_True, prm); - distmin = Min(distmin, pts1.Distance(pts2)); + distmin = std::min(distmin, pts1.Distance(pts2)); // ns1, ns2, np are copied locally to avoid crashing fields ! ns1 = nsurf1; @@ -1581,7 +1581,7 @@ Standard_Boolean BlendFunc_EvolRad::Section(const Blend_Point& P, } if (ray < 0.) - { // to avoid Abs(dray) some lines below + { // to avoid std::abs(dray) some lines below rayprim = -rayprim; } @@ -1598,7 +1598,7 @@ Standard_Boolean BlendFunc_EvolRad::Section(const Blend_Point& P, pts2, tg1, tg2, - Abs(ray), + std::abs(ray), rayprim, Center, tgc, @@ -1609,7 +1609,7 @@ Standard_Boolean BlendFunc_EvolRad::Section(const Blend_Point& P, } else { - GeomFill::GetCircle(myTConv, ns1, ns2, np, pts1, pts2, Abs(ray), Center, Poles, Weights); + GeomFill::GetCircle(myTConv, ns1, ns2, np, pts1, pts2, std::abs(ray), Center, Poles, Weights); return Standard_False; } } @@ -1685,7 +1685,7 @@ Standard_Boolean BlendFunc_EvolRad::Section(const Blend_Point& P, */ // Calculs des equations ComputeValues(X, 2, Standard_True, prm); - distmin = Min(distmin, pts1.Distance(pts2)); + distmin = std::min(distmin, pts1.Distance(pts2)); /* #ifdef OCCT_DEBUG @@ -1717,14 +1717,14 @@ Standard_Boolean BlendFunc_EvolRad::Section(const Blend_Point& P, for ( ii=1; ii<=4; ii++) { - if (Abs(VDiff(ii)-D2EDT2(ii)) > 1.e-4*(Abs(D2EDT2(ii))+1.e-1)) + if (std::abs(VDiff(ii)-D2EDT2(ii)) > 1.e-4*(std::abs(D2EDT2(ii))+1.e-1)) { std::cout << "erreur sur D2EDT2 : "<< ii << std::endl; std::cout << D2EDT2(ii) << " D.F = " << VDiff(ii) << std::endl; } for (jj=1; jj<=4; jj++) { - if (Abs(MDiff(ii,jj)-D2EDXDT(ii, jj)) > - 1.e-3*(Abs(D2EDXDT(ii, jj))+1.e-2)) + if (std::abs(MDiff(ii,jj)-D2EDXDT(ii, jj)) > + 1.e-3*(std::abs(D2EDXDT(ii, jj))+1.e-2)) { std::cout << "erreur sur D2EDXDT : "<< ii << " , " << jj << std::endl; std::cout << D2EDXDT(ii,jj) << " D.F = " << MDiff(ii,jj) << std::endl; @@ -1735,8 +1735,8 @@ Standard_Boolean BlendFunc_EvolRad::Section(const Blend_Point& P, MDiff = (Mu1 - DEDX)/deltaX; for (ii=1; ii<=4; ii++) { for (jj=1; jj<=4; jj++) { - if (Abs(MDiff(ii,jj)-D2EDX2(ii, jj, 1)) > - 1.e-4*(Abs(D2EDX2(ii, jj, 1))+1.e-1)) + if (std::abs(MDiff(ii,jj)-D2EDX2(ii, jj, 1)) > + 1.e-4*(std::abs(D2EDX2(ii, jj, 1))+1.e-1)) { std::cout << "erreur sur D2EDX2 : "<< ii << " , " << jj << " , " << 1 << std::endl; std::cout << D2EDX2(ii,jj, 1) << " D.F = " << MDiff(ii,jj) << std::endl; @@ -1748,8 +1748,8 @@ Standard_Boolean BlendFunc_EvolRad::Section(const Blend_Point& P, MDiff = (Mv1 - DEDX)/deltaX; for (ii=1; ii<=4; ii++) { for (jj=1; jj<=4; jj++) { - if (Abs(MDiff(ii,jj)-D2EDX2(ii, jj, 2)) > - 1.e-4*(Abs(D2EDX2(ii, jj, 2))+1.e-1)) + if (std::abs(MDiff(ii,jj)-D2EDX2(ii, jj, 2)) > + 1.e-4*(std::abs(D2EDX2(ii, jj, 2))+1.e-1)) { std::cout << "erreur sur D2EDX2 : "<< ii << " , " << jj << " , " << 2 << std::endl; std::cout << D2EDX2(ii,jj, 2) << " D.F = " << MDiff(ii,jj) << std::endl; @@ -1760,8 +1760,8 @@ Standard_Boolean BlendFunc_EvolRad::Section(const Blend_Point& P, MDiff = (Mu2 - DEDX)/deltaX; for (ii=1; ii<=4; ii++) { for (jj=1; jj<=4; jj++) { - if (Abs(MDiff(ii,jj)-D2EDX2(ii, jj, 3)) > - 1.e-4*(Abs(D2EDX2(ii, jj, 3))+1.e-1)) + if (std::abs(MDiff(ii,jj)-D2EDX2(ii, jj, 3)) > + 1.e-4*(std::abs(D2EDX2(ii, jj, 3))+1.e-1)) { std::cout << "erreur sur D2EDX2 : "<< ii << " , " << jj << " , " << 3 << std::endl; std::cout << D2EDX2(ii,jj, 3) << " D.F = " << MDiff(ii,jj) << std::endl; @@ -1773,8 +1773,8 @@ Standard_Boolean BlendFunc_EvolRad::Section(const Blend_Point& P, MDiff = (Mv2 - DEDX)/deltaX; for (ii=1; ii<=4; ii++) { for (jj=1; jj<=4; jj++) { - if (Abs(MDiff(ii,jj)-D2EDX2(ii, jj, 4)) > - 1.e-4*(Abs(D2EDX2(ii, jj, 4))+1.e-1)) + if (std::abs(MDiff(ii,jj)-D2EDX2(ii, jj, 4)) > + 1.e-4*(std::abs(D2EDX2(ii, jj, 4))+1.e-1)) { std::cout << "erreur sur D2EDX2 : "<< ii << " , " << jj << " , " << 4 << std::endl; @@ -1948,7 +1948,7 @@ Standard_Boolean BlendFunc_EvolRad::Section(const Blend_Point& P, } if (ray < 0.) - { // to avoid Abs(dray) several lines below + { // to avoid std::abs(dray) several lines below rayprim = -rayprim; raysecn = -raysecn; } @@ -1971,7 +1971,7 @@ Standard_Boolean BlendFunc_EvolRad::Section(const Blend_Point& P, tg2, dtg1, dtg2, - Abs(ray), + std::abs(ray), rayprim, raysecn, Center, @@ -1986,7 +1986,16 @@ Standard_Boolean BlendFunc_EvolRad::Section(const Blend_Point& P, } else { - GeomFill::GetCircle(myTConv, ns1, ns2, nplan, pts1, pts2, Abs(ray), Center, Poles, Weights); + GeomFill::GetCircle(myTConv, + ns1, + ns2, + nplan, + pts1, + pts2, + std::abs(ray), + Center, + Poles, + Weights); return Standard_False; } } diff --git a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_EvolRadInv.cxx b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_EvolRadInv.cxx index 0949e22014..cf0603576c 100644 --- a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_EvolRadInv.cxx +++ b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_EvolRadInv.cxx @@ -147,7 +147,7 @@ Standard_Boolean BlendFunc_EvolRadInv::IsSolution(const math_Vector& Sol, const { math_Vector valsol(1, 4); Value(Sol, valsol); - if (Abs(valsol(1)) <= Tol + if (std::abs(valsol(1)) <= Tol && (valsol(2) * valsol(2) + valsol(3) * valsol(3) + valsol(4) * valsol(4)) <= Tol * Tol) return Standard_True; diff --git a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_Ruled.cxx b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_Ruled.cxx index 0b60339b4b..5be54cebbf 100644 --- a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_Ruled.cxx +++ b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_Ruled.cxx @@ -101,8 +101,8 @@ Standard_Boolean BlendFunc_Ruled::IsSolution(const math_Vector& Sol, const Stand Standard_Real norm, ndotns, grosterme; Values(Sol, valsol, gradsol); - if (Abs(valsol(1)) <= Tol && Abs(valsol(2)) <= Tol && Abs(valsol(3)) <= Tol - && Abs(valsol(4)) <= Tol) + if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol && std::abs(valsol(3)) <= Tol + && std::abs(valsol(4)) <= Tol) { // Calcul des tangentes diff --git a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_RuledInv.cxx b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_RuledInv.cxx index d9b3a4f6f5..2d8a0db39d 100644 --- a/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_RuledInv.cxx +++ b/src/ModelingAlgorithms/TKFillet/BlendFunc/BlendFunc_RuledInv.cxx @@ -107,8 +107,8 @@ Standard_Boolean BlendFunc_RuledInv::IsSolution(const math_Vector& Sol, const St { math_Vector valsol(1, 4); Value(Sol, valsol); - if (Abs(valsol(1)) <= Tol && Abs(valsol(2)) <= Tol && Abs(valsol(3)) <= Tol - && Abs(valsol(4)) <= Tol) + if (std::abs(valsol(1)) <= Tol && std::abs(valsol(2)) <= Tol && std::abs(valsol(3)) <= Tol + && std::abs(valsol(4)) <= Tol) return Standard_True; return Standard_False; diff --git a/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_Builder.cxx b/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_Builder.cxx index babfe9ca49..bade18fc89 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_Builder.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_Builder.cxx @@ -1023,22 +1023,22 @@ TopoDS_Edge ChFi2d_Builder::BuildFilletEdge(const TopoDS_Vertex& V, gp_Pnt p2 = Adaptor3dSurface.Value(Ptg2.X(), Ptg2.Y()); B.MakeVertex(Vertex1, p1, Tol); NewExtr1 = Vertex1; - if (Abs(U2 - ufirst1) <= Precision::PConfusion()) + if (std::abs(U2 - ufirst1) <= Precision::PConfusion()) { NewExtr1 = V1; } - if (Abs(U2 - ulast1) <= Precision::PConfusion()) + if (std::abs(U2 - ulast1) <= Precision::PConfusion()) { NewExtr1 = V2; } B.MakeVertex(Vertex2, p2, Tol); NewExtr2 = Vertex2; - if (Abs(Vv2 - ufirst2) <= Precision::PConfusion()) + if (std::abs(Vv2 - ufirst2) <= Precision::PConfusion()) { NewExtr2 = V3; } - if (Abs(Vv2 - ulast2) <= Precision::PConfusion()) + if (std::abs(Vv2 - ulast2) <= Precision::PConfusion()) { NewExtr2 = V4; } diff --git a/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_ChamferAPI.cxx b/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_ChamferAPI.cxx index 587b0f6c57..84a526a089 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_ChamferAPI.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_ChamferAPI.cxx @@ -123,9 +123,9 @@ TopoDS_Edge ChFi2d_ChamferAPI::Result(TopoDS_Edge& theEdge1, const Standard_Real theLength2) { TopoDS_Edge aResult; - if (Abs(myEnd1 - myStart1) < theLength1) + if (std::abs(myEnd1 - myStart1) < theLength1) return aResult; - if (Abs(myEnd2 - myStart2) < theLength2) + if (std::abs(myEnd2 - myStart2) < theLength2) return aResult; Standard_Real aCommon1 = (myCommonStart1 ? myStart1 : myEnd1) diff --git a/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_FilletAlgo.cxx b/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_FilletAlgo.cxx index 3607eb0db3..43c136e0dd 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_FilletAlgo.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_FilletAlgo.cxx @@ -279,7 +279,7 @@ void ChFi2d_FilletAlgo::FillPoint(FilletPoint* thePoint, const Standard_Real the const Standard_Real d = aProj.Distance(a); thePoint->appendValue(d * d - myRadius * myRadius, (aParamProj >= myStart2 && aParamProj <= myEnd2 && aValid2)); - if (Abs(d - myRadius) < Precision::Confusion()) + if (std::abs(d - myRadius) < Precision::Confusion()) thePoint->setParam2(aParamProj); } } @@ -339,7 +339,7 @@ Standard_Boolean ChFi2d_FilletAlgo::Perform(const Standard_Real theRadius) FilletPoint *aLeft = NULL, *aRight; for (aParam = myStart1 + aStep; - aParam < myEnd1 || Abs(myEnd1 - aParam) < Precision::Confusion(); + aParam < myEnd1 || std::abs(myEnd1 - aParam) < Precision::Confusion(); aParam += aStep) { if (!aLeft) @@ -452,10 +452,10 @@ void ChFi2d_FilletAlgo::PerformNewton(FilletPoint* theLeft, FilletPoint* theRigh + aA * theLeft->getParam() * theLeft->getParam() / 2.0; Standard_Real aDet = aB * aB - 2.0 * aA * aC; - if (Abs(aA) < Precision::Confusion()) + if (std::abs(aA) < Precision::Confusion()) { // linear case // std::cout<<"###"< 10e-20) + if (std::abs(aB) > 10e-20) { Standard_Real aX0 = -aC / aB; // use extremum if (aX0 > theLeft->getParam() && aX0 < theRight->getParam()) @@ -470,7 +470,7 @@ void ChFi2d_FilletAlgo::PerformNewton(FilletPoint* theLeft, FilletPoint* theRigh } else { - if (Abs(aB) > Abs(aDet * 1000000.)) + if (std::abs(aB) > std::abs(aDet * 1000000.)) { // possible floating point operations accuracy errors // std::cout<<"*"; ProcessPoint(theLeft, @@ -561,7 +561,7 @@ TopoDS_Edge ChFi2d_FilletAlgo::Result(const gp_Pnt& thePoint, aP = DBL_MAX; if (iSolution == -1) { - aP = Abs(aPoint->getCenter().Distance(aTargetPoint2d) - myRadius); + aP = std::abs(aPoint->getCenter().Distance(aTargetPoint2d) - myRadius); } else if (iSolution == iSol) { @@ -718,12 +718,12 @@ Standard_Boolean FilletPoint::calculateDiff(FilletPoint* thePoint) { for (b = 1; b <= thePoint->myV.Length(); b++) { - if (b == 1 || Abs(thePoint->myV.Value(b) - myV.Value(a)) < Abs(aDY)) + if (b == 1 || std::abs(thePoint->myV.Value(b) - myV.Value(a)) < std::abs(aDY)) aDY = thePoint->myV.Value(b) - myV.Value(a); } if (aDiffsSet) { - if (Abs(aDY / aDX) < Abs(myD.Value(a))) + if (std::abs(aDY / aDX) < std::abs(myD.Value(a))) myD.SetValue(a, aDY / aDX); } else @@ -750,7 +750,7 @@ void FilletPoint::FilterPoints(FilletPoint* thePoint) { // calculate hypothesis value of the Y2 with the constant first and second derivative aY2 = aY + aDX * (thePoint->myD.Value(b) - myD.Value(a)) / 2.0; - if (aNear == 0 || Abs(aY2 - thePoint->myV.Value(b)) < Abs(aDiff)) + if (aNear == 0 || std::abs(aY2 - thePoint->myV.Value(b)) < std::abs(aDiff)) { aNear = b; aDiff = aY2 - thePoint->myV.Value(b); @@ -763,14 +763,14 @@ void FilletPoint::FilterPoints(FilletPoint* thePoint) { // the same sign at the same sides of the interval if (myV.Value(a) * myD.Value(a) > 0) { - if (Abs(myD.Value(a)) > Precision::Confusion()) + if (std::abs(myD.Value(a)) > Precision::Confusion()) aNear = 0; } else { - if (Abs(myV.Value(a)) > Abs(thePoint->myV.Value(aNear))) + if (std::abs(myV.Value(a)) > std::abs(thePoint->myV.Value(aNear))) if (thePoint->myV.Value(aNear) * thePoint->myD.Value(aNear) < 0 - && Abs(thePoint->myD.Value(aNear)) > Precision::Confusion()) + && std::abs(thePoint->myD.Value(aNear)) > Precision::Confusion()) { aNear = 0; } @@ -794,7 +794,7 @@ void FilletPoint::FilterPoints(FilletPoint* thePoint) if (aNear) { - if (Abs(aDiff / aDX) > 1.e+7) + if (std::abs(aDiff / aDX) > 1.e+7) { aNear = 0; } @@ -814,7 +814,7 @@ void FilletPoint::FilterPoints(FilletPoint* thePoint) { if (myNear.Value(b) == aNear) { - if (Abs(aDiffs.Value(b)) < Abs(aDiff)) + if (std::abs(aDiffs.Value(b)) < std::abs(aDiff)) { // return this 'near' aFound = Standard_True; myV.Remove(a); @@ -862,7 +862,7 @@ int FilletPoint::hasSolution(const Standard_Real theRadius) Standard_Integer a; for (a = 1; a <= myV.Length(); a++) { - if (Abs(sqrt(Abs(Abs(myV.Value(a)) + theRadius * theRadius)) - theRadius) + if (std::abs(sqrt(std::abs(std::abs(myV.Value(a)) + theRadius * theRadius)) - theRadius) < Precision::Confusion()) return a; } diff --git a/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_FilletAlgo.hxx b/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_FilletAlgo.hxx index 24fd73720a..071dd08769 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_FilletAlgo.hxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi2d/ChFi2d_FilletAlgo.hxx @@ -200,7 +200,7 @@ public: Standard_Real aValue; for (a = myV.Length(); a > 0; a--) { - if (aResultIndex == 0 || Abs(aValue) > Abs(myV.Value(a))) + if (aResultIndex == 0 || std::abs(aValue) > std::abs(myV.Value(a))) { aResultIndex = a; aValue = myV.Value(a); diff --git a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d.cxx b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d.cxx index 34f08dade2..12d2b556c3 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d.cxx @@ -149,7 +149,7 @@ Standard_Boolean ChFi3d::IsTangentFaces(const TopoDS_Edge& theEdge, if (theOrder == GeomAbs_G1 && BRep_Tool::Continuity(theEdge, theFace1, theFace2) != GeomAbs_C0) return Standard_True; - Standard_Real TolC0 = Max(0.001, 1.5 * BRep_Tool::Tolerance(theEdge)); + Standard_Real TolC0 = std::max(0.001, 1.5 * BRep_Tool::Tolerance(theEdge)); Standard_Real aFirst; Standard_Real aLast; @@ -212,7 +212,7 @@ Standard_Boolean ChFi3d::IsTangentFaces(const TopoDS_Edge& theEdge, Handle(BRepTopAdaptor_TopolTool) aTool2 = new BRepTopAdaptor_TopolTool(aBAHS2); Standard_Integer aNbSamples1 = aTool1->NbSamples(); Standard_Integer aNbSamples2 = aTool2->NbSamples(); - Standard_Integer aNbSamples = Max(aNbSamples1, aNbSamples2); + Standard_Integer aNbSamples = std::max(aNbSamples1, aNbSamples2); // Computation of the continuity. Standard_Real aPar; @@ -520,7 +520,7 @@ Standard_Integer ChFi3d::NextSide(TopAbs_Orientation& Or1, else ChoixConge = 5; } - if (Abs(ChoixSave) % 2 == 0) + if (std::abs(ChoixSave) % 2 == 0) ChoixConge++; return ChoixConge; } @@ -590,24 +590,24 @@ void Correct2dPoint(const TopoDS_Face& theF, gp_Pnt2d& theP2d) v2 = aBAS.LastVParameter(); if (!(Precision::IsInfinite(u1) || Precision::IsInfinite(u2))) { - eps = Max(coeff * (u2 - u1), Precision::PConfusion()); - if (Abs(theP2d.X() - u1) < eps) + eps = std::max(coeff * (u2 - u1), Precision::PConfusion()); + if (std::abs(theP2d.X() - u1) < eps) { theP2d.SetX(u1 + eps); } - if (Abs(theP2d.X() - u2) < eps) + if (std::abs(theP2d.X() - u2) < eps) { theP2d.SetX(u2 - eps); } } if (!(Precision::IsInfinite(v1) || Precision::IsInfinite(v2))) { - eps = Max(coeff * (v2 - v1), Precision::PConfusion()); - if (Abs(theP2d.Y() - v1) < eps) + eps = std::max(coeff * (v2 - v1), Precision::PConfusion()); + if (std::abs(theP2d.Y() - v1) < eps) { theP2d.SetY(v1 + eps); } - if (Abs(theP2d.Y() - v2) < eps) + if (std::abs(theP2d.Y() - v2) < eps) { theP2d.SetY(v2 - eps); } diff --git a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder.cxx b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder.cxx index c24a37c8f5..17ba4c3da6 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder.cxx @@ -127,8 +127,8 @@ static void CompleteDS(TopOpeBRepDS_DataStructure& DStr, const TopoDS_Shape& S) for (TopOpeBRepDS_PointIterator it(LI); it.More(); it.Next()) { Standard_Real par = it.Parameter(); - parmin = Min(parmin, par); - parmax = Max(parmax, par); + parmin = std::min(parmin, par); + parmax = std::max(parmax, par); } DStr.ChangeCurve(ic).SetRange(parmin, parmax); } diff --git a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_0.cxx b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_0.cxx index 3ef99bf683..acac7059ef 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_0.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_0.cxx @@ -117,10 +117,10 @@ void ChFi3d_Boite(const gp_Pnt2d& p1, Standard_Real& mv, Standard_Real& Mv) { - mu = Min(p1.X(), p2.X()); - Mu = Max(p1.X(), p2.X()); - mv = Min(p1.Y(), p2.Y()); - Mv = Max(p1.Y(), p2.Y()); + mu = std::min(p1.X(), p2.X()); + Mu = std::max(p1.X(), p2.X()); + mv = std::min(p1.Y(), p2.Y()); + Mv = std::max(p1.Y(), p2.Y()); } //======================================================================= @@ -139,18 +139,18 @@ void ChFi3d_Boite(const gp_Pnt2d& p1, Standard_Real& Mv) { Standard_Real a, b; - a = Min(p1.X(), p2.X()); - b = Min(p3.X(), p4.X()); - mu = Min(a, b); - a = Max(p1.X(), p2.X()); - b = Max(p3.X(), p4.X()); - Mu = Max(a, b); - a = Min(p1.Y(), p2.Y()); - b = Min(p3.Y(), p4.Y()); - mv = Min(a, b); - a = Max(p1.Y(), p2.Y()); - b = Max(p3.Y(), p4.Y()); - Mv = Max(a, b); + a = std::min(p1.X(), p2.X()); + b = std::min(p3.X(), p4.X()); + mu = std::min(a, b); + a = std::max(p1.X(), p2.X()); + b = std::max(p3.X(), p4.X()); + Mu = std::max(a, b); + a = std::min(p1.Y(), p2.Y()); + b = std::min(p3.Y(), p4.Y()); + mv = std::min(a, b); + a = std::max(p1.Y(), p2.Y()); + b = std::max(p3.Y(), p4.Y()); + Mv = std::max(a, b); Du = Mu - mu; Dv = Mv - mv; } @@ -604,13 +604,13 @@ void ChFi3d_BoundSrf(GeomAdaptor_Surface& S, { if (!S.IsUPeriodic()) { - uu1 = Max(uu1, u1); - uu2 = Min(uu2, u2); + uu1 = std::max(uu1, u1); + uu2 = std::min(uu2, u2); } if (!S.IsVPeriodic()) { - vv1 = Max(vv1, v1); - vv2 = Min(vv2, v2); + vv1 = std::max(vv1, v1); + vv2 = std::min(vv2, v2); } } S.Load(surface, uu1, uu2, vv1, vv2); @@ -1094,7 +1094,7 @@ static Standard_Real recadre(const Standard_Real p, const Standard_Real last) { const Standard_Real pp = p + (sens > 0 ? (first - last) : (last - first)); - return ((Abs(pp - ref) < Abs(p - ref)) ? pp : p); + return ((std::abs(pp - ref) < std::abs(p - ref)) ? pp : p); } //================================================================================================= @@ -1125,7 +1125,7 @@ Standard_Boolean ChFi3d_IntTraces(const Handle(ChFiDS_SurfData)& fd1, if ((last - first) < Precision::PConfusion()) return Standard_False; if (enlarge) - delta = Min(0.1, 0.05 * (last - first)); + delta = std::min(0.1, 0.05 * (last - first)); Handle(Geom2d_Curve) pcf1 = fd1->Interference(jf1).PCurveOnFace(); if (pcf1.IsNull()) return Standard_False; @@ -1146,7 +1146,7 @@ Standard_Boolean ChFi3d_IntTraces(const Handle(ChFiDS_SurfData)& fd1, if ((last - first) < Precision::PConfusion()) return Standard_False; if (enlarge) - delta = Min(0.1, 0.05 * (last - first)); + delta = std::min(0.1, 0.05 * (last - first)); Handle(Geom2d_Curve) pcf2 = fd2->Interference(jf2).PCurveOnFace(); if (pcf2.IsNull()) return Standard_False; @@ -1206,7 +1206,7 @@ Standard_Boolean ChFi3d_IntTraces(const Handle(ChFiDS_SurfData)& fd1, { Standard_Real pp1 = int2d.ParamOnFirst(); pp1 = recadre(pp1, pref1, sens1, first1, last1); - if ((Abs(pp1 - pref1) < Abs(p1 - pref1))) + if ((std::abs(pp1 - pref1) < std::abs(p1 - pref1))) { p1 = pp1; p2 = int2d.ParamOnSecond(); @@ -1230,7 +1230,7 @@ Standard_Boolean ChFi3d_IntTraces(const Handle(ChFiDS_SurfData)& fd1, { Standard_Real pp2 = int2d.ParamOnSecond(); pp2 = recadre(pp2, pref2, sens2, first2, last2); - if ((Abs(pp2 - pref2) < Abs(p2 - pref2))) + if ((std::abs(pp2 - pref2) < std::abs(p2 - pref2))) { p2 = pp2; p1 = int2d.ParamOnFirst(); @@ -1257,8 +1257,8 @@ Standard_Boolean ChFi3d_IntTraces(const Handle(ChFiDS_SurfData)& fd1, p2 = int2d.ParamOnSecond(); p2d = int2d.Value(); } - else if ((Abs(int2d.ParamOnFirst() - pref1) < Abs(p1 - pref1)) - && (Abs(int2d.ParamOnSecond() - pref2) < Abs(p2 - pref2))) + else if ((std::abs(int2d.ParamOnFirst() - pref1) < std::abs(p1 - pref1)) + && (std::abs(int2d.ParamOnSecond() - pref2) < std::abs(p2 - pref2))) { p1 = int2d.ParamOnFirst(); p2 = int2d.ParamOnSecond(); @@ -1324,13 +1324,13 @@ void ChFi3d_ReparamPcurv(const Standard_Real Uf, Handle(Geom2d_BSplineCurve) pc = Handle(Geom2d_BSplineCurve)::DownCast(basis); if (pc.IsNull()) return; - if (Abs(upcf - pc->FirstParameter()) > Precision::PConfusion() - || Abs(upcl - pc->LastParameter()) > Precision::PConfusion()) + if (std::abs(upcf - pc->FirstParameter()) > Precision::PConfusion() + || std::abs(upcl - pc->LastParameter()) > Precision::PConfusion()) { pc->Segment(upcf, upcl); } - if (Abs(Uf - pc->FirstParameter()) > Precision::PConfusion() - || Abs(Ul - pc->LastParameter()) > Precision::PConfusion()) + if (std::abs(Uf - pc->FirstParameter()) > Precision::PConfusion() + || std::abs(Ul - pc->LastParameter()) > Precision::PConfusion()) { TColgp_Array1OfPnt2d pol(1, pc->NbPoles()); pc->Poles(pol); @@ -1421,7 +1421,7 @@ Standard_Boolean ChFi3d_CheckSameParameter(const Handle(Adaptor3d_Curve)& C3d, gp_Pnt pS = S->Value(u, v); gp_Pnt pC = C3d->Value(t); Standard_Real d2 = pS.SquareDistance(pC); - tolreached = Max(tolreached, d2); + tolreached = std::max(tolreached, d2); } tolreached = sqrt(tolreached); if (tolreached > tol3d) @@ -1430,7 +1430,7 @@ Standard_Boolean ChFi3d_CheckSameParameter(const Handle(Adaptor3d_Curve)& C3d, return Standard_False; } tolreached *= 2.; - tolreached = Max(tolreached, Precision::Confusion()); + tolreached = std::max(tolreached, Precision::Confusion()); return Standard_True; } @@ -1542,22 +1542,25 @@ void ChFi3d_ComputePCurv(const gp_Pnt2d& UV1, p2 = UV1; } - if (Abs(p1.X() - p2.X()) <= tol && Abs((p2.Y() - p1.Y()) - (Parfin - Pardeb)) <= tol) + if (std::abs(p1.X() - p2.X()) <= tol && std::abs((p2.Y() - p1.Y()) - (Parfin - Pardeb)) <= tol) { gp_Pnt2d ppp(p1.X(), p1.Y() - Pardeb); Pcurv = new Geom2d_Line(ppp, gp::DY2d()); } - else if (Abs(p1.X() - p2.X()) <= tol && Abs((p1.Y() - p2.Y()) - (Parfin - Pardeb)) <= tol) + else if (std::abs(p1.X() - p2.X()) <= tol + && std::abs((p1.Y() - p2.Y()) - (Parfin - Pardeb)) <= tol) { gp_Pnt2d ppp(p1.X(), p1.Y() + Pardeb); Pcurv = new Geom2d_Line(ppp, gp::DY2d().Reversed()); } - else if (Abs(p1.Y() - p2.Y()) <= tol && Abs((p2.X() - p1.X()) - (Parfin - Pardeb)) <= tol) + else if (std::abs(p1.Y() - p2.Y()) <= tol + && std::abs((p2.X() - p1.X()) - (Parfin - Pardeb)) <= tol) { gp_Pnt2d ppp(p1.X() - Pardeb, p1.Y()); Pcurv = new Geom2d_Line(ppp, gp::DX2d()); } - else if (Abs(p1.Y() - p2.Y()) <= tol && Abs((p1.X() - p2.X()) - (Parfin - Pardeb)) <= tol) + else if (std::abs(p1.Y() - p2.Y()) <= tol + && std::abs((p1.X() - p2.X()) - (Parfin - Pardeb)) <= tol) { gp_Pnt2d ppp(p1.X() + Pardeb, p1.Y()); Pcurv = new Geom2d_Line(ppp, gp::DX2d().Reversed()); @@ -1707,11 +1710,11 @@ Handle(Geom2d_Curve) ChFi3d_BuildPCurve(const gp_Pnt2d& p1, TColgp_Array1OfPnt2d pol(1, 4); pol(1) = p1; pol(4) = p2; - Standard_Real Lambda1 = Max(Abs(d2.Dot(d1)), Abs(dref.Dot(d1))); - Lambda1 = Max(0.5 * mref * Lambda1, 1.e-5); + Standard_Real Lambda1 = std::max(std::abs(d2.Dot(d1)), std::abs(dref.Dot(d1))); + Lambda1 = std::max(0.5 * mref * Lambda1, 1.e-5); pol(2) = gp_Pnt2d(p1.XY() + Lambda1 * d1.XY()); - Standard_Real Lambda2 = Max(Abs(d1.Dot(d2)), Abs(dref.Dot(d2))); - Lambda2 = Max(0.5 * mref * Lambda2, 1.e-5); + Standard_Real Lambda2 = std::max(std::abs(d1.Dot(d2)), std::abs(dref.Dot(d2))); + Lambda2 = std::max(0.5 * mref * Lambda2, 1.e-5); pol(3) = gp_Pnt2d(p2.XY() + Lambda2 * d2.XY()); return new Geom2d_BezierCurve(pol); } @@ -1818,7 +1821,7 @@ void ChFi3d_ComputeArete(const ChFiDS_CommonPoint& P1, tolreached = tol3d; - if (Abs(UV1.X() - UV2.X()) <= tol2d) + if (std::abs(UV1.X() - UV2.X()) <= tol2d) { if (IFlag == 0) { @@ -1866,7 +1869,7 @@ void ChFi3d_ComputeArete(const ChFiDS_CommonPoint& P1, Pcurv = new Geom2d_Line(UV1, gp_Vec2d(UV1, UV2)); } } - else if (Abs(UV1.Y() - UV2.Y()) <= tol2d) + else if (std::abs(UV1.Y() - UV2.Y()) <= tol2d) { // iso v if (IFlag == 0) @@ -2030,7 +2033,7 @@ Standard_EXPORT void ChFi3d_FilCommonPoint(const BRepBlend_Extremity& SP, const Standard_Real Tol) { // BRep_Tool Outil; - Standard_Real Dist, maxtol = Max(Tol, CP.Tolerance()); + Standard_Real Dist, maxtol = std::max(Tol, CP.Tolerance()); CP.SetPoint(SP.Value()); // One starts with the point and the vector if (SP.HasTangent()) @@ -2056,7 +2059,7 @@ Standard_EXPORT void ChFi3d_FilCommonPoint(const BRepBlend_Extremity& SP, Dist = (SP.Value()).Distance(BRep_Tool::Pnt(V)); //// modified by jgv, 18.09.02 for OCC571 //// // maxtol += Dist; - maxtol = Max(Dist, maxtol); + maxtol = std::max(Dist, maxtol); ////////////////////////////////////////////// CP.SetPoint(BRep_Tool::Pnt(V)); @@ -2097,17 +2100,17 @@ Standard_EXPORT void ChFi3d_FilCommonPoint(const BRepBlend_Extremity& SP, // a preexisting vertex has been met CP.SetVertex(V[Index_min]); // the old vertex is loaded CP.SetPoint(BRep_Tool::Pnt(V[Index_min])); - maxtol = Max(BRep_Tool::Tolerance(V[Index_min]), maxtol); + maxtol = std::max(BRep_Tool::Tolerance(V[Index_min]), maxtol); //// modified by jgv, 18.09.02 for OCC571 //// // maxtol += Dist; - maxtol = Max(Dist, maxtol); + maxtol = std::max(Dist, maxtol); ////////////////////////////////////////////// LeParamAmoi = BRep_Tool::Parameter(V[Index_min], E); } else { // Creation of an arc only - maxtol = Max(BRep_Tool::Tolerance(E), maxtol); - maxtol = Max(SP.Tolerance(), maxtol); + maxtol = std::max(BRep_Tool::Tolerance(E), maxtol); + maxtol = std::max(SP.Tolerance(), maxtol); LeParamAmoi = PR.ParameterOnArc(); } @@ -2292,7 +2295,8 @@ static void QueryAddVertexInEdge(TopOpeBRepDS_ListOfInterference& LI, TopOpeBRepDS_Kind kv = cpi->GeometryType(); TopAbs_Orientation newOr = cpi->Transition().Orientation(TopAbs_IN); Standard_Real newpar = cpi->Parameter(); - if (IV == newIV && kv == TopOpeBRepDS_VERTEX && Or == newOr && Abs(par - newpar) < 1.e-10) + if (IV == newIV && kv == TopOpeBRepDS_VERTEX && Or == newOr + && std::abs(par - newpar) < 1.e-10) { return; } @@ -2433,7 +2437,7 @@ void ChFi3d_FilDS(const Standard_Integer SolidIndex, IcFil1 = Fi.LineIndex(); if (!IcFil1) continue; - Standard_Real FiLen = Abs(Fi.FirstParameter() - Fi.LastParameter()); + Standard_Real FiLen = std::abs(Fi.FirstParameter() - Fi.LastParameter()); if (FiLen > Precision::PConfusion()) continue; TopOpeBRepDS_Curve& cc = DStr.ChangeCurve(IcFil1); @@ -2748,7 +2752,7 @@ void ChFi3d_FilDS(const Standard_Integer SolidIndex, Parfin, tol3d, tolreached); - TCurv.Tolerance(Max(TCurv.Tolerance(), tolreached)); + TCurv.Tolerance(std::max(TCurv.Tolerance(), tolreached)); Interfc1 = ChFi3d_FilCurveInDS(Icurv, Isurf, PCurv, ET1); DStr.ChangeSurfaceInterferences(Isurf).Append(Interfc1); } @@ -3297,7 +3301,7 @@ Standard_Real ChFi3d_ConvTol2dToTol3d(const Handle(Adaptor3d_Surface)& S, const Standard_Real vres = S->VResolution(1.e-7); Standard_Real uresto3d = 1.e-7 * tol2d / ures; Standard_Real vresto3d = 1.e-7 * tol2d / vres; - return Max(uresto3d, vresto3d); + return std::max(uresto3d, vresto3d); } //======================================================================= @@ -3339,7 +3343,7 @@ Standard_Real ChFi3d_EvalTolReached(const Handle(Adaptor3d_Surface)& S1, distmax = d; } distmax = 1.5 * sqrt(distmax); - distmax = Max(distmax, Precision::Confusion()); + distmax = std::max(distmax, Precision::Confusion()); return distmax; } @@ -3565,7 +3569,7 @@ Standard_Boolean ChFi3d_ComputeCurves(const Handle(Adaptor3d_Surface)& S1, Pc1->Value(Udeb).Coord(x, y); x = Pardeb(1) - x; y = Pardeb(2) - y; - if (Abs(x) >= tol2d || Abs(y) >= tol2d) + if (std::abs(x) >= tol2d || std::abs(y) >= tol2d) Pc1->Translate(gp_Vec2d(x, y)); } ChFi3d_ProjectPCurv(HC, S2, Pc2, tol3d, tolr2); @@ -3575,12 +3579,12 @@ Standard_Boolean ChFi3d_ComputeCurves(const Handle(Adaptor3d_Surface)& S1, Pc2->Value(Udeb).Coord(x, y); x = Pardeb(3) - x; y = Pardeb(4) - y; - if (Abs(x) >= tol2d || Abs(y) >= tol2d) + if (std::abs(x) >= tol2d || std::abs(y) >= tol2d) Pc2->Translate(gp_Vec2d(x, y)); } C3d = new Geom_TrimmedCurve(C3d, Udeb, Ufin); - tolreached = 1.5 * Max(tolr1, tolr2); - tolreached = Min(tolreached, ChFi3d_EvalTolReached(S1, Pc1, S2, Pc2, C3d)); + tolreached = 1.5 * std::max(tolr1, tolr2); + tolreached = std::min(tolreached, ChFi3d_EvalTolReached(S1, Pc1, S2, Pc2, C3d)); return Standard_True; } } @@ -3694,7 +3698,7 @@ Standard_Boolean ChFi3d_ComputeCurves(const Handle(Adaptor3d_Surface)& S1, // select right end parameter Standard_Real Uok = failedF ? Ul : Uf; Standard_Real U1 = C3d->FirstParameter(), U2 = C3d->LastParameter(); - Uok = Abs(Uok - U1) > Abs(Uok - U2) ? U1 : U2; + Uok = std::abs(Uok - U1) > std::abs(Uok - U2) ? U1 : U2; if (failedF) Uf = Uok; else @@ -3702,7 +3706,7 @@ Standard_Boolean ChFi3d_ComputeCurves(const Handle(Adaptor3d_Surface)& S1, } else { // both projected, but where? - if (Abs(Uf - Ul) < Precision::PConfusion()) + if (std::abs(Uf - Ul) < Precision::PConfusion()) continue; } ptestdeb = C3d->Value(Uf); @@ -3754,12 +3758,12 @@ Standard_Boolean ChFi3d_ComputeCurves(const Handle(Adaptor3d_Surface)& S1, Pc1->Value(Uf).Coord(x, y); x = Pardeb(1) - x; y = Pardeb(2) - y; - if (Abs(x) > tol2d || Abs(y) > tol2d) + if (std::abs(x) > tol2d || std::abs(y) > tol2d) Pc1->Translate(gp_Vec2d(x, y)); Pc2->Value(Uf).Coord(x, y); x = Pardeb(3) - x; y = Pardeb(4) - y; - if (Abs(x) > tol2d || Abs(y) > tol2d) + if (std::abs(x) > tol2d || std::abs(y) > tol2d) Pc2->Translate(gp_Vec2d(x, y)); tolreached = ChFi3d_EvalTolReached(S1, Pc1, S2, Pc2, C3d); return Standard_True; @@ -3825,13 +3829,13 @@ Standard_Boolean ChFi3d_ComputeCurves(const Handle(Adaptor3d_Surface)& S1, gp_Pnt codeb1 = S1->Value(Pardeb(1), Pardeb(2)); gp_Pnt codeb2 = S2->Value(Pardeb(3), Pardeb(4)); - Standard_Real tol1 = Max(codeb1.Distance(codeb2), tol3d); + Standard_Real tol1 = std::max(codeb1.Distance(codeb2), tol3d); Standard_Boolean bondeb = (tol1 == tol3d); gp_Pnt pntd(0.5 * (codeb1.Coord() + codeb2.Coord())); gp_Pnt cofin1 = S1->Value(Parfin(1), Parfin(2)); gp_Pnt cofin2 = S2->Value(Parfin(3), Parfin(4)); - Standard_Real tol2 = Max(cofin1.Distance(cofin2), tol3d); + Standard_Real tol2 = std::max(cofin1.Distance(cofin2), tol3d); Standard_Boolean bonfin = (tol2 == tol3d); gp_Pnt pntf(0.5 * (cofin1.Coord() + cofin2.Coord())); @@ -3948,8 +3952,8 @@ Standard_Boolean ChFi3d_ComputeCurves(const Handle(Adaptor3d_Surface)& S1, return Standard_False; // tolreached = approx.TolReached3d(); // Standard_Real tolr2d = approx.TolReached2d(); - // tolreached = Max(tolreached,ChFi3d_ConvTol2dToTol3d(S1,tolr2d)); - // tolreached = Max(tolreached,ChFi3d_ConvTol2dToTol3d(S2,tolr2d)); + // tolreached = std::max(tolreached,ChFi3d_ConvTol2dToTol3d(S1,tolr2d)); + // tolreached = std::max(tolreached,ChFi3d_ConvTol2dToTol3d(S2,tolr2d)); const AppParCurves_MultiBSpCurve& mbs = approx.Value(1); Standard_Integer nbpol = mbs.NbPoles(); TColgp_Array1OfPnt pol3d(1, nbpol); @@ -3964,7 +3968,7 @@ Standard_Boolean ChFi3d_ComputeCurves(const Handle(Adaptor3d_Surface)& S1, pol3d(1) = pntd; pol2d1(1).SetCoord(Pardeb(1), Pardeb(2)); pol2d2(1).SetCoord(Pardeb(3), Pardeb(4)); - // tolreached = Max(tolreached,ddeb); + // tolreached = std::max(tolreached,ddeb); } if (dfin >= tol2) @@ -3972,7 +3976,7 @@ Standard_Boolean ChFi3d_ComputeCurves(const Handle(Adaptor3d_Surface)& S1, pol3d(nbpol) = pntf; pol2d1(nbpol).SetCoord(Parfin(1), Parfin(2)); pol2d2(nbpol).SetCoord(Parfin(3), Parfin(4)); - // tolreached = Max(tolreached,dfin); + // tolreached = std::max(tolreached,dfin); } const TColStd_Array1OfReal& knots = mbs.Knots(); const TColStd_Array1OfInteger& mults = mbs.Multiplicities(); @@ -3981,8 +3985,8 @@ Standard_Boolean ChFi3d_ComputeCurves(const Handle(Adaptor3d_Surface)& S1, Pc1 = new Geom2d_BSplineCurve(pol2d1, knots, mults, deg); Pc2 = new Geom2d_BSplineCurve(pol2d2, knots, mults, deg); tolreached = ChFi3d_EvalTolReached(S1, Pc1, S2, Pc2, C3d); - tolreached = Max(tolreached, ddeb); - tolreached = Max(tolreached, dfin); + tolreached = std::max(tolreached, ddeb); + tolreached = std::max(tolreached, dfin); return Standard_True; } } @@ -4037,9 +4041,9 @@ Standard_Boolean ChFi3d_IntCS(const Handle(Adaptor3d_Surface)& S, temp = pint.W(); isol = i; } - else if (Abs(pint.W() - wc) < dist) + else if (std::abs(pint.W() - wc) < dist) { - dist = Abs(pint.W() - wc); + dist = std::abs(pint.W() - wc); isol = i; } } @@ -4100,11 +4104,11 @@ void ChFi3d_ComputesIntPC(const ChFiDS_FaceInterference& Fi1, distref2 = p3d1.SquareDistance(p3d2); P.SetXYZ(0.5 * (p3d1.XYZ() + p3d2.XYZ())); // recalculation of the extremums - Standard_Real delt1 = Min(0.1, 0.05 * (Fi1.LastParameter() - Fi1.FirstParameter())); + Standard_Real delt1 = std::min(0.1, 0.05 * (Fi1.LastParameter() - Fi1.FirstParameter())); Handle(Geom2dAdaptor_Curve) hc2d1 = new Geom2dAdaptor_Curve(Fi1.PCurveOnSurf(), UInt1 - delt1, UInt1 + delt1); - Adaptor3d_CurveOnSurface cons1(hc2d1, HS1); - Standard_Real delt2 = Min(0.1, 0.05 * (Fi2.LastParameter() - Fi2.FirstParameter())); + Adaptor3d_CurveOnSurface cons1(hc2d1, HS1); + Standard_Real delt2 = std::min(0.1, 0.05 * (Fi2.LastParameter() - Fi2.FirstParameter())); Handle(Geom2dAdaptor_Curve) hc2d2 = new Geom2dAdaptor_Curve(Fi2.PCurveOnSurf(), UInt2 - delt2, UInt2 + delt2); Adaptor3d_CurveOnSurface cons2(hc2d2, HS2); @@ -4162,7 +4166,7 @@ Handle(GeomAdaptor_Surface) ChFi3d_BoundSurf(TopOpeBRepDS_DataStructure& DStr GeomAbs_SurfaceType styp = S1.GetType(); if (styp == GeomAbs_Cylinder) { - Dv = Max(0.5 * Dv, 4. * S1.Cylinder().Radius()); + Dv = std::max(0.5 * Dv, 4. * S1.Cylinder().Radius()); Du = 0.; S1.Load(DStr.Surface(Fd1->Surf()).Surface(), mu, Mu, mv - Dv, Mv + Dv); } @@ -4170,13 +4174,13 @@ Handle(GeomAdaptor_Surface) ChFi3d_BoundSurf(TopOpeBRepDS_DataStructure& DStr // period more than 2PI. else if (styp == GeomAbs_Torus || styp == GeomAbs_Cone) { - Du = Min(M_PI - 0.5 * Du, 0.1 * Du); + Du = std::min(M_PI - 0.5 * Du, 0.1 * Du); Dv = 0.; S1.Load(DStr.Surface(Fd1->Surf()).Surface(), mu - Du, Mu + Du, mv, Mv); } else if (styp == GeomAbs_Plane) { - Du = Max(0.5 * Du, 4. * Dv); + Du = std::max(0.5 * Du, 4. * Dv); Dv = 0.; S1.Load(DStr.Surface(Fd1->Surf()).Surface(), mu - Du, Mu + Du, mv, Mv); } @@ -4505,8 +4509,8 @@ Standard_EXPORT void ChFi3d_PerformElSpine(Handle(ChFiDS_ElSpine)& HES, { IF = Spine->Index(WF, 1); IL = Spine->Index(WL, 0); - Wrefdeb = Max(Spine->FirstParameter(IF), WF); - Wreffin = Min(Spine->LastParameter(IL), WL); + Wrefdeb = std::max(Spine->FirstParameter(IF), WF); + Wreffin = std::min(Spine->LastParameter(IL), WL); } // Spine->D1(WF, PDeb, VrefDeb); @@ -4609,7 +4613,7 @@ Standard_EXPORT void ChFi3d_PerformElSpine(Handle(ChFiDS_ElSpine)& HES, } } // else {//#1 // - if (Abs(Last - First) < tolpared) + if (std::abs(Last - First) < tolpared) { cepadur = 1; } @@ -4644,7 +4648,7 @@ Standard_EXPORT void ChFi3d_PerformElSpine(Handle(ChFiDS_ElSpine)& HES, // TC = new (Geom_TrimmedCurve)(Cv, First, Last); BS = GeomConvert::CurveToBSplineCurve(TC); - CurveCleaner(BS, Abs(WL - WF) * 1.e-4, 0); + CurveCleaner(BS, std::abs(WL - WF) * 1.e-4, 0); // // Smoothing of the curve iToApproxByC2 = 0; @@ -4731,7 +4735,7 @@ Standard_EXPORT void ChFi3d_PerformElSpine(Handle(ChFiDS_ElSpine)& HES, // TC = new (Geom_TrimmedCurve)(Cv, First, Last); BS = GeomConvert::CurveToBSplineCurve(TC); - CurveCleaner(BS, Abs(WL - WF) * 1.e-4, 0); + CurveCleaner(BS, std::abs(WL - WF) * 1.e-4, 0); // // Smoothing of the curve aContinuity = TC->Continuity(); @@ -4743,7 +4747,7 @@ Standard_EXPORT void ChFi3d_PerformElSpine(Handle(ChFiDS_ElSpine)& HES, TC = BS; } // - tolrac = Min(tol, epsV); + tolrac = std::min(tol, epsV); Bof = Concat.Add(TC, 2. * tolrac, Standard_True); // si l'ajout ne s'est pas bien passe on essai d'augmenter la tolerance if (!Bof) @@ -4847,11 +4851,11 @@ Standard_EXPORT void ChFi3d_PerformElSpine(Handle(ChFiDS_ElSpine)& HES, } // // Reparametrisation et segmentation sur le domaine de la Spine. - if (Abs(BSpline->FirstParameter() - WF) < tol) + if (std::abs(BSpline->FirstParameter() - WF) < tol) { WF = BSpline->FirstParameter(); } - if (Abs(BSpline->LastParameter() - WL) < tol) + if (std::abs(BSpline->LastParameter() - WL) < tol) { WL = BSpline->LastParameter(); } @@ -4919,19 +4923,19 @@ Standard_EXPORT void ChFi3d_PerformElSpine(Handle(ChFiDS_ElSpine)& HES, MultMax = BSpline->Degree() - 2; } // correction C2 or C3 (if possible) - CurveCleaner(BSpline, Abs(WL - WF) * 1.e-4, 1); - CurveCleaner(BSpline, Abs(WL - WF) * 1.e-2, MultMax); - Standard_Integer MultMin = Max(BSpline->Degree() - 4, 1); + CurveCleaner(BSpline, std::abs(WL - WF) * 1.e-4, 1); + CurveCleaner(BSpline, std::abs(WL - WF) * 1.e-2, MultMax); + Standard_Integer MultMin = std::max(BSpline->Degree() - 4, 1); for (ii = fk; ii <= lk; ii++) { if (BSpline->Multiplicity(ii) > MultMax) { - Bof = BSpline->RemoveKnot(ii, MultMax, Abs(WL - WF) / 10); + Bof = BSpline->RemoveKnot(ii, MultMax, std::abs(WL - WF) / 10); } // See C4 if (BSpline->Multiplicity(ii) > MultMin) { - Bof = BSpline->RemoveKnot(ii, MultMin, Abs(WL - WF) * 1.e-4); + Bof = BSpline->RemoveKnot(ii, MultMin, std::abs(WL - WF) * 1.e-4); } } // elspine periodic => BSpline Periodic @@ -4943,9 +4947,9 @@ Standard_EXPORT void ChFi3d_PerformElSpine(Handle(ChFiDS_ElSpine)& HES, // modified by NIZNHY-PKV Fri Dec 10 12:20:22 2010ft if (iToApproxByC2) { - Bof = BSpline->RemoveKnot(1, MultMax, Abs(WL - WF) / 10); + Bof = BSpline->RemoveKnot(1, MultMax, std::abs(WL - WF) / 10); } - // Bof = BSpline->RemoveKnot(1, MultMax, Abs(WL-WF)/10); + // Bof = BSpline->RemoveKnot(1, MultMax, std::abs(WL-WF)/10); // modified by NIZNHY-PKV Mon Dec 13 14:12:54 2010t } } @@ -4961,7 +4965,7 @@ Standard_EXPORT void ChFi3d_PerformElSpine(Handle(ChFiDS_ElSpine)& HES, ES.FirstPointAndTgt(PDeb, VrefDeb); Standard_Real scaldeb = VrefDeb.Dot(V1); Standard_Real disdeb = PDeb.Distance(P1); - if ((Abs(WF - LocalWF) < 1.e-12) && ((scaldeb <= 0.9999999) || disdeb >= tol)) + if ((std::abs(WF - LocalWF) < 1.e-12) && ((scaldeb <= 0.9999999) || disdeb >= tol)) { // Yes if there was no extension and the tangent is not the good one. adjust = Standard_True; @@ -4971,7 +4975,7 @@ Standard_EXPORT void ChFi3d_PerformElSpine(Handle(ChFiDS_ElSpine)& HES, ES.LastPointAndTgt(PFin, VrefFin); Standard_Real scalfin = VrefFin.Dot(V2); Standard_Real disfin = PFin.Distance(P2); - if ((Abs(WL - LocalWL) < 1.e-12) && ((scalfin <= 0.9999999) || disfin >= tol)) + if ((std::abs(WL - LocalWL) < 1.e-12) && ((scalfin <= 0.9999999) || disfin >= tol)) { // the same at the end adjust = Standard_True; @@ -5197,7 +5201,7 @@ Standard_Real ChFi3d_AngleEdge(const TopoDS_Vertex& Vtx, dir1.Reverse(); if (!Vtx.IsSame(TopExp::FirstVertex(E2))) dir2.Reverse(); - angle = Abs(dir1.Angle(dir2)); + angle = std::abs(dir1.Angle(dir2)); return angle; } @@ -5510,7 +5514,7 @@ Standard_Boolean ChFi3d_IsSmooth(const Handle(Geom_Curve)& C) LProp.SetParameter(t); if (!LProp.IsTangentDefined()) return Standard_False; - Curvature = Abs(LProp.Curvature()); + Curvature = std::abs(LProp.Curvature()); if (Curvature > Resolution) { C->D0(t, P1); @@ -5541,7 +5545,7 @@ Standard_Boolean ChFi3d_IsSmooth(const Handle(Geom_Curve)& C) LProp.SetParameter(t); if (!LProp.IsTangentDefined()) return Standard_False; - Curvature = Abs(LProp.Curvature()); + Curvature = std::abs(LProp.Curvature()); if (Curvature > Resolution) { C->D0(t, P1); diff --git a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_1.cxx b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_1.cxx index 01b2bf0250..aaa9601fb0 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_1.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_1.cxx @@ -286,8 +286,8 @@ static TopoDS_Edge MakeOffsetEdge(const TopoDS_Edge& theEdge, Standard_Real ParTol = 1.e-5; Standard_Real FirstDiff = aBAcurve.FirstParameter() - Params[0]; Standard_Real LastDiff = aBAcurve.LastParameter() - Params[1]; - if (Abs(FirstDiff) > ParTol || - Abs(LastDiff) > ParTol) + if (std::abs(FirstDiff) > ParTol || + std::abs(LastDiff) > ParTol) { Handle(Geom_BSplineCurve) BsplCurve = Handle(Geom_BSplineCurve)::DownCast(IntCurve); TColStd_Array1OfReal aKnots(1, BsplCurve->NbKnots()); diff --git a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_2.cxx b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_2.cxx index 569fdcc862..61e39a4f2e 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_2.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_2.cxx @@ -129,7 +129,7 @@ static void ChFi3d_CoupeParPlan(const ChFiDS_CommonPoint& compoint1, gp_Dir nor = tgt1.Crossed(d12); Handle(Geom_Plane) Plan = new Geom_Plane(P1, nor); Standard_Real scal; - scal = Abs(nor.Dot(tgt2)); + scal = std::abs(nor.Dot(tgt2)); if (scal < 0.01) { Handle(GeomAdaptor_Surface) HPlan = new GeomAdaptor_Surface(Plan); @@ -943,16 +943,16 @@ void ChFi3d_Builder::StartSol(const Handle(ChFiDS_Stripe)& Stripe, AS.Initialize(f1); ResU = AS.UResolution(TolE); ResV = AS.VResolution(TolE); - derive *= 2 * (Abs(derive.X()) * ResU + Abs(derive.Y()) * ResV); + derive *= 2 * (std::abs(derive.X()) * ResU + std::abs(derive.Y()) * ResV); P2d = P1.Translated(derive); - if (I1->Classify(P2d, Min(ResU, ResV), 0) == TopAbs_IN) + if (I1->Classify(P2d, std::min(ResU, ResV), 0) == TopAbs_IN) { P1 = P2d; } else { P2d = P1.Translated(-derive); - if (I1->Classify(P2d, Min(ResU, ResV), 0) == TopAbs_IN) + if (I1->Classify(P2d, std::min(ResU, ResV), 0) == TopAbs_IN) { P1 = P2d; } @@ -1767,7 +1767,7 @@ static void ChFi3d_MakeExtremities(Handle(ChFiDS_Stripe)& Stripe, tol3d, tolreached); Standard_Real oldtol = DStr.ChangeCurve(ICurv).Tolerance(); - DStr.ChangeCurve(ICurv).Tolerance(Max(oldtol, tolreached)); + DStr.ChangeCurve(ICurv).Tolerance(std::max(oldtol, tolreached)); if (CV1.IsOnArc()) { ChFi3d_EnlargeBox(CV1.Arc(), EFMap(CV1.Arc()), CV1.ParameterOnArc(), b1); @@ -2293,8 +2293,8 @@ void ChFi3d_Builder::PerformSetOfSurfOnElSpine(const Handle(ChFiDS_ElSpine)& Standard_Real bidf = wf, bidl = wl; if (!Spine->IsPeriodic()) { - bidf = Max(0., wf); - bidl = Min(wl, Spine->LastParameter(Spine->NbEdges())); + bidf = std::max(0., wf); + bidl = std::min(wl, Spine->LastParameter(Spine->NbEdges())); // PMN 20/07/98 : Attention in case if there is only extension if ((bidl - bidf) < 0.01 * Spine->LastParameter(Spine->NbEdges())) { @@ -2985,7 +2985,7 @@ void ChFi3d_Builder::PerformSetOfKPart(Handle(ChFiDS_Stripe)& Stripe, const Stan { // start section -> first KPart // update of extension. - Spine->SetFirstTgt(Min(0., WFirst)); + Spine->SetFirstTgt(std::min(0., WFirst)); CurrentHE->LastParameter(WFirst); CurrentHE->SetLastPointAndTgt(PFirst, TFirst); Spine->AppendElSpine(CurrentHE); @@ -3061,7 +3061,7 @@ void ChFi3d_Builder::PerformSetOfKPart(Handle(ChFiDS_Stripe)& Stripe, const Stan else { Spine->D1(Spine->LastParameter(), PLast, TLast); - Spine->SetLastTgt(Max(Spine->LastParameter(Spine->NbEdges()), WLast)); + Spine->SetLastTgt(std::max(Spine->LastParameter(Spine->NbEdges()), WLast)); if (Spine->LastParameter() - WLast > tolesp) { CurrentHE->LastParameter(Spine->LastParameter()); @@ -3431,10 +3431,10 @@ void ChFi3d_Builder::PerformSetOfKGen(Handle(ChFiDS_Stripe)& Stripe, const Stand curs2 = cursd->IndexOfC2(); else curs2 = cursd->IndexOfS2(); - Standard_Real tol1 = Max(curp1.Tolerance(), nextp1.Tolerance()); + Standard_Real tol1 = std::max(curp1.Tolerance(), nextp1.Tolerance()); ChFiDS_CommonPoint& curp2 = cursd->ChangeVertexLastOnS2(); ChFiDS_CommonPoint& nextp2 = nextsd->ChangeVertexFirstOnS2(); - Standard_Real tol2 = Max(curp2.Tolerance(), nextp2.Tolerance()); + Standard_Real tol2 = std::max(curp2.Tolerance(), nextp2.Tolerance()); if (nextsd->IsOnCurve1()) nexts1 = nextsd->IndexOfC1(); else diff --git a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_6.cxx b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_6.cxx index d3d22d2963..64105e030d 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_6.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_6.cxx @@ -295,11 +295,11 @@ static void CompParam(const Geom2dAdaptor_Curve& Carc, int2d = Intersection.Point(i); p1 = int2d.ParamOnFirst(); p2 = int2d.ParamOnSecond(); - if (Abs(prefarc - p2) < dist) + if (std::abs(prefarc - p2) < dist) { ptg = p1; parc = p2; - dist = Abs(prefarc - p2); + dist = std::abs(prefarc - p2); found = 1; } } @@ -703,7 +703,7 @@ Standard_Boolean ChFi3d_Builder::StoreData(Handle(ChFiDS_SurfData)& Data Handle(Geom_BoundedSurface) aBndSurf = Surf; Standard_Boolean ext1 = Standard_False, ext2 = Standard_False; - Standard_Real eps = Max(tolget3d, 2. * Precision::Confusion()); + Standard_Real eps = std::max(tolget3d, 2. * Precision::Confusion()); if (length1 > eps) { gp_Pnt P11, P21; @@ -957,7 +957,7 @@ Standard_Boolean ChFi3d_Builder::StoreData(Handle(ChFiDS_SurfData)& Data { aDenom++; - if (Abs(aDeltav) <= tolget2d) + if (std::abs(aDeltav) <= tolget2d) return Standard_False; continue; @@ -1762,7 +1762,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData(Handle(ChFiDS_SurfData)& } else { - Target = SpLast + Abs(SpLast); + Target = SpLast + std::abs(SpLast); if (!intl) Target = Last; } @@ -1846,9 +1846,10 @@ Standard_Boolean ChFi3d_Builder::ComputeData(Handle(ChFiDS_SurfData)& TopoDS_Face bif; // Max step is relevant, but too great, the vector is required to detect // the twists. - if ((Abs(Last - First) <= MS * 5.) && (Abs(Last - First) >= 0.01 * Abs(NewFirst - Target))) + if ((std::abs(Last - First) <= MS * 5.) + && (std::abs(Last - First) >= 0.01 * std::abs(NewFirst - Target))) { - MS = Abs(Last - First) * 0.2; + MS = std::abs(Last - First) * 0.2; } while (again < 3) @@ -1966,7 +1967,7 @@ Standard_Boolean ChFi3d_Builder::ComputeData(Handle(ChFiDS_SurfData)& } else if (again == 1) { - if (Abs(fpointpar - u1sov) >= TolGuide || Abs(lpointpar - u2sov) >= TolGuide) + if (std::abs(fpointpar - u1sov) >= TolGuide || std::abs(lpointpar - u2sov) >= TolGuide) { #ifdef OCCT_DEBUG std::cout << "Number of points is still too small, the step is reduced" << std::endl; @@ -2351,9 +2352,9 @@ Standard_Boolean ChFi3d_Builder::ComputeData(Handle(ChFiDS_SurfData)& } if (Gd1 && Gd2) { - Target = Min((Lin->Point(1).Parameter() - Rab), First); - Target = Max(Target, SpFirst); - Data->FirstExtensionValue(Abs(Lin->Point(1).Parameter() - Target)); + Target = std::min((Lin->Point(1).Parameter() - Rab), First); + Target = std::max(Target, SpFirst); + Data->FirstExtensionValue(std::abs(Lin->Point(1).Parameter() - Target)); } if (intf && !unseulsuffitdeb) intf = (Gd1 && Gd2) //; @@ -2420,9 +2421,9 @@ Standard_Boolean ChFi3d_Builder::ComputeData(Handle(ChFiDS_SurfData)& } if (Gf1 && Gf2) { - Target = Max((Lin->Point(Nbpnt).Parameter() + Rab), Last); - Target = Min(Target, SpLast); - Data->LastExtensionValue(Abs(Target - Lin->Point(Nbpnt).Parameter())); + Target = std::max((Lin->Point(Nbpnt).Parameter() + Rab), Last); + Target = std::min(Target, SpLast); + Data->LastExtensionValue(std::abs(Target - Lin->Point(Nbpnt).Parameter())); } if (intl && !unseulsuffitfin) @@ -2596,7 +2597,7 @@ Standard_Boolean ChFi3d_Builder::SimulData(Handle(ChFiDS_SurfData)& /*Data*/, { Standard_Real u1 = Lin->Point(1).Parameter(); Standard_Real u2 = Lin->Point(Nbpnt).Parameter(); - if (Abs(u1 - u1sov) >= TolGuide || Abs(u2 - u2sov) >= TolGuide) + if (std::abs(u1 - u1sov) >= TolGuide || std::abs(u2 - u2sov) >= TolGuide) { again++; #ifdef OCCT_DEBUG diff --git a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_C1.cxx b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_C1.cxx index 90d1a1ab99..157d5f6c15 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_C1.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_C1.cxx @@ -131,7 +131,7 @@ static Standard_Real recadre(const Standard_Real p, pp -= (last - first); else pp += (last - first); - if (Abs(pp - ref) < Abs(p - ref)) + if (std::abs(pp - ref) < std::abs(p - ref)) return pp; return p; } @@ -215,10 +215,10 @@ static Standard_Boolean Update(const Handle(Adaptor3d_Surface)& fb, w = Intersection.Point(i).W(); if (isperiodic) w = recadre(w, wop, isfirst, uf, ul); - if (uf <= w && ul >= w && Abs(w - wop) < dist) + if (uf <= w && ul >= w && std::abs(w - wop) < dist) { isol = i; - dist = Abs(w - wop); + dist = std::abs(w - wop); } } if (isperiodic) @@ -226,12 +226,12 @@ static Standard_Boolean Update(const Handle(Adaptor3d_Surface)& fb, for (i = 1; i <= nbp; i++) { w = Intersection.Point(i).W(); - if (uf <= w && ul >= w && Abs(w - wop) < distbis - && (Abs(w - ul) <= 0.01 || Abs(w - uf) <= 0.01)) + if (uf <= w && ul >= w && std::abs(w - wop) < distbis + && (std::abs(w - ul) <= 0.01 || std::abs(w - uf) <= 0.01)) { isolbis = i; wbis = recadre(w, wop, isfirst, uf, ul); - distbis = Abs(wbis - wop); + distbis = std::abs(wbis - wop); recadrebis = Standard_True; } } @@ -347,8 +347,8 @@ static Standard_Boolean Update(const Handle(Adaptor3d_Surface)& face, Standard_Real f = fi.FirstParameter(); Standard_Real l = fi.LastParameter(); Standard_Real delta = 0.1 * (l - f); - f = Max(f - delta, pc->FirstParameter()); - l = Min(l + delta, pc->LastParameter()); + f = std::max(f - delta, pc->FirstParameter()); + l = std::min(l + delta, pc->LastParameter()); Handle(Geom2dAdaptor_Curve) hpc = new Geom2dAdaptor_Curve(pc, f, l); Adaptor3d_CurveOnSurface c2(hpc, surf); @@ -951,7 +951,7 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index, par1 = ponc1.Parameter(); par2 = ponc2.Parameter(); Standard_Real Tol = 1.e-4; - if (Abs(par2 - Udeb) > Tol && Abs(Ufin - par2) > Tol) + if (std::abs(par2 - Udeb) > Tol && std::abs(Ufin - par2) > Tol) { gp_Pnt P1 = ponc1.Value(); TopOpeBRepDS_Point tpoint(P1, Tol); @@ -1245,7 +1245,7 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index, Standard_Real pard, parf; pard = BRep_Tool::Parameter(Vdeb, edgecouture); parf = BRep_Tool::Parameter(Vfin, edgecouture); - if (Abs(par1 - pard) < Abs(parf - par1)) + if (std::abs(par1 - pard) < std::abs(parf - par1)) ori = TopAbs_FORWARD; else ori = TopAbs_REVERSED; @@ -1418,7 +1418,7 @@ void ChFi3d_Builder::PerformOneCorner(const Standard_Integer Index, Standard_Real pard, parf; pard = BRep_Tool::Parameter(Vdeb, edgecouture); parf = BRep_Tool::Parameter(Vfin, edgecouture); - if (Abs(par1 - pard) < Abs(parf - par1)) + if (std::abs(par1 - pard) < std::abs(parf - par1)) ori = TopAbs_REVERSED; else ori = TopAbs_FORWARD; @@ -1656,7 +1656,8 @@ static Standard_Boolean IsShrink(const Geom2dAdaptor_Curve& PC, case GeomAbs_Line: { gp_Pnt2d P1 = PC.Value(Pf); gp_Pnt2d P2 = PC.Value(Pl); - if (Abs(P1.Coord(isU ? 1 : 2) - Param) <= tol && Abs(P2.Coord(isU ? 1 : 2) - Param) <= tol) + if (std::abs(P1.Coord(isU ? 1 : 2) - Param) <= tol + && std::abs(P2.Coord(isU ? 1 : 2) - Param) <= tol) return Standard_True; else return Standard_False; @@ -1668,7 +1669,7 @@ static Standard_Boolean IsShrink(const Geom2dAdaptor_Curve& PC, for (i = 1; i <= aSample.NbPoints(); i++) { gp_Pnt2d P = PC.Value(aSample.GetParameter(i)); - if (Abs(P.Coord(isU ? 1 : 2) - Param) > tol) + if (std::abs(P.Coord(isU ? 1 : 2) - Param) > tol) return Standard_False; } return Standard_True; @@ -1939,12 +1940,12 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) if (checkShrink) { - if (Abs(P2d2.Y() - P2d4.Y()) <= Precision::PConfusion()) + if (std::abs(P2d2.Y() - P2d4.Y()) <= Precision::PConfusion()) { isUShrink = Standard_False; checkShrParam = P2d2.Y(); } - else if (Abs(P2d2.X() - P2d4.X()) <= Precision::PConfusion()) + else if (std::abs(P2d2.X() - P2d4.X()) <= Precision::PConfusion()) { isUShrink = Standard_True; checkShrParam = P2d2.X(); @@ -2259,7 +2260,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) ChFi3d_cherche_vertex(Edge[0], Edge[1], Vcom, trouve); if (Vcom.IsSame(Vtx)) ang1 = ChFi3d_AngleEdge(Vtx, Edge[0], Edge[1]); - if (Abs(ang1 - M_PI) < 0.01) + if (std::abs(ang1 - M_PI) < 0.01) { oneintersection1 = Standard_True; facesau = Face[0]; @@ -2275,7 +2276,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) ChFi3d_cherche_vertex(Edge[1], Edge[2], Vcom, trouve); if (Vcom.IsSame(Vtx)) ang1 = ChFi3d_AngleEdge(Vtx, Edge[1], Edge[2]); - if (Abs(ang1 - M_PI) < 0.01) + if (std::abs(ang1 - M_PI) < 0.01) { oneintersection2 = Standard_True; facesau = Face[1]; @@ -2514,7 +2515,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) Handle(Geom_BoundedSurface)::DownCast(DStr.Surface(Fd->Surf()).Surface()); if (!S1.IsNull()) { - Standard_Real length = 0.5 * Max(Fi1Length, Fi2Length); + Standard_Real length = 0.5 * std::max(Fi1Length, Fi2Length); GeomLib::ExtendSurfByLength(S1, length, 1, Standard_False, !isfirst); prolface[nn] = 1; if (!stripe->IsInDS(!isfirst)) @@ -2754,9 +2755,9 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) // deb=pfildeb.X(); // xx1=pfil1.X(); // xx2=pfil2.X(); - // moins2pi=Abs(deb)< Abs(Abs(deb)-2*M_PI); - // moins2pi1=Abs(xx1)< Abs(Abs(xx1)-2*M_PI); - // moins2pi2=Abs(xx2)< Abs(Abs(xx2)-2*M_PI); + // moins2pi=std::abs(deb)< std::abs(std::abs(deb)-2*M_PI); + // moins2pi1=std::abs(xx1)< std::abs(std::abs(xx1)-2*M_PI); + // moins2pi2=std::abs(xx2)< std::abs(std::abs(xx2)-2*M_PI); // if (moins2pi1!=moins2pi2) { // if (moins2pi) { // if (!moins2pi1) xx1=xx1-2*M_PI; @@ -2777,9 +2778,9 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) // deb=ufmin; // xx1=pfac1.X(); // xx2=pfac2.X(); - // moins2pi=Abs(deb)< Abs(Abs(deb)-2*M_PI); - // moins2pi1=Abs(xx1)< Abs(Abs(xx1)-2*M_PI); - // moins2pi2=Abs(xx2)< Abs(Abs(xx2)-2*M_PI); + // moins2pi=std::abs(deb)< std::abs(std::abs(deb)-2*M_PI); + // moins2pi1=std::abs(xx1)< std::abs(std::abs(xx1)-2*M_PI); + // moins2pi2=std::abs(xx2)< std::abs(std::abs(xx2)-2*M_PI); // if (moins2pi1!=moins2pi2) { // if (moins2pi) { // if (!moins2pi1) xx1=xx1-2*M_PI; @@ -2846,8 +2847,8 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) Ps->D0(p2, p2d2); HGs->D0(p2d1.X(), p2d1.Y(), P5); HGs->D0(p2d2.X(), p2d2.Y(), P6); - to1 = Max(P1.Distance(P5) + P3.Distance(P7), tolreached); - to2 = Max(P2.Distance(P6) + P4.Distance(P8), tolreached); + to1 = std::max(P1.Distance(P5) + P3.Distance(P7), tolreached); + to2 = std::max(P2.Distance(P6) + P4.Distance(P8), tolreached); ////////////////////////////////////////////////////////////////////// // storage in the DS of the intersection curve @@ -2863,7 +2864,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) if (!CV1.IsVertex()) { TopOpeBRepDS_Point& tpt = DStr.ChangePoint(indpoint1); - tpt.Tolerance(Max(tpt.Tolerance(), to1)); + tpt.Tolerance(std::max(tpt.Tolerance(), to1)); } else Isvtx1 = 1; @@ -2874,7 +2875,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) if (!CV2.IsVertex()) { TopOpeBRepDS_Point& tpt = DStr.ChangePoint(indpoint2); - tpt.Tolerance(Max(tpt.Tolerance(), to2)); + tpt.Tolerance(std::max(tpt.Tolerance(), to2)); } else Isvtx2 = 1; @@ -2889,7 +2890,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) if (nb != 1) { TopOpeBRepDS_Point& tpt = DStr.ChangePoint(indpoint1); - tpt.Tolerance(Max(tpt.Tolerance(), to1)); + tpt.Tolerance(std::max(tpt.Tolerance(), to1)); } TopOpeBRepDS_Curve tcurv3d(Cc, tolreached); indcurve[nb - 1] = DStr.AddCurve(tcurv3d); @@ -3102,7 +3103,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) Geom2dAPI_ProjectPointOnCurve Projector(P2d, C2dint1); par = Projector.LowerDistanceParameter(); Standard_Real shift = par - ParVtx; - if (Abs(shift) > Precision::Confusion()) + if (std::abs(shift) > Precision::Confusion()) { par1 += shift; par2 += shift; @@ -3118,11 +3119,11 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) Handle(GeomAdaptor_Surface) H1, H2; H1 = new GeomAdaptor_Surface(Sfacemoins1); if (Sface.IsNull()) - tolex = Max(tolex, ChFi3d_EvalTolReached(H1, C2dint1, H1, C2dint1, Ct)); + tolex = std::max(tolex, ChFi3d_EvalTolReached(H1, C2dint1, H1, C2dint1, Ct)); else { H2 = new GeomAdaptor_Surface(Sface); - tolex = Max(tolex, ChFi3d_EvalTolReached(H1, C2dint1, H2, C2dint2, Ct)); + tolex = std::max(tolex, ChFi3d_EvalTolReached(H1, C2dint1, H2, C2dint2, Ct)); } } TopOpeBRepDS_Curve tcurv(Ct, tolex); @@ -3194,7 +3195,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) tolapp3d, aTolreached); TopOpeBRepDS_Curve& TCurv = DStr.ChangeCurve(indcurve[nb - 1]); - TCurv.Tolerance(Max(TCurv.Tolerance(), aTolreached)); + TCurv.Tolerance(std::max(TCurv.Tolerance(), aTolreached)); InterfPS[nb - 1] = ChFi3d_FilCurveInDS(indcurve[nb - 1], IsurfPrev, Ps, orcourbe); DStr.ChangeSurfaceInterferences(IsurfPrev).Append(InterfPS[nb - 1]); @@ -3303,7 +3304,7 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) ChFi3d_ComputePCurv(C3d, UV1, UV2, Pc, aSurf, p1, p2, tolapp3d, aTolreached); - Crv.Tolerance(Max(Crv.Tolerance(), aTolreached)); + Crv.Tolerance(std::max(Crv.Tolerance(), aTolreached)); Interfc = ChFi3d_FilCurveInDS(Icurv, IsurfPrev, Pc, TopAbs::Reverse(orcourbe)); DStr.ChangeSurfaceInterferences(IsurfPrev).Append(Interfc); @@ -3349,9 +3350,9 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) { const IntRes2d_IntersectionPoint& ip = Intersector.Point(nb); gp_Pnt Pint = C3d->Value(ip.ParamOnFirst()); - tol = Max(tol, Pvert.Distance(Pint)); + tol = std::max(tol, Pvert.Distance(Pint)); Pint = Cend->Value(ip.ParamOnSecond()); - tol = Max(tol, Pvert.Distance(Pint)); + tol = std::max(tol, Pvert.Distance(Pint)); } for (nb = 1; nb <= Intersector.NbSegments(); nb++) { @@ -3360,17 +3361,17 @@ void ChFi3d_Builder::PerformIntersectionAtEnd(const Standard_Integer Index) { const IntRes2d_IntersectionPoint& ip = is.FirstPoint(); gp_Pnt Pint = C3d->Value(ip.ParamOnFirst()); - tol = Max(tol, Pvert.Distance(Pint)); + tol = std::max(tol, Pvert.Distance(Pint)); Pint = Cend->Value(ip.ParamOnSecond()); - tol = Max(tol, Pvert.Distance(Pint)); + tol = std::max(tol, Pvert.Distance(Pint)); } if (is.HasLastPoint()) { const IntRes2d_IntersectionPoint& ip = is.LastPoint(); gp_Pnt Pint = C3d->Value(ip.ParamOnFirst()); - tol = Max(tol, Pvert.Distance(Pint)); + tol = std::max(tol, Pvert.Distance(Pint)); Pint = Cend->Value(ip.ParamOnSecond()); - tol = Max(tol, Pvert.Distance(Pint)); + tol = std::max(tol, Pvert.Distance(Pint)); } } Pds.Tolerance(tol); @@ -4595,7 +4596,7 @@ void ChFi3d_Builder::IntersectMoreCorner(const Standard_Integer Index) par1 = ponc1.Parameter(); par2 = ponc2.Parameter(); Standard_Real Tol = 1.e-4; - if (Abs(par2 - Udeb) > Tol && Abs(Ufin - par2) > Tol) + if (std::abs(par2 - Udeb) > Tol && std::abs(Ufin - par2) > Tol) { gp_Pnt P1 = ponc1.Value(); TopOpeBRepDS_Point tpoint(P1, Tol); @@ -4703,7 +4704,7 @@ void ChFi3d_Builder::IntersectMoreCorner(const Standard_Integer Index) Standard_Real pard, parf; pard = BRep_Tool::Parameter(Vdeb, edgecouture); parf = BRep_Tool::Parameter(Vfin, edgecouture); - if (Abs(par1 - pard) < Abs(parf - par1)) + if (std::abs(par1 - pard) < std::abs(parf - par1)) ori = TopAbs_FORWARD; else ori = TopAbs_REVERSED; diff --git a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_C2.cxx b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_C2.cxx index cad70cb041..1d035d5908 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_C2.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_C2.cxx @@ -386,10 +386,10 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer Standard_Integer Ipoin2; ChFiDS_CommonPoint& cpco1 = Fd1->ChangeVertex(isfirst1, IFaCo1); ChFiDS_CommonPoint& cpco2 = Fd2->ChangeVertex(isfirst2, IFaCo2); - Standard_Real tolpco = Max(cpco1.Tolerance(), cpco2.Tolerance()); + Standard_Real tolpco = std::max(cpco1.Tolerance(), cpco2.Tolerance()); ChFiDS_CommonPoint& cparc1 = Fd1->ChangeVertex(isfirst1, IFaArc1); ChFiDS_CommonPoint& cparc2 = Fd2->ChangeVertex(isfirst2, IFaArc2); - Standard_Real tolparc = Max(cparc1.Tolerance(), cparc2.Tolerance()); + Standard_Real tolparc = std::max(cparc1.Tolerance(), cparc2.Tolerance()); Standard_Integer ICurv = DStr.AddCurve(TopOpeBRepDS_Curve(Gc, tolreached)); // Corner1 Corner1->SetParameters(isfirst1, WFirst, WLast); @@ -397,10 +397,10 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer Corner1->ChangePCurve(isfirst1) = PGc1; cpco1.Reset(); cpco1.SetPoint(PFaCo); - cpco1.SetTolerance(Max(tolreached, tolpco)); + cpco1.SetTolerance(std::max(tolreached, tolpco)); Fd1->ChangeInterference(IFaCo1).SetParameter(UIntPC1, isfirst1); - tolparc = Max(tolparc, tolreached); - cparc1.SetTolerance(Max(tolparc, tolreached)); + tolparc = std::max(tolparc, tolreached); + cparc1.SetTolerance(std::max(tolparc, tolreached)); Ipoin1 = ChFi3d_IndexPointInDS(Fd1->Vertex(isfirst1, 1), DStr); Corner1->SetIndexPoint(Ipoin1, isfirst1, 1); Ipoin2 = ChFi3d_IndexPointInDS(Fd1->Vertex(isfirst1, 2), DStr); @@ -575,7 +575,7 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer Standard_Integer IpointCo, IpointMil, IpointArc; ChFiDS_CommonPoint& psmaco = SmaFD->ChangeVertex(isfirstSma, IFaCoSma); ChFiDS_CommonPoint& pbigco = BigFD->ChangeVertex(isfirstBig, IFaCoBig); - Standard_Real tolpco = Max(psmaco.Tolerance(), pbigco.Tolerance()); + Standard_Real tolpco = std::max(psmaco.Tolerance(), pbigco.Tolerance()); ChFiDS_CommonPoint& psmamil = SmaFD->ChangeVertex(isfirstSma, IFaArcSma); Standard_Real tolpmil = psmamil.Tolerance(); Standard_Integer ICurv = DStr.AddCurve(TopOpeBRepDS_Curve(Gc, tolreached)); @@ -585,11 +585,11 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer SmaCD->ChangePCurve(isfirstSma) = PGc1; psmaco.Reset(); psmaco.SetPoint(PFaCo); - psmaco.SetTolerance(Max(tolpco, tolreached)); + psmaco.SetTolerance(std::max(tolpco, tolreached)); SmaFD->ChangeInterference(IFaCoSma).SetParameter(UIntPCSma, isfirstSma); psmamil.Reset(); psmamil.SetPoint(PMil); - psmamil.SetTolerance(Max(tolpmil, tolreached)); + psmamil.SetTolerance(std::max(tolpmil, tolreached)); SmaFD->ChangeInterference(IFaArcSma).SetParameter(wi, isfirstSma); IpointCo = ChFi3d_IndexPointInDS(psmaco, DStr); SmaCD->SetIndexPoint(IpointCo, isfirstSma, IFaCoSma); @@ -646,8 +646,8 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer Standard_Real lsma = FiArcSma.LastParameter(); Standard_Real deltSma = 0.05 * (lsma - fsma); Handle(Geom2d_Curve) pcpc = SmaFD->Interference(IFaArcSma).PCurveOnFace(); - fsma = Max(pcpc->FirstParameter(), wi - deltSma); - lsma = Min(pcpc->LastParameter(), wi + deltSma); + fsma = std::max(pcpc->FirstParameter(), wi - deltSma); + lsma = std::min(pcpc->LastParameter(), wi + deltSma); if (lsma < fsma) { done = Standard_False; @@ -717,7 +717,7 @@ Standard_Boolean ChFi3d_Builder::PerformTwoCornerbyInter(const Standard_Integer WFirst = Gc->FirstParameter(); WLast = Gc->LastParameter(); ICurv = DStr.AddCurve(TopOpeBRepDS_Curve(Gc, tolreached)); - cpend.SetTolerance(Max(cpend.Tolerance(), tolreached)); + cpend.SetTolerance(std::max(cpend.Tolerance(), tolreached)); IpointArc = ChFi3d_IndexPointInDS(cpend, DStr); BigCD->SetIndexPoint(IpointArc, isfirstBig, IFaArcBig); diff --git a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_CnCrn.cxx b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_CnCrn.cxx index 74ed45f729..289674eeeb 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_CnCrn.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_CnCrn.cxx @@ -330,13 +330,13 @@ static void CurveHermite(const TopOpeBRepDS_DataStructure& DStr, TColgp_Array1OfXYZ Cont(1, size); PLib::HermiteCoefficients(0, 1, 1, 1, MatCoefs); Standard_Real L1 = p01.Distance(p02); - Standard_Real lambda = ((Standard_Real)1) / Max(d11.Magnitude() / L1, 1.e-6); + Standard_Real lambda = ((Standard_Real)1) / std::max(d11.Magnitude() / L1, 1.e-6); Cont(1) = p01.XYZ(); if (sensicmoins == 1) Cont(2) = d11.XYZ() * (-lambda); else Cont(2) = d11.XYZ() * (lambda); - lambda = ((Standard_Real)1) / Max(d12.Magnitude() / L1, 1.e-6); + lambda = ((Standard_Real)1) / std::max(d12.Magnitude() / L1, 1.e-6); Cont(3) = p02.XYZ(); if (sensicplus == 1) Cont(4) = d12.XYZ() * (lambda); @@ -538,12 +538,12 @@ static void CalculBatten(const Handle(GeomAdaptor_Surface)& ASurf, else ang2 = -M_PI - dir1.Angle(dir4); if (contraint1 && contraint2) - anglebig = (Abs(ang1) > 1.2) || (Abs(ang2) > 1.2); + anglebig = (std::abs(ang1) > 1.2) || (std::abs(ang2) > 1.2); else if (contraint1) - anglebig = Abs(ang1) > 1.2; + anglebig = std::abs(ang1) > 1.2; else if (contraint2) - anglebig = Abs(ang2) > 1.2; - if (isplane && (Abs(ang1) > M_PI / 2 || Abs(ang2) > M_PI / 2)) + anglebig = std::abs(ang2) > 1.2; + if (isplane && (std::abs(ang1) > M_PI / 2 || std::abs(ang2) > M_PI / 2)) isplane = Standard_False; if (anglebig && !isplane) { @@ -1108,8 +1108,8 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex, if (bordlibre) { nedge = (nedge - 2) / 2 + 2; - Standard_Real angedg = Abs(ChFi3d_AngleEdge(V1, edgelibre1, edgelibre2)); - droit = Abs(angedg - M_PI) < 0.01; + Standard_Real angedg = std::abs(ChFi3d_AngleEdge(V1, edgelibre1, edgelibre2)); + droit = std::abs(angedg - M_PI) < 0.01; } else nedge = nedge / 2; @@ -1392,8 +1392,8 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex, if (ind != ic) { TopoDS_Edge ecur = TopoDS::Edge(Evive.Value(ind)); - Standard_Real ang = Abs(ChFi3d_AngleEdge(V1, ecur, ereg)); - if (ang < 0.01 || Abs(ang - M_PI) < 0.01) + Standard_Real ang = std::abs(ChFi3d_AngleEdge(V1, ecur, ereg)); + if (ang < 0.01 || std::abs(ang - M_PI) < 0.01) { regul.SetValue(ic, Standard_False); tangentregul.SetValue(ic, Standard_True); @@ -1421,7 +1421,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex, { E1 = TopoDS::Edge(Evive.Value(ic)); E2 = TopoDS::Edge(Evive.Value(icplus)); - deuxconges = (Abs(ChFi3d_AngleEdge(V1, E1, E2)) < 0.01); + deuxconges = (std::abs(ChFi3d_AngleEdge(V1, E1, E2)) < 0.01); trouve = deuxconges; } } @@ -1442,8 +1442,8 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex, if (!E1.IsSame(edgelibre1) && !E1.IsSame(edgelibre2) && !E2.IsSame(edgelibre1) && !E2.IsSame(edgelibre2)) { - Standard_Real ang = Abs(ChFi3d_AngleEdge(V1, E1, E2)); - deuxconges = (ang < 0.01 || Abs(ang - M_PI) < 0.01); + Standard_Real ang = std::abs(ChFi3d_AngleEdge(V1, E1, E2)); + deuxconges = (ang < 0.01 || std::abs(ang - M_PI) < 0.01); } } } @@ -1515,8 +1515,8 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex, { ChFi3d_cherche_vertex(Arc, cp1.Arc(), Vcom, trouve); if (trouve) - angedg = Abs(ChFi3d_AngleEdge(Vcom, Arc, cp1.Arc())); - if (!cp1.Arc().IsSame(Arc) && Abs(angedg - M_PI) < 0.01) + angedg = std::abs(ChFi3d_AngleEdge(Vcom, Arc, cp1.Arc())); + if (!cp1.Arc().IsSame(Arc) && std::abs(angedg - M_PI) < 0.01) { Evive.SetValue(ic, cp1.Arc()); ChFi3d_edge_common_faces(myEFMap(cp1.Arc()), F1, F2); @@ -1556,8 +1556,8 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex, angedg = M_PI; ChFi3d_cherche_vertex(Arc, cp2.Arc(), Vcom, trouve); if (trouve) - angedg = Abs(ChFi3d_AngleEdge(Vcom, Arc, cp2.Arc())); - if (!cp2.Arc().IsSame(Arc) && Abs(angedg - M_PI) < 0.01) + angedg = std::abs(ChFi3d_AngleEdge(Vcom, Arc, cp2.Arc())); + if (!cp2.Arc().IsSame(Arc) && std::abs(angedg - M_PI) < 0.01) { Evive.SetValue(ic, cp2.Arc()); ChFi3d_edge_common_faces(myEFMap(cp2.Arc()), F1, F2); @@ -1646,9 +1646,9 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex, Standard_Real angedg; Standard_Integer iface; // if two edges are tangent the intersection is not attempted (cts60046) - angedg = - Abs(ChFi3d_AngleEdge(V1, TopoDS::Edge(Evive.Value(ic)), TopoDS::Edge(Evive.Value(icplus)))); - if (Abs(angedg - M_PI) > 0.01) + angedg = std::abs( + ChFi3d_AngleEdge(V1, TopoDS::Edge(Evive.Value(ic)), TopoDS::Edge(Evive.Value(icplus)))); + if (std::abs(angedg - M_PI) > 0.01) ok = ChFi3d_SearchFD(DStr, CD.Value(ic), CD.Value(icplus), @@ -2549,7 +2549,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex, jfp = 3 - jf.Value(icplus); cp = CD.Value(icplus)->SetOfSurfData()->Value(i.Value(icplus, ic))->ChangeVertex(isfirst, jfp); - if (cp.Point().Distance(PE) <= Max(1.e-4, tolcp)) + if (cp.Point().Distance(PE) <= std::max(1.e-4, tolcp)) { // edge was limited by the 1st CommonPoint of CD[icplus] indpoint.SetValue(ic, 0, indpoint.Value(icplus, 0)); @@ -2563,7 +2563,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex, ->SetOfSurfData() ->Value(i.Value(icmoins, ic)) ->ChangeVertex(isfirst, jf.Value(icmoins)); - if (cp.Point().Distance(PE) <= Max(1.e-4, tolcp)) + if (cp.Point().Distance(PE) <= std::max(1.e-4, tolcp)) { // edge was limited by the 2nd CommonPoint of CD[icmoins] if (indpoint.Value(ic, 0) == 0) @@ -3134,7 +3134,7 @@ void ChFi3d_Builder::PerformMoreThreeCorner(const Standard_Integer Jndex, S3d.Clear(); PSurf.Disc2dContour(4, S2d); PSurf.Disc3dContour(4, 0, S3d); - seuil = Max(tolapp, 10 * PSurf.G0Error()); + seuil = std::max(tolapp, 10 * PSurf.G0Error()); GeomPlate_PlateG0Criterion critere(S2d, S3d, seuil); GeomPlate_MakeApprox Mapp(gpPlate, critere, tolapp, nbcarreau, degmax); Handle(Geom_Surface) Surf(Mapp.Surface()); diff --git a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_SpKP.cxx b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_SpKP.cxx index 441581b23b..36712075cc 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_SpKP.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_Builder_SpKP.cxx @@ -995,20 +995,20 @@ Standard_Boolean ChFi3d_Builder::SplitKPart(const Handle(ChFiDS_SurfData)& D { ptg = CD1->InterferenceOnS1().FirstParameter(); dsp = ComputeAbscissa(ed, ptg); - if (Abs(dsp) < dist) + if (std::abs(dsp) < dist) { ifirst = i1; - dist = Abs(dsp); + dist = std::abs(dsp); } } else if (CP2.IsOnArc() && !SearchFace(Spine, CP2, F2, FBID)) { ptg = CD1->InterferenceOnS2().FirstParameter(); dsp = ComputeAbscissa(ed, ptg); - if (Abs(dsp) < dist) + if (std::abs(dsp) < dist) { ifirst = i1; - dist = Abs(dsp); + dist = std::abs(dsp); } } } @@ -1121,20 +1121,20 @@ Standard_Boolean ChFi3d_Builder::SplitKPart(const Handle(ChFiDS_SurfData)& D { ptg = CD3->InterferenceOnS1().LastParameter(); dsp = -ComputeAbscissa(ed, ptg) - f + l; - if (Abs(dsp) < dist) + if (std::abs(dsp) < dist) { ilast = i2; - dist = Abs(dsp); + dist = std::abs(dsp); } } else if (CP2.IsOnArc() && !SearchFace(Spine, CP2, F2, FBID)) { ptg = CD3->InterferenceOnS2().LastParameter(); dsp = -ComputeAbscissa(ed, ptg) - f + l; - if (Abs(dsp) < dist) + if (std::abs(dsp) < dist) { ilast = i2; - dist = Abs(dsp); + dist = std::abs(dsp); } } } diff --git a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_ChBuilder.cxx b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_ChBuilder.cxx index 61d6f8ee02..efb6f09da1 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_ChBuilder.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_ChBuilder.cxx @@ -130,13 +130,13 @@ void ExtentSpineOnCommonFace(Handle(ChFiDS_Spine)& Spine1, // a1+a2 = alpha Standard_Real temp; temp = cosalpha + dis2 / dis1; - if (Abs(temp) > tolesp) + if (std::abs(temp) > tolesp) { tga1 = sinalpha / temp; d1plus = dis1 / tga1; } temp = cosalpha + dis1 / dis2; - if (Abs(temp) > tolesp) + if (std::abs(temp) > tolesp) { tga2 = sinalpha / temp; d2plus = dis2 / tga2; @@ -334,7 +334,7 @@ void ChFi3d_ChBuilder::Add(const Standard_Real Dis1, Standard_Real Offset = -1; if (myMode == ChFiDS_ConstThroatWithPenetrationChamfer) { - Offset = Min(Dis1, Dis2); + Offset = std::min(Dis1, Dis2); } Spine->SetEdges(E_wnt); @@ -663,8 +663,8 @@ void ChFi3d_ChBuilder::SimulKPart(const Handle(ChFiDS_SurfData)& SD) const case GeomAbs_Plane: { v1 = p1f.Y(); v2 = p2f.Y(); - u1 = Max(p1f.X(), p2f.X()); - u2 = Min(p1l.X(), p2l.X()); + u1 = std::max(p1f.X(), p2f.X()); + u2 = std::min(p1l.X(), p2l.X()); sec = new ChFiDS_SecHArray1(1, 2); gp_Pln Pl = AS.Plane(); ChFiDS_CircSection& sec1 = sec->ChangeValue(1); @@ -676,8 +676,8 @@ void ChFi3d_ChBuilder::SimulKPart(const Handle(ChFiDS_SurfData)& SD) const case GeomAbs_Cone: { v1 = p1f.Y(); v2 = p2f.Y(); - u1 = Max(p1f.X(), p2f.X()); - u2 = Min(p1l.X(), p2l.X()); + u1 = std::max(p1f.X(), p2f.X()); + u2 = std::min(p1l.X(), p2l.X()); Standard_Real ang = (u2 - u1); gp_Cone Co = AS.Cone(); Standard_Real rad = Co.RefRadius(), sang = Co.SemiAngle(); @@ -762,7 +762,7 @@ Standard_Boolean ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& { Standard_Real dis; chsp->GetDist(dis); - radius = Max(dis, radiusspine); + radius = std::max(dis, radiusspine); locfleche = radius * 1.e-2; // graphic criterion std::unique_ptr pFunc; @@ -901,8 +901,8 @@ Standard_Boolean ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& { Standard_Real dis1, dis2; chsp->Dists(dis1, dis2); - radius = Max(dis1, dis2); - radius = Max(radius, radiusspine); + radius = std::max(dis1, dis2); + radius = std::max(radius, radiusspine); locfleche = radius * 1.e-2; // graphic criterion std::unique_ptr pFunc; @@ -933,7 +933,7 @@ Standard_Boolean ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& } pFunc.reset(new BRepBlend_ConstThroatWithPenetration(S1, S2, OffsetHGuide)); pFInv.reset(new BRepBlend_ConstThroatWithPenetrationInv(S1, S2, OffsetHGuide)); - Standard_Real Throat = Max(dis1, dis2); + Standard_Real Throat = std::max(dis1, dis2); pFunc->Set(Throat, Throat, Choix); pFInv->Set(Throat, Throat, Choix); } @@ -1059,8 +1059,8 @@ Standard_Boolean ChFi3d_ChBuilder::SimulSurf(Handle(ChFiDS_SurfData)& { // distance and angle Standard_Real dis, angle; chsp->GetDistAngle(dis, angle); - radius = Max(dis, dis * tan(angle)); - radius = Max(radius, radiusspine); + radius = std::max(dis, dis * tan(angle)); + radius = std::max(radius, radiusspine); locfleche = radius * 1.e-2; // graphic criterion Standard_Integer Ch = Choix; @@ -1408,7 +1408,7 @@ Standard_Boolean ChFi3d_ChBuilder::PerformFirstSection(const Handle(ChFiDS_Spine // exception } pFunc.reset(new BRepBlend_ConstThroatWithPenetration(S1, S2, OffsetHGuide)); - Standard_Real Throat = Max(dis1, dis2); + Standard_Real Throat = std::max(dis1, dis2); pFunc->Set(Throat, Throat, Choix); // dis2? } BRepBlend_Walking TheWalk(S1, S2, I1, I2, HGuide); @@ -1449,9 +1449,9 @@ Standard_Boolean ChFi3d_ChBuilder::PerformFirstSection(const Handle(ChFiDS_Spine { /* Standard_Real Alpha = TgF.Angle(TgL); - Standard_Real SinAlpha = Sin(Alpha); - Standard_Real CosAlpha = Cos(Alpha); - Standard_Real TanAlpha = Tan(Alpha); + Standard_Real SinAlpha = std::sin(Alpha); + Standard_Real CosAlpha = std::cos(Alpha); + Standard_Real TanAlpha = std::tan(Alpha); Standard_Real dis1dis1 = dis1*dis1, dis2dis2 = dis2*dis2; aDist2 = sqrt(dis1dis1 - dis2dis2) - dis2/TanAlpha; Standard_Real CosBeta = sqrt(1-dis2dis2/dis1dis1)*CosAlpha + dis2/dis1*SinAlpha; @@ -1685,7 +1685,7 @@ Standard_Boolean ChFi3d_ChBuilder::PerformSurf(ChFiDS_SequenceOfSurfData& } pFunc.reset(new BRepBlend_ConstThroatWithPenetration(S1, S2, OffsetHGuide)); pFInv.reset(new BRepBlend_ConstThroatWithPenetrationInv(S1, S2, OffsetHGuide)); - Standard_Real Throat = Max(d1, d2); + Standard_Real Throat = std::max(d1, d2); pFunc->Set(Throat, Throat, Choix); pFInv->Set(Throat, Throat, Choix); } @@ -1893,94 +1893,6 @@ void ChFi3d_ChBuilder::ExtentOneCorner(const TopoDS_Vertex& V, const Handle(ChFi Spine->SetLastParameter(dU * (1. + Coeff)); Spine->SetLastTgt(dU); } - /* - Standard_Integer Sens; - Standard_Boolean isfirst; - Standard_Integer Iedge = 1; - Standard_Real d1, d2; - - Handle(ChFiDS_Spine) Spine = S->Spine(); - Handle(ChFiDS_ChamfSpine) - chsp = Handle(ChFiDS_ChamfSpine)::DownCast(Spine); - chsp->Dists(d1,d2); - Standard_Integer IE = ChFi3d_IndexOfSurfData(V,S,Sens); - isfirst = (Sens == 1); - if (!isfirst) - Iedge = Spine->NbEdges(); - - TopTools_ListIteratorOfListOfShape It, Jt; - TopoDS_Edge E1, E2, Ec; - TopoDS_Face F1, F2, Fc; - TopoDS_Edge EdgeSp = Spine->Edges(Iedge); - - ConexFaces(Spine,Iedge,F1,F2); - - for (Jt.Initialize(myVEMap(V));Jt.More();Jt.Next()) { - Ec = TopoDS::Edge(Jt.Value()); - if (!Ec.IsSame(EdgeSp)){ - for (It.Initialize(myEFMap(Ec));It.More();It.Next()) { - Fc = TopoDS::Face(It.Value()); - if (Fc.IsSame(F1)) - E1 = Ec; - else if (Fc.IsSame(F2)) - E2 = Ec; - } - } - } - - gp_Vec tg1, tg2, tgsp; - gp_Pnt tmp, ptgui; - Spine->D1(Spine->Absc(V),ptgui,tgsp); - if (isfirst) - tgsp.Reverse(); - - // tg1 - BRepAdaptor_Curve curv; - curv.Initialize(E1); - curv.D1(curv.FirstParameter(),tmp,tg1); //pour eviter les projections - tg1.Reverse(); - // pbm d'erreurs d'approx : baisser la tolerance - if( !tmp.IsEqual(ptgui,tolesp*1.e2) ) - curv.D1(curv.LastParameter(),tmp,tg1); - - // tg2 - curv.Initialize(E2); - curv.D1(curv.FirstParameter(),tmp,tg2); - tg2.Reverse(); - if( !tmp.IsEqual(ptgui,tolesp*1.e2) ) - curv.D1(curv.LastParameter(),tmp,tg2); - - // calcul de dspine - Standard_Real dspine; - Standard_Real d1plus = 0.; - Standard_Real d2plus = 0.; - - Standard_Real sinalpha = tg1.Dot(tgsp); - if (sinalpha < 0.){ - Standard_Real cosalpha = Sqrt(1 - sinalpha*sinalpha); - d1plus = -d1*sinalpha/cosalpha; - } - sinalpha = tg2.Dot(tgsp); - if (sinalpha < 0.){ - Standard_Real cosalpha = Sqrt(1 - sinalpha*sinalpha); - d2plus = -d2*sinalpha/cosalpha; - } - dspine = d1plus; - if (d2plus > d1plus) - dspine = d2plus; - - dspine *=1.5; - - // ExtentOneCorner - if (isfirst) { - Spine->SetFirstParameter(-dspine); - Spine->SetFirstTgt(0.); - } - else{ - Standard_Real param = Spine->LastParameter(Spine->NbEdges()); - Spine->SetLastParameter(param+dspine); - Spine->SetLastTgt(param); - } */ } //======================================================================= diff --git a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_ChBuilder_C3.cxx b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_ChBuilder_C3.cxx index 8b1ba7f850..600fa06924 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_ChBuilder_C3.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_ChBuilder_C3.cxx @@ -106,12 +106,12 @@ static Handle(GeomAdaptor_Surface) BoundSurf(const Handle(Geom_Surface)& S, Standard_Real uuu1, uuu2, vvv1, vvv2; S->Bounds(uuu1, uuu2, vvv1, vvv2); ChFi3d_Boite(Pdeb, Pfin, uu1, uu2, vv1, vv2); - Standard_Real Step = Max((uu2 - uu1), (vv2 - vv1)); + Standard_Real Step = std::max((uu2 - uu1), (vv2 - vv1)); Step *= 0.2; - uuu1 = Max((uu1 - Step), uuu1); - uuu2 = Min((uu2 + Step), uuu2); - vvv1 = Max((vv1 - Step), vvv1); - vvv2 = Min((vv2 + Step), vvv2); + uuu1 = std::max((uu1 - Step), uuu1); + uuu2 = std::min((uu2 + Step), uuu2); + vvv1 = std::max((vv1 - Step), vvv1); + vvv2 = std::min((vv2 + Step), vvv2); GAS.Load(S, uuu1, uuu2, vvv1, vvv2); return HS; } @@ -480,8 +480,8 @@ void ChFi3d_ChBuilder::PerformThreeCorner(const Standard_Integer Jndex) // (resp. p2d[fin]) // if (CornerAllSame) - // c1triangle = (Abs(p[deb][pivot]-p[deb][fin])ChangeValue(1); @@ -506,8 +506,8 @@ void ChFi3d_FilBuilder::SimulKPart(const Handle(ChFiDS_SurfData)& SD) const case GeomAbs_Torus: { v1 = p1f.Y(); v2 = p2f.Y(); - u1 = Max(p1f.X(), p2f.X()); - u2 = Min(p1l.X(), p2l.X()); + u1 = std::max(p1f.X(), p2f.X()); + u2 = std::min(p1l.X(), p2l.X()); Standard_Real ang = (u2 - u1); gp_Torus To = AS.Torus(); Standard_Real majr = To.MajorRadius(), minr = To.MinorRadius(); @@ -526,8 +526,8 @@ void ChFi3d_FilBuilder::SimulKPart(const Handle(ChFiDS_SurfData)& SD) const case GeomAbs_Sphere: { v1 = p1f.Y(); v2 = p2f.Y(); - u1 = Max(p1f.X(), p2f.X()); - u2 = Min(p1l.X(), p2l.X()); + u1 = std::max(p1f.X(), p2f.X()); + u2 = std::min(p1l.X(), p2l.X()); Standard_Real ang = (u2 - u1); gp_Sphere Sp = AS.Sphere(); Standard_Real rad = Sp.Radius(); @@ -2175,8 +2175,10 @@ void ChFi3d_FilBuilder::SplitSurf(ChFiDS_SequenceOfSurfData& SeqData, Standard_Real a, b, c; // (1) Finds vi so that iso v=vi is punctual - VFirst = Min(ref->InterferenceOnS1().FirstParameter(), ref->InterferenceOnS2().FirstParameter()); - VLast = Max(ref->InterferenceOnS1().LastParameter(), ref->InterferenceOnS2().LastParameter()); + VFirst = + std::min(ref->InterferenceOnS1().FirstParameter(), ref->InterferenceOnS2().FirstParameter()); + VLast = + std::max(ref->InterferenceOnS1().LastParameter(), ref->InterferenceOnS2().LastParameter()); // (1.1) Finds the first point inside for (ii = 1; ii <= Nbpnt && Line->Point(ii).Parameter() < VFirst; ii++) @@ -2285,7 +2287,7 @@ void ChFi3d_FilBuilder::SplitSurf(ChFiDS_SequenceOfSurfData& SeqData, Courbe2->D0(T, P2); P3d.SetXYZ((P1.XYZ() + P2.XYZ()) / 2); VertexTol = P1.Distance(P2); - VertexTol += Max(C1.Tolerance(), C2.Tolerance()); + VertexTol += std::max(C1.Tolerance(), C2.Tolerance()); SD->ChangeVertexLastOnS1().SetPoint(P3d); SD->ChangeVertexLastOnS2().SetPoint(P3d); diff --git a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_FilBuilder_C2.cxx b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_FilBuilder_C2.cxx index 6fe1054a14..1a18498f02 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_FilBuilder_C2.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_FilBuilder_C2.cxx @@ -107,11 +107,11 @@ static Standard_Boolean ToricRotule(const BRepAdaptor_Surface& fac, gp_Dir df = fac.Plane().Position().Direction(); gp_Dir ds1 = s1.Plane().Position().Direction(); gp_Dir ds2 = s2.Plane().Position().Direction(); - if (Abs(df.Dot(ds1)) >= tolesp || Abs(df.Dot(ds2)) >= tolesp) + if (std::abs(df.Dot(ds1)) >= tolesp || std::abs(df.Dot(ds2)) >= tolesp) return Standard_False; Standard_Real r1 = sp1->Radius(); Standard_Real r2 = sp2->Radius(); - if (Abs(r1 - r2) >= tolesp) + if (std::abs(r1 - r2) >= tolesp) return Standard_False; return Standard_True; } @@ -207,7 +207,7 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index) if (Sens2 == -1) dir2.Reverse(); Standard_Real ang1; - ang1 = Abs(dir1.Angle(dir2)); + ang1 = std::abs(dir1.Angle(dir2)); if (ang1 < M_PI / 180.) { PerformMoreThreeCorner(Index, 2); @@ -569,7 +569,7 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index) else { Handle(Adaptor3d_Curve) HPivTrim = - Hpivot->Trim(Min(parCP1, parCP2), Max(parCP1, parCP2), tolesp); + Hpivot->Trim(std::min(parCP1, parCP2), std::max(parCP1, parCP2), tolesp); Bpiv = new GeomFill_SimpleBound(HPivTrim, tolapp3d, 2.e-4); fil.Init(Bfac, B2, Bpiv, B1, 1); BRepAdaptor_Curve2d pcpivot; @@ -606,16 +606,17 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index) } if (pcpivot.GetType() != GeomAbs_BSplineCurve) { - Handle(Geom2d_TrimmedCurve) trc = - new Geom2d_TrimmedCurve(pcpivot.Curve(), Min(parCP1, parCP2), Max(parCP1, parCP2)); - PCurveOnPiv = Geom2dConvert::CurveToBSplineCurve(trc); + Handle(Geom2d_TrimmedCurve) trc = new Geom2d_TrimmedCurve(pcpivot.Curve(), + std::min(parCP1, parCP2), + std::max(parCP1, parCP2)); + PCurveOnPiv = Geom2dConvert::CurveToBSplineCurve(trc); } else { PCurveOnPiv = Geom2dConvert::SplitBSplineCurve( Handle(Geom2d_BSplineCurve)::DownCast(pcpivot.Curve()), - Min(parCP1, parCP2), - Max(parCP1, parCP2), + std::min(parCP1, parCP2), + std::max(parCP1, parCP2), tol2d); } TColStd_Array1OfReal kk(1, PCurveOnPiv->NbKnots()); @@ -721,7 +722,7 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index) P2deb, tolapp3d, tolr1); - tolreached = Max(tolreached, tolr1); + tolreached = std::max(tolreached, tolr1); TopOpeBRepDS_Curve Tcurv1(C3d, tolreached); Icf = DStr.AddCurve(Tcurv1); regdeb.SetCurve(Icf); @@ -763,7 +764,7 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index) P2deb, tolapp3d, tolr2); - tolreached = Max(tolreached, tolr2); + tolreached = std::max(tolreached, tolr2); TopOpeBRepDS_Curve Tcurv2(C3d, tolreached); Icl = DStr.AddCurve(Tcurv2); regfin.SetCurve(Icl); @@ -912,7 +913,7 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index) if (SurFopsam.IsUClosed()) { Standard_Real Uperiod = SurFopsam.LastUParameter() - SurFopsam.FirstUParameter(); - if (Abs(ppfacsam.X() - ppfacdif.X()) > Uperiod / 2) + if (std::abs(ppfacsam.X() - ppfacdif.X()) > Uperiod / 2) { if (ppfacdif.X() < ppfacsam.X()) ppfacdif.SetX(ppfacdif.X() + Uperiod); @@ -1004,7 +1005,7 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index) Standard_Real tolr1; Handle(GeomAdaptor_Curve) HC3d = new GeomAdaptor_Curve(C3d); ChFi3d_SameParameter(HC3d, pcFopsam, HBRFopsam, tolapp3d, tolr1); - tolreached = Max(tolreached, tolr1); + tolreached = std::max(tolreached, tolr1); TopOpeBRepDS_Curve Tcurv1(C3d, tolreached); Icf = DStr.AddCurve(Tcurv1); // place the pcurve on face in the DS @@ -1045,7 +1046,7 @@ void ChFi3d_FilBuilder::PerformTwoCorner(const Standard_Integer Index) Standard_Real tolr2; HC3d->Load(C3d); ChFi3d_SameParameter(HC3d, pcsurfdif, Hsurfdif, tolapp3d, tolr2); - tolreached = Max(tolreached, tolr2); + tolreached = std::max(tolreached, tolr2); TopOpeBRepDS_Curve Tcurv2(C3d, tolreached); Icl = DStr.AddCurve(Tcurv2); regfin.SetCurve(Icl); diff --git a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_FilBuilder_C3.cxx b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_FilBuilder_C3.cxx index 0ce01839be..435e5b728f 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_FilBuilder_C3.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFi3d/ChFi3d_FilBuilder_C3.cxx @@ -222,7 +222,7 @@ static Standard_Boolean ToricCorner(const TopoDS_Face& F, const Standard_Real rf, const gp_Vec& v) { - if (Abs(rd - rf) > Precision::Confusion()) + if (std::abs(rd - rf) > Precision::Confusion()) { return Standard_False; } @@ -231,8 +231,8 @@ static Standard_Boolean ToricCorner(const TopoDS_Face& F, { return Standard_False; } - Standard_Real scal1 = Abs(bs.Plane().Position().XDirection().Dot(v)); - Standard_Real scal2 = Abs(bs.Plane().Position().YDirection().Dot(v)); + Standard_Real scal1 = std::abs(bs.Plane().Position().XDirection().Dot(v)); + Standard_Real scal2 = std::abs(bs.Plane().Position().YDirection().Dot(v)); return (scal1 <= Precision::Confusion() && scal2 <= Precision::Confusion()); } @@ -382,8 +382,8 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex) fin = (pivot + 2) % 3; } pivdif = Standard_False; - if (Abs(p[0][1] - p[0][2]) <= tol2d && Abs(p[1][0] - p[1][2]) <= tol2d - && Abs(p[2][0] - p[2][1]) <= tol2d) + if (std::abs(p[0][1] - p[0][2]) <= tol2d && std::abs(p[1][0] - p[1][2]) <= tol2d + && std::abs(p[2][0] - p[2][1]) <= tol2d) { c1pointu = Standard_True; } @@ -440,7 +440,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex) } } if (!c1toric) - c1spheric = (Abs(qr[0] - qr[1]) < tolapp3d && Abs(qr[0] - qr[2]) < tolapp3d); + c1spheric = (std::abs(qr[0] - qr[1]) < tolapp3d && std::abs(qr[0] - qr[2]) < tolapp3d); } // Previously to avoid loops the points were always located @@ -520,9 +520,9 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex) if (!c1pointu) { if (!pivdif) - c1pointu = - (Abs(p[deb][pivot] - p[deb][fin]) <= tol2d && Abs(p[fin][pivot] - p[fin][deb]) <= tol2d); - if (Abs(p[pivot][deb] - p[pivot][fin]) <= tol2d) + c1pointu = (std::abs(p[deb][pivot] - p[deb][fin]) <= tol2d + && std::abs(p[fin][pivot] - p[fin][deb]) <= tol2d); + if (std::abs(p[pivot][deb] - p[pivot][fin]) <= tol2d) c1toric = ToricCorner(face[pivot], Rdeb, Rfin, Vdp); } // there is a pivot, the start and the end CD (finally !?!) : @@ -777,7 +777,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex) Handle(BRepBlend_Line) lin; Standard_Real ffi = WFirst, lla = WLast + pasmax; - if (Abs(Rdeb - Rfin) <= tolapp3d) + if (std::abs(Rdeb - Rfin) <= tolapp3d) { BRepBlend_ConstRad func(Fac, Surf, cornerspine); @@ -1130,7 +1130,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex) tolapp3d, tolrdeb, rev); - tcdeb.Tolerance(Max(tolrdeb, tcdeb.Tolerance())); + tcdeb.Tolerance(std::max(tolrdeb, tcdeb.Tolerance())); if (rev) ChFi3d_EnlargeBox(DStr, CD[deb], fddeb, *pbf2, *pbf1, isfirst); else @@ -1175,7 +1175,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex) tolapp3d, tolrfin, rev); - tcfin.Tolerance(Max(tolrfin, tcfin.Tolerance())); + tcfin.Tolerance(std::max(tolrfin, tcfin.Tolerance())); if (rev) ChFi3d_EnlargeBox(DStr, CD[fin], fdfin, *pbl2, *pbl1, isfirst); else @@ -1208,7 +1208,7 @@ void ChFi3d_FilBuilder::PerformThreeCorner(const Standard_Integer Jndex) fi.LastParameter(), tolapp3d, tolr); - TCcoinpiv.Tolerance(Max(TCcoinpiv.Tolerance(), tolr)); + TCcoinpiv.Tolerance(std::max(TCcoinpiv.Tolerance(), tolr)); CD[pivot]->ChangePCurve(isfirst) = C2dOnPiv; CD[pivot]->SetIndexPoint(If2, isfirst, isurf1); CD[pivot]->SetIndexPoint(Il2, isfirst, isurf2); diff --git a/src/ModelingAlgorithms/TKFillet/ChFiDS/ChFiDS_FilSpine.cxx b/src/ModelingAlgorithms/TKFillet/ChFiDS/ChFiDS_FilSpine.cxx index c884b9a532..2a452a4ebb 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFiDS/ChFiDS_FilSpine.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFiDS/ChFiDS_FilSpine.cxx @@ -59,12 +59,12 @@ void ChFiDS_FilSpine::Reset(const Standard_Boolean AllData) gp_XY FirstUandR = parandrad.First(); gp_XY LastUandR = parandrad.Last(); - if (Abs(spinedeb - FirstUandR.X()) > gp::Resolution()) + if (std::abs(spinedeb - FirstUandR.X()) > gp::Resolution()) { FirstUandR.SetX(spinedeb); parandrad.Prepend(FirstUandR); } - if (Abs(spinefin - LastUandR.X()) > gp::Resolution()) + if (std::abs(spinefin - LastUandR.X()) > gp::Resolution()) { LastUandR.SetX(spinefin); parandrad.Append(LastUandR); @@ -98,9 +98,9 @@ void ChFiDS_FilSpine::UnSetRadius(const TopoDS_Edge& E) Standard_Integer ifirst = 0, ilast = 0; for (Standard_Integer i = 1; i <= parandrad.Length(); i++) { - if (Abs(parandrad(i).X() - Uf) <= gp::Resolution()) + if (std::abs(parandrad(i).X() - Uf) <= gp::Resolution()) ifirst = i; - if (Abs(parandrad(i).X() - Ul) <= gp::Resolution()) + if (std::abs(parandrad(i).X() - Ul) <= gp::Resolution()) ilast = i; } if (ifirst != 0 && ilast != 0) @@ -226,7 +226,7 @@ Standard_Boolean ChFiDS_FilSpine::IsConstant() const Standard_Boolean isconst = Standard_True; Standard_Real Radius = parandrad(1).Y(); for (Standard_Integer i = 2; i <= parandrad.Length(); i++) - if (Abs(Radius - parandrad(i).Y()) > Precision::Confusion()) + if (std::abs(Radius - parandrad(i).Y()) > Precision::Confusion()) { isconst = Standard_False; break; @@ -248,7 +248,7 @@ Standard_Boolean ChFiDS_FilSpine::IsConstant(const Standard_Integer IE) const par = parandrad(i).X(); rad = parandrad(i).Y(); Standard_Real nextpar = parandrad(i + 1).X(); - if (Abs(Uf - par) <= gp::Resolution() + if (std::abs(Uf - par) <= gp::Resolution() || (par < Uf && Uf < nextpar && nextpar - Uf > gp::Resolution())) { StartRad = rad; @@ -259,9 +259,9 @@ Standard_Boolean ChFiDS_FilSpine::IsConstant(const Standard_Integer IE) const { par = parandrad(i).X(); rad = parandrad(i).Y(); - if (Abs(rad - StartRad) > Precision::Confusion()) + if (std::abs(rad - StartRad) > Precision::Confusion()) return Standard_False; - if (Abs(Ul - par) <= gp::Resolution()) + if (std::abs(Ul - par) <= gp::Resolution()) return Standard_True; if (par > Ul) return Standard_True; @@ -291,7 +291,7 @@ Standard_Real ChFiDS_FilSpine::Radius(const Standard_Integer IE) const par = parandrad(i).X(); rad = parandrad(i).Y(); Standard_Real nextpar = parandrad(i + 1).X(); - if (Abs(Uf - par) <= gp::Resolution() + if (std::abs(Uf - par) <= gp::Resolution() || (par < Uf && Uf < nextpar && nextpar - Uf > gp::Resolution())) { StartRad = rad; @@ -302,9 +302,9 @@ Standard_Real ChFiDS_FilSpine::Radius(const Standard_Integer IE) const { par = parandrad(i).X(); rad = parandrad(i).Y(); - if (Abs(rad - StartRad) > Precision::Confusion()) + if (std::abs(rad - StartRad) > Precision::Confusion()) throw Standard_DomainError("Edge is not constant"); - if (Abs(Ul - par) <= gp::Resolution()) + if (std::abs(Ul - par) <= gp::Resolution()) return StartRad; if (par > Ul) return StartRad; @@ -573,7 +573,7 @@ Handle(Law_Composite) ChFiDS_FilSpine::ComputeLaw(const Handle(ChFiDS_ElSpine)& Rdeb = Radius(ind(1)); curfin = LastParameter(ind(1)); curfin = ElCLib::InPeriod(curfin, spinedeb + tol3d, spinefin + tol3d); - curfin = Min(fin, curfin); + curfin = std::min(fin, curfin); Handle(Law_Constant) curloi = new Law_Constant(); curloi->Set(Rdeb, curdeb, curfin); list.Append(curloi); @@ -617,7 +617,7 @@ Handle(Law_Composite) ChFiDS_FilSpine::ComputeLaw(const Handle(ChFiDS_ElSpine)& if (IsConstant(ind(1))) { Rdeb = Radius(ind(1)); - curfin = Min(fin, LastParameter(ind(1))); + curfin = std::min(fin, LastParameter(ind(1))); Handle(Law_Constant) curloi = new Law_Constant(); curloi->Set(Rdeb, curdeb, curfin); list.Append(curloi); @@ -692,10 +692,10 @@ Handle(Law_Composite) ChFiDS_FilSpine::ComputeLaw(const Handle(ChFiDS_ElSpine)& if (biddeb >= curfin) curfin = fin; else - curfin = Min(fin, curfin); + curfin = std::min(fin, curfin); } else - curfin = Min(fin, curfin); + curfin = std::min(fin, curfin); } if ((curfin - curdeb) > tol3d) { @@ -711,7 +711,7 @@ Handle(Law_Composite) ChFiDS_FilSpine::ComputeLaw(const Handle(ChFiDS_ElSpine)& curfin = LastParameter(ind(icur)); if (IsPeriodic()) curfin = ElCLib::InPeriod(curfin, spinedeb + tol3d, spinefin + tol3d); - curfin = Min(fin, curfin); + curfin = std::min(fin, curfin); lawencours = Standard_True; if (ind(icur) == ind(nbed)) { @@ -726,7 +726,7 @@ Handle(Law_Composite) ChFiDS_FilSpine::ComputeLaw(const Handle(ChFiDS_ElSpine)& if (biddeb >= curfin) curfin = fin; else - curfin = Min(fin, curfin); + curfin = std::min(fin, curfin); } // or if it is the end of spine with extension. else if (ind(icur) == len) diff --git a/src/ModelingAlgorithms/TKFillet/ChFiDS/ChFiDS_Regul.cxx b/src/ModelingAlgorithms/TKFillet/ChFiDS/ChFiDS_Regul.cxx index 385f5ec481..6f463838dd 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFiDS/ChFiDS_Regul.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFiDS/ChFiDS_Regul.cxx @@ -29,7 +29,7 @@ ChFiDS_Regul::ChFiDS_Regul() void ChFiDS_Regul::SetCurve(const Standard_Integer IC) { - icurv = Abs(IC); + icurv = std::abs(IC); } //================================================================================================= @@ -37,9 +37,9 @@ void ChFiDS_Regul::SetCurve(const Standard_Integer IC) void ChFiDS_Regul::SetS1(const Standard_Integer IS1, const Standard_Boolean IsFace) { if (IsFace) - is1 = Abs(IS1); + is1 = std::abs(IS1); else - is1 = -Abs(IS1); + is1 = -std::abs(IS1); } //================================================================================================= @@ -47,9 +47,9 @@ void ChFiDS_Regul::SetS1(const Standard_Integer IS1, const Standard_Boolean IsFa void ChFiDS_Regul::SetS2(const Standard_Integer IS2, const Standard_Boolean IsFace) { if (IsFace) - is2 = Abs(IS2); + is2 = std::abs(IS2); else - is2 = -Abs(IS2); + is2 = -std::abs(IS2); } //================================================================================================= @@ -77,12 +77,12 @@ Standard_Integer ChFiDS_Regul::Curve() const Standard_Integer ChFiDS_Regul::S1() const { - return Abs(is1); + return std::abs(is1); } //================================================================================================= Standard_Integer ChFiDS_Regul::S2() const { - return Abs(is2); + return std::abs(is2); } diff --git a/src/ModelingAlgorithms/TKFillet/ChFiDS/ChFiDS_Spine.cxx b/src/ModelingAlgorithms/TKFillet/ChFiDS/ChFiDS_Spine.cxx index 703c03b039..7aacc7679e 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFiDS/ChFiDS_Spine.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFiDS/ChFiDS_Spine.cxx @@ -410,9 +410,9 @@ Standard_Integer ChFiDS_Spine::Index(const Standard_Real W, const Standard_Boole { Standard_Integer ind, len = abscissa->Length(); Standard_Real par = W, last = abscissa->Value(abscissa->Upper()); - Standard_Real f = 0., l = 0., t = Max(tolesp, Precision::Confusion()); + Standard_Real f = 0., l = 0., t = std::max(tolesp, Precision::Confusion()); - if (IsPeriodic() && Abs(par) >= t && Abs(par - last) >= t) + if (IsPeriodic() && std::abs(par) >= t && std::abs(par - last) >= t) par = ElCLib::InPeriod(par, 0., last); for (ind = 1; ind <= len; ind++) @@ -422,13 +422,13 @@ Standard_Integer ChFiDS_Spine::Index(const Standard_Real W, const Standard_Boole if (par < l || ind == len) break; } - if (Forward && ind < len && Abs(par - l) < t) + if (Forward && ind < len && std::abs(par - l) < t) ind++; - else if (!Forward && ind > 1 && Abs(par - f) < t) + else if (!Forward && ind > 1 && std::abs(par - f) < t) ind--; - else if (Forward && IsPeriodic() && ind == len && Abs(par - l) < t) + else if (Forward && IsPeriodic() && ind == len && std::abs(par - l) < t) ind = 1; - else if (!Forward && IsPeriodic() && ind == 1 && Abs(par - f) < t) + else if (!Forward && IsPeriodic() && ind == 1 && std::abs(par - f) < t) ind = len; return ind; } @@ -575,15 +575,15 @@ void ChFiDS_Spine::Parameter(const Standard_Integer Index, void ChFiDS_Spine::Prepare(Standard_Real& L, Standard_Integer& Ind) const { - Standard_Real tol = Max(tolesp, Precision::Confusion()); + Standard_Real tol = std::max(tolesp, Precision::Confusion()); Standard_Real last = abscissa->Value(abscissa->Upper()); Standard_Integer len = abscissa->Length(); - if (IsPeriodic() && Abs(L) >= tol && Abs(L - last) >= tol) + if (IsPeriodic() && std::abs(L) >= tol && std::abs(L - last) >= tol) L = ElCLib::InPeriod(L, 0., last); if (hasfirsttgt && (L <= firsttgtpar)) { - if (hasref && valref >= L && Abs(L - firsttgtpar) <= tol) + if (hasref && valref >= L && std::abs(L - firsttgtpar) <= tol) { Ind = Index(L); } @@ -599,7 +599,7 @@ void ChFiDS_Spine::Prepare(Standard_Real& L, Standard_Integer& Ind) const } else if (haslasttgt && (L >= lasttgtpar)) { - if (hasref && valref <= L && Abs(L - lasttgtpar) <= tol) + if (hasref && valref <= L && std::abs(L - lasttgtpar) <= tol) { Ind = Index(L); } @@ -624,12 +624,12 @@ void ChFiDS_Spine::Prepare(Standard_Real& L, Standard_Integer& Ind) const { if (L >= valref && Ind != 1) { - if (Abs(L - abscissa->Value(Ind - 1)) <= Precision::Confusion()) + if (std::abs(L - abscissa->Value(Ind - 1)) <= Precision::Confusion()) Ind--; } else if (L <= valref && Ind != len) { - if (Abs(L - abscissa->Value(Ind)) <= Precision::Confusion()) + if (std::abs(L - abscissa->Value(Ind)) <= Precision::Confusion()) Ind++; } } @@ -785,7 +785,7 @@ void ChFiDS_Spine::D2(const Standard_Real AbsC, gp_Pnt& P, gp_Vec& V1, gp_Vec& V Standard_Real N1 = V1.SquareMagnitude(); Standard_Real D2 = -(V1.Dot(V2)) * (1. / N1) * (1. / N1); V2.Multiply(1. / N1); - N1 = Sqrt(N1); + N1 = std::sqrt(N1); gp_Vec Va = V1.Multiplied(D2); V2.Add(Va); Standard_Real D1 = 1. / N1; diff --git a/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnCon.cxx b/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnCon.cxx index 58cbc21047..33686e68d8 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnCon.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnCon.cxx @@ -115,8 +115,8 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr, if ((plandab && DisOnP) || (!plandab && !DisOnP)) { - Standard_Real tgang = Tan(Angle), Dis11; - Standard_Real tgCon = Abs(Tan(angCon)); + Standard_Real tgang = std::tan(Angle), Dis11; + Standard_Real tgCon = std::abs(std::tan(angCon)); if (ouvert) { move = Dis * tgang / (1. - tgCon * tgang); @@ -134,7 +134,7 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr, if (dedans) { ChamfRad = Spine.Radius() - Dis; - if (Abs(ChamfRad) < Precision::Confusion()) + if (std::abs(ChamfRad) < Precision::Confusion()) pointu = Standard_True; if (ChamfRad < 0) { @@ -153,7 +153,7 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr, if (ouvert) { - if (Abs(angCon) - Abs(SemiAngl) > -Precision::Confusion()) + if (std::abs(angCon) - std::abs(SemiAngl) > -Precision::Confusion()) { #ifdef OCCT_DEBUG std::cout << "wrong choice of angle for the chamfer" << std::endl; @@ -165,10 +165,10 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr, else { Standard_Real Dis1; - move = Dis * Cos(angCon); + move = Dis * std::cos(angCon); if (ouvert) { - SemiAngl = Abs(angCon) + Angle; + SemiAngl = std::abs(angCon) + Angle; if ((M_PI / 2. - SemiAngl) < Precision::Confusion()) { @@ -177,23 +177,23 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr, #endif return Standard_False; } - Dis1 = move * Tan(SemiAngl) - Dis * Abs(Sin(angCon)); + Dis1 = move * std::tan(SemiAngl) - Dis * std::abs(std::sin(angCon)); if (!dedans) SemiAngl = -SemiAngl; } else { - SemiAngl = Abs(angCon) - Angle; + SemiAngl = std::abs(angCon) - Angle; - if (Abs(SemiAngl) < Precision::Confusion()) + if (std::abs(SemiAngl) < Precision::Confusion()) { iscylinder = Standard_True; - Dis1 = Dis * Abs(Sin(angCon)); + Dis1 = Dis * std::abs(std::sin(angCon)); } else { - Dis1 = Dis * Abs(Sin(angCon)) - move * Tan(SemiAngl); + Dis1 = Dis * std::abs(std::sin(angCon)) - move * std::tan(SemiAngl); } if (SemiAngl > Precision::Confusion()) @@ -208,7 +208,7 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr, { ChamfRad = Spine.Radius() - Dis1; - if (Abs(ChamfRad) < Precision::Confusion()) + if (std::abs(ChamfRad) < Precision::Confusion()) pointu = Standard_True; if (ChamfRad < 0) { @@ -225,9 +225,9 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr, } if (ouvert) - dis = Dis1 + Dis * Abs(Sin(angCon)); + dis = Dis1 + Dis * std::abs(std::sin(angCon)); else - dis = Dis1 - Dis * Abs(Sin(angCon)); + dis = Dis1 - Dis * std::abs(std::sin(angCon)); } Or.SetCoord(Or.X() + move * Dpl.X(), Or.Y() + move * Dpl.Y(), Or.Z() + move * Dpl.Z()); diff --git a/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnCyl.cxx b/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnCyl.cxx index 6ccc4219f7..53b42202c7 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnCyl.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnCyl.cxx @@ -146,7 +146,7 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr, if (dedans) { Rad = Cyl.Radius() - dis1; - if (Abs(Rad) <= Precision::Confusion()) + if (std::abs(Rad) <= Precision::Confusion()) pointu = Standard_True; if (Rad < 0) { @@ -291,7 +291,7 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr, ElSLib::Parameters(Cyl, Pt, u, v); Standard_Real tol = Precision::PConfusion(); Standard_Boolean careaboutsens = 0; - if (Abs(lu - fu - 2 * M_PI) < tol) + if (std::abs(lu - fu - 2 * M_PI) < tol) careaboutsens = 1; if (u >= fu - tol && u < fu) u = fu; @@ -306,10 +306,10 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr, if (deru.Dot(Dy) < 0.) { d2dCyl.Reverse(); - if (careaboutsens && Abs(fu - u) < tol) + if (careaboutsens && std::abs(fu - u) < tol) u = lu; } - else if (careaboutsens && Abs(lu - u) < tol) + else if (careaboutsens && std::abs(lu - u) < tol) u = fu; gp_Pnt2d p2dCyl(u, v); gp_Lin2d lin2dCyl(p2dCyl, d2dCyl); @@ -413,7 +413,7 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr, // Calculation of distances dis1 and dis2, depending on Dis and Angle gp_Vec DirSOrC = VecTranslCyl.Normalized(); Standard_Real cosA1 = DirSOrC.Dot(VecTranslPln.Normalized()); - Standard_Real sinA1 = Sqrt(1. - cosA1 * cosA1); + Standard_Real sinA1 = std::sqrt(1. - cosA1 * cosA1); Standard_Real dis1 = 0.; Standard_Real dis2, ray = Cyl.Radius(); Standard_Boolean IsDisOnP = ((plandab && DisOnP) || (!plandab && !DisOnP)); @@ -421,7 +421,7 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr, if (IsDisOnP) { dis1 = Dis; - Standard_Real sinAl = Sin(Angle), cosAl = Cos(Angle); + Standard_Real sinAl = std::sin(Angle), cosAl = std::cos(Angle); Standard_Real h = dis1 * sinAl; Standard_Real cosAhOC = cosA1 * sinAl + sinA1 * cosAl; Standard_Real sinAhOC = sinA1 * sinAl - cosA1 * cosAl; @@ -440,11 +440,11 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr, } else if (dis2 < 1.E-09) { - dis2 = ray * Sqrt(2. * temp2); + dis2 = ray * std::sqrt(2. * temp2); } else { - dis2 = ray * Sqrt(2. * (temp2 - sinAhOC * Sqrt(dis2))); + dis2 = ray * std::sqrt(2. * (temp2 - sinAhOC * std::sqrt(dis2))); } } else @@ -453,7 +453,7 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr, } // construction of POnCyl - Standard_Real alpha = (2 * ASin(dis2 * 0.5 / ray)); + Standard_Real alpha = (2 * std::asin(dis2 * 0.5 / ray)); gp_Vec VecTemp = VecTranslCyl.Reversed(); if ((XDir.Crossed(gp_Dir(VecTranslCyl))).Dot(NorF) < 0.) @@ -482,13 +482,13 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr, Corde.Normalize(); Standard_Real cosCorTan = TCyl.Dot(Corde); Standard_Real tgCorTan = 1. / (cosCorTan * cosCorTan); - tgCorTan = Sqrt(tgCorTan - 1.); + tgCorTan = std::sqrt(tgCorTan - 1.); Standard_Real tgAng = tan(Angle); tgAng = (tgAng + tgCorTan) / (1. - tgAng * tgCorTan); Standard_Real cosA11 = dis2 / (2. * ray); - Standard_Real sinA11 = Sqrt(1. - cosA11 * cosA11); + Standard_Real sinA11 = std::sqrt(1. - cosA11 * cosA11); if (cosA1 > 0) sinA11 = -sinA11; dis1 = (sinA1 + cosA1 * tgAng) * cosA11; diff --git a/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnPln.cxx b/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnPln.cxx index 38ab26ab76..1275ea7041 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnPln.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_ChAsymPlnPln.cxx @@ -112,11 +112,11 @@ Standard_Boolean ChFiKPart_MakeChAsym(TopOpeBRepDS_DataStructure& DStr, if (DisOnP1) { dis1 = Dis; - dis2 = Dis / (cosP + sinP / Tan(Angle)); + dis2 = Dis / (cosP + sinP / std::tan(Angle)); } else { - dis1 = Dis / (cosP + sinP / Tan(Angle)); + dis1 = Dis / (cosP + sinP / std::tan(Angle)); dis2 = Dis; } // Compute a point on the plane Pl1 and on the chamfer diff --git a/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_ChPlnCon.cxx b/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_ChPlnCon.cxx index dc127388c2..4d3cdf3fd9 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_ChPlnCon.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_ChPlnCon.cxx @@ -67,16 +67,16 @@ Standard_Boolean ChFiKPart_MakeChamfer(TopOpeBRepDS_DataStructure& DStr, Standard_Real Dis1 = theDis1, Dis2 = theDis2; Standard_Real Alpha = M_PI / 2 - angcon; - Standard_Real CosHalfAlpha = Cos(Alpha / 2); + Standard_Real CosHalfAlpha = std::cos(Alpha / 2); if (theMode == ChFiDS_ConstThroatChamfer) Dis1 = Dis2 = theDis1 / CosHalfAlpha; else if (theMode == ChFiDS_ConstThroatWithPenetrationChamfer) { - Standard_Real aDis1 = Min(theDis1, theDis2); - Standard_Real aDis2 = Max(theDis1, theDis2); + Standard_Real aDis1 = std::min(theDis1, theDis2); + Standard_Real aDis2 = std::max(theDis1, theDis2); Standard_Real dis1dis1 = aDis1 * aDis1, dis2dis2 = aDis2 * aDis2; - Standard_Real SinAlpha = Sin(Alpha); - Standard_Real CosAlpha = Cos(Alpha); + Standard_Real SinAlpha = std::sin(Alpha); + Standard_Real CosAlpha = std::cos(Alpha); Standard_Real CotanAlpha = CosAlpha / SinAlpha; Dis1 = sqrt(dis2dis2 - dis1dis1) - aDis1 * CotanAlpha; Standard_Real CosBeta = sqrt(1 - dis1dis1 / dis2dis2) * CosAlpha + aDis1 / aDis2 * SinAlpha; @@ -84,7 +84,7 @@ Standard_Boolean ChFiKPart_MakeChamfer(TopOpeBRepDS_DataStructure& DStr, Dis2 = FullDist1 - aDis1 / SinAlpha; } - Standard_Real sincon = Abs(Sin(angcon)); + Standard_Real sincon = std::abs(std::sin(angcon)); Standard_Real angle; Standard_Boolean IsResol; @@ -121,10 +121,10 @@ Standard_Boolean ChFiKPart_MakeChamfer(TopOpeBRepDS_DataStructure& DStr, if (!ouvert) { - if (Abs(Dis1 - Dis2 * sincon) > Precision::Confusion()) + if (std::abs(Dis1 - Dis2 * sincon) > Precision::Confusion()) { - Standard_Real abscos = Abs(Dis2 - Dis1 * sincon); - angle = ATan((Dis1 * Cos(angcon)) / abscos); + Standard_Real abscos = std::abs(Dis2 - Dis1 * sincon); + angle = std::atan((Dis1 * std::cos(angcon)) / abscos); } else { @@ -133,7 +133,7 @@ Standard_Boolean ChFiKPart_MakeChamfer(TopOpeBRepDS_DataStructure& DStr, } else { - angle = ATan((Dis1 * Cos(angcon)) / (Dis2 + Dis1 * sincon)); + angle = std::atan((Dis1 * std::cos(angcon)) / (Dis2 + Dis1 * sincon)); } Standard_Boolean DisOnP = Standard_False; @@ -191,7 +191,7 @@ Standard_Boolean ChFiKPart_MakeChamfer(TopOpeBRepDS_DataStructure& DStr, // variables used to compute the semiangle of the chamfer Standard_Real angle = Con.SemiAngle(); - Standard_Real move = Dis2 * Cos(angle); + Standard_Real move = Dis2 * std::cos(angle); Or.SetCoord( Or.X()+ move*Dpl.X(), Or.Y()+ move*Dpl.Y(), Or.Z()+ move*Dpl.Z()); @@ -199,9 +199,9 @@ Standard_Boolean ChFiKPart_MakeChamfer(TopOpeBRepDS_DataStructure& DStr, gp_Dir Vec1(Or.X()-PtPl.X(), Or.Y()-PtPl.Y(), Or.Z()-PtPl.Z()); Standard_Real Dis; if (ouvert) - Dis = Dis1 + Dis2*Abs(Sin(angle)); + Dis = Dis1 + Dis2*std::abs(std::sin(angle)); else - Dis = Dis1 - Dis2*Abs(Sin(angle)); + Dis = Dis1 - Dis2*std::abs(std::sin(angle)); gp_Pnt Pt(Or.X()+Dis*PosPl.XDirection().X(), Or.Y()+Dis*PosPl.XDirection().Y(), @@ -214,7 +214,7 @@ Standard_Boolean ChFiKPart_MakeChamfer(TopOpeBRepDS_DataStructure& DStr, if (dedans) { ChamfRad = Spine.Radius() - Dis1; - if ( Abs(ChamfRad)<=Precision::Confusion() ) pointu = Standard_True; + if ( std::abs(ChamfRad)<=Precision::Confusion() ) pointu = Standard_True; if( ChamfRad < 0 ) { #ifdef OCCT_DEBUG std::cout<<"le chanfrein ne passe pas"<= fu - tol && u < fu) u = fu; @@ -300,10 +300,10 @@ Standard_Boolean ChFiKPart_MakeChamfer(TopOpeBRepDS_DataStructure& DStr, if (deru.Dot(Dy) < 0.) { d2dCyl.Reverse(); - if (careaboutsens && Abs(fu - u) < tol) + if (careaboutsens && std::abs(fu - u) < tol) u = lu; } - else if (careaboutsens && Abs(lu - u) < tol) + else if (careaboutsens && std::abs(lu - u) < tol) u = fu; gp_Pnt2d p2dCyl(u, v); gp_Lin2d lin2dCyl(p2dCyl, d2dCyl); @@ -408,7 +408,7 @@ Standard_Boolean ChFiKPart_MakeChamfer(TopOpeBRepDS_DataStructure& DStr, POnPln.SetXYZ((OrSpine.XYZ()).Added(VecTranslPln.XYZ())); // construction of POnCyl - Standard_Real alpha = (2 * ASin(dis2 * 0.5 / Cyl.Radius())); + Standard_Real alpha = (2 * std::asin(dis2 * 0.5 / Cyl.Radius())); // gp_Vec VecTranslCyl; // VecTranslCyl = gp_Vec(OrSpine,OrCyl); diff --git a/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_ChPlnPln.cxx b/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_ChPlnPln.cxx index 819b0cccfc..94e767f4be 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_ChPlnPln.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_ChPlnPln.cxx @@ -106,16 +106,16 @@ Standard_Boolean ChFiKPart_MakeChamfer(TopOpeBRepDS_DataStructure& DStr, Standard_Real Dis1 = theDis1, Dis2 = theDis2; Standard_Real Alpha = VecTransl1.Angle(VecTransl2); - Standard_Real CosHalfAlpha = Cos(Alpha / 2); + Standard_Real CosHalfAlpha = std::cos(Alpha / 2); if (theMode == ChFiDS_ConstThroatChamfer) Dis1 = Dis2 = theDis1 / CosHalfAlpha; else if (theMode == ChFiDS_ConstThroatWithPenetrationChamfer) { - Standard_Real aDis1 = Min(theDis1, theDis2); - Standard_Real aDis2 = Max(theDis1, theDis2); + Standard_Real aDis1 = std::min(theDis1, theDis2); + Standard_Real aDis2 = std::max(theDis1, theDis2); Standard_Real dis1dis1 = aDis1 * aDis1, dis2dis2 = aDis2 * aDis2; - Standard_Real SinAlpha = Sin(Alpha); - Standard_Real CosAlpha = Cos(Alpha); + Standard_Real SinAlpha = std::sin(Alpha); + Standard_Real CosAlpha = std::cos(Alpha); Standard_Real CotanAlpha = CosAlpha / SinAlpha; Dis1 = sqrt(dis2dis2 - dis1dis1) - aDis1 * CotanAlpha; Standard_Real CosBeta = sqrt(1 - dis1dis1 / dis2dis2) * CosAlpha + aDis1 / aDis2 * SinAlpha; diff --git a/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_FilPlnCon.cxx b/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_FilPlnCon.cxx index 25139138eb..031afd1eb2 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_FilPlnCon.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_FilPlnCon.cxx @@ -121,7 +121,7 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr, if (ddc.Dot(Dp) < 0.) ddc.Reverse(); Standard_Real Ang = ddp.Angle(ddc); - Standard_Real Rabio = Radius / Tan(Ang / 2); + Standard_Real Rabio = Radius / std::tan(Ang / 2); Standard_Real Maxrad = cPln.Distance(Pv); Standard_Real Rad; Standard_Boolean dedans = Dx.Dot(Dc) <= 0.; @@ -132,7 +132,7 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr, Dz.Reverse(); } Rad = Maxrad - Rabio; - if (Abs(Rad) <= Precision::Confusion()) + if (std::abs(Rad) <= Precision::Confusion()) { c1sphere = Standard_True; } @@ -269,7 +269,7 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr, ElSLib::Parameters(Con, P, u, v); Standard_Real tol = Precision::PConfusion(); Standard_Boolean careaboutsens = 0; - if (Abs(lu - fu - 2 * M_PI) < tol) + if (std::abs(lu - fu - 2 * M_PI) < tol) careaboutsens = 1; if (u >= fu - tol && u < fu) u = fu; @@ -283,10 +283,10 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr, if (deru.Dot(Dy) < 0.) { d2dCon.Reverse(); - if (careaboutsens && Abs(fu - u) < tol) + if (careaboutsens && std::abs(fu - u) < tol) u = lu; } - else if (careaboutsens && Abs(lu - u) < tol) + else if (careaboutsens && std::abs(lu - u) < tol) u = fu; gp_Pnt2d p2dCon(u, v); gp_Lin2d lin2dCon(p2dCon, d2dCon); diff --git a/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_FilPlnCyl.cxx b/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_FilPlnCyl.cxx index 964cc97f8e..878b748ce6 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_FilPlnCyl.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_FilPlnCyl.cxx @@ -305,12 +305,12 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr, Standard_Real acote = 1e-7; ElCLib::D1(First, Spine, PtSp, DSp); ElSLib::Parameters(Cyl, PtSp, u, v); - if ((Abs(u) < acote) || (Abs(u - (2 * M_PI)) < acote)) + if ((std::abs(u) < acote) || (std::abs(u - (2 * M_PI)) < acote)) { ElCLib::D1(First + 0.2, Spine, PtSp2, DSp2); Standard_Real u2, v2; ElSLib::Parameters(Cyl, PtSp2, u2, v2); - if (Abs(u2 - u) > M_PI) + if (std::abs(u2 - u) > M_PI) { u = (2 * M_PI) - u; PtSp = ElSLib::Value(u, v, Cyl); @@ -341,7 +341,7 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr, Dz.Reverse(); } Rad = cylrad - Radius; - if (Abs(Rad) <= Precision::Confusion()) + if (std::abs(Rad) <= Precision::Confusion()) { c1sphere = Standard_True; } @@ -513,7 +513,7 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr, ElSLib::Parameters(Cyl, P, u, v); Standard_Real tol = Precision::PConfusion(); Standard_Boolean careaboutsens = 0; - if (Abs(lu - fu - 2 * M_PI) < tol) + if (std::abs(lu - fu - 2 * M_PI) < tol) careaboutsens = 1; if (u >= fu - tol && u < fu) u = fu; @@ -527,10 +527,10 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr, if (deru.Dot(Dy) < 0.) { d2dCyl.Reverse(); - if (careaboutsens && Abs(fu - u) < tol) + if (careaboutsens && std::abs(fu - u) < tol) u = lu; } - else if (careaboutsens && Abs(lu - u) < tol) + else if (careaboutsens && std::abs(lu - u) < tol) u = fu; gp_Pnt2d p2dCyl(u, v); gp_Lin2d lin2dCyl(p2dCyl, d2dCyl); diff --git a/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_FilPlnPln.cxx b/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_FilPlnPln.cxx index 174a3d551f..1e14957625 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_FilPlnPln.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_FilPlnPln.cxx @@ -81,7 +81,7 @@ Standard_Boolean ChFiKPart_MakeFillet(TopOpeBRepDS_DataStructure& DStr, gp_Vec V = gp_Vec(D1) + gp_Vec(D2); gp_Dir S(V); gp_Pnt C; - Standard_Real Fac = Radius / Cos(Ang / 2.); + Standard_Real Fac = Radius / std::cos(Ang / 2.); C.SetCoord(Pv.X() + Fac * S.X(), Pv.Y() + Fac * S.Y(), Pv.Z() + Fac * S.Z()); gp_Dir xdir = D1.Reversed(); gp_Ax3 CylAx3(C, AxisCylinder, xdir); diff --git a/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_Sphere.cxx b/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_Sphere.cxx index abe889d305..9d4c752c8b 100644 --- a/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_Sphere.cxx +++ b/src/ModelingAlgorithms/TKFillet/ChFiKPart/ChFiKPart_ComputeData_Sphere.cxx @@ -82,11 +82,11 @@ Standard_Boolean ChFiKPart_Sphere(TopOpeBRepDS_DataStructure& DStr, Standard_Real delta = sqrt(Rad * Rad - rr * rr); gp_Pnt cen(pp.X() + delta * di.X(), pp.Y() + delta * di.Y(), pp.Z() + delta * di.Z()); gp_Dir dz(gp_Vec(p1, cen)); - if (Abs(ds1.Dot(dz) - 1.) > ptol) + if (std::abs(ds1.Dot(dz) - 1.) > ptol) { cen.SetCoord(pp.X() - delta * di.X(), pp.Y() - delta * di.Y(), pp.Z() - delta * di.Z()); dz = gp_Dir(gp_Vec(p1, cen)); - if (Abs(ds1.Dot(dz) - 1.) > ptol) + if (std::abs(ds1.Dot(dz) - 1.) > ptol) { #ifdef OCCT_DEBUG std::cout << "center of the spherical corner not found" << std::endl; @@ -165,7 +165,7 @@ Standard_Boolean ChFiKPart_Sphere(TopOpeBRepDS_DataStructure& DStr, } gp_Vec2d v2d(P1S2, P2S2); gp_Dir2d d2d(v2d); - if (Abs(v2d.Magnitude() - ang) <= ptol) + if (std::abs(v2d.Magnitude() - ang) <= ptol) { gp_Lin2d l2d(P1S2, d2d); C2d = new Geom2d_Line(l2d); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/AppBlend/AppBlend_AppSurf.gxx b/src/ModelingAlgorithms/TKGeomAlgo/AppBlend/AppBlend_AppSurf.gxx index 40873e0ae9..6d2c02d4ea 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/AppBlend/AppBlend_AppSurf.gxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/AppBlend/AppBlend_AppSurf.gxx @@ -227,8 +227,8 @@ void AppBlend_AppSurf::InternalPerform(const Handle(TheLine)& Lin, TColgp_Array1OfPnt tabAppP(1, NbUPoles); TColgp_Array1OfVec tabAppV(1, NbUPoles); - TColgp_Array1OfPnt2d tabP2d(1, Max(1, NbPoles2d)); - TColgp_Array1OfVec2d tabV2d(1, Max(1, NbPoles2d)); + TColgp_Array1OfPnt2d tabP2d(1, std::max(1, NbPoles2d)); + TColgp_Array1OfVec2d tabV2d(1, std::max(1, NbPoles2d)); TColStd_Array1OfReal tabW(1, NbUPoles), tabDW(1, NbUPoles); @@ -414,8 +414,8 @@ void AppBlend_AppSurf::InternalPerform(const Handle(TheLine)& Lin, for (Standard_Integer Index = 1; Index <= theapprox.NbMultiCurves(); Index++) { theapprox.Error(Index, TheTol3d, TheTol2d); - mytol3d = Max(TheTol3d, mytol3d); - mytol2d = Max(TheTol2d, mytol2d); + mytol3d = std::max(TheTol3d, mytol3d); + mytol2d = std::max(TheTol2d, mytol2d); } #ifdef OCCT_DEBUG std::cout << " Tolerances obtenues --> 3d : " << mytol3d << std::endl; @@ -637,15 +637,15 @@ void AppBlend_AppSurf::Perform(const Handle(TheLine)& Lin, X = Y = Z = RealLast(); DX = DY = DZ = RealFirst(); - TColgp_Array1OfPnt2d tabP2d(1, Max(1, NbPoles2d)); - TColgp_Array1OfVec2d tabV2d(1, Max(1, NbPoles2d)); - TColStd_Array1OfReal X2d(1, Max(1, NbPoles2d)); + TColgp_Array1OfPnt2d tabP2d(1, std::max(1, NbPoles2d)); + TColgp_Array1OfVec2d tabV2d(1, std::max(1, NbPoles2d)); + TColStd_Array1OfReal X2d(1, std::max(1, NbPoles2d)); X2d.Init(RealLast()); - TColStd_Array1OfReal Y2d(1, Max(1, NbPoles2d)); + TColStd_Array1OfReal Y2d(1, std::max(1, NbPoles2d)); Y2d.Init(RealLast()); - TColStd_Array1OfReal DX2d(1, Max(1, NbPoles2d)); + TColStd_Array1OfReal DX2d(1, std::max(1, NbPoles2d)); DX2d.Init(RealFirst()); - TColStd_Array1OfReal DY2d(1, Max(1, NbPoles2d)); + TColStd_Array1OfReal DY2d(1, std::max(1, NbPoles2d)); DY2d.Init(RealFirst()); TColStd_Array1OfReal tabW(1, NbUPoles), tabDW(1, NbUPoles); @@ -828,7 +828,7 @@ void AppBlend_AppSurf::Perform(const Handle(TheLine)& Lin, for (itronc = 1; itronc <= nbtronc; itronc++) { troncstart(itronc) = start; - Standard_Integer rabrab = Min(rab, reste); + Standard_Integer rabrab = std::min(rab, reste); if (reste > 0) { reste -= rabrab; @@ -938,9 +938,9 @@ void AppBlend_AppSurf::Perform(const Handle(TheLine)& Lin, { AppParCurves_MultiCurve& mucu = theapprox.ChangeValue(Index); theapprox.Error(Index, TheTol3d, TheTol2d); - mytol3d = Max(TheTol3d / DX, mytol3d); - mytol3d = Max(TheTol3d / DY, mytol3d); - mytol3d = Max(TheTol3d / DZ, mytol3d); + mytol3d = std::max(TheTol3d / DX, mytol3d); + mytol3d = std::max(TheTol3d / DY, mytol3d); + mytol3d = std::max(TheTol3d / DZ, mytol3d); for (j = 1; j <= NbUPoles; j++) { mucu.Transform(j, -X / DX, 1. / DX, -Y / DY, 1. / DY, -Z / DZ, 1. / DZ); @@ -952,8 +952,8 @@ void AppBlend_AppSurf::Perform(const Handle(TheLine)& Lin, 1. / DX2d(j), -Y2d(j) / DY2d(j), 1. / DY2d(j)); - mytol2d = Max(TheTol2d / DX2d(j), mytol2d); - mytol2d = Max(TheTol2d / DY2d(j), mytol2d); + mytol2d = std::max(TheTol2d / DX2d(j), mytol2d); + mytol2d = std::max(TheTol2d / DY2d(j), mytol2d); } concat.Append(mucu); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_Approx.gxx b/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_Approx.gxx index 2bdd0f9db3..740fb551c0 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_Approx.gxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_Approx.gxx @@ -42,9 +42,9 @@ static void ComputeTrsf3d(const Handle(TheWLine)& theline, for (Standard_Integer i = 1; i <= aNbPnts; i++) { const gp_Pnt P = theline->Point(i).Value(); - aXmin = Min(P.X(), aXmin); - aYmin = Min(P.Y(), aYmin); - aZmin = Min(P.Z(), aZmin); + aXmin = std::min(P.X(), aXmin); + aYmin = std::min(P.Y(), aYmin); + aZmin = std::min(P.Z(), aZmin); } theXo = -aXmin; @@ -75,8 +75,8 @@ static void ComputeTrsf2d(const Handle(TheWLine)& theline, const IntSurf_PntOn2S POn2S = theline->Point(i); Standard_Real U, V; (POn2S.*pfunc)(U, V); - aUmin = Min(U, aUmin); - aVmin = Min(V, aVmin); + aUmin = std::min(U, aUmin); + aVmin = std::min(V, aVmin); } theUo = -aUmin; @@ -139,14 +139,14 @@ void ApproxInt_Approx::Parameters(const ApproxInt_TheMultiLine& Line, dist += aP22d.SquareDistance(aP12d); } - dist = Sqrt(dist); + dist = std::sqrt(dist); if (Par == Approx_ChordLength) { TheParameters(i) = TheParameters(i - 1) + dist; } else { // Par == Approx_Centripetal - TheParameters(i) = TheParameters(i - 1) + Sqrt(dist); + TheParameters(i) = TheParameters(i - 1) + std::sqrt(dist); } } for (i = firstP; i <= lastP; i++) @@ -446,8 +446,8 @@ void ApproxInt_Approx::UpdateTolReached() { Standard_Real Tol3D, Tol2D; myComputeLineBezier.Error(ICur, Tol3D, Tol2D); - myTolReached3d = Max(myTolReached3d, Tol3D); - myTolReached2d = Max(myTolReached2d, Tol2D); + myTolReached3d = std::max(myTolReached3d, Tol3D); + myTolReached2d = std::max(myTolReached2d, Tol2D); } } else @@ -567,8 +567,8 @@ void ApproxInt_Approx::buildKnots(const Handle(TheWLine)& theline, myData.indicemax); const Standard_Integer nbp3d = aTestLine.NbP3d(), nbp2d = aTestLine.NbP2d(); - TColgp_Array1OfPnt aTabPnt3d(1, Max(1, nbp3d)); - TColgp_Array1OfPnt2d aTabPnt2d(1, Max(1, nbp2d)); + TColgp_Array1OfPnt aTabPnt3d(1, std::max(1, nbp3d)); + TColgp_Array1OfPnt2d aTabPnt2d(1, std::max(1, nbp2d)); TColgp_Array1OfPnt aPntXYZ(myData.indicemin, myData.indicemax); TColgp_Array1OfPnt2d aPntU1V1(myData.indicemin, myData.indicemax); TColgp_Array1OfPnt2d aPntU2V2(myData.indicemin, myData.indicemax); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_ImpPrmSvSurfaces.gxx b/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_ImpPrmSvSurfaces.gxx index 027b88f7a9..2daf4ddb1c 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_ImpPrmSvSurfaces.gxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_ImpPrmSvSurfaces.gxx @@ -132,7 +132,7 @@ static Standard_Boolean SingularProcessing(const gp_Vec& theDU, // Use sign "+" if theTg3D and theDV are codirectional // and sign "-" if opposite const Standard_Real aDP = theTg3D.Dot(theDV); - theTg2D.SetCoord(0.0, Sign(sqrt(aSQTan / aSqMagnDV), aDP)); + theTg2D.SetCoord(0.0, std::copysign(sqrt(aSQTan / aSqMagnDV), aDP)); } else { @@ -174,7 +174,7 @@ static Standard_Boolean SingularProcessing(const gp_Vec& theDU, // Use sign "+" if theTg3D and theDU are codirectional // and sign "-" if opposite const Standard_Real aDP = theTg3D.Dot(theDU); - theTg2D.SetCoord(Sign(sqrt(aSQTan / aSqMagnDU), aDP), 0.0); + theTg2D.SetCoord(std::copysign(sqrt(aSQTan / aSqMagnDU), aDP), 0.0); } else { @@ -215,7 +215,7 @@ static Standard_Boolean SingularProcessing(const gp_Vec& theDU, // theTg3D is parallel to theDU const Standard_Real aDP = theTg3D.Dot(theDU); - const Standard_Real aLenTg = Sign(sqrt(aSQTan), aDP); + const Standard_Real aLenTg = std::copysign(sqrt(aSQTan), aDP); theTg2D.SetCoord(aLenTg / aLenSum, aLenTg / aLenSum); } else @@ -251,7 +251,7 @@ static Standard_Boolean SingularProcessing(const gp_Vec& theDU, // theTg3D is parallel to theDU const Standard_Real aDP = theTg3D.Dot(theDU); - const Standard_Real aLenTg = Sign(sqrt(aSQTan), aDP); + const Standard_Real aLenTg = std::copysign(sqrt(aSQTan), aDP); theTg2D.SetCoord(aLenTg / aLenSum, -aLenTg / aLenSum); } else @@ -315,7 +315,8 @@ static Standard_Boolean NonSingularProcessing(const gp_Vec& theDU, const Standard_Real aDeltaU = aTgV.SquareMagnitude() / aSQMagn; const Standard_Real aDeltaV = aTgU.SquareMagnitude() / aSQMagn; - theTg2D.SetCoord(Sign(sqrt(aDeltaU), aTgV.Dot(aNormal)), -Sign(sqrt(aDeltaV), aTgU.Dot(aNormal))); + theTg2D.SetCoord(std::copysign(sqrt(aDeltaU), aTgV.Dot(aNormal)), + -std::copysign(sqrt(aDeltaV), aTgU.Dot(aNormal))); return Standard_True; } @@ -559,8 +560,8 @@ Standard_Boolean ApproxInt_ImpPrmSvSurfaces::Compute(Standard_Real& u1, { MyHasBeenComputed = Standard_True; - Standard_Real DistAvantApresU = Abs(PourTesterU - X(1)); - Standard_Real DistAvantApresV = Abs(PourTesterV - X(2)); + Standard_Real DistAvantApresU = std::abs(PourTesterU - X(1)); + Standard_Real DistAvantApresV = std::abs(PourTesterV - X(2)); MyPnt = P = ThePSurfaceTool::Value(aPSurf, X(1), X(2)); @@ -833,7 +834,7 @@ Standard_Boolean ApproxInt_ImpPrmSvSurfaces::SeekPoint(const Standard_Real u1, if (aQSurf.TypeQuadric() != GeomAbs_Plane) { Standard_Real sign = (NewU1 > u1) ? -1 : 1; - while (Abs(u1 - NewU1) > M_PI) + while (std::abs(u1 - NewU1) > M_PI) NewU1 += sign * (M_PI + M_PI); } } @@ -847,7 +848,7 @@ Standard_Boolean ApproxInt_ImpPrmSvSurfaces::SeekPoint(const Standard_Real u1, if (aQSurf.TypeQuadric() != GeomAbs_Plane) { Standard_Real sign = (NewU2 > u2) ? -1 : 1; - while (Abs(u2 - NewU2) > M_PI) + while (std::abs(u2 - NewU2) > M_PI) NewU2 += sign * (M_PI + M_PI); } } @@ -1002,10 +1003,10 @@ Standard_Boolean ApproxInt_ImpPrmSvSurfaces::FillInitialVectorOfSolution( // finding "outboundaried" solution (Rsnld -> NotDone). if (GetUseSolver()) { - Standard_Real du = - Max(Precision::Confusion(), ThePSurfaceTool::UResolution(aPSurf, Precision::Confusion())); - Standard_Real dv = - Max(Precision::Confusion(), ThePSurfaceTool::VResolution(aPSurf, Precision::Confusion())); + Standard_Real du = std::max(Precision::Confusion(), + ThePSurfaceTool::UResolution(aPSurf, Precision::Confusion())); + Standard_Real dv = std::max(Precision::Confusion(), + ThePSurfaceTool::VResolution(aPSurf, Precision::Confusion())); if (X(1) - 0.0000000001 <= binfu) X(1) = X(1) + du; if (X(1) + 0.0000000001 >= bsupu) diff --git a/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_KnotTools.cxx b/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_KnotTools.cxx index 308ffcdfb3..3f5218d06c 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_KnotTools.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_KnotTools.cxx @@ -25,9 +25,8 @@ #include #include -// (Sqrt(5.0) - 1.0) / 4.0 -// static const Standard_Real aSinCoeff = 0.30901699437494742410229341718282; -static const Standard_Real aSinCoeff2 = 0.09549150281252627; // aSinCoeff^2 = (3. - Sqrt(5.)) / 8. +static const Standard_Real aSinCoeff2 = + 0.09549150281252627; // aSinCoeff^2 = (3. - std::sqrt(5.)) / 8. static const Standard_Integer aMaxPntCoeff = 15; //================================================================================================= @@ -78,11 +77,11 @@ static Standard_Real EvalCurv(const Standard_Real dim, return Precision::Infinite(); } - q = Min(q, Precision::Infinite()); + q = std::min(q, Precision::Infinite()); q *= q * q; // - Standard_Real curv = Sqrt(mp / q); + Standard_Real curv = std::sqrt(mp / q); return curv; } @@ -205,8 +204,8 @@ void ApproxInt_KnotTools::ComputeKnotInds(const NCollection_LocalArray 0. && ad1 > eps && ad2 > eps) { @@ -290,11 +289,11 @@ void ApproxInt_KnotTools::ComputeKnotInds(const NCollection_LocalArray aSinCoeff2 * m1 * m2) // Sqrt (mp/(m1*m2)) > aSinCoeff + if (mp > aSinCoeff2 * m1 * m2) // std::sqrt(mp/(m1*m2)) > aSinCoeff { // Insert new knots - Standard_Real d1 = Abs(aCurv(anInd) - aCurv(anIndPrev)); - Standard_Real d2 = Abs(aCurv(anInd) - aCurv(anIndNext)); + Standard_Real d1 = std::abs(aCurv(anInd) - aCurv(anIndPrev)); + Standard_Real d2 = std::abs(aCurv(anInd) - aCurv(anIndNext)); if (d1 > d2) { Ok = InsKnotBefI(j, aCurv, theCoords, dim, theInds, Standard_False); @@ -493,7 +492,7 @@ Standard_Boolean ApproxInt_KnotTools::InsKnotBefI( Standard_Real ac = theCurv(j - 1), ac1 = theCurv(j); if ((curv >= ac && curv <= ac1) || (curv >= ac1 && curv <= ac)) { - if (Abs(curv - ac) < Abs(curv - ac1)) + if (std::abs(curv - ac) < std::abs(curv - ac1)) { mid = j - 1; } @@ -539,7 +538,7 @@ Standard_Boolean ApproxInt_KnotTools::InsKnotBefI( // mp *= 2.; //P(j,i) = -P(i,j); // - if (mp > aSinCoeff2 * m1 * m2) // Sqrt (mp / m1m2) > aSinCoeff + if (mp > aSinCoeff2 * m1 * m2) // std::sqrt(mp / m1m2) > aSinCoeff { theInds.InsertBefore(theI, mid); return Standard_True; @@ -645,7 +644,7 @@ static Standard_Real MaxParamRatio(const math_Vector& thePars) if (aRat < 1.) aRat = 1. / aRat; - aMaxRatio = Max(aMaxRatio, aRat); + aMaxRatio = std::max(aMaxRatio, aRat); } return aMaxRatio; } @@ -681,8 +680,8 @@ Approx_ParametrizationType ApproxInt_KnotTools::DefineParType(const Handle(IntPa theFpar, theLpar); - TColgp_Array1OfPnt aTabPnt3d(1, Max(1, nbp3d)); - TColgp_Array1OfPnt2d aTabPnt2d(1, Max(1, nbp2d)); + TColgp_Array1OfPnt aTabPnt3d(1, std::max(1, nbp3d)); + TColgp_Array1OfPnt2d aTabPnt2d(1, std::max(1, nbp2d)); TColgp_Array1OfPnt aPntXYZ(theFpar, theLpar); TColgp_Array1OfPnt2d aPntU1V1(theFpar, theLpar); TColgp_Array1OfPnt2d aPntU2V2(theFpar, theLpar); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_MultiLine.gxx b/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_MultiLine.gxx index bd2890840c..66f998560d 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_MultiLine.gxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_MultiLine.gxx @@ -69,8 +69,8 @@ ApproxInt_MultiLine::ApproxInt_MultiLine(const Handle_TheLine& line, const Standard_Integer IndMax) : PtrOnmySvSurfaces(svsurf), myLine(line), - indicemin(Min(IndMin, IndMax)), - indicemax(Max(IndMin, IndMax)), + indicemin(std::min(IndMin, IndMax)), + indicemax(std::max(IndMin, IndMax)), nbp3d(NbP3d), nbp2d(NbP2d), myApproxU1V1(ApproxU1V1), @@ -112,8 +112,8 @@ ApproxInt_MultiLine::ApproxInt_MultiLine(const Handle_TheLine& line, const Standard_Integer IndMax) : PtrOnmySvSurfaces(0), myLine(line), - indicemin(Min(IndMin, IndMax)), - indicemax(Max(IndMin, IndMax)), + indicemin(std::min(IndMin, IndMax)), + indicemax(std::max(IndMin, IndMax)), nbp3d(NbP3d), nbp2d(NbP2d), myApproxU1V1(ApproxU1V1), @@ -667,12 +667,12 @@ Standard_Boolean ApproxInt_MultiLine::MakeMLOneMorePoint(const Standard_Integer vmid2 = (vprev2 + vcur2) / 2; IntSurf_PntOn2S MidPoint; Standard_Boolean IsNewPointInvalid = Standard_False; - IsNewPointInvalid = - myApproxU1V1 && Abs(ucur1 - umid1) <= tolerance(1) && Abs(vcur1 - vmid1) <= tolerance(2); + IsNewPointInvalid = myApproxU1V1 && std::abs(ucur1 - umid1) <= tolerance(1) + && std::abs(vcur1 - vmid1) <= tolerance(2); if (!IsNewPointInvalid) { - IsNewPointInvalid = - myApproxU2V2 && Abs(ucur2 - umid2) <= tolerance(1) && Abs(vcur2 - vmid2) <= tolerance(2); + IsNewPointInvalid = myApproxU2V2 && std::abs(ucur2 - umid2) <= tolerance(1) + && std::abs(vcur2 - vmid2) <= tolerance(2); if (!IsNewPointInvalid && ((TheSvSurfaces*)PtrOnmySvSurfaces)->SeekPoint(umid1, vmid1, umid2, vmid2, MidPoint)) { diff --git a/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_PrmPrmSvSurfaces.gxx b/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_PrmPrmSvSurfaces.gxx index 06e93a5ab7..8b308ac91c 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_PrmPrmSvSurfaces.gxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/ApproxInt/ApproxInt_PrmPrmSvSurfaces.gxx @@ -347,7 +347,7 @@ Standard_Boolean ApproxInt_PrmPrmSvSurfaces::TangencyOnSurf2(const Standard_Real DeltaU = (TgTU - TgTV * TUTV ) / UmTUTV2 ; DeltaV = (TgTV - TgTU * TUTV ) / UmTUTV2 ; - Delta = 1.0 / Sqrt(DeltaU * DeltaU + DeltaV * DeltaV); + Delta = 1.0 / std::sqrt(DeltaU * DeltaU + DeltaV * DeltaV); Tguv1.Multiplied(Delta); MyTguv1 = Tguv1; @@ -364,7 +364,7 @@ Standard_Boolean ApproxInt_PrmPrmSvSurfaces::TangencyOnSurf2(const Standard_Real DeltaU = (TgTU - TgTV * TUTV ) / UmTUTV2 ; DeltaV = (TgTV - TgTU * TUTV ) / UmTUTV2 ; - Delta = 1.0 / Sqrt(DeltaU * DeltaU + DeltaV * DeltaV); + Delta = 1.0 / std::sqrt(DeltaU * DeltaU + DeltaV * DeltaV); Tguv2.Multiplied(Delta); MyTguv2 = Tguv2; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_Batten.cxx b/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_Batten.cxx index c39831985b..42d118b109 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_Batten.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_Batten.cxx @@ -173,20 +173,22 @@ Standard_Boolean FairCurve_Batten::Compute(FairCurve_AnalysisCode& ACode, Ratio = 1; if (NewConstraintOrder1 > 0) { - Fraction = Abs(DAngle1) / (AngleMax * Exp(-Abs(OldAngle1) / AngleMax) + AngleMin); + Fraction = + std::abs(DAngle1) / (AngleMax * std::exp(-std::abs(OldAngle1) / AngleMax) + AngleMin); if (Fraction > 1) Ratio = 1 / Fraction; } if (NewConstraintOrder2 > 0) { - Fraction = Abs(DAngle2) / (AngleMax * Exp(-Abs(OldAngle2) / AngleMax) + AngleMin); + Fraction = + std::abs(DAngle2) / (AngleMax * std::exp(-std::abs(OldAngle2) / AngleMax) + AngleMin); if (Fraction > 1) Ratio = (Ratio < 1 / Fraction ? Ratio : 1 / Fraction); } OldDist = OldP1.Distance(OldP2); NewDist = NewP1.Distance(NewP2); - Fraction = Abs(OldDist - NewDist) / (OldDist / 3); + Fraction = std::abs(OldDist - NewDist) / (OldDist / 3); if (Fraction > 1) Ratio = (Ratio < 1 / Fraction ? Ratio : 1 / Fraction); @@ -438,9 +440,10 @@ Standard_Boolean FairCurve_Batten::Compute(const gp_Vec2d& DeltaP1, ACode = FairCurve_InfiniteSliding; // Eventual insertion of Nodes - Standard_Boolean NewKnots = Standard_False; - Standard_Integer NbKnots = Knots->Length(); - Standard_Real ValAngles = (Abs(OldAngle1) + Abs(OldAngle2) + 2 * Abs(OldAngle2 - OldAngle1)); + Standard_Boolean NewKnots = Standard_False; + Standard_Integer NbKnots = Knots->Length(); + Standard_Real ValAngles = + (std::abs(OldAngle1) + std::abs(OldAngle2) + 2 * std::abs(OldAngle2 - OldAngle1)); while (ValAngles > (2 * (NbKnots - 2) + 1) * (1 + 2 * NbKnots)) { NewKnots = Standard_True; @@ -501,14 +504,14 @@ Standard_Real FairCurve_Batten::SlidingOfReference(const Standard_Real Dist, return Dist; if (NewConstraintOrder1 == 0) - a1 = Abs(Abs(NewAngle2) < M_PI ? Angle2 / 2 : M_PI / 2); + a1 = std::abs(std::abs(NewAngle2) < M_PI ? Angle2 / 2 : M_PI / 2); else - a1 = Abs(Angle1); + a1 = std::abs(Angle1); if (NewConstraintOrder2 == 0) - a2 = Abs(Abs(NewAngle1) < M_PI ? Angle1 / 2 : M_PI / 2); + a2 = std::abs(std::abs(NewAngle1) < M_PI ? Angle1 / 2 : M_PI / 2); else - a2 = Abs(Angle2); + a2 = std::abs(Angle2); // case of angle of the same sign if (Angle1 * Angle2 >= 0) @@ -559,7 +562,7 @@ Standard_Real FairCurve_Batten::Compute(const Standard_Real Dist, const Standard } // length of circle P1P2 respecting ANGLE if (Angle > M_PI) { - return Sqrt(Angle * M_PI) * Dist; + return std::sqrt(Angle * M_PI) * Dist; } else { diff --git a/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_DistributionOfJerk.cxx b/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_DistributionOfJerk.cxx index 3f850dea9f..26dae4c692 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_DistributionOfJerk.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_DistributionOfJerk.cxx @@ -170,8 +170,8 @@ Standard_Boolean FairCurve_DistributionOfJerk::Value(const math_Vector& TParam, // (3) Evaluation du Hessien de la tension locale ---------------------- - Standard_Real FacteurX = (1 - Pow(XPrim * InvNormeCPrim, 2)) * InvNormeCPrim; - Standard_Real FacteurY = (1 - Pow(YPrim * InvNormeCPrim, 2)) * InvNormeCPrim; + Standard_Real FacteurX = (1 - std::pow(XPrim * InvNormeCPrim, 2)) * InvNormeCPrim; + Standard_Real FacteurY = (1 - std::pow(YPrim * InvNormeCPrim, 2)) * InvNormeCPrim; Standard_Real FacteurXY = -(XPrim * InvNormeCPrim) * (YPrim * InvNormeCPrim) * InvNormeCPrim; Standard_Real FacteurW = WVal * InvNormeCPrim; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_DistributionOfSagging.cxx b/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_DistributionOfSagging.cxx index a444563898..4cf1be271e 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_DistributionOfSagging.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_DistributionOfSagging.cxx @@ -143,8 +143,8 @@ Standard_Boolean FairCurve_DistributionOfSagging::Value(const math_Vector& TPara // (3) Evaluation du Hessien de la tension locale ---------------------- - Standard_Real FacteurX = (1 - Pow(XPrim * InvNormeCPrim, 2)) * InvNormeCPrim; - Standard_Real FacteurY = (1 - Pow(YPrim * InvNormeCPrim, 2)) * InvNormeCPrim; + Standard_Real FacteurX = (1 - std::pow(XPrim * InvNormeCPrim, 2)) * InvNormeCPrim; + Standard_Real FacteurY = (1 - std::pow(YPrim * InvNormeCPrim, 2)) * InvNormeCPrim; Standard_Real FacteurXY = -(XPrim * InvNormeCPrim) * (YPrim * InvNormeCPrim) * InvNormeCPrim; Standard_Real FacteurW = WVal * InvNormeCPrim; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_Energy.cxx b/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_Energy.cxx index ca12694380..ed2e9c9ec8 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_Energy.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_Energy.cxx @@ -48,10 +48,10 @@ FairCurve_Energy::FairCurve_Energy(const Handle(TColgp_HArray1OfPnt2d)& Poles, MyHessian(0, MyNbValues + MyNbValues * (MyNbValues + 1) / 2) { // chesk angles in reference (Ox,Oy) - gp_XY L0(Cos(Angle1), Sin(Angle1)), L1(-Cos(Angle2), Sin(Angle2)); + gp_XY L0(std::cos(Angle1), std::sin(Angle1)), L1(-std::cos(Angle2), std::sin(Angle2)); MyLinearForm.SetValue(0, L0); MyLinearForm.SetValue(1, L1); - gp_XY Q0(-Sin(Angle1), Cos(Angle1)), Q1(Sin(Angle2), Cos(Angle2)); + gp_XY Q0(-std::sin(Angle1), std::cos(Angle1)), Q1(std::sin(Angle2), std::cos(Angle2)); MyQuadForm.SetValue(0, ((double)Degree) / (Degree - 1) * Curvature1 * Q0); MyQuadForm.SetValue(1, ((double)Degree) / (Degree - 1) * Curvature2 * Q1); } @@ -218,7 +218,7 @@ void FairCurve_Energy::Hessian1(const math_Vector& Vect, math_Matrix& H) + (Laux.X() * (MyLinearForm(0).X() * Vect(kk) + MyLinearForm(0).Y() * Vect(kk + 1)) + Laux.Y() * (MyLinearForm(0).X() * Vect(ii) + MyLinearForm(0).Y() * Vect(ii + 1))) + Laux.X() * Laux.Y() * Vect(ii + 2)) - + (Pow(Laux.X(), 2) * Vect(kk + 2) + Pow(Laux.Y(), 2) * Vect(ii + 3)); + + (std::pow(Laux.X(), 2) * Vect(kk + 2) + std::pow(Laux.Y(), 2) * Vect(ii + 3)); H(2, 1) = (Cos0 * Vect(kk) + CosSin0 * (Vect(ii) + Vect(kk + 1)) / 2 + Sin0 * Vect(ii + 1)) + Laux * MyLinearForm(0).Multiplied(Aux) @@ -321,7 +321,7 @@ void FairCurve_Energy::Hessian1(const math_Vector& Vect, math_Matrix& H) + Laux.Y() * (MyLinearForm(1).X() * Vect(kk + 1) + MyLinearForm(1).Y() * Vect(ii + 1))) + Laux.X() * Laux.Y() * Vect(ll + jj)) - + (Pow(Laux.X(), 2) * Vect(ll) + Pow(Laux.Y(), 2) * Vect(ll + jj + 1)); + + (std::pow(Laux.X(), 2) * Vect(ll) + std::pow(Laux.Y(), 2) * Vect(ll + jj + 1)); H(FinH + 2, FinH + 1) = Cos1 * Vect(kk) + CosSin1 * (Vect(ii) + Vect(kk + 1)) / 2 + Sin1 * Vect(ii + 1); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_MinimalVariation.cxx b/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_MinimalVariation.cxx index 114367b310..3c26df8c96 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_MinimalVariation.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_MinimalVariation.cxx @@ -77,33 +77,35 @@ Standard_Boolean FairCurve_MinimalVariation::Compute(FairCurve_AnalysisCode& ACo if (NewConstraintOrder1 > 0) { - Fraction = Abs(DAngle1) / (AngleMax * Exp(-Abs(OldAngle1) / AngleMax) + AngleMin); + Fraction = + std::abs(DAngle1) / (AngleMax * std::exp(-std::abs(OldAngle1) / AngleMax) + AngleMin); if (Fraction > 1) Ratio = 1 / Fraction; } if (NewConstraintOrder2 > 0) { - Fraction = Abs(DAngle2) / (AngleMax * Exp(-Abs(OldAngle2) / AngleMax) + AngleMin); + Fraction = + std::abs(DAngle2) / (AngleMax * std::exp(-std::abs(OldAngle2) / AngleMax) + AngleMin); if (Fraction > 1) Ratio = (Ratio < 1 / Fraction ? Ratio : 1 / Fraction); } OldDist = OldP1.Distance(OldP2); NewDist = NewP1.Distance(NewP2); - Fraction = Abs(OldDist - NewDist) / (OldDist / 3); + Fraction = std::abs(OldDist - NewDist) / (OldDist / 3); if (Fraction > 1) Ratio = (Ratio < 1 / Fraction ? Ratio : 1 / Fraction); if (NewConstraintOrder1 > 1) { - Fraction = Abs(DRho1) * OldDist / (2 + Abs(OldAngle1) + Abs(OldAngle2)); + Fraction = std::abs(DRho1) * OldDist / (2 + std::abs(OldAngle1) + std::abs(OldAngle2)); if (Fraction > 1) Ratio = (Ratio < 1 / Fraction ? Ratio : 1 / Fraction); } if (NewConstraintOrder2 > 1) { - Fraction = Abs(DRho2) * OldDist / (2 + Abs(OldAngle1) + Abs(OldAngle2)); + Fraction = std::abs(DRho2) * OldDist / (2 + std::abs(OldAngle1) + std::abs(OldAngle2)); if (Fraction > 1) Ratio = (Ratio < 1 / Fraction ? Ratio : 1 / Fraction); } @@ -437,9 +439,10 @@ Standard_Boolean FairCurve_MinimalVariation::Compute(const gp_Vec2d& Del ACode = FairCurve_InfiniteSliding; // Eventual insertion of Nodes - Standard_Boolean NewKnots = Standard_False; - Standard_Integer NbKnots = Knots->Length(); - Standard_Real ValAngles = (Abs(OldAngle1) + Abs(OldAngle2) + 2 * Abs(OldAngle2 - OldAngle1)); + Standard_Boolean NewKnots = Standard_False; + Standard_Integer NbKnots = Knots->Length(); + Standard_Real ValAngles = + (std::abs(OldAngle1) + std::abs(OldAngle2) + 2 * std::abs(OldAngle2 - OldAngle1)); while (ValAngles > (2 * (NbKnots - 2) + 1) * (1 + 2 * NbKnots)) { NewKnots = Standard_True; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_Newton.cxx b/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_Newton.cxx index 0664761e55..6fa2180cb7 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_Newton.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/FairCurve/FairCurve_Newton.cxx @@ -45,5 +45,6 @@ Standard_Boolean FairCurve_Newton::IsConverged() const { const Standard_Real N = TheStep.Norm(); return (N <= 0.01 * mySpTol) - || (N <= mySpTol && Abs(TheMinimum - PreviousMinimum) <= XTol * Abs(PreviousMinimum)); + || (N <= mySpTol + && std::abs(TheMinimum - PreviousMinimum) <= XTol * std::abs(PreviousMinimum)); } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GTests/Geom2dAPI_InterCurveCurve_Test.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GTests/Geom2dAPI_InterCurveCurve_Test.cxx index 83b34222ae..80f23689e1 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GTests/Geom2dAPI_InterCurveCurve_Test.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GTests/Geom2dAPI_InterCurveCurve_Test.cxx @@ -35,7 +35,7 @@ TEST(Geom2dAPI_InterCurveCurve_Test, OCC29289_EllipseIntersectionNewtonRoot) Intersector.Init(Ge1, Ge2, 1.e-7); EXPECT_GT(Intersector.NbPoints(), 0) << "Error: intersector found no points"; - // Setup trigonometric equation: A*Cos(x) + B*Sin(x) + C*Cos(2*x) + D*Sin(2*x) + E + // Setup trigonometric equation: A*std::cos(x) + B*Sin(x) + C*std::cos(2*x) + D*Sin(2*x) + E Standard_Real A, B, C, D, E; A = 1.875; B = -.75; @@ -61,6 +61,6 @@ TEST(Geom2dAPI_InterCurveCurve_Test, OCC29289_EllipseIntersectionNewtonRoot) ASSERT_TRUE(Resol.IsDone()) << "Error: Newton is not done for " << Teta; Standard_Real TetaNewton = Resol.Root(); - EXPECT_LE(Abs(Teta - TetaNewton), 1.e-7) << "Error: Newton root is wrong for " << Teta; + EXPECT_LE(std::abs(Teta - TetaNewton), 1.e-7) << "Error: Newton root is wrong for " << Teta; } } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn.cxx index 8c5a0237ed..c5644312b1 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn.cxx @@ -66,7 +66,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, WellDone = Standard_False; NbrSol = 0; Standard_Integer nbsol = 0; - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsEnclosing() || Qualified2.IsOutside() @@ -95,33 +95,33 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, // Processing of boundary cases. + //========================================================================= - if (Abs(d3 - d4) < Tol + if (std::abs(d3 - d4) < Tol && (Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) && (Qualified2.IsEnclosed() || Qualified2.IsOutside() || Qualified2.IsUnqualified())) { nbsol++; - Radius(nbsol) = Abs(d3); + Radius(nbsol) = std::abs(d3); WellDone = Standard_True; } - if (Abs(d1 - d2) < Tol && (Qualified1.IsEnclosing() || Qualified1.IsUnqualified()) + if (std::abs(d1 - d2) < Tol && (Qualified1.IsEnclosing() || Qualified1.IsUnqualified()) && (Qualified2.IsEnclosing() || Qualified2.IsUnqualified())) { nbsol++; - Radius(nbsol) = Abs(d1); + Radius(nbsol) = std::abs(d1); WellDone = Standard_True; } - if (Abs(d1 - d4) < Tol && (Qualified1.IsEnclosing() || Qualified1.IsUnqualified()) + if (std::abs(d1 - d4) < Tol && (Qualified1.IsEnclosing() || Qualified1.IsUnqualified()) && (Qualified2.IsEnclosed() || Qualified2.IsOutside() || Qualified2.IsUnqualified())) { nbsol++; - Radius(nbsol) = Abs(d1); + Radius(nbsol) = std::abs(d1); WellDone = Standard_True; } - if (Abs(d3 - d2) < Tol && (Qualified2.IsEnclosing() || Qualified2.IsUnqualified()) + if (std::abs(d3 - d2) < Tol && (Qualified2.IsEnclosing() || Qualified2.IsUnqualified()) && (Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { nbsol++; - Radius(nbsol) = Abs(d3); + Radius(nbsol) = std::abs(d3); WellDone = Standard_True; } gp_Lin2d L(center1, gp_Dir2d(center2.XY() - center1.XY())); @@ -145,11 +145,11 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius(i) - R1) < Tol) + else if (std::abs(distcc1 + Radius(i) - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius(i)) < Tol) + else if (std::abs(distcc1 - R1 - Radius(i)) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -161,11 +161,11 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { qualifier2(NbrSol) = Qualified2.Qualifier(); } - else if (Abs(distcc2 + Radius(i) - R2) < Tol) + else if (std::abs(distcc2 + Radius(i) - R2) < Tol) { qualifier2(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc2 - R2 - Radius(i)) < Tol) + else if (std::abs(distcc2 - R2 - Radius(i)) < Tol) { qualifier2(NbrSol) = GccEnt_outside; } @@ -240,7 +240,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, if (dist1 - R1 < Tol) { nbsol = 1; - Rbid(1) = Abs(R1 - dist1); + Rbid(1) = std::abs(R1 - dist1); } } else if (Qualified1.IsOutside()) @@ -248,7 +248,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, if (R1 - dist1 < Tol) { nbsol = 1; - Rbid(1) = Abs(dist1 - R1); + Rbid(1) = std::abs(dist1 - R1); } } else if (Qualified1.IsEnclosing()) @@ -260,14 +260,14 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { nbsol = 2; Rbid(1) = dist1 + R1; - Rbid(1) = Abs(dist1 - R1); + Rbid(1) = std::abs(dist1 - R1); } if (Qualified2.IsEnclosed() && nbsol != 0) { if (dist2 - R2 < Tol) { nsol = 1; - RBid(1) = Abs(R2 - dist2); + RBid(1) = std::abs(R2 - dist2); } } else if (Qualified2.IsOutside() && nbsol != 0) @@ -275,7 +275,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, if (R2 - dist2 < Tol) { nsol = 1; - RBid(1) = Abs(R2 - dist2); + RBid(1) = std::abs(R2 - dist2); } } else if (Qualified2.IsEnclosing() && nbsol != 0) @@ -287,13 +287,13 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { nsol = 2; RBid(1) = dist2 + R2; - RBid(2) = Abs(R2 - dist2); + RBid(2) = std::abs(R2 - dist2); } for (Standard_Integer isol = 1; isol <= nbsol; isol++) { for (Standard_Integer jsol = 1; jsol <= nsol; jsol++) { - if (Abs(Rbid(isol) - RBid(jsol)) <= Tol) + if (std::abs(Rbid(isol) - RBid(jsol)) <= Tol) { nnsol++; Radius(nnsol) = (RBid(jsol) + Rbid(isol)) / 2.; @@ -313,11 +313,11 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius(i) - R1) < Tol) + else if (std::abs(distcc1 + Radius(i) - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius(i)) < Tol) + else if (std::abs(distcc1 - R1 - Radius(i)) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -329,11 +329,11 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { qualifier2(NbrSol) = Qualified2.Qualifier(); } - else if (Abs(distcc2 + Radius(i) - R2) < Tol) + else if (std::abs(distcc2 + Radius(i) - R2) < Tol) { qualifier2(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc2 - R2 - Radius(i)) < Tol) + else if (std::abs(distcc2 - R2 - Radius(i)) < Tol) { qualifier2(NbrSol) = GccEnt_outside; } @@ -341,7 +341,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { qualifier2(NbrSol) = GccEnt_enclosing; } - if (Center.Distance(center1) <= Tol && Abs(Radius(k) - C1.Radius()) <= Tol) + if (Center.Distance(center1) <= Tol && std::abs(Radius(k) - C1.Radius()) <= Tol) { TheSame1(NbrSol) = 1; } @@ -353,7 +353,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, par1sol(NbrSol) = ElCLib::Parameter(cirsol(NbrSol), pnttg1sol(NbrSol)); pararg1(NbrSol) = ElCLib::Parameter(C1, pnttg2sol(NbrSol)); } - if (Center.Distance(center2) <= Tol && Abs(Radius(k) - C2.Radius()) <= Tol) + if (Center.Distance(center2) <= Tol && std::abs(Radius(k) - C2.Radius()) <= Tol) { TheSame2(NbrSol) = 1; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_1.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_1.cxx index e38300ffb1..5ad05183b0 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_1.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_1.cxx @@ -74,7 +74,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, throw GccEnt_BadQualifier(); return; } - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); Standard_Real Radius = 0; Standard_Boolean ok = Standard_False; gp_Dir2d dirx(gp_Dir2d::D::X); @@ -100,14 +100,14 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, Standard_Real dist2 = L2.Distance(pinterm); if (Qualified1.IsEnclosed() || Qualified1.IsOutside()) { - if (Abs(distcl - R1 - dist2) <= Tol) + if (std::abs(distcl - R1 - dist2) <= Tol) { ok = Standard_True; } } else if (Qualified1.IsEnclosing()) { - if (Abs(dist2 - distcl - R1) <= Tol) + if (std::abs(dist2 - distcl - R1) <= Tol) { ok = Standard_True; } @@ -161,11 +161,11 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + dist2 - R1) < Tol) + else if (std::abs(distcc1 + dist2 - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - dist2) < Tol) + else if (std::abs(distcc1 - R1 - dist2) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -235,7 +235,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { if (dist1 - R1 < Tolerance) { - if (Abs(Abs(R1 - dist1) - dist2) < Tolerance) + if (std::abs(std::abs(R1 - dist1) - dist2) < Tolerance) { ok = Standard_True; } @@ -245,7 +245,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { if (R1 - dist1 < Tolerance) { - if (Abs(Abs(R1 - dist1) - dist2) < Tolerance) + if (std::abs(std::abs(R1 - dist1) - dist2) < Tolerance) { ok = Standard_True; } @@ -292,11 +292,11 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius - R1) < Tol) + else if (std::abs(distcc1 + Radius - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius) < Tol) + else if (std::abs(distcc1 - R1 - Radius) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -316,7 +316,8 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { qualifier2(NbrSol) = GccEnt_enclosed; } - if (Center.Distance(center1) <= Tolerance && Abs(Radius - C1.Radius()) <= Tolerance) + if (Center.Distance(center1) <= Tolerance + && std::abs(Radius - C1.Radius()) <= Tolerance) { TheSame1(NbrSol) = 1; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_10.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_10.cxx index 0f306b6cb7..380254ce36 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_10.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_10.cxx @@ -72,7 +72,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedLin& Qualified1, throw GccEnt_BadQualifier(); return; } - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); gp_Dir2d dirx(gp_Dir2d::D::X); gp_Lin2d L1 = Qualified1.Qualified(); gp_Pnt2d originL1(L1.Location()); @@ -89,7 +89,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedLin& Qualified1, gp_Pnt2d pinterm(Point2.XY() + (distpc + Ron) * dir.XY()); Standard_Real dist1 = L1.Distance(pinterm); - if (Abs(dist1 - distpc + Ron) <= Tol) + if (std::abs(dist1 - distpc + Ron) <= Tol) { dir = gp_Dir2d(-dirL1.Y(), dirL1.X()); gp_Dir2d direc(originL1.XY() - pinterm.XY()); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_11.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_11.cxx index da449bbd73..fb1e7d3259 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_11.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_11.cxx @@ -67,30 +67,31 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const gp_Pnt2d& Point1, WellDone = Standard_False; NbrSol = 0; gp_Dir2d dirx(gp_Dir2d::D::X); - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); Standard_Real dist = Point1.Distance(Point2); Standard_Real dp1cen = Point1.Distance(OnCirc.Location()); Standard_Real dp2cen = Point2.Distance(OnCirc.Location()); Standard_Real R = OnCirc.Radius(); gp_Circ2d C1 = OnCirc; - if (dist < Tol || Abs(dp1cen + 2 * R - dp2cen) < Tol || Abs(dp2cen + 2 * R - dp1cen) < Tol) + if (dist < Tol || std::abs(dp1cen + 2 * R - dp2cen) < Tol + || std::abs(dp2cen + 2 * R - dp1cen) < Tol) { WellDone = Standard_True; return; } gp_Lin2d L1(gp_Pnt2d((Point1.XY() + Point2.XY()) / 2.0), gp_Dir2d(Point1.Y() - Point2.Y(), Point2.X() - Point1.X())); - if (Abs(dp1cen + 2 * R - dp2cen) < Tol || Abs(dp2cen + 2 * R - dp1cen) < Tol) + if (std::abs(dp1cen + 2 * R - dp2cen) < Tol || std::abs(dp2cen + 2 * R - dp1cen) < Tol) { - if (Abs(dp1cen + 2 * R - dp2cen) < Tol) + if (std::abs(dp1cen + 2 * R - dp2cen) < Tol) { C1 = gp_Circ2d(gp_Ax2d(OnCirc.Location(), dirx), - OnCirc.Radius() + Abs(dp2cen - dp1cen - 2.0 * R)); + OnCirc.Radius() + std::abs(dp2cen - dp1cen - 2.0 * R)); } - else if (Abs(dp1cen + 2 * R - dp2cen) < Tol) + else if (std::abs(dp1cen + 2 * R - dp2cen) < Tol) { C1 = gp_Circ2d(gp_Ax2d(OnCirc.Location(), dirx), - OnCirc.Radius() + Abs(dp2cen - dp1cen - 2.0 * R)); + OnCirc.Radius() + std::abs(dp2cen - dp1cen - 2.0 * R)); } } IntAna2d_AnaIntersection Intp(L1, C1); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_2.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_2.cxx index dd6b958feb..d151b3b388 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_2.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_2.cxx @@ -59,7 +59,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedLin& Qualified1, } gp_Dir2d dirx(gp_Dir2d::D::X); - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); // calculation of bisectrices of L1 and L2 gp_Lin2d L1(Qualified1.Qualified()); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_3.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_3.cxx index 0d9345f319..ce115eeddb 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_3.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_3.cxx @@ -65,7 +65,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { TheSame1.Init(0); TheSame2.Init(0); - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; NbrSol = 0; if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() @@ -92,21 +92,21 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, pinterm = gp_Pnt2d(Point2.XY() - dp2l * gp_XY(-donline.Y(), donline.X())); } Standard_Real dist = pinterm.Distance(center1); - if (Qualified1.IsEnclosed() && Abs(R1 - dist - dp2l) <= Tol) + if (Qualified1.IsEnclosed() && std::abs(R1 - dist - dp2l) <= Tol) { WellDone = Standard_True; } - else if (Qualified1.IsEnclosing() && Abs(R1 + dist - dp2l) <= Tol) + else if (Qualified1.IsEnclosing() && std::abs(R1 + dist - dp2l) <= Tol) { WellDone = Standard_True; } - else if (Qualified1.IsOutside() && Abs(dist - dp2l) <= Tol) + else if (Qualified1.IsOutside() && std::abs(dist - dp2l) <= Tol) { WellDone = Standard_True; } else if (Qualified1.IsUnqualified() - && (Abs(dist - dp2l) <= Tol || Abs(R1 - dist - dp2l) <= Tol - || Abs(R1 + dist - dp2l) <= Tol)) + && (std::abs(dist - dp2l) <= Tol || std::abs(R1 - dist - dp2l) <= Tol + || std::abs(R1 + dist - dp2l) <= Tol)) { WellDone = Standard_True; } @@ -121,11 +121,11 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + dp2l - R1) < Tol) + else if (std::abs(distcc1 + dp2l - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - dp2l) < Tol) + else if (std::abs(distcc1 - R1 - dp2l) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -188,7 +188,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, if (dist1 - C1.Radius() <= Tolerance) { ok = Standard_True; - Radius(1) = Abs(C1.Radius() - dist1); + Radius(1) = std::abs(C1.Radius() - dist1); } } else if (Qualified1.IsOutside()) @@ -196,7 +196,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, if (C1.Radius() - dist1 <= Tolerance) { ok = Standard_True; - Radius(1) = Abs(C1.Radius() - dist1); + Radius(1) = std::abs(C1.Radius() - dist1); } } else if (Qualified1.IsEnclosing()) @@ -207,14 +207,14 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, /* else if (Qualified1.IsUnqualified() && ok) { ok = Standard_True; nbsol = 2; - Radius(1) = Abs(C1.Radius()-dist1); + Radius(1) = std::abs(C1.Radius()-dist1); Radius(2) = C1.Radius()+dist1; } */ else if (Qualified1.IsUnqualified()) { Standard_Real popradius = Center.Distance(Point2); - if (Abs(popradius - dist1)) + if (std::abs(popradius - dist1)) { ok = Standard_True; Radius(1) = popradius; @@ -233,11 +233,11 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius(k) - R1) < Tol) + else if (std::abs(distcc1 + Radius(k) - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius(k)) < Tol) + else if (std::abs(distcc1 - R1 - Radius(k)) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -247,7 +247,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, } qualifier2(NbrSol) = GccEnt_noqualifier; if (Center.Distance(center1) <= Tolerance - && Abs(Radius(k) - C1.Radius()) <= Tolerance) + && std::abs(Radius(k) - C1.Radius()) <= Tolerance) { TheSame1(NbrSol) = 1; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_4.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_4.cxx index 585076dbe0..4c8daed48b 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_4.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_4.cxx @@ -75,7 +75,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedLin& Qualified1, throw GccEnt_BadQualifier(); return; } - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); gp_Dir2d dirx(gp_Dir2d::D::X); gp_Lin2d L1 = Qualified1.Qualified(); gp_Pnt2d originL1(L1.Location()); @@ -102,7 +102,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedLin& Qualified1, pinterm = gp_Pnt2d(Point2.XY() - dp2l * gp_XY(-donline.Y(), donline.X())); } Standard_Real dist = L1.Distance(pinterm); - if (Abs(dist - dp2l) <= Tol) + if (std::abs(dist - dp2l) <= Tol) { gp_Dir2d dirbid(originL1.XY() - pinterm.XY()); if (Qualified1.IsEnclosed() && dirbid.Dot(normal) < 0.) diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_5.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_5.cxx index 14e4887a35..7cb717a36b 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_5.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_5.cxx @@ -61,7 +61,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const gp_Pnt2d& Point1, gp_Dir2d dirx(gp_Dir2d::D::X); Standard_Real dist = Point1.Distance(Point2); - if (dist < Abs(Tolerance)) + if (dist < std::abs(Tolerance)) { WellDone = Standard_True; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_6.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_6.cxx index e37a16e15b..3cab2bc11d 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_6.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_6.cxx @@ -72,7 +72,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, throw GccEnt_BadQualifier(); return; } - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); gp_Circ2d C1 = Qualified1.Qualified(); gp_Circ2d C2 = Qualified2.Qualified(); gp_Dir2d dirx(gp_Dir2d::D::X); @@ -96,19 +96,19 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, gp_Pnt2d pinterm(center1.XY() + (distcco - Ron) * dircc.XY()); Standard_Real distcc2 = pinterm.Distance(center2); Standard_Real distcc1 = pinterm.Distance(center1); - Standard_Real d1 = Abs(distcc2 - R2 - Abs(distcc1 - R1)); - Standard_Real d2 = Abs(distcc2 + R2 - Abs(distcc1 - R1)); - Standard_Real d3 = Abs(distcc2 - R2 - (distcc1 + R1)); - Standard_Real d4 = Abs(distcc2 + R2 - (distcc1 + R1)); + Standard_Real d1 = std::abs(distcc2 - R2 - std::abs(distcc1 - R1)); + Standard_Real d2 = std::abs(distcc2 + R2 - std::abs(distcc1 - R1)); + Standard_Real d3 = std::abs(distcc2 - R2 - (distcc1 + R1)); + Standard_Real d4 = std::abs(distcc2 + R2 - (distcc1 + R1)); if (d1 > Tol || d2 > Tol || d3 > Tol || d4 > Tol) { pinterm = gp_Pnt2d(center1.XY() + (distcco + Ron) * dircc.XY()); distcc2 = pinterm.Distance(center2); distcc1 = pinterm.Distance(center1); - d1 = Abs(distcc2 - R2 - Abs(distcc1 - R1)); - d2 = Abs(distcc2 + R2 - Abs(distcc1 - R1)); - d3 = Abs(distcc2 - R2 - (distcc1 + R1)); - d4 = Abs(distcc2 + R2 - (distcc1 + R1)); + d1 = std::abs(distcc2 - R2 - std::abs(distcc1 - R1)); + d2 = std::abs(distcc2 + R2 - std::abs(distcc1 - R1)); + d3 = std::abs(distcc2 - R2 - (distcc1 + R1)); + d4 = std::abs(distcc2 + R2 - (distcc1 + R1)); if (d1 > Tol || d2 > Tol || d3 > Tol || d4 > Tol) { nbsol1 = 0; @@ -119,7 +119,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, if (Qualified1.IsEnclosed() || Qualified1.IsOutside()) { nbsol1 = 1; - Radius(1) = Abs(distcc1 - R1); + Radius(1) = std::abs(distcc1 - R1); } else if (Qualified1.IsEnclosing()) { @@ -129,13 +129,13 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, else if (Qualified1.IsUnqualified()) { nbsol1 = 2; - Radius(1) = Abs(distcc1 - R1); + Radius(1) = std::abs(distcc1 - R1); Radius(2) = R1 + distcc1; } if (Qualified2.IsEnclosed() || Qualified2.IsOutside()) { nbsol2 = 1; - Rradius(1) = Abs(distcc2 - R2); + Rradius(1) = std::abs(distcc2 - R2); } else if (Qualified2.IsEnclosing()) { @@ -145,14 +145,14 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, else if (Qualified2.IsUnqualified()) { nbsol2 = 2; - Rradius(1) = Abs(distcc2 - R2); + Rradius(1) = std::abs(distcc2 - R2); Rradius(2) = R2 + distcc2; } for (Standard_Integer i = 1; i <= nbsol1; i++) { for (Standard_Integer j = 1; j <= nbsol2; j++) { - if (Abs(Radius(i) - Rradius(j)) <= Tol) + if (std::abs(Radius(i) - Rradius(j)) <= Tol) { WellDone = Standard_True; NbrSol++; @@ -166,11 +166,11 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius(i) - R1) < Tol) + else if (std::abs(distcc1 + Radius(i) - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius(i)) < Tol) + else if (std::abs(distcc1 - R1 - Radius(i)) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -182,11 +182,11 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { qualifier2(NbrSol) = Qualified2.Qualifier(); } - else if (Abs(distcc2 + Radius(i) - R2) < Tol) + else if (std::abs(distcc2 + Radius(i) - R2) < Tol) { qualifier2(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc2 - R2 - Radius(i)) < Tol) + else if (std::abs(distcc2 - R2 - Radius(i)) < Tol) { qualifier2(NbrSol) = GccEnt_outside; } @@ -261,7 +261,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, if (dist1 - R1 < Tol) { nbsol = 1; - Rbid(1) = Abs(R1 - dist1); + Rbid(1) = std::abs(R1 - dist1); } } else if (Qualified1.IsOutside()) @@ -269,7 +269,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, if (R1 - dist1 < Tol) { nbsol = 1; - Rbid(1) = Abs(dist1 - R1); + Rbid(1) = std::abs(dist1 - R1); } } else if (Qualified1.IsEnclosing()) @@ -281,14 +281,14 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { nbsol = 2; Rbid(1) = dist1 + R1; - Rbid(1) = Abs(dist1 - R1); + Rbid(1) = std::abs(dist1 - R1); } if (Qualified2.IsEnclosed() && nbsol != 0) { if (dist2 - R2 < Tol) { nsol = 1; - RBid(1) = Abs(R2 - dist2); + RBid(1) = std::abs(R2 - dist2); } } else if (Qualified2.IsOutside() && nbsol != 0) @@ -296,7 +296,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, if (R2 - dist2 < Tol) { nsol = 1; - RBid(1) = Abs(R2 - dist2); + RBid(1) = std::abs(R2 - dist2); } } else if (Qualified2.IsEnclosing() && nbsol != 0) @@ -308,13 +308,13 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { nsol = 2; RBid(1) = dist2 + R2; - RBid(2) = Abs(R2 - dist2); + RBid(2) = std::abs(R2 - dist2); } for (Standard_Integer isol = 1; isol <= nbsol; isol++) { for (Standard_Integer jsol = 1; jsol <= nsol; jsol++) { - if (Abs(Rbid(isol) - RBid(jsol)) <= Tol) + if (std::abs(Rbid(isol) - RBid(jsol)) <= Tol) { nnsol++; Radius(nnsol) = (RBid(jsol) + Rbid(isol)) / 2.; @@ -334,11 +334,11 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius(k) - R1) < Tol) + else if (std::abs(distcc1 + Radius(k) - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius(k)) < Tol) + else if (std::abs(distcc1 - R1 - Radius(k)) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -350,11 +350,11 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { qualifier2(NbrSol) = Qualified2.Qualifier(); } - else if (Abs(distcc2 + Radius(k) - R2) < Tol) + else if (std::abs(distcc2 + Radius(k) - R2) < Tol) { qualifier2(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc2 - R2 - Radius(k)) < Tol) + else if (std::abs(distcc2 - R2 - Radius(k)) < Tol) { qualifier2(NbrSol) = GccEnt_outside; } @@ -363,7 +363,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, qualifier2(NbrSol) = GccEnt_enclosing; } if (Center.Distance(center1) <= Tolerance - && Abs(Radius(k) - C1.Radius()) <= Tolerance) + && std::abs(Radius(k) - C1.Radius()) <= Tolerance) { TheSame1(NbrSol) = 1; } @@ -376,7 +376,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, pararg1(NbrSol) = ElCLib::Parameter(C1, pnttg1sol(NbrSol)); } if (Center.Distance(center2) <= Tolerance - && Abs(Radius(k) - C2.Radius()) <= Tolerance) + && std::abs(Radius(k) - C2.Radius()) <= Tolerance) { TheSame2(NbrSol) = 1; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_7.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_7.cxx index 91908a4ae2..8f47a96e5c 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_7.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_7.cxx @@ -75,7 +75,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, // Processing of boundary cases. + //========================================================================= - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); TColStd_Array1OfReal Rradius(1, 2); Standard_Integer nbsol1 = 1; // Standard_Integer nbsol2 = 0; @@ -85,8 +85,8 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, gp_Pnt2d pinterm(center1.XY() + (distcco - Ron) * dircc.XY()); Standard_Real distpl2 = L2.Distance(pinterm); Standard_Real distcc1 = pinterm.Distance(center1); - Standard_Real d1 = Abs(distpl2 - Abs(distcc1 - R1)); - Standard_Real d2 = Abs(distpl2 - (distcc1 + R1)); + Standard_Real d1 = std::abs(distpl2 - std::abs(distcc1 - R1)); + Standard_Real d2 = std::abs(distpl2 - (distcc1 + R1)); if (d1 > Tol || d2 > Tol) { pinterm = gp_Pnt2d(center1.XY() + (distcco - Ron) * dircc.XY()); @@ -100,7 +100,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, if (Qualified1.IsEnclosed() || Qualified1.IsOutside()) { nbsol1 = 1; - Rradius(1) = Abs(distcc1 - R1); + Rradius(1) = std::abs(distcc1 - R1); } else if (Qualified1.IsEnclosing()) { @@ -110,7 +110,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, else if (Qualified1.IsUnqualified()) { nbsol1 = 2; - Rradius(1) = Abs(distcc1 - R1); + Rradius(1) = std::abs(distcc1 - R1); Rradius(2) = R1 + distcc1; } gp_Dir2d dirbid(origin2.XY() - pinterm.XY()); @@ -125,7 +125,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, } for (Standard_Integer i = 1; i <= nbsol1; i++) { - if (Abs(Rradius(i) - distpl2) <= Tol) + if (std::abs(Rradius(i) - distpl2) <= Tol) { WellDone = Standard_True; NbrSol++; @@ -138,11 +138,11 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Rradius(i) - R1) < Tol) + else if (std::abs(distcc1 + Rradius(i) - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Rradius(i)) < Tol) + else if (std::abs(distcc1 - R1 - Rradius(i)) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -216,7 +216,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { if (dist1 - R1 < Tolerance) { - if (Abs(Abs(R1 - dist1) - dist2) < Tolerance) + if (std::abs(std::abs(R1 - dist1) - dist2) < Tolerance) { ok = Standard_True; } @@ -226,7 +226,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { if (R1 - dist1 < Tolerance) { - if (Abs(Abs(R1 - dist1) - dist2) < Tolerance) + if (std::abs(std::abs(R1 - dist1) - dist2) < Tolerance) { ok = Standard_True; } @@ -272,11 +272,11 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius - R1) < Tol) + else if (std::abs(distcc1 + Radius - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius) < Tol) + else if (std::abs(distcc1 - R1 - Radius) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -296,7 +296,8 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { qualifier2(NbrSol) = GccEnt_enclosed; } - if (Center.Distance(center1) <= Tolerance && Abs(Radius - C1.Radius()) <= Tolerance) + if (Center.Distance(center1) <= Tolerance + && std::abs(Radius - C1.Radius()) <= Tolerance) { TheSame1(NbrSol) = 1; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_8.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_8.cxx index 1ac5a9ea4a..8da67e89a1 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_8.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanOn_8.cxx @@ -67,7 +67,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, throw GccEnt_BadQualifier(); return; } - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); TColStd_Array1OfReal Radius(1, 2); gp_Dir2d dirx(gp_Dir2d::D::X); gp_Circ2d C1 = Qualified1.Qualified(); @@ -91,16 +91,16 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, pinterm = gp_Pnt2d(center1.XY() + (distcco - Ron) * dircc.XY()); Standard_Real distcc2 = pinterm.Distance(Point2); Standard_Real distcc1 = pinterm.Distance(center1); - Standard_Real d1 = Abs(distcc2 - Abs(distcc1 - R1)); - Standard_Real d2 = Abs(distcc2 - (distcc1 + R1)); + Standard_Real d1 = std::abs(distcc2 - std::abs(distcc1 - R1)); + Standard_Real d2 = std::abs(distcc2 - (distcc1 + R1)); if (d1 > Tol || d2 > Tol) { if (!SameCenter) pinterm = gp_Pnt2d(center1.XY() + (distcco + Ron) * dircc.XY()); distcc2 = pinterm.Distance(Point2); distcc1 = pinterm.Distance(center1); - d1 = Abs(distcc2 - Abs(distcc1 - R1)); - d2 = Abs(distcc2 - (distcc1 + R1)); + d1 = std::abs(distcc2 - std::abs(distcc1 - R1)); + d2 = std::abs(distcc2 - (distcc1 + R1)); if (d1 > Tol || d2 > Tol) { nbsol1 = 0; @@ -111,7 +111,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, if (Qualified1.IsEnclosed() || Qualified1.IsOutside()) { nbsol1 = 1; - Radius(1) = Abs(distcc1 - R1); + Radius(1) = std::abs(distcc1 - R1); } else if (Qualified1.IsEnclosing()) { @@ -121,7 +121,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, else if (Qualified1.IsUnqualified()) { nbsol1 = 2; - Radius(1) = Abs(distcc1 - R1); + Radius(1) = std::abs(distcc1 - R1); Radius(2) = R1 + distcc1; } for (Standard_Integer i = 1; i <= nbsol1; i++) @@ -139,11 +139,11 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius(i) - R1) < Tol) + else if (std::abs(distcc1 + Radius(i) - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius(i)) < Tol) + else if (std::abs(distcc1 - R1 - Radius(i)) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -217,7 +217,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, if (dist1 - C1.Radius() <= Tol) { ok = Standard_True; - Radius(1) = Abs(C1.Radius() - dist1); + Radius(1) = std::abs(C1.Radius() - dist1); } } else if (Qualified1.IsOutside()) @@ -225,7 +225,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, if (C1.Radius() - dist1 <= Tol) { ok = Standard_True; - Radius(1) = Abs(C1.Radius() - dist1); + Radius(1) = std::abs(C1.Radius() - dist1); } } else if (Qualified1.IsEnclosing()) @@ -237,7 +237,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { ok = Standard_True; nbsol = 2; - Radius(1) = Abs(C1.Radius() - dist1); + Radius(1) = std::abs(C1.Radius() - dist1); Radius(2) = C1.Radius() + dist1; } if (ok) @@ -264,11 +264,11 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius(k) - R1) < Tol) + else if (std::abs(distcc1 + Radius(k) - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius(k)) < Tol) + else if (std::abs(distcc1 - R1 - Radius(k)) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -277,7 +277,7 @@ GccAna_Circ2d2TanOn::GccAna_Circ2d2TanOn(const GccEnt_QualifiedCirc& Qualified1, qualifier1(NbrSol) = GccEnt_enclosing; } qualifier2(NbrSol) = GccEnt_noqualifier; - if (distcc1 <= Tol && Abs(Radius(k) - C1.Radius()) <= Tol) + if (distcc1 <= Tol && std::abs(Radius(k) - C1.Radius()) <= Tol) { TheSame1(NbrSol) = 1; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad.cxx index 7899f5330e..475f8e2ac0 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad.cxx @@ -56,7 +56,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified pararg2(1, 8) { - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); gp_Dir2d dirx(gp_Dir2d::D::X); WellDone = Standard_False; NbrSol = 0; @@ -99,24 +99,25 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified if ((Qualified1.IsEnclosed()) && Qualified2.IsEnclosed()) { // ========================================================= - if (Radius * 2.0 - Abs(R1 + R2 - dist) > Tol) + if (Radius * 2.0 - std::abs(R1 + R2 - dist) > Tol) { WellDone = Standard_True; } else { - if ((dist - R1 - R2 > Tol) || (Tol < Max(R1, R2) - dist - Min(R1, R2))) + if ((dist - R1 - R2 > Tol) || (Tol < std::max(R1, R2) - dist - std::min(R1, R2))) { WellDone = Standard_True; } - else if (Abs(dist - R1 - R2) <= Tol || Abs(Max(R1, R2) - dist - Min(R1, R2)) <= Tol) + else if (std::abs(dist - R1 - R2) <= Tol + || std::abs(std::max(R1, R2) - dist - std::min(R1, R2)) <= Tol) { - if (Abs(dist - R1 - R2) <= Tol) + if (std::abs(dist - R1 - R2) <= Tol) { rbid = R2 + (dist - R1 - R2) / 2.0; signe = -1; } - else if (Abs(Max(R1, R2) - dist - Min(R1, R2)) <= Tol) + else if (std::abs(std::max(R1, R2) - dist - std::min(R1, R2)) <= Tol) { if (R1 > R2) { @@ -127,7 +128,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified C2 = gp_Circ2d(C1); R3 = R1; } - rbid = -R3 + (Min(R1, R2) + dist - Max(R1, R2)) / 2.; + rbid = -R3 + (std::min(R1, R2) + dist - std::max(R1, R2)) / 2.; signe = 1; } gp_Ax2d axe(gp_Pnt2d(center2.XY() - rbid * dir1.XY()), dirx); @@ -144,8 +145,8 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified } else { - C(1) = gp_Circ2d(gp_Ax2d(C(1).Location(), dirx), Abs(Radius - R1)); - C(2) = gp_Circ2d(gp_Ax2d(C(2).Location(), dirx), Abs(Radius - R2)); + C(1) = gp_Circ2d(gp_Ax2d(C(1).Location(), dirx), std::abs(Radius - R1)); + C(2) = gp_Circ2d(gp_Ax2d(C(2).Location(), dirx), std::abs(Radius - R2)); nbsol = 1; } } @@ -174,9 +175,9 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified { WellDone = Standard_True; } - else if ((Abs(R2 - Radius) <= Tol) || (Abs(R1 - Radius) <= Tol)) + else if ((std::abs(R2 - Radius) <= Tol) || (std::abs(R1 - Radius) <= Tol)) { - if (Abs(R2 - Radius) <= Tol) + if (std::abs(R2 - Radius) <= Tol) { C(2) = gp_Circ2d(C2); R3 = R2; @@ -184,7 +185,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified TheSame1(1) = 0; pnttg1sol(1) = gp_Pnt2d(C(2).Location().XY() + R3 * dir1.XY()); } - else if (Abs(Radius - R1) <= Tol) + else if (std::abs(Radius - R1) <= Tol) { C(2) = gp_Circ2d(C1); R3 = R1; @@ -202,13 +203,13 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified } else { - if ((Abs(R2 + dist - R1) <= Tol) || (Abs(Radius * 2.0 - R1 - dist - R2) < Tol)) + if ((std::abs(R2 + dist - R1) <= Tol) || (std::abs(Radius * 2.0 - R1 - dist - R2) < Tol)) { - if (Abs(R2 + dist - R1) <= Tol) + if (std::abs(R2 + dist - R1) <= Tol) { signe = 1; } - else if (Abs(Radius * 2.0 - R1 - dist - R2) < Tol) + else if (std::abs(Radius * 2.0 - R1 - dist - R2) < Tol) { signe = -1; } @@ -226,8 +227,8 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified } else { - C(1) = gp_Circ2d(gp_Ax2d(C(1).Location(), dirx), Abs(Radius - R1)); - C(2) = gp_Circ2d(gp_Ax2d(C(2).Location(), dirx), Abs(Radius - R2)); + C(1) = gp_Circ2d(gp_Ax2d(C(1).Location(), dirx), std::abs(Radius - R1)); + C(2) = gp_Circ2d(gp_Ax2d(C(2).Location(), dirx), std::abs(Radius - R2)); nbsol = 1; } } @@ -258,25 +259,26 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified } else { - if (((Radius - R1 > 0.0) && (Abs(dist - R1 - R2) <= Tol)) - || (Abs(R1 - R2 + dist - Radius * 2.0) <= Tol) - || (Abs(R1 - R2 - dist - Radius * 2.0) <= Tol) || (Abs(dist - R1 - R2) <= Tol)) + if (((Radius - R1 > 0.0) && (std::abs(dist - R1 - R2) <= Tol)) + || (std::abs(R1 - R2 + dist - Radius * 2.0) <= Tol) + || (std::abs(R1 - R2 - dist - Radius * 2.0) <= Tol) + || (std::abs(dist - R1 - R2) <= Tol)) { - if (Abs(R1 - R2 + dist - Radius * 2.0) <= Tol) + if (std::abs(R1 - R2 + dist - Radius * 2.0) <= Tol) { signe = -1; } else { signe = 1; - if ((Radius - R1 > 0.0) && (Abs(dist - R1 - R2) <= Tol)) + if ((Radius - R1 > 0.0) && (std::abs(dist - R1 - R2) <= Tol)) { R2 = R1; } - else if (Abs(dist - R1 - R2) <= Tol) + else if (std::abs(dist - R1 - R2) <= Tol) { R2 = R1; - if (Abs(R1 - Radius) <= Tol) + if (std::abs(R1 - Radius) <= Tol) { TheSame1(1) = 1; } @@ -296,7 +298,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified } else { - C(1) = gp_Circ2d(gp_Ax2d(C(1).Location(), dirx), Abs(Radius - R1)); + C(1) = gp_Circ2d(gp_Ax2d(C(1).Location(), dirx), std::abs(Radius - R1)); C(2) = gp_Circ2d(gp_Ax2d(C(2).Location(), dirx), Radius + R2); nbsol = 1; } @@ -327,7 +329,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified } else { - if ((Abs(dist - R2 - R1) <= Tol) || (Abs(Radius - R1) <= Tol)) + if ((std::abs(dist - R2 - R1) <= Tol) || (std::abs(Radius - R1) <= Tol)) { WellDone = Standard_True; NbrSol = 1; @@ -338,7 +340,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified qualifier2(1) = Qualified2.Qualifier(); pnttg2sol(1) = gp_Pnt2d(center1.XY() + (dist - R2) * dir1.XY()); TheSame2(1) = 0; - if (Abs(Radius - R1) > 0.0) + if (std::abs(Radius - R1) > 0.0) { TheSame1(1) = 1; } @@ -350,10 +352,10 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified } else { - C(3) = gp_Circ2d(gp_Ax2d(C(1).Location(), dirx), Abs(Radius - R1)); + C(3) = gp_Circ2d(gp_Ax2d(C(1).Location(), dirx), std::abs(Radius - R1)); C(4) = gp_Circ2d(gp_Ax2d(C(2).Location(), dirx), Radius + R2); - C(1) = gp_Circ2d(gp_Ax2d(C(1).Location(), dirx), Abs(Radius - R1)); - C(2) = gp_Circ2d(gp_Ax2d(C(2).Location(), dirx), Abs(Radius - R2)); + C(1) = gp_Circ2d(gp_Ax2d(C(1).Location(), dirx), std::abs(Radius - R1)); + C(2) = gp_Circ2d(gp_Ax2d(C(2).Location(), dirx), std::abs(Radius - R2)); nbsol = 2; } } @@ -361,17 +363,17 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified else if ((Qualified1.IsEnclosing()) && (Qualified2.IsEnclosing())) { // ================================================================== - if ((Tol < Max(R1, R2) - Radius) || (Tol < Max(R1, R2) - dist - Min(R1, R2)) + if ((Tol < std::max(R1, R2) - Radius) || (Tol < std::max(R1, R2) - dist - std::min(R1, R2)) || (dist + R1 + R2 - Radius * 2.0 > Tol)) { WellDone = Standard_True; } else { - if ((Abs(dist + Min(R1, R2) - Max(R1, R2)) <= Tol) - || (Abs(R1 + R2 + dist - 2.0 * Radius) <= Tol)) + if ((std::abs(dist + std::min(R1, R2) - std::max(R1, R2)) <= Tol) + || (std::abs(R1 + R2 + dist - 2.0 * Radius) <= Tol)) { - if (Abs(dist + Min(R1, R2) - Max(R1, R2)) <= Tol) + if (std::abs(dist + std::min(R1, R2) - std::max(R1, R2)) <= Tol) { signe = 1; } @@ -391,7 +393,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified TheSame1(1) = 0; TheSame2(1) = 0; } - else if (Abs(Radius - Max(R1, R2)) <= Tol) + else if (std::abs(Radius - std::max(R1, R2)) <= Tol) { WellDone = Standard_True; NbrSol = 1; @@ -419,8 +421,8 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified } else { - C(1) = gp_Circ2d(gp_Ax2d(C(1).Location(), dirx), Abs(Radius - R1)); - C(2) = gp_Circ2d(gp_Ax2d(C(2).Location(), dirx), Abs(Radius - R2)); + C(1) = gp_Circ2d(gp_Ax2d(C(1).Location(), dirx), std::abs(Radius - R1)); + C(2) = gp_Circ2d(gp_Ax2d(C(2).Location(), dirx), std::abs(Radius - R2)); nbsol = 1; } } @@ -448,12 +450,12 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified { WellDone = Standard_True; } - else if (((Abs(R1 - Radius) <= Tol) || (Abs(R1 + R2 - dist) <= Tol)) - || (Abs(dist - R2 + R1 - Radius * 2.0) <= Tol)) + else if (((std::abs(R1 - Radius) <= Tol) || (std::abs(R1 + R2 - dist) <= Tol)) + || (std::abs(dist - R2 + R1 - Radius * 2.0) <= Tol)) { WellDone = Standard_True; NbrSol = 1; - if ((Abs(R1 - Radius) <= Tol) || (Abs(R1 + R2 - dist) <= Tol)) + if ((std::abs(R1 - Radius) <= Tol) || (std::abs(R1 + R2 - dist) <= Tol)) { TheSame1(1) = 1; } @@ -472,7 +474,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified } else { - C(1) = gp_Circ2d(gp_Ax2d(C(1).Location(), dirx), Abs(Radius - R1)); + C(1) = gp_Circ2d(gp_Ax2d(C(1).Location(), dirx), std::abs(Radius - R1)); C(2) = gp_Circ2d(gp_Ax2d(C(2).Location(), dirx), Radius + R2); nbsol = 1; } @@ -499,17 +501,17 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified { WellDone = Standard_True; } - else if ((Abs(R1 - Radius) <= Tol) || (Abs(R1 - dist - R2) > 0.0)) + else if ((std::abs(R1 - Radius) <= Tol) || (std::abs(R1 - dist - R2) > 0.0)) { - if (Abs(R1 - Radius) <= Tol) + if (std::abs(R1 - Radius) <= Tol) { TheSame1(1) = 1; - if ((Abs(Radius - R2) <= Tol) && (center1.Distance(center2) <= Tol)) + if ((std::abs(Radius - R2) <= Tol) && (center1.Distance(center2) <= Tol)) { TheSame2(1) = 1; } } - else if (Abs(R1 - dist - R2) > 0.0) + else if (std::abs(R1 - dist - R2) > 0.0) { TheSame1(1) = 0; TheSame2(1) = 0; @@ -526,17 +528,17 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified } else { - C(3) = gp_Circ2d(gp_Ax2d(C(1).Location(), dirx), Abs(Radius - R1)); + C(3) = gp_Circ2d(gp_Ax2d(C(1).Location(), dirx), std::abs(Radius - R1)); C(4) = gp_Circ2d(gp_Ax2d(C(2).Location(), dirx), Radius + R2); - C(1) = gp_Circ2d(gp_Ax2d(C(1).Location(), dirx), Abs(Radius - R1)); - C(2) = gp_Circ2d(gp_Ax2d(C(2).Location(), dirx), Abs(Radius - R2)); + C(1) = gp_Circ2d(gp_Ax2d(C(1).Location(), dirx), std::abs(Radius - R1)); + C(2) = gp_Circ2d(gp_Ax2d(C(2).Location(), dirx), std::abs(Radius - R2)); nbsol = 2; } } else if ((Qualified1.IsOutside()) && (Qualified2.IsOutside())) { // ============================================================== - if (Tol < Max(R1, R2) - dist - Min(R1, R2)) + if (Tol < std::max(R1, R2) - dist - std::min(R1, R2)) { WellDone = Standard_True; } @@ -546,7 +548,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified } else { - if (Abs(dist + Min(R1, R2) - Max(R1, R2)) <= Tol) + if (std::abs(dist + std::min(R1, R2) - std::max(R1, R2)) <= Tol) { WellDone = Standard_True; NbrSol = 1; @@ -568,7 +570,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified TheSame1(1) = 0; TheSame2(1) = 0; } - else if (Abs(dist - R1 - R2 - Radius * 2.0) <= Tol) + else if (std::abs(dist - R1 - R2 - Radius * 2.0) <= Tol) { WellDone = Standard_True; NbrSol = 1; @@ -623,9 +625,11 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified } else { - if ((Abs(R1 - R2 - dist) <= Tol) - || ((Abs(dist - R1 - R2) <= Tol) && (Abs(Radius * 2.0 - dist + R1 + R2) <= Tol)) - || ((Abs(dist + R1 - R2) <= Tol) && (Abs(R2 + dist - R1 - Radius * 2.0) <= Tol))) + if ((std::abs(R1 - R2 - dist) <= Tol) + || ((std::abs(dist - R1 - R2) <= Tol) + && (std::abs(Radius * 2.0 - dist + R1 + R2) <= Tol)) + || ((std::abs(dist + R1 - R2) <= Tol) + && (std::abs(R2 + dist - R1 - Radius * 2.0) <= Tol))) { WellDone = Standard_True; NbrSol = 1; @@ -644,7 +648,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified C(3) = gp_Circ2d(gp_Ax2d(C(1).Location(), dirx), Radius + R1); C(4) = gp_Circ2d(gp_Ax2d(C(2).Location(), dirx), Radius + R2); C(1) = gp_Circ2d(gp_Ax2d(C(1).Location(), dirx), Radius + R1); - C(2) = gp_Circ2d(gp_Ax2d(C(1).Location(), dirx), Abs(Radius - R2)); + C(2) = gp_Circ2d(gp_Ax2d(C(1).Location(), dirx), std::abs(Radius - R2)); nbsol = 2; } } @@ -656,30 +660,30 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified { WellDone = Standard_True; } - else if ((Max(R1, R2) - dist - Min(R1, R2) > Tol) - && (((Max(R1, R2) - dist - Min(R1, R2)) - Radius * 2.0 > Tol))) + else if ((std::max(R1, R2) - dist - std::min(R1, R2) > Tol) + && (((std::max(R1, R2) - dist - std::min(R1, R2)) - Radius * 2.0 > Tol))) { WellDone = Standard_True; } else { - Standard_Real p3 = Max(R1, R2) - Min(R1, R2) - dist - Radius * 2.0; + Standard_Real p3 = std::max(R1, R2) - std::min(R1, R2) - dist - Radius * 2.0; Standard_Real p4 = dist - R1 - R2; Standard_Real p5 = Radius * 2.0 - dist + R1 + R2; if (p3 > 0.0) { - dist = Max(R1, R2) - Min(R1, R2) - Radius * 2.0; + dist = std::max(R1, R2) - std::min(R1, R2) - Radius * 2.0; } else if (p4 > 0.0 && p5 < 0.0) { R1 = dist - R2 - Radius * 2.0; } - C(1) = gp_Circ2d(gp_Ax2d(center1, dirx), Abs(Radius - R1)); - C(2) = gp_Circ2d(gp_Ax2d(center2, dirx), Abs(Radius - R2)); - C(3) = gp_Circ2d(gp_Ax2d(center1, dirx), Abs(Radius - R1)); + C(1) = gp_Circ2d(gp_Ax2d(center1, dirx), std::abs(Radius - R1)); + C(2) = gp_Circ2d(gp_Ax2d(center2, dirx), std::abs(Radius - R2)); + C(3) = gp_Circ2d(gp_Ax2d(center1, dirx), std::abs(Radius - R1)); C(4) = gp_Circ2d(gp_Ax2d(center2, dirx), Radius + R2); C(5) = gp_Circ2d(gp_Ax2d(center1, dirx), Radius + R1); - C(6) = gp_Circ2d(gp_Ax2d(center2, dirx), Abs(Radius - R2)); + C(6) = gp_Circ2d(gp_Ax2d(center2, dirx), std::abs(Radius - R2)); C(7) = gp_Circ2d(gp_Ax2d(center1, dirx), Radius + R1); C(8) = gp_Circ2d(gp_Ax2d(center2, dirx), Radius + R2); nbsol = 4; @@ -708,11 +712,11 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius - R1) < Tol) + else if (std::abs(distcc1 + Radius - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius) < Tol) + else if (std::abs(distcc1 - R1 - Radius) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -724,11 +728,11 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified { qualifier2(NbrSol) = Qualified2.Qualifier(); } - else if (Abs(distcc2 + Radius - R2) < Tol) + else if (std::abs(distcc2 + Radius - R2) < Tol) { qualifier2(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc2 - R2 - Radius) < Tol) + else if (std::abs(distcc2 - R2 - Radius) < Tol) { qualifier2(NbrSol) = GccEnt_outside; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_1.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_1.cxx index 524bf2764b..f36cff8905 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_1.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_1.cxx @@ -57,7 +57,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified pararg2(1, 8) { - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); gp_Dir2d dirx(gp_Dir2d::D::X); NbrSol = 0; WellDone = Standard_False; @@ -127,7 +127,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified { if (((-ydir * (cxloc - lxloc) + xdir * (cyloc - lyloc) < 0.0) && (Radius * 2.0 > R1 - distance)) - || (Abs(distance - R1) < Tol) + || (std::abs(distance - R1) < Tol) || ((-ydir * (cxloc - lxloc) + xdir * (cyloc - lyloc) > 0.0) && (Radius * 2.0 > (R1 + distance + Tol)))) { @@ -164,10 +164,10 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified { if (((-ydir * (cxloc - lxloc) + xdir * (cyloc - lyloc) > 0.0) && (Radius * 2.0 > R1 - distance)) - || (Abs(R1 - Radius) < Tol) + || (std::abs(R1 - Radius) < Tol) || ((-ydir * (cxloc - lxloc) + xdir * (cyloc - lyloc) < 0.0) && (Radius * 2.0 > (R1 + distance))) - || (Abs(distance - R1) < Tol)) + || (std::abs(distance - R1) < Tol)) { cote = -1.0; nbsol = 3; @@ -416,7 +416,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified { ncote1 = 2; ncote2 = 1; - cote1(1) = Abs(Radius - R1); + cote1(1) = std::abs(Radius - R1); cote1(2) = Radius + R1; cote2(1) = 1.0; nbsol = 1; @@ -448,7 +448,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified { ncote1 = 2; ncote2 = 1; - cote1(1) = Abs(Radius - R1); + cote1(1) = std::abs(Radius - R1); cote1(2) = Radius + R1; cote2(1) = -1.0; nbsol = 1; @@ -478,7 +478,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified { ncote1 = 2; ncote2 = 2; - cote1(1) = Abs(Radius - R1); + cote1(1) = std::abs(Radius - R1); cote1(2) = Radius + R1; cote2(1) = 1.0; cote2(2) = -1.0; @@ -518,11 +518,11 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius - R1) < Tol) + else if (std::abs(distcc1 + Radius - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius) < Tol) + else if (std::abs(distcc1 - R1 - Radius) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -587,7 +587,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified qualifier1(1) = Qualified1.Qualifier(); qualifier2(1) = Qualified2.Qualifier(); pnttg2sol(1) = gp_Pnt2d(Cen.XY() + cote * Radius * gp_XY(ydir, -xdir)); - if (Abs(R1 - Radius) > 0.0) + if (std::abs(R1 - Radius) > 0.0) { pnttg1sol(1) = gp_Pnt2d(Cen.XY() + ccote * Radius * gp_XY(ydir, -xdir)); } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_2.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_2.cxx index 1c683fb0c3..3c40b984dd 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_2.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_2.cxx @@ -57,7 +57,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified { gp_Dir2d dirx(gp_Dir2d::D::X); - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); NbrSol = 0; WellDone = Standard_False; if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() @@ -101,7 +101,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified } else { - if (Abs(distance - R1) < Tol) + if (std::abs(distance - R1) < Tol) { nbsol = -1; deport = R1 - Radius; @@ -109,7 +109,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified } else { - C(1) = gp_Circ2d(C1.XAxis(), Abs(Radius - R1)); + C(1) = gp_Circ2d(C1.XAxis(), std::abs(Radius - R1)); C(2) = gp_Circ2d(gp_Ax2d(Point2, dirx), Radius); nbsol = 1; } @@ -124,7 +124,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified } else { - if (Abs(distance - R1) < Tol) + if (std::abs(distance - R1) < Tol) { nbsol = -1; deport = R1 - Radius; @@ -132,7 +132,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified } else { - C(1) = gp_Circ2d(C1.XAxis(), Abs(Radius - R1)); + C(1) = gp_Circ2d(C1.XAxis(), std::abs(Radius - R1)); C(2) = gp_Circ2d(gp_Ax2d(Point2, dirx), Radius); nbsol = 1; } @@ -145,7 +145,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified { WellDone = Standard_True; } - else if ((Abs(distance - R1) < Tol) || (Abs(dispc1 - Radius * 2.0) < Tol)) + else if ((std::abs(distance - R1) < Tol) || (std::abs(dispc1 - Radius * 2.0) < Tol)) { nbsol = -1; deport = R1 + Radius; @@ -161,13 +161,13 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified else if (Qualified1.IsUnqualified()) { // ==================================== - if (Abs(dispc1 - Radius * 2.0) < Tol) + if (std::abs(dispc1 - Radius * 2.0) < Tol) { WellDone = Standard_True; gp_Pnt2d Center(center1.XY() + (distance - Radius) * dir1.XY()); cirsol(1) = gp_Circ2d(gp_Ax2d(Center, dirx), Radius); // ================================================== - if (Abs(Center.Distance(center1) - R1) < Tol) + if (std::abs(Center.Distance(center1) - R1) < Tol) { qualifier1(1) = GccEnt_enclosed; } @@ -181,7 +181,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified WellDone = Standard_True; NbrSol = 1; } - else if ((Abs(R1 - Radius) < Tol) && (Abs(distance - R1) < Tol)) + else if ((std::abs(R1 - Radius) < Tol) && (std::abs(distance - R1) < Tol)) { cirsol(1) = gp_Circ2d(C1); // ========================= @@ -197,7 +197,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified } else { - C(1) = gp_Circ2d(C1.XAxis(), Abs(Radius - R1)); + C(1) = gp_Circ2d(C1.XAxis(), std::abs(Radius - R1)); C(2) = gp_Circ2d(gp_Ax2d(Point2, dirx), Radius); C(3) = gp_Circ2d(C1.XAxis(), Radius + R1); C(4) = gp_Circ2d(gp_Ax2d(Point2, dirx), Radius); @@ -224,11 +224,11 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius - R1) < Tol) + else if (std::abs(distcc1 + Radius - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius) < Tol) + else if (std::abs(distcc1 - R1 - Radius) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -268,7 +268,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedCirc& Qualified // ================================================== qualifier1(1) = Qualified1.Qualifier(); qualifier2(1) = GccEnt_noqualifier; - if (Abs(deport) <= Tol && Abs(Radius - R1) <= Tol) + if (std::abs(deport) <= Tol && std::abs(Radius - R1) <= Tol) { TheSame1(1) = 1; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_3.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_3.cxx index 1970ce987b..70d239fb65 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_3.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_3.cxx @@ -61,7 +61,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const GccEnt_QualifiedLin& Qualified1 { gp_Dir2d dirx(gp_Dir2d::D::X); - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); NbrSol = 0; WellDone = Standard_False; if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_5.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_5.cxx index f46e92d9f4..46e12b4906 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_5.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d2TanRad_5.cxx @@ -48,7 +48,7 @@ GccAna_Circ2d2TanRad::GccAna_Circ2d2TanRad(const gp_Pnt2d& Point1, { gp_Dir2d dirx(gp_Dir2d::D::X); - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); NbrSol = 0; WellDone = Standard_False; if (Radius < 0.0) diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan.cxx index 920c80a08d..848b2cdf60 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan.cxx @@ -57,7 +57,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { gp_Dir2d dirx(gp_Dir2d::D::X); - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; NbrSol = 0; if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() @@ -97,38 +97,40 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, gp_XY dir3 = center1.XY() - center3.XY(); ////////// - if ((Abs(R1 - R2) <= Tolerance && center1.IsEqual(center2, Tolerance)) - || (Abs(R1 - R3) <= Tolerance && center1.IsEqual(center3, Tolerance)) - || (Abs(R2 - R3) <= Tolerance && center2.IsEqual(center3, Tolerance))) + if ((std::abs(R1 - R2) <= Tolerance && center1.IsEqual(center2, Tolerance)) + || (std::abs(R1 - R3) <= Tolerance && center1.IsEqual(center3, Tolerance)) + || (std::abs(R2 - R3) <= Tolerance && center2.IsEqual(center3, Tolerance))) return; else { - if (Abs(dir2 ^ dir3) <= Tolerance) + if (std::abs(dir2 ^ dir3) <= Tolerance) { Standard_Real Dist1 = center1.Distance(center2); Standard_Real Dist2 = center1.Distance(center3); Standard_Real Dist3 = center2.Distance(center3); - if (Abs(Abs(R1 - R2) - Dist1) <= Tolerance) + if (std::abs(std::abs(R1 - R2) - Dist1) <= Tolerance) { - if (Abs(Abs(R1 - R3) - Dist2) <= Tolerance) + if (std::abs(std::abs(R1 - R3) - Dist2) <= Tolerance) { - if (Abs(Abs(R2 - R3) - Dist3) <= Tolerance) + if (std::abs(std::abs(R2 - R3) - Dist3) <= Tolerance) return; } - else if (Abs(R1 + R3 - Dist2) <= Tolerance) + else if (std::abs(R1 + R3 - Dist2) <= Tolerance) { - if (Abs(R2 + R3 - Dist3) <= Tolerance) + if (std::abs(R2 + R3 - Dist3) <= Tolerance) return; } } - else if (Abs(R1 + R2 - Dist1) <= Tolerance) + else if (std::abs(R1 + R2 - Dist1) <= Tolerance) { - if (Abs(Abs(R1 - R3) - Dist2) <= Tolerance && Abs(R2 + R3 - Dist3) <= Tolerance) + if (std::abs(std::abs(R1 - R3) - Dist2) <= Tolerance + && std::abs(R2 + R3 - Dist3) <= Tolerance) { } else { - if (Abs(Abs(R2 - R3) - Dist3) <= Tolerance && Abs(R1 + R3 - Dist2) <= Tolerance) + if (std::abs(std::abs(R2 - R3) - Dist3) <= Tolerance + && std::abs(R1 + R3 - Dist2) <= Tolerance) return; } } @@ -198,12 +200,17 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, // Verification do two circles touch each other or not // if at least one circle touches other one IsTouch become Standard_Standard_True - if (Abs((X1 - X2) * (X1 - X2) + (Y1 - Y2) * (Y1 - Y2) - (R1 - R2) * (R1 - R2)) <= Tolerance - || Abs((X1 - X2) * (X1 - X2) + (Y1 - Y2) * (Y1 - Y2) - (R1 + R2) * (R1 + R2)) <= Tolerance - || Abs((X1 - X3) * (X1 - X3) + (Y1 - Y3) * (Y1 - Y3) - (R1 - R3) * (R1 - R3)) <= Tolerance - || Abs((X1 - X3) * (X1 - X3) + (Y1 - Y3) * (Y1 - Y3) - (R1 + R3) * (R1 + R3)) <= Tolerance - || Abs((X2 - X3) * (X2 - X3) + (Y2 - Y3) * (Y2 - Y3) - (R2 - R3) * (R2 - R3)) <= Tolerance - || Abs((X2 - X3) * (X2 - X3) + (Y2 - Y3) * (Y2 - Y3) - (R2 + R3) * (R2 + R3)) <= Tolerance) + if (std::abs((X1 - X2) * (X1 - X2) + (Y1 - Y2) * (Y1 - Y2) - (R1 - R2) * (R1 - R2)) <= Tolerance + || std::abs((X1 - X2) * (X1 - X2) + (Y1 - Y2) * (Y1 - Y2) - (R1 + R2) * (R1 + R2)) + <= Tolerance + || std::abs((X1 - X3) * (X1 - X3) + (Y1 - Y3) * (Y1 - Y3) - (R1 - R3) * (R1 - R3)) + <= Tolerance + || std::abs((X1 - X3) * (X1 - X3) + (Y1 - Y3) * (Y1 - Y3) - (R1 + R3) * (R1 + R3)) + <= Tolerance + || std::abs((X2 - X3) * (X2 - X3) + (Y2 - Y3) * (Y2 - Y3) - (R2 - R3) * (R2 - R3)) + <= Tolerance + || std::abs((X2 - X3) * (X2 - X3) + (Y2 - Y3) * (Y2 - Y3) - (R2 + R3) * (R2 + R3)) + <= Tolerance) IsTouch = Standard_True; else IsTouch = Standard_False; @@ -228,7 +235,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, if (i == 1 || i == 4 || i == 5 || i == 8) { - if (Abs(R1 - R2) > Tolerance) + if (std::abs(R1 - R2) > Tolerance) { Beta2(i) = (X1 - X2) / (R1 - R2); Gamma2(i) = (Y1 - Y2) / (R1 - R2); @@ -242,7 +249,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, Gamma2(i) = (Y1 - Y2) / (R1 + R2); Delta2(i) = (X2 * X2 - X1 * X1 + Y2 * Y2 - Y1 * Y1 + (R1 + R2) * (R1 + R2)) / (2 * (R1 + R2)); } - if ((i == 1 || i == 4 || i == 5 || i == 8) && (Abs(R1 - R2) <= Tolerance)) + if ((i == 1 || i == 4 || i == 5 || i == 8) && (std::abs(R1 - R2) <= Tolerance)) { // If R1 = R2 A2(i) = 0.; @@ -269,7 +276,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, if (i == 1 || i == 3 || i == 6 || i == 8) { - if (Abs(R1 - R3) > Tolerance) + if (std::abs(R1 - R3) > Tolerance) { Beta3(i) = (X1 - X3) / (R1 - R3); Gamma3(i) = (Y1 - Y3) / (R1 - R3); @@ -283,7 +290,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, Gamma3(i) = (Y1 - Y3) / (R1 + R3); Delta3(i) = (X3 * X3 - X1 * X1 + Y3 * Y3 - Y1 * Y1 + (R1 + R3) * (R1 + R3)) / (2 * (R1 + R3)); } - if ((i == 1 || i == 3 || i == 6 || i == 8) && (Abs(R1 - R3) <= Tolerance)) + if ((i == 1 || i == 3 || i == 6 || i == 8) && (std::abs(R1 - R3) <= Tolerance)) { A3(i) = 0.; B3(i) = 0.; @@ -346,8 +353,9 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, // Check is Cir1 a solution of this system or not // In that case equations are equal to each other - if (Abs(a2 - a3) <= Tolerance && Abs(b2 - b3) <= Tolerance && Abs(c2 - c3) <= Tolerance - && Abs(d2 - d3) <= Tolerance && Abs(e2 - e3) <= Tolerance && Abs(f2 - f3) <= Tolerance) + if (std::abs(a2 - a3) <= Tolerance && std::abs(b2 - b3) <= Tolerance + && std::abs(c2 - c3) <= Tolerance && std::abs(d2 - d3) <= Tolerance + && std::abs(e2 - e3) <= Tolerance && std::abs(f2 - f3) <= Tolerance) { xSol(CurSol) = X1; ySol(CurSol) = Y1; @@ -355,7 +363,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, continue; } // 1) a2 = 0 - if (Abs(a2) <= Tolerance) + if (std::abs(a2) <= Tolerance) { // 1.1) b2y + d2 = 0 @@ -370,8 +378,8 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, // for each y solution: y = yRoots.Value(k); // Searching for solution of the equation Ax2 + Bx + C = 0 - if (!(k == 2 && Abs(y - yRoots.Value(1)) <= 10 * Tolerance) - && Abs(b2 * y + d2) <= b2 * Tolerance) + if (!(k == 2 && std::abs(y - yRoots.Value(1)) <= 10 * Tolerance) + && std::abs(b2 * y + d2) <= b2 * Tolerance) { A = a3; B = 2 * (b3 * y + d3); @@ -381,7 +389,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, for (j = 1; j <= xRoots.NbSolutions(); j++) { x = xRoots.Value(j); - if (!(j == 2 && Abs(x - xRoots.Value(1)) <= 10 * Tolerance)) + if (!(j == 2 && std::abs(x - xRoots.Value(1)) <= 10 * Tolerance)) { xSol(CurSol) = x; ySol(CurSol) = y; @@ -414,13 +422,16 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, // Check if this value is already caught IsSame = Standard_False; for (l = 1; l < k; l++) - if (Abs(y - yRoots1.Value(l)) <= 10 * Tolerance) + if (std::abs(y - yRoots1.Value(l)) <= 10 * Tolerance) IsSame = Standard_True; - Epsilon = (Abs((Abs((Abs(4 * A * y) + Abs(3 * B)) * y) + Abs(2 * C)) * y) + Abs(D)); - if (Abs((((A * y + B) * y + C) * y + D) * y + E) <= Epsilon * Tolerance) + Epsilon = + (std::abs((std::abs((std::abs(4 * A * y) + std::abs(3 * B)) * y) + std::abs(2 * C)) + * y) + + std::abs(D)); + if (std::abs((((A * y + B) * y + C) * y + D) * y + E) <= Epsilon * Tolerance) { - if (!IsSame && Abs(b2 * y + d2) > b2 * Tolerance) + if (!IsSame && std::abs(b2 * y + d2) > b2 * Tolerance) { x = -(c2 * (y * y) + 2 * e2 * y + f2) / (2 * (b2 * y + d2)); xSol(CurSol) = x; @@ -440,10 +451,10 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, IsSame = Standard_False; FirstIndex = (i == 1) ? 1 : FirstSol(i); for (l = FirstIndex; l < CurSol; l++) - if (Abs(y - ySol(l)) <= 10 * Tolerance) + if (std::abs(y - ySol(l)) <= 10 * Tolerance) IsSame = Standard_True; - if (!IsSame && Abs(b2 * y + d2) > b2 * Tolerance) + if (!IsSame && std::abs(b2 * y + d2) > b2 * Tolerance) { x = -(c2 * (y * y) + 2 * e2 * y + f2) / (2 * (b2 * y + d2)); xSol(CurSol) = x; @@ -455,7 +466,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, else { // 2) a2 != 0 - // Coefficients of the equation (sy + v)Sqrt(p2 - q) = (my2 + ny + t) + // Coefficients of the equation (sy + v)std::sqrt(p2 - q) = (my2 + ny + t) m = 2 * a3 * b2 * b2 / (a2 * a2) - 2 * b2 * b3 / a2 - a3 * c2 / a2 + c3; n = 4 * a3 * b2 * d2 / (a2 * a2) - 2 * b3 * d2 / a2 - 2 * b2 * d3 / a2 - 2 * a3 * e2 / a2 + 2 * e3; @@ -465,7 +476,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, //------------------------------------------ // If s = v = 0 - if (Abs(s) <= Tolerance && Abs(v) <= Tolerance) + if (std::abs(s) <= Tolerance && std::abs(v) <= Tolerance) { math_DirectPolynomialRoots yRoots(m, n, t); if (yRoots.IsDone() && !yRoots.InfiniteRoots()) @@ -474,11 +485,13 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, // for each y solution: y = yRoots.Value(k); - p = -(b2 * y + d2) / a2; - q = (c2 * (y * y) + 2 * e2 * y + f2) / a2; - Epsilon = - 2. * (Abs((b2 * b2 + Abs(a2 * c2)) * y) + Abs(b2 * d2) + Abs(a2 * e2)) / (a2 * a2); - if (!(k == 2 && Abs(y - yRoots.Value(1)) <= 10 * Tolerance) + p = -(b2 * y + d2) / a2; + q = (c2 * (y * y) + 2 * e2 * y + f2) / a2; + Epsilon = 2. + * (std::abs((b2 * b2 + std::abs(a2 * c2)) * y) + std::abs(b2 * d2) + + std::abs(a2 * e2)) + / (a2 * a2); + if (!(k == 2 && std::abs(y - yRoots.Value(1)) <= 10 * Tolerance) && p * p - q >= -Epsilon * Tolerance) { A = a2; @@ -491,7 +504,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, // for each x solution: x = xRoots.Value(l); - if (!(l == 2 && Abs(x - xRoots.Value(1)) <= 10 * Tolerance)) + if (!(l == 2 && std::abs(x - xRoots.Value(1)) <= 10 * Tolerance)) { xSol(CurSol) = x; ySol(CurSol) = y; @@ -531,14 +544,19 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, IsSame = Standard_False; FirstIndex = (i == 1) ? 1 : FirstSol(i); for (l = FirstIndex; l < CurSol; l++) - if (Abs(y - ySol(l)) <= 10 * Tolerance) + if (std::abs(y - ySol(l)) <= 10 * Tolerance) IsSame = Standard_True; - Epsilon = (Abs((Abs((Abs(4 * A * y) + Abs(3 * B)) * y) + Abs(2 * C)) * y) + Abs(D)); - if (Abs((((A * y + B) * y + C) * y + D) * y + E) <= Epsilon * Tolerance) + Epsilon = + (std::abs((std::abs((std::abs(4 * A * y) + std::abs(3 * B)) * y) + std::abs(2 * C)) + * y) + + std::abs(D)); + if (std::abs((((A * y + B) * y + C) * y + D) * y + E) <= Epsilon * Tolerance) { - Epsilon = 2. * (Abs((b2 * b2 + Abs(a2 * c2)) * y) + Abs(b2 * d2) + Abs(a2 * e2)) + Epsilon = 2. + * (std::abs((b2 * b2 + std::abs(a2 * c2)) * y) + std::abs(b2 * d2) + + std::abs(a2 * e2)) / (a2 * a2); if (!IsSame && p * p - q >= -Epsilon * Tolerance) { @@ -552,7 +570,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, // for each x solution: x = xRoots.Value(l); - if (!(l == 2 && Abs(x - xRoots.Value(1)) <= 10 * Tolerance)) + if (!(l == 2 && std::abs(x - xRoots.Value(1)) <= 10 * Tolerance)) { xSol(CurSol) = x; ySol(CurSol) = y; @@ -577,11 +595,13 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, // Check if this value is already caught IsSame = Standard_False; for (l = 1; l < k; l++) - if (Abs(y - yRoots.Value(l)) <= 10 * Tolerance) + if (std::abs(y - yRoots.Value(l)) <= 10 * Tolerance) IsSame = Standard_True; - Epsilon = - 2. * (Abs((b2 * b2 + Abs(a2 * c2)) * y) + Abs(b2 * d2) + Abs(a2 * e2)) / (a2 * a2); + Epsilon = 2. + * (std::abs((b2 * b2 + std::abs(a2 * c2)) * y) + std::abs(b2 * d2) + + std::abs(a2 * e2)) + / (a2 * a2); if (!IsSame && p * p - q >= -Epsilon * Tolerance) { A = a2; @@ -594,7 +614,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, // for each x solution: x = xRoots.Value(l); - if (!(l == 2 && Abs(x - xRoots.Value(1)) <= 10 * Tolerance)) + if (!(l == 2 && std::abs(x - xRoots.Value(1)) <= 10 * Tolerance)) { xSol(CurSol) = x; ySol(CurSol) = y; @@ -619,13 +639,13 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, x = xSol(j); y = ySol(j); // in some cases when R1 = R2 : - if ((i == 1 || i == 4 || i == 5 || i == 8) && (Abs(R1 - R2) <= Tolerance)) + if ((i == 1 || i == 4 || i == 5 || i == 8) && (std::abs(R1 - R2) <= Tolerance)) { if (i == 1 || i == 4) { - r = R1 + Sqrt((x - X1) * (x - X1) + (y - Y1) * (y - Y1)); - Epsilon = 10 * (2 * Abs(r - R2) + Abs(x - X2) + Abs(y - Y2)); - if (Abs((r - R2) * (r - R2) - (x - X2) * (x - X2) - (y - Y2) * (y - Y2)) + r = R1 + std::sqrt((x - X1) * (x - X1) + (y - Y1) * (y - Y1)); + Epsilon = 10 * (2 * std::abs(r - R2) + std::abs(x - X2) + std::abs(y - Y2)); + if (std::abs((r - R2) * (r - R2) - (x - X2) * (x - X2) - (y - Y2) * (y - Y2)) <= Epsilon * Tolerance) { xSol1(CurSol) = x; @@ -633,10 +653,10 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, rSol1(CurSol) = r; CurSol++; } - r = R1 - Sqrt((x - X1) * (x - X1) + (y - Y1) * (y - Y1)); - Epsilon = 10 * (2 * Abs(r - R2) + Abs(x - X2) + Abs(y - Y2)); + r = R1 - std::sqrt((x - X1) * (x - X1) + (y - Y1) * (y - Y1)); + Epsilon = 10 * (2 * std::abs(r - R2) + std::abs(x - X2) + std::abs(y - Y2)); if ((r > Tolerance) - && (Abs((r - R2) * (r - R2) - (x - X2) * (x - X2) - (y - Y2) * (y - Y2)) + && (std::abs((r - R2) * (r - R2) - (x - X2) * (x - X2) - (y - Y2) * (y - Y2)) <= Epsilon * Tolerance)) { xSol1(CurSol) = x; @@ -648,7 +668,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, else { // i == 5 || i == 8 - r = -R1 + Sqrt((x - X1) * (x - X1) + (y - Y1) * (y - Y1)); + r = -R1 + std::sqrt((x - X1) * (x - X1) + (y - Y1) * (y - Y1)); if (r > Tolerance) { xSol1(CurSol) = x; @@ -721,12 +741,12 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, y = ySol1(j); r = rSol1(j); // in some cases when R1 = R3 : - if ((i == 1 || i == 3 || i == 6 || i == 8) && Abs(R1 - R3) <= Tolerance) + if ((i == 1 || i == 3 || i == 6 || i == 8) && std::abs(R1 - R3) <= Tolerance) { if (i == 1 || i == 3) { - Epsilon = 10 * (2 * Abs(r - R3) + Abs(x - X3) + Abs(y - Y3)); - if (Abs((r - R3) * (r - R3) - (x - X3) * (x - X3) - (y - Y3) * (y - Y3)) + Epsilon = 10 * (2 * std::abs(r - R3) + std::abs(x - X3) + std::abs(y - Y3)); + if (std::abs((r - R3) * (r - R3) - (x - X3) * (x - X3) - (y - Y3) * (y - Y3)) <= Epsilon * Tolerance) { xSol(CurSol) = x; @@ -738,8 +758,8 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, else { // i == 6 || i == 8 - Epsilon = 10 * (2 * (r + R3) + Abs(x - X3) + Abs(y - Y3)); - if (Abs((r + R3) * (r + R3) - (x - X3) * (x - X3) - (y - Y3) * (y - Y3)) + Epsilon = 10 * (2 * (r + R3) + std::abs(x - X3) + std::abs(y - Y3)); + if (std::abs((r + R3) * (r + R3) - (x - X3) * (x - X3) - (y - Y3) * (y - Y3)) <= Epsilon * Tolerance) { xSol(CurSol) = x; @@ -752,9 +772,9 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, else { // Other cases - Epsilon = 10 * (Abs(Beta3(i)) + Abs(Gamma3(i)) + 1.); + Epsilon = 10 * (std::abs(Beta3(i)) + std::abs(Gamma3(i)) + 1.); if (i == 1 || i == 3) - if (Abs(R3 + Beta3(i) * x + Gamma3(i) * y + Delta3(i) - r) <= Epsilon * Tolerance) + if (std::abs(R3 + Beta3(i) * x + Gamma3(i) * y + Delta3(i) - r) <= Epsilon * Tolerance) { xSol(CurSol) = x; ySol(CurSol) = y; @@ -762,7 +782,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, CurSol++; } if (i == 6 || i == 8) - if (Abs(R3 + Beta3(i) * x + Gamma3(i) * y + Delta3(i) + r) <= Epsilon * Tolerance) + if (std::abs(R3 + Beta3(i) * x + Gamma3(i) * y + Delta3(i) + r) <= Epsilon * Tolerance) { xSol(CurSol) = x; ySol(CurSol) = y; @@ -770,7 +790,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, CurSol++; } if (i == 4 || i == 7) - if (Abs(Beta3(i) * x + Gamma3(i) * y + Delta3(i) - r - R3) <= Epsilon * Tolerance) + if (std::abs(Beta3(i) * x + Gamma3(i) * y + Delta3(i) - r - R3) <= Epsilon * Tolerance) { xSol(CurSol) = x; ySol(CurSol) = y; @@ -778,7 +798,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, CurSol++; } if (i == 2 || i == 5) - if (Abs(r - R3 + Beta3(i) * x + Gamma3(i) * y + Delta3(i)) <= Epsilon * Tolerance) + if (std::abs(r - R3 + Beta3(i) * x + Gamma3(i) * y + Delta3(i)) <= Epsilon * Tolerance) { xSol(CurSol) = x; ySol(CurSol) = y; @@ -818,9 +838,9 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, Standard_Real distcc1 = Center.Distance(center1); if (!Qualified1.IsUnqualified()) qualifier1(NbrSol) = Qualified1.Qualifier(); - else if (Abs(distcc1 + rSol(j) - R1) <= Tol) + else if (std::abs(distcc1 + rSol(j) - R1) <= Tol) qualifier1(NbrSol) = GccEnt_enclosed; - else if (Abs(distcc1 - R1 - rSol(j)) <= Tol) + else if (std::abs(distcc1 - R1 - rSol(j)) <= Tol) qualifier1(NbrSol) = GccEnt_outside; else qualifier1(NbrSol) = GccEnt_enclosing; @@ -828,9 +848,9 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, Standard_Real distcc2 = Center.Distance(center1); if (!Qualified2.IsUnqualified()) qualifier2(NbrSol) = Qualified2.Qualifier(); - else if (Abs(distcc2 + rSol(j) - R2) <= Tol) + else if (std::abs(distcc2 + rSol(j) - R2) <= Tol) qualifier2(NbrSol) = GccEnt_enclosed; - else if (Abs(distcc2 - R2 - rSol(j)) <= Tol) + else if (std::abs(distcc2 - R2 - rSol(j)) <= Tol) qualifier2(NbrSol) = GccEnt_outside; else qualifier2(NbrSol) = GccEnt_enclosing; @@ -838,9 +858,9 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, Standard_Real distcc3 = Center.Distance(center1); if (!Qualified3.IsUnqualified()) qualifier3(NbrSol) = Qualified3.Qualifier(); - else if (Abs(distcc3 + rSol(j) - R3) <= Tol) + else if (std::abs(distcc3 + rSol(j) - R3) <= Tol) qualifier3(NbrSol) = GccEnt_enclosed; - else if (Abs(distcc3 - R3 - rSol(j)) <= Tol) + else if (std::abs(distcc3 - R3 - rSol(j)) <= Tol) qualifier3(NbrSol) = GccEnt_outside; else qualifier3(NbrSol) = GccEnt_enclosing; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_1.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_1.cxx index 72f6d5319d..61939f631e 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_1.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_1.cxx @@ -62,7 +62,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { gp_Dir2d dirx(gp_Dir2d::D::X); - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; NbrSol = 0; if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() @@ -159,7 +159,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { if (dist1 - R1 < Tolerance) { - Radius(1) = Abs(R1 - dist1); + Radius(1) = std::abs(R1 - dist1); nbsol1 = 1; ok = Standard_True; } @@ -168,7 +168,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { if (R1 - dist1 < Tolerance) { - Radius(1) = Abs(R1 - dist1); + Radius(1) = std::abs(R1 - dist1); nbsol1 = 1; ok = Standard_True; } @@ -177,13 +177,13 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { ok = Standard_True; nbsol1 = 1; - Radius(1) = Abs(R1 - dist1); + Radius(1) = std::abs(R1 - dist1); } else if (Qualified1.IsUnqualified()) { ok = Standard_True; nbsol1 = 2; - Radius(1) = Abs(R1 - dist1); + Radius(1) = std::abs(R1 - dist1); Radius(2) = R1 + dist1; } if (Qualified2.IsEnclosed() && ok) @@ -192,9 +192,9 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { for (Standard_Integer ii = 1; ii <= nbsol1; ii++) { - if (Abs(Radius(ii) - Abs(R2 - dist2)) < Tol) + if (std::abs(Radius(ii) - std::abs(R2 - dist2)) < Tol) { - Radius(1) = Abs(R2 - dist2); + Radius(1) = std::abs(R2 - dist2); ok = Standard_True; nbsol2 = 1; } @@ -207,9 +207,9 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { for (Standard_Integer ii = 1; ii <= nbsol1; ii++) { - if (Abs(Radius(ii) - Abs(R2 - dist2)) < Tol) + if (std::abs(Radius(ii) - std::abs(R2 - dist2)) < Tol) { - Radius(1) = Abs(R2 - dist2); + Radius(1) = std::abs(R2 - dist2); ok = Standard_True; nbsol2 = 1; } @@ -220,7 +220,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { for (Standard_Integer ii = 1; ii <= nbsol1; ii++) { - if (Abs(Radius(ii) - R2 - dist2) < Tol) + if (std::abs(Radius(ii) - R2 - dist2) < Tol) { Radius(1) = R2 + dist2; ok = Standard_True; @@ -232,13 +232,13 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { for (Standard_Integer ii = 1; ii <= nbsol1; ii++) { - if (Abs(Radius(ii) - Abs(R2 - dist2)) < Tol) + if (std::abs(Radius(ii) - std::abs(R2 - dist2)) < Tol) { - Rradius = Abs(R2 - dist2); + Rradius = std::abs(R2 - dist2); ok = Standard_True; nbsol2++; } - else if (Abs(Radius(ii) - R2 - dist2) < Tol) + else if (std::abs(Radius(ii) - R2 - dist2) < Tol) { Rradius = R2 + dist2; ok = Standard_True; @@ -251,7 +251,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, } else if (nbsol2 == 2) { - Radius(1) = Abs(R2 - dist2); + Radius(1) = std::abs(R2 - dist2); Radius(2) = R2 + dist2; } } @@ -292,11 +292,11 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius(ind3) - R1) < Tol) + else if (std::abs(distcc1 + Radius(ind3) - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius(ind3)) < Tol) + else if (std::abs(distcc1 - R1 - Radius(ind3)) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -309,11 +309,11 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { qualifier2(NbrSol) = Qualified2.Qualifier(); } - else if (Abs(distcc2 + Radius(ind3) - R2) < Tol) + else if (std::abs(distcc2 + Radius(ind3) - R2) < Tol) { qualifier2(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc2 - R2 - Radius(ind3)) < Tol) + else if (std::abs(distcc2 - R2 - Radius(ind3)) < Tol) { qualifier2(NbrSol) = GccEnt_outside; } @@ -335,7 +335,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, qualifier3(NbrSol) = GccEnt_enclosed; } if (Center.Distance(C1.Location()) <= Tolerance - && Abs(Radius(ind3) - R1) <= Tolerance) + && std::abs(Radius(ind3) - R1) <= Tolerance) { TheSame1(NbrSol) = 1; } @@ -357,7 +357,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, pararg1(NbrSol) = ElCLib::Parameter(C1, pnttg1sol(NbrSol)); } if (Center.Distance(C2.Location()) <= Tolerance - && Abs(Radius(ind3) - R2) <= Tolerance) + && std::abs(Radius(ind3) - R2) <= Tolerance) { TheSame2(NbrSol) = 1; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_2.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_2.cxx index 270fbf705c..e17b3cff5f 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_2.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_2.cxx @@ -63,7 +63,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, TheSame1.Init(0); gp_Dir2d dirx(gp_Dir2d::D::X); - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; NbrSol = 0; if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() @@ -130,7 +130,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { if (dist1 - R1 < Tolerance) { - Radius(1) = Abs(R1 - dist1); + Radius(1) = std::abs(R1 - dist1); nbsol1 = 1; ok = Standard_True; } @@ -139,7 +139,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { if (R1 - dist1 < Tolerance) { - Radius(1) = Abs(R1 - dist1); + Radius(1) = std::abs(R1 - dist1); nbsol1 = 1; ok = Standard_True; } @@ -148,13 +148,13 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { ok = Standard_True; nbsol1 = 1; - Radius(1) = Abs(R1 - dist1); + Radius(1) = std::abs(R1 - dist1); } else if (Qualified1.IsUnqualified()) { ok = Standard_True; nbsol1 = 2; - Radius(1) = Abs(R1 - dist1); + Radius(1) = std::abs(R1 - dist1); Radius(2) = R1 + dist1; } if (Qualified2.IsEnclosed() && ok) @@ -165,7 +165,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { for (Standard_Integer ii = 1; ii <= nbsol1; ii++) { - if (Abs(dist2 - Radius(ii)) < Tol) + if (std::abs(dist2 - Radius(ii)) < Tol) { ok = Standard_True; Radius(1) = Radius(ii); @@ -181,7 +181,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { for (Standard_Integer ii = 1; ii <= nbsol1; ii++) { - if (Abs(dist2 - Radius(ii)) < Tol) + if (std::abs(dist2 - Radius(ii)) < Tol) { ok = Standard_True; Radius(1) = Radius(ii); @@ -193,7 +193,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { for (Standard_Integer ii = 1; ii <= nbsol1; ii++) { - if (Abs(dist2 - Radius(ii)) < Tol) + if (std::abs(dist2 - Radius(ii)) < Tol) { ok = Standard_True; Radius(1) = Radius(ii); @@ -206,7 +206,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, + ((origin3.Y() - Center.Y()) * (dir3.X()))) <= 0) { - if (Abs(dist3 - Radius(1)) < Tol) + if (std::abs(dist3 - Radius(1)) < Tol) { ok = Standard_True; nbsol3 = 1; @@ -219,7 +219,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, + ((origin3.Y() - Center.Y()) * (dir3.X()))) >= 0) { - if (Abs(dist3 - Radius(1)) < Tol) + if (std::abs(dist3 - Radius(1)) < Tol) { ok = Standard_True; nbsol3 = 1; @@ -228,7 +228,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, } else if (Qualified3.IsUnqualified() && ok) { - if (Abs(dist3 - Radius(1)) < Tol) + if (std::abs(dist3 - Radius(1)) < Tol) { ok = Standard_True; nbsol3 = 1; @@ -246,11 +246,11 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius(m) - R1) < Tol) + else if (std::abs(distcc1 + Radius(m) - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius(m)) < Tol) + else if (std::abs(distcc1 - R1 - Radius(m)) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -284,7 +284,8 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { qualifier3(NbrSol) = GccEnt_enclosed; } - if (Center.Distance(center1) <= Tolerance && Abs(Radius(m) - R1) <= Tolerance) + if (Center.Distance(center1) <= Tolerance + && std::abs(Radius(m) - R1) <= Tolerance) { TheSame1(NbrSol) = 1; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_3.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_3.cxx index d2cb20d113..953d2788aa 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_3.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_3.cxx @@ -181,17 +181,17 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedLin& Qualified1, Standard_Real cross3 = gp_Dir2d(-ydir3, xdir3).Dot(gp_Dir2d(xloc3 - cx, yloc3 - cy)); if (cross1 != 0.0) { - cross1 = cross1 / Abs(cross1); + cross1 = cross1 / std::abs(cross1); } pnttg1sol(nbsol) = gp_Pnt2d(gp_XY(cx, cy) + cross1 * Radius * gp_XY(-ydir1, xdir1)); if (cross2 != 0.0) { - cross2 = cross2 / Abs(cross2); + cross2 = cross2 / std::abs(cross2); } pnttg2sol(nbsol) = gp_Pnt2d(gp_XY(cx, cy) + cross2 * Radius * gp_XY(-ydir2, xdir2)); if (cross3 != 0.0) { - cross3 = cross3 / Abs(cross3); + cross3 = cross3 / std::abs(cross3); } pnttg3sol(nbsol) = gp_Pnt2d(gp_XY(cx, cy) + cross3 * Radius * gp_XY(-ydir3, xdir3)); par1sol(nbsol) = ElCLib::Parameter(cirsol(nbsol), pnttg1sol(nbsol)); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_4.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_4.cxx index 7f3b8625e0..6c33a41c97 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_4.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_4.cxx @@ -66,7 +66,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { gp_Dir2d dirx(gp_Dir2d::D::X); - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; NbrSol = 0; if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() @@ -200,7 +200,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { if (dist1 - R1 < Tolerance) { - Radius(1) = Abs(R1 - dist1); + Radius(1) = std::abs(R1 - dist1); nbsol1 = 1; ok = Standard_True; } @@ -209,7 +209,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { if (R1 - dist1 < Tolerance) { - Radius(1) = Abs(R1 - dist1); + Radius(1) = std::abs(R1 - dist1); nbsol1 = 1; ok = Standard_True; } @@ -224,7 +224,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { ok = Standard_True; nbsol1 = 2; - Radius(1) = Abs(R1 - dist1); + Radius(1) = std::abs(R1 - dist1); Radius(2) = R1 + dist1; } if (Qualified2.IsEnclosed() && ok) @@ -233,9 +233,9 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { for (Standard_Integer ii = 1; ii <= nbsol1; ii++) { - if (Abs(Radius(ii) - Abs(R2 - dist2)) < Tol) + if (std::abs(Radius(ii) - std::abs(R2 - dist2)) < Tol) { - Radius(1) = Abs(R2 - dist2); + Radius(1) = std::abs(R2 - dist2); ok = Standard_True; nbsol2 = 1; } @@ -248,9 +248,9 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { for (Standard_Integer ii = 1; ii <= nbsol1; ii++) { - if (Abs(Radius(ii) - Abs(R2 - dist2)) < Tol) + if (std::abs(Radius(ii) - std::abs(R2 - dist2)) < Tol) { - Radius(1) = Abs(R2 - dist2); + Radius(1) = std::abs(R2 - dist2); ok = Standard_True; nbsol2 = 1; } @@ -261,7 +261,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { for (Standard_Integer ii = 1; ii <= nbsol1; ii++) { - if (Abs(Radius(ii) - R2 - dist2) < Tol) + if (std::abs(Radius(ii) - R2 - dist2) < Tol) { Radius(1) = R2 + dist2; ok = Standard_True; @@ -273,13 +273,13 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { for (Standard_Integer ii = 1; ii <= nbsol1; ii++) { - if (Abs(Radius(ii) - Abs(R2 - dist2)) < Tol) + if (std::abs(Radius(ii) - std::abs(R2 - dist2)) < Tol) { - Rradius = Abs(R2 - dist2); + Rradius = std::abs(R2 - dist2); ok = Standard_True; nbsol2++; } - else if (Abs(Radius(ii) - R2 - dist2) < Tol) + else if (std::abs(Radius(ii) - R2 - dist2) < Tol) { Rradius = R2 + dist2; ok = Standard_True; @@ -292,13 +292,13 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, } else if (nbsol2 == 2) { - Radius(1) = Abs(R2 - dist2); + Radius(1) = std::abs(R2 - dist2); Radius(2) = R2 + dist2; } } for (Standard_Integer ii = 1; ii <= nbsol2; ii++) { - if (Abs(dist3 - Radius(ii)) <= Tol) + if (std::abs(dist3 - Radius(ii)) <= Tol) { nbsol3++; ok = Standard_True; @@ -316,11 +316,11 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius(k1) - R1) < Tol) + else if (std::abs(distcc1 + Radius(k1) - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius(k1)) < Tol) + else if (std::abs(distcc1 - R1 - Radius(k1)) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -335,11 +335,11 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { qualifier2(NbrSol) = Qualified2.Qualifier(); } - else if (Abs(distcc2 + Radius(k1) - R2) < Tol) + else if (std::abs(distcc2 + Radius(k1) - R2) < Tol) { qualifier2(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc2 - R2 - Radius(k1)) < Tol) + else if (std::abs(distcc2 - R2 - Radius(k1)) < Tol) { qualifier2(NbrSol) = GccEnt_outside; } @@ -348,7 +348,8 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, qualifier2(NbrSol) = GccEnt_enclosing; } qualifier3(NbrSol) = GccEnt_noqualifier; - if (Center.Distance(center1) <= Tolerance && Abs(Radius(k1) - R1) <= Tolerance) + if (Center.Distance(center1) <= Tolerance + && std::abs(Radius(k1) - R1) <= Tolerance) { TheSame1(NbrSol) = 1; } @@ -364,7 +365,8 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, par1sol(NbrSol) = ElCLib::Parameter(cirsol(NbrSol), pnttg1sol(NbrSol)); pararg1(NbrSol) = ElCLib::Parameter(C1, pnttg1sol(NbrSol)); } - if (Center.Distance(center2) <= Tolerance && Abs(Radius(k1) - R2) <= Tolerance) + if (Center.Distance(center2) <= Tolerance + && std::abs(Radius(k1) - R2) <= Tolerance) { TheSame2(NbrSol) = 1; } @@ -411,7 +413,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { gp_Circ2d CC = cirsol(kk); Standard_Real NR = CC.Location().Distance(Point3); - if (Abs(NR - CC.Radius()) > Tol) + if (std::abs(NR - CC.Radius()) > Tol) { cirsol(kk).SetRadius(NR); } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_5.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_5.cxx index 1174f42423..c74291fe7f 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_5.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_5.cxx @@ -64,7 +64,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { gp_Dir2d dirx(gp_Dir2d::D::X); - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); Standard_Real MaxRad = 1e10, MinRad = 1e-6; WellDone = Standard_False; NbrSol = 0; @@ -140,7 +140,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { if (dist1 - R1 < Tolerance) { - Radius(1) = Abs(R1 - dist1); + Radius(1) = std::abs(R1 - dist1); nbsol1 = 1; ok = Standard_True; } @@ -149,7 +149,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { if (R1 - dist1 < Tolerance) { - Radius(1) = Abs(R1 - dist1); + Radius(1) = std::abs(R1 - dist1); nbsol1 = 1; ok = Standard_True; } @@ -158,13 +158,13 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { ok = Standard_True; nbsol1 = 1; - Radius(1) = Abs(R1 - dist1); + Radius(1) = std::abs(R1 - dist1); } else if (Qualified1.IsUnqualified()) { ok = Standard_True; nbsol1 = 2; - Radius(1) = Abs(R1 - dist1); + Radius(1) = std::abs(R1 - dist1); Radius(2) = R1 + dist1; } if (Qualified2.IsEnclosed() && ok) @@ -175,7 +175,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { for (Standard_Integer ii = 1; ii <= nbsol1; ii++) { - if (Abs(dist2 - Radius(ii)) < Tol) + if (std::abs(dist2 - Radius(ii)) < Tol) { ok = Standard_True; Radius(1) = Radius(ii); @@ -191,7 +191,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { for (Standard_Integer ii = 1; ii <= nbsol1; ii++) { - if (Abs(dist2 - Radius(ii)) < Tol) + if (std::abs(dist2 - Radius(ii)) < Tol) { ok = Standard_True; Radius(1) = Radius(ii); @@ -203,14 +203,14 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { for (Standard_Integer ii = 1; ii <= nbsol1; ii++) { - if (Abs(dist2 - Radius(ii)) < Tol) + if (std::abs(dist2 - Radius(ii)) < Tol) { ok = Standard_True; Radius(1) = Radius(ii); } } } - if (Abs(dist3 - Radius(1)) <= Tol && ok) + if (std::abs(dist3 - Radius(1)) <= Tol && ok) { ok = Standard_True; nbsol3 = 1; @@ -224,7 +224,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, // pop : if the radius is too great - no creation if (Radius(k) > MaxRad) break; - if (Abs(Radius(k)) < MinRad) + if (std::abs(Radius(k)) < MinRad) break; NbrSol++; @@ -235,11 +235,11 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius(k) - R1) < Tol) + else if (std::abs(distcc1 + Radius(k) - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius(k)) < Tol) + else if (std::abs(distcc1 - R1 - Radius(k)) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -261,7 +261,8 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, qualifier2(NbrSol) = GccEnt_enclosed; } qualifier3(NbrSol) = GccEnt_noqualifier; - if (Center.Distance(C1.Location()) <= Tolerance && Abs(Radius(k) - R1) <= Tolerance) + if (Center.Distance(C1.Location()) <= Tolerance + && std::abs(Radius(k) - R1) <= Tolerance) { TheSame1(NbrSol) = 1; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_6.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_6.cxx index 0db34a8b1a..3ef3ed176d 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_6.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_6.cxx @@ -57,7 +57,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedLin& Qualified1, gp_Dir2d dirx(gp_Dir2d::D::X); WellDone = Standard_False; - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); NbrSol = 0; if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) || !(Qualified2.IsEnclosed() || Qualified2.IsOutside() || Qualified2.IsUnqualified())) @@ -144,7 +144,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedLin& Qualified1, + ((origin2.Y() - Center.Y()) * (dir2.X()))) <= 0) { - if (Abs(dist2 - Radius) < Tol) + if (std::abs(dist2 - Radius) < Tol) { } else @@ -159,7 +159,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedLin& Qualified1, + ((origin2.Y() - Center.Y()) * (dir2.X()))) >= 0) { - if (Abs(dist2 - Radius) < Tol) + if (std::abs(dist2 - Radius) < Tol) { } else @@ -170,7 +170,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedLin& Qualified1, } else if (Qualified2.IsUnqualified() && ok) { - if (Abs(dist2 - Radius) < Tol) + if (std::abs(dist2 - Radius) < Tol) { } else @@ -180,7 +180,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedLin& Qualified1, } if (ok) { - if (Abs(dist3 - Radius) < Tol) + if (std::abs(dist3 - Radius) < Tol) { nbsol3 = 1; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_7.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_7.cxx index 9ca28597ac..8fc718e874 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_7.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_7.cxx @@ -58,7 +58,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { gp_Dir2d dirx(gp_Dir2d::D::X); - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; NbrSol = 0; if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() @@ -130,7 +130,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { if (dist1 - R1 < Tolerance) { - Radius(1) = Abs(R1 - dist1); + Radius(1) = std::abs(R1 - dist1); nbsol1 = 1; ok = Standard_True; } @@ -139,7 +139,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { if (R1 - dist1 < Tolerance) { - Radius(1) = Abs(R1 - dist1); + Radius(1) = std::abs(R1 - dist1); nbsol1 = 1; ok = Standard_True; } @@ -154,7 +154,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { ok = Standard_True; nbsol1 = 2; - Radius(1) = Abs(R1 - dist1); + Radius(1) = std::abs(R1 - dist1); Radius(2) = R1 + dist1; } if (ok) @@ -162,8 +162,9 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, ok = Standard_False; for (Standard_Integer ii = 1; ii <= nbsol1; ii++) { - // pop if (Abs(dist2-Radius(ii))<=Tol && Abs(dist2-Radius(ii))<=Tol){ - if (Abs(dist2 - Radius(ii)) <= Tol && Abs(dist3 - Radius(ii)) <= Tol) + // pop if (std::abs(dist2-Radius(ii))<=Tol && + // std::abs(dist2-Radius(ii))<=Tol){ + if (std::abs(dist2 - Radius(ii)) <= Tol && std::abs(dist3 - Radius(ii)) <= Tol) { nbsol3 = ii; ok = Standard_True; @@ -185,11 +186,11 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius(nbsol3) - R1) < Tol) + else if (std::abs(distcc1 + Radius(nbsol3) - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius(nbsol3)) < Tol) + else if (std::abs(distcc1 - R1 - Radius(nbsol3)) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -199,7 +200,8 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedCirc& Qualified1, } qualifier2(NbrSol) = GccEnt_noqualifier; qualifier3(NbrSol) = GccEnt_noqualifier; - if (Center.Distance(center1) <= Tolerance && Abs(Radius(nbsol3) - R1) <= Tolerance) + if (Center.Distance(center1) <= Tolerance + && std::abs(Radius(nbsol3) - R1) <= Tolerance) { TheSame1(NbrSol) = 1; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_8.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_8.cxx index b434e2eacb..85bd3ff3b2 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_8.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2d3Tan_8.cxx @@ -57,7 +57,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedLin& Qualified1, { WellDone = Standard_False; - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); gp_Dir2d dirx(gp_Dir2d::D::X); NbrSol = 0; if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) @@ -121,7 +121,7 @@ GccAna_Circ2d3Tan::GccAna_Circ2d3Tan(const GccEnt_QualifiedLin& Qualified1, } if (ok) { - if (Abs(dist2 - Radius) <= Tol) + if (std::abs(dist2 - Radius) <= Tol) { nbsol3 = 1; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dBisec.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dBisec.cxx index 027aba5735..f7b96cc686 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dBisec.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dBisec.cxx @@ -54,7 +54,7 @@ GccAna_Circ2dBisec::GccAna_Circ2dBisec(const gp_Circ2d& Circ1, const gp_Circ2d& Standard_Real R1 = Circ1.Radius(); Standard_Real R2 = Circ2.Radius(); - if (Abs(R1 - R2) <= Tol) + if (std::abs(R1 - R2) <= Tol) { sameradius = Standard_True; } @@ -81,7 +81,7 @@ GccAna_Circ2dBisec::GccAna_Circ2dBisec(const gp_Circ2d& Circ1, const gp_Circ2d& NbrSol = 2; WellDone = Standard_True; } - else if (Abs(R1 - dist - R2) <= Tol) + else if (std::abs(R1 - dist - R2) <= Tol) { intersection = 1; if (sameradius) @@ -109,7 +109,7 @@ GccAna_Circ2dBisec::GccAna_Circ2dBisec(const gp_Circ2d& Circ1, const gp_Circ2d& WellDone = Standard_True; } } - else if (Abs(R1 - dist + R2) <= Tol) + else if (std::abs(R1 - dist + R2) <= Tol) { intersection = 3; if (sameradius) @@ -199,7 +199,7 @@ Handle(GccInt_Bisec) GccAna_Circ2dBisec::ThisSolution(const Standard_Integer Ind { gp_Elips2d E(acencen, (R1 + R2) / 2.0, - Sqrt((R1 * R1 + R2 * R2 - dist * dist) / 4. + R1 * R2 / 2.)); + std::sqrt((R1 * R1 + R2 * R2 - dist * dist) / 4. + R1 * R2 / 2.)); bissol = new GccInt_BElips(E); // ============================= } @@ -214,7 +214,7 @@ Handle(GccInt_Bisec) GccAna_Circ2dBisec::ThisSolution(const Standard_Integer Ind { if (Index == 1) { - if (Abs(xcencir2 - xcencir1) < Tol && Abs(ycencir2 - ycencir1) < Tol) + if (std::abs(xcencir2 - xcencir1) < Tol && std::abs(ycencir2 - ycencir1) < Tol) { gp_Circ2d C(acenx, (R1 + R2) / 2.0); bissol = new GccInt_BCirc(C); @@ -224,14 +224,14 @@ Handle(GccInt_Bisec) GccAna_Circ2dBisec::ThisSolution(const Standard_Integer Ind { gp_Elips2d E(acencen, (R1 + R2) / 2.0, - Sqrt((R1 * R1 + R2 * R2 - dist * dist) / 4. + R1 * R2 / 2.)); + std::sqrt((R1 * R1 + R2 * R2 - dist * dist) / 4. + R1 * R2 / 2.)); bissol = new GccInt_BElips(E); // ============================== } } else if (Index == 2) { - if (Abs(xcencir2 - xcencir1) < Tol && Abs(ycencir2 - ycencir1) < Tol) + if (std::abs(xcencir2 - xcencir1) < Tol && std::abs(ycencir2 - ycencir1) < Tol) { gp_Circ2d C(acencen, (R1 - R2) / 2.); bissol = new GccInt_BCirc(C); @@ -241,7 +241,7 @@ Handle(GccInt_Bisec) GccAna_Circ2dBisec::ThisSolution(const Standard_Integer Ind { gp_Elips2d E(acencen, (R1 - R2) / 2.0, - Sqrt((R1 * R1 + R2 * R2 - dist * dist) / 4. - R1 * R2 / 2.)); + std::sqrt((R1 * R1 + R2 * R2 - dist * dist) / 4. - R1 * R2 / 2.)); bissol = new GccInt_BElips(E); // ============================== } @@ -259,7 +259,7 @@ Handle(GccInt_Bisec) GccAna_Circ2dBisec::ThisSolution(const Standard_Integer Ind } else if (Index == 2) { - gp_Elips2d E(acencen, R1, Sqrt(R1 * R1 - dist * dist / 4.0)); + gp_Elips2d E(acencen, R1, std::sqrt(R1 * R1 - dist * dist / 4.0)); bissol = new GccInt_BElips(E); // ============================== } @@ -269,13 +269,17 @@ Handle(GccInt_Bisec) GccAna_Circ2dBisec::ThisSolution(const Standard_Integer Ind if (Index == 1) { gp_Hypr2d H1; - H1 = gp_Hypr2d(acencen, (R1 - R2) / 2.0, Sqrt(dist * dist - (R1 - R2) * (R1 - R2)) / 2.0); + H1 = gp_Hypr2d(acencen, + (R1 - R2) / 2.0, + std::sqrt(dist * dist - (R1 - R2) * (R1 - R2)) / 2.0); bissol = new GccInt_BHyper(H1); // =============================== } else if (Index == 2) { - gp_Hypr2d H1(acencen, (R1 - R2) / 2.0, Sqrt(dist * dist - (R1 - R2) * (R1 - R2)) / 2.0); + gp_Hypr2d H1(acencen, + (R1 - R2) / 2.0, + std::sqrt(dist * dist - (R1 - R2) * (R1 - R2)) / 2.0); bissol = new GccInt_BHyper(H1.OtherBranch()); // =============================== } @@ -283,7 +287,7 @@ Handle(GccInt_Bisec) GccAna_Circ2dBisec::ThisSolution(const Standard_Integer Ind { gp_Elips2d E(acencen, (R1 + R2) / 2.0, - Sqrt((R1 * R1 + R2 * R2 - dist * dist) / 4. + R1 * R2 / 2.)); + std::sqrt((R1 * R1 + R2 * R2 - dist * dist) / 4. + R1 * R2 / 2.)); bissol = new GccInt_BElips(E); // ============================== } @@ -316,13 +320,17 @@ Handle(GccInt_Bisec) GccAna_Circ2dBisec::ThisSolution(const Standard_Integer Ind } else if (Index == 2) { - gp_Hypr2d H1(acencen, (R1 - R2) / 2.0, Sqrt(dist * dist - (R1 - R2) * (R1 - R2)) / 2.0); + gp_Hypr2d H1(acencen, + (R1 - R2) / 2.0, + std::sqrt(dist * dist - (R1 - R2) * (R1 - R2)) / 2.0); bissol = new GccInt_BHyper(H1); // =============================== } else if (Index == 3) { - gp_Hypr2d H1(acencen, (R1 - R2) / 2.0, Sqrt(dist * dist - (R1 - R2) * (R1 - R2)) / 2.0); + gp_Hypr2d H1(acencen, + (R1 - R2) / 2.0, + std::sqrt(dist * dist - (R1 - R2) * (R1 - R2)) / 2.0); bissol = new GccInt_BHyper(H1.OtherBranch()); // =============================== } @@ -340,13 +348,13 @@ Handle(GccInt_Bisec) GccAna_Circ2dBisec::ThisSolution(const Standard_Integer Ind } else if (Index == 2) { - gp_Hypr2d H1(acencen, R1, Sqrt(dist * dist - 4 * R1 * R1) / 2.0); + gp_Hypr2d H1(acencen, R1, std::sqrt(dist * dist - 4 * R1 * R1) / 2.0); bissol = new GccInt_BHyper(H1); // =============================== } else if (Index == 3) { - gp_Hypr2d H1(acencen, R1, Sqrt(dist * dist - 4 * R1 * R1) / 2.0); + gp_Hypr2d H1(acencen, R1, std::sqrt(dist * dist - 4 * R1 * R1) / 2.0); bissol = new GccInt_BHyper(H1.OtherBranch()); // =============================== } @@ -355,25 +363,33 @@ Handle(GccInt_Bisec) GccAna_Circ2dBisec::ThisSolution(const Standard_Integer Ind { if (Index == 1) { - gp_Hypr2d H1(acencen, (R1 - R2) / 2.0, Sqrt(dist * dist - (R1 - R2) * (R1 - R2)) / 2.0); + gp_Hypr2d H1(acencen, + (R1 - R2) / 2.0, + std::sqrt(dist * dist - (R1 - R2) * (R1 - R2)) / 2.0); bissol = new GccInt_BHyper(H1); // =============================== } else if (Index == 2) { - gp_Hypr2d H1(acencen, (R1 - R2) / 2.0, Sqrt(dist * dist - (R1 - R2) * (R1 - R2)) / 2.0); + gp_Hypr2d H1(acencen, + (R1 - R2) / 2.0, + std::sqrt(dist * dist - (R1 - R2) * (R1 - R2)) / 2.0); bissol = new GccInt_BHyper(H1.OtherBranch()); // =============================== } else if (Index == 3) { - gp_Hypr2d H1(acencen, (R1 + R2) / 2.0, Sqrt(dist * dist - (R1 + R2) * (R1 + R2)) / 2.0); + gp_Hypr2d H1(acencen, + (R1 + R2) / 2.0, + std::sqrt(dist * dist - (R1 + R2) * (R1 + R2)) / 2.0); bissol = new GccInt_BHyper(H1); // =============================== } else if (Index == 4) { - gp_Hypr2d H1(acencen, (R1 + R2) / 2.0, Sqrt(dist * dist - (R1 + R2) * (R1 + R2)) / 2.0); + gp_Hypr2d H1(acencen, + (R1 + R2) / 2.0, + std::sqrt(dist * dist - (R1 + R2) * (R1 + R2)) / 2.0); bissol = new GccInt_BHyper(H1.OtherBranch()); // =============================== } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanCen.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanCen.cxx index 7842841ee5..d7fc1cfd49 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanCen.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanCen.cxx @@ -66,7 +66,7 @@ GccAna_Circ2dTanCen::GccAna_Circ2dTanCen(const GccEnt_QualifiedCirc& Qualified1, return; } gp_Dir2d dirx(gp_Dir2d::D::X); - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); gp_Circ2d C1 = Qualified1.Qualified(); Standard_Real R1 = C1.Radius(); gp_Pnt2d center1(C1.Location()); @@ -82,7 +82,7 @@ GccAna_Circ2dTanCen::GccAna_Circ2dTanCen(const GccEnt_QualifiedCirc& Qualified1, // ============================ if (dist - R1 <= Tol) { - Radius = Abs(R1 - dist); + Radius = std::abs(R1 - dist); signe = 1; } else @@ -105,7 +105,7 @@ GccAna_Circ2dTanCen::GccAna_Circ2dTanCen(const GccEnt_QualifiedCirc& Qualified1, } else { - Radius = Abs(R1 - dist); + Radius = std::abs(R1 - dist); signe = -1; } } @@ -148,7 +148,7 @@ GccAna_Circ2dTanCen::GccAna_Circ2dTanCen(const GccEnt_QualifiedCirc& Qualified1, { signe1 = -signe; } - Radius = Abs(R1 + signe * dist); + Radius = std::abs(R1 + signe * dist); NbrSol++; cirsol(NbrSol) = gp_Circ2d(gp_Ax2d(Pcenter, dirx), Radius); // ======================================================== @@ -157,11 +157,11 @@ GccAna_Circ2dTanCen::GccAna_Circ2dTanCen(const GccEnt_QualifiedCirc& Qualified1, { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius - R1) < Tol) + else if (std::abs(distcc1 + Radius - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius) < Tol) + else if (std::abs(distcc1 - R1 - Radius) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad.cxx index ad0782b387..1d795996b5 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad.cxx @@ -69,7 +69,7 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedCirc& Qualifi TheSame1.Init(0); gp_Dir2d dirx(gp_Dir2d::D::X); - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; NbrSol = 0; if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() @@ -110,7 +110,7 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedCirc& Qualifi } else { - if (Abs(Radius - R1 + dist) < Tol) + if (std::abs(Radius - R1 + dist) < Tol) { WellDone = Standard_True; NbrSol = 1; @@ -170,7 +170,7 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedCirc& Qualifi } else { - if (Abs(dist - R1 - Radius) < Tol) + if (std::abs(dist - R1 - Radius) < Tol) { WellDone = Standard_True; NbrSol = 1; @@ -211,11 +211,11 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedCirc& Qualifi { qualifier1(1) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius - R1) < Tol) + else if (std::abs(distcc1 + Radius - R1) < Tol) { qualifier1(1) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius) < Tol) + else if (std::abs(distcc1 - R1 - Radius) < Tol) { qualifier1(1) = GccEnt_outside; } @@ -223,7 +223,7 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedCirc& Qualifi { qualifier1(1) = GccEnt_enclosing; } - if (Abs(Radius - R1) <= Tol) + if (std::abs(Radius - R1) <= Tol) { TheSame1(1) = 1; } @@ -245,7 +245,7 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedCirc& Qualifi OnLine.Coefficients(A, B, C); Standard_Real D = A; Standard_Real x0, y0; - if (Abs(D) <= Tol) + if (std::abs(D) <= Tol) { A = B; B = D; @@ -265,7 +265,7 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedCirc& Qualifi for (Standard_Integer i = 1; i <= Sol.NbSolutions(); i++) { - if (Abs(D) > Tol) + if (std::abs(D) > Tol) { yc = Sol.Value(i); xc = -(B / A) * yc - C / A; @@ -286,11 +286,11 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedCirc& Qualifi { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius - R1) < Tol) + else if (std::abs(distcc1 + Radius - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius) < Tol) + else if (std::abs(distcc1 - R1 - Radius) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_1.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_1.cxx index ce9647647c..06a3a6b1cb 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_1.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_1.cxx @@ -53,7 +53,7 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedLin& Qualifie parcen3(1, 2) { - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); gp_Dir2d dirx(gp_Dir2d::D::X); WellDone = Standard_False; NbrSol = 0; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_2.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_2.cxx index e51b267b17..1ea5dc9bcf 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_2.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_2.cxx @@ -56,7 +56,7 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const gp_Pnt2d& Point1, { gp_Dir2d dirx(gp_Dir2d::D::X); - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; NbrSol = 0; Standard_Real dp1lin = OnLine.Distance(Point1); @@ -80,7 +80,7 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const gp_Pnt2d& Point1, Standard_Real ydir = (OnLine.Direction()).Y(); Standard_Real lxloc = (OnLine.Location()).X(); Standard_Real lyloc = (OnLine.Location()).Y(); - if (Abs(dp1lin - Radius) < Tol) + if (std::abs(dp1lin - Radius) < Tol) { WellDone = Standard_True; NbrSol = 1; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_3.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_3.cxx index e22eec901e..32ad5d8268 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_3.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_3.cxx @@ -53,7 +53,7 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedCirc& Qualifi TheSame1.Init(0); gp_Dir2d dirx(gp_Dir2d::D::X); - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); Standard_Integer signe[5]; signe[0] = 0; signe[1] = 0; @@ -98,7 +98,7 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedCirc& Qualifi } else { - if (Abs(Radius - R1) < Tol) + if (std::abs(Radius - R1) < Tol) { if (OnCirc.Distance(center1) < Tol) { @@ -116,7 +116,7 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedCirc& Qualifi WellDone = Standard_False; } } - else if (Abs(R1 - dist - R2 - Radius) <= Tol) + else if (std::abs(R1 - dist - R2 - Radius) <= Tol) { dir1on(1) = gp_Dir2d(c1x - onx, c1y - ony); sign = -1; @@ -124,7 +124,7 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedCirc& Qualifi else { nparal = 1; - disparal[0] = Abs(R1 - Radius); + disparal[0] = std::abs(R1 - Radius); } } } @@ -137,7 +137,7 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedCirc& Qualifi } else { - if (Abs(Radius - R1) < Tol) + if (std::abs(Radius - R1) < Tol) { if (OnCirc.Distance(center1) < Tol) { @@ -155,10 +155,11 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedCirc& Qualifi WellDone = Standard_True; } } - else if ((Abs(R1 + dist - R2 - Radius) < Tol) || (Abs(Radius - R1 - dist - R2) < Tol)) + else if ((std::abs(R1 + dist - R2 - Radius) < Tol) + || (std::abs(Radius - R1 - dist - R2) < Tol)) { dir1on(1) = gp_Dir2d(c1x - onx, c1y - ony); - if (Abs(R1 + dist - R2 - Radius) < Tol) + if (std::abs(R1 + dist - R2 - Radius) < Tol) { sign = 1; } @@ -170,7 +171,7 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedCirc& Qualifi else { nparal = 1; - disparal[0] = Abs(R1 - Radius); + disparal[0] = std::abs(R1 - Radius); } } } @@ -184,18 +185,18 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedCirc& Qualifi else { dir1on(1) = gp_Dir2d(c1x - onx, c1y - ony); - if (Abs(R1 - dist - R2 + Radius) < Tol) + if (std::abs(R1 - dist - R2 + Radius) < Tol) { sign = -1; } - else if (Abs(dist - R1 - R2 - Radius) < Tol) + else if (std::abs(dist - R1 - R2 - Radius) < Tol) { sign = 1; } else { nparal = 1; - disparal[0] = Abs(R1 + Radius); + disparal[0] = std::abs(R1 + Radius); } } } @@ -212,7 +213,7 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedCirc& Qualifi else { dir1on(1) = gp_Dir2d(c1x - onx, c1y - ony); - if (Abs(dist - R1 - R2 - Radius) < Tol) + if (std::abs(dist - R1 - R2 - Radius) < Tol) { sign = 1; } @@ -227,8 +228,8 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedCirc& Qualifi else { nparal = 2; - disparal[0] = Abs(R1 + Radius); - disparal[1] = Abs(R1 - Radius); + disparal[0] = std::abs(R1 + Radius); + disparal[1] = std::abs(R1 - Radius); } } } @@ -250,11 +251,11 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedCirc& Qualifi { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius - R1) < Tol) + else if (std::abs(distcc1 + Radius - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius) < Tol) + else if (std::abs(distcc1 - R1 - Radius) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -286,11 +287,11 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedCirc& Qualifi { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius - R1) < Tol) + else if (std::abs(distcc1 + Radius - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius) < Tol) + else if (std::abs(distcc1 - R1 - Radius) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_4.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_4.cxx index 9e3b5adc6a..e112f36d92 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_4.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_4.cxx @@ -58,7 +58,7 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const GccEnt_QualifiedLin& Qualifie TheSame1.Init(0); gp_Dir2d dirx(gp_Dir2d::D::X); - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; NbrSol = 0; if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_5.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_5.cxx index a0112af763..72b029bb68 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_5.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Circ2dTanOnRad_5.cxx @@ -50,7 +50,7 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const gp_Pnt2d& Point1, { gp_Dir2d dirx(gp_Dir2d::D::X); - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; NbrSol = 0; Standard_Real Roncirc = OnCirc.Radius(); @@ -68,11 +68,11 @@ GccAna_Circ2dTanOnRad::GccAna_Circ2dTanOnRad(const gp_Pnt2d& Point1, else { Standard_Integer signe = 0; - if (Abs(dist1 - Radius) < Tol) + if (std::abs(dist1 - Radius) < Tol) { signe = 1; } - else if (Abs(dist2 - Radius) < Tol) + else if (std::abs(dist2 - Radius) < Tol) { signe = -1; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_CircLin2dBisec.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_CircLin2dBisec.cxx index b874eeda62..c74e729474 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_CircLin2dBisec.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_CircLin2dBisec.cxx @@ -80,7 +80,8 @@ Handle(GccInt_Bisec) GccAna_CircLin2dBisec::ThisSolution(const Standard_Integer Standard_Real ycencir = circle.Location().Y(); Standard_Real R1 = circle.Radius(); Standard_Real dist = line.Distance(circle.Location()); - if ((Abs(line.Distance(circle.Location()) - circle.Radius()) <= gp::Resolution()) && (Index == 1)) + if ((std::abs(line.Distance(circle.Location()) - circle.Radius()) <= gp::Resolution()) + && (Index == 1)) { gp_Lin2d biscirlin1(circle.Location(), gp_Dir2d(-ydir, xdir)); bissol = new GccInt_BLine(biscirlin1); @@ -123,7 +124,7 @@ Handle(GccInt_Bisec) GccAna_CircLin2dBisec::ThisSolution(const Standard_Integer ycencir - signe * xdir * (dist - R1) / 2.)), gp_Dir2d(-signe * ydir, signe * xdir)); } - biscirlin = gp_Parab2d(axeparab1, Abs(dist - R1) / 2.0); + biscirlin = gp_Parab2d(axeparab1, std::abs(dist - R1) / 2.0); } bissol = new GccInt_BParab(biscirlin); // ========================================================== diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_CircPnt2dBisec.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_CircPnt2dBisec.cxx index d9d630f880..78ff7a08b5 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_CircPnt2dBisec.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_CircPnt2dBisec.cxx @@ -57,7 +57,7 @@ void GccAna_CircPnt2dBisec::DefineSolutions() { Standard_Real dist = circle.Radius() - point.Distance(circle.Location()); - if (Abs(dist) < myTolerance) + if (std::abs(dist) < myTolerance) { theposition = 0; NbrSol = 1; @@ -122,7 +122,7 @@ Handle(GccInt_Bisec) GccAna_CircPnt2dBisec::ThisSolution(const Standard_Integer if (theposition == -1) { - gp_Elips2d biscirpnt(majax, R1 / 2., Sqrt(R1 * R1 - dist * dist) / 2.); + gp_Elips2d biscirpnt(majax, R1 / 2., std::sqrt(R1 * R1 - dist * dist) / 2.); bissol = new GccInt_BElips(biscirpnt); // =========================================================== } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Lin2d2Tan.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Lin2d2Tan.cxx index 0caa1df106..9671c3a8b2 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Lin2d2Tan.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Lin2d2Tan.cxx @@ -48,7 +48,7 @@ GccAna_Lin2d2Tan::GccAna_Lin2d2Tan(const gp_Pnt2d& ThePoint1, pararg2(1, 1) { - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; NbrSol = 0; Standard_Real dist = ThePoint1.Distance(ThePoint2); @@ -94,7 +94,7 @@ GccAna_Lin2d2Tan::GccAna_Lin2d2Tan(const GccEnt_QualifiedCirc& Qualified1, pararg2(1, 2) { - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; NbrSol = 0; if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() @@ -115,7 +115,7 @@ GccAna_Lin2d2Tan::GccAna_Lin2d2Tan(const GccEnt_QualifiedCirc& Qualified1, { WellDone = Standard_True; } - else if (Abs(ThePoint.Distance(C1.Location()) - R1) <= Tol) + else if (std::abs(ThePoint.Distance(C1.Location()) - R1) <= Tol) { gp_Dir2d dir(gp_Vec2d(C1.Location(), ThePoint)); linsol(1) = gp_Lin2d(ThePoint, gp_Dir2d(Standard_Real(-dir.Y()), Standard_Real(dir.X()))); @@ -131,7 +131,7 @@ GccAna_Lin2d2Tan::GccAna_Lin2d2Tan(const GccEnt_QualifiedCirc& Qualified1, { Standard_Real signe = 1; Standard_Real dist = ThePoint.Distance(C1.Location()); - Standard_Real d = dist - Sqrt(dist * dist - R1 * R1); + Standard_Real d = dist - std::sqrt(dist * dist - R1 * R1); if (Qualified1.IsEnclosing()) { // ============================= @@ -151,7 +151,7 @@ GccAna_Lin2d2Tan::GccAna_Lin2d2Tan(const GccEnt_QualifiedCirc& Qualified1, } for (Standard_Integer i = 1; i <= NbrSol; i++) { - gp_Pnt2d P1(C1.Location().Rotated(ThePoint, ASin(signe * R1 / dist))); + gp_Pnt2d P1(C1.Location().Rotated(ThePoint, std::asin(signe * R1 / dist))); gp_Dir2d D1(gp_Vec2d(P1, ThePoint)); P1 = gp_Pnt2d(P1.XY() + d * D1.XY()); linsol(i) = gp_Lin2d(P1, gp_Dir2d(gp_Vec2d(P1, ThePoint))); @@ -205,7 +205,7 @@ GccAna_Lin2d2Tan::GccAna_Lin2d2Tan(const GccEnt_QualifiedCirc& Qualified1, pararg2(1, 4) { - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; NbrSol = 0; if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() @@ -231,7 +231,7 @@ GccAna_Lin2d2Tan::GccAna_Lin2d2Tan(const GccEnt_QualifiedCirc& Qualified1, gp_Dir2d D1; Standard_Integer signe = 1; Standard_Real dist = C1.Location().Distance(C2.Location()); - if (Tol < Max(R1, R2) - dist - Min(R1, R2)) + if (Tol < std::max(R1, R2) - dist - std::min(R1, R2)) { WellDone = Standard_True; } @@ -241,7 +241,7 @@ GccAna_Lin2d2Tan::GccAna_Lin2d2Tan(const GccEnt_QualifiedCirc& Qualified1, if (Qualified1.IsEnclosing() && Qualified2.IsEnclosing()) { // ========================================================= - if (Abs(dist + Min(R1, R2) - Max(R1, R2)) <= Tol && dist >= Tol) + if (std::abs(dist + std::min(R1, R2) - std::max(R1, R2)) <= Tol && dist >= Tol) { if (R1 < R2) { @@ -263,7 +263,7 @@ GccAna_Lin2d2Tan::GccAna_Lin2d2Tan(const GccEnt_QualifiedCirc& Qualified1, } else { - gp_Pnt2d P1(C2.Location().Rotated(C1.Location(), ASin((R1 - R2) / dist))); + gp_Pnt2d P1(C2.Location().Rotated(C1.Location(), std::asin((R1 - R2) / dist))); D1 = gp_Dir2d(gp_Vec2d(C1.Location(), P1)); P1 = gp_Pnt2d((C1.Location().XY() + gp_XY(R1 * D1.Y(), -R1 * D1.X()))); linsol(1) = gp_Lin2d(P1, D1); @@ -293,7 +293,7 @@ GccAna_Lin2d2Tan::GccAna_Lin2d2Tan(const GccEnt_QualifiedCirc& Qualified1, { WellDone = Standard_True; } - else if (Abs(dist - R1 - R2) < Tol && dist > Tol) + else if (std::abs(dist - R1 - R2) < Tol && dist > Tol) { D1 = gp_Dir2d(gp_Vec2d(C1.Location(), C2.Location())); gp_Pnt2d P1(C1.Location().XY() + R1 * D1.XY()); @@ -308,7 +308,7 @@ GccAna_Lin2d2Tan::GccAna_Lin2d2Tan(const GccEnt_QualifiedCirc& Qualified1, } else { - gp_Pnt2d P1(C2.Location().Rotated(C1.Location(), ASin(signe * (R1 + R2) / dist))); + gp_Pnt2d P1(C2.Location().Rotated(C1.Location(), std::asin(signe * (R1 + R2) / dist))); D1 = gp_Dir2d(gp_Vec2d(C1.Location(), P1)); P1 = gp_Pnt2d(C1.Location().XY() + signe * (gp_XY(R1 * D1.Y(), -R1 * D1.X()))); linsol(1) = gp_Lin2d(P1, D1); @@ -324,7 +324,7 @@ GccAna_Lin2d2Tan::GccAna_Lin2d2Tan(const GccEnt_QualifiedCirc& Qualified1, else if (Qualified1.IsOutside() && Qualified2.IsOutside()) { // ========================================================= - if (Abs(dist + Min(R1, R2) - Max(R1, R2)) < Tol && dist > Tol) + if (std::abs(dist + std::min(R1, R2) - std::max(R1, R2)) < Tol && dist > Tol) { if (R1 < R2) { @@ -348,7 +348,7 @@ GccAna_Lin2d2Tan::GccAna_Lin2d2Tan(const GccEnt_QualifiedCirc& Qualified1, } else { - gp_Pnt2d P1(C2.Location().Rotated(C1.Location(), ASin((R2 - R1) / dist))); + gp_Pnt2d P1(C2.Location().Rotated(C1.Location(), std::asin((R2 - R1) / dist))); D1 = gp_Dir2d(gp_Vec2d(C1.Location(), P1)); P1 = gp_Pnt2d(C1.Location().XY() + gp_XY(-R1 * D1.Y(), R1 * D1.X())); linsol(1) = gp_Lin2d(P1, D1); @@ -376,7 +376,7 @@ GccAna_Lin2d2Tan::GccAna_Lin2d2Tan(const GccEnt_QualifiedCirc& Qualified1, { signe = -1; } - if (Abs(dist + Min(R1, R2) - Max(R1, R2)) < Tol && dist > Tol) + if (std::abs(dist + std::min(R1, R2) - std::max(R1, R2)) < Tol && dist > Tol) { if (R1 < R2) { @@ -400,7 +400,7 @@ GccAna_Lin2d2Tan::GccAna_Lin2d2Tan(const GccEnt_QualifiedCirc& Qualified1, } else { - gp_Pnt2d P1(C2.Location().Rotated(C1.Location(), ASin((R1 - R2) / dist))); + gp_Pnt2d P1(C2.Location().Rotated(C1.Location(), std::asin((R1 - R2) / dist))); D1 = gp_Dir2d(gp_Vec2d(C1.Location(), P1)); P1 = gp_Pnt2d(C1.Location().XY() + gp_XY(R1 * D1.Y(), -R1 * D1.X())); linsol(1) = gp_Lin2d(P1, D1); @@ -412,9 +412,10 @@ GccAna_Lin2d2Tan::GccAna_Lin2d2Tan(const GccEnt_QualifiedCirc& Qualified1, gp_Pnt2d(C2.Location().XY() + signe * (gp_XY(R2 * D1.Y(), -R2 * D1.X()))); WellDone = Standard_True; NbrSol = 1; - if (Min(R1, R2) + Max(R1, R2) < dist) + if (std::min(R1, R2) + std::max(R1, R2) < dist) { - gp_Pnt2d P2(C2.Location().Rotated(C1.Location(), ASin(signe * (R1 + R2) / dist))); + gp_Pnt2d P2( + C2.Location().Rotated(C1.Location(), std::asin(signe * (R1 + R2) / dist))); gp_Dir2d D2(gp_Vec2d(C1.Location(), P2)); P2 = gp_Pnt2d(C1.Location().XY() + signe * (gp_XY(R1 * D2.Y(), -R1 * D2.X()))); linsol(2) = gp_Lin2d(P2, D2); @@ -440,7 +441,7 @@ GccAna_Lin2d2Tan::GccAna_Lin2d2Tan(const GccEnt_QualifiedCirc& Qualified1, { signe = -1; } - if (Abs(dist + Min(R1, R2) - Max(R1, R2)) <= Tol && dist >= Tol) + if (std::abs(dist + std::min(R1, R2) - std::max(R1, R2)) <= Tol && dist >= Tol) { if (R1 < R2) { @@ -464,7 +465,7 @@ GccAna_Lin2d2Tan::GccAna_Lin2d2Tan(const GccEnt_QualifiedCirc& Qualified1, } else { - gp_Pnt2d P1(C2.Location().Rotated(C1.Location(), ASin(signe * (R2 - R1) / dist))); + gp_Pnt2d P1(C2.Location().Rotated(C1.Location(), std::asin(signe * (R2 - R1) / dist))); D1 = gp_Dir2d(gp_Vec2d(C1.Location(), P1)); P1 = gp_Pnt2d(C1.Location().XY() + gp_XY(-R1 * D1.Y(), R1 * D1.X())); linsol(1) = gp_Lin2d(P1, D1); @@ -476,9 +477,10 @@ GccAna_Lin2d2Tan::GccAna_Lin2d2Tan(const GccEnt_QualifiedCirc& Qualified1, gp_Pnt2d(C2.Location().XY() + signe * (gp_XY(-R2 * D1.Y(), R2 * D1.X()))); WellDone = Standard_True; NbrSol = 1; - if (Min(R1, R2) + Max(R1, R2) < dist) + if (std::min(R1, R2) + std::max(R1, R2) < dist) { - gp_Pnt2d P2(C2.Location().Rotated(C1.Location(), ASin(signe * (-R2 - R1) / dist))); + gp_Pnt2d P2( + C2.Location().Rotated(C1.Location(), std::asin(signe * (-R2 - R1) / dist))); gp_Dir2d D2(gp_Vec2d(C1.Location(), P2)); P2 = gp_Pnt2d(C1.Location().XY() + signe * (gp_XY(-R1 * D2.Y(), R1 * D2.X()))); linsol(2) = gp_Lin2d(P2, D2); @@ -500,7 +502,7 @@ GccAna_Lin2d2Tan::GccAna_Lin2d2Tan(const GccEnt_QualifiedCirc& Qualified1, { signe = -signe; NbrSol++; - gp_Pnt2d P1(C2.Location().Rotated(C1.Location(), ASin(signe * (R2 - R1) / dist))); + gp_Pnt2d P1(C2.Location().Rotated(C1.Location(), std::asin(signe * (R2 - R1) / dist))); D1 = gp_Dir2d(gp_Vec2d(C1.Location(), P1)); P1 = gp_Pnt2d(C1.Location().XY() + signe * gp_XY(-R1 * D1.Y(), R1 * D1.X())); linsol(NbrSol) = gp_Lin2d(P1, D1); @@ -511,9 +513,9 @@ GccAna_Lin2d2Tan::GccAna_Lin2d2Tan(const GccEnt_QualifiedCirc& Qualified1, pnttg2sol(NbrSol) = gp_Pnt2d(C2.Location().XY() + signe * (gp_XY(-R2 * D1.Y(), R2 * D1.X()))); WellDone = Standard_True; - if (Min(R1, R2) + Max(R1, R2) < dist) + if (std::min(R1, R2) + std::max(R1, R2) < dist) { - gp_Pnt2d P2(C2.Location().Rotated(C1.Location(), ASin(signe * (R2 + R1) / dist))); + gp_Pnt2d P2(C2.Location().Rotated(C1.Location(), std::asin(signe * (R2 + R1) / dist))); gp_Dir2d D2(gp_Vec2d(C1.Location(), P2)); P2 = gp_Pnt2d(C1.Location().XY() + signe * (gp_XY(R1 * D2.Y(), -R1 * D2.X()))); NbrSol++; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Lin2dTanObl.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Lin2dTanObl.cxx index b6c571ddd3..b1b89ddbda 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Lin2dTanObl.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GccAna/GccAna_Lin2dTanObl.cxx @@ -57,9 +57,9 @@ GccAna_Lin2dTanObl::GccAna_Lin2dTanObl(const gp_Pnt2d& ThePoint, linsol(1) = gp_Lin2d(ThePoint, // ============================== - gp_Dir2d(Cosa * Cos(TheAngle) - Sina * Sin(TheAngle), + gp_Dir2d(Cosa * std::cos(TheAngle) - Sina * std::sin(TheAngle), // =============================================== - Sina * Cos(TheAngle) + Sin(TheAngle) * Cosa)); + Sina * std::cos(TheAngle) + std::sin(TheAngle) * Cosa)); // ======================================= qualifier1(1) = GccEnt_noqualifier; pnttg1sol(1) = ThePoint; @@ -131,8 +131,8 @@ GccAna_Lin2dTanObl::GccAna_Lin2dTanObl(const GccEnt_QualifiedCirc& Qualified1, if (Qualified1.IsEnclosing()) { // ============================= - gp_XY xy(Cos(TheAngle) * Cosa - Sin(TheAngle) * Sina, - Cos(TheAngle) * Sina + Sin(TheAngle) * Cosa); + gp_XY xy(std::cos(TheAngle) * Cosa - std::sin(TheAngle) * Sina, + std::cos(TheAngle) * Sina + std::sin(TheAngle) * Cosa); pnttg1sol(1) = gp_Pnt2d(C1.Location().XY() + R1 * gp_XY(xy.Y(), -xy.X())); linsol(1) = gp_Lin2d(pnttg1sol(1), gp_Dir2d(xy)); // =============================================== @@ -154,8 +154,8 @@ GccAna_Lin2dTanObl::GccAna_Lin2dTanObl(const GccEnt_QualifiedCirc& Qualified1, else if (Qualified1.IsOutside()) { // ================================ - gp_XY xy(Cos(TheAngle) * Cosa - Sin(TheAngle) * Sina, - Cos(TheAngle) * Sina + Sin(TheAngle) * Cosa); + gp_XY xy(std::cos(TheAngle) * Cosa - std::sin(TheAngle) * Sina, + std::cos(TheAngle) * Sina + std::sin(TheAngle) * Cosa); pnttg1sol(1) = gp_Pnt2d(C1.Location().XY() + R1 * gp_XY(-xy.Y(), xy.X())); linsol(1) = gp_Lin2d(pnttg1sol(1), gp_Dir2d(xy)); // =============================================== @@ -177,8 +177,8 @@ GccAna_Lin2dTanObl::GccAna_Lin2dTanObl(const GccEnt_QualifiedCirc& Qualified1, else if (Qualified1.IsUnqualified()) { // ==================================== - gp_XY xy(Cos(TheAngle) * Cosa - Sin(TheAngle) * Sina, - Cos(TheAngle) * Sina + Sin(TheAngle) * Cosa); + gp_XY xy(std::cos(TheAngle) * Cosa - std::sin(TheAngle) * Sina, + std::cos(TheAngle) * Sina + std::sin(TheAngle) * Cosa); pnttg1sol(1) = gp_Pnt2d(C1.Location().XY() + R1 * gp_XY(xy.Y(), -xy.X())); linsol(1) = gp_Lin2d(pnttg1sol(1), gp_Dir2d(xy)); // =============================================== diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dAPI/Geom2dAPI_Interpolate.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dAPI/Geom2dAPI_Interpolate.cxx index 411b9a8886..e77abce338 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dAPI/Geom2dAPI_Interpolate.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dAPI/Geom2dAPI_Interpolate.cxx @@ -259,8 +259,8 @@ static void ScaleTangents(const TColgp_Array1OfPnt2d& PointsArray, value[0] = value[1] = 0.0e0; for (jj = 1; jj <= 2; jj++) { - value[0] += Abs(TangentsArray.Value(ii).Coord(jj)); - value[1] += Abs(eval_result[1][jj - 1]); + value[0] += std::abs(TangentsArray.Value(ii).Coord(jj)); + value[1] += std::abs(eval_result[1][jj - 1]); } ratio = value[1] / value[0]; for (jj = 1; jj <= 2; jj++) diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanOnGeo.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanOnGeo.cxx index 84fae67d25..bf7cefc3e3 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanOnGeo.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanOnGeo.cxx @@ -70,7 +70,7 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedCirc& Standard_Real thelast = 100000.; Standard_Real firstparam; Standard_Real lastparam; - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); NbrSol = 0; TColStd_Array1OfReal Rbid(1, 2); TColStd_Array1OfReal RBid(1, 2); @@ -97,15 +97,15 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedCirc& Standard_Integer nbsolution = Bis.NbSolutions(); Handle(Geom2dAdaptor_Curve) HCu2 = new Geom2dAdaptor_Curve(OnCurv); Adaptor2d_OffsetCurve Cu2(HCu2, 0.); - firstparam = Max(Cu2.FirstParameter(), thefirst); - lastparam = Min(Cu2.LastParameter(), thelast); + firstparam = std::max(Cu2.FirstParameter(), thefirst); + lastparam = std::min(Cu2.LastParameter(), thelast); IntRes2d_Domain D2(Cu2.Value(firstparam), firstparam, Tol, Cu2.Value(lastparam), lastparam, Tol); - Standard_Real Tol1 = Abs(Tolerance); + Standard_Real Tol1 = std::abs(Tolerance); Standard_Real Tol2 = Tol1; for (Standard_Integer i = 1; i <= nbsolution; i++) { @@ -176,7 +176,7 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedCirc& if (dist1 - R1 < Tol) { nbsol = 1; - Rbid(1) = Abs(R1 - dist1); + Rbid(1) = std::abs(R1 - dist1); } } else if (Qualified1.IsOutside()) @@ -184,7 +184,7 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedCirc& if (R1 - dist1 < Tol) { nbsol = 1; - Rbid(1) = Abs(dist1 - R1); + Rbid(1) = std::abs(dist1 - R1); } } else if (Qualified1.IsEnclosing()) @@ -196,20 +196,20 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedCirc& { nbsol = 2; Rbid(1) = dist1 + R1; - Rbid(1) = Abs(dist1 - R1); + Rbid(1) = std::abs(dist1 - R1); } if (Qualified2.IsEnclosed() && nbsol != 0) { if (dist2 - R2 < Tol) { - RBid(1) = Abs(R2 - dist2); + RBid(1) = std::abs(R2 - dist2); } } else if (Qualified2.IsOutside() && nbsol != 0) { if (R2 - dist2 < Tol) { - RBid(1) = Abs(R2 - dist2); + RBid(1) = std::abs(R2 - dist2); } } else if (Qualified2.IsEnclosing() && nbsol != 0) @@ -219,13 +219,13 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedCirc& else if (Qualified2.IsUnqualified() && nbsol != 0) { RBid(1) = dist2 + R2; - RBid(2) = Abs(R2 - dist2); + RBid(2) = std::abs(R2 - dist2); } for (Standard_Integer isol = 1; isol <= nbsol; isol++) { for (Standard_Integer jsol = 1; jsol <= nbsol; jsol++) { - if (Abs(Rbid(isol) - RBid(jsol)) <= Tol) + if (std::abs(Rbid(isol) - RBid(jsol)) <= Tol) { nnsol++; Radius(nnsol) = (RBid(jsol) + Rbid(isol)) / 2.; @@ -245,11 +245,11 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedCirc& { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius(i) - R1) < Tol) + else if (std::abs(distcc1 + Radius(i) - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius(i)) < Tol) + else if (std::abs(distcc1 - R1 - Radius(i)) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -261,11 +261,11 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedCirc& { qualifier2(NbrSol) = Qualified2.Qualifier(); } - else if (Abs(distcc2 + Radius(i) - R2) < Tol) + else if (std::abs(distcc2 + Radius(i) - R2) < Tol) { qualifier2(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc2 - R2 - Radius(i)) < Tol) + else if (std::abs(distcc2 - R2 - Radius(i)) < Tol) { qualifier2(NbrSol) = GccEnt_outside; } @@ -273,7 +273,7 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedCirc& { qualifier2(NbrSol) = GccEnt_enclosing; } - if (dist1 <= Tol && Abs(Radius(k) - C1.Radius()) <= Tol) + if (dist1 <= Tol && std::abs(Radius(k) - C1.Radius()) <= Tol) { TheSame1(NbrSol) = 1; } @@ -285,7 +285,7 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedCirc& par1sol(NbrSol) = ElCLib::Parameter(cirsol(NbrSol), pnttg1sol(NbrSol)); pararg1(NbrSol) = ElCLib::Parameter(C1, pnttg1sol(NbrSol)); } - if (dist2 <= Tol && Abs(Radius(k) - C2.Radius()) <= Tol) + if (dist2 <= Tol && std::abs(Radius(k) - C2.Radius()) <= Tol) { TheSame2(NbrSol) = 1; } @@ -345,7 +345,7 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedCirc& Standard_Real firstparam; Standard_Real lastparam; NbrSol = 0; - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); Standard_Real Radius; if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) @@ -366,14 +366,14 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedCirc& GccAna_CircLin2dBisec Bis(C1, L2); if (Bis.IsDone()) { - Standard_Real Tol1 = Abs(Tolerance); + Standard_Real Tol1 = std::abs(Tolerance); Standard_Real Tol2 = Tol1; Geom2dInt_TheIntConicCurveOfGInter Intp; Standard_Integer nbsolution = Bis.NbSolutions(); Handle(Geom2dAdaptor_Curve) HCu2 = new Geom2dAdaptor_Curve(OnCurv); Adaptor2d_OffsetCurve C2(HCu2, 0.); - firstparam = Max(C2.FirstParameter(), thefirst); - lastparam = Min(C2.LastParameter(), thelast); + firstparam = std::max(C2.FirstParameter(), thefirst); + lastparam = std::min(C2.LastParameter(), thelast); IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol, C2.Value(lastparam), lastparam, Tol); for (Standard_Integer i = 1; i <= nbsolution; i++) { @@ -469,11 +469,11 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedCirc& { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius - R1) < Tol) + else if (std::abs(distcc1 + Radius - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius) < Tol) + else if (std::abs(distcc1 - R1 - Radius) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -493,7 +493,7 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedCirc& { qualifier2(NbrSol) = GccEnt_enclosed; } - if (dist1 <= Tol && Abs(Radius - C1.Radius()) <= Tol) + if (dist1 <= Tol && std::abs(Radius - C1.Radius()) <= Tol) { TheSame1(NbrSol) = 1; } @@ -564,7 +564,7 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedLin& throw GccEnt_BadQualifier(); return; } - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); Standard_Real Radius = 0; gp_Dir2d dirx(gp_Dir2d::D::X); gp_Lin2d L1 = Qualified1.Qualified(); @@ -578,14 +578,14 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedLin& GccAna_Lin2dBisec Bis(L1, L2); if (Bis.IsDone()) { - Standard_Real Tol1 = Abs(Tolerance); + Standard_Real Tol1 = std::abs(Tolerance); Standard_Real Tol2 = Tol1; Geom2dInt_TheIntConicCurveOfGInter Intp; Standard_Integer nbsolution = Bis.NbSolutions(); Handle(Geom2dAdaptor_Curve) HCu2 = new Geom2dAdaptor_Curve(OnCurv); Adaptor2d_OffsetCurve C2(HCu2, 0.); - firstparam = Max(C2.FirstParameter(), thefirst); - lastparam = Min(C2.LastParameter(), thelast); + firstparam = std::max(C2.FirstParameter(), thefirst); + lastparam = std::min(C2.LastParameter(), thelast); IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol, C2.Value(lastparam), lastparam, Tol); IntRes2d_Domain D1; for (Standard_Integer i = 1; i <= nbsolution; i++) @@ -746,7 +746,7 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedCirc& throw GccEnt_BadQualifier(); return; } - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); Standard_Real Radius; gp_Dir2d dirx(gp_Dir2d::D::X); gp_Circ2d C1 = Qualified1.Qualified(); @@ -755,14 +755,14 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedCirc& GccAna_CircPnt2dBisec Bis(C1, Point2); if (Bis.IsDone()) { - Standard_Real Tol1 = Abs(Tolerance); + Standard_Real Tol1 = std::abs(Tolerance); Standard_Real Tol2 = Tol1; Geom2dInt_TheIntConicCurveOfGInter Intp; Standard_Integer nbsolution = Bis.NbSolutions(); Handle(Geom2dAdaptor_Curve) HCu2 = new Geom2dAdaptor_Curve(OnCurv); Adaptor2d_OffsetCurve C2(HCu2, 0.); - firstparam = Max(C2.FirstParameter(), thefirst); - lastparam = Min(C2.LastParameter(), thelast); + firstparam = std::max(C2.FirstParameter(), thefirst); + lastparam = std::min(C2.LastParameter(), thelast); IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol, C2.Value(lastparam), lastparam, Tol); for (Standard_Integer i = 1; i <= nbsolution; i++) { @@ -858,11 +858,11 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedCirc& { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius - R1) < Tol) + else if (std::abs(distcc1 + Radius - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius) < Tol) + else if (std::abs(distcc1 - R1 - Radius) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -871,7 +871,7 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedCirc& qualifier1(NbrSol) = GccEnt_enclosing; } qualifier2(NbrSol) = GccEnt_noqualifier; - if (dist1 <= Tol && Abs(Radius - R1) <= Tol) + if (dist1 <= Tol && std::abs(Radius - R1) <= Tol) { TheSame1(NbrSol) = 1; } @@ -934,7 +934,7 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedLin& Standard_Real thelast = 100000.; Standard_Real firstparam; Standard_Real lastparam; - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); NbrSol = 0; if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) { @@ -949,13 +949,13 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const GccEnt_QualifiedLin& GccAna_LinPnt2dBisec Bis(L1, Point2); if (Bis.IsDone()) { - Standard_Real Tol1 = Abs(Tolerance); + Standard_Real Tol1 = std::abs(Tolerance); Standard_Real Tol2 = Tol1; Geom2dInt_TheIntConicCurveOfGInter Intp; Handle(Geom2dAdaptor_Curve) HCu2 = new Geom2dAdaptor_Curve(OnCurv); Adaptor2d_OffsetCurve C2(HCu2, 0.); - firstparam = Max(C2.FirstParameter(), thefirst); - lastparam = Min(C2.LastParameter(), thelast); + firstparam = std::max(C2.FirstParameter(), thefirst); + lastparam = std::min(C2.LastParameter(), thelast); IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol, C2.Value(lastparam), lastparam, Tol); Handle(GccInt_Bisec) Sol = Bis.ThisSolution(); GccInt_IType type = Sol->ArcType(); @@ -1088,19 +1088,19 @@ Geom2dGcc_Circ2d2TanOnGeo::Geom2dGcc_Circ2d2TanOnGeo(const gp_Pnt2d& Standard_Real thelast = 100000.; Standard_Real firstparam; Standard_Real lastparam; - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); NbrSol = 0; gp_Dir2d dirx(gp_Dir2d::D::X); GccAna_Pnt2dBisec Bis(Point1, Point2); if (Bis.IsDone()) { - Standard_Real Tol1 = Abs(Tolerance); + Standard_Real Tol1 = std::abs(Tolerance); Standard_Real Tol2 = Tol1; Geom2dInt_TheIntConicCurveOfGInter Intp; Handle(Geom2dAdaptor_Curve) HCu2 = new Geom2dAdaptor_Curve(OnCurv); Adaptor2d_OffsetCurve Cu2(HCu2, 0.); - firstparam = Max(Cu2.FirstParameter(), thefirst); - lastparam = Min(Cu2.LastParameter(), thelast); + firstparam = std::max(Cu2.FirstParameter(), thefirst); + lastparam = std::min(Cu2.LastParameter(), thelast); IntRes2d_Domain D2(Cu2.Value(firstparam), firstparam, Tol, diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanOnIter.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanOnIter.cxx index 703b336cde..dc5fccf9cd 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanOnIter.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanOnIter.cxx @@ -59,7 +59,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const GccEnt_QualifiedLin parcen3 = 0.; WellDone = Standard_False; - Standard_Real Tol = Abs(Tolang); + Standard_Real Tol = std::abs(Tolang); qualifier1 = GccEnt_noqualifier; qualifier2 = GccEnt_noqualifier; if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified()) @@ -95,7 +95,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const GccEnt_QualifiedLin gp_Pnt2d point2 = Geom2dGcc_CurveTool::Value(Cu2, Param2); gp_Pnt2d point3 = ElCLib::Value(Param3, OnLine); Ufirst(4) = (point3.Distance(point2) + point3.Distance(point1)) / 2.; - Geom2dGcc_FunctionTanCuCuOnCu Func(L1, Cu2, OnLine, Max(Ufirst(4), Tol)); + Geom2dGcc_FunctionTanCuCuOnCu Func(L1, Cu2, OnLine, std::max(Ufirst(4), Tol)); math_FunctionSetRoot Root(Func, tol); Root.Perform(Func, Ufirst, Umin, Umax); Func.Value(Ufirst, Umin); @@ -110,7 +110,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const GccEnt_QualifiedLin gp_Pnt2d point3new(OnLine.Location().XY() + Ufirst(3) * Tan3.XY()); Standard_Real dist1 = point3new.Distance(point1); Standard_Real dist2 = point3new.Distance(point2); - if (Abs(dist1 - dist2) / 2. <= Tol) + if (std::abs(dist1 - dist2) / 2. <= Tol) { cirsol = gp_Circ2d(gp_Ax2d(point3new, dirx), (dist1 + dist2) / 2.); Standard_Real normetan2 = Tan2.Magnitude(); @@ -177,7 +177,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const Geom2dGcc_QCurve& Q throw GccEnt_BadQualifier(); return; } - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); gp_Dir2d dirx(gp_Dir2d::D::X); Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified(); Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified(); @@ -196,15 +196,15 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const Geom2dGcc_QCurve& Q Ufirst(1) = Param1; Ufirst(2) = Param2; Ufirst(3) = Param3; - tol(1) = Geom2dGcc_CurveTool::EpsX(Cu1, Abs(Tolerance)); - tol(2) = Geom2dGcc_CurveTool::EpsX(Cu2, Abs(Tolerance)); + tol(1) = Geom2dGcc_CurveTool::EpsX(Cu1, std::abs(Tolerance)); + tol(2) = Geom2dGcc_CurveTool::EpsX(Cu2, std::abs(Tolerance)); tol(3) = 1.e-15; tol(4) = Tol / 10.; gp_Pnt2d point1 = Geom2dGcc_CurveTool::Value(Cu1, Param1); gp_Pnt2d point2 = Geom2dGcc_CurveTool::Value(Cu2, Param2); gp_Pnt2d point3 = ElCLib::Value(Param3, OnLine); Ufirst(4) = (point3.Distance(point2) + point3.Distance(point1)) / 2.; - Geom2dGcc_FunctionTanCuCuOnCu Func(Cu1, Cu2, OnLine, Max(Ufirst(4), Tol)); + Geom2dGcc_FunctionTanCuCuOnCu Func(Cu1, Cu2, OnLine, std::max(Ufirst(4), Tol)); math_FunctionSetRoot Root(Func, tol); Root.Perform(Func, Ufirst, Umin, Umax); Func.Value(Ufirst, Umin); @@ -222,7 +222,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const Geom2dGcc_QCurve& Q { return; } - if (Abs(dist1 - dist2) / 2. <= Tol) + if (std::abs(dist1 - dist2) / 2. <= Tol) { cirsol = gp_Circ2d(gp_Ax2d(point3new, dirx), (dist1 + dist2) / 2.); Standard_Real normetan1 = Tan1.Magnitude(); @@ -295,7 +295,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const Geom2dGcc_QCurve& Q throw GccEnt_BadQualifier(); return; } - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); gp_Dir2d dirx(gp_Dir2d::D::X); Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified(); math_Vector Umin(1, 3); @@ -310,13 +310,13 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const Geom2dGcc_QCurve& Q Umax(3) = RealLast(); Ufirst(1) = Param1; Ufirst(2) = Param2; - tol(1) = Geom2dGcc_CurveTool::EpsX(Cu1, Abs(Tolerance)); + tol(1) = Geom2dGcc_CurveTool::EpsX(Cu1, std::abs(Tolerance)); tol(2) = 1.e-15; tol(3) = Tol / 10.; gp_Pnt2d point1 = Geom2dGcc_CurveTool::Value(Cu1, Param1); gp_Pnt2d point3 = ElCLib::Value(Param2, OnLine); Ufirst(3) = (point3.Distance(Point2) + point3.Distance(point1)) / 2.; - Geom2dGcc_FunctionTanCuCuOnCu Func(Cu1, Point2, OnLine, Max(Ufirst(3), Tol)); + Geom2dGcc_FunctionTanCuCuOnCu Func(Cu1, Point2, OnLine, std::max(Ufirst(3), Tol)); math_FunctionSetRoot Root(Func, tol); Root.Perform(Func, Ufirst, Umin, Umax); Func.Value(Ufirst, Umin); @@ -329,7 +329,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const Geom2dGcc_QCurve& Q ElCLib::D1(Ufirst(2), OnLine, point3new, Tan3); Standard_Real dist1 = point3new.Distance(point1new); Standard_Real dist2 = point3new.Distance(Point2); - if (Abs(dist1 - dist2) / 2. <= Tol) + if (std::abs(dist1 - dist2) / 2. <= Tol) { cirsol = gp_Circ2d(gp_Ax2d(point3new, dirx), (dist1 + dist2) / 2.); Standard_Real normetan1 = Tan1.Magnitude(); @@ -390,7 +390,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const GccEnt_QualifiedCir throw GccEnt_BadQualifier(); return; } - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); gp_Dir2d dirx(gp_Dir2d::D::X); gp_Circ2d C1 = Qualified1.Qualified(); Standard_Real R1 = C1.Radius(); @@ -411,14 +411,14 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const GccEnt_QualifiedCir Ufirst(2) = Param2; Ufirst(3) = Param3; tol(1) = 2.e-15 * M_PI; - tol(2) = Geom2dGcc_CurveTool::EpsX(Cu2, Abs(Tolerance)); + tol(2) = Geom2dGcc_CurveTool::EpsX(Cu2, std::abs(Tolerance)); tol(3) = 1.e-15; tol(4) = Tol / 10.; gp_Pnt2d point1 = ElCLib::Value(Param1, C1); gp_Pnt2d point2 = Geom2dGcc_CurveTool::Value(Cu2, Param2); gp_Pnt2d point3 = ElCLib::Value(Param3, OnLine); Ufirst(4) = (point3.Distance(point2) + point3.Distance(point1)) / 2.; - Geom2dGcc_FunctionTanCuCuOnCu Func(C1, Cu2, OnLine, Max(Ufirst(4), Tol)); + Geom2dGcc_FunctionTanCuCuOnCu Func(C1, Cu2, OnLine, std::max(Ufirst(4), Tol)); math_FunctionSetRoot Root(Func, tol); Root.Perform(Func, Ufirst, Umin, Umax); Func.Value(Ufirst, Umin); @@ -437,7 +437,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const GccEnt_QualifiedCir point3 = ElCLib::Value(Ufirst(1), OnLine); Standard_Real dist1 = point3.Distance(point1); Standard_Real dist2 = point3.Distance(point2); - if (Abs(dist1 - dist2) / 2. <= Tol) + if (std::abs(dist1 - dist2) / 2. <= Tol) { cirsol = gp_Circ2d(gp_Ax2d(point3, dirx), (dist1 + dist2) / 2.); Standard_Real normetan2 = Tan2.Magnitude(); @@ -506,7 +506,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const GccEnt_QualifiedCir throw GccEnt_BadQualifier(); return; } - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); gp_Dir2d dirx(gp_Dir2d::D::X); gp_Circ2d C1 = Qualified1.Qualified(); Standard_Real R1 = C1.Radius(); @@ -527,14 +527,14 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const GccEnt_QualifiedCir Ufirst(2) = Param2; Ufirst(3) = Param3; tol(1) = 2.e-15 * M_PI; - tol(2) = Geom2dGcc_CurveTool::EpsX(Cu2, Abs(Tolerance)); + tol(2) = Geom2dGcc_CurveTool::EpsX(Cu2, std::abs(Tolerance)); tol(3) = 2.e-15 * M_PI; tol(4) = Tol / 10.; gp_Pnt2d point1 = ElCLib::Value(Param1, C1); gp_Pnt2d point2 = Geom2dGcc_CurveTool::Value(Cu2, Param2); gp_Pnt2d point3 = ElCLib::Value(Param3, OnCirc); Ufirst(4) = (point3.Distance(point2) + point3.Distance(point1)) / 2.; - Geom2dGcc_FunctionTanCuCuOnCu Func(C1, Cu2, OnCirc, Max(Ufirst(4), Tol)); + Geom2dGcc_FunctionTanCuCuOnCu Func(C1, Cu2, OnCirc, std::max(Ufirst(4), Tol)); math_FunctionSetRoot Root(Func, tol); Root.Perform(Func, Ufirst, Umin, Umax); Func.Value(Ufirst, Umin); @@ -546,12 +546,12 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const GccEnt_QualifiedCir ElCLib::D1(Ufirst(1), C1, point1, Tan1); Geom2dGcc_CurveTool::D1(Cu2, Ufirst(2), point2, Tan2); #ifdef OCCT_DEBUG - gp_Vec2d Tan3(-Sin(Ufirst(3)), Cos(Ufirst(3))); + gp_Vec2d Tan3(-std::sin(Ufirst(3)), std::cos(Ufirst(3))); #endif point3 = ElCLib::Value(Ufirst(3), OnCirc); Standard_Real dist1 = point3.Distance(point1); Standard_Real dist2 = point3.Distance(point2); - if (Abs(dist1 - dist2) / 2. <= Tol) + if (std::abs(dist1 - dist2) / 2. <= Tol) { cirsol = gp_Circ2d(gp_Ax2d(point3, dirx), (dist1 + dist2) / 2.); Standard_Real normetan2 = Tan2.Magnitude(); @@ -619,7 +619,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const GccEnt_QualifiedLin throw GccEnt_BadQualifier(); return; } - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); gp_Dir2d dirx(gp_Dir2d::D::X); gp_Lin2d L1 = Qualified1.Qualified(); Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified(); @@ -639,14 +639,14 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const GccEnt_QualifiedLin Ufirst(2) = Param2; Ufirst(3) = Param3; tol(1) = 1.e-15; - tol(2) = Geom2dGcc_CurveTool::EpsX(Cu2, Abs(Tolerance)); + tol(2) = Geom2dGcc_CurveTool::EpsX(Cu2, std::abs(Tolerance)); tol(3) = 2.e-15 * M_PI; tol(4) = Tol / 10.; gp_Pnt2d point1 = ElCLib::Value(Param1, L1); gp_Pnt2d point2 = Geom2dGcc_CurveTool::Value(Cu2, Param2); gp_Pnt2d point3 = ElCLib::Value(Param3, OnCirc); Ufirst(4) = (point3.Distance(point2) + point3.Distance(point1)) / 2.; - Geom2dGcc_FunctionTanCuCuOnCu Func(L1, Cu2, OnCirc, Max(Ufirst(4), Tol)); + Geom2dGcc_FunctionTanCuCuOnCu Func(L1, Cu2, OnCirc, std::max(Ufirst(4), Tol)); math_FunctionSetRoot Root(Func, tol); Root.Perform(Func, Ufirst, Umin, Umax); Func.Value(Ufirst, Umin); @@ -658,12 +658,12 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const GccEnt_QualifiedLin ElCLib::D1(Ufirst(1), L1, point1new, Tan1); Geom2dGcc_CurveTool::D1(Cu2, Ufirst(2), point2new, Tan2); #ifdef OCCT_DEBUG - gp_Vec2d Tan3(-Sin(Ufirst(3)), Cos(Ufirst(3))); + gp_Vec2d Tan3(-std::sin(Ufirst(3)), std::cos(Ufirst(3))); #endif point3 = ElCLib::Value(Ufirst(3), OnCirc); Standard_Real dist1 = point3.Distance(point1new); Standard_Real dist2 = point3.Distance(point2new); - if (Abs(dist1 - dist2) / 2. <= Tol) + if (std::abs(dist1 - dist2) / 2. <= Tol) { cirsol = gp_Circ2d(gp_Ax2d(point3, dirx), (dist1 + dist2) / 2.); Standard_Real normetan2 = Tan2.Magnitude(); @@ -730,7 +730,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const Geom2dGcc_QCurve& Q throw GccEnt_BadQualifier(); return; } - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); gp_Dir2d dirx(gp_Dir2d::D::X); Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified(); Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified(); @@ -749,16 +749,16 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const Geom2dGcc_QCurve& Q Ufirst(1) = Param1; Ufirst(2) = Param2; Ufirst(3) = Param3; - tol(1) = Geom2dGcc_CurveTool::EpsX(Cu1, Abs(Tolerance)); - tol(2) = Geom2dGcc_CurveTool::EpsX(Cu2, Abs(Tolerance)); + tol(1) = Geom2dGcc_CurveTool::EpsX(Cu1, std::abs(Tolerance)); + tol(2) = Geom2dGcc_CurveTool::EpsX(Cu2, std::abs(Tolerance)); tol(3) = 2.e-15 * M_PI; tol(4) = Tol / 10.; gp_Pnt2d point1 = Geom2dGcc_CurveTool::Value(Cu1, Param1); gp_Pnt2d point2 = Geom2dGcc_CurveTool::Value(Cu2, Param2); Standard_Real R1 = OnCirc.Radius(); - gp_Pnt2d point3(OnCirc.Location().XY() + R1 * gp_XY(Cos(Param3), Sin(Param3))); + gp_Pnt2d point3(OnCirc.Location().XY() + R1 * gp_XY(std::cos(Param3), std::sin(Param3))); Ufirst(4) = (point3.Distance(point2) + point3.Distance(point1)) / 2.; - Geom2dGcc_FunctionTanCuCuOnCu Func(Cu1, Cu2, OnCirc, Max(Ufirst(4), Tol)); + Geom2dGcc_FunctionTanCuCuOnCu Func(Cu1, Cu2, OnCirc, std::max(Ufirst(4), Tol)); math_FunctionSetRoot Root(Func, tol); Root.Perform(Func, Ufirst, Umin, Umax); Func.Value(Ufirst, Umin); @@ -770,12 +770,13 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const Geom2dGcc_QCurve& Q Geom2dGcc_CurveTool::D1(Cu1, Ufirst(1), point1, Tan1); Geom2dGcc_CurveTool::D1(Cu2, Ufirst(2), point2, Tan2); #ifdef OCCT_DEBUG - gp_Vec2d Tan3(-Sin(Ufirst(3)), Cos(Ufirst(3))); + gp_Vec2d Tan3(-std::sin(Ufirst(3)), std::cos(Ufirst(3))); #endif - point3 = gp_Pnt2d(OnCirc.Location().XY() + R1 * gp_XY(Cos(Ufirst(3)), Sin(Ufirst(3)))); + point3 = + gp_Pnt2d(OnCirc.Location().XY() + R1 * gp_XY(std::cos(Ufirst(3)), std::sin(Ufirst(3)))); Standard_Real dist1 = point3.Distance(point1); Standard_Real dist2 = point3.Distance(point2); - if (Abs(dist1 - dist2) / 2. <= Tol) + if (std::abs(dist1 - dist2) / 2. <= Tol) { cirsol = gp_Circ2d(gp_Ax2d(point3, dirx), (dist1 + dist2) / 2.); Standard_Real normetan1 = Tan1.Magnitude(); @@ -848,7 +849,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const Geom2dGcc_QCurve& Q throw GccEnt_BadQualifier(); return; } - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); gp_Dir2d dirx(gp_Dir2d::D::X); Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified(); math_Vector Umin(1, 3); @@ -863,13 +864,13 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const Geom2dGcc_QCurve& Q Umax(3) = RealLast(); Ufirst(1) = Param1; Ufirst(2) = Param2; - tol(1) = Geom2dGcc_CurveTool::EpsX(Cu1, Abs(Tolerance)); + tol(1) = Geom2dGcc_CurveTool::EpsX(Cu1, std::abs(Tolerance)); tol(2) = 2.e-15 * M_PI; tol(3) = Tol / 10.; gp_Pnt2d point1 = Geom2dGcc_CurveTool::Value(Cu1, Param1); gp_Pnt2d point3 = ElCLib::Value(Param2, OnCirc); Ufirst(3) = (point3.Distance(Point2) + point3.Distance(point1)) / 2.; - Geom2dGcc_FunctionTanCuCuOnCu Func(Cu1, Point2, OnCirc, Max(Ufirst(3), Tol)); + Geom2dGcc_FunctionTanCuCuOnCu Func(Cu1, Point2, OnCirc, std::max(Ufirst(3), Tol)); math_FunctionSetRoot Root(Func, tol); Root.Perform(Func, Ufirst, Umin, Umax); Func.Value(Ufirst, Umin); @@ -882,7 +883,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const Geom2dGcc_QCurve& Q ElCLib::D1(Ufirst(2), OnCirc, point3new, Tan3); Standard_Real dist1 = point3new.Distance(point1new); Standard_Real dist2 = point3new.Distance(Point2); - if (Abs(dist1 - dist2) / 2. <= Tol) + if (std::abs(dist1 - dist2) / 2. <= Tol) { cirsol = gp_Circ2d(gp_Ax2d(point3new, dirx), (dist1 + dist2) / 2.); Standard_Real normetan1 = Tan1.Magnitude(); @@ -933,7 +934,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const Geom2dGcc_QCurve& parcen3 = 0.; WellDone = Standard_False; - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); qualifier1 = GccEnt_noqualifier; qualifier2 = GccEnt_noqualifier; if (!(Qualified1.IsEnclosed() || Qualified1.IsEnclosing() || Qualified1.IsOutside() @@ -962,15 +963,15 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const Geom2dGcc_QCurve& Ufirst(1) = Param1; Ufirst(2) = Param2; Ufirst(3) = Param3; - tol(1) = Geom2dGcc_CurveTool::EpsX(Cu1, Abs(Tolerance)); - tol(2) = Geom2dGcc_CurveTool::EpsX(Cu2, Abs(Tolerance)); - tol(3) = Geom2dGcc_CurveTool::EpsX(OnCurv, Abs(Tolerance)); + tol(1) = Geom2dGcc_CurveTool::EpsX(Cu1, std::abs(Tolerance)); + tol(2) = Geom2dGcc_CurveTool::EpsX(Cu2, std::abs(Tolerance)); + tol(3) = Geom2dGcc_CurveTool::EpsX(OnCurv, std::abs(Tolerance)); tol(4) = Tol / 10.; gp_Pnt2d point1 = Geom2dGcc_CurveTool::Value(Cu1, Param1); gp_Pnt2d point2 = Geom2dGcc_CurveTool::Value(Cu2, Param2); gp_Pnt2d point3 = Geom2dGcc_CurveTool::Value(OnCurv, Param3); Ufirst(4) = (point3.Distance(point2) + point3.Distance(point1)) / 2.; - Geom2dGcc_FunctionTanCuCuOnCu Func(Cu1, Cu2, OnCurv, Max(Ufirst(4), Tol)); + Geom2dGcc_FunctionTanCuCuOnCu Func(Cu1, Cu2, OnCurv, std::max(Ufirst(4), Tol)); math_FunctionSetRoot Root(Func, tol); Root.Perform(Func, Ufirst, Umin, Umax); Func.Value(Ufirst, Umin); @@ -983,7 +984,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const Geom2dGcc_QCurve& Geom2dGcc_CurveTool::D1(OnCurv, Ufirst(3), point3, Tan3); Standard_Real dist1 = point3.Distance(point1); Standard_Real dist2 = point3.Distance(point2); - if (Abs(dist1 - dist2) / 2. <= Tol) + if (std::abs(dist1 - dist2) / 2. <= Tol) { cirsol = gp_Circ2d(gp_Ax2d(point3, dirx), (dist1 + dist2) / 2.); Standard_Real normetan1 = Tan1.Magnitude(); @@ -1060,7 +1061,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const GccEnt_QualifiedCir throw GccEnt_BadQualifier(); return; } - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); gp_Circ2d C1 = Qualified1.Qualified(); Standard_Real R1 = C1.Radius(); Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified(); @@ -1080,14 +1081,14 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const GccEnt_QualifiedCir Ufirst(2) = Param2; Ufirst(3) = ParamOn; tol(1) = 2.e-15 * M_PI; - tol(2) = Geom2dGcc_CurveTool::EpsX(Cu2, Abs(Tolerance)); - tol(3) = Geom2dGcc_CurveTool::EpsX(OnCurv, Abs(Tolerance)); + tol(2) = Geom2dGcc_CurveTool::EpsX(Cu2, std::abs(Tolerance)); + tol(3) = Geom2dGcc_CurveTool::EpsX(OnCurv, std::abs(Tolerance)); tol(4) = Tol / 10.; gp_Pnt2d point1 = ElCLib::Value(Param1, C1); gp_Pnt2d point2 = Geom2dGcc_CurveTool::Value(Cu2, Param2); gp_Pnt2d point3 = Geom2dGcc_CurveTool::Value(OnCurv, ParamOn); Ufirst(4) = (point3.Distance(point2) + point3.Distance(point1)) / 2.; - Geom2dGcc_FunctionTanCuCuOnCu Func(C1, Cu2, OnCurv, Max(Ufirst(4), Tol)); + Geom2dGcc_FunctionTanCuCuOnCu Func(C1, Cu2, OnCurv, std::max(Ufirst(4), Tol)); math_FunctionSetRoot Root(Func, tol); Root.Perform(Func, Ufirst, Umin, Umax); Func.Value(Ufirst, Umin); @@ -1100,7 +1101,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const GccEnt_QualifiedCir ElCLib::D1(Ufirst(1), C1, point1, Tan1); Standard_Real dist1 = point3.Distance(point1); Standard_Real dist2 = point3.Distance(point2); - if (Abs(dist1 - dist2) / 2. <= Tol) + if (std::abs(dist1 - dist2) / 2. <= Tol) { gp_Dir2d dirx(gp_Dir2d::D::X); cirsol = gp_Circ2d(gp_Ax2d(point3, dirx), (dist1 + dist2) / 2.); @@ -1169,7 +1170,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const GccEnt_QualifiedLin throw GccEnt_BadQualifier(); return; } - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); gp_Dir2d dirx(gp_Dir2d::D::X); gp_Lin2d L1 = Qualified1.Qualified(); Geom2dAdaptor_Curve Cu2 = Qualified2.Qualified(); @@ -1189,14 +1190,14 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const GccEnt_QualifiedLin Ufirst(2) = Param2; Ufirst(3) = ParamOn; tol(1) = 1.e-15; - tol(2) = Geom2dGcc_CurveTool::EpsX(Cu2, Abs(Tolerance)); - tol(3) = Geom2dGcc_CurveTool::EpsX(OnCurv, Abs(Tolerance)); + tol(2) = Geom2dGcc_CurveTool::EpsX(Cu2, std::abs(Tolerance)); + tol(3) = Geom2dGcc_CurveTool::EpsX(OnCurv, std::abs(Tolerance)); tol(4) = Tol / 10.; gp_Pnt2d point1 = ElCLib::Value(Param1, L1); gp_Pnt2d point2 = Geom2dGcc_CurveTool::Value(Cu2, Param2); gp_Pnt2d point3 = Geom2dGcc_CurveTool::Value(OnCurv, ParamOn); Ufirst(4) = (point3.Distance(point2) + point3.Distance(point1)) / 2.; - Geom2dGcc_FunctionTanCuCuOnCu Func(L1, Cu2, OnCurv, Max(Ufirst(4), Tol)); + Geom2dGcc_FunctionTanCuCuOnCu Func(L1, Cu2, OnCurv, std::max(Ufirst(4), Tol)); math_FunctionSetRoot Root(Func, tol); Root.Perform(Func, Ufirst, Umin, Umax); Func.Value(Ufirst, Umin); @@ -1209,7 +1210,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const GccEnt_QualifiedLin Geom2dGcc_CurveTool::D1(OnCurv, Ufirst(3), point3, Tan3); Standard_Real dist1 = point3.Distance(point1); Standard_Real dist2 = point3.Distance(point2); - if (Abs(dist1 - dist2) / 2. <= Tol) + if (std::abs(dist1 - dist2) / 2. <= Tol) { cirsol = gp_Circ2d(gp_Ax2d(point3, dirx), (dist1 + dist2) / 2.); Standard_Real normetan2 = Tan2.Magnitude(); @@ -1273,7 +1274,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const Geom2dGcc_QCurve& throw GccEnt_BadQualifier(); return; } - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); gp_Dir2d dirx(gp_Dir2d::D::X); Geom2dAdaptor_Curve Cu1 = Qualified1.Qualified(); math_Vector Umin(1, 3); @@ -1288,13 +1289,13 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const Geom2dGcc_QCurve& Umax(3) = Geom2dGcc_CurveTool::LastParameter(OnCurv); Ufirst(1) = Param1; Ufirst(2) = ParamOn; - tol(1) = Geom2dGcc_CurveTool::EpsX(Cu1, Abs(Tolerance)); - tol(2) = Geom2dGcc_CurveTool::EpsX(OnCurv, Abs(Tolerance)); + tol(1) = Geom2dGcc_CurveTool::EpsX(Cu1, std::abs(Tolerance)); + tol(2) = Geom2dGcc_CurveTool::EpsX(OnCurv, std::abs(Tolerance)); tol(3) = Tol / 10.; gp_Pnt2d point1 = Geom2dGcc_CurveTool::Value(Cu1, Param1); gp_Pnt2d point3 = Geom2dGcc_CurveTool::Value(OnCurv, ParamOn); Ufirst(3) = (point3.Distance(Point2) + point3.Distance(point1)) / 2.; - Geom2dGcc_FunctionTanCuCuOnCu Func(Cu1, Point2, OnCurv, Max(Ufirst(3), Tol)); + Geom2dGcc_FunctionTanCuCuOnCu Func(Cu1, Point2, OnCurv, std::max(Ufirst(3), Tol)); math_FunctionSetRoot Root(Func, tol); Root.Perform(Func, Ufirst, Umin, Umax); Func.Value(Ufirst, Umin); @@ -1307,7 +1308,7 @@ Geom2dGcc_Circ2d2TanOnIter::Geom2dGcc_Circ2d2TanOnIter(const Geom2dGcc_QCurve& Geom2dGcc_CurveTool::D1(OnCurv, Ufirst(3), point3, Tan3); Standard_Real dist1 = point3.Distance(point1); Standard_Real dist2 = point3.Distance(Point2); - if (Abs(dist1 - dist2) / 2. <= Tol) + if (std::abs(dist1 - dist2) / 2. <= Tol) { cirsol = gp_Circ2d(gp_Ax2d(point3, dirx), (dist1 + dist2) / 2.); Standard_Real normetan1 = Tan1.Magnitude(); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanRadGeo.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanRadGeo.cxx index b87d684a8a..99ad71ddf0 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanRadGeo.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d2TanRadGeo.cxx @@ -75,7 +75,7 @@ Geom2dGcc_Circ2d2TanRadGeo::Geom2dGcc_Circ2d2TanRadGeo(const GccEnt_QualifiedLin // Traitement. + //======================================================================== - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; Standard_Real firstparam; @@ -198,8 +198,8 @@ Geom2dGcc_Circ2d2TanRadGeo::Geom2dGcc_Circ2d2TanRadGeo(const GccEnt_QualifiedLin Handle(Geom2dAdaptor_Curve) HCu2 = new Geom2dAdaptor_Curve(Cu2); // Adaptor2d_OffsetCurve C2(HCu2,cote2(jcote2)); Adaptor2d_OffsetCurve C2(HCu2, -cote2(jcote2)); - firstparam = Max(C2.FirstParameter(), thefirst); - lastparam = Min(C2.LastParameter(), thelast); + firstparam = std::max(C2.FirstParameter(), thefirst); + lastparam = std::min(C2.LastParameter(), thelast); IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol, @@ -289,7 +289,7 @@ Geom2dGcc_Circ2d2TanRadGeo::Geom2dGcc_Circ2d2TanRadGeo(const GccEnt_QualifiedCir // Traitement. + //======================================================================== - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; Standard_Real firstparam; @@ -413,8 +413,8 @@ Geom2dGcc_Circ2d2TanRadGeo::Geom2dGcc_Circ2d2TanRadGeo(const GccEnt_QualifiedCir Handle(Geom2dAdaptor_Curve) HCu2 = new Geom2dAdaptor_Curve(Cu2); // Adaptor2d_OffsetCurve C2(HCu2,cote2(jcote2)); Adaptor2d_OffsetCurve C2(HCu2, -cote2(jcote2)); - firstparam = Max(C2.FirstParameter(), thefirst); - lastparam = Min(C2.LastParameter(), thelast); + firstparam = std::max(C2.FirstParameter(), thefirst); + lastparam = std::min(C2.LastParameter(), thelast); IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol, @@ -443,11 +443,11 @@ Geom2dGcc_Circ2d2TanRadGeo::Geom2dGcc_Circ2d2TanRadGeo(const GccEnt_QualifiedCir { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius - R1) < Tol) + else if (std::abs(distcc1 + Radius - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius) < Tol) + else if (std::abs(distcc1 - R1 - Radius) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -514,7 +514,7 @@ Geom2dGcc_Circ2d2TanRadGeo::Geom2dGcc_Circ2d2TanRadGeo(const Geom2dGcc_QCurve& Q // Traitement. + //======================================================================== - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; Standard_Real firstparam; @@ -570,8 +570,8 @@ Geom2dGcc_Circ2d2TanRadGeo::Geom2dGcc_Circ2d2TanRadGeo(const Geom2dGcc_QCurve& Q Handle(Geom2dAdaptor_Curve) HCu1 = new Geom2dAdaptor_Curve(Cu1); // Adaptor2d_OffsetCurve Cu2(HCu1,cote1(jcote1)); Adaptor2d_OffsetCurve Cu2(HCu1, -cote1(jcote1)); - firstparam = Max(Cu2.FirstParameter(), thefirst); - lastparam = Min(Cu2.LastParameter(), thelast); + firstparam = std::max(Cu2.FirstParameter(), thefirst); + lastparam = std::min(Cu2.LastParameter(), thelast); IntRes2d_Domain D2(Cu2.Value(firstparam), firstparam, Tol, @@ -674,7 +674,7 @@ static void PrecRoot(const Adaptor2d_OffsetCurve& theC1, theC1.D2(aU, aPu, aD1u, aD2u); theC2.D2(aV, aPv, aD1v, aD2v); - const Standard_Real aCrProd = Abs(aD1u.Crossed(aD1v)); + const Standard_Real aCrProd = std::abs(aD1u.Crossed(aD1v)); if (aCrProd * aCrProd > 1.0e-6 * aD1u.SquareMagnitude() * aD1v.SquareMagnitude()) { // Curves are not tangent. Therefore, we consider that @@ -750,9 +750,9 @@ static void PrecRoot(const Adaptor2d_OffsetCurve& theC1, aStepU = -(aS1 * aDS2v - aS2 * aDS1v) / aDet; aStepV = -(aS2 * aDS1u - aS1 * aDS2u) / aDet; - if (Abs(aStepU) < Epsilon(Abs(aU))) + if (std::abs(aStepU) < Epsilon(std::abs(aU))) { - if (Abs(aStepV) < Epsilon(Abs(aV))) + if (std::abs(aStepV) < Epsilon(std::abs(aV))) { break; } @@ -807,7 +807,7 @@ Geom2dGcc_Circ2d2TanRadGeo::Geom2dGcc_Circ2d2TanRadGeo(const Geom2dGcc_QCurve& Q // Traitement. + //======================================================================== - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); #ifdef OCCT_DEBUG const Standard_Real thefirst = -100000.; const Standard_Real thelast = 100000.; @@ -920,8 +920,8 @@ Geom2dGcc_Circ2d2TanRadGeo::Geom2dGcc_Circ2d2TanRadGeo(const Geom2dGcc_QCurve& Q // Adaptor2d_OffsetCurve C1(HCu1,cote1(jcote1)); Adaptor2d_OffsetCurve C1(HCu1, -cote1(jcote1)); #ifdef OCCT_DEBUG - Standard_Real firstparam = Max(C1.FirstParameter(), thefirst); - Standard_Real lastparam = Min(C1.LastParameter(), thelast); + Standard_Real firstparam = std::max(C1.FirstParameter(), thefirst); + Standard_Real lastparam = std::min(C1.LastParameter(), thelast); IntRes2d_Domain D2C1(C1.Value(firstparam), firstparam, Tol, @@ -935,8 +935,8 @@ Geom2dGcc_Circ2d2TanRadGeo::Geom2dGcc_Circ2d2TanRadGeo(const Geom2dGcc_QCurve& Q // Adaptor2d_OffsetCurve C2(HCu2,cote2(jcote2)); Adaptor2d_OffsetCurve C2(HCu2, -cote2(jcote2)); #ifdef OCCT_DEBUG - firstparam = Max(C2.FirstParameter(), thefirst); - lastparam = Min(C2.LastParameter(), thelast); + firstparam = std::max(C2.FirstParameter(), thefirst); + lastparam = std::min(C2.LastParameter(), thelast); IntRes2d_Domain D2C2(C2.Value(firstparam), firstparam, Tol, @@ -973,8 +973,8 @@ Geom2dGcc_Circ2d2TanRadGeo::Geom2dGcc_Circ2d2TanRadGeo(const Geom2dGcc_QCurve& Q Standard_Real aDist1221 = P12.SquareDistance(P21); Standard_Real aDist2122 = P21.SquareDistance(P22); - if ((Min(aDist1112, aDist1122) <= aSQApproxTol) - && (Min(aDist1221, aDist2122) <= aSQApproxTol)) + if ((std::min(aDist1112, aDist1122) <= aSQApproxTol) + && (std::min(aDist1221, aDist2122) <= aSQApproxTol)) { PrecRoot(C1, C2, aU0, aV0, aU0, aV0); } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d3TanIter.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d3TanIter.cxx index a63df35da5..9e723ebee8 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d3TanIter.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2d3TanIter.cxx @@ -60,7 +60,7 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const Geom2dGcc_QCurve& Quali pararg2 = 0.; pararg3 = 0.; - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; qualifier1 = GccEnt_noqualifier; qualifier2 = GccEnt_noqualifier; @@ -92,9 +92,9 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const Geom2dGcc_QCurve& Quali Ufirst(1) = Param1; Ufirst(2) = Param2; Ufirst(3) = Param3; - tol(1) = Geom2dGcc_CurveTool::EpsX(Cu1, Abs(Tolerance)); - tol(2) = Geom2dGcc_CurveTool::EpsX(Cu2, Abs(Tolerance)); - tol(3) = Geom2dGcc_CurveTool::EpsX(Cu3, Abs(Tolerance)); + tol(1) = Geom2dGcc_CurveTool::EpsX(Cu1, std::abs(Tolerance)); + tol(2) = Geom2dGcc_CurveTool::EpsX(Cu2, std::abs(Tolerance)); + tol(3) = Geom2dGcc_CurveTool::EpsX(Cu3, std::abs(Tolerance)); math_FunctionSetRoot Root(Func, tol); Root.Perform(Func, Ufirst, Umin, Umax); if (Root.IsDone()) @@ -203,7 +203,7 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const GccEnt_QualifiedCirc& Q pararg2 = 0.; pararg3 = 0.; - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; qualifier1 = GccEnt_noqualifier; qualifier2 = GccEnt_noqualifier; @@ -236,8 +236,8 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const GccEnt_QualifiedCirc& Q Ufirst(2) = Param2; Ufirst(3) = Param3; tol(1) = 2.e-15 * M_PI; - tol(2) = Geom2dGcc_CurveTool::EpsX(Cu2, Abs(Tolerance)); - tol(3) = Geom2dGcc_CurveTool::EpsX(Cu3, Abs(Tolerance)); + tol(2) = Geom2dGcc_CurveTool::EpsX(Cu2, std::abs(Tolerance)); + tol(3) = Geom2dGcc_CurveTool::EpsX(Cu3, std::abs(Tolerance)); math_FunctionSetRoot Root(Func, tol); Root.Perform(Func, Ufirst, Umin, Umax); if (Root.IsDone()) @@ -246,8 +246,8 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const GccEnt_QualifiedCirc& Q Func.Value(Ufirst, Umin); gp_Pnt2d centre1(C1.Location()); Standard_Real R1 = C1.Radius(); - gp_Pnt2d point1(centre1.XY() + R1 * gp_XY(Cos(Ufirst(1)), Sin(Ufirst(1)))); - gp_Vec2d Tan1(gp_XY(-Sin(Ufirst(1)), Cos(Ufirst(1)))); + gp_Pnt2d point1(centre1.XY() + R1 * gp_XY(std::cos(Ufirst(1)), std::sin(Ufirst(1)))); + gp_Vec2d Tan1(gp_XY(-std::sin(Ufirst(1)), std::cos(Ufirst(1)))); gp_Pnt2d point2, point3; // gp_Vec2d Tan2,Tan3,Nor2,Nor3; gp_Vec2d Tan2, Tan3; @@ -351,7 +351,7 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const GccEnt_QualifiedCirc& Q pararg2 = 0.; pararg3 = 0.; - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; qualifier1 = GccEnt_noqualifier; qualifier2 = GccEnt_noqualifier; @@ -385,7 +385,7 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const GccEnt_QualifiedCirc& Q Ufirst(3) = Param3; tol(1) = 2.e-15 * M_PI; tol(2) = 2.e-15 * M_PI; - tol(3) = Geom2dGcc_CurveTool::EpsX(Cu3, Abs(Tolerance)); + tol(3) = Geom2dGcc_CurveTool::EpsX(Cu3, std::abs(Tolerance)); math_FunctionSetRoot Root(Func, tol); Root.Perform(Func, Ufirst, Umin, Umax); if (Root.IsDone()) @@ -394,12 +394,12 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const GccEnt_QualifiedCirc& Q Func.Value(Ufirst, Umin); gp_Pnt2d centre1(C1.Location()); Standard_Real R1 = C1.Radius(); - gp_Pnt2d point1(centre1.XY() + R1 * gp_XY(Cos(Ufirst(1)), Sin(Ufirst(1)))); - gp_Vec2d Tan1(gp_XY(-Sin(Ufirst(1)), Cos(Ufirst(1)))); + gp_Pnt2d point1(centre1.XY() + R1 * gp_XY(std::cos(Ufirst(1)), std::sin(Ufirst(1)))); + gp_Vec2d Tan1(gp_XY(-std::sin(Ufirst(1)), std::cos(Ufirst(1)))); gp_Pnt2d centre2(C2.Location()); Standard_Real R2 = C2.Radius(); - gp_Pnt2d point2(centre2.XY() + R2 * gp_XY(Cos(Ufirst(2)), Sin(Ufirst(2)))); - gp_Vec2d Tan2(gp_XY(-Sin(Ufirst(2)), Cos(Ufirst(2)))); + gp_Pnt2d point2(centre2.XY() + R2 * gp_XY(std::cos(Ufirst(2)), std::sin(Ufirst(2)))); + gp_Vec2d Tan2(gp_XY(-std::sin(Ufirst(2)), std::cos(Ufirst(2)))); gp_Pnt2d point3; gp_Vec2d Tan3; Geom2dGcc_CurveTool::D1(Cu3, Ufirst(3), point3, Tan3); @@ -502,7 +502,7 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const GccEnt_QualifiedLin& Qu pararg2 = 0.; pararg3 = 0.; - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; qualifier1 = GccEnt_noqualifier; qualifier2 = GccEnt_noqualifier; @@ -534,8 +534,8 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const GccEnt_QualifiedLin& Qu Ufirst(2) = Param2; Ufirst(3) = Param3; tol(1) = 1.e-15; - tol(2) = Geom2dGcc_CurveTool::EpsX(Cu2, Abs(Tolerance)); - tol(3) = Geom2dGcc_CurveTool::EpsX(Cu3, Abs(Tolerance)); + tol(2) = Geom2dGcc_CurveTool::EpsX(Cu2, std::abs(Tolerance)); + tol(3) = Geom2dGcc_CurveTool::EpsX(Cu3, std::abs(Tolerance)); math_FunctionSetRoot Root(Func, tol); Root.Perform(Func, Ufirst, Umin, Umax); if (Root.IsDone()) @@ -652,7 +652,7 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const GccEnt_QualifiedLin& Qu pararg2 = 0.; pararg3 = 0.; - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; qualifier1 = GccEnt_noqualifier; qualifier2 = GccEnt_noqualifier; @@ -684,7 +684,7 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const GccEnt_QualifiedLin& Qu Ufirst(3) = Param3; tol(1) = 1.e-15; tol(2) = 1.e-15; - tol(3) = Geom2dGcc_CurveTool::EpsX(Cu3, Abs(Tolerance)); + tol(3) = Geom2dGcc_CurveTool::EpsX(Cu3, std::abs(Tolerance)); math_FunctionSetRoot Root(Func, tol); Root.Perform(Func, Ufirst, Umin, Umax); if (Root.IsDone()) @@ -793,7 +793,7 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const Geom2dGcc_QCurve& Quali pararg2 = 0.; pararg3 = 0.; - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; qualifier1 = GccEnt_noqualifier; qualifier2 = GccEnt_noqualifier; @@ -824,8 +824,8 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const Geom2dGcc_QCurve& Quali Ufirst(2) = Param1; Ufirst(3) = Param2; tol(1) = 2.e-15 * M_PI; - tol(2) = Geom2dGcc_CurveTool::EpsX(Cu1, Abs(Tolerance)); - tol(3) = Geom2dGcc_CurveTool::EpsX(Cu2, Abs(Tolerance)); + tol(2) = Geom2dGcc_CurveTool::EpsX(Cu1, std::abs(Tolerance)); + tol(3) = Geom2dGcc_CurveTool::EpsX(Cu2, std::abs(Tolerance)); math_FunctionSetRoot Root(Func, tol); Root.Perform(Func, Ufirst, Umin, Umax); if (Root.IsDone()) @@ -842,7 +842,7 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const Geom2dGcc_QCurve& Quali { cirsol = circ.ThisSolution(1); gp_Pnt2d centre(cirsol.Location()); - gp_Vec2d Tan3(-Sin(Ufirst(1)), Cos(Ufirst(1))); + gp_Vec2d Tan3(-std::sin(Ufirst(1)), std::cos(Ufirst(1))); Standard_Real normetan1 = Tan1.Magnitude(); Standard_Real normetan2 = Tan2.Magnitude(); Standard_Real normetan3 = Tan3.Magnitude(); @@ -926,7 +926,7 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const Geom2dGcc_QCurve& Quali pararg2 = 0.; pararg3 = 0.; - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; qualifier1 = GccEnt_noqualifier; qualifier2 = GccEnt_noqualifier; @@ -956,7 +956,7 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const Geom2dGcc_QCurve& Quali Ufirst(3) = Param1; tol(1) = 2.e-15 * M_PI; tol(2) = 2.e-15 * M_PI; - tol(3) = Geom2dGcc_CurveTool::EpsX(Cu1, Abs(Tolerance)); + tol(3) = Geom2dGcc_CurveTool::EpsX(Cu1, std::abs(Tolerance)); math_FunctionSetRoot Root(Func, tol); Root.Perform(Func, Ufirst, Umin, Umax); if (Root.IsDone()) @@ -972,8 +972,8 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const Geom2dGcc_QCurve& Quali { cirsol = circ.ThisSolution(1); gp_Pnt2d centre(cirsol.Location()); - gp_Vec2d Tan2(-Sin(Ufirst(2)), Cos(Ufirst(2))); - gp_Vec2d Tan1(-Sin(Ufirst(1)), Cos(Ufirst(1))); + gp_Vec2d Tan2(-std::sin(Ufirst(2)), std::cos(Ufirst(2))); + gp_Vec2d Tan1(-std::sin(Ufirst(1)), std::cos(Ufirst(1))); Standard_Real normetan1 = Tan1.Magnitude(); Standard_Real normetan2 = Tan2.Magnitude(); Standard_Real normetan3 = Tan3.Magnitude(); @@ -1052,7 +1052,7 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const GccEnt_QualifiedLin& Qu pararg2 = 0.; pararg3 = 0.; - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; qualifier1 = GccEnt_noqualifier; qualifier2 = GccEnt_noqualifier; @@ -1083,7 +1083,7 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const GccEnt_QualifiedLin& Qu Ufirst(1) = M_PI; tol(1) = 2.e-15; tol(2) = 1.e-15; - tol(3) = Geom2dGcc_CurveTool::EpsX(Cu2, Abs(Tolerance)); + tol(3) = Geom2dGcc_CurveTool::EpsX(Cu2, std::abs(Tolerance)); math_FunctionSetRoot Root(Func, tol); Root.Perform(Func, Ufirst, Umin, Umax); if (Root.IsDone()) @@ -1102,7 +1102,7 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const GccEnt_QualifiedLin& Qu gp_Pnt2d centre(cirsol.Location()); Standard_Real pscal = centre.XY().Dot(gp_XY(-L1.Direction().Y(), L1.Direction().X())); gp_Vec2d Tan1(L1.Direction().XY()); - gp_Vec2d Tan3(-Sin(Ufirst(1)), Cos(Ufirst(1))); + gp_Vec2d Tan3(-std::sin(Ufirst(1)), std::cos(Ufirst(1))); Standard_Real normetan1 = Tan1.Magnitude(); Standard_Real normetan2 = Tan2.Magnitude(); Standard_Real normetan3 = Tan3.Magnitude(); @@ -1187,7 +1187,7 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const GccEnt_QualifiedCirc& Q pararg2 = 0.; pararg3 = 0.; - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; qualifier1 = GccEnt_noqualifier; qualifier2 = GccEnt_noqualifier; @@ -1220,7 +1220,7 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const GccEnt_QualifiedCirc& Q Ufirst(3) = Param3; tol(1) = 2.e-15 * M_PI; tol(2) = 1.e-15; - tol(3) = Geom2dGcc_CurveTool::EpsX(Cu3, Abs(Tolerance)); + tol(3) = Geom2dGcc_CurveTool::EpsX(Cu3, std::abs(Tolerance)); math_FunctionSetRoot Root(Func, tol); Root.Perform(Func, Ufirst, Umin, Umax); if (Root.IsDone()) @@ -1229,7 +1229,7 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const GccEnt_QualifiedCirc& Q Root.Root(Ufirst); gp_Pnt2d centre1(C1.Location()); Standard_Real R1 = C1.Radius(); - gp_Pnt2d point1(centre1.XY() + R1 * gp_XY(Cos(Ufirst(1)), Sin(Ufirst(1)))); + gp_Pnt2d point1(centre1.XY() + R1 * gp_XY(std::cos(Ufirst(1)), std::sin(Ufirst(1)))); gp_Pnt2d centre2(L2.Location()); gp_Pnt2d point2(centre2.XY() + Ufirst(2) * L2.Direction().XY()); gp_Pnt2d point3; @@ -1240,7 +1240,7 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const GccEnt_QualifiedCirc& Q { cirsol = circ.ThisSolution(1); gp_Pnt2d centre(cirsol.Location()); - gp_Vec2d Tan1(-Sin(Ufirst(1)), Cos(Ufirst(1))); + gp_Vec2d Tan1(-std::sin(Ufirst(1)), std::cos(Ufirst(1))); gp_Vec2d Tan2(L2.Direction().XY()); Standard_Real normetan1 = Tan1.Magnitude(); Standard_Real normetan2 = Tan2.Magnitude(); @@ -1333,7 +1333,7 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const GccEnt_QualifiedCirc& Q pararg2 = 0.; pararg3 = 0.; - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; qualifier1 = GccEnt_noqualifier; qualifier2 = GccEnt_noqualifier; @@ -1365,7 +1365,7 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const GccEnt_QualifiedCirc& Q Ufirst(3) = Param2; tol(1) = 2.e-15 * M_PI; tol(2) = 2.e-15 * M_PI; - tol(3) = Geom2dGcc_CurveTool::EpsX(Cu2, Abs(Tolerance)); + tol(3) = Geom2dGcc_CurveTool::EpsX(Cu2, std::abs(Tolerance)); math_FunctionSetRoot Root(Func, tol); Root.Perform(Func, Ufirst, Umin, Umax); if (Root.IsDone()) @@ -1374,7 +1374,7 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const GccEnt_QualifiedCirc& Q Func.Value(Ufirst, Umin); gp_Pnt2d centre1(C1.Location()); Standard_Real R1 = C1.Radius(); - gp_Pnt2d point1(centre1.XY() + R1 * gp_XY(Cos(Ufirst(1)), Sin(Ufirst(1)))); + gp_Pnt2d point1(centre1.XY() + R1 * gp_XY(std::cos(Ufirst(1)), std::sin(Ufirst(1)))); gp_Pnt2d point2; // gp_Vec2d Tan2,Nor2; gp_Vec2d Tan2; @@ -1384,8 +1384,8 @@ Geom2dGcc_Circ2d3TanIter::Geom2dGcc_Circ2d3TanIter(const GccEnt_QualifiedCirc& Q { cirsol = circ.ThisSolution(1); gp_Pnt2d centre(cirsol.Location()); - gp_Vec2d Tan1(-Sin(Ufirst(1)), Cos(Ufirst(1))); - gp_Vec2d Tan3(-Sin(Ufirst(3)), Cos(Ufirst(3))); + gp_Vec2d Tan1(-std::sin(Ufirst(1)), std::cos(Ufirst(1))); + gp_Vec2d Tan3(-std::sin(Ufirst(3)), std::cos(Ufirst(3))); Standard_Real normetan2 = Tan2.Magnitude(); gp_Vec2d Vec1(point1, centre); gp_Vec2d Vec2(point2, centre); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2dTanCenGeo.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2dTanCenGeo.cxx index 7c17bea9cf..4c43d9e5ea 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2dTanCenGeo.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2dTanCenGeo.cxx @@ -48,7 +48,7 @@ Geom2dGcc_Circ2dTanCenGeo::Geom2dGcc_Circ2dTanCenGeo(const Geom2dGcc_QCurve& Qua par1sol(1, 2), pararg1(1, 2) { - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); TColgp_Array1OfPnt2d pTan(1, 2); TColStd_Array1OfInteger Index(1, 2); TColStd_Array1OfReal theDist2(1, 2); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2dTanOnRadGeo.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2dTanOnRadGeo.cxx index b842e36b0d..aa5b11ae61 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2dTanOnRadGeo.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Circ2dTanOnRadGeo.cxx @@ -84,7 +84,7 @@ Geom2dGcc_Circ2dTanOnRadGeo::Geom2dGcc_Circ2dTanOnRadGeo(const Geom2dGcc_QCurve& //========================================================================= gp_Dir2d dirx(gp_Dir2d::D::X); - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); Standard_Real thefirst = -100000.; Standard_Real thelast = 100000.; Standard_Real firstparam; @@ -133,8 +133,8 @@ Geom2dGcc_Circ2dTanOnRadGeo::Geom2dGcc_Circ2dTanOnRadGeo(const Geom2dGcc_QCurve& Handle(Geom2dAdaptor_Curve) HCu1 = new Geom2dAdaptor_Curve(Cu1); // Adaptor2d_OffsetCurve C2(HCu1,Coef(jcote1)); Adaptor2d_OffsetCurve C2(HCu1, -Coef(jcote1)); - firstparam = Max(C2.FirstParameter(), thefirst); - lastparam = Min(C2.LastParameter(), thelast); + firstparam = std::max(C2.FirstParameter(), thefirst); + lastparam = std::min(C2.LastParameter(), thelast); IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol, @@ -213,7 +213,7 @@ Geom2dGcc_Circ2dTanOnRadGeo::Geom2dGcc_Circ2dTanOnRadGeo(const Geom2dGcc_QCurve& Standard_Real thelast = 100000.; Standard_Real firstparam; Standard_Real lastparam; - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); Standard_Integer nbrcote1 = 0; WellDone = Standard_False; NbrSol = 0; @@ -264,8 +264,8 @@ Geom2dGcc_Circ2dTanOnRadGeo::Geom2dGcc_Circ2dTanOnRadGeo(const Geom2dGcc_QCurve& Handle(Geom2dAdaptor_Curve) HCu1 = new Geom2dAdaptor_Curve(Cu1); // Adaptor2d_OffsetCurve C2(HCu1,cote1(jcote1)); Adaptor2d_OffsetCurve C2(HCu1, -cote1(jcote1)); - firstparam = Max(C2.FirstParameter(), thefirst); - lastparam = Min(C2.LastParameter(), thelast); + firstparam = std::max(C2.FirstParameter(), thefirst); + lastparam = std::min(C2.LastParameter(), thelast); IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol, @@ -344,7 +344,7 @@ Geom2dGcc_Circ2dTanOnRadGeo::Geom2dGcc_Circ2dTanOnRadGeo(const GccEnt_QualifiedC Standard_Real thelast = 100000.; Standard_Real firstparam; Standard_Real lastparam; - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); Standard_Integer nbrcote1 = 0; WellDone = Standard_False; NbrSol = 0; @@ -395,8 +395,8 @@ Geom2dGcc_Circ2dTanOnRadGeo::Geom2dGcc_Circ2dTanOnRadGeo(const GccEnt_QualifiedC 2. * M_PI, Tol); D1.SetEquivalentParameters(0., 2. * M_PI); - firstparam = Max(Geom2dGcc_CurveTool::FirstParameter(OnCurv), thefirst); - lastparam = Min(Geom2dGcc_CurveTool::LastParameter(OnCurv), thelast); + firstparam = std::max(Geom2dGcc_CurveTool::FirstParameter(OnCurv), thefirst); + lastparam = std::min(Geom2dGcc_CurveTool::LastParameter(OnCurv), thelast); IntRes2d_Domain D2(Geom2dGcc_CurveTool::Value(OnCurv, firstparam), firstparam, Tol, @@ -419,11 +419,11 @@ Geom2dGcc_Circ2dTanOnRadGeo::Geom2dGcc_Circ2dTanOnRadGeo(const GccEnt_QualifiedC { qualifier1(NbrSol) = Qualified1.Qualifier(); } - else if (Abs(distcc1 + Radius - R1) < Tol) + else if (std::abs(distcc1 + Radius - R1) < Tol) { qualifier1(NbrSol) = GccEnt_enclosed; } - else if (Abs(distcc1 - R1 - Radius) < Tol) + else if (std::abs(distcc1 - R1 - Radius) < Tol) { qualifier1(NbrSol) = GccEnt_outside; } @@ -491,7 +491,7 @@ Geom2dGcc_Circ2dTanOnRadGeo::Geom2dGcc_Circ2dTanOnRadGeo(const GccEnt_QualifiedL Standard_Real thelast = 100000.; Standard_Real firstparam; Standard_Real lastparam; - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; NbrSol = 0; if (!(Qualified1.IsEnclosed() || Qualified1.IsOutside() || Qualified1.IsUnqualified())) @@ -537,8 +537,8 @@ Geom2dGcc_Circ2dTanOnRadGeo::Geom2dGcc_Circ2dTanOnRadGeo(const GccEnt_QualifiedL gp_Pnt2d Point(dir1.XY() + cote1(jcote1) * norm1.XY()); gp_Lin2d Line(Point, dir1); // ligne avec deport. IntRes2d_Domain D1; - firstparam = Max(Geom2dGcc_CurveTool::FirstParameter(OnCurv), thefirst); - lastparam = Min(Geom2dGcc_CurveTool::LastParameter(OnCurv), thelast); + firstparam = std::max(Geom2dGcc_CurveTool::FirstParameter(OnCurv), thefirst); + lastparam = std::min(Geom2dGcc_CurveTool::LastParameter(OnCurv), thelast); IntRes2d_Domain D2(Geom2dGcc_CurveTool::Value(OnCurv, firstparam), firstparam, Tol, @@ -629,7 +629,7 @@ Geom2dGcc_Circ2dTanOnRadGeo::Geom2dGcc_Circ2dTanOnRadGeo(const Geom2dGcc_QCurve& Standard_Real thelast = 100000.; Standard_Real firstparam; Standard_Real lastparam; - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); Standard_Integer nbrcote1 = 0; WellDone = Standard_False; NbrSol = 0; @@ -673,8 +673,8 @@ Geom2dGcc_Circ2dTanOnRadGeo::Geom2dGcc_Circ2dTanOnRadGeo(const Geom2dGcc_QCurve& Handle(Geom2dAdaptor_Curve) HCu1 = new Geom2dAdaptor_Curve(Cu1); // Adaptor2d_OffsetCurve C1(HCu1,cote1(jcote1)); Adaptor2d_OffsetCurve C1(HCu1, -cote1(jcote1)); - firstparam = Max(C1.FirstParameter(), thefirst); - lastparam = Min(C1.LastParameter(), thelast); + firstparam = std::max(C1.FirstParameter(), thefirst); + lastparam = std::min(C1.LastParameter(), thelast); IntRes2d_Domain D1(C1.Value(firstparam), firstparam, Tol, @@ -683,8 +683,8 @@ Geom2dGcc_Circ2dTanOnRadGeo::Geom2dGcc_Circ2dTanOnRadGeo(const Geom2dGcc_QCurve& Tol); Handle(Geom2dAdaptor_Curve) HOnCurv = new Geom2dAdaptor_Curve(OnCurv); Adaptor2d_OffsetCurve C2(HOnCurv); - firstparam = Max(C2.FirstParameter(), thefirst); - lastparam = Min(C2.LastParameter(), thelast); + firstparam = std::max(C2.FirstParameter(), thefirst); + lastparam = std::min(C2.LastParameter(), thelast); IntRes2d_Domain D2(C2.Value(firstparam), firstparam, Tol, @@ -763,7 +763,7 @@ Geom2dGcc_Circ2dTanOnRadGeo::Geom2dGcc_Circ2dTanOnRadGeo(const gp_Pnt2d& Standard_Real thelast = 100000.; Standard_Real firstparam; Standard_Real lastparam; - Standard_Real Tol = Abs(Tolerance); + Standard_Real Tol = std::abs(Tolerance); WellDone = Standard_False; NbrSol = 0; @@ -782,8 +782,8 @@ Geom2dGcc_Circ2dTanOnRadGeo::Geom2dGcc_Circ2dTanOnRadGeo(const gp_Pnt2d& 2 * M_PI, Tol); D1.SetEquivalentParameters(0., 2. * M_PI); - firstparam = Max(Geom2dGcc_CurveTool::FirstParameter(OnCurv), thefirst); - lastparam = Min(Geom2dGcc_CurveTool::LastParameter(OnCurv), thelast); + firstparam = std::max(Geom2dGcc_CurveTool::FirstParameter(OnCurv), thefirst); + lastparam = std::min(Geom2dGcc_CurveTool::LastParameter(OnCurv), thelast); IntRes2d_Domain D2(Geom2dGcc_CurveTool::Value(OnCurv, firstparam), firstparam, Tol, diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_FunctionTanCirCu.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_FunctionTanCirCu.cxx index 46ceb49621..a741f13d0c 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_FunctionTanCirCu.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_FunctionTanCirCu.cxx @@ -66,7 +66,7 @@ Geom2dGcc_FunctionTanCirCu::Geom2dGcc_FunctionTanCirCu(const gp_Circ2d& aLoc += (Geom2dGcc_CurveTool::Value(Curve, anX)).XY(); anX += aStep; } - myWeight = Max((aLoc - TheCirc.Location().XY()).SquareModulus(), TheCirc.Radius()); + myWeight = std::max((aLoc - TheCirc.Location().XY()).SquareModulus(), TheCirc.Radius()); // Modified by Sergey KHROMOV - Thu Apr 5 09:51:25 2001 End } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Lin2d2Tan.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Lin2d2Tan.cxx index 33adc34f0f..645987378e 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Lin2d2Tan.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Lin2d2Tan.cxx @@ -420,7 +420,7 @@ Standard_Boolean Geom2dGcc_Lin2d2Tan::Add(const Standard_Integer theInde for (i = 1; i < theIndex; i++) { - if (Abs(aPar1arg - pararg1(i)) <= theTol && Abs(aPar2arg - pararg2(i)) <= theTol) + if (std::abs(aPar1arg - pararg1(i)) <= theTol && std::abs(aPar2arg - pararg2(i)) <= theTol) return Standard_False; } @@ -430,14 +430,14 @@ Standard_Boolean Geom2dGcc_Lin2d2Tan::Add(const Standard_Integer theInde Geom2dGcc_CurveTool::D1(theC1, aPar1arg, aPoint, aVTan); - if (Abs(aLinDir.Crossed(gp_Dir2d(aVTan))) > theTol) + if (std::abs(aLinDir.Crossed(gp_Dir2d(aVTan))) > theTol) return Standard_False; if (!theC2.Curve().IsNull()) { Geom2dGcc_CurveTool::D1(theC2, aPar2arg, aPoint, aVTan); - if (Abs(aLinDir.Crossed(gp_Dir2d(aVTan))) > theTol) + if (std::abs(aLinDir.Crossed(gp_Dir2d(aVTan))) > theTol) return Standard_False; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Lin2d2TanIter.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Lin2d2TanIter.cxx index 0cb793fb01..7d29309625 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Lin2d2TanIter.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Lin2d2TanIter.cxx @@ -47,7 +47,7 @@ Geom2dGcc_Lin2d2TanIter::Geom2dGcc_Lin2d2TanIter(const GccEnt_QualifiedCirc& Qua pararg1 = 0.; par2sol = 0.0; pararg2 = 0.0; - // Standard_Real Tol = Abs(Tolang); + // Standard_Real Tol = std::abs(Tolang); WellDone = Standard_False; qualifier1 = GccEnt_noqualifier; @@ -61,7 +61,12 @@ Geom2dGcc_Lin2d2TanIter::Geom2dGcc_Lin2d2TanIter(const GccEnt_QualifiedCirc& Qua Standard_Real U1 = Geom2dGcc_CurveTool::FirstParameter(Cu2); Standard_Real U2 = Geom2dGcc_CurveTool::LastParameter(Cu2); Geom2dGcc_FunctionTanCirCu func(C1, Cu2); - math_FunctionRoot sol(func, Param2, Geom2dGcc_CurveTool::EpsX(Cu2, Abs(Tolang)), U1, U2, 100); + math_FunctionRoot sol(func, + Param2, + Geom2dGcc_CurveTool::EpsX(Cu2, std::abs(Tolang)), + U1, + U2, + 100); if (sol.IsDone()) { Standard_Real Usol = sol.Root(); @@ -69,7 +74,7 @@ Geom2dGcc_Lin2d2TanIter::Geom2dGcc_Lin2d2TanIter(const GccEnt_QualifiedCirc& Qua // Modified by Sergey KHROMOV - Thu Apr 5 17:39:47 2001 Begin Standard_Real Norm; func.Value(Usol, Norm); - if (Abs(Norm) < Tolang) + if (std::abs(Norm) < Tolang) { // Modified by Sergey KHROMOV - Thu Apr 5 17:39:48 2001 End gp_Pnt2d Origine; @@ -163,8 +168,8 @@ Geom2dGcc_Lin2d2TanIter::Geom2dGcc_Lin2d2TanIter(const Geom2dGcc_QCurve& Qualifi Umax(2) = Geom2dGcc_CurveTool::LastParameter(Cu2); Ufirst(1) = Param1; Ufirst(2) = Param2; - tol(1) = Geom2dGcc_CurveTool::EpsX(Cu1, Abs(Tolang)); - tol(2) = Geom2dGcc_CurveTool::EpsX(Cu2, Abs(Tolang)); + tol(1) = Geom2dGcc_CurveTool::EpsX(Cu1, std::abs(Tolang)); + tol(2) = Geom2dGcc_CurveTool::EpsX(Cu2, std::abs(Tolang)); math_FunctionSetRoot Root(Func, tol); Root.Perform(Func, Ufirst, Umin, Umax); if (Root.IsDone()) @@ -173,7 +178,7 @@ Geom2dGcc_Lin2d2TanIter::Geom2dGcc_Lin2d2TanIter(const Geom2dGcc_QCurve& Qualifi // Modified by Sergey KHROMOV - Thu Apr 5 17:45:00 2001 Begin math_Vector Norm(1, 2); Func.Value(Ufirst, Norm); - if (Abs(Norm(1)) < Tolang && Abs(Norm(2)) < Tolang) + if (std::abs(Norm(1)) < Tolang && std::abs(Norm(2)) < Tolang) { // Modified by Sergey KHROMOV - Thu Apr 5 17:45:01 2001 End gp_Pnt2d point1, point2; @@ -233,14 +238,19 @@ Geom2dGcc_Lin2d2TanIter::Geom2dGcc_Lin2d2TanIter(const Geom2dGcc_QCurve& Qualifi Standard_Real U1 = Geom2dGcc_CurveTool::FirstParameter(Cu1); Standard_Real U2 = Geom2dGcc_CurveTool::LastParameter(Cu1); Geom2dGcc_FunctionTanCuPnt func(Cu1, ThePoint); - math_FunctionRoot sol(func, Param1, Geom2dGcc_CurveTool::EpsX(Cu1, Abs(Tolang)), U1, U2, 100); + math_FunctionRoot sol(func, + Param1, + Geom2dGcc_CurveTool::EpsX(Cu1, std::abs(Tolang)), + U1, + U2, + 100); if (sol.IsDone()) { Standard_Real Usol = sol.Root(); // Modified by Sergey KHROMOV - Thu Apr 5 17:45:17 2001 Begin Standard_Real Norm; func.Value(Usol, Norm); - if (Abs(Norm) < Tolang) + if (std::abs(Norm) < Tolang) { // Modified by Sergey KHROMOV - Thu Apr 5 17:45:19 2001 End gp_Pnt2d Origine; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Lin2dTanObl.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Lin2dTanObl.cxx index 4c6b480efd..80e15b6516 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Lin2dTanObl.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Lin2dTanObl.cxx @@ -255,7 +255,7 @@ Standard_Boolean Geom2dGcc_Lin2dTanObl::Add(const Standard_Integer the for (i = 1; i < theIndex; i++) { - if (Abs(aPar1arg - pararg1(i)) <= theTol && Abs(aPar2arg - pararg2(i)) <= theTol) + if (std::abs(aPar1arg - pararg1(i)) <= theTol && std::abs(aPar2arg - pararg2(i)) <= theTol) return Standard_False; } @@ -265,7 +265,7 @@ Standard_Boolean Geom2dGcc_Lin2dTanObl::Add(const Standard_Integer the Geom2dGcc_CurveTool::D1(theC1, aPar1arg, aPoint, aVTan); - if (Abs(aLinDir.Crossed(gp_Dir2d(aVTan))) > theTol) + if (std::abs(aLinDir.Crossed(gp_Dir2d(aVTan))) > theTol) return Standard_False; linsol(theIndex) = aLin; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Lin2dTanOblIter.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Lin2dTanOblIter.cxx index a0289f013b..d2e311bdaf 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Lin2dTanOblIter.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dGcc/Geom2dGcc_Lin2dTanOblIter.cxx @@ -60,24 +60,25 @@ Geom2dGcc_Lin2dTanOblIter::Geom2dGcc_Lin2dTanOblIter(const Geom2dGcc_QCurve& Qua Standard_Real A = Dir.X(); Standard_Real B = Dir.Y(); gp_Dir2d TheDirection(Dir); - if (Abs(Angle) > Abs(TolAng)) + if (std::abs(Angle) > std::abs(TolAng)) { - if (Abs(Abs(Angle) - M_PI) <= Abs(TolAng)) + if (std::abs(std::abs(Angle) - M_PI) <= std::abs(TolAng)) { Paral2 = Standard_True; TheDirection = Dir.Reversed(); } - else if (Abs(Angle - M_PI / 2) <= Abs(TolAng)) + else if (std::abs(Angle - M_PI / 2) <= std::abs(TolAng)) { TheDirection = gp_Dir2d(-B, A); } - else if (Abs(Angle + M_PI / 2) <= Abs(TolAng)) + else if (std::abs(Angle + M_PI / 2) <= std::abs(TolAng)) { TheDirection = gp_Dir2d(B, -A); } else { - TheDirection = gp_Dir2d(A * Cos(Angle) - B * Sin(Angle), A * Sin(Angle) + B * Cos(Angle)); + TheDirection = gp_Dir2d(A * std::cos(Angle) - B * std::sin(Angle), + A * std::sin(Angle) + B * std::cos(Angle)); } } else @@ -85,7 +86,12 @@ Geom2dGcc_Lin2dTanOblIter::Geom2dGcc_Lin2dTanOblIter(const Geom2dGcc_QCurve& Qua Paral2 = Standard_True; } Geom2dGcc_FunctionTanObl func(Cu1, TheDirection); - math_FunctionRoot sol(func, Param1, Geom2dGcc_CurveTool::EpsX(Cu1, Abs(TolAng)), U1, U2, 100); + math_FunctionRoot sol(func, + Param1, + Geom2dGcc_CurveTool::EpsX(Cu1, std::abs(TolAng)), + U1, + U2, + 100); if (sol.IsDone()) { Standard_Real Usol = sol.Root(); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dHatch/Geom2dHatch_Elements.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dHatch/Geom2dHatch_Elements.cxx index 943f7abbeb..ed8f5f667e 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dHatch/Geom2dHatch_Elements.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dHatch/Geom2dHatch_Elements.cxx @@ -148,9 +148,9 @@ Standard_Boolean Geom2dHatch_Elements::OtherSegment(const gp_Pnt2d& P, if (aTanMod < Precision::SquarePConfusion()) continue; - aTanVec /= Sqrt(aTanMod); + aTanVec /= std::sqrt(aTanMod); Standard_Real aSinA = aTanVec.Crossed(aLinDir); - if (Abs(aSinA) < 0.001) + if (std::abs(aSinA) < 0.001) { // too small angle - line and edge may be considered // as tangent which is bad for classifier @@ -172,7 +172,7 @@ Standard_Boolean Geom2dHatch_Elements::OtherSegment(const gp_Pnt2d& P, myCurEdge++; myCurEdgePar = Probing_Start; } - Par = Sqrt(Par); + Par = std::sqrt(Par); return Standard_True; } } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dHatch/Geom2dHatch_Hatcher.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dHatch/Geom2dHatch_Hatcher.cxx index fbd99ac0a4..ce743eae80 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dHatch/Geom2dHatch_Hatcher.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dHatch/Geom2dHatch_Hatcher.cxx @@ -613,7 +613,8 @@ Standard_Boolean Geom2dHatch_Hatcher::Trim(const Standard_Integer IndH, const St // `hatcher'. //----------------------------------------------------------------------- - Standard_Boolean Conf2d = Abs(Pnt1.ParamOnFirst() - Pnt2.ParamOnFirst()) <= myConfusion2d; + Standard_Boolean Conf2d = + std::abs(Pnt1.ParamOnFirst() - Pnt2.ParamOnFirst()) <= myConfusion2d; //----------------------------------------------------------------------- // Les deux points peuvent etre `confondus' au regard des intersections. diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dInt/Geom2dInt_Geom2dCurveTool.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dInt/Geom2dInt_Geom2dCurveTool.cxx index 6ed370ead3..340abcb623 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Geom2dInt/Geom2dInt_Geom2dCurveTool.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Geom2dInt/Geom2dInt_Geom2dCurveTool.cxx @@ -40,7 +40,7 @@ Standard_Integer Geom2dInt_Geom2dCurveTool::NbSamples(const Adaptor2d_Curve2d& C Standard_Real anb = t1 / t * nbs; nbs = (Standard_Integer)anb; - Standard_Integer aMinPntNb = Max(C.Degree() + 1, 4); + Standard_Integer aMinPntNb = std::max(C.Degree() + 1, 4); if (nbs < aMinPntNb) nbs = aMinPntNb; } @@ -52,9 +52,9 @@ Standard_Integer Geom2dInt_Geom2dCurveTool::NbSamples(const Adaptor2d_Curve2d& C Standard_Real R = C.Circle().Radius(); if (R > minR) { - Standard_Real angl = 0.283079; // 2.*ACos(1. - eps); - Standard_Integer n = RealToInt(Abs(U1 - U0) / angl); - nbs = Max(n, nbs); + Standard_Real angl = 0.283079; // 2.*std::acos(1. - eps); + Standard_Integer n = RealToInt(std::abs(U1 - U0) / angl); + nbs = std::max(n, nbs); } } @@ -75,9 +75,9 @@ Standard_Integer Geom2dInt_Geom2dCurveTool::NbSamples(const Adaptor2d_Curve2d& C Standard_Real R = C.Circle().Radius(); if (R > minR) { - Standard_Real angl = 0.283079; // 2.*ACos(1. - eps); + Standard_Real angl = 0.283079; // 2.*std::acos(1. - eps); Standard_Integer n = RealToInt((C.LastParameter() - C.FirstParameter()) / angl); - nbs = Max(n, nbs); + nbs = std::max(n, nbs); } } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomAPI/GeomAPI_Interpolate.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomAPI/GeomAPI_Interpolate.cxx index 92fb4e7985..d45ee1605c 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomAPI/GeomAPI_Interpolate.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomAPI/GeomAPI_Interpolate.cxx @@ -258,8 +258,8 @@ static void ScaleTangents(const TColgp_Array1OfPnt& PointsArray, value[0] = value[1] = 0.0e0; for (jj = 1; jj <= 3; jj++) { - value[0] += Abs(TangentsArray.Value(ii).Coord(jj)); - value[1] += Abs(eval_result[1][jj - 1]); + value[0] += std::abs(TangentsArray.Value(ii).Coord(jj)); + value[1] += std::abs(eval_result[1][jj - 1]); } ratio = value[1] / value[0]; for (jj = 1; jj <= 3; jj++) diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomAPI/GeomAPI_PointsToBSplineSurface.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomAPI/GeomAPI_PointsToBSplineSurface.cxx index 2dffd369a6..ed88bf6bde 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomAPI/GeomAPI_PointsToBSplineSurface.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomAPI/GeomAPI_PointsToBSplineSurface.cxx @@ -64,14 +64,14 @@ static void BuildParameters(const AppDef_MultiLine& theLine, dist += aP2.SquareDistance(aP1); } - dist = Sqrt(dist); + dist = std::sqrt(dist); if (theParT == Approx_ChordLength) { thePars(i) = thePars(i - 1) + dist; } else { // Par == Approx_Centripetal - thePars(i) = thePars(i - 1) + Sqrt(dist); + thePars(i) = thePars(i - 1) + std::sqrt(dist); } } for (i = firstP; i <= lastP; i++) @@ -98,9 +98,9 @@ static void BuildPeriodicTangent(const AppDef_MultiLine& theLine, return; } // - Standard_Integer i, nnpol, nnp = Min(nbpoints, 9); + Standard_Integer i, nnpol, nnp = std::min(nbpoints, 9); nnpol = nnp; - Standard_Integer lastp = Min(lastpt, firstpt + nnp - 1); + Standard_Integer lastp = std::min(lastpt, firstpt + nnp - 1); Standard_Real U; AppParCurves_Constraint Cons = AppParCurves_TangencyPoint; if (nnp <= 4) @@ -139,7 +139,7 @@ static void BuildPeriodicTangent(const AppDef_MultiLine& theLine, j += 3; } - Standard_Integer firstp = Max(firstpt, lastpt - nnp + 1); + Standard_Integer firstp = std::max(firstpt, lastpt - nnp + 1); if (firstp == firstpt && lastp == lastpt) { diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomAPI/GeomAPI_PointsToBSplineSurface.hxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomAPI/GeomAPI_PointsToBSplineSurface.hxx index fab7d9f1a9..f23e976d24 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomAPI/GeomAPI_PointsToBSplineSurface.hxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomAPI/GeomAPI_PointsToBSplineSurface.hxx @@ -56,7 +56,7 @@ class Geom_BSplineSurface; //! type of parametrization, which can be Approx_ChordLength, Approx_Centripetal //! or Approx_IsoParametric. Default value is Approx_ChordLength. //! For ChordLength parametrisation U(i) = U(i-1) + P(i).Distance(P(i-1)), -//! For Centripetal type U(i) = U(i-1) + Sqrt(P(i).Distance(P(i-1))). +//! For Centripetal type U(i) = U(i-1) + std::sqrt(P(i).Distance(P(i-1))). //! Centripetal type can get better result for irregular distances between points. //! //! Approximation and interpolation algorithms can build periodical surface along U diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill.cxx index 045315f896..044cd78a57 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill.cxx @@ -100,25 +100,25 @@ Handle(Geom_Surface) GeomFill::Surface(const Handle(Geom_Curve)& Curve1, if (D1.IsEqual(D2, Precision::Angular())) { - if (Abs(a1 - proj - a2) <= Precision::Confusion() - && Abs(b1 - proj - b2) <= Precision::Confusion()) + if (std::abs(a1 - proj - a2) <= Precision::Confusion() + && std::abs(b1 - proj - b2) <= Precision::Confusion()) { gp_Ax3 Ax(L1.Location(), gp_Dir(D1.Crossed(P1P2)), D1); Handle(Geom_Plane) P = new Geom_Plane(Ax); Standard_Real V = P1P2.Dot(Ax.YDirection()); - Surf = new Geom_RectangularTrimmedSurface(P, a1, b1, Min(0., V), Max(0., V)); + Surf = new Geom_RectangularTrimmedSurface(P, a1, b1, std::min(0., V), std::max(0., V)); IsDone = Standard_True; } } if (D1.IsOpposite(D2, Precision::Angular())) { - if (Abs(a1 - proj + b2) <= Precision::Confusion() - && Abs(b1 - proj + a2) <= Precision::Confusion()) + if (std::abs(a1 - proj + b2) <= Precision::Confusion() + && std::abs(b1 - proj + a2) <= Precision::Confusion()) { gp_Ax3 Ax(L1.Location(), gp_Dir(D1.Crossed(P1P2)), D1); Handle(Geom_Plane) P = new Geom_Plane(Ax); Standard_Real V = P1P2.Dot(Ax.YDirection()); - Surf = new Geom_RectangularTrimmedSurface(P, a1, b1, Min(0., V), Max(0., V)); + Surf = new Geom_RectangularTrimmedSurface(P, a1, b1, std::min(0., V), std::max(0., V)); IsDone = Standard_True; } } @@ -142,15 +142,16 @@ Handle(Geom_Surface) GeomFill::Surface(const Handle(Geom_Curve)& Curve1, Standard_Real V = gp_Vec(A1.Location(), A2.Location()).Dot(gp_Vec(A1.Direction())); if (!Trim1 && !Trim2) { - if (Abs(C1.Radius() - C2.Radius()) < Precision::Confusion()) + if (std::abs(C1.Radius() - C2.Radius()) < Precision::Confusion()) { Handle(Geom_CylindricalSurface) C = new Geom_CylindricalSurface(A1, C1.Radius()); - Surf = new Geom_RectangularTrimmedSurface(C, Min(0., V), Max(0., V), Standard_False); + Surf = + new Geom_RectangularTrimmedSurface(C, std::min(0., V), std::max(0., V), Standard_False); } else { Standard_Real Rad = C2.Radius() - C1.Radius(); - Standard_Real Ang = ATan(Rad / V); + Standard_Real Ang = std::atan(Rad / V); if (Ang < 0.) { A1.ZReverse(); @@ -158,8 +159,9 @@ Handle(Geom_Surface) GeomFill::Surface(const Handle(Geom_Curve)& Curve1, Ang = -Ang; } Handle(Geom_ConicalSurface) C = new Geom_ConicalSurface(A1, Ang, C1.Radius()); - V /= Cos(Ang); - Surf = new Geom_RectangularTrimmedSurface(C, Min(0., V), Max(0., V), Standard_False); + V /= std::cos(Ang); + Surf = + new Geom_RectangularTrimmedSurface(C, std::min(0., V), std::max(0., V), Standard_False); } IsDone = Standard_True; } @@ -204,7 +206,7 @@ void GeomFill::GetShape(const Standard_Real MaxAng, } break; default: { - Standard_Integer NbSpan = (Standard_Integer)(Ceiling(3. * Abs(MaxAng) / 2. / M_PI)); + Standard_Integer NbSpan = (Standard_Integer)(std::ceil(3. * std::abs(MaxAng) / 2. / M_PI)); NbPoles = 2 * NbSpan + 1; NbKnots = NbSpan + 1; Degree = 2; @@ -247,7 +249,7 @@ void GeomFill::GetMinimalWeights(const Convert_ParameterisationType TConv, CtoBspl->Weights(Weights); TColStd_Array1OfReal poids(Weights.Lower(), Weights.Upper()); - Standard_Real angle_min = Max(Precision::PConfusion(), MinAng); + Standard_Real angle_min = std::max(Precision::PConfusion(), MinAng); Handle(Geom_TrimmedCurve) Sect2 = new Geom_TrimmedCurve(new Geom_Circle(C), 0., angle_min); CtoBspl = GeomConvert::CurveToBSplineCurve(Sect2, TConv); @@ -329,7 +331,7 @@ Standard_Real GeomFill::GetTolerance(const Convert_ParameterisationType TConv, gp_Ax2 popAx2(gp_Pnt(0, 0, 0), gp_Dir(gp_Dir::D::Z)); gp_Circ C(popAx2, Radius); Handle(Geom_Circle) popCircle = new Geom_Circle(C); - Handle(Geom_TrimmedCurve) Sect = new Geom_TrimmedCurve(popCircle, 0., Max(AngleMin, 0.02)); + Handle(Geom_TrimmedCurve) Sect = new Geom_TrimmedCurve(popCircle, 0., std::max(AngleMin, 0.02)); // 0.02 est proche d'1 degree, en desous on ne se preocupe pas de la tngence // afin d'eviter des tolerances d'approximation tendant vers 0 ! Handle(Geom_BSplineCurve) CtoBspl = GeomConvert::CurveToBSplineCurve(Sect, TConv); @@ -378,7 +380,7 @@ void GeomFill::GetCircle(const Convert_ParameterisationType TConv, Cosa = 1; Sina = 0; } - Angle = ACos(Cosa); + Angle = std::acos(Cosa); // Recadrage sur ]-pi/2, 3pi/2] if (Sina < 0.) { @@ -416,13 +418,13 @@ void GeomFill::GetCircle(const Convert_ParameterisationType TConv, np2 = nplan.Crossed(ns1); Alpha = Angle / ((Standard_Real)(NbSpan)); - Cosas2 = Cos(Alpha / 2); + Cosas2 = std::cos(Alpha / 2); for (i = 1, jj = low + 2; i <= NbSpan - 1; i++, jj += 2) { lambda = ((Standard_Real)(i)) * Alpha; - Cosa = Cos(lambda); - Sina = Sin(lambda); + Cosa = std::cos(lambda); + Sina = std::sin(lambda); temp.SetLinearForm(Cosa - 1, ns1, Sina, np2); Poles(jj).SetXYZ(pts1.XYZ() + Rayon * temp.XYZ()); Weights(jj) = 1; @@ -479,7 +481,7 @@ Standard_Boolean GeomFill::GetCircle(const Convert_ParameterisationType TConv, Cosa = 1; Sina = 0; } - Angle = ACos(Cosa); + Angle = std::acos(Cosa); // Recadrage sur ]-pi/2, 3pi/2] if (Sina < 0.) { @@ -489,7 +491,7 @@ Standard_Boolean GeomFill::GetCircle(const Convert_ParameterisationType TConv, Angle = 2. * M_PI - Angle; } - if (Abs(Sina) > Abs(Cosa)) + if (std::abs(Sina) > std::abs(Cosa)) { DAngle = -(dn1w.Dot(ns2) + ns1.Dot(dn2w)) / Sina; } @@ -545,14 +547,14 @@ Standard_Boolean GeomFill::GetCircle(const Convert_ParameterisationType TConv, dnp2 = dnplan.Crossed(ns1).Added(nplan.Crossed(dn1w)); Alpha = Angle / ((Standard_Real)(NbSpan)); - Cosas2 = Cos(Alpha / 2); - Sinas2 = Sin(Alpha / 2); + Cosas2 = std::cos(Alpha / 2); + Sinas2 = std::sin(Alpha / 2); for (i = 1, jj = low + 2; i <= NbSpan - 1; i++, jj += 2) { lambda = ((Standard_Real)(i)) * Alpha; - Cosa = Cos(lambda); - Sina = Sin(lambda); + Cosa = std::cos(lambda); + Sina = std::sin(lambda); temp.SetLinearForm(Cosa - 1, ns1, Sina, np2); Poles(jj).SetXYZ(pts1.XYZ() + Rayon * temp.XYZ()); @@ -644,7 +646,7 @@ Standard_Boolean GeomFill::GetCircle(const Convert_ParameterisationType TConv, Cosa = 1; Sina = 0; } - Angle = ACos(Cosa); + Angle = std::acos(Cosa); // Recadrage sur ]-pi/2, 3pi/2] if (Sina < 0.) { @@ -654,7 +656,7 @@ Standard_Boolean GeomFill::GetCircle(const Convert_ParameterisationType TConv, Angle = 2. * M_PI - Angle; } - if (Abs(Sina) > Abs(Cosa)) + if (std::abs(Sina) > std::abs(Cosa)) { aux = dn1w.Dot(ns2) + ns1.Dot(dn2w); DAngle = -aux / Sina; @@ -746,14 +748,14 @@ Standard_Boolean GeomFill::GetCircle(const Convert_ParameterisationType TConv, d2np2 += 2 * dnplan.Crossed(dn1w); Alpha = Angle / ((Standard_Real)(NbSpan)); - Cosas2 = Cos(Alpha / 2); - Sinas2 = Sin(Alpha / 2); + Cosas2 = std::cos(Alpha / 2); + Sinas2 = std::sin(Alpha / 2); for (i = 1, jj = low + 2; i <= NbSpan - 1; i++, jj += 2) { lambda = ((Standard_Real)(i)) * Alpha; - Cosa = Cos(lambda); - Sina = Sin(lambda); + Cosa = std::cos(lambda); + Sina = std::sin(lambda); temp.SetLinearForm(Cosa - 1, ns1, Sina, np2); Poles(jj).SetXYZ(pts1.XYZ() + Rayon * temp.XYZ()); @@ -797,7 +799,7 @@ Standard_Boolean GeomFill::GetCircle(const Convert_ParameterisationType TConv, // Les poids Dlambda = -Sinas2 * DAngle / (2 * NbSpan); - D2lambda = -Sinas2 * D2Angle / (2 * NbSpan) - Cosas2 * Pow(DAngle / (2 * NbSpan), 2); + D2lambda = -Sinas2 * D2Angle / (2 * NbSpan) - Cosas2 * std::pow(DAngle / (2 * NbSpan), 2); for (i = low; i < upp; i += 2) { diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_BSplineCurves.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_BSplineCurves.cxx index b3a5fe4b1f..7858f22f28 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_BSplineCurves.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_BSplineCurves.cxx @@ -177,7 +177,7 @@ static Standard_Integer SetSameDistribution(Handle(Geom_BSplineCurve)& C1, BSplCLib::Reparametrize(K21, K22, K1); C1->SetKnots(K1); } - else if (Abs(K12 - K11) > Precision::PConfusion()) + else if (std::abs(K12 - K11) > Precision::PConfusion()) { BSplCLib::Reparametrize(K11, K12, K2); C2->SetKnots(K2); @@ -310,8 +310,8 @@ void GeomFill_BSplineCurves::Init(const Handle(Geom_BSplineCurve)& C1, Standard_Integer Deg2 = CC2->Degree(); Standard_Integer Deg3 = CC3->Degree(); Standard_Integer Deg4 = CC4->Degree(); - Standard_Integer DegU = Max(Deg1, Deg3); - Standard_Integer DegV = Max(Deg2, Deg4); + Standard_Integer DegU = std::max(Deg1, Deg3); + Standard_Integer DegV = std::max(Deg2, Deg4); if (Deg1 < DegU) CC1->IncreaseDegree(DegU); if (Deg2 < DegV) @@ -491,7 +491,7 @@ void GeomFill_BSplineCurves::Init(const Handle(Geom_BSplineCurve)& C1, if (Type != GeomFill_CurvedStyle) { - Standard_Integer DegU = Max(Deg1, Deg2); + Standard_Integer DegU = std::max(Deg1, Deg2); if (CC1->Degree() < DegU) CC1->IncreaseDegree(DegU); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_BezierCurves.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_BezierCurves.cxx index 540062fbef..fd965b7a06 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_BezierCurves.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_BezierCurves.cxx @@ -71,9 +71,9 @@ static void SetSameWeights(TColStd_Array1OfReal& W1, W4(i) *= Gamma; } - if (Abs(A - B) > Eps) + if (std::abs(A - B) > Eps) { - Standard_Real w = Pow(W1(1) / W4(1), 1. / (Standard_Real)(NV - 1)); + Standard_Real w = std::pow(W1(1) / W4(1), 1. / (Standard_Real)(NV - 1)); Standard_Real x = w; for (i = NV - 1; i >= 1; i--) { @@ -208,13 +208,13 @@ void GeomFill_BezierCurves::Init(const Handle(Geom_BezierCurve)& C1, Standard_ConstructionError_Raise_if(!IsOK, " GeomFill_BezierCurves: Courbes non jointives"); // Mise en conformite des degres - Standard_Integer DegU = Max(CC1->Degree(), CC3->Degree()); - Standard_Integer DegV = Max(CC2->Degree(), CC4->Degree()); + Standard_Integer DegU = std::max(CC1->Degree(), CC3->Degree()); + Standard_Integer DegV = std::max(CC2->Degree(), CC4->Degree()); if (Type == GeomFill_CoonsStyle) { - DegU = Max(DegU, 3); - DegV = Max(DegV, 3); + DegU = std::max(DegU, 3); + DegV = std::max(DegV, 3); } if (CC1->Degree() < DegU) @@ -364,7 +364,7 @@ void GeomFill_BezierCurves::Init(const Handle(Geom_BezierCurve)& C1, if (Type != GeomFill_CurvedStyle) { - Standard_Integer DegU = Max(Deg1, Deg2); + Standard_Integer DegU = std::max(Deg1, Deg2); if (CC1->Degree() < DegU) CC1->Increase(DegU); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_BoundWithSurf.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_BoundWithSurf.cxx index 0829155047..b68f85ad85 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_BoundWithSurf.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_BoundWithSurf.cxx @@ -117,7 +117,7 @@ void GeomFill_BoundWithSurf::D1Norm(const Standard_Real U, gp_Vec& N, gp_Vec& DN Standard_Real nsuu = N.Dot(Suu), nsuv = N.Dot(Suv), nsvv = N.Dot(Svv); Standard_Real susu = Su.Dot(Su), susv = Su.Dot(Sv), svsv = Sv.Dot(Sv); Standard_Real deno = (susu * svsv) - (susv * susv); - if (Abs(deno) < 1.e-16) + if (std::abs(deno) < 1.e-16) { // on embraye sur un calcul approche, c est mieux que rien!?! gp_Vec temp = Norm(U + 1.e-12); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_CircularBlendFunc.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_CircularBlendFunc.cxx index 47a59b52fa..cd6191d5c6 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_CircularBlendFunc.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_CircularBlendFunc.cxx @@ -70,7 +70,7 @@ static void GeomFillFusInt(const TColStd_Array1OfReal& I1, { v1 = I1(ind1); v2 = I2(ind2); - if (Abs(v1 - v2) <= Epspar) + if (std::abs(v1 - v2) <= Epspar) { // Ici les elements de I1 et I2 conviennent . Seq.Append((v1 + v2) / 2); @@ -205,12 +205,12 @@ void GeomFill_CircularBlendFunc::Discret() { Cosa = 1.; } - Angle = Abs(ACos(Cosa)); + Angle = std::abs(std::acos(Cosa)); if (Angle > maxang) maxang = Angle; if (Angle < minang) minang = Angle; - distmin = Min(distmin, P1.Distance(P2)); + distmin = std::min(distmin, P1.Distance(P2)); myBary.ChangeCoord() += (P1.XYZ() + P2.XYZ()); } } @@ -231,13 +231,13 @@ void GeomFill_CircularBlendFunc::Discret() Cosa = ns1.Dot(ns2); if (Cosa > 1.) Cosa = 1.; - Angle = Abs(ACos(Cosa)); + Angle = std::abs(std::acos(Cosa)); if (Angle > maxang) maxang = Angle; if (Angle < minang) minang = Angle; - distmin = Min(distmin, P1.Distance(P2)); + distmin = std::min(distmin, P1.Distance(P2)); myBary.ChangeCoord() += (P1.XYZ() + P2.XYZ()); } } @@ -641,8 +641,8 @@ void GeomFill_CircularBlendFunc::GetTolerance(const Standard_Real BoundTol, Tol = GeomFill::GetTolerance(myTConv, minang, myRadius, AngleTol, SurfTol); Tol3d.Init(SurfTol); - Tol3d(low + 1) = Tol3d(up - 1) = Min(Tol, SurfTol); - Tol3d(low) = Tol3d(up) = Min(Tol, BoundTol); + Tol3d(low + 1) = Tol3d(up - 1) = std::min(Tol, SurfTol); + Tol3d(low) = Tol3d(up) = std::min(Tol, BoundTol); } void GeomFill_CircularBlendFunc::SetTolerance(const Standard_Real, const Standard_Real) diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_ConstrainedFilling.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_ConstrainedFilling.cxx index 1ce159def4..f7487034bf 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_ConstrainedFilling.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_ConstrainedFilling.cxx @@ -74,7 +74,7 @@ static Standard_Integer inqadd(const Standard_Real d1, m[0] = m[1] = deg - 2; if (d1 != 1. && d2 != 1.) { - if (Abs(d1 + d2 - 1.) < tolk) + if (std::abs(d1 + d2 - 1.) < tolk) { k[0] = 0.5 * (d1 + 1. - d2); nbadd = 1; @@ -82,8 +82,8 @@ static Standard_Integer inqadd(const Standard_Real d1, else { nbadd = 2; - k[0] = Min(d1, 1. - d2); - k[1] = Max(d1, 1. - d2); + k[0] = std::min(d1, 1. - d2); + k[1] = std::max(d1, 1. - d2); } } else if (d1 != 1.) @@ -220,7 +220,7 @@ static void coonscnd(const Standard_Integer nb, if (stat[i].HasConstraint()) { Standard_Integer ip = (i - 1 + nb) % nb; - Standard_Real tolang = Min(bound[ip]->Tolang(), bound[i]->Tolang()); + Standard_Real tolang = std::min(bound[ip]->Tolang(), bound[i]->Tolang()); Standard_Real an = stat[i].NorAng(); Standard_Boolean twist = Standard_False; if (an >= 0.5 * M_PI) @@ -233,7 +233,7 @@ static void coonscnd(const Standard_Integer nb, else { Standard_Real fact = 0.5 * 27. / 4; - tolang *= (Min(mintg[ip], mintg[i]) * fact * fact_normalization); + tolang *= (std::min(mintg[ip], mintg[i]) * fact * fact_normalization); gp_Vec tgp, dnorp, tgi, dnori, vbid; gp_Pnt pbid; Standard_Real fp, lp, fi, li; @@ -253,7 +253,7 @@ static void coonscnd(const Standard_Integer nb, Standard_Real scal2 = tgi.Dot(dnorp); if (!twist) scal2 *= -1.; - scal1 = Abs(scal1 + scal2); + scal1 = std::abs(scal1 + scal2); if (scal1 > tolang) { Standard_Real killfactor = tolang / scal1; @@ -408,7 +408,7 @@ void GeomFill_ConstrainedFilling::Init(const Handle(GeomFill_Boundary)& B1, gp_Pnt p1 = bound[1]->Value(1.); gp_Pnt p2 = bound[2]->Value(1.); gp_Pnt ppp(0.5 * (p1.XYZ() + p2.XYZ())); - Standard_Real t3 = Max(bound[1]->Tol3d(), bound[2]->Tol3d()); + Standard_Real t3 = std::max(bound[1]->Tol3d(), bound[2]->Tol3d()); Handle(GeomFill_DegeneratedBound) DB = new GeomFill_DegeneratedBound(ppp, 0., 1., t3, 10.); ptch = new GeomFill_CoonsAlgPatch(bound[0], bound[1], DB, bound[2]); @@ -557,13 +557,13 @@ void GeomFill_ConstrainedFilling::SetDomain(const Standard_Real const Handle(GeomFill_BoundWithSurf)& B) { if (B == ptch->Bound(0)) - dom[0] = Min(1., Abs(l)); + dom[0] = std::min(1., std::abs(l)); else if (B == ptch->Bound(1)) - dom[1] = Min(1., Abs(l)); + dom[1] = std::min(1., std::abs(l)); else if (B == ptch->Bound(2)) - dom[2] = Min(1., Abs(l)); + dom[2] = std::min(1., std::abs(l)); else if (B == ptch->Bound(3)) - dom[3] = Min(1., Abs(l)); + dom[3] = std::min(1., std::abs(l)); } //================================================================================================= @@ -679,7 +679,7 @@ void GeomFill_ConstrainedFilling::PerformApprox() if (app.IsDone() || app.HasResult()) { - Standard_Integer imk = Min(ibound[0], ibound[1]); + Standard_Integer imk = std::min(ibound[0], ibound[1]); Standard_Integer nbpol = app.NbPoles(); degree[imk] = app.Degree(); mults[imk] = app.Multiplicities(); @@ -735,7 +735,7 @@ void GeomFill_ConstrainedFilling::MatchKnots() ntpol[3] = tgtepol[3]; Standard_Real kadd[2]; Standard_Integer madd[2]; - Standard_Real tolk = 1. / Max(10, 2 * knots[1]->Array1().Length()); + Standard_Real tolk = 1. / std::max(10, 2 * knots[1]->Array1().Length()); Standard_Integer nbadd = inqadd(dom[0], dom[2], kadd, madd, degree[1], tolk); if (nbadd) { @@ -827,7 +827,7 @@ void GeomFill_ConstrainedFilling::MatchKnots() { for (i = 2; i <= nbnk; i++) { - if (Abs(dom[0] - nm[1]->Value(i)) < tolk) + if (std::abs(dom[0] - nm[1]->Value(i)) < tolk) { ind[0] = i; break; @@ -838,7 +838,7 @@ void GeomFill_ConstrainedFilling::MatchKnots() { for (i = 1; i < nbnk; i++) { - if (Abs(1. - dom[2] - nm[1]->Value(i)) < tolk) + if (std::abs(1. - dom[2] - nm[1]->Value(i)) < tolk) { ind[2] = i; break; @@ -846,7 +846,7 @@ void GeomFill_ConstrainedFilling::MatchKnots() } } } - tolk = 1. / Max(10., 2. * knots[0]->Array1().Length()); + tolk = 1. / std::max(10., 2. * knots[0]->Array1().Length()); nbadd = inqadd(dom[1], dom[3], kadd, madd, degree[0], tolk); if (nbadd) { @@ -938,7 +938,7 @@ void GeomFill_ConstrainedFilling::MatchKnots() { for (i = 2; i <= nbnk; i++) { - if (Abs(dom[1] - nm[0]->Value(i)) < tolk) + if (std::abs(dom[1] - nm[0]->Value(i)) < tolk) { ind[1] = i; break; @@ -949,7 +949,7 @@ void GeomFill_ConstrainedFilling::MatchKnots() { for (i = 1; i < nbnk; i++) { - if (Abs(1. - dom[3] - nm[0]->Value(i)) < tolk) + if (std::abs(1. - dom[3] - nm[0]->Value(i)) < tolk) { ind[3] = i; break; @@ -1528,9 +1528,9 @@ void GeomFill_ConstrainedFilling::CheckTgteField(const Standard_Integer I) #endif if (vnor.Magnitude() > 1.e-15 && vtg.Magnitude() > 1.e-15) { - Standard_Real alpha = Abs(M_PI / 2. - Abs(vnor.Angle(vtg))); - if (Abs(alpha) > maxang) - maxang = Abs(alpha); + Standard_Real alpha = std::abs(M_PI / 2. - std::abs(vnor.Angle(vtg))); + if (std::abs(alpha) > maxang) + maxang = std::abs(alpha); } } std::cout << "KAlgo angle max sur bord " << I << " : " << maxang << std::endl; @@ -1577,9 +1577,9 @@ void GeomFill_ConstrainedFilling::CheckApprox(const Standard_Integer I) vbound = bou->Norm(uu); if (vapp.Magnitude() > 1.e-15 && vbound.Magnitude() > 1.e-15) { - Standard_Real alpha = Abs(M_PI / 2. - Abs(vbound.Angle(vapp))); - if (Abs(alpha) > maxang) - maxang = Abs(alpha); + Standard_Real alpha = std::abs(M_PI / 2. - std::abs(vbound.Angle(vapp))); + if (std::abs(alpha) > maxang) + maxang = std::abs(alpha); } #ifdef DRAW Handle(Draw_Segment3D) seg; @@ -1660,8 +1660,8 @@ void GeomFill_ConstrainedFilling::CheckResult(const Standard_Integer I) vres[k] = V1.Crossed(V2); if (vres[k].Magnitude() > 1.e-15 && vbound[k].Magnitude() > 1.e-15) { - Standard_Real alpha = Abs(vres[k].Angle(vbound[k])); - alpha = Min(alpha, Abs(M_PI - alpha)); + Standard_Real alpha = std::abs(vres[k].Angle(vbound[k])); + alpha = std::min(alpha, std::abs(M_PI - alpha)); if (alpha > maxang) maxang = alpha; #ifdef DRAW diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_CorrectedFrenet.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_CorrectedFrenet.cxx index c8a9fc0c14..de3d78057f 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_CorrectedFrenet.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_CorrectedFrenet.cxx @@ -149,7 +149,7 @@ static void smoothlaw(Handle(Law_BSpline)& Law, tol = 0.; for (ii = 1; ii <= Param->Length() && Ok; ii++) { - d = Abs(BS->Value(Param->Value(ii)) - Points->Value(ii)); + d = std::abs(BS->Value(Param->Value(ii)) - Points->Value(ii)); if (d > tol) tol = d; Ok = (tol <= Tol); @@ -186,7 +186,7 @@ static void smoothlaw(Handle(Law_BSpline)& Law, tol = 0.; for (ii = 1; ii <= Param->Length() && Ok; ii++) { - d = Abs(BS->Value(Param->Value(ii)) - Points->Value(ii)); + d = std::abs(BS->Value(Param->Value(ii)) - Points->Value(ii)); if (d > tol) tol = d; Ok = (tol <= Tol); @@ -319,7 +319,7 @@ static Standard_Boolean FindPlane(const Handle(Adaptor3d_Curve)& theC, Handle(Ge { const gp_XYZ& xyz = TabP->Value(ii).XYZ(); dist = a * xyz.X() + b * xyz.Y() + c * xyz.Z() + d; - found = (Abs(dist) <= Precision::Confusion()); + found = (std::abs(dist) <= Precision::Confusion()); } return found; } @@ -438,7 +438,7 @@ void GeomFill_CorrectedFrenet::Init() AvStep = (myTrimmed->LastParameter() - myTrimmed->FirstParameter()) / NbStep; for (i = 1; i <= NbI; i++) { - NbStep = Max(Standard_Integer((T(i + 1) - T(i)) / AvStep), 3); + NbStep = std::max(Standard_Integer((T(i + 1) - T(i)) / AvStep), 3); Step = (T(i + 1) - T(i)) / NbStep; if (!InitInterval(T(i), T(i + 1), @@ -541,7 +541,7 @@ Standard_Boolean GeomFill_CorrectedFrenet::InitInterval(const Standard_Real { if (currParam > DLast) { - if (Abs(DLast - Param) < Precision::SquareConfusion()) + if (std::abs(DLast - Param) < Precision::SquareConfusion()) { Param = currParam; } @@ -566,7 +566,7 @@ Standard_Boolean GeomFill_CorrectedFrenet::InitInterval(const Standard_Real angleAT = CalcAngleAT(Tangent, Normal, prevTangent, prevNormal); if (isConst && i > 1) - if (Abs(angleAT) > Precision::PConfusion()) + if (std::abs(angleAT) > Precision::PConfusion()) isConst = Standard_False; angleAT += (i > 1) ? EvolAT(i - 1) : startAng; @@ -574,19 +574,23 @@ Standard_Boolean GeomFill_CorrectedFrenet::InitInterval(const Standard_Real prevNormal = Normal; if (isZero) - if (Abs(angleAT) > Precision::PConfusion()) + if (std::abs(angleAT) > Precision::PConfusion()) isZero = Standard_False; aT += Tangent; cross = Tangent.Crossed(Normal); - aN.SetLinearForm(Sin(angleAT), cross, 1 - Cos(angleAT), Tangent.Crossed(cross), Normal + aN); + aN.SetLinearForm(std::sin(angleAT), + cross, + 1 - std::cos(angleAT), + Tangent.Crossed(cross), + Normal + aN); prevTangent = Tangent; Param = currParam; i++; // Evaluate the Next step CS.D1(Param, PonC, D1); - Standard_Real L = Max(PonC.XYZ().Modulus() / 2, LengthMin); + Standard_Real L = std::max(PonC.XYZ().Modulus() / 2, LengthMin); Standard_Real norm = D1.Magnitude(); if (norm < Precision::Confusion()) { @@ -655,7 +659,7 @@ Standard_Real GeomFill_CorrectedFrenet::CalcAngleAT(const gp_Vec& Tangent, Standard_Real angle; gp_Vec Normal_rot, cross; angle = Tangent.Angle(prevTangent); - if (Abs(angle) > Precision::Angular() && Abs(angle) < M_PI - Precision::Angular()) + if (std::abs(angle) > Precision::Angular() && std::abs(angle) < M_PI - Precision::Angular()) { cross = Tangent.Crossed(prevTangent).Normalized(); Normal_rot = Normal + sin(angle) * cross.Crossed(Normal) @@ -681,7 +685,7 @@ static Standard_Real corr2PI_PI(Standard_Real Ang) static Standard_Real diffAng(Standard_Real A, Standard_Real Ao) { - Standard_Real dA = (A - Ao) - Floor((A - Ao) / 2.0 / M_PI) * 2.0 * M_PI; + Standard_Real dA = (A - Ao) - std::floor((A - Ao) / 2.0 / M_PI) * 2.0 * M_PI; return dA = dA >= 0 ? corr2PI_PI(dA) : -corr2PI_PI(-dA); } @@ -718,7 +722,7 @@ Standard_Real GeomFill_CorrectedFrenet::GetAngleAT(const Standard_Real Param) co Standard_Real DAng = CalcAngleAT(Tangent, Normal, HArrTangent->Value(iC), HArrNormal->Value(iC)); Standard_Real DA = diffAng(DAng, dAng); // The correction (there is core of OCC78 bug) - if (Abs(DA) > M_PI / 2.0) + if (std::abs(DA) > M_PI / 2.0) { AngP = AngPo + DAng; }; @@ -743,7 +747,11 @@ Standard_Boolean GeomFill_CorrectedFrenet::D0(const Standard_Real Param, // rotation around Tangent gp_Vec cross; cross = Tangent.Crossed(Normal); - Normal.SetLinearForm(Sin(angleAT), cross, (1 - Cos(angleAT)), Tangent.Crossed(cross), Normal); + Normal.SetLinearForm(std::sin(angleAT), + cross, + (1 - std::cos(angleAT)), + Tangent.Crossed(cross), + Normal); BiNormal = Tangent.Crossed(Normal); return Standard_True; @@ -770,8 +778,8 @@ Standard_Boolean GeomFill_CorrectedFrenet::D1(const Standard_Real Param, angleAT = GetAngleAT(Param); // OCC78 gp_Vec cross, dcross, tcross, dtcross, aux; - sina = Sin(angleAT); - cosa = Cos(angleAT); + sina = std::sin(angleAT); + cosa = std::cos(angleAT); cross = Tangent.Crossed(Normal); dcross.SetLinearForm(1, DTangent.Crossed(Normal), Tangent.Crossed(DNormal)); @@ -836,8 +844,8 @@ Standard_Boolean GeomFill_CorrectedFrenet::D2(const Standard_Real Param, angleAT = GetAngleAT(Param); // OCC78 gp_Vec cross, dcross, d2cross, tcross, dtcross, d2tcross, aux; - sina = Sin(angleAT); - cosa = Cos(angleAT); + sina = std::sin(angleAT); + cosa = std::cos(angleAT); cross = Tangent.Crossed(Normal); dcross.SetLinearForm(1, DTangent.Crossed(Normal), Tangent.Crossed(DNormal)); d2cross.SetLinearForm(1, @@ -1008,7 +1016,7 @@ GeomFill_Trihedron GeomFill_CorrectedFrenet::EvaluateBestMode() tmin = Int(i); tmax = Int(i + 1); Standard_Real Torsion = ComputeTorsion(tmin, myTrimmed); - if (Abs(Torsion) > MaxTorsion) + if (std::abs(Torsion) > MaxTorsion) return GeomFill_IsDiscreteTrihedron; // DiscreteTrihedron Handle(Law_Function) trimmedlaw = EvolAroundT->Trim(tmin, tmax, Precision::PConfusion() / 2); @@ -1024,7 +1032,7 @@ GeomFill_Trihedron GeomFill_CorrectedFrenet::EvaluateBestMode() if (k > 2) { Standard_Real theAngle = PrevVec.Angle(aVec); - if (Abs(theAngle) > MaxAngle) + if (std::abs(theAngle) > MaxAngle) return GeomFill_IsDiscreteTrihedron; // DiscreteTrihedron } PrevVec = aVec; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_CurveAndTrihedron.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_CurveAndTrihedron.cxx index 2892152c32..a7379b13bc 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_CurveAndTrihedron.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_CurveAndTrihedron.cxx @@ -78,7 +78,7 @@ void GeomFill_CurveAndTrihedron::SetTrsf(const gp_Mat& Transfo) WithTrans = Standard_False; // Au cas ou Trans = I for (Standard_Integer ii = 1; ii <= 3 && !WithTrans; ii++) for (Standard_Integer jj = 1; jj <= 3 && !WithTrans; jj++) - if (Abs(Aux.Value(ii, jj)) > 1.e-14) + if (std::abs(Aux.Value(ii, jj)) > 1.e-14) WithTrans = Standard_True; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_DiscreteTrihedron.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_DiscreteTrihedron.cxx index b863cd0dd5..fa92bae647 100755 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_DiscreteTrihedron.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_DiscreteTrihedron.cxx @@ -200,13 +200,13 @@ Standard_Boolean GeomFill_DiscreteTrihedron::D0(const Standard_Real Param, break; } Index = I1; - if (Abs(Param - myKnots->Value(I2)) < TolPar) + if (std::abs(Param - myKnots->Value(I2)) < TolPar) Index = I2; Standard_Real PrevParam = myKnots->Value(Index); gp_Ax2 PrevAxis = myTrihedrons->Value(Index); gp_Ax2 theAxis; - if (Abs(Param - PrevParam) < TolPar) + if (std::abs(Param - PrevParam) < TolPar) theAxis = PrevAxis; else // is between knots { diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_DraftTrihedron.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_DraftTrihedron.cxx index ac271f96de..4b4537ab32 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_DraftTrihedron.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_DraftTrihedron.cxx @@ -56,7 +56,7 @@ GeomFill_DraftTrihedron::GeomFill_DraftTrihedron(const gp_Vec& BiNormal, const S void GeomFill_DraftTrihedron::SetAngle(const Standard_Real Angle) { myAngle = M_PI / 2 + Angle; - myCos = Cos(myAngle); + myCos = std::cos(myAngle); } //======================================================================= @@ -86,7 +86,7 @@ Standard_Boolean GeomFill_DraftTrihedron::D0(const Standard_Real Param, mu = myCos; // La Normal est portee par la regle - Normal.SetLinearForm(Sqrt(1 - mu * mu), b, mu, v); + Normal.SetLinearForm(std::sqrt(1 - mu * mu), b, mu, v); // Le reste suit.... // La tangente est perpendiculaire a la normale et a la direction de depouille @@ -136,8 +136,8 @@ Standard_Boolean GeomFill_DraftTrihedron::D1(const Standard_Real Param, Standard_Real mu = myCos; - Normal.SetLinearForm(Sqrt(1 - mu * mu), b, mu, v); - DNormal.SetLinearForm(Sqrt(1 - mu * mu), db, mu, dv); + Normal.SetLinearForm(std::sqrt(1 - mu * mu), b, mu, v); + DNormal.SetLinearForm(std::sqrt(1 - mu * mu), db, mu, dv); Tangent = Normal.Crossed(B); normT = Tangent.Magnitude(); @@ -201,7 +201,7 @@ Standard_Boolean GeomFill_DraftTrihedron::D2(const Standard_Real Param, gp_Vec d2v = d2b.Crossed(T) + 2 * db.Crossed(DT) + b.Crossed(D2T); Standard_Real mu = myCos, rac; - rac = Sqrt(1 - mu * mu); + rac = std::sqrt(1 - mu * mu); Normal.SetLinearForm(rac, b, mu, v); DNormal.SetLinearForm(rac, db, mu, dv); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_EvolvedSection.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_EvolvedSection.cxx index 73eb596332..072688ba78 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_EvolvedSection.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_EvolvedSection.cxx @@ -223,7 +223,7 @@ Standard_Boolean GeomFill_EvolvedSection::IsUPeriodic() const //======================================================= Standard_Boolean GeomFill_EvolvedSection::IsVPeriodic() const { - return (Abs(myLaw->Value(First) - myLaw->Value(Last)) < Precision::Confusion()); + return (std::abs(myLaw->Value(First) - myLaw->Value(Last)) < Precision::Confusion()); } //======================================================= diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Frenet.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Frenet.cxx index 1a6b0da609..b7329ae977 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Frenet.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Frenet.cxx @@ -173,7 +173,8 @@ void GeomFill_Frenet::Init() if (IsConst->Value(i)) { - if (Abs(C.X() - C1.X()) > Tol || Abs(C.Y() - C1.Y()) > Tol || Abs(C.Z() - C1.Z()) > Tol) + if (std::abs(C.X() - C1.X()) > Tol || std::abs(C.Y() - C1.Y()) > Tol + || std::abs(C.Z() - C1.Z()) > Tol) { IsConst->ChangeValue(i) = Standard_False; } @@ -294,9 +295,9 @@ void GeomFill_Frenet::Init() { Func.D2(mySngl->Value(i), C, SnglDer, SnglDer2); if ((norm = SnglDer.Magnitude()) > gp::Resolution()) - mySnglLen->ChangeValue(i) = Min(NullTol / norm, MaxSingular); + mySnglLen->ChangeValue(i) = std::min(NullTol / norm, MaxSingular); else if ((norm = SnglDer2.Magnitude()) > gp::Resolution()) - mySnglLen->ChangeValue(i) = Min(Sqrt(2 * NullTol / norm), MaxSingular); + mySnglLen->ChangeValue(i) = std::min(std::sqrt(2 * NullTol / norm), MaxSingular); else mySnglLen->ChangeValue(i) = MaxSingular; } @@ -471,8 +472,8 @@ Standard_Boolean GeomFill_Frenet::D0(const Standard_Real theParam, u = theParam - aDelta; gp_Pnt P1, P2; - myTrimmed->D0(Min(theParam, u), P1); - myTrimmed->D0(Max(theParam, u), P2); + myTrimmed->D0(std::min(theParam, u), P1); + myTrimmed->D0(std::max(theParam, u), P2); gp_Vec V1(P1, P2); Standard_Real aDirFactor = aTn.Dot(V1); @@ -808,7 +809,7 @@ Standard_Boolean GeomFill_Frenet::IsSingular(const Standard_Real U, Standard_Int return Standard_False; for (i = 1; i <= mySngl->Length(); i++) { - if (Abs(U - mySngl->Value(i)) < mySnglLen->Value(i)) + if (std::abs(U - mySngl->Value(i)) < mySnglLen->Value(i)) { Index = i; return Standard_True; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_FunctionDraft.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_FunctionDraft.cxx index c106d3e006..8b977668e8 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_FunctionDraft.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_FunctionDraft.cxx @@ -139,9 +139,9 @@ Standard_Boolean GeomFill_FunctionDraft::DerivT(const Handle(Adaptor3d_Curve)& C C->D1(Param, P, DP); // derivee de la section - F(1) = DP.Coord(1) + W * dN.Coord(1) * Sin(teta); - F(2) = DP.Coord(2) + W * dN.Coord(2) * Sin(teta); - F(3) = DP.Coord(3) + W * dN.Coord(3) * Sin(teta); + F(1) = DP.Coord(1) + W * dN.Coord(1) * std::sin(teta); + F(2) = DP.Coord(2) + W * dN.Coord(2) * std::sin(teta); + F(3) = DP.Coord(3) + W * dN.Coord(3) * std::sin(teta); return Standard_True; } @@ -162,9 +162,9 @@ Standard_Boolean GeomFill_FunctionDraft::Deriv2T(const Handle(Adaptor3d_Curve)& C->D2(Param, P, DP, D2P); // derivee de la section - F(1) = D2P.Coord(1) + W * d2N.Coord(1) * Sin(teta); - F(2) = D2P.Coord(2) + W * d2N.Coord(2) * Sin(teta); - F(3) = D2P.Coord(3) + W * d2N.Coord(3) * Sin(teta); + F(1) = D2P.Coord(1) + W * d2N.Coord(1) * std::sin(teta); + F(2) = D2P.Coord(2) + W * d2N.Coord(2) * std::sin(teta); + F(3) = D2P.Coord(3) + W * d2N.Coord(3) * std::sin(teta); return Standard_True; } @@ -183,9 +183,9 @@ Standard_Boolean GeomFill_FunctionDraft::DerivTX(const gp_Vec& dN, Standard_Integer i; for (i = 1; i <= 3; i++) { - D(i, 1) = dN.Coord(i) * Sin(teta); // derivee / W - D(i, 2) = 0.; // derivee / U - D(i, 3) = 0.; // derivee / V + D(i, 1) = dN.Coord(i) * std::sin(teta); // derivee / W + D(i, 2) = 0.; // derivee / U + D(i, 3) = 0.; // derivee / V } return Standard_True; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_FunctionGuide.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_FunctionGuide.cxx index 2cb5bd5798..c3c83c6e67 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_FunctionGuide.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_FunctionGuide.cxx @@ -235,8 +235,8 @@ void GeomFill_FunctionGuide::DSDT(const Standard_Real U, // C origine sur l'axe de revolution // Vdir vecteur unitaire definissant la direction de l'axe de revolution // Q(v) point de parametre V sur la courbe de revolution - // OM (u,v) = OC + CQ * Cos(U) + (CQ.Vdir)(1-Cos(U)) * Vdir + - // (Vdir^CQ)* Sin(U) + // OM (u,v) = OC + CQ * std::cos(U) + (CQ.Vdir)(1-std::cos(U)) * Vdir + + // (Vdir^CQ)* std::sin(U) gp_Pnt Pc; TheCurve->D0(V, Pc); // Q(v) @@ -254,12 +254,15 @@ void GeomFill_FunctionGuide::DSDT(const Standard_Real U, gp_XYZ DVcrossCQ; DVcrossCQ.SetLinearForm(DDir.Crossed(Q), Dir.Crossed(DQ)); // Vdir^CQ - DVcrossCQ.Multiply(Sin(U)); //(Vdir^CQ)*Sin(U) + DVcrossCQ.Multiply(std::sin(U)); //(Vdir^CQ)*Sin(U) - Standard_Real CosU = Cos(U); + Standard_Real CosU = std::cos(U); gp_XYZ DVdotCQ; - DVdotCQ.SetLinearForm(DDir.Dot(Q) + Dir.Dot(DQ), Dir, Dir.Dot(Q), DDir); //(CQ.Vdir)(1-Cos(U))Vdir - DVdotCQ.Add(DVcrossCQ); // addition des composantes + DVdotCQ.SetLinearForm(DDir.Dot(Q) + Dir.Dot(DQ), + Dir, + Dir.Dot(Q), + DDir); //(CQ.Vdir)(1-std::cos(U))Vdir + DVdotCQ.Add(DVcrossCQ); // addition des composantes DQ.Multiply(CosU); DQ.Add(DVdotCQ); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_GuideTrihedronPlan.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_GuideTrihedronPlan.cxx index 2ac3ac2d51..4195dfab99 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_GuideTrihedronPlan.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_GuideTrihedronPlan.cxx @@ -61,7 +61,7 @@ static void InGoodPeriod(const Standard_Real Prec, Standard_Real& Current) { Standard_Real Diff = Current - Prec; - Standard_Integer nb = (Standard_Integer)IntegerPart(Diff / Period); + Standard_Integer nb = (Standard_Integer)std::trunc(Diff / Period); Current -= nb * Period; Diff = Current - Prec; if (Diff > Period / 2) @@ -170,7 +170,7 @@ void GeomFill_GuideTrihedronPlan::Init() if (ii > 1) { Standard_Real Diff = w - Pole->Value(1, ii - 1).Y(); - if (Abs(Diff) > DeltaG) + if (std::abs(Diff) > DeltaG) { if (myGuide->IsPeriodic()) { @@ -181,7 +181,7 @@ void GeomFill_GuideTrihedronPlan::Init() } #ifdef OCCT_DEBUG - if (Abs(Diff) > DeltaG) + if (std::abs(Diff) > DeltaG) { std::cout << "Trihedron Plan Diff on Guide : " << Diff << std::endl; } @@ -325,7 +325,7 @@ Standard_Boolean GeomFill_GuideTrihedronPlan::D1(const Standard_Real Param, /* Standard_Real h=1.e-7, e, etg, etc; E.Value(Res, e); E.Value(Res+h, etg); - if ( Abs( (etg-e)/h - dedx) > 1.e-4) { + if ( std::abs( (etg-e)/h - dedx) > 1.e-4) { std::cout << "err :" << (etg-e)/h - dedx << std::endl; } gp_Pnt pdbg; @@ -335,7 +335,7 @@ Standard_Boolean GeomFill_GuideTrihedronPlan::D1(const Standard_Real Param, GeomFill_PlanFunc Edeb(pdbg, td, myGuide); Edeb.Value(Res, etc); - if ( Abs( (etc-e)/h - dedt) > 1.e-4) { + if ( std::abs( (etc-e)/h - dedt) > 1.e-4) { std::cout << "err :" << (etc-e)/h - dedt << std::endl; } */ @@ -394,73 +394,6 @@ Standard_Boolean GeomFill_GuideTrihedronPlan::D2(const Standard_Real Param, DBiNormal, D2BiNormal); - /* - // plan ortho a Tangent pour trouver la pt Pprime sur le guide - Handle(Geom_Plane) Plan = new (Geom_Plane)(P, Tangent); - Handle(GeomAdaptor_Surface) Pl= new(GeomAdaptor_Surface)(Plan); - - - Standard_Integer Iter = 50; - // fonction dont il faut trouver la racine : G(W) - Pl(U,V)=0 - GeomFill_FunctionPipe E(Pl , myGuide); - InitX(Param); - - // resolution - math_FunctionSetRoot Result(E, X, XTol, - Inf, Sup, Iter); - if (Result.IsDone()) - { - math_Vector R(1,3); - R = Result.Root(); // solution - myTrimG->D2(R(1), PG, TG, DTG); - - gp_Vec n (P, PG); // vecteur definissant la normale du triedre - Standard_Real Norm = n.Magnitude(); - n /= Norm; - Normal = n.Normalized(); - BiNormal = Tangent.Crossed(Normal); - - - - // derivee premiere du triedre - Standard_Real dtp_dt; - dtp_dt = (To*Tangent - Norm*(n*DTangent))/(Tangent*TG); - gp_Vec dn, d2n; - dn.SetLinearForm(dtp_dt, TG, -1, To); - - DNormal.SetLinearForm(-(n*dn), n, dn); - DNormal /= Norm; - DBiNormal = Tangent.Crossed(DNormal) + DTangent.Crossed(Normal); - - // derivee seconde du triedre - Standard_Real d2tp_dt2; - d2tp_dt2 = (DTo*Tangent+To*DTangent - dn*DTangent-Norm*n*D2Tangent)/(TG*Tangent) - - (To*Tangent-Norm*n*DTangent) * (DTG*dtp_dt*Tangent+TG*DTangent) - / ((TG*Tangent)*(TG*Tangent)); - - - d2n.SetLinearForm(dtp_dt*dtp_dt, DTG, d2tp_dt2, TG, -DTo); - dn/=Norm; - d2n/=Norm; - - D2Normal.SetLinearForm(3*Pow(n*dn,2)- (dn.SquareMagnitude() + n*d2n), n, - -2*(n*dn), dn, - d2n); - - D2BiNormal.SetLinearForm(1, D2Tangent.Crossed(Normal), - 2, DTangent.Crossed(DNormal), - Tangent.Crossed(D2Normal)); - } - else {// Erreur... - #ifdef OCCT_DEBUG - std::cout << "D2 :"; - TracePlan(Plan); - #endif - myStatus = GeomFill_PlaneNotIntersectGuide; - return Standard_False; - } - */ - // return Standard_True; return Standard_False; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_LocationDraft.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_LocationDraft.cxx index 6e819937d5..9ca15aefe1 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_LocationDraft.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_LocationDraft.cxx @@ -84,7 +84,7 @@ void GeomFill_LocationDraft::SetTrsf(const gp_Mat& Transfo) WithTrans = Standard_False; // Au cas ou Trans = I for (Standard_Integer ii = 1; ii <= 3 && !WithTrans; ii++) for (Standard_Integer jj = 1; jj <= 3 && !WithTrans; jj++) - if (Abs(Aux.Value(ii, jj)) > 1.e-14) + if (std::abs(Aux.Value(ii, jj)) > 1.e-14) WithTrans = Standard_True; } @@ -152,7 +152,7 @@ void GeomFill_LocationDraft::Prepare() myLaw->D0(t, T, N, B); // Generatrice - D = Cos(myAngle) * B + Sin(myAngle) * N; + D = std::cos(myAngle) * B + std::sin(myAngle) * N; L = new (Geom_Line)(P, D); @@ -245,7 +245,7 @@ Standard_Boolean GeomFill_LocationDraft::D0(const Standard_Real Param, { // la generatrice intersecte la surface d'arret // la generatrice - D = Cos(myAngle) * B + Sin(myAngle) * N; + D = std::cos(myAngle) * B + std::sin(myAngle) * N; Handle(Geom_Line) L = new (Geom_Line)(P, D); Handle(GeomAdaptor_Curve) G = new (GeomAdaptor_Curve)(L); @@ -360,7 +360,7 @@ Standard_Boolean GeomFill_LocationDraft::D1(const Standard_Real Param, if (Intersec == Standard_True) { // la generatrice intersecte la surface d'arret // la generatrice - D = Cos(myAngle) * B + Sin(myAngle) * N; + D = std::cos(myAngle) * B + std::sin(myAngle) * N; Handle(Geom_Line) L = new (Geom_Line)(P, D); Handle(GeomAdaptor_Curve) G = new (GeomAdaptor_Curve)(L); @@ -497,7 +497,7 @@ Standard_Boolean GeomFill_LocationDraft::D2(const Standard_Real Param, { // la generatrice intersecte la surface d'arret // la generatrice - D = Cos(myAngle) * B + Sin(myAngle) * N; + D = std::cos(myAngle) * B + std::sin(myAngle) * N; Handle(Geom_Line) L = new (Geom_Line)(P, D); Handle(GeomAdaptor_Curve) G = new (GeomAdaptor_Curve)(L); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_LocationGuide.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_LocationGuide.cxx index 44522579bd..34c3af9f54 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_LocationGuide.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_LocationGuide.cxx @@ -141,7 +141,7 @@ static void InGoodPeriod(const Standard_Real Prec, Standard_Real& Current) { Standard_Real Diff = Current - Prec; - Standard_Integer nb = (Standard_Integer)IntegerPart(Diff / Period); + Standard_Integer nb = (Standard_Integer)std::trunc(Diff / Period); Current -= nb * Period; Diff = Current - Prec; if (Diff > Period / 2) @@ -399,7 +399,7 @@ void GeomFill_LocationGuide::SetRotation(const Standard_Real PrecAngle, Standard jref = j; } } - MinDist = Sqrt(MinDist); + MinDist = std::sqrt(MinDist); DistMini.Points(jref, Pc, Ps); Ps.Parameter(theU, theV); @@ -414,7 +414,7 @@ void GeomFill_LocationGuide::SetRotation(const Standard_Real PrecAngle, Standard if (ii > 1) { Diff = w - myPoles2d->Value(1, ii - 1).Y(); - if (Abs(Diff) > DeltaG) + if (std::abs(Diff) > DeltaG) { if (myGuide->IsPeriodic()) { @@ -424,7 +424,7 @@ void GeomFill_LocationGuide::SetRotation(const Standard_Real PrecAngle, Standard } #ifdef OCCT_DEBUG - if (Abs(Diff) > DeltaG) + if (std::abs(Diff) > DeltaG) { std::cout << "Location :: Diff on Guide : " << Diff << std::endl; } @@ -436,13 +436,13 @@ void GeomFill_LocationGuide::SetRotation(const Standard_Real PrecAngle, Standard if (ii > 1) { Diff = Angle - OldAngle; - if (Abs(Diff) > M_PI) + if (std::abs(Diff) > M_PI) { InGoodPeriod(OldAngle, 2 * M_PI, Angle); Diff = Angle - OldAngle; } #ifdef OCCT_DEBUG - if (Abs(Diff) > M_PI / 4) + if (std::abs(Diff) > M_PI / 4) { std::cout << "Diff d'angle trop grand !!" << std::endl; } @@ -460,7 +460,7 @@ void GeomFill_LocationGuide::SetRotation(const Standard_Real PrecAngle, Standard } Diff = v - myPoles2d->Value(2, ii - 1).Y(); #ifdef OCCT_DEBUG - if (Abs(Diff) > (Ul - Uf) / (2 + NbKnots)) + if (std::abs(Diff) > (Ul - Uf) / (2 + NbKnots)) { std::cout << "Diff sur section trop grand !!" << std::endl; } @@ -573,7 +573,7 @@ void GeomFill_LocationGuide::SetTrsf(const gp_Mat& Transfo) WithTrans = Standard_False; // Au cas ou Trans = I for (Standard_Integer ii = 1; ii <= 3 && !WithTrans; ii++) for (Standard_Integer jj = 1; jj <= 3 && !WithTrans; jj++) - if (Abs(Aux.Value(ii, jj)) > 1.e-14) + if (std::abs(Aux.Value(ii, jj)) > 1.e-14) WithTrans = Standard_True; } @@ -845,13 +845,13 @@ Standard_Boolean GeomFill_LocationGuide::D1(const Standard_Real Param, Standard_Real Aprim = DSDT(2); #ifdef OCCT_DEBUG - gp_Mat M2 (Cos(A), -Sin(A),0, // rotation autour de T - Sin(A), Cos(A),0, + gp_Mat M2 (std::cos(A), -std::sin(A),0, // rotation autour de T + std::sin(A), std::cos(A),0, 0,0,1); #endif - gp_Mat M2prim (-Sin(A), -Cos(A), 0, // derivee rotation autour de T - Cos(A), -Sin(A), 0, + gp_Mat M2prim (-std::sin(A), -std::cos(A), 0, // derivee rotation autour de T + std::cos(A), -std::sin(A), 0, 0, 0, 0); M2prim.Multiply(Aprim); @@ -1065,16 +1065,16 @@ Standard_Boolean GeomFill_LocationGuide::D2( Standard_Real Aprim = DSDT(2); Standard_Real Asec = D2SDT2(2); - gp_Mat M2 (Cos(A),-Sin(A),0, // rotation autour de T - Sin(A), Cos(A),0, + gp_Mat M2 (std::cos(A),-std::sin(A),0, // rotation autour de T + std::sin(A), std::cos(A),0, 0, 0, 1); - gp_Mat M2prim (-Sin(A),-Cos(A),0, // derivee 1ere rotation autour de T - Cos(A), -Sin(A),0, + gp_Mat M2prim (-std::sin(A),-std::cos(A),0, // derivee 1ere rotation autour de T + std::cos(A), -std::sin(A),0, 0,0,0); - gp_Mat M2sec (-Cos(A), Sin(A), 0, // derivee 2nde rotation autour de T - -Sin(A), -Cos(A), 0, + gp_Mat M2sec (-std::cos(A), std::sin(A), 0, // derivee 2nde rotation autour de T + -std::sin(A), -std::cos(A), 0, 0,0,0); M2sec.Multiply(Aprim*Aprim); gp_Mat M2p = M2prim.Multiplied(Asec); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_NSections.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_NSections.cxx index aa431f29bf..ccdcee8217 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_NSections.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_NSections.cxx @@ -73,7 +73,7 @@ static Standard_Boolean verifD1(const TColgp_Array1OfPnt& P1, for (ii = 1; ii <= L; ii++) { dw = (W2(ii) - W1(ii)) / pas; - if (Abs(dw - DWeights(ii)) > wTol) + if (std::abs(dw - DWeights(ii)) > wTol) { if (Affich) { @@ -119,7 +119,7 @@ static Standard_Boolean verifD2(const TColgp_Array1OfVec& DP1, { Standard_Real dw1 = DW1(ii), dw2 = DW2(ii); d2w = (dw2 - dw1) / pas; - if (Abs(d2w - D2Weights(ii)) > wTol) + if (std::abs(d2w - D2Weights(ii)) > wTol) { if (Affich) { @@ -654,14 +654,14 @@ void GeomFill_NSections::ComputeSurface() Ui2 = ULast; Standard_Integer i1, i2; myRefSurf->LocateU(Ui1, Precision::PConfusion(), i1, i2); - if (Abs(Ui1 - myRefSurf->UKnot(i1)) <= Precision::PConfusion()) + if (std::abs(Ui1 - myRefSurf->UKnot(i1)) <= Precision::PConfusion()) Ui1 = myRefSurf->UKnot(i1); - if (Abs(Ui1 - myRefSurf->UKnot(i2)) <= Precision::PConfusion()) + if (std::abs(Ui1 - myRefSurf->UKnot(i2)) <= Precision::PConfusion()) Ui1 = myRefSurf->UKnot(i2); myRefSurf->LocateU(Ui2, Precision::PConfusion(), i1, i2); - if (Abs(Ui2 - myRefSurf->UKnot(i1)) <= Precision::PConfusion()) + if (std::abs(Ui2 - myRefSurf->UKnot(i1)) <= Precision::PConfusion()) Ui2 = myRefSurf->UKnot(i1); - if (Abs(Ui2 - myRefSurf->UKnot(i2)) <= Precision::PConfusion()) + if (std::abs(Ui2 - myRefSurf->UKnot(i2)) <= Precision::PConfusion()) Ui2 = myRefSurf->UKnot(i2); V0 = myRefSurf->VKnot(myRefSurf->FirstVKnotIndex()); V1 = myRefSurf->VKnot(myRefSurf->LastVKnotIndex()); @@ -930,7 +930,7 @@ Standard_Boolean GeomFill_NSections::IsConstant(Standard_Real& Error) const Standard_Real Tol = 1.e-7; Standard_Boolean samedir, samerad, samepos; samedir = (C1.Axis().IsParallel(C2.Axis(), 1.e-4)); - samerad = (Abs(C1.Radius() - C2.Radius()) < Tol); + samerad = (std::abs(C1.Radius() - C2.Radius()) < Tol); samepos = (C1.Location().Distance(C2.Location()) < Tol); if (!samepos) { @@ -948,7 +948,7 @@ Standard_Boolean GeomFill_NSections::IsConstant(Standard_Real& Error) const samedir = (L1.Direction().IsParallel(L2.Direction(), 1.e-4)); gp_Pnt P11 = AC1.Value(AC1.FirstParameter()), P12 = AC1.Value(AC1.LastParameter()), P21 = AC2.Value(AC2.FirstParameter()), P22 = AC2.Value(AC2.LastParameter()); - samelength = (Abs(P11.Distance(P12) - P21.Distance(P22)) < Tol); + samelength = (std::abs(P11.Distance(P12) - P21.Distance(P22)) < Tol); // l'ecart entre les 2 sections ne compte pas samepos = ((P11.Distance(P21) < Tol && P12.Distance(P22) < Tol) || (P12.Distance(P21) < Tol && P11.Distance(P22) < Tol)); @@ -1006,7 +1006,7 @@ Standard_Boolean GeomFill_NSections::IsConicalLaw(Standard_Real& Error) const // formule plus generale pour 3 sections au moins // Standard_Real param0 = C2.Radius()*myParams(1) - C1.Radius()*myParams(2); // param0 = param0 / (C2.Radius()-C1.Radius()) ; - // linearrad = ( Abs( C3.Radius()*myParams(1)-C1.Radius()*myParams(3) + // linearrad = ( std::abs( C3.Radius()*myParams(1)-C1.Radius()*myParams(3) // - param0*(C3.Radius()-C1.Radius()) ) < Tol); if (isconic) { @@ -1025,8 +1025,8 @@ Standard_Boolean GeomFill_NSections::IsConicalLaw(Standard_Real& Error) const //// Modified by jgv, 18.02.2009 for OCC20866 //// Standard_Real first1 = AC1.FirstParameter(), last1 = AC1.LastParameter(); Standard_Real first2 = AC2.FirstParameter(), last2 = AC2.LastParameter(); - isconic = (Abs(first1 - first2) <= Precision::PConfusion() - && Abs(last1 - last2) <= Precision::PConfusion()); + isconic = (std::abs(first1 - first2) <= Precision::PConfusion() + && std::abs(last1 - last2) <= Precision::PConfusion()); ////////////////////////////////////////////////// } } @@ -1061,7 +1061,7 @@ Handle(Geom_Curve) GeomFill_NSections::CirclSection(const Standard_Real V) const const Standard_Real aParL = AC1.LastParameter(); const Standard_Real aPeriod = AC1.IsPeriodic() ? AC1.Period() : 0.0; - if ((aPeriod == 0.0) || (Abs(aParL - aParF - aPeriod) > Precision::PConfusion())) + if ((aPeriod == 0.0) || (std::abs(aParL - aParF - aPeriod) > Precision::PConfusion())) { Handle(Geom_Curve) Cbis = new Geom_TrimmedCurve(C, aParF, aParL); C = Cbis; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Pipe.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Pipe.cxx index 2362174ee4..9ed1cfeadc 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Pipe.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Pipe.cxx @@ -90,7 +90,7 @@ static Standard_Boolean CheckSense(const TColGeom_SequenceOfCurve& Seq1, Standard_Real f = C1->FirstParameter(), l = C1->LastParameter(); Standard_Integer iP, NP = 21; TColgp_Array1OfPnt Tab(1, NP); - Standard_Real u = f, h = Abs(f - l) / 20.; + Standard_Real u = f, h = std::abs(f - l) / 20.; for (iP = 1; iP <= NP; iP++) { C1->D0(u, Tab(iP)); @@ -163,12 +163,12 @@ static Standard_Boolean CheckSense(const TColGeom_SequenceOfCurve& Seq1, // meme sens ? Standard_Boolean ok = Standard_True, - pasnul1 = (Abs(alpha1) > Precision::Confusion()) - && (Abs(beta1) > Precision::Confusion()), - pasnul2 = (Abs(alpha2) > Precision::Confusion()) - && (Abs(beta2) > Precision::Confusion()), - pasnul3 = (Abs(alpha3) > Precision::Confusion()) - && (Abs(beta3) > Precision::Confusion()); + pasnul1 = (std::abs(alpha1) > Precision::Confusion()) + && (std::abs(beta1) > Precision::Confusion()), + pasnul2 = (std::abs(alpha2) > Precision::Confusion()) + && (std::abs(beta2) > Precision::Confusion()), + pasnul3 = (std::abs(alpha3) > Precision::Confusion()) + && (std::abs(beta3) > Precision::Confusion()); if (pasnul1 && pasnul2 && pasnul3) { if (alpha1 * beta1 > 0.0) @@ -681,7 +681,7 @@ void GeomFill_Pipe::Init(const Handle(Geom_Curve)& Path, const TColGeom_Sequence } for (i = 1; i < NSections.Length(); i++) { - if (Abs(SeqP.Value(i + 1) - SeqP.Value(i)) < Precision::PConfusion()) + if (std::abs(SeqP.Value(i + 1) - SeqP.Value(i)) < Precision::PConfusion()) { throw Standard_ConstructionError("GeomFill_Pipe::Init with NSections : invalid parameters"); } @@ -911,7 +911,7 @@ Standard_Boolean GeomFill_Pipe::KPartT4() Standard_Real L0 = myAdpPath->LastParameter() - myAdpPath->FirstParameter(); Standard_Real L1 = myAdpFirstSect->LastParameter() - myAdpFirstSect->FirstParameter(); Standard_Real L2 = myAdpLastSect->LastParameter() - myAdpLastSect->FirstParameter(); - if (Abs(L1 - L0) > Precision::Confusion() || Abs(L2 - L0) > Precision::Confusion()) + if (std::abs(L1 - L0) > Precision::Confusion() || std::abs(L2 - L0) > Precision::Confusion()) { return Ok; } @@ -922,7 +922,8 @@ Standard_Boolean GeomFill_Pipe::KPartT4() gp_Pnt P2 = myAdpLastSect->Value(myAdpLastSect->FirstParameter()); gp_Dir V1(gp_Vec(P0, P1)); gp_Dir V2(gp_Vec(P0, P2)); - if (Abs(V1.Dot(D0)) > Precision::Confusion() || Abs(V2.Dot(D0)) > Precision::Confusion()) + if (std::abs(V1.Dot(D0)) > Precision::Confusion() + || std::abs(V2.Dot(D0)) > Precision::Confusion()) return Ok; // the result is a cylindrical surface. @@ -956,7 +957,8 @@ Standard_Boolean GeomFill_Pipe::KPartT4() Standard_Real Alp1 = myAdpFirstSect->FirstParameter() - myAdpFirstSect->LastParameter(); Standard_Real Alp2 = myAdpLastSect->FirstParameter() - myAdpLastSect->LastParameter(); - if (Abs(Alp0 - Alp1) > Precision::Angular() || Abs(Alp0 - Alp2) > Precision::Angular()) + if (std::abs(Alp0 - Alp1) > Precision::Angular() + || std::abs(Alp0 - Alp2) > Precision::Angular()) return Ok; gp_Ax2 A0 = myAdpPath->Circle().Position(); @@ -984,7 +986,8 @@ Standard_Boolean GeomFill_Pipe::KPartT4() gp_Dir V2(gp_Vec(P0, P2)); gp_Circ Ci = myAdpPath->Circle(); gp_Vec YRef = ElCLib::CircleDN(myAdpPath->FirstParameter(), A0, Ci.Radius(), 1); - if (Abs(V1.Dot(YRef)) > Precision::Confusion() || Abs(V2.Dot(YRef)) > Precision::Confusion()) + if (std::abs(V1.Dot(YRef)) > Precision::Confusion() + || std::abs(V2.Dot(YRef)) > Precision::Confusion()) return Ok; // OK it`s a Toroidal Surface !! OUF !! diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_PolynomialConvertor.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_PolynomialConvertor.cxx index 25545febe5..e2c19879a7 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_PolynomialConvertor.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_PolynomialConvertor.cxx @@ -80,9 +80,9 @@ void GeomFill_PolynomialConvertor::Init() for (ii = 1; ii <= Ordre; ii++) { terme = Poles1d->Value(ii, jj); - if (Abs(terme - 1) < 1.e-9) + if (std::abs(terme - 1) < 1.e-9) terme = 1; // petite retouche - if (Abs(terme + 1) < 1.e-9) + if (std::abs(terme + 1) < 1.e-9) terme = -1; B(ii, jj) = terme; } @@ -107,7 +107,7 @@ void GeomFill_PolynomialConvertor::Section(const gp_Pnt& FirstPnt, math_Vector Vx(1, Ordre), Vy(1, Ordre); math_Vector Px(1, Ordre), Py(1, Ordre); Standard_Integer ii; - Standard_Real Cos_b = Cos(Angle), Sin_b = Sin(Angle); + Standard_Real Cos_b = std::cos(Angle), Sin_b = std::sin(Angle); Standard_Real beta, beta2, beta3; gp_Vec V1(Center, FirstPnt), V2; V2 = Dir ^ V1; @@ -163,7 +163,7 @@ void GeomFill_PolynomialConvertor::Section(const gp_Pnt& FirstPnt, math_Vector Vx(1, Ordre), Vy(1, Ordre), DVx(1, Ordre), DVy(1, Ordre); math_Vector Px(1, Ordre), Py(1, Ordre), DPx(1, Ordre), DPy(1, Ordre); Standard_Integer ii; - Standard_Real Cos_b = Cos(Angle), Sin_b = Sin(Angle); + Standard_Real Cos_b = std::cos(Angle), Sin_b = std::sin(Angle); Standard_Real beta, beta2, beta3, bprim; gp_Vec V1(Center, FirstPnt), V1Prim, V2; V2 = Dir ^ V1; @@ -255,7 +255,7 @@ void GeomFill_PolynomialConvertor::Section(const gp_Pnt& FirstPnt, D2Py(1, Ordre); Standard_Integer ii; - Standard_Real aux, Cos_b = Cos(Angle), Sin_b = Sin(Angle); + Standard_Real aux, Cos_b = std::cos(Angle), Sin_b = std::sin(Angle); Standard_Real beta, beta2, beta3, bprim, bprim2, bsecn; gp_Vec V1(Center, FirstPnt), V1Prim, V1Secn, V2; V2 = Dir ^ V1; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Profiler.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Profiler.cxx index 62ffcef877..8672453724 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Profiler.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Profiler.cxx @@ -185,7 +185,7 @@ void GeomFill_Profiler::Perform(const Standard_Real PTol) } // evaluate the max degree - myDegree = Max(myDegree, C->Degree()); + myDegree = std::max(myDegree, C->Degree()); // Calcul de Max ( Ufin - Udeb) sur l ensemble des courbes. if ((U2 - U1) > EcartMax) diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_QuasiAngularConvertor.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_QuasiAngularConvertor.cxx index 30de0aaa78..edf94a9416 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_QuasiAngularConvertor.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_QuasiAngularConvertor.cxx @@ -26,7 +26,7 @@ #define NullAngle 1.e-6 -// QuasiAngular is rational definition of Cos(theta(t) and sin(theta) +// QuasiAngular is rational definition of std::cos(theta(t) and sin(theta) // on [-alpha, +alpha] with // 2 2 // U - V @@ -98,9 +98,9 @@ void GeomFill_QuasiAngularConvertor::Init() for (ii = 1; ii <= Ordre; ii++) { terme = Poles1d->Value(ii, jj); - if (Abs(terme - 1) < 1.e-9) + if (std::abs(terme - 1) < 1.e-9) terme = 1; // petite retouche - if (Abs(terme + 1) < 1.e-9) + if (std::abs(terme + 1) < 1.e-9) terme = -1; B(ii, jj) = terme; } @@ -148,7 +148,7 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt, if ((M_PI / 2 - beta) > NullAngle) { - if (Abs(beta) < NullAngle) + if (std::abs(beta) < NullAngle) { Standard_Real cf = 2.0 / (3 * 5 * 7); b = -(0.2 + cf * beta2) / (1 + 0.2 * beta2); @@ -156,7 +156,7 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt, } else { - tan_b = Tan(beta); + tan_b = std::tan(beta); b = -1.0e0 / beta2; b += beta / (3 * (tan_b - beta)); } @@ -232,8 +232,8 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt, // La derive s'ecrit donc : // AngPrim * (sin(Ang)*D*D + cos(Ang)*D) // + sin(Ang)*DPrim + (1. - cos(Ang)) *(DPrim*D + D*DPrim) - Sina = Sin(Angle / 2); - Cosa = Cos(Angle / 2); + Sina = std::sin(Angle / 2); + Cosa = std::cos(Angle / 2); D.SetCross(Dir.XYZ()); DPrim.SetCross(DDir.XYZ()); @@ -263,7 +263,7 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt, beta5 = beta3 * beta2; beta6 = beta3 * beta3; - if (Abs(beta) < NullAngle) + if (std::abs(beta) < NullAngle) { // On calcul b par D.L Standard_Real cf = 2.0 / (3 * 5 * 7); @@ -279,7 +279,7 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt, bpr = (2 * betaprim) / beta3; if ((M_PI / 2 - beta) > NullAngle) { - tan_b = Tan(beta); + tan_b = std::tan(beta); dtan_b = betaprim * (1 + tan_b * tan_b); b2 = tan_b - beta; b += beta / (3 * b2); @@ -388,8 +388,8 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt, // La derive s'ecrit donc : // AngPrim * (sin(Ang)*D*D + cos(Ang)*D) // + sin(Ang)*DPrim + (1. - cos(Ang)) *(DPrim*D + D*DPrim) - Sina = Sin(Angle / 2); - Cosa = Cos(Angle / 2); + Sina = std::sin(Angle / 2); + Cosa = std::cos(Angle / 2); D.SetCross(Dir.XYZ()); DPrim.SetCross(DDir.XYZ()); DSecn.SetCross(D2Dir.XYZ()); @@ -453,7 +453,7 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt, beta6 = beta3 * beta3; betaprim2 = betaprim * betaprim; - if (Abs(beta) < NullAngle) + if (std::abs(beta) < NullAngle) { // On calcul b par D.L Standard_Real cf = -2.0 / 21; @@ -472,7 +472,7 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt, bsc = (2 * betasecn - 6 * betaprim * (betaprim / beta)) / beta3; if ((M_PI / 2 - beta) > NullAngle) { - tan_b = Tan(beta); + tan_b = std::tan(beta); dtan_b = betaprim * (1 + tan_b * tan_b); d2tan_b = betasecn * (1 + tan_b * tan_b) + 2 * betaprim * tan_b * dtan_b; b2 = tan_b - beta; @@ -558,7 +558,7 @@ void GeomFill_QuasiAngularConvertor::Section(const gp_Pnt& FirstPnt, D2P.SetCoord(D2Px(ii) / wi, D2Py(ii) / wi, 0); D2P -= 2 * (dwi / wi) * DP; - D2P += (2 * Pow(dwi / wi, 2) - D2W(ii) / wi) * P; + D2P += (2 * std::pow(dwi / wi, 2) - D2W(ii) / wi) * P; DP -= (DW(ii) / wi) * P; Poles(ii).ChangeCoord() = M * P + Center.XYZ(); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_SectionPlacement.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_SectionPlacement.cxx index 741726c8c4..510c41d13c 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_SectionPlacement.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_SectionPlacement.cxx @@ -73,9 +73,9 @@ static Standard_Real Penalite(const Standard_Real angle, const Standard_Real dis Standard_Real penal; if (dist < 1) - penal = Sqrt(dist); + penal = std::sqrt(dist); else if (dist < 2) - penal = Pow(dist, 2); + penal = std::pow(dist, 2); else penal = dist + 2; @@ -185,7 +185,7 @@ GeomFill_SectionPlacement::GeomFill_SectionPlacement(const Handle(GeomFill_Locat Standard_Real DX = aXmax - aXmin; Standard_Real DY = aYmax - aYmin; Standard_Real DZ = aZmax - aZmin; - Gabarit = Sqrt(DX * DX + DY * DY + DZ * DZ) / 2.; + Gabarit = std::sqrt(DX * DX + DY * DY + DZ * DZ) / 2.; Gabarit += Precision::Confusion(); // Cas des toute petite @@ -252,11 +252,11 @@ GeomFill_SectionPlacement::GeomFill_SectionPlacement(const Handle(GeomFill_Locat aCurve = (Handle(Geom_TrimmedCurve)::DownCast(aCurve))->BasisCurve(); Standard_Real Ufirst = aCurve->FirstParameter(); Standard_Real aPeriod = aCurve->Period(); - Standard_Real U1 = Ufirst + Floor((first - Ufirst) / aPeriod) * aPeriod; + Standard_Real U1 = Ufirst + std::floor((first - Ufirst) / aPeriod) * aPeriod; Standard_Real U2 = U1 + aPeriod; - if (Abs(first - U1) <= Precision::PConfusion()) + if (std::abs(first - U1) <= Precision::PConfusion()) first = U1; - if (Abs(last - U2) <= Precision::PConfusion()) + if (std::abs(last - U2) <= Precision::PConfusion()) last = U2; } Standard_Real t, delta; @@ -411,13 +411,13 @@ void GeomFill_SectionPlacement::Perform(const Handle(Adaptor3d_Curve)& Path, // (1.1) Distances Point-Plan Standard_Real DistPlan; gp_Vec V1(PonPath, TheAxe.Location()); - DistPlan = Abs(V1.Dot(VRef)); + DistPlan = std::abs(V1.Dot(VRef)); if (DistPlan <= IntTol) DistCenter = V1.Magnitude(); gp_Pnt Plast = Path->Value(Path->LastParameter()); V1.SetXYZ(TheAxe.Location().XYZ() - Plast.XYZ()); - DistPlan = Abs(V1.Dot(VRef)); + DistPlan = std::abs(V1.Dot(VRef)); if (DistPlan <= IntTol) { Standard_Real aDist = V1.Magnitude(); @@ -462,8 +462,8 @@ void GeomFill_SectionPlacement::Perform(const Handle(Adaptor3d_Curve)& Path, Standard_Real firstDistance = plane.SquareDistance(firstPoint); Standard_Real lastDistance = plane.SquareDistance(lastPoint); - if (((Abs(firstDistance) < Precision::SquareConfusion()) - && Abs(lastDistance) < Precision::SquareConfusion()) + if (((std::abs(firstDistance) < Precision::SquareConfusion()) + && std::abs(lastDistance) < Precision::SquareConfusion()) || firstDistance < lastDistance) { PathParam = Path->FirstParameter(); @@ -492,13 +492,13 @@ void GeomFill_SectionPlacement::Perform(const Handle(Adaptor3d_Curve)& Path, // (1.1) Distances Point-Plan Standard_Real DistPlan; gp_Vec V1 (PonPath, TheAxe.Location()); - DistPlan = Abs(V1.Dot(VRef)); + DistPlan = std::abs(V1.Dot(VRef)); // On examine l'autre extremite gp_Pnt P; Tangente(Path->Curve(), Path->LastParameter(), P, dp1); V1.SetXYZ(TheAxe.Location().XYZ()-P.XYZ()); - if (Abs(V1.Dot(VRef)) <= DistPlan ) { // On prend l'autre extremite + if (std::abs(V1.Dot(VRef)) <= DistPlan ) { // On prend l'autre extremite alpha = M_PI/2 - EvalAngle(VRef, dp1); distaux = PonPath.Distance(PonSec); if (distaux > Tol) { @@ -921,7 +921,7 @@ Standard_Boolean GeomFill_SectionPlacement::Choix(const Standard_Real dist, return Standard_True; // (2) si l'ecart en distance est de l'ordre du gabarit - if (Abs(evoldist) < Gabarit) + if (std::abs(evoldist) < Gabarit) { // (2.1) si le gain en angle est important on garde if (evolangle > 0.5) diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Sweep.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Sweep.cxx index d5598b28d4..cbf9943f8d 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Sweep.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_Sweep.cxx @@ -587,7 +587,7 @@ Standard_Boolean GeomFill_Sweep::BuildKPart() gp_Mat M; Standard_Real levier, error = 0; Standard_Real UFirst = 0, VFirst = First, ULast = 0, VLast = Last; - Standard_Real Tol = Min(Tol3d, BoundTol); + Standard_Real Tol = std::min(Tol3d, BoundTol); // (1) Trajectoire Rectilignes ------------------------- if (myLoc->IsTranslation(error)) @@ -647,8 +647,8 @@ Standard_Boolean GeomFill_Sweep::BuildKPart() L.Transform(Tf2); DS.SetXYZ(L.Position().Direction().XYZ()); DS.Normalize(); - levier = Abs(DS.Dot(DP)); - SError = error + levier * Abs(Last - First); + levier = std::abs(DS.Dot(DP)); + SError = error + levier * std::abs(Last - First); if (SError <= Tol) { Ok = Standard_True; @@ -669,8 +669,8 @@ Standard_Boolean GeomFill_Sweep::BuildKPart() DS.SetXYZ(C.Position().Direction().XYZ()); DS.Normalize(); - levier = Abs(DS.CrossMagnitude(DP)) * C.Radius(); - SError = levier * Abs(Last - First); + levier = std::abs(DS.CrossMagnitude(DP)) * C.Radius(); + SError = levier * std::abs(Last - First); if (SError <= TolProd) { Ok = Standard_True; @@ -760,8 +760,8 @@ Standard_Boolean GeomFill_Sweep::BuildKPart() gp_Ax3 Axis(Centre0, Dir, N); S = new (Geom_ConicalSurface)(Axis, Angle, C.Radius()); // Calcul du glissement parametrique - VFirst = First / Cos(Angle); - VLast = Last / Cos(Angle); + VFirst = First / std::cos(Angle); + VLast = Last / std::cos(Angle); // Bornes en U UFirst = AC.FirstParameter(); @@ -794,7 +794,7 @@ Standard_Boolean GeomFill_Sweep::BuildKPart() { // La trajectoire gp_Pnt Centre; - isVPeriodic = (Abs(Last - First - 2 * M_PI) < 1.e-15); + isVPeriodic = (std::abs(Last - First - 2 * M_PI) < 1.e-15); Standard_Real RotRadius; gp_Vec DP, DS, DN; myLoc->D0(0.1, M, DS); @@ -866,10 +866,10 @@ Standard_Boolean GeomFill_Sweep::BuildKPart() gp_Vec NC; NC.SetXYZ(C.Position().Direction().XYZ()); NC.Normalize(); - error = Abs(NC.Dot(DN)); + error = std::abs(NC.Dot(DN)); // Puis on evalue l'erreur commise sur la section, // en pivotant son plan ( pour contenir l'axe de rotation) - error += Abs(NC.Dot(DS)); + error += std::abs(NC.Dot(DS)); error *= C.Radius(); if (error <= Tol) { @@ -910,7 +910,8 @@ Standard_Boolean GeomFill_Sweep::BuildKPart() isUReversed = Standard_True; } - if (Abs(l - f) <= Precision::PConfusion() || Abs(UlastOnSec - UfirstOnSec) > M_PI_2) + if (std::abs(l - f) <= Precision::PConfusion() + || std::abs(UlastOnSec - UfirstOnSec) > M_PI_2) { // l == f - "degenerated" surface // UlastOnSec - UfirstOnSec > M_PI_2 - "twisted" surface, @@ -964,7 +965,7 @@ Standard_Boolean GeomFill_Sweep::BuildKPart() myExchUV = Standard_True; // Attention l'arete de couture dans le cas periodique // n'est peut etre pas a la bonne place... - if (isUPeriodic && Abs(UFirst) > Precision::PConfusion()) + if (isUPeriodic && std::abs(UFirst) > Precision::PConfusion()) isUPeriodic = Standard_False; // Pour trimmer la surface... Ok = Standard_True; } @@ -981,9 +982,9 @@ Standard_Boolean GeomFill_Sweep::BuildKPart() L.Transform(Tf2); gp_Vec DL; DL.SetXYZ(L.Direction().XYZ()); - levier = Max(Abs(AC.FirstParameter()), AC.LastParameter()); + levier = std::max(std::abs(AC.FirstParameter()), AC.LastParameter()); // si la line est ortogonale au cercle de rotation - SError = error + levier * Abs(DL.Dot(DP)); + SError = error + levier * std::abs(DL.Dot(DP)); if (SError <= Tol) { Standard_Boolean reverse; @@ -1020,7 +1021,7 @@ Standard_Boolean GeomFill_Sweep::BuildKPart() else { // On evalue l'angle du cone - Standard_Real Angle = Abs(Dir.Angle(L)); + Standard_Real Angle = std::abs(Dir.Angle(L)); if (Angle > M_PI / 2) Angle = M_PI - Angle; if (reverse) @@ -1030,7 +1031,7 @@ Standard_Boolean GeomFill_Sweep::BuildKPart() { Angle = -Angle; } - if (Abs(Abs(Angle) - M_PI / 2) > 0.01) + if (std::abs(std::abs(Angle) - M_PI / 2) > 0.01) { // (2.2.b) Cone // si les 2 droites ne sont pas orthogonales diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_SweepSectionGenerator.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_SweepSectionGenerator.cxx index 3204ff8033..6805832f45 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_SweepSectionGenerator.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomFill/GeomFill_SweepSectionGenerator.cxx @@ -507,7 +507,7 @@ Standard_Boolean GeomFill_SweepSectionGenerator::Section(const Standard_Integer if (DPoles(i).Magnitude() > Epsilon(1.)) { DPoles(i).Normalize(); - DPoles(i) *= Sqrt(x * x + y * y); + DPoles(i) *= std::sqrt(x * x + y * y); } } } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS_1.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS_1.cxx index d08caa9818..34968886ac 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS_1.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_IntSS_1.cxx @@ -447,7 +447,7 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index, { myLConstruct.Part(i, fprm, lprm); // - if (Abs(fprm) > aRealEpsilon || Abs(lprm - aPeriod) > aRealEpsilon) + if (std::abs(fprm) > aRealEpsilon || std::abs(lprm - aPeriod) > aRealEpsilon) { //============================================== Handle(Geom_TrimmedCurve) aTC3D = new Geom_TrimmedCurve(newc, fprm, lprm); @@ -487,14 +487,14 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index, slineS2.Append(H1); } //============================================== - } // if (Abs(fprm) > RealEpsilon() || Abs(lprm-2.*M_PI) > RealEpsilon()) + } // if (std::abs(fprm) > RealEpsilon() || std::abs(lprm-2.*M_PI) > RealEpsilon()) // else { // on regarde si on garde // if (aNbParts == 1) { - if (Abs(fprm) < RealEpsilon() && Abs(lprm - 2. * M_PI) < RealEpsilon()) + if (std::abs(fprm) < RealEpsilon() && std::abs(lprm - 2. * M_PI) < RealEpsilon()) { Handle(Geom_TrimmedCurve) aTC3D = new Geom_TrimmedCurve(newc, fprm, lprm); // @@ -919,9 +919,9 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index, Check.FixTangent(Standard_True, Standard_True); // // Check IsClosed() - Standard_Real aDist = - Max(BS->StartPoint().XYZ().SquareModulus(), BS->EndPoint().XYZ().SquareModulus()); - Standard_Real eps = Epsilon(aDist); + Standard_Real aDist = std::max(BS->StartPoint().XYZ().SquareModulus(), + BS->EndPoint().XYZ().SquareModulus()); + Standard_Real eps = Epsilon(aDist); if (BS->StartPoint().SquareDistance(BS->EndPoint()) < 2. * eps) { // Avoid creating B-splines containing two coincident poles only @@ -1084,8 +1084,8 @@ void GeomInt_IntSS::TreatRLine(const Handle(IntPatch_RLine)& theRL, anAHC2d = theRL->ArcOnS1(); theRL->ParamOnS1(tf, tl); theC2d1 = Geom2dAdaptor::MakeCurve(*anAHC2d); - tf = Max(tf, theC2d1->FirstParameter()); - tl = Min(tl, theC2d1->LastParameter()); + tf = std::max(tf, theC2d1->FirstParameter()); + tl = std::min(tl, theC2d1->LastParameter()); theC2d1 = new Geom2d_TrimmedCurve(theC2d1, tf, tl); } else if (theRL->IsArcOnS2()) @@ -1094,8 +1094,8 @@ void GeomInt_IntSS::TreatRLine(const Handle(IntPatch_RLine)& theRL, anAHC2d = theRL->ArcOnS2(); theRL->ParamOnS2(tf, tl); theC2d2 = Geom2dAdaptor::MakeCurve(*anAHC2d); - tf = Max(tf, theC2d2->FirstParameter()); - tl = Min(tl, theC2d2->LastParameter()); + tf = std::max(tf, theC2d2->FirstParameter()); + tl = std::min(tl, theC2d2->LastParameter()); theC2d2 = new Geom2d_TrimmedCurve(theC2d2, tf, tl); } else @@ -1131,7 +1131,7 @@ void GeomInt_IntSS::TreatRLine(const Handle(IntPatch_RLine)& theRL, Handle(Geom_Surface) aS = GeomAdaptor::MakeSurface(*theHS1); BuildPCurves(tf, tl, aTol, aS, theC3d, theC2d1); } - theTolReached = Max(theTolReached, aTol); + theTolReached = std::max(theTolReached, aTol); } //================================================================================================= @@ -1190,9 +1190,9 @@ void GeomInt_IntSS::BuildPCurves(const Standard_Real theFirst, } else { - if ((theLast - theFirst) > Epsilon(Abs(theFirst))) + if ((theLast - theFirst) > Epsilon(std::abs(theFirst))) { - // The domain of C2d is [Epsilon(Abs(f)), 2.e-09] + // The domain of C2d is [Epsilon(std::abs(f)), 2.e-09] // On this small range C2d can be considered as segment // of line. @@ -1241,7 +1241,7 @@ void GeomInt_IntSS::BuildPCurves(const Standard_Real theFirst, const gp_Pnt2d pmidcurve2d(0.5 * (aP2d1.XY() + aP2d2.XY())); const gp_Pnt aPC(anAS.Value(pmidcurve2d.X(), pmidcurve2d.Y())); const Standard_Real aDist = PMid.Distance(aPC); - theTol = Max(aDist, theTol); + theTol = std::max(aDist, theTol); // Check same parameter in middle point .end } } @@ -1317,7 +1317,7 @@ void GeomInt_IntSS::TrimILineOnSurfBoundaries(const Handle(Geom2d_Curve)& theC2d theBound2.Get(aU2f, aV2f, aU2l, aV2l); Standard_Real aDelta = aV1l - aV1f; - if (Abs(aDelta) > RealSmall()) + if (std::abs(aDelta) > RealSmall()) { if (!Precision::IsInfinite(aU1f)) { @@ -1336,7 +1336,7 @@ void GeomInt_IntSS::TrimILineOnSurfBoundaries(const Handle(Geom2d_Curve)& theC2d } aDelta = aU1l - aU1f; - if (Abs(aDelta) > RealSmall()) + if (std::abs(aDelta) > RealSmall()) { if (!Precision::IsInfinite(aV1f)) { @@ -1354,7 +1354,7 @@ void GeomInt_IntSS::TrimILineOnSurfBoundaries(const Handle(Geom2d_Curve)& theC2d } aDelta = aV2l - aV2f; - if (Abs(aDelta) > RealSmall()) + if (std::abs(aDelta) > RealSmall()) { if (!Precision::IsInfinite(aU2f)) { @@ -1372,7 +1372,7 @@ void GeomInt_IntSS::TrimILineOnSurfBoundaries(const Handle(Geom2d_Curve)& theC2d } aDelta = aU2l - aU2f; - if (Abs(aDelta) > RealSmall()) + if (std::abs(aDelta) > RealSmall()) { if (!Precision::IsInfinite(aV2f)) { diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_LineConstructor.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_LineConstructor.cxx index 9d25a416c3..4c93934645 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_LineConstructor.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_LineConstructor.cxx @@ -349,7 +349,7 @@ void GeomInt_LineConstructor::Perform(const Handle(IntPatch_Line)& L) { firstp = GeomInt_LineTool::Vertex(L, i).ParameterOnLine(); lastp = GeomInt_LineTool::Vertex(L, i + 1).ParameterOnLine(); - if (Abs(firstp - lastp) > Precision::PConfusion()) + if (std::abs(firstp - lastp) > Precision::PConfusion()) { intrvtested = Standard_True; const Standard_Real pmid = (firstp + lastp) * 0.5; @@ -452,7 +452,7 @@ void GeomInt_LineConstructor::Perform(const Handle(IntPatch_Line)& L) Standard_Boolean inserted = Standard_False; for (Standard_Integer j = 1; j <= nbinserted; j++) { - if (Abs(prm - seqpss(j).Parameter()) <= Tol) + if (std::abs(prm - seqpss(j).Parameter()) <= Tol) { // accumulate GeomInt_ParameterAndOrientation& valj = seqpss.ChangeValue(j); @@ -602,8 +602,8 @@ void GeomInt_LineConstructor::Perform(const Handle(IntPatch_Line)& L) if (!dansS1 || !dansS2) { lastp = seqpss(i).Parameter(); - Standard_Real stofirst = Max(firstp, thefirst); - Standard_Real stolast = Min(lastp, thelast); + Standard_Real stofirst = std::max(firstp, thefirst); + Standard_Real stolast = std::min(lastp, thelast); if (stolast > stofirst) { @@ -657,7 +657,7 @@ void GeomInt_LineConstructor::Perform(const Handle(IntPatch_Line)& L) if (dansS1 && dansS2) { lastp = thelast; - firstp = Max(firstp, thefirst); + firstp = std::max(firstp, thefirst); if (lastp > firstp) { seqp.Append(firstp); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_TheZerImpFuncOfTheImpPrmSvSurfacesOfWLApprox.hxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_TheZerImpFuncOfTheImpPrmSvSurfacesOfWLApprox.hxx index 6ec75d1dba..22c9e2687a 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_TheZerImpFuncOfTheImpPrmSvSurfacesOfWLApprox.hxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomInt/GeomInt_TheZerImpFuncOfTheImpPrmSvSurfacesOfWLApprox.hxx @@ -60,7 +60,7 @@ public: Standard_Real Root() const; - //! Returns the value Tol so that if Abs(Func.Root())LastParameter(); HProjector->Bounds(1, ProjUdeb, ProjUfin); - if (HProjector->NbCurves() != 1 || Abs(UdebCheck - ProjUdeb) > Precision::PConfusion() - || Abs(UfinCheck - ProjUfin) > Precision::PConfusion()) + if (HProjector->NbCurves() != 1 || std::abs(UdebCheck - ProjUdeb) > Precision::PConfusion() + || std::abs(UfinCheck - ProjUfin) > Precision::PConfusion()) { if (HProjector->IsSinglePnt(1, P2d)) { @@ -331,7 +331,8 @@ Handle(Adaptor2d_Curve2d) GeomPlate_BuildPlateSurface::ProjectedCurve(Handle(Ada Last1 = Curv->LastParameter(); HProjector->Bounds(1, First2, Last2); - if (Abs(First1 - First2) <= Max(myTolU, myTolV) && Abs(Last1 - Last2) <= Max(myTolU, myTolV)) + if (std::abs(First1 - First2) <= std::max(myTolU, myTolV) + && std::abs(Last1 - Last2) <= std::max(myTolU, myTolV)) { HProjector = Handle(ProjLib_HCompProjectedCurve)::DownCast( HProjector->Trim(First2, Last2, Precision::PConfusion())); @@ -1862,7 +1863,8 @@ void GeomPlate_BuildPlateSurface::Intersect(Handle(GeomPlate_HArray1OfSequenceOf Standard_Real ant = v16.Angle(v26); if (ant > (M_PI / 2)) ant = M_PI - ant; - if ((Abs(v16 * v15 - v16 * v25) > (myTol3d / 1000)) || (Abs(ant) > myTol3d / 1000)) + if ((std::abs(v16 * v15 - v16 * v25) > (myTol3d / 1000)) + || (std::abs(ant) > myTol3d / 1000)) // Non-compatible ==> remove zone in constraint G1 // corresponding to 3D tolerance of 0.01 { @@ -1876,12 +1878,12 @@ void GeomPlate_BuildPlateSurface::Intersect(Handle(GeomPlate_HArray1OfSequenceOf A1 = V1.Angle(V2); if (A1 > (M_PI / 2)) A1 = M_PI - A1; - if (Abs(Abs(A1) - M_PI) < myTolAng) + if (std::abs(std::abs(A1) - M_PI) < myTolAng) Tol = 100000 * myTol3d; #ifdef OCCT_DEBUG if (Affich) std::cout << "Angle between curves " << i << "," << j << " " - << Abs(Abs(A1) - M_PI) << std::endl; + << std::abs(std::abs(A1) - M_PI) << std::endl; #endif coin = Ci.Resolution(Tol); @@ -1917,8 +1919,8 @@ void GeomPlate_BuildPlateSurface::Intersect(Handle(GeomPlate_HArray1OfSequenceOf } N = vecU ^ vecV; Standard_Real Angle = vec.Angle(N); - Angle = Abs(M_PI / 2 - Angle); - if (Angle > myTolAng / 10.) //????????? //if (Abs( scal ) > myTol3d/100) + Angle = std::abs(M_PI / 2 - Angle); + if (Angle > myTolAng / 10.) //????????? //if (std::abs( scal ) > myTol3d/100) { // Non-compatible ==> one removes zone in constraint G0 and G1 // corresponding to 3D tolerance of 0.01 @@ -1932,12 +1934,12 @@ void GeomPlate_BuildPlateSurface::Intersect(Handle(GeomPlate_HArray1OfSequenceOf A1 = V1.Angle(V2); if (A1 > M_PI / 2) A1 = M_PI - A1; - if (Abs(Abs(A1) - M_PI) < myTolAng) + if (std::abs(std::abs(A1) - M_PI) < myTolAng) Tol = 100000 * myTol3d; #ifdef OCCT_DEBUG if (Affich) - std::cout << "Angle entre Courbe " << i << "," << j << " " << Abs(Abs(A1) - M_PI) - << std::endl; + std::cout << "Angle entre Courbe " << i << "," << j << " " + << std::abs(std::abs(A1) - M_PI) << std::endl; #endif if (myLinCont->Value(i)->Order() == 1) { @@ -2072,7 +2074,7 @@ void GeomPlate_BuildPlateSurface::Discretise( tabP2d(Nbint + 1).SetX(Length2d); for (ii = 2; ii <= Nbint; ii++) { - U = Uinit + (Ufinal - Uinit) * ((1 - Cos((ii - 1) * M_PI / (Nbint))) / 2); + U = Uinit + (Ufinal - Uinit) * ((1 - std::cos((ii - 1) * M_PI / (Nbint))) / 2); tabP2d(ii).SetY(U); /* if (!HC2d.IsNull()) { Standard_Real L = GCPnts_AbscissaPoint::Length(HC2d->Curve2d(), Uinit, U); @@ -2105,12 +2107,12 @@ void GeomPlate_BuildPlateSurface::Discretise( Inter = Ufinal; // to avoid bug on Sun else if (ACR) { - CurLength = Length2d * (1 - Cos((j - 1) * M_PI / (NbPnt_i - 1))) / 2; + CurLength = Length2d * (1 - std::cos((j - 1) * M_PI / (NbPnt_i - 1))) / 2; Inter = acrlaw->Value(CurLength); } else { - Inter = Uinit + (Ufinal - Uinit) * ((1 - Cos((j - 1) * M_PI / (NbPnt_i - 1))) / 2); + Inter = Uinit + (Ufinal - Uinit) * ((1 - std::cos((j - 1) * M_PI / (NbPnt_i - 1))) / 2); } myParCont->ChangeValue(i).Append(Inter); // add a point if (NbPtInter != 0) @@ -2272,7 +2274,7 @@ void GeomPlate_BuildPlateSurface::LoadCurve(const Standard_Integer NbBoucle, Handle(GeomPlate_CurveConstraint) CC = myLinCont->Value(i); if (CC->Order() != -1) { - Tang = Min(CC->Order(), OrderMax); + Tang = std::min(CC->Order(), OrderMax); Nt = myPlateCont->Value(i).Length(); if (Tang != -1) for (j = 1; j <= Nt; j++) @@ -2385,7 +2387,7 @@ void GeomPlate_BuildPlateSurface::LoadPoint(const Standard_Integer, const Standa -PP.Coord(3) + P3d.Coord(3)); Plate_PinpointConstraint PC(P2d.XY(), Pdif.XYZ(), 0, 0); myPlate.Load(PC); - Tang = Min(myPntCont->Value(i)->Order(), OrderMax); + Tang = std::min(myPntCont->Value(i)->Order(), OrderMax); if (Tang == 1) { // ==1 gp_Vec V1, V2, V3, V4; @@ -2539,10 +2541,10 @@ Standard_Boolean GeomPlate_BuildPlateSurface::VerifSurface(const Standard_Intege { // at least one point is not acceptable in G0 Standard_Real Coef; if (LinCont->Order() == 0) - Coef = 0.6 * Log(diffDistMax + 7.4); + Coef = 0.6 * std::log(diffDistMax + 7.4); // 7.4 corresponds to the calculation of min. coefficient = 1.2 is e^1.2/0.6 else - Coef = Log(diffDistMax + 3.3); + Coef = std::log(diffDistMax + 3.3); // 3.3 corresponds to calculation of min. coefficient = 1.2 donc e^1.2 if (Coef > 3) Coef = 3; @@ -2552,7 +2554,7 @@ Standard_Boolean GeomPlate_BuildPlateSurface::VerifSurface(const Standard_Intege Coef = 1.6; } - if (LinCont->NbPoints() >= Floor(LinCont->NbPoints() * Coef)) + if (LinCont->NbPoints() >= std::floor(LinCont->NbPoints() * Coef)) Coef = 2; // to provide increase of the number of points LinCont->SetNbPoints(Standard_Integer(LinCont->NbPoints() * Coef)); @@ -2561,7 +2563,7 @@ Standard_Boolean GeomPlate_BuildPlateSurface::VerifSurface(const Standard_Intege else if (NdiffAng > 0) // at least 1 point is not acceptable in G1 { Standard_Real Coef = 1.5; - if ((LinCont->NbPoints() + 1) >= Floor(LinCont->NbPoints() * Coef)) + if ((LinCont->NbPoints() + 1) >= std::floor(LinCont->NbPoints() * Coef)) Coef = 2; LinCont->SetNbPoints(Standard_Integer(LinCont->NbPoints() * Coef)); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/GeomPlate/GeomPlate_PlateG0Criterion.cxx b/src/ModelingAlgorithms/TKGeomAlgo/GeomPlate/GeomPlate_PlateG0Criterion.cxx index 5ed5f6e3e0..c330e5fafb 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/GeomPlate/GeomPlate_PlateG0Criterion.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/GeomPlate/GeomPlate_PlateG0Criterion.cxx @@ -111,7 +111,7 @@ void GeomPlate_PlateG0Criterion::Value(AdvApp2Var_Patch& P, const AdvApp2Var_Con } } } - P.SetCritValue(Sqrt(dist)); + P.SetCritValue(std::sqrt(dist)); } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Hatch/Hatch_Hatcher.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Hatch/Hatch_Hatcher.cxx index 373de0d988..400ce47654 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Hatch/Hatch_Hatcher.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Hatch/Hatch_Hatcher.cxx @@ -133,9 +133,9 @@ void Hatch_Hatcher::Trim(const gp_Lin2d& L, void Hatch_Hatcher::Trim(const gp_Pnt2d& P1, const gp_Pnt2d& P2, const Standard_Integer Index) { gp_Vec2d V(P1, P2); - if (Abs(V.X()) > .9 * RealLast()) + if (std::abs(V.X()) > .9 * RealLast()) V.Multiply(1 / V.X()); - else if (Abs(V.Y()) > .9 * RealLast()) + else if (std::abs(V.Y()) > .9 * RealLast()) V.Multiply(1 / V.Y()); if (V.Magnitude() > myToler) { diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Hatch/Hatch_Line.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Hatch/Hatch_Line.cxx index 7b42397071..489cee21f6 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Hatch/Hatch_Line.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Hatch/Hatch_Line.cxx @@ -47,7 +47,7 @@ void Hatch_Line::AddIntersection(const Standard_Real Par1, { Standard_Real dfIntPar1 = myInters(i).myPar1; // akm OCC109 vvv : Two intersections too close - if (Abs(Par1 - dfIntPar1) < theToler) + if (std::abs(Par1 - dfIntPar1) < theToler) { myInters.Remove(i); return; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/HatchGen/HatchGen_PointOnElement.cxx b/src/ModelingAlgorithms/TKGeomAlgo/HatchGen/HatchGen_PointOnElement.cxx index 4cbdd4de23..50a13d75a2 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/HatchGen/HatchGen_PointOnElement.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/HatchGen/HatchGen_PointOnElement.cxx @@ -179,7 +179,7 @@ HatchGen_PointOnElement::HatchGen_PointOnElement(const IntRes2d_IntersectionPoin Standard_Boolean HatchGen_PointOnElement::IsIdentical(const HatchGen_PointOnElement& Point, const Standard_Real Confusion) const { - Standard_Real Delta = Abs(myParam - Point.myParam); + Standard_Real Delta = std::abs(myParam - Point.myParam); return ((Delta <= Confusion) && (myIndex == Point.myIndex) && (myPosit == Point.myPosit) && (myType == Point.myType) && (myBefore == Point.myBefore) && (myAfter == Point.myAfter) && (mySegBeg == Point.mySegBeg) && (mySegEnd == Point.mySegEnd)); @@ -193,7 +193,7 @@ Standard_Boolean HatchGen_PointOnElement::IsIdentical(const HatchGen_PointOnElem Standard_Boolean HatchGen_PointOnElement::IsDifferent(const HatchGen_PointOnElement& Point, const Standard_Real Confusion) const { - Standard_Real Delta = Abs(myParam - Point.myParam); + Standard_Real Delta = std::abs(myParam - Point.myParam); return ((Delta > Confusion) || (myIndex != Point.myIndex) || (myPosit != Point.myPosit) || (myType != Point.myType) || (myBefore != Point.myBefore) || (myAfter != Point.myAfter) || (mySegBeg != Point.mySegBeg) || (mySegEnd != Point.mySegEnd)); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/HatchGen/HatchGen_PointOnHatching.cxx b/src/ModelingAlgorithms/TKGeomAlgo/HatchGen/HatchGen_PointOnHatching.cxx index ef1270e33b..17b31da45f 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/HatchGen/HatchGen_PointOnHatching.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/HatchGen/HatchGen_PointOnHatching.cxx @@ -139,7 +139,7 @@ Standard_Boolean HatchGen_PointOnHatching::IsLower(const HatchGen_PointOnHatchin Standard_Boolean HatchGen_PointOnHatching::IsEqual(const HatchGen_PointOnHatching& Point, const Standard_Real Confusion) const { - return (Abs(Point.myParam - myParam) <= Confusion); + return (std::abs(Point.myParam - myParam) <= Confusion); } //======================================================================= diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IConicTool.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IConicTool.cxx index 56d4e011ff..b95a9930e0 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IConicTool.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IConicTool.cxx @@ -262,7 +262,7 @@ Standard_Real IntCurve_IConicTool::Distance(const gp_Pnt2d& ThePoint) const case GeomAbs_Hyperbola: { //-- Distance(X,Y) = (X/a)**2 - (Y/b)**2 -1 //-- pour x>0 //-- -(Y/b)**2 - 1 sinon ?? - //-- avec un gradient avec x -> Abs(x) + //-- avec un gradient avec x -> std::abs(x) gp_Pnt2d P = ThePoint; P.Transform(Abs_To_Object); if (P.X() > 0.0) @@ -357,7 +357,7 @@ gp_Vec2d IntCurve_IConicTool::GradDistance(const gp_Pnt2d& ThePoint) const gp_Pnt2d P = ThePoint; P.Transform(Abs_To_Object); //--### la Branche a X negatif doit ramener vers les X positifs - gp_Vec2d Gradient(2.0 * Abs(P.X()) / Hypr_aa, -2.0 * P.Y() / Hypr_bb); + gp_Vec2d Gradient(2.0 * std::abs(P.X()) / Hypr_aa, -2.0 * P.Y() / Hypr_bb); Gradient.Transform(Object_To_Abs); return (Gradient); } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic.cxx index b9afbcaacd..e202f8bcfa 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic.cxx @@ -1179,7 +1179,7 @@ void SetBinfBsupFromIntAna2d(const IntAna2d_AnaIntersection& theIntAna2d, { Standard_Real param = theIntAna2d.Point(p).ParamOnFirst(); - if (Abs(param) < LIMITE) + if (std::abs(param) < LIMITE) { gp_Vec2d V; gp_Pnt2d P; @@ -1225,7 +1225,7 @@ void SetBinfBsupFromIntAna2d(const IntAna2d_AnaIntersection& theIntAna2d, { Standard_Real param = theIntAna2d.Point(p).ParamOnFirst(); - if (Abs(param) < LIMITE) + if (std::abs(param) < LIMITE) { gp_Vec2d V; gp_Pnt2d P; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic_1.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic_1.cxx index 1cfb7317bd..0edd1c960f 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic_1.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic_1.cxx @@ -156,7 +156,7 @@ void CircleCircleGeometricIntersection(const gp_Circ2d& C1, Standard_Real dO1O2 = (C1.Location()).Distance(C2.Location()); Standard_Real R1 = C1.Radius(); Standard_Real R2 = C2.Radius(); - Standard_Real AbsR1mR2 = Abs(R1 - R2); + Standard_Real AbsR1mR2 = std::abs(R1 - R2); //---------------------------------------------------------------- if (dO1O2 > (R1 + R2 + Tol)) { @@ -198,8 +198,8 @@ void CircleCircleGeometricIntersection(const gp_Circ2d& C1, { Standard_Real dx = (R1pTolR1pTol + dO1O2dO1O2 - R2R2) / (dO1O2 + dO1O2); Standard_Real dy = (R1pTolR1pTol - dx * dx); - dy = (dy >= 0.0) ? Sqrt(dy) : 0.0; - dAlpha1 = ATan2(dy, dx); + dy = (dy >= 0.0) ? std::sqrt(dy) : 0.0; + dAlpha1 = std::atan2(dy, dx); C1_binf1 = -dAlpha1; C1_bsup1 = dAlpha1; @@ -207,24 +207,24 @@ void CircleCircleGeometricIntersection(const gp_Circ2d& C1, } //-------------------------------------------------------------------- //-- 2 segments donnes par Inter C2 avec C1- C1 C1+ - //-- Seul le signe de dx change si dO1O2 < Max(R1,R2) + //-- Seul le signe de dx change si dO1O2 < std::max(R1,R2) //-- else if (dO1O2 > AbsR1mR2 - Tol) { // -- + //------------------- Intersection C2 C1+ -------------------------- Standard_Real dx = (R1pTolR1pTol + dO1O2dO1O2 - R2R2) / (dO1O2 + dO1O2); Standard_Real dy = (R1pTolR1pTol - dx * dx); - dy = (dy >= 0.0) ? Sqrt(dy) : 0.0; + dy = (dy >= 0.0) ? std::sqrt(dy) : 0.0; - dAlpha1 = ATan2(dy, dx); + dAlpha1 = std::atan2(dy, dx); C1_binf1 = -dAlpha1; C1_bsup2 = dAlpha1; //-- |...? ?...| Sur C1 //------------------ Intersection C2 C1- ------------------------- dx = (R1mTolR1mTol + dO1O2dO1O2 - R2R2) / (dO1O2 + dO1O2); dy = (R1mTolR1mTol - dx * dx); - dy = (dy >= 0.0) ? Sqrt(dy) : 0.0; - dAlpha1 = ATan2(dy, dx); + dy = (dy >= 0.0) ? std::sqrt(dy) : 0.0; + dAlpha1 = std::atan2(dy, dx); C1_binf2 = dAlpha1; C1_bsup1 = -dAlpha1; //-- |...x x...| Sur C1 @@ -487,8 +487,8 @@ void LineCircleGeometricIntersection(const gp_Lin2d& Line, // if(dO1O2 > RmTol) { Standard_Real dx = dO1O2; Standard_Real dy = 0.0; //(RpTol*RpTol-dx*dx); //Patch !!! - dy = (dy >= 0.0) ? Sqrt(dy) : 0.0; - dAlpha1 = ATan2(dy, dx); + dy = (dy >= 0.0) ? std::sqrt(dy) : 0.0; + dAlpha1 = std::atan2(dy, dx); binf1 = -dAlpha1; bsup1 = dAlpha1; @@ -502,21 +502,21 @@ void LineCircleGeometricIntersection(const gp_Lin2d& Line, //------------------- Intersection Line Circle+ -------------------------- Standard_Real dx = dO1O2; Standard_Real dy = R * R - dx * dx; //(RpTol*RpTol-dx*dx); //Patch !!! - dy = (dy >= 0.0) ? Sqrt(dy) : 0.0; + dy = (dy >= 0.0) ? std::sqrt(dy) : 0.0; - dAlpha1 = ATan2(dy, dx); + dAlpha1 = std::atan2(dy, dx); binf1 = -dAlpha1; bsup2 = dAlpha1; //-- |...? ?...| Sur C1 //------------------ Intersection Line Circle- ------------------------- dy = R * R - dx * dx; //(RmTol*RmTol-dx*dx); //Patch !!! - dy = (dy >= 0.0) ? Sqrt(dy) : 0.0; - dAlpha1 = ATan2(dy, dx); + dy = (dy >= 0.0) ? std::sqrt(dy) : 0.0; + dAlpha1 = std::atan2(dy, dx); binf2 = dAlpha1; bsup1 = -dAlpha1; //-- |...x x...| Sur C1 - if ((dAlpha1 * R) < (Max(Tol, TolTang))) + if ((dAlpha1 * R) < (std::max(Tol, TolTang))) { bsup1 = bsup2; nbsol = 1; @@ -726,12 +726,12 @@ void LineLineGeometricIntersection(const gp_Lin2d& L1, Standard_Real D = U1y * U2x - U1x * U2y; // modified by NIZHNY-MKK Tue Feb 15 10:54:04 2000.BEGIN - // if(Abs(D)<1e-15) { //-- Droites // - if (Abs(D) < TOLERANCE_ANGULAIRE) + // if(std::abs(D)<1e-15) { //-- Droites // + if (std::abs(D) < TOLERANCE_ANGULAIRE) { // modified by NIZHNY-MKK Tue Feb 15 10:54:11 2000.END D = U1y * Uo21x - U1x * Uo21y; - nbsol = (Abs(D) <= Tol) ? 2 : 0; + nbsol = (std::abs(D) <= Tol) ? 2 : 0; } else { @@ -744,7 +744,7 @@ void LineLineGeometricIntersection(const gp_Lin2d& L1, D = -D; if (D > 1.0) D = 1.0; //-- Deja vu ! - SinDemiAngle = Sin(0.5 * ASin(D)); + SinDemiAngle = std::sin(0.5 * std::asin(D)); nbsol = 1; } } @@ -826,7 +826,7 @@ void IntCurve_IntConicConic::Perform(const gp_Circ2d& Circle1, if (deltat >= PIpPI) { // make deltat not including the upper limit - deltat = NextAfter(PIpPI, 0.); + deltat = std::nextafter(PIpPI, 0.); } while (C1Domain.Binf >= PIpPI) @@ -840,7 +840,7 @@ void IntCurve_IntConicConic::Perform(const gp_Circ2d& Circle1, deltat = C2Domain.Bsup - C2Domain.Binf; if (deltat >= PIpPI) { - deltat = NextAfter(PIpPI, 0.); + deltat = std::nextafter(PIpPI, 0.); } while (C2Domain.Binf >= PIpPI) @@ -1172,7 +1172,7 @@ IntRes2d_Position FindPositionLL(Standard_Real& Param, const IntRes2d_Domain& Do Standard_Real aResPar = Param; if (Domain.HasFirstPoint()) { - aDPar = Abs(Param - Domain.FirstParameter()); + aDPar = std::abs(Param - Domain.FirstParameter()); if (aDPar <= Domain.FirstTolerance()) { aResPar = Domain.FirstParameter(); @@ -1181,7 +1181,7 @@ IntRes2d_Position FindPositionLL(Standard_Real& Param, const IntRes2d_Domain& Do } if (Domain.HasLastPoint()) { - Standard_Real aD2 = Abs(Param - Domain.LastParameter()); + Standard_Real aD2 = std::abs(Param - Domain.LastParameter()); if (aD2 <= Domain.LastTolerance() && (aPos == IntRes2d_Middle || aD2 < aDPar)) { aResPar = Domain.LastParameter(); @@ -1575,7 +1575,7 @@ void IntCurve_IntConicConic::Perform(const gp_Lin2d& L1, Standard_Boolean ResultIsAPoint = Standard_False; - if (((Res1sup - Res1inf) <= LongMiniSeg) || (Abs(Res2sup - Res2inf) <= LongMiniSeg)) + if (((Res1sup - Res1inf) <= LongMiniSeg) || (std::abs(Res2sup - Res2inf) <= LongMiniSeg)) { //-- On force la creation d un point ResultIsAPoint = Standard_True; @@ -1736,7 +1736,7 @@ void IntCurve_IntConicConic::Perform(const gp_Lin2d& L1, PtSeg2.SetValues(ElCLib::Value(U2, L2), U1, U2, T1b, T2b, Standard_False); - if ((Abs(Res1inf - U1) > LongMiniSeg) && (Abs(Res2inf - U2) > LongMiniSeg)) + if ((std::abs(Res1inf - U1) > LongMiniSeg) && (std::abs(Res2inf - U2) > LongMiniSeg)) { IntRes2d_IntersectionSegment Segment(PtSeg1, PtSeg2, isOpposite, Standard_False); Append(Segment); @@ -1866,7 +1866,8 @@ void IntCurve_IntConicConic::Perform(const gp_Lin2d& L1, PtSeg2.SetValues(Ptfin, Res1sup, Res2sup, T1b, T2b, Standard_False); - if ((Abs(U1 - Res1sup) > LongMiniSeg) || (Abs(U2 - Res2sup) > LongMiniSeg)) + if ((std::abs(U1 - Res1sup) > LongMiniSeg) + || (std::abs(U2 - Res2sup) > LongMiniSeg)) { //-- Modif du 1er Octobre 92 (Pour Composites) @@ -2343,7 +2344,7 @@ void IntCurve_IntConicConic::Perform(const gp_Lin2d& Line, if(NbSolTotal == 2) { if(SolutionLine[0].Binf==SolutionLine[0].BSup) { if(SolutionLine[1].Binf==SolutionLine[1].BSup) { - if(Abs(SolutionLine[0].Binf-SolutionLine[1].Binf) MaxTol) && (Abs(Lsup - Linf) > MaxTol)) + if (((std::abs(Csup - Cinf) * R > MaxTol) && (std::abs(Lsup - Linf) > MaxTol)) || (T1a.TransitionType() != T2a.TransitionType())) { //-- Verifier egalement les transitions @@ -2602,7 +2603,7 @@ void LineEllipseGeometricIntersection(const gp_Lin2d& Line, gp_Elips2d aTEllipse = Ellipse.Transformed(aTr); gp_Lin2d aTLine = Line.Transformed(aTr); Standard_Real aDY = aTLine.Position().Direction().Y(); - Standard_Boolean IsVert = Abs(aDY) > 1. - 2. * Epsilon(1.); + Standard_Boolean IsVert = std::abs(aDY) > 1. - 2. * Epsilon(1.); // Standard_Real a = aTEllipse.MajorRadius(); Standard_Real b = aTEllipse.MinorRadius(); @@ -2624,7 +2625,7 @@ void LineEllipseGeometricIntersection(const gp_Lin2d& Line, } // Standard_Real x1 = 0., y1 = 0., x2 = 0., y2 = 0.; - if (Abs(aB) > eps0) + if (std::abs(aB) > eps0) { Standard_Real m = -anA / aB; Standard_Real m2 = m * m; @@ -2658,7 +2659,7 @@ void LineEllipseGeometricIntersection(const gp_Lin2d& Line, } return; } - D = Sqrt(D); + D = std::sqrt(D); Standard_Real n = a2 * m2 + b2; Standard_Real k = a * b * D / n; Standard_Real l = -a2 * m * c / n; @@ -2671,19 +2672,19 @@ void LineEllipseGeometricIntersection(const gp_Lin2d& Line, else { x1 = -aC / anA; - if (Abs(x1) > a + TolTang) + if (std::abs(x1) > a + TolTang) { nbsol = 0; return; } - else if (Abs(x1) >= a - Epsilon(1. + a)) + else if (std::abs(x1) >= a - Epsilon(1. + a)) { nbsol = 1; y1 = 0.; } else { - y1 = b * Sqrt(1. - x1 * x1 / a2); + y1 = b * std::sqrt(1. - x1 * x1 / a2); x2 = x1; y2 = -y1; nbsol = 2; @@ -3104,7 +3105,7 @@ void IntCurve_IntConicConic::Perform(const gp_Lin2d& L, IntRes2d_IntersectionPoint NewPoint2(P1b, Lsup, Esup, T2b, T1b, ReversedParameters()); - if (((Abs(Esup - Einf) * R > MaxTol) && (Abs(Lsup - Linf) > MaxTol)) + if (((std::abs(Esup - Einf) * R > MaxTol) && (std::abs(Lsup - Linf) > MaxTol)) || (T1a.TransitionType() != T2a.TransitionType())) { IntRes2d_IntersectionSegment NewSeg(NewPoint1, diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic_Tool.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic_Tool.cxx index 521dfdb12b..1625485d9d 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic_Tool.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic_Tool.cxx @@ -37,7 +37,7 @@ void Determine_Transition_LC(const IntRes2d_Position Pos1, Standard_Real sgn = Tan1.Crossed(Tan2); Standard_Real norm = Tan1.Magnitude() * Tan2.Magnitude(); - if (Abs(sgn) <= TOLERANCE_ANGULAIRE * norm) + if (std::abs(sgn) <= TOLERANCE_ANGULAIRE * norm) { // Transition TOUCH ######### Standard_Boolean opos = (Tan1.Dot(Tan2)) < 0; @@ -50,7 +50,7 @@ void Determine_Transition_LC(const IntRes2d_Position Pos1, Standard_Real Val1 = Norm.Dot(Norm1); Standard_Real Val2 = Norm.Dot(Norm2); - if (Abs(Val1 - Val2) <= gp::Resolution()) + if (std::abs(Val1 - Val2) <= gp::Resolution()) { T1.SetValue(Standard_True, Pos1, IntRes2d_Unknown, opos); T2.SetValue(Standard_True, Pos2, IntRes2d_Unknown, opos); @@ -243,7 +243,7 @@ Interval::Interval(const Standard_Real a, Standard_Real Interval::Length() { - return ((IsNull) ? -1.0 : Abs(Bsup - Binf)); + return ((IsNull) ? -1.0 : std::abs(Bsup - Binf)); } Interval Interval::IntersectionWithBounded(const Interval& Inter) diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic_Tool.hxx b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic_Tool.hxx index d334cf499f..5033c4ac25 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic_Tool.hxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic_Tool.hxx @@ -93,7 +93,7 @@ public: } } - Standard_Real Length() { return ((isnull) ? -100.0 : Abs(Bsup - Binf)); } + Standard_Real Length() { return ((isnull) ? -100.0 : std::abs(Bsup - Binf)); } PeriodicInterval(const IntRes2d_Domain& Domain) { diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntPolyPolyGen.gxx b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntPolyPolyGen.gxx index 210cdc8b42..2a5a4792ec 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntPolyPolyGen.gxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntPolyPolyGen.gxx @@ -515,7 +515,7 @@ void IntCurve_IntPolyPolyGen::Perform(const TheCurve& C1, SPnt.InfoFirst(Type, SegIndex1, ParamOn1); SPnt.InfoSecond(Type, SegIndex2, ParamOn2); - if (Abs(SegIndex1 - SegIndex2) > 1) + if (std::abs(SegIndex1 - SegIndex2) > 1) { EIP.Perform(Poly1, Poly1, SegIndex1, SegIndex2, ParamOn1, ParamOn2); @@ -531,7 +531,7 @@ void IntCurve_IntPolyPolyGen::Perform(const TheCurve& C1, Standard_Real Dist = P1.Distance(P2); Standard_Real EpsX1 = 10.0 * TheCurveTool::EpsX(C1); - if (Abs(U - V) <= EpsX1) + if (std::abs(U - V) <= EpsX1) { //----------------------------------------- //-- Solution not valid @@ -550,9 +550,9 @@ void IntCurve_IntPolyPolyGen::Perform(const TheCurve& C1, for (Standard_Integer p = 1; p <= nbp; p++) { const IntRes2d_IntersectionPoint& P = Point(p); - if (Abs(U - P.ParamOnFirst()) <= EpsX1) + if (std::abs(U - P.ParamOnFirst()) <= EpsX1) { - if (Abs(V - P.ParamOnSecond()) <= EpsX1) + if (std::abs(V - P.ParamOnSecond()) <= EpsX1) { Dist = TolConf + 1.0; p += nbp; @@ -737,7 +737,8 @@ void IntCurve_IntPolyPolyGen::Perform(const TheCurve& C1, D1.LastParameter(), TheCurveTool::EpsX(C1)); } - else if (Abs(ParamInfOnCurve1 - ParamSupOnCurve1) > Abs(ParamInfOnCurve2 - ParamSupOnCurve2)) + else if (std::abs(ParamInfOnCurve1 - ParamSupOnCurve1) + > std::abs(ParamInfOnCurve2 - ParamSupOnCurve2)) { PolyVInf = TheProjPCur::FindParameter(C1, P1, @@ -772,8 +773,8 @@ void IntCurve_IntPolyPolyGen::Perform(const TheCurve& C1, IntRes2d_IntersectionPoint PtSeg1(P1, PolyUInf, PolyVInf, Trans1, Trans2, Standard_False); //---------------------------------------------------------------------- - if ((Abs(PolyUInf - PolyUSup) <= TheCurveTool::EpsX(C1)) - || (Abs(PolyVInf - PolyVSup) <= TheCurveTool::EpsX(C1))) + if ((std::abs(PolyUInf - PolyUSup) <= TheCurveTool::EpsX(C1)) + || (std::abs(PolyVInf - PolyVSup) <= TheCurveTool::EpsX(C1))) { // bad segment } @@ -817,7 +818,8 @@ void IntCurve_IntPolyPolyGen::Perform(const TheCurve& C1, D1.LastParameter(), TheCurveTool::EpsX(C1)); } - else if (Abs(ParamInfOnCurve1 - ParamSupOnCurve1) > Abs(ParamInfOnCurve2 - ParamSupOnCurve2)) + else if (std::abs(ParamInfOnCurve1 - ParamSupOnCurve1) + > std::abs(ParamInfOnCurve2 - ParamSupOnCurve2)) { PolyVSup = TheProjPCur::FindParameter(C1, P1, @@ -942,13 +944,13 @@ Standard_Boolean HeadOrEndPoint(const IntRes2d_Domain& D1, { if (Pos1 == IntRes2d_Middle) { - if (Abs(u - D1.FirstParameter()) <= EpsX1) + if (std::abs(u - D1.FirstParameter()) <= EpsX1) { Pos1 = IntRes2d_Head; P1 = D1.FirstPoint(); HeadOn1 = Standard_True; } - else if (Abs(u - D1.LastParameter()) <= EpsX1) + else if (std::abs(u - D1.LastParameter()) <= EpsX1) { Pos1 = IntRes2d_End; P1 = D1.LastPoint(); @@ -962,7 +964,7 @@ Standard_Boolean HeadOrEndPoint(const IntRes2d_Domain& D1, if (Pos2 == IntRes2d_Middle) { - if (Abs(v - D2.FirstParameter()) <= EpsX2) + if (std::abs(v - D2.FirstParameter()) <= EpsX2) { Pos2 = IntRes2d_Head; HeadOn2 = Standard_True; @@ -976,7 +978,7 @@ Standard_Boolean HeadOrEndPoint(const IntRes2d_Domain& D1, P2 = P1; } } - else if (Abs(v - D2.LastParameter()) <= EpsX2) + else if (std::abs(v - D2.LastParameter()) <= EpsX2) { Pos2 = IntRes2d_End; EndOn2 = Standard_True; @@ -1058,8 +1060,8 @@ void IntCurve_IntPolyPolyGen::Perform(const TheCurve& C1, if (NbIter == 0) { // Minimal number of points. - nbsamplesOnC1 = Max(nbsamplesOnC1, myMinPntNb); - nbsamplesOnC2 = Max(nbsamplesOnC2, myMinPntNb); + nbsamplesOnC1 = std::max(nbsamplesOnC1, myMinPntNb); + nbsamplesOnC2 = std::max(nbsamplesOnC2, myMinPntNb); } else { @@ -1076,8 +1078,8 @@ void IntCurve_IntPolyPolyGen::Perform(const TheCurve& C1, if ((aPoly1->DeflectionOverEstimation() > TolConf) && (aPoly2->DeflectionOverEstimation() > TolConf)) { - const Standard_Real aDeflectionSum = Max(aPoly1->DeflectionOverEstimation(), TolConf) - + Max(aPoly2->DeflectionOverEstimation(), TolConf); + const Standard_Real aDeflectionSum = std::max(aPoly1->DeflectionOverEstimation(), TolConf) + + std::max(aPoly2->DeflectionOverEstimation(), TolConf); if (nbsamplesOnC2 > nbsamplesOnC1) { @@ -1240,9 +1242,9 @@ Standard_Boolean IntCurve_IntPolyPolyGen::findIntersect(const TheCurve& for (Standard_Integer p = 1; p <= nbp; p++) { const IntRes2d_IntersectionPoint& P = Point(p); - if (Abs(U - P.ParamOnFirst()) <= EpsX1) + if (std::abs(U - P.ParamOnFirst()) <= EpsX1) { - if (Abs(V - P.ParamOnSecond()) <= EpsX2) + if (std::abs(V - P.ParamOnSecond()) <= EpsX2) { Dist = TolConf + 1.0; p += nbp; @@ -1446,7 +1448,8 @@ Standard_Boolean IntCurve_IntPolyPolyGen::findIntersect(const TheCurve& D2.LastParameter(), TheCurveTool::EpsX(C2)); } - else if (Abs(ParamInfOnCurve1 - ParamSupOnCurve1) > Abs(ParamInfOnCurve2 - ParamSupOnCurve2)) + else if (std::abs(ParamInfOnCurve1 - ParamSupOnCurve1) + > std::abs(ParamInfOnCurve2 - ParamSupOnCurve2)) { PolyVInf = TheProjPCur::FindParameter(C2, P1, @@ -1481,8 +1484,8 @@ Standard_Boolean IntCurve_IntPolyPolyGen::findIntersect(const TheCurve& IntRes2d_IntersectionPoint PtSeg1(P1, PolyUInf, PolyVInf, Trans1, Trans2, Standard_False); //---------------------------------------------------------------------- - if ((Abs(PolyUInf - PolyUSup) <= TheCurveTool::EpsX(C1)) - || (Abs(PolyVInf - PolyVSup) <= TheCurveTool::EpsX(C2))) + if ((std::abs(PolyUInf - PolyUSup) <= TheCurveTool::EpsX(C1)) + || (std::abs(PolyVInf - PolyVSup) <= TheCurveTool::EpsX(C2))) { Insert(PtSeg1); } @@ -1526,8 +1529,8 @@ Standard_Boolean IntCurve_IntPolyPolyGen::findIntersect(const TheCurve& D2.LastParameter(), TheCurveTool::EpsX(C2)); } - else if (Abs(ParamInfOnCurve1 - ParamSupOnCurve1) - > Abs(ParamInfOnCurve2 - ParamSupOnCurve2)) + else if (std::abs(ParamInfOnCurve1 - ParamSupOnCurve1) + > std::abs(ParamInfOnCurve2 - ParamSupOnCurve2)) { PolyVSup = TheProjPCur::FindParameter(C2, P1, @@ -1598,9 +1601,9 @@ void GetIntersection(const TheCurve& theC1, // Standard_Real aTol2 = theTolConf * theTolConf; Standard_Real aPTol1 = - Max(100. * Epsilon(Max(Abs(theT1f), Abs(theT1l))), Precision::PConfusion()); + std::max(100. * Epsilon(std::max(std::abs(theT1f), std::abs(theT1l))), Precision::PConfusion()); Standard_Real aPTol2 = - Max(100. * Epsilon(Max(Abs(theT2f), Abs(theT2l))), Precision::PConfusion()); + std::max(100. * Epsilon(std::max(std::abs(theT2f), std::abs(theT2l))), Precision::PConfusion()); gp_Pnt2d aP1f, aP1l, aP2f, aP2l; Bnd_Box2d aB1, aB2; // @@ -1649,7 +1652,7 @@ void GetIntersection(const TheCurve& theC1, } } // - dmin = Sqrt(dmin); + dmin = std::sqrt(dmin); if (theDist > dmin) { theDist = dmin; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_Polygon2dGen.gxx b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_Polygon2dGen.gxx index beff323950..86df44d1ec 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_Polygon2dGen.gxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_Polygon2dGen.gxx @@ -78,7 +78,7 @@ IntCurve_Polygon2dGen::IntCurve_Polygon2dGen(const TheCurve& C, //--- // Modified by Sergey KHROMOV - Mon Mar 24 12:03:05 2003 Begin // TheDeflection = 0.000000001; - TheDeflection = Min(0.000000001, Tol / 100.); + TheDeflection = std::min(0.000000001, Tol / 100.); // Modified by Sergey KHROMOV - Mon Mar 24 12:03:05 2003 End i = 1; u = D.FirstParameter(); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_Inter.gxx b/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_Inter.gxx index a6ccf2e973..335bb0beed 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_Inter.gxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_Inter.gxx @@ -189,7 +189,7 @@ void IntCurveSurface_Inter::DoSurface(const TheSurface& surface, } Standard_Real Ures = TheSurfaceTool::UResolution(surface, dU); Standard_Real Vres = TheSurfaceTool::VResolution(surface, dV); - gap = Max(Ures, Vres); + gap = std::max(Ures, Vres); } //================================================================================================= @@ -645,7 +645,7 @@ void IntCurveSurface_Inter::InternalPerform(const TheCurve& for (i = 1, im1 = 0; i < NbStartPoints; im1++, i++) { // modified by NIZHNY-MKK Mon Oct 3 17:38:49 2005 - // if(Abs(TabW[i]-TabW[im1]) ptol || Abs(v - sv) > ptol || Abs(w - sw) > ptol) + if (std::abs(u - su) > ptol || std::abs(v - sv) > ptol || std::abs(w - sw) > ptol) { intersectionExacte.Perform(u, v, w, rsnld, u0, u1, v0, v1, winf, wsup); if (intersectionExacte.IsDone()) @@ -820,7 +820,7 @@ void IntCurveSurface_Inter::InternalPerform(const TheCurve& for (i = 1, im1 = 0; i < NbStartPoints; im1++, i++) { // modified by NIZHNY-MKK Mon Oct 3 17:38:56 2005 - // if(Abs(TabW[i]-TabW[im1]) ptol || Abs(v - sv) > ptol || Abs(w - sw) > ptol) + if (std::abs(u - su) > ptol || std::abs(v - sv) > ptol || std::abs(w - sw) > ptol) { intersectionExacte.Perform(u, v, w, rsnld, u0, u1, v0, v1, winf, wsup); if (intersectionExacte.IsDone()) @@ -1028,7 +1028,7 @@ void IntCurveSurface_Inter::PerformConicSurf(const gp_Lin& Line, case GeomAbs_Cone: { constexpr Standard_Real correction = 1.E+5 * Precision::Angular(); gp_Cone cn = TheSurfaceTool::Cone(surface); - if (Abs(cn.SemiAngle()) < M_PI / 2.0 - correction) + if (std::abs(cn.SemiAngle()) < M_PI / 2.0 - correction) { IntAna_IntConicQuad LinCone(Line, cn); AppendIntAna(curve, surface, LinCone); @@ -1676,24 +1676,24 @@ void EstLimForInfExtr(const gp_Lin& Line, aExtr.Points(1, aP1, aP2); v = aP1.Parameter(); - vmin = Min(vmin, v); - vmax = Max(vmax, v); + vmin = std::min(vmin, v); + vmax = std::max(vmax, v); u += step; } - vmin = vmin - Abs(vmin) - 10.; - vmax = vmax + Abs(vmax) + 10.; + vmin = vmin - std::abs(vmin) - 10.; + vmax = vmax + std::abs(vmax) + 10.; - V1new = Max(V1new, vmin); - V2new = Min(V2new, vmax); + V1new = std::max(V1new, vmin); + V2new = std::min(V2new, vmax); } else if (U1inf || U2inf) { Standard_Real umin = RealLast(), umax = -umin; - Standard_Real u0 = Min(Max(0., U1new), U2new); - Standard_Real v0 = Min(Max(0., V1new), V2new); + Standard_Real u0 = std::min(std::max(0., U1new), U2new); + Standard_Real v0 = std::min(std::max(0., V1new), V2new); gp_Pnt aP; TheSurfaceTool::D0(surface, u0, v0, aP); gp_Pln aRefPln(aP, aDirOfExt); @@ -1781,8 +1781,8 @@ void EstLimForInfExtr(const gp_Lin& Line, const IntAna2d_IntPoint& anIntPnt = anInter.Point(i); - umin = Min(anIntPnt.ParamOnFirst(), umin); - umax = Max(anIntPnt.ParamOnFirst(), umax); + umin = std::min(anIntPnt.ParamOnFirst(), umin); + umax = std::max(anIntPnt.ParamOnFirst(), umax); } } else @@ -1790,11 +1790,11 @@ void EstLimForInfExtr(const gp_Lin& Line, return; } - umin = umin - Abs(umin) - 10; - umax = umax + Abs(umax) + 10; + umin = umin - std::abs(umin) - 10; + umax = umax + std::abs(umax) + 10; - U1new = Max(U1new, umin); - U2new = Min(U2new, umax); + U1new = std::max(U1new, umin); + U2new = std::min(U2new, umax); if (V1inf || V2inf) { @@ -1877,7 +1877,7 @@ void ProjectIntersectAndEstLim(const gp_Lin& theLine, // retrieve params of intersections Standard_Integer aNbIntPnt = anIntersect.IsDone() ? anIntersect.NbPoints() : 0; Standard_Integer aNbIntPntSym = anIntersectSym.IsDone() ? anIntersectSym.NbPoints() : 0; - Standard_Integer iPnt, aNbPnt = Max(aNbIntPnt, aNbIntPntSym); + Standard_Integer iPnt, aNbPnt = std::max(aNbIntPnt, aNbIntPntSym); if (aNbPnt == 0) { @@ -1891,15 +1891,15 @@ void ProjectIntersectAndEstLim(const gp_Lin& theLine, { const IntAna2d_IntPoint& aIntPnt = anIntersect.Point(iPnt); aParam = aIntPnt.ParamOnFirst(); - theVmin = Min(theVmin, aParam); - theVmax = Max(theVmax, aParam); + theVmin = std::min(theVmin, aParam); + theVmax = std::max(theVmax, aParam); } if (iPnt <= aNbIntPntSym) { const IntAna2d_IntPoint& aIntPnt = anIntersectSym.Point(iPnt); aParam = aIntPnt.ParamOnFirst(); - theVmin = Min(theVmin, aParam); - theVmax = Max(theVmax, aParam); + theVmin = std::min(theVmin, aParam); + theVmax = std::max(theVmax, aParam); } } @@ -1931,9 +1931,9 @@ void EstLimForInfRevl(const gp_Lin& Line, if (U1inf || U2inf) { if (U1inf) - U1new = Max(0., U1new); + U1new = std::max(0., U1new); else - U2new = Min(2 * M_PI, U2new); + U2new = std::min(2 * M_PI, U2new); if (!V1inf && !V2inf) return; } @@ -2014,8 +2014,8 @@ void EstLimForInfRevl(const gp_Lin& Line, return; } - aVmin = aVmin - Abs(aVmin) - 10; - aVmax = aVmax + Abs(aVmax) + 10; + aVmin = aVmin - std::abs(aVmin) - 10; + aVmax = aVmax + std::abs(aVmax) + 10; if (V1inf) V1new = aVmin; @@ -2072,10 +2072,10 @@ void EstLimForInfOffs(const gp_Lin& Line, Standard_Real u, v; ElSLib::Parameters(aPln, LinPlane.Point(1), u, v); - U1new = Max(U1new, u - 10.); - U2new = Min(U2new, u + 10.); - V1new = Max(V1new, v - 10.); - V2new = Min(V2new, v + 10.); + U1new = std::max(U1new, u - 10.); + U2new = std::min(U2new, u + 10.); + V1new = std::max(V1new, v - 10.); + V2new = std::min(V2new, v + 10.); } else if (aTypeOfBasSurf == GeomAbs_Cylinder) { @@ -2099,7 +2099,7 @@ void EstLimForInfOffs(const gp_Lin& Line, anA.Rotate(gp_Ax1(anA.Location(), anA.Direction()), M_PI); aCyl.SetPosition(anA); // modified by NIZHNY-MKK Mon Oct 3 17:37:54 2005 - // aCyl.SetRadius(Abs(aR)); + // aCyl.SetRadius(std::abs(aR)); aCyl.SetRadius(-aR); } else @@ -2128,25 +2128,25 @@ void EstLimForInfOffs(const gp_Lin& Line, { ElSLib::Parameters(aCyl, LinCylinder.Point(i), u, v); - vmin = Min(vmin, v); - vmax = Max(vmax, v); + vmin = std::min(vmin, v); + vmax = std::max(vmax, v); } - V1new = Max(V1new, vmin - Abs(vmin) - 10.); - V2new = Min(V2new, vmax + Abs(vmax) + 10.); + V1new = std::max(V1new, vmin - std::abs(vmin) - 10.); + V2new = std::min(V2new, vmax + std::abs(vmax) + 10.); } else if (aTypeOfBasSurf == GeomAbs_Cone) { gp_Cone aCon = aBasSurf->Cone(); Standard_Real anAng = aCon.SemiAngle(); - Standard_Real aR = aCon.RefRadius() + anOffVal * Cos(anAng); + Standard_Real aR = aCon.RefRadius() + anOffVal * std::cos(anAng); gp_Ax3 anA = aCon.Position(); if (aR >= 0.) { gp_Vec aZ(anA.Direction()); - aZ *= -anOffVal * Sin(anAng); + aZ *= -anOffVal * std::sin(anAng); anA.Translate(aZ); aCon.SetPosition(anA); aCon.SetRadius(aR); @@ -2177,12 +2177,12 @@ void EstLimForInfOffs(const gp_Lin& Line, { ElSLib::Parameters(aCon, LinCone.Point(i), u, v); - vmin = Min(vmin, v); - vmax = Max(vmax, v); + vmin = std::min(vmin, v); + vmax = std::max(vmax, v); } - V1new = Max(V1new, vmin - Abs(vmin) - 10.); - V2new = Min(V2new, vmax + Abs(vmax) + 10.); + V1new = std::max(V1new, vmin - std::abs(vmin) - 10.); + V2new = std::min(V2new, vmax + std::abs(vmax) + 10.); } else if (aTypeOfBasSurf == GeomAbs_SurfaceOfExtrusion) { @@ -2212,26 +2212,26 @@ void EstLimForInfOffs(const gp_Lin& Line, GeomAbs_CurveType aBasCurvType = aBasSurf->BasisCurve()->GetType(); if (aBasCurvType == GeomAbs_Line) { - U1new = Max(anU1, -1.e10); - U2new = Min(anU2, 1.e10); + U1new = std::max(anU1, -1.e10); + U2new = std::min(anU2, 1.e10); } else if (aBasCurvType == GeomAbs_Parabola) { gp_Parab aPrb = aBasSurf->BasisCurve()->Parabola(); Standard_Real aF = aPrb.Focal(); - Standard_Real dU = 2.e5 * Sqrt(aF); - U1new = Max(anU1, -dU); - U2new = Min(anU2, dU); + Standard_Real dU = 2.e5 * std::sqrt(aF); + U1new = std::max(anU1, -dU); + U2new = std::min(anU2, dU); } else if (aBasCurvType == GeomAbs_Hyperbola) { - U1new = Max(anU1, -30.); - U2new = Min(anU2, 30.); + U1new = std::max(anU1, -30.); + U2new = std::min(anU2, 30.); } else { - U1new = Max(anU1, -1.e10); - U2new = Min(anU2, 1.e10); + U1new = std::max(anU1, -1.e10); + U2new = std::min(anU2, 1.e10); } } } @@ -2241,33 +2241,33 @@ void EstLimForInfOffs(const gp_Lin& Line, GeomAbs_CurveType aBasCurvType = aBasSurf->BasisCurve()->GetType(); if (aBasCurvType == GeomAbs_Line) { - V1new = Max(V1new, -1.e10); - V2new = Min(V2new, 1.e10); + V1new = std::max(V1new, -1.e10); + V2new = std::min(V2new, 1.e10); } else if (aBasCurvType == GeomAbs_Parabola) { gp_Parab aPrb = aBasSurf->BasisCurve()->Parabola(); Standard_Real aF = aPrb.Focal(); - Standard_Real dV = 2.e5 * Sqrt(aF); - V1new = Max(V1new, -dV); - V2new = Min(V2new, dV); + Standard_Real dV = 2.e5 * std::sqrt(aF); + V1new = std::max(V1new, -dV); + V2new = std::min(V2new, dV); } else if (aBasCurvType == GeomAbs_Hyperbola) { - V1new = Max(V1new, -30.); - V2new = Min(V2new, 30.); + V1new = std::max(V1new, -30.); + V2new = std::min(V2new, 30.); } else { - V1new = Max(V1new, -1.e10); - V2new = Min(V2new, 1.e10); + V1new = std::max(V1new, -1.e10); + V2new = std::min(V2new, 1.e10); } } else { - V1new = Max(V1new, -1.e10); - V2new = Min(V2new, 1.e10); + V1new = std::max(V1new, -1.e10); + V2new = std::min(V2new, 1.e10); } } @@ -2278,8 +2278,8 @@ void EstLimForInfSurf(Standard_Real& U1new, Standard_Real& V1new, Standard_Real& V2new) { - U1new = Max(U1new, -1.e10); - U2new = Min(U2new, 1.e10); - V1new = Max(V1new, -1.e10); - V2new = Min(V2new, 1.e10); + U1new = std::max(U1new, -1.e10); + U2new = std::min(U2new, 1.e10); + V1new = std::max(V1new, -1.e10); + V2new = std::min(V2new, 1.e10); } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_Intersection.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_Intersection.cxx index 683f568ba5..97fb12e96f 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_Intersection.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_Intersection.cxx @@ -20,7 +20,7 @@ #include #include -#define PARAMEQUAL(a, b) (Abs((a) - (b)) < (1e-8)) +#define PARAMEQUAL(a, b) (std::abs((a) - (b)) < (1e-8)) //================================================================================ IntCurveSurface_Intersection::IntCurveSurface_Intersection() diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_Polyhedron.gxx b/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_Polyhedron.gxx index 052c17ce8c..c8cc62eeaa 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_Polyhedron.gxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_Polyhedron.gxx @@ -339,7 +339,7 @@ Standard_Real IntCurveSurface_Polyhedron::DeflectionOnTriangle(const ThePSurface Standard_Real v = (v1 + v2 + v3) / 3.0; gp_Pnt P = ThePSurfaceTool::Value(Surface, u, v); gp_Vec P1P(P1, P); - return (Abs(P1P.Dot(NormalVector))); + return (std::abs(P1P.Dot(NormalVector))); } //================================================================================================= @@ -875,7 +875,7 @@ Standard_Boolean IntCurveSurface_Polyhedron::IsOnBound(const Standard_Integer In } #endif Standard_Boolean* CMyIsOnBounds = (Standard_Boolean*)C_MyIsOnBounds; - Standard_Integer aDiff = Abs(Index1 - Index2); + Standard_Integer aDiff = std::abs(Index1 - Index2); Standard_Integer i; // Check if points are neighbour ones. diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_TheHCurveTool.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_TheHCurveTool.cxx index 6bac5d6a03..a69d82dd5e 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_TheHCurveTool.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntCurveSurface/IntCurveSurface_TheHCurveTool.cxx @@ -174,8 +174,8 @@ void IntCurveSurface_TheHCurveTool::SamplePars(const Handle(Adaptor3d_Curve)& C, } // Analysis of deflection - Standard_Real aDefl2 = Max(Defl * Defl, 1.e-9); - Standard_Real tol = Max(0.01 * aDefl2, 1.e-9); + Standard_Real aDefl2 = std::max(Defl * Defl, 1.e-9); + Standard_Real tol = std::max(0.01 * aDefl2, 1.e-9); Standard_Integer l; Standard_Integer NbSamples = 2; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntImp/IntImp_ComputeTangence.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntImp/IntImp_ComputeTangence.cxx index 652c95561b..3ef13dc6f6 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntImp/IntImp_ComputeTangence.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntImp/IntImp_ComputeTangence.cxx @@ -115,8 +115,8 @@ Standard_Boolean IntImp_ComputeTangence(const gp_Vec DPuv[], Tgduv[3] = -DPuv[2].Dot(N1); Standard_Boolean tangent = - (Abs(Tgduv[0]) <= EpsUV[0] * NormDuv[1] && Abs(Tgduv[1]) <= EpsUV[1] * NormDuv[0] - && Abs(Tgduv[2]) <= EpsUV[2] * NormDuv[3] && Abs(Tgduv[3]) <= EpsUV[3] * NormDuv[2]); + (std::abs(Tgduv[0]) <= EpsUV[0] * NormDuv[1] && std::abs(Tgduv[1]) <= EpsUV[1] * NormDuv[0] + && std::abs(Tgduv[2]) <= EpsUV[2] * NormDuv[3] && std::abs(Tgduv[3]) <= EpsUV[3] * NormDuv[2]); if (!tangent) { Standard_Real t = N1.Dot(N2); @@ -130,10 +130,10 @@ Standard_Boolean IntImp_ComputeTangence(const gp_Vec DPuv[], if (!tangent) { - NormDuv[0] = Abs(Tgduv[1]) / NormDuv[0]; // iso u sur caro1 - NormDuv[1] = Abs(Tgduv[0]) / NormDuv[1]; // iso v sur caro1 - NormDuv[2] = Abs(Tgduv[3]) / NormDuv[2]; // iso u sur caro2 - NormDuv[3] = Abs(Tgduv[2]) / NormDuv[3]; // iso v sur caro2 + NormDuv[0] = std::abs(Tgduv[1]) / NormDuv[0]; // iso u sur caro1 + NormDuv[1] = std::abs(Tgduv[0]) / NormDuv[1]; // iso v sur caro1 + NormDuv[2] = std::abs(Tgduv[3]) / NormDuv[2]; // iso u sur caro2 + NormDuv[3] = std::abs(Tgduv[2]) / NormDuv[3]; // iso v sur caro2 //-- Tri sur NormDuv ( en para. avec ChoixRef ) Standard_Boolean triOk = Standard_False; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntImp/IntImp_Int2S.gxx b/src/ModelingAlgorithms/TKGeomAlgo/IntImp/IntImp_Int2S.gxx index a5ea3c60e5..d9240e6f03 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntImp/IntImp_Int2S.gxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntImp/IntImp_Int2S.gxx @@ -96,7 +96,7 @@ IntImp_ConstIsoparametric IntImp_Int2S::Perform(const TColStd_Array1OfReal& BestChoix = ChoixIso; if (Rsnld.IsDone()) { - if (Abs(myZerParFunc.Root()) <= tol) + if (std::abs(myZerParFunc.Root()) <= tol) { // distance des 2 points // dans la tolerance Rsnld.Root(UVap); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntImp/IntImp_IntCS.gxx b/src/ModelingAlgorithms/TKGeomAlgo/IntImp/IntImp_IntCS.gxx index cea676277c..6143e21f4b 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntImp/IntImp_IntCS.gxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntImp/IntImp_IntCS.gxx @@ -134,7 +134,7 @@ void IntImp_IntCS::Perform(const Standard_Real U, Rsnld.Perform(myFunction, UVap, BornInf, BornSup); if (Rsnld.IsDone()) { - Standard_Real AbsmyFunctionRoot = Abs(myFunction.Root()); + Standard_Real AbsmyFunctionRoot = std::abs(myFunction.Root()); if (AbsmyFunctionRoot <= tol) { Rsnld.Root(UVap); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntImpParGen/IntImpParGen.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntImpParGen/IntImpParGen.cxx index aaf8eb6f70..1d65cb4de0 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntImpParGen/IntImpParGen.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntImpParGen/IntImpParGen.cxx @@ -69,7 +69,8 @@ void IntImpParGen::DeterminePosition(IntRes2d_Position& Pos1, { if (Pos1 == IntRes2d_Head) { - if (Abs(Param1 - TheDomain.LastParameter()) < Abs(Param1 - TheDomain.FirstParameter())) + if (std::abs(Param1 - TheDomain.LastParameter()) + < std::abs(Param1 - TheDomain.FirstParameter())) Pos1 = IntRes2d_End; } else @@ -129,7 +130,7 @@ void IntImpParGen::DetermineTransition(const IntRes2d_Position Pos1, Standard_Real sgn = Tan1.Crossed(Tan2); Standard_Real norm = Tan1.Magnitude() * Tan2.Magnitude(); - if (Abs(sgn) <= TOLERANCE_ANGULAIRE * norm) + if (std::abs(sgn) <= TOLERANCE_ANGULAIRE * norm) { // Transition TOUCH ######### Standard_Boolean opos = (Tan1.Dot(Tan2)) < 0; if (!(courbure1 || courbure2)) @@ -159,7 +160,7 @@ void IntImpParGen::DetermineTransition(const IntRes2d_Position Pos1, Val2 = Norm.Dot(Norm2); } - if (Abs(Val1 - Val2) <= TOLERANCE_ANGULAIRE) + if (std::abs(Val1 - Val2) <= TOLERANCE_ANGULAIRE) { T1.SetValue(Standard_True, Pos1, IntRes2d_Unknown, opos); T2.SetValue(Standard_True, Pos2, IntRes2d_Unknown, opos); @@ -231,7 +232,7 @@ Standard_Boolean IntImpParGen::DetermineTransition(const IntRes2d_Position Pos1, Standard_Real sgn = Tan1.Crossed(Tan2); Standard_Real norm = Tan1Magnitude * Tan2Magnitude; - if (Abs(sgn) <= TOLERANCE_ANGULAIRE * norm) + if (std::abs(sgn) <= TOLERANCE_ANGULAIRE * norm) { // Transition TOUCH ######### return (Standard_False); } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntImpParGen/IntImpParGen_Intersector.gxx b/src/ModelingAlgorithms/TKGeomAlgo/IntImpParGen/IntImpParGen_Intersector.gxx index 8b62b396cb..6eb88a1101 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntImpParGen/IntImpParGen_Intersector.gxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntImpParGen/IntImpParGen_Intersector.gxx @@ -666,7 +666,7 @@ void IntImpParGen_Intersector::Perform(const ImpTool& TheImpTool, if (!HeadOnPar) { if (TheImpCurveDomain.FirstPoint().Distance(TheParCurveDomain.FirstPoint()) - <= Max(TheImpCurveDomain.FirstTolerance(), TheParCurveDomain.FirstTolerance())) + <= std::max(TheImpCurveDomain.FirstTolerance(), TheParCurveDomain.FirstTolerance())) { param1 = TheImpCurveDomain.FirstParameter(); param2 = TheParCurveDomain.FirstParameter(); @@ -693,7 +693,7 @@ void IntImpParGen_Intersector::Perform(const ImpTool& TheImpTool, if (!EndOnPar) { if (TheImpCurveDomain.FirstPoint().Distance(TheParCurveDomain.LastPoint()) - <= Max(TheImpCurveDomain.FirstTolerance(), TheParCurveDomain.LastTolerance())) + <= std::max(TheImpCurveDomain.FirstTolerance(), TheParCurveDomain.LastTolerance())) { param1 = TheImpCurveDomain.FirstParameter(); param2 = TheParCurveDomain.LastParameter(); @@ -724,7 +724,7 @@ void IntImpParGen_Intersector::Perform(const ImpTool& TheImpTool, if (!HeadOnPar) { if (TheImpCurveDomain.LastPoint().Distance(TheParCurveDomain.FirstPoint()) - <= Max(TheImpCurveDomain.LastTolerance(), TheParCurveDomain.FirstTolerance())) + <= std::max(TheImpCurveDomain.LastTolerance(), TheParCurveDomain.FirstTolerance())) { param1 = TheImpCurveDomain.LastParameter(); param2 = TheParCurveDomain.FirstParameter(); @@ -751,7 +751,7 @@ void IntImpParGen_Intersector::Perform(const ImpTool& TheImpTool, if (!EndOnPar) { if (TheImpCurveDomain.LastPoint().Distance(TheParCurveDomain.LastPoint()) - <= Max(TheImpCurveDomain.LastTolerance(), TheParCurveDomain.LastTolerance())) + <= std::max(TheImpCurveDomain.LastTolerance(), TheParCurveDomain.LastTolerance())) { param1 = TheImpCurveDomain.LastParameter(); param2 = TheParCurveDomain.LastParameter(); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntImpParGen/IntImpParGen_Tool.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntImpParGen/IntImpParGen_Tool.cxx index f49060b51d..e0550757d4 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntImpParGen/IntImpParGen_Tool.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntImpParGen/IntImpParGen_Tool.cxx @@ -69,7 +69,8 @@ void Determine_Position(IntRes2d_Position& Pos1, { if (Pos1 == IntRes2d_Head) { - if (Abs(Param1 - TheDomain.LastParameter()) < Abs(Param1 - TheDomain.FirstParameter())) + if (std::abs(Param1 - TheDomain.LastParameter()) + < std::abs(Param1 - TheDomain.FirstParameter())) Pos1 = IntRes2d_End; } else @@ -126,7 +127,7 @@ void Determine_Transition(const IntRes2d_Position Pos1, Standard_Real sgn = Tan1.Crossed(Tan2); Standard_Real norm = Tan1.Magnitude() * Tan2.Magnitude(); - if (Abs(sgn) <= TOLERANCE_ANGULAIRE * norm) + if (std::abs(sgn) <= TOLERANCE_ANGULAIRE * norm) { // Transition TOUCH ######### Standard_Boolean opos = (Tan1.Dot(Tan2)) < 0; if (!(courbure1 || courbure2)) @@ -156,7 +157,7 @@ void Determine_Transition(const IntRes2d_Position Pos1, Val2 = Norm.Dot(Norm2); } - if (Abs(Val1 - Val2) <= gp::Resolution()) + if (std::abs(Val1 - Val2) <= gp::Resolution()) { T1.SetValue(Standard_True, Pos1, IntRes2d_Unknown, opos); T2.SetValue(Standard_True, Pos2, IntRes2d_Unknown, opos); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ALine.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ALine.cxx index 7d7e5ccd55..ef898d5104 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ALine.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ALine.cxx @@ -80,7 +80,7 @@ void IntPatch_ALine::AddVertex(const IntPatch_Point& VTXj) const IntPatch_Point& VTXi = svtx.Value(i); if((VTXj.IsOnDomS1()==Standard_False) && (VTXj.IsOnDomS2()==Standard_False)) { if((VTXi.IsOnDomS1()==Standard_False) && (VTXi.IsOnDomS2()==Standard_False)) { - if(Abs(par-VTXi.ParameterOnLine())<=PCONFUSION) { + if(std::abs(par-VTXi.ParameterOnLine())<=PCONFUSION) { #if DEBUG std::cout<<" Rejet IntPatch_ALine::AddVertex (0) "< aTol && Abs(aV + M_PI / 2) > aTol) + if (std::abs(aV - M_PI / 2) > aTol && std::abs(aV + M_PI / 2) > aTol) continue; } else @@ -298,7 +298,7 @@ void IntPatch_ALineToWLine::CorrectEndPoint(Handle(IntSurf_LineOn2S)& theLine, Standard_Real aXend, aYend; aPntOn2S.ParametersOnSurface(anIsOnFirst, aXend, aYend); - if (Abs(aDir.Y()) < gp::Resolution()) + if (std::abs(aDir.Y()) < gp::Resolution()) continue; Standard_Real aNewXend = aDir.X() / aDir.Y() * (aYend - aY0) + aX0; @@ -321,7 +321,7 @@ Standard_Real IntPatch_ALineToWLine::GetSectionRadius(const gp_Pnt& thePnt3d) co const gp_XYZ aRVec = thePnt3d.XYZ() - aCone.Apex().XYZ(); const gp_XYZ& aDir = aCone.Axis().Direction().XYZ(); - aRetVal = Min(aRetVal, Abs(aRVec.Dot(aDir) * Tan(aCone.SemiAngle()))); + aRetVal = std::min(aRetVal, std::abs(aRVec.Dot(aDir) * std::tan(aCone.SemiAngle()))); } else if (aQuad.TypeQuadric() == GeomAbs_Sphere) { @@ -338,7 +338,7 @@ Standard_Real IntPatch_ALineToWLine::GetSectionRadius(const gp_Pnt& thePnt3d) co } else { - aRetVal = Min(aRetVal, Sqrt(aDelta)); + aRetVal = std::min(aRetVal, std::sqrt(aDelta)); } } } @@ -450,7 +450,7 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine, } const Standard_Real aTol = 2.0 * myTol3D + Precision::Confusion(); - const Standard_Real aPrmTol = Max(1.0e-4 * (theLPar - theFPar), Precision::PConfusion()); + const Standard_Real aPrmTol = std::max(1.0e-4 * (theLPar - theFPar), Precision::PConfusion()); IntPatch_SpecPntType aPrePointExist = IntPatch_SPntNone; @@ -496,15 +496,15 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine, continue; aLPar = aVertexParams(i); - if (Abs(aLPar - aParameter) < aPrmTol) + if (std::abs(aLPar - aParameter) < aPrmTol) continue; break; } - if ((aStep - (aLPar - aParameter) > aPrmTol) && (Abs(aLPar - aParameter) > aPrmTol)) + if ((aStep - (aLPar - aParameter) > aPrmTol) && (std::abs(aLPar - aParameter) > aPrmTol)) { - aStep = Max((aLPar - aParameter) / 5, 1.e-5); + aStep = std::max((aLPar - aParameter) / 5, 1.e-5); isStepReduced = Standard_True; } @@ -563,13 +563,16 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine, if (aPrePointExist != IntPatch_SPntNone) { - const Standard_Real aURes = Max(myS1->UResolution(myTol3D), myS2->UResolution(myTol3D)), - aVRes = Max(myS1->VResolution(myTol3D), myS2->VResolution(myTol3D)); + const Standard_Real aURes = + std::max(myS1->UResolution(myTol3D), myS2->UResolution(myTol3D)), + aVRes = + std::max(myS1->VResolution(myTol3D), myS2->VResolution(myTol3D)); - const Standard_Real aTol2d = (aPrePointExist == IntPatch_SPntPole) ? -1.0 - : (aPrePointExist == IntPatch_SPntSeamV) ? aVRes - : (aPrePointExist == IntPatch_SPntSeamUV) ? Max(aURes, aVRes) - : aURes; + const Standard_Real aTol2d = (aPrePointExist == IntPatch_SPntPole) ? -1.0 + : (aPrePointExist == IntPatch_SPntSeamV) ? aVRes + : (aPrePointExist == IntPatch_SPntSeamUV) + ? std::max(aURes, aVRes) + : aURes; IntSurf_PntOn2S aRPT = aPOn2S; @@ -604,7 +607,7 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine, myQuad2.Parameters(aPnt3d, u2, v2); aRPT.SetValue(aPnt3d, u1, v1, u2, v2); - if (aPOn2S.IsSame(aPrevLPoint, Max(Precision::Approximation(), aTol))) + if (aPOn2S.IsSame(aPrevLPoint, std::max(Precision::Approximation(), aTol))) { // Set V-parameter as precise value found on the previous step. if (aSingularSurfaceID == 1) @@ -669,7 +672,7 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine, if (((aPrevParam < aParam) && (aParam <= aParameter)) || ((aPrevParam == aParameter) && (aParam == aParameter)) || (aPOn2S.IsSame(aVP.PntOn2S(), aVP.Tolerance()) - && (Abs(aVP.ParameterOnLine() - aParameter) < aPrmTol))) + && (std::abs(aVP.ParameterOnLine() - aParameter) < aPrmTol))) { // We have either jumped over the vertex or "fell" on the vertex. // However, ALine can be self-interfered. Therefore, we need to check @@ -824,8 +827,9 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine, aLVtx.SetValue(aVertP2S); aLVtx.SetTolerance(aVertToler); Standard_Real aParam = aLVtx.ParameterOnLine(); - if (Abs(aParam - theLPar) <= Precision::PConfusion()) // in the case of closed curve, - aLVtx.SetParameter(-1); // we don't know yet the number of points in the curve + if (std::abs(aParam - theLPar) + <= Precision::PConfusion()) // in the case of closed curve, + aLVtx.SetParameter(-1); // we don't know yet the number of points in the curve else aLVtx.SetParameter(aNewVertexParam); aSeqVertex(++aNewVertID) = aLVtx; @@ -857,15 +861,15 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine, continue; aLPar = aVertexParams(i); - if (Abs(aLPar - aParameter) < aPrmTol) + if (std::abs(aLPar - aParameter) < aPrmTol) continue; break; } - if ((aStep - (aLPar - aParameter) > aPrmTol) && (Abs(aLPar - aParameter) > aPrmTol)) + if ((aStep - (aLPar - aParameter) > aPrmTol) && (std::abs(aLPar - aParameter) > aPrmTol)) { - aStep = Max((aLPar - aParameter) / 5, 1.e-5); + aStep = std::max((aLPar - aParameter) / 5, 1.e-5); isStepReduced = Standard_True; } @@ -910,7 +914,7 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine, else { // Computation of transitions of the line on two surfaces --- - const Standard_Integer indice1 = Max(aLinOn2S->NbPoints() / 3, 2); + const Standard_Integer indice1 = std::max(aLinOn2S->NbPoints() / 3, 2); const gp_Pnt & aPP0 = aLinOn2S->Value(indice1 - 1).Value(), &aPP1 = aLinOn2S->Value(indice1).Value(); const gp_Vec tgvalid(aPP0, aPP1); @@ -969,11 +973,11 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine, Standard_Integer IntPatch_ALineToWLine::CheckDeflection(const gp_XYZ& theMidPt, const Standard_Real theMaxDeflection) const { - Standard_Real aDist = Abs(myQuad1.Distance(theMidPt)); + Standard_Real aDist = std::abs(myQuad1.Distance(theMidPt)); if (aDist > theMaxDeflection) return 1; - aDist = Max(Abs(myQuad2.Distance(theMidPt)), aDist); + aDist = std::max(std::abs(myQuad2.Distance(theMidPt)), aDist); if (aDist > theMaxDeflection) return 1; @@ -1007,7 +1011,7 @@ Standard_Boolean IntPatch_ALineToWLine::StepComputing(const Handle(IntPatch_ALin const Standard_Integer aNbIterMax = 50; const Standard_Real aNotFilledRange = theLastParOfAline - theCurParam; - Standard_Real aMinStep = theStepMin, aMaxStep = Min(theStepMax, aNotFilledRange); + Standard_Real aMinStep = theStepMin, aMaxStep = std::min(theStepMax, aNotFilledRange); if (aMinStep > aMaxStep) { @@ -1041,8 +1045,8 @@ Standard_Boolean IntPatch_ALineToWLine::StepComputing(const Handle(IntPatch_ALin // circle is no greater than anEps. theStep is the step in // parameter space of intersection curve (must be converted from 3D-step). - theStep = Min(sqrt(anEps * (2.0 * aR + anEps)) / theTgMagnitude, aMaxStep); - theStep = Max(theStep, aMinStep); + theStep = std::min(sqrt(anEps * (2.0 * aR + anEps)) / theTgMagnitude, aMaxStep); + theStep = std::max(theStep, aMinStep); } // The step value has been computed for osculating circle. diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ArcFunction.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ArcFunction.cxx index de22670ce2..f4fdcac0c8 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ArcFunction.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ArcFunction.cxx @@ -66,7 +66,7 @@ Standard_Integer IntPatch_ArcFunction::GetStateNumber() Standard_Integer IntPatch_ArcFunction::NbSamples() const { - return Max(Max(IntPatch_HInterTool::NbSamplesU(mySurf, 0., 0.), - IntPatch_HInterTool::NbSamplesV(mySurf, 0., 0.)), - IntPatch_HInterTool::NbSamplesOnArc(myArc)); + return std::max(std::max(IntPatch_HInterTool::NbSamplesU(mySurf, 0., 0.), + IntPatch_HInterTool::NbSamplesV(mySurf, 0., 0.)), + IntPatch_HInterTool::NbSamplesOnArc(myArc)); } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_GLine.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_GLine.cxx index 2aa7eabcc8..82e1577bc2 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_GLine.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_GLine.cxx @@ -451,7 +451,7 @@ void IntPatch_GLine::ComputeVertexParameters(const Standard_Real /*Tol*/) const IntPatch_Point& VTXj = svtx.Value(j); if ((!VTXj.IsOnDomS1()) && (!VTXj.IsOnDomS2())) { - if (Abs(VTXi.ParameterOnLine() - VTXj.ParameterOnLine()) <= PrecisionPConfusion) + if (std::abs(VTXi.ParameterOnLine() - VTXj.ParameterOnLine()) <= PrecisionPConfusion) { svtx.Remove(j); nbvtx--; @@ -489,7 +489,7 @@ void IntPatch_GLine::ComputeVertexParameters(const Standard_Real /*Tol*/) const IntPatch_Point& VTXj = svtx.Value(j); if (VTXj.IsOnDomS1() && (!VTXj.IsOnDomS2())) { - if (Abs(VTXi.ParameterOnArc1() - VTXj.ParameterOnArc1()) <= PrecisionPConfusion) + if (std::abs(VTXi.ParameterOnArc1() - VTXj.ParameterOnArc1()) <= PrecisionPConfusion) { if (VTXi.ArcOnS1() == VTXj.ArcOnS1()) { @@ -548,7 +548,7 @@ void IntPatch_GLine::ComputeVertexParameters(const Standard_Real /*Tol*/) const IntPatch_Point& VTXj = svtx.Value(j); if (VTXj.IsOnDomS2() && (!VTXj.IsOnDomS1())) { - if (Abs(VTXi.ParameterOnArc2() - VTXj.ParameterOnArc2()) <= PrecisionPConfusion) + if (std::abs(VTXi.ParameterOnArc2() - VTXj.ParameterOnArc2()) <= PrecisionPConfusion) { if (VTXi.ArcOnS2() == VTXj.ArcOnS2()) { @@ -650,7 +650,7 @@ void IntPatch_GLine::ComputeVertexParameters(const Standard_Real /*Tol*/) IntPatch_Point& VTXM1 = svtx.ChangeValue(j); Standard_Boolean kill = Standard_False; Standard_Boolean killm1 = Standard_False; - if (Abs(VTXM1.ParameterOnLine() - VTX.ParameterOnLine()) < PrecisionPConfusion) + if (std::abs(VTXM1.ParameterOnLine() - VTX.ParameterOnLine()) < PrecisionPConfusion) { if (VTXM1.IsOnDomS1() && VTX.IsOnDomS1()) //-- OnS1 OnS1 { @@ -814,7 +814,7 @@ void IntPatch_GLine::ComputeVertexParameters(const Standard_Real /*Tol*/) // eap, =>> Standard_Real newParam = ponline; const Standard_Real PiPi = M_PI + M_PI; - Standard_Boolean is2PI = (Abs(ponline - PiPi) <= PrecisionPConfusion); + Standard_Boolean is2PI = (std::abs(ponline - PiPi) <= PrecisionPConfusion); if (nbvtx > 2 && // do this check if seam edge only gives vertices !is2PI) // but always change 2PI -> 0 @@ -822,13 +822,13 @@ void IntPatch_GLine::ComputeVertexParameters(const Standard_Real /*Tol*/) if (is2PI) newParam = 0; - else if (Abs(ponline) <= PrecisionPConfusion) + else if (std::abs(ponline) <= PrecisionPConfusion) newParam = PiPi; else newParam -= PiPi; - // if( (Abs(ponline)<=PrecisionPConfusion) - // ||(Abs(ponline-M_PI-M_PI) <=PrecisionPConfusion)) + // if( (std::abs(ponline)<=PrecisionPConfusion) + // ||(std::abs(ponline-M_PI-M_PI) <=PrecisionPConfusion)) // eap, <<= Standard_Real u1a, v1a, u2a, v2a, u1b, v1b, u2b, v2b; @@ -836,15 +836,15 @@ void IntPatch_GLine::ComputeVertexParameters(const Standard_Real /*Tol*/) VTX.Parameters(u1b, v1b, u2b, v2b); Standard_Integer flag = 0; - if ((Abs(u1a - u1b) <= PrecisionPConfusion)) + if ((std::abs(u1a - u1b) <= PrecisionPConfusion)) flag |= 1; - if ((Abs(v1a - v1b) <= PrecisionPConfusion)) + if ((std::abs(v1a - v1b) <= PrecisionPConfusion)) flag |= 2; - if ((Abs(u2a - u2b) <= PrecisionPConfusion)) + if ((std::abs(u2a - u2b) <= PrecisionPConfusion)) flag |= 4; - if ((Abs(v2a - v2b) <= PrecisionPConfusion)) + if ((std::abs(v2a - v2b) <= PrecisionPConfusion)) flag |= 8; Standard_Boolean TestOn1 = Standard_False; @@ -889,14 +889,14 @@ void IntPatch_GLine::ComputeVertexParameters(const Standard_Real /*Tol*/) } else { - if (Abs(U1A - u1min) > PrecisionPConfusion) + if (std::abs(U1A - u1min) > PrecisionPConfusion) ToBreak = Standard_True; - if (Abs(U1B - u1max) > PrecisionPConfusion) + if (std::abs(U1B - u1max) > PrecisionPConfusion) ToBreak = Standard_True; } /////////////////////////////////////////////// // eap, =>> - // if (Abs(ponline) <= PrecisionPConfusion) { + // if (std::abs(ponline) <= PrecisionPConfusion) { // const Standard_Real PiPi = M_PI+M_PI; if (newParam >= ParamMinOnLine && newParam <= ParamMaxOnLine /*PiPi >= ParamMinOnLine && PiPi<=ParamMaxOnLine*/) @@ -950,15 +950,15 @@ void IntPatch_GLine::ComputeVertexParameters(const Standard_Real /*Tol*/) } else { - if (Abs(U2A - u2min) > PrecisionPConfusion) + if (std::abs(U2A - u2min) > PrecisionPConfusion) ToBreak = Standard_True; - if (Abs(U2B - u2max) > PrecisionPConfusion) + if (std::abs(U2B - u2max) > PrecisionPConfusion) ToBreak = Standard_True; } /////////////////////////////////////////////// // eap, =>> - // if (Abs(ponline) <= PrecisionPConfusion) { + // if (std::abs(ponline) <= PrecisionPConfusion) { // const Standard_Real PiPi = M_PI+M_PI; if (newParam >= ParamMinOnLine && newParam <= ParamMaxOnLine /*PiPi >= ParamMinOnLine && PiPi<=ParamMaxOnLine*/) diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_HInterTool.hxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_HInterTool.hxx index 12cf9f1761..d283670508 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_HInterTool.hxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_HInterTool.hxx @@ -89,7 +89,7 @@ public: //! Returns the parametric tolerance used to consider //! that the vertex and another point meet, i-e - //! if Abs(parameter(Vertex) - parameter(OtherPnt))<= + //! if std::abs(parameter(Vertex) - parameter(OtherPnt))<= //! Tolerance, the points are "merged". Standard_EXPORT static Standard_Real Tolerance(const Handle(Adaptor3d_HVertex)& V, const Handle(Adaptor2d_Curve2d)& C); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ImpImpIntersection.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ImpImpIntersection.cxx index 5400beb290..27fa39bdf7 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ImpImpIntersection.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ImpImpIntersection.cxx @@ -207,14 +207,14 @@ Standard_Boolean IntersectionWithAnArc(gp_Pnt& PSurf, Standard_Real da = (-PaPr.X()) * d2d.Y() - (-PaPr.Y()) * d2d.X(); Standard_Real dr = D1a.X() * (-PaPr.Y()) - D1a.Y() * (-PaPr.X()); - if (Abs(d) > 1e-15) + if (std::abs(d) > 1e-15) { da /= d; dr /= d; } else { - if (Abs(PaPr.X()) > Abs(PaPr.Y())) + if (std::abs(PaPr.X()) > std::abs(PaPr.Y())) { Standard_Real xx = PaPr.X(); xx *= 0.5; @@ -253,7 +253,7 @@ Standard_Boolean IntersectionWithAnArc(gp_Pnt& PSurf, else if (dr > drmax) dr = drmax; - if (Abs(da) < 1e-10 && Abs(dr) < 1e-10) + if (std::abs(da) < 1e-10 && std::abs(dr) < 1e-10) { para = theta; PSurf = alin->Value(para); @@ -530,7 +530,7 @@ void PutPointsOnLine(const Handle(Adaptor3d_Surface)& S1, Standard_Real aVtxTol = aVtx->Resolution(currentarc); Standard_Real aTolAng = 0.01 * tolerance; - tolerance = Max(tolerance, aVtxTol); + tolerance = std::max(tolerance, aVtxTol); gp_Vec aNorm1 = QuadSurf.Normale(Psurf); gp_Vec aNorm2 = OtherQuad.Normale(Psurf); @@ -538,7 +538,7 @@ void PutPointsOnLine(const Handle(Adaptor3d_Surface)& S1, if (aNorm1.Magnitude() > gp::Resolution() && aNorm2.Magnitude() > gp::Resolution()) { if (aNorm1.IsParallel(aNorm2, aTolAng)) - tolerance = Sqrt(tolerance); + tolerance = std::sqrt(tolerance); } // } // Modified by skv - Thu Jan 15 15:57:15 2004 OCC4455 End @@ -1211,7 +1211,7 @@ Standard_Boolean FindLine(gp_Pnt& Psurf, const gp_Pnt ptbis = ElCLib::Value(parabis, Parab); const Standard_Real distbis = Psurf.Distance(ptbis); - const Standard_Real aDist = Sqrt(aSqDist); + const Standard_Real aDist = std::sqrt(aSqDist); const Standard_Real ddist = distbis - aDist; //--cout<<" para: "<ArcType(); @@ -2630,7 +2630,7 @@ void IntPatch_ImpImpIntersection::Perform(const Handle(Adaptor3d_Surface)& S1, // too small. Therefore, we shall bind its value above. // Here, we use simple constant. const Standard_Real a2DTol = - Min(1.0e-4, Min(S1->UResolution(TolTang), S2->UResolution(TolTang))); + std::min(1.0e-4, std::min(S1->UResolution(TolTang), S2->UResolution(TolTang))); myDone = IntCyCy(quad1, quad2, TolTang, a2DTol, aBox1, aBox2, empt, SameSurf, multpoint, slin, spnt); @@ -3902,7 +3902,7 @@ void SeamPosition(const gp_Pnt& aPLoc, const gp_Ax3& aPos, gp_Ax2& aSeamPos) // modified by NIZNHY-PKV Thu Sep 15 10:53:41 2011t -// If Abs(a) <= aNulValue then it is considered that a = 0. +// If std::abs(a) <= aNulValue then it is considered that a = 0. static const Standard_Real aNulValue = 1.0e-11; static void ShortCosForm(const Standard_Real theCosFactor, @@ -4059,9 +4059,9 @@ ComputationMethods::stCoeffsValue::stCoeffsValue(const gp_Cylinder& theCyl1, const Standard_Real aDelta1 = mVecC1(1) * mVecC2(2) - mVecC1(2) * mVecC2(1); // 1-2 const Standard_Real aDelta2 = mVecC1(2) * mVecC2(3) - mVecC1(3) * mVecC2(2); // 2-3 const Standard_Real aDelta3 = mVecC1(1) * mVecC2(3) - mVecC1(3) * mVecC2(1); // 1-3 - const Standard_Real anAbsD1 = Abs(aDelta1); // 1-2 - const Standard_Real anAbsD2 = Abs(aDelta2); // 2-3 - const Standard_Real anAbsD3 = Abs(aDelta3); // 1-3 + const Standard_Real anAbsD1 = std::abs(aDelta1); // 1-2 + const Standard_Real anAbsD2 = std::abs(aDelta2); // 2-3 + const Standard_Real anAbsD3 = std::abs(aDelta3); // 1-3 if (anAbsD1 >= anAbsD2) { @@ -4096,7 +4096,7 @@ ComputationMethods::stCoeffsValue::stCoeffsValue(const gp_Cylinder& theCyl1, // Therefore, in this case we should compare sine with angular tolerance. // This constant is used for check if axes are parallel (see constructor // AxeOperator::AxeOperator(...) in IntAna_QuadQuadGeo.cxx file). - if (Abs(aDetV1V2) < Precision::Angular()) + if (std::abs(aDetV1V2) < Precision::Angular()) { throw Standard_Failure("Error. Exception in divide by zerro (IntCyCyTrim)!!!!"); } @@ -4477,12 +4477,12 @@ static inline Standard_Boolean DeltaU1Computing(const math_Matrix& theSyst, { Standard_Real aDet = theSyst.Determinant(); - if (Abs(aDet) > aNulValue) + if (std::abs(aDet) > aNulValue) { math_Matrix aSyst1(theSyst); aSyst1.SetCol(2, theFree); - theDeltaU1Found = Abs(aSyst1.Determinant() / aDet); + theDeltaU1Found = std::abs(aSyst1.Determinant() / aDet); return Standard_True; } @@ -4595,9 +4595,9 @@ static Standard_Boolean StepComputing(const math_Matrix& theMatr, const Standard_Real aDet1 = theMatr(1, 3) * theMatr(2, 4) - theMatr(2, 3) * theMatr(1, 4); const Standard_Real aDet2 = theMatr(1, 3) * theMatr(3, 4) - theMatr(3, 3) * theMatr(1, 4); const Standard_Real aDet3 = theMatr(2, 3) * theMatr(3, 4) - theMatr(3, 3) * theMatr(2, 4); - const Standard_Real anAbsD1 = Abs(aDet1); - const Standard_Real anAbsD2 = Abs(aDet2); - const Standard_Real anAbsD3 = Abs(aDet3); + const Standard_Real anAbsD1 = std::abs(aDet1); + const Standard_Real anAbsD2 = std::abs(aDet2); + const Standard_Real anAbsD3 = std::abs(aDet3); if (anAbsD1 >= anAbsD2) { @@ -4607,7 +4607,7 @@ static Standard_Boolean StepComputing(const math_Matrix& theMatr, if (anAbsD1 <= aNulValue) return isSuccess; - theDeltaU1Found = Abs(aFree(1) * theMatr(2, 4) - aFree(2) * theMatr(1, 4)) / anAbsD1; + theDeltaU1Found = std::abs(aFree(1) * theMatr(2, 4) - aFree(2) * theMatr(1, 4)) / anAbsD1; isSuccess = Standard_True; } else @@ -4616,7 +4616,7 @@ static Standard_Boolean StepComputing(const math_Matrix& theMatr, if (anAbsD3 <= aNulValue) return isSuccess; - theDeltaU1Found = Abs(aFree(2) * theMatr(3, 4) - aFree(3) * theMatr(2, 4)) / anAbsD3; + theDeltaU1Found = std::abs(aFree(2) * theMatr(3, 4) - aFree(3) * theMatr(2, 4)) / anAbsD3; isSuccess = Standard_True; } } @@ -4628,7 +4628,7 @@ static Standard_Boolean StepComputing(const math_Matrix& theMatr, if (anAbsD2 <= aNulValue) return isSuccess; - theDeltaU1Found = Abs(aFree(1) * theMatr(3, 4) - aFree(3) * theMatr(1, 4)) / anAbsD2; + theDeltaU1Found = std::abs(aFree(1) * theMatr(3, 4) - aFree(3) * theMatr(1, 4)) / anAbsD2; isSuccess = Standard_True; } else @@ -4637,7 +4637,7 @@ static Standard_Boolean StepComputing(const math_Matrix& theMatr, if (anAbsD3 <= aNulValue) return isSuccess; - theDeltaU1Found = Abs(aFree(2) * theMatr(3, 4) - aFree(3) * theMatr(2, 4)) / anAbsD3; + theDeltaU1Found = std::abs(aFree(2) * theMatr(3, 4) - aFree(3) * theMatr(2, 4)) / anAbsD3; isSuccess = Standard_True; } } @@ -5175,7 +5175,7 @@ static void ShortCosForm(const Standard_Real theCosFactor, return; } - theAngle = acos(Abs(theCosFactor / theCoeff)); + theAngle = acos(std::abs(theCosFactor / theCoeff)); if (theSinFactor > 0.0) { @@ -5295,7 +5295,7 @@ Standard_Boolean ComputationMethods::CylCylComputeParameters(const Standard_Real Standard_Real* const theDelta) { // This formula is got from some experience and can be changed. - const Standard_Real aTol0 = Min(10.0 * Epsilon(1.0) * theCoeffs.mB, aNulValue); + const Standard_Real aTol0 = std::min(10.0 * Epsilon(1.0) * theCoeffs.mB, aNulValue); const Standard_Real aTol = 1.0 - aTol0; if (theWLIndex < 0 || theWLIndex > 1) @@ -5342,14 +5342,14 @@ Standard_Boolean ComputationMethods::CylCylComputeParameters(const Standard_Real // If p == (1-d) (when p > 0) or p == (-1+d) (when p < 0) then // acos(p)-acos(p+x) = x/sqrt(d*(2-d)). - // Here always aTol0 <= d <= 1. Max(x) is considered (!) to be equal to aTol0. + // Here always aTol0 <= d <= 1. std::max(x) is considered (!) to be equal to aTol0. // In this case // 8*aTol0 <= acos(p)-acos(p+x) <= sqrt(2/(2-aTol0)-1), // because 0 < aTol0 < 1. // E.g. when aTol0 = 1.0e-11, // 8.0e-11 <= acos(p)-acos(p+x) < 2.24e-6. - const Standard_Real aDelta = Min(1.0 - anArg, 1.0 + anArg); + const Standard_Real aDelta = std::min(1.0 - anArg, 1.0 + anArg); Standard_DivideByZero_Raise_if((aDelta * aDelta < RealSmall()) || (aDelta >= 2.0), "IntPatch_ImpImpIntersection_4.gxx, CylCylComputeParameters()"); *theDelta = aTol0 / sqrt(aDelta * (2.0 - aDelta)); @@ -5466,7 +5466,7 @@ Standard_Boolean WorkWithBoundaries::SearchOnVBounds(const SearchBoundType theSB Standard_Real aDetMainSyst = aMatr.Determinant(); - if (Abs(aDetMainSyst) < aNulValue) + if (std::abs(aDetMainSyst) < aNulValue) { return Standard_False; } @@ -5482,7 +5482,7 @@ Standard_Boolean WorkWithBoundaries::SearchOnVBounds(const SearchBoundType theSB Standard_Real aDelta = aDetMainVar / aDetMainSyst - aMainVarPrev; - if (Abs(aDelta) > aMaxError) + if (std::abs(aDelta) > aMaxError) return Standard_False; anError = aDelta * aDelta; @@ -5491,7 +5491,7 @@ Standard_Boolean WorkWithBoundaries::SearchOnVBounds(const SearchBoundType theSB /// aDelta = aDetVar1 / aDetMainSyst - aU2Prev; - if (Abs(aDelta) > aMaxError) + if (std::abs(aDelta) > aMaxError) return Standard_False; anError += aDelta * aDelta; @@ -5601,7 +5601,7 @@ static Standard_Boolean InscribeInterval(const Standard_Real theUfTarget, anUpar, theTol2D, thePeriod, - (Abs(theUlTarget - anUpar) < theTol2D))) + (std::abs(theUlTarget - anUpar) < theTol2D))) { theRange.SetVoid(); theRange.Add(anUpar); @@ -5619,7 +5619,7 @@ static Standard_Boolean InscribeInterval(const Standard_Real theUfTarget, anUpar, theTol2D, thePeriod, - (Abs(theUfTarget - anUpar) < theTol2D))) + (std::abs(theUfTarget - anUpar) < theTol2D))) { theRange.SetVoid(); theRange.Add(anUpar); @@ -5746,9 +5746,9 @@ static Standard_Boolean AddPointIntoWL(const IntSurf_Quadric& } const Standard_Real aDelta = aU1 - aU1par; - if (2.0 * Abs(aDelta) > thePeriodOfSurf1) + if (2.0 * std::abs(aDelta) > thePeriodOfSurf1) { - aU1par += Sign(thePeriodOfSurf1, aDelta); + aU1par += std::copysign(thePeriodOfSurf1, aDelta); } } @@ -5911,7 +5911,7 @@ void WorkWithBoundaries::AddBoundaryPoint(const Handle(IntPatch_WLine)& theWL, aUVPoint[anIndex].mySurfID = anIDSurf; - if ((Abs(aVf - anArrVzad[anIndex]) > myTol2D) + if ((std::abs(aVf - anArrVzad[anIndex]) > myTol2D) && ((aVf - anArrVzad[anIndex]) * (aVl - anArrVzad[anIndex]) > 0.0)) { continue; @@ -6049,7 +6049,7 @@ static void SeekAdditionalPoints(const IntSurf_Quadric& theQua theLine->Value(theEndPointOnLine).ParametersOnS1(u2, v2); } - aMinDeltaParam = Max(Abs(u2 - u1) / IntToReal(theMinNbPoints), aMinDeltaParam); + aMinDeltaParam = std::max(std::abs(u2 - u1) / IntToReal(theMinNbPoints), aMinDeltaParam); } Standard_Integer aLastPointIndex = theEndPointOnLine; @@ -6086,7 +6086,7 @@ static void SeekAdditionalPoints(const IntSurf_Quadric& theQua theLine->Value(lp).ParametersOnS2(U2l, V2l); } - if (Abs(U1l - U1f) <= aMinDeltaParam) + if (std::abs(U1l - U1f) <= aMinDeltaParam) { // Step is minimal. It is not necessary to divide it. continue; @@ -6163,13 +6163,13 @@ Standard_Boolean WorkWithBoundaries::BoundariesComputing( { // -(1+C)/B <= cos(U1-FI1) <= (1-C)/B - if (theCoeffs.mB + Abs(theCoeffs.mC) < -1.0) + if (theCoeffs.mB + std::abs(theCoeffs.mC) < -1.0) { //(1-C)/B < -1 or -(1+C)/B > 1 ==> No solution return Standard_False; } - else if (theCoeffs.mB + Abs(theCoeffs.mC) <= 1.0) + else if (theCoeffs.mB + std::abs(theCoeffs.mC) <= 1.0) { //(1-C)/B >= 1 and -(1+C)/B <= -1 ==> U=[0;2*PI]+aFI1 theURange[0].Add(theCoeffs.mFI1); @@ -6208,7 +6208,7 @@ Standard_Boolean WorkWithBoundaries::BoundariesComputing( theURange[0].Add(aDAngle + theCoeffs.mFI1); theURange[0].Add(thePeriod - aDAngle + theCoeffs.mFI1); } - else if (theCoeffs.mB - Abs(theCoeffs.mC) >= 1.0) + else if (theCoeffs.mB - std::abs(theCoeffs.mC) >= 1.0) { //(1-C)/B <= 1 and -(1+C)/B >= -1 ==> //(U=[aDAngle1;aDAngle2]+aFI1) || @@ -6245,12 +6245,12 @@ Standard_Boolean WorkWithBoundaries::BoundariesComputing( { // (1-C)/B <= cos(U1-FI1) <= -(1+C)/B - if (theCoeffs.mB + Abs(theCoeffs.mC) > 1.0) + if (theCoeffs.mB + std::abs(theCoeffs.mC) > 1.0) { // -(1+C)/B < -1 or (1-C)/B > 1 ==> No solutions return Standard_False; } - else if (-theCoeffs.mB + Abs(theCoeffs.mC) <= 1.0) + else if (-theCoeffs.mB + std::abs(theCoeffs.mC) <= 1.0) { // -(1+C)/B >= 1 and (1-C)/B <= -1 ==> U=[0;2*PI]+aFI1 theURange[0].Add(theCoeffs.mFI1); @@ -6289,7 +6289,7 @@ Standard_Boolean WorkWithBoundaries::BoundariesComputing( theURange[0].Add(aDAngle + theCoeffs.mFI1); theURange[0].Add(thePeriod - aDAngle + theCoeffs.mFI1); } - else if (-theCoeffs.mB - Abs(theCoeffs.mC) >= 1.0) + else if (-theCoeffs.mB - std::abs(theCoeffs.mC) >= 1.0) { // -(1+C)/B <= 1 and (1-C)/B >= -1 ==> //(U=[aDAngle1;aDAngle2]+aFI1) || (U=[2*PI-aDAngle2;2*PI-aDAngle1]+aFI1), @@ -6358,7 +6358,7 @@ static void CriticalPointsComputing(const ComputationMethods::stCoeffsValue& the theU1crit[3] = theUSurf1l; const Standard_Real aCOS = cos(theCoeffs.mFI2); - const Standard_Real aBSB = Abs(theCoeffs.mB); + const Standard_Real aBSB = std::abs(theCoeffs.mB); if ((theCoeffs.mC - aBSB <= aCOS) && (aCOS <= theCoeffs.mC + aBSB)) { Standard_Real anArg = (aCOS - theCoeffs.mC) / theCoeffs.mB; @@ -6377,16 +6377,16 @@ static void CriticalPointsComputing(const ComputationMethods::stCoeffsValue& the // In accorance with pure mathematic, theU1crit[6] and [8] // must be -Precision::Infinite() instead of used +Precision::Infinite() - theU1crit[6] = Abs((aSl - theCoeffs.mC) / theCoeffs.mB) < 1.0 + theU1crit[6] = std::abs((aSl - theCoeffs.mC) / theCoeffs.mB) < 1.0 ? -acos((aSl - theCoeffs.mC) / theCoeffs.mB) + theCoeffs.mFI1 : Precision::Infinite(); - theU1crit[7] = Abs((aSf - theCoeffs.mC) / theCoeffs.mB) < 1.0 + theU1crit[7] = std::abs((aSf - theCoeffs.mC) / theCoeffs.mB) < 1.0 ? -acos((aSf - theCoeffs.mC) / theCoeffs.mB) + theCoeffs.mFI1 : Precision::Infinite(); - theU1crit[8] = Abs((aSf - theCoeffs.mC) / theCoeffs.mB) < 1.0 + theU1crit[8] = std::abs((aSf - theCoeffs.mC) / theCoeffs.mB) < 1.0 ? acos((aSf - theCoeffs.mC) / theCoeffs.mB) + theCoeffs.mFI1 : Precision::Infinite(); - theU1crit[9] = Abs((aSl - theCoeffs.mC) / theCoeffs.mB) < 1.0 + theU1crit[9] = std::abs((aSl - theCoeffs.mC) / theCoeffs.mB) < 1.0 ? acos((aSl - theCoeffs.mC) / theCoeffs.mB) + theCoeffs.mFI1 : Precision::Infinite(); @@ -6438,7 +6438,7 @@ static void CriticalPointsComputing(const ComputationMethods::stCoeffsValue& the // Compare 1st and last significant elements of theU1crit // They may still differs by period. - if (Abs(anB - anA - thePeriod) < theTol2D) + if (std::abs(anB - anA - thePeriod) < theTol2D) { // E.g. anA == 2.0e-17, anB == (thePeriod-1.0e-18) anA = (anA + anB - thePeriod) / 2.0; anB = Precision::Infinite(); @@ -6481,7 +6481,7 @@ void WorkWithBoundaries::BoundaryEstimation(const gp_Cylinder& theCy1, // projections of two opposite parallelogram vertices //(joined by the maximal diagonal) to the cylinder axis. const Standard_Real aSinA = sqrt(aSqSinA); - const Standard_Real anAbsCosA = Abs(aCosA); + const Standard_Real anAbsCosA = std::abs(aCosA); const Standard_Real aHDV1 = (aR1 * anAbsCosA + aR2) / aSinA, aHDV2 = (aR2 * anAbsCosA + aR1) / aSinA; @@ -6599,7 +6599,7 @@ static IntPatch_ImpImpIntersection::IntStatus CyCyNoGeometric( if (anRmin * aDeflection > 1.e-3) { Standard_Real anAngle = 1.0e0 - aDeflection; - anAngle = 2.0e0 * ACos(anAngle); + anAngle = 2.0e0 * std::acos(anAngle); aNbP = (Standard_Integer)(2. * M_PI / anAngle) + 1; } anOptdu = 2. * M_PI_2 / (Standard_Real)(aNbP - 1); @@ -6627,9 +6627,9 @@ static IntPatch_ImpImpIntersection::IntStatus CyCyNoGeometric( du = 2. * M_PI / aNbMaxPoints; } Standard_Integer aNbPts = - Min(RealToInt((aUSurf1l - aUSurf1f) / du) + 1, RealToInt(20.0 * theCyl1.Radius())); - const Standard_Integer aNbPoints = Min(Max(aNbMinPoints, aNbPts), aNbMaxPoints); - const Standard_Real aStepMin = Max(aTol2D, Precision::PConfusion()), + std::min(RealToInt((aUSurf1l - aUSurf1f) / du) + 1, RealToInt(20.0 * theCyl1.Radius())); + const Standard_Integer aNbPoints = std::min(std::max(aNbMinPoints, aNbPts), aNbMaxPoints); + const Standard_Real aStepMin = std::max(aTol2D, Precision::PConfusion()), aStepMax = (aUSurf1l - aUSurf1f > M_PI / 100.0) ? (aUSurf1l - aUSurf1f) / IntToReal(aNbPoints) : aUSurf1l - aUSurf1f; @@ -6834,15 +6834,15 @@ static IntPatch_ImpImpIntersection::IntStatus CyCyNoGeometric( ComputationMethods::CylCylComputeParameters(anU1, i, anEquationCoeffs, aU2[i], &aTol); InscribePoint(aUSurf2f, aUSurf2l, aU2[i], aTol2D, aPeriod, Standard_False); - aTol = Max(aTol, aTol2D); + aTol = std::max(aTol, aTol2D); - if (Abs(aU2[i]) <= aTol) + if (std::abs(aU2[i]) <= aTol) aU2[i] = 0.0; - else if (Abs(aU2[i] - aPeriod) <= aTol) + else if (std::abs(aU2[i] - aPeriod) <= aTol) aU2[i] = aPeriod; - else if (Abs(aU2[i] - aUSurf2f) <= aTol) + else if (std::abs(aU2[i] - aUSurf2f) <= aTol) aU2[i] = aUSurf2f; - else if (Abs(aU2[i] - aUSurf2l) <= aTol) + else if (std::abs(aU2[i] - aUSurf2l) <= aTol) aU2[i] = aUSurf2l; } else @@ -6854,7 +6854,8 @@ static IntPatch_ImpImpIntersection::IntStatus CyCyNoGeometric( if (aNbPntsWL == 0) { // the line has not contained any points yet if (((aUSurf2f + aPeriod - aUSurf2l) <= 2.0 * aTol2D) - && ((Abs(aU2[i] - aUSurf2f) < aTol2D) || (Abs(aU2[i] - aUSurf2l) < aTol2D))) + && ((std::abs(aU2[i] - aUSurf2f) < aTol2D) + || (std::abs(aU2[i] - aUSurf2l) < aTol2D))) { // In this case aU2[i] can have two values: current aU2[i] or // aU2[i]+aPeriod (aU2[i]-aPeriod). It is necessary to choose @@ -6885,7 +6886,8 @@ static IntPatch_ImpImpIntersection::IntStatus CyCyNoGeometric( else { // aNbPntsWL > 0 if (((aUSurf2l - aUSurf2f) >= aPeriod) - && ((Abs(aU2[i] - aUSurf2f) < aTol2D) || (Abs(aU2[i] - aUSurf2l) < aTol2D))) + && ((std::abs(aU2[i] - aUSurf2f) < aTol2D) + || (std::abs(aU2[i] - aUSurf2l) < aTol2D))) { // end of the line Standard_Real aU2prev = 0.0, aV2prev = 0.0; if (isReversed) @@ -6893,7 +6895,7 @@ static IntPatch_ImpImpIntersection::IntStatus CyCyNoGeometric( else aWLine[i]->Curve()->Value(aNbPntsWL).ParametersOnS2(aU2prev, aV2prev); - if (2.0 * Abs(aU2prev - aU2[i]) > aPeriod) + if (2.0 * std::abs(aU2prev - aU2[i]) > aPeriod) { if (aU2prev > aU2[i]) aU2[i] += aPeriod; @@ -6925,22 +6927,22 @@ static IntPatch_ImpImpIntersection::IntStatus CyCyNoGeometric( if (!isAddingWLEnabled[i]) { Standard_Boolean isBoundIntersect = Standard_False; - if ((Abs(aV1[i] - aVSurf1f) <= aTol2D) + if ((std::abs(aV1[i] - aVSurf1f) <= aTol2D) || ((aV1[i] - aVSurf1f) * (aV1Prev[i] - aVSurf1f) < 0.0)) { isBoundIntersect = Standard_True; } - else if ((Abs(aV1[i] - aVSurf1l) <= aTol2D) + else if ((std::abs(aV1[i] - aVSurf1l) <= aTol2D) || ((aV1[i] - aVSurf1l) * (aV1Prev[i] - aVSurf1l) < 0.0)) { isBoundIntersect = Standard_True; } - else if ((Abs(aV2[i] - aVSurf2f) <= aTol2D) + else if ((std::abs(aV2[i] - aVSurf2f) <= aTol2D) || ((aV2[i] - aVSurf2f) * (aV2Prev[i] - aVSurf2f) < 0.0)) { isBoundIntersect = Standard_True; } - else if ((Abs(aV2[i] - aVSurf2l) <= aTol2D) + else if ((std::abs(aV2[i] - aVSurf2l) <= aTol2D) || ((aV2[i] - aVSurf2l) * (aV2Prev[i] - aVSurf2l) < 0.0)) { isBoundIntersect = Standard_True; @@ -6982,7 +6984,7 @@ static IntPatch_ImpImpIntersection::IntStatus CyCyNoGeometric( if (aWLFindStatus[i] == WLFStatus_Absent) { - if (((aUSurf2l - aUSurf2f) >= aPeriod) && (Abs(anU1 - aUSurf1l) < aTol2D)) + if (((aUSurf2l - aUSurf2f) >= aPeriod) && (std::abs(anU1 - aUSurf1l) < aTol2D)) { isForce = Standard_True; } @@ -7001,11 +7003,11 @@ static IntPatch_ImpImpIntersection::IntStatus CyCyNoGeometric( isFound1, isFound2); - const Standard_Boolean isPrevVBound = - !isVIntersect - && ((Abs(aV1Prev[i] - aVSurf1f) <= aTol2D) || (Abs(aV1Prev[i] - aVSurf1l) <= aTol2D) - || (Abs(aV2Prev[i] - aVSurf2f) <= aTol2D) - || (Abs(aV2Prev[i] - aVSurf2l) <= aTol2D)); + const Standard_Boolean isPrevVBound = !isVIntersect + && ((std::abs(aV1Prev[i] - aVSurf1f) <= aTol2D) + || (std::abs(aV1Prev[i] - aVSurf1l) <= aTol2D) + || (std::abs(aV2Prev[i] - aVSurf2f) <= aTol2D) + || (std::abs(aV2Prev[i] - aVSurf2l) <= aTol2D)); aV1Prev[i] = aV1[i]; aV2Prev[i] = aV2[i]; @@ -7034,7 +7036,7 @@ static IntPatch_ImpImpIntersection::IntStatus CyCyNoGeometric( const Standard_Real aDelta = aU2[i] - aU2p; - if (2.0 * Abs(aDelta) > aPeriod) + if (2.0 * std::abs(aDelta) > aPeriod) { if (aDelta > 0.0) { @@ -7140,7 +7142,7 @@ static IntPatch_ImpImpIntersection::IntStatus CyCyNoGeometric( const Standard_Real aDelta = aU2[i] - aU2p; - if (2 * Abs(aDelta) > aPeriod) + if (2 * std::abs(aDelta) > aPeriod) { if (aDelta > 0.0) { @@ -7201,7 +7203,7 @@ static IntPatch_ImpImpIntersection::IntStatus CyCyNoGeometric( else aWLine[i]->Curve()->Value(aWLine[i]->NbPnts()).ParametersOnS1(aU1c, aV1c); - anUmaxAdded = Max(anUmaxAdded, aU1c); + anUmaxAdded = std::max(anUmaxAdded, aU1c); isChanged = Standard_True; } @@ -7279,7 +7281,7 @@ static IntPatch_ImpImpIntersection::IntStatus CyCyNoGeometric( if (aWLFindStatus[i] == WLFStatus_Absent) { anUexpect[i] += aStepMax; - aMinUexp = Min(aMinUexp, anUexpect[i]); + aMinUexp = std::min(aMinUexp, anUexpect[i]); continue; } // @@ -7287,7 +7289,7 @@ static IntPatch_ImpImpIntersection::IntStatus CyCyNoGeometric( { // Use constant step anUexpect[i] += aStepMax; - aMinUexp = Min(aMinUexp, anUexpect[i]); + aMinUexp = std::min(aMinUexp, anUexpect[i]); continue; } @@ -7327,7 +7329,7 @@ static IntPatch_ImpImpIntersection::IntStatus CyCyNoGeometric( { // To avoid cycling-up anUexpect[i] += aStepMax; - aMinUexp = Min(aMinUexp, anUexpect[i]); + aMinUexp = std::min(aMinUexp, anUexpect[i]); continue; } @@ -7339,7 +7341,7 @@ static IntPatch_ImpImpIntersection::IntStatus CyCyNoGeometric( aStepTmp = aStepMax; anUexpect[i] = anU1 + aStepTmp; - aMinUexp = Min(aMinUexp, anUexpect[i]); + aMinUexp = std::min(aMinUexp, anUexpect[i]); } anU1 = aMinUexp; @@ -7458,7 +7460,7 @@ static IntPatch_ImpImpIntersection::IntStatus CyCyNoGeometric( if (anAngle > M_PI_2) anAngle -= M_PI; - if (Abs(anAngle) > 0.25) // ~ 14deg. + if (std::abs(anAngle) > 0.25) // ~ 14deg. { const Standard_Integer aNbPntsPrev = aWLine[i]->NbPnts(); SeekAdditionalPoints(aQuad1, @@ -7570,14 +7572,14 @@ static IntPatch_ImpImpIntersection::IntStatus CyCyNoGeometric( Standard_Real anUf = 0.0, anUl = 0.0, aCurU2 = 0.0; if (isReversed) { - anUf = Max(u2 - aStepMax, aUSurf1f); - anUl = Min(u2 + aStepMax, aUSurf1l); + anUf = std::max(u2 - aStepMax, aUSurf1f); + anUl = std::min(u2 + aStepMax, aUSurf1l); aCurU2 = u1; } else { - anUf = Max(u1 - aStepMax, aUSurf1f); - anUl = Min(u1 + aStepMax, aUSurf1l); + anUf = std::max(u1 - aStepMax, aUSurf1f); + anUl = std::min(u1 + aStepMax, aUSurf1l); aCurU2 = u2; } @@ -7592,8 +7594,8 @@ static IntPatch_ImpImpIntersection::IntStatus CyCyNoGeometric( if (!ComputationMethods::CylCylComputeParameters(anUmid, i, anEquationCoeffs, anU2t)) continue; - Standard_Real aDU2 = fmod(Abs(anU2t - aCurU2), aPeriod); - aDU2 = Min(aDU2, Abs(aDU2 - aPeriod)); + Standard_Real aDU2 = fmod(std::abs(anU2t - aCurU2), aPeriod); + aDU2 = std::min(aDU2, std::abs(aDU2 - aPeriod)); if (aDU2 < aDelta) { aDelta = aDU2; @@ -7629,7 +7631,7 @@ static IntPatch_ImpImpIntersection::IntStatus CyCyNoGeometric( Standard_Real &aPar1 = (aParID == 0) ? anUf : anUl, &aPar2 = (aParID == 0) ? anUl : anUf; - while (Abs(aPar2 - aPar1) > aStepMin) + while (std::abs(aPar2 - aPar1) > aStepMin) { Standard_Real anUC = 0.5 * (anUf + anUl); Standard_Real aU2 = 0.0, aV1 = 0.0, aV2 = 0.0; @@ -7642,16 +7644,16 @@ static IntPatch_ImpImpIntersection::IntStatus CyCyNoGeometric( if (isDone) { - if (Abs(aV1 - aVSurf1f) <= aTol2D) + if (std::abs(aV1 - aVSurf1f) <= aTol2D) aV1 = aVSurf1f; - if (Abs(aV1 - aVSurf1l) <= aTol2D) + if (std::abs(aV1 - aVSurf1l) <= aTol2D) aV1 = aVSurf1l; - if (Abs(aV2 - aVSurf2f) <= aTol2D) + if (std::abs(aV2 - aVSurf2f) <= aTol2D) aV2 = aVSurf2f; - if (Abs(aV2 - aVSurf2l) <= aTol2D) + if (std::abs(aV2 - aVSurf2l) <= aTol2D) aV2 = aVSurf2l; isDone = AddPointIntoWL(aQuad1, @@ -7680,8 +7682,8 @@ static IntPatch_ImpImpIntersection::IntStatus CyCyNoGeometric( if (isDone) { - anAddedPar[0] = Min(anAddedPar[0], anUC); - anAddedPar[1] = Max(anAddedPar[1], anUC); + anAddedPar[0] = std::min(anAddedPar[0], anUC); + anAddedPar[1] = std::max(anAddedPar[1], anUC); aPar2 = anUC; } else diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ImpPrmIntersection.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ImpPrmIntersection.cxx index ecb57b317a..78123dfd24 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ImpPrmIntersection.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ImpPrmIntersection.cxx @@ -131,7 +131,7 @@ static IntPatch_SpecPntType IsSeamOrPole(const Handle(Adaptor3d_Surface)& theQSu } } - const Standard_Real aDeltaU = Abs(aUQRef - aUQNext); + const Standard_Real aDeltaU = std::abs(aUQRef - aUQNext); if ((aType != GeomAbs_Torus) && (aDeltaU < theDeltaMax)) return IntPatch_SPntNone; @@ -142,7 +142,7 @@ static IntPatch_SpecPntType IsSeamOrPole(const Handle(Adaptor3d_Surface)& theQSu return IntPatch_SPntSeamU; case GeomAbs_Torus: { - const Standard_Real aDeltaV = Abs(aVQRef - aVQNext); + const Standard_Real aDeltaV = std::abs(aVQRef - aVQNext); if ((aDeltaU >= theDeltaMax) && (aDeltaV >= theDeltaMax)) return IntPatch_SPntSeamUV; @@ -326,7 +326,7 @@ void ComputeTangency(const IntPatch_TheSOnBounds& solrst, vtx = PStart.Vertex(); vtxorien = Domain->Orientation(vtx); - if (Abs(test) <= tole) + if (std::abs(test) <= tole) { LocTrans = TopAbs_EXTERNAL; // et pourquoi pas INTERNAL } @@ -376,7 +376,7 @@ void ComputeTangency(const IntPatch_TheSOnBounds& solrst, test = vectg.Dot(v1.Crossed(v2)); vtxorien = Domain->Orientation(PStart.Vertex()); - if (Abs(test) <= tole) + if (std::abs(test) <= tole) { LocTrans = TopAbs_EXTERNAL; // et pourquoi pas INTERNAL } @@ -527,9 +527,9 @@ Standard_Real GetLocalStep(const Handle(Adaptor3d_Surface)& theSurf, const Stand Standard_Integer aMaxDeg = 0; const Standard_Real aLimRes = 1.e-10; - aMinRes = Min(theSurf->UResolution(Precision::Confusion()), - theSurf->VResolution(Precision::Confusion())); - aMaxDeg = Max(theSurf->UDegree(), theSurf->VDegree()); + aMinRes = std::min(theSurf->UResolution(Precision::Confusion()), + theSurf->VResolution(Precision::Confusion())); + aMaxDeg = std::max(theSurf->UDegree(), theSurf->VDegree()); if (aMinRes < aLimRes && aMaxDeg > 3) { aLocalStep = 0.0001; @@ -547,7 +547,7 @@ Standard_Real GetLocalStep(const Handle(Adaptor3d_Surface)& theSurf, const Stand Standard_Real aMinInt = Precision::Infinite(); for (i = 1; i <= aNbInt; ++i) { - aMinInt = Min(aMinInt, anInts(i + 1) - anInts(i)); + aMinInt = std::min(aMinInt, anInts(i + 1) - anInts(i)); } aMinInt /= theSurf->LastUParameter() - theSurf->FirstUParameter(); @@ -569,7 +569,7 @@ Standard_Real GetLocalStep(const Handle(Adaptor3d_Surface)& theSurf, const Stand Standard_Real aMinInt = Precision::Infinite(); for (i = 1; i <= aNbInt; ++i) { - aMinInt = Min(aMinInt, anInts(i + 1) - anInts(i)); + aMinInt = std::min(aMinInt, anInts(i + 1) - anInts(i)); } aMinInt /= theSurf->LastVParameter() - theSurf->FirstVParameter(); @@ -580,7 +580,7 @@ Standard_Real GetLocalStep(const Handle(Adaptor3d_Surface)& theSurf, const Stand } } - aLocalStep = Min(theStep, aLocalStep); + aLocalStep = std::min(theStep, aLocalStep); return aLocalStep; } @@ -763,7 +763,7 @@ void IntPatch_ImpPrmIntersection::Perform(const Handle(Adaptor3d_Surface)& Sur UVap(1) = s2d.X(); UVap(2) = s2d.Y(); Func.Value(UVap, Valf); - Standard_Real rvalf = Sign(1., Valf(1)); + Standard_Real rvalf = std::copysign(1., Valf(1)); for (Standard_Integer i = 2; i <= aNbSamples; ++i) { T->SamplePoint(i, s2d, s3d); @@ -1716,7 +1716,7 @@ void IntPatch_ImpPrmIntersection::Perform(const Handle(Adaptor3d_Surface)& Sur // Now slin is filled as follows: lower indices correspond to Restriction line, // after (higher indices) - only Walking-line. - const Standard_Real aTol3d = Max(Func.Tolerance(), TolTang); + const Standard_Real aTol3d = std::max(Func.Tolerance(), TolTang); const Handle(Adaptor3d_Surface)& aQSurf = (reversed) ? Surf2 : Surf1; const Handle(Adaptor3d_Surface)& anOtherSurf = (reversed) ? Surf1 : Surf2; @@ -1773,7 +1773,7 @@ void IntPatch_ImpPrmIntersection::Perform(const Handle(Adaptor3d_Surface)& Sur Standard_Real aTol2d = anOtherSurf->UResolution(aTol3d), aPeriod = anOtherSurf->IsVPeriodic() ? anOtherSurf->VPeriod() : 0.0; - if (Abs(aDir.X()) < 0.5) + if (std::abs(aDir.X()) < 0.5) { // Restriction directs along V-direction aTol2d = anOtherSurf->VResolution(aTol3d); aPeriod = anOtherSurf->IsUPeriodic() ? anOtherSurf->UPeriod() : 0.0; @@ -2331,7 +2331,7 @@ static void ToSmooth(const Handle(IntSurf_LineOn2S)& Line, if (doU) { - Standard_Real dU = Min((DDU / 10.), 5.e-8); + Standard_Real dU = std::min((DDU / 10.), 5.e-8); Standard_Real U = (U2 > U3) ? (U2 + dU) : (U2 - dU); if (IsReversed) Line->SetUV(Index1, Standard_False, U, V1); @@ -2812,7 +2812,7 @@ static Standard_Boolean IsPointOnBoundary(const Standard_Real theToler2D, const Standard_Real thePeriod, const Standard_Real theParam) { - Standard_Real aDelta = Abs(theParam - theBoundary); + Standard_Real aDelta = std::abs(theParam - theBoundary); if (thePeriod != 0.0) { aDelta = fmod(aDelta, thePeriod); @@ -2887,14 +2887,14 @@ static void DetectOfBoundaryAchievement(const Handle(Adaptor3d_Surface)& theQSur const Standard_Real aDu = (aUPrev - aUCurr); const Standard_Real aDv = (aVPrev - aVCurr); - if (aUPeriod > 0.0 && (2.0 * Abs(aDu) > aUPeriod)) + if (aUPeriod > 0.0 && (2.0 * std::abs(aDu) > aUPeriod)) { - aUCurr += Sign(aUPeriod, aDu); + aUCurr += std::copysign(aUPeriod, aDu); } - if (aVPeriod > 0.0 && (2.0 * Abs(aDv) > aVPeriod)) + if (aVPeriod > 0.0 && (2.0 * std::abs(aDv) > aVPeriod)) { - aVCurr += Sign(aVPeriod, aDv); + aVCurr += std::copysign(aVPeriod, aDv); } IntSurf_PntOn2S aPoint = aPCurr; @@ -3001,10 +3001,11 @@ static Standard_Boolean DecomposeResult(const Handle(IntPatch_PointLine)& theLi const Standard_Real aURes = theQSurf->UResolution(theArcTol), aVRes = theQSurf->VResolution(theArcTol); - const Standard_Real aTol2d = (aPrePointExist == IntPatch_SPntPole) ? -1.0 - : (aPrePointExist == IntPatch_SPntSeamV) ? aVRes - : (aPrePointExist == IntPatch_SPntSeamUV) ? Max(aURes, aVRes) - : aURes; + const Standard_Real aTol2d = (aPrePointExist == IntPatch_SPntPole) ? -1.0 + : (aPrePointExist == IntPatch_SPntSeamV) ? aVRes + : (aPrePointExist == IntPatch_SPntSeamUV) + ? std::max(aURes, aVRes) + : aURes; if (IntPatch_SpecialPoints::ContinueAfterSpecialPoint(theQSurf, thePSurf, @@ -3452,12 +3453,12 @@ static Standard_Boolean DecomposeResult(const Handle(IntPatch_PointLine)& theLi if (aFLIndex == 0) { - aFPar = Max(aFPar, aPar); + aFPar = std::max(aFPar, aPar); aPar = aFPar; } else { - aLPar = Min(aLPar, aPar); + aLPar = std::min(aLPar, aPar); aPar = aLPar; } @@ -3559,7 +3560,7 @@ Standard_Boolean IsCoincide( } const Standard_Real aDist = theArc->Line().Distance(anArc->Line()); - if ((aDist < theToler2D) || (Abs(aDist - thePeriod) < theToler2D)) + if ((aDist < theToler2D) || (std::abs(aDist - thePeriod) < theToler2D)) { const Standard_Real aRf = theArc->FirstParameter(), aRl = theArc->LastParameter(); const Standard_Real aParf = anArc->FirstParameter(), aParl = anArc->LastParameter(); @@ -3607,7 +3608,7 @@ Standard_Boolean IsCoincide( const gp_Pnt2d aPmin(ElCLib::Value(aRParam, anArcLin)); const Standard_Real aDist = aPloc.Distance(aPmin); - if ((aDist < theToler2D) || (Abs(aDist - thePeriod) < theToler2D)) + if ((aDist < theToler2D) || (std::abs(aDist - thePeriod) < theToler2D)) { // Considered point is in Restriction line. // Go to the next point. continue; @@ -3634,7 +3635,7 @@ Standard_Boolean IsCoincide( return Standard_False; } - if (Abs(theFunc.Root()) > theToler3D) + if (std::abs(theFunc.Root()) > theToler3D) { return Standard_False; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_InterferencePolyhedron.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_InterferencePolyhedron.cxx index 6207a578bf..aab55df108 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_InterferencePolyhedron.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_InterferencePolyhedron.cxx @@ -256,7 +256,7 @@ void IntPatch_InterferencePolyhedron::Intersect(const Standard_Integer Tri1, Tdp); // Scalar product of two normalized vectors -> cosinus of the angle - Incidence = Abs(TNor * ONor); + Incidence = std::abs(TNor * ONor); // Distance of the plane of the triangle from the object by three points of SeconPol Standard_Real dfOpT[3]; @@ -277,10 +277,14 @@ void IntPatch_InterferencePolyhedron::Intersect(const Standard_Integer Tri1, // triangle of within the eventual tangency zone is found. Intf_TangentZone TheTZ; - if ((Abs(dfOpT[0]) <= Tolerance && Abs(dfOpT[1]) <= Tolerance && Abs(dfOpT[2]) <= Tolerance) - && (Abs(dpOfT[0]) <= Tolerance && Abs(dpOfT[1]) <= Tolerance && Abs(dpOfT[2]) <= Tolerance) - && (Abs(dfOpT[0] + dfOpT[1] + dfOpT[2]) != Abs(dfOpT[0]) + Abs(dfOpT[1]) + Abs(dfOpT[2])) - && (Abs(dpOfT[0] + dpOfT[1] + dpOfT[2]) != Abs(dpOfT[0]) + Abs(dpOfT[1]) + Abs(dpOfT[2]))) + if ((std::abs(dfOpT[0]) <= Tolerance && std::abs(dfOpT[1]) <= Tolerance + && std::abs(dfOpT[2]) <= Tolerance) + && (std::abs(dpOfT[0]) <= Tolerance && std::abs(dpOfT[1]) <= Tolerance + && std::abs(dpOfT[2]) <= Tolerance) + && (std::abs(dfOpT[0] + dfOpT[1] + dfOpT[2]) + != std::abs(dfOpT[0]) + std::abs(dfOpT[1]) + std::abs(dfOpT[2])) + && (std::abs(dpOfT[0] + dpOfT[1] + dpOfT[2]) + != std::abs(dpOfT[0]) + std::abs(dpOfT[1]) + std::abs(dpOfT[2]))) { if (TangentZoneValue(TheTZ, FirstPol, Tri1, SeconPol, Tri2)) @@ -381,8 +385,8 @@ void IntPatch_InterferencePolyhedron::Intersect(const Standard_Integer Tri1, 0, 0., Intf_EDGE, - Min(TI[iToo], TI[inext]), - Max(TI[iToo], TI[inext]), + std::min(TI[iToo], TI[inext]), + std::max(TI[iToo], TI[inext]), parT[iToo], Incidence)); parO[iObj] = 0.; @@ -409,7 +413,7 @@ void IntPatch_InterferencePolyhedron::Intersect(const Standard_Integer Tri1, inext = Pourcent3[iObj + 1]; if (edOT[iObj] == 1) { - if (Abs(deOpT[iObj][iToo]) <= floatGap) + if (std::abs(deOpT[iObj][iToo]) <= floatGap) { if ((dpOpT[iObj][iToo] + dpOpT[inext][iToo]) < voo[iObj].Modulus()) { @@ -418,8 +422,8 @@ void IntPatch_InterferencePolyhedron::Intersect(const Standard_Integer Tri1, parO[iObj] = 1. - parO[iObj]; piOT.Append(Intf_SectionPoint(IntPatch_PolyhedronTool::Point(SeconPol, TI[iToo]), Intf_EDGE, - Min(OI[iObj], OI[inext]), - Max(OI[iObj], OI[inext]), + std::min(OI[iObj], OI[inext]), + std::max(OI[iObj], OI[inext]), parO[iObj], Intf_VERTEX, TI[iToo], @@ -443,7 +447,7 @@ void IntPatch_InterferencePolyhedron::Intersect(const Standard_Integer Tri1, { if (parT[iToo] != 0.) { - if (Abs(dfOpT[iToo]) <= floatGap) + if (std::abs(dfOpT[iToo]) <= floatGap) { piOT.Append(Intf_SectionPoint(IntPatch_PolyhedronTool::Point(SeconPol, TI[iToo]), Intf_FACE, @@ -468,7 +472,7 @@ void IntPatch_InterferencePolyhedron::Intersect(const Standard_Integer Tri1, { if (parO[iObj] != 0.) { - if (Abs(dpOfT[iObj]) <= floatGap) + if (std::abs(dpOfT[iObj]) <= floatGap) { piOT.Append(Intf_SectionPoint(IntPatch_PolyhedronTool::Point(FirstPol, OI[iObj]), Intf_VERTEX, @@ -565,12 +569,12 @@ void IntPatch_InterferencePolyhedron::Intersect(const Standard_Integer Tri1, { piOT.Append(Intf_SectionPoint(piO, Intf_EDGE, - Min(OI[iObj], OI[inext]), - Max(OI[iObj], OI[inext]), + std::min(OI[iObj], OI[inext]), + std::max(OI[iObj], OI[inext]), parO[iObj], Intf_EDGE, - Min(TI[iToo], TI[jnext]), - Max(TI[iToo], TI[jnext]), + std::min(TI[iToo], TI[jnext]), + std::max(TI[iToo], TI[jnext]), parT[iToo], Incidence)); edOT[iObj] = edTT[iToo] = 0; @@ -602,8 +606,8 @@ void IntPatch_InterferencePolyhedron::Intersect(const Standard_Integer Tri1, parO[iObj] = 1. - parO[iObj]; piOT.Append(Intf_SectionPoint(piO, Intf_EDGE, - Min(OI[iObj], OI[inext]), - Max(OI[iObj], OI[inext]), + std::min(OI[iObj], OI[inext]), + std::max(OI[iObj], OI[inext]), parO[iObj], Intf_FACE, Tri2, @@ -636,8 +640,8 @@ void IntPatch_InterferencePolyhedron::Intersect(const Standard_Integer Tri1, 0, 0., Intf_EDGE, - Min(TI[iToo], TI[jnext]), - Max(TI[iToo], TI[jnext]), + std::min(TI[iToo], TI[jnext]), + std::max(TI[iToo], TI[jnext]), parT[iToo], Incidence)); nbpiOT++; @@ -646,7 +650,7 @@ void IntPatch_InterferencePolyhedron::Intersect(const Standard_Integer Tri1, } } - NCollection_LocalArray id(Max(nbpiOT, 4)); + NCollection_LocalArray id(std::max(nbpiOT, 4)); Standard_Integer ideb = -1; Standard_Integer ifin = -2; @@ -905,7 +909,7 @@ Standard_Boolean IntPatch_InterferencePolyhedron::TangentZoneValue( nbpInt++; break; } - else if (Abs(dpOeT[nob][nou]) <= Tolerance) + else if (std::abs(dpOeT[nob][nou]) <= Tolerance) { if (dpOpT[nob][nou] + dpOpT[nob][nou2] < vtt[nou].Modulus()) { @@ -918,8 +922,8 @@ Standard_Boolean IntPatch_InterferencePolyhedron::TangentZoneValue( 0, 0., Intf_EDGE, - Min(TI[nou], TI[nou2]), - Max(TI[nou], TI[nou2]), + std::min(TI[nou], TI[nou2]), + std::max(TI[nou], TI[nou2]), par, 1.)); tOP[nob] = Intf_EDGE; @@ -964,7 +968,7 @@ Standard_Boolean IntPatch_InterferencePolyhedron::TangentZoneValue( for (nob = 0; nob <= 2; nob++) { nob2 = Pourcent3[nob + 1]; - if (Abs(deOpT[nob][nou]) <= Tolerance) + if (std::abs(deOpT[nob][nou]) <= Tolerance) { if (dpOpT[nob][nou] + dpOpT[nob2][nou] < voo[nob].Modulus()) { @@ -973,8 +977,8 @@ Standard_Boolean IntPatch_InterferencePolyhedron::TangentZoneValue( par = 1. - par; Tpi.Append(Intf_SectionPoint(IntPatch_PolyhedronTool::Point(SeconPol, TI[nou]), Intf_EDGE, - Min(OI[nob], OI[nob2]), - Max(OI[nob], OI[nob2]), + std::min(OI[nob], OI[nob2]), + std::max(OI[nob], OI[nob2]), par, Intf_VERTEX, TI[nou], @@ -1060,12 +1064,12 @@ Standard_Boolean IntPatch_InterferencePolyhedron::TangentZoneValue( parT[nbpInt] = 1. - parT[nbpInt]; Tpi.Append(Intf_SectionPoint(lepi, Intf_EDGE, - Min(OI[nob], OI[nob2]), - Max(OI[nob], OI[nob2]), + std::min(OI[nob], OI[nob2]), + std::max(OI[nob], OI[nob2]), parO[nbpInt], Intf_EDGE, - Min(TI[nou], TI[nou2]), - Max(TI[nou], TI[nou2]), + std::min(TI[nou], TI[nou2]), + std::max(TI[nou], TI[nou2]), parT[nbpInt], Incidence)); nbpInt++; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_Intersection.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_Intersection.cxx index 53a94fae6b..0ed255d035 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_Intersection.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_Intersection.cxx @@ -246,8 +246,8 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_Surface)& S1, //=============================================================== static void FUN_GetMinMaxXYZPnt(const Handle(Adaptor3d_Surface)& S, gp_Pnt& pMin, gp_Pnt& pMax) { - const Standard_Real DU = 0.25 * Abs(S->LastUParameter() - S->FirstUParameter()); - const Standard_Real DV = 0.25 * Abs(S->LastVParameter() - S->FirstVParameter()); + const Standard_Real DU = 0.25 * std::abs(S->LastUParameter() - S->FirstUParameter()); + const Standard_Real DV = 0.25 * std::abs(S->LastVParameter() - S->FirstVParameter()); Standard_Real tMinXYZ = RealLast(); Standard_Real tMaxXYZ = -tMinXYZ; gp_Pnt PUV, ptMax, ptMin; @@ -320,7 +320,8 @@ static void FUN_TrimInfSurf(const gp_Pnt& Pmin, Vmin = cV; } } - TP = Max(Abs(Umin), Max(Abs(Umax), Max(Abs(Vmin), Abs(Vmax)))); + TP = + std::max(std::abs(Umin), std::max(std::abs(Umax), std::max(std::abs(Vmin), std::abs(Vmax)))); } if (TP == 0.) { @@ -405,7 +406,7 @@ static void FUN_GetUiso(const Handle(Geom_Surface)& GS, GeomAdaptor_Curve gac(gcbs); const GeomAbs_CurveType GACT = gac.GetType(); if (IsVP || IsVC || GACT == GeomAbs_BSplineCurve || GACT == GeomAbs_BezierCurve - || Abs(LastV - FirstV) < 1.e+5) + || std::abs(LastV - FirstV) < 1.e+5) { Handle(Geom_Curve) gc = gos->UIso(U); if (IsVP && (FirstV == 0.0 && LastV == (2 * M_PI))) @@ -500,7 +501,7 @@ static void FUN_GetViso(const Handle(Geom_Surface)& GS, GeomAdaptor_Curve gac(gcbs); const GeomAbs_CurveType GACT = gac.GetType(); if (IsUP || IsUC || GACT == GeomAbs_BSplineCurve || GACT == GeomAbs_BezierCurve - || Abs(LastU - FirstU) < 1.e+5) + || std::abs(LastU - FirstU) < 1.e+5) { Handle(Geom_Curve) gc = gos->VIso(V); if (IsUP && (FirstU == 0.0 && LastU == (2 * M_PI))) @@ -790,7 +791,7 @@ static void FUN_NewFirstLast(const GeomAbs_CurveType& ga_ct, { case GeomAbs_Line: case GeomAbs_Parabola: { - if (Abs(Lst - Fst) > TrVal) + if (std::abs(Lst - Fst) > TrVal) { if (Fst >= 0. && Lst >= 0.) { @@ -812,7 +813,7 @@ static void FUN_NewFirstLast(const GeomAbs_CurveType& ga_ct, break; } case GeomAbs_Hyperbola: { - if (Abs(Lst - Fst) > 10.) + if (std::abs(Lst - Fst) > 10.) { if (Fst >= 0. && Lst >= 0.) { @@ -986,13 +987,13 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_Surface)& theS1, if (typs1 == GeomAbs_Cone || typs2 == GeomAbs_Cone) { const gp_Cone aCon1 = (aCTType == GeomAbs_Cone) ? aCTSurf->Cone() : aGeomSurf->Cone(); - Standard_Real a1 = Abs(aCon1.SemiAngle()); + Standard_Real a1 = std::abs(aCon1.SemiAngle()); bToCheck = (a1 < 0.02) || (a1 > 1.55); // if (typs1 == typs2) { const gp_Cone aCon2 = aGeomSurf->Cone(); - Standard_Real a2 = Abs(aCon2.SemiAngle()); + Standard_Real a2 = std::abs(aCon2.SemiAngle()); bToCheck = bToCheck || (a2 < 0.02) || (a2 > 1.55); // if (a1 > 1.55 && a2 > 1.55) @@ -1044,9 +1045,9 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_Surface)& theS1, if (aCTType == GeomAbs_Cone) { bGeomGeom = 1; - if (Abs(aCTSurf->Cone().SemiAngle()) < 0.02) + if (std::abs(aCTSurf->Cone().SemiAngle()) < 0.02) { - Standard_Real ps = Abs(aCTAx.Direction().Dot(aGeomAx.Direction())); + Standard_Real ps = std::abs(aCTAx.Direction().Dot(aGeomAx.Direction())); if (ps < 0.015) { bGeomGeom = 0; @@ -1279,13 +1280,13 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_Surface)& theS1, if (typs1 == GeomAbs_Cone || typs2 == GeomAbs_Cone) { const gp_Cone aCon1 = (aCTType == GeomAbs_Cone) ? aCTSurf->Cone() : aGeomSurf->Cone(); - Standard_Real a1 = Abs(aCon1.SemiAngle()); + Standard_Real a1 = std::abs(aCon1.SemiAngle()); bToCheck = (a1 < 0.02) || (a1 > 1.55); // if (typs1 == typs2) { const gp_Cone aCon2 = aGeomSurf->Cone(); - Standard_Real a2 = Abs(aCon2.SemiAngle()); + Standard_Real a2 = std::abs(aCon2.SemiAngle()); bToCheck = bToCheck || (a2 < 0.02) || (a2 > 1.55); // if (a1 > 1.55 && a2 > 1.55) @@ -1318,8 +1319,8 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_Surface)& theS1, { const gp_Torus aTor2 = aGeomSurf->Torus(); bToCheck = (bToCheck && (aTor2.MajorRadius() > aTor2.MinorRadius())) - || (Abs(aTor1.MajorRadius() - aTor2.MajorRadius()) < TolTang - && Abs(aTor1.MinorRadius() - aTor2.MinorRadius()) < TolTang); + || (std::abs(aTor1.MajorRadius() - aTor2.MajorRadius()) < TolTang + && std::abs(aTor1.MinorRadius() - aTor2.MinorRadius()) < TolTang); } // if (aCTType == GeomAbs_Torus) @@ -1339,9 +1340,9 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_Surface)& theS1, if (aCTType == GeomAbs_Cone) { bGeomGeom = 1; - if (Abs(aCTSurf->Cone().SemiAngle()) < 0.02) + if (std::abs(aCTSurf->Cone().SemiAngle()) < 0.02) { - Standard_Real ps = Abs(aCTAx.Direction().Dot(aGeomAx.Direction())); + Standard_Real ps = std::abs(aCTAx.Direction().Dot(aGeomAx.Direction())); if (ps < 0.015) { bGeomGeom = 0; @@ -1529,9 +1530,11 @@ void IntPatch_Intersection::ParamParamPerfom(const Handle(Adaptor3d_Surface)& if (theD1->DomainIsInfinite()) { FUN_GetMinMaxXYZPnt(theS2, pMinXYZ, pMaxXYZ); - const Standard_Real MU = Max(Abs(theS2->FirstUParameter()), Abs(theS2->LastUParameter())); - const Standard_Real MV = Max(Abs(theS2->FirstVParameter()), Abs(theS2->LastVParameter())); - const Standard_Real AP = Max(MU, MV); + const Standard_Real MU = + std::max(std::abs(theS2->FirstUParameter()), std::abs(theS2->LastUParameter())); + const Standard_Real MV = + std::max(std::abs(theS2->FirstVParameter()), std::abs(theS2->LastVParameter())); + const Standard_Real AP = std::max(MU, MV); Handle(Adaptor3d_Surface) SS; FUN_TrimInfSurf(pMinXYZ, pMaxXYZ, theS1, AP, SS); interpp.Perform(SS, theD1, theS2, theD2, TolTang, TolArc, myFleche, myUVMaxStep); @@ -1539,9 +1542,11 @@ void IntPatch_Intersection::ParamParamPerfom(const Handle(Adaptor3d_Surface)& else { FUN_GetMinMaxXYZPnt(theS1, pMinXYZ, pMaxXYZ); - const Standard_Real MU = Max(Abs(theS1->FirstUParameter()), Abs(theS1->LastUParameter())); - const Standard_Real MV = Max(Abs(theS1->FirstVParameter()), Abs(theS1->LastVParameter())); - const Standard_Real AP = Max(MU, MV); + const Standard_Real MU = + std::max(std::abs(theS1->FirstUParameter()), std::abs(theS1->LastUParameter())); + const Standard_Real MV = + std::max(std::abs(theS1->FirstVParameter()), std::abs(theS1->LastVParameter())); + const Standard_Real AP = std::max(MU, MV); Handle(Adaptor3d_Surface) SS; FUN_TrimInfSurf(pMinXYZ, pMaxXYZ, theS2, AP, SS); interpp.Perform(theS1, theD1, SS, theD2, TolTang, TolArc, myFleche, myUVMaxStep); @@ -2122,7 +2127,7 @@ Standard_Boolean IntPatch_Intersection::CheckSingularPoints( gp_Pnt2d aP1; gp_Vec2d aDir; aBnd->D1((pinf + psup) / 2., aP1, aDir); - if (Abs(aDir.X()) > Abs(aDir.Y())) + if (std::abs(aDir.X()) > std::abs(aDir.Y())) isU = Standard_True; else isU = Standard_False; @@ -2136,9 +2141,9 @@ Standard_Boolean IntPatch_Intersection::CheckSingularPoints( aP1 = aBnd->Value(t); theS1->D1(aP1.X(), aP1.Y(), aPP1, aDU, aDV); if (isU) - aD1NormMax = Max(aD1NormMax, aDU.Magnitude()); + aD1NormMax = std::max(aD1NormMax, aDU.Magnitude()); else - aD1NormMax = Max(aD1NormMax, aDV.Magnitude()); + aD1NormMax = std::max(aD1NormMax, aDV.Magnitude()); aPmid += aPP1.XYZ(); aNb++; @@ -2160,14 +2165,14 @@ Standard_Boolean IntPatch_Intersection::CheckSingularPoints( Standard_Integer aNbExt = aProj.NbExt(); for (i = 1; i <= aNbExt; ++i) { - theDist = Min(theDist, aProj.SquareDistance(i)); + theDist = std::min(theDist, aProj.SquareDistance(i)); } } } } if (!Precision::IsInfinite(theDist)) { - theDist = Sqrt(theDist); + theDist = std::sqrt(theDist); isSingular = Standard_True; } @@ -2265,7 +2270,7 @@ void IntPatch_Intersection::PrepareSurfaces( NCollection_Vector& theVecHS2) { if ((theS1->GetType() == GeomAbs_Cone) - && (Abs(M_PI / 2. - Abs(theS1->Cone().SemiAngle())) < theTol)) + && (std::abs(M_PI / 2. - std::abs(theS1->Cone().SemiAngle())) < theTol)) { splitCone(theS1, theD1, theTol, theVecHS1); } @@ -2275,7 +2280,7 @@ void IntPatch_Intersection::PrepareSurfaces( } if ((theS2->GetType() == GeomAbs_Cone) - && (Abs(M_PI / 2. - Abs(theS2->Cone().SemiAngle())) < theTol)) + && (std::abs(M_PI / 2. - std::abs(theS2->Cone().SemiAngle())) < theTol)) { splitCone(theS2, theD2, theTol, theVecHS2); } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_LineConstructor.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_LineConstructor.cxx index 467ebf29e9..ec5fb68bdc 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_LineConstructor.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_LineConstructor.cxx @@ -469,7 +469,7 @@ static Standard_Integer AppendSameVertexG(Handle(IntPatch_GLine)& glig, { p1 = Vtxindex.ParameterOnLine(); p2 = Vtxi.ParameterOnLine(); - if (Abs(p1 - p2) < Precision::PConfusion()) + if (std::abs(p1 - p2) < Precision::PConfusion()) { aajouter = Standard_True; } @@ -860,7 +860,7 @@ static Standard_Boolean IsSegmentSmall(const Handle(IntPatch_WLine)& WLine, Standard_Real tolF = GetVertexTolerance(vtxF); Standard_Real tolL = GetVertexTolerance(vtxL); - Standard_Real tol = Max(tolF, tolL); + Standard_Real tol = std::max(tolF, tolL); Standard_Real len = 0.; gp_Pnt p1 = WLine->Point(ipF).Value(); @@ -984,7 +984,7 @@ static Standard_Boolean TestIfWLineIsRestriction(const IntPatch_SequenceOfLine& std::cout << " IntPatch_LineConstructor.gxx : CC**ONS" << (allon1 == NbPnts ? 1 : 2) << "** Traitement WLIne + ARC CLASS " << std::endl; #endif - Standard_Real tol2d = Max(tol2d1, tol2d2); + Standard_Real tol2d = std::max(tol2d1, tol2d2); return TestWLineIsARLine(slinref, wlin, tol2d); } return Standard_False; @@ -1443,7 +1443,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinre // In this case we try to classify the "virtual" WLine point: // the geometrical point between two vertices. This emulates // situation when (lastp-firstp) != 1. - if (Abs(int_lastp - int_firstp) == 1) + if (std::abs(int_lastp - int_firstp) == 1) { Standard_Real vFu1, vFv1, vFu2, vFv2, vLu1, vLv1, vLu2, vLv2; const IntSurf_PntOn2S& vF = WLineVertex_i.PntOn2S(); @@ -1496,7 +1496,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinre aTolerance = ComputeParametricTolerance(TolArc, ad1u, ad1v); in2 = myDom2->Classify(gp_Pnt2d(du, dv), aTolerance, Standard_False); } - } // end of if(Abs(int_lastp-int_firstp) == 1) + } // end of if(std::abs(int_lastp-int_firstp) == 1) if (in1 != TopAbs_OUT && in2 != TopAbs_OUT) { @@ -1511,12 +1511,12 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinre Pmid2.Parameters(u1b, v1b, u2b, v2b); Recadre(mySurf1, mySurf2, u1b, v1b, u2b, v2b); - Standard_Real dd12_u = Abs(u1a - u1b); - Standard_Real dd12_v = Abs(v1a - v1b); + Standard_Real dd12_u = std::abs(u1a - u1b); + Standard_Real dd12_v = std::abs(v1a - v1b); if (dd12_u + dd12_v < 1e-12) { - dd12_u = Abs(u1 - u1b); - dd12_v = Abs(v1 - v1b); + dd12_u = std::abs(u1 - u1b); + dd12_v = std::abs(v1 - v1b); if (dd12_u + dd12_v < 1e-12) { LignetropPetite = Standard_True; @@ -1576,7 +1576,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinre { firstp = GLine->Vertex(i).ParameterOnLine(); lastp = GLine->Vertex(i + 1).ParameterOnLine(); - if (Abs(firstp - lastp) > Precision::PConfusion()) + if (std::abs(firstp - lastp) > Precision::PConfusion()) { intrvtested = Standard_True; Standard_Real pmid = (firstp + lastp) * 0.5; @@ -1659,7 +1659,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinre } if (acadr >= cadrinf && acadr <= cadrsup) { - if (Abs(firstp - lastp) > Precision::PConfusion()) + if (std::abs(firstp - lastp) > Precision::PConfusion()) { intrvtested = Standard_True; Standard_Real pmid = (firstp + lastp) * 0.5; @@ -1755,7 +1755,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinre { //-- On na classifie pas sur 1 Standard_Real u0 = Vtx1.ParameterOnLine(); Standard_Real u1 = Vtx2.ParameterOnLine(); - if (Abs(u1 - u0) > Precision::PConfusion()) + if (std::abs(u1 - u0) > Precision::PConfusion()) { Standard_Real u = (999.0 * u0 + u1) * 0.001; @@ -1845,7 +1845,7 @@ void IntPatch_LineConstructor::Perform(const IntPatch_SequenceOfLine& slinre { Standard_Real u0 = Vtx1.ParameterOnLine(); Standard_Real u1 = Vtx2.ParameterOnLine(); - if (Abs(u1 - u0) > Precision::PConfusion()) + if (std::abs(u1 - u0) > Precision::PConfusion()) { Standard_Real u = (999.0 * u0 + u1) * 0.001; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_PointLine.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_PointLine.cxx index 74bd19dced..c31181871b 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_PointLine.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_PointLine.cxx @@ -140,8 +140,8 @@ Standard_Real IntPatch_PointLine::CurvatureRadiusOfIntersLine( Standard_Real aDeltaU = aTgV.SquareMagnitude() / aSqNMagn; Standard_Real aDeltaV = aTgU.SquareMagnitude() / aSqNMagn; - aDuS1 = Sign(sqrt(aDeltaU), aTgV.Dot(aN1)); - aDvS1 = -Sign(sqrt(aDeltaV), aTgU.Dot(aN1)); + aDuS1 = std::copysign(sqrt(aDeltaU), aTgV.Dot(aN1)); + aDvS1 = -std::copysign(sqrt(aDeltaV), aTgU.Dot(aN1)); aSqNMagn = aN2.SquareMagnitude(); aTgU.SetXYZ(aCTan.Crossed(aDU2).XYZ()); @@ -149,8 +149,8 @@ Standard_Real IntPatch_PointLine::CurvatureRadiusOfIntersLine( aDeltaU = aTgV.SquareMagnitude() / aSqNMagn; aDeltaV = aTgU.SquareMagnitude() / aSqNMagn; - aDuS2 = Sign(sqrt(aDeltaU), aTgV.Dot(aN2)); - aDvS2 = -Sign(sqrt(aDeltaV), aTgU.Dot(aN2)); + aDuS2 = std::copysign(sqrt(aDeltaU), aTgV.Dot(aN2)); + aDvS2 = -std::copysign(sqrt(aDeltaV), aTgU.Dot(aN2)); } // According to "Marching along surface/surface intersection curves @@ -167,7 +167,7 @@ Standard_Real IntPatch_PointLine::CurvatureRadiusOfIntersLine( const Standard_Real aA = aN1.Dot(aN1), aB = aN1.Dot(aN2), aC = aN2.Dot(aN2); const Standard_Real aDetSyst = aB * aB - aA * aC; - if (Abs(aDetSyst) < aSmallValue) + if (std::abs(aDetSyst) < aSmallValue) { // Undetermined system solution return -1.0; @@ -194,7 +194,7 @@ Standard_Real IntPatch_PointLine::CurvatureRadiusOfIntersLine( #if 0 if(aTestID) { - if(Abs(aFactSqRad - anExpectedSqRad) < Precision::Confusion()) + if(std::abs(aFactSqRad - anExpectedSqRad) < Precision::Confusion()) { printf("OK: Curvature radius is equal to expected (%5.10g)", anExpectedSqRad); } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_PolyArc.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_PolyArc.cxx index b4645dbba1..6428259157 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_PolyArc.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_PolyArc.cxx @@ -41,8 +41,8 @@ IntPatch_PolyArc::IntPatch_PolyArc(const Handle(Adaptor2d_Curve2d)& Line, const Standard_Real aPdeb, const Standard_Real aPfin, const Bnd_Box2d& BoxOtherPolygon) - : brise(1, Max(1, NbSample)), - param(1, Max(1, NbSample)), + : brise(1, std::max(1, NbSample)), + param(1, std::max(1, NbSample)), offsetx(0.0), offsety(0.0) { @@ -113,7 +113,7 @@ IntPatch_PolyArc::IntPatch_PolyArc(const Handle(Adaptor2d_Curve2d)& Line, // MSV: (see cda 002 H2) if segment is too large (>>r) we have // a risk to jump through BoxOtherPolygon, therefore we should // check this condition if the first one is failure. - Standard_Boolean isMidPtInBox = (Abs(bx0 - XXs) + Abs(by0 - YYs)) < r; + Standard_Boolean isMidPtInBox = (std::abs(bx0 - XXs) + std::abs(by0 - YYs)) < r; Standard_Boolean isSegOut = Standard_True; if (!isMidPtInBox) { @@ -133,17 +133,17 @@ IntPatch_PolyArc::IntPatch_PolyArc(const Handle(Adaptor2d_Curve2d)& Line, // if(IndexInf>i) IndexInf=i-1; // if(IndexSup i) - IndexInf = Max(i - 2, 1); + IndexInf = std::max(i - 2, 1); if (IndexSup < i) - IndexSup = Min(i + 1, NbSample); + IndexSup = std::min(i + 1, NbSample); } myBox.Add(brise(i)); Line->D0(param(i) - Pas * 0.5, p2d); Xm = p2d.X() - XXs; Ym = p2d.Y() - YYs; - Xm = Sqrt(Xm * Xm + Ym * Ym); - myError = Max(myError, Xm); + Xm = std::sqrt(Xm * Xm + Ym * Ym); + myError = std::max(myError, Xm); Xs = X; Ys = Y; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_PolyLine.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_PolyLine.cxx index bd5af05020..25b091523a 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_PolyLine.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_PolyLine.cxx @@ -120,8 +120,8 @@ void IntPatch_PolyLine::Prepare() Standard_Real xt2 = Ax * t2 * t2 + Bx * t2 + Cx; Standard_Real yt2 = Ay * t2 * t2 + By * t2 + Cy; // max deflection on segments P1-P2 and P2-P3 - Standard_Real d1 = Abs(A1 * xt1 + B1 * yt1 + C1); - Standard_Real d2 = Abs(A2 * xt2 + B2 * yt2 + C2); + Standard_Real d1 = std::abs(A1 * xt1 + B1 * yt1 + C1); + Standard_Real d2 = std::abs(A2 * xt2 + B2 * yt2 + C2); if (d2 > d1) d1 = d2; // select min deflection from linear and parabolic ones @@ -129,7 +129,7 @@ void IntPatch_PolyLine::Prepare() d_2 = d1 * d1; } if (d_2 > myError * myError) - myError = Sqrt(d_2); + myError = std::sqrt(d_2); } P1 = P2; P2 = P3; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_Polyhedron.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_Polyhedron.cxx index 3efcef22a4..53f59dbfac 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_Polyhedron.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_Polyhedron.cxx @@ -222,7 +222,7 @@ Standard_Real IntPatch_Polyhedron::DeflectionOnTriangle(const Handle(Adaptor3d_S Standard_Real u = (u1 + u2 + u3) / 3.0; Standard_Real v = (v1 + v2 + v3) / 3.0; gp_Vec P1P(P1, Surface->Value(u, v)); - return (Abs(P1P.Dot(NormalVector))); + return (std::abs(P1P.Dot(NormalVector))); } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_PrmPrmIntersection.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_PrmPrmIntersection.cxx index 5ef4276a52..0c04f1cf1f 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_PrmPrmIntersection.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_PrmPrmIntersection.cxx @@ -109,8 +109,8 @@ static void SeveralWlinesProcessing(const Handle(Adaptor3d_Surface)& theSurf1, Standard_Real vRs1 = theSurf1->VResolution(tDistance); Standard_Real uRs2 = theSurf2->UResolution(tDistance); Standard_Real vRs2 = theSurf2->VResolution(tDistance); - Standard_Real RmaxS1 = Max(uRs1, vRs1); - Standard_Real RmaxS2 = Max(uRs2, vRs2); + Standard_Real RmaxS1 = std::max(uRs1, vRs1); + Standard_Real RmaxS2 = std::max(uRs2, vRs2); if (RmaxS1 < theMaxStepS1 && RmaxS2 < theMaxStepS2) { @@ -157,7 +157,7 @@ static void SeveralWlinesProcessing(const Handle(Adaptor3d_Surface)& theSurf1, Standard_Boolean removePrev = Standard_False; if (ciV == 1) { - Standard_Integer dPar = Abs(VPold.Value(ciV) - VPold.Value(ciV + 1)); + Standard_Integer dPar = std::abs(VPold.Value(ciV) - VPold.Value(ciV + 1)); if (dPar > 10) { removeNext = Standard_True; @@ -167,7 +167,7 @@ static void SeveralWlinesProcessing(const Handle(Adaptor3d_Surface)& theSurf1, } else if (ciV == cnbV) { - Standard_Integer dPar = Abs(VPold.Value(ciV) - VPold.Value(ciV - 1)); + Standard_Integer dPar = std::abs(VPold.Value(ciV) - VPold.Value(ciV - 1)); if (dPar > 10) { removePrev = Standard_True; @@ -176,8 +176,8 @@ static void SeveralWlinesProcessing(const Handle(Adaptor3d_Surface)& theSurf1, } else { - Standard_Integer dParMi = Abs(VPold.Value(ciV) - VPold.Value(ciV - 1)); - Standard_Integer dParMa = Abs(VPold.Value(ciV) - VPold.Value(ciV + 1)); + Standard_Integer dParMi = std::abs(VPold.Value(ciV) - VPold.Value(ciV - 1)); + Standard_Integer dParMa = std::abs(VPold.Value(ciV) - VPold.Value(ciV + 1)); if (dParMi > 10) { removePrev = Standard_True; @@ -921,7 +921,7 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_Surface)& Sur for (nsp1 = nbp / 2; nsp1 >= 1; nsp1--) { SectionPointToParameters(LineSec.GetPoint(nsp1), Poly1, Poly1, U1, V1, U2, V2); - Standard_Real CurrentIncidence = Abs(U1 - U2) + Abs(V1 - V2); + Standard_Real CurrentIncidence = std::abs(U1 - U2) + std::abs(V1 - V2); if (CurrentIncidence > incidence) { nbps2 = nsp1; @@ -931,7 +931,7 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_Surface)& Sur for (nsp1 = nbp / 2; nsp1 <= nbp; nsp1++) { SectionPointToParameters(LineSec.GetPoint(nsp1), Poly1, Poly1, U1, V1, U2, V2); - Standard_Real CurrentIncidence = Abs(U1 - U2) + Abs(V1 - V2); + Standard_Real CurrentIncidence = std::abs(U1 - U2) + std::abs(V1 - V2); if (CurrentIncidence > incidence) { nbps2 = nsp1; @@ -977,7 +977,7 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_Surface)& Sur if (HasStartPoint) { StartPOn2S.Parameters(pu1, pv1, pu2, pv2); - if (Abs(pu1 - pu2) > 1e-7 || Abs(pv1 - pv2) > 1e-7) + if (std::abs(pu1 - pu2) > 1e-7 || std::abs(pv1 - pv2) > 1e-7) { NbLigCalculee = SLin.Length(); Standard_Integer l; @@ -1088,7 +1088,8 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_Surface)& Sur imin = i; const IntSurf_PntOn2S& Pi = PW.Line()->Value(i); Pi.Parameters(u1, v1, u2, v2); - } while ((i < nbpw) && (Abs(u1 - u2) <= 1e-6 && Abs(v1 - v2) <= 1e-6)); + } while ((i < nbpw) + && (std::abs(u1 - u2) <= 1e-6 && std::abs(v1 - v2) <= 1e-6)); if (imin > 2) imin--; @@ -1100,7 +1101,7 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_Surface)& Sur imax = i; const IntSurf_PntOn2S& Pi = PW.Line()->Value(i); Pi.Parameters(u1, v1, u2, v2); - } while ((i > 2) && (Abs(u1 - u2) <= 1e-6 && Abs(v1 - v2) <= 1e-6)); + } while ((i > 2) && (std::abs(u1 - u2) <= 1e-6 && std::abs(v1 - v2) <= 1e-6)); if (imax < nbpw) imax++; @@ -1184,7 +1185,7 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_Surface)& Sur if (HasStartPoint) { StartPOn2S.Parameters(pu1, pv1, pu2, pv2); - if (Abs(pu1 - pu2) > 1e-7 || Abs(pv1 - pv2) > 1e-7) + if (std::abs(pu1 - pu2) > 1e-7 || std::abs(pv1 - pv2) > 1e-7) { NbLigCalculee = SLin.Length(); dminiPointLigne = SeuildPointLigne + SeuildPointLigne; @@ -1295,7 +1296,7 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_Surface)& Sur imin = i; const IntSurf_PntOn2S& Pi = PW.Line()->Value(i); Pi.Parameters(u1, v1, u2, v2); - } while ((i < nbp) && (Abs(u1 - u2) <= 1e-6 && Abs(v1 - v2) <= 1e-6)); + } while ((i < nbp) && (std::abs(u1 - u2) <= 1e-6 && std::abs(v1 - v2) <= 1e-6)); if (imin > 2) imin--; @@ -1307,7 +1308,7 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_Surface)& Sur imax = i; const IntSurf_PntOn2S& Pi = PW.Line()->Value(i); Pi.Parameters(u1, v1, u2, v2); - } while ((i > 2) && (Abs(u1 - u2) <= 1e-6 && Abs(v1 - v2) <= 1e-6)); + } while ((i > 2) && (std::abs(u1 - u2) <= 1e-6 && std::abs(v1 - v2) <= 1e-6)); if (imax < nbp) imax++; @@ -1431,7 +1432,7 @@ Handle(IntPatch_Line) IntPatch_PrmPrmIntersection::NewLine( Standard_Real du1 = u1 - U1(i - 1); Standard_Real dv1 = v1 - V1(i - 1); - AC(i) = AC(i - 1) + Sqrt((du1 * du1) + (dv1 * dv1)); + AC(i) = AC(i - 1) + std::sqrt((du1 * du1) + (dv1 * dv1)); } Handle(IntSurf_LineOn2S) ResultPntOn2SLine = new IntSurf_LineOn2S(); @@ -1761,13 +1762,13 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_Surface)& Sur IntSurf_PntOn2S NewPnt; if (Surf1->IsUClosed()) { - if (Abs(U1 - Surf1->FirstUParameter()) <= TolPar) + if (std::abs(U1 - Surf1->FirstUParameter()) <= TolPar) { NewU1 = Surf1->LastUParameter(); NewPnt.SetValue(NewU1, V1, U2, V2); AdditionalPnts.Append(NewPnt); } - else if (Abs(U1 - Surf1->LastUParameter()) <= TolPar) + else if (std::abs(U1 - Surf1->LastUParameter()) <= TolPar) { NewU1 = Surf1->FirstUParameter(); NewPnt.SetValue(NewU1, V1, U2, V2); @@ -1776,13 +1777,13 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_Surface)& Sur } if (Surf1->IsVClosed()) { - if (Abs(V1 - Surf1->FirstVParameter()) <= TolPar) + if (std::abs(V1 - Surf1->FirstVParameter()) <= TolPar) { NewV1 = Surf1->LastVParameter(); NewPnt.SetValue(U1, NewV1, U2, V2); AdditionalPnts.Append(NewPnt); } - else if (Abs(V1 - Surf1->LastVParameter()) <= TolPar) + else if (std::abs(V1 - Surf1->LastVParameter()) <= TolPar) { NewV1 = Surf1->FirstVParameter(); NewPnt.SetValue(U1, NewV1, U2, V2); @@ -1791,13 +1792,13 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_Surface)& Sur } if (Surf2->IsUClosed()) { - if (Abs(U2 - Surf2->FirstUParameter()) <= TolPar) + if (std::abs(U2 - Surf2->FirstUParameter()) <= TolPar) { NewU2 = Surf2->LastUParameter(); NewPnt.SetValue(U1, V1, NewU2, V2); AdditionalPnts.Append(NewPnt); } - else if (Abs(U2 - Surf2->LastUParameter()) <= TolPar) + else if (std::abs(U2 - Surf2->LastUParameter()) <= TolPar) { NewU2 = Surf2->FirstUParameter(); NewPnt.SetValue(U1, V1, NewU2, V2); @@ -1806,13 +1807,13 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_Surface)& Sur } if (Surf2->IsVClosed()) { - if (Abs(V2 - Surf2->FirstVParameter()) <= TolPar) + if (std::abs(V2 - Surf2->FirstVParameter()) <= TolPar) { NewV2 = Surf2->LastVParameter(); NewPnt.SetValue(U1, V1, U2, NewV2); AdditionalPnts.Append(NewPnt); } - else if (Abs(V2 - Surf2->LastVParameter()) <= TolPar) + else if (std::abs(V2 - Surf2->LastVParameter()) <= TolPar) { NewV2 = Surf2->FirstVParameter(); NewPnt.SetValue(U1, V1, U2, NewV2); @@ -1830,8 +1831,8 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_Surface)& Sur { IntSurf_PntOn2S aNewPnt = iter2.Value(); aNewPnt.Parameters(NewU1, NewV1, NewU2, NewV2); - if (Abs(U1 - NewU1) <= TolPar && Abs(V1 - NewV1) <= TolPar && Abs(U2 - NewU2) <= TolPar - && Abs(V2 - NewV2) <= TolPar) + if (std::abs(U1 - NewU1) <= TolPar && std::abs(V1 - NewV1) <= TolPar + && std::abs(U2 - NewU2) <= TolPar && std::abs(V2 - NewV2) <= TolPar) AdditionalPnts.Remove(iter2); else iter2.Next(); @@ -2016,8 +2017,8 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_Surface)& Sur trans1, trans2, TolTang, - Max(PW.MaxStep(0), PW.MaxStep(1)), - Max(PW.MaxStep(2), PW.MaxStep(3)), + std::max(PW.MaxStep(0), PW.MaxStep(1)), + std::max(PW.MaxStep(2), PW.MaxStep(3)), wline); AddWLine(SLin, wline, Deflection); @@ -2323,7 +2324,7 @@ IntSurf_PntOn2S MakeNewPoint(const IntSurf_PntOn2S& replacePnt, { if (Periods[i] != 0.) { - if (Abs(NewParams[i] - OldParams[i]) >= 0.5 * Periods[i]) + if (std::abs(NewParams[i] - OldParams[i]) >= 0.5 * Periods[i]) { if (NewParams[i] < OldParams[i]) NewParams[i] += Periods[i]; @@ -2761,8 +2762,8 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_Surface)& Sur trans1, trans2, TolTang, - Max(PW.MaxStep(0), PW.MaxStep(1)), - Max(PW.MaxStep(2), PW.MaxStep(3)), + std::max(PW.MaxStep(0), PW.MaxStep(1)), + std::max(PW.MaxStep(2), PW.MaxStep(3)), wline); AddWLine(SLin, wline, Deflection); @@ -3377,7 +3378,7 @@ void IntPatch_PrmPrmIntersection::PointDepart(Handle(IntSurf_LineOn2S)& L aIPD.xP1(i, j).Coord(x0, y0, z0); aIPD.xP1(i - 1, j - 1).Coord(x1, y1, z1); // - d = Abs(x1 - x0) + Abs(y1 - y0) + Abs(z1 - z0); + d = std::abs(x1 - x0) + std::abs(y1 - y0) + std::abs(z1 - z0); if (d > dmaxOn1) { dmaxOn1 = d; @@ -3404,7 +3405,7 @@ void IntPatch_PrmPrmIntersection::PointDepart(Handle(IntSurf_LineOn2S)& L { aIPD.xP2(i, j).Coord(x0, y0, z0); aIPD.xP2(i - 1, j - 1).Coord(x1, y1, z1); - d = Abs(x1 - x0) + Abs(y1 - y0) + Abs(z1 - z0); + d = std::abs(x1 - x0) + std::abs(y1 - y0) + std::abs(z1 - z0); if (d > dmaxOn2) { dmaxOn2 = d; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_RstInt.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_RstInt.cxx index 713665df79..4f1482a963 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_RstInt.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_RstInt.cxx @@ -132,7 +132,7 @@ static Standard_Boolean CoincideOnArc(const gp_Pnt& Ptsomme Handle(Adaptor3d_HVertex)& Vtx) { Standard_Real distmin = RealLast(); - Standard_Real tolarc = Max(Toler, Tol3d(A, Domain)); + Standard_Real tolarc = std::max(Toler, Tol3d(A, Domain)); Domain->Initialize(A); Domain->InitVertexIterator(); @@ -143,7 +143,7 @@ static Standard_Boolean CoincideOnArc(const gp_Pnt& Ptsomme gp_Pnt2d p2d = A->Value(prm); gp_Pnt point = Surf->Value(p2d.X(), p2d.Y()); const Standard_Real dist = point.Distance(Ptsommet); - Standard_Real tol = Max(tolarc, Tol3d(vtx1, Domain)); + Standard_Real tol = std::max(tolarc, Tol3d(vtx1, Domain)); if (dist <= tol && dist <= distmin) { // the best coincidence @@ -161,7 +161,7 @@ static void VerifyTgline(const Handle(IntPatch_WLine)& wlin, gp_Vec& Tgl) { - if (Abs(Tgl.X()) < Tol && Abs(Tgl.Y()) < Tol && Abs(Tgl.Z()) < Tol) + if (std::abs(Tgl.X()) < Tol && std::abs(Tgl.Y()) < Tol && std::abs(Tgl.Z()) < Tol) { //-- On construit une tangente plus grande //-- (Eviter des points tres proches ds Walking) @@ -174,7 +174,7 @@ static void VerifyTgline(const Handle(IntPatch_WLine)& wlin, for (i = param + 1; i <= nbpt; i++) { gp_Vec T(wlin->Point(param).Value(), wlin->Point(i).Value()); - if (Abs(T.X()) >= Tol || Abs(T.Y()) >= Tol || Abs(T.Z()) >= Tol) + if (std::abs(T.X()) >= Tol || std::abs(T.Y()) >= Tol || std::abs(T.Z()) >= Tol) { Tgl = T; return; @@ -186,7 +186,7 @@ static void VerifyTgline(const Handle(IntPatch_WLine)& wlin, for (i = param - 1; i >= 1; i--) { gp_Vec T(wlin->Point(i).Value(), wlin->Point(param).Value()); - if (Abs(T.X()) >= Tol || Abs(T.Y()) >= Tol || Abs(T.Z()) >= Tol) + if (std::abs(T.X()) >= Tol || std::abs(T.Y()) >= Tol || std::abs(T.Z()) >= Tol) { Tgl = T; return; @@ -208,7 +208,7 @@ static void GetLinePoint2d(const Handle(IntPatch_Line)& L, IntPatch_IType typL = L->ArcType(); Standard_Integer Nbptlin = (typL == IntPatch_Walking ? wlin->NbPnts() : rlin->NbPnts()); - Standard_Real par = IntegerPart(param); + Standard_Real par = std::trunc(param); Standard_Integer Irang = Standard_Integer(par); if (Irang == Nbptlin) { @@ -216,7 +216,7 @@ static void GetLinePoint2d(const Handle(IntPatch_Line)& L, par = 1.0; } else - par = Abs(param - par); + par = std::abs(param - par); Standard_Real us1, vs1, us2, vs2; if (typL == IntPatch_Walking) @@ -367,7 +367,7 @@ static Standard_Boolean FindParameter(const Handle(IntPatch_Line)& L, norm2 = v2.SquareMagnitude(); if (v1.Dot(v2) < 0.) { - Param = (Standard_Real)(i - 1) + 1. / (1. + Sqrt(norm2 / norm1)); + Param = (Standard_Real)(i - 1) + 1. / (1. + std::sqrt(norm2 / norm1)); Tgl = gp_Vec(p1, p2); found = Standard_True; } @@ -401,7 +401,7 @@ inline Standard_Boolean ArePnt2dEqual(const gp_Pnt2d& p1, const Standard_Real tolU, const Standard_Real tolV) { - return Abs(p1.X() - p2.X()) < tolU && Abs(p1.Y() - p2.Y()) < tolV; + return std::abs(p1.X() - p2.X()) < tolU && std::abs(p1.Y() - p2.Y()) < tolV; } //================================================================================================= @@ -433,8 +433,8 @@ void IntPatch_RstInt::PutVertexOnLine(const Handle(IntPatch_Line)& L, Handle(IntPatch_WLine) wlin(Handle(IntPatch_WLine)::DownCast(L)); //-- faite au cast. Standard_Integer Nbvtx = 0; Standard_Real tolPLin = Surf->UResolution(Precision::Confusion()); - tolPLin = Max(tolPLin, Surf->VResolution(Precision::Confusion())); - tolPLin = Min(tolPLin, Precision::Confusion()); + tolPLin = std::max(tolPLin, Surf->VResolution(Precision::Confusion())); + tolPLin = std::min(tolPLin, Precision::Confusion()); IntPatch_PolyLine PLin(tolPLin); Standard_Real PFirst, PLast; @@ -538,11 +538,11 @@ void IntPatch_RstInt::PutVertexOnLine(const Handle(IntPatch_Line)& L, { Handle(Adaptor3d_HVertex) vtx = Domain->Vertex(); Standard_Real prm = IntPatch_HInterTool::Parameter(vtx, arc); - if (Abs(prm - PFirst) < Precision::PConfusion()) + if (std::abs(prm - PFirst) < Precision::PConfusion()) { arc->D0(PFirst, p2dFirst); } - else if (Abs(prm - PLast) < Precision::PConfusion()) + else if (std::abs(prm - PLast) < Precision::PConfusion()) { arc->D0(PLast, p2dLast); } @@ -564,7 +564,7 @@ void IntPatch_RstInt::PutVertexOnLine(const Handle(IntPatch_Line)& L, const gp_Dir2d& aDir = aLin.Direction(); // Here, we consider rectangular axis-aligned domain only. - const Standard_Boolean isAlongU = (Abs(aDir.X()) > Abs(aDir.Y())); + const Standard_Boolean isAlongU = (std::abs(aDir.X()) > std::abs(aDir.Y())); if (SurfaceIsPeriodic && !isAlongU) { @@ -671,7 +671,7 @@ void IntPatch_RstInt::PutVertexOnLine(const Handle(IntPatch_Line)& L, Standard_Integer nbTreated = 0; GetLinePoint2d(L, aW1 + 1, !OnFirst, U, V); - Standard_Real par = IntegerPart(aW2); + Standard_Real par = std::trunc(aW2); Standard_Integer Irang = Standard_Integer(par) + 1; if (Irang == Brise.NbPoints()) { @@ -680,7 +680,7 @@ void IntPatch_RstInt::PutVertexOnLine(const Handle(IntPatch_Line)& L, } else { - par = Abs(aW2 - par); + par = std::abs(aW2 - par); } W = (1. - par) * Brise.Parameter(Irang) + par * Brise.Parameter(Irang + 1); @@ -704,7 +704,7 @@ void IntPatch_RstInt::PutVertexOnLine(const Handle(IntPatch_Line)& L, OtherSurf->D0(U, V, anOldPnt); OtherSurf->D0(U2, V2, aNewPnt); // if (anOldPnt.SquareDistance(aNewPnt) < Precision::SquareConfusion()) - Standard_Real aTolConf = Max(Precision::Confusion(), edgeTol); + Standard_Real aTolConf = std::max(Precision::Confusion(), edgeTol); if (anOldPnt.SquareDistance(aNewPnt) < aTolConf * aTolConf) { @@ -725,8 +725,8 @@ void IntPatch_RstInt::PutVertexOnLine(const Handle(IntPatch_Line)& L, if (possiblyClosed) { locpt2(j).Coord(U, V); - if ((OSurfaceIsUClosed && Abs(U - U2) > tolOUClosed) - || (OSurfaceIsVClosed && Abs(V - V2) > tolOVClosed)) + if ((OSurfaceIsUClosed && std::abs(U - U2) > tolOUClosed) + || (OSurfaceIsVClosed && std::abs(V - V2) > tolOVClosed)) continue; } duplicate = Standard_True; @@ -767,15 +767,15 @@ void IntPatch_RstInt::PutVertexOnLine(const Handle(IntPatch_Line)& L, if (SurfaceIsUClosed || SurfaceIsVClosed) { GetLinePoint2d(L, paramline, OnFirst, U, V); - if ((SurfaceIsUClosed && Abs(U - U1) > tolUClosed) - || (SurfaceIsVClosed && Abs(V - V1) > tolVClosed)) + if ((SurfaceIsUClosed && std::abs(U - U1) > tolUClosed) + || (SurfaceIsVClosed && std::abs(V - V1) > tolVClosed)) found = Standard_False; } if (found && (OSurfaceIsUClosed || OSurfaceIsVClosed)) { GetLinePoint2d(L, paramline, !OnFirst, U, V); - if ((OSurfaceIsUClosed && Abs(U - U2) > tolOUClosed) - || (OSurfaceIsVClosed && Abs(V - V2) > tolOVClosed)) + if ((OSurfaceIsUClosed && std::abs(U - U2) > tolOUClosed) + || (OSurfaceIsVClosed && std::abs(V - V2) > tolOVClosed)) found = Standard_False; } } @@ -818,8 +818,8 @@ void IntPatch_RstInt::PutVertexOnLine(const Handle(IntPatch_Line)& L, Rptline.ParametersOnS1(U, V); else Rptline.ParametersOnS2(U, V); - if ((SurfaceIsUClosed && Abs(U - U1) > tolUClosed) - || (SurfaceIsVClosed && Abs(V - V1) > tolVClosed)) + if ((SurfaceIsUClosed && std::abs(U - U1) > tolUClosed) + || (SurfaceIsVClosed && std::abs(V - V1) > tolVClosed)) continue; } if (OSurfaceIsUClosed || OSurfaceIsVClosed) @@ -828,13 +828,13 @@ void IntPatch_RstInt::PutVertexOnLine(const Handle(IntPatch_Line)& L, Rptline.ParametersOnS2(U, V); else Rptline.ParametersOnS1(U, V); - if ((OSurfaceIsUClosed && Abs(U - U2) > tolOUClosed) - || (OSurfaceIsVClosed && Abs(V - V2) > tolOVClosed)) + if ((OSurfaceIsUClosed && std::abs(U - U2) > tolOUClosed) + || (OSurfaceIsVClosed && std::abs(V - V2) > tolOVClosed)) continue; } } Standard_Real dist = ptsommet.Distance(Rptline.Value()); - Standard_Real dt = Max(vtxTol, Rptline.Tolerance()); + Standard_Real dt = std::max(vtxTol, Rptline.Tolerance()); if (dist < dmin) { if (dist <= dt) diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_SpecialPoints.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_SpecialPoints.cxx index 913051137b..744bfa3646 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_SpecialPoints.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_SpecialPoints.cxx @@ -140,7 +140,7 @@ static inline void GetTangent(const Standard_Real theConeSemiAngle, const Standard_Real aCosUn = (1.0 - aW2) / (1.0 + aW2); const Standard_Real aSinUn = 2.0 * theParameter / (1.0 + aW2); - const Standard_Real aTanA = Tan(theConeSemiAngle); + const Standard_Real aTanA = std::tan(theConeSemiAngle); theResult.SetCoord(aTanA * aCosUn, aTanA * aSinUn, 1.0); } @@ -434,8 +434,8 @@ Standard_Boolean IntPatch_SpecialPoints::ProcessSphere(const IntSurf_PntOn2S& th // Ask to pay attention to the fact that this vector is always normalized. gp_Vec2d aV1; - if ((Abs(theDUofPSurf.Z()) < Precision::PConfusion()) - && (Abs(theDVofPSurf.Z()) < Precision::PConfusion())) + if ((std::abs(theDUofPSurf.Z()) < Precision::PConfusion()) + && (std::abs(theDVofPSurf.Z()) < Precision::PConfusion())) { // Example of this case is an intersection of a plane with a sphere // when the plane tangents the sphere in some pole (i.e. only one @@ -465,7 +465,7 @@ Standard_Boolean IntPatch_SpecialPoints::ProcessSphere(const IntSurf_PntOn2S& th } else { - if (Abs(theDUofPSurf.Z()) > Abs(theDVofPSurf.Z())) + if (std::abs(theDUofPSurf.Z()) > std::abs(theDVofPSurf.Z())) { const Standard_Real aDusDvs = theDVofPSurf.Z() / theDUofPSurf.Z(); aV1.SetCoord(theDUofPSurf.X() * aDusDvs - theDVofPSurf.X(), @@ -480,10 +480,10 @@ Standard_Boolean IntPatch_SpecialPoints::ProcessSphere(const IntSurf_PntOn2S& th aV1.Normalize(); - if (Abs(aV1.X()) > Abs(aV1.Y())) - theUquad = Sign(asin(aV1.Y()), theVquad); + if (std::abs(aV1.X()) > std::abs(aV1.Y())) + theUquad = std::copysign(asin(aV1.Y()), theVquad); else - theUquad = Sign(acos(aV1.X()), theVquad); + theUquad = std::copysign(acos(aV1.X()), theVquad); } return Standard_True; @@ -586,9 +586,10 @@ Standard_Boolean IntPatch_SpecialPoints::ProcessCone(const IntSurf_PntOn2S& theP gp_XYZ aTgILine[2]; const Standard_Integer aNbTangent = - !theIsIsoChoosen - ? GetTangentToIntLineForCone(theCone.SemiAngle(), aTgPlaneZ.Divided(Sqrt(aSqModTg)), aTgILine) - : 0; + !theIsIsoChoosen ? GetTangentToIntLineForCone(theCone.SemiAngle(), + aTgPlaneZ.Divided(std::sqrt(aSqModTg)), + aTgILine) + : 0; if (aNbTangent == 0) { @@ -623,11 +624,12 @@ Standard_Boolean IntPatch_SpecialPoints::ProcessCone(const IntSurf_PntOn2S& theP } // Normalize - aVecCS.Divide(Sqrt(aSqMod)); + aVecCS.Divide(std::sqrt(aSqMod)); // Angle in range [0, PI/2] - Standard_Real anUq = - (Abs(aVecCS.X()) < Abs(aVecCS.Y())) ? ACos(Abs(aVecCS.X())) : ASin(Abs(aVecCS.Y())); + Standard_Real anUq = (std::abs(aVecCS.X()) < std::abs(aVecCS.Y())) + ? std::acos(std::abs(aVecCS.X())) + : std::asin(std::abs(aVecCS.Y())); // Convert angles to the range [0, 2*PI] if (aVecCS.Y() < 0.0) @@ -648,7 +650,7 @@ Standard_Boolean IntPatch_SpecialPoints::ProcessCone(const IntSurf_PntOn2S& theP // Select the parameter the nearest to aUIso anUq = ElCLib::InPeriod(anUq, 0.0, aPeriod); - Standard_Real aDelta = Abs(anUq - aUIso); + Standard_Real aDelta = std::abs(anUq - aUIso); if (aDelta > M_PI) aDelta = aPeriod - aDelta; @@ -720,14 +722,14 @@ Standard_Integer IntPatch_SpecialPoints::GetTangentToIntLineForCone( gp_XYZ theResult[2]) { const Standard_Real aNullTol = Epsilon(1.0); - const Standard_Real aTanA = Tan(theConeSemiAngle); + const Standard_Real aTanA = std::tan(theConeSemiAngle); const Standard_Real aA = thePlnNormal.Z() / aTanA - thePlnNormal.X(); const Standard_Real aB = thePlnNormal.Y(); const Standard_Real aC = thePlnNormal.Z() / aTanA + thePlnNormal.X(); - if (Abs(aA) < aNullTol) + if (std::abs(aA) < aNullTol) { - if (Abs(aB) > aNullTol) + if (std::abs(aB) > aNullTol) { // The plane goes along the cone generatrix. GetTangent(theConeSemiAngle, -aC / (aB + aB), theResult[0]); @@ -740,14 +742,14 @@ Standard_Integer IntPatch_SpecialPoints::GetTangentToIntLineForCone( } // Discriminant of this equation is equal to - Standard_Real aDiscr = thePlnNormal.Z() / Sin(theConeSemiAngle); + Standard_Real aDiscr = thePlnNormal.Z() / std::sin(theConeSemiAngle); aDiscr = 1.0 - aDiscr * aDiscr; - if (Abs(aDiscr) < aNullTol) + if (std::abs(aDiscr) < aNullTol) { // The plane goes along the cone generatrix. // Attention! Mathematically, this cond. is equivalent to - // above processed one (Abs(aA) < aNullTol && (Abs(aB) > aNullTol)). + // above processed one (std::abs(aA) < aNullTol && (std::abs(aB) > aNullTol)). // However, we separate this branch in order to eliminate numerical // instability. @@ -756,7 +758,7 @@ Standard_Integer IntPatch_SpecialPoints::GetTangentToIntLineForCone( } else if (aDiscr > 0.0) { - const Standard_Real aRD = Sqrt(aDiscr); + const Standard_Real aRD = std::sqrt(aDiscr); GetTangent(theConeSemiAngle, (-aB + aRD) / aA, theResult[0]); GetTangent(theConeSemiAngle, (-aB - aRD) / aA, theResult[1]); return 2; @@ -794,7 +796,7 @@ Standard_Boolean IntPatch_SpecialPoints::AddSingularPole(const Handle(Adaptor3d_ if (theQSurf->GetType() == GeomAbs_Sphere) { - aVquad = Sign(M_PI_2, aVquad); + aVquad = std::copysign(M_PI_2, aVquad); } else if (theQSurf->GetType() == GeomAbs_Cone) { @@ -1059,7 +1061,7 @@ void IntPatch_SpecialPoints::AdjustPointAndVertex(const IntSurf_PntOn2S& theRefP { Standard_Real aDeltaPar = aRefPar[aRefInd] - aPar[i]; - const Standard_Real anIncr = Sign(aPeriod, aDeltaPar); + const Standard_Real anIncr = std::copysign(aPeriod, aDeltaPar); while ((aDeltaPar > aHalfPeriod) || (aDeltaPar < -aHalfPeriod)) { aPar[i] += anIncr; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_TheSurfFunction.hxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_TheSurfFunction.hxx index e63102a1fb..83ec1d6db6 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_TheSurfFunction.hxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_TheSurfFunction.hxx @@ -59,7 +59,7 @@ public: Standard_Real Root() const; - //! Returns the value Tol so that if Abs(Func.Root()) aNbVertexes) svtx.Append(thePnt); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_WLineTool.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_WLineTool.cxx index 4ab13b03bf..6dafb9ad8a 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_WLineTool.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_WLineTool.cxx @@ -249,7 +249,7 @@ static Handle(IntPatch_WLine) DeleteOuterPoints(const Handle(IntPatch_WLine)& { isAllDeleted = Standard_False; - aFirstGeomIdx = Max(i - 1, 1); + aFirstGeomIdx = std::max(i - 1, 1); if (aDelOuterPointsHash(i) == -1) aFirstGeomIdx = i; // Use data what lies in (i) point / vertex. @@ -284,7 +284,7 @@ static Handle(IntPatch_WLine) DeleteOuterPoints(const Handle(IntPatch_WLine)& } else { - aLastGeomIdx = Min(i + 1, theWLine->NbPnts()); + aLastGeomIdx = std::min(i + 1, theWLine->NbPnts()); if (aDelOuterPointsHash(i) == -1) aLastGeomIdx = i; // Use data what lies in (i) point / vertex. @@ -437,9 +437,9 @@ static Handle(IntPatch_WLine) DeleteByTube(const Handle(IntPatch_WLine)& theW // Choose base tolerance and scale it to pipe algorithm. constexpr Standard_Real aBaseTolerance = Precision::Approximation(); Standard_Real aResS1Tol = - Min(theS1->UResolution(aBaseTolerance), theS1->VResolution(aBaseTolerance)); + std::min(theS1->UResolution(aBaseTolerance), theS1->VResolution(aBaseTolerance)); Standard_Real aResS2Tol = - Min(theS2->UResolution(aBaseTolerance), theS2->VResolution(aBaseTolerance)); + std::min(theS2->UResolution(aBaseTolerance), theS2->VResolution(aBaseTolerance)); Standard_Real aTol1 = aResS1Tol * aResS1Tol; Standard_Real aTol2 = aResS2Tol * aResS2Tol; Standard_Real aTol3d = aBaseTolerance * aBaseTolerance; @@ -478,7 +478,7 @@ static Handle(IntPatch_WLine) DeleteByTube(const Handle(IntPatch_WLine)& theW // Check very rare case when wline fluctuates nearly one point and some of them may be equal. // Middle point will be deleted when such situation occurs. // bugs moddata_2 bug469. - if (Min(aStepOnS1, aStepOnS2) >= aLimitCoeff * Max(aStepOnS1, aStepOnS2)) + if (std::min(aStepOnS1, aStepOnS2) >= aLimitCoeff * std::max(aStepOnS1, aStepOnS2)) { // Set hash flag to "Delete" state. Standard_Real aCurrStep = aBase3dPnt.SquareDistance(aPnt3d); @@ -628,7 +628,7 @@ static Standard_Boolean IsSeamOrBound(const IntSurf_PntOn2S& thePtf, continue; } - const Standard_Real aDelta = Abs(aParL[i] - aParF[i]); + const Standard_Real aDelta = std::abs(aParL[i] - aParF[i]); if (2.0 * aDelta > theArrPeriods[i]) { // Most likely, seam is intersected. @@ -953,7 +953,7 @@ static IntPatchWT_WLsConnectionType CheckArgumentsToExtend(const Handle(Adaptor3 // However, it is necessary to add check if we // intersect boundary. const Standard_Real aPar = - aParWL1[i] + theArrPeriods[i] * Ceiling((aNewPar[i] - aParWL1[i]) / theArrPeriods[i]); + aParWL1[i] + theArrPeriods[i] * std::ceil((aNewPar[i] - aParWL1[i]) / theArrPeriods[i]); aParWL1[i] = aParWL2[i]; aParWL2[i] = aPar; } @@ -971,7 +971,7 @@ static IntPatchWT_WLsConnectionType CheckArgumentsToExtend(const Handle(Adaptor3 // aParWL1[i] aNewPar[i] aParWL2[i] const Standard_Real aPar = - aParWL2[i] - theArrPeriods[i] * Ceiling((aParWL2[i] - aNewPar[i]) / theArrPeriods[i]); + aParWL2[i] - theArrPeriods[i] * std::ceil((aParWL2[i] - aNewPar[i]) / theArrPeriods[i]); aParWL2[i] = aParWL1[i]; aParWL1[i] = aPar; } @@ -1421,16 +1421,16 @@ Handle(IntPatch_WLine) IntPatch_WLineTool::ComputePurgedWLine( p1.Parameters(UV[0], UV[1], UV[2], UV[3]); p2.Parameters(UV[4], UV[5], UV[6], UV[7]); - Standard_Real aMax = Abs(UV[0]); + Standard_Real aMax = std::abs(UV[0]); for (Standard_Integer anIdx = 1; anIdx < 8; anIdx++) { - if (aMax < Abs(UV[anIdx])) - aMax = Abs(UV[anIdx]); + if (aMax < std::abs(UV[anIdx])) + aMax = std::abs(UV[anIdx]); } if (p1.Value().IsEqual(p2.Value(), gp::Resolution()) - || Abs(UV[0] - UV[4]) + Abs(UV[1] - UV[5]) < 1.0e-16 * aMax - || Abs(UV[2] - UV[6]) + Abs(UV[3] - UV[7]) < 1.0e-16 * aMax) + || std::abs(UV[0] - UV[4]) + std::abs(UV[1] - UV[5]) < 1.0e-16 * aMax + || std::abs(UV[2] - UV[6]) + std::abs(UV[3] - UV[7]) < 1.0e-16 * aMax) { aTmpWLine = aLocalWLine; aLocalWLine = new IntPatch_WLine(aLineOn2S, Standard_False); @@ -1501,7 +1501,7 @@ void IntPatch_WLineTool::JoinWLines(IntPatch_SequenceOfLine& theSlin, // For two cylindrical surfaces only const Standard_Real aMinRad = - 1.0e-3 * Min(theS1->Cylinder().Radius(), theS2->Cylinder().Radius()); + 1.0e-3 * std::min(theS1->Cylinder().Radius(), theS2->Cylinder().Radius()); const Standard_Real anArrPeriods[4] = {theS1->IsUPeriodic() ? theS1->UPeriod() : 0.0, theS1->IsVPeriodic() ? theS1->VPeriod() : 0.0, @@ -1569,7 +1569,7 @@ void IntPatch_WLineTool::JoinWLines(IntPatch_SequenceOfLine& theSlin, Standard_Real aSqDistF = aPntFWL1.Value().SquareDistance(aPntFWL2.Value()); Standard_Real aSqDistL = aPntFWL1.Value().SquareDistance(aPntLWL2.Value()); - const Standard_Real aSqMinFDist = Min(aSqDistF, aSqDistL); + const Standard_Real aSqMinFDist = std::min(aSqDistF, aSqDistL); if (aSqMinFDist < Precision::SquareConfusion()) { const Standard_Boolean isFM = (aSqDistF < aSqDistL); @@ -1584,7 +1584,7 @@ void IntPatch_WLineTool::JoinWLines(IntPatch_SequenceOfLine& theSlin, aSqDistF = aPntLWL1.Value().SquareDistance(aPntFWL2.Value()); aSqDistL = aPntLWL1.Value().SquareDistance(aPntLWL2.Value()); - const Standard_Real aSqMinLDist = Min(aSqDistF, aSqDistL); + const Standard_Real aSqMinLDist = std::min(aSqDistF, aSqDistL); if (aSqMinLDist < Precision::SquareConfusion()) { const Standard_Boolean isFM = (aSqDistF < aSqDistL); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPolyh/IntPolyh_Intersection.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPolyh/IntPolyh_Intersection.cxx index 4600daa55f..8b296e318e 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPolyh/IntPolyh_Intersection.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPolyh/IntPolyh_Intersection.cxx @@ -488,7 +488,7 @@ Standard_Boolean IntPolyh_Intersection::IsAdvRequired(IntPolyh_PMaillageAffinage IntPolyh_ListIteratorOfListOfCouples aIt(Couples); for (; aIt.More(); aIt.Next()) { - if (Abs(aIt.Value().Angle()) > anEps) + if (std::abs(aIt.Value().Angle()) > anEps) { // The angle between interfering triangles is small -> perform advanced // intersection to make intersection more precise @@ -544,7 +544,7 @@ Standard_Boolean IntPolyh_Intersection::AnalyzeIntersection(IntPolyh_PMaillageAf IntPolyh_ListIteratorOfListOfCouples aIt(Couples); for (; aIt.More(); aIt.Next()) { - Standard_Real cosa = Abs(aIt.Value().Angle()); + Standard_Real cosa = std::abs(aIt.Value().Angle()); if (cosa > eps) ++npara; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPolyh/IntPolyh_MaillageAffinage.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPolyh/IntPolyh_MaillageAffinage.cxx index 34c97f4817..8cdb722533 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPolyh/IntPolyh_MaillageAffinage.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPolyh/IntPolyh_MaillageAffinage.cxx @@ -1172,9 +1172,9 @@ static void LargeTrianglesDeflectionsRefinement(const Handle(Adaptor3d_Surface)& // the smallest side of the bounding box is taken Standard_Real x0, y0, z0, x1, y1, z1; theOppositeBox.Get(x0, y0, z0, x1, y1, z1); - Standard_Real dx = Abs(x1 - x0); - Standard_Real dy = Abs(y1 - y0); - Standard_Real diag = Abs(z1 - z0); + Standard_Real dx = std::abs(x1 - x0); + Standard_Real dy = std::abs(y1 - y0); + Standard_Real diag = std::abs(z1 - z0); Standard_Real dd = (dx > dy) ? dy : dx; if (diag > dd) diag = dd; @@ -1668,7 +1668,7 @@ Standard_Integer IntPolyh_MaillageAffinage::StartingPointsResearch(const Standar Standard_Integer NbPointsTotal = 0; /// check T1 normal - if (Abs(nn1modulus) < MyConfusionPrecision) + if (std::abs(nn1modulus) < MyConfusionPrecision) { // 10.0e-20){ } else @@ -1701,7 +1701,7 @@ Standard_Integer IntPolyh_MaillageAffinage::StartingPointsResearch(const Standar } /// check T2 normal - if (Abs(mm1modulus) < MyConfusionPrecision) + if (std::abs(mm1modulus) < MyConfusionPrecision) { // 10.0e-20){ } else @@ -1809,7 +1809,7 @@ Standard_Integer IntPolyh_MaillageAffinage::NextStartingPointsResearch( IntPolyh_StartPoint SP1, SP2; /// check T1 normal - if (Abs(nn1modulus) < MyConfusionPrecision) + if (std::abs(nn1modulus) < MyConfusionPrecision) { // 10.0e-20){ } else @@ -1841,7 +1841,7 @@ Standard_Integer IntPolyh_MaillageAffinage::NextStartingPointsResearch( } } /// check T2 normal - if (Abs(mm1modulus) < MyConfusionPrecision) + if (std::abs(mm1modulus) < MyConfusionPrecision) { // 10.0e-20){ } else @@ -1947,16 +1947,16 @@ void CalculPtsInterTriEdgeCoplanaires(const Standard_Integer TriSurfID, Standard_Real p0p = Per.Dot(PT1); /// The edge are PT1 are projected on the perpendicular of the side in the plane of the triangle if ((((p1p >= p0p) && (p0p >= p2p)) || ((p1p <= p0p) && (p0p <= p2p))) - && (Abs(p1p - p2p) > MyConfusionPrecision)) + && (std::abs(p1p - p2p) > MyConfusionPrecision)) { Standard_Real lambda = (p1p - p0p) / (p1p - p2p); if (lambda < -MyConfusionPrecision) { } IntPolyh_Point PIE; - if (Abs(lambda) < MyConfusionPrecision) // lambda=0 + if (std::abs(lambda) < MyConfusionPrecision) // lambda=0 PIE = PE1; - else if (Abs(lambda) > 1.0 - MyConfusionPrecision) // lambda=1 + else if (std::abs(lambda) > 1.0 - MyConfusionPrecision) // lambda=1 PIE = PE2; else PIE = PE1 + Edge * lambda; @@ -1982,13 +1982,13 @@ void CalculPtsInterTriEdgeCoplanaires(const Standard_Integer TriSurfID, SP1.SetXYZ(PIE.X(), PIE.Y(), PIE.Z()); if (TriSurfID == 1) { - if (Abs(alpha) < MyConfusionPrecision) + if (std::abs(alpha) < MyConfusionPrecision) { // alpha=0 SP1.SetUV1(PT1.U(), PT1.V()); SP1.SetUV1(PIE.U(), PIE.V()); SP1.SetEdge1(-1); } - if (Abs(alpha) > 1.0 - MyConfusionPrecision) + if (std::abs(alpha) > 1.0 - MyConfusionPrecision) { // alpha=1 SP1.SetUV1(PT2.U(), PT2.V()); SP1.SetUV1(PIE.U(), PIE.V()); @@ -2008,13 +2008,13 @@ void CalculPtsInterTriEdgeCoplanaires(const Standard_Integer TriSurfID, } else if (TriSurfID == 2) { - if (Abs(alpha) < MyConfusionPrecision) + if (std::abs(alpha) < MyConfusionPrecision) { // alpha=0 SP1.SetUV1(PT1.U(), PT1.V()); SP1.SetUV1(PIE.U(), PIE.V()); SP1.SetEdge2(-1); } - if (Abs(alpha) > 1.0 - MyConfusionPrecision) + if (std::abs(alpha) > 1.0 - MyConfusionPrecision) { // alpha=1 SP1.SetUV1(PT2.U(), PT2.V()); SP1.SetUV1(PIE.U(), PIE.V()); @@ -2042,13 +2042,13 @@ void CalculPtsInterTriEdgeCoplanaires(const Standard_Integer TriSurfID, SP2.SetXYZ(PIE.X(), PIE.Y(), PIE.Z()); if (TriSurfID == 1) { - if (Abs(alpha) < MyConfusionPrecision) + if (std::abs(alpha) < MyConfusionPrecision) { // alpha=0 SP2.SetUV1(PT1.U(), PT1.V()); SP2.SetUV1(PIE.U(), PIE.V()); SP2.SetEdge1(-1); } - if (Abs(alpha) > 1.0 - MyConfusionPrecision) + if (std::abs(alpha) > 1.0 - MyConfusionPrecision) { // alpha=1 SP2.SetUV1(PT2.U(), PT2.V()); SP2.SetUV1(PIE.U(), PIE.V()); @@ -2068,13 +2068,13 @@ void CalculPtsInterTriEdgeCoplanaires(const Standard_Integer TriSurfID, } else if (TriSurfID == 2) { - if (Abs(alpha) < MyConfusionPrecision) + if (std::abs(alpha) < MyConfusionPrecision) { // alpha=0 SP2.SetUV1(PT1.U(), PT1.V()); SP2.SetUV1(PIE.U(), PIE.V()); SP2.SetEdge2(-1); } - if (Abs(alpha) > 1.0 - MyConfusionPrecision) + if (std::abs(alpha) > 1.0 - MyConfusionPrecision) { // alpha=1 SP2.SetUV1(PT2.U(), PT2.V()); SP2.SetUV1(PIE.U(), PIE.V()); @@ -2256,8 +2256,8 @@ void CalculPtsInterTriEdgeCoplanaires(const Standard_Integer TriSurfID, } // It is checked if PEP1!=PEP2 - if ((NbPoints == 2) && (Abs(PEP1.U() - PEP2.U()) < MyConfusionPrecision) - && (Abs(PEP1.V() - PEP2.V()) < MyConfusionPrecision)) + if ((NbPoints == 2) && (std::abs(PEP1.U() - PEP2.U()) < MyConfusionPrecision) + && (std::abs(PEP1.V() - PEP2.V()) < MyConfusionPrecision)) NbPoints = 1; if (NbPoints == 2) { @@ -2300,24 +2300,24 @@ void CalculPtsInterTriEdgeCoplanaires(const Standard_Integer TriSurfID, // Filter if the point is placed on top, the edge is set to -1 if (NbPoints > 0) { - if (Abs(SP1.Lambda1()) < MyConfusionPrecision) + if (std::abs(SP1.Lambda1()) < MyConfusionPrecision) SP1.SetEdge1(-1); - if (Abs(SP1.Lambda1() - 1) < MyConfusionPrecision) + if (std::abs(SP1.Lambda1() - 1) < MyConfusionPrecision) SP1.SetEdge1(-1); - if (Abs(SP1.Lambda2()) < MyConfusionPrecision) + if (std::abs(SP1.Lambda2()) < MyConfusionPrecision) SP1.SetEdge2(-1); - if (Abs(SP1.Lambda2() - 1) < MyConfusionPrecision) + if (std::abs(SP1.Lambda2() - 1) < MyConfusionPrecision) SP1.SetEdge2(-1); } if (NbPoints == 2) { - if (Abs(SP2.Lambda1()) < MyConfusionPrecision) + if (std::abs(SP2.Lambda1()) < MyConfusionPrecision) SP2.SetEdge1(-1); - if (Abs(SP2.Lambda1() - 1) < MyConfusionPrecision) + if (std::abs(SP2.Lambda1() - 1) < MyConfusionPrecision) SP2.SetEdge1(-1); - if (Abs(SP2.Lambda2()) < MyConfusionPrecision) + if (std::abs(SP2.Lambda2()) < MyConfusionPrecision) SP2.SetEdge2(-1); - if (Abs(SP2.Lambda2() - 1) < MyConfusionPrecision) + if (std::abs(SP2.Lambda2() - 1) < MyConfusionPrecision) SP2.SetEdge2(-1); } } @@ -2380,7 +2380,8 @@ Standard_Integer IntPolyh_MaillageAffinage::TriangleEdgeContact(const Standard_I // PE1I = lambda.Edge - if ((Abs(pe1 - pt1) < MyConfusionPrecision) && (Abs(pe2 - pt1) < MyConfusionPrecision)) + if ((std::abs(pe1 - pt1) < MyConfusionPrecision) + && (std::abs(pe2 - pt1) < MyConfusionPrecision)) { // edge and triangle are coplanar (two contact points at maximum) @@ -2392,7 +2393,8 @@ Standard_Integer IntPolyh_MaillageAffinage::TriangleEdgeContact(const Standard_I Standard_Real pp3 = PerpEdge.Dot(PT3); Standard_Real ppe1 = PerpEdge.Dot(PE1); - if ((Abs(pp1 - pp2) < MyConfusionPrecision) && (Abs(pp1 - pp3) < MyConfusionPrecision)) + if ((std::abs(pp1 - pp2) < MyConfusionPrecision) + && (std::abs(pp1 - pp3) < MyConfusionPrecision)) { } else @@ -2419,8 +2421,8 @@ Standard_Integer IntPolyh_MaillageAffinage::TriangleEdgeContact(const Standard_I SP2, NbPoints); - if ((NbPoints > 1) && (Abs(SP2.U1() - SP1.U1()) < MyConfusionPrecision) - && (Abs(SP1.V1() - SP2.V1()) < MyConfusionPrecision)) + if ((NbPoints > 1) && (std::abs(SP2.U1() - SP1.U1()) < MyConfusionPrecision) + && (std::abs(SP1.V1() - SP2.V1()) < MyConfusionPrecision)) NbPoints = 1; // second side @@ -2442,8 +2444,8 @@ Standard_Integer IntPolyh_MaillageAffinage::TriangleEdgeContact(const Standard_I NbPoints); } - if ((NbPoints > 1) && (Abs(SP1.U1() - SP2.U1()) < MyConfusionPrecision) - && (Abs(SP1.V2() - SP2.V1()) < MyConfusionPrecision)) + if ((NbPoints > 1) && (std::abs(SP1.U1() - SP2.U1()) < MyConfusionPrecision) + && (std::abs(SP1.V2() - SP2.V1()) < MyConfusionPrecision)) NbPoints = 1; if (NbPoints >= 2) return (NbPoints); @@ -2471,8 +2473,8 @@ Standard_Integer IntPolyh_MaillageAffinage::TriangleEdgeContact(const Standard_I SP2, NbPoints); - if ((NbPoints > 1) && (Abs(SP2.U1() - SP1.U1()) < MyConfusionPrecision) - && (Abs(SP1.V1() - SP2.V1()) < MyConfusionPrecision)) + if ((NbPoints > 1) && (std::abs(SP2.U1() - SP1.U1()) < MyConfusionPrecision) + && (std::abs(SP1.V1() - SP2.V1()) < MyConfusionPrecision)) NbPoints = 1; // second side @@ -2493,8 +2495,8 @@ Standard_Integer IntPolyh_MaillageAffinage::TriangleEdgeContact(const Standard_I SP2, NbPoints); } - if ((NbPoints > 1) && (Abs(SP2.U1() - SP1.U1()) < MyConfusionPrecision) - && (Abs(SP1.V1() - SP2.V1()) < MyConfusionPrecision)) + if ((NbPoints > 1) && (std::abs(SP2.U1() - SP1.U1()) < MyConfusionPrecision) + && (std::abs(SP1.V1() - SP2.V1()) < MyConfusionPrecision)) NbPoints = 1; if (NbPoints >= 2) return (NbPoints); @@ -2522,8 +2524,8 @@ Standard_Integer IntPolyh_MaillageAffinage::TriangleEdgeContact(const Standard_I SP2, NbPoints); - if ((NbPoints > 1) && (Abs(SP2.U1() - SP1.U1()) < MyConfusionPrecision) - && (Abs(SP1.V1() - SP2.V1()) < MyConfusionPrecision)) + if ((NbPoints > 1) && (std::abs(SP2.U1() - SP1.U1()) < MyConfusionPrecision) + && (std::abs(SP1.V1() - SP2.V1()) < MyConfusionPrecision)) NbPoints = 1; // second side @@ -2544,8 +2546,8 @@ Standard_Integer IntPolyh_MaillageAffinage::TriangleEdgeContact(const Standard_I SP2, NbPoints); } - if ((NbPoints > 1) && (Abs(SP2.U1() - SP1.U1()) < MyConfusionPrecision) - && (Abs(SP2.V1() - SP1.V1()) < MyConfusionPrecision)) + if ((NbPoints > 1) && (std::abs(SP2.U1() - SP1.U1()) < MyConfusionPrecision) + && (std::abs(SP2.V1() - SP1.V1()) < MyConfusionPrecision)) NbPoints = 1; if (NbPoints >= 2) return (NbPoints); @@ -2562,7 +2564,7 @@ Standard_Integer IntPolyh_MaillageAffinage::TriangleEdgeContact(const Standard_I if (lambda < -MyConfusionPrecision) { } - else if (Abs(lambda) < MyConfusionPrecision) + else if (std::abs(lambda) < MyConfusionPrecision) { // lambda==0 PI = PE1; if (TriSurfID == 1) @@ -2570,7 +2572,7 @@ Standard_Integer IntPolyh_MaillageAffinage::TriangleEdgeContact(const Standard_I else SP1.SetEdge1(-1); } - else if (Abs(lambda - 1.0) < MyConfusionPrecision) + else if (std::abs(lambda - 1.0) < MyConfusionPrecision) { // lambda==1 PI = PE2; if (TriSurfID == 1) @@ -2602,11 +2604,11 @@ Standard_Integer IntPolyh_MaillageAffinage::TriangleEdgeContact(const Standard_I Standard_Real D3, D4; // Combination Eq1 Eq2 - if (Abs(Cote23X) > MyConfusionPrecision) + if (std::abs(Cote23X) > MyConfusionPrecision) { D1 = Cote12.Y() - Cote12.X() * Cote23.Y() / Cote23X; } - if (Abs(D1) > MyConfusionPrecision) + if (std::abs(D1) > MyConfusionPrecision) { alpha = (PI.Y() - PT1.Y() - (PI.X() - PT1.X()) * Cote23.Y() / Cote23X) / D1; @@ -2617,24 +2619,25 @@ Standard_Integer IntPolyh_MaillageAffinage::TriangleEdgeContact(const Standard_I beta = (PI.X() - PT1.X() - alpha * Cote12.X()) / Cote23X; } // Combination Eq1 and Eq2 with Cote23.X()==0 - else if ((Abs(Cote12.X()) > MyConfusionPrecision) && (Abs(Cote23X) < MyConfusionPrecision)) + else if ((std::abs(Cote12.X()) > MyConfusionPrecision) + && (std::abs(Cote23X) < MyConfusionPrecision)) { // There is Cote23.X()==0 alpha = (PI.X() - PT1.X()) / Cote12.X(); if ((alpha < -MyConfusionPrecision) || (alpha > (1.0 + MyConfusionPrecision))) return (0); - else if (Abs(Cote23.Y()) > MyConfusionPrecision) + else if (std::abs(Cote23.Y()) > MyConfusionPrecision) beta = (PI.Y() - PT1.Y() - alpha * Cote12.Y()) / Cote23.Y(); - else if (Abs(Cote23.Z()) > MyConfusionPrecision) + else if (std::abs(Cote23.Z()) > MyConfusionPrecision) beta = (PI.Z() - PT1.Z() - alpha * Cote12.Z()) / Cote23.Z(); else { } } // Combination Eq1 and Eq3 - else if ((Abs(Cote23.X()) > MyConfusionPrecision) - && (Abs(D3 = (Cote12.Z() - Cote12.X() * Cote23.Z() / Cote23.X())) + else if ((std::abs(Cote23.X()) > MyConfusionPrecision) + && (std::abs(D3 = (Cote12.Z() - Cote12.X() * Cote23.Z() / Cote23.X())) > MyConfusionPrecision)) { @@ -2646,8 +2649,8 @@ Standard_Integer IntPolyh_MaillageAffinage::TriangleEdgeContact(const Standard_I beta = (PI.X() - PT1.X() - alpha * Cote12.X()) / Cote23.X(); } // Combination Eq2 and Eq3 - else if ((Abs(Cote23.Y()) > MyConfusionPrecision) - && (Abs(D4 = (Cote12.Z() - Cote12.Y() * Cote23.Z() / Cote23.Y())) + else if ((std::abs(Cote23.Y()) > MyConfusionPrecision) + && (std::abs(D4 = (Cote12.Z() - Cote12.Y() * Cote23.Z() / Cote23.Y())) > MyConfusionPrecision)) { @@ -2659,14 +2662,15 @@ Standard_Integer IntPolyh_MaillageAffinage::TriangleEdgeContact(const Standard_I beta = (PI.Y() - PT1.Y() - alpha * Cote12.Y()) / Cote23.Y(); } // Combination Eq2 and Eq3 with Cote23.Y()==0 - else if ((Abs(Cote12.Y()) > MyConfusionPrecision) && (Abs(Cote23.Y()) < MyConfusionPrecision)) + else if ((std::abs(Cote12.Y()) > MyConfusionPrecision) + && (std::abs(Cote23.Y()) < MyConfusionPrecision)) { alpha = (PI.Y() - PT1.Y()) / Cote12.Y(); if ((alpha < -MyConfusionPrecision) || (alpha > (1.0 + MyConfusionPrecision))) return (0); - else if (Abs(Cote23.Z()) > MyConfusionPrecision) + else if (std::abs(Cote23.Z()) > MyConfusionPrecision) beta = (PI.Z() - PT1.Z() - alpha * Cote12.Z()) / Cote23.Z(); else @@ -2677,14 +2681,15 @@ Standard_Integer IntPolyh_MaillageAffinage::TriangleEdgeContact(const Standard_I } } // Combination Eq1 and Eq3 with Cote23.Z()==0 - else if ((Abs(Cote12.Z()) > MyConfusionPrecision) && (Abs(Cote23.Z()) < MyConfusionPrecision)) + else if ((std::abs(Cote12.Z()) > MyConfusionPrecision) + && (std::abs(Cote23.Z()) < MyConfusionPrecision)) { alpha = (PI.Z() - PT1.Z()) / Cote12.Z(); if ((alpha < -MyConfusionPrecision) || (alpha > (1.0 + MyConfusionPrecision))) return (0); - else if (Abs(Cote23.X()) > MyConfusionPrecision) + else if (std::abs(Cote23.X()) > MyConfusionPrecision) beta = (PI.X() - PT1.X() - alpha * Cote12.X()) / Cote23.X(); else @@ -2717,14 +2722,14 @@ Standard_Integer IntPolyh_MaillageAffinage::TriangleEdgeContact(const Standard_I SP1.SetUV1(PT1.U(), PT1.V()); SP1.SetEdge1(-1); } - else if ((beta < MyConfusionPrecision) && (Abs(1 - alpha) < MyConfusionPrecision)) + else if ((beta < MyConfusionPrecision) && (std::abs(1 - alpha) < MyConfusionPrecision)) { // beta==0 alpha==1 SP1.SetXYZ(PT2.X(), PT2.Y(), PT2.Z()); SP1.SetUV1(PT2.U(), PT2.V()); SP1.SetEdge1(-1); } - else if ((Abs(beta - 1) < MyConfusionPrecision) - && (Abs(1 - alpha) < MyConfusionPrecision)) + else if ((std::abs(beta - 1) < MyConfusionPrecision) + && (std::abs(1 - alpha) < MyConfusionPrecision)) { // beta==1 alpha==1 SP1.SetXYZ(PT3.X(), PT3.Y(), PT3.Z()); SP1.SetUV1(PT3.U(), PT3.V()); @@ -2738,7 +2743,7 @@ Standard_Integer IntPolyh_MaillageAffinage::TriangleEdgeContact(const Standard_I else SP1.SetLambda1(1.0 - alpha); } - else if (Abs(beta - alpha) < MyConfusionPrecision) + else if (std::abs(beta - alpha) < MyConfusionPrecision) { // beta==alpha SP1.SetEdge1(Tri1.GetEdgeNumber(3)); if (Tri1.GetEdgeOrientation(3) > 0) @@ -2746,7 +2751,7 @@ Standard_Integer IntPolyh_MaillageAffinage::TriangleEdgeContact(const Standard_I else SP1.SetLambda1(alpha); } - else if (Abs(alpha - 1) < MyConfusionPrecision) + else if (std::abs(alpha - 1) < MyConfusionPrecision) { // alpha==1 SP1.SetEdge1(Tri1.GetEdgeNumber(2)); if (Tri1.GetEdgeOrientation(2) > 0) @@ -2767,14 +2772,14 @@ Standard_Integer IntPolyh_MaillageAffinage::TriangleEdgeContact(const Standard_I SP1.SetUV2(PT1.U(), PT1.V()); SP1.SetEdge2(-1); } - else if ((beta < MyConfusionPrecision) && (Abs(1 - alpha) < MyConfusionPrecision)) + else if ((beta < MyConfusionPrecision) && (std::abs(1 - alpha) < MyConfusionPrecision)) { // beta==0 alpha==1 SP1.SetXYZ(PT2.X(), PT2.Y(), PT2.Z()); SP1.SetUV2(PT2.U(), PT2.V()); SP1.SetEdge2(-1); } - else if ((Abs(beta - 1) < MyConfusionPrecision) - && (Abs(1 - alpha) < MyConfusionPrecision)) + else if ((std::abs(beta - 1) < MyConfusionPrecision) + && (std::abs(1 - alpha) < MyConfusionPrecision)) { // beta==1 alpha==1 SP1.SetXYZ(PT3.X(), PT3.Y(), PT3.Z()); SP1.SetUV2(PT3.U(), PT3.V()); @@ -2788,7 +2793,7 @@ Standard_Integer IntPolyh_MaillageAffinage::TriangleEdgeContact(const Standard_I else SP1.SetLambda2(1.0 - alpha); } - else if (Abs(beta - alpha) < MyConfusionPrecision) + else if (std::abs(beta - alpha) < MyConfusionPrecision) { // beta==alpha SP1.SetEdge2(Tri2.GetEdgeNumber(3)); if (Tri2.GetEdgeOrientation(3) > 0) @@ -2796,7 +2801,7 @@ Standard_Integer IntPolyh_MaillageAffinage::TriangleEdgeContact(const Standard_I else SP1.SetLambda2(alpha); } - else if (Abs(alpha - 1) < MyConfusionPrecision) + else if (std::abs(alpha - 1) < MyConfusionPrecision) { // alpha==1 SP1.SetEdge2(Tri2.GetEdgeNumber(2)); if (Tri2.GetEdgeOrientation(2) > 0) @@ -2972,11 +2977,11 @@ Standard_Integer CheckNextStartPoint(IntPolyh_SectionLine& SectionLine, for (Standard_Integer uiui = 0; uiui < FinTTZ; uiui++) { IntPolyh_StartPoint TestSP = TTangentZones[uiui]; - if ((Abs(SP.U1() - TestSP.U1()) < MyConfusionPrecision) - && (Abs(SP.V1() - TestSP.V1()) < MyConfusionPrecision)) + if ((std::abs(SP.U1() - TestSP.U1()) < MyConfusionPrecision) + && (std::abs(SP.V1() - TestSP.V1()) < MyConfusionPrecision)) { - if ((Abs(SP.U2() - TestSP.U2()) < MyConfusionPrecision) - && (Abs(SP.V2() - TestSP.V2()) < MyConfusionPrecision)) + if ((std::abs(SP.U2() - TestSP.U2()) < MyConfusionPrecision) + && (std::abs(SP.V2() - TestSP.V2()) < MyConfusionPrecision)) { Test = 0; // SP is already in the list of tops uiui = FinTTZ; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPolyh/IntPolyh_Point.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPolyh/IntPolyh_Point.cxx index 09e2f1e018..df4a932c9a 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPolyh/IntPolyh_Point.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPolyh/IntPolyh_Point.cxx @@ -68,7 +68,7 @@ IntPolyh_Point IntPolyh_Point::Divide(const Standard_Real RR) const { IntPolyh_Point res; // - if (Abs(RR) > 10.0e-20) + if (std::abs(RR) > 10.0e-20) { res.SetX(myX / RR); res.SetY(myY / RR); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPolyh/IntPolyh_StartPoint.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPolyh/IntPolyh_StartPoint.cxx index f76b104931..24ee6c8f14 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPolyh/IntPolyh_StartPoint.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPolyh/IntPolyh_StartPoint.cxx @@ -268,18 +268,19 @@ Standard_Integer IntPolyh_StartPoint::CheckSameSP(const IntPolyh_StartPoint& SP) /// Les edges sont definis if (((lambda1 > -MyConfusionPrecision) - && (Abs(lambda1 - SP.lambda1) + && (std::abs(lambda1 - SP.lambda1) < MyConfusionPrecision)) // lambda1!=-1 && lambda1==SP.lambda2 || ((lambda2 > -MyConfusionPrecision) - && (Abs(lambda2 - SP.lambda2) < MyConfusionPrecision))) + && (std::abs(lambda2 - SP.lambda2) < MyConfusionPrecision))) Test = 1; - // if( (Abs(u1-SP.u1) infVal ? (Val > 0 ? infVal : -infVal) : Val); + return (std::abs(Val) > infVal ? (Val > 0 ? infVal : -infVal) : Val); } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntRes2d/IntRes2d_Intersection.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntRes2d/IntRes2d_Intersection.cxx index 0a8b6e0846..acedc6961e 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntRes2d/IntRes2d_Intersection.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntRes2d/IntRes2d_Intersection.cxx @@ -21,7 +21,7 @@ #include #include -#define PARAMEQUAL(a, b) (Abs((a) - (b)) < (1e-8)) +#define PARAMEQUAL(a, b) (std::abs((a) - (b)) < (1e-8)) static void InternalVerifyPosition(IntRes2d_Transition& T1, IntRes2d_Transition& T2, diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntStart/IntStart_SearchInside.gxx b/src/ModelingAlgorithms/TKGeomAlgo/IntStart/IntStart_SearchInside.gxx index 78d6791726..b7b126fb41 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntStart/IntStart_SearchInside.gxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntStart/IntStart_SearchInside.gxx @@ -129,10 +129,10 @@ void IntStart_SearchInside::Perform(TheFunction& Func, UVap(2) = s2d.Y(); Standard_Real u1, v1, u2, v2; - u1 = Binf(1) = Max(umin, UVap(1) - du); - v1 = Binf(2) = Max(vmin, UVap(2) - dv); - u2 = Bsup(1) = Min(umax, UVap(1) + du); - v2 = Bsup(2) = Min(vmax, UVap(2) + dv); + u1 = Binf(1) = std::max(umin, UVap(1) - du); + v1 = Binf(2) = std::max(vmin, UVap(2) - dv); + u2 = Bsup(1) = std::min(umax, UVap(1) + du); + v2 = Bsup(2) = std::min(vmax, UVap(2) + dv); //-- gp_Pnt Pmilieu = ThePSurfaceTool::Value(PS,0.5*(u1+u2),0.5*(v1+v2)); gp_Pnt Pextrm1 = ThePSurfaceTool::Value(PS, u1, v1); @@ -203,10 +203,10 @@ void IntStart_SearchInside::Perform(TheFunction& Func, UVap(1) = s2d.X(); UVap(2) = s2d.Y(); - Binf(1) = Max(umin, UVap(1) - du); - Binf(2) = Max(vmin, UVap(2) - dv); - Bsup(1) = Min(umax, UVap(1) + du); - Bsup(2) = Min(vmax, UVap(2) + dv); + Binf(1) = std::max(umin, UVap(1) - du); + Binf(2) = std::max(vmin, UVap(2) - dv); + Bsup(1) = std::min(umax, UVap(1) + du); + Bsup(2) = std::min(vmax, UVap(2) + dv); } if (nepastester == Standard_False) @@ -214,7 +214,7 @@ void IntStart_SearchInside::Perform(TheFunction& Func, Rsnld.Perform(Func, UVap, Binf, Bsup); if (Rsnld.IsDone()) { - if (Abs(Func.Root()) <= Tol) + if (std::abs(Func.Root()) <= Tol) { if (!Func.IsTangent()) { @@ -229,10 +229,11 @@ void IntStart_SearchInside::Perform(TheFunction& Func, { const IntSurf_InteriorPoint& IPj = list(j); const gp_Pnt& Pj = IPj.Value(); - if ((Abs(Pj.X() - psol.X()) <= Epsilon) && (Abs(Pj.Y() - psol.Y()) <= Epsilon) - && (Abs(Pj.Z() - psol.Z()) <= Epsilon) - && (Abs(UVap(1) - IPj.UParameter()) <= toler1) - && (Abs(UVap(2) - IPj.VParameter()) <= toler2)) + if ((std::abs(Pj.X() - psol.X()) <= Epsilon) + && (std::abs(Pj.Y() - psol.Y()) <= Epsilon) + && (std::abs(Pj.Z() - psol.Z()) <= Epsilon) + && (std::abs(UVap(1) - IPj.UParameter()) <= toler1) + && (std::abs(UVap(2) - IPj.VParameter()) <= toler2)) { testpnt = Standard_False; } @@ -305,7 +306,7 @@ void IntStart_SearchInside::Perform(TheFunction& Func, { Standard_Real tol = Func.Tolerance(); Standard_Real valf = Func.Root(); - if (Abs(valf) <= tol && !Func.IsTangent()) + if (std::abs(valf) <= tol && !Func.IsTangent()) { const gp_Pnt& psol = Func.Point(); Rsnld.Root(UVap); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntStart/IntStart_SearchOnBoundaries.gxx b/src/ModelingAlgorithms/TKGeomAlgo/IntStart/IntStart_SearchOnBoundaries.gxx index 294669b3d8..e751f6bb44 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntStart/IntStart_SearchOnBoundaries.gxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntStart/IntStart_SearchOnBoundaries.gxx @@ -153,7 +153,7 @@ void FindVertex(const TheArc& A, // The arc is already assumed in the load function. Func.Value(param, valf); - if (Abs(valf) <= Toler) + if (std::abs(valf) <= Toler) { itemp = Func.GetStateNumber(); pnt.Append(IntStart_ThePathPoint(Func.Valpoint(itemp), Toler, vtx, A, param)); @@ -180,7 +180,7 @@ Standard_Boolean IsDegenerated(const IntSurf_Quadric& theQuadric) if (TypeQuad == GeomAbs_Cone) { gp_Cone aCone = theQuadric.Cone(); - Standard_Real aSemiAngle = Abs(aCone.SemiAngle()); + Standard_Real aSemiAngle = std::abs(aCone.SemiAngle()); if (aSemiAngle < 0.02 || aSemiAngle > 1.55) return Standard_True; } @@ -517,7 +517,7 @@ static void BoundedArc(const TheArc& A, Standard_Real aParam = Pdeb + i * delta; Standard_Real aValue; Func.Value(aParam, aValue); - if (Abs(aValue) > GlobalTol) + if (std::abs(aValue) > GlobalTol) { SolOnBoundary = Standard_False; break; @@ -533,9 +533,9 @@ static void BoundedArc(const TheArc& A, // Recuperer point debut et fin, et leur parametre. SolAgain.GetInterval(i, pardeb, parfin); - if (Abs(pardeb - Pdeb) <= Precision::PConfusion()) + if (std::abs(pardeb - Pdeb) <= Precision::PConfusion()) pardeb = Pdeb; - if (Abs(parfin - Pfin) <= Precision::PConfusion()) + if (std::abs(parfin - Pfin) <= Precision::PConfusion()) parfin = Pfin; SolAgain.GetIntervalState(i, ideb, ifin); @@ -604,21 +604,21 @@ static void BoundedArc(const TheArc& A, Standard_Real yf = 0.0; Standard_Real ym = 0.0; Standard_Real yl = 0.0; - if (Func.Value(param, ym) && Abs(ym) < maxdist) + if (Func.Value(param, ym) && std::abs(ym) < maxdist) { - Standard_Real sm = Sign(1., ym); + Standard_Real sm = std::copysign(1., ym); Standard_Boolean aTang = Func.Value(para, yf) && Func.Value(parap1, yl); if (aTang) { // Line can be tangent surface if all distances less then maxdist - aTang = aTang && Abs(yf) < maxdist && Abs(yl) < maxdist; + aTang = aTang && std::abs(yf) < maxdist && std::abs(yl) < maxdist; } if (aTang && IsIntCSdone && TypeConS == GeomAbs_Line) { // Interval is got by exact intersection // Line can be tangent if all points are on the same side of surface // it means that signs of all distances are the same - Standard_Real sf = Sign(1., yf), sl = Sign(1., yl); + Standard_Real sf = std::copysign(1., yf), sl = std::copysign(1., yl); aTang = aTang && (sm == sf) && (sm == sl); } if (aTang) @@ -632,10 +632,10 @@ static void BoundedArc(const TheArc& A, aTol = 0.001; // fix floating point exception 569, chl-922-e9 - parap1 = (Abs(parap1) < 1.e9) ? parap1 : ((parap1 >= 0.) ? 1.e9 : -1.e9); - para = (Abs(para) < 1.e9) ? para : ((para >= 0.) ? 1.e9 : -1.e9); + parap1 = (std::abs(parap1) < 1.e9) ? parap1 : ((parap1 >= 0.) ? 1.e9 : -1.e9); + para = (std::abs(para) < 1.e9) ? para : ((para >= 0.) ? 1.e9 : -1.e9); - Standard_Integer aNbNodes = RealToInt(Ceiling((parap1 - para) / aTol)); + Standard_Integer aNbNodes = RealToInt(std::ceil((parap1 - para) / aTol)); Standard_Real aVal = RealLast(); Standard_Real aValMax = 0.; @@ -651,7 +651,7 @@ static void BoundedArc(const TheArc& A, if (Func.Value(aCurPar, aCurVal)) { - Standard_Real anAbsVal = Abs(aCurVal); + Standard_Real anAbsVal = std::abs(aCurVal); if (anAbsVal < aVal) { aVal = anAbsVal; @@ -668,8 +668,8 @@ static void BoundedArc(const TheArc& A, // minimal and maximal values are almost the same if (IsIntCSdone && aNbNodes > 1) { - aTang = - Abs(param - para) > EpsX && Abs(parap1 - param) > EpsX && 0.01 * aValMax <= aVal; + aTang = std::abs(param - para) > EpsX && std::abs(parap1 - param) > EpsX + && 0.01 * aValMax <= aVal; } if (aTang) { @@ -689,7 +689,7 @@ static void BoundedArc(const TheArc& A, if (!Func.Value(para, dist)) continue; - dist = Abs(dist); + dist = std::abs(dist); Standard_Integer anIndx = -1; // const Standard_Real aParam = Sol->GetPoint(aSI(i).Index()); @@ -697,8 +697,8 @@ static void BoundedArc(const TheArc& A, if (dist < maxdist) { if (!IsIntCSdone - && (Abs(aParam - Pdeb) <= Precision::PConfusion() - || Abs(aParam - Pfin) <= Precision::PConfusion())) + && (std::abs(aParam - Pdeb) <= Precision::PConfusion() + || std::abs(aParam - Pfin) <= Precision::PConfusion())) { anIndx = pSol->GetPointState(aSI(i).Index()); } @@ -787,8 +787,8 @@ static void BoundedArc(const TheArc& A, if (Nbi == 1) { - if ((Abs(pardeb - Pdeb) < Precision::PConfusion()) - && (Abs(parfin - Pfin) < Precision::PConfusion())) + if ((std::abs(pardeb - Pdeb) < Precision::PConfusion()) + && (std::abs(parfin - Pfin) < Precision::PConfusion())) { Arcsol = Standard_True; } @@ -908,7 +908,7 @@ void PointProcess(const gp_Pnt& Pt, while (goon) { vtx = Domain->Vertex(); - dist = Abs(Para - TheSOBTool::Parameter(vtx, A)); + dist = std::abs(Para - TheSOBTool::Parameter(vtx, A)); toler = TheSOBTool::Tolerance(vtx, A); #ifdef OCCT_DEBUG if (toler > 0.1) @@ -934,7 +934,7 @@ void PointProcess(const gp_Pnt& Pt, { // jag 940608 if (ptsol.Vertex() == vtx && ptsol.Arc() == A) { if (Domain->Identical(ptsol.Vertex(), vtx) && ptsol.Arc() == A - && Abs(ptsol.Parameter() - Para) <= toler) + && std::abs(ptsol.Parameter() - Para) <= toler) { found = Standard_True; } @@ -979,7 +979,7 @@ void PointProcess(const gp_Pnt& Pt, ptsol = pnt.Value(k); if (ptsol.Arc() != A || !ptsol.IsNew()) // vertex continue; - if (Abs(ptsol.Parameter() - Para) <= Precision::PConfusion()) + if (std::abs(ptsol.Parameter() - Para) <= Precision::PConfusion()) { found_internal = Standard_True; Range = k; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntSurf/IntSurf_Quadric.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntSurf/IntSurf_Quadric.cxx index 576ac42d89..5881f1f231 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntSurf/IntSurf_Quadric.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntSurf/IntSurf_Quadric.cxx @@ -81,7 +81,7 @@ IntSurf_Quadric::IntSurf_Quadric(const gp_Cone& C) lin.SetPosition(ax3.Axis()); prm1 = C.RefRadius(); prm2 = C.SemiAngle(); - prm3 = Cos(prm2); + prm3 = std::cos(prm2); prm4 = 0.0; } @@ -140,7 +140,7 @@ void IntSurf_Quadric::SetValue(const gp_Cone& C) lin.SetPosition(ax3.Axis()); prm1 = C.RefRadius(); prm2 = C.SemiAngle(); - prm3 = Cos(prm2); + prm3 = std::cos(prm2); prm4 = 0.0; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_IWalking.gxx b/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_IWalking.gxx index 768ad8d9c7..0ab1a5b7cf 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_IWalking.gxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_IWalking.gxx @@ -50,14 +50,14 @@ static Standard_Boolean IsTangentExtCheck(TheIWFunction& theFunc, { const Standard_Real aTol = theFunc.Tolerance(); const Standard_Integer aNbItems = 4; - const Standard_Real aParU[aNbItems] = {Min(theU + theStepU, theUsup), - Max(theU - theStepU, theUinf), + const Standard_Real aParU[aNbItems] = {std::min(theU + theStepU, theUsup), + std::max(theU - theStepU, theUinf), theU, theU}; const Standard_Real aParV[aNbItems] = {theV, theV, - Min(theV + theStepV, theVsup), - Max(theV - theStepV, theVinf)}; + std::min(theV + theStepV, theVsup), + std::max(theV - theStepV, theVinf)}; math_Vector aX(1, 2), aVal(1, 1); @@ -69,7 +69,7 @@ static Standard_Boolean IsTangentExtCheck(TheIWFunction& theFunc, if (!theFunc.Value(aX, aVal)) continue; - if (Abs(theFunc.Root()) > aTol) + if (std::abs(theFunc.Root()) > aTol) return Standard_False; } @@ -235,7 +235,7 @@ void IntWalk_IWalking::Perform(const ThePOPIterator& Pnts1, Func.Set(Caro); - if (mySRangeU.Delta() > Max(tolerance(1), Precision::PConfusion())) + if (mySRangeU.Delta() > std::max(tolerance(1), Precision::PConfusion())) { mySRangeU.Enlarge(mySRangeU.Delta()); mySRangeU.Common(Bnd_Range(Um, UM)); @@ -245,7 +245,7 @@ void IntWalk_IWalking::Perform(const ThePOPIterator& Pnts1, mySRangeU = Bnd_Range(Um, UM); } - if (mySRangeV.Delta() > Max(tolerance(2), Precision::PConfusion())) + if (mySRangeV.Delta() > std::max(tolerance(2), Precision::PConfusion())) { mySRangeV.Enlarge(mySRangeV.Delta()); mySRangeV.Common(Bnd_Range(Vm, VM)); @@ -388,9 +388,9 @@ void IntWalk_IWalking::Perform(const ThePOPIterator& Pnts1, static void CutVectorByTolerances(gp_Vec2d& theVector, const math_Vector& theTolerance) { - if (Abs(theVector.X()) < theTolerance(1)) + if (std::abs(theVector.X()) < theTolerance(1)) theVector.SetX(0.); - if (Abs(theVector.Y()) < theTolerance(2)) + if (std::abs(theVector.Y()) < theTolerance(2)) theVector.SetY(0.); } @@ -450,7 +450,7 @@ Standard_Boolean IntWalk_IWalking::Cadrage(math_Vector& BornInf, { // jag 940616 if (Duvx) { - theStepU = Abs((BornInf(1) - UVap(1)) / Duvx); // iso U =BornInf(1) + theStepU = std::abs((BornInf(1) - UVap(1)) / Duvx); // iso U =BornInf(1) } else { @@ -461,7 +461,7 @@ Standard_Boolean IntWalk_IWalking::Cadrage(math_Vector& BornInf, { if (Duvx) { - theStepU = Abs((BornSup(1) - UVap(1)) / Duvx); // iso U =BornSup(1) + theStepU = std::abs((BornSup(1) - UVap(1)) / Duvx); // iso U =BornSup(1) } else { @@ -472,7 +472,7 @@ Standard_Boolean IntWalk_IWalking::Cadrage(math_Vector& BornInf, { // jag 940616 if (Duvy) { - theStepV = Abs((BornInf(2) - UVap(2)) / Duvy); // iso V =BornInf(2) + theStepV = std::abs((BornInf(2) - UVap(2)) / Duvy); // iso V =BornInf(2) } else { @@ -483,7 +483,7 @@ Standard_Boolean IntWalk_IWalking::Cadrage(math_Vector& BornInf, { if (Duvy) { - theStepV = Abs((BornSup(2) - UVap(2)) / Duvy); // iso V =BornSup(2) + theStepV = std::abs((BornSup(2) - UVap(2)) / Duvy); // iso V =BornSup(2) } else { @@ -528,7 +528,7 @@ Standard_Boolean IntWalk_IWalking::Cadrage(math_Vector& BornInf, { // jag 940616 if (Duvx) { - Standard_Real aStep = Abs((BornInf(1) - UVap(1)) / Duvx); // iso U =BornInf(1) + Standard_Real aStep = std::abs((BornInf(1) - UVap(1)) / Duvx); // iso U =BornInf(1) if (aStep < Step) Step = aStep; } @@ -541,7 +541,7 @@ Standard_Boolean IntWalk_IWalking::Cadrage(math_Vector& BornInf, { // jag 940616 if (Duvx) { - Standard_Real aStep = Abs((BornSup(1) - UVap(1)) / Duvx); // iso U =BornSup(1) + Standard_Real aStep = std::abs((BornSup(1) - UVap(1)) / Duvx); // iso U =BornSup(1) if (aStep < Step) Step = aStep; } @@ -554,7 +554,7 @@ Standard_Boolean IntWalk_IWalking::Cadrage(math_Vector& BornInf, { // jag 940616 if (Duvy) { - Standard_Real aStep = Abs((BornInf(2) - UVap(2)) / Duvy); // iso V =BornInf(2) + Standard_Real aStep = std::abs((BornInf(2) - UVap(2)) / Duvy); // iso V =BornInf(2) if (aStep < Step) Step = aStep; } @@ -567,7 +567,7 @@ Standard_Boolean IntWalk_IWalking::Cadrage(math_Vector& BornInf, { // jag 940616 if (Duvy) { - Standard_Real aStep = Abs((BornSup(2) - UVap(2)) / Duvy); // iso V =BornSup(2) + Standard_Real aStep = std::abs((BornSup(2) - UVap(2)) / Duvy); // iso V =BornSup(2) if (aStep < Step) Step = aStep; } @@ -638,7 +638,8 @@ Standard_Boolean IntWalk_IWalking::TestArretPassage(const TColStd_SequenceOfReal // IFV for OCC20285 - if ((Abs(Du) < tolu2 && Abs(Dv) < tolv2) || (Abs(Dup) < tolu2 && Abs(Dvp) < tolv2)) + if ((std::abs(Du) < tolu2 && std::abs(Dv) < tolv2) + || (std::abs(Dup) < tolu2 && std::abs(Dvp) < tolv2)) { wd2[i].etat = -wd2[i].etat; } @@ -698,12 +699,12 @@ Standard_Boolean IntWalk_IWalking::TestArretPassage(const TColStd_SequenceOfReal Vtest = wd1[i].vstart; Dup = Up - Utest; Dvp = Vp - Vtest; - if (Abs(Dup) >= tolu || Abs(Dvp) >= tolv) + if (std::abs(Dup) >= tolu || std::abs(Dvp) >= tolv) { Standard_Real UV1mUtest = UV(1) - Utest; Standard_Real UV2mVtest = UV(2) - Vtest; if (((Dup * UV1mUtest + Dvp * UV2mVtest) < 0) - || (Abs(UV1mUtest) < tolu && Abs(UV2mVtest) < tolv)) + || (std::abs(UV1mUtest) < tolu && std::abs(UV2mVtest) < tolv)) { i_candidates.Append((Standard_Integer)i); SqDist_candidates.Append(Dup * Dup + Dvp * Dvp); @@ -724,7 +725,7 @@ Standard_Boolean IntWalk_IWalking::TestArretPassage(const TColStd_SequenceOfReal for (j = N + 1; j <= N + nbMultiplicities[i]; j++) { if (((Up - Umult(j)) * (UV(1) - Umult(j)) + (Vp - Vmult(j)) * (UV(2) - Vmult(j)) < 0) - || (Abs(UV(1) - Umult(j)) < tolu && Abs(UV(2) - Vmult(j)) < tolv)) + || (std::abs(UV(1) - Umult(j)) < tolu && std::abs(UV(2) - Vmult(j)) < tolv)) { Irang = (Standard_Integer)i; Arrive = Standard_True; @@ -805,13 +806,15 @@ Standard_Boolean IntWalk_IWalking::TestArretPassage(const TColStd_SequenceOfReal // This is no good for computation. Therefore, it is limited. // Do not limit this factor in case of highly anisotropic parametrization //(parametric space is considerably larger in one direction than another). - const Standard_Boolean isHighlyAnisotropic = Max(tolu, tolv) > 1000. * Min(tolu, tolv); + const Standard_Boolean isHighlyAnisotropic = std::max(tolu, tolv) > 1000. * std::min(tolu, tolv); const Standard_Real deltau = - mySRangeU.IsVoid() ? UM - Um - : (isHighlyAnisotropic ? mySRangeU.Delta() : Max(mySRangeU.Delta(), 1.0)); + mySRangeU.IsVoid() + ? UM - Um + : (isHighlyAnisotropic ? mySRangeU.Delta() : std::max(mySRangeU.Delta(), 1.0)); const Standard_Real deltav = - mySRangeV.IsVoid() ? VM - Vm - : (isHighlyAnisotropic ? mySRangeV.Delta() : Max(mySRangeV.Delta(), 1.0)); + mySRangeV.IsVoid() + ? VM - Vm + : (isHighlyAnisotropic ? mySRangeV.Delta() : std::max(mySRangeV.Delta(), 1.0)); Up /= deltau; UV1 /= deltau; @@ -858,7 +861,7 @@ Standard_Boolean IntWalk_IWalking::TestArretPassage(const TColStd_SequenceOfReal Standard_Real dCurrentStart = UV1mUtest * UV1mUtest + UV2mVtest * UV2mVtest; Scal = (UpmUtest) * (UV1mUtest) + (VpmVtest) * (UV2mVtest); - if ((Abs(UpmUtest) < tolu && Abs(VpmVtest) < tolv)) + if ((std::abs(UpmUtest) < tolu && std::abs(VpmVtest) < tolv)) { if (Index != k) { @@ -924,7 +927,7 @@ Standard_Boolean IntWalk_IWalking::TestArretPassage(const TColStd_SequenceOfReal Vtest /= deltav; if (((Up - Utest) * (UV1 - Utest) + (Vp - Vtest) * (UV2 - Vtest) < 0) - || (Abs(UV1 - Utest) < tolu && Abs(UV2 - Vtest) < tolv)) + || (std::abs(UV1 - Utest) < tolu && std::abs(UV2 - Vtest) < tolv)) Irang = i; else if (nbMultiplicities[i] > 0) { @@ -936,7 +939,7 @@ Standard_Boolean IntWalk_IWalking::TestArretPassage(const TColStd_SequenceOfReal Standard_Real Umultj = Umult(j) / deltau; Standard_Real Vmultj = Vmult(j) / deltav; if (((Up - Umultj) * (UV1 - Umultj) + (Vp - Vmultj) * (UV2 - Vmultj) < 0) - || (Abs(UV1 - Umultj) < tolu && Abs(UV2 - Vmultj) < tolv)) + || (std::abs(UV1 - Umultj) < tolu && std::abs(UV2 - Vmultj) < tolv)) { Irang = i; break; @@ -978,14 +981,14 @@ Standard_Boolean IntWalk_IWalking::TestArretAjout(TheIWFunction& sp, { Irang = seqAjout.Value(i); - // add test Abs(Irang) <= lines.Length() for the case when + // add test std::abs(Irang) <= lines.Length() for the case when // a closed line is opened by adding a 1 point on this same // line. Anyway there is a huge problem as 2 points will be // added on this line... - if (Abs(Irang) <= lines.Length()) + if (std::abs(Irang) <= lines.Length()) { - const Handle(IntWalk_TheIWLine)& Line = lines.Value(Abs(Irang)); + const Handle(IntWalk_TheIWLine)& Line = lines.Value(std::abs(Irang)); if (Irang > 0) Psol = Line->Value(Line->NbPoints()); else @@ -999,9 +1002,9 @@ Standard_Boolean IntWalk_IWalking::TestArretAjout(TheIWFunction& sp, Psol.ParametersOnS1(U1, V1); } if (((Up - U1) * (UV(1) - U1) + (Vp - V1) * (UV(2) - V1)) < 0 - || (Abs(UV(1) - U1) < tolerance(1) && Abs(UV(2) - V1) < tolerance(2))) + || (std::abs(UV(1) - U1) < tolerance(1) && std::abs(UV(2) - V1) < tolerance(2))) { - // jag 940615 Irang= -Abs(Irang); + // jag 940615 Irang= -std::abs(Irang); Arrive = Standard_True; UV(1) = U1; UV(2) = V1; @@ -1036,7 +1039,7 @@ void IntWalk_IWalking::FillPntsInHoles(TheIWFunction& sp, continue; Standard_Boolean ToRemove = Standard_False; IntSurf_PntOn2S PointAlone1, PointAlone2; - const Handle(IntWalk_TheIWLine)& Line1 = lines.Value(Abs(Irang1)); + const Handle(IntWalk_TheIWLine)& Line1 = lines.Value(std::abs(Irang1)); if (Irang1 > 0) PointAlone1 = Line1->Value(Line1->NbPoints()); else @@ -1049,7 +1052,7 @@ void IntWalk_IWalking::FillPntsInHoles(TheIWFunction& sp, Standard_Integer Irang2 = CopySeqAlone(j); if (Irang2 == 0 || BadSolutions.Contains(Irang2)) continue; - const Handle(IntWalk_TheIWLine)& Line2 = lines.Value(Abs(Irang2)); + const Handle(IntWalk_TheIWLine)& Line2 = lines.Value(std::abs(Irang2)); if (Irang2 > 0) PointAlone2 = Line2->Value(Line2->NbPoints()); else @@ -1071,7 +1074,7 @@ void IntWalk_IWalking::FillPntsInHoles(TheIWFunction& sp, continue; } // Ends of same line - if (Abs(Irang1) == Abs(MinRang) && lines.Value(Abs(Irang1))->NbPoints() == 2) + if (std::abs(Irang1) == std::abs(MinRang) && lines.Value(std::abs(Irang1))->NbPoints() == 2) { SeqToRemove.Append(Irang1); SeqToRemove.Append(MinRang); @@ -1081,7 +1084,7 @@ void IntWalk_IWalking::FillPntsInHoles(TheIWFunction& sp, continue; } /////////////////// - const Handle(IntWalk_TheIWLine)& Line2 = lines.Value(Abs(MinRang)); + const Handle(IntWalk_TheIWLine)& Line2 = lines.Value(std::abs(MinRang)); if (MinRang > 0) PointAlone2 = Line2->Value(Line2->NbPoints()); else @@ -1091,8 +1094,8 @@ void IntWalk_IWalking::FillPntsInHoles(TheIWFunction& sp, P2d2 = PointAlone2.ValueOnSurface(reversed); Standard_Real MinSqDist3d = Pnt1.SquareDistance(Pnt2); if (MinSqDist3d <= epsilon - || (Abs(P2d1.X() - P2d2.X()) <= tolerance(1) - && Abs(P2d1.Y() - P2d2.Y()) <= tolerance(2))) // close points + || (std::abs(P2d1.X() - P2d2.X()) <= tolerance(1) + && std::abs(P2d1.Y() - P2d2.Y()) <= tolerance(2))) // close points ToRemove = Standard_True; else // real curve { @@ -1101,7 +1104,7 @@ void IntWalk_IWalking::FillPntsInHoles(TheIWFunction& sp, UVap(2) = (P2d1.Y() + P2d2.Y()) / 2; math_FunctionSetRoot Rsnld(sp, tolerance); Rsnld.Perform(sp, UVap, BornInf, BornSup); - if (Rsnld.IsDone() && Abs(sp.Root()) <= sp.Tolerance() && !sp.IsTangent()) + if (Rsnld.IsDone() && std::abs(sp.Root()) <= sp.Tolerance() && !sp.IsTangent()) { Rsnld.Root(UV); gp_Pnt2d Pmid(UV(1), UV(2)); @@ -1177,7 +1180,7 @@ void IntWalk_IWalking::TestArretCadre(const TColStd_SequenceOfReal& Umult, // tried all tests of stop and arrived. // test of stop on all given departure points already marked and on the entire current line. // This line can be shortened if the stop point is found. -// Abs(Irang) = index in the iterator of departure points or 0 +// std::abs(Irang) = index in the iterator of departure points or 0 // if Irang <0 , it is necessary to add this point on the line (no Line->Cut) // UV = parameter of the departure point { @@ -1233,7 +1236,8 @@ void IntWalk_IWalking::TestArretCadre(const TColStd_SequenceOfReal& Umult, UV(2) = wd1[Irang].vstart; Found = Standard_True; } - else if (Abs(Uc - wd1[i].ustart) < tolerance(1) && Abs(Vc - wd1[i].vstart) < tolerance(2)) + else if (std::abs(Uc - wd1[i].ustart) < tolerance(1) + && std::abs(Vc - wd1[i].vstart) < tolerance(2)) { Line->Cut(j); nbp = Line->NbPoints(); @@ -1263,7 +1267,8 @@ void IntWalk_IWalking::TestArretCadre(const TColStd_SequenceOfReal& Umult, Found = Standard_True; break; } - else if (Abs(Uc - Umult(k)) < tolerance(1) && Abs(Vc - Vmult(k)) < tolerance(2)) + else if (std::abs(Uc - Umult(k)) < tolerance(1) + && std::abs(Vc - Vmult(k)) < tolerance(2)) { Line->Cut(j); nbp = Line->NbPoints(); @@ -1329,8 +1334,8 @@ void IntWalk_IWalking::TestArretCadre(const TColStd_SequenceOfReal& Umult, UV(2) = wd1[Irang].vstart; Found = Standard_True; } - else if (Abs(UV(1) - wd1[i].ustart) < tolerance(1) - && Abs(UV(2) - wd1[i].vstart) < tolerance(2)) + else if (std::abs(UV(1) - wd1[i].ustart) < tolerance(1) + && std::abs(UV(2) - wd1[i].vstart) < tolerance(2)) { Irang = i; UV(1) = wd1[Irang].ustart; @@ -1356,7 +1361,8 @@ void IntWalk_IWalking::TestArretCadre(const TColStd_SequenceOfReal& Umult, Found = Standard_True; break; } - else if (Abs(UV(1) - Umult(j)) < tolerance(1) && Abs(UV(2) - Vmult(j)) < tolerance(2)) + else if (std::abs(UV(1) - Umult(j)) < tolerance(1) + && std::abs(UV(2) - Vmult(j)) < tolerance(2)) { Irang = i; UV(1) = wd1[Irang].ustart; @@ -1482,7 +1488,7 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult, if (IsPointOnLine(previousPoint, BornInf, BornSup, Rsnld, aFuncForDuplicate)) { - wd1[I].etat = -Abs(wd1[I].etat); // mark point as processed + wd1[I].etat = -std::abs(wd1[I].etat); // mark point as processed continue; } @@ -1524,12 +1530,12 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult, // modified by NIZHNY-MKK Fri Oct 27 12:34:37 2000.END // Modified by Sergey KHROMOV - Tue Nov 20 10:41:45 2001 Begin - wd1[I].etat = -Abs(wd1[I].etat); + wd1[I].etat = -std::abs(wd1[I].etat); movementdirectioninfo[I] = (movementdirectioninfo[I] == 0) ? StepSign : 0; // Modified by Sergey KHROMOV - Tue Nov 20 10:41:56 2001 End // first step of advancement - Standard_Real d2dx = Abs(previousd2d.X()); - Standard_Real d2dy = Abs(previousd2d.Y()); + Standard_Real d2dx = std::abs(previousd2d.X()); + Standard_Real d2dy = std::abs(previousd2d.Y()); if (d2dx < tolerance(1)) { PasC = pas * (VM - Vm) / d2dy; @@ -1540,7 +1546,7 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult, } else { - PasC = pas * Min((UM - Um) / d2dx, (VM - Vm) / d2dy); + PasC = pas * std::min((UM - Um) / d2dx, (VM - Vm) / d2dy); } Arrive = Standard_False; @@ -1574,11 +1580,11 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult, } if (Rsnld.IsDone()) { - if (Abs(Func.Root()) > Func.Tolerance()) + if (std::abs(Func.Root()) > Func.Tolerance()) { PasC = PasC / 2.0; - PasCu = Abs(PasC * previousd2d.X()); - PasCv = Abs(PasC * previousd2d.Y()); + PasCu = std::abs(PasC * previousd2d.X()); + PasCv = std::abs(PasC * previousd2d.Y()); if (PasCu <= tolerance(1) && PasCv <= tolerance(2)) { if (CurrentLine->NbPoints() == 1) @@ -1725,7 +1731,7 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult, Standard_Integer etat1N = wd1[N].etat; // modified by NIZHNY-MKK Thu Nov 2 15:09:51 2000.BEGIN // if (etat1N < 11) { // passing point that is a stop - if (Abs(etat1N) < 11) + if (std::abs(etat1N) < 11) { // passing point that is a stop // modified by NIZHNY-MKK Thu Nov 2 15:12:11 2000.END if (aStatus == IntWalk_ArretSurPoint) @@ -1752,7 +1758,7 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult, { // modified by NIZHNY-MKK Fri Oct 27 12:43:05 2000.BEGIN // wd1[N].etat= - wd1[N].etat; - wd1[N].etat = -Abs(etat1N); + wd1[N].etat = -std::abs(etat1N); movementdirectioninfo[N] = (movementdirectioninfo[N] == 0) ? StepSign : 0; if (Arrive && movementdirectioninfo[N] != 0) { @@ -1794,8 +1800,8 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult, else { // no numerical solution PasC = PasC / 2.; - PasCu = Abs(PasC * previousd2d.X()); - PasCv = Abs(PasC * previousd2d.Y()); + PasCu = std::abs(PasC * previousd2d.X()); + PasCv = std::abs(PasC * previousd2d.Y()); if (PasCu <= tolerance(1) && PasCv <= tolerance(2)) { if (CurrentLine->NbPoints() == 1) @@ -1849,7 +1855,7 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult, Vav -= Vavp; Uav *= 0.001; Vav *= 0.001; - if (Abs(Uav) < tolerance(1) && Abs(Vav) < tolerance(2)) + if (std::abs(Uav) < tolerance(1) && std::abs(Vav) < tolerance(2)) { // modified by NIZHNY-MKK Fri Oct 27 13:01:38 2000.BEGIN // wd1[av].etat=-wd1[av].etat; @@ -1882,7 +1888,7 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult, Vav -= Vavp; Uav *= 0.001; Vav *= 0.001; - if (Abs(Uav) < tolerance(1) && Abs(Vav) < tolerance(2)) + if (std::abs(Uav) < tolerance(1) && std::abs(Vav) < tolerance(2)) { // modified by NIZHNY-MKK Fri Oct 27 13:02:49 2000.BEGIN // wd1[av].etat=-wd1[av].etat; @@ -1934,12 +1940,12 @@ static Standard_Boolean TestPassedSolutionWithNegativeState( Vtest = wd[i].vstart; Dup = prevUp - Utest; Dvp = prevVp - Vtest; - if (Abs(Dup) >= tolu || Abs(Dvp) >= tolv) + if (std::abs(Dup) >= tolu || std::abs(Dvp) >= tolv) { Standard_Real UV1mUtest = UV(1) - Utest; Standard_Real UV2mVtest = UV(2) - Vtest; if (((Dup * UV1mUtest + Dvp * UV2mVtest) < 0) - || (Abs(UV1mUtest) < tolu && Abs(UV2mVtest) < tolv)) + || (std::abs(UV1mUtest) < tolu && std::abs(UV2mVtest) < tolv)) { Irang = i; Arrive = Standard_True; @@ -1957,7 +1963,7 @@ static Standard_Boolean TestPassedSolutionWithNegativeState( { if (((prevUp - Umult(j)) * (UV(1) - Umult(j)) + (prevVp - Vmult(j)) * (UV(2) - Vmult(j)) < 0) - || (Abs(UV(1) - Umult(j)) < tolu && Abs(UV(2) - Vmult(j)) < tolv)) + || (std::abs(UV(1) - Umult(j)) < tolu && std::abs(UV(2) - Vmult(j)) < tolv)) { Irang = i; Arrive = Standard_True; @@ -2065,7 +2071,7 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult, Standard_Real aParam = BornInf(aChangeIdx) + aParamIdx * aStep(aChangeIdx); UV(aChangeIdx) = aParam; Func.Derivatives(UV, D); - if (Abs(D(1, aChangeIdx)) > Precision::Confusion()) + if (std::abs(D(1, aChangeIdx)) > Precision::Confusion()) { isLeftDegeneratedBorder[aBorderIdx - 1] = Standard_False; break; @@ -2079,7 +2085,7 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult, Standard_Real aParam = BornInf(aChangeIdx) + aParamIdx * aStep(aChangeIdx); UV(aChangeIdx) = aParam; Func.Derivatives(UV, D); - if (Abs(D(1, aChangeIdx)) > Precision::Confusion()) + if (std::abs(D(1, aChangeIdx)) > Precision::Confusion()) { isRightDegeneratedBorder[aBorderIdx - 1] = Standard_False; break; @@ -2120,8 +2126,8 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult, // first step of advancement - Standard_Real d2dx = Abs(previousd2d.X()); - Standard_Real d2dy = Abs(previousd2d.Y()); + Standard_Real d2dx = std::abs(previousd2d.X()); + Standard_Real d2dy = std::abs(previousd2d.Y()); if (d2dx < tolerance(1)) { PasC = pas * (VM - Vm) / d2dy; @@ -2132,7 +2138,7 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult, } else { - PasC = pas * Min((UM - Um) / d2dx, (VM - Vm) / d2dy); + PasC = pas * std::min((UM - Um) / d2dx, (VM - Vm) / d2dy); } PasSav = PasC; @@ -2165,11 +2171,11 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult, } if (Rsnld.IsDone()) { - if (Abs(Func.Root()) > Func.Tolerance()) + if (std::abs(Func.Root()) > Func.Tolerance()) { // no solution for the tolerance PasC = PasC / 2.; - PasCu = Abs(PasC * previousd2d.X()); - PasCv = Abs(PasC * previousd2d.Y()); + PasCu = std::abs(PasC * previousd2d.X()); + PasCv = std::abs(PasC * previousd2d.Y()); if (PasCu <= tolerance(1) && PasCv <= tolerance(2)) { @@ -2222,9 +2228,10 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult, { // Check degenerated cases and fix if possible. if ((isLeftDegeneratedBorder[aCoordIdx - 1] - && Abs(Uvap(aCoordIdx) - BornInf(aCoordIdx)) < Precision::PConfusion()) + && std::abs(Uvap(aCoordIdx) - BornInf(aCoordIdx)) < Precision::PConfusion()) || (isRightDegeneratedBorder[aCoordIdx - 1] - && Abs(Uvap(aCoordIdx) - BornSup(aCoordIdx)) < Precision::PConfusion())) + && std::abs(Uvap(aCoordIdx) - BornSup(aCoordIdx)) + < Precision::PConfusion())) { Standard_Real uvprev[2], uv[2]; if (!reversed) @@ -2246,9 +2253,9 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult, if (aStatus != IntWalk_PasTropGrand) { // Make linear extrapolation. - if (Abs(uv[aCoordIdx - 1] - uvprev[aCoordIdx - 1]) > gp::Resolution()) - aScaleCoeff = Abs((Uvap(aCoordIdx) - uv[aCoordIdx - 1]) - / (uv[aCoordIdx - 1] - uvprev[aCoordIdx - 1])); + if (std::abs(uv[aCoordIdx - 1] - uvprev[aCoordIdx - 1]) > gp::Resolution()) + aScaleCoeff = std::abs((Uvap(aCoordIdx) - uv[aCoordIdx - 1]) + / (uv[aCoordIdx - 1] - uvprev[aCoordIdx - 1])); Standard_Integer aFixIdx = aCoordIdx == 1 ? 2 : 1; // Fixing index; Uvap(aFixIdx) = uv[aFixIdx - 1] + (uv[aFixIdx - 1] - uvprev[aFixIdx - 1]) * aScaleCoeff; @@ -2536,8 +2543,8 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult, else { // no numerical solution NotDone PasC = PasC / 2.; - PasCu = Abs(PasC * previousd2d.X()); - PasCv = Abs(PasC * previousd2d.Y()); + PasCu = std::abs(PasC * previousd2d.X()); + PasCv = std::abs(PasC * previousd2d.Y()); if (PasCu <= tolerance(1) && PasCv <= tolerance(2)) { @@ -2687,7 +2694,8 @@ IntWalk_StatusDeflection IntWalk_IWalking::TestDeflection( if (Cosi2 < CosRef3D) { // angle 3d too great Step = Step / 2.0; - Standard_Real StepU = Abs(Step * previousd2d.X()), StepV = Abs(Step * previousd2d.Y()); + Standard_Real StepU = std::abs(Step * previousd2d.X()), + StepV = std::abs(Step * previousd2d.Y()); if (StepU < tolerance(1) && StepV < tolerance(2)) aStatus = IntWalk_ArretSurPointPrecedent; else @@ -2696,16 +2704,16 @@ IntWalk_StatusDeflection IntWalk_IWalking::TestDeflection( } } - const Standard_Real aMinTolU = 0.1 * Abs(Step * previousd2d.X()), - aMinTolV = 0.1 * Abs(Step * previousd2d.Y()); - const Standard_Real aTolU = (aMinTolU > 0.0) ? Min(tolerance(1), aMinTolU) : tolerance(1), - aTolV = (aMinTolV > 0.0) ? Min(tolerance(2), aMinTolV) : tolerance(2); + const Standard_Real aMinTolU = 0.1 * std::abs(Step * previousd2d.X()), + aMinTolV = 0.1 * std::abs(Step * previousd2d.Y()); + const Standard_Real aTolU = (aMinTolU > 0.0) ? std::min(tolerance(1), aMinTolU) : tolerance(1), + aTolV = (aMinTolV > 0.0) ? std::min(tolerance(2), aMinTolV) : tolerance(2); - // If aMinTolU==0.0 then (Abs(Du) < aMinTolU) is equivalent of (Abs(Du) < 0.0). + // If aMinTolU==0.0 then (std::abs(Du) < aMinTolU) is equivalent of (std::abs(Du) < 0.0). // It is impossible. Therefore, this case should be processed separately. // Analogically for aMinTolV. - if ((Abs(Du) < aTolU) && (Abs(Dv) < aTolV)) + if ((std::abs(Du) < aTolU) && (std::abs(Dv) < aTolV)) { // Thin shapes (for which Ulast-Ufirst or/and Vlast-Vfirst is quite small) // exists (see bug #25820). In this case, step is quite small too. @@ -2734,7 +2742,8 @@ IntWalk_StatusDeflection IntWalk_IWalking::TestDeflection( if (Cosi2 < CosRef2D || Cosi < 0) { Step = Step / 2.0; - Standard_Real StepU = Abs(Step * previousd2d.X()), StepV = Abs(Step * previousd2d.Y()); + Standard_Real StepU = std::abs(Step * previousd2d.X()), + StepV = std::abs(Step * previousd2d.Y()); if (StepU < tolerance(1) && StepV < tolerance(2)) aStatus = IntWalk_ArretSurPointPrecedent; @@ -2749,7 +2758,8 @@ IntWalk_StatusDeflection IntWalk_IWalking::TestDeflection( if (Cosi2 < CosRef3D) { // angle 3d too great Step = Step / 2.; - Standard_Real StepU = Abs(Step * previousd2d.X()), StepV = Abs(Step * previousd2d.Y()); + Standard_Real StepU = std::abs(Step * previousd2d.X()), + StepV = std::abs(Step * previousd2d.Y()); if (StepU < tolerance(1) && StepV < tolerance(2)) aStatus = IntWalk_ArretSurPoint; else @@ -2762,7 +2772,8 @@ IntWalk_StatusDeflection IntWalk_IWalking::TestDeflection( { // angle 2d too great or change the side Step = Step / 2.; - Standard_Real StepU = Abs(Step * previousd2d.X()), StepV = Abs(Step * previousd2d.Y()); + Standard_Real StepU = std::abs(Step * previousd2d.X()), + StepV = std::abs(Step * previousd2d.Y()); if (StepU < tolerance(1) && StepV < tolerance(2)) aStatus = IntWalk_ArretSurPointPrecedent; else @@ -2775,11 +2786,11 @@ IntWalk_StatusDeflection IntWalk_IWalking::TestDeflection( { if (aStatus == IntWalk_PointConfondu) { - Standard_Real StepU = Min(Abs(1.5 * Du), pas * (UM - Um)), - StepV = Min(Abs(1.5 * Dv), pas * (VM - Vm)); + Standard_Real StepU = std::min(std::abs(1.5 * Du), pas * (UM - Um)), + StepV = std::min(std::abs(1.5 * Dv), pas * (VM - Vm)); - Standard_Real d2dx = Abs(previousd2d.X()); - Standard_Real d2dy = Abs(previousd2d.Y()); + Standard_Real d2dx = std::abs(previousd2d.X()); + Standard_Real d2dy = std::abs(previousd2d.Y()); if (d2dx < tolerance(1)) { @@ -2791,7 +2802,7 @@ IntWalk_StatusDeflection IntWalk_IWalking::TestDeflection( } else { - Step = Min(StepU / d2dx, StepV / d2dy); + Step = std::min(StepU / d2dx, StepV / d2dy); } } else @@ -2801,22 +2812,6 @@ IntWalk_StatusDeflection IntWalk_IWalking::TestDeflection( // is observed. // otherwise adjust the step depending on the previous step - /* - Standard_Real Dist = Sqrt(Norme)/3.; - TColgp_Array1OfPnt Poles(1,4); - gp_Pnt POnCurv,Milieu; - Poles(1) = previousPoint.Value(); - Poles(4) = sp.Point(); - Poles(2) = Poles(1).XYZ() + - StepSign * Dist* previousd3d.Normalized().XYZ(); - Poles(3) = Poles(4).XYZ() - - StepSign * Dist*sp.Direction3d().Normalized().XYZ(); - BzCLib::PntPole(0.5,Poles,POnCurv); - Milieu = (Poles(1).XYZ() + Poles(4).XYZ())*0.5; - // FlecheCourante = Milieu.Distance(POnCurv); - Standard_Real FlecheCourante = Milieu.SquareDistance(POnCurv); - */ - // Direct calculation : // POnCurv=(((p1+p2)/2.+(p2+p3)/2.)/2. + ((p2+p3)/2.+(p3+P4)/2.)/2.)/2. // either POnCurv = p1/8. + 3.p2/8. + 3.p3/8. + p4/8. @@ -2825,7 +2820,7 @@ IntWalk_StatusDeflection IntWalk_IWalking::TestDeflection( // Calculate the deviation with (p1+p4)/2. . So it is just necessary to calculate // the norm (square) of 3.*lambda (d1 - d4)/8. // either the norm of : - // 3.*(Sqrt(Norme)/3.)*StepSign*(d1-d4)/8. + // 3.*(std::sqrt(Norme)/3.)*StepSign*(d1-d4)/8. // which produces, taking the square : // Norme * (d1-d4).SquareMagnitude()/64. @@ -2836,11 +2831,11 @@ IntWalk_StatusDeflection IntWalk_IWalking::TestDeflection( // if (FlecheCourante <= 0.5*fleche) { if (FlecheCourante <= 0.25 * fleche * fleche) { - Standard_Real d2dx = Abs(sp.Direction2d().X()); - Standard_Real d2dy = Abs(sp.Direction2d().Y()); + Standard_Real d2dx = std::abs(sp.Direction2d().X()); + Standard_Real d2dy = std::abs(sp.Direction2d().Y()); - Standard_Real StepU = Min(Abs(1.5 * Du), pas * (UM - Um)), - StepV = Min(Abs(1.5 * Dv), pas * (VM - Vm)); + Standard_Real StepU = std::min(std::abs(1.5 * Du), pas * (UM - Um)), + StepV = std::min(std::abs(1.5 * Dv), pas * (VM - Vm)); if (d2dx < tolerance(1)) { @@ -2852,7 +2847,7 @@ IntWalk_StatusDeflection IntWalk_IWalking::TestDeflection( } else { - Step = Min(StepU / d2dx, StepV / d2dy); + Step = std::min(StepU / d2dx, StepV / d2dy); } } else @@ -2861,7 +2856,8 @@ IntWalk_StatusDeflection IntWalk_IWalking::TestDeflection( if (FlecheCourante > fleche * fleche) { // step too great Step = Step / 2.; - Standard_Real StepU = Abs(Step * previousd2d.X()), StepV = Abs(Step * previousd2d.Y()); + Standard_Real StepU = std::abs(Step * previousd2d.X()), + StepV = std::abs(Step * previousd2d.Y()); if (StepU < tolerance(1) && StepV < tolerance(2)) aStatus = IntWalk_ArretSurPointPrecedent; @@ -2870,23 +2866,23 @@ IntWalk_StatusDeflection IntWalk_IWalking::TestDeflection( } else { - Standard_Real d2dx = Abs(sp.Direction2d().X()); - Standard_Real d2dy = Abs(sp.Direction2d().Y()); + Standard_Real d2dx = std::abs(sp.Direction2d().X()); + Standard_Real d2dy = std::abs(sp.Direction2d().Y()); - Standard_Real StepU = Min(Abs(1.5 * Du), pas * (UM - Um)), - StepV = Min(Abs(1.5 * Dv), pas * (VM - Vm)); + Standard_Real StepU = std::min(std::abs(1.5 * Du), pas * (UM - Um)), + StepV = std::min(std::abs(1.5 * Dv), pas * (VM - Vm)); if (d2dx < tolerance(1)) { - Step = Min(Step, StepV / d2dy); + Step = std::min(Step, StepV / d2dy); } else if (d2dy < tolerance(2)) { - Step = Min(Step, StepU / d2dx); + Step = std::min(Step, StepU / d2dx); } else { - Step = Min(Step, Min(StepU / d2dx, StepV / d2dy)); + Step = std::min(Step, std::min(StepU / d2dx, StepV / d2dy)); } } } @@ -3026,11 +3022,12 @@ void IntWalk_IWalking::RemoveTwoEndPoints(const Standard_Integer IndOfPoint) Standard_Boolean IntWalk_IWalking::IsPointOnLine(const gp_Pnt2d& theP2d, const Standard_Integer Irang) { - const Handle(IntWalk_TheIWLine)& aLine = lines.Value(Abs(Irang)); + const Handle(IntWalk_TheIWLine)& aLine = lines.Value(std::abs(Irang)); for (Standard_Integer i = 1; i <= aLine->NbPoints(); i++) { gp_Pnt2d P2d1 = aLine->Value(i).ValueOnSurface(reversed); - if (Abs(P2d1.X() - theP2d.X()) <= tolerance(1) && Abs(P2d1.Y() - theP2d.Y()) <= tolerance(2)) + if (std::abs(P2d1.X() - theP2d.X()) <= tolerance(1) + && std::abs(P2d1.Y() - theP2d.Y()) <= tolerance(2)) return Standard_True; if (i < aLine->NbPoints()) { diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_PWalking.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_PWalking.cxx index 70f4bbcc30..13bb28a79f 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_PWalking.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_PWalking.cxx @@ -46,47 +46,47 @@ void IntWalk_PWalking::ComputePasInit(const Standard_Real theDeltaU1, const Handle(Adaptor3d_Surface)& Caro1 = myIntersectionOn2S.Function().AuxillarSurface1(); const Handle(Adaptor3d_Surface)& Caro2 = myIntersectionOn2S.Function().AuxillarSurface2(); - const Standard_Real aDeltaU1 = Abs(UM1 - Um1); - const Standard_Real aDeltaV1 = Abs(VM1 - Vm1); - const Standard_Real aDeltaU2 = Abs(UM2 - Um2); - const Standard_Real aDeltaV2 = Abs(VM2 - Vm2); + const Standard_Real aDeltaU1 = std::abs(UM1 - Um1); + const Standard_Real aDeltaV1 = std::abs(VM1 - Vm1); + const Standard_Real aDeltaU2 = std::abs(UM2 - Um2); + const Standard_Real aDeltaV2 = std::abs(VM2 - Vm2); //-- limit the reduction of uv box estimate to 0.01 natural box //-- theDeltaU1 : On box of Inter //-- aDeltaU1 : On parametric space if (!Precision::IsInfinite(aDeltaU1)) - pasuv[0] = Max(Increment * Max(theDeltaU1, aRangePart * aDeltaU1), pasuv[0]); + pasuv[0] = std::max(Increment * std::max(theDeltaU1, aRangePart * aDeltaU1), pasuv[0]); else - pasuv[0] = Max(Increment * theDeltaU1, pasuv[0]); + pasuv[0] = std::max(Increment * theDeltaU1, pasuv[0]); if (!Precision::IsInfinite(aDeltaV1)) - pasuv[1] = Max(Increment * Max(theDeltaV1, aRangePart * aDeltaV1), pasuv[1]); + pasuv[1] = std::max(Increment * std::max(theDeltaV1, aRangePart * aDeltaV1), pasuv[1]); else - pasuv[1] = Max(Increment * theDeltaV1, pasuv[1]); + pasuv[1] = std::max(Increment * theDeltaV1, pasuv[1]); if (!Precision::IsInfinite(aDeltaU2)) - pasuv[2] = Max(Increment * Max(theDeltaU2, aRangePart * aDeltaU2), pasuv[2]); + pasuv[2] = std::max(Increment * std::max(theDeltaU2, aRangePart * aDeltaU2), pasuv[2]); else - pasuv[2] = Max(Increment * theDeltaU2, pasuv[2]); + pasuv[2] = std::max(Increment * theDeltaU2, pasuv[2]); if (!Precision::IsInfinite(aDeltaV2)) - pasuv[3] = Max(Increment * Max(theDeltaV2, aRangePart * aDeltaV2), pasuv[3]); + pasuv[3] = std::max(Increment * std::max(theDeltaV2, aRangePart * aDeltaV2), pasuv[3]); else - pasuv[3] = Max(Increment * theDeltaV2, pasuv[3]); + pasuv[3] = std::max(Increment * theDeltaV2, pasuv[3]); const Standard_Real ResoU1tol = Adaptor3d_HSurfaceTool::UResolution(Caro1, tolconf); const Standard_Real ResoV1tol = Adaptor3d_HSurfaceTool::VResolution(Caro1, tolconf); const Standard_Real ResoU2tol = Adaptor3d_HSurfaceTool::UResolution(Caro2, tolconf); const Standard_Real ResoV2tol = Adaptor3d_HSurfaceTool::VResolution(Caro2, tolconf); - myStepMin[0] = Max(myStepMin[0], 2.0 * ResoU1tol); - myStepMin[1] = Max(myStepMin[1], 2.0 * ResoV1tol); - myStepMin[2] = Max(myStepMin[2], 2.0 * ResoU2tol); - myStepMin[3] = Max(myStepMin[3], 2.0 * ResoV2tol); + myStepMin[0] = std::max(myStepMin[0], 2.0 * ResoU1tol); + myStepMin[1] = std::max(myStepMin[1], 2.0 * ResoV1tol); + myStepMin[2] = std::max(myStepMin[2], 2.0 * ResoU2tol); + myStepMin[3] = std::max(myStepMin[3], 2.0 * ResoV2tol); for (Standard_Integer i = 0; i < 4; i++) { - pasuv[i] = Max(myStepMin[i], pasuv[i]); + pasuv[i] = std::max(myStepMin[i], pasuv[i]); } } @@ -233,8 +233,8 @@ IntWalk_PWalking::IntWalk_PWalking(const Handle(Adaptor3d_Surface)& Caro1, Standard_Real MAXVAL; Standard_Real MAXVAL2; // - MAXVAL = Abs(Um1); - MAXVAL2 = Abs(UM1); + MAXVAL = std::abs(Um1); + MAXVAL2 = std::abs(UM1); if (MAXVAL2 > MAXVAL) MAXVAL = MAXVAL2; NEWRESO = ResoU1 * MAXVAL; @@ -243,8 +243,8 @@ IntWalk_PWalking::IntWalk_PWalking(const Handle(Adaptor3d_Surface)& Caro1, ResoU1 = NEWRESO; } - MAXVAL = Abs(Um2); - MAXVAL2 = Abs(UM2); + MAXVAL = std::abs(Um2); + MAXVAL2 = std::abs(UM2); if (MAXVAL2 > MAXVAL) MAXVAL = MAXVAL2; NEWRESO = ResoU2 * MAXVAL; @@ -253,8 +253,8 @@ IntWalk_PWalking::IntWalk_PWalking(const Handle(Adaptor3d_Surface)& Caro1, ResoU2 = NEWRESO; } - MAXVAL = Abs(Vm1); - MAXVAL2 = Abs(VM1); + MAXVAL = std::abs(Vm1); + MAXVAL2 = std::abs(VM1); if (MAXVAL2 > MAXVAL) MAXVAL = MAXVAL2; NEWRESO = ResoV1 * MAXVAL; @@ -263,8 +263,8 @@ IntWalk_PWalking::IntWalk_PWalking(const Handle(Adaptor3d_Surface)& Caro1, ResoV1 = NEWRESO; } - MAXVAL = Abs(Vm2); - MAXVAL2 = Abs(VM2); + MAXVAL = std::abs(Vm2); + MAXVAL2 = std::abs(VM2); if (MAXVAL2 > MAXVAL) MAXVAL = MAXVAL2; NEWRESO = ResoV2 * MAXVAL; @@ -273,10 +273,10 @@ IntWalk_PWalking::IntWalk_PWalking(const Handle(Adaptor3d_Surface)& Caro1, ResoV2 = NEWRESO; } - pasuv[0] = pasMax * Abs(UM1 - Um1); - pasuv[1] = pasMax * Abs(VM1 - Vm1); - pasuv[2] = pasMax * Abs(UM2 - Um2); - pasuv[3] = pasMax * Abs(VM2 - Vm2); + pasuv[0] = pasMax * std::abs(UM1 - Um1); + pasuv[1] = pasMax * std::abs(VM1 - Vm1); + pasuv[2] = pasMax * std::abs(UM2 - Um2); + pasuv[3] = pasMax * std::abs(VM2 - Vm2); if (ResoU1 > 0.0001 * pasuv[0]) ResoU1 = 0.00001 * pasuv[0]; @@ -412,8 +412,8 @@ IntWalk_PWalking::IntWalk_PWalking(const Handle(Adaptor3d_Surface)& Caro1, // Standard_Real NEWRESO, MAXVAL, MAXVAL2; // - MAXVAL = Abs(Um1); - MAXVAL2 = Abs(UM1); + MAXVAL = std::abs(Um1); + MAXVAL2 = std::abs(UM1); if (MAXVAL2 > MAXVAL) { MAXVAL = MAXVAL2; @@ -424,8 +424,8 @@ IntWalk_PWalking::IntWalk_PWalking(const Handle(Adaptor3d_Surface)& Caro1, ResoU1 = NEWRESO; } // - MAXVAL = Abs(Um2); - MAXVAL2 = Abs(UM2); + MAXVAL = std::abs(Um2); + MAXVAL2 = std::abs(UM2); if (MAXVAL2 > MAXVAL) { MAXVAL = MAXVAL2; @@ -436,8 +436,8 @@ IntWalk_PWalking::IntWalk_PWalking(const Handle(Adaptor3d_Surface)& Caro1, ResoU2 = NEWRESO; } // - MAXVAL = Abs(Vm1); - MAXVAL2 = Abs(VM1); + MAXVAL = std::abs(Vm1); + MAXVAL2 = std::abs(VM1); if (MAXVAL2 > MAXVAL) { MAXVAL = MAXVAL2; @@ -448,8 +448,8 @@ IntWalk_PWalking::IntWalk_PWalking(const Handle(Adaptor3d_Surface)& Caro1, ResoV1 = NEWRESO; } // - MAXVAL = Abs(Vm2); - MAXVAL2 = Abs(VM2); + MAXVAL = std::abs(Vm2); + MAXVAL2 = std::abs(VM2); if (MAXVAL2 > MAXVAL) { MAXVAL = MAXVAL2; @@ -460,10 +460,10 @@ IntWalk_PWalking::IntWalk_PWalking(const Handle(Adaptor3d_Surface)& Caro1, ResoV2 = NEWRESO; } // - pasuv[0] = pasMax * Abs(UM1 - Um1); - pasuv[1] = pasMax * Abs(VM1 - Vm1); - pasuv[2] = pasMax * Abs(UM2 - Um2); - pasuv[3] = pasMax * Abs(VM2 - Vm2); + pasuv[0] = pasMax * std::abs(UM1 - Um1); + pasuv[1] = pasMax * std::abs(VM1 - Vm1); + pasuv[2] = pasMax * std::abs(UM2 - Um2); + pasuv[3] = pasMax * std::abs(VM2 - Vm2); // if (Adaptor3d_HSurfaceTool::IsUPeriodic(Caro1) == Standard_False) { @@ -847,16 +847,16 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep, switch (ChoixIso) { case IntImp_UIsoparametricOnCaro1: - f = Abs(previousd1.X()); + f = std::abs(previousd1.X()); break; case IntImp_VIsoparametricOnCaro1: - f = Abs(previousd1.Y()); + f = std::abs(previousd1.Y()); break; case IntImp_UIsoparametricOnCaro2: - f = Abs(previousd2.X()); + f = std::abs(previousd2.X()); break; case IntImp_VIsoparametricOnCaro2: - f = Abs(previousd2.Y()); + f = std::abs(previousd2.Y()); break; default: break; @@ -879,22 +879,22 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep, // aIncKey = 5. * (Standard_Real)IncKey; aEps = 1.e-7; - if (ChoixIso == IntImp_UIsoparametricOnCaro1 && Abs(dP1) < aEps) + if (ChoixIso == IntImp_UIsoparametricOnCaro1 && std::abs(dP1) < aEps) { dP1 *= aIncKey; } - if (ChoixIso == IntImp_VIsoparametricOnCaro1 && Abs(dP2) < aEps) + if (ChoixIso == IntImp_VIsoparametricOnCaro1 && std::abs(dP2) < aEps) { dP2 *= aIncKey; } - if (ChoixIso == IntImp_UIsoparametricOnCaro2 && Abs(dP3) < aEps) + if (ChoixIso == IntImp_UIsoparametricOnCaro2 && std::abs(dP3) < aEps) { dP3 *= aIncKey; } - if (ChoixIso == IntImp_VIsoparametricOnCaro2 && Abs(dP4) < aEps) + if (ChoixIso == IntImp_VIsoparametricOnCaro2 && std::abs(dP4) < aEps) { dP4 *= aIncKey; } @@ -933,9 +933,9 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep, for (Standard_Integer i = 0; i < 4; i++) { - if (Abs(aNewPnt[i] - aParMin[i]) < aTol[i]) + if (std::abs(aNewPnt[i] - aParMin[i]) < aTol[i]) aNewPnt[i] = aParMin[i]; - else if (Abs(aNewPnt[i] - aParMax[i]) < aTol[i]) + else if (std::abs(aNewPnt[i] - aParMax[i]) < aTol[i]) aNewPnt[i] = aParMax[i]; } @@ -948,10 +948,10 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep, myIntersectionOn2S.ChangePoint().SetValue(aNewPnt[0], aNewPnt[1], aNewPnt[2], aNewPnt[3]); - anAbsParamDist[0] = Abs(Param(1) - dP1 - aNewPnt[0]); - anAbsParamDist[1] = Abs(Param(2) - dP2 - aNewPnt[1]); - anAbsParamDist[2] = Abs(Param(3) - dP3 - aNewPnt[2]); - anAbsParamDist[3] = Abs(Param(4) - dP4 - aNewPnt[3]); + anAbsParamDist[0] = std::abs(Param(1) - dP1 - aNewPnt[0]); + anAbsParamDist[1] = std::abs(Param(2) - dP2 - aNewPnt[1]); + anAbsParamDist[2] = std::abs(Param(3) - dP3 - aNewPnt[2]); + anAbsParamDist[3] = std::abs(Param(4) - dP4 - aNewPnt[3]); if (anAbsParamDist[0] < ResoU1 && anAbsParamDist[1] < ResoV1 && anAbsParamDist[2] < ResoU2 && anAbsParamDist[3] < ResoV2 && aStatus != IntWalk_PasTropGrand) { @@ -1222,7 +1222,7 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep, for (Standard_Integer i = 0; i < 4; i++) { - const Standard_Real aNewStep = Min(1.5 * pasuv[i], pasInit[i]); + const Standard_Real aNewStep = std::min(1.5 * pasuv[i], pasInit[i]); if (aNewStep > pasuv[i]) { pasuv[i] = aNewStep; @@ -1586,7 +1586,7 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep, } else { - anAngleS1 = Abs(PrevToParamOnS1.Angle(PrevToCurOnS1)); + anAngleS1 = std::abs(PrevToParamOnS1.Angle(PrevToCurOnS1)); } if (aSQMCurS2 < gp::Resolution()) @@ -1604,7 +1604,7 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep, } else { - anAngleS2 = Abs(PrevToParamOnS2.Angle(PrevToCurOnS2)); + anAngleS2 = std::abs(PrevToParamOnS2.Angle(PrevToCurOnS2)); } if ((anAngleS1 > MaxAngle) && (anAngleS2 > MaxAngle)) @@ -1832,16 +1832,16 @@ Standard_Boolean IntWalk_PWalking::ExtendLineInCommonZone( switch (theChoixIso) { case IntImp_UIsoparametricOnCaro1: - f = Abs(previousd1.X()); + f = std::abs(previousd1.X()); break; case IntImp_VIsoparametricOnCaro1: - f = Abs(previousd1.Y()); + f = std::abs(previousd1.Y()); break; case IntImp_UIsoparametricOnCaro2: - f = Abs(previousd2.X()); + f = std::abs(previousd2.X()); break; case IntImp_VIsoparametricOnCaro2: - f = Abs(previousd2.Y()); + f = std::abs(previousd2.Y()); break; } @@ -1855,13 +1855,13 @@ Standard_Boolean IntWalk_PWalking::ExtendLineInCommonZone( Standard_Real dP3 = sensCheminement * pasuv[2] * previousd2.X() / f; Standard_Real dP4 = sensCheminement * pasuv[3] * previousd2.Y() / f; - if (theChoixIso == IntImp_UIsoparametricOnCaro1 && Abs(dP1) < 1.e-7) + if (theChoixIso == IntImp_UIsoparametricOnCaro1 && std::abs(dP1) < 1.e-7) dP1 *= (5. * (Standard_Real)dIncKey); - if (theChoixIso == IntImp_VIsoparametricOnCaro1 && Abs(dP2) < 1.e-7) + if (theChoixIso == IntImp_VIsoparametricOnCaro1 && std::abs(dP2) < 1.e-7) dP2 *= (5. * (Standard_Real)dIncKey); - if (theChoixIso == IntImp_UIsoparametricOnCaro2 && Abs(dP3) < 1.e-7) + if (theChoixIso == IntImp_UIsoparametricOnCaro2 && std::abs(dP3) < 1.e-7) dP3 *= (5. * (Standard_Real)dIncKey); - if (theChoixIso == IntImp_VIsoparametricOnCaro2 && Abs(dP4) < 1.e-7) + if (theChoixIso == IntImp_VIsoparametricOnCaro2 && std::abs(dP4) < 1.e-7) dP4 *= (5. * (Standard_Real)dIncKey); Param(1) += dP1; @@ -2277,10 +2277,10 @@ Standard_Boolean IntWalk_PWalking::DistanceMinimizeByGradient( // I.e. if theU1 = 0.0 then Epsilon(theU1) = DBL_MIN (~1.0e-308). // Work with this number is impossible: there is a dangerous to // obtain Floating-point-overflow. Therefore, we limit this value. - const Standard_Real aMinAddValU1 = Max(Epsilon(theInit(1)), aTolNul); - const Standard_Real aMinAddValV1 = Max(Epsilon(theInit(2)), aTolNul); - const Standard_Real aMinAddValU2 = Max(Epsilon(theInit(3)), aTolNul); - const Standard_Real aMinAddValV2 = Max(Epsilon(theInit(4)), aTolNul); + const Standard_Real aMinAddValU1 = std::max(Epsilon(theInit(1)), aTolNul); + const Standard_Real aMinAddValV1 = std::max(Epsilon(theInit(2)), aTolNul); + const Standard_Real aMinAddValU2 = std::max(Epsilon(theInit(3)), aTolNul); + const Standard_Real aMinAddValV2 = std::max(Epsilon(theInit(4)), aTolNul); Handle(Geom_Surface) aS1, aS2; @@ -2324,16 +2324,20 @@ Standard_Boolean IntWalk_PWalking::DistanceMinimizeByGradient( while (flRepeat) { Standard_Real anAdd = aGradFu * aStepU1; - const Standard_Real aPARu = theInit(1) - Sign(Max(Abs(anAdd), aMinAddValU1), anAdd); + const Standard_Real aPARu = + theInit(1) - std::copysign(std::max(std::abs(anAdd), aMinAddValU1), anAdd); - anAdd = aGradFv * aStepV1; - const Standard_Real aPARv = theInit(2) - Sign(Max(Abs(anAdd), aMinAddValV1), anAdd); + anAdd = aGradFv * aStepV1; + const Standard_Real aPARv = + theInit(2) - std::copysign(std::max(std::abs(anAdd), aMinAddValV1), anAdd); - anAdd = aGradFU * aStepU2; - const Standard_Real aParU = theInit(3) - Sign(Max(Abs(anAdd), aMinAddValU2), anAdd); + anAdd = aGradFU * aStepU2; + const Standard_Real aParU = + theInit(3) - std::copysign(std::max(std::abs(anAdd), aMinAddValU2), anAdd); - anAdd = aGradFV * aStepV2; - const Standard_Real aParV = theInit(4) - Sign(Max(Abs(anAdd), aMinAddValV2), anAdd); + anAdd = aGradFV * aStepV2; + const Standard_Real aParV = + theInit(4) - std::copysign(std::max(std::abs(anAdd), aMinAddValV2), anAdd); gp_Pnt aPt1, aPt2; @@ -2477,8 +2481,8 @@ Standard_Boolean IntWalk_PWalking::HandleSingleSingularPoint( for (Standard_Integer i = 1; i <= 4; ++i) { - if (Abs(thePnt(i) - aLowBorder[i - 1]) < Precision::PConfusion() - || Abs(thePnt(i) - aUppBorder[i - 1]) < Precision::PConfusion()) + if (std::abs(thePnt(i) - aLowBorder[i - 1]) < Precision::PConfusion() + || std::abs(thePnt(i) - aUppBorder[i - 1]) < Precision::PConfusion()) { anInt.Perform(thePnt, aRsnld, aLockedDir[i - 1]); @@ -2508,13 +2512,13 @@ Standard_Boolean IntWalk_PWalking::HandleSingleSingularPoint( if (aMod > Precision::Confusion()) { Standard_Real aTolU = the3DTol / aMod; - if (Abs(aLowBorder[iu] - aPars[iu]) < aTolU) + if (std::abs(aLowBorder[iu] - aPars[iu]) < aTolU) { aP = aSurfs[k]->Value(aLowBorder[iu], aPars[iv]); if (aPInt.SquareDistance(aP) < aTol2) aPars[iu] = aLowBorder[iu]; } - else if (Abs(aUppBorder[iu] - aPars[iu]) < aTolU) + else if (std::abs(aUppBorder[iu] - aPars[iu]) < aTolU) { aP = aSurfs[k]->Value(aUppBorder[iu], aPars[iv]); if (aPInt.SquareDistance(aP) < aTol2) @@ -2525,13 +2529,13 @@ Standard_Boolean IntWalk_PWalking::HandleSingleSingularPoint( if (aMod > Precision::Confusion()) { Standard_Real aTolV = the3DTol / aMod; - if (Abs(aLowBorder[iv] - aPars[iv]) < aTolV) + if (std::abs(aLowBorder[iv] - aPars[iv]) < aTolV) { aP = aSurfs[k]->Value(aPars[iu], aLowBorder[iv]); if (aPInt.SquareDistance(aP) < aTol2) aPars[iv] = aLowBorder[iv]; } - else if (Abs(aUppBorder[iv] - aPars[iv]) < aTolV) + else if (std::abs(aUppBorder[iv] - aPars[iv]) < aTolV) { aP = aSurfs[k]->Value(aPars[iu], aUppBorder[iv]); if (aPInt.SquareDistance(aP) < aTol2) @@ -2588,12 +2592,12 @@ Standard_Boolean IntWalk_PWalking::SeekPointOnBoundary(const Handle(Adaptor3d_Su theASurf2->LastVParameter()}; // Tune solution tolerance according with object size. - const Standard_Real aRes1 = Max(Precision::PConfusion() / theASurf1->UResolution(1.0), - Precision::PConfusion() / theASurf1->VResolution(1.0)); - const Standard_Real aRes2 = Max(Precision::PConfusion() / theASurf2->UResolution(1.0), - Precision::PConfusion() / theASurf2->VResolution(1.0)); - const Standard_Real a3DTol = Max(aRes1, aRes2); - const Standard_Real aTol = Max(Precision::Confusion(), a3DTol); + const Standard_Real aRes1 = std::max(Precision::PConfusion() / theASurf1->UResolution(1.0), + Precision::PConfusion() / theASurf1->VResolution(1.0)); + const Standard_Real aRes2 = std::max(Precision::PConfusion() / theASurf2->UResolution(1.0), + Precision::PConfusion() / theASurf2->VResolution(1.0)); + const Standard_Real a3DTol = std::max(aRes1, aRes2); + const Standard_Real aTol = std::max(Precision::Confusion(), a3DTol); // u1, v1, u2, v2 order is used. TColStd_Array1OfReal aPnt(1, 4); @@ -2808,10 +2812,10 @@ Standard_Boolean IntWalk_PWalking::PutToBoundary(const Handle(Adaptor3d_Surface) const Standard_Real aV2bLast = theASurf2->LastVParameter(); Standard_Real aTol = 1.0; - aTol = Min(aTol, aU1bLast - aU1bFirst); - aTol = Min(aTol, aU2bLast - aU2bFirst); - aTol = Min(aTol, aV1bLast - aV1bFirst); - aTol = Min(aTol, aV2bLast - aV2bFirst) * 1.0e-3; + aTol = std::min(aTol, aU1bLast - aU1bFirst); + aTol = std::min(aTol, aU2bLast - aU2bFirst); + aTol = std::min(aTol, aV1bLast - aV1bFirst); + aTol = std::min(aTol, aV2bLast - aV2bFirst) * 1.0e-3; if (aTol <= 2.0 * aTolMin) return hasBeenAdded; @@ -3160,10 +3164,10 @@ void IntWalk_PWalking::RepartirOuDiviser(Standard_Boolean& DejaReparti, { line->Value(nn).Parameters(u1, v1, u2, v2); line->Value(nn - 1).Parameters(U1, V1, U2, V2); - pasuv[0] = Abs(u1 - U1); - pasuv[1] = Abs(v1 - V1); - pasuv[2] = Abs(u2 - U2); - pasuv[3] = Abs(v2 - V2); + pasuv[0] = std::abs(u1 - U1); + pasuv[1] = std::abs(v1 - V1); + pasuv[2] = std::abs(u2 - U2); + pasuv[3] = std::abs(v2 - V2); } #endif } @@ -3210,10 +3214,10 @@ void IntWalk_PWalking::RepartirOuDiviser(Standard_Boolean& DejaReparti, { line->Value(nn).Parameters(u1, v1, u2, v2); line->Value(nn - 1).Parameters(U1, V1, U2, V2); - pasuv[0] = Abs(u1 - U1); - pasuv[1] = Abs(v1 - V1); - pasuv[2] = Abs(u2 - U2); - pasuv[3] = Abs(v2 - V2); + pasuv[0] = std::abs(u1 - U1); + pasuv[1] = std::abs(v1 - V1); + pasuv[2] = std::abs(u2 - U2); + pasuv[3] = std::abs(v2 - V2); } #endif } @@ -3233,7 +3237,7 @@ void IntWalk_PWalking::RepartirOuDiviser(Standard_Boolean& DejaReparti, namespace { // OCC431(apo): modified -> -static const Standard_Real CosRef2D = Cos(M_PI / 9.0), AngRef2D = M_PI / 2.0; +static const Standard_Real CosRef2D = std::cos(M_PI / 9.0), AngRef2D = M_PI / 2.0; static const Standard_Real d = 7.0; } // namespace @@ -3319,17 +3323,17 @@ IntWalk_StatusDeflection IntWalk_PWalking::TestDeflection(const IntImp_ConstIsop if (aSqDist < Precision::SquareConfusion()) { - pasInit[0] = Max(pasInit[0], 5.0 * ResoU1); - pasInit[1] = Max(pasInit[1], 5.0 * ResoV1); - pasInit[2] = Max(pasInit[2], 5.0 * ResoU2); - pasInit[3] = Max(pasInit[3], 5.0 * ResoV2); + pasInit[0] = std::max(pasInit[0], 5.0 * ResoU1); + pasInit[1] = std::max(pasInit[1], 5.0 * ResoV1); + pasInit[2] = std::max(pasInit[2], 5.0 * ResoU2); + pasInit[3] = std::max(pasInit[3], 5.0 * ResoV2); for (Standard_Integer i = 0; i < 4; i++) { - pasuv[i] = Max(pasuv[i], Min(1.5 * pasuv[i], pasInit[i])); + pasuv[i] = std::max(pasuv[i], std::min(1.5 * pasuv[i], pasInit[i])); } // Compute local resolution: for OCC26717 - if (Abs(pasuv[choixIso] - pasInit[choixIso]) <= Precision::Confusion()) + if (std::abs(pasuv[choixIso] - pasInit[choixIso]) <= Precision::Confusion()) { Standard_Real CurU, CurV; if (choixIso == IntImp_UIsoparametricOnCaro1 || choixIso == IntImp_VIsoparametricOnCaro1) @@ -3381,10 +3385,10 @@ IntWalk_StatusDeflection IntWalk_PWalking::TestDeflection(const IntImp_ConstIsop Du2 = Uc2 - Up2; Dv2 = Vc2 - Vp2; - AbsDu1 = Abs(Du1); - AbsDu2 = Abs(Du2); - AbsDv1 = Abs(Dv1); - AbsDv2 = Abs(Dv2); + AbsDu1 = std::abs(Du1); + AbsDu2 = std::abs(Du2); + AbsDv1 = std::abs(Dv1); + AbsDv2 = std::abs(Dv2); //================================================================================= //==== S t e p o f p r o g r e s s i o n (between previous and Current) ======= //================================================================================= @@ -3420,25 +3424,19 @@ IntWalk_StatusDeflection IntWalk_PWalking::TestDeflection(const IntImp_ConstIsop d1 = d; if (Duv1 > aMinDiv2) { - d1 = Abs(ResoUV1 / Duv1); - d1 = Min(Sqrt(d1) * tolArea, d); + d1 = std::abs(ResoUV1 / Duv1); + d1 = std::min(std::sqrt(d1) * tolArea, d); } - // d1 = Abs(ResoUV1/Duv1); - // d1 = Min(Sqrt(d1)*tolArea,d); - // modified by NIZNHY-PKV Wed Nov 13 12:34:30 2002 t - tolCoeff1 = Exp(d1); + tolCoeff1 = std::exp(d1); // // modified by NIZNHY-PKV Wed Nov 13 12:34:43 2002 f d2 = d; if (Duv2 > aMinDiv2) { - d2 = Abs(ResoUV2 / Duv2); - d2 = Min(Sqrt(d2) * tolArea, d); + d2 = std::abs(ResoUV2 / Duv2); + d2 = std::min(std::sqrt(d2) * tolArea, d); } - // d2 = Abs(ResoUV2/Duv2); - // d2 = Min(Sqrt(d2)*tolArea,d); - // modified by NIZNHY-PKV Wed Nov 13 12:34:53 2002 t - tolCoeff2 = Exp(d2); + tolCoeff2 = std::exp(d2); CosRef1 = CosRef2D / tolCoeff1; CosRef2 = CosRef2D / tolCoeff2; // @@ -3473,8 +3471,8 @@ IntWalk_StatusDeflection IntWalk_PWalking::TestDeflection(const IntImp_ConstIsop const gp_Dir2d& Tg2dcourante2 = myIntersectionOn2S.DirectionOnS2(); Cosi1 = Du1 * Tg2dcourante1.X() + Dv1 * Tg2dcourante1.Y(); Cosi2 = Du2 * Tg2dcourante2.X() + Dv2 * Tg2dcourante2.Y(); - Ang1 = Abs(previousd1.Angle(Tg2dcourante1)); - Ang2 = Abs(previousd2.Angle(Tg2dcourante2)); + Ang1 = std::abs(previousd1.Angle(Tg2dcourante1)); + Ang2 = std::abs(previousd2.Angle(Tg2dcourante2)); AngRef1 = AngRef2D * tolCoeff1; AngRef2 = AngRef2D * tolCoeff2; //------------------------------------------------------- @@ -3503,7 +3501,8 @@ IntWalk_StatusDeflection IntWalk_PWalking::TestDeflection(const IntImp_ConstIsop //--------------------------------------- //-- Estimate of the vector -- //--------------------------------------- - FlecheCourante = Sqrt(Abs((previousd.XYZ() - TgCourante.XYZ()).SquareModulus() * aSqDist)) / 8.; + FlecheCourante = + std::sqrt(std::abs((previousd.XYZ() - TgCourante.XYZ()).SquareModulus() * aSqDist)) / 8.; if (FlecheCourante <= fleche * 0.5) { //-- Current step too small @@ -3555,10 +3554,10 @@ IntWalk_StatusDeflection IntWalk_PWalking::TestDeflection(const IntImp_ConstIsop R = R1; if (Ratio > R) Ratio = R; - pasuv[0] = Min(Ratio * pasuv[0], pasInit[0]); - pasuv[1] = Min(Ratio * pasuv[1], pasInit[1]); - pasuv[2] = Min(Ratio * pasuv[2], pasInit[2]); - pasuv[3] = Min(Ratio * pasuv[3], pasInit[3]); + pasuv[0] = std::min(Ratio * pasuv[0], pasInit[0]); + pasuv[1] = std::min(Ratio * pasuv[1], pasInit[1]); + pasuv[2] = std::min(Ratio * pasuv[2], pasInit[2]); + pasuv[3] = std::min(Ratio * pasuv[3], pasInit[3]); if (pasuv[0] != pasSu1 || pasuv[2] != pasSu2 || pasuv[1] != pasSv1 || pasuv[3] != pasSv2) { if (++STATIC_BLOCAGE_SUR_PAS_TROP_GRAND > 5) @@ -3686,24 +3685,24 @@ IntWalk_StatusDeflection IntWalk_PWalking::TestDeflection(const IntImp_ConstIsop if (aStatus == IntWalk_StepTooSmall) { - pasuv[0] = Max(pasuv[0], AbsDu1); - pasuv[1] = Max(pasuv[1], AbsDv1); - pasuv[2] = Max(pasuv[2], AbsDu2); - pasuv[3] = Max(pasuv[3], AbsDv2); + pasuv[0] = std::max(pasuv[0], AbsDu1); + pasuv[1] = std::max(pasuv[1], AbsDv1); + pasuv[2] = std::max(pasuv[2], AbsDu2); + pasuv[3] = std::max(pasuv[3], AbsDv2); - pasInit[0] = Max(pasInit[0], AbsDu1); - pasInit[1] = Max(pasInit[1], AbsDv1); - pasInit[2] = Max(pasInit[2], AbsDu2); - pasInit[3] = Max(pasInit[3], AbsDv2); + pasInit[0] = std::max(pasInit[0], AbsDu1); + pasInit[1] = std::max(pasInit[1], AbsDv1); + pasInit[2] = std::max(pasInit[2], AbsDu2); + pasInit[3] = std::max(pasInit[3], AbsDv2); return aStatus; } } - pasuv[0] = Max(myStepMin[0], Min(Min(Ratio * AbsDu1, pasuv[0]), pasInit[0])); - pasuv[1] = Max(myStepMin[1], Min(Min(Ratio * AbsDv1, pasuv[1]), pasInit[1])); - pasuv[2] = Max(myStepMin[2], Min(Min(Ratio * AbsDu2, pasuv[2]), pasInit[2])); - pasuv[3] = Max(myStepMin[3], Min(Min(Ratio * AbsDv2, pasuv[3]), pasInit[3])); + pasuv[0] = std::max(myStepMin[0], std::min(std::min(Ratio * AbsDu1, pasuv[0]), pasInit[0])); + pasuv[1] = std::max(myStepMin[1], std::min(std::min(Ratio * AbsDv1, pasuv[1]), pasInit[1])); + pasuv[2] = std::max(myStepMin[2], std::min(std::min(Ratio * AbsDu2, pasuv[2]), pasInit[2])); + pasuv[3] = std::max(myStepMin[3], std::min(std::min(Ratio * AbsDv2, pasuv[3]), pasInit[3])); if (aStatus == IntWalk_OK) STATIC_BLOCAGE_SUR_PAS_TROP_GRAND = 0; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_PWalking.hxx b/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_PWalking.hxx index f37fb536c5..b0217e68de 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_PWalking.hxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_PWalking.hxx @@ -155,7 +155,7 @@ public: //! theIndex must be started with 1. void RemoveAPoint(const Standard_Integer theIndex) { - const Standard_Integer anIdx = Min(theIndex, line->NbPoints()); + const Standard_Integer anIdx = (std::min)(theIndex, line->NbPoints()); if (anIdx < 1) return; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_PWalking.lxx b/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_PWalking.lxx index fb46c08dbc..6f2af68ae9 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_PWalking.lxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntWalk/IntWalk_PWalking.lxx @@ -95,5 +95,5 @@ inline void IntWalk_PWalking::AddAPoint(const IntSurf_PntOn2S& POn2S) } #endif line->Add(POn2S); - myTangentIdx = Max(myTangentIdx, 1); + myTangentIdx = std::max(myTangentIdx, 1); } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_InterferencePolygon2d.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_InterferencePolygon2d.cxx index b56cea5819..a2b32fbcb0 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_InterferencePolygon2d.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_InterferencePolygon2d.cxx @@ -298,7 +298,7 @@ void Intf_InterferencePolygon2d::Intersect(const Standard_Integer iObje1, { if (SelfIntf) { - if (Abs(iObje1 - iObje2) <= 1) + if (std::abs(iObje1 - iObje2) <= 1) return; //-- Ajout du 15 jan 98 } @@ -310,10 +310,10 @@ void Intf_InterferencePolygon2d::Intersect(const Standard_Integer iObje1, gp_XY segO = EndO.XY() - BegO.XY(); // If the length of segment is zero, nothing is done - Standard_Real lgT = Sqrt(segT * segT); + Standard_Real lgT = std::sqrt(segT * segT); if (lgT <= 0.) return; - Standard_Real lgO = Sqrt(segO * segO); + Standard_Real lgO = std::sqrt(segO * segO); if (lgO <= 0.) return; @@ -333,7 +333,7 @@ void Intf_InterferencePolygon2d::Intersect(const Standard_Integer iObje1, Standard_Real dbOT = ((BegO.XY() - BegT.XY()) ^ segT) / lgT; Standard_Real dbObT = BegO.Distance(BegT); Standard_Real dbOeT = BegO.Distance(EndT); - if (Abs(dbOT) <= Tolerance) + if (std::abs(dbOT) <= Tolerance) { if (dbObT <= Tolerance) { @@ -365,7 +365,7 @@ void Intf_InterferencePolygon2d::Intersect(const Standard_Integer iObje1, Standard_Real deOT = ((EndO.XY() - BegT.XY()) ^ segT) / lgT; Standard_Real deObT = EndO.Distance(BegT); Standard_Real deOeT = EndO.Distance(EndT); - if (Abs(deOT) <= Tolerance) + if (std::abs(deOT) <= Tolerance) { if (deObT <= Tolerance) { @@ -401,7 +401,7 @@ void Intf_InterferencePolygon2d::Intersect(const Standard_Integer iObje1, // Interference Standard_Real dbTO = ((BegT.XY() - BegO.XY()) ^ segO) / lgO; - if (Abs(dbTO) <= Tolerance) + if (std::abs(dbTO) <= Tolerance) { if (dbObT > Tolerance && deObT > Tolerance && dbObT + deObT <= (lgO + Tolerance)) { @@ -415,7 +415,7 @@ void Intf_InterferencePolygon2d::Intersect(const Standard_Integer iObje1, // Interference Standard_Real deTO = ((EndT.XY() - BegO.XY()) ^ segO) / lgO; - if (Abs(deTO) <= Tolerance) + if (std::abs(deTO) <= Tolerance) { if (dbOeT > Tolerance && deOeT > Tolerance && dbOeT + deOeT <= (lgO + Tolerance)) { @@ -436,7 +436,7 @@ void Intf_InterferencePolygon2d::Intersect(const Standard_Integer iObje1, Standard_Boolean edgeSP = Standard_False; Standard_Real parOSP = 0, parTSP = 0; - if (Abs(dbOT - deOT) > floatgap && Abs(dbTO - deTO) > floatgap) + if (std::abs(dbOT - deOT) > floatgap && std::abs(dbTO - deTO) > floatgap) { parOSP = dbOT / (dbOT - deOT); parTSP = dbTO / (dbTO - deTO); @@ -541,10 +541,10 @@ void Intf_InterferencePolygon2d::Intersect(const Standard_Integer iObje1, Standard_Real parTmax = parT[1]; for (Standard_Integer i = 2; i <= nbpi; i++) { - parOmin = Min(parOmin, parO[i]); - parOmax = Max(parOmax, parO[i]); - parTmin = Min(parTmin, parT[i]); - parTmax = Max(parTmax, parT[i]); + parOmin = std::min(parOmin, parO[i]); + parOmax = std::max(parOmax, parO[i]); + parTmin = std::min(parTmin, parT[i]); + parTmax = std::max(parTmax, parT[i]); } Standard_Real delta; @@ -596,8 +596,8 @@ void Intf_InterferencePolygon2d::Intersect(const Standard_Integer iObje1, || (sigPS < 0. && parTdeb > parTmax && parTmax < 1.)) { nbpi++; - parO[nbpi] = Max(0., Min(1., parOdeb)); - parT[nbpi] = Max(0., Min(1., parTdeb)); + parO[nbpi] = std::max(0., std::min(1., parOdeb)); + parT[nbpi] = std::max(0., std::min(1., parTdeb)); x = BegO.X() + (segO.X() * parO[nbpi]); y = BegO.Y() + (segO.Y() * parO[nbpi]); thePi.Append(Intf_SectionPoint(gp_Pnt2d(x, y), @@ -615,8 +615,8 @@ void Intf_InterferencePolygon2d::Intersect(const Standard_Integer iObje1, || (sigPS > 0. && parTfin > parTmax && parTmax < 1.)) { nbpi++; - parO[nbpi] = Min(1., Max(0., parOfin)); - parT[nbpi] = Min(1., Max(0., parTfin)); + parO[nbpi] = std::min(1., std::max(0., parOfin)); + parT[nbpi] = std::min(1., std::max(0., parTfin)); x = BegO.X() + (segO.X() * parO[nbpi]); y = BegO.Y() + (segO.Y() * parO[nbpi]); thePi.Append(Intf_SectionPoint(gp_Pnt2d(x, y), diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_InterferencePolygonPolyhedron.gxx b/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_InterferencePolygonPolyhedron.gxx index 54c40d05f0..e0a3b1ad0a 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_InterferencePolygonPolyhedron.gxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_InterferencePolygonPolyhedron.gxx @@ -922,8 +922,8 @@ void Intf_InterferencePolygonPolyhedron::Intersect(const gp_Pnt& BegO, iLin, param, Intf_EDGE, - Min(pTri[sEdge], pTri[Pourcent3[sEdge + 1]]), - Max(pTri[sEdge], pTri[Pourcent3[sEdge + 1]]), + std::min(pTri[sEdge], pTri[Pourcent3[sEdge + 1]]), + std::max(pTri[sEdge], pTri[Pourcent3[sEdge + 1]]), 0., 1.); mySPoins.Append(SP); @@ -986,7 +986,7 @@ void Intf_InterferencePolygonPolyhedron::Intersect(const gp_Pnt& BegO, //-- //-- printf("\nIntf_InterferencePolygPolyh : dBegTri=%g dEndTri=%g // Tolerance=%g\n",dBegTri,dEndTri,Tolerance); - // if(Abs(dBegTri) <= Tolerance || Abs(dEndTri) <= Tolerance) + // if(std::abs(dBegTri) <= Tolerance || std::abs(dEndTri) <= Tolerance) { gp_Vec VecPol(BegO, EndO); Standard_Real NVecPol = VecPol.Magnitude(); @@ -1233,8 +1233,8 @@ void Intf_InterferencePolygonPolyhedron::Intersect(const gp_Pnt& BegO, iLin, param, Intf_EDGE, - Min(pTri[sEdge], pTri[Pourcent3[sEdge + 1]]), - Max(pTri[sEdge], pTri[Pourcent3[sEdge + 1]]), + std::min(pTri[sEdge], pTri[Pourcent3[sEdge + 1]]), + std::max(pTri[sEdge], pTri[Pourcent3[sEdge + 1]]), 0., 1.); mySPoins.Append(SP); @@ -1297,7 +1297,7 @@ void Intf_InterferencePolygonPolyhedron::Intersect(const gp_Pnt& BegO, //-- //-- printf("\nIntf_InterferencePolygPolyh : dBegTri=%g dEndTri=%g // Tolerance=%g\n",dBegTri,dEndTri,Tolerance); - // if (Abs(dBegTri) <= Tolerance || Abs(dEndTri) <= Tolerance) + // if (std::abs(dBegTri) <= Tolerance || std::abs(dEndTri) <= Tolerance) { gp_Vec VecPol(BegO, EndO); Standard_Real NVecPol = VecPol.Magnitude(); diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_TangentZone.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_TangentZone.cxx index 37451b11b5..324b0599e9 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_TangentZone.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_TangentZone.cxx @@ -242,9 +242,9 @@ void Intf_TangentZone::InfoFirst(Standard_Integer& segMin, Standard_Real& paraMax) const { ParamOnFirst(paraMin, paraMax); - segMin = (Standard_Integer)(IntegerPart(paraMin)); + segMin = (Standard_Integer)(std::trunc(paraMin)); paraMin = paraMin - (Standard_Real)segMin; - segMax = (Standard_Integer)(IntegerPart(paraMax)); + segMax = (Standard_Integer)(std::trunc(paraMax)); paraMax = paraMax - (Standard_Real)segMax; } @@ -256,9 +256,9 @@ void Intf_TangentZone::InfoSecond(Standard_Integer& segMin, Standard_Real& paraMax) const { ParamOnSecond(paraMin, paraMax); - segMin = (Standard_Integer)(IntegerPart(paraMin)); + segMin = (Standard_Integer)(std::trunc(paraMin)); paraMin = paraMin - (Standard_Real)segMin; - segMax = (Standard_Integer)(IntegerPart(paraMax)); + segMax = (Standard_Integer)(std::trunc(paraMax)); paraMax = paraMax - (Standard_Real)segMax; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_Tool.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_Tool.cxx index 8501d74707..302f47e3ae 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_Tool.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Intf/Intf_Tool.cxx @@ -112,12 +112,12 @@ void Intf_Tool::Lin2dBox(const gp_Lin2d& L2d, const Bnd_Box2d& domain, Bnd_Box2d parcur = -Precision::Infinite(); else parcur = (ymin - L2d.Location().XY().Y()) / L2d.Direction().XY().Y(); - parmin = Max(parmin, parcur); + parmin = std::max(parmin, parcur); if (domain.IsOpenYmax()) parcur = Precision::Infinite(); else parcur = (ymax - L2d.Location().XY().Y()) / L2d.Direction().XY().Y(); - parmax = Min(parmax, parcur); + parmax = std::min(parmax, parcur); yToSet = Standard_True; } else if (L2d.Direction().XY().Y() < 0.) @@ -126,12 +126,12 @@ void Intf_Tool::Lin2dBox(const gp_Lin2d& L2d, const Bnd_Box2d& domain, Bnd_Box2d parcur = -Precision::Infinite(); else parcur = (ymax - L2d.Location().XY().Y()) / L2d.Direction().XY().Y(); - parmin = Max(parmin, parcur); + parmin = std::max(parmin, parcur); if (domain.IsOpenYmin()) parcur = Precision::Infinite(); else parcur = (ymin - L2d.Location().XY().Y()) / L2d.Direction().XY().Y(); - parmax = Min(parmax, parcur); + parmax = std::min(parmax, parcur); yToSet = Standard_True; } else @@ -151,16 +151,16 @@ void Intf_Tool::Lin2dBox(const gp_Lin2d& L2d, const Bnd_Box2d& domain, Bnd_Box2d { par1 = L2d.Location().XY().X() + parmin * L2d.Direction().XY().X(); par2 = L2d.Location().XY().X() + parmax * L2d.Direction().XY().X(); - Xmin = Min(par1, par2); - Xmax = Max(par1, par2); + Xmin = std::min(par1, par2); + Xmax = std::max(par1, par2); } if (yToSet) { par1 = L2d.Location().XY().Y() + parmin * L2d.Direction().XY().Y(); par2 = L2d.Location().XY().Y() + parmax * L2d.Direction().XY().Y(); - Ymin = Min(par1, par2); - Ymax = Max(par1, par2); + Ymin = std::min(par1, par2); + Ymax = std::max(par1, par2); } boxLin.Update(Xmin, Ymin, Xmax, Ymax); @@ -194,10 +194,10 @@ void Intf_Tool::Hypr2dBox(const gp_Hypr2d& theHypr2d, const Bnd_Box2d& domain, B Standard_Integer npi; for (npi = 0; npi < nbPi; npi++) { - Xmin = Min(Xmin, xint[npi]); - Xmax = Max(Xmax, xint[npi]); - Ymin = Min(Ymin, yint[npi]); - Ymax = Max(Ymax, yint[npi]); + Xmin = std::min(Xmin, xint[npi]); + Xmax = std::max(Xmax, xint[npi]); + Ymin = std::min(Ymin, yint[npi]); + Ymax = std::max(Ymax, yint[npi]); } boxHypr2d.Update(Xmin, Ymin, Xmax, Ymax); @@ -243,7 +243,7 @@ void Intf_Tool::Hypr2dBox(const gp_Hypr2d& theHypr2d, const Bnd_Box2d& domain, B sinan = gp_XY(0., 1.) ^ Tan.XY(); break; } - if (Abs(sinan) > Precision::Angular()) + if (std::abs(sinan) > Precision::Angular()) { if (sinan > 0.) { @@ -283,7 +283,7 @@ void Intf_Tool::Hypr2dBox(const gp_Hypr2d& theHypr2d, const Bnd_Box2d& domain, B for (ip = ipmin; ip <= ipmax; ip += pas) { boxHypr2d.Add(ElCLib::Value(Standard_Real(ip) / 10., theHypr2d)); - if (Abs(ip) <= 10) + if (std::abs(ip) <= 10) pas = 1; else pas = 10; @@ -435,10 +435,10 @@ void Intf_Tool::Parab2dBox(const gp_Parab2d& theParab2d, Standard_Integer npi; for (npi = 0; npi < nbPi; npi++) { - Xmin = Min(Xmin, xint[npi]); - Xmax = Max(Xmax, xint[npi]); - Ymin = Min(Ymin, yint[npi]); - Ymax = Max(Ymax, yint[npi]); + Xmin = std::min(Xmin, xint[npi]); + Xmax = std::max(Xmax, xint[npi]); + Ymin = std::min(Ymin, yint[npi]); + Ymax = std::max(Ymax, yint[npi]); } boxParab2d.Update(Xmin, Ymin, Xmax, Ymax); @@ -484,7 +484,7 @@ void Intf_Tool::Parab2dBox(const gp_Parab2d& theParab2d, sinan = gp_XY(0., 1.) ^ Tan.XY(); break; } - if (Abs(sinan) > Precision::Angular()) + if (std::abs(sinan) > Precision::Angular()) { if (sinan > 0.) { @@ -524,7 +524,7 @@ void Intf_Tool::Parab2dBox(const gp_Parab2d& theParab2d, for (ip = ipmin; ip <= ipmax; ip += pas) { boxParab2d.Add(ElCLib::Value(Standard_Real(ip) / 10., theParab2d)); - if (Abs(ip) <= 10) + if (std::abs(ip) <= 10) pas = 1; else pas = 10; @@ -712,12 +712,12 @@ void Intf_Tool::LinBox(const gp_Lin& L, const Bnd_Box& domain, Bnd_Box& boxLin) parcur = -Precision::Infinite(); else parcur = (ymin - L.Location().XYZ().Y()) / L.Direction().XYZ().Y(); - parmin = Max(parmin, parcur); + parmin = std::max(parmin, parcur); if (domain.IsOpenYmax()) parcur = Precision::Infinite(); else parcur = (ymax - L.Location().XYZ().Y()) / L.Direction().XYZ().Y(); - parmax = Min(parmax, parcur); + parmax = std::min(parmax, parcur); yToSet = Standard_True; } else if (L.Direction().XYZ().Y() < 0.) @@ -726,12 +726,12 @@ void Intf_Tool::LinBox(const gp_Lin& L, const Bnd_Box& domain, Bnd_Box& boxLin) parcur = -Precision::Infinite(); else parcur = (ymax - L.Location().XYZ().Y()) / L.Direction().XYZ().Y(); - parmin = Max(parmin, parcur); + parmin = std::max(parmin, parcur); if (domain.IsOpenYmin()) parcur = Precision::Infinite(); else parcur = (ymin - L.Location().XYZ().Y()) / L.Direction().XYZ().Y(); - parmax = Min(parmax, parcur); + parmax = std::min(parmax, parcur); yToSet = Standard_True; } else @@ -749,12 +749,12 @@ void Intf_Tool::LinBox(const gp_Lin& L, const Bnd_Box& domain, Bnd_Box& boxLin) parcur = -Precision::Infinite(); else parcur = (zmin - L.Location().XYZ().Z()) / L.Direction().XYZ().Z(); - parmin = Max(parmin, parcur); + parmin = std::max(parmin, parcur); if (domain.IsOpenZmax()) parcur = Precision::Infinite(); else parcur = (zmax - L.Location().XYZ().Z()) / L.Direction().XYZ().Z(); - parmax = Min(parmax, parcur); + parmax = std::min(parmax, parcur); zToSet = Standard_True; } else if (L.Direction().XYZ().Z() < 0.) @@ -763,12 +763,12 @@ void Intf_Tool::LinBox(const gp_Lin& L, const Bnd_Box& domain, Bnd_Box& boxLin) parcur = -Precision::Infinite(); else parcur = (zmax - L.Location().XYZ().Z()) / L.Direction().XYZ().Z(); - parmin = Max(parmin, parcur); + parmin = std::max(parmin, parcur); if (domain.IsOpenZmin()) parcur = Precision::Infinite(); else parcur = (zmin - L.Location().XYZ().Z()) / L.Direction().XYZ().Z(); - parmax = Min(parmax, parcur); + parmax = std::min(parmax, parcur); zToSet = Standard_True; } else @@ -788,24 +788,24 @@ void Intf_Tool::LinBox(const gp_Lin& L, const Bnd_Box& domain, Bnd_Box& boxLin) { par1 = L.Location().XYZ().X() + parmin * L.Direction().XYZ().X(); par2 = L.Location().XYZ().X() + parmax * L.Direction().XYZ().X(); - Xmin = Min(par1, par2); - Xmax = Max(par1, par2); + Xmin = std::min(par1, par2); + Xmax = std::max(par1, par2); } if (yToSet) { par1 = L.Location().XYZ().Y() + parmin * L.Direction().XYZ().Y(); par2 = L.Location().XYZ().Y() + parmax * L.Direction().XYZ().Y(); - Ymin = Min(par1, par2); - Ymax = Max(par1, par2); + Ymin = std::min(par1, par2); + Ymax = std::max(par1, par2); } if (zToSet) { par1 = L.Location().XYZ().Z() + parmin * L.Direction().XYZ().Z(); par2 = L.Location().XYZ().Z() + parmax * L.Direction().XYZ().Z(); - Zmin = Min(par1, par2); - Zmax = Max(par1, par2); + Zmin = std::min(par1, par2); + Zmax = std::max(par1, par2); } boxLin.Update(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); @@ -845,12 +845,12 @@ void Intf_Tool::HyprBox(const gp_Hypr& theHypr, const Bnd_Box& domain, Bnd_Box& // for (npi = 0; npi < nbPi; npi++) { - Xmin = Min(Xmin, xint[npi]); - Xmax = Max(Xmax, xint[npi]); - Ymin = Min(Ymin, yint[npi]); - Ymax = Max(Ymax, yint[npi]); - Zmin = Min(Zmin, zint[npi]); - Zmax = Max(Zmax, yint[npi]); + Xmin = std::min(Xmin, xint[npi]); + Xmax = std::max(Xmax, xint[npi]); + Ymin = std::min(Ymin, yint[npi]); + Ymax = std::max(Ymax, yint[npi]); + Zmin = std::min(Zmin, zint[npi]); + Zmax = std::max(Zmax, yint[npi]); } boxHypr.Update(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); // @@ -883,7 +883,7 @@ void Intf_Tool::HyprBox(const gp_Hypr& theHypr, const Bnd_Box& domain, Bnd_Box& sinan = gp_XYZ(0., 0., -1.) * Tan.XYZ(); break; } - if (Abs(sinan) > Precision::Angular()) + if (std::abs(sinan) > Precision::Angular()) { if (sinan > 0.) { @@ -943,7 +943,7 @@ void Intf_Tool::HyprBox(const gp_Hypr& theHypr, const Bnd_Box& domain, Bnd_Box& for (ip=ipmin; ip<=ipmax; ip+=pas) { boxHypr.Add(ElCLib::Value(Standard_Real(ip)/10., theHypr)); - if (Abs(ip)<=10) { + if (std::abs(ip)<=10) { pas=1; } else { @@ -1361,12 +1361,12 @@ void Intf_Tool::ParabBox(const gp_Parab& theParab, const Bnd_Box& domain, Bnd_Bo for (npi = 0; npi < nbPi; npi++) { - Xmin = Min(Xmin, xint[npi]); - Xmax = Max(Xmax, xint[npi]); - Ymin = Min(Ymin, yint[npi]); - Ymax = Max(Ymax, yint[npi]); - Zmin = Min(Zmin, zint[npi]); - Zmax = Max(Zmax, yint[npi]); + Xmin = std::min(Xmin, xint[npi]); + Xmax = std::max(Xmax, xint[npi]); + Ymin = std::min(Ymin, yint[npi]); + Ymax = std::max(Ymax, yint[npi]); + Zmin = std::min(Zmin, zint[npi]); + Zmax = std::max(Zmax, yint[npi]); } boxParab.Update(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); @@ -1400,7 +1400,7 @@ void Intf_Tool::ParabBox(const gp_Parab& theParab, const Bnd_Box& domain, Bnd_Bo sinan = gp_XYZ(0., 0., -1.) * Tan.XYZ(); break; } - if (Abs(sinan) > Precision::Angular()) + if (std::abs(sinan) > Precision::Angular()) { if (sinan > 0.) { @@ -1436,7 +1436,7 @@ void Intf_Tool::ParabBox(const gp_Parab& theParab, const Bnd_Box& domain, Bnd_Bo for (ip = ipmin; ip <= ipmax; ip += pas) { boxParab.Add(ElCLib::Value(Standard_Real(ip) / 10., theParab)); - if (Abs(ip) <= 10) + if (std::abs(ip) <= 10) pas = 1; else pas = 10; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Law/Law_BSpFunc.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Law/Law_BSpFunc.cxx index 5316798b34..9ef3bfadfa 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Law/Law_BSpFunc.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Law/Law_BSpFunc.cxx @@ -118,7 +118,7 @@ Standard_Integer Law_BSpFunc::NbIntervals(const GeomAbs_Shape S) const Nb, Index2, newLast); - if (Abs(newFirst - TK(Index1 + 1)) < Precision::PConfusion()) + if (std::abs(newFirst - TK(Index1 + 1)) < Precision::PConfusion()) Index1++; if (newLast - TK(Index2) > Precision::PConfusion()) Index2++; @@ -198,7 +198,7 @@ void Law_BSpFunc::Intervals(TColStd_Array1OfReal& T, const GeomAbs_Shape S) cons Nb, Index2, newLast); - if (Abs(newFirst - TK(Index1 + 1)) < Precision::PConfusion()) + if (std::abs(newFirst - TK(Index1 + 1)) < Precision::PConfusion()) Index1++; if (newLast - TK(Index2) > Precision::PConfusion()) Index2++; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Law/Law_BSpline.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Law/Law_BSpline.cxx index b18280eb68..337d3ecd5b 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Law/Law_BSpline.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Law/Law_BSpline.cxx @@ -95,7 +95,7 @@ static void CheckCurveData(const TColStd_Array1OfReal& CPoles, for (Standard_Integer I = CKnots.Lower(); I < CKnots.Upper(); I++) { - if (CKnots(I + 1) - CKnots(I) <= Epsilon(Abs(CKnots(I)))) + if (CKnots(I + 1) - CKnots(I) <= Epsilon(std::abs(CKnots(I)))) { throw Standard_ConstructionError(); } @@ -158,7 +158,7 @@ static void KnotAnalysis(const Standard_Integer Degree, for (Standard_Integer i = FirstKM + 1; i < LastKM; i++) { Multi = CMults(i); - MaxKnotMult = Max(MaxKnotMult, Multi); + MaxKnotMult = std::max(MaxKnotMult, Multi); } } } @@ -174,7 +174,7 @@ static Standard_Boolean Rational(const TColStd_Array1OfReal& W) Standard_Boolean rat = Standard_False; for (i = 1; i < n; i++) { - rat = Abs(W(i) - W(i + 1)) > gp::Resolution(); + rat = std::abs(W(i) - W(i + 1)) > gp::Resolution(); if (rat) break; } @@ -675,7 +675,7 @@ void Law_BSpline::InsertPoleAfter // insert the weight Handle(TColStd_HArray1OfReal) nweights; - Standard_Boolean rat = IsRational() || Abs(Weight-1.) > gp::Resolution(); + Standard_Boolean rat = IsRational() || std::abs(Weight-1.) > gp::Resolution(); if (rat) { nweights = new TColStd_HArray1OfReal(1,nbpoles+1); @@ -812,7 +812,7 @@ Standard_Real Law_BSpline::ReversedParameter(const Standard_Real U) const void Law_BSpline::Segment(const Standard_Real U1, const Standard_Real U2) { Standard_DomainError_Raise_if(U2 < U1, "Law_BSpline::Segment"); - Standard_Real Eps = Epsilon(Max(Abs(U1), Abs(U2))); + Standard_Real Eps = Epsilon(std::max(std::abs(U1), std::abs(U2))); Standard_Real delta = U2 - U1; Standard_Real NewU1, NewU2; @@ -842,8 +842,8 @@ void Law_BSpline::Segment(const Standard_Real U1, const Standard_Real U2) knots->Upper(), index, NewU2); - Knots(1) = Min(NewU1, NewU2); - Knots(2) = Max(NewU1, NewU2); + Knots(1) = std::min(NewU1, NewU2); + Knots(2) = std::max(NewU1, NewU2); Mults(1) = Mults(2) = deg; InsertKnots(Knots, Mults, Eps); @@ -859,7 +859,7 @@ void Law_BSpline::Segment(const Standard_Real U1, const Standard_Real U2) knots->Upper(), index0, U); - if (Abs(knots->Value(index0 + 1) - U) < Eps) + if (std::abs(knots->Value(index0 + 1) - U) < Eps) index0++; SetOrigin(index0); SetNotPeriodic(); @@ -887,7 +887,7 @@ void Law_BSpline::Segment(const Standard_Real U1, const Standard_Real U2) ToU2, index2, U); - if (Abs(knots->Value(index2 + 1) - U) < Eps) + if (std::abs(knots->Value(index2 + 1) - U) < Eps) index2++; Standard_Integer nbknots = index2 - index1 + 1; @@ -910,7 +910,7 @@ void Law_BSpline::Segment(const Standard_Real U1, const Standard_Real U2) Standard_Integer pindex2 = BSplCLib::PoleIndex(deg, index2, periodic, mults->Array1()); pindex1++; - pindex2 = Min(pindex2 + 1, poles->Length()); + pindex2 = std::min(pindex2 + 1, poles->Length()); Standard_Integer nbpoles = pindex2 - pindex1 + 1; @@ -952,7 +952,7 @@ void Law_BSpline::SetKnot(const Standard_Integer Index, const Standard_Real K) { if (Index < 1 || Index > knots->Length()) throw Standard_OutOfRange(); - Standard_Real DK = Abs(Epsilon(K)); + Standard_Real DK = std::abs(Epsilon(K)); if (Index == 1) { if (K >= knots->Value(2) - DK) @@ -1012,7 +1012,7 @@ void Law_BSpline::SetPeriodic() Handle(TColStd_HArray1OfInteger) tm = mults; TColStd_Array1OfInteger cmults((mults->Array1())(first), first, last); - cmults(first) = cmults(last) = Max(cmults(first), cmults(last)); + cmults(first) = cmults(last) = std::max(cmults(first), cmults(last)); mults = new TColStd_HArray1OfInteger(1, cmults.Length()); mults->ChangeArray1() = cmults; @@ -1209,7 +1209,7 @@ void Law_BSpline::SetWeight(const Standard_Integer Index, const Standard_Real W) if (W <= gp::Resolution()) throw Standard_ConstructionError(); - Standard_Boolean rat = IsRational() || (Abs(W - 1.) > gp::Resolution()); + Standard_Boolean rat = IsRational() || (std::abs(W - 1.) > gp::Resolution()); if (rat) { @@ -1338,7 +1338,7 @@ Standard_Boolean Law_BSpline::IsCN(const Standard_Integer N) const Standard_Boolean Law_BSpline::IsClosed() const { - return (Abs(StartPoint() - EndPoint())) <= gp::Resolution(); + return (std::abs(StartPoint() - EndPoint())) <= gp::Resolution(); } //================================================================================================= @@ -1794,20 +1794,20 @@ void Law_BSpline::LocateU(const Standard_Real U, const TColStd_Array1OfReal& CKnots = TheKnots->Array1(); Standard_Real UFirst = CKnots(1); Standard_Real ULast = CKnots(CKnots.Length()); - if (Abs(U - UFirst) <= Abs(ParametricTolerance)) + if (std::abs(U - UFirst) <= std::abs(ParametricTolerance)) { I1 = I2 = 1; } - else if (Abs(U - ULast) <= Abs(ParametricTolerance)) + else if (std::abs(U - ULast) <= std::abs(ParametricTolerance)) { I1 = I2 = CKnots.Length(); } - else if (NewU < UFirst - Abs(ParametricTolerance)) + else if (NewU < UFirst - std::abs(ParametricTolerance)) { I2 = 1; I1 = 0; } - else if (NewU > ULast + Abs(ParametricTolerance)) + else if (NewU > ULast + std::abs(ParametricTolerance)) { I1 = CKnots.Length(); I2 = I1 + 1; @@ -1816,12 +1816,13 @@ void Law_BSpline::LocateU(const Standard_Real U, { I1 = 1; BSplCLib::Hunt(CKnots, NewU, I1); - I1 = Max(Min(I1, CKnots.Upper()), CKnots.Lower()); - while (I1 + 1 <= CKnots.Upper() && Abs(CKnots(I1 + 1) - NewU) <= Abs(ParametricTolerance)) + I1 = std::max(std::min(I1, CKnots.Upper()), CKnots.Lower()); + while (I1 + 1 <= CKnots.Upper() + && std::abs(CKnots(I1 + 1) - NewU) <= std::abs(ParametricTolerance)) { I1++; } - if (Abs(CKnots(I1) - NewU) <= Abs(ParametricTolerance)) + if (std::abs(CKnots(I1) - NewU) <= std::abs(ParametricTolerance)) { I2 = I1; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Law/Law_BSpline.hxx b/src/ModelingAlgorithms/TKGeomAlgo/Law/Law_BSpline.hxx index 0adc9ddfb6..22a2eeea1f 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Law/Law_BSpline.hxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Law/Law_BSpline.hxx @@ -479,8 +479,8 @@ public: //! Knots (I1) <= U <= Knots (I2) //! . if I1 = I2 U is a knot value (the tolerance criterion //! ParametricTolerance is used). - //! . if I1 < 1 => U < Knots (1) - Abs(ParametricTolerance) - //! . if I2 > NbKnots => U > Knots (NbKnots) + Abs(ParametricTolerance) + //! . if I1 < 1 => U < Knots (1) - std::abs(ParametricTolerance) + //! . if I2 > NbKnots => U > Knots (NbKnots) + std::abs(ParametricTolerance) Standard_EXPORT void LocateU(const Standard_Real U, const Standard_Real ParametricTolerance, Standard_Integer& I1, diff --git a/src/ModelingAlgorithms/TKGeomAlgo/Law/Law_Interpolate.cxx b/src/ModelingAlgorithms/TKGeomAlgo/Law/Law_Interpolate.cxx index 2a45b60782..6813a1f7b9 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/Law/Law_Interpolate.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/Law/Law_Interpolate.cxx @@ -57,13 +57,14 @@ static void BuildParameters(const Standard_Boolean PeriodicFlag, ParametersPtr->SetValue(1, 0.); for (ii = PointsArray.Lower(); ii < PointsArray.Upper(); ii++) { - distance = Abs(PointsArray.Value(ii) - PointsArray.Value(ii + 1)); + distance = std::abs(PointsArray.Value(ii) - PointsArray.Value(ii + 1)); ParametersPtr->SetValue(index, ParametersPtr->Value(ii) + distance); index += 1; } if (PeriodicFlag) { - distance = Abs(PointsArray.Value(PointsArray.Upper()) - PointsArray.Value(PointsArray.Lower())); + distance = + std::abs(PointsArray.Value(PointsArray.Upper()) - PointsArray.Value(PointsArray.Lower())); ParametersPtr->SetValue(index, ParametersPtr->Value(ii) + distance); } } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/LocalAnalysis/LocalAnalysis_CurveContinuity.cxx b/src/ModelingAlgorithms/TKGeomAlgo/LocalAnalysis/LocalAnalysis_CurveContinuity.cxx index e3ae3ee11c..945492d44f 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/LocalAnalysis/LocalAnalysis_CurveContinuity.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/LocalAnalysis/LocalAnalysis_CurveContinuity.cxx @@ -149,7 +149,7 @@ void LocalAnalysis_CurveContinuity::CurvG2(GeomLProp_CLProps& Curv1, GeomLProp_C { myCourbC1 = Curv1.Curvature(); myCourbC2 = Curv2.Curvature(); - if ((Abs(myCourbC1) > epscrb) && (Abs(myCourbC2) > epscrb)) + if ((std::abs(myCourbC1) > epscrb) && (std::abs(myCourbC2) > epscrb)) { V1 = Curv1.D1(); V2 = Curv2.D1(); @@ -162,7 +162,7 @@ void LocalAnalysis_CurveContinuity::CurvG2(GeomLProp_CLProps& Curv1, GeomLProp_C myContG2 = ang; myCourbC1 = Curv1.Curvature(); myCourbC2 = Curv2.Curvature(); - myG2Variation = Abs(myCourbC1 - myCourbC2) / sqrt(myCourbC1 * myCourbC2); + myG2Variation = std::abs(myCourbC1 - myCourbC2) / sqrt(myCourbC1 * myCourbC2); } else { @@ -282,7 +282,7 @@ Standard_Boolean LocalAnalysis_CurveContinuity::IsC1() const { throw StdFail_NotDone(); } - if (IsC0() && ((myContC1 <= myepsC1) || (Abs(myContC1 - M_PI) <= myepsC1))) + if (IsC0() && ((myContC1 <= myepsC1) || (std::abs(myContC1 - M_PI) <= myepsC1))) return Standard_True; else return Standard_False; @@ -300,11 +300,11 @@ Standard_Boolean LocalAnalysis_CurveContinuity::IsC2() const } if (IsC1()) { - if ((myContC2 <= myepsC2) || (Abs(myContC2 - M_PI) <= myepsC2)) + if ((myContC2 <= myepsC2) || (std::abs(myContC2 - M_PI) <= myepsC2)) { epsil1 = 0.5 * myepsC1 * myepsC1 * myLambda1; epsil2 = 0.5 * myepsC2 * myepsC2 * myLambda2; - if ((Abs(myLambda1 * myLambda1 - myLambda2)) <= (epsil1 * epsil1 + epsil2)) + if ((std::abs(myLambda1 * myLambda1 - myLambda2)) <= (epsil1 * epsil1 + epsil2)) return Standard_True; } else @@ -321,7 +321,7 @@ Standard_Boolean LocalAnalysis_CurveContinuity::IsG1() const { throw StdFail_NotDone(); } - if (IsC0() && ((myContG1 <= myepsG1 || (Abs(myContG1 - M_PI) <= myepsG1)))) + if (IsC0() && ((myContG1 <= myepsG1 || (std::abs(myContG1 - M_PI) <= myepsG1)))) return Standard_True; else return Standard_False; @@ -363,7 +363,7 @@ Standard_Boolean LocalAnalysis_CurveContinuity::IsG2() const if (IETA1 == 1) { Standard_Real eps = RealPart((myContG2 + myepsG2) / M_PI) * M_PI; - if (Abs(eps - myepsG2) < myepsG2) + if (std::abs(eps - myepsG2) < myepsG2) { if (myG2Variation < myperce) return Standard_True; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/LocalAnalysis/LocalAnalysis_SurfaceContinuity.cxx b/src/ModelingAlgorithms/TKGeomAlgo/LocalAnalysis/LocalAnalysis_SurfaceContinuity.cxx index 0b4c66e804..622b5499d8 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/LocalAnalysis/LocalAnalysis_SurfaceContinuity.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/LocalAnalysis/LocalAnalysis_SurfaceContinuity.cxx @@ -204,10 +204,14 @@ void LocalAnalysis_SurfaceContinuity::SurfG2(GeomLProp_SLProps& Surf1, GeomLProp Surf2.CurvatureDirections(DMIN2, DMAX2); DMIN1.Coord(x1, y1, z1); DMAX1.Coord(x2, y2, z2); - gp_Dir MCD1((Abs(x1) + Abs(x2)) / 2, (Abs(y1) + Abs(y2)) / 2, (Abs(z1) + Abs(z2)) / 2); + gp_Dir MCD1((std::abs(x1) + std::abs(x2)) / 2, + (std::abs(y1) + std::abs(y2)) / 2, + (std::abs(z1) + std::abs(z2)) / 2); DMIN2.Coord(x1, y1, z1); DMAX2.Coord(x2, y2, z2); - gp_Dir MCD2((Abs(x1) + Abs(x2)) / 2, (Abs(y1) + Abs(y2)) / 2, (Abs(z1) + Abs(z2)) / 2); + gp_Dir MCD2((std::abs(x1) + std::abs(x2)) / 2, + (std::abs(y1) + std::abs(y2)) / 2, + (std::abs(z1) + std::abs(z2)) / 2); myAlpha = MCD1.Angle(MCD2); RMIN1 = Surf1.MinCurvature(); @@ -223,9 +227,9 @@ void LocalAnalysis_SurfaceContinuity::SurfG2(GeomLProp_SLProps& Surf1, GeomLProp Standard_Real DETA, DZETA; DETA = (myETA1 - myETA2) / 2; DZETA = (myZETA1 - myZETA2) / 2; - myGap = Abs(DETA) - + sqrt(DZETA * DZETA * Cos(myAlpha) * Cos(myAlpha) - + myZETA * myZETA * Sin(myAlpha) * Sin(myAlpha)); + myGap = std::abs(DETA) + + sqrt(DZETA * DZETA * std::cos(myAlpha) * std::cos(myAlpha) + + myZETA * myZETA * std::sin(myAlpha) * std::sin(myAlpha)); } else { @@ -545,8 +549,8 @@ Standard_Boolean LocalAnalysis_SurfaceContinuity::IsC2() const eps2v = 0.5 * myepsC2 * myepsC2 * myLambda2V; if ((myContC2U < myepsC2) && (myContC2V < myepsC2)) { - if (Abs(myLambda1U * myLambda1U - myLambda2U) <= (eps1u * eps1u + eps2u)) - if (Abs(myLambda1V * myLambda1V - myLambda2V) <= (eps1v * eps1v + eps2v)) + if (std::abs(myLambda1U * myLambda1U - myLambda2U) <= (eps1u * eps1u + eps2u)) + if (std::abs(myLambda1V * myLambda1V - myLambda2V) <= (eps1v * eps1v + eps2v)) return Standard_True; else return Standard_False; @@ -589,13 +593,13 @@ Standard_Boolean LocalAnalysis_SurfaceContinuity::IsG2() const EPSNL = 8 * myepsC0 / (mymaxlen * mymaxlen); if (IsG1()) { - if ((Abs(myETA) < EPSNL) && (Abs(myZETA) < EPSNL)) + if ((std::abs(myETA) < EPSNL) && (std::abs(myZETA) < EPSNL)) return Standard_True; - if ((Abs(myZETA1) < EPSNL) && (Abs(myZETA2) < EPSNL)) + if ((std::abs(myZETA1) < EPSNL) && (std::abs(myZETA2) < EPSNL)) itype = 1; - else if ((Abs(myETA1) < EPSNL) && (Abs(myETA2) < EPSNL)) + else if ((std::abs(myETA1) < EPSNL) && (std::abs(myETA2) < EPSNL)) itype = 1; - else if ((Abs(Abs(myZETA) - Abs(myETA))) < EPSNL) + else if ((std::abs(std::abs(myZETA) - std::abs(myETA))) < EPSNL) itype = 1; else if ((myETA1 < myZETA1) && (myETA2 < myZETA2)) itype = 1; diff --git a/src/ModelingAlgorithms/TKGeomAlgo/TopTrans/TopTrans_CurveTransition.cxx b/src/ModelingAlgorithms/TKGeomAlgo/TopTrans/TopTrans_CurveTransition.cxx index fbdd935616..6a8754ebed 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/TopTrans/TopTrans_CurveTransition.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/TopTrans/TopTrans_CurveTransition.cxx @@ -313,7 +313,7 @@ Standard_Boolean TopTrans_CurveTransition::IsBefore(const Standard_Real Tole, Standard_Real TN2 = myTgt * N2; Standard_Boolean OneBefore = Standard_False; - if (Abs(TN1) <= Tole || Abs(TN2) <= Tole) + if (std::abs(TN1) <= Tole || std::abs(TN2) <= Tole) { // Tangent : The first is the interference which have the nearest curvature // from the reference. diff --git a/src/ModelingAlgorithms/TKGeomAlgo/TopTrans/TopTrans_SurfaceTransition.cxx b/src/ModelingAlgorithms/TKGeomAlgo/TopTrans/TopTrans_SurfaceTransition.cxx index c7cec36b2f..5a1ef75fd0 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/TopTrans/TopTrans_SurfaceTransition.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/TopTrans/TopTrans_SurfaceTransition.cxx @@ -68,10 +68,10 @@ static void FUN_getSTA(const Standard_Real Ang, Standard_Integer& i, Standard_Integer& j) { - Standard_Real cos = Cos(Ang); - Standard_Real sin = Sin(Ang); - Standard_Boolean nullcos = Abs(cos) < tola; - Standard_Boolean nullsin = Abs(sin) < tola; + Standard_Real cos = std::cos(Ang); + Standard_Real sin = std::sin(Ang); + Standard_Boolean nullcos = std::abs(cos) < tola; + Standard_Boolean nullsin = std::abs(sin) < tola; if (nullcos) i = 0; else @@ -95,7 +95,7 @@ static void FUN_getSTA(const Standard_Real Ang, FUN_getSTA(Ang,tola,i,j); if (j == 0) { Standard_Real diff = Curv - CurvRef; - if (Abs(diff) < tola) {STATIC_DEFINED = Standard_False; return;} // nyi FUN_Raise + if (std::abs(diff) < tola) {STATIC_DEFINED = Standard_False; return;} // nyi FUN_Raise j = (diff < 0.) ? 1 : 2; } }*/ @@ -118,9 +118,9 @@ static Standard_Integer FUN_refnearest(const Standard_Real Angref, if (undef) return M_updateREF; - Standard_Real cosref = Cos(Angref), cos = Cos(Ang); - Standard_Real dcos = Abs(cosref) - Abs(cos); - if (Abs(dcos) < tola) + Standard_Real cosref = std::cos(Angref), cos = std::cos(Ang); + Standard_Real dcos = std::abs(cosref) - std::abs(cos); + if (std::abs(dcos) < tola) { // Analysis for tangent cases : if two boundary faces are same sided // and have tangent normals, if they have opposite orientations @@ -150,8 +150,8 @@ static Standard_Integer FUN_refnearest(const Standard_Integer i, Standard_Boolean& TouchFlag) // eap Mar 25 2002 { Standard_Boolean iisj = (i == j); - Standard_Real abscos = Abs(Cos(Ang)); - Standard_Boolean i0 = (Abs(1. - abscos) < tola); + Standard_Real abscos = std::abs(std::cos(Ang)); + Standard_Boolean i0 = (std::abs(1. - abscos) < tola); Standard_Boolean j0 = (abscos < tola); Standard_Boolean nullcurv = (Curv == 0.); Standard_Boolean curvpos = (Curv > tola); @@ -183,15 +183,15 @@ static Standard_Integer FUN_refnearest(const Standard_Integer i, return M_updateREF; } // undef - Standard_Real cosref = Cos(Angref), cos = Cos(Ang); - Standard_Real dcos = Abs(cosref) - Abs(cos); - Standard_Boolean samecos = Abs(dcos) < tola; + Standard_Real cosref = std::cos(Angref), cos = std::cos(Ang); + Standard_Real dcos = std::abs(cosref) - std::abs(cos); + Standard_Boolean samecos = std::abs(dcos) < tola; if (samecos) { // Analysis for tangent cases : if two boundary faces are same sided // and have sma dironF. - if (Abs(Curvref - Curv) < 1.e-4) + if (std::abs(Curvref - Curv) < 1.e-4) { if (TopAbs::Complement(Ori) == Oriref) return M_Ointernal; @@ -212,9 +212,9 @@ static Standard_Integer FUN_refnearest(const Standard_Integer i, { // check for (j==1) the face is ABOVE Sref // check for (j==2) the face is BELOW Sref - if ((j == 2) && (Abs(Curv) < CurvSref)) + if ((j == 2) && (std::abs(Curv) < CurvSref)) updateref = M_noupdate; - if ((j == 1) && (Abs(Curv) > CurvSref)) + if ((j == 1) && (std::abs(Curv) > CurvSref)) updateref = M_noupdate; } return updateref; @@ -251,10 +251,10 @@ void TopTrans_SurfaceTransition::Reset(const gp_Dir& Tgt, STATIC_DEFINED = Standard_True; constexpr Standard_Real tola = Precision::Angular(); - Standard_Boolean curismax = (Abs(MaxD.Dot(myTgt)) < tola); - Standard_Boolean curismin = (Abs(MinD.Dot(myTgt)) < tola); + Standard_Boolean curismax = (std::abs(MaxD.Dot(myTgt)) < tola); + Standard_Boolean curismin = (std::abs(MinD.Dot(myTgt)) < tola); - if ((Abs(MaxCurv) < tola) && (Abs(MinCurv) < tola)) + if ((std::abs(MaxCurv) < tola) && (std::abs(MinCurv) < tola)) { Reset(Tgt, Norm); return; @@ -272,9 +272,9 @@ void TopTrans_SurfaceTransition::Reset(const gp_Dir& Tgt, } if (curismax) - myCurvRef = Abs(MaxCurv); + myCurvRef = std::abs(MaxCurv); if (curismin) - myCurvRef = Abs(MinCurv); + myCurvRef = std::abs(MinCurv); if (myCurvRef < tola) myCurvRef = 0.; @@ -329,8 +329,8 @@ void TopTrans_SurfaceTransition::Compare Standard_Real Curv = 0.; // ------ constexpr Standard_Real tola = Precision::Angular(); - Standard_Boolean curismax = (Abs(MaxD.Dot(myTgt)) < tola); - Standard_Boolean curismin = (Abs(MinD.Dot(myTgt)) < tola); + Standard_Boolean curismax = (std::abs(MaxD.Dot(myTgt)) < tola); + Standard_Boolean curismin = (std::abs(MinD.Dot(myTgt)) < tola); if (!curismax && !curismin) { // In the plane normal to , we see the boundary face as @@ -342,9 +342,9 @@ void TopTrans_SurfaceTransition::Compare return; } if (curismax) - Curv = Abs(MaxCurv); + Curv = std::abs(MaxCurv); if (curismin) - Curv = Abs(MinCurv); + Curv = std::abs(MinCurv); if (myCurvRef < tola) Curv = 0.; gp_Dir dironF = FUN_nCinsideS(myTgt, Norm); diff --git a/src/ModelingAlgorithms/TKHLR/Contap/Contap_ArcFunction.cxx b/src/ModelingAlgorithms/TKHLR/Contap/Contap_ArcFunction.cxx index 70ed1ece9e..ae5edc196b 100644 --- a/src/ModelingAlgorithms/TKHLR/Contap/Contap_ArcFunction.cxx +++ b/src/ModelingAlgorithms/TKHLR/Contap/Contap_ArcFunction.cxx @@ -194,9 +194,9 @@ Standard_Integer Contap_ArcFunction::GetStateNumber() Standard_Integer Contap_ArcFunction::NbSamples() const { - return Max( - Max(Contap_HContTool::NbSamplesU(mySurf, 0., 0.), Contap_HContTool::NbSamplesV(mySurf, 0., 0.)), - Contap_HContTool::NbSamplesOnArc(myArc)); + return std::max(std::max(Contap_HContTool::NbSamplesU(mySurf, 0., 0.), + Contap_HContTool::NbSamplesV(mySurf, 0., 0.)), + Contap_HContTool::NbSamplesOnArc(myArc)); } // modified by NIZNHY-PKV Thu Mar 29 16:53:07 2001f diff --git a/src/ModelingAlgorithms/TKHLR/Contap/Contap_ArcFunction.lxx b/src/ModelingAlgorithms/TKHLR/Contap/Contap_ArcFunction.lxx index be67162495..f6fcf102fb 100644 --- a/src/ModelingAlgorithms/TKHLR/Contap/Contap_ArcFunction.lxx +++ b/src/ModelingAlgorithms/TKHLR/Contap/Contap_ArcFunction.lxx @@ -18,14 +18,14 @@ inline void Contap_ArcFunction::Set(const gp_Dir& Direction, const Standard_Real { myType = Contap_DraftStd; myDir = Direction; - myCosAng = Cos(M_PI / 2. + Angle); + myCosAng = std::cos(M_PI / 2. + Angle); } inline void Contap_ArcFunction::Set(const gp_Pnt& Eye, const Standard_Real Angle) { myType = Contap_DraftPrs; myEye = Eye; - myCosAng = Cos(M_PI / 2. + Angle); + myCosAng = std::cos(M_PI / 2. + Angle); } inline void Contap_ArcFunction::Set(const gp_Dir& Direction) diff --git a/src/ModelingAlgorithms/TKHLR/Contap/Contap_ContAna.cxx b/src/ModelingAlgorithms/TKHLR/Contap/Contap_ContAna.cxx index 6ec91bfeb2..c65daf1296 100644 --- a/src/ModelingAlgorithms/TKHLR/Contap/Contap_ContAna.cxx +++ b/src/ModelingAlgorithms/TKHLR/Contap/Contap_ContAna.cxx @@ -42,7 +42,7 @@ void Contap_ContAna::Perform(const gp_Sphere& S, const gp_Dir& D) typL = GeomAbs_Circle; pt1 = S.Location(); dir1 = D; - if (Abs(D.Dot(S.XAxis().Direction())) < 0.9999999999999) + if (std::abs(D.Dot(S.XAxis().Direction())) < 0.9999999999999) { dir2 = D.Crossed(S.XAxis().Direction()); } @@ -61,7 +61,7 @@ void Contap_ContAna::Perform(const gp_Sphere& S, const gp_Dir& D, const Standard typL = GeomAbs_Circle; dir1 = D; - if (Abs(D.Dot(S.XAxis().Direction())) < 0.9999999999999) + if (std::abs(D.Dot(S.XAxis().Direction())) < 0.9999999999999) { dir2 = D.Crossed(S.XAxis().Direction()); } @@ -98,7 +98,7 @@ void Contap_ContAna::Perform(const gp_Sphere& S, const gp_Pnt& Eye) gp_XYZ locxyz(S.Location().XYZ()); dir1.SetXYZ(Eye.XYZ() - locxyz); pt1.SetXYZ(locxyz + (radius * radius / dist) * dir1.XYZ()); - if (Abs(dir1.Dot(S.XAxis().Direction())) < 0.9999999999999) + if (std::abs(dir1.Dot(S.XAxis().Direction())) < 0.9999999999999) { dir2 = dir1.Crossed(S.XAxis().Direction()); } @@ -148,7 +148,7 @@ void Contap_ContAna::Perform(const gp_Cylinder& C, const gp_Dir& D, const Standa Standard_Real norm1 = Coefcos * Coefcos + Coefsin * Coefsin; Standard_Real norm2 = sqrt(norm1); - if (Abs(Coefcst) < norm2) + if (std::abs(Coefcst) < norm2) { typL = GeomAbs_Line; nbSol = 2; @@ -163,12 +163,12 @@ void Contap_ContAna::Perform(const gp_Cylinder& C, const gp_Dir& D, const Standa // Necessary to solve Coefcos*cos(t) + Coefsin*sin(t) = Coefcst // and the origins of solution are in the reference of the // cylinder in (R*cost0, R*sint0,0) and (R*cost1,R*sint1,0) - // By setting cos(phi) = Coefcos/Sqrt(Coefcos**2 + Coefsin**2) and - // sin(phi) = Coefsin/Sqrt(Coefcos**2 + Coefsin**2) + // By setting cos(phi) = Coefcos/std::sqrt(Coefcos**2 + Coefsin**2) and + // sin(phi) = Coefsin/std::sqrt(Coefcos**2 + Coefsin**2) // and by using trigonometric relations the values of cosinus // and sinus to the solutions are obtained. - prm = Sqrt(norm1 - Coefcst * Coefcst); + prm = std::sqrt(norm1 - Coefcst * Coefcst); Standard_Real cost0, sint0, cost1, sint1; cost0 = (Coefcos * Coefcst - Coefsin * prm) / norm1; @@ -229,23 +229,23 @@ void Contap_ContAna::Perform(const gp_Cone& C, const gp_Dir& D) { done = Standard_False; - Standard_Real Tgtalpha = Tan(C.SemiAngle()); + Standard_Real Tgtalpha = std::tan(C.SemiAngle()); Standard_Real Coefcos = D.Dot(C.Position().XDirection()); Standard_Real Coefsin = D.Dot(C.Position().YDirection()); Standard_Real Coefcst = D.Dot(C.Axis().Direction()) * Tgtalpha; Standard_Real norm1 = Coefcos * Coefcos + Coefsin * Coefsin; - Standard_Real norm2 = Sqrt(norm1); - // if (Abs(Abs(Coefcst)-norm2) <= Tolpetit) { // tol angulaire 1.e-8 + Standard_Real norm2 = std::sqrt(norm1); + // if (std::abs(std::abs(Coefcst)-norm2) <= Tolpetit) { // tol angulaire 1.e-8 // typL = GeomAbs_Line; // nbSol = 1; // pt1 = C.Apex(); // dir1 = D; // } - // else if (Abs(Coefcst) < norm2) { + // else if (std::abs(Coefcst) < norm2) { - if (Abs(Coefcst) < norm2) + if (std::abs(Coefcst) < norm2) { typL = GeomAbs_Line; nbSol = 2; @@ -254,12 +254,12 @@ void Contap_ContAna::Perform(const gp_Cone& C, const gp_Dir& D) // Necessary to solve Coefcos*cos(t) + Coefsin*sin(t) = Coefcst // and director vectors of solutions are // cos(t0) * XDirection + sin(t0) * YDirection + ZDirection/Tgtalpha - // By setting cos(phi) = Coefcos/Sqrt(Coefcos**2 + Coefsin**2) and - // sin(phi) = Coefsin/Sqrt(Coefcos**2 + Coefsin**2) + // By setting cos(phi) = Coefcos/std::sqrt(Coefcos**2 + Coefsin**2) and + // sin(phi) = Coefsin/std::sqrt(Coefcos**2 + Coefsin**2) // and by using trigonometric relations the values of cosinus // and sinus to the solutions are obtained. - prm = Sqrt(norm1 - Coefcst * Coefcst); + prm = std::sqrt(norm1 - Coefcst * Coefcst); Standard_Real cost0, sint0, cost1, sint1; cost0 = (Coefcos * Coefcst - Coefsin * prm) / norm1; @@ -301,27 +301,27 @@ void Contap_ContAna::Perform(const gp_Cone& C, const gp_Dir& D, const Standard_R Standard_Real Coefcst1 = cos(M_PI * 0.5 + Angle); Standard_Real norm1 = Coefcos * Coefcos + Coefsin * Coefsin; - Standard_Real norm2 = Sqrt(norm1); + Standard_Real norm2 = std::sqrt(norm1); Standard_Real Coefnz = D.Dot(C.Axis().Direction()) * Sina; Standard_Real Coefcst = (Coefcst1 + Coefnz) / Cosa; - if (Abs(Coefcst) < norm2) + if (std::abs(Coefcst) < norm2) { typL = GeomAbs_Line; nbSol += 2; pt1 = C.Apex(); pt2 = pt1; - // It is requiredto solve Coefcos*cos(t) + Coefsin*sin(t) = Coefcst + // It is required to solve Coefcos*cos(t) + Coefsin*sin(t) = Coefcst // and the director vectors of solutions are // cos(t0) * XDirection + sin(t0) * YDirection + ZDirection/Tgtalpha - // By setting cos(phi) = Coefcos/Sqrt(Coefcos**2 + Coefsin**2) and - // sin(phi) = Coefsin/Sqrt(Coefcos**2 + Coefsin**2) + // By setting cos(phi) = Coefcos/std::sqrt(Coefcos**2 + Coefsin**2) and + // sin(phi) = Coefsin/std::sqrt(Coefcos**2 + Coefsin**2) // and by using trigonometric relations the values of cosinus // and sinus to the solutions are obtained. - prm = Sqrt(norm1 - Coefcst * Coefcst); + prm = std::sqrt(norm1 - Coefcst * Coefcst); Standard_Real cost0, sint0, cost1, sint1; cost0 = (Coefcos * Coefcst - Coefsin * prm) / norm1; @@ -348,14 +348,14 @@ void Contap_ContAna::Perform(const gp_Cone& C, const gp_Dir& D, const Standard_R Coefcst = (Coefcst1 - Coefnz) / Cosa; - if (Abs(Coefcst) < norm2) + if (std::abs(Coefcst) < norm2) { typL = GeomAbs_Line; nbSol += 2; pt3 = C.Apex(); pt4 = pt3; - prm = Sqrt(norm1 - Coefcst * Coefcst); + prm = std::sqrt(norm1 - Coefcst * Coefcst); Standard_Real cost0, sint0, cost1, sint1; cost0 = (Coefcos * Coefcst - Coefsin * prm) / norm1; @@ -394,7 +394,7 @@ void Contap_ContAna::Perform(const gp_Cone& C, const gp_Pnt& Eye) { done = Standard_False; - Standard_Real Tgtalpha = Tan(C.SemiAngle()); + Standard_Real Tgtalpha = std::tan(C.SemiAngle()); gp_XYZ apexeye(Eye.XYZ()); apexeye.Subtract(C.Apex().XYZ()); @@ -404,16 +404,16 @@ void Contap_ContAna::Perform(const gp_Cone& C, const gp_Pnt& Eye) Standard_Real Coefcst = apexeye.Dot(C.Axis().Direction().XYZ()) * Tgtalpha; Standard_Real norm1 = Coefcos * Coefcos + Coefsin * Coefsin; - Standard_Real norm2 = Sqrt(Coefcos * Coefcos + Coefsin * Coefsin); - // if (Abs(Abs(Coefcst)-norm2) <= Tolpetit) { // tol angulaire 1.e-8 + Standard_Real norm2 = std::sqrt(Coefcos * Coefcos + Coefsin * Coefsin); + // if (std::abs(std::abs(Coefcst)-norm2) <= Tolpetit) { // tol angulaire 1.e-8 // typL = GeomAbs_Line; // nbSol = 1; // pt1 = C.Apex(); // dir1.SetXYZ(apexeye); // } - // else if (Abs(Coefcst) < norm2) { + // else if (std::abs(Coefcst) < norm2) { - if (Abs(Coefcst) < norm2) + if (std::abs(Coefcst) < norm2) { typL = GeomAbs_Line; nbSol = 2; @@ -422,12 +422,12 @@ void Contap_ContAna::Perform(const gp_Cone& C, const gp_Pnt& Eye) // It is required to solve Coefcos*cos(t) + Coefsin*sin(t) = Coefcst // and the director vectors of solutions are // cos(t0) * XDirection + sin(t0) * YDirection + ZDirection/Tgtalpha - // By setting cos(phi) = Coefcos/Sqrt(Coefcos**2 + Coefsin**2) and - // sin(phi) = Coefsin/Sqrt(Coefcos**2 + Coefsin**2) + // By setting cos(phi) = Coefcos/std::sqrt(Coefcos**2 + Coefsin**2) and + // sin(phi) = Coefsin/std::sqrt(Coefcos**2 + Coefsin**2) // and by using trigonometric relations the values of cosinus // and sinus to the solutions are obtained. - prm = Sqrt(norm1 - Coefcst * Coefcst); + prm = std::sqrt(norm1 - Coefcst * Coefcst); Standard_Real cost0, sint0, cost1, sint1; cost0 = (Coefcos * Coefcst - Coefsin * prm) / norm1; diff --git a/src/ModelingAlgorithms/TKHLR/Contap/Contap_Contour.cxx b/src/ModelingAlgorithms/TKHLR/Contap/Contap_Contour.cxx index 67172a4421..553bb82bde 100644 --- a/src/ModelingAlgorithms/TKHLR/Contap/Contap_Contour.cxx +++ b/src/ModelingAlgorithms/TKHLR/Contap/Contap_Contour.cxx @@ -401,7 +401,7 @@ static void LineConstructor(Contap_TheSequenceOfLine& slin, firstp = L.Vertex(i).ParameterOnLine(); lastp = L.Vertex(i + 1).ParameterOnLine(); } - if (Abs(firstp - lastp) > 0.000000001) + if (std::abs(firstp - lastp) > 0.000000001) { Standard_Real pmid = (firstp + lastp) * 0.5; gp_Pnt Pmid = ElCLib::Value(pmid, L.Circle()); @@ -450,7 +450,7 @@ static void LineConstructor(Contap_TheSequenceOfLine& slin, { Standard_Real firstp = L.Vertex(nbvtx).ParameterOnLine(); Standard_Real lastp = L.Vertex(1).ParameterOnLine() + M_PI + M_PI; - if (Abs(firstp - lastp) > 0.0000000001) + if (std::abs(firstp - lastp) > 0.0000000001) { Standard_Real pmid = (firstp + lastp) * 0.5; gp_Pnt Pmid = ElCLib::Value(pmid, L.Circle()); @@ -677,7 +677,7 @@ static void ComputeTangency(const Contap_TheSearch& solrst, if (PStart.IsNew()) { Standard_Real tbis = vectg.Normalized().Dot(tg3drst.Normalized()); - if (Abs(tbis) < 1. - tole) + if (std::abs(tbis) < 1. - tole) { if ((test < 0. && arcorien == TopAbs_FORWARD) @@ -713,7 +713,7 @@ static void ComputeTangency(const Contap_TheSearch& solrst, test = test / (vectg.Magnitude()); test = test / ((normale.Crossed(tg3drst)).Magnitude()); - if (Abs(test) <= tole) + if (std::abs(test) <= tole) { tobeverified = Standard_True; LocTrans = TopAbs_EXTERNAL; // et pourquoi pas INTERNAL @@ -766,7 +766,7 @@ static void ComputeTangency(const Contap_TheSearch& solrst, test = test / ((normale.Crossed(tg3drst)).Magnitude()); vtxorien = Domain->Orientation(vtx2); - if (Abs(test) <= tole) + if (std::abs(test) <= tole) { tobeverified = Standard_True; LocTrans = TopAbs_EXTERNAL; // et pourquoi pas INTERNAL @@ -1227,8 +1227,8 @@ void ComputeInternalPointsOnRstr(Contap_Line& Line, vtestb = gp_Vec(0., 0., 0.); } - if ((vtestb.Magnitude() <= gp::Resolution()) || (Abs(paramp - paraminf) <= toler) - || (Abs(paramp - paramsup) <= toler)) + if ((vtestb.Magnitude() <= gp::Resolution()) || (std::abs(paramp - paraminf) <= toler) + || (std::abs(paramp - paramsup) <= toler)) { // on est a la solution solution = Standard_True; @@ -1251,7 +1251,7 @@ void ComputeInternalPointsOnRstr(Contap_Line& Line, for (i = 1; i <= Line.NbVertex(); i++) { Contap_Point& thevtx = Line.Vertex(i); - if (Abs(thevtx.ParameterOnLine() - paramp) <= toler) + if (std::abs(thevtx.ParameterOnLine() - paramp) <= toler) { thevtx.SetInternal(); ok = Standard_False; // on a correspondence @@ -1401,7 +1401,7 @@ void ComputeInternalPoints(Contap_Line& Line, rsnld.Root(X); SFunc.Values(X, F, DF); - if (Abs(F(1)) <= SFunc.Tolerance()) + if (std::abs(F(1)) <= SFunc.Tolerance()) { if (!SFunc.IsTangent()) @@ -1418,8 +1418,8 @@ void ComputeInternalPoints(Contap_Line& Line, vtestb = gp_Vec(0., 0., 0.); } if ((vtestb.Magnitude() <= gp::Resolution()) - || (Abs(X(1) - XInf(1)) <= toler(1) && Abs(X(2) - XInf(2)) <= toler(2)) - || (Abs(X(1) - XSup(1)) <= toler(1) && Abs(X(2) - XSup(2)) <= toler(2))) + || (std::abs(X(1) - XInf(1)) <= toler(1) && std::abs(X(2) - XInf(2)) <= toler(2)) + || (std::abs(X(1) - XSup(1)) <= toler(1) && std::abs(X(2) - XSup(2)) <= toler(2))) { // on est a la solution solution = Standard_True; @@ -1448,7 +1448,7 @@ void ComputeInternalPoints(Contap_Line& Line, Standard_Boolean newpoint = Standard_False; Line.Point(indexinf).ParametersOnS2(U, V); gp_Vec2d vinf(X(1) - U, X(2) - V); - if (Abs(vinf.X()) <= toler(1) && Abs(vinf.Y()) <= toler(2)) + if (std::abs(vinf.X()) <= toler(1) && std::abs(vinf.Y()) <= toler(2)) { paramp = indexinf; } @@ -1458,7 +1458,7 @@ void ComputeInternalPoints(Contap_Line& Line, { Line.Point(index).ParametersOnS2(U, V); gp_Vec2d vsup(X(1) - U, X(2) - V); - if (Abs(vsup.X()) <= toler(1) && Abs(vsup.Y()) <= toler(2)) + if (std::abs(vsup.X()) <= toler(1) && std::abs(vsup.Y()) <= toler(2)) { paramp = index; break; @@ -1559,7 +1559,7 @@ void Contap_Contour::Perform(const Handle(Adaptor3d_TopolTool)& Domain) Standard_Real EpsU = Adaptor3d_HSurfaceTool::UResolution(Surf, Precision::Confusion()); Standard_Real EpsV = Adaptor3d_HSurfaceTool::VResolution(Surf, Precision::Confusion()); - Standard_Real Preci = Min(EpsU, EpsV); + Standard_Real Preci = std::min(EpsU, EpsV); // Standard_Real Fleche = 5.e-1; // Standard_Real Pas = 5.e-2; Standard_Real Fleche = 0.01; @@ -1978,14 +1978,14 @@ static Standard_Boolean FindLine(Contap_Line& Line, gp_Lin lin(Line.Line()); para = ElCLib::Parameter(lin, Ptref); ElCLib::D1(para, lin, pt, tg); - dist = pt.Distance(Ptref) + Abs(Norm.Dot(lin.Direction())); + dist = pt.Distance(Ptref) + std::abs(Norm.Dot(lin.Direction())); } else { // Contap__Circle gp_Circ cir(Line.Circle()); para = ElCLib::Parameter(cir, Ptref); ElCLib::D1(para, cir, pt, tg); - dist = pt.Distance(Ptref) + Abs(Norm.Dot(tg / cir.Radius())); + dist = pt.Distance(Ptref) + std::abs(Norm.Dot(tg / cir.Radius())); } if (dist < dismin) { @@ -2057,7 +2057,7 @@ static void PutPointsOnLine(const Contap_TheSearch& solrst, // des cones, et les sommets d`une sphere. Il faudrait peut-etre // rajouter une methode dans SurfProps - if (Abs(d2d.Y()) <= Precision::Confusion()) + if (std::abs(d2d.Y()) <= Precision::Confusion()) { tgtrst = d1v.Crossed(normale); if (d2d.X() < 0.0) @@ -2172,7 +2172,7 @@ void Contap_Contour::PerformAna(const Handle(Adaptor3d_TopolTool)& Domain) { case Contap_ContourStd: { gp_Dir Dirpln(pl.Axis().Direction()); - if (Abs(mySFunc.Direction().Dot(Dirpln)) > Precision::Angular()) + if (std::abs(mySFunc.Direction().Dot(Dirpln)) > Precision::Angular()) { // Aucun point du plan n`est solution, en particulier aucun point // sur restriction. @@ -2192,8 +2192,8 @@ void Contap_Contour::PerformAna(const Handle(Adaptor3d_TopolTool)& Domain) break; case Contap_DraftStd: { gp_Dir Dirpln(pl.Axis().Direction()); - Standard_Real Sina = Sin(mySFunc.Angle()); - if (Abs(mySFunc.Direction().Dot(Dirpln) + Sina) > // voir SurfFunction + Standard_Real Sina = std::sin(mySFunc.Angle()); + if (std::abs(mySFunc.Direction().Dot(Dirpln) + Sina) > // voir SurfFunction Precision::Angular()) { diff --git a/src/ModelingAlgorithms/TKHLR/Contap/Contap_HContTool.hxx b/src/ModelingAlgorithms/TKHLR/Contap/Contap_HContTool.hxx index 50ea22723d..cbd9b0c601 100644 --- a/src/ModelingAlgorithms/TKHLR/Contap/Contap_HContTool.hxx +++ b/src/ModelingAlgorithms/TKHLR/Contap/Contap_HContTool.hxx @@ -79,7 +79,7 @@ public: //! Returns the parametric tolerance used to consider //! that the vertex and another point meet, i-e - //! if Abs(parameter(Vertex) - parameter(OtherPnt))<= + //! if std::abs(parameter(Vertex) - parameter(OtherPnt))<= //! Tolerance, the points are "merged". Standard_EXPORT static Standard_Real Tolerance(const Handle(Adaptor3d_HVertex)& V, const Handle(Adaptor2d_Curve2d)& C); diff --git a/src/ModelingAlgorithms/TKHLR/Contap/Contap_SurfFunction.cxx b/src/ModelingAlgorithms/TKHLR/Contap/Contap_SurfFunction.cxx index 8ad04e5267..f8ae55c05b 100644 --- a/src/ModelingAlgorithms/TKHLR/Contap/Contap_SurfFunction.cxx +++ b/src/ModelingAlgorithms/TKHLR/Contap/Contap_SurfFunction.cxx @@ -262,7 +262,7 @@ Standard_Boolean Contap_SurfFunction::IsTangent() derived = Standard_True; } tangent = Standard_False; - Standard_Real D = Sqrt(Fpu * Fpu + Fpv * Fpv); + Standard_Real D = std::sqrt(Fpu * Fpu + Fpv * Fpv); if (D <= gp::Resolution()) { diff --git a/src/ModelingAlgorithms/TKHLR/Contap/Contap_SurfFunction.hxx b/src/ModelingAlgorithms/TKHLR/Contap/Contap_SurfFunction.hxx index f679269c17..3f1c3f98b0 100644 --- a/src/ModelingAlgorithms/TKHLR/Contap/Contap_SurfFunction.hxx +++ b/src/ModelingAlgorithms/TKHLR/Contap/Contap_SurfFunction.hxx @@ -69,7 +69,7 @@ public: //! It is a vector of dimension 1, i-e a real. Standard_Real Root() const; - //! Returns the value Tol so that if Abs(Func.Root())Transformation()); if (D1.IsParallel(gp::DZ(), Precision::Angular())) myType = GeomAbs_Circle; - else if (Abs(D1.Dot(gp::DZ())) + else if (std::abs(D1.Dot(gp::DZ())) < Precision::Angular() * 10) //*10: The minor radius of ellipse should not be too small. myType = GeomAbs_OtherCurve; @@ -208,7 +208,7 @@ Standard_Real HLRBRep_Curve::Update(Standard_Real TotMin[16], Standard_Real TotM myOZ = VFZ * gp_Vec(P.X() - F.X(), P.Y() - F.Y(), P.Z()); } else - myVX = Sqrt(V.X() * V.X() + V.Y() * V.Y()) * l3d; + myVX = std::sqrt(V.X() * V.X() + V.Y() * V.Y()) * l3d; } return (UpdateMinMax(TotMin, TotMax)); } diff --git a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_Data.cxx b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_Data.cxx index fb0f977d07..fbfa44f75c 100644 --- a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_Data.cxx +++ b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_Data.cxx @@ -736,19 +736,19 @@ void HLRBRep_Data::Update(const HLRAlgo_Projector& P) EC.D1(EC.Parameter3d(EC.LastParameter()), Pt, Tg2); Tg1.Transform(T); Tg2.Transform(T); - if (Abs(Tg1.X()) + Abs(Tg1.Y()) < myToler * 10) + if (std::abs(Tg1.X()) + std::abs(Tg1.Y()) < myToler * 10) ver1 = Standard_True; else { gp_Dir Dir1(Tg1); - ver1 = Abs(Dir1.X()) + Abs(Dir1.Y()) < myToler * 10; + ver1 = std::abs(Dir1.X()) + std::abs(Dir1.Y()) < myToler * 10; } - if (Abs(Tg2.X()) + Abs(Tg2.Y()) < myToler * 10) + if (std::abs(Tg2.X()) + std::abs(Tg2.Y()) < myToler * 10) ver2 = Standard_True; else { gp_Dir Dir2(Tg2); - ver2 = Abs(Dir2.X()) + Abs(Dir2.Y()) < myToler * 10; + ver2 = std::abs(Dir2.X()) + std::abs(Dir2.Y()) < myToler * 10; } } ed.VerAtSta(ed.Vertical() || ver1); @@ -855,7 +855,7 @@ void HLRBRep_Data::Update(const HLRAlgo_Projector& P) } else r = Nm.Z(); - if (Abs(r) > myToler * 10) + if (std::abs(r) > myToler * 10) { fd.Back(r < 0); found = Standard_True; @@ -1603,7 +1603,7 @@ Standard_Integer HLRBRep_Data::HidingStartLevel(const Standard_Integer Loop = Standard_False; else { - if (Abs(param - sta) > Abs(param - end)) + if (std::abs(param - sta) > std::abs(param - end)) end = param; else sta = param; diff --git a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_EdgeIList.cxx b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_EdgeIList.cxx index 51e853cc8e..44d56e90b1 100644 --- a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_EdgeIList.cxx +++ b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_EdgeIList.cxx @@ -63,7 +63,7 @@ static Standard_Boolean SimilarInterference(const HLRAlgo_Interference& I1, // l2 = I2.Intersection().Level(); or2 = I2.Transition(); - Standard_Boolean IsSimilar = Abs(p1 - p2) <= eps && or1 == or2; + Standard_Boolean IsSimilar = std::abs(p1 - p2) <= eps && or1 == or2; return IsSimilar; } #endif diff --git a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_PolyAlgo.cxx b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_PolyAlgo.cxx index e310aaf074..bcdd4dd0d6 100644 --- a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_PolyAlgo.cxx +++ b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_PolyAlgo.cxx @@ -362,7 +362,7 @@ void HLRBRep_PolyAlgo::StoreShell(const TopoDS_Shape& TopTools_IndexedMapOfShape anEM; TopExp::MapShapes(theShape, TopAbs_EDGE, anEM); const Standard_Integer aNbEdge = anEM.Extent(); - NCollection_Array1 aFlagArray(1, Max(aNbEdge, 1)); + NCollection_Array1 aFlagArray(1, std::max(aNbEdge, 1)); aFlagArray.Init(0); for (anEdgeExp.Init(theShape, TopAbs_EDGE); anEdgeExp.More(); anEdgeExp.Next()) { @@ -1662,7 +1662,7 @@ void HLRBRep_PolyAlgo::Interpolation(HLRAlgo_ListOfBPoint& the mP4P1, flag); } - else if (Abs(coef4 - coef3) < myTolSta) // p1 i1p3-i2p4 p2 + else if (std::abs(coef4 - coef3) < myTolSta) // p1 i1p3-i2p4 p2 { MoveOrInsertPoint(theList, theX1, diff --git a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_Surface.cxx b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_Surface.cxx index af4f8e524e..d4119c1ec1 100644 --- a/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_Surface.cxx +++ b/src/ModelingAlgorithms/TKHLR/HLRBRep/HLRBRep_Surface.cxx @@ -92,7 +92,7 @@ Standard_Boolean HLRBRep_Surface::SideRowsOfPoles(const Standard_Real tol, for (iv = 2; iv <= nbvPoles && result; iv++) { Pnt(iu, iv).Coord(x, y, z); - result = Abs(x - x0) < tole && Abs(y - y0) < tole; + result = std::abs(x - x0) < tole && std::abs(y - y0) < tole; } } if (result) @@ -106,7 +106,7 @@ Standard_Boolean HLRBRep_Surface::SideRowsOfPoles(const Standard_Real tol, for (iu = 2; iu <= nbuPoles && result; iu++) { Pnt(iu, iv).Coord(x, y, z); - result = Abs(x - x0) < tole && Abs(y - y0) < tole; + result = std::abs(x - x0) < tole && std::abs(y - y0) < tole; } } if (result) @@ -128,7 +128,7 @@ Standard_Boolean HLRBRep_Surface::SideRowsOfPoles(const Standard_Real tol, GProp_PEquation Pl(p, (Standard_Real)tol); if (Pl.IsPlanar()) - result = Abs(Pl.Plane().Axis().Direction().Z()) < 0.0001; + result = std::abs(Pl.Plane().Axis().Direction().Z()) < 0.0001; return result; } @@ -155,7 +155,7 @@ Standard_Boolean HLRBRep_Surface::IsSide(const Standard_Real tolF, const Standar } else r = D.Z(); - return Abs(r) < toler; + return std::abs(r) < toler; } else if (myType == GeomAbs_Cylinder) { @@ -165,7 +165,7 @@ Standard_Boolean HLRBRep_Surface::IsSide(const Standard_Real tolF, const Standar gp_Ax1 A = Cyl.Axis(); D = A.Direction(); D.Transform(myProj->Transformation()); - r = Sqrt(D.X() * D.X() + D.Y() * D.Y()); + r = std::sqrt(D.X() * D.X() + D.Y() * D.Y()); return r < toler; } else if (myType == GeomAbs_Cone) diff --git a/src/ModelingAlgorithms/TKHLR/HLRTopoBRep/HLRTopoBRep_FaceIsoLiner.cxx b/src/ModelingAlgorithms/TKHLR/HLRTopoBRep/HLRTopoBRep_FaceIsoLiner.cxx index 5b70e60a8a..19a70a64a9 100644 --- a/src/ModelingAlgorithms/TKHLR/HLRTopoBRep/HLRTopoBRep_FaceIsoLiner.cxx +++ b/src/ModelingAlgorithms/TKHLR/HLRTopoBRep/HLRTopoBRep_FaceIsoLiner.cxx @@ -119,8 +119,8 @@ void HLRTopoBRep_FaceIsoLiner::Perform(const Standard_Integer FI, Standard_Integer IndE; const TopoDS_Edge& newE = TopoDS::Edge(ExpEdges.Current()); const Handle(Geom2d_Curve) PC = BRep_Tool::CurveOnSurface(newE, TF, U1, U2); - if (Abs(PC->FirstParameter() - U1) <= Precision::PConfusion() - && Abs(PC->LastParameter() - U2) <= Precision::PConfusion()) + if (std::abs(PC->FirstParameter() - U1) <= Precision::PConfusion() + && std::abs(PC->LastParameter() - U2) <= Precision::PConfusion()) { IndE = Hatcher.AddElement(PC, newE.Orientation()); } @@ -145,8 +145,8 @@ void HLRTopoBRep_FaceIsoLiner::Perform(const Standard_Integer FI, Standard_Integer IndE; const TopoDS_Edge& newE = TopoDS::Edge(itE.Value()); const Handle(Geom2d_Curve) PC = BRep_Tool::CurveOnSurface(newE, TF, U1, U2); - if (Abs(PC->FirstParameter() - U1) <= Precision::PConfusion() - && Abs(PC->LastParameter() - U2) <= Precision::PConfusion()) + if (std::abs(PC->FirstParameter() - U1) <= Precision::PConfusion() + && std::abs(PC->LastParameter() - U2) <= Precision::PConfusion()) { IndE = Hatcher.AddElement(PC, TopAbs_INTERNAL); } @@ -169,9 +169,9 @@ void HLRTopoBRep_FaceIsoLiner::Perform(const Standard_Integer FI, Standard_Real Tolerance = BRep_Tool::Tolerance(TF); Standard_Integer IIso; - Standard_Real DeltaU = Abs(UMax - UMin); - Standard_Real DeltaV = Abs(VMax - VMin); - Standard_Real Confusion = Min(DeltaU, DeltaV) * HatcherConfusion3d; + Standard_Real DeltaU = std::abs(UMax - UMin); + Standard_Real DeltaV = std::abs(VMax - VMin); + Standard_Real Confusion = std::min(DeltaU, DeltaV) * HatcherConfusion3d; Hatcher.Confusion3d(Confusion); //----------------------------------------------------------------------- diff --git a/src/ModelingAlgorithms/TKHLR/HLRTopoBRep/HLRTopoBRep_OutLiner.cxx b/src/ModelingAlgorithms/TKHLR/HLRTopoBRep/HLRTopoBRep_OutLiner.cxx index 589993eca7..f1f4eb1701 100644 --- a/src/ModelingAlgorithms/TKHLR/HLRTopoBRep/HLRTopoBRep_OutLiner.cxx +++ b/src/ModelingAlgorithms/TKHLR/HLRTopoBRep/HLRTopoBRep_OutLiner.cxx @@ -197,8 +197,8 @@ void HLRTopoBRep_OutLiner::ProcessFace(const TopoDS_Face& F, Standard_Integer ec; for (ec = 1; ec <= aNe; ++ec) { - // dist = Min(dist, anExt.Value(ec)); - dist = Min(dist, anExt.SquareDistance(ec)); + // dist = std::min(dist, anExt.Value(ec)); + dist = std::min(dist, anExt.SquareDistance(ec)); } // if(dist <= 1.e-7) { diff --git a/src/ModelingAlgorithms/TKHLR/Intrv/Intrv_Interval.lxx b/src/ModelingAlgorithms/TKHLR/Intrv/Intrv_Interval.lxx index 743c3b4869..787933064a 100644 --- a/src/ModelingAlgorithms/TKHLR/Intrv/Intrv_Interval.lxx +++ b/src/ModelingAlgorithms/TKHLR/Intrv/Intrv_Interval.lxx @@ -93,8 +93,8 @@ inline void Intrv_Interval::FuseAtStart(const Standard_Real Start, { if (myStart != RealFirst()) { - Standard_Real a = Min(myStart - myTolStart, Start - TolStart); - Standard_Real b = Min(myStart + myTolStart, Start + TolStart); + Standard_Real a = std::min(myStart - myTolStart, Start - TolStart); + Standard_Real b = std::min(myStart + myTolStart, Start + TolStart); myStart = (a + b) / 2; myTolStart = (Standard_ShortReal)(b - a) / 2; } @@ -114,8 +114,8 @@ inline void Intrv_Interval::CutAtStart(const Standard_Real Start, const Standard { if (myStart != RealFirst()) { - Standard_Real a = Max(myStart - myTolStart, Start - TolStart); - Standard_Real b = Max(myStart + myTolStart, Start + TolStart); + Standard_Real a = std::max(myStart - myTolStart, Start - TolStart); + Standard_Real b = std::max(myStart + myTolStart, Start + TolStart); myStart = (a + b) / 2; myTolStart = (Standard_ShortReal)(b - a) / 2; } @@ -143,8 +143,8 @@ inline void Intrv_Interval::FuseAtEnd(const Standard_Real End, const Standard_Sh { if (myEnd != RealLast()) { - Standard_Real a = Max(myEnd - myTolEnd, End - TolEnd); - Standard_Real b = Max(myEnd + myTolEnd, End + TolEnd); + Standard_Real a = std::max(myEnd - myTolEnd, End - TolEnd); + Standard_Real b = std::max(myEnd + myTolEnd, End + TolEnd); myEnd = (a + b) / 2; myTolEnd = (Standard_ShortReal)(b - a) / 2; } @@ -164,8 +164,8 @@ inline void Intrv_Interval::CutAtEnd(const Standard_Real End, const Standard_Sho { if (myEnd != RealLast()) { - Standard_Real a = Min(myEnd - myTolEnd, End - TolEnd); - Standard_Real b = Min(myEnd + myTolEnd, End + TolEnd); + Standard_Real a = std::min(myEnd - myTolEnd, End - TolEnd); + Standard_Real b = std::min(myEnd + myTolEnd, End + TolEnd); myEnd = (a + b) / 2; myTolEnd = (Standard_ShortReal)(b - a) / 2; } @@ -178,7 +178,7 @@ inline Standard_Boolean AreFused(const Standard_Real c1, const Standard_Real c2, const Standard_ShortReal t2) { - return t1 + t2 >= Abs(c1 - c2); + return t1 + t2 >= std::abs(c1 - c2); } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKHelix/HelixBRep/HelixBRep_BuilderHelix.cxx b/src/ModelingAlgorithms/TKHelix/HelixBRep/HelixBRep_BuilderHelix.cxx index 531c94c221..03ed1bfae2 100644 --- a/src/ModelingAlgorithms/TKHelix/HelixBRep/HelixBRep_BuilderHelix.cxx +++ b/src/ModelingAlgorithms/TKHelix/HelixBRep/HelixBRep_BuilderHelix.cxx @@ -221,7 +221,7 @@ void HelixBRep_BuilderHelix::Perform() aPitch = aHeight / myPitches->Value(i); } - aTaperAngle = ATan(.5 * (myDiams->Value(i + 1) - myDiams->Value(i)) / aHeight); + aTaperAngle = std::atan(.5 * (myDiams->Value(i + 1) - myDiams->Value(i)) / aHeight); TopoDS_Wire aPart; aBB.MakeWire(aPart); @@ -349,7 +349,7 @@ void HelixBRep_BuilderHelix::BuildPart(const gp_Ax1& theAxis, // aBB.MakeWire(thePart); // - myTolReached = Max(myTolReached, aBH.ToleranceReached()); + myTolReached = std::max(myTolReached, aBH.ToleranceReached()); TColGeom_SequenceOfCurve aSC; aSC.Assign(aBH.Curves()); if (aT1 < 0.) @@ -368,7 +368,7 @@ void HelixBRep_BuilderHelix::BuildPart(const gp_Ax1& theAxis, return; } - myTolReached = Max(myTolReached, aBH1.ToleranceReached()); + myTolReached = std::max(myTolReached, aBH1.ToleranceReached()); const TColGeom_SequenceOfCurve& aSC1 = aBH1.Curves(); Standard_Integer nbc = aSC1.Length(); for (i = nbc; i >= 1; i--) diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_BaseMeshAlgo.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_BaseMeshAlgo.cxx index 930a6239ff..5443925464 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_BaseMeshAlgo.cxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_BaseMeshAlgo.cxx @@ -175,7 +175,7 @@ Standard_Integer BRepMesh_BaseMeshAlgo::addLinkToMesh(const Standard_Integer t aLinkIndex = myStructure->AddLink(BRepMesh_Edge(theFirstNodeId, theLastNodeId, BRepMesh_Frontier)); - return Abs(aLinkIndex); + return std::abs(aLinkIndex); } //================================================================================================= @@ -197,9 +197,9 @@ TopAbs_Orientation BRepMesh_BaseMeshAlgo::fixSeamEdgeOrientation( const gp_Pnt2d& aPnt2_2 = aPCurve->GetPoint(aPCurve->ParametersNb() - 1); const Standard_Real aSqDist1 = - Min(aPnt1_1.SquareDistance(aPnt1_2), aPnt1_1.SquareDistance(aPnt2_2)); + std::min(aPnt1_1.SquareDistance(aPnt1_2), aPnt1_1.SquareDistance(aPnt2_2)); const Standard_Real aSqDist2 = - Min(aPnt2_1.SquareDistance(aPnt1_2), aPnt2_1.SquareDistance(aPnt2_2)); + std::min(aPnt2_1.SquareDistance(aPnt1_2), aPnt2_1.SquareDistance(aPnt2_2)); if (aSqDist1 < Precision::SquareConfusion() && aSqDist2 < Precision::SquareConfusion()) { return TopAbs_INTERNAL; diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_CircleTool.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_CircleTool.cxx index ef812b47f3..395a7bea1c 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_CircleTool.cxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_CircleTool.cxx @@ -38,7 +38,7 @@ BRepMesh_CircleTool::BRepMesh_CircleTool(const Standard_Integer : myTolerance(Precision::PConfusion()), myAllocator(theAllocator), myCellFilter(10.0, theAllocator), - mySelector(myTolerance, Max(theReservedSize, 64), theAllocator) + mySelector(myTolerance, std::max(theReservedSize, 64), theAllocator) { } @@ -51,10 +51,10 @@ void BRepMesh_CircleTool::bind(const Standard_Integer theIndex, BRepMesh_Circle aCirle(theLocation, theRadius); // compute coords - Standard_Real aMaxX = Min(theLocation.X() + theRadius, myFaceMax.X()); - Standard_Real aMinX = Max(theLocation.X() - theRadius, myFaceMin.X()); - Standard_Real aMaxY = Min(theLocation.Y() + theRadius, myFaceMax.Y()); - Standard_Real aMinY = Max(theLocation.Y() - theRadius, myFaceMin.Y()); + Standard_Real aMaxX = std::min(theLocation.X() + theRadius, myFaceMax.X()); + Standard_Real aMinX = std::max(theLocation.X() - theRadius, myFaceMin.X()); + Standard_Real aMaxY = std::min(theLocation.Y() + theRadius, myFaceMax.Y()); + Standard_Real aMinY = std::max(theLocation.Y() - theRadius, myFaceMin.Y()); gp_XY aMinPnt(aMinX, aMinY); gp_XY aMaxPnt(aMaxX, aMaxY); @@ -106,7 +106,7 @@ Standard_Boolean BRepMesh_CircleTool::MakeCircle(const gp_XY& thePoint1, + const_cast(thePoint2).ChangeCoord(1) * aLink2.Y() + const_cast(thePoint3).ChangeCoord(1) * aLink3.Y()); - if (Abs(aD) < gp::Resolution()) + if (std::abs(aD) < gp::Resolution()) return Standard_False; const Standard_Real aInvD = 1. / aD; @@ -119,9 +119,9 @@ Standard_Boolean BRepMesh_CircleTool::MakeCircle(const gp_XY& thePoint1, theLocation.ChangeCoord(2) = (aSqMod1 * aLink1.X() + aSqMod2 * aLink2.X() + aSqMod3 * aLink3.X()) * aInvD; - theRadius = Sqrt(Max(Max((thePoint1 - theLocation).SquareModulus(), - (thePoint2 - theLocation).SquareModulus()), - (thePoint3 - theLocation).SquareModulus())) + theRadius = std::sqrt(std::max(std::max((thePoint1 - theLocation).SquareModulus(), + (thePoint2 - theLocation).SquareModulus()), + (thePoint3 - theLocation).SquareModulus())) + 2 * RealEpsilon(); return Standard_True; diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Classifier.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Classifier.cxx index 61fa53a886..a3a394bddd 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Classifier.cxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Classifier.cxx @@ -99,7 +99,7 @@ void BRepMesh_Classifier::RegisterWire(const NCollection_Sequence aSqConfusion && B.SquareMagnitude() > aSqConfusion) { const Standard_Real aCurAngle = A.Angle(B); - const Standard_Real aCurAngleAbs = Abs(aCurAngle); + const Standard_Real aCurAngleAbs = std::abs(aCurAngle); // Check if vectors are opposite if (aCurAngleAbs > aAngTol && (M_PI - aCurAngleAbs) > aAngTol) { @@ -110,7 +110,7 @@ void BRepMesh_Classifier::RegisterWire(const NCollection_Sequence BRepMesh_ConeRangeSplitter::GetSplitStep const std::pair& aRangeU = GetRangeU(); const std::pair& aRangeV = GetRangeV(); - gp_Cone aCone = GetDFace()->GetSurface()->Cone(); - Standard_Real aRefR = aCone.RefRadius(); - Standard_Real aSAng = aCone.SemiAngle(); - Standard_Real aRadius = - Max(Abs(aRefR + aRangeV.first * Sin(aSAng)), Abs(aRefR + aRangeV.second * Sin(aSAng))); + gp_Cone aCone = GetDFace()->GetSurface()->Cone(); + Standard_Real aRefR = aCone.RefRadius(); + Standard_Real aSAng = aCone.SemiAngle(); + Standard_Real aRadius = std::max(std::abs(aRefR + aRangeV.first * std::sin(aSAng)), + std::abs(aRefR + aRangeV.second * std::sin(aSAng))); Standard_Real Dv, Du = GCPnts_TangentialDeflection::ArcAngularStep(aRadius, GetDFace()->GetDeflection(), @@ -41,7 +41,7 @@ std::pair BRepMesh_ConeRangeSplitter::GetSplitStep const Standard_Real aDiffU = aRangeU.second - aRangeU.first; const Standard_Real aDiffV = aRangeV.second - aRangeV.first; const Standard_Real aScale = (Du * aRadius); - const Standard_Real aRatio = Max(1., Log(aDiffV / aScale)); + const Standard_Real aRatio = std::max(1., std::log(aDiffV / aScale)); const Standard_Integer nbU = (Standard_Integer)(aDiffU / Du); const Standard_Integer nbV = (Standard_Integer)(aDiffV / aScale / aRatio); diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_CurveTessellator.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_CurveTessellator.cxx index 03a10afa86..ea576eb993 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_CurveTessellator.cxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_CurveTessellator.cxx @@ -77,22 +77,22 @@ void BRepMesh_CurveTessellator::init() aPreciseLinDef *= 0.5; } - aPreciseLinDef = Max(aPreciseLinDef, Precision::Confusion()); - aPreciseAngDef = Max(aPreciseAngDef, Precision::Angular()); + aPreciseLinDef = std::max(aPreciseLinDef, Precision::Confusion()); + aPreciseAngDef = std::max(aPreciseAngDef, Precision::Angular()); Standard_Real aMinSize = myParameters.MinSize; if (myParameters.AdjustMinSize) { - aMinSize = Min(aMinSize, - myParameters.RelMinSize() - * GCPnts_AbscissaPoint::Length(myCurve, - myCurve.FirstParameter(), - myCurve.LastParameter(), - aPreciseLinDef)); + aMinSize = std::min(aMinSize, + myParameters.RelMinSize() + * GCPnts_AbscissaPoint::Length(myCurve, + myCurve.FirstParameter(), + myCurve.LastParameter(), + aPreciseLinDef)); } mySquareEdgeDef = aPreciseLinDef * aPreciseLinDef; - mySquareMinSize = Max(mySquareEdgeDef, aMinSize * aMinSize); + mySquareMinSize = std::max(mySquareEdgeDef, aMinSize * aMinSize); myEdgeSqTol = BRep_Tool::Tolerance(myEdge); myEdgeSqTol *= myEdgeSqTol; @@ -111,7 +111,7 @@ void BRepMesh_CurveTessellator::init() break; } - const Standard_Integer aMinPntNb = Max(myMinPointsNb, aMinPntThreshold); // OCC287 + const Standard_Integer aMinPntNb = std::max(myMinPointsNb, aMinPntThreshold); // OCC287 myDiscretTool.Initialize(myCurve, myCurve.FirstParameter(), myCurve.LastParameter(), @@ -286,7 +286,7 @@ void BRepMesh_CurveTessellator::splitSegment(const Handle(Geom_Surface)& theSurf gp_Pnt P3dF, P3dL, midP3d, midP3dFromSurf; Standard_Real midpar; - if (Abs(theLast - theFirst) < 2 * Precision::PConfusion()) + if (std::abs(theLast - theFirst) < 2 * Precision::PConfusion()) { return; } diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_CylinderRangeSplitter.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_CylinderRangeSplitter.cxx index 9c747606b1..b5806760ae 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_CylinderRangeSplitter.cxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_CylinderRangeSplitter.cxx @@ -59,7 +59,7 @@ Handle(IMeshData::ListOfPnt2d) BRepMesh_CylinderRangeSplitter::GenerateSurfaceNo // of long cylinder with small radius. nbV = aDv > static_cast (IntegerLast()) ? 0 : (Standard_Integer) (aDv); - nbV = Min(nbV, 100 * nbU); + nbV = std::min(nbV, 100 * nbU); */ } @@ -89,6 +89,6 @@ void BRepMesh_CylinderRangeSplitter::computeDelta(const Standard_Real /*theLengt const Standard_Real theLengthV) { const std::pair& aRangeV = GetRangeV(); - myDelta.first = myDu / Max(theLengthV, aRangeV.second - aRangeV.first); - myDelta.second = 1.; + myDelta.first = myDu / std::max(theLengthV, aRangeV.second - aRangeV.first); + myDelta.second = 1.; } diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_DataStructureOfDelaun.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_DataStructureOfDelaun.cxx index 757db91df3..3bb97e543a 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_DataStructureOfDelaun.cxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_DataStructureOfDelaun.cxx @@ -83,7 +83,7 @@ Standard_Integer BRepMesh_DataStructureOfDelaun::AddLink(const BRepMesh_Edge& th else aLinkIndex = myLinks.Add(theLink, aPair); - const Standard_Integer aLinkId = Abs(aLinkIndex); + const Standard_Integer aLinkId = std::abs(aLinkIndex); linksConnectedTo(theLink.FirstNode()).Append(aLinkId); linksConnectedTo(theLink.LastNode()).Append(aLinkId); myLinksOfDomain.Add(aLinkIndex); @@ -111,7 +111,7 @@ Standard_Boolean BRepMesh_DataStructureOfDelaun::SubstituteLink(const Standard_I myLinks.Substitute(theIndex, aLink, aPair); cleanLink(theIndex, aLink); - const Standard_Integer aLinkId = Abs(theIndex); + const Standard_Integer aLinkId = std::abs(theIndex); linksConnectedTo(theNewLink.FirstNode()).Append(aLinkId); linksConnectedTo(theNewLink.LastNode()).Append(aLinkId); myLinks.Substitute(theIndex, theNewLink, aPair); diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_DefaultRangeSplitter.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_DefaultRangeSplitter.cxx index 52bb296d3f..b46a4a8057 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_DefaultRangeSplitter.cxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_DefaultRangeSplitter.cxx @@ -34,10 +34,10 @@ void BRepMesh_DefaultRangeSplitter::Reset(const IMeshData::IFaceHandle& theDFace void BRepMesh_DefaultRangeSplitter::AddPoint(const gp_Pnt2d& thePoint) { - myRangeU.first = Min(thePoint.X(), myRangeU.first); - myRangeU.second = Max(thePoint.X(), myRangeU.second); - myRangeV.first = Min(thePoint.Y(), myRangeV.first); - myRangeV.second = Max(thePoint.Y(), myRangeV.second); + myRangeU.first = std::min(thePoint.X(), myRangeU.first); + myRangeU.second = std::max(thePoint.X(), myRangeU.second); + myRangeV.first = std::min(thePoint.Y(), myRangeV.first); + myRangeV.second = std::max(thePoint.Y(), myRangeV.second); } //================================================================================================= @@ -122,8 +122,8 @@ void BRepMesh_DefaultRangeSplitter::computeTolerance(const Standard_Real /*theLe const Standard_Real aResV = aSurface.VResolution(aTolerance) * 1.1; const Standard_Real aDeflectionUV = 1.e-05; - myTolerance.first = Max(Min(aDeflectionUV, aResU), 1e-7 * aDiffU); - myTolerance.second = Max(Min(aDeflectionUV, aResV), 1e-7 * aDiffV); + myTolerance.first = std::max(std::min(aDeflectionUV, aResU), 1e-7 * aDiffU); + myTolerance.second = std::max(std::min(aDeflectionUV, aResV), 1e-7 * aDiffV); } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Deflection.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Deflection.cxx index 56019f7200..cd03128e2f 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Deflection.cxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Deflection.cxx @@ -48,7 +48,7 @@ Standard_Real BRepMesh_Deflection::ComputeAbsoluteDeflection( Standard_Real aX1, aY1, aZ1, aX2, aY2, aZ2; aBox.Get(aX1, aY1, aZ1, aX2, aY2, aZ2); const Standard_Real aMaxShapeSize = - (theMaxShapeSize > 0.0) ? theMaxShapeSize : Max(aX2 - aX1, Max(aY2 - aY1, aZ2 - aZ1)); + (theMaxShapeSize > 0.0) ? theMaxShapeSize : std::max(aX2 - aX1, std::max(aY2 - aY1, aZ2 - aZ1)); Standard_Real anAdjustmentCoefficient = aMaxShapeSize / (2 * aShapeSize); if (anAdjustmentCoefficient < 0.5) @@ -90,9 +90,9 @@ void BRepMesh_Deflection::ComputeDeflection(const IMeshData::IEdgeHandle& theDEd const Standard_Real aDistL = aLastVertex.IsNull() ? -1.0 : BRep_Tool::Pnt(aLastVertex).Distance(aCurve->Value(aLastParam)); - const Standard_Real aVertexAdjustDistance = Max(aDistF, aDistL); + const Standard_Real aVertexAdjustDistance = std::max(aDistF, aDistL); - aLinDeflection = Max(aVertexAdjustDistance, aLinDeflection); + aLinDeflection = std::max(aVertexAdjustDistance, aLinDeflection); } theDEdge->SetDeflection(aLinDeflection); @@ -147,9 +147,9 @@ void BRepMesh_Deflection::ComputeDeflection(const IMeshData::IFaceHandle& theDFa } aFaceDeflection = - Max(2. * BRepMesh_ShapeTool::MaxFaceTolerance(theDFace->GetFace()), aFaceDeflection); + std::max(2. * BRepMesh_ShapeTool::MaxFaceTolerance(theDFace->GetFace()), aFaceDeflection); } - aFaceDeflection = Max(aDeflection, aFaceDeflection); + aFaceDeflection = std::max(aDeflection, aFaceDeflection); theDFace->SetDeflection(aFaceDeflection); } diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_DelabellaBaseMeshAlgo.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_DelabellaBaseMeshAlgo.cxx index 32fb0e7e23..1bf6f84831 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_DelabellaBaseMeshAlgo.cxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_DelabellaBaseMeshAlgo.cxx @@ -148,7 +148,7 @@ void BRepMesh_DelabellaBaseMeshAlgo::buildBaseTriangulation() const BRepMesh_Edge aLink(aNodes[k], aNodes[(k + 1) % 3], BRepMesh_Free); const Standard_Integer aLinkInfo = aStructure->AddLink(aLink); - aEdges[k] = Abs(aLinkInfo); + aEdges[k] = std::abs(aLinkInfo); aOrientations[k] = aLinkInfo > 0; } diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Delaun.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Delaun.cxx index d216a50527..f26740ebea 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Delaun.cxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Delaun.cxx @@ -296,8 +296,8 @@ void BRepMesh_Delaun::initCirclesTool(const Bnd_Box2d& theBox, } myCircles.SetMinMaxSize(gp_XY(aMinX, aMinY), gp_XY(aMaxX, aMaxY)); - myCircles.SetCellSize(aDeltaX / Max(theCellsCountU, aScaler), - aDeltaY / Max(theCellsCountV, aScaler)); + myCircles.SetCellSize(aDeltaX / std::max(theCellsCountU, aScaler), + aDeltaY / std::max(theCellsCountV, aScaler)); myInitCircles = Standard_True; } @@ -344,8 +344,8 @@ void BRepMesh_Delaun::superMesh(const Bnd_Box2d& theBox) Standard_Real aDeltaX = aMaxX - aMinX; Standard_Real aDeltaY = aMaxY - aMinY; - Standard_Real aDeltaMin = Min(aDeltaX, aDeltaY); - Standard_Real aDeltaMax = Max(aDeltaX, aDeltaY); + Standard_Real aDeltaMin = std::min(aDeltaX, aDeltaY); + Standard_Real aDeltaMax = std::max(aDeltaX, aDeltaY); Standard_Real aDelta = aDeltaX + aDeltaY; mySupVert.Append( @@ -366,7 +366,7 @@ void BRepMesh_Delaun::superMesh(const Bnd_Box2d& theBox) Standard_Integer aLinkIndex = myMeshData->AddLink( BRepMesh_Edge(mySupVert[aFirstNode], mySupVert[aLastNode], BRepMesh_Free)); - e[aNodeId] = Abs(aLinkIndex); + e[aNodeId] = std::abs(aLinkIndex); o[aNodeId] = (aLinkIndex > 0); } @@ -512,7 +512,7 @@ void BRepMesh_Delaun::createTriangles(const Standard_Integer theVertexI Standard_Real aDist12 = aFirstLinkDir ^ anEdgeDir; Standard_Real aDist23 = anEdgeDir ^ aLastLinkDir; - if (Abs(aDist12) < Precision || Abs(aDist23) < Precision) + if (std::abs(aDist12) < Precision || std::abs(aDist23) < Precision) { continue; } @@ -532,7 +532,7 @@ void BRepMesh_Delaun::createTriangles(const Standard_Integer theVertexI for (Standard_Integer aTriLinkIt = 0; aTriLinkIt < 3; ++aTriLinkIt) { const Standard_Integer& anEdgeInfo = anEdgesInfo[aTriLinkIt]; - anEdgeIds[aTriLinkIt] = Abs(anEdgeInfo); + anEdgeIds[aTriLinkIt] = std::abs(anEdgeInfo); anEdgesOri[aTriLinkIt] = anEdgeInfo > 0; } @@ -546,9 +546,9 @@ void BRepMesh_Delaun::createTriangles(const Standard_Integer theVertexI aLoopEdges.Append(-anEdges.Key()); if (aFirstLinkDir.SquareModulus() > aLastLinkDir.SquareModulus()) - anExternalEdges.Append(Abs(anEdgesInfo[0])); + anExternalEdges.Append(std::abs(anEdgesInfo[0])); else - anExternalEdges.Append(Abs(anEdgesInfo[2])); + anExternalEdges.Append(std::abs(anEdgesInfo[2])); } } @@ -556,7 +556,7 @@ void BRepMesh_Delaun::createTriangles(const Standard_Integer theVertexI while (!anExternalEdges.IsEmpty()) { const BRepMesh_PairOfIndex& aPair = - myMeshData->ElementsConnectedTo(Abs(anExternalEdges.First())); + myMeshData->ElementsConnectedTo(std::abs(anExternalEdges.First())); if (!aPair.IsEmpty()) deleteTriangle(aPair.FirstIndex(), thePoly); @@ -572,11 +572,11 @@ void BRepMesh_Delaun::createTriangles(const Standard_Integer theVertexI while (!aLoopEdges.IsEmpty()) { - const BRepMesh_Edge& anEdge = GetEdge(Abs(aLoopEdges.First())); + const BRepMesh_Edge& anEdge = GetEdge(std::abs(aLoopEdges.First())); if (anEdge.Movability() != BRepMesh_Deleted) { Standard_Integer anEdgeIdx = aLoopEdges.First(); - meshLeftPolygonOf(Abs(anEdgeIdx), (anEdgeIdx > 0)); + meshLeftPolygonOf(std::abs(anEdgeIdx), (anEdgeIdx > 0)); } aLoopEdges.RemoveFirst(); @@ -1093,7 +1093,7 @@ Standard_Boolean BRepMesh_Delaun::meshLeftPolygonOf(const Standard_Integer return Standard_False; // Return to the previous point - Standard_Integer aDeadLinkId = Abs(aPolygon.Last()); + Standard_Integer aDeadLinkId = std::abs(aPolygon.Last()); aDeadLinks.Add(aDeadLinkId); aLeprousLinks.Remove(aDeadLinkId); @@ -1101,7 +1101,7 @@ Standard_Boolean BRepMesh_Delaun::meshLeftPolygonOf(const Standard_Integer aBoxes.Remove(aBoxes.Length()); Standard_Integer aPrevLinkInfo = aPolygon.Last(); - const BRepMesh_Edge& aPrevLink = GetEdge(Abs(aPrevLinkInfo)); + const BRepMesh_Edge& aPrevLink = GetEdge(std::abs(aPrevLinkInfo)); if (aPrevLinkInfo > 0) { @@ -1162,7 +1162,7 @@ Standard_Integer BRepMesh_Delaun::findNextPolygonLink( for (; aLinkIt.More(); aLinkIt.Next()) { const Standard_Integer& aNeighbourLinkInfo = aLinkIt.Value(); - Standard_Integer aNeighbourLinkId = Abs(aNeighbourLinkInfo); + Standard_Integer aNeighbourLinkId = std::abs(aNeighbourLinkInfo); if (theDeadLinks.Contains(aNeighbourLinkId) || (!theSkipped.IsNull() && theSkipped->Contains(aNeighbourLinkId))) @@ -1205,11 +1205,11 @@ Standard_Integer BRepMesh_Delaun::findNextPolygonLink( Standard_Boolean isCheckPointOnEdge = Standard_True; if (isFrontier) { - if (Abs(Abs(anAngle) - M_PI) < Precision::Angular()) + if (std::abs(std::abs(anAngle) - M_PI) < Precision::Angular()) { // Glued constrains - don't check intersection isCheckPointOnEdge = Standard_False; - anAngle = Abs(anAngle); + anAngle = std::abs(anAngle); } } @@ -1273,7 +1273,7 @@ Standard_Boolean BRepMesh_Delaun::checkIntersection(const BRepMesh_Edge& if (!theLinkBndBox.IsOut(thePolyBoxes.Value(aPolyIt))) { // intersection is possible... - Standard_Integer aPolyLinkId = Abs(thePolygon(aPolyIt)); + Standard_Integer aPolyLinkId = std::abs(thePolygon(aPolyIt)); const BRepMesh_Edge& aPolyLink = GetEdge(aPolyLinkId); // skip intersections between frontier edges @@ -1339,7 +1339,7 @@ void BRepMesh_Delaun::cleanupPolygon(const IMeshData::SequenceOfInteger& thePoly for (Standard_Integer aPolyIt = 1; aPolyIt <= aPolyLen; ++aPolyIt) { Standard_Integer aPolyEdgeInfo = thePolygon(aPolyIt); - Standard_Integer aPolyEdgeId = Abs(aPolyEdgeInfo); + Standard_Integer aPolyEdgeId = std::abs(aPolyEdgeInfo); anIgnoredEdges.Add(aPolyEdgeId); Standard_Boolean isForward = (aPolyEdgeInfo > 0); @@ -1550,7 +1550,7 @@ Standard_Boolean BRepMesh_Delaun::isVertexInsidePolygon( aPrevVertexDir = aCurVertexDir; } - if (Abs(Angle2PI - aTotalAng) > Precision::Angular()) + if (std::abs(Angle2PI - aTotalAng) > Precision::Angular()) return Standard_False; return Standard_True; @@ -1728,12 +1728,12 @@ void BRepMesh_Delaun::meshPolygon(IMeshData::SequenceOfInteger& thePolygon, // Check and correct boundary edges Standard_Integer aPolyLen = thePolygon.Length(); - const Standard_Real aPolyArea = Abs(polyArea(thePolygon, 1, aPolyLen)); + const Standard_Real aPolyArea = std::abs(polyArea(thePolygon, 1, aPolyLen)); const Standard_Real aSmallLoopArea = 0.001 * aPolyArea; for (Standard_Integer aPolyIt = 1; aPolyIt < aPolyLen; ++aPolyIt) { Standard_Integer aCurEdgeInfo = thePolygon(aPolyIt); - Standard_Integer aCurEdgeId = Abs(aCurEdgeInfo); + Standard_Integer aCurEdgeId = std::abs(aCurEdgeInfo); const BRepMesh_Edge* aCurEdge = &GetEdge(aCurEdgeId); if (aCurEdge->Movability() != BRepMesh_Frontier) continue; @@ -1750,7 +1750,7 @@ void BRepMesh_Delaun::meshPolygon(IMeshData::SequenceOfInteger& thePolygon, for (; aNextPolyIt <= aPolyLen; ++aNextPolyIt) { Standard_Integer aNextEdgeInfo = thePolygon(aNextPolyIt); - Standard_Integer aNextEdgeId = Abs(aNextEdgeInfo); + Standard_Integer aNextEdgeId = std::abs(aNextEdgeInfo); const BRepMesh_Edge* aNextEdge = &GetEdge(aNextEdgeId); if (aNextEdge->Movability() != BRepMesh_Frontier) continue; @@ -1777,17 +1777,17 @@ void BRepMesh_Delaun::meshPolygon(IMeshData::SequenceOfInteger& thePolygon, gp_Vec2d aVec2(anIntPnt, aNextPnts[0]); aLoopArea += (aVec1 ^ aVec2) / 2.; - if (Abs(aLoopArea) > aSmallLoopArea) + if (std::abs(aLoopArea) > aSmallLoopArea) { aNextNodes[1] = aCurNodes[0]; aNextPnts[1] = aCurPnts[0]; - aNextEdgeId = Abs(createAndReplacePolygonLink(aNextNodes, - aNextPnts, - aNextPolyIt, - BRepMesh_Delaun::Replace, - thePolygon, - thePolyBoxes)); + aNextEdgeId = std::abs(createAndReplacePolygonLink(aNextNodes, + aNextPnts, + aNextPolyIt, + BRepMesh_Delaun::Replace, + thePolygon, + thePolyBoxes)); processLoop(aPolyIt, aNextPolyIt, thePolygon, thePolyBoxes); return; @@ -1813,7 +1813,7 @@ void BRepMesh_Delaun::meshPolygon(IMeshData::SequenceOfInteger& thePolygon, { Standard_Integer aSkippedLinkIt = aPolyIt; for (; aSkippedLinkIt <= aIndexToRemoveTo; ++aSkippedLinkIt) - theSkipped->Add(Abs(thePolygon(aSkippedLinkIt))); + theSkipped->Add(std::abs(thePolygon(aSkippedLinkIt))); } } else if (aIntFlag == BRepMesh_GeomTool::PointOnSegment) @@ -1827,7 +1827,7 @@ void BRepMesh_Delaun::meshPolygon(IMeshData::SequenceOfInteger& thePolygon, // Check is second link touches the first one gp_Vec2d aVec1(aRefPoint, aNextPnts[0]); gp_Vec2d aVec2(aRefPoint, aNextPnts[1]); - if (Abs(aVec1 ^ aVec2) < Precision) + if (std::abs(aVec1 ^ aVec2) < Precision) { isFirstChopping = Standard_True; break; @@ -1899,12 +1899,12 @@ void BRepMesh_Delaun::meshPolygon(IMeshData::SequenceOfInteger& thePolygon, if (isAddReplacingEdge) { - aCurEdgeId = Abs(createAndReplacePolygonLink(aCurNodes, - aCurPnts, - aPolyIt, - BRepMesh_Delaun::Replace, - thePolygon, - thePolyBoxes)); + aCurEdgeId = std::abs(createAndReplacePolygonLink(aCurNodes, + aCurPnts, + aPolyIt, + BRepMesh_Delaun::Replace, + thePolygon, + thePolyBoxes)); aCurEdge = &GetEdge(aCurEdgeId); aCurVec = gp_Vec2d(aCurPnts[0], aCurPnts[1]); @@ -1983,7 +1983,7 @@ Standard_Boolean BRepMesh_Delaun::meshElementaryPolygon( for (Standard_Integer anEdgeIt = 0; anEdgeIt < 3; ++anEdgeIt) { Standard_Integer anEdgeInfo = thePolygon(anEdgeIt + 1); - anEdges[anEdgeIt] = Abs(anEdgeInfo); + anEdges[anEdgeIt] = std::abs(anEdgeInfo); anEdgesOri[anEdgeIt] = (anEdgeInfo > 0); } @@ -2017,7 +2017,7 @@ void BRepMesh_Delaun::decomposeSimplePolygon(IMeshData::SequenceOfInteger& thePo // Polygon contains more than 3 links Standard_Integer aFirstEdgeInfo = thePolygon(1); - const BRepMesh_Edge& aFirstEdge = GetEdge(Abs(aFirstEdgeInfo)); + const BRepMesh_Edge& aFirstEdge = GetEdge(std::abs(aFirstEdgeInfo)); Standard_Integer aNodes[3]; getOrientedNodes(aFirstEdge, aFirstEdgeInfo > 0, aNodes); @@ -2048,7 +2048,7 @@ void BRepMesh_Delaun::decomposeSimplePolygon(IMeshData::SequenceOfInteger& thePo for (Standard_Integer aLinkIt = 3; aLinkIt <= aPolyLen; ++aLinkIt) { Standard_Integer aLinkInfo = thePolygon(aLinkIt); - const BRepMesh_Edge& aNextEdge = GetEdge(Abs(aLinkInfo)); + const BRepMesh_Edge& aNextEdge = GetEdge(std::abs(aLinkInfo)); aPivotNode = aLinkInfo > 0 ? aNextEdge.FirstNode() : aNextEdge.LastNode(); @@ -2060,8 +2060,8 @@ void BRepMesh_Delaun::decomposeSimplePolygon(IMeshData::SequenceOfInteger& thePo gp_Vec2d aDistanceDir(aRefVertices[1], aPivotVertex); Standard_Real aDist = aRefEdgeDir ^ aDistanceDir; - Standard_Real aAngle = Abs(aRefEdgeDir.Angle(aDistanceDir)); - Standard_Real anAbsDist = Abs(aDist); + Standard_Real aAngle = std::abs(aRefEdgeDir.Angle(aDistanceDir)); + Standard_Real anAbsDist = std::abs(aDist); if (anAbsDist < Precision || aDist < 0.) continue; @@ -2090,7 +2090,7 @@ void BRepMesh_Delaun::decomposeSimplePolygon(IMeshData::SequenceOfInteger& thePo if (!aBox.IsOut(thePolyBoxes.Value(aCheckLinkIt))) { - const BRepMesh_Edge& aPolyLink = GetEdge(Abs(thePolygon(aCheckLinkIt))); + const BRepMesh_Edge& aPolyLink = GetEdge(std::abs(thePolygon(aCheckLinkIt))); if (aCheckLink.IsEqual(aPolyLink)) continue; @@ -2141,7 +2141,7 @@ void BRepMesh_Delaun::decomposeSimplePolygon(IMeshData::SequenceOfInteger& thePo for (Standard_Integer aTriEdgeIt = 0; aTriEdgeIt < 3; ++aTriEdgeIt) { const Standard_Integer& anEdgeInfo = aNewEdgesInfo[aTriEdgeIt]; - anEdges[aTriEdgeIt] = Abs(anEdgeInfo); + anEdges[aTriEdgeIt] = std::abs(anEdgeInfo); anEdgesOri[aTriEdgeIt] = anEdgeInfo > 0; } addTriangle(anEdges, anEdgesOri, aNodes); @@ -2533,7 +2533,7 @@ Standard_Real BRepMesh_Delaun::polyArea(const IMeshData::SequenceOfInteger& theP return aArea; } Standard_Integer aCurEdgeInfo = thePolygon(theStartIndex); - Standard_Integer aCurEdgeId = Abs(aCurEdgeInfo); + Standard_Integer aCurEdgeId = std::abs(aCurEdgeInfo); const BRepMesh_Edge* aCurEdge = &GetEdge(aCurEdgeId); Standard_Integer aNodes[2]; @@ -2544,7 +2544,7 @@ Standard_Real BRepMesh_Delaun::polyArea(const IMeshData::SequenceOfInteger& theP for (; aPolyIt <= theEndIndex; ++aPolyIt) { aCurEdgeInfo = thePolygon(aPolyIt); - aCurEdgeId = Abs(aCurEdgeInfo); + aCurEdgeId = std::abs(aCurEdgeInfo); aCurEdge = &GetEdge(aCurEdgeId); getOrientedNodes(*aCurEdge, aCurEdgeInfo > 0, aNodes); @@ -2594,7 +2594,7 @@ Standard_CString BRepMesh_DumpPoly(void* thePolygon, IMeshData::SequenceOfInteger::Iterator aLinksIt(aPolygon); for (; aLinksIt.More(); aLinksIt.Next()) { - const BRepMesh_Edge& aLink = aMeshData->GetLink(Abs(aLinksIt.Value())); + const BRepMesh_Edge& aLink = aMeshData->GetLink(std::abs(aLinksIt.Value())); gp_Pnt aPnt[2]; for (Standard_Integer i = 0; i < 2; ++i) diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_DelaunayDeflectionControlMeshAlgo.hxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_DelaunayDeflectionControlMeshAlgo.hxx index ed2a251daf..c1c44efc8b 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_DelaunayDeflectionControlMeshAlgo.hxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_DelaunayDeflectionControlMeshAlgo.hxx @@ -118,7 +118,7 @@ protected: if (!(myMaxSqDeflection < 0.)) { - this->getDFace()->SetDeflection(Sqrt(myMaxSqDeflection)); + this->getDFace()->SetDeflection(std::sqrt(myMaxSqDeflection)); } } @@ -148,7 +148,7 @@ private: Standard_Real SquareDeviation(const gp_Pnt& thePoint) const { - const Standard_Real aDeflection = Abs(myNormal.Dot(gp_Vec(myRefPnt, thePoint))); + const Standard_Real aDeflection = std::abs(myNormal.Dot(gp_Vec(myRefPnt, thePoint))); return aDeflection * aDeflection; } @@ -277,7 +277,7 @@ private: const gp_Vec2d aLink2d2(theNodesInfo[1].Point2d, theNodesInfo[2].Point2d); const Standard_Real MinimalArea2d = 1.e-9; - return (Abs(aLink2d1 ^ aLink2d2) > MinimalArea2d); + return (std::abs(aLink2d1 ^ aLink2d2) > MinimalArea2d); } //! Computes normal using two link vectors. diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_FaceChecker.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_FaceChecker.cxx index b657d7fb84..c103ee8462 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_FaceChecker.cxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_FaceChecker.cxx @@ -153,7 +153,7 @@ public: const Standard_Real aAngle = gp_Vec2d(mySegment->Point1->XY(), mySegment->Point2->XY()) .Angle(gp_Vec2d(aSegment.Point1->XY(), aSegment.Point2->XY())); - if (Abs(aAngle) < MaxTangentAngle) + if (std::abs(aAngle) < MaxTangentAngle) { return Standard_False; } @@ -177,7 +177,7 @@ public: aPrevVec = aCurVec; } - if (Abs(aSumS / 2.) < myMaxLoopSize) + if (std::abs(aSumS / 2.) < myMaxLoopSize) { return Standard_False; } diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_GeomTool.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_GeomTool.cxx index 095f5bdea2..ff19ea0c9b 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_GeomTool.cxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_GeomTool.cxx @@ -99,11 +99,12 @@ void AdjustCellsCounts(const Handle(Adaptor3d_Surface)& theFace, Standard_Real aSqNbVert = theNbVertices; if (aType == GeomAbs_Plane) { - theCellsCountU = theCellsCountV = (Standard_Integer)Ceiling(Pow(2, Log10(aSqNbVert))); + theCellsCountU = theCellsCountV = + (Standard_Integer)std::ceil(std::pow(2, std::log10(aSqNbVert))); } else if (aType == GeomAbs_Cylinder || aType == GeomAbs_Cone) { - theCellsCountV = (Standard_Integer)Ceiling(Pow(2, Log10(aSqNbVert))); + theCellsCountV = (Standard_Integer)std::ceil(std::pow(2, std::log10(aSqNbVert))); } else if (aType == GeomAbs_SurfaceOfExtrusion || aType == GeomAbs_SurfaceOfRevolution) { @@ -113,30 +114,30 @@ void AdjustCellsCounts(const Handle(Adaptor3d_Surface)& theFace, { // planar, cylindrical, conical cases if (aType == GeomAbs_SurfaceOfExtrusion) - theCellsCountU = (Standard_Integer)Ceiling(Pow(2, Log10(aSqNbVert))); + theCellsCountU = (Standard_Integer)std::ceil(std::pow(2, std::log10(aSqNbVert))); else - theCellsCountV = (Standard_Integer)Ceiling(Pow(2, Log10(aSqNbVert))); + theCellsCountV = (Standard_Integer)std::ceil(std::pow(2, std::log10(aSqNbVert))); } if (aType == GeomAbs_SurfaceOfExtrusion) { // V is always a line - theCellsCountV = (Standard_Integer)Ceiling(Pow(2, Log10(aSqNbVert))); + theCellsCountV = (Standard_Integer)std::ceil(std::pow(2, std::log10(aSqNbVert))); } } else if (aType == GeomAbs_BezierSurface || aType == GeomAbs_BSplineSurface) { if (theFace->UDegree() < 2) { - theCellsCountU = (Standard_Integer)Ceiling(Pow(2, Log10(aSqNbVert))); + theCellsCountU = (Standard_Integer)std::ceil(std::pow(2, std::log10(aSqNbVert))); } if (theFace->VDegree() < 2) { - theCellsCountV = (Standard_Integer)Ceiling(Pow(2, Log10(aSqNbVert))); + theCellsCountV = (Standard_Integer)std::ceil(std::pow(2, std::log10(aSqNbVert))); } } - theCellsCountU = Max(theCellsCountU, 2); - theCellsCountV = Max(theCellsCountV, 2); + theCellsCountU = std::max(theCellsCountU, 2); + theCellsCountV = std::max(theCellsCountV, 2); } } // namespace @@ -297,10 +298,10 @@ BRepMesh_GeomTool::IntFlag BRepMesh_GeomTool::IntLinLin(const gp_XY& theStartPnt const Standard_Real aPrec = gp::Resolution(); // Are edgegs codirectional - if (Abs(aCrossD1D2) < aPrec) + if (std::abs(aCrossD1D2) < aPrec) { // Just a parallel case? - if (Abs(aCrossD1D3) < aPrec) + if (std::abs(aCrossD1D3) < aPrec) return BRepMesh_GeomTool::Same; else return BRepMesh_GeomTool::NoIntersection; @@ -442,25 +443,26 @@ std::pair BRepMesh_GeomTool::CellsCount( Standard_Integer aCellsCountU, aCellsCountV; if (aType == GeomAbs_Torus) { - aCellsCountU = - (Standard_Integer)Ceiling(Pow(2, Log10((aRangeU.second - aRangeU.first) / aDelta.first))); - aCellsCountV = - (Standard_Integer)Ceiling(Pow(2, Log10((aRangeV.second - aRangeV.first) / aDelta.second))); + aCellsCountU = (Standard_Integer)std::ceil( + std::pow(2, std::log10((aRangeU.second - aRangeU.first) / aDelta.first))); + aCellsCountV = (Standard_Integer)std::ceil( + std::pow(2, std::log10((aRangeV.second - aRangeV.first) / aDelta.second))); } else if (aType == GeomAbs_Cylinder) { - aCellsCountU = (Standard_Integer)Ceiling(Pow( - 2, - Log10((aRangeU.second - aRangeU.first) / aDelta.first / (aRangeV.second - aRangeV.first)))); - aCellsCountV = - (Standard_Integer)Ceiling(Pow(2, Log10((aRangeV.second - aRangeV.first) / anErrFactorV))); + aCellsCountU = (Standard_Integer)std::ceil( + std::pow(2, + std::log10((aRangeU.second - aRangeU.first) / aDelta.first + / (aRangeV.second - aRangeV.first)))); + aCellsCountV = (Standard_Integer)std::ceil( + std::pow(2, std::log10((aRangeV.second - aRangeV.first) / anErrFactorV))); } else { - aCellsCountU = (Standard_Integer)Ceiling( - Pow(2, Log10((aRangeU.second - aRangeU.first) / aDelta.first / anErrFactorU))); - aCellsCountV = (Standard_Integer)Ceiling( - Pow(2, Log10((aRangeV.second - aRangeV.first) / aDelta.second / anErrFactorV))); + aCellsCountU = (Standard_Integer)std::ceil( + std::pow(2, std::log10((aRangeU.second - aRangeU.first) / aDelta.first / anErrFactorU))); + aCellsCountV = (Standard_Integer)std::ceil( + std::pow(2, std::log10((aRangeV.second - aRangeV.first) / aDelta.second / anErrFactorV))); } AdjustCellsCounts(theSurface, theVerticesNb, aCellsCountU, aCellsCountV); @@ -478,7 +480,7 @@ Standard_Integer BRepMesh_GeomTool::classifyPoint(const gp_XY& thePoint1, constexpr Standard_Real aPrec = Precision::PConfusion(); const Standard_Real aSqPrec = aPrec * aPrec; - Standard_Real aDist = Abs(aP1 ^ aP2); + Standard_Real aDist = std::abs(aP1 ^ aP2); if (aDist > aPrec) { aDist = (aDist * aDist) / aP1.SquareModulus(); diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_IncrementalMesh.hxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_IncrementalMesh.hxx index 13a2bff7ee..e657ca23e8 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_IncrementalMesh.hxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_IncrementalMesh.hxx @@ -90,9 +90,10 @@ private: if (myParameters.MinSize < Precision::Confusion()) { - myParameters.MinSize = Max(IMeshTools_Parameters::RelMinSize() - * Min(myParameters.Deflection, myParameters.DeflectionInterior), - Precision::Confusion()); + myParameters.MinSize = + (std::max)(IMeshTools_Parameters::RelMinSize() + * (std::min)(myParameters.Deflection, myParameters.DeflectionInterior), + Precision::Confusion()); } if (myParameters.Angle < Precision::Angular()) diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_MeshTool.hxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_MeshTool.hxx index 54fd5f1248..6aa2f47b87 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_MeshTool.hxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_MeshTool.hxx @@ -52,7 +52,7 @@ public: if (aNodeVec.SquareMagnitude() > gp::Resolution()) { const Standard_Real aCross = aNodeVec.Crossed(myConstraint.Direction()); - if (Abs(aCross) > gp::Resolution()) + if (std::abs(aCross) > gp::Resolution()) { return mySign ? aCross < 0. : aCross > 0.; } @@ -123,7 +123,7 @@ public: const Standard_Integer aLinkIt = myStructure->AddLink(BRepMesh_Edge(theFirstNode, theLastNode, BRepMesh_Free)); - theLinkIndex = Abs(aLinkIt); + theLinkIndex = std::abs(aLinkIt); theLinkOri = (aLinkIt > 0); } diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ModelBuilder.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ModelBuilder.cxx index 6b92122c4b..f546e489af 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ModelBuilder.cxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ModelBuilder.cxx @@ -56,7 +56,7 @@ Handle(IMeshData_Model) BRepMesh_ModelBuilder::performInternal( } else { - aModel->SetMaxSize(Max(theParameters.Deflection, theParameters.DeflectionInterior)); + aModel->SetMaxSize(std::max(theParameters.Deflection, theParameters.DeflectionInterior)); } Handle(IMeshTools_ShapeVisitor) aVisitor = new BRepMesh_ShapeVisitor(aModel); diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ModelHealer.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ModelHealer.cxx index e79c529b66..616a642d03 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ModelHealer.cxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ModelHealer.cxx @@ -54,7 +54,7 @@ public: Standard_Integer aPointsNb = aDEdge->GetCurve()->ParametersNb(); aDEdge->Clear(Standard_True); - aDEdge->SetDeflection(Max(aDEdge->GetDeflection() / 3., Precision::Confusion())); + aDEdge->SetDeflection(std::max(aDEdge->GetDeflection() / 3., Precision::Confusion())); for (Standard_Integer aPCurveIt = 0; aPCurveIt < aDEdge->PCurvesNb(); ++aPCurveIt) { @@ -419,11 +419,11 @@ TopoDS_Vertex BRepMesh_ModelHealer::getCommonVertex(const IMeshData::IEdgeHandle const Standard_Real aTol2_1 = BRep_Tool::Tolerance(aVertex2_1); const Standard_Real aTol2_2 = BRep_Tool::Tolerance(aVertex2_2); - if (isInToleranceWithSomeOf(aPnt1_1, aPnt2_1, aPnt2_2, aTol1_1 + Max(aTol2_1, aTol2_2))) + if (isInToleranceWithSomeOf(aPnt1_1, aPnt2_1, aPnt2_2, aTol1_1 + std::max(aTol2_1, aTol2_2))) { return aVertex1_1; } - else if (isInToleranceWithSomeOf(aPnt1_2, aPnt2_1, aPnt2_2, aTol1_2 + Max(aTol2_1, aTol2_2))) + else if (isInToleranceWithSomeOf(aPnt1_2, aPnt2_1, aPnt2_2, aTol1_2 + std::max(aTol2_1, aTol2_2))) { return aVertex1_2; } diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ModelPreProcessor.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ModelPreProcessor.cxx index 22473306de..830ae9d3bf 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ModelPreProcessor.cxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ModelPreProcessor.cxx @@ -136,7 +136,7 @@ public: { if (aDEdge->GetCurve()->ParametersNb() == 2) { - if (splitEdge(aDEdge, aDFace, Abs(getConeStep(aDFace)))) + if (splitEdge(aDEdge, aDFace, std::abs(getConeStep(aDFace)))) { TopLoc_Location aLoc; const Handle(Poly_Triangulation)& aTriangulation = @@ -198,14 +198,14 @@ private: // Calculate the step by parameter of the curve. const gp_Pnt2d& aFPntOfIPC1 = aIPC1->GetPoint(0); const gp_Pnt2d& aLPntOfIPC1 = aIPC1->GetPoint(aIPC1->ParametersNb() - 1); - const Standard_Real aMod = Abs(aFPntOfIPC1.Y() - aLPntOfIPC1.Y()); + const Standard_Real aMod = std::abs(aFPntOfIPC1.Y() - aLPntOfIPC1.Y()); if (aMod < gp::Resolution()) { return Standard_False; } - const Standard_Real aDT = Abs(aLParam - aFParam) / aMod * theDU; + const Standard_Real aDT = std::abs(aLParam - aFParam) / aMod * theDU; if (!splitCurve(aHC, theDEdge->GetCurve(), aDT)) { @@ -230,7 +230,7 @@ private: // Select the correct pcurve of the seam-edge. const gp_Pnt2d& aFPntOfPC1 = aPC1->Value(aPC1->FirstParameter()); - if (Abs(aLPntOfIPC1.X() - aFPntOfPC1.X()) > Precision::Confusion()) + if (std::abs(aLPntOfIPC1.X() - aFPntOfPC1.X()) > Precision::Confusion()) { std::swap(aPC1, aPC2); } diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_NURBSRangeSplitter.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_NURBSRangeSplitter.cxx index 91d74c0b3d..9e52c8ff5f 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_NURBSRangeSplitter.cxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_NURBSRangeSplitter.cxx @@ -551,14 +551,14 @@ Handle(IMeshData::SequenceOfReal) BRepMesh_NURBSRangeSplitter::computeGrainAndFi } const Handle(BRepAdaptor_Surface)& aSurface = GetSurface(); - const Standard_Real aMinSize2d = - Max(aSurface->UResolution(theParameters.MinSize), aSurface->VResolution(theParameters.MinSize)); + const Standard_Real aMinSize2d = std::max(aSurface->UResolution(theParameters.MinSize), + aSurface->VResolution(theParameters.MinSize)); - aMinDiff = Max(aMinSize2d, aMinDiff); + aMinDiff = std::max(aMinSize2d, aMinDiff); const Standard_Real aDiffMaxLim = 0.1 * theRangeDiff; - const Standard_Real aDiffMinLim = Max(0.005 * theRangeDiff, 2. * theTol2d); - const Standard_Real aDiff = Max(aMinSize2d, Min(aDiffMaxLim, aDiffMinLim)); + const Standard_Real aDiffMinLim = std::max(0.005 * theRangeDiff, 2. * theTol2d); + const Standard_Real aDiff = std::max(aMinSize2d, std::min(aDiffMaxLim, aDiffMinLim)); return filterParameters(theSourceParams, aMinDiff, aDiff, theAllocator); } diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_NodeInsertionMeshAlgo.hxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_NodeInsertionMeshAlgo.hxx index 5c0815e36d..a8c69965bc 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_NodeInsertionMeshAlgo.hxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_NodeInsertionMeshAlgo.hxx @@ -156,7 +156,7 @@ private: // aPCurve->ParametersNb() == 0 aEndIndex = aPCurve->ParametersNb() - 1; - aPointIt = Min(0, aEndIndex); + aPointIt = (std::min)(0, aEndIndex); aInc = 1; } else @@ -165,7 +165,7 @@ private: // aPCurve->ParametersNb() == 0 aPointIt = aPCurve->ParametersNb() - 1; - aEndIndex = Min(0, aPointIt); + aEndIndex = (std::min)(0, aPointIt); aInc = -1; } diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ShapeTool.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ShapeTool.cxx index cd6699e730..48baa2e101 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ShapeTool.cxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_ShapeTool.cxx @@ -70,10 +70,10 @@ Standard_Real BRepMesh_ShapeTool::MaxFaceTolerance(const TopoDS_Face& theFace) { Standard_Real aMaxTolerance = BRep_Tool::Tolerance(theFace); - Standard_Real aTolerance = Max(MaxTolerance(theFace), - MaxTolerance(theFace)); + Standard_Real aTolerance = std::max(MaxTolerance(theFace), + MaxTolerance(theFace)); - return Max(aMaxTolerance, aTolerance); + return std::max(aMaxTolerance, aTolerance); } //================================================================================================= @@ -86,7 +86,7 @@ void BRepMesh_ShapeTool::BoxMaxDimension(const Bnd_Box& theBox, Standard_Real& t Standard_Real aMinX, aMinY, aMinZ, aMaxX, aMaxY, aMaxZ; theBox.Get(aMinX, aMinY, aMinZ, aMaxX, aMaxY, aMaxZ); - theMaxDimension = Max(aMaxX - aMinX, Max(aMaxY - aMinY, aMaxZ - aMinZ)); + theMaxDimension = std::max(aMaxX - aMinX, std::max(aMaxY - aMinY, aMaxZ - aMinZ)); } //================================================================================================= @@ -119,8 +119,8 @@ void BRepMesh_ShapeTool::CheckAndUpdateFlags(const IMeshData::IEdgeHandle& the { const Standard_Real aDiffFirst = aCurveOnSurf.FirstParameter() - aFirstParam; const Standard_Real aDiffLast = aCurveOnSurf.LastParameter() - aLastParam; - theEdge->SetSameRange(Abs(aDiffFirst) < Precision::PConfusion() - && Abs(aDiffLast) < Precision::PConfusion()); + theEdge->SetSameRange(std::abs(aDiffFirst) < Precision::PConfusion() + && std::abs(aDiffLast) < Precision::PConfusion()); if (!theEdge->GetSameRange()) { diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_TorusRangeSplitter.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_TorusRangeSplitter.cxx index 36955316d0..651e495857 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_TorusRangeSplitter.cxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_TorusRangeSplitter.cxx @@ -40,7 +40,7 @@ Handle(IMeshData::ListOfPnt2d) BRepMesh_TorusRangeSplitter::GenerateSurfaceNodes Standard_Real Dv = 0.9 * oldDv; // TWOTHIRD * oldDv; Dv = oldDv; - const Standard_Integer nbV = Max((Standard_Integer)(aDiffV / Dv), 2); + const Standard_Integer nbV = std::max((Standard_Integer)(aDiffV / Dv), 2); Dv = aDiffV / (nbV + 1); Standard_Real Du; @@ -58,15 +58,15 @@ Handle(IMeshData::ListOfPnt2d) BRepMesh_TorusRangeSplitter::GenerateSurfaceNodes return Handle(IMeshData::ListOfPnt2d)(); } - Du *= Min(oldDv, Du) / aa; + Du *= std::min(oldDv, Du) / aa; } else { Du = Dv; } - Standard_Integer nbU = Max((Standard_Integer)(aDiffU / Du), 2); - nbU = Max(nbU, (Standard_Integer)(nbV * aDiffU * R / (aDiffV * r) / 5.)); + Standard_Integer nbU = std::max((Standard_Integer)(aDiffU / Du), 2); + nbU = std::max(nbU, (Standard_Integer)(nbV * aDiffU * R / (aDiffV * r) / 5.)); Du = aDiffU / (nbU + 1); const Handle(NCollection_IncAllocator) aTmpAlloc = @@ -147,9 +147,9 @@ Handle(IMeshData::SequenceOfReal) BRepMesh_TorusRangeSplitter::fillParams( } // Calculate DU, leave array of parameters - const Standard_Real aDiff = Abs(theRange.second - theRange.first); + const Standard_Real aDiff = std::abs(theRange.second - theRange.first); Standard_Real aStep = FUN_CalcAverageDUV(aParamArray, aLength); - aStep = Max(aStep, aDiff / (Standard_Real)theStepsNb / 2.); + aStep = std::max(aStep, aDiff / (Standard_Real)theStepsNb / 2.); Standard_Real aStdStep = aDiff / (Standard_Real)aLength; if (aStep > aStdStep) @@ -167,7 +167,7 @@ Handle(IMeshData::SequenceOfReal) BRepMesh_TorusRangeSplitter::fillParams( const Standard_Integer aParamsLength = aParams->Length(); for (Standard_Integer i = 1; i <= aParamsLength && isToInsert; ++i) { - isToInsert = (Abs(aParams->Value(i) - pp) > aStdStep); + isToInsert = (std::abs(aParams->Value(i) - pp) > aStdStep); } if (isToInsert) @@ -202,7 +202,7 @@ Standard_Real BRepMesh_TorusRangeSplitter::FUN_CalcAverageDUV(TColStd_Array1OfRe // Accumulate if (i != 1) { - p = Abs(P(i) - P(i - 1)); + p = std::abs(P(i) - P(i - 1)); if (p > 1.e-7) { result += p; diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Vertex.hxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Vertex.hxx index 6fca278d5f..ce1b86c0b3 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Vertex.hxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_Vertex.hxx @@ -117,7 +117,7 @@ struct hash size_t operator()(const BRepMesh_Vertex& theVertex) const noexcept { return std::hash{}( - (Floor(1e5 * theVertex.Coord().X()) * Floor(1e5 * theVertex.Coord().Y()))); + (std::floor(1e5 * theVertex.Coord().X()) * std::floor(1e5 * theVertex.Coord().Y()))); } }; } // namespace std diff --git a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_VertexTool.cxx b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_VertexTool.cxx index fa786cd4d3..4a9ba74640 100644 --- a/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_VertexTool.cxx +++ b/src/ModelingAlgorithms/TKMesh/BRepMesh/BRepMesh_VertexTool.cxx @@ -31,7 +31,7 @@ NCollection_CellFilter_Action BRepMesh_VertexInspector::Inspect(const Standard_I gp_XY aVec = (myPoint - aVertex.Coord()); Standard_Boolean inTol; - if (Abs(myTolerance[1]) < Precision::Confusion()) + if (std::abs(myTolerance[1]) < Precision::Confusion()) { inTol = aVec.SquareModulus() < myTolerance[0]; } diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset.cxx index 233967b689..40d1bf7b5f 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset.cxx @@ -76,7 +76,7 @@ Handle(Geom_Surface) BRepOffset::Surface(const Handle(Geom_Surface)& Surface, else if (Radius <= -Tol) { Axis.Rotate(gp_Ax1(Axis.Location(), Axis.Direction()), M_PI); - Result = new Geom_CylindricalSurface(Axis, Abs(Radius)); + Result = new Geom_CylindricalSurface(Axis, std::abs(Radius)); theStatus = BRepOffset_Reversed; } else @@ -88,19 +88,19 @@ Handle(Geom_Surface) BRepOffset::Surface(const Handle(Geom_Surface)& Surface, { Handle(Geom_ConicalSurface) C = Handle(Geom_ConicalSurface)::DownCast(Surface); Standard_Real Alpha = C->SemiAngle(); - Standard_Real Radius = C->RefRadius() + Offset * Cos(Alpha); + Standard_Real Radius = C->RefRadius() + Offset * std::cos(Alpha); gp_Ax3 Axis = C->Position(); if (Radius >= 0.) { gp_Vec Z(Axis.Direction()); - Z *= -Offset * Sin(Alpha); + Z *= -Offset * std::sin(Alpha); Axis.Translate(Z); } else { Radius = -Radius; gp_Vec Z(Axis.Direction()); - Z *= -Offset * Sin(Alpha); + Z *= -Offset * std::sin(Alpha); Axis.Translate(Z); Axis.Rotate(gp_Ax1(Axis.Location(), Axis.Direction()), M_PI); Alpha = -Alpha; diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Analyse.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Analyse.cxx index bad7747a7f..123b3ec461 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Analyse.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Analyse.cxx @@ -153,7 +153,7 @@ Standard_Boolean CheckMixedContinuity(const TopoDS_Edge& theEdge, return aMixedCont; } // But we caqnnot trust result, if it is C0. because this value set by default. - Standard_Real TolC0 = Max(0.001, 1.5 * BRep_Tool::Tolerance(theEdge)); + Standard_Real TolC0 = std::max(0.001, 1.5 * BRep_Tool::Tolerance(theEdge)); Standard_Real aFirst; Standard_Real aLast; @@ -309,7 +309,7 @@ void BRepOffset_Analyse::Perform(const TopoDS_Shape& S, myDescendants.Clear(); myAngle = Angle; - Standard_Real SinTol = Abs(Sin(Angle)); + Standard_Real SinTol = std::abs(std::sin(Angle)); // Build ancestors. BuildAncestors(S, myAncestors); @@ -412,12 +412,12 @@ void BRepOffset_Analyse::TreatTangentFaces(const TopTools_ListOfShape& theLE, const Standard_Real* pOffsetVal1 = myFaceOffsetMap.Seek(aF1); const Standard_Real* pOffsetVal2 = myFaceOffsetMap.Seek(aF2); - const Standard_Real anOffsetVal1 = pOffsetVal1 ? Abs(*pOffsetVal1) : myOffset; - const Standard_Real anOffsetVal2 = pOffsetVal2 ? Abs(*pOffsetVal2) : myOffset; + const Standard_Real anOffsetVal1 = pOffsetVal1 ? std::abs(*pOffsetVal1) : myOffset; + const Standard_Real anOffsetVal2 = pOffsetVal2 ? std::abs(*pOffsetVal2) : myOffset; if (anOffsetVal1 != anOffsetVal2) { BRep_Builder().Add(aCETangent, aE); - anEdgeOffsetMap.Bind(aE, Max(anOffsetVal1, anOffsetVal2)); + anEdgeOffsetMap.Bind(aE, std::max(anOffsetVal1, anOffsetVal2)); const TopoDS_Shape& aFMin = anOffsetVal1 < anOffsetVal2 ? aF1 : aF2; for (TopoDS_Iterator itV(aE); itV.More(); itV.Next()) @@ -493,7 +493,7 @@ void BRepOffset_Analyse::TreatTangentFaces(const TopTools_ListOfShape& theLE, Handle(IntTools_Context) aCtx = new IntTools_Context(); // Tangency criteria - Standard_Real aSinTol = Abs(Sin(myAngle)); + Standard_Real aSinTol = std::abs(std::sin(myAngle)); // Make blocks of connected edges TopTools_ListOfListOfShape aLCB; @@ -546,7 +546,7 @@ void BRepOffset_Analyse::TreatTangentFaces(const TopTools_ListOfShape& theLE, { BRep_Builder().Add(aBlock, aE2.Oriented(TopAbs_FORWARD)); aMFence.Add(aE2); - anOffset = Max(anOffset, anEdgeOffsetMap.Find(aE2)); + anOffset = std::max(anOffset, anEdgeOffsetMap.Find(aE2)); } } @@ -572,8 +572,8 @@ void BRepOffset_Analyse::TreatTangentFaces(const TopTools_ListOfShape& theLE, const Standard_Real* pOffsetVal1 = myFaceOffsetMap.Seek(aF1); const Standard_Real* pOffsetVal2 = myFaceOffsetMap.Seek(aF2); - const Standard_Real anOffsetVal1 = pOffsetVal1 ? Abs(*pOffsetVal1) : myOffset; - const Standard_Real anOffsetVal2 = pOffsetVal2 ? Abs(*pOffsetVal2) : myOffset; + const Standard_Real anOffsetVal1 = pOffsetVal1 ? std::abs(*pOffsetVal1) : myOffset; + const Standard_Real anOffsetVal2 = pOffsetVal2 ? std::abs(*pOffsetVal2) : myOffset; const TopoDS_Shape& aFToRemove = anOffsetVal1 > anOffsetVal2 ? aF1 : aF2; const TopoDS_Shape& aFOpposite = anOffsetVal1 > anOffsetVal2 ? aF2 : aF1; diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Inter2d.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Inter2d.cxx index 5a024fda04..7aed52d35b 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Inter2d.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Inter2d.cxx @@ -118,7 +118,7 @@ static Standard_Integer DefineClosedness(const TopoDS_Face& theFace) gp_Vec2d aTangent = aPCurve->DN(fpar, 1); Standard_Real aCrossProd1 = aTangent ^ gp::DX2d(); Standard_Real aCrossProd2 = aTangent ^ gp::DY2d(); - if (Abs(aCrossProd2) < Abs(aCrossProd1)) // pcurve is parallel to OY + if (std::abs(aCrossProd2) < std::abs(aCrossProd1)) // pcurve is parallel to OY return 1; else return 2; @@ -203,9 +203,9 @@ static void GetEdgesOrientedInFace(const TopoDS_Shape& theShape, Standard_Real aParam2 = BRep_Tool::Parameter(aVertex, anEdge2); BRepAdaptor_Curve2d aBAcurve1(anEdge1, theFace); BRepAdaptor_Curve2d aBAcurve2(anEdge2, theFace); - gp_Pnt2d aPnt1 = aBAcurve1.Value(aParam1); - gp_Pnt2d aPnt2 = aBAcurve2.Value(aParam2); - Standard_Real aDelta = Abs(aPnt1.Coord(IndCoord) - aPnt2.Coord(IndCoord)); + gp_Pnt2d aPnt1 = aBAcurve1.Value(aParam1); + gp_Pnt2d aPnt2 = aBAcurve2.Value(aParam2); + Standard_Real aDelta = std::abs(aPnt1.Coord(IndCoord) - aPnt2.Coord(IndCoord)); if (aDelta > aMaxDelta) { aMaxDelta = aDelta; @@ -442,7 +442,7 @@ static void EdgeInter(const TopoDS_Face& F, BRepLib::BuildCurve3d(E2); Standard_Real TolSum = BRep_Tool::Tolerance(E1) + BRep_Tool::Tolerance(E2); - TolSum = Max(TolSum, 1.e-5); + TolSum = std::max(TolSum, 1.e-5); TColgp_SequenceOfPnt ResPoints; TColStd_SequenceOfReal ResParamsOnE1, ResParamsOnE2; @@ -508,8 +508,8 @@ static void EdgeInter(const TopoDS_Face& F, dist1 = P1.Distance(P); dist2 = P2.Distance(P); dist3 = P1.Distance(P2); - dist1 = Max(dist1, dist2); - dist1 = Max(dist1, dist3); + dist1 = std::max(dist1, dist2); + dist1 = std::max(dist1, dist3); B.UpdateVertex(aNewVertex, dist1); #ifdef OCCT_DEBUG @@ -553,7 +553,7 @@ static void EdgeInter(const TopoDS_Face& F, V2or.Reverse(); Standard_Real CrossProd = V2or ^ V1; #ifdef OCCT_DEBUG - if (Abs(CrossProd) <= gp::Resolution()) + if (std::abs(CrossProd) <= gp::Resolution()) std::cout << std::endl << "CrossProd = " << CrossProd << std::endl; #endif if (CrossProd > 0.) @@ -598,7 +598,7 @@ static void EdgeInter(const TopoDS_Face& F, Standard_Real Dist = P1.Distance(P2); if (Dist < TolConf) { - Standard_Real aTol = Max(BRep_Tool::Tolerance(V1[j]), BRep_Tool::Tolerance(V2[k])); + Standard_Real aTol = std::max(BRep_Tool::Tolerance(V1[j]), BRep_Tool::Tolerance(V2[k])); TopoDS_Vertex V = BRepLib_MakeVertex(P1); U1 = (j == 0) ? f[1] : l[1]; U2 = (k == 0) ? f[2] : l[2]; @@ -642,8 +642,8 @@ static void EdgeInter(const TopoDS_Face& F, // if (P1.IsEqual(P2,10*Tol)) { Standard_Real aTol; - aTol = Max(BRep_Tool::Tolerance(TopoDS::Vertex(it1LV1.Value())), - BRep_Tool::Tolerance(TopoDS::Vertex(it2LV1.Value()))); + aTol = std::max(BRep_Tool::Tolerance(TopoDS::Vertex(it1LV1.Value())), + BRep_Tool::Tolerance(TopoDS::Vertex(it2LV1.Value()))); if (P1.IsEqual(P2, aTol)) { // Modified by skv - Thu Jan 22 18:19:05 2004 OCC4455 End @@ -666,7 +666,7 @@ static void EdgeInter(const TopoDS_Face& F, // Vertex storage in DS. //--------------------------------- Standard_Real TolStore = BRep_Tool::Tolerance(E1) + BRep_Tool::Tolerance(E2); - TolStore = Max(TolStore, Tol); + TolStore = std::max(TolStore, Tol); Store(E1, E2, LV1, LV2, TolStore, AsDes, aDMVV); } } @@ -751,7 +751,7 @@ static void RefEdgeInter(const TopoDS_Face& F, if ((GAC1.GetType() == GeomAbs_Line) && (GAC2.GetType() == GeomAbs_Line)) { // Just quickly check if lines coincide - Standard_Real anAngle = Abs(GAC1.Line().Direction().Angle(GAC2.Line().Direction())); + Standard_Real anAngle = std::abs(GAC1.Line().Direction().Angle(GAC2.Line().Direction())); if (anAngle <= 1.e-8 || M_PI - anAngle <= 1.e-8) { theCoincide = Standard_True; @@ -762,7 +762,7 @@ static void RefEdgeInter(const TopoDS_Face& F, // Take into account the intersection range of line-line intersection // (the smaller angle between curves, the bigger range) TolLL = IntTools_Tools::ComputeIntRange(TolDub, TolDub, anAngle); - TolLL = Min(TolLL, 1.e-5); + TolLL = std::min(TolLL, 1.e-5); } } @@ -813,8 +813,8 @@ static void RefEdgeInter(const TopoDS_Face& F, dist1 = P1.Distance(P); dist2 = P2.Distance(P); dist3 = P1.Distance(P2); - dist1 = Max(dist1, dist2); - dist1 = Max(dist1, dist3); + dist1 = std::max(dist1, dist2); + dist1 = std::max(dist1, dist3); B.UpdateVertex(aNewVertex, dist1); #ifdef OCCT_DEBUG @@ -858,7 +858,7 @@ static void RefEdgeInter(const TopoDS_Face& F, V2or.Reverse(); Standard_Real CrossProd = V2or ^ V1; #ifdef OCCT_DEBUG - if (Abs(CrossProd) <= gp::Resolution()) + if (std::abs(CrossProd) <= gp::Resolution()) std::cout << std::endl << "CrossProd = " << CrossProd << std::endl; #endif if (CrossProd > 0.) @@ -1008,9 +1008,9 @@ static void RefEdgeInter(const TopoDS_Face& F, ////----------------------------------------------------- Standard_Real TolStore = BRep_Tool::Tolerance(E1) + BRep_Tool::Tolerance(E2); - TolStore = Max(TolStore, Tol); + TolStore = std::max(TolStore, Tol); // Compare to Line-Line tolerance - TolStore = Max(TolStore, TolLL); + TolStore = std::max(TolStore, TolLL); Store(E1, E2, LV1, LV2, TolStore, AsDes, aDMVV); } } @@ -1030,13 +1030,13 @@ static Standard_Integer evaluateMaxSegment(const Adaptor3d_CurveOnSurface& aCurv if (aSurf->GetType() == GeomAbs_BSplineSurface) { Handle(Geom_BSplineSurface) aBSpline = aSurf->BSpline(); - aNbSKnots = Max(aBSpline->NbUKnots(), aBSpline->NbVKnots()); + aNbSKnots = std::max(aBSpline->NbUKnots(), aBSpline->NbVKnots()); } if (aCurv2d->GetType() == GeomAbs_BSplineCurve) { aNbC2dKnots = aCurv2d->NbKnots(); } - Standard_Integer aReturn = (Standard_Integer)(30 + Max(aNbSKnots, aNbC2dKnots)); + Standard_Integer aReturn = (Standard_Integer)(30 + std::max(aNbSKnots, aNbC2dKnots)); return aReturn; } @@ -1098,7 +1098,7 @@ static Standard_Boolean ExtendPCurve(const Handle(Geom2d_Curve)& aPCurve, Handle(Geom2d_TrimmedCurve) aSegment; Geom2dConvert_CompCurveToBSplineCurve aCompCurve(aTrCurve, Convert_RationalC1); constexpr Standard_Real aTol = Precision::Confusion(); - Standard_Real aDelta = Max(a2Offset, 1.); + Standard_Real aDelta = std::max(a2Offset, 1.); if (FirstPar > anEf - a2Offset) { @@ -1140,7 +1140,7 @@ Standard_Boolean BRepOffset_Inter2d::ExtentEdge(const TopoDS_Edge& E, TopoDS_Shape aLocalShape = E.EmptyCopied(); Standard_Real anEf; Standard_Real anEl; - Standard_Real a2Offset = 2. * Abs(theOffset); + Standard_Real a2Offset = 2. * std::abs(theOffset); BRep_Builder BB; Standard_Integer i, j; @@ -1446,8 +1446,8 @@ Standard_Boolean BRepOffset_Inter2d::ExtentEdge(const TopoDS_Edge& E, continue; FirstPar = (Handle(BRep_GCurve)::DownCast(CurveRep))->First(); LastPar = (Handle(BRep_GCurve)::DownCast(CurveRep))->Last(); - if (Abs(FirstPar - FirstParOnPC) > Precision::PConfusion() - || Abs(LastPar - LastParOnPC) > Precision::PConfusion()) + if (std::abs(FirstPar - FirstParOnPC) > Precision::PConfusion() + || std::abs(LastPar - LastParOnPC) > Precision::PConfusion()) { theLoc = E.Location() * theLoc; theSurf = @@ -1463,10 +1463,10 @@ Standard_Boolean BRepOffset_Inter2d::ExtentEdge(const TopoDS_Edge& E, Standard_Real U1, U2, V1, V2; theSurf->Bounds(U1, U2, V1, V2); gp_Pnt2d Origin = Handle(Geom2d_Line)::DownCast(theCurve)->Location(); - if (Abs(Origin.X() - U1) <= Precision::Confusion() - || Abs(Origin.X() - U2) <= Precision::Confusion() - || Abs(Origin.Y() - V1) <= Precision::Confusion() - || Abs(Origin.Y() - V2) <= Precision::Confusion()) + if (std::abs(Origin.X() - U1) <= Precision::Confusion() + || std::abs(Origin.X() - U2) <= Precision::Confusion() + || std::abs(Origin.Y() - V1) <= Precision::Confusion() + || std::abs(Origin.Y() - V2) <= Precision::Confusion()) { BRepLib::SameParameter(NE, Precision::Confusion(), Standard_True); break; @@ -1518,7 +1518,7 @@ Standard_Boolean BRepOffset_Inter2d::ExtentEdge(const TopoDS_Edge& E, Handle(Geom_TrimmedCurve) aSegment; GeomConvert_CompCurveToBSplineCurve aCompCurve(aTrCurve, Convert_RationalC1); constexpr Standard_Real aTol = Precision::Confusion(); - Standard_Real aDelta = Max(a2Offset, 1.); + Standard_Real aDelta = std::max(a2Offset, 1.); if (FirstPar > anEf - a2Offset) { diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Inter3d.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Inter3d.cxx index ef7ec92674..5ffaa0716e 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Inter3d.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Inter3d.cxx @@ -138,8 +138,8 @@ void BRepOffset_Inter3d::CompletInt(const TopTools_ListOfShape& SetOfFaces, } const BOPTools_BoxPairSelector::PairIDs& aPair = aPairs[iPair]; - const TopoDS_Face& aF1 = TopoDS::Face(aMFaces.FindKey(Min(aPair.ID1, aPair.ID2))); - const TopoDS_Face& aF2 = TopoDS::Face(aMFaces.FindKey(Max(aPair.ID1, aPair.ID2))); + const TopoDS_Face& aF1 = TopoDS::Face(aMFaces.FindKey(std::min(aPair.ID1, aPair.ID2))); + const TopoDS_Face& aF2 = TopoDS::Face(aMFaces.FindKey(std::max(aPair.ID1, aPair.ID2))); // intersect faces FaceInter(aF1, aF2, InitOffsetFace); diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset.cxx index 65c8085dcf..b6b0d85ac4 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset.cxx @@ -886,8 +886,9 @@ void BRepOffset_MakeOffset::MakeOffsetShape(const Message_ProgressRange& theRang // ------------ EvalMax(myShape, myTol); // There are possible second variant: analytical continuation of arcsin. - Standard_Real TolAngleCoeff = Min(myTol / (Abs(myOffset * 0.5) + Precision::Confusion()), 1.0); - Standard_Real TolAngle = 4 * ASin(TolAngleCoeff); + Standard_Real TolAngleCoeff = + std::min(myTol / (std::abs(myOffset * 0.5) + Precision::Confusion()), 1.0); + Standard_Real TolAngle = 4 * std::asin(TolAngleCoeff); if ((myJoin == GeomAbs_Intersection) && myInter && myIsPlanar) { myAnalyse.SetOffsetValue(myOffset); @@ -2517,14 +2518,14 @@ void BRepOffset_MakeOffset::CorrectConicalFaces() Standard_Real Uf, Vf, Ul, Vl; ElSLib::Parameters(theSphere, fPnt, Uf, Vf); ElSLib::Parameters(theSphere, lPnt, Ul, Vl); - if (Abs(Ul) <= Precision::Confusion()) + if (std::abs(Ul) <= Precision::Confusion()) Ul = 2. * M_PI; Handle(Geom_Curve) aCurv = aSphSurf->VIso(Vf); /* if (!isFirstFace) { gp_Circ aCircle = (Handle(Geom_Circle)::DownCast(aCurv))->Circ(); - if (Abs(Uf - f) > Precision::Confusion()) + if (std::abs(Uf - f) > Precision::Confusion()) { aCircle.Rotate(aCircle.Axis(), f - Uf); aCurv = new Geom_Circle(aCircle); @@ -2622,7 +2623,7 @@ void BRepOffset_MakeOffset::CorrectConicalFaces() Handle(Geom2d_Curve) aC2d = BRep_Tool::CurveOnSurface(FirstEdge, aSphSurf, L, f, l); p2d1 = aC2d->Value(f); p2d2 = aC2d->Value(l); - if (Abs(p2d1.X() - Ufirst) <= Precision::Confusion()) + if (std::abs(p2d1.X() - Ufirst) <= Precision::Confusion()) { EdgesOfWire.Remove(itl); break; @@ -3087,7 +3088,7 @@ void BRepOffset_MakeOffset::MakeMissingWalls(const Message_ProgressRange& theRan TopTools_IndexedDataMapOfShapeListOfShape Contours; //Start vertex + list of connected edges (free boundary) // clang-format on TopTools_DataMapOfShapeShape MapEF; // Edges of contours: edge + face - Standard_Real OffsetVal = Abs(myOffset); + Standard_Real OffsetVal = std::abs(myOffset); FillContours(myFaceComp, myAnalyse, Contours, MapEF); @@ -3145,7 +3146,7 @@ void BRepOffset_MakeOffset::MakeMissingWalls(const Message_ProgressRange& theRan gp_Pnt aP1 = anOEC->Value(aF); gp_Pnt aP2 = anOEC->Value(aL); TopoDS_Vertex anOEV1, anOEV2; - Standard_Real aTol = Max(BRep_Tool::Tolerance(V1), BRep_Tool::Tolerance(V2)); + Standard_Real aTol = std::max(BRep_Tool::Tolerance(V1), BRep_Tool::Tolerance(V2)); aBB.MakeVertex(anOEV1, aP1, aTol); anOEV1.Orientation(TopAbs_FORWARD); aBB.MakeVertex(anOEV2, aP2, aTol); @@ -3176,10 +3177,11 @@ void BRepOffset_MakeOffset::MakeMissingWalls(const Message_ProgressRange& theRan if (aPntOF.SquareDistance(aPntOL) > gp::Resolution()) { // To avoid computation of complex analytical continuation of Sin / ArcSin. - Standard_Real aSinValue = Min(2 * anEdgeTol / aPntOF.Distance(aPntOL), 1.0); - Standard_Real aMaxAngle = Min(Abs(ASin(aSinValue)), M_PI_4); // Maximal angle. + Standard_Real aSinValue = std::min(2 * anEdgeTol / aPntOF.Distance(aPntOL), 1.0); + Standard_Real aMaxAngle = + std::min(std::abs(std::asin(aSinValue)), M_PI_4); // Maximal angle. Standard_Real aCurrentAngle = gp_Vec(aPntF, aPntL).Angle(gp_Vec(aPntOF, aPntOL)); - if (aC->IsKind(STANDARD_TYPE(Geom_Line)) && Abs(aCurrentAngle) > aMaxAngle) + if (aC->IsKind(STANDARD_TYPE(Geom_Line)) && std::abs(aCurrentAngle) > aMaxAngle) { // anEdge not collinear to offset edge. isBuildFromScratch = Standard_True; @@ -3269,7 +3271,8 @@ void BRepOffset_MakeOffset::MakeMissingWalls(const Message_ProgressRange& theRan if (aCirc.Axis().IsParallel(aCircOE.Axis(), Precision::Confusion()) && anAxisLine.Contains(aCircOE.Location(), Precision::Confusion())) { // cylinder, plane or cone - if (Abs(aCirc.Radius() - aCircOE.Radius()) <= Precision::Confusion()) // case of cylinder + if (std::abs(aCirc.Radius() - aCircOE.Radius()) + <= Precision::Confusion()) // case of cylinder theSurf = GC_MakeCylindricalSurface(aCirc).Value(); else if (aCirc.Location().Distance(aCircOE.Location()) <= Precision::Confusion()) { // case of plane @@ -3467,7 +3470,7 @@ void BRepOffset_MakeOffset::MakeMissingWalls(const Message_ProgressRange& theRan Standard_Real fparOE = BAcurveOE.FirstParameter(); Standard_Real lparOE = BAcurveOE.LastParameter(); TopLoc_Location Loc; - if (Abs(fpar - fparOE) > Precision::Confusion()) + if (std::abs(fpar - fparOE) > Precision::Confusion()) { const TopoDS_Edge& anE4 = (ToReverse) ? E3 : E4; gp_Pnt2d fp2d = EdgeLine2d->Value(fpar); @@ -3492,7 +3495,7 @@ void BRepOffset_MakeOffset::MakeMissingWalls(const Message_ProgressRange& theRan BB.UpdateEdge(anE4, aLine2d2, theSurf, Loc, max_deviation); BB.Range(anE4, FirstPar, LastPar); } - if (Abs(lpar - lparOE) > Precision::Confusion()) + if (std::abs(lpar - lparOE) > Precision::Confusion()) { const TopoDS_Edge& anE3 = (ToReverse) ? E4 : E3; gp_Pnt2d lp2d = EdgeLine2d->Value(lpar); @@ -4207,16 +4210,16 @@ void CorrectSolid(TopoDS_Solid& theSol, TopTools_ListOfShape& theSolList) const TopoDS_Shape& aSh = anIt.Value(); GProp_GProps aVProps; BRepGProp::VolumeProperties(aSh, aVProps, Standard_True); - if (Abs(aVProps.Mass()) > aVolMax) + if (std::abs(aVProps.Mass()) > aVolMax) { anOuterVol = aVProps.Mass(); - aVolMax = Abs(anOuterVol); + aVolMax = std::abs(anOuterVol); anOuterShell = aSh; } aVols.Append(aVProps.Mass()); } // - if (Abs(anOuterVol) < Precision::Confusion()) + if (std::abs(anOuterVol) < Precision::Confusion()) { return; } @@ -4282,13 +4285,13 @@ Standard_Boolean BRepOffset_MakeOffset::CheckInputData(const Message_ProgressRan myBadShape = aTmpShape; Message_ProgressScope aPS(theRange, NULL, 1); // Non-null offset. - if (Abs(myOffset) <= myTol) + if (std::abs(myOffset) <= myTol) { Standard_Boolean isFound = Standard_False; TopTools_DataMapIteratorOfDataMapOfShapeReal anIter(myFaceOffset); for (; anIter.More(); anIter.Next()) { - if (Abs(anIter.Value()) > myTol) + if (std::abs(anIter.Value()) > myTol) { isFound = Standard_True; break; diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset_1.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset_1.cxx index 732a5bd4fd..1b1af324a4 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset_1.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeOffset_1.cxx @@ -2166,7 +2166,7 @@ void BRepOffset_BuildOffsetFaces::FindInvalidEdges( aVSum2.Normalize(); // Standard_Real aCos = aVSum1.Dot(aVSum2); - if (Abs(aCos) < 0.9999) + if (std::abs(aCos) < 0.9999) { continue; } @@ -3220,7 +3220,7 @@ Standard_Boolean BRepOffset_BuildOffsetFaces::CheckInverted( gp_Vec aVO(aPO1, aPO2); // Standard_Real anAngle = aVI.Angle(aVO); - Standard_Boolean bInverted = Abs(anAngle - M_PI) < 1.e-4; + Standard_Boolean bInverted = std::abs(anAngle - M_PI) < 1.e-4; if (bInverted) { TopTools_ListIteratorOfListOfShape aItLEIm(aLEImages); diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeSimpleOffset.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeSimpleOffset.cxx index 7a540114aa..07b9835f40 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeSimpleOffset.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_MakeSimpleOffset.cxx @@ -140,8 +140,8 @@ Standard_Real BRepOffset_MakeSimpleOffset::GetSafeOffset(const Standard_Real the Standard_Real aMaxTol = 0.0; aMaxTol = BRep_Tool::MaxTolerance(myInputShape, TopAbs_VERTEX); - const Standard_Real anExpOffset = Max((theExpectedToler - aMaxTol) / (2.0 * myMaxAngle), - 0.0); // Minimal distance can't be lower than 0.0. + const Standard_Real anExpOffset = std::max((theExpectedToler - aMaxTol) / (2.0 * myMaxAngle), + 0.0); // Minimal distance can't be lower than 0.0. return anExpOffset; } @@ -284,7 +284,7 @@ static void tgtfaces(const TopoDS_Edge& Ed, // Compute angle. Standard_Real aCurrentAng = d1.Angle(d2); - theResAngle = Max(theResAngle, aCurrentAng); + theResAngle = std::max(theResAngle, aCurrentAng); } } diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Offset.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Offset.cxx index 4dcc45b44e..9459639033 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Offset.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Offset.cxx @@ -208,7 +208,7 @@ static void ComputeCurve3d(const TopoDS_Edge& Edge, if (STy == GeomAbs_Sphere) { gp_Pnt2d P = C.Line().Location(); - if (Abs(Abs(P.Y()) - M_PI / 2.) < Precision::PConfusion()) + if (std::abs(std::abs(P.Y()) - M_PI / 2.) < Precision::PConfusion()) { TheBuilder.Degenerated(Edge, Standard_True); } @@ -534,7 +534,7 @@ void BRepOffset_Offset::Init(const TopoDS_Face& Face, Handle(Geom2d_Curve) aCurve = BRep_Tool::CurveOnSurface(theDegEdge, Face, fpar, lpar); gp_Pnt2d fp2d = aCurve->Value(fpar); gp_Pnt2d lp2d = aCurve->Value(lpar); - if (Abs(fp2d.X() - lp2d.X()) <= Precision::PConfusion()) + if (std::abs(fp2d.X() - lp2d.X()) <= Precision::PConfusion()) UisoDegen = Standard_True; if (DegEdges.Length() == 2) @@ -554,14 +554,14 @@ void BRepOffset_Offset::Init(const TopoDS_Face& Face, { if (UisoDegen) { - if (Abs(fp2d.X() - uf1) <= Precision::Confusion()) + if (std::abs(fp2d.X() - uf1) <= Precision::Confusion()) UminDegen = Standard_True; else UmaxDegen = Standard_True; } else { - if (Abs(fp2d.Y() - vf1) <= Precision::Confusion()) + if (std::abs(fp2d.Y() - vf1) <= Precision::Confusion()) VminDegen = Standard_True; else VmaxDegen = Standard_True; @@ -849,7 +849,7 @@ void BRepOffset_Offset::Init(const TopoDS_Face& Face, P2d2 = C2d->Value(BRep_Tool::Parameter(V2, Eforward, CurFace)); if (VonDegen.Contains(V1)) { - if (Abs(P2d1.Y() - vf1) <= Precision::Confusion()) + if (std::abs(P2d1.Y() - vf1) <= Precision::Confusion()) { P1 = MinApex; vstart = v1; @@ -869,7 +869,7 @@ void BRepOffset_Offset::Init(const TopoDS_Face& Face, } if (VonDegen.Contains(V2)) { - if (Abs(P2d2.Y() - vf1) <= Precision::Confusion()) + if (std::abs(P2d2.Y() - vf1) <= Precision::Confusion()) { P2 = MinApex; vend = v1; @@ -1101,7 +1101,7 @@ void BRepOffset_Offset::Init(const TopoDS_Edge& Path, } // Calcul du tuyau - GeomFill_Pipe Pipe(HCP, HEdge1, HEdge2, Abs(Offset)); + GeomFill_Pipe Pipe(HCP, HEdge1, HEdge2, std::abs(Offset)); Pipe.Perform(Tol, Polynomial, Conti); if (!Pipe.IsDone()) throw Standard_ConstructionError("GeomFill_Pipe : Cannot make a surface"); @@ -1149,7 +1149,7 @@ void BRepOffset_Offset::Init(const TopoDS_Edge& Path, myBuilder.Degenerated(Edge1, Standard_True); } - TheTol = Max(PathTol, BRep_Tool::Tolerance(Edge1) + ErrorPipe); + TheTol = std::max(PathTol, BRep_Tool::Tolerance(Edge1) + ErrorPipe); UpdateEdge(Edge1, PC, myFace, TheTol); // mise a same range de la nouvelle pcurve. @@ -1164,7 +1164,7 @@ void BRepOffset_Offset::Init(const TopoDS_Edge& Path, // mise a sameparameter pour les KPart if (ErrorPipe == 0) { - TheTol = Max(TheTol, Tol); + TheTol = std::max(TheTol, Tol); myBuilder.SameParameter(Edge1, Standard_False); BRepLib::SameParameter(Edge1, TheTol); } @@ -1195,7 +1195,7 @@ void BRepOffset_Offset::Init(const TopoDS_Edge& Path, myBuilder.Degenerated(Edge2, Standard_True); } - TheTol = Max(PathTol, BRep_Tool::Tolerance(Edge2) + ErrorPipe); + TheTol = std::max(PathTol, BRep_Tool::Tolerance(Edge2) + ErrorPipe); UpdateEdge(Edge2, PC, myFace, TheTol); // mise a same range de la nouvelle pcurve. @@ -1208,7 +1208,7 @@ void BRepOffset_Offset::Init(const TopoDS_Edge& Path, // mise a sameparameter pour les KPart if (ErrorPipe == 0) { - TheTol = Max(TheTol, Tol); + TheTol = std::max(TheTol, Tol); myBuilder.SameParameter(Edge2, Standard_False); BRepLib::SameParameter(Edge2, TheTol); } @@ -1492,7 +1492,7 @@ void BRepOffset_Offset::Init(const TopoDS_Vertex& Vertex, gp_Ax3 Axis(Origin, Vdir, Xdir); - Handle(Geom_Surface) S = new Geom_SphericalSurface(Axis, Abs(Offset)); + Handle(Geom_Surface) S = new Geom_SphericalSurface(Axis, std::abs(Offset)); Standard_Real f, l, Tol = BRep_Tool::Tolerance(Vertex); @@ -1599,7 +1599,7 @@ void BRepOffset_Offset::Init(const TopoDS_Vertex& Vertex, void BRepOffset_Offset::Init(const TopoDS_Edge& Edge, const Standard_Real Offset) { myShape = Edge; - Standard_Real myOffset = Abs(Offset); + Standard_Real myOffset = std::abs(Offset); Standard_Real f, l; TopLoc_Location Loc; diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_SimpleOffset.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_SimpleOffset.cxx index 909f8edd32..ec4833aca3 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_SimpleOffset.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_SimpleOffset.cxx @@ -284,10 +284,10 @@ void BRepOffset_SimpleOffset::FillEdgeData( if (aValidateEdge.IsDone()) { Standard_Real aMaxTol1 = aValidateEdge.GetMaxDistance(); - anEdgeTol = Max(anEdgeTol, aMaxTol1); + anEdgeTol = std::max(anEdgeTol, aMaxTol1); } } - aNED.myTol = Max(BRep_Tool::Tolerance(aNewEdge), anEdgeTol); + aNED.myTol = std::max(BRep_Tool::Tolerance(aNewEdge), anEdgeTol); // Save computed 3d curve in map. myEdgeInfo.Bind(theEdge, aNED); @@ -364,7 +364,7 @@ void BRepOffset_SimpleOffset::FillVertexData( anOffsetPointVec.Append(anOffsetPointLast); } - aMaxEdgeTol = Max(aMaxEdgeTol, aNED.myTol); + aMaxEdgeTol = std::max(aMaxEdgeTol, aNED.myTol); } // NCollection_Vector starts from 0 by default. @@ -385,7 +385,7 @@ void BRepOffset_SimpleOffset::FillVertexData( aSqMaxDist = aSqDist; } - const Standard_Real aResTol = Max(aMaxEdgeTol, Sqrt(aSqMaxDist)); + const Standard_Real aResTol = std::max(aMaxEdgeTol, std::sqrt(aSqMaxDist)); const Standard_Real aMultCoeff = 1.001; // Avoid tolernace problems. NewVertexData aNVD; diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Tool.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Tool.cxx index 33c276457a..04db6e2ed9 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Tool.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffset/BRepOffset_Tool.cxx @@ -232,10 +232,10 @@ static void PutInBounds(const TopoDS_Face& F, const TopoDS_Edge& E, Handle(Geom2 gp_Pnt2d Pf = C2d->Value(f); gp_Pnt2d Pl = C2d->Value(l); gp_Pnt2d Pm = C2d->Value(0.34 * f + 0.66 * l); - Standard_Real minC = Min(Pf.X(), Pl.X()); - minC = Min(minC, Pm.X()); - Standard_Real maxC = Max(Pf.X(), Pl.X()); - maxC = Max(maxC, Pm.X()); + Standard_Real minC = std::min(Pf.X(), Pl.X()); + minC = std::min(minC, Pm.X()); + Standard_Real maxC = std::max(Pf.X(), Pl.X()); + maxC = std::max(maxC, Pm.X()); Standard_Real du = 0.; if (minC < umin - eps) { @@ -276,10 +276,10 @@ static void PutInBounds(const TopoDS_Face& F, const TopoDS_Edge& E, Handle(Geom2 gp_Pnt2d Pf = C2d->Value(f); gp_Pnt2d Pl = C2d->Value(l); gp_Pnt2d Pm = C2d->Value(0.34 * f + 0.66 * l); - Standard_Real minC = Min(Pf.Y(), Pl.Y()); - minC = Min(minC, Pm.Y()); - Standard_Real maxC = Max(Pf.Y(), Pl.Y()); - maxC = Max(maxC, Pm.Y()); + Standard_Real minC = std::min(Pf.Y(), Pl.Y()); + minC = std::min(minC, Pm.Y()); + Standard_Real maxC = std::max(Pf.Y(), Pl.Y()); + maxC = std::max(maxC, Pm.Y()); Standard_Real dv = 0.; if (minC < vmin - eps) { @@ -321,8 +321,8 @@ Standard_Real BRepOffset_Tool::Gabarit(const Handle(Geom_Curve)& aCurve) BndLib_Add3dCurve::Add(GC, Precision::Confusion(), aBox); Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax, dist; aBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); - dist = Max((aXmax - aXmin), (aYmax - aYmin)); - dist = Max(dist, (aZmax - aZmin)); + dist = std::max((aXmax - aXmin), (aYmax - aYmin)); + dist = std::max(dist, (aZmax - aZmin)); return dist; } @@ -335,7 +335,7 @@ static void BuildPCurves(const TopoDS_Edge& E, const TopoDS_Face& F) if (!C2d.IsNull()) return; - // Standard_Real Tolerance = Max(Precision::Confusion(),BRep_Tool::Tolerance(E)); + // Standard_Real Tolerance = std::max(Precision::Confusion(),BRep_Tool::Tolerance(E)); constexpr Standard_Real Tolerance = Precision::Confusion(); BRepAdaptor_Surface AS(F, 0); @@ -1057,8 +1057,8 @@ static Handle(Geom2d_Curve) ConcatPCurves(const TopoDS_Edge& E1, if (PCurve1 == PCurve2) { newPCurve = PCurve1; - newFirst = Min(first1, first2); - newLast = Max(last1, last2); + newFirst = std::min(first1, first2); + newLast = std::max(last1, last2); } else if (PCurve1->DynamicType() == PCurve2->DynamicType() && (PCurve1->IsInstance(STANDARD_TYPE(Geom2d_Line)) @@ -1103,8 +1103,8 @@ static Handle(Geom2d_Curve) ConcatPCurves(const TopoDS_Edge& E1, first2 = ElCLib::Parameter(theHypr, P1); last2 = ElCLib::Parameter(theHypr, P2); } - newFirst = Min(first1, first2); - newLast = Max(last1, last2); + newFirst = std::min(first1, first2); + newLast = std::max(last1, last2); } else { @@ -1162,8 +1162,8 @@ static TopoDS_Edge Glue(const TopoDS_Edge& E1, if (C1 == C2) { newCurve = C1; - fparam = Min(first1, first2); - lparam = Max(last1, last2); + fparam = std::min(first1, first2); + lparam = std::max(last1, last2); } else if (C1->DynamicType() == C2->DynamicType() && (C1->IsInstance(STANDARD_TYPE(Geom_Line)) || C1->IsKind(STANDARD_TYPE(Geom_Conic)))) @@ -2037,10 +2037,10 @@ static void ExtentEdge(const TopoDS_Face& F, Standard_Real umin, umax, vmin, vmax; S->Bounds(umin, umax, vmin, vmax); - umin = Max(umin, -PMax); - vmin = Max(vmin, -PMax); - umax = Min(umax, PMax); - vmax = Min(vmax, PMax); + umin = std::max(umin, -PMax); + vmin = std::max(vmin, -PMax); + umax = std::min(umax, PMax); + vmax = std::min(vmax, PMax); Standard_Real f, l; Handle(Geom2d_Curve) C2d = BRep_Tool::CurveOnSurface(E, F, f, l); @@ -2051,21 +2051,21 @@ static void ExtentEdge(const TopoDS_Face& F, C2d->D1(CE.FirstParameter(), P, Tang); Standard_Real tx, ty, tmin; tx = ty = Precision::Infinite(); - if (Abs(Tang.X()) > Precision::Confusion()) - tx = Min(Abs((umax - P.X()) / Tang.X()), Abs((umin - P.X()) / Tang.X())); - if (Abs(Tang.Y()) > Precision::Confusion()) - ty = Min(Abs((vmax - P.Y()) / Tang.Y()), Abs((vmin - P.Y()) / Tang.Y())); - tmin = Min(tx, ty); + if (std::abs(Tang.X()) > Precision::Confusion()) + tx = std::min(std::abs((umax - P.X()) / Tang.X()), std::abs((umin - P.X()) / Tang.X())); + if (std::abs(Tang.Y()) > Precision::Confusion()) + ty = std::min(std::abs((vmax - P.Y()) / Tang.Y()), std::abs((vmin - P.Y()) / Tang.Y())); + tmin = std::min(tx, ty); Tang = tmin * Tang; gp_Pnt2d PF2d(P.X() - Tang.X(), P.Y() - Tang.Y()); C2d->D1(CE.LastParameter(), P, Tang); tx = ty = Precision::Infinite(); - if (Abs(Tang.X()) > Precision::Confusion()) - tx = Min(Abs((umax - P.X()) / Tang.X()), Abs((umin - P.X()) / Tang.X())); - if (Abs(Tang.Y()) > Precision::Confusion()) - ty = Min(Abs((vmax - P.Y()) / Tang.Y()), Abs((vmin - P.Y()) / Tang.Y())); - tmin = Min(tx, ty); + if (std::abs(Tang.X()) > Precision::Confusion()) + tx = std::min(std::abs((umax - P.X()) / Tang.X()), std::abs((umin - P.X()) / Tang.X())); + if (std::abs(Tang.Y()) > Precision::Confusion()) + ty = std::min(std::abs((vmax - P.Y()) / Tang.Y()), std::abs((vmin - P.Y()) / Tang.Y())); + tmin = std::min(tx, ty); Tang = tmin * Tang; gp_Pnt2d PL2d(P.X() + Tang.X(), P.Y() + Tang.Y()); @@ -2129,7 +2129,7 @@ static Standard_Boolean ProjectVertexOnEdge(TopoDS_Vertex& V, if (V.Orientation() == TopAbs_FORWARD) { - if (Abs(f) < Precision::Infinite()) + if (std::abs(f) < Precision::Infinite()) { gp_Pnt PF = C.Value(f); if (PF.IsEqual(P, TolConf)) @@ -2141,7 +2141,7 @@ static Standard_Boolean ProjectVertexOnEdge(TopoDS_Vertex& V, } if (V.Orientation() == TopAbs_REVERSED) { - if (!found && Abs(l) < Precision::Infinite()) + if (!found && std::abs(l) < Precision::Infinite()) { gp_Pnt PL = C.Value(l); if (PL.IsEqual(P, TolConf)) @@ -2188,7 +2188,7 @@ static Standard_Boolean ProjectVertexOnEdge(TopoDS_Vertex& V, if (!found) { std::cout << "BRepOffset_Tool::ProjectVertexOnEdge Parameter no found" << std::endl; - if (Abs(f) < Precision::Infinite() && Abs(l) < Precision::Infinite()) + if (std::abs(f) < Precision::Infinite() && std::abs(l) < Precision::Infinite()) { #ifdef DRAW DBRep::Set("E", E); @@ -2317,7 +2317,8 @@ void BRepOffset_Tool::Inter2d(const TopoDS_Face& F, { for (Standard_Integer i2 = 0; i2 < 2; i2++) { - if (Abs(fl1[i1]) < Precision::Infinite() && Abs(fl2[i2]) < Precision::Infinite()) + if (std::abs(fl1[i1]) < Precision::Infinite() + && std::abs(fl2[i2]) < Precision::Infinite()) { if (P1[i1].IsEqual(P2[i2], TolConf)) { @@ -2571,9 +2572,9 @@ static void MakeFace(const Handle(Geom_Surface)& S, gp_Pnt theApex = theCone.Apex(); Standard_Real Uapex, Vapex; ElSLib::Parameters(theCone, theApex, Uapex, Vapex); - if (Abs(VMin - Vapex) <= Precision::Confusion()) + if (std::abs(VMin - Vapex) <= Precision::Confusion()) vmindegen = Standard_True; - if (Abs(VMax - Vapex) <= Precision::Confusion()) + if (std::abs(VMax - Vapex) <= Precision::Confusion()) vmaxdegen = Standard_True; } @@ -3054,10 +3055,10 @@ static Standard_Boolean EnlargeGeometry(Handle(Geom_Surface)& S, Standard_Real UU1, UU2, VV1, VV2; S->Bounds(UU1, UU2, VV1, VV2); // Pas d extension au dela des bornes de la surface. - U1 = Max(UU1, U1); - V1 = Max(VV1, V1); - U2 = Min(UU2, U2); - V2 = Min(VV2, V2); + U1 = std::max(UU1, U1); + V1 = std::max(VV1, V1); + U2 = std::min(UU2, U2); + V2 = std::min(VV2, V2); } return SurfaceChange; } @@ -3208,7 +3209,7 @@ void BRepOffset_Tool::CheckBounds(const TopoDS_Face& F, Vbound++; if (BRep_Tool::Degenerated(anEdge)) { - if (Abs(theLine->Location().Y() - VF1) <= Precision::Confusion()) + if (std::abs(theLine->Location().Y() - VF1) <= Precision::Confusion()) enlargeVfirst = Standard_False; else // theLine->Location().Y() is near VF2 enlargeVlast = Standard_False; @@ -3237,11 +3238,11 @@ void BRepOffset_Tool::CheckBounds(const TopoDS_Face& F, if (Ubound >= 2 || Vbound >= 2) { - if (Ubound >= 2 && Abs(UF1 - Ufirst) <= Precision::Confusion() - && Abs(UF2 - Ulast) <= Precision::Confusion()) + if (Ubound >= 2 && std::abs(UF1 - Ufirst) <= Precision::Confusion() + && std::abs(UF2 - Ulast) <= Precision::Confusion()) enlargeU = Standard_False; - if (Vbound >= 2 && Abs(VF1 - Vfirst) <= Precision::Confusion() - && Abs(VF2 - Vlast) <= Precision::Confusion()) + if (Vbound >= 2 && std::abs(VF1 - Vfirst) <= Precision::Confusion() + && std::abs(VF2 - Vlast) <= Precision::Confusion()) { enlargeVfirst = Standard_False; enlargeVlast = Standard_False; @@ -3329,10 +3330,10 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace(const TopoDS_Face& F, } else { - UU1 = Max(US1, UU1); - UU2 = Min(UU2, US2); - VV1 = Max(VS1, VV1); - VV2 = Min(VS2, VV2); + UU1 = std::max(US1, UU1); + UU2 = std::min(UU2, US2); + VV1 = std::max(VS1, VV1); + VV2 = std::min(VS2, VV2); } if (S->IsUPeriodic()) @@ -3974,9 +3975,9 @@ void BRepOffset_Tool::ExtentFace(const TopoDS_Face& F, { if (U1 > U2) { - if (Abs(U1 - l) < eps) + if (std::abs(U1 - l) < eps) U1 = f; - if (Abs(U2 - f) < eps) + if (std::abs(U2 - f) < eps) U2 = l; } TopoDS_Shape aLocalVertex = NV1.Oriented(TopAbs_FORWARD); @@ -3993,9 +3994,9 @@ void BRepOffset_Tool::ExtentFace(const TopoDS_Face& F, { if (U2 > U1) { - if (Abs(U2 - l) < eps) + if (std::abs(U2 - l) < eps) U2 = f; - if (Abs(U1 - f) < eps) + if (std::abs(U1 - f) < eps) U1 = l; } TopoDS_Shape aLocalVertex = NV2.Oriented(TopAbs_FORWARD); diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_DraftAngle.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_DraftAngle.cxx index f778b20b46..ffa64945d5 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_DraftAngle.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_DraftAngle.cxx @@ -97,7 +97,7 @@ void BRepOffsetAPI_DraftAngle::Add(const TopoDS_Face& F, const Standard_Boolean Flag) { // POP-DPF : protection - if (Abs(Angle) <= 1.e-04) + if (std::abs(Angle) <= 1.e-04) return; Standard_NullObject_Raise_if(myInitialShape.IsNull(), "BRepOffsetAPI_DraftAngle::Add() - initial shape is not set"); @@ -394,7 +394,7 @@ void BRepOffsetAPI_DraftAngle::CorrectWires() Standard_Real aTolE = BRep_Tool::Tolerance(anEdge); // Tolerance to compare the intersection points is the maximal // tolerance of intersecting edges - Standard_Real aTolCmp = Max(aTolCurE, aTolE); + Standard_Real aTolCmp = std::max(aTolCurE, aTolE); // Standard_Integer aNbIntPnt = aGInter.NbPoints(); for (k = 1; k <= aNbIntPnt; ++k) @@ -512,7 +512,7 @@ void BRepOffsetAPI_DraftAngle::CorrectWires() TopoDS_Face theFace = TopoDS::Face(Fseq(j)); TopLoc_Location L; Handle(Geom_Surface) theSurf = BRep_Tool::Surface(theFace, L); - if (Abs(par - FirstPar) <= Precision::Confusion()) + if (std::abs(par - FirstPar) <= Precision::Confusion()) { BB.UpdateVertex(Vfirst, ParsSeam(i)(1), SeamEdge, BRep_Tool::Tolerance(Vfirst)); EPmap(SeamEdge).Append(ParsSeam(i)(1)); @@ -531,7 +531,7 @@ void BRepOffsetAPI_DraftAngle::CorrectWires() par = ParsNonSeam(i)(j); BB.Range(NewE, prevpar, par); SeamEdge = TopoDS::Edge(Seam(i)(j)); - if (j == ParsNonSeam(i).Length() && Abs(par - LastPar) <= Precision::Confusion()) + if (j == ParsNonSeam(i).Length() && std::abs(par - LastPar) <= Precision::Confusion()) { NewV = Vlast; if (firstind == 2 && j == 2) @@ -568,7 +568,7 @@ void BRepOffsetAPI_DraftAngle::CorrectWires() NewE = TopoDS::Edge(aLocalShape); // NewE = TopoDS::Edge( anEdge.EmptyCopied() ); par = LastPar; - if (Abs(prevpar - par) > Precision::Confusion()) + if (std::abs(prevpar - par) > Precision::Confusion()) { BB.Range(NewE, prevpar, par); NewE.Orientation(TopAbs_FORWARD); @@ -629,7 +629,7 @@ void BRepOffsetAPI_DraftAngle::CorrectWires() remove = Standard_False; for (i = 1; i < Seq.Length(); i++) { - if (Abs(Seq(i) - Seq(i + 1)) <= Precision::Confusion()) + if (std::abs(Seq(i) - Seq(i + 1)) <= Precision::Confusion()) { Seq.Remove(i + 1); SeqShape.Remove(i + 1); @@ -667,7 +667,7 @@ void BRepOffsetAPI_DraftAngle::CorrectWires() lpar = Seq(1); TopoDS_Edge NewE; Standard_Integer firstind = 1; - if (Abs(fpar - lpar) <= Precision::Confusion()) + if (std::abs(fpar - lpar) <= Precision::Confusion()) { firstind = 2; fpar = Seq(1); @@ -723,7 +723,7 @@ void BRepOffsetAPI_DraftAngle::CorrectWires() // Find vertices for (j = 1; j <= Seq2.Length(); j++) { - if (Abs(fpar - Seq2(j)) <= Precision::Confusion()) + if (std::abs(fpar - Seq2(j)) <= Precision::Confusion()) { break; } @@ -742,7 +742,7 @@ void BRepOffsetAPI_DraftAngle::CorrectWires() i = Seq.Length(); fpar = Seq(i); lpar = LastPar; - if (Abs(fpar - lpar) <= Precision::Confusion()) + if (std::abs(fpar - lpar) <= Precision::Confusion()) continue; TopoDS_Shape aLocalShape = anEdge.EmptyCopied(); NewE = TopoDS::Edge(aLocalShape); diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_MakeEvolved.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_MakeEvolved.cxx index 8ee00c8e86..de436f5efe 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_MakeEvolved.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_MakeEvolved.cxx @@ -70,7 +70,7 @@ BRepOffsetAPI_MakeEvolved::BRepOffsetAPI_MakeEvolved(const TopoDS_Shape& Spin if (!AxeProf) { Standard_Boolean POS; - BRepFill::Axe(Spine, Profil, Axis, POS, Max(Tol, Precision::Confusion())); + BRepFill::Axe(Spine, Profil, Axis, POS, std::max(Tol, Precision::Confusion())); if (ProfOnSpine && !POS) return; } diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.cxx index ee328895b1..94a354df87 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_MakeOffset.cxx @@ -406,7 +406,7 @@ void BRepOffsetAPI_MakeOffset::Perform(const Standard_Real Offset, const Standar for (itOW.Initialize(myLeft); itOW.More(); itOW.Next()) { BRepFill_OffsetWire& Algo = itOW.ChangeValue(); - Algo.Perform(Abs(Offset), Alt); + Algo.Perform(std::abs(Offset), Alt); if (Algo.IsDone() && !Algo.Shape().IsNull()) { B.Add(Res, isWasReversed ? Algo.Shape().Reversed() : Algo.Shape()); diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_MiddlePath.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_MiddlePath.cxx index 3e8b186c05..dd2fed8cad 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_MiddlePath.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_MiddlePath.cxx @@ -894,7 +894,7 @@ void BRepOffsetAPI_MiddlePath::Build(const Message_ProgressRange& /*theRange*/) Standard_Real anAngle = Vec1.AngleWithRef(Vec2, theAxis.Direction()); if (anAngle < 0.) anAngle += 2. * M_PI; - if (Abs(anAngle - theAngle) > AngTol) + if (std::abs(anAngle - theAngle) > AngTol) theAxis.Reverse(); gp_Ax2 theAx2(theCenterOfCirc, theAxis.Direction(), Vec1); Handle(Geom_Circle) theCircle = GC_MakeCircle(theAx2, Vec1.Magnitude()); diff --git a/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx b/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx index 078376c0e8..46f5c631b2 100644 --- a/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx +++ b/src/ModelingAlgorithms/TKOffset/BRepOffsetAPI/BRepOffsetAPI_ThruSections.cxx @@ -1208,9 +1208,9 @@ Handle(Geom_BSplineSurface) BRepOffsetAPI_ThruSections::TotalSurf( TopoDS_Edge aNextEdge = TopoDS::Edge(shapes((j - 1) * NbEdges + i)); Standard_Real aTolV = Precision::Confusion(); TopExp::Vertices(aNextEdge, vf, vl); - aTolV = Max(aTolV, BRep_Tool::Tolerance(vf)); - aTolV = Max(aTolV, BRep_Tool::Tolerance(vl)); - aTolV = Min(aTolV, 1.e-3); + aTolV = std::max(aTolV, BRep_Tool::Tolerance(vf)); + aTolV = std::max(aTolV, BRep_Tool::Tolerance(vl)); + aTolV = std::min(aTolV, 1.e-3); curvBS = EdgeToBSpline(aNextEdge); if (curvBS.IsNull()) { @@ -1257,7 +1257,7 @@ Handle(Geom_BSplineSurface) BRepOffsetAPI_ThruSections::TotalSurf( if (myPres3d <= 1.e-3) nbIt = 0; - Standard_Integer degmin = 2, degmax = Max(myDegMax, degmin); + Standard_Integer degmin = 2, degmax = std::max(myDegMax, degmin); Standard_Boolean SpApprox = Standard_True; GeomFill_AppSurf anApprox(degmin, degmax, myPres3d, myPres3d, nbIt); @@ -1446,7 +1446,7 @@ const TopTools_ListOfShape& BRepOffsetAPI_ThruSections::Generated(const TopoDS_S Standard_Integer Eindex = myVertexIndex(S); Standard_Integer Vindex = (Eindex > 0) ? 0 : 1; - Eindex = Abs(Eindex); + Eindex = std::abs(Eindex); // Find the first longitudinal edge TopoDS_Face FirstFace = TopoDS::Face(AllFaces(Eindex)); diff --git a/src/ModelingAlgorithms/TKOffset/BiTgte/BiTgte_Blend.cxx b/src/ModelingAlgorithms/TKOffset/BiTgte/BiTgte_Blend.cxx index b1820e7dff..5ddd1de7c3 100644 --- a/src/ModelingAlgorithms/TKOffset/BiTgte/BiTgte_Blend.cxx +++ b/src/ModelingAlgorithms/TKOffset/BiTgte/BiTgte_Blend.cxx @@ -239,7 +239,7 @@ static void KPartCurve3d(const TopoDS_Edge& Edge, if (STy == GeomAbs_Sphere) { gp_Pnt2d P = C.Line().Location(); - if (Abs(Abs(P.Y()) - M_PI / 2.) < Precision::PConfusion()) + if (std::abs(std::abs(P.Y()) - M_PI / 2.) < Precision::PConfusion()) { TheBuilder.Degenerated(Edge, Standard_True); } @@ -633,7 +633,7 @@ static TopoDS_Edge FindCreatedEdge(const TopoDS_Vertex& V1, Handle(Geom_Circle) Circ = Handle(Geom_Circle)::DownCast(CET); if (Circ.IsNull()) continue; - if (Abs(Circ->Radius() - Abs(Radius)) > Tol) + if (std::abs(Circ->Radius() - std::abs(Radius)) > Tol) continue; TopoDS_Vertex U1, U2; @@ -1394,7 +1394,7 @@ void BiTgte_Blend::ComputeCenters() // ------------ // Preanalyze. // ------------ - Standard_Real TolAngle = 2 * ASin(myTol / Abs(myRadius * 0.5)); + Standard_Real TolAngle = 2 * std::asin(myTol / std::abs(myRadius * 0.5)); myAnalyse.Perform(myShape, TolAngle); // ------------------------------------------ @@ -1851,7 +1851,7 @@ void BiTgte_Blend::ComputeSurfaces() Handle(Geom_Surface) GS1, GS2; Handle(Geom_Curve) GC1, GC2; - Standard_Real TolAngle = 2 * ASin(myTol / Abs(myRadius * 0.5)); + Standard_Real TolAngle = 2 * std::asin(myTol / std::abs(myRadius * 0.5)); BRepOffset_Analyse CenterAnalyse(myResult, TolAngle); // ----------------------------------------------------- diff --git a/src/ModelingAlgorithms/TKOffset/Draft/Draft.cxx b/src/ModelingAlgorithms/TKOffset/Draft/Draft.cxx index aa5dd63488..288ab5d422 100644 --- a/src/ModelingAlgorithms/TKOffset/Draft/Draft.cxx +++ b/src/ModelingAlgorithms/TKOffset/Draft/Draft.cxx @@ -63,13 +63,13 @@ Standard_Real Draft::Angle(const TopoDS_Face& F, const gp_Dir& D) { normale.Reverse(); } - Angle = ASin(normale.Dot(D)); + Angle = std::asin(normale.Dot(D)); } else if (TypeS == STANDARD_TYPE(Geom_CylindricalSurface)) { gp_Cylinder Cy(Handle(Geom_CylindricalSurface)::DownCast(S)->Cylinder()); Standard_Real testdir = D.Dot(Cy.Axis().Direction()); - if (Abs(testdir) <= 1. - Precision::Angular()) + if (std::abs(testdir) <= 1. - Precision::Angular()) { throw Standard_DomainError(); } @@ -79,7 +79,7 @@ Standard_Real Draft::Angle(const TopoDS_Face& F, const gp_Dir& D) { // STANDARD_TYPE(Geom_ConicalSurface) gp_Cone Co(Handle(Geom_ConicalSurface)::DownCast(S)->Cone()); Standard_Real testdir = D.Dot(Co.Axis().Direction()); - if (Abs(testdir) <= 1. - Precision::Angular()) + if (std::abs(testdir) <= 1. - Precision::Angular()) { throw Standard_DomainError(); } @@ -94,7 +94,7 @@ Standard_Real Draft::Angle(const TopoDS_Face& F, const gp_Dir& D) { d1u.Reverse(); } - Angle = ASin(d1u.Dot(D)); + Angle = std::asin(d1u.Dot(D)); } return Angle; } diff --git a/src/ModelingAlgorithms/TKOffset/Draft/Draft_EdgeInfo.cxx b/src/ModelingAlgorithms/TKOffset/Draft/Draft_EdgeInfo.cxx index b5c45b05ca..f5d481df1f 100644 --- a/src/ModelingAlgorithms/TKOffset/Draft/Draft_EdgeInfo.cxx +++ b/src/ModelingAlgorithms/TKOffset/Draft/Draft_EdgeInfo.cxx @@ -51,7 +51,7 @@ void Draft_EdgeInfo::Add(const TopoDS_Face& F) { mySeconF = F; } - myTol = Max(myTol, BRep_Tool::Tolerance(F)); + myTol = std::max(myTol, BRep_Tool::Tolerance(F)); } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKOffset/Draft/Draft_Modification.cxx b/src/ModelingAlgorithms/TKOffset/Draft/Draft_Modification.cxx index 1576475880..d2fe9b6734 100644 --- a/src/ModelingAlgorithms/TKOffset/Draft/Draft_Modification.cxx +++ b/src/ModelingAlgorithms/TKOffset/Draft/Draft_Modification.cxx @@ -273,7 +273,7 @@ Standard_Boolean Draft_Modification::NewCurve(const TopoDS_Edge& E, return Standard_False; Tol = Einf.Tolerance(); - Tol = Max(Tol, BRep_Tool::Tolerance(E)); + Tol = std::max(Tol, BRep_Tool::Tolerance(E)); L.Identity(); C = myEMap.FindFromKey(E).Geometry(); @@ -460,7 +460,7 @@ Standard_Boolean Draft_Modification::NewParameter(const TopoDS_Vertex& V, // Patch Standard_Real FirstPar = GC->FirstParameter(), LastPar = GC->LastParameter(); constexpr Standard_Real pconf = Precision::PConfusion(); - if (Abs(paramf - LastPar) <= pconf) + if (std::abs(paramf - LastPar) <= pconf) { paramf = FirstPar; FV.Orientation(E.Orientation()); @@ -482,7 +482,7 @@ Standard_Boolean Draft_Modification::NewParameter(const TopoDS_Vertex& V, } } - Tol = Max(BRep_Tool::Tolerance(V), BRep_Tool::Tolerance(E)); + Tol = std::max(BRep_Tool::Tolerance(V), BRep_Tool::Tolerance(E)); return Standard_True; } diff --git a/src/ModelingAlgorithms/TKOffset/Draft/Draft_Modification_1.cxx b/src/ModelingAlgorithms/TKOffset/Draft/Draft_Modification_1.cxx index a2e0302155..756245101b 100644 --- a/src/ModelingAlgorithms/TKOffset/Draft/Draft_Modification_1.cxx +++ b/src/ModelingAlgorithms/TKOffset/Draft/Draft_Modification_1.cxx @@ -220,7 +220,7 @@ Standard_Boolean Draft_Modification::InternalAdd(const TopoDS_Face& F, else { gp_Cone Co = Handle(Geom_ConicalSurface)::DownCast(NewS)->Cone(); - Standard_Real Vapex = -Co.RefRadius() / Sin(Co.SemiAngle()); + Standard_Real Vapex = -Co.RefRadius() / std::sin(Co.SemiAngle()); if (vmin < Vapex) { // vmax should not exceed Vapex if (vmax + deltav > Vapex) @@ -1148,16 +1148,16 @@ void Draft_Modification::Perform() GeomAPI_ProjectPointOnSurf projector(Pnt, S1, Precision::Confusion()); Standard_Real U, V; projector.LowerDistanceParameters(U, V); - if (Abs(U) <= Precision::Confusion() - || Abs(U - 2. * M_PI) <= Precision::Confusion()) + if (std::abs(U) <= Precision::Confusion() + || std::abs(U - 2. * M_PI) <= Precision::Confusion()) Candidates.Append(aCurve); else { Pnt = aCurve->Value(aCurve->LastParameter()); projector.Init(Pnt, S1, Precision::Confusion()); projector.LowerDistanceParameters(U, V); - if (Abs(U) <= Precision::Confusion() - || Abs(U - 2. * M_PI) <= Precision::Confusion()) + if (std::abs(U) <= Precision::Confusion() + || std::abs(U - 2. * M_PI) <= Precision::Confusion()) { aCurve->Reverse(); Candidates.Append(aCurve); @@ -1288,7 +1288,7 @@ void Draft_Modification::Perform() */ } // else: i2s.NbLines() > 2 && S1 is Cylinder or Cone - Einf.Tolerance(Max(Einf.Tolerance(), i2s.TolReached3d())); + Einf.Tolerance(std::max(Einf.Tolerance(), i2s.TolReached3d())); } // End step KPart } else @@ -1574,7 +1574,7 @@ void Draft_Modification::Perform() } else { - if (Abs(initpar - param) > Precision::PConfusion()) + if (std::abs(initpar - param) > Precision::PConfusion()) { Standard_Real f, l; TopLoc_Location Loc; @@ -1646,7 +1646,7 @@ void Draft_Modification::Perform() aDirOL.Divide(sqrt(aSqMagn)); const Standard_Real aCosF = aDirNF.Dot(aDirOF), aCosL = aDirNL.Dot(aDirOL); - const Standard_Real aCosMax = Abs(aCosF) > Abs(aCosL) ? aCosF : aCosL; + const Standard_Real aCosMax = std::abs(aCosF) > std::abs(aCosL) ? aCosF : aCosL; if (aCosMax < 0.0) { @@ -1689,9 +1689,9 @@ void Draft_Modification::Perform() // pf >= pl Standard_Real FirstPar = theCurve->FirstParameter(), LastPar = theCurve->LastParameter(); constexpr Standard_Real pconf = Precision::PConfusion(); - if (Abs(pf - LastPar) <= pconf) + if (std::abs(pf - LastPar) <= pconf) pf = FirstPar; - else if (Abs(pl - FirstPar) <= pconf) + else if (std::abs(pl - FirstPar) <= pconf) pl = LastPar; if (pl <= pf) @@ -1732,7 +1732,7 @@ Handle(Geom_Surface) Draft_Modification::NewSurface(const Handle(Geom_Surface)& Standard_Real Theta; if (FindRotation(Pl, Oris, Direction, Angle, NeutralPlane, Axe, Theta)) { - if (Abs(Theta) > Precision::Angular()) + if (std::abs(Theta) > Precision::Angular()) { NewS = Handle(Geom_Surface)::DownCast(S->Rotated(Axe, Theta)); } @@ -1745,7 +1745,7 @@ Handle(Geom_Surface) Draft_Modification::NewSurface(const Handle(Geom_Surface)& else if (TypeS == STANDARD_TYPE(Geom_CylindricalSurface)) { Standard_Real testdir = Direction.Dot(NeutralPlane.Axis().Direction()); - if (Abs(testdir) <= 1. - Precision::Angular()) + if (std::abs(testdir) <= 1. - Precision::Angular()) { #ifdef OCCT_DEBUG std::cout << "NewSurfaceCyl:Draft_Direction_and_Neutral_Perpendicular" << std::endl; @@ -1754,14 +1754,14 @@ Handle(Geom_Surface) Draft_Modification::NewSurface(const Handle(Geom_Surface)& } gp_Cylinder Cy = Handle(Geom_CylindricalSurface)::DownCast(S)->Cylinder(); testdir = Direction.Dot(Cy.Axis().Direction()); - if (Abs(testdir) <= 1. - Precision::Angular()) + if (std::abs(testdir) <= 1. - Precision::Angular()) { #ifdef OCCT_DEBUG std::cout << "NewSurfaceCyl:Draft_Direction_and_Cylinder_Perpendicular" << std::endl; #endif return NewS; } - if (Abs(Angle) > Precision::Angular()) + if (std::abs(Angle) > Precision::Angular()) { IntAna_QuadQuadGeo i2s; i2s.Perform(NeutralPlane, Cy, Precision::Angular(), Precision::Confusion()); @@ -1797,7 +1797,7 @@ Handle(Geom_Surface) Draft_Modification::NewSurface(const Handle(Geom_Surface)& alpha = -alpha; } Standard_Real Z = ElCLib::LineParameter(Cy.Axis(), Center); - Standard_Real Rad = Cy.Radius() + Z * Tan(alpha); + Standard_Real Rad = Cy.Radius() + Z * std::tan(alpha); if (Rad < 0.) { Rad = -Rad; @@ -1818,7 +1818,7 @@ Handle(Geom_Surface) Draft_Modification::NewSurface(const Handle(Geom_Surface)& { Standard_Real testdir = Direction.Dot(NeutralPlane.Axis().Direction()); - if (Abs(testdir) <= 1. - Precision::Angular()) + if (std::abs(testdir) <= 1. - Precision::Angular()) { #ifdef OCCT_DEBUG std::cout << "NewSurfaceCone:Draft_Direction_and_Neutral_Perpendicular" << std::endl; @@ -1829,7 +1829,7 @@ Handle(Geom_Surface) Draft_Modification::NewSurface(const Handle(Geom_Surface)& gp_Cone Co1 = Handle(Geom_ConicalSurface)::DownCast(S)->Cone(); testdir = Direction.Dot(Co1.Axis().Direction()); - if (Abs(testdir) <= 1. - Precision::Angular()) + if (std::abs(testdir) <= 1. - Precision::Angular()) { #ifdef OCCT_DEBUG std::cout << "NewSurfaceCone:Draft_Direction_and_Cone_Perpendicular" << std::endl; @@ -1856,14 +1856,14 @@ Handle(Geom_Surface) Draft_Modification::NewSurface(const Handle(Geom_Surface)& } gp_Pnt Center = i2s.Circle(1).Location(); - if (Abs(Angle) > Precision::Angular()) + if (std::abs(Angle) > Precision::Angular()) { if (testdir < 0.) { alpha = -alpha; } Standard_Real Z = ElCLib::LineParameter(Co1.Axis(), Center); - Standard_Real Rad = i2s.Circle(1).Radius() + Z * Tan(alpha); + Standard_Real Rad = i2s.Circle(1).Radius() + Z * std::tan(alpha); if (Rad < 0.) { Rad = -Rad; @@ -1872,7 +1872,7 @@ Handle(Geom_Surface) Draft_Modification::NewSurface(const Handle(Geom_Surface)& { alpha = -alpha; } - if (Abs(alpha - Co1.SemiAngle()) < Precision::Angular()) + if (std::abs(alpha - Co1.SemiAngle()) < Precision::Angular()) { NewS = S; } @@ -1918,7 +1918,7 @@ Handle(Geom_Curve) Draft_Modification::NewCurve(const Handle(Geom_Curve)& C, Standard_Real Theta; if (FindRotation(Pl, Oris, Direction, Angle, NeutralPlane, Axe, Theta)) { - if (Abs(Theta) > Precision::Angular()) + if (std::abs(Theta) > Precision::Angular()) { NewC = Handle(Geom_Curve)::DownCast(C->Rotated(Axe, Theta)); } @@ -1937,7 +1937,7 @@ Handle(Geom_Curve) Draft_Modification::NewCurve(const Handle(Geom_Curve)& C, gp_Lin lin = Handle(Geom_Line)::DownCast(C)->Lin(); // Standard_Real testdir = Direction.Dot(lin.Direction()); - // if (Abs(testdir) <= 1.-Precision::Angular()) { + // if (std::abs(testdir) <= 1.-Precision::Angular()) { // return NewC; // } gp_Dir Norm; @@ -2128,7 +2128,7 @@ static Standard_Real Parameter(const Handle(Geom_Curve)& C, const gp_Pnt& P, Sta else if (ctyp == STANDARD_TYPE(Geom_Circle)) { param = ElCLib::Parameter(Handle(Geom_Circle)::DownCast(cbase)->Circ(), P); - if (Abs(2. * M_PI - param) <= Epsilon(2. * M_PI)) + if (std::abs(2. * M_PI - param) <= Epsilon(2. * M_PI)) { param = 0.; } @@ -2136,7 +2136,7 @@ static Standard_Real Parameter(const Handle(Geom_Curve)& C, const gp_Pnt& P, Sta else if (ctyp == STANDARD_TYPE(Geom_Ellipse)) { param = ElCLib::Parameter(Handle(Geom_Ellipse)::DownCast(cbase)->Elips(), P); - if (Abs(2. * M_PI - param) <= Epsilon(2. * M_PI)) + if (std::abs(2. * M_PI - param) <= Epsilon(2. * M_PI)) { param = 0.; } @@ -2193,7 +2193,7 @@ static Standard_Real Parameter(const Handle(Geom_Curve)& C, const gp_Pnt& P, Sta { Standard_Real Per = cbase->Period(); Standard_Real Tolp = Precision::Parametric(Precision::Confusion()); - if (Abs(Per - param) <= Tolp) + if (std::abs(Per - param) <= Tolp) { param = 0.; } @@ -2340,7 +2340,7 @@ static Standard_Boolean FindRotation(const gp_Pln& Pl, gp_Dir nx = li.Direction(); gp_Dir ny = Pl.Axis().Direction().Crossed(nx); Standard_Real a = Direction.Dot(nx); - if (Abs(a) <= 1 - Precision::Angular()) + if (std::abs(a) <= 1 - Precision::Angular()) { Standard_Real b = Direction.Dot(ny); Standard_Real c = Direction.Dot(Pl.Axis().Direction()); @@ -2350,19 +2350,19 @@ static Standard_Boolean FindRotation(const gp_Pln& Pl, b = -b; c = -c; } - Standard_Real denom = Sqrt(1 - a * a); - Standard_Real Sina = Sin(Angle); - if (denom > Abs(Sina)) + Standard_Real denom = std::sqrt(1 - a * a); + Standard_Real Sina = std::sin(Angle); + if (denom > std::abs(Sina)) { - Standard_Real phi = ATan2(b / denom, c / denom); - Standard_Real theta0 = ACos(Sina / denom); + Standard_Real phi = std::atan2(b / denom, c / denom); + Standard_Real theta0 = std::acos(Sina / denom); theta = theta0 - phi; - if (Cos(theta) < 0.) + if (std::cos(theta) < 0.) { theta = -theta0 - phi; } // modified by NIZHNY-EAP Tue Nov 16 15:51:38 1999 ___BEGIN___ - while (Abs(theta) > M_PI) + while (std::abs(theta) > M_PI) { theta = theta + M_PI * (theta < 0 ? 1 : -1); } diff --git a/src/ModelingAlgorithms/TKPrim/BRepPreviewAPI/BRepPreviewAPI_MakeBox.cxx b/src/ModelingAlgorithms/TKPrim/BRepPreviewAPI/BRepPreviewAPI_MakeBox.cxx index a8a017bd9c..152aa2d23e 100644 --- a/src/ModelingAlgorithms/TKPrim/BRepPreviewAPI/BRepPreviewAPI_MakeBox.cxx +++ b/src/ModelingAlgorithms/TKPrim/BRepPreviewAPI/BRepPreviewAPI_MakeBox.cxx @@ -31,9 +31,9 @@ void BRepPreviewAPI_MakeBox::Build(const Message_ProgressRange& /*theRange*/) anLocation.Y() + myWedge.GetYMax(), anLocation.Z() + myWedge.GetZMax()); - Standard_Boolean aThinOnX = Abs(aFirstPoint.X() - aSecondPoint.X()) < Precision::Confusion(); - Standard_Boolean aThinOnY = Abs(aFirstPoint.Y() - aSecondPoint.Y()) < Precision::Confusion(); - Standard_Boolean aThinOnZ = Abs(aFirstPoint.Z() - aSecondPoint.Z()) < Precision::Confusion(); + Standard_Boolean aThinOnX = std::abs(aFirstPoint.X() - aSecondPoint.X()) < Precision::Confusion(); + Standard_Boolean aThinOnY = std::abs(aFirstPoint.Y() - aSecondPoint.Y()) < Precision::Confusion(); + Standard_Boolean aThinOnZ = std::abs(aFirstPoint.Z() - aSecondPoint.Z()) < Precision::Confusion(); Standard_Integer aPreviewType = (int)aThinOnX + (int)aThinOnY + (int)aThinOnZ; diff --git a/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_Cone.cxx b/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_Cone.cxx index c125bd5e85..aeb7bb5a7e 100644 --- a/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_Cone.cxx +++ b/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_Cone.cxx @@ -44,7 +44,7 @@ BRepPrim_Cone::BRepPrim_Cone(const Standard_Real Angle, throw Standard_DomainError("cone with angle > PI/2"); // cut at top - VMax(Height / Cos(myHalfAngle)); + VMax(Height / std::cos(myHalfAngle)); VMin(0.); SetMeridian(); } @@ -141,7 +141,7 @@ void BRepPrim_Cone::SetMeridian() A.Translate(V); Handle(Geom_Line) L = new Geom_Line(A); Handle(Geom2d_Line) L2d = - new Geom2d_Line(gp_Pnt2d(myRadius, 0), gp_Dir2d(Sin(myHalfAngle), Cos(myHalfAngle))); + new Geom2d_Line(gp_Pnt2d(myRadius, 0), gp_Dir2d(std::sin(myHalfAngle), std::cos(myHalfAngle))); Meridian(L, L2d); } @@ -153,15 +153,15 @@ void BRepPrim_Cone::SetParameters(const Standard_Real R1, { if (((R1 != 0) && (R1 < Precision::Confusion())) || ((R2 != 0) && (R2 < Precision::Confusion()))) throw Standard_DomainError("cone with negative or too small radius"); - if (Abs(R1 - R2) < Precision::Confusion()) + if (std::abs(R1 - R2) < Precision::Confusion()) throw Standard_DomainError("cone with two identic radii"); if (H < Precision::Confusion()) throw Standard_DomainError("cone with negative or null height"); myRadius = R1; - myHalfAngle = ATan((R2 - R1) / H); + myHalfAngle = std::atan((R2 - R1) / H); // cut top and bottom VMin(0.); - VMax(Sqrt(H * H + (R2 - R1) * (R2 - R1))); + VMax(std::sqrt(H * H + (R2 - R1) * (R2 - R1))); } diff --git a/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_Cone.hxx b/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_Cone.hxx index d4cb2025e6..3839d1d142 100644 --- a/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_Cone.hxx +++ b/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_Cone.hxx @@ -64,7 +64,7 @@ public: //! //! Error : R1 and R2 < Resolution //! R1 or R2 negative - //! Abs(R1-R2) < Resolution + //! std::abs(R1-R2) < Resolution //! H < Resolution //! H negative Standard_EXPORT BRepPrim_Cone(const Standard_Real R1, diff --git a/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_OneAxis.cxx b/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_OneAxis.cxx index 0f92085e0a..4a061c5081 100644 --- a/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_OneAxis.cxx +++ b/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_OneAxis.cxx @@ -180,7 +180,7 @@ void BRepPrim_OneAxis::VMax(const Standard_Real V) Standard_Boolean BRepPrim_OneAxis::MeridianOnAxis(const Standard_Real V) const { - return Abs(MeridianValue(V).X()) < Precision::Confusion(); + return std::abs(MeridianValue(V).X()) < Precision::Confusion(); } //================================================================================================= @@ -381,7 +381,7 @@ const TopoDS_Face& BRepPrim_OneAxis::TopFace() gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(gp_Dir2d::D::X))); myBuilder.SetPCurve(myEdges[ETOPEND], myFaces[FTOP], - gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(Cos(myAngle), Sin(myAngle)))); + gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(std::cos(myAngle), std::sin(myAngle)))); } myBuilder.CompleteFace(myFaces[FTOP]); @@ -422,7 +422,7 @@ const TopoDS_Face& BRepPrim_OneAxis::BottomFace() gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(gp_Dir2d::D::X))); myBuilder.SetPCurve(myEdges[EBOTEND], myFaces[FBOTTOM], - gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(Cos(myAngle), Sin(myAngle)))); + gp_Lin2d(gp_Pnt2d(0, 0), gp_Dir2d(std::cos(myAngle), std::sin(myAngle)))); } myBuilder.CompleteFace(myFaces[FBOTTOM]); diff --git a/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_OneAxis.hxx b/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_OneAxis.hxx index 4ddb7c7edc..6f129aa5e7 100644 --- a/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_OneAxis.hxx +++ b/src/ModelingAlgorithms/TKPrim/BRepPrim/BRepPrim_OneAxis.hxx @@ -110,7 +110,7 @@ public: //! Returns True if the point of parameter on the //! meridian is on the Axis. Default implementation is - //! Abs(MeridianValue(V).X()) < Precision::Confusion() + //! std::abs(MeridianValue(V).X()) < Precision::Confusion() Standard_EXPORT virtual Standard_Boolean MeridianOnAxis(const Standard_Real V) const; //! Returns True if the meridian is closed. diff --git a/src/ModelingAlgorithms/TKPrim/BRepPrimAPI/BRepPrimAPI_MakeBox.cxx b/src/ModelingAlgorithms/TKPrim/BRepPrimAPI/BRepPrimAPI_MakeBox.cxx index 4d98a42eea..f0a9ea1a13 100644 --- a/src/ModelingAlgorithms/TKPrim/BRepPrimAPI/BRepPrimAPI_MakeBox.cxx +++ b/src/ModelingAlgorithms/TKPrim/BRepPrimAPI/BRepPrimAPI_MakeBox.cxx @@ -43,9 +43,9 @@ BRepPrimAPI_MakeBox::BRepPrimAPI_MakeBox(const Standard_Real dx, const Standard_Real dy, const Standard_Real dz) : myWedge(gp_Ax2(pmin(gp_Pnt(0, 0, 0), dx, dy, dz), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), - Abs(dx), - Abs(dy), - Abs(dz)) + std::abs(dx), + std::abs(dy), + std::abs(dz)) { } @@ -56,9 +56,9 @@ BRepPrimAPI_MakeBox::BRepPrimAPI_MakeBox(const gp_Pnt& P, const Standard_Real dy, const Standard_Real dz) : myWedge(gp_Ax2(pmin(P, dx, dy, dz), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), - Abs(dx), - Abs(dy), - Abs(dz)) + std::abs(dx), + std::abs(dy), + std::abs(dz)) { } @@ -66,14 +66,14 @@ BRepPrimAPI_MakeBox::BRepPrimAPI_MakeBox(const gp_Pnt& P, inline gp_Pnt pmin(const gp_Pnt& p1, const gp_Pnt& p2) { - return gp_Pnt(Min(p1.X(), p2.X()), Min(p1.Y(), p2.Y()), Min(p1.Z(), p2.Z())); + return gp_Pnt(std::min(p1.X(), p2.X()), std::min(p1.Y(), p2.Y()), std::min(p1.Z(), p2.Z())); } BRepPrimAPI_MakeBox::BRepPrimAPI_MakeBox(const gp_Pnt& P1, const gp_Pnt& P2) : myWedge(gp_Ax2(pmin(P1, P2), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), - Abs(P2.X() - P1.X()), - Abs(P2.Y() - P1.Y()), - Abs(P2.Z() - P1.Z())) + std::abs(P2.X() - P1.X()), + std::abs(P2.Y() - P1.Y()), + std::abs(P2.Z() - P1.Z())) { } @@ -95,9 +95,9 @@ void BRepPrimAPI_MakeBox::Init(const Standard_Real theDX, { myWedge = BRepPrim_Wedge( gp_Ax2(pmin(gp_Pnt(0, 0, 0), theDX, theDY, theDZ), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), - Abs(theDX), - Abs(theDY), - Abs(theDZ)); + std::abs(theDX), + std::abs(theDY), + std::abs(theDZ)); } //================================================================================================= @@ -109,9 +109,9 @@ void BRepPrimAPI_MakeBox::Init(const gp_Pnt& thePnt, { myWedge = BRepPrim_Wedge( gp_Ax2(pmin(thePnt, theDX, theDY, theDZ), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), - Abs(theDX), - Abs(theDY), - Abs(theDZ)); + std::abs(theDX), + std::abs(theDY), + std::abs(theDZ)); } //================================================================================================= @@ -120,9 +120,9 @@ void BRepPrimAPI_MakeBox::Init(const gp_Pnt& thePnt1, const gp_Pnt& thePnt2) { myWedge = BRepPrim_Wedge(gp_Ax2(pmin(thePnt1, thePnt2), gp_Dir(gp_Dir::D::Z), gp_Dir(gp_Dir::D::X)), - Abs(thePnt2.X() - thePnt1.X()), - Abs(thePnt2.Y() - thePnt1.Y()), - Abs(thePnt2.Z() - thePnt1.Z())); + std::abs(thePnt2.X() - thePnt1.X()), + std::abs(thePnt2.Y() - thePnt1.Y()), + std::abs(thePnt2.Z() - thePnt1.Z())); } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKPrim/BRepPrimAPI/BRepPrimAPI_MakeSphere.cxx b/src/ModelingAlgorithms/TKPrim/BRepPrimAPI/BRepPrimAPI_MakeSphere.cxx index a30282bdcc..fb6372325e 100644 --- a/src/ModelingAlgorithms/TKPrim/BRepPrimAPI/BRepPrimAPI_MakeSphere.cxx +++ b/src/ModelingAlgorithms/TKPrim/BRepPrimAPI/BRepPrimAPI_MakeSphere.cxx @@ -33,7 +33,7 @@ BRepPrimAPI_MakeSphere::BRepPrimAPI_MakeSphere(const Standard_Real R) BRepPrimAPI_MakeSphere::BRepPrimAPI_MakeSphere(const Standard_Real R, const Standard_Real angle) : mySphere(gp_Ax2(gp::Origin(), (angle < 0. ? -1 : 1) * gp::DZ(), gp::DX()), R) { - mySphere.Angle(Abs(angle)); + mySphere.Angle(std::abs(angle)); } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKPrim/BRepSweep/BRepSweep_Revol.cxx b/src/ModelingAlgorithms/TKPrim/BRepSweep/BRepSweep_Revol.cxx index 9e618d9f74..d94adcc569 100644 --- a/src/ModelingAlgorithms/TKPrim/BRepSweep/BRepSweep_Revol.cxx +++ b/src/ModelingAlgorithms/TKPrim/BRepSweep/BRepSweep_Revol.cxx @@ -96,7 +96,7 @@ TopoDS_Shape BRepSweep_Revol::LastShape(const TopoDS_Shape& aGenS) Sweep_NumShape BRepSweep_Revol::NumShape(const Standard_Real D) const { Sweep_NumShape N; - if (Abs(Angle(D) - 2 * M_PI) <= Precision::Angular()) + if (std::abs(Angle(D) - 2 * M_PI) <= Precision::Angular()) { N.Init(2, TopAbs_EDGE, Standard_True, Standard_False, Standard_False); } @@ -131,7 +131,7 @@ gp_Ax1 BRepSweep_Revol::Axe(const gp_Ax1& Ax, const Standard_Real D) const Standard_Real BRepSweep_Revol::Angle(const Standard_Real D) const { - Standard_Real d = Abs(D); + Standard_Real d = std::abs(D); while (d > (2 * M_PI + Precision::Angular())) { d = d - 2 * M_PI; diff --git a/src/ModelingAlgorithms/TKPrim/BRepSweep/BRepSweep_Rotation.cxx b/src/ModelingAlgorithms/TKPrim/BRepSweep/BRepSweep_Rotation.cxx index 3a6b4a37a6..bcafcc4e9f 100644 --- a/src/ModelingAlgorithms/TKPrim/BRepSweep/BRepSweep_Rotation.cxx +++ b/src/ModelingAlgorithms/TKPrim/BRepSweep/BRepSweep_Rotation.cxx @@ -714,7 +714,7 @@ Standard_Boolean BRepSweep_Rotation::GDDShapeIsToAdd(const TopoDS_Shape& aNewS && aGenS.ShapeType() == TopAbs_FACE && aDirS.Type() == TopAbs_EDGE && aSubDirS.Type() == TopAbs_VERTEX) { - return (Abs(myAng - 2 * M_PI) > Precision::Angular()); + return (std::abs(myAng - 2 * M_PI) > Precision::Angular()); } else if (aNewShape.ShapeType() == TopAbs_FACE && aNewSubShape.ShapeType() == TopAbs_EDGE && aGenS.ShapeType() == TopAbs_EDGE && aDirS.Type() == TopAbs_EDGE @@ -724,7 +724,7 @@ Standard_Boolean BRepSweep_Rotation::GDDShapeIsToAdd(const TopoDS_Shape& aNewS GeomAdaptor_Surface AS(BRep_Tool::Surface(TopoDS::Face(aNewShape), Loc)); if (AS.GetType() == GeomAbs_Plane) { - return (Abs(myAng - 2 * M_PI) > Precision::Angular()); + return (std::abs(myAng - 2 * M_PI) > Precision::Angular()); } else { @@ -753,7 +753,7 @@ Standard_Boolean BRepSweep_Rotation::SeparatedWires(const TopoDS_Shape& aNewSh GeomAdaptor_Surface AS(BRep_Tool::Surface(TopoDS::Face(aNewShape), Loc)); if (AS.GetType() == GeomAbs_Plane) { - return (Abs(myAng - 2 * M_PI) <= Precision::Angular()); + return (std::abs(myAng - 2 * M_PI) <= Precision::Angular()); } else { @@ -831,8 +831,8 @@ Standard_Boolean BRepSweep_Rotation::IsInvariant(const TopoDS_Shape& aGenS) cons if (aC.GetType() == GeomAbs_Line) return Standard_True; - Standard_Real aTol = Max(BRep_Tool::Tolerance(V1), BRep_Tool::Tolerance(V2)); - gp_Lin Lin(myAxe.Location(), myAxe.Direction()); + Standard_Real aTol = std::max(BRep_Tool::Tolerance(V1), BRep_Tool::Tolerance(V2)); + gp_Lin Lin(myAxe.Location(), myAxe.Direction()); const TColgp_Array1OfPnt& aPoles = (aC.GetType() == GeomAbs_BSplineCurve ? aC.BSpline()->Poles() : aC.Bezier()->Poles()); diff --git a/src/ModelingAlgorithms/TKPrim/BRepSweep/BRepSweep_Trsf.cxx b/src/ModelingAlgorithms/TKPrim/BRepSweep/BRepSweep_Trsf.cxx index a8b05bc7f4..a2a0969289 100644 --- a/src/ModelingAlgorithms/TKPrim/BRepSweep/BRepSweep_Trsf.cxx +++ b/src/ModelingAlgorithms/TKPrim/BRepSweep/BRepSweep_Trsf.cxx @@ -107,8 +107,9 @@ void BRepSweep_Trsf::SetContinuity(const TopoDS_Shape& aGenS, const Sweep_NumSha TopExp::Vertices(E, d, f); if (d.IsSame(f)) { - // tol3d = Max(tl,BRep_Tool::Tolerance(d)); - const Standard_Real tol3d = Max(tl, 2. * BRep_Tool::Tolerance(d)); // IFV 24.05.00 buc60684 + // tol3d = std::max(tl,BRep_Tool::Tolerance(d)); + const Standard_Real tol3d = + std::max(tl, 2. * BRep_Tool::Tolerance(d)); // IFV 24.05.00 buc60684 e.Initialize(E); ud = BRep_Tool::Parameter(d, TopoDS::Edge(aGenS)); uf = BRep_Tool::Parameter(f, TopoDS::Edge(aGenS)); @@ -169,9 +170,9 @@ void BRepSweep_Trsf::SetContinuity(const TopoDS_Shape& aGenS, const Sweep_NumSha { u1 = BRep_Tool::Parameter(V, E1); u2 = BRep_Tool::Parameter(V, E2); - // tol3d = Max(tl,BRep_Tool::Tolerance(V)); + // tol3d = std::max(tl,BRep_Tool::Tolerance(V)); const Standard_Real tol3d = - Max(tl, 2. * BRep_Tool::Tolerance(V)); // IFV 24.05.00 buc60684 + std::max(tl, 2. * BRep_Tool::Tolerance(V)); // IFV 24.05.00 buc60684 e1.Initialize(E1); e2.Initialize(E2); cont = BRepLProp::Continuity(e1, e2, u1, u2, tol3d, ta); diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeAlgo/ShapeAlgo_AlgoContainer.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeAlgo/ShapeAlgo_AlgoContainer.cxx index 8d8f8d91f4..e1797f345b 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeAlgo/ShapeAlgo_AlgoContainer.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeAlgo/ShapeAlgo_AlgoContainer.cxx @@ -561,7 +561,7 @@ Standard_Boolean ShapeAlgo_AlgoContainer::HomoWires(const TopoDS_Wire& wireIn1, iterPerry = Standard_True; nbCreatedEdges++; } - else if (Abs(delta1 * ratio - delta2) <= epsilon) + else if (std::abs(delta1 * ratio - delta2) <= epsilon) { BRepBuilderAPI_MakeEdge makeEdge1(crv1, first1, last1); BRepBuilderAPI_MakeEdge makeEdge2(crv2, first2, last2); diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis.cxx index 4270b91dd7..62bf9025a0 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis.cxx @@ -50,8 +50,8 @@ Standard_Real ShapeAnalysis::AdjustByPeriod(const Standard_Real Val, const Standard_Real Period) { Standard_Real diff = Val - ToVal; - Standard_Real D = Abs(diff); - Standard_Real P = Abs(Period); + Standard_Real D = std::abs(diff); + Standard_Real P = std::abs(Period); if (D <= 0.5 * P) return 0.; if (P < 1e-100) @@ -214,7 +214,7 @@ Standard_Boolean ShapeAnalysis::IsOuterBound(const TopoDS_Face& face) { BRepAdaptor_Surface Ads(F, Standard_False); Standard_Real tol = BRep_Tool::Tolerance(F); - Standard_Real toluv = Min(Ads.UResolution(tol), Ads.VResolution(tol)); + Standard_Real toluv = std::min(Ads.UResolution(tol), Ads.VResolution(tol)); BRepTopAdaptor_FClass2d fcl(F, toluv); Standard_Boolean rescl = (fcl.PerformInfinitePoint() == TopAbs_OUT); return rescl; diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_BoxBndTree.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_BoxBndTree.cxx index e548791868..acc849570b 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_BoxBndTree.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_BoxBndTree.cxx @@ -128,7 +128,7 @@ Standard_Boolean ShapeAnalysis_BoxBndTreeSelector::Accept(const Standard_Integer } Standard_Integer result = res1; Standard_Real min3d; - min3d = Min(dm1, dm2); + min3d = std::min(dm1, dm2); if (min3d > myMin3d) return Standard_False; diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_CanonicalRecognition.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_CanonicalRecognition.cxx index 1fc5c17396..3367e0439f 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_CanonicalRecognition.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_CanonicalRecognition.cxx @@ -603,7 +603,7 @@ Handle(Geom_Surface) ShapeAnalysis_CanonicalRecognition::GetSurface( return anElemSurf; } gp_Ax3 aPos1; - TColStd_Array1OfReal aParams1(1, Max(1, GetNbPars(theTarget))); + TColStd_Array1OfReal aParams1(1, std::max(1, GetNbPars(theTarget))); const TopoDS_Shape& aFace = anIter.Value(); anElemSurf = GetSurface(TopoDS::Face(aFace), theTol, theType, theTarget, theGap, theStatus); @@ -621,7 +621,7 @@ Handle(Geom_Surface) ShapeAnalysis_CanonicalRecognition::GetSurface( anIter.Next(); } gp_Ax3 aPos; - TColStd_Array1OfReal aParams(1, Max(1, GetNbPars(theTarget))); + TColStd_Array1OfReal aParams(1, std::max(1, GetNbPars(theTarget))); Standard_Boolean isOK; for (; anIter.More(); anIter.Next()) { @@ -692,7 +692,7 @@ Handle(Geom_Surface) ShapeAnalysis_CanonicalRecognition::GetSurface( } gp_Ax3 aPos; - Standard_Integer aNbPars = Max(1, GetNbPars(theTarget)); + Standard_Integer aNbPars = std::max(1, GetNbPars(theTarget)); TColStd_Array1OfReal aParams(1, aNbPars); Standard_Integer ifit = -1, i; @@ -754,7 +754,7 @@ Handle(Geom_Surface) ShapeAnalysis_CanonicalRecognition::GetSurface( const TopoDS_Edge& anEdge1 = TopoDS::Edge(anIter.Value()); gp_Ax3 aPos1 = thePos; Standard_Integer aNbPars = GetNbPars(theTarget); - TColStd_Array1OfReal aParams1(1, Max(1, aNbPars)); + TColStd_Array1OfReal aParams1(1, std::max(1, aNbPars)); Standard_Real aGap1; Standard_Integer i; for (i = 1; i <= aNbPars; ++i) @@ -772,7 +772,7 @@ Handle(Geom_Surface) ShapeAnalysis_CanonicalRecognition::GetSurface( { gp_Ax3 aPos = aPos1; aNbPars = GetNbPars(theTarget); - TColStd_Array1OfReal aParams(1, Max(1, aNbPars)); + TColStd_Array1OfReal aParams(1, std::max(1, aNbPars)); for (i = 1; i <= aNbPars; ++i) { aParams(i) = aParams1(i); @@ -1052,7 +1052,7 @@ Standard_Boolean CompareConicParams(const GeomAbs_CurveType theTarget, for (i = 1; i <= aNbPars; ++i) { - if (Abs(theRefParams(i) - theParams(i)) > theTol) + if (std::abs(theRefParams(i) - theParams(i)) > theTol) return Standard_False; } @@ -1132,7 +1132,7 @@ Standard_Boolean CompareSurfParams(const GeomAbs_SurfaceType theTarget, { if (theTarget != GeomAbs_Plane) { - if (Abs(theRefParams(1) - theParams(1)) > theTol) + if (std::abs(theRefParams(1) - theParams(1)) > theTol) { return Standard_False; } @@ -1190,7 +1190,7 @@ Standard_Real DeviationSurfParams(const GeomAbs_SurfaceType theTarget, Standard_Real aDevPars = 0.; if (theTarget != GeomAbs_Plane) { - aDevPars = Abs(theRefParams(1) - theParams(1)); + aDevPars = std::abs(theRefParams(1) - theParams(1)); } // if (theTarget == GeomAbs_Sphere) @@ -1202,7 +1202,7 @@ Standard_Real DeviationSurfParams(const GeomAbs_SurfaceType theTarget, { const gp_Dir& aRefDir = theRefPos.Direction(); const gp_Dir& aDir = thePos.Direction(); - Standard_Real anAngDev = (1. - Abs(aRefDir * aDir)); + Standard_Real anAngDev = (1. - std::abs(aRefDir * aDir)); aDevPars += anAngDev; } @@ -1219,7 +1219,7 @@ Standard_Boolean GetSamplePoints(const TopoDS_Wire& theWire, NCollection_Vector aLengths; NCollection_Vector aCurves; NCollection_Vector aPoints; - Standard_Real aTol = Max(1.e-3, theTol / 10.); + Standard_Real aTol = std::max(1.e-3, theTol / 10.); Standard_Real aTotalLength = 0.; TopoDS_Iterator anEIter(theWire); for (; anEIter.More(); anEIter.Next()) @@ -1243,7 +1243,7 @@ Standard_Boolean GetSamplePoints(const TopoDS_Wire& theWire, const BRepAdaptor_Curve& aC = aCurves(i); Standard_Real aClength = GCPnts_AbscissaPoint::Length(aC, aTol); Standard_Integer aNbPoints = RealToInt(aClength / aTotalLength * theMaxNbInt + 1); - aNbPoints = Max(2, aNbPoints); + aNbPoints = std::max(2, aNbPoints); GCPnts_QuasiUniformAbscissa aPointGen(aC, aNbPoints); if (!aPointGen.IsDone()) continue; @@ -1288,7 +1288,7 @@ static Standard_Real GetLSGap(const Handle(TColgp_HArray1OfXYZ)& thePoints, for (i = thePoints->Lower(); i <= thePoints->Upper(); ++i) { gp_XYZ aD = thePoints->Value(i) - aLoc; - aGap = Max(aGap, Abs((aD.Modulus() - anR))); + aGap = std::max(aGap, std::abs((aD.Modulus() - anR))); } } else if (theTarget == GeomAbs_Cylinder) @@ -1298,7 +1298,7 @@ static Standard_Real GetLSGap(const Handle(TColgp_HArray1OfXYZ)& thePoints, { gp_Vec aD(thePoints->Value(i) - aLoc); aD.Cross(aDir); - aGap = Max(aGap, Abs((aD.Magnitude() - anR))); + aGap = std::max(aGap, std::abs((aD.Magnitude() - anR))); } } else if (theTarget == GeomAbs_Cone) @@ -1312,9 +1312,9 @@ static Standard_Real GetLSGap(const Handle(TColgp_HArray1OfXYZ)& thePoints, ElSLib::ConeParameters(thePos, anR, anAng, aPi, u, v); gp_Pnt aPp; ElSLib::ConeD0(u, v, thePos, anR, anAng, aPp); - aGap = Max(aGap, aPi.SquareDistance(aPp)); + aGap = std::max(aGap, aPi.SquareDistance(aPp)); } - aGap = Sqrt(aGap); + aGap = std::sqrt(aGap); } return aGap; @@ -1360,7 +1360,7 @@ void FillSolverData(const GeomAbs_SurfaceType theTarget, aDR = 0.1; } Standard_Real aDXYZ = aDR; - Standard_Real aDAng = theRelDev * Abs(theParams(1)); + Standard_Real aDAng = theRelDev * std::abs(theParams(1)); Standard_Integer i; for (i = 1; i <= 3; ++i) { @@ -1370,11 +1370,11 @@ void FillSolverData(const GeomAbs_SurfaceType theTarget, if (theParams(1) >= 0.) { theFBnd(4) = theStartPoint(4) - aDAng; - theLBnd(4) = Min(M_PI_2, theStartPoint(4) + aDR); + theLBnd(4) = std::min(M_PI_2, theStartPoint(4) + aDR); } else { - theFBnd(4) = Max(-M_PI_2, theStartPoint(4) - aDAng); + theFBnd(4) = std::max(-M_PI_2, theStartPoint(4) - aDAng); theLBnd(4) = theStartPoint(4) + aDAng; } theFBnd(5) = theStartPoint(5) - aDR; diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx index 44658457dc..11b764c129 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_CheckSmallFace.cxx @@ -198,8 +198,8 @@ Standard_Integer ShapeAnalysis_CheckSmallFace::IsSpotFace(const TopoDS_Face& F, spot.SetCoord((minx + maxx) / 2., (miny + maxy) / 2., (minz + maxz) / 2.); spotol = maxx - minx; - spotol = Max(spotol, maxy - miny); - spotol = Max(spotol, maxz - minz); + spotol = std::max(spotol, maxy - miny); + spotol = std::max(spotol, maxz - minz); spotol = spotol / 2.; return (same ? 2 : 1); @@ -343,15 +343,15 @@ Standard_Boolean ShapeAnalysis_CheckSmallFace::CheckStripEdges(const TopoDS_Edge C2 = BRep_Tool::Curve(E2, cf2, cl2); if (C1.IsNull() || C2.IsNull()) return Standard_False; - cf1 = Max(cf1, C1->FirstParameter()); - cl1 = Min(cl1, C1->LastParameter()); + cf1 = std::max(cf1, C1->FirstParameter()); + cl1 = std::min(cl1, C1->LastParameter()); Handle(Geom_TrimmedCurve) C1T = new Geom_TrimmedCurve(C1, cf1, cl1, Standard_True); // pdn protection against feature in Trimmed_Curve cf1 = C1T->FirstParameter(); cl1 = C1T->LastParameter(); Handle(Geom_TrimmedCurve) CC; - cf2 = Max(cf2, C2->FirstParameter()); - cl2 = Min(cl2, C2->LastParameter()); + cf2 = std::max(cf2, C2->FirstParameter()); + cl2 = std::min(cl2, C2->LastParameter()); Handle(Geom_TrimmedCurve) C2T = new Geom_TrimmedCurve(C2, cf2, cl2, Standard_True); cf2 = C2T->FirstParameter(); cl2 = C2T->LastParameter(); @@ -668,7 +668,7 @@ Standard_Integer ShapeAnalysis_CheckSmallFace::CheckSplittingVertices( continue; // Out of range fpar = param - cf; lpar = param - cl; - if ((Abs(fpar) < eps) || (Abs(lpar) < eps)) + if ((std::abs(fpar) < eps) || (std::abs(lpar) < eps)) continue; // Near end or start listEdge.Append(E); listParam.Append(param); @@ -974,8 +974,8 @@ Standard_Boolean ShapeAnalysis_CheckSmallFace::CheckPinFace(const TopoDS_Face& V2 = TopExp::LastVertex(theFirstEdge); p1 = BRep_Tool::Pnt(V1); p2 = BRep_Tool::Pnt(V2); - tol = Max(BRep_Tool::Tolerance(V1), BRep_Tool::Tolerance(V2)); - if (toler > 0) // tol = Max(tol, toler); gka + tol = std::max(BRep_Tool::Tolerance(V1), BRep_Tool::Tolerance(V2)); + if (toler > 0) // tol = std::max(tol, toler); gka tol = toler; d1 = p1.Distance(p2); if (d1 == 0) @@ -997,7 +997,7 @@ Standard_Boolean ShapeAnalysis_CheckSmallFace::CheckPinFace(const TopoDS_Face& p1 = BRep_Tool::Pnt(V1); p2 = BRep_Tool::Pnt(V2); if (toler == -1) - tol = Max(BRep_Tool::Tolerance(V1), BRep_Tool::Tolerance(V2)); + tol = std::max(BRep_Tool::Tolerance(V1), BRep_Tool::Tolerance(V2)); else tol = toler; if (p1.Distance(p2) > tol) diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_Curve.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_Curve.cxx index 3e61a2548a..88ee5d6f4c 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_Curve.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_Curve.cxx @@ -114,11 +114,11 @@ static void ProjectOnSegments(const Adaptor3d_Curve& theCurve, } if (aHasChanged) { - aProjDistance = Sqrt(aMinSqDistance); + aProjDistance = std::sqrt(aMinSqDistance); } - anEndParam = Min(anEndParam, aProjParam + aParamStep); - aStartParam = Max(aStartParam, aProjParam - aParamStep); + anEndParam = std::min(anEndParam, aProjParam + aParamStep); + aStartParam = std::max(aStartParam, aProjParam - aParamStep); } //================================================================================================= @@ -186,8 +186,8 @@ Standard_Real ShapeAnalysis_Curve::Project(const Handle(Geom_Curve)& C3D, // in that case value 0.1 was too much and this method returned not correct parameter // uMin = uMin - 0.1; // uMax = uMax + 0.1; - // modified by pdn on 01.07.98 after BUC60195 entity 1952 (Min() added) - Standard_Real delta = Min(GAC.Resolution(preci), (uMax - uMin) * 0.1); + // modified by pdn on 01.07.98 after BUC60195 entity 1952 (std::min() added) + Standard_Real delta = std::min(GAC.Resolution(preci), (uMax - uMin) * 0.1); uMin -= delta; uMax += delta; GAC.Load(C3D, uMin, uMax); @@ -539,8 +539,8 @@ Standard_Real ShapeAnalysis_Curve::NextProject(const Standard_Real paramPr // in that case value 0.1 was too much and this method returned not correct parameter // uMin = uMin - 0.1; // uMax = uMax + 0.1; - // modified by pdn on 01.07.98 after BUC60195 entity 1952 (Min() added) - Standard_Real delta = Min(GAC.Resolution(preci), (uMax - uMin) * 0.1); + // modified by pdn on 01.07.98 after BUC60195 entity 1952 (std::min() added) + Standard_Real delta = std::min(GAC.Resolution(preci), (uMax - uMin) * 0.1); uMin -= delta; uMax += delta; GAC.Load(C3D, uMin, uMax); @@ -625,10 +625,10 @@ Standard_Boolean ShapeAnalysis_Curve::ValidateRange(const Handle(Geom_Curve)& th // DANGER precision 3d applique a une espace 1d // Last = cf au lieu de Last = cl - if (Abs(Last - cf) < Precision::PConfusion() /*preci*/) + if (std::abs(Last - cf) < Precision::PConfusion() /*preci*/) Last = cl; // First = cl au lieu de First = cf - else if (Abs(First - cl) < Precision::PConfusion() /*preci*/) + else if (std::abs(First - cl) < Precision::PConfusion() /*preci*/) First = cf; // on se trouve dans un cas ou l origine est traversee @@ -661,10 +661,10 @@ Standard_Boolean ShapeAnalysis_Curve::ValidateRange(const Handle(Geom_Curve)& th // DANGER precision 3d applique a une espace 1d // Last = cf au lieu de Last = cl - if (Abs(Last - cf) < Precision::PConfusion() /*preci*/) + if (std::abs(Last - cf) < Precision::PConfusion() /*preci*/) Last = cl; // First = cl au lieu de First = cf - else if (Abs(First - cl) < Precision::PConfusion() /*preci*/) + else if (std::abs(First - cl) < Precision::PConfusion() /*preci*/) First = cf; // on se trouve dans un cas ou l origine est traversee @@ -734,11 +734,11 @@ static Standard_Integer SearchForExtremum(const Handle(Geom2d_Curve)& C2d, gp_Vec2d D1, D2; C2d->D2(par, res, D1, D2); Standard_Real Det = (D2 * dir); - if (Abs(Det) < 1e-10) + if (std::abs(Det) < 1e-10) return Standard_True; par -= (D1 * dir) / Det; - if (Abs(par - prevpar) < Precision::PConfusion()) + if (std::abs(par - prevpar) < Precision::PConfusion()) return Standard_True; if (par < First) @@ -922,7 +922,7 @@ Standard_Integer ShapeAnalysis_Curve::SelectForwardSeam(const Handle(Geom2d_Curv static gp_XYZ GetAnyNormal(const 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 { @@ -1047,7 +1047,7 @@ Standard_Boolean ShapeAnalysis_Curve::IsPlanar(const TColgp_Array1OfPnt& pnts, Normal = GetAnyNormal(N1); return Standard_True; } - return Abs(N1 * Normal) < Precision::Confusion(); + return std::abs(N1 * Normal) < Precision::Confusion(); } gp_XYZ aMaxDir; @@ -1117,7 +1117,7 @@ Standard_Boolean ShapeAnalysis_Curve::IsPlanar(const Handle(Geom_Curve)& curve, Normal = GetAnyNormal(N1); return Standard_True; } - return Abs(N1 * Normal) < Precision::Confusion(); + return std::abs(N1 * Normal) < Precision::Confusion(); } if (curve->IsKind(STANDARD_TYPE(Geom_Conic))) @@ -1344,7 +1344,7 @@ Standard_Boolean ShapeAnalysis_Curve::IsClosed(const Handle(Geom_Curve)& theCurv if (theCurve->IsClosed()) return Standard_True; - Standard_Real prec = Max(preci, Precision::Confusion()); + Standard_Real prec = std::max(preci, Precision::Confusion()); Standard_Real f, l; f = theCurve->FirstParameter(); diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_Edge.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_Edge.cxx index eb7a7935c5..20dcf3bfdc 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_Edge.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_Edge.cxx @@ -298,7 +298,7 @@ Standard_Boolean ShapeAnalysis_Edge::GetEndTangent2d( { gp_Pnt2d ptmp; Standard_Real par1, par2, delta = (cl - cf) * dpnew; - if (Abs(delta) < Precision::PConfusion()) + if (std::abs(delta) < Precision::PConfusion()) { dpnew = 0.0; } @@ -592,8 +592,8 @@ static Standard_Integer CheckVertexTolerance(const TopoDS_Edge& edge, gp_Pnt2d p2 = pcurve->Value(b); gp_Pnt P1 = S->Value(p1.X(), p1.Y()).Transformed(L.Transformation()); gp_Pnt P2 = S->Value(p2.X(), p2.Y()).Transformed(L.Transformation()); - toler1 = Max(toler1, pnt1.SquareDistance(P1)); - toler2 = Max(toler2, pnt2.SquareDistance(P2)); + toler1 = std::max(toler1, pnt1.SquareDistance(P1)); + toler2 = std::max(toler2, pnt2.SquareDistance(P2)); } } //: abv 10.06.02: porting C40 -> dev (CC670-12608.stp) @@ -609,8 +609,8 @@ static Standard_Integer CheckVertexTolerance(const TopoDS_Edge& edge, gp_Pnt2d p2 = pcurve->Value(b); gp_Pnt P1 = S->Value(p1.X(), p1.Y()).Transformed(L.Transformation()); gp_Pnt P2 = S->Value(p2.X(), p2.Y()).Transformed(L.Transformation()); - toler1 = Max(toler1, pnt1.SquareDistance(P1)); - toler2 = Max(toler2, pnt2.SquareDistance(P2)); + toler1 = std::max(toler1, pnt1.SquareDistance(P1)); + toler2 = std::max(toler2, pnt2.SquareDistance(P2)); } else Status |= ShapeExtend::EncodeStatus(ShapeExtend_FAIL3); @@ -619,8 +619,8 @@ static Standard_Integer CheckVertexTolerance(const TopoDS_Edge& edge, //: o8 abv 19 Feb 99: CTS18541.stp #18559: coeff 1.0001 added // szv 18 Aug 99: edge tolerance is taken in consideration Standard_Real tole = BRep_Tool::Tolerance(edge); - toler1 = Max(1.0000001 * Sqrt(toler1), tole); - toler2 = Max(1.0000001 * Sqrt(toler2), tole); + toler1 = std::max(1.0000001 * std::sqrt(toler1), tole); + toler2 = std::max(1.0000001 * std::sqrt(toler2), tole); if (toler1 > old1) Status |= ShapeExtend::EncodeStatus(ShapeExtend_DONE1); if (toler2 > old2) @@ -849,12 +849,16 @@ Standard_Boolean ShapeAnalysis_Edge::CheckOverlapping(const TopoDS_Edge& theEdg Standard_Real aLength2 = GCPnts_AbscissaPoint::Length(aAdCurve2); TopoDS_Edge aFirstEdge = (aLength1 >= aLength2 ? theEdge2 : theEdge1); TopoDS_Edge aSecEdge = (aLength1 >= aLength2 ? theEdge1 : theEdge2); - Standard_Real aLength = Min(aLength1, aLength2); + Standard_Real aLength = std::min(aLength1, aLength2); // check overalpping between edges on whole edges - Standard_Real aStep = Min(aLength1, aLength2) / 2; - isOverlap = - IsOverlapPartEdges(aFirstEdge, aSecEdge, theTolOverlap, aStep, 0., Min(aLength1, aLength2)); + Standard_Real aStep = std::min(aLength1, aLength2) / 2; + isOverlap = IsOverlapPartEdges(aFirstEdge, + aSecEdge, + theTolOverlap, + aStep, + 0., + std::min(aLength1, aLength2)); if (isOverlap) { @@ -867,7 +871,7 @@ Standard_Boolean ShapeAnalysis_Edge::CheckOverlapping(const TopoDS_Edge& theEdg // check overalpping between edges on segment with length less than theDomainDist Standard_Real aDomainTol = - (theDomainDist > Min(aLength1, aLength2) ? Min(aLength1, aLength2) : theDomainDist); + (theDomainDist > std::min(aLength1, aLength2) ? std::min(aLength1, aLength2) : theDomainDist); BRepExtrema_DistShapeShape aMinDist(aFirstEdge, aSecEdge, theTolOverlap); Standard_Real aresTol = theTolOverlap; if (aMinDist.IsDone()) diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_FreeBounds.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_FreeBounds.cxx index 7ce642b451..8c710d3ba6 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_FreeBounds.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_FreeBounds.cxx @@ -178,7 +178,7 @@ void ShapeAnalysis_FreeBounds::ConnectWiresToWires(Handle(TopTools_HSequenceOfSh for (i = 1; i <= arrwires->Length(); i++) arrwires->SetValue(i, iwires->Value(i)); owires = new TopTools_HSequenceOfShape; - Standard_Real tolerance = Max(toler, Precision::Confusion()); + Standard_Real tolerance = std::max(toler, Precision::Confusion()); Handle(ShapeExtend_WireData) sewd = new ShapeExtend_WireData(TopoDS::Wire(arrwires->Value(1))); @@ -388,7 +388,7 @@ static void SplitWire(const TopoDS_Wire& wire, { closed = new TopTools_HSequenceOfShape; open = new TopTools_HSequenceOfShape; - Standard_Real tolerance = Max(toler, Precision::Confusion()); + Standard_Real tolerance = std::max(toler, Precision::Confusion()); BRep_Builder B; ShapeAnalysis_Edge sae; diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_FreeBoundsProperties.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_FreeBoundsProperties.cxx index df0e060047..2ddcc13d70 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_FreeBoundsProperties.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_FreeBoundsProperties.cxx @@ -294,7 +294,7 @@ Standard_Boolean ShapeAnalysis_FreeBoundsProperties::CheckNotches(const TopoDS_W Standard_Real& distMax, const Standard_Real /*prec*/) { - Standard_Real tol = Max(myTolerance, Precision::Confusion()); + Standard_Real tol = std::max(myTolerance, Precision::Confusion()); Handle(ShapeExtend_WireData) wdt = new ShapeExtend_WireData(wire); BRep_Builder B; B.MakeWire(notch); @@ -336,7 +336,7 @@ Standard_Boolean ShapeAnalysis_FreeBoundsProperties::CheckNotches(const TopoDS_W if (E2.Orientation() == TopAbs_REVERSED) vec2.Reverse(); - Standard_Real angl = Abs(vec1.Angle(vec2)); + Standard_Real angl = std::abs(vec1.Angle(vec2)); if (angl > 0.95 * M_PI) { distMax = .0; diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_Geom.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_Geom.cxx index a697f85ab3..b97df7ff22 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_Geom.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_Geom.cxx @@ -164,14 +164,14 @@ Standard_Boolean ShapeAnalysis_Geom::PositionTrsf(const Handle(TColStd_HArray2Of Standard_Real mm = (m1 + m2 + m3) / 3.; // voici la Norme moyenne, cf Scale // szv#4:S4163:12Mar99 optimized Standard_Real pmm = prec * mm; - if (Abs(m1 - mm) > pmm || Abs(m2 - mm) > pmm || Abs(m3 - mm) > pmm) + if (std::abs(m1 - mm) > pmm || std::abs(m2 - mm) > pmm || std::abs(m3 - mm) > pmm) return Standard_False; // szv#4:S4163:12Mar99 warning v1.Divide(m1); v2.Divide(m2); v3.Divide(m3); // szv#4:S4163:12Mar99 optimized - 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; // Ici, Orthogonale et memes normes. En plus on l a Normee @@ -191,7 +191,7 @@ Standard_Boolean ShapeAnalysis_Geom::PositionTrsf(const Handle(TColStd_HArray2Of } // Restent les autres caracteristiques : - if (Abs(mm - 1.) > prec) + if (std::abs(mm - 1.) > prec) trsf.SetScale(gp_Pnt(0, 0, 0), mm); // szv#4:S4163:12Mar99 optimized gp_Vec tp(gtrsf.TranslationPart()); if (unit != 1.) diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_Surface.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_Surface.cxx index 1abb1c86a3..c1c6484063 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_Surface.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_Surface.cxx @@ -195,7 +195,7 @@ void ShapeAnalysis_Surface::ComputeSingularities() if (mySurf->IsKind(STANDARD_TYPE(Geom_ConicalSurface))) { Handle(Geom_ConicalSurface) conicS = Handle(Geom_ConicalSurface)::DownCast(mySurf); - Standard_Real vApex = -conicS->RefRadius() / Sin(conicS->SemiAngle()); + Standard_Real vApex = -conicS->RefRadius() / std::sin(conicS->SemiAngle()); myPreci[0] = 0; myP3d[0] = conicS->Apex(); myFirstP2d[0].SetCoord(su1, vApex); @@ -211,8 +211,8 @@ void ShapeAnalysis_Surface::ComputeSingularities() Standard_Real minorR = toroidS->MinorRadius(); Standard_Real majorR = toroidS->MajorRadius(); // szv#4:S4163:12Mar99 warning - possible div by zero - Standard_Real Ang = ACos(Min(1., majorR / minorR)); - myPreci[0] = myPreci[1] = Max(0., majorR - minorR); + Standard_Real Ang = std::acos(std::min(1., majorR / minorR)); + myPreci[0] = myPreci[1] = std::max(0., majorR - minorR); myP3d[0] = mySurf->Value(0., M_PI - Ang); myFirstP2d[0].SetCoord(su1, M_PI - Ang); myLastP2d[0].SetCoord(su2, M_PI - Ang); @@ -273,14 +273,14 @@ void ShapeAnalysis_Surface::ComputeSingularities() gp_Pnt Corner3 = myAdSur->Value(su2, sv1); gp_Pnt Corner4 = myAdSur->Value(su2, sv2); - myPreci[0] = - Max(Corner1.Distance(Corner2), Max(myP3d[0].Distance(Corner1), myP3d[0].Distance(Corner2))); - myPreci[1] = - Max(Corner3.Distance(Corner4), Max(myP3d[1].Distance(Corner3), myP3d[1].Distance(Corner4))); - myPreci[2] = - Max(Corner1.Distance(Corner3), Max(myP3d[2].Distance(Corner1), myP3d[2].Distance(Corner3))); - myPreci[3] = - Max(Corner2.Distance(Corner4), Max(myP3d[3].Distance(Corner2), myP3d[3].Distance(Corner4))); + myPreci[0] = std::max(Corner1.Distance(Corner2), + std::max(myP3d[0].Distance(Corner1), myP3d[0].Distance(Corner2))); + myPreci[1] = std::max(Corner3.Distance(Corner4), + std::max(myP3d[1].Distance(Corner3), myP3d[1].Distance(Corner4))); + myPreci[2] = std::max(Corner1.Distance(Corner3), + std::max(myP3d[2].Distance(Corner1), myP3d[2].Distance(Corner3))); + myPreci[3] = std::max(Corner2.Distance(Corner4), + std::max(myP3d[3].Distance(Corner2), myP3d[3].Distance(Corner4))); myNbDeg = 4; } @@ -406,7 +406,7 @@ Standard_Boolean ShapeAnalysis_Surface::ProjectDegenerated(const gp_Pnt& P { Standard_Real gap2 = myP3d[i].SquareDistance(P3d); if (gap2 > preci * preci) - gap2 = Min(gap2, myP3d[i].SquareDistance(Value(result))); + gap2 = std::min(gap2, myP3d[i].SquareDistance(Value(result))); // rln S4135 if (gap2 <= preci * preci && gapMin > gap2) { @@ -416,7 +416,7 @@ Standard_Boolean ShapeAnalysis_Surface::ProjectDegenerated(const gp_Pnt& P } if (indMin < 0) return Standard_False; - myGap = Sqrt(gapMin); + myGap = std::sqrt(gapMin); if (!myUIsoDeg[indMin]) result.SetX(neighbour.X()); else @@ -445,7 +445,7 @@ Standard_Boolean ShapeAnalysis_Surface::ProjectDegenerated(const Standard_Intege { Standard_Real gap2 = myP3d[i].SquareDistance(points(j)); if (gap2 > prec2) - gap2 = Min(gap2, myP3d[i].SquareDistance(Value(pnt2d(j)))); + gap2 = std::min(gap2, myP3d[i].SquareDistance(Value(pnt2d(j)))); if (gap2 <= prec2 && gapMin > gap2) { gapMin = gap2; @@ -455,7 +455,7 @@ Standard_Boolean ShapeAnalysis_Surface::ProjectDegenerated(const Standard_Intege if (indMin < 0) return Standard_False; - myGap = Sqrt(gapMin); + myGap = std::sqrt(gapMin); gp_Pnt2d pk; Standard_Integer k; // svv Jan11 2000 : porting on DEC @@ -504,7 +504,7 @@ Standard_Boolean ShapeAnalysis_Surface::IsDegenerated(const gp_Pnt2d& p2d1, gp_Pnt p1 = Value(p2d1); gp_Pnt p2 = Value(p2d2); gp_Pnt pm = Value(0.5 * (p2d1.XY() + p2d2.XY())); - Standard_Real max3d = Max(p1.Distance(p2), Max(pm.Distance(p1), pm.Distance(p2))); + Standard_Real max3d = std::max(p1.Distance(p2), std::max(pm.Distance(p1), pm.Distance(p2))); if (max3d > tol) return Standard_False; @@ -514,8 +514,8 @@ Standard_Boolean ShapeAnalysis_Surface::IsDegenerated(const gp_Pnt2d& p2d1, if (RU < Precision::PConfusion() || RV < Precision::PConfusion()) return 0; - Standard_Real du = Abs(p2d1.X() - p2d2.X()) / RU; - Standard_Real dv = Abs(p2d1.Y() - p2d2.Y()) / RV; + Standard_Real du = std::abs(p2d1.X() - p2d2.X()) / RU; + Standard_Real dv = std::abs(p2d1.Y() - p2d2.Y()) / RV; max3d *= ratio; return du * du + dv * dv > max3d * max3d; } @@ -600,7 +600,7 @@ Handle(Geom_Curve) ShapeAnalysis_Surface::VIso(const Standard_Real V) Standard_Boolean ShapeAnalysis_Surface::IsUClosed(const Standard_Real preci) { - Standard_Real prec = Max(preci, Precision::Confusion()); + Standard_Real prec = std::max(preci, Precision::Confusion()); Standard_Real anUmidVal = -1.; if (myUCloseVal < 0) { @@ -609,8 +609,8 @@ Standard_Boolean ShapeAnalysis_Surface::IsUClosed(const Standard_Real preci) Bounds(uf, ul, vf, vl); // modified by rln on 12/11/97 mySurf-> is deleted // mySurf->Bounds (uf,ul,vf,vl); RestrictBounds(uf, ul, vf, vl); - myUDelt = Abs(ul - uf) / 20; // modified by rln 11/11/97 instead of 10 - // because of the example when 10 was not enough + myUDelt = std::abs(ul - uf) / 20; // modified by rln 11/11/97 instead of 10 + // because of the example when 10 was not enough if (mySurf->IsUClosed()) { myUCloseVal = 0.; @@ -697,11 +697,11 @@ Standard_Boolean ShapeAnalysis_Surface::IsUClosed(const Standard_Real preci) } else { - distmin = Min(distmin, aDist); + distmin = std::min(distmin, aDist); } } - distmin = Sqrt(distmin); - myUDelt = Min(myUDelt, 0.5 * SurfAdapt.UResolution(distmin)); // #4 smh + distmin = std::sqrt(distmin); + myUDelt = std::min(myUDelt, 0.5 * SurfAdapt.UResolution(distmin)); // #4 smh } else { @@ -719,11 +719,11 @@ Standard_Boolean ShapeAnalysis_Surface::IsUClosed(const Standard_Real preci) } else { - distmin = Min(distmin, aDist); + distmin = std::min(distmin, aDist); } } - distmin = Sqrt(distmin); - myUDelt = Min(myUDelt, 0.5 * SurfAdapt.UResolution(distmin)); // #4 smh + distmin = std::sqrt(distmin); + myUDelt = std::min(myUDelt, 0.5 * SurfAdapt.UResolution(distmin)); // #4 smh } break; } @@ -751,11 +751,11 @@ Standard_Boolean ShapeAnalysis_Surface::IsUClosed(const Standard_Real preci) } else { - distmin = Min(distmin, aDist); + distmin = std::min(distmin, aDist); } } - distmin = Sqrt(distmin); - myUDelt = Min(myUDelt, 0.5 * SurfAdapt.UResolution(distmin)); // #4 smh + distmin = std::sqrt(distmin); + myUDelt = std::min(myUDelt, 0.5 * SurfAdapt.UResolution(distmin)); // #4 smh } break; } @@ -782,11 +782,11 @@ Standard_Boolean ShapeAnalysis_Surface::IsUClosed(const Standard_Real preci) } else { - distmin = Min(distmin, aDist); + distmin = std::min(distmin, aDist); } } - distmin = Sqrt(distmin); - myUDelt = Min(myUDelt, 0.5 * SurfAdapt.UResolution(distmin)); // #4 smh + distmin = std::sqrt(distmin); + myUDelt = std::min(myUDelt, 0.5 * SurfAdapt.UResolution(distmin)); // #4 smh break; } } // switch @@ -807,7 +807,7 @@ Standard_Boolean ShapeAnalysis_Surface::IsUClosed(const Standard_Real preci) Standard_Boolean ShapeAnalysis_Surface::IsVClosed(const Standard_Real preci) { - Standard_Real prec = Max(preci, Precision::Confusion()); + Standard_Real prec = std::max(preci, Precision::Confusion()); Standard_Real aVmidVal = -1.; if (myVCloseVal < 0) { @@ -816,8 +816,8 @@ Standard_Boolean ShapeAnalysis_Surface::IsVClosed(const Standard_Real preci) Bounds(uf, ul, vf, vl); // modified by rln on 12/11/97 mySurf-> is deleted // mySurf->Bounds (uf,ul,vf,vl); RestrictBounds(uf, ul, vf, vl); - myVDelt = Abs(vl - vf) / 20; // 2; rln S4135 - // because of the example when 10 was not enough + myVDelt = std::abs(vl - vf) / 20; // 2; rln S4135 + // because of the example when 10 was not enough if (mySurf->IsVClosed()) { myVCloseVal = 0.; @@ -891,11 +891,11 @@ Standard_Boolean ShapeAnalysis_Surface::IsVClosed(const Standard_Real preci) } else { - distmin = Min(distmin, aDist); + distmin = std::min(distmin, aDist); } } - distmin = Sqrt(distmin); - myVDelt = Min(myVDelt, 0.5 * SurfAdapt.VResolution(distmin)); // #4 smh + distmin = std::sqrt(distmin); + myVDelt = std::min(myVDelt, 0.5 * SurfAdapt.VResolution(distmin)); // #4 smh } else { @@ -913,11 +913,11 @@ Standard_Boolean ShapeAnalysis_Surface::IsVClosed(const Standard_Real preci) } else { - distmin = Min(distmin, aDist); + distmin = std::min(distmin, aDist); } } - distmin = Sqrt(distmin); - myVDelt = Min(myVDelt, 0.5 * SurfAdapt.VResolution(distmin)); // #4 smh + distmin = std::sqrt(distmin); + myVDelt = std::min(myVDelt, 0.5 * SurfAdapt.VResolution(distmin)); // #4 smh } break; } @@ -945,11 +945,11 @@ Standard_Boolean ShapeAnalysis_Surface::IsVClosed(const Standard_Real preci) } else { - distmin = Min(distmin, aDist); + distmin = std::min(distmin, aDist); } } - distmin = Sqrt(distmin); - myVDelt = Min(myVDelt, 0.5 * SurfAdapt.VResolution(distmin)); // #4 smh + distmin = std::sqrt(distmin); + myVDelt = std::min(myVDelt, 0.5 * SurfAdapt.VResolution(distmin)); // #4 smh } break; } @@ -976,15 +976,15 @@ Standard_Boolean ShapeAnalysis_Surface::IsVClosed(const Standard_Real preci) } else { - distmin = Min(distmin, aDist); + distmin = std::min(distmin, aDist); } } - distmin = Sqrt(distmin); - myVDelt = Min(myVDelt, 0.5 * SurfAdapt.VResolution(distmin)); // #4 smh + distmin = std::sqrt(distmin); + myVDelt = std::min(myVDelt, 0.5 * SurfAdapt.VResolution(distmin)); // #4 smh break; } } // switch - myGap = Sqrt(myVCloseVal); + myGap = std::sqrt(myVCloseVal); myVCloseVal = myGap; } @@ -1056,7 +1056,7 @@ Standard_Integer ShapeAnalysis_Surface::SurfaceNewton(const gp_Pnt2d& p2dPre // rs2p = rs2; // test the step by uv and deviation from the solution - Standard_Real aResolution = Max(1e-12, (U + V) * 10e-16); + Standard_Real aResolution = std::max(1e-12, (U + V) * 10e-16); if (fabs(du) + fabs(dv) > aResolution) continue; // Precision::PConfusion() continue; @@ -1118,7 +1118,7 @@ gp_Pnt2d ShapeAnalysis_Surface::NextValueOfUV(const gp_Pnt2d& p2dPrev, for (Standard_Integer anIdx = aMinIndex; anIdx <= aMaxIndex; ++anIdx) { Standard_Real aKnot = aBSpline->UKnot(anIdx); - if (Abs(aKnot - p2dPrev.X()) < Precision::Confusion()) + if (std::abs(aKnot - p2dPrev.X()) < Precision::Confusion()) return ValueOfUV(P3D, preci); } } @@ -1131,7 +1131,7 @@ gp_Pnt2d ShapeAnalysis_Surface::NextValueOfUV(const gp_Pnt2d& p2dPrev, for (Standard_Integer anIdx = aMinIndex; anIdx <= aMaxIndex; ++anIdx) { Standard_Real aKnot = aBSpline->VKnot(anIdx); - if (Abs(aKnot - p2dPrev.Y()) < Precision::Confusion()) + if (std::abs(aKnot - p2dPrev.Y()) < Precision::Confusion()) return ValueOfUV(P3D, preci); } } @@ -1248,7 +1248,7 @@ gp_Pnt2d ShapeAnalysis_Surface::ValueOfUV(const gp_Pnt& P3D, const Standard_Real // code is taken from GeomAPI_ProjectPointOnSurf if (!myExtOK) { - // Standard_Real du = Abs(ul-uf)/100; Standard_Real dv = Abs(vl-vf)/100; + // Standard_Real du = std::abs(ul-uf)/100; Standard_Real dv = std::abs(vl-vf)/100; // if (IsUClosed()) du = 0; if (IsVClosed()) dv = 0; // Forcer appel a IsU-VClosed if (myUCloseVal < 0) @@ -1261,8 +1261,8 @@ gp_Pnt2d ShapeAnalysis_Surface::ValueOfUV(const gp_Pnt& P3D, const Standard_Real if (!mySurf->IsKind(STANDARD_TYPE(Geom_OffsetSurface))) { // modified by rln during fixing CSR # BUC60035 entity #D231 - du = Min(myUDelt, SurfAdapt.UResolution(preci)); - dv = Min(myVDelt, SurfAdapt.VResolution(preci)); + du = std::min(myUDelt, SurfAdapt.UResolution(preci)); + dv = std::min(myVDelt, SurfAdapt.VResolution(preci)); } constexpr Standard_Real Tol = Precision::PConfusion(); myExtPS.SetFlag(Extrema_ExtFlag_MIN); diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_TransferParametersProj.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_TransferParametersProj.cxx index 3d17fd9889..0351ecabbd 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_TransferParametersProj.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_TransferParametersProj.cxx @@ -240,7 +240,7 @@ static Standard_Real CorrectParameter(const Handle(Geom2d_Curve)& crv, const Sta for (Standard_Integer j = bspline->FirstUKnotIndex(); j <= bspline->LastUKnotIndex(); j++) { Standard_Real valknot = bspline->Knot(j); - if (Abs(valknot - param) < Precision::PConfusion()) + if (std::abs(valknot - param) < Precision::PConfusion()) return valknot; } } @@ -365,7 +365,7 @@ void ShapeAnalysis_TransferParametersProj::TransferRange(TopoDS_Edge& Standard_Real linLast = first + beta * len; Standard_Real dist1 = sac.NextProject(linFirst, GAC, ploc1, myPrecision, pproj, ppar1); Standard_Real dist2 = sac.NextProject(linLast, GAC, ploc2, myPrecision, pproj, ppar2); - Standard_Boolean useLinear = Abs(ppar1 - ppar2) < preci; + Standard_Boolean useLinear = std::abs(ppar1 - ppar2) < preci; gp_Pnt pos1 = C3d->Value(linFirst); gp_Pnt pos2 = C3d->Value(linLast); @@ -426,7 +426,7 @@ void ShapeAnalysis_TransferParametersProj::TransferRange(TopoDS_Edge& Standard_Boolean isFirstOnEnd = (ppar1 - first) / len < Precision::PConfusion(); Standard_Boolean isLastOnEnd = (last - ppar2) / len < Precision::PConfusion(); - Standard_Boolean useLinear = Abs(ppar1 - ppar2) < Precision::PConfusion(); + Standard_Boolean useLinear = std::abs(ppar1 - ppar2) < Precision::PConfusion(); if (isFirstOnEnd && !localLinearFirst) localLinearFirst = Standard_True; if (isLastOnEnd && !localLinearLast) diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_Wire.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_Wire.cxx index f2b1732753..51d78f3c21 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_Wire.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_Wire.cxx @@ -860,8 +860,8 @@ Standard_Boolean ShapeAnalysis_Wire::CheckDegenerated(const Standard_Integer num Standard_Boolean lack = Standard_False; Standard_Boolean dgnr = Standard_False; // pdn 12.03.99 minimal value processing first - Standard_Real precFirst = Min(myPrecision, BRep_Tool::Tolerance(V1)); - Standard_Real precFin = Max(myPrecision, BRep_Tool::Tolerance(V1)); + Standard_Real precFirst = std::min(myPrecision, BRep_Tool::Tolerance(V1)); + Standard_Real precFin = std::max(myPrecision, BRep_Tool::Tolerance(V1)); Standard_Real precVtx = (myPrecision < BRep_Tool::Tolerance(V1) ? 2 * precFin : precFin); // forward : si Edge FWD/REV. Si LACK, toujours True Standard_Boolean forward = (E2.Orientation() == TopAbs_FORWARD); @@ -980,7 +980,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckDegenerated(const Standard_Integer num // the situation when degenerated edge already exists but flag is not set //(i.e. the parametric space is closed) GeomAdaptor_Surface& Ads = *mySurf->Adaptor3d(); - Standard_Real max = Max(Ads.UResolution(myPrecision), Ads.VResolution(myPrecision)); + Standard_Real max = std::max(Ads.UResolution(myPrecision), Ads.VResolution(myPrecision)); if (p2d1.Distance(p2d2) /*Abs (par1 - par2)*/ <= max + gp::Resolution()) return Standard_False; @@ -1054,8 +1054,8 @@ Standard_Boolean ShapeAnalysis_Wire::CheckGap2d(const Standard_Integer num) gp_Pnt2d p2 = C2->Value(uf2); myMin2d = myMax2d = p1.Distance(p2); GeomAdaptor_Surface& SA = *mySurf->Adaptor3d(); - if (myMin2d - > (Max(SA.UResolution(myPrecision), SA.VResolution(myPrecision)) + Precision::PConfusion())) + if (myMin2d > (std::max(SA.UResolution(myPrecision), SA.VResolution(myPrecision)) + + Precision::PConfusion())) myStatus = ShapeExtend::EncodeStatus(ShapeExtend_DONE1); return LastCheckStatus(ShapeExtend_DONE); } @@ -1097,7 +1097,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckCurveGap(const Standard_Integer num) if (maxdist < dist) maxdist = dist; } - myMin3d = myMax3d = Sqrt(maxdist); + myMin3d = myMax3d = std::sqrt(maxdist); if (myMin3d > myPrecision) myStatus = ShapeExtend::EncodeStatus(ShapeExtend_DONE1); return LastCheckStatus(ShapeExtend_DONE); @@ -1148,7 +1148,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckSelfIntersectingEdge( myStatus |= ShapeExtend::EncodeStatus(ShapeExtend_FAIL1); return Standard_False; } - if (Abs(a - b) <= ::Precision::PConfusion()) + if (std::abs(a - b) <= ::Precision::PConfusion()) return Standard_False; Standard_Real tolint = 1.0e-10; @@ -1258,15 +1258,15 @@ Standard_Boolean ShapeAnalysis_Wire::CheckIntersectingEdges( myStatus |= ShapeExtend::EncodeStatus(ShapeExtend_FAIL3); return Standard_False; } - if (Abs(a1 - b1) <= ::Precision::PConfusion() || + if (std::abs(a1 - b1) <= ::Precision::PConfusion() || // clang-format off - Abs ( a2 - b2 ) <= ::Precision::PConfusion() ) return Standard_False; //:f7 abv 6 May 98: BUC50070 on #42276 + std::abs( a2 - b2 ) <= ::Precision::PConfusion() ) return Standard_False; //:f7 abv 6 May 98: BUC50070 on #42276 // clang-format on Standard_Boolean isForward1 = (edge1.Orientation() == TopAbs_FORWARD); Standard_Boolean isForward2 = (edge2.Orientation() == TopAbs_FORWARD); - Standard_Real tol0 = Max(BRep_Tool::Tolerance(V1), BRep_Tool::Tolerance(V2)); + Standard_Real tol0 = std::max(BRep_Tool::Tolerance(V1), BRep_Tool::Tolerance(V2)); Standard_Real tol = tol0; gp_Pnt pnt = BRep_Tool::Pnt(V1); @@ -1297,9 +1297,10 @@ Standard_Boolean ShapeAnalysis_Wire::CheckIntersectingEdges( //: 86 abv 22 Jan 98: fix self-intersection even if tolerance of vertex is enough // to annihilate it. This is done to prevent wrong effects if vertex tolerance // will be decreased (e.g., in FixLacking) - Standard_Real tole = Max((BRep_Tool::SameParameter(edge1) ? BRep_Tool::Tolerance(edge1) : tol0), - (BRep_Tool::SameParameter(edge2) ? BRep_Tool::Tolerance(edge2) : tol0)); - Standard_Real tolt = Min(tol, Max(tole, myPrecision)); + Standard_Real tole = + std::max((BRep_Tool::SameParameter(edge1) ? BRep_Tool::Tolerance(edge1) : tol0), + (BRep_Tool::SameParameter(edge2) ? BRep_Tool::Tolerance(edge2) : tol0)); + Standard_Real tolt = std::min(tol, std::max(tole, myPrecision)); // Standard_Real prevRange1 = RealLast(), prevRange2 = RealLast(); //SK Standard_Integer isLacking = -1; //: l0 abv: CATIA01 #1727: protect against adding lacking // #83 rln 19.03.99 sim2.igs, entity 4292 @@ -1344,7 +1345,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckIntersectingEdges( gp_Pnt pint = 0.5 * (pi1.XYZ() + pi2.XYZ()); Standard_Real di1 = pi1.SquareDistance(pnt); Standard_Real di2 = pi2.SquareDistance(pnt); - Standard_Real dist2 = Max(di1, di2); + Standard_Real dist2 = std::max(di1, di2); // rln 03/02/98: CSR#BUC50004 entity 56 (to avoid later inserting lacking edge) if (isLacking < 0) @@ -1354,7 +1355,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckIntersectingEdges( //: l0 Standard_Real distab2 = mySurf->Value ( end1 ).SquareDistance ( mySurf->Value ( //: end2 ) ); l0: test like in BRepCheck GeomAdaptor_Surface& Ads = *mySurf->Adaptor3d(); - Standard_Real tol2d = 2 * Max(Ads.UResolution(tol), Ads.VResolution(tol)); + Standard_Real tol2d = 2 * std::max(Ads.UResolution(tol), Ads.VResolution(tol)); isLacking = (end1.SquareDistance(end2) >= tol2d * tol2d); } @@ -1420,7 +1421,8 @@ Standard_Boolean ShapeAnalysis_Wire::CheckIntersectingEdges( return Standard_False; } - if (Abs(a1 - b1) <= ::Precision::PConfusion() || Abs(a2 - b2) <= ::Precision::PConfusion()) + if (std::abs(a1 - b1) <= ::Precision::PConfusion() + || std::abs(a2 - b2) <= ::Precision::PConfusion()) return Standard_False; points2d.Clear(); @@ -1579,21 +1581,21 @@ Standard_Boolean ShapeAnalysis_Wire::CheckLacking(const Standard_Integer num, myMax2d = v12.SquareMagnitude(); // test like in BRepCheck - Standard_Real tol = Max(BRep_Tool::Tolerance(V1), BRep_Tool::Tolerance(V2)); + Standard_Real tol = std::max(BRep_Tool::Tolerance(V1), BRep_Tool::Tolerance(V2)); tol = (Tolerance > gp::Resolution() && Tolerance < tol ? Tolerance : tol); GeomAdaptor_Surface& Ads = *mySurf->Adaptor3d(); - Standard_Real tol2d = 2 * Max(Ads.UResolution(tol), Ads.VResolution(tol)); + Standard_Real tol2d = 2 * std::max(Ads.UResolution(tol), Ads.VResolution(tol)); if ( // tol2d < gp::Resolution() || //#2 smh 26.03.99 S4163 Zero divide myMax2d < tol2d * tol2d) return Standard_False; - myMax2d = Sqrt(myMax2d); - myMax3d = tol * myMax2d / Max(tol2d, gp::Resolution()); + myMax2d = std::sqrt(myMax2d); + myMax3d = tol * myMax2d / std::max(tol2d, gp::Resolution()); myStatus |= ShapeExtend::EncodeStatus(ShapeExtend_DONE1); if (myMax2d < Precision::PConfusion() || //: abv 03.06.02 CTS21866.stp - (v1.SquareMagnitude() > gp::Resolution() && Abs(v12.Angle(v1)) > 0.9 * M_PI) - || (v2.SquareMagnitude() > gp::Resolution() && Abs(v12.Angle(v2)) > 0.9 * M_PI)) + (v1.SquareMagnitude() > gp::Resolution() && std::abs(v12.Angle(v1)) > 0.9 * M_PI) + || (v2.SquareMagnitude() > gp::Resolution() && std::abs(v12.Angle(v2)) > 0.9 * M_PI)) myStatus |= ShapeExtend::EncodeStatus(ShapeExtend_DONE2); return Standard_True; } @@ -1726,7 +1728,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckNotchedEdges(const Standard_Integer nu if (v2.Magnitude() < gp::Resolution() || v1.Magnitude() < gp::Resolution()) return Standard_False; - if (Abs(v2.Angle(v1)) > 0.1 || p2d1.Distance(p2d2) > Tolerance) + if (std::abs(v2.Angle(v1)) > 0.1 || p2d1.Distance(p2d2) > Tolerance) return Standard_False; Handle(Geom2dAdaptor_Curve) AC2d1 = new Geom2dAdaptor_Curve(c2d1, a1, b1); @@ -1873,7 +1875,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckSmallArea(const TopoDS_Wire& theWire) BRepGProp::LinearProperties(aFace, aLProps); Standard_Real aNewTolerance = aLProps.Mass() * myPrecision; - if (Abs(aProps.Mass()) < 0.5 * aNewTolerance) + if (std::abs(aProps.Mass()) < 0.5 * aNewTolerance) { myStatus = ShapeExtend::EncodeStatus(ShapeExtend_DONE1); return Standard_True; @@ -1949,8 +1951,8 @@ Standard_Boolean ShapeAnalysis_Wire::CheckShapeConnect(Standard_Real& tailh dm2 = headhead; } Standard_Integer result = res1; - myMin3d = Min(dm1, dm2); - myMax3d = Max(dm1, dm2); + myMin3d = std::min(dm1, dm2); + myMax3d = std::max(dm1, dm2); if (dm1 > dm2) { dm1 = dm2; @@ -1973,7 +1975,7 @@ Standard_Boolean ShapeAnalysis_Wire::CheckShapeConnect(Standard_Real& tailh if (!res2) myStatus |= ShapeExtend::EncodeStatus(ShapeExtend_DONE6); - if (myMin3d > Max(myPrecision, prec)) + if (myMin3d > std::max(myPrecision, prec)) myStatus = ShapeExtend::EncodeStatus(ShapeExtend_FAIL2); return LastCheckStatus(ShapeExtend_DONE); } @@ -2292,12 +2294,12 @@ Standard_Boolean ShapeAnalysis_Wire::CheckTail(const TopoDS_Edge& theEdge1, Standard_Integer aResults[] = {1, 1}; for (Standard_Integer aEI = 0; aEI < 2; ++aEI) { - if (Abs(aParams[aEI] - aLs[aEI][1 - aVIs[aEI]]) <= Precision::PConfusion()) + if (std::abs(aParams[aEI] - aLs[aEI][1 - aVIs[aEI]]) <= Precision::PConfusion()) { aResults[aEI] = 2; *aEParts[aEI][0] = aEs[aEI]; } - else if (Abs(aParams[aEI] - aLs[aEI][aVIs[aEI]]) <= Precision::PConfusion()) + else if (std::abs(aParams[aEI] - aLs[aEI][aVIs[aEI]]) <= Precision::PConfusion()) { aResults[aEI] = 0; } diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_WireOrder.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_WireOrder.cxx index 7c1602d4b0..bfd32f5863 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_WireOrder.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_WireOrder.cxx @@ -170,7 +170,7 @@ Standard_Integer ShapeAnalysis_WireOrder::NbEdges() const static Standard_Real DISTABS(const gp_XYZ& v1, const gp_XYZ& v2) { - return Abs(v1.X() - v2.X()) + Abs(v1.Y() - v2.Y()) + Abs(v1.Z() - v2.Z()); + return std::abs(v1.X() - v2.X()) + std::abs(v1.Y() - v2.Y()) + std::abs(v1.Z() - v2.Z()); } // La routine qui suit gere les boucles internes a un wire. Questce a dire ? @@ -595,7 +595,7 @@ void ShapeAnalysis_WireOrder::Perform(const Standard_Boolean /*closed*/) aJoinDist = aReverseDist; } // check if we found a better distance - if (aJoinDist < aMinDist3 && Abs(aMinDist3 - aJoinDist) > aTol2) + if (aJoinDist < aMinDist3 && std::abs(aMinDist3 - aJoinDist) > aTol2) { aMinDist3 = aJoinDist; aDirect3 = (aDirectDist <= aReverseDist); @@ -603,7 +603,7 @@ void ShapeAnalysis_WireOrder::Perform(const Standard_Boolean /*closed*/) } } // check if we found a better distance - if (aMinDist3 < aMinDist2 && Abs(aMinDist2 - aMinDist3) > aTol2) + if (aMinDist3 < aMinDist2 && std::abs(aMinDist2 - aMinDist3) > aTol2) { aMinDist2 = aMinDist3; aDirect2 = aDirect3; @@ -612,7 +612,7 @@ void ShapeAnalysis_WireOrder::Perform(const Standard_Boolean /*closed*/) } } // check if we found a better distance - if (aMinDist2 < aMinDist1 && Abs(aMinDist1 - aMinDist2) > aTol2) + if (aMinDist2 < aMinDist1 && std::abs(aMinDist1 - aMinDist2) > aTol2) { aMinDist1 = aMinDist2; aLoopNum1 = aLoopIt; diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeBuild/ShapeBuild_Edge.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeBuild/ShapeBuild_Edge.cxx index 8104574bbc..b2ab857fad 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeBuild/ShapeBuild_Edge.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeBuild/ShapeBuild_Edge.cxx @@ -137,8 +137,8 @@ static Standard_Real AdjustByPeriod(const Standard_Real Val, const Standard_Real Period) { Standard_Real diff = Val - ToVal; - Standard_Real D = Abs(diff); - Standard_Real P = Abs(Period); + Standard_Real D = std::abs(diff); + Standard_Real P = std::abs(Period); if (D <= 0.5 * P) return 0.; if (P < 1e-100) @@ -640,7 +640,7 @@ Standard_Boolean ShapeBuild_Edge::BuildCurve3d(const TopoDS_Edge& edge) const // C0 surface (but curve 3d is required as C1) and tolerance is 1e-07 // lets use maximum of tolerance and default parameter 1.e-5 // Another solutions: use quite big Tolerance or require C0 curve on C0 surface - if (BRepLib::BuildCurve3d(edge, Max(1.e-5, BRep_Tool::Tolerance(edge)))) + if (BRepLib::BuildCurve3d(edge, std::max(1.e-5, BRep_Tool::Tolerance(edge)))) { // #50 S4054 rln 14.12.98 write cylinder in BRep mode into IGES and read back // with 2DUse_Forced - pcurve and removed 3D curves have different ranges diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct.cxx index 220b0c56bb..28345a5735 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct.cxx @@ -72,7 +72,7 @@ Handle(Geom_BSplineCurve) ShapeConstruct::ConvertCurveToBSpline(const Handle(Geo else { if (C3D->IsKind(STANDARD_TYPE(Geom_Conic))) - MaxDeg = Min(MaxDeg, 6); + MaxDeg = std::min(MaxDeg, 6); // clang-format off Handle(Geom_Curve) tcurve = new Geom_TrimmedCurve(C3D,First,Last); //protection against parabols ets @@ -451,7 +451,8 @@ static inline void SegmentCurve(HCurve& curve, const Standard_Real first, const if (curve->IsPeriodic()) curve->Segment(first, last); else - curve->Segment(Max(curve->FirstParameter(), first), Min(curve->LastParameter(), last)); + curve->Segment(std::max(curve->FirstParameter(), first), + std::min(curve->LastParameter(), last)); } } @@ -472,8 +473,8 @@ static inline void GetReversedParameters(const HPoint& p11, Standard_Real d12 = p11.Distance(p22); Standard_Real d22 = p22.Distance(p12); - Standard_Real Dmin1 = Min(d11, d21); - Standard_Real Dmin2 = Min(d12, d22); + Standard_Real Dmin1 = std::min(d11, d21); + Standard_Real Dmin2 = std::min(d12, d22); if (fabs(Dmin1 - Dmin2) <= Precision::Confusion() || Dmin2 > Dmin1) { isRev1 = (d11 < d21 ? Standard_True : Standard_False); diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct_Curve.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct_Curve.cxx index bd8c87b9f9..032b295923 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct_Curve.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct_Curve.cxx @@ -91,8 +91,8 @@ Standard_Boolean ShapeConstruct_Curve::AdjustCurveSegment(const Handle(Geom_Curv // Propager sur le reste, c est pas mal non plus if (U1 >= U2) return Standard_False; - Standard_Real UU1 = Max(U1, BSPL->FirstParameter()); - Standard_Real UU2 = Min(U2, BSPL->LastParameter()); + Standard_Real UU1 = std::max(U1, BSPL->FirstParameter()); + Standard_Real UU2 = std::min(U2, BSPL->LastParameter()); BSPL->Segment(UU1, UU2); BSPL->SetPole(1, P1); BSPL->SetPole(BSPL->NbPoles(), P2); diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx index c331330a46..04a90d5848 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx @@ -276,7 +276,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::Perform(Handle(Geom_Curve for (; anIdx <= bspl->NbKnots() && aFirstParam < Last; anIdx++) { // Fill current knot interval. - aLastParam = Min(Last, bspl->Knot(anIdx)); + aLastParam = std::min(Last, bspl->Knot(anIdx)); Standard_Integer aNbIntPnts = NCONTROL; // Number of inner points is adapted according to the length of the interval // to avoid a lot of calculations on small range of parameters. @@ -308,10 +308,10 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::Perform(Handle(Geom_Curve aLength3d += aDist; p3d1 = p3d2; - aMinParSpeed = Min(aMinParSpeed, aDist / aStep); + aMinParSpeed = std::min(aMinParSpeed, aDist / aStep); } const Standard_Real aCoeff = aLength3d / (aLastParam - aFirstParam); - if (Abs(aCoeff) > gp::Resolution()) + if (std::abs(aCoeff) > gp::Resolution()) aKnotCoeffs.Append(aCoeff); aFirstParam = aLastParam; } @@ -766,7 +766,7 @@ Handle(Geom2d_Curve) ShapeConstruct_ProjectCurveOnSurface::getLine( // Check that straight line in 2d with parameterisation as in 3d will fit // fit 3d curve at all points. Standard_Real dPar = theparams(nb) - theparams(1); - if (Abs(dPar) < Precision::PConfusion()) + if (std::abs(dPar) < Precision::PConfusion()) return 0; gp_Vec2d aVec0(aP2d[0], aP2d[3]); gp_Vec2d aVec = aVec0 / dPar; @@ -796,7 +796,7 @@ Handle(Geom2d_Curve) ShapeConstruct_ProjectCurveOnSurface::getLine( { Standard_Real aFirstPointDist = mySurf->Surface()->Value(aP2d[0].X(), aP2d[0].Y()).SquareDistance(thepoints(1)); - aTol2 = Max(aTol2, aTol2 * 2 * aFirstPointDist); + aTol2 = std::max(aTol2, aTol2 * 2 * aFirstPointDist); for (i = 2; i < nb; i++) { gp_XY aCurPoint = aP2d[0].XY() + aVec.XY() * (theparams(i) - theparams(1)); @@ -804,14 +804,14 @@ Handle(Geom2d_Curve) ShapeConstruct_ProjectCurveOnSurface::getLine( aSurf->D0(aCurPoint.X(), aCurPoint.Y(), aCurP); Standard_Real aDist1 = aCurP.SquareDistance(thepoints(i)); - if (Abs(aFirstPointDist - aDist1) > aTol2) + if (std::abs(aFirstPointDist - aDist1) > aTol2) return 0; } } // check if pcurve can be represented by Geom2d_Line (parameterised by length) Standard_Real aLLength = aVec0.Magnitude(); - if (Abs(aLLength - dPar) <= Precision::PConfusion()) + if (std::abs(aLLength - dPar) <= Precision::PConfusion()) { gp_XY aDirL = aVec0.XY() / aLLength; gp_Pnt2d aPL(aP2d[0].XY() - theparams(1) * aDirL); @@ -954,7 +954,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::ApproxPCurve(const Standa // Chacun des par1 ou par2 est-il sur un bord. Attention first/last : recaler if (isoclosed && (isoPar1 == parf || isoPar1 == parl)) { - if (Abs(tdeb - parf) < Abs(tdeb - parl)) + if (std::abs(tdeb - parf) < std::abs(tdeb - parl)) isoPar1 = parf; else isoPar1 = parl; @@ -968,7 +968,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::ApproxPCurve(const Standa // pdn S4030 optimizing and fix isopar case on PRO41323 tfin = pout(nbrPnt - 1); // dist = ShapeAnalysis_Curve().Project (cIso,points(nbrPnt-1),myPreci,pt,tfin,Cf,Cl); - if (Abs(tfin - parf) < Abs(tfin - parl)) + if (std::abs(tfin - parf) < std::abs(tfin - parl)) isoPar2 = parf; else isoPar2 = parl; @@ -986,8 +986,8 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::ApproxPCurve(const Standa // skl change "if" for pout(nbrPnt-1) 19.11.2003 if (!isoclosed) { - if ((Abs(tdeb - isoPar1) > Abs(tdeb - isoPar2)) - && (Abs(pout(nbrPnt - 1) - isoPar2) > Abs(pout(nbrPnt - 1) - isoPar1))) + if ((std::abs(tdeb - isoPar1) > std::abs(tdeb - isoPar2)) + && (std::abs(pout(nbrPnt - 1) - isoPar2) > std::abs(pout(nbrPnt - 1) - isoPar1))) { gp_Pnt2d valueTmp = valueP1; valueP1 = valueP2; @@ -1289,7 +1289,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::ApproxPCurve(const Standa { // dist2d = pnt2d (aPntIter - 1).Distance(pnt2d (aPntIter)); Standard_Real CurX = pnt2d(aPntIter).X(); - dist2d = Abs(CurX - prevX); + dist2d = std::abs(CurX - prevX); if (dist2d > (Up / 2)) { InsertAdditionalPointOrAdjust(ToAdjust, @@ -1381,7 +1381,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::ApproxPCurve(const Standa { // dist2d = pnt2d (i-1).Distance(pnt2d (i)); Standard_Real CurY = pnt2d(aPntIter).Y(); - dist2d = Abs(CurY - prevY); + dist2d = std::abs(CurY - prevY); if (dist2d > (Vp / 2)) { InsertAdditionalPointOrAdjust(ToAdjust, @@ -1426,7 +1426,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::ApproxPCurve(const Standa for (Standard_Integer aPntIter = 2; aPntIter <= pnt2d.Length(); ++aPntIter) { // #1 rln 11/02/98 ca_exhaust.stp entity #9869 dist2d = pnt2d (i-1).Distance(pnt2d (i)); - dist2d = Abs(pnt2d(aPntIter).Y() - pnt2d(aPntIter - 1).Y()); + dist2d = std::abs(pnt2d(aPntIter).Y() - pnt2d(aPntIter - 1).Y()); if (dist2d > (Vp / 2)) { // ATTENTION : il faut regarder ou le decalage se fait. @@ -1443,10 +1443,10 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::ApproxPCurve(const Standa Standard_Boolean currOnLast = Standard_False; // .X ? plutot .Y , non ? - Standard_Real distPrevVF = Abs(pnt2d(aPntIter - 1).Y() - vf); - Standard_Real distPrevVL = Abs(pnt2d(aPntIter - 1).Y() - vl); - Standard_Real distCurrVF = Abs(pnt2d(aPntIter).Y() - vf); - Standard_Real distCurrVL = Abs(pnt2d(aPntIter).Y() - vl); + Standard_Real distPrevVF = std::abs(pnt2d(aPntIter - 1).Y() - vf); + Standard_Real distPrevVL = std::abs(pnt2d(aPntIter - 1).Y() - vl); + Standard_Real distCurrVF = std::abs(pnt2d(aPntIter).Y() - vf); + Standard_Real distCurrVL = std::abs(pnt2d(aPntIter).Y() - vl); Standard_Real theMin = distPrevVF; prevOnFirst = Standard_True; @@ -1542,8 +1542,9 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::ApproxPCurve(const Standa // abv 16 Mar 00: trj3_s1-ug.stp #697: ignore points in singularity if (mySurf->IsDegenerated(points(ind), Precision::Confusion())) continue; - OnBound = (Abs(Abs(CurX - 0.5 * (ul + uf)) - Up / 2) <= Precision::PConfusion()); - if (!start && Abs(Abs(CurX - PrevX) - Up / 2) <= 0.01 * Up) + OnBound = + (std::abs(std::abs(CurX - 0.5 * (ul + uf)) - Up / 2) <= Precision::PConfusion()); + if (!start && std::abs(std::abs(CurX - PrevX) - Up / 2) <= 0.01 * Up) break; start = Standard_False; PrevX = CurX; @@ -1598,8 +1599,9 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::ApproxPCurve(const Standa // abv 16 Mar 00: trj3_s1-ug.stp #697: ignore points in singularity if (mySurf->IsDegenerated(points(ind), Precision::Confusion())) continue; - OnBound = (Abs(Abs(CurY - 0.5 * (vl + vf)) - Vp / 2) <= Precision::PConfusion()); - if (!start && Abs(Abs(CurY - PrevY) - Vp / 2) <= 0.01 * Vp) + OnBound = + (std::abs(std::abs(CurY - 0.5 * (vl + vf)) - Vp / 2) <= Precision::PConfusion()); + if (!start && std::abs(std::abs(CurY - PrevY) - Vp / 2) <= 0.01 * Vp) break; start = Standard_False; PrevY = CurY; @@ -1669,7 +1671,7 @@ Handle(Geom2d_Curve) ShapeConstruct_ProjectCurveOnSurface::ApproximatePCurve( Handle(TColStd_HArray1OfReal)& params, const Handle(Geom_Curve)& /*orig*/) const { - // Standard_Real resol = Min(mySurf->Adaptor3d()->VResolution(myPreci), + // Standard_Real resol = std::min(mySurf->Adaptor3d()->VResolution(myPreci), // mySurf->Adaptor3d()->UResolution(myPreci)); Standard_Real theTolerance2d = myPreci; // (100*nbrPnt);//resol; Handle(Geom2d_Curve) C2d; @@ -1874,9 +1876,9 @@ void ShapeConstruct_ProjectCurveOnSurface::CorrectExtremity(const Handle(Geom_Cu // Check correctness of { const Standard_Real aPrevDist = - Abs(SecondPointOfLine.Coord(IndCoord) - FirstPointOfLine.Coord(IndCoord)); + std::abs(SecondPointOfLine.Coord(IndCoord) - FirstPointOfLine.Coord(IndCoord)); const Standard_Real aCurDist = - Abs(EndPoint.Coord(IndCoord) - SecondPointOfLine.Coord(IndCoord)); + std::abs(EndPoint.Coord(IndCoord) - SecondPointOfLine.Coord(IndCoord)); if (aCurDist <= 2 * aPrevDist) return; } @@ -1888,7 +1890,8 @@ void ShapeConstruct_ProjectCurveOnSurface::CorrectExtremity(const Handle(Geom_Cu for (;;) { - if (Abs(SecondPointOfLine.Coord(3 - IndCoord) - FinishCoord) <= 2 * Precision::PConfusion()) + if (std::abs(SecondPointOfLine.Coord(3 - IndCoord) - FinishCoord) + <= 2 * Precision::PConfusion()) break; gp_Vec2d aVec(FirstPointOfLine, SecondPointOfLine); @@ -1912,7 +1915,7 @@ void ShapeConstruct_ProjectCurveOnSurface::CorrectExtremity(const Handle(Geom_Cu FirstPointOfLine = SecondPointOfLine; FirstParam = SecondParam; SecondParam = (FirstParam + FinishParam) / 2; - if (Abs(SecondParam - FirstParam) <= 2 * Precision::PConfusion()) + if (std::abs(SecondParam - FirstParam) <= 2 * Precision::PConfusion()) break; gp_Pnt aP3d; theC3d->D0(SecondParam, aP3d); @@ -1925,9 +1928,9 @@ void ShapeConstruct_ProjectCurveOnSurface::CorrectExtremity(const Handle(Geom_Cu // because when a projected point is too close to singularity, // the non-constant coordinate becomes random. const Standard_Real aPrevDist = - Abs(FirstPointOfLine.Coord(IndCoord) - PrevPoint.Coord(IndCoord)); + std::abs(FirstPointOfLine.Coord(IndCoord) - PrevPoint.Coord(IndCoord)); const Standard_Real aCurDist = - Abs(SecondPointOfLine.Coord(IndCoord) - FirstPointOfLine.Coord(IndCoord)); + std::abs(SecondPointOfLine.Coord(IndCoord) - FirstPointOfLine.Coord(IndCoord)); if (aCurDist > 2 * aPrevDist) break; } @@ -1991,15 +1994,15 @@ void ShapeConstruct_ProjectCurveOnSurface::InsertAdditionalPointOrAdjust( Standard_Real FirstT = PrevPar; // params(i-1) Standard_Real LastT = CurPar; // params(i) MidCoord = MidP2d.Coord(theIndCoord); - while (Abs(MidCoord - prevCoord) >= Period / 2 - TolOnPeriod - || Abs(CurCoord - MidCoord) >= Period / 2 - TolOnPeriod) + while (std::abs(MidCoord - prevCoord) >= Period / 2 - TolOnPeriod + || std::abs(CurCoord - MidCoord) >= Period / 2 - TolOnPeriod) { if (MidPar - FirstT <= Precision::PConfusion() || LastT - MidPar <= Precision::PConfusion()) { Success = Standard_False; break; // wrong choice } - if (Abs(MidCoord - prevCoord) >= Period / 2 - TolOnPeriod) + if (std::abs(MidCoord - prevCoord) >= Period / 2 - TolOnPeriod) LastT = (FirstT + LastT) / 2; else FirstT = (FirstT + LastT) / 2; @@ -2068,7 +2071,7 @@ void ShapeConstruct_ProjectCurveOnSurface::CheckPoints(Handle(TColgp_HArray1OfPn } if (DistMin2 < RealLast()) // clang-format off - preci = 0.9 * Sqrt (DistMin2); // preci est la distance min entre les points on la reduit un peu + preci = 0.9 * std::sqrt(DistMin2); // preci est la distance min entre les points on la reduit un peu // clang-format on if (nbPntDropped == 0) return; @@ -2145,7 +2148,7 @@ void ShapeConstruct_ProjectCurveOnSurface::CheckPoints2d(Handle(TColgp_HArray1Of } } if (DistMin2 < RealLast()) - preci = 0.9 * Sqrt(DistMin2); + preci = 0.9 * std::sqrt(DistMin2); if (nbPntDropped == 0) return; @@ -2372,7 +2375,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::IsAnIsoparametric( //: e7 abv 21 Apr 98: ProSTEP TR8, r0501_pe #56679: // avoid possible null-length curves - if (mp[0] > 0 && mp[1] > 0 && Abs(tp[0] - tp[1]) < Precision::PConfusion()) + if (mp[0] > 0 && mp[1] > 0 && std::abs(tp[0] - tp[1]) < Precision::PConfusion()) continue; if (mp[0] > 0 && (!p1OnIso || currd2[0] < mind2[0])) diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeCustom/ShapeCustom_BSplineRestriction.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeCustom/ShapeCustom_BSplineRestriction.cxx index 08a3ee78b4..08ef1e494b 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeCustom/ShapeCustom_BSplineRestriction.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeCustom/ShapeCustom_BSplineRestriction.cxx @@ -543,8 +543,8 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface( if (ConvertCurve(BasCurve, ResCurve, Standard_False, - Max(VF, BasCurve->FirstParameter()), - Min(VL, BasCurve->LastParameter()), + std::max(VF, BasCurve->FirstParameter()), + std::min(VL, BasCurve->LastParameter()), TolS, Standard_False)) { @@ -562,8 +562,8 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface( if (ConvertCurve(BasCurve, ResCurve, Standard_False, - Max(VF, BasCurve->FirstParameter()), - Min(VL, BasCurve->LastParameter()), + std::max(VF, BasCurve->FirstParameter()), + std::min(VL, BasCurve->LastParameter()), TolS, IsOf)) { @@ -591,8 +591,8 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface( ConvertCurve(BasCurve, ResCurve, Standard_True, - Max(UF, BasCurve->FirstParameter()), - Min(UL, BasCurve->LastParameter()), + std::max(UF, BasCurve->FirstParameter()), + std::min(UL, BasCurve->LastParameter()), TolS, IsOf); gp_Trsf shiftF, shiftL; @@ -606,8 +606,8 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface( if (ConvertCurve(BasCurve, ResCurve, Standard_False, - Max(UF, BasCurve->FirstParameter()), - Min(UL, BasCurve->LastParameter()), + std::max(UF, BasCurve->FirstParameter()), + std::min(UL, BasCurve->LastParameter()), TolS, IsOf)) { @@ -731,8 +731,8 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface( Standard_Real u1, u2, v1, v2; aSurf->Bounds(u1, u2, v1, v2); Standard_Real ShiftU = 0, ShiftV = 0; - if (Abs(u1 - UF) > Precision::PConfusion() || Abs(u2 - UL) > Precision::PConfusion() - || Abs(v1 - VF) > Precision::PConfusion() || Abs(v2 - VL) > Precision::PConfusion()) + if (std::abs(u1 - UF) > Precision::PConfusion() || std::abs(u2 - UL) > Precision::PConfusion() + || std::abs(v1 - VF) > Precision::PConfusion() || std::abs(v2 - VL) > Precision::PConfusion()) { /*if(aSurf->IsUPeriodic() ) { Standard_Real aDelta = (UL > UF ? UL - UF : UF - UL ); @@ -742,8 +742,8 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface( Standard_Boolean isTrim = Standard_False; if (!aSurf->IsUPeriodic()) { // else { - u1 = Max(u1, UF); - u2 = Min(u2, UL); + u1 = std::max(u1, UF); + u2 = std::min(u2, UL); isTrim = Standard_True; } /*if(aSurf->IsVPeriodic()) { @@ -754,8 +754,8 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface( }*/ if (!aSurf->IsVPeriodic()) { // else - v1 = Max(v1, VF); - v2 = Min(v2, VL); + v1 = std::max(v1, VF); + v2 = std::min(v2, VL); isTrim = Standard_True; } @@ -770,8 +770,8 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface( aSurf = trSurface; } } - Standard_Integer aCU = Min(ContToInteger(Cont), ContToInteger(aSurf->Continuity())); - Standard_Integer aCV = Min(ContToInteger(Cont), ContToInteger(aSurf->Continuity())); + Standard_Integer aCU = std::min(ContToInteger(Cont), ContToInteger(aSurf->Continuity())); + Standard_Integer aCV = std::min(ContToInteger(Cont), ContToInteger(aSurf->Continuity())); if (!aCU) aCU = ContToInteger(Cont); if (!aCV) @@ -805,7 +805,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface( std::cout << " iteration = " << i << "\terror = " << anApprox.MaxError() << "\tspans = " << nbOfSpan << std::endl; std::cout << " Surface is approximated with continuity " - << IntegerToGeomAbsShape(Min(aCU, aCV)) << std::endl; + << IntegerToGeomAbsShape(std::min(aCU, aCV)) << std::endl; } #endif S = anApprox.Surface(); @@ -820,8 +820,8 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface( // Standard_Integer nbUK = Bsc->NbUKnots(); // nbUK not used (skl) myConvert = Standard_True; myNbOfSpan = myNbOfSpan + nbOfSpan; - mySurfaceError = Max(mySurfaceError, anApprox.MaxError()); - if (Abs(ShiftU) > Precision::PConfusion()) + mySurfaceError = std::max(mySurfaceError, anApprox.MaxError()); + if (std::abs(ShiftU) > Precision::PConfusion()) { Standard_Integer nb = Bsc->NbUKnots(); TColStd_Array1OfReal uknots(1, nb); @@ -830,7 +830,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface( uknots(j) += ShiftU; Bsc->SetUKnots(uknots); } - if (Abs(ShiftV) > Precision::PConfusion()) + if (std::abs(ShiftV) > Precision::PConfusion()) { Standard_Integer nb = Bsc->NbVKnots(); TColStd_Array1OfReal vknots(1, nb); @@ -1005,7 +1005,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve(const Handle(Geom_ Handle(Geom_Curve) ResCurve; if (ConvertCurve(BasCurve, ResCurve, IsConvert, First, Last, TolCur, IsOf)) { - // Stanadrd_Real F = Max(pf,First), L = Min(pl,Last); + // Stanadrd_Real F = std::max(pf,First), L = std::min(pl,Last); // if(First != Last) // C = new // Geom_TrimmedCurve(ResCurve,Max(First,ResCurve->FirstParameter()),Min(Last,ResCurve->LastParameter())); @@ -1059,7 +1059,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve(const Handle(Geom_ aBSpline = GeomConvert::CurveToBSplineCurve(tcurve, Convert_QuasiAngular); Standard_Real Shift = First - aBSpline->FirstParameter(); - if (Abs(Shift) > Precision::PConfusion()) + if (std::abs(Shift) > Precision::PConfusion()) { Standard_Integer nbKnots = aBSpline->NbKnots(); TColStd_Array1OfReal newKnots(1, nbKnots); @@ -1182,7 +1182,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve(const Handle(Geom_ aCurve1 = new Geom_TrimmedCurve(aCurve, First, Last); else if (pf < (First - Precision::PConfusion()) || pl > (Last + Precision::PConfusion())) { - Standard_Real F = Max(First, pf), L = Min(Last, pl); + Standard_Real F = std::max(First, pf), L = std::min(Last, pl); if (F != L) aCurve1 = new Geom_TrimmedCurve(aCurve, F, L); else @@ -1190,10 +1190,11 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve(const Handle(Geom_ } else aCurve1 = aCurve; - Standard_Integer aC = Min(ContToInteger(myContinuity3d), ContToInteger(aCurve->Continuity())); + Standard_Integer aC = + std::min(ContToInteger(myContinuity3d), ContToInteger(aCurve->Continuity())); if (!aC) aC = ContToInteger(myContinuity3d); - // aC = Min(aC,(Deg -1)); + // aC = std::min(aC,(Deg -1)); Standard_Integer MaxSeg = myNbMaxSeg; Standard_Integer MaxDeg = myMaxDegree; // GeomAbs_Shape aCont = IntegerToGeomAbsShape(aC); @@ -1212,7 +1213,8 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve(const Handle(Geom_ C = anApprox.Curve(); Standard_Integer Nbseg = Handle(Geom_BSplineCurve)::DownCast(C)->NbKnots() - 1; Standard_Integer DegC = Handle(Geom_BSplineCurve)::DownCast(C)->Degree(); - if (myDeg && ((DegC > MaxDeg) || !Done || (anApprox.MaxError() >= Max(TolCur, myTol3d)))) + if (myDeg + && ((DegC > MaxDeg) || !Done || (anApprox.MaxError() >= std::max(TolCur, myTol3d)))) { if (MaxSeg < myParameters->GMaxSeg()) { @@ -1235,7 +1237,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve(const Handle(Geom_ } if (!myDeg && ((Nbseg > myParameters->GMaxSeg()) || !Done - || (anApprox.MaxError() >= Max(TolCur, myTol3d)))) + || (anApprox.MaxError() >= std::max(TolCur, myTol3d)))) { if (MaxDeg < myParameters->GMaxDegree()) { @@ -1258,7 +1260,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve(const Handle(Geom_ } myConvert = Standard_True; TolCur = anApprox.MaxError(); - myCurve3dError = Max(myCurve3dError, anApprox.MaxError()); + myCurve3dError = std::max(myCurve3dError, anApprox.MaxError()); return Standard_True; } } @@ -1304,7 +1306,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::NewCurve2d(const TopoDS_Edge& E Handle(Geom_Surface) aSurface = BRep_Tool::Surface(F, L); GeomAdaptor_Surface AdS(aSurface); Standard_Real TolCur = - Min(AdS.UResolution(BRep_Tool::Tolerance(E)), AdS.VResolution(BRep_Tool::Tolerance(E))); + std::min(AdS.UResolution(BRep_Tool::Tolerance(E)), AdS.VResolution(BRep_Tool::Tolerance(E))); Handle(Geom2d_Curve) aCurve = BRep_Tool::CurveOnSurface(E, F, First, Last); if (aCurve.IsNull()) return Standard_False; @@ -1381,8 +1383,8 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve2d(const Handle(Geo Handle(Geom2d_Curve) ResCurve; if (ConvertCurve2d(BasCurve, ResCurve, IsConvert, First, Last, TolCur, IsOf)) { - // Standard_Real F = Max(ResCurve->FirstParameter(),First), L = - // Min(ResCurve->LastParameter(),Last); if(F != Last) + // Standard_Real F = std::max(ResCurve->FirstParameter(),First), L = + // std::min(ResCurve->LastParameter(),Last); if(F != Last) // C = new // Geom2d_TrimmedCurve(ResCurve,Max(First,ResCurve->FirstParameter()),Min(Last,ResCurve->LastParameter())); // else @@ -1431,7 +1433,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve2d(const Handle(Geo aBSpline2d = Geom2dConvert::CurveToBSplineCurve(tcurve, Convert_QuasiAngular); Standard_Real Shift = First - aBSpline2d->FirstParameter(); - if (Abs(Shift) > Precision::PConfusion()) + if (std::abs(Shift) > Precision::PConfusion()) { Standard_Integer nbKnots = aBSpline2d->NbKnots(); TColStd_Array1OfReal newKnots(1, nbKnots); @@ -1558,7 +1560,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve2d(const Handle(Geo else if (aCurve->FirstParameter() < (First - Precision::PConfusion()) || aCurve->LastParameter() > (Last + Precision::PConfusion())) { - Standard_Real F = Max(First, pf), L = Min(Last, pl); + Standard_Real F = std::max(First, pf), L = std::min(Last, pl); if (F != L) aCurve1 = new Geom2d_TrimmedCurve(aCurve, F, L); else @@ -1566,10 +1568,11 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve2d(const Handle(Geo } else aCurve1 = aCurve; - Standard_Integer aC = Min(ContToInteger(myContinuity2d), ContToInteger(aCurve->Continuity())); + Standard_Integer aC = + std::min(ContToInteger(myContinuity2d), ContToInteger(aCurve->Continuity())); if (!aC) aC = ContToInteger(myContinuity2d); - // aC = Min(aC,(Deg -1)); + // aC = std::min(aC,(Deg -1)); Standard_Integer aC1 = aC; // GeomAbs_Shape aCont =IntegerToGeomAbsShape(aC); Standard_Integer MaxSeg = myNbMaxSeg; @@ -1589,7 +1592,8 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve2d(const Handle(Geo Standard_Integer Nbseg = Handle(Geom2d_BSplineCurve)::DownCast(C)->NbKnots() - 1; Standard_Integer DegC = Handle(Geom2d_BSplineCurve)::DownCast(C)->Degree(); - if (myDeg && ((DegC > MaxDeg) || !Done || (anApprox.MaxError() >= Max(myTol2d, TolCur)))) + if (myDeg + && ((DegC > MaxDeg) || !Done || (anApprox.MaxError() >= std::max(myTol2d, TolCur)))) { if (MaxSeg < myParameters->GMaxSeg()) { @@ -1612,7 +1616,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve2d(const Handle(Geo } if (!myDeg - && ((Nbseg >= MaxSeg) || !Done || (anApprox.MaxError() >= Max(myTol2d, TolCur)))) + && ((Nbseg >= MaxSeg) || !Done || (anApprox.MaxError() >= std::max(myTol2d, TolCur)))) { if (MaxDeg < myParameters->GMaxDegree()) { @@ -1635,7 +1639,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve2d(const Handle(Geo } myConvert = Standard_True; TolCur = anApprox.MaxError(); - myCurve2dError = Max(myCurve2dError, anApprox.MaxError()); + myCurve2dError = std::max(myCurve2dError, anApprox.MaxError()); return Standard_True; } } diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeCustom/ShapeCustom_ConvertToRevolution.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeCustom/ShapeCustom_ConvertToRevolution.cxx index d17321ca01..a34f947c83 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeCustom/ShapeCustom_ConvertToRevolution.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeCustom/ShapeCustom_ConvertToRevolution.cxx @@ -129,7 +129,7 @@ Standard_Boolean ShapeCustom_ConvertToRevolution::NewSurface(const TopoDS_Face& else if (ES->IsKind(STANDARD_TYPE(Geom_ConicalSurface))) { Handle(Geom_ConicalSurface) CS = Handle(Geom_ConicalSurface)::DownCast(ES); - gp_Dir N = dir.XYZ() + X.XYZ() * Tan(CS->SemiAngle()); + gp_Dir N = dir.XYZ() + X.XYZ() * std::tan(CS->SemiAngle()); gp_Ax1 Ax1(pos.XYZ() + X.XYZ() * CS->RefRadius(), N); BasisCurve = new Geom_Line(Ax1); } diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeCustom/ShapeCustom_Surface.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeCustom/ShapeCustom_Surface.cxx index 2b23d96e83..53a9d0391b 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeCustom/ShapeCustom_Surface.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeCustom/ShapeCustom_Surface.cxx @@ -228,7 +228,7 @@ Handle(Geom_Surface) ShapeCustom_Surface::ConvertToAnalytical(const Standard_Rea if (nVP > 2) { - if ((Abs(R(1)) < tol) && (Abs(R(2)) < tol) && (Abs(R(3)) > tol)) + if ((std::abs(R(1)) < tol) && (std::abs(R(2)) < tol) && (std::abs(R(3)) > tol)) { // deja fait gp_Ax3 aAx3(p3(1), aDir, xVec); // gp_Ax3 aAx3(p3(3), aDir); @@ -244,7 +244,7 @@ Handle(Geom_Surface) ShapeCustom_Surface::ConvertToAnalytical(const Standard_Rea // deja fait gp_Ax3 aAx3(p3(1), aDir, xVec); // gp_Ax3 aAx3(p3(1), aDir); - if (Abs(R(2) - R(1)) < tol) + if (std::abs(R(2) - R(1)) < tol) { Handle(Geom_CylindricalSurface) anObject = new Geom_CylindricalSurface(aAx3, R(1)); if (!uClosed) @@ -309,7 +309,7 @@ Handle(Geom_Surface) ShapeCustom_Surface::ConvertToAnalytical(const Standard_Rea 0.5 * (p1(i).Z() + p2(i).Z())); R(i) = p3(i).Distance(p1(i)); } - if ((Abs(R(1) - R(2)) < tol) && (Abs(R(1) - R(3)) < tol)) + if ((std::abs(R(1) - R(2)) < tol) && (std::abs(R(1) - R(3)) < tol)) { gp_Pnt p10(0.5 * (p3(1).X() + p3(2).X()), 0.5 * (p3(1).Y() + p3(2).Y()), diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeCustom/ShapeCustom_TrsfModification.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeCustom/ShapeCustom_TrsfModification.cxx index a7bba4008a..a375d552a5 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeCustom/ShapeCustom_TrsfModification.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeCustom/ShapeCustom_TrsfModification.cxx @@ -47,7 +47,7 @@ Standard_Boolean ShapeCustom_TrsfModification::NewSurface(const TopoDS_Face& Standard_Boolean& RevFace) { Standard_Boolean result = BRepTools_TrsfModification::NewSurface(F, S, L, Tol, RevWires, RevFace); - Tol = (*((Handle(BRep_TFace)*)&F.TShape()))->Tolerance() * Abs(Trsf().ScaleFactor()); + Tol = (*((Handle(BRep_TFace)*)&F.TShape()))->Tolerance() * std::abs(Trsf().ScaleFactor()); return result; } @@ -59,7 +59,7 @@ Standard_Boolean ShapeCustom_TrsfModification::NewCurve(const TopoDS_Edge& E, Standard_Real& Tol) { Standard_Boolean result = BRepTools_TrsfModification::NewCurve(E, C, L, Tol); - Tol = (*((Handle(BRep_TEdge)*)&E.TShape()))->Tolerance() * Abs(Trsf().ScaleFactor()); + Tol = (*((Handle(BRep_TEdge)*)&E.TShape()))->Tolerance() * std::abs(Trsf().ScaleFactor()); return result; } @@ -70,7 +70,7 @@ Standard_Boolean ShapeCustom_TrsfModification::NewPoint(const TopoDS_Vertex& V, Standard_Real& Tol) { Standard_Boolean result = BRepTools_TrsfModification::NewPoint(V, P, Tol); - Tol = (*((Handle(BRep_TVertex)*)&V.TShape()))->Tolerance() * Abs(Trsf().ScaleFactor()); + Tol = (*((Handle(BRep_TVertex)*)&V.TShape()))->Tolerance() * std::abs(Trsf().ScaleFactor()); return result; } @@ -84,7 +84,7 @@ Standard_Boolean ShapeCustom_TrsfModification::NewCurve2d(const TopoDS_Edge& Standard_Real& Tol) { Standard_Boolean result = BRepTools_TrsfModification::NewCurve2d(E, F, NewE, NewF, C, Tol); - Tol = (*((Handle(BRep_TEdge)*)&E.TShape()))->Tolerance() * Abs(Trsf().ScaleFactor()); + Tol = (*((Handle(BRep_TEdge)*)&E.TShape()))->Tolerance() * std::abs(Trsf().ScaleFactor()); return result; } @@ -96,6 +96,6 @@ Standard_Boolean ShapeCustom_TrsfModification::NewParameter(const TopoDS_Vertex& Standard_Real& Tol) { Standard_Boolean result = BRepTools_TrsfModification::NewParameter(V, E, P, Tol); - Tol = (*((Handle(BRep_TVertex)*)&V.TShape()))->Tolerance() * Abs(Trsf().ScaleFactor()); + Tol = (*((Handle(BRep_TVertex)*)&V.TShape()))->Tolerance() * std::abs(Trsf().ScaleFactor()); return result; } diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_ComposeShell.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_ComposeShell.cxx index d7c5ebf67b..ebd4d351d5 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_ComposeShell.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_ComposeShell.cxx @@ -322,13 +322,13 @@ static Standard_Real ParamPointsOnLine(const gp_Pnt2d& p1, const gp_Pnt2d& p2, c Standard_Real dist1 = PointLineDeviation(p1, line); Standard_Real dist2 = PointLineDeviation(p2, line); // in most cases, one of points is on line - if (Abs(dist1) < ::Precision::PConfusion()) + if (std::abs(dist1) < ::Precision::PConfusion()) { - if (Abs(dist2) < ::Precision::PConfusion()) + if (std::abs(dist2) < ::Precision::PConfusion()) return 0.5 * (ParamPointOnLine(p1, line) + ParamPointOnLine(p2, line)); return ParamPointOnLine(p1, line); } - if (Abs(dist2) < ::Precision::PConfusion()) + if (std::abs(dist2) < ::Precision::PConfusion()) return ParamPointOnLine(p2, line); // just protection if (dist2 * dist1 > 0) @@ -419,8 +419,8 @@ static inline Standard_Boolean IsCoincided(const gp_Pnt2d& p1, // pdn Maximal accuracy is working precision of intersector. Standard_Real UTolerance = UResolution * tol; Standard_Real VTolerance = VResolution * tol; - return Abs(p1.X() - p2.X()) <= Max(TOLINT, UTolerance) - && Abs(p1.Y() - p2.Y()) <= Max(TOLINT, VTolerance); + return std::abs(p1.X() - p2.X()) <= std::max(TOLINT, UTolerance) + && std::abs(p1.Y() - p2.Y()) <= std::max(TOLINT, VTolerance); } //================================================================================================= @@ -648,7 +648,7 @@ Standard_Integer ShapeFix_ComposeShell::ComputeCode(const Handle(ShapeExtend_Wir Standard_Real par1 = (i == begInd && special >= 0 ? begPar : (isreversed ? l : f)); Standard_Real par2 = (i == endInd && special <= 0 ? endPar : (isreversed ? f : l)); Standard_Real dpar = (par2 - par1) / (NPOINTS - 1); - Standard_Integer np = (Abs(dpar) < ::Precision::PConfusion() ? 1 : NPOINTS); + Standard_Integer np = (std::abs(dpar) < ::Precision::PConfusion() ? 1 : NPOINTS); Standard_Integer j; // svv #1 for (j = 0; j < np; j++) { @@ -656,7 +656,7 @@ Standard_Integer ShapeFix_ComposeShell::ComputeCode(const Handle(ShapeExtend_Wir gp_Pnt2d p2d = c2d->Value(par); if (myClosedMode) { - if (myUClosed && Abs(line.Direction().X()) < ::Precision::PConfusion()) + if (myUClosed && std::abs(line.Direction().X()) < ::Precision::PConfusion()) { if (begin) shift = ShapeAnalysis::AdjustByPeriod(p2d.X(), line.Location().X(), myUPeriod); @@ -664,7 +664,7 @@ Standard_Integer ShapeFix_ComposeShell::ComputeCode(const Handle(ShapeExtend_Wir shift = ShapeAnalysis::AdjustByPeriod(p2d.X() - p2d0.X(), 0., myUPeriod); p2d.SetX(p2d.X() + shift); } - if (myVClosed && Abs(line.Direction().Y()) < ::Precision::PConfusion()) + if (myVClosed && std::abs(line.Direction().Y()) < ::Precision::PConfusion()) { if (begin) shift = ShapeAnalysis::AdjustByPeriod(p2d.Y(), line.Location().Y(), myVPeriod); @@ -713,9 +713,9 @@ Standard_Integer ShapeFix_ComposeShell::ComputeCode(const Handle(ShapeExtend_Wir { // in closed mode, if segment is of 2*pi length, it is BOTH Standard_Real dev = PointLineDeviation(p2d0, line); - if (myUClosed && Abs(line.Direction().X()) < ::Precision::PConfusion()) + if (myUClosed && std::abs(line.Direction().X()) < ::Precision::PConfusion()) { - if (Abs(Abs(dev) - myUPeriod) < 0.1 * myUPeriod) + if (std::abs(std::abs(dev) - myUPeriod) < 0.1 * myUPeriod) { code = IOR_BOTH; if (dev > 0) @@ -724,9 +724,9 @@ Standard_Integer ShapeFix_ComposeShell::ComputeCode(const Handle(ShapeExtend_Wir else if (code == IOR_BOTH) code = IOR_UNDEF; } - if (myVClosed && Abs(line.Direction().Y()) < ::Precision::PConfusion()) + if (myVClosed && std::abs(line.Direction().Y()) < ::Precision::PConfusion()) { - if (Abs(Abs(dev) - myVPeriod) < 0.1 * myVPeriod) + if (std::abs(std::abs(dev) - myVPeriod) < 0.1 * myVPeriod) { code = IOR_BOTH; if (dev > 0) @@ -839,7 +839,7 @@ static Standard_Real GetGridResolution(const Handle(TColStd_HArray1OfReal)& Spli Standard_Real rigthLen = (cutIndex < nb ? SplitValues->Value(cutIndex + 1) - SplitValues->Value(cutIndex) : SplitValues->Value(2) - SplitValues->Value(1)); - return Min(leftLen, rigthLen) / 3.; + return std::min(leftLen, rigthLen) / 3.; } //================================================================================================= @@ -1015,8 +1015,8 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire(ShapeFix_WireSegment& // should be shifted too. gka SAMTECH 28.07.06 if (isPeriodic) { - if (currPar > (Max(lastPar, firstPar) + Precision::PConfusion()) - || currPar < (Min(firstPar, lastPar) - Precision::PConfusion())) + if (currPar > (std::max(lastPar, firstPar) + Precision::PConfusion()) + || currPar < (std::min(firstPar, lastPar) - Precision::PConfusion())) { Standard_Real aShift = ShapeAnalysis::AdjustByPeriod(currPar, (firstPar + lastPar) * 0.5, aPeriod); @@ -1030,12 +1030,12 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire(ShapeFix_WireSegment& // Try to adjust current splitting point to previous or end of edge Standard_Boolean doCut = Standard_True; TopoDS_Vertex V; - if (Abs(currPar - lastPar) < ::Precision::PConfusion()) + if (std::abs(currPar - lastPar) < ::Precision::PConfusion()) { V = lastV; doCut = Standard_False; } - else if (Abs(currPar - prevPar) < ::Precision::PConfusion()) + else if (std::abs(currPar - prevPar) < ::Precision::PConfusion()) { vertices.Append(prevV); code = SegmentCodes(j); // classification code - update for next segment @@ -1062,12 +1062,12 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire(ShapeFix_WireSegment& if (isCutByU) { Standard_Real gridRes = GetGridResolution(myGrid->UJointValues(), cutIndex) / lastVTol; - uRes = Min(myUResolution, gridRes); + uRes = std::min(myUResolution, gridRes); } else { Standard_Real gridRes = GetGridResolution(myGrid->VJointValues(), cutIndex) / lastVTol; - vRes = Min(myVResolution, gridRes); + vRes = std::min(myVResolution, gridRes); } if (IsCoincided(lastPnt2d, currPnt2d, uRes, vRes, lastVTol) && IsCoincided(lastPnt2d, @@ -1096,12 +1096,12 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire(ShapeFix_WireSegment& if (isCutByU) { Standard_Real gridRes = GetGridResolution(myGrid->UJointValues(), cutIndex) / prevVTol; - uRes = Min(myUResolution, gridRes); + uRes = std::min(myUResolution, gridRes); } else { Standard_Real gridRes = GetGridResolution(myGrid->VJointValues(), cutIndex) / prevVTol; - vRes = Min(myVResolution, gridRes); + vRes = std::min(myVResolution, gridRes); } if (IsCoincided(prevPnt2d, currPnt2d, uRes, vRes, prevVTol) && IsCoincided(prevPnt2d, @@ -1286,7 +1286,7 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire(ShapeFix_WireSegment& if (code == 0 && wire.Orientation() == TopAbs_EXTERNAL) { // pdn defining code for intersection of two isos - code = ((isCutByU == (Abs(firstPar - currPar) < Abs(lastPar - currPar))) ? 2 : 1); + code = ((isCutByU == (std::abs(firstPar - currPar) < std::abs(lastPar - currPar))) ? 2 : 1); } DefinePatch(result, code, isCutByU, cutIndex); } @@ -1347,9 +1347,9 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine(ShapeFix_WireSegment& w Standard_Integer closedDir = 0; if (myClosedMode) { - if (myUClosed && Abs(line.Direction().X()) < ::Precision::PConfusion()) + if (myUClosed && std::abs(line.Direction().X()) < ::Precision::PConfusion()) closedDir = -1; - else if (myVClosed && Abs(line.Direction().Y()) < ::Precision::PConfusion()) + else if (myVClosed && std::abs(line.Direction().Y()) < ::Precision::PConfusion()) closedDir = 1; } Standard_Real halfPeriod = 0.5 * (closedDir ? closedDir < 0 ? myUPeriod : myVPeriod : 0.); @@ -1404,7 +1404,7 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine(ShapeFix_WireSegment& w } Standard_Real dUmax = umax + shift - x; shiftNext.SetX(dUmax > 0 ? -myUPeriod : myUPeriod); - nbIter = (Standard_Integer)(1 + Abs(dUmax) / myUPeriod); + nbIter = (Standard_Integer)(1 + std::abs(dUmax) / myUPeriod); shift = ShapeAnalysis::AdjustByPeriod(posf.X(), x, myUPeriod); posf.SetX(posf.X() + shift); shift = ShapeAnalysis::AdjustByPeriod(posl.X(), x, myUPeriod); @@ -1424,7 +1424,7 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine(ShapeFix_WireSegment& w } Standard_Real dVmax = vmax + shift - y; shiftNext.SetY(dVmax > 0 ? -myVPeriod : myVPeriod); - nbIter = (Standard_Integer)(1 + Abs(dVmax) / myVPeriod); + nbIter = (Standard_Integer)(1 + std::abs(dVmax) / myVPeriod); shift = ShapeAnalysis::AdjustByPeriod(posf.Y(), y, myVPeriod); posf.SetY(posf.Y() + shift); shift = ShapeAnalysis::AdjustByPeriod(posl.Y(), y, myVPeriod); @@ -1444,7 +1444,7 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine(ShapeFix_WireSegment& w } else if (code == IOR_UNDEF || code != prevCode) { - if (!closedDir || Abs(dev - prevDev) < halfPeriod) + if (!closedDir || std::abs(dev - prevDev) < halfPeriod) { // clang-format off IntLinePar.Append ( ParamPointsOnLine ( pos, prevPos, line ) ); // !! - maybe compute exactly ? @@ -1543,7 +1543,7 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine(ShapeFix_WireSegment& w && wire.Orientation() != TopAbs_INTERNAL && (prevCode == IOR_UNDEF || prevCode != firstCode)) { - if (!closedDir || Abs(firstDev - prevDev) < halfPeriod) + if (!closedDir || std::abs(firstDev - prevDev) < halfPeriod) { IntLinePar.Append(ParamPointsOnLine(pos, firstPos, line)); IntEdgePar.Append(isreversed ? f : l); @@ -1573,7 +1573,7 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine(ShapeFix_WireSegment& w if (i == j) break; if (IntEdgeInd(i) == IntEdgeInd(j) - && Abs(IntEdgePar(i) - IntEdgePar(j)) < ::Precision::PConfusion()) + && std::abs(IntEdgePar(i) - IntEdgePar(j)) < ::Precision::PConfusion()) { IntLinePar.Remove(i); IntEdgePar.Remove(i); @@ -1589,9 +1589,9 @@ Standard_Boolean ShapeFix_ComposeShell::SplitByLine(ShapeFix_WireSegment& w Standard_Real a1, b1, a2, b2; BRep_Tool::Range(E1, myFace, a1, b1); BRep_Tool::Range(E2, myFace, a2, b2); - if (Abs(IntEdgePar(j) - (E1.Orientation() == TopAbs_FORWARD ? b1 : a1)) + if (std::abs(IntEdgePar(j) - (E1.Orientation() == TopAbs_FORWARD ? b1 : a1)) < ::Precision::PConfusion() - && Abs(IntEdgePar(i) - (E2.Orientation() == TopAbs_FORWARD ? a2 : b2)) + && std::abs(IntEdgePar(i) - (E2.Orientation() == TopAbs_FORWARD ? a2 : b2)) < ::Precision::PConfusion()) { IntLinePar.Remove(i); @@ -1762,7 +1762,7 @@ void ShapeFix_ComposeShell::SplitByLine(ShapeFix_SequenceOfWireSegment& wires, // merge null-length tangential segments into one-point tangencies or intersections for (i = 1; i < SplitLinePar.Length(); i++) { - if (Abs(SplitLinePar(i + 1) - SplitLinePar(i)) > ::Precision::PConfusion() + if (std::abs(SplitLinePar(i + 1) - SplitLinePar(i)) > ::Precision::PConfusion() && !SplitLineVertex(i).IsSame(SplitLineVertex(i + 1))) continue; if ((SplitLineCode(i) & ITP_ENDSEG && SplitLineCode(i + 1) & ITP_BEGSEG) @@ -1829,8 +1829,8 @@ void ShapeFix_ComposeShell::SplitByLine(ShapeFix_SequenceOfWireSegment& wires, // case when max tolerance is not defined tolerance of vertices will be used as is if (aMaxTol <= 2. * Precision::Confusion()) aMaxTol = Precision::Infinite(); - Standard_Real aTol1 = Min(BRep_Tool::Tolerance(V1), aMaxTol); - Standard_Real aTol2 = Min(BRep_Tool::Tolerance(V2), aMaxTol); + Standard_Real aTol1 = std::min(BRep_Tool::Tolerance(V1), aMaxTol); + Standard_Real aTol2 = std::min(BRep_Tool::Tolerance(V2), aMaxTol); gp_Pnt aP1 = BRep_Tool::Pnt(V1); gp_Pnt aP2 = BRep_Tool::Pnt(V2); Standard_Real aD = aP1.SquareDistance(aP2); @@ -1978,7 +1978,7 @@ void ShapeFix_ComposeShell::SplitByGrid(ShapeFix_SequenceOfWireSegment& seqw) // in same cases for example trj4_pm2-ug-203.stp (entity #8024) wire in 2D space has length // greater then period Standard_Integer iumin = - Max(0, GetPatchIndex(Uf1 + pprec, myGrid->UJointValues(), myUClosed)); + std::max(0, GetPatchIndex(Uf1 + pprec, myGrid->UJointValues(), myUClosed)); Standard_Integer iumax = GetPatchIndex(Ul1 - pprec, myGrid->UJointValues(), myUClosed) + 1; for (Standard_Integer j = 1; j <= wire.NbEdges(); j++) @@ -1988,7 +1988,7 @@ void ShapeFix_ComposeShell::SplitByGrid(ShapeFix_SequenceOfWireSegment& seqw) } Standard_Integer ivmin = - Max(0, GetPatchIndex(Vf1 + pprec, myGrid->VJointValues(), myVClosed)); + std::max(0, GetPatchIndex(Vf1 + pprec, myGrid->VJointValues(), myVClosed)); Standard_Integer ivmax = GetPatchIndex(Vl1 - pprec, myGrid->VJointValues(), myVClosed) + 1; for (Standard_Integer j = 1; j <= wire.NbEdges(); j++) @@ -2260,10 +2260,10 @@ static Standard_Boolean IsSamePatch(const ShapeFix_WireSegment& wire, } // compute common (extended) indices - Standard_Integer iun = Min(iumin, jumin); - Standard_Integer iux = Max(iumax, jumax); - Standard_Integer ivn = Min(ivmin, jvmin); - Standard_Integer ivx = Max(ivmax, jvmax); + Standard_Integer iun = std::min(iumin, jumin); + Standard_Integer iux = std::max(iumax, jumax); + Standard_Integer ivn = std::min(ivmin, jvmin); + Standard_Integer ivx = std::max(ivmax, jvmax); Standard_Boolean ok = (iun == iux || iun + 1 == iux) && (ivn == ivx || ivn + 1 == ivx); if (ok && extend) { @@ -2446,7 +2446,7 @@ void ShapeFix_ComposeShell::CollectWires(ShapeFix_SequenceOfWireSegment& wires, // for coincidence (instead of vertex tolerance) in order // this check to be in agreement with check for position of wire segments // thus avoiding bad effects on overlapping edges - Standard_Real ctol = Max(edgeTol, BRep_Tool::Tolerance(endV /*lastEdge*/)); + Standard_Real ctol = std::max(edgeTol, BRep_Tool::Tolerance(endV /*lastEdge*/)); Standard_Boolean conn = IsCoincided(endPnt, lPnt, myUResolution, myVResolution, ctol); Standard_Real dist = endPnt.SquareDistance(lPnt); @@ -2978,9 +2978,9 @@ void ShapeFix_ComposeShell::DispatchWires(TopTools_SequenceOfShape& faces, if (c21 == c22 || pf1.SquareDistance(pf2) < dPreci || pl1.SquareDistance(pl2) < dPreci) { gp_Vec2d shift(0., 0.); - if (myUClosed && Abs(pf2.X() - pl2.X()) < ::Precision::PConfusion()) + if (myUClosed && std::abs(pf2.X() - pl2.X()) < ::Precision::PConfusion()) shift.SetX(myUPeriod); - if (myVClosed && Abs(pf2.Y() - pl2.Y()) < ::Precision::PConfusion()) + if (myVClosed && std::abs(pf2.Y() - pl2.Y()) < ::Precision::PConfusion()) shift.SetY(myVPeriod); c22->Translate(shift); } diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Edge.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Edge.cxx index 0f7bff292f..29dc1f4aab 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Edge.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Edge.cxx @@ -157,8 +157,8 @@ Standard_Boolean ShapeFix_Edge::FixAddPCurve(const TopoDS_Edge& // parallel to one iso let us translate it parallely in the direction to another // iso (which is located farther from aC2d). Thus, the requirement for closeness // to the surface bounds may be avoided. -// For example, instead of Abs(theLoc.X()-uf) <= Tol) ... elseif (...-ul..)... -// the comparison if (Abs(theLoc.X()-uf) <= Abs(theLoc.X()-ul)) .... can be used. +// For example, instead of std::abs(theLoc.X()-uf) <= Tol) ... elseif (...-ul..)... +// the comparison if (std::abs(theLoc.X()-uf) <= std::abs(theLoc.X()-ul)) .... can be used. // The reason for fix #12 is that seam is not certain to lie on the bound : // if a surface is periodic the whole contour may be shifted (e.g. ProSTEP, @@ -182,27 +182,27 @@ static Handle(Geom2d_Curve) TranslatePCurve(const Handle(Geom_Surface)& aSurf, Handle(Geom2d_Line) theNewL2d = theL2d; // case UClosed - if (Abs(theDir.X()) <= aTol && Abs(theDir.Y()) >= aTol) + if (std::abs(theDir.X()) <= aTol && std::abs(theDir.Y()) >= aTol) { - if (Abs(theLoc.X() - uf) < Abs(theLoc.X() - ul)) + if (std::abs(theLoc.X() - uf) < std::abs(theLoc.X() - ul)) newLoc.SetCoord(theLoc.X() + (ul - uf), theLoc.Y()); else newLoc.SetCoord(theLoc.X() - (ul - uf), theLoc.Y()); theNewL2d = new Geom2d_Line(newLoc, theDir); } /* // case UClosed and line in U = UFirst - if ((Abs(theLoc.X() - uf) <= aTol) && - (Abs(theDir.X()) <= aTol) && - (Abs(theDir.Y()) >= aTol)) { + if ((std::abs(theLoc.X() - uf) <= aTol) && + (std::abs(theDir.X()) <= aTol) && + (std::abs(theDir.Y()) >= aTol)) { // on translate en ul gp_Pnt2d newLoc(ul, theLoc.Y()); Handle(Geom2d_Line) theNewL2d = new Geom2d_Line(newLoc, theDir); return theNewL2d; } // cas UClosed and line in U = ULast - if ((Abs(theLoc.X() - ul) <= aTol) && - (Abs(theDir.X()) <= aTol) && - (Abs(theDir.Y()) >= aTol)) { + if ((std::abs(theLoc.X() - ul) <= aTol) && + (std::abs(theDir.X()) <= aTol) && + (std::abs(theDir.Y()) >= aTol)) { // on translate en uf gp_Pnt2d newLoc(uf, theLoc.Y()); Handle(Geom2d_Line) theNewL2d = new Geom2d_Line(newLoc, theDir); @@ -210,27 +210,27 @@ static Handle(Geom2d_Curve) TranslatePCurve(const Handle(Geom_Surface)& aSurf, } */ // case VClosed - if (Abs(theDir.X()) >= aTol && Abs(theDir.Y()) <= aTol) + if (std::abs(theDir.X()) >= aTol && std::abs(theDir.Y()) <= aTol) { - if (Abs(theLoc.Y() - vf) < Abs(theLoc.Y() - vl)) + if (std::abs(theLoc.Y() - vf) < std::abs(theLoc.Y() - vl)) newLoc.SetCoord(theLoc.X(), theLoc.Y() + (vl - vf)); else newLoc.SetCoord(theLoc.X(), theLoc.Y() - (vl - vf)); theNewL2d = new Geom2d_Line(newLoc, theDir); } /* // case VClosed and line in V = VFirst - if ((Abs(theLoc.Y() - vf) <= aTol) && - (Abs(theDir.X()) >= aTol) && - (Abs(theDir.Y()) <= aTol)) { + if ((std::abs(theLoc.Y() - vf) <= aTol) && + (std::abs(theDir.X()) >= aTol) && + (std::abs(theDir.Y()) <= aTol)) { // on translate en vl gp_Pnt2d newLoc(theLoc.X(), vl); Handle(Geom2d_Line) theNewL2d = new Geom2d_Line(newLoc, theDir); return theNewL2d; } // cas VClosed and line in V = VLast - if ((Abs(theLoc.Y() - vl) <= aTol) && - (Abs(theDir.X()) >= aTol) && - (Abs(theDir.Y()) <= aTol)) { + if ((std::abs(theLoc.Y() - vl) <= aTol) && + (std::abs(theDir.X()) >= aTol) && + (std::abs(theDir.Y()) <= aTol)) { // on translate en vf gp_Pnt2d newLoc(theLoc.X(), vf); Handle(Geom2d_Line) theNewL2d = new Geom2d_Line(newLoc, theDir); @@ -265,7 +265,7 @@ static Handle(Geom2d_Curve) TranslatePCurve(const Handle(Geom_Surface)& aSurf, gp_Trsf2d T; if (theVector.IsParallel(VectIsoUF, aTol)) { - if (Abs(FirstPoint.X() - uf) < Abs(FirstPoint.X() - ul)) + if (std::abs(FirstPoint.X() - uf) < std::abs(FirstPoint.X() - ul)) T.SetTranslation(p00, p10); else T.SetTranslation(p10, p00); @@ -273,14 +273,14 @@ static Handle(Geom2d_Curve) TranslatePCurve(const Handle(Geom_Surface)& aSurf, return newC; } /* // case UClosed and line in U = UFirst - if (Abs(FirstPoint.X() - uf) <= aTol) { + if (std::abs(FirstPoint.X() - uf) <= aTol) { gp_Trsf2d T; T.SetTranslation(p00, p10); newC->Transform(T); return newC; } // case UClosed and line in U = ULast - else if (Abs(FirstPoint.X() - ul) <= aTol) { + else if (std::abs(FirstPoint.X() - ul) <= aTol) { gp_Trsf2d T; T.SetTranslation(p10, p00); newC->Transform(T); @@ -292,7 +292,7 @@ static Handle(Geom2d_Curve) TranslatePCurve(const Handle(Geom_Surface)& aSurf, */ else if (theVector.IsParallel(VectIsoVF, aTol)) { - if (Abs(FirstPoint.Y() - vf) < Abs(FirstPoint.Y() - vl)) + if (std::abs(FirstPoint.Y() - vf) < std::abs(FirstPoint.Y() - vl)) T.SetTranslation(p00, p01); else T.SetTranslation(p01, p00); @@ -357,9 +357,9 @@ static void TempSameRange(const TopoDS_Edge& AnEdge, const Standard_Real Toleran first_time_in = Standard_False; } - if (Abs(first - current_first) > Precision::PConfusion() + if (std::abs(first - current_first) > Precision::PConfusion() || //: b8 abv 20 Feb 98: Confusion -> PConfusion - Abs(last - current_last) > Precision::PConfusion()) + std::abs(last - current_last) > Precision::PConfusion()) { //: b8 Standard_Real oldFirst = 0., oldLast = 0.; // skl if (has_curve) @@ -382,7 +382,7 @@ static void TempSameRange(const TopoDS_Edge& AnEdge, const Standard_Real Toleran { constexpr Standard_Real preci = Precision::PConfusion(); - if (Abs(oldFirst) > preci || Abs(oldLast - 1) > preci) + if (std::abs(oldFirst) > preci || std::abs(oldLast - 1) > preci) { Handle(Geom2d_BezierCurve) bezier = Handle(Geom2d_BezierCurve)::DownCast(Curve2dPtr->Copy()); @@ -411,7 +411,7 @@ static void TempSameRange(const TopoDS_Edge& AnEdge, const Standard_Real Toleran { constexpr Standard_Real preci = Precision::PConfusion(); - if (Abs(oldFirst) > preci || Abs(oldLast - 1) > preci) + if (std::abs(oldFirst) > preci || std::abs(oldLast - 1) > preci) { Handle(Geom2d_BezierCurve) bezier = Handle(Geom2d_BezierCurve)::DownCast(Curve2dPtr2->Copy()); @@ -836,9 +836,9 @@ Standard_Boolean ShapeFix_Edge::FixSameParameter(const TopoDS_Edge& edge, // restore tolerances because they could be modified by BRepLib if (!V1.IsNull()) - SFST.SetTolerance(V1, Max(maxdev, TolFV), TopAbs_VERTEX); + SFST.SetTolerance(V1, std::max(maxdev, TolFV), TopAbs_VERTEX); if (!V2.IsNull()) - SFST.SetTolerance(V2, Max(maxdev, TolLV), TopAbs_VERTEX); + SFST.SetTolerance(V2, std::max(maxdev, TolLV), TopAbs_VERTEX); if (maxdev > tol) { diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_EdgeProjAux.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_EdgeProjAux.cxx index 6f1844a3b6..6365891c93 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_EdgeProjAux.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_EdgeProjAux.cxx @@ -278,16 +278,16 @@ void ShapeFix_EdgeProjAux::Init2d(const Standard_Real preci) { if (SA.BasisCurve()->GetType() == GeomAbs_Hyperbola) { - uf = Max(uf, -23.); - ul = Min(ul, 23.); + uf = std::max(uf, -23.); + ul = std::min(ul, 23.); } } if (SA.GetType() == GeomAbs_SurfaceOfRevolution) { if (SA.BasisCurve()->GetType() == GeomAbs_Hyperbola) { - vf = Max(vf, -23.); - vl = Min(vl, 23.); + vf = std::max(vf, -23.); + vl = std::min(vl, 23.); } } if (!Precision::IsInfinite(uf) && !Precision::IsInfinite(ul) && !Precision::IsInfinite(vf) @@ -318,13 +318,13 @@ void ShapeFix_EdgeProjAux::Init2d(const Standard_Real preci) yli = (vl - pnt.Y()) / dir.Y(); if (dir.X() * dir.Y() > 0) { - cfi = (Abs(xli - xfi) < Abs(xli - yfi) ? xfi : yfi); - cli = (Abs(xfi - xli) < Abs(xfi - yli) ? xli : yli); + cfi = (std::abs(xli - xfi) < std::abs(xli - yfi) ? xfi : yfi); + cli = (std::abs(xfi - xli) < std::abs(xfi - yli) ? xli : yli); } else { - cfi = (Abs(xli - xfi) < Abs(xli - yli) ? xfi : yli); - cli = (Abs(yli - xli) < Abs(yli - yfi) ? xli : yfi); + cfi = (std::abs(xli - xfi) < std::abs(xli - yli) ? xfi : yli); + cli = (std::abs(yli - xli) < std::abs(yli - yfi) ? xli : yfi); } } if (cfi < cli) @@ -451,12 +451,12 @@ void ShapeFix_EdgeProjAux::Init2d(const Standard_Real preci) if (COnS.Value(Uinf).Distance(COnS.Value(Usup)) < Precision::Confusion()) { // 18.11.2002 SKL OCC630 compare values with tolerance Precision::PConfusion() instead of "==" - if (Abs(myFirstParam - Uinf) < ::Precision::PConfusion() - && Abs(myLastParam - Uinf) < ::Precision::PConfusion()) + if (std::abs(myFirstParam - Uinf) < ::Precision::PConfusion() + && std::abs(myLastParam - Uinf) < ::Precision::PConfusion()) myLastParam = w2 = Usup; // 18.11.2002 SKL OCC630 compare values with tolerance Precision::PConfusion() instead of "==" - else if (Abs(myFirstParam - Usup) < ::Precision::PConfusion() - && Abs(myLastParam - Usup) < ::Precision::PConfusion()) + else if (std::abs(myFirstParam - Usup) < ::Precision::PConfusion() + && std::abs(myLastParam - Usup) < ::Precision::PConfusion()) myFirstParam = w1 = Uinf; } @@ -612,9 +612,9 @@ void ShapeFix_EdgeProjAux::UpdateParam2d(const Handle(Geom2d_Curve)& theCurve2d) else if (theCurve2d->IsClosed()) { // szv#4:S4163:12Mar99 optimized - if (Abs(myFirstParam - cl) <= preci2d) + if (std::abs(myFirstParam - cl) <= preci2d) myFirstParam = cf; - else if (Abs(myLastParam - cf) <= preci2d) + else if (std::abs(myLastParam - cf) <= preci2d) myLastParam = cl; else { @@ -632,9 +632,9 @@ void ShapeFix_EdgeProjAux::UpdateParam2d(const Handle(Geom2d_Curve)& theCurve2d) Handle(Geom2d_BSplineCurve) aBSpline2d = Handle(Geom2d_BSplineCurve)::DownCast(theCurve2d); if (aBSpline2d->StartPoint().Distance(aBSpline2d->EndPoint()) <= preci2d) { - if (Abs(myFirstParam - cl) <= preci2d) + if (std::abs(myFirstParam - cl) <= preci2d) myFirstParam = cf; - else if (Abs(myLastParam - cf) <= preci2d) + else if (std::abs(myLastParam - cf) <= preci2d) myLastParam = cl; } } diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Face.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Face.cxx index 0286d5afd8..0cc31557ea 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Face.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Face.cxx @@ -292,9 +292,9 @@ static Standard_Boolean SplitWire(const TopoDS_Face& face, curve1->D0(a1, v0); curve2->D0(b2, v1); GeomAdaptor_Surface anAdaptor(BRep_Tool::Surface(face)); - Standard_Real tol = Max(BRep_Tool::Tolerance(V0), BRep_Tool::Tolerance(V1)); + Standard_Real tol = std::max(BRep_Tool::Tolerance(V0), BRep_Tool::Tolerance(V1)); Standard_Real maxResolution = - 2 * Max(anAdaptor.UResolution(tol), anAdaptor.VResolution(tol)); + 2 * std::max(anAdaptor.UResolution(tol), anAdaptor.VResolution(tol)); if (v0.SquareDistance(v1) < maxResolution) { // new wire is closed, put it into sequence @@ -358,7 +358,7 @@ Standard_Boolean ShapeFix_Face::Perform() if (myAutoCorrectPrecisionMode) { Standard_Real size = ShapeFix::LeastEdgeSize(S); - Standard_Real newpreci = Min(aSavPreci, size / 2.); + Standard_Real newpreci = std::min(aSavPreci, size / 2.); newpreci = newpreci * 1.00001; if (aSavPreci > newpreci && newpreci > Precision::Confusion()) { @@ -1505,8 +1505,8 @@ static Standard_Boolean CheckWire(const TopoDS_Wire& wire, vec += c2d->Value(l).XY() - c2d->Value(f).XY(); } - Standard_Real aDelta = Abs(vec.X()) - dU; - if (Abs(aDelta) < 0.1 * dU) + Standard_Real aDelta = std::abs(vec.X()) - dU; + if (std::abs(aDelta) < 0.1 * dU) { if (vec.X() > 0.0) { @@ -1522,8 +1522,8 @@ static Standard_Boolean CheckWire(const TopoDS_Wire& wire, isuopen = 0; } - aDelta = Abs(vec.Y()) - dV; - if (Abs(aDelta) < 0.1 * dV) + aDelta = std::abs(vec.Y()) - dV; + if (std::abs(aDelta) < 0.1 * dV) { if (vec.Y() > 0.0) { @@ -1583,7 +1583,7 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam() SUF = fU1; if (::Precision::IsInfinite(SUL)) SUL = fU2; - if (Abs(SUL - SUF) < ::Precision::PConfusion()) + if (std::abs(SUL - SUF) < ::Precision::PConfusion()) { if (::Precision::IsInfinite(SUF)) SUF -= 1000.; @@ -1597,7 +1597,7 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam() SVF = fV1; if (::Precision::IsInfinite(SVL)) SVL = fV2; - if (Abs(SVL - SVF) < ::Precision::PConfusion()) + if (std::abs(SVL - SVF) < ::Precision::PConfusion()) { if (::Precision::IsInfinite(SVF)) SVF -= 1000.; @@ -1606,8 +1606,8 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam() } } - URange = Min(Abs(SUL - SUF), Precision::Infinite()); - VRange = Min(Abs(SVL - SVF), Precision::Infinite()); + URange = std::min(std::abs(SUL - SUF), Precision::Infinite()); + VRange = std::min(std::abs(SVL - SVF), Precision::Infinite()); // Standard_Real UTol = 0.2 * URange, VTol = 0.2 * VRange; Standard_Integer ismodeu = 0, ismodev = 0; // szv#4:S4163:12Mar99 was Boolean Standard_Integer isdeg1 = 0, isdeg2 = 0; @@ -1710,7 +1710,7 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam() { Standard_Real aRa = aTorSurf->MajorRadius(); Standard_Real aRi = aTorSurf->MinorRadius(); - Standard_Real aPhi = ACos(-aRa / aRi); + Standard_Real aPhi = std::acos(-aRa / aRi); p.SetCoord(0.0, (ismodeu > 0 ? M_PI + aPhi : aPhi)); Standard_Real aXCoord = -ismodeu; @@ -1855,8 +1855,8 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam() 0.5 * (m2[coord][0] + m2[coord][1]), 0.5 * (m1[coord][0] + m1[coord][1] + isneg * (period + ::Precision::PConfusion())), period); - m1[coord][0] = Min(m1[coord][0], m2[coord][0] + shiftw2); - m1[coord][1] = Max(m1[coord][1], m2[coord][1] + shiftw2); + m1[coord][0] = std::min(m1[coord][0], m2[coord][0] + shiftw2); + m1[coord][1] = std::max(m1[coord][1], m2[coord][1] + shiftw2); for (TopoDS_Iterator it(tmpF, Standard_False); it.More(); it.Next()) { if (it.Value().ShapeType() != TopAbs_WIRE) @@ -1924,9 +1924,9 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam() if (uclosed && ismodeu) { pos1.SetX(pos1.X() + ShapeAnalysis::AdjustByPeriod(pos1.X(), SUF, URange)); - if (foundU == 2 && Abs(pos1.X()) > Abs(uf)) + if (foundU == 2 && std::abs(pos1.X()) > std::abs(uf)) skipU = Standard_True; - else if (!foundU || (foundU == 1 && Abs(pos1.X()) < Abs(uf))) + else if (!foundU || (foundU == 1 && std::abs(pos1.X()) < std::abs(uf))) { foundU = 1; uf = pos1.X(); @@ -1936,9 +1936,9 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam() if (vclosed && !ismodeu) { pos1.SetY(pos1.Y() + ShapeAnalysis::AdjustByPeriod(pos1.Y(), SVF, VRange)); - if (foundV == 2 && Abs(pos1.Y()) > Abs(vf)) + if (foundV == 2 && std::abs(pos1.Y()) > std::abs(vf)) skipV = Standard_True; - else if (!foundV || (foundV == 1 && Abs(pos1.Y()) < Abs(vf))) + else if (!foundV || (foundV == 1 && std::abs(pos1.Y()) < std::abs(vf))) { foundV = 1; vf = pos1.Y(); @@ -1961,8 +1961,8 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam() if (uclosed && ismodeu) { pos2.SetX(pos2.X() + ShapeAnalysis::AdjustByPeriod(pos2.X(), pos1.X(), URange)); - if (Abs(pos2.X() - pos1.X()) < ::Precision::PConfusion() - && (foundU != 2 || Abs(pos1.X()) < Abs(uf))) + if (std::abs(pos2.X() - pos1.X()) < ::Precision::PConfusion() + && (foundU != 2 || std::abs(pos1.X()) < std::abs(uf))) { foundU = 2; uf = pos1.X(); @@ -1971,8 +1971,8 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam() if (vclosed && !ismodeu) { pos2.SetY(pos2.Y() + ShapeAnalysis::AdjustByPeriod(pos2.Y(), pos1.Y(), VRange)); - if (Abs(pos2.Y() - pos1.Y()) < ::Precision::PConfusion() - && (foundV != 2 || Abs(pos1.Y()) < Abs(vf))) + if (std::abs(pos2.Y() - pos1.Y()) < ::Precision::PConfusion() + && (foundV != 2 || std::abs(pos1.Y()) < std::abs(vf))) { foundV = 2; vf = pos1.Y(); @@ -2723,8 +2723,8 @@ static Standard_Boolean IsPeriodicConicalLoop(const Handle(Geom_ConicalSurface)& Standard_Real aUFirst = aUVFirst.X(), aULast = aUVLast.X(); Standard_Real aVFirst = aUVFirst.Y(), aVLast = aUVLast.Y(); - Standard_Real aCurMaxU = Max(aUFirst, aULast), aCurMinU = Min(aUFirst, aULast); - Standard_Real aCurMaxV = Max(aVFirst, aVLast), aCurMinV = Min(aVFirst, aVLast); + Standard_Real aCurMaxU = std::max(aUFirst, aULast), aCurMinU = std::min(aUFirst, aULast); + Standard_Real aCurMaxV = std::max(aVFirst, aVLast), aCurMinV = std::min(aVFirst, aVLast); if (aCurMinU < aMinU) aMinU = aCurMinU; @@ -2738,7 +2738,7 @@ static Standard_Boolean IsPeriodicConicalLoop(const Handle(Geom_ConicalSurface)& Standard_Real aDeltaU = aULast - aUFirst; aCumulDeltaU += aDeltaU; - aCumulDeltaUAbs += Abs(aDeltaU); + aCumulDeltaUAbs += std::abs(aDeltaU); } theMinU = aMinU; @@ -2747,8 +2747,8 @@ static Standard_Boolean IsPeriodicConicalLoop(const Handle(Geom_ConicalSurface)& theMaxV = aMaxV; isUDecrease = (aCumulDeltaU < 0 ? Standard_True : Standard_False); - Standard_Boolean is2PIDelta = Abs(aCumulDeltaUAbs - 2 * M_PI) <= theTolerance; - Standard_Boolean isAroundApex = Abs(theMaxU - theMinU) > 2 * M_PI - theTolerance; + Standard_Boolean is2PIDelta = std::abs(aCumulDeltaUAbs - 2 * M_PI) <= theTolerance; + Standard_Boolean isAroundApex = std::abs(theMaxU - theMinU) > 2 * M_PI - theTolerance; return is2PIDelta && isAroundApex; } @@ -2828,7 +2828,7 @@ Standard_Boolean ShapeFix_Face::FixPeriodicDegenerated() return Standard_False; // Bad surface // Find the V parameter of the apex - Standard_Real aConeBaseH = aConeBaseR / Sin(aSemiAngle); + Standard_Real aConeBaseH = aConeBaseR / std::sin(aSemiAngle); Standard_Real anApexV = -aConeBaseH; // Get apex vertex diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_IntersectionTool.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_IntersectionTool.cxx index 090e222933..4701e12c68 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_IntersectionTool.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_IntersectionTool.cxx @@ -100,7 +100,7 @@ Standard_Boolean ShapeFix_IntersectionTool::SplitEdge(const TopoDS_Edge& edge, Handle(Geom2d_Curve) c2d; sae.PCurve(edge, face, c2d, a, b, Standard_True); - if (Abs(a - param) < 0.01 * preci || Abs(b - param) < 0.01 * preci) + if (std::abs(a - param) < 0.01 * preci || std::abs(b - param) < 0.01 * preci) return Standard_False; // check distance between edge and new vertex gp_Pnt P1; @@ -185,9 +185,9 @@ Standard_Boolean ShapeFix_IntersectionTool::CutEdge(const TopoDS_Edge& edge, const TopoDS_Face& face, Standard_Boolean& iscutline) const { - if (Abs(cut - pend) < 10. * Precision::PConfusion()) + if (std::abs(cut - pend) < 10. * Precision::PConfusion()) return Standard_False; - Standard_Real aRange = Abs(cut - pend); + Standard_Real aRange = std::abs(cut - pend); Standard_Real a, b; BRep_Tool::Range(edge, a, b); @@ -208,14 +208,14 @@ Standard_Boolean ShapeFix_IntersectionTool::CutEdge(const TopoDS_Edge& edge, if (tc->BasisCurve()->IsKind(STANDARD_TYPE(Geom2d_Line))) { BRep_Builder B; - B.Range(edge, Min(pend, cut), Max(pend, cut)); - if (Abs(pend - lp) < Precision::PConfusion()) + B.Range(edge, std::min(pend, cut), std::max(pend, cut)); + if (std::abs(pend - lp) < Precision::PConfusion()) { // cut from the beginning Standard_Real cut3d = (cut - fp) * (b - a) / (lp - fp); B.Range(edge, a + cut3d, b, Standard_True); iscutline = Standard_True; } - else if (Abs(pend - fp) < Precision::PConfusion()) + else if (std::abs(pend - fp) < Precision::PConfusion()) { // cut from the end Standard_Real cut3d = (lp - cut) * (b - a) / (lp - fp); B.Range(edge, a, b - cut3d, Standard_True); @@ -230,13 +230,13 @@ Standard_Boolean ShapeFix_IntersectionTool::CutEdge(const TopoDS_Edge& edge, } // det-study on 03/12/01 checking the old and new ranges - if (Abs(Abs(a - b) - aRange) < Precision::PConfusion()) + if (std::abs(std::abs(a - b) - aRange) < Precision::PConfusion()) return Standard_False; if (aRange < 10. * Precision::PConfusion()) return Standard_False; BRep_Builder B; - B.Range(edge, Min(pend, cut), Max(pend, cut)); + B.Range(edge, std::min(pend, cut), std::max(pend, cut)); return Standard_True; } @@ -475,7 +475,7 @@ Standard_Boolean ShapeFix_IntersectionTool::UnionVertexes(const Handle(ShapeExte Standard_Real d22 = PV1L.Distance(PV2L); if (d11 < d12 && d11 < d21 && d11 < d22) { - Standard_Real tolv = Max(BRep_Tool::Tolerance(V1F), BRep_Tool::Tolerance(V2F)); + Standard_Real tolv = std::max(BRep_Tool::Tolerance(V1F), BRep_Tool::Tolerance(V2F)); if (!V2F.IsSame(V1F) && d11 < tolv) { // union vertexes V1F and V2F @@ -548,7 +548,7 @@ Standard_Boolean ShapeFix_IntersectionTool::UnionVertexes(const Handle(ShapeExte } else if (d12 < d21 && d12 < d22) { - Standard_Real tolv = Max(BRep_Tool::Tolerance(V1F), BRep_Tool::Tolerance(V2L)); + Standard_Real tolv = std::max(BRep_Tool::Tolerance(V1F), BRep_Tool::Tolerance(V2L)); if (!V2L.IsSame(V1F) && d12 < tolv) { // union vertexes V1F and V2L @@ -622,7 +622,7 @@ Standard_Boolean ShapeFix_IntersectionTool::UnionVertexes(const Handle(ShapeExte } else if (d21 < d22) { - Standard_Real tolv = Max(BRep_Tool::Tolerance(V1L), BRep_Tool::Tolerance(V2F)); + Standard_Real tolv = std::max(BRep_Tool::Tolerance(V1L), BRep_Tool::Tolerance(V2F)); if (!V2F.IsSame(V1L) && d21 < tolv) { // union vertexes V1L and V2F @@ -695,7 +695,7 @@ Standard_Boolean ShapeFix_IntersectionTool::UnionVertexes(const Handle(ShapeExte } else { - Standard_Real tolv = Max(BRep_Tool::Tolerance(V1L), BRep_Tool::Tolerance(V2L)); + Standard_Real tolv = std::max(BRep_Tool::Tolerance(V1L), BRep_Tool::Tolerance(V2L)); if (!V2L.IsSame(V1L) && d22 < tolv) { // union vertexes V1L and V2L @@ -878,7 +878,7 @@ Standard_Boolean ShapeFix_IntersectionTool::FindVertAndSplitEdge( NeedSplit = Standard_False; } V = V1; - tolV = Max((pi1.Distance(PV1) / 2) * 1.00001, BRep_Tool::Tolerance(V1)); + tolV = std::max((pi1.Distance(PV1) / 2) * 1.00001, BRep_Tool::Tolerance(V1)); } else { @@ -887,14 +887,14 @@ Standard_Boolean ShapeFix_IntersectionTool::FindVertAndSplitEdge( NeedSplit = Standard_False; } V = V2; - tolV = Max((pi1.Distance(PV2) / 2) * 1.00001, BRep_Tool::Tolerance(V2)); + tolV = std::max((pi1.Distance(PV2) / 2) * 1.00001, BRep_Tool::Tolerance(V2)); } if (NeedSplit || aTmpKey) { if (SplitEdge1(sewd, face, num1, param1, V, tolV, boxes)) { B.UpdateVertex(V, tolV); - MaxTolVert = Max(MaxTolVert, tolV); + MaxTolVert = std::max(MaxTolVert, tolV); // NbSplit++; num1--; return Standard_True; @@ -924,9 +924,9 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire(Handle(ShapeExt for (TopExp_Explorer exp(SF, TopAbs_VERTEX); exp.More(); exp.Next()) { Standard_Real tolV = BRep_Tool::Tolerance(TopoDS::Vertex(exp.Current())); - MaxTolVert = Max(MaxTolVert, tolV); + MaxTolVert = std::max(MaxTolVert, tolV); } - MaxTolVert = Min(MaxTolVert, myMaxTol); + MaxTolVert = std::min(MaxTolVert, myMaxTol); ShapeAnalysis_Edge sae; // step 1 : intersection of adjacent edges @@ -998,24 +998,24 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire(Handle(ShapeExt gp_Pnt PVL1 = BRep_Tool::Pnt(VL1); Standard_Real dist1 = pi1.Distance(PVF1); Standard_Real dist2 = pi1.Distance(PVL1); - Standard_Real distmin = Min(dist1, dist2); + Standard_Real distmin = std::min(dist1, dist2); if (dist1 != dist2 && distmin < MaxTolVert) { if (dist1 < dist2) { - tolV = Max(dist1 * 1.00001, BRep_Tool::Tolerance(VF1)); + tolV = std::max(dist1 * 1.00001, BRep_Tool::Tolerance(VF1)); B.UpdateVertex(VF1, tolV); V = VF1; } else { - tolV = Max(dist2 * 1.00001, BRep_Tool::Tolerance(VL1)); + tolV = std::max(dist2 * 1.00001, BRep_Tool::Tolerance(VL1)); B.UpdateVertex(VL1, tolV); V = VL1; } - Standard_Real dista = Abs(a1 - param1); - Standard_Real distb = Abs(b1 - param1); + Standard_Real dista = std::abs(a1 - param1); + Standard_Real distb = std::abs(b1 - param1); Standard_Boolean IsCutLine; ModifE1 = CutEdge(edge1, ((dista > distb) ? a1 : b1), param1, face, IsCutLine); if (ModifE1) @@ -1031,24 +1031,24 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire(Handle(ShapeExt gp_Pnt PVL2 = BRep_Tool::Pnt(VL2); dist1 = pi2.Distance(PVF2); dist2 = pi2.Distance(PVL2); - distmin = Min(dist1, dist2); + distmin = std::min(dist1, dist2); if (dist1 != dist2 && distmin < MaxTolVert) { if (dist1 < dist2) { - tolV = Max(dist1 * 1.00001, BRep_Tool::Tolerance(VF2)); + tolV = std::max(dist1 * 1.00001, BRep_Tool::Tolerance(VF2)); B.UpdateVertex(VF2, tolV); V = VF2; } else { - tolV = Max(dist2 * 1.00001, BRep_Tool::Tolerance(VL2)); + tolV = std::max(dist2 * 1.00001, BRep_Tool::Tolerance(VL2)); B.UpdateVertex(VL2, tolV); V = VL2; } - Standard_Real dista = Abs(a2 - param2); - Standard_Real distb = Abs(b2 - param2); + Standard_Real dista = std::abs(a2 - param2); + Standard_Real distb = std::abs(b2 - param2); Standard_Boolean IsCutLine; ModifE2 = CutEdge(edge2, ((dista > distb) ? a2 : b2), param2, face, IsCutLine); if (ModifE2) @@ -1077,9 +1077,9 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire(Handle(ShapeExt if (!ModifE1 && !ModifE2) { gp_Pnt P0((pi1.X() + pi2.X()) / 2, (pi1.Y() + pi2.Y()) / 2, (pi1.Z() + pi2.Z()) / 2); - tolV = Max((pi1.Distance(pi2) / 2) * 1.00001, Precision::Confusion()); + tolV = std::max((pi1.Distance(pi2) / 2) * 1.00001, Precision::Confusion()); B.MakeVertex(V, P0, tolV); - MaxTolVert = Max(MaxTolVert, tolV); + MaxTolVert = std::max(MaxTolVert, tolV); Standard_Boolean isEdgeSplit2 = SplitEdge1(sewd, face, num2, param2, V, tolV, boxes); if (isEdgeSplit2) { @@ -1173,31 +1173,31 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire(Handle(ShapeExt gp_Pnt PV2 = BRep_Tool::Pnt(V2); // Standard_Real tol1 = BRep_Tool::Tolerance(V1); // Standard_Real tol2 = BRep_Tool::Tolerance(V2); - // Standard_Real maxtol = Max(tol1,tol2); + // Standard_Real maxtol = std::max(tol1,tol2); Standard_Real dist1 = Pnt11.Distance(PV1); Standard_Real dist2 = Pnt12.Distance(PV1); - Standard_Real maxdist = Max(dist1, dist2); + Standard_Real maxdist = std::max(dist1, dist2); Standard_Real pdist; if (edge1.Orientation() == TopAbs_REVERSED) - pdist = Max(Abs(b1 - p11), Abs(b1 - p12)); + pdist = std::max(std::abs(b1 - p11), std::abs(b1 - p12)); else - pdist = Max(Abs(a1 - p11), Abs(a1 - p12)); - if (maxdist < MaxTolVert || pdist < Abs(b1 - a1) * 0.01) + pdist = std::max(std::abs(a1 - p11), std::abs(a1 - p12)); + if (maxdist < MaxTolVert || pdist < std::abs(b1 - a1) * 0.01) { - // if(maxdist distb) pend = a1; else pend = b1; - if (Abs(pend - p11) > Abs(pend - p12)) + if (std::abs(pend - p11) > std::abs(pend - p12)) cut = p12; else cut = p11; @@ -1237,16 +1237,16 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire(Handle(ShapeExt gp_Pnt PV22 = BRep_Tool::Pnt(V22); // tol1 = BRep_Tool::Tolerance(V1); // tol2 = BRep_Tool::Tolerance(V2); - // maxtol = Max(tol1,tol2); + // maxtol = std::max(tol1,tol2); dist1 = Pnt21.Distance(PV12); dist2 = Pnt22.Distance(PV12); - maxdist = Max(dist1, dist2); + maxdist = std::max(dist1, dist2); if (edge2.Orientation() == TopAbs_REVERSED) - pdist = Max(Abs(b2 - p21), Abs(b2 - p22)); + pdist = std::max(std::abs(b2 - p21), std::abs(b2 - p22)); else - pdist = Max(Abs(a2 - p21), Abs(a2 - p22)); - // if(maxdist distb) pend = a2; else pend = b2; - if (Abs(pend - p21) > Abs(pend - p22)) + if (std::abs(pend - p21) > std::abs(pend - p22)) cut = p22; else cut = p21; @@ -1321,10 +1321,10 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire(Handle(ShapeExt gp_Pnt P0((Pnt10.X() + Pnt20.X()) / 2, (Pnt10.Y() + Pnt20.Y()) / 2, (Pnt10.Z() + Pnt20.Z()) / 2); - dist1 = Max(Pnt11.Distance(P0), Pnt12.Distance(P0)); - dist2 = Max(Pnt21.Distance(P0), Pnt22.Distance(P0)); - Standard_Real tolV = Max(dist1, dist2); - tolV = Max(tolV, Pnt10.Distance(Pnt20)) * 1.00001; + dist1 = std::max(Pnt11.Distance(P0), Pnt12.Distance(P0)); + dist2 = std::max(Pnt21.Distance(P0), Pnt22.Distance(P0)); + Standard_Real tolV = std::max(dist1, dist2); + tolV = std::max(tolV, Pnt10.Distance(Pnt20)) * 1.00001; Standard_Boolean FixSegment = Standard_True; if (tolV < MaxTolVert) { @@ -1344,7 +1344,8 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire(Handle(ShapeExt } else if (FixSegment) { - // if( Abs(p12-p11)>Abs(b1-a1)/2 || Abs(p22-p21)>Abs(b2-a2)/2 ) { + // if( std::abs(p12-p11)>std::abs(b1-a1)/2 || std::abs(p22-p21)>std::abs(b2-a2)/2 ) + // { // segment is big and we have to split each intersecting edge // on 3 edges --> middle edge - edge based on segment // after we can remove edges made from segment @@ -1354,10 +1355,10 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire(Handle(ShapeExt gp_Pnt P02((Pnt12.X() + Pnt22.X()) / 2, (Pnt12.Y() + Pnt22.Y()) / 2, (Pnt12.Z() + Pnt22.Z()) / 2); - Standard_Real tolV1 = Max(Pnt11.Distance(P01), Pnt21.Distance(P01)); - tolV1 = Max(tolV1, Precision::Confusion()) * 1.00001; - Standard_Real tolV2 = Max(Pnt12.Distance(P02), Pnt22.Distance(P02)); - tolV2 = Max(tolV2, Precision::Confusion()) * 1.00001; + Standard_Real tolV1 = std::max(Pnt11.Distance(P01), Pnt21.Distance(P01)); + tolV1 = std::max(tolV1, Precision::Confusion()) * 1.00001; + Standard_Real tolV2 = std::max(Pnt12.Distance(P02), Pnt22.Distance(P02)); + tolV2 = std::max(tolV2, Precision::Confusion()) * 1.00001; if (tolV1 > MaxTolVert || tolV2 > MaxTolVert) continue; TopoDS_Vertex NewV1, NewV2; @@ -1386,14 +1387,14 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire(Handle(ShapeExt Standard_Integer akey1 = 0, akey2 = 0; Standard_Real newTolerance; // analysis fo P01 - newTolerance = Max(tolV1, BRep_Tool::Tolerance(V1)); + newTolerance = std::max(tolV1, BRep_Tool::Tolerance(V1)); if (P01.Distance(PV1) < newTolerance) { B.MakeVertex(NewV1, BRep_Tool::Pnt(V1), newTolerance); NewV1.Orientation(V1.Orientation()); akey1++; } - newTolerance = Max(tolV1, BRep_Tool::Tolerance(V2)); + newTolerance = std::max(tolV1, BRep_Tool::Tolerance(V2)); if (P01.Distance(PV2) < newTolerance) { B.MakeVertex(NewV1, BRep_Tool::Pnt(V2), newTolerance); @@ -1401,14 +1402,14 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire(Handle(ShapeExt akey1++; } // analysis fo P02 - newTolerance = Max(tolV2, BRep_Tool::Tolerance(V1)); + newTolerance = std::max(tolV2, BRep_Tool::Tolerance(V1)); if (P02.Distance(PV1) < newTolerance) { B.MakeVertex(NewV2, BRep_Tool::Pnt(V1), newTolerance); NewV2.Orientation(V1.Orientation()); akey2++; } - newTolerance = Max(tolV2, BRep_Tool::Tolerance(V2)); + newTolerance = std::max(tolV2, BRep_Tool::Tolerance(V2)); if (P02.Distance(PV2) < newTolerance) { B.MakeVertex(NewV2, BRep_Tool::Pnt(V2), newTolerance); @@ -1666,7 +1667,7 @@ Standard_Boolean ShapeFix_IntersectionTool::FixIntersectingWires(TopoDS_Face& fa for (TopExp_Explorer exp(SF, TopAbs_VERTEX); exp.More(); exp.Next()) { Standard_Real tolV = BRep_Tool::Tolerance(TopoDS::Vertex(exp.Current())); - MaxTolVert = Max(MaxTolVert, tolV); + MaxTolVert = std::max(MaxTolVert, tolV); } Standard_Boolean isDone = Standard_False; // gka 06.09.04 ShapeAnalysis_Edge sae; @@ -1758,9 +1759,10 @@ Standard_Boolean ShapeFix_IntersectionTool::FixIntersectingWires(TopoDS_Face& fa (pi1.Z() + pi2.Z()) / 2); BRep_Builder B; TopoDS_Vertex V; - Standard_Real tolV = Max((pi1.Distance(pi2) / 2) * 1.00001, Precision::Confusion()); + Standard_Real tolV = + std::max((pi1.Distance(pi2) / 2) * 1.00001, Precision::Confusion()); B.MakeVertex(V, P0, tolV); - MaxTolVert = Max(MaxTolVert, tolV); + MaxTolVert = std::max(MaxTolVert, tolV); Standard_Boolean isSplitEdge2 = SplitEdge1(sewd2, face, num2, param2, V, tolV, boxes2); if (isSplitEdge2) @@ -1855,13 +1857,13 @@ Standard_Boolean ShapeFix_IntersectionTool::FixIntersectingWires(TopoDS_Face& fa gp_Pnt PV2 = BRep_Tool::Pnt(V2); Standard_Real dist1 = Pnt11.Distance(PV1); Standard_Real dist2 = Pnt12.Distance(PV1); - Standard_Real maxdist = Max(dist1, dist2); + Standard_Real maxdist = std::max(dist1, dist2); Standard_Real pdist; if (edge1.Orientation() == TopAbs_REVERSED) - pdist = Max(Abs(b1 - p11), Abs(b1 - p12)); + pdist = std::max(std::abs(b1 - p11), std::abs(b1 - p12)); else - pdist = Max(Abs(a1 - p11), Abs(a1 - p12)); - if (maxdist < MaxTolVert || pdist < Abs(b1 - a1) * 0.01) + pdist = std::max(std::abs(a1 - p11), std::abs(a1 - p12)); + if (maxdist < MaxTolVert || pdist < std::abs(b1 - a1) * 0.01) { newtol = maxdist; NewV = V1; @@ -1869,12 +1871,12 @@ Standard_Boolean ShapeFix_IntersectionTool::FixIntersectingWires(TopoDS_Face& fa } dist1 = Pnt11.Distance(PV2); dist2 = Pnt12.Distance(PV2); - maxdist = Max(dist1, dist2); + maxdist = std::max(dist1, dist2); if (edge1.Orientation() == TopAbs_REVERSED) - pdist = Max(Abs(a1 - p11), Abs(a1 - p12)); + pdist = std::max(std::abs(a1 - p11), std::abs(a1 - p12)); else - pdist = Max(Abs(b1 - p11), Abs(b1 - p12)); - if (maxdist < MaxTolVert || pdist < Abs(b1 - a1) * 0.01) + pdist = std::max(std::abs(b1 - p11), std::abs(b1 - p12)); + if (maxdist < MaxTolVert || pdist < std::abs(b1 - a1) * 0.01) { if ((IsModified1 && maxdist < newtol) || !IsModified1) { @@ -1886,14 +1888,14 @@ Standard_Boolean ShapeFix_IntersectionTool::FixIntersectingWires(TopoDS_Face& fa if (IsModified1) { // cut edge1 and update tolerance NewV - Standard_Real dista = Abs(a1 - p11) + Abs(a1 - p12); - Standard_Real distb = Abs(b1 - p11) + Abs(b1 - p12); + Standard_Real dista = std::abs(a1 - p11) + std::abs(a1 - p12); + Standard_Real distb = std::abs(b1 - p11) + std::abs(b1 - p12); Standard_Real pend, cut; if (dista > distb) pend = a1; else pend = b1; - if (Abs(pend - p11) > Abs(pend - p12)) + if (std::abs(pend - p11) > std::abs(pend - p12)) cut = p12; else cut = p11; @@ -1916,12 +1918,12 @@ Standard_Boolean ShapeFix_IntersectionTool::FixIntersectingWires(TopoDS_Face& fa gp_Pnt PV22 = BRep_Tool::Pnt(V22); dist1 = Pnt21.Distance(PV12); dist2 = Pnt22.Distance(PV12); - maxdist = Max(dist1, dist2); + maxdist = std::max(dist1, dist2); if (edge2.Orientation() == TopAbs_REVERSED) - pdist = Max(Abs(b2 - p21), Abs(b2 - p22)); + pdist = std::max(std::abs(b2 - p21), std::abs(b2 - p22)); else - pdist = Max(Abs(a2 - p21), Abs(a2 - p22)); - if (maxdist < MaxTolVert || pdist < Abs(b2 - a2) * 0.01) + pdist = std::max(std::abs(a2 - p21), std::abs(a2 - p22)); + if (maxdist < MaxTolVert || pdist < std::abs(b2 - a2) * 0.01) { newtol = maxdist; NewV = V12; @@ -1929,12 +1931,12 @@ Standard_Boolean ShapeFix_IntersectionTool::FixIntersectingWires(TopoDS_Face& fa } dist1 = Pnt21.Distance(PV22); dist2 = Pnt22.Distance(PV22); - maxdist = Max(dist1, dist2); + maxdist = std::max(dist1, dist2); if (edge2.Orientation() == TopAbs_REVERSED) - pdist = Max(Abs(a2 - p21), Abs(a2 - p22)); + pdist = std::max(std::abs(a2 - p21), std::abs(a2 - p22)); else - pdist = Max(Abs(b2 - p21), Abs(b2 - p22)); - if (maxdist < MaxTolVert || pdist < Abs(b2 - a2) * 0.01) + pdist = std::max(std::abs(b2 - p21), std::abs(b2 - p22)); + if (maxdist < MaxTolVert || pdist < std::abs(b2 - a2) * 0.01) { if ((IsModified2 && maxdist < newtol) || !IsModified2) { @@ -1946,14 +1948,14 @@ Standard_Boolean ShapeFix_IntersectionTool::FixIntersectingWires(TopoDS_Face& fa if (IsModified2) { // cut edge1 and update tolerance NewV - Standard_Real dista = Abs(a2 - p21) + Abs(a2 - p22); - Standard_Real distb = Abs(b2 - p21) + Abs(b2 - p22); + Standard_Real dista = std::abs(a2 - p21) + std::abs(a2 - p22); + Standard_Real distb = std::abs(b2 - p21) + std::abs(b2 - p22); Standard_Real pend, cut; if (dista > distb) pend = a2; else pend = b2; - if (Abs(pend - p21) > Abs(pend - p22)) + if (std::abs(pend - p21) > std::abs(pend - p22)) cut = p22; else cut = p21; @@ -1980,7 +1982,8 @@ Standard_Boolean ShapeFix_IntersectionTool::FixIntersectingWires(TopoDS_Face& fa else { // create new vertex and split edge1 and edge2 using it - if (Abs(p12 - p11) > Abs(b1 - a1) / 2 || Abs(p22 - p21) > Abs(b2 - a2) / 2) + if (std::abs(p12 - p11) > std::abs(b1 - a1) / 2 + || std::abs(p22 - p21) > std::abs(b2 - a2) / 2) { // segment is big and we have to split each intersecting edge // on 3 edges --> middle edge - edge based on segment @@ -1990,10 +1993,10 @@ Standard_Boolean ShapeFix_IntersectionTool::FixIntersectingWires(TopoDS_Face& fa gp_Pnt P02((Pnt12.X() + Pnt22.X()) / 2, (Pnt12.Y() + Pnt22.Y()) / 2, (Pnt12.Z() + Pnt22.Z()) / 2); - Standard_Real tolV1 = Max(Pnt11.Distance(P01), Pnt21.Distance(P01)); - tolV1 = Max(tolV1, Precision::Confusion()) * 1.00001; - Standard_Real tolV2 = Max(Pnt12.Distance(P02), Pnt22.Distance(P02)); - tolV2 = Max(tolV2, Precision::Confusion()) * 1.00001; + Standard_Real tolV1 = std::max(Pnt11.Distance(P01), Pnt21.Distance(P01)); + tolV1 = std::max(tolV1, Precision::Confusion()) * 1.00001; + Standard_Real tolV2 = std::max(Pnt12.Distance(P02), Pnt22.Distance(P02)); + tolV2 = std::max(tolV2, Precision::Confusion()) * 1.00001; if (tolV1 > MaxTolVert || tolV2 > MaxTolVert) continue; @@ -2003,14 +2006,14 @@ Standard_Boolean ShapeFix_IntersectionTool::FixIntersectingWires(TopoDS_Face& fa // split edge1 Standard_Integer akey1 = 0, akey2 = 0; // analysis fo P01 - if (P01.Distance(PV1) < Max(tolV1, BRep_Tool::Tolerance(V1))) + if (P01.Distance(PV1) < std::max(tolV1, BRep_Tool::Tolerance(V1))) { NewV1 = V1; if (tolV1 > BRep_Tool::Tolerance(V1)) B.UpdateVertex(NewV1, tolV1); akey1++; } - if (P01.Distance(PV2) < Max(tolV1, BRep_Tool::Tolerance(V2))) + if (P01.Distance(PV2) < std::max(tolV1, BRep_Tool::Tolerance(V2))) { NewV1 = V2; if (tolV1 > BRep_Tool::Tolerance(V2)) @@ -2018,14 +2021,14 @@ Standard_Boolean ShapeFix_IntersectionTool::FixIntersectingWires(TopoDS_Face& fa akey1++; } // analysis fo P02 - if (P02.Distance(PV1) < Max(tolV2, BRep_Tool::Tolerance(V1))) + if (P02.Distance(PV1) < std::max(tolV2, BRep_Tool::Tolerance(V1))) { NewV2 = V1; if (tolV2 > BRep_Tool::Tolerance(V1)) B.UpdateVertex(NewV2, tolV2); akey2++; } - if (P02.Distance(PV2) < Max(tolV2, BRep_Tool::Tolerance(V2))) + if (P02.Distance(PV2) < std::max(tolV2, BRep_Tool::Tolerance(V2))) { NewV2 = V2; if (tolV2 > BRep_Tool::Tolerance(V2)) @@ -2192,12 +2195,12 @@ Standard_Boolean ShapeFix_IntersectionTool::FixIntersectingWires(TopoDS_Face& fa Standard_Real param2 = (p21 + p22) / 2; gp_Pnt Pnt10 = GetPointOnEdge(edge1, sas, C1, param1); gp_Pnt Pnt20 = GetPointOnEdge(edge2, sas, C2, param2); - dist1 = Max(Pnt11.Distance(P0), Pnt12.Distance(Pnt10)); - dist2 = Max(Pnt21.Distance(P0), Pnt22.Distance(Pnt10)); - Standard_Real tolV = Max(dist1, dist2); - tolV = Max(tolV, Pnt10.Distance(Pnt20)) * 1.00001; + dist1 = std::max(Pnt11.Distance(P0), Pnt12.Distance(Pnt10)); + dist2 = std::max(Pnt21.Distance(P0), Pnt22.Distance(Pnt10)); + Standard_Real tolV = std::max(dist1, dist2); + tolV = std::max(tolV, Pnt10.Distance(Pnt20)) * 1.00001; B.MakeVertex(NewV, Pnt10, tolV); - MaxTolVert = Max(MaxTolVert, tolV); + MaxTolVert = std::max(MaxTolVert, tolV); hasModifWire = Standard_True; if (SplitEdge2(sewd2, face, num2, p21, p22, NewV, tolV, boxes2)) { diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Root.lxx b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Root.lxx index d149db1239..18c379863a 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Root.lxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Root.lxx @@ -53,7 +53,7 @@ inline Standard_Real ShapeFix_Root::MaxTolerance() const inline Standard_Real ShapeFix_Root::LimitTolerance(const Standard_Real toler) const { // only maximal restriction implemented. - return Min(myMaxTol, toler); + return std::min(myMaxTol, toler); } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_SplitTool.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_SplitTool.cxx index 6d8253c13f..51794f7dce 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_SplitTool.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_SplitTool.cxx @@ -56,7 +56,7 @@ Standard_Boolean ShapeFix_SplitTool::SplitEdge(const TopoDS_Edge& edge, ShapeAnalysis_Edge sae; Handle(Geom2d_Curve) c2d; sae.PCurve(edge, face, c2d, a, b, Standard_True); - if (Abs(a - param) < tol2d || Abs(b - param) < tol2d) + if (std::abs(a - param) < tol2d || std::abs(b - param) < tol2d) return Standard_False; // check distance between edge and new vertex gp_Pnt P1; @@ -201,9 +201,9 @@ Standard_Boolean ShapeFix_SplitTool::CutEdge(const TopoDS_Edge& edge, const TopoDS_Face& face, Standard_Boolean& iscutline) const { - if (Abs(cut - pend) < 10. * Precision::PConfusion()) + if (std::abs(cut - pend) < 10. * Precision::PConfusion()) return Standard_False; - Standard_Real aRange = Abs(cut - pend); + Standard_Real aRange = std::abs(cut - pend); Standard_Real a, b; BRep_Tool::Range(edge, a, b); iscutline = Standard_False; @@ -224,8 +224,8 @@ Standard_Boolean ShapeFix_SplitTool::CutEdge(const TopoDS_Edge& edge, if (tc->BasisCurve()->IsKind(STANDARD_TYPE(Geom2d_Line))) { BRep_Builder B; - B.Range(edge, Min(pend, cut), Max(pend, cut)); - if (Abs(pend - lp) < Precision::PConfusion()) + B.Range(edge, std::min(pend, cut), std::max(pend, cut)); + if (std::abs(pend - lp) < Precision::PConfusion()) { // cut from the beginning Standard_Real cut3d = (cut - fp) * (b - a) / (lp - fp); if (cut3d <= Precision::PConfusion()) @@ -233,7 +233,7 @@ Standard_Boolean ShapeFix_SplitTool::CutEdge(const TopoDS_Edge& edge, B.Range(edge, a + cut3d, b, Standard_True); iscutline = Standard_True; } - else if (Abs(pend - fp) < Precision::PConfusion()) + else if (std::abs(pend - fp) < Precision::PConfusion()) { // cut from the end Standard_Real cut3d = (lp - cut) * (b - a) / (lp - fp); if (cut3d <= Precision::PConfusion()) @@ -248,15 +248,15 @@ Standard_Boolean ShapeFix_SplitTool::CutEdge(const TopoDS_Edge& edge, } // det-study on 03/12/01 checking the old and new ranges - if (Abs(Abs(a - b) - aRange) < Precision::PConfusion()) + if (std::abs(std::abs(a - b) - aRange) < Precision::PConfusion()) return Standard_False; if (aRange < 10. * Precision::PConfusion()) return Standard_False; Handle(Geom_Curve) c = BRep_Tool::Curve(edge, a, b); ShapeAnalysis_Curve sac; - a = Min(pend, cut); - b = Max(pend, cut); + a = std::min(pend, cut); + b = std::max(pend, cut); Standard_Real na = a, nb = b; BRep_Builder B; diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Wire.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Wire.cxx index 6824376cfa..c773710d07 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Wire.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Wire.cxx @@ -155,7 +155,7 @@ void ShapeFix_Wire::SetPrecision(const Standard_Real prec) void ShapeFix_Wire::SetMaxTailAngle(const Standard_Real theMaxTailAngle) { - myMaxTailAngleSine = Sin(theMaxTailAngle); + myMaxTailAngleSine = std::sin(theMaxTailAngle); myMaxTailAngleSine = (myMaxTailAngleSine >= 0) ? myMaxTailAngleSine : 0; } @@ -577,7 +577,7 @@ Standard_Boolean ShapeFix_Wire::FixEdgeCurves() Standard_Boolean tmpUIsoDeg; S->Singularity(j, Preci, P3d, pd1, pd2, par1, par2, tmpUIsoDeg); if (SAC.Project(GAC, P3d, MinTolerance(), pr, split, Standard_True) - < Max(Preci, MinTolerance())) + < std::max(Preci, MinTolerance())) { if (split - a > ::Precision::PConfusion() && b - split > ::Precision::PConfusion()) { @@ -644,7 +644,7 @@ Standard_Boolean ShapeFix_Wire::FixEdgeCurves() Standard_Real aDist = BRep_Tool::Pnt(V1).Distance(BRep_Tool::Pnt(V)); if (aDist < BRep_Tool::Tolerance(V1) * 1.01) { - B.UpdateVertex(V1, Max(aDist, BRep_Tool::Tolerance(V1))); + B.UpdateVertex(V1, std::max(aDist, BRep_Tool::Tolerance(V1))); a = split; V1 = V; continue; @@ -654,7 +654,7 @@ Standard_Boolean ShapeFix_Wire::FixEdgeCurves() aDist = BRep_Tool::Pnt(V2).Distance(BRep_Tool::Pnt(V)); if (aDist < BRep_Tool::Tolerance(V2) * 1.01) { - B.UpdateVertex(V, Max(aDist, BRep_Tool::Tolerance(V2))); + B.UpdateVertex(V, std::max(aDist, BRep_Tool::Tolerance(V2))); b = split; V2 = V; continue; @@ -708,7 +708,7 @@ Standard_Boolean ShapeFix_Wire::FixEdgeCurves() ShapeBuild_Edge sbe; Standard_Real URange, SUF, SUL, SVF, SVL; myAnalyzer->Surface()->Bounds(SUF, SUL, SVF, SVL); - URange = (Abs(SUL - SUF)); + URange = (std::abs(SUL - SUF)); gp_XY vec(0, 0); ShapeAnalysis_Edge sae; Standard_Integer k; @@ -720,7 +720,7 @@ Standard_Boolean ShapeFix_Wire::FixEdgeCurves() break; vec += c2d->Value(cl).XY() - c2d->Value(cf).XY(); } - if (k > nb && Abs(Abs(vec.X()) - URange) < 0.1 * URange) + if (k > nb && std::abs(std::abs(vec.X()) - URange) < 0.1 * URange) { sbe.RemovePCurve(sbwd->Edge(overdegen), face); myFixEdge->Projector()->AdjustOverDegenMode() = Standard_False; @@ -764,7 +764,7 @@ Standard_Boolean ShapeFix_Wire::FixEdgeCurves() TopLoc_Location L; Standard_Real first = 0., last = 0.; BRep_Tool::CurveOnSurface(sbwd->Edge(i), C, S, L, first, last); - if (C.IsNull() || Abs(last - first) < Precision::PConfusion()) + if (C.IsNull() || std::abs(last - first) < Precision::PConfusion()) { // clang-format off SendWarning ( sbwd->Edge ( i ), Message_Msg ( "FixWire.FixCurve3d.Removed" ) );// Incomplete edge (with no pcurves or 3d curve) removed @@ -1459,13 +1459,13 @@ Standard_Boolean ShapeFix_Wire::FixShifted() SUMid = 0.5 * (SUF + SUL); SVMid = 0.5 * (SVF + SVL); if (uclosed) - URange = Abs(SUL - SUF); + URange = std::abs(SUL - SUF); else URange = RealLast(); if (!IsVCrvClosed) { if (vclosed) - VRange = Abs(SVL - SVF); + VRange = std::abs(SVL - SVF); else VRange = RealLast(); } @@ -1530,12 +1530,12 @@ Standard_Boolean ShapeFix_Wire::FixShifted() gp_Pnt2d degP1, degP2; Standard_Real degT1, degT2; if (surf->DegeneratedValues(p, - Max(Precision(), BRep_Tool::Tolerance(V)), + std::max(Precision(), BRep_Tool::Tolerance(V)), degP1, degP2, degT1, degT2)) - isDeg = (Abs(degP1.X() - degP2.X()) > Abs(degP1.Y() - degP2.Y()) ? 1 : 2); + isDeg = (std::abs(degP1.X() - degP2.X()) > std::abs(degP1.Y() - degP2.Y()) ? 1 : 2); // abv 23 Feb 00: UKI60107-6 210: additional check for near-degenerated case // smh#15 PRO19800. Check if the surface is surface of revolution. @@ -1629,32 +1629,36 @@ Standard_Boolean ShapeFix_Wire::FixShifted() Standard_Real scld = (pd2.XY() - pd1.XY()) * x.XY(); Standard_Real scln = (pn2.XY() - pn1.XY()) * x.XY(); if (rot1 * rot2 < -::Precision::PConfusion() && scld * scln < -::Precision::PConfusion() - && Abs(scln) > 0.1 * period && Abs(scld) > 0.1 * period + && std::abs(scln) > 0.1 * period && std::abs(scld) > 0.1 * period && rot1 * scld > ::Precision::PConfusion() && rot2 * scln > ::Precision::PConfusion()) { // abv 02 Mar 00: trying more sophisticated analysis (ie_exhaust-A.stp #37520) - Standard_Real sign = (rot2 > 0 ? 1. : -1.); - Standard_Real deep1 = - Min(sign * (pn2.XY() * x.XY()), - Min(sign * (pd1.XY() * x.XY()), - Min(sign * (c2d2->Value(b2).XY() * x.XY()), - Min(sign * (cx1->Value(ax1).XY() * x.XY()), - Min(sign * (c2d2->Value(0.5 * (a2 + b2)).XY() * x.XY()), - sign * (cx1->Value(0.5 * (ax1 + bx1)).XY() * x.XY())))))); - Standard_Real deep2 = - Max(sign * (pn1.XY() * x.XY()), - Max(sign * (pd2.XY() * x.XY()), - Max(sign * (c2d1->Value(a1).XY() * x.XY()), - Max(sign * (cx2->Value(bx2).XY() * x.XY()), - Max(sign * (c2d1->Value(0.5 * (a1 + b1)).XY() * x.XY()), - sign * (cx2->Value(0.5 * (ax2 + bx2)).XY() * x.XY())))))); + Standard_Real sign = (rot2 > 0 ? 1. : -1.); + Standard_Real deep1 = std::min( + sign * (pn2.XY() * x.XY()), + std::min( + sign * (pd1.XY() * x.XY()), + std::min( + sign * (c2d2->Value(b2).XY() * x.XY()), + std::min(sign * (cx1->Value(ax1).XY() * x.XY()), + std::min(sign * (c2d2->Value(0.5 * (a2 + b2)).XY() * x.XY()), + sign * (cx1->Value(0.5 * (ax1 + bx1)).XY() * x.XY())))))); + Standard_Real deep2 = std::max( + sign * (pn1.XY() * x.XY()), + std::max( + sign * (pd2.XY() * x.XY()), + std::max( + sign * (c2d1->Value(a1).XY() * x.XY()), + std::max(sign * (cx2->Value(bx2).XY() * x.XY()), + std::max(sign * (c2d1->Value(0.5 * (a1 + b1)).XY() * x.XY()), + sign * (cx2->Value(0.5 * (ax2 + bx2)).XY() * x.XY())))))); Standard_Real deep = deep2 - deep1; // estimated current size of wire by x // pdn 30 Oct 00: trying correct period [0,period] (trj5_k1-tc-203.stp #4698) Standard_Real dx = ShapeAnalysis::AdjustToPeriod(deep, ::Precision::PConfusion(), period + ::Precision::PConfusion()); x *= (scld > 0 ? -dx : dx); - // x *= ( Abs(scld-scln) > 1.5 * period ? 2. : 1. ) * + // x *= ( std::abs(scld-scln) > 1.5 * period ? 2. : 1. ) * // ( scld >0 ? -period : period ); gp_Trsf2d Shift; Shift.SetTranslation(x); @@ -1698,14 +1702,14 @@ Standard_Boolean ShapeFix_Wire::FixShifted() Standard_Real du = 0.,dv = 0.; //#79 rln 15.03.99 S4135: bmarkmdl.igs entity 633 (incorrectly oriented contour) check for gap - if(uclosed&&(Abs(p2f.X()-p2l.X())GAS.UResolution(Precision())) - { if((Abs(p2f.X()-SUF)p2l.Y())) + if(uclosed&&(std::abs(p2f.X()-p2l.X())GAS.UResolution(Precision())) + { if((std::abs(p2f.X()-SUF)p2l.Y())) du = -URange; } - if(vclosed&&(Abs(p2f.Y()-p2l.Y())GAS.VResolution(Precision())) - { if((Abs(p2f.Y()-SVF)p2l.X())) dv = VRange; - if((Abs(p2f.Y()-SVL)GAS.VResolution(Precision())) + { if((std::abs(p2f.Y()-SVF)p2l.X())) dv = VRange; + if((std::abs(p2f.Y()-SVL) URange - UTol) du = ShapeAnalysis::AdjustByPeriod(p2d2.X(), p2d1.X(), URange); else if (dx > UTol && stop == nb) @@ -1740,7 +1744,7 @@ Standard_Boolean ShapeFix_Wire::FixShifted() } if (vclosed && isDeg != 2) { - Standard_Real dy = Abs(p2d2.Y() - p2d1.Y()); + Standard_Real dy = std::abs(p2d2.Y() - p2d1.Y()); if (dy > VRange - VTol) dv = ShapeAnalysis::AdjustByPeriod(p2d2.Y(), p2d1.Y(), VRange); else if (dy > VTol && stop == nb) @@ -1763,7 +1767,7 @@ Standard_Boolean ShapeFix_Wire::FixShifted() Standard_Real umin, vmin, umax, vmax; box.Get(umin, vmin, umax, vmax); - if (Abs(umin + umax - SUF - SUL) < URange && Abs(vmin + vmax - SVF - SVL) < VRange + if (std::abs(umin + umax - SUF - SUL) < URange && std::abs(vmin + vmax - SVF - SVL) < VRange && !LastFixStatus(ShapeExtend_DONE)) return Standard_False; @@ -2078,16 +2082,16 @@ static Standard_Boolean RemoveLoop(TopoDS_Edge& E, std::cout << "Cut Loop: tol orig " << tol << ", prec " << prec << ", new tol " << newtol << std::endl; #endif - if (newtol > Max(prec, tol)) + if (newtol > std::max(prec, tol)) return Standard_False; //: s2 bs = BRep_Tool::CurveOnSurface ( edge, face, a, b ); - if (Abs(a - f) > ::Precision::PConfusion() || // smth strange, cancel - Abs(b - l) > ::Precision::PConfusion()) + if (std::abs(a - f) > ::Precision::PConfusion() || // smth strange, cancel + std::abs(b - l) > ::Precision::PConfusion()) return Standard_False; // PTV OCC884 if (!aPlaneSurf.IsNull()) { - B.UpdateEdge(E, aNew3dCrv, Max(newtol, tol)); + B.UpdateEdge(E, aNew3dCrv, std::max(newtol, tol)); // OCC901 if (!TryNewPCurve(E, face, bs, a, b, newtol)) return Standard_False; @@ -2122,7 +2126,7 @@ static Standard_Boolean RemoveLoop(TopoDS_Edge& E, Standard_Real dist2 = pcurPnt.Distance(crv->Value(Seq3d->Value(2))); Standard_Real dist3 = pcurPnt.Distance(crv->Value(Seq3d->Value(3))); Standard_Real ftrim, ltrim; - if (dist3 > Max(dist1, dist2)) + if (dist3 > std::max(dist1, dist2)) { loopRemoved3d = Standard_False; } @@ -2261,7 +2265,7 @@ static Standard_Boolean RemoveLoop(TopoDS_Edge& E, Standard_Real dist2 = pcurPnt.Distance(crv->Value(Seq3d->Value(2))); Standard_Real dist3 = pcurPnt.Distance(crv->Value(Seq3d->Value(3))); Standard_Real ftrim, ltrim; - if (dist3 > Max(dist1, dist2)) + if (dist3 > std::max(dist1, dist2)) { // is loop in 3d ftrim = Seq3d->Value(1); ltrim = Seq3d->Value(2); @@ -2396,7 +2400,7 @@ Standard_Boolean ShapeFix_Wire::FixSelfIntersectingEdge(const Standard_Integer n Standard_Real dist22 = pnt2.SquareDistance(pint); if (dist21 < tol1 * tol1 || dist22 < tol2 * tol2) continue; - newtol = 1.001 * Sqrt(Min(dist21, dist22)); //: f8 + newtol = 1.001 * std::sqrt(std::min(dist21, dist22)); //: f8 //: k3 abv 24 Dec 98: BUC50070 #26682 and #30087: try to remove loop if (myGeomMode) @@ -2411,7 +2415,7 @@ Standard_Boolean ShapeFix_Wire::FixSelfIntersectingEdge(const Standard_Integer n Face(), points2d.Value(i), tolfact, - Min(MaxTolerance(), Max(newtol, Precision())), + std::min(MaxTolerance(), std::max(newtol, Precision())), myRemoveLoopMode == 0)) { myLastFixStatus |= ShapeExtend::EncodeStatus(ShapeExtend_DONE4); @@ -2483,7 +2487,7 @@ Standard_Boolean ShapeFix_Wire::FixSelfIntersectingEdge(const Standard_Integer n if (!E1.IsNull()) { TTSS->Append(E1); - newtol = Max(BRep_Tool::Tolerance(E1), BRep_Tool::Tolerance(E2)); + newtol = std::max(BRep_Tool::Tolerance(E1), BRep_Tool::Tolerance(E2)); } else newtol = BRep_Tool::Tolerance(E2); @@ -2637,8 +2641,8 @@ Standard_Boolean ShapeFix_Wire::FixIntersectingEdges(const Standard_Integer num) Standard_Real param1 = (num == 1 ? IP.ParamOnSecond() : IP.ParamOnFirst()); Standard_Real param2 = (num == 1 ? IP.ParamOnFirst() : IP.ParamOnSecond()); - Standard_Real newRange1 = Abs((isForward1 ? a1 : b1) - param1); - Standard_Real newRange2 = Abs((isForward2 ? b2 : a2) - param2); + Standard_Real newRange1 = std::abs((isForward1 ? a1 : b1) - param1); + Standard_Real newRange2 = std::abs((isForward2 ? b2 : a2) - param2); if (newRange1 > prevRange1 && newRange2 > prevRange2) continue; @@ -2658,7 +2662,7 @@ Standard_Boolean ShapeFix_Wire::FixIntersectingEdges(const Standard_Integer num) rad + ComputeLocalDeviation(E1, pint, pnt, param1, (isForward1 ? b1 : a1), Face()); Standard_Real te2 = rad + ComputeLocalDeviation(E2, pint, pnt, (isForward2 ? a2 : b2), param2, Face()); - Standard_Real maxte = Max(te1, te2); + Standard_Real maxte = std::max(te1, te2); if (maxte < MaxTolerance() && maxte < newtol) { if (BRep_Tool::Tolerance(E1) < te1 || BRep_Tool::Tolerance(E2) < te2) @@ -2970,8 +2974,8 @@ Standard_Boolean ShapeFix_Wire::FixIntersectingEdges(const Standard_Integer num1 continue; // if the vertexies are far than tolerances so // we do not need to increase edge tolerance - if (aNecessaryVtxTole > Max(aMaxEdgeTol1, tole1) - || aNecessaryVtxTole > Max(aMaxEdgeTol2, tole2)) + if (aNecessaryVtxTole > std::max(aMaxEdgeTol1, tole1) + || aNecessaryVtxTole > std::max(aMaxEdgeTol2, tole2)) { aMaxEdgeTol1 = 0.0; aMaxEdgeTol2 = 0.0; @@ -2995,10 +2999,10 @@ Standard_Boolean ShapeFix_Wire::FixIntersectingEdges(const Standard_Integer num1 myLastFixStatus |= ShapeExtend::EncodeStatus(ShapeExtend_DONE1); if (newTolers(rank) < finTol) { - if (Max(aMaxEdgeTol1, aMaxEdgeTol2) < finTol && (aMaxEdgeTol1 > 0 || aMaxEdgeTol2 > 0)) + if (std::max(aMaxEdgeTol1, aMaxEdgeTol2) < finTol && (aMaxEdgeTol1 > 0 || aMaxEdgeTol2 > 0)) { - aNewTolEdge1 = Max(aNewTolEdge1, aMaxEdgeTol1); - aNewTolEdge2 = Max(aNewTolEdge2, aMaxEdgeTol2); + aNewTolEdge1 = std::max(aNewTolEdge1, aMaxEdgeTol1); + aNewTolEdge2 = std::max(aNewTolEdge2, aMaxEdgeTol2); } else { @@ -3017,14 +3021,14 @@ Standard_Boolean ShapeFix_Wire::FixIntersectingEdges(const Standard_Integer num1 if (aNewTolEdge1 > 0) { for (i = 1; i <= 2; i++) - if (aNewTolEdge1 > Max(vertexTolers(i), newTolers(i))) + if (aNewTolEdge1 > std::max(vertexTolers(i), newTolers(i))) newTolers(i) = aNewTolEdge1; B.UpdateEdge(edge1, aNewTolEdge1); } if (aNewTolEdge2 > 0) { for (i = 3; i <= 4; i++) - if (aNewTolEdge2 > Max(vertexTolers(i), newTolers(i))) + if (aNewTolEdge2 > std::max(vertexTolers(i), newTolers(i))) newTolers(i) = aNewTolEdge2; B.UpdateEdge(edge2, aNewTolEdge2); } @@ -3180,7 +3184,7 @@ Standard_Boolean ShapeFix_Wire::FixLacking(const Standard_Integer num, const Sta ShapeAnalysis_Edge sae; TopoDS_Vertex V1 = sae.LastVertex(E1); TopoDS_Vertex V2 = sae.FirstVertex(E2); - Standard_Real tol = Max(BRep_Tool::Tolerance(V1), BRep_Tool::Tolerance(V2)); + Standard_Real tol = std::max(BRep_Tool::Tolerance(V1), BRep_Tool::Tolerance(V2)); Standard_Real Prec = Precision(); Standard_Real dist2d = myAnalyzer->MaxDistance2d(); @@ -3288,8 +3292,8 @@ Standard_Boolean ShapeFix_Wire::FixLacking(const Standard_Integer num, const Sta p3d2 = c3d->Value(a); Standard_Real dist2d3d2 = p3d2.Distance(surf->Value(p2d2)); - tol1 = Max(BRep_Tool::Tolerance(E1), dist2d3d1); - tol2 = Max(BRep_Tool::Tolerance(E2), dist2d3d2); + tol1 = std::max(BRep_Tool::Tolerance(E1), dist2d3d1); + tol2 = std::max(BRep_Tool::Tolerance(E2), dist2d3d2); //: c5 Standard_Real tol0 = Max ( tol1 + tol2, thepreci ); Standard_Real tol0 = tol1 + tol2; //: c5 abv 26 Feb 98: CTS17806 #44418 Standard_Real dist3d2 = p3d1.SquareDistance(p3d2); @@ -3514,9 +3518,9 @@ Standard_Boolean ShapeFix_Wire::FixNotchedEdges() // check whether the whole edges should be removed - this is the case // when split point coincides with the end of the edge; // for closed edges split point may fall at the other end (see issue #0029780) - if (Abs(param - (isRemoveFirst ? b : a)) <= ::Precision::PConfusion() + if (std::abs(param - (isRemoveFirst ? b : a)) <= ::Precision::PConfusion() || (sae.IsClosed3d(splitE) - && Abs(param - (isRemoveFirst ? a : b)) <= ::Precision::PConfusion())) + && std::abs(param - (isRemoveFirst ? a : b)) <= ::Precision::PConfusion())) { FixDummySeam(n1); // The seam edge is removed from the list. So, need to step back to avoid missing of edge @@ -3526,7 +3530,7 @@ Standard_Boolean ShapeFix_Wire::FixNotchedEdges() else // perform splitting of the edge and adding to wire { // pdn check if it is necessary - if (Abs((isRemoveFirst ? a : b) - param) < ::Precision::PConfusion()) + if (std::abs((isRemoveFirst ? a : b) - param) < ::Precision::PConfusion()) { continue; } diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Wire_1.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Wire_1.cxx index 297446a071..a2b4ea7aaa 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Wire_1.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Wire_1.cxx @@ -133,7 +133,7 @@ static Standard_Real AdjustOnPeriodic3d(const Handle(Geom_Curve)& c, if (ShapeAnalysis_Curve::IsPeriodic(c)) { Standard_Real T = c->Period(); - Standard_Real shift = -IntegerPart(first / T) * T; + Standard_Real shift = -std::trunc(first / T) * T; if (first < 0.) shift += T; Standard_Real sfirst = first + shift, slast = last + shift; @@ -350,8 +350,8 @@ Standard_Boolean ShapeFix_Wire::FixGap3d(const Standard_Integer num, const Stand // 15.11.2002 PTV OCC966 if (!ShapeAnalysis_Curve::IsPeriodic(c)) tc = new Geom_TrimmedCurve(c, - Max(first, c->FirstParameter()), - Min(last, c->LastParameter())); + std::max(first, c->FirstParameter()), + std::min(last, c->LastParameter())); else tc = new Geom_TrimmedCurve(c, first, last); bsp = GeomConvert::CurveToBSplineCurve(tc); @@ -422,7 +422,7 @@ Standard_Boolean ShapeFix_Wire::FixGap3d(const Standard_Integer num, const Stand { if (c1->IsKind(STANDARD_TYPE(Geom_Circle)) || c1->IsKind(STANDARD_TYPE(Geom_Ellipse))) { - Standard_Real diff = M_PI - Abs(clast1 - cfirst2) * 0.5; + Standard_Real diff = M_PI - std::abs(clast1 - cfirst2) * 0.5; first1 -= diff; last1 += diff; done1 = Standard_True; @@ -517,8 +517,8 @@ Standard_Boolean ShapeFix_Wire::FixGap3d(const Standard_Integer num, const Stand u2 = AdjustOnPeriodic3d(c2, !reversed2, first2, last2, u2); // Check points to satisfy distance criterium gp_Pnt p1 = c1->Value(u1), p2 = c2->Value(u2); - if (p1.Distance(p2) <= gap && Abs(cfirst1 - u1) > ::Precision::PConfusion() - && Abs(clast2 - u2) > ::Precision::PConfusion() + if (p1.Distance(p2) <= gap && std::abs(cfirst1 - u1) > ::Precision::PConfusion() + && std::abs(clast2 - u2) > ::Precision::PConfusion() && (((u1 > first1) && (u1 < last1)) || ((u2 > first2) && (u2 < last2)) || (cpnt1.Distance(p1) <= gap) || (cpnt2.Distance(p2) <= gap))) { @@ -574,13 +574,13 @@ Standard_Boolean ShapeFix_Wire::FixGap3d(const Standard_Integer num, const Stand if (pp1.Distance(pp2) < ::Precision::Confusion()) { // assume intersection - pardist = Abs(cfirst1 - uu1); + pardist = std::abs(cfirst1 - uu1); if (pardist1 > pardist || pardist1 < 0.) { index1 = i; pardist1 = pardist; } - pardist = Abs(clast2 - uu2); + pardist = std::abs(clast2 - uu2); if (pardist2 > pardist || pardist2 < 0.) { index2 = i; @@ -609,8 +609,8 @@ Standard_Boolean ShapeFix_Wire::FixGap3d(const Standard_Integer num, const Stand uu2 = AdjustOnPeriodic3d(c2, !reversed2, first2, last2, uu2); // Check points to satisfy distance criterium pp1 = c1->Value(uu1), pp2 = c2->Value(uu2); - if (pp1.Distance(pp2) <= gap && Abs(cfirst1 - uu1) > ::Precision::PConfusion() - && Abs(clast2 - uu2) > ::Precision::PConfusion() + if (pp1.Distance(pp2) <= gap && std::abs(cfirst1 - uu1) > ::Precision::PConfusion() + && std::abs(clast2 - uu2) > ::Precision::PConfusion() && (((uu1 > first1) && (uu1 < last1)) || ((uu2 > first2) && (uu2 < last2)) || (cpnt1.Distance(pp1) <= gap) || (cpnt2.Distance(pp2) <= gap))) { @@ -792,7 +792,7 @@ static Standard_Real AdjustOnPeriodic2d(const Handle(Geom2d_Curve)& pc, if (ShapeAnalysis_Curve::IsPeriodic(pc)) { Standard_Real T = pc->Period(); - Standard_Real shift = -IntegerPart(first / T) * T; + Standard_Real shift = -std::trunc(first / T) * T; if (first < 0.) shift += T; Standard_Real sfirst = first + shift, slast = last + shift; @@ -820,7 +820,7 @@ Standard_Boolean ShapeFix_Wire::FixGap2d(const Standard_Integer num, const Stand constexpr Standard_Real preci = ::Precision::PConfusion(); // Standard_Real preci = Precision(); // GeomAdaptor_Surface& SA = Analyzer().Surface()->Adaptor()->ChangeSurface(); - // preci = Max(SA.UResolution(preci), SA.VResolution(preci)); + // preci = std::max(SA.UResolution(preci), SA.VResolution(preci)); Handle(ShapeExtend_WireData) sbwd = WireData(); Standard_Integer n2 = (num > 0 ? num : sbwd->NbEdges()); @@ -1001,8 +1001,8 @@ Standard_Boolean ShapeFix_Wire::FixGap2d(const Standard_Integer num, const Stand // 15.11.2002 PTV OCC966 if (!ShapeAnalysis_Curve::IsPeriodic(pc)) c = new Geom2d_TrimmedCurve(pc, - Max(first, pc->FirstParameter()), - Min(last, pc->LastParameter())); + std::max(first, pc->FirstParameter()), + std::min(last, pc->LastParameter())); else c = new Geom2d_TrimmedCurve(pc, first, last); bsp = Geom2dConvert::CurveToBSplineCurve(c); @@ -1074,7 +1074,7 @@ Standard_Boolean ShapeFix_Wire::FixGap2d(const Standard_Integer num, const Stand { if (pc1->IsKind(STANDARD_TYPE(Geom2d_Circle)) || pc1->IsKind(STANDARD_TYPE(Geom2d_Ellipse))) { - Standard_Real diff = M_PI - Abs(clast1 - cfirst2) * 0.5; + Standard_Real diff = M_PI - std::abs(clast1 - cfirst2) * 0.5; first1 -= diff; last1 += diff; done1 = Standard_True; @@ -1167,13 +1167,13 @@ Standard_Boolean ShapeFix_Wire::FixGap2d(const Standard_Integer num, const Stand Standard_Real u1 = AdjustOnPeriodic2d(pc1, reversed1, first1, last1, IP.ParamOnFirst()); Standard_Real u2 = AdjustOnPeriodic2d(pc2, !reversed2, first2, last2, IP.ParamOnSecond()); - pardist = Abs(cfirst1 - u1); + pardist = std::abs(cfirst1 - u1); if (pardist1 > pardist || pardist1 < 0.) { index1 = i; pardist1 = pardist; } - pardist = Abs(clast2 - u2); + pardist = std::abs(clast2 - u2); if (pardist2 > pardist || pardist2 < 0.) { index2 = i; @@ -1199,14 +1199,14 @@ Standard_Boolean ShapeFix_Wire::FixGap2d(const Standard_Integer num, const Stand AdjustOnPeriodic2d(pc1, reversed1, first1, last1, IP.ParamOnFirst()); Standard_Real u2 = AdjustOnPeriodic2d(pc2, !reversed2, first2, last2, IP.ParamOnSecond()); - pardist = Abs(cfirst1 - u1); + pardist = std::abs(cfirst1 - u1); if (pardist1 > pardist || pardist1 < 0.) { flag1 = j; index1 = i; pardist1 = pardist; } - pardist = Abs(clast2 - u2); + pardist = std::abs(clast2 - u2); if (pardist2 > pardist || pardist2 < 0.) { flag2 = j; @@ -1262,8 +1262,8 @@ Standard_Boolean ShapeFix_Wire::FixGap2d(const Standard_Integer num, const Stand Standard_Real u2 = AdjustOnPeriodic2d(pc2, !reversed2, first2, last2, IP.ParamOnSecond()); // Check points to satisfy distance criterium gp_Pnt2d p1 = pc1->Value(u1), p2 = pc2->Value(u2); - if (p1.Distance(p2) <= gap && Abs(cfirst1 - u1) > ::Precision::PConfusion() - && Abs(clast2 - u2) > ::Precision::PConfusion() + if (p1.Distance(p2) <= gap && std::abs(cfirst1 - u1) > ::Precision::PConfusion() + && std::abs(clast2 - u2) > ::Precision::PConfusion() && (((u1 > first1) && (u1 < last1)) || ((u2 > first2) && (u2 < last2)) || (cpnt1.Distance(p1) <= gap) || (cpnt2.Distance(p2) <= gap))) { @@ -1287,8 +1287,8 @@ Standard_Boolean ShapeFix_Wire::FixGap2d(const Standard_Integer num, const Stand u2 = AdjustOnPeriodic2d(pc2, !reversed2, first2, last2, u2); // Check points to satisfy distance criterium gp_Pnt2d p1 = pc1->Value(u1), p2 = pc2->Value(u2); - if (p1.Distance(p2) <= gap && Abs(cfirst1 - u1) > ::Precision::PConfusion() - && Abs(clast2 - u2) > ::Precision::PConfusion() + if (p1.Distance(p2) <= gap && std::abs(cfirst1 - u1) > ::Precision::PConfusion() + && std::abs(clast2 - u2) > ::Precision::PConfusion() && (((u1 > first1) && (u1 < last1)) || ((u2 > first2) && (u2 < last2)) || (cpnt1.Distance(p1) <= gap) || (cpnt2.Distance(p2) <= gap))) { @@ -1400,8 +1400,8 @@ Standard_Boolean ShapeFix_Wire::FixGap2d(const Standard_Integer num, const Stand u2 = AdjustOnPeriodic2d(pc2, !reversed2, first2, last2, u2); // Check points to satisfy distance criterium gp_Pnt2d p1 = pc1->Value(u1), p2 = pc2->Value(u2); - if (p1.Distance(p2) <= gap && Abs(cfirst1 - u1) > ::Precision::PConfusion() - && Abs(clast2 - u2) > ::Precision::PConfusion() + if (p1.Distance(p2) <= gap && std::abs(cfirst1 - u1) > ::Precision::PConfusion() + && std::abs(clast2 - u2) > ::Precision::PConfusion() && (((u1 > first1) && (u1 < last1)) || ((u2 > first2) && (u2 < last2)) || (cpnt1.Distance(p1) <= gap) || (cpnt2.Distance(p2) <= gap))) { @@ -1547,7 +1547,7 @@ Standard_Boolean ShapeFix_Wire::FixGap2d(const Standard_Integer num, const Stand fpar, lpar, Inter.Point(i).ParamOnSecond()); - dist = Abs((j == 1 ? cfirst1 : clast2) - uu); + dist = std::abs((j == 1 ? cfirst1 : clast2) - uu); if (mindist > dist || mindist < 0.) { index = i; @@ -1575,7 +1575,7 @@ Standard_Boolean ShapeFix_Wire::FixGap2d(const Standard_Integer num, const Stand fpar, lpar, IP.ParamOnSecond()); - dist = Abs((jj == 1 ? cfirst1 : clast2) - uu); + dist = std::abs((jj == 1 ? cfirst1 : clast2) - uu); if (mindist > dist || mindist < 0.) { flag = jj; @@ -1601,12 +1601,12 @@ Standard_Boolean ShapeFix_Wire::FixGap2d(const Standard_Integer num, const Stand fpar, lpar, IP.ParamOnSecond()); - if (j == 1 && Abs(cfirst1 - uu) > ::Precision::PConfusion()) + if (j == 1 && std::abs(cfirst1 - uu) > ::Precision::PConfusion()) { ipar1 = uu; ipnt = IP.Value(); } - if (j == 2 && Abs(clast2 - uu) > ::Precision::PConfusion()) + if (j == 2 && std::abs(clast2 - uu) > ::Precision::PConfusion()) { ipar2 = uu; ipnt = IP.Value(); diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Wireframe.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Wireframe.cxx index 71746fa2ff..6f0124f913 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Wireframe.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Wireframe.cxx @@ -323,7 +323,7 @@ static Standard_Boolean JoinEdges(const TopoDS_Edge& E1, ? TopAbs_FORWARD : TopAbs_REVERSED); } - B.UpdateEdge(newedge, CRes, Max(BRep_Tool::Tolerance(E1), BRep_Tool::Tolerance(E2))); + B.UpdateEdge(newedge, CRes, std::max(BRep_Tool::Tolerance(E1), BRep_Tool::Tolerance(E2))); Standard_Real fp = CRes->FirstParameter(); Standard_Real lp = CRes->LastParameter(); if (fp > newf) @@ -628,7 +628,7 @@ Standard_Boolean ShapeFix_Wireframe::MergeSmallEdges( const Standard_Real theLimitAngle) { Standard_Boolean aModLimitAngle = (theLimitAngle > -1.0 || myLimitAngle > -1.0); - Standard_Real aLimitAngle = Max(theLimitAngle, myLimitAngle); + Standard_Real aLimitAngle = std::max(theLimitAngle, myLimitAngle); Standard_Boolean aModeDrop = theModeDrop || myModeDrop; TopTools_DataMapOfShapeShape theNewVertices; @@ -736,7 +736,7 @@ Standard_Boolean ShapeFix_Wireframe::MergeSmallEdges( if (Vec1.SquareMagnitude() < tol2 || Vec2.SquareMagnitude() < tol2) Ang1 = M_PI / 2.; else - Ang1 = Abs(Vec1.Angle(Vec2)); + Ang1 = std::abs(Vec1.Angle(Vec2)); C2->D1(last2, P, Vec1); C3->D1(first3, P, Vec2); if (edge2.Orientation() == TopAbs_REVERSED) @@ -746,8 +746,8 @@ Standard_Boolean ShapeFix_Wireframe::MergeSmallEdges( if (Vec1.SquareMagnitude() < tol2 || Vec2.SquareMagnitude() < tol2) Ang2 = M_PI / 2.; else - Ang2 = Abs(Vec1.Angle(Vec2)); - // isLimAngle = (theLimitAngle != -1 && Min(Ang1,Ang2) > theLimitAngle); + Ang2 = std::abs(Vec1.Angle(Vec2)); + // isLimAngle = (theLimitAngle != -1 && std::min(Ang1,Ang2) > theLimitAngle); // take_next = (Ang2 aLimitAngle); + isLimAngle = (aModLimitAngle && std::min(Ang1, Ang2) > aLimitAngle); } else if (same_set1 && !same_set2) { @@ -1220,7 +1220,7 @@ Standard_Boolean ShapeFix_Wireframe::MergeSmallEdges( if (Vec1.SquareMagnitude() < tol2 || Vec2.SquareMagnitude() < tol2) Ang1 = M_PI / 2.; else - Ang1 = Abs(Vec1.Angle(Vec2)); + Ang1 = std::abs(Vec1.Angle(Vec2)); C2->D1(last2, P, Vec1); C3->D1(first3, P, Vec2); if (edge2.Orientation() == TopAbs_REVERSED) @@ -1230,8 +1230,8 @@ Standard_Boolean ShapeFix_Wireframe::MergeSmallEdges( if (Vec1.SquareMagnitude() < tol2 || Vec2.SquareMagnitude() < tol2) Ang2 = M_PI / 2.; else - Ang2 = Abs(Vec1.Angle(Vec2)); - // isLimAngle = (theLimitAngle != -1 && Min(Ang1,Ang2) > theLimitAngle); + Ang2 = std::abs(Vec1.Angle(Vec2)); + // isLimAngle = (theLimitAngle != -1 && std::min(Ang1,Ang2) > theLimitAngle); // take_next = (Ang2 aLimitAngle); + isLimAngle = (aModLimitAngle && std::min(Ang1, Ang2) > aLimitAngle); } else if (same_set1 && !same_set2) { diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade.cxx index 5c7468a2ab..cc6dbd98c9 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade.cxx @@ -86,7 +86,7 @@ Standard_Boolean ShapeUpgrade::C0BSplineToSequenceOfC1BSplineCurve( TempKnots(TempKnotIndex) = KnotSequence(StartFlatIndex - deg); for (j = StartFlatIndex - deg + 1; j <= EndFlatIndex + deg; j++) - if (Abs(KnotSequence(j) - KnotSequence(j - 1)) <= gp::Resolution()) + if (std::abs(KnotSequence(j) - KnotSequence(j - 1)) <= gp::Resolution()) TempMults(TempKnotIndex)++; else TempKnots(++TempKnotIndex) = KnotSequence(j); diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_ConvertCurve2dToBezier.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_ConvertCurve2dToBezier.cxx index 0d3af95812..1df4c5f01a 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_ConvertCurve2dToBezier.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_ConvertCurve2dToBezier.cxx @@ -163,9 +163,9 @@ void ShapeUpgrade_ConvertCurve2dToBezier::Compute() Standard_Real bf = aBSpline2d->FirstParameter(); Standard_Real bl = aBSpline2d->LastParameter(); - if (Abs(First - bf) < precision) + if (std::abs(First - bf) < precision) First = bf; - if (Abs(Last - bl) < precision) + if (std::abs(Last - bl) < precision) Last = bl; if (First < bf) { diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_ConvertCurve3dToBezier.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_ConvertCurve3dToBezier.cxx index 4508e6b40e..c095123472 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_ConvertCurve3dToBezier.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_ConvertCurve3dToBezier.cxx @@ -146,9 +146,9 @@ void ShapeUpgrade_ConvertCurve3dToBezier::Compute() Standard_Real bf = aBSpline->FirstParameter(); Standard_Real bl = aBSpline->LastParameter(); - if (Abs(First - bf) < precision) + if (std::abs(First - bf) < precision) First = bf; - if (Abs(Last - bl) < precision) + if (std::abs(Last - bl) < precision) Last = bl; if (First < bf) { diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_ConvertSurfaceToBezierBasis.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_ConvertSurfaceToBezierBasis.cxx index 29b878d2c2..ece774bca9 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_ConvertSurfaceToBezierBasis.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_ConvertSurfaceToBezierBasis.cxx @@ -528,7 +528,8 @@ static Handle(Geom_Surface) GetSegment(const Handle(Geom_Surface)& surf, << std::endl; #endif } - if (Abs(U1 - Umin) < Precision::PConfusion() && Abs(U2 - Umax) < Precision::PConfusion()) + if (std::abs(U1 - Umin) < Precision::PConfusion() + && std::abs(U2 - Umax) < Precision::PConfusion()) return revol; Handle(Geom_RectangularTrimmedSurface) res = diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_FaceDivide.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_FaceDivide.cxx index aae3ebfa9e..f6ec6108fb 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_FaceDivide.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_FaceDivide.cxx @@ -123,17 +123,17 @@ Standard_Boolean ShapeUpgrade_FaceDivide::SplitSurface(const Standard_Real theAr { Standard_Real dU = (Ul - Uf) * 0.01; if (Uf > aSUf) - Uf -= Min(dU, Uf - aSUf); + Uf -= std::min(dU, Uf - aSUf); if (Ul < aSUl) - Ul += Min(dU, aSUl - Ul); + Ul += std::min(dU, aSUl - Ul); } if (!surf->IsVPeriodic()) { Standard_Real dV = (Vl - Vf) * 0.01; if (Vf > aSVf) - Vf -= Min(dV, Vf - aSVf); + Vf -= std::min(dV, Vf - aSVf); if (Vl < aSVl) - Vl += Min(dV, aSVl - Vl); + Vl += std::min(dV, aSVl - Vl); } SplitSurf->Init(surf, Uf, Ul, Vf, Vl, theArea); diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_FixSmallBezierCurves.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_FixSmallBezierCurves.cxx index 3f5dadaa34..a5f2bcda3a 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_FixSmallBezierCurves.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_FixSmallBezierCurves.cxx @@ -102,7 +102,7 @@ Standard_Boolean ShapeUpgrade_FixSmallBezierCurves::Approx(Handle(Geom_Curve)& TopLoc_Location L; Handle(Geom_Surface) aSurf = BRep_Tool::Surface(myFace, L); GeomAdaptor_Surface ads(aSurf); // = new GeomAdaptor_Surface(aSurf); - Standard_Real prec = Max(ads.UResolution(Precision()), ads.VResolution(Precision())); + Standard_Real prec = std::max(ads.UResolution(Precision()), ads.VResolution(Precision())); if (sae.PCurve(myEdge, myFace, c2d, f, l, Standard_False)) { if (First < f) diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_SplitCurve2d.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_SplitCurve2d.cxx index 192e850398..5cebe6a55b 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_SplitCurve2d.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_SplitCurve2d.cxx @@ -63,9 +63,9 @@ void ShapeUpgrade_SplitCurve2d::Init(const Handle(Geom2d_Curve)& C, { Standard_Real fP = aCurve->FirstParameter(); Standard_Real lP = aCurve->LastParameter(); - if (Abs(firstPar - fP) < precision) + if (std::abs(firstPar - fP) < precision) firstPar = fP; - if (Abs(lastPar - lP) < precision) + if (std::abs(lastPar - lP) < precision) lastPar = lP; if (firstPar < fP) { @@ -151,8 +151,8 @@ void ShapeUpgrade_SplitCurve2d::Build(const Standard_Boolean Segment) if (myNbCurves == 1) { Standard_Boolean filled = Standard_True; - if (Abs(myCurve->FirstParameter() - First) < Precision::PConfusion() - && Abs(myCurve->LastParameter() - Last) < Precision::PConfusion()) + if (std::abs(myCurve->FirstParameter() - First) < Precision::PConfusion() + && std::abs(myCurve->LastParameter() - Last) < Precision::PConfusion()) myResultingCurves->SetValue(1, myCurve); else if (!Segment diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_SplitCurve3d.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_SplitCurve3d.cxx index 105c4ea648..16eacf45af 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_SplitCurve3d.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_SplitCurve3d.cxx @@ -62,9 +62,9 @@ void ShapeUpgrade_SplitCurve3d::Init(const Handle(Geom_Curve)& C, { Standard_Real fP = aCurve->FirstParameter(); Standard_Real lP = aCurve->LastParameter(); - if (Abs(firstPar - fP) < precision) + if (std::abs(firstPar - fP) < precision) firstPar = fP; - if (Abs(lastPar - lP) < precision) + if (std::abs(lastPar - lP) < precision) lastPar = lP; if (firstPar < fP) { @@ -153,9 +153,9 @@ void ShapeUpgrade_SplitCurve3d::Build(const Standard_Boolean Segment) constexpr Standard_Real precision = Precision::PConfusion(); Standard_Real firstPar = myCurve->FirstParameter(); Standard_Real lastPar = myCurve->LastParameter(); - if (Abs(First - firstPar) < precision) + if (std::abs(First - firstPar) < precision) First = firstPar; - if (Abs(Last - lastPar) < precision) + if (std::abs(Last - lastPar) < precision) Last = lastPar; if (First < firstPar) { @@ -180,8 +180,8 @@ void ShapeUpgrade_SplitCurve3d::Build(const Standard_Boolean Segment) if (myNbCurves == 1) { Standard_Boolean filled = Standard_True; - if (Abs(myCurve->FirstParameter() - First) < Precision::PConfusion() - && Abs(myCurve->LastParameter() - Last) < Precision::PConfusion()) + if (std::abs(myCurve->FirstParameter() - First) < Precision::PConfusion() + && std::abs(myCurve->LastParameter() - Last) < Precision::PConfusion()) myResultingCurves->SetValue(1, myCurve); else if (!Segment diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_SplitSurface.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_SplitSurface.cxx index 03a179fea2..eaa50e552d 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_SplitSurface.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_SplitSurface.cxx @@ -115,8 +115,8 @@ void ShapeUpgrade_SplitSurface::Init(const Handle(Geom_Surface)& S, } else { - UF = Max(U1, UFirst); - UL = Min(U2, ULast); + UF = std::max(U1, UFirst); + UL = std::min(U2, ULast); } if (VFirst > V2 - precision || VLast < V1 - precision) { @@ -125,8 +125,8 @@ void ShapeUpgrade_SplitSurface::Init(const Handle(Geom_Surface)& S, } else { - VF = Max(V1, VFirst); - VL = Min(V2, VLast); + VF = std::max(V1, VFirst); + VL = std::min(V2, VLast); } if (myArea != 0.) @@ -350,10 +350,10 @@ void ShapeUpgrade_SplitSurface::Build(const Standard_Boolean Segment) { Handle(Geom_RectangularTrimmedSurface) NewSurf = new Geom_RectangularTrimmedSurface(NewSurfaceEx, - Max(U1, UFirst), - Min(ULast, U2), - Max(VFirst, V1), - Min(VLast, V2)); + std::max(U1, UFirst), + std::min(ULast, U2), + std::max(VFirst, V1), + std::min(VLast, V2)); Surfaces->SetValue(nc1, 1, NewSurf); } } @@ -434,8 +434,10 @@ void ShapeUpgrade_SplitSurface::Build(const Standard_Boolean Segment) { mySurface->Bounds(U1, U2, V1, V2); Standard_Boolean filled = Standard_True; - if (Abs(U1 - UFirst) < Precision::PConfusion() && Abs(U2 - ULast) < Precision::PConfusion() - && Abs(V1 - VFirst) < Precision::PConfusion() && Abs(V2 - VLast) < Precision::PConfusion()) + if (std::abs(U1 - UFirst) < Precision::PConfusion() + && std::abs(U2 - ULast) < Precision::PConfusion() + && std::abs(V1 - VFirst) < Precision::PConfusion() + && std::abs(V2 - VLast) < Precision::PConfusion()) Surfaces->SetValue(1, 1, mySurface); else if (!Segment || !mySurface->IsKind(STANDARD_TYPE(Geom_BSplineSurface)) || !Status(ShapeExtend_DONE2)) diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_SplitSurfaceArea.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_SplitSurfaceArea.cxx index 10f90a88a1..4cb6bfb5fd 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_SplitSurfaceArea.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_SplitSurfaceArea.cxx @@ -61,7 +61,7 @@ void ShapeUpgrade_SplitSurfaceArea::Compute(const Standard_Boolean /*Segment*/) { if (!anIsFixedUVnbSplits) //(myUnbSplit <= 0 || myVnbSplit <= 0) { - Standard_Real aSquareSize = Sqrt(myArea / myNbParts); + Standard_Real aSquareSize = std::sqrt(myArea / myNbParts); myUnbSplit = (Standard_Integer)(myUsize / aSquareSize); myVnbSplit = (Standard_Integer)(myVsize / aSquareSize); if (myUnbSplit == 0) diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_SplitSurfaceContinuity.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_SplitSurfaceContinuity.cxx index 31f88aba3f..66a775253b 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_SplitSurfaceContinuity.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_SplitSurfaceContinuity.cxx @@ -167,7 +167,11 @@ void ShapeUpgrade_SplitSurfaceContinuity::Compute(const Standard_Boolean Segment tmp->Bounds(U1, U2, V1, V2); Handle(Geom_Surface) theSurf = tmp->BasisSurface(); ShapeUpgrade_SplitSurfaceContinuity sps; - sps.Init(theSurf, Max(U1, UFirst), Min(U2, ULast), Max(V1, VFirst), Min(V2, VLast)); + sps.Init(theSurf, + std::max(U1, UFirst), + std::min(U2, ULast), + std::max(V1, VFirst), + std::min(V2, VLast)); sps.SetUSplitValues(myUSplitValues); sps.SetVSplitValues(myVSplitValues); sps.SetTolerance(myTolerance); diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_Tool.lxx b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_Tool.lxx index 6d94bef273..c6ac033329 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_Tool.lxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_Tool.lxx @@ -79,5 +79,5 @@ inline Standard_Real ShapeUpgrade_Tool::MaxTolerance() const inline Standard_Real ShapeUpgrade_Tool::LimitTolerance(const Standard_Real toler) const { // only maximal restriction implemented. - return Min(myMaxTol, toler); + return std::min(myMaxTol, toler); } diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx index d83ad2fb42..633c770f10 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx @@ -116,7 +116,7 @@ static Standard_Boolean IsUiso(const TopoDS_Edge& theEdge, const TopoDS_Face& th gp_Pnt2d aP2d; gp_Vec2d aVec; aBAcurve2d.D1(aBAcurve2d.FirstParameter(), aP2d, aVec); - return (Abs(aVec.Y()) > Abs(aVec.X())); + return (std::abs(aVec.Y()) > std::abs(aVec.X())); } static Standard_Boolean IsLinear(const BRepAdaptor_Curve& theBAcurve, gp_Dir& theDir) @@ -259,7 +259,7 @@ static Standard_Boolean TryMakeLine(const Handle(Geom2d_Curve)& thePCurve, gp_Vec2d aVec(aFirstPnt, aLastPnt); Standard_Real aSqLen = aVec.SquareMagnitude(); Standard_Real aSqParamLen = (theLast - theFirst) * (theLast - theFirst); - if (Abs(aSqLen - aSqParamLen) > Precision::Confusion()) + if (std::abs(aSqLen - aSqParamLen) > Precision::Confusion()) return Standard_False; gp_Dir2d aDir = aVec; @@ -346,7 +346,7 @@ static Standard_Real ComputeMinEdgeSize(const TopTools_SequenceOfShape& theEdges if (aSqDist < MinSize) MinSize = aSqDist; } - MinSize = Sqrt(MinSize); + MinSize = std::sqrt(MinSize); return MinSize; } @@ -622,12 +622,13 @@ static void RelocatePCurvesToNewUorigin( (anOrientation == TopAbs_FORWARD) ? anEdgeStartParam : anEdgeEndParam; gp_Pnt2d aPoint = aPCurve->Value(aParam); Standard_Real anOffset = CurPoint.Coord(theIndCoord) - aPoint.Coord(theIndCoord); - if (!(Abs(anOffset) < theCoordTol || Abs(Abs(anOffset) - thePeriod) < theCoordTol)) + if (!(std::abs(anOffset) < theCoordTol + || std::abs(std::abs(anOffset) - thePeriod) < theCoordTol)) { continue; // may be if CurVertex is deg.vertex } - if (Abs(anOffset) > thePeriod / 2) + if (std::abs(anOffset) > thePeriod / 2) { anOffset = TrueValueOfOffset(anOffset, thePeriod); gp_Vec2d aVec; @@ -799,8 +800,8 @@ static void ReconstructMissedSeam(const TopTools_SequenceOfShape& theRemovedEdge { Standard_Real aParam = (anEdge.Orientation() == TopAbs_FORWARD) ? Param1 : Param2; gp_Pnt2d aPoint = aPC->Value(aParam); - Standard_Real aUdiff = Abs(aPoint.X() - theCurPoint.X()); - Standard_Real aVdiff = Abs(aPoint.Y() - theCurPoint.Y()); + Standard_Real aUdiff = std::abs(aPoint.X() - theCurPoint.X()); + Standard_Real aVdiff = std::abs(aPoint.Y() - theCurPoint.Y()); if ((theUperiod != 0. && aUdiff > theUperiod / 2) || (theVperiod != 0. && aVdiff > theVperiod / 2)) { @@ -828,8 +829,8 @@ static void ReconstructMissedSeam(const TopTools_SequenceOfShape& theRemovedEdge aPC = BRep_Tool::CurveOnSurface(anEdge, theFrefFace, Param1, Param2); aParam = (anEdge.Orientation() == TopAbs_FORWARD) ? Param1 : Param2; aPoint = aPC->Value(aParam); - aUdiff = Abs(aPoint.X() - theCurPoint.X()); - aVdiff = Abs(aPoint.Y() - theCurPoint.Y()); + aUdiff = std::abs(aPoint.X() - theCurPoint.X()); + aVdiff = std::abs(aPoint.Y() - theCurPoint.Y()); } if ((theUperiod == 0. || aUdiff < theUperiod / 2) && (theVperiod == 0. || aVdiff < theVperiod / 2)) @@ -872,7 +873,7 @@ static Standard_Boolean SameSurf(const Handle(Geom_Surface)& theS1, } else { - uf1 = Min(-1., (ul1 - 1.)); + uf1 = std::min(-1., (ul1 - 1.)); } } else @@ -883,7 +884,7 @@ static Standard_Boolean SameSurf(const Handle(Geom_Surface)& theS1, } else { - if (Abs(uf1 - uf2) > aPTol) + if (std::abs(uf1 - uf2) > aPTol) { return Standard_False; } @@ -898,7 +899,7 @@ static Standard_Boolean SameSurf(const Handle(Geom_Surface)& theS1, } else { - vf1 = Min(-1., (vl1 - 1.)); + vf1 = std::min(-1., (vl1 - 1.)); } } else @@ -909,7 +910,7 @@ static Standard_Boolean SameSurf(const Handle(Geom_Surface)& theS1, } else { - if (Abs(vf1 - vf2) > aPTol) + if (std::abs(vf1 - vf2) > aPTol) { return Standard_False; } @@ -924,7 +925,7 @@ static Standard_Boolean SameSurf(const Handle(Geom_Surface)& theS1, } else { - ul1 = Max(1., (uf1 + 1.)); + ul1 = std::max(1., (uf1 + 1.)); } } else @@ -935,7 +936,7 @@ static Standard_Boolean SameSurf(const Handle(Geom_Surface)& theS1, } else { - if (Abs(ul1 - ul2) > aPTol) + if (std::abs(ul1 - ul2) > aPTol) { return Standard_False; } @@ -950,7 +951,7 @@ static Standard_Boolean SameSurf(const Handle(Geom_Surface)& theS1, } else { - vl1 = Max(1., (vf1 + 1.)); + vl1 = std::max(1., (vf1 + 1.)); } } else @@ -961,7 +962,7 @@ static Standard_Boolean SameSurf(const Handle(Geom_Surface)& theS1, } else { - if (Abs(vl1 - vl2) > aPTol) + if (std::abs(vl1 - vl2) > aPTol) { return Standard_False; } @@ -1022,7 +1023,7 @@ static void TransformPCurves(const TopoDS_Face& theRefFace, Standard_Real aParam = ElCLib::LineParameter(AxisOfSurfFace.Axis(), OriginRefSurf); - if (Abs(aParam) > Precision::PConfusion()) + if (std::abs(aParam) > Precision::PConfusion()) aTranslation = -aParam; gp_Dir VdirSurfFace = AxisOfSurfFace.Direction(); @@ -1049,9 +1050,9 @@ static void TransformPCurves(const TopoDS_Face& theRefFace, else anAngle = XdirRefSurf.Angle(XdirSurfFace); - ToRotate = (Abs(anAngle) > Precision::PConfusion()); + ToRotate = (std::abs(anAngle) > Precision::PConfusion()); - ToTranslate = (Abs(aTranslation) > Precision::PConfusion()); + ToTranslate = (std::abs(aTranslation) > Precision::PConfusion()); ToModify = ToTranslate || ToRotate || X_Reverse || Y_Reverse; } @@ -1106,7 +1107,7 @@ static void TransformPCurves(const TopoDS_Face& theRefFace, Handle(Geom_Curve) aC3d = BRep_Tool::Curve(anEdge, fpar, lpar); aC3d = new Geom_TrimmedCurve(aC3d, fpar, lpar); Standard_Real tol = BRep_Tool::Tolerance(anEdge); - tol = Min(tol, Precision::Approximation()); + tol = std::min(tol, Precision::Approximation()); NewPCurves[ii] = GeomProjLib::Curve2d(aC3d, RefSurf); } else @@ -1144,8 +1145,8 @@ static void TransformPCurves(const TopoDS_Face& theRefFace, Standard_Real aVperiod = (RefSurf->IsVClosed()) ? (aVmax - aVmin) : 0.; gp_Pnt2d aP2dOnPCurve1 = PCurveOnRef->Value(fpar); gp_Pnt2d aP2dOnPCurve2 = NewPCurves[0]->Value(fpar); - if ((aUperiod != 0. && Abs(aP2dOnPCurve1.X() - aP2dOnPCurve2.X()) > aUperiod / 2) - || (aVperiod != 0. && Abs(aP2dOnPCurve1.Y() - aP2dOnPCurve2.Y()) > aVperiod / 2)) + if ((aUperiod != 0. && std::abs(aP2dOnPCurve1.X() - aP2dOnPCurve2.X()) > aUperiod / 2) + || (aVperiod != 0. && std::abs(aP2dOnPCurve1.Y() - aP2dOnPCurve2.Y()) > aVperiod / 2)) { Handle(Geom2d_Curve) NullPCurve; BB.UpdateEdge(anEdge, NullPCurve, theRefFace, 0.); @@ -1855,7 +1856,7 @@ void ShapeUpgrade_UnifySameDomain::UnionPCurves(const TopTools_SequenceOfShape& gp_Circ2d aCirc = anAdaptor.Circle(); gp_Circ2d aPrevCirc = aPrevAdaptor.Circle(); if (aCirc.Location().Distance(aPrevCirc.Location()) <= Precision::Confusion() - && Abs(aCirc.Radius() - aPrevCirc.Radius()) <= Precision::Confusion()) + && std::abs(aCirc.Radius() - aPrevCirc.Radius()) <= Precision::Confusion()) { isSameCurve = Standard_True; gp_Pnt2d p1 = anAdaptor.Value(aFirst); @@ -1979,7 +1980,7 @@ void ShapeUpgrade_UnifySameDomain::UnionPCurves(const TopTools_SequenceOfShape& for (Standard_Integer ii = 1; ii <= ResPCurves.Length(); ii++) { Standard_Real aRange = ResLasts(ii) - ResFirsts(ii); - if (Abs(aRange3d - aRange) > aMaxTol) + if (std::abs(aRange3d - aRange) > aMaxTol) IsBadRange = Standard_True; } @@ -2017,7 +2018,8 @@ void ShapeUpgrade_UnifySameDomain::UnionPCurves(const TopTools_SequenceOfShape& { for (Standard_Integer ii = 1; ii <= ResPCurves.Length(); ii++) { - if (Abs(aFirst3d - ResFirsts(ii)) > aMaxTol || Abs(aLast3d - ResLasts(ii)) > aMaxTol) + if (std::abs(aFirst3d - ResFirsts(ii)) > aMaxTol + || std::abs(aLast3d - ResLasts(ii)) > aMaxTol) { Geom2dAdaptor_Curve aGAcurve(ResPCurves(ii)); GeomAbs_CurveType aType = aGAcurve.GetType(); @@ -2255,7 +2257,7 @@ Standard_Boolean ShapeUpgrade_UnifySameDomain::MergeSubSeq( // result curve gp_Pnt aP0 = BRep_Tool::Pnt(V[0]); gp_Pnt aP1 = BRep_Tool::Pnt(V[1]); - Standard_Real aTol = Max(BRep_Tool::Tolerance(V[0]), BRep_Tool::Tolerance(V[1])); + Standard_Real aTol = std::max(BRep_Tool::Tolerance(V[0]), BRep_Tool::Tolerance(V[1])); if (aP0.SquareDistance(aP1) < aTol * aTol) { isClosed = Standard_True; @@ -2280,7 +2282,7 @@ Standard_Boolean ShapeUpgrade_UnifySameDomain::MergeSubSeq( FP = adef.LastParameter(); LP = adef.FirstParameter(); } - if (Abs(FP) < Precision::PConfusion()) + if (std::abs(FP) < Precision::PConfusion()) { B.MakeEdge(E, Cir, Precision::Confusion()); B.Add(E, V[0]); @@ -2321,7 +2323,7 @@ Standard_Boolean ShapeUpgrade_UnifySameDomain::MergeSubSeq( } gp_Pnt PointFirst = BRep_Tool::Pnt(V[0]); - while (Abs(ParamLast - ParamFirst) > 7 * M_PI / 8) + while (std::abs(ParamLast - ParamFirst) > 7 * M_PI / 8) ParamLast = (ParamFirst + ParamLast) / 2; BRepAdaptor_Curve BAcurveFE(FE); gp_Pnt PointLast = BAcurveFE.Value(ParamLast); @@ -3308,7 +3310,7 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces( TopTools_MapOfShape edgesMap; CoordTol = ComputeMinEdgeSize(edges, F_RefFace, edgesMap); CoordTol /= 10.; - CoordTol = Max(CoordTol, Precision::Confusion()); + CoordTol = std::max(CoordTol, Precision::Confusion()); TopTools_IndexedDataMapOfShapeListOfShape VEmap; for (Standard_Integer ind = 1; ind <= edges.Length(); ind++) @@ -3360,9 +3362,10 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces( aPC1 = BRep_Tool::CurveOnSurface(EdgeWith2pcurves, F_RefFace, aFirst, aLast); EdgeWith2pcurves.Reverse(); aPC2 = BRep_Tool::CurveOnSurface(EdgeWith2pcurves, F_RefFace, aFirst, aLast); - gp_Pnt2d aPnt1 = aPC1->Value(aFirst); - gp_Pnt2d aPnt2 = aPC2->Value(aFirst); - Standard_Boolean anIsUclosed = (Abs(aPnt1.X() - aPnt2.X()) > Abs(aPnt1.Y() - aPnt2.Y())); + gp_Pnt2d aPnt1 = aPC1->Value(aFirst); + gp_Pnt2d aPnt2 = aPC2->Value(aFirst); + Standard_Boolean anIsUclosed = + (std::abs(aPnt1.X() - aPnt2.X()) > std::abs(aPnt1.Y() - aPnt2.Y())); Standard_Boolean aToMakeUPeriodic = Standard_False, aToMakeVPeriodic = Standard_False; if (anIsUclosed && Uperiod == 0.) aToMakeUPeriodic = Standard_True; @@ -3636,9 +3639,9 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces( if (CurVertex.IsSame(StartVertex)) { // Points of two vertices coincide in 3d but may be not in 2d - if ((Uperiod != 0. && Abs(StartPoint.X() - CurPoint.X()) > Uperiod / 2) + if ((Uperiod != 0. && std::abs(StartPoint.X() - CurPoint.X()) > Uperiod / 2) || (Vperiod != 0. - && Abs(StartPoint.Y() - CurPoint.Y()) + && std::abs(StartPoint.Y() - CurPoint.Y()) > Vperiod / 2)) // end of parametric space { // do not contain seams => we must reconstruct the seam up to @@ -3725,13 +3728,13 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces( BRep_Tool::CurveOnSurface(anEdge, F_RefFace, fpar, lpar); Standard_Real aParam = (anEdge.Orientation() == TopAbs_FORWARD) ? fpar : lpar; gp_Pnt2d aPoint = aPCurve->Value(aParam); - Standard_Real DiffU = Abs(aPoint.X() - CurPoint.X()); - Standard_Real DiffV = Abs(aPoint.Y() - CurPoint.Y()); + Standard_Real DiffU = std::abs(aPoint.X() - CurPoint.X()); + Standard_Real DiffV = std::abs(aPoint.Y() - CurPoint.Y()); if (Uperiod != 0. && DiffU > CoordTol - && Abs(DiffU - Uperiod) > CoordTol) // may be it is a deg.vertex + && std::abs(DiffU - Uperiod) > CoordTol) // may be it is a deg.vertex continue; if (Vperiod != 0. && DiffV > CoordTol - && Abs(DiffV - Vperiod) > CoordTol) // may be it is a deg.vertex + && std::abs(DiffV - Vperiod) > CoordTol) // may be it is a deg.vertex continue; // Check: may be and are on Period from each other @@ -3753,7 +3756,7 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces( // Check: may be it is the end if (LastVertexOfSeam.IsSame(StartVertex) - && Abs(StartPoint.X() - StartOfNextEdge.X()) < Uperiod / 2) + && std::abs(StartPoint.X() - StartOfNextEdge.X()) < Uperiod / 2) EndOfWire = Standard_True; break; @@ -3776,8 +3779,8 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces( if (Uperiod != 0. || Vperiod != 0.) { if (CurVertex.IsSame(StartVertex) - && (Uperiod == 0. || Abs(StartPoint.X() - CurPoint.X()) < Uperiod / 2) - && (Vperiod == 0. || Abs(StartPoint.Y() - CurPoint.Y()) < Vperiod / 2)) + && (Uperiod == 0. || std::abs(StartPoint.X() - CurPoint.X()) < Uperiod / 2) + && (Vperiod == 0. || std::abs(StartPoint.Y() - CurPoint.Y()) < Vperiod / 2)) break; // end of wire ReconstructMissedSeam(RemovedEdges, @@ -4040,7 +4043,7 @@ void ShapeUpgrade_UnifySameDomain::UnifyEdges() sff.SetContext(myContext); sff.SetPrecision(aPrec); sff.SetMinTolerance(aPrec); - sff.SetMaxTolerance(Max(1., aPrec * 1000.)); + sff.SetMaxTolerance(std::max(1., aPrec * 1000.)); sff.FixOrientationMode() = 0; sff.FixAddNaturalBoundMode() = 0; sff.FixIntersectingWiresMode() = 0; diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_WireDivide.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_WireDivide.cxx index cc2b628a35..0e6c7b3fed 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_WireDivide.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeUpgrade/ShapeUpgrade_WireDivide.cxx @@ -162,7 +162,7 @@ static void CorrectSplitValues(const Handle(TColStd_HSequenceOfReal)& orig3d, Standard_Real par = new2d->Value(i); Standard_Integer index = 0; for (Standard_Integer j = 1; j <= len2d && !index; j++) - if (Abs(par - orig2d->Value(j)) < preci) + if (std::abs(par - orig2d->Value(j)) < preci) index = j; if (index && !fixNew3d(index)) { @@ -180,7 +180,7 @@ static void CorrectSplitValues(const Handle(TColStd_HSequenceOfReal)& orig3d, Standard_Real par = new3d->Value(i); Standard_Integer index = 0; for (Standard_Integer j = 1; j <= len3d && !index; j++) - if (Abs(par - orig3d->Value(j)) < preci) + if (std::abs(par - orig3d->Value(j)) < preci) index = j; if (index && !fixNew2d(index)) { @@ -485,7 +485,7 @@ void ShapeUpgrade_WireDivide::Perform() std::cout << "Error: Number of intervals are not equal for 2d 3d. Ignored." << std::endl; #endif - nbc = Min(nbc, nbc2d); + nbc = std::min(nbc, nbc2d); } } } diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepApprox/BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox.hxx b/src/ModelingAlgorithms/TKTopAlgo/BRepApprox/BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox.hxx index 20cd8e1cd3..0b7b325a47 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepApprox/BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox.hxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepApprox/BRepApprox_TheZerImpFuncOfTheImpPrmSvSurfacesOfApprox.hxx @@ -66,7 +66,7 @@ public: Standard_Real Root() const; - //! Returns the value Tol so that if Abs(Func.Root()) 2) @@ -564,10 +564,10 @@ void FindExactUVBounds(const TopoDS_Face& FF, break; } } - else if (Abs(v - vmin) <= TolV || Abs(v - vmax) <= TolV) + else if (std::abs(v - vmin) <= TolV || std::abs(v - vmax) <= TolV) { Standard_Real d = Du * aV; - if (1. - Abs(d) <= Precision::PConfusion()) + if (1. - std::abs(d) <= Precision::PConfusion()) { Nv++; if (Nv > 2) @@ -602,9 +602,9 @@ void FindExactUVBounds(const TopoDS_Face& FF, // fill box for the given face Standard_Real aT1, aT2; - Standard_Real TolU = Max(aBAS.UResolution(Tol), Precision::PConfusion()); - Standard_Real TolV = Max(aBAS.VResolution(Tol), Precision::PConfusion()); - Standard_Real TolUV = Max(TolU, TolV); + Standard_Real TolU = std::max(aBAS.UResolution(Tol), Precision::PConfusion()); + Standard_Real TolV = std::max(aBAS.VResolution(Tol), Precision::PConfusion()); + Standard_Real TolUV = std::max(TolU, TolV); Bnd_Box2d aBox; ex.Init(F, TopAbs_EDGE); for (; ex.More(); ex.Next()) @@ -633,8 +633,8 @@ void FindExactUVBounds(const TopoDS_Face& FF, aS->Bounds(aUmin, aUmax, aVmin, aVmax); if (!aS->IsUPeriodic()) { - umin = Max(aUmin, umin); - umax = Min(aUmax, umax); + umin = std::max(aUmin, umin); + umax = std::min(aUmax, umax); } else { @@ -648,8 +648,8 @@ void FindExactUVBounds(const TopoDS_Face& FF, // if (!aS->IsVPeriodic()) { - vmin = Max(aVmin, vmin); - vmax = Min(aVmax, vmax); + vmin = std::max(aVmin, vmin); + vmax = std::min(aVmax, vmax); } else { @@ -765,9 +765,9 @@ void AdjustFaceBox(const BRepAdaptor_Surface& BS, FaceBox.Get(fxmin, fymin, fzmin, fxmax, fymax, fzmax); EdgeBox.Get(exmin, eymin, ezmin, exmax, eymax, ezmax); // - Standard_Real TolU = Max(BS.UResolution(Tol), Precision::PConfusion()); - Standard_Real TolV = Max(BS.VResolution(Tol), Precision::PConfusion()); - BRepTopAdaptor_FClass2d FClass(BS.Face(), Max(TolU, TolV)); + Standard_Real TolU = std::max(BS.UResolution(Tol), Precision::PConfusion()); + Standard_Real TolV = std::max(BS.VResolution(Tol), Precision::PConfusion()); + BRepTopAdaptor_FClass2d FClass(BS.Face(), std::max(TolU, TolV)); // Standard_Boolean isModified = Standard_False; if (exmin > fxmin) diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx index 995f7b995b..ba75b482ab 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_FastSewing.cxx @@ -266,7 +266,7 @@ void BRepBuilderAPI_FastSewing::Perform(void) // create vertices having unique coordinates Standard_Real aRange = Compute3DRange(); Handle(NCollection_IncAllocator) anAlloc = new NCollection_IncAllocator; - NCollection_CellFilter aCells(Max(myTolerance, aRange / IntegerLast()), + NCollection_CellFilter aCells(std::max(myTolerance, aRange / IntegerLast()), anAlloc); for (Standard_Integer i = myFaceVec.Lower(); i <= myFaceVec.Upper(); i++) @@ -531,8 +531,8 @@ Standard_Real BRepBuilderAPI_FastSewing::Compute3DRange() Standard_Real aXm = 0.0, aYm = 0.0, aZm = 0.0, aXM = 0.0, aYM = 0.0, aZM = 0.0; aBox.Get(aXm, aYm, aZm, aXM, aYM, aZM); Standard_Real aDelta = aXM - aXm; - aDelta = Max(aDelta, aYM - aYm); - aDelta = Max(aDelta, aZM - aZm); + aDelta = std::max(aDelta, aYM - aYm); + aDelta = std::max(aDelta, aZM - aZm); return aDelta; } diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_MakeShapeOnMesh.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_MakeShapeOnMesh.cxx index 12c298ee02..22fc238a7d 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_MakeShapeOnMesh.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_MakeShapeOnMesh.cxx @@ -31,8 +31,8 @@ struct Edge { //! Constructor. Sets edge nodes. Edge(const Standard_Integer TheIdx1, const Standard_Integer TheIdx2) - : Idx1(Min(TheIdx1, TheIdx2)), - Idx2(Max(TheIdx1, TheIdx2)) + : Idx1(std::min(TheIdx1, TheIdx2)), + Idx2(std::max(TheIdx1, TheIdx2)) { } diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx index 2ca75c1ae4..ab9b0071a4 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx @@ -211,10 +211,10 @@ static Standard_Boolean IsClosedByIsos(const Handle(Geom_Surface)& thesurf, { Standard_Boolean isClosed = Standard_False; - gp_Pnt2d psurf1 = - (acrv2d->IsPeriodic() ? acrv2d->Value(f2d) : acrv2d->Value(Max(f2d, acrv2d->FirstParameter()))); - gp_Pnt2d psurf2 = - (acrv2d->IsPeriodic() ? acrv2d->Value(l2d) : acrv2d->Value(Min(l2d, acrv2d->LastParameter()))); + gp_Pnt2d psurf1 = (acrv2d->IsPeriodic() ? acrv2d->Value(f2d) + : acrv2d->Value(std::max(f2d, acrv2d->FirstParameter()))); + gp_Pnt2d psurf2 = (acrv2d->IsPeriodic() ? acrv2d->Value(l2d) + : acrv2d->Value(std::min(l2d, acrv2d->LastParameter()))); Handle(Geom_Curve) aCrv1; Handle(Geom_Curve) aCrv2; if (isUIsos) @@ -491,7 +491,7 @@ static Standard_Boolean findNMVertices(const TopoDS_Edge& theEdge, locProj.Perform(pt); if (locProj.IsDone() && locProj.NbExt() > 0) { - Standard_Real dist2Min = Min(distF2, distL2); + Standard_Real dist2Min = std::min(distF2, distL2); Standard_Integer ind, indMin = 0; for (ind = 1; ind <= locProj.NbExt(); ind++) { @@ -906,11 +906,10 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& { Standard_Real pf = c2d1->FirstParameter(); // Standard_Real pl = c2d1->LastParameter(); - gp_Pnt2d p1n = c2d1->Value(Max(first, pf)); - // gp_Pnt2d p2n = c2d1->Value(Min(pl,last)); - gp_Pnt2d p21n = c2d2->Value(Max(first, c2d2->FirstParameter())); - gp_Pnt2d p22n = c2d2->Value(Min(last, c2d2->LastParameter())); - Standard_Real aDist = Min(p1n.Distance(p21n), p1n.Distance(p22n)); + gp_Pnt2d p1n = c2d1->Value(std::max(first, pf)); + gp_Pnt2d p21n = c2d2->Value(std::max(first, c2d2->FirstParameter())); + gp_Pnt2d p22n = c2d2->Value(std::min(last, c2d2->LastParameter())); + Standard_Real aDist = std::min(p1n.Distance(p21n), p1n.Distance(p22n)); Standard_Real U1, U2, V1, V2; surf2->Bounds(U1, U2, V1, V2); isSeam = ((uclosed && aDist > 0.75 * (fabs(U2 - U1))) @@ -1035,7 +1034,7 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& if (dist > dist2) dist2 = dist; } - maxTol = Max(sqrt(dist2) * (1. + 1e-7), Precision::Confusion()); + maxTol = std::max(sqrt(dist2) * (1. + 1e-7), Precision::Confusion()); } } if (maxTol >= 0. && maxTol < tolReached) @@ -1393,7 +1392,7 @@ Standard_Boolean BRepBuilderAPI_Sewing::IsMergedClosed(const TopoDS_Edge& Edge1, gp_Pnt2d p22d = C2d1->Value(0.5*(first2d2 + last2d2)); Standard_Real dist2d = p12d.Distance(p22d); GeomAdaptor_Surface Ads(BRep_Tool::Surface(face)); - Standard_Real distSurf = Max(Ads.UResolution(dist), Ads.VResolution(dist)); + Standard_Real distSurf = std::max(Ads.UResolution(dist), Ads.VResolution(dist)); return (dist2d*0.2 >= distSurf); */ Standard_Integer isULongC1, isULongC2, isVLongC1, isVLongC2; @@ -1421,11 +1420,11 @@ Standard_Boolean BRepBuilderAPI_Sewing::IsMergedClosed(const TopoDS_Edge& Edge1, if (isUClosed && isVLongC1 && isVLongC2) { // Do not merge if not overlapped by V - Standard_Real dist = Max((C2Vmin - C1Vmax), (C1Vmin - C2Vmax)); + Standard_Real dist = std::max((C2Vmin - C1Vmax), (C1Vmin - C2Vmax)); if (dist < 0.0) { - Standard_Real distInner = Max((C2Umin - C1Umax), (C1Umin - C2Umax)); - Standard_Real distOuter = (SUmax - SUmin) - Max((C2Umax - C1Umin), (C1Umax - C2Umin)); + Standard_Real distInner = std::max((C2Umin - C1Umax), (C1Umin - C2Umax)); + Standard_Real distOuter = (SUmax - SUmin) - std::max((C2Umax - C1Umin), (C1Umax - C2Umin)); if (distOuter <= distInner) return Standard_True; } @@ -1433,11 +1432,11 @@ Standard_Boolean BRepBuilderAPI_Sewing::IsMergedClosed(const TopoDS_Edge& Edge1, if (isVClosed && isULongC1 && isULongC2) { // Do not merge if not overlapped by U - Standard_Real dist = Max((C2Umin - C1Umax), (C1Umin - C2Umax)); + Standard_Real dist = std::max((C2Umin - C1Umax), (C1Umin - C2Umax)); if (dist < 0.0) { - Standard_Real distInner = Max((C2Vmin - C1Vmax), (C1Vmin - C2Vmax)); - Standard_Real distOuter = (SVmax - SVmin) - Max((C2Vmax - C1Vmin), (C1Vmax - C2Vmin)); + Standard_Real distInner = std::max((C2Vmin - C1Vmax), (C1Vmin - C2Vmax)); + Standard_Real distOuter = (SVmax - SVmin) - std::max((C2Vmax - C1Vmin), (C1Vmax - C2Vmin)); if (distOuter <= distInner) return Standard_True; } @@ -1728,7 +1727,7 @@ Standard_Boolean BRepBuilderAPI_Sewing::FindCandidates(TopTools_SequenceOfShape& TColStd_SequenceOfInteger seqEqDistantIndex; seqEqDistantIndex.Append(1); for (i = 2; i <= nbCandidates; i++) { Standard_Integer index = seqCandidateIndex(i); - if (Abs(minDistance - arrDistance(index)) <= Precision::Confusion()) + if (std::abs(minDistance - arrDistance(index)) <= Precision::Confusion()) seqEqDistantIndex.Append(index); } @@ -1892,7 +1891,7 @@ void BRepBuilderAPI_Sewing::Init(const Standard_Real tolerance, const Standard_Boolean optionNonmanifold) { // Set tolerance and Perform options - myTolerance = Max(tolerance, Precision::Confusion()); + myTolerance = std::max(tolerance, Precision::Confusion()); mySewing = optionSewing; myAnalysis = optionAnalysis; myCutting = optionCutting; @@ -3745,7 +3744,7 @@ void BRepBuilderAPI_Sewing::Merging(const Standard_Boolean /* firstTime */, { const TopoDS_Edge& edge = TopoDS::Edge(MergedWithSections.FindFromKey(MapSplitEdges.FindKey(ii))); - MinSplitTol = Min(MinSplitTol, BRep_Tool::Tolerance(edge)); + MinSplitTol = std::min(MinSplitTol, BRep_Tool::Tolerance(edge)); } // Calculate bound merging tolerance const TopoDS_Edge& BoundEdge = TopoDS::Edge(MergedWithBound.FindFromKey(bound)); @@ -4215,7 +4214,7 @@ static Standard_Boolean IsDegeneratedWire(const TopoDS_Shape& wire) // Get maximal vertices tolerance TopoDS_Vertex V1, V2; // TopExp::Vertices(TopoDS::Wire(wire),V1,V2); - // Standard_Real tol = Max(BRep_Tool::Tolerance(V1),BRep_Tool::Tolerance(V2)); + // Standard_Real tol = std::max(BRep_Tool::Tolerance(V1),BRep_Tool::Tolerance(V2)); Standard_Real wireLength = 0.0; TopLoc_Location loc; Standard_Real first, last; @@ -4313,8 +4312,8 @@ static TopoDS_Edge DegeneratedSection(const TopoDS_Shape& section, const TopoDS_ // Test if the new edge is degenerated TopoDS_Vertex v1, v2; TopExp::Vertices(TopoDS::Edge(section), v1, v2); - // Standard_Real tol = Max(BRep_Tool::Tolerance(v1),BRep_Tool::Tolerance(v2)); - // tol = Max(tolerance,tol); + // Standard_Real tol = std::max(BRep_Tool::Tolerance(v1),BRep_Tool::Tolerance(v2)); + // tol = std::max(tolerance,tol); gp_Pnt p1, p2, p3; p1 = BRep_Tool::Pnt(v1); @@ -4352,7 +4351,7 @@ static TopoDS_Edge DegeneratedSection(const TopoDS_Shape& section, const TopoDS_ { Standard_Real d1 = BRep_Tool::Tolerance(v1) + p2.Distance(p1); Standard_Real d2 = BRep_Tool::Tolerance(v2) + p2.Distance(p3); - Standard_Real newTolerance = Max(d1, d2); + Standard_Real newTolerance = std::max(d1, d2); aBuilder.MakeVertex(newVertex, p2, newTolerance); } TopoDS_Shape anEdge = edge.Oriented(TopAbs_FORWARD); @@ -4812,7 +4811,7 @@ void BRepBuilderAPI_Sewing::ProjectPointsOnCurve(const TColgp_Array1OfPnt& arrPn if (locProj.IsDone() && locProj.NbExt() > 0) { Standard_Real dist2Min = - (isConsiderEnds || i1 == find || i1 == lind ? Min(distF2, distL2) + (isConsiderEnds || i1 == find || i1 == lind ? std::min(distF2, distL2) : Precision::Infinite()); Standard_Integer ind, indMin = 0; for (ind = 1; ind <= locProj.NbExt(); ind++) @@ -4833,7 +4832,7 @@ void BRepBuilderAPI_Sewing::ProjectPointsOnCurve(const TColgp_Array1OfPnt& arrPn Standard_Real distProj2 = ptProj.SquareDistance(pt); if (!locProj.IsMin(indMin)) { - if (Min(distF2, distL2) < dist2Min) + if (std::min(distF2, distL2) < dist2Min) { if (distF2 < distL2) { @@ -4870,7 +4869,7 @@ void BRepBuilderAPI_Sewing::ProjectPointsOnCurve(const TColgp_Array1OfPnt& arrPn } if (!isProjected && isConsiderEnds) { - if (Min(distF2, distL2) < worktol * worktol) + if (std::min(distF2, distL2) < worktol * worktol) { if (distF2 < distL2) { @@ -4986,7 +4985,7 @@ void BRepBuilderAPI_Sewing::CreateCuttingNodes(const TopTools_IndexedMapOfShape& } // Check if current point is close to one of the existent - if (distMin <= Max(disProj * 0.1, MinTolerance())) + if (distMin <= std::max(disProj * 0.1, MinTolerance())) { // Check distance if close Standard_Real jdist = seqDist.Value(indexMin); @@ -5233,12 +5232,12 @@ void BRepBuilderAPI_Sewing::CreateSections(const TopoDS_Shape& secti // try { c2dNew = Handle(Geom2d_Curve)::DownCast(c2d->Copy()); // c2dNew = Handle(Geom2d_Curve)::DownCast(c2dBSP->Copy()); - // Handle(Geom2d_BSplineCurve)::DownCast(c2dNew)->Segment(Max(first2d,par1),Min(par2,last2d)); + // Handle(Geom2d_BSplineCurve)::DownCast(c2dNew)->Segment(std::max(first2d,par1),Min(par2,last2d)); if (!c2d1.IsNull()) { // if(!c2dBSP1.IsNull()) { c2d1New = Handle(Geom2d_Curve)::DownCast(c2d1->Copy()); // c2d1New = Handle(Geom2d_Curve)::DownCast(c2dBSP1->Copy()); - // Handle(Geom2d_BSplineCurve)::DownCast(c2d1New)->Segment(Max(first2d1,par1),Min(par2,last2d1)); + // Handle(Geom2d_BSplineCurve)::DownCast(c2d1New)->Segment(std::max(first2d1,par1),Min(par2,last2d1)); } //} /*catch (Standard_Failure) { diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_Transform.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_Transform.cxx index d4d9aaf650..5b787fb9fb 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_Transform.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepBuilderAPI/BRepBuilderAPI_Transform.cxx @@ -46,7 +46,7 @@ void BRepBuilderAPI_Transform::Perform(const TopoDS_Shape& theShape, const Standard_Boolean theCopyMesh) { myUseModif = theCopyGeom || myTrsf.IsNegative() - || (Abs(Abs(myTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec()); + || (std::abs(std::abs(myTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec()); if (myUseModif) { Handle(BRepTools_TrsfModification) theModif = diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Analyzer.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Analyzer.cxx index e034c2ccc7..07f969dd34 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Analyzer.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Analyzer.cxx @@ -416,11 +416,11 @@ void BRepCheck_Analyzer::Perform() const Handle(OSD_ThreadPool)& aThreadPool = OSD_ThreadPool::DefaultPool(); const Standard_Integer aNbThreads = aThreadPool->NbThreads(); Standard_Integer aNbTasks = aNbThreads * 10; - Standard_Integer aTaskSize = (Standard_Integer)Ceiling((double)aMapSize / aNbTasks); + Standard_Integer aTaskSize = (Standard_Integer)std::ceil((double)aMapSize / aNbTasks); if (aTaskSize < aMinTaskSize) { aTaskSize = aMinTaskSize; - aNbTasks = (Standard_Integer)Ceiling((double)aMapSize / aTaskSize); + aNbTasks = (Standard_Integer)std::ceil((double)aMapSize / aTaskSize); } NCollection_Array1> aArrayOfArray(0, aNbTasks - 1); diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Edge.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Edge.cxx index 03bcaa011a..286c9a5ffe 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Edge.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Edge.cxx @@ -346,7 +346,7 @@ void BRepCheck_Edge::InContext(const TopoDS_Shape& S) } // gka OCC // Modified by skv - Tue Apr 27 11:50:35 2004 Begin - if (Abs(ff - First) > eps || Abs(ll - Last) > eps) + if (std::abs(ff - First) > eps || std::abs(ll - Last) > eps) { BRepCheck::Add(lst, BRepCheck_InvalidSameRangeFlag); BRepCheck::Add(lst, BRepCheck_InvalidSameParameterFlag); diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Face.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Face.cxx index 23f251018f..ee97af425f 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Face.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Face.cxx @@ -775,7 +775,7 @@ static Standard_Boolean IsInside(const TopoDS_Wire& theWire, aParameter = (aFirst + aLast) * 0.5; // Edge is skipped if its parametric range is too small - if (Abs(aParameter - aFirst) < Precision::PConfusion()) + if (std::abs(aParameter - aFirst) < Precision::PConfusion()) { continue; } @@ -880,8 +880,8 @@ Standard_Boolean CheckThin(const TopoDS_Shape& w, const TopoDS_Shape& f) if (pc1.IsNull() || pc2.IsNull()) return Standard_False; - Standard_Real d1 = Abs(l1 - f1) / 100.; - Standard_Real d2 = Abs(l2 - f2) / 100.; + Standard_Real d1 = std::abs(l1 - f1) / 100.; + Standard_Real d2 = std::abs(l2 - f2) / 100.; Standard_Real m1 = (l1 + f1) * 0.5; Standard_Real m2 = (l2 + f2) * 0.5; diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Vertex.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Vertex.cxx index 59dfa086bd..7388dd722c 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Vertex.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Vertex.cxx @@ -136,7 +136,7 @@ void BRepCheck_Vertex::InContext(const TopoDS_Shape& S) TopAbs_Orientation orv = VFind.Orientation(); Standard_Real Tol = BRep_Tool::Tolerance(TopoDS::Vertex(myShape)); - Tol = Max(Tol, BRep_Tool::Tolerance(E)); // to check + Tol = std::max(Tol, BRep_Tool::Tolerance(E)); // to check Tol *= Tol; Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*)&E.TShape()); @@ -247,7 +247,7 @@ void BRepCheck_Vertex::InContext(const TopoDS_Shape& S) TopLoc_Location L = (Floc * TFloc).Predivided(myShape.Location()); Standard_Real Tol = BRep_Tool::Tolerance(TopoDS::Vertex(myShape)); - Tol = Max(Tol, BRep_Tool::Tolerance(TopoDS::Face(S))); // to check + Tol = std::max(Tol, BRep_Tool::Tolerance(TopoDS::Face(S))); // to check Tol *= Tol; BRep_ListIteratorOfListOfPointRepresentation itpr(TV->Points()); diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Wire.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Wire.cxx index e3a4a895e3..5c6ab1ec2c 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Wire.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepCheck/BRepCheck_Wire.cxx @@ -451,8 +451,8 @@ static Standard_Boolean IsDistanceIn2DTolerance( { Standard_Real dumax = 0.01 * (aFaceSurface.LastUParameter() - aFaceSurface.FirstUParameter()); Standard_Real dvmax = 0.01 * (aFaceSurface.LastVParameter() - aFaceSurface.FirstVParameter()); - Standard_Real dumin = Abs(thePnt.X() - thePntRef.X()); - Standard_Real dvmin = Abs(thePnt.Y() - thePntRef.Y()); + Standard_Real dumin = std::abs(thePnt.X() - thePntRef.X()); + Standard_Real dvmin = std::abs(thePnt.Y() - thePntRef.Y()); if ((dumin < dumax) && (dvmin < dvmax)) return Standard_True; @@ -485,12 +485,12 @@ static Standard_Boolean IsDistanceIn2DTolerance( Standard_Real aMDU = aDU.Magnitude(); if (aMDU > Precision::Confusion()) { - dumax = Max((aTol3d / aMDU), dumax); + dumax = std::max((aTol3d / aMDU), dumax); } Standard_Real aMDV = aDV.Magnitude(); if (aMDV > Precision::Confusion()) { - dvmax = Max((aTol3d / aMDV), dvmax); + dvmax = std::max((aTol3d / aMDV), dvmax); } #ifdef OCCT_DEBUG @@ -502,7 +502,7 @@ static Standard_Boolean IsDistanceIn2DTolerance( } #endif - Standard_Real aTol2d = 2 * Max(dumax, dvmax); + Standard_Real aTol2d = 2 * std::max(dumax, dvmax); #ifdef OCCT_DEBUG if ((aTol2d <= 0.0) && (PrintWarnings)) @@ -513,7 +513,7 @@ static Standard_Boolean IsDistanceIn2DTolerance( } #endif - Standard_Real Dist = Max(dumin, dvmin); + Standard_Real Dist = std::max(dumin, dvmin); if (Dist < aTol2d) return Standard_True; @@ -689,13 +689,13 @@ BRepCheck_Status BRepCheck_Wire::Closed2d(const TopoDS_Face& theFace, const Stan // Modified by Sergey KHROMOV - Thu Jun 20 10:58:05 2002 End // check distance - // Standard_Real dfUDist=Abs(p.X()-p1.X()); - // Standard_Real dfVDist=Abs(p.Y()-p1.Y()); + // Standard_Real dfUDist=std::abs(p.X()-p1.X()); + // Standard_Real dfVDist=std::abs(p.Y()-p1.Y()); // if (dfUDist > aUResol || dfVDist > aVResol) // { Standard_Real aTol3d = - Max(BRep_Tool::Tolerance(aFirstVertex), BRep_Tool::Tolerance(aWireExp.CurrentVertex())); + std::max(BRep_Tool::Tolerance(aFirstVertex), BRep_Tool::Tolerance(aWireExp.CurrentVertex())); gp_Pnt aPntRef = BRep_Tool::Pnt(aFirstVertex); gp_Pnt aPnt = BRep_Tool::Pnt(aWireExp.CurrentVertex()); @@ -1424,9 +1424,10 @@ BRepCheck_Status BRepCheck_Wire::SelfIntersect(const TopoDS_Face& F, { Standard_Real newVParaOnEdge1 = BRep_Tool::Parameter(vtt, E1); Standard_Real newVParaOnEdge2 = BRep_Tool::Parameter(vtt, E2); - if (Abs(IP_ParamOnFirst - VParaOnEdge1) + Abs(IP_ParamOnSecond - VParaOnEdge2) - > Abs(IP_ParamOnFirst - newVParaOnEdge1) - + Abs(IP_ParamOnSecond - newVParaOnEdge2)) + if (std::abs(IP_ParamOnFirst - VParaOnEdge1) + + std::abs(IP_ParamOnSecond - VParaOnEdge2) + > std::abs(IP_ParamOnFirst - newVParaOnEdge1) + + std::abs(IP_ParamOnSecond - newVParaOnEdge2)) { VertexLePlusProche = p3dvtt; VParaOnEdge1 = newVParaOnEdge1; @@ -2064,7 +2065,7 @@ static Standard_Boolean IsClosed2dForPeriodicFace(const TopoDS_Face& theFace, Standard_Real aTol = BRep_Tool::Tolerance(theVertex); Standard_Real aUResol = aFaceSurface.UResolution(aTol); Standard_Real aVResol = aFaceSurface.VResolution(aTol); - Standard_Real aVicinity = Sqrt(aUResol * aUResol + aVResol * aVResol); + Standard_Real aVicinity = std::sqrt(aUResol * aUResol + aVResol * aVResol); Standard_Real aDistP1P2 = theP1.Distance(theP2); TopTools_ListIteratorOfListOfShape anIter(aSeamEdges); @@ -2095,7 +2096,7 @@ static Standard_Boolean IsClosed2dForPeriodicFace(const TopoDS_Face& theFace, continue; a2dTol = aPnt1.Distance(aPnt2) * 1.e-2; - a2dTol = Max(a2dTol, aVicinity); + a2dTol = std::max(a2dTol, aVicinity); if (aDistP1P2 > a2dTol) return Standard_False; diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepClass/BRepClass_FaceExplorer.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepClass/BRepClass_FaceExplorer.cxx index 2ec75d68af..d0219af3a6 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepClass/BRepClass_FaceExplorer.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepClass/BRepClass_FaceExplorer.cxx @@ -87,7 +87,7 @@ Standard_Boolean BRepClass_FaceExplorer::CheckPoint(gp_Pnt2d& thePoint) else { Standard_Real anEpsilon = Epsilon(aDistance); - if (anEpsilon > Max(myUMax - myUMin, myVMax - myVMin)) + if (anEpsilon > std::max(myUMax - myUMin, myVMax - myVMin)) { gp_Vec2d aLinVec(aCenterPnt, thePoint); gp_Dir2d aLinDir(aLinVec); @@ -179,11 +179,11 @@ Standard_Boolean BRepClass_FaceExplorer::OtherSegment(const gp_Pnt2d& P, Standard_Real aTanMod = aTanVec.SquareMagnitude(); if (aTanMod < aTolParConf2) continue; - aTanVec /= Sqrt(aTanMod); + aTanVec /= std::sqrt(aTanMod); Standard_Real aSinA = aTanVec.Crossed(aLinDir.XY()); const Standard_Real SmallAngle = 0.001; Standard_Boolean isSmallAngle = Standard_False; - if (Abs(aSinA) < SmallAngle) + if (std::abs(aSinA) < SmallAngle) { isSmallAngle = Standard_True; // The line from the input point P to the current point on edge @@ -252,7 +252,7 @@ Standard_Boolean BRepClass_FaceExplorer::OtherSegment(const gp_Pnt2d& P, myCurEdgePar = Probing_Start; } - Par = Sqrt(Par); + Par = std::sqrt(Par); return Standard_True; } } diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepClass/BRepClass_Intersector.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepClass/BRepClass_Intersector.cxx index 2c6eefb9f0..99e517472c 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepClass/BRepClass_Intersector.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepClass/BRepClass_Intersector.cxx @@ -106,14 +106,14 @@ Standard_Real MaxTol2DCurEdge(const TopoDS_Vertex& theV1, } Standard_Real aTol2D, anUr, aVr; - Standard_Real aTolV3D = Max(aTolV3D1, aTolV3D2); + Standard_Real aTolV3D = std::max(aTolV3D1, aTolV3D2); BRepAdaptor_Surface aS(theF, Standard_False); anUr = aS.UResolution(aTolV3D); aVr = aS.VResolution(aTolV3D); - aTol2D = Max(anUr, aVr); + aTol2D = std::max(anUr, aVr); // - aTol2D = Max(aTol2D, theTol); + aTol2D = std::max(aTol2D, theTol); return aTol2D; } @@ -165,7 +165,7 @@ Standard_Boolean CheckOn(IntRes2d_IntersectionPoint& thePntInter, if (aMinInd != 0) { - aMinDist = Sqrt(aMinDist); + aMinDist = std::sqrt(aMinDist); } if (aMinDist <= theTolZ) { @@ -178,11 +178,11 @@ Standard_Boolean CheckOn(IntRes2d_IntersectionPoint& thePntInter, { IntRes2d_Transition aTrOnLin(IntRes2d_Head); IntRes2d_Position aPosOnCurve = IntRes2d_Middle; - if ((Abs(aPar - theDeb) <= Precision::Confusion()) || (aPar < theDeb)) + if ((std::abs(aPar - theDeb) <= Precision::Confusion()) || (aPar < theDeb)) { aPosOnCurve = IntRes2d_Head; } - else if ((Abs(aPar - theFin) <= Precision::Confusion()) || (aPar > theFin)) + else if ((std::abs(aPar - theFin) <= Precision::Confusion()) || (aPar > theFin)) { aPosOnCurve = IntRes2d_End; } diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepClass3d/BRepClass3d_SClassifier.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepClass3d/BRepClass3d_SClassifier.cxx index df6d0aa1e1..73a9c394af 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepClass3d/BRepClass3d_SClassifier.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepClass3d/BRepClass3d_SClassifier.cxx @@ -305,7 +305,7 @@ void BRepClass3d_SClassifier::Perform(BRepClass3d_SolidExplorer& SolidExplorer, aSelectorLine.GetVertParam(i, V, LP); LVInts.Add(V); - if (Abs(LP) < Abs(NearFaultPar)) + if (std::abs(LP) < std::abs(NearFaultPar)) NearFaultPar = LP; } @@ -330,12 +330,12 @@ void BRepClass3d_SClassifier::Perform(BRepClass3d_SolidExplorer& SolidExplorer, IntCurveSurface_TransitionOnCurve tran = IntCurveSurface_Tangent; Standard_Integer Tst = GetTransi(f1, f2, EE, param, L, tran); - if (Tst == 1 && Abs(Lpar) < Abs(parmin)) + if (Tst == 1 && std::abs(Lpar) < std::abs(parmin)) { parmin = Lpar; Trans(parmin, tran, myState); } - else if (Abs(Lpar) < Abs(NearFaultPar)) + else if (std::abs(Lpar) < std::abs(NearFaultPar)) NearFaultPar = Lpar; } } @@ -357,7 +357,7 @@ void BRepClass3d_SClassifier::Perform(BRepClass3d_SolidExplorer& SolidExplorer, // Prolong segment, since there are cases when // the intersector does not find intersection points with the original // segment due to rough triangulation of a parameterized surface. - Standard_Real addW = Max(10 * Tol, 0.01 * Par); + Standard_Real addW = std::max(10 * Tol, 0.01 * Par); Standard_Real AddW = addW; Bnd_Box aBoxF = Intersector3d.Bounding(); @@ -369,11 +369,11 @@ void BRepClass3d_SClassifier::Perform(BRepClass3d_SolidExplorer& SolidExplorer, aBoxF.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); Standard_Real boxaddW = GetAddToParam(L, Par, aBoxF); - addW = Max(addW, boxaddW); + addW = std::max(addW, boxaddW); } Standard_Real minW = -AddW; - Standard_Real maxW = Min(Par * 10, Par + addW); + Standard_Real maxW = std::min(Par * 10, Par + addW); Intersector3d.Perform(L, minW, maxW); if (Intersector3d.IsDone()) { @@ -419,11 +419,12 @@ void BRepClass3d_SClassifier::Perform(BRepClass3d_SolidExplorer& SolidExplorer, } for (Standard_Integer i = 1; i <= Intersector3d.NbPnt(); i++) { - if (Abs(Intersector3d.WParameter(i)) < Abs(parmin) - Precision::PConfusion()) + if (std::abs(Intersector3d.WParameter(i)) + < std::abs(parmin) - Precision::PConfusion()) { parmin = Intersector3d.WParameter(i); TopAbs_State aState = Intersector3d.State(i); - if (Abs(parmin) <= Tol) + if (std::abs(parmin) <= Tol) { myState = 2; myFace = f; @@ -479,7 +480,8 @@ void BRepClass3d_SClassifier::Perform(BRepClass3d_SolidExplorer& SolidExplorer, myState = 1; } //-- Exploration of the shells - if (NearFaultPar != RealLast() && Abs(parmin) >= Abs(NearFaultPar) - Precision::PConfusion()) + if (NearFaultPar != RealLast() + && std::abs(parmin) >= std::abs(NearFaultPar) - Precision::PConfusion()) { isFaultyLine = Standard_True; } @@ -629,7 +631,8 @@ static Standard_Integer GetTransi(const TopoDS_Face& f1, const gp_Dir& LDir = L.Direction(); - if (Abs(LDir.Dot(nf1)) < Precision::Angular() || Abs(LDir.Dot(nf2)) < Precision::Angular()) + if (std::abs(LDir.Dot(nf1)) < Precision::Angular() + || std::abs(LDir.Dot(nf2)) < Precision::Angular()) { // line is orthogonal to normal(s) // trans = IntCurveSurface_Tangent; @@ -639,7 +642,7 @@ static Standard_Integer GetTransi(const TopoDS_Face& f1, if (nf1.IsParallel(nf2, Precision::Angular())) { Standard_Real angD = nf1.Dot(LDir); - if (Abs(angD) < Precision::Angular()) + if (std::abs(angD) < Precision::Angular()) return -1; else if (angD > 0) trans = IntCurveSurface_Out; diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepClass3d/BRepClass3d_SolidExplorer.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepClass3d/BRepClass3d_SolidExplorer.cxx index 0d28be5647..b6bb18ba1e 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepClass3d/BRepClass3d_SolidExplorer.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepClass3d/BRepClass3d_SolidExplorer.cxx @@ -544,9 +544,9 @@ Standard_Integer BRepClass3d_SolidExplorer::OtherSegment(const gp_Pnt& P, // // avoid process faces from uncorrected shells constexpr Standard_Real eps = Precision::PConfusion(); - Standard_Real epsU = Max(eps * Max(Abs(U2), Abs(U1)), eps); - Standard_Real epsV = Max(eps * Max(Abs(V2), Abs(V1)), eps); - if (Abs(U2 - U1) < epsU || Abs(V2 - V1) < epsV) + Standard_Real epsU = std::max(eps * std::max(std::abs(U2), std::abs(U1)), eps); + Standard_Real epsV = std::max(eps * std::max(std::abs(V2), std::abs(V1)), eps); + if (std::abs(U2 - U1) < epsU || std::abs(V2 - V1) < epsV) { return 2; } @@ -661,7 +661,7 @@ Standard_Integer BRepClass3d_SolidExplorer::OtherSegment(const gp_Pnt& P, Standard_Real tt = Norm.Magnitude(); if (tt > gp::Resolution()) { - tt = Abs(Norm.Dot(V)) / (tt * Par); + tt = std::abs(Norm.Dot(V)) / (tt * Par); if (tt > maxscal) { maxscal = tt; diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepClass3d/BRepClass3d_SolidPassiveClassifier.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepClass3d/BRepClass3d_SolidPassiveClassifier.cxx index 450556642e..110759ffda 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepClass3d/BRepClass3d_SolidPassiveClassifier.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepClass3d/BRepClass3d_SolidPassiveClassifier.cxx @@ -62,7 +62,7 @@ void BRepClass3d_SolidPassiveClassifier::Compare(const TopoDS_Face& Face, const { myParam = myIntersector.WParameter(); myFace = myIntersector.Face(); - if (Abs(myParam) <= myTolerance) + if (std::abs(myParam) <= myTolerance) { //-- ######################################### #ifdef OCCT_DEBUG diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_DistShapeShape.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_DistShapeShape.cxx index d9a678b0bd..9091abd3bb 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_DistShapeShape.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_DistShapeShape.cxx @@ -201,7 +201,7 @@ struct VertexFunctor Solution.Dist[theIndex] = aDist; } - else if (Abs(aDist - Solution.Dist[theIndex]) < Eps) + else if (std::abs(aDist - Solution.Dist[theIndex]) < Eps) { const BRepExtrema_SolutionElem Sol1(aDist, aPoint1, BRepExtrema_IsVertex, aVertex1); const BRepExtrema_SolutionElem Sol2(aDist, aPoint2, BRepExtrema_IsVertex, aVertex2); @@ -240,11 +240,11 @@ Standard_Boolean BRepExtrema_DistShapeShape::DistanceVertVert( const Handle(OSD_ThreadPool)& aThreadPool = OSD_ThreadPool::DefaultPool(); const Standard_Integer aNbThreads = aThreadPool->NbThreads(); Standard_Integer aNbTasks = aNbThreads; - Standard_Integer aTaskSize = (Standard_Integer)Ceiling((double)aCount1 / aNbTasks); + Standard_Integer aTaskSize = (Standard_Integer)std::ceil((double)aCount1 / aNbTasks); if (aTaskSize < aMinTaskSize) { aTaskSize = aMinTaskSize; - aNbTasks = (Standard_Integer)Ceiling((double)aCount1 / aTaskSize); + aNbTasks = (Standard_Integer)std::ceil((double)aCount1 / aTaskSize); } Standard_Integer aFirstIndex(1); @@ -283,7 +283,7 @@ Standard_Boolean BRepExtrema_DistShapeShape::DistanceVertVert( mySolutionsShape2.Append(aFunctor.Solution.Shape2[anI]); myDistRef = aDist; } - else if (Abs(aDist - myDistRef) < myEps) + else if (std::abs(aDist - myDistRef) < myEps) { mySolutionsShape1.Append(aFunctor.Solution.Shape1[anI]); mySolutionsShape2.Append(aFunctor.Solution.Shape2[anI]); @@ -358,7 +358,7 @@ struct DistanceFunctor Solution.Dist[theIndex] = aDistTool.DistValue(); } - else if (Abs(aDist - Solution.Dist[theIndex]) < Eps) + else if (std::abs(aDist - Solution.Dist[theIndex]) < Eps) { BRepExtrema_SeqOfSolution aSeq1 = aDistTool.Seq1Value(); BRepExtrema_SeqOfSolution aSeq2 = aDistTool.Seq2Value(); @@ -483,11 +483,11 @@ Standard_Boolean BRepExtrema_DistShapeShape::DistanceMapMap( const Standard_Integer aNbThreads = aThreadPool->NbThreads(); const Standard_Integer aMinPairTaskSize = aCount1 < 10 ? aCount1 : 10; Standard_Integer aNbPairTasks = aNbThreads; - Standard_Integer aPairTaskSize = (Standard_Integer)Ceiling((double)aCount1 / aNbPairTasks); + Standard_Integer aPairTaskSize = (Standard_Integer)std::ceil((double)aCount1 / aNbPairTasks); if (aPairTaskSize < aMinPairTaskSize) { aPairTaskSize = aMinPairTaskSize; - aNbPairTasks = (Standard_Integer)Ceiling((double)aCount1 / aPairTaskSize); + aNbPairTasks = (Standard_Integer)std::ceil((double)aCount1 / aPairTaskSize); } Standard_Integer aFirstIndex(1); @@ -535,7 +535,7 @@ Standard_Boolean BRepExtrema_DistShapeShape::DistanceMapMap( const Standard_Integer aMapSize = aPairList.Size(); Standard_Integer aNbTasks = aMapSize < aNbThreads ? aMapSize : aNbThreads; - Standard_Integer aTaskSize = (Standard_Integer)Ceiling((double)aMapSize / aNbTasks); + Standard_Integer aTaskSize = (Standard_Integer)std::ceil((double)aMapSize / aNbTasks); NCollection_Array1> anArrayOfArray(0, aNbTasks - 1); // Since aPairList is sorted in ascending order of distances between Bnd_Boxes, @@ -594,7 +594,7 @@ Standard_Boolean BRepExtrema_DistShapeShape::DistanceMapMap( mySolutionsShape2.Append(aFunctor.Solution.Shape2[anI]); myDistRef = aDist; } - else if (Abs(aDist - myDistRef) < myEps) + else if (std::abs(aDist - myDistRef) < myEps) { mySolutionsShape1.Append(aFunctor.Solution.Shape1[anI]); mySolutionsShape2.Append(aFunctor.Solution.Shape2[anI]); @@ -767,11 +767,11 @@ Standard_Boolean BRepExtrema_DistShapeShape::SolidTreatment( const Handle(OSD_ThreadPool)& aThreadPool = OSD_ThreadPool::DefaultPool(); const Standard_Integer aNbThreads = aThreadPool->NbThreads(); Standard_Integer aNbTasks = aNbThreads * 10; - Standard_Integer aTaskSize = (Standard_Integer)Ceiling((double)aMapSize / aNbTasks); + Standard_Integer aTaskSize = (Standard_Integer)std::ceil((double)aMapSize / aNbTasks); if (aTaskSize < aMinTaskSize) { aTaskSize = aMinTaskSize; - aNbTasks = (Standard_Integer)Ceiling((double)aMapSize / aTaskSize); + aNbTasks = (Standard_Integer)std::ceil((double)aMapSize / aTaskSize); } NCollection_Array1> anArrayOfArray(0, aNbTasks - 1); @@ -948,7 +948,7 @@ Standard_Boolean BRepExtrema_DistShapeShape::Perform(const Message_ProgressRange return Standard_False; } - if (Abs(myDistRef) > myEps) + if (std::abs(myDistRef) > myEps) { if (!DistanceMapMap(myMapF1, myMapF2, myBF1, myBF2, aRootScope.Next())) { diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_DistanceSS.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_DistanceSS.cxx index 6c159dee27..15bc435f6b 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_DistanceSS.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_DistanceSS.cxx @@ -556,7 +556,7 @@ static Standard_Boolean isOnBoundary(const TopoDS_Edge& theEdge, { const TopoDS_Vertex& aV = TopoDS::Vertex(it.Value()); Standard_Real aVParam = BRep_Tool::Parameter(aV, theEdge); - if (Abs(aVParam - theParam) < thePTol + if (std::abs(aVParam - theParam) < thePTol && BRep_Tool::Pnt(aV).Distance(theSol) < BRep_Tool::Tolerance(aV)) { return Standard_True; diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ExtCC.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ExtCC.cxx index 4af79aae0a..d0a2288758 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ExtCC.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ExtCC.cxx @@ -37,8 +37,8 @@ void BRepExtrema_ExtCC::Initialize(const TopoDS_Edge& E2) Standard_Real V1, V2; BRepAdaptor_Curve Curv(E2); myHC = new BRepAdaptor_Curve(Curv); - Standard_Real Tol = Min(BRep_Tool::Tolerance(E2), Precision::Confusion()); - Tol = Max(Curv.Resolution(Tol), Precision::PConfusion()); + Standard_Real Tol = std::min(BRep_Tool::Tolerance(E2), Precision::Confusion()); + Tol = std::max(Curv.Resolution(Tol), Precision::PConfusion()); BRep_Tool::Range(E2, V1, V2); myExtCC.SetCurve(2, *myHC, V1, V2); myExtCC.SetTolerance(2, Tol); @@ -53,8 +53,8 @@ void BRepExtrema_ExtCC::Perform(const TopoDS_Edge& E1) Standard_Real U1, U2; BRepAdaptor_Curve Curv(E1); Handle(BRepAdaptor_Curve) HC = new BRepAdaptor_Curve(Curv); - Standard_Real Tol = Min(BRep_Tool::Tolerance(E1), Precision::Confusion()); - Tol = Max(Curv.Resolution(Tol), Precision::PConfusion()); + Standard_Real Tol = std::min(BRep_Tool::Tolerance(E1), Precision::Confusion()); + Tol = std::max(Curv.Resolution(Tol), Precision::PConfusion()); BRep_Tool::Range(E1, U1, U2); myExtCC.SetCurve(1, *HC, U1, U2); myExtCC.SetTolerance(1, Tol); diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ExtCF.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ExtCF.cxx index 2c9a04f37b..ce1b6ccbf4 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ExtCF.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ExtCF.cxx @@ -42,13 +42,13 @@ void BRepExtrema_ExtCF::Initialize(const TopoDS_Edge& E, const TopoDS_Face& F) myHS = new BRepAdaptor_Surface(Surf); Standard_Real aTolC, aTolS; // - aTolS = Min(BRep_Tool::Tolerance(F), Precision::Confusion()); - aTolS = Min(Surf.UResolution(aTolS), Surf.VResolution(aTolS)); - aTolS = Max(aTolS, Precision::PConfusion()); + aTolS = std::min(BRep_Tool::Tolerance(F), Precision::Confusion()); + aTolS = std::min(Surf.UResolution(aTolS), Surf.VResolution(aTolS)); + aTolS = std::max(aTolS, Precision::PConfusion()); // - aTolC = Min(BRep_Tool::Tolerance(E), Precision::Confusion()); + aTolC = std::min(BRep_Tool::Tolerance(E), Precision::Confusion()); aTolC = aC.Resolution(aTolC); - aTolC = Max(aTolC, Precision::PConfusion()); + aTolC = std::max(aTolC, Precision::PConfusion()); // Standard_Real U1, U2, V1, V2; BRepTools::UVBounds(F, U1, U2, V1, V2); diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ExtFF.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ExtFF.cxx index dfda2e1bd5..b875f289ad 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ExtFF.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ExtFF.cxx @@ -43,9 +43,9 @@ void BRepExtrema_ExtFF::Initialize(const TopoDS_Face& F2) return; // protect against non-geometric type (e.g. triangulation) myHS = new BRepAdaptor_Surface(Surf); - Standard_Real Tol = Min(BRep_Tool::Tolerance(F2), Precision::Confusion()); - Tol = Min(Surf.UResolution(Tol), Surf.VResolution(Tol)); - Tol = Max(Tol, Precision::PConfusion()); + Standard_Real Tol = std::min(BRep_Tool::Tolerance(F2), Precision::Confusion()); + Tol = std::min(Surf.UResolution(Tol), Surf.VResolution(Tol)); + Tol = std::max(Tol, Precision::PConfusion()); Standard_Real U1, U2, V1, V2; BRepTools::UVBounds(F2, U1, U2, V1, V2); myExtSS.Initialize(*myHS, U1, U2, V1, V2, Tol); @@ -64,9 +64,9 @@ void BRepExtrema_ExtFF::Perform(const TopoDS_Face& F1, const TopoDS_Face& F2) return; // protect against non-geometric type (e.g. triangulation) Handle(BRepAdaptor_Surface) HS1 = new BRepAdaptor_Surface(Surf1); - Standard_Real Tol1 = Min(BRep_Tool::Tolerance(F1), Precision::Confusion()); - Tol1 = Min(Surf1.UResolution(Tol1), Surf1.VResolution(Tol1)); - Tol1 = Max(Tol1, Precision::PConfusion()); + Standard_Real Tol1 = std::min(BRep_Tool::Tolerance(F1), Precision::Confusion()); + Tol1 = std::min(Surf1.UResolution(Tol1), Surf1.VResolution(Tol1)); + Tol1 = std::max(Tol1, Precision::PConfusion()); Standard_Real U1, U2, V1, V2; BRepTools::UVBounds(F1, U1, U2, V1, V2); myExtSS.Perform(*HS1, U1, U2, V1, V2, Tol1); diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ExtPC.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ExtPC.cxx index 631fcea947..f9a5d8e4bc 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ExtPC.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ExtPC.cxx @@ -35,8 +35,8 @@ void BRepExtrema_ExtPC::Initialize(const TopoDS_Edge& E) return; // protect against non-geometric type (e.g. polygon) Standard_Real U1, U2; myHC = new BRepAdaptor_Curve(E); - Standard_Real Tol = Min(BRep_Tool::Tolerance(E), Precision::Confusion()); - Tol = Max(myHC->Resolution(Tol), Precision::PConfusion()); + Standard_Real Tol = std::min(BRep_Tool::Tolerance(E), Precision::Confusion()); + Tol = std::max(myHC->Resolution(Tol), Precision::PConfusion()); BRep_Tool::Range(E, U1, U2); myExtPC.Initialize(*myHC, U1, U2, Tol); } diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ExtPF.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ExtPF.cxx index 80fce2bfe2..ba77555394 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ExtPF.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ExtPF.cxx @@ -50,10 +50,10 @@ void BRepExtrema_ExtPF::Initialize(const TopoDS_Face& TheFace, if (mySurf.GetType() == GeomAbs_OtherSurface) return; // protect against non-geometric type (e.g. triangulation) - Standard_Real Tol = Min(BRep_Tool::Tolerance(TheFace), Precision::Confusion()); + Standard_Real Tol = std::min(BRep_Tool::Tolerance(TheFace), Precision::Confusion()); Standard_Real aTolU, aTolV; - aTolU = Max(mySurf.UResolution(Tol), Precision::PConfusion()); - aTolV = Max(mySurf.VResolution(Tol), Precision::PConfusion()); + aTolU = std::max(mySurf.UResolution(Tol), Precision::PConfusion()); + aTolV = std::max(mySurf.VResolution(Tol), Precision::PConfusion()); Standard_Real U1, U2, V1, V2; BRepTools::UVBounds(TheFace, U1, U2, V1, V2); myExtPS.SetFlag(TheFlag); diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_OverlapTool.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_OverlapTool.cxx index 62a867b0c2..8f88b6ba71 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_OverlapTool.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_OverlapTool.cxx @@ -105,9 +105,9 @@ public: EdgeNormals[1] = BVH_Vec3d::Cross(Edges[1], Normal); EdgeNormals[2] = BVH_Vec3d::Cross(Edges[2], Normal); - EdgeNormals[0] *= 1.0 / Max(EdgeNormals[0].Modulus(), Precision::Confusion()); - EdgeNormals[1] *= 1.0 / Max(EdgeNormals[1].Modulus(), Precision::Confusion()); - EdgeNormals[2] *= 1.0 / Max(EdgeNormals[2].Modulus(), Precision::Confusion()); + EdgeNormals[0] *= 1.0 / std::max(EdgeNormals[0].Modulus(), Precision::Confusion()); + EdgeNormals[1] *= 1.0 / std::max(EdgeNormals[1].Modulus(), Precision::Confusion()); + EdgeNormals[2] *= 1.0 / std::max(EdgeNormals[2].Modulus(), Precision::Confusion()); const BVH_Vec3d aDirect01 = EdgeNormals[0] - EdgeNormals[1]; const BVH_Vec3d aDirect02 = EdgeNormals[0] + EdgeNormals[2]; @@ -121,7 +121,7 @@ public: theVertex2 + aDirect12 * (theDeflect / aDirect12.Dot(EdgeNormals[2])); const BVH_Vec3d aNormOffset = - Normal * (theDeflect / Max(Normal.Modulus(), Precision::Confusion())); + Normal * (theDeflect / std::max(Normal.Modulus(), Precision::Confusion())); for (Standard_Integer aVertIdx = 0; aVertIdx < 3; ++aVertIdx) { @@ -146,13 +146,13 @@ public: { const Standard_Real aProj1 = Vertices[aVertIdx].Dot(theAxis); - aMin1 = Min(aMin1, aProj1); - aMax1 = Max(aMax1, aProj1); + aMin1 = std::min(aMin1, aProj1); + aMax1 = std::max(aMax1, aProj1); const Standard_Real aProj2 = thePrism.Vertices[aVertIdx].Dot(theAxis); - aMin2 = Min(aMin2, aProj2); - aMax2 = Max(aMax2, aProj2); + aMin2 = std::min(aMin2, aProj2); + aMax2 = std::max(aMax2, aProj2); if (aMin1 <= aMax2 && aMax1 >= aMin2) { @@ -214,12 +214,12 @@ Standard_Boolean segmentsIntersected(const BVH_Vec2d& theOriginSeg0, const Standard_Real aEdge0Time1 = aEdge0Time0 + theDirectSeg0.Dot(aDirect); const Standard_Real aEdge1Time1 = aEdge1Time0 + theDirectSeg1.Dot(aDirect); - const Standard_Real aEdge0Min = Min(aEdge0Time0, aEdge0Time1); - const Standard_Real aEdge1Min = Min(aEdge1Time0, aEdge1Time1); - const Standard_Real aEdge0Max = Max(aEdge0Time0, aEdge0Time1); - const Standard_Real aEdge1Max = Max(aEdge1Time0, aEdge1Time1); + const Standard_Real aEdge0Min = std::min(aEdge0Time0, aEdge0Time1); + const Standard_Real aEdge1Min = std::min(aEdge1Time0, aEdge1Time1); + const Standard_Real aEdge0Max = std::max(aEdge0Time0, aEdge0Time1); + const Standard_Real aEdge1Max = std::max(aEdge1Time0, aEdge1Time1); - if (Max(aEdge0Min, aEdge1Min) > Min(aEdge0Max, aEdge1Max)) + if (std::max(aEdge0Min, aEdge1Min) > std::min(aEdge0Max, aEdge1Max)) { return Standard_False; } @@ -312,8 +312,8 @@ Standard_Boolean trianglesIntersected(const BVH_Vec3d& theTrng0Vert0, + (aProjTrng0Vert1 - aProjTrng0Vert2) * aDistTrng0Vert2 / (aDistTrng0Vert2 - aDistTrng0Vert1); - const Standard_Real aTimeMin1 = Min(aTime1, aTime2); - const Standard_Real aTimeMax1 = Max(aTime1, aTime2); + const Standard_Real aTimeMin1 = std::min(aTime1, aTime2); + const Standard_Real aTimeMax1 = std::max(aTime1, aTime2); Standard_Real aProjTrng1Vert0 = theTrng1Vert0.Dot(aCrossLine); Standard_Real aProjTrng1Vert1 = theTrng1Vert1.Dot(aCrossLine); @@ -341,11 +341,11 @@ Standard_Boolean trianglesIntersected(const BVH_Vec3d& theTrng0Vert0, + (aProjTrng1Vert1 - aProjTrng1Vert2) * aDistTrng1Vert2 / (aDistTrng1Vert2 - aDistTrng1Vert1); - const Standard_Real aTimeMin2 = Min(aTime1, aTime2); - const Standard_Real aTimeMax2 = Max(aTime1, aTime2); + const Standard_Real aTimeMin2 = std::min(aTime1, aTime2); + const Standard_Real aTimeMax2 = std::max(aTime1, aTime2); - aTime1 = Max(aTimeMin1, aTimeMin2); - aTime2 = Min(aTimeMax1, aTimeMax2); + aTime1 = std::max(aTimeMin1, aTimeMin2); + aTime2 = std::min(aTimeMax1, aTimeMax2); return aTime1 <= aTime2; // intervals intersected --> triangles overlapped } diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityDistTool.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityDistTool.cxx index a43140c7ca..49b451e793 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityDistTool.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityDistTool.cxx @@ -103,7 +103,7 @@ void BRepExtrema_ProximityDistTool::goThroughtSet1(const BVH_Array3d& theVer const Standard_Boolean theIsAdditionalSet) { Standard_Integer aVtxSize = (Standard_Integer)theVertices1.size(); - Standard_Integer aVtxStep = Max(myNbSamples1 <= 0 ? 1 : aVtxSize / myNbSamples1, 1); + Standard_Integer aVtxStep = std::max(myNbSamples1 <= 0 ? 1 : aVtxSize / myNbSamples1, 1); for (Standard_Integer aVtxIdx = 0; aVtxIdx < aVtxSize; aVtxIdx += aVtxStep) { myDistance = std::numeric_limits::max(); diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityValueTool.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityValueTool.cxx index c9ec0e2bb9..3476265207 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityValueTool.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepExtrema/BRepExtrema_ProximityValueTool.cxx @@ -250,7 +250,7 @@ Standard_Boolean BRepExtrema_ProximityValueTool::getEdgeAdditionalVertices( Standard_Real aLen = GCPnts_AbscissaPoint::Length(aBAC); Standard_Integer aNbSamplePoints = (Standard_Integer)(aLen / theStep) + 1; - GCPnts_QuasiUniformAbscissa aGCPnts(aBAC, Max(3, aNbSamplePoints)); + GCPnts_QuasiUniformAbscissa aGCPnts(aBAC, std::max(3, aNbSamplePoints)); if (!aGCPnts.IsDone()) return Standard_False; @@ -352,8 +352,8 @@ static Standard_Real getModelRange(const TopLoc_Location& theLocation Standard_Real aXm = 0.0, aYm = 0.0, aZm = 0.0, aXM = 0.0, aYM = 0.0, aZM = 0.0; aBox.Get(aXm, aYm, aZm, aXM, aYM, aZM); Standard_Real aRange = aXM - aXm; - aRange = Max(aRange, aYM - aYm); - aRange = Max(aRange, aZM - aZm); + aRange = std::max(aRange, aYM - aYm); + aRange = std::max(aRange, aZM - aZm); return aRange; } @@ -423,7 +423,7 @@ Standard_Boolean BRepExtrema_ProximityValueTool::getFaceAdditionalVertices( return Standard_False; } - myCells.Reset(Max(aTol, getModelRange(aLocation, aTr) / IntegerLast())); + myCells.Reset(std::max(aTol, getModelRange(aLocation, aTr) / IntegerLast())); for (Standard_Integer aTriIdx = 1; aTriIdx <= aTr->NbTriangles(); ++aTriIdx) { diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp.hxx b/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp.hxx index 28b78d3475..abe007e128 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp.hxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp.hxx @@ -140,7 +140,7 @@ public: //! The surface properties of all the faces in are computed. //! Adaptive 2D Gauss integration is used. //! Parameter Eps sets maximal relative error of computed mass (area) for each face. - //! Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values + //! Error is calculated as std::abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values //! for two successive steps of adaptive integration. //! Method returns estimation of relative error reached for whole shape. //! WARNING: if Eps > 0.001 algorithm performs non-adaptive integration. @@ -207,7 +207,7 @@ public: //! If OnlyClosed is True then computed faces must belong to closed Shells. //! Adaptive 2D Gauss integration is used. //! Parameter Eps sets maximal relative error of computed mass (volume) for each face. - //! Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values + //! Error is calculated as std::abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values //! for two successive steps of adaptive integration. //! Method returns estimation of relative error reached for whole shape. //! WARNING: if Eps > 0.001 algorithm performs non-adaptive integration. diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_Cinert.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_Cinert.cxx index be8aaccb6f..b34d86a9a7 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_Cinert.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_Cinert.cxx @@ -34,7 +34,8 @@ void BRepGProp_Cinert::Perform(const BRepAdaptor_Curve& C) Standard_Real Lower = BRepGProp_EdgeTool::FirstParameter(C); Standard_Real Upper = BRepGProp_EdgeTool::LastParameter(C); - Standard_Integer Order = Min(BRepGProp_EdgeTool::IntegrationOrder(C), math::GaussPointsMax()); + Standard_Integer Order = + std::min(BRepGProp_EdgeTool::IntegrationOrder(C), math::GaussPointsMax()); gp_Pnt P; // value on the curve gp_Vec V1; // first derivative on the curve @@ -64,15 +65,15 @@ void BRepGProp_Cinert::Perform(const BRepAdaptor_Curve& C) nbIntervals = 1; } Standard_Integer nIndex = 0; - Standard_Real UU1 = Min(Lower, Upper); - Standard_Real UU2 = Max(Lower, Upper); + Standard_Real UU1 = std::min(Lower, Upper); + Standard_Real UU2 = std::max(Lower, Upper); for (nIndex = 1; nIndex <= nbIntervals; nIndex++) { if (bHasIntervals) { - Lower = Max(TI(nIndex), UU1); - Upper = Min(TI(nIndex + 1), UU2); + Lower = std::max(TI(nIndex), UU1); + Upper = std::min(TI(nIndex + 1), UU2); } else { @@ -145,7 +146,7 @@ void BRepGProp_Cinert::Perform(const BRepAdaptor_Curve& C) inertia = gp_Mat(gp_XYZ(Ixx, -Ixy, -Ixz), gp_XYZ(-Ixy, Iyy, -Iyz), gp_XYZ(-Ixz, -Iyz, Izz)); - if (Abs(dim) < gp::Resolution()) + if (std::abs(dim) < gp::Resolution()) g = P; else g.SetCoord(Ix / dim, Iy / dim, Iz / dim); diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_Face.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_Face.cxx index 5a2f6a1d12..94b69646f3 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_Face.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_Face.cxx @@ -49,7 +49,7 @@ Standard_Integer BRepGProp_Face::UIntegrationOrder() const case GeomAbs_BezierSurface: { Nu = (*((Handle(Geom_BezierSurface)*)&((mySurface.Surface()).Surface())))->UDegree() + 1; - Nu = Max(4, Nu); + Nu = std::max(4, Nu); } break; case GeomAbs_BSplineSurface: { @@ -57,7 +57,7 @@ Standard_Integer BRepGProp_Face::UIntegrationOrder() const (*((Handle(Geom_BSplineSurface)*)&((mySurface.Surface()).Surface())))->UDegree() + 1; Standard_Integer b = (*((Handle(Geom_BSplineSurface)*)&((mySurface.Surface()).Surface())))->NbUKnots() - 1; - Nu = Max(4, a * b); + Nu = std::max(4, a * b); } break; @@ -65,7 +65,7 @@ Standard_Integer BRepGProp_Face::UIntegrationOrder() const Nu = 9; break; } - return Max(8, 2 * Nu); + return std::max(8, 2 * Nu); } //================================================================================================= @@ -82,7 +82,7 @@ Standard_Integer BRepGProp_Face::VIntegrationOrder() const case GeomAbs_BezierSurface: { Nv = (*((Handle(Geom_BezierSurface)*)&((mySurface.Surface()).Surface())))->VDegree() + 1; - Nv = Max(4, Nv); + Nv = std::max(4, Nv); } break; @@ -91,7 +91,7 @@ Standard_Integer BRepGProp_Face::VIntegrationOrder() const (*((Handle(Geom_BSplineSurface)*)&((mySurface.Surface()).Surface())))->VDegree() + 1; Standard_Integer b = (*((Handle(Geom_BSplineSurface)*)&((mySurface.Surface()).Surface())))->NbVKnots() - 1; - Nv = Max(4, a * b); + Nv = std::max(4, a * b); } break; @@ -99,7 +99,7 @@ Standard_Integer BRepGProp_Face::VIntegrationOrder() const Nv = 9; break; } - return Max(8, 2 * Nv); + return std::max(8, 2 * Nv); } //================================================================================================= @@ -142,7 +142,7 @@ Standard_Integer BRepGProp_Face::IntegrationOrder() const break; } - return Max(4, 2 * N); + return std::max(4, 2 * N); } //================================================================================================= @@ -210,12 +210,12 @@ static Standard_Real AS = -0.15, AL = -0.50, B = 1.0, C = 0.75, D = 0.25; static inline Standard_Real SCoeff(const Standard_Real Eps) { - return Eps < 0.1 ? AS * (B + Log10(Eps)) + C : C; + return Eps < 0.1 ? AS * (B + std::log10(Eps)) + C : C; } static inline Standard_Real LCoeff(const Standard_Real Eps) { - return Eps < 0.1 ? AL * (B + Log10(Eps)) + D : D; + return Eps < 0.1 ? AL * (B + std::log10(Eps)) + D : D; } //================================================================================================= @@ -258,7 +258,8 @@ Standard_Integer BRepGProp_Face::SIntOrder(const Standard_Real Eps) const Nv = 2; break; } - return Min(RealToInt(Ceiling(SCoeff(Eps) * Max((Nu + 1), (Nv + 1)))), math::GaussPointsMax()); + return std::min(RealToInt(std::ceil(SCoeff(Eps) * std::max((Nu + 1), (Nv + 1)))), + math::GaussPointsMax()); } //================================================================================================= @@ -406,14 +407,13 @@ Standard_Integer BRepGProp_Face::LIntOrder(const Standard_Real Eps) const Standard_Real aVmax = mySurface.LastVParameter(); Standard_Real dv = (aVmax - aVmin); - Standard_Real anR = (dv > Epsilon1 ? Min((aYmax - aYmin) / dv, 1.) : 1.); + Standard_Real anR = (dv > Epsilon1 ? std::min((aYmax - aYmin) / dv, 1.) : 1.); - // Standard_Integer anRInt = Max(RealToInt(Ceiling(SVIntSubs()*anR)), 2); - Standard_Integer anRInt = RealToInt(Ceiling(SVIntSubs() * anR)); + Standard_Integer anRInt = RealToInt(std::ceil(SVIntSubs() * anR)); Standard_Integer aLSubs = LIntSubs(); - // Standard_Real NL, NS = Max(SIntOrder(1.0)*anRInt/LIntSubs(), 1); - Standard_Real NL, NS = Max(SIntOrder(1.) * anRInt / aLSubs, 1); + // Standard_Real NL, NS = std::max(SIntOrder(1.0)*anRInt/LIntSubs(), 1); + Standard_Real NL, NS = std::max(SIntOrder(1.) * anRInt / aLSubs, 1); switch (myCurve.GetType()) { case GeomAbs_Line: @@ -442,12 +442,11 @@ Standard_Integer BRepGProp_Face::LIntOrder(const Standard_Real Eps) const break; } - NL = Max(NL, NS); + NL = std::max(NL, NS); - Standard_Integer nn = RealToInt(aLSubs <= 4 ? Ceiling(LCoeff(Eps) * (NL + 1)) : NL + 1); + Standard_Integer nn = RealToInt(aLSubs <= 4 ? std::ceil(LCoeff(Eps) * (NL + 1)) : NL + 1); - // return Min(RealToInt(Ceiling(LCoeff(Eps)*(NL+1)*NS)), math::GaussPointsMax()); - return Min(nn, math::GaussPointsMax()); + return std::min(nn, math::GaussPointsMax()); } //================================================================================================= @@ -590,7 +589,7 @@ static void GetRealKnots(const Standard_Real theMin, if (aStartI == 0) aStartI = iU; - Standard_Integer aNbNode = Max(0, aEndI - aStartI + 1) + 2; + Standard_Integer aNbNode = std::max(0, aEndI - aStartI + 1) + 2; Standard_Integer j; theRealKnots = new TColStd_HArray1OfReal(1, aNbNode); diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_Gauss.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_Gauss.cxx index 0989fff997..34026d6160 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_Gauss.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_Gauss.cxx @@ -215,7 +215,8 @@ Standard_Integer BRepGProp_Gauss::FillIntervalBounds( NCollection_Handle& theError, NCollection_Handle& theCommonError) { - const Standard_Integer aSize = Max(theKnots.Upper(), MaxSubs(theKnots.Upper() - 1, theNumSubs)); + const Standard_Integer aSize = + std::max(theKnots.Upper(), MaxSubs(theKnots.Upper() - 1, theNumSubs)); if (aSize - 1 > theParam1->Upper()) { @@ -427,7 +428,7 @@ void BRepGProp_Gauss::convert(const BRepGProp_Gauss::Inertia& theInertia, gp_Mat& theOutMatrixOfInertia, Standard_Real& theOutMass) { - if (Abs(theInertia.Mass) >= EPS_DIM) + if (std::abs(theInertia.Mass) >= EPS_DIM) { const Standard_Real anInvMass = 1.0 / theInertia.Mass; theOutGravityCenter.SetX(theInertia.Ix * anInvMass); @@ -457,7 +458,7 @@ void BRepGProp_Gauss::convert(const BRepGProp_Gauss::Inertia& theInertia, Standard_Real& theOutMass) { convert(theInertia, theOutGravityCenter, theOutMatrixOfInertia, theOutMass); - if (Abs(theInertia.Mass) >= EPS_DIM && theIsByPoint) + if (std::abs(theInertia.Mass) >= EPS_DIM && theIsByPoint) { const Standard_Real anInvMass = 1.0 / theInertia.Mass; if (theIsByPoint == Standard_True) @@ -503,7 +504,7 @@ Standard_Real BRepGProp_Gauss::Compute(BRepGProp_Face& theSurface, const Standard_Boolean isVerifyComputation = (0.0 < theEps && theEps < 0.001) ? Standard_True : Standard_False; - Standard_Real anEpsilon = Abs(theEps); + Standard_Real anEpsilon = std::abs(theEps); BRepGProp_Gauss::Inertia anInertia; InertiaArray anInertiaL = new NCollection_Array1(1, SM); @@ -515,7 +516,7 @@ Standard_Real BRepGProp_Gauss::Compute(BRepGProp_Face& theSurface, NCollection_Handle UGaussP[2]; NCollection_Handle UGaussW[2]; - const Standard_Integer aNbGaussPoint = RealToInt(Ceiling(ERROR_ALGEBR_RATIO * GPM)); + const Standard_Integer aNbGaussPoint = RealToInt(std::ceil(ERROR_ALGEBR_RATIO * GPM)); LGaussP[0] = new math_Vector(1, GPM); LGaussP[1] = new math_Vector(1, aNbGaussPoint); @@ -567,7 +568,7 @@ Standard_Real BRepGProp_Gauss::Compute(BRepGProp_Face& theSurface, iGLEnd = isErrorCalculation ? 2 : 1; NbUGaussP[0] = theSurface.SIntOrder(anEpsilon); - NbUGaussP[1] = RealToInt(Ceiling(ERROR_ALGEBR_RATIO * NbUGaussP[0])); + NbUGaussP[1] = RealToInt(std::ceil(ERROR_ALGEBR_RATIO * NbUGaussP[0])); math::GaussPoints(NbUGaussP[0], *UGaussP[0]); math::GaussWeights(NbUGaussP[0], *UGaussW[0]); @@ -582,7 +583,7 @@ Standard_Real BRepGProp_Gauss::Compute(BRepGProp_Face& theSurface, { if (isNaturalRestriction) { - NbLGaussP[0] = Min(2 * NbUGaussP[0], math::GaussPointsMax()); + NbLGaussP[0] = std::min(2 * NbUGaussP[0], math::GaussPointsMax()); } else { @@ -593,7 +594,7 @@ Standard_Real BRepGProp_Gauss::Compute(BRepGProp_Face& theSurface, NbLGaussP[0] = theSurface.LIntOrder(anEpsilon); } - NbLGaussP[1] = RealToInt(Ceiling(ERROR_ALGEBR_RATIO * NbLGaussP[0])); + NbLGaussP[1] = RealToInt(std::ceil(ERROR_ALGEBR_RATIO * NbLGaussP[0])); math::GaussPoints(NbLGaussP[0], *LGaussP[0]); math::GaussWeights(NbLGaussP[0], *LGaussW[0]); @@ -620,7 +621,7 @@ Standard_Real BRepGProp_Gauss::Compute(BRepGProp_Face& theSurface, kLEnd = 1; JL = 0; - if (Abs(l2 - l1) > EPS_PARAM) + if (std::abs(l2 - l1) > EPS_PARAM) { iLSubEnd = FillIntervalBounds(l1, l2, LKnots, NumSubs, anInertiaL, L1, L2, ErrL, ErrUL); LMaxSubs = BRepGProp_Gauss::MaxSubs(iLSubEnd); @@ -649,7 +650,7 @@ Standard_Real BRepGProp_Gauss::Compute(BRepGProp_Face& theSurface, LRange[0] = IL = JL; } - if (JL == LMaxSubs || Abs(L2->Value(JL) - L1->Value(JL)) < EPS_PARAM) + if (JL == LMaxSubs || std::abs(L2->Value(JL) - L1->Value(JL)) < EPS_PARAM) { if (kLEnd == 1) { @@ -692,7 +693,7 @@ Standard_Real BRepGProp_Gauss::Compute(BRepGProp_Face& theSurface, theSurface.D12d(l, Puv, Vuv); Dul = Vuv.Y() * LGaussW[iGL]->Value(iL); // Dul = Du / Dl - if (Abs(Dul) < EPS_PARAM) + if (std::abs(Dul) < EPS_PARAM) continue; v = Puv.Y(); @@ -714,7 +715,7 @@ Standard_Real BRepGProp_Gauss::Compute(BRepGProp_Face& theSurface, kUEnd = 1; JU = 0; - if (Abs(u2 - u1) < EPS_PARAM) + if (std::abs(u2 - u1) < EPS_PARAM) continue; NCollection_Handle aDummy; @@ -743,7 +744,7 @@ Standard_Real BRepGProp_Gauss::Compute(BRepGProp_Face& theSurface, else URange[0] = IU = JU; - if (JU == UMaxSubs || Abs(U2->Value(JU) - U1->Value(JU)) < EPS_PARAM) + if (JU == UMaxSubs || std::abs(U2->Value(JU) - U1->Value(JU)) < EPS_PARAM) if (kUEnd == 1) { ErrU->Value(JU) = 0.0; @@ -753,7 +754,7 @@ Standard_Real BRepGProp_Gauss::Compute(BRepGProp_Face& theSurface, { --JU; EpsU = ErrorU; - Eps = 10. * EpsU * Abs((u2 - u1) * Dul); + Eps = 10. * EpsU * std::abs((u2 - u1) * Dul); EpsL = 0.9 * Eps; break; } @@ -821,13 +822,13 @@ Standard_Real BRepGProp_Gauss::Compute(BRepGProp_Face& theSurface, if (iGL > 0) continue; - Standard_Real aDMass = Abs(aLocal[1].Mass - aLocal[0].Mass); + Standard_Real aDMass = std::abs(aLocal[1].Mass - aLocal[0].Mass); if (myType == Vinert) { - aLocal[1].Ixx = Abs(aLocal[1].Ixx - aLocal[0].Ixx); - aLocal[1].Iyy = Abs(aLocal[1].Iyy - aLocal[0].Iyy); - aLocal[1].Izz = Abs(aLocal[1].Izz - aLocal[0].Izz); + aLocal[1].Ixx = std::abs(aLocal[1].Ixx - aLocal[0].Ixx); + aLocal[1].Iyy = std::abs(aLocal[1].Iyy - aLocal[0].Iyy); + aLocal[1].Izz = std::abs(aLocal[1].Izz - aLocal[0].Izz); anUI.Ix = mult(aLocal[0].Ix, ur); anUI.Iy = mult(aLocal[0].Iy, ur); @@ -880,7 +881,7 @@ Standard_Real BRepGProp_Gauss::Compute(BRepGProp_Face& theSurface, if (iGL > 0) continue; - ErrUL->Value(iLS) = ErrorU * Abs((u2 - u1) * Dul); + ErrUL->Value(iLS) = ErrorU * std::abs((u2 - u1) * Dul); for (i = 1; i <= JU; ++i) { @@ -906,15 +907,15 @@ Standard_Real BRepGProp_Gauss::Compute(BRepGProp_Face& theSurface, if (iGLEnd == 2) { - Standard_Real aSubDim = Abs(CDim[1] - CDim[0]); + Standard_Real aSubDim = std::abs(CDim[1] - CDim[0]); if (myType == Vinert) { ErrorU = ErrUL->Value(iLS); - CIxx[1] = Abs(CIxx[1] - CIxx[0]); - CIyy[1] = Abs(CIyy[1] - CIyy[0]); - CIzz[1] = Abs(CIzz[1] - CIzz[0]); + CIxx[1] = std::abs(CIxx[1] - CIxx[0]); + CIyy[1] = std::abs(CIyy[1] - CIyy[0]); + CIzz[1] = std::abs(CIzz[1] - CIzz[0]); #ifndef IS_MIN_DIM aSubDim = CIxx[1] + CIyy[1] + CIzz[1]; @@ -962,12 +963,12 @@ Standard_Real BRepGProp_Gauss::Compute(BRepGProp_Face& theSurface, DIzz += aLocalL.Izz; } - DDim = Abs(DIxx) + Abs(DIyy) + Abs(DIzz); + DDim = std::abs(DIxx) + std::abs(DIyy) + std::abs(DIzz); } } #endif - DDim = Abs(DDim * anEpsilon); + DDim = std::abs(DDim * anEpsilon); if (DDim > Eps) { @@ -986,7 +987,7 @@ Standard_Real BRepGProp_Gauss::Compute(BRepGProp_Face& theSurface, addAndRestoreInertia(anInertiaL->Value(i), anInertia); } - ErrorLMax = Max(ErrorLMax, ErrorL); + ErrorLMax = std::max(ErrorLMax, ErrorL); } if (isNaturalRestriction) @@ -1004,12 +1005,13 @@ Standard_Real BRepGProp_Gauss::Compute(BRepGProp_Face& theSurface, { if (theOutMass != 0.0) { - Eps = ErrorLMax / Abs(theOutMass); + Eps = ErrorLMax / std::abs(theOutMass); #ifndef IS_MIN_DIM { if (myType == Vinert) - Eps = ErrorLMax / (Abs(anInertia.Ixx) + Abs(anInertia.Iyy) + Abs(anInertia.Izz)); + Eps = ErrorLMax + / (std::abs(anInertia.Ixx) + std::abs(anInertia.Iyy) + std::abs(anInertia.Izz)); } #endif } @@ -1065,12 +1067,12 @@ void BRepGProp_Gauss::Compute(BRepGProp_Face& theSurface, checkBounds(u1, u2, v1, v2); const Standard_Integer NbUGaussgp_Pnts = - Min(theSurface.UIntegrationOrder(), math::GaussPointsMax()); + std::min(theSurface.UIntegrationOrder(), math::GaussPointsMax()); const Standard_Integer NbVGaussgp_Pnts = - Min(theSurface.VIntegrationOrder(), math::GaussPointsMax()); + std::min(theSurface.VIntegrationOrder(), math::GaussPointsMax()); - const Standard_Integer NbGaussgp_Pnts = Max(NbUGaussgp_Pnts, NbVGaussgp_Pnts); + const Standard_Integer NbGaussgp_Pnts = std::max(NbUGaussgp_Pnts, NbVGaussgp_Pnts); // Number of Gauss points for the integration on the face math_Vector GaussSPV(1, NbGaussgp_Pnts); @@ -1086,9 +1088,10 @@ void BRepGProp_Gauss::Compute(BRepGProp_Face& theSurface, return; } - Standard_Integer NbCGaussgp_Pnts = Min(theSurface.IntegrationOrder(), math::GaussPointsMax()); + Standard_Integer NbCGaussgp_Pnts = + std::min(theSurface.IntegrationOrder(), math::GaussPointsMax()); - NbCGaussgp_Pnts = Max(NbCGaussgp_Pnts, NbGaussgp_Pnts); + NbCGaussgp_Pnts = std::max(NbCGaussgp_Pnts, NbGaussgp_Pnts); math_Vector GaussCP(1, NbCGaussgp_Pnts); math_Vector GaussCW(1, NbCGaussgp_Pnts); @@ -1170,7 +1173,7 @@ void BRepGProp_Gauss::Compute(BRepGProp_Face& theSurface, const Standard_Integer aVNbCGaussgp_Pnts = theSurface.VIntegrationOrder(); const Standard_Integer aNbGaussgp_Pnts = - Min(Max(theSurface.IntegrationOrder(), aVNbCGaussgp_Pnts), math::GaussPointsMax()); + std::min(std::max(theSurface.IntegrationOrder(), aVNbCGaussgp_Pnts), math::GaussPointsMax()); math_Vector GaussP(1, aNbGaussgp_Pnts); math_Vector GaussW(1, aNbGaussgp_Pnts); @@ -1193,8 +1196,8 @@ void BRepGProp_Gauss::Compute(BRepGProp_Face& theSurface, theSurface.D12d(l, Puv, Vuv); u2 = Puv.X(); - u2 = Min(Max(u1, u2), _u2); // OCC104 - const Standard_Real v = Min(Max(Puv.Y(), v1), v2); + u2 = std::min(std::max(u1, u2), _u2); // OCC104 + const Standard_Real v = std::min(std::max(Puv.Y(), v1), v2); const Standard_Real Dul = Vuv.Y() * GaussW(i); const Standard_Real um = 0.5 * (u2 + u1); @@ -1245,8 +1248,8 @@ void BRepGProp_Gauss::Compute(const BRepGProp_Face& theSurface, theSurface.Bounds(LowerU, UpperU, LowerV, UpperV); checkBounds(LowerU, UpperU, LowerV, UpperV); - const Standard_Integer UOrder = Min(theSurface.UIntegrationOrder(), math::GaussPointsMax()); - const Standard_Integer VOrder = Min(theSurface.VIntegrationOrder(), math::GaussPointsMax()); + const Standard_Integer UOrder = std::min(theSurface.UIntegrationOrder(), math::GaussPointsMax()); + const Standard_Integer VOrder = std::min(theSurface.VIntegrationOrder(), math::GaussPointsMax()); // Gauss points and weights math_Vector GaussPU(1, UOrder); diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_Gauss.hxx b/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_Gauss.hxx index c41f201dc5..45e3423e0e 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_Gauss.hxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_Gauss.hxx @@ -164,7 +164,7 @@ public: //! @name public API //! @param[out] theOutGravityCenter - garvity center of region; //! @param[out] theOutInertia - matrix of inertia; //! @return value of error which is calculated as - //! Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values + //! std::abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values //! for two successive steps of adaptive integration. Standard_EXPORT Standard_Real Compute(BRepGProp_Face& theSurface, BRepGProp_Domain& theDomain, @@ -186,7 +186,7 @@ public: //! @name public API //! @param[out] theOutGravityCenter - garvity center of region; //! @param[out] theOutInertia - matrix of inertia; //! @return value of error which is calculated as - //! Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values + //! std::abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values //! for two successive steps of adaptive integration. Standard_EXPORT Standard_Real Compute(BRepGProp_Face& theSurface, BRepGProp_Domain& theDomain, diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_MeshCinert.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_MeshCinert.cxx index dc3ad62267..75a6939ea9 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_MeshCinert.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_MeshCinert.cxx @@ -123,7 +123,7 @@ void BRepGProp_MeshCinert::Perform(const TColgp_Array1OfPnt& theNodes) inertia = gp_Mat(gp_XYZ(Ixx, -Ixy, -Ixz), gp_XYZ(-Ixy, Iyy, -Iyz), gp_XYZ(-Ixz, -Iyz, Izz)); - if (Abs(dim) < gp::Resolution()) + if (std::abs(dim) < gp::Resolution()) g = P; else g.SetCoord(Ix / dim, Iy / dim, Iz / dim); diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_MeshProps.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_MeshProps.cxx index e43ca8f6b9..cb7536ca92 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_MeshProps.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_MeshProps.cxx @@ -182,7 +182,7 @@ void BRepGProp_MeshProps::Perform(const Handle(Poly_Triangulation)& theMesh, const gp_Trsf& aTr = theLoc.Transformation(); // Standard_Boolean isToCopy = aTr.ScaleFactor() * aTr.HVectorialPart().Determinant() < 0. - || Abs(Abs(aTr.ScaleFactor()) - 1.) > gp::Resolution(); + || std::abs(std::abs(aTr.ScaleFactor()) - 1.) > gp::Resolution(); if (isToCopy) { Handle(Poly_Triangulation) aCopy = @@ -284,7 +284,7 @@ void BRepGProp_MeshProps::Perform(const Handle(Poly_Triangulation)& theMesh, } dim = aGProps[0]; - if (Abs(dim) >= 1.e-20) // To be consistent with GProp_GProps + if (std::abs(dim) >= 1.e-20) // To be consistent with GProp_GProps { g.SetX(aGProps[1] / dim); g.SetY(aGProps[2] / dim); diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_TFunction.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_TFunction.cxx index 7f15bdb362..b48e945d92 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_TFunction.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_TFunction.cxx @@ -104,7 +104,7 @@ Standard_Boolean BRepGProp_TFunction::Value(const Standard_Real X, Standard_Real else return Standard_False; - Standard_Real aAbsCoeff = Abs(aCoeff); + Standard_Real aAbsCoeff = std::abs(aCoeff); if (aAbsCoeff <= Precision::Angular()) { @@ -127,8 +127,8 @@ Standard_Boolean BRepGProp_TFunction::Value(const Standard_Real X, Standard_Real F = 0.; // Epmirical criterion - aNbPntsStart = Min(15, mySurface.UIntegrationOrder() / (anUKnots->Length() - 1) + 1); - aNbPntsStart = Max(5, aNbPntsStart); + aNbPntsStart = std::min(15, mySurface.UIntegrationOrder() / (anUKnots->Length() - 1) + 1); + aNbPntsStart = std::max(5, aNbPntsStart); while (i < iU) { @@ -151,14 +151,14 @@ Standard_Boolean BRepGProp_TFunction::Value(const Standard_Real X, Standard_Real F *= aCoeff; aLocalErr *= aAbsCoeff; - myAbsError = Max(myAbsError, aLocalErr); + myAbsError = std::max(myAbsError, aLocalErr); myTolReached += aLocalErr; - if (Abs(F) > Epsilon(1.)) - aLocalErr /= Abs(F); + if (std::abs(F) > Epsilon(1.)) + aLocalErr /= std::abs(F); - myErrReached = Max(myErrReached, aLocalErr); + myErrReached = std::max(myErrReached, aLocalErr); return Standard_True; } diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_Vinert.hxx b/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_Vinert.hxx index 75a1f5ad60..b3a566d85e 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_Vinert.hxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_Vinert.hxx @@ -58,7 +58,7 @@ public: //! delimited with the surface and the point VLocation. S can be closed //! Adaptive 2D Gauss integration is used. //! Parameter Eps sets maximal relative error of computed mass (volume) for face. - //! Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values + //! Error is calculated as std::abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values //! for two successive steps of adaptive integration. Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, const gp_Pnt& VLocation, @@ -79,7 +79,7 @@ public: //! delimited with the surface and the point VLocation. //! Adaptive 2D Gauss integration is used. //! Parameter Eps sets maximal relative error of computed mass (volume) for face. - //! Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values + //! Error is calculated as std::abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values //! for two successive steps of adaptive integration. //! WARNING: if Eps > 0.001 algorithm performs non-adaptive integration. Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, @@ -102,7 +102,7 @@ public: //! delimited with the surface and the plane Pln. //! Adaptive 2D Gauss integration is used. //! Parameter Eps sets maximal relative error of computed mass (volume) for face. - //! Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values + //! Error is calculated as std::abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values //! for two successive steps of adaptive integration. //! WARNING: if Eps > 0.001 algorithm performs non-adaptive integration. Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, @@ -123,7 +123,7 @@ public: //! delimited with the surface and the point VLocation. S can be closed //! Adaptive 2D Gauss integration is used. //! Parameter Eps sets maximal relative error of computed mass (volume) for face. - //! Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values + //! Error is calculated as std::abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values //! for two successive steps of adaptive integration. Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, BRepGProp_Domain& D, @@ -146,7 +146,7 @@ public: //! delimited with the surface and the point VLocation. //! Adaptive 2D Gauss integration is used. //! Parameter Eps sets maximal relative error of computed mass (volume) for face. - //! Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values + //! Error is calculated as std::abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values //! for two successive steps of adaptive integration. //! WARNING: if Eps > 0.001 algorithm performs non-adaptive integration. Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, @@ -171,7 +171,7 @@ public: //! delimited with the surface and the plane Pln. //! Adaptive 2D Gauss integration is used. //! Parameter Eps sets maximal relative error of computed mass (volume) for face. - //! Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values + //! Error is calculated as std::abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values //! for two successive steps of adaptive integration. //! WARNING: if Eps > 0.001 algorithm performs non-adaptive integration. Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_VinertGK.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_VinertGK.cxx index 412cafb6e6..d878742a29 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_VinertGK.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepGProp/BRepGProp_VinertGK.cxx @@ -391,8 +391,8 @@ Standard_Real BRepGProp_VinertGK::PrivatePerform(BRepGProp_Face& theSurfa GProp_ValueType aValueType; // Empirical criterion. - aNbPnts = Min(15, theSurface.IntegrationOrder() / aNbTIntervals + 1); - aNbPnts = Max(5, aNbPnts); + aNbPnts = std::min(15, theSurface.IntegrationOrder() / aNbTIntervals + 1); + aNbPnts = std::max(5, aNbPnts); // aNbPnts = theSurface.IntegrationOrder(); aLocalValue.Init(0.); @@ -496,7 +496,7 @@ Standard_Real BRepGProp_VinertGK::PrivatePerform(BRepGProp_Face& theSurfa dim = aValue(1); myErrorReached = aTolReached(1); myAbsolutError = myErrorReached; - Standard_Real anAbsDim = Abs(dim); + Standard_Real anAbsDim = std::abs(dim); Standard_Real aVolTol = Epsilon(myAbsolutError); if (anAbsDim >= aVolTol) myErrorReached /= anAbsDim; diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib.cxx index 8ca65de201..33041ece41 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib.cxx @@ -169,8 +169,8 @@ Standard_Boolean BRepLib::CheckSameRange(const TopoDS_Edge& AnEdge, const Standa } else { - IsSameRange = - (Abs(current_first - first) <= Tolerance) && (Abs(current_last - last) <= Tolerance); + IsSameRange = (std::abs(current_first - first) <= Tolerance) + && (std::abs(current_last - last) <= Tolerance); } } an_Iterator.Next(); @@ -225,8 +225,8 @@ void BRepLib::SameRange(const TopoDS_Edge& AnEdge, const Standard_Real Tolerance first_time_in = Standard_False; } - if (Abs(first - current_first) > Precision::Confusion() - || Abs(last - current_last) > Precision::Confusion()) + if (std::abs(first - current_first) > Precision::Confusion() + || std::abs(last - current_last) > Precision::Confusion()) { if (has_curve) { @@ -280,13 +280,13 @@ static Standard_Integer evaluateMaxSegment(const Standard_Integer aMaxS if (aSurf->GetType() == GeomAbs_BSplineSurface) { Handle(Geom_BSplineSurface) aBSpline = aSurf->BSpline(); - aNbSKnots = Max(aBSpline->NbUKnots(), aBSpline->NbVKnots()); + aNbSKnots = std::max(aBSpline->NbUKnots(), aBSpline->NbVKnots()); } if (aCurv2d->GetType() == GeomAbs_BSplineCurve) { aNbC2dKnots = aCurv2d->NbKnots(); } - Standard_Integer aReturn = (Standard_Integer)(30 + Max(aNbSKnots, aNbC2dKnots)); + Standard_Integer aReturn = (Standard_Integer)(30 + std::max(aNbSKnots, aNbC2dKnots)); return aReturn; } @@ -419,8 +419,8 @@ Standard_Boolean BRepLib::BuildCurve3d(const TopoDS_Edge& AnEdge, BRep_Builder B; tolerance = BRep_Tool::Tolerance(AnEdge); // Patch - // max_deviation = Max(tolerance, max_deviation) ; - max_deviation = Max(tolerance, Tolerance); + // max_deviation = std::max(tolerance, max_deviation) ; + max_deviation = std::max(tolerance, Tolerance); if (NewCurvePtr.IsNull()) return Standard_False; B.UpdateEdge(TopoDS::Edge(AnEdge), NewCurvePtr, L[0], max_deviation); @@ -655,7 +655,7 @@ Standard_Boolean BRepLib::UpdateEdgeTol(const TopoDS_Edge& AnEdge, max_distance); } max_distance *= safe_factor; - edge_tolerance = Max(max_distance, edge_tolerance); + edge_tolerance = std::max(max_distance, edge_tolerance); } } curve_index += 1; @@ -752,7 +752,7 @@ static void GetEdgeTol(const TopoDS_Edge& theEdge, gp_Pnt Pc3d = HC->Value(u); gp_Pnt2d p2d = pc->Value(u); gp_Pnt Pcons = ElSLib::Value(p2d.X(), p2d.Y(), pln); - Standard_Real eps = Max(Pc3d.XYZ().SquareModulus(), Pcons.XYZ().SquareModulus()); + Standard_Real eps = std::max(Pc3d.XYZ().SquareModulus(), Pcons.XYZ().SquareModulus()); eps = Epsilon(eps); Standard_Real temp = Pc3d.SquareDistance(Pcons); if (temp <= eps) @@ -789,7 +789,7 @@ static void UpdTolMap(const TopoDS_Shape& theSh, if (!anOldtol) theShToTol.Bind(theSh, theNewTol); else - theShToTol(theSh) = Max(*anOldtol, theNewTol); + theShToTol(theSh) = std::max(*anOldtol, theNewTol); } } @@ -1033,12 +1033,12 @@ static Standard_Real ComputeTol(const Handle(Adaptor3d_Curve)& c3d, { if (Puv.X() < uf - du) { - dapp = Max(dapp, DSdu * (uf - Puv.X())); + dapp = std::max(dapp, DSdu * (uf - Puv.X())); continue; } else if (Puv.X() > ul + du) { - dapp = Max(dapp, DSdu * (Puv.X() - ul)); + dapp = std::max(dapp, DSdu * (Puv.X() - ul)); continue; } } @@ -1046,12 +1046,12 @@ static Standard_Real ComputeTol(const Handle(Adaptor3d_Curve)& c3d, { if (Puv.Y() < vf - dv) { - dapp = Max(dapp, DSdv * (vf - Puv.Y())); + dapp = std::max(dapp, DSdv * (vf - Puv.Y())); continue; } else if (Puv.Y() > vl + dv) { - dapp = Max(dapp, DSdv * (Puv.Y() - vl)); + dapp = std::max(dapp, DSdv * (Puv.Y() - vl)); continue; } } @@ -1066,7 +1066,7 @@ static Standard_Real ComputeTol(const Handle(Adaptor3d_Curve)& c3d, dist(i + 1) = temp; - d2 = Max(d2, temp); + d2 = std::max(d2, temp); } if (Precision::IsInfinite(d2)) @@ -1074,7 +1074,7 @@ static Standard_Real ComputeTol(const Handle(Adaptor3d_Curve)& c3d, return d2; } - d2 = Sqrt(d2); + d2 = std::sqrt(d2); if (dapp > d2) { return dapp; @@ -1112,14 +1112,14 @@ static Standard_Real ComputeTol(const Handle(Adaptor3d_Curve)& c3d, { if (dist(i) > 0 && dist(i) < 1.0) { - D2 = Max(D2, dist(i)); + D2 = std::max(D2, dist(i)); } } } // d2 = 1.5*sqrt(d2); d2 = (!ana) ? 1.5 * d2 : 1.5 * sqrt(D2); - d2 = Max(d2, 1.e-7); + d2 = std::max(d2, 1.e-7); return d2; } @@ -1297,7 +1297,7 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge, } // Eval tol2d to compute SameRange - Standard_Real TolSameRange = Max(GAC.Resolution(theTolerance), Precision::PConfusion()); + Standard_Real TolSameRange = std::max(GAC.Resolution(theTolerance), Precision::PConfusion()); for (Standard_Integer i = 0; i < 2; i++) { Handle(Geom2d_Curve) curPC = PC[i]; @@ -1325,8 +1325,8 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge, { Standard_Real UResol = GAS.UResolution(theTolerance); Standard_Real VResol = GAS.VResolution(theTolerance); - Standard_Real TolConf2d = Min(UResol, VResol); - TolConf2d = Max(TolConf2d, Precision::PConfusion()); + Standard_Real TolConf2d = std::min(UResol, VResol); + TolConf2d = std::max(TolConf2d, Precision::PConfusion()); Handle(Geom2d_BSplineCurve) bs2d = GAC2d.BSpline(); Handle(Geom2d_BSplineCurve) bs2dsov = bs2d; Standard_Real fC0 = bs2d->FirstParameter(), lC0 = bs2d->LastParameter(); @@ -1340,8 +1340,8 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge, { // -------- IFV, Jan 2000 gp_Pnt2d NewOriginPoint; bs2d->D0(bs2d->FirstParameter(), NewOriginPoint); - if (Abs(OriginPoint.X() - NewOriginPoint.X()) > Precision::PConfusion() - || Abs(OriginPoint.Y() - NewOriginPoint.Y()) > Precision::PConfusion()) + if (std::abs(OriginPoint.X() - NewOriginPoint.X()) > Precision::PConfusion() + || std::abs(OriginPoint.Y() - NewOriginPoint.Y()) > Precision::PConfusion()) { TColStd_Array1OfReal Knotbs2d(1, bs2d->NbKnots()); @@ -1350,8 +1350,8 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge, for (Standard_Integer Index = 1; Index <= bs2d->NbKnots(); Index++) { bs2d->D0(Knotbs2d(Index), NewOriginPoint); - if (Abs(OriginPoint.X() - NewOriginPoint.X()) > Precision::PConfusion() - || Abs(OriginPoint.Y() - NewOriginPoint.Y()) > Precision::PConfusion()) + if (std::abs(OriginPoint.X() - NewOriginPoint.X()) > Precision::PConfusion() + || std::abs(OriginPoint.Y() - NewOriginPoint.Y()) > Precision::PConfusion()) continue; bs2d->SetOrigin(Index); @@ -1368,7 +1368,7 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge, bs2d = bs2dsov; Standard_Real UResbail = GAS.UResolution(tolbail); Standard_Real VResbail = GAS.VResolution(tolbail); - Standard_Real Tol2dbail = Min(UResbail, VResbail); + Standard_Real Tol2dbail = std::min(UResbail, VResbail); bs2d->D0(bs2d->FirstParameter(), OriginPoint); Standard_Integer nbp = bs2d->NbPoles(); @@ -1379,12 +1379,12 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge, for (Standard_Integer ip = 2; ip <= nbp; ip++) { p1 = poles(ip); - d = Min(d, p.SquareDistance(p1)); + d = std::min(d, p.SquareDistance(p1)); p = p1; } d = sqrt(d) * .1; - Tol2dbail = Max(Min(Tol2dbail, d), TolConf2d); + Tol2dbail = std::max(std::min(Tol2dbail, d), TolConf2d); Geom2dConvert::C0BSplineToC1BSplineCurve(bs2d, Tol2dbail); @@ -1392,8 +1392,8 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge, { // -------- IFV, Jan 2000 gp_Pnt2d NewOriginPoint; bs2d->D0(bs2d->FirstParameter(), NewOriginPoint); - if (Abs(OriginPoint.X() - NewOriginPoint.X()) > Precision::PConfusion() - || Abs(OriginPoint.Y() - NewOriginPoint.Y()) > Precision::PConfusion()) + if (std::abs(OriginPoint.X() - NewOriginPoint.X()) > Precision::PConfusion() + || std::abs(OriginPoint.Y() - NewOriginPoint.Y()) > Precision::PConfusion()) { TColStd_Array1OfReal Knotbs2d(1, bs2d->NbKnots()); @@ -1402,8 +1402,8 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge, for (Standard_Integer Index = 1; Index <= bs2d->NbKnots(); Index++) { bs2d->D0(Knotbs2d(Index), NewOriginPoint); - if (Abs(OriginPoint.X() - NewOriginPoint.X()) > Precision::PConfusion() - || Abs(OriginPoint.Y() - NewOriginPoint.Y()) > Precision::PConfusion()) + if (std::abs(OriginPoint.X() - NewOriginPoint.X()) > Precision::PConfusion() + || std::abs(OriginPoint.Y() - NewOriginPoint.Y()) > Precision::PConfusion()) continue; bs2d->SetOrigin(Index); @@ -1457,7 +1457,7 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge, GeomAbs_Shape cont = bs2d->Continuity(); Standard_Boolean IsBad = Standard_False; - if (cont > GeomAbs_C0 && error > Max(1.e-3, theTolerance)) + if (cont > GeomAbs_C0 && error > std::max(1.e-3, theTolerance)) { Standard_Integer NbKnots = bs2d->NbKnots(); TColStd_Array1OfReal Knots(1, NbKnots); @@ -1469,7 +1469,7 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge, for (Standard_Integer j = 2; j < NbKnots; j++) { dtcur = Knots(j + 1) - Knots(j); - dtmin = Min(dtmin, dtcur); + dtmin = std::min(dtmin, dtcur); if (IsBad) continue; @@ -1487,7 +1487,7 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge, if (IsBad) { // To avoid failures in Approx_CurvilinearParameter - bs2d->Resolution(Max(1.e-3, theTolerance), dtcur); + bs2d->Resolution(std::max(1.e-3, theTolerance), dtcur); if (dtmin < dtcur) IsBad = Standard_False; } @@ -1505,7 +1505,7 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge, maxdeg = 14; Approx_CurvilinearParameter AppCurPar(HC2d, HS, - Max(1.e-3, theTolerance), + std::max(1.e-3, theTolerance), cont, maxdeg, 10); @@ -1515,8 +1515,8 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge, GAC2d.Load(bs2d, f3d, l3d); curPC = bs2d; - if (Abs(bs2d->FirstParameter() - fC0) > TolSameRange - || Abs(bs2d->LastParameter() - lC0) > TolSameRange) + if (std::abs(bs2d->FirstParameter() - fC0) > TolSameRange + || std::abs(bs2d->LastParameter() - lC0) > TolSameRange) { Standard_Integer NbKnots = bs2d->NbKnots(); TColStd_Array1OfReal Knots(1, NbKnots); @@ -1542,7 +1542,7 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge, if (SameP.IsSameParameter()) { - maxdist = Max(maxdist, SameP.TolReached()); + maxdist = std::max(maxdist, SameP.TolReached()); if (updatepc) { if (i == 0) @@ -1558,11 +1558,11 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge, { curPC = SameP.Curve2d(); updatepc = Standard_True; - maxdist = Max(maxdist, tolreached); + maxdist = std::max(maxdist, tolreached); } else { - maxdist = Max(maxdist, error); + maxdist = std::max(maxdist, error); } if (updatepc) { @@ -1600,10 +1600,10 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge, if (!IsSameP) { Standard_Real Prec_Surf = BRepCheck::PrecSurface(HS); - Standard_Real CurTol = anEdgeTol + Max(Prec_C3d, Prec_Surf); + Standard_Real CurTol = anEdgeTol + std::max(Prec_C3d, Prec_Surf); if (CurTol >= error) { - maxdist = Max(maxdist, anEdgeTol); + maxdist = std::max(maxdist, anEdgeTol); IsSameP = Standard_True; } } @@ -1624,7 +1624,7 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge, if (YaPCu) { // Avoid setting too small tolerances. - maxdist = Max(maxdist, Precision::Confusion()); + maxdist = std::max(maxdist, Precision::Confusion()); theNewTol = maxdist; aNTE->Modified(Standard_True); aNTE->Tolerance(maxdist); @@ -1723,7 +1723,7 @@ static void InternalUpdateTolerances(const TopoDS_Shape& theOldShape, Ftol = aShToTol(FF); else Ftol = BRep_Tool::Tolerance(FF); // tolerance have not been updated - tol = Max(tol, Ftol); + tol = std::max(tol, Ftol); } // Update can only increase tolerance, so if the edge has a greater // tolerance than its faces it is not concerned @@ -1750,7 +1750,7 @@ static void InternalUpdateTolerances(const TopoDS_Shape& theOldShape, { const TopoDS_Edge& E = TopoDS::Edge(lConx.Value()); const Standard_Real* aNtol = aShToTol.Seek(E); - tol = Max(tol, aNtol ? *aNtol : BRep_Tool::Tolerance(E)); + tol = std::max(tol, aNtol ? *aNtol : BRep_Tool::Tolerance(E)); if (tol > BigTol) continue; if (!BRep_Tool::SameRange(E)) @@ -1805,7 +1805,7 @@ static void InternalUpdateTolerances(const TopoDS_Shape& theOldShape, itcr.Next(); } } - tol = Max(tol, sqrt(aMaxDist)); + tol = std::max(tol, sqrt(aMaxDist)); tol += 2. * Epsilon(tol); // Standard_Real aVTol = BRep_Tool::Tolerance(V); @@ -1928,14 +1928,14 @@ void BRepLib::UpdateInnerTolerances(const TopoDS_Shape& aShape) gp_Pnt End1 = anHCurve->Value(fpar); Standard_Real dist1 = Pnt1.Distance(End1); dist1 += 2. * Epsilon(dist1); - BB.UpdateVertex(V1, Max(dist1, TolEdge)); + BB.UpdateVertex(V1, std::max(dist1, TolEdge)); } if (!V2.IsNull()) { gp_Pnt End2 = anHCurve->Value(lpar); Standard_Real dist2 = Pnt2.Distance(End2); dist2 += 2. * Epsilon(dist2); - BB.UpdateVertex(V2, Max(dist2, TolEdge)); + BB.UpdateVertex(V2, std::max(dist2, TolEdge)); } } } @@ -2195,7 +2195,7 @@ GeomAbs_Shape BRepLib::ContinuityOfFaces(const TopoDS_Edge& theEdge, if (isSmoothSuspect) { aCurCont = GeomAbs_G1; - if (Abs(Sqrt(aSqLen1) - Sqrt(aSqLen2)) < Precision::Confusion() + if (std::abs(std::sqrt(aSqLen1) - std::sqrt(aSqLen2)) < Precision::Confusion() && aDer1.Dot(aDer2) > Precision::SquareConfusion()) // <= check vectors are codirectional aCurCont = GeomAbs_C1; } @@ -2216,10 +2216,10 @@ GeomAbs_Shape BRepLib::ContinuityOfFaces(const TopoDS_Edge& theEdge, { if (aCrvDir1[0].XYZ().CrossSquareMagnitude(aCrvDir2[aStep].XYZ()) <= Precision::SquareConfusion() - && Abs(aCrvLen1[0] - aCrvLen2[aStep]) < Precision::Confusion() + && std::abs(aCrvLen1[0] - aCrvLen2[aStep]) < Precision::Confusion() && aCrvDir1[1].XYZ().CrossSquareMagnitude(aCrvDir2[1 - aStep].XYZ()) <= Precision::SquareConfusion() - && Abs(aCrvLen1[1] - aCrvLen2[1 - aStep]) < Precision::Confusion()) + && std::abs(aCrvLen1[1] - aCrvLen2[1 - aStep]) < Precision::Confusion()) { if (aCurCont == GeomAbs_C1 && aCrvDir1[0].Dot(aCrvDir2[aStep]) > Precision::Confusion() && aCrvDir1[1].Dot(aCrvDir2[1 - aStep]) > Precision::Confusion()) @@ -2661,7 +2661,7 @@ void BRepLib::UpdateDeflection(const TopoDS_Shape& theShape) const gp_Pnt aMid3d_t = (aP3d[0].XYZ() + aP3d[1].XYZ() + aP3d[2].XYZ()) / 3.; const gp_Pnt2d aMid2d_t = (aP2d[0].XY() + aP2d[1].XY() + aP2d[2].XY()) / 3.; - aSqDeflection = Max(aSqDeflection, aTool.Eval(aMid2d_t, aMid3d_t)); + aSqDeflection = std::max(aSqDeflection, aTool.Eval(aMid2d_t, aMid3d_t)); for (Standard_Integer i = 0; i < 3; ++i) { @@ -2679,12 +2679,12 @@ void BRepLib::UpdateDeflection(const TopoDS_Shape& theShape) const gp_Pnt aMid3d_l = (aP3d1.XYZ() + aP3d2.XYZ()) / 2.; const gp_Pnt2d aMid2d_l = (aP2d1.XY() + aP2d2.XY()) / 2.; - aSqDeflection = Max(aSqDeflection, aTool.Eval(aMid2d_l, aMid3d_l)); + aSqDeflection = std::max(aSqDeflection, aTool.Eval(aMid2d_l, aMid3d_l)); } } } - aPT->Deflection(Sqrt(aSqDeflection)); + aPT->Deflection(std::sqrt(aSqDeflection)); } } @@ -2955,7 +2955,7 @@ void BRepLib::ExtendFace(const TopoDS_Face& theF, { // Adjust face bounds to first period Standard_Real aDelta = aFUMax - aFUMin; - aFUMin = Max(aSUMin, aFUMin + anUPeriod * Ceiling((aSUMin - aFUMin) / anUPeriod)); + aFUMin = std::max(aSUMin, aFUMin + anUPeriod * std::ceil((aSUMin - aFUMin) / anUPeriod)); aFUMax = aFUMin + aDelta; } @@ -2965,8 +2965,8 @@ void BRepLib::ExtendFace(const TopoDS_Face& theF, { // Adjust face bounds to first period Standard_Real aDelta = aFVMax - aFVMin; - aFVMin = Max(aSVMin, aFVMin + aVPeriod * Ceiling((aSVMin - aFVMin) / aVPeriod)); - aFVMax = aFVMin + aDelta; + aFVMin = std::max(aSVMin, aFVMin + aVPeriod * std::ceil((aSVMin - aFVMin) / aVPeriod)); + aFVMax = aFVMin + aDelta; } // Enlarge the face @@ -2977,23 +2977,23 @@ void BRepLib::ExtendFace(const TopoDS_Face& theF, aVRes = aBAS.VResolution(theExtVal); if (theExtUMin) - aFUMin = Max(aSUMin, aFUMin - anURes); + aFUMin = std::max(aSUMin, aFUMin - anURes); if (theExtUMax) - aFUMax = Min(isUPeriodic ? aFUMin + anUPeriod : aSUMax, aFUMax + anURes); + aFUMax = std::min(isUPeriodic ? aFUMin + anUPeriod : aSUMax, aFUMax + anURes); if (theExtVMin) - aFVMin = Max(aSVMin, aFVMin - aVRes); + aFVMin = std::max(aSVMin, aFVMin - aVRes); if (theExtVMax) - aFVMax = Min(isVPeriodic ? aFVMin + aVPeriod : aSVMax, aFVMax + aVRes); + aFVMax = std::min(isVPeriodic ? aFVMin + aVPeriod : aSVMax, aFVMax + aVRes); // Check if the periodic surface should become closed. // In this case, use the basis surface with basis bounds. constexpr Standard_Real anEps = Precision::PConfusion(); - if (isUPeriodic && Abs(aFUMax - aFUMin - anUPeriod) < anEps) + if (isUPeriodic && std::abs(aFUMax - aFUMin - anUPeriod) < anEps) { aFUMin = aSUMin; aFUMax = aSUMax; } - if (isVPeriodic && Abs(aFVMax - aFVMin - aVPeriod) < anEps) + if (isVPeriodic && std::abs(aFVMax - aFVMin - aVPeriod) < anEps) { aFVMin = aSVMin; aFVMax = aSVMax; diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_1.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_1.cxx index bc9281752c..ac979c3574 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_1.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_1.cxx @@ -132,7 +132,7 @@ static Standard_Boolean findNearestValidPoint(const Adaptor3d_Curve& theCurve, // 3. Precise solution with binary search - Standard_Real aDelta = Abs(anUOut - anUIn); + Standard_Real aDelta = std::abs(anUOut - anUIn); while (aDelta > theEps) { Standard_Real aMidU = (anUIn + anUOut) * 0.5; @@ -142,7 +142,7 @@ static Standard_Boolean findNearestValidPoint(const Adaptor3d_Curve& theCurve, anUOut = aMidU; else anUIn = aMidU; - aDelta = Abs(anUOut - anUIn); + aDelta = std::abs(anUOut - anUIn); } thePar = (anUIn + anUOut) * 0.5; return Standard_True; @@ -169,12 +169,12 @@ Standard_Boolean BRepLib::FindValidRange(const Adaptor3d_Curve& theCurve, Standard_Real aMaxPar = 0.0; if (!isInfParV1) - aMaxPar = Abs(theParV1); + aMaxPar = std::abs(theParV1); if (!isInfParV2) - aMaxPar = Max(aMaxPar, Abs(theParV2)); + aMaxPar = std::max(aMaxPar, std::abs(theParV2)); - Standard_Real anEps = - Max(Max(theCurve.Resolution(theTolE) * 0.1, Epsilon(aMaxPar)), Precision::PConfusion()); + Standard_Real anEps = std::max(std::max(theCurve.Resolution(theTolE) * 0.1, Epsilon(aMaxPar)), + Precision::PConfusion()); if (isInfParV1) theFirst = theParV1; diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_FindSurface.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_FindSurface.cxx index 189e0c96c5..29ac573e13 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_FindSurface.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_FindSurface.cxx @@ -58,7 +58,7 @@ static Standard_Real Controle(const TColgp_SequenceOfPnt& thePoints, for (ii = 1; ii <= thePoints.Length(); ii++) { const gp_XYZ& xyz = thePoints(ii).XYZ(); - dist = Abs(a * xyz.X() + b * xyz.Y() + c * xyz.Z() + d); + dist = std::abs(a * xyz.X() + b * xyz.Y() + c * xyz.Z() + d); if (dist > dfMaxDist) dfMaxDist = dist; } @@ -182,7 +182,7 @@ static void fillParams(const TColStd_Array1OfReal& theKnots, Standard_Real aPrevPar = theParMin; theParams.Append(aPrevPar); - Standard_Integer aNbP = Max(theDegree, 1); + Standard_Integer aNbP = std::max(theDegree, 1); for (Standard_Integer i = 1; (i < theKnots.Length()) && (theKnots(i) < (theParMax - Precision::PConfusion())); @@ -459,7 +459,7 @@ void BRepLib_FindSurface::Init(const TopoDS_Shape& S, Standard_Real anEMax = -anEMin; for (i = 1; i <= 3; ++i) { - Standard_Real anE = Abs(anEVals(i)); + Standard_Real anE = std::abs(anEVals(i)); if (anEMin > anE) { anEMin = anE; @@ -523,11 +523,11 @@ void BRepLib_FindSurface::Init(const TopoDS_Shape& S, if (!isSolved) return; // Removing very small values - Standard_Real aMaxV = Max(Abs(aVec(1)), Max(Abs(aVec(2)), Abs(aVec(3)))); + Standard_Real aMaxV = std::max(std::abs(aVec(1)), std::max(std::abs(aVec(2)), std::abs(aVec(3)))); Standard_Real eps = Epsilon(aMaxV); for (i = 1; i <= 3; ++i) { - if (Abs(aVec(i)) <= eps) + if (std::abs(aVec(i)) <= eps) aVec(i) = 0.; } gp_Vec aN(aVec(1), aVec(2), aVec(3)); diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_FuseEdges.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_FuseEdges.cxx index 3b4af6d86c..e68e75d804 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_FuseEdges.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_FuseEdges.cxx @@ -115,7 +115,7 @@ static void BCSmoothing(Handle(Geom_BSplineCurve)& theC, Standard_Integer anInd = aKnotIndex(i); Standard_Real aK1 = 0.5 * (aKnots(anInd) + aKnots(anInd - 1)); - if (Abs(aK1 - aLastKnot) > 1.e-3) + if (std::abs(aK1 - aLastKnot) > 1.e-3) { aKnotIns.Append(aK1); aLastKnot = aK1; @@ -123,7 +123,7 @@ static void BCSmoothing(Handle(Geom_BSplineCurve)& theC, Standard_Real aK2 = 0.5 * (aKnots(anInd + 1) + aKnots(anInd)); - if (Abs(aK2 - aLastKnot) > 1.e-3) + if (std::abs(aK2 - aLastKnot) > 1.e-3) { aKnotIns.Append(aK2); aLastKnot = aK2; @@ -852,7 +852,7 @@ Standard_Boolean BRepLib_FuseEdges::SameSupport(const TopoDS_Edge& E1, const Top { gp_Circ ci1 = Handle(Geom_Circle)::DownCast(C1)->Circ(); gp_Circ ci2 = Handle(Geom_Circle)::DownCast(C2)->Circ(); - if (Abs(ci1.Radius() - ci2.Radius()) <= tollin + if (std::abs(ci1.Radius() - ci2.Radius()) <= tollin && ci1.Location().SquareDistance(ci2.Location()) <= tollin * tollin && ci1.Axis().IsParallel(ci2.Axis(), tolang)) { @@ -866,8 +866,8 @@ Standard_Boolean BRepLib_FuseEdges::SameSupport(const TopoDS_Edge& E1, const Top gp_Elips ci1 = Handle(Geom_Ellipse)::DownCast(C1)->Elips(); gp_Elips ci2 = Handle(Geom_Ellipse)::DownCast(C2)->Elips(); - if (Abs(ci1.MajorRadius() - ci2.MajorRadius()) <= tollin - && Abs(ci1.MinorRadius() - ci2.MinorRadius()) <= tollin + if (std::abs(ci1.MajorRadius() - ci2.MajorRadius()) <= tollin + && std::abs(ci1.MinorRadius() - ci2.MinorRadius()) <= tollin && ci1.Location().SquareDistance(ci2.Location()) <= tollin * tollin && ci1.Axis().IsParallel(ci2.Axis(), tolang)) { @@ -903,7 +903,7 @@ Standard_Boolean BRepLib_FuseEdges::SameSupport(const TopoDS_Edge& E1, const Top // we must ensure that before fuse two bsplines, the end of one curve does not // corresponds to the beginning of the second. // we could add a special treatment for periodic bspline. This is not done for the moment. - if (Abs(f2 - l1) > tollin && Abs(f1 - l2) > tollin) + if (std::abs(f2 - l1) > tollin && std::abs(f1 - l2) > tollin) { return Standard_False; } @@ -950,7 +950,7 @@ Standard_Boolean BRepLib_FuseEdges::SameSupport(const TopoDS_Edge& E1, const Top { return Standard_False; } - if (Abs(M1(k) - M2(k)) > tollin) + if (std::abs(M1(k) - M2(k)) > tollin) { return Standard_False; } @@ -979,7 +979,7 @@ Standard_Boolean BRepLib_FuseEdges::SameSupport(const TopoDS_Edge& E1, const Top for (Standard_Integer w = 1; w <= nbpoles; w++) { - if (Abs(W1(w) - W2(w)) > tollin) + if (std::abs(W1(w) - W2(w)) > tollin) { return Standard_False; } @@ -992,7 +992,7 @@ Standard_Boolean BRepLib_FuseEdges::SameSupport(const TopoDS_Edge& E1, const Top // we must ensure that before fuse two bezier, the end of one curve does not // corresponds to the beginning of the second. - if (Abs(f2 - l1) > tollin && Abs(f1 - l2) > tollin) + if (std::abs(f2 - l1) > tollin && std::abs(f1 - l2) > tollin) { return Standard_False; } @@ -1041,7 +1041,7 @@ Standard_Boolean BRepLib_FuseEdges::SameSupport(const TopoDS_Edge& E1, const Top for (Standard_Integer w = 1; w <= nbpoles; w++) { - if (Abs(W1(w) - W2(w)) > tollin) + if (std::abs(W1(w) - W2(w)) > tollin) { return Standard_False; } @@ -1154,7 +1154,8 @@ Standard_Boolean BRepLib_FuseEdges::UpdatePCurve(const TopoDS_Edge& the // check that new curve 2d is same range Standard_Real first = Curv2d->FirstParameter(); Standard_Real last = Curv2d->LastParameter(); - if (Abs(first - ef) > Precision::PConfusion() || Abs(last - el) > Precision::PConfusion()) + if (std::abs(first - ef) > Precision::PConfusion() + || std::abs(last - el) > Precision::PConfusion()) { Handle(Geom2d_BSplineCurve) bc = Handle(Geom2d_BSplineCurve)::DownCast(Curv2d); TColStd_Array1OfReal Knots(1, bc->NbKnots()); diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_MakeEdge.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_MakeEdge.cxx index c89d9ffb04..7527899aad 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_MakeEdge.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_MakeEdge.cxx @@ -696,7 +696,7 @@ void BRepLib_MakeEdge::Init(const Handle(Geom_Curve)& CC, myError = BRepLib_DifferentPointsOnClosedCurve; return; } - else if (P1.Distance(BRep_Tool::Pnt(V1)) > Max(preci, BRep_Tool::Tolerance(V1))) + else if (P1.Distance(BRep_Tool::Pnt(V1)) > std::max(preci, BRep_Tool::Tolerance(V1))) { myError = BRepLib_DifferentPointsOnClosedCurve; return; @@ -727,7 +727,7 @@ void BRepLib_MakeEdge::Init(const Handle(Geom_Curve)& CC, { B.MakeVertex(V1, P1, preci); } - else if (P1.Distance(BRep_Tool::Pnt(V1)) > Max(preci, BRep_Tool::Tolerance(V1))) + else if (P1.Distance(BRep_Tool::Pnt(V1)) > std::max(preci, BRep_Tool::Tolerance(V1))) { myError = BRepLib_DifferentsPointAndParameter; return; @@ -748,7 +748,7 @@ void BRepLib_MakeEdge::Init(const Handle(Geom_Curve)& CC, { B.MakeVertex(V2, P2, preci); } - else if (P2.Distance(BRep_Tool::Pnt(V2)) > Max(preci, BRep_Tool::Tolerance(V2))) + else if (P2.Distance(BRep_Tool::Pnt(V2)) > std::max(preci, BRep_Tool::Tolerance(V2))) { myError = BRepLib_DifferentsPointAndParameter; return; @@ -978,7 +978,7 @@ void BRepLib_MakeEdge::Init(const Handle(Geom2d_Curve)& CC, myError = BRepLib_DifferentPointsOnClosedCurve; return; } - else if (P1.Distance(BRep_Tool::Pnt(V1)) > Max(preci, BRep_Tool::Tolerance(V1))) + else if (P1.Distance(BRep_Tool::Pnt(V1)) > std::max(preci, BRep_Tool::Tolerance(V1))) { myError = BRepLib_DifferentPointsOnClosedCurve; return; @@ -1003,7 +1003,7 @@ void BRepLib_MakeEdge::Init(const Handle(Geom2d_Curve)& CC, { B.MakeVertex(V1, P1, preci); } - else if (P1.Distance(BRep_Tool::Pnt(V1)) > Max(preci, BRep_Tool::Tolerance(V1))) + else if (P1.Distance(BRep_Tool::Pnt(V1)) > std::max(preci, BRep_Tool::Tolerance(V1))) { myError = BRepLib_DifferentsPointAndParameter; return; @@ -1024,7 +1024,7 @@ void BRepLib_MakeEdge::Init(const Handle(Geom2d_Curve)& CC, { B.MakeVertex(V2, P2, preci); } - else if (P2.Distance(BRep_Tool::Pnt(V2)) > Max(preci, BRep_Tool::Tolerance(V2))) + else if (P2.Distance(BRep_Tool::Pnt(V2)) > std::max(preci, BRep_Tool::Tolerance(V2))) { myError = BRepLib_DifferentsPointAndParameter; return; diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_MakeFace.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_MakeFace.cxx index a62e9987a0..9c6ccff0e7 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_MakeFace.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_MakeFace.cxx @@ -201,7 +201,7 @@ BRepLib_MakeFace::BRepLib_MakeFace(const TopoDS_Wire& W, const Standard_Boolean BRep_Builder B; myError = BRepLib_FaceDone; - Standard_Real tol = Max(1.2 * FS.ToleranceReached(), FS.Tolerance()); + Standard_Real tol = std::max(1.2 * FS.ToleranceReached(), FS.Tolerance()); B.MakeFace(TopoDS::Face(myShape), FS.Surface(), FS.Location(), tol); @@ -399,7 +399,7 @@ Standard_Boolean BRepLib_MakeFace::IsDegenerated(const Handle(Geom_Curve)& theCu gp_Circ Circ = AC.Circle(); if (Circ.Radius() > theMaxTol) return Standard_False; - theActTol = Max(Circ.Radius(), aConfusion); + theActTol = std::max(Circ.Radius(), aConfusion); return Standard_True; } else if (Type == GeomAbs_BSplineCurve) @@ -418,7 +418,7 @@ Standard_Boolean BRepLib_MakeFace::IsDegenerated(const Handle(Geom_Curve)& theCu if (aPoleDist2 > aMaxPoleDist2) aMaxPoleDist2 = aPoleDist2; } - theActTol = Max(1.000001 * Sqrt(aMaxPoleDist2), aConfusion); + theActTol = std::max(1.000001 * std::sqrt(aMaxPoleDist2), aConfusion); return Standard_True; } else if (Type == GeomAbs_BezierCurve) @@ -437,7 +437,7 @@ Standard_Boolean BRepLib_MakeFace::IsDegenerated(const Handle(Geom_Curve)& theCu if (aPoleDist2 > aMaxPoleDist2) aMaxPoleDist2 = aPoleDist2; } - theActTol = Max(1.000001 * Sqrt(aMaxPoleDist2), aConfusion); + theActTol = std::max(1.000001 * std::sqrt(aMaxPoleDist2), aConfusion); return Standard_True; } @@ -534,10 +534,10 @@ void BRepLib_MakeFace::Init(const Handle(Geom_Surface)& SS, // closed flag Standard_Boolean uclosed = - S->IsUClosed() && Abs(UMin - umin) < epsilon && Abs(UMax - umax) < epsilon; + S->IsUClosed() && std::abs(UMin - umin) < epsilon && std::abs(UMax - umax) < epsilon; Standard_Boolean vclosed = - S->IsVClosed() && Abs(VMin - vmin) < epsilon && Abs(VMax - vmax) < epsilon; + S->IsVClosed() && std::abs(VMin - vmin) < epsilon && std::abs(VMax - vmax) < epsilon; // compute 3d curves and degenerate flag Standard_Real maxTol = TolDegen; @@ -576,16 +576,16 @@ void BRepLib_MakeFace::Init(const Handle(Geom_Surface)& SS, if (!umininf) { if (!vmininf) - B.MakeVertex(V00, S->Value(UMin, VMin), Max(uminTol, vminTol)); + B.MakeVertex(V00, S->Value(UMin, VMin), std::max(uminTol, vminTol)); if (!vmaxinf) - B.MakeVertex(V01, S->Value(UMin, VMax), Max(uminTol, vmaxTol)); + B.MakeVertex(V01, S->Value(UMin, VMax), std::max(uminTol, vmaxTol)); } if (!umaxinf) { if (!vmininf) - B.MakeVertex(V10, S->Value(UMax, VMin), Max(umaxTol, vminTol)); + B.MakeVertex(V10, S->Value(UMax, VMin), std::max(umaxTol, vminTol)); if (!vmaxinf) - B.MakeVertex(V11, S->Value(UMax, VMax), Max(umaxTol, vmaxTol)); + B.MakeVertex(V11, S->Value(UMax, VMax), std::max(umaxTol, vmaxTol)); } if (uclosed) @@ -634,7 +634,7 @@ void BRepLib_MakeFace::Init(const Handle(Geom_Surface)& SS, else B.MakeEdge(eumin); if (uclosed) - B.UpdateEdge(eumin, Lumax, Lumin, F, Max(uminTol, umaxTol)); + B.UpdateEdge(eumin, Lumax, Lumin, F, std::max(uminTol, umaxTol)); else B.UpdateEdge(eumin, Lumin, F, uminTol); B.Degenerated(eumin, Dumin); @@ -684,7 +684,7 @@ void BRepLib_MakeFace::Init(const Handle(Geom_Surface)& SS, else B.MakeEdge(evmin); if (vclosed) - B.UpdateEdge(evmin, Lvmin, Lvmax, F, Max(vminTol, vmaxTol)); + B.UpdateEdge(evmin, Lvmin, Lvmax, F, std::max(vminTol, vmaxTol)); else B.UpdateEdge(evmin, Lvmin, F, vminTol); B.Degenerated(evmin, Dvmin); diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_PointCloudShape.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_PointCloudShape.cxx index de4197b16f..5f350aaa2a 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_PointCloudShape.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_PointCloudShape.cxx @@ -65,7 +65,7 @@ Standard_Integer BRepLib_PointCloudShape::NbPointsByDensity(const Standard_Real { Standard_Real anArea = faceArea(aExpF.Current()); - Standard_Integer aNbPnts = Max((Standard_Integer)std::ceil(anArea / theDensity), 1); + Standard_Integer aNbPnts = std::max((Standard_Integer)std::ceil(anArea / theDensity), 1); myFacePoints.Bind(aExpF.Current(), aNbPnts); aNbPoints += aNbPnts; } diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_ValidateEdge.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_ValidateEdge.cxx index ec34707016..eba1d5568c 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_ValidateEdge.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepLib/BRepLib_ValidateEdge.cxx @@ -111,8 +111,9 @@ void BRepLib_ValidateEdge::processApprox() Standard_Integer aControlPointsNumber = (myControlPointsNumber < 1) ? 1 : myControlPointsNumber; Standard_Boolean anIsProjection = - (!mySameParameter || Abs(anOtherFirstParam - aReferenceFirstParam) > Precision::PConfusion() - || Abs(anOtherLastParam - aReferenceLastParam) > Precision::PConfusion()); + (!mySameParameter + || std::abs(anOtherFirstParam - aReferenceFirstParam) > Precision::PConfusion() + || std::abs(anOtherLastParam - aReferenceLastParam) > Precision::PConfusion()); if (!anIsProjection) { @@ -131,7 +132,7 @@ void BRepLib_ValidateEdge::processApprox() // Stop process for best performance if (myExitIfToleranceExceeded && aMaxSquareDistance > aSquareToleranceForChecking) { - myCalculatedDistance = Sqrt(aMaxSquareDistance); + myCalculatedDistance = std::sqrt(aMaxSquareDistance); return; } } @@ -147,7 +148,7 @@ void BRepLib_ValidateEdge::processApprox() } if (myExitIfToleranceExceeded && aMaxSquareDistance > aSquareToleranceForChecking) { - myCalculatedDistance = Sqrt(aMaxSquareDistance); + myCalculatedDistance = std::sqrt(aMaxSquareDistance); return; } @@ -160,7 +161,7 @@ void BRepLib_ValidateEdge::processApprox() } if (myExitIfToleranceExceeded && aMaxSquareDistance > aSquareToleranceForChecking) { - myCalculatedDistance = Sqrt(aMaxSquareDistance); + myCalculatedDistance = std::sqrt(aMaxSquareDistance); return; } @@ -193,7 +194,7 @@ void BRepLib_ValidateEdge::processApprox() } if (myExitIfToleranceExceeded && aMaxSquareDistance > aSquareToleranceForChecking) { - myCalculatedDistance = Sqrt(aMaxSquareDistance); + myCalculatedDistance = std::sqrt(aMaxSquareDistance); return; } } @@ -213,7 +214,7 @@ void BRepLib_ValidateEdge::processApprox() } if (myExitIfToleranceExceeded && aMaxSquareDistance > aSquareToleranceForChecking) { - myCalculatedDistance = Sqrt(aMaxSquareDistance); + myCalculatedDistance = std::sqrt(aMaxSquareDistance); return; } } @@ -225,7 +226,7 @@ void BRepLib_ValidateEdge::processApprox() } } } - myCalculatedDistance = Sqrt(aMaxSquareDistance); + myCalculatedDistance = std::sqrt(aMaxSquareDistance); } //================================================================================================= diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepMAT2d/BRepMAT2d_LinkTopoBilo.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepMAT2d/BRepMAT2d_LinkTopoBilo.cxx index 82e7a78b22..51695cd22c 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepMAT2d/BRepMAT2d_LinkTopoBilo.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepMAT2d/BRepMAT2d_LinkTopoBilo.cxx @@ -165,7 +165,7 @@ void BRepMAT2d_LinkTopoBilo::LinkToWire(const TopoDS_Wire& W, BE = BiLo.Graph()->BasicElt(Ite.Key()); Type = BiLo.GeomElt(BE)->DynamicType(); KC = Ite.Value(); - S = TopoSeq.Value(Abs(KC)); + S = TopoSeq.Value(std::abs(KC)); if (Type == STANDARD_TYPE(Geom2d_CartesianPoint)) { diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx index 26a8e7866c..209dbef273 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx @@ -141,7 +141,7 @@ BRepTopAdaptor_FClass2d::BRepTopAdaptor_FClass2d(const TopoDS_Face& aFace, if (BRep_Tool::CurveOnSurface(edge, Face, pfbid, plbid).IsNull()) return; - if (Abs(plbid - pfbid) < 1.e-9) + if (std::abs(plbid - pfbid) < 1.e-9) continue; Standard_Boolean degenerated = Standard_False; @@ -244,8 +244,8 @@ BRepTopAdaptor_FClass2d::BRepTopAdaptor_FClass2d(const TopoDS_Face& aFace, gp_Lin2d Lin(SeqPnt2d(ii - 2), gp_Dir2d(gp_Vec2d(SeqPnt2d(ii - 2), SeqPnt2d(ii)))); Standard_Real ul = ElCLib::Parameter(Lin, SeqPnt2d(ii - 1)); gp_Pnt2d Pp = ElCLib::Value(ul, Lin); - Standard_Real dU = Abs(Pp.X() - SeqPnt2d(ii - 1).X()); - Standard_Real dV = Abs(Pp.Y() - SeqPnt2d(ii - 1).Y()); + Standard_Real dU = std::abs(Pp.X() - SeqPnt2d(ii - 1).X()); + Standard_Real dV = std::abs(Pp.Y() - SeqPnt2d(ii - 1).Y()); //-- printf(" (du=%7.5g dv=%7.5g)",dU,dV); if (dU > FlecheU) FlecheU = dU; @@ -310,9 +310,9 @@ BRepTopAdaptor_FClass2d::BRepTopAdaptor_FClass2d(const TopoDS_Face& aFace, // if(N>1e-16){ Standard_Real a=A.Angle(B); angle+=a; } } - Standard_Real anExpThick = Max(2. * Abs(square) / aPer, 1e-7); - Standard_Real aDefl = Max(FlecheU, FlecheV); - Standard_Real aDiscrDefl = Min(aDefl * 0.1, anExpThick * 10.); + Standard_Real anExpThick = std::max(2. * std::abs(square) / aPer, 1e-7); + Standard_Real aDefl = std::max(FlecheU, FlecheV); + Standard_Real aDiscrDefl = std::min(aDefl * 0.1, anExpThick * 10.); while (aDefl > anExpThick && aDiscrDefl > 1e-7) { // Deflection of the polygon is too much for this ratio of area and perimeter, @@ -331,7 +331,7 @@ BRepTopAdaptor_FClass2d::BRepTopAdaptor_FClass2d(const TopoDS_Face& aFace, { Standard_Real pfbid, plbid; BRep_Tool::Range(edge, Face, pfbid, plbid); - if (Abs(plbid - pfbid) < 1.e-9) + if (std::abs(plbid - pfbid) < 1.e-9) continue; BRepAdaptor_Curve2d C(edge, Face); GCPnts_QuasiUniformDeflection aDiscr(C, aDiscrDefl); @@ -358,8 +358,8 @@ BRepTopAdaptor_FClass2d::BRepTopAdaptor_FClass2d(const TopoDS_Face& aFace, gp_Lin2d Lin(SeqPnt2d(ii - 2), gp_Dir2d(gp_Vec2d(SeqPnt2d(ii - 2), SeqPnt2d(ii)))); Standard_Real ul = ElCLib::Parameter(Lin, SeqPnt2d(ii - 1)); gp_Pnt2d Pp = ElCLib::Value(ul, Lin); - Standard_Real dU = Abs(Pp.X() - SeqPnt2d(ii - 1).X()); - Standard_Real dV = Abs(Pp.Y() - SeqPnt2d(ii - 1).Y()); + Standard_Real dU = std::abs(Pp.X() - SeqPnt2d(ii - 1).X()); + Standard_Real dV = std::abs(Pp.Y() - SeqPnt2d(ii - 1).Y()); if (dU > FlecheU) FlecheU = dU; if (dV > FlecheV) @@ -386,14 +386,14 @@ BRepTopAdaptor_FClass2d::BRepTopAdaptor_FClass2d(const TopoDS_Face& aFace, aPer += (PClass(im0).XY() - PClass(im1).XY()).Modulus(); } - anExpThick = Max(2. * Abs(square) / aPer, 1e-7); - aDefl = Max(FlecheU, FlecheV); - aDiscrDefl = Min(aDiscrDefl * 0.1, anExpThick * 10.); + anExpThick = std::max(2. * std::abs(square) / aPer, 1e-7); + aDefl = std::max(FlecheU, FlecheV); + aDiscrDefl = std::min(aDiscrDefl * 0.1, anExpThick * 10.); } //-- FlecheU*=10.0; //-- FlecheV*=10.0; - if (aNbE == 1 && FlecheU < eps && FlecheV < eps && Abs(square) < eps) + if (aNbE == 1 && FlecheU < eps && FlecheV < eps && std::abs(square) < eps) { TabOrien.Append(1); } diff --git a/src/ModelingAlgorithms/TKTopAlgo/BRepTopAdaptor/BRepTopAdaptor_HVertex.cxx b/src/ModelingAlgorithms/TKTopAlgo/BRepTopAdaptor/BRepTopAdaptor_HVertex.cxx index 3f5021cccc..cb2adc1726 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/BRepTopAdaptor/BRepTopAdaptor_HVertex.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/BRepTopAdaptor/BRepTopAdaptor_HVertex.cxx @@ -65,7 +65,7 @@ Standard_Real BRepTopAdaptor_HVertex::Resolution(const Handle(Adaptor2d_Curve2d) Standard_Real VRes = S.VResolution(tv); Standard_Real tURes = C->Resolution(URes); Standard_Real tVRes = C->Resolution(VRes); - Standard_Real ResUV1 = Max(tURes, tVRes); + Standard_Real ResUV1 = std::max(tURes, tVRes); if (mag < 1e-12) { @@ -116,7 +116,7 @@ Standard_Real BRepTopAdaptor_HVertex::Resolution(const Handle(Adaptor2d_Curve2d) S.D1(p2d.X(), p2d.Y(), P1, DU, DV); DC.SetLinearForm(v2d.X(), DU, v2d.Y(), DV); Dist1 = P.Distance(P1); - if (Abs(Dist1 - tv) < Abs(Dist - tv)) + if (std::abs(Dist1 - tv) < std::abs(Dist - tv)) { // Take the result of interpolation ResUV = tv / Dist; @@ -139,7 +139,7 @@ Standard_Real BRepTopAdaptor_HVertex::Resolution(const Handle(Adaptor2d_Curve2d) C->D0(pp, p2d); S.D0(p2d.X(), p2d.Y(), P1); Dist1 = P.Distance(P1); - if (Abs(Dist1 - tv) < Abs(Dist - tv)) + if (std::abs(Dist1 - tv) < std::abs(Dist - tv)) { // Take the new estimation ResUV = tv / mag; @@ -147,7 +147,7 @@ Standard_Real BRepTopAdaptor_HVertex::Resolution(const Handle(Adaptor2d_Curve2d) } } - return Min(ResUV, ResUV1); + return std::min(ResUV, ResUV1); } TopAbs_Orientation BRepTopAdaptor_HVertex::Orientation() diff --git a/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_Bisec.cxx b/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_Bisec.cxx index f66cd564bd..87afe009a3 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_Bisec.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_Bisec.cxx @@ -169,7 +169,7 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve, gp_Dir2d Sd(asecondvector); // if (Fd.Dot(Sd) < Precision::Angular() - 1.) { // if (Fd.Dot(Sd) < 10*Precision::Angular() - 1.) //patch - if (Fd.Dot(Sd) < Sqrt(2. * Precision::Angular()) - 1.) + if (Fd.Dot(Sd) < std::sqrt(2. * Precision::Angular()) - 1.) IsLine = Standard_True; } if (IsLine) @@ -218,7 +218,7 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve, { gp_Dir2d dir1(afirstvector), dir2(asecondvector); Nx = -dir1.X() - dir2.X(), Ny = -dir1.Y() - dir2.Y(); - if (Abs(Nx) <= gp::Resolution() && Abs(Ny) <= gp::Resolution()) + if (std::abs(Nx) <= gp::Resolution() && std::abs(Ny) <= gp::Resolution()) { Nx = -afirstvector.Y(); Ny = afirstvector.X(); @@ -245,8 +245,8 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve, } } } - UFirst = Max(UFirst, Bis->FirstParameter()); - ULast = Min(ULast, Bis->LastParameter()); + UFirst = std::max(UFirst, Bis->FirstParameter()); + ULast = std::min(ULast, Bis->LastParameter()); thebisector = new Geom2d_TrimmedCurve(Bis, UFirst, ULast); #ifdef DRAW if (Affich) @@ -354,7 +354,7 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Curve)& afirstcurve, { gp_Dir2d dir1(afirstvector), dir2(asecondvector); Standard_Real Nx = -dir1.X() - dir2.X(), Ny = -dir1.Y() - dir2.Y(); - if (Abs(Nx) <= gp::Resolution() && Abs(Ny) <= gp::Resolution()) + if (std::abs(Nx) <= gp::Resolution() && std::abs(Ny) <= gp::Resolution()) { Nx = -afirstvector.Y(); Ny = afirstvector.X(); @@ -507,7 +507,7 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Point)& afirstpoint, { gp_Dir2d dir1(afirstvector), dir2(asecondvector); Standard_Real Nx = -dir1.X() - dir2.X(), Ny = -dir1.Y() - dir2.Y(); - if (Abs(Nx) <= gp::Resolution() && Abs(Ny) <= gp::Resolution()) + if (std::abs(Nx) <= gp::Resolution() && std::abs(Ny) <= gp::Resolution()) { Nx = -afirstvector.Y(); Ny = afirstvector.X(); @@ -547,8 +547,8 @@ void Bisector_Bisec::Perform(const Handle(Geom2d_Point)& afirstpoint, } } - UFirst = Max(UFirst, Bis->FirstParameter()); - ULast = Min(ULast, Bis->LastParameter()); + UFirst = std::max(UFirst, Bis->FirstParameter()); + ULast = std::min(ULast, Bis->LastParameter()); thebisector = new Geom2d_TrimmedCurve(Bis, UFirst, ULast); #ifdef DRAW @@ -638,7 +638,7 @@ static void ReplaceByLineIfIsToSmall(Handle(Bisector_Curve)& Bis, Standard_Real& ULast) { - if (Abs(ULast - UFirst) > 2. * Precision::PConfusion() * 10.) + if (std::abs(ULast - UFirst) > 2. * Precision::PConfusion() * 10.) return; // patch gp_Pnt2d PF = Bis->Value(UFirst); @@ -679,7 +679,7 @@ static Standard_Boolean IsMaxRC(const Handle(Geom2d_Curve)& C, Standard_Real U, } else { - KF = Abs(D1 ^ D2) / (Norm2 * sqrt(Norm2)); + KF = std::abs(D1 ^ D2) / (Norm2 * sqrt(Norm2)); } C->D2(UL, P, D1, D2); @@ -690,7 +690,7 @@ static Standard_Boolean IsMaxRC(const Handle(Geom2d_Curve)& C, Standard_Real U, } else { - KL = Abs(D1 ^ D2) / (Norm2 * sqrt(Norm2)); + KL = std::abs(D1 ^ D2) / (Norm2 * sqrt(Norm2)); } Standard_Boolean IsMax = Standard_False; diff --git a/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_BisecAna.cxx b/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_BisecAna.cxx index 2edde16625..f4ad99ee96 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_BisecAna.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_BisecAna.cxx @@ -135,12 +135,12 @@ Standard_Real Bisector_BisecAna::Distance(const gp_Pnt2d& apoint, // the status is determined only in case on curve ie: // tangent to the bissectrice is bisectrice of two vectors. Standard_Real SinPlat = 1.e-3; - if (Abs(afirstdir ^ aseconddir) < SinPlat) + if (std::abs(afirstdir ^ aseconddir) < SinPlat) { // flat if (afirstdir * aseconddir >= 0.0) { // tangent mixed // correct if the scalar product is close to 1. - if (Abs(tangdir * afirstdir) < 0.5) + if (std::abs(tangdir * afirstdir) < 0.5) { astatus = Standard_False; } @@ -148,7 +148,7 @@ Standard_Real Bisector_BisecAna::Distance(const gp_Pnt2d& apoint, else { // opposed tangents. // correct if the scalar product is close to 0. - if (Abs(tangdir * afirstdir) > 0.5) + if (std::abs(tangdir * afirstdir) > 0.5) { astatus = Standard_False; } @@ -345,7 +345,7 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve, // Particular case when two circles are mixed. //----------------------------------------------------- if (circle1.Location().IsEqual(circle2.Location(), PreConf) - && (Abs(radius1 - radius2) <= PreConf)) + && (std::abs(radius1 - radius2) <= PreConf)) { gp_Pnt2d P1 = afirstcurve->Value(afirstcurve->LastParameter()); gp_Pnt2d P2 = asecondcurve->Value(asecondcurve->FirstParameter()); @@ -427,8 +427,8 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve, Standard_Boolean CirclesTangent = Standard_False; // Modified by Sergey KHROMOV - Thu Oct 31 12:42:21 2002 End - // if ( oncurve && Abs(D1) < PreConf) { - if (oncurve && Abs(D1) < PreConf && tan1.IsParallel(tan2, 1.e-8)) + // if ( oncurve && std::abs(D1) < PreConf) { + if (oncurve && std::abs(D1) < PreConf && tan1.IsParallel(tan2, 1.e-8)) { // Modified by Sergey KHROMOV - Thu Oct 31 12:42:22 2002 Begin // C2 included in C1 and tangent. @@ -440,8 +440,8 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve, { D1 = 0.5 * (radius1 - EntreAxe + radius2); // Modified by Sergey KHROMOV - Thu Oct 31 12:44:24 2002 Begin - // if (oncurve && Abs(D1) < PreConf) { - if (oncurve && Abs(D1) < PreConf && tan1.IsParallel(tan2, 1.e-8)) + // if (oncurve && std::abs(D1) < PreConf) { + if (oncurve && std::abs(D1) < PreConf && tan1.IsParallel(tan2, 1.e-8)) { // Modified by Sergey KHROMOV - Thu Oct 31 12:44:25 2002 End // C2 and C1 tangent and disconnected. @@ -562,8 +562,8 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve, // flat and not turn back. Standard_Real Par1 = ElCLib::Parameter(gpline, circle1.Location()); Standard_Real Par2 = ElCLib::Parameter(gpline, circle2.Location()); - Standard_Real MinPar = Min(Par1, Par2); - Standard_Real MaxPar = Max(Par1, Par2); + Standard_Real MinPar = std::min(Par1, Par2); + Standard_Real MaxPar = std::max(Par1, Par2); if (!thesense) { @@ -640,8 +640,8 @@ void Bisector_BisecAna::Perform(const Handle(Geom2d_Curve)& afirstcurve, Standard_Real radius1 = circle1.Radius(); Standard_Real D1 = (line2.Distance(circle1.Location()) - radius1); // Modified by Sergey KHROMOV - Wed Oct 30 14:48:43 2002 Begin - // if (Abs(D1) < PreConf) { - if (Abs(D1) < PreConf && tan1.IsParallel(tan2, 1.e-8)) + // if (std::abs(D1) < PreConf) { + if (std::abs(D1) < PreConf && tan1.IsParallel(tan2, 1.e-8)) { // Modified by Sergey KHROMOV - Wed Oct 30 14:48:44 2002 End circle1.SetRadius(radius1 + D1); @@ -1346,8 +1346,8 @@ void Bisector_BisecAna::SetTrim(const Handle(Geom2d_Curve)&) if (Type1 == STANDARD_TYPE(Geom2d_Parabola)) { gpParabola = Handle(Geom2d_Parabola)::DownCast(BasisCurve)->Parab2d(); Focus = gpParabola.Focal(); - Standard_Real Val1 = Sqrt(Limit*Focus); - Standard_Real Val2 = Sqrt(Limit*Limit); + Standard_Real Val1 = std::sqrt(Limit*Focus); + Standard_Real Val2 = std::sqrt(Limit*Limit); UB2 = (Val1 <= Val2 ? Val1:Val2); } else if (Type1 == STANDARD_TYPE(Geom2d_Hyperbola)) { @@ -1356,8 +1356,8 @@ void Bisector_BisecAna::SetTrim(const Handle(Geom2d_Curve)&) Standard_Real Minr = gpHyperbola.MinorRadius(); Standard_Real Valu1 = Limit/Majr; Standard_Real Valu2 = Limit/Minr; - Standard_Real Val1 = Log(Valu1+Sqrt(Valu1*Valu1-1)); - Standard_Real Val2 = Log(Valu2+Sqrt(Valu2*Valu2+1)); + Standard_Real Val1 = Log(Valu1+std::sqrt(Valu1*Valu1-1)); + Standard_Real Val2 = Log(Valu2+std::sqrt(Valu2*Valu2+1)); UB2 = (Val1 <= Val2 ? Val1:Val2); } } diff --git a/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_BisecCC.cxx b/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_BisecCC.cxx index 8e80f03b81..b6041a2d4f 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_BisecCC.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_BisecCC.cxx @@ -631,7 +631,7 @@ gp_Pnt2d Bisector_BisecCC::ValueAndDist(const Standard_Real U, Standard_Real VMax = myPolygon.Value(IntervalIndex + 1).ParamOnC2(); Standard_Real Alpha, VInit; - if (Abs(UMax - UMin) < gp::Resolution()) + if (std::abs(UMax - UMin) < gp::Resolution()) { VInit = VMin; } @@ -642,8 +642,8 @@ gp_Pnt2d Bisector_BisecCC::ValueAndDist(const Standard_Real U, } U1 = LinkBisCurve(U); - Standard_Real VTemp = Min(VMin, VMax); - VMax = Max(VMin, VMax); + Standard_Real VTemp = std::min(VMin, VMax); + VMax = std::max(VMin, VMax); VMin = VTemp; Standard_Boolean Valid = Standard_True; //--------------------------------------------------------------- @@ -665,7 +665,7 @@ gp_Pnt2d Bisector_BisecCC::ValueAndDist(const Standard_Real U, Bisector_FunctionH H(curve2, P1, sign1 * sign2 * T1); Standard_Real FInit; H.Value(VInit, FInit); - if (Abs(FInit) < EpsH) + if (std::abs(FInit) < EpsH) { U2 = VInit; } @@ -845,13 +845,13 @@ gp_Pnt2d Bisector_BisecCC::ValueByInt(const Standard_Real U, } } - if (Abs(ULastOnC2 - UFirstOnC2) < Precision::PConfusion() / 100.) + if (std::abs(ULastOnC2 - UFirstOnC2) < Precision::PConfusion() / 100.) { Dist = Precision::Infinite(); return P1; } - DiscretPar(Abs(ULastOnC2 - UFirstOnC2), EpsH, EpsMax, 2, 20, EpsX, NbSamples); + DiscretPar(std::abs(ULastOnC2 - UFirstOnC2), EpsH, EpsMax, 2, 20, EpsX, NbSamples); Bisector_FunctionH H(curve2, P1, sign1 * sign2 * Tan1); math_FunctionRoots SolRoot(H, UFirstOnC2, ULastOnC2, NbSamples, EpsX, EpsH, EpsH); @@ -1170,7 +1170,7 @@ void Bisector_BisecCC::Values(const Standard_Real U, gp_Vec2d dFdu = Tu - (dAdu / B - dBdu * A / BB) * Nor - (A / B) * Nu; gp_Vec2d dFdv = (-dAdv / B + dBdv * A / BB) * Nor; - if (Abs(dHdv) > gp::Resolution()) + if (std::abs(dHdv) > gp::Resolution()) { V1 = dFdu + dFdv * (-dHdu / dHdv); } @@ -1430,7 +1430,7 @@ static Standard_Boolean PointByInt(const Handle(Geom2d_Curve)& CA, Standard_Real K1 = Curvature(CA, UOnA, Precision::Confusion()); if (K1 != 0.) { - if (Dist > Abs(1 / K1)) + if (Dist > std::abs(1 / K1)) YaSol = Standard_False; } } @@ -1441,7 +1441,7 @@ static Standard_Boolean PointByInt(const Handle(Geom2d_Curve)& CA, Standard_Real K2 = Curvature(CB, UOnB, Precision::Confusion()); if (K2 != 0.) { - if (Dist > Abs(1 / K2)) + if (Dist > std::abs(1 / K2)) YaSol = Standard_False; } } @@ -1756,14 +1756,14 @@ static Standard_Boolean ProjOnCurve(const gp_Pnt2d& P, gp_Vec2d PPF(PF.X() - P.X(), PF.Y() - P.Y()); TF.Normalize(); - if (Abs(PPF.Dot(TF)) < Precision::Confusion()) + if (std::abs(PPF.Dot(TF)) < Precision::Confusion()) { theParam = C->FirstParameter(); return Standard_True; } gp_Vec2d PPL(PL.X() - P.X(), PL.Y() - P.Y()); TL.Normalize(); - if (Abs(PPL.Dot(TL)) < Precision::Confusion()) + if (std::abs(PPL.Dot(TL)) < Precision::Confusion()) { theParam = C->LastParameter(); return Standard_True; @@ -1866,7 +1866,7 @@ void Bisector_BisecCC::ComputePointEnd() TF.Normalize(); if (KC != 0.) { - RC = Abs(1 / KC); + RC = std::abs(1 / KC); } else { @@ -1892,7 +1892,7 @@ static Standard_Boolean DiscretPar(const Standard_Real DU, return Standard_False; } - Eps = Min(EpsMax, DU / NbMax); + Eps = std::min(EpsMax, DU / NbMax); if (Eps < EpsMin) { diff --git a/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_BisecPC.cxx b/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_BisecPC.cxx index b905b0d9d4..2b2ae0984c 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_BisecPC.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_BisecPC.cxx @@ -394,7 +394,7 @@ void Bisector_BisecPC::Values(const Standard_Real U, Standard_Real NorPPC = Nor.Dot(aPPC); Standard_Real A1; - if (Abs(NorPPC) > gp::Resolution() && (NorPPC * sign) < 0.) + if (std::abs(NorPPC) > gp::Resolution() && (NorPPC * sign) < 0.) { A1 = 0.5 * SquarePPC / NorPPC; P.SetCoord(PC.X() - Nor.X() * A1, PC.Y() - Nor.Y() * A1); @@ -499,7 +499,7 @@ Standard_Real Bisector_BisecPC::Distance(const Standard_Real U) const } } - if (Abs(Prosca) < Precision::Confusion() || (Prosca * sign) > 0.) + if (std::abs(Prosca) < Precision::Confusion() || (Prosca * sign) > 0.) { return Precision::Infinite(); } diff --git a/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_FunctionInter.cxx b/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_FunctionInter.cxx index 049cf433bb..abe48ee55d 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_FunctionInter.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_FunctionInter.cxx @@ -87,7 +87,7 @@ Standard_Boolean Bisector_FunctionInter::Values(const Standard_Real X, F1 = PC.Distance(PB1); F2 = PC.Distance(PB2); F = F1 - F2; - if (Abs(F1) < gp::Resolution()) + if (std::abs(F1) < gp::Resolution()) { DF1 = Precision::Infinite(); } @@ -95,7 +95,7 @@ Standard_Boolean Bisector_FunctionInter::Values(const Standard_Real X, { DF1 = ((PC.X() - PB1.X()) * (TC.X() - TB1.X()) + (PC.Y() - PB1.Y()) * (TC.Y() - TB1.Y())) / F1; } - if (Abs(F2) < gp::Resolution()) + if (std::abs(F2) < gp::Resolution()) { DF2 = Precision::Infinite(); } diff --git a/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_Inter.cxx b/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_Inter.cxx index b99ab15a7d..5c4bb36e4f 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_Inter.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_Inter.cxx @@ -134,8 +134,8 @@ void Bisector_Inter::Perform(const Bisector_Bisec& C1, UMax = Bis1->IntervalLast(IB1); if (UMax > MinDomain && UMin < MaxDomain) { - UMin = Max(UMin, MinDomain); - UMax = Min(UMax, MaxDomain); + UMin = std::max(UMin, MinDomain); + UMax = std::min(UMax, MaxDomain); PMin = Bis1->Value(UMin); PMax = Bis1->Value(UMax); SD1[IB1].SetValues(PMin, UMin, D1.FirstTolerance(), PMax, UMax, D1.LastTolerance()); @@ -189,8 +189,8 @@ void Bisector_Inter::Perform(const Bisector_Bisec& C1, UMax = Bis2->IntervalLast(IB2); if (UMax > MinDomain && UMin < MaxDomain) { - UMin = Max(UMin, MinDomain); - UMax = Min(UMax, MaxDomain); + UMin = std::max(UMin, MinDomain); + UMax = std::min(UMax, MaxDomain); PMin = Bis2->Value(UMin); PMax = Bis2->Value(UMax); SD2[IB2].SetValues(PMin, UMin, D2.FirstTolerance(), PMax, UMax, D2.LastTolerance()); @@ -384,8 +384,8 @@ void Bisector_Inter::NeighbourPerform(const Handle(Bisector_BisecCC)& Bis1, (void)P2E; // Calculate the domain of intersection on the guideline. - UMin = Max(D1.FirstParameter(), UMin); - UMax = Min(D1.LastParameter(), UMax); + UMin = std::max(D1.FirstParameter(), UMin); + UMax = std::min(D1.LastParameter(), UMax); done = Standard_True; @@ -430,7 +430,7 @@ void Bisector_Inter::TestBound(const Handle(Geom2d_Line)& Bis1, gp_Pnt2d PF = Bis2->Value(D2.FirstParameter()); gp_Pnt2d PL = Bis2->Value(D2.LastParameter()); // Modified by skv - Mon May 5 14:43:28 2003 OCC616 Begin - // Standard_Real Tol = Min(TolConf,Precision::Confusion()); + // Standard_Real Tol = std::min(TolConf,Precision::Confusion()); // Tol = 10*Tol; Standard_Real Tol = TolConf; // Modified by skv - Mon May 5 14:43:30 2003 OCC616 End diff --git a/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_PolyBis.cxx b/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_PolyBis.cxx index e987ad5ad1..46ca1f6ec4 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_PolyBis.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/Bisector/Bisector_PolyBis.cxx @@ -88,7 +88,7 @@ Standard_Integer Bisector_PolyBis::Interval(const Standard_Real U) const if (dU <= gp::Resolution()) return 1; - Standard_Integer IntU = Standard_Integer(Abs(U - First().ParamOnBis()) / dU); + Standard_Integer IntU = Standard_Integer(std::abs(U - First().ParamOnBis()) / dU); IntU++; if (thePoints[IntU].ParamOnBis() >= U) diff --git a/src/ModelingAlgorithms/TKTopAlgo/IntCurvesFace/IntCurvesFace_Intersector.cxx b/src/ModelingAlgorithms/TKTopAlgo/IntCurvesFace/IntCurvesFace_Intersector.cxx index 10dd865414..d0e87cf840 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/IntCurvesFace/IntCurvesFace_Intersector.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/IntCurvesFace/IntCurvesFace_Intersector.cxx @@ -174,10 +174,10 @@ IntCurvesFace_Intersector::IntCurvesFace_Intersector(const TopoDS_Face& Face if (dU > Precision::Confusion() && dV > Precision::Confusion()) { - if (Max(dU, dV) > Min(dU, dV) * aTresh) + if (std::max(dU, dV) > std::min(dU, dV) * aTresh) { aMinSamples = 10; - nbsu = (Standard_Integer)(Sqrt(dU / dV) * aMaxSamples); + nbsu = (Standard_Integer)(std::sqrt(dU / dV) * aMaxSamples); if (nbsu < aMinSamples) nbsu = aMinSamples; nbsv = aMaxSamples2 / nbsu; @@ -229,13 +229,15 @@ void IntCurvesFace_Intersector::InternalCall(const IntCurveSurface_HInter& HICS, for (; anExp.More(); anExp.Next()) { Standard_Real curtol = BRep_Tool::Tolerance(TopoDS::Edge(anExp.Current())); - mintol3d = Min(mintol3d, curtol); - maxtol3d = Max(maxtol3d, curtol); + mintol3d = std::min(mintol3d, curtol); + maxtol3d = std::max(maxtol3d, curtol); } - Standard_Real minres = Max(Hsurface->UResolution(mintol3d), Hsurface->VResolution(mintol3d)); - Standard_Real maxres = Max(Hsurface->UResolution(maxtol3d), Hsurface->VResolution(maxtol3d)); - mintol2d = Max(minres, Tol); - maxtol2d = Max(maxres, Tol); + Standard_Real minres = + std::max(Hsurface->UResolution(mintol3d), Hsurface->VResolution(mintol3d)); + Standard_Real maxres = + std::max(Hsurface->UResolution(maxtol3d), Hsurface->VResolution(maxtol3d)); + mintol2d = std::max(minres, Tol); + maxtol2d = std::max(maxres, Tol); // Handle(BRepTopAdaptor_TopolTool) anAdditionalTool; for (Standard_Integer index = HICS.NbPoints(); index >= 1; index--) diff --git a/src/ModelingAlgorithms/TKTopAlgo/MAT2d/MAT2d_Circuit.cxx b/src/ModelingAlgorithms/TKTopAlgo/MAT2d/MAT2d_Circuit.cxx index e2a128d258..2d76d44bf1 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/MAT2d/MAT2d_Circuit.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/MAT2d/MAT2d_Circuit.cxx @@ -273,7 +273,7 @@ Standard_Boolean MAT2d_Circuit::IsSharpCorner(const Handle(Geom2d_Geometry)& Geo gp_Pnt2d P1 = C1->Value(MilC1); gp_Pnt2d P2 = C2->Value(MilC2); - D = Min(P1.Distance(P), P2.Distance(P)); + D = std::min(P1.Distance(P), P2.Distance(P)); D /= 10; if (Direction < 0.) @@ -318,7 +318,7 @@ Standard_Boolean MAT2d_Circuit::IsSharpCorner(const Handle(Geom2d_Geometry)& Geo } // end of if (myJoinType == GeomAbs_Arc) else if (myJoinType == GeomAbs_Intersection) { - if (Abs(ProVec) <= TolAng && DotProd < 0) + if (std::abs(ProVec) <= TolAng && DotProd < 0) { while (NbTest <= 10) { @@ -494,7 +494,7 @@ void MAT2d_Circuit::InitOpen(TColGeom2d_SequenceOfGeometry& Line) const for (Standard_Integer i = 2; i <= Line.Length() - 2; i++) { - if (Abs(CrossProd(Line.Value(i), Line.Value(i + 1), DotProd)) > 1.E-8 || DotProd < 0.) + if (std::abs(CrossProd(Line.Value(i), Line.Value(i + 1), DotProd)) > 1.E-8 || DotProd < 0.) { Curve = Handle(Geom2d_TrimmedCurve)::DownCast(Line.Value(i)); Line.InsertAfter(i, new Geom2d_CartesianPoint(Curve->EndPoint())); @@ -908,8 +908,8 @@ void MAT2d_DrawCurve(const Handle(Geom2d_Curve)& aCurve, const Standard_Integer { gpParabola = Handle(Geom2d_Parabola)::DownCast(curve)->Parab2d(); Focus = gpParabola.Focal(); - Standard_Real Val1 = Sqrt(Limit * Focus); - Standard_Real Val2 = Sqrt(Limit * Limit); + Standard_Real Val1 = std::sqrt(Limit * Focus); + Standard_Real Val2 = std::sqrt(Limit * Limit); delta = (Val1 <= Val2 ? Val1 : Val2); } else if (type == STANDARD_TYPE(Geom2d_Hyperbola)) @@ -919,8 +919,8 @@ void MAT2d_DrawCurve(const Handle(Geom2d_Curve)& aCurve, const Standard_Integer Standard_Real Minr = gpHyperbola.MinorRadius(); Standard_Real Valu1 = Limit / Majr; Standard_Real Valu2 = Limit / Minr; - Standard_Real Val1 = Log(Valu1 + Sqrt(Valu1 * Valu1 - 1)); - Standard_Real Val2 = Log(Valu2 + Sqrt(Valu2 * Valu2 + 1)); + Standard_Real Val1 = Log(Valu1 + std::sqrt(Valu1 * Valu1 - 1)); + Standard_Real Val2 = Log(Valu2 + std::sqrt(Valu2 * Valu2 + 1)); delta = (Val1 <= Val2 ? Val1 : Val2); } CurveDraw = diff --git a/src/ModelingAlgorithms/TKTopAlgo/MAT2d/MAT2d_Tool2d.cxx b/src/ModelingAlgorithms/TKTopAlgo/MAT2d/MAT2d_Tool2d.cxx index 7b10679208..5f9a1b9f5f 100644 --- a/src/ModelingAlgorithms/TKTopAlgo/MAT2d/MAT2d_Tool2d.cxx +++ b/src/ModelingAlgorithms/TKTopAlgo/MAT2d/MAT2d_Tool2d.cxx @@ -673,7 +673,7 @@ Standard_Boolean MAT2d_Tool2d::Projection(const Standard_Integer IEdge, Distance = Extremas.SquareDistance(i); } } - Distance = Sqrt(Distance); + Distance = std::sqrt(Distance); } else { @@ -710,7 +710,7 @@ Standard_Boolean MAT2d_Tool2d::IsSameDistance(const Handle(MAT_Bisector)& Bisect if (!isDone2) { Handle(Geom2d_Geometry) Elt = theCircuit->Value(IEdge2); - Standard_Real Tol = Max(Precision::Confusion(), eps * Dist(1)); + Standard_Real Tol = std::max(Precision::Confusion(), eps * Dist(1)); if (CheckEnds(Elt, PCom, Dist(1), Tol)) { Dist(2) = Dist(1); @@ -722,7 +722,7 @@ Standard_Boolean MAT2d_Tool2d::IsSameDistance(const Handle(MAT_Bisector)& Bisect if (isDone2) { Handle(Geom2d_Geometry) Elt = theCircuit->Value(IEdge1); - Standard_Real Tol = Max(Precision::Confusion(), eps * Dist(2)); + Standard_Real Tol = std::max(Precision::Confusion(), eps * Dist(2)); if (CheckEnds(Elt, PCom, Dist(2), Tol)) { Dist(1) = Dist(2); @@ -750,7 +750,7 @@ Standard_Boolean MAT2d_Tool2d::IsSameDistance(const Handle(MAT_Bisector)& Bisect if (!isDone4) { Handle(Geom2d_Geometry) Elt = theCircuit->Value(IEdge4); - Standard_Real Tol = Max(Precision::Confusion(), eps * Dist(3)); + Standard_Real Tol = std::max(Precision::Confusion(), eps * Dist(3)); if (CheckEnds(Elt, PCom, Dist(3), Tol)) { Dist(4) = Dist(3); @@ -762,7 +762,7 @@ Standard_Boolean MAT2d_Tool2d::IsSameDistance(const Handle(MAT_Bisector)& Bisect if (isDone4) { Handle(Geom2d_Geometry) Elt = theCircuit->Value(IEdge3); - Standard_Real Tol = Max(Precision::Confusion(), eps * Dist(4)); + Standard_Real Tol = std::max(Precision::Confusion(), eps * Dist(4)); if (CheckEnds(Elt, PCom, Dist(4), Tol)) { Dist(3) = Dist(4); @@ -793,7 +793,7 @@ Standard_Boolean MAT2d_Tool2d::IsSameDistance(const Handle(MAT_Bisector)& Bisect { if (theJoinType == GeomAbs_Intersection && Precision::IsInfinite(Dist(i))) continue; - if (Abs(Dist(i) - Distance) > EpsDist) + if (std::abs(Dist(i) - Distance) > EpsDist) { Distance = Precision::Infinite(); return Standard_False; @@ -1286,9 +1286,9 @@ Standard_Boolean AreNeighbours(const Standard_Integer IEdge1, const Standard_Integer IEdge2, const Standard_Integer NbEdge) { - if (Abs(IEdge1 - IEdge2) == 1) + if (std::abs(IEdge1 - IEdge2) == 1) return Standard_True; - else if (Abs(IEdge1 - IEdge2) == NbEdge - 1) + else if (std::abs(IEdge1 - IEdge2) == NbEdge - 1) return Standard_True; else return Standard_False; @@ -1358,8 +1358,8 @@ IntRes2d_Domain Domain(const Handle(Geom2d_TrimmedCurve)& Bisector1, const Stand { gpParabola = Handle(Geom2d_Parabola)::DownCast(BasisCurve)->Parab2d(); Focus = gpParabola.Focal(); - Standard_Real Val1 = Sqrt(Limit * Focus); - Standard_Real Val2 = Sqrt(Limit * Limit); + Standard_Real Val1 = std::sqrt(Limit * Focus); + Standard_Real Val2 = std::sqrt(Limit * Limit); Param2 = (Val1 <= Val2 ? Val1 : Val2); } else if (Type1 == STANDARD_TYPE(Geom2d_Hyperbola)) @@ -1369,8 +1369,8 @@ IntRes2d_Domain Domain(const Handle(Geom2d_TrimmedCurve)& Bisector1, const Stand Standard_Real Minr = gpHyperbola.MinorRadius(); Standard_Real Valu1 = Limit / Majr; Standard_Real Valu2 = Limit / Minr; - Standard_Real Val1 = Log(Valu1 + Sqrt(Valu1 * Valu1 - 1)); - Standard_Real Val2 = Log(Valu2 + Sqrt(Valu2 * Valu2 + 1)); + Standard_Real Val1 = std::log(Valu1 + std::sqrt(Valu1 * Valu1 - 1)); + Standard_Real Val2 = std::log(Valu2 + std::sqrt(Valu2 * Valu2 + 1)); Param2 = (Val1 <= Val2 ? Val1 : Val2); } } @@ -1410,9 +1410,9 @@ Standard_Boolean CheckEnds(const Handle(Geom2d_Geometry)& Elt, gp_Pnt2d aPl = Curve->EndPoint(); Standard_Real df = PCom.Distance(aPf); Standard_Real dl = PCom.Distance(aPl); - if (Abs(df - Distance) <= Tol) + if (std::abs(df - Distance) <= Tol) return Standard_True; - if (Abs(dl - Distance) <= Tol) + if (std::abs(dl - Distance) <= Tol) return Standard_True; } return Standard_False; @@ -1456,8 +1456,8 @@ void MAT2d_DrawCurve(const Handle(Geom2d_Curve)& aCurve, const Standard_Integer { gpParabola = Handle(Geom2d_Parabola)::DownCast(curve)->Parab2d(); Focus = gpParabola.Focal(); - Standard_Real Val1 = Sqrt(Limit * Focus); - Standard_Real Val2 = Sqrt(Limit * Limit); + Standard_Real Val1 = std::sqrt(Limit * Focus); + Standard_Real Val2 = std::sqrt(Limit * Limit); delta = (Val1 <= Val2 ? Val1 : Val2); } else if (type == STANDARD_TYPE(Geom2d_Hyperbola)) @@ -1467,8 +1467,8 @@ void MAT2d_DrawCurve(const Handle(Geom2d_Curve)& aCurve, const Standard_Integer Standard_Real Minr = gpHyperbola.MinorRadius(); Standard_Real Valu1 = Limit / Majr; Standard_Real Valu2 = Limit / Minr; - Standard_Real Val1 = Log(Valu1 + Sqrt(Valu1 * Valu1 - 1)); - Standard_Real Val2 = Log(Valu2 + Sqrt(Valu2 * Valu2 + 1)); + Standard_Real Val1 = Log(Valu1 + std::sqrt(Valu1 * Valu1 - 1)); + Standard_Real Val2 = Log(Valu2 + std::sqrt(Valu2 * Valu2 + 1)); delta = (Val1 <= Val2 ? Val1 : Val2); } CurveDraw = diff --git a/src/ModelingData/TKBRep/BRep/BRep_Tool.cxx b/src/ModelingData/TKBRep/BRep/BRep_Tool.cxx index 69f85c65fb..beb7b8ec67 100644 --- a/src/ModelingData/TKBRep/BRep/BRep_Tool.cxx +++ b/src/ModelingData/TKBRep/BRep/BRep_Tool.cxx @@ -1704,7 +1704,7 @@ Standard_Real BRep_Tool::MaxTolerance(const TopoDS_Shape& theShape, for (; anExpSS.More(); anExpSS.Next()) { const TopoDS_Shape& aCurrentSubShape = anExpSS.Current(); - aTol = Max(aTol, Tolerance(TopoDS::Face(aCurrentSubShape))); + aTol = std::max(aTol, Tolerance(TopoDS::Face(aCurrentSubShape))); } } else if (theSubShape == TopAbs_EDGE) @@ -1712,7 +1712,7 @@ Standard_Real BRep_Tool::MaxTolerance(const TopoDS_Shape& theShape, for (; anExpSS.More(); anExpSS.Next()) { const TopoDS_Shape& aCurrentSubShape = anExpSS.Current(); - aTol = Max(aTol, Tolerance(TopoDS::Edge(aCurrentSubShape))); + aTol = std::max(aTol, Tolerance(TopoDS::Edge(aCurrentSubShape))); } } else if (theSubShape == TopAbs_VERTEX) @@ -1720,7 +1720,7 @@ Standard_Real BRep_Tool::MaxTolerance(const TopoDS_Shape& theShape, for (; anExpSS.More(); anExpSS.Next()) { const TopoDS_Shape& aCurrentSubShape = anExpSS.Current(); - aTol = Max(aTol, Tolerance(TopoDS::Vertex(aCurrentSubShape))); + aTol = std::max(aTol, Tolerance(TopoDS::Vertex(aCurrentSubShape))); } } diff --git a/src/ModelingData/TKBRep/BRepAdaptor/BRepAdaptor_CompCurve.cxx b/src/ModelingData/TKBRep/BRepAdaptor/BRepAdaptor_CompCurve.cxx index ec9d0390e2..c837973ea4 100644 --- a/src/ModelingData/TKBRep/BRepAdaptor/BRepAdaptor_CompCurve.cxx +++ b/src/ModelingData/TKBRep/BRepAdaptor/BRepAdaptor_CompCurve.cxx @@ -376,7 +376,7 @@ gp_Vec BRepAdaptor_CompCurve::DN(const Standard_Real U, const Standard_Integer N Standard_Integer index = CurIndex; Prepare(u, d, index); - return (myCurves->Value(index).DN(u, N) * Pow(d, N)); + return (myCurves->Value(index).DN(u, N) * std::pow(d, N)); } Standard_Real BRepAdaptor_CompCurve::Resolution(const Standard_Real R3d) const diff --git a/src/ModelingData/TKBRep/BRepLProp/BRepLProp.cxx b/src/ModelingData/TKBRep/BRepLProp/BRepLProp.cxx index 6ae301c6af..47d0ba7b00 100644 --- a/src/ModelingData/TKBRep/BRepLProp/BRepLProp.cxx +++ b/src/ModelingData/TKBRep/BRepLProp/BRepLProp.cxx @@ -56,7 +56,7 @@ GeomAbs_Shape BRepLProp::Continuity(const BRepAdaptor_Curve& C1, { throw Standard_Failure("Courbes non jointives"); } - Standard_Integer min = Min(n1, n2); + Standard_Integer min = std::min(n1, n2); if (min >= 1) { d1 = clp1.D1(); diff --git a/src/ModelingData/TKBRep/BRepLProp/BRepLProp_SurfaceTool.cxx b/src/ModelingData/TKBRep/BRepLProp/BRepLProp_SurfaceTool.cxx index 6fd945e0c7..633fb911f9 100644 --- a/src/ModelingData/TKBRep/BRepLProp/BRepLProp_SurfaceTool.cxx +++ b/src/ModelingData/TKBRep/BRepLProp/BRepLProp_SurfaceTool.cxx @@ -71,7 +71,7 @@ gp_Vec BRepLProp_SurfaceTool::DN(const BRepAdaptor_Surface& S, Standard_Integer BRepLProp_SurfaceTool::Continuity(const BRepAdaptor_Surface& S) { - GeomAbs_Shape s = (GeomAbs_Shape)Min(S.UContinuity(), S.VContinuity()); + GeomAbs_Shape s = std::min(S.UContinuity(), S.VContinuity()); switch (s) { case GeomAbs_C0: diff --git a/src/ModelingData/TKBRep/BRepTools/BRepTools.cxx b/src/ModelingData/TKBRep/BRepTools/BRepTools.cxx index 01ed08811a..25b59626f7 100644 --- a/src/ModelingData/TKBRep/BRepTools/BRepTools.cxx +++ b/src/ModelingData/TKBRep/BRepTools/BRepTools.cxx @@ -1202,7 +1202,8 @@ void BRepTools::DetectClosedness(const TopoDS_Face& theFace, BRep_Tool::CurveOnSurface(TopoDS::Edge(anEdge.Reversed()), theFace, fpar, lpar); gp_Pnt2d Point1 = PCurve1->Value(fpar); gp_Pnt2d Point2 = PCurve2->Value(fpar); - Standard_Boolean IsUiso = (Abs(Point1.X() - Point2.X()) > Abs(Point1.Y() - Point2.Y())); + Standard_Boolean IsUiso = + (std::abs(Point1.X() - Point2.X()) > std::abs(Point1.Y() - Point2.Y())); if (IsUiso) theUclosed = Standard_True; else @@ -1227,13 +1228,13 @@ Standard_Real BRepTools::EvalAndUpdateTol(const TopoDS_Edge& theE, // if (!C3d->IsPeriodic()) { - first = Max(first, C3d->FirstParameter()); - last = Min(last, C3d->LastParameter()); + first = std::max(first, C3d->FirstParameter()); + last = std::min(last, C3d->LastParameter()); } if (!C2d->IsPeriodic()) { - first = Max(first, C2d->FirstParameter()); - last = Min(last, C2d->LastParameter()); + first = std::max(first, C2d->FirstParameter()); + last = std::min(last, C2d->LastParameter()); } const Handle(Adaptor3d_Curve) aGeomAdaptorCurve = new GeomAdaptor_Curve(C3d, first, last); @@ -1257,7 +1258,7 @@ Standard_Real BRepTools::EvalAndUpdateTol(const TopoDS_Edge& theE, // Try to estimate by sample points Standard_Integer nbint = 22; Standard_Real dt = (last - first) / nbint; - dt = Max(dt, Precision::Confusion()); + dt = std::max(dt, Precision::Confusion()); Standard_Real d, dmax = 0.; gp_Pnt2d aP2d; gp_Pnt aPC, aPS; @@ -1288,7 +1289,7 @@ Standard_Real BRepTools::EvalAndUpdateTol(const TopoDS_Edge& theE, } } - newtol = 1.2 * Sqrt(dmax); + newtol = 1.2 * std::sqrt(dmax); } } Standard_Real Tol = BRep_Tool::Tolerance(theE); @@ -1440,7 +1441,8 @@ void BRepTools::CheckLocations(const TopoDS_Shape& theS, TopTools_ListOfShape& t const TopLoc_Location& aLoc = anS.Location(); const gp_Trsf& aTrsf = aLoc.Transformation(); Standard_Boolean isBadTrsf = - aTrsf.IsNegative() || (Abs(Abs(aTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec()); + aTrsf.IsNegative() + || (std::abs(std::abs(aTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec()); if (isBadTrsf) { diff --git a/src/ModelingData/TKBRep/BRepTools/BRepTools.hxx b/src/ModelingData/TKBRep/BRepTools/BRepTools.hxx index 59cdd84a2c..8c712da584 100644 --- a/src/ModelingData/TKBRep/BRepTools/BRepTools.hxx +++ b/src/ModelingData/TKBRep/BRepTools/BRepTools.hxx @@ -394,8 +394,9 @@ public: const Standard_Boolean theForce = Standard_False); //! Check all locations of shape according criterium: - //! aTrsf.IsNegative() || (Abs(Abs(aTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec()) - //! All sub-shapes having such locations are put in list theProblemShapes + //! aTrsf.IsNegative() || (std::abs(std::abs(aTrsf.ScaleFactor()) - 1.) > + //! TopLoc_Location::ScalePrec()) All sub-shapes having such locations are put in list + //! theProblemShapes Standard_EXPORT static void CheckLocations(const TopoDS_Shape& theS, TopTools_ListOfShape& theProblemShapes); }; diff --git a/src/ModelingData/TKBRep/BRepTools/BRepTools_GTrsfModification.cxx b/src/ModelingData/TKBRep/BRepTools/BRepTools_GTrsfModification.cxx index 843cafb359..ab345c269a 100644 --- a/src/ModelingData/TKBRep/BRepTools/BRepTools_GTrsfModification.cxx +++ b/src/ModelingData/TKBRep/BRepTools/BRepTools_GTrsfModification.cxx @@ -46,17 +46,17 @@ BRepTools_GTrsfModification::BRepTools_GTrsfModification(const gp_GTrsf& T) // on prend comme dilatation maximale pour la tolerance la norme sup Standard_Real loc1, loc2, loc3, loc4; - loc1 = Max(Abs(T.Value(1, 1)), Abs(T.Value(1, 2))); - loc2 = Max(Abs(T.Value(2, 1)), Abs(T.Value(2, 2))); - loc3 = Max(Abs(T.Value(3, 1)), Abs(T.Value(3, 2))); - loc4 = Max(Abs(T.Value(1, 3)), Abs(T.Value(2, 3))); + loc1 = std::max(std::abs(T.Value(1, 1)), std::abs(T.Value(1, 2))); + loc2 = std::max(std::abs(T.Value(2, 1)), std::abs(T.Value(2, 2))); + loc3 = std::max(std::abs(T.Value(3, 1)), std::abs(T.Value(3, 2))); + loc4 = std::max(std::abs(T.Value(1, 3)), std::abs(T.Value(2, 3))); - loc1 = Max(loc1, loc2); - loc2 = Max(loc3, loc4); + loc1 = std::max(loc1, loc2); + loc2 = std::max(loc3, loc4); - loc1 = Max(loc1, loc2); + loc1 = std::max(loc1, loc2); - myGScale = Max(loc1, Abs(T.Value(3, 3))); + myGScale = std::max(loc1, std::abs(T.Value(3, 3))); } //================================================================================================= @@ -260,7 +260,7 @@ Standard_Boolean BRepTools_GTrsfModification::NewTriangulation( theTriangulation = theTriangulation->Copy(); theTriangulation->SetCachedMinMax(Bnd_Box()); // clear bounding box - theTriangulation->Deflection(theTriangulation->Deflection() * Abs(myGScale)); + theTriangulation->Deflection(theTriangulation->Deflection() * std::abs(myGScale)); // apply transformation to 3D nodes for (Standard_Integer anInd = 1; anInd <= theTriangulation->NbNodes(); ++anInd) { @@ -317,7 +317,7 @@ Standard_Boolean BRepTools_GTrsfModification::NewPolygon(const TopoDS_Edge& aGTrsf.Multiply(aLoc.Transformation()); thePoly = thePoly->Copy(); - thePoly->Deflection(thePoly->Deflection() * Abs(myGScale)); + thePoly->Deflection(thePoly->Deflection() * std::abs(myGScale)); // transform nodes TColgp_Array1OfPnt& aNodesArray = thePoly->ChangeNodes(); for (Standard_Integer anId = aNodesArray.Lower(); anId <= aNodesArray.Upper(); ++anId) diff --git a/src/ModelingData/TKBRep/BRepTools/BRepTools_NurbsConvertModification.cxx b/src/ModelingData/TKBRep/BRepTools/BRepTools_NurbsConvertModification.cxx index d2f47f8496..348b9062ae 100644 --- a/src/ModelingData/TKBRep/BRepTools/BRepTools_NurbsConvertModification.cxx +++ b/src/ModelingData/TKBRep/BRepTools/BRepTools_NurbsConvertModification.cxx @@ -257,24 +257,24 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewSurface(const TopoDS_Fac V2 = curvV2; S->Bounds(surfU1, surfU2, surfV1, surfV2); - if (Abs(U1 - surfU1) <= TolPar) + if (std::abs(U1 - surfU1) <= TolPar) U1 = surfU1; - if (Abs(U2 - surfU2) <= TolPar) + if (std::abs(U2 - surfU2) <= TolPar) U2 = surfU2; - if (Abs(V1 - surfV1) <= TolPar) + if (std::abs(V1 - surfV1) <= TolPar) V1 = surfV1; - if (Abs(V2 - surfV2) <= TolPar) + if (std::abs(V2 - surfV2) <= TolPar) V2 = surfV2; if (!IsUp) { - U1 = Max(surfU1, curvU1); - U2 = Min(surfU2, curvU2); + U1 = std::max(surfU1, curvU1); + U2 = std::min(surfU2, curvU2); } if (!IsVp) { - V1 = Max(surfV1, curvV1); - V2 = Min(surfV2, curvV2); + V1 = std::max(surfV1, curvV1); + V2 = std::min(surfV2, curvV2); } //<-OCC466(apo) @@ -291,49 +291,8 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewSurface(const TopoDS_Fac V2 = V1 + Vp; } - /* - if(IsUp && IsVp) { - Standard_Real dU = Abs(U2 - U1), dV = Abs(V2 - V1); - Standard_Real Up = S->UPeriod(), Vp = S->VPeriod(); - if(Abs(dU - Up) <= TolPar && U2 <= Up) { - if(Abs(dV - Vp) <= TolPar && V2 <= Vp) { } - else { - SS = new Geom_RectangularTrimmedSurface(S, V1+1e-9, V2-1e-9, Standard_False); - } - } - else { - if(Abs(dV - Vp) <= TolPar && V2 <= Vp) - SS = new Geom_RectangularTrimmedSurface(S, U1+1e-9, U2-1e-9, Standard_True); - else - SS = new Geom_RectangularTrimmedSurface(S, U1+1e-9, U2-1e-9, V1+1e-9, V2-1e-9); - } - } - - if(IsUp && !IsVp) { - Standard_Real dU = Abs(U2 - U1); - Standard_Real Up = S->UPeriod(); - if(Abs(dU - Up) <= TolPar && U2 <= Up) - SS = new Geom_RectangularTrimmedSurface(S, V1+1e-9, V2-1e-9, Standard_False); - else - SS = new Geom_RectangularTrimmedSurface(S, U1+1e-9, U2-1e-9, V1+1e-9, V2-1e-9); - } - - if(!IsUp && IsVp) { - Standard_Real dV = Abs(V2 - V1); - Standard_Real Vp = S->VPeriod(); - if(Abs(dV - Vp) <= TolPar && V2 <= Vp) - SS = new Geom_RectangularTrimmedSurface(S, U1+1e-9, U2-1e-9, Standard_True); - else - SS = new Geom_RectangularTrimmedSurface(S, U1+1e-9, U2-1e-9, V1+1e-9, V2-1e-9); - } - - if(!IsUp && !IsVp) { - SS = new Geom_RectangularTrimmedSurface(S, U1+1e-9, U2-1e-9, V1+1e-9, V2-1e-9); - } - */ - - if (Abs(surfU1 - U1) > Tol || Abs(surfU2 - U2) > Tol || Abs(surfV1 - V1) > Tol - || Abs(surfV2 - V2) > Tol) + if (std::abs(surfU1 - U1) > Tol || std::abs(surfU2 - U2) > Tol || std::abs(surfV1 - V1) > Tol + || std::abs(surfV2 - V2) > Tol) S = new Geom_RectangularTrimmedSurface(S, U1, U2, V1, V2); S->Bounds(surfU1, surfU2, surfV1, surfV2); @@ -345,11 +304,11 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewSurface(const TopoDS_Fac // on recadre les bornes de S sinon les anciennes PCurves sont aux fraises // - if (Abs(curvU1 - surfU1) > UTol && !BS->IsUPeriodic()) + if (std::abs(curvU1 - surfU1) > UTol && !BS->IsUPeriodic()) { GeomLib_ChangeUBounds(BS, U1, U2); } - if (Abs(curvV1 - surfV1) > VTol && !BS->IsVPeriodic()) + if (std::abs(curvV1 - surfV1) > VTol && !BS->IsVPeriodic()) { GeomLib_ChangeVBounds(BS, V1, V2); } @@ -457,8 +416,8 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve(const TopoDS_Edge& if (C->IsPeriodic()) { Standard_Real p = C->Period(); - Standard_Real d = Abs(l - f); - if (Abs(d - p) <= TolPar && l <= p) + Standard_Real d = std::abs(l - f); + if (std::abs(d - p) <= TolPar && l <= p) { } else @@ -482,7 +441,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve(const TopoDS_Edge& if (!BC->IsPeriodic()) { BC->Resolution(Tol, UTol); - if (Abs(f - fnew) > UTol || Abs(l - lnew) > UTol) + if (std::abs(f - fnew) > UTol || std::abs(l - lnew) > UTol) { TColStd_Array1OfReal knots(1, BC->NbKnots()); BC->Knots(knots); @@ -723,11 +682,11 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d(const TopoDS_Edg Standard_Real aMinDist = Precision::Infinite(); if (S->IsUPeriodic()) { - aMinDist = Min(0.5 * S->UPeriod(), aMinDist); + aMinDist = std::min(0.5 * S->UPeriod(), aMinDist); } if (S->IsVPeriodic()) { - aMinDist = Min(0.5 * S->VPeriod(), aMinDist); + aMinDist = std::min(0.5 * S->VPeriod(), aMinDist); } aMinDist *= aMinDist; // Old domain @@ -938,7 +897,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewPolygonOnTriangulation( // update parameters of 2D polygon if (thePoly->HasParameters()) { - Standard_Real aTol = Max(BRep_Tool::Tolerance(theEdge), thePoly->Deflection()); + Standard_Real aTol = std::max(BRep_Tool::Tolerance(theEdge), thePoly->Deflection()); TopLoc_Location aLoc; Handle(Geom_Surface) aSurf = BRep_Tool::Surface(theFace, aLoc); Handle(Geom_Surface) aNewSurf = newSurface(myMap, theFace); @@ -949,7 +908,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewPolygonOnTriangulation( { // compute 2D tolerance GeomAdaptor_Surface aSurfAdapt(aSurf); - Standard_Real aTol2D = Max(aSurfAdapt.UResolution(aTol), aSurfAdapt.VResolution(aTol)); + Standard_Real aTol2D = std::max(aSurfAdapt.UResolution(aTol), aSurfAdapt.VResolution(aTol)); for (Standard_Integer anInd = 1; anInd <= thePoly->NbNodes(); ++anInd) { diff --git a/src/ModelingData/TKBRep/BRepTools/BRepTools_PurgeLocations.cxx b/src/ModelingData/TKBRep/BRepTools/BRepTools_PurgeLocations.cxx index 9ab3a16358..54da5097d7 100644 --- a/src/ModelingData/TKBRep/BRepTools/BRepTools_PurgeLocations.cxx +++ b/src/ModelingData/TKBRep/BRepTools/BRepTools_PurgeLocations.cxx @@ -48,7 +48,8 @@ Standard_Boolean BRepTools_PurgeLocations::Perform(const TopoDS_Shape& theShape) const gp_Trsf& aTrsf = aLoc.Transformation(); Standard_Boolean isBadTrsf = - aTrsf.IsNegative() || (Abs(Abs(aTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec()); + aTrsf.IsNegative() + || (std::abs(std::abs(aTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec()); if (isBadTrsf) { aBadTrsfInds.Append(ind); @@ -129,7 +130,8 @@ Standard_Boolean BRepTools_PurgeLocations::PurgeLocation(const TopoDS_Shape& the gp_Trsf aTrsf = aFD->Trsf(); Standard_Integer aFP = aRefLoc.FirstPower(); Standard_Boolean isBad = - aTrsf.IsNegative() || (Abs(Abs(aTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec()); + aTrsf.IsNegative() + || (std::abs(std::abs(aTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec()); TopLoc_Location aLoc(aFD); aLoc = aLoc.Powered(aFP); aTrsf = aLoc.Transformation(); diff --git a/src/ModelingData/TKBRep/BRepTools/BRepTools_PurgeLocations.hxx b/src/ModelingData/TKBRep/BRepTools/BRepTools_PurgeLocations.hxx index 5c8340e804..5bf343df44 100644 --- a/src/ModelingData/TKBRep/BRepTools/BRepTools_PurgeLocations.hxx +++ b/src/ModelingData/TKBRep/BRepTools/BRepTools_PurgeLocations.hxx @@ -20,8 +20,8 @@ #include //! Removes location datums, which satisfy conditions: -//! aTrsf.IsNegative() || (Abs(Abs(aTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec()) -//! from all locations of shape and its subshapes +//! aTrsf.IsNegative() || (std::abs(std::abs(aTrsf.ScaleFactor()) - 1.) > +//! TopLoc_Location::ScalePrec()) from all locations of shape and its subshapes class BRepTools_PurgeLocations { diff --git a/src/ModelingData/TKBRep/BRepTools/BRepTools_TrsfModification.cxx b/src/ModelingData/TKBRep/BRepTools/BRepTools_TrsfModification.cxx index 130caf3f10..c89f438125 100644 --- a/src/ModelingData/TKBRep/BRepTools/BRepTools_TrsfModification.cxx +++ b/src/ModelingData/TKBRep/BRepTools/BRepTools_TrsfModification.cxx @@ -77,7 +77,7 @@ Standard_Boolean BRepTools_TrsfModification::NewSurface(const TopoDS_Face& F, } Tol = BRep_Tool::Tolerance(F); - Tol *= Abs(myTrsf.ScaleFactor()); + Tol *= std::abs(myTrsf.ScaleFactor()); RevWires = Standard_False; RevFace = myTrsf.IsNegative(); @@ -118,7 +118,7 @@ Standard_Boolean BRepTools_TrsfModification::NewTriangulation( theTriangulation = theTriangulation->Copy(); theTriangulation->SetCachedMinMax(Bnd_Box()); // clear bounding box - theTriangulation->Deflection(theTriangulation->Deflection() * Abs(myTrsf.ScaleFactor())); + theTriangulation->Deflection(theTriangulation->Deflection() * std::abs(myTrsf.ScaleFactor())); // apply transformation to 3D nodes for (Standard_Integer anInd = 1; anInd <= theTriangulation->NbNodes(); ++anInd) { @@ -189,7 +189,7 @@ Standard_Boolean BRepTools_TrsfModification::NewPolygon(const TopoDS_Edge& } theP = theP->Copy(); - theP->Deflection(theP->Deflection() * Abs(myTrsf.ScaleFactor())); + theP->Deflection(theP->Deflection() * std::abs(myTrsf.ScaleFactor())); TColgp_Array1OfPnt& aNodesArray = theP->ChangeNodes(); for (Standard_Integer anId = aNodesArray.Lower(); anId <= aNodesArray.Upper(); ++anId) { @@ -205,7 +205,7 @@ Standard_Boolean BRepTools_TrsfModification::NewPolygon(const TopoDS_Edge& if (!aCurve.IsNull()) { Standard_Real aReparametrization = aCurve->ParametricTransformation(aTrsf); - if (Abs(aReparametrization - 1.0) > Precision::PConfusion()) + if (std::abs(aReparametrization - 1.0) > Precision::PConfusion()) { TColStd_Array1OfReal& aParams = theP->ChangeParameters(); for (Standard_Integer anInd = aParams.Lower(); anInd <= aParams.Upper(); ++anInd) @@ -244,14 +244,14 @@ Standard_Boolean BRepTools_TrsfModification::NewPolygonOnTriangulation( return Standard_False; } theP = theP->Copy(); - theP->Deflection(theP->Deflection() * Abs(myTrsf.ScaleFactor())); + theP->Deflection(theP->Deflection() * std::abs(myTrsf.ScaleFactor())); // transform the parametrization Handle(Geom_Surface) aSurf = BRep_Tool::Surface(theF, aLoc); Standard_Real aFirst, aLast; Handle(Geom2d_Curve) aC2d = BRep_Tool::CurveOnSurface(theE, theF, aFirst, aLast); if (!aSurf.IsNull() && !aC2d.IsNull() - && Abs(Abs(myTrsf.ScaleFactor()) - 1.0) > TopLoc_Location::ScalePrec()) + && std::abs(std::abs(myTrsf.ScaleFactor()) - 1.0) > TopLoc_Location::ScalePrec()) { gp_GTrsf2d aGTrsf = aSurf->ParametricTransformation(myTrsf); if (aGTrsf.Form() != gp_Identity) @@ -282,7 +282,7 @@ Standard_Boolean BRepTools_TrsfModification::NewCurve(const TopoDS_Edge& E, C = BRep_Tool::Curve(E, L, f, l); Tol = BRep_Tool::Tolerance(E); - Tol *= Abs(myTrsf.ScaleFactor()); + Tol *= std::abs(myTrsf.ScaleFactor()); gp_Trsf LT = L.Transformation(); LT.Invert(); @@ -305,7 +305,7 @@ Standard_Boolean BRepTools_TrsfModification::NewPoint(const TopoDS_Vertex& V, { P = BRep_Tool::Pnt(V); Tol = BRep_Tool::Tolerance(V); - Tol *= Abs(myTrsf.ScaleFactor()); + Tol *= std::abs(myTrsf.ScaleFactor()); P.Transform(myTrsf); return Standard_True; @@ -323,7 +323,7 @@ Standard_Boolean BRepTools_TrsfModification::NewCurve2d(const TopoDS_Edge& E, TopLoc_Location loc; Tol = BRep_Tool::Tolerance(E); Standard_Real scale = myTrsf.ScaleFactor(); - Tol *= Abs(scale); + Tol *= std::abs(scale); const Handle(Geom_Surface)& S = BRep_Tool::Surface(F, loc); if (S.IsNull()) @@ -358,9 +358,9 @@ Standard_Boolean BRepTools_TrsfModification::NewCurve2d(const TopoDS_Edge& E, f = fc; if (l - lc > Precision::PConfusion()) l = lc; - if (Abs(l - f) < Precision::PConfusion()) + if (std::abs(l - f) < Precision::PConfusion()) { - if (Abs(f - fc) < Precision::PConfusion() && !Precision::IsInfinite(lc)) + if (std::abs(f - fc) < Precision::PConfusion() && !Precision::IsInfinite(lc)) { l = lc; } @@ -373,7 +373,7 @@ Standard_Boolean BRepTools_TrsfModification::NewCurve2d(const TopoDS_Edge& E, newf = f; newl = l; - if (Abs(scale) != 1.) + if (std::abs(scale) != 1.) { NewC = new Geom2d_TrimmedCurve(NewC, f, l); @@ -415,7 +415,7 @@ Standard_Boolean BRepTools_TrsfModification::NewParameter(const TopoDS_Vertex& V TopLoc_Location loc; Tol = BRep_Tool::Tolerance(V); - Tol *= Abs(myTrsf.ScaleFactor()); + Tol *= std::abs(myTrsf.ScaleFactor()); P = BRep_Tool::Parameter(V, E); Standard_Real f, l; diff --git a/src/ModelingData/TKBRep/BRepTools/BRepTools_WireExplorer.cxx b/src/ModelingData/TKBRep/BRepTools/BRepTools_WireExplorer.cxx index 7514fc6aa9..85578bbea6 100644 --- a/src/ModelingData/TKBRep/BRepTools/BRepTools_WireExplorer.cxx +++ b/src/ModelingData/TKBRep/BRepTools/BRepTools_WireExplorer.cxx @@ -142,13 +142,13 @@ void BRepTools_WireExplorer::Init(const TopoDS_Wire& W, for (; anExp.More(); anExp.Next()) { const TopoDS_Vertex& aV = TopoDS::Vertex(anExp.Current()); - dfVertToler = Max(BRep_Tool::Tolerance(aV), dfVertToler); + dfVertToler = std::max(BRep_Tool::Tolerance(aV), dfVertToler); } if (dfVertToler < Precision::Confusion()) { // Use tolerance of edges for (TopoDS_Iterator it(W); it.More(); it.Next()) - dfVertToler = Max(BRep_Tool::Tolerance(TopoDS::Edge(it.Value())), dfVertToler); + dfVertToler = std::max(BRep_Tool::Tolerance(TopoDS::Edge(it.Value())), dfVertToler); if (dfVertToler < Precision::Confusion()) // empty wire @@ -169,25 +169,25 @@ void BRepTools_WireExplorer::Init(const TopoDS_Wire& W, if (a <= Precision::Confusion()) tol1 = maxtol; else - tol1 = Min(maxtol, dfVertToler / a); + tol1 = std::min(maxtol, dfVertToler / a); aGAS.D1(UMin, VMax, aP, aD1U, aD1V); a = aD1U.Magnitude(); if (a <= Precision::Confusion()) tol2 = maxtol; else - tol2 = Min(maxtol, dfVertToler / a); + tol2 = std::min(maxtol, dfVertToler / a); - myTolU = 2. * Max(tol1, tol2); + myTolU = 2. * std::max(tol1, tol2); } if (aGAS.GetType() == GeomAbs_BSplineSurface || aGAS.GetType() == GeomAbs_BezierSurface) { - Standard_Real maxTol = Max(myTolU, myTolV); + Standard_Real maxTol = std::max(myTolU, myTolV); gp_Pnt aP; gp_Vec aDU, aDV; aGAS.D1((UMax - UMin) / 2., (VMax - VMin) / 2., aP, aDU, aDV); - Standard_Real mod = Sqrt(aDU * aDU + aDV * aDV); + Standard_Real mod = std::sqrt(aDU * aDU + aDV * aDV); if (mod > gp::Resolution()) { if (mod * maxTol / dfVertToler < 1.5) @@ -572,7 +572,7 @@ void BRepTools_WireExplorer::Next() else aPCurve->D0(dfFPar, aPEb); - if (Abs(dfLPar - dfFPar) > Precision::PConfusion()) + if (std::abs(dfLPar - dfFPar) > Precision::PConfusion()) { isrevese = (E.Orientation() == TopAbs_REVERSED); isrevese = !isrevese; @@ -598,7 +598,7 @@ void BRepTools_WireExplorer::Next() } } gp_Vec2d anEDir(aPEb, aPEe); - dfCurAngle = Abs(anEDir.Angle(anERefDir)); + dfCurAngle = std::abs(anEDir.Angle(anERefDir)); } if (dfCurAngle <= dfMinAngle) @@ -606,7 +606,7 @@ void BRepTools_WireExplorer::Next() Standard_Real d = PRef.SquareDistance(aPEb); if (d <= Precision::PConfusion()) d = 0.; - if (Abs(aPEb.X() - PRef.X()) < myTolU && Abs(aPEb.Y() - PRef.Y()) < myTolV) + if (std::abs(aPEb.X() - PRef.X()) < myTolU && std::abs(aPEb.Y() - PRef.Y()) < myTolV) { if (d <= dmin) { @@ -752,7 +752,7 @@ Standard_Real GetNextParamOnPC(const Handle(Geom2d_Curve)& aPC, const Standard_Boolean& reverse) { Standard_Real result = (reverse) ? fP : lP; - Standard_Real dP = Abs(lP - fP) / 1000.; // was / 16.; + Standard_Real dP = std::abs(lP - fP) / 1000.; // was / 16.; if (reverse) { Standard_Real startPar = fP; @@ -762,7 +762,7 @@ Standard_Real GetNextParamOnPC(const Handle(Geom2d_Curve)& aPC, gp_Pnt2d pnt; startPar += dP; aPC->D0(startPar, pnt); - if (Abs(aPRef.X() - pnt.X()) < tolU && Abs(aPRef.Y() - pnt.Y()) < tolV) + if (std::abs(aPRef.X() - pnt.X()) < tolU && std::abs(aPRef.Y() - pnt.Y()) < tolV) continue; else { @@ -787,7 +787,7 @@ Standard_Real GetNextParamOnPC(const Handle(Geom2d_Curve)& aPC, gp_Pnt2d pnt; startPar -= dP; aPC->D0(startPar, pnt); - if (Abs(aPRef.X() - pnt.X()) < tolU && Abs(aPRef.Y() - pnt.Y()) < tolV) + if (std::abs(aPRef.X() - pnt.X()) < tolU && std::abs(aPRef.Y() - pnt.Y()) < tolV) continue; else { diff --git a/src/ModelingData/TKBRep/TopoDS/TopoDS_Shape.hxx b/src/ModelingData/TKBRep/TopoDS/TopoDS_Shape.hxx index 5335132090..ae1106d716 100644 --- a/src/ModelingData/TKBRep/TopoDS/TopoDS_Shape.hxx +++ b/src/ModelingData/TKBRep/TopoDS/TopoDS_Shape.hxx @@ -317,7 +317,8 @@ protected: //! @param theTrsf transformation to validate void validateTransformation(const gp_Trsf& theTrsf) const { - if (Abs(Abs(theTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec() || theTrsf.IsNegative()) + if (std::abs(std::abs(theTrsf.ScaleFactor()) - 1.) > TopLoc_Location::ScalePrec() + || theTrsf.IsNegative()) { // Exception throw Standard_DomainError("Transformation with scaling transformation is forbidden"); diff --git a/src/ModelingData/TKG2d/Adaptor2d/Adaptor2d_OffsetCurve.cxx b/src/ModelingData/TKG2d/Adaptor2d/Adaptor2d_OffsetCurve.cxx index 4f1a466a42..d7b480a891 100644 --- a/src/ModelingData/TKG2d/Adaptor2d/Adaptor2d_OffsetCurve.cxx +++ b/src/ModelingData/TKG2d/Adaptor2d/Adaptor2d_OffsetCurve.cxx @@ -572,11 +572,11 @@ static Standard_Integer nbPoints(const Handle(Adaptor2d_Curve2d)& theCurve) if (theCurve->GetType() == GeomAbs_BezierCurve) { - nbs = Max(nbs, 3 + theCurve->NbPoles()); + nbs = std::max(nbs, 3 + theCurve->NbPoles()); } else if (theCurve->GetType() == GeomAbs_BSplineCurve) { - nbs = Max(nbs, theCurve->NbKnots() * theCurve->Degree()); + nbs = std::max(nbs, theCurve->NbKnots() * theCurve->Degree()); } if (nbs > 300) diff --git a/src/ModelingData/TKG2d/Geom2d/Geom2d_BSplineCurve.cxx b/src/ModelingData/TKG2d/Geom2d/Geom2d_BSplineCurve.cxx index 11c50d5480..347c2632a3 100644 --- a/src/ModelingData/TKG2d/Geom2d/Geom2d_BSplineCurve.cxx +++ b/src/ModelingData/TKG2d/Geom2d/Geom2d_BSplineCurve.cxx @@ -65,7 +65,7 @@ static void CheckCurveData(const TColgp_Array1OfPnt2d& CPoles, for (Standard_Integer I = CKnots.Lower(); I < CKnots.Upper(); I++) { - if (CKnots(I + 1) - CKnots(I) <= Epsilon(Abs(CKnots(I)))) + if (CKnots(I + 1) - CKnots(I) <= Epsilon(std::abs(CKnots(I)))) { throw Standard_ConstructionError("BSpline curve: Knots interval values too close"); } @@ -80,7 +80,7 @@ static Standard_Boolean Rational(const TColStd_Array1OfReal& theWeights) { for (Standard_Integer i = theWeights.Lower(); i < theWeights.Upper(); i++) { - if (Abs(theWeights[i] - theWeights[i + 1]) > gp::Resolution()) + if (std::abs(theWeights[i] - theWeights[i + 1]) > gp::Resolution()) { return Standard_True; } @@ -515,7 +515,7 @@ void Geom2d_BSplineCurve::InsertPoleAfter(const Standard_Integer Index, // Insert the weight Handle(TColStd_HArray1OfReal) nweights; - Standard_Boolean rat = IsRational() || Abs(Weight - 1.) > gp::Resolution(); + Standard_Boolean rat = IsRational() || std::abs(Weight - 1.) > gp::Resolution(); if (rat) { @@ -642,8 +642,8 @@ void Geom2d_BSplineCurve::Segment(const Standard_Real aU1, if (aU2 < aU1) throw Standard_DomainError("Geom2d_BSplineCurve::Segment"); // - Standard_Real AbsUMax = Max(Abs(FirstParameter()), Abs(LastParameter())); - Standard_Real Eps = Max(Epsilon(AbsUMax), theTolerance); + Standard_Real AbsUMax = std::max(std::abs(FirstParameter()), std::abs(LastParameter())); + Standard_Real Eps = std::max(Epsilon(AbsUMax), theTolerance); Standard_Real NewU1, NewU2; Standard_Real U, DU = 0; Standard_Integer i, k, index; @@ -688,8 +688,8 @@ void Geom2d_BSplineCurve::Segment(const Standard_Real aU1, knots->Upper(), index, NewU2); - Knots(1) = Min(NewU1, NewU2); - Knots(2) = Max(NewU1, NewU2); + Knots(1) = std::min(NewU1, NewU2); + Knots(2) = std::max(NewU1, NewU2); Mults(1) = Mults(2) = deg; InsertKnots(Knots, Mults, Eps); @@ -706,7 +706,7 @@ void Geom2d_BSplineCurve::Segment(const Standard_Real aU1, index, U); // Eps = Epsilon(knots->Value(index+1)); - if (Abs(knots->Value(index + 1) - U) <= Eps) + if (std::abs(knots->Value(index + 1) - U) <= Eps) { index++; } @@ -728,7 +728,7 @@ void Geom2d_BSplineCurve::Segment(const Standard_Real aU1, ToU2, index1, U); - if (Abs(knots->Value(index1 + 1) - U) <= Eps) + if (std::abs(knots->Value(index1 + 1) - U) <= Eps) { index1++; } @@ -742,7 +742,7 @@ void Geom2d_BSplineCurve::Segment(const Standard_Real aU1, index2, U); // Eps = Epsilon(knots->Value(index2+1)); - if (Abs(knots->Value(index2 + 1) - U) <= Eps || index2 == index1) + if (std::abs(knots->Value(index2 + 1) - U) <= Eps || index2 == index1) { index2++; } @@ -774,7 +774,7 @@ void Geom2d_BSplineCurve::Segment(const Standard_Real aU1, Standard_Integer pindex2 = BSplCLib::PoleIndex(deg, index2, periodic, mults->Array1()); pindex1++; - pindex2 = Min(pindex2 + 1, poles->Length()); + pindex2 = std::min(pindex2 + 1, poles->Length()); Standard_Integer nbpoles = pindex2 - pindex1 + 1; @@ -817,7 +817,7 @@ void Geom2d_BSplineCurve::SetKnot(const Standard_Integer Index, const Standard_R { if (Index < 1 || Index > knots->Length()) throw Standard_OutOfRange("BSpline curve: SetKnot: Index and #knots mismatch"); - Standard_Real DK = Abs(Epsilon(K)); + Standard_Real DK = std::abs(Epsilon(K)); if (Index == 1) { if (K >= knots->Value(2) - DK) @@ -879,7 +879,7 @@ void Geom2d_BSplineCurve::SetPeriodic() Handle(TColStd_HArray1OfInteger) tm = mults; TColStd_Array1OfInteger cmults((mults->Array1())(first), first, last); - cmults(first) = cmults(last) = Min(deg, Max(cmults(first), cmults(last))); + cmults(first) = cmults(last) = std::min(deg, std::max(cmults(first), cmults(last))); mults = new TColStd_HArray1OfInteger(1, cmults.Length()); mults->ChangeArray1() = cmults; @@ -1064,7 +1064,7 @@ void Geom2d_BSplineCurve::SetWeight(const Standard_Integer Index, const Standard if (W <= gp::Resolution()) throw Standard_ConstructionError("BSpline curve: SetWeight: Weight too small"); - Standard_Boolean rat = IsRational() || (Abs(W - 1.) > gp::Resolution()); + Standard_Boolean rat = IsRational() || (std::abs(W - 1.) > gp::Resolution()); if (rat) { diff --git a/src/ModelingData/TKG2d/Geom2d/Geom2d_BSplineCurve.hxx b/src/ModelingData/TKG2d/Geom2d/Geom2d_BSplineCurve.hxx index 8955056100..b09736b9c2 100644 --- a/src/ModelingData/TKG2d/Geom2d/Geom2d_BSplineCurve.hxx +++ b/src/ModelingData/TKG2d/Geom2d/Geom2d_BSplineCurve.hxx @@ -785,8 +785,8 @@ public: //! Knots (I1) <= U <= Knots (I2) //! . if I1 = I2 U is a knot value (the tolerance criterion //! ParametricTolerance is used). - //! . if I1 < 1 => U < Knots (1) - Abs(ParametricTolerance) - //! . if I2 > NbKnots => U > Knots (NbKnots) + Abs(ParametricTolerance) + //! . if I1 < 1 => U < Knots (1) - std::abs(ParametricTolerance) + //! . if I2 > NbKnots => U > Knots (NbKnots) + std::abs(ParametricTolerance) Standard_EXPORT void LocateU(const Standard_Real U, const Standard_Real ParametricTolerance, Standard_Integer& I1, diff --git a/src/ModelingData/TKG2d/Geom2d/Geom2d_BSplineCurve_1.cxx b/src/ModelingData/TKG2d/Geom2d/Geom2d_BSplineCurve_1.cxx index abd4c67183..f70af76e9d 100644 --- a/src/ModelingData/TKG2d/Geom2d/Geom2d_BSplineCurve_1.cxx +++ b/src/ModelingData/TKG2d/Geom2d/Geom2d_BSplineCurve_1.cxx @@ -100,7 +100,7 @@ Standard_Boolean Geom2d_BSplineCurve::IsG1(const Standard_Real theTf, return Standard_False; } - if (Abs(aV1.Angle(aV2)) > theAngTol) + if (std::abs(aV1.Angle(aV2)) > theAngTol) return Standard_False; } @@ -130,7 +130,7 @@ Standard_Boolean Geom2d_BSplineCurve::IsG1(const Standard_Real theTf, return Standard_False; } - if (Abs(aV1.Angle(aV2)) > theAngTol) + if (std::abs(aV1.Angle(aV2)) > theAngTol) return Standard_False; return Standard_True; @@ -659,12 +659,12 @@ void Geom2d_BSplineCurve::LocateU(const Standard_Real U, PeriodicNormalization(NewU); // Attention a la periode Standard_Real UFirst = CKnots(1); Standard_Real ULast = CKnots(CKnots.Length()); - Standard_Real PParametricTolerance = Abs(ParametricTolerance); - if (Abs(NewU - UFirst) <= PParametricTolerance) + Standard_Real PParametricTolerance = std::abs(ParametricTolerance); + if (std::abs(NewU - UFirst) <= PParametricTolerance) { I1 = I2 = 1; } - else if (Abs(NewU - ULast) <= PParametricTolerance) + else if (std::abs(NewU - ULast) <= PParametricTolerance) { I1 = I2 = CKnots.Length(); } @@ -682,12 +682,12 @@ void Geom2d_BSplineCurve::LocateU(const Standard_Real U, { I1 = 1; BSplCLib::Hunt(CKnots, NewU, I1); - I1 = Max(Min(I1, CKnots.Upper()), CKnots.Lower()); - while (I1 + 1 <= CKnots.Upper() && Abs(CKnots(I1 + 1) - NewU) <= PParametricTolerance) + I1 = std::max(std::min(I1, CKnots.Upper()), CKnots.Lower()); + while (I1 + 1 <= CKnots.Upper() && std::abs(CKnots(I1 + 1) - NewU) <= PParametricTolerance) { I1++; } - if (Abs(CKnots(I1) - NewU) <= PParametricTolerance) + if (std::abs(CKnots(I1) - NewU) <= PParametricTolerance) { I2 = I1; } diff --git a/src/ModelingData/TKG2d/Geom2d/Geom2d_BezierCurve.cxx b/src/ModelingData/TKG2d/Geom2d/Geom2d_BezierCurve.cxx index 3ce6a72dd7..84dcf13221 100644 --- a/src/ModelingData/TKG2d/Geom2d/Geom2d_BezierCurve.cxx +++ b/src/ModelingData/TKG2d/Geom2d/Geom2d_BezierCurve.cxx @@ -53,7 +53,7 @@ static Standard_Boolean Rational(const TColStd_Array1OfReal& W) Standard_Boolean rat = Standard_False; for (i = 1; i < n; i++) { - rat = Abs(W(i) - W(i + 1)) > gp::Resolution(); + rat = std::abs(W(i) - W(i + 1)) > gp::Resolution(); if (rat) break; } @@ -228,7 +228,7 @@ void Geom2d_BezierCurve::InsertPoleAfter(const Standard_Integer Index, // Insert the weight Handle(TColStd_HArray1OfReal) nweights; - Standard_Boolean rat = IsRational() || Abs(Weight - 1.) > gp::Resolution(); + Standard_Boolean rat = IsRational() || std::abs(Weight - 1.) > gp::Resolution(); if (rat) { @@ -346,7 +346,7 @@ Standard_Real Geom2d_BezierCurve::ReversedParameter(const Standard_Real U) const void Geom2d_BezierCurve::Segment(const Standard_Real U1, const Standard_Real U2) { - closed = (Abs(Value(U1).Distance(Value(U2))) <= gp::Resolution()); + closed = (std::abs(Value(U1).Distance(Value(U2))) <= gp::Resolution()); // // WARNING: when calling trimming be careful that the cache // is computed regarding 0.0e0 and not 1.0e0 @@ -423,7 +423,7 @@ void Geom2d_BezierCurve::SetWeight(const Standard_Integer Index, const Standard_ if (!wasrat) { // a weight of 1. does not turn to rational - if (Abs(Weight - 1.) <= gp::Resolution()) + if (std::abs(Weight - 1.) <= gp::Resolution()) return; // set weights of 1. diff --git a/src/ModelingData/TKG2d/Geom2d/Geom2d_Circle.cxx b/src/ModelingData/TKG2d/Geom2d/Geom2d_Circle.cxx index bd224c95bb..8972bb3e14 100644 --- a/src/ModelingData/TKG2d/Geom2d/Geom2d_Circle.cxx +++ b/src/ModelingData/TKG2d/Geom2d/Geom2d_Circle.cxx @@ -201,7 +201,7 @@ Vec2d Geom2d_Circle::DN(const Standard_Real U, const Standard_Integer N) const void Geom2d_Circle::Transform(const Trsf2d& T) { - radius = radius * Abs(T.ScaleFactor()); + radius = radius * std::abs(T.ScaleFactor()); pos.Transform(T); } diff --git a/src/ModelingData/TKG2d/Geom2d/Geom2d_Circle.hxx b/src/ModelingData/TKG2d/Geom2d/Geom2d_Circle.hxx index 9ac3efc4ed..c544a62862 100644 --- a/src/ModelingData/TKG2d/Geom2d/Geom2d_Circle.hxx +++ b/src/ModelingData/TKG2d/Geom2d/Geom2d_Circle.hxx @@ -45,7 +45,7 @@ DEFINE_STANDARD_HANDLE(Geom2d_Circle, Geom2d_Conic) //! circle, determining the direction in which the //! parameter increases along the circle. //! The Geom2d_Circle circle is parameterized by an angle: -//! P(U) = O + R*Cos(U)*XDir + R*Sin(U)*YDir +//! P(U) = O + R*std::cos(U)*XDir + R*Sin(U)*YDir //! where: //! - P is the point of parameter U, //! - O, XDir and YDir are respectively the origin, "X diff --git a/src/ModelingData/TKG2d/Geom2d/Geom2d_Direction.cxx b/src/ModelingData/TKG2d/Geom2d/Geom2d_Direction.cxx index e2192d34f4..18bb908d12 100644 --- a/src/ModelingData/TKG2d/Geom2d/Geom2d_Direction.cxx +++ b/src/ModelingData/TKG2d/Geom2d/Geom2d_Direction.cxx @@ -41,7 +41,7 @@ Handle(Geom2d_Geometry) Geom2d_Direction::Copy() const Geom2d_Direction::Geom2d_Direction(const Standard_Real X, const Standard_Real Y) { - Standard_Real D = Sqrt(X * X + Y * Y); + Standard_Real D = std::sqrt(X * X + Y * Y); Standard_ConstructionError_Raise_if(D <= gp::Resolution(), "Geom2d_Direction() - input vector has zero length"); gpVec2d = gp_Vec2d(X / D, Y / D); @@ -55,7 +55,7 @@ Geom2d_Direction::Geom2d_Direction(const gp_Dir2d& V) void Geom2d_Direction::SetCoord(const Standard_Real X, const Standard_Real Y) { - Standard_Real D = Sqrt(X * X + Y * Y); + Standard_Real D = std::sqrt(X * X + Y * Y); Standard_ConstructionError_Raise_if( D <= gp::Resolution(), "Geom2d_Direction::SetCoord() - input vector has zero length"); @@ -70,7 +70,7 @@ void Geom2d_Direction::SetDir2d(const gp_Dir2d& V) void Geom2d_Direction::SetX(const Standard_Real X) { - Standard_Real D = Sqrt(X * X + gpVec2d.Y() * gpVec2d.Y()); + Standard_Real D = std::sqrt(X * X + gpVec2d.Y() * gpVec2d.Y()); Standard_ConstructionError_Raise_if(D <= gp::Resolution(), "Geom2d_Direction::SetX() - input vector has zero length"); gpVec2d = gp_Vec2d(X / D, gpVec2d.Y() / D); @@ -79,7 +79,7 @@ void Geom2d_Direction::SetX(const Standard_Real X) void Geom2d_Direction::SetY(const Standard_Real Y) { - Standard_Real D = Sqrt(gpVec2d.X() * gpVec2d.X() + Y * Y); + Standard_Real D = std::sqrt(gpVec2d.X() * gpVec2d.X() + Y * Y); Standard_ConstructionError_Raise_if(D <= gp::Resolution(), "Geom2d_Direction::SetY() - input vector has zero length"); gpVec2d = gp_Vec2d(gpVec2d.X() / D, Y / D); diff --git a/src/ModelingData/TKG2d/Geom2d/Geom2d_Direction.hxx b/src/ModelingData/TKG2d/Geom2d/Geom2d_Direction.hxx index 4faf370aee..35e059a321 100644 --- a/src/ModelingData/TKG2d/Geom2d/Geom2d_Direction.hxx +++ b/src/ModelingData/TKG2d/Geom2d/Geom2d_Direction.hxx @@ -36,7 +36,7 @@ class Geom2d_Direction : public Geom2d_Vector public: //! Creates a unit vector with it 2 cartesian coordinates. //! - //! Raised if Sqrt( X*X + Y*Y) <= Resolution from gp. + //! Raised if std::sqrt( X*X + Y*Y) <= Resolution from gp. Standard_EXPORT Geom2d_Direction(const Standard_Real X, const Standard_Real Y); //! Creates a persistent copy of . @@ -45,8 +45,7 @@ public: //! Assigns the coordinates X and Y to this unit vector, //! then normalizes it. //! Exceptions - //! Standard_ConstructionError if Sqrt(X*X + - //! Y*Y) is less than or equal to gp::Resolution(). + //! Standard_ConstructionError if std::sqrt(X*X + Y*Y) is less than or equal to gp::Resolution(). Standard_EXPORT void SetCoord(const Standard_Real X, const Standard_Real Y); //! Converts the gp_Dir2d unit vector V into this unit vector. diff --git a/src/ModelingData/TKG2d/Geom2d/Geom2d_Ellipse.cxx b/src/ModelingData/TKG2d/Geom2d/Geom2d_Ellipse.cxx index b91c509e96..7b6dc71c8d 100644 --- a/src/ModelingData/TKG2d/Geom2d/Geom2d_Ellipse.cxx +++ b/src/ModelingData/TKG2d/Geom2d/Geom2d_Ellipse.cxx @@ -162,7 +162,7 @@ Standard_Real Geom2d_Ellipse::Eccentricity() const } else { - return (Sqrt(majorRadius * majorRadius - minorRadius * minorRadius)) / majorRadius; + return (std::sqrt(majorRadius * majorRadius - minorRadius * minorRadius)) / majorRadius; } } @@ -170,14 +170,14 @@ Standard_Real Geom2d_Ellipse::Eccentricity() const Standard_Real Geom2d_Ellipse::Focal() const { - return 2.0 * Sqrt(majorRadius * majorRadius - minorRadius * minorRadius); + return 2.0 * std::sqrt(majorRadius * majorRadius - minorRadius * minorRadius); } //================================================================================================= Pnt2d Geom2d_Ellipse::Focus1() const { - Standard_Real C = Sqrt(majorRadius * majorRadius - minorRadius * minorRadius); + Standard_Real C = std::sqrt(majorRadius * majorRadius - minorRadius * minorRadius); return Pnt2d(pos.Location().X() + C * pos.XDirection().X(), pos.Location().Y() + C * pos.XDirection().Y()); } @@ -186,7 +186,7 @@ Pnt2d Geom2d_Ellipse::Focus1() const Pnt2d Geom2d_Ellipse::Focus2() const { - Standard_Real C = Sqrt(majorRadius * majorRadius - minorRadius * minorRadius); + Standard_Real C = std::sqrt(majorRadius * majorRadius - minorRadius * minorRadius); return Pnt2d(pos.Location().X() - C * pos.XDirection().X(), pos.Location().Y() - C * pos.XDirection().Y()); } @@ -283,8 +283,8 @@ Vec2d Geom2d_Ellipse::DN(const Standard_Real U, const Standard_Integer N) const void Geom2d_Ellipse::Transform(const Trsf2d& T) { - majorRadius = majorRadius * Abs(T.ScaleFactor()); - minorRadius = minorRadius * Abs(T.ScaleFactor()); + majorRadius = majorRadius * std::abs(T.ScaleFactor()); + minorRadius = minorRadius * std::abs(T.ScaleFactor()); pos.Transform(T); } diff --git a/src/ModelingData/TKG2d/Geom2d/Geom2d_Ellipse.hxx b/src/ModelingData/TKG2d/Geom2d/Geom2d_Ellipse.hxx index aaea128363..48e8abe31e 100644 --- a/src/ModelingData/TKG2d/Geom2d/Geom2d_Ellipse.hxx +++ b/src/ModelingData/TKG2d/Geom2d/Geom2d_Ellipse.hxx @@ -46,7 +46,7 @@ DEFINE_STANDARD_HANDLE(Geom2d_Ellipse, Geom2d_Conic) //! ellipse, determining the direction in which the //! parameter increases along the ellipse. //! The Geom2d_Ellipse ellipse is parameterized by an angle: -//! P(U) = O + MajorRad*Cos(U)*XDir + MinorRad*Sin(U)*YDir +//! P(U) = O + MajorRad*std::cos(U)*XDir + MinorRad*Sin(U)*YDir //! where: //! - P is the point of parameter U, //! - O, XDir and YDir are respectively the origin, "X diff --git a/src/ModelingData/TKG2d/Geom2d/Geom2d_Hyperbola.cxx b/src/ModelingData/TKG2d/Geom2d/Geom2d_Hyperbola.cxx index ad1cee885a..0bdc2443cd 100644 --- a/src/ModelingData/TKG2d/Geom2d/Geom2d_Hyperbola.cxx +++ b/src/ModelingData/TKG2d/Geom2d/Geom2d_Hyperbola.cxx @@ -209,21 +209,21 @@ Ax2d Geom2d_Hyperbola::Directrix2() const Standard_Real Geom2d_Hyperbola::Eccentricity() const { Standard_DomainError_Raise_if(majorRadius <= gp::Resolution(), " "); - return (Sqrt(majorRadius * majorRadius + minorRadius * minorRadius)) / majorRadius; + return (std::sqrt(majorRadius * majorRadius + minorRadius * minorRadius)) / majorRadius; } //================================================================================================= Standard_Real Geom2d_Hyperbola::Focal() const { - return 2.0 * Sqrt(majorRadius * majorRadius + minorRadius * minorRadius); + return 2.0 * std::sqrt(majorRadius * majorRadius + minorRadius * minorRadius); } //================================================================================================= Pnt2d Geom2d_Hyperbola::Focus1() const { - Standard_Real C = Sqrt(majorRadius * majorRadius + minorRadius * minorRadius); + Standard_Real C = std::sqrt(majorRadius * majorRadius + minorRadius * minorRadius); XY Pxy = pos.XDirection().XY(); Pxy.Multiply(C); Pxy.Add(pos.Location().XY()); @@ -234,7 +234,7 @@ Pnt2d Geom2d_Hyperbola::Focus1() const Pnt2d Geom2d_Hyperbola::Focus2() const { - Standard_Real C = Sqrt(majorRadius * majorRadius + minorRadius * minorRadius); + Standard_Real C = std::sqrt(majorRadius * majorRadius + minorRadius * minorRadius); XY Pxy = pos.XDirection().XY(); Pxy.Multiply(-C); Pxy.Add(pos.Location().XY()); @@ -311,8 +311,8 @@ Vec2d Geom2d_Hyperbola::DN(const Standard_Real U, const Standard_Integer N) cons void Geom2d_Hyperbola::Transform(const Trsf2d& T) { - majorRadius = majorRadius * Abs(T.ScaleFactor()); - minorRadius = minorRadius * Abs(T.ScaleFactor()); + majorRadius = majorRadius * std::abs(T.ScaleFactor()); + minorRadius = minorRadius * std::abs(T.ScaleFactor()); pos.Transform(T); } diff --git a/src/ModelingData/TKG2d/Geom2d/Geom2d_Hyperbola.hxx b/src/ModelingData/TKG2d/Geom2d/Geom2d_Hyperbola.hxx index c8c58e9679..7602ff12f8 100644 --- a/src/ModelingData/TKG2d/Geom2d/Geom2d_Hyperbola.hxx +++ b/src/ModelingData/TKG2d/Geom2d/Geom2d_Hyperbola.hxx @@ -49,7 +49,7 @@ DEFINE_STANDARD_HANDLE(Geom2d_Hyperbola, Geom2d_Conic) //! hyperbola, determining the direction in which the //! parameter increases along the hyperbola. //! The Geom2d_Hyperbola hyperbola is parameterized as follows: -//! P(U) = O + MajRad*Cosh(U)*XDir + MinRad*Sinh(U)*YDir +//! P(U) = O + MajRad*std::cosh(U)*XDir + MinRad*std::sinh(U)*YDir //! where: //! - P is the point of parameter U, //! - O, XDir and YDir are respectively the origin, "X @@ -249,8 +249,8 @@ public: Standard_EXPORT Standard_Real Parameter() const; //! Returns in P the point of parameter U. - //! P = C + MajorRadius * Cosh (U) * XDir + - //! MinorRadius * Sinh (U) * YDir + //! P = C + MajorRadius * std::cosh(U) * XDir + + //! MinorRadius * std::sinh(U) * YDir //! where C is the center of the hyperbola , XDir the XDirection and //! YDir the YDirection of the hyperbola's local coordinate system. Standard_EXPORT void D0(const Standard_Real U, gp_Pnt2d& P) const Standard_OVERRIDE; diff --git a/src/ModelingData/TKG2d/Geom2d/Geom2d_Line.cxx b/src/ModelingData/TKG2d/Geom2d/Geom2d_Line.cxx index 2d1284ee1b..7ec206cef3 100644 --- a/src/ModelingData/TKG2d/Geom2d/Geom2d_Line.cxx +++ b/src/ModelingData/TKG2d/Geom2d/Geom2d_Line.cxx @@ -234,14 +234,14 @@ Standard_Real Geom2d_Line::TransformedParameter(const Standard_Real U, const gp_ { if (Precision::IsInfinite(U)) return U; - return U * Abs(T.ScaleFactor()); + return U * std::abs(T.ScaleFactor()); } //================================================================================================= Standard_Real Geom2d_Line::ParametricTransformation(const gp_Trsf2d& T) const { - return Abs(T.ScaleFactor()); + return std::abs(T.ScaleFactor()); } //================================================================================================= diff --git a/src/ModelingData/TKG2d/Geom2d/Geom2d_OffsetCurve.cxx b/src/ModelingData/TKG2d/Geom2d/Geom2d_OffsetCurve.cxx index 18d4db28fa..c7346953af 100644 --- a/src/ModelingData/TKG2d/Geom2d/Geom2d_OffsetCurve.cxx +++ b/src/ModelingData/TKG2d/Geom2d/Geom2d_OffsetCurve.cxx @@ -313,7 +313,7 @@ Standard_Real Geom2d_OffsetCurve::Period() const void Geom2d_OffsetCurve::Transform(const gp_Trsf2d& T) { basisCurve->Transform(T); - offsetValue *= Abs(T.ScaleFactor()); + offsetValue *= std::abs(T.ScaleFactor()); myEvaluator->SetOffsetValue(offsetValue); } diff --git a/src/ModelingData/TKG2d/Geom2d/Geom2d_Parabola.cxx b/src/ModelingData/TKG2d/Geom2d/Geom2d_Parabola.cxx index 869f4d4b72..f7113a8528 100644 --- a/src/ModelingData/TKG2d/Geom2d/Geom2d_Parabola.cxx +++ b/src/ModelingData/TKG2d/Geom2d/Geom2d_Parabola.cxx @@ -231,7 +231,7 @@ Vec2d Geom2d_Parabola::DN(const Standard_Real U, const Standard_Integer N) const void Geom2d_Parabola::Transform(const Trsf2d& T) { - focalLength *= Abs(T.ScaleFactor()); + focalLength *= std::abs(T.ScaleFactor()); pos.Transform(T); } @@ -241,14 +241,14 @@ Standard_Real Geom2d_Parabola::TransformedParameter(const Standard_Real U, const { if (Precision::IsInfinite(U)) return U; - return U * Abs(T.ScaleFactor()); + return U * std::abs(T.ScaleFactor()); } //================================================================================================= Standard_Real Geom2d_Parabola::ParametricTransformation(const gp_Trsf2d& T) const { - return Abs(T.ScaleFactor()); + return std::abs(T.ScaleFactor()); } //================================================================================================= diff --git a/src/ModelingData/TKG2d/Geom2d/Geom2d_TrimmedCurve.cxx b/src/ModelingData/TKG2d/Geom2d/Geom2d_TrimmedCurve.cxx index ab926ef490..b2be3192d3 100644 --- a/src/ModelingData/TKG2d/Geom2d/Geom2d_TrimmedCurve.cxx +++ b/src/ModelingData/TKG2d/Geom2d/Geom2d_TrimmedCurve.cxx @@ -112,7 +112,7 @@ void Geom2d_TrimmedCurve::SetTrim(const Standard_Real U1, if (theAdjustPeriodic) ElCLib::AdjustPeriodic(Udeb, Ufin, - Min(Abs(uTrim2 - uTrim1) / 2, Precision::PConfusion()), + std::min(std::abs(uTrim2 - uTrim1) / 2, Precision::PConfusion()), uTrim1, uTrim2); } diff --git a/src/ModelingData/TKG2d/Geom2dAdaptor/Geom2dAdaptor.cxx b/src/ModelingData/TKG2d/Geom2dAdaptor/Geom2dAdaptor.cxx index 0d6a29b0a3..b5ac71eef1 100644 --- a/src/ModelingData/TKG2d/Geom2dAdaptor/Geom2dAdaptor.cxx +++ b/src/ModelingData/TKG2d/Geom2dAdaptor/Geom2dAdaptor.cxx @@ -107,8 +107,8 @@ Handle(Geom2d_Curve) Geom2dAdaptor::MakeCurve(const Adaptor2d_Curve2d& HC) } else { - Standard_Real tf = Max(HC.FirstParameter(), C2D->FirstParameter()); - Standard_Real tl = Min(HC.LastParameter(), C2D->LastParameter()); + Standard_Real tf = std::max(HC.FirstParameter(), C2D->FirstParameter()); + Standard_Real tl = std::min(HC.LastParameter(), C2D->LastParameter()); C2D = new Geom2d_TrimmedCurve(C2D, tf, tl); } } diff --git a/src/ModelingData/TKG2d/Geom2dAdaptor/Geom2dAdaptor_Curve.cxx b/src/ModelingData/TKG2d/Geom2dAdaptor/Geom2dAdaptor_Curve.cxx index 274c5b097e..18c55bcd38 100644 --- a/src/ModelingData/TKG2d/Geom2dAdaptor/Geom2dAdaptor_Curve.cxx +++ b/src/ModelingData/TKG2d/Geom2dAdaptor/Geom2dAdaptor_Curve.cxx @@ -116,12 +116,12 @@ GeomAbs_Shape Geom2dAdaptor_Curve::LocalContinuity(const Standard_Real U1, Nb, Index2, newLast); - if (Abs(newFirst - TK(Index1 + 1)) < Precision::PConfusion()) + if (std::abs(newFirst - TK(Index1 + 1)) < Precision::PConfusion()) { if (Index1 < Nb) Index1++; } - if (Abs(newLast - TK(Index2)) < Precision::PConfusion()) + if (std::abs(newLast - TK(Index2)) < Precision::PConfusion()) Index2--; Standard_Integer MultMax; // attention aux courbes peridiques. @@ -350,7 +350,7 @@ Standard_Integer Geom2dAdaptor_Curve::NbIntervals(const GeomAbs_Shape S) const throw Standard_DomainError("Geom2dAdaptor_Curve::NbIntervals()"); } - Standard_Real anEps = Min(Resolution(Precision::Confusion()), Precision::PConfusion()); + Standard_Real anEps = std::min(Resolution(Precision::Confusion()), Precision::PConfusion()); return BSplCLib::Intervals(myBSplineCurve->Knots(), myBSplineCurve->Multiplicities(), @@ -432,7 +432,7 @@ void Geom2dAdaptor_Curve::Intervals(TColStd_Array1OfReal& T, const GeomAbs_Shape throw Standard_DomainError("Geom2dAdaptor_Curve::Intervals()"); } - Standard_Real anEps = Min(Resolution(Precision::Confusion()), Precision::PConfusion()); + Standard_Real anEps = std::min(Resolution(Precision::Confusion()), Precision::PConfusion()); BSplCLib::Intervals(myBSplineCurve->Knots(), myBSplineCurve->Multiplicities(), @@ -766,7 +766,7 @@ Standard_Real Geom2dAdaptor_Curve::Resolution(const Standard_Real Ruv) const case GeomAbs_Circle: { Standard_Real R = Handle(Geom2d_Circle)::DownCast(myCurve)->Circ2d().Radius(); if (R > Ruv / 2.) - return 2 * ASin(Ruv / (2 * R)); + return 2 * std::asin(Ruv / (2 * R)); else return 2 * M_PI; } @@ -921,13 +921,13 @@ static Standard_Integer nbPoints(const Handle(Geom2d_Curve)& theCurve) else if (theCurve->IsKind(STANDARD_TYPE(Geom2d_OffsetCurve))) { Handle(Geom2d_Curve) aCurve = Handle(Geom2d_OffsetCurve)::DownCast(theCurve)->BasisCurve(); - return Max(nbs, nbPoints(aCurve)); + return std::max(nbs, nbPoints(aCurve)); } else if (theCurve->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve))) { Handle(Geom2d_Curve) aCurve = Handle(Geom2d_TrimmedCurve)::DownCast(theCurve)->BasisCurve(); - return Max(nbs, nbPoints(aCurve)); + return std::max(nbs, nbPoints(aCurve)); } if (nbs > 300) nbs = 300; diff --git a/src/ModelingData/TKG2d/Geom2dEvaluator/Geom2dEvaluator.cxx b/src/ModelingData/TKG2d/Geom2dEvaluator/Geom2dEvaluator.cxx index d4567d0a6b..753cc44eea 100644 --- a/src/ModelingData/TKG2d/Geom2dEvaluator/Geom2dEvaluator.cxx +++ b/src/ModelingData/TKG2d/Geom2dEvaluator/Geom2dEvaluator.cxx @@ -47,7 +47,7 @@ void Geom2dEvaluator::CalculateD1(gp_Pnt2d& theValue, gp_XY Ndir(theD1.Y(), -theD1.X()); gp_XY DNdir(theD2.Y(), -theD2.X()); Standard_Real R2 = Ndir.SquareModulus(); - Standard_Real R = Sqrt(R2); + Standard_Real R = std::sqrt(R2); Standard_Real R3 = R * R2; Standard_Real Dr = Ndir.Dot(DNdir); if (R3 <= gp::Resolution()) @@ -94,7 +94,7 @@ void Geom2dEvaluator::CalculateD2(gp_Pnt2d& theValue, gp_XY DNdir(theD2.Y(), -theD2.X()); gp_XY D2Ndir(theD3.Y(), -theD3.X()); Standard_Real R2 = Ndir.SquareModulus(); - Standard_Real R = Sqrt(R2); + Standard_Real R = std::sqrt(R2); Standard_Real R3 = R2 * R; Standard_Real R4 = R2 * R2; Standard_Real R5 = R3 * R2; @@ -167,7 +167,7 @@ void Geom2dEvaluator::CalculateD3(gp_Pnt2d& theValue, gp_XY D2Ndir(theD3.Y(), -theD3.X()); gp_XY D3Ndir(theD4.Y(), -theD4.X()); Standard_Real R2 = Ndir.SquareModulus(); - Standard_Real R = Sqrt(R2); + Standard_Real R = std::sqrt(R2); Standard_Real R3 = R2 * R; Standard_Real R4 = R2 * R2; Standard_Real R5 = R3 * R2; diff --git a/src/ModelingData/TKG2d/Geom2dEvaluator/Geom2dEvaluator_OffsetCurve.cxx b/src/ModelingData/TKG2d/Geom2dEvaluator/Geom2dEvaluator_OffsetCurve.cxx index 4d23f774f7..8db3a7f080 100644 --- a/src/ModelingData/TKG2d/Geom2dEvaluator/Geom2dEvaluator_OffsetCurve.cxx +++ b/src/ModelingData/TKG2d/Geom2dEvaluator/Geom2dEvaluator_OffsetCurve.cxx @@ -227,7 +227,7 @@ Standard_Boolean Geom2dEvaluator_OffsetCurve::AdjustDerivative( else du = anUsupremum - anUinfium; - const Standard_Real aDelta = Max(du * DivisionFactor, aMinStep); + const Standard_Real aDelta = std::max(du * DivisionFactor, aMinStep); // Derivative is approximated by Taylor-series Standard_Integer anIndex = 1; // Derivative order @@ -246,8 +246,8 @@ Standard_Boolean Geom2dEvaluator_OffsetCurve::AdjustDerivative( u = theU - aDelta; gp_Pnt2d P1, P2; - BaseD0(Min(theU, u), P1); - BaseD0(Max(theU, u), P2); + BaseD0(std::min(theU, u), P1); + BaseD0(std::max(theU, u), P2); gp_Vec2d V1(P1, P2); isDirectionChange = V.Dot(V1) < 0.0; diff --git a/src/ModelingData/TKG2d/Geom2dLProp/Geom2dLProp_FuncCurExt.cxx b/src/ModelingData/TKG2d/Geom2dLProp/Geom2dLProp_FuncCurExt.cxx index a863ee7b93..97540a8d3b 100644 --- a/src/ModelingData/TKG2d/Geom2dLProp/Geom2dLProp_FuncCurExt.cxx +++ b/src/ModelingData/TKG2d/Geom2dLProp/Geom2dLProp_FuncCurExt.cxx @@ -43,7 +43,7 @@ Standard_Boolean Geom2dLProp_FuncCurExt::Value(const Standard_Real X, Standard_R Standard_Real CPV1V3 = V1.Crossed(V3); Standard_Real V1V2 = V1.Dot(V2); Standard_Real V1V1 = V1.SquareMagnitude(); - Standard_Real NV1 = Sqrt(V1V1); + Standard_Real NV1 = std::sqrt(V1V1); Standard_Real V13 = V1V1 * NV1; Standard_Real V15 = V13 * V1V1; @@ -100,7 +100,7 @@ Standard_Boolean Geom2dLProp_FuncCurExt::IsMinKC(const Standard_Real X) const Geom2dLProp_Curve2dTool::D3(theCurve, X, P1, V1, V2, V3); Standard_Real CPV1V2 = V1.Crossed(V2); Standard_Real V1V1 = V1.SquareMagnitude(); - Standard_Real NV1 = Sqrt(V1V1); + Standard_Real NV1 = std::sqrt(V1V1); Standard_Real V13 = V1V1 * NV1; if (V13 < gp::Resolution()) @@ -118,7 +118,7 @@ Standard_Boolean Geom2dLProp_FuncCurExt::IsMinKC(const Standard_Real X) const Geom2dLProp_Curve2dTool::D3(theCurve, X + Dx, P1, V1, V2, V3); CPV1V2 = V1.Crossed(V2); V1V1 = V1.SquareMagnitude(); - NV1 = Sqrt(V1V1); + NV1 = std::sqrt(V1V1); V13 = V1V1 * NV1; if (V13 < gp::Resolution()) @@ -127,7 +127,7 @@ Standard_Boolean Geom2dLProp_FuncCurExt::IsMinKC(const Standard_Real X) const } KP = CPV1V2 / V13; - if (Abs(KC) > Abs(KP)) + if (std::abs(KC) > std::abs(KP)) { return Standard_True; } diff --git a/src/ModelingData/TKG2d/Geom2dLProp/Geom2dLProp_FuncCurNul.cxx b/src/ModelingData/TKG2d/Geom2dLProp/Geom2dLProp_FuncCurNul.cxx index 7822372139..46d25e8b61 100644 --- a/src/ModelingData/TKG2d/Geom2dLProp/Geom2dLProp_FuncCurNul.cxx +++ b/src/ModelingData/TKG2d/Geom2dLProp/Geom2dLProp_FuncCurNul.cxx @@ -66,7 +66,7 @@ Standard_Boolean Geom2dLProp_FuncCurNul::Values(const Standard_Real X, D = 0.; /* - if (Abs(CP1) < 1.e-4) { + if (std::abs(CP1) < 1.e-4) { return Standard_True; } else */ diff --git a/src/ModelingData/TKG2d/LProp/LProp_CLProps.gxx b/src/ModelingData/TKG2d/LProp/LProp_CLProps.gxx index 072f6ef73f..44b7ddd6e7 100644 --- a/src/ModelingData/TKG2d/LProp/LProp_CLProps.gxx +++ b/src/ModelingData/TKG2d/LProp/LProp_CLProps.gxx @@ -189,7 +189,7 @@ void LProp_CLProps::Tangent(Dir& D) else du = anUsupremum - anUinfium; - const Standard_Real aDelta = Max(du * DivisionFactor, MinStep); + const Standard_Real aDelta = std::max(du * DivisionFactor, MinStep); Vec V = myDerivArr[mySignificantFirstDerivativeOrder - 1]; @@ -201,8 +201,8 @@ void LProp_CLProps::Tangent(Dir& D) u = myU - aDelta; Pnt P1, P2; - Tool::Value(myCurve, Min(myU, u), P1); - Tool::Value(myCurve, Max(myU, u), P2); + Tool::Value(myCurve, std::min(myU, u), P1); + Tool::Value(myCurve, std::max(myU, u), P2); Vec V1(P1, P2); Standard_Real aDirFactor = V.Dot(V1); @@ -256,7 +256,7 @@ Standard_Real LProp_CLProps::Curvature() void LProp_CLProps::Normal(Dir& D) { Standard_Real c = Curvature(); - if (c == RealLast() || Abs(c) <= myLinTol) + if (c == RealLast() || std::abs(c) <= myLinTol) { throw LProp_NotDefined("LProp_CLProps::Normal(...):" "Curvature is null or infinity"); @@ -273,7 +273,7 @@ void LProp_CLProps::Normal(Dir& D) void LProp_CLProps::CentreOfCurvature(Pnt& P) { - if (Abs(Curvature()) <= myLinTol) + if (std::abs(Curvature()) <= myLinTol) { throw LProp_NotDefined(); } diff --git a/src/ModelingData/TKG2d/LProp/LProp_SLProps.gxx b/src/ModelingData/TKG2d/LProp/LProp_SLProps.gxx index c8e461dac2..393267dedc 100644 --- a/src/ModelingData/TKG2d/LProp/LProp_SLProps.gxx +++ b/src/ModelingData/TKG2d/LProp/LProp_SLProps.gxx @@ -239,7 +239,7 @@ void LProp_SLProps::TangentU(gp_Dir& D) else du = anUsupremum - anUinfium; - const Standard_Real aDeltaU = Max(du * DivisionFactor, MinStep); + const Standard_Real aDeltaU = std::max(du * DivisionFactor, MinStep); gp_Vec V = myD2u; @@ -251,8 +251,8 @@ void LProp_SLProps::TangentU(gp_Dir& D) u = myU - aDeltaU; gp_Pnt P1, P2; - Tool::Value(mySurf, Min(myU, u), myV, P1); - Tool::Value(mySurf, Max(myU, u), myV, P2); + Tool::Value(mySurf, std::min(myU, u), myV, P1); + Tool::Value(mySurf, std::max(myU, u), myV, P2); gp_Vec V1(P1, P2); Standard_Real aDirFactor = V.Dot(V1); @@ -301,7 +301,7 @@ void LProp_SLProps::TangentV(gp_Dir& D) else dv = anVsupremum - anVinfium; - const Standard_Real aDeltaV = Max(dv * DivisionFactor, MinStep); + const Standard_Real aDeltaV = std::max(dv * DivisionFactor, MinStep); gp_Vec V = myD2v; @@ -313,8 +313,8 @@ void LProp_SLProps::TangentV(gp_Dir& D) v = myV - aDeltaV; gp_Pnt P1, P2; - Tool::Value(mySurf, myU, Min(myV, v), P1); - Tool::Value(mySurf, myU, Max(myV, v), P2); + Tool::Value(mySurf, myU, std::min(myV, v), P1); + Tool::Value(mySurf, myU, std::max(myV, v), P2); gp_Vec V1(P1, P2); Standard_Real aDirFactor = V.Dot(V1); @@ -407,7 +407,7 @@ Standard_Boolean LProp_SLProps::IsCurvatureDefined() Standard_Real B = E * N - G * L; Standard_Real C = F * N - G * M; - Standard_Real MaxABC = Max(Max(Abs(A), Abs(B)), Abs(C)); + Standard_Real MaxABC = std::max(std::max(std::abs(A), std::abs(B)), std::abs(C)); if (MaxABC < RealEpsilon()) // ombilic { myMinCurv = N / G; @@ -426,7 +426,7 @@ Standard_Boolean LProp_SLProps::IsCurvatureDefined() Standard_Real Curv1, Curv2, Root1, Root2; gp_Vec VectCurv1, VectCurv2; - if (Abs(A) > RealEpsilon()) + if (std::abs(A) > RealEpsilon()) { math_DirectPolynomialRoots Root(A, B, C); if (Root.NbSolutions() != 2) @@ -444,7 +444,7 @@ Standard_Boolean LProp_SLProps::IsCurvatureDefined() VectCurv2 = Root2 * myD1u + myD1v; } } - else if (Abs(C) > RealEpsilon()) + else if (std::abs(C) > RealEpsilon()) { math_DirectPolynomialRoots Root(C, B, A); @@ -498,7 +498,7 @@ Standard_Boolean LProp_SLProps::IsUmbilic() if (!IsCurvatureDefined()) throw LProp_NotDefined(); - return Abs(myMaxCurv - myMinCurv) < Abs(Epsilon(myMaxCurv)); + return std::abs(myMaxCurv - myMinCurv) < std::abs(Epsilon(myMaxCurv)); } Standard_Real LProp_SLProps::MaxCurvature() diff --git a/src/ModelingData/TKG3d/Adaptor3d/Adaptor3d_CurveOnSurface.cxx b/src/ModelingData/TKG3d/Adaptor3d/Adaptor3d_CurveOnSurface.cxx index 023d7c63d8..6aecc442b3 100644 --- a/src/ModelingData/TKG3d/Adaptor3d/Adaptor3d_CurveOnSurface.cxx +++ b/src/ModelingData/TKG3d/Adaptor3d/Adaptor3d_CurveOnSurface.cxx @@ -163,14 +163,14 @@ static void Hunt(const TColStd_Array1OfReal& Arr, const Standard_Real Coord, Sta // when coordinate component definitely equals a knot only. constexpr Standard_Real Tol = Precision::PConfusion() / 10; Standard_Integer i = 1; - while ((i <= Arr.Upper()) && (Abs(Coord - Arr(i)) > Tol)) + while ((i <= Arr.Upper()) && (std::abs(Coord - Arr(i)) > Tol)) { i++; } - if (Abs(Coord - Arr(i)) < Tol) + if (std::abs(Coord - Arr(i)) < Tol) Iloc = i; - else if (Abs(Coord - Arr(i)) > Tol) + else if (std::abs(Coord - Arr(i)) > Tol) throw Standard_NotImplemented("Adaptor3d_CurveOnSurface:Hunt"); } @@ -230,9 +230,9 @@ static void FindBounds(const TColStd_Array1OfReal& Arr, if (N == Bound1) { - if (Abs(Der) > Tol) + if (std::abs(Der) > Tol) DerNull = Standard_False; - if (Abs(Der) <= Tol) + if (std::abs(Der) <= Tol) DerNull = Standard_True; Bound1 = N; Bound2 = N + 1; @@ -240,9 +240,9 @@ static void FindBounds(const TColStd_Array1OfReal& Arr, } if (N == Bound2) { - if (Abs(Der) > Tol) + if (std::abs(Der) > Tol) DerNull = Standard_False; - if (Abs(Der) <= Tol) + if (std::abs(Der) <= Tol) DerNull = Standard_True; Bound1 = N - 1; Bound2 = N; @@ -250,7 +250,7 @@ static void FindBounds(const TColStd_Array1OfReal& Arr, } if ((N != Bound1) && (N != Bound2)) { - if (Abs(Der) > Tol) + if (std::abs(Der) > Tol) { if (Der > 0) { @@ -264,7 +264,7 @@ static void FindBounds(const TColStd_Array1OfReal& Arr, } DerNull = Standard_False; } - if (Abs(Der) <= Tol) + if (std::abs(Der) <= Tol) { DerNull = Standard_True; Bound1 = N - 1; @@ -303,11 +303,11 @@ static void Locate1Coord(const Standard_Integer Index, Standard_Integer Lo = BSplC->FirstUKnotIndex(), Up = BSplC->LastUKnotIndex(); i = Lo; - while ((Abs(BSplC->Knot(i) - Comp1) > Tol) && (i != Up)) + while ((std::abs(BSplC->Knot(i) - Comp1) > Tol) && (i != Up)) i++; cur = BSplC->Knot(i); - if (Abs(Comp1 - cur) <= Tol) + if (std::abs(Comp1 - cur) <= Tol) { Bnd1 = Lo; @@ -330,7 +330,7 @@ static void Locate1Coord(const Standard_Integer Index, } else if (DIsNull == Standard_True) { - if (Abs(Comp1 - (f = BSplC->Knot(Lo))) <= Tol) + if (std::abs(Comp1 - (f = BSplC->Knot(Lo))) <= Tol) { if (Index == 1) { @@ -343,7 +343,7 @@ static void Locate1Coord(const Standard_Integer Index, RightTop.SetY(BSplC->Knot(Lo + 1)); } } - else if (Abs(Comp1 - (l = BSplC->Knot(Up))) <= Tol) + else if (std::abs(Comp1 - (l = BSplC->Knot(Up))) <= Tol) { if (Index == 1) { @@ -385,7 +385,7 @@ static void Locate1Coord(const Standard_Integer Index, if (i != Up) { - if (Abs(DComp1) < Tol) + if (std::abs(DComp1) < Tol) { if (Index == 1) { @@ -398,7 +398,7 @@ static void Locate1Coord(const Standard_Integer Index, RightTop.SetY(l); } } - else if (Abs(DComp1) > Tol) + else if (std::abs(DComp1) > Tol) { if (Index == 1) { @@ -474,7 +474,7 @@ static void Locate1Coord(const Standard_Integer Index, Up = Up1; Down = Down1; - while ((Abs(BSplS->UKnot(i) - Comp1) > Tol) && (i != Up1)) + while ((std::abs(BSplS->UKnot(i) - Comp1) > Tol) && (i != Up1)) { i++; } @@ -489,7 +489,7 @@ static void Locate1Coord(const Standard_Integer Index, Up = Up2; Down = Down2; - while ((Abs(BSplS->VKnot(i) - Comp1) > Tol) && (i != Up2)) + while ((std::abs(BSplS->VKnot(i) - Comp1) > Tol) && (i != Up2)) { i++; } @@ -497,7 +497,7 @@ static void Locate1Coord(const Standard_Integer Index, cur = BSplS->VKnot(i); } - if (Abs(Comp1 - cur) <= Tol) + if (std::abs(Comp1 - cur) <= Tol) { Standard_Integer Bnd1 = Down, Bnd2 = Up; if (Index == 1) @@ -594,7 +594,7 @@ static void Locate1Coord(const Standard_Integer Index, if (i != Up) { - if (Abs(DComp1) > Tol) + if (std::abs(DComp1) > Tol) { if (Index == 1) { @@ -625,7 +625,7 @@ static void Locate1Coord(const Standard_Integer Index, } else { - if (Abs(DComp1) < Tol) + if (std::abs(DComp1) < Tol) { if (Index == 1) { @@ -685,7 +685,7 @@ static void Locate2Coord(const Standard_Integer Index, if ((Comp1 != I1) && (Comp1 != I2)) { - if (Abs(DComp1) > Tol) + if (std::abs(DComp1) > Tol) { if (DComp1 < 0) { @@ -727,7 +727,7 @@ static void Locate2Coord(const Standard_Integer Index, } } } - else if (Abs(DComp1) <= Tol) + else if (std::abs(DComp1) <= Tol) { if (Index == 1) { @@ -741,7 +741,7 @@ static void Locate2Coord(const Standard_Integer Index, } } } - else if (Abs(Comp1 - I1) < Tol) + else if (std::abs(Comp1 - I1) < Tol) { if (Index == 1) { @@ -754,7 +754,7 @@ static void Locate2Coord(const Standard_Integer Index, RightTop.SetY(I2); } } - else if (Abs(Comp1 - I2) < Tol) + else if (std::abs(Comp1 - I2) < Tol) { if (Index == 1) { @@ -797,7 +797,7 @@ static void Locate2Coord(const Standard_Integer Index, NLo = BSplS->FirstVKnotIndex(); } - if ((DComp > 0) && (Abs(DComp) > Tol)) + if ((DComp > 0) && (std::abs(DComp) > Tol)) { Hunt(Arr, Comp, N); if (N >= NUp) @@ -829,7 +829,7 @@ static void Locate2Coord(const Standard_Integer Index, RightTop.SetY(Tmp2); } } - else if ((DComp < 0) && (Abs(DComp) > Tol)) + else if ((DComp < 0) && (std::abs(DComp) > Tol)) { Hunt(Arr, Comp, N); if (N <= NLo) @@ -1196,13 +1196,13 @@ void Adaptor3d_CurveOnSurface::D1(const Standard_Real U, gp_Pnt& P, gp_Vec& V) c Standard_Real LP = myCurve->LastParameter(); constexpr Standard_Real Tol = Precision::PConfusion() / 10; - if ((Abs(U - FP) < Tol) && (!myFirstSurf.IsNull())) + if ((std::abs(U - FP) < Tol) && (!myFirstSurf.IsNull())) { myCurve->D1(U, Puv, Duv); myFirstSurf->D1(Puv.X(), Puv.Y(), P, D1U, D1V); V.SetLinearForm(Duv.X(), D1U, Duv.Y(), D1V); } - else if ((Abs(U - LP) < Tol) && (!myLastSurf.IsNull())) + else if ((std::abs(U - LP) < Tol) && (!myLastSurf.IsNull())) { myCurve->D1(U, Puv, Duv); myLastSurf->D1(Puv.X(), Puv.Y(), P, D1U, D1V); @@ -1232,7 +1232,7 @@ void Adaptor3d_CurveOnSurface::D2(const Standard_Real U, gp_Pnt& P, gp_Vec& V1, Standard_Real LP = myCurve->LastParameter(); constexpr Standard_Real Tol = Precision::PConfusion() / 10; - if ((Abs(U - FP) < Tol) && (!myFirstSurf.IsNull())) + if ((std::abs(U - FP) < Tol) && (!myFirstSurf.IsNull())) { myCurve->D2(U, UV, DW, D2W); myFirstSurf->D2(UV.X(), UV.Y(), P, D1U, D1V, D2U, D2V, D2UV); @@ -1241,7 +1241,7 @@ void Adaptor3d_CurveOnSurface::D2(const Standard_Real U, gp_Pnt& P, gp_Vec& V1, V2.SetLinearForm(D2W.X(), D1U, D2W.Y(), D1V, 2. * DW.X() * DW.Y(), D2UV); V2.SetLinearForm(DW.X() * DW.X(), D2U, DW.Y() * DW.Y(), D2V, V2); } - else if ((Abs(U - LP) < Tol) && (!myLastSurf.IsNull())) + else if ((std::abs(U - LP) < Tol) && (!myLastSurf.IsNull())) { myCurve->D2(U, UV, DW, D2W); myLastSurf->D2(UV.X(), UV.Y(), P, D1U, D1V, D2U, D2V, D2UV); @@ -1285,7 +1285,7 @@ void Adaptor3d_CurveOnSurface::D3(const Standard_Real U, Standard_Real FP = myCurve->FirstParameter(); Standard_Real LP = myCurve->LastParameter(); - if ((Abs(U - FP) < Tol) && (!myFirstSurf.IsNull())) + if ((std::abs(U - FP) < Tol) && (!myFirstSurf.IsNull())) { myCurve->D3(U, UV, DW, D2W, D3W); myFirstSurf->D3(UV.X(), UV.Y(), P, D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV); @@ -1296,7 +1296,7 @@ void Adaptor3d_CurveOnSurface::D3(const Standard_Real U, } else - if ((Abs(U - LP) < Tol) && (!myLastSurf.IsNull())) + if ((std::abs(U - LP) < Tol) && (!myLastSurf.IsNull())) { myCurve->D3(U, UV, DW, D2W, D3W); myLastSurf->D3(UV.X(), UV.Y(), P, D1U, D1V, D2U, D2V, D2UV, D3U, D3V, D3UUV, D3UVV); @@ -1357,7 +1357,7 @@ Standard_Real Adaptor3d_CurveOnSurface::Resolution(const Standard_Real R3d) cons Standard_Real ru, rv; ru = mySurface->UResolution(R3d); rv = mySurface->VResolution(R3d); - return myCurve->Resolution(Min(ru, rv)); + return myCurve->Resolution(std::min(ru, rv)); } //================================================================================================= @@ -1576,7 +1576,7 @@ void Adaptor3d_CurveOnSurface::EvalKPart() if (STy == GeomAbs_Sphere) { gp_Pnt2d P = myCurve->Line().Location(); - if (Abs(Abs(P.Y()) - M_PI / 2.) >= Precision::PConfusion()) + if (std::abs(std::abs(P.Y()) - M_PI / 2.) >= Precision::PConfusion()) { myType = GeomAbs_Circle; gp_Sphere Sph = mySurface->Sphere(); diff --git a/src/ModelingData/TKG3d/Adaptor3d/Adaptor3d_IsoCurve.cxx b/src/ModelingData/TKG3d/Adaptor3d/Adaptor3d_IsoCurve.cxx index 0e111fa3fc..61a4055bb8 100644 --- a/src/ModelingData/TKG3d/Adaptor3d/Adaptor3d_IsoCurve.cxx +++ b/src/ModelingData/TKG3d/Adaptor3d/Adaptor3d_IsoCurve.cxx @@ -148,13 +148,13 @@ void Adaptor3d_IsoCurve::Load(const GeomAbs_IsoType Iso, if (myIso == GeomAbs_IsoU) { - myFirst = Max(myFirst, mySurface->FirstVParameter()); - myLast = Min(myLast, mySurface->LastVParameter()); + myFirst = std::max(myFirst, mySurface->FirstVParameter()); + myLast = std::min(myLast, mySurface->LastVParameter()); } else { - myFirst = Max(myFirst, mySurface->FirstUParameter()); - myLast = Min(myLast, mySurface->LastUParameter()); + myFirst = std::max(myFirst, mySurface->FirstUParameter()); + myLast = std::min(myLast, mySurface->LastUParameter()); } // Adjust the parameters on periodic surfaces diff --git a/src/ModelingData/TKG3d/Adaptor3d/Adaptor3d_TopolTool.cxx b/src/ModelingData/TKG3d/Adaptor3d/Adaptor3d_TopolTool.cxx index 824f01fd34..6318e42be5 100644 --- a/src/ModelingData/TKG3d/Adaptor3d/Adaptor3d_TopolTool.cxx +++ b/src/ModelingData/TKG3d/Adaptor3d/Adaptor3d_TopolTool.cxx @@ -74,7 +74,7 @@ void Adaptor3d_TopolTool::Initialize(const Handle(Adaptor3d_Surface)& S) if (!Vinfinfinite) { - deltap = Min(Usup - Uinf, 2. * myInfinite); + deltap = std::min(Usup - Uinf, 2. * myInfinite); if (Uinf >= -myInfinite) { pinf = Uinf; @@ -100,7 +100,7 @@ void Adaptor3d_TopolTool::Initialize(const Handle(Adaptor3d_Surface)& S) if (!Usupinfinite) { - deltap = Min(Vsup - Vinf, 2. * myInfinite); + deltap = std::min(Vsup - Vinf, 2. * myInfinite); if (Vinf >= -myInfinite) { pinf = Vinf; @@ -126,7 +126,7 @@ void Adaptor3d_TopolTool::Initialize(const Handle(Adaptor3d_Surface)& S) if (!Vsupinfinite) { - deltap = Min(Usup - Uinf, 2. * myInfinite); + deltap = std::min(Usup - Uinf, 2. * myInfinite); if (-Usup >= -myInfinite) { pinf = -Usup; @@ -152,7 +152,7 @@ void Adaptor3d_TopolTool::Initialize(const Handle(Adaptor3d_Surface)& S) if (!Uinfinfinite) { - deltap = Min(Vsup - Vinf, 2. * myInfinite); + deltap = std::min(Vsup - Vinf, 2. * myInfinite); if (-Vsup >= -myInfinite) { pinf = -Vsup; @@ -183,7 +183,7 @@ void Adaptor3d_TopolTool::Initialize(const Handle(Adaptor3d_Surface)& S) Standard_Real U = 0., V = 0.; GetConeApexParam(S->Cone(), U, V); - deltap = Min(Usup - Uinf, 2. * myInfinite); + deltap = std::min(Usup - Uinf, 2. * myInfinite); if (Uinf >= -myInfinite) { pinf = Uinf; @@ -292,8 +292,8 @@ TopAbs_State Adaptor3d_TopolTool::Classify(const gp_Pnt2d& P, { return TopAbs_OUT; } - if ((Abs(U - Uinf) <= Tol) || (Abs(U - Usup) <= Tol) || (Abs(V - Vinf) <= Tol) - || (Abs(V - Vsup) <= Tol)) + if ((std::abs(U - Uinf) <= Tol) || (std::abs(U - Usup) <= Tol) || (std::abs(V - Vinf) <= Tol) + || (std::abs(V - Vsup) <= Tol)) { return TopAbs_ON; } @@ -323,7 +323,7 @@ TopAbs_State Adaptor3d_TopolTool::Classify(const gp_Pnt2d& P, { dansu = Standard_True; surumax = Standard_False; - if (Abs(U - Usup) <= Tol) + if (std::abs(U - Usup) <= Tol) { surumax = Standard_True; } @@ -341,7 +341,7 @@ TopAbs_State Adaptor3d_TopolTool::Classify(const gp_Pnt2d& P, { dansu = Standard_True; surumin = Standard_False; - if (Abs(U - Uinf) <= Tol) + if (std::abs(U - Uinf) <= Tol) { surumin = Standard_True; } @@ -357,11 +357,11 @@ TopAbs_State Adaptor3d_TopolTool::Classify(const gp_Pnt2d& P, { dansu = Standard_True; surumin = surumax = Standard_False; - if (Abs(U - Uinf) <= Tol) + if (std::abs(U - Uinf) <= Tol) { surumin = Standard_True; } - else if (Abs(U - Usup) <= Tol) + else if (std::abs(U - Usup) <= Tol) { surumax = Standard_True; } @@ -385,7 +385,7 @@ TopAbs_State Adaptor3d_TopolTool::Classify(const gp_Pnt2d& P, { dansv = Standard_True; survmax = Standard_False; - if (Abs(V - Vsup) <= Tol) + if (std::abs(V - Vsup) <= Tol) { survmax = Standard_True; } @@ -403,7 +403,7 @@ TopAbs_State Adaptor3d_TopolTool::Classify(const gp_Pnt2d& P, { dansv = Standard_True; survmin = Standard_False; - if (Abs(V - Vinf) <= Tol) + if (std::abs(V - Vinf) <= Tol) { survmin = Standard_True; } @@ -419,11 +419,11 @@ TopAbs_State Adaptor3d_TopolTool::Classify(const gp_Pnt2d& P, { dansv = Standard_True; survmin = survmax = Standard_False; - if (Abs(V - Vinf) <= Tol) + if (std::abs(V - Vinf) <= Tol) { survmin = Standard_True; } - else if (Abs(V - Vsup) <= Tol) + else if (std::abs(V - Vsup) <= Tol) { survmax = Standard_True; } @@ -457,8 +457,8 @@ Standard_Boolean Adaptor3d_TopolTool::IsThePointOn(const gp_Pnt2d& P, { return (Standard_False); } - if ((Abs(U - Uinf) <= Tol) || (Abs(U - Usup) <= Tol) || (Abs(V - Vinf) <= Tol) - || (Abs(V - Vsup) <= Tol)) + if ((std::abs(U - Uinf) <= Tol) || (std::abs(U - Usup) <= Tol) || (std::abs(V - Vinf) <= Tol) + || (std::abs(V - Vsup) <= Tol)) { return (Standard_True); } @@ -488,7 +488,7 @@ Standard_Boolean Adaptor3d_TopolTool::IsThePointOn(const gp_Pnt2d& P, { dansu = Standard_True; surumax = Standard_False; - if (Abs(U - Usup) <= Tol) + if (std::abs(U - Usup) <= Tol) { surumax = Standard_True; } @@ -506,7 +506,7 @@ Standard_Boolean Adaptor3d_TopolTool::IsThePointOn(const gp_Pnt2d& P, { dansu = Standard_True; surumin = Standard_False; - if (Abs(U - Uinf) <= Tol) + if (std::abs(U - Uinf) <= Tol) { surumin = Standard_True; } @@ -522,11 +522,11 @@ Standard_Boolean Adaptor3d_TopolTool::IsThePointOn(const gp_Pnt2d& P, { dansu = Standard_True; surumin = surumax = Standard_False; - if (Abs(U - Uinf) <= Tol) + if (std::abs(U - Uinf) <= Tol) { surumin = Standard_True; } - else if (Abs(U - Usup) <= Tol) + else if (std::abs(U - Usup) <= Tol) { surumax = Standard_True; } @@ -550,7 +550,7 @@ Standard_Boolean Adaptor3d_TopolTool::IsThePointOn(const gp_Pnt2d& P, { dansv = Standard_True; survmax = Standard_False; - if (Abs(V - Vsup) <= Tol) + if (std::abs(V - Vsup) <= Tol) { survmax = Standard_True; } @@ -568,7 +568,7 @@ Standard_Boolean Adaptor3d_TopolTool::IsThePointOn(const gp_Pnt2d& P, { dansv = Standard_True; survmin = Standard_False; - if (Abs(V - Vinf) <= Tol) + if (std::abs(V - Vinf) <= Tol) { survmin = Standard_True; } @@ -584,11 +584,11 @@ Standard_Boolean Adaptor3d_TopolTool::IsThePointOn(const gp_Pnt2d& P, { dansv = Standard_True; survmin = survmax = Standard_False; - if (Abs(V - Vinf) <= Tol) + if (std::abs(V - Vinf) <= Tol) { survmin = Standard_True; } - else if (Abs(V - Vsup) <= Tol) + else if (std::abs(V - Vsup) <= Tol) { survmax = Standard_True; } @@ -868,12 +868,12 @@ void Adaptor3d_TopolTool::ComputeSamplePoints() if (aRatio >= 10.) { nbsu *= 2; - nbsu = Min(nbsu, aMaxNbSample); + nbsu = std::min(nbsu, aMaxNbSample); } else if (aRatio <= 0.1) { nbsv *= 2; - nbsv = Min(nbsv, aMaxNbSample); + nbsv = std::min(nbsv, aMaxNbSample); } } else if (typS == GeomAbs_BezierSurface) @@ -1061,8 +1061,8 @@ void Adaptor3d_TopolTool::SamplePnts(const Standard_Real theDefl, // case GeomAbs_BezierSurface: { // nbsv=myS->NbVPoles(); // nbsu=myS->NbUPoles(); - // nbsu = Max(nbsu, theNUmin); - // nbsv = Max(nbsv, theNVmin); + // nbsu = std::max(nbsu, theNUmin); + // nbsv = std::max(nbsv, theNVmin); // if(nbsu>8 || nbsv>8) { // const Handle(Geom_BezierSurface)& Bez = myS->Bezier(); // Standard_Integer nbup = Bez->NbUPoles(); @@ -1089,9 +1089,9 @@ void Adaptor3d_TopolTool::SamplePnts(const Standard_Real theDefl, // case GeomAbs_Sphere: // case GeomAbs_Torus: // case GeomAbs_SurfaceOfRevolution: - // case GeomAbs_SurfaceOfExtrusion: { nbsv = Max(15,theNVmin); nbsu=Max(15,theNUmin); } - // break; default: { nbsu = Max(10,theNUmin); nbsv=Max(10,theNVmin); - // } break; + // case GeomAbs_SurfaceOfExtrusion: { nbsv = std::max(15,theNVmin); nbsu=Max(15,theNUmin); } + // break; default: { nbsu = std::max(10,theNUmin); + // nbsv=Max(10,theNVmin); } break; // } // if(nbsu<6) nbsu=6; @@ -1193,14 +1193,14 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl, if (nbsu < nbsv) { aNb = (Standard_Integer)(nbsv * ((Standard_Real)theNUmin) / ((Standard_Real)nbsu)); - aNb = Min(aNb, 30); + aNb = std::min(aNb, 30); bVuniform = (aNb > nbsv) ? Standard_True : bVuniform; nbsv = bVuniform ? aNb : nbsv; } else { aNb = (Standard_Integer)(nbsu * ((Standard_Real)theNVmin) / ((Standard_Real)nbsv)); - aNb = Min(aNb, 30); + aNb = std::min(aNb, 30); bUuniform = (aNb > nbsu) ? Standard_True : bUuniform; nbsu = bUuniform ? aNb : nbsu; } @@ -1318,8 +1318,8 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl, // Analysis of deflection - Standard_Real aDefl2 = Max(theDefl * theDefl, 1.e-9); - Standard_Real tol = Max(0.01 * aDefl2, 1.e-9); + Standard_Real aDefl2 = std::max(theDefl * theDefl, 1.e-9); + Standard_Real tol = std::max(0.01 * aDefl2, 1.e-9); Standard_Integer l; anUFlg(1) = Standard_True; @@ -1413,9 +1413,9 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl, while (!anUFlg(i++)) ; if (i < nbsu / 2) - j = Min(i + (nbsu - i) / 2, nbsu - 1); + j = std::min(i + (nbsu - i) / 2, nbsu - 1); else - j = Max(i / 2, 2); + j = std::max(i / 2, 2); } anUFlg(j) = Standard_True; myNbSamplesU = myMinPnts; @@ -1512,9 +1512,9 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl, while (!aVFlg(i++)) ; if (i < nbsv / 2) - j = Min(i + (nbsv - i) / 2, nbsv - 1); + j = std::min(i + (nbsv - i) / 2, nbsv - 1); else - j = Max(i / 2, 2); + j = std::max(i / 2, 2); } myNbSamplesV = myMinPnts; aVFlg(j) = Standard_True; @@ -1629,7 +1629,7 @@ void Adaptor3d_TopolTool::GetConeApexParam(const gp_Cone& theC, { theU = 0.0; } - else if (-Radius > Ploc.Z() * Tan(SAngle)) + else if (-Radius > Ploc.Z() * std::tan(SAngle)) { // the point is at the `wrong` side of the apex theU = atan2(-Ploc.Y(), -Ploc.X()); diff --git a/src/ModelingData/TKG3d/AdvApprox/AdvApprox_ApproxAFunction.cxx b/src/ModelingData/TKG3d/AdvApprox/AdvApprox_ApproxAFunction.cxx index 258f47f251..6a0e3369f9 100644 --- a/src/ModelingData/TKG3d/AdvApprox/AdvApprox_ApproxAFunction.cxx +++ b/src/ModelingData/TKG3d/AdvApprox/AdvApprox_ApproxAFunction.cxx @@ -145,7 +145,7 @@ static void PrepareConvert(const Standard_Integer NumCurves, Standard_Real diff, moy, facteur1, facteur2, normal1, normal2, eps; Standard_Real * Res1, *Res2, *Val1, *Val2; Standard_Real * Coef1, *Coef2; - Standard_Integer RealDegree = Max(MaxDegree + 1, 2 * ContinuityOrder + 2); + Standard_Integer RealDegree = std::max(MaxDegree + 1, 2 * ContinuityOrder + 2); gp_Vec V1, V2; gp_Vec2d v1, v2; @@ -198,24 +198,24 @@ static void PrepareConvert(const Standard_Integer NumCurves, Standard_Real f2_divizor = TrueIntervals(icurve + 2) - TrueIntervals(icurve + 1); Standard_Real fract1, fract2; - if (Abs(f1_divizor) < Toler) // this is to avoid divizion by zero + if (std::abs(f1_divizor) < Toler) // this is to avoid divizion by zero // in this case fract1 = 5.14755758946803e-85 facteur1 = 0.0; else { fract1 = f1_dividend / f1_divizor; - facteur1 = Pow(fract1, iordre); + facteur1 = std::pow(fract1, iordre); } - if (Abs(f2_divizor) < Toler) + if (std::abs(f2_divizor) < Toler) // in this case fract2 = 6.77193633669143e-313 facteur2 = 0.0; else { fract2 = f2_dividend / f2_divizor; - facteur2 = Pow(fract2, iordre); + facteur2 = std::pow(fract2, iordre); } - normal1 = Pow(f1_divizor, iordre); - normal2 = Pow(f2_divizor, iordre); + normal1 = std::pow(f1_divizor, iordre); + normal2 = std::pow(f2_divizor, iordre); idim = 1; Val1 = Res1 + iordre * Dimension - 1; @@ -224,8 +224,8 @@ static void PrepareConvert(const Standard_Integer NumCurves, for (ii = 1; ii <= Num1DSS && isCi; ii++, idim++) { eps = LocalTolerance(idim) * 0.01; - diff = Abs(Val1[ii] * facteur1 - Val2[ii] * facteur2); - moy = Abs(Val1[ii] * facteur1 + Val2[ii] * facteur2); + diff = std::abs(Val1[ii] * facteur1 - Val2[ii] * facteur2); + moy = std::abs(Val1[ii] * facteur1 + Val2[ii] * facteur2); // Un premier controle sur la valeur relative if (diff > moy * 1.e-9) { @@ -251,8 +251,8 @@ static void PrepareConvert(const Standard_Integer NumCurves, v2.SetCoord(Val2[1], Val2[2]); v1 *= facteur1; v2 *= facteur2; - diff = Abs(v1.X() - v2.X()) + Abs(v1.Y() - v2.Y()); - moy = Abs(v1.X() + v2.X()) + Abs(v1.Y() + v2.Y()); + diff = std::abs(v1.X() - v2.X()) + std::abs(v1.Y() - v2.Y()); + moy = std::abs(v1.X() + v2.X()) + std::abs(v1.Y() + v2.Y()); if (diff > moy * 1.e-9) { Prec(idim) = diff * normal1; @@ -274,8 +274,8 @@ static void PrepareConvert(const Standard_Integer NumCurves, V2.SetCoord(Val2[1], Val2[2], Val2[3]); V1 *= facteur1; V2 *= facteur2; - diff = Abs(V1.X() - V2.X()) + Abs(V1.Y() - V2.Y()) + Abs(V1.Z() - V2.Z()); - moy = Abs(V1.X() + V2.X()) + Abs(V1.Y() + V2.Y()) + Abs(V1.Z() + V2.Z()); + diff = std::abs(V1.X() - V2.X()) + std::abs(V1.Y() - V2.Y()) + std::abs(V1.Z() - V2.Z()); + moy = std::abs(V1.X() + V2.X()) + std::abs(V1.Y() + V2.Y()) + std::abs(V1.Z() + V2.Z()); if (diff > moy * 1.e-9) { Prec(idim) = diff * normal1; @@ -446,7 +446,7 @@ void AdvApprox_ApproxAFunction::Approximation( //-------------------------- Verification des entrees ------------------ - if ((MaxSegments < 1) || (Abs(Last - First) < 1.e-9)) + if ((MaxSegments < 1) || (std::abs(Last - First) < 1.e-9)) { ErrorCode = 1; return; @@ -735,7 +735,7 @@ void AdvApprox_ApproxAFunction::Perform(const Standard_Integer Num1DSS, throw Standard_ConstructionError(); } Standard_Real ApproxStartEnd[2]; - Standard_Integer NumMaxCoeffs = Max(myMaxDegree + 1, 2 * ContinuityOrder + 2); + Standard_Integer NumMaxCoeffs = std::max(myMaxDegree + 1, 2 * ContinuityOrder + 2); myMaxDegree = NumMaxCoeffs - 1; Standard_Integer code_precis = 1; // @@ -815,7 +815,7 @@ void AdvApprox_ApproxAFunction::Perform(const Standard_Integer Num1DSS, for (ii = PolynomialIntervalsPtr.LowerRow(); ii <= PolynomialIntervalsPtr.UpperRow(); ii++) { // On force un degre 1 minimum (PRO5474) - NumCoeffPerCurvePtr->ChangeValue(ii) = Max(2, NumCoeffPerCurvePtr->Value(ii)); + NumCoeffPerCurvePtr->ChangeValue(ii) = std::max(2, NumCoeffPerCurvePtr->Value(ii)); PolynomialIntervalsPtr.SetValue(ii, 1, ApproxStartEnd[0]); PolynomialIntervalsPtr.SetValue(ii, 2, ApproxStartEnd[1]); } @@ -870,7 +870,7 @@ void AdvApprox_ApproxAFunction::Perform(const Standard_Integer Num1DSS, for (ii = 1; ii <= NumCurves; ii++) { local_index = (ii - 1) * TotalNumSS; - error_value = Max(ErrorMax(local_index + jj), error_value); + error_value = std::max(ErrorMax(local_index + jj), error_value); } my1DMaxError->SetValue(jj, error_value); } @@ -915,7 +915,7 @@ void AdvApprox_ApproxAFunction::Perform(const Standard_Integer Num1DSS, for (ii = 1; ii <= NumCurves; ii++) { local_index = (ii - 1) * TotalNumSS + index; - error_value = Max(ErrorMax(local_index + jj), error_value); + error_value = std::max(ErrorMax(local_index + jj), error_value); } my2DMaxError->SetValue(jj, error_value); } @@ -960,7 +960,7 @@ void AdvApprox_ApproxAFunction::Perform(const Standard_Integer Num1DSS, for (ii = 1; ii <= NumCurves; ii++) { local_index = (ii - 1) * TotalNumSS + index; - error_value = Max(ErrorMax(local_index + jj), error_value); + error_value = std::max(ErrorMax(local_index + jj), error_value); } my3DMaxError->SetValue(jj, error_value); } diff --git a/src/ModelingData/TKG3d/AdvApprox/AdvApprox_DichoCutting.cxx b/src/ModelingData/TKG3d/AdvApprox/AdvApprox_DichoCutting.cxx index eb5fa8ce40..5fb39ebf77 100644 --- a/src/ModelingData/TKG3d/AdvApprox/AdvApprox_DichoCutting.cxx +++ b/src/ModelingData/TKG3d/AdvApprox/AdvApprox_DichoCutting.cxx @@ -26,5 +26,5 @@ Standard_Boolean AdvApprox_DichoCutting::Value(const Standard_Real a, // longueur minimum d'un intervalle pour F(U,V) : EPS1=1.e-9 (cf.MEPS1) constexpr Standard_Real lgmin = 10 * Precision::PConfusion(); cuttingvalue = (a + b) / 2; - return (Abs(b - a) >= 2 * lgmin); + return (std::abs(b - a) >= 2 * lgmin); } diff --git a/src/ModelingData/TKG3d/AdvApprox/AdvApprox_PrefAndRec.cxx b/src/ModelingData/TKG3d/AdvApprox/AdvApprox_PrefAndRec.cxx index a6f1be2731..f7d72c4f07 100644 --- a/src/ModelingData/TKG3d/AdvApprox/AdvApprox_PrefAndRec.cxx +++ b/src/ModelingData/TKG3d/AdvApprox/AdvApprox_PrefAndRec.cxx @@ -46,13 +46,13 @@ Standard_Boolean AdvApprox_PrefAndRec::Value(const Standard_Real a, cut = mil; // Recheche d'une decoupe preferentiel - dist = Abs((a * myWeight + b) / (1 + myWeight) - mil); + dist = std::abs((a * myWeight + b) / (1 + myWeight) - mil); for (i = 1; i <= myPrefCutting.Length(); i++) { - if (dist > Abs(mil - myPrefCutting.Value(i))) + if (dist > std::abs(mil - myPrefCutting.Value(i))) { cut = myPrefCutting.Value(i); - dist = Abs(mil - cut); + dist = std::abs(mil - cut); isfound = Standard_True; } } @@ -60,18 +60,18 @@ Standard_Boolean AdvApprox_PrefAndRec::Value(const Standard_Real a, // Recheche d'une decoupe recommende if (!isfound) { - dist = Abs((a - b) / 2); + dist = std::abs((a - b) / 2); for (i = 1; i <= myRecCutting.Length(); i++) { - if ((dist - lgmin) > Abs(mil - myRecCutting.Value(i))) + if ((dist - lgmin) > std::abs(mil - myRecCutting.Value(i))) { cut = myRecCutting.Value(i); - dist = Abs(mil - cut); + dist = std::abs(mil - cut); } } } // Resultat cuttingvalue = cut; - return (Abs(cut - a) >= lgmin && Abs(b - cut) >= lgmin); + return (std::abs(cut - a) >= lgmin && std::abs(b - cut) >= lgmin); } diff --git a/src/ModelingData/TKG3d/AdvApprox/AdvApprox_PrefCutting.cxx b/src/ModelingData/TKG3d/AdvApprox/AdvApprox_PrefCutting.cxx index de5235e3a8..36eb1564bb 100644 --- a/src/ModelingData/TKG3d/AdvApprox/AdvApprox_PrefCutting.cxx +++ b/src/ModelingData/TKG3d/AdvApprox/AdvApprox_PrefCutting.cxx @@ -31,16 +31,16 @@ Standard_Boolean AdvApprox_PrefCutting::Value(const Standard_Real a, // pour F(U,V) : EPS1=1.e-9 (cf.MMEPS1) constexpr Standard_Real lgmin = 10 * Precision::PConfusion(); Standard_Integer i; - Standard_Real cut, mil = (a + b) / 2, dist = Abs((a - b) / 2); + Standard_Real cut, mil = (a + b) / 2, dist = std::abs((a - b) / 2); cut = mil; for (i = myPntOfCutting.Lower(); i <= myPntOfCutting.Upper(); i++) { - if ((dist - lgmin) > Abs(mil - myPntOfCutting.Value(i))) + if ((dist - lgmin) > std::abs(mil - myPntOfCutting.Value(i))) { cut = myPntOfCutting.Value(i); - dist = Abs(mil - myPntOfCutting.Value(i)); + dist = std::abs(mil - myPntOfCutting.Value(i)); } } cuttingvalue = cut; - return (Abs(cut - a) >= lgmin && Abs(b - cut) >= lgmin); + return (std::abs(cut - a) >= lgmin && std::abs(b - cut) >= lgmin); } diff --git a/src/ModelingData/TKG3d/GProp/GProp_CelGProps.cxx b/src/ModelingData/TKG3d/GProp/GProp_CelGProps.cxx index a2d31b7db5..97326a53af 100644 --- a/src/ModelingData/TKG3d/GProp/GProp_CelGProps.cxx +++ b/src/ModelingData/TKG3d/GProp/GProp_CelGProps.cxx @@ -39,17 +39,17 @@ void GProp_CelGProps::Perform(const gp_Circ& C, const Standard_Real U1, const St C.Axis().Direction().Coord(Xa3, Ya3, Za3); Standard_Real Ray = C.Radius(); - dim = Ray * Abs(U2 - U1); - Standard_Real xloc = Ray * (Sin(U2) - Sin(U1)) / (U2 - U1); - Standard_Real yloc = Ray * (Cos(U1) - Cos(U2)) / (U2 - U1); + dim = Ray * std::abs(U2 - U1); + Standard_Real xloc = Ray * (std::sin(U2) - std::sin(U1)) / (U2 - U1); + Standard_Real yloc = Ray * (std::cos(U1) - std::cos(U2)) / (U2 - U1); g.SetCoord(xloc * Xa1 + yloc * Xa2 + X0, xloc * Ya1 + yloc * Ya2 + Y0, Z0); math_Matrix Dm(1, 3, 1, 3); - Dm(1, 1) = Ray * Ray * Ray * (U2 / 2 - U1 / 2 - Sin(2 * U2) / 4 + Sin(2 * U1) / 4); - Dm(2, 2) = Ray * Ray * Ray * (U2 / 2 - U1 / 2 + Sin(2 * U2) / 4 - Sin(2 * U1) / 4); + Dm(1, 1) = Ray * Ray * Ray * (U2 / 2 - U1 / 2 - std::sin(2 * U2) / 4 + std::sin(2 * U1) / 4); + Dm(2, 2) = Ray * Ray * Ray * (U2 / 2 - U1 / 2 + std::sin(2 * U2) / 4 - std::sin(2 * U1) / 4); Dm(3, 3) = Ray * Ray * dim; - Dm(2, 1) = Dm(1, 2) = -Ray * Ray * Ray * (Cos(2 * U1) / 4 - Cos(2 * U2) / 4); + Dm(2, 1) = Dm(1, 2) = -Ray * Ray * Ray * (std::cos(2 * U1) / 4 - std::cos(2 * U2) / 4); Dm(3, 1) = Dm(1, 3) = 0.; Dm(3, 2) = Dm(2, 3) = 0.; math_Matrix Passage(1, 3, 1, 3); @@ -87,7 +87,7 @@ void GProp_CelGProps::Perform(const gp_Lin& C, const Standard_Real U1, const Sta { gp_Ax1 Pos = C.Position(); gp_Pnt P1 = ElCLib::LineValue(U1, Pos); - dim = Abs(U2 - U1); + dim = std::abs(U2 - U1); gp_Pnt P2 = ElCLib::LineValue(U2, Pos); g.SetCoord((P1.X() + P2.X()) / 2., (P1.Y() + P2.Y()) / 2., (P1.Z() + P2.Z()) / 2.); Standard_Real Vx, Vy, Vz, X0, Y0, Z0; diff --git a/src/ModelingData/TKG3d/GProp/GProp_GProps.cxx b/src/ModelingData/TKG3d/GProp/GProp_GProps.cxx index 65b821aec3..3125117819 100644 --- a/src/ModelingData/TKG3d/GProp/GProp_GProps.cxx +++ b/src/ModelingData/TKG3d/GProp/GProp_GProps.cxx @@ -49,7 +49,7 @@ void GProp_GProps::Add(const GProp_GProps& Item, const Standard_Real Density) g.SetXYZ(g.XYZ().Multiplied(dim)); GXYZ.Add(g.XYZ()); dim = dim + Item.dim * Density; - if (Abs(dim) >= 1.e-20) + if (std::abs(dim) >= 1.e-20) { GXYZ.Divide(dim); g.SetXYZ(GXYZ); @@ -69,7 +69,7 @@ void GProp_GProps::Add(const GProp_GProps& Item, const Standard_Real Density) g.SetXYZ(g.XYZ().Multiplied(dim)); GXYZ.Add(g.XYZ()); dim = dim + Item.dim * Density; - if (Abs(dim) >= 1.e-20) + if (std::abs(dim) >= 1.e-20) { GXYZ.Divide(dim); g.SetXYZ(GXYZ); @@ -146,7 +146,7 @@ Standard_Real GProp_GProps::MomentOfInertia(const gp_Ax1& A) const Standard_Real GProp_GProps::RadiusOfGyration(const gp_Ax1& A) const { - return Sqrt(MomentOfInertia(A) / dim); + return std::sqrt(MomentOfInertia(A) / dim); } GProp_PrincipalProps GProp_GProps::PrincipalProperties() const @@ -178,9 +178,9 @@ GProp_PrincipalProps GProp_GProps::PrincipalProperties() const Standard_Real Rzz = 0.0e0; if (0.0e0 != dim) { - Rxx = Sqrt(Abs(Ixx / dim)); - Ryy = Sqrt(Abs(Iyy / dim)); - Rzz = Sqrt(Abs(Izz / dim)); + Rxx = std::sqrt(std::abs(Ixx / dim)); + Ryy = std::sqrt(std::abs(Iyy / dim)); + Rzz = std::sqrt(std::abs(Izz / dim)); } return GProp_PrincipalProps(Ixx, Iyy, diff --git a/src/ModelingData/TKG3d/GProp/GProp_PEquation.cxx b/src/ModelingData/TKG3d/GProp/GProp_PEquation.cxx index 6f072a93b6..0488b64445 100644 --- a/src/ModelingData/TKG3d/GProp/GProp_PEquation.cxx +++ b/src/ModelingData/TKG3d/GProp/GProp_PEquation.cxx @@ -66,17 +66,17 @@ GProp_PEquation::GProp_PEquation(const TColgp_Array1OfPnt& Pnts, const Standard_ } Standard_Integer dimension = 3; Standard_Integer It = 0; - if (Abs(Dmx1 - Dmn1) <= Tol) + if (std::abs(Dmx1 - Dmn1) <= Tol) { dimension = dimension - 1; It = 1; } - if (Abs(Dmx2 - Dmn2) <= Tol) + if (std::abs(Dmx2 - Dmn2) <= Tol) { dimension = dimension - 1; It = 2 * (It + 1); } - if (Abs(Dmx3 - Dmn3) <= Tol) + if (std::abs(Dmx3 - Dmn3) <= Tol) { dimension = dimension - 1; It = 3 * (It + 1); diff --git a/src/ModelingData/TKG3d/GProp/GProp_PrincipalProps.cxx b/src/ModelingData/TKG3d/GProp/GProp_PrincipalProps.cxx index ce6485a054..6bd2094a00 100644 --- a/src/ModelingData/TKG3d/GProp/GProp_PrincipalProps.cxx +++ b/src/ModelingData/TKG3d/GProp/GProp_PrincipalProps.cxx @@ -53,37 +53,32 @@ GProp_PrincipalProps::GProp_PrincipalProps(const Standard_Real Ixx, Standard_Boolean GProp_PrincipalProps::HasSymmetryAxis() const { - - // Standard_Real Eps1 = Abs(Epsilon (i1)); - // Standard_Real Eps2 = Abs(Epsilon (i2)); const Standard_Real aRelTol = 1.e-10; - Standard_Real Eps1 = Abs(i1) * aRelTol; - Standard_Real Eps2 = Abs(i2) * aRelTol; - return (Abs(i1 - i2) <= Eps1 || Abs(i1 - i3) <= Eps1 || Abs(i2 - i3) <= Eps2); + Standard_Real Eps1 = std::abs(i1) * aRelTol; + Standard_Real Eps2 = std::abs(i2) * aRelTol; + return (std::abs(i1 - i2) <= Eps1 || std::abs(i1 - i3) <= Eps1 || std::abs(i2 - i3) <= Eps2); } Standard_Boolean GProp_PrincipalProps::HasSymmetryAxis(const Standard_Real aTol) const { - Standard_Real Eps1 = Abs(i1 * aTol) + Abs(Epsilon(i1)); - Standard_Real Eps2 = Abs(i2 * aTol) + Abs(Epsilon(i2)); - return (Abs(i1 - i2) <= Eps1 || Abs(i1 - i3) <= Eps1 || Abs(i2 - i3) <= Eps2); + Standard_Real Eps1 = std::abs(i1 * aTol) + std::abs(Epsilon(i1)); + Standard_Real Eps2 = std::abs(i2 * aTol) + std::abs(Epsilon(i2)); + return (std::abs(i1 - i2) <= Eps1 || std::abs(i1 - i3) <= Eps1 || std::abs(i2 - i3) <= Eps2); } Standard_Boolean GProp_PrincipalProps::HasSymmetryPoint() const { - - // Standard_Real Eps1 = Abs(Epsilon (i1)); const Standard_Real aRelTol = 1.e-10; - Standard_Real Eps1 = Abs(i1) * aRelTol; - return (Abs(i1 - i2) <= Eps1 && Abs(i1 - i3) <= Eps1); + Standard_Real Eps1 = std::abs(i1) * aRelTol; + return (std::abs(i1 - i2) <= Eps1 && std::abs(i1 - i3) <= Eps1); } Standard_Boolean GProp_PrincipalProps::HasSymmetryPoint(const Standard_Real aTol) const { - Standard_Real Eps1 = Abs(i1 * aTol) + Abs(Epsilon(i1)); - return (Abs(i1 - i2) <= Eps1 && Abs(i1 - i3) <= Eps1); + Standard_Real Eps1 = std::abs(i1 * aTol) + std::abs(Epsilon(i1)); + return (std::abs(i1 - i2) <= Eps1 && std::abs(i1 - i3) <= Eps1); } void GProp_PrincipalProps::Moments(Standard_Real& Ixx, Standard_Real& Iyy, Standard_Real& Izz) const diff --git a/src/ModelingData/TKG3d/GProp/GProp_SelGProps.cxx b/src/ModelingData/TKG3d/GProp/GProp_SelGProps.cxx index d1d7e6d7e5..d307d651f1 100644 --- a/src/ModelingData/TKG3d/GProp/GProp_SelGProps.cxx +++ b/src/ModelingData/TKG3d/GProp/GProp_SelGProps.cxx @@ -43,10 +43,10 @@ void GProp_SelGProps::Perform(const gp_Cylinder& S, S.Position().YDirection().Coord(Xa2, Ya2, Za2); S.Position().Direction().Coord(Xa3, Ya3, Za3); dim = R * (Z2 - Z1) * (Alpha2 - Alpha1); - Standard_Real SA2 = Sin(Alpha2); - Standard_Real SA1 = Sin(Alpha1); - Standard_Real CA2 = Cos(Alpha2); - Standard_Real CA1 = Cos(Alpha1); + Standard_Real SA2 = std::sin(Alpha2); + Standard_Real SA1 = std::sin(Alpha1); + Standard_Real CA2 = std::cos(Alpha2); + Standard_Real CA1 = std::cos(Alpha1); Standard_Real Ix = R * (SA2 - SA1) / (Alpha2 - Alpha1); Standard_Real Iy = R * (CA1 - CA2) / (Alpha2 - Alpha1); g.SetCoord(X0 + Ix * Xa1 + Iy * Xa2 + Xa3 * (Z2 + Z1) / 2., @@ -112,13 +112,13 @@ void GProp_SelGProps::Perform(const gp_Cone& S, S.Position().YDirection().Coord(Xa2, Ya2, Za2); S.Position().Direction().Coord(Xa3, Ya3, Za3); Standard_Real t = S.SemiAngle(); - Standard_Real Cnt = Cos(t); - Standard_Real Snt = Sin(t); + Standard_Real Cnt = std::cos(t); + Standard_Real Snt = std::sin(t); Standard_Real R = S.RefRadius(); - Standard_Real Sn2 = Sin(Alpha2); - Standard_Real Sn1 = Sin(Alpha1); - Standard_Real Cn2 = Cos(Alpha2); - Standard_Real Cn1 = Cos(Alpha1); + Standard_Real Sn2 = std::sin(Alpha2); + Standard_Real Sn1 = std::sin(Alpha1); + Standard_Real Cn2 = std::cos(Alpha2); + Standard_Real Cn1 = std::cos(Alpha1); Standard_Real Auxi1 = R + (Z2 + Z1) * Snt / 2.; Standard_Real Auxi2 = (Z2 * Z2 + Z1 * Z2 + Z1 * Z1) / 3.; @@ -196,14 +196,14 @@ void GProp_SelGProps::Perform(const gp_Sphere& S, S.Position().YDirection().Coord(Xa2, Ya2, Za2); S.Position().Direction().Coord(Xa3, Ya3, Za3); Standard_Real R = S.Radius(); - Standard_Real Cnt1 = Cos(Teta1); - Standard_Real Snt1 = Sin(Teta1); - Standard_Real Cnt2 = Cos(Teta2); - Standard_Real Snt2 = Sin(Teta2); - Standard_Real Cnf1 = Cos(Alpha1); - Standard_Real Snf1 = Sin(Alpha1); - Standard_Real Cnf2 = Cos(Alpha2); - Standard_Real Snf2 = Sin(Alpha2); + Standard_Real Cnt1 = std::cos(Teta1); + Standard_Real Snt1 = std::sin(Teta1); + Standard_Real Cnt2 = std::cos(Teta2); + Standard_Real Snt2 = std::sin(Teta2); + Standard_Real Cnf1 = std::cos(Alpha1); + Standard_Real Snf1 = std::sin(Alpha1); + Standard_Real Cnf2 = std::cos(Alpha2); + Standard_Real Snf2 = std::sin(Alpha2); dim = R * R * (Teta2 - Teta1) * (Snf2 - Snf1); Standard_Real Ix = R * (Snt2 - Snt1) / (Teta2 - Teta1) * (Alpha2 - Alpha1 + Snf2 * Cnf2 - Snf1 * Cnf1) / (Snf2 - Snf1) / 2.; @@ -275,14 +275,14 @@ void GProp_SelGProps::Perform(const gp_Torus& S, S.Axis().Direction().Coord(Xa3, Ya3, Za3); Standard_Real RMax = S.MajorRadius(); Standard_Real Rmin = S.MinorRadius(); - Standard_Real Cnt1 = Cos(Teta1); - Standard_Real Snt1 = Sin(Teta1); - Standard_Real Cnt2 = Cos(Teta2); - Standard_Real Snt2 = Sin(Teta2); - Standard_Real Cnf1 = Cos(Alpha1); - Standard_Real Snf1 = Sin(Alpha1); - Standard_Real Cnf2 = Cos(Alpha2); - Standard_Real Snf2 = Sin(Alpha2); + Standard_Real Cnt1 = std::cos(Teta1); + Standard_Real Snt1 = std::sin(Teta1); + Standard_Real Cnt2 = std::cos(Teta2); + Standard_Real Snt2 = std::sin(Teta2); + Standard_Real Cnf1 = std::cos(Alpha1); + Standard_Real Snf1 = std::sin(Alpha1); + Standard_Real Cnf2 = std::cos(Alpha2); + Standard_Real Snf2 = std::sin(Alpha2); dim = RMax * Rmin * (Teta2 - Teta1) * (Alpha2 - Alpha1); Standard_Real Ix = diff --git a/src/ModelingData/TKG3d/GProp/GProp_VelGProps.cxx b/src/ModelingData/TKG3d/GProp/GProp_VelGProps.cxx index 8febfecd05..20aafb3638 100644 --- a/src/ModelingData/TKG3d/GProp/GProp_VelGProps.cxx +++ b/src/ModelingData/TKG3d/GProp/GProp_VelGProps.cxx @@ -87,10 +87,10 @@ void GProp_VelGProps::Perform(const gp_Cylinder& S, S.Position().YDirection().Coord(Xa2, Ya2, Za2); S.Position().Direction().Coord(Xa3, Ya3, Za3); dim = Rayon * Rayon * (Z2 - Z1) / 2.; - Standard_Real SA2 = Sin(Alpha2); - Standard_Real SA1 = Sin(Alpha1); - Standard_Real CA2 = Cos(Alpha2); - Standard_Real CA1 = Cos(Alpha1); + Standard_Real SA2 = std::sin(Alpha2); + Standard_Real SA1 = std::sin(Alpha1); + Standard_Real CA2 = std::cos(Alpha2); + Standard_Real CA1 = std::cos(Alpha1); Standard_Real Dsin = SA2 - SA1; Standard_Real Dcos = CA1 - CA2; Standard_Real Coef = Rayon / (Alpha2 - Alpha1); @@ -158,13 +158,13 @@ void GProp_VelGProps::Perform(const gp_Cone& S, S.Position().YDirection().Coord(Xa2, Ya2, Za2); S.Position().Direction().Coord(Xa3, Ya3, Za3); Standard_Real t = S.SemiAngle(); - Standard_Real Cnt = Cos(t); - Standard_Real Snt = Sin(t); + Standard_Real Cnt = std::cos(t); + Standard_Real Snt = std::sin(t); Standard_Real R = S.RefRadius(); - Standard_Real Sn2 = Sin(Alpha2); - Standard_Real Sn1 = Sin(Alpha1); - Standard_Real Cn2 = Cos(Alpha2); - Standard_Real Cn1 = Cos(Alpha1); + Standard_Real Sn2 = std::sin(Alpha2); + Standard_Real Sn1 = std::sin(Alpha1); + Standard_Real Cn2 = std::cos(Alpha2); + Standard_Real Cn1 = std::cos(Alpha1); Standard_Real ZZ = (Z2 - Z1) * (Z2 - Z1) * Cnt * Snt; Standard_Real Auxi1 = 2 * R + (Z2 + Z1) * Snt; @@ -241,14 +241,14 @@ void GProp_VelGProps::Perform(const gp_Sphere& S, S.Position().YDirection().Coord(Xa2, Ya2, Za2); S.Position().Direction().Coord(Xa3, Ya3, Za3); Standard_Real R = S.Radius(); - Standard_Real Cnt1 = Cos(Teta1); - Standard_Real Snt1 = Sin(Teta1); - Standard_Real Cnt2 = Cos(Teta2); - Standard_Real Snt2 = Sin(Teta2); - Standard_Real Cnf1 = Cos(Alpha1); - Standard_Real Snf1 = Sin(Alpha1); - Standard_Real Cnf2 = Cos(Alpha2); - Standard_Real Snf2 = Sin(Alpha2); + Standard_Real Cnt1 = std::cos(Teta1); + Standard_Real Snt1 = std::sin(Teta1); + Standard_Real Cnt2 = std::cos(Teta2); + Standard_Real Snt2 = std::sin(Teta2); + Standard_Real Cnf1 = std::cos(Alpha1); + Standard_Real Snf1 = std::sin(Alpha1); + Standard_Real Cnf2 = std::cos(Alpha2); + Standard_Real Snf2 = std::sin(Alpha2); dim = (Teta2 - Teta1) * R * R * R * (Snf2 - Snf1) / 3.; @@ -322,14 +322,14 @@ void GProp_VelGProps::Perform(const gp_Torus& S, S.Position().Direction().Coord(Xa3, Ya3, Za3); Standard_Real RMax = S.MajorRadius(); Standard_Real Rmin = S.MinorRadius(); - Standard_Real Cnt1 = Cos(Teta1); - Standard_Real Snt1 = Sin(Teta1); - Standard_Real Cnt2 = Cos(Alpha2); - Standard_Real Snt2 = Sin(Alpha2); - Standard_Real Cnf1 = Cos(Alpha1); - Standard_Real Snf1 = Sin(Alpha1); - Standard_Real Cnf2 = Cos(Alpha2); - Standard_Real Snf2 = Sin(Alpha2); + Standard_Real Cnt1 = std::cos(Teta1); + Standard_Real Snt1 = std::sin(Teta1); + Standard_Real Cnt2 = std::cos(Alpha2); + Standard_Real Snt2 = std::sin(Alpha2); + Standard_Real Cnf1 = std::cos(Alpha1); + Standard_Real Snf1 = std::sin(Alpha1); + Standard_Real Cnf2 = std::cos(Alpha2); + Standard_Real Snf2 = std::sin(Alpha2); dim = RMax * Rmin * Rmin * (Teta2 - Teta1) * (Alpha2 - Alpha1) / 2.; Standard_Real Ix = diff --git a/src/ModelingData/TKG3d/Geom/Geom_BSplineCurve.cxx b/src/ModelingData/TKG3d/Geom/Geom_BSplineCurve.cxx index b60f415bf6..bde66ba29c 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_BSplineCurve.cxx +++ b/src/ModelingData/TKG3d/Geom/Geom_BSplineCurve.cxx @@ -68,7 +68,7 @@ static void CheckCurveData(const TColgp_Array1OfPnt& CPoles, for (Standard_Integer I = CKnots.Lower(); I < CKnots.Upper(); I++) { - if (CKnots(I + 1) - CKnots(I) <= Epsilon(Abs(CKnots(I)))) + if (CKnots(I + 1) - CKnots(I) <= Epsilon(std::abs(CKnots(I)))) { throw Standard_ConstructionError("BSpline curve: Knots interval values too close"); } @@ -83,7 +83,7 @@ static Standard_Boolean Rational(const TColStd_Array1OfReal& theWeights) { for (Standard_Integer i = theWeights.Lower(); i < theWeights.Upper(); i++) { - if (Abs(theWeights[i] - theWeights[i + 1]) > gp::Resolution()) + if (std::abs(theWeights[i] - theWeights[i + 1]) > gp::Resolution()) { return Standard_True; } @@ -536,17 +536,17 @@ void Geom_BSplineCurve::Segment(const Standard_Real U1, Standard_Real aNu2 = NewU2; //-- DBB - Knots(1) = Min(NewU1, NewU2); - Knots(2) = Max(NewU1, NewU2); + Knots(1) = std::min(NewU1, NewU2); + Knots(2) = std::max(NewU1, NewU2); Mults(1) = Mults(2) = deg; - Standard_Real AbsUMax = Max(Abs(NewU1), Abs(NewU2)); + Standard_Real AbsUMax = std::max(std::abs(NewU1), std::abs(NewU2)); // Modified by Sergey KHROMOV - Fri Apr 11 12:15:40 2003 Begin - AbsUMax = Max(AbsUMax, Max(Abs(FirstParameter()), Abs(LastParameter()))); + AbsUMax = std::max(AbsUMax, std::max(std::abs(FirstParameter()), std::abs(LastParameter()))); // Modified by Sergey KHROMOV - Fri Apr 11 12:15:40 2003 End - Standard_Real Eps = Max(Epsilon(AbsUMax), theTolerance); + Standard_Real Eps = std::max(Epsilon(AbsUMax), theTolerance); InsertKnots(Knots, Mults, Eps); @@ -563,7 +563,7 @@ void Geom_BSplineCurve::Segment(const Standard_Real U1, index, U); // Test si l'insertion est Ok et decalage sinon. - if (Abs(knots->Value(index + 1) - U) <= Eps) // <= pour etre homogene a InsertKnots + if (std::abs(knots->Value(index + 1) - U) <= Eps) // <= pour etre homogene a InsertKnots index++; SetOrigin(index); SetNotPeriodic(); @@ -583,7 +583,7 @@ void Geom_BSplineCurve::Segment(const Standard_Real U1, ToU2, index1, U); - if (Abs(knots->Value(index1 + 1) - U) <= Eps) + if (std::abs(knots->Value(index1 + 1) - U) <= Eps) index1++; BSplCLib::LocateParameter(deg, @@ -595,7 +595,7 @@ void Geom_BSplineCurve::Segment(const Standard_Real U1, ToU2, index2, U); - if (Abs(knots->Value(index2 + 1) - U) <= Eps || index2 == index1) + if (std::abs(knots->Value(index2 + 1) - U) <= Eps || index2 == index1) index2++; Standard_Integer nbknots = index2 - index1 + 1; @@ -622,7 +622,7 @@ void Geom_BSplineCurve::Segment(const Standard_Real U1, Standard_Integer pindex2 = BSplCLib::PoleIndex(deg, index2, periodic, mults->Array1()); pindex1++; - pindex2 = Min(pindex2 + 1, poles->Length()); + pindex2 = std::min(pindex2 + 1, poles->Length()); Standard_Integer nbpoles = pindex2 - pindex1 + 1; @@ -676,7 +676,7 @@ void Geom_BSplineCurve::SetKnot(const Standard_Integer Index, const Standard_Rea { if (Index < 1 || Index > knots->Length()) throw Standard_OutOfRange("BSpline curve: SetKnot: Index and #knots mismatch"); - Standard_Real DK = Abs(Epsilon(K)); + Standard_Real DK = std::abs(Epsilon(K)); if (Index == 1) { if (K >= knots->Value(2) - DK) @@ -738,7 +738,7 @@ void Geom_BSplineCurve::SetPeriodic() Handle(TColStd_HArray1OfInteger) tm = mults; TColStd_Array1OfInteger cmults((mults->Array1())(first), first, last); - cmults(first) = cmults(last) = Min(deg, Max(cmults(first), cmults(last))); + cmults(first) = cmults(last) = std::min(deg, std::max(cmults(first), cmults(last))); mults = new TColStd_HArray1OfInteger(1, cmults.Length()); mults->ChangeArray1() = cmults; @@ -868,7 +868,7 @@ void Geom_BSplineCurve::SetOrigin(const Standard_Real U, const Standard_Real Tol while (Tol > (ul - u)) u -= period; - if (Abs(U - u) > Tol) + if (std::abs(U - u) > Tol) { // On reparametre la courbe Standard_Real delta = U - u; uf += delta; @@ -881,7 +881,7 @@ void Geom_BSplineCurve::SetOrigin(const Standard_Real U, const Standard_Real Tol } UpdateKnots(); } - if (Abs(U - uf) < Tol) + if (std::abs(U - uf) < Tol) return; TColStd_Array1OfReal& kn = knots->ChangeArray1(); @@ -890,13 +890,13 @@ void Geom_BSplineCurve::SetOrigin(const Standard_Real U, const Standard_Real Tol for (Standard_Integer i = fk; i <= lk; i++) { Standard_Real dki = kn.Value(i) - U; - if (Abs(dki) < Abs(delta)) + if (std::abs(dki) < std::abs(delta)) { ik = i; delta = dki; } } - if (Abs(delta) > Tol) + if (std::abs(delta) > Tol) { InsertKnot(U); if (delta < 0.) @@ -976,7 +976,7 @@ void Geom_BSplineCurve::SetWeight(const Standard_Integer Index, const Standard_R if (W <= gp::Resolution()) throw Standard_ConstructionError("BSpline curve: SetWeight: Weight too small"); - Standard_Boolean rat = IsRational() || (Abs(W - 1.) > gp::Resolution()); + Standard_Boolean rat = IsRational() || (std::abs(W - 1.) > gp::Resolution()); if (rat) { diff --git a/src/ModelingData/TKG3d/Geom/Geom_BSplineCurve.hxx b/src/ModelingData/TKG3d/Geom/Geom_BSplineCurve.hxx index 8975b8d9d1..6066120447 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_BSplineCurve.hxx +++ b/src/ModelingData/TKG3d/Geom/Geom_BSplineCurve.hxx @@ -751,8 +751,8 @@ public: //! Knots (I1) <= U <= Knots (I2) //! . if I1 = I2 U is a knot value (the tolerance criterion //! ParametricTolerance is used). - //! . if I1 < 1 => U < Knots (1) - Abs(ParametricTolerance) - //! . if I2 > NbKnots => U > Knots (NbKnots) + Abs(ParametricTolerance) + //! . if I1 < 1 => U < Knots (1) - std::abs(ParametricTolerance) + //! . if I2 > NbKnots => U > Knots (NbKnots) + std::abs(ParametricTolerance) Standard_EXPORT void LocateU(const Standard_Real U, const Standard_Real ParametricTolerance, Standard_Integer& I1, diff --git a/src/ModelingData/TKG3d/Geom/Geom_BSplineCurve_1.cxx b/src/ModelingData/TKG3d/Geom/Geom_BSplineCurve_1.cxx index 9fea0640e7..91d6d2adcb 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_BSplineCurve_1.cxx +++ b/src/ModelingData/TKG3d/Geom/Geom_BSplineCurve_1.cxx @@ -99,7 +99,7 @@ Standard_Boolean Geom_BSplineCurve::IsG1(const Standard_Real theTf, return Standard_False; } - if (Abs(aV1.Angle(aV2)) > theAngTol) + if (std::abs(aV1.Angle(aV2)) > theAngTol) return Standard_False; } @@ -129,7 +129,7 @@ Standard_Boolean Geom_BSplineCurve::IsG1(const Standard_Real theTf, return Standard_False; } - if (Abs(aV1.Angle(aV2)) > theAngTol) + if (std::abs(aV1.Angle(aV2)) > theAngTol) return Standard_False; return Standard_True; @@ -660,12 +660,12 @@ void Geom_BSplineCurve::LocateU(const Standard_Real U, Standard_Real UFirst = CKnots(1); Standard_Real ULast = CKnots(CKnots.Length()); - Standard_Real PParametricTolerance = Abs(ParametricTolerance); - if (Abs(NewU - UFirst) <= PParametricTolerance) + Standard_Real PParametricTolerance = std::abs(ParametricTolerance); + if (std::abs(NewU - UFirst) <= PParametricTolerance) { I1 = I2 = 1; } - else if (Abs(NewU - ULast) <= PParametricTolerance) + else if (std::abs(NewU - ULast) <= PParametricTolerance) { I1 = I2 = CKnots.Length(); } @@ -683,12 +683,12 @@ void Geom_BSplineCurve::LocateU(const Standard_Real U, { I1 = 1; BSplCLib::Hunt(CKnots, NewU, I1); - I1 = Max(Min(I1, CKnots.Upper()), CKnots.Lower()); - while (I1 + 1 <= CKnots.Upper() && Abs(CKnots(I1 + 1) - NewU) <= PParametricTolerance) + I1 = std::max(std::min(I1, CKnots.Upper()), CKnots.Lower()); + while (I1 + 1 <= CKnots.Upper() && std::abs(CKnots(I1 + 1) - NewU) <= PParametricTolerance) { I1++; } - if (Abs(CKnots(I1) - NewU) <= PParametricTolerance) + if (std::abs(CKnots(I1) - NewU) <= PParametricTolerance) { I2 = I1; } diff --git a/src/ModelingData/TKG3d/Geom/Geom_BSplineSurface.cxx b/src/ModelingData/TKG3d/Geom/Geom_BSplineSurface.cxx index b79768dbc0..c8af1ad93e 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_BSplineSurface.cxx +++ b/src/ModelingData/TKG3d/Geom/Geom_BSplineSurface.cxx @@ -69,7 +69,7 @@ static void CheckSurfaceData(const TColgp_Array2OfPnt& SPoles, Standard_Integer i; for (i = SUKnots.Lower(); i < SUKnots.Upper(); i++) { - if (SUKnots(i + 1) - SUKnots(i) <= Epsilon(Abs(SUKnots(i)))) + if (SUKnots(i + 1) - SUKnots(i) <= Epsilon(std::abs(SUKnots(i)))) { throw Standard_ConstructionError("Geom_BSplineSurface: UKnots interval values too close"); } @@ -77,7 +77,7 @@ static void CheckSurfaceData(const TColgp_Array2OfPnt& SPoles, for (i = SVKnots.Lower(); i < SVKnots.Upper(); i++) { - if (SVKnots(i + 1) - SVKnots(i) <= Epsilon(Abs(SVKnots(i)))) + if (SVKnots(i + 1) - SVKnots(i) <= Epsilon(std::abs(SVKnots(i)))) { throw Standard_ConstructionError("Geom_BSplineSurface: VKnots interval values too close"); } @@ -104,7 +104,7 @@ static void Rational(const TColStd_Array2OfReal& Weights, I = Weights.LowerRow(); while (!Vrational && I <= Weights.UpperRow() - 1) { - Vrational = (Abs(Weights(I, J) - Weights(I + 1, J)) > Epsilon(Abs(Weights(I, J)))); + Vrational = (std::abs(Weights(I, J) - Weights(I + 1, J)) > Epsilon(std::abs(Weights(I, J)))); I++; } J++; @@ -117,7 +117,7 @@ static void Rational(const TColStd_Array2OfReal& Weights, J = Weights.LowerCol(); while (!Urational && J <= Weights.UpperCol() - 1) { - Urational = (Abs(Weights(I, J) - Weights(I, J + 1)) > Epsilon(Abs(Weights(I, J)))); + Urational = (std::abs(Weights(I, J) - Weights(I, J + 1)) > Epsilon(std::abs(Weights(I, J)))); J++; } I++; @@ -604,8 +604,8 @@ void Geom_BSplineSurface::segment(const Standard_Real U1, // inserting the UKnots TColStd_Array1OfReal UKnots(1, 2); TColStd_Array1OfInteger UMults(1, 2); - UKnots(1) = Min(NewU1, NewU2); - UKnots(2) = Max(NewU1, NewU2); + UKnots(1) = std::min(NewU1, NewU2); + UKnots(2) = std::max(NewU1, NewU2); UMults(1) = UMults(2) = udeg; InsertUKnots(UKnots, UMults, EpsU); @@ -637,8 +637,8 @@ void Geom_BSplineSurface::segment(const Standard_Real U1, TColStd_Array1OfReal VKnots(1, 2); TColStd_Array1OfInteger VMults(1, 2); - VKnots(1) = Min(NewV1, NewV2); - VKnots(2) = Max(NewV1, NewV2); + VKnots(1) = std::min(NewV1, NewV2); + VKnots(2) = std::max(NewV1, NewV2); VMults(1) = VMults(2) = vdeg; InsertVKnots(VKnots, VMults, EpsV); } @@ -655,7 +655,7 @@ void Geom_BSplineSurface::segment(const Standard_Real U1, uknots->Upper(), index, U); - if (Abs(uknots->Value(index + 1) - U) <= EpsU) + if (std::abs(uknots->Value(index + 1) - U) <= EpsU) index++; SetUOrigin(index); SetUNotPeriodic(); @@ -674,7 +674,7 @@ void Geom_BSplineSurface::segment(const Standard_Real U1, ToU2, index1U, U); - if (Abs(uknots->Value(index1U + 1) - U) <= EpsU) + if (std::abs(uknots->Value(index1U + 1) - U) <= EpsU) index1U++; BSplCLib::LocateParameter(udeg, uknots->Array1(), @@ -685,7 +685,7 @@ void Geom_BSplineSurface::segment(const Standard_Real U1, ToU2, index2U, U); - if (Abs(uknots->Value(index2U + 1) - U) <= EpsU || index2U == index1U) + if (std::abs(uknots->Value(index2U + 1) - U) <= EpsU || index2U == index1U) index2U++; Standard_Integer nbuknots = index2U - index1U + 1; @@ -718,7 +718,7 @@ void Geom_BSplineSurface::segment(const Standard_Real U1, vknots->Upper(), index, V); - if (Abs(vknots->Value(index + 1) - V) <= EpsV) + if (std::abs(vknots->Value(index + 1) - V) <= EpsV) index++; SetVOrigin(index); SetVNotPeriodic(); @@ -737,7 +737,7 @@ void Geom_BSplineSurface::segment(const Standard_Real U1, ToV2, index1V, V); - if (Abs(vknots->Value(index1V + 1) - V) <= EpsV) + if (std::abs(vknots->Value(index1V + 1) - V) <= EpsV) index1V++; BSplCLib::LocateParameter(vdeg, vknots->Array1(), @@ -748,7 +748,7 @@ void Geom_BSplineSurface::segment(const Standard_Real U1, ToV2, index2V, V); - if (Abs(vknots->Value(index2V + 1) - V) <= EpsV || index2V == index1V) + if (std::abs(vknots->Value(index2V + 1) - V) <= EpsV || index2V == index1V) index2V++; Standard_Integer nbvknots = index2V - index1V + 1; @@ -774,7 +774,7 @@ void Geom_BSplineSurface::segment(const Standard_Real U1, Standard_Integer pindex2U = BSplCLib::PoleIndex(udeg, index2U, uperiodic, umults->Array1()); pindex1U++; - pindex2U = Min(pindex2U + 1, poles->ColLength()); + pindex2U = std::min(pindex2U + 1, poles->ColLength()); Standard_Integer nbupoles = pindex2U - pindex1U + 1; @@ -783,7 +783,7 @@ void Geom_BSplineSurface::segment(const Standard_Real U1, Standard_Integer pindex2V = BSplCLib::PoleIndex(vdeg, index2V, vperiodic, vmults->Array1()); pindex1V++; - pindex2V = Min(pindex2V + 1, poles->RowLength()); + pindex2V = std::min(pindex2V + 1, poles->RowLength()); Standard_Integer nbvpoles = pindex2V - pindex1V + 1; @@ -848,11 +848,11 @@ void Geom_BSplineSurface::Segment(const Standard_Real U1, if ((U2 < U1) || (V2 < V1)) throw Standard_DomainError("Geom_BSplineSurface::Segment"); - Standard_Real aMaxU = Max(Abs(U2), Abs(U1)); - Standard_Real EpsU = Max(Epsilon(aMaxU), theUTolerance); + Standard_Real aMaxU = std::max(std::abs(U2), std::abs(U1)); + Standard_Real EpsU = std::max(Epsilon(aMaxU), theUTolerance); - Standard_Real aMaxV = Max(Abs(V2), Abs(V1)); - Standard_Real EpsV = Max(Epsilon(aMaxV), theVTolerance); + Standard_Real aMaxV = std::max(std::abs(V2), std::abs(V1)); + Standard_Real EpsV = std::max(Epsilon(aMaxV), theVTolerance); segment(U1, U2, V1, V2, EpsU, EpsV, Standard_True, Standard_True); } @@ -870,18 +870,18 @@ void Geom_BSplineSurface::CheckAndSegment(const Standard_Real U1, if ((U2 < U1) || (V2 < V1)) throw Standard_DomainError("Geom_BSplineSurface::CheckAndSegment"); - Standard_Real aMaxU = Max(Abs(U2), Abs(U1)); - Standard_Real EpsU = Max(Epsilon(aMaxU), theUTolerance); + Standard_Real aMaxU = std::max(std::abs(U2), std::abs(U1)); + Standard_Real EpsU = std::max(Epsilon(aMaxU), theUTolerance); - Standard_Real aMaxV = Max(Abs(V2), Abs(V1)); - Standard_Real EpsV = Max(Epsilon(aMaxV), theVTolerance); + Standard_Real aMaxV = std::max(std::abs(V2), std::abs(V1)); + Standard_Real EpsV = std::max(Epsilon(aMaxV), theVTolerance); Standard_Boolean segment_in_U = Standard_True; Standard_Boolean segment_in_V = Standard_True; - segment_in_U = (Abs(U1 - uknots->Value(uknots->Lower())) > EpsU) - || (Abs(U2 - uknots->Value(uknots->Upper())) > EpsU); - segment_in_V = (Abs(V1 - vknots->Value(vknots->Lower())) > EpsV) - || (Abs(V2 - vknots->Value(vknots->Upper())) > EpsV); + segment_in_U = (std::abs(U1 - uknots->Value(uknots->Lower())) > EpsU) + || (std::abs(U2 - uknots->Value(uknots->Upper())) > EpsU); + segment_in_V = (std::abs(V1 - vknots->Value(vknots->Lower())) > EpsV) + || (std::abs(V2 - vknots->Value(vknots->Upper())) > EpsV); segment(U1, U2, V1, V2, EpsU, EpsV, segment_in_U, segment_in_V); } @@ -894,7 +894,7 @@ void Geom_BSplineSurface::SetUKnot(const Standard_Integer UIndex, const Standard throw Standard_OutOfRange("Geom_BSplineSurface::SetUKnot: Index and #knots mismatch"); Standard_Integer NewIndex = UIndex; - Standard_Real DU = Abs(Epsilon(K)); + Standard_Real DU = std::abs(Epsilon(K)); if (UIndex == 1) { if (K >= uknots->Value(2) - DU) @@ -936,14 +936,14 @@ void Geom_BSplineSurface::SetUKnots(const TColStd_Array1OfReal& UK) } if (Lower > 1) { - if (Abs(UK(Lower) - uknots->Value(Lower - 1)) <= gp::Resolution()) + if (std::abs(UK(Lower) - uknots->Value(Lower - 1)) <= gp::Resolution()) { throw Standard_ConstructionError("Geom_BSplineSurface::SetUKnots: invalid knot value"); } } if (Upper < uknots->Length()) { - if (Abs(UK(Upper) - uknots->Value(Upper + 1)) <= gp::Resolution()) + if (std::abs(UK(Upper) - uknots->Value(Upper + 1)) <= gp::Resolution()) { throw Standard_ConstructionError("Geom_BSplineSurface::SetUKnots: invalid knot value"); } @@ -954,7 +954,7 @@ void Geom_BSplineSurface::SetUKnots(const TColStd_Array1OfReal& UK) uknots->SetValue(i, UK(i)); if (i != Lower) { - if (Abs(UK(i) - K1) <= gp::Resolution()) + if (std::abs(UK(i) - K1) <= gp::Resolution()) { throw Standard_ConstructionError("Geom_BSplineSurface::SetUKnots: invalid knot value"); } @@ -983,7 +983,7 @@ void Geom_BSplineSurface::SetVKnot(const Standard_Integer VIndex, const Standard if (VIndex < 1 || VIndex > vknots->Length()) throw Standard_OutOfRange("Geom_BSplineSurface::SetVKnot: Index and #knots mismatch"); Standard_Integer NewIndex = VIndex + vknots->Lower() - 1; - Standard_Real DV = Abs(Epsilon(K)); + Standard_Real DV = std::abs(Epsilon(K)); if (VIndex == 1) { if (K >= vknots->Value(2) - DV) @@ -1027,14 +1027,14 @@ void Geom_BSplineSurface::SetVKnots(const TColStd_Array1OfReal& VK) } if (Lower > 1) { - if (Abs(VK(Lower) - vknots->Value(Lower - 1)) <= gp::Resolution()) + if (std::abs(VK(Lower) - vknots->Value(Lower - 1)) <= gp::Resolution()) { throw Standard_ConstructionError("Geom_BSplineSurface::SetVKnots: invalid knot value"); } } if (Upper < vknots->Length()) { - if (Abs(VK(Upper) - vknots->Value(Upper + 1)) <= gp::Resolution()) + if (std::abs(VK(Upper) - vknots->Value(Upper + 1)) <= gp::Resolution()) { throw Standard_ConstructionError("Geom_BSplineSurface::SetVKnots: invalid knot value"); } @@ -1045,7 +1045,7 @@ void Geom_BSplineSurface::SetVKnots(const TColStd_Array1OfReal& VK) vknots->SetValue(i, VK(i)); if (i != Lower) { - if (Abs(VK(i) - K1) <= gp::Resolution()) + if (std::abs(VK(i) - K1) <= gp::Resolution()) { throw Standard_ConstructionError("Geom_BSplineSurface::SetVKnots: invalid knot value"); } @@ -1244,7 +1244,7 @@ void Geom_BSplineSurface::PeriodicNormalization(Standard_Real& Uparameter, { aMaxVal = ufknots->Value(ufknots->Upper() - udeg); aMinVal = ufknots->Value(udeg + 1); - Standard_Real eps = Abs(Epsilon(Uparameter)); + Standard_Real eps = std::abs(Epsilon(Uparameter)); Period = aMaxVal - aMinVal; if (Period <= eps) @@ -1266,7 +1266,7 @@ void Geom_BSplineSurface::PeriodicNormalization(Standard_Real& Uparameter, { aMaxVal = vfknots->Value(vfknots->Upper() - vdeg); aMinVal = vfknots->Value(vdeg + 1); - Standard_Real eps = Abs(Epsilon(Vparameter)); + Standard_Real eps = std::abs(Epsilon(Vparameter)); Period = aMaxVal - aMinVal; if (Period <= eps) diff --git a/src/ModelingData/TKG3d/Geom/Geom_BSplineSurface.hxx b/src/ModelingData/TKG3d/Geom/Geom_BSplineSurface.hxx index a398e97bc4..268f48e7c6 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_BSplineSurface.hxx +++ b/src/ModelingData/TKG3d/Geom/Geom_BSplineSurface.hxx @@ -686,8 +686,8 @@ public: //! UKnots (I1) <= U <= UKnots (I2) //! . if I1 = I2 U is a knot value (the tolerance criterion //! ParametricTolerance is used). - //! . if I1 < 1 => U < UKnots(1) - Abs(ParametricTolerance) - //! . if I2 > NbUKnots => U > UKnots(NbUKnots)+Abs(ParametricTolerance) + //! . if I1 < 1 => U < UKnots(1) - std::abs(ParametricTolerance) + //! . if I2 > NbUKnots => U > UKnots(NbUKnots)+std::abs(ParametricTolerance) Standard_EXPORT void LocateU(const Standard_Real U, const Standard_Real ParametricTolerance, Standard_Integer& I1, @@ -702,8 +702,8 @@ public: //! VKnots (I1) <= V <= VKnots (I2) //! . if I1 = I2 V is a knot value (the tolerance criterion //! ParametricTolerance is used). - //! . if I1 < 1 => V < VKnots(1) - Abs(ParametricTolerance) - //! . if I2 > NbVKnots => V > VKnots(NbVKnots)+Abs(ParametricTolerance) + //! . if I1 < 1 => V < VKnots(1) - std::abs(ParametricTolerance) + //! . if I2 > NbVKnots => V > VKnots(NbVKnots)+std::abs(ParametricTolerance) //! poles insertion and removing //! The following methods are available only if the surface //! is Uniform or QuasiUniform in the considered direction diff --git a/src/ModelingData/TKG3d/Geom/Geom_BSplineSurface_1.cxx b/src/ModelingData/TKG3d/Geom/Geom_BSplineSurface_1.cxx index ce348a53a3..8541c9ef02 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_BSplineSurface_1.cxx +++ b/src/ModelingData/TKG3d/Geom/Geom_BSplineSurface_1.cxx @@ -937,8 +937,8 @@ void Geom_BSplineSurface::SetUPeriodic() Handle(TColStd_HArray1OfInteger) tm = umults; TColStd_Array1OfInteger cmults((umults->Array1())(first), first, last); // Modified by Sergey KHROMOV - Mon Feb 10 10:59:00 2003 Begin - // cmults(first) = cmults(last) = Max( cmults(first), cmults(last)); - cmults(first) = cmults(last) = Min(udeg, Max(cmults(first), cmults(last))); + // cmults(first) = cmults(last) = std::max( cmults(first), cmults(last)); + cmults(first) = cmults(last) = std::min(udeg, std::max(cmults(first), cmults(last))); // Modified by Sergey KHROMOV - Mon Feb 10 10:59:00 2003 End umults = new TColStd_HArray1OfInteger(1, cmults.Length()); umults->ChangeArray1() = cmults; @@ -1004,8 +1004,8 @@ void Geom_BSplineSurface::SetVPeriodic() Handle(TColStd_HArray1OfInteger) tm = vmults; TColStd_Array1OfInteger cmults((vmults->Array1())(first), first, last); // Modified by Sergey KHROMOV - Mon Feb 10 11:00:33 2003 Begin - // cmults(first) = cmults(last) = Max( cmults(first), cmults(last)); - cmults(first) = cmults(last) = Min(vdeg, Max(cmults(first), cmults(last))); + // cmults(first) = cmults(last) = std::max( cmults(first), cmults(last)); + cmults(first) = cmults(last) = std::min(vdeg, std::max(cmults(first), cmults(last))); // Modified by Sergey KHROMOV - Mon Feb 10 11:00:34 2003 End vmults = new TColStd_HArray1OfInteger(1, cmults.Length()); vmults->ChangeArray1() = cmults; @@ -1472,12 +1472,12 @@ void Geom_BSplineSurface::LocateU(const Standard_Real U, const TColStd_Array1OfReal& Knots = TheKnots->Array1(); Standard_Real UFirst = Knots(1); Standard_Real ULast = Knots(Knots.Length()); - Standard_Real PParametricTolerance = Abs(ParametricTolerance); - if (Abs(NewU - UFirst) <= PParametricTolerance) + Standard_Real PParametricTolerance = std::abs(ParametricTolerance); + if (std::abs(NewU - UFirst) <= PParametricTolerance) { I1 = I2 = 1; } - else if (Abs(NewU - ULast) <= PParametricTolerance) + else if (std::abs(NewU - ULast) <= PParametricTolerance) { I1 = I2 = Knots.Length(); } @@ -1495,12 +1495,12 @@ void Geom_BSplineSurface::LocateU(const Standard_Real U, { I1 = 1; BSplCLib::Hunt(Knots, NewU, I1); - I1 = Max(Min(I1, Knots.Upper()), Knots.Lower()); - while (I1 + 1 <= Knots.Upper() && Abs(Knots(I1 + 1) - NewU) <= PParametricTolerance) + I1 = std::max(std::min(I1, Knots.Upper()), Knots.Lower()); + while (I1 + 1 <= Knots.Upper() && std::abs(Knots(I1 + 1) - NewU) <= PParametricTolerance) { I1++; } - if (Abs(Knots(I1) - NewU) <= PParametricTolerance) + if (std::abs(Knots(I1) - NewU) <= PParametricTolerance) { I2 = I1; } @@ -1531,12 +1531,12 @@ void Geom_BSplineSurface::LocateV(const Standard_Real V, const TColStd_Array1OfReal& Knots = TheKnots->Array1(); Standard_Real VFirst = Knots(1); Standard_Real VLast = Knots(Knots.Length()); - Standard_Real PParametricTolerance = Abs(ParametricTolerance); - if (Abs(NewV - VFirst) <= PParametricTolerance) + Standard_Real PParametricTolerance = std::abs(ParametricTolerance); + if (std::abs(NewV - VFirst) <= PParametricTolerance) { I1 = I2 = 1; } - else if (Abs(NewV - VLast) <= PParametricTolerance) + else if (std::abs(NewV - VLast) <= PParametricTolerance) { I1 = I2 = Knots.Length(); } @@ -1554,12 +1554,12 @@ void Geom_BSplineSurface::LocateV(const Standard_Real V, { I1 = 1; BSplCLib::Hunt(Knots, NewV, I1); - I1 = Max(Min(I1, Knots.Upper()), Knots.Lower()); - while (I1 + 1 <= Knots.Upper() && Abs(Knots(I1 + 1) - NewV) <= PParametricTolerance) + I1 = std::max(std::min(I1, Knots.Upper()), Knots.Lower()); + while (I1 + 1 <= Knots.Upper() && std::abs(Knots(I1 + 1) - NewV) <= PParametricTolerance) { I1++; } - if (Abs(Knots(I1) - NewV) <= PParametricTolerance) + if (std::abs(Knots(I1) - NewV) <= PParametricTolerance) { I2 = I1; } diff --git a/src/ModelingData/TKG3d/Geom/Geom_BezierCurve.cxx b/src/ModelingData/TKG3d/Geom/Geom_BezierCurve.cxx index 40a8960359..faeb7007c3 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_BezierCurve.cxx +++ b/src/ModelingData/TKG3d/Geom/Geom_BezierCurve.cxx @@ -54,7 +54,7 @@ static Standard_Boolean Rational(const TColStd_Array1OfReal& W) Standard_Boolean rat = Standard_False; for (i = 1; i < n; i++) { - rat = Abs(W(i) - W(i + 1)) > gp::Resolution(); + rat = std::abs(W(i) - W(i + 1)) > gp::Resolution(); if (rat) break; } @@ -238,7 +238,7 @@ void Geom_BezierCurve::InsertPoleAfter(const Standard_Integer Index, // Insert the weight Handle(TColStd_HArray1OfReal) nweights; - Standard_Boolean rat = IsRational() || Abs(Weight - 1.) > gp::Resolution(); + Standard_Boolean rat = IsRational() || std::abs(Weight - 1.) > gp::Resolution(); if (rat) { @@ -365,7 +365,7 @@ Standard_Real Geom_BezierCurve::ReversedParameter(const Standard_Real U) const void Geom_BezierCurve::Segment(const Standard_Real U1, const Standard_Real U2) { - closed = (Abs(Value(U1).Distance(Value(U2))) <= Precision::Confusion()); + closed = (std::abs(Value(U1).Distance(Value(U2))) <= Precision::Confusion()); TColStd_Array1OfReal bidflatknots(BSplCLib::FlatBezierKnots(Degree()), 1, 2 * (Degree() + 1)); TColgp_HArray1OfPnt coeffs(1, poles->Size()); @@ -442,7 +442,7 @@ void Geom_BezierCurve::SetWeight(const Standard_Integer Index, const Standard_Re if (!wasrat) { // a weight of 1. does not turn to rational - if (Abs(Weight - 1.) <= gp::Resolution()) + if (std::abs(Weight - 1.) <= gp::Resolution()) return; // set weights of 1. diff --git a/src/ModelingData/TKG3d/Geom/Geom_BezierSurface.cxx b/src/ModelingData/TKG3d/Geom/Geom_BezierSurface.cxx index 077461d3b6..9b13fb9d7c 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_BezierSurface.cxx +++ b/src/ModelingData/TKG3d/Geom/Geom_BezierSurface.cxx @@ -63,7 +63,7 @@ static void Rational(const TColStd_Array2OfReal& Weights, I = Weights.LowerRow(); while (!Vrational && I <= Weights.UpperRow() - 1) { - Vrational = (Abs(Weights(I, J) - Weights(I + 1, J)) > Epsilon(Abs(Weights(I, J)))); + Vrational = (std::abs(Weights(I, J) - Weights(I + 1, J)) > Epsilon(std::abs(Weights(I, J)))); I++; } J++; @@ -76,7 +76,7 @@ static void Rational(const TColStd_Array2OfReal& Weights, J = Weights.LowerCol(); while (!Urational && J <= Weights.UpperCol() - 1) { - Urational = (Abs(Weights(I, J) - Weights(I, J + 1)) > Epsilon(Abs(Weights(I, J)))); + Urational = (std::abs(Weights(I, J) - Weights(I, J + 1)) > Epsilon(std::abs(Weights(I, J)))); J++; } I++; @@ -447,8 +447,8 @@ Geom_BezierSurface::Geom_BezierSurface(const TColgp_Array2OfPnt& SurfacePoles, I = PoleWeights.LowerRow(); while (!vrational && I <= PoleWeights.UpperRow() - 1) { - vrational = - (Abs(PoleWeights(I, J) - PoleWeights(I + 1, J)) > Epsilon(Abs(PoleWeights(I, J)))); + vrational = (std::abs(PoleWeights(I, J) - PoleWeights(I + 1, J)) + > Epsilon(std::abs(PoleWeights(I, J)))); I++; } J++; @@ -459,8 +459,8 @@ Geom_BezierSurface::Geom_BezierSurface(const TColgp_Array2OfPnt& SurfacePoles, J = PoleWeights.LowerCol(); while (!urational && J <= PoleWeights.UpperCol() - 1) { - urational = - (Abs(PoleWeights(I, J) - PoleWeights(I, J + 1)) > Epsilon(Abs(PoleWeights(I, J)))); + urational = (std::abs(PoleWeights(I, J) - PoleWeights(I, J + 1)) + > Epsilon(std::abs(PoleWeights(I, J)))); J++; } I++; @@ -1170,7 +1170,7 @@ void Geom_BezierSurface::SetWeight(const Standard_Integer UIndex, if (!wasrat) { // a weight of 1. does not turn to rational - if (Abs(Weight - 1.) <= gp::Resolution()) + if (std::abs(Weight - 1.) <= gp::Resolution()) return; // set weights of 1. @@ -1184,7 +1184,7 @@ void Geom_BezierSurface::SetWeight(const Standard_Integer UIndex, if (UIndex < 1 || UIndex > Weights.ColLength() || VIndex < 1 || VIndex > Weights.RowLength()) throw Standard_OutOfRange(); - if (Abs(Weight - Weights(UIndex, VIndex)) > gp::Resolution()) + if (std::abs(Weight - Weights(UIndex, VIndex)) > gp::Resolution()) { Weights(UIndex, VIndex) = Weight; Rational(Weights, urational, vrational); @@ -1290,7 +1290,7 @@ void Geom_BezierSurface::UReverse() Standard_Real W; for (Col = 1; Col <= Poles.RowLength(); Col++) { - for (Row = 1; Row <= IntegerPart(Poles.ColLength() / 2); Row++) + for (Row = 1; Row <= std::trunc(Poles.ColLength() / 2); Row++) { W = Weights(Row, Col); Weights(Row, Col) = Weights(Poles.ColLength() - Row + 1, Col); @@ -1305,7 +1305,7 @@ void Geom_BezierSurface::UReverse() { for (Col = 1; Col <= Poles.RowLength(); Col++) { - for (Row = 1; Row <= IntegerPart(Poles.ColLength() / 2); Row++) + for (Row = 1; Row <= std::trunc(Poles.ColLength() / 2); Row++) { Pol = Poles(Row, Col); Poles(Row, Col) = Poles(Poles.ColLength() - Row + 1, Col); @@ -1335,7 +1335,7 @@ void Geom_BezierSurface::VReverse() Standard_Real W; for (Row = 1; Row <= Poles.ColLength(); Row++) { - for (Col = 1; Col <= IntegerPart(Poles.RowLength() / 2); Col++) + for (Col = 1; Col <= std::trunc(Poles.RowLength() / 2); Col++) { W = Weights(Row, Col); Weights(Row, Col) = Weights(Row, Poles.RowLength() - Col + 1); @@ -1350,7 +1350,7 @@ void Geom_BezierSurface::VReverse() { for (Row = 1; Row <= Poles.ColLength(); Row++) { - for (Col = 1; Col <= IntegerPart(Poles.RowLength() / 2); Col++) + for (Col = 1; Col <= std::trunc(Poles.RowLength() / 2); Col++) { Pol = Poles(Row, Col); Poles(Row, Col) = Poles(Row, Poles.RowLength() - Col + 1); diff --git a/src/ModelingData/TKG3d/Geom/Geom_Circle.cxx b/src/ModelingData/TKG3d/Geom/Geom_Circle.cxx index aa6a7cf19a..2b4cd07afc 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_Circle.cxx +++ b/src/ModelingData/TKG3d/Geom/Geom_Circle.cxx @@ -187,7 +187,7 @@ Vec Geom_Circle::DN(const Standard_Real U, const Standard_Integer N) const void Geom_Circle::Transform(const Trsf& T) { - radius = radius * Abs(T.ScaleFactor()); + radius = radius * std::abs(T.ScaleFactor()); pos.Transform(T); } diff --git a/src/ModelingData/TKG3d/Geom/Geom_Circle.hxx b/src/ModelingData/TKG3d/Geom/Geom_Circle.hxx index 0bf0234a1d..555cfd0f56 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_Circle.hxx +++ b/src/ModelingData/TKG3d/Geom/Geom_Circle.hxx @@ -51,7 +51,7 @@ DEFINE_STANDARD_HANDLE(Geom_Circle, Geom_Conic) //! the trigonometric sense), determining the direction in //! which the parameter increases along the circle. //! The Geom_Circle circle is parameterized by an angle: -//! P(U) = O + R*Cos(U)*XDir + R*Sin(U)*YDir, where: +//! P(U) = O + R*std::cos(U)*XDir + R*Sin(U)*YDir, where: //! - P is the point of parameter U, //! - O, XDir and YDir are respectively the origin, "X //! Direction" and "Y Direction" of its local coordinate system, diff --git a/src/ModelingData/TKG3d/Geom/Geom_ConicalSurface.cxx b/src/ModelingData/TKG3d/Geom/Geom_ConicalSurface.cxx index 6ec6cc6283..71fd14c81d 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_ConicalSurface.cxx +++ b/src/ModelingData/TKG3d/Geom/Geom_ConicalSurface.cxx @@ -69,7 +69,8 @@ Geom_ConicalSurface::Geom_ConicalSurface(const Ax3& A3, semiAngle(Ang) { - if (R < 0.0 || Abs(Ang) <= gp::Resolution() || Abs(Ang) >= M_PI / 2.0 - gp::Resolution()) + if (R < 0.0 || std::abs(Ang) <= gp::Resolution() + || std::abs(Ang) >= M_PI / 2.0 - gp::Resolution()) throw Standard_ConstructionError(); pos = A3; @@ -181,7 +182,7 @@ void Geom_ConicalSurface::SetRadius(const Standard_Real R) void Geom_ConicalSurface::SetSemiAngle(const Standard_Real Ang) { - if (Abs(Ang) <= gp::Resolution() || Abs(Ang) >= M_PI / 2.0 - gp::Resolution()) + if (std::abs(Ang) <= gp::Resolution() || std::abs(Ang) >= M_PI / 2.0 - gp::Resolution()) { throw Standard_ConstructionError(); } @@ -194,7 +195,7 @@ Pnt Geom_ConicalSurface::Apex() const { XYZ Coord = Position().Direction().XYZ(); - Coord.Multiply(-radius / Tan(semiAngle)); + Coord.Multiply(-radius / std::tan(semiAngle)); Coord.Add(Position().Location().XYZ()); return Pnt(Coord); } @@ -227,11 +228,11 @@ void Geom_ConicalSurface::Coefficients(Standard_Real& A1, Standard_Real& D) const { // Dans le repere du cone : - // X**2 + Y**2 - (Myradius - Z * Tan(semiAngle))**2 = 0.0 + // X**2 + Y**2 - (Myradius - Z * std::tan(semiAngle))**2 = 0.0 Trsf T; T.SetTransformation(pos); - Standard_Real KAng = Tan(semiAngle); + Standard_Real KAng = std::tan(semiAngle); Standard_Real T11 = T.Value(1, 1); Standard_Real T12 = T.Value(1, 2); Standard_Real T13 = T.Value(1, 3); @@ -345,7 +346,7 @@ Handle(Geom_Curve) Geom_ConicalSurface::VIso(const Standard_Real V) const void Geom_ConicalSurface::Transform(const Trsf& T) { - radius = radius * Abs(T.ScaleFactor()); + radius = radius * std::abs(T.ScaleFactor()); pos.Transform(T); } @@ -356,7 +357,7 @@ void Geom_ConicalSurface::TransformParameters(Standard_Real&, const gp_Trsf& T) const { if (!Precision::IsInfinite(V)) - V *= Abs(T.ScaleFactor()); + V *= std::abs(T.ScaleFactor()); } //================================================================================================= @@ -365,7 +366,7 @@ gp_GTrsf2d Geom_ConicalSurface::ParametricTransformation(const gp_Trsf& T) const { gp_GTrsf2d T2; gp_Ax2d Axis(gp::Origin2d(), gp::DX2d()); - T2.SetAffinity(Axis, Abs(T.ScaleFactor())); + T2.SetAffinity(Axis, std::abs(T.ScaleFactor())); return T2; } diff --git a/src/ModelingData/TKG3d/Geom/Geom_ConicalSurface.hxx b/src/ModelingData/TKG3d/Geom/Geom_ConicalSurface.hxx index 171f2b5a55..d6e88f5520 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_ConicalSurface.hxx +++ b/src/ModelingData/TKG3d/Geom/Geom_ConicalSurface.hxx @@ -89,8 +89,8 @@ public: //! such that the normal Vector (N = D1U ^ D1V) is oriented towards //! the "outside region" of the surface. //! - //! Raised if Radius < 0.0 or Abs(Ang) < Resolution from gp or - //! Abs(Ang) >= PI/2 - Resolution + //! Raised if Radius < 0.0 or std::abs(Ang) < Resolution from gp or + //! std::abs(Ang) >= PI/2 - Resolution Standard_EXPORT Geom_ConicalSurface(const gp_Ax3& A3, const Standard_Real Ang, const Standard_Real Radius); @@ -108,9 +108,9 @@ public: //! Changes the semi angle of the conical surface. //! Semi-angle can be negative. Its absolute value - //! Abs(Ang) is in range ]0,PI/2[. - //! Raises ConstructionError if Abs(Ang) < Resolution from gp or - //! Abs(Ang) >= PI/2 - Resolution + //! std::abs(Ang) is in range ]0,PI/2[. + //! Raises ConstructionError if std::abs(Ang) < Resolution from gp or + //! std::abs(Ang) >= PI/2 - Resolution Standard_EXPORT void SetSemiAngle(const Standard_Real Ang); //! Returns a non transient cone with the same geometric properties as . diff --git a/src/ModelingData/TKG3d/Geom/Geom_CylindricalSurface.cxx b/src/ModelingData/TKG3d/Geom/Geom_CylindricalSurface.cxx index ae241b6c84..4419de8a99 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_CylindricalSurface.cxx +++ b/src/ModelingData/TKG3d/Geom/Geom_CylindricalSurface.cxx @@ -300,7 +300,7 @@ Handle(Geom_Curve) Geom_CylindricalSurface::VIso(const Standard_Real V) const void Geom_CylindricalSurface::Transform(const Trsf& T) { - radius = radius * Abs(T.ScaleFactor()); + radius = radius * std::abs(T.ScaleFactor()); pos.Transform(T); } @@ -311,7 +311,7 @@ void Geom_CylindricalSurface::TransformParameters(Standard_Real&, const gp_Trsf& T) const { if (!Precision::IsInfinite(V)) - V *= Abs(T.ScaleFactor()); + V *= std::abs(T.ScaleFactor()); } //================================================================================================= @@ -320,7 +320,7 @@ gp_GTrsf2d Geom_CylindricalSurface::ParametricTransformation(const gp_Trsf& T) c { gp_GTrsf2d T2; gp_Ax2d Axis(gp::Origin2d(), gp::DX2d()); - T2.SetAffinity(Axis, Abs(T.ScaleFactor())); + T2.SetAffinity(Axis, std::abs(T.ScaleFactor())); return T2; } diff --git a/src/ModelingData/TKG3d/Geom/Geom_Direction.cxx b/src/ModelingData/TKG3d/Geom/Geom_Direction.cxx index e967d990ab..94a6abd403 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_Direction.cxx +++ b/src/ModelingData/TKG3d/Geom/Geom_Direction.cxx @@ -81,7 +81,7 @@ Standard_Real Geom_Direction::SquareMagnitude() const void Geom_Direction::SetCoord(const Standard_Real X, const Standard_Real Y, const Standard_Real Z) { - Standard_Real D = Sqrt(X * X + Y * Y + Z * Z); + Standard_Real D = std::sqrt(X * X + Y * Y + Z * Z); Standard_ConstructionError_Raise_if(D <= gp::Resolution(), "Geom_Direction::SetCoord() - input vector has zero length"); gpVec = gp_Vec(X / D, Y / D, Z / D); @@ -90,7 +90,7 @@ void Geom_Direction::SetCoord(const Standard_Real X, const Standard_Real Y, cons void Geom_Direction::SetX(const Standard_Real X) { - Standard_Real D = Sqrt(X * X + gpVec.Y() * gpVec.Y() + gpVec.Z() * gpVec.Z()); + Standard_Real D = std::sqrt(X * X + gpVec.Y() * gpVec.Y() + gpVec.Z() * gpVec.Z()); Standard_ConstructionError_Raise_if(D <= gp::Resolution(), "Geom_Direction::SetX() - input vector has zero length"); gpVec = gp_Vec(X / D, gpVec.Y() / D, gpVec.Z() / D); @@ -99,7 +99,7 @@ void Geom_Direction::SetX(const Standard_Real X) void Geom_Direction::SetY(const Standard_Real Y) { - Standard_Real D = Sqrt(gpVec.X() * gpVec.X() + Y * Y + gpVec.Z() * gpVec.Z()); + Standard_Real D = std::sqrt(gpVec.X() * gpVec.X() + Y * Y + gpVec.Z() * gpVec.Z()); Standard_ConstructionError_Raise_if(D <= gp::Resolution(), "Geom_Direction::SetY() - input vector has zero length"); gpVec = gp_Vec(gpVec.X() / D, Y / D, gpVec.Z() / D); @@ -108,7 +108,7 @@ void Geom_Direction::SetY(const Standard_Real Y) void Geom_Direction::SetZ(const Standard_Real Z) { - Standard_Real D = Sqrt(gpVec.X() * gpVec.X() + gpVec.Y() * gpVec.Y() + Z * Z); + Standard_Real D = std::sqrt(gpVec.X() * gpVec.X() + gpVec.Y() * gpVec.Y() + Z * Z); Standard_ConstructionError_Raise_if(D <= gp::Resolution(), "Geom_Direction::SetZ() - input vector has zero length"); gpVec = gp_Vec(gpVec.X() / D, gpVec.Y() / D, Z / D); diff --git a/src/ModelingData/TKG3d/Geom/Geom_Direction.hxx b/src/ModelingData/TKG3d/Geom/Geom_Direction.hxx index 5c4e0e555b..da8e9283f8 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_Direction.hxx +++ b/src/ModelingData/TKG3d/Geom/Geom_Direction.hxx @@ -36,7 +36,7 @@ class Geom_Direction : public Geom_Vector public: //! Creates a unit vector with it 3 cartesian coordinates. //! - //! Raised if Sqrt( X*X + Y*Y + Z*Z) <= Resolution from gp. + //! Raised if std::sqrt( X*X + Y*Y + Z*Z) <= Resolution from gp. Standard_EXPORT Geom_Direction(const Standard_Real X, const Standard_Real Y, const Standard_Real Z); @@ -46,7 +46,7 @@ public: //! Sets to X,Y,Z coordinates. //! - //! Raised if Sqrt( X*X + Y*Y + Z*Z) <= Resolution from gp. + //! Raised if std::sqrt( X*X + Y*Y + Z*Z) <= Resolution from gp. Standard_EXPORT void SetCoord(const Standard_Real X, const Standard_Real Y, const Standard_Real Z); @@ -56,17 +56,17 @@ public: //! Changes the X coordinate of . //! - //! Raised if Sqrt( X*X + Y*Y + Z*Z) <= Resolution from gp. + //! Raised if std::sqrt( X*X + Y*Y + Z*Z) <= Resolution from gp. Standard_EXPORT void SetX(const Standard_Real X); //! Changes the Y coordinate of . //! - //! Raised if Sqrt( X*X + Y*Y + Z*Z) <= Resolution from gp. + //! Raised if std::sqrt( X*X + Y*Y + Z*Z) <= Resolution from gp. Standard_EXPORT void SetY(const Standard_Real Y); //! Changes the Z coordinate of . //! - //! Raised if Sqrt( X*X + Y*Y + Z*Z) <= Resolution from gp. + //! Raised if std::sqrt( X*X + Y*Y + Z*Z) <= Resolution from gp. Standard_EXPORT void SetZ(const Standard_Real Z); //! Returns the non transient direction with the same diff --git a/src/ModelingData/TKG3d/Geom/Geom_Ellipse.cxx b/src/ModelingData/TKG3d/Geom/Geom_Ellipse.cxx index 78f9276862..6fc2c8e773 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_Ellipse.cxx +++ b/src/ModelingData/TKG3d/Geom/Geom_Ellipse.cxx @@ -234,7 +234,7 @@ Standard_Real Geom_Ellipse::Eccentricity() const } else { - return (Sqrt(majorRadius * majorRadius - minorRadius * minorRadius)) / majorRadius; + return (std::sqrt(majorRadius * majorRadius - minorRadius * minorRadius)) / majorRadius; } } @@ -243,7 +243,7 @@ Standard_Real Geom_Ellipse::Eccentricity() const Standard_Real Geom_Ellipse::Focal() const { - return 2.0 * Sqrt(majorRadius * majorRadius - minorRadius * minorRadius); + return 2.0 * std::sqrt(majorRadius * majorRadius - minorRadius * minorRadius); } //================================================================================================= @@ -251,7 +251,7 @@ Standard_Real Geom_Ellipse::Focal() const Pnt Geom_Ellipse::Focus1() const { - Standard_Real C = Sqrt(majorRadius * majorRadius - minorRadius * minorRadius); + Standard_Real C = std::sqrt(majorRadius * majorRadius - minorRadius * minorRadius); Standard_Real Xp, Yp, Zp, Xd, Yd, Zd; pos.Location().Coord(Xp, Yp, Zp); pos.XDirection().Coord(Xd, Yd, Zd); @@ -263,7 +263,7 @@ Pnt Geom_Ellipse::Focus1() const Pnt Geom_Ellipse::Focus2() const { - Standard_Real C = Sqrt(majorRadius * majorRadius - minorRadius * minorRadius); + Standard_Real C = std::sqrt(majorRadius * majorRadius - minorRadius * minorRadius); Standard_Real Xp, Yp, Zp, Xd, Yd, Zd; pos.Location().Coord(Xp, Yp, Zp); pos.XDirection().Coord(Xd, Yd, Zd); @@ -286,8 +286,8 @@ Standard_Real Geom_Ellipse::Parameter() const void Geom_Ellipse::Transform(const Trsf& T) { - majorRadius = majorRadius * Abs(T.ScaleFactor()); - minorRadius = minorRadius * Abs(T.ScaleFactor()); + majorRadius = majorRadius * std::abs(T.ScaleFactor()); + minorRadius = minorRadius * std::abs(T.ScaleFactor()); pos.Transform(T); } diff --git a/src/ModelingData/TKG3d/Geom/Geom_Ellipse.hxx b/src/ModelingData/TKG3d/Geom/Geom_Ellipse.hxx index 4b4646cf09..934779a067 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_Ellipse.hxx +++ b/src/ModelingData/TKG3d/Geom/Geom_Ellipse.hxx @@ -53,7 +53,7 @@ DEFINE_STANDARD_HANDLE(Geom_Ellipse, Geom_Conic) //! the trigonometric sense), determining the direction in //! which the parameter increases along the ellipse. //! The Geom_Ellipse ellipse is parameterized by an angle: -//! P(U) = O + MajorRad*Cos(U)*XDir + MinorRad*Sin(U)*YDir +//! P(U) = O + MajorRad*std::cos(U)*XDir + MinorRad*Sin(U)*YDir //! where: //! - P is the point of parameter U, //! - O, XDir and YDir are respectively the origin, "X diff --git a/src/ModelingData/TKG3d/Geom/Geom_Hyperbola.cxx b/src/ModelingData/TKG3d/Geom/Geom_Hyperbola.cxx index 63862c4345..78ac2f13cb 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_Hyperbola.cxx +++ b/src/ModelingData/TKG3d/Geom/Geom_Hyperbola.cxx @@ -264,7 +264,7 @@ Standard_Real Geom_Hyperbola::Eccentricity() const { Standard_ConstructionError_Raise_if(majorRadius == 0.0, " ") return ( - Sqrt(majorRadius * majorRadius + minorRadius * minorRadius)) + std::sqrt(majorRadius * majorRadius + minorRadius * minorRadius)) / majorRadius; } @@ -273,7 +273,7 @@ Standard_Real Geom_Hyperbola::Eccentricity() const Standard_Real Geom_Hyperbola::Focal() const { - return 2.0 * Sqrt(majorRadius * majorRadius + minorRadius * minorRadius); + return 2.0 * std::sqrt(majorRadius * majorRadius + minorRadius * minorRadius); } //================================================================================================= @@ -281,7 +281,7 @@ Standard_Real Geom_Hyperbola::Focal() const Pnt Geom_Hyperbola::Focus1() const { - Standard_Real C = Sqrt(majorRadius * majorRadius + minorRadius * minorRadius); + Standard_Real C = std::sqrt(majorRadius * majorRadius + minorRadius * minorRadius); Standard_Real Xp, Yp, Zp, Xd, Yd, Zd; pos.Location().Coord(Xp, Yp, Zp); pos.XDirection().Coord(Xd, Yd, Zd); @@ -293,7 +293,7 @@ Pnt Geom_Hyperbola::Focus1() const Pnt Geom_Hyperbola::Focus2() const { - Standard_Real C = Sqrt(majorRadius * majorRadius + minorRadius * minorRadius); + Standard_Real C = std::sqrt(majorRadius * majorRadius + minorRadius * minorRadius); Standard_Real Xp, Yp, Zp, Xd, Yd, Zd; pos.Location().Coord(Xp, Yp, Zp); pos.XDirection().Coord(Xd, Yd, Zd); @@ -323,8 +323,8 @@ Standard_Real Geom_Hyperbola::Parameter() const void Geom_Hyperbola::Transform(const Trsf& T) { - majorRadius = majorRadius * Abs(T.ScaleFactor()); - minorRadius = minorRadius * Abs(T.ScaleFactor()); + majorRadius = majorRadius * std::abs(T.ScaleFactor()); + minorRadius = minorRadius * std::abs(T.ScaleFactor()); pos.Transform(T); } diff --git a/src/ModelingData/TKG3d/Geom/Geom_Hyperbola.hxx b/src/ModelingData/TKG3d/Geom/Geom_Hyperbola.hxx index fa6c922922..96f250d275 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_Hyperbola.hxx +++ b/src/ModelingData/TKG3d/Geom/Geom_Hyperbola.hxx @@ -57,7 +57,7 @@ DEFINE_STANDARD_HANDLE(Geom_Hyperbola, Geom_Conic) //! determining the direction in which the parameter //! increases along the hyperbola. //! The Geom_Hyperbola hyperbola is parameterized as follows: -//! P(U) = O + MajRad*Cosh(U)*XDir + MinRad*Sinh(U)*YDir, where: +//! P(U) = O + MajRad*std::cosh(U)*XDir + MinRad*std::sinh(U)*YDir, where: //! - P is the point of parameter U, //! - O, XDir and YDir are respectively the origin, "X //! Direction" and "Y Direction" of its local coordinate system, @@ -226,8 +226,8 @@ public: Standard_EXPORT Standard_Real Parameter() const; //! Returns in P the point of parameter U. - //! P = C + MajorRadius * Cosh (U) * XDir + - //! MinorRadius * Sinh (U) * YDir + //! P = C + MajorRadius * std::cosh(U) * XDir + + //! MinorRadius * std::sinh(U) * YDir //! where C is the center of the hyperbola , XDir the XDirection and //! YDir the YDirection of the hyperbola's local coordinate system. Standard_EXPORT void D0(const Standard_Real U, gp_Pnt& P) const Standard_OVERRIDE; diff --git a/src/ModelingData/TKG3d/Geom/Geom_Line.cxx b/src/ModelingData/TKG3d/Geom/Geom_Line.cxx index d04fac1eea..c481b70f6f 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_Line.cxx +++ b/src/ModelingData/TKG3d/Geom/Geom_Line.cxx @@ -217,14 +217,14 @@ Standard_Real Geom_Line::TransformedParameter(const Standard_Real U, const gp_Tr { if (Precision::IsInfinite(U)) return U; - return U * Abs(T.ScaleFactor()); + return U * std::abs(T.ScaleFactor()); } //================================================================================================= Standard_Real Geom_Line::ParametricTransformation(const gp_Trsf& T) const { - return Abs(T.ScaleFactor()); + return std::abs(T.ScaleFactor()); } //================================================================================================= diff --git a/src/ModelingData/TKG3d/Geom/Geom_OffsetSurface.cxx b/src/ModelingData/TKG3d/Geom/Geom_OffsetSurface.cxx index 873d34c384..8ba66be5fc 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_OffsetSurface.cxx +++ b/src/ModelingData/TKG3d/Geom/Geom_OffsetSurface.cxx @@ -845,7 +845,7 @@ Handle(Geom_Surface) Geom_OffsetSurface::Surface() const else if (Radius <= -Tol) { Axis.Rotate(gp_Ax1(Axis.Location(), Axis.Direction()), M_PI); - Result = new Geom_CylindricalSurface(Axis, Abs(Radius)); + Result = new Geom_CylindricalSurface(Axis, std::abs(Radius)); Result->UReverse(); } else @@ -862,22 +862,22 @@ Handle(Geom_Surface) Geom_OffsetSurface::Surface() const Standard_Real aRadius; if (isDirect) { - aRadius = C->RefRadius() + offsetValue * Cos(anAlpha); + aRadius = C->RefRadius() + offsetValue * std::cos(anAlpha); } else { - aRadius = C->RefRadius() - offsetValue * Cos(anAlpha); + aRadius = C->RefRadius() - offsetValue * std::cos(anAlpha); } if (aRadius >= 0.) { gp_Vec aZ(anAxis.Direction()); if (isDirect) { - aZ *= -offsetValue * Sin(anAlpha); + aZ *= -offsetValue * std::sin(anAlpha); } else { - aZ *= offsetValue * Sin(anAlpha); + aZ *= offsetValue * std::sin(anAlpha); } anAxis.Translate(aZ); Result = new Geom_ConicalSurface(anAxis, anAlpha, aRadius); diff --git a/src/ModelingData/TKG3d/Geom/Geom_OsculatingSurface.cxx b/src/ModelingData/TKG3d/Geom/Geom_OsculatingSurface.cxx index 2110f9b730..3eeb8bf7d2 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_OsculatingSurface.cxx +++ b/src/ModelingData/TKG3d/Geom/Geom_OsculatingSurface.cxx @@ -477,8 +477,8 @@ Standard_Boolean Geom_OsculatingSurface::BuildOsculatingSurface( } else { - MinDegree = (Standard_Integer)Min(udeg, vdeg); - MaxDegree = (Standard_Integer)Max(udeg, vdeg); + MinDegree = (Standard_Integer)std::min(udeg, vdeg); + MaxDegree = (Standard_Integer)std::max(udeg, vdeg); TColgp_Array2OfPnt cachepoles(1, MaxDegree + 1, 1, MinDegree + 1); // end for cache @@ -710,7 +710,7 @@ Standard_Boolean Geom_OsculatingSurface::IsQPunctual(const Handle(Geom_Surface)& for (T = U1; T <= U2; T = T + Step) { S->D1(T, Param, P, D1U, D1V); - D1NormMax = Max(D1NormMax, D1U.Magnitude()); + D1NormMax = std::max(D1NormMax, D1U.Magnitude()); } #ifdef OCCT_DEBUG @@ -726,7 +726,7 @@ Standard_Boolean Geom_OsculatingSurface::IsQPunctual(const Handle(Geom_Surface)& for (T = V1; T <= V2; T = T + Step) { S->D1(Param, T, P, D1U, D1V); - D1NormMax = Max(D1NormMax, D1V.Magnitude()); + D1NormMax = std::max(D1NormMax, D1V.Magnitude()); } #ifdef OCCT_DEBUG std::cout << " D1NormMax = " << D1NormMax << std::endl; diff --git a/src/ModelingData/TKG3d/Geom/Geom_Parabola.cxx b/src/ModelingData/TKG3d/Geom/Geom_Parabola.cxx index 31d1d6236a..ff41fba67f 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_Parabola.cxx +++ b/src/ModelingData/TKG3d/Geom/Geom_Parabola.cxx @@ -227,7 +227,7 @@ gp_Parab Geom_Parabola::Parab() const void Geom_Parabola::Transform(const Trsf& T) { - focalLength *= Abs(T.ScaleFactor()); + focalLength *= std::abs(T.ScaleFactor()); pos.Transform(T); } @@ -237,14 +237,14 @@ Standard_Real Geom_Parabola::TransformedParameter(const Standard_Real U, const g { if (Precision::IsInfinite(U)) return U; - return U * Abs(T.ScaleFactor()); + return U * std::abs(T.ScaleFactor()); } //================================================================================================= Standard_Real Geom_Parabola::ParametricTransformation(const gp_Trsf& T) const { - return Abs(T.ScaleFactor()); + return std::abs(T.ScaleFactor()); } //================================================================================================= diff --git a/src/ModelingData/TKG3d/Geom/Geom_Plane.cxx b/src/ModelingData/TKG3d/Geom/Geom_Plane.cxx index a17734eaab..82843f8ab2 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_Plane.cxx +++ b/src/ModelingData/TKG3d/Geom/Geom_Plane.cxx @@ -302,9 +302,9 @@ Handle(Geom_Curve) Geom_Plane::VIso(const Standard_Real V) const void Geom_Plane::TransformParameters(Standard_Real& U, Standard_Real& V, const gp_Trsf& T) const { if (!Precision::IsInfinite(U)) - U *= Abs(T.ScaleFactor()); + U *= std::abs(T.ScaleFactor()); if (!Precision::IsInfinite(V)) - V *= Abs(T.ScaleFactor()); + V *= std::abs(T.ScaleFactor()); } //================================================================================================= @@ -312,7 +312,7 @@ void Geom_Plane::TransformParameters(Standard_Real& U, Standard_Real& V, const g gp_GTrsf2d Geom_Plane::ParametricTransformation(const gp_Trsf& T) const { gp_Trsf2d T2; - T2.SetScale(gp::Origin2d(), Abs(T.ScaleFactor())); + T2.SetScale(gp::Origin2d(), std::abs(T.ScaleFactor())); return gp_GTrsf2d(T2); } diff --git a/src/ModelingData/TKG3d/Geom/Geom_Plane.hxx b/src/ModelingData/TKG3d/Geom/Geom_Plane.hxx index b2450bd6a4..ec52746623 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_Plane.hxx +++ b/src/ModelingData/TKG3d/Geom/Geom_Plane.hxx @@ -83,7 +83,7 @@ public: //! @code //! Ax + By + Cz + D = 0.0 //! @endcode - //! Raised if Sqrt (A*A + B*B + C*C) <= Resolution from gp + //! Raised if std::sqrt(A*A + B*B + C*C) <= Resolution from gp Standard_EXPORT Geom_Plane(const Standard_Real A, const Standard_Real B, const Standard_Real C, diff --git a/src/ModelingData/TKG3d/Geom/Geom_RectangularTrimmedSurface.cxx b/src/ModelingData/TKG3d/Geom/Geom_RectangularTrimmedSurface.cxx index ec2e907d01..62bea8278c 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_RectangularTrimmedSurface.cxx +++ b/src/ModelingData/TKG3d/Geom/Geom_RectangularTrimmedSurface.cxx @@ -237,7 +237,7 @@ void Geom_RectangularTrimmedSurface::SetTrim(const Standard_Real U1, utrim2 = U2; ElCLib::AdjustPeriodic(Udeb, Ufin, - Min(Abs(utrim2 - utrim1) / 2, Precision::PConfusion()), + std::min(std::abs(utrim2 - utrim1) / 2, Precision::PConfusion()), utrim1, utrim2); } @@ -284,7 +284,7 @@ void Geom_RectangularTrimmedSurface::SetTrim(const Standard_Real U1, vtrim2 = V2; ElCLib::AdjustPeriodic(Vdeb, Vfin, - Min(Abs(vtrim2 - vtrim1) / 2, Precision::PConfusion()), + std::min(std::abs(vtrim2 - vtrim1) / 2, Precision::PConfusion()), vtrim1, vtrim2); } diff --git a/src/ModelingData/TKG3d/Geom/Geom_SphericalSurface.cxx b/src/ModelingData/TKG3d/Geom/Geom_SphericalSurface.cxx index 2fd6abb221..317f070036 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_SphericalSurface.cxx +++ b/src/ModelingData/TKG3d/Geom/Geom_SphericalSurface.cxx @@ -308,7 +308,7 @@ Standard_Real Geom_SphericalSurface::Volume() const void Geom_SphericalSurface::Transform(const Trsf& T) { - radius = radius * Abs(T.ScaleFactor()); + radius = radius * std::abs(T.ScaleFactor()); pos.Transform(T); } diff --git a/src/ModelingData/TKG3d/Geom/Geom_SurfaceOfLinearExtrusion.cxx b/src/ModelingData/TKG3d/Geom/Geom_SurfaceOfLinearExtrusion.cxx index e37a19ff36..017538bd70 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_SurfaceOfLinearExtrusion.cxx +++ b/src/ModelingData/TKG3d/Geom/Geom_SurfaceOfLinearExtrusion.cxx @@ -289,7 +289,7 @@ void Geom_SurfaceOfLinearExtrusion::TransformParameters(Standard_Real& U, { U = basisCurve->TransformedParameter(U, T); if (!Precision::IsInfinite(V)) - V *= Abs(T.ScaleFactor()); + V *= std::abs(T.ScaleFactor()); } //================================================================================================= @@ -299,7 +299,7 @@ gp_GTrsf2d Geom_SurfaceOfLinearExtrusion::ParametricTransformation(const gp_Trsf // transformation in the V Direction gp_GTrsf2d TV; gp_Ax2d Axis(gp::Origin2d(), gp::DX2d()); - TV.SetAffinity(Axis, Abs(T.ScaleFactor())); + TV.SetAffinity(Axis, std::abs(T.ScaleFactor())); // transformation in the U Direction gp_GTrsf2d TU; Axis = gp_Ax2d(gp::Origin2d(), gp::DY2d()); diff --git a/src/ModelingData/TKG3d/Geom/Geom_ToroidalSurface.cxx b/src/ModelingData/TKG3d/Geom/Geom_ToroidalSurface.cxx index d1816be7a9..f6b014a3a7 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_ToroidalSurface.cxx +++ b/src/ModelingData/TKG3d/Geom/Geom_ToroidalSurface.cxx @@ -327,8 +327,8 @@ Standard_Real Geom_ToroidalSurface::Volume() const void Geom_ToroidalSurface::Transform(const Trsf& T) { - majorRadius = majorRadius * Abs(T.ScaleFactor()); - minorRadius = minorRadius * Abs(T.ScaleFactor()); + majorRadius = majorRadius * std::abs(T.ScaleFactor()); + minorRadius = minorRadius * std::abs(T.ScaleFactor()); pos.Transform(T); } diff --git a/src/ModelingData/TKG3d/Geom/Geom_ToroidalSurface.hxx b/src/ModelingData/TKG3d/Geom/Geom_ToroidalSurface.hxx index 48f6ab2bbf..a88df01f7e 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_ToroidalSurface.hxx +++ b/src/ModelingData/TKG3d/Geom/Geom_ToroidalSurface.hxx @@ -203,7 +203,7 @@ public: //! Computes the point P (U, V) on the surface. //! P (U, V) = Loc + MinorRadius * Sin (V) * Zdir + - //! (MajorRadius + MinorRadius * Cos(V)) * + //! (MajorRadius + MinorRadius * std::cos(V)) * //! (cos (U) * XDir + sin (U) * YDir) //! where Loc is the origin of the placement plane (XAxis, YAxis) //! XDir is the direction of the XAxis and YDir the direction of diff --git a/src/ModelingData/TKG3d/Geom/Geom_TrimmedCurve.cxx b/src/ModelingData/TKG3d/Geom/Geom_TrimmedCurve.cxx index af1bb19de7..23347170fe 100644 --- a/src/ModelingData/TKG3d/Geom/Geom_TrimmedCurve.cxx +++ b/src/ModelingData/TKG3d/Geom/Geom_TrimmedCurve.cxx @@ -111,7 +111,7 @@ void Geom_TrimmedCurve::SetTrim(const Standard_Real U1, if (theAdjustPeriodic) ElCLib::AdjustPeriodic(Udeb, Ufin, - Min(Abs(uTrim2 - uTrim1) / 2, Precision::PConfusion()), + std::min(std::abs(uTrim2 - uTrim1) / 2, Precision::PConfusion()), uTrim1, uTrim2); } diff --git a/src/ModelingData/TKG3d/GeomAdaptor/GeomAdaptor_Curve.cxx b/src/ModelingData/TKG3d/GeomAdaptor/GeomAdaptor_Curve.cxx index a8527903ce..0ea5b5300e 100644 --- a/src/ModelingData/TKG3d/GeomAdaptor/GeomAdaptor_Curve.cxx +++ b/src/ModelingData/TKG3d/GeomAdaptor/GeomAdaptor_Curve.cxx @@ -114,12 +114,12 @@ GeomAbs_Shape GeomAdaptor_Curve::LocalContinuity(const Standard_Real U1, Nb, Index2, newLast); - if (Abs(newFirst - TK(Index1 + 1)) < Precision::PConfusion()) + if (std::abs(newFirst - TK(Index1 + 1)) < Precision::PConfusion()) { if (Index1 < Nb) Index1++; } - if (Abs(newLast - TK(Index2)) < Precision::PConfusion()) + if (std::abs(newLast - TK(Index2)) < Precision::PConfusion()) Index2--; Standard_Integer MultMax; // attention aux courbes peridiques. @@ -314,7 +314,7 @@ Standard_Integer GeomAdaptor_Curve::NbIntervals(const GeomAbs_Shape S) const throw Standard_DomainError("GeomAdaptor_Curve::NbIntervals()"); } - Standard_Real anEps = Min(Resolution(Precision::Confusion()), Precision::PConfusion()); + Standard_Real anEps = std::min(Resolution(Precision::Confusion()), Precision::PConfusion()); return BSplCLib::Intervals(myBSplineCurve->Knots(), myBSplineCurve->Multiplicities(), @@ -406,7 +406,7 @@ void GeomAdaptor_Curve::Intervals(TColStd_Array1OfReal& T, const GeomAbs_Shape S throw Standard_DomainError("GeomAdaptor_Curve::Intervals()"); } - Standard_Real anEps = Min(Resolution(Precision::Confusion()), Precision::PConfusion()); + Standard_Real anEps = std::min(Resolution(Precision::Confusion()), Precision::PConfusion()); BSplCLib::Intervals(myBSplineCurve->Knots(), myBSplineCurve->Multiplicities(), @@ -746,7 +746,7 @@ Standard_Real GeomAdaptor_Curve::Resolution(const Standard_Real R3D) const case GeomAbs_Circle: { Standard_Real R = Handle(Geom_Circle)::DownCast(myCurve)->Circ().Radius(); if (R > R3D / 2.) - return 2 * ASin(R3D / (2 * R)); + return 2 * std::asin(R3D / (2 * R)); else return 2 * M_PI; } diff --git a/src/ModelingData/TKG3d/GeomAdaptor/GeomAdaptor_Surface.cxx b/src/ModelingData/TKG3d/GeomAdaptor/GeomAdaptor_Surface.cxx index 7dba6c900b..e944a3ef37 100644 --- a/src/ModelingData/TKG3d/GeomAdaptor/GeomAdaptor_Surface.cxx +++ b/src/ModelingData/TKG3d/GeomAdaptor/GeomAdaptor_Surface.cxx @@ -81,9 +81,9 @@ GeomAbs_Shape LocalContinuity(Standard_Integer Degree, BSplCLib::LocateParameter(Degree, TK, TM, PFirst, IsPeriodic, 1, Nb, Index1, newFirst); BSplCLib::LocateParameter(Degree, TK, TM, PLast, IsPeriodic, 1, Nb, Index2, newLast); constexpr Standard_Real EpsKnot = Precision::PConfusion(); - if (Abs(newFirst - TK(Index1 + 1)) < EpsKnot) + if (std::abs(newFirst - TK(Index1 + 1)) < EpsKnot) Index1++; - if (Abs(newLast - TK(Index2)) < EpsKnot) + if (std::abs(newLast - TK(Index2)) < EpsKnot) Index2--; // attention aux courbes peridiques. if ((IsPeriodic) && (Index1 == Nb)) @@ -626,10 +626,10 @@ Standard_Boolean GeomAdaptor_Surface::IsUClosed() const Standard_Real U1, U2, V1, V2; mySurface->Bounds(U1, U2, V1, V2); if (mySurface->IsUPeriodic()) - return (Abs(Abs(U1 - U2) - Abs(myUFirst - myULast)) < Precision::PConfusion()); + return (std::abs(std::abs(U1 - U2) - std::abs(myUFirst - myULast)) < Precision::PConfusion()); - return (Abs(U1 - myUFirst) < Precision::PConfusion() - && Abs(U2 - myULast) < Precision::PConfusion()); + return (std::abs(U1 - myUFirst) < Precision::PConfusion() + && std::abs(U2 - myULast) < Precision::PConfusion()); } //================================================================================================= @@ -642,10 +642,10 @@ Standard_Boolean GeomAdaptor_Surface::IsVClosed() const Standard_Real U1, U2, V1, V2; mySurface->Bounds(U1, U2, V1, V2); if (mySurface->IsVPeriodic()) - return (Abs(Abs(V1 - V2) - Abs(myVFirst - myVLast)) < Precision::PConfusion()); + return (std::abs(std::abs(V1 - V2) - std::abs(myVFirst - myVLast)) < Precision::PConfusion()); - return (Abs(V1 - myVFirst) < Precision::PConfusion() - && Abs(V2 - myVLast) < Precision::PConfusion()); + return (std::abs(V1 - myVFirst) < Precision::PConfusion() + && std::abs(V2 - myVLast) < Precision::PConfusion()); } //================================================================================================= @@ -766,22 +766,22 @@ void GeomAdaptor_Surface::D1(const Standard_Real U, { Standard_Integer Ideb, Ifin, IVdeb, IVfin, USide = 0, VSide = 0; Standard_Real u = U, v = V; - if (Abs(U - myUFirst) <= myTolU) + if (std::abs(U - myUFirst) <= myTolU) { USide = 1; u = myUFirst; } - else if (Abs(U - myULast) <= myTolU) + else if (std::abs(U - myULast) <= myTolU) { USide = -1; u = myULast; } - if (Abs(V - myVFirst) <= myTolV) + if (std::abs(V - myVFirst) <= myTolV) { VSide = 1; v = myVFirst; } - else if (Abs(V - myVLast) <= myTolV) + else if (std::abs(V - myVLast) <= myTolV) { VSide = -1; v = myVLast; @@ -829,22 +829,22 @@ void GeomAdaptor_Surface::D2(const Standard_Real U, { Standard_Integer Ideb, Ifin, IVdeb, IVfin, USide = 0, VSide = 0; Standard_Real u = U, v = V; - if (Abs(U - myUFirst) <= myTolU) + if (std::abs(U - myUFirst) <= myTolU) { USide = 1; u = myUFirst; } - else if (Abs(U - myULast) <= myTolU) + else if (std::abs(U - myULast) <= myTolU) { USide = -1; u = myULast; } - if (Abs(V - myVFirst) <= myTolV) + if (std::abs(V - myVFirst) <= myTolV) { VSide = 1; v = myVFirst; } - else if (Abs(V - myVLast) <= myTolV) + else if (std::abs(V - myVLast) <= myTolV) { VSide = -1; v = myVLast; @@ -898,22 +898,22 @@ void GeomAdaptor_Surface::D3(const Standard_Real U, { Standard_Integer Ideb, Ifin, IVdeb, IVfin, USide = 0, VSide = 0; Standard_Real u = U, v = V; - if (Abs(U - myUFirst) <= myTolU) + if (std::abs(U - myUFirst) <= myTolU) { USide = 1; u = myUFirst; } - else if (Abs(U - myULast) <= myTolU) + else if (std::abs(U - myULast) <= myTolU) { USide = -1; u = myULast; } - if (Abs(V - myVFirst) <= myTolV) + if (std::abs(V - myVFirst) <= myTolV) { VSide = 1; v = myVFirst; } - else if (Abs(V - myVLast) <= myTolV) + else if (std::abs(V - myVLast) <= myTolV) { VSide = -1; v = myVLast; @@ -973,22 +973,22 @@ gp_Vec GeomAdaptor_Surface::DN(const Standard_Real U, { Standard_Integer Ideb, Ifin, IVdeb, IVfin, USide = 0, VSide = 0; Standard_Real u = U, v = V; - if (Abs(U - myUFirst) <= myTolU) + if (std::abs(U - myUFirst) <= myTolU) { USide = 1; u = myUFirst; } - else if (Abs(U - myULast) <= myTolU) + else if (std::abs(U - myULast) <= myTolU) { USide = -1; u = myULast; } - if (Abs(V - myVFirst) <= myTolV) + if (std::abs(V - myVFirst) <= myTolV) { VSide = 1; v = myVFirst; } - else if (Abs(V - myVLast) <= myTolV) + else if (std::abs(V - myVLast) <= myTolV) { VSide = -1; v = myVLast; @@ -1102,7 +1102,7 @@ Standard_Real GeomAdaptor_Surface::UResolution(const Standard_Real R3d) const } if (Res <= 1.) - return 2. * ASin(Res); + return 2. * std::asin(Res); return 2. * M_PI; } @@ -1162,7 +1162,7 @@ Standard_Real GeomAdaptor_Surface::VResolution(const Standard_Real R3d) const } if (Res <= 1.) - return 2. * ASin(Res); + return 2. * std::asin(Res); return 2. * M_PI; } diff --git a/src/ModelingData/TKG3d/GeomAdaptor/GeomAdaptor_SurfaceOfRevolution.cxx b/src/ModelingData/TKG3d/GeomAdaptor/GeomAdaptor_SurfaceOfRevolution.cxx index ba28084674..f8524375ea 100644 --- a/src/ModelingData/TKG3d/GeomAdaptor/GeomAdaptor_SurfaceOfRevolution.cxx +++ b/src/ModelingData/TKG3d/GeomAdaptor/GeomAdaptor_SurfaceOfRevolution.cxx @@ -268,7 +268,7 @@ Handle(Adaptor3d_Surface) GeomAdaptor_SurfaceOfRevolution::UTrim(const Standard_ (void)First; (void)Last; (void)Tol; - Standard_OutOfRange_Raise_if(Abs(First) > Eps || Abs(Last - 2. * M_PI) > Eps, + Standard_OutOfRange_Raise_if(std::abs(First) > Eps || std::abs(Last - 2. * M_PI) > Eps, "GeomAdaptor_SurfaceOfRevolution : UTrim : Parameters out of range"); Handle(GeomAdaptor_SurfaceOfRevolution) HR = @@ -381,7 +381,7 @@ GeomAbs_SurfaceType GeomAdaptor_SurfaceOfRevolution::GetType() const // on calcule la distance projetee sur l axe. gp_Vec vlin(pf, pl); gp_Vec vaxe(myAxis.Direction()); - Standard_Real projlen = Abs(vaxe.Dot(vlin)); + Standard_Real projlen = std::abs(vaxe.Dot(vlin)); if ((len - projlen) <= TolConf) { gp_Pnt P = Value(0., 0.); @@ -397,8 +397,8 @@ GeomAbs_SurfaceType GeomAdaptor_SurfaceOfRevolution::GetType() const gp_Vec V(myAxis.Location(), myBasisCurve->Line().Location()); gp_Vec W(Axe.Direction()); gp_Vec AxisDir(myAxis.Direction()); - Standard_Real proj = Abs(W.Dot(AxisDir)); - if (Abs(V.DotCross(AxisDir, W)) <= TolConf + Standard_Real proj = std::abs(W.Dot(AxisDir)); + if (std::abs(V.DotCross(AxisDir, W)) <= TolConf && (proj >= TolConeSemiAng && proj <= 1. - TolConeSemiAng)) { return GeomAbs_Cone; diff --git a/src/ModelingData/TKG3d/GeomEvaluator/GeomEvaluator_OffsetCurve.cxx b/src/ModelingData/TKG3d/GeomEvaluator/GeomEvaluator_OffsetCurve.cxx index 686cd46b0f..2e04c94af2 100644 --- a/src/ModelingData/TKG3d/GeomEvaluator/GeomEvaluator_OffsetCurve.cxx +++ b/src/ModelingData/TKG3d/GeomEvaluator/GeomEvaluator_OffsetCurve.cxx @@ -220,7 +220,7 @@ void GeomEvaluator_OffsetCurve::CalculateD1(gp_Pnt& theValue, gp_XYZ Ndir = (theD1.XYZ()).Crossed(myOffsetDir.XYZ()); gp_XYZ DNdir = (theD2.XYZ()).Crossed(myOffsetDir.XYZ()); Standard_Real R2 = Ndir.SquareModulus(); - Standard_Real R = Sqrt(R2); + Standard_Real R = std::sqrt(R2); Standard_Real R3 = R * R2; Standard_Real Dr = Ndir.Dot(DNdir); if (R3 <= gp::Resolution()) @@ -264,7 +264,7 @@ void GeomEvaluator_OffsetCurve::CalculateD2(gp_Pnt& theValue, gp_XYZ DNdir = (theD2.XYZ()).Crossed(myOffsetDir.XYZ()); gp_XYZ D2Ndir = (theD3.XYZ()).Crossed(myOffsetDir.XYZ()); Standard_Real R2 = Ndir.SquareModulus(); - Standard_Real R = Sqrt(R2); + Standard_Real R = std::sqrt(R2); Standard_Real R3 = R2 * R; Standard_Real R4 = R2 * R2; Standard_Real R5 = R3 * R2; @@ -337,7 +337,7 @@ void GeomEvaluator_OffsetCurve::CalculateD3(gp_Pnt& theValue, gp_XYZ D2Ndir = (theD3.XYZ()).Crossed(myOffsetDir.XYZ()); gp_XYZ D3Ndir = (theD4.XYZ()).Crossed(myOffsetDir.XYZ()); Standard_Real R2 = Ndir.SquareModulus(); - Standard_Real R = Sqrt(R2); + Standard_Real R = std::sqrt(R2); Standard_Real R3 = R2 * R; Standard_Real R4 = R2 * R2; Standard_Real R5 = R3 * R2; @@ -431,7 +431,7 @@ Standard_Boolean GeomEvaluator_OffsetCurve::AdjustDerivative( else du = anUsupremum - anUinfium; - const Standard_Real aDelta = Max(du * DivisionFactor, aMinStep); + const Standard_Real aDelta = std::max(du * DivisionFactor, aMinStep); // Derivative is approximated by Taylor-series Standard_Integer anIndex = 1; // Derivative order @@ -450,8 +450,8 @@ Standard_Boolean GeomEvaluator_OffsetCurve::AdjustDerivative( u = theU - aDelta; gp_Pnt P1, P2; - BaseD0(Min(theU, u), P1); - BaseD0(Max(theU, u), P2); + BaseD0(std::min(theU, u), P1); + BaseD0(std::max(theU, u), P2); gp_Vec V1(P1, P2); isDirectionChange = V.Dot(V1) < 0.0; diff --git a/src/ModelingData/TKG3d/GeomEvaluator/GeomEvaluator_OffsetSurface.cxx b/src/ModelingData/TKG3d/GeomEvaluator/GeomEvaluator_OffsetSurface.cxx index 0e5e7f56b1..954891a84f 100644 --- a/src/ModelingData/TKG3d/GeomEvaluator/GeomEvaluator_OffsetSurface.cxx +++ b/src/ModelingData/TKG3d/GeomEvaluator/GeomEvaluator_OffsetSurface.cxx @@ -79,14 +79,14 @@ static Standard_Boolean shiftPoint(const Standard_Real theUStart, (isUPeriodic || (isUSingular && !isVSingular) ? 0. : 0.5 * (aUMin + aUMax) - theUStart); Standard_Real aDirV = (isVPeriodic || (isVSingular && !isUSingular) ? 0. : 0.5 * (aVMin + aVMax) - theVStart); - Standard_Real aDist = Sqrt(aDirU * aDirU + aDirV * aDirV); + Standard_Real aDist = std::sqrt(aDirU * aDirU + aDirV * aDirV); // shift current point from its current position towards center, by value of twice // current distance from it to start (but not less than Precision::PConfusion()); // fail if center is overpassed. Standard_Real aDU = theU - theUStart; Standard_Real aDV = theV - theVStart; - Standard_Real aStep = Max(2. * Sqrt(aDU * aDU + aDV * aDV), Precision::PConfusion()); + Standard_Real aStep = std::max(2. * std::sqrt(aDU * aDU + aDV * aDV), Precision::PConfusion()); if (aStep >= aDist) { return Standard_False; @@ -566,9 +566,9 @@ void GeomEvaluator_OffsetSurface::CalculateD0(const Standard_Real theU, Standard_Real aD1UNorm2 = aD1U.SquareMagnitude(); Standard_Real aD1VNorm2 = aD1V.SquareMagnitude(); if (aD1UNorm2 > 1.0) - aD1U /= Sqrt(aD1UNorm2); + aD1U /= std::sqrt(aD1UNorm2); if (aD1VNorm2 > 1.0) - aD1V /= Sqrt(aD1VNorm2); + aD1V /= std::sqrt(aD1VNorm2); gp_Vec aNorm = aD1U.Crossed(aD1V); if (aNorm.SquareMagnitude() > the_D1MagTol * the_D1MagTol) @@ -660,9 +660,9 @@ void GeomEvaluator_OffsetSurface::CalculateD1(const Standard_Real theU, Standard_Real aD1UNorm2 = aD1U.SquareMagnitude(); Standard_Real aD1VNorm2 = aD1V.SquareMagnitude(); if (aD1UNorm2 > 1.0) - aD1U /= Sqrt(aD1UNorm2); + aD1U /= std::sqrt(aD1UNorm2); if (aD1VNorm2 > 1.0) - aD1V /= Sqrt(aD1VNorm2); + aD1V /= std::sqrt(aD1VNorm2); Standard_Boolean isSingular = Standard_False; Standard_Integer MaxOrder = 0; diff --git a/src/ModelingData/TKG3d/GeomLProp/GeomLProp.cxx b/src/ModelingData/TKG3d/GeomLProp/GeomLProp.cxx index f6e5a62e2b..e527ee18f9 100644 --- a/src/ModelingData/TKG3d/GeomLProp/GeomLProp.cxx +++ b/src/ModelingData/TKG3d/GeomLProp/GeomLProp.cxx @@ -138,7 +138,7 @@ GeomAbs_Shape GeomLProp::Continuity(const Handle(Geom_Curve)& C1, { throw Standard_Failure("Courbes non jointives"); } - Standard_Integer min = Min(n1, n2); + Standard_Integer min = std::min(n1, n2); if (min >= 1) { d1 = clp1.D1(); diff --git a/src/ModelingData/TKG3d/LProp3d/LProp3d_SurfaceTool.cxx b/src/ModelingData/TKG3d/LProp3d/LProp3d_SurfaceTool.cxx index db2fc24421..97f55f88c1 100644 --- a/src/ModelingData/TKG3d/LProp3d/LProp3d_SurfaceTool.cxx +++ b/src/ModelingData/TKG3d/LProp3d/LProp3d_SurfaceTool.cxx @@ -70,7 +70,7 @@ gp_Vec LProp3d_SurfaceTool::DN(const Handle(Adaptor3d_Surface)& S, Standard_Integer LProp3d_SurfaceTool::Continuity(const Handle(Adaptor3d_Surface)& S) { - GeomAbs_Shape s = (GeomAbs_Shape)Min(S->UContinuity(), S->VContinuity()); + GeomAbs_Shape s = (GeomAbs_Shape)std::min(S->UContinuity(), S->VContinuity()); switch (s) { case GeomAbs_C0: diff --git a/src/ModelingData/TKGeomBase/AdvApp2Var/AdvApp2Var_ApproxAFunc2Var.cxx b/src/ModelingData/TKGeomBase/AdvApp2Var/AdvApp2Var_ApproxAFunc2Var.cxx index 52f97cfeef..56540bedc1 100644 --- a/src/ModelingData/TKGeomBase/AdvApp2Var/AdvApp2Var_ApproxAFunc2Var.cxx +++ b/src/ModelingData/TKGeomBase/AdvApp2Var/AdvApp2Var_ApproxAFunc2Var.cxx @@ -205,13 +205,13 @@ void AdvApp2Var_ApproxAFunc2Var::Init() default: throw Standard_ConstructionError("AdvApp2Var_ApproxAFunc2Var : VContinuity Error"); } - ndu = Max(myMaxDegInU + 1, 2 * iu + 2); - ndv = Max(myMaxDegInV + 1, 2 * iv + 2); + ndu = std::max(myMaxDegInU + 1, 2 * iu + 2); + ndv = std::max(myMaxDegInV + 1, 2 * iv + 2); if (ndu < 2 * iu + 2) throw Standard_ConstructionError("AdvApp2Var_ApproxAFunc2Var : UMaxDegree Error"); if (ndv < 2 * iv + 2) throw Standard_ConstructionError("AdvApp2Var_ApproxAFunc2Var : VMaxDegree Error"); - myPrecisionCode = Max(0, Min(myPrecisionCode, 3)); + myPrecisionCode = std::max(0, std::min(myPrecisionCode, 3)); AdvApp2Var_Context Conditions(ifav, iu, iv, @@ -825,16 +825,16 @@ void AdvApp2Var_ApproxAFunc2Var::Compute3DErrors() F4Tol = my3DTolOnFront->Value(iesp, 4); for (ipat = 1; ipat <= myResult.NbPatch(); ipat++) { - error_max = Max((myResult(ipat).MaxErrors())->Value(iesp), error_max); - error_U0 = Max((myResult(ipat).IsoErrors())->Value(iesp, 3), error_U0); - error_U1 = Max((myResult(ipat).IsoErrors())->Value(iesp, 4), error_U1); - error_V0 = Max((myResult(ipat).IsoErrors())->Value(iesp, 1), error_V0); - error_V1 = Max((myResult(ipat).IsoErrors())->Value(iesp, 2), error_V1); + error_max = std::max((myResult(ipat).MaxErrors())->Value(iesp), error_max); + error_U0 = std::max((myResult(ipat).IsoErrors())->Value(iesp, 3), error_U0); + error_U1 = std::max((myResult(ipat).IsoErrors())->Value(iesp, 4), error_U1); + error_V0 = std::max((myResult(ipat).IsoErrors())->Value(iesp, 1), error_V0); + error_V1 = std::max((myResult(ipat).IsoErrors())->Value(iesp, 2), error_V1); error_moy += (myResult(ipat).AverageErrors())->Value(iesp); } my3DMaxError->SetValue(iesp, error_max); - my3DUFrontError->SetValue(iesp, Max(error_U0, error_U1)); - my3DVFrontError->SetValue(iesp, Max(error_V0, error_V1)); + my3DUFrontError->SetValue(iesp, std::max(error_U0, error_U1)); + my3DVFrontError->SetValue(iesp, std::max(error_V0, error_V1)); error_moy /= (Standard_Real)myResult.NbPatch(); my3DAverageError->SetValue(iesp, error_moy); if (error_max > Tol || error_U0 > F3Tol || error_U1 > F4Tol || error_V0 > F1Tol @@ -863,7 +863,7 @@ void AdvApp2Var_ApproxAFunc2Var::ComputeCritError() crit_max = 0.; for (ipat = 1; ipat <= myResult.NbPatch(); ipat++) { - crit_max = Max((myResult(ipat).CritValue()), crit_max); + crit_max = std::max((myResult(ipat).CritValue()), crit_max); } myCriterionError = crit_max; } diff --git a/src/ModelingData/TKGeomBase/AdvApp2Var/AdvApp2Var_Network.cxx b/src/ModelingData/TKGeomBase/AdvApp2Var/AdvApp2Var_Network.cxx index 1b9099d14d..a5b08cfed8 100644 --- a/src/ModelingData/TKGeomBase/AdvApp2Var/AdvApp2Var_Network.cxx +++ b/src/ModelingData/TKGeomBase/AdvApp2Var/AdvApp2Var_Network.cxx @@ -152,8 +152,8 @@ void AdvApp2Var_Network::SameDegree(const Standard_Integer iu, for (AdvApp2Var_SequenceOfPatch::Iterator aPatIter(myNet); aPatIter.More(); aPatIter.Next()) { const Handle(AdvApp2Var_Patch)& aPat = aPatIter.Value(); - ncfu = Max(ncfu, aPat->NbCoeffInU()); - ncfv = Max(ncfv, aPat->NbCoeffInV()); + ncfu = std::max(ncfu, aPat->NbCoeffInU()); + ncfv = std::max(ncfv, aPat->NbCoeffInV()); } // augmentation des nombres de coeff. diff --git a/src/ModelingData/TKGeomBase/AdvApp2Var/AdvApp2Var_Node.cxx b/src/ModelingData/TKGeomBase/AdvApp2Var/AdvApp2Var_Node.cxx index fe86845329..546cff7be0 100644 --- a/src/ModelingData/TKGeomBase/AdvApp2Var/AdvApp2Var_Node.cxx +++ b/src/ModelingData/TKGeomBase/AdvApp2Var/AdvApp2Var_Node.cxx @@ -34,8 +34,8 @@ AdvApp2Var_Node::AdvApp2Var_Node() //================================================================================================= AdvApp2Var_Node::AdvApp2Var_Node(const Standard_Integer iu, const Standard_Integer iv) - : myTruePoints(0, Max(0, iu), 0, Max(0, iv)), - myErrors(0, Max(0, iu), 0, Max(0, iv)), + : myTruePoints(0, std::max(0, iu), 0, std::max(0, iv)), + myErrors(0, std::max(0, iu), 0, std::max(0, iv)), myOrdInU(iu), myOrdInV(iv) { diff --git a/src/ModelingData/TKGeomBase/AdvApp2Var/AdvApp2Var_Patch.cxx b/src/ModelingData/TKGeomBase/AdvApp2Var/AdvApp2Var_Patch.cxx index c246338942..922fead4e5 100644 --- a/src/ModelingData/TKGeomBase/AdvApp2Var/AdvApp2Var_Patch.cxx +++ b/src/ModelingData/TKGeomBase/AdvApp2Var/AdvApp2Var_Patch.cxx @@ -313,7 +313,7 @@ void AdvApp2Var_Patch::Discretise(const AdvApp2Var_Context& Conditions VDBFN[0] = myV0; VDBFN[1] = myV1; - SIZE = Max(NBPNTU, NBPNTV); + SIZE = std::max(NBPNTU, NBPNTV); Handle(TColStd_HArray1OfReal) HTABLE = new TColStd_HArray1OfReal(1, SIZE); Standard_Real* TAB = (Standard_Real*)&HTABLE->ChangeArray1()(HTABLE->Lower()); @@ -548,7 +548,7 @@ void AdvApp2Var_Patch::AddConstraints(const AdvApp2Var_Context& Conditions, } // tables required for FORTRAN - Standard_Integer IORDMX = Max(IORDRU, IORDRV); + Standard_Integer IORDMX = std::max(IORDRU, IORDRV); Handle(TColStd_HArray1OfReal) HEXTR = new TColStd_HArray1OfReal(1, 2 * IORDMX + 2); Standard_Real* EXTR = (Standard_Real*)&HEXTR->ChangeArray1()(HEXTR->Lower()); Handle(TColStd_HArray1OfReal) HFACT = new TColStd_HArray1OfReal(1, IORDMX + 1); @@ -651,17 +651,17 @@ void AdvApp2Var_Patch::AddErrors(const AdvApp2Var_Framework& Constraints) for (iv = 1; iv <= myOrdInV + 1; iv++) { error = ((Constraints.IsoV(myU0, myU1, myV0)).MaxErrors())->Value(iesp, iv); - errU = Max(errU, error); + errU = std::max(errU, error); error = ((Constraints.IsoV(myU0, myU1, myV1)).MaxErrors())->Value(iesp, iv); - errU = Max(errU, error); + errU = std::max(errU, error); } errV = 0.; for (iu = 1; iu <= myOrdInU + 1; iu++) { error = ((Constraints.IsoU(myU0, myV0, myV1)).MaxErrors())->Value(iesp, iu); - errV = Max(errV, error); + errV = std::max(errV, error); error = ((Constraints.IsoU(myU1, myV0, myV1)).MaxErrors())->Value(iesp, iu); - errV = Max(errV, error); + errV = std::max(errV, error); } myMaxErrors->ChangeValue(iesp) += errU * hmax[myOrdInV + 1] + errV * hmax[myOrdInU + 1]; @@ -670,23 +670,23 @@ void AdvApp2Var_Patch::AddErrors(const AdvApp2Var_Framework& Constraints) for (iv = 1; iv <= myOrdInV + 1; iv++) { error = ((Constraints.IsoV(myU0, myU1, myV0)).MoyErrors())->Value(iesp, iv); - errU = Max(errU, error); + errU = std::max(errU, error); error = ((Constraints.IsoV(myU0, myU1, myV1)).MoyErrors())->Value(iesp, iv); - errU = Max(errU, error); + errU = std::max(errU, error); } errV = 0.; for (iu = 1; iu <= myOrdInU + 1; iu++) { error = ((Constraints.IsoU(myU0, myV0, myV1)).MoyErrors())->Value(iesp, iu); - errV = Max(errV, error); + errV = std::max(errV, error); error = ((Constraints.IsoU(myU1, myV0, myV1)).MoyErrors())->Value(iesp, iu); - errV = Max(errV, error); + errV = std::max(errV, error); } error = myMoyErrors->Value(iesp); error *= error; error += errU * hmax[myOrdInV + 1] * errU * hmax[myOrdInV + 1] + errV * hmax[myOrdInU + 1] * errV * hmax[myOrdInU + 1]; - myMoyErrors->SetValue(iesp, Sqrt(error)); + myMoyErrors->SetValue(iesp, std::sqrt(error)); // max errors at iso-borders Handle(TColStd_HArray2OfReal) HERISO = new TColStd_HArray2OfReal(1, NBSESP, 1, 4); @@ -702,21 +702,21 @@ void AdvApp2Var_Patch::AddErrors(const AdvApp2Var_Framework& Constraints) for (iv = 0; iv <= myOrdInV; iv++) { error = (Constraints.Node(myU0, myV0))->Error(iu, iv); - emax1 = Max(emax1, error); + emax1 = std::max(emax1, error); error = (Constraints.Node(myU1, myV0))->Error(iu, iv); - emax2 = Max(emax2, error); + emax2 = std::max(emax2, error); error = (Constraints.Node(myU0, myV1))->Error(iu, iv); - emax3 = Max(emax3, error); + emax3 = std::max(emax3, error); error = (Constraints.Node(myU1, myV1))->Error(iu, iv); - emax4 = Max(emax4, error); + emax4 = std::max(emax4, error); } } // calculate max errors on borders - err1 = Max(emax1, emax2); - err2 = Max(emax3, emax4); - err3 = Max(emax1, emax3); - err4 = Max(emax2, emax4); + err1 = std::max(emax1, emax2); + err2 = std::max(emax3, emax4); + err3 = std::max(emax1, emax3); + err4 = std::max(emax2, emax4); // calculate final errors on internal isos if ((Constraints.IsoV(myU0, myU1, myV0)).Position() == 0) @@ -772,17 +772,17 @@ void AdvApp2Var_Patch::MakeApprox(const AdvApp2Var_Context& Conditions, Standard_Integer IORDRU = myOrdInU, IORDRV = myOrdInV, NDMINU = 1, NDMINV = 1, NCOEFU, NCOEFV; // NDMINU and NDMINV depend on the nb of coeff of neighboring isos // and of the required order of continuity - NDMINU = Max(1, 2 * IORDRU + 1); + NDMINU = std::max(1, 2 * IORDRU + 1); NCOEFU = (Constraints.IsoV(myU0, myU1, myV0)).NbCoeff() - 1; - NDMINU = Max(NDMINU, NCOEFU); + NDMINU = std::max(NDMINU, NCOEFU); NCOEFU = (Constraints.IsoV(myU0, myU1, myV1)).NbCoeff() - 1; - NDMINU = Max(NDMINU, NCOEFU); + NDMINU = std::max(NDMINU, NCOEFU); - NDMINV = Max(1, 2 * IORDRV + 1); + NDMINV = std::max(1, 2 * IORDRV + 1); NCOEFV = (Constraints.IsoU(myU0, myV0, myV1)).NbCoeff() - 1; - NDMINV = Max(NDMINV, NCOEFV); + NDMINV = std::max(NDMINV, NCOEFV); NCOEFV = (Constraints.IsoU(myU1, myV0, myV1)).NbCoeff() - 1; - NDMINV = Max(NDMINV, NCOEFV); + NDMINV = std::max(NDMINV, NCOEFV); // tables of approximations Handle(TColStd_HArray1OfReal) HEPSAPR = new TColStd_HArray1OfReal(1, NBSESP); diff --git a/src/ModelingData/TKGeomBase/AppCont/AppCont_LeastSquare.cxx b/src/ModelingData/TKGeomBase/AppCont/AppCont_LeastSquare.cxx index 17cba64c4f..1ad78c0d8c 100644 --- a/src/ModelingData/TKGeomBase/AppCont/AppCont_LeastSquare.cxx +++ b/src/ModelingData/TKGeomBase/AppCont/AppCont_LeastSquare.cxx @@ -35,8 +35,8 @@ void AppCont_LeastSquare::FixSingleBorderPoint(const AppCont_Function& the NCollection_Array1& theFix) { Standard_Integer aMaxIter = 15; - NCollection_Array1 aTabP(1, Max(myNbP, 1)), aPrevP(1, Max(myNbP, 1)); - NCollection_Array1 aTabP2d(1, Max(myNbP2d, 1)), aPrevP2d(1, Max(myNbP2d, 1)); + NCollection_Array1 aTabP(1, std::max(myNbP, 1)), aPrevP(1, std::max(myNbP, 1)); + NCollection_Array1 aTabP2d(1, std::max(myNbP2d, 1)), aPrevP2d(1, std::max(myNbP2d, 1)); Standard_Real aMult = ((theU - theU0) > (theU1 - theU)) ? 1.0 : -1.0; Standard_Real aStartParam = theU, aCurrParam, aPrevDist = 1.0, aCurrDist = 1.0; @@ -113,10 +113,10 @@ AppCont_LeastSquare::AppCont_LeastSquare(const AppCont_Function& SSP, Standard_Integer i2plus1, i2plus2; myNbdiscret = myNbPoints; - NCollection_Array1 aTabP(1, Max(myNbP, 1)); - NCollection_Array1 aTabP2d(1, Max(myNbP2d, 1)); - NCollection_Array1 aTabV(1, Max(myNbP, 1)); - NCollection_Array1 aTabV2d(1, Max(myNbP2d, 1)); + NCollection_Array1 aTabP(1, std::max(myNbP, 1)); + NCollection_Array1 aTabP2d(1, std::max(myNbP2d, 1)); + NCollection_Array1 aTabV(1, std::max(myNbP, 1)); + NCollection_Array1 aTabV2d(1, std::max(myNbP2d, 1)); for (Standard_Integer aDimIdx = 1; aDimIdx <= myNbP * 3 + myNbP2d * 2; aDimIdx++) { @@ -185,8 +185,10 @@ AppCont_LeastSquare::AppCont_LeastSquare(const AppCont_Function& SSP, for (Standard_Integer aDimIdx = 1; aDimIdx <= aMaxDim; aDimIdx++) { if (myPerInfo(aDimIdx).isPeriodic - && Abs(myPoints(1, aDimIdx) - myPoints(2, aDimIdx)) > myPerInfo(aDimIdx).myPeriod / 2.01 - && Abs(myPoints(2, aDimIdx) - myPoints(3, aDimIdx)) < myPerInfo(aDimIdx).myPeriod / 2.01) + && std::abs(myPoints(1, aDimIdx) - myPoints(2, aDimIdx)) + > myPerInfo(aDimIdx).myPeriod / 2.01 + && std::abs(myPoints(2, aDimIdx) - myPoints(3, aDimIdx)) + < myPerInfo(aDimIdx).myPeriod / 2.01) { Standard_Real aPeriodMult = (myPoints(1, aDimIdx) < myPoints(2, aDimIdx)) ? 1.0 : -1.0; Standard_Real aNewParam = myPoints(1, aDimIdx) + aPeriodMult * myPerInfo(aDimIdx).myPeriod; @@ -198,7 +200,7 @@ AppCont_LeastSquare::AppCont_LeastSquare(const AppCont_Function& SSP, for (Standard_Integer aDimIdx = 1; aDimIdx <= aMaxDim; aDimIdx++) { if (myPerInfo(aDimIdx).isPeriodic - && Abs(myPoints(aPntIdx, aDimIdx) - myPoints(aPntIdx + 1, aDimIdx)) + && std::abs(myPoints(aPntIdx, aDimIdx) - myPoints(aPntIdx + 1, aDimIdx)) > myPerInfo(aDimIdx).myPeriod / 2.01) { Standard_Real aPeriodMult = @@ -256,8 +258,8 @@ AppCont_LeastSquare::AppCont_LeastSquare(const AppCont_Function& SSP, { math_Matrix M(1, classe, 1, classe); MMatrix(classe, M); - NCollection_Array1 aFixP2d(1, Max(myNbP2d, 1)); - NCollection_Array1 aFixP(1, Max(myNbP, 1)); + NCollection_Array1 aFixP2d(1, std::max(myNbP2d, 1)); + NCollection_Array1 aFixP(1, std::max(myNbP, 1)); if (myFirstC == AppParCurves_PassPoint || myFirstC == AppParCurves_TangencyPoint) { @@ -285,7 +287,8 @@ AppCont_LeastSquare::AppCont_LeastSquare(const AppCont_Function& SSP, for (Standard_Integer aDimIdx = 1; aDimIdx <= aMaxDim; aDimIdx++) { if (myPerInfo(aDimIdx).isPeriodic - && Abs(myPoles(1, aDimIdx) - myPoints(1, aDimIdx)) > myPerInfo(aDimIdx).myPeriod / 2.01) + && std::abs(myPoles(1, aDimIdx) - myPoints(1, aDimIdx)) + > myPerInfo(aDimIdx).myPeriod / 2.01) { Standard_Real aMult = myPoles(1, aDimIdx) < myPoints(1, aDimIdx) ? 1.0 : -1.0; myPoles(1, aDimIdx) += aMult * myPerInfo(aDimIdx).myPeriod; @@ -319,7 +322,7 @@ AppCont_LeastSquare::AppCont_LeastSquare(const AppCont_Function& SSP, for (Standard_Integer aDimIdx = 1; aDimIdx <= 2; aDimIdx++) { if (myPerInfo(aDimIdx).isPeriodic - && Abs(myPoles(classe, aDimIdx) - myPoints(myNbPoints, aDimIdx)) + && std::abs(myPoles(classe, aDimIdx) - myPoints(myNbPoints, aDimIdx)) > myPerInfo(aDimIdx).myPeriod / 2.01) { Standard_Real aMult = @@ -563,7 +566,7 @@ void AppCont_LeastSquare::Error(Standard_Real& F, e2 = MyPoints(i, i2 + 1); e3 = MyPoints(i, i2 + 2); err3d = e1 * e1 + e2 * e2 + e3 * e3; - MaxE3d = Max(MaxE3d, err3d); + MaxE3d = std::max(MaxE3d, err3d); F += err3d; i2 += 3; } @@ -572,14 +575,14 @@ void AppCont_LeastSquare::Error(Standard_Real& F, e1 = MyPoints(i, i2); e2 = MyPoints(i, i2 + 1); err2d = e1 * e1 + e2 * e2; - MaxE2d = Max(MaxE2d, err2d); + MaxE2d = std::max(MaxE2d, err2d); F += err2d; i2 += 2; } } - MaxE3d = Sqrt(MaxE3d); - MaxE2d = Sqrt(MaxE2d); + MaxE3d = std::sqrt(MaxE3d); + MaxE2d = std::sqrt(MaxE2d); } //================================================================================================= diff --git a/src/ModelingData/TKGeomBase/AppDef/AppDef_LinearCriteria.cxx b/src/ModelingData/TKGeomBase/AppDef/AppDef_LinearCriteria.cxx index b0a0e4171a..5bfe9a7781 100644 --- a/src/ModelingData/TKGeomBase/AppDef/AppDef_LinearCriteria.cxx +++ b/src/ModelingData/TKGeomBase/AppDef/AppDef_LinearCriteria.cxx @@ -355,7 +355,7 @@ Standard_Integer AppDef_LinearCriteria::QualityValues(const Standard_Real J1min, ICDANA = 1; if (ValCri[i] < 0.1 * myEstimation[i]) ICDANA = 2; - myEstimation[i] = Max(1.05 * ValCri[i], JEsMin[i]); + myEstimation[i] = std::max(1.05 * ValCri[i], JEsMin[i]); } } @@ -439,8 +439,8 @@ void AppDef_LinearCriteria::ErrorValues(Standard_Real& MaxError, if (NbDim != (2 * myNbP2d + 3 * myNbP3d)) throw Standard_DomainError("AppDef_LinearCriteria::ErrorValues"); - TColgp_Array1OfPnt TabP3d(1, Max(1, myNbP3d)); - TColgp_Array1OfPnt2d TabP2d(1, Max(1, myNbP2d)); + TColgp_Array1OfPnt TabP3d(1, std::max(1, myNbP3d)); + TColgp_Array1OfPnt2d TabP2d(1, std::max(1, myNbP2d)); TColStd_Array1OfReal BasePoint(1, NbDim); gp_Pnt2d P2d; gp_Pnt P3d; @@ -461,8 +461,8 @@ void AppDef_LinearCriteria::ErrorValues(Standard_Real& MaxError, { P3d.SetCoord(BasePoint(c0 + 1), BasePoint(c0 + 2), BasePoint(c0 + 3)); SqrDist = P3d.SquareDistance(TabP3d(ipnt)); - Dist = Sqrt(SqrDist); - MaxError = Max(MaxError, Dist); + Dist = std::sqrt(SqrDist); + MaxError = std::max(MaxError, Dist); QuadraticError += SqrDist; AverageError += Dist; c0 += 3; @@ -476,8 +476,8 @@ void AppDef_LinearCriteria::ErrorValues(Standard_Real& MaxError, { P2d.SetCoord(BasePoint(c0 + 1), BasePoint(c0 + 2)); SqrDist = P2d.SquareDistance(TabP2d(ipnt)); - Dist = Sqrt(SqrDist); - MaxError = Max(MaxError, Dist); + Dist = std::sqrt(SqrDist); + MaxError = std::max(MaxError, Dist); QuadraticError += SqrDist; AverageError += Dist; c0 += 2; @@ -548,13 +548,13 @@ void AppDef_LinearCriteria::Hessian(const Standard_Integer Element, for (i = 0; i <= degH; i++) { k1 = (i <= Order) ? i : i - Order - 1; - curcoeff = Pow(coeff, k1) * poid * BV[i]; + curcoeff = std::pow(coeff, k1) * poid * BV[i]; // Hermite*Hermite part of matrix for (j = i; j <= degH; j++) { k2 = (j <= Order) ? j : j - Order - 1; - AuxH(i, j) += curcoeff * Pow(coeff, k2) * BV[j]; + AuxH(i, j) += curcoeff * std::pow(coeff, k2) * BV[j]; } // Hermite*Jacobi part of matrix for (j = degH + 1; j <= MxDeg; j++) @@ -603,8 +603,8 @@ void AppDef_LinearCriteria::Gradient(const Standard_Integer Element, if (Dimension > (2 * myNbP2d + 3 * myNbP3d)) throw Standard_DomainError("AppDef_LinearCriteria::ErrorValues"); - TColgp_Array1OfPnt TabP3d(1, Max(1, myNbP3d)); - TColgp_Array1OfPnt2d TabP2d(1, Max(1, myNbP2d)); + TColgp_Array1OfPnt TabP3d(1, std::max(1, myNbP3d)); + TColgp_Array1OfPnt2d TabP2d(1, std::max(1, myNbP2d)); Standard_Boolean In3d; Standard_Integer IndPnt, IndCrd; @@ -680,7 +680,7 @@ void AppDef_LinearCriteria::Gradient(const Standard_Integer Element, for (i = 0; i <= degH; i++) { k = (i <= Order) ? i : i - Order - 1; - curcoeff = Pow(coeff, k); + curcoeff = std::pow(coeff, k); G(i0 + i) *= curcoeff; } } diff --git a/src/ModelingData/TKGeomBase/AppDef/AppDef_Variational.cxx b/src/ModelingData/TKGeomBase/AppDef/AppDef_Variational.cxx index c37b154d0f..f09c008079 100644 --- a/src/ModelingData/TKGeomBase/AppDef/AppDef_Variational.cxx +++ b/src/ModelingData/TKGeomBase/AppDef/AppDef_Variational.cxx @@ -101,7 +101,7 @@ AppDef_Variational::AppDef_Variational( // Verifications: if (myMaxDegree < 1) throw Standard_DomainError(); - myMaxDegree = Min(30, myMaxDegree); + myMaxDegree = std::min(30, myMaxDegree); // if (myMaxSegment < 1) throw Standard_DomainError(); @@ -153,8 +153,8 @@ AppDef_Variational::AppDef_Variational( // Table of Points initialization // Standard_Integer ipoint, jp2d, jp3d, index; - TColgp_Array1OfPnt TabP3d(1, Max(1, myNbP3d)); - TColgp_Array1OfPnt2d TabP2d(1, Max(1, myNbP2d)); + TColgp_Array1OfPnt TabP3d(1, std::max(1, myNbP3d)); + TColgp_Array1OfPnt2d TabP2d(1, std::max(1, myNbP2d)); gp_Pnt2d P2d; gp_Pnt P3d; index = 1; @@ -227,10 +227,10 @@ void AppDef_Variational::Init() Standard_Integer ipoint, jp2d, jp3d, index, jndex; Standard_Integer CurMultyPoint; - TColgp_Array1OfVec TabV3d(1, Max(1, myNbP3d)); - TColgp_Array1OfVec2d TabV2d(1, Max(1, myNbP2d)); - TColgp_Array1OfVec TabV3dcurv(1, Max(1, myNbP3d)); - TColgp_Array1OfVec2d TabV2dcurv(1, Max(1, myNbP2d)); + TColgp_Array1OfVec TabV3d(1, std::max(1, myNbP3d)); + TColgp_Array1OfVec2d TabV2d(1, std::max(1, myNbP2d)); + TColgp_Array1OfVec TabV3dcurv(1, std::max(1, myNbP3d)); + TColgp_Array1OfVec2d TabV2dcurv(1, std::max(1, myNbP2d)); gp_Vec Vt3d, Vc3d; gp_Vec2d Vt2d, Vc2d; @@ -239,10 +239,12 @@ void AppDef_Variational::Init() if (myNbConstraints < 0) throw Standard_ConstructionError(); - myTypConstraints = new TColStd_HArray1OfInteger(1, Max(1, 2 * myNbConstraints)); - myTabConstraints = new TColStd_HArray1OfReal(1, Max(1, 2 * myDimension * myNbConstraints)); - myTtheta = new TColStd_HArray1OfReal(1, Max(1, (2 * myNbP2d + 6 * myNbP3d) * myNbConstraints)); - myTfthet = new TColStd_HArray1OfReal(1, Max(1, (2 * myNbP2d + 6 * myNbP3d) * myNbConstraints)); + myTypConstraints = new TColStd_HArray1OfInteger(1, std::max(1, 2 * myNbConstraints)); + myTabConstraints = new TColStd_HArray1OfReal(1, std::max(1, 2 * myDimension * myNbConstraints)); + myTtheta = + new TColStd_HArray1OfReal(1, std::max(1, (2 * myNbP2d + 6 * myNbP3d) * myNbConstraints)); + myTfthet = + new TColStd_HArray1OfReal(1, std::max(1, (2 * myNbP2d + 6 * myNbP3d) * myNbConstraints)); // // Table of types initialization @@ -352,7 +354,7 @@ void AppDef_Variational::Init() Vt2d = TabV2d.Value(jp2d); Vt2d.Normalize(); Vc2d = TabV2dcurv.Value(jp2d); - if (Abs(Abs(Vc2d.Angle(Vt2d)) - M_PI / 2.) > Precision::Angular()) + if (std::abs(std::abs(Vc2d.Angle(Vt2d)) - M_PI / 2.) > Precision::Angular()) throw Standard_ConstructionError(); myTabConstraints->SetValue(jndex++, Vt2d.X()); myTabConstraints->SetValue(jndex++, Vt2d.Y()); @@ -410,7 +412,7 @@ void AppDef_Variational::Init() Vt2d = TabV2d.Value(jp2d); Vt2d.Normalize(); Vc2d = TabV2dcurv.Value(jp2d); - if (Abs(Abs(Vc2d.Angle(Vt2d)) - M_PI / 2.) > Precision::Angular()) + if (std::abs(std::abs(Vc2d.Angle(Vt2d)) - M_PI / 2.) > Precision::Angular()) throw Standard_ConstructionError(); myTabConstraints->SetValue(jndex++, Vt2d.X()); myTabConstraints->SetValue(jndex++, Vt2d.Y()); @@ -478,8 +480,8 @@ void AppDef_Variational::Approximate() Standard_Integer jp2d, jp3d, ipole, NbElem = TheCurve->NbElements(); - TColgp_Array1OfPnt TabP3d(1, Max(1, myNbP3d)); - TColgp_Array1OfPnt2d TabP2d(1, Max(1, myNbP2d)); + TColgp_Array1OfPnt TabP3d(1, std::max(1, myNbP3d)); + TColgp_Array1OfPnt2d TabP2d(1, std::max(1, myNbP2d)); Standard_Real debfin[2] = {-1., 1}; gp_Pnt2d P2d; @@ -722,8 +724,8 @@ void AppDef_Variational::Distance(math_Matrix& mat) if (myIsDone == Standard_False) throw StdFail_NotDone(); Standard_Integer ipoint, jp2d, jp3d, index; - TColgp_Array1OfPnt TabP3d(1, Max(1, myNbP3d)); - TColgp_Array1OfPnt2d TabP2d(1, Max(1, myNbP2d)); + TColgp_Array1OfPnt TabP3d(1, std::max(1, myNbP3d)); + TColgp_Array1OfPnt2d TabP2d(1, std::max(1, myNbP2d)); Standard_Integer j0 = mat.LowerCol() - myFirstPoint; gp_Pnt2d P2d; @@ -1303,7 +1305,7 @@ void AppDef_Variational::TheMotor(Handle(AppDef_SmoothCriterion)& J, CNew->Knots() = CCurrent->Knots(); J->SetParameters(CurrentTi); - EpsDeg = Min(WQuality * .1, CBLONG * .001); + EpsDeg = std::min(WQuality * .1, CBLONG * .001); Optimization(J, *TheAssembly, lconst, EpsDeg, CNew, CurrentTi->Array1()); @@ -1318,7 +1320,7 @@ void AppDef_Variational::TheMotor(Handle(AppDef_SmoothCriterion)& J, J->ErrorValues(ERRMAX, ERRQUA, ERRMOY); - isnear = ((Sqrt(ERRQUA / NbrPnt) < 2 * WQuality) && (myNbIterations > 1)); + isnear = ((std::sqrt(ERRQUA / NbrPnt) < 2 * WQuality) && (myNbIterations > 1)); // (1.3) Optimisation des ti par proj orthogonale // et calcul de l'erreur aux points. @@ -1448,7 +1450,7 @@ void AppDef_Variational::TheMotor(Handle(AppDef_SmoothCriterion)& J, J->SetParameters(CurrentTi); - EpsDeg = Min(WQuality * .1, CBLONG * .001); + EpsDeg = std::min(WQuality * .1, CBLONG * .001); Optimization(J, *TheAssembly, lconst, EpsDeg, CNew, CurrentTi->Array1()); CCurrent = CNew; @@ -1589,9 +1591,9 @@ L8000: J->EstLength() = CBLONG; myParameters->ChangeArray1() = NewTi->Array1(); myCriterium[0] = ERRQUA; - myCriterium[1] = Sqrt(VALCRI[0]); - myCriterium[2] = Sqrt(VALCRI[1]); - myCriterium[3] = Sqrt(VALCRI[2]); + myCriterium[1] = std::sqrt(VALCRI[0]); + myCriterium[2] = std::sqrt(VALCRI[1]); + myCriterium[3] = std::sqrt(VALCRI[2]); myMaxError = ERRMAX; myMaxErrorIndex = NumPnt; if (NbrPnt > NbrConstraint) @@ -1739,7 +1741,7 @@ void AppDef_Variational::Project(const Handle(FEmTool_Curve)& C, Aux = ValOfC(i) - myTabPoints->Value(i0 + i); Dist += Aux * Aux; } - Dist = Sqrt(Dist); + Dist = std::sqrt(Dist); // ------- Newton's method for solving (C'(t),C(t) - P) = 0 @@ -1762,7 +1764,7 @@ void AppDef_Variational::Project(const Handle(FEmTool_Curve)& C, F2 += DF * DF + Aux * SecndDerOfC(i); // ((C'(t),C(t) - P))' } - if (Abs(F2) < Eps) + if (std::abs(F2) < Eps) EnCour = Standard_False; else { @@ -1783,7 +1785,7 @@ void AppDef_Variational::Project(const Handle(FEmTool_Curve)& C, Aux = ValOfC(i) - myTabPoints->Value(i0 + i); Dist += Aux * Aux; } - Dist = Sqrt(Dist); + Dist = std::sqrt(Dist); Ecart = Dist0 - Dist; @@ -1926,7 +1928,7 @@ void AppDef_Variational::ACR(Handle(FEmTool_Curve)& Curve, { // ii = RealToInt((TPara - VTest + Eps) / DeltaT); // VTest += (ii + 1) * DeltaT; - VTest += Ceiling((TPara - VTest + Eps) / DeltaT) * DeltaT; + VTest += std::ceil((TPara - VTest + Eps) / DeltaT) * DeltaT; if (VTest > 1. - Eps) VTest = 1.; } @@ -1984,7 +1986,7 @@ static Standard_Integer NearIndex(const Standard_Real T, Ibeg = Imidl; } - if (Abs(T - TabPar(Ifin)) < Eps) + if (std::abs(T - TabPar(Ifin)) < Eps) return Ifin; return Ibeg; @@ -2132,15 +2134,15 @@ void AppDef_Variational::InitSmoothCriterion() else if (myTolerance == 0.) WQuality = 1.; else - WQuality = Max(myTolerance, Eps2 * Length); + WQuality = std::max(myTolerance, Eps2 * Length); Standard_Integer NbConstr = myNbPassPoints + myNbTangPoints + myNbCurvPoints; - WQuadratic = Sqrt((Standard_Real)(myNbPoints - NbConstr)) * WQuality; + WQuadratic = std::sqrt((Standard_Real)(myNbPoints - NbConstr)) * WQuality; if (WQuadratic > Eps3) WQuadratic = 1. / WQuadratic; if (WQuadratic == 0.) - WQuadratic = Max(Sqrt(E1), 1.); + WQuadratic = std::max(std::sqrt(E1), 1.); mySmoothCriterion->SetWeight(WQuadratic, WQuality, myPercent[0], myPercent[1], myPercent[2]); @@ -2197,7 +2199,7 @@ void AppDef_Variational::InitParameters(Standard_Real& Length) aux = myTabPoints->Value(i1 + i) - myTabPoints->Value(i0 + i); dist += aux * aux; } - Length += Sqrt(dist); + Length += std::sqrt(dist); myParameters->SetValue(ipoint, Length); } @@ -2615,15 +2617,16 @@ void AppDef_Variational::InitCutting(const PLib_HermitJacobi& aBase, for (i = 1; i <= NbConstr; i++) { - kk = Abs(myTypConstraints->Value(2 * i)) + 1; - ORCMx = Max(ORCMx, kk); + kk = std::abs(myTypConstraints->Value(2 * i)) + 1; + ORCMx = std::max(ORCMx, kk); NCont += kk; } if (ORCMx > myMaxDegree - myNivCont) throw Standard_ConstructionError("AppDef_Variational::InitCutting"); - Standard_Integer NLibre = Max(myMaxDegree - myNivCont - (myMaxDegree + 1) / 4, myNivCont + 1); + Standard_Integer NLibre = + std::max(myMaxDegree - myNivCont - (myMaxDegree + 1) / 4, myNivCont + 1); NbElem = (NCont % NLibre == 0) ? NCont / NLibre : NCont / NLibre + 1; @@ -2661,7 +2664,7 @@ void AppDef_Variational::InitCutting(const PLib_HermitJacobi& aBase, while (NDeb < NCnt && IDeb < IFin) { IDeb++; - NDeb += Abs(myTypConstraints->Value(2 * IDeb)) + 1; + NDeb += std::abs(myTypConstraints->Value(2 * IDeb)) + 1; } if (NDeb == NCnt) @@ -2694,7 +2697,7 @@ void AppDef_Variational::InitCutting(const PLib_HermitJacobi& aBase, while (NFin < NCnt && IDeb < IFin) { IFin--; - NFin += Abs(myTypConstraints->Value(2 * IFin)) + 1; + NFin += std::abs(myTypConstraints->Value(2 * IFin)) + 1; } if (NFin == NCnt) @@ -2758,7 +2761,7 @@ void AppDef_Variational::Adjusting(Handle(AppDef_SmoothCriterion)& J, /* ============ boucle sur le moteur de lissage ============== */ vtest = WQuality * .9; - j1cibl = Sqrt(myCriterium[0] / (NbrPnt - NbrConstraint)); + j1cibl = std::sqrt(myCriterium[0] / (NbrPnt - NbrConstraint)); while (loptim) { @@ -2844,11 +2847,11 @@ void AppDef_Variational::Adjusting(Handle(AppDef_SmoothCriterion)& J, /* (6) Tests de rejet */ - j1cibl = Sqrt(myCriterium[0] / (NbrPnt - NbrConstraint)); - vseuil = Sqrt(vocri[1]) + (erold - myMaxError) * 4; + j1cibl = std::sqrt(myCriterium[0] / (NbrPnt - NbrConstraint)); + vseuil = std::sqrt(vocri[1]) + (erold - myMaxError) * 4; lrejet = ((myMaxError > WQuality) && (myMaxError > erold * 1.01)) - || (Sqrt(myCriterium[1]) > vseuil * 1.05); + || (std::sqrt(myCriterium[1]) > vseuil * 1.05); if (lrejet) { @@ -2966,7 +2969,7 @@ void AppDef_Variational::AssemblingConstraints(const Handle(FEmTool_Curve)& Curv myHermitJacobi.D0(t, G0); for (k = 1; k < Order; k++) { - mfact = Pow(coeff, k); + mfact = std::pow(coeff, k); G0(k) *= mfact; G0(k + Order) *= mfact; } @@ -2976,7 +2979,7 @@ void AppDef_Variational::AssemblingConstraints(const Handle(FEmTool_Curve)& Curv myHermitJacobi.D1(t, G0, G1); for (k = 1; k < Order; k++) { - mfact = Pow(coeff, k); + mfact = std::pow(coeff, k); G0(k) *= mfact; G0(k + Order) *= mfact; G1(k) *= mfact; @@ -2993,7 +2996,7 @@ void AppDef_Variational::AssemblingConstraints(const Handle(FEmTool_Curve)& Curv myHermitJacobi.D2(t, G0, G1, G2); for (k = 1; k < Order; k++) { - mfact = Pow(coeff, k); + mfact = std::pow(coeff, k); G0(k) *= mfact; G0(k + Order) *= mfact; G1(k) *= mfact; @@ -3257,9 +3260,9 @@ Standard_Boolean AppDef_Variational::InitTthetaF(const Standard_Integer n // Calculation of myTfthet if (typcon == AppParCurves_CurvaturePoint) { - XX = Pow(T.X(), 2); + XX = std::pow(T.X(), 2); XY = T.X() * T.Y(); - YY = Pow(T.Y(), 2); + YY = std::pow(T.Y(), 2); if (ndimen == 2) { F.SetX(YY * theta1.X() - XY * theta1.Y()); @@ -3271,7 +3274,7 @@ Standard_Boolean AppDef_Variational::InitTthetaF(const Standard_Integer n { XZ = T.X() * T.Z(); YZ = T.Y() * T.Z(); - ZZ = Pow(T.Z(), 2); + ZZ = std::pow(T.Z(), 2); F.SetX((ZZ + YY) * theta1.X() - XY * theta1.Y() - XZ * theta1.Z()); F.SetY((XX + ZZ) * theta1.Y() - XY * theta1.X() - YZ * theta1.Z()); diff --git a/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_BSpFunction.gxx b/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_BSpFunction.gxx index 32b00bae82..1d1c2133ff 100644 --- a/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_BSpFunction.gxx +++ b/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_BSpFunction.gxx @@ -309,7 +309,7 @@ Standard_Real AppParCurves_BSpFunction::Error(const Standard_Integer IPoint, if (!Contraintes) return d; else - return Sqrt(MyF(IPoint, CurveIndex)); + return std::sqrt(MyF(IPoint, CurveIndex)); } Standard_Real AppParCurves_BSpFunction::MaxError3d() const diff --git a/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_BSpGradient.gxx b/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_BSpGradient.gxx index 66ac5e5c68..16efe80da7 100644 --- a/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_BSpGradient.gxx +++ b/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_BSpGradient.gxx @@ -338,7 +338,7 @@ void AppParCurves_BSpGradient::Perform( if (DFU >= RealEpsilon()) { DU = FU / DFU; - DU = Sign(Min(5.e-02, Abs(DU)), DU); + DU = std::copysign(std::min(5.e-02, std::abs(DU)), DU); UF += DU; Parameters(j) = UF; } @@ -370,7 +370,7 @@ void AppParCurves_BSpGradient::Perform( // Recherche des erreurs maxi et moyenne a un index donne: for (k = 1; k <= nbP; k++) { - ParError(j) = Max(ParError(j), MyF.Error(j, k)); + ParError(j) = std::max(ParError(j), MyF.Error(j, k)); } AvError += ParError(j); } diff --git a/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_Function.gxx b/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_Function.gxx index d2a45f2d84..46ca893e60 100644 --- a/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_Function.gxx +++ b/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_Function.gxx @@ -276,14 +276,14 @@ Standard_Boolean AppParCurves_Function::Value(const math_Vector& X, Standard_Rea FZ = CC - PTLZ(i, Ci); MyF(i, Ci) += FZ * FZ; Fi = MyF(i, Ci); - if (Sqrt(Fi) > ERR3d) - ERR3d = Sqrt(Fi); + if (std::sqrt(Fi) > ERR3d) + ERR3d = std::sqrt(Fi); } else { Fi = MyF(i, Ci); - if (Sqrt(Fi) > ERR2d) - ERR2d = Sqrt(Fi); + if (std::sqrt(Fi) > ERR2d) + ERR2d = std::sqrt(Fi); } FVal += Fi; } @@ -455,14 +455,14 @@ void AppParCurves_Function::Perform(const math_Vector& X) MyF(i, Ci) += FZ * FZ; Grad_F(i, Ci) += 2.0 * DCC * FZ; Fi = MyF(i, Ci); - if (Sqrt(Fi) > ERR3d) - ERR3d = Sqrt(Fi); + if (std::sqrt(Fi) > ERR3d) + ERR3d = std::sqrt(Fi); } else { Fi = MyF(i, Ci); - if (Sqrt(Fi) > ERR2d) - ERR2d = Sqrt(Fi); + if (std::sqrt(Fi) > ERR2d) + ERR2d = std::sqrt(Fi); } FVal += Fi; ValGrad_F(i) += Grad_F(i, Ci); @@ -680,7 +680,7 @@ const AppParCurves_MultiCurve& AppParCurves_Function::CurveValue() Standard_Real AppParCurves_Function::Error(const Standard_Integer IPoint, const Standard_Integer CurveIndex) const { - return Sqrt(MyF(IPoint, CurveIndex)); + return std::sqrt(MyF(IPoint, CurveIndex)); } Standard_Real AppParCurves_Function::MaxError3d() const diff --git a/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_Gradient.gxx b/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_Gradient.gxx index fb48ef6f7a..c5febcf9ac 100644 --- a/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_Gradient.gxx +++ b/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_Gradient.gxx @@ -171,7 +171,7 @@ AppParCurves_Gradient::AppParCurves_Gradient( if (DFU >= RealEpsilon()) { DU = FU / DFU; - DU = Sign(Min(5.e-02, Abs(DU)), DU); + DU = std::copysign(std::min(5.e-02, std::abs(DU)), DU); UF += DU; Parameters(j) = UF; } @@ -207,7 +207,7 @@ AppParCurves_Gradient::AppParCurves_Gradient( // Recherche des erreurs maxi et moyenne a un index donne: for (k = 1; k <= nbP; k++) { - ParError(j) = Max(ParError(j), MyF.Error(j, k)); + ParError(j) = std::max(ParError(j), MyF.Error(j, k)); } AvError += ParError(j); } diff --git a/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_LeastSquare.gxx b/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_LeastSquare.gxx index bc10957ad1..912bdfd0f0 100644 --- a/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_LeastSquare.gxx +++ b/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_LeastSquare.gxx @@ -151,7 +151,7 @@ AppParCurves_LeastSquare::AppParCurves_LeastSquare(const MultiLine& A(FirstPoint, LastPoint, 1, NbPol), DA(FirstPoint, LastPoint, 1, NbPol), B2(TheFirstPoint(FirstCons, FirstPoint), - Max(TheFirstPoint(FirstCons, FirstPoint), TheLastPoint(LastCons, LastPoint)), + std::max(TheFirstPoint(FirstCons, FirstPoint), TheLastPoint(LastCons, LastPoint)), 1, NbBColumns(SSP)), mypoints(FirstPoint, LastPoint, 1, NbBColumns(SSP)), @@ -181,7 +181,7 @@ AppParCurves_LeastSquare::AppParCurves_LeastSquare(const MultiLine& A(FirstPoint, LastPoint, 1, NbPol), DA(FirstPoint, LastPoint, 1, NbPol), B2(TheFirstPoint(FirstCons, FirstPoint), - Max(TheFirstPoint(FirstCons, FirstPoint), TheLastPoint(LastCons, LastPoint)), + std::max(TheFirstPoint(FirstCons, FirstPoint), TheLastPoint(LastCons, LastPoint)), 1, NbBColumns(SSP)), mypoints(FirstPoint, LastPoint, 1, NbBColumns(SSP)), @@ -213,7 +213,7 @@ AppParCurves_LeastSquare::AppParCurves_LeastSquare(const MultiLine& A(FirstPoint, LastPoint, 1, NbPol), DA(FirstPoint, LastPoint, 1, NbPol), B2(TheFirstPoint(FirstCons, FirstPoint), - Max(TheFirstPoint(FirstCons, FirstPoint), TheLastPoint(LastCons, LastPoint)), + std::max(TheFirstPoint(FirstCons, FirstPoint), TheLastPoint(LastCons, LastPoint)), 1, NbBColumns(SSP)), mypoints(FirstPoint, LastPoint, 1, NbBColumns(SSP)), @@ -251,7 +251,7 @@ AppParCurves_LeastSquare::AppParCurves_LeastSquare(const MultiLine& A(FirstPoint, LastPoint, 1, NbPol), DA(FirstPoint, LastPoint, 1, NbPol), B2(TheFirstPoint(FirstCons, FirstPoint), - Max(TheFirstPoint(FirstCons, FirstPoint), TheLastPoint(LastCons, LastPoint)), + std::max(TheFirstPoint(FirstCons, FirstPoint), TheLastPoint(LastCons, LastPoint)), 1, NbBColumns(SSP)), mypoints(FirstPoint, LastPoint, 1, NbBColumns(SSP)), @@ -1281,8 +1281,8 @@ void AppParCurves_LeastSquare::Error(Standard_Real& F, Standard_Real& MaxE3d, St else i2 += 2; } - MaxE3d = Sqrt(MaxE3d); - MaxE2d = Sqrt(MaxE2d); + MaxE3d = std::sqrt(MaxE3d); + MaxE2d = std::sqrt(MaxE2d); } void AppParCurves_LeastSquare::ErrorGradient(math_Vector& Grad, @@ -1370,8 +1370,8 @@ void AppParCurves_LeastSquare::ErrorGradient(math_Vector& Grad, else i2 += 2; } - MaxE3d = Sqrt(MaxE3d); - MaxE2d = Sqrt(MaxE2d); + MaxE3d = std::sqrt(MaxE3d); + MaxE2d = std::sqrt(MaxE2d); } const math_Matrix& AppParCurves_LeastSquare::Distance() @@ -1382,7 +1382,7 @@ const math_Matrix& AppParCurves_LeastSquare::Distance() { for (Standard_Integer j = 1; j <= nbP + nbP2d; j++) { - theError(i, j) = Sqrt(theError(i, j)); + theError(i, j) = std::sqrt(theError(i, j)); } } iscalculated = Standard_True; @@ -1612,8 +1612,8 @@ void AppParCurves_LeastSquare::MakeTAA(math_Vector& TheA, math_Vector& myTAB) { indexdeb = myindex(k) + 1; indexfin = indexdeb + deg; - jinit = Max(resinit, indexdeb); - jfin = Min(resfin, indexfin); + jinit = std::max(resinit, indexdeb); + jfin = std::min(resfin, indexfin); k1 = k + myfirst - FirstP; for (i = 0; i <= NA1; i++) { @@ -1721,8 +1721,8 @@ void AppParCurves_LeastSquare::MakeTAA(math_Vector& AA, math_Matrix& myTAB) { indexdeb = myindex(k) + 1; indexfin = indexdeb + deg; - jinit = Max(resinit, indexdeb); - jfin = Min(resfin, indexfin); + jinit = std::max(resinit, indexdeb); + jfin = std::min(resfin, indexfin); for (i = jinit; i <= jfin; i++) { Akj = A(k, i); @@ -1745,7 +1745,7 @@ void AppParCurves_LeastSquare::MakeTAA(math_Vector& AA, math_Matrix& myTAB) Standard_Integer d, i2 = 1; iinit = resinit; jinit = resinit; - ifin = Min(resfin, deg + 1); + ifin = std::min(resfin, deg + 1); for (k = 2; k <= len; k++) { for (i = iinit; i <= ifin; i++) @@ -1760,8 +1760,8 @@ void AppParCurves_LeastSquare::MakeTAA(math_Vector& AA, math_Matrix& myTAB) { iinit = ifin + 1; d = ifin + mymults->Value(k); - ifin = Min(d, resfin); - jinit = Max(resinit, d - deg); + ifin = std::min(d, resfin); + jinit = std::max(resinit, d - deg); } } } @@ -1778,8 +1778,8 @@ void AppParCurves_LeastSquare::MakeTAA(math_Vector& AA) { indexdeb = myindex(k) + 1; indexfin = indexdeb + deg; - jinit = Max(resinit, indexdeb); - jfin = Min(resfin, indexfin); + jinit = std::max(resinit, indexdeb); + jfin = std::min(resfin, indexfin); for (i = jinit; i <= jfin; i++) { Akj = A(k, i); @@ -1793,7 +1793,7 @@ void AppParCurves_LeastSquare::MakeTAA(math_Vector& AA) Standard_Integer i2 = 1; iinit = resinit; jinit = resinit; - ifin = Min(resfin, deg + 1); + ifin = std::min(resfin, deg + 1); Standard_Integer len, d; if (!myknots.IsNull()) len = myknots->Length(); @@ -1813,8 +1813,8 @@ void AppParCurves_LeastSquare::MakeTAA(math_Vector& AA) { iinit = ifin + 1; d = ifin + mymults->Value(k); - ifin = Min(d, resfin); - jinit = Max(resinit, d - deg); + ifin = std::min(d, resfin); + jinit = std::max(resinit, d - deg); } } } @@ -1843,7 +1843,7 @@ void AppParCurves_LeastSquare::SearchIndex(math_IntegerVector& Index) { iinit = resinit; jinit = resinit; - ifin = Min(resfin, deg + 1); + ifin = std::min(resfin, deg + 1); len = myknots->Length(); for (k = 2; k <= len; k++) @@ -1859,8 +1859,8 @@ void AppParCurves_LeastSquare::SearchIndex(math_IntegerVector& Index) } iinit = ifin + 1; d = ifin + mymults->Value(k); - ifin = Min(d, resfin); - jinit = Max(resinit, d - deg); + ifin = std::min(d, resfin); + jinit = std::max(resinit, d - deg); } } } diff --git a/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_ResolConstraint.gxx b/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_ResolConstraint.gxx index 0366765b36..453886d696 100644 --- a/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_ResolConstraint.gxx +++ b/src/ModelingData/TKGeomBase/AppParCurves/AppParCurves_ResolConstraint.gxx @@ -171,16 +171,16 @@ AppParCurves_ResolConstraint::AppParCurves_ResolConstraint( ToolLine::Tangency(SSP, Npt, tabV); V = tabV(k); V.Coord(T1, T2, T3); - Tmax = Abs(T1); + Tmax = std::abs(T1); Ibont(k, i) = 1; - if (Abs(T2) > Tmax) + if (std::abs(T2) > Tmax) { - Tmax = Abs(T2); + Tmax = std::abs(T2); Ibont(k, i) = 2; } - if (Abs(T3) > Tmax) + if (std::abs(T3) > Tmax) { - Tmax = Abs(T3); + Tmax = std::abs(T3); Ibont(k, i) = 3; } if (Ibont(k, i) == 3) @@ -250,11 +250,11 @@ AppParCurves_ResolConstraint::AppParCurves_ResolConstraint( V2d = tabV2d(k - nb3d); T1 = V2d.X(); T2 = V2d.Y(); - Tmax = Abs(T1); + Tmax = std::abs(T1); Ibont(k, i) = 1; - if (Abs(T2) > Tmax) + if (std::abs(T2) > Tmax) { - Tmax = Abs(T2); + Tmax = std::abs(T2); Ibont(k, i) = 2; } for (j = 1; j <= Npol; j++) @@ -640,16 +640,16 @@ const math_Matrix& AppParCurves_ResolConstraint::ConstraintDerivative(const Mult ToolLine::Tangency(SSP, Npt, tabV); V = tabV(k); V.Coord(T1, T2, T3); - Tmax = Abs(T1); + Tmax = std::abs(T1); Ibont(k, i) = 1; - if (Abs(T2) > Tmax) + if (std::abs(T2) > Tmax) { - Tmax = Abs(T2); + Tmax = std::abs(T2); Ibont(k, i) = 2; } - if (Abs(T3) > Tmax) + if (std::abs(T3) > Tmax) { - Tmax = Abs(T3); + Tmax = std::abs(T3); Ibont(k, i) = 3; } AppParCurves::SecondDerivativeBernstein(Parameters(Npt), DDA); @@ -699,11 +699,11 @@ const math_Matrix& AppParCurves_ResolConstraint::ConstraintDerivative(const Mult ToolLine::Tangency(SSP, Npt, tabV2d); V2d = tabV2d(k); V2d.Coord(T1, T2); - Tmax = Abs(T1); + Tmax = std::abs(T1); Ibont(k, i) = 1; - if (Abs(T2) > Tmax) + if (std::abs(T2) > Tmax) { - Tmax = Abs(T2); + Tmax = std::abs(T2); Ibont(k, i) = 2; } for (j = 1; j <= Npol; j++) diff --git a/src/ModelingData/TKGeomBase/Approx/Approx_BSplComputeLine.gxx b/src/ModelingData/TKGeomBase/Approx/Approx_BSplComputeLine.gxx index d9a5b4c7c2..157306d180 100644 --- a/src/ModelingData/TKGeomBase/Approx/Approx_BSplComputeLine.gxx +++ b/src/ModelingData/TKGeomBase/Approx/Approx_BSplComputeLine.gxx @@ -875,14 +875,14 @@ void Approx_BSplComputeLine::Parameters(const MultiLine& Line, dist += aP22d.SquareDistance(aP12d); } - dist = Sqrt(dist); + dist = std::sqrt(dist); if (Par == Approx_ChordLength) { TheParameters(i) = TheParameters(i - 1) + dist; } else { // Par == Approx_Centripetal - TheParameters(i) = TheParameters(i - 1) + Sqrt(dist); + TheParameters(i) = TheParameters(i - 1) + std::sqrt(dist); } } for (i = firstP + 1; i <= lastP; i++) @@ -929,7 +929,7 @@ Standard_Boolean Approx_BSplComputeLine::Compute(const MultiLine& Lin if (mycont == -1) multinter = 1; else - multinter = Max(1, deg - mycont); + multinter = std::max(1, deg - mycont); for (i = Mults.Lower() + 1; i <= Mults.Upper() - 1; i++) { Mults(i) = multinter; @@ -1220,8 +1220,8 @@ void Approx_BSplComputeLine::FindRealConstraints(const MultiLine& Line) nbP3d = LineTool::NbP3d(Line); nbP2d = LineTool::NbP2d(Line); Standard_Boolean Ok = Standard_False; - TColgp_Array1OfVec TabV(1, Max(1, nbP3d)); - TColgp_Array1OfVec2d TabV2d(1, Max(1, nbP2d)); + TColgp_Array1OfVec TabV(1, std::max(1, nbP3d)); + TColgp_Array1OfVec2d TabV2d(1, std::max(1, nbP2d)); Standard_Integer Thefirstpt = LineTool::FirstPoint(Line); Standard_Integer Thelastpt = LineTool::LastPoint(Line); @@ -1366,9 +1366,9 @@ void Approx_BSplComputeLine::Interpol(const MultiLine& Line) } else { - Standard_Integer nnpol, nnp = Min(nbpoints, 9); + Standard_Integer nnpol, nnp = std::min(nbpoints, 9); nnpol = nnp; - Standard_Integer lastp = Min(Thelastpt, Thefirstpt + nnp - 1); + Standard_Integer lastp = std::min(Thelastpt, Thefirstpt + nnp - 1); Standard_Real U; Approx_BSpParLeastSquareOfMyBSplGradient SQ1(Line, Thefirstpt, lastp, Cons, Cons, nnpol); @@ -1380,7 +1380,7 @@ void Approx_BSplComputeLine::Interpol(const MultiLine& Line) U = 0.0; TangencyVector(Line, C1, U, V1); - Standard_Integer firstp = Max(Thefirstpt, Thelastpt - nnp + 1); + Standard_Integer firstp = std::max(Thefirstpt, Thelastpt - nnp + 1); if (firstp == Thefirstpt && lastp == Thelastpt) { diff --git a/src/ModelingData/TKGeomBase/Approx/Approx_ComputeCLine.gxx b/src/ModelingData/TKGeomBase/Approx/Approx_ComputeCLine.gxx index e2a6c68783..78d3e1ffa4 100644 --- a/src/ModelingData/TKGeomBase/Approx/Approx_ComputeCLine.gxx +++ b/src/ModelingData/TKGeomBase/Approx/Approx_ComputeCLine.gxx @@ -103,11 +103,11 @@ void Approx_ComputeCLine::Perform(const MultiLine& Line) Standard_Real TolU = 0.; if (myHangChecking) { - TolU = Max((ULast - UFirst) * 1.e-03, Precision::Confusion()); + TolU = std::max((ULast - UFirst) * 1.e-03, Precision::Confusion()); } else { - TolU = Max((ULast - UFirst) * 1.e-05, Precision::PApproximation()); + TolU = std::max((ULast - UFirst) * 1.e-05, Precision::PApproximation()); } Standard_Real myfirstU = UFirst; Standard_Real mylastU = ULast; @@ -148,7 +148,7 @@ void Approx_ComputeCLine::Perform(const MultiLine& Line) mylastU = ULast; aNbCut = 0; aNbImp = 0; - if (Abs(ULast - myfirstU) <= RealEpsilon() || aMaxSegments >= myMaxSegments) + if (std::abs(ULast - myfirstU) <= RealEpsilon() || aMaxSegments >= myMaxSegments) { Finish = Standard_True; alldone = Standard_True; @@ -197,7 +197,9 @@ void Approx_ComputeCLine::Perform(const MultiLine& Line) aNbImp = 0; } // is new decision better? - if (!Ok && (Abs(myfirstU - mylastU) <= TolU || aMaxSegments >= aMaxSegments1 || aStopCutting)) + if (!Ok + && (std::abs(myfirstU - mylastU) <= TolU || aMaxSegments >= aMaxSegments1 + || aStopCutting)) { Ok = Standard_True; // stop interval cutting, approx the rest part @@ -282,7 +284,7 @@ Standard_Boolean Approx_ComputeCLine::Compute(const MultiLine& Line, { for (deg = mydegremax; deg >= mydegremin; deg--) { - NbPoints = Min(2 * deg + 1, NbPointsMax); + NbPoints = std::min(2 * deg + 1, NbPointsMax); AppCont_LeastSquare LSquare(Line, Ufirst, Ulast, myfirstC, mylastC, deg, NbPoints); mydone = LSquare.IsDone(); if (mydone) @@ -350,7 +352,7 @@ Standard_Boolean Approx_ComputeCLine::Compute(const MultiLine& Line, { for (deg = mydegremin; deg <= mydegremax; deg++) { - NbPoints = Min(2 * deg + 1, NbPointsMax); + NbPoints = std::min(2 * deg + 1, NbPointsMax); AppCont_LeastSquare LSquare(Line, Ufirst, Ulast, myfirstC, mylastC, deg, NbPoints); mydone = LSquare.IsDone(); if (mydone) diff --git a/src/ModelingData/TKGeomBase/Approx/Approx_ComputeLine.gxx b/src/ModelingData/TKGeomBase/Approx/Approx_ComputeLine.gxx index 48431743f5..6c0b59cb29 100644 --- a/src/ModelingData/TKGeomBase/Approx/Approx_ComputeLine.gxx +++ b/src/ModelingData/TKGeomBase/Approx/Approx_ComputeLine.gxx @@ -159,8 +159,8 @@ static Standard_Boolean CheckMultiCurve(const AppParCurves_MultiCurve& theMultiC Standard_Integer NbCur = theMultiCurve.NbCurves(); Standard_Boolean LoopFound = Standard_False; - Standard_Integer aNbP3d = Max(nbp3d, 1); - Standard_Integer aNbP2d = Max(nbp2d, 1); + Standard_Integer aNbP3d = std::max(nbp3d, 1); + Standard_Integer aNbP2d = std::max(nbp2d, 1); TColgp_Array1OfPnt tabP(1, aNbP3d); TColgp_Array1OfPnt2d tabP2d(1, aNbP2d); @@ -320,7 +320,7 @@ static Standard_Boolean CheckMultiCurve(const AppParCurves_MultiCurve& theMultiC return Standard_False; } - FirstVec /= Sqrt(aSqNormToler); + FirstVec /= std::sqrt(aSqNormToler); gp_Pnt2d MidPnt = aPoles2d(2); for (Standard_Integer k = 3; k <= aPoles2d.Upper(); k++) { @@ -332,7 +332,7 @@ static Standard_Boolean CheckMultiCurve(const AppParCurves_MultiCurve& theMultiC return Standard_False; } - SecondVec /= Sqrt(aVecSqNorm); + SecondVec /= std::sqrt(aVecSqNorm); Standard_Real ScalProd = FirstVec * SecondVec; if (ScalProd < MinScalProd) { @@ -1304,14 +1304,14 @@ void Approx_ComputeLine::Parameters(const MultiLine& Line, dist += aP22d.SquareDistance(aP12d); } - dist = Sqrt(dist); + dist = std::sqrt(dist); if (Par == Approx_ChordLength) { TheParameters(i) = TheParameters(i - 1) + dist; } else { // Par == Approx_Centripetal - TheParameters(i) = TheParameters(i - 1) + Sqrt(dist); + TheParameters(i) = TheParameters(i - 1) + std::sqrt(dist); } } for (i = firstP; i <= lastP; i++) @@ -1357,7 +1357,7 @@ Standard_Boolean Approx_ComputeLine::Compute(const MultiLine& Line, } currenttol3d = currenttol2d = RealLast(); - for (deg = Min(nbp - 1, mydegremin); deg <= Mdegmax; deg++) + for (deg = std::min(nbp - 1, mydegremin); deg <= Mdegmax; deg++) { AppParCurves_MultiCurve mySCU(deg + 1); if (mysquares) diff --git a/src/ModelingData/TKGeomBase/Approx/Approx_CurveOnSurface.cxx b/src/ModelingData/TKGeomBase/Approx/Approx_CurveOnSurface.cxx index a15089e783..1583e0286a 100644 --- a/src/ModelingData/TKGeomBase/Approx/Approx_CurveOnSurface.cxx +++ b/src/ModelingData/TKGeomBase/Approx/Approx_CurveOnSurface.cxx @@ -424,17 +424,17 @@ void Approx_CurveOnSurface::Perform(const Standard_Integer theMaxSegments, if (mySurf->UContinuity() == GeomAbs_C0) { if (!Adaptor3d_HSurfaceTool::IsSurfG1(mySurf, Standard_True, Precision::Angular())) - TolU = Min(1.e-3, 1.e3 * TolU); + TolU = std::min(1.e-3, 1.e3 * TolU); if (!Adaptor3d_HSurfaceTool::IsSurfG1(mySurf, Standard_True, Precision::Confusion())) - TolU = Min(1.e-3, 1.e2 * TolU); + TolU = std::min(1.e-3, 1.e2 * TolU); } if (mySurf->VContinuity() == GeomAbs_C0) { if (!Adaptor3d_HSurfaceTool::IsSurfG1(mySurf, Standard_False, Precision::Angular())) - TolV = Min(1.e-3, 1.e3 * TolV); + TolV = std::min(1.e-3, 1.e3 * TolV); if (!Adaptor3d_HSurfaceTool::IsSurfG1(mySurf, Standard_False, Precision::Confusion())) - TolV = Min(1.e-3, 1.e2 * TolV); + TolV = std::min(1.e-3, 1.e2 * TolV); } OneDTol->SetValue(1, TolU); @@ -670,15 +670,15 @@ Standard_Boolean Approx_CurveOnSurface::buildC3dOnIsoLine(const Handle(Adaptor2d if (theIsU) { - Standard_Real aV1Param = Min(aF2d.Y(), aL2d.Y()); - Standard_Real aV2Param = Max(aF2d.Y(), aL2d.Y()); + Standard_Real aV1Param = std::min(aF2d.Y(), aL2d.Y()); + Standard_Real aV2Param = std::max(aF2d.Y(), aL2d.Y()); if (aV2Param < V1 - myTol || aV1Param > V2 + myTol) { return Standard_False; } else if (Precision::IsInfinite(V1) || Precision::IsInfinite(V2)) { - if (Abs(aV2Param - aV1Param) < Precision::PConfusion()) + if (std::abs(aV2Param - aV1Param) < Precision::PConfusion()) { return Standard_False; } @@ -687,9 +687,9 @@ Standard_Boolean Approx_CurveOnSurface::buildC3dOnIsoLine(const Handle(Adaptor2d } else { - aV1Param = Max(aV1Param, V1); - aV2Param = Min(aV2Param, V2); - if (Abs(aV2Param - aV1Param) < Precision::PConfusion()) + aV1Param = std::max(aV1Param, V1); + aV2Param = std::min(aV2Param, V2); + if (std::abs(aV2Param - aV1Param) < Precision::PConfusion()) { return Standard_False; } @@ -700,15 +700,15 @@ Standard_Boolean Approx_CurveOnSurface::buildC3dOnIsoLine(const Handle(Adaptor2d } else { - Standard_Real aU1Param = Min(aF2d.X(), aL2d.X()); - Standard_Real aU2Param = Max(aF2d.X(), aL2d.X()); + Standard_Real aU1Param = std::min(aF2d.X(), aL2d.X()); + Standard_Real aU2Param = std::max(aF2d.X(), aL2d.X()); if (aU2Param < U1 - myTol || aU1Param > U2 + myTol) { return Standard_False; } else if (Precision::IsInfinite(U1) || Precision::IsInfinite(U2)) { - if (Abs(aU2Param - aU1Param) < Precision::PConfusion()) + if (std::abs(aU2Param - aU1Param) < Precision::PConfusion()) { return Standard_False; } @@ -717,9 +717,9 @@ Standard_Boolean Approx_CurveOnSurface::buildC3dOnIsoLine(const Handle(Adaptor2d } else { - aU1Param = Max(aU1Param, U1); - aU2Param = Min(aU2Param, U2); - if (Abs(aU2Param - aU1Param) < Precision::PConfusion()) + aU1Param = std::max(aU1Param, U1); + aU2Param = std::min(aU2Param, U2); + if (std::abs(aU2Param - aU1Param) < Precision::PConfusion()) { return Standard_False; } @@ -756,10 +756,10 @@ Standard_Boolean Approx_CurveOnSurface::buildC3dOnIsoLine(const Handle(Adaptor2d const gp_Pnt aPntC2D = mySurf->Value(aPnt2d.X(), aPnt2d.Y()); const Standard_Real aSqDeviation = aPntC3D.SquareDistance(aPntC2D); - myError3d = Max(aSqDeviation, myError3d); + myError3d = std::max(aSqDeviation, myError3d); } - myError3d = Sqrt(myError3d); + myError3d = std::sqrt(myError3d); // Target tolerance is not obtained. This situation happens for isolines on the sphere. // OCCT is unable to convert it keeping original parameterization, while the geometric diff --git a/src/ModelingData/TKGeomBase/Approx/Approx_CurvilinearParameter.cxx b/src/ModelingData/TKGeomBase/Approx/Approx_CurvilinearParameter.cxx index 6f63ae4807..f0f584aad3 100644 --- a/src/ModelingData/TKGeomBase/Approx/Approx_CurvilinearParameter.cxx +++ b/src/ModelingData/TKGeomBase/Approx/Approx_CurvilinearParameter.cxx @@ -376,7 +376,7 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_ myCurve3d = new Geom_BSplineCurve(Poles, Knots->Array1(), Mults->Array1(), Degree); myCurve2d1 = new Geom2d_BSplineCurve(Poles2d, Knots->Array1(), Mults->Array1(), Degree); } - myMaxError2d1 = Max(aApprox.MaxError(1, 1), aApprox.MaxError(1, 2)); + myMaxError2d1 = std::max(aApprox.MaxError(1, 1), aApprox.MaxError(1, 2)); myMaxError3d = aApprox.MaxError(3, 1); #ifdef OCCT_DEBUG_CHRONO @@ -562,8 +562,8 @@ Approx_CurvilinearParameter::Approx_CurvilinearParameter(const Handle(Adaptor2d_ Poles2d(i).SetY(Poles1d(i)); myCurve2d2 = new Geom2d_BSplineCurve(Poles2d, Knots->Array1(), Mults->Array1(), Degree); } - myMaxError2d1 = Max(aApprox.MaxError(1, 1), aApprox.MaxError(1, 2)); - myMaxError2d2 = Max(aApprox.MaxError(1, 3), aApprox.MaxError(1, 4)); + myMaxError2d1 = std::max(aApprox.MaxError(1, 1), aApprox.MaxError(1, 2)); + myMaxError2d2 = std::max(aApprox.MaxError(1, 3), aApprox.MaxError(1, 4)); myMaxError3d = aApprox.MaxError(3, 1); #ifdef OCCT_DEBUG_CHRONO @@ -676,8 +676,8 @@ void Approx_CurvilinearParameter::ToleranceComputation(const Handle(Adaptor2d_Cu { pntVW = C2D->Value(FirstU + (i - 1) * (LastU - FirstU) / (MaxNumber - 1)); S->D1(pntVW.X(), pntVW.Y(), P, dS_dv, dS_dw); - Max_dS_dv = Max(Max_dS_dv, dS_dv.Magnitude()); - Max_dS_dw = Max(Max_dS_dw, dS_dw.Magnitude()); + Max_dS_dv = std::max(Max_dS_dv, dS_dv.Magnitude()); + Max_dS_dw = std::max(Max_dS_dw, dS_dw.Magnitude()); } TolV = Tol / (4. * Max_dS_dv); TolW = Tol / (4. * Max_dS_dw); diff --git a/src/ModelingData/TKGeomBase/Approx/Approx_CurvlinFunc.cxx b/src/ModelingData/TKGeomBase/Approx/Approx_CurvlinFunc.cxx index 91bacd442c..d546acdad5 100644 --- a/src/ModelingData/TKGeomBase/Approx/Approx_CurvlinFunc.cxx +++ b/src/ModelingData/TKGeomBase/Approx/Approx_CurvlinFunc.cxx @@ -112,7 +112,7 @@ static void findfourpoints(const Standard_Real, k = mod2/(mod1*mod1*mod1); tau = D1.Dot(D2.Crossed(D3)); tau /= mod2*mod2; - OMEGA = Sqrt(k*k + tau*tau); + OMEGA = std::sqrt(k*k + tau*tau); return OMEGA; } diff --git a/src/ModelingData/TKGeomBase/Approx/Approx_SameParameter.cxx b/src/ModelingData/TKGeomBase/Approx/Approx_SameParameter.cxx index cd2dae3339..f9418e2f0d 100644 --- a/src/ModelingData/TKGeomBase/Approx/Approx_SameParameter.cxx +++ b/src/ModelingData/TKGeomBase/Approx/Approx_SameParameter.cxx @@ -124,7 +124,7 @@ static void ProjectPointOnCurve(const Standard_Real InitValue, vector = gp_Vec(a_point, APoint); func = vector.Dot(d1); - if (Abs(func) < Tolerance * d1.Magnitude()) + if (std::abs(func) < Tolerance * d1.Magnitude()) { not_done = 0; Status = Standard_True; @@ -135,11 +135,11 @@ static void ProjectPointOnCurve(const Standard_Real InitValue, // Avoid division by zero. const Standard_Real Toler = 1.0e-12; - if (Abs(func_derivative) > Toler) + if (std::abs(func_derivative) > Toler) param -= func / func_derivative; - param = Max(param, Curve.FirstParameter()); - param = Min(param, Curve.LastParameter()); + param = std::max(param, Curve.FirstParameter()); + param = std::min(param, Curve.LastParameter()); } } while (not_done && num_iter <= NumIteration); @@ -176,12 +176,12 @@ static Standard_Real ComputeTolReached(const Handle(Adaptor3d_Curve)& c3d, d2 = Precision::Infinite(); break; } - d2 = Max(d2, Pc3d.SquareDistance(Pcons)); + d2 = std::max(d2, Pc3d.SquareDistance(Pcons)); } const Standard_Real aMult = 1. + 0.05; // Standard_Real aDeviation = aMult * sqrt(d2); - aDeviation = Max(aDeviation, Precision::Confusion()); // Tolerance in modeling space. + aDeviation = std::max(aDeviation, Precision::Confusion()); // Tolerance in modeling space. return aDeviation; } @@ -664,7 +664,7 @@ Standard_Boolean Approx_SameParameter::CheckSameParameter(Approx_SameParameter_D theData.myCOnS.D0(theData.myC2dPL, Pcons); myC3d->D0(theData.myC3dPL, Pc3d); dist2 = Pcons.SquareDistance(Pc3d); - dmax2 = Max(dmax2, dist2); + dmax2 = std::max(dmax2, dist2); Extrema_LocateExtPC Projector; Projector.Initialize(*myC3d, theData.myC3dPF, theData.myC3dPL, theData.myTol); diff --git a/src/ModelingData/TKGeomBase/Approx/Approx_SweepApproximation.cxx b/src/ModelingData/TKGeomBase/Approx/Approx_SweepApproximation.cxx index 8c2c1f8249..46db85ac83 100644 --- a/src/ModelingData/TKGeomBase/Approx/Approx_SweepApproximation.cxx +++ b/src/ModelingData/TKGeomBase/Approx/Approx_SweepApproximation.cxx @@ -117,7 +117,7 @@ void Approx_SweepApproximation::Perform(const Standard_Real First, Tol = ThreeDTol->Value(ii) / 2; // To take account of the error on the final result. OneDTol->SetValue(ii, Tol * Wmin(ii) / Size); Tol *= Wmin(ii); // Factor of projection - ThreeDTol->SetValue(ii, Max(Tol, 1.e-20)); + ThreeDTol->SetValue(ii, std::max(Tol, 1.e-20)); } } else @@ -151,7 +151,7 @@ void Approx_SweepApproximation::Perform(const Standard_Real First, res = tolu; AAffin->ChangeValue(ii).SetValue(2, 2, tolu / tolv); } - TwoDTol->SetValue(ii, Min(Tol2d, res)); + TwoDTol->SetValue(ii, std::min(Tol2d, res)); } } diff --git a/src/ModelingData/TKGeomBase/BndLib/BndLib.cxx b/src/ModelingData/TKGeomBase/BndLib/BndLib.cxx index ba3079a523..cf6ea6973c 100644 --- a/src/ModelingData/TKGeomBase/BndLib/BndLib.cxx +++ b/src/ModelingData/TKGeomBase/BndLib/BndLib.cxx @@ -66,7 +66,7 @@ void Compute(const Standard_Real theP1, aTeta2 = theP2; } - Standard_Real aDelta = Abs(aTeta2 - aTeta1); + Standard_Real aDelta = std::abs(aTeta2 - aTeta1); if (aDelta > 2. * M_PI) { aTeta1 = 0.; @@ -93,10 +93,10 @@ void Compute(const Standard_Real theP1, // One places already both ends Standard_Real aCn1, aSn1, aCn2, aSn2; - aCn1 = Cos(aTeta1); - aSn1 = Sin(aTeta1); - aCn2 = Cos(aTeta2); - aSn2 = Sin(aTeta2); + aCn1 = std::cos(aTeta1); + aSn1 = std::sin(aTeta1); + aCn2 = std::cos(aTeta2); + aSn2 = std::sin(aTeta2); theB.Add(PointType(theO.Coord() + theRa * aCn1 * theXd.Coord() + theRb * aSn1 * theYd.Coord())); theB.Add(PointType(theO.Coord() + theRa * aCn2 * theXd.Coord() + theRb * aSn2 * theYd.Coord())); @@ -511,9 +511,9 @@ void BndLib::Add(const gp_Circ& C, // Standard_Real tt; Standard_Real xmin, xmax, txmin, txmax; - if (Abs(Xd.X()) > gp::Resolution()) + if (std::abs(Xd.X()) > gp::Resolution()) { - txmin = ATan(Yd.X() / Xd.X()); + txmin = std::atan(Yd.X() / Xd.X()); txmin = ElCLib::InPeriod(txmin, 0., 2. * M_PI); } else @@ -521,8 +521,8 @@ void BndLib::Add(const gp_Circ& C, txmin = M_PI / 2.; } txmax = txmin <= M_PI ? txmin + M_PI : txmin - M_PI; - xmin = R * Cos(txmin) * Xd.X() + R * Sin(txmin) * Yd.X() + O.X(); - xmax = R * Cos(txmax) * Xd.X() + R * Sin(txmax) * Yd.X() + O.X(); + xmin = R * std::cos(txmin) * Xd.X() + R * std::sin(txmin) * Yd.X() + O.X(); + xmax = R * std::cos(txmax) * Xd.X() + R * std::sin(txmax) * Yd.X() + O.X(); if (xmin > xmax) { tt = xmin; @@ -534,9 +534,9 @@ void BndLib::Add(const gp_Circ& C, } // Standard_Real ymin, ymax, tymin, tymax; - if (Abs(Xd.Y()) > gp::Resolution()) + if (std::abs(Xd.Y()) > gp::Resolution()) { - tymin = ATan(Yd.Y() / Xd.Y()); + tymin = std::atan(Yd.Y() / Xd.Y()); tymin = ElCLib::InPeriod(tymin, 0., 2. * M_PI); } else @@ -544,8 +544,8 @@ void BndLib::Add(const gp_Circ& C, tymin = M_PI / 2.; } tymax = tymin <= M_PI ? tymin + M_PI : tymin - M_PI; - ymin = R * Cos(tymin) * Xd.Y() + R * Sin(tymin) * Yd.Y() + O.Y(); - ymax = R * Cos(tymax) * Xd.Y() + R * Sin(tymax) * Yd.Y() + O.Y(); + ymin = R * std::cos(tymin) * Xd.Y() + R * std::sin(tymin) * Yd.Y() + O.Y(); + ymax = R * std::cos(tymax) * Xd.Y() + R * std::sin(tymax) * Yd.Y() + O.Y(); if (ymin > ymax) { tt = ymin; @@ -557,9 +557,9 @@ void BndLib::Add(const gp_Circ& C, } // Standard_Real zmin, zmax, tzmin, tzmax; - if (Abs(Xd.Z()) > gp::Resolution()) + if (std::abs(Xd.Z()) > gp::Resolution()) { - tzmin = ATan(Yd.Z() / Xd.Z()); + tzmin = std::atan(Yd.Z() / Xd.Z()); tzmin = ElCLib::InPeriod(tzmin, 0., 2. * M_PI); } else @@ -567,8 +567,8 @@ void BndLib::Add(const gp_Circ& C, tzmin = M_PI / 2.; } tzmax = tzmin <= M_PI ? tzmin + M_PI : tzmin - M_PI; - zmin = R * Cos(tzmin) * Xd.Z() + R * Sin(tzmin) * Yd.Z() + O.Z(); - zmax = R * Cos(tzmax) * Xd.Z() + R * Sin(tzmax) * Yd.Z() + O.Z(); + zmin = R * std::cos(tzmin) * Xd.Z() + R * std::sin(tzmin) * Yd.Z() + O.Z(); + zmax = R * std::cos(tzmax) * Xd.Z() + R * std::sin(tzmax) * Yd.Z() + O.Z(); if (zmin > zmax) { tt = zmin; @@ -602,34 +602,34 @@ void BndLib::Add(const gp_Circ& C, txmin = ElCLib::InPeriod(txmin, utrim1, utrim1 + 2. * M_PI); if (txmin >= utrim1 && txmin <= utrim2) { - Xmin = Min(xmin, Xmin); + Xmin = std::min(xmin, Xmin); } txmax = ElCLib::InPeriod(txmax, utrim1, utrim1 + 2. * M_PI); if (txmax >= utrim1 && txmax <= utrim2) { - Xmax = Max(xmax, Xmax); + Xmax = std::max(xmax, Xmax); } // tymin = ElCLib::InPeriod(tymin, utrim1, utrim1 + 2. * M_PI); if (tymin >= utrim1 && tymin <= utrim2) { - Ymin = Min(ymin, Ymin); + Ymin = std::min(ymin, Ymin); } tymax = ElCLib::InPeriod(tymax, utrim1, utrim1 + 2. * M_PI); if (tymax >= utrim1 && tymax <= utrim2) { - Ymax = Max(ymax, Ymax); + Ymax = std::max(ymax, Ymax); } // tzmin = ElCLib::InPeriod(tzmin, utrim1, utrim1 + 2. * M_PI); if (tzmin >= utrim1 && tzmin <= utrim2) { - Zmin = Min(zmin, Zmin); + Zmin = std::min(zmin, Zmin); } tzmax = ElCLib::InPeriod(tzmax, utrim1, utrim1 + 2. * M_PI); if (tzmax >= utrim1 && tzmax <= utrim2) { - Zmax = Max(zmax, Zmax); + Zmax = std::max(zmax, Zmax); } // B.Update(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); @@ -704,9 +704,9 @@ void BndLib::Add(const gp_Elips& C, // Standard_Real tt; Standard_Real xmin, xmax, txmin, txmax; - if (Abs(Xd.X()) > gp::Resolution()) + if (std::abs(Xd.X()) > gp::Resolution()) { - txmin = ATan((MinR * Yd.X()) / (MajR * Xd.X())); + txmin = std::atan((MinR * Yd.X()) / (MajR * Xd.X())); txmin = ElCLib::InPeriod(txmin, 0., 2. * M_PI); } else @@ -714,8 +714,8 @@ void BndLib::Add(const gp_Elips& C, txmin = M_PI / 2.; } txmax = txmin <= M_PI ? txmin + M_PI : txmin - M_PI; - xmin = MajR * Cos(txmin) * Xd.X() + MinR * Sin(txmin) * Yd.X() + O.X(); - xmax = MajR * Cos(txmax) * Xd.X() + MinR * Sin(txmax) * Yd.X() + O.X(); + xmin = MajR * std::cos(txmin) * Xd.X() + MinR * std::sin(txmin) * Yd.X() + O.X(); + xmax = MajR * std::cos(txmax) * Xd.X() + MinR * std::sin(txmax) * Yd.X() + O.X(); if (xmin > xmax) { tt = xmin; @@ -727,9 +727,9 @@ void BndLib::Add(const gp_Elips& C, } // Standard_Real ymin, ymax, tymin, tymax; - if (Abs(Xd.Y()) > gp::Resolution()) + if (std::abs(Xd.Y()) > gp::Resolution()) { - tymin = ATan((MinR * Yd.Y()) / (MajR * Xd.Y())); + tymin = std::atan((MinR * Yd.Y()) / (MajR * Xd.Y())); tymin = ElCLib::InPeriod(tymin, 0., 2. * M_PI); } else @@ -737,8 +737,8 @@ void BndLib::Add(const gp_Elips& C, tymin = M_PI / 2.; } tymax = tymin <= M_PI ? tymin + M_PI : tymin - M_PI; - ymin = MajR * Cos(tymin) * Xd.Y() + MinR * Sin(tymin) * Yd.Y() + O.Y(); - ymax = MajR * Cos(tymax) * Xd.Y() + MinR * Sin(tymax) * Yd.Y() + O.Y(); + ymin = MajR * std::cos(tymin) * Xd.Y() + MinR * std::sin(tymin) * Yd.Y() + O.Y(); + ymax = MajR * std::cos(tymax) * Xd.Y() + MinR * std::sin(tymax) * Yd.Y() + O.Y(); if (ymin > ymax) { tt = ymin; @@ -750,9 +750,9 @@ void BndLib::Add(const gp_Elips& C, } // Standard_Real zmin, zmax, tzmin, tzmax; - if (Abs(Xd.Z()) > gp::Resolution()) + if (std::abs(Xd.Z()) > gp::Resolution()) { - tzmin = ATan((MinR * Yd.Z()) / (MajR * Xd.Z())); + tzmin = std::atan((MinR * Yd.Z()) / (MajR * Xd.Z())); tzmin = ElCLib::InPeriod(tzmin, 0., 2. * M_PI); } else @@ -760,8 +760,8 @@ void BndLib::Add(const gp_Elips& C, tzmin = M_PI / 2.; } tzmax = tzmin <= M_PI ? tzmin + M_PI : tzmin - M_PI; - zmin = MajR * Cos(tzmin) * Xd.Z() + MinR * Sin(tzmin) * Yd.Z() + O.Z(); - zmax = MajR * Cos(tzmax) * Xd.Z() + MinR * Sin(tzmax) * Yd.Z() + O.Z(); + zmin = MajR * std::cos(tzmin) * Xd.Z() + MinR * std::sin(tzmin) * Yd.Z() + O.Z(); + zmax = MajR * std::cos(tzmax) * Xd.Z() + MinR * std::sin(tzmax) * Yd.Z() + O.Z(); if (zmin > zmax) { tt = zmin; @@ -795,34 +795,34 @@ void BndLib::Add(const gp_Elips& C, txmin = ElCLib::InPeriod(txmin, utrim1, utrim1 + 2. * M_PI); if (txmin >= utrim1 && txmin <= utrim2) { - Xmin = Min(xmin, Xmin); + Xmin = std::min(xmin, Xmin); } txmax = ElCLib::InPeriod(txmax, utrim1, utrim1 + 2. * M_PI); if (txmax >= utrim1 && txmax <= utrim2) { - Xmax = Max(xmax, Xmax); + Xmax = std::max(xmax, Xmax); } // tymin = ElCLib::InPeriod(tymin, utrim1, utrim1 + 2. * M_PI); if (tymin >= utrim1 && tymin <= utrim2) { - Ymin = Min(ymin, Ymin); + Ymin = std::min(ymin, Ymin); } tymax = ElCLib::InPeriod(tymax, utrim1, utrim1 + 2. * M_PI); if (tymax >= utrim1 && tymax <= utrim2) { - Ymax = Max(ymax, Ymax); + Ymax = std::max(ymax, Ymax); } // tzmin = ElCLib::InPeriod(tzmin, utrim1, utrim1 + 2. * M_PI); if (tzmin >= utrim1 && tzmin <= utrim2) { - Zmin = Min(zmin, Zmin); + Zmin = std::min(zmin, Zmin); } tzmax = ElCLib::InPeriod(tzmax, utrim1, utrim1 + 2. * M_PI); if (tzmax >= utrim1 && tzmax <= utrim2) { - Zmax = Max(zmax, Zmax); + Zmax = std::max(zmax, Zmax); } // B.Update(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); @@ -1274,13 +1274,13 @@ void BndLib::Add(const gp_Cone& S, } else if (Precision::IsPositiveInfinite(VMax)) { - gp_Dir D(Cos(A) * S.Axis().Direction()); + gp_Dir D(std::cos(A) * S.Axis().Direction()); OpenMinMax(D, B); } else { ComputeCone(S, UMin, UMax, 0., VMax, B); - gp_Dir D(Cos(A) * S.Axis().Direction()); + gp_Dir D(std::cos(A) * S.Axis().Direction()); OpenMin(D, B); } } @@ -1288,7 +1288,7 @@ void BndLib::Add(const gp_Cone& S, { if (Precision::IsNegativeInfinite(VMax)) { - gp_Dir D(Cos(A) * S.Axis().Direction()); + gp_Dir D(std::cos(A) * S.Axis().Direction()); OpenMinMax(D, B); } else if (Precision::IsPositiveInfinite(VMax)) @@ -1298,7 +1298,7 @@ void BndLib::Add(const gp_Cone& S, else { ComputeCone(S, UMin, UMax, 0., VMax, B); - gp_Dir D(Cos(A) * S.Axis().Direction()); + gp_Dir D(std::cos(A) * S.Axis().Direction()); OpenMax(D, B); } } @@ -1307,13 +1307,13 @@ void BndLib::Add(const gp_Cone& S, if (Precision::IsNegativeInfinite(VMax)) { ComputeCone(S, UMin, UMax, VMin, 0., B); - gp_Dir D(Cos(A) * S.Axis().Direction()); + gp_Dir D(std::cos(A) * S.Axis().Direction()); OpenMin(D, B); } else if (Precision::IsPositiveInfinite(VMax)) { ComputeCone(S, UMin, UMax, VMin, 0., B); - gp_Dir D(Cos(A) * S.Axis().Direction()); + gp_Dir D(std::cos(A) * S.Axis().Direction()); OpenMax(D, B); } else @@ -1452,7 +1452,7 @@ static void computeDegeneratedTorus(const gp_Torus& theTorus, aZmin = aP.Z() - aRi; aZmax = aP.Z() + aRi; - Standard_Real aPhi = ACos(-aRa / aRi); + Standard_Real aPhi = std::acos(-aRa / aRi); constexpr Standard_Real anUper = 2. * M_PI - Precision::PConfusion(); Standard_Real aVper = 2. * aPhi - Precision::PConfusion(); diff --git a/src/ModelingData/TKGeomBase/BndLib/BndLib_Add2dCurve.cxx b/src/ModelingData/TKGeomBase/BndLib/BndLib_Add2dCurve.cxx index ac792b6149..5495dc7d7f 100644 --- a/src/ModelingData/TKGeomBase/BndLib/BndLib_Add2dCurve.cxx +++ b/src/ModelingData/TKGeomBase/BndLib/BndLib_Add2dCurve.cxx @@ -530,7 +530,7 @@ Standard_Integer BndLib_Box2dCurve::NbSamples() if (du < .9) { N = RealToInt(du * N) + 1; - N = Max(N, 5); + N = std::max(N, 5); } break; } @@ -542,14 +542,14 @@ Standard_Integer BndLib_Box2dCurve::NbSamples() if (du < .9) { N = RealToInt(du * N) + 1; - N = Max(N, 5); + N = std::max(N, 5); } break; } default: N = 17; } - return Min(23, N); + return std::min(23, N); } //================================================================================================= @@ -567,8 +567,8 @@ Standard_Real BndLib_Box2dCurve::AdjustExtr(const Standard_Real UMin, Standard_Real Du = (myCurve->LastParameter() - myCurve->FirstParameter()); // Geom2dAdaptor_Curve aGAC(myCurve); - Standard_Real UTol = Max(aGAC.Resolution(Tol), Precision::PConfusion()); - Standard_Real reltol = UTol / Max(Abs(UMin), Abs(UMax)); + Standard_Real UTol = std::max(aGAC.Resolution(Tol), Precision::PConfusion()); + Standard_Real reltol = UTol / std::max(std::abs(UMin), std::abs(UMax)); if (UMax - UMin < 0.01 * Du) { // It is suggested that function has one extremum on small interval @@ -582,7 +582,7 @@ Standard_Real BndLib_Box2dCurve::AdjustExtr(const Standard_Real UMin, } } // - Standard_Integer aNbParticles = Max(8, RealToInt(32 * (UMax - UMin) / Du)); + Standard_Integer aNbParticles = std::max(8, RealToInt(32 * (UMax - UMin) / Du)); Standard_Real maxstep = (UMax - UMin) / (aNbParticles + 1); math_Vector aT(1, 1); math_Vector aLowBorder(1, 1); @@ -590,7 +590,7 @@ Standard_Real BndLib_Box2dCurve::AdjustExtr(const Standard_Real UMin, math_Vector aSteps(1, 1); aLowBorder(1) = UMin; aUppBorder(1) = UMax; - aSteps(1) = Min(0.1 * Du, maxstep); + aSteps(1) = std::min(0.1 * Du, maxstep); Curv2dMaxMinCoordMVar aFunc(myCurve, UMin, UMax, CoordIndx, aSign); math_PSO aFinder(&aFunc, aLowBorder, aUppBorder, aSteps, aNbParticles); @@ -598,7 +598,10 @@ Standard_Real BndLib_Box2dCurve::AdjustExtr(const Standard_Real UMin, // math_BrentMinimum anOptLoc(reltol, 100, UTol); Curv2dMaxMinCoord aFunc1(myCurve, UMin, UMax, CoordIndx, aSign); - anOptLoc.Perform(aFunc1, Max(aT(1) - aSteps(1), UMin), aT(1), Min(aT(1) + aSteps(1), UMax)); + anOptLoc.Perform(aFunc1, + std::max(aT(1) - aSteps(1), UMin), + aT(1), + std::min(aT(1) + aSteps(1), UMax)); if (anOptLoc.IsDone()) { @@ -657,7 +660,7 @@ void BndLib_Box2dCurve::PerformGenCurv(const Standard_Real Tol) { CoordMax[k] = P.Coord(k + 1); } - Standard_Real d = Abs(aD.Coord(k + 1)); + Standard_Real d = std::abs(aD.Coord(k + 1)); if (DeflMax[k] < d) { DeflMax[k] = d; @@ -681,8 +684,8 @@ void BndLib_Box2dCurve::PerformGenCurv(const Standard_Real Tol) if (aPnts(i).Coord(k + 1) - CMin < d) { Standard_Real tmin, tmax; - tmin = myT1 + Max(0, i - 2) * du; - tmax = myT1 + Min(Nu - 1, i) * du; + tmin = myT1 + std::max(0, i - 2) * du; + tmax = myT1 + std::min(Nu - 1, i) * du; Standard_Real cmin = AdjustExtr(tmin, tmax, CMin, k + 1, Tol, Standard_True); if (cmin < CMin) { @@ -692,8 +695,8 @@ void BndLib_Box2dCurve::PerformGenCurv(const Standard_Real Tol) else if (CMax - aPnts(i).Coord(k + 1) < d) { Standard_Real tmin, tmax; - tmin = myT1 + Max(0, i - 2) * du; - tmax = myT1 + Min(Nu - 1, i) * du; + tmin = myT1 + std::max(0, i - 2) * du; + tmax = myT1 + std::min(Nu - 1, i) * du; Standard_Real cmax = AdjustExtr(tmin, tmax, CMax, k + 1, Tol, Standard_False); if (cmax > CMax) { diff --git a/src/ModelingData/TKGeomBase/BndLib/BndLib_Add3dCurve.cxx b/src/ModelingData/TKGeomBase/BndLib/BndLib_Add3dCurve.cxx index efa7ff74ff..e34ceae37c 100644 --- a/src/ModelingData/TKGeomBase/BndLib/BndLib_Add3dCurve.cxx +++ b/src/ModelingData/TKGeomBase/BndLib/BndLib_Add3dCurve.cxx @@ -115,7 +115,7 @@ static Standard_Real FillBox(Bnd_Box& B, C.D0(first, P1); B.Add(P1); Standard_Real p = first, dp = last - first, tol = 0.; - if (Abs(dp) > Precision::PConfusion()) + if (std::abs(dp) > Precision::PConfusion()) { Standard_Integer i; dp /= 2 * N; @@ -128,7 +128,7 @@ static Standard_Real FillBox(Bnd_Box& B, C.D0(p, P3); B.Add(P3); gp_Pnt Pc((P1.XYZ() + P3.XYZ()) / 2.0); - tol = Max(tol, Pc.Distance(P2)); + tol = std::max(tol, Pc.Distance(P2)); P1 = P3; } } @@ -190,8 +190,8 @@ void BndLib_Add3dCurve::Add(const Adaptor3d_Curve& C, } case GeomAbs_BSplineCurve: { Handle(Geom_BSplineCurve) Bs = C.BSpline(); - if (Abs(Bs->FirstParameter() - U1) > Precision::Parametric(Tol) - || Abs(Bs->LastParameter() - U2) > Precision::Parametric(Tol)) + if (std::abs(Bs->FirstParameter() - U1) > Precision::Parametric(Tol) + || std::abs(Bs->LastParameter() - U2) > Precision::Parametric(Tol)) { Handle(Geom_Geometry) G = Bs->Copy(); @@ -223,15 +223,15 @@ void BndLib_Add3dCurve::Add(const Adaptor3d_Curve& C, const Standard_Real aPeriod = Bsaux->LastParameter() - Bsaux->FirstParameter(); // Check direct distance between parameters - const Standard_Real aDirectDiff = Abs(u2 - u1); + const Standard_Real aDirectDiff = std::abs(u2 - u1); // Check distances across period boundary (in both directions) - const Standard_Real aCrossPeriodDiff1 = Abs(u2 - aPeriod - u1); - const Standard_Real aCrossPeriodDiff2 = Abs(u1 - aPeriod - u2); + const Standard_Real aCrossPeriodDiff1 = std::abs(u2 - aPeriod - u1); + const Standard_Real aCrossPeriodDiff2 = std::abs(u1 - aPeriod - u2); // Find the minimum difference (closest approach) const Standard_Real aMinDiff = - Min(aDirectDiff, Min(aCrossPeriodDiff1, aCrossPeriodDiff2)); + std::min(aDirectDiff, std::min(aCrossPeriodDiff1, aCrossPeriodDiff2)); if (aMinDiff < aSegmentTol) { @@ -239,9 +239,9 @@ void BndLib_Add3dCurve::Add(const Adaptor3d_Curve& C, } } // For non-periodic curves, just check direct parameter difference - else if (Abs(u2 - u1) < aSegmentTol) + else if (std::abs(u2 - u1) < aSegmentTol) { - aSegmentTol = Abs(u2 - u1) * 0.01; + aSegmentTol = std::abs(u2 - u1) * 0.01; } Bsaux->Segment(u1, u2, aSegmentTol); Bs = Bsaux; @@ -257,7 +257,7 @@ void BndLib_Add3dCurve::Add(const Adaptor3d_Curve& C, for (k = k1 + 1; k <= k2; k++) { last = Knots(k); - tol = Max(FillBox(B1, GACurve, first, last, N), tol); + tol = std::max(FillBox(B1, GACurve, first, last, N), tol); first = last; } if (!B1.IsVoid()) @@ -377,7 +377,7 @@ void BndLib_Add3dCurve::AddGenCurv(const Adaptor3d_Curve& C, { CoordMax[k] = P.Coord(k + 1); } - Standard_Real d = Abs(aD.Coord(k + 1)); + Standard_Real d = std::abs(aD.Coord(k + 1)); if (DeflMax[k] < d) { DeflMax[k] = d; @@ -387,7 +387,7 @@ void BndLib_Add3dCurve::AddGenCurv(const Adaptor3d_Curve& C, } // // Adjusting minmax - Standard_Real eps = Max(Tol, Precision::Confusion()); + Standard_Real eps = std::max(Tol, Precision::Confusion()); for (k = 0; k < 3; ++k) { Standard_Real d = DeflMax[k]; @@ -402,8 +402,8 @@ void BndLib_Add3dCurve::AddGenCurv(const Adaptor3d_Curve& C, if (aPnts(i).Coord(k + 1) - CMin < d) { Standard_Real umin, umax; - umin = UMin + Max(0, i - 2) * du; - umax = UMin + Min(Nu - 1, i) * du; + umin = UMin + std::max(0, i - 2) * du; + umax = UMin + std::min(Nu - 1, i) * du; Standard_Real cmin = AdjustExtr(C, umin, umax, CMin, k + 1, eps, Standard_True); if (cmin < CMin) { @@ -413,8 +413,8 @@ void BndLib_Add3dCurve::AddGenCurv(const Adaptor3d_Curve& C, else if (CMax - aPnts(i).Coord(k + 1) < d) { Standard_Real umin, umax; - umin = UMin + Max(0, i - 2) * du; - umax = UMin + Min(Nu - 1, i) * du; + umin = UMin + std::max(0, i - 2) * du; + umax = UMin + std::min(Nu - 1, i) * du; Standard_Real cmax = AdjustExtr(C, umin, umax, CMax, k + 1, eps, Standard_False); if (cmax > CMax) { @@ -540,10 +540,10 @@ Standard_Real AdjustExtr(const Adaptor3d_Curve& C, Standard_Real aSign = IsMin ? 1. : -1.; Standard_Real extr = aSign * Extr0; // - Standard_Real uTol = Max(C.Resolution(Tol), Precision::PConfusion()); + Standard_Real uTol = std::max(C.Resolution(Tol), Precision::PConfusion()); Standard_Real Du = (C.LastParameter() - C.FirstParameter()); // - Standard_Real reltol = uTol / Max(Abs(UMin), Abs(UMax)); + Standard_Real reltol = uTol / std::max(std::abs(UMin), std::abs(UMax)); if (UMax - UMin < 0.01 * Du) { @@ -557,7 +557,7 @@ Standard_Real AdjustExtr(const Adaptor3d_Curve& C, } } // - Standard_Integer aNbParticles = Max(8, RealToInt(32 * (UMax - UMin) / Du)); + Standard_Integer aNbParticles = std::max(8, RealToInt(32 * (UMax - UMin) / Du)); Standard_Real maxstep = (UMax - UMin) / (aNbParticles + 1); math_Vector aT(1, 1); math_Vector aLowBorder(1, 1); @@ -565,7 +565,7 @@ Standard_Real AdjustExtr(const Adaptor3d_Curve& C, math_Vector aSteps(1, 1); aLowBorder(1) = UMin; aUppBorder(1) = UMax; - aSteps(1) = Min(0.1 * Du, maxstep); + aSteps(1) = std::min(0.1 * Du, maxstep); CurvMaxMinCoordMVar aFunc(C, UMin, UMax, CoordIndx, aSign); math_PSO aFinder(&aFunc, aLowBorder, aUppBorder, aSteps, aNbParticles); @@ -573,7 +573,10 @@ Standard_Real AdjustExtr(const Adaptor3d_Curve& C, // math_BrentMinimum anOptLoc(reltol, 100, uTol); CurvMaxMinCoord aFunc1(C, UMin, UMax, CoordIndx, aSign); - anOptLoc.Perform(aFunc1, Max(aT(1) - aSteps(1), UMin), aT(1), Min(aT(1) + aSteps(1), UMax)); + anOptLoc.Perform(aFunc1, + std::max(aT(1) - aSteps(1), UMin), + aT(1), + std::min(aT(1) + aSteps(1), UMax)); if (anOptLoc.IsDone()) { @@ -601,7 +604,7 @@ Standard_Integer NbSamples(const Adaptor3d_Curve& C, if (du < .9) { N = RealToInt(du * N) + 1; - N = Max(N, 5); + N = std::max(N, 5); } break; } @@ -613,12 +616,12 @@ Standard_Integer NbSamples(const Adaptor3d_Curve& C, if (du < .9) { N = RealToInt(du * N) + 1; - N = Max(N, 5); + N = std::max(N, 5); } break; } default: N = 33; } - return Min(500, N); + return std::min(500, N); } diff --git a/src/ModelingData/TKGeomBase/BndLib/BndLib_AddSurface.cxx b/src/ModelingData/TKGeomBase/BndLib/BndLib_AddSurface.cxx index f20e70d40d..7f6136195a 100644 --- a/src/ModelingData/TKGeomBase/BndLib/BndLib_AddSurface.cxx +++ b/src/ModelingData/TKGeomBase/BndLib/BndLib_AddSurface.cxx @@ -97,7 +97,7 @@ static Standard_Integer NbUSamples(const Adaptor3d_Surface& S) default: N = 33; } - return Min(50, N); + return std::min(50, N); } //================================================================================================= @@ -120,7 +120,7 @@ static Standard_Integer NbVSamples(const Adaptor3d_Surface& S) default: N = 33; } - return Min(50, N); + return std::min(50, N); } // Modified by skv - Fri Aug 27 12:29:04 2004 OCC6503 Begin @@ -225,19 +225,19 @@ void ComputePolesIndexes(const TColStd_Array1OfReal& theKnots, Standard_Integer& theOutMaxIdx) { BSplCLib::Hunt(theKnots, theMin, theOutMinIdx); - theOutMinIdx = Max(theOutMinIdx, theKnots.Lower()); + theOutMinIdx = std::max(theOutMinIdx, theKnots.Lower()); BSplCLib::Hunt(theKnots, theMax, theOutMaxIdx); theOutMaxIdx++; - theOutMaxIdx = Min(theOutMaxIdx, theKnots.Upper()); + theOutMaxIdx = std::min(theOutMaxIdx, theKnots.Upper()); Standard_Integer mult = theMults(theOutMaxIdx); theOutMinIdx = BSplCLib::PoleIndex(theDegree, theOutMinIdx, theIsPeriodic, theMults) + 1; - theOutMinIdx = Max(theOutMinIdx, 1); + theOutMinIdx = std::max(theOutMinIdx, 1); theOutMaxIdx = BSplCLib::PoleIndex(theDegree, theOutMaxIdx, theIsPeriodic, theMults) + 1; theOutMaxIdx += theDegree - mult; if (!theIsPeriodic) - theOutMaxIdx = Min(theOutMaxIdx, theMaxPoleIdx); + theOutMaxIdx = std::min(theOutMaxIdx, theMaxPoleIdx); } // Modified by skv - Fri Aug 27 12:29:04 2004 OCC6503 End @@ -300,9 +300,9 @@ void BndLib_AddSurface::Add(const Adaptor3d_Surface& S, break; } case GeomAbs_Sphere: { - if (Abs(UMin) < Precision::Angular() && Abs(UMax - 2. * M_PI) < Precision::Angular() - && Abs(VMin + M_PI / 2.) < Precision::Angular() - && Abs(VMax - M_PI / 2.) < Precision::Angular()) // a whole sphere + if (std::abs(UMin) < Precision::Angular() && std::abs(UMax - 2. * M_PI) < Precision::Angular() + && std::abs(VMin + M_PI / 2.) < Precision::Angular() + && std::abs(VMax - M_PI / 2.) < Precision::Angular()) // a whole sphere BndLib::Add(S.Sphere(), Tol, B); else BndLib::Add(S.Sphere(), UMin, UMax, VMin, VMax, Tol, B); @@ -329,8 +329,10 @@ void BndLib_AddSurface::Add(const Adaptor3d_Surface& S, // All of poles used for any parameter, // that's why in case of trimmed parameters handled by grid algorithm. - if (Abs(UMin - S.FirstUParameter()) > PTol || Abs(VMin - S.FirstVParameter()) > PTol - || Abs(UMax - S.LastUParameter()) > PTol || Abs(VMax - S.LastVParameter()) > PTol) + if (std::abs(UMin - S.FirstUParameter()) > PTol + || std::abs(VMin - S.FirstVParameter()) > PTol + || std::abs(UMax - S.LastUParameter()) > PTol + || std::abs(VMax - S.LastVParameter()) > PTol) { // Borders not equal to topology borders. isUseConvexHullAlgorithm = Standard_False; @@ -590,7 +592,7 @@ void BndLib_AddSurface::AddGenSurf(const Adaptor3d_Surface& S, { CoordMax[k] = P.Coord(k + 1); } - Standard_Real d = Abs(aD.Coord(k + 1)); + Standard_Real d = std::abs(aD.Coord(k + 1)); if (DeflMax[k] < d) { DeflMax[k] = d; @@ -612,7 +614,7 @@ void BndLib_AddSurface::AddGenSurf(const Adaptor3d_Surface& S, { CoordMax[k] = P.Coord(k + 1); } - Standard_Real d = Abs(aD.Coord(k + 1)); + Standard_Real d = std::abs(aD.Coord(k + 1)); if (DeflMax[k] < d) { DeflMax[k] = d; @@ -623,7 +625,7 @@ void BndLib_AddSurface::AddGenSurf(const Adaptor3d_Surface& S, } // // Adjusting minmax - Standard_Real eps = Max(Tol, Precision::Confusion()); + Standard_Real eps = std::max(Tol, Precision::Confusion()); for (k = 0; k < 3; ++k) { Standard_Real d = DeflMax[k]; @@ -641,10 +643,10 @@ void BndLib_AddSurface::AddGenSurf(const Adaptor3d_Surface& S, if (aPnts(i, j).Coord(k + 1) - CMin < d) { Standard_Real umin, umax, vmin, vmax; - umin = UMin + Max(0, i - 2) * du; - umax = UMin + Min(Nu - 1, i) * du; - vmin = VMin + Max(0, j - 2) * dv; - vmax = VMin + Min(Nv - 1, j) * dv; + umin = UMin + std::max(0, i - 2) * du; + umax = UMin + std::min(Nu - 1, i) * du; + vmin = VMin + std::max(0, j - 2) * dv; + vmax = VMin + std::min(Nv - 1, j) * dv; Standard_Real cmin = AdjustExtr(S, umin, umax, vmin, vmax, CMin, k + 1, eps, Standard_True); if (cmin < CMin) @@ -655,10 +657,10 @@ void BndLib_AddSurface::AddGenSurf(const Adaptor3d_Surface& S, else if (CMax - aPnts(i, j).Coord(k + 1) < d) { Standard_Real umin, umax, vmin, vmax; - umin = UMin + Max(0, i - 2) * du; - umax = UMin + Min(Nu - 1, i) * du; - vmin = VMin + Max(0, j - 2) * dv; - vmax = VMin + Min(Nv - 1, j) * dv; + umin = UMin + std::max(0, i - 2) * du; + umax = UMin + std::min(Nu - 1, i) * du; + vmin = VMin + std::max(0, j - 2) * dv; + vmax = VMin + std::min(Nv - 1, j) * dv; Standard_Real cmax = AdjustExtr(S, umin, umax, vmin, vmax, CMax, k + 1, eps, Standard_False); if (cmax > CMax) @@ -706,15 +708,15 @@ public: Value(X, F1); X(1) = UMax; Value(X, F2); - Standard_Real DU = Abs((F2 - F1) / (UMax - UMin)); + Standard_Real DU = std::abs((F2 - F1) / (UMax - UMin)); X(1) = (UMin + UMax) / 2.; X(2) = VMin; Value(X, F1); X(2) = VMax; Value(X, F2); - Standard_Real DV = Abs((F2 - F1) / (VMax - VMin)); - myPenalty = 10. * Max(DU, DV); - myPenalty = Max(myPenalty, 1.); + Standard_Real DV = std::abs((F2 - F1) / (VMax - VMin)); + myPenalty = 10. * std::max(DU, DV); + myPenalty = std::max(myPenalty, 1.); } Standard_Boolean Value(const math_Vector& X, Standard_Real& F) @@ -802,9 +804,9 @@ Standard_Real AdjustExtr(const Adaptor3d_Surface& S, Standard_Real aSign = IsMin ? 1. : -1.; Standard_Real extr = aSign * Extr0; Standard_Real relTol = 2. * Tol; - if (Abs(extr) > Tol) + if (std::abs(extr) > Tol) { - relTol /= Abs(extr); + relTol /= std::abs(extr); } Standard_Real Du = (S.LastUParameter() - S.FirstUParameter()); Standard_Real Dv = (S.LastVParameter() - S.FirstVParameter()); @@ -818,13 +820,13 @@ Standard_Real AdjustExtr(const Adaptor3d_Surface& S, aLowBorder(2) = VMin; aUppBorder(2) = VMax; - Standard_Integer aNbU = Max(8, RealToInt(32 * (UMax - UMin) / Du)); - Standard_Integer aNbV = Max(8, RealToInt(32 * (VMax - VMin) / Dv)); + Standard_Integer aNbU = std::max(8, RealToInt(32 * (UMax - UMin) / Du)); + Standard_Integer aNbV = std::max(8, RealToInt(32 * (VMax - VMin) / Dv)); Standard_Integer aNbParticles = aNbU * aNbV; Standard_Real aMaxUStep = (UMax - UMin) / (aNbU + 1); - aSteps(1) = Min(0.1 * Du, aMaxUStep); + aSteps(1) = std::min(0.1 * Du, aMaxUStep); Standard_Real aMaxVStep = (VMax - VMin) / (aNbV + 1); - aSteps(2) = Min(0.1 * Dv, aMaxVStep); + aSteps(2) = std::min(0.1 * Dv, aMaxVStep); SurfMaxMinCoord aFunc(S, UMin, UMax, VMin, VMax, CoordIndx, aSign); math_PSO aFinder(&aFunc, aLowBorder, aUppBorder, aSteps, aNbParticles); @@ -867,7 +869,7 @@ Standard_Integer NbUSamples(const Adaptor3d_Surface& S, if (du < .9) { N = RealToInt(du * N) + 1; - N = Max(N, 5); + N = std::max(N, 5); } break; } @@ -880,14 +882,14 @@ Standard_Integer NbUSamples(const Adaptor3d_Surface& S, if (du < .9) { N = RealToInt(du * N) + 1; - N = Max(N, 5); + N = std::max(N, 5); } break; } default: N = 33; } - return Min(50, N); + return std::min(50, N); } //================================================================================================= @@ -907,7 +909,7 @@ Standard_Integer NbVSamples(const Adaptor3d_Surface& S, if (dv < .9) { N = RealToInt(dv * N) + 1; - N = Max(N, 5); + N = std::max(N, 5); } break; } @@ -920,12 +922,12 @@ Standard_Integer NbVSamples(const Adaptor3d_Surface& S, if (dv < .9) { N = RealToInt(dv * N) + 1; - N = Max(N, 5); + N = std::max(N, 5); } break; } default: N = 33; } - return Min(50, N); + return std::min(50, N); } diff --git a/src/ModelingData/TKGeomBase/CPnts/CPnts_AbscissaPoint.cxx b/src/ModelingData/TKGeomBase/CPnts/CPnts_AbscissaPoint.cxx index 36f14bf74b..15bc984c29 100644 --- a/src/ModelingData/TKGeomBase/CPnts/CPnts_AbscissaPoint.cxx +++ b/src/ModelingData/TKGeomBase/CPnts/CPnts_AbscissaPoint.cxx @@ -66,10 +66,10 @@ static Standard_Integer order(const Adaptor3d_Curve& C) return 5; case GeomAbs_BezierCurve: - return Min(24, 2 * C.Degree()); + return std::min(24, 2 * C.Degree()); case GeomAbs_BSplineCurve: - return Min(24, 2 * C.NbPoles() - 1); + return std::min(24, 2 * C.NbPoles() - 1); default: return 10; @@ -88,10 +88,10 @@ static Standard_Integer order(const Adaptor2d_Curve2d& C) return 5; case GeomAbs_BezierCurve: - return Min(24, 2 * C.Bezier()->Degree()); + return std::min(24, 2 * C.Bezier()->Degree()); case GeomAbs_BSplineCurve: - return Min(24, 2 * C.BSpline()->NbPoles() - 1); + return std::min(24, 2 * C.BSpline()->NbPoles() - 1); default: return 10; @@ -142,7 +142,7 @@ Standard_Real CPnts_AbscissaPoint::Length(const Adaptor3d_Curve& C, { throw Standard_ConstructionError(); } - return Abs(TheLength.Value()); + return std::abs(TheLength.Value()); } //================================================================================================= @@ -161,7 +161,7 @@ Standard_Real CPnts_AbscissaPoint::Length(const Adaptor2d_Curve2d& C, { throw Standard_ConstructionError(); } - return Abs(TheLength.Value()); + return std::abs(TheLength.Value()); } //======================================================================= @@ -184,7 +184,7 @@ Standard_Real CPnts_AbscissaPoint::Length(const Adaptor3d_Curve& C, { throw Standard_ConstructionError(); } - return Abs(TheLength.Value()); + return std::abs(TheLength.Value()); } //======================================================================= @@ -207,7 +207,7 @@ Standard_Real CPnts_AbscissaPoint::Length(const Adaptor2d_Curve2d& C, { throw Standard_ConstructionError(); } - return Abs(TheLength.Value()); + return std::abs(TheLength.Value()); } //================================================================================================= @@ -311,8 +311,8 @@ void CPnts_AbscissaPoint::Init(const Adaptor3d_Curve& C, myF.Init(rf, (Standard_Address)&C, order(C)); // myF.Init(f3d,(Standard_Address)&C,order(C)); myL = CPnts_AbscissaPoint::Length(C, U1, U2); - myUMin = Min(U1, U2); - myUMax = Max(U1, U2); + myUMin = std::min(U1, U2); + myUMax = std::max(U1, U2); Standard_Real DU = myUMax - myUMin; myUMin = myUMin - DU; myUMax = myUMax + DU; @@ -329,8 +329,8 @@ void CPnts_AbscissaPoint::Init(const Adaptor2d_Curve2d& C, myF.Init(rf, (Standard_Address)&C, order(C)); // myF.Init(f2d,(Standard_Address)&C,order(C)); myL = CPnts_AbscissaPoint::Length(C, U1, U2); - myUMin = Min(U1, U2); - myUMax = Max(U1, U2); + myUMin = std::min(U1, U2); + myUMax = std::max(U1, U2); Standard_Real DU = myUMax - myUMin; myUMin = myUMin - DU; myUMax = myUMax + DU; @@ -351,8 +351,8 @@ void CPnts_AbscissaPoint::Init(const Adaptor3d_Curve& C, myF.Init(rf, (Standard_Address)&C, order(C)); // myF.Init(f3d,(Standard_Address)&C,order(C)); myL = CPnts_AbscissaPoint::Length(C, U1, U2, Tol); - myUMin = Min(U1, U2); - myUMax = Max(U1, U2); + myUMin = std::min(U1, U2); + myUMax = std::max(U1, U2); Standard_Real DU = myUMax - myUMin; myUMin = myUMin - DU; myUMax = myUMax + DU; @@ -370,8 +370,8 @@ void CPnts_AbscissaPoint::Init(const Adaptor2d_Curve2d& C, myF.Init(rf, (Standard_Address)&C, order(C)); // myF.Init(f2d,(Standard_Address)&C,order(C)); myL = CPnts_AbscissaPoint::Length(C, U1, U2, Tol); - myUMin = Min(U1, U2); - myUMax = Max(U1, U2); + myUMin = std::min(U1, U2); + myUMax = std::max(U1, U2); Standard_Real DU = myUMax - myUMin; myUMin = myUMin - DU; myUMax = myUMax + DU; @@ -428,7 +428,7 @@ void CPnts_AbscissaPoint::Perform(const Standard_Real Abscissa, // if (Solution.IsDone()) { // Standard_Real D; // myF.Derivative(Solution.Root(),D); - // if (Abs(Solution.Value()) < Resolution * D) { + // if (std::abs(Solution.Value()) < Resolution * D) { // myDone = Standard_True; // myParam = Solution.Root(); // } @@ -470,7 +470,7 @@ void CPnts_AbscissaPoint::AdvPerform(const Standard_Real Abscissa, // if (Solution.IsDone()) { // Standard_Real D; // myF.Derivative(Solution.Root(),D); - // if (Abs(Solution.Value()) < Resolution * D) { + // if (std::abs(Solution.Value()) < Resolution * D) { // myDone = Standard_True; // myParam = Solution.Root(); // } diff --git a/src/ModelingData/TKGeomBase/CPnts/CPnts_UniformDeflection.cxx b/src/ModelingData/TKGeomBase/CPnts/CPnts_UniformDeflection.cxx index 2e83ada051..0a2b54b76c 100644 --- a/src/ModelingData/TKGeomBase/CPnts/CPnts_UniformDeflection.cxx +++ b/src/ModelingData/TKGeomBase/CPnts/CPnts_UniformDeflection.cxx @@ -114,7 +114,7 @@ void CPnts_UniformDeflection::Perform() if (NormD1 < myTolCur || V2.Magnitude() < myTolCur) { // singularity on the tangent or null curvature - myDu = Min(myDwmax, 1.5 * myDu); + myDu = std::min(myDwmax, 1.5 * myDu); } else { @@ -122,19 +122,19 @@ void CPnts_UniformDeflection::Perform() if (NormD2 / NormD1 < myDeflection) { // collinearity of derivatives - myDu = Min(myDwmax, 1.5 * myDu); + myDu = std::min(myDwmax, 1.5 * myDu); } else { - myDu = Sqrt(8. * myDeflection * NormD1 / NormD2); - myDu = Min(Max(myDu, myTolCur), myDwmax); + myDu = std::sqrt(8. * myDeflection * NormD1 / NormD2); + myDu = std::min(std::max(myDu, myTolCur), myDwmax); } } // check if the arrow is observed if WithControl if (myControl) { - myDu = Min(myDu, myLastParam - myFirstParam); + myDu = std::min(myDu, myLastParam - myFirstParam); if (my3d) { D03d(myCurve, myFirstParam + myDu, P); @@ -157,14 +157,14 @@ void CPnts_UniformDeflection::Perform() // from the others) this test does not work on the points of inflexion if (NormD2 > myDeflection / 5.0) { - NormD2 = Max(NormD2, 1.1 * myDeflection); - myDu = myDu * Sqrt(myDeflection / NormD2); - myDu = Min(Max(myDu, myTolCur), myDwmax); + NormD2 = std::max(NormD2, 1.1 * myDeflection); + myDu = myDu * std::sqrt(myDeflection / NormD2); + myDu = std::min(std::max(myDu, myTolCur), myDwmax); } } } myFirstParam += myDu; - myFinish = myLastParam - myFirstParam < myTolCur || Abs(myDu) < myTolCur || + myFinish = myLastParam - myFirstParam < myTolCur || std::abs(myDu) < myTolCur || // to avoid less than double precision endless increment myDu < anEspilon; } diff --git a/src/ModelingData/TKGeomBase/CPnts/CPnts_UniformDeflection.hxx b/src/ModelingData/TKGeomBase/CPnts/CPnts_UniformDeflection.hxx index c830301740..85d5c18e12 100644 --- a/src/ModelingData/TKGeomBase/CPnts/CPnts_UniformDeflection.hxx +++ b/src/ModelingData/TKGeomBase/CPnts/CPnts_UniformDeflection.hxx @@ -68,7 +68,7 @@ public: //! deflection //! when the curve is singular at the point P(u),the algorithm //! computes the next point as - //! P(u + Max(CurrentStep,Abs(LastParameter-FirstParameter))) + //! P(u + std::max(CurrentStep,std::abs(LastParameter-FirstParameter))) //! if the singularity is at the first point ,the next point //! calculated is the P(LastParameter) Standard_EXPORT CPnts_UniformDeflection(const Adaptor3d_Curve& C, diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_Curve2dTool.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_Curve2dTool.cxx index 87455851bb..d2fca729a8 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_Curve2dTool.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_Curve2dTool.cxx @@ -49,7 +49,7 @@ Handle(TColStd_HArray1OfReal) Extrema_Curve2dTool::DeflCurvIntervals(const Adapt return Intervals; } // - Standard_Real aDefl = Max(0.01 * L / (2. * M_PI), mindefl); + Standard_Real aDefl = std::max(0.01 * L / (2. * M_PI), mindefl); if (aDefl > maxdefl) { nbpnts = 2; @@ -58,8 +58,8 @@ Handle(TColStd_HArray1OfReal) Extrema_Curve2dTool::DeflCurvIntervals(const Adapt Intervals->SetValue(nbpnts, tl); return Intervals; } - Standard_Real aMinLen = Max(.00001 * L, Precision::Confusion()); - Standard_Real aTol = Max(0.00001 * (tl - tf), Precision::PConfusion()); + Standard_Real aMinLen = std::max(.00001 * L, Precision::Confusion()); + Standard_Real aTol = std::max(0.00001 * (tl - tf), Precision::PConfusion()); GCPnts_TangentialDeflection aPntGen(C, M_PI / 6, aDefl, 2, aTol, aMinLen); nbpnts = aPntGen.NbPoints(); Intervals = new TColStd_HArray1OfReal(1, nbpnts); diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_CurveLocator.gxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_CurveLocator.gxx index 3c6a5c4eec..c3b54be8fe 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_CurveLocator.gxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_CurveLocator.gxx @@ -77,10 +77,10 @@ void Extrema_CurveLocator::Locate(const Pnt& P, Standard_Real Uinf = Tool1::FirstParameter(C); Standard_Real Ulast = Tool1::LastParameter(C); - U1 = Min(Uinf, Ulast); - U2 = Max(Uinf, Ulast); - U11 = Min(Umin, Usup); - U12 = Max(Umin, Usup); + U1 = std::min(Uinf, Ulast); + U2 = std::max(Uinf, Ulast); + U11 = std::min(Umin, Usup); + U12 = std::max(Umin, Usup); if (U11 < U1 - RealEpsilon()) U11 = U1; diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_CurveTool.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_CurveTool.cxx index c774cd3206..a67027e775 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_CurveTool.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_CurveTool.cxx @@ -62,7 +62,7 @@ Handle(TColStd_HArray1OfReal) Extrema_CurveTool::DeflCurvIntervals(const Adaptor return Intervals; } // - Standard_Real aDefl = Max(0.01 * L / (2. * M_PI), mindefl); + Standard_Real aDefl = std::max(0.01 * L / (2. * M_PI), mindefl); if (aDefl > maxdefl) { nbpnts = 2; @@ -72,8 +72,8 @@ Handle(TColStd_HArray1OfReal) Extrema_CurveTool::DeflCurvIntervals(const Adaptor return Intervals; } // - Standard_Real aMinLen = Max(.00001 * L, Precision::Confusion()); - Standard_Real aTol = Max(0.00001 * (tl - tf), Precision::PConfusion()); + Standard_Real aMinLen = std::max(.00001 * L, Precision::Confusion()); + Standard_Real aTol = std::max(0.00001 * (tl - tf), Precision::PConfusion()); // GCPnts_TangentialDeflection aPntGen(C, M_PI / 6, aDefl, 2, aTol, aMinLen); nbpnts = aPntGen.NbPoints(); diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtCC.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtCC.cxx index 907876414c..71bd53ee96 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtCC.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtCC.cxx @@ -179,7 +179,7 @@ void Extrema_ExtCC::Perform() { Standard_NullObject_Raise_if(!myC[0] || !myC[1], "Extrema_ExtCC::Perform()") myECC.SetParams(*myC[0], *myC[1], myInf[0], mySup[0], myInf[1], mySup[1]); - myECC.SetTolerance(Min(myTol[0], myTol[1])); + myECC.SetTolerance(std::min(myTol[0], myTol[1])); myECC.SetSingleSolutionFlag(GetSingleSolutionFlag()); myDone = Standard_False; mypoints.Clear(); @@ -188,7 +188,7 @@ void Extrema_ExtCC::Perform() GeomAbs_CurveType type1 = myC[0]->GetType(); GeomAbs_CurveType type2 = myC[1]->GetType(); - Standard_Real U11, U12, U21, U22, Tol = Min(myTol[0], myTol[1]); + Standard_Real U11, U12, U21, U22, Tol = std::min(myTol[0], myTol[1]); U11 = myInf[0]; U12 = mySup[0]; @@ -575,7 +575,7 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11, // Precision of the calculation depends on circles radii const Standard_Real aPrecision = - Max(Epsilon(myC[0]->Circle().Radius()), Epsilon(myC[1]->Circle().Radius())); + std::max(Epsilon(myC[0]->Circle().Radius()), Epsilon(myC[1]->Circle().Radius())); // Project arc of the 1st circle between points theUt11 and theUt12 to the // 2nd circle. It is necessary to chose correct arc from two possible ones. @@ -653,7 +653,7 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11, Standard_Real aMinSqD = ExtPCir.SquareDistance(1); for (Standard_Integer anExtID = 2; anExtID <= ExtPCir.NbExt(); anExtID++) { - aMinSqD = Min(aMinSqD, ExtPCir.SquareDistance(anExtID)); + aMinSqD = std::min(aMinSqD, ExtPCir.SquareDistance(anExtID)); } if (aMinSqD <= aMinSquareDist + (1. + aMinSqD) * aPrecision) @@ -663,7 +663,7 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11, myIsParallel = Standard_True; const Standard_Real aDeltaSqDist = aMinSqD - theSqDist; - const Standard_Real aSqD = Max(aMinSqD, theSqDist); + const Standard_Real aSqD = std::max(aMinSqD, theSqDist); // 0 <= Dist1-Dist2 <= Eps // 0 <= Dist1^2 - Dist2^2 < Eps*(Dist1+Dist2) @@ -731,7 +731,7 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11, mypoints.Append(ExtPCir.Point(anExtID)); mypoints.Append(aP2); mySqDist.Append(ExtPCir.SquareDistance(anExtID)); - aMinSquareDist = Min(aMinSquareDist, ExtPCir.SquareDistance(anExtID)); + aMinSquareDist = std::min(aMinSquareDist, ExtPCir.SquareDistance(anExtID)); } } } @@ -784,7 +784,7 @@ void Extrema_ExtCC::PrepareParallelResult(const Standard_Real theUt11, mypoints.Append(aP1); mypoints.Append(aP2); mySqDist.Append(aDmin); - aMinSquareDist = Min(aMinSquareDist, aDmin); + aMinSquareDist = std::min(aMinSquareDist, aDmin); } } aProjRng1.Shift(M_PI); diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtCC2d.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtCC2d.cxx index 3b7bef5b9d..b146f163a3 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtCC2d.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtCC2d.cxx @@ -96,7 +96,7 @@ void Extrema_ExtCC2d::Perform(const Adaptor2d_Curve2d& C1, mySqDist.Clear(); GeomAbs_CurveType type1 = Extrema_Curve2dTool::GetType(C1), type2 = Extrema_Curve2dTool::GetType(*myC); - Standard_Real U11, U12, U21, U22, Tol = Min(mytolc1, mytolc2); + Standard_Real U11, U12, U21, U22, Tol = std::min(mytolc1, mytolc2); // Extrema_POnCurv2d P1, P2; mynbext = 0; inverse = Standard_False; diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtCS.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtCS.cxx index 17b5859cd9..b507529510 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtCS.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtCS.cxx @@ -188,11 +188,11 @@ void Extrema_ExtCS::Perform(const Adaptor3d_Curve& C, for (i = 0; i <= 7; i++) { aParOnLin = ElCLib::Parameter(aLin, aLimPntArray[i]); - tmin = Min(aParOnLin, tmin); - tmax = Max(aParOnLin, tmax); + tmin = std::min(aParOnLin, tmin); + tmax = std::max(aParOnLin, tmax); } - cfirst = Max(cfirst, tmin); - clast = Min(clast, tmax); + cfirst = std::max(cfirst, tmin); + clast = std::min(clast, tmax); } if (myS->IsUPeriodic()) @@ -370,7 +370,7 @@ void Extrema_ExtCS::Perform(const Adaptor3d_Curve& C, { Standard_Real aDiff = aDist[0] - aDist[1]; // Both computed -> take only minimal - if (Abs(aDiff) < Precision::Confusion()) + if (std::abs(aDiff) < Precision::Confusion()) // Add both bAdd[0] = bAdd[1] = Standard_True; else if (aDiff < 0) @@ -403,8 +403,8 @@ void Extrema_ExtCS::Perform(const Adaptor3d_Curve& C, Ext.Initialize(*myS, NbU, NbV, mytolS); if (myCtype == GeomAbs_Hyperbola) { - Standard_Real tmin = Max(-20., C.FirstParameter()); - Standard_Real tmax = Min(20., C.LastParameter()); + Standard_Real tmin = std::max(-20., C.FirstParameter()); + Standard_Real tmax = std::min(20., C.LastParameter()); Ext.Perform(C, NbT, tmin, tmax, mytolC); // to avoid overflow } else @@ -583,7 +583,7 @@ Standard_Boolean Extrema_ExtCS::AddSolution(const Adaptor3d_Curve& theCurve, Standard_Real Tj = aPC.Parameter(); Standard_Real Uj, Vj; aPS.Parameter(Uj, Vj); - if (Abs(T - Tj) <= mytolC && Abs(U - Uj) <= mytolS && Abs(V - Vj) <= mytolS) + if (std::abs(T - Tj) <= mytolC && std::abs(U - Uj) <= mytolS && std::abs(V - Vj) <= mytolS) { IsNewSolution = Standard_False; break; diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtElC.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtElC.cxx index a5e7e5921c..48d5341686 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtElC.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtElC.cxx @@ -74,11 +74,11 @@ public: PIpPI = M_PI + M_PI; for (Standard_Integer i = 0; i < NbRoots; i++) { - if (Abs(u - Roots[i]) <= aEps) + if (std::abs(u - Roots[i]) <= aEps) { return Standard_True; } - if (Abs(u - Roots[i] - PIpPI) <= aEps) + if (std::abs(u - Roots[i] - PIpPI) <= aEps) { return Standard_True; } @@ -173,11 +173,11 @@ ExtremaExtElC_TrigonometricRoots::ExtremaExtElC_TrigonometricRoots(const Standar } // //-- La recherche directe donne n importe quoi. - aMaxCoef = Max(CC, SC); - aMaxCoef = Max(aMaxCoef, C); - aMaxCoef = Max(aMaxCoef, S); - aMaxCoef = Max(aMaxCoef, Cte); - aPrecision = Max(1.e-8, 1.e-12 * aMaxCoef); + aMaxCoef = std::max(CC, SC); + aMaxCoef = std::max(aMaxCoef, C); + aMaxCoef = std::max(aMaxCoef, S); + aMaxCoef = std::max(aMaxCoef, Cte); + aPrecision = std::max(1.e-8, 1.e-12 * aMaxCoef); SvNbRoots = NbRoots; for (i = 0; i < SvNbRoots; ++i) @@ -187,7 +187,7 @@ ExtremaExtElC_TrigonometricRoots::ExtremaExtElC_TrigonometricRoots(const Standar Standard_Real si = sin(Roots[i]); y = co * (CC * co + (SC + SC) * si + C) + S * si + Cte; // modified by OCC Tue Oct 3 18:43:00 2006 - if (Abs(y) > aPrecision) + if (std::abs(y) > aPrecision) { NbRoots--; Roots[i] = 1000.0; @@ -214,9 +214,9 @@ ExtremaExtElC_TrigonometricRoots::ExtremaExtElC_TrigonometricRoots(const Standar infinite_roots = Standard_False; if (NbRoots == 0) { //--!!!!! Detect case Pol = Cte ( 1e-50 ) !!!! - if ((Abs(CC) + Abs(SC) + Abs(C) + Abs(S)) < 1e-10) + if ((std::abs(CC) + std::abs(SC) + std::abs(C) + std::abs(S)) < 1e-10) { - if (Abs(Cte) < 1e-10) + if (std::abs(Cte) < 1e-10) { infinite_roots = Standard_True; } @@ -227,23 +227,23 @@ ExtremaExtElC_TrigonometricRoots::ExtremaExtElC_TrigonometricRoots(const Standar else { // try to set very small coefficients to ZERO - if (Abs(CC) < 1e-10) + if (std::abs(CC) < 1e-10) { cc = 0.0; } - if (Abs(SC) < 1e-10) + if (std::abs(SC) < 1e-10) { sc = 0.0; } - if (Abs(C) < 1e-10) + if (std::abs(C) < 1e-10) { c = 0.0; } - if (Abs(S) < 1e-10) + if (std::abs(S) < 1e-10) { s = 0.0; } - if (Abs(Cte) < 1e-10) + if (std::abs(Cte) < 1e-10) { cte = 0.0; } @@ -364,7 +364,7 @@ Standard_Boolean Extrema_ExtElC::PlanarLineCircleExtrema(const gp_Lin& theLin, { const gp_Dir &aDirC = theCirc.Axis().Direction(), &aDirL = theLin.Direction(); - if (Abs(aDirC.Dot(aDirL)) > Precision::Angular()) + if (std::abs(aDirC.Dot(aDirL)) > Precision::Angular()) return Standard_False; // The line is in the circle-plane completely @@ -455,7 +455,7 @@ Standard_Boolean Extrema_ExtElC::PlanarLineCircleExtrema(const gp_Lin& theLin, // <=> (((P2O2+O2O1).D)D+O1O2).T = 0. // <=> ((P2O2.D)(D.T)+((O2O1.D)D-O2O1).T = 0. // We are in the reference of the circle; let: -// Cos = Cos(u2) and Sin = Sin(u2), +// Cos = std::cos(u2) and Sin = std::sin(u2), // P2 (R*Cos,R*Sin,0.), // T (-R*Sin,R*Cos,0.), // D (Dx,Dy,Dz), @@ -644,7 +644,7 @@ Extrema_ExtElC::Extrema_ExtElC(const gp_Lin& C1, const gp_Elips& C2) <=> (((P2O2+O2O1).D)D+O1O2).T = 0. <=> ((P2O2.D)(D.T)+((O2O1.D)D-O2O1).T = 0. We are in the reference of the ellipse; let: - Cos = Cos(u2) and Sin = Sin(u2), + Cos = std::cos(u2) and Sin = std::sin(u2), P2 (MajR*Cos,MinR*Sin,0.), T (-MajR*Sin,MinR*Cos,0.), D (Dx,Dy,Dz), @@ -835,7 +835,7 @@ Extrema_ExtElC::Extrema_ExtElC(const gp_Lin& C1, const gp_Hypr& C2) v = Sol.Value(NoSol); if (v > 0.0) { - U2 = Log(v); + U2 = std::log(v); P2 = ElCLib::Value(U2, C2); U1 = (gp_Vec(O1, P2)).Dot(D1); P1 = ElCLib::Value(U1, C1); @@ -1073,9 +1073,7 @@ Extrema_ExtElC::Extrema_ExtElC(const gp_Circ& C1, const gp_Circ& C2) { // see pkv/900/L4 for details aVal = -aVal; } - aBeta = Sqrt(aVal); - // aBeta=Sqrt(aR1*aR1-aAlpha*aAlpha); - //-- + aBeta = std::sqrt(aVal); aPt.SetXYZ(aPc1.XYZ() + aAlpha * aDir12.XYZ()); // aDLt = aDc1 ^ aDir12; diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtElC2d.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtElC2d.cxx index fa0647111f..205aaf01f9 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtElC2d.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtElC2d.cxx @@ -134,12 +134,12 @@ Method: gp_Pnt2d O1 = C1.Location(); gp_Pnt2d P1, P2; - if (Abs(Dy) <= RealEpsilon()) + if (std::abs(Dy) <= RealEpsilon()) { teta[0] = M_PI / 2.0; } else - teta[0] = ATan(-Dx / Dy); + teta[0] = std::atan(-Dx / Dy); teta[1] = teta[0] + M_PI; if (teta[0] < 0.0) teta[0] = teta[0] + 2.0 * M_PI; @@ -185,12 +185,12 @@ Extrema_ExtElC2d::Extrema_ExtElC2d(const gp_Lin2d& C1, const gp_Elips2d& C2) Standard_Real U1, teta[2], r1 = C2.MajorRadius(), r2 = C2.MinorRadius(); gp_Pnt2d O1 = C1.Location(), P1, P2; - if (Abs(Dy) <= RealEpsilon()) + if (std::abs(Dy) <= RealEpsilon()) { teta[0] = M_PI / 2.0; } else - teta[0] = ATan(-Dx * r2 / (Dy * r1)); + teta[0] = std::atan(-Dx * r2 / (Dy * r1)); teta[1] = teta[0] + M_PI; if (teta[0] < 0.0) @@ -235,16 +235,16 @@ Extrema_ExtElC2d::Extrema_ExtElC2d(const gp_Lin2d& C1, const gp_Hypr2d& C2) Standard_Real U1, v2, U2 = 0, R = C2.MajorRadius(), r = C2.MinorRadius(); gp_Pnt2d P1, P2; - if (Abs(Dy) < RealEpsilon()) + if (std::abs(Dy) < RealEpsilon()) { return; } - if (Abs(R - r * Dx / Dy) < RealEpsilon()) + if (std::abs(R - r * Dx / Dy) < RealEpsilon()) return; v2 = (R + r * Dx / Dy) / (R - r * Dx / Dy); if (v2 > 0.0) - U2 = Log(Sqrt(v2)); + U2 = std::log(std::sqrt(v2)); P2 = ElCLib::Value(U2, C2); U1 = (gp_Vec2d(C1.Location(), P2)).Dot(D); @@ -278,7 +278,7 @@ Extrema_ExtElC2d::Extrema_ExtElC2d(const gp_Lin2d& C1, const gp_Parab2d& C2) Standard_Real U1, U2, P = C2.Parameter(); gp_Pnt2d P1, P2; - if (Abs(Dy) < RealEpsilon()) + if (std::abs(Dy) < RealEpsilon()) { return; } @@ -327,7 +327,7 @@ Extrema_ExtElC2d::Extrema_ExtElC2d(const gp_Circ2d& C1, const gp_Circ2d& C2) Standard_Real r1 = C1.Radius(), r2 = C2.Radius(); Standard_Real Usol2[2], Usol1[2]; gp_Pnt2d P1[2], P2[2]; - gp_Vec2d O1O2(DO1O2 / Sqrt(aSqDCenters)); + gp_Vec2d O1O2(DO1O2 / std::sqrt(aSqDCenters)); P1[0] = O1.Translated(r1 * O1O2); Usol1[0] = ElCLib::Parameter(C1, P1[0]); diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtElCS.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtElCS.cxx index 5a657c5150..06a7ebe330 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtElCS.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtElCS.cxx @@ -733,9 +733,9 @@ void Extrema_ExtElCS::Perform(const gp_Hypr& C, const gp_Pln& S) Standard_Real A = C.MinorRadius() * (NPln.Dot(YDir)); Standard_Real B = C.MajorRadius() * (NPln.Dot(XDir)); - if (Abs(B) > Abs(A)) + if (std::abs(B) > std::abs(A)) { - Standard_Real T = -0.5 * Log((A + B) / (B - A)); + Standard_Real T = -0.5 * std::log((A + B) / (B - A)); gp_Pnt Ph = ElCLib::HyperbolaValue(T, Pos, C.MajorRadius(), C.MinorRadius()); Extrema_POnCurv PC(T, Ph); myPoint1 = new Extrema_HArray1OfPOnCurv(1, 1); diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPElC.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPElC.cxx index b36a40ab1d..9924362f60 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPElC.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPElC.cxx @@ -235,17 +235,16 @@ Method: Standard_Real OPpMagn = OPp.Magnitude(); if (OPpMagn < Tol) { - if (Abs(A - B) < Tol) + if (std::abs(A - B) < Tol) { return; } } Standard_Real X = OPp.Dot(gp_Vec(C.XAxis().Direction())); Standard_Real Y = OPp.Dot(gp_Vec(C.YAxis().Direction())); - // Standard_Real Y = Sqrt(OPpMagn*OPpMagn-X*X); Standard_Real ko2 = (B * B - A * A) / 2., ko3 = -B * Y, ko4 = A * X; - if (Abs(ko3) < 1.e-16 * Max(Abs(ko2), Abs(ko3))) + if (std::abs(ko3) < 1.e-16 * std::max(std::abs(ko2), std::abs(ko3))) ko3 = 0.0; // math_TrigonometricFunctionRoots Sol(0.,(B*B-A*A)/2.,-B*Y,A*X,0.,Uinf,Usup); @@ -300,7 +299,7 @@ Method: Let Pp, le point projete; on recherche les valeurs u telles que: (C(u)-Pp).C'(u) = 0. (1) Let R and r be the radiuses of the hyperbola, - Chu = Cosh(u) and Shu = Sinh(u), + Chu = std::cosh(u) and Shu = std::sinh(u), C(u) = (R*Chu,r*Shu) and Pp = (X,Y); Then, (1) <=> (R*Chu-X,r*Shu-Y).(R*Shu,r*Chu) = 0. (R**2+r**2)*Chu*Shu - X*R*Shu - Y*r*Chu = 0. (2) @@ -352,7 +351,7 @@ Method: Vs = Sol.Value(NoSol); if (Vs > 0.) { - Us = Log(Vs); + Us = std::log(Vs); if ((Us >= Uinf) && (Us <= Usup)) { Cu = ElCLib::Value(Us, C); @@ -427,10 +426,9 @@ Method: // 2- Calculation of solutions ... - Standard_Real F = C.Focal(); - gp_Vec OPp(O, Pp); - Standard_Real X = OPp.Dot(gp_Vec(C.XAxis().Direction())); - // Standard_Real Y = Sqrt(OPpMagn*OPpMagn-X*X); + Standard_Real F = C.Focal(); + gp_Vec OPp(O, Pp); + Standard_Real X = OPp.Dot(gp_Vec(C.XAxis().Direction())); Standard_Real Y = OPp.Dot(gp_Vec(C.YAxis().Direction())); math_DirectPolynomialRoots Sol(1. / (4. * F), 0., 2. * F - X, -2. * F * Y); if (!Sol.IsDone()) diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPElC2d.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPElC2d.cxx index 29b2e5b096..b72b30638e 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPElC2d.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPElC2d.cxx @@ -181,7 +181,7 @@ void Extrema_ExtPElC2d::Perform(const gp_Pnt2d& P, Standard_Real B = E.MinorRadius(); gp_Vec2d V(OR, P); - if (OR.IsEqual(P, Precision::Confusion()) && (Abs(A - B) <= Tol)) + if (OR.IsEqual(P, Precision::Confusion()) && (std::abs(A - B) <= Tol)) { return; } @@ -257,7 +257,7 @@ void Extrema_ExtPElC2d::Perform(const gp_Pnt2d& P, Vs = Sol.Value(NoSol); if (Vs > 0.) { - Us = Log(Vs); + Us = std::log(Vs); if ((Us >= Uinf) && (Us <= Usup)) { Cu = ElCLib::Value(Us, H); diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPElS.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPElS.cxx index 41102ec6dc..73d7a05444 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPElS.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPElS.cxx @@ -157,7 +157,7 @@ void Extrema_ExtPElS::Perform(const gp_Pnt& P, const gp_Cone& S, const Standard_ gp_Vec MP(M, P); Standard_Real L2 = MP.SquareMagnitude(); - Standard_Real Vm = -(S.RefRadius() / Sin(A)); + Standard_Real Vm = -(S.RefRadius() / std::sin(A)); // Case when P is mixed with S ... if (L2 < Tol * Tol) @@ -204,7 +204,7 @@ void Extrema_ExtPElS::Perform(const gp_Pnt& P, const gp_Cone& S, const Standard_ U2 -= 2. * M_PI; } Standard_Real B = MP.Angle(DirZ); - A = Abs(A); + A = std::abs(A); Standard_Real L = sqrt(L2); if (!Same) { diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPExtS.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPExtS.cxx index b140703ce5..7c2b82549e 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPExtS.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPExtS.cxx @@ -377,7 +377,7 @@ void Extrema_ExtPExtS::Perform(const gp_Pnt& P) { // Additional checking solution: FSR sometimes is wrong // when starting point is far from solution. - Standard_Real dist = Sqrt(myF.SquareDistance(k)); + Standard_Real dist = std::sqrt(myF.SquareDistance(k)); math_Vector Vals(1, 2); const Extrema_POnSurf& PonS = myF.Point(k); Standard_Real u, v; @@ -389,8 +389,8 @@ void Extrema_ExtPExtS::Perform(const gp_Pnt& P) myS->D1(u, v, Pe, du, dv); Standard_Real mdu = du.Magnitude(); Standard_Real mdv = dv.Magnitude(); - u = Abs(Vals(1)); - v = Abs(Vals(2)); + u = std::abs(Vals(1)); + v = std::abs(Vals(2)); if (mdu > Precision::PConfusion()) { if (u / dist / mdu > Precision::PConfusion()) @@ -565,7 +565,7 @@ static Standard_Boolean IsCaseAnalyticallyComputable(const GeomAbs_CurveType& th return Standard_False; } // check if it is a plane - if (Abs(theCurvePos.Direction() * theSurfaceDirection) <= gp::Resolution()) + if (std::abs(theCurvePos.Direction() * theSurfaceDirection) <= gp::Resolution()) return Standard_False; else return Standard_True; diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPRevS.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPRevS.cxx index ab88669041..6d6c549a7e 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPRevS.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPRevS.cxx @@ -158,7 +158,7 @@ static Standard_Boolean IsCaseAnalyticallyComputable(const GeomAbs_CurveType& th return Standard_True; return Standard_False; // gp_Vec V (AxeOfRevolution.Location(),theCurvePos.Location()); - // if (Abs( V * theCurvePos.Direction()) <= gp::Resolution()) + // if (std::abs( V * theCurvePos.Direction()) <= gp::Resolution()) // return Standard_True; // else // return Standard_False; @@ -324,7 +324,7 @@ void Extrema_ExtPRevS::Perform(const gp_Pnt& P) Standard_Real U, V; gp_Pnt P1, Ppp; Standard_Real OPpz = gp_Vec(O, Pp).Dot(Z); - if (Abs(OPpz) <= gp::Resolution()) + if (std::abs(OPpz) <= gp::Resolution()) { Ppp = Pp; U = 0; @@ -343,7 +343,7 @@ void Extrema_ExtPRevS::Perform(const gp_Pnt& P) gp_Vec OPpp(O, Ppp), OPq(O, myS->Value(M_PI / 2, 0)); if (U != M_PI / 2) { - if (Abs(OPq.Magnitude()) <= gp::Resolution()) + if (std::abs(OPq.Magnitude()) <= gp::Resolution()) OPq = gp_Vec(O, myS->Value(M_PI / 2, anACurve->LastParameter() / 10)); if (OPpp.AngleWithRef(OPq, Dir) < 0) U += M_PI; diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPS.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPS.cxx index dbf7197e5d..37ec74bb68 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPS.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtPS.cxx @@ -58,7 +58,7 @@ static Standard_Boolean IsoIsDeg(const Adaptor3d_Surface& S, for (T = U1; T <= U2; T = T + Step) { S.D1(T, Param, P, D1U, D1V); - D1NormMax = Max(D1NormMax, D1U.Magnitude()); + D1NormMax = std::max(D1NormMax, D1U.Magnitude()); } if (D1NormMax > TolMax || D1NormMax < TolMin) @@ -78,7 +78,7 @@ static Standard_Boolean IsoIsDeg(const Adaptor3d_Surface& S, for (T = V1; T <= V2; T = T + Step) { S.D1(Param, T, P, D1U, D1V); - D1NormMax = Max(D1NormMax, D1V.Magnitude()); + D1NormMax = std::max(D1NormMax, D1V.Magnitude()); } if (D1NormMax > TolMax || D1NormMax < TolMin) diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_FuncExtCC.gxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_FuncExtCC.gxx index b78511f7c3..179f707fc2 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_FuncExtCC.gxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_FuncExtCC.gxx @@ -86,7 +86,7 @@ Standard_Real Extrema_FuncExtCC::SearchOfTolerance(const Standard_Address C) aMax = vm; } while (++aNum < NPoint + 1); - return Max(aMax * TolFactor, MinTol); + return std::max(aMax * TolFactor, MinTol); } //================================================================================================= @@ -222,7 +222,7 @@ Standard_Boolean Extrema_FuncExtCC::Value(const math_Vector& UV, math_Vector& F) else du = myUsupremum - myUinfium; - const Standard_Real aDelta = Max(du * DivisionFactor, MinStep); + const Standard_Real aDelta = std::max(du * DivisionFactor, MinStep); Standard_Integer n = 1; // Derivative order Vec V; @@ -245,8 +245,8 @@ Standard_Boolean Extrema_FuncExtCC::Value(const math_Vector& UV, math_Vector& F) u = myU - aDelta; Pnt P1, P2; - Tool1::D0(*((Curve1*)myC1), Min(myU, u), P1); - Tool1::D0(*((Curve1*)myC1), Max(myU, u), P2); + Tool1::D0(*((Curve1*)myC1), std::min(myU, u), P1); + Tool1::D0(*((Curve1*)myC1), std::max(myU, u), P2); Vec V1(P1, P2); Standard_Real aDirFactor = V.Dot(V1); @@ -309,7 +309,7 @@ Standard_Boolean Extrema_FuncExtCC::Value(const math_Vector& UV, math_Vector& F) else dv = myVsupremum - myVinfium; - const Standard_Real aDelta = Max(dv * DivisionFactor, MinStep); + const Standard_Real aDelta = std::max(dv * DivisionFactor, MinStep); // Derivative is approximated by Taylor-series @@ -334,8 +334,8 @@ Standard_Boolean Extrema_FuncExtCC::Value(const math_Vector& UV, math_Vector& F) v = myV - aDelta; Pnt P1, P2; - Tool2::D0(*((Curve2*)myC2), Min(myV, v), P1); - Tool2::D0(*((Curve2*)myC2), Max(myV, v), P2); + Tool2::D0(*((Curve2*)myC2), std::min(myV, v), P1); + Tool2::D0(*((Curve2*)myC2), std::max(myV, v), P2); Vec V1(P1, P2); Standard_Real aDirFactor = V.Dot(V1); @@ -433,7 +433,7 @@ Standard_Boolean Extrema_FuncExtCC::Values(const math_Vector& UV, math_Vector& F else du = myUsupremum - myUinfium; - const Standard_Real aDeltaU = Max(du * DivisionFactor, MinStep); + const Standard_Real aDeltaU = std::max(du * DivisionFactor, MinStep); Standard_Real dv; if ((myVsupremum >= RealLast()) || (myVinfium <= RealFirst())) @@ -441,7 +441,7 @@ Standard_Boolean Extrema_FuncExtCC::Values(const math_Vector& UV, math_Vector& F else dv = myVsupremum - myVinfium; - const Standard_Real aDeltaV = Max(dv * DivisionFactor, MinStep); + const Standard_Real aDeltaV = std::max(dv * DivisionFactor, MinStep); Vec P1P2(myP1, myP2); @@ -695,7 +695,7 @@ Standard_Integer Extrema_FuncExtCC::GetStateNumber() Dv /= mod; } - if (Abs(P1P2.Dot(Du)) <= myTol && Abs(P1P2.Dot(Dv)) <= myTol) + if (std::abs(P1P2.Dot(Du)) <= myTol && std::abs(P1P2.Dot(Dv)) <= myTol) { mySqDist.Append(myP1.SquareDistance(myP2)); myPoints.Append(POnC(myU, myP1)); diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_FuncExtPC.gxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_FuncExtPC.gxx index c54044d409..d2e5302516 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_FuncExtPC.gxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_FuncExtPC.gxx @@ -64,7 +64,7 @@ Standard_Real Extrema_FuncExtPC::SearchOfTolerance() aMax = vm; } while (++aNum < NPoint + 1); - return Max(aMax * TolFactor, MinTol); + return std::max(aMax * TolFactor, MinTol); } //============================================================================= @@ -181,7 +181,7 @@ Standard_Boolean Extrema_FuncExtPC::Value(const Standard_Real U, Standard_Real& else du = myUsupremum - myUinfium; - const Standard_Real aDelta = Max(du * DivisionFactor, MinStep); + const Standard_Real aDelta = std::max(du * DivisionFactor, MinStep); // Derivative is approximated by Taylor-series Standard_Integer n = 1; // Derivative order @@ -205,8 +205,8 @@ Standard_Boolean Extrema_FuncExtPC::Value(const Standard_Real U, Standard_Real& u = myU - aDelta; Pnt P1, P2; - Tool::D0(*((Curve*)myC), Min(myU, u), P1); - Tool::D0(*((Curve*)myC), Max(myU, u), P2); + Tool::D0(*((Curve*)myC), std::min(myU, u), P1); + Tool::D0(*((Curve*)myC), std::max(myU, u), P2); Vec V1(P1, P2); Standard_Real aDirFactor = V.Dot(V1); @@ -312,7 +312,7 @@ Standard_Boolean Extrema_FuncExtPC::Values(const Standard_Real U, else du = myUsupremum - myUinfium; - const Standard_Real aDelta = Max(du * DivisionFactor, MinStep); + const Standard_Real aDelta = std::max(du * DivisionFactor, MinStep); Standard_Real F1, F2, F3; diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_GExtPC.gxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_GExtPC.gxx index b4d6cfec0b..5e8b12bed4 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_GExtPC.gxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_GExtPC.gxx @@ -188,8 +188,8 @@ void Extrema_GExtPC::Perform(const ThePoint& P) } } aMin2 = P.SquareDistance(aP2); - Standard_Real aMinSqDist = Min(aMin1, aMin2); - Standard_Real aMinDer = Min(Abs(aVal1), Abs(aVal2)); + Standard_Real aMinSqDist = std::min(aMin1, aMin2); + Standard_Real aMinDer = std::min(std::abs(aVal1), std::abs(aVal2)); if (!(Precision::IsInfinite(aVal1) || Precision::IsInfinite(aVal2))) { // Derivatives have opposite signs - min or max inside of interval (sufficient @@ -210,7 +210,7 @@ void Extrema_GExtPC::Perform(const ThePoint& P) for (i = 1; i <= NbExt && isToAdd; i++) { Standard_Real t = mypoint.Value(i).Parameter(); - isToAdd = (distmin < mySqDist(i)) && (Abs(t - tmin) > mytolu); + isToAdd = (distmin < mySqDist(i)) && (std::abs(t - tmin) > mytolu); } if (isToAdd) { @@ -289,7 +289,7 @@ void Extrema_GExtPC::Perform(const ThePoint& P) // condition). Necessary condition - when point lies on curve. Necessary condition - // when derivative of point is too small. if (aVal1 * aVal2 <= 0.0 || aBase1.Dot(aBase2) <= 0.0 - || 2.0 * Abs(aVal1) < Precision::Confusion()) + || 2.0 * std::abs(aVal1) < Precision::Confusion()) { myintuinf = aParam(aVal.Lower()); myintusup = aParam(aVal.Lower() + 1); @@ -314,7 +314,7 @@ void Extrema_GExtPC::Perform(const ThePoint& P) // condition). Necessary condition - when point lies on curve. Necessary condition - // when derivative of point is too small. if (aVal1 * aVal2 <= 0.0 || aBase1.Dot(aBase2) <= 0.0 - || 2.0 * Abs(aVal2) < Precision::Confusion()) + || 2.0 * std::abs(aVal2) < Precision::Confusion()) { myintuinf = aParam(aVal.Upper() - 1); myintusup = aParam(aVal.Upper()); @@ -342,7 +342,7 @@ void Extrema_GExtPC::Perform(const ThePoint& P) theHInter = TheCurveTool::DeflCurvIntervals(aCurve); n = theHInter->Length() - 1; } - mysample = Max(mysample / n, aMaxSample); + mysample = std::max(mysample / n, aMaxSample); Standard_Real maxint = 0.; for (i = 1; i <= n; ++i) { @@ -362,7 +362,7 @@ void Extrema_GExtPC::Perform(const ThePoint& P) { myintuinf = theHInter->Value(i); myintusup = theHInter->Value(i + 1); - mysample = Max(RealToInt(aMaxSample * (myintusup - myintuinf) / maxint), 3); + mysample = std::max(RealToInt(aMaxSample * (myintusup - myintuinf) / maxint), 3); Standard_Real anInfToCheck = myintuinf; Standard_Real aSupToCheck = myintusup; @@ -424,9 +424,9 @@ void Extrema_GExtPC::Perform(const ThePoint& P) for (i = 1; i <= aNbPoints; i++) { U = mypoint.Value(i).Parameter(); - if (Abs(U - myuinf) < mytolu) + if (std::abs(U - myuinf) < mytolu) isFirstAdded = Standard_True; - else if (Abs(myusup - U) < mytolu) + else if (std::abs(myusup - U) < mytolu) isLastAdded = Standard_True; } if (!isFirstAdded && mydist1 < Precision::SquareConfusion()) @@ -531,7 +531,7 @@ void Extrema_GExtPC::AddSol(const Standard_Real theU, for (i = 1; i <= NbExt; i++) { Standard_Real t = mypoint.Value(i).Parameter(); - if (Abs(t - theU) <= mytolu) + if (std::abs(t - theU) <= mytolu) { return; } diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_GLocateExtPC.gxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_GLocateExtPC.gxx index 811975cf26..58c9ed2c96 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_GLocateExtPC.gxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_GLocateExtPC.gxx @@ -131,8 +131,8 @@ void Extrema_GLocateExtPC::Perform(const ThePoint& P, const Standard_Real U0) // l intervalle total de recherche de l'extremum (hla : au cas ou // myintuinf > myintusup, c est que les 2 intervalles ne s intersectent // pas, mais il n'y avait aucune raison de sortir en "return") - myintuinf = Max(theInter(inter), myumin); - myintusup = Min(theInter(inter + 1), myusup); + myintuinf = std::max(theInter(inter), myumin); + myintusup = std::min(theInter(inter + 1), myusup); if ((local_u0 >= myintuinf) && (local_u0 < myintusup)) found = Standard_True; inter++; @@ -171,8 +171,8 @@ void Extrema_GLocateExtPC::Perform(const ThePoint& P, const Standard_Real U0) i2 = inter - k; if (i1 <= n) { - myintuinf = Max(theInter(i1), myumin); - myintusup = Min(theInter(i1 + 1), myusup); + myintuinf = std::max(theInter(i1), myumin); + myintusup = std::min(theInter(i1 + 1), myusup); if (myintuinf < myintusup) { TheCurveTool::D1(*((TheCurve*)myC), myintuinf, P1, V1); @@ -208,8 +208,8 @@ void Extrema_GLocateExtPC::Perform(const ThePoint& P, const Standard_Real U0) if (i2 > 0) { - myintuinf = Max(theInter(i2), myumin); - myintusup = Min(theInter(i2 + 1), myusup); + myintuinf = std::max(theInter(i2), myumin); + myintusup = std::min(theInter(i2 + 1), myusup); if (myintuinf < myintusup) { TheCurveTool::D1(*((TheCurve*)myC), myintusup, P1, V1); @@ -265,7 +265,7 @@ void Extrema_GLocateExtPC::Perform(const ThePoint& P, const Standard_Real U0) for (i = 1; i <= myExtremPC.NbExt(); i++) { Par = myExtremPC.Point(i).Parameter(); - valU = Abs(Par - U0); + valU = std::abs(Par - U0); if (valU <= valU2) { valU2 = valU; diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtCC.gxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtCC.gxx index c6bb44dc98..9a7a1fffe6 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtCC.gxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtCC.gxx @@ -338,7 +338,7 @@ void Extrema_GenExtCC::Perform() Standard_Real aLC = 100.0; // Default value. const Standard_Real aMaxDer1 = 1.0 / C1.Resolution(1.0); const Standard_Real aMaxDer2 = 1.0 / C2.Resolution(1.0); - Standard_Real aMaxDer = Max(aMaxDer1, aMaxDer2) * M_SQRT2; + Standard_Real aMaxDer = std::max(aMaxDer1, aMaxDer2) * M_SQRT2; if (aLC > aMaxDer) aLC = aMaxDer; @@ -393,13 +393,13 @@ void Extrema_GenExtCC::Perform() aT(2) = t2; aFunc.Values(aT, aF, aG); Standard_Real aMod = aG(1) * aG(1) + aG(2) * aG(2); - aMaxG = Max(aMaxG, aMod); + aMaxG = std::max(aMaxG, aMod); } } - aMaxG = Sqrt(aMaxG); + aMaxG = std::sqrt(aMaxG); if (aMaxG > aMaxDer) { - aLC = Min(aMaxG, aMaxLC); + aLC = std::min(aMaxG, aMaxLC); isConstLockedFlag = Standard_True; } if (aMaxG > 100. * aMaxLC) @@ -422,10 +422,10 @@ void Extrema_GenExtCC::Perform() aFinder.SetFunctionalMinimalValue(0.0); // Best distance cannot be lower than 0.0. // Size computed to have cell index inside of int32 value. - const Standard_Real aCellSize = Max( - Max(anIntervals1->Last() - anIntervals1->First(), anIntervals2->Last() - anIntervals2->First()) - * Precision::PConfusion() / (2.0 * M_SQRT2), - Precision::PConfusion()); + const Standard_Real aCellSize = std::max(std::max(anIntervals1->Last() - anIntervals1->First(), + anIntervals2->Last() - anIntervals2->First()) + * Precision::PConfusion() / (2.0 * M_SQRT2), + Precision::PConfusion()); Extrema_CCPointsInspector anInspector(aCellSize); NCollection_CellFilter aFilter(aCellSize); NCollection_Vector aPnts; @@ -547,7 +547,7 @@ void Extrema_GenExtCC::Perform() aVec(2) = (aCurrent.Y() + aNext.Y()) * 0.5; aFunc.Value(aVec, aVal); - if (Abs(aVal - aF) < Precision::Confusion()) + if (std::abs(aVal - aF) < Precision::Confusion()) { // It seems the parallel segment is found. // Save only extreme solutions on that segment. @@ -610,7 +610,7 @@ void Extrema_GenExtCC::Perform() { Standard_Real aDist1 = ProjPOnC(C1.Value(aT1[iT]), anExtPC2); Standard_Real aDist2 = ProjPOnC(C2.Value(aT2[iT]), anExtPC1); - isParallel = (Abs(Min(aDist1, aDist2) - aF * aF) < Precision::Confusion()); + isParallel = (std::abs(std::min(aDist1, aDist2) - aF * aF) < Precision::Confusion()); } } diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtCS.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtCS.cxx index 9071cd8685..f777244a90 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtCS.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtCS.cxx @@ -375,7 +375,7 @@ void Extrema_GenExtCS::Perform(const Adaptor3d_Curve& C, for (i = 1; i <= aSqDists1.Length(); ++i) { Standard_Real aDist = aSqDists1(i); - if (Abs(aDist - aMinDist) <= aTol) + if (std::abs(aDist - aMinDist) <= aTol) { aSqDists.Append(aDist); aPntsOnCrv.Append(aPntsOnCrv1(i)); @@ -413,7 +413,8 @@ void Extrema_GenExtCS::GlobMinGenCS(const Adaptor3d_Curve& theC, Standard_Real aMinResolution = aScaleFactor - * Min(aResolutionCU, Min(aStepSU / myS->UResolution(1.0), aStepSV / myS->VResolution(1.0))); + * std::min(aResolutionCU, + std::min(aStepSU / myS->UResolution(1.0), aStepSV / myS->VResolution(1.0))); if (aMinResolution > Epsilon(1.0)) { @@ -421,7 +422,7 @@ void Extrema_GenExtCS::GlobMinGenCS(const Adaptor3d_Curve& theC, { const Standard_Integer aMaxNbNodes = 50; - aNewCsample = Min(aMaxNbNodes, RealToInt(mytsample * aResolutionCU / aMinResolution)); + aNewCsample = std::min(aMaxNbNodes, RealToInt(mytsample * aResolutionCU / aMinResolution)); aStepCU = (aMaxTUV(1) - aMinTUV(1)) / aNewCsample; } @@ -505,7 +506,7 @@ void Extrema_GenExtCS::GlobMinConicS(const Adaptor3d_Curve& theC, aMaxUV = anUVsup - (anUVsup - anUVinf) / aBorderDivisor; // Increase numbers of UV samples to improve searching global minimum - Standard_Integer anAddsample = Max(mytsample / 2, 3); + Standard_Integer anAddsample = std::max(mytsample / 2, 3); Standard_Integer anUsample = myusample + anAddsample; Standard_Integer aVsample = myvsample + anAddsample; // @@ -599,13 +600,13 @@ void Extrema_GenExtCS::GlobMinConicS(const Adaptor3d_Curve& theC, for (iu = -1; iu <= 1; ++iu) { Standard_Real u = anUV(1) + iu * aStepSU; - u = Max(anUVinf(1), u); - u = Min(anUVsup(1), u); + u = std::max(anUVinf(1), u); + u = std::min(anUVsup(1), u); for (iv = -1; iv <= 1; ++iv) { Standard_Real v = anUV(2) + iv * aStepSV; - v = Max(anUVinf(2), v); - v = Min(anUVsup(2), v); + v = std::max(anUVinf(2), v); + v = std::min(anUVsup(2), v); myS->D1(u, v, aPOnS, aDU, aDV); if (aPOnC.SquareDistance(aPOnS) < Precision::SquareConfusion()) { @@ -690,9 +691,9 @@ void Extrema_GenExtCS::GlobMinCQuadric(const Adaptor3d_Curve& theC, // because dimension of optimisation task is reduced const Standard_Integer aMaxNbNodes = 50; Standard_Integer aNewCsample = mytsample; - Standard_Integer anAddsample = Max(myusample / 2, 3); + Standard_Integer anAddsample = std::max(myusample / 2, 3); aNewCsample += anAddsample; - aNewCsample = Min(aNewCsample, aMaxNbNodes); + aNewCsample = std::min(aNewCsample, aMaxNbNodes); // // Correct number of curve samples in case of low resolution Standard_Real aStepCT = (aMaxT(1) - aMinT(1)) / aNewCsample; @@ -703,14 +704,15 @@ void Extrema_GenExtCS::GlobMinCQuadric(const Adaptor3d_Curve& theC, Standard_Real aMinResolution = aScaleFactor - * Min(aResolutionCU, Min(aStepSU / myS->UResolution(1.0), aStepSV / myS->VResolution(1.0))); + * std::min(aResolutionCU, + std::min(aStepSU / myS->UResolution(1.0), aStepSV / myS->VResolution(1.0))); if (aMinResolution > Epsilon(1.0)) { if (aResolutionCU > aMinResolution) { - aNewCsample = Min(aMaxNbNodes, RealToInt(aNewCsample * aResolutionCU / aMinResolution)); + aNewCsample = std::min(aMaxNbNodes, RealToInt(aNewCsample * aResolutionCU / aMinResolution)); aStepCT = (aMaxT(1) - aMinT(1)) / aNewCsample; } diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtPS.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtPS.cxx index 9081003fae..bb07405607 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtPS.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_GenExtPS.cxx @@ -171,7 +171,7 @@ Method: - F: Extrema_FuncExtPS created from P and S, - UV: math_Vector the components which of are parameters of the extremum on the grid, - - Tol: Min(TolU,TolV), (Prov.:math_FunctionSetRoot does not authorize a vector) + - Tol: std::min(TolU,TolV), (Prov.:math_FunctionSetRoot does not authorize a vector) - UVinf: math_Vector the components which of are lower limits of u and v, - UVsup: math_Vector the components which of are upper limits of u and v. @@ -324,7 +324,7 @@ inline static void fillParams(const TColStd_Array1OfReal& theKnots, if (theKnots(i + 1) < theParMin + Precision::PConfusion()) continue; - Standard_Real aStep = (theKnots(i + 1) - theKnots(i)) / Max(theDegree, 2); + Standard_Real aStep = (theKnots(i + 1) - theKnots(i)) / std::max(theDegree, 2); Standard_Integer k = 1; for (; k <= theDegree; k++) { @@ -444,7 +444,8 @@ const Extrema_POnSurfParams& Extrema_GenExtPS::ComputeEdgeParameters( } else { - const Standard_Real aDiffDist = Abs(theParam0.GetSqrDistance() - theParam1.GetSqrDistance()); + const Standard_Real aDiffDist = + std::abs(theParam0.GetSqrDistance() - theParam1.GetSqrDistance()); if (aDiffDist >= aSqrDist01 - theDiffTol) { @@ -637,7 +638,7 @@ void Extrema_GenExtPS::BuildGrid(const gp_Pnt& thePoint) const Extrema_POnSurfParams& aVE1 = myVEdgePntParams.Value(NoU + 1, NoV); aSqrDist01 = aUE0.Value().SquareDistance(aUE1.Value()); - aDiffDist = Abs(aUE0.GetSqrDistance() - aUE1.GetSqrDistance()); + aDiffDist = std::abs(aUE0.GetSqrDistance() - aUE1.GetSqrDistance()); isOut = Standard_False; if (aDiffDist >= aSqrDist01 - aDiffTol) @@ -648,7 +649,7 @@ void Extrema_GenExtPS::BuildGrid(const gp_Pnt& thePoint) else { aSqrDist01 = aVE0.Value().SquareDistance(aVE1.Value()); - aDiffDist = Abs(aVE0.GetSqrDistance() - aVE1.GetSqrDistance()); + aDiffDist = std::abs(aVE0.GetSqrDistance() - aVE1.GetSqrDistance()); if (aDiffDist >= aSqrDist01 - aDiffTol) { @@ -758,31 +759,31 @@ static void CorrectNbSamples(const Adaptor3d_Surface& theS, Standard_Integer& theNbV) { Standard_Real aMinLen = 1.e-3; - Standard_Integer nbp = Min(23, theNbV); + Standard_Integer nbp = std::min(23, theNbV); Standard_Real aLenU1 = LengthOfIso(theS, GeomAbs_IsoU, theV1, theV2, nbp, theU1); if (aLenU1 <= aMinLen) { Standard_Real aL = LengthOfIso(theS, GeomAbs_IsoU, theV1, theV2, nbp, .7 * theU1 + 0.3 * theU2); - aLenU1 = Max(aL, aLenU1); + aLenU1 = std::max(aL, aLenU1); } Standard_Real aLenU2 = LengthOfIso(theS, GeomAbs_IsoU, theV1, theV2, nbp, theU2); if (aLenU2 <= aMinLen) { Standard_Real aL = LengthOfIso(theS, GeomAbs_IsoU, theV1, theV2, nbp, .3 * theU1 + 0.7 * theU2); - aLenU2 = Max(aL, aLenU2); + aLenU2 = std::max(aL, aLenU2); } - nbp = Min(23, theNbV); + nbp = std::min(23, theNbV); Standard_Real aLenV1 = LengthOfIso(theS, GeomAbs_IsoV, theU1, theU2, nbp, theV1); if (aLenV1 <= aMinLen) { Standard_Real aL = LengthOfIso(theS, GeomAbs_IsoV, theU1, theU2, nbp, .7 * theV1 + 0.3 * theV2); - aLenV1 = Max(aL, aLenV1); + aLenV1 = std::max(aL, aLenV1); } Standard_Real aLenV2 = LengthOfIso(theS, GeomAbs_IsoV, theU1, theU2, nbp, theV2); if (aLenV2 <= aMinLen) { Standard_Real aL = LengthOfIso(theS, GeomAbs_IsoV, theU1, theU2, nbp, .3 * theV1 + 0.7 * theV2); - aLenV2 = Max(aL, aLenV2); + aLenV2 = std::max(aL, aLenV2); } // Standard_Real aStepV1 = aLenU1 / theNbV; @@ -790,19 +791,19 @@ static void CorrectNbSamples(const Adaptor3d_Surface& theS, Standard_Real aStepU1 = aLenV1 / theNbU; Standard_Real aStepU2 = aLenV2 / theNbU; - Standard_Real aMaxStepV = Max(aStepV1, aStepV2); - Standard_Real aMaxStepU = Max(aStepU1, aStepU2); + Standard_Real aMaxStepV = std::max(aStepV1, aStepV2); + Standard_Real aMaxStepU = std::max(aStepU1, aStepU2); // Standard_Real aRatio = aMaxStepV / aMaxStepU; if (aRatio > 10.) { - Standard_Integer aMult = RealToInt(Log(aRatio)); + Standard_Integer aMult = RealToInt(std::log(aRatio)); if (aMult > 1) theNbV *= aMult; } else if (aRatio < 0.1) { - Standard_Integer aMult = RealToInt(-Log(aRatio)); + Standard_Integer aMult = RealToInt(-std::log(aRatio)); if (aMult > 1) theNbV *= aMult; } @@ -821,9 +822,9 @@ void Extrema_GenExtPS::BuildTree() Standard_Integer aVValue = aBspl->VDegree() * aBspl->NbVKnots(); // 300 is value, which is used for singular points (see Extrema_ExtPS.cxx::Initialize(...)) if (aUValue > myusample) - myusample = Min(aUValue, 300); + myusample = std::min(aUValue, 300); if (aVValue > myvsample) - myvsample = Min(aVValue, 300); + myvsample = std::min(aVValue, 300); } // CorrectNbSamples(*myS, myumin, myusup, myusample, myvmin, myvsup, myvsample); diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_GenLocateExtPC.gxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_GenLocateExtPC.gxx index 62edd50824..24569b64c2 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_GenLocateExtPC.gxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_GenLocateExtPC.gxx @@ -100,7 +100,7 @@ Methode: uu = PP.Parameter(); if (myF.Value(uu, ff)) { - if (Abs(ff) >= 1.e-07) + if (std::abs(ff) >= 1.e-07) myDone = Standard_False; } else diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_GenLocateExtPS.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_GenLocateExtPS.cxx index 2d3bac027b..707604dbf5 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_GenLocateExtPS.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_GenLocateExtPS.cxx @@ -35,26 +35,26 @@ static void CorrectTol(const Standard_Real theU0, const Standard_Real theV0, mat const Standard_Real tolog10 = 0.43429; if (epsu > anEpsRef) { - Standard_Integer n = RealToInt(tolog10 * Log(epsu / anEpsRef) + 1) + 1; + Standard_Integer n = RealToInt(tolog10 * std::log(epsu / anEpsRef) + 1) + 1; Standard_Integer i; Standard_Real tol = aTolRef; for (i = 1; i <= n; ++i) { tol *= 10.; } - theTol(1) = Max(theTol(1), tol); + theTol(1) = std::max(theTol(1), tol); } Standard_Real epsv = Epsilon(theV0); if (epsv > anEpsRef) { - Standard_Integer n = RealToInt(tolog10 * Log(epsv / anEpsRef) + 1) + 1; + Standard_Integer n = RealToInt(tolog10 * std::log(epsv / anEpsRef) + 1) + 1; Standard_Integer i; Standard_Real tol = aTolRef; for (i = 1; i <= n; ++i) { tol *= 10.; } - theTol(2) = Max(theTol(2), tol); + theTol(2) = std::max(theTol(2), tol); } } @@ -66,9 +66,9 @@ Standard_Boolean Extrema_GenLocateExtPS::IsMinDist(const gp_Pnt& theP const Standard_Real theV0) { Standard_Real du = - Max(theS.UResolution(10. * Precision::Confusion()), 10. * Precision::PConfusion()); + std::max(theS.UResolution(10. * Precision::Confusion()), 10. * Precision::PConfusion()); Standard_Real dv = - Max(theS.VResolution(10. * Precision::Confusion()), 10. * Precision::PConfusion()); + std::max(theS.VResolution(10. * Precision::Confusion()), 10. * Precision::PConfusion()); Standard_Real u, v; gp_Pnt aP0 = theS.Value(theU0, theV0); Standard_Real d0 = theP.SquareDistance(aP0); @@ -78,8 +78,8 @@ Standard_Boolean Extrema_GenLocateExtPS::IsMinDist(const gp_Pnt& theP u = theU0 + iu * du; if (!theS.IsUPeriodic()) { - u = Max(u, theS.FirstUParameter()); - u = Min(u, theS.LastUParameter()); + u = std::max(u, theS.FirstUParameter()); + u = std::min(u, theS.LastUParameter()); } for (iv = -1; iv <= 1; ++iv) { @@ -89,8 +89,8 @@ Standard_Boolean Extrema_GenLocateExtPS::IsMinDist(const gp_Pnt& theP v = theV0 + iv * dv; if (!theS.IsVPeriodic()) { - v = Max(v, theS.FirstVParameter()); - v = Min(v, theS.LastVParameter()); + v = std::max(v, theS.FirstVParameter()); + v = std::min(v, theS.LastVParameter()); } Standard_Real d = theP.SquareDistance(theS.Value(u, v)); if (d < d0) @@ -181,8 +181,8 @@ void Extrema_GenLocateExtPS::Perform(const gp_Pnt& theP, CorrectTol(theU0, theV0, aTol); } - Standard_Boolean isCorrectTol = (Abs(aTol(1) - myTolU) > Precision::PConfusion() - || Abs(aTol(2) - myTolV) > Precision::PConfusion()); + Standard_Boolean isCorrectTol = (std::abs(aTol(1) - myTolU) > Precision::PConfusion() + || std::abs(aTol(2) - myTolV) > Precision::PConfusion()); math_FunctionSetRoot aSR(F, aTol); aSR.Perform(F, aStart, aBoundInf, aBoundSup); diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_GlobOptFuncCQuadric.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_GlobOptFuncCQuadric.cxx index 0f76290274..ac44e0d56e 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_GlobOptFuncCQuadric.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_GlobOptFuncCQuadric.cxx @@ -65,12 +65,12 @@ void Extrema_GlobOptFuncCQuadric::value(Standard_Real ct, Standard_Real& F) if (u >= myUf && u <= myUl && v >= myVf && v <= myVl) { gp_Pnt aPS = myS->Value(u, v); - F = Min(F, aCP.SquareDistance(aPS)); + F = std::min(F, aCP.SquareDistance(aPS)); } Standard_Integer i; for (i = 0; i < 4; ++i) { - F = Min(F, aCP.SquareDistance(myPTrim[i])); + F = std::min(F, aCP.SquareDistance(myPTrim[i])); } } @@ -138,11 +138,11 @@ void Extrema_GlobOptFuncCQuadric::LoadQuad(const Adaptor3d_Surface* S, if (myS->IsUPeriodic()) { constexpr Standard_Real aTMax = 2. * M_PI + Precision::PConfusion(); - if (myUf > aTMax || myUf < -Precision::PConfusion() || Abs(myUl - myUf) > aTMax) + if (myUf > aTMax || myUf < -Precision::PConfusion() || std::abs(myUl - myUf) > aTMax) { ElCLib::AdjustPeriodic(0., 2. * M_PI, - Min(Abs(myUl - myUf) / 2, Precision::PConfusion()), + std::min(std::abs(myUl - myUf) / 2, Precision::PConfusion()), myUf, myUl); } @@ -150,11 +150,11 @@ void Extrema_GlobOptFuncCQuadric::LoadQuad(const Adaptor3d_Surface* S, if (myS->IsVPeriodic()) { constexpr Standard_Real aTMax = 2. * M_PI + Precision::PConfusion(); - if (myVf > aTMax || myVf < -Precision::PConfusion() || Abs(myVl - myVf) > aTMax) + if (myVf > aTMax || myVf < -Precision::PConfusion() || std::abs(myVl - myVf) > aTMax) { ElCLib::AdjustPeriodic(0., 2. * M_PI, - Min(Abs(myVl - myVf) / 2, Precision::PConfusion()), + std::min(std::abs(myVl - myVf) / 2, Precision::PConfusion()), myVf, myVl); } diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_GlobOptFuncConicS.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_GlobOptFuncConicS.cxx index ee05a33cfe..9e6cf424c0 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_GlobOptFuncConicS.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_GlobOptFuncConicS.cxx @@ -57,10 +57,10 @@ void Extrema_GlobOptFuncConicS::value(Standard_Real su, Standard_Real sv, Standa if (ct >= myTf && ct <= myTl) { gp_Pnt aPC = myC->Value(ct); - F = Min(F, aPS.SquareDistance(aPC)); + F = std::min(F, aPS.SquareDistance(aPC)); } - F = Min(F, aPS.SquareDistance(myCPf)); - F = Min(F, aPS.SquareDistance(myCPl)); + F = std::min(F, aPS.SquareDistance(myCPf)); + F = std::min(F, aPS.SquareDistance(myCPl)); } //================================================================================================= @@ -133,11 +133,11 @@ void Extrema_GlobOptFuncConicS::LoadConic(const Adaptor3d_Curve* C, if (myC->IsPeriodic()) { constexpr Standard_Real aTMax = 2. * M_PI + Precision::PConfusion(); - if (myTf > aTMax || myTf < -Precision::PConfusion() || Abs(myTl - myTf) > aTMax) + if (myTf > aTMax || myTf < -Precision::PConfusion() || std::abs(myTl - myTf) > aTMax) { ElCLib::AdjustPeriodic(0., 2. * M_PI, - Min(Abs(myTl - myTf) / 2, Precision::PConfusion()), + std::min(std::abs(myTl - myTf) / 2, Precision::PConfusion()), myTf, myTl); } @@ -229,7 +229,7 @@ Standard_Real Extrema_GlobOptFuncConicS::ConicParameter(const math_Vector& theUV if (ct >= myTf && ct <= myTl) { gp_Pnt aPC = myC->Value(ct); - F = Min(F, aPS.SquareDistance(aPC)); + F = std::min(F, aPS.SquareDistance(aPC)); } Standard_Real Fext = aPS.SquareDistance(myCPf); if (Fext < F) diff --git a/src/ModelingData/TKGeomBase/FEmTool/FEmTool_Assembly.cxx b/src/ModelingData/TKGeomBase/FEmTool/FEmTool_Assembly.cxx index 5cbceade7d..21312c13b8 100644 --- a/src/ModelingData/TKGeomBase/FEmTool/FEmTool_Assembly.cxx +++ b/src/ModelingData/TKGeomBase/FEmTool/FEmTool_Assembly.cxx @@ -44,7 +44,7 @@ static Standard_Integer MinIndex(const Handle(FEmTool_HAssemblyTable)& Table) nvaru = T->Upper(); for (nvar = nvarl; nvar <= nvaru; nvar++) { - Imin = Min(Imin, T->Value(nvar)); + Imin = std::min(Imin, T->Value(nvar)); } } return Imin; @@ -72,7 +72,7 @@ static Standard_Integer MaxIndex(const Handle(FEmTool_HAssemblyTable)& Table) nvaru = T->Upper(); for (nvar = nvarl; nvar <= nvaru; nvar++) { - Imax = Max(Imax, T->Value(nvar)); + Imax = std::max(Imax, T->Value(nvar)); } } return Imax; @@ -109,12 +109,12 @@ FEmTool_Assembly::FEmTool_Assembly(const TColStd_Array2OfInteger& Depende Imin = T->Value(nvarl) + I0; for (nvar = nvarl; nvar <= nvaru; nvar++) - Imin = Min(Imin, T->Value(nvar) + I0); + Imin = std::min(Imin, T->Value(nvar) + I0); for (nvar = nvarl; nvar <= nvaru; nvar++) { i = T->Value(nvar) + I0; - FirstIndexes(i) = Min(FirstIndexes(i), Imin); + FirstIndexes(i) = std::min(FirstIndexes(i), Imin); } } @@ -144,7 +144,7 @@ void FEmTool_Assembly::AddMatrix(const Standard_Integer Element, const TColStd_Array1OfInteger& T1 = myRefTable->Value(Dimension1, Element)->Array1(); const TColStd_Array1OfInteger& T2 = myRefTable->Value(Dimension2, Element)->Array1(); - Standard_Integer nvarl = T1.Lower(), nvaru = Min(T1.Upper(), nvarl + Mat.RowNumber() - 1); + Standard_Integer nvarl = T1.Lower(), nvaru = std::min(T1.Upper(), nvarl + Mat.RowNumber() - 1); Standard_Integer I, J, I0 = 1 - B.Lower(), i, ii, j, @@ -178,7 +178,7 @@ void FEmTool_Assembly::AddVector(const Standard_Integer Element, const math_Vector& Vec) { const TColStd_Array1OfInteger& T = myRefTable->Value(Dimension, Element)->Array1(); - Standard_Integer nvarl = T.Lower(), nvaru = Min(T.Upper(), nvarl + Vec.Length() - 1), + Standard_Integer nvarl = T.Lower(), nvaru = std::min(T.Upper(), nvarl + Vec.Length() - 1), i0 = Vec.Lower() - nvarl; // Standard_Integer I, i; @@ -484,8 +484,8 @@ void FEmTool_Assembly::AddConstraint(const Standard_Integer IndexofConstraint, for (i = Indexes->Lower(); i <= Indexes->Upper(); i++) { - Imin = Min(Imin, Indexes->Value(i)); - Imax = Max(Imax, Indexes->Value(i)); + Imin = std::min(Imin, Indexes->Value(i)); + Imax = std::max(Imax, Indexes->Value(i)); } Handle(TColStd_HArray1OfReal) Coeff; diff --git a/src/ModelingData/TKGeomBase/FEmTool/FEmTool_Curve.cxx b/src/ModelingData/TKGeomBase/FEmTool/FEmTool_Curve.cxx index 4421fb4af6..ed013ec9ca 100644 --- a/src/ModelingData/TKGeomBase/FEmTool/FEmTool_Curve.cxx +++ b/src/ModelingData/TKGeomBase/FEmTool/FEmTool_Curve.cxx @@ -87,7 +87,7 @@ void FEmTool_Curve::SetElement(const Standard_Integer IndexOfElement, { i1 += myDimension; i2 += myDimension; - mfact = Pow(stenor, i); + mfact = std::pow(stenor, i); for (j = 1; j <= myDimension; j++) { myCoeff(i1 + j) *= mfact; @@ -126,7 +126,7 @@ void FEmTool_Curve::GetElement(const Standard_Integer IndexOfElement, TColStd_Ar for (i = 1; i <= myBase.NivConstr(); i++) { - mfact = Pow(stenor, i); + mfact = std::pow(stenor, i); for (j = j1 + 1; j <= myDimension; j++) { Coeffs(i2 + i, j) *= mfact; @@ -441,7 +441,7 @@ void FEmTool_Curve::ReduceDegree(const Standard_Integer IndexOfElement, myBase.ReduceDegree(myDimension, deg, Tol, myCoeff.ChangeValue(Ptr), NewDegree, MaxError); - NewDegree = Max(NewDegree, 2 * myBase.NivConstr() + 1); + NewDegree = std::max(NewDegree, 2 * myBase.NivConstr() + 1); if (NewDegree < deg) { diff --git a/src/ModelingData/TKGeomBase/FEmTool/FEmTool_LinearFlexion.cxx b/src/ModelingData/TKGeomBase/FEmTool/FEmTool_LinearFlexion.cxx index 6796905286..88eaed4f8d 100644 --- a/src/ModelingData/TKGeomBase/FEmTool/FEmTool_LinearFlexion.cxx +++ b/src/ModelingData/TKGeomBase/FEmTool/FEmTool_LinearFlexion.cxx @@ -53,9 +53,9 @@ FEmTool_LinearFlexion::FEmTool_LinearFlexion(const Standard_Integer WorkDegree, PLib_HermitJacobi theBase(WDeg, ConstraintOrder); FEmTool_ElementsOfRefMatrix Elem = FEmTool_ElementsOfRefMatrix(theBase, DerOrder); Standard_Integer maxDegree = WDeg + 1; - math_IntegerVector anOrder(1, 1, Min(4 * (maxDegree / 2 + 1), math::GaussPointsMax())); - math_Vector Lower(1, 1, -1.), Upper(1, 1, 1.); - math_GaussSetIntegration anInt(Elem, Lower, Upper, anOrder); + math_IntegerVector anOrder(1, 1, std::min(4 * (maxDegree / 2 + 1), math::GaussPointsMax())); + math_Vector Lower(1, 1, -1.), Upper(1, 1, 1.); + math_GaussSetIntegration anInt(Elem, Lower, Upper, anOrder); MatrixElemts = anInt.Value(); } @@ -95,13 +95,13 @@ Handle(TColStd_HArray2OfInteger) FEmTool_LinearFlexion::DependenceTable() const Standard_Real FEmTool_LinearFlexion::Value() { - Standard_Integer deg = Min(myCoeff->ColLength() - 1, RefMatrix.UpperRow()), i, j, - j0 = myCoeff->LowerRow(), degH = Min(2 * myOrder + 1, deg), + Standard_Integer deg = std::min(myCoeff->ColLength() - 1, RefMatrix.UpperRow()), i, j, + j0 = myCoeff->LowerRow(), degH = std::min(2 * myOrder + 1, deg), NbDim = myCoeff->RowLength(), dim; TColStd_Array2OfReal NewCoeff(1, NbDim, 0, deg); - Standard_Real coeff = (myLast - myFirst) / 2., cteh3 = 2. / Pow(coeff, 3), mfact, Jline; + Standard_Real coeff = (myLast - myFirst) / 2., cteh3 = 2. / std::pow(coeff, 3), mfact, Jline; Standard_Integer k1; @@ -110,7 +110,7 @@ Standard_Real FEmTool_LinearFlexion::Value() for (i = 0; i <= degH; i++) { k1 = (i <= myOrder) ? i : i - myOrder - 1; - mfact = Pow(coeff, k1); + mfact = std::pow(coeff, k1); for (dim = 1; dim <= NbDim; dim++) NewCoeff(dim, i) = myCoeff->Value(j0 + i, dim) * mfact; } @@ -153,10 +153,10 @@ void FEmTool_LinearFlexion::Hessian(const Standard_Integer Dimension1, if (DepTab->Value(Dimension1, Dimension2) == 0) throw Standard_DomainError("FEmTool_LinearJerk::Hessian"); - Standard_Integer deg = Min(RefMatrix.UpperRow(), H.RowNumber() - 1), - degH = Min(2 * myOrder + 1, deg); + Standard_Integer deg = std::min(RefMatrix.UpperRow(), H.RowNumber() - 1), + degH = std::min(2 * myOrder + 1, deg); - Standard_Real coeff = (myLast - myFirst) / 2., cteh3 = 2. / Pow(coeff, 3), mfact; + Standard_Real coeff = (myLast - myFirst) / 2., cteh3 = 2. / std::pow(coeff, 3), mfact; Standard_Integer k1, k2, i, j; H.Init(0.); @@ -164,12 +164,12 @@ void FEmTool_LinearFlexion::Hessian(const Standard_Integer Dimension1, for (i = 0; i <= degH; i++) { k1 = (i <= myOrder) ? i : i - myOrder - 1; - mfact = Pow(coeff, k1) * cteh3; + mfact = std::pow(coeff, k1) * cteh3; // Hermite*Hermite part of matrix for (j = i; j <= degH; j++) { k2 = (j <= myOrder) ? j : j - myOrder - 1; - H(i, j) = mfact * Pow(coeff, k2) * RefMatrix(i, j); + H(i, j) = mfact * std::pow(coeff, k2) * RefMatrix(i, j); if (i != j) H(j, i) = H(i, j); } @@ -199,7 +199,7 @@ void FEmTool_LinearFlexion::Gradient(const Standard_Integer Dimension, math_Vect if (Dimension < myCoeff->LowerCol() || Dimension > myCoeff->UpperCol()) throw Standard_OutOfRange("FEmTool_LinearFlexion::Gradient"); - Standard_Integer deg = Min(G.Length() - 1, myCoeff->ColLength() - 1); + Standard_Integer deg = std::min(G.Length() - 1, myCoeff->ColLength() - 1); math_Vector X(0, deg); math_Matrix H(0, deg, 0, deg); diff --git a/src/ModelingData/TKGeomBase/FEmTool/FEmTool_LinearJerk.cxx b/src/ModelingData/TKGeomBase/FEmTool/FEmTool_LinearJerk.cxx index 44e5a19c8e..2cc8277d02 100644 --- a/src/ModelingData/TKGeomBase/FEmTool/FEmTool_LinearJerk.cxx +++ b/src/ModelingData/TKGeomBase/FEmTool/FEmTool_LinearJerk.cxx @@ -54,7 +54,7 @@ FEmTool_LinearJerk::FEmTool_LinearJerk(const Standard_Integer WorkDegree, Standard_Integer maxDegree = WDeg + 1; - math_IntegerVector anOrder(1, 1, Min(4 * (maxDegree / 2 + 1), math::GaussPointsMax())); + math_IntegerVector anOrder(1, 1, std::min(4 * (maxDegree / 2 + 1), math::GaussPointsMax())); math_Vector Lower(1, 1, -1.), Upper(1, 1, 1.); @@ -94,13 +94,13 @@ Handle(TColStd_HArray2OfInteger) FEmTool_LinearJerk::DependenceTable() const Standard_Real FEmTool_LinearJerk::Value() { - Standard_Integer deg = Min(myCoeff->ColLength() - 1, RefMatrix.UpperRow()), i, j, - j0 = myCoeff->LowerRow(), degH = Min(2 * myOrder + 1, deg), + Standard_Integer deg = std::min(myCoeff->ColLength() - 1, RefMatrix.UpperRow()), i, j, + j0 = myCoeff->LowerRow(), degH = std::min(2 * myOrder + 1, deg), NbDim = myCoeff->RowLength(), dim; TColStd_Array2OfReal NewCoeff(1, NbDim, 0, deg); - Standard_Real coeff = (myLast - myFirst) / 2., cteh3 = 2. / Pow(coeff, 5), mfact, Jline; + Standard_Real coeff = (myLast - myFirst) / 2., cteh3 = 2. / std::pow(coeff, 5), mfact, Jline; Standard_Integer k1; @@ -109,7 +109,7 @@ Standard_Real FEmTool_LinearJerk::Value() for (i = 0; i <= degH; i++) { k1 = (i <= myOrder) ? i : i - myOrder - 1; - mfact = Pow(coeff, k1); + mfact = std::pow(coeff, k1); for (dim = 1; dim <= NbDim; dim++) NewCoeff(dim, i) = myCoeff->Value(j0 + i, dim) * mfact; } @@ -154,10 +154,10 @@ void FEmTool_LinearJerk::Hessian(const Standard_Integer Dimension1, if (DepTab->Value(Dimension1, Dimension2) == 0) throw Standard_DomainError("FEmTool_LinearJerk::Hessian"); - Standard_Integer deg = Min(RefMatrix.UpperRow(), H.RowNumber() - 1), - degH = Min(2 * myOrder + 1, deg); + Standard_Integer deg = std::min(RefMatrix.UpperRow(), H.RowNumber() - 1), + degH = std::min(2 * myOrder + 1, deg); - Standard_Real coeff = (myLast - myFirst) / 2., cteh3 = 2. / Pow(coeff, 5), mfact; + Standard_Real coeff = (myLast - myFirst) / 2., cteh3 = 2. / std::pow(coeff, 5), mfact; Standard_Integer k1, k2, i, j, i0 = H.LowerRow(), j0 = H.LowerCol(), i1, j1; H.Init(0.); @@ -166,13 +166,13 @@ void FEmTool_LinearJerk::Hessian(const Standard_Integer Dimension1, for (i = 0; i <= degH; i++) { k1 = (i <= myOrder) ? i : i - myOrder - 1; - mfact = Pow(coeff, k1) * cteh3; + mfact = std::pow(coeff, k1) * cteh3; // Hermite*Hermite part of matrix j1 = j0 + i; for (j = i; j <= degH; j++) { k2 = (j <= myOrder) ? j : j - myOrder - 1; - H(i1, j1) = mfact * Pow(coeff, k2) * RefMatrix(i, j); + H(i1, j1) = mfact * std::pow(coeff, k2) * RefMatrix(i, j); if (i != j) H(j1, i1) = H(i1, j1); j1++; @@ -209,7 +209,7 @@ void FEmTool_LinearJerk::Gradient(const Standard_Integer Dimension, math_Vector& if (Dimension < myCoeff->LowerCol() || Dimension > myCoeff->UpperCol()) throw Standard_OutOfRange("FEmTool_LinearJerk::Gradient"); - Standard_Integer deg = Min(G.Length() - 1, myCoeff->ColLength() - 1); + Standard_Integer deg = std::min(G.Length() - 1, myCoeff->ColLength() - 1); math_Vector X(0, deg); Standard_Integer i, i1 = myCoeff->LowerRow(); diff --git a/src/ModelingData/TKGeomBase/FEmTool/FEmTool_LinearTension.cxx b/src/ModelingData/TKGeomBase/FEmTool/FEmTool_LinearTension.cxx index 57d7c6dc36..d035d86496 100644 --- a/src/ModelingData/TKGeomBase/FEmTool/FEmTool_LinearTension.cxx +++ b/src/ModelingData/TKGeomBase/FEmTool/FEmTool_LinearTension.cxx @@ -53,7 +53,7 @@ FEmTool_LinearTension::FEmTool_LinearTension(const Standard_Integer WorkDegree, FEmTool_ElementsOfRefMatrix Elem = FEmTool_ElementsOfRefMatrix(theBase, DerOrder); Standard_Integer maxDegree = WDeg + 1; - math_IntegerVector anOrder(1, 1, Min(4 * (maxDegree / 2 + 1), math::GaussPointsMax())); + math_IntegerVector anOrder(1, 1, std::min(4 * (maxDegree / 2 + 1), math::GaussPointsMax())); math_Vector Lower(1, 1, -1.), Upper(1, 1, 1.); math_GaussSetIntegration anInt(Elem, Lower, Upper, anOrder); @@ -91,8 +91,8 @@ Handle(TColStd_HArray2OfInteger) FEmTool_LinearTension::DependenceTable() const Standard_Real FEmTool_LinearTension::Value() { - Standard_Integer deg = Min(myCoeff->ColLength() - 1, RefMatrix.UpperRow()), i, j, - j0 = myCoeff->LowerRow(), degH = Min(2 * myOrder + 1, deg), + Standard_Integer deg = std::min(myCoeff->ColLength() - 1, RefMatrix.UpperRow()), i, j, + j0 = myCoeff->LowerRow(), degH = std::min(2 * myOrder + 1, deg), NbDim = myCoeff->RowLength(), dim; TColStd_Array2OfReal NewCoeff(1, NbDim, 0, deg); @@ -106,7 +106,7 @@ Standard_Real FEmTool_LinearTension::Value() for (i = 0; i <= degH; i++) { k1 = (i <= myOrder) ? i : i - myOrder - 1; - mfact = Pow(coeff, k1); + mfact = std::pow(coeff, k1); for (dim = 1; dim <= NbDim; dim++) NewCoeff(dim, i) = myCoeff->Value(j0 + i, dim) * mfact; } @@ -149,8 +149,8 @@ void FEmTool_LinearTension::Hessian(const Standard_Integer Dimension1, if (DepTab->Value(Dimension1, Dimension2) == 0) throw Standard_DomainError("FEmTool_LinearTension::Hessian"); - Standard_Integer deg = Min(RefMatrix.UpperRow(), H.RowNumber() - 1), - degH = Min(2 * myOrder + 1, deg); + Standard_Integer deg = std::min(RefMatrix.UpperRow(), H.RowNumber() - 1), + degH = std::min(2 * myOrder + 1, deg); Standard_Real coeff = (myLast - myFirst) / 2., cteh3 = 2. / coeff, mfact; Standard_Integer k1, k2, i, j, i0 = H.LowerRow(), j0 = H.LowerCol(), i1, j1; @@ -161,13 +161,13 @@ void FEmTool_LinearTension::Hessian(const Standard_Integer Dimension1, for (i = 0; i <= degH; i++) { k1 = (i <= myOrder) ? i : i - myOrder - 1; - mfact = Pow(coeff, k1) * cteh3; + mfact = std::pow(coeff, k1) * cteh3; // Hermite*Hermite part of matrix j1 = j0 + i; for (j = i; j <= degH; j++) { k2 = (j <= myOrder) ? j : j - myOrder - 1; - H(i1, j1) = mfact * Pow(coeff, k2) * RefMatrix(i, j); + H(i1, j1) = mfact * std::pow(coeff, k2) * RefMatrix(i, j); if (i != j) H(j1, i1) = H(i1, j1); j1++; @@ -204,7 +204,7 @@ void FEmTool_LinearTension::Gradient(const Standard_Integer Dimension, math_Vect if (Dimension < myCoeff->LowerCol() || Dimension > myCoeff->UpperCol()) throw Standard_OutOfRange("FEmTool_LinearTension::Gradient"); - Standard_Integer deg = Min(G.Length() - 1, myCoeff->ColLength() - 1); + Standard_Integer deg = std::min(G.Length() - 1, myCoeff->ColLength() - 1); math_Vector X(0, deg); Standard_Integer i, i1 = myCoeff->LowerRow(); diff --git a/src/ModelingData/TKGeomBase/FEmTool/FEmTool_ProfileMatrix.cxx b/src/ModelingData/TKGeomBase/FEmTool/FEmTool_ProfileMatrix.cxx index 9d708c7fb1..489f5c1f5e 100644 --- a/src/ModelingData/TKGeomBase/FEmTool/FEmTool_ProfileMatrix.cxx +++ b/src/ModelingData/TKGeomBase/FEmTool/FEmTool_ProfileMatrix.cxx @@ -117,7 +117,7 @@ Standard_Boolean FEmTool_ProfileMatrix::Decompose() { return Standard_False; // Matrix is not positive defined } - a = Sqrt(a); + a = std::sqrt(a); SMA[DiagAddr] = a; CurrAddr = DiagAddr; @@ -128,7 +128,7 @@ Standard_Boolean FEmTool_ProfileMatrix::Decompose() // Computation of Sum of S .S for k = 1,..,j-1 // ik jk Sum = 0; - Kmin = Max((i - profile(1, i)), Kj); + Kmin = std::max((i - profile(1, i)), Kj); ik = profile(2, i) - i + Kmin; jk = DiagAddr - j + Kmin; for (k = Kmin; k < j; k++, ik++, jk++) diff --git a/src/ModelingData/TKGeomBase/GC/GC_MakeCylindricalSurface.cxx b/src/ModelingData/TKGeomBase/GC/GC_MakeCylindricalSurface.cxx index 25861572ce..099963e09e 100644 --- a/src/ModelingData/TKGeomBase/GC/GC_MakeCylindricalSurface.cxx +++ b/src/ModelingData/TKGeomBase/GC/GC_MakeCylindricalSurface.cxx @@ -91,7 +91,7 @@ GC_MakeCylindricalSurface::GC_MakeCylindricalSurface(const gp_Cylinder& Cyl, const Standard_Real Dist) { TheError = gce_Done; - Standard_Real R = Abs(Cyl.Radius() - Dist); + Standard_Real R = std::abs(Cyl.Radius() - Dist); TheCylinder = new Geom_CylindricalSurface(Cyl); TheCylinder->SetRadius(R); } diff --git a/src/ModelingData/TKGeomBase/GC/GC_MakePlane.cxx b/src/ModelingData/TKGeomBase/GC/GC_MakePlane.cxx index 5858602545..8cc911a7fb 100644 --- a/src/ModelingData/TKGeomBase/GC/GC_MakePlane.cxx +++ b/src/ModelingData/TKGeomBase/GC/GC_MakePlane.cxx @@ -43,7 +43,7 @@ GC_MakePlane::GC_MakePlane(const Standard_Real A, const Standard_Real C, const Standard_Real D) { - if (Sqrt(A * A + B * B + C * C) <= gp::Resolution()) + if (std::sqrt(A * A + B * B + C * C) <= gp::Resolution()) { TheError = gce_BadEquation; } diff --git a/src/ModelingData/TKGeomBase/GC/GC_MakePlane.hxx b/src/ModelingData/TKGeomBase/GC/GC_MakePlane.hxx index c23602a93a..844c415109 100644 --- a/src/ModelingData/TKGeomBase/GC/GC_MakePlane.hxx +++ b/src/ModelingData/TKGeomBase/GC/GC_MakePlane.hxx @@ -54,7 +54,7 @@ public: //! Creates a plane from its cartesian equation : //! Ax + By + Cz + D = 0.0 - //! Status is "BadEquation" if Sqrt (A*A + B*B + C*C) + //! Status is "BadEquation" if std::sqrt(A*A + B*B + C*C) //! <= Resolution from gp Standard_EXPORT GC_MakePlane(const Standard_Real A, const Standard_Real B, diff --git a/src/ModelingData/TKGeomBase/GCPnts/GCPnts_AbscissaPoint.cxx b/src/ModelingData/TKGeomBase/GCPnts/GCPnts_AbscissaPoint.cxx index ad224f96dc..f2b974ac92 100644 --- a/src/ModelingData/TKGeomBase/GCPnts/GCPnts_AbscissaPoint.cxx +++ b/src/ModelingData/TKGeomBase/GCPnts/GCPnts_AbscissaPoint.cxx @@ -74,7 +74,7 @@ static void Compute(CPnts_AbscissaPoint& theComputer, const Standard_Real theEPSILON) { // test for easy solution - if (Abs(theAbscis) <= Precision::Confusion()) + if (std::abs(theAbscis) <= Precision::Confusion()) { theComputer.SetParameter(theU0); return; @@ -111,7 +111,7 @@ static void Compute(CPnts_AbscissaPoint& theComputer, while (anIndex >= 1 && anIndex <= aNbIntervals) { aL = CPnts_AbscissaPoint::Length(theC, theU0, aTI(anIndex + aDirection)); - if (Abs(aL - theAbscis) <= Precision::Confusion()) + if (std::abs(aL - theAbscis) <= Precision::Confusion()) { theComputer.SetParameter(aTI(anIndex + aDirection)); return; @@ -203,7 +203,7 @@ static void AdvCompute(CPnts_AbscissaPoint& theComputer, if (anIndex == 0 && aDirection > 0) { aL = CPnts_AbscissaPoint::Length(theC, theU0, aTI(anIndex + aDirection), theEPSILON); - if (Abs(aL - theAbscis) <= /*Precision::Confusion()*/ theEPSILON) + if (std::abs(aL - theAbscis) <= /*Precision::Confusion()*/ theEPSILON) { theComputer.SetParameter(aTI(anIndex + aDirection)); return; @@ -231,7 +231,7 @@ static void AdvCompute(CPnts_AbscissaPoint& theComputer, while (anIndex >= 1 && anIndex <= aNbIntervals) { aL = CPnts_AbscissaPoint::Length(theC, theU0, aTI(anIndex + aDirection), theEPSILON); - if (Abs(aL - theAbscis) <= Precision::PConfusion()) + if (std::abs(aL - theAbscis) <= Precision::PConfusion()) { theComputer.SetParameter(aTI(anIndex + aDirection)); return; @@ -278,13 +278,13 @@ static void AdvCompute(CPnts_AbscissaPoint& theComputer, { if (aSign > 0) { - theUi = Min(theUi, theC.LastParameter()); - aU1 = Min(aU1, theC.LastParameter()); + theUi = std::min(theUi, theC.LastParameter()); + aU1 = std::min(aU1, theC.LastParameter()); } else { - theUi = Max(theUi, theC.FirstParameter()); - aU1 = Max(aU1, theC.FirstParameter()); + theUi = std::max(theUi, theC.FirstParameter()); + aU1 = std::max(aU1, theC.FirstParameter()); } } @@ -383,7 +383,7 @@ Standard_Real GCPnts_AbscissaPoint::length(const TheCurve& theC, switch (aType) { case GCPnts_LengthParametrized: { - return Abs(theU2 - theU1) * aRatio; + return std::abs(theU2 - theU1) * aRatio; } case GCPnts_Parametrized: { return theTol != NULL ? CPnts_AbscissaPoint::Length(theC, theU1, theU2, *theTol) @@ -393,8 +393,8 @@ Standard_Real GCPnts_AbscissaPoint::length(const TheCurve& theC, const Standard_Integer aNbIntervals = theC.NbIntervals(GeomAbs_CN); TColStd_Array1OfReal aTI(1, aNbIntervals + 1); theC.Intervals(aTI, GeomAbs_CN); - const Standard_Real aUU1 = Min(theU1, theU2); - const Standard_Real aUU2 = Max(theU1, theU2); + const Standard_Real aUU1 = std::min(theU1, theU2); + const Standard_Real aUU2 = std::max(theU1, theU2); Standard_Real aL = 0.0; for (Standard_Integer anIndex = 1; anIndex <= aNbIntervals; ++anIndex) { @@ -409,14 +409,15 @@ Standard_Real GCPnts_AbscissaPoint::length(const TheCurve& theC, if (theTol != NULL) { aL += CPnts_AbscissaPoint::Length(theC, - Max(aTI(anIndex), aUU1), - Min(aTI(anIndex + 1), aUU2), + std::max(aTI(anIndex), aUU1), + std::min(aTI(anIndex + 1), aUU2), *theTol); } else { - aL += - CPnts_AbscissaPoint::Length(theC, Max(aTI(anIndex), aUU1), Min(aTI(anIndex + 1), aUU2)); + aL += CPnts_AbscissaPoint::Length(theC, + std::max(aTI(anIndex), aUU1), + std::min(aTI(anIndex + 1), aUU2)); } } return aL; diff --git a/src/ModelingData/TKGeomBase/GCPnts/GCPnts_QuasiUniformDeflection.cxx b/src/ModelingData/TKGeomBase/GCPnts/GCPnts_QuasiUniformDeflection.cxx index e3479b8cb4..4801a26a35 100644 --- a/src/ModelingData/TKGeomBase/GCPnts/GCPnts_QuasiUniformDeflection.cxx +++ b/src/ModelingData/TKGeomBase/GCPnts/GCPnts_QuasiUniformDeflection.cxx @@ -307,8 +307,8 @@ static Standard_Boolean PerformCircular(const TheCurve& theC, const Standard_Real theU1, const Standard_Real theU2) { - Standard_Real anAngle = Max(1.0 - (theDeflection / theC.Circle().Radius()), 0.0); - anAngle = 2.0 * ACos(anAngle); + Standard_Real anAngle = std::max(1.0 - (theDeflection / theC.Circle().Radius()), 0.0); + anAngle = 2.0 * std::acos(anAngle); Standard_Integer aNbPoints = (Standard_Integer)((theU2 - theU1) / anAngle); aNbPoints += 2; anAngle = (theU2 - theU1) / (Standard_Real)(aNbPoints - 1); @@ -441,7 +441,7 @@ static Standard_Boolean PerformComposite(TColStd_SequenceOfReal& theParameters, Standard_Real aUa = theU1; for (Standard_Integer anIndex = aPIndex;;) { - Standard_Real aUb = anIndex + 1 <= aTI.Upper() ? Min(theU2, aTI(anIndex + 1)) : theU2; + Standard_Real aUb = anIndex + 1 <= aTI.Upper() ? std::min(theU2, aTI(anIndex + 1)) : theU2; if (!PerformCurve(theParameters, thePoints, theC, @@ -593,15 +593,16 @@ void GCPnts_QuasiUniformDeflection::initialize(const TheCurve& theC, myParams.Clear(); myPoints.Clear(); - const Standard_Real anEPSILON = Min(theC.Resolution(Precision::Confusion()), 1.e50); + const Standard_Real anEPSILON = std::min(theC.Resolution(Precision::Confusion()), 1.e50); const GCPnts_DeflectionType aType = GetDefType(theC); - const Standard_Real aU1 = Min(theU1, theU2); - const Standard_Real aU2 = Max(theU1, theU2); + const Standard_Real aU1 = std::min(theU1, theU2); + const Standard_Real aU2 = std::max(theU1, theU2); if (aType == GCPnts_Curved || aType == GCPnts_DefComposite) { if (theC.GetType() == GeomAbs_BSplineCurve || theC.GetType() == GeomAbs_BezierCurve) { - const Standard_Real aMaxPar = Max(Abs(theC.FirstParameter()), Abs(theC.LastParameter())); + const Standard_Real aMaxPar = + std::max(std::abs(theC.FirstParameter()), std::abs(theC.LastParameter())); if (anEPSILON < Epsilon(aMaxPar)) { return; diff --git a/src/ModelingData/TKGeomBase/GCPnts/GCPnts_TangentialDeflection.cxx b/src/ModelingData/TKGeomBase/GCPnts/GCPnts_TangentialDeflection.cxx index 5f5432a399..668292d68f 100644 --- a/src/ModelingData/TKGeomBase/GCPnts/GCPnts_TangentialDeflection.cxx +++ b/src/ModelingData/TKGeomBase/GCPnts/GCPnts_TangentialDeflection.cxx @@ -323,7 +323,7 @@ void GCPnts_TangentialDeflection::EvaluateDu(const TheCurve& theC, Standard_Real Ln = Lc / Lt; if (Ln > LTol) { - theDu = sqrt(8.0 * Max(myCurvatureDeflection, myMinLen) / Ln); + theDu = sqrt(8.0 * std::max(myCurvatureDeflection, myMinLen) / Ln); theNotDone = Standard_False; } } @@ -369,8 +369,8 @@ void GCPnts_TangentialDeflection::PerformCircular(const TheCurve& theC) const Standard_Real aDiff = myLastU - myFirstu; // Round up number of points to satisfy curvatureDeflection more precisely - Standard_Integer NbPoints = (Standard_Integer)Min(Ceiling(aDiff / Du), 1.0e+6); - NbPoints = Max(NbPoints, myMinNbPnts - 1); + Standard_Integer NbPoints = (Standard_Integer)std::min(std::ceil(aDiff / Du), 1.0e+6); + NbPoints = std::max(NbPoints, myMinNbPnts - 1); Du = aDiff / NbPoints; gp_Pnt P; @@ -417,8 +417,8 @@ void GCPnts_TangentialDeflection::initialize(const TheCurve& theC, myUTol = theUTol; myAngularDeflection = theAngularDeflection; myCurvatureDeflection = theCurvatureDeflection; - myMinNbPnts = Max(theMinimumOfPoints, 2); - myMinLen = Max(theMinLen, Precision::Confusion()); + myMinNbPnts = std::max(theMinimumOfPoints, 2); + myMinLen = std::max(theMinLen, Precision::Confusion()); switch (theC.GetType()) { @@ -504,14 +504,14 @@ Standard_Real GCPnts_TangentialDeflection::ArcAngularStep(const Standard_Real th Standard_Real Du = 0.0, aMinSizeAng = 0.0; if (theRadius > aPrecision) { - Du = Max(1.0 - (theLinearDeflection / theRadius), 0.0); + Du = std::max(1.0 - (theLinearDeflection / theRadius), 0.0); // It is not suitable to consider min size greater than 1/4 arc len. if (theMinLength > aPrecision) - aMinSizeAng = Min(theMinLength / theRadius, M_PI_2); + aMinSizeAng = std::min(theMinLength / theRadius, M_PI_2); } - Du = 2.0 * ACos(Du); - Du = Max(Min(Du, theAngularDeflection), aMinSizeAng); + Du = 2.0 * std::acos(Du); + Du = std::max(std::min(Du, theAngularDeflection), aMinSizeAng); return Du; } @@ -567,12 +567,12 @@ void GCPnts_TangentialDeflection::PerformCurve(const TheCurve& theC) { case GeomAbs_BSplineCurve: { Handle(typename GCPnts_TCurveTypes::BSplineCurve) BS = theC.BSpline(); - NbPoints = Max(BS->Degree() + 1, NbPoints); + NbPoints = std::max(BS->Degree() + 1, NbPoints); break; } case GeomAbs_BezierCurve: { Handle(typename GCPnts_TCurveTypes::BezierCurve) BZ = theC.Bezier(); - NbPoints = Max(BZ->Degree() + 1, NbPoints); + NbPoints = std::max(BZ->Degree() + 1, NbPoints); break; } default: { @@ -738,7 +738,7 @@ void GCPnts_TangentialDeflection::PerformCurve(const TheCurve& theC) } // On retient le plus penalisant - Coef = Max(ACoef, FCoef); + Coef = std::max(ACoef, FCoef); if (isNeedToCheck && Coef < 0.55) { @@ -755,7 +755,7 @@ void GCPnts_TangentialDeflection::PerformCurve(const TheCurve& theC) if (Coef <= 1.0) { - if (Abs(myLastU - U2) < myUTol) + if (std::abs(myLastU - U2) < myUTol) { myParameters.Append(myLastU); myPoints.Append(LastPoint); @@ -781,7 +781,7 @@ void GCPnts_TangentialDeflection::PerformCurve(const TheCurve& theC) { TooSmall = Standard_True; // Standard_Real UUU2 = U2; - Du += Min((U2 - U1) * (1. - Coef), Du * Us3); + Du += std::min((U2 - U1) * (1. - Coef), Du * Us3); U2 = U1 + Du; if (U2 > myLastU) @@ -866,7 +866,7 @@ void GCPnts_TangentialDeflection::PerformCurve(const TheCurve& theC) // Recalage avant dernier point : i = myPoints.Length() - 1; // Real d = myPoints (i).Distance (myPoints (i+1)); - // if (Abs(myParameters (i) - myParameters (i+1))<= 0.000001 || d < Precision::Confusion()) { + // if (std::abs(myParameters (i) - myParameters (i+1))<= 0.000001 || d < Precision::Confusion()) { // cout<<"deux points confondus"<::DistFunction aFunc(theC, theU1, theU2); // const Standard_Integer aNbIter = 100; - const Standard_Real aRelTol = Max(1.e-3, 2. * myUTol / (Abs(theU1) + Abs(theU2))); + const Standard_Real aRelTol = std::max(1.e-3, 2. * myUTol / (std::abs(theU1) + std::abs(theU2))); // math_BrentMinimum anOptLoc(aRelTol, aNbIter, myUTol); anOptLoc.Perform(aFunc, theU1, (theU1 + theU2) / 2., theU2); if (anOptLoc.IsDone()) { - theMaxDefl = Sqrt(-anOptLoc.Minimum()); + theMaxDefl = std::sqrt(-anOptLoc.Minimum()); theUMax = anOptLoc.Location(); return; } // math_Vector aLowBorder(1, 1), aUppBorder(1, 1), aSteps(1, 1); - aSteps(1) = Max(0.1 * Du, 100. * myUTol); - const Standard_Integer aNbParticles = Max(8, RealToInt(32 * (theU2 - theU1) / Du)); + aSteps(1) = std::max(0.1 * Du, 100. * myUTol); + const Standard_Integer aNbParticles = std::max(8, RealToInt(32 * (theU2 - theU1) / Du)); aLowBorder(1) = theU1; aUppBorder(1) = theU2; // @@ -981,14 +981,17 @@ void GCPnts_TangentialDeflection::EstimDefl(const TheCurve& theC, math_PSO aFinder(&aFuncMV, aLowBorder, aUppBorder, aSteps, aNbParticles); aFinder.Perform(aSteps, aValue, aT); // - anOptLoc.Perform(aFunc, Max(aT(1) - aSteps(1), theU1), aT(1), Min(aT(1) + aSteps(1), theU2)); + anOptLoc.Perform(aFunc, + std::max(aT(1) - aSteps(1), theU1), + aT(1), + std::min(aT(1) + aSteps(1), theU2)); if (anOptLoc.IsDone()) { - theMaxDefl = Sqrt(-anOptLoc.Minimum()); + theMaxDefl = std::sqrt(-anOptLoc.Minimum()); theUMax = anOptLoc.Location(); return; } - theMaxDefl = Sqrt(-aValue); + theMaxDefl = std::sqrt(-aValue); theUMax = aT(1); } diff --git a/src/ModelingData/TKGeomBase/GCPnts/GCPnts_UniformAbscissa.cxx b/src/ModelingData/TKGeomBase/GCPnts/GCPnts_UniformAbscissa.cxx index afacccfe88..d2775cb9ba 100644 --- a/src/ModelingData/TKGeomBase/GCPnts/GCPnts_UniformAbscissa.cxx +++ b/src/ModelingData/TKGeomBase/GCPnts/GCPnts_UniformAbscissa.cxx @@ -97,7 +97,7 @@ static Standard_Boolean Perform(TColStd_Array1OfReal& theParameters, const Standard_Real theEPSILON) { Standard_Boolean isLocalDone = Standard_True; - Standard_Real aUU1 = Min(theU1, theU2), aUU2 = Max(theU1, theU2); + Standard_Real aUU1 = std::min(theU1, theU2), aUU2 = std::max(theU1, theU2); theNbPoints = 0; // this initialization avoids the computation of the Length of the curve @@ -125,7 +125,7 @@ static Standard_Boolean Perform(TColStd_Array1OfReal& theParameters, { anIndex += 1; aUi = anAbscissaFinder.Parameter(); - if (Abs(aUi - aUU2) <= theEPSILON) + if (std::abs(aUi - aUU2) <= theEPSILON) { theParameters.SetValue(anIndex, aUU2); isNotDone = Standard_False; @@ -168,8 +168,8 @@ static Standard_Boolean PerformLengthParametrized(TColStd_Array1OfReal& theParam Standard_Integer& theNbPoints, const Standard_Real theEPSILON) { - Standard_Real aUU1 = Min(theU1, theU2); - Standard_Real aUU2 = Max(theU1, theU2); + Standard_Real aUU1 = std::min(theU1, theU2); + Standard_Real aUU2 = std::max(theU1, theU2); // Ratio is defined as dl = Ratio * du // for a circle of gp Ratio is equal to the radius of the circle. @@ -177,8 +177,8 @@ static Standard_Boolean PerformLengthParametrized(TColStd_Array1OfReal& theParam const Standard_Real aRatio = GetParameterLengthRatio(theC); if (theAbscissa < 0.0e0) { - aUU2 = Min(theU1, theU2); - aUU1 = Max(theU1, theU2); + aUU2 = std::min(theU1, theU2); + aUU1 = std::max(theU1, theU2); } const Standard_Real aDelta = (theAbscissa / theTotalLength) * (aUU2 - aUU1); @@ -189,7 +189,7 @@ static Standard_Boolean PerformLengthParametrized(TColStd_Array1OfReal& theParam { anIndex += 1; const Standard_Real aUi = theParameters.Value(anIndex - 1) + aDelta; - if (Abs(aUi - aUU2) <= theEPSILON) + if (std::abs(aUi - aUU2) <= theEPSILON) { theParameters.SetValue(anIndex, aUU2); isNotDone = Standard_False; @@ -201,7 +201,7 @@ static Standard_Boolean PerformLengthParametrized(TColStd_Array1OfReal& theParam else { isNotDone = Standard_False; - if (Abs(theParameters.Value(anIndex - 1) - aUU2) * aRatio / theAbscissa < 0.1) + if (std::abs(theParameters.Value(anIndex - 1) - aUU2) * aRatio / theAbscissa < 0.1) { theParameters.SetValue(anIndex - 1, aUU2); anIndex -= 1; @@ -385,7 +385,7 @@ void GCPnts_UniformAbscissa::initialize(const TheCurve& theC, myNbPoints = 0; myDone = Standard_False; - const Standard_Real anEPSILON = theC.Resolution(Max(theTol, Precision::Confusion())); + const Standard_Real anEPSILON = theC.Resolution(std::max(theTol, Precision::Confusion())); const Standard_Real aL = GCPnts_AbscissaPoint::Length(theC, theU1, theU2, anEPSILON); if (aL <= Precision::Confusion()) { @@ -395,7 +395,7 @@ void GCPnts_UniformAbscissa::initialize(const TheCurve& theC, // compute the total Length here so that we can guess // the number of points instead of letting the constructor // of CPnts_AbscissaPoint do that and lose the information - const Standard_Real aSizeR = aL / Abs(theAbscissa) + 5; + const Standard_Real aSizeR = aL / std::abs(theAbscissa) + 5; if (aSizeR >= IntegerLast()) // modified by Igor Motchalov 23/04/2001 { return; @@ -499,7 +499,7 @@ void GCPnts_UniformAbscissa::initialize(const TheCurve& theC, myNbPoints = 0; myDone = Standard_False; - const Standard_Real anEPSILON = theC.Resolution(Max(theTol, Precision::Confusion())); + const Standard_Real anEPSILON = theC.Resolution(std::max(theTol, Precision::Confusion())); // although very similar to Initialize with Abscissa this avoid // the computation of the total length of the curve twice const Standard_Real aL = GCPnts_AbscissaPoint::Length(theC, theU1, theU2, anEPSILON); diff --git a/src/ModelingData/TKGeomBase/GCPnts/GCPnts_UniformDeflection.cxx b/src/ModelingData/TKGeomBase/GCPnts/GCPnts_UniformDeflection.cxx index 02e89d852d..76e6c67ef4 100644 --- a/src/ModelingData/TKGeomBase/GCPnts/GCPnts_UniformDeflection.cxx +++ b/src/ModelingData/TKGeomBase/GCPnts/GCPnts_UniformDeflection.cxx @@ -190,8 +190,8 @@ static Standard_Boolean PerformCircular(const TheCurve& theC, const Standard_Real theU2) { gp_Pnt aPoint; - Standard_Real anAngle = Max(1.0 - (theDeflection / theC.Circle().Radius()), 0.0); - anAngle = 2.0e0 * ACos(anAngle); + Standard_Real anAngle = std::max(1.0 - (theDeflection / theC.Circle().Radius()), 0.0); + anAngle = 2.0e0 * std::acos(anAngle); Standard_Integer aNbPoints = (Standard_Integer)((theU2 - theU1) / anAngle); aNbPoints += 2; anAngle = (theU2 - theU1) / (Standard_Real)(aNbPoints - 1); @@ -280,7 +280,7 @@ static Standard_Boolean PerformComposite(TColStd_SequenceOfReal& theParameters, Standard_Real aUa = theU1; for (Standard_Integer anIndex = aPIndex;;) { - Standard_Real aUb = anIndex + 1 <= aTI.Upper() ? Min(theU2, aTI(anIndex + 1)) : theU2; + Standard_Real aUb = anIndex + 1 <= aTI.Upper() ? std::min(theU2, aTI(anIndex + 1)) : theU2; if (!PerformCurve(theParameters, thePoints, theC, @@ -321,8 +321,8 @@ void GCPnts_UniformDeflection::initialize(const TheCurve& theC, myParams.Clear(); myPoints.Clear(); - const Standard_Real aU1 = Min(theU1, theU2); - const Standard_Real aU2 = Max(theU1, theU2); + const Standard_Real aU1 = std::min(theU1, theU2); + const Standard_Real aU2 = std::max(theU1, theU2); const GCPnts_DeflectionType aType = GetDefType(theC); switch (aType) { diff --git a/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert.cxx b/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert.cxx index 373f1d8d1c..764c2aacb1 100644 --- a/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert.cxx +++ b/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert.cxx @@ -125,8 +125,8 @@ Handle(Geom2d_BSplineCurve) Geom2dConvert::SplitBSplineCurve( Standard_Integer TheLast = C->LastUKnotIndex(); if (FromK1 == ToK2) throw Standard_DomainError(); - Standard_Integer FirstK = Min(FromK1, ToK2); - Standard_Integer LastK = Max(FromK1, ToK2); + Standard_Integer FirstK = std::min(FromK1, ToK2); + Standard_Integer LastK = std::max(FromK1, ToK2); if (FirstK < TheFirst || LastK > TheLast) throw Standard_OutOfRange(); @@ -157,8 +157,8 @@ Handle(Geom2d_BSplineCurve) Geom2dConvert::SplitBSplineCurve( const Standard_Real, // ParametricTolerance, const Standard_Boolean SameOrientation) { - Standard_Real FirstU = Min(FromU1, ToU2); - Standard_Real LastU = Max(FromU1, ToU2); + Standard_Real FirstU = std::min(FromU1, ToU2); + Standard_Real LastU = std::max(FromU1, ToU2); Handle(Geom2d_BSplineCurve) C1 = Handle(Geom2d_BSplineCurve)::DownCast(C->Copy()); @@ -509,7 +509,7 @@ static Handle(Geom2d_BSplineCurve) MultNumandDenom(const Handle(Geom2d_BSplineCu BS->KnotSequence(BSFlatKnots); start_value = BSKnots(1); end_value = BSKnots(BS->NbKnots()); - Standard_Real tolerance = 10. * Epsilon(Abs(end_value)); + Standard_Real tolerance = 10. * Epsilon(std::abs(end_value)); a->Knots(aKnots); a->Poles(aPoles); @@ -843,7 +843,7 @@ static GeomAbs_Shape Continuity(const Handle(Geom2d_Curve)& C1, { d1.Normalize(); d2.Normalize(); - value = Abs(d1.Dot(d2)); + value = std::abs(d1.Dot(d2)); if (value >= 1.0e0 - ta * ta) { cont = GeomAbs_G1; @@ -1026,9 +1026,8 @@ void Geom2dConvert::ConcatG1(TColGeom2d_Array1OfBSplineCurve& ArrayOfCu KnotC1(1) = 0.0; for (ii = 2; ii <= KnotC1.Length(); ii++) { - // KnotC1(ii)=(-b+Abs(a)/a*Sqrt(b*b-4*a*(c-KnotC1(ii))))/(2*a); KnotC1(ii) = - (-b + Sqrt(b * b - 4 * a * (c - KnotC1(ii)))) / (2 * a); // ifv 17.05.00 buc60667 + (-b + std::sqrt(b * b - 4 * a * (c - KnotC1(ii)))) / (2 * a); // ifv 17.05.00 buc60667 } TColgp_Array1OfPnt2d Curve1Poles(1, Curve1->NbPoles()); Curve1->Poles(Curve1Poles); @@ -1293,9 +1292,8 @@ void Geom2dConvert::ConcatC1(TColGeom2d_Array1OfBSplineCurve& ArrayOfCu KnotC1(1) = 0.0; for (ii = 2; ii <= KnotC1.Length(); ii++) { - // KnotC1(ii)=(-b+Abs(a)/a*Sqrt(b*b-4*a*(c-KnotC1(ii))))/(2*a); KnotC1(ii) = - (-b + Sqrt(b * b - 4 * a * (c - KnotC1(ii)))) / (2 * a); // ifv 17.05.00 buc60667 + (-b + std::sqrt(b * b - 4 * a * (c - KnotC1(ii)))) / (2 * a); // ifv 17.05.00 buc60667 } TColgp_Array1OfPnt2d Curve1Poles(1, Curve1->NbPoles()); Curve1->Poles(Curve1Poles); @@ -1430,7 +1428,7 @@ void Geom2dConvert::C0BSplineToC1BSplineCurve(Handle(Geom2d_BSplineCurve)& BS, nbcurveC1++; } - nbcurveC1 = Min(nbcurveC1, BS->NbKnots() - 1); + nbcurveC1 = std::min(nbcurveC1, BS->NbKnots() - 1); if (nbcurveC1 > 1) { @@ -1525,7 +1523,7 @@ void Geom2dConvert::C0BSplineToArrayOfC1BSplineCurve( nbcurveC1++; } - nbcurveC1 = Min(nbcurveC1, BS->NbKnots() - 1); + nbcurveC1 = std::min(nbcurveC1, BS->NbKnots() - 1); if (nbcurveC1 > 1) { diff --git a/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert_ApproxArcsSegments.cxx b/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert_ApproxArcsSegments.cxx index dc5d2f3b52..81c92a095d 100644 --- a/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert_ApproxArcsSegments.cxx +++ b/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert_ApproxArcsSegments.cxx @@ -254,7 +254,7 @@ Handle(Geom2d_TrimmedCurve) Geom2dConvert_ApproxArcsSegments::makeLine( // if the derivatives in the end points differ from the derivative line // more than value of the specified continuity tolerance // then a biarc should be built instead of a line. - const Standard_Real aContTolerance = ::Max(myAngleTolerance, 0.01); + const Standard_Real aContTolerance = std::max(myAngleTolerance, 0.01); if (absAngle[0] > aContTolerance || absAngle[1] > aContTolerance) { // std::cout << "makeLine(): Line not built" << std::endl; @@ -905,6 +905,6 @@ Standard_Boolean isInflectionPoint(const Standard_Real theParam, const Standard_Real aSqMod = aD1.XY().SquareModulus(); const Standard_Real aCurvature = fabs(aD1.XY() ^ aD2.XY()) / (aSqMod * sqrt(aSqMod)); Standard_Real aContAngle = fabs(gp_Vec2d(aP1.XY() - theFirstInfl.Point()).Angle(aD1)); - aContAngle = ::Min(aContAngle, fabs(M_PI - aContAngle)); + aContAngle = std::min(aContAngle, fabs(M_PI - aContAngle)); return (aCurvature < MyCurvatureTolerance && aContAngle < theAngleTol); } diff --git a/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert_CompCurveToBSplineCurve.cxx b/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert_CompCurveToBSplineCurve.cxx index 47cd92da1e..d7bcf45852 100644 --- a/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert_CompCurveToBSplineCurve.cxx +++ b/src/ModelingData/TKGeomBase/Geom2dConvert/Geom2dConvert_CompCurveToBSplineCurve.cxx @@ -138,7 +138,7 @@ void Geom2dConvert_CompCurveToBSplineCurve::Add(Handle(Geom2d_BSplineCurve)& Fir const Standard_Boolean After) { // Harmonisation des degres. - Standard_Integer Deg = Max(FirstCurve->Degree(), SecondCurve->Degree()); + Standard_Integer Deg = std::max(FirstCurve->Degree(), SecondCurve->Degree()); if (FirstCurve->Degree() < Deg) { FirstCurve->IncreaseDegree(Deg); diff --git a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert.cxx b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert.cxx index 5eef7f1407..9708a1b654 100644 --- a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert.cxx +++ b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert.cxx @@ -108,8 +108,8 @@ Handle(Geom_BSplineCurve) GeomConvert::SplitBSplineCurve(const Handle(Geom_BSpli Standard_Integer TheLast = C->LastUKnotIndex(); if (FromK1 == ToK2) throw Standard_DomainError(); - Standard_Integer FirstK = Min(FromK1, ToK2); - Standard_Integer LastK = Max(FromK1, ToK2); + Standard_Integer FirstK = std::min(FromK1, ToK2); + Standard_Integer LastK = std::max(FromK1, ToK2); if (FirstK < TheFirst || LastK > TheLast) throw Standard_DomainError(); @@ -139,8 +139,8 @@ Handle(Geom_BSplineCurve) GeomConvert::SplitBSplineCurve( const Standard_Real, // ParametricTolerance, const Standard_Boolean SameOrientation) { - Standard_Real FirstU = Min(FromU1, ToU2); - Standard_Real LastU = Max(FromU1, ToU2); + Standard_Real FirstU = std::min(FromU1, ToU2); + Standard_Real LastU = std::max(FromU1, ToU2); Handle(Geom_BSplineCurve) C1 = Handle(Geom_BSplineCurve)::DownCast(C->Copy()); @@ -330,7 +330,8 @@ Handle(Geom_BSplineCurve) GeomConvert::CurveToBSplineCurve( Standard_Real Uf = TheCurve->FirstParameter(); Standard_Real Ul = TheCurve->LastParameter(); ElCLib::AdjustPeriodic(Uf, Ul, Precision::Confusion(), U1, U2); - if (Abs(U1 - Uf) <= Precision::Confusion() && Abs(U2 - Ul) <= Precision::Confusion()) + if (std::abs(U1 - Uf) <= Precision::Confusion() + && std::abs(U2 - Ul) <= Precision::Confusion()) TheCurve->SetNotPeriodic(); } /////////////////////////////////////////////// @@ -889,9 +890,8 @@ void GeomConvert::ConcatG1(TColGeom_Array1OfBSplineCurve& ArrayOfCurves KnotC1(1) = 0.0; for (ii = 2; ii <= KnotC1.Length(); ii++) { - // KnotC1(ii)=(-b+Abs(a)/a*Sqrt(b*b-4*a*(c-KnotC1(ii))))/(2*a); KnotC1(ii) = - (-b + Sqrt(b * b - 4 * a * (c - KnotC1(ii)))) / (2 * a); // ifv 17.05.00 buc60667 + (-b + std::sqrt(b * b - 4 * a * (c - KnotC1(ii)))) / (2 * a); // ifv 17.05.00 buc60667 } TColgp_Array1OfPnt Curve1Poles(1, Curve1->NbPoles()); Curve1->Poles(Curve1Poles); @@ -1139,9 +1139,8 @@ void GeomConvert::ConcatC1(TColGeom_Array1OfBSplineCurve& ArrayOfCurves KnotC1(1) = 0.0; for (ii = 2; ii <= KnotC1.Length(); ii++) { - // KnotC1(ii)=(-b+Abs(a)/a*Sqrt(b*b-4*a*(c-KnotC1(ii))))/(2*a); KnotC1(ii) = - (-b + Sqrt(b * b - 4 * a * (c - KnotC1(ii)))) / (2 * a); // ifv 17.05.00 buc60667 + (-b + std::sqrt(b * b - 4 * a * (c - KnotC1(ii)))) / (2 * a); // ifv 17.05.00 buc60667 } TColgp_Array1OfPnt Curve1Poles(1, Curve1->NbPoles()); Curve1->Poles(Curve1Poles); diff --git a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_1.cxx b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_1.cxx index 361a86a168..cf50aa040f 100644 --- a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_1.cxx +++ b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_1.cxx @@ -129,10 +129,10 @@ Handle(Geom_BSplineSurface) GeomConvert::SplitBSplineSurface( Standard_Integer LastV = S->LastVKnotIndex(); if (FromUK1 == ToUK2 || FromVK1 == ToVK2) throw Standard_DomainError(); - Standard_Integer FirstUK = Min(FromUK1, ToUK2); - Standard_Integer LastUK = Max(FromUK1, ToUK2); - Standard_Integer FirstVK = Min(FromVK1, ToVK2); - Standard_Integer LastVK = Max(FromVK1, ToVK2); + Standard_Integer FirstUK = std::min(FromUK1, ToUK2); + Standard_Integer LastUK = std::max(FromUK1, ToUK2); + Standard_Integer FirstVK = std::min(FromVK1, ToVK2); + Standard_Integer LastVK = std::max(FromVK1, ToVK2); if (FirstUK < FirstU || LastUK > LastU || FirstVK < FirstV || LastVK > LastV) { throw Standard_DomainError(); @@ -183,8 +183,8 @@ Handle(Geom_BSplineSurface) GeomConvert::SplitBSplineSurface(const Handle(Geom_B Standard_Integer FirstU = S->FirstUKnotIndex(); Standard_Integer LastU = S->LastUKnotIndex(); - Standard_Integer FirstUK = Min(FromK1, ToK2); - Standard_Integer LastUK = Max(FromK1, ToK2); + Standard_Integer FirstUK = std::min(FromK1, ToK2); + Standard_Integer LastUK = std::max(FromK1, ToK2); if (FirstUK < FirstU || LastUK > LastU) throw Standard_DomainError(); @@ -209,8 +209,8 @@ Handle(Geom_BSplineSurface) GeomConvert::SplitBSplineSurface(const Handle(Geom_B Standard_Integer FirstV = S->FirstVKnotIndex(); Standard_Integer LastV = S->LastVKnotIndex(); - Standard_Integer FirstVK = Min(FromK1, ToK2); - Standard_Integer LastVK = Max(FromK1, ToK2); + Standard_Integer FirstVK = std::min(FromK1, ToK2); + Standard_Integer LastVK = std::max(FromK1, ToK2); if (FirstVK < FirstV || LastVK > LastV) throw Standard_DomainError(); @@ -246,10 +246,10 @@ Handle(Geom_BSplineSurface) GeomConvert::SplitBSplineSurface( const Standard_Boolean SameUOrientation, const Standard_Boolean SameVOrientation) { - Standard_Real FirstU = Min(FromU1, ToU2); - Standard_Real LastU = Max(FromU1, ToU2); - Standard_Real FirstV = Min(FromV1, ToV2); - Standard_Real LastV = Max(FromV1, ToV2); + Standard_Real FirstU = std::min(FromU1, ToU2); + Standard_Real LastU = std::max(FromU1, ToU2); + Standard_Real FirstV = std::min(FromV1, ToV2); + Standard_Real LastV = std::max(FromV1, ToV2); Handle(Geom_BSplineSurface) NewSurface = Handle(Geom_BSplineSurface)::DownCast(S->Copy()); @@ -288,7 +288,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SplitBSplineSurface( const Standard_Real ParametricTolerance, const Standard_Boolean SameOrientation) { - if (Abs(FromParam1 - ToParam2) <= Abs(ParametricTolerance)) + if (std::abs(FromParam1 - ToParam2) <= std::abs(ParametricTolerance)) { throw Standard_DomainError(); } @@ -296,8 +296,8 @@ Handle(Geom_BSplineSurface) GeomConvert::SplitBSplineSurface( if (USplit) { - Standard_Real FirstU = Min(FromParam1, ToParam2); - Standard_Real LastU = Max(FromParam1, ToParam2); + Standard_Real FirstU = std::min(FromParam1, ToParam2); + Standard_Real LastU = std::max(FromParam1, ToParam2); Standard_Real FirstV = S->VKnot(S->FirstVKnotIndex()); Standard_Real LastV = S->VKnot(S->LastVKnotIndex()); @@ -318,8 +318,8 @@ Handle(Geom_BSplineSurface) GeomConvert::SplitBSplineSurface( { Standard_Real FirstU = S->UKnot(S->FirstUKnotIndex()); Standard_Real LastU = S->UKnot(S->LastUKnotIndex()); - Standard_Real FirstV = Min(FromParam1, ToParam2); - Standard_Real LastV = Max(FromParam1, ToParam2); + Standard_Real FirstV = std::min(FromParam1, ToParam2); + Standard_Real LastV = std::max(FromParam1, ToParam2); NewSurface->Segment(FirstU, LastU, FirstV, LastV); @@ -344,10 +344,10 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface(const Handle(Ge Standard_Real U1, U2, V1, V2; Sr->Bounds(U1, U2, V1, V2); - Standard_Real UFirst = Min(U1, U2); - Standard_Real ULast = Max(U1, U2); - Standard_Real VFirst = Min(V1, V2); - Standard_Real VLast = Max(V1, V2); + Standard_Real UFirst = std::min(U1, U2); + Standard_Real ULast = std::max(U1, U2); + Standard_Real VFirst = std::min(V1, V2); + Standard_Real VLast = std::max(V1, V2); // If the surface Sr is infinite stop the computation if (Precision::IsNegativeInfinite(UFirst) || Precision::IsPositiveInfinite(ULast) @@ -401,8 +401,9 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface(const Handle(Ge } // // For cylinders, cones, spheres, toruses - const Standard_Boolean isUClosed = Abs((ULast - UFirst) - 2. * M_PI) <= Precision::PConfusion(); - const Standard_Real eps = 100. * Epsilon(2. * M_PI); + const Standard_Boolean isUClosed = + std::abs((ULast - UFirst) - 2. * M_PI) <= Precision::PConfusion(); + const Standard_Real eps = 100. * Epsilon(2. * M_PI); // if (Surf->IsKind(STANDARD_TYPE(Geom_Plane))) { @@ -437,7 +438,8 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface(const Handle(Ge Convert_CylinderToBSplineSurface Convert(Cyl, VFirst, VLast); TheSurface = BSplineSurfaceBuilder(Convert); Standard_Integer aNbK = TheSurface->NbUKnots(); - if (Abs(TheSurface->UKnot(1) - UFirst) > eps || Abs(TheSurface->UKnot(aNbK) - ULast) > eps) + if (std::abs(TheSurface->UKnot(1) - UFirst) > eps + || std::abs(TheSurface->UKnot(aNbK) - ULast) > eps) { TheSurface->CheckAndSegment(UFirst, ULast, VFirst, VLast); } @@ -458,7 +460,8 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface(const Handle(Ge Convert_ConeToBSplineSurface Convert(Co, VFirst, VLast); TheSurface = BSplineSurfaceBuilder(Convert); Standard_Integer aNbK = TheSurface->NbUKnots(); - if (Abs(TheSurface->UKnot(1) - UFirst) > eps || Abs(TheSurface->UKnot(aNbK) - ULast) > eps) + if (std::abs(TheSurface->UKnot(1) - UFirst) > eps + || std::abs(TheSurface->UKnot(aNbK) - ULast) > eps) { TheSurface->CheckAndSegment(UFirst, ULast, VFirst, VLast); } @@ -482,7 +485,8 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface(const Handle(Ge Convert_SphereToBSplineSurface Convert(Sph, VFirst, VLast, Standard_False); TheSurface = BSplineSurfaceBuilder(Convert); Standard_Integer aNbK = TheSurface->NbUKnots(); - if (Abs(TheSurface->UKnot(1) - UFirst) > eps || Abs(TheSurface->UKnot(aNbK) - ULast) > eps) + if (std::abs(TheSurface->UKnot(1) - UFirst) > eps + || std::abs(TheSurface->UKnot(aNbK) - ULast) > eps) { TheSurface->CheckAndSegment(UFirst, ULast, VFirst, VLast); } @@ -510,7 +514,8 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface(const Handle(Ge Convert_TorusToBSplineSurface Convert(Tr, VFirst, VLast, Standard_False); TheSurface = BSplineSurfaceBuilder(Convert); Standard_Integer aNbK = TheSurface->NbUKnots(); - if (Abs(TheSurface->UKnot(1) - UFirst) > eps || Abs(TheSurface->UKnot(aNbK) - ULast) > eps) + if (std::abs(TheSurface->UKnot(1) - UFirst) > eps + || std::abs(TheSurface->UKnot(aNbK) - ULast) > eps) { TheSurface->CheckAndSegment(UFirst, ULast, VFirst, VLast); } @@ -520,7 +525,8 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface(const Handle(Ge Convert_TorusToBSplineSurface Convert(Tr, UFirst, ULast); TheSurface = BSplineSurfaceBuilder(Convert); Standard_Integer aNbK = TheSurface->NbVKnots(); - if (Abs(TheSurface->VKnot(1) - VFirst) > eps || Abs(TheSurface->VKnot(aNbK) - VLast) > eps) + if (std::abs(TheSurface->VKnot(1) - VFirst) > eps + || std::abs(TheSurface->VKnot(aNbK) - VLast) > eps) { TheSurface->CheckAndSegment(UFirst, ULast, VFirst, VLast); } @@ -573,7 +579,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface(const Handle(Ge else { // Nombre de spans : ouverture maximale = 150 degres ( = PI / 1.2 rds) - nbUSpans = (Standard_Integer)IntegerPart(1.2 * (ULast - UFirst) / M_PI) + 1; + nbUSpans = (Standard_Integer)std::trunc(1.2 * (ULast - UFirst) / M_PI) + 1; AlfaU = (ULast - UFirst) / (nbUSpans * 2); NbUPoles = 2 * nbUSpans + 1; NbUKnots = nbUSpans + 1; @@ -613,7 +619,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface(const Handle(Ge } } gp_GTrsf Aff; - Aff.SetAffinity(Revol->Axis(), 1 / Cos(AlfaU)); + Aff.SetAffinity(Revol->Axis(), 1 / std::cos(AlfaU)); gp_XYZ coord; for (j = 1; j <= NbVPoles; j++) { @@ -627,7 +633,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface(const Handle(Ge for (j = 1; j <= NbVPoles; j++) { NewPoles(i, j) = Poles(j).Transformed(Trsf); - NewWeights(i, j) = Weights(j) * Cos(AlfaU); + NewWeights(i, j) = Weights(j) * std::cos(AlfaU); } } @@ -850,7 +856,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface(const Handle(Ge } } gp_GTrsf Aff; - Aff.SetAffinity(Revol->Axis(), 1 / Cos(AlfaU)); + Aff.SetAffinity(Revol->Axis(), 1 / std::cos(AlfaU)); gp_XYZ coord; for (j = 1; j <= NbVPoles; j++) { @@ -864,7 +870,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface(const Handle(Ge for (j = 1; j <= NbVPoles; j++) { NewPoles(i, j) = Poles(j).Transformed(Trsf); - NewWeights(i, j) = Weights(j) * Cos(AlfaU); + NewWeights(i, j) = Weights(j) * std::cos(AlfaU); } } diff --git a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_CompCurveToBSplineCurve.cxx b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_CompCurveToBSplineCurve.cxx index ca3f095841..5b83fbc7e0 100644 --- a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_CompCurveToBSplineCurve.cxx +++ b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_CompCurveToBSplineCurve.cxx @@ -131,7 +131,7 @@ void GeomConvert_CompCurveToBSplineCurve::Add(Handle(Geom_BSplineCurve)& FirstCu const Standard_Integer MinM) { // Harmonisation des degres. - Standard_Integer Deg = Max(FirstCurve->Degree(), SecondCurve->Degree()); + Standard_Integer Deg = std::max(FirstCurve->Degree(), SecondCurve->Degree()); if (FirstCurve->Degree() < Deg) { FirstCurve->IncreaseDegree(Deg); @@ -192,7 +192,7 @@ void GeomConvert_CompCurveToBSplineCurve::Add(Handle(Geom_BSplineCurve)& FirstCu Noeuds(ii) = Ratio1 * FirstCurve->Knot(ii) - Delta1; if (ii > 1) { - eps = Epsilon(Abs(Noeuds(ii - 1))); + eps = Epsilon(std::abs(Noeuds(ii - 1))); if (eps < 5.e-10) eps = 5.e-10; if (Noeuds(ii) - Noeuds(ii - 1) <= eps) @@ -206,7 +206,7 @@ void GeomConvert_CompCurveToBSplineCurve::Add(Handle(Geom_BSplineCurve)& FirstCu for (ii = 2, jj = NbK1 + 1; ii <= NbK2; ii++, jj++) { Noeuds(jj) = Ratio2 * SecondCurve->Knot(ii) - Delta2; - eps = Epsilon(Abs(Noeuds(jj - 1))); + eps = Epsilon(std::abs(Noeuds(jj - 1))); if (eps < 5.e-10) eps = 5.e-10; if (Noeuds(jj) - Noeuds(jj - 1) <= eps) diff --git a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_CurveToAnaCurve.cxx b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_CurveToAnaCurve.cxx index 1edab68688..f54b61bc7c 100644 --- a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_CurveToAnaCurve.cxx +++ b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_CurveToAnaCurve.cxx @@ -230,12 +230,12 @@ Standard_Boolean GeomConvert_CurveToAnaCurve::GetCircle(gp_Circ& crc, const gp_Pnt& P2) { // Control if points are not aligned (should be done by MakeCirc - Standard_Real aMaxCoord = Sqrt(Precision::Infinite()); - if (Abs(P0.X()) > aMaxCoord || Abs(P0.Y()) > aMaxCoord || Abs(P0.Z()) > aMaxCoord) + Standard_Real aMaxCoord = std::sqrt(Precision::Infinite()); + if (std::abs(P0.X()) > aMaxCoord || std::abs(P0.Y()) > aMaxCoord || std::abs(P0.Z()) > aMaxCoord) return Standard_False; - if (Abs(P1.X()) > aMaxCoord || Abs(P1.Y()) > aMaxCoord || Abs(P1.Z()) > aMaxCoord) + if (std::abs(P1.X()) > aMaxCoord || std::abs(P1.Y()) > aMaxCoord || std::abs(P1.Z()) > aMaxCoord) return Standard_False; - if (Abs(P2.X()) > aMaxCoord || Abs(P2.Y()) > aMaxCoord || Abs(P2.Z()) > aMaxCoord) + if (std::abs(P2.X()) > aMaxCoord || std::abs(P2.Y()) > aMaxCoord || std::abs(P2.Z()) > aMaxCoord) return Standard_False; // Building the circle @@ -309,7 +309,7 @@ Handle(Geom_Curve) GeomConvert_CurveToAnaCurve::ComputeCircle(const Handle(Geom_ // first parameter should be closed to zero - if (Abs(cf) < Precision::PConfusion() || Abs(PI2 - cf) < Precision::PConfusion()) + if (std::abs(cf) < Precision::PConfusion() || std::abs(PI2 - cf) < Precision::PConfusion()) cf = 0.; Standard_Real cm = ElCLib::Parameter(crc, c3d->Value((c1 + c2) / 2.)); @@ -424,14 +424,14 @@ static Standard_Boolean ConicDefinition(const Standard_Real a, Standard_Real cos2t; Standard_Real auxil; - if (Abs(term2) <= eps && Abs(term1) <= eps) + if (std::abs(term2) <= eps && std::abs(term1) <= eps) { cos2t = 1.; auxil = 0.; } else { - if (Abs(term1) < eps) + if (std::abs(term1) < eps) { return Standard_False; } @@ -446,7 +446,7 @@ static Standard_Boolean ConicDefinition(const Standard_Real a, Standard_Real aprim = (a + c + auxil) / 2.; Standard_Real cprim = (a + c - auxil) / 2.; - if (Abs(aprim) < gp::Resolution() || Abs(cprim) < gp::Resolution()) + if (std::abs(aprim) < gp::Resolution() || std::abs(cprim) < gp::Resolution()) return Standard_False; term1 = -gdet / (aprim * pdet); @@ -548,8 +548,8 @@ Handle(Geom_Curve) GeomConvert_CurveToAnaCurve::ComputeEllipse(const Handle(Geom if (!IsArrayPntPlanar(AP, ndir, prec)) return res; - if (Abs(ndir.X()) < gp::Resolution() && Abs(ndir.Y()) < gp::Resolution() - && Abs(ndir.Z()) < gp::Resolution()) + if (std::abs(ndir.X()) < gp::Resolution() && std::abs(ndir.Y()) < gp::Resolution() + && std::abs(ndir.Z()) < gp::Resolution()) return res; gp_Ax3 AX(gp_Pnt(0, 0, 0), ndir); @@ -644,7 +644,7 @@ Handle(Geom_Curve) GeomConvert_CurveToAnaCurve::ComputeEllipse(const Handle(Geom // first parameter should be closed to zero - if (Abs(cf) < Precision::PConfusion() || Abs(PI2 - cf) < Precision::PConfusion()) + if (std::abs(cf) < Precision::PConfusion() || std::abs(PI2 - cf) < Precision::PConfusion()) cf = 0.; Standard_Real cm = ElCLib::Parameter(anEllipse, c3d->Value((c1 + c2) / 2.)); @@ -772,12 +772,12 @@ Handle(Geom_Curve) GeomConvert_CurveToAnaCurve::ComputeCurve(const Handle(Geom_C { d[0] = RealLast(); newc3d[0] = ComputeLine(c3d, tolerance, c1, c2, fp[0], lp[0], d[0]); - Standard_Real tol = Min(tolerance, d[0]); + Standard_Real tol = std::min(tolerance, d[0]); if (!Precision::IsInfinite(c1) && !Precision::IsInfinite(c2)) { d[1] = RealLast(); newc3d[1] = ComputeCircle(c3d, tol, c1, c2, fp[1], lp[1], d[1]); - tol = Min(tol, d[1]); + tol = std::min(tol, d[1]); d[2] = RealLast(); newc3d[2] = ComputeEllipse(c3d, tol, c1, c2, fp[2], lp[2], d[2]); } diff --git a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_SurfToAnaSurf.cxx b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_SurfToAnaSurf.cxx index 518bc0cd8d..4ceac3f9aa 100644 --- a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_SurfToAnaSurf.cxx +++ b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_SurfToAnaSurf.cxx @@ -191,14 +191,15 @@ Handle(Geom_Surface) GeomConvert_SurfToAnaSurf::TryCylinerCone(const Handle(Geom P3 = lastiso->Value((lastiso->LastParameter() - lastiso->FirstParameter()) / 2); } // cylinder - if (((Abs(R2 - R1)) < theToler) && ((Abs(R3 - R1)) < theToler) && ((Abs(R3 - R2)) < theToler)) + if (((std::abs(R2 - R1)) < theToler) && ((std::abs(R3 - R1)) < theToler) + && ((std::abs(R3 - R2)) < theToler)) { gp_Ax3 Axes(P1, gp_Dir(gp_Vec(P1, P3))); aNewSurf = new Geom_CylindricalSurface(Axes, R1); } // cone - else if ((((Abs(R1)) > (Abs(R2))) && ((Abs(R2)) > (Abs(R3)))) - || (((Abs(R3)) > (Abs(R2))) && ((Abs(R2)) > (Abs(R1))))) + else if ((((std::abs(R1)) > (std::abs(R2))) && ((std::abs(R2)) > (std::abs(R3)))) + || (((std::abs(R3)) > (std::abs(R2))) && ((std::abs(R2)) > (std::abs(R1))))) { Standard_Real radius; gp_Ax3 Axes; @@ -239,7 +240,7 @@ static void GetLSGap(const Handle(TColgp_HArray1OfXYZ)& thePoints, { gp_Vec aD(thePoints->Value(i) - aLoc); aD.Cross(aDir); - theGap = Max(theGap, Abs((aD.Magnitude() - theR))); + theGap = std::max(theGap, std::abs((aD.Magnitude() - theR))); } } @@ -404,16 +405,16 @@ Handle(Geom_Surface) GeomConvert_SurfToAnaSurf::TryCylinderByGaussField( ++n; Standard_Real aMinCurv = aProps.MinCurvature(); Standard_Real aMaxCurv = aProps.MaxCurvature(); - Standard_Real aGaussCurv = Abs(aProps.GaussianCurvature()); - Standard_Real aK1 = Sqrt(aGaussCurv); + Standard_Real aGaussCurv = std::abs(aProps.GaussianCurvature()); + Standard_Real aK1 = std::sqrt(aGaussCurv); if (aK1 > theToler) { return aNewSurf; } gp_XYZ aD; aProps.CurvatureDirections(aMaxD, aMinD); - aMinCurv = Abs(aMinCurv); - aMaxCurv = Abs(aMaxCurv); + aMinCurv = std::abs(aMinCurv); + aMaxCurv = std::abs(aMaxCurv); if (aMinCurv > aMaxCurv) { // aMinCurv < 0; @@ -429,11 +430,11 @@ Handle(Geom_Surface) GeomConvert_SurfToAnaSurf::TryCylinderByGaussField( // if (n > 1) { - if (Abs(aMaxCurv - anAvMaxCurv / (n - 1)) > aTol / anR2) + if (std::abs(aMaxCurv - anAvMaxCurv / (n - 1)) > aTol / anR2) { return aNewSurf; } - if (Abs(aMinCurv - anAvMinCurv / (n - 1)) > aTol) + if (std::abs(aMinCurv - anAvMinCurv / (n - 1)) > aTol) { return aNewSurf; } @@ -454,7 +455,7 @@ Handle(Geom_Surface) GeomConvert_SurfToAnaSurf::TryCylinderByGaussField( anAvR /= n; anAvDir /= n; // - if (Abs(anAvMinCurv) > theToler) + if (std::abs(anAvMinCurv) > theToler) { return aNewSurf; } @@ -464,8 +465,8 @@ Handle(Geom_Surface) GeomConvert_SurfToAnaSurf::TryCylinderByGaussField( Standard_Real d = (anRs(i) - anAvR); aSigmaR += d * d; } - aSigmaR = Sqrt(aSigmaR / n); - aSigmaR = 3. * aSigmaR / Sqrt(n); + aSigmaR = std::sqrt(aSigmaR / n); + aSigmaR = 3. * aSigmaR / std::sqrt(n); if (aSigmaR > aTol) { return aNewSurf; @@ -569,7 +570,7 @@ Handle(Geom_Surface) GeomConvert_SurfToAnaSurf::TryTorusSphere( Standard_Real R2 = aCircle2->Circ().Radius(); // check radiuses - if ((Abs(R - R1) > toler) || (Abs(R - R2) > toler)) + if ((std::abs(R - R1) > toler) || (std::abs(R - R2) > toler)) return newSurface; // get centers of the major radius diff --git a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_Units.cxx b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_Units.cxx index 38229bcd31..24afb1d990 100644 --- a/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_Units.cxx +++ b/src/ModelingData/TKGeomBase/GeomConvert/GeomConvert_Units.cxx @@ -72,7 +72,7 @@ Handle(Geom2d_Curve) GeomConvert_Units::RadianToDegree(const Handle(Geom2d_Curve Handle(Geom_ConicalSurface) conicS = Handle(Geom_ConicalSurface)::DownCast(theSurf); Standard_Real semAng = conicS->SemiAngle(); uFact = AngleFact; - vFact = LengthFact * Cos(semAng); + vFact = LengthFact * std::cos(semAng); } else if (theSurf->IsKind(STANDARD_TYPE(Geom_Plane))) { @@ -205,7 +205,7 @@ Handle(Geom2d_Curve) GeomConvert_Units::DegreeToRadian(const Handle(Geom2d_Curve Handle(Geom_ConicalSurface) conicS = Handle(Geom_ConicalSurface)::DownCast(theSurface); Standard_Real semAng = conicS->SemiAngle(); uFact = AngleFact; - vFact = LengthFact / Cos(semAng); + vFact = LengthFact / std::cos(semAng); } else if (theSurface->IsKind(STANDARD_TYPE(Geom_Plane))) { diff --git a/src/ModelingData/TKGeomBase/GeomLib/GeomLib.cxx b/src/ModelingData/TKGeomBase/GeomLib/GeomLib.cxx index dea6aa1e2c..aef4e8136d 100644 --- a/src/ModelingData/TKGeomBase/GeomLib/GeomLib.cxx +++ b/src/ModelingData/TKGeomBase/GeomLib/GeomLib.cxx @@ -234,7 +234,7 @@ static void ComputeLambda(const math_Matrix& Constraint, { pol4(pp) += 2 * GW * pol2(ii) * pol2(jj); } - pol4(2 * ii - 1) += GW * Pow(pol2(ii), 2); + pol4(2 * ii - 1) += GW * std::pow(pol2(ii), 2); } } @@ -278,7 +278,7 @@ void GeomLib::RemovePointsFromArray(const Standard_Integer NumPoints, Standard_Integer ii, jj, add_one_point, loc_num_points, num_points, index; Standard_Real delta, current_parameter; - loc_num_points = Max(0, NumPoints - 2); + loc_num_points = std::max(0, NumPoints - 2); delta = InParameters(InParameters.Upper()) - InParameters(InParameters.Lower()); delta /= (Standard_Real)(loc_num_points + 1); num_points = 1; @@ -423,7 +423,7 @@ void GeomLib::FuseIntervals(const TColStd_Array1OfReal& I1, { v1 = I1(ind1); v2 = I2(ind2); - if (Abs(v1 - v2) <= Epspar) + if (std::abs(v1 - v2) <= Epspar) { // Ici les elements de I1 et I2 conviennent . if (IsAdjustToFirstInterval) @@ -494,7 +494,7 @@ void GeomLib::EvalMaxParametricDistance(const Adaptor3d_Curve& ACurve, ACurve.D0(Parameters(ii), Point1); AReferenceCurve.D0(Parameters(ii), Point2); local_distance_squared = Point1.SquareDistance(Point2); - max_squared = Max(max_squared, local_distance_squared); + max_squared = std::max(max_squared, local_distance_squared); } if (max_squared > 0.0e0) { @@ -551,7 +551,7 @@ void GeomLib::EvalMaxDistanceAlongParameter(const Adaptor3d_Curve& ACurve, other_parameter = Parameters(ii); } - max_squared = Max(max_squared, local_distance_squared); + max_squared = std::max(max_squared, local_distance_squared); } if (max_squared > tolerance_squared) { @@ -870,15 +870,15 @@ void GeomLib::SameRange(const Standard_Real Tolerance, { if (CurvePtr.IsNull()) throw Standard_Failure(); - if (Abs(LastOnCurve - RequestedLast) <= Tolerance - && Abs(FirstOnCurve - RequestedFirst) <= Tolerance) + if (std::abs(LastOnCurve - RequestedLast) <= Tolerance + && std::abs(FirstOnCurve - RequestedFirst) <= Tolerance) { NewCurvePtr = CurvePtr; return; } // the parametrisation length must at least be the same. - if (Abs(LastOnCurve - FirstOnCurve - RequestedLast + RequestedFirst) <= Tolerance) + if (std::abs(LastOnCurve - FirstOnCurve - RequestedLast + RequestedFirst) <= Tolerance) { if (CurvePtr->IsKind(STANDARD_TYPE(Geom2d_Line))) { @@ -924,8 +924,8 @@ void GeomLib::SameRange(const Standard_Real Tolerance, // RequestedFirst et RequestedLast on aura un probleme // // - else if (Abs(LastOnCurve - FirstOnCurve) > Precision::PConfusion() - || Abs(RequestedLast + RequestedFirst) > Precision::PConfusion()) + else if (std::abs(LastOnCurve - FirstOnCurve) > Precision::PConfusion() + || std::abs(RequestedLast + RequestedFirst) > Precision::PConfusion()) { Handle(Geom2d_TrimmedCurve) TC = new Geom2d_TrimmedCurve(CurvePtr, FirstOnCurve, LastOnCurve); @@ -952,7 +952,7 @@ void GeomLib::SameRange(const Standard_Real Tolerance, if (aCCheck->IsPeriodic()) { - if (Abs(LastOnCurve - FirstOnCurve) > Precision::PConfusion()) + if (std::abs(LastOnCurve - FirstOnCurve) > Precision::PConfusion()) { TC = new Geom2d_TrimmedCurve(CurvePtr, FirstOnCurve, LastOnCurve); } @@ -964,9 +964,9 @@ void GeomLib::SameRange(const Standard_Real Tolerance, } else { - const Standard_Real Udeb = Max(CurvePtr->FirstParameter(), FirstOnCurve); - const Standard_Real Ufin = Min(CurvePtr->LastParameter(), LastOnCurve); - if (Abs(Ufin - Udeb) > Precision::PConfusion()) + const Standard_Real Udeb = std::max(CurvePtr->FirstParameter(), FirstOnCurve); + const Standard_Real Ufin = std::min(CurvePtr->LastParameter(), LastOnCurve); + if (std::abs(Ufin - Udeb) > Precision::PConfusion()) { TC = new Geom2d_TrimmedCurve(CurvePtr, Udeb, Ufin); } @@ -1337,11 +1337,11 @@ void GeomLib::ExtendCurveToPoint(Handle(Geom_BoundedCurve)& Curve, dt = d1.Magnitude() / norm; if ((dt < 1.5) && (dt > 0.75)) { // Le bord est dans la moyenne on le garde - Lambda = ((Standard_Real)1) / Max(d1.Magnitude() / L1, Tol); + Lambda = ((Standard_Real)1) / std::max(d1.Magnitude() / L1, Tol); } else { - Lambda = ((Standard_Real)1) / Max(norm / L1, Tol); + Lambda = ((Standard_Real)1) / std::max(norm / L1, Tol); } } else @@ -1378,9 +1378,9 @@ void GeomLib::ExtendCurveToPoint(Handle(Geom_BoundedCurve)& Curve, Cont(1) = p0.XYZ(); Cont(2) = d1.XYZ() * Lambda; if (Continuity >= 2) - Cont(3) = d2.XYZ() * Pow(Lambda, 2); + Cont(3) = d2.XYZ() * std::pow(Lambda, 2); if (Continuity >= 3) - Cont(4) = d3.XYZ() * Pow(Lambda, 3); + Cont(4) = d3.XYZ() * std::pow(Lambda, 3); Cont(size) = Point.XYZ(); TColgp_Array1OfPnt ExtrapPoles(1, size); @@ -1618,7 +1618,7 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface, lambda = new (TColStd_HArray1OfReal)(1, Cdim); Standard_Boolean periodic_flag = Standard_False; - Standard_Integer extrap_mode[2], derivative_request = Max(Continuity, 1); + Standard_Integer extrap_mode[2], derivative_request = std::max(Continuity, 1); extrap_mode[0] = extrap_mode[1] = Cdeg; TColStd_Array1OfReal Result(1, Cdim * (derivative_request + 1)); @@ -1672,7 +1672,7 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface, lamb(ii - 1) = lamb(ii - 2) = lamb(ii - 3) = val; lamb(ii) = 0.; - lambmin = Min(lambmin, val); + lambmin = std::min(lambmin, val); } else { @@ -1700,7 +1700,7 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface, Ok = Standard_False; } lamb(ii) = lamb(ii - 1) = lamb(ii - 2) = val; - lambmin = Min(lambmin, val); + lambmin = std::min(lambmin, val); } else { @@ -1819,7 +1819,7 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface, if (rational) { ww = PRes(indice + 3); - if (Abs(ww - 1.0) < EpsW) + if (std::abs(ww - 1.0) < EpsW) ww = 1.0; if (ww < EpsW) { @@ -1847,7 +1847,7 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface, if (rational) { ww = PRes(indice + 3); - if (Abs(ww - 1.0) < EpsW) + if (std::abs(ww - 1.0) < EpsW) ww = 1.0; if (ww < EpsW) { @@ -1980,12 +1980,12 @@ void GeomLib::Inertia(const TColgp_Array1OfPnt& Points, n2 = J.Value(2); n3 = J.Value(3); - Standard_Real r1 = Min(Min(n1, n2), n3), r2; + Standard_Real r1 = std::min(std::min(n1, n2), n3), r2; Standard_Integer m1, m2, m3; if (r1 == n1) { m1 = 1; - r2 = Min(n2, n3); + r2 = std::min(n2, n3); if (r2 == n2) { m2 = 2; @@ -2002,7 +2002,7 @@ void GeomLib::Inertia(const TColgp_Array1OfPnt& Points, if (r1 == n2) { m1 = 2; - r2 = Min(n1, n3); + r2 = std::min(n1, n3); if (r2 == n1) { m2 = 1; @@ -2017,7 +2017,7 @@ void GeomLib::Inertia(const TColgp_Array1OfPnt& Points, else { m1 = 3; - r2 = Min(n1, n2); + r2 = std::min(n1, n2); if (r2 == n1) { m2 = 1; @@ -2039,9 +2039,9 @@ void GeomLib::Inertia(const TColgp_Array1OfPnt& Points, XDir.SetCoord(V3(1), V3(2), V3(3)); YDir.SetCoord(V2(1), V2(2), V2(3)); - Zgap = sqrt(Abs(J.Value(m1))); - Ygap = sqrt(Abs(J.Value(m2))); - Xgap = sqrt(Abs(J.Value(m3))); + Zgap = sqrt(std::abs(J.Value(m1))); + Ygap = sqrt(std::abs(J.Value(m2))); + Xgap = sqrt(std::abs(J.Value(m3))); } //================================================================================================= @@ -2749,31 +2749,31 @@ void GeomLib::IsClosed(const Handle(Geom_Surface)& S, Standard_Integer nbp = 23; if (Precision::IsInfinite(v1)) { - v1 = Sign(1., v1); + v1 = std::copysign(1., v1); } if (Precision::IsInfinite(v2)) { - v2 = Sign(1., v2); + v2 = std::copysign(1., v2); } // if (aSType == GeomAbs_OffsetSurface || aSType == GeomAbs_OtherSurface) { if (Precision::IsInfinite(u1)) { - u1 = Sign(1., u1); + u1 = std::copysign(1., u1); } if (Precision::IsInfinite(u2)) { - u2 = Sign(1., u2); + u2 = std::copysign(1., u2); } } isUClosed = Standard_True; Standard_Real dt = (v2 - v1) / (nbp - 1); - Standard_Real res = Max(aGAS.UResolution(Tol), Precision::PConfusion()); + Standard_Real res = std::max(aGAS.UResolution(Tol), Precision::PConfusion()); if (dt <= res) { nbp = RealToInt((v2 - v1) / (2. * res)) + 1; - nbp = Max(nbp, 2); + nbp = std::max(nbp, 2); dt = (v2 - v1) / (nbp - 1); } Standard_Real t; @@ -2793,11 +2793,11 @@ void GeomLib::IsClosed(const Handle(Geom_Surface)& S, nbp = 23; isVClosed = Standard_True; dt = (u2 - u1) / (nbp - 1); - res = Max(aGAS.VResolution(Tol), Precision::PConfusion()); + res = std::max(aGAS.VResolution(Tol), Precision::PConfusion()); if (dt <= res) { nbp = RealToInt((u2 - u1) / (2. * res)) + 1; - nbp = Max(nbp, 2); + nbp = std::max(nbp, 2); dt = (u2 - u1) / (nbp - 1); } for (i = 0; i < nbp; ++i) @@ -3044,15 +3044,15 @@ Handle(Geom_Curve) GeomLib::buildC3dOnIsoLine(const Handle(Adaptor2d_Curve2d)& t if (theIsU) { - Standard_Real aV1Param = Min(aF2d.Y(), aL2d.Y()); - Standard_Real aV2Param = Max(aF2d.Y(), aL2d.Y()); + Standard_Real aV1Param = std::min(aF2d.Y(), aL2d.Y()); + Standard_Real aV2Param = std::max(aF2d.Y(), aL2d.Y()); if (aV2Param < V1 - theTolerance || aV1Param > V2 + theTolerance) { return Handle(Geom_Curve)(); } else if (Precision::IsInfinite(V1) || Precision::IsInfinite(V2)) { - if (Abs(aV2Param - aV1Param) < Precision::PConfusion()) + if (std::abs(aV2Param - aV1Param) < Precision::PConfusion()) { return Handle(Geom_Curve)(); } @@ -3061,9 +3061,9 @@ Handle(Geom_Curve) GeomLib::buildC3dOnIsoLine(const Handle(Adaptor2d_Curve2d)& t } else { - aV1Param = Max(aV1Param, V1); - aV2Param = Min(aV2Param, V2); - if (Abs(aV2Param - aV1Param) < Precision::PConfusion()) + aV1Param = std::max(aV1Param, V1); + aV2Param = std::min(aV2Param, V2); + if (std::abs(aV2Param - aV1Param) < Precision::PConfusion()) { return Handle(Geom_Curve)(); } @@ -3074,15 +3074,15 @@ Handle(Geom_Curve) GeomLib::buildC3dOnIsoLine(const Handle(Adaptor2d_Curve2d)& t } else { - Standard_Real aU1Param = Min(aF2d.X(), aL2d.X()); - Standard_Real aU2Param = Max(aF2d.X(), aL2d.X()); + Standard_Real aU1Param = std::min(aF2d.X(), aL2d.X()); + Standard_Real aU2Param = std::max(aF2d.X(), aL2d.X()); if (aU2Param < U1 - theTolerance || aU1Param > U2 + theTolerance) { return Handle(Geom_Curve)(); } else if (Precision::IsInfinite(U1) || Precision::IsInfinite(U2)) { - if (Abs(aU2Param - aU1Param) < Precision::PConfusion()) + if (std::abs(aU2Param - aU1Param) < Precision::PConfusion()) { return Handle(Geom_Curve)(); } @@ -3091,9 +3091,9 @@ Handle(Geom_Curve) GeomLib::buildC3dOnIsoLine(const Handle(Adaptor2d_Curve2d)& t } else { - aU1Param = Max(aU1Param, U1); - aU2Param = Min(aU2Param, U2); - if (Abs(aU2Param - aU1Param) < Precision::PConfusion()) + aU1Param = std::max(aU1Param, U1); + aU2Param = std::min(aU2Param, U2); + if (std::abs(aU2Param - aU1Param) < Precision::PConfusion()) { return Handle(Geom_Curve)(); } @@ -3130,10 +3130,10 @@ Handle(Geom_Curve) GeomLib::buildC3dOnIsoLine(const Handle(Adaptor2d_Curve2d)& t const gp_Pnt aPntC2D = theSurf->Value(aPnt2d.X(), aPnt2d.Y()); const Standard_Real aSqDeviation = aPntC3D.SquareDistance(aPntC2D); - anError3d = Max(aSqDeviation, anError3d); + anError3d = std::max(aSqDeviation, anError3d); } - anError3d = Sqrt(anError3d); + anError3d = std::sqrt(anError3d); // Target tolerance is not obtained. This situation happens for isolines on the sphere. // OCCT is unable to convert it keeping original parameterization, while the geometric diff --git a/src/ModelingData/TKGeomBase/GeomLib/GeomLib_Check2dBSplineCurve.cxx b/src/ModelingData/TKGeomBase/GeomLib/GeomLib_Check2dBSplineCurve.cxx index db0d76558f..ce31f81349 100644 --- a/src/ModelingData/TKGeomBase/GeomLib/GeomLib_Check2dBSplineCurve.cxx +++ b/src/ModelingData/TKGeomBase/GeomLib/GeomLib_Check2dBSplineCurve.cxx @@ -29,8 +29,8 @@ GeomLib_Check2dBSplineCurve::GeomLib_Check2dBSplineCurve(const Handle(Geom2d_BSp myDone(Standard_False), myFixFirstTangent(Standard_False), myFixLastTangent(Standard_False), - myAngularTolerance(Abs(AngularTolerance)), - myTolerance(Abs(Tolerance)), + myAngularTolerance(std::abs(AngularTolerance)), + myTolerance(std::abs(Tolerance)), myIndSecondPole(-1), myIndPrelastPole(-1) { @@ -61,7 +61,7 @@ GeomLib_Check2dBSplineCurve::GeomLib_Check2dBSplineCurve(const Handle(Geom2d_BSp avector_normalized = a_vector / vector_magnitude; Standard_Real CrossProd = tangent_normalized ^ avector_normalized; - if (Abs(CrossProd) > CrossProdTol) + if (std::abs(CrossProd) > CrossProdTol) break; value = tangent.Dot(a_vector); @@ -90,7 +90,7 @@ GeomLib_Check2dBSplineCurve::GeomLib_Check2dBSplineCurve(const Handle(Geom2d_BSp avector_normalized = a_vector / vector_magnitude; Standard_Real CrossProd = tangent_normalized ^ avector_normalized; - if (Abs(CrossProd) > CrossProdTol) + if (std::abs(CrossProd) > CrossProdTol) break; value = tangent.Dot(a_vector); diff --git a/src/ModelingData/TKGeomBase/GeomLib/GeomLib_CheckBSplineCurve.cxx b/src/ModelingData/TKGeomBase/GeomLib/GeomLib_CheckBSplineCurve.cxx index 17daac86ce..37fd350671 100644 --- a/src/ModelingData/TKGeomBase/GeomLib/GeomLib_CheckBSplineCurve.cxx +++ b/src/ModelingData/TKGeomBase/GeomLib/GeomLib_CheckBSplineCurve.cxx @@ -29,8 +29,8 @@ GeomLib_CheckBSplineCurve::GeomLib_CheckBSplineCurve(const Handle(Geom_BSplineCu myDone(Standard_False), myFixFirstTangent(Standard_False), myFixLastTangent(Standard_False), - myAngularTolerance(Abs(AngularTolerance)), - myTolerance(Abs(Tolerance)), + myAngularTolerance(std::abs(AngularTolerance)), + myTolerance(std::abs(Tolerance)), myIndSecondPole(-1), myIndPrelastPole(-1) { diff --git a/src/ModelingData/TKGeomBase/GeomLib/GeomLib_CheckCurveOnSurface.cxx b/src/ModelingData/TKGeomBase/GeomLib/GeomLib_CheckCurveOnSurface.cxx index e121d2beb1..b5c40cbde5 100644 --- a/src/ModelingData/TKGeomBase/GeomLib/GeomLib_CheckCurveOnSurface.cxx +++ b/src/ModelingData/TKGeomBase/GeomLib/GeomLib_CheckCurveOnSurface.cxx @@ -393,7 +393,7 @@ void GeomLib_CheckCurveOnSurface::Perform(const Handle(Adaptor3d_CurveOnSurface) const Standard_Integer aNbThreads = myIsParallel - ? Min(anIntervals.Size(), OSD_ThreadPool::DefaultPool()->NbDefaultThreadsToLaunch()) + ? std::min(anIntervals.Size(), OSD_ThreadPool::DefaultPool()->NbDefaultThreadsToLaunch()) : 1; Array1OfHCurve aCurveArray(0, aNbThreads - 1); Array1OfHCurve aCurveOnSurfaceArray(0, aNbThreads - 1); @@ -425,7 +425,7 @@ void GeomLib_CheckCurveOnSurface::Perform(const Handle(Adaptor3d_CurveOnSurface) } aComp.OptimalValues(myMaxDistance, myMaxParameter); - myMaxDistance = sqrt(Abs(myMaxDistance)); + myMaxDistance = sqrt(std::abs(myMaxDistance)); } catch (Standard_Failure const&) { @@ -623,12 +623,12 @@ Standard_Integer FillSubIntervals(const Handle(Adaptor3d_Curve)& theCurve3d, if (!aBS3DCurv.IsNull()) { - theNbParticles = Max(theNbParticles, aBS3DCurv->Degree()); + theNbParticles = std::max(theNbParticles, aBS3DCurv->Degree()); } if (!aBS2DCurv.IsNull()) { - theNbParticles = Max(theNbParticles, aBS2DCurv->Degree()); + theNbParticles = std::max(theNbParticles, aBS2DCurv->Degree()); } } catch (Standard_Failure const&) diff --git a/src/ModelingData/TKGeomBase/GeomLib/GeomLib_LogSample.cxx b/src/ModelingData/TKGeomBase/GeomLib/GeomLib_LogSample.cxx index 8d65e49cff..0f0d7ae058 100644 --- a/src/ModelingData/TKGeomBase/GeomLib/GeomLib_LogSample.cxx +++ b/src/ModelingData/TKGeomBase/GeomLib/GeomLib_LogSample.cxx @@ -23,7 +23,7 @@ GeomLib_LogSample::GeomLib_LogSample(const Standard_Real A, : math_FunctionSample(A, B, N) { myF = A - 1; - myexp = Log(B - A) / N; + myexp = std::log(B - A) / N; } Standard_Real GeomLib_LogSample::GetParameter(const Standard_Integer Index) const @@ -42,6 +42,6 @@ Standard_Real GeomLib_LogSample::GetParameter(const Standard_Integer Index) cons throw Standard_OutOfRange("GeomLib_LogSample::GetParameter"); } - Standard_Real v = myF + Exp(myexp * Index); + Standard_Real v = myF + std::exp(myexp * Index); return v; } diff --git a/src/ModelingData/TKGeomBase/GeomLib/GeomLib_Tool.cxx b/src/ModelingData/TKGeomBase/GeomLib/GeomLib_Tool.cxx index 30e761e08a..4be260b895 100644 --- a/src/ModelingData/TKGeomBase/GeomLib/GeomLib_Tool.cxx +++ b/src/ModelingData/TKGeomBase/GeomLib/GeomLib_Tool.cxx @@ -343,7 +343,7 @@ Standard_Real GeomLib_Tool::ComputeDeviation(const Geom2dAdaptor_Curve& theCurve aFunc.ValueAndDerives(aU0, aSqDefl, aD1, aD2); for (Standard_Integer anItr = 1; anItr <= theNbIters; anItr++) { - if (Abs(aD2) < Precision::PConfusion()) + if (std::abs(aD2) < Precision::PConfusion()) { break; } @@ -358,16 +358,17 @@ Standard_Real GeomLib_Tool::ComputeDeviation(const Geom2dAdaptor_Curve& theCurve aFunc.ValueAndDerives(aU1, aSqD, aD1, aD2); if (aSqD > aSqDefl) { - aUmax = aU1; - const Standard_Real aDD = aSqDefl > 0.0 ? Abs(Sqrt(aSqD) - Sqrt(aSqDefl)) : Sqrt(aSqD); - aSqDefl = aSqD; + aUmax = aU1; + const Standard_Real aDD = + aSqDefl > 0.0 ? std::abs(std::sqrt(aSqD) - std::sqrt(aSqDefl)) : std::sqrt(aSqD); + aSqDefl = aSqD; if (aDD < aTolDefl) { break; } } - if (Abs(aU0 - aU1) < Precision::PConfusion()) + if (std::abs(aU0 - aU1) < Precision::PConfusion()) { break; } @@ -395,7 +396,7 @@ Standard_Real GeomLib_Tool::ComputeDeviation(const Geom2dAdaptor_Curve& theCurve theVecCurvLine->SetXY(aFunc.VecCurveLine().XY()); } } - return Sqrt(aSqDefl); + return std::sqrt(aSqDefl); } //======================================================================= @@ -439,5 +440,5 @@ Standard_Real GeomLib_Tool::ComputeDeviation(const Geom2dAdaptor_Curve& theCurve { *thePrmOnCurve = anOutputPnt(1); } - return Sqrt(Abs(aSqDefl)); + return std::sqrt(std::abs(aSqDefl)); } \ No newline at end of file diff --git a/src/ModelingData/TKGeomBase/GeomProjLib/GeomProjLib.cxx b/src/ModelingData/TKGeomBase/GeomProjLib/GeomProjLib.cxx index 8461c4baec..0c7c2dc3c2 100644 --- a/src/ModelingData/TKGeomBase/GeomProjLib/GeomProjLib.cxx +++ b/src/ModelingData/TKGeomBase/GeomProjLib/GeomProjLib.cxx @@ -78,7 +78,7 @@ Handle(Geom2d_Curve) GeomProjLib::Curve2d(const Handle(Geom_Curve)& C, } #endif - Tolerance = Max(Precision::PConfusion(), Tolerance); + Tolerance = std::max(Precision::PConfusion(), Tolerance); GeomAdaptor_Curve AC(C, First, Last); GeomAdaptor_Surface AS(S, UDeb, UFin, VDeb, VFin); @@ -138,8 +138,8 @@ Handle(Geom2d_Curve) GeomProjLib::Curve2d(const Handle(Geom_Curve)& C, Standard_Real U2 = CTrim->LastParameter(); if (!G2dC->IsPeriodic()) { - U1 = Max(U1, G2dC->FirstParameter()); - U2 = Min(U2, G2dC->LastParameter()); + U1 = std::max(U1, G2dC->FirstParameter()); + U2 = std::min(U2, G2dC->LastParameter()); } G2dC = new Geom2d_TrimmedCurve(G2dC, U1, U2); } @@ -290,8 +290,8 @@ Handle(Geom_Curve) GeomProjLib::Project(const Handle(Geom_Curve)& C, const Handl // Standard_Real TolU = Precision::PApproximation(); // Standard_Real TolV = Precision::PApproximation(); Standard_Real Tol = 0.0001; - Standard_Real TolU = Pow(Tol, 2. / 3); - Standard_Real TolV = Pow(Tol, 2. / 3); + Standard_Real TolU = std::pow(Tol, 2. / 3); + Standard_Real TolV = std::pow(Tol, 2. / 3); ProjLib_CompProjectedCurve Proj(HS, HC, TolU, TolV, -1.); Standard_Real f, l; diff --git a/src/ModelingData/TKGeomBase/Hermit/Hermit.cxx b/src/ModelingData/TKGeomBase/Hermit/Hermit.cxx index b6ebd0fc9f..d5bfab3412 100644 --- a/src/ModelingData/TKGeomBase/Hermit/Hermit.cxx +++ b/src/ModelingData/TKGeomBase/Hermit/Hermit.cxx @@ -312,39 +312,43 @@ static void PolyTest(const TColStd_Array1OfReal& Herm, Pole3 = Polesinit(3).Y(); if (Pole0 < 3) { - a = Log10(Pole3 / Pole0); + a = std::log10(Pole3 / Pole0); if (boucle == 2) { for (i = 0; i <= 3; i++) Polesinit(i).SetCoord( 0.0, - Polesinit(i).Y() - (Pole3 * (Pow(10.0, (-0.5 * Log10(TolPoles) - a / 2.0))))); + Polesinit(i).Y() + - (Pole3 * (std::pow(10.0, (-0.5 * std::log10(TolPoles) - a / 2.0))))); } if (boucle == 1) { for (i = 0; i <= 3; i++) Polesinit(i).SetCoord( 0.0, - Polesinit(i).Y() - (Pole0 * (Pow(10.0, (a / 2.0 + 0.5 * Log10(TolPoles)))))); + Polesinit(i).Y() + - (Pole0 * (std::pow(10.0, (a / 2.0 + 0.5 * std::log10(TolPoles)))))); dercas = 1; } } if (Pole0 > Pole3) { - a = Log10(Pole0 / Pole3); + a = std::log10(Pole0 / Pole3); if (boucle == 2) { for (i = 0; i <= 3; i++) Polesinit(i).SetCoord( 0.0, - Polesinit(i).Y() - (Pole0 * (Pow(10.0, (-0.5 * Log10(TolPoles) - a / 2.0))))); + Polesinit(i).Y() + - (Pole0 * (std::pow(10.0, (-0.5 * std::log10(TolPoles) - a / 2.0))))); } if (boucle == 1) { for (i = 0; i <= 3; i++) Polesinit(i).SetCoord( 0.0, - Polesinit(i).Y() - (Pole3 * (Pow(10.0, (a / 2.0 + 0.5 * Log10(TolPoles)))))); + Polesinit(i).Y() + - (Pole3 * (std::pow(10.0, (a / 2.0 + 0.5 * std::log10(TolPoles)))))); dercas = 1; } } @@ -571,39 +575,43 @@ static void PolyTest(const TColStd_Array1OfReal& Herm, Pole3 = Polesinit(3).Y(); if (Pole0 < 3) { - a = Log10(Pole3 / Pole0); + a = std::log10(Pole3 / Pole0); if (boucle == 2) { for (i = 0; i <= 3; i++) Polesinit(i).SetCoord( 0.0, - Polesinit(i).Y() - (Pole3 * (Pow(10.0, (-0.5 * Log10(TolPoles) - a / 2.0))))); + Polesinit(i).Y() + - (Pole3 * (std::pow(10.0, (-0.5 * std::log10(TolPoles) - a / 2.0))))); } if (boucle == 1) { for (i = 0; i <= 3; i++) Polesinit(i).SetCoord( 0.0, - Polesinit(i).Y() - (Pole0 * (Pow(10.0, (a / 2.0 + 0.5 * Log10(TolPoles)))))); + Polesinit(i).Y() + - (Pole0 * (std::pow(10.0, (a / 2.0 + 0.5 * std::log10(TolPoles)))))); dercas = 1; } } if (Pole0 > Pole3) { - a = Log10(Pole0 / Pole3); + a = std::log10(Pole0 / Pole3); if (boucle == 2) { for (i = 0; i <= 3; i++) Polesinit(i).SetCoord( 0.0, - Polesinit(i).Y() - (Pole0 * (Pow(10.0, (-0.5 * Log10(TolPoles) - a / 2.0))))); + Polesinit(i).Y() + - (Pole0 * (std::pow(10.0, (-0.5 * std::log10(TolPoles) - a / 2.0))))); } else if (boucle == 1) { for (i = 0; i <= 3; i++) Polesinit(i).SetCoord( 0.0, - Polesinit(i).Y() - (Pole3 * (Pow(10.0, (a / 2.0 + 0.5 * Log10(TolPoles)))))); + Polesinit(i).Y() + - (Pole3 * (std::pow(10.0, (a / 2.0 + 0.5 * std::log10(TolPoles)))))); dercas = 1; } } @@ -774,8 +782,8 @@ Handle(Geom2d_BSplineCurve) Hermit::Solution(const Handle(Geom_BSplineCurve)& BS if (Upos1 != 0.0) if (Upos2 != 1.0) { - Ux = Min(Upos1, Upos2); - Uy = Max(Upos1, Upos2); + Ux = std::min(Upos1, Upos2); + Uy = std::max(Upos1, Upos2); } else { @@ -875,8 +883,8 @@ Handle(Geom2d_BSplineCurve) Hermit::Solution(const Handle(Geom2d_BSplineCurve)& if (Upos1 != 0.0) if (Upos2 != 1.0) { - Ux = Min(Upos1, Upos2); - Uy = Max(Upos1, Upos2); + Ux = std::min(Upos1, Upos2); + Uy = std::max(Upos1, Upos2); } else { @@ -976,8 +984,8 @@ void Hermit::Solutionbis(const Handle(Geom_BSplineCurve)& BS, if (Upos1 != 0.0) if (Upos2 != 1.0) { - Ux = Min(Upos1, Upos2); - Uy = Max(Upos1, Upos2); + Ux = std::min(Upos1, Upos2); + Uy = std::max(Upos1, Upos2); } else { diff --git a/src/ModelingData/TKGeomBase/IntAna/IntAna_Curve.cxx b/src/ModelingData/TKGeomBase/IntAna/IntAna_Curve.cxx index 89def1b251..a95732d52e 100644 --- a/src/ModelingData/TKGeomBase/IntAna/IntAna_Curve.cxx +++ b/src/ModelingData/TKGeomBase/IntAna/IntAna_Curve.cxx @@ -22,9 +22,9 @@ //---------------------------------------------------------------------- //-- Differents constructeurs sont proposes qui correspondent aux //-- polynomes en Z : -//-- A(Sin(Theta),Cos(Theta)) Z**2 -//-- + B(Sin(Theta),Cos(Theta)) Z -//-- + C(Sin(Theta),Cos(Theta)) +//-- A(std::sin(Theta),std::cos(Theta)) Z**2 +//-- + B(std::sin(Theta),std::cos(Theta)) Z +//-- + C(std::sin(Theta),std::cos(Theta)) //-- //-- Une Courbe est definie sur un domaine //-- @@ -114,16 +114,16 @@ void IntAna_Curve::SetConeQuadValues(const gp_Cone& Cone, RCyl = Cone.RefRadius(); Angle = Cone.SemiAngle(); - Standard_Real UnSurTgAngle = 1.0 / (Tan(Cone.SemiAngle())); + Standard_Real UnSurTgAngle = 1.0 / (std::tan(Cone.SemiAngle())); typequadric = GeomAbs_Cone; TwoCurves = twocurves; //-- deux Z pour un meme parametre TakeZPositive = takezpositive; //-- Prendre sur la courbe le Z Positif - //-- ( -B + Sqrt()) et non (-B - Sqrt()) + //-- ( -B + std::sqrt()) et non (-B - std::sqrt()) - Z0Cte = Q1; //-- Attention On a Z?Cos Cos(t) - Z0Sin = 0.0; //-- et Non 2 Z?Cos Cos(t) !!! + Z0Cte = Q1; //-- Attention On a Z?Cos std::cos(t) + Z0Sin = 0.0; //-- et Non 2 Z?Cos std::cos(t) !!! Z0Cos = 0.0; //-- Ce pour tous les Parametres Z0CosCos = 0.0; //-- ie pas de Coefficient 2 Z0SinSin = 0.0; //-- devant les termes CS C S @@ -182,7 +182,7 @@ void IntAna_Curve::SetCylinderQuadValues(const gp_Cylinder& Cyl, TwoCurves = twocurves; //-- deux Z pour un meme parametre TakeZPositive = takezpositive; //-- Prendre sur la courbe le Z Positif - Standard_Real RCylmul2 = RCyl + RCyl; //-- ( -B + Sqrt()) + Standard_Real RCylmul2 = RCyl + RCyl; //-- ( -B + std::sqrt()) Z0Cte = Q1; Z0Sin = RCylmul2 * Qy; @@ -301,7 +301,7 @@ void IntAna_Curve::InternalUVValue(const Standard_Real theta, throw Standard_DomainError("IntAna_Curve::Domain"); } - if (Abs(Theta - DomainSup) < aDT) + if (std::abs(Theta - DomainSup) < aDT) { // Point of Null-discriminant. Theta = DomainSup; @@ -319,10 +319,10 @@ void IntAna_Curve::InternalUVValue(const Standard_Real theta, SecondSolution = TakeZPositive; } // - cost = Cos(Theta); - sint = Sin(Theta); - const Standard_Real aSin2t = Sin(Theta + Theta); - const Standard_Real aCos2t = Cos(Theta + Theta); + cost = std::cos(Theta); + sint = std::sin(Theta); + const Standard_Real aSin2t = std::sin(Theta + Theta); + const Standard_Real aCos2t = std::cos(Theta + Theta); A = Z2Cte + sint * (Z2Sin + sint * Z2SinSin) + cost * (Z2Cos + cost * Z2CosCos) + Z2CosSin * aSin2t; @@ -348,14 +348,14 @@ void IntAna_Curve::InternalUVValue(const Standard_Real theta, // Error of discriminant computation is equal to // (d(Disc)/dt)*dt, where 1st derivative d(Disc)/dt = 2*B*aDB - 4*(A*aDC + C*aDA). - const Standard_Real aTolD = 2.0 * aDT * Abs(B * aDB - 2.0 * (A * aDC + C * aDA)); + const Standard_Real aTolD = 2.0 * aDT * std::abs(B * aDB - 2.0 * (A * aDC + C * aDA)); if (aDiscriminant < aTolD) aDiscriminant = 0.0; - if (Abs(A) <= Precision::PConfusion()) + if (std::abs(A) <= Precision::PConfusion()) { - if (Abs(B) <= Precision::PConfusion()) + if (std::abs(B) <= Precision::PConfusion()) { Param2 = 0.0; } @@ -366,7 +366,7 @@ void IntAna_Curve::InternalUVValue(const Standard_Real theta, } else { - SigneSqrtDis = (SecondSolution) ? Sqrt(aDiscriminant) : -Sqrt(aDiscriminant); + SigneSqrtDis = (SecondSolution) ? std::sqrt(aDiscriminant) : -std::sqrt(aDiscriminant); Param2 = (-B + SigneSqrtDis) / (A + A); } } @@ -407,7 +407,7 @@ Standard_Boolean IntAna_Curve::D1u(const Standard_Real theta, gp_Pnt& Pt, gp_Vec InternalUVValue(theta, U, V, A, B, C, cost, sint, SigneSqrtDis); // Pt = Value(theta); - if (Abs(A) < 1.0e-7 || Abs(SigneSqrtDis) < 1.0e-10) + if (std::abs(A) < 1.0e-7 || std::abs(SigneSqrtDis) < 1.0e-10) return (Standard_False); //-- Approximation de la derivee (mieux que le calcul mathematique!) @@ -537,12 +537,12 @@ gp_Pnt IntAna_Curve::InternalValue(const Standard_Real U, const Standard_Real _V { case GeomAbs_Cone: { //------------------------------------------------ - //-- Parametrage : X = V * Cos(U) --- - //-- Y = V * Sin(U) --- - //-- Z = (V-RCyl) / Tan(SemiAngle)-- + //-- Parametrage : X = V * std::cos(U) --- + //-- Y = V * std::sin(U) --- + //-- Z = (V-RCyl) / std::tan(SemiAngle)-- //------------------------------------------------ //-- Angle Vaut Cone.SemiAngle() - return (ElSLib::ConeValue(U, (V - RCyl) / Sin(Angle), Ax3, RCyl, Angle)); + return (ElSLib::ConeValue(U, (V - RCyl) / std::sin(Angle), Ax3, RCyl, Angle)); } break; diff --git a/src/ModelingData/TKGeomBase/IntAna/IntAna_IntConicQuad.cxx b/src/ModelingData/TKGeomBase/IntAna/IntAna_IntConicQuad.cxx index 04a5022cd5..5b76896880 100644 --- a/src/ModelingData/TKGeomBase/IntAna/IntAna_IntConicQuad.cxx +++ b/src/ModelingData/TKGeomBase/IntAna/IntAna_IntConicQuad.cxx @@ -386,7 +386,7 @@ PERFORM(const gp_Hypr& H, const IntAna_Quadric& Quad) Standard_Real t = HyperQuadPol.Value(i); if (t >= RealEpsilon()) { - Standard_Real Lnt = Log(t); + Standard_Real Lnt = std::log(t); paramonc[bonnessolutions] = Lnt; pnts[bonnessolutions] = ElCLib::HyperbolaValue(Lnt, H.Position(), R, r); bonnessolutions++; @@ -447,7 +447,7 @@ void IntAna_IntConicQuad::Perform(const gp_Lin& L, // Tolang represente la tolerance angulaire a partir de laquelle on considere // que l angle entre 2 vecteurs est nul. On raisonnera sur le cosinus de cet - // angle, (on a Cos(t) equivalent a t au voisinage de Pi/2). + // angle, (on a std::cos(t) equivalent a t au voisinage de Pi/2). done = Standard_False; @@ -463,7 +463,7 @@ void IntAna_IntConicQuad::Perform(const gp_Lin& L, Dis = A * Orig.X() + B * Orig.Y() + C * Orig.Z() + D; // parallel = Standard_False; - if (Abs(Direc) < Tolang) + if (std::abs(Direc) < Tolang) { parallel = Standard_True; if (Len != 0 && Direc != 0) @@ -481,7 +481,7 @@ void IntAna_IntConicQuad::Perform(const gp_Lin& L, } if (parallel) { - if (Abs(Dis) < Tolang) + if (std::abs(Dis) < Tolang) { inquadric = Standard_True; } diff --git a/src/ModelingData/TKGeomBase/IntAna/IntAna_IntQuadQuad.cxx b/src/ModelingData/TKGeomBase/IntAna/IntAna_IntQuadQuad.cxx index 9bade3f616..00cc68d630 100644 --- a/src/ModelingData/TKGeomBase/IntAna/IntAna_IntQuadQuad.cxx +++ b/src/ModelingData/TKGeomBase/IntAna/IntAna_IntQuadQuad.cxx @@ -78,24 +78,24 @@ static void AddSpecialPoints(const IntAna_Quadric& theQuad, continue; } - Standard_Real aDelta1 = Min(aU - theTheta1, 0.0), aDelta2 = Max(aU - theTheta2, 0.0); + Standard_Real aDelta1 = std::min(aU - theTheta1, 0.0), aDelta2 = std::max(aU - theTheta2, 0.0); if (aDelta1 < -M_PI) { - // Must be aDelta1 = Min(aU - theTheta1 + aPeriod, 0.0). + // Must be aDelta1 = std::min(aU - theTheta1 + aPeriod, 0.0). // But aU - theTheta1 + aPeriod >= 0 always. aDelta1 = 0.0; } if (aDelta2 > M_PI) { - // Must be aDelta2 = Max(aU - theTheta2 - aPeriod, 0.0). + // Must be aDelta2 = std::max(aU - theTheta2 - aPeriod, 0.0). // But aU - theTheta2 - aPeriod <= 0 always. aDelta2 = 0.0; } - const Standard_Real aDelta = Max(-aDelta1, aDelta2); - aMaxDelta = Max(aMaxDelta, aDelta); + const Standard_Real aDelta = std::max(-aDelta1, aDelta2); + aMaxDelta = std::max(aMaxDelta, aDelta); } if (aMaxDelta != 0.0) @@ -143,11 +143,11 @@ public: // for (i = 0; i < NbRoots; ++i) { - if (Abs(u - Roots[i]) <= aEps) + if (std::abs(u - Roots[i]) <= aEps) { return Standard_True; } - if (Abs(u - Roots[i] - PIpPI) <= aEps) + if (std::abs(u - Roots[i] - PIpPI) <= aEps) { return Standard_True; } @@ -240,7 +240,7 @@ TrigonometricRoots::TrigonometricRoots(const Standard_Real CC, Standard_Real co = cos(Roots[i]); Standard_Real si = sin(Roots[i]); y = co * (CC * co + (SC + SC) * si + C) + S * si + Cte; - if (Abs(y) > 1e-8) + if (std::abs(y) > 1e-8) { done = Standard_False; return; //-- le 1er avril 98 @@ -266,9 +266,9 @@ TrigonometricRoots::TrigonometricRoots(const Standard_Real CC, // if (!NbRoots) { //--!!!!! Detection du cas Pol = Cte ( 1e-50 ) !!!! - if ((Abs(CC) + Abs(SC) + Abs(C) + Abs(S)) < 1e-10) + if ((std::abs(CC) + std::abs(SC) + std::abs(C) + std::abs(S)) < 1e-10) { - if (Abs(Cte) < 1e-10) + if (std::abs(Cte) < 1e-10) { infinite_roots = Standard_True; } @@ -411,12 +411,12 @@ void IntAna_IntQuadQuad::Perform(const gp_Cylinder& Cyl, //---------------------------------------------------------------------- //-- Parametrage du Cylindre Cyl : - //-- X = Rcyl * Cos(Theta) - //-- Y = Rcyl * Sin(Theta) + //-- X = Rcyl * std::cos(Theta) + //-- Y = Rcyl * std::sin(Theta) //-- Z = Z //---------------------------------------------------------------------- //-- Donne une Equation de la forme : - //-- F(Sin(Theta),Cos(Theta),ZCyl) = 0 + //-- F(std::sin(Theta),std::cos(Theta),ZCyl) = 0 //-- (Equation du second degre en ZCyl) //-- ZCyl**2 CoeffZ2(Theta) + ZCyl CoeffZ1(Theta) + CoeffZ0(Theta) //---------------------------------------------------------------------- @@ -428,13 +428,13 @@ void IntAna_IntQuadQuad::Perform(const gp_Cylinder& Cyl, //-- !!!! Attention , si on norme sur Qzz pour detecter le cas 1er degre //---------------------------------------------------------------------- //-- On Cherche Les Racines en Theta du discriminant de cette equation : - //-- DIS(Theta) = C_1 + C_SS Sin()**2 + C_CC Cos()**2 + 2 C_SC Sin() Cos() - //-- + 2 C_S Sin() + 2 C_C Cos() + //-- DIS(Theta) = C_1 + C_SS std::sin()**2 + C_CC std::cos()**2 + 2 C_SC std::sin() std::cos() + //-- + 2 C_S std::sin() + 2 C_C std::cos() //-- //-- Si Qzz = 0 Alors On Resout Z=Fct(Theta) sur le domaine de Theta //---------------------------------------------------------------------- - if (Abs(Qzz) < myEpsilonCoeffPolyNull) + if (std::abs(Qzz) < myEpsilonCoeffPolyNull) { done = Standard_False; //-- le 12 mars 98 return; @@ -664,7 +664,7 @@ void IntAna_IntQuadQuad::Perform(const gp_Cylinder& Cyl, //-- On detecte les racines doubles //-- Si il n y a que 2 racines alors on prend tout l interval //---------------------------------------------------------------- - if (Abs(Theta2 - Theta1) <= aRealEpsilon) + if (std::abs(Theta2 - Theta1) <= aRealEpsilon) { UnPtTg = Standard_True; autrepar = Theta1 - 0.1; @@ -725,7 +725,7 @@ void IntAna_IntQuadQuad::Perform(const gp_Cylinder& Cyl, //-- On detecte les racines doubles //-- Si il n y a que 2 racines alors on prend tout l interval //---------------------------------------------------------------- - if (Abs(Theta2 - Theta1) <= 1e-12) + if (std::abs(Theta2 - Theta1) <= 1e-12) { //-- std::cout<<"\n####### Un Point de Tangence en Theta = "< +INF pour Theta - //-- std::cout<<"######## Droite Solution Pour Theta = "<= Abs(Det2)) && (Abs(Det1) >= Abs(Det3)))) + if ((Det1 != 0.0) && ((std::abs(Det1) >= std::abs(Det2)) && (std::abs(Det1) >= std::abs(Det3)))) { A = (smy * V2.X() - smx * V2.Y()) / Det1; } - else if ((Det2 != 0.0) && ((Abs(Det2) >= Abs(Det1)) && (Abs(Det2) >= Abs(Det3)))) + else if ((Det2 != 0.0) + && ((std::abs(Det2) >= std::abs(Det1)) && (std::abs(Det2) >= std::abs(Det3)))) { A = (smz * V2.Y() - smy * V2.Z()) / Det2; } @@ -236,11 +237,11 @@ void AxeOperator::Distance(Standard_Real& dist, Standard_Real& Param1, Standard_ gp_Ax2 DirToAx2(const gp_Pnt& P, const gp_Dir& D) { Standard_Real x = D.X(); - Standard_Real ax = Abs(x); + Standard_Real ax = std::abs(x); Standard_Real y = D.Y(); - Standard_Real ay = Abs(y); + Standard_Real ay = std::abs(y); Standard_Real z = D.Z(); - Standard_Real az = Abs(z); + Standard_Real az = std::abs(z); if ((ax == 0.0) || ((ax < ay) && (ax < az))) { return (gp_Ax2(P, D, gp_Dir(gp_Vec(0.0, -z, y)))); @@ -308,16 +309,16 @@ Standard_Real EstimDist(const gp_Cone& theCon1, const gp_Cone& theCon2) for (k = 1; k <= aNbPoints; ++k) { const IntAna2d_IntPoint& anIntP = anInter.Point(k); - Standard_Real aPar1 = Abs(anIntP.ParamOnFirst()); - aMinDist[0] = Min(aPar1, aMinDist[0]); - Standard_Real aPar2 = Abs(anIntP.ParamOnSecond()); - aMinDist[1] = Min(aPar2, aMinDist[1]); + Standard_Real aPar1 = std::abs(anIntP.ParamOnFirst()); + aMinDist[0] = std::min(aPar1, aMinDist[0]); + Standard_Real aPar2 = std::abs(anIntP.ParamOnSecond()); + aMinDist[1] = std::min(aPar2, aMinDist[1]); } } } } - Standard_Real aDist = Max(aMinDist[0], aMinDist[1]); + Standard_Real aDist = std::max(aMinDist[0], aMinDist[1]); return aDist; } @@ -410,7 +411,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P1, if (aMVD <= TolAng) { // normalles are collinear - planes are same or parallel - typeres = (Abs(dist1) <= Tol && Abs(dist2) <= Tol) ? IntAna_Same : IntAna_Empty; + typeres = (std::abs(dist1) <= Tol && std::abs(dist2) <= Tol) ? IntAna_Same : IntAna_Empty; } else { @@ -422,7 +423,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P1, denom2 = denom * denom; ddenom = 1. - denom2; - denom = (Abs(ddenom) <= aEps) ? aEps : ddenom; + denom = (std::abs(ddenom) <= aEps) ? aEps : ddenom; par1 = dist1 / denom; par2 = -dist2 / denom; @@ -566,15 +567,15 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, gp_Vec ldv(axec.Direction()); gp_Vec npv(normp); - Standard_Real dA = Abs(ldv.Angle(npv)); + Standard_Real dA = std::abs(ldv.Angle(npv)); if (dA > (M_PI / 4.)) { - Standard_Real dang = Abs(ldv.Angle(npv)) - M_PI / 2.; - Standard_Real dangle = Abs(dang); + Standard_Real dang = std::abs(ldv.Angle(npv)) - M_PI / 2.; + Standard_Real dangle = std::abs(dang); if (dangle > Tolang) { - Standard_Real sinda = Abs(Sin(dangle)); - Standard_Real dif = Abs(sinda - Tol); + Standard_Real sinda = std::abs(std::sin(dangle)); + Standard_Real dif = std::abs(sinda - Tol); if (dif < Tol) { tolang = sinda * 2.; @@ -594,7 +595,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, typeres = IntAna_Line; omega.SetCoord(X - dist * A, Y - dist * B, Z - dist * C); - if (Abs(Abs(dist) - radius) < Tol) + if (std::abs(std::abs(dist) - radius) < Tol) { nbint = 1; pt1.SetXYZ(omega); @@ -618,10 +619,10 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, else dir1 = axec.Direction(); } - else if (Abs(dist) < radius) + else if (std::abs(dist) < radius) { nbint = 2; - h = Sqrt(radius * radius - dist * dist); + h = std::sqrt(radius * radius - dist * dist); axey = axec.Direction().XYZ().Crossed(normp); // axey est normalise pt1.SetXYZ(omega - h * axey); @@ -633,10 +634,9 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, gp_XYZ omegaXYZtrnsl(omegaXYZ + 100. * axec.Direction().XYZ()); Standard_Real Xt, Yt, Zt, distt, ht; omegaXYZtrnsl.Coord(Xt, Yt, Zt); - distt = A * Xt + B * Yt + C * Zt + D; - // ht = Sqrt(radius*radius - distt*distt); + distt = A * Xt + B * Yt + C * Zt + D; Standard_Real anSqrtArg = radius * radius - distt * distt; - ht = (anSqrtArg > 0.) ? Sqrt(anSqrtArg) : 0.; + ht = (anSqrtArg > 0.) ? std::sqrt(anSqrtArg) : 0.; gp_XYZ omega1(omegaXYZtrnsl.X() - distt * A, omegaXYZtrnsl.Y() - distt * B, @@ -692,7 +692,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, // on construit un ellipse typeres = IntAna_Ellipse; - cost = Abs(axec.Direction().XYZ().Dot(normp)); + cost = std::abs(axec.Direction().XYZ().Dot(normp)); axex = axey.Crossed(normp); dir1.SetXYZ(normp); // Modif ds ce bloc @@ -767,27 +767,27 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, angl = Co.SemiAngle(); - cosa = Cos(angl); - sina = Abs(Sin(angl)); + cosa = std::cos(angl); + sina = std::abs(std::sin(angl)); // Angle entre la normale au plan et l axe du cone, ramene entre 0. et PI/2. sint = axey.Modulus(); - cost = Abs(Co.Axis().Direction().XYZ().Dot(normp)); + cost = std::abs(Co.Axis().Direction().XYZ().Dot(normp)); // Le calcul de costa permet de determiner si le plan contient - // un generatrice du cone : on calcul Sin((PI/2. - t) - angl) + // un generatrice du cone : on calcul std::sin((PI/2. - t) - angl) costa = cost * cosa - sint * sina; // sin((PI/2 -t)-angl)=cos(t+angl) // avec t ramene entre 0 et pi/2. - if (Abs(dist) < Tol) + if (std::abs(dist) < Tol) { // on considere que le plan contient le sommet du cone. // les solutions possibles sont donc : 1 point, 1 droite, 2 droites // selon l inclinaison du plan. - if (Abs(costa) < Tolang) + if (std::abs(costa) < Tolang) { // plan parallele a la generatrice typeres = IntAna_Line; nbint = 1; @@ -805,7 +805,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, nbint = 2; pt1 = apex; pt2 = apex; - dh = Sqrt(sina * sina - cost * cost) / cosa; + dh = std::sqrt(sina * sina - cost * cost) / cosa; dir1.SetXYZ(axex + dh * axey); dir2.SetXYZ(axex - dh * axey); } @@ -832,8 +832,8 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, pt2 = pt1; dir1 = normp; dir2.SetXYZ(axex); - param1 = param2 = Abs(dist / Tan(angl)); - param1bis = param2bis = Abs(dist); + param1 = param2 = std::abs(dist / std::tan(angl)); + param1bis = param2bis = std::abs(dist); } else { @@ -848,13 +848,13 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, distance = apex.Distance(center); - if (inter.ParamOnConic(1) + Co.RefRadius() / Tan(angl) < 0.) + if (inter.ParamOnConic(1) + Co.RefRadius() / std::tan(angl) < 0.) { axex.Reverse(); axey.Reverse(); } - if (Abs(costa) < Tolang) + if (std::abs(costa) < Tolang) { // plan parallele a une generatrice typeres = IntAna_Parabola; nbint = 1; @@ -872,7 +872,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, pt1 = center; dir1 = Co.Position().Direction(); dir2 = Co.Position().XDirection(); - param1 = apex.Distance(center) * Abs(Tan(angl)); + param1 = apex.Distance(center) * std::abs(std::tan(angl)); } else if (cost < sina) { @@ -886,7 +886,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, dir1 = normp; dir2.SetXYZ(axex); param1 = param2 = cost * sina * cosa * distance / (sina * sina - cost * cost); - param1bis = param2bis = cost * sina * distance / Sqrt(sina * sina - cost * cost); + param1bis = param2bis = cost * sina * distance / std::sqrt(sina * sina - cost * cost); } else { // on a alors cost > sina @@ -899,7 +899,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, dir1 = normp; dir2.SetXYZ(axex); param1 = radius; - param1bis = cost * sina * distance / Sqrt(cost * cost - sina * sina); + param1bis = cost * sina * distance / std::sqrt(cost * cost - sina * sina); } } } @@ -911,7 +911,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, static Standard_Real HyperbolaLimit = 2.0E+6; // OCC537(apo) 50000 if (typeres == IntAna_Ellipse && nbint >= 1) { - if (Abs(param1) > EllipseLimit || Abs(param1bis) > EllipseLimit) + if (std::abs(param1) > EllipseLimit || std::abs(param1bis) > EllipseLimit) { done = Standard_False; return; @@ -919,7 +919,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, } if (typeres == IntAna_Hyperbola && nbint >= 2) { - if (Abs(param2) > HyperbolaLimit || Abs(param2bis) > HyperbolaLimit) + if (std::abs(param2) > HyperbolaLimit || std::abs(param2bis) > HyperbolaLimit) { done = Standard_False; return; @@ -927,7 +927,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, } if (typeres == IntAna_Hyperbola && nbint >= 1) { - if (Abs(param1) > HyperbolaLimit || Abs(param1bis) > HyperbolaLimit) + if (std::abs(param1) > HyperbolaLimit || std::abs(param1bis) > HyperbolaLimit) { done = Standard_False; return; @@ -979,7 +979,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, const gp_Sphere& S) dist = A * X + B * Y + C * Z + D; - if (Abs(Abs(dist) - radius) < Epsilon(radius)) + if (std::abs(std::abs(dist) - radius) < Epsilon(radius)) { // on a une seule solution : le point projection du centre de la sphere // sur le plan @@ -987,7 +987,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, const gp_Sphere& S) typeres = IntAna_Point; pt1.SetCoord(X - dist * A, Y - dist * B, Z - dist * C); } - else if (Abs(dist) < radius) + else if (std::abs(dist) < radius) { // on a un cercle solution nbint = 1; @@ -997,7 +997,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& P, const gp_Sphere& S) if (P.Direct() == Standard_False) dir1.Reverse(); dir2 = P.Position().XDirection(); - param1 = Sqrt(radius * radius - dist * dist); + param1 = std::sqrt(radius * radius - dist * dist); } param2bis = 0.0; //-- pour eviter param2bis not used .... done = Standard_True; @@ -1218,8 +1218,8 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cylinder& Cyl1, Standard_Real A = DirCyl1.Angle(DirCyl2); Standard_Real B; - B = Abs(Sin(0.5 * (M_PI - A))); - A = Abs(Sin(0.5 * A)); + B = std::abs(std::sin(0.5 * (M_PI - A))); + A = std::abs(std::sin(0.5 * A)); if (A == 0.0 || B == 0.0) { @@ -1251,7 +1251,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cylinder& Cyl1, } else { - if (Abs(DistA1A2 - Cyl1.Radius() - Cyl2.Radius()) < Tol) + if (std::abs(DistA1A2 - Cyl1.Radius() - Cyl2.Radius()) < Tol) { typeres = IntAna_Point; Standard_Real d, p1, p2; @@ -1317,7 +1317,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cylinder& Cyl, const gp_Cone& Con, con if (A1A2.Same()) { gp_Pnt Pt = Con.Apex(); - Standard_Real dist = Cyl.Radius() / (Tan(Con.SemiAngle())); + Standard_Real dist = Cyl.Radius() / (std::tan(Con.SemiAngle())); gp_Dir dir = Cyl.Position().Direction(); pt1.SetCoord(Pt.X() + dist * dir.X(), Pt.Y() + dist * dir.Y(), Pt.Z() + dist * dir.Z()); pt2.SetCoord(Pt.X() - dist * dir.X(), Pt.Y() - dist * dir.Y(), Pt.Z() - dist * dir.Z()); @@ -1374,7 +1374,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cylinder& Cyl, const gp_Sphere& Sph, c } else { - Standard_Real dist = Sqrt(Sph.Radius() * Sph.Radius() - Cyl.Radius() * Cyl.Radius()); + Standard_Real dist = std::sqrt(Sph.Radius() * Sph.Radius() - Cyl.Radius() * Cyl.Radius()); gp_Dir dir = Cyl.Position().Direction(); dir1 = dir2 = dir; typeres = IntAna_Circle; @@ -1435,8 +1435,8 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cone& Con1, const gp_Cone& Con2, const Standard_Real TOL_APEX_CONF = 1.e-10; // - tg1 = Tan(Con1.SemiAngle()); - tg2 = Tan(Con2.SemiAngle()); + tg1 = std::tan(Con1.SemiAngle()); + tg2 = std::tan(Con2.SemiAngle()); if ((tg1 * tg2) < 0.) { @@ -1451,7 +1451,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cone& Con1, const gp_Cone& Con2, const AxeOperator A1A2(Con1.Axis(), Con2.Axis()); // Standard_Real aTolAng = myEPSILON_ANGLE_CONE; - if ((Abs(tg1 - tg2) < Tol) && (A1A2.Parallel())) + if ((std::abs(tg1 - tg2) < Tol) && (A1A2.Parallel())) { Standard_Real DistA1A2 = A1A2.Distance(); if (DistA1A2 > 100. * Tol) @@ -1463,8 +1463,8 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cone& Con1, const gp_Cone& Con2, const } else { - aTolAng = Max(myEPSILON_ANGLE_CONE, Tol / aMinSolDist); - aTolAng = Min(aTolAng, Tol); + aTolAng = std::max(myEPSILON_ANGLE_CONE, Tol / aMinSolDist); + aTolAng = std::min(aTolAng, Tol); } } } @@ -1478,7 +1478,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cone& Con1, const gp_Cone& Con2, const gp_Dir D = Con1.Position().Direction(); Standard_Real d = gp_Vec(D).Dot(gp_Vec(P, Con2.Apex())); - if (Abs(tg1 - tg2) > myEPSILON_ANGLE_CONE) + if (std::abs(tg1 - tg2) > myEPSILON_ANGLE_CONE) { if (fabs(d) < TOL_APEX_CONF) { @@ -1489,11 +1489,11 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cone& Con1, const gp_Cone& Con2, const } x = (d * tg2) / (tg1 + tg2); pt1.SetCoord(P.X() + x * D.X(), P.Y() + x * D.Y(), P.Z() + x * D.Z()); - param1 = Abs(x * tg1); + param1 = std::abs(x * tg1); x = (d * tg2) / (tg2 - tg1); pt2.SetCoord(P.X() + x * D.X(), P.Y() + x * D.Y(), P.Z() + x * D.Z()); - param2 = Abs(x * tg1); + param2 = std::abs(x * tg1); dir1 = dir2 = D; nbint = 2; typeres = IntAna_Circle; @@ -1510,13 +1510,13 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cone& Con1, const gp_Cone& Con2, const nbint = 1; x = d * 0.5; pt1.SetCoord(P.X() + x * D.X(), P.Y() + x * D.Y(), P.Z() + x * D.Z()); - param1 = Abs(x * tg1); + param1 = std::abs(x * tg1); dir1 = D; } } } //-- fin A1A2.Same // 2 - else if ((Abs(tg1 - tg2) < aTolAng) && (A1A2.Parallel())) + else if ((std::abs(tg1 - tg2) < aTolAng) && (A1A2.Parallel())) { Standard_Real DistA1A2 = A1A2.Distance(); @@ -1531,7 +1531,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cone& Con1, const gp_Cone& Con2, const gp_Dir DB1 = gp_Dir(O1_Proj_A2); Standard_Real yO1O2 = O1O2.Dot(gp_Vec(DA1)); - Standard_Real ABSTG1 = Abs(tg1); + Standard_Real ABSTG1 = std::abs(tg1); Standard_Real X2 = (DistA1A2 / ABSTG1 - yO1O2) * 0.5; Standard_Real X1 = X2 + yO1O2; @@ -1598,7 +1598,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cone& Con1, const gp_Cone& Con2, const typeres = IntAna_NoGeometricSolution; } } - } // else if((Abs(tg1-tg2) 0.0) ? Sqrt(Beta) : 0.0; + Beta = (Beta > 0.0) ? std::sqrt(Beta) : 0.0; if (Beta <= myEPSILON_MINI_CIRCLE_RADIUS) { @@ -2207,14 +2207,14 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& Pln, const gp_Torus& Tor, const S aTorLoc.Coord(X, Y, Z); aDist = A * X + B * Y + C * Z + D; // - aDR = Abs(aDist) - aRMin; + aDR = std::abs(aDist) - aRMin; if (aDR > aTolNum) { typeres = IntAna_Empty; return; } // - if (Abs(aDR) < aTolNum) + if (std::abs(aDR) < aTolNum) { aDist = (aDist < 0) ? -aRMin : aRMin; } @@ -2222,7 +2222,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Pln& Pln, const gp_Torus& Tor, const S typeres = IntAna_Circle; // pt1.SetCoord(X - aDist * A, Y - aDist * B, Z - aDist * C); - aDt = Sqrt(Abs(aRMin * aRMin - aDist * aDist)); + aDt = std::sqrt(std::abs(aRMin * aRMin - aDist * aDist)); param1 = aRMaj + aDt; dir1 = aTorAx.Direction(); nbint = 1; @@ -2324,7 +2324,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cylinder& Cyl, // typeres = IntAna_Circle; // - Standard_Real aDist = Sqrt(Abs(aRMin * aRMin - (aRCyl - aRMaj) * (aRCyl - aRMaj))); + Standard_Real aDist = std::sqrt(std::abs(aRMin * aRMin - (aRCyl - aRMaj) * (aRCyl - aRMaj))); gp_XYZ aTorLoc = aTorAx.Location().XYZ(); // dir1 = aTorAx.Direction(); @@ -2430,7 +2430,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Cone& Con, const gp_Torus& Tor, const typeres = IntAna_Circle; // gp_XYZ aPh = aPCT.XYZ() - aDist * aConL.Normal(aPCT).Direction().XYZ(); - aDt = Sqrt(Abs(aRMin * aRMin - aDist * aDist)); + aDt = std::sqrt(std::abs(aRMin * aRMin - aDist * aDist)); // gp_Pnt aP; gp_XYZ aDVal = aDt * aDL.XYZ(); @@ -2545,7 +2545,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Sphere& Sph, const gp_Torus& Tor, cons // gp_Vec aVec12(aTorLoc, aSphLoc); aDist = aVec12.Magnitude(); - if (((aDist - Tol) > (aRMin + aRSph)) || ((aDist + Tol) < Abs(aRMin - aRSph))) + if (((aDist - Tol) > (aRMin + aRSph)) || ((aDist + Tol) < std::abs(aRMin - aRSph))) { typeres = IntAna_Empty; return; @@ -2556,7 +2556,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Sphere& Sph, const gp_Torus& Tor, cons Standard_Real anAlpha, aBeta; // anAlpha = 0.5 * (aRMin * aRMin - aRSph * aRSph + aDist * aDist) / aDist; - aBeta = Sqrt(Abs(aRMin * aRMin - anAlpha * anAlpha)); + aBeta = std::sqrt(std::abs(aRMin * aRMin - anAlpha * anAlpha)); // gp_Dir aDir12(aVec12); gp_XYZ aPh = aTorLoc.XYZ() + anAlpha * aDir12.XYZ(); @@ -2569,7 +2569,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Sphere& Sph, const gp_Torus& Tor, cons pt1.SetXYZ(aP.XYZ() - param1 * aXDir.XYZ()); dir1 = aTorAx.Direction(); nbint = 1; - if ((aDist < (aRSph + aRMin)) && (aDist > Abs(aRSph - aRMin)) && (aDVal.Modulus() > Tol)) + if ((aDist < (aRSph + aRMin)) && (aDist > std::abs(aRSph - aRMin)) && (aDVal.Modulus() > Tol)) { aP.SetXYZ(aPh - aDVal); param2 = aLin.Distance(aP); @@ -2634,7 +2634,8 @@ void IntAna_QuadQuadGeo::Perform(const gp_Torus& Tor1, return; } // - if (aLoc1.IsEqual(aLoc2, Tol) && (Abs(aRMin1 - aRMin2) <= Tol) && (Abs(aRMaj1 - aRMaj2) <= Tol)) + if (aLoc1.IsEqual(aLoc2, Tol) && (std::abs(aRMin1 - aRMin2) <= Tol) + && (std::abs(aRMaj1 - aRMaj2) <= Tol)) { typeres = IntAna_Same; return; @@ -2655,7 +2656,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Torus& Tor1, // gp_Vec aV12(aP1, aP2); aDist = aV12.Magnitude(); - if (((aDist - Tol) > (aRMin1 + aRMin2)) || ((aDist + Tol) < Abs(aRMin1 - aRMin2))) + if (((aDist - Tol) > (aRMin1 + aRMin2)) || ((aDist + Tol) < std::abs(aRMin1 - aRMin2))) { typeres = IntAna_Empty; return; @@ -2666,7 +2667,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Torus& Tor1, Standard_Real anAlpha, aBeta; // anAlpha = 0.5 * (aRMin1 * aRMin1 - aRMin2 * aRMin2 + aDist * aDist) / aDist; - aBeta = Sqrt(Abs(aRMin1 * aRMin1 - anAlpha * anAlpha)); + aBeta = std::sqrt(std::abs(aRMin1 * aRMin1 - anAlpha * anAlpha)); // gp_Dir aDir12(aV12); gp_XYZ aPh = aP1.XYZ() + anAlpha * aDir12.XYZ(); @@ -2679,7 +2680,7 @@ void IntAna_QuadQuadGeo::Perform(const gp_Torus& Tor1, pt1.SetXYZ(aP.XYZ() - param1 * aXDir1.XYZ()); dir1 = anAx1.Direction(); nbint = 1; - if ((aDist < (aRMin1 + aRMin2)) && (aDist > Abs(aRMin1 - aRMin2)) && aDVal.Modulus() > Tol) + if ((aDist < (aRMin1 + aRMin2)) && (aDist > std::abs(aRMin1 - aRMin2)) && aDVal.Modulus() > Tol) { aP.SetXYZ(aPh - aDVal); param2 = aL1.Distance(aP); diff --git a/src/ModelingData/TKGeomBase/IntAna/IntAna_Quadric.cxx b/src/ModelingData/TKGeomBase/IntAna/IntAna_Quadric.cxx index 472118f1bd..8c4a65c15c 100644 --- a/src/ModelingData/TKGeomBase/IntAna/IntAna_Quadric.cxx +++ b/src/ModelingData/TKGeomBase/IntAna/IntAna_Quadric.cxx @@ -97,7 +97,7 @@ IntAna_Quadric::IntAna_Quadric(const gp_Cone& Cone) void IntAna_Quadric::SetQuadric(const gp_Cone& Cone) { Cone.Coefficients(CXX, CYY, CZZ, CXY, CXZ, CYZ, CX, CY, CZ, CCte); - const Standard_Real aVParam = -Cone.RefRadius() / Sin(Cone.SemiAngle()); + const Standard_Real aVParam = -Cone.RefRadius() / std::sin(Cone.SemiAngle()); mySpecialPoints.Append(ElSLib::Value(0.0, aVParam, Cone)); } diff --git a/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_AnaIntersection_1.cxx b/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_AnaIntersection_1.cxx index 1e7caaf395..17967176c9 100644 --- a/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_AnaIntersection_1.cxx +++ b/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_AnaIntersection_1.cxx @@ -32,9 +32,10 @@ void IntAna2d_AnaIntersection::Perform(const gp_Lin2d& L1, const gp_Lin2d& L2) Standard_Real al1, be1, ga1; Standard_Real al2, be2, ga2; - Standard_Real Det = Max(Abs(A1), Max(Abs(A2), Max(Abs(B1), Abs(B2)))); + Standard_Real Det = + std::max(std::abs(A1), std::max(std::abs(A2), std::max(std::abs(B1), std::abs(B2)))); - if (Abs(A1) == Det) + if (std::abs(A1) == Det) { al1 = A1; be1 = B1; @@ -43,7 +44,7 @@ void IntAna2d_AnaIntersection::Perform(const gp_Lin2d& L1, const gp_Lin2d& L2) be2 = B2; ga2 = C2; } - else if (Abs(B1) == Det) + else if (std::abs(B1) == Det) { al1 = B1; be1 = A1; @@ -52,7 +53,7 @@ void IntAna2d_AnaIntersection::Perform(const gp_Lin2d& L1, const gp_Lin2d& L2) be2 = A2; ga2 = C2; } - else if (Abs(A2) == Det) + else if (std::abs(A2) == Det) { al1 = A2; be1 = B2; @@ -74,11 +75,11 @@ void IntAna2d_AnaIntersection::Perform(const gp_Lin2d& L1, const gp_Lin2d& L2) Standard_Real rap = al2 / al1; Standard_Real denom = be2 - rap * be1; - if (Abs(denom) <= RealEpsilon()) + if (std::abs(denom) <= RealEpsilon()) { // Directions confondues para = Standard_True; nbp = 0; - if (Abs(ga2 - rap * ga1) <= RealEpsilon()) + if (std::abs(ga2 - rap * ga1) <= RealEpsilon()) { // Droites confondues iden = Standard_True; empt = Standard_False; @@ -98,8 +99,8 @@ void IntAna2d_AnaIntersection::Perform(const gp_Lin2d& L1, const gp_Lin2d& L2) Standard_Real XS = (be1 * ga2 / al1 - be2 * ga1 / al1) / denom; Standard_Real YS = (rap * ga1 - ga2) / denom; - if (((Abs(A1) != Det) && (Abs(B1) == Det)) - || ((Abs(A1) != Det) && (Abs(B1) != Det) && (Abs(A2) != Det))) + if (((std::abs(A1) != Det) && (std::abs(B1) == Det)) + || ((std::abs(A1) != Det) && (std::abs(B1) != Det) && (std::abs(A2) != Det))) { Standard_Real temp = XS; XS = YS; @@ -107,7 +108,7 @@ void IntAna2d_AnaIntersection::Perform(const gp_Lin2d& L1, const gp_Lin2d& L2) } Standard_Real La, Mu; - if (Abs(A1) >= Abs(B1)) + if (std::abs(A1) >= std::abs(B1)) { La = (YS - L1.Location().Y()) / A1; } @@ -115,7 +116,7 @@ void IntAna2d_AnaIntersection::Perform(const gp_Lin2d& L1, const gp_Lin2d& L2) { La = (L1.Location().X() - XS) / B1; } - if (Abs(A2) >= Abs(B2)) + if (std::abs(A2) >= std::abs(B2)) { Mu = (YS - L2.Location().Y()) / A2; } diff --git a/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_AnaIntersection_2.cxx b/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_AnaIntersection_2.cxx index 17d3d8b6cf..f97f4f2663 100644 --- a/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_AnaIntersection_2.cxx +++ b/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_AnaIntersection_2.cxx @@ -27,7 +27,7 @@ void IntAna2d_AnaIntersection::Perform(const gp_Circ2d& C1, const gp_Circ2d& C2) Standard_Real R1 = C1.Radius(); Standard_Real R2 = C2.Radius(); Standard_Real sum = R1 + R2; - Standard_Real dif = Abs(R1 - R2); + Standard_Real dif = std::abs(R1 - R2); if (d <= RealEpsilon()) { // Cercle concentriques @@ -52,7 +52,7 @@ void IntAna2d_AnaIntersection::Perform(const gp_Circ2d& C1, const gp_Circ2d& C2) iden = Standard_False; nbp = 0; } - else if (Abs(d - sum) <= Epsilon(sum)) + else if (std::abs(d - sum) <= Epsilon(sum)) { // Cercles exterieurs et tangents empt = Standard_False; para = Standard_False; @@ -89,7 +89,7 @@ void IntAna2d_AnaIntersection::Perform(const gp_Circ2d& C1, const gp_Circ2d& C2) { l1 = (l1 > 0 ? R1 : -R1); } - Standard_Real h = Sqrt(R1 * R1 - l1 * l1); + Standard_Real h = std::sqrt(R1 * R1 - l1 * l1); Standard_Real XS1 = C1.Location().X() + l1 * ax.X() / d - h * ax.Y() / d; Standard_Real YS1 = C1.Location().Y() + l1 * ax.Y() / d + h * ax.X() / d; @@ -109,25 +109,25 @@ void IntAna2d_AnaIntersection::Perform(const gp_Circ2d& C1, const gp_Circ2d& C2) // si l'axe de reference est l'axe des centres C1C2 // On prend l'arccos entre pi/2 et 3pi/2, l'arcsin sinon. - if (Abs(cost1) <= 0.707) + if (std::abs(cost1) <= 0.707) { - ang1 = ACos(cost1); + ang1 = std::acos(cost1); } else { - ang1 = ASin(sint1); + ang1 = std::asin(sint1); if (cost1 < 0.0) { ang1 = M_PI - ang1; } } - if (Abs(cost2) <= 0.707) + if (std::abs(cost2) <= 0.707) { - ang2 = ACos(cost2); + ang2 = std::acos(cost2); } else { - ang2 = ASin(sint2); + ang2 = std::asin(sint2); if (cost2 < 0.0) { ang2 = M_PI - ang2; @@ -172,7 +172,7 @@ void IntAna2d_AnaIntersection::Perform(const gp_Circ2d& C1, const gp_Circ2d& C2) lpnt[0].SetValue(XS1, YS1, ang11, ang21); lpnt[1].SetValue(XS2, YS2, ang12, ang22); } - else if (Abs(d - dif) <= Epsilon(sum)) + else if (std::abs(d - dif) <= Epsilon(sum)) { // Cercles tangents interieurs empt = Standard_False; para = Standard_False; diff --git a/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_AnaIntersection_3.cxx b/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_AnaIntersection_3.cxx index 264912feda..91f797cf44 100644 --- a/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_AnaIntersection_3.cxx +++ b/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_AnaIntersection_3.cxx @@ -35,7 +35,7 @@ void IntAna2d_AnaIntersection::Perform(const gp_Lin2d& L, const gp_Circ2d& C) L.Coefficients(A, B, C0); d = A * C.Location().X() + B * C.Location().Y() + C0; - if (Abs(d) - C.Radius() > Epsilon(C.Radius())) + if (std::abs(d) - C.Radius() > Epsilon(C.Radius())) { empt = Standard_True; nbp = 0; @@ -49,7 +49,7 @@ void IntAna2d_AnaIntersection::Perform(const gp_Lin2d& L, const gp_Circ2d& C) // ang = C.XAxis().Direction().Angle(L.Direction()); // ang = ang + M_PI / 2.0; // modified by NIZNHY-PKV Fri Jun 15 09:55:29 2007t - if (Abs(Abs(d) - C.Radius()) <= Epsilon(C.Radius())) + if (std::abs(std::abs(d) - C.Radius()) <= Epsilon(C.Radius())) { // Cas de tangence Standard_Real u, XS, YS, ang; @@ -82,7 +82,7 @@ void IntAna2d_AnaIntersection::Perform(const gp_Lin2d& L, const gp_Circ2d& C) Standard_Real h, XS1,YS1, XS2,YS2, ang1,ang2, u1,u2;//,cost,sint angt; // clang-format on nbp = 2; - h = Sqrt(C.Radius() * C.Radius() - d * d); + h = std::sqrt(C.Radius() * C.Radius() - d * d); // modified by NIZNHY-PKV Fri Jun 15 09:55:47 2007f // cost=d/C.Radius(); // sint=h/C.Radius(); @@ -99,36 +99,7 @@ void IntAna2d_AnaIntersection::Perform(const gp_Lin2d& L, const gp_Circ2d& C) u2 = ElCLib::Parameter(L, aP2D2); ang1 = ElCLib::Parameter(C, aP2D1); ang2 = ElCLib::Parameter(C, aP2D2); - // - /* - if (Abs(cost)<=0.707) { - angt=ACos(cost); - } - else { - angt=ASin(sint); - if (cost<0) {angt=M_PI-angt;} - } - - ang1=ang-angt; - ang2=ang+angt; - if (ang1<0.0) { - ang1=ang1+2.0*M_PI; - } - else if (ang1>=2.0*M_PI) { - ang1=ang1-2.0*M_PI; - } - if (ang2<0.0) { - ang2=ang2+2.0*M_PI; - } - else if (ang2>=2.0*M_PI) { - ang2=ang2-2.0*M_PI; - } - u1=B*(L.Location().X()-C.Location().X()) - - A*(L.Location().Y()-C.Location().Y()) +h; - u2=u1-2.0*h; - */ - // modified by NIZNHY-PKV Fri Jun 15 09:56:19 2007t lpnt[0].SetValue(XS1, YS1, u1, ang1); lpnt[1].SetValue(XS2, YS2, u2, ang2); } diff --git a/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_AnaIntersection_5.cxx b/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_AnaIntersection_5.cxx index cfaf8b49af..402f97c63f 100644 --- a/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_AnaIntersection_5.cxx +++ b/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_AnaIntersection_5.cxx @@ -43,7 +43,7 @@ void IntAna2d_AnaIntersection::Perform(const gp_Circ2d& Circle, const IntAna2d_C Conic.Coefficients(A, B, C, D, E, F); Conic.NewCoefficients(A, B, C, D, E, F, Axe_rep); - // Parametre a avec x=Radius Cos(a) et y=Radius Sin(a) + // Parametre a avec x=Radius std::cos(a) et y=Radius std::sin(a) pss = B * radius_P2; pcc = A * radius_P2 - pss; // COS ^2 @@ -72,8 +72,8 @@ void IntAna2d_AnaIntersection::Perform(const gp_Circ2d& Circle, const IntAna2d_C for (i = 1; i <= nbp; i++) { S = Sol.Value(i); - tx = radius * Cos(S); - ty = radius * Sin(S); + tx = radius * std::cos(S); + ty = radius * std::sin(S); Coord_Ancien_Repere(tx, ty, Axe_rep); if (!CIsDirect) S = M_PI + M_PI - S; diff --git a/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_AnaIntersection_6.cxx b/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_AnaIntersection_6.cxx index fb97fcc3e1..140da0ec82 100644 --- a/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_AnaIntersection_6.cxx +++ b/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_AnaIntersection_6.cxx @@ -44,7 +44,7 @@ void IntAna2d_AnaIntersection::Perform(const gp_Elips2d& Elips, const IntAna2d_C Conic.Coefficients(A, B, C, D, E, F); Conic.NewCoefficients(A, B, C, D, E, F, Axe_rep); - // Parametre : a avec x=MajorRadius Cos(a) et y=MinorRadius Sin(a) + // Parametre : a avec x=MajorRadius std::cos(a) et y=MinorRadius std::sin(a) pss = B * minor_radius * minor_radius; // SIN ^2 pcc = A * major_radius * major_radius - pss; // COS ^2 @@ -72,8 +72,8 @@ void IntAna2d_AnaIntersection::Perform(const gp_Elips2d& Elips, const IntAna2d_C for (i = 1; i <= nbp; i++) { S = Sol.Value(i); - tx = major_radius * Cos(S); - ty = minor_radius * Sin(S); + tx = major_radius * std::cos(S); + ty = minor_radius * std::sin(S); Coord_Ancien_Repere(tx, ty, Axe_rep); if (!EIsDirect) S = M_PI + M_PI - S; diff --git a/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_AnaIntersection_8.cxx b/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_AnaIntersection_8.cxx index 9e11eceb3f..9957aef882 100644 --- a/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_AnaIntersection_8.cxx +++ b/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_AnaIntersection_8.cxx @@ -118,7 +118,7 @@ void IntAna2d_AnaIntersection::Perform(const gp_Hypr2d& H, const IntAna2d_Conic& nb_sol_valides++; Coord_Ancien_Repere(tx, ty, Axe_rep); - S = Log(S); + S = std::log(S); if (!HIsDirect) S = -S; lpnt[nb_sol_valides - 1].SetValue(tx, ty, S); diff --git a/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_Outils.cxx b/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_Outils.cxx index 427c753e05..ed221d1a5d 100644 --- a/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_Outils.cxx +++ b/src/ModelingData/TKGeomBase/IntAna2d/IntAna2d_Outils.cxx @@ -30,13 +30,12 @@ MyDirectPolynomialRoots::MyDirectPolynomialRoots(const Standard_Real A4, // Modified by Sergey KHROMOV - Thu Oct 24 13:10:14 2002 Begin Standard_Real anAA[5]; - anAA[0] = Abs(A0); - anAA[1] = Abs(A1); - anAA[2] = Abs(A2); - anAA[3] = Abs(A3); - anAA[4] = Abs(A4); + anAA[0] = std::abs(A0); + anAA[1] = std::abs(A1); + anAA[2] = std::abs(A2); + anAA[3] = std::abs(A3); + anAA[4] = std::abs(A4); - // if((Abs(A4)+Abs(A3)+Abs(A2)+Abs(A1)+Abs(A0))UResolution(theTol3d)); - myTolV = Max(Precision::PConfusion(), mySurface->VResolution(theTol3d)); + myTolU = std::max(Precision::PConfusion(), mySurface->UResolution(theTol3d)); + myTolV = std::max(Precision::PConfusion(), mySurface->VResolution(theTol3d)); Init(); } @@ -753,7 +753,7 @@ void ProjLib_CompProjectedCurve::Init() // Search for the beginning of a new continuous part // to avoid infinite computation in some difficult cases. new_part = Standard_False; - if (t > FirstU && Abs(t - prevDeb) <= Precision::PConfusion()) + if (t > FirstU && std::abs(t - prevDeb) <= Precision::PConfusion()) SameDeb = Standard_True; while (t <= LastU && !new_part && !FromLastU && !SameDeb) { @@ -778,7 +778,8 @@ void ProjLib_CompProjectedCurve::Init() aPrjPS.Perform(ParT, ParU, ParV, aTol, aLowBorder, aUppBorder, FuncTol, Standard_True); - if (aPrjPS.IsDone() && P1.Parameter() > Max(FirstU, t - Step + Precision::PConfusion()) + if (aPrjPS.IsDone() + && P1.Parameter() > std::max(FirstU, t - Step + Precision::PConfusion()) && P1.Parameter() <= t) { t = ParT; @@ -810,20 +811,20 @@ void ProjLib_CompProjectedCurve::Init() gp_Vec2d D; if ((mySurface->IsUPeriodic() - && Abs(aUppBorder.X() - aLowBorder.X() - mySurface->UPeriod()) + && std::abs(aUppBorder.X() - aLowBorder.X() - mySurface->UPeriod()) < Precision::Confusion()) || (mySurface->IsVPeriodic() - && Abs(aUppBorder.Y() - aLowBorder.Y() - mySurface->VPeriod()) + && std::abs(aUppBorder.Y() - aLowBorder.Y() - mySurface->VPeriod()) < Precision::Confusion())) { - if ((Abs(U - aLowBorder.X()) < mySurface->UResolution(Precision::PConfusion())) + if ((std::abs(U - aLowBorder.X()) < mySurface->UResolution(Precision::PConfusion())) && mySurface->IsUPeriodic()) { d1(t, U, V, D, myCurve, mySurface); if (D.X() < 0) U = aUppBorder.X(); } - else if ((Abs(U - aUppBorder.X()) < mySurface->UResolution(Precision::PConfusion())) + else if ((std::abs(U - aUppBorder.X()) < mySurface->UResolution(Precision::PConfusion())) && mySurface->IsUPeriodic()) { d1(t, U, V, D, myCurve, mySurface); @@ -831,14 +832,14 @@ void ProjLib_CompProjectedCurve::Init() U = aLowBorder.X(); } - if ((Abs(V - aLowBorder.Y()) < mySurface->VResolution(Precision::PConfusion())) + if ((std::abs(V - aLowBorder.Y()) < mySurface->VResolution(Precision::PConfusion())) && mySurface->IsVPeriodic()) { d1(t, U, V, D, myCurve, mySurface); if (D.Y() < 0) V = aUppBorder.Y(); } - else if ((Abs(V - aUppBorder.Y()) <= mySurface->VResolution(Precision::PConfusion())) + else if ((std::abs(V - aUppBorder.Y()) <= mySurface->VResolution(Precision::PConfusion())) && mySurface->IsVPeriodic()) { d1(t, U, V, D, myCurve, mySurface); @@ -866,10 +867,10 @@ void ProjLib_CompProjectedCurve::Init() if (t != FirstU) { // Search for exact boundary point - Tol = Min(myTolU, myTolV); + Tol = std::min(myTolU, myTolV); gp_Vec2d aD; d1(Triple.X(), Triple.Y(), Triple.Z(), aD, myCurve, mySurface); - Tol /= Max(Abs(aD.X()), Abs(aD.Y())); + Tol /= std::max(std::abs(aD.X()), std::abs(aD.Y())); if (!ExactBound(Triple, t - Step, Tol, myTolU, myTolV, myCurve, mySurface)) { @@ -915,7 +916,7 @@ void ProjLib_CompProjectedCurve::Init() if (MagnD2 < Precision::Confusion()) WalkStep = MaxStep; else - WalkStep = Min(MaxStep, Max(MinStep, 0.1 * MagnD1 / MagnD2)); + WalkStep = std::min(MaxStep, std::max(MinStep, 0.1 * MagnD1 / MagnD2)); Step = WalkStep; @@ -932,9 +933,9 @@ void ProjLib_CompProjectedCurve::Init() U0 = Triple.Y() + (Step / prevStep) * (Triple.Y() - prevTriple.Y()); V0 = Triple.Z() + (Step / prevStep) * (Triple.Z() - prevTriple.Z()); // adjust U0 to be in [mySurface->FirstUParameter(),mySurface->LastUParameter()] - U0 = Min(Max(U0, aLowBorder.X()), aUppBorder.X()); + U0 = std::min(std::max(U0, aLowBorder.X()), aUppBorder.X()); // adjust V0 to be in [mySurface->FirstVParameter(),mySurface->LastVParameter()] - V0 = Min(Max(V0, aLowBorder.Y()), aUppBorder.Y()); + V0 = std::min(std::max(V0, aLowBorder.Y()), aUppBorder.Y()); aPrjPS.Perform(t, U0, V0, aTol, aLowBorder, aUppBorder, FuncTol, Standard_True); if (!aPrjPS.IsDone()) @@ -942,10 +943,10 @@ void ProjLib_CompProjectedCurve::Init() if (Step <= GlobalMinStep) { // Search for exact boundary point - Tol = Min(myTolU, myTolV); + Tol = std::min(myTolU, myTolV); gp_Vec2d D; d1(Triple.X(), Triple.Y(), Triple.Z(), D, myCurve, mySurface); - Tol /= Max(Abs(D.X()), Abs(D.Y())); + Tol /= std::max(std::abs(D.X()), std::abs(D.Y())); if (!ExactBound(Triple, t, Tol, myTolU, myTolV, myCurve, mySurface)) { @@ -983,7 +984,7 @@ void ProjLib_CompProjectedCurve::Init() if (t > (LastU - MinStep / 4)) { Step = Step + LastU - t; - if (Abs(Step - SaveStep) <= Precision::PConfusion()) + if (std::abs(Step - SaveStep) <= Precision::PConfusion()) Step = GlobalMinStep; // to avoid looping t = LastU; } @@ -1004,16 +1005,16 @@ void ProjLib_CompProjectedCurve::Init() { Standard_Boolean isUPossible = Standard_False; if (mySurface->IsUPeriodic() - && (Abs(Triple.Y() - mySurface->FirstUParameter()) > Precision::PConfusion() - && Abs(Triple.Y() - mySurface->LastUParameter()) > Precision::PConfusion())) + && (std::abs(Triple.Y() - mySurface->FirstUParameter()) > Precision::PConfusion() + && std::abs(Triple.Y() - mySurface->LastUParameter()) > Precision::PConfusion())) { isUPossible = Standard_True; } Standard_Boolean isVPossible = Standard_False; if (mySurface->IsVPeriodic() - && (Abs(Triple.Z() - mySurface->FirstVParameter()) > Precision::PConfusion() - && Abs(Triple.Z() - mySurface->LastVParameter()) > Precision::PConfusion())) + && (std::abs(Triple.Z() - mySurface->FirstVParameter()) > Precision::PConfusion() + && std::abs(Triple.Z() - mySurface->LastVParameter()) > Precision::PConfusion())) { isVPossible = Standard_True; } @@ -1042,7 +1043,7 @@ void ProjLib_CompProjectedCurve::Init() if (MagnD2 < Precision::Confusion()) WalkStep = MaxStep; else - WalkStep = Min(MaxStep, Max(MinStep, 0.1 * MagnD1 / MagnD2)); + WalkStep = std::min(MaxStep, std::max(MinStep, 0.1 * MagnD1 / MagnD2)); Step = WalkStep; t += Step; @@ -1057,7 +1058,7 @@ void ProjLib_CompProjectedCurve::Init() for (Standard_Integer anIdx = aSplitIdx; anIdx < aSize; ++anIdx) { const Standard_Real aParam = aSplits(anIdx); - if (Abs(aParam - Triple.X()) < Precision::PConfusion()) + if (std::abs(aParam - Triple.X()) < Precision::PConfusion()) { // The current point is equal to a split point. new_part = Standard_False; @@ -1195,7 +1196,7 @@ void ProjLib_CompProjectedCurve::Init() // is i-part U-isoparametric ? for (j = 1; j <= mySequence->Value(i)->Length(); j++) { - if (Abs(mySequence->Value(i)->Value(j).Y() - AveU) > myTolU) + if (std::abs(mySequence->Value(i)->Value(j).Y() - AveU) > myTolU) { myUIso->SetValue(i, Standard_False); break; @@ -1205,7 +1206,7 @@ void ProjLib_CompProjectedCurve::Init() // is i-part V-isoparametric ? for (j = 1; j <= mySequence->Value(i)->Length(); j++) { - if (Abs(mySequence->Value(i)->Value(j).Z() - AveV) > myTolV) + if (std::abs(mySequence->Value(i)->Value(j).Z() - AveV) > myTolV) { myVIso->SetValue(i, Standard_False); break; @@ -1570,12 +1571,12 @@ void ProjLib_CompProjectedCurve::D0(const Standard_Real U, gp_Pnt2d& P) const // Cubic Interpolation if (mySequence->Value(i)->Length() < 4 - || (Abs(U - mySequence->Value(i)->Value(j).X()) <= Precision::PConfusion())) + || (std::abs(U - mySequence->Value(i)->Value(j).X()) <= Precision::PConfusion())) { U0 = mySequence->Value(i)->Value(j).Y(); V0 = mySequence->Value(i)->Value(j).Z(); } - else if (Abs(U - mySequence->Value(i)->Value(j + 1).X()) <= Precision::PConfusion()) + else if (std::abs(U - mySequence->Value(i)->Value(j + 1).X()) <= Precision::PConfusion()) { U0 = mySequence->Value(i)->Value(j + 1).Y(); V0 = mySequence->Value(i)->Value(j + 1).Z(); @@ -1843,9 +1844,9 @@ void ProjLib_CompProjectedCurve::BuildIntervals(const GeomAbs_Shape S) const Ul = mySequence->Value(i)->Value(j).Y(); Ur = mySequence->Value(i)->Value(j + 1).Y(); - if (Abs(Ul - CutPntsU(k)) <= myTolU) + if (std::abs(Ul - CutPntsU(k)) <= myTolU) TUdisc.Append(mySequence->Value(i)->Value(j).X()); - else if (Abs(Ur - CutPntsU(k)) <= myTolU) + else if (std::abs(Ur - CutPntsU(k)) <= myTolU) TUdisc.Append(mySequence->Value(i)->Value(j + 1).X()); else if ((Ul < CutPntsU(k) && CutPntsU(k) < Ur) || (Ur < CutPntsU(k) && CutPntsU(k) < Ul)) { @@ -1857,10 +1858,10 @@ void ProjLib_CompProjectedCurve::BuildIntervals(const GeomAbs_Shape S) const gp_Pnt Triple; Triple = mySequence->Value(i)->Value(j); d1(Triple.X(), Triple.Y(), Triple.Z(), D, myCurve, mySurface); - if (Abs(D.X()) < Precision::Confusion()) + if (std::abs(D.X()) < Precision::Confusion()) Tol = myTolU; else - Tol = Min(myTolU, myTolU / Abs(D.X())); + Tol = std::min(myTolU, myTolU / std::abs(D.X())); Tl = mySequence->Value(i)->Value(j).X(); Tr = mySequence->Value(i)->Value(j + 1).X(); @@ -1911,9 +1912,9 @@ void ProjLib_CompProjectedCurve::BuildIntervals(const GeomAbs_Shape S) const Vl = mySequence->Value(i)->Value(j).Z(); Vr = mySequence->Value(i)->Value(j + 1).Z(); - if (Abs(Vl - CutPntsV(k)) <= myTolV) + if (std::abs(Vl - CutPntsV(k)) <= myTolV) TVdisc.Append(mySequence->Value(i)->Value(j).X()); - else if (Abs(Vr - CutPntsV(k)) <= myTolV) + else if (std::abs(Vr - CutPntsV(k)) <= myTolV) TVdisc.Append(mySequence->Value(i)->Value(j + 1).X()); else if ((Vl < CutPntsV(k) && CutPntsV(k) < Vr) || (Vr < CutPntsV(k) && CutPntsV(k) < Vl)) { @@ -1925,10 +1926,10 @@ void ProjLib_CompProjectedCurve::BuildIntervals(const GeomAbs_Shape S) const gp_Pnt Triple; Triple = mySequence->Value(i)->Value(j); d1(Triple.X(), Triple.Y(), Triple.Z(), D, myCurve, mySurface); - if (Abs(D.Y()) < Precision::Confusion()) + if (std::abs(D.Y()) < Precision::Confusion()) Tol = myTolV; else - Tol = Min(myTolV, myTolV / Abs(D.Y())); + Tol = std::min(myTolV, myTolV / std::abs(D.Y())); Tl = mySequence->Value(i)->Value(j).X(); Tr = mySequence->Value(i)->Value(j + 1).X(); @@ -2112,10 +2113,10 @@ void ProjLib_CompProjectedCurve::UpdateTripleByTrapCriteria(gp_Pnt& thePoint) co { // Compute maximal deviation from 3D and choose the biggest one. Standard_Real aVRes = mySurface->VResolution(Precision::Confusion()); - Standard_Real aMaxTol = Max(Precision::PConfusion(), aVRes); + Standard_Real aMaxTol = std::max(Precision::PConfusion(), aVRes); - if (Abs(thePoint.Z() - mySurface->FirstVParameter()) < aMaxTol - || Abs(thePoint.Z() - mySurface->LastVParameter()) < aMaxTol) + if (std::abs(thePoint.Z() - mySurface->FirstVParameter()) < aMaxTol + || std::abs(thePoint.Z() - mySurface->LastVParameter()) < aMaxTol) { isProblemsPossible = Standard_True; } @@ -2123,10 +2124,10 @@ void ProjLib_CompProjectedCurve::UpdateTripleByTrapCriteria(gp_Pnt& thePoint) co // 27135 bug. Trap on degenerated edge. if (mySurface->GetType() == GeomAbs_Sphere - && (Abs(thePoint.Z() - mySurface->FirstVParameter()) < Precision::PConfusion() - || Abs(thePoint.Z() - mySurface->LastVParameter()) < Precision::PConfusion() - || Abs(thePoint.Y() - mySurface->FirstUParameter()) < Precision::PConfusion() - || Abs(thePoint.Y() - mySurface->LastUParameter()) < Precision::PConfusion())) + && (std::abs(thePoint.Z() - mySurface->FirstVParameter()) < Precision::PConfusion() + || std::abs(thePoint.Z() - mySurface->LastVParameter()) < Precision::PConfusion() + || std::abs(thePoint.Y() - mySurface->FirstUParameter()) < Precision::PConfusion() + || std::abs(thePoint.Y() - mySurface->LastUParameter()) < Precision::PConfusion())) { isProblemsPossible = Standard_True; } @@ -2150,12 +2151,12 @@ void ProjLib_CompProjectedCurve::UpdateTripleByTrapCriteria(gp_Pnt& thePoint) co // Restore original position in case of period jump. if (mySurface->IsUPeriodic() - && Abs(Abs(U - thePoint.Y()) - mySurface->UPeriod()) < Precision::PConfusion()) + && std::abs(std::abs(U - thePoint.Y()) - mySurface->UPeriod()) < Precision::PConfusion()) { U = thePoint.Y(); } if (mySurface->IsVPeriodic() - && Abs(Abs(V - thePoint.Z()) - mySurface->VPeriod()) < Precision::PConfusion()) + && std::abs(std::abs(V - thePoint.Z()) - mySurface->VPeriod()) < Precision::PConfusion()) { V = thePoint.Z(); } @@ -2287,8 +2288,8 @@ void FindSplitPoint(SplitDS& theSplitDS, aPOnS.Parameter(U, V); aProjParam = theSplitDS.myPeriodicDir ? V : U; - if (Abs(aProjParam - theSplitDS.myPerMinParam) < Precision::PConfusion() - || Abs(aProjParam - theSplitDS.myPerMaxParam) < Precision::PConfusion()) + if (std::abs(aProjParam - theSplitDS.myPerMinParam) < Precision::PConfusion() + || std::abs(aProjParam - theSplitDS.myPerMaxParam) < Precision::PConfusion()) { const Standard_Real aParam = aPOnC2.Parameter(); const Standard_Real aCFParam = theSplitDS.myCurve->FirstParameter(); diff --git a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ComputeApprox.cxx b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ComputeApprox.cxx index 0035112e5a..0faca37469 100644 --- a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ComputeApprox.cxx +++ b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ComputeApprox.cxx @@ -56,7 +56,7 @@ // OFV: static inline Standard_Boolean IsEqual(Standard_Real Check, Standard_Real With, Standard_Real Toler) { - return ((Abs(Check - With) < Toler) ? Standard_True : Standard_False); + return ((std::abs(Check - With) < Toler) ? Standard_True : Standard_False); } //================================================================================================= @@ -120,7 +120,7 @@ static gp_Pnt2d Function_Value(const Standard_Real U, { if (SType == GeomAbs_Sphere) { - if (Abs(S - U1) > M_PI) + if (std::abs(S - U1) > M_PI) { T = M_PI - T; S = M_PI + S; @@ -200,13 +200,13 @@ static Standard_Real Function_ComputeStep(const Handle(Adaptor3d_Curve)& myCurve W2 = myCurve->LastParameter(); Standard_Real L = GCPnts_AbscissaPoint::Length(*myCurve); Standard_Integer nbp = RealToInt(L / (R * M_PI_4)) + 1; - nbp = Max(nbp, 3); + nbp = std::max(nbp, 3); Standard_Real Step = (W2 - W1) / (nbp - 1); if (Step > Step0) { Step = Step0; nbp = RealToInt((W2 - W1) / Step) + 1; - nbp = Max(nbp, 3); + nbp = std::max(nbp, 3); Step = (W2 - W1) / (nbp - 1); } @@ -273,8 +273,8 @@ static void Function_SetUVBounds(Standard_Real& myU1, ElSLib::Parameters(Cone, P1, U1, V1); ElSLib::Parameters(Cone, P2, U2, V2); ElSLib::Parameters(Cone, P, U, V); - myU1 = Min(U1, U2); - myU2 = Max(U1, U2); + myU1 = std::min(U1, U2); + myU2 = std::max(U1, U2); if ((U1 < U && U < U2) && !myCurve->IsClosed()) { UCouture = Standard_False; @@ -355,7 +355,7 @@ static void Function_SetUVBounds(Standard_Real& myU1, U += Delta; d = U - U1; } - dmax = Max(dmax, Abs(d)); + dmax = std::max(dmax, std::abs(d)); if (U < myU1) { myU1 = U; @@ -370,11 +370,11 @@ static void Function_SetUVBounds(Standard_Real& myU1, isFirst = Standard_False; } // for(Standard_Real par = W1 + Step; par <= W2; par += Step) - if (!(Abs(pmin - W1) <= Precision::PConfusion() - || Abs(pmin - W2) <= Precision::PConfusion())) + if (!(std::abs(pmin - W1) <= Precision::PConfusion() + || std::abs(pmin - W2) <= Precision::PConfusion())) myU1 -= dmax * .5; - if (!(Abs(pmax - W1) <= Precision::PConfusion() - || Abs(pmax - W2) <= Precision::PConfusion())) + if (!(std::abs(pmax - W1) <= Precision::PConfusion() + || std::abs(pmax - W2) <= Precision::PConfusion())) myU2 += dmax * .5; if ((myU1 >= 0. && myU1 <= 2 * M_PI) && (myU2 >= 0. && myU2 <= 2 * M_PI)) @@ -403,8 +403,8 @@ static void Function_SetUVBounds(Standard_Real& myU1, ElSLib::Parameters(Cylinder, P1, U1, V1); ElSLib::Parameters(Cylinder, P2, U2, V2); ElSLib::Parameters(Cylinder, P, U, V); - myU1 = Min(U1, U2); - myU2 = Max(U1, U2); + myU1 = std::min(U1, U2); + myU2 = std::max(U1, U2); if (!myCurve->IsClosed()) { @@ -482,7 +482,7 @@ static void Function_SetUVBounds(Standard_Real& myU1, U += Delta; d = U - U1; } - dmax = Max(dmax, Abs(d)); + dmax = std::max(dmax, std::abs(d)); if (U < myU1) { myU1 = U; @@ -496,11 +496,11 @@ static void Function_SetUVBounds(Standard_Real& myU1, U1 = U; } - if (!(Abs(pmin - W1) <= Precision::PConfusion() - || Abs(pmin - W2) <= Precision::PConfusion())) + if (!(std::abs(pmin - W1) <= Precision::PConfusion() + || std::abs(pmin - W2) <= Precision::PConfusion())) myU1 -= dmax * .5; - if (!(Abs(pmax - W1) <= Precision::PConfusion() - || Abs(pmax - W2) <= Precision::PConfusion())) + if (!(std::abs(pmax - W1) <= Precision::PConfusion() + || std::abs(pmax - W2) <= Precision::PConfusion())) myU2 += dmax * .5; if ((myU1 >= 0. && myU1 <= 2 * M_PI) && (myU2 >= 0. && myU2 <= 2 * M_PI)) @@ -552,15 +552,15 @@ static void Function_SetUVBounds(Standard_Real& myU1, gp_Pln Plane(gp_Ax3(Circle.Position())); Plane.Coefficients(A, B, C, D); // - if (Abs(C) < Tol) + if (std::abs(C) < Tol) { - if (Abs(A) > Tol) + if (std::abs(A) > Tol) { if ((D / A) < 0.) { - if ((R - Abs(D / A)) > Tol) + if ((R - std::abs(D / A)) > Tol) NbSolutions = 2; - else if (Abs(R - Abs(D / A)) < Tol) + else if (std::abs(R - std::abs(D / A)) < Tol) NbSolutions = 1; else NbSolutions = 0; @@ -571,7 +571,7 @@ static void Function_SetUVBounds(Standard_Real& myU1, { Standard_Real delta = R * R * (A * A + C * C) - D * D; delta *= C * C; - if (Abs(delta) < Tol * Tol) + if (std::abs(delta) < Tol * Tol) { if (A * D > 0.) NbSolutions = 1; @@ -579,7 +579,7 @@ static void Function_SetUVBounds(Standard_Real& myU1, else if (delta > 0) { Standard_Real xx; - delta = Sqrt(delta); + delta = std::sqrt(delta); xx = -A * D + delta; // if (xx > Tol) @@ -596,67 +596,61 @@ static void Function_SetUVBounds(Standard_Real& myU1, Standard_Real UU = 0.; ElSLib::Parameters(SP, P1, U1, V1); Standard_Real eps = 10. * Epsilon(1.); - Standard_Real dt = Max(Precision::PConfusion(), 0.01 * (W2 - W1)); - if (Abs(U1) < eps) + Standard_Real dt = std::max(Precision::PConfusion(), 0.01 * (W2 - W1)); + if (std::abs(U1) < eps) { // May be U1 must be equal 2*PI? gp_Pnt Pd = myCurve->Value(W1 + dt); Standard_Real ud, vd; ElSLib::Parameters(SP, Pd, ud, vd); - if (Abs(U1 - ud) > M_PI) + if (std::abs(U1 - ud) > M_PI) { U1 = 2. * M_PI; } } - else if (Abs(2. * M_PI - U1) < eps) + else if (std::abs(2. * M_PI - U1) < eps) { // maybe U1 = 0.? gp_Pnt Pd = myCurve->Value(W1 + dt); Standard_Real ud, vd; ElSLib::Parameters(SP, Pd, ud, vd); - if (Abs(U1 - ud) > M_PI) + if (std::abs(U1 - ud) > M_PI) { U1 = 0.; } } // ElSLib::Parameters(SP, P2, U2, V1); - if (Abs(U2) < eps) + if (std::abs(U2) < eps) { // May be U2 must be equal 2*PI? gp_Pnt Pd = myCurve->Value(W2 - dt); Standard_Real ud, vd; ElSLib::Parameters(SP, Pd, ud, vd); - if (Abs(U2 - ud) > M_PI) + if (std::abs(U2 - ud) > M_PI) { U2 = 2. * M_PI; } } - else if (Abs(2. * M_PI - U2) < eps) + else if (std::abs(2. * M_PI - U2) < eps) { // maybe U2 = 0.? gp_Pnt Pd = myCurve->Value(W2 - dt); Standard_Real ud, vd; ElSLib::Parameters(SP, Pd, ud, vd); - if (Abs(U2 - ud) > M_PI) + if (std::abs(U2 - ud) > M_PI) { U2 = 0.; } } // ElSLib::Parameters(SP, P, UU, V1); - //+This fragment was the reason of bug # 26008. - //+It has been deleted on April, 03 2015. - // Standard_Real UUmi = Min(Min(U1,UU),Min(UU,U2)); - // Standard_Real UUma = Max(Max(U1,UU),Max(UU,U2)); - // Standard_Boolean reCalc = ((UUmi >= 0. && UUmi <= M_PI) && (UUma >= 0. && UUma <= M_PI)); - // box+sphere << P2 = myCurve->Value(W1 + M_PI / 8); ElSLib::Parameters(SP, P2, U2, V2); // if (NbSolutions == 1) { - if (Abs(U1 - U2) > M_PI) + if (std::abs(U1 - U2) > M_PI) { // on traverse la couture if (U1 > M_PI) { @@ -693,7 +687,7 @@ static void Function_SetUVBounds(Standard_Real& myU1, } // // eval the VCouture. - if ((C == 0) || Abs(Abs(D / C) - R) > 1.e-10) + if ((C == 0) || std::abs(std::abs(D / C) - R) > 1.e-10) { VCouture = Standard_False; } @@ -716,7 +710,7 @@ static void Function_SetUVBounds(Standard_Real& myU1, // si P1.Z() vaut +/- R on est sur le sommet : pas significatif. gp_Pnt pp = P1.Transformed(Trsf); - if (Abs(pp.X() * pp.X() + pp.Y() * pp.Y() + pp.Z() * pp.Z() - R * R) < Tol) + if (std::abs(pp.X() * pp.X() + pp.Y() * pp.Y() + pp.Z() * pp.Z() - R * R) < Tol) { gp_Pnt Center = Circle.Location(); Standard_Real U, V; @@ -730,18 +724,6 @@ static void Function_SetUVBounds(Standard_Real& myU1, // box+sphere >> myV1 = -1.e+100; myV2 = 1.e+100; - - //+This fragment was the reason of bug # 26008. - //+It has been deleted on April, 03 2015. - // Standard_Real UU1 = myU1, UU2 = myU2; - // if((Abs(UU1) <= (2.*M_PI) && Abs(UU2) <= (2.*M_PI)) && NbSolutions == 1 && reCalc) { - // gp_Pnt Center = Circle.Location(); - // Standard_Real U,V; - // ElSLib::SphereParameters(gp_Ax3(gp::XOY()),1,Center, U, V); - // myU1 = U-M_PI; - // myU1 = Min(UU1,myU1); - // myU2 = myU1 + 2.*M_PI; - //} // box+sphere << } // if ( myCurve->GetType() == GeomAbs_Circle) @@ -777,7 +759,7 @@ static void Function_SetUVBounds(Standard_Real& myU1, U += Delta; d = U - U1; } - dmax = Max(dmax, Abs(d)); + dmax = std::max(dmax, std::abs(d)); if (U < myU1) { myU1 = U; @@ -791,11 +773,11 @@ static void Function_SetUVBounds(Standard_Real& myU1, U1 = U; } - if (!(Abs(pmin - W1) <= Precision::PConfusion() - || Abs(pmin - W2) <= Precision::PConfusion())) + if (!(std::abs(pmin - W1) <= Precision::PConfusion() + || std::abs(pmin - W2) <= Precision::PConfusion())) myU1 -= dmax * .5; - if (!(Abs(pmax - W1) <= Precision::PConfusion() - || Abs(pmax - W2) <= Precision::PConfusion())) + if (!(std::abs(pmax - W1) <= Precision::PConfusion() + || std::abs(pmax - W2) <= Precision::PConfusion())) myU2 += dmax * .5; if ((myU1 >= 0. && myU1 <= 2 * M_PI) && (myU2 >= 0. && myU2 <= 2 * M_PI)) @@ -866,8 +848,8 @@ static void Function_SetUVBounds(Standard_Real& myU1, V += DeltaV; dV = V - V1; } - dmaxU = Max(dmaxU, Abs(dU)); - dmaxV = Max(dmaxV, Abs(dV)); + dmaxU = std::max(dmaxU, std::abs(dU)); + dmaxV = std::max(dmaxV, std::abs(dV)); if (U < myU1) { myU1 = U; @@ -892,17 +874,17 @@ static void Function_SetUVBounds(Standard_Real& myU1, V1 = V; } - if (!(Abs(pminU - W1) <= Precision::PConfusion() - || Abs(pminU - W2) <= Precision::PConfusion())) + if (!(std::abs(pminU - W1) <= Precision::PConfusion() + || std::abs(pminU - W2) <= Precision::PConfusion())) myU1 -= dmaxU * .5; - if (!(Abs(pmaxU - W1) <= Precision::PConfusion() - || Abs(pmaxU - W2) <= Precision::PConfusion())) + if (!(std::abs(pmaxU - W1) <= Precision::PConfusion() + || std::abs(pmaxU - W2) <= Precision::PConfusion())) myU2 += dmaxU * .5; - if (!(Abs(pminV - W1) <= Precision::PConfusion() - || Abs(pminV - W2) <= Precision::PConfusion())) + if (!(std::abs(pminV - W1) <= Precision::PConfusion() + || std::abs(pminV - W2) <= Precision::PConfusion())) myV1 -= dmaxV * .5; - if (!(Abs(pmaxV - W1) <= Precision::PConfusion() - || Abs(pmaxV - W2) <= Precision::PConfusion())) + if (!(std::abs(pmaxV - W1) <= Precision::PConfusion() + || std::abs(pmaxV - W2) <= Precision::PConfusion())) myV2 += dmaxV * .5; if ((myU1 >= 0. && myU1 <= 2 * M_PI) && (myU2 >= 0. && myU2 <= 2 * M_PI)) @@ -1039,7 +1021,7 @@ static Standard_Real ComputeTolU(const Handle(Adaptor3d_Surface)& theSurf, Standard_Real aTolU = theSurf->UResolution(theTolerance); if (theSurf->IsUPeriodic()) { - aTolU = Min(aTolU, 0.01 * theSurf->UPeriod()); + aTolU = std::min(aTolU, 0.01 * theSurf->UPeriod()); } return aTolU; @@ -1053,7 +1035,7 @@ static Standard_Real ComputeTolV(const Handle(Adaptor3d_Surface)& theSurf, Standard_Real aTolV = theSurf->VResolution(theTolerance); if (theSurf->IsVPeriodic()) { - aTolV = Min(aTolV, 0.01 * theSurf->VPeriod()); + aTolV = std::min(aTolV, 0.01 * theSurf->VPeriod()); } return aTolV; @@ -1075,7 +1057,7 @@ ProjLib_ComputeApprox::ProjLib_ComputeApprox() ProjLib_ComputeApprox::ProjLib_ComputeApprox(const Handle(Adaptor3d_Curve)& C, const Handle(Adaptor3d_Surface)& S, const Standard_Real Tol) - : myTolerance(Max(Tol, Precision::PApproximation())), + : myTolerance(std::max(Tol, Precision::PApproximation())), myDegMin(-1), myDegMax(-1), myMaxSegments(-1), @@ -1245,9 +1227,10 @@ void ProjLib_ComputeApprox::Perform(const Handle(Adaptor3d_Curve)& C, } //------------- - const Standard_Real aTolU = ComputeTolU(S, myTolerance); - const Standard_Real aTolV = ComputeTolV(S, myTolerance); - const Standard_Real aTol2d = Max(Sqrt(aTolU * aTolU + aTolV * aTolV), Precision::PConfusion()); + const Standard_Real aTolU = ComputeTolU(S, myTolerance); + const Standard_Real aTolV = ComputeTolV(S, myTolerance); + const Standard_Real aTol2d = + std::max(std::sqrt(aTolU * aTolU + aTolV * aTolV), Precision::PConfusion()); Approx_FitAndDivide2d Fit(Deg1, Deg2, myTolerance, aTol2d, Standard_True, aFistC, aLastC); Fit.SetMaxSegments(aMaxSegments); @@ -1270,7 +1253,7 @@ void ProjLib_ComputeApprox::Perform(const Handle(Adaptor3d_Curve)& C, for (i = 1; i <= NbCurves; i++) { Fit.Error(i, Tol3d, Tol2d); - aNewTol2d = Max(aNewTol2d, Tol2d); + aNewTol2d = std::max(aNewTol2d, Tol2d); AppParCurves_MultiCurve MC = Fit.Value(i); // Charge la Ieme Curve TColgp_Array1OfPnt2d Poles2d(1, MC.Degree() + 1); // Recupere les poles MC.Curve(1, Poles2d); @@ -1312,7 +1295,7 @@ void ProjLib_ComputeApprox::Perform(const Handle(Adaptor3d_Curve)& C, // try to smoother the Curve GeomAbs_C1. Standard_Integer aDeg = myBSpline->Degree(); Standard_Boolean OK = Standard_True; - Standard_Real aSmoothTol = Max(Precision::Confusion(), aNewTol2d); + Standard_Real aSmoothTol = std::max(Precision::Confusion(), aNewTol2d); for (Standard_Integer ij = 2; ij < NbKnots; ij++) { OK = OK && myBSpline->RemoveKnot(ij, aDeg - 1, aSmoothTol); @@ -1380,14 +1363,14 @@ void ProjLib_ComputeApprox::Perform(const Handle(Adaptor3d_Curve)& C, Standard_Integer number; if (F.VCouture) { - if (SType == GeomAbs_Sphere && Abs(u - F.myU1) > M_PI) + if (SType == GeomAbs_Sphere && std::abs(u - F.myU1) > M_PI) { ToMirror = Standard_True; dv = -M_PI; v = M_PI - v; } Standard_Real newV = ElCLib::InPeriod(v, F.myV1, F.myV2); - number = (Standard_Integer)(Floor((newV - v) / (F.myV2 - F.myV1))); + number = (Standard_Integer)(std::floor((newV - v) / (F.myV2 - F.myV1))); dv -= number * (F.myV2 - F.myV1); } if (F.UCouture || (F.VCouture && SType == GeomAbs_Sphere)) diff --git a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx index 92a8ab2f0c..68a562b3c0 100644 --- a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx +++ b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx @@ -119,7 +119,7 @@ static void computePeriodicity(const Handle(Adaptor3d_Surface)& theSurf, aTrimF = theSurf->FirstUParameter(); // Trimmed first aTrimL = theSurf->LastUParameter(); // Trimmed last aS->Bounds(aBaseF, aBaseL, aDummyF, aDummyL); // Non-trimmed values. - if (Abs(aBaseF - aTrimF) + Abs(aBaseL - aTrimL) > Precision::PConfusion()) + if (std::abs(aBaseF - aTrimF) + std::abs(aBaseL - aTrimL) > Precision::PConfusion()) { // Param space reduced. theUPeriod = 0.0; @@ -140,7 +140,7 @@ static void computePeriodicity(const Handle(Adaptor3d_Surface)& theSurf, aTrimF = theSurf->FirstVParameter(); // Trimmed first aTrimL = theSurf->LastVParameter(); // Trimmed last aS->Bounds(aDummyF, aDummyL, aBaseF, aBaseL); // Non-trimmed values. - if (Abs(aBaseF - aTrimF) + Abs(aBaseL - aTrimL) > Precision::PConfusion()) + if (std::abs(aBaseF - aTrimF) + std::abs(aBaseL - aTrimL) > Precision::PConfusion()) { // Param space reduced. theVPeriod = 0.0; @@ -197,8 +197,8 @@ static gp_Pnt2d Function_Value(const Standard_Real theU, const aFuncStruct& theD Vsup = theData.mySurf->LastVParameter(); // Check case when curve is close to co-parametrized isoline on surf. - if (Abs(p2d.X() - Uinf) < Precision::PConfusion() - || Abs(p2d.X() - Usup) < Precision::PConfusion()) + if (std::abs(p2d.X() - Uinf) < Precision::PConfusion() + || std::abs(p2d.X() - Usup) < Precision::PConfusion()) { // V isoline. gp_Pnt aPnt; @@ -207,8 +207,8 @@ static gp_Pnt2d Function_Value(const Standard_Real theU, const aFuncStruct& theD p2d.SetY(theU); } - if (Abs(p2d.Y() - Vinf) < Precision::PConfusion() - || Abs(p2d.Y() - Vsup) < Precision::PConfusion()) + if (std::abs(p2d.Y() - Vinf) < Precision::PConfusion() + || std::abs(p2d.Y() - Vsup) < Precision::PConfusion()) { // U isoline. gp_Pnt aPnt; @@ -261,7 +261,7 @@ static gp_Pnt2d Function_Value(const Standard_Real theU, const aFuncStruct& theD if (V0 > (Vsup + (Vsup - Vinf))) decalV = int((V0 - Vsup + (Vsup - Vinf)) / (2 * M_PI)) + 1; T += decalV * 2 * M_PI; - if (0.4 * M_PI < Abs(U0 - S) && Abs(U0 - S) < 1.6 * M_PI) + if (0.4 * M_PI < std::abs(U0 - S) && std::abs(U0 - S) < 1.6 * M_PI) { T = M_PI - T; if (U0 < S) @@ -731,9 +731,8 @@ Handle(Geom2d_BSplineCurve) ProjLib_ComputeApproxOnPolarSurface::Perform( InitialCurve2d->Intervals(Inter2d, GeomAbs_C1); j = 1; for (i = 1, j = 1; i <= nbInter; i++) - if (Abs(Inter.Value(i) - Inter2d.Value(j)) < ParamTol) - { // OCC217 - // if(Abs(Inter.Value(i) - Inter2d.Value(j)) < myTolerance) { + if (std::abs(Inter.Value(i) - Inter2d.Value(j)) < ParamTol) + { if (j > nbInter2d) break; j++; @@ -872,7 +871,7 @@ Handle(Geom2d_BSplineCurve) ProjLib_ComputeApproxOnPolarSurface::Perform( (void)nbK2d; // unused but set for debug nbK2d += BSC2d->NbKnots() - 1; - deg = Max(deg, BSC2d->Degree()); + deg = std::max(deg, BSC2d->Degree()); } else { @@ -896,13 +895,13 @@ Handle(Geom2d_BSplineCurve) ProjLib_ComputeApproxOnPolarSurface::Perform( gp_Pnt2d aC2Beg = BS->Pole(1); // Beginning of C2. Standard_Real anUJump = 0.0, anVJump = 0.0; - if (anUPeriod > 0.0 && Abs(aC1End.X() - aC2Beg.X()) > (anUPeriod) / 2.01) + if (anUPeriod > 0.0 && std::abs(aC1End.X() - aC2Beg.X()) > (anUPeriod) / 2.01) { Standard_Real aMultCoeff = aC2Beg.X() < aC1End.X() ? 1.0 : -1.0; anUJump = (anUPeriod)*aMultCoeff; } - if (anVPeriod && Abs(aC1End.Y() - aC2Beg.Y()) > (anVPeriod) / 2.01) + if (anVPeriod && std::abs(aC1End.Y() - aC2Beg.Y()) > (anVPeriod) / 2.01) { Standard_Real aMultCoeff = aC2Beg.Y() < aC1End.Y() ? 1.0 : -1.0; anVJump = (anVPeriod)*aMultCoeff; @@ -1002,7 +1001,7 @@ Handle(Adaptor2d_Curve2d) ProjLib_ComputeApproxOnPolarSurface::BuildInitialCurve { Sloc = S; ElSLib::Parameters(Cylinder, Pts(i), S, T); - if (Abs(Sloc - S) > M_PI) + if (std::abs(Sloc - S) > M_PI) { if (Sloc > S) usens++; @@ -1025,7 +1024,7 @@ Handle(Adaptor2d_Curve2d) ProjLib_ComputeApproxOnPolarSurface::BuildInitialCurve { Sloc = S; ElSLib::Parameters(Cone, Pts(i), S, T); - if (Abs(Sloc - S) > M_PI) + if (std::abs(Sloc - S) > M_PI) { if (Sloc > S) usens++; @@ -1049,21 +1048,21 @@ Handle(Adaptor2d_Curve2d) ProjLib_ComputeApproxOnPolarSurface::BuildInitialCurve Sloc = S; Tloc = T; ElSLib::Parameters(Sphere, Pts(i), S, T); - if (1.6 * M_PI < Abs(Sloc - S)) + if (1.6 * M_PI < std::abs(Sloc - S)) { if (Sloc > S) usens += 2; else usens -= 2; } - if (1.6 * M_PI > Abs(Sloc - S) && Abs(Sloc - S) > 0.4 * M_PI) + if (1.6 * M_PI > std::abs(Sloc - S) && std::abs(Sloc - S) > 0.4 * M_PI) { vparit = !vparit; if (Sloc > S) usens++; else usens--; - if (Abs(Tloc - Vsup) < (Vsup - Vinf) / 5) + if (std::abs(Tloc - Vsup) < (Vsup - Vinf) / 5) vsens++; else vsens--; @@ -1091,14 +1090,14 @@ Handle(Adaptor2d_Curve2d) ProjLib_ComputeApproxOnPolarSurface::BuildInitialCurve Sloc = S; Tloc = T; ElSLib::Parameters(Torus, Pts(i), S, T); - if (Abs(Sloc - S) > M_PI) + if (std::abs(Sloc - S) > M_PI) { if (Sloc > S) usens++; else usens--; } - if (Abs(Tloc - T) > M_PI) + if (std::abs(Tloc - T) > M_PI) { if (Tloc > T) vsens++; @@ -1138,8 +1137,8 @@ Handle(Adaptor2d_Curve2d) ProjLib_ComputeApproxOnPolarSurface::BuildInitialCurve } if (aMinSqDist > DistTol3d2) // try to project with less tolerance { - TolU = Min(TolU, Precision::PConfusion()); - TolV = Min(TolV, Precision::PConfusion()); + TolU = std::min(TolU, Precision::PConfusion()); + TolV = std::min(TolV, Precision::PConfusion()); aExtPS.Initialize(*Surf, Surf->FirstUParameter(), Surf->LastUParameter(), @@ -1209,7 +1208,7 @@ Handle(Adaptor2d_Curve2d) ProjLib_ComputeApproxOnPolarSurface::BuildInitialCurve Dist2Max = aDist2; } } - Standard_Real aMaxT2 = Max(TolU, TolV); + Standard_Real aMaxT2 = std::max(TolU, TolV); aMaxT2 *= aMaxT2; if (Dist2Max > aMaxT2) { @@ -1381,14 +1380,14 @@ Handle(Adaptor2d_Curve2d) ProjLib_ComputeApproxOnPolarSurface::BuildInitialCurve } Standard_Real LocalU, LocalV; aGlobalExtr.Point(imin).Parameter(LocalU, LocalV); - if (uperiod > 0. && Abs(U0 - LocalU) >= uperiod / 2.) + if (uperiod > 0. && std::abs(U0 - LocalU) >= uperiod / 2.) { if (LocalU > U0) usens = -1; else usens = 1; } - if (vperiod > 0. && Abs(V0 - LocalV) >= vperiod / 2.) + if (vperiod > 0. && std::abs(V0 - LocalV) >= vperiod / 2.) { if (LocalV > V0) vsens = -1; @@ -1632,7 +1631,7 @@ Handle(Adaptor2d_Curve2d) ProjLib_ComputeApproxOnPolarSurface::BuildInitialCurve TestV += sense * vperiod; } gp_Vec2d Offset(TestU - MidPoint.X(), TestV - MidPoint.Y()); - if (Abs(Offset.X()) > gp::Resolution() || Abs(Offset.Y()) > gp::Resolution()) + if (std::abs(Offset.X()) > gp::Resolution() || std::abs(Offset.Y()) > gp::Resolution()) myBSpline->Translate(Offset); ////////////////////////////////////////// Geom2dAdaptor_Curve GAC(myBSpline); @@ -1673,7 +1672,7 @@ Handle(Geom2d_BSplineCurve) ProjLib_ComputeApproxOnPolarSurface::ProjectUsingIni } Standard_Real DistTol3d2 = DistTol3d * DistTol3d; Standard_Real TolU = Surf->UResolution(Tol3d), TolV = Surf->VResolution(Tol3d); - Standard_Real Tol2d = Max(Sqrt(TolU * TolU + TolV * TolV), Precision::PConfusion()); + Standard_Real Tol2d = std::max(std::sqrt(TolU * TolU + TolV * TolV), Precision::PConfusion()); Standard_Integer i; GeomAbs_SurfaceType TheTypeS = Surf->GetType(); @@ -2069,12 +2068,12 @@ Handle(Geom2d_BSplineCurve) ProjLib_ComputeApproxOnPolarSurface::ProjectUsingIni for (j = 1; j <= NbCurves; j++) { Standard_Integer Deg = Fit.Value(j).Degree(); - MaxDeg = Max(MaxDeg, Deg); + MaxDeg = std::max(MaxDeg, Deg); Fit.Error(j, Tol3d, Tol2d); - aNewTol2d = Max(aNewTol2d, Tol2d); + aNewTol2d = std::max(aNewTol2d, Tol2d); } // - myTolReached = Max(myTolReached, myTolerance * (aNewTol2d / anOldTol2d)); + myTolReached = std::max(myTolReached, myTolerance * (aNewTol2d / anOldTol2d)); // NbPoles = MaxDeg * NbCurves + 1; // Tops on the BSpline TColgp_Array1OfPnt2d Poles(1, NbPoles); @@ -2134,7 +2133,7 @@ Handle(Geom2d_BSplineCurve) ProjLib_ComputeApproxOnPolarSurface::ProjectUsingIni // try to smoother the Curve GeomAbs_C1. Standard_Boolean OK = Standard_True; - Standard_Real aSmoothTol = Max(Precision::Confusion(), aNewTol2d); + Standard_Real aSmoothTol = std::max(Precision::Confusion(), aNewTol2d); if (myBndPnt == AppParCurves_PassPoint) { aSmoothTol *= 10.; diff --git a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Cone.cxx b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Cone.cxx index 6296a7c653..16742ec492 100644 --- a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Cone.cxx +++ b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Cone.cxx @@ -91,7 +91,7 @@ void ProjLib_Cone::Project(const gp_Lin& L) // L is parallel to U-isoline of the cone. myType = GeomAbs_Line; - const Standard_Real aSign = Sign(1.0, L.Direction().Dot(Dv)); + const Standard_Real aSign = std::copysign(1.0, L.Direction().Dot(Dv)); gp_Pnt2d P2d(U, V - aDeltaV * aSign); gp_Dir2d D2d(0., aSign); @@ -130,18 +130,18 @@ void ProjLib_Cone::Project(const gp_Circ& C) { U = 0.; } - else if (-myCone.RefRadius() > z * Tan(myCone.SemiAngle())) + else if (-myCone.RefRadius() > z * std::tan(myCone.SemiAngle())) { - U = ATan2(-y, -x); + U = std::atan2(-y, -x); } else { - U = ATan2(y, x); + U = std::atan2(y, x); } if (U < 0.) U += 2 * M_PI; - V = z / Cos(myCone.SemiAngle()); + V = z / std::cos(myCone.SemiAngle()); gp_Pnt2d P2d1(U, V); gp_Dir2d D2d; diff --git a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Cylinder.cxx b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Cylinder.cxx index 16cadc31f8..f28ef24733 100644 --- a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Cylinder.cxx +++ b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Cylinder.cxx @@ -83,9 +83,9 @@ static gp_Pnt2d EvalPnt2d(const gp_Pnt& P, const gp_Cylinder& Cy) Standard_Real Z = OP.Dot(gp_Vec(Cy.Position().Direction())); Standard_Real U; - if (Abs(X) > Precision::PConfusion() || Abs(Y) > Precision::PConfusion()) + if (std::abs(X) > Precision::PConfusion() || std::abs(Y) > Precision::PConfusion()) { - U = ATan2(Y, X); + U = std::atan2(Y, X); } else { diff --git a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_PrjFunc.cxx b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_PrjFunc.cxx index c102fc985a..8bce13c9b1 100644 --- a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_PrjFunc.cxx +++ b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_PrjFunc.cxx @@ -33,7 +33,7 @@ ProjLib_PrjFunc::ProjLib_PrjFunc(const Adaptor3d_Curve* C, myV(0), myFix(Fix) { - myNorm = Min(1., Min(mySurface->UResolution(1.), mySurface->VResolution(1.))); + myNorm = std::min(1., std::min(mySurface->UResolution(1.), mySurface->VResolution(1.))); // myNorm=1.; switch (myFix) { diff --git a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ProjectOnPlane.cxx b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ProjectOnPlane.cxx index 6c23a68979..7ec3c3fe69 100644 --- a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ProjectOnPlane.cxx +++ b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ProjectOnPlane.cxx @@ -350,7 +350,7 @@ static void PerformApprox(const Handle(Adaptor3d_Curve)& C, for (i = 1; i <= NbCurves; i++) { Standard_Integer Deg = Fit.Value(i).Degree(); - MaxDeg = Max(MaxDeg, Deg); + MaxDeg = std::max(MaxDeg, Deg); } NbPoles = MaxDeg * NbCurves + 1; // Poles sur la BSpline @@ -366,7 +366,7 @@ static void PerformApprox(const Handle(Adaptor3d_Curve)& C, { Fit.Parameters(i, Knots(i), Knots(i + 1)); Fit.Error(i, anErr3d, anErr2d); - anErrMax = Max(anErrMax, anErr3d); + anErrMax = std::max(anErrMax, anErr3d); AppParCurves_MultiCurve MC = Fit.Value(i); // Charge la Ieme Curve TColgp_Array1OfPnt LocalPoles(1, MC.Degree() + 1); // Recupere les poles MC.Curve(1, LocalPoles); @@ -461,7 +461,7 @@ ProjLib_ProjectOnPlane::ProjLib_ProjectOnPlane(const gp_Ax3& Pl, const gp_Dir& D myType(GeomAbs_OtherCurve), myIsApprox(Standard_False) { - // if ( Abs(D * Pl.Direction()) < Precision::Confusion()) { + // if ( std::abs(D * Pl.Direction()) < Precision::Confusion()) { // throw Standard_ConstructionError // ("ProjLib_ProjectOnPlane: The Direction and the Plane are parallel"); // } @@ -589,7 +589,7 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_Curve)& C, myResult = new GeomAdaptor_Curve(aGACurve); // Modified by Sergey KHROMOV - Tue Jan 29 16:57:30 2002 End } - else if (Abs(Xc.Magnitude() - 1.) < Precision::Confusion()) + else if (std::abs(Xc.Magnitude() - 1.) < Precision::Confusion()) { myType = GeomAbs_Line; gp_Pnt P = ProjectPnt(myPlane, myDirection, L.Location()); @@ -658,9 +658,9 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_Curve)& C, case GeomAbs_Circle: { // Pour le cercle et l ellipse on a les relations suivantes: // ( Rem : pour le cercle R1 = R2 = R) - // P(u) = O + R1 * Cos(u) * Xc + R2 * Sin(u) * Yc + // P(u) = O + R1 * std::cos(u) * Xc + R2 * std::sin(u) * Yc // ==> Q(u) = f(P(u)) - // = f(O) + R1 * Cos(u) * f(Xc) + R2 * Sin(u) * f(Yc) + // = f(O) + R1 * std::cos(u) * f(Xc) + R2 * std::sin(u) * f(Yc) gp_Circ Circ = myCurve->Circle(); Axis = Circ.Position(); @@ -735,8 +735,8 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_Curve)& C, if (anEigenCalc.IsDone()) { // radii of the projected ellipse - Minor = 1.0 / Sqrt(anEigenCalc.Value(1)); - Major = 1.0 / Sqrt(anEigenCalc.Value(2)); + Minor = 1.0 / std::sqrt(anEigenCalc.Value(1)); + Major = 1.0 / std::sqrt(anEigenCalc.Value(2)); // calculate the rotation angle for the plane axes to meet the correct axes of the // projected ellipse (swap eigenvectors in respect to major and minor axes) @@ -764,7 +764,7 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_Curve)& C, { gp_Ax2 Axe(P, Dx ^ Dy, Dx); - if (Abs(Major - Minor) < Precision::Confusion()) + if (std::abs(Major - Minor) < Precision::Confusion()) { myType = GeomAbs_Circle; gp_Circ Circ(Axe, Major); @@ -832,7 +832,7 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_Curve)& C, myIsApprox = Standard_False; - if ((Abs(Yc.Magnitude() - 1.) < Precision::Confusion()) + if ((std::abs(Yc.Magnitude() - 1.) < Precision::Confusion()) && (Xc.Magnitude() < Precision::Confusion())) { myType = GeomAbs_Line; @@ -871,9 +871,9 @@ void ProjLib_ProjectOnPlane::Load(const Handle(Adaptor3d_Curve)& C, } break; case GeomAbs_Hyperbola: { - // P(u) = O + R1 * Cosh(u) * Xc + R2 * Sinh(u) * Yc + // P(u) = O + R1 * std::cosh(u) * Xc + R2 * std::sinh(u) * Yc // ==> Q(u) = f(P(u)) - // = f(O) + R1 * Cosh(u) * f(Xc) + R2 * Sinh(u) * f(Yc) + // = f(O) + R1 * std::cosh(u) * f(Xc) + R2 * std::sinh(u) * f(Yc) gp_Hypr Hypr = myCurve->Hyperbola(); gp_Ax2 AxeRef = Hypr.Position(); @@ -1501,7 +1501,7 @@ Standard_Boolean ProjLib_ProjectOnPlane::BuildHyperbolaByApex( gp_Vec aV(P, aP1); Standard_Real anX = aV * anXDir; Standard_Real anY = aV * anYDir; - Standard_Real aMinRad = anY / Sqrt(anX * anX / aMajRad / aMajRad - 1.); + Standard_Real aMinRad = anY / std::sqrt(anX * anX / aMajRad / aMajRad - 1.); gp_Ax2 anA2(P, Z, anXDir); gp_Hypr anHypr(anA2, aMajRad, aMinRad); theGeomHyperbolaPtr = new Geom_Hyperbola(anHypr); @@ -1525,8 +1525,8 @@ void ProjLib_ProjectOnPlane::BuildByApprox(const Standard_Real theLimitParameter || Precision::IsInfinite(myCurve->LastParameter())) { // To avoid exception in approximation - Standard_Real f = Max(-theLimitParameter, myCurve->FirstParameter()); - Standard_Real l = Min(theLimitParameter, myCurve->LastParameter()); + Standard_Real f = std::max(-theLimitParameter, myCurve->FirstParameter()); + Standard_Real l = std::min(theLimitParameter, myCurve->LastParameter()); Handle(Adaptor3d_Curve) aTrimCurve = myCurve->Trim(f, l, Precision::Confusion()); PerformApprox(aTrimCurve, myPlane, myDirection, anApproxCurve); } diff --git a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ProjectOnSurface.cxx b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ProjectOnSurface.cxx index 32de5fe4fd..6fd00abf3e 100644 --- a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ProjectOnSurface.cxx +++ b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ProjectOnSurface.cxx @@ -189,7 +189,7 @@ void ProjLib_ProjectOnSurface::Load(const Handle(Adaptor3d_Curve)& C, const Stan for (i = 1; i <= NbCurves; i++) { Standard_Integer Deg = Fit.Value(i).Degree(); - MaxDeg = Max(MaxDeg, Deg); + MaxDeg = std::max(MaxDeg, Deg); } NbPoles = MaxDeg * NbCurves + 1; // Poles sur la BSpline TColgp_Array1OfPnt Poles(1, NbPoles); diff --git a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ProjectedCurve.cxx b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ProjectedCurve.cxx index ed8add984f..3dbb949039 100644 --- a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ProjectedCurve.cxx +++ b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_ProjectedCurve.cxx @@ -57,7 +57,7 @@ static Standard_Real ComputeTolU(const Handle(Adaptor3d_Surface)& theSurf, Standard_Real aTolU = theSurf->UResolution(theTolerance); if (theSurf->IsUPeriodic()) { - aTolU = Min(aTolU, 0.01 * theSurf->UPeriod()); + aTolU = std::min(aTolU, 0.01 * theSurf->UPeriod()); } return aTolU; @@ -71,7 +71,7 @@ static Standard_Real ComputeTolV(const Handle(Adaptor3d_Surface)& theSurf, Standard_Real aTolV = theSurf->VResolution(theTolerance); if (theSurf->IsVPeriodic()) { - aTolV = Min(aTolV, 0.01 * theSurf->VPeriod()); + aTolV = std::min(aTolV, 0.01 * theSurf->VPeriod()); } return aTolV; @@ -101,7 +101,7 @@ static Standard_Boolean IsoIsDeg(const Adaptor3d_Surface& S, for (T = U1; T <= U2; T = T + Step) { S.D1(T, Param, P, D1U, D1V); - D1NormMax = Max(D1NormMax, D1U.Magnitude()); + D1NormMax = std::max(D1NormMax, D1U.Magnitude()); } if (D1NormMax > TolMax || D1NormMax < TolMin) @@ -114,7 +114,7 @@ static Standard_Boolean IsoIsDeg(const Adaptor3d_Surface& S, for (T = V1; T <= V2; T = T + Step) { S.D1(Param, T, P, D1U, D1V); - D1NormMax = Max(D1NormMax, D1V.Magnitude()); + D1NormMax = std::max(D1NormMax, D1V.Magnitude()); } if (D1NormMax > TolMax || D1NormMax < TolMin) @@ -312,7 +312,7 @@ ProjLib_ProjectedCurve::ProjLib_ProjectedCurve(const Handle(Adaptor3d_Surface)& ProjLib_ProjectedCurve::ProjLib_ProjectedCurve(const Handle(Adaptor3d_Surface)& S, const Handle(Adaptor3d_Curve)& C, const Standard_Real Tol) - : myTolerance(Max(Tol, Precision::Confusion())), + : myTolerance(std::max(Tol, Precision::Confusion())), myDegMin(-1), myDegMax(-1), myMaxSegments(-1), @@ -366,7 +366,7 @@ void ProjLib_ProjectedCurve::Load(const Standard_Real theTol) void ProjLib_ProjectedCurve::Perform(const Handle(Adaptor3d_Curve)& C) { - myTolerance = Max(myTolerance, Precision::Confusion()); + myTolerance = std::max(myTolerance, Precision::Confusion()); myCurve = C; Standard_Real FirstPar = C->FirstParameter(); Standard_Real LastPar = C->LastParameter(); @@ -429,8 +429,8 @@ void ProjLib_ProjectedCurve::Perform(const Handle(Adaptor3d_Curve)& C) gp_Pnt Pf = myCurve->Value(f); gp_Pnt Pl = myCurve->Value(l); gp_Pnt aLoc = aSph.Position().Location(); - Standard_Real maxdist = Max(Pf.Distance(aLoc), Pl.Distance(aLoc)); - TolConf = Max(anR * minang, Abs(anR - maxdist)); + Standard_Real maxdist = std::max(Pf.Distance(aLoc), Pl.Distance(aLoc)); + TolConf = std::max(anR * minang, std::abs(anR - maxdist)); // Surface has pole at V = Vmin and Vmax gp_Pnt Pole = mySurface->Value(U1, Vmin); @@ -605,9 +605,9 @@ void ProjLib_ProjectedCurve::Perform(const Handle(Adaptor3d_Curve)& C) } } - Standard_Real aTolU = Max(ComputeTolU(mySurface, myTolerance), Precision::Confusion()); - Standard_Real aTolV = Max(ComputeTolV(mySurface, myTolerance), Precision::Confusion()); - Standard_Real aTol2d = Sqrt(aTolU * aTolU + aTolV * aTolV); + Standard_Real aTolU = std::max(ComputeTolU(mySurface, myTolerance), Precision::Confusion()); + Standard_Real aTolV = std::max(ComputeTolV(mySurface, myTolerance), Precision::Confusion()); + Standard_Real aTol2d = std::sqrt(aTolU * aTolU + aTolV * aTolV); Standard_Real aMaxDist = 100. * myTolerance; if (myMaxDist > 0.) @@ -658,7 +658,7 @@ void ProjLib_ProjectedCurve::Perform(const Handle(Adaptor3d_Curve)& C) { aTolU = appr.MaxError2dU(); aTolV = appr.MaxError2dV(); - Standard_Real aNewTol2d = Sqrt(aTolU * aTolU + aTolV * aTolV); + Standard_Real aNewTol2d = std::sqrt(aTolU * aTolU + aTolV * aTolV); myTolerance *= (aNewTol2d / aTol2d); if (IsTrimmed[0] || IsTrimmed[1]) { @@ -693,7 +693,7 @@ void ProjLib_ProjectedCurve::Perform(const Handle(Adaptor3d_Curve)& C) // try to smoother the Curve GeomAbs_C1. Standard_Integer aDeg = aRes->Degree(); Standard_Boolean OK = Standard_True; - Standard_Real aSmoothTol = Max(Precision::Confusion(), aNewTol2d); + Standard_Real aSmoothTol = std::max(Precision::Confusion(), aNewTol2d); for (Standard_Integer ij = 2; ij < aRes->NbKnots(); ij++) { OK = OK && aRes->RemoveKnot(ij, aDeg - 1, aSmoothTol); diff --git a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Projector.cxx b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Projector.cxx index 8fbd4cf11f..2608da24c7 100644 --- a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Projector.cxx +++ b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Projector.cxx @@ -181,7 +181,7 @@ void ProjLib_Projector::UFrame(const Standard_Real CFirst, gp_Pnt2d PFirst; PFirst = ElCLib::Value(CFirst, myLin); // PLast = ElCLib::Value(CLast ,myLin); - // Standard_Real U = Min( PFirst.X(), PLast.X()); + // Standard_Real U = std::min( PFirst.X(), PLast.X()); Standard_Real U = PFirst.X(); Standard_Real NewU = ElCLib::InPeriod(U, UFirst, UFirst + Period); myLin.Translate(gp_Vec2d(NewU - U, 0.)); @@ -205,7 +205,7 @@ void ProjLib_Projector::VFrame(const Standard_Real CFirst, gp_Pnt2d PFirst; PFirst = ElCLib::Value(CFirst, myLin); // PLast = ElCLib::Value(CLast ,myLin); - // Standard_Real V = Min( PFirst.Y(), PLast.Y()); + // Standard_Real V = std::min( PFirst.Y(), PLast.Y()); Standard_Real V = PFirst.Y(); Standard_Real NewV = ElCLib::InPeriod(V, VFirst, VFirst + Period); myLin.Translate(gp_Vec2d(0., NewV - V)); diff --git a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Sphere.cxx b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Sphere.cxx index 45631e8749..b91cdfb070 100644 --- a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Sphere.cxx +++ b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Sphere.cxx @@ -69,7 +69,7 @@ void ProjLib_Sphere::Init(const gp_Sphere& Sp) // by Radius) // / X = cosV cosU U = Atan(Y/X) // P = | Y = cosV sinU ==> -// \ Z = sinV V = ASin( Z) +// \ Z = sinV V = std::asin( Z) //======================================================================= static gp_Pnt2d EvalPnt2d(const gp_Vec& P, const gp_Sphere& Sp) @@ -79,9 +79,9 @@ static gp_Pnt2d EvalPnt2d(const gp_Vec& P, const gp_Sphere& Sp) Standard_Real Z = P.Dot(gp_Vec(Sp.Position().Direction())); Standard_Real U, V; - if (Abs(X) > Precision::PConfusion() || Abs(Y) > Precision::PConfusion()) + if (std::abs(X) > Precision::PConfusion() || std::abs(Y) > Precision::PConfusion()) { - Standard_Real UU = ATan2(Y, X); + Standard_Real UU = std::atan2(Y, X); U = ElCLib::InPeriod(UU, 0., 2 * M_PI); } else @@ -93,7 +93,7 @@ static gp_Pnt2d EvalPnt2d(const gp_Vec& P, const gp_Sphere& Sp) Z = 1.; else if (Z < -1.) Z = -1.; - V = ASin(Z); + V = std::asin(Z); return gp_Pnt2d(U, V); } @@ -135,14 +135,14 @@ void ProjLib_Sphere::Project(const gp_Circ& C) P2d2 = EvalPnt2d(gp_Vec(Yc), mySphere); if (isIsoU - && (Abs(P2d1.Y() - M_PI / 2.) < Precision::PConfusion() - || Abs(P2d1.Y() + M_PI / 2.) < Precision::PConfusion())) + && (std::abs(P2d1.Y() - M_PI / 2.) < Precision::PConfusion() + || std::abs(P2d1.Y() + M_PI / 2.) < Precision::PConfusion())) { // then P1 is on the apex of the sphere and U is undefined // The value of U is given by P2d2.Y() . P2d1.SetX(P2d2.X()); } - else if (Abs(Abs(P2d1.X() - P2d2.X()) - M_PI) < Precision::PConfusion()) + else if (std::abs(std::abs(P2d1.X() - P2d2.X()) - M_PI) < Precision::PConfusion()) { // then we have U2 = U1 + PI; V2; // we have to assume that U1 = U2 @@ -170,7 +170,7 @@ void ProjLib_Sphere::Project(const gp_Circ& C) if (U < 0) U += 2 * M_PI; Standard_Real Z = gp_Vec(O, C.Location()).Dot(Zs); - Standard_Real V = ASin(Z / mySphere.Radius()); + Standard_Real V = std::asin(Z / mySphere.Radius()); P2d1 = gp_Pnt2d(U, V); D2d = gp_Dir2d((Xc ^ Yc).Dot(Xs ^ Ys), 0.); isDone = Standard_True; @@ -219,7 +219,7 @@ void ProjLib_Sphere::SetInBounds(const Standard_Real U) // if ((P.Y() > M_PI/2) || if ((P.Y() - M_PI / 2 > Tol) || // Modified by skv - Tue Aug 1 16:29:59 2006 OCC13116 End - (Abs(P.Y() - M_PI / 2) < Tol && D2d.IsEqual(gp::DY2d(), Tol))) + (std::abs(P.Y() - M_PI / 2) < Tol && D2d.IsEqual(gp::DY2d(), Tol))) { Axis = gp_Ax2d(gp_Pnt2d(0., M_PI / 2.), gp::DX2d()); } @@ -227,7 +227,7 @@ void ProjLib_Sphere::SetInBounds(const Standard_Real U) // else if ((P.Y() < -M_PI/2) || else if ((P.Y() + M_PI / 2 < -Tol) || // Modified by skv - Tue Aug 1 16:29:59 2006 OCC13116 End - (Abs(P.Y() + M_PI / 2) < Tol && D2d.IsOpposite(gp::DY2d(), Tol))) + (std::abs(P.Y() + M_PI / 2) < Tol && D2d.IsOpposite(gp::DY2d(), Tol))) { Axis = gp_Ax2d(gp_Pnt2d(0., -M_PI / 2.), gp::DX2d()); } diff --git a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Torus.cxx b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Torus.cxx index c578f84446..534eefce83 100644 --- a/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Torus.cxx +++ b/src/ModelingData/TKGeomBase/ProjLib/ProjLib_Torus.cxx @@ -63,7 +63,7 @@ void ProjLib_Torus::Init(const gp_Torus& To) // ( in order to avoid to divide by Radius) // / X = (1+cosV)*cosU U = Atan(Y/X) // P = | Y = (1+cosV)*sinU ==> -// \ Z = sinV V = ASin( Z) +// \ Z = sinV V = std::asin( Z) //======================================================================= static gp_Pnt2d EvalPnt2d(const gp_Vec& Ve, const gp_Torus& To) @@ -72,9 +72,9 @@ static gp_Pnt2d EvalPnt2d(const gp_Vec& Ve, const gp_Torus& To) Standard_Real Y = Ve.Dot(gp_Vec(To.Position().YDirection())); Standard_Real U, V; - if (Abs(X) > Precision::PConfusion() || Abs(Y) > Precision::PConfusion()) + if (std::abs(X) > Precision::PConfusion() || std::abs(Y) > Precision::PConfusion()) { - U = ATan2(Y, X); + U = std::atan2(Y, X); } else { @@ -124,7 +124,7 @@ void ProjLib_Torus::Project(const gp_Circ& C) } else { - V = ASin(Z); + V = std::asin(Z); } if (C.Radius() < myTorus.MajorRadius()) @@ -138,9 +138,9 @@ void ProjLib_Torus::Project(const gp_Circ& C) P1.SetY(V); P2.SetY(V); gp_Vec2d V2d(P1, P2); - // Normalement Abs( P1.X() - P2.X()) = PI/2 + // Normalement std::abs( P1.X() - P2.X()) = PI/2 // Si != PI/2, on a traverse la periode => On reverse la Direction - if (Abs(P1.X() - P2.X()) > M_PI) + if (std::abs(P1.X() - P2.X()) > M_PI) V2d.Reverse(); gp_Dir2d D2(V2d); diff --git a/src/ModelingData/TKGeomBase/gce/gce_MakeCirc.cxx b/src/ModelingData/TKGeomBase/gce/gce_MakeCirc.cxx index d7706a7419..ee8555c61f 100644 --- a/src/ModelingData/TKGeomBase/gce/gce_MakeCirc.cxx +++ b/src/ModelingData/TKGeomBase/gce/gce_MakeCirc.cxx @@ -209,9 +209,9 @@ gce_MakeCirc::gce_MakeCirc(const gp_Pnt& Center, const gp_Dir& Norm, const Stand Standard_Real A = Norm.X(); Standard_Real B = Norm.Y(); Standard_Real C = Norm.Z(); - Standard_Real Aabs = Abs(A); - Standard_Real Babs = Abs(B); - Standard_Real Cabs = Abs(C); + Standard_Real Aabs = std::abs(A); + Standard_Real Babs = std::abs(B); + Standard_Real Cabs = std::abs(C); gp_Ax2 Pos; //========================================================================= @@ -281,9 +281,9 @@ gce_MakeCirc::gce_MakeCirc(const gp_Pnt& Center, const gp_Pnt& Ptaxis, const Sta Standard_Real A = Ptaxis.X() - Center.X(); Standard_Real B = Ptaxis.Y() - Center.Y(); Standard_Real C = Ptaxis.Z() - Center.Z(); - Standard_Real Aabs = Abs(A); - Standard_Real Babs = Abs(B); - Standard_Real Cabs = Abs(C); + Standard_Real Aabs = std::abs(A); + Standard_Real Babs = std::abs(B); + Standard_Real Cabs = std::abs(C); gp_Ax2 Pos; //========================================================================= @@ -350,9 +350,9 @@ gce_MakeCirc::gce_MakeCirc(const gp_Ax1& Axis, const Standard_Real Radius) Standard_Real A = Norm.X(); Standard_Real B = Norm.Y(); Standard_Real C = Norm.Z(); - Standard_Real Aabs = Abs(A); - Standard_Real Babs = Abs(B); - Standard_Real Cabs = Abs(C); + Standard_Real Aabs = std::abs(A); + Standard_Real Babs = std::abs(B); + Standard_Real Cabs = std::abs(C); gp_Ax2 Pos; //========================================================================= diff --git a/src/ModelingData/TKGeomBase/gce/gce_MakeCirc2d.cxx b/src/ModelingData/TKGeomBase/gce/gce_MakeCirc2d.cxx index fa4bf9d835..68b4cfee28 100644 --- a/src/ModelingData/TKGeomBase/gce/gce_MakeCirc2d.cxx +++ b/src/ModelingData/TKGeomBase/gce/gce_MakeCirc2d.cxx @@ -209,7 +209,7 @@ gce_MakeCirc2d::gce_MakeCirc2d(const gp_Circ2d& Circ, const gp_Pnt2d& Point) gce_MakeCirc2d::gce_MakeCirc2d(const gp_Circ2d& Circ, const Standard_Real Dist1) { - TheCirc2d = gp_Circ2d(Circ.Axis(), Abs(Circ.Radius() + Dist1)); + TheCirc2d = gp_Circ2d(Circ.Axis(), std::abs(Circ.Radius() + Dist1)); TheError = gce_Done; } diff --git a/src/ModelingData/TKGeomBase/gce/gce_MakeCone.cxx b/src/ModelingData/TKGeomBase/gce/gce_MakeCone.cxx index 43807a5e4f..15eb4bf3ae 100644 --- a/src/ModelingData/TKGeomBase/gce/gce_MakeCone.cxx +++ b/src/ModelingData/TKGeomBase/gce/gce_MakeCone.cxx @@ -72,7 +72,7 @@ gce_MakeCone::gce_MakeCone(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3, Standard_Real Dist13 = PP3.Distance(P1); Standard_Real Dist14 = PP4.Distance(P1); - if (Abs(Dist13 - Dist14) < RealEpsilon()) + if (std::abs(Dist13 - Dist14) < RealEpsilon()) { TheError = gce_NullAngle; return; @@ -81,8 +81,8 @@ gce_MakeCone::gce_MakeCone(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3, Standard_Real Dist3 = L1.Distance(P3); Standard_Real Dist4 = L1.Distance(P4); Standard_Real DifRad = Dist3 - Dist4; - Standard_Real angle = Abs(ATan(DifRad / (Dist13 - Dist14))); - if (Abs(M_PI / 2. - angle) < RealEpsilon() || Abs(angle) < RealEpsilon()) + Standard_Real angle = std::abs(std::atan(DifRad / (Dist13 - Dist14))); + if (std::abs(M_PI / 2. - angle) < RealEpsilon() || std::abs(angle) < RealEpsilon()) { TheError = gce_NullRadius; return; @@ -99,15 +99,15 @@ gce_MakeCone::gce_MakeCone(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3, Standard_Real x = DD1.X(); Standard_Real y = DD1.Y(); Standard_Real z = DD1.Z(); - if (Abs(x) > gp::Resolution()) + if (std::abs(x) > gp::Resolution()) { D2 = gp_Dir(-y, x, 0.0); } - else if (Abs(y) > gp::Resolution()) + else if (std::abs(y) > gp::Resolution()) { D2 = gp_Dir(-y, x, 0.0); } - else if (Abs(z) > gp::Resolution()) + else if (std::abs(z) > gp::Resolution()) { D2 = gp_Dir(0.0, -z, y); } @@ -212,8 +212,8 @@ gce_MakeCone::gce_MakeCone(const gp_Pnt& P1, } else { - Standard_Real Angle = Abs(atan((R1 - R2) / dist)); - if (Abs(M_PI / 2. - Angle) < RealEpsilon() || Abs(Angle) < RealEpsilon()) + Standard_Real Angle = std::abs(atan((R1 - R2) / dist)); + if (std::abs(M_PI / 2. - Angle) < RealEpsilon() || std::abs(Angle) < RealEpsilon()) { TheError = gce_NullAngle; } @@ -224,15 +224,15 @@ gce_MakeCone::gce_MakeCone(const gp_Pnt& P1, Standard_Real x = D1.X(); Standard_Real y = D1.Y(); Standard_Real z = D1.Z(); - if (Abs(x) > gp::Resolution()) + if (std::abs(x) > gp::Resolution()) { D2 = gp_Dir(-y, x, 0.0); } - else if (Abs(y) > gp::Resolution()) + else if (std::abs(y) > gp::Resolution()) { D2 = gp_Dir(-y, x, 0.0); } - else if (Abs(z) > gp::Resolution()) + else if (std::abs(z) > gp::Resolution()) { D2 = gp_Dir(0.0, -z, y); } diff --git a/src/ModelingData/TKGeomBase/gce/gce_MakeCylinder.cxx b/src/ModelingData/TKGeomBase/gce/gce_MakeCylinder.cxx index 7f446c2b35..cc20e89de4 100644 --- a/src/ModelingData/TKGeomBase/gce/gce_MakeCylinder.cxx +++ b/src/ModelingData/TKGeomBase/gce/gce_MakeCylinder.cxx @@ -59,15 +59,15 @@ gce_MakeCylinder::gce_MakeCylinder(const gp_Ax1& Axis, const Standard_Real Radiu Standard_Real x = D.X(); Standard_Real y = D.Y(); Standard_Real z = D.Z(); - if (Abs(x) > gp::Resolution()) + if (std::abs(x) > gp::Resolution()) { Direc = gp_Dir(-y, x, 0.0); } - else if (Abs(y) > gp::Resolution()) + else if (std::abs(y) > gp::Resolution()) { Direc = gp_Dir(-y, x, 0.0); } - else if (Abs(z) > gp::Resolution()) + else if (std::abs(z) > gp::Resolution()) { Direc = gp_Dir(0.0, -z, y); } @@ -105,15 +105,15 @@ gce_MakeCylinder::gce_MakeCylinder(const gp_Pnt& P1, const gp_Pnt& P2, const gp_ Standard_Real x = D1.X(); Standard_Real y = D1.Y(); Standard_Real z = D1.Z(); - if (Abs(x) > gp::Resolution()) + if (std::abs(x) > gp::Resolution()) { D2 = gp_Dir(-y, x, 0.0); } - else if (Abs(y) > gp::Resolution()) + else if (std::abs(y) > gp::Resolution()) { D2 = gp_Dir(-y, x, 0.0); } - else if (Abs(z) > gp::Resolution()) + else if (std::abs(z) > gp::Resolution()) { D2 = gp_Dir(0.0, -z, y); } diff --git a/src/ModelingData/TKGeomBase/gce/gce_MakeDir.hxx b/src/ModelingData/TKGeomBase/gce/gce_MakeDir.hxx index c974d31eb7..09323ed1d7 100644 --- a/src/ModelingData/TKGeomBase/gce/gce_MakeDir.hxx +++ b/src/ModelingData/TKGeomBase/gce/gce_MakeDir.hxx @@ -49,7 +49,7 @@ public: Standard_EXPORT gce_MakeDir(const gp_XYZ& Coord); //! Creates a direction with its 3 cartesian coordinates. - //! Status is "NullVector" if Sqrt(Xv*Xv + Yv*Yv + Zv*Zv) + //! Status is "NullVector" if std::sqrt(Xv*Xv + Yv*Yv + Zv*Zv) //! <= Resolution Standard_EXPORT gce_MakeDir(const Standard_Real Xv, const Standard_Real Yv, @@ -66,7 +66,7 @@ public: //! than or equal to gp::Resolution(): //! - the magnitude of vector V, //! - the modulus of Coord, - //! - Sqrt(Xv*Xv + Yv*Yv + Zv*Zv). + //! - std::sqrt(Xv*Xv + Yv*Yv + Zv*Zv). Standard_EXPORT gce_MakeDir(const gp_Pnt& P1, const gp_Pnt& P2); //! Returns the constructed unit vector. diff --git a/src/ModelingData/TKGeomBase/gce/gce_MakeDir2d.hxx b/src/ModelingData/TKGeomBase/gce/gce_MakeDir2d.hxx index 256186a8cf..f45532781d 100644 --- a/src/ModelingData/TKGeomBase/gce/gce_MakeDir2d.hxx +++ b/src/ModelingData/TKGeomBase/gce/gce_MakeDir2d.hxx @@ -48,7 +48,7 @@ public: Standard_EXPORT gce_MakeDir2d(const gp_XY& Coord); //! Creates a direction with its 3 cartesian coordinates. - //! Status is "NullVector" if Sqrt(Xv*Xv + Yv*Yv ) + //! Status is "NullVector" if std::sqrt(Xv*Xv + Yv*Yv ) //! <= Resolution Standard_EXPORT gce_MakeDir2d(const Standard_Real Xv, const Standard_Real Yv); @@ -63,7 +63,7 @@ public: //! than or equal to gp::Resolution(): //! - the magnitude of vector V, //! - the modulus of Coord, - //! - Sqrt(Xv*Xv + Yv*Yv). + //! - std::sqrt(Xv*Xv + Yv*Yv). Standard_EXPORT gce_MakeDir2d(const gp_Pnt2d& P1, const gp_Pnt2d& P2); //! Returns the constructed unit vector. diff --git a/src/ModelingData/TKGeomBase/gce/gce_MakeLin2d.hxx b/src/ModelingData/TKGeomBase/gce/gce_MakeLin2d.hxx index 19ed706b70..0fa3e99d48 100644 --- a/src/ModelingData/TKGeomBase/gce/gce_MakeLin2d.hxx +++ b/src/ModelingData/TKGeomBase/gce/gce_MakeLin2d.hxx @@ -51,7 +51,7 @@ public: Standard_EXPORT gce_MakeLin2d(const gp_Pnt2d& P, const gp_Dir2d& V); //! Creates the line from the equation A*X + B*Y + C = 0.0 - //! the status is "NullAxis"if Sqrt(A*A + B*B) <= Resolution from gp. + //! the status is "NullAxis"if std::sqrt(A*A + B*B) <= Resolution from gp. Standard_EXPORT gce_MakeLin2d(const Standard_Real A, const Standard_Real B, const Standard_Real C); @@ -73,7 +73,7 @@ public: //! Warning //! If an error occurs (that is, when IsDone returns //! false), the Status function returns: - //! - gce_NullAxis if Sqrt(A*A + B*B) is less + //! - gce_NullAxis if std::sqrt(A*A + B*B) is less //! than or equal to gp::Resolution(), or //! - gce_ConfusedPoints if points P1 and P2 are coincident. Standard_EXPORT gce_MakeLin2d(const gp_Pnt2d& P1, const gp_Pnt2d& P2); diff --git a/src/ModelingData/TKGeomBase/gce/gce_MakePln.hxx b/src/ModelingData/TKGeomBase/gce/gce_MakePln.hxx index 5cf91f9b56..4903fa9a8d 100644 --- a/src/ModelingData/TKGeomBase/gce/gce_MakePln.hxx +++ b/src/ModelingData/TKGeomBase/gce/gce_MakePln.hxx @@ -65,7 +65,7 @@ public: //! Creates a plane from its cartesian equation : //! A * X + B * Y + C * Z + D = 0.0 //! - //! the status is "BadEquation" if Sqrt (A*A + B*B + C*C) <= + //! the status is "BadEquation" if std::sqrt(A*A + B*B + C*C) <= //! Resolution from gp. Standard_EXPORT gce_MakePln(const Standard_Real A, const Standard_Real B, @@ -99,8 +99,8 @@ public: //! normal to the Direction of . //! Warning - If an error occurs (that is, when IsDone returns //! false), the Status function returns: - //! - gce_BadEquation if Sqrt(A*A + B*B + - //! C*C) is less than or equal to gp::Resolution(), + //! - gce_BadEquation if std::sqrt(A*A + B*B + C*C) + //! is less than or equal to gp::Resolution(), //! - gce_ConfusedPoints if P1 and P2 are coincident, or //! - gce_ColinearPoints if P1, P2 and P3 are collinear. Standard_EXPORT gce_MakePln(const gp_Ax1& Axis); diff --git a/src/Visualization/TKMeshVS/MeshVS/MeshVS_Tool.cxx b/src/Visualization/TKMeshVS/MeshVS/MeshVS_Tool.cxx index 02f36b2503..06fa563a77 100644 --- a/src/Visualization/TKMeshVS/MeshVS/MeshVS_Tool.cxx +++ b/src/Visualization/TKMeshVS/MeshVS/MeshVS_Tool.cxx @@ -273,7 +273,7 @@ Standard_Boolean MeshVS_Tool::GetNormal(const TColStd_Array1OfReal& Nodes, gp_Ve if (fabs(cur_vec[0]) > conf || fabs(cur_vec[1]) > conf || fabs(cur_vec[2]) > conf) { Standard_Real cur = - Sqrt(cur_vec[0] * cur_vec[0] + cur_vec[1] * cur_vec[1] + cur_vec[2] * cur_vec[2]); + std::sqrt(cur_vec[0] * cur_vec[0] + cur_vec[1] * cur_vec[1] + cur_vec[2] * cur_vec[2]); for (Standard_Integer k = 0; k < 3; k++) cur_vec[k] /= cur; } @@ -342,7 +342,7 @@ Standard_Boolean MeshVS_Tool::GetAverageNormal(const TColStd_Array1OfReal& Nodes if (fabs(cur_vec[0]) > conf || fabs(cur_vec[1]) > conf || fabs(cur_vec[2]) > conf) { Standard_Real cur = - Sqrt(cur_vec[0] * cur_vec[0] + cur_vec[1] * cur_vec[1] + cur_vec[2] * cur_vec[2]); + std::sqrt(cur_vec[0] * cur_vec[0] + cur_vec[1] * cur_vec[1] + cur_vec[2] * cur_vec[2]); for (Standard_Integer k = 0; k < 3; k++) cur_vec[k] /= cur; } diff --git a/src/Visualization/TKMeshVS/MeshVS/MeshVS_VectorPrsBuilder.cxx b/src/Visualization/TKMeshVS/MeshVS/MeshVS_VectorPrsBuilder.cxx index 08fd017607..6fc61f1f39 100644 --- a/src/Visualization/TKMeshVS/MeshVS/MeshVS_VectorPrsBuilder.cxx +++ b/src/Visualization/TKMeshVS/MeshVS/MeshVS_VectorPrsBuilder.cxx @@ -240,7 +240,7 @@ void MeshVS_VectorPrsBuilder::Build(const Handle(Prs3d_Presentation)& Prs, { aValue = aVec.Magnitude(); - if (Abs(aValue) < Precision::Confusion()) + if (std::abs(aValue) < Precision::Confusion()) continue; if (aSource->GetGeom(aKey, IsElement, aCoords, NbNodes, aType)) @@ -276,7 +276,7 @@ void MeshVS_VectorPrsBuilder::Build(const Handle(Prs3d_Presentation)& Prs, gp_Ax3(gp_Pnt(X, Y, Z), aVec)); DrawVector(aTrsf, - Max(k * fabs(aValue) + b, aMinLength), + std::max(k * fabs(aValue) + b, aMinLength), aMaxLen, anArrowPnt, aLineArray, diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_AspectsSprite.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_AspectsSprite.cxx index 7a1c9277b0..7f922a76ce 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_AspectsSprite.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_AspectsSprite.cxx @@ -184,7 +184,7 @@ void OpenGl_AspectsSprite::build(const Handle(OpenGl_Context)& theCtx, const OpenGl_PointSprite* aSprite = dynamic_cast(mySprite.get()); if (!aSprite->IsDisplayList()) { - theMarkerSize = Standard_ShortReal(Max(aSprite->SizeX(), aSprite->SizeY())); + theMarkerSize = Standard_ShortReal(std::max(aSprite->SizeX(), aSprite->SizeY())); } return; } @@ -212,7 +212,7 @@ void OpenGl_AspectsSprite::build(const Handle(OpenGl_Context)& theCtx, // reuse shared resource if (!aSprite->IsDisplayList()) { - theMarkerSize = Standard_ShortReal(Max(aSprite->SizeX(), aSprite->SizeY())); + theMarkerSize = Standard_ShortReal(std::max(aSprite->SizeX(), aSprite->SizeY())); } return; } @@ -251,7 +251,7 @@ void OpenGl_AspectsSprite::build(const Handle(OpenGl_Context)& theCtx, // Creating texture resource for using it with point sprites Handle(Image_PixMap) anImage = aNewMarkerImage->GetImage(); theMarkerSize = - Max((Standard_ShortReal)anImage->Width(), (Standard_ShortReal)anImage->Height()); + std::max((Standard_ShortReal)anImage->Width(), (Standard_ShortReal)anImage->Height()); if (!hadAlreadyRGBA) { @@ -287,7 +287,7 @@ void OpenGl_AspectsSprite::build(const Handle(OpenGl_Context)& theCtx, Image_PixMap::FlipY(*anImageCopy); anImage = anImageCopy; } - const GLint anAligment = Min((GLint)anImage->MaxRowAligmentBytes(), 8); + const GLint anAligment = std::min((GLint)anImage->MaxRowAligmentBytes(), 8); theCtx->core11fwd->glPixelStorei(GL_UNPACK_ALIGNMENT, anAligment); const GLint anExtraBytes = GLint(anImage->RowExtraBytes()); diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_BackgroundArray.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_BackgroundArray.cxx index 33319a27c1..9624b55708 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_BackgroundArray.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_BackgroundArray.cxx @@ -291,8 +291,8 @@ Standard_Boolean OpenGl_BackgroundArray::createGradientArray( for (Standard_Integer anIt = 1; anIt < aSubdiv + 2; ++anIt) { anEllipVerts[anIt] = - OpenGl_Vec2(float(Cos(aParam) * M_SQRT2 * myViewWidth / 2.0 + myViewWidth / 2.0f), - float(Sin(aParam) * M_SQRT2 * myViewHeight / 2.0 + myViewHeight / 2.0f)); + OpenGl_Vec2(float(std::cos(aParam) * M_SQRT2 * myViewWidth / 2.0 + myViewWidth / 2.0f), + float(std::sin(aParam) * M_SQRT2 * myViewHeight / 2.0 + myViewHeight / 2.0f)); aParam += aTetta; } diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Context.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Context.cxx index 61c306076c..827fe4f9cd 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Context.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Context.cxx @@ -1397,12 +1397,12 @@ void OpenGl_Context::init(const Standard_Boolean theIsCoreProfile) GLint aMaxVPortSize[2] = {0, 0}; core11fwd->glGetIntegerv(GL_MAX_VIEWPORT_DIMS, aMaxVPortSize); - myMaxDumpSizeX = Min(aMaxVPortSize[0], myMaxTexDim); - myMaxDumpSizeY = Min(aMaxVPortSize[1], myMaxTexDim); + myMaxDumpSizeX = std::min(aMaxVPortSize[0], myMaxTexDim); + myMaxDumpSizeY = std::min(aMaxVPortSize[1], myMaxTexDim); if (myVendor == "intel") { // Intel drivers have known bug with empty dump for images with width>=5462 - myMaxDumpSizeX = Min(myMaxDumpSizeX, 4096); + myMaxDumpSizeX = std::min(myMaxDumpSizeX, 4096); } if (extAnis) @@ -1437,7 +1437,7 @@ void OpenGl_Context::init(const Standard_Boolean theIsCoreProfile) GLint aNbColorSamples = 0, aNbDepthSamples = 0; core11fwd->glGetIntegerv(GL_MAX_COLOR_TEXTURE_SAMPLES, &aNbColorSamples); core11fwd->glGetIntegerv(GL_MAX_DEPTH_TEXTURE_SAMPLES, &aNbDepthSamples); - myMaxMsaaSamples = Min(aNbColorSamples, aNbDepthSamples); + myMaxMsaaSamples = std::min(aNbColorSamples, aNbDepthSamples); } } if (myMaxMsaaSamples <= 1) diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Context.hxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Context.hxx index 8f60484203..2d7fbc7457 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Context.hxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Context.hxx @@ -958,7 +958,7 @@ public: //! @name methods to alter or retrieve current state Standard_ShortReal RenderScale() const { return myRenderScale; } //! Return TRUE if rendering scale factor is not 1. - Standard_Boolean HasRenderScale() const { return Abs(myRenderScale - 1.0f) > 0.0001f; } + Standard_Boolean HasRenderScale() const { return std::abs(myRenderScale - 1.0f) > 0.0001f; } //! Rendering scale factor (inverted value). Standard_ShortReal RenderScaleInv() const { return myRenderScaleInv; } @@ -983,7 +983,7 @@ public: //! @name methods to alter or retrieve current state void SetResolutionRatio(const Standard_ShortReal theRatio) { myResolutionRatio = theRatio; - myLineWidthScale = Max(1.0f, std::floor(theRatio + 0.5f)); + myLineWidthScale = (std::max)(1.0f, std::floor(theRatio + 0.5f)); } //! Return line feater width in pixels. diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Font.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Font.cxx index 0f01353f50..3130196b1d 100755 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Font.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Font.cxx @@ -115,7 +115,7 @@ bool OpenGl_Font::createTexture(const Handle(OpenGl_Context)& theCtx) myTileSizeY = myFont->GlyphMaxSizeY(true); const Standard_Integer aGlyphsNb = - Min(THE_MAX_GLYPHS_PER_TEXTURE, myFont->GlyphsNumber(true) - myLastTileId + 1); + std::min(THE_MAX_GLYPHS_PER_TEXTURE, myFont->GlyphsNumber(true) - myLastTileId + 1); const Standard_Integer aMaxTileSizeX = myFont->GlyphMaxSizeX(true); const Standard_Integer aMaxSize = theCtx->MaxTextureSize(); const Standard_Integer aTextureSizeX = diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameBuffer.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameBuffer.cxx index 1afbe8b335..3c34a6b951 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameBuffer.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameBuffer.cxx @@ -1219,7 +1219,7 @@ Standard_Boolean OpenGl_FrameBuffer::BufferDump(const Handle(OpenGl_Context)& // setup alignment // clang-format off - const GLint anAligment = Min (GLint(theImage.MaxRowAligmentBytes()), 8); // limit to 8 bytes for OpenGL + const GLint anAligment = std::min(GLint(theImage.MaxRowAligmentBytes()), 8); // limit to 8 bytes for OpenGL // clang-format on theGlCtx->core11fwd->glPixelStorei(GL_PACK_ALIGNMENT, anAligment); bool isBatchCopy = !theImage.IsTopDown(); diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameStats.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameStats.cxx index 85ca4dfc64..1abb2e6045 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameStats.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameStats.cxx @@ -55,11 +55,12 @@ bool OpenGl_FrameStats::IsFrameUpdated(Handle(OpenGl_FrameStats)& thePrev) const } // check just a couple of major counters else if (myLastFrameIndex == thePrev->myLastFrameIndex - && Abs(aFrame.FrameRate() - thePrev->myCountersTmp.FrameRate()) <= 0.001 - && Abs(aFrame.FrameRateCpu() - thePrev->myCountersTmp.FrameRateCpu()) <= 0.001 - && Abs(aFrame.ImmediateFrameRate() - thePrev->myCountersTmp.ImmediateFrameRate()) + && std::abs(aFrame.FrameRate() - thePrev->myCountersTmp.FrameRate()) <= 0.001 + && std::abs(aFrame.FrameRateCpu() - thePrev->myCountersTmp.FrameRateCpu()) <= 0.001 + && std::abs(aFrame.ImmediateFrameRate() - thePrev->myCountersTmp.ImmediateFrameRate()) <= 0.001 - && Abs(aFrame.ImmediateFrameRateCpu() - thePrev->myCountersTmp.ImmediateFrameRateCpu()) + && std::abs(aFrame.ImmediateFrameRateCpu() + - thePrev->myCountersTmp.ImmediateFrameRateCpu()) <= 0.001 && aFrame[Graphic3d_FrameStatsCounter_NbLayers] == thePrev->myCountersTmp[Graphic3d_FrameStatsCounter_NbLayers] diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameStatsPrs.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameStatsPrs.cxx index f14cea073f..e72a4a1386 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameStatsPrs.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_FrameStatsPrs.cxx @@ -159,12 +159,13 @@ void OpenGl_FrameStatsPrs::updateChart(const Handle(OpenGl_Workspace)& theWorksp ++aFrameIter) { const Graphic3d_FrameStatsData& aFrame = aStats->DataFrames().Value(aFrameIter); - aMaxDuration = Max(aMaxDuration, aFrame.TimerValue(Graphic3d_FrameStatsTimer_ElapsedFrame)); + aMaxDuration = + std::max(aMaxDuration, aFrame.TimerValue(Graphic3d_FrameStatsTimer_ElapsedFrame)); } - aMaxDuration = Ceiling(aMaxDuration * 1000.0 * 0.1) * 0.001 * 10.0; // round number - // clang-format off - aMaxDuration = Max (Min (aMaxDuration, 0.1), 0.005); // limit by 100 ms (10 FPS) and 5 ms (200 FPS) - // clang-format on + aMaxDuration = std::ceil(aMaxDuration * 1000.0 * 0.1) * 0.001 * 10.0; // round number + // clang-format off + aMaxDuration = std::max (std::min (aMaxDuration, 0.1), 0.005); // limit by 100 ms (10 FPS) and 5 ms (200 FPS) + // clang-format on } const Standard_Integer aNbTimers = 4; @@ -261,7 +262,7 @@ void OpenGl_FrameStatsPrs::updateChart(const Handle(OpenGl_Workspace)& theWorksp const Standard_Real aBinX1 = anOffset.x() + Standard_Real(aFrameIter) * aBinSize.x(); const Standard_Real aBinX2 = aBinX1 + aBinSize.x(); - const Standard_Real aCurrSizeY = Min(aTimeElapsed / aMaxDuration, 1.2) * aBinSize.y(); + const Standard_Real aCurrSizeY = std::min(aTimeElapsed / aMaxDuration, 1.2) * aBinSize.y(); const Standard_Real aBinY1 = isTopDown ? (anOffset.y() - aCurrY) : (anOffset.y() - aBinSize.y() + aCurrY); const Standard_Real aBinY2 = diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Sampler.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Sampler.cxx index ed4b6461b3..cf3fe52473 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Sampler.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Sampler.cxx @@ -251,7 +251,7 @@ void OpenGl_Sampler::applySamplerParams(const Handle(OpenGl_Context)& t if (theCtx->HasTextureBaseLevel() && (theSampler == NULL || !theSampler->isValidSampler())) { - const Standard_Integer aMaxLevel = Min(theMaxMipLevels, theParams->MaxLevel()); + const Standard_Integer aMaxLevel = std::min(theMaxMipLevels, theParams->MaxLevel()); setParameter(theCtx, theSampler, theTarget, GL_TEXTURE_BASE_LEVEL, theParams->BaseLevel()); setParameter(theCtx, theSampler, theTarget, GL_TEXTURE_MAX_LEVEL, aMaxLevel); } diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_SceneGeometry.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_SceneGeometry.cxx index 1da943cc97..ae0b25f5a7 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_SceneGeometry.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_SceneGeometry.cxx @@ -99,7 +99,9 @@ Standard_ShortReal OpenGl_TriangleSet::Center(const Standard_Integer theIndex, const Standard_ShortReal aVertex2 = BVH::VecComp::Get(Vertices[aTriangle.z()], theAxis); - return (Min(Min(aVertex0, aVertex1), aVertex2) + Max(Max(aVertex0, aVertex1), aVertex2)) * 0.5f; + return (std::min(std::min(aVertex0, aVertex1), aVertex2) + + std::max(std::max(aVertex0, aVertex1), aVertex2)) + * 0.5f; } // ======================================================================= @@ -233,7 +235,7 @@ Standard_Boolean OpenGl_RaytraceGeometry::ProcessAcceleration() } } - myBotLevelTreeDepth = Max(myBotLevelTreeDepth, aTriangleSet->QuadBVH()->Depth()); + myBotLevelTreeDepth = std::max(myBotLevelTreeDepth, aTriangleSet->QuadBVH()->Depth()); } #ifdef RAY_TRACE_PRINT_INFO diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShaderManager.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShaderManager.cxx index 4293f4415d..6639e8482a 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShaderManager.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShaderManager.cxx @@ -586,7 +586,7 @@ void OpenGl_ShaderManager::pushLightSourceState( / (float)myLightSourceState.ShadowMaps()->First()->Texture()->SizeX(), myLightSourceState.ShadowMaps()->First()->ShadowMapBias()); const Standard_Integer aNbShadows = - Min(theProgram->NbShadowMaps(), myLightSourceState.ShadowMaps()->Size()); + std::min(theProgram->NbShadowMaps(), myLightSourceState.ShadowMaps()->Size()); for (Standard_Integer aShadowIter = 0; aShadowIter < aNbShadows; ++aShadowIter) { const Handle(OpenGl_ShadowMap)& aShadow = @@ -835,7 +835,7 @@ void OpenGl_ShaderManager::pushClippingState(const Handle(OpenGl_ShaderProgram)& const Standard_Integer aNbClipPlanesMax = theProgram->NbClipPlanesMax(); const Standard_Integer aNbPlanes = - Min(myContext->Clipping().NbClippingOrCappingOn(), aNbClipPlanesMax); + std::min(myContext->Clipping().NbClippingOrCappingOn(), aNbClipPlanesMax); if (aNbPlanes < 1) { theProgram->SetUniform(myContext, theProgram->GetStateLocation(OpenGl_OCC_CLIP_PLANE_COUNT), 0); @@ -1143,7 +1143,7 @@ Standard_Boolean OpenGl_ShaderManager::BindFboBlitProgram(Standard_Integer theNb { NCollection_Array1& aList = myBlitPrograms[theIsFallback_sRGB ? 1 : 0]; - Standard_Integer aNbSamples = Max(theNbSamples, 1); + Standard_Integer aNbSamples = std::max(theNbSamples, 1); if (aNbSamples > aList.Upper()) { aList.Resize(1, aNbSamples, true); diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShaderProgram.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShaderProgram.cxx index 1a293811e3..3af5f35c53 100755 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShaderProgram.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShaderProgram.cxx @@ -668,7 +668,7 @@ Standard_Boolean OpenGl_ShaderProgram::Initialize(const Handle(OpenGl_Context)& const TCollection_AsciiString aSamplerNamePrefix("occSampler"); const Standard_Integer aNbUnitsMax = - Max(theCtx->MaxCombinedTextureUnits(), Graphic3d_TextureUnit_NB); + std::max(theCtx->MaxCombinedTextureUnits(), static_cast(Graphic3d_TextureUnit_NB)); for (GLint aUnitIter = 0; aUnitIter < aNbUnitsMax; ++aUnitIter) { const TCollection_AsciiString aName = aSamplerNamePrefix + aUnitIter; diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShaderStates.hxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShaderStates.hxx index e024857584..9b755d3d6a 100755 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShaderStates.hxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShaderStates.hxx @@ -198,7 +198,7 @@ public: void Set(Graphic3d_RenderTransparentMethod theMode, const float theDepthFactor) { myOitMode = theMode; - myDepthFactor = static_cast(Max(0.f, Min(1.f, theDepthFactor))); + myDepthFactor = static_cast((std::max)(0.f, (std::min)(1.f, theDepthFactor))); } //! Returns flag indicating whether writing of output for OIT processing diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShadowMap.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShadowMap.cxx index 8a1e305a13..d8223859a0 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShadowMap.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_ShadowMap.cxx @@ -115,7 +115,7 @@ bool OpenGl_ShadowMap::UpdateCamera(const Graphic3d_CView& theView, const gp_XYZ if (myShadowCamera->FitMinMax(aMinMaxBox, 10.0 * Precision::Confusion(), false)) { // clang-format off - myShadowCamera->SetScale (Max (myShadowCamera->ViewDimensions().X() * 1.1, myShadowCamera->ViewDimensions().Y() * 1.1)); // add margin + myShadowCamera->SetScale (std::max (myShadowCamera->ViewDimensions().X() * 1.1, myShadowCamera->ViewDimensions().Y() * 1.1)); // add margin // clang-format on } myShadowCamera->ZFitAll(1.0, aMinMaxBox, aGraphicBox); diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Structure.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Structure.cxx index be9362129c..c867bb2cfb 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Structure.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Structure.cxx @@ -448,7 +448,7 @@ void OpenGl_Structure::Render(const Handle(OpenGl_Workspace)& theWorkspace) cons if (aCtx->core11ffp != NULL && !myTrsf.IsNull()) { const Standard_Real aScale = myTrsf->Trsf().ScaleFactor(); - if (Abs(aScale - 1.0) > Precision::Confusion()) + if (std::abs(aScale - 1.0) > Precision::Confusion()) { aCtx->SetGlNormalizeEnabled(Standard_True); } @@ -702,7 +702,7 @@ void OpenGl_Structure::applyPersistence(const Handle(OpenGl_Context)& t if (!theCtx->IsGlNormalizeEnabled() && theCtx->core11ffp != NULL) { const Standard_Real aScale = Graphic3d_TransformUtils::ScaleFactor(aWorldView); - if (Abs(aScale - 1.0) > Precision::Confusion()) + if (std::abs(aScale - 1.0) > Precision::Confusion()) { theCtx->SetGlNormalizeEnabled(true); } diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Text.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Text.cxx index e8f1291de0..0f90f29e65 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Text.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Text.cxx @@ -274,7 +274,7 @@ void OpenGl_Text::StringSize(const Handle(OpenGl_Context)& theCtx, } else if (aCharThis == '\x0A') // LF (line feed, new line) { - theWidth = Max(theWidth, aWidth); + theWidth = std::max(theWidth, aWidth); aWidth = 0.0f; continue; } @@ -291,7 +291,7 @@ void OpenGl_Text::StringSize(const Handle(OpenGl_Context)& theCtx, aWidth += aFont->FTFont()->AdvanceX(aCharThis, aCharNext); } - theWidth = Max(theWidth, aWidth); + theWidth = std::max(theWidth, aWidth); const Handle(OpenGl_Context)& aCtx = theCtx; aFont.Nullify(); @@ -405,8 +405,8 @@ void OpenGl_Text::setupMatrix(const Handle(OpenGl_Context)& theCtx, // Note that for better readability we could also try aligning freely rotated in 3D text // (myHasPlane), when camera orientation co-aligned with horizontal text orientation, but this // might look awkward while rotating camera. - aWinXYZ.x() = Floor(aWinXYZ.x()); - aWinXYZ.y() = Floor(aWinXYZ.y()); + aWinXYZ.x() = std::floor(aWinXYZ.x()); + aWinXYZ.y() = std::floor(aWinXYZ.y()); } Graphic3d_TransformUtils::UnProject(aWinXYZ.x(), aWinXYZ.y(), diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Texture.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Texture.cxx index 759938b8c2..677c79fe1f 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_Texture.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_Texture.cxx @@ -353,7 +353,7 @@ bool OpenGl_Texture::Init(const Handle(OpenGl_Context)& theCtx, if (aDataPtr != NULL) { // clang-format off - const GLint anAligment = Min ((GLint )theImage->MaxRowAligmentBytes(), 8); // OpenGL supports alignment upto 8 bytes + const GLint anAligment = std::min((GLint )theImage->MaxRowAligmentBytes(), 8); // OpenGL supports alignment upto 8 bytes // clang-format on theCtx->core11fwd->glPixelStorei(GL_UNPACK_ALIGNMENT, anAligment); const GLint anExtraBytes = GLint(theImage->RowExtraBytes()); @@ -671,7 +671,7 @@ bool OpenGl_Texture::GenerateMipmaps(const Handle(OpenGl_Context)& theCtx) Bind(theCtx); if (theCtx->HasTextureBaseLevel() && !mySampler->isValidSampler()) { - const Standard_Integer aMaxLevel = Min(myMaxMipLevel, mySampler->Parameters()->MaxLevel()); + const Standard_Integer aMaxLevel = std::min(myMaxMipLevel, mySampler->Parameters()->MaxLevel()); mySampler->SetParameter(theCtx, myTarget, GL_TEXTURE_MAX_LEVEL, aMaxLevel); } theCtx->arbFBO->glGenerateMipmap(myTarget); @@ -847,7 +847,7 @@ bool OpenGl_Texture::InitCompressed(const Handle(OpenGl_Context)& theCtx, mySizedFormat = aFormat.Internal(); myIsTopDown = theImage.IsTopDown(); mySize.SetValues(theImage.SizeX(), theImage.SizeY(), 1); - myMaxMipLevel = Max(theImage.MipMaps().Size() - 1, 0); + myMaxMipLevel = std::max(theImage.MipMaps().Size() - 1, 0); if (myMaxMipLevel > 0 && !theImage.IsCompleteMipMapSet()) { const Graphic3d_Vec2i aMipSize = computeSmallestMipMapSize(mySize.xy(), myMaxMipLevel); @@ -1026,8 +1026,8 @@ bool OpenGl_Texture::InitRectangle(const Handle(OpenGl_Context)& theCtx, myNbSamples = 1; myMaxMipLevel = 0; - const GLsizei aSizeX = Min(theCtx->MaxTextureSize(), theSizeX); - const GLsizei aSizeY = Min(theCtx->MaxTextureSize(), theSizeY); + const GLsizei aSizeX = std::min(theCtx->MaxTextureSize(), theSizeX); + const GLsizei aSizeY = std::min(theCtx->MaxTextureSize(), theSizeY); Bind(theCtx); applyDefaultSamplerParams(theCtx); @@ -1237,7 +1237,7 @@ bool OpenGl_Texture::InitCubeMap(const Handle(OpenGl_Context)& theCtx, theToGenMipmap = false; theSize = aCompImage->SizeX(); theFormat = aCompImage->BaseFormat(); - myMaxMipLevel = Max(aCompImage->MipMaps().Size() - 1, 0); + myMaxMipLevel = std::max(aCompImage->MipMaps().Size() - 1, 0); if (myMaxMipLevel > 0 && !aCompImage->IsCompleteMipMapSet()) { const Graphic3d_Vec2i aMipSize = @@ -1413,7 +1413,7 @@ bool OpenGl_Texture::InitCubeMap(const Handle(OpenGl_Context)& theCtx, if (!anImage.IsNull()) { // clang-format off - const GLint anAligment = Min ((GLint)anImage->MaxRowAligmentBytes(), 8); // OpenGL supports alignment upto 8 bytes + const GLint anAligment = std::min((GLint)anImage->MaxRowAligmentBytes(), 8); // OpenGL supports alignment upto 8 bytes // clang-format on const GLint anExtraBytes = GLint(anImage->RowExtraBytes()); const GLint aPixelsWidth = GLint(anImage->SizeRowBytes() / anImage->SizePixelBytes()); @@ -1435,7 +1435,7 @@ bool OpenGl_Texture::InitCubeMap(const Handle(OpenGl_Context)& theCtx, } anImage = aCopyImage; // clang-format off - const GLint anAligment2 = Min((GLint)anImage->MaxRowAligmentBytes(), 8); // OpenGL supports alignment upto 8 bytes + const GLint anAligment2 = std::min((GLint)anImage->MaxRowAligmentBytes(), 8); // OpenGL supports alignment upto 8 bytes // clang-format on theCtx->core11fwd->glPixelStorei(GL_UNPACK_ALIGNMENT, anAligment2); } @@ -1654,7 +1654,7 @@ bool OpenGl_Texture::ImageDump(Image_PixMap& theImage, } // clang-format off - const GLint anAligment = Min (GLint(theImage.MaxRowAligmentBytes()), 8); // limit to 8 bytes for OpenGL + const GLint anAligment = std::min(GLint(theImage.MaxRowAligmentBytes()), 8); // limit to 8 bytes for OpenGL // clang-format on theCtx->core11fwd->glPixelStorei(GL_PACK_ALIGNMENT, anAligment); if (theCtx->hasPackRowLength) diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_TextureSetPairIterator.hxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_TextureSetPairIterator.hxx index de309d1b94..3dc472594c 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_TextureSetPairIterator.hxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_TextureSetPairIterator.hxx @@ -34,13 +34,13 @@ public: { if (!theSet1.IsNull() && !theSet1->IsEmpty()) { - myUnitLower = Min(myUnitLower, theSet1->FirstUnit()); - myUnitUpper = Max(myUnitUpper, theSet1->LastUnit()); + myUnitLower = (std::min)(myUnitLower, static_cast(theSet1->FirstUnit())); + myUnitUpper = (std::max)(myUnitUpper, static_cast(theSet1->LastUnit())); } if (!theSet2.IsNull() && !theSet2->IsEmpty()) { - myUnitLower = Min(myUnitLower, theSet2->FirstUnit()); - myUnitUpper = Max(myUnitUpper, theSet2->LastUnit()); + myUnitLower = (std::min)(myUnitLower, static_cast(theSet2->FirstUnit())); + myUnitUpper = (std::max)(myUnitUpper, static_cast(theSet2->LastUnit())); } myUnitCurrent = myUnitLower; myTexture1 = diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_TileSampler.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_TileSampler.cxx index 0e9ad6f180..7d2f89dbfc 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_TileSampler.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_TileSampler.cxx @@ -158,11 +158,11 @@ void OpenGl_TileSampler::SetSize(const Graphic3d_RenderingParams& theParams, myViewSize = theSize; - const int aTileSize = Max(theParams.RayTracingTileSize, 1); + const int aTileSize = std::max(theParams.RayTracingTileSize, 1); const int aNbTilesX = - Max(1, static_cast(ceilf(static_cast(theSize.x()) / aTileSize))); + std::max(1, static_cast(ceilf(static_cast(theSize.x()) / aTileSize))); const int aNbTilesY = - Max(1, static_cast(ceilf(static_cast(theSize.y()) / aTileSize))); + std::max(1, static_cast(ceilf(static_cast(theSize.y()) / aTileSize))); if (myTileSize != aTileSize || (int)myTiles.SizeX != aNbTilesX || (int)myTiles.SizeY != aNbTilesY) { myTileSize = aTileSize; diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_TileSampler.hxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_TileSampler.hxx index 408b04ac33..94fbd64a34 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_TileSampler.hxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_TileSampler.hxx @@ -87,7 +87,7 @@ public: { for (Standard_Size aColIter = 0; aColIter < myTiles.SizeX; ++aColIter) { - aNbSamples = Max(aNbSamples, myTiles.Value(aRowIter, aColIter)); + aNbSamples = (std::max)(aNbSamples, static_cast(myTiles.Value(aRowIter, aColIter))); } } return aNbSamples; @@ -125,8 +125,8 @@ protected: //! Returns number of pixels in the given tile. int tileArea(int theX, int theY) const { - const int aSizeX = Min(myTileSize, myViewSize.x() - theX * myTileSize); - const int aSizeY = Min(myTileSize, myViewSize.y() - theY * myTileSize); + const int aSizeX = (std::min)(myTileSize, myViewSize.x() - theX * myTileSize); + const int aSizeY = (std::min)(myTileSize, myViewSize.y() - theY * myTileSize); return aSizeX * aSizeY; } diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_View.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_View.cxx index 3bb304f6d1..14cab7257f 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_View.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_View.cxx @@ -598,7 +598,7 @@ Standard_Boolean OpenGl_View::ShadowMapDump(Image_PixMap& theIm } // Setup alignment. // clang-format off - const GLint anAligment = Min (GLint(theImage.MaxRowAligmentBytes()), 8); // limit to 8 bytes for OpenGL. + const GLint anAligment = std::min(GLint(theImage.MaxRowAligmentBytes()), 8); // limit to 8 bytes for OpenGL. // clang-format on aGlCtx->core11fwd->glPixelStorei(GL_PACK_ALIGNMENT, anAligment); // Read data. @@ -841,7 +841,7 @@ Standard_Integer OpenGl_View::ZLayerMax() const aLayerIter.More(); aLayerIter.Next()) { - aLayerMax = Max(aLayerMax, aLayerIter.Value()->LayerId()); + aLayerMax = std::max(aLayerMax, aLayerIter.Value()->LayerId()); } return aLayerMax; } @@ -1192,7 +1192,7 @@ bool OpenGl_View::prepareFrameBuffers(Graphic3d_Camera::Projection& theProj) // determine multisampling parameters Standard_Integer aNbSamples = !myToDisableMSAA && aSizeX == aRendSize.x() - ? Max(Min(myRenderParams.NbMsaaSamples, aCtx->MaxMsaaSamples()), 0) + ? std::max(std::min(myRenderParams.NbMsaaSamples, aCtx->MaxMsaaSamples()), 0) : 0; if (aNbSamples != 0) { diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_View.hxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_View.hxx index 0ea45a057b..5772a6dd5a 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_View.hxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_View.hxx @@ -711,10 +711,10 @@ protected: //! @name data types related to ray-tracing }; //! Default ray-tracing depth. - static const Standard_Integer THE_DEFAULT_NB_BOUNCES = 3; + static constexpr Standard_Integer THE_DEFAULT_NB_BOUNCES = 3; //! Default size of traversal stack. - static const Standard_Integer THE_DEFAULT_STACK_SIZE = 10; + static constexpr Standard_Integer THE_DEFAULT_STACK_SIZE = 10; //! Compile-time ray-tracing parameters. struct RaytracingParams diff --git a/src/Visualization/TKOpenGl/OpenGl/OpenGl_View_Raytrace.cxx b/src/Visualization/TKOpenGl/OpenGl/OpenGl_View_Raytrace.cxx index fa0776485a..33dcd5f004 100644 --- a/src/Visualization/TKOpenGl/OpenGl/OpenGl_View_Raytrace.cxx +++ b/src/Visualization/TKOpenGl/OpenGl/OpenGl_View_Raytrace.cxx @@ -239,7 +239,7 @@ Standard_Boolean OpenGl_View::updateRaytraceGeometry(const RaytraceUpdateMode const BVH_Vec3f aSize = myRaytraceGeometry.Box().Size(); - myRaytraceSceneEpsilon = Max(1.0e-6f, 1.0e-4f * aSize.Modulus()); + myRaytraceSceneEpsilon = std::max(1.0e-6f, 1.0e-4f * aSize.Modulus()); return uploadRaytraceData(theGlContext); } @@ -392,9 +392,10 @@ OpenGl_RaytraceMaterial OpenGl_View::convertMaterial(const OpenGl_Aspects* { // interior color is always ignored for Specular aResMat.Specular.SetValues(aSrcSpe, aShine); - const Standard_ShortReal aMaxRefl = Max( - aResMat.Diffuse.x() + aResMat.Specular.x(), - Max(aResMat.Diffuse.y() + aResMat.Specular.y(), aResMat.Diffuse.z() + aResMat.Specular.z())); + const Standard_ShortReal aMaxRefl = + std::max(aResMat.Diffuse.x() + aResMat.Specular.x(), + std::max(aResMat.Diffuse.y() + aResMat.Specular.y(), + aResMat.Diffuse.z() + aResMat.Specular.z())); const Standard_ShortReal aReflectionScale = 0.75f / aMaxRefl; aResMat.Reflection.SetValues(aSrcSpe * aReflectionScale, 0.0f); } @@ -1409,7 +1410,7 @@ Standard_Boolean OpenGl_View::initRaytraceResources(const Standard_Integer if (myRaytraceParameters.StackSize < aRequiredStackSize) { - myRaytraceParameters.StackSize = Max(aRequiredStackSize, THE_DEFAULT_STACK_SIZE); + myRaytraceParameters.StackSize = std::max(aRequiredStackSize, THE_DEFAULT_STACK_SIZE); aToRebuildShaders = Standard_True; } @@ -1419,7 +1420,7 @@ Standard_Boolean OpenGl_View::initRaytraceResources(const Standard_Integer { if (myRaytraceParameters.StackSize > THE_DEFAULT_STACK_SIZE) { - myRaytraceParameters.StackSize = Max(aRequiredStackSize, THE_DEFAULT_STACK_SIZE); + myRaytraceParameters.StackSize = std::max(aRequiredStackSize, THE_DEFAULT_STACK_SIZE); aToRebuildShaders = Standard_True; } } @@ -1585,8 +1586,8 @@ Standard_Boolean OpenGl_View::initRaytraceResources(const Standard_Integer if (myIsRaytraceDataValid) { myRaytraceParameters.StackSize = - Max(THE_DEFAULT_STACK_SIZE, - myRaytraceGeometry.TopLevelTreeDepth() + myRaytraceGeometry.BotLevelTreeDepth()); + std::max(THE_DEFAULT_STACK_SIZE, + myRaytraceGeometry.TopLevelTreeDepth() + myRaytraceGeometry.BotLevelTreeDepth()); } const TCollection_AsciiString aPrefixString = generateShaderPrefix(theGlContext); @@ -2670,13 +2671,13 @@ Standard_Boolean OpenGl_View::updateRaytraceLightSources(const OpenGl_Mat4& theI 1.0f); // store smoothing radius in W-component - aEmission.w() = Max(aLight.Smoothness(), 0.f); + aEmission.w() = std::max(aLight.Smoothness(), 0.f); } else { // store cosine of smoothing angle in W-component - aEmission.w() = - cosf(Min(Max(aLight.Smoothness(), 0.f), static_cast(M_PI / 2.0))); + aEmission.w() = cosf( + std::min(std::max(aLight.Smoothness(), 0.f), static_cast(M_PI / 2.0))); } if (aLight.IsHeadlight()) diff --git a/src/Visualization/TKService/Aspect/Aspect_CircularGrid.cxx b/src/Visualization/TKService/Aspect/Aspect_CircularGrid.cxx index f1953bcb0e..68cf66de75 100644 --- a/src/Visualization/TKService/Aspect/Aspect_CircularGrid.cxx +++ b/src/Visualization/TKService/Aspect/Aspect_CircularGrid.cxx @@ -75,15 +75,15 @@ void Aspect_CircularGrid::Compute(const Standard_Real X, Standard_Real xo = XOrigin(); Standard_Real yo = YOrigin(); - Standard_Real d = Sqrt((xo - X) * (xo - X) + (yo - Y) * (yo - Y)); + Standard_Real d = std::sqrt((xo - X) * (xo - X) + (yo - Y) * (yo - Y)); Standard_Integer n = (Standard_Integer)(d / myRadiusStep + 0.5); Standard_Real radius = Standard_Real(n) * myRadiusStep; Standard_Real cosinus = (X - xo) / d; - Standard_Real a = ACos(cosinus); + Standard_Real a = std::acos(cosinus); Standard_Real ra = RotationAngle(); if (Y < yo) a = 2 * M_PI - a; - n = (Standard_Integer)((a - ra) / myAlpha + Sign(0.5, a - ra)); + n = (Standard_Integer)((a - ra) / myAlpha + std::copysign(0.5, a - ra)); Standard_Real cs = 0, sn = 0; Standard_Boolean done = Standard_False; @@ -146,8 +146,8 @@ void Aspect_CircularGrid::Compute(const Standard_Real X, if (!done) { Standard_Real ang = ra + Standard_Real(n) * myAlpha; - cs = Cos(ang); - sn = Sin(ang); + cs = std::cos(ang); + sn = std::sin(ang); } gridX = xo + cs * radius; gridY = yo + sn * radius; @@ -166,8 +166,8 @@ Standard_Integer Aspect_CircularGrid::DivisionNumber() const void Aspect_CircularGrid::Init() { myAlpha = M_PI / Standard_Real(myDivisionNumber); - myA1 = Cos(myAlpha); - myB1 = Sin(myAlpha); + myA1 = std::cos(myAlpha); + myB1 = std::sin(myAlpha); } //================================================================================================= diff --git a/src/Visualization/TKService/Aspect/Aspect_OpenVRSession.cxx b/src/Visualization/TKService/Aspect/Aspect_OpenVRSession.cxx index 8a56007e85..381ae71917 100644 --- a/src/Visualization/TKService/Aspect/Aspect_OpenVRSession.cxx +++ b/src/Visualization/TKService/Aspect/Aspect_OpenVRSession.cxx @@ -869,7 +869,7 @@ void Aspect_OpenVRSession::updateProjectionFrustums() NCollection_Vec4(-aFrustL.Left, aFrustL.Right, -aFrustR.Left, aFrustR.Right).maxComp(), NCollection_Vec4(-aFrustL.Top, aFrustL.Bottom, -aFrustR.Top, aFrustR.Bottom).maxComp()); myAspect = aTanHalfFov.x() / aTanHalfFov.y(); - myFieldOfView = 2.0 * ATan(aTanHalfFov.y()) * 180.0 / M_PI; + myFieldOfView = 2.0 * std::atan(aTanHalfFov.y()) * 180.0 / M_PI; // Intra-ocular Distance can be changed in runtime // const vr::HmdMatrix34_t aLeftToHead = myContext->System->GetEyeToHeadTransform (vr::Eye_Left); diff --git a/src/Visualization/TKService/Aspect/Aspect_RectangularGrid.cxx b/src/Visualization/TKService/Aspect/Aspect_RectangularGrid.cxx index 5e5a543556..de27784457 100644 --- a/src/Visualization/TKService/Aspect/Aspect_RectangularGrid.cxx +++ b/src/Visualization/TKService/Aspect/Aspect_RectangularGrid.cxx @@ -95,10 +95,10 @@ void Aspect_RectangularGrid::Compute(const Standard_Real X, { Standard_Real D1 = b1 * X - a1 * Y - c1; Standard_Real D2 = b2 * X - a2 * Y - c2; - Standard_Integer n1 = Standard_Integer(Abs(D1) / myXStep + 0.5); - Standard_Integer n2 = Standard_Integer(Abs(D2) / myYStep + 0.5); - Standard_Real offset1 = c1 + Standard_Real(n1) * Sign(myXStep, D1); - Standard_Real offset2 = c2 + Standard_Real(n2) * Sign(myYStep, D2); + Standard_Integer n1 = Standard_Integer(std::abs(D1) / myXStep + 0.5); + Standard_Integer n2 = Standard_Integer(std::abs(D2) / myYStep + 0.5); + Standard_Real offset1 = c1 + Standard_Real(n1) * std::copysign(myXStep, D1); + Standard_Real offset2 = c2 + Standard_Real(n2) * std::copysign(myYStep, D2); Standard_Real Delta = a1 * b2 - b1 * a2; gridX = (offset2 * a1 - offset1 * a2) / Delta; gridY = (offset2 * b1 - offset1 * b2) / Delta; @@ -140,8 +140,8 @@ void Aspect_RectangularGrid::Init() Standard_Real angle2 = mySecondAngle + RotationAngle(); if (angle1 != 0.) { - a1 = -Sin(angle1); - b1 = Cos(angle1); + a1 = -std::sin(angle1); + b1 = std::cos(angle1); c1 = XOrigin() * b1 - YOrigin() * a1; } else @@ -154,8 +154,8 @@ void Aspect_RectangularGrid::Init() if (angle2 != 0.) { angle2 += M_PI / 2.; - a2 = -Sin(angle2); - b2 = Cos(angle2); + a2 = -std::sin(angle2); + b2 = std::cos(angle2); c2 = XOrigin() * b2 - YOrigin() * a2; } else @@ -170,7 +170,9 @@ void Aspect_RectangularGrid::Init() Standard_Boolean Aspect_RectangularGrid::CheckAngle(const Standard_Real alpha, const Standard_Real beta) const { - return (Abs(Sin(alpha) * Cos(beta + M_PI / 2.) - Cos(alpha) * Sin(beta + M_PI / 2.)) != 0); + return (std::abs(std::sin(alpha) * std::cos(beta + M_PI / 2.) + - std::cos(alpha) * std::sin(beta + M_PI / 2.)) + != 0); } //================================================================================================= diff --git a/src/Visualization/TKService/Aspect/Aspect_VKeySet.cxx b/src/Visualization/TKService/Aspect/Aspect_VKeySet.cxx index 3a9d4b3c7d..99c5d7cf8c 100644 --- a/src/Visualization/TKService/Aspect/Aspect_VKeySet.cxx +++ b/src/Visualization/TKService/Aspect/Aspect_VKeySet.cxx @@ -97,7 +97,7 @@ void Aspect_VKeySet::KeyFromAxis(Aspect_VKey theNegative, const Aspect_VKey aKeyDown = thePressure > 0 ? thePositive : theNegative; const Aspect_VKey aKeyUp = thePressure < 0 ? thePositive : theNegative; - KeyDown_Unlocked(aKeyDown, theTime, Abs(thePressure)); + KeyDown_Unlocked(aKeyDown, theTime, std::abs(thePressure)); if (myKeys[aKeyUp].KStatus == KeyStatus_Pressed) { KeyUp_Unlocked(aKeyUp, theTime); diff --git a/src/Visualization/TKService/Font/Font_FTFont.cxx b/src/Visualization/TKService/Font/Font_FTFont.cxx index 5dfc7d9b81..1a51bf303f 100755 --- a/src/Visualization/TKService/Font/Font_FTFont.cxx +++ b/src/Visualization/TKService/Font/Font_FTFont.cxx @@ -174,12 +174,12 @@ bool Font_FTFont::Init(const Handle(NCollection_Buffer)& theData, const double THE_SHEAR_ANGLE = 10.0 * M_PI / 180.0; FT_Matrix aMat; - aMat.xx = FT_Fixed(Cos(-THE_SHEAR_ANGLE) * (1 << 16)); + aMat.xx = FT_Fixed(std::cos(-THE_SHEAR_ANGLE) * (1 << 16)); aMat.xy = 0; aMat.yx = 0; aMat.yy = aMat.xx; - FT_Fixed aFactor = FT_Fixed(Tan(THE_SHEAR_ANGLE) * (1 << 16)); + FT_Fixed aFactor = FT_Fixed(std::tan(THE_SHEAR_ANGLE) * (1 << 16)); aMat.xy += FT_MulFix(aFactor, aMat.xx); FT_Set_Transform(myFTFace, &aMat, 0); @@ -408,7 +408,7 @@ bool Font_FTFont::RenderGlyph(const Standard_Utf32Char theUChar) aBitmap.buffer, aBitmap.width, aBitmap.rows, - Abs(aBitmap.pitch))) + std::abs(aBitmap.pitch))) { return false; } diff --git a/src/Visualization/TKService/Font/Font_TextFormatter.cxx b/src/Visualization/TKService/Font/Font_TextFormatter.cxx index ab5ac3dbb1..4469c2e852 100644 --- a/src/Visualization/TKService/Font/Font_TextFormatter.cxx +++ b/src/Visualization/TKService/Font/Font_TextFormatter.cxx @@ -111,8 +111,8 @@ void Font_TextFormatter::Append(const NCollection_String& theString, Font_FTFont return; } - myAscender = Max(myAscender, theFont.Ascender()); - myLineSpacing = Max(myLineSpacing, theFont.LineSpacing()); + myAscender = std::max(myAscender, theFont.Ascender()); + myLineSpacing = std::max(myLineSpacing, theFont.LineSpacing()); myString += theString; int aSymbolsCounter = 0; // special counter to process tabulation symbols @@ -151,7 +151,7 @@ void Font_TextFormatter::Append(const NCollection_String& theString, Font_FTFont ++aSymbolsCounter; myCorners.Append(myPen); myPen.x() += anAdvanceX; - myMaxSymbolWidth = Max(myMaxSymbolWidth, anAdvanceX); + myMaxSymbolWidth = std::max(myMaxSymbolWidth, anAdvanceX); } myLastSymbolWidth = myPen.x() - myCorners.Last().x(); } @@ -222,7 +222,7 @@ void Font_TextFormatter::Format() if (HasWrapping()) { // it is not possible to wrap less than symbol width - aMaxLineWidth = Max(aMaxLineWidth, MaximumSymbolWidth()); + aMaxLineWidth = std::max(aMaxLineWidth, MaximumSymbolWidth()); } else { @@ -234,10 +234,10 @@ void Font_TextFormatter::Format() { for (int aLineIt = 0; aLineIt < myNewLines.Size(); aLineIt++) { - aMaxLineWidth = Max(aMaxLineWidth, LineWidth(aLineIt)); + aMaxLineWidth = std::max(aMaxLineWidth, LineWidth(aLineIt)); } // clang-format off - aMaxLineWidth = Max (aMaxLineWidth, LineWidth (myNewLines.Size())); // processing the last line also + aMaxLineWidth = std::max(aMaxLineWidth, LineWidth (myNewLines.Size())); // processing the last line also // clang-format on } } @@ -336,7 +336,7 @@ Standard_Boolean Font_TextFormatter::GlyphBoundingBox(const Standard_Integer the } const NCollection_Vec2& aNextLeftCorner = BottomLeft(theIndex + 1); - if (Abs(aLeftCorner.y() - aNextLeftCorner.y()) < Precision::Confusion()) // in the same row + if (std::abs(aLeftCorner.y() - aNextLeftCorner.y()) < Precision::Confusion()) // in the same row { theBndBox.Right = aNextLeftCorner.x(); } @@ -371,7 +371,7 @@ Standard_Boolean Font_TextFormatter::IsLFSymbol(const Standard_Integer theIndex) return Standard_False; } - return Abs(aBndBox.Right - aBndBox.Left) < Precision::Confusion(); + return std::abs(aBndBox.Right - aBndBox.Left) < Precision::Confusion(); } //================================================================================================= @@ -417,7 +417,7 @@ Standard_Integer Font_TextFormatter::LineIndex(const Standard_Integer theIndex) return 0; } - return (Standard_Integer)Abs((BottomLeft(theIndex).y() + myAscender) / myLineSpacing); + return (Standard_Integer)std::abs((BottomLeft(theIndex).y() + myAscender) / myLineSpacing); } //================================================================================================= diff --git a/src/Visualization/TKService/GTests/Graphic3d_BndBox_Test.cxx b/src/Visualization/TKService/GTests/Graphic3d_BndBox_Test.cxx index 9cc8b25cc8..a1717c8ae4 100644 --- a/src/Visualization/TKService/GTests/Graphic3d_BndBox_Test.cxx +++ b/src/Visualization/TKService/GTests/Graphic3d_BndBox_Test.cxx @@ -192,12 +192,12 @@ TEST(Graphic3d_BndBox3dTest, TransformationRotation) Standard_Real aPrecision = Precision::Confusion(); - EXPECT_TRUE(Abs(aCornerMin.x() - -1) < aPrecision) << "Xmin should be rotated"; - EXPECT_TRUE(Abs(aCornerMin.y() - 1) < aPrecision) << "Ymin should be rotated"; - EXPECT_TRUE(Abs(aCornerMin.z() - 0) < aPrecision) << "Zmin should remain unchanged"; - EXPECT_TRUE(Abs(aCornerMax.x() - 0) < aPrecision) << "Xmax should be rotated"; - EXPECT_TRUE(Abs(aCornerMax.y() - 2) < aPrecision) << "Ymax should be rotated"; - EXPECT_TRUE(Abs(aCornerMax.z() - 1) < aPrecision) << "Zmax should remain unchanged"; + EXPECT_TRUE(std::abs(aCornerMin.x() - -1) < aPrecision) << "Xmin should be rotated"; + EXPECT_TRUE(std::abs(aCornerMin.y() - 1) < aPrecision) << "Ymin should be rotated"; + EXPECT_TRUE(std::abs(aCornerMin.z() - 0) < aPrecision) << "Zmin should remain unchanged"; + EXPECT_TRUE(std::abs(aCornerMax.x() - 0) < aPrecision) << "Xmax should be rotated"; + EXPECT_TRUE(std::abs(aCornerMax.y() - 2) < aPrecision) << "Ymax should be rotated"; + EXPECT_TRUE(std::abs(aCornerMax.z() - 1) < aPrecision) << "Zmax should remain unchanged"; } TEST(Graphic3d_BndBox3dTest, TransformationComposed) @@ -226,17 +226,17 @@ TEST(Graphic3d_BndBox3dTest, TransformationComposed) Graphic3d_Vec3d(-45.09248805040103, 87.9443412035472, -20.487612688573407); Standard_Real aPrecision = 0.00001; // Acceptable error for this test case - EXPECT_TRUE(Abs(aResultCornerMin.x() - anExpectedCornerMin.x()) < aPrecision) + EXPECT_TRUE(std::abs(aResultCornerMin.x() - anExpectedCornerMin.x()) < aPrecision) << "Xmin should match expected after composed transformation"; - EXPECT_TRUE(Abs(aResultCornerMin.y() - anExpectedCornerMin.y()) < aPrecision) + EXPECT_TRUE(std::abs(aResultCornerMin.y() - anExpectedCornerMin.y()) < aPrecision) << "Ymin should match expected after composed transformation"; - EXPECT_TRUE(Abs(aResultCornerMin.z() - anExpectedCornerMin.z()) < aPrecision) + EXPECT_TRUE(std::abs(aResultCornerMin.z() - anExpectedCornerMin.z()) < aPrecision) << "Zmin should match expected after composed transformation"; - EXPECT_TRUE(Abs(aResultCornerMax.x() - anExpectedCornerMax.x()) < aPrecision) + EXPECT_TRUE(std::abs(aResultCornerMax.x() - anExpectedCornerMax.x()) < aPrecision) << "Xmax should match expected after composed transformation"; - EXPECT_TRUE(Abs(aResultCornerMax.y() - anExpectedCornerMax.y()) < aPrecision) + EXPECT_TRUE(std::abs(aResultCornerMax.y() - anExpectedCornerMax.y()) < aPrecision) << "Ymax should match expected after composed transformation"; - EXPECT_TRUE(Abs(aResultCornerMax.z() - anExpectedCornerMax.z()) < aPrecision) + EXPECT_TRUE(std::abs(aResultCornerMax.z() - anExpectedCornerMax.z()) < aPrecision) << "Zmax should match expected after composed transformation"; } diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_ArrayOfPrimitives.hxx b/src/Visualization/TKService/Graphic3d/Graphic3d_ArrayOfPrimitives.hxx index 15ecc1711a..7cc5f719d8 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_ArrayOfPrimitives.hxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_ArrayOfPrimitives.hxx @@ -426,7 +426,7 @@ public: Standard_Byte(theB * 255.0), 255); } - myAttribs->NbElements = Max(theIndex, myAttribs->NbElements); + myAttribs->NbElements = (std::max)(theIndex, myAttribs->NbElements); } //! Change the vertex color in the array. @@ -442,7 +442,7 @@ public: myColData + myColStride * ((Standard_Size)theIndex - 1)); (*aColorPtr) = theColor; } - myAttribs->NbElements = Max(theIndex, myAttribs->NbElements); + myAttribs->NbElements = (std::max)(theIndex, myAttribs->NbElements); } //! Change the vertex color in the array. @@ -490,7 +490,7 @@ public: aVec.y() = Standard_ShortReal(theNY); aVec.z() = Standard_ShortReal(theNZ); } - myAttribs->NbElements = Max(theIndex, myAttribs->NbElements); + myAttribs->NbElements = (std::max)(theIndex, myAttribs->NbElements); } //! Change the vertex texel in the array. @@ -518,7 +518,7 @@ public: aVec.x() = Standard_ShortReal(theTX); aVec.y() = Standard_ShortReal(theTY); } - myAttribs->NbElements = Max(theIndex, myAttribs->NbElements); + myAttribs->NbElements = (std::max)(theIndex, myAttribs->NbElements); } //! Returns the vertice from the vertex table if defined. @@ -926,7 +926,7 @@ public: //! @name optional array of Bounds/Subgroups within primitive array (e.g aVec.g() = Standard_ShortReal(theG); aVec.b() = Standard_ShortReal(theB); aVec.a() = 1.0f; - myBounds->NbBounds = Max(theIndex, myBounds->NbBounds); + myBounds->NbBounds = (std::max)(theIndex, myBounds->NbBounds); } protected: //! @name protected constructors diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_ArrayOfQuadrangleStrips.hxx b/src/Visualization/TKService/Graphic3d/Graphic3d_ArrayOfQuadrangleStrips.hxx index 506b37daab..fa0ab2fb26 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_ArrayOfQuadrangleStrips.hxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_ArrayOfQuadrangleStrips.hxx @@ -45,7 +45,7 @@ public: //! .... //! myArray->AddVertex (x8, y8, z8); //! @endcode - //! The number of quadrangle really drawn is: VertexNumber()/2 - Min(1, BoundNumber()). + //! The number of quadrangle really drawn is: VertexNumber()/2 - std::min(1, BoundNumber()). //! @param theMaxVertexs defines the maximum allowed vertex number in the array //! @param theMaxStrips defines the maximum allowed strip number in the array //! @param theArrayFlags array flags diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_ArrayOfTriangleFans.hxx b/src/Visualization/TKService/Graphic3d/Graphic3d_ArrayOfTriangleFans.hxx index e613b69ceb..95706e3256 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_ArrayOfTriangleFans.hxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_ArrayOfTriangleFans.hxx @@ -43,7 +43,7 @@ public: //! .... //! myArray->AddVertex (x8, y8, z8); //! @endcode - //! The number of triangle really drawn is: VertexNumber() - 2 * Min(1, BoundNumber()) + //! The number of triangle really drawn is: VertexNumber() - 2 * std::min(1, BoundNumber()) //! @param theMaxVertexs defines the maximum allowed vertex number in the array //! @param theMaxFans defines the maximum allowed fan number in the array //! @param theArrayFlags array flags diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_ArrayOfTriangleStrips.hxx b/src/Visualization/TKService/Graphic3d/Graphic3d_ArrayOfTriangleStrips.hxx index fe73905bb9..b7d9bf0cc4 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_ArrayOfTriangleStrips.hxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_ArrayOfTriangleStrips.hxx @@ -45,7 +45,7 @@ public: //! @endcode //! @param theMaxVertexs defines the maximum allowed vertex number in the array //! @param theMaxStrips defines the maximum allowed strip number in the array; - //! the number of triangle really drawn is: VertexNumber() - 2 * Min(1, + //! the number of triangle really drawn is: VertexNumber() - 2 * std::min(1, //! BoundNumber()) //! @param theArrayFlags array flags Graphic3d_ArrayOfTriangleStrips(Standard_Integer theMaxVertexs, @@ -62,7 +62,7 @@ public: //! Creates an array of triangle strips (Graphic3d_TOPA_TRIANGLESTRIPS). //! @param theMaxVertexs defines the maximum allowed vertex number in the array //! @param theMaxStrips defines the maximum allowed strip number in the array; - //! the number of triangle really drawn is: VertexNumber() - 2 * Min(1, + //! the number of triangle really drawn is: VertexNumber() - 2 * std::min(1, //! BoundNumber()) //! @param theHasVNormals when TRUE, AddVertex(Point,Normal), AddVertex(Point,Normal,Color) or //! AddVertex(Point,Normal,Texel) should be used to specify vertex normal; diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_BufferRange.hxx b/src/Visualization/TKService/Graphic3d/Graphic3d_BufferRange.hxx index 7ea50fabc0..ccd9a20e19 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_BufferRange.hxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_BufferRange.hxx @@ -63,8 +63,8 @@ struct Graphic3d_BufferRange return; } - const Standard_Integer aStart = Min(Start, theRange.Start); - const Standard_Integer aLast = Max(Upper(), theRange.Upper()); + const Standard_Integer aStart = (std::min)(Start, theRange.Start); + const Standard_Integer aLast = (std::max)(Upper(), theRange.Upper()); Start = aStart; Length = aLast - aStart + 1; } diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_CLight.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_CLight.cxx index 43f1955ecf..540832b31e 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_CLight.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_CLight.cxx @@ -173,9 +173,10 @@ void Graphic3d_CLight::SetDirection(const gp_Dir& theDir) && myType != Graphic3d_TypeOfLightSource_Directional, "Graphic3d_CLight::SetDirection(), incorrect light type"); updateRevisionIf( - Abs(myDirection.x() - static_cast(theDir.X())) > ShortRealEpsilon() - || Abs(myDirection.y() - static_cast(theDir.Y())) > ShortRealEpsilon() - || Abs(myDirection.z() - static_cast(theDir.Z())) > ShortRealEpsilon()); + std::abs(myDirection.x() - static_cast(theDir.X())) > ShortRealEpsilon() + || std::abs(myDirection.y() - static_cast(theDir.Y())) > ShortRealEpsilon() + || std::abs(myDirection.z() - static_cast(theDir.Z())) + > ShortRealEpsilon()); myDirection.x() = static_cast(theDir.X()); myDirection.y() = static_cast(theDir.Y()); @@ -209,7 +210,7 @@ void Graphic3d_CLight::SetIntensity(Standard_ShortReal theValue) { Standard_OutOfRange_Raise_if(theValue <= 0.0f, "Graphic3d_CLight::SetIntensity(), Negative value for intensity"); - updateRevisionIf(Abs(myIntensity - theValue) > ShortRealEpsilon()); + updateRevisionIf(std::abs(myIntensity - theValue) > ShortRealEpsilon()); myIntensity = theValue; } @@ -221,7 +222,7 @@ void Graphic3d_CLight::SetAngle(Standard_ShortReal theAngle) "Graphic3d_CLight::SetAngle(), incorrect light type"); Standard_OutOfRange_Raise_if(theAngle <= 0.0 || theAngle >= M_PI, "Graphic3d_CLight::SetAngle(), bad angle"); - updateRevisionIf(Abs(changeAngle() - theAngle) > ShortRealEpsilon()); + updateRevisionIf(std::abs(changeAngle() - theAngle) > ShortRealEpsilon()); changeAngle() = theAngle; } @@ -236,8 +237,9 @@ void Graphic3d_CLight::SetAttenuation(Standard_ShortReal theConstAttenuation, Standard_OutOfRange_Raise_if(theConstAttenuation < 0.0f || theLinearAttenuation < 0.0f || theConstAttenuation + theLinearAttenuation == 0.0f, "Graphic3d_CLight::SetAttenuation(), bad coefficient"); - updateRevisionIf(Abs(changeConstAttenuation() - theConstAttenuation) > ShortRealEpsilon() - || Abs(changeLinearAttenuation() - theLinearAttenuation) > ShortRealEpsilon()); + updateRevisionIf(std::abs(changeConstAttenuation() - theConstAttenuation) > ShortRealEpsilon() + || std::abs(changeLinearAttenuation() - theLinearAttenuation) + > ShortRealEpsilon()); changeConstAttenuation() = theConstAttenuation; changeLinearAttenuation() = theLinearAttenuation; } @@ -250,7 +252,7 @@ void Graphic3d_CLight::SetConcentration(Standard_ShortReal theConcentration) "Graphic3d_CLight::SetConcentration(), incorrect light type"); Standard_OutOfRange_Raise_if(theConcentration < 0.0f || theConcentration > 1.0f, "Graphic3d_CLight::SetConcentration(), bad coefficient"); - updateRevisionIf(Abs(changeConcentration() - theConcentration) > ShortRealEpsilon()); + updateRevisionIf(std::abs(changeConcentration() - theConcentration) > ShortRealEpsilon()); changeConcentration() = theConcentration; } @@ -264,7 +266,7 @@ void Graphic3d_CLight::SetSmoothRadius(Standard_ShortReal theValue) Standard_OutOfRange_Raise_if( theValue < 0.0f, "Graphic3d_CLight::SetSmoothRadius(), Bad value for smoothing radius"); - updateRevisionIf(Abs(mySmoothness - theValue) > ShortRealEpsilon()); + updateRevisionIf(std::abs(mySmoothness - theValue) > ShortRealEpsilon()); mySmoothness = theValue; } @@ -276,7 +278,7 @@ void Graphic3d_CLight::SetSmoothAngle(Standard_ShortReal theValue) "Graphic3d_CLight::SetSmoothAngle(), incorrect light type"); Standard_OutOfRange_Raise_if(theValue < 0.0f || theValue > Standard_ShortReal(M_PI / 2.0), "Graphic3d_CLight::SetSmoothAngle(), Bad value for smoothing angle"); - updateRevisionIf(Abs(mySmoothness - theValue) > ShortRealEpsilon()); + updateRevisionIf(std::abs(mySmoothness - theValue) > ShortRealEpsilon()); mySmoothness = theValue; } @@ -289,7 +291,7 @@ void Graphic3d_CLight::SetRange(Standard_ShortReal theValue) "Graphic3d_CLight::SetRange(), incorrect light type"); Standard_OutOfRange_Raise_if(theValue < 0.0, "Graphic3d_CLight::SetRange(), Bad value for falloff range"); - updateRevisionIf(Abs(Range() - theValue) > ShortRealEpsilon()); + updateRevisionIf(std::abs(Range() - theValue) > ShortRealEpsilon()); myDirection.w() = theValue; }; diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_CView.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_CView.cxx index d79534b014..555bd28bdf 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_CView.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_CView.cxx @@ -271,7 +271,7 @@ void Graphic3d_CView::SubviewResized(const Handle(Aspect_NeutralWindow)& theWind } else if ((mySubviewCorner & Aspect_TOTP_RIGHT) != 0) { - mySubviewTopLeft.x() = Max(aWinSize.x() - anOffset.x() - aViewSize.x(), 0); + mySubviewTopLeft.x() = std::max(aWinSize.x() - anOffset.x() - aViewSize.x(), 0); } if ((mySubviewCorner & Aspect_TOTP_TOP) != 0) @@ -280,16 +280,16 @@ void Graphic3d_CView::SubviewResized(const Handle(Aspect_NeutralWindow)& theWind } else if ((mySubviewCorner & Aspect_TOTP_BOTTOM) != 0) { - mySubviewTopLeft.y() = Max(aWinSize.y() - anOffset.y() - aViewSize.y(), 0); + mySubviewTopLeft.y() = std::max(aWinSize.y() - anOffset.y() - aViewSize.y(), 0); } mySubviewTopLeft += mySubviewMargins; aViewSize -= mySubviewMargins * 2; - const int aRight = Min(mySubviewTopLeft.x() + aViewSize.x(), aWinSize.x()); + const int aRight = std::min(mySubviewTopLeft.x() + aViewSize.x(), aWinSize.x()); aViewSize.x() = aRight - mySubviewTopLeft.x(); - const int aBot = Min(mySubviewTopLeft.y() + aViewSize.y(), aWinSize.y()); + const int aBot = std::min(mySubviewTopLeft.y() + aViewSize.y(), aWinSize.y()); aViewSize.y() = aBot - mySubviewTopLeft.y(); theWindow->SetSize(aViewSize.x(), aViewSize.y()); @@ -577,11 +577,11 @@ Standard_Real Graphic3d_CView::ConsiderZoomPersistenceObjects() aLayerIter.Next()) { const Handle(Graphic3d_Layer)& aLayer = aLayerIter.Value(); - aMaxCoef = Max(aMaxCoef, - aLayer->considerZoomPersistenceObjects(Identification(), - aCamera, - aWinSize.x(), - aWinSize.y())); + aMaxCoef = std::max(aMaxCoef, + aLayer->considerZoomPersistenceObjects(Identification(), + aCamera, + aWinSize.x(), + aWinSize.y())); } return aMaxCoef; @@ -641,11 +641,12 @@ Bnd_Box Graphic3d_CView::MinMaxValues(const Graphic3d_MapOfStructure& theSet, // To prevent float overflow at camera parameters calculation and further // rendering, bounding boxes with at least one vertex coordinate out of // float range are skipped by view fit algorithms - if (Abs(aBox.CornerMax().X()) >= ShortRealLast() || Abs(aBox.CornerMax().Y()) >= ShortRealLast() - || Abs(aBox.CornerMax().Z()) >= ShortRealLast() - || Abs(aBox.CornerMin().X()) >= ShortRealLast() - || Abs(aBox.CornerMin().Y()) >= ShortRealLast() - || Abs(aBox.CornerMin().Z()) >= ShortRealLast()) + if (std::abs(aBox.CornerMax().X()) >= ShortRealLast() + || std::abs(aBox.CornerMax().Y()) >= ShortRealLast() + || std::abs(aBox.CornerMax().Z()) >= ShortRealLast() + || std::abs(aBox.CornerMin().X()) >= ShortRealLast() + || std::abs(aBox.CornerMin().Y()) >= ShortRealLast() + || std::abs(aBox.CornerMin().Z()) >= ShortRealLast()) { continue; } @@ -1441,8 +1442,9 @@ void Graphic3d_CView::DiagnosticInformation(TColStd_IndexedDataMapOfStringString myXRSession->GetString(Aspect_XRSession::InfoString_SerialNumber); TCollection_AsciiString aDisplay = TCollection_AsciiString() + myXRSession->RecommendedViewport().x() + "x" - + myXRSession->RecommendedViewport().y() + "@" + (int)Round(myXRSession->DisplayFrequency()) - + " [FOVy: " + (int)Round(myXRSession->FieldOfView()) + "]"; + + myXRSession->RecommendedViewport().y() + "@" + + (int)std::round(myXRSession->DisplayFrequency()) + + " [FOVy: " + (int)std::round(myXRSession->FieldOfView()) + "]"; theDict.ChangeFromIndex(theDict.Add("VRvendor", aVendor)) = aVendor; theDict.ChangeFromIndex(theDict.Add("VRdevice", aDevice)) = aDevice; diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_Camera.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_Camera.cxx index eb2dcd92f6..26628f2eb2 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_Camera.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_Camera.cxx @@ -49,14 +49,14 @@ static Standard_Real zEpsilon() // relative z-range tolerance compatible with for floating point. static Standard_Real zEpsilon(const Standard_Real theValue) { - Standard_Real anAbsValue = Abs(theValue); + Standard_Real anAbsValue = std::abs(theValue); if (anAbsValue <= (double)FLT_MIN) { return FLT_MIN; } - Standard_Real aLogRadix = Log10(anAbsValue) / Log10(FLT_RADIX); - Standard_Real aExp = Floor(aLogRadix); - return FLT_EPSILON * Pow(FLT_RADIX, aExp); + Standard_Real aLogRadix = std::log10(anAbsValue) / std::log10(FLT_RADIX); + Standard_Real aExp = std::floor(aLogRadix); + return FLT_EPSILON * std::pow(FLT_RADIX, aExp); } //! Convert camera definition to Ax3 @@ -82,7 +82,7 @@ Graphic3d_Camera::Graphic3d_Camera() myFOVy(45.0), myFOVx(45.0), myFOV2d(180.0), - myFOVyTan(Tan(DTR_HALF * 45.0)), + myFOVyTan(std::tan(DTR_HALF * 45.0)), myZNear(DEFAULT_ZNEAR), myZFar(DEFAULT_ZFAR), myAspect(1.0), @@ -111,7 +111,7 @@ Graphic3d_Camera::Graphic3d_Camera(const Handle(Graphic3d_Camera)& theOther) myFOVy(45.0), myFOVx(45.0), myFOV2d(180.0), - myFOVyTan(Tan(DTR_HALF * 45.0)), + myFOVyTan(std::tan(DTR_HALF * 45.0)), myZNear(DEFAULT_ZNEAR), myZFar(DEFAULT_ZFAR), myAspect(1.0), @@ -421,7 +421,7 @@ void Graphic3d_Camera::SetFOVy(const Standard_Real theFOVy) myFOVy = theFOVy; myFOVx = theFOVy * myAspect; - myFOVyTan = Tan(DTR_HALF * myFOVy); + myFOVyTan = std::tan(DTR_HALF * myFOVy); InvalidateProjection(); } @@ -561,11 +561,11 @@ static Graphic3d_Vec4d safePointCast(const gp_Pnt& thePnt) // have to deal with values greater then max float gp_Pnt aSafePoint = thePnt; const Standard_Real aBigFloat = aLim * 0.1f; - if (Abs(aSafePoint.X()) > aLim) + if (std::abs(aSafePoint.X()) > aLim) aSafePoint.SetX(aSafePoint.X() >= 0 ? aBigFloat : -aBigFloat); - if (Abs(aSafePoint.Y()) > aLim) + if (std::abs(aSafePoint.Y()) > aLim) aSafePoint.SetY(aSafePoint.Y() >= 0 ? aBigFloat : -aBigFloat); - if (Abs(aSafePoint.Z()) > aLim) + if (std::abs(aSafePoint.Z()) > aLim) aSafePoint.SetZ(aSafePoint.Z() >= 0 ? aBigFloat : -aBigFloat); // convert point @@ -762,7 +762,7 @@ void Graphic3d_Camera::Frustum(gp_Pln& theLeft, gp_Vec aDirTop = -anUp; if (!IsOrthographic()) { - Standard_Real aHFOVHor = ATan(Tan(DTR_HALF * FOVy()) * Aspect()); + Standard_Real aHFOVHor = std::atan(std::tan(DTR_HALF * FOVy()) * Aspect()); Standard_Real aHFOVVer = DTR_HALF * FOVy(); aDirLeft.Rotate(gp_Ax1(gp::Origin(), anUp), aHFOVHor); aDirRight.Rotate(gp_Ax1(gp::Origin(), anUp), -aHFOVHor); @@ -1345,10 +1345,10 @@ bool Graphic3d_Camera::FitMinMax(const Bnd_Box& theBox, // 4) Determine new zooming in view space. // 1. Determine normalized projection asymmetry (if any). - Standard_Real anAssymX = Tan((aCamSide).Angle(aFrustumPlane[1].Axis().Direction())) - - Tan((-aCamSide).Angle(aFrustumPlane[2].Axis().Direction())); - Standard_Real anAssymY = Tan((aCamUp).Angle(aFrustumPlane[3].Axis().Direction())) - - Tan((-aCamUp).Angle(aFrustumPlane[4].Axis().Direction())); + Standard_Real anAssymX = std::tan((aCamSide).Angle(aFrustumPlane[1].Axis().Direction())) + - std::tan((-aCamSide).Angle(aFrustumPlane[2].Axis().Direction())); + Standard_Real anAssymY = std::tan((aCamUp).Angle(aFrustumPlane[3].Axis().Direction())) + - std::tan((-aCamUp).Angle(aFrustumPlane[4].Axis().Direction())); // 2. Determine how far should be the frustum planes placed from center // of bounding box, in order to match the bounding box closely. @@ -1363,7 +1363,7 @@ bool Graphic3d_Camera::FitMinMax(const Bnd_Box& theBox, Standard_Real& aFitDist = aFitDistance[anI]; for (Standard_Integer aJ = aBndCorner.Lower(); aJ <= aBndCorner.Upper(); ++aJ) { - aFitDist = Max(aFitDist, gp_Vec(aBndCenter, aBndCorner[aJ]).Dot(aPlaneN)); + aFitDist = std::max(aFitDist, gp_Vec(aBndCenter, aBndCorner[aJ]).Dot(aPlaneN)); } } // The center of camera is placed on the same line with center of bounding box. @@ -1382,13 +1382,18 @@ bool Graphic3d_Camera::FitMinMax(const Bnd_Box& theBox, // \// // // // (frustum plane) - aFitDistance[1] *= Sqrt(1 + Pow(Tan(aCamSide.Angle(aFrustumPlane[1].Axis().Direction())), 2.0)); + aFitDistance[1] *= + std::sqrt(1 + std::pow(std::tan(aCamSide.Angle(aFrustumPlane[1].Axis().Direction())), 2.0)); aFitDistance[2] *= - Sqrt(1 + Pow(Tan((-aCamSide).Angle(aFrustumPlane[2].Axis().Direction())), 2.0)); - aFitDistance[3] *= Sqrt(1 + Pow(Tan(aCamUp.Angle(aFrustumPlane[3].Axis().Direction())), 2.0)); - aFitDistance[4] *= Sqrt(1 + Pow(Tan((-aCamUp).Angle(aFrustumPlane[4].Axis().Direction())), 2.0)); - aFitDistance[5] *= Sqrt(1 + Pow(Tan(aCamDir.Angle(aFrustumPlane[5].Axis().Direction())), 2.0)); - aFitDistance[6] *= Sqrt(1 + Pow(Tan((-aCamDir).Angle(aFrustumPlane[6].Axis().Direction())), 2.0)); + std::sqrt(1 + std::pow(std::tan((-aCamSide).Angle(aFrustumPlane[2].Axis().Direction())), 2.0)); + aFitDistance[3] *= + std::sqrt(1 + std::pow(std::tan(aCamUp.Angle(aFrustumPlane[3].Axis().Direction())), 2.0)); + aFitDistance[4] *= + std::sqrt(1 + std::pow(std::tan((-aCamUp).Angle(aFrustumPlane[4].Axis().Direction())), 2.0)); + aFitDistance[5] *= + std::sqrt(1 + std::pow(std::tan(aCamDir.Angle(aFrustumPlane[5].Axis().Direction())), 2.0)); + aFitDistance[6] *= + std::sqrt(1 + std::pow(std::tan((-aCamDir).Angle(aFrustumPlane[6].Axis().Direction())), 2.0)); Standard_Real aViewSizeXv = aFitDistance[1] + aFitDistance[2]; Standard_Real aViewSizeYv = aFitDistance[3] + aFitDistance[4]; @@ -1426,11 +1431,11 @@ bool Graphic3d_Camera::FitMinMax(const Bnd_Box& theBox, const Standard_Real anAspect = Aspect(); if (anAspect > 1.0) { - SetScale(Max(aViewSizeXv / anAspect, aViewSizeYv)); + SetScale(std::max(aViewSizeXv / anAspect, aViewSizeYv)); } else { - SetScale(Max(aViewSizeXv, aViewSizeYv * anAspect)); + SetScale(std::max(aViewSizeXv, aViewSizeYv * anAspect)); } return true; } @@ -1526,8 +1531,8 @@ bool Graphic3d_Camera::ZFitAll(const Standard_Real theScaleFactor, // be absent). Standard_Real& aChangeMinDist = aCounter >= 8 ? aModelMinDist : aGraphMinDist; Standard_Real& aChangeMaxDist = aCounter >= 8 ? aModelMaxDist : aGraphMaxDist; - aChangeMinDist = Min(aDistance, aChangeMinDist); - aChangeMaxDist = Max(aDistance, aChangeMaxDist); + aChangeMinDist = std::min(aDistance, aChangeMinDist); + aChangeMaxDist = std::max(aDistance, aChangeMaxDist); aCounter++; } @@ -1644,7 +1649,7 @@ void Graphic3d_Camera::Interpolate(const Handle(Graphic3d_Camera)& theStart, const double theT, Handle(Graphic3d_Camera)& theCamera) { - if (Abs(theT - 1.0) < Precision::Confusion()) + if (std::abs(theT - 1.0) < Precision::Confusion()) { // just copy end-point transformation theCamera->Copy(theEnd); @@ -1652,7 +1657,7 @@ void Graphic3d_Camera::Interpolate(const Handle(Graphic3d_Camera)& theStart, } theCamera->Copy(theStart); - if (Abs(theT - 0.0) < Precision::Confusion()) + if (std::abs(theT - 0.0) < Precision::Confusion()) { return; } @@ -1713,7 +1718,7 @@ void Graphic3d_Camera::Interpolate(const Handle(Graphic3d_Camera)& theStart, } // apply scaling - if (Abs(theStart->Scale() - theEnd->Scale()) > Precision::Confusion() + if (std::abs(theStart->Scale() - theEnd->Scale()) > Precision::Confusion() && theStart->IsOrthographic()) { const Standard_Real aScale = diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_Camera.hxx b/src/Visualization/TKService/Graphic3d/Graphic3d_Camera.hxx index 83a3b91c3f..b508f2abe3 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_Camera.hxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_Camera.hxx @@ -788,7 +788,7 @@ private: Standard_Real myFOVy; //!< Field Of View in y axis. Standard_Real myFOVx; //!< Field Of View in x axis. Standard_Real myFOV2d; //!< Field Of View limit for 2d on-screen elements - Standard_Real myFOVyTan; //!< Field Of View as Tan(DTR_HALF * myFOVy) + Standard_Real myFOVyTan; //!< Field Of View as std::tan(DTR_HALF * myFOVy) Standard_Real myZNear; //!< Distance to near clipping plane. Standard_Real myZFar; //!< Distance to far clipping plane. Standard_Real myAspect; //!< Width to height display ratio. diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_CameraTile.hxx b/src/Visualization/TKService/Graphic3d/Graphic3d_CameraTile.hxx index b4d7de73b7..facd923a46 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_CameraTile.hxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_CameraTile.hxx @@ -60,11 +60,11 @@ public: return aTile; } - aTile.Offset.x() = Max(Offset.x(), 0); - aTile.Offset.y() = Max(Offset.y(), 0); + aTile.Offset.x() = (std::max)(Offset.x(), 0); + aTile.Offset.y() = (std::max)(Offset.y(), 0); - const Standard_Integer anX = Min(Offset.x() + TileSize.x(), TotalSize.x()); - const Standard_Integer anY = Min(Offset.y() + TileSize.y(), TotalSize.y()); + const Standard_Integer anX = (std::min)(Offset.x() + TileSize.x(), TotalSize.x()); + const Standard_Integer anY = (std::min)(Offset.y() + TileSize.y(), TotalSize.y()); aTile.TileSize.x() = anX - Offset.x(); aTile.TileSize.y() = anY - Offset.y(); return aTile; diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_CullingTool.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_CullingTool.cxx index f654b0b04c..6117ea7a1e 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_CullingTool.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_CullingTool.cxx @@ -60,8 +60,8 @@ void Graphic3d_CullingTool::SetViewVolume(const Handle(Graphic3d_Camera)& theCam myCamScale = theCamera->IsOrthographic() ? theCamera->Scale() : 2.0 - * Tan(theCamera->FOVy() * M_PI - / 360.0); // same as theCamera->Scale()/theCamera->Distance() + * std::tan(theCamera->FOVy() * M_PI + / 360.0); // same as theCamera->Scale()/theCamera->Distance() // Compute frustum points theCamera->FrustumPoints(myClipVerts, theModelWorld); @@ -106,7 +106,8 @@ void Graphic3d_CullingTool::SetViewportSize(Standard_Integer theViewportWidth, { myViewportHeight = theViewportHeight > 0 ? theViewportHeight : 1; myViewportWidth = theViewportWidth > 0 ? theViewportWidth : 1; - myPixelSize = Max(theResolutionRatio / myViewportHeight, theResolutionRatio / myViewportWidth); + myPixelSize = + std::max(theResolutionRatio / myViewportHeight, theResolutionRatio / myViewportWidth); } //================================================================================================= @@ -167,8 +168,8 @@ void Graphic3d_CullingTool::CacheClipPtsProjections() ++aCornerIter) { Standard_Real aProjection = myClipVerts[aCornerIter].Dot(myClipPlanes[aPlaneIter].Normal); - aMaxProj = Max(aProjection, aMaxProj); - aMinProj = Min(aProjection, aMinProj); + aMaxProj = std::max(aProjection, aMaxProj); + aMinProj = std::min(aProjection, aMinProj); } myMaxClipProjectionPts[aPlaneIter] = aMaxProj; myMinClipProjectionPts[aPlaneIter] = aMinProj; @@ -186,8 +187,8 @@ void Graphic3d_CullingTool::CacheClipPtsProjections() ++aCornerIter) { Standard_Real aProjection = myClipVerts[aCornerIter].Dot(anAxes[aDim]); - aMaxProj = Max(aProjection, aMaxProj); - aMinProj = Min(aProjection, aMinProj); + aMaxProj = std::max(aProjection, aMaxProj); + aMinProj = std::min(aProjection, aMinProj); } myMaxOrthoProjectionPts[aDim] = aMaxProj; myMinOrthoProjectionPts[aDim] = aMinProj; diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_FrameStats.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_FrameStats.cxx index f4c110ba14..684fbff7ae 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_FrameStats.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_FrameStats.cxx @@ -682,7 +682,7 @@ void Graphic3d_FrameStats::FrameStart(const Handle(Graphic3d_CView)& theView, } const Standard_Integer aNbFrames = - Max(!theView.IsNull() ? theView->RenderingParams().StatsNbFrames : 1, 1); + std::max(!theView.IsNull() ? theView->RenderingParams().StatsNbFrames : 1, 1); if (myCounters.Size() != aNbFrames) { myCounters.Resize(0, aNbFrames - 1, false); diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_FrameStatsData.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_FrameStatsData.cxx index 471209d88c..3448491455 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_FrameStatsData.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_FrameStatsData.cxx @@ -118,10 +118,10 @@ void Graphic3d_FrameStatsData::Reset() void Graphic3d_FrameStatsData::FillMax(const Graphic3d_FrameStatsData& theOther) { - myFps = Max(myFps, theOther.myFps); - myFpsCpu = Max(myFpsCpu, theOther.myFpsCpu); - myFpsImmediate = Max(myFpsImmediate, theOther.myFpsImmediate); - myFpsCpuImmediate = Max(myFpsCpuImmediate, theOther.myFpsCpuImmediate); + myFps = std::max(myFps, theOther.myFps); + myFpsCpu = std::max(myFpsCpu, theOther.myFpsCpu); + myFpsImmediate = std::max(myFpsImmediate, theOther.myFpsImmediate); + myFpsCpuImmediate = std::max(myFpsCpuImmediate, theOther.myFpsCpuImmediate); for (size_t aCounterIter = 0; aCounterIter < myCounters.size(); ++aCounterIter) { myCounters[aCounterIter] = myCounters[aCounterIter] > theOther.myCounters[aCounterIter] @@ -130,8 +130,8 @@ void Graphic3d_FrameStatsData::FillMax(const Graphic3d_FrameStatsData& theOther) } for (size_t aTimerIter = 0; aTimerIter < myTimers.size(); ++aTimerIter) { - myTimersMax[aTimerIter] = Max(myTimersMax[aTimerIter], theOther.myTimersMax[aTimerIter]); - myTimersMin[aTimerIter] = Min(myTimersMin[aTimerIter], theOther.myTimersMin[aTimerIter]); + myTimersMax[aTimerIter] = std::max(myTimersMax[aTimerIter], theOther.myTimersMax[aTimerIter]); + myTimersMin[aTimerIter] = std::min(myTimersMin[aTimerIter], theOther.myTimersMin[aTimerIter]); myTimers[aTimerIter] = myTimersMax[aTimerIter]; } } @@ -151,8 +151,8 @@ void Graphic3d_FrameStatsDataTmp::FlushTimers(Standard_Size theNbFrames, bool th for (size_t aTimerIter = 0; aTimerIter < myTimers.size(); ++aTimerIter) { const Standard_Real aFrameTime = myTimers[aTimerIter] - myTimersPrev[aTimerIter]; - myTimersMax[aTimerIter] = Max(myTimersMax[aTimerIter], aFrameTime); - myTimersMin[aTimerIter] = Min(myTimersMin[aTimerIter], aFrameTime); + myTimersMax[aTimerIter] = std::max(myTimersMax[aTimerIter], aFrameTime); + myTimersMin[aTimerIter] = std::min(myTimersMin[aTimerIter], aFrameTime); myTimersPrev[aTimerIter] = myTimers[aTimerIter]; } diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_Layer.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_Layer.cxx index 9999456708..f5fe7cd0c4 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_Layer.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_Layer.cxx @@ -44,8 +44,8 @@ void Graphic3d_Layer::Add(const Graphic3d_CStructure* theStruct, Graphic3d_DisplayPriority thePriority, Standard_Boolean isForChangePriority) { - const Standard_Integer anIndex = - Min(Max(thePriority, Graphic3d_DisplayPriority_Bottom), Graphic3d_DisplayPriority_Topmost); + const Standard_Integer anIndex = std::min(std::max(thePriority, Graphic3d_DisplayPriority_Bottom), + Graphic3d_DisplayPriority_Topmost); if (theStruct == NULL) { return; @@ -152,12 +152,12 @@ inline Graphic3d_BndBox3d centerOfinfiniteBndBox(const Graphic3d_BndBox3d& theBn //! Return true if at least one vertex coordinate out of float range. inline bool isInfiniteBndBox(const Graphic3d_BndBox3d& theBndBox) { - return Abs(theBndBox.CornerMax().x()) >= ShortRealLast() - || Abs(theBndBox.CornerMax().y()) >= ShortRealLast() - || Abs(theBndBox.CornerMax().z()) >= ShortRealLast() - || Abs(theBndBox.CornerMin().x()) >= ShortRealLast() - || Abs(theBndBox.CornerMin().y()) >= ShortRealLast() - || Abs(theBndBox.CornerMin().z()) >= ShortRealLast(); + return std::abs(theBndBox.CornerMax().x()) >= ShortRealLast() + || std::abs(theBndBox.CornerMax().y()) >= ShortRealLast() + || std::abs(theBndBox.CornerMax().z()) >= ShortRealLast() + || std::abs(theBndBox.CornerMin().x()) >= ShortRealLast() + || std::abs(theBndBox.CornerMin().y()) >= ShortRealLast() + || std::abs(theBndBox.CornerMin().z()) >= ShortRealLast(); } //! Extend bounding box with another box. @@ -388,18 +388,18 @@ Standard_Real Graphic3d_Layer::considerZoomPersistenceObjects( { aConvertedPoints[anIdx] = theCamera->Project(aPoints[anIdx]); - aConvertedMinX = Min(aConvertedMinX, aConvertedPoints[anIdx].X()); - aConvertedMaxX = Max(aConvertedMaxX, aConvertedPoints[anIdx].X()); + aConvertedMinX = std::min(aConvertedMinX, aConvertedPoints[anIdx].X()); + aConvertedMaxX = std::max(aConvertedMaxX, aConvertedPoints[anIdx].X()); - aConvertedMinY = Min(aConvertedMinY, aConvertedPoints[anIdx].Y()); - aConvertedMaxY = Max(aConvertedMaxY, aConvertedPoints[anIdx].Y()); + aConvertedMinY = std::min(aConvertedMinY, aConvertedPoints[anIdx].Y()); + aConvertedMaxY = std::max(aConvertedMaxY, aConvertedPoints[anIdx].Y()); } const Standard_Boolean isBigObject = - (Abs(aConvertedMaxX - aConvertedMinX) + (std::abs(aConvertedMaxX - aConvertedMinX) > 2.0) // width of zoom pers. object greater than width of window // clang-format off - || (Abs (aConvertedMaxY - aConvertedMinY) > 2.0); // height of zoom pers. object greater than height of window + || (std::abs (aConvertedMaxY - aConvertedMinY) > 2.0); // height of zoom pers. object greater than height of window // clang-format on const Standard_Boolean isAlreadyInScreen = (aConvertedMinX > -1.0 && aConvertedMinX < 1.0) && (aConvertedMaxX > -1.0 && aConvertedMaxX < 1.0) @@ -447,15 +447,15 @@ Standard_Real Graphic3d_Layer::considerZoomPersistenceObjects( : (aConvertedMaxY - 1.0)); } - const Standard_Real aDifX = Abs(aConvertedTPPoint.X()) - aShiftX; - const Standard_Real aDifY = Abs(aConvertedTPPoint.Y()) - aShiftY; + const Standard_Real aDifX = std::abs(aConvertedTPPoint.X()) - aShiftX; + const Standard_Real aDifY = std::abs(aConvertedTPPoint.Y()) - aShiftY; if (aDifX > Precision::Confusion()) { - aMaxCoef = Max(aMaxCoef, Abs(aConvertedTPPoint.X()) / aDifX); + aMaxCoef = std::max(aMaxCoef, std::abs(aConvertedTPPoint.X()) / aDifX); } if (aDifY > Precision::Confusion()) { - aMaxCoef = Max(aMaxCoef, Abs(aConvertedTPPoint.Y()) / aDifY); + aMaxCoef = std::max(aMaxCoef, std::abs(aConvertedTPPoint.Y()) / aDifY); } } } diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_MarkerImage.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_MarkerImage.cxx index 1661ff9fee..c255bc122f 100755 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_MarkerImage.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_MarkerImage.cxx @@ -102,15 +102,15 @@ static Handle(Image_PixMap) mergeImages(const Handle(Image_PixMap)& theImage1, aHeight2 = (Standard_Integer)theImage2->Height(); } - const Standard_Integer aMaxWidth = Max(aWidth1, aWidth2); - const Standard_Integer aMaxHeight = Max(aHeight1, aHeight2); - const Standard_Integer aSize = Max(aMaxWidth, aMaxHeight); + const Standard_Integer aMaxWidth = std::max(aWidth1, aWidth2); + const Standard_Integer aMaxHeight = std::max(aHeight1, aHeight2); + const Standard_Integer aSize = std::max(aMaxWidth, aMaxHeight); aResultImage->InitZero(Image_Format_Alpha, aSize, aSize); if (!theImage1.IsNull()) { - const Standard_Integer aXOffset1 = Abs(aWidth1 - aMaxWidth) / 2; - const Standard_Integer anYOffset1 = Abs(aHeight1 - aMaxHeight) / 2; + const Standard_Integer aXOffset1 = std::abs(aWidth1 - aMaxWidth) / 2; + const Standard_Integer anYOffset1 = std::abs(aHeight1 - aMaxHeight) / 2; for (Standard_Integer anY = 0; anY < aHeight1; anY++) { Standard_Byte* anImageLine = theImage1->ChangeRow(anY); @@ -124,8 +124,8 @@ static Handle(Image_PixMap) mergeImages(const Handle(Image_PixMap)& theImage1, if (!theImage2.IsNull()) { - const Standard_Integer aXOffset2 = Abs(aWidth2 - aMaxWidth) / 2; - const Standard_Integer anYOffset2 = Abs(aHeight2 - aMaxHeight) / 2; + const Standard_Integer aXOffset2 = std::abs(aWidth2 - aMaxWidth) / 2; + const Standard_Integer anYOffset2 = std::abs(aHeight2 - aMaxHeight) / 2; for (Standard_Integer anY = 0; anY < aHeight2; anY++) { Standard_Byte* anImageLine = theImage2->ChangeRow(anY); @@ -310,7 +310,7 @@ const Handle(Image_PixMap)& Graphic3d_MarkerImage::GetImage() // to store bitmap in a square image, so the image will not be stretched // when rendering with point sprites. const Standard_Integer aNumOfBytesInRow = myWidth / 8 + (myWidth % 8 ? 1 : 0); - const Standard_Integer aSize = Max(myWidth, myHeight); + const Standard_Integer aSize = std::max(myWidth, myHeight); const Standard_Integer aRowOffset = (aSize - myHeight) / 2 + myMargin; const Standard_Integer aColumnOffset = (aSize - myWidth) / 2 + myMargin; const Standard_Integer aLowerIndex = myBitMap->Lower(); @@ -483,7 +483,7 @@ Handle(Graphic3d_MarkerImage) Graphic3d_MarkerImage::StandardMarker( NCollection_Vec4 aColor(theColor); - const Standard_Integer aSize = Max(aWidth + 2, aHeight + 2); // includes extra margin + const Standard_Integer aSize = std::max(aWidth + 2, aHeight + 2); // includes extra margin Handle(Image_PixMap) anImage = new Image_PixMap(); Handle(Image_PixMap) anImageA = new Image_PixMap(); anImage->InitZero(Image_Format_RGBA, aSize, aSize); diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_ShaderObject.cxx b/src/Visualization/TKService/Graphic3d/Graphic3d_ShaderObject.cxx index 7e7219124b..05659adace 100755 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_ShaderObject.cxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_ShaderObject.cxx @@ -131,8 +131,8 @@ Handle(Graphic3d_ShaderObject) Graphic3d_ShaderObject::CreateFromSource( { if ((aVar.Stages & aStageIter) != 0) { - aStageLower = Min(aStageLower, aStageIter); - aStageUpper = Max(aStageUpper, aStageIter); + aStageLower = std::min(aStageLower, aStageIter); + aStageUpper = std::max(aStageUpper, aStageIter); } } if ((Standard_Integer)theType < aStageLower || (Standard_Integer)theType > aStageUpper) diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_TransformPers.hxx b/src/Visualization/TKService/Graphic3d/Graphic3d_TransformPers.hxx index 464513ca0a..12e335b78f 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_TransformPers.hxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_TransformPers.hxx @@ -270,7 +270,7 @@ public: gp_Pnt(myParams.Params3d.PntX, myParams.Params3d.PntY, myParams.Params3d.PntZ)); const Standard_Real aFocus = aVecToObj.Dot(aVecToEye); const gp_XYZ aViewDim = theCamera->ViewDimensions(aFocus); - return Abs(aViewDim.Y()) / Standard_Real(aVPSizeY); + return std::abs(aViewDim.Y()) / Standard_Real(aVPSizeY); } //! Create orientation matrix based on camera and view dimensions. @@ -400,7 +400,7 @@ public: // scale factor to pixels const gp_XYZ aViewDim = aProxyCamera->ViewDimensions(aFocus); - const Standard_Real aScale = Abs(aViewDim.Y()) / Standard_Real(aVPSizeY); + const Standard_Real aScale = std::abs(aViewDim.Y()) / Standard_Real(aVPSizeY); const gp_Dir aForward = aProxyCamera->Direction(); gp_XYZ aCenter = aProxyCamera->Center().XYZ() + aForward.XYZ() * (aFocus - aProxyCamera->Distance()); @@ -410,7 +410,7 @@ public: (Standard_Real(myParams.Params2d.OffsetX) + aJitterComp) * aScale; const gp_Dir aSide = aForward.Crossed(aProxyCamera->Up()); const gp_XYZ aDeltaX = - aSide.XYZ() * (Abs(aViewDim.X()) * aProxyCamera->NDC2dOffsetX() - anOffsetX); + aSide.XYZ() * (std::abs(aViewDim.X()) * aProxyCamera->NDC2dOffsetX() - anOffsetX); if ((myParams.Params2d.Corner & Aspect_TOTP_RIGHT) != 0) { aCenter += aDeltaX; @@ -425,7 +425,8 @@ public: const Standard_Real anOffsetY = (Standard_Real(myParams.Params2d.OffsetY) + aJitterComp) * aScale; const gp_XYZ aDeltaY = - aProxyCamera->Up().XYZ() * (Abs(aViewDim.Y()) * aProxyCamera->NDC2dOffsetY() - anOffsetY); + aProxyCamera->Up().XYZ() + * (std::abs(aViewDim.Y()) * aProxyCamera->NDC2dOffsetY() - anOffsetY); if ((myParams.Params2d.Corner & Aspect_TOTP_TOP) != 0) { aCenter += aDeltaY; @@ -453,7 +454,7 @@ public: // scale factor to pixels const gp_XYZ aViewDim = aProxyCamera->ViewDimensions(aFocus); - const Standard_Real aScale = Abs(aViewDim.Y()) / Standard_Real(aVPSizeY); + const Standard_Real aScale = std::abs(aViewDim.Y()) / Standard_Real(aVPSizeY); gp_XYZ aCenter(0.0, 0.0, -aFocus); if ((myParams.Params2d.Corner & (Aspect_TOTP_LEFT | Aspect_TOTP_RIGHT)) != 0) { diff --git a/src/Visualization/TKService/Graphic3d/Graphic3d_TransformUtils.hxx b/src/Visualization/TKService/Graphic3d/Graphic3d_TransformUtils.hxx index 7f06f64faa..c46788d19a 100644 --- a/src/Visualization/TKService/Graphic3d/Graphic3d_TransformUtils.hxx +++ b/src/Visualization/TKService/Graphic3d/Graphic3d_TransformUtils.hxx @@ -127,7 +127,7 @@ static Standard_Real ScaleFactor(const NCollection_Mat4& theMatrix) { // The determinant of the matrix should give the scale factor (cubed). const T aDeterminant = theMatrix.DeterminantMat3(); - return Pow(static_cast(aDeterminant), 1.0 / 3.0); + return std::pow(static_cast(aDeterminant), 1.0 / 3.0); } } // namespace Graphic3d_TransformUtils diff --git a/src/Visualization/TKService/Image/Image_DDSParser.cxx b/src/Visualization/TKService/Image/Image_DDSParser.cxx index 2b30fd7942..f7cef9abc2 100644 --- a/src/Visualization/TKService/Image/Image_DDSParser.cxx +++ b/src/Visualization/TKService/Image/Image_DDSParser.cxx @@ -227,7 +227,7 @@ Handle(Image_CompressedPixMap) Image_DDSParser::parseHeader(const DDSFileHeader& aDef->SetBaseFormat(aBaseFormat); aDef->SetCompressedFormat(aFormat); - const Standard_Integer aNbMipMaps = Max((Standard_Integer)theHeader.MipMapCount, 1); + const Standard_Integer aNbMipMaps = std::max((Standard_Integer)theHeader.MipMapCount, 1); aDef->ChangeMipMaps().Resize(0, aNbMipMaps - 1, false); { Standard_Size aFaceSize = 0; diff --git a/src/Visualization/TKService/Image/Image_Diff.cxx b/src/Visualization/TKService/Image/Image_Diff.cxx index 73a7131893..7c3814ac67 100644 --- a/src/Visualization/TKService/Image/Image_Diff.cxx +++ b/src/Visualization/TKService/Image/Image_Diff.cxx @@ -161,7 +161,7 @@ Standard_Integer Image_Diff::Compare() const Standard_Integer aDiff = Standard_Integer(myImageNew->Value(aRow, aCol)) - Standard_Integer(myImageRef->Value(aRow, aCol)); - if (Abs(aDiff) > aDiffThreshold) + if (std::abs(aDiff) > aDiffThreshold) { myDiffPixels.Append(PackXY((uint16_t)aCol, (uint16_t)aRow)); ++aNbDiffColors; @@ -411,8 +411,8 @@ Standard_Integer Image_Diff::ignoreBorderEffect() for (Standard_Integer aPixelId2 = aPixelId1 + 1; aPixelId2 < myDiffPixels.Length(); ++aPixelId2) { Standard_Integer aValue2 = myDiffPixels.Value(aPixelId2); - if (Abs(Standard_Integer(UnpackX(aValue1)) - Standard_Integer(UnpackX(aValue2))) <= 1 - && Abs(Standard_Integer(UnpackY(aValue1)) - Standard_Integer(UnpackY(aValue2))) <= 1) + if (std::abs(Standard_Integer(UnpackX(aValue1)) - Standard_Integer(UnpackX(aValue2))) <= 1 + && std::abs(Standard_Integer(UnpackY(aValue1)) - Standard_Integer(UnpackY(aValue2))) <= 1) { // A neighbour is found. Create a new group and add both pixels. if (myGroupsOfDiffPixels.IsEmpty()) diff --git a/src/Visualization/TKService/Media/Media_FormatContext.cxx b/src/Visualization/TKService/Media/Media_FormatContext.cxx index 6be277e23e..a12b224557 100644 --- a/src/Visualization/TKService/Media/Media_FormatContext.cxx +++ b/src/Visualization/TKService/Media/Media_FormatContext.cxx @@ -258,8 +258,8 @@ bool Media_FormatContext::OpenInput(const TCollection_AsciiString& theInput) for (unsigned int aStreamId = 0; aStreamId < myFormatCtx->nb_streams; ++aStreamId) { const AVStream& aStream = *myFormatCtx->streams[aStreamId]; - myPtsStartBase = Min(myPtsStartBase, StreamUnitsToSeconds(aStream, aStream.start_time)); - myDuration = Max(myDuration, StreamUnitsToSeconds(aStream, aStream.duration)); + myPtsStartBase = std::min(myPtsStartBase, StreamUnitsToSeconds(aStream, aStream.start_time)); + myDuration = std::max(myDuration, StreamUnitsToSeconds(aStream, aStream.duration)); } } diff --git a/src/Visualization/TKService/WNT/WNT_Window.cxx b/src/Visualization/TKService/WNT/WNT_Window.cxx index 376e7abc96..563de7de3d 100644 --- a/src/Visualization/TKService/WNT/WNT_Window.cxx +++ b/src/Visualization/TKService/WNT/WNT_Window.cxx @@ -316,19 +316,19 @@ Aspect_TypeOfResize WNT_Window::DoResize() } int aMask = 0; - if (Abs((int)aPlace.rcNormalPosition.left - myXLeft) > 2) + if (std::abs((int)aPlace.rcNormalPosition.left - myXLeft) > 2) { aMask |= 1; } - if (Abs((int)aPlace.rcNormalPosition.right - myXRight) > 2) + if (std::abs((int)aPlace.rcNormalPosition.right - myXRight) > 2) { aMask |= 2; } - if (Abs((int)aPlace.rcNormalPosition.top - myYTop) > 2) + if (std::abs((int)aPlace.rcNormalPosition.top - myYTop) > 2) { aMask |= 4; } - if (Abs((int)aPlace.rcNormalPosition.bottom - myYBottom) > 2) + if (std::abs((int)aPlace.rcNormalPosition.bottom - myYBottom) > 2) { aMask |= 8; } diff --git a/src/Visualization/TKService/Xw/Xw_Window.cxx b/src/Visualization/TKService/Xw/Xw_Window.cxx index 68de4bb186..befaae9ff8 100644 --- a/src/Visualization/TKService/Xw/Xw_Window.cxx +++ b/src/Visualization/TKService/Xw/Xw_Window.cxx @@ -256,13 +256,13 @@ Aspect_TypeOfResize Xw_Window::DoResize() Standard_Integer aMask = 0; Aspect_TypeOfResize aMode = Aspect_TOR_UNKNOWN; - if (Abs(aWinAttr.x - myXLeft) > 2) + if (std::abs(aWinAttr.x - myXLeft) > 2) aMask |= 1; - if (Abs((aWinAttr.x + aWinAttr.width) - myXRight) > 2) + if (std::abs((aWinAttr.x + aWinAttr.width) - myXRight) > 2) aMask |= 2; - if (Abs(aWinAttr.y - myYTop) > 2) + if (std::abs(aWinAttr.y - myYTop) > 2) aMask |= 4; - if (Abs((aWinAttr.y + aWinAttr.height) - myYBottom) > 2) + if (std::abs((aWinAttr.y + aWinAttr.height) - myYBottom) > 2) aMask |= 8; switch (aMask) { diff --git a/src/Visualization/TKV3d/AIS/AIS_Animation.cxx b/src/Visualization/TKV3d/AIS/AIS_Animation.cxx index a1b83fb07d..a2de639aa8 100644 --- a/src/Visualization/TKV3d/AIS/AIS_Animation.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_Animation.cxx @@ -143,7 +143,7 @@ void AIS_Animation::UpdateTotalDuration() anIter.Next()) { myChildrenDuration = - Max(myChildrenDuration, anIter.Value()->StartPts() + anIter.Value()->Duration()); + std::max(myChildrenDuration, anIter.Value()->StartPts() + anIter.Value()->Duration()); } } @@ -233,7 +233,7 @@ void AIS_Animation::Stop() { const Standard_Real anElapsedTime = ElapsedTime(); myTimer->Stop(); - myTimer->Seek(Min(Duration(), anElapsedTime)); + myTimer->Seek(std::min(Duration(), anElapsedTime)); } for (NCollection_Sequence::Iterator anIter(myAnimations); anIter.More(); @@ -251,8 +251,8 @@ Standard_Boolean AIS_Animation::Update(const Standard_Real thePts) aPosition.Pts = thePts; aPosition.LocalPts = thePts - myPtsStart; aPosition.LocalNormalized = HasOwnDuration() ? (aPosition.LocalPts / myOwnDuration) : 0.0; - aPosition.LocalNormalized = Max(0.0, aPosition.LocalNormalized); - aPosition.LocalNormalized = Min(1.0, aPosition.LocalNormalized); + aPosition.LocalNormalized = std::max(0.0, aPosition.LocalNormalized); + aPosition.LocalNormalized = std::min(1.0, aPosition.LocalNormalized); updateWithChildren(aPosition); return thePts < myPtsStart + Duration(); } @@ -274,8 +274,8 @@ void AIS_Animation::updateWithChildren(const AIS_AnimationProgress& thePosition) aPosition.LocalPts = aPosition.LocalPts - anAnim->StartPts(); aPosition.LocalNormalized = anAnim->HasOwnDuration() ? (aPosition.LocalPts / anAnim->OwnDuration()) : 0.0; - aPosition.LocalNormalized = Max(0.0, aPosition.LocalNormalized); - aPosition.LocalNormalized = Min(1.0, aPosition.LocalNormalized); + aPosition.LocalNormalized = std::max(0.0, aPosition.LocalNormalized); + aPosition.LocalNormalized = std::min(1.0, aPosition.LocalNormalized); anAnim->updateWithChildren(aPosition); } diff --git a/src/Visualization/TKV3d/AIS/AIS_Animation.hxx b/src/Visualization/TKV3d/AIS/AIS_Animation.hxx index 485542dea8..3ac8c58cf7 100644 --- a/src/Visualization/TKV3d/AIS/AIS_Animation.hxx +++ b/src/Visualization/TKV3d/AIS/AIS_Animation.hxx @@ -95,7 +95,7 @@ public: void SetStartPts(const Standard_Real thePtsStart) { myPtsStart = thePtsStart; } //! @return duration of the animation in the timeline - Standard_Real Duration() const { return Max(myOwnDuration, myChildrenDuration); } + Standard_Real Duration() const { return (std::max)(myOwnDuration, myChildrenDuration); } //! Update total duration considering all animations on timeline. Standard_EXPORT void UpdateTotalDuration(); diff --git a/src/Visualization/TKV3d/AIS/AIS_Circle.cxx b/src/Visualization/TKV3d/AIS/AIS_Circle.cxx index 5df5bbe709..6ab0c0f3b6 100644 --- a/src/Visualization/TKV3d/AIS/AIS_Circle.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_Circle.cxx @@ -57,7 +57,7 @@ AIS_Circle::AIS_Circle(const Handle(Geom_Circle)& theComponent, myComponent(theComponent), myUStart(theUStart), myUEnd(theUEnd), - myCircleIsArc(Abs(Abs(theUEnd - theUStart) - 2.0 * M_PI) > gp::Resolution()), + myCircleIsArc(std::abs(std::abs(theUEnd - theUStart) - 2.0 * M_PI) > gp::Resolution()), myIsFilledCircleSens(theIsFilledCircleSens) { } diff --git a/src/Visualization/TKV3d/AIS/AIS_ColorScale.cxx b/src/Visualization/TKV3d/AIS/AIS_ColorScale.cxx index afea862db2..e708ed5860 100644 --- a/src/Visualization/TKV3d/AIS/AIS_ColorScale.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_ColorScale.cxx @@ -93,17 +93,17 @@ static Standard_Integer colorDiscreteInterval(Standard_Real theValue, Standard_Real theMax, Standard_Integer theNbIntervals) { - if (Abs(theMax - theMin) <= Precision::Approximation()) + if (std::abs(theMax - theMin) <= Precision::Approximation()) { return 1; } Standard_Integer anInterval = 1 - + (Standard_Integer)Floor(Standard_Real(theNbIntervals) * (theValue - theMin) - / (theMax - theMin)); + + (Standard_Integer)std::floor(Standard_Real(theNbIntervals) * (theValue - theMin) + / (theMax - theMin)); // map the very upper value (theValue==theMax) to the largest color interval - anInterval = Min(anInterval, theNbIntervals); + anInterval = std::min(anInterval, theNbIntervals); return anInterval; } } // namespace @@ -205,8 +205,8 @@ void AIS_ColorScale::GetColors(Aspect_SequenceOfColor& theColors) const void AIS_ColorScale::SetRange(const Standard_Real theMin, const Standard_Real theMax) { - myMin = Min(theMin, theMax); - myMax = Max(theMin, theMax); + myMin = std::min(theMin, theMax); + myMax = std::max(theMin, theMax); } //================================================================================================= @@ -282,7 +282,7 @@ Aspect_SequenceOfColor AIS_ColorScale::MakeUniformColors(Standard_Integer theNbC // adjust range to be within (0, 360], with sign according to theHueFrom and theHueTo Standard_Real aHueRange = std::fmod(theHueTo - theHueFrom, 360.); constexpr Standard_Real aHueEps = Precision::Angular() * 180. / M_PI; - if (Abs(aHueRange) <= aHueEps) + if (std::abs(aHueRange) <= aHueEps) { aHueRange = (aHueRange < 0 ? -360. : 360.); } @@ -305,7 +305,7 @@ Aspect_SequenceOfColor AIS_ColorScale::MakeUniformColors(Standard_Integer theNbC } // discretize the range with 1 degree step - const int NBCOLORS = 2 + (int)Abs(aHueRange / 1.); + const int NBCOLORS = 2 + (int)std::abs(aHueRange / 1.); Standard_Real aHueStep = aHueRange / (NBCOLORS - 1); NCollection_Array1 aGrid(0, NBCOLORS - 1); for (Standard_Integer i = 0; i < NBCOLORS; i++) @@ -375,7 +375,7 @@ void AIS_ColorScale::SizeHint(Standard_Integer& theWidth, Standard_Integer& theH for (Standard_Integer aLabIter = (myIsLabelAtBorder ? 0 : 1); aLabIter <= myNbIntervals; ++aLabIter) { - aTextWidth = Max(aTextWidth, TextWidth(GetLabel(aLabIter))); + aTextWidth = std::max(aTextWidth, TextWidth(GetLabel(aLabIter))); } } @@ -391,7 +391,7 @@ void AIS_ColorScale::SizeHint(Standard_Integer& theWidth, Standard_Integer& theH aTitleWidth = TextWidth(myTitle) + mySpacing * 2; } - theWidth = Max(aTitleWidth, aScaleWidth); + theWidth = std::max(aTitleWidth, aScaleWidth); theHeight = aScaleHeight + aTitleHeight; } @@ -414,7 +414,7 @@ Standard_Real AIS_ColorScale::GetIntervalValue(const Standard_Integer theIndex) Standard_Real aNum = 0; if (myNbIntervals > 0) { - aNum = GetMin() + theIndex * (Abs(GetMax() - GetMin()) / myNbIntervals); + aNum = GetMin() + theIndex * (std::abs(GetMax() - GetMin()) / myNbIntervals); } return aNum; } @@ -489,7 +489,7 @@ Standard_Integer AIS_ColorScale::computeMaxLabelWidth( { if (!aLabIter.Value().IsEmpty()) { - aWidthMax = Max(aWidthMax, TextWidth(aLabIter.Value())); + aWidthMax = std::max(aWidthMax, TextWidth(aLabIter.Value())); } } return aWidthMax; @@ -559,7 +559,8 @@ void AIS_ColorScale::Compute(const Handle(PrsMgr_PresentationManager)&, const Standard_Integer aTextWidth = myLabelPos != Aspect_TOCSP_NONE ? computeMaxLabelWidth(aLabels) : 0; - Standard_Integer aColorBreadth = Max(5, Min(20, myBreadth - aTextWidth - 3 * mySpacing)); + Standard_Integer aColorBreadth = + std::max(5, std::min(20, myBreadth - aTextWidth - 3 * mySpacing)); if (myLabelPos == Aspect_TOCSP_CENTER || myLabelPos == Aspect_TOCSP_NONE) { aColorBreadth += aTextWidth; @@ -750,7 +751,7 @@ void AIS_ColorScale::drawLabels(const Handle(Graphic3d_Group)& theGroup !myTitle.IsEmpty() ? (myTextHeight + 2 * mySpacing) : mySpacing; const Standard_Integer aSpc = myHeight - aTitleHeight - - ((Min(aNbLabels, 2) + Abs(aNbLabels - aNbIntervals - 1)) * myTextHeight); + - ((std::min(aNbLabels, 2) + std::abs(aNbLabels - aNbIntervals - 1)) * myTextHeight); if (aSpc <= 0) { return; @@ -819,8 +820,8 @@ void AIS_ColorScale::drawLabels(const Handle(Graphic3d_Group)& theGroup Standard_Integer i0 = -1; while (aPos <= i2 && i0 == -1) { - if (aFilter && !(aPos % aFilter) && Abs(aPos - aLast1) >= aFilter - && Abs(aPos - aLast2) >= aFilter) + if (aFilter && !(aPos % aFilter) && std::abs(aPos - aLast1) >= aFilter + && std::abs(aPos - aLast2) >= aFilter) { i0 = aPos; } diff --git a/src/Visualization/TKV3d/AIS/AIS_InteractiveContext.cxx b/src/Visualization/TKV3d/AIS/AIS_InteractiveContext.cxx index 969247a396..e5bb26861f 100644 --- a/src/Visualization/TKV3d/AIS/AIS_InteractiveContext.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_InteractiveContext.cxx @@ -1763,7 +1763,7 @@ void AIS_InteractiveContext::ClearGlobal(const Handle(AIS_InteractiveObject)& th myDetectedSeq.Remove(aDetIter); if (myCurDetected == aDetIter) { - myCurDetected = Min(myDetectedSeq.Upper(), aDetIter); + myCurDetected = std::min(myDetectedSeq.Upper(), aDetIter); } if (myCurHighlighted == aDetIter) { @@ -1984,7 +1984,7 @@ Standard_Boolean AIS_InteractiveContext::PlaneSize(Standard_Real& theX, Standard { theX = myDefaultDrawer->PlaneAspect()->PlaneXLength(); theY = myDefaultDrawer->PlaneAspect()->PlaneYLength(); - return (Abs(theX - theY) <= Precision::Confusion()); + return (std::abs(theX - theY) <= Precision::Confusion()); } //================================================================================================= diff --git a/src/Visualization/TKV3d/AIS/AIS_LightSource.cxx b/src/Visualization/TKV3d/AIS/AIS_LightSource.cxx index d433299ae3..1aa2505e05 100644 --- a/src/Visualization/TKV3d/AIS/AIS_LightSource.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_LightSource.cxx @@ -808,7 +808,7 @@ void AIS_LightSource::computeSpot(const Handle(Prs3d_Presentation)& thePrs, if (theMode == 0 && myToDisplayRange) { const Standard_ShortReal aHalfAngle = myLightSource->Angle() / 2.0f; - const Standard_Real aRadius = aDistance * Tan(aHalfAngle); + const Standard_Real aRadius = aDistance * std::tan(aHalfAngle); gp_Ax3 aSystem(aLightPos + aLightDir.XYZ() * aDistance, -aLightDir); gp_Trsf aTrsfCone; aTrsfCone.SetTransformation(aSystem, gp_Ax3()); @@ -850,7 +850,7 @@ void AIS_LightSource::ComputeSelection(const Handle(SelectMgr_Selection)& theSel aSensPosition->SetSensitivityFactor(12); if (!myTransformPersistence.IsNull() && myTransformPersistence->IsTrihedronOr2d()) { - aSensPosition->SetSensitivityFactor(Max(12, Standard_Integer(mySize * 0.5))); + aSensPosition->SetSensitivityFactor(std::max(12, Standard_Integer(mySize * 0.5))); } theSel->Add(aSensPosition); } diff --git a/src/Visualization/TKV3d/AIS/AIS_Manipulator.cxx b/src/Visualization/TKV3d/AIS/AIS_Manipulator.cxx index fad803f7e5..df9e2674e6 100644 --- a/src/Visualization/TKV3d/AIS/AIS_Manipulator.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_Manipulator.cxx @@ -372,7 +372,7 @@ void AIS_Manipulator::adjustSize(const Bnd_Box& theBox) Standard_Real aYSize = aYmax - aYmin; Standard_Real aZSize = aZmax - aZmin; - SetSize((Standard_ShortReal)(Max(aXSize, Max(aYSize, aZSize)) * 0.5)); + SetSize((Standard_ShortReal)(std::max(aXSize, std::max(aYSize, aZSize)) * 0.5)); } //================================================================================================= @@ -615,7 +615,7 @@ Standard_Boolean AIS_Manipulator::ObjectTransformation(const Standard_Integer t gp_Dir aCurrentAxis = gce_MakeDir(aPosLoc, aNewPosition); Standard_Real anAngle = aStartAxis.AngleWithRef(aCurrentAxis, aCurrAxis.Direction()); - if (Abs(anAngle) < Precision::Confusion()) + if (std::abs(anAngle) < Precision::Confusion()) { return Standard_False; } @@ -643,7 +643,7 @@ Standard_Boolean AIS_Manipulator::ObjectTransformation(const Standard_Integer t anAspect->SetTransparency(0.5); anAspect->SetColor(myAxes[myCurrentIndex].Color()); - mySector.Init(0.0f, myAxes[myCurrentIndex].InnerRadius(), anAxis, Abs(anAngle)); + mySector.Init(0.0f, myAxes[myCurrentIndex].InnerRadius(), anAxis, std::abs(anAngle)); mySectorGroup->Clear(); mySectorGroup->SetPrimitivesAspect(anAspect->Aspect()); mySectorGroup->AddPrimitiveArray(mySector.Array()); @@ -651,7 +651,7 @@ Standard_Boolean AIS_Manipulator::ObjectTransformation(const Standard_Integer t } // Change value of an angle if it should have different sign. - if (anAngle * myPrevState < 0 && Abs(anAngle) < M_PI_2) + if (anAngle * myPrevState < 0 && std::abs(anAngle) < M_PI_2) { Standard_Real aSign = myPrevState > 0 ? -1.0 : 1.0; anAngle = aSign * (M_PI * 2 - anAngle); @@ -835,9 +835,10 @@ void AIS_Manipulator::RecomputeTransformation(const Handle(Graphic3d_Camera)& th anAxisDir = myPosition.XDirection().Crossed(myPosition.YDirection()); } - const gp_Dir aCameraProj = Abs(Abs(anAxisDir.Dot(aCameraDir)) - 1.0) <= gp::Resolution() - ? aCameraDir - : anAxisDir.Crossed(aCameraDir).Crossed(anAxisDir); + const gp_Dir aCameraProj = + std::abs(std::abs(anAxisDir.Dot(aCameraDir)) - 1.0) <= gp::Resolution() + ? aCameraDir + : anAxisDir.Crossed(aCameraDir).Crossed(anAxisDir); const Standard_Boolean isReversed = anAxisDir.Dot(aCameraDir) > 0; Standard_Real anAngle = aNormal.AngleWithRef(aCameraProj, anAxisDir); if (aRefAxis.Direction().X() > 0) @@ -919,16 +920,16 @@ void AIS_Manipulator::RecomputeTransformation(const Handle(Graphic3d_Camera)& th const gp_Dir aZDir = gp::DZ(); const gp_Dir aCameraProjection = - Abs(aXDir.Dot(aCameraDir)) <= gp::Resolution() - || Abs(anYDir.Dot(aCameraDir)) <= gp::Resolution() + std::abs(aXDir.Dot(aCameraDir)) <= gp::Resolution() + || std::abs(anYDir.Dot(aCameraDir)) <= gp::Resolution() ? aCameraDir : aXDir.XYZ() * (aXDir.Dot(aCameraDir)) + anYDir.XYZ() * (anYDir.Dot(aCameraDir)); const Standard_Boolean isReversed = aZDir.Dot(aCameraDir) > 0; - const Standard_Real anAngle = M_PI_2 - aCameraDir.Angle(aCameraProjection); - gp_Dir aRotAxis = Abs(Abs(aCameraProjection.Dot(aZDir)) - 1.0) <= gp::Resolution() - ? aZDir - : aCameraProjection.Crossed(aZDir); + const Standard_Real anAngle = M_PI_2 - aCameraDir.Angle(aCameraProjection); + gp_Dir aRotAxis = std::abs(std::abs(aCameraProjection.Dot(aZDir)) - 1.0) <= gp::Resolution() + ? aZDir + : aCameraProjection.Crossed(aZDir); if (isReversed) { aRotAxis.Reverse(); @@ -1430,8 +1431,8 @@ void AIS_Manipulator::ComputeSelection(const Handle(SelectMgr_Selection)& theSel // Sensitivity is calculated relative to the default size of the manipulator (100.0f). const Standard_ShortReal aSensitivityCoef = myAxes[0].Size() / 100.0f; // clang-format off - const Standard_Integer aHighSensitivity = Max (Min (RealToInt (aSensitivityCoef * 15), 15), 3); // clamp sensitivity within range [3, 15] - const Standard_Integer aLowSensitivity = Max (Min (RealToInt (aSensitivityCoef * 10), 10), 2); // clamp sensitivity within range [2, 10] + const Standard_Integer aHighSensitivity = std::clamp(static_cast(aSensitivityCoef * 15), 3, 15); // clamp sensitivity within range [3, 15] + const Standard_Integer aLowSensitivity = std::clamp(static_cast(aSensitivityCoef * 10), 2, 10); // clamp sensitivity within range [2, 10] // clang-format on switch (aMode) diff --git a/src/Visualization/TKV3d/AIS/AIS_Plane.cxx b/src/Visualization/TKV3d/AIS/AIS_Plane.cxx index cd53808302..55ee6dd771 100644 --- a/src/Visualization/TKV3d/AIS/AIS_Plane.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_Plane.cxx @@ -380,7 +380,7 @@ Standard_Boolean AIS_Plane::Size(Standard_Real& X, Standard_Real& Y) const { X = myDrawer->PlaneAspect()->PlaneXLength(); Y = myDrawer->PlaneAspect()->PlaneYLength(); - return Abs(X - Y) <= Precision::Confusion(); + return std::abs(X - Y) <= Precision::Confusion(); } //================================================================================================= @@ -395,7 +395,7 @@ void AIS_Plane::SetMinimumSize(const Standard_Real theValue) Standard_Real aX, anY; Size(aX, anY); SetTransformPersistence( - new Graphic3d_TransformPersScaledAbove(Min(aX, anY) / theValue, myCenter)); + new Graphic3d_TransformPersScaledAbove(std::min(aX, anY) / theValue, myCenter)); } //================================================================================================= @@ -497,8 +497,8 @@ void AIS_Plane::ComputeFrame() Handle(Geom_Plane)::DownCast(pl->Translated(pl->Location(), myCenter))); ElSLib::Parameters(thegoodpl->Pln(), myPmin, U, V); - U = 2.4 * Abs(U); - V = 2.4 * Abs(V); + U = 2.4 * std::abs(U); + V = 2.4 * std::abs(V); if (U < 10 * Precision::Confusion()) U = 0.1; if (V < 10 * Precision::Confusion()) diff --git a/src/Visualization/TKV3d/AIS/AIS_TextLabel.cxx b/src/Visualization/TKV3d/AIS/AIS_TextLabel.cxx index 4f27b35c63..f050cdb0cf 100644 --- a/src/Visualization/TKV3d/AIS/AIS_TextLabel.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_TextLabel.cxx @@ -373,8 +373,8 @@ Standard_Boolean AIS_TextLabel::calculateLabelParams(const gp_Pnt& thePosition, const NCollection_String aText(myText.ToExtString()); Font_Rect aBndBox = aFont->BoundingBox(aText, anAsp->HorizontalJustification(), anAsp->VerticalJustification()); - theWidth = Abs(aBndBox.Width()); - theHeight = Abs(aBndBox.Height()); + theWidth = std::abs(aBndBox.Width()); + theHeight = std::abs(aBndBox.Height()); theCenterOfLabel = thePosition; if (anAsp->VerticalJustification() == Graphic3d_VTA_BOTTOM) diff --git a/src/Visualization/TKV3d/AIS/AIS_ViewController.cxx b/src/Visualization/TKV3d/AIS/AIS_ViewController.cxx index d4ab549065..343d135a81 100644 --- a/src/Visualization/TKV3d/AIS/AIS_ViewController.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_ViewController.cxx @@ -419,7 +419,7 @@ void AIS_ViewController::flushGestures(const Handle(AIS_InteractiveContext)&, // rotation const Standard_Real aRotTouchTol = !aTouch.IsPreciseDevice ? aTolScale * myTouchRotationThresholdPx : gp::Resolution(); - if (Abs(aTouch.Delta().x()) + Abs(aTouch.Delta().y()) > aRotTouchTol) + if (std::abs(aTouch.Delta().x()) + std::abs(aTouch.Delta().y()) > aRotTouchTol) { const Standard_Real aRotAccel = myNavigationMode == AIS_NavigationMode_FirstPersonWalk ? myMouseAccel : myOrbitAccel; @@ -484,10 +484,10 @@ void AIS_ViewController::flushGestures(const Handle(AIS_InteractiveContext)&, else { Standard_Real aNumerator = A1 * B2 - A2 * B1; - aRotAngle = ATan(aNumerator / aDenomenator); + aRotAngle = std::atan(aNumerator / aDenomenator); } - if (Abs(aRotAngle) > Standard_Real(myTouchZRotationThreshold)) + if (std::abs(aRotAngle) > Standard_Real(myTouchZRotationThreshold)) { myGL.ZRotate.ToRotate = true; myGL.ZRotate.Angle = aRotAngle; @@ -495,7 +495,7 @@ void AIS_ViewController::flushGestures(const Handle(AIS_InteractiveContext)&, } } - if (Abs(aDeltaSize) > aTolScale * myTouchZoomThresholdPx) + if (std::abs(aDeltaSize) > aTolScale * myTouchZoomThresholdPx) { // zoom aDeltaSize *= Standard_Real(myTouchZoomRatio); @@ -506,7 +506,7 @@ void AIS_ViewController::flushGestures(const Handle(AIS_InteractiveContext)&, const Standard_Real aPanTouchTol = !aFirstTouch.IsPreciseDevice ? aTolScale * myTouchPanThresholdPx : gp::Resolution(); - if (Abs(aPinchCenterXDev) + Abs(aPinchCenterYDev) > aPanTouchTol) + if (std::abs(aPinchCenterXDev) + std::abs(aPinchCenterYDev) > aPanTouchTol) { // pan if (myUpdateStartPointPan) @@ -988,7 +988,7 @@ bool AIS_ViewController::UpdateMousePosition(const Graphic3d_Vec2i& thePoint, const double aRotTol = theIsEmulated ? double(myTouchToleranceScale) * myTouchRotationThresholdPx : 0.0; const Graphic3d_Vec2d aDeltaF(aDelta); - if (Abs(aDeltaF.x()) + Abs(aDeltaF.y()) > aRotTol) + if (std::abs(aDeltaF.x()) + std::abs(aDeltaF.y()) > aRotTol) { const double aRotAccel = myNavigationMode == AIS_NavigationMode_FirstPersonWalk ? myMouseAccel : myOrbitAccel; @@ -1024,7 +1024,7 @@ bool AIS_ViewController::UpdateMousePosition(const Graphic3d_Vec2i& thePoint, theIsEmulated ? double(myTouchToleranceScale) * myTouchZoomThresholdPx : 0.0; const double aScrollDelta = myMouseActiveGesture == AIS_MouseGesture_Zoom ? aDelta.x() : aDelta.y(); - if (Abs(aScrollDelta) > aZoomTol) + if (std::abs(aScrollDelta) > aZoomTol) { if (UpdateZoom(Aspect_ScrollDelta(aScrollDelta))) { @@ -1046,7 +1046,7 @@ bool AIS_ViewController::UpdateMousePosition(const Graphic3d_Vec2i& thePoint, const double aPanTol = theIsEmulated ? double(myTouchToleranceScale) * myTouchPanThresholdPx : 0.0; const Graphic3d_Vec2d aDeltaF(aDelta); - if (Abs(aDeltaF.x()) + Abs(aDeltaF.y()) > aPanTol) + if (std::abs(aDeltaF.x()) + std::abs(aDeltaF.y()) > aPanTol) { if (myUpdateStartPointPan) { @@ -1083,7 +1083,7 @@ bool AIS_ViewController::UpdateMousePosition(const Graphic3d_Vec2i& thePoint, const double aDragTol = theIsEmulated ? double(myTouchToleranceScale) * myTouchDraggingThresholdPx : 0.0; - if (double(Abs(aDelta.x()) + Abs(aDelta.y())) > aDragTol) + if (double(std::abs(aDelta.x()) + std::abs(aDelta.y())) > aDragTol) { const double aRotAccel = myNavigationMode == AIS_NavigationMode_FirstPersonWalk ? myMouseAccel : myOrbitAccel; @@ -1281,7 +1281,7 @@ AIS_WalkDelta AIS_ViewController::FetchNavigationKeys(Standard_Real theCrouchRat updateEventsTime(aPrevEventTime, aNewEventTime); double aDuration = 0.0, aPressure = 1.0; - if (Abs(myThrustSpeed) > gp::Resolution()) + if (std::abs(myThrustSpeed) > gp::Resolution()) { if (myHasThrust) { @@ -1316,7 +1316,7 @@ AIS_WalkDelta AIS_ViewController::FetchNavigationKeys(Standard_Real theCrouchRat : 1.0; if (myKeys.HoldDuration(Aspect_VKey_NavForward, aNewEventTime, aDuration, aPressure)) { - double aProgress = Abs(Min(aMaxDuration, aDuration)); + double aProgress = std::abs(std::min(aMaxDuration, aDuration)); aProgress *= aRunRatio; aWalk.SetDefined(true); aWalk[AIS_WalkTranslation_Forward].Value += aProgress; @@ -1325,7 +1325,7 @@ AIS_WalkDelta AIS_ViewController::FetchNavigationKeys(Standard_Real theCrouchRat } if (myKeys.HoldDuration(Aspect_VKey_NavBackward, aNewEventTime, aDuration, aPressure)) { - double aProgress = Abs(Min(aMaxDuration, aDuration)); + double aProgress = std::abs(std::min(aMaxDuration, aDuration)); aProgress *= aRunRatio; aWalk.SetDefined(true); aWalk[AIS_WalkTranslation_Forward].Value += -aProgress; @@ -1334,7 +1334,7 @@ AIS_WalkDelta AIS_ViewController::FetchNavigationKeys(Standard_Real theCrouchRat } if (myKeys.HoldDuration(Aspect_VKey_NavSlideLeft, aNewEventTime, aDuration, aPressure)) { - double aProgress = Abs(Min(aMaxDuration, aDuration)); + double aProgress = std::abs(std::min(aMaxDuration, aDuration)); aProgress *= aRunRatio; aWalk.SetDefined(true); aWalk[AIS_WalkTranslation_Side].Value = -aProgress; @@ -1343,7 +1343,7 @@ AIS_WalkDelta AIS_ViewController::FetchNavigationKeys(Standard_Real theCrouchRat } if (myKeys.HoldDuration(Aspect_VKey_NavSlideRight, aNewEventTime, aDuration, aPressure)) { - double aProgress = Abs(Min(aMaxDuration, aDuration)); + double aProgress = std::abs(std::min(aMaxDuration, aDuration)); aProgress *= aRunRatio; aWalk.SetDefined(true); aWalk[AIS_WalkTranslation_Side].Value = aProgress; @@ -1352,7 +1352,7 @@ AIS_WalkDelta AIS_ViewController::FetchNavigationKeys(Standard_Real theCrouchRat } if (myKeys.HoldDuration(Aspect_VKey_NavLookLeft, aNewEventTime, aDuration, aPressure)) { - double aProgress = Abs(Min(aMaxDuration, aDuration)) * aPressure; + double aProgress = std::abs(std::min(aMaxDuration, aDuration)) * aPressure; aWalk.SetDefined(true); aWalk[AIS_WalkRotation_Yaw].Value = aProgress; aWalk[AIS_WalkRotation_Yaw].Pressure = aPressure; @@ -1360,7 +1360,7 @@ AIS_WalkDelta AIS_ViewController::FetchNavigationKeys(Standard_Real theCrouchRat } if (myKeys.HoldDuration(Aspect_VKey_NavLookRight, aNewEventTime, aDuration, aPressure)) { - double aProgress = Abs(Min(aMaxDuration, aDuration)) * aPressure; + double aProgress = std::abs(std::min(aMaxDuration, aDuration)) * aPressure; aWalk.SetDefined(true); aWalk[AIS_WalkRotation_Yaw].Value = -aProgress; aWalk[AIS_WalkRotation_Yaw].Pressure = aPressure; @@ -1368,7 +1368,7 @@ AIS_WalkDelta AIS_ViewController::FetchNavigationKeys(Standard_Real theCrouchRat } if (myKeys.HoldDuration(Aspect_VKey_NavLookUp, aNewEventTime, aDuration, aPressure)) { - double aProgress = Abs(Min(aMaxDuration, aDuration)) * aPressure; + double aProgress = std::abs(std::min(aMaxDuration, aDuration)) * aPressure; aWalk.SetDefined(true); aWalk[AIS_WalkRotation_Pitch].Value = !myToInvertPitch ? -aProgress : aProgress; aWalk[AIS_WalkRotation_Pitch].Pressure = aPressure; @@ -1376,7 +1376,7 @@ AIS_WalkDelta AIS_ViewController::FetchNavigationKeys(Standard_Real theCrouchRat } if (myKeys.HoldDuration(Aspect_VKey_NavLookDown, aNewEventTime, aDuration, aPressure)) { - double aProgress = Abs(Min(aMaxDuration, aDuration)) * aPressure; + double aProgress = std::abs(std::min(aMaxDuration, aDuration)) * aPressure; aWalk.SetDefined(true); aWalk[AIS_WalkRotation_Pitch].Value = !myToInvertPitch ? aProgress : -aProgress; aWalk[AIS_WalkRotation_Pitch].Pressure = aPressure; @@ -1384,7 +1384,7 @@ AIS_WalkDelta AIS_ViewController::FetchNavigationKeys(Standard_Real theCrouchRat } if (myKeys.HoldDuration(Aspect_VKey_NavRollCCW, aNewEventTime, aDuration, aPressure)) { - double aProgress = Abs(Min(aMaxDuration, aDuration)) * aPressure; + double aProgress = std::abs(std::min(aMaxDuration, aDuration)) * aPressure; aWalk.SetDefined(true); aWalk[AIS_WalkRotation_Roll].Value = -aProgress; aWalk[AIS_WalkRotation_Roll].Pressure = aPressure; @@ -1392,7 +1392,7 @@ AIS_WalkDelta AIS_ViewController::FetchNavigationKeys(Standard_Real theCrouchRat } if (myKeys.HoldDuration(Aspect_VKey_NavRollCW, aNewEventTime, aDuration, aPressure)) { - double aProgress = Abs(Min(aMaxDuration, aDuration)) * aPressure; + double aProgress = std::abs(std::min(aMaxDuration, aDuration)) * aPressure; aWalk.SetDefined(true); aWalk[AIS_WalkRotation_Roll].Value = aProgress; aWalk[AIS_WalkRotation_Roll].Pressure = aPressure; @@ -1400,7 +1400,7 @@ AIS_WalkDelta AIS_ViewController::FetchNavigationKeys(Standard_Real theCrouchRat } if (myKeys.HoldDuration(Aspect_VKey_NavSlideUp, aNewEventTime, aDuration, aPressure)) { - double aProgress = Abs(Min(aMaxDuration, aDuration)); + double aProgress = std::abs(std::min(aMaxDuration, aDuration)); aWalk.SetDefined(true); aWalk[AIS_WalkTranslation_Up].Value = aProgress; aWalk[AIS_WalkTranslation_Up].Pressure = aPressure; @@ -1408,7 +1408,7 @@ AIS_WalkDelta AIS_ViewController::FetchNavigationKeys(Standard_Real theCrouchRat } if (myKeys.HoldDuration(Aspect_VKey_NavSlideDown, aNewEventTime, aDuration, aPressure)) { - double aProgress = Abs(Min(aMaxDuration, aDuration)); + double aProgress = std::abs(std::min(aMaxDuration, aDuration)); aWalk.SetDefined(true); aWalk[AIS_WalkTranslation_Up].Value = -aProgress; aWalk[AIS_WalkTranslation_Up].Pressure = aPressure; @@ -1507,13 +1507,14 @@ void AIS_ViewController::handleZoom(const Handle(V3d_View)& theView, const Handle(Graphic3d_Camera)& aCam = theView->Camera(); if (thePnt != NULL) { - const double aViewDist = Max(myMinCamDistance, (thePnt->XYZ() - aCam->Eye().XYZ()).Modulus()); + const double aViewDist = + std::max(myMinCamDistance, (thePnt->XYZ() - aCam->Eye().XYZ()).Modulus()); aCam->SetCenter(aCam->Eye().XYZ() + aCam->Direction().XYZ() * aViewDist); } if (!theParams.HasPoint()) { - Standard_Real aCoeff = Abs(theParams.Delta) / 100.0 + 1.0; + Standard_Real aCoeff = std::abs(theParams.Delta) / 100.0 + 1.0; aCoeff = theParams.Delta > 0.0 ? aCoeff : 1.0 / aCoeff; theView->SetZoom(aCoeff, true); theView->Invalidate(); @@ -1525,7 +1526,7 @@ void AIS_ViewController::handleZoom(const Handle(V3d_View)& theView, // theView->StartZoomAtPoint (theParams.Point.x(), theParams.Point.y()); // theView->ZoomAtPoint (0, 0, (int )theParams.Delta, (int )theParams.Delta); - double aDZoom = Abs(theParams.Delta) / 100.0 + 1.0; + double aDZoom = std::abs(theParams.Delta) / 100.0 + 1.0; aDZoom = (theParams.Delta > 0.0) ? aDZoom : 1.0 / aDZoom; if (aDZoom <= 0.0) { @@ -1667,7 +1668,7 @@ void AIS_ViewController::handleOrbitRotation(const Handle(V3d_View)& theView, * (M_PI * 0.5); // Z-up locking: clamp pitch to prevent camera flipping at top/bottom - if (Abs(aPitchAngleDelta) > gp::Resolution()) + if (std::abs(aPitchAngleDelta) > gp::Resolution()) { // Calculate current pitch angle from camera direction (like original Euler) const double aCurrentPitch = asin(-myCamStartOpDir.Z()); // Negative Z for proper orientation @@ -1680,8 +1681,8 @@ void AIS_ViewController::handleOrbitRotation(const Handle(V3d_View)& theView, } // Apply transformations only when needed - const bool hasYaw = Abs(aYawAngleDelta) > Precision::Angular(); - const bool hasPitch = Abs(aPitchAngleDelta) > Precision::Angular(); + const bool hasYaw = std::abs(aYawAngleDelta) > Precision::Angular(); + const bool hasPitch = std::abs(aPitchAngleDelta) > Precision::Angular(); if (hasYaw || hasPitch) { @@ -1801,9 +1802,9 @@ void AIS_ViewController::handleViewRotation(const Handle(V3d_View)& theView, } const Handle(Graphic3d_Camera)& aCam = theView->Camera(); - const bool aRollIsChanged = Abs(theRoll - myCurrentRollAngle) > gp::Resolution(); - const bool toRotateAnyway = - Abs(theYawExtra) > gp::Resolution() || Abs(thePitchExtra) > gp::Resolution() || aRollIsChanged; + const bool aRollIsChanged = std::abs(theRoll - myCurrentRollAngle) > gp::Resolution(); + const bool toRotateAnyway = std::abs(theYawExtra) > gp::Resolution() + || std::abs(thePitchExtra) > gp::Resolution() || aRollIsChanged; // Store old and new roll values for later processing const double anOldRollAngle = myCurrentRollAngle; @@ -1859,8 +1860,8 @@ void AIS_ViewController::handleViewRotation(const Handle(V3d_View)& theView, gp_Dir aBaseUp = myCamStartOpUp; gp_Dir aBaseDir = myCamStartOpDir; - const bool hasYaw = Abs(aYawAngleDelta) > Precision::Angular(); - const bool hasPitch = Abs(aPitchAngleDelta) > Precision::Angular(); + const bool hasYaw = std::abs(aYawAngleDelta) > Precision::Angular(); + const bool hasPitch = std::abs(aPitchAngleDelta) > Precision::Angular(); if (hasYaw || hasPitch) { @@ -2024,8 +2025,8 @@ void AIS_ViewController::FitAllAuto(const Handle(AIS_InteractiveContext)& theCtx theView->FitMinMax(aCameraSel, aBoxSel, aFitMargin); theView->FitMinMax(aCameraAll, aBoxAll, aFitMargin); if (aCameraSel->Center().IsEqual(aCam->Center(), aFitTol) - && Abs(aCameraSel->Scale() - aCam->Scale()) < aFitTol - && Abs(aCameraSel->Distance() - aCam->Distance()) < aFitTol) + && std::abs(aCameraSel->Scale() - aCam->Scale()) < aFitTol + && std::abs(aCameraSel->Distance() - aCam->Distance()) < aFitTol) { // fit all entire view on second FitALL request aCam->Copy(aCameraAll); @@ -2166,7 +2167,8 @@ AIS_WalkDelta AIS_ViewController::handleNavigationKeys(const Handle(AIS_Interact aMin = aBndBox.CornerMin().XYZ(); aMax = aBndBox.CornerMax().XYZ(); } - double aBndDiam = Max(Max(aMax.X() - aMin.X(), aMax.Y() - aMin.Y()), aMax.Z() - aMin.Z()); + double aBndDiam = + std::max(std::max(aMax.X() - aMin.X(), aMax.Y() - aMin.Y()), aMax.Z() - aMin.Z()); if (aBndDiam <= gp::Resolution()) { aBndDiam = 0.001; @@ -2412,7 +2414,7 @@ void AIS_ViewController::handleCameraActions(const Handle(AIS_InteractiveContext if (!theWalk[AIS_WalkRotation_Roll].IsEmpty() && !myToLockOrbitZUp) { aRoll = (M_PI / 12.0) * theWalk[AIS_WalkRotation_Roll].Pressure; - aRoll *= Min(1000.0 * theWalk[AIS_WalkRotation_Roll].Duration, 100.0) / 100.0; + aRoll *= std::min(1000.0 * theWalk[AIS_WalkRotation_Roll].Duration, 100.0) / 100.0; if (theWalk[AIS_WalkRotation_Roll].Value < 0.0) { aRoll = -aRoll; @@ -2516,7 +2518,7 @@ void AIS_ViewController::handleXRTurnPad(const Handle(AIS_InteractiveContext)&, const Aspect_XRAnalogActionData aPadPos = theView->View()->XRSession()->GetAnalogActionData(aPadPosAct); if (aPadClick.IsActive && aPadClick.IsPressed && aPadClick.IsChanged && aPadPos.IsActive - && Abs(aPadPos.VecXYZ.y()) < 0.5f && Abs(aPadPos.VecXYZ.x()) > 0.7f) + && std::abs(aPadPos.VecXYZ.y()) < 0.5f && std::abs(aPadPos.VecXYZ.x()) > 0.7f) { gp_Trsf aTrsfTurn; aTrsfTurn.SetRotation(gp_Ax1(gp::Origin(), theView->View()->BaseXRCamera()->Up()), @@ -2567,7 +2569,7 @@ void AIS_ViewController::handleXRTeleport(const Handle(AIS_InteractiveContext)& const bool isPressed = aPadClick.IsPressed; const bool isClicked = !aPadClick.IsPressed && aPadClick.IsChanged; if (aPadClick.IsActive && (isPressed || isClicked) && aPadPos.IsActive - && aPadPos.VecXYZ.y() > 0.6f && Abs(aPadPos.VecXYZ.x()) < 0.5f) + && aPadPos.VecXYZ.y() > 0.6f && std::abs(aPadPos.VecXYZ.x()) < 0.5f) { const Aspect_TrackedDevicePose& aPose = theView->View()->XRSession()->TrackedPoses()[aDeviceId]; @@ -2692,7 +2694,7 @@ void AIS_ViewController::handleXRPicking(const Handle(AIS_InteractiveContext)& t theView->View()->XRSession()->GetDigitalActionData(aTrigClickAct); const Aspect_XRAnalogActionData aTrigPos = theView->View()->XRSession()->GetAnalogActionData(aTrigPullAct); - if (aTrigPos.IsActive && Abs(aTrigPos.VecXYZ.x()) > 0.1f) + if (aTrigPos.IsActive && std::abs(aTrigPos.VecXYZ.x()) > 0.1f) { myXRLastPickingHand = aRole; handleXRHighlight(theCtx, theView); @@ -3016,10 +3018,11 @@ void AIS_ViewController::handleSelectionPoly(const Handle(AIS_InteractiveContext } else { - theCtx->MainSelector()->AllowOverlapDetection(aPnt1.y() != Min(aPnt1.y(), aPnt2.y())); + theCtx->MainSelector()->AllowOverlapDetection(aPnt1.y() + != std::min(aPnt1.y(), aPnt2.y())); theCtx->SelectRectangle( - Graphic3d_Vec2i(Min(aPnt1.x(), aPnt2.x()), Min(aPnt1.y(), aPnt2.y())), - Graphic3d_Vec2i(Max(aPnt1.x(), aPnt2.x()), Max(aPnt1.y(), aPnt2.y())), + Graphic3d_Vec2i(std::min(aPnt1.x(), aPnt2.x()), std::min(aPnt1.y(), aPnt2.y())), + Graphic3d_Vec2i(std::max(aPnt1.x(), aPnt2.x()), std::max(aPnt1.y(), aPnt2.y())), theView, myGL.Selection.Scheme); theCtx->MainSelector()->AllowOverlapDetection(false); @@ -3443,7 +3446,7 @@ void AIS_ViewController::handleXRPresentations(const Handle(AIS_InteractiveConte const Bnd_Box aViewBox = theView->View()->MinMaxValues(true); if (!aViewBox.IsVoid()) { - aLaserLen = Sqrt(aViewBox.SquareExtent()); + aLaserLen = std::sqrt(aViewBox.SquareExtent()); } else { @@ -3462,7 +3465,7 @@ void AIS_ViewController::handleXRPresentations(const Handle(AIS_InteractiveConte const Bnd_Box aViewBox = theView->View()->MinMaxValues(true); if (!aViewBox.IsVoid()) { - aLaserLen = Sqrt(aViewBox.SquareExtent()); + aLaserLen = std::sqrt(aViewBox.SquareExtent()); } else { diff --git a/src/Visualization/TKV3d/AIS/AIS_ViewCube.cxx b/src/Visualization/TKV3d/AIS/AIS_ViewCube.cxx index afcf49f369..612613da16 100644 --- a/src/Visualization/TKV3d/AIS/AIS_ViewCube.cxx +++ b/src/Visualization/TKV3d/AIS/AIS_ViewCube.cxx @@ -45,7 +45,7 @@ static Standard_Integer nbDirectionComponents(const gp_Dir& theDir) Standard_Integer aNbComps = 0; for (Standard_Integer aCompIter = 1; aCompIter <= 3; ++aCompIter) { - if (Abs(theDir.Coord(aCompIter)) > gp::Resolution()) + if (std::abs(theDir.Coord(aCompIter)) > gp::Resolution()) { ++aNbComps; } @@ -289,7 +289,7 @@ void AIS_ViewCube::ResetStyles() void AIS_ViewCube::SetSize(Standard_Real theValue, Standard_Boolean theToAdaptAnother) { - const bool isNewSize = Abs(mySize - theValue) > Precision::Confusion(); + const bool isNewSize = std::abs(mySize - theValue) > Precision::Confusion(); mySize = theValue; if (theToAdaptAnother) { @@ -315,7 +315,7 @@ void AIS_ViewCube::SetRoundRadius(const Standard_Real theValue) { Standard_OutOfRange_Raise_if(theValue < 0.0 || theValue > 0.5, "AIS_ViewCube::SetRoundRadius(): theValue should be in [0; 0.5]"); - if (Abs(myRoundRadius - theValue) > Precision::Confusion()) + if (std::abs(myRoundRadius - theValue) > Precision::Confusion()) { myRoundRadius = theValue; SetToUpdate(); @@ -331,7 +331,7 @@ void AIS_ViewCube::createRoundRectangleTriangles(const Handle(Graphic3d_ArrayOfT Standard_Real theRadius, const gp_Trsf& theTrsf) { - const Standard_Real aRadius = Min(theRadius, Min(theSize.X(), theSize.Y()) * 0.5); + const Standard_Real aRadius = std::min(theRadius, std::min(theSize.X(), theSize.Y()) * 0.5); const gp_XY aHSize(theSize.X() * 0.5 - aRadius, theSize.Y() * 0.5 - aRadius); const gp_Dir aNorm = gp::DZ().Transformed(theTrsf); const Standard_Integer aVertFirst = !theTris.IsNull() ? theTris->VertexNumber() : 0; @@ -352,9 +352,10 @@ void AIS_ViewCube::createRoundRectangleTriangles(const Handle(Graphic3d_ArrayOfT M_PI * 0.5, 0.0, Standard_Real(aNodeIter) / Standard_Real(THE_NB_ROUND_SPLITS)); - theTris->AddVertex( - gp_Pnt(aHSize.X() + aRadius * Cos(anAngle), aHSize.Y() + aRadius * Sin(anAngle), 0.0) - .Transformed(theTrsf)); + theTris->AddVertex(gp_Pnt(aHSize.X() + aRadius * std::cos(anAngle), + aHSize.Y() + aRadius * std::sin(anAngle), + 0.0) + .Transformed(theTrsf)); } for (Standard_Integer aNodeIter = 0; aNodeIter <= THE_NB_ROUND_SPLITS; ++aNodeIter) { @@ -362,9 +363,10 @@ void AIS_ViewCube::createRoundRectangleTriangles(const Handle(Graphic3d_ArrayOfT 0.0, -M_PI * 0.5, Standard_Real(aNodeIter) / Standard_Real(THE_NB_ROUND_SPLITS)); - theTris->AddVertex( - gp_Pnt(aHSize.X() + aRadius * Cos(anAngle), -aHSize.Y() + aRadius * Sin(anAngle), 0.0) - .Transformed(theTrsf)); + theTris->AddVertex(gp_Pnt(aHSize.X() + aRadius * std::cos(anAngle), + -aHSize.Y() + aRadius * std::sin(anAngle), + 0.0) + .Transformed(theTrsf)); } for (Standard_Integer aNodeIter = 0; aNodeIter <= THE_NB_ROUND_SPLITS; ++aNodeIter) { @@ -372,9 +374,10 @@ void AIS_ViewCube::createRoundRectangleTriangles(const Handle(Graphic3d_ArrayOfT -M_PI * 0.5, -M_PI, Standard_Real(aNodeIter) / Standard_Real(THE_NB_ROUND_SPLITS)); - theTris->AddVertex( - gp_Pnt(-aHSize.X() + aRadius * Cos(anAngle), -aHSize.Y() + aRadius * Sin(anAngle), 0.0) - .Transformed(theTrsf)); + theTris->AddVertex(gp_Pnt(-aHSize.X() + aRadius * std::cos(anAngle), + -aHSize.Y() + aRadius * std::sin(anAngle), + 0.0) + .Transformed(theTrsf)); } for (Standard_Integer aNodeIter = 0; aNodeIter <= THE_NB_ROUND_SPLITS; ++aNodeIter) { @@ -382,9 +385,10 @@ void AIS_ViewCube::createRoundRectangleTriangles(const Handle(Graphic3d_ArrayOfT -M_PI, -M_PI * 1.5, Standard_Real(aNodeIter) / Standard_Real(THE_NB_ROUND_SPLITS)); - theTris->AddVertex( - gp_Pnt(-aHSize.X() + aRadius * Cos(anAngle), aHSize.Y() + aRadius * Sin(anAngle), 0.0) - .Transformed(theTrsf)); + theTris->AddVertex(gp_Pnt(-aHSize.X() + aRadius * std::cos(anAngle), + aHSize.Y() + aRadius * std::sin(anAngle), + 0.0) + .Transformed(theTrsf)); } // split triangle fan @@ -465,11 +469,12 @@ void AIS_ViewCube::createBoxEdgeTriangles(const Handle(Graphic3d_ArrayOfTriangle V3d_TypeOfOrientation theDirection) const { const Standard_Real aThickness = - Max(myBoxFacetExtension * gp_XY(1.0, 1.0).Modulus() - myBoxEdgeGap, myBoxEdgeMinSize); + std::max(myBoxFacetExtension * gp_XY(1.0, 1.0).Modulus() - myBoxEdgeGap, myBoxEdgeMinSize); const gp_Dir aDir = V3d::GetProjAxis(theDirection); const gp_Pnt aPos = - aDir.XYZ() * (mySize * 0.5 * gp_XY(1.0, 1.0).Modulus() + myBoxFacetExtension * Cos(M_PI_4)); + aDir.XYZ() + * (mySize * 0.5 * gp_XY(1.0, 1.0).Modulus() + myBoxFacetExtension * std::cos(M_PI_4)); const gp_Ax2 aPosition(aPos, aDir.Reversed()); gp_Ax3 aSystem(aPosition); @@ -505,13 +510,14 @@ void AIS_ViewCube::createBoxCornerTriangles(const Handle(Graphic3d_ArrayOfTriang } const Standard_Real anEdgeHWidth = myBoxFacetExtension * gp_XY(1.0, 1.0).Modulus() * 0.5; - const Standard_Real aHeight = anEdgeHWidth * Sqrt(2.0 / 3.0); // tetrahedron height + const Standard_Real aHeight = anEdgeHWidth * std::sqrt(2.0 / 3.0); // tetrahedron height const gp_Pnt aPos = aDir.XYZ() * (aHSize * gp_Vec(1.0, 1.0, 1.0).Magnitude() + aHeight); const gp_Ax2 aPosition(aPos, aDir.Reversed()); gp_Ax3 aSystem(aPosition); gp_Trsf aTrsf; aTrsf.SetTransformation(aSystem, gp_Ax3()); - const Standard_Real aRadius = Max(myBoxFacetExtension * 0.5 / Cos(M_PI_4), myCornerMinSize); + const Standard_Real aRadius = + std::max(myBoxFacetExtension * 0.5 / std::cos(M_PI_4), myCornerMinSize); theTris->AddVertex(gp_Pnt(0.0, 0.0, 0.0).Transformed(aTrsf)); for (Standard_Integer aNodeIter = 0; aNodeIter < THE_NB_DISK_SLICES; ++aNodeIter) @@ -521,7 +527,7 @@ void AIS_ViewCube::createBoxCornerTriangles(const Handle(Graphic3d_ArrayOfTriang 0.0, Standard_Real(aNodeIter) / Standard_Real(THE_NB_DISK_SLICES)); theTris->AddVertex( - gp_Pnt(aRadius * Cos(anAngle), aRadius * Sin(anAngle), 0.0).Transformed(aTrsf)); + gp_Pnt(aRadius * std::cos(anAngle), aRadius * std::sin(anAngle), 0.0).Transformed(aTrsf)); } theTris->AddTriangleFanEdges(aVertFirst + 1, theTris->VertexNumber(), true); } diff --git a/src/Visualization/TKV3d/AIS/AIS_ViewCube.hxx b/src/Visualization/TKV3d/AIS/AIS_ViewCube.hxx index 19d340a0f6..7f1fe14e1e 100644 --- a/src/Visualization/TKV3d/AIS/AIS_ViewCube.hxx +++ b/src/Visualization/TKV3d/AIS/AIS_ViewCube.hxx @@ -123,7 +123,7 @@ public: //! @name Geometry management API //! Set new value of box facet extension. void SetBoxFacetExtension(Standard_Real theValue) { - if (Abs(myBoxFacetExtension - theValue) > Precision::Confusion()) + if (std::abs(myBoxFacetExtension - theValue) > Precision::Confusion()) { myBoxFacetExtension = theValue; SetToUpdate(); @@ -136,7 +136,7 @@ public: //! @name Geometry management API //! Set new value of padding between axes and 3D part (box). void SetAxesPadding(Standard_Real theValue) { - if (Abs(myAxesPadding - theValue) > Precision::Confusion()) + if (std::abs(myAxesPadding - theValue) > Precision::Confusion()) { myAxesPadding = theValue; SetToUpdate(); @@ -149,7 +149,7 @@ public: //! @name Geometry management API //! Set new value of box edges gap. void SetBoxEdgeGap(Standard_Real theValue) { - if (Abs(myBoxEdgeGap - theValue) > Precision::Confusion()) + if (std::abs(myBoxEdgeGap - theValue) > Precision::Confusion()) { myBoxEdgeGap = theValue; SetToUpdate(); @@ -162,7 +162,7 @@ public: //! @name Geometry management API //! Set new value of box edge minimal size. void SetBoxEdgeMinSize(Standard_Real theValue) { - if (Abs(myBoxEdgeMinSize - theValue) > Precision::Confusion()) + if (std::abs(myBoxEdgeMinSize - theValue) > Precision::Confusion()) { myBoxEdgeMinSize = theValue; SetToUpdate(); @@ -175,7 +175,7 @@ public: //! @name Geometry management API //! Set new value of box corner minimal size. void SetBoxCornerMinSize(Standard_Real theValue) { - if (Abs(myCornerMinSize - theValue) > Precision::Confusion()) + if (std::abs(myCornerMinSize - theValue) > Precision::Confusion()) { myCornerMinSize = theValue; SetToUpdate(); @@ -196,7 +196,7 @@ public: //! @name Geometry management API //! Sets radius of axes of the trihedron. void SetAxesRadius(const Standard_Real theRadius) { - if (Abs(myAxesRadius - theRadius) > Precision::Confusion()) + if (std::abs(myAxesRadius - theRadius) > Precision::Confusion()) { myAxesRadius = theRadius; SetToUpdate(); @@ -209,7 +209,7 @@ public: //! @name Geometry management API //! Sets radius of cone of axes of the trihedron. void SetAxesConeRadius(Standard_Real theRadius) { - if (Abs(myAxesConeRadius - theRadius) > Precision::Confusion()) + if (std::abs(myAxesConeRadius - theRadius) > Precision::Confusion()) { myAxesConeRadius = theRadius; SetToUpdate(); @@ -222,7 +222,7 @@ public: //! @name Geometry management API //! Sets radius of sphere (central point) of the trihedron. void SetAxesSphereRadius(Standard_Real theRadius) { - if (Abs(myAxesSphereRadius - theRadius) > Precision::Confusion()) + if (std::abs(myAxesSphereRadius - theRadius) > Precision::Confusion()) { myAxesSphereRadius = theRadius; SetToUpdate(); @@ -310,9 +310,9 @@ public: //! @name Style management API //! @param[in] theValue input transparency value void SetBoxTransparency(Standard_Real theValue) { - if (Abs(myDrawer->ShadingAspect()->Transparency() - theValue) > Precision::Confusion() - || Abs(myBoxEdgeAspect->Transparency() - theValue) > Precision::Confusion() - || Abs(myBoxCornerAspect->Transparency() - theValue) > Precision::Confusion()) + if (std::abs(myDrawer->ShadingAspect()->Transparency() - theValue) > Precision::Confusion() + || std::abs(myBoxEdgeAspect->Transparency() - theValue) > Precision::Confusion() + || std::abs(myBoxCornerAspect->Transparency() - theValue) > Precision::Confusion()) { myDrawer->ShadingAspect()->SetTransparency(theValue); myBoxEdgeAspect->SetTransparency(theValue); @@ -384,7 +384,7 @@ public: //! @name Style management API //! @code Attributes()->TextAspect()->SetHeight() @endcode void SetFontHeight(Standard_Real theValue) { - if (Abs(myDrawer->TextAspect()->Height() - theValue) > Precision::Confusion()) + if (std::abs(myDrawer->TextAspect()->Height() - theValue) > Precision::Confusion()) { myDrawer->TextAspect()->SetHeight(theValue); SetToUpdate(); diff --git a/src/Visualization/TKV3d/AIS/AIS_WalkDelta.hxx b/src/Visualization/TKV3d/AIS/AIS_WalkDelta.hxx index 045df64dbe..38ba604456 100644 --- a/src/Visualization/TKV3d/AIS/AIS_WalkDelta.hxx +++ b/src/Visualization/TKV3d/AIS/AIS_WalkDelta.hxx @@ -40,7 +40,7 @@ struct AIS_WalkPart Standard_Real Duration; //!< duration //! Return TRUE if delta is empty. - bool IsEmpty() const { return Abs(Value) <= RealSmall(); } + bool IsEmpty() const { return std::abs(Value) <= RealSmall(); } //! Empty constructor. AIS_WalkPart() diff --git a/src/Visualization/TKV3d/DsgPrs/DsgPrs.cxx b/src/Visualization/TKV3d/DsgPrs/DsgPrs.cxx index bb4fca02d4..2705cf35ae 100644 --- a/src/Visualization/TKV3d/DsgPrs/DsgPrs.cxx +++ b/src/Visualization/TKV3d/DsgPrs/DsgPrs.cxx @@ -245,16 +245,16 @@ void DsgPrs::ComputeCurvilinearFacesLengthPresentation(const Standard_Real First deltaU = LastU - FirstU; deltaV = LastV - FirstV; - if (VCurve->IsPeriodic() && Abs(deltaU) > VCurve->Period() / 2) + if (VCurve->IsPeriodic() && std::abs(deltaU) > VCurve->Period() / 2) { Standard_Real Sign = (deltaU > 0.0) ? -1.0 : 1.0; - deltaU = VCurve->Period() - Abs(deltaU); + deltaU = VCurve->Period() - std::abs(deltaU); deltaU *= Sign; } - if (UCurve->IsPeriodic() && Abs(deltaV) > UCurve->Period() / 2) + if (UCurve->IsPeriodic() && std::abs(deltaV) > UCurve->Period() / 2) { Standard_Real Sign = (deltaV > 0.0) ? -1.0 : 1.0; - deltaV = UCurve->Period() - Abs(deltaV); + deltaV = UCurve->Period() - std::abs(deltaV); deltaV *= Sign; } } @@ -285,7 +285,7 @@ void DsgPrs::ComputeFacesAnglePresentation(const Standard_Real ArrowLength, Standard_Real& FirstParAttachCirc, Standard_Real& LastParAttachCirc) { - if (Value > Precision::Angular() && Abs(M_PI - Value) > Precision::Angular()) + if (Value > Precision::Angular() && std::abs(M_PI - Value) > Precision::Angular()) { // Computing presentation of angle's arc gp_Ax2 ax(CenterPoint, axisdir, dir1); diff --git a/src/Visualization/TKV3d/DsgPrs/DsgPrs_AnglePresentation.cxx b/src/Visualization/TKV3d/DsgPrs/DsgPrs_AnglePresentation.cxx index 46af0a084f..734c200625 100644 --- a/src/Visualization/TKV3d/DsgPrs/DsgPrs_AnglePresentation.cxx +++ b/src/Visualization/TKV3d/DsgPrs/DsgPrs_AnglePresentation.cxx @@ -139,7 +139,7 @@ void DsgPrs_AnglePresentation::Add(const Handle(Prs3d_Presentation)& aPresentati //-------------------------- Compute angle ------------------------ if (txt.Length() == 0) { - Standard_Real angle = UnitsAPI::CurrentFromLS(Abs(OppParam), "PLANE ANGLE"); + Standard_Real angle = UnitsAPI::CurrentFromLS(std::abs(OppParam), "PLANE ANGLE"); char res[80]; Sprintf(res, "%g", angle); txt = TCollection_ExtendedString(res); @@ -269,7 +269,7 @@ void DsgPrs_AnglePresentation::Add(const Handle(Prs3d_Presentation)& aPresentati if (uco > ufin) { - if (Abs(theval) < M_PI) + if (std::abs(theval) < M_PI) { // test if uco is in the opposite sector if (uco > udeb + M_PI && uco < ufin + M_PI) @@ -294,8 +294,8 @@ void DsgPrs_AnglePresentation::Add(const Handle(Prs3d_Presentation)& aPresentati } } - const Standard_Real alpha = Abs(ufin - udeb); - const Standard_Integer nbp = Max(4, Standard_Integer(50. * alpha / M_PI)); + const Standard_Real alpha = std::abs(ufin - udeb); + const Standard_Integer nbp = std::max(4, Standard_Integer(50. * alpha / M_PI)); const Standard_Real dteta = alpha / (nbp - 1); Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(nbp + 4, 3); @@ -399,10 +399,10 @@ void DsgPrs_AnglePresentation::Add(const Handle(Prs3d_Presentation)& aPresentati // Creating the angle's arc or line if null angle Handle(Graphic3d_ArrayOfPrimitives) aPrims; - if (theval > Precision::Angular() && Abs(M_PI - theval) > Precision::Angular()) + if (theval > Precision::Angular() && std::abs(M_PI - theval) > Precision::Angular()) { - const Standard_Real Alpha = Abs(LastParAngleCirc - FirstParAngleCirc); - const Standard_Integer NodeNumber = Max(4, Standard_Integer(50. * Alpha / M_PI)); + const Standard_Real Alpha = std::abs(LastParAngleCirc - FirstParAngleCirc); + const Standard_Integer NodeNumber = std::max(4, Standard_Integer(50. * Alpha / M_PI)); const Standard_Real delta = Alpha / (Standard_Real)(NodeNumber - 1); aPrims = new Graphic3d_ArrayOfPolylines(NodeNumber + 4, 3); @@ -454,8 +454,8 @@ void DsgPrs_AnglePresentation::Add(const Handle(Prs3d_Presentation)& aPresentati else { // Creating the arc from AttachmentPoint2 to its projection - const Standard_Real Alpha = Abs(LastParAttachCirc - FirstParAttachCirc); - const Standard_Integer NodeNumber = Max(4, Standard_Integer(50. * Alpha / M_PI)); + const Standard_Real Alpha = std::abs(LastParAttachCirc - FirstParAttachCirc); + const Standard_Integer NodeNumber = std::max(4, Standard_Integer(50. * Alpha / M_PI)); const Standard_Real delta = Alpha / (Standard_Real)(NodeNumber - 1); aPrims = new Graphic3d_ArrayOfPolylines(NodeNumber); @@ -496,7 +496,7 @@ void DsgPrs_AnglePresentation::Add(const Handle(Prs3d_Presentation)& aPresentati Norm = dir1.Crossed(dir2B); } - if (Abs(theval) > M_PI) + if (std::abs(theval) > M_PI) Norm.Reverse(); gp_Ax2 ax(CenterPoint, Norm, dir1); @@ -516,7 +516,7 @@ void DsgPrs_AnglePresentation::Add(const Handle(Prs3d_Presentation)& aPresentati if (uco > ufin) { - if (Abs(theval) < M_PI) + if (std::abs(theval) < M_PI) { // test if uco is in the opposite sector if (uco > udeb + M_PI && uco < ufin + M_PI) @@ -541,8 +541,8 @@ void DsgPrs_AnglePresentation::Add(const Handle(Prs3d_Presentation)& aPresentati } } - const Standard_Real alpha = Abs(ufin - udeb); - const Standard_Integer nbp = Max(4, Standard_Integer(50. * alpha / M_PI)); + const Standard_Real alpha = std::abs(ufin - udeb); + const Standard_Integer nbp = std::max(4, Standard_Integer(50. * alpha / M_PI)); const Standard_Real dteta = alpha / (nbp - 1); Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(nbp + 4, 3); @@ -622,7 +622,7 @@ void DsgPrs_AnglePresentation::Add(const Handle(Prs3d_Presentation)& aPresentati aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect()); gp_Dir Norm = dir1.Crossed(dir2); - if (Abs(theval) > M_PI) + if (std::abs(theval) > M_PI) Norm.Reverse(); gp_Ax2 ax(CenterPoint, Norm, dir1); @@ -642,7 +642,7 @@ void DsgPrs_AnglePresentation::Add(const Handle(Prs3d_Presentation)& aPresentati if (uco > ufin) { - if (Abs(theval) < M_PI) + if (std::abs(theval) < M_PI) { // test if uco is in the opposite sector if (uco > udeb + M_PI && uco < ufin + M_PI) @@ -667,8 +667,8 @@ void DsgPrs_AnglePresentation::Add(const Handle(Prs3d_Presentation)& aPresentati } } - const Standard_Real alpha = Abs(ufin - udeb); - const Standard_Integer nbp = Max(4, Standard_Integer(50. * alpha / M_PI)); + const Standard_Real alpha = std::abs(ufin - udeb); + const Standard_Integer nbp = std::max(4, Standard_Integer(50. * alpha / M_PI)); const Standard_Real dteta = alpha / (nbp - 1); Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(nbp + 4, 3); @@ -741,7 +741,7 @@ void DsgPrs_AnglePresentation::Add(const Handle(Prs3d_Presentation)& aPresentati aPresentation->CurrentGroup()->SetPrimitivesAspect(LA->LineAspect()->Aspect()); gp_Dir Norm = dir1.Crossed(dir2); - if (Abs(theval) > M_PI) + if (std::abs(theval) > M_PI) Norm.Reverse(); gp_Ax2 ax(CenterPoint, Norm, dir1); @@ -761,7 +761,7 @@ void DsgPrs_AnglePresentation::Add(const Handle(Prs3d_Presentation)& aPresentati if (uco > ufin) { - if (Abs(theval) < M_PI) + if (std::abs(theval) < M_PI) { // test if uco is in the opposite sector if (uco > udeb + M_PI && uco < ufin + M_PI) @@ -786,8 +786,8 @@ void DsgPrs_AnglePresentation::Add(const Handle(Prs3d_Presentation)& aPresentati } } - const Standard_Real alpha = Abs(ufin - udeb); - const Standard_Integer nbp = Max(4, Standard_Integer(50. * alpha / M_PI)); + const Standard_Real alpha = std::abs(ufin - udeb); + const Standard_Integer nbp = std::max(4, Standard_Integer(50. * alpha / M_PI)); const Standard_Real dteta = alpha / (nbp - 1); Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(nbp + 4, 3); @@ -859,7 +859,7 @@ void DsgPrs_AnglePresentation::Add(const Handle(Prs3d_Presentation)& aPresentati gp_Ax2 ax(CenterPoint, theAxe.Direction(), dir1); gp_Circ cer(ax, CenterPoint.Distance(AttachmentPoint1)); - const Standard_Integer nbp = Max(4, Standard_Integer(50. * theval / M_PI)); + const Standard_Integer nbp = std::max(4, Standard_Integer(50. * theval / M_PI)); const Standard_Real dteta = theval / (nbp - 1); Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(nbp); diff --git a/src/Visualization/TKV3d/DsgPrs/DsgPrs_EllipseRadiusPresentation.cxx b/src/Visualization/TKV3d/DsgPrs/DsgPrs_EllipseRadiusPresentation.cxx index d2b2935e5c..597d7ddc97 100644 --- a/src/Visualization/TKV3d/DsgPrs/DsgPrs_EllipseRadiusPresentation.cxx +++ b/src/Visualization/TKV3d/DsgPrs/DsgPrs_EllipseRadiusPresentation.cxx @@ -99,7 +99,7 @@ void DsgPrs_EllipseRadiusPresentation::Add(const Handle(Prs3d_Presentation)& aPr gp_Dir dir(Vpnt ^ Vapex); Standard_Real parFirst = anEllipse.Position().Direction().IsOpposite(dir, Precision::Angular()) ? uLast : uFirst; - const Standard_Integer NodeNumber = Max(4, Standard_Integer(50. * Alpha / M_PI)); + const Standard_Integer NodeNumber = std::max(4, Standard_Integer(50. * Alpha / M_PI)); const Standard_Real delta = Alpha / (NodeNumber - 1); Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(NodeNumber); @@ -155,7 +155,7 @@ void DsgPrs_EllipseRadiusPresentation::Add(const Handle(Prs3d_Presentation)& aPr gp_Dir dir(Vpnt ^ Vapex); Standard_Real parFirst = aCurve->Direction().IsOpposite(dir, Precision::Angular()) ? uLast : uFirst; - const Standard_Integer NodeNumber = Max(4, Standard_Integer(50. * Alpha / M_PI)); + const Standard_Integer NodeNumber = std::max(4, Standard_Integer(50. * Alpha / M_PI)); const Standard_Real delta = Alpha / (NodeNumber - 1); Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(NodeNumber); diff --git a/src/Visualization/TKV3d/DsgPrs/DsgPrs_EqualDistancePresentation.cxx b/src/Visualization/TKV3d/DsgPrs/DsgPrs_EqualDistancePresentation.cxx index e4e53cc95f..69a608b784 100644 --- a/src/Visualization/TKV3d/DsgPrs/DsgPrs_EqualDistancePresentation.cxx +++ b/src/Visualization/TKV3d/DsgPrs/DsgPrs_EqualDistancePresentation.cxx @@ -200,9 +200,9 @@ void DsgPrs_EqualDistancePresentation::AddIntervalBetweenTwoArcs( Standard_Real aDelta, aCurPar; if (aPar12 < aPar11) aPar12 += 2. * M_PI; - if (Abs(aPar12 - aPar11) > Precision::Confusion()) + if (std::abs(aPar12 - aPar11) > Precision::Confusion()) { - aNodeNb = Standard_Integer(Max(Abs(aPar12 - aPar11) * 50. / M_PI + 0.5, 4.)); + aNodeNb = Standard_Integer(std::max(std::abs(aPar12 - aPar11) * 50. / M_PI + 0.5, 4.)); aDelta = (aPar12 - aPar11) / aNodeNb; aCurPar = aPar11; @@ -214,9 +214,9 @@ void DsgPrs_EqualDistancePresentation::AddIntervalBetweenTwoArcs( } if (aPar22 < aPar21) aPar22 += 2. * M_PI; - if (Abs(aPar22 - aPar21) > Precision::Confusion()) + if (std::abs(aPar22 - aPar21) > Precision::Confusion()) { - aNodeNb = Standard_Integer(Max(Abs(aPar22 - aPar21) * 50. / M_PI + 0.5, 4.)); + aNodeNb = Standard_Integer(std::max(std::abs(aPar22 - aPar21) * 50. / M_PI + 0.5, 4.)); aDelta = (aPar22 - aPar21) / aNodeNb; aCurPar = aPar21; diff --git a/src/Visualization/TKV3d/DsgPrs/DsgPrs_EqualRadiusPresentation.cxx b/src/Visualization/TKV3d/DsgPrs/DsgPrs_EqualRadiusPresentation.cxx index bbfe9d8443..13516c2030 100644 --- a/src/Visualization/TKV3d/DsgPrs/DsgPrs_EqualRadiusPresentation.cxx +++ b/src/Visualization/TKV3d/DsgPrs/DsgPrs_EqualRadiusPresentation.cxx @@ -89,7 +89,8 @@ void DsgPrs_EqualRadiusPresentation::Add(const Handle(Prs3d_Presentation)& aPres } else { - Standard_Real Rad = Max(FirstCenter.Distance(FirstPoint), SecondCenter.Distance(SecondPoint)); + Standard_Real Rad = + std::max(FirstCenter.Distance(FirstPoint), SecondCenter.Distance(SecondPoint)); SmallDist = Rad * 0.05; // take 1/20 part of length; if (SmallDist <= Precision::Confusion()) diff --git a/src/Visualization/TKV3d/DsgPrs/DsgPrs_FilletRadiusPresentation.cxx b/src/Visualization/TKV3d/DsgPrs/DsgPrs_FilletRadiusPresentation.cxx index 2b06ce8092..b3a4f2c3eb 100644 --- a/src/Visualization/TKV3d/DsgPrs/DsgPrs_FilletRadiusPresentation.cxx +++ b/src/Visualization/TKV3d/DsgPrs/DsgPrs_FilletRadiusPresentation.cxx @@ -84,8 +84,8 @@ void DsgPrs_FilletRadiusPresentation::Add(const Handle(Prs3d_Presentation)& aPre // Creating the fillet's arc if (!SpecCase) { - const Standard_Real Alpha = Abs(LastParCirc - FirstParCirc); - const Standard_Integer NodeNumber = Max(4, Standard_Integer(50. * Alpha / M_PI)); + const Standard_Real Alpha = std::abs(LastParCirc - FirstParCirc); + const Standard_Integer NodeNumber = std::max(4, Standard_Integer(50. * Alpha / M_PI)); const Standard_Real delta = Alpha / (NodeNumber - 1); Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(NodeNumber); diff --git a/src/Visualization/TKV3d/DsgPrs/DsgPrs_IdenticPresentation.cxx b/src/Visualization/TKV3d/DsgPrs/DsgPrs_IdenticPresentation.cxx index a315f2a9b3..b315fc9ac7 100644 --- a/src/Visualization/TKV3d/DsgPrs/DsgPrs_IdenticPresentation.cxx +++ b/src/Visualization/TKV3d/DsgPrs/DsgPrs_IdenticPresentation.cxx @@ -119,13 +119,13 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta if (alpha < 0) alpha += 2. * M_PI; const Standard_Integer nb = (Standard_Integer)(50. * alpha / M_PI); - const Standard_Integer nbp = Max(4, nb); + const Standard_Integer nbp = std::max(4, nb); const Standard_Real dteta = alpha / (nbp - 1); Handle(Graphic3d_ArrayOfPolylines) aPrims; // trait joignant aPntOffset - if (Abs((aPntOffset.Distance(aCenter) - rad)) >= Precision::Confusion()) + if (std::abs((aPntOffset.Distance(aCenter) - rad)) >= Precision::Confusion()) { aPrims = new Graphic3d_ArrayOfPolylines(nbp + 2, 2); aPrims->AddBound(2); @@ -169,7 +169,7 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta if (alpha < 0) alpha += 2. * M_PI; const Standard_Integer nb = (Standard_Integer)(50. * alpha / M_PI); - const Standard_Integer nbp = Max(4, nb); + const Standard_Integer nbp = std::max(4, nb); const Standard_Real dteta = alpha / (nbp - 1); Handle(Graphic3d_ArrayOfPolylines) aPrims; @@ -216,7 +216,7 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta if (alpha < 0) alpha += 2. * M_PI; const Standard_Integer nb = (Standard_Integer)(50.0 * alpha / M_PI); - const Standard_Integer nbp = Max(4, nb); + const Standard_Integer nbp = std::max(4, nb); const Standard_Real dteta = alpha / (nbp - 1); Handle(Graphic3d_ArrayOfPolylines) aPrims; diff --git a/src/Visualization/TKV3d/DsgPrs/DsgPrs_LengthPresentation.cxx b/src/Visualization/TKV3d/DsgPrs/DsgPrs_LengthPresentation.cxx index 267c2999a1..d85b0950f9 100644 --- a/src/Visualization/TKV3d/DsgPrs/DsgPrs_LengthPresentation.cxx +++ b/src/Visualization/TKV3d/DsgPrs/DsgPrs_LengthPresentation.cxx @@ -53,7 +53,7 @@ void DsgPrs_LengthPresentation::Add(const Handle(Prs3d_Presentation)& aPresentat parmin = ElCLib::Parameter(L3, Proj1); parmax = parmin; parcur = ElCLib::Parameter(L3, Proj2); - Standard_Real dist = Abs(parmin - parcur); + Standard_Real dist = std::abs(parmin - parcur); if (parcur < parmin) parmin = parcur; if (parcur > parmax) @@ -163,7 +163,7 @@ void DsgPrs_LengthPresentation::Add(const Handle(Prs3d_Presentation)& aPresentat if ((Par1 > 0.0 && Par2 > 0.0) || (Par1 < 0.0 && Par2 < 0.0)) { FirstPoint = OffsetPoint; - LastPoint = (Abs(Par1) > Abs(Par2)) ? EndOfArrow1 : EndOfArrow2; + LastPoint = (std::abs(Par1) > std::abs(Par2)) ? EndOfArrow1 : EndOfArrow2; } else { @@ -227,7 +227,7 @@ void DsgPrs_LengthPresentation::Add(const Handle(Prs3d_Presentation)& aPresentat parmin = ElCLib::Parameter(L3, Proj1); parmax = parmin; parcur = ElCLib::Parameter(L3, Proj2); - Standard_Real dist = Abs(parmin - parcur); + Standard_Real dist = std::abs(parmin - parcur); if (parcur < parmin) parmin = parcur; if (parcur > parmax) @@ -325,7 +325,7 @@ void DsgPrs_LengthPresentation::Add(const Handle(Prs3d_Presentation)& aPresentat if ((Par1 > 0.0 && Par2 > 0.0) || (Par1 < 0.0 && Par2 < 0.0)) { FirstPoint = OffsetPoint; - LastPoint = (Abs(Par1) > Abs(Par2)) ? AttachmentPoint1 : EndOfArrow2; + LastPoint = (std::abs(Par1) > std::abs(Par2)) ? AttachmentPoint1 : EndOfArrow2; } else { @@ -355,20 +355,20 @@ void DsgPrs_LengthPresentation::Add(const Handle(Prs3d_Presentation)& aPresentat Standard_Real Alpha, delta; Standard_Integer NodeNumber; - Alpha = Abs(deltaU); + Alpha = std::abs(deltaU); if (Alpha > Precision::Angular() && Alpha < Precision::Infinite()) { - NodeNumber = Max(4, Standard_Integer(50. * Alpha / M_PI)); + NodeNumber = std::max(4, Standard_Integer(50. * Alpha / M_PI)); delta = deltaU / (Standard_Real)(NodeNumber - 1); aPrims = new Graphic3d_ArrayOfPolylines(NodeNumber); for (Standard_Integer i = 1; i <= NodeNumber; i++, FirstU += delta) aPrims->AddVertex(VCurve->Value(FirstU)); aPresentation->CurrentGroup()->AddPrimitiveArray(aPrims); } - Alpha = Abs(deltaV); + Alpha = std::abs(deltaV); if (Alpha > Precision::Angular() && Alpha < Precision::Infinite()) { - NodeNumber = Max(4, Standard_Integer(50. * Alpha / M_PI)); + NodeNumber = std::max(4, Standard_Integer(50. * Alpha / M_PI)); delta = deltaV / (Standard_Real)(NodeNumber - 1); aPrims = new Graphic3d_ArrayOfPolylines(NodeNumber); for (Standard_Integer i = 1; i <= NodeNumber; i++, FirstV += delta) diff --git a/src/Visualization/TKV3d/DsgPrs/DsgPrs_MidPointPresentation.cxx b/src/Visualization/TKV3d/DsgPrs/DsgPrs_MidPointPresentation.cxx index 4fd0489261..8c6d811b1f 100644 --- a/src/Visualization/TKV3d/DsgPrs/DsgPrs_MidPointPresentation.cxx +++ b/src/Visualization/TKV3d/DsgPrs/DsgPrs_MidPointPresentation.cxx @@ -199,7 +199,7 @@ void DsgPrs_MidPointPresentation::Add(const Handle(Prs3d_Presentation)& aPresent if (alpha < 0) alpha += 2. * M_PI; const Standard_Integer nb = (Standard_Integer)(50.0 * alpha / M_PI); - Standard_Integer nbp = Max(4, nb); + Standard_Integer nbp = std::max(4, nb); Standard_Real dteta = alpha / (nbp - 1); Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfPolylines(nbp); @@ -279,7 +279,7 @@ void DsgPrs_MidPointPresentation::Add(const Handle(Prs3d_Presentation)& aPresent if (alpha < 0) alpha += 2 * M_PI; const Standard_Integer nb = (Standard_Integer)(50.0 * alpha / M_PI); - Standard_Integer nbp = Max(4, nb); + Standard_Integer nbp = std::max(4, nb); Standard_Real dteta = alpha / (nbp - 1); Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfPolylines(nbp); diff --git a/src/Visualization/TKV3d/DsgPrs/DsgPrs_OffsetPresentation.cxx b/src/Visualization/TKV3d/DsgPrs/DsgPrs_OffsetPresentation.cxx index 3ae92cd6f1..6a7cc177ca 100644 --- a/src/Visualization/TKV3d/DsgPrs/DsgPrs_OffsetPresentation.cxx +++ b/src/Visualization/TKV3d/DsgPrs/DsgPrs_OffsetPresentation.cxx @@ -68,7 +68,7 @@ void DsgPrs_OffsetPresentation::Add(const Handle(Prs3d_Presentation)& aPresentat parmin = ElCLib::Parameter(L3, Proj1); parmax = parmin; parcur = ElCLib::Parameter(L3, Proj2); - Standard_Real dist = Abs(parmin - parcur); + Standard_Real dist = std::abs(parmin - parcur); if (parcur < parmin) parmin = parcur; if (parcur > parmax) diff --git a/src/Visualization/TKV3d/DsgPrs/DsgPrs_ParalPresentation.cxx b/src/Visualization/TKV3d/DsgPrs/DsgPrs_ParalPresentation.cxx index b4ed8e37a2..02386028a3 100644 --- a/src/Visualization/TKV3d/DsgPrs/DsgPrs_ParalPresentation.cxx +++ b/src/Visualization/TKV3d/DsgPrs/DsgPrs_ParalPresentation.cxx @@ -48,7 +48,7 @@ void DsgPrs_ParalPresentation::Add(const Handle(Prs3d_Presentation)& aPresentati parmin = ElCLib::Parameter(L3, Proj1); parmax = parmin; parcur = ElCLib::Parameter(L3, Proj2); - Standard_Real dist = Abs(parmin - parcur); + Standard_Real dist = std::abs(parmin - parcur); if (parcur < parmin) parmin = parcur; if (parcur > parmax) @@ -145,7 +145,7 @@ void DsgPrs_ParalPresentation::Add(const Handle(Prs3d_Presentation)& aPresentati parmin = ElCLib::Parameter(L3, Proj1); parmax = parmin; parcur = ElCLib::Parameter(L3, Proj2); - Standard_Real dist = Abs(parmin - parcur); + Standard_Real dist = std::abs(parmin - parcur); if (parcur < parmin) parmin = parcur; if (parcur > parmax) diff --git a/src/Visualization/TKV3d/DsgPrs/DsgPrs_RadiusPresentation.cxx b/src/Visualization/TKV3d/DsgPrs/DsgPrs_RadiusPresentation.cxx index 762f34aeeb..6aec6d445f 100644 --- a/src/Visualization/TKV3d/DsgPrs/DsgPrs_RadiusPresentation.cxx +++ b/src/Visualization/TKV3d/DsgPrs/DsgPrs_RadiusPresentation.cxx @@ -81,8 +81,9 @@ void DsgPrs_RadiusPresentation::Add(const Handle(Prs3d_Presentation)& aPresentat } else { - const Standard_Real ecartpar = Min(Abs(fpara - parat), Abs(lpara - parat)); - const Standard_Real ecartoth = Min(Abs(fpara - otherpar), Abs(lpara - otherpar)); + const Standard_Real ecartpar = std::min(std::abs(fpara - parat), std::abs(lpara - parat)); + const Standard_Real ecartoth = + std::min(std::abs(fpara - otherpar), std::abs(lpara - otherpar)); if (ecartpar <= ecartoth) { parat = (parat < fpara) ? fpara : lpara; @@ -106,7 +107,7 @@ void DsgPrs_RadiusPresentation::Add(const Handle(Prs3d_Presentation)& aPresentat { const Standard_Real uatt = ElCLib::Parameter(L, attpoint); const Standard_Real uptc = ElCLib::Parameter(L, ptoncirc); - if (Abs(uatt) > Abs(uptc)) + if (std::abs(uatt) > std::abs(uptc)) drawtopoint = aCircle.Location(); else firstpoint = aCircle.Location(); diff --git a/src/Visualization/TKV3d/DsgPrs/DsgPrs_ShapeDirPresentation.cxx b/src/Visualization/TKV3d/DsgPrs/DsgPrs_ShapeDirPresentation.cxx index ebf7f3f159..0794033ae6 100644 --- a/src/Visualization/TKV3d/DsgPrs/DsgPrs_ShapeDirPresentation.cxx +++ b/src/Visualization/TKV3d/DsgPrs/DsgPrs_ShapeDirPresentation.cxx @@ -115,7 +115,7 @@ static Standard_Boolean FindPointOnFace(const TopoDS_Face& face, gp_Pnt2d& pt2d) } } - if (Abs(area) < gp::Resolution()) + if (std::abs(area) < gp::Resolution()) { pt2d.SetCoord(points(1).X(), points(1).Y()); return Standard_False; diff --git a/src/Visualization/TKV3d/DsgPrs/DsgPrs_SymmetricPresentation.cxx b/src/Visualization/TKV3d/DsgPrs/DsgPrs_SymmetricPresentation.cxx index 0497301d0c..515786b453 100644 --- a/src/Visualization/TKV3d/DsgPrs/DsgPrs_SymmetricPresentation.cxx +++ b/src/Visualization/TKV3d/DsgPrs/DsgPrs_SymmetricPresentation.cxx @@ -92,7 +92,7 @@ void DsgPrs_SymmetricPresentation::Add(const Handle(Prs3d_Presentation)& aPresen parmin = ElCLib::Parameter(L3, P1); parmax = parmin; parcur = ElCLib::Parameter(L3, P2); - Standard_Real dist = Abs(parmin - parcur); + Standard_Real dist = std::abs(parmin - parcur); if (parcur < parmin) parmin = parcur; if (parcur > parmax) @@ -177,7 +177,7 @@ void DsgPrs_SymmetricPresentation::Add(const Handle(Prs3d_Presentation)& aPresen parmin = ElCLib::Parameter(L3, P1); parmax = parmin; parcur = ElCLib::Parameter(L3, P2); - dist = Abs(parmin - parcur); + dist = std::abs(parmin - parcur); if (parcur < parmin) parmin = parcur; if (parcur > parmax) @@ -261,7 +261,7 @@ void DsgPrs_SymmetricPresentation::Add(const Handle(Prs3d_Presentation)& aPresen parmin = ElCLib::Parameter(L3, P1); parmax = parmin; parcur = ElCLib::Parameter(L3, P2); - dist = Abs(parmin - parcur); + dist = std::abs(parmin - parcur); if (parcur < parmin) parmin = parcur; if (parcur > parmax) @@ -484,7 +484,7 @@ void DsgPrs_SymmetricPresentation::Add(const Handle(Prs3d_Presentation)& aPresen ProjOffsetPoint = ProjCenter1.Translated(Vout.Divided(Vout.Magnitude()).Multiplied(Dt)); OffsetPnt = ProjOffsetPoint; } - h = Sqrt(R * R - Dt * Dt); + h = std::sqrt(R * R - Dt * Dt); gp_Pnt P1 = ProjOffsetPoint.Translated(Vp.Added(Vp.Divided(Vp.Magnitude()).Multiplied(h))); gp_Vec v(P1, ProjOffsetPoint); gp_Pnt P2 = ProjOffsetPoint.Translated(v); @@ -494,7 +494,7 @@ void DsgPrs_SymmetricPresentation::Add(const Handle(Prs3d_Presentation)& aPresen parmin = ElCLib::Parameter(L3, P1); parmax = parmin; parcur = ElCLib::Parameter(L3, P2); - Standard_Real dist = Abs(parmin - parcur); + Standard_Real dist = std::abs(parmin - parcur); if (parcur < parmin) parmin = parcur; if (parcur > parmax) @@ -533,12 +533,12 @@ void DsgPrs_SymmetricPresentation::Add(const Handle(Prs3d_Presentation)& aPresen if (alpha > M_PI) { alpha = (2. * M_PI) - alpha; - nbp = (Standard_Integer)IntegerPart(alpha / (alpha * .02)); + nbp = (Standard_Integer)std::trunc(alpha / (alpha * .02)); Dalpha = alpha / (nbp - 1); } else { - nbp = (Standard_Integer)IntegerPart(alpha / (alpha * .02)); + nbp = (Standard_Integer)std::trunc(alpha / (alpha * .02)); Dalpha = -alpha / (nbp - 1); } } @@ -547,12 +547,12 @@ void DsgPrs_SymmetricPresentation::Add(const Handle(Prs3d_Presentation)& aPresen if (alpha > M_PI) { alpha = (2. * M_PI) - alpha; - nbp = (Standard_Integer)IntegerPart(alpha / (alpha * .02)); + nbp = (Standard_Integer)std::trunc(alpha / (alpha * .02)); Dalpha = -alpha / (nbp - 1); } else { - nbp = (Standard_Integer)IntegerPart(alpha / (alpha * .02)); + nbp = (Standard_Integer)std::trunc(alpha / (alpha * .02)); Dalpha = alpha / (nbp - 1); } } @@ -581,12 +581,12 @@ void DsgPrs_SymmetricPresentation::Add(const Handle(Prs3d_Presentation)& aPresen if (alpha > M_PI) { alpha = (2 * M_PI) - alpha; - nbp = (Standard_Integer)IntegerPart(alpha / (alpha * .02)); + nbp = (Standard_Integer)std::trunc(alpha / (alpha * .02)); Dalpha = alpha / (nbp - 1); } else { - nbp = (Standard_Integer)IntegerPart(alpha / (alpha * .02)); + nbp = (Standard_Integer)std::trunc(alpha / (alpha * .02)); Dalpha = -alpha / (nbp - 1); } } @@ -595,12 +595,12 @@ void DsgPrs_SymmetricPresentation::Add(const Handle(Prs3d_Presentation)& aPresen if (alpha > M_PI) { alpha = (2 * M_PI) - alpha; - nbp = (Standard_Integer)IntegerPart(alpha / (alpha * .02)); + nbp = (Standard_Integer)std::trunc(alpha / (alpha * .02)); Dalpha = -alpha / (nbp - 1); } else { - nbp = (Standard_Integer)IntegerPart(alpha / (alpha * .02)); + nbp = (Standard_Integer)std::trunc(alpha / (alpha * .02)); Dalpha = alpha / (nbp - 1); } } @@ -806,7 +806,7 @@ void DsgPrs_SymmetricPresentation::Add(const Handle(Prs3d_Presentation)& aPresen parmin = ElCLib::Parameter(L3, P1); parmax = parmin; parcur = ElCLib::Parameter(L3, P2); - Standard_Real dist = Abs(parmin - parcur); + Standard_Real dist = std::abs(parmin - parcur); if (parcur < parmin) parmin = parcur; if (parcur > parmax) diff --git a/src/Visualization/TKV3d/Prs3d/Prs3d.cxx b/src/Visualization/TKV3d/Prs3d/Prs3d.cxx index 92901ba290..014e589807 100644 --- a/src/Visualization/TKV3d/Prs3d/Prs3d.cxx +++ b/src/Visualization/TKV3d/Prs3d/Prs3d.cxx @@ -111,7 +111,8 @@ Standard_Boolean Prs3d::MatchSegment(const Standard_Real X, Standard_Real Lambda = ((X - X1) * DX + (Y - Y1) * DY + (Z - Z1) * DZ) / Dist; if (Lambda < 0. || Lambda > 1.) return Standard_False; - dist = Abs(X - X1 - Lambda * DX) + Abs(Y - Y1 - Lambda * DY) + Abs(Z - Z1 - Lambda * DZ); + dist = std::abs(X - X1 - Lambda * DX) + std::abs(Y - Y1 - Lambda * DY) + + std::abs(Z - Z1 - Lambda * DZ); return (dist < aDistance); } diff --git a/src/Visualization/TKV3d/Prs3d/Prs3d.hxx b/src/Visualization/TKV3d/Prs3d/Prs3d.hxx index fce767ed2d..5971a5e9bc 100644 --- a/src/Visualization/TKV3d/Prs3d/Prs3d.hxx +++ b/src/Visualization/TKV3d/Prs3d/Prs3d.hxx @@ -65,7 +65,7 @@ public: const Standard_Real theDeviationCoefficient) { const Graphic3d_Vec3d aDiag = theBndMax - theBndMin; - return Max(aDiag.maxComp() * theDeviationCoefficient * 4.0, Precision::Confusion()); + return (std::max)(aDiag.maxComp() * theDeviationCoefficient * 4.0, Precision::Confusion()); } //! Computes the absolute deflection value based on relative deflection diff --git a/src/Visualization/TKV3d/Prs3d/Prs3d_Arrow.cxx b/src/Visualization/TKV3d/Prs3d/Prs3d_Arrow.cxx index 61b9404f35..0bff6bb22b 100644 --- a/src/Visualization/TKV3d/Prs3d/Prs3d_Arrow.cxx +++ b/src/Visualization/TKV3d/Prs3d/Prs3d_Arrow.cxx @@ -54,11 +54,12 @@ Handle(Graphic3d_ArrayOfSegments) Prs3d_Arrow::DrawSegments(const gp_Pnt& // construction of i,j mark for the circle gp_Dir aN; - if (Abs(theDir.X()) <= Abs(theDir.Y()) && Abs(theDir.X()) <= Abs(theDir.Z())) + if (std::abs(theDir.X()) <= std::abs(theDir.Y()) && std::abs(theDir.X()) <= std::abs(theDir.Z())) { aN = gp::DX(); } - else if (Abs(theDir.Y()) <= Abs(theDir.Z()) && Abs(theDir.Y()) <= Abs(theDir.X())) + else if (std::abs(theDir.Y()) <= std::abs(theDir.Z()) + && std::abs(theDir.Y()) <= std::abs(theDir.X())) { aN = gp::DY(); } @@ -71,11 +72,11 @@ Handle(Graphic3d_ArrayOfSegments) Prs3d_Arrow::DrawSegments(const gp_Pnt& const gp_XYZ anXYZj = theDir.XYZ().Crossed(anXYZi.XYZ()); aSegments->AddVertex(theLocation); - const Standard_Real Tg = Tan(theAngle); + const Standard_Real Tg = std::tan(theAngle); for (Standard_Integer aVertIter = 1; aVertIter <= theNbSegments; ++aVertIter) { - const Standard_Real aCos = Cos(2.0 * M_PI / theNbSegments * (aVertIter - 1)); - const Standard_Real aSin = Sin(2.0 * M_PI / theNbSegments * (aVertIter - 1)); + const Standard_Real aCos = std::cos(2.0 * M_PI / theNbSegments * (aVertIter - 1)); + const Standard_Real aSin = std::sin(2.0 * M_PI / theNbSegments * (aVertIter - 1)); const gp_Pnt pp(aC.X() + (aCos * anXYZi.X() + aSin * anXYZj.X()) * theLength * Tg, aC.Y() + (aCos * anXYZi.Y() + aSin * anXYZj.Y()) * theLength * Tg, @@ -111,7 +112,7 @@ Handle(Graphic3d_ArrayOfTriangles) Prs3d_Arrow::DrawShaded(const gp_Ax1& const Standard_Real theConeLength, const Standard_Integer theNbFacettes) { - const Standard_Real aTubeLength = Max(0.0, theAxisLength - theConeLength); + const Standard_Real aTubeLength = std::max(0.0, theAxisLength - theConeLength); const Standard_Integer aNbTrisTube = (theTubeRadius > 0.0 && aTubeLength > 0.0) ? Prs3d_ToolCylinder::TrianglesNb(theNbFacettes, 1) : 0; diff --git a/src/Visualization/TKV3d/Prs3d/Prs3d_Point.hxx b/src/Visualization/TKV3d/Prs3d/Prs3d_Point.hxx index a13a1fef0d..ce67d07440 100755 --- a/src/Visualization/TKV3d/Prs3d/Prs3d_Point.hxx +++ b/src/Visualization/TKV3d/Prs3d/Prs3d_Point.hxx @@ -54,7 +54,8 @@ public: { Standard_Real aX, aY, aZ; PointTool::Coord(thePoint, aX, aY, aZ); - return Sqrt((theX - aX) * (theX - aX) + (theY - aY) * (theY - aY) + (theZ - aZ) * (theZ - aZ)) + return std::sqrt((theX - aX) * (theX - aX) + (theY - aY) * (theY - aY) + + (theZ - aZ) * (theZ - aZ)) <= theDistance; } }; diff --git a/src/Visualization/TKV3d/Prs3d/Prs3d_ToolCylinder.cxx b/src/Visualization/TKV3d/Prs3d/Prs3d_ToolCylinder.cxx index 83b51c9c5f..66b233aa30 100644 --- a/src/Visualization/TKV3d/Prs3d/Prs3d_ToolCylinder.cxx +++ b/src/Visualization/TKV3d/Prs3d/Prs3d_ToolCylinder.cxx @@ -41,7 +41,7 @@ gp_Pnt Prs3d_ToolCylinder::Vertex(const Standard_Real theU, const Standard_Real { const Standard_Real aU = theU * M_PI * 2.0; const Standard_Real aRadius = myBottomRadius + (myTopRadius - myBottomRadius) * theV; - return gp_Pnt(Cos(aU) * aRadius, Sin(aU) * aRadius, theV * myHeight); + return gp_Pnt(std::cos(aU) * aRadius, std::sin(aU) * aRadius, theV * myHeight); } //================================================================================================= @@ -49,7 +49,7 @@ gp_Pnt Prs3d_ToolCylinder::Vertex(const Standard_Real theU, const Standard_Real gp_Dir Prs3d_ToolCylinder::Normal(const Standard_Real theU, const Standard_Real) const { const Standard_Real aU = theU * M_PI * 2.0; - return gp_Dir(Cos(aU) * myHeight, Sin(aU) * myHeight, myBottomRadius - myTopRadius); + return gp_Dir(std::cos(aU) * myHeight, std::sin(aU) * myHeight, myBottomRadius - myTopRadius); } //================================================================================================= diff --git a/src/Visualization/TKV3d/Prs3d/Prs3d_ToolDisk.cxx b/src/Visualization/TKV3d/Prs3d/Prs3d_ToolDisk.cxx index e4f80e35e5..0a801a14d1 100644 --- a/src/Visualization/TKV3d/Prs3d/Prs3d_ToolDisk.cxx +++ b/src/Visualization/TKV3d/Prs3d/Prs3d_ToolDisk.cxx @@ -40,7 +40,7 @@ gp_Pnt Prs3d_ToolDisk::Vertex(const Standard_Real theU, const Standard_Real theV { const Standard_Real aU = myStartAngle + theU * (myEndAngle - myStartAngle); const Standard_Real aRadius = myInnerRadius + (myOuterRadius - myInnerRadius) * theV; - return gp_Pnt(Cos(aU) * aRadius, Sin(aU) * aRadius, 0.0); + return gp_Pnt(std::cos(aU) * aRadius, std::sin(aU) * aRadius, 0.0); } //================================================================================================= diff --git a/src/Visualization/TKV3d/Prs3d/Prs3d_ToolSector.cxx b/src/Visualization/TKV3d/Prs3d/Prs3d_ToolSector.cxx index 5ffcdb2f7e..3f46dcf587 100644 --- a/src/Visualization/TKV3d/Prs3d/Prs3d_ToolSector.cxx +++ b/src/Visualization/TKV3d/Prs3d/Prs3d_ToolSector.cxx @@ -36,7 +36,7 @@ gp_Pnt Prs3d_ToolSector::Vertex(const Standard_Real theU, const Standard_Real th { const Standard_Real aU = theU * M_PI / 2.0; const Standard_Real aRadius = myRadius * theV; - return gp_Pnt(Cos(aU) * aRadius, Sin(aU) * aRadius, 0.0); + return gp_Pnt(std::cos(aU) * aRadius, std::sin(aU) * aRadius, 0.0); } //================================================================================================= diff --git a/src/Visualization/TKV3d/Prs3d/Prs3d_ToolSphere.cxx b/src/Visualization/TKV3d/Prs3d/Prs3d_ToolSphere.cxx index 9ffbbd8c71..c273b633f1 100644 --- a/src/Visualization/TKV3d/Prs3d/Prs3d_ToolSphere.cxx +++ b/src/Visualization/TKV3d/Prs3d/Prs3d_ToolSphere.cxx @@ -36,7 +36,9 @@ gp_Pnt Prs3d_ToolSphere::Vertex(const Standard_Real theU, const Standard_Real th { const Standard_Real aU = theU * M_PI * 2.0; const Standard_Real aV = theV * M_PI; - return gp_Pnt(myRadius * Cos(aU) * Sin(aV), -myRadius * Sin(aU) * Sin(aV), myRadius * Cos(aV)); + return gp_Pnt(myRadius * std::cos(aU) * std::sin(aV), + -myRadius * std::sin(aU) * std::sin(aV), + myRadius * std::cos(aV)); } //================================================================================================= @@ -45,7 +47,7 @@ gp_Dir Prs3d_ToolSphere::Normal(const Standard_Real theU, const Standard_Real th { const Standard_Real aU = theU * M_PI * 2.0; const Standard_Real aV = theV * M_PI; - return gp_Dir(Cos(aU) * Sin(aV), -Sin(aU) * Sin(aV), Cos(aV)); + return gp_Dir(std::cos(aU) * std::sin(aV), -std::sin(aU) * std::sin(aV), std::cos(aV)); } //================================================================================================= diff --git a/src/Visualization/TKV3d/Prs3d/Prs3d_ToolTorus.cxx b/src/Visualization/TKV3d/Prs3d/Prs3d_ToolTorus.cxx index 867b0a2d2a..7878746b01 100644 --- a/src/Visualization/TKV3d/Prs3d/Prs3d_ToolTorus.cxx +++ b/src/Visualization/TKV3d/Prs3d/Prs3d_ToolTorus.cxx @@ -40,9 +40,9 @@ gp_Pnt Prs3d_ToolTorus::Vertex(const Standard_Real theU, const Standard_Real the { const Standard_Real aU = theU * myAngle; const Standard_Real aV = myVMin + theV * (myVMax - myVMin); - return gp_Pnt((myMajorRadius + myMinorRadius * Cos(aV)) * Cos(aU), - (myMajorRadius + myMinorRadius * Cos(aV)) * Sin(aU), - myMinorRadius * Sin(aV)); + return gp_Pnt((myMajorRadius + myMinorRadius * std::cos(aV)) * std::cos(aU), + (myMajorRadius + myMinorRadius * std::cos(aV)) * std::sin(aU), + myMinorRadius * std::sin(aV)); } //================================================================================================= @@ -51,7 +51,7 @@ gp_Dir Prs3d_ToolTorus::Normal(const Standard_Real theU, const Standard_Real the { const Standard_Real aU = theU * myAngle; const Standard_Real aV = myVMin + theV * (myVMax - myVMin); - return gp_Dir(Cos(aU) * Cos(aV), Sin(aU) * Cos(aV), Sin(aV)); + return gp_Dir(std::cos(aU) * std::cos(aV), std::sin(aU) * std::cos(aV), std::sin(aV)); } //================================================================================================= diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim.cxx index e622ad2cf6..1f0818f49b 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim.cxx @@ -863,7 +863,7 @@ void PrsDim::InitFaceLength(const TopoDS_Face& theFace, Standard_Real& theOffset) { if (PrsDim::GetPlaneFromFace(theFace, thePlane, theSurface, theSurfaceType, theOffset) - && Abs(theOffset) > Precision::Confusion()) + && std::abs(theOffset) > Precision::Confusion()) { theSurface = new Geom_OffsetSurface(theSurface, theOffset); theOffset = 0.0e0; @@ -1212,7 +1212,7 @@ gp_Pnt PrsDim::TranslatePointToBound(const gp_Pnt& aPoint, Standard_Boolean IsFound = Standard_False; for (Standard_Integer i = 1; i <= 3; i++) { - if (Abs(Dir(i)) <= gp::Resolution()) + if (std::abs(Dir(i)) <= gp::Resolution()) continue; for (Standard_Integer j = 1; j <= 2; j++) { @@ -1336,9 +1336,9 @@ gp_Pnt PrsDim::NearestApex(const gp_Elips& elips, { IsInDomain = Standard_False; Standard_Real posd = - Min(DistanceFromApex(elips, pApex, fpara), DistanceFromApex(elips, pApex, lpara)); + std::min(DistanceFromApex(elips, pApex, fpara), DistanceFromApex(elips, pApex, lpara)); Standard_Real negd = - Min(DistanceFromApex(elips, nApex, fpara), DistanceFromApex(elips, nApex, lpara)); + std::min(DistanceFromApex(elips, nApex, fpara), DistanceFromApex(elips, nApex, lpara)); if (posd < negd) EndOfArrow = pApex; else diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_AngleDimension.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_AngleDimension.cxx index efb53f7d85..829ca96a46 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_AngleDimension.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_AngleDimension.cxx @@ -376,7 +376,7 @@ void PrsDim_AngleDimension::DrawArc(const Handle(Prs3d_Presentation)& thePresent if (myType == PrsDim_TypeOfAngle_Exterior) anAngle = 2.0 * M_PI - anAngle; // it sets 50 points on PI, and a part of points if angle is less - const Standard_Integer aNbPoints = Max(4, Standard_Integer(50.0 * anAngle / M_PI)); + const Standard_Integer aNbPoints = std::max(4, Standard_Integer(50.0 * anAngle / M_PI)); GCPnts_UniformAbscissa aMakePnts(anArcAdaptor, aNbPoints); if (!aMakePnts.IsDone()) @@ -701,7 +701,7 @@ void PrsDim_AngleDimension::Compute(const Handle(PrsMgr_PresentationManager)&, ? aSecondAttach : aSecondArrowEnd, myCenterPoint, - Abs(GetFlyout()), + std::abs(GetFlyout()), theMode); } } @@ -750,7 +750,7 @@ void PrsDim_AngleDimension::Compute(const Handle(PrsMgr_PresentationManager)&, ? aSecondAttach : aSecondArrowEnd, myCenterPoint, - Abs(GetFlyout()), + std::abs(GetFlyout()), theMode); } @@ -905,12 +905,12 @@ Standard_Boolean PrsDim_AngleDimension::InitTwoEdgesAngle(gp_Pln& theComputedPla const Standard_Real aParam21 = ElCLib::Parameter(aFirstLin, aFirstPoint2); const Standard_Real aParam22 = ElCLib::Parameter(aFirstLin, aLastPoint2); myCenterPoint = - ElCLib::Value((Min(aParam11, aParam12) + Max(aParam21, aParam22)) * 0.5, aFirstLin); - myFirstPoint = myCenterPoint.Translated(gp_Vec(aFirstLin.Direction()) * Abs(GetFlyout())); + ElCLib::Value((std::min(aParam11, aParam12) + std::max(aParam21, aParam22)) * 0.5, aFirstLin); + myFirstPoint = myCenterPoint.Translated(gp_Vec(aFirstLin.Direction()) * std::abs(GetFlyout())); mySecondPoint = myCenterPoint.XYZ() + (aFirstLin.Direction().IsEqual(aSecondLin.Direction(), Precision::Angular()) - ? aFirstLin.Direction().Reversed().XYZ() * Abs(GetFlyout()) - : aSecondLin.Direction().XYZ() * Abs(GetFlyout())); + ? aFirstLin.Direction().Reversed().XYZ() * std::abs(GetFlyout()) + : aSecondLin.Direction().XYZ() * std::abs(GetFlyout())); } else { @@ -930,8 +930,10 @@ Standard_Boolean PrsDim_AngleDimension::InitTwoEdgesAngle(gp_Pln& theComputedPla if (isInfinite1 || isInfinite2) { - myFirstPoint = myCenterPoint.Translated(gp_Vec(aFirstLin.Direction()) * Abs(GetFlyout())); - mySecondPoint = myCenterPoint.Translated(gp_Vec(aSecondLin.Direction()) * Abs(GetFlyout())); + myFirstPoint = + myCenterPoint.Translated(gp_Vec(aFirstLin.Direction()) * std::abs(GetFlyout())); + mySecondPoint = + myCenterPoint.Translated(gp_Vec(aSecondLin.Direction()) * std::abs(GetFlyout())); return IsValidPoints(myFirstPoint, myCenterPoint, mySecondPoint); } diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_Chamf2dDimension.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_Chamf2dDimension.cxx index efca32b027..6c4477b578 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_Chamf2dDimension.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_Chamf2dDimension.cxx @@ -198,7 +198,7 @@ void PrsDim_Chamf2dDimension::ComputeSelection(const Handle(SelectMgr_Selection) aSelection->Add(seg); // Text - Standard_Real size(Min(myVal / 100. + 1.e-6, myArrowSize + 1.e-6)); + Standard_Real size(std::min(myVal / 100. + 1.e-6, myArrowSize + 1.e-6)); Handle(Select3D_SensitiveBox) box = new Select3D_SensitiveBox(own, myPosition.X(), myPosition.Y(), diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_Chamf3dDimension.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_Chamf3dDimension.cxx index e2902afbb4..168d3c969b 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_Chamf3dDimension.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_Chamf3dDimension.cxx @@ -169,7 +169,7 @@ void PrsDim_Chamf3dDimension::ComputeSelection(const Handle(SelectMgr_Selection) aSelection->Add(seg); // Text - Standard_Real size(Min(myVal / 100. + 1.e-6, myArrowSize + 1.e-6)); + Standard_Real size(std::min(myVal / 100. + 1.e-6, myArrowSize + 1.e-6)); Handle(Select3D_SensitiveBox) box = new Select3D_SensitiveBox(own, myPosition.X(), myPosition.Y(), diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_ConcentricRelation.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_ConcentricRelation.cxx index b3cebd5aec..6ccfeb8e40 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_ConcentricRelation.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_ConcentricRelation.cxx @@ -110,7 +110,7 @@ void PrsDim_ConcentricRelation::ComputeEdgeVertexConcentric( Handle(Geom_Circle) CIRCLE(Handle(Geom_Circle)::DownCast(C)); myCenter = CIRCLE->Location(); - myRad = Min(CIRCLE->Radius() / 5., 15.); + myRad = std::min(CIRCLE->Radius() / 5., 15.); gp_Dir vec(p1.XYZ() - myCenter.XYZ()); gp_Vec vectrans(vec); myPnt = myCenter.Translated(vectrans.Multiplied(myRad)); diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_DiameterDimension.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_DiameterDimension.cxx index 8312816552..57365ac430 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_DiameterDimension.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_DiameterDimension.cxx @@ -304,7 +304,7 @@ Standard_Boolean PrsDim_DiameterDimension::IsValidAnchor(const gp_Circ& theCircl Standard_Real anAnchorDist = theAnchor.Distance(theCircle.Location()); Standard_Real aRadius = myCircle.Radius(); - return Abs(anAnchorDist - aRadius) > Precision::Confusion() + return std::abs(anAnchorDist - aRadius) > Precision::Confusion() && aCirclePlane.Contains(theAnchor, Precision::Confusion()); } diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_Dimension.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_Dimension.cxx index 26de54c89d..5c2f8e46e6 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_Dimension.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_Dimension.cxx @@ -1416,7 +1416,7 @@ void PrsDim_Dimension::PointsForArrow(const gp_Pnt& thePeakPnt, gp_Pnt anArrowEnd = ElCLib::Value(theArrowLength, anArrowLin); gp_Lin anEdgeLin(anArrowEnd, theDirection.Crossed(thePlane)); - Standard_Real anEdgeLength = Tan(theArrowAngle) * theArrowLength; + Standard_Real anEdgeLength = std::tan(theArrowAngle) * theArrowLength; theSidePnt1 = ElCLib::Value(anEdgeLength, anEdgeLin); theSidePnt2 = ElCLib::Value(-anEdgeLength, anEdgeLin); diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_EllipseRadiusDimension.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_EllipseRadiusDimension.cxx index ffcfba44d3..4d19e2ad3d 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_EllipseRadiusDimension.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_EllipseRadiusDimension.cxx @@ -159,7 +159,7 @@ void PrsDim_EllipseRadiusDimension::ComputeCylFaceGeometry(const PrsDim_KindOfSu if (surf1.GetType() == GeomAbs_OffsetSurface) { - if (Offset < 0.0 && Abs(Offset) > myEllipse.MinorRadius()) + if (Offset < 0.0 && std::abs(Offset) > myEllipse.MinorRadius()) { throw Standard_ConstructionError( "PrsDim:: Absolute value of negative offset is larger than MinorRadius"); diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_EqualDistanceRelation.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_EqualDistanceRelation.cxx index 92be5ee303..6d1bb77c3e 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_EqualDistanceRelation.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_EqualDistanceRelation.cxx @@ -484,7 +484,7 @@ void PrsDim_EqualDistanceRelation::ComputeTwoEdgesLength( constexpr Standard_Real confusion(Precision::Confusion()); if (arrsize < confusion) arrsize = Val * 0.1; - if (Abs(Val) <= confusion) + if (std::abs(Val) <= confusion) { arrsize = 0.; } @@ -595,7 +595,7 @@ void PrsDim_EqualDistanceRelation::ComputeTwoEdgesLength( if (arrsize < Precision::Confusion()) arrsize = Val * 0.1; - if (Abs(Val) <= Precision::Confusion()) + if (std::abs(Val) <= Precision::Confusion()) { arrsize = 0.; } @@ -770,7 +770,7 @@ void PrsDim_EqualDistanceRelation::ComputeOneEdgeOneVertexLength( gp_Dir DirAttach = l.Direction(); // size Standard_Real arrsize = ArrowSize; - if (Abs(Val) <= Precision::Confusion()) + if (std::abs(Val) <= Precision::Confusion()) { arrsize = 0.; } diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_EqualRadiusRelation.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_EqualRadiusRelation.cxx index 4a46c1c64d..abe5e9b3d8 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_EqualRadiusRelation.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_EqualRadiusRelation.cxx @@ -109,11 +109,11 @@ void PrsDim_EqualRadiusRelation::Compute(const Handle(PrsMgr_PresentationManager else { Standard_Real aPar = ElCLib::Parameter(FirstCirc, myFirstPoint); - if (IntegerPart(0.5 * LastPar1 / M_PI) != 0 && aPar < FirstPar1) - aPar += 2 * M_PI * IntegerPart(0.5 * LastPar1 / M_PI); + if (std::trunc(0.5 * LastPar1 / M_PI) != 0 && aPar < FirstPar1) + aPar += 2 * M_PI * std::trunc(0.5 * LastPar1 / M_PI); Standard_Real aRadius = FirstCirc.Radius(); - if (Abs(myFirstPoint.Distance(myFirstCenter) - aRadius) >= Precision::Confusion()) + if (std::abs(myFirstPoint.Distance(myFirstCenter) - aRadius) >= Precision::Confusion()) myFirstPoint = ElCLib::Value(aPar, FirstCirc); if (FirstPoint1.Distance(LastPoint1) > Precision::Confusion()) { @@ -129,11 +129,11 @@ void PrsDim_EqualRadiusRelation::Compute(const Handle(PrsMgr_PresentationManager } aPar = ElCLib::Parameter(SecondCirc, mySecondPoint); - if (IntegerPart(0.5 * LastPar2 / M_PI) != 0 && aPar < FirstPar2) - aPar += 2 * M_PI * IntegerPart(0.5 * LastPar2 / M_PI); + if (std::trunc(0.5 * LastPar2 / M_PI) != 0 && aPar < FirstPar2) + aPar += 2 * M_PI * std::trunc(0.5 * LastPar2 / M_PI); aRadius = SecondCirc.Radius(); - if (Abs(mySecondPoint.Distance(mySecondCenter) - aRadius) >= Precision::Confusion()) + if (std::abs(mySecondPoint.Distance(mySecondCenter) - aRadius) >= Precision::Confusion()) mySecondPoint = ElCLib::Value(aPar, SecondCirc); if (FirstPoint2.Distance(LastPoint2) > Precision::Confusion()) { @@ -148,7 +148,8 @@ void PrsDim_EqualRadiusRelation::Compute(const Handle(PrsMgr_PresentationManager } if (!myArrowSizeIsDefined) myArrowSize = - (Min(myFirstCenter.Distance(myFirstPoint), mySecondCenter.Distance(mySecondPoint))) * 0.05; + (std::min(myFirstCenter.Distance(myFirstPoint), mySecondCenter.Distance(mySecondPoint))) + * 0.05; Handle(Prs3d_DimensionAspect) la = myDrawer->DimensionAspect(); Handle(Prs3d_ArrowAspect) arr = la->ArrowAspect(); diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_FixRelation.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_FixRelation.cxx index 0081b35629..7bed3d0e07 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_FixRelation.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_FixRelation.cxx @@ -431,7 +431,7 @@ void PrsDim_FixRelation::ComputeCirclePosition(const gp_Circ& gcirc, // readjust parametres on the circle if (plast > 2 * M_PI) { - Standard_Real nbtours = Floor(plast / (2 * M_PI)); + Standard_Real nbtours = std::floor(plast / (2 * M_PI)); plast -= nbtours * 2 * M_PI; pfirst -= nbtours * 2 * M_PI; } diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_IdenticRelation.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_IdenticRelation.cxx index 67548a30cd..80dd9f258c 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_IdenticRelation.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_IdenticRelation.cxx @@ -64,10 +64,10 @@ static Standard_Boolean IsEqual2PI(const Standard_Real angle1, const Standard_Real angle2, const Standard_Real precision) { - Standard_Real diff = Abs(angle1 - angle2); + Standard_Real diff = std::abs(angle1 - angle2); if (diff < precision) return Standard_True; - else if (Abs(diff - 2 * M_PI) < precision) + else if (std::abs(diff - 2 * M_PI) < precision) return Standard_True; return Standard_False; } @@ -849,7 +849,7 @@ void PrsDim_IdenticRelation::ComputeTwoCirclesPresentation(const Handle(Prs3d_Pr att = pf1; curpos = firstp1; } - Standard_Real maxrad = Min(Modulo2PI(pl1 - pf1), Modulo2PI(pl2 - pf2)) * 3 / 4; + Standard_Real maxrad = std::min(Modulo2PI(pl1 - pf1), Modulo2PI(pl2 - pf2)) * 3 / 4; if (rad > maxrad) rad = maxrad; Standard_Real pFAttach = Modulo2PI(att - rad); @@ -1209,7 +1209,7 @@ void PrsDim_IdenticRelation::ComputeTwoEllipsesPresentation(const Handle(Prs3d_P att = pf1; curpos = firstp1; } - Standard_Real maxrad = Min(Modulo2PI(pl1 - pf1), Modulo2PI(pl2 - pf2)) * 3 / 4; + Standard_Real maxrad = std::min(Modulo2PI(pl1 - pf1), Modulo2PI(pl2 - pf2)) * 3 / 4; if (rad > maxrad) rad = maxrad; Standard_Real pFAttach = Modulo2PI(att - rad); diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_LengthDimension.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_LengthDimension.cxx index 409238ed85..6a4230eec1 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_LengthDimension.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_LengthDimension.cxx @@ -529,7 +529,8 @@ Standard_Boolean PrsDim_LengthDimension::InitEdgeFaceLength(const TopoDS_Edge& t // reverse direction if parameter is close to the end of the curve, // to reduce chances to have overlapping between dimension line and edge - if (Abs(aParam - aCurveAdaptor.FirstParameter()) < Abs(aParam - aCurveAdaptor.LastParameter())) + if (std::abs(aParam - aCurveAdaptor.FirstParameter()) + < std::abs(aParam - aCurveAdaptor.LastParameter())) { theEdgeDir.Reverse(); } diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_MaxRadiusDimension.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_MaxRadiusDimension.cxx index b0c069fc08..04ae7e081a 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_MaxRadiusDimension.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_MaxRadiusDimension.cxx @@ -104,7 +104,7 @@ void PrsDim_MaxRadiusDimension::ComputeEllipse(const Handle(Prs3d_Presentation)& // size if (!myArrowSizeIsDefined) { - myArrowSize = Min(myArrowSize, myVal / 5.); + myArrowSize = std::min(myArrowSize, myVal / 5.); } arr->SetLength(myArrowSize); @@ -157,7 +157,7 @@ void PrsDim_MaxRadiusDimension::ComputeArcOfEllipse(const Handle(Prs3d_Presentat // size if (!myArrowSizeIsDefined) { - myArrowSize = Min(myArrowSize, myVal / 5.); + myArrowSize = std::min(myArrowSize, myVal / 5.); } arr->SetLength(myArrowSize); @@ -252,7 +252,7 @@ void PrsDim_MaxRadiusDimension::ComputeSelection(const Handle(SelectMgr_Selectio aSelection->Add(seg); // Text - Standard_Real size(Min(myVal / 100. + 1.e-6, myArrowSize + 1.e-6)); + Standard_Real size(std::min(myVal / 100. + 1.e-6, myArrowSize + 1.e-6)); Handle(Select3D_SensitiveBox) box = new Select3D_SensitiveBox(own, AttachmentPoint.X(), AttachmentPoint.Y(), diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_MidPointRelation.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_MidPointRelation.cxx index 566e8efd35..a8b0c15159 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_MidPointRelation.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_MidPointRelation.cxx @@ -420,7 +420,7 @@ void PrsDim_MidPointRelation::ComputePointsOnLine(const gp_Pnt& pnt1, gp_Pnt aProjPnt = ElCLib::Value(ppar, aLin); Standard_Real dist = myMidPoint.Distance(aProjPnt); Standard_Real ll = pnt1.Distance(pnt2); - Standard_Real segm = Min(dist, ll) * 0.75; + Standard_Real segm = std::min(dist, ll) * 0.75; if (dist < Precision::Confusion()) segm = ll * 0.75; @@ -446,12 +446,12 @@ void PrsDim_MidPointRelation::ComputePointsOnLine(const gp_Pnt& pnt1, Standard_Real dp1 = aProjPnt.Distance(pnt1); Standard_Real dp2 = aProjPnt.Distance(pnt2); - segm = Min(dist, dp1) * 0.75; + segm = std::min(dist, dp1) * 0.75; aVecTr = gp_Vec(aProjPnt, pnt1); aVecTr.Normalize(); aPnt1 = aProjPnt.Translated(aVecTr * segm); - segm = Min(dist, dp2) * 0.75; + segm = std::min(dist, dp2) * 0.75; aVecTr = gp_Vec(aProjPnt, pnt2); aVecTr.Normalize(); aPnt2 = aProjPnt.Translated(aVecTr * segm); @@ -527,7 +527,7 @@ void PrsDim_MidPointRelation::ComputePointsOnCirc(const gp_Circ& aCirc, pcurpos1 = pcurpos1 + 2 * M_PI - pFAttach; if (pcurpos1 > pSAttachM) // out { - segm = Min(rad, deltap * 0.75); + segm = std::min(rad, deltap * 0.75); if (pcurpos1 > pmiddleout) { pcurpos = pFAttach; @@ -546,17 +546,17 @@ void PrsDim_MidPointRelation::ComputePointsOnCirc(const gp_Circ& aCirc, Standard_Real dp1 = pcurpos1 - pFAttach; Standard_Real dp2 = pSAttachM - pcurpos1; - segm = Min(rad, dp1 * 0.75); + segm = std::min(rad, dp1 * 0.75); pFPnt = pcurpos - segm; - segm = Min(rad, dp2 * 0.75); + segm = std::min(rad, dp2 * 0.75); pSPnt = pcurpos + segm; } } else if (pcurpos1 > (pFAttach + deltap)) // out { pcurpos1 -= pFAttach; - segm = Min(rad, deltap * 0.75); + segm = std::min(rad, deltap * 0.75); if (pcurpos1 > pmiddleout) { pcurpos = pFAttach; @@ -575,10 +575,10 @@ void PrsDim_MidPointRelation::ComputePointsOnCirc(const gp_Circ& aCirc, Standard_Real dp1 = pcurpos1 - pFAttach; Standard_Real dp2 = pSAttach - pcurpos1; - segm = Min(rad, dp1 * 0.75); + segm = std::min(rad, dp1 * 0.75); pFPnt = pcurpos - segm; - segm = Min(rad, dp2 * 0.75); + segm = std::min(rad, dp2 * 0.75); pSPnt = pcurpos + segm; } } @@ -653,7 +653,7 @@ void PrsDim_MidPointRelation::ComputePointsOnElips(const gp_Elips& anEll, pcurpos1 = pcurpos1 + 2 * M_PI - pFAttach; if (pcurpos1 > pSAttachM) // out { - segm = Min(rad, deltap * 0.75); + segm = std::min(rad, deltap * 0.75); if (pcurpos1 > pmiddleout) { pcurpos = pFAttach; @@ -672,17 +672,17 @@ void PrsDim_MidPointRelation::ComputePointsOnElips(const gp_Elips& anEll, Standard_Real dp1 = pcurpos1 - pFAttach; Standard_Real dp2 = pSAttachM - pcurpos1; - segm = Min(rad, dp1 * 0.75); + segm = std::min(rad, dp1 * 0.75); pFPnt = pcurpos - segm; - segm = Min(rad, dp2 * 0.75); + segm = std::min(rad, dp2 * 0.75); pSPnt = pcurpos + segm; } } else if (pcurpos1 > (pFAttach + deltap)) // out { pcurpos1 -= pFAttach; - segm = Min(rad, deltap * 0.75); + segm = std::min(rad, deltap * 0.75); if (pcurpos1 > pmiddleout) { pcurpos = pFAttach; @@ -701,10 +701,10 @@ void PrsDim_MidPointRelation::ComputePointsOnElips(const gp_Elips& anEll, Standard_Real dp1 = pcurpos1 - pFAttach; Standard_Real dp2 = pSAttach - pcurpos1; - segm = Min(rad, dp1 * 0.75); + segm = std::min(rad, dp1 * 0.75); pFPnt = pcurpos - segm; - segm = Min(rad, dp2 * 0.75); + segm = std::min(rad, dp2 * 0.75); pSPnt = pcurpos + segm; } } diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_MinRadiusDimension.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_MinRadiusDimension.cxx index 8e7d57c761..6b2cff9d51 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_MinRadiusDimension.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_MinRadiusDimension.cxx @@ -107,7 +107,7 @@ void PrsDim_MinRadiusDimension::ComputeEllipse(const Handle(Prs3d_Presentation)& // size if (!myArrowSizeIsDefined) { - myArrowSize = Min(myArrowSize, myVal / 5.); + myArrowSize = std::min(myArrowSize, myVal / 5.); } arr->SetLength(myArrowSize); @@ -161,7 +161,7 @@ void PrsDim_MinRadiusDimension::ComputeArcOfEllipse(const Handle(Prs3d_Presentat // size if (!myArrowSizeIsDefined) { - myArrowSize = Min(myArrowSize, myVal / 5.); + myArrowSize = std::min(myArrowSize, myVal / 5.); } arr->SetLength(myArrowSize); @@ -254,7 +254,7 @@ void PrsDim_MinRadiusDimension::ComputeSelection(const Handle(SelectMgr_Selectio aSelection->Add(seg); // Text - Standard_Real size(Min(myVal / 100. + 1.e-6, myArrowSize + 1.e-6)); + Standard_Real size(std::min(myVal / 100. + 1.e-6, myArrowSize + 1.e-6)); Handle(Select3D_SensitiveBox) box = new Select3D_SensitiveBox(own, AttachmentPoint.X(), AttachmentPoint.Y(), diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_OffsetDimension.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_OffsetDimension.cxx index c9392fd780..7a8ad0413c 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_OffsetDimension.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_OffsetDimension.cxx @@ -178,7 +178,7 @@ void PrsDim_OffsetDimension::ComputeSelection(const Handle(SelectMgr_Selection)& } // Text - Standard_Real size(Min(myVal / 100. + 1.e-6, myArrowSize + 1.e-6)); + Standard_Real size(std::min(myVal / 100. + 1.e-6, myArrowSize + 1.e-6)); Handle(Select3D_SensitiveBox) box = new Select3D_SensitiveBox(own, Tcurpos.X(), Tcurpos.Y(), @@ -194,12 +194,12 @@ void PrsDim_OffsetDimension::ComputeSelection(const Handle(SelectMgr_Selection)& parmax = parmin; parcur = ElCLib::Parameter(L3, Proj2); - parmin = Min(parmin, parcur); - parmax = Max(parmax, parcur); + parmin = std::min(parmin, parcur); + parmax = std::max(parmax, parcur); parcur = ElCLib::Parameter(L3, Tcurpos); - parmin = Min(parmin, parcur); - parmax = Max(parmax, parcur); + parmin = std::min(parmin, parcur); + parmax = std::max(parmax, parcur); gp_Pnt PointMin = ElCLib::Value(parmin, L3); gp_Pnt PointMax = ElCLib::Value(parmax, L3); diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_ParallelRelation.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_ParallelRelation.cxx index 269a6e6786..ba433be6f7 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_ParallelRelation.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_ParallelRelation.cxx @@ -119,7 +119,7 @@ void PrsDim_ParallelRelation::ComputeSelection(const Handle(SelectMgr_Selection) else { L3 = gce_MakeLin(Proj1, myDirAttach); - Standard_Real size(Min(myVal / 100. + 1.e-6, myArrowSize + 1.e-6)); + Standard_Real size(std::min(myVal / 100. + 1.e-6, myArrowSize + 1.e-6)); Handle(Select3D_SensitiveBox) box = new Select3D_SensitiveBox(own, myPosition.X(), myPosition.Y(), @@ -134,12 +134,12 @@ void PrsDim_ParallelRelation::ComputeSelection(const Handle(SelectMgr_Selection) parmax = parmin; parcur = ElCLib::Parameter(L3, Proj2); - parmin = Min(parmin, parcur); - parmax = Max(parmax, parcur); + parmin = std::min(parmin, parcur); + parmax = std::max(parmax, parcur); parcur = ElCLib::Parameter(L3, myPosition); - parmin = Min(parmin, parcur); - parmax = Max(parmax, parcur); + parmin = std::min(parmin, parcur); + parmax = std::max(parmax, parcur); gp_Pnt PointMin = ElCLib::Value(parmin, L3); gp_Pnt PointMax = ElCLib::Value(parmax, L3); @@ -257,8 +257,8 @@ void PrsDim_ParallelRelation::ComputeTwoEdgesParallel( arrSize1 = ptat11.Distance(ptat12) / 50.; if (!isInfinite2) arrSize2 = ptat21.Distance(ptat22) / 50.; - myArrowSize = Max(myArrowSize, Max(arrSize1, arrSize2)); - // myArrowSize = Min(myArrowSize,Min(arrSize1,arrSize2)); + myArrowSize = std::max(myArrowSize, std::max(arrSize1, arrSize2)); + // myArrowSize = std::min(myArrowSize,Min(arrSize1,arrSize2)); } if (myAutomaticPosition) diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_PerpendicularRelation.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_PerpendicularRelation.cxx index 3987028613..be002b4fce 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_PerpendicularRelation.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_PerpendicularRelation.cxx @@ -253,8 +253,8 @@ void PrsDim_PerpendicularRelation::ComputeTwoEdgesPerpendicular( curpar = ElCLib::Parameter(geom_lin1->Lin(), pint3d); par1 = ElCLib::Parameter(geom_lin1->Lin(), ptat11); par2 = ElCLib::Parameter(geom_lin1->Lin(), ptat12); - pmin = Min(par1, par2); - pmax = Max(par1, par2); + pmin = std::min(par1, par2); + pmax = std::max(par1, par2); if (myPosition.SquareDistance(ptat11) > myPosition.SquareDistance(ptat12)) p1 = ptat11; @@ -265,7 +265,7 @@ void PrsDim_PerpendicularRelation::ComputeTwoEdgesPerpendicular( interOut1 = Standard_True; } if (!isInfinite2) - length = 2. * Min(ptat11.Distance(ptat12), ptat21.Distance(ptat22)) / 5.; + length = 2. * std::min(ptat11.Distance(ptat12), ptat21.Distance(ptat22)) / 5.; else length = 2. * ptat11.Distance(ptat12) / 5.; lengthComputed = Standard_True; @@ -279,8 +279,8 @@ void PrsDim_PerpendicularRelation::ComputeTwoEdgesPerpendicular( curpar = ElCLib::Parameter(geom_lin2->Lin(), pint3d); par1 = ElCLib::Parameter(geom_lin2->Lin(), ptat21); par2 = ElCLib::Parameter(geom_lin2->Lin(), ptat22); - pmin = Min(par1, par2); - pmax = Max(par1, par2); + pmin = std::min(par1, par2); + pmax = std::max(par1, par2); if (myPosition.SquareDistance(ptat21) > myPosition.SquareDistance(ptat22)) p2 = ptat21; @@ -294,7 +294,7 @@ void PrsDim_PerpendicularRelation::ComputeTwoEdgesPerpendicular( if (!lengthComputed) { if (!isInfinite1) - length = 2. * Min(ptat11.Distance(ptat12), ptat21.Distance(ptat22)) / 5.; + length = 2. * std::min(ptat11.Distance(ptat12), ptat21.Distance(ptat22)) / 5.; else length = 2. * ptat21.Distance(ptat22) / 5.; } diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_SymmetricRelation.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_SymmetricRelation.cxx index 8b32ebf373..e759179bb1 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_SymmetricRelation.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_SymmetricRelation.cxx @@ -170,7 +170,7 @@ void PrsDim_SymmetricRelation::ComputeSelection(const Handle(SelectMgr_Selection else { L3 = gce_MakeLin(P1, myFDirAttach); - Standard_Real size(Min(myVal / 100. + 1.e-6, myArrowSize + 1.e-6)); + Standard_Real size(std::min(myVal / 100. + 1.e-6, myArrowSize + 1.e-6)); Handle(Select3D_SensitiveBox) box = new Select3D_SensitiveBox(own, myPosition.X(), myPosition.Y(), @@ -185,12 +185,12 @@ void PrsDim_SymmetricRelation::ComputeSelection(const Handle(SelectMgr_Selection parmax = parmin; parcur = ElCLib::Parameter(L3, P2); - parmin = Min(parmin, parcur); - parmax = Max(parmax, parcur); + parmin = std::min(parmin, parcur); + parmax = std::max(parmax, parcur); parcur = ElCLib::Parameter(L3, myPosition); - parmin = Min(parmin, parcur); - parmax = Max(parmax, parcur); + parmin = std::min(parmin, parcur); + parmax = std::max(parmax, parcur); gp_Pnt PointMin = ElCLib::Value(parmin, L3); gp_Pnt PointMax = ElCLib::Value(parmax, L3); @@ -237,7 +237,7 @@ void PrsDim_SymmetricRelation::ComputeSelection(const Handle(SelectMgr_Selection ProjOffsetPoint = ProjCenter1.Translated(Vout.Divided(Vout.Magnitude()).Multiplied(Dt)); OffsetPnt = ProjOffsetPoint; } - h = Sqrt(R * R - Dt * Dt); + h = std::sqrt(R * R - Dt * Dt); gp_Pnt P1 = ProjOffsetPoint.Translated(Vp.Added(Vp.Divided(Vp.Magnitude()).Multiplied(h))); gp_Vec v(P1, ProjOffsetPoint); gp_Pnt P2 = ProjOffsetPoint.Translated(v); @@ -250,7 +250,7 @@ void PrsDim_SymmetricRelation::ComputeSelection(const Handle(SelectMgr_Selection else { L3 = gce_MakeLin(P1, laxis.Direction()); - Standard_Real size(Min(myVal / 100. + 1.e-6, myArrowSize + 1.e-6)); + Standard_Real size(std::min(myVal / 100. + 1.e-6, myArrowSize + 1.e-6)); Handle(Select3D_SensitiveBox) box = new Select3D_SensitiveBox(own, myPosition.X(), myPosition.Y(), @@ -265,12 +265,12 @@ void PrsDim_SymmetricRelation::ComputeSelection(const Handle(SelectMgr_Selection parmax = parmin; parcur = ElCLib::Parameter(L3, P2); - parmin = Min(parmin, parcur); - parmax = Max(parmax, parcur); + parmin = std::min(parmin, parcur); + parmax = std::max(parmax, parcur); parcur = ElCLib::Parameter(L3, myPosition); - parmin = Min(parmin, parcur); - parmax = Max(parmax, parcur); + parmin = std::min(parmin, parcur); + parmax = std::max(parmax, parcur); gp_Pnt PointMin = ElCLib::Value(parmin, L3); gp_Pnt PointMax = ElCLib::Value(parmax, L3); @@ -306,7 +306,7 @@ void PrsDim_SymmetricRelation::ComputeSelection(const Handle(SelectMgr_Selection else { L3 = gce_MakeLin(P1, myFDirAttach); - Standard_Real size(Min(myVal / 100. + 1.e-6, myArrowSize + 1.e-6)); + Standard_Real size(std::min(myVal / 100. + 1.e-6, myArrowSize + 1.e-6)); Handle(Select3D_SensitiveBox) box = new Select3D_SensitiveBox(own, myPosition.X(), myPosition.Y(), @@ -321,12 +321,12 @@ void PrsDim_SymmetricRelation::ComputeSelection(const Handle(SelectMgr_Selection parmax = parmin; parcur = ElCLib::Parameter(L3, P2); - parmin = Min(parmin, parcur); - parmax = Max(parmax, parcur); + parmin = std::min(parmin, parcur); + parmax = std::max(parmax, parcur); parcur = ElCLib::Parameter(L3, myPosition); - parmin = Min(parmin, parcur); - parmax = Max(parmax, parcur); + parmin = std::min(parmin, parcur); + parmax = std::max(parmax, parcur); gp_Pnt PointMin = ElCLib::Value(parmin, L3); gp_Pnt PointMax = ElCLib::Value(parmax, L3); diff --git a/src/Visualization/TKV3d/PrsDim/PrsDim_TangentRelation.cxx b/src/Visualization/TKV3d/PrsDim/PrsDim_TangentRelation.cxx index 2b839d1fed..d3cb85b606 100644 --- a/src/Visualization/TKV3d/PrsDim/PrsDim_TangentRelation.cxx +++ b/src/Visualization/TKV3d/PrsDim/PrsDim_TangentRelation.cxx @@ -368,7 +368,7 @@ void PrsDim_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentat Handle(Geom_Circle) circle2(Handle(Geom_Circle)::DownCast(copy2)); Standard_Real R1 = circle1->Radius(); Standard_Real R2 = circle2->Radius(); - myLength = Max(R1, R2) / 5.0; + myLength = std::max(R1, R2) / 5.0; if (!found) { if ((circle1->Location()).IsEqual(circle2->Location(), Precision::Confusion())) @@ -410,7 +410,7 @@ void PrsDim_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentat Handle(Geom_Ellipse) ellipse(Handle(Geom_Ellipse)::DownCast(copy2)); Standard_Real R1 = circle->Radius(); Standard_Real R2 = ellipse->MajorRadius(); - myLength = Max(R1, R2) / 5.0; + myLength = std::max(R1, R2) / 5.0; if (!found) { if (R1 >= R2) @@ -440,7 +440,7 @@ void PrsDim_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentat Handle(Geom_Circle) circle(Handle(Geom_Circle)::DownCast(copy2)); Standard_Real R1 = ellipse->MajorRadius(); Standard_Real R2 = circle->Radius(); - myLength = Max(R1, R2) / 5.0; + myLength = std::max(R1, R2) / 5.0; if (!found) { if (R1 >= R2) @@ -470,7 +470,7 @@ void PrsDim_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentat Handle(Geom_Ellipse) ellipse2(Handle(Geom_Ellipse)::DownCast(copy2)); Standard_Real R1 = ellipse1->MajorRadius(); Standard_Real R2 = ellipse2->MajorRadius(); - myLength = Max(R1, R2) / 5.0; + myLength = std::max(R1, R2) / 5.0; if (!found) { if (R1 > R2) @@ -502,7 +502,7 @@ void PrsDim_TangentRelation::ComputeTwoEdgesTangent(const Handle(Prs3d_Presentat myAttach = pint3d; myDir = theDir; myPosition = pint3d; - myLength = Min(myLength, myArrowSize); + myLength = std::min(myLength, myArrowSize); DsgPrs_TangentPresentation::Add(aPresentation, myDrawer, myAttach, myDir, myLength); if ((myExtShape != 0) && !extCurv.IsNull()) diff --git a/src/Visualization/TKV3d/Select3D/Select3D_SensitiveCylinder.cxx b/src/Visualization/TKV3d/Select3D/Select3D_SensitiveCylinder.cxx index 61be6440ea..0b25d9bdb8 100644 --- a/src/Visualization/TKV3d/Select3D/Select3D_SensitiveCylinder.cxx +++ b/src/Visualization/TKV3d/Select3D/Select3D_SensitiveCylinder.cxx @@ -86,7 +86,7 @@ Handle(Select3D_SensitiveEntity) Select3D_SensitiveCylinder::GetConnected() Select3D_BndBox3d Select3D_SensitiveCylinder::BoundingBox() { - Standard_Real aMaxRad = Max(myBottomRadius, myTopRadius); + Standard_Real aMaxRad = std::max(myBottomRadius, myTopRadius); Graphic3d_Mat4d aTrsf; myTrsf.GetMat4(aTrsf); diff --git a/src/Visualization/TKV3d/Select3D/Select3D_SensitiveGroup.cxx b/src/Visualization/TKV3d/Select3D/Select3D_SensitiveGroup.cxx index 521ee90570..69664d7640 100644 --- a/src/Visualization/TKV3d/Select3D/Select3D_SensitiveGroup.cxx +++ b/src/Visualization/TKV3d/Select3D/Select3D_SensitiveGroup.cxx @@ -35,7 +35,7 @@ Select3D_SensitiveGroup::Select3D_SensitiveGroup(const Handle(SelectMgr_EntityOw Select3D_EntitySequence& theEntities, const Standard_Boolean theIsMustMatchAll) : Select3D_SensitiveSet(theOwnerId), - myEntities(Max(1, theEntities.Size())), + myEntities(std::max(1, theEntities.Size())), myMustMatchAll(theIsMustMatchAll), myToCheckOverlapAll(Standard_False), myCenter(0.0, 0.0, 0.0) diff --git a/src/Visualization/TKV3d/Select3D/Select3D_SensitivePoly.cxx b/src/Visualization/TKV3d/Select3D/Select3D_SensitivePoly.cxx index 2bdd39da26..b7c29f628c 100644 --- a/src/Visualization/TKV3d/Select3D/Select3D_SensitivePoly.cxx +++ b/src/Visualization/TKV3d/Select3D/Select3D_SensitivePoly.cxx @@ -36,7 +36,7 @@ static Standard_Integer GetCircleNbPoints(const gp_Circ& theCircle, if (theCircle.Radius() > Precision::Confusion()) { const Standard_Boolean isSector = - theIsFilled && Abs(Abs(theU2 - theU1) - 2.0 * M_PI) > gp::Resolution(); + theIsFilled && std::abs(std::abs(theU2 - theU1) - 2.0 * M_PI) > gp::Resolution(); return 2 * theNbPnts + 1 + (isSector ? 2 : 0); } @@ -59,7 +59,7 @@ static void initCircle(Select3D_PointData& thePolygon, gp_Pnt aP1; gp_Vec aV1; - const Standard_Boolean isSector = Abs(theU2 - theU1 - 2.0 * M_PI) > gp::Resolution(); + const Standard_Boolean isSector = std::abs(theU2 - theU1 - 2.0 * M_PI) > gp::Resolution(); if (isSector && theIsFilled) { @@ -72,7 +72,7 @@ static void initCircle(Select3D_PointData& thePolygon, thePolygon.SetPnt(aPntIdx++, aP1); aV1.Normalize(); - const gp_Pnt aP2 = aP1.XYZ() + aV1.XYZ() * Tan(aStep * 0.5) * aRadius; + const gp_Pnt aP2 = aP1.XYZ() + aV1.XYZ() * std::tan(aStep * 0.5) * aRadius; thePolygon.SetPnt(aPntIdx++, aP2); } aP1 = ElCLib::CircleValue(theU2, theCircle.Position(), theCircle.Radius()); @@ -202,7 +202,12 @@ Select3D_SensitivePoly::Select3D_SensitivePoly(const Handle(SelectMgr_EntityOwne if (myPolyg.Size() != 1) { - initCircle(myPolyg, theCircle, Min(theU1, theU2), Max(theU1, theU2), theIsFilled, theNbPnts); + initCircle(myPolyg, + theCircle, + std::min(theU1, theU2), + std::max(theU1, theU2), + theIsFilled, + theNbPnts); } else { @@ -308,12 +313,12 @@ Select3D_BndBox3d Select3D_SensitivePoly::Box(const Standard_Integer theIdx) con gp_Pnt aPnt1 = myPolyg.Pnt3d(aSegmentIdx); gp_Pnt aPnt2 = myPolyg.Pnt3d(aSegmentIdx + 1); - const SelectMgr_Vec3 aMinPnt(Min(aPnt1.X(), aPnt2.X()), - Min(aPnt1.Y(), aPnt2.Y()), - Min(aPnt1.Z(), aPnt2.Z())); - const SelectMgr_Vec3 aMaxPnt(Max(aPnt1.X(), aPnt2.X()), - Max(aPnt1.Y(), aPnt2.Y()), - Max(aPnt1.Z(), aPnt2.Z())); + const SelectMgr_Vec3 aMinPnt(std::min(aPnt1.X(), aPnt2.X()), + std::min(aPnt1.Y(), aPnt2.Y()), + std::min(aPnt1.Z(), aPnt2.Z())); + const SelectMgr_Vec3 aMaxPnt(std::max(aPnt1.X(), aPnt2.X()), + std::max(aPnt1.Y(), aPnt2.Y()), + std::max(aPnt1.Z(), aPnt2.Z())); return Select3D_BndBox3d(aMinPnt, aMaxPnt); } diff --git a/src/Visualization/TKV3d/Select3D/Select3D_SensitivePrimitiveArray.cxx b/src/Visualization/TKV3d/Select3D/Select3D_SensitivePrimitiveArray.cxx index fc0842d88b..0f1baa404f 100644 --- a/src/Visualization/TKV3d/Select3D/Select3D_SensitivePrimitiveArray.cxx +++ b/src/Visualization/TKV3d/Select3D/Select3D_SensitivePrimitiveArray.cxx @@ -84,7 +84,7 @@ struct Select3D_SensitivePrimitiveArray::Select3D_SensitivePrimitiveArray_InitFu Handle(Select3D_SensitivePrimitiveArray)& anEntity = myPrimArray.myGroups->ChangeValue(theIndex); const Standard_Integer aLower = myPrimArray.myIndexLower + theIndex * myDivStep; - const Standard_Integer anUpper = Min(aLower + myDivStep - 1, myPrimArray.myIndexUpper); + const Standard_Integer anUpper = std::min(aLower + myDivStep - 1, myPrimArray.myIndexUpper); anEntity = new Select3D_SensitivePrimitiveArray(myPrimArray.myOwnerId); anEntity->SetPatchSizeMax(myPrimArray.myPatchSizeMax); anEntity->SetPatchDistance(myPrimArray.myPatchDistance); diff --git a/src/Visualization/TKV3d/Select3D/Select3D_SensitiveSegment.cxx b/src/Visualization/TKV3d/Select3D/Select3D_SensitiveSegment.cxx index 66567c708d..885720eb15 100644 --- a/src/Visualization/TKV3d/Select3D/Select3D_SensitiveSegment.cxx +++ b/src/Visualization/TKV3d/Select3D/Select3D_SensitiveSegment.cxx @@ -86,12 +86,12 @@ gp_Pnt Select3D_SensitiveSegment::CenterOfGeometry() const //======================================================================= Select3D_BndBox3d Select3D_SensitiveSegment::BoundingBox() { - const SelectMgr_Vec3 aMinPnt(Min(myStart.X(), myEnd.X()), - Min(myStart.Y(), myEnd.Y()), - Min(myStart.Z(), myEnd.Z())); - const SelectMgr_Vec3 aMaxPnt(Max(myStart.X(), myEnd.X()), - Max(myStart.Y(), myEnd.Y()), - Max(myStart.Z(), myEnd.Z())); + const SelectMgr_Vec3 aMinPnt(std::min(myStart.X(), myEnd.X()), + std::min(myStart.Y(), myEnd.Y()), + std::min(myStart.Z(), myEnd.Z())); + const SelectMgr_Vec3 aMaxPnt(std::max(myStart.X(), myEnd.X()), + std::max(myStart.Y(), myEnd.Y()), + std::max(myStart.Z(), myEnd.Z())); return Select3D_BndBox3d(aMinPnt, aMaxPnt); } diff --git a/src/Visualization/TKV3d/Select3D/Select3D_SensitiveTriangle.cxx b/src/Visualization/TKV3d/Select3D/Select3D_SensitiveTriangle.cxx index 59642140ad..83624a0c09 100644 --- a/src/Visualization/TKV3d/Select3D/Select3D_SensitiveTriangle.cxx +++ b/src/Visualization/TKV3d/Select3D/Select3D_SensitiveTriangle.cxx @@ -85,13 +85,13 @@ Handle(Select3D_SensitiveEntity) Select3D_SensitiveTriangle::GetConnected() Select3D_BndBox3d Select3D_SensitiveTriangle::BoundingBox() { const SelectMgr_Vec3 aMinPnt = - SelectMgr_Vec3(Min(myPoints[0].X(), Min(myPoints[1].X(), myPoints[2].X())), - Min(myPoints[0].Y(), Min(myPoints[1].Y(), myPoints[2].Y())), - Min(myPoints[0].Z(), Min(myPoints[1].Z(), myPoints[2].Z()))); + SelectMgr_Vec3(std::min(myPoints[0].X(), std::min(myPoints[1].X(), myPoints[2].X())), + std::min(myPoints[0].Y(), std::min(myPoints[1].Y(), myPoints[2].Y())), + std::min(myPoints[0].Z(), std::min(myPoints[1].Z(), myPoints[2].Z()))); const SelectMgr_Vec3 aMaxPnt = - SelectMgr_Vec3(Max(myPoints[0].X(), Max(myPoints[1].X(), myPoints[2].X())), - Max(myPoints[0].Y(), Max(myPoints[1].Y(), myPoints[2].Y())), - Max(myPoints[0].Z(), Max(myPoints[1].Z(), myPoints[2].Z()))); + SelectMgr_Vec3(std::max(myPoints[0].X(), std::max(myPoints[1].X(), myPoints[2].X())), + std::max(myPoints[0].Y(), std::max(myPoints[1].Y(), myPoints[2].Y())), + std::max(myPoints[0].Z(), std::max(myPoints[1].Z(), myPoints[2].Z()))); return Select3D_BndBox3d(aMinPnt, aMaxPnt); } diff --git a/src/Visualization/TKV3d/Select3D/Select3D_SensitiveTriangulation.cxx b/src/Visualization/TKV3d/Select3D/Select3D_SensitiveTriangulation.cxx index 5647d9ce63..599dc7d057 100644 --- a/src/Visualization/TKV3d/Select3D/Select3D_SensitiveTriangulation.cxx +++ b/src/Visualization/TKV3d/Select3D/Select3D_SensitiveTriangulation.cxx @@ -218,12 +218,12 @@ Select3D_BndBox3d Select3D_SensitiveTriangulation::Box(const Standard_Integer th const gp_Pnt aPnt2 = myTriangul->Node(aNode2); const gp_Pnt aPnt3 = myTriangul->Node(aNode3); - aMinPnt = SelectMgr_Vec3(Min(aPnt1.X(), Min(aPnt2.X(), aPnt3.X())), - Min(aPnt1.Y(), Min(aPnt2.Y(), aPnt3.Y())), - Min(aPnt1.Z(), Min(aPnt2.Z(), aPnt3.Z()))); - aMaxPnt = SelectMgr_Vec3(Max(aPnt1.X(), Max(aPnt2.X(), aPnt3.X())), - Max(aPnt1.Y(), Max(aPnt2.Y(), aPnt3.Y())), - Max(aPnt1.Z(), Max(aPnt2.Z(), aPnt3.Z()))); + aMinPnt = SelectMgr_Vec3(std::min(aPnt1.X(), std::min(aPnt2.X(), aPnt3.X())), + std::min(aPnt1.Y(), std::min(aPnt2.Y(), aPnt3.Y())), + std::min(aPnt1.Z(), std::min(aPnt2.Z(), aPnt3.Z()))); + aMaxPnt = SelectMgr_Vec3(std::max(aPnt1.X(), std::max(aPnt2.X(), aPnt3.X())), + std::max(aPnt1.Y(), std::max(aPnt2.Y(), aPnt3.Y())), + std::max(aPnt1.Z(), std::max(aPnt2.Z(), aPnt3.Z()))); } else { @@ -232,12 +232,12 @@ Select3D_BndBox3d Select3D_SensitiveTriangulation::Box(const Standard_Integer th const gp_Pnt aNode1 = myTriangul->Node(aNodeIdx1); const gp_Pnt aNode2 = myTriangul->Node(aNodeIdx2); - aMinPnt = SelectMgr_Vec3(Min(aNode1.X(), aNode2.X()), - Min(aNode1.Y(), aNode2.Y()), - Min(aNode1.Z(), aNode2.Z())); - aMaxPnt = SelectMgr_Vec3(Max(aNode1.X(), aNode2.X()), - Max(aNode1.Y(), aNode2.Y()), - Max(aNode1.Z(), aNode2.Z())); + aMinPnt = SelectMgr_Vec3(std::min(aNode1.X(), aNode2.X()), + std::min(aNode1.Y(), aNode2.Y()), + std::min(aNode1.Z(), aNode2.Z())); + aMaxPnt = SelectMgr_Vec3(std::max(aNode1.X(), aNode2.X()), + std::max(aNode1.Y(), aNode2.Y()), + std::max(aNode1.Z(), aNode2.Z())); } return Select3D_BndBox3d(aMinPnt, aMaxPnt); diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_AxisIntersector.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_AxisIntersector.cxx index c315558cef..1595450a53 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_AxisIntersector.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_AxisIntersector.cxx @@ -201,7 +201,7 @@ bool SelectMgr_AxisIntersector::rayPlaneIntersection(const gp_Vec& th Standard_Real aD = thePlane.Dot(anU); Standard_Real aN = -thePlane.Dot(aW); - if (Abs(aD) < Precision::Confusion()) + if (std::abs(aD) < Precision::Confusion()) { thePickResult.Invalidate(); return false; @@ -262,7 +262,7 @@ Standard_Boolean SelectMgr_AxisIntersector::OverlapsBox( } Standard_Real aDepth = 0.0; - Bnd_Range aRange(Max(aTimeEnter, 0.0), aTimeLeave); + Bnd_Range aRange(std::max(aTimeEnter, 0.0), aTimeLeave); aRange.GetMin(aDepth); if (!theClipRange.GetNearestDepth(aRange, aDepth)) @@ -427,7 +427,7 @@ Standard_Boolean SelectMgr_AxisIntersector::OverlapsTriangle( const gp_Pnt aPnts[3] = {thePnt1, thePnt2, thePnt3}; const Standard_Real anAlpha = aTriangleNormal.XYZ().Dot(myAxis.Direction().XYZ()); - if (Abs(anAlpha) < gp::Resolution()) + if (std::abs(anAlpha) < gp::Resolution()) { // handle the case when triangle normal and selecting frustum direction are orthogonal SelectBasics_PickResult aPickResult; @@ -545,7 +545,7 @@ Standard_Boolean SelectMgr_AxisIntersector::OverlapsSphere( } Standard_Real aDepth = 0.0; - Bnd_Range aRange(Max(aTimeEnter, 0.0), aTimeLeave); + Bnd_Range aRange(std::max(aTimeEnter, 0.0), aTimeLeave); aRange.GetMin(aDepth); if (!theClipRange.GetNearestDepth(aRange, aDepth)) { @@ -591,7 +591,7 @@ Standard_Boolean SelectMgr_AxisIntersector::OverlapsCylinder( } Standard_Real aDepth = 0.0; - Bnd_Range aRange(Max(aTimeEnter, 0.0), Max(aTimeEnter, aTimeLeave)); + Bnd_Range aRange(std::max(aTimeEnter, 0.0), std::max(aTimeEnter, aTimeLeave)); aRange.GetMin(aDepth); if (!theClipRange.GetNearestDepth(aRange, aDepth)) { @@ -601,11 +601,11 @@ Standard_Boolean SelectMgr_AxisIntersector::OverlapsCylinder( const gp_Pnt aPntOnCylinder = aLoc.XYZ() + aRayDir.XYZ() * aDepth; thePickResult.SetDepth(aDepth); thePickResult.SetPickedPoint(aPntOnCylinder.Transformed(theTrsf)); - if (Abs(aPntOnCylinder.Z()) < Precision::Confusion()) + if (std::abs(aPntOnCylinder.Z()) < Precision::Confusion()) { thePickResult.SetSurfaceNormal(-gp::DZ().Transformed(theTrsf)); } - else if (Abs(aPntOnCylinder.Z() - theHeight) < Precision::Confusion()) + else if (std::abs(aPntOnCylinder.Z() - theHeight) < Precision::Confusion()) { thePickResult.SetSurfaceNormal(gp::DZ().Transformed(theTrsf)); } @@ -672,7 +672,7 @@ Standard_Boolean SelectMgr_AxisIntersector::OverlapsCircle( return false; } - Standard_Real aDepth = Max(aTime, 0.0); + Standard_Real aDepth = std::max(aTime, 0.0); if (theClipRange.IsClipped(aDepth)) { return false; @@ -681,7 +681,7 @@ Standard_Boolean SelectMgr_AxisIntersector::OverlapsCircle( const gp_Pnt aPntOnCylinder = aLoc.XYZ() + aRayDir.XYZ() * aDepth; thePickResult.SetDepth(aDepth); thePickResult.SetPickedPoint(aPntOnCylinder.Transformed(theTrsf)); - if (Abs(aPntOnCylinder.Z()) < Precision::Confusion()) + if (std::abs(aPntOnCylinder.Z()) < Precision::Confusion()) { thePickResult.SetSurfaceNormal(-gp::DZ().Transformed(theTrsf)); } diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_BVHThreadPool.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_BVHThreadPool.cxx index 2bdd71ae82..edb8239c89 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_BVHThreadPool.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_BVHThreadPool.cxx @@ -28,7 +28,7 @@ SelectMgr_BVHThreadPool::SelectMgr_BVHThreadPool(Standard_Integer theNbThreads) myIdleEvent(Standard_True), myIsStarted(Standard_False) { - Standard_Integer aBVHThreadsNum = Max(1, theNbThreads); + Standard_Integer aBVHThreadsNum = std::max(1, theNbThreads); myBVHThreads.Resize(1, aBVHThreadsNum, Standard_False); Standard_Boolean toCatchFpe = OSD::ToCatchFloatingSignals(); diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_BaseIntersector.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_BaseIntersector.cxx index 61f42bfb4a..3cb1a459a0 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_BaseIntersector.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_BaseIntersector.cxx @@ -122,9 +122,9 @@ Standard_Boolean SelectMgr_BaseIntersector::RaySphereIntersection(const gp_Pnt& return Standard_False; } - const Standard_Real aTime1 = (-aK - Sqrt(aDiscr)) / anA; - const Standard_Real aTime2 = (-aK + Sqrt(aDiscr)) / anA; - if (Abs(aTime1) < Abs(aTime2)) + const Standard_Real aTime1 = (-aK - std::sqrt(aDiscr)) / anA; + const Standard_Real aTime2 = (-aK + std::sqrt(aDiscr)) / anA; + if (std::abs(aTime1) < std::abs(aTime2)) { theTimeEnter = aTime1; theTimeLeave = aTime2; @@ -174,8 +174,8 @@ Standard_Boolean SelectMgr_BaseIntersector::RayCylinderIntersection( // ray intersection with cone / truncated cone if (theTopRadius != theBottomRadius) { - const Standard_Real aTriangleHeight = - Min(theBottomRadius, theTopRadius) * theHeight / (Abs(theBottomRadius - theTopRadius)); + const Standard_Real aTriangleHeight = std::min(theBottomRadius, theTopRadius) * theHeight + / (std::abs(theBottomRadius - theTopRadius)); gp_Ax3 aSystem; if (theBottomRadius > theTopRadius) { @@ -191,7 +191,7 @@ Standard_Boolean SelectMgr_BaseIntersector::RayCylinderIntersection( aTrsfCone.SetTransformation(gp_Ax3(), aSystem); const gp_Pnt aPnt(theLoc.Transformed(aTrsfCone)); const gp_Dir aDir(theRayDir.Transformed(aTrsfCone)); - const Standard_Real aMaxRad = Max(theBottomRadius, theTopRadius); + const Standard_Real aMaxRad = std::max(theBottomRadius, theTopRadius); const Standard_Real aConeHeight = theHeight + aTriangleHeight; // solving quadratic equation anA * T^2 + 2 * aK * T + aC = 0 @@ -207,8 +207,8 @@ Standard_Boolean SelectMgr_BaseIntersector::RayCylinderIntersection( Standard_Real aDiscr = aK * aK - anA * aC; if (aDiscr > 0) { - const Standard_Real aTimeEnterCone = (-aK - Sqrt(aDiscr)) / anA; - const Standard_Real aTimeLeaveCone = (-aK + Sqrt(aDiscr)) / anA; + const Standard_Real aTimeEnterCone = (-aK - std::sqrt(aDiscr)) / anA; + const Standard_Real aTimeLeaveCone = (-aK + std::sqrt(aDiscr)) / anA; const Standard_Real aZFromRoot1 = aPnt.Z() + aTimeEnterCone * aDir.Z(); const Standard_Real aZFromRoot2 = aPnt.Z() + aTimeLeaveCone * aDir.Z(); @@ -234,8 +234,8 @@ Standard_Boolean SelectMgr_BaseIntersector::RayCylinderIntersection( const Standard_Real aDiscr = aK * aK - anA * aC; if (aDiscr > 0) { - const Standard_Real aRoot1 = (-aK + Sqrt(aDiscr)) / anA; - const Standard_Real aRoot2 = (-aK - Sqrt(aDiscr)) / anA; + const Standard_Real aRoot1 = (-aK + std::sqrt(aDiscr)) / anA; + const Standard_Real aRoot2 = (-aK - std::sqrt(aDiscr)) / anA; const Standard_Real aZFromRoot1 = theLoc.Z() + aRoot1 * theRayDir.Z(); const Standard_Real aZFromRoot2 = theLoc.Z() + aRoot2 * theRayDir.Z(); if (aZFromRoot1 > 0 && aZFromRoot1 < theHeight) @@ -279,7 +279,7 @@ Standard_Boolean SelectMgr_BaseIntersector::RayCircleIntersection( const Standard_Real aK = aX1 * aX1 + anY1 * anY1; if ((theIsFilled && aK <= theRadius * theRadius) - || (!theIsFilled && Abs(sqrt(aK) - theRadius) <= Precision::Confusion())) + || (!theIsFilled && std::abs(sqrt(aK) - theRadius) <= Precision::Confusion())) { theTime = aTime; return true; diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_Frustum.lxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_Frustum.lxx index 389924131c..57429141df 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_Frustum.lxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_Frustum.lxx @@ -49,8 +49,8 @@ Standard_Boolean SelectMgr_Frustum::isSeparated(const SelectMgr_Vec3& theBoxM { const Standard_Real aProj = myVertices[aVertIdx].XYZ().Dot(theDirect); - aMinF = Min(aMinF, aProj); - aMaxF = Max(aMaxF, aProj); + aMinF = std::min(aMinF, aProj); + aMaxF = std::max(aMaxF, aProj); if (aMinF <= aMaxB && aMaxF >= aMinB) { @@ -95,23 +95,23 @@ Standard_Boolean SelectMgr_Frustum::isSeparated(const gp_Pnt& thePnt1, Standard_Real aTriangleProj; aTriangleProj = theAxis.Dot(thePnt1.XYZ()); - aMinTr = Min(aMinTr, aTriangleProj); - aMaxTr = Max(aMaxTr, aTriangleProj); + aMinTr = std::min(aMinTr, aTriangleProj); + aMaxTr = std::max(aMaxTr, aTriangleProj); aTriangleProj = theAxis.Dot(thePnt2.XYZ()); - aMinTr = Min(aMinTr, aTriangleProj); - aMaxTr = Max(aMaxTr, aTriangleProj); + aMinTr = std::min(aMinTr, aTriangleProj); + aMaxTr = std::max(aMaxTr, aTriangleProj); aTriangleProj = theAxis.Dot(thePnt3.XYZ()); - aMinTr = Min(aMinTr, aTriangleProj); - aMaxTr = Max(aMaxTr, aTriangleProj); + aMinTr = std::min(aMinTr, aTriangleProj); + aMaxTr = std::max(aMaxTr, aTriangleProj); for (Standard_Integer aVertIter = 0; aVertIter < N * 2; ++aVertIter) { const Standard_Real aProj = myVertices[aVertIter].XYZ().Dot(theAxis); - aMinF = Min(aMinF, aProj); - aMaxF = Max(aMaxF, aProj); + aMinF = std::min(aMinF, aProj); + aMaxF = std::max(aMaxF, aProj); if (aMinF <= aMaxTr && aMaxF >= aMinTr) { @@ -243,8 +243,8 @@ Standard_Boolean SelectMgr_Frustum::hasSegmentOverlap(const gp_Pnt& theStartP Standard_Real aProj1 = myPlanes[aPlaneIdx].XYZ().Dot(theStartPnt.XYZ()); Standard_Real aProj2 = myPlanes[aPlaneIdx].XYZ().Dot(theEndPnt.XYZ()); - aMinSegm = Min(aProj1, aProj2); - aMaxSegm = Max(aProj1, aProj2); + aMinSegm = std::min(aProj1, aProj2); + aMaxSegm = std::max(aProj1, aProj2); aMaxF = myMaxVertsProjections[aPlaneIdx]; aMinF = myMinVertsProjections[aPlaneIdx]; @@ -260,13 +260,13 @@ Standard_Boolean SelectMgr_Frustum::hasSegmentOverlap(const gp_Pnt& theStartP for (Standard_Integer aVertIdx = 0; aVertIdx < N * 2; ++aVertIdx) { Standard_Real aProjection = aDir.Dot(myVertices[aVertIdx].XYZ()); - aMax2 = Max(aMax2, aProjection); - aMin2 = Min(aMin2, aProjection); + aMax2 = std::max(aMax2, aProjection); + aMin2 = std::min(aMin2, aProjection); } Standard_Real aProj1 = aDir.Dot(theStartPnt.XYZ()); Standard_Real aProj2 = aDir.Dot(theEndPnt.XYZ()); - aMin1 = Min(aProj1, aProj2); - aMax1 = Max(aProj1, aProj2); + aMin1 = std::min(aProj1, aProj2); + aMax1 = std::max(aProj1, aProj2); if (aMin1 > aMax2 || aMax1 < aMin2) { return Standard_False; @@ -282,14 +282,14 @@ Standard_Boolean SelectMgr_Frustum::hasSegmentOverlap(const gp_Pnt& theStartP Standard_Real Proj1 = aTestDir.Dot(theStartPnt.XYZ()); Standard_Real Proj2 = aTestDir.Dot(theEndPnt.XYZ()); - aMinSegm = Min(Proj1, Proj2); - aMaxSegm = Max(Proj1, Proj2); + aMinSegm = std::min(Proj1, Proj2); + aMaxSegm = std::max(Proj1, Proj2); for (Standard_Integer aVertIdx = 0; aVertIdx < N * 2; ++aVertIdx) { Standard_Real aProjection = aTestDir.Dot(myVertices[aVertIdx].XYZ()); - aMaxF = Max(aMaxF, aProjection); - aMinF = Min(aMinF, aProjection); + aMaxF = std::max(aMaxF, aProjection); + aMinF = std::min(aMinF, aProjection); } if (aMinSegm > aMaxF || aMaxSegm < aMinF) @@ -327,8 +327,8 @@ Standard_Boolean SelectMgr_Frustum::hasPolygonOverlap(const TColgp_Array1OfPn for (Standard_Integer aVertIdx = 0; aVertIdx < N * 2; ++aVertIdx) { Standard_Real aProjection = aNormal.Dot(myVertices[aVertIdx].XYZ()); - aMax = Max(aMax, aProjection); - aMin = Min(aMin, aProjection); + aMax = std::max(aMax, aProjection); + aMin = std::min(aMin, aProjection); } if (aPolygProjection > aMax || aPolygProjection < aMin) { @@ -346,8 +346,8 @@ Standard_Boolean SelectMgr_Frustum::hasPolygonOverlap(const TColgp_Array1OfPn for (Standard_Integer aPntIter = aStartIdx; aPntIter <= anEndIdx; ++aPntIter) { Standard_Real aProjection = aPlane.Dot(theArrayOfPnts.Value(aPntIter).XYZ()); - aMaxPolyg = Max(aMaxPolyg, aProjection); - aMinPolyg = Min(aMinPolyg, aProjection); + aMaxPolyg = std::max(aMaxPolyg, aProjection); + aMinPolyg = std::min(aMinPolyg, aProjection); } aMaxF = myMaxVertsProjections[aPlaneIdx]; aMinF = myMinVertsProjections[aPlaneIdx]; @@ -377,15 +377,15 @@ Standard_Boolean SelectMgr_Frustum::hasPolygonOverlap(const TColgp_Array1OfPn for (Standard_Integer aPntIter = aStartIdx; aPntIter <= anEndIdx; ++aPntIter) { Standard_Real aProjection = aTestDir.Dot(theArrayOfPnts.Value(aPntIter).XYZ()); - aMaxPolyg = Max(aMaxPolyg, aProjection); - aMinPolyg = Min(aMinPolyg, aProjection); + aMaxPolyg = std::max(aMaxPolyg, aProjection); + aMinPolyg = std::min(aMinPolyg, aProjection); } for (Standard_Integer aVertIdx = 0; aVertIdx < N * 2; ++aVertIdx) { Standard_Real aProjection = aTestDir.Dot(myVertices[aVertIdx].XYZ()); - aMaxF = Max(aMaxF, aProjection); - aMinF = Min(aMinF, aProjection); + aMaxF = std::max(aMaxF, aProjection); + aMinF = std::min(aMinF, aProjection); } if (aMinPolyg > aMaxF || aMaxPolyg < aMinF) @@ -423,12 +423,12 @@ Standard_Boolean SelectMgr_Frustum::hasTriangleOverlap(const gp_Pnt& thePnt1, Standard_Real aTriangleProjMax = aTriangleProj; aTriangleProj = aPlane.Dot(thePnt2.XYZ()); - aTriangleProjMin = Min(aTriangleProjMin, aTriangleProj); - aTriangleProjMax = Max(aTriangleProjMax, aTriangleProj); + aTriangleProjMin = std::min(aTriangleProjMin, aTriangleProj); + aTriangleProjMax = std::max(aTriangleProjMax, aTriangleProj); aTriangleProj = aPlane.Dot(thePnt3.XYZ()); - aTriangleProjMin = Min(aTriangleProjMin, aTriangleProj); - aTriangleProjMax = Max(aTriangleProjMax, aTriangleProj); + aTriangleProjMin = std::min(aTriangleProjMin, aTriangleProj); + aTriangleProjMax = std::max(aTriangleProjMax, aTriangleProj); Standard_Real aFrustumProjMax = myMaxVertsProjections[aPlaneIdx]; Standard_Real aFrustumProjMin = myMinVertsProjections[aPlaneIdx]; @@ -472,7 +472,7 @@ Standard_Boolean SelectMgr_Frustum::hasSphereOverlap(const gp_Pnt& theP for (Standard_Integer aPlaneIdx = 0; aPlaneIdx < N; aPlaneIdx += anIncFactor) { const gp_XYZ& aPlane = myPlanes[aPlaneIdx].XYZ(); - const Standard_Real aNormVecLen = Sqrt(aPlane.Dot(aPlane)); + const Standard_Real aNormVecLen = std::sqrt(aPlane.Dot(aPlane)); const Standard_Real aCenterProj = aPlane.Dot(thePnt.XYZ()) / aNormVecLen; const Standard_Real aMaxDist = myMaxVertsProjections[aPlaneIdx] / aNormVecLen; const Standard_Real aMinDist = myMinVertsProjections[aPlaneIdx] / aNormVecLen; @@ -526,7 +526,7 @@ Standard_Boolean SelectMgr_Frustum::isDotInside(const gp_Pnt& the const gp_Vec aVec2(thePnt, aVert2); anAngle += aVec1.Angle(aVec2); } - if (Abs(anAngle - 2.0 * M_PI) < Precision::Angular()) + if (std::abs(anAngle - 2.0 * M_PI) < Precision::Angular()) { return true; } @@ -550,7 +550,7 @@ Standard_Boolean SelectMgr_Frustum::isSegmentsIntersect(const gp_Pnt& thePnt1 thePnt2Seg2.X() - thePnt1Seg1.X(), thePnt2Seg2.Y() - thePnt1Seg1.Y(), thePnt2Seg2.Z() - thePnt1Seg1.Z()); - if (Abs(aMatPln.Determinant()) > Precision::Confusion()) + if (std::abs(aMatPln.Determinant()) > Precision::Confusion()) { return false; } @@ -633,8 +633,8 @@ Standard_Boolean SelectMgr_Frustum::isIntersectCircle( const Standard_Real aDiscr = aK * aK - anA * aC; if (aDiscr >= 0.0) { - const Standard_Real aT1 = (-aK + Sqrt(aDiscr)) / anA; - const Standard_Real aT2 = (-aK - Sqrt(aDiscr)) / anA; + const Standard_Real aT1 = (-aK + std::sqrt(aDiscr)) / anA; + const Standard_Real aT2 = (-aK - std::sqrt(aDiscr)) / anA; if ((aT1 >= 0 && aT1 <= 1) || (aT2 >= 0 && aT2 <= 1)) { return true; @@ -754,10 +754,11 @@ Standard_Boolean SelectMgr_Frustum::hasCylinderOverlap(const Standard_Real const Standard_Real anAngle = aCylNorm.Angle(aViewRayDir); aPoints[0] = - aBottomCenterProject.XYZ() - aCylNormProject.XYZ() * theBottomRad * Abs(Cos(anAngle)); + aBottomCenterProject.XYZ() - aCylNormProject.XYZ() * theBottomRad * std::abs(std::cos(anAngle)); aPoints[1] = aBottomCenterProject.XYZ() + aDirEndFaces.XYZ() * theBottomRad; aPoints[2] = aTopCenterProject.XYZ() + aDirEndFaces.XYZ() * theTopRad; - aPoints[3] = aTopCenterProject.XYZ() + aCylNormProject.XYZ() * theTopRad * Abs(Cos(anAngle)); + aPoints[3] = + aTopCenterProject.XYZ() + aCylNormProject.XYZ() * theTopRad * std::abs(std::cos(anAngle)); aPoints[4] = aTopCenterProject.XYZ() - aDirEndFaces.XYZ() * theTopRad; aPoints[5] = aBottomCenterProject.XYZ() - aDirEndFaces.XYZ() * theBottomRad; const TColgp_Array1OfPnt aPointsArr(aPoints[0], 0, 5); @@ -765,7 +766,7 @@ Standard_Boolean SelectMgr_Frustum::hasCylinderOverlap(const Standard_Real for (Standard_Integer anIdx = 0; anIdx < N; anIdx++) { if ((aCylNormProject.Dot(aCylNormProject) == 0.0 - && aVertices.Value(anIdx).Distance(aPoints[0]) <= Max(theTopRad, theBottomRad)) + && aVertices.Value(anIdx).Distance(aPoints[0]) <= std::max(theTopRad, theBottomRad)) || isDotInside(aVertices.Value(anIdx), aPointsArr)) { if (theInside != NULL) diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_RectangularFrustum.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_RectangularFrustum.cxx index 1d9286dfff..190a66adbb 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_RectangularFrustum.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_RectangularFrustum.cxx @@ -80,7 +80,7 @@ void SelectMgr_RectangularFrustum::segmentSegmentDistance( { aTn = aTd; } - aTc = (Abs(aTd) < gp::Resolution() ? 0.0 : aTn / aTd); + aTc = (std::abs(aTd) < gp::Resolution() ? 0.0 : aTn / aTd); const gp_Pnt aClosestPnt = myNearPickedPnt.XYZ() + aV * aTc; thePickResult.SetDepth(myNearPickedPnt.Distance(aClosestPnt) * myScale); @@ -95,8 +95,9 @@ void SelectMgr_RectangularFrustum::segmentSegmentDistance( return; } - const Standard_Real aCosOfAngle = aFigureVec.Dot(aPickedVec) / (aPickedVecMod * aFigureVecMod); - const Standard_Real aSegPntShift = Min(aFigureVecMod, Max(0.0, aCosOfAngle * aPickedVecMod)); + const Standard_Real aCosOfAngle = aFigureVec.Dot(aPickedVec) / (aPickedVecMod * aFigureVecMod); + const Standard_Real aSegPntShift = + std::min(aFigureVecMod, std::max(0.0, aCosOfAngle * aPickedVecMod)); thePickResult.SetPickedPoint(theSegPnt1.XYZ() + aFigureVec.XYZ() * (aSegPntShift / aFigureVecMod)); } @@ -115,9 +116,9 @@ bool SelectMgr_RectangularFrustum::segmentPlaneIntersection( Standard_Real aD = thePlane.Dot(anU); Standard_Real aN = -thePlane.Dot(aW); - if (Abs(aD) < Precision::Confusion()) + if (std::abs(aD) < Precision::Confusion()) { - if (Abs(aN) < Precision::Angular()) + if (std::abs(aN) < Precision::Angular()) { thePickResult.Invalidate(); return false; @@ -233,8 +234,8 @@ void SelectMgr_RectangularFrustum::cacheVertexProjections( theFrustum->myVertices[aVertIdxs[aPlaneIdx]].XYZ()); Standard_Real aProj2 = theFrustum->myPlanes[aPlaneIdx].XYZ().Dot( theFrustum->myVertices[aVertIdxs[aPlaneIdx + 1]].XYZ()); - theFrustum->myMinVertsProjections[aPlaneIdx] = Min(aProj1, aProj2); - theFrustum->myMaxVertsProjections[aPlaneIdx] = Max(aProj1, aProj2); + theFrustum->myMinVertsProjections[aPlaneIdx] = std::min(aProj1, aProj2); + theFrustum->myMaxVertsProjections[aPlaneIdx] = std::max(aProj1, aProj2); } } else @@ -248,8 +249,8 @@ void SelectMgr_RectangularFrustum::cacheVertexProjections( for (Standard_Integer aVertIdx = 0; aVertIdx < 8; ++aVertIdx) { Standard_Real aProjection = aPlane.Dot(theFrustum->myVertices[aVertIdx].XYZ()); - aMin = Min(aMin, aProjection); - aMax = Max(aMax, aProjection); + aMin = std::min(aMin, aProjection); + aMax = std::max(aMax, aProjection); } theFrustum->myMinVertsProjections[aPlaneIdx] = aMin; theFrustum->myMaxVertsProjections[aPlaneIdx] = aMax; @@ -264,8 +265,8 @@ void SelectMgr_RectangularFrustum::cacheVertexProjections( for (Standard_Integer aVertIdx = 0; aVertIdx < 8; ++aVertIdx) { const gp_XYZ& aVert = theFrustum->myVertices[aVertIdx].XYZ(); - aMax = Max(aVert.GetData()[aDim], aMax); - aMin = Min(aVert.GetData()[aDim], aMin); + aMax = std::max(aVert.GetData()[aDim], aMax); + aMin = std::min(aVert.GetData()[aDim], aMin); } theFrustum->myMaxOrthoVertsProjections[aDim] = aMax; theFrustum->myMinOrthoVertsProjections[aDim] = aMin; @@ -426,7 +427,8 @@ Handle(SelectMgr_BaseIntersector) SelectMgr_RectangularFrustum::ScaleAndTransfor aRes->myEdgeDirs[5] = aRes->myVertices[4].XYZ() - aRes->myVertices[5].XYZ(); // Compute scale to transform depth from local coordinate system to world coordinate system - aRes->myScale = Sqrt(aRefScale / aRes->myFarPickedPnt.SquareDistance(aRes->myNearPickedPnt)); + aRes->myScale = + std::sqrt(aRefScale / aRes->myFarPickedPnt.SquareDistance(aRes->myNearPickedPnt)); } aRes->SetBuilder(theBuilder); @@ -523,16 +525,16 @@ Standard_Boolean SelectMgr_RectangularFrustum::OverlapsBox( aTimeLeave)) { gp_Pnt aNearestPnt(RealLast(), RealLast(), RealLast()); - aNearestPnt.SetX(Max(Min(myNearPickedPnt.X(), theBoxMax.x()), theBoxMin.x())); - aNearestPnt.SetY(Max(Min(myNearPickedPnt.Y(), theBoxMax.y()), theBoxMin.y())); - aNearestPnt.SetZ(Max(Min(myNearPickedPnt.Z(), theBoxMax.z()), theBoxMin.z())); + aNearestPnt.SetX(std::max(std::min(myNearPickedPnt.X(), theBoxMax.x()), theBoxMin.x())); + aNearestPnt.SetY(std::max(std::min(myNearPickedPnt.Y(), theBoxMax.y()), theBoxMin.y())); + aNearestPnt.SetZ(std::max(std::min(myNearPickedPnt.Z(), theBoxMax.z()), theBoxMin.z())); aDepth = aNearestPnt.Distance(myNearPickedPnt); thePickResult.SetDepth(aDepth); return !theClipRange.IsClipped(thePickResult.Depth()); } - Bnd_Range aRange(Max(aTimeEnter, 0.0), aTimeLeave); + Bnd_Range aRange(std::max(aTimeEnter, 0.0), aTimeLeave); aRange.GetMin(aDepth); if (!theClipRange.GetNearestDepth(aRange, aDepth)) @@ -565,7 +567,7 @@ Standard_Boolean SelectMgr_RectangularFrustum::OverlapsPoint( gp_XYZ aV = thePnt.XYZ() - myNearPickedPnt.XYZ(); const Standard_Real aDepth = aV.Dot(myViewRayDir.XYZ()); - thePickResult.SetDepth(Abs(aDepth) * myScale); + thePickResult.SetDepth(std::abs(aDepth) * myScale); thePickResult.SetPickedPoint(thePnt); return !theClipRange.IsClipped(thePickResult.Depth()); @@ -719,7 +721,7 @@ Standard_Boolean SelectMgr_RectangularFrustum::OverlapsTriangle( const gp_Pnt aPnts[3] = {thePnt1, thePnt2, thePnt3}; const Standard_Real anAlpha = aTriangleNormal.XYZ().Dot(myViewRayDir.XYZ()); - if (Abs(anAlpha) < gp::Resolution()) + if (std::abs(anAlpha) < gp::Resolution()) { // handle the case when triangle normal and selecting frustum direction are orthogonal SelectBasics_PickResult aPickResult; @@ -823,11 +825,11 @@ Standard_Boolean SelectMgr_RectangularFrustum::OverlapsCylinder( } const gp_Pnt aPntOnCylinder = aLoc.XYZ() + aRayDir.XYZ() * aTimes[aResTime]; - if (Abs(aPntOnCylinder.Z()) < Precision::Confusion()) + if (std::abs(aPntOnCylinder.Z()) < Precision::Confusion()) { thePickResult.SetSurfaceNormal(-gp::DZ().Transformed(theTrsf)); } - else if (Abs(aPntOnCylinder.Z() - theHeight) < Precision::Confusion()) + else if (std::abs(aPntOnCylinder.Z() - theHeight) < Precision::Confusion()) { thePickResult.SetSurfaceNormal(gp::DZ().Transformed(theTrsf)); } @@ -880,7 +882,7 @@ Standard_Boolean SelectMgr_RectangularFrustum::OverlapsCircle( } const gp_Pnt aPntOnCircle = aLoc.XYZ() + aRayDir.XYZ() * aTime; - if (Abs(aPntOnCircle.Z()) < Precision::Confusion()) + if (std::abs(aPntOnCircle.Z()) < Precision::Confusion()) { thePickResult.SetSurfaceNormal(-gp::DZ().Transformed(theTrsf)); } @@ -932,8 +934,8 @@ Standard_Boolean SelectMgr_RectangularFrustum::isIntersectCircle( const Standard_Real aDiscr = aK * aK - anA * aC; if (aDiscr >= 0.0) { - const Standard_Real aT1 = (-aK + Sqrt(aDiscr)) / anA; - const Standard_Real aT2 = (-aK - Sqrt(aDiscr)) / anA; + const Standard_Real aT1 = (-aK + std::sqrt(aDiscr)) / anA; + const Standard_Real aT2 = (-aK - std::sqrt(aDiscr)) / anA; if ((aT1 >= 0 && aT1 <= 1) || (aT2 >= 0 && aT2 <= 1)) { return true; @@ -959,7 +961,7 @@ Standard_Boolean SelectMgr_RectangularFrustum::isSegmentsIntersect(const gp_Pnt& thePnt2Seg2.X() - thePnt1Seg1.X(), thePnt2Seg2.Y() - thePnt1Seg1.Y(), thePnt2Seg2.Z() - thePnt1Seg1.Z()); - if (Abs(aMatPln.Determinant()) > Precision::Confusion()) + if (std::abs(aMatPln.Determinant()) > Precision::Confusion()) { return false; } diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_Selection.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_Selection.cxx index e0760003ac..f78f250af0 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_Selection.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_Selection.cxx @@ -77,7 +77,7 @@ void SelectMgr_Selection::Add(const Handle(Select3D_SensitiveEntity)& theSensiti } else { - mySensFactor = Max(mySensFactor, anEntity->BaseSensitive()->SensitivityFactor()); + mySensFactor = std::max(mySensFactor, anEntity->BaseSensitive()->SensitivityFactor()); } } diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectionImageFiller.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectionImageFiller.cxx index b8a5841d7e..54d70124dc 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectionImageFiller.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_SelectionImageFiller.cxx @@ -158,8 +158,8 @@ public: const SelectMgr_SortCriterion& aSortCriterion = myMainSel->PickedData(thePicked); myUnnormImage.ChangeValue(theRow, theCol) = float(aSortCriterion.Depth); - myDepthMin = Min(myDepthMin, aSortCriterion.Depth); - myDepthMax = Max(myDepthMax, aSortCriterion.Depth); + myDepthMin = std::min(myDepthMin, aSortCriterion.Depth); + myDepthMax = std::max(myDepthMax, aSortCriterion.Depth); } //! Normalize the depth values. diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_SortCriterion.hxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_SortCriterion.hxx index 66971a1200..bfb9b4192a 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_SortCriterion.hxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_SortCriterion.hxx @@ -66,7 +66,7 @@ public: } // closest object is selected if their depths are not equal within tolerance - if (Abs(Depth - theOther.Depth) > Tolerance + theOther.Tolerance) + if (std::abs(Depth - theOther.Depth) > Tolerance + theOther.Tolerance) { return Depth < theOther.Depth; } @@ -76,17 +76,17 @@ public: { gp_Dir aNormal(Normal.x(), Normal.y(), Normal.z()); gp_Dir anOtherNormal(theOther.Normal.x(), theOther.Normal.y(), theOther.Normal.z()); - aCos = Abs(Cos(aNormal.Angle(anOtherNormal))); + aCos = std::abs(std::cos(aNormal.Angle(anOtherNormal))); } Standard_Real aDepth = Depth - Tolerance; Standard_Real anOtherDepth = theOther.Depth - theOther.Tolerance; // Comparison depths taking into account tolerances occurs when the surfaces are parallel // or have the same sensitivity and the angle between them is less than 60 degrees. - if (Abs(aDepth - anOtherDepth) > Precision::Confusion()) + if (std::abs(aDepth - anOtherDepth) > Precision::Confusion()) { - if ((aCos > 0.5 && Abs(Tolerance - theOther.Tolerance) < Precision::Confusion()) - || Abs(aCos - 1.0) < Precision::Confusion()) + if ((aCos > 0.5 && std::abs(Tolerance - theOther.Tolerance) < Precision::Confusion()) + || std::abs(aCos - 1.0) < Precision::Confusion()) { return aDepth < anOtherDepth; } @@ -128,7 +128,7 @@ public: } // if (Abs (Depth - theOther.Depth) <= (Tolerance + theOther.Tolerance)) - if (Abs(Depth - theOther.Depth) <= Precision::Confusion()) + if (std::abs(Depth - theOther.Depth) <= Precision::Confusion()) { return MinDist < theOther.MinDist; } diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_ToleranceMap.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_ToleranceMap.cxx index 837e440efd..09a5825c4a 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_ToleranceMap.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_ToleranceMap.cxx @@ -38,7 +38,7 @@ void SelectMgr_ToleranceMap::Add(const Standard_Integer& theTolerance) ++(*aFreq); if (*aFreq == 1 && theTolerance != myLargestKey) { - myLargestKey = Max(theTolerance, myLargestKey); + myLargestKey = std::max(theTolerance, myLargestKey); } return; } @@ -50,7 +50,7 @@ void SelectMgr_ToleranceMap::Add(const Standard_Integer& theTolerance) } else { - myLargestKey = Max(theTolerance, myLargestKey); + myLargestKey = std::max(theTolerance, myLargestKey); } } @@ -77,7 +77,7 @@ void SelectMgr_ToleranceMap::Decrement(const Standard_Integer& theTolerance) { if (anIter.Value() != 0) { - myLargestKey = Max(myLargestKey, anIter.Key()); + myLargestKey = std::max(myLargestKey, anIter.Key()); } } } diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustum.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustum.cxx index 5b6ed1ecf8..a3f2e9ec76 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustum.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustum.cxx @@ -67,8 +67,8 @@ void SelectMgr_TriangularFrustum::cacheVertexProjections( for (Standard_Integer aVertIdx = 0; aVertIdx < 6; ++aVertIdx) { Standard_Real aProjection = aPlane.Dot(theFrustum->myVertices[aVertIdx].XYZ()); - aMax = Max(aMax, aProjection); - aMin = Min(aMin, aProjection); + aMax = std::max(aMax, aProjection); + aMin = std::min(aMin, aProjection); } theFrustum->myMaxVertsProjections[aPlaneIdx] = aMax; theFrustum->myMinVertsProjections[aPlaneIdx] = aMin; @@ -81,8 +81,8 @@ void SelectMgr_TriangularFrustum::cacheVertexProjections( for (Standard_Integer aVertIdx = 0; aVertIdx < 6; ++aVertIdx) { Standard_Real aProjection = theFrustum->myVertices[aVertIdx].XYZ().GetData()[aDim]; - aMax = Max(aMax, aProjection); - aMin = Min(aMin, aProjection); + aMax = std::max(aMax, aProjection); + aMin = std::min(aMin, aProjection); } theFrustum->myMaxOrthoVertsProjections[aDim] = aMax; theFrustum->myMinOrthoVertsProjections[aDim] = aMin; diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustumSet.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustumSet.cxx index 4463a975e0..2b3ead3863 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustumSet.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_TriangularFrustumSet.cxx @@ -504,7 +504,7 @@ Standard_Boolean SelectMgr_TriangularFrustumSet::OverlapsSphere( gp_Vec aVecAngle2(aCenterProj, aPntProj2); anAngleSum += aVecAngle1.Angle(aVecAngle2); } - Standard_Boolean isCenterInside = Abs(anAngleSum - 2 * M_PI) < Precision::Confusion(); + Standard_Boolean isCenterInside = std::abs(anAngleSum - 2 * M_PI) < Precision::Confusion(); Standard_Boolean isBoundaryInside = Standard_False; Standard_Boolean isIntersectSphereBoundaries = IsBoundaryIntersectSphere(aCenterProj, theRadius, aNorm, aBoundaries, isBoundaryInside); @@ -592,7 +592,7 @@ Standard_Boolean SelectMgr_TriangularFrustumSet::OverlapsCylinder( const gp_Dir aDirNorm(aVecPlane1.Crossed(aVecPlane2)); const Standard_Real anAngle = aCylNorm.Angle(aDirNorm); - const Standard_Real aCosAngle = Cos(anAngle); + const Standard_Real aCosAngle = std::cos(anAngle); const gp_Pln aPln(myFrustums.First()->myVertices[0], aDirNorm); Standard_Real aCoefA, aCoefB, aCoefC, aCoefD; aPln.Coefficients(aCoefA, aCoefB, aCoefC, aCoefD); @@ -618,8 +618,8 @@ Standard_Boolean SelectMgr_TriangularFrustumSet::OverlapsCylinder( } gp_Pnt aPoints[6]; - aPoints[0] = aBottomCenterProject.XYZ() - aCylNormProject * theBottomRad * Abs(aCosAngle); - aPoints[1] = aTopCenterProject.XYZ() + aCylNormProject * theTopRad * Abs(aCosAngle); + aPoints[0] = aBottomCenterProject.XYZ() - aCylNormProject * theBottomRad * std::abs(aCosAngle); + aPoints[1] = aTopCenterProject.XYZ() + aCylNormProject * theTopRad * std::abs(aCosAngle); const gp_Dir aDirEndFaces = (aCylNorm.IsParallel(aDirNorm, Precision::Angular())) ? gp::DY().Transformed(theTrsf) : aCylNorm.Crossed(aDirNorm); @@ -827,8 +827,8 @@ Standard_Boolean SelectMgr_TriangularFrustumSet::segmentSegmentIntersection( gp_XYZ aVec2 = theEndPnt2.XYZ() - theStartPnt2.XYZ(); gp_XYZ aVec21 = theStartPnt2.XYZ() - theStartPnt1.XYZ(); gp_XYZ aVec12 = theStartPnt1.XYZ() - theStartPnt2.XYZ(); - if (Abs(aVec21.DotCross(aVec1, aVec2)) > Precision::Confusion() - || Abs(aVec12.DotCross(aVec2, aVec1)) > Precision::Confusion()) + if (std::abs(aVec21.DotCross(aVec1, aVec2)) > Precision::Confusion() + || std::abs(aVec12.DotCross(aVec2, aVec1)) > Precision::Confusion()) { // lines are not coplanar return false; @@ -892,7 +892,7 @@ Standard_Boolean SelectMgr_TriangularFrustumSet::isIntersectBoundary( gp_Pnt aCrossPoint = aCircCenter.Translated(aNormalLine.Direction().Reversed().XYZ() * aDistance); - Standard_Real anOffset = Sqrt(theRadius * theRadius - aDistance * aDistance); + Standard_Real anOffset = std::sqrt(theRadius * theRadius - aDistance * aDistance); // Line-circle intersection points gp_Pnt aP1 = aCrossPoint.Translated(aLine.Direction().XYZ() * anOffset); gp_Pnt aP2 = aCrossPoint.Translated(aLine.Direction().Reversed().XYZ() * anOffset); diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_ViewClipRange.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_ViewClipRange.cxx index dd7e2b8539..c3a92b4b17 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_ViewClipRange.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_ViewClipRange.cxx @@ -46,7 +46,7 @@ void SelectMgr_ViewClipRange::AddClippingPlanes(const Graphic3d_SequenceOfHClipP Standard_Real aDistToPln = 0.0; // check whether the pick line is parallel to clip plane - if (Abs(aDotProduct) < Precision::Angular()) + if (std::abs(aDotProduct) < Precision::Angular()) { if (aDistance < 0.0) { diff --git a/src/Visualization/TKV3d/SelectMgr/SelectMgr_ViewerSelector.cxx b/src/Visualization/TKV3d/SelectMgr/SelectMgr_ViewerSelector.cxx index 5750e203f5..cb164f7d9d 100644 --- a/src/Visualization/TKV3d/SelectMgr/SelectMgr_ViewerSelector.cxx +++ b/src/Visualization/TKV3d/SelectMgr/SelectMgr_ViewerSelector.cxx @@ -151,7 +151,7 @@ void SelectMgr_ViewerSelector::updatePoint3d(SelectMgr_SortCriterion& else { const Standard_Real aDistFromEye = - Abs((theCriterion.Point.XYZ() - myCameraEye.XYZ()).Dot(myCameraDir.XYZ())); + std::abs((theCriterion.Point.XYZ() - myCameraEye.XYZ()).Dot(myCameraDir.XYZ())); theCriterion.Tolerance = aDistFromEye * myCameraScale * aSensFactor; } break; @@ -668,7 +668,7 @@ void SelectMgr_ViewerSelector::TraverseSensitives(const Standard_Integer theView Graphic3d_Vec2i aWinSize; mySelectingVolumeMgr.WindowSize(aWinSize.x(), aWinSize.y()); const double aPixelSize = - aWinSize.x() > 0 && aWinSize.y() > 0 ? Max(1.0 / aWinSize.x(), 1.0 / aWinSize.y()) : 1.0; + aWinSize.x() > 0 && aWinSize.y() > 0 ? std::max(1.0 / aWinSize.x(), 1.0 / aWinSize.y()) : 1.0; const Handle(Graphic3d_Camera)& aCamera = mySelectingVolumeMgr.Camera(); Graphic3d_Mat4d aProjectionMat, aWorldViewMat; @@ -756,7 +756,7 @@ void SelectMgr_ViewerSelector::TraverseSensitives(const Standard_Integer theView { myCameraScale = aMgr.Camera()->IsOrthographic() ? aMgr.Camera()->Scale() - : 2.0 * Tan(aMgr.Camera()->FOVy() * M_PI / 360.0); + : 2.0 * std::tan(aMgr.Camera()->FOVy() * M_PI / 360.0); myCameraScale *= aPixelSize; } diff --git a/src/Visualization/TKV3d/StdPrs/StdPrs_Curve.cxx b/src/Visualization/TKV3d/StdPrs/StdPrs_Curve.cxx index 9e6376da70..0fd9d8a0ec 100644 --- a/src/Visualization/TKV3d/StdPrs/StdPrs_Curve.cxx +++ b/src/Visualization/TKV3d/StdPrs/StdPrs_Curve.cxx @@ -98,7 +98,7 @@ static void DrawCurve(const Adaptor3d_Curve& aCurve, if (aCurve.GetType() == GeomAbs_BSplineCurve) { nbintervals = aCurve.NbKnots() - 1; - nbintervals = Max(1, nbintervals / 3); + nbintervals = std::max(1, nbintervals / 3); } switch (aCurve.GetType()) @@ -118,7 +118,7 @@ static void DrawCurve(const Adaptor3d_Curve& aCurve, } break; default: { - const Standard_Integer N = Max(2, NbP * nbintervals); + const Standard_Integer N = std::max(2, NbP * nbintervals); const Standard_Real DU = (U2 - U1) / (N - 1); gp_Pnt p; @@ -156,25 +156,25 @@ static Standard_Boolean MatchCurve(const Standard_Real X, { case GeomAbs_Line: { gp_Pnt p1 = aCurve.Value(U1); - if (Abs(X - p1.X()) + Abs(Y - p1.Y()) + Abs(Z - p1.Z()) <= aDistance) + if (std::abs(X - p1.X()) + std::abs(Y - p1.Y()) + std::abs(Z - p1.Z()) <= aDistance) return Standard_True; gp_Pnt p2 = aCurve.Value(U2); - if (Abs(X - p2.X()) + Abs(Y - p2.Y()) + Abs(Z - p2.Z()) <= aDistance) + if (std::abs(X - p2.X()) + std::abs(Y - p2.Y()) + std::abs(Z - p2.Z()) <= aDistance) return Standard_True; return Prs3d::MatchSegment(X, Y, Z, aDistance, p1, p2, retdist); } case GeomAbs_Circle: { const Standard_Real Radius = aCurve.Circle().Radius(); - const Standard_Real DU = Sqrt(8.0 * TheDeflection / Radius); - const Standard_Real Er = Abs(U2 - U1) / DU; - const Standard_Integer N = Max(2, (Standard_Integer)IntegerPart(Er)); + const Standard_Real DU = std::sqrt(8.0 * TheDeflection / Radius); + const Standard_Real Er = std::abs(U2 - U1) / DU; + const Standard_Integer N = std::max(2, (Standard_Integer)std::trunc(Er)); if (N > 0) { gp_Pnt p1, p2; for (Standard_Integer Index = 1; Index <= N + 1; Index++) { p2 = aCurve.Value(U1 + (Index - 1) * DU); - if (Abs(X - p2.X()) + Abs(Y - p2.Y()) + Abs(Z - p2.Z()) <= aDistance) + if (std::abs(X - p2.X()) + std::abs(Y - p2.Y()) + std::abs(Z - p2.Z()) <= aDistance) return Standard_True; if (Index > 1) @@ -193,7 +193,7 @@ static Standard_Boolean MatchCurve(const Standard_Real X, for (Standard_Integer i = 1; i <= NbP; i++) { p2 = aCurve.Value(U1 + (i - 1) * DU); - if (Abs(X - p2.X()) + Abs(Y - p2.Y()) + Abs(Z - p2.Z()) <= aDistance) + if (std::abs(X - p2.X()) + std::abs(Y - p2.Y()) + std::abs(Z - p2.Z()) <= aDistance) return Standard_True; if (i > 1) { diff --git a/src/Visualization/TKV3d/StdPrs/StdPrs_DeflectionCurve.cxx b/src/Visualization/TKV3d/StdPrs/StdPrs_DeflectionCurve.cxx index ddaa0b9002..ed6265e6d1 100644 --- a/src/Visualization/TKV3d/StdPrs/StdPrs_DeflectionCurve.cxx +++ b/src/Visualization/TKV3d/StdPrs/StdPrs_DeflectionCurve.cxx @@ -51,14 +51,14 @@ static Standard_Real GetDeflection(const Adaptor3d_Curve& aCurve, Total.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); Standard_Real m = RealLast(); if (!(Total.IsOpenXmin() || Total.IsOpenXmax())) - m = Abs(aXmax - aXmin); + m = std::abs(aXmax - aXmin); if (!(Total.IsOpenYmin() || Total.IsOpenYmax())) - m = Max(m, Abs(aYmax - aYmin)); + m = std::max(m, std::abs(aYmax - aYmin)); if (!(Total.IsOpenZmin() || Total.IsOpenZmax())) - m = Max(m, Abs(aZmax - aZmin)); + m = std::max(m, std::abs(aZmax - aZmin)); - m = Min(m, aDrawer->MaximalParameterValue()); - m = Max(m, Precision::Confusion()); + m = std::min(m, aDrawer->MaximalParameterValue()); + m = std::max(m, Precision::Confusion()); TheDeflection = m * aDrawer->DeviationCoefficient(); } @@ -167,8 +167,8 @@ static void drawCurve(Adaptor3d_Curve& aCurve, theU2 = T(j + 1); if (theU2 > U1 && theU1 < U2) { - theU1 = Max(theU1, U1); - theU2 = Min(theU2, U2); + theU1 = std::max(theU1, U1); + theU2 = std::min(theU2, U2); GCPnts_TangentialDeflection Algo(aCurve, theU1, theU2, anAngle, TheDeflection); NumberOfPoints = Algo.NbPoints(); @@ -219,10 +219,10 @@ static Standard_Boolean MatchCurve(const Standard_Real X, { case GeomAbs_Line: { gp_Pnt p1 = aCurve.Value(U1); - if (Abs(X - p1.X()) + Abs(Y - p1.Y()) + Abs(Z - p1.Z()) <= aDistance) + if (std::abs(X - p1.X()) + std::abs(Y - p1.Y()) + std::abs(Z - p1.Z()) <= aDistance) return Standard_True; gp_Pnt p2 = aCurve.Value(U2); - if (Abs(X - p2.X()) + Abs(Y - p2.Y()) + Abs(Z - p2.Z()) <= aDistance) + if (std::abs(X - p2.X()) + std::abs(Y - p2.Y()) + std::abs(Z - p2.Z()) <= aDistance) return Standard_True; return Prs3d::MatchSegment(X, Y, Z, aDistance, p1, p2, retdist); } @@ -230,16 +230,16 @@ static Standard_Boolean MatchCurve(const Standard_Real X, const Standard_Real Radius = aCurve.Circle().Radius(); if (!Precision::IsInfinite(Radius)) { - const Standard_Real DU = Sqrt(8.0 * TheDeflection / Radius); - const Standard_Real Er = Abs(U2 - U1) / DU; - const Standard_Integer N = Max(2, (Standard_Integer)IntegerPart(Er)); + const Standard_Real DU = std::sqrt(8.0 * TheDeflection / Radius); + const Standard_Real Er = std::abs(U2 - U1) / DU; + const Standard_Integer N = std::max(2, (Standard_Integer)std::trunc(Er)); if (N > 0) { gp_Pnt p1, p2; for (Standard_Integer Index = 1; Index <= N + 1; Index++) { p2 = aCurve.Value(U1 + (Index - 1) * DU); - if (Abs(X - p2.X()) + Abs(Y - p2.Y()) + Abs(Z - p2.Z()) <= aDistance) + if (std::abs(X - p2.X()) + std::abs(Y - p2.Y()) + std::abs(Z - p2.Z()) <= aDistance) return Standard_True; if (Index > 1) @@ -262,7 +262,7 @@ static Standard_Boolean MatchCurve(const Standard_Real X, for (Standard_Integer i = 1; i <= NumberOfPoints; i++) { p2 = Algo.Value(i); - if (Abs(X - p2.X()) + Abs(Y - p2.Y()) + Abs(Z - p2.Z()) <= aDistance) + if (std::abs(X - p2.X()) + std::abs(Y - p2.Y()) + std::abs(Z - p2.Z()) <= aDistance) return Standard_True; if (i > 1) { diff --git a/src/Visualization/TKV3d/StdPrs/StdPrs_Isolines.cxx b/src/Visualization/TKV3d/StdPrs/StdPrs_Isolines.cxx index 8a298ce49c..73eed81926 100644 --- a/src/Visualization/TKV3d/StdPrs/StdPrs_Isolines.cxx +++ b/src/Visualization/TKV3d/StdPrs/StdPrs_Isolines.cxx @@ -68,7 +68,8 @@ static void sortSegments(const SeqOfVecOfSegments& theSegments, Standard_Real aLast = 0.0; for (VecOfSegments::Iterator aSegIter(*anIsoSegs); aSegIter.More(); aSegIter.Next()) { - if (!aPolyline->IsEmpty() && Abs(aSegIter.Value()[0].Param - aLast) > Precision::PConfusion()) + if (!aPolyline->IsEmpty() + && std::abs(aSegIter.Value()[0].Param - aLast) > Precision::PConfusion()) { aPolyline = new TColgp_HSequenceOfPnt(); thePolylines.Append(aPolyline); @@ -91,8 +92,8 @@ static void findLimits(const Adaptor3d_Curve& theCurve, Standard_Real& theFirst, Standard_Real& theLast) { - theFirst = Max(theCurve.FirstParameter(), theFirst); - theLast = Min(theCurve.LastParameter(), theLast); + theFirst = std::max(theCurve.FirstParameter(), theFirst); + theLast = std::min(theCurve.LastParameter(), theLast); Standard_Boolean isFirstInf = Precision::IsNegativeInfinite(theFirst); Standard_Boolean isLastInf = Precision::IsPositiveInfinite(theLast); @@ -214,10 +215,10 @@ void StdPrs_Isolines::AddOnTriangulation(const TopoDS_Face& theFace, if (Precision::IsInfinite(u1) || Precision::IsInfinite(u2) || Precision::IsInfinite(v1) || Precision::IsInfinite(v2)) { - u1 = Max(aUmin, u1); - u2 = Min(aUmax, u2); - v1 = Max(aVmin, v1); - v2 = Min(aVmax, v2); + u1 = std::max(aUmin, u1); + u2 = std::min(aUmax, u2); + v1 = std::max(aVmin, v1); + v2 = std::min(aVmax, v2); aSurface = new Geom_RectangularTrimmedSurface(aSurface, u1, u2, v1, v2); } } @@ -414,12 +415,12 @@ void StdPrs_Isolines::addOnSurface(const Handle(BRepAdaptor_Surface)& theSurface { // Choose a deflection for sampling edge uv curves. Standard_Real aUVLimit = theDrawer->MaximalParameterValue(); - Standard_Real aUmin = Max(theSurface->FirstUParameter(), -aUVLimit); - Standard_Real aUmax = Min(theSurface->LastUParameter(), aUVLimit); - Standard_Real aVmin = Max(theSurface->FirstVParameter(), -aUVLimit); - Standard_Real aVmax = Min(theSurface->LastVParameter(), aUVLimit); + Standard_Real aUmin = std::max(theSurface->FirstUParameter(), -aUVLimit); + Standard_Real aUmax = std::min(theSurface->LastUParameter(), aUVLimit); + Standard_Real aVmin = std::max(theSurface->FirstVParameter(), -aUVLimit); + Standard_Real aVmax = std::min(theSurface->LastVParameter(), aUVLimit); Standard_Real aSamplerDeflection = - Max(aUmax - aUmin, aVmax - aVmin) * theDrawer->DeviationCoefficient(); + std::max(aUmax - aUmin, aVmax - aVmin) * theDrawer->DeviationCoefficient(); Standard_Real aHatchingTolerance = RealLast(); try @@ -454,7 +455,7 @@ void StdPrs_Isolines::addOnSurface(const Handle(BRepAdaptor_Surface)& theSurface gp_Pnt2d aP1(aSampler.Value(anI).X(), aSampler.Value(anI).Y()); gp_Pnt2d aP2(aSampler.Value(anI + 1).X(), aSampler.Value(anI + 1).Y()); - aHatchingTolerance = Min(aP1.SquareDistance(aP2), aHatchingTolerance); + aHatchingTolerance = std::min(aP1.SquareDistance(aP2), aHatchingTolerance); aTrimPoints.Append(anOrientation == TopAbs_FORWARD ? aP1 : aP2); aTrimPoints.Append(anOrientation == TopAbs_FORWARD ? aP2 : aP1); @@ -487,13 +488,13 @@ void StdPrs_Isolines::addOnSurface(const Handle(BRepAdaptor_Surface)& theSurface } } - aU1 = Max(anOrigin - aUVLimit, aU1); - aU2 = Min(anOrigin + aUVLimit, aU2); + aU1 = std::max(anOrigin - aUVLimit, aU1); + aU2 = std::min(anOrigin + aUVLimit, aU2); gp_Pnt2d aP1 = anEdgeCurve->Value(aU1); gp_Pnt2d aP2 = anEdgeCurve->Value(aU2); - aHatchingTolerance = Min(aP1.SquareDistance(aP2), aHatchingTolerance); + aHatchingTolerance = std::min(aP1.SquareDistance(aP2), aHatchingTolerance); aTrimPoints.Append(anOrientation == TopAbs_FORWARD ? aP1 : aP2); aTrimPoints.Append(anOrientation == TopAbs_FORWARD ? aP2 : aP1); @@ -520,8 +521,8 @@ void StdPrs_Isolines::addOnSurface(const Handle(BRepAdaptor_Surface)& theSurface // Compute a hatching tolerance. aHatchingTolerance *= 0.1; - aHatchingTolerance = Max(Precision::Confusion(), aHatchingTolerance); - aHatchingTolerance = Min(1.0E-5, aHatchingTolerance); + aHatchingTolerance = std::max(Precision::Confusion(), aHatchingTolerance); + aHatchingTolerance = std::min(1.0E-5, aHatchingTolerance); // Load isolines into hatcher. Hatch_Hatcher aHatcher(aHatchingTolerance, anEdgeTool.IsOriented()); @@ -741,7 +742,7 @@ Standard_Boolean StdPrs_Isolines::findSegmentOnTriangulation(const Handle(Geom_S isLeftUV2 ? theIsoline.Distance(aNodeUV2) : -theIsoline.Distance(aNodeUV2); // Isoline crosses first point of an edge. - if (Abs(aDistanceUV1) < Precision::PConfusion()) + if (std::abs(aDistanceUV1) < Precision::PConfusion()) { theSegment[aNPoints].Param = theIsU ? aNodeUV1.Y() : aNodeUV1.X(); theSegment[aNPoints].Pnt = aNode1; @@ -750,7 +751,7 @@ Standard_Boolean StdPrs_Isolines::findSegmentOnTriangulation(const Handle(Geom_S } // Isoline crosses second point of an edge. - if (Abs(aDistanceUV2) < Precision::PConfusion()) + if (std::abs(aDistanceUV2) < Precision::PConfusion()) { theSegment[aNPoints].Param = theIsU ? aNodeUV2.Y() : aNodeUV2.X(); theSegment[aNPoints].Pnt = aNode2; @@ -779,7 +780,8 @@ Standard_Boolean StdPrs_Isolines::findSegmentOnTriangulation(const Handle(Geom_S // Derive cross-point from parametric coordinates // ... - Standard_Real anAlpha = Abs(aDistanceUV1) / (Abs(aDistanceUV1) + Abs(aDistanceUV2)); + Standard_Real anAlpha = + std::abs(aDistanceUV1) / (std::abs(aDistanceUV1) + std::abs(aDistanceUV2)); gp_Pnt aCross(0.0, 0.0, 0.0); Standard_Real aCrossU = aNodeUV1.X() + anAlpha * (aNodeUV2.X() - aNodeUV1.X()); @@ -824,7 +826,8 @@ Standard_Boolean StdPrs_Isolines::findSegmentOnTriangulation(const Handle(Geom_S GCPnts_AbscissaPoint::Length(aCurveAdaptor1, aPntOnNode1Iso, aPntOnNode3Iso, 1e-2); Standard_Real aLength2 = GCPnts_AbscissaPoint::Length(aCurveAdaptor2, aPntOnNode2Iso, aPntOnNode3Iso, 1e-2); - if (Abs(aLength1) < Precision::Confusion() || Abs(aLength2) < Precision::Confusion()) + if (std::abs(aLength1) < Precision::Confusion() + || std::abs(aLength2) < Precision::Confusion()) { theSegment[aNPoints].Param = aCrossParam; theSegment[aNPoints].Pnt = (aNode2.XYZ() - aNode1.XYZ()) * anAlpha + aNode1.XYZ(); @@ -840,7 +843,8 @@ Standard_Boolean StdPrs_Isolines::findSegmentOnTriangulation(const Handle(Geom_S ++aNPoints; } - if (aNPoints != 2 || Abs(theSegment[1].Param - theSegment[0].Param) <= Precision::PConfusion()) + if (aNPoints != 2 + || std::abs(theSegment[1].Param - theSegment[0].Param) <= Precision::PConfusion()) { return false; } diff --git a/src/Visualization/TKV3d/StdPrs/StdPrs_Plane.cxx b/src/Visualization/TKV3d/StdPrs/StdPrs_Plane.cxx index b3c95c2c07..f47f9a81c2 100644 --- a/src/Visualization/TKV3d/StdPrs/StdPrs_Plane.cxx +++ b/src/Visualization/TKV3d/StdPrs/StdPrs_Plane.cxx @@ -60,8 +60,8 @@ void StdPrs_Plane::Add(const Handle(Prs3d_Presentation)& aPresentation, { TheGroup->SetPrimitivesAspect(theaspect->IsoAspect()->Aspect()); const Standard_Real dist = theaspect->IsoDistance(); - const Standard_Integer nbx = Standard_Integer(Abs(2. * Xmax) / dist) - 1; - const Standard_Integer nby = Standard_Integer(Abs(2. * Ymax) / dist) - 1; + const Standard_Integer nbx = Standard_Integer(std::abs(2. * Xmax) / dist) - 1; + const Standard_Integer nby = Standard_Integer(std::abs(2. * Ymax) / dist) - 1; Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2 * (nbx + nby)); Standard_Integer i; Standard_Real cur = -Xmax + dist; @@ -142,7 +142,7 @@ Standard_Boolean StdPrs_Plane::Match(const Standard_Real X, gp_Pln theplane = aPlane.Plane(); gp_Pnt thepoint(X, Y, Z); - return (Abs(theplane.Distance(thepoint)) <= aDistance); + return (std::abs(theplane.Distance(thepoint)) <= aDistance); } else return Standard_False; diff --git a/src/Visualization/TKV3d/StdPrs/StdPrs_PoleCurve.cxx b/src/Visualization/TKV3d/StdPrs/StdPrs_PoleCurve.cxx index 91a17f6942..c7cf9d30c0 100644 --- a/src/Visualization/TKV3d/StdPrs/StdPrs_PoleCurve.cxx +++ b/src/Visualization/TKV3d/StdPrs/StdPrs_PoleCurve.cxx @@ -93,7 +93,7 @@ Standard_Boolean StdPrs_PoleCurve::Match(const Standard_Real X, for (i = 1; i <= Nb; i++) { Bz->Pole(i).Coord(x, y, z); - if (Abs(X - x) + Abs(Y - y) + Abs(Z - z) <= aDistance) + if (std::abs(X - x) + std::abs(Y - y) + std::abs(Z - z) <= aDistance) return Standard_True; } return Standard_False; @@ -105,7 +105,7 @@ Standard_Boolean StdPrs_PoleCurve::Match(const Standard_Real X, for (i = 1; i <= Nb; i++) { Bs->Pole(i).Coord(x, y, z); - if (Abs(X - x) + Abs(Y - y) + Abs(Z - z) <= aDistance) + if (std::abs(X - x) + std::abs(Y - y) + std::abs(Z - z) <= aDistance) return Standard_True; } return Standard_False; @@ -134,7 +134,7 @@ Standard_Integer StdPrs_PoleCurve::Pick(const Standard_Real X, for (i = 1; i <= Nb; i++) { Bz->Pole(i).Coord(x, y, z); - dist = Abs(X - x) + Abs(Y - y) + Abs(Z - z); + dist = std::abs(X - x) + std::abs(Y - y) + std::abs(Z - z); if (dist <= aDistance) { if (dist < DistMin) @@ -152,7 +152,7 @@ Standard_Integer StdPrs_PoleCurve::Pick(const Standard_Real X, for (i = 1; i <= Nb; i++) { Bs->Pole(i).Coord(x, y, z); - dist = Abs(X - x) + Abs(Y - y) + Abs(Z - z); + dist = std::abs(X - x) + std::abs(Y - y) + std::abs(Z - z); if (dist <= aDistance) { if (dist < DistMin) diff --git a/src/Visualization/TKV3d/StdPrs/StdPrs_ToolTriangulatedShape.cxx b/src/Visualization/TKV3d/StdPrs/StdPrs_ToolTriangulatedShape.cxx index 02308114b5..965e65f332 100644 --- a/src/Visualization/TKV3d/StdPrs/StdPrs_ToolTriangulatedShape.cxx +++ b/src/Visualization/TKV3d/StdPrs/StdPrs_ToolTriangulatedShape.cxx @@ -197,8 +197,8 @@ void StdPrs_ToolTriangulatedShape::ClearOnOwnDeflectionChange( const Standard_Real anAnglePrev = theDrawer->PreviousDeviationAngle(); const Standard_Real aCoeffNew = theDrawer->DeviationCoefficient(); const Standard_Real aCoeffPrev = theDrawer->PreviousDeviationCoefficient(); - if ((!isOwnDeviationAngle || Abs(anAngleNew - anAnglePrev) <= Precision::Angular()) - && (!isOwnDeviationCoefficient || Abs(aCoeffNew - aCoeffPrev) <= Precision::Confusion())) + if ((!isOwnDeviationAngle || std::abs(anAngleNew - anAnglePrev) <= Precision::Angular()) + && (!isOwnDeviationCoefficient || std::abs(aCoeffNew - aCoeffPrev) <= Precision::Confusion())) { return; } diff --git a/src/Visualization/TKV3d/StdPrs/StdPrs_WFDeflectionRestrictedFace.cxx b/src/Visualization/TKV3d/StdPrs/StdPrs_WFDeflectionRestrictedFace.cxx index e4c3c7a80a..e72b6d29a0 100644 --- a/src/Visualization/TKV3d/StdPrs/StdPrs_WFDeflectionRestrictedFace.cxx +++ b/src/Visualization/TKV3d/StdPrs/StdPrs_WFDeflectionRestrictedFace.cxx @@ -44,8 +44,8 @@ static void FindLimits(const Adaptor3d_Curve& aCurve, Standard_Real& First, Standard_Real& Last) { - First = Max(aCurve.FirstParameter(), First); - Last = Min(aCurve.LastParameter(), Last); + First = std::max(aCurve.FirstParameter(), First); + Last = std::min(aCurve.LastParameter(), Last); Standard_Boolean firstInf = Precision::IsNegativeInfinite(First); Standard_Boolean lastInf = Precision::IsPositiveInfinite(Last); @@ -113,16 +113,16 @@ void StdPrs_WFDeflectionRestrictedFace::Add(const Handle(Prs3d_Presentation)& a const Standard_Real aLimit = aDrawer->MaximalParameterValue(); // compute bounds of the restriction - Standard_Real UMin = Max(UF, -aLimit); - Standard_Real UMax = Min(UL, aLimit); - Standard_Real VMin = Max(VF, -aLimit); - Standard_Real VMax = Min(VL, aLimit); + Standard_Real UMin = std::max(UF, -aLimit); + Standard_Real UMax = std::min(UL, aLimit); + Standard_Real VMin = std::max(VF, -aLimit); + Standard_Real VMax = std::min(VL, aLimit); // update min max for the hatcher. - gp_Pnt2d P1, P2; - Standard_Real U1, U2; - gp_Pnt dummypnt; - Standard_Real ddefle = Max(UMax - UMin, VMax - VMin) * aDrawer->DeviationCoefficient(); + gp_Pnt2d P1, P2; + Standard_Real U1, U2; + gp_Pnt dummypnt; + Standard_Real ddefle = std::max(UMax - UMin, VMax - VMin) * aDrawer->DeviationCoefficient(); TColgp_SequenceOfPnt2d tabP; Standard_Real aHatchingTol = 1.e100; @@ -143,20 +143,20 @@ void StdPrs_WFDeflectionRestrictedFace::Add(const Handle(Prs3d_Presentation)& a { dummypnt = UDP.Value(1); P2.SetCoord(dummypnt.X(), dummypnt.Y()); - UMin = Min(P2.X(), UMin); - UMax = Max(P2.X(), UMax); - VMin = Min(P2.Y(), VMin); - VMax = Max(P2.Y(), VMax); + UMin = std::min(P2.X(), UMin); + UMax = std::max(P2.X(), UMax); + VMin = std::min(P2.Y(), VMin); + VMax = std::max(P2.Y(), VMax); for (Standard_Integer i = 2; i <= aNumberOfPoints; i++) { P1 = P2; dummypnt = UDP.Value(i); P2.SetCoord(dummypnt.X(), dummypnt.Y()); - UMin = Min(P2.X(), UMin); - UMax = Max(P2.X(), UMax); - VMin = Min(P2.Y(), VMin); - VMax = Max(P2.Y(), VMax); - aHatchingTol = Min(P1.SquareDistance(P2), aHatchingTol); + UMin = std::min(P2.X(), UMin); + UMax = std::max(P2.X(), UMax); + VMin = std::min(P2.Y(), VMin); + VMax = std::max(P2.Y(), VMax); + aHatchingTol = std::min(P1.SquareDistance(P2), aHatchingTol); if (anOrient == TopAbs_FORWARD) { @@ -203,19 +203,19 @@ void StdPrs_WFDeflectionRestrictedFace::Add(const Handle(Prs3d_Presentation)& a aOrigin = (U1 + U2) * 0.5; } } - U1 = Max(aOrigin - aLimit, U1); - U2 = Min(aOrigin + aLimit, U2); + U1 = std::max(aOrigin - aLimit, U1); + U2 = std::min(aOrigin + aLimit, U2); P1 = TheRCurve->Value(U1); P2 = TheRCurve->Value(U2); - UMin = Min(P1.X(), UMin); - UMax = Max(P1.X(), UMax); - VMin = Min(P1.Y(), VMin); - VMax = Max(P1.Y(), VMax); - UMin = Min(P2.X(), UMin); - UMax = Max(P2.X(), UMax); - VMin = Min(P2.Y(), VMin); - VMax = Max(P2.Y(), VMax); - aHatchingTol = Min(P1.SquareDistance(P2), aHatchingTol); + UMin = std::min(P1.X(), UMin); + UMax = std::max(P1.X(), UMax); + VMin = std::min(P1.Y(), VMin); + VMax = std::max(P1.Y(), VMax); + UMin = std::min(P2.X(), UMin); + UMax = std::max(P2.X(), UMax); + VMin = std::min(P2.Y(), VMin); + VMax = std::max(P2.Y(), VMax); + aHatchingTol = std::min(P1.SquareDistance(P2), aHatchingTol); if (anOrient == TopAbs_FORWARD) { @@ -239,8 +239,8 @@ void StdPrs_WFDeflectionRestrictedFace::Add(const Handle(Prs3d_Presentation)& a // Compute the hatching tolerance. aHatchingTol *= 0.1; - aHatchingTol = Max(Precision::Confusion(), aHatchingTol); - aHatchingTol = Min(1.e-5, aHatchingTol); + aHatchingTol = std::max(Precision::Confusion(), aHatchingTol); + aHatchingTol = std::min(1.e-5, aHatchingTol); // load the isos Hatch_Hatcher isobuild(aHatchingTol, ToolRst.IsOriented()); diff --git a/src/Visualization/TKV3d/StdPrs/StdPrs_WFDeflectionSurface.cxx b/src/Visualization/TKV3d/StdPrs/StdPrs_WFDeflectionSurface.cxx index 87e415e557..583a3fdf1d 100644 --- a/src/Visualization/TKV3d/StdPrs/StdPrs_WFDeflectionSurface.cxx +++ b/src/Visualization/TKV3d/StdPrs/StdPrs_WFDeflectionSurface.cxx @@ -153,11 +153,11 @@ void StdPrs_WFDeflectionSurface::Add(const Handle(Prs3d_Presentation)& aPresenta Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax; Total.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax); if (!(Total.IsOpenXmin() || Total.IsOpenXmax())) - m = Min(m, Abs(aXmax - aXmin)); + m = std::min(m, std::abs(aXmax - aXmin)); if (!(Total.IsOpenYmin() || Total.IsOpenYmax())) - m = Min(m, Abs(aYmax - aYmin)); + m = std::min(m, std::abs(aYmax - aYmin)); if (!(Total.IsOpenZmin() || Total.IsOpenZmax())) - m = Min(m, Abs(aZmax - aZmin)); + m = std::min(m, std::abs(aZmax - aZmin)); TheDeflection = m * aDrawer->DeviationCoefficient(); } diff --git a/src/Visualization/TKV3d/StdSelect/StdSelect_BRepSelectionTool.cxx b/src/Visualization/TKV3d/StdSelect/StdSelect_BRepSelectionTool.cxx index 0e44920551..43096395cc 100644 --- a/src/Visualization/TKV3d/StdSelect/StdSelect_BRepSelectionTool.cxx +++ b/src/Visualization/TKV3d/StdSelect/StdSelect_BRepSelectionTool.cxx @@ -593,8 +593,8 @@ void StdSelect_BRepSelectionTool::GetEdgeSensitive(const TopoDS_Shape& aV2 = anIntervals(anIntervalId + 1); if (aV2 > aParamFirst && aV1 < aParamLast) { - aV1 = Max(aV1, aParamFirst); - aV2 = Min(aV2, aParamLast); + aV1 = std::max(aV1, aParamFirst); + aV2 = std::min(aV2, aParamLast); GCPnts_TangentialDeflection anAlgo(cu3d, aV1, aV2, theDeviationAngle, theDeflection); aNumberOfPoints = anAlgo.NbPoints(); @@ -624,11 +624,11 @@ void StdSelect_BRepSelectionTool::GetEdgeSensitive(const TopoDS_Shape& if (cu3d.GetType() == GeomAbs_BSplineCurve) { nbintervals = cu3d.NbKnots() - 1; - nbintervals = Max(1, nbintervals / 3); + nbintervals = std::max(1, nbintervals / 3); } Standard_Real aParam; - Standard_Integer aPntNb = Max(2, theNbPOnEdge * nbintervals); + Standard_Integer aPntNb = std::max(2, theNbPOnEdge * nbintervals); Standard_Real aParamDelta = (aParamLast - aParamFirst) / (aPntNb - 1); Handle(TColgp_HArray1OfPnt) aPointArray = new TColgp_HArray1OfPnt(1, aPntNb); for (Standard_Integer aPntId = 1; aPntId <= aPntNb; ++aPntId) @@ -703,7 +703,7 @@ Standard_Boolean StdSelect_BRepSelectionTool::GetSensitiveForFace( { aRad1 = 0.0; aRad2 = aCircles[0].Radius(); - aHeight = aRad2 * Tan(aCone.SemiAngle()); + aHeight = aRad2 * std::tan(aCone.SemiAngle()); aTrsf.SetTransformation(aCone.Position(), gp::XOY()); } else @@ -835,7 +835,7 @@ Standard_Boolean StdSelect_BRepSelectionTool::GetSensitiveForFace( Standard_Real wf = 0.0, wl = 0.0; BRep_Tool::Range(aWireExplorer.Current(), wf, wl); - if (Abs(wf - wl) <= Precision::Confusion()) + if (std::abs(wf - wl) <= Precision::Confusion()) { #ifdef OCCT_DEBUG std::cout << " StdSelect_BRepSelectionTool : Curve where ufirst = ulast ...." << std::endl; @@ -863,14 +863,15 @@ Standard_Boolean StdSelect_BRepSelectionTool::GetSensitiveForFace( break; } case GeomAbs_Circle: { - if (2.0 * M_PI - Abs(wl - wf) <= Precision::Confusion()) + if (2.0 * M_PI - std::abs(wl - wf) <= Precision::Confusion()) { if (BS.GetType() == GeomAbs_Cylinder || BS.GetType() == GeomAbs_Torus || BS.GetType() == GeomAbs_Cone || BS.GetType() == GeomAbs_BSplineSurface) // beuurkk pour l'instant... { Standard_Real ff = wf, ll = wl; - Standard_Real dw = (Max(wf, wl) - Min(wf, wl)) / (Standard_Real)Max(2, NbPOnEdge - 1); + Standard_Real dw = (std::max(wf, wl) - std::min(wf, wl)) + / static_cast(std::max(2, NbPOnEdge - 1)); if (aWireExplorer.Orientation() == TopAbs_FORWARD) { for (Standard_Real wc = wf + dw; wc <= wl; wc += dw) @@ -903,7 +904,8 @@ Standard_Boolean StdSelect_BRepSelectionTool::GetSensitiveForFace( else { Standard_Real ff = wf, ll = wl; - Standard_Real dw = (Max(wf, wl) - Min(wf, wl)) / (Standard_Real)Max(2, NbPOnEdge - 1); + Standard_Real dw = + (std::max(wf, wl) - std::min(wf, wl)) / static_cast(std::max(2, NbPOnEdge - 1)); if (aWireExplorer.Orientation() == TopAbs_FORWARD) { for (Standard_Real wc = wf + dw; wc <= wl; wc += dw) @@ -923,7 +925,8 @@ Standard_Boolean StdSelect_BRepSelectionTool::GetSensitiveForFace( } default: { Standard_Real ff = wf, ll = wl; - Standard_Real dw = (Max(wf, wl) - Min(wf, wl)) / (Standard_Real)Max(2, NbPOnEdge - 1); + Standard_Real dw = + (std::max(wf, wl) - std::min(wf, wl)) / static_cast(std::max(2, NbPOnEdge - 1)); if (aWireExplorer.Orientation() == TopAbs_FORWARD) { for (Standard_Real wc = wf + dw; wc <= wl; wc += dw) @@ -1002,10 +1005,10 @@ Standard_Boolean StdSelect_BRepSelectionTool::GetSensitiveForCylinder( const gp_Cone aCone = BRepAdaptor_Surface(*aFaces[aConIndex]).Cone(); const Standard_Real aRad1 = aCone.RefRadius(); const Standard_Real aHeight = - (aRad1 != 0.0) ? aRad1 / Abs(Tan(aCone.SemiAngle())) + (aRad1 != 0.0) ? aRad1 / std::abs(std::tan(aCone.SemiAngle())) : aCone.Location().Distance( aGeomPln->Location().Transformed(aLocSurf[aConIndex == 0 ? 1 : 0])); - const Standard_Real aRad2 = (aRad1 != 0.0) ? 0.0 : Tan(aCone.SemiAngle()) * aHeight; + const Standard_Real aRad2 = (aRad1 != 0.0) ? 0.0 : std::tan(aCone.SemiAngle()) * aHeight; gp_Trsf aTrsf; aTrsf.SetTransformation(aCone.Position(), gp::XOY()); Handle(Select3D_SensitiveCylinder) aSensSCyl = @@ -1076,12 +1079,12 @@ Standard_Boolean StdSelect_BRepSelectionTool::GetSensitiveForCylinder( .Distance(aGeomPlanes[1]->Location().Transformed(*aGeomPlanesLoc[1])); gp_Trsf aTrsf; aTrsf.SetTransformation(aCone.Position(), gp::XOY()); - const Standard_Real aTriangleHeight = (aCone.SemiAngle() > 0.0) - ? aRad1 / Tan(aCone.SemiAngle()) - : aRad1 / Tan(Abs(aCone.SemiAngle())) - aHeight; - const Standard_Real aRad2 = (aCone.SemiAngle() > 0.0) - ? aRad1 * (aTriangleHeight + aHeight) / aTriangleHeight - : aRad1 * aTriangleHeight / (aTriangleHeight + aHeight); + const Standard_Real aTriangleHeight = + (aCone.SemiAngle() > 0.0) ? aRad1 / std::tan(aCone.SemiAngle()) + : aRad1 / std::tan(std::abs(aCone.SemiAngle())) - aHeight; + const Standard_Real aRad2 = (aCone.SemiAngle() > 0.0) + ? aRad1 * (aTriangleHeight + aHeight) / aTriangleHeight + : aRad1 * aTriangleHeight / (aTriangleHeight + aHeight); Handle(Select3D_SensitiveCylinder) aSensSCyl = new Select3D_SensitiveCylinder(theOwner, aRad1, aRad2, aHeight, aTrsf); diff --git a/src/Visualization/TKV3d/V3d/V3d.cxx b/src/Visualization/TKV3d/V3d/V3d.cxx index 9d65f25818..42db3d5fa8 100644 --- a/src/Visualization/TKV3d/V3d/V3d.cxx +++ b/src/Visualization/TKV3d/V3d/V3d.cxx @@ -53,9 +53,9 @@ void V3d::ArrowOfRadius(const Handle(Graphic3d_Group)& garrow, // Construction d'un repere i,j pour le cercle: Xn = 0., Yn = 0., Zn = 0.; - if (Abs(Dx) <= Abs(Dy) && Abs(Dx) <= Abs(Dz)) + if (std::abs(Dx) <= std::abs(Dy) && std::abs(Dx) <= std::abs(Dz)) Xn = 1.; - else if (Abs(Dy) <= Abs(Dz) && Abs(Dy) <= Abs(Dx)) + else if (std::abs(Dy) <= std::abs(Dz) && std::abs(Dy) <= std::abs(Dx)) Yn = 1.; else Zn = 1.; @@ -63,7 +63,7 @@ void V3d::ArrowOfRadius(const Handle(Graphic3d_Group)& garrow, Yi = Dz * Xn - Dx * Zn; Zi = Dx * Yn - Dy * Xn; - Norme = Sqrt(Xi * Xi + Yi * Yi + Zi * Zi); + Norme = std::sqrt(Xi * Xi + Yi * Yi + Zi * Zi); Xi = Xi / Norme; Yi = Yi / Norme; Zi = Zi / Norme; @@ -76,11 +76,11 @@ void V3d::ArrowOfRadius(const Handle(Graphic3d_Group)& garrow, new Graphic3d_ArrayOfPolylines(3 * NbPoints, NbPoints); Standard_Integer i; - const Standard_Real Tg = Tan(Alpha); + const Standard_Real Tg = std::tan(Alpha); for (i = 1; i <= NbPoints; i++) { - const Standard_Real cosinus = Cos(2. * M_PI / NbPoints * (i - 1)); - const Standard_Real sinus = Sin(2. * M_PI / NbPoints * (i - 1)); + const Standard_Real cosinus = std::cos(2. * M_PI / NbPoints * (i - 1)); + const Standard_Real sinus = std::sin(2. * M_PI / NbPoints * (i - 1)); X = Xc + (cosinus * Xi + sinus * Xj) * Lng * Tg; Y = Yc + (cosinus * Yi + sinus * Yj) * Lng * Tg; @@ -110,7 +110,7 @@ void V3d::CircleInPlane(const Handle(Graphic3d_Group)& gcircle, const Standard_Real DZ, const Standard_Real Rayon) { - Standard_Real Norme = Sqrt(DX * DX + DY * DY + DZ * DZ); + Standard_Real Norme = std::sqrt(DX * DX + DY * DY + DZ * DZ); if (Norme >= 0.0001) { Standard_Real VX, VY, VZ, X, Y, Z, Xn, Yn, Zn, Xi, Yi, Zi, Xj, Yj, Zj; @@ -121,9 +121,9 @@ void V3d::CircleInPlane(const Handle(Graphic3d_Group)& gcircle, // Construction of marker i,j for the circle: Xn = 0., Yn = 0., Zn = 0.; - if (Abs(VX) <= Abs(VY) && Abs(VX) <= Abs(VZ)) + if (std::abs(VX) <= std::abs(VY) && std::abs(VX) <= std::abs(VZ)) Xn = 1.; - else if (Abs(VY) <= Abs(VZ) && Abs(VY) <= Abs(VX)) + else if (std::abs(VY) <= std::abs(VZ) && std::abs(VY) <= std::abs(VX)) Yn = 1.; else Zn = 1.; @@ -131,7 +131,7 @@ void V3d::CircleInPlane(const Handle(Graphic3d_Group)& gcircle, Yi = VZ * Xn - VX * Zn; Zi = VX * Yn - VY * Xn; - Norme = Sqrt(Xi * Xi + Yi * Yi + Zi * Zi); + Norme = std::sqrt(Xi * Xi + Yi * Yi + Zi * Zi); Xi = Xi / Norme; Yi = Yi / Norme; Zi = Zi / Norme; @@ -148,8 +148,8 @@ void V3d::CircleInPlane(const Handle(Graphic3d_Group)& gcircle, const Standard_Real Dalpha = 2. * M_PI / NFACES; for (; i <= NFACES; i++, Alpha += Dalpha) { - const Standard_Real cosinus = Cos(Alpha); - const Standard_Real sinus = Sin(Alpha); + const Standard_Real cosinus = std::cos(Alpha); + const Standard_Real sinus = std::sin(Alpha); X = X0 + (cosinus * Xi + sinus * Xj) * Rayon; Y = Y0 + (cosinus * Yi + sinus * Yj) * Rayon; diff --git a/src/Visualization/TKV3d/V3d/V3d_CircularGrid.cxx b/src/Visualization/TKV3d/V3d/V3d_CircularGrid.cxx index 9b89c798ca..8bbd47356a 100644 --- a/src/Visualization/TKV3d/V3d/V3d_CircularGrid.cxx +++ b/src/Visualization/TKV3d/V3d/V3d_CircularGrid.cxx @@ -160,8 +160,8 @@ void V3d_CircularGrid::UpdateDisplay() if (MakeTransform) { - const Standard_Real CosAlpha = Cos(RotationAngle()); - const Standard_Real SinAlpha = Sin(RotationAngle()); + const Standard_Real CosAlpha = std::cos(RotationAngle()); + const Standard_Real SinAlpha = std::sin(RotationAngle()); gp_Trsf aTrsf; // Translation @@ -241,7 +241,7 @@ void V3d_CircularGrid::DefineLines() for (Standard_Integer i = 1; i <= nbpnts; i++) { aPrims1->AddVertex(p0); - aPrims1->AddVertex(Cos(alpha * i) * myRadius, Sin(alpha * i) * myRadius, -myOffSet); + aPrims1->AddVertex(std::cos(alpha * i) * myRadius, std::sin(alpha * i) * myRadius, -myOffSet); } myGroup->AddPrimitiveArray(aPrims1, Standard_False); @@ -255,7 +255,7 @@ void V3d_CircularGrid::DefineLines() const Standard_Boolean isTenth = (Modulus(nblines, 10) == 0); for (Standard_Integer i = 0; i < nbpnts; i++) { - const gp_Pnt pt(Cos(alpha * i) * r, Sin(alpha * i) * r, -myOffSet); + const gp_Pnt pt(std::cos(alpha * i) * r, std::sin(alpha * i) * r, -myOffSet); (isTenth ? aSeqTenth : aSeqLines).Append(pt); } } @@ -332,7 +332,7 @@ void V3d_CircularGrid::DefinePoints() for (r = aStep; r <= myRadius; r += aStep) { for (Standard_Integer i = 0; i < nbpnts; i++) - aSeqPnts.Append(gp_Pnt(Cos(alpha * i) * r, Sin(alpha * i) * r, -myOffSet)); + aSeqPnts.Append(gp_Pnt(std::cos(alpha * i) * r, std::sin(alpha * i) * r, -myOffSet)); } myGroup->SetGroupPrimitivesAspect(MarkerAttrib); if (aSeqPnts.Length()) diff --git a/src/Visualization/TKV3d/V3d/V3d_RectangularGrid.cxx b/src/Visualization/TKV3d/V3d/V3d_RectangularGrid.cxx index 1f19d29233..69703bc8fd 100644 --- a/src/Visualization/TKV3d/V3d/V3d_RectangularGrid.cxx +++ b/src/Visualization/TKV3d/V3d/V3d_RectangularGrid.cxx @@ -162,8 +162,8 @@ void V3d_RectangularGrid::UpdateDisplay() if (MakeTransform) { - const Standard_Real CosAlpha = Cos(RotationAngle()); - const Standard_Real SinAlpha = Sin(RotationAngle()); + const Standard_Real CosAlpha = std::cos(RotationAngle()); + const Standard_Real SinAlpha = std::sin(RotationAngle()); gp_Trsf aTrsf; // Translation diff --git a/src/Visualization/TKV3d/V3d/V3d_Trihedron.cxx b/src/Visualization/TKV3d/V3d/V3d_Trihedron.cxx index 51277b087d..f692a56a6c 100644 --- a/src/Visualization/TKV3d/V3d/V3d_Trihedron.cxx +++ b/src/Visualization/TKV3d/V3d/V3d_Trihedron.cxx @@ -184,7 +184,7 @@ void V3d_Trihedron::SetArrowsColor(const Quantity_Color& theXColor, void V3d_Trihedron::SetScale(const Standard_Real theScale) { - if (Abs(myScale - theScale) > Precision::Confusion()) + if (std::abs(myScale - theScale) > Precision::Confusion()) { invalidate(); } @@ -195,7 +195,7 @@ void V3d_Trihedron::SetScale(const Standard_Real theScale) void V3d_Trihedron::SetSizeRatio(const Standard_Real theRatio) { - if (Abs(myRatio - theRatio) > Precision::Confusion()) + if (std::abs(myRatio - theRatio) > Precision::Confusion()) { invalidate(); } @@ -206,7 +206,7 @@ void V3d_Trihedron::SetSizeRatio(const Standard_Real theRatio) void V3d_Trihedron::SetArrowDiameter(const Standard_Real theDiam) { - if (Abs(myDiameter - theDiam) > Precision::Confusion()) + if (std::abs(myDiameter - theDiam) > Precision::Confusion()) { invalidate(); } @@ -217,7 +217,7 @@ void V3d_Trihedron::SetArrowDiameter(const Standard_Real theDiam) void V3d_Trihedron::SetNbFacets(const Standard_Integer theNbFacets) { - if (Abs(myNbFacettes - theNbFacets) > 0) + if (std::abs(myNbFacettes - theNbFacets) > 0) { invalidate(); } @@ -304,12 +304,12 @@ void V3d_Trihedron::compute() new Graphic3d_ArrayOfPolylines(THE_CIRCLE_SERMENTS_NB + 2); for (Standard_Integer anIt = THE_CIRCLE_SERMENTS_NB; anIt >= 0; --anIt) { - anCircleArray->AddVertex(aRayon * Sin(anIt * THE_CIRCLE_SEGMENT_ANGLE), - aRayon * Cos(anIt * THE_CIRCLE_SEGMENT_ANGLE), + anCircleArray->AddVertex(aRayon * std::sin(anIt * THE_CIRCLE_SEGMENT_ANGLE), + aRayon * std::cos(anIt * THE_CIRCLE_SEGMENT_ANGLE), 0.0); } - anCircleArray->AddVertex(aRayon * Sin(THE_CIRCLE_SERMENTS_NB * THE_CIRCLE_SEGMENT_ANGLE), - aRayon * Cos(THE_CIRCLE_SERMENTS_NB * THE_CIRCLE_SEGMENT_ANGLE), + anCircleArray->AddVertex(aRayon * std::sin(THE_CIRCLE_SERMENTS_NB * THE_CIRCLE_SEGMENT_ANGLE), + aRayon * std::cos(THE_CIRCLE_SERMENTS_NB * THE_CIRCLE_SEGMENT_ANGLE), 0.0); aSphereGroup->SetGroupPrimitivesAspect(mySphereShadingAspect->Aspect()); diff --git a/src/Visualization/TKV3d/V3d/V3d_View.cxx b/src/Visualization/TKV3d/V3d/V3d_View.cxx index 9e72f25b07..5e58397f95 100644 --- a/src/Visualization/TKV3d/V3d/V3d_View.cxx +++ b/src/Visualization/TKV3d/V3d/V3d_View.cxx @@ -511,9 +511,9 @@ void V3d_View::SetBackgroundColor(const Quantity_TypeOfColor theType, const Standard_Real theV2, const Standard_Real theV3) { - Standard_Real aV1 = Max(Min(theV1, 1.0), 0.0); - Standard_Real aV2 = Max(Min(theV2, 1.0), 0.0); - Standard_Real aV3 = Max(Min(theV3, 1.0), 0.0); + Standard_Real aV1 = std::max(std::min(theV1, 1.0), 0.0); + Standard_Real aV2 = std::max(std::min(theV2, 1.0), 0.0); + Standard_Real aV3 = std::max(std::min(theV3, 1.0), 0.0); SetBackgroundColor(Quantity_Color(aV1, aV2, aV3, theType)); } @@ -1155,7 +1155,7 @@ void V3d_View::SetDepth(const Standard_Real Depth) // Move the view ref point instead of the eye. gp_Vec aDir(aCamera->Direction()); gp_Pnt aCameraEye = aCamera->Eye(); - gp_Pnt aCameraCenter = aCameraEye.Translated(aDir.Multiplied(Abs(Depth))); + gp_Pnt aCameraCenter = aCameraEye.Translated(aDir.Multiplied(std::abs(Depth))); aCamera->SetCenter(aCameraCenter); } @@ -1167,7 +1167,7 @@ void V3d_View::SetDepth(const Standard_Real Depth) void V3d_View::SetProj(const Standard_Real Vx, const Standard_Real Vy, const Standard_Real Vz) { - V3d_BadValue_Raise_if(Sqrt(Vx * Vx + Vy * Vy + Vz * Vz) <= 0., + V3d_BadValue_Raise_if(std::sqrt(Vx * Vx + Vy * Vy + Vz * Vz) <= 0., "V3d_View::SetProj, null projection vector"); Standard_Real aTwistBefore = Twist(); @@ -1371,12 +1371,12 @@ void V3d_View::SetZSize(const Standard_Real theSize) // ShortReal precision factor used to add meaningful tolerance to // ZNear, ZFar values in order to avoid equality after type conversion // to ShortReal matrices type. - const Standard_Real aPrecision = 1.0 / Pow(10.0, ShortRealDigits() - 1); + const Standard_Real aPrecision = 1.0 / std::pow(10.0, ShortRealDigits() - 1); Standard_Real aZFar = Zmax + aDistance * 2.0; Standard_Real aZNear = -Zmax + aDistance; - aZNear -= Abs(aZNear) * aPrecision; - aZFar += Abs(aZFar) * aPrecision; + aZNear -= std::abs(aZNear) * aPrecision; + aZFar += std::abs(aZFar) * aPrecision; if (!aCamera->IsOrthographic()) { @@ -1386,17 +1386,17 @@ void V3d_View::SetZSize(const Standard_Real theSize) aZNear = aPrecision; aZFar = aPrecision * 2.0; } - else if (aZNear < Abs(aZFar) * aPrecision) + else if (aZNear < std::abs(aZFar) * aPrecision) { // Z is less than 0.0, try to fix it using any appropriate z-scale - aZNear = Abs(aZFar) * aPrecision; + aZNear = std::abs(aZFar) * aPrecision; } } // If range is too small - if (aZFar < (aZNear + Abs(aZFar) * aPrecision)) + if (aZFar < (aZNear + std::abs(aZFar) * aPrecision)) { - aZFar = aZNear + Abs(aZFar) * aPrecision; + aZFar = aZNear + std::abs(aZFar) * aPrecision; } aCamera->SetZRange(aZNear, aZFar); @@ -1552,65 +1552,65 @@ void V3d_View::DepthFitAll(const Standard_Real Aspect, const Standard_Real Margi aBox.Get(Xmin, Ymin, Zmin, Xmax, Ymax, Zmax); Project(Xmin, Ymin, Zmin, U, V, W); Project(Xmax, Ymax, Zmax, U1, V1, W1); - Umin = Min(U, U1); - Umax = Max(U, U1); - Vmin = Min(V, V1); - Vmax = Max(V, V1); - Wmin = Min(W, W1); - Wmax = Max(W, W1); + Umin = std::min(U, U1); + Umax = std::max(U, U1); + Vmin = std::min(V, V1); + Vmax = std::max(V, V1); + Wmin = std::min(W, W1); + Wmax = std::max(W, W1); Project(Xmin, Ymin, Zmax, U, V, W); - Umin = Min(U, Umin); - Umax = Max(U, Umax); - Vmin = Min(V, Vmin); - Vmax = Max(V, Vmax); - Wmin = Min(W, Wmin); - Wmax = Max(W, Wmax); + Umin = std::min(U, Umin); + Umax = std::max(U, Umax); + Vmin = std::min(V, Vmin); + Vmax = std::max(V, Vmax); + Wmin = std::min(W, Wmin); + Wmax = std::max(W, Wmax); Project(Xmax, Ymin, Zmax, U, V, W); - Umin = Min(U, Umin); - Umax = Max(U, Umax); - Vmin = Min(V, Vmin); - Vmax = Max(V, Vmax); - Wmin = Min(W, Wmin); - Wmax = Max(W, Wmax); + Umin = std::min(U, Umin); + Umax = std::max(U, Umax); + Vmin = std::min(V, Vmin); + Vmax = std::max(V, Vmax); + Wmin = std::min(W, Wmin); + Wmax = std::max(W, Wmax); Project(Xmax, Ymin, Zmin, U, V, W); - Umin = Min(U, Umin); - Umax = Max(U, Umax); - Vmin = Min(V, Vmin); - Vmax = Max(V, Vmax); - Wmin = Min(W, Wmin); - Wmax = Max(W, Wmax); + Umin = std::min(U, Umin); + Umax = std::max(U, Umax); + Vmin = std::min(V, Vmin); + Vmax = std::max(V, Vmax); + Wmin = std::min(W, Wmin); + Wmax = std::max(W, Wmax); Project(Xmax, Ymax, Zmin, U, V, W); - Umin = Min(U, Umin); - Umax = Max(U, Umax); - Vmin = Min(V, Vmin); - Vmax = Max(V, Vmax); - Wmin = Min(W, Wmin); - Wmax = Max(W, Wmax); + Umin = std::min(U, Umin); + Umax = std::max(U, Umax); + Vmin = std::min(V, Vmin); + Vmax = std::max(V, Vmax); + Wmin = std::min(W, Wmin); + Wmax = std::max(W, Wmax); Project(Xmin, Ymax, Zmax, U, V, W); - Umin = Min(U, Umin); - Umax = Max(U, Umax); - Vmin = Min(V, Vmin); - Vmax = Max(V, Vmax); - Wmin = Min(W, Wmin); - Wmax = Max(W, Wmax); + Umin = std::min(U, Umin); + Umax = std::max(U, Umax); + Vmin = std::min(V, Vmin); + Vmax = std::max(V, Vmax); + Wmin = std::min(W, Wmin); + Wmax = std::max(W, Wmax); Project(Xmin, Ymax, Zmin, U, V, W); - Umin = Min(U, Umin); - Umax = Max(U, Umax); - Vmin = Min(V, Vmin); - Vmax = Max(V, Vmax); - Wmin = Min(W, Wmin); - Wmax = Max(W, Wmax); + Umin = std::min(U, Umin); + Umax = std::max(U, Umax); + Vmin = std::min(V, Vmin); + Vmax = std::max(V, Vmax); + Wmin = std::min(W, Wmin); + Wmax = std::max(W, Wmax); // Adjust Z size - Wmax = Max(Abs(Wmin), Abs(Wmax)); + Wmax = std::max(std::abs(Wmin), std::abs(Wmax)); Dz = 2. * Wmax + Margin * Wmax; // Compute depth value - Dx = Abs(Umax - Umin); - Dy = Abs(Vmax - Vmin); // Dz = Abs(Wmax - Wmin); + Dx = std::abs(Umax - Umin); + Dy = std::abs(Vmax - Vmin); // Dz = std::abs(Wmax - Wmin); Dx += Margin * Dx; Dy += Margin * Dy; - Size = Sqrt(Dx * Dx + Dy * Dy + Dz * Dz); + Size = std::sqrt(Dx * Dx + Dy * Dy + Dz * Dz); if (Size > 0.) { SetZSize(Size); @@ -1993,47 +1993,47 @@ Standard_Integer V3d_View::MinMax(Standard_Real& Umin, Project(Xmin, Ymin, Zmin, Umin, Vmin, Wmin); Project(Xmax, Ymax, Zmax, Umax, Vmax, Wmax); Project(Xmin, Ymin, Zmax, U, V, W); - Umin = Min(U, Umin); - Umax = Max(U, Umax); - Vmin = Min(V, Vmin); - Vmax = Max(V, Vmax); - Wmin = Min(W, Wmin); - Wmax = Max(W, Wmax); + Umin = std::min(U, Umin); + Umax = std::max(U, Umax); + Vmin = std::min(V, Vmin); + Vmax = std::max(V, Vmax); + Wmin = std::min(W, Wmin); + Wmax = std::max(W, Wmax); Project(Xmax, Ymin, Zmax, U, V, W); - Umin = Min(U, Umin); - Umax = Max(U, Umax); - Vmin = Min(V, Vmin); - Vmax = Max(V, Vmax); - Wmin = Min(W, Wmin); - Wmax = Max(W, Wmax); + Umin = std::min(U, Umin); + Umax = std::max(U, Umax); + Vmin = std::min(V, Vmin); + Vmax = std::max(V, Vmax); + Wmin = std::min(W, Wmin); + Wmax = std::max(W, Wmax); Project(Xmax, Ymin, Zmin, U, V, W); - Umin = Min(U, Umin); - Umax = Max(U, Umax); - Vmin = Min(V, Vmin); - Vmax = Max(V, Vmax); - Wmin = Min(W, Wmin); - Wmax = Max(W, Wmax); + Umin = std::min(U, Umin); + Umax = std::max(U, Umax); + Vmin = std::min(V, Vmin); + Vmax = std::max(V, Vmax); + Wmin = std::min(W, Wmin); + Wmax = std::max(W, Wmax); Project(Xmax, Ymax, Zmin, U, V, W); - Umin = Min(U, Umin); - Umax = Max(U, Umax); - Vmin = Min(V, Vmin); - Vmax = Max(V, Vmax); - Wmin = Min(W, Wmin); - Wmax = Max(W, Wmax); + Umin = std::min(U, Umin); + Umax = std::max(U, Umax); + Vmin = std::min(V, Vmin); + Vmax = std::max(V, Vmax); + Wmin = std::min(W, Wmin); + Wmax = std::max(W, Wmax); Project(Xmin, Ymax, Zmax, U, V, W); - Umin = Min(U, Umin); - Umax = Max(U, Umax); - Vmin = Min(V, Vmin); - Vmax = Max(V, Vmax); - Wmin = Min(W, Wmin); - Wmax = Max(W, Wmax); + Umin = std::min(U, Umin); + Umax = std::max(U, Umax); + Vmin = std::min(V, Vmin); + Vmax = std::max(V, Vmax); + Wmin = std::min(W, Wmin); + Wmax = std::max(W, Wmax); Project(Xmin, Ymax, Zmin, U, V, W); - Umin = Min(U, Umin); - Umax = Max(U, Umax); - Vmin = Min(V, Vmin); - Vmax = Max(V, Vmax); - Wmin = Min(W, Wmin); - Wmax = Max(W, Wmax); + Umin = std::min(U, Umin); + Umax = std::max(U, Umax); + Vmin = std::min(V, Vmin); + Vmax = std::max(V, Vmax); + Wmin = std::min(W, Wmin); + Wmax = std::max(W, Wmax); } return Nstruct; } @@ -2122,7 +2122,7 @@ gp_Pnt V3d_View::GravityPoint() const { const gp_Pnt& aBndPnt = aPnts[aPntIt]; const gp_Pnt aProjected = Camera()->Project(aBndPnt); - if (Abs(aProjected.X()) <= 1.0 && Abs(aProjected.Y()) <= 1.0) + if (std::abs(aProjected.X()) <= 1.0 && std::abs(aProjected.Y()) <= 1.0) { aResult += aBndPnt.XYZ(); ++aNbPoints; @@ -2255,7 +2255,7 @@ Standard_Real V3d_View::Twist() const const gp_XYZ aP = Yaxis.XYZ().Crossed(aCameraUp.XYZ()); // compute Angle - Standard_Real anAngle = ASin(Max(Min(aP.Modulus(), 1.0), -1.0)); + Standard_Real anAngle = std::asin(std::max(std::min(aP.Modulus(), 1.0), -1.0)); if (Yaxis.Dot(aCameraUp.XYZ()) < 0.0) { anAngle = M_PI - anAngle; @@ -2317,7 +2317,7 @@ void V3d_View::SetFocale(const Standard_Real focale) return; } - Standard_Real aFOVyRad = ATan(focale / (aCamera->Distance() * 2.0)); + Standard_Real aFOVyRad = std::atan(focale / (aCamera->Distance() * 2.0)); aCamera->SetFOVy(aFOVyRad * (360 / M_PI)); @@ -2335,7 +2335,7 @@ Standard_Real V3d_View::Focale() const return 0.0; } - return aCamera->Distance() * 2.0 * Tan(aCamera->FOVy() * M_PI / 360.0); + return aCamera->Distance() * 2.0 * std::tan(aCamera->FOVy() * M_PI / 360.0); } //================================================================================================= @@ -2446,7 +2446,7 @@ void V3d_View::Zoom(const Standard_Integer theXp1, Standard_Integer aDy = theYp2 - theYp1; if (aDx != 0 || aDy != 0) { - Standard_Real aCoeff = Sqrt((Standard_Real)(aDx * aDx + aDy * aDy)) / 100.0 + 1.0; + Standard_Real aCoeff = std::sqrt((Standard_Real)(aDx * aDx + aDy * aDy)) / 100.0 + 1.0; aCoeff = (aDx > 0) ? aCoeff : 1.0 / aCoeff; SetZoom(aCoeff, Standard_True); } @@ -2472,7 +2472,7 @@ void V3d_View::ZoomAtPoint(const Standard_Integer theMouseStartX, // zoom Standard_Real aDxy = Standard_Real((theMouseEndX + theMouseEndY) - (theMouseStartX + theMouseStartY)); - Standard_Real aDZoom = Abs(aDxy) / 100.0 + 1.0; + Standard_Real aDZoom = std::abs(aDxy) / 100.0 + 1.0; aDZoom = (aDxy > 0.0) ? aDZoom : 1.0 / aDZoom; V3d_BadValue_Raise_if(aDZoom <= 0.0, "V3d_View::ZoomAtPoint, bad coefficient"); @@ -2526,7 +2526,7 @@ void V3d_View::AxialScale(const Standard_Integer Dx, { Standard_Real Sx, Sy, Sz; AxialScale(Sx, Sy, Sz); - Standard_Real dscale = Sqrt(Dx * Dx + Dy * Dy) / 100. + 1; + Standard_Real dscale = std::sqrt(Dx * Dx + Dy * Dy) / 100. + 1; dscale = (Dx > 0) ? dscale : 1. / dscale; if (Axis == V3d_X) Sx = dscale; @@ -2548,8 +2548,8 @@ void V3d_View::FitAll(const Standard_Real theXmin, Handle(Graphic3d_Camera) aCamera = Camera(); Standard_Real anAspect = aCamera->Aspect(); - Standard_Real aFitSizeU = Abs(theXmax - theXmin); - Standard_Real aFitSizeV = Abs(theYmax - theYmin); + Standard_Real aFitSizeU = std::abs(theXmax - theXmin); + Standard_Real aFitSizeV = std::abs(theYmax - theYmin); Standard_Real aFitAspect = aFitSizeU / aFitSizeV; if (aFitAspect >= anAspect) { @@ -2589,8 +2589,8 @@ void V3d_View::StartRotation(const Standard_Integer X, myZRotation = Standard_False; if (zRotationThreshold > 0.) { - Standard_Real dx = Abs(sx - rx / 2.); - Standard_Real dy = Abs(sy - ry / 2.); + Standard_Real dx = std::abs(sx - rx / 2.); + Standard_Real dy = std::abs(sy - ry / 2.); // if( dx > rx/3. || dy > ry/3. ) myZRotation = Standard_True; Standard_Real dd = zRotationThreshold * (rx + ry) / 2.; if (dx > dd || dy > dd) @@ -2745,8 +2745,8 @@ Standard_Boolean V3d_View::ToPixMap(Image_PixMap& theImage, const V3d_ImageDumpO { if (aFBOVPSize.x() > theParams.TileSize || aFBOVPSize.y() > theParams.TileSize) { - aFBOVPSize.x() = Min(aFBOVPSize.x(), theParams.TileSize); - aFBOVPSize.y() = Min(aFBOVPSize.y(), theParams.TileSize); + aFBOVPSize.x() = std::min(aFBOVPSize.x(), theParams.TileSize); + aFBOVPSize.y() = std::min(aFBOVPSize.y(), theParams.TileSize); isTiling = true; } } @@ -2791,8 +2791,8 @@ Standard_Boolean V3d_View::ToPixMap(Image_PixMap& theImage, const V3d_ImageDumpO Message::SendInfo(TCollection_AsciiString("Info, tiling image dump is used, image size (") + aFBOVPSize.x() + "x" + aFBOVPSize.y() + ") exceeds hardware limits (" + aMaxTexSizeX + "x" + aMaxTexSizeY + ")"); - aFBOVPSize.x() = Min(aFBOVPSize.x(), aMaxTexSizeX); - aFBOVPSize.y() = Min(aFBOVPSize.y(), aMaxTexSizeY); + aFBOVPSize.x() = std::min(aFBOVPSize.x(), aMaxTexSizeX); + aFBOVPSize.y() = std::min(aFBOVPSize.y(), aMaxTexSizeY); isTiling = true; } @@ -3014,11 +3014,11 @@ void V3d_View::Scale(const Handle(Graphic3d_Camera)& theCamera, Standard_Real anAspect = theCamera->Aspect(); if (anAspect > 1.0) { - theCamera->SetScale(Max(theSizeXv / anAspect, theSizeYv)); + theCamera->SetScale(std::max(theSizeXv / anAspect, theSizeYv)); } else { - theCamera->SetScale(Max(theSizeXv, theSizeYv * anAspect)); + theCamera->SetScale(std::max(theSizeXv, theSizeYv * anAspect)); } Invalidate(); } @@ -3397,8 +3397,8 @@ void V3d_View::SetGrid(const gp_Ax3& aPlane, const Handle(Aspect_Grid)& aGrid) aPlane.YDirection().Coord(ydx, ydy, ydz); aPlane.Direction().Coord(dx, dy, dz); - Standard_Real CosAlpha = Cos(MyGrid->RotationAngle()); - Standard_Real SinAlpha = Sin(MyGrid->RotationAngle()); + Standard_Real CosAlpha = std::cos(MyGrid->RotationAngle()); + Standard_Real SinAlpha = std::sin(MyGrid->RotationAngle()); TColStd_Array2OfReal Trsf1(1, 4, 1, 4); Trsf1(4, 4) = 1.0; @@ -3455,8 +3455,8 @@ void toPolarCoords(const Standard_Real theX, Standard_Real& theR, Standard_Real& thePhi) { - theR = Sqrt(theX * theX + theY * theY); - thePhi = ATan2(theY, theX); + theR = std::sqrt(theX * theX + theY * theY); + thePhi = std::atan2(theY, theX); } //================================================================================================= @@ -3466,8 +3466,8 @@ void toCartesianCoords(const Standard_Real theR, Standard_Real& theX, Standard_Real& theY) { - theX = theR * Cos(thePhi); - theY = theR * Sin(thePhi); + theX = theR * std::cos(thePhi); + theY = theR * std::sin(thePhi); } //================================================================================================= @@ -3484,7 +3484,7 @@ Graphic3d_Vertex V3d_View::Compute(const Graphic3d_Vertex& theVertex) const // Casw when the plane of the grid and the plane of the view // are perpendicular to MYEPSILON2 close radians #define MYEPSILON2 M_PI / 180.0 // Delta between 2 angles - if (Abs(VPN.Angle(GPN) - M_PI / 2.) < MYEPSILON2) + if (std::abs(VPN.Angle(GPN) - M_PI / 2.) < MYEPSILON2) { return theVertex; } @@ -3515,8 +3515,8 @@ Graphic3d_Vertex V3d_View::Compute(const Graphic3d_Vertex& theVertex) const { // project point on plane to grid local space const gp_Vec aToPoint(aPnt0, aPointOnPlane); - const Standard_Real anXSteps = Round(aGridX.Dot(aToPoint) / aRectGrid->XStep()); - const Standard_Real anYSteps = Round(aGridY.Dot(aToPoint) / aRectGrid->YStep()); + const Standard_Real anXSteps = std::round(aGridX.Dot(aToPoint) / aRectGrid->XStep()); + const Standard_Real anYSteps = std::round(aGridY.Dot(aToPoint) / aRectGrid->YStep()); // clamp point to grid const gp_Vec aResult = aGridX * anXSteps * aRectGrid->XStep() @@ -3535,8 +3535,8 @@ Graphic3d_Vertex V3d_View::Compute(const Graphic3d_Vertex& theVertex) const toPolarCoords(aLocalX, aLocalY, anR, aPhi); // clamp point to grid - const Standard_Real anRSteps = Round(anR / aCircleGrid->RadiusStep()); - const Standard_Real aPhiSteps = Round(aPhi / anAlpha); + const Standard_Real anRSteps = std::round(anR / aCircleGrid->RadiusStep()); + const Standard_Real aPhiSteps = std::round(aPhi / anAlpha); toCartesianCoords(anRSteps * aCircleGrid->RadiusStep(), aPhiSteps * anAlpha, aLocalX, aLocalY); const gp_Vec aResult = aGridX * aLocalX + aGridY * aLocalY + gp_Vec(aPnt0);