Janitor : Use std::clamp and remove obsolete includes of cvfMath

This commit is contained in:
Magne Sjaastad
2021-02-22 11:38:01 +01:00
parent 084835ce66
commit 1caac72715
34 changed files with 37 additions and 67 deletions

View File

@@ -144,14 +144,14 @@ void RimCellRangeFilter::computeAndSetValidValues()
const cvf::StructGridInterface* grid = selectedGrid();
if ( grid && grid->cellCountI() > 0 && grid->cellCountJ() > 0 && grid->cellCountK() > 0 )
{
cellCountI = cvf::Math::clamp( cellCountI.v(), 1, static_cast<int>( grid->cellCountI() ) );
startIndexI = cvf::Math::clamp( startIndexI.v(), 1, static_cast<int>( grid->cellCountI() ) );
cellCountI = std::clamp( cellCountI.v(), 1, static_cast<int>( grid->cellCountI() ) );
startIndexI = std::clamp( startIndexI.v(), 1, static_cast<int>( grid->cellCountI() ) );
cellCountJ = cvf::Math::clamp( cellCountJ.v(), 1, static_cast<int>( grid->cellCountJ() ) );
startIndexJ = cvf::Math::clamp( startIndexJ.v(), 1, static_cast<int>( grid->cellCountJ() ) );
cellCountJ = std::clamp( cellCountJ.v(), 1, static_cast<int>( grid->cellCountJ() ) );
startIndexJ = std::clamp( startIndexJ.v(), 1, static_cast<int>( grid->cellCountJ() ) );
cellCountK = cvf::Math::clamp( cellCountK.v(), 1, static_cast<int>( grid->cellCountK() ) );
startIndexK = cvf::Math::clamp( startIndexK.v(), 1, static_cast<int>( grid->cellCountK() ) );
cellCountK = std::clamp( cellCountK.v(), 1, static_cast<int>( grid->cellCountK() ) );
startIndexK = std::clamp( startIndexK.v(), 1, static_cast<int>( grid->cellCountK() ) );
}
this->updateIconState();
}

View File

@@ -42,7 +42,6 @@
#include "cafPdmUiDoubleSliderEditor.h"
#include "cvfAssert.h"
#include "cvfMath.h"
#include <cmath> // Needed for HUGE_VAL on Linux

View File

@@ -33,7 +33,6 @@
#include "cafPdmUiDoubleSliderEditor.h"
#include "cvfAssert.h"
#include "cvfMath.h"
CAF_PDM_SOURCE_INIT( RimGeoMechPropertyFilter, "GeoMechPropertyFilter" );