mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5101 clang-format: Adjusted penalties
Use lower absolute values to improve control of behavior
This commit is contained in:
@@ -86,10 +86,7 @@ bool RiaArgumentParser::parseArguments( cvf::ProgramOptions* progOpt )
|
||||
"Use --summaryplot -help to show a more detailed help text.\n",
|
||||
cvf::ProgramOptions::OPTIONAL_MULTI_VALUE );
|
||||
|
||||
progOpt->registerOption( "commandFile",
|
||||
"<commandfile>",
|
||||
"Execute the command file.",
|
||||
cvf::ProgramOptions::SINGLE_VALUE );
|
||||
progOpt->registerOption( "commandFile", "<commandfile>", "Execute the command file.", cvf::ProgramOptions::SINGLE_VALUE );
|
||||
progOpt->registerOption( "commandFileReplaceCases",
|
||||
"[<caseId>] <caseListFile>",
|
||||
"Supply list of cases to replace in project, performing command file for each case.",
|
||||
|
||||
@@ -53,10 +53,8 @@ std::vector<std::vector<cvf::Vec3d>> calcFacePoints( const std::vector<cvf::Vec3
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<cvf::Vec3d> RiaCellDividingTools::createHexCornerCoords( std::array<cvf::Vec3d, 8> mainCellCorners,
|
||||
size_t nx,
|
||||
size_t ny,
|
||||
size_t nz )
|
||||
std::vector<cvf::Vec3d>
|
||||
RiaCellDividingTools::createHexCornerCoords( std::array<cvf::Vec3d, 8> mainCellCorners, size_t nx, size_t ny, size_t nz )
|
||||
{
|
||||
std::array<std::pair<size_t, size_t>, 12> edgeCorners = {
|
||||
std::make_pair( 0, 1 ),
|
||||
|
||||
@@ -576,8 +576,7 @@ caf::ColorTable RiaColorTables::createBrightnessBasedColorTable( cvf::Color3ub b
|
||||
for ( int i = 0; i < brightnessLevelCount; ++i )
|
||||
{
|
||||
float brightness = static_cast<float>( i ) / static_cast<float>( brightnessLevelCount - 1 );
|
||||
colors.push_back(
|
||||
cvf::Color3ub( RiaColorTools::fromQColorTo3f( QColor::fromHslF( hueF, satF, brightness ) ) ) );
|
||||
colors.push_back( cvf::Color3ub( RiaColorTools::fromQColorTo3f( QColor::fromHslF( hueF, satF, brightness ) ) ) );
|
||||
}
|
||||
}
|
||||
return caf::ColorTable( colors );
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
/// Uses W3.org relative luminance calculation taking into account the different luminance of the different colors
|
||||
/// https://www.w3.org/TR/WCAG20-TECHS/G18.html
|
||||
/// Luminance is between [0, 1] so anything above 0.5 is considered in the bright half of the spectrum.
|
||||
/// However, subjectively the contrast looks better if the threshold is to 0.4 so black contrast is used a bit more often.
|
||||
/// However, subjectively the contrast looks better if the threshold is to 0.4 so black contrast is used a bit more
|
||||
/// often.
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaColorTools::isBrightnessAboveThreshold( cvf::Color3f backgroundColor )
|
||||
{
|
||||
|
||||
@@ -47,9 +47,8 @@ public:
|
||||
bool includePositiveValuesOnly );
|
||||
|
||||
template <typename T>
|
||||
static void getValuesByIntervals( const std::vector<T>& values,
|
||||
const CurveIntervals& intervals,
|
||||
std::vector<T>* filteredValues )
|
||||
static void
|
||||
getValuesByIntervals( const std::vector<T>& values, const CurveIntervals& intervals, std::vector<T>* filteredValues )
|
||||
{
|
||||
CVF_ASSERT( filteredValues );
|
||||
|
||||
|
||||
@@ -44,8 +44,7 @@ QDateTime RiaDateStringParser::parseDateString( const std::string& dateString )
|
||||
if ( hasSeparators( dateString ) )
|
||||
{
|
||||
parsedOk = tryParseYearFirst( dateString, year, month, day ) ||
|
||||
tryParseDayFirst( dateString, year, month, day ) ||
|
||||
tryParseMonthFirst( dateString, year, month, day );
|
||||
tryParseDayFirst( dateString, year, month, day ) || tryParseMonthFirst( dateString, year, month, day );
|
||||
}
|
||||
if ( !parsedOk )
|
||||
{
|
||||
|
||||
@@ -42,8 +42,7 @@ RigEclipseWellLogExtractor* RiaExtractionTools::wellLogExtractorEclipseCase( Rim
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigGeoMechWellLogExtractor* RiaExtractionTools::wellLogExtractorGeoMechCase( RimWellPath* wellPath,
|
||||
RimGeoMechCase* geomCase )
|
||||
RigGeoMechWellLogExtractor* RiaExtractionTools::wellLogExtractorGeoMechCase( RimWellPath* wellPath, RimGeoMechCase* geomCase )
|
||||
{
|
||||
auto wlPlotCollection = wellLogPlotCollection();
|
||||
if ( !wlPlotCollection ) return nullptr;
|
||||
|
||||
@@ -37,8 +37,7 @@ namespace RiaExtractionTools
|
||||
RigEclipseWellLogExtractor* wellLogExtractorEclipseCase( RimWellPath* wellPath, RimEclipseCase* eclipseCase );
|
||||
RigGeoMechWellLogExtractor* wellLogExtractorGeoMechCase( RimWellPath* wellPath, RimGeoMechCase* geomCase );
|
||||
|
||||
RigEclipseWellLogExtractor* findOrCreateSimWellExtractor( const RimSimWellInView* simWell,
|
||||
const RigWellPath* wellPathGeom );
|
||||
RigEclipseWellLogExtractor* findOrCreateSimWellExtractor( const RimSimWellInView* simWell, const RigWellPath* wellPathGeom );
|
||||
|
||||
RimWellLogPlotCollection* wellLogPlotCollection();
|
||||
|
||||
|
||||
@@ -55,9 +55,7 @@ void RiaImageFileCompare::reset()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaImageFileCompare::runComparison( const QString& imgFileName,
|
||||
const QString& refFileName,
|
||||
const QString& diffFileName )
|
||||
bool RiaImageFileCompare::runComparison( const QString& imgFileName, const QString& refFileName, const QString& diffFileName )
|
||||
{
|
||||
reset();
|
||||
|
||||
@@ -73,10 +71,8 @@ bool RiaImageFileCompare::runComparison( const QString& imgFileName,
|
||||
// The ImageMagick compare tool on RedHat 5 does not support the lowlight-color options
|
||||
// Use GCC version as a crude mechanism for disabling use of this option on RedHat5
|
||||
#if ( __GNUC__ == 4 && __GNUC_MINOR__ <= 1 )
|
||||
QString args = QString( "-fuzz 0.4% -metric ae \"%1\" \"%2\" \"%3\"" )
|
||||
.arg( imgFileName )
|
||||
.arg( refFileName )
|
||||
.arg( ( diffFileName ) );
|
||||
QString args =
|
||||
QString( "-fuzz 0.4% -metric ae \"%1\" \"%2\" \"%3\"" ).arg( imgFileName ).arg( refFileName ).arg( ( diffFileName ) );
|
||||
#else
|
||||
QString args = QString( "-fuzz 0.4% -lowlight-color white -metric ae \"%1\" \"%2\" \"%3\"" )
|
||||
.arg( imgFileName )
|
||||
|
||||
@@ -107,22 +107,21 @@ bool RiaImportEclipseCaseTools::openEclipseCasesFromFile( const QStringList& fil
|
||||
// Import summary cases
|
||||
if ( !summaryFileInfos.empty() )
|
||||
{
|
||||
RimSummaryCaseMainCollection* sumCaseColl = project->activeOilField()
|
||||
? project->activeOilField()->summaryCaseMainCollection()
|
||||
: nullptr;
|
||||
RimSummaryCaseMainCollection* sumCaseColl =
|
||||
project->activeOilField() ? project->activeOilField()->summaryCaseMainCollection() : nullptr;
|
||||
if ( sumCaseColl )
|
||||
{
|
||||
std::vector<RimSummaryCase*> newSumCases = sumCaseColl->createSummaryCasesFromFileInfos( summaryFileInfos );
|
||||
for ( RimSummaryCase* newSumCase : newSumCases )
|
||||
{
|
||||
RimSummaryCaseCollection* existingCollection = nullptr;
|
||||
QString gridCaseFile = RifEclipseSummaryTools::findGridCaseFileFromSummaryHeaderFile(
|
||||
newSumCase->summaryHeaderFilename() );
|
||||
QString gridCaseFile =
|
||||
RifEclipseSummaryTools::findGridCaseFileFromSummaryHeaderFile( newSumCase->summaryHeaderFilename() );
|
||||
RimEclipseCase* gridCase = project->eclipseCaseFromGridFileName( gridCaseFile );
|
||||
if ( gridCase )
|
||||
{
|
||||
RimSummaryCase* existingSummaryCase = sumCaseColl->findSummaryCaseFromFileName(
|
||||
newSumCase->summaryHeaderFilename() );
|
||||
RimSummaryCase* existingSummaryCase =
|
||||
sumCaseColl->findSummaryCaseFromFileName( newSumCase->summaryHeaderFilename() );
|
||||
RimGridSummaryCase* existingGridSummaryCase = dynamic_cast<RimGridSummaryCase*>( existingSummaryCase );
|
||||
RimFileSummaryCase* existingFileSummaryCase = dynamic_cast<RimFileSummaryCase*>( existingSummaryCase );
|
||||
if ( existingGridSummaryCase )
|
||||
@@ -451,8 +450,7 @@ bool RiaImportEclipseCaseTools::addEclipseCases( const QStringList& fil
|
||||
|
||||
project->activeOilField()->analysisModels()->updateConnectedEditors();
|
||||
|
||||
if ( RiaGuiApplication::isRunning() && gridCaseGroup &&
|
||||
gridCaseGroup->statisticsCaseCollection()->reservoirs.size() > 0 )
|
||||
if ( RiaGuiApplication::isRunning() && gridCaseGroup && gridCaseGroup->statisticsCaseCollection()->reservoirs.size() > 0 )
|
||||
{
|
||||
RiuMainWindow::instance()->selectAsCurrentItem( gridCaseGroup->statisticsCaseCollection()->reservoirs[0] );
|
||||
}
|
||||
|
||||
@@ -68,8 +68,7 @@ void RiaProjectModifier::setReplaceSourceCasesFirstOccurrence( const std::vector
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaProjectModifier::setReplaceSourceCasesById( int caseGroupIdToReplace,
|
||||
const std::vector<QString>& newGridFileNames )
|
||||
void RiaProjectModifier::setReplaceSourceCasesById( int caseGroupIdToReplace, const std::vector<QString>& newGridFileNames )
|
||||
{
|
||||
if ( caseGroupIdToReplace >= 0 )
|
||||
{
|
||||
|
||||
@@ -174,9 +174,8 @@ void RiaRegressionTestRunner::runRegressionTest()
|
||||
{
|
||||
QDir testCaseFolder( folderFileInfo.filePath() );
|
||||
|
||||
bool anyCommandFilesExecuted = findAndExecuteCommandFiles( testCaseFolder,
|
||||
regressionTestConfig,
|
||||
htmlReportFileName );
|
||||
bool anyCommandFilesExecuted =
|
||||
findAndExecuteCommandFiles( testCaseFolder, regressionTestConfig, htmlReportFileName );
|
||||
|
||||
if ( !anyCommandFilesExecuted )
|
||||
{
|
||||
|
||||
@@ -98,11 +98,10 @@ void RiaSimWellBranchTools::appendSimWellBranchFieldsIfRequiredFromWellName( caf
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSimWellBranchTools::appendSimWellBranchFieldsIfRequiredFromSimWellName(
|
||||
caf::PdmUiOrdering* uiOrdering,
|
||||
const QString& simWellName,
|
||||
const caf::PdmField<bool>& branchDetectionField,
|
||||
const caf::PdmField<int>& branchIndexField )
|
||||
void RiaSimWellBranchTools::appendSimWellBranchFieldsIfRequiredFromSimWellName( caf::PdmUiOrdering* uiOrdering,
|
||||
const QString& simWellName,
|
||||
const caf::PdmField<bool>& branchDetectionField,
|
||||
const caf::PdmField<int>& branchIndexField )
|
||||
{
|
||||
if ( RiaSimWellBranchTools::simulationWellBranches( simWellName, true ).size() > 1 )
|
||||
{
|
||||
|
||||
@@ -59,8 +59,7 @@ RiaJCurveCalculator::RiaJCurveCalculator( cvf::Vec3d p1, double azi1, double inc
|
||||
m_curveStatus = FAILED_RADIUS_TOO_LARGE;
|
||||
|
||||
RiaArcCurveCalculator arc( p1, t1, p2 );
|
||||
if ( arc.curveStatus() == RiaArcCurveCalculator::OK ||
|
||||
arc.curveStatus() == RiaArcCurveCalculator::OK_STRAIGHT_LINE )
|
||||
if ( arc.curveStatus() == RiaArcCurveCalculator::OK || arc.curveStatus() == RiaArcCurveCalculator::OK_STRAIGHT_LINE )
|
||||
{
|
||||
m_c1 = arc.center();
|
||||
m_n1 = arc.normal();
|
||||
|
||||
@@ -63,15 +63,15 @@ RiaSCurveCalculator::RiaSCurveCalculator( cvf::Vec3d p1, cvf::Vec3d q1, cvf::Vec
|
||||
bool isOk = true;
|
||||
m_isCalculationOK = true;
|
||||
|
||||
Vec3d tq1q2 = ( q2 - q1 ).getNormalized(
|
||||
&isOk ); // !ok means the control points are in the same place. Could fallback to use only one circle segment + one line.
|
||||
Vec3d tq1q2 = ( q2 - q1 ).getNormalized( &isOk ); // !ok means the control points are in the same place. Could
|
||||
// fallback to use only one circle segment + one line.
|
||||
m_isCalculationOK = m_isCalculationOK && isOk;
|
||||
Vec3d t1 = ( q1 - p1 ).getNormalized(
|
||||
&isOk ); // !ok means no tangent specified. Could fallback to use only one circle segment + one line.
|
||||
Vec3d t1 = ( q1 - p1 ).getNormalized( &isOk ); // !ok means no tangent specified. Could fallback to use only one
|
||||
// circle segment + one line.
|
||||
m_isCalculationOK = m_isCalculationOK && isOk;
|
||||
Vec3d t2 = ( p2 - q2 ).getNormalized(
|
||||
&isOk ); // !ok means no tangent specified. Could fallback to use only one circle segment + one line or only one
|
||||
// straight line if both tangents are missing
|
||||
Vec3d t2 = ( p2 - q2 ).getNormalized( &isOk ); // !ok means no tangent specified. Could fallback to use only one
|
||||
// circle segment + one line or only one straight line if both
|
||||
// tangents are missing
|
||||
m_isCalculationOK = m_isCalculationOK && isOk;
|
||||
|
||||
if ( !m_isCalculationOK )
|
||||
@@ -130,8 +130,8 @@ RiaSCurveCalculator::RiaSCurveCalculator( cvf::Vec3d p1, cvf::Vec3d q1, cvf::Vec
|
||||
m_firstArcEndpoint = q1 + ( q1 - p1 ).length() * tq1q2;
|
||||
m_secondArcStartpoint = q2 - ( q2 - p2 ).length() * tq1q2;
|
||||
|
||||
if ( ( ( q1 - p1 ).length() + ( q2 - p2 ).length() ) >
|
||||
( q2 - q1 ).length() ) // first arc end and second arc start is overlapping
|
||||
if ( ( ( q1 - p1 ).length() + ( q2 - p2 ).length() ) > ( q2 - q1 ).length() ) // first arc end and second arc start
|
||||
// is overlapping
|
||||
{
|
||||
m_ctrlPpointCurveStatus = FAILED_ARC_OVERLAP;
|
||||
m_isCalculationOK = false;
|
||||
|
||||
Reference in New Issue
Block a user