diff --git a/ApplicationLibCode/CommandFileInterface/RicfExportProperty.cpp b/ApplicationLibCode/CommandFileInterface/RicfExportProperty.cpp index b681c386ac..7012de7c89 100644 --- a/ApplicationLibCode/CommandFileInterface/RicfExportProperty.cpp +++ b/ApplicationLibCode/CommandFileInterface/RicfExportProperty.cpp @@ -48,14 +48,12 @@ CAF_PDM_SOURCE_INIT( RicfExportProperty, "exportProperty" ); //-------------------------------------------------------------------------------------------------- RicfExportProperty::RicfExportProperty() { - // clang-format off - CAF_PDM_InitScriptableField(&m_caseId, "caseId", -1, "Case ID"); - CAF_PDM_InitScriptableField(&m_timeStepIndex, "timeStep", -1, "Time Step Index"); - CAF_PDM_InitScriptableField(&m_propertyName, "property", QString(), "Property Name"); - CAF_PDM_InitScriptableField(&m_eclipseKeyword, "eclipseKeyword", QString(), "Eclipse Keyword"); - CAF_PDM_InitScriptableField(&m_undefinedValue, "undefinedValue", 0.0, "Undefined Value"); - CAF_PDM_InitScriptableField(&m_exportFileName, "exportFile", QString(), "Export FileName"); - // clang-format on + CAF_PDM_InitScriptableField( &m_caseId, "caseId", -1, "Case ID" ); + CAF_PDM_InitScriptableField( &m_timeStepIndex, "timeStep", -1, "Time Step Index" ); + CAF_PDM_InitScriptableField( &m_propertyName, "property", QString(), "Property Name" ); + CAF_PDM_InitScriptableField( &m_eclipseKeyword, "eclipseKeyword", QString(), "Eclipse Keyword" ); + CAF_PDM_InitScriptableField( &m_undefinedValue, "undefinedValue", 0.0, "Undefined Value" ); + CAF_PDM_InitScriptableField( &m_exportFileName, "exportFile", QString(), "Export FileName" ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/CommandFileInterface/RicfSetExportFolder.cpp b/ApplicationLibCode/CommandFileInterface/RicfSetExportFolder.cpp index 42eddc3eac..c49288ef9b 100644 --- a/ApplicationLibCode/CommandFileInterface/RicfSetExportFolder.cpp +++ b/ApplicationLibCode/CommandFileInterface/RicfSetExportFolder.cpp @@ -31,11 +31,12 @@ CAF_PDM_SOURCE_INIT( RicfSetExportFolder, "setExportFolder" ); //-------------------------------------------------------------------------------------------------- RicfSetExportFolder::RicfSetExportFolder() { - // clang-format off - CAF_PDM_InitScriptableField(&m_type, "type", RicfCommandFileExecutor::ExportTypeEnum(RicfCommandFileExecutor::ExportType::COMPLETIONS), "Type"); - CAF_PDM_InitScriptableField(&m_path, "path", QString(), "Path"); - CAF_PDM_InitScriptableField(&m_createFolder, "createFolder", false, "Create Folder"); - // clang-format on + CAF_PDM_InitScriptableField( &m_type, + "type", + RicfCommandFileExecutor::ExportTypeEnum( RicfCommandFileExecutor::ExportType::COMPLETIONS ), + "Type" ); + CAF_PDM_InitScriptableField( &m_path, "path", QString(), "Path" ); + CAF_PDM_InitScriptableField( &m_createFolder, "createFolder", false, "Create Folder" ); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionDataSettingsUi.cpp b/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionDataSettingsUi.cpp index 03809b2ac9..a1b18d65e1 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionDataSettingsUi.cpp +++ b/ApplicationLibCode/Commands/CompletionExportCommands/RicExportCompletionDataSettingsUi.cpp @@ -26,44 +26,46 @@ #include "RimWellPath.h" #include "RimWellPathCompletions.h" -// clang-format off namespace caf { - template<> - void RicExportCompletionDataSettingsUi::ExportSplitType::setUp() - { - addItem(RicExportCompletionDataSettingsUi::ExportSplit::UNIFIED_FILE, "UNIFIED_FILE", "Unified File"); - addItem(RicExportCompletionDataSettingsUi::ExportSplit::SPLIT_ON_WELL, "SPLIT_ON_WELL", "Split on Well"); - addItem(RicExportCompletionDataSettingsUi::ExportSplit::SPLIT_ON_WELL_AND_COMPLETION_TYPE, "SPLIT_ON_WELL_AND_COMPLETION_TYPE", "Split on Well and Completion Type"); - setDefault(RicExportCompletionDataSettingsUi::ExportSplit::SPLIT_ON_WELL_AND_COMPLETION_TYPE); - } - - template<> - void RicExportCompletionDataSettingsUi::CompdatExportType::setUp() - { - addItem(RicExportCompletionDataSettingsUi::CompdatExport::TRANSMISSIBILITIES, "TRANSMISSIBILITIES", "Calculated Transmissibilities"); - addItem(RicExportCompletionDataSettingsUi::CompdatExport::WPIMULT_AND_DEFAULT_CONNECTION_FACTORS, "WPIMULT_AND_DEFAULT_CONNECTION_FACTORS", "Default Connection Factors and WPIMULT (Fractures Not Supported)"); - setDefault(RicExportCompletionDataSettingsUi::CompdatExport::TRANSMISSIBILITIES); - } - - template<> - void RicExportCompletionDataSettingsUi::CombinationModeType::setUp() - { - addItem(RicExportCompletionDataSettingsUi::CombinationMode::INDIVIDUALLY, "INDIVIDUALLY", "Individually"); - addItem(RicExportCompletionDataSettingsUi::CombinationMode::COMBINED, "COMBINED", "Combined"); - setDefault(RicExportCompletionDataSettingsUi::CombinationMode::INDIVIDUALLY); - } - - template<> - void RicExportCompletionDataSettingsUi::TransScalingWBHPSource::setUp() - { - addItem(RicExportFractureCompletionsImpl::WBHP_FROM_SUMMARY, "WBHP_SUMMARY", "WBHP From Summary Case"); - addItem(RicExportFractureCompletionsImpl::WBHP_FROM_USER_DEF, "WBHP_USER_DEFINED", "Fixed User Defined WBHP"); - - setDefault(RicExportFractureCompletionsImpl::WBHP_FROM_SUMMARY); - } +template <> +void RicExportCompletionDataSettingsUi::ExportSplitType::setUp() +{ + addItem( RicExportCompletionDataSettingsUi::ExportSplit::UNIFIED_FILE, "UNIFIED_FILE", "Unified File" ); + addItem( RicExportCompletionDataSettingsUi::ExportSplit::SPLIT_ON_WELL, "SPLIT_ON_WELL", "Split on Well" ); + addItem( RicExportCompletionDataSettingsUi::ExportSplit::SPLIT_ON_WELL_AND_COMPLETION_TYPE, + "SPLIT_ON_WELL_AND_COMPLETION_TYPE", + "Split on Well and Completion Type" ); + setDefault( RicExportCompletionDataSettingsUi::ExportSplit::SPLIT_ON_WELL_AND_COMPLETION_TYPE ); } -// clang-format on + +template <> +void RicExportCompletionDataSettingsUi::CompdatExportType::setUp() +{ + addItem( RicExportCompletionDataSettingsUi::CompdatExport::TRANSMISSIBILITIES, "TRANSMISSIBILITIES", "Calculated Transmissibilities" ); + addItem( RicExportCompletionDataSettingsUi::CompdatExport::WPIMULT_AND_DEFAULT_CONNECTION_FACTORS, + "WPIMULT_AND_DEFAULT_CONNECTION_FACTORS", + "Default Connection Factors and WPIMULT (Fractures Not Supported)" ); + setDefault( RicExportCompletionDataSettingsUi::CompdatExport::TRANSMISSIBILITIES ); +} + +template <> +void RicExportCompletionDataSettingsUi::CombinationModeType::setUp() +{ + addItem( RicExportCompletionDataSettingsUi::CombinationMode::INDIVIDUALLY, "INDIVIDUALLY", "Individually" ); + addItem( RicExportCompletionDataSettingsUi::CombinationMode::COMBINED, "COMBINED", "Combined" ); + setDefault( RicExportCompletionDataSettingsUi::CombinationMode::INDIVIDUALLY ); +} + +template <> +void RicExportCompletionDataSettingsUi::TransScalingWBHPSource::setUp() +{ + addItem( RicExportFractureCompletionsImpl::WBHP_FROM_SUMMARY, "WBHP_SUMMARY", "WBHP From Summary Case" ); + addItem( RicExportFractureCompletionsImpl::WBHP_FROM_USER_DEF, "WBHP_USER_DEFINED", "Fixed User Defined WBHP" ); + + setDefault( RicExportFractureCompletionsImpl::WBHP_FROM_SUMMARY ); +} +} // namespace caf CAF_PDM_SOURCE_INIT( RicExportCompletionDataSettingsUi, "RicExportCompletionDataSettingsUi" ); diff --git a/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryPlotFeatureImpl.cpp b/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryPlotFeatureImpl.cpp index d56d2f5b62..9fbe3f2f93 100644 --- a/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryPlotFeatureImpl.cpp +++ b/ApplicationLibCode/Commands/SummaryPlotCommands/RicSummaryPlotFeatureImpl.cpp @@ -778,32 +778,30 @@ void RicSummaryPlotFeatureImpl::insertFilteredAddressesInSet( const QStringList& //-------------------------------------------------------------------------------------------------- QString RicSummaryPlotFeatureImpl::summaryPlotCommandLineHelpText() { - // clang-format off QString txt = - "The --summaryplot option has the following syntax:\n" - "\n" - "[] \n" - "\n" - "It creates one summary plot for each of the the summary vectors matched by the " - " using all the in each plot.\n" - "The has the syntax [:[:[:i,j,k]]] and can be repeated.\n" - "Wildcards can also be used, eg. \"WOPT:*\" to select the total oil production from all the wells.\n" - "3D Grid properties from restart files can also be requested in the form :i,j,k.\n" - "The can be written with or without extension.\n" - "As long as only summary vectors are requested, only the corresponding SMSPEC file will be opened for each case.\n" - "If a grid property is requested, however (eg. SOIL:20,21,1) the corresponding EGRID and restart data will be loaded as well.\n" - "\n" - "The summary plot options are: \n" - " -help\t Show this help text and ignore the rest of the options.\n" - " -h\t Include history vectors. Will be read from the summary file if the vectors exist.\n" - " \t Only history vectors from the first summary case in the project will be included.\n" - " -nl\t Omit legend in plot.\n" - " -s\t Create only one plot including all the defined vectors and cases.\n" - " -n\t Scale all curves into the range 0.0-1.0. Useful when using -s.\n" - " -e\t Import all the cases as an ensemble, and create ensemble curves sets instead of single curves.\n" - " -c \t Same as -e, but colors the curves by the ensemble parameter . \n" - " -cl \t Same as -c, but uses logarithmic legend.\n"; - // clang-format on + "The --summaryplot option has the following syntax:\n" + "\n" + "[] \n" + "\n" + "It creates one summary plot for each of the the summary vectors matched by the " + " using all the in each plot.\n" + "The has the syntax [:[:[:i,j,k]]] and can be repeated.\n" + "Wildcards can also be used, eg. \"WOPT:*\" to select the total oil production from all the wells.\n" + "3D Grid properties from restart files can also be requested in the form :i,j,k.\n" + "The can be written with or without extension.\n" + "As long as only summary vectors are requested, only the corresponding SMSPEC file will be opened for each case.\n" + "If a grid property is requested, however (eg. SOIL:20,21,1) the corresponding EGRID and restart data will be loaded as well.\n" + "\n" + "The summary plot options are: \n" + " -help\t Show this help text and ignore the rest of the options.\n" + " -h\t Include history vectors. Will be read from the summary file if the vectors exist.\n" + " \t Only history vectors from the first summary case in the project will be included.\n" + " -nl\t Omit legend in plot.\n" + " -s\t Create only one plot including all the defined vectors and cases.\n" + " -n\t Scale all curves into the range 0.0-1.0. Useful when using -s.\n" + " -e\t Import all the cases as an ensemble, and create ensemble curves sets instead of single curves.\n" + " -c \t Same as -e, but colors the curves by the ensemble parameter . \n" + " -cl \t Same as -c, but uses logarithmic legend.\n"; return txt; } diff --git a/ApplicationLibCode/FileInterface/RifSurfaceImporter.cpp b/ApplicationLibCode/FileInterface/RifSurfaceImporter.cpp index c7a08a4d1c..5d850f2064 100644 --- a/ApplicationLibCode/FileInterface/RifSurfaceImporter.cpp +++ b/ApplicationLibCode/FileInterface/RifSurfaceImporter.cpp @@ -279,16 +279,11 @@ std::pair, std::vector> RifSurfaceImporter::re } } - // clang-format off - if ( surfaceDataPoints.empty() - || minI == std::numeric_limits::max() - || minJ == std::numeric_limits::max() - || maxI == std::numeric_limits::min() - || maxJ == std::numeric_limits::min() ) + if ( surfaceDataPoints.empty() || minI == std::numeric_limits::max() || minJ == std::numeric_limits::max() || + maxI == std::numeric_limits::min() || maxJ == std::numeric_limits::min() ) { return {}; } - // clang-format on // Create full size grid matrix diff --git a/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlot.cpp b/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlot.cpp index 2362ac131d..13c31e08d9 100644 --- a/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/AnalysisPlots/RimAnalysisPlot.cpp @@ -1172,9 +1172,7 @@ void RimAnalysisPlot::applyFilter( const RimPlotDataFilterItem* filter, RimSummaryCase* sumCaseInEvaluation = nullptr; - // clang-format off - std::function evaluateFilterForAllCases = - [&]( RifEclipseSummaryAddress addrToFilterValue ) // clang-format on + std::function evaluateFilterForAllCases = [&]( RifEclipseSummaryAddress addrToFilterValue ) { for ( auto sumCase : *filteredSumCases ) { @@ -1261,8 +1259,7 @@ void RimAnalysisPlot::applyFilter( const RimPlotDataFilterItem* filter, { std::pair minMax = filter->filterRangeMinMax(); - // clang-format off - storeResultCoreLambda = [&]( double value ) // clang-format on + storeResultCoreLambda = [&]( double value ) { if ( minMax.first <= value && value <= minMax.second ) { @@ -1272,8 +1269,7 @@ void RimAnalysisPlot::applyFilter( const RimPlotDataFilterItem* filter, } else if ( filter->filterOperation() == RimPlotDataFilterItem::TOP_N || filter->filterOperation() == RimPlotDataFilterItem::BOTTOM_N ) { - // clang-format off - storeResultCoreLambda = [&]( double value ) // clang-format on + storeResultCoreLambda = [&]( double value ) { bool useLargest = filter->filterOperation() == RimPlotDataFilterItem::TOP_N; @@ -1311,8 +1307,7 @@ void RimAnalysisPlot::applyFilter( const RimPlotDataFilterItem* filter, { std::pair minMax = filter->filterRangeMinMax(); - // clang-format off - storeResultCoreLambda = [&]( double value ) // clang-format on + storeResultCoreLambda = [&]( double value ) { if ( minMax.first <= value && value <= minMax.second ) { @@ -1323,8 +1318,7 @@ void RimAnalysisPlot::applyFilter( const RimPlotDataFilterItem* filter, else if ( filter->filterOperation() == RimPlotDataFilterItem::TOP_N || filter->filterOperation() == RimPlotDataFilterItem::BOTTOM_N ) { - // clang-format off - storeResultCoreLambda = [&]( double value ) // clang-format on + storeResultCoreLambda = [&]( double value ) { bool useLargest = filter->filterOperation() == RimPlotDataFilterItem::TOP_N; diff --git a/ApplicationLibCode/UnitTests/cvfGeometryTools-Test.cpp b/ApplicationLibCode/UnitTests/cvfGeometryTools-Test.cpp index 7a5b04304d..7146e3bff3 100644 --- a/ApplicationLibCode/UnitTests/cvfGeometryTools-Test.cpp +++ b/ApplicationLibCode/UnitTests/cvfGeometryTools-Test.cpp @@ -101,22 +101,20 @@ std::vector createVertices() std::vector vxs; vxs.resize( 14, cvf::Vec3d::ZERO ); - // clang-format off - vxs[ 0]= cvf::Vec3d( 0 , 0 , 0 ); - vxs[ 1]= cvf::Vec3d( 1 , 0 , 0 ); - vxs[ 2]= cvf::Vec3d( 1 , 1 , 0 ); - vxs[ 3]= cvf::Vec3d( 0 , 1 , 0 ); - vxs[ 4]= cvf::Vec3d(-0.4 ,-0.2 , 0.0 ); - vxs[ 5]= cvf::Vec3d( 0.4 , 0.6 , 0.0 ); - vxs[ 6]= cvf::Vec3d( 0.8 , 0.2 , 0.0 ); - vxs[ 7]= cvf::Vec3d( 0.0 ,-0.6 , 0.0 ); - vxs[ 8]= cvf::Vec3d( 1.0 , 1.2 , 0.0 ); - vxs[ 9]= cvf::Vec3d( 1.4 , 0.8 , 0.0 ); - vxs[10]= cvf::Vec3d( 0.4 ,-0.2 , 0.0 ); - vxs[11]= cvf::Vec3d( 1.2 , 0.6 , 0.0 ); - vxs[12]= cvf::Vec3d( 1.6 , 0.2 , 0.0 ); - vxs[13]= cvf::Vec3d( 0.8 ,-0.6 , 0.0 ); - // clang-format on + vxs[0] = cvf::Vec3d( 0, 0, 0 ); + vxs[1] = cvf::Vec3d( 1, 0, 0 ); + vxs[2] = cvf::Vec3d( 1, 1, 0 ); + vxs[3] = cvf::Vec3d( 0, 1, 0 ); + vxs[4] = cvf::Vec3d( -0.4, -0.2, 0.0 ); + vxs[5] = cvf::Vec3d( 0.4, 0.6, 0.0 ); + vxs[6] = cvf::Vec3d( 0.8, 0.2, 0.0 ); + vxs[7] = cvf::Vec3d( 0.0, -0.6, 0.0 ); + vxs[8] = cvf::Vec3d( 1.0, 1.2, 0.0 ); + vxs[9] = cvf::Vec3d( 1.4, 0.8, 0.0 ); + vxs[10] = cvf::Vec3d( 0.4, -0.2, 0.0 ); + vxs[11] = cvf::Vec3d( 1.2, 0.6, 0.0 ); + vxs[12] = cvf::Vec3d( 1.6, 0.2, 0.0 ); + vxs[13] = cvf::Vec3d( 0.8, -0.6, 0.0 ); return vxs; } diff --git a/ApplicationLibCode/UserInterface/AnalysisPlots/RiuGroupedBarChartBuilder.cpp b/ApplicationLibCode/UserInterface/AnalysisPlots/RiuGroupedBarChartBuilder.cpp index 4404c3b6cc..e52ce2746c 100644 --- a/ApplicationLibCode/UserInterface/AnalysisPlots/RiuGroupedBarChartBuilder.cpp +++ b/ApplicationLibCode/UserInterface/AnalysisPlots/RiuGroupedBarChartBuilder.cpp @@ -489,47 +489,49 @@ void RiuGroupedBarChartBuilder::addBarChartToPlot( QwtPlot* plot, Qt::Orientatio filteredSortedBarEntries = filteredBarEntries; } - // clang-format off auto addGroupTickText = [&]( double groupStartPos, QString tickText, QList& groupTickPosList ) { - if( tickText.isEmpty() ) return; + if ( tickText.isEmpty() ) return; double tickPos = midPoint( groupStartPos, currentBarPosition ); - QwtScaleDiv::TickType ttyp = (&groupTickPosList == &majTickPositions ) ? QwtScaleDiv::MajorTick - : ( &groupTickPosList == &midTickPositions ) ? QwtScaleDiv::MediumTick - : QwtScaleDiv::MinorTick; + QwtScaleDiv::TickType ttyp = ( &groupTickPosList == &majTickPositions ) ? QwtScaleDiv::MajorTick + : ( &groupTickPosList == &midTickPositions ) ? QwtScaleDiv::MediumTick + : QwtScaleDiv::MinorTick; - // Make sure we do not get ticks of different level exactly at the same spot, + // Make sure we do not get ticks of different level exactly at the same spot, // so that the drawing is able to distinguish - if( ttyp == QwtScaleDiv::MinorTick ) tickPos += 2e-4; - if( ttyp == QwtScaleDiv::MediumTick ) tickPos += 1e-4; + if ( ttyp == QwtScaleDiv::MinorTick ) tickPos += 2e-4; + if ( ttyp == QwtScaleDiv::MediumTick ) tickPos += 1e-4; - groupPositionedAxisTexts[tickPos] = RiuBarChartScaleDraw::RiuBarChartTick(ttyp, tickText, true); + groupPositionedAxisTexts[tickPos] = RiuBarChartScaleDraw::RiuBarChartTick( ttyp, tickText, true ); groupTickPosList.push_back( tickPos ); }; - auto addGroupDivider = [&]( double position, QList& groupDividerPosList) + auto addGroupDivider = [&]( double position, QList& groupDividerPosList ) { - QwtScaleDiv::TickType ttyp = - (&groupDividerPosList == &majDividerPositions) ? QwtScaleDiv::MajorTick - : (&groupDividerPosList == &midDividerPositions) ? QwtScaleDiv::MediumTick - : QwtScaleDiv::MinorTick; + QwtScaleDiv::TickType ttyp = ( &groupDividerPosList == &majDividerPositions ) ? QwtScaleDiv::MajorTick + : ( &groupDividerPosList == &midDividerPositions ) ? QwtScaleDiv::MediumTick + : QwtScaleDiv::MinorTick; - // Make sure we do not get ticks of different level exactly at the same spot, + // Make sure we do not get ticks of different level exactly at the same spot, // so that the drawing is able to distinguish double spacing = majGroupSpacing; - if( ttyp == QwtScaleDiv::MediumTick ){ spacing = midGroupSpacing; } - if( ttyp == QwtScaleDiv::MinorTick ) { spacing = minGroupSpacing; } + if ( ttyp == QwtScaleDiv::MediumTick ) + { + spacing = midGroupSpacing; + } + if ( ttyp == QwtScaleDiv::MinorTick ) + { + spacing = minGroupSpacing; + } - groupDividerPosList.push_back(currentBarPosition - 0.5 - 0.5*spacing); + groupDividerPosList.push_back( currentBarPosition - 0.5 - 0.5 * spacing ); }; - // clang-format on - // Loop over entries, calculate tick positions and bar positions as we go for ( const BarEntry& barDef : filteredSortedBarEntries ) diff --git a/ApplicationLibCode/UserInterface/RiuCellAndNncPickEventHandler.cpp b/ApplicationLibCode/UserInterface/RiuCellAndNncPickEventHandler.cpp index 2863191de4..702de76c96 100644 --- a/ApplicationLibCode/UserInterface/RiuCellAndNncPickEventHandler.cpp +++ b/ApplicationLibCode/UserInterface/RiuCellAndNncPickEventHandler.cpp @@ -137,7 +137,6 @@ bool RiuCellAndNncPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eve RimIntersectionResultDefinition* sepInterResDef = nullptr; - // clang-format off if ( const RivSourceInfo* rivSourceInfo = dynamic_cast( firstHitPart->sourceInfo() ) ) { gridIndex = rivSourceInfo->gridIndex(); @@ -146,56 +145,54 @@ bool RiuCellAndNncPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eve CVF_ASSERT( rivSourceInfo->m_cellFaceFromTriangleMapper.notNull() ); gridLocalCellIndex = rivSourceInfo->m_cellFaceFromTriangleMapper->cellIndex( firstPartTriangleIndex ); - face = rivSourceInfo->m_cellFaceFromTriangleMapper->cellFace( firstPartTriangleIndex ); + face = rivSourceInfo->m_cellFaceFromTriangleMapper->cellFace( firstPartTriangleIndex ); } } - else if ( const RivFemPickSourceInfo* femSourceInfo = - dynamic_cast( firstHitPart->sourceInfo() ) ) + else if ( const RivFemPickSourceInfo* femSourceInfo = dynamic_cast( firstHitPart->sourceInfo() ) ) { - gridIndex = femSourceInfo->femPartIndex(); + gridIndex = femSourceInfo->femPartIndex(); gridLocalCellIndex = femSourceInfo->triangleToElmMapper()->elementIndex( firstPartTriangleIndex ); - gmFace = femSourceInfo->triangleToElmMapper()->elementFace( firstPartTriangleIndex ); + gmFace = femSourceInfo->triangleToElmMapper()->elementFace( firstPartTriangleIndex ); } - else if ( const RivReservoirSurfaceIntersectionSourceInfo* surfeIntersectSourceInfo = - dynamic_cast( firstHitPart->sourceInfo() ) ) + else if ( const RivReservoirSurfaceIntersectionSourceInfo* surfeIntersectSourceInfo = + dynamic_cast( firstHitPart->sourceInfo() ) ) { - RiuViewerCommands::findCellAndGridIndex( mainOrComparisonView, - surfeIntersectSourceInfo->intersection()->activeSeparateResultDefinition(), - surfeIntersectSourceInfo->triangleToCellIndex()[firstPartTriangleIndex], - &gridLocalCellIndex, - &gridIndex ); + RiuViewerCommands::findCellAndGridIndex( mainOrComparisonView, + surfeIntersectSourceInfo->intersection()->activeSeparateResultDefinition(), + surfeIntersectSourceInfo->triangleToCellIndex()[firstPartTriangleIndex], + &gridLocalCellIndex, + &gridIndex ); - intersectionHit = true; + intersectionHit = true; intersectionTriangleHit = surfeIntersectSourceInfo->triangle( firstPartTriangleIndex ); - sepInterResDef = surfeIntersectSourceInfo->intersection()->activeSeparateResultDefinition(); + sepInterResDef = surfeIntersectSourceInfo->intersection()->activeSeparateResultDefinition(); } - else if ( const RivExtrudedCurveIntersectionSourceInfo* intersectionSourceInfo = - dynamic_cast( firstHitPart->sourceInfo() ) ) + else if ( const RivExtrudedCurveIntersectionSourceInfo* intersectionSourceInfo = + dynamic_cast( firstHitPart->sourceInfo() ) ) { - RiuViewerCommands::findCellAndGridIndex( mainOrComparisonView, - intersectionSourceInfo->intersection()->activeSeparateResultDefinition(), - intersectionSourceInfo->triangleToCellIndex()[firstPartTriangleIndex], - &gridLocalCellIndex, - &gridIndex ); + RiuViewerCommands::findCellAndGridIndex( mainOrComparisonView, + intersectionSourceInfo->intersection()->activeSeparateResultDefinition(), + intersectionSourceInfo->triangleToCellIndex()[firstPartTriangleIndex], + &gridLocalCellIndex, + &gridIndex ); intersectionHit = true; intersectionTriangleHit = intersectionSourceInfo->triangle( firstPartTriangleIndex ); - sepInterResDef = intersectionSourceInfo->intersection()->activeSeparateResultDefinition(); + sepInterResDef = intersectionSourceInfo->intersection()->activeSeparateResultDefinition(); } - else if ( const RivBoxIntersectionSourceInfo* intersectionBoxSourceInfo = - dynamic_cast( firstHitPart->sourceInfo() ) ) + else if ( const RivBoxIntersectionSourceInfo* intersectionBoxSourceInfo = + dynamic_cast( firstHitPart->sourceInfo() ) ) { - RiuViewerCommands::findCellAndGridIndex( mainOrComparisonView, - intersectionBoxSourceInfo->intersectionBox()->activeSeparateResultDefinition(), - intersectionBoxSourceInfo->triangleToCellIndex()[firstPartTriangleIndex], - &gridLocalCellIndex, - &gridIndex ); + RiuViewerCommands::findCellAndGridIndex( mainOrComparisonView, + intersectionBoxSourceInfo->intersectionBox()->activeSeparateResultDefinition(), + intersectionBoxSourceInfo->triangleToCellIndex()[firstPartTriangleIndex], + &gridLocalCellIndex, + &gridIndex ); intersectionHit = true; intersectionTriangleHit = intersectionBoxSourceInfo->triangle( firstPartTriangleIndex ); - sepInterResDef = intersectionBoxSourceInfo->intersectionBox()->activeSeparateResultDefinition(); + sepInterResDef = intersectionBoxSourceInfo->intersectionBox()->activeSeparateResultDefinition(); } - // clang-format on if ( sepInterResDef ) { @@ -309,65 +306,60 @@ bool RiuCellAndNncPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eve { // Select the other cell if we are about to select the same cell at an nnc. // To make consecutive clicks toggle between closest and furthest cell - // clang-format off if ( nncIndex != cvf::UNDEFINED_SIZE_T ) { auto selectedItem = dynamic_cast( Riu3dSelectionManager::instance()->selectedItem() ); - RimEclipseView* eclipseView = dynamic_cast(mainOrComparisonView); + RimEclipseView* eclipseView = dynamic_cast( mainOrComparisonView ); - if ( selectedItem && eclipseView && - selectedItem->m_gridIndex == gridIndex && - selectedItem->m_gridLocalCellIndex == gridLocalCellIndex && - selectedItem->m_nncIndex == nncIndex ) + if ( selectedItem && eclipseView && selectedItem->m_gridIndex == gridIndex && + selectedItem->m_gridLocalCellIndex == gridLocalCellIndex && selectedItem->m_nncIndex == nncIndex ) { - RigMainGrid* mainGrid = eclipseView->eclipseCase()->eclipseCaseData()->mainGrid(); - const RigConnection& nncConn = mainGrid->nncData()->allConnections()[nncIndex]; + RigMainGrid* mainGrid = eclipseView->eclipseCase()->eclipseCaseData()->mainGrid(); + const RigConnection& nncConn = mainGrid->nncData()->allConnections()[nncIndex]; - size_t c1LocalIdx = cvf::UNDEFINED_SIZE_T; - const RigGridBase* grid1 = mainGrid->gridAndGridLocalIdxFromGlobalCellIdx(nncConn.c1GlobIdx(), &c1LocalIdx); - size_t c1GridIdx = grid1->gridIndex(); - size_t c2LocalIdx = cvf::UNDEFINED_SIZE_T; - const RigGridBase* grid2 = mainGrid->gridAndGridLocalIdxFromGlobalCellIdx(nncConn.c2GlobIdx(), &c2LocalIdx); - size_t c2GridIdx = grid2->gridIndex(); + size_t c1LocalIdx = cvf::UNDEFINED_SIZE_T; + const RigGridBase* grid1 = mainGrid->gridAndGridLocalIdxFromGlobalCellIdx( nncConn.c1GlobIdx(), &c1LocalIdx ); + size_t c1GridIdx = grid1->gridIndex(); + size_t c2LocalIdx = cvf::UNDEFINED_SIZE_T; + const RigGridBase* grid2 = mainGrid->gridAndGridLocalIdxFromGlobalCellIdx( nncConn.c2GlobIdx(), &c2LocalIdx ); + size_t c2GridIdx = grid2->gridIndex(); - if (gridLocalCellIndex == c1LocalIdx && gridIndex == c1GridIdx) + if ( gridLocalCellIndex == c1LocalIdx && gridIndex == c1GridIdx ) { gridLocalCellIndex = c2LocalIdx; - gridIndex = c2GridIdx; - - if (face == cvf::StructGridInterface::NO_FACE) + gridIndex = c2GridIdx; + + if ( face == cvf::StructGridInterface::NO_FACE ) { face = nncConn.face(); } else { - face = cvf::StructGridInterface::oppositeFace(face); + face = cvf::StructGridInterface::oppositeFace( face ); } } - else if (gridLocalCellIndex == c2LocalIdx && gridIndex == c2GridIdx) + else if ( gridLocalCellIndex == c2LocalIdx && gridIndex == c2GridIdx ) { gridLocalCellIndex = c1LocalIdx; - gridIndex = c1GridIdx; - if (face == cvf::StructGridInterface::NO_FACE) + gridIndex = c1GridIdx; + if ( face == cvf::StructGridInterface::NO_FACE ) { - face = cvf::StructGridInterface::oppositeFace(nncConn.face()); + face = cvf::StructGridInterface::oppositeFace( nncConn.face() ); } else { - face = cvf::StructGridInterface::oppositeFace(face); + face = cvf::StructGridInterface::oppositeFace( face ); } } else { - // None really matched, error in nnc data. + // None really matched, error in nnc data. } } } - // clang-format on - selItem = new RiuEclipseSelectionItem( associatedGridView, eclResDef, timestepIndex, diff --git a/ApplicationLibCode/UserInterface/RiuResultTextBuilder.cpp b/ApplicationLibCode/UserInterface/RiuResultTextBuilder.cpp index c175f40d2d..c6dd29c8a9 100644 --- a/ApplicationLibCode/UserInterface/RiuResultTextBuilder.cpp +++ b/ApplicationLibCode/UserInterface/RiuResultTextBuilder.cpp @@ -582,16 +582,11 @@ QString RiuResultTextBuilder::nncResultText() eclipseCase->allanDiagramData()->formationIndexCombinationFromCategory( ( *nncValues )[m_nncIndex] ); std::vector fmNames = eclipseCase->formationNames(); - // clang-format off - if ( fmIndexPair.first >= 0 && - fmIndexPair.second >= 0 && - static_cast(fmNames.size()) > fmIndexPair.first && - static_cast(fmNames.size()) > fmIndexPair.second ) + if ( fmIndexPair.first >= 0 && fmIndexPair.second >= 0 && static_cast( fmNames.size() ) > fmIndexPair.first && + static_cast( fmNames.size() ) > fmIndexPair.second ) { - resultValueText = fmNames[fmIndexPair.first] + " - " + - fmNames[fmIndexPair.second]; + resultValueText = fmNames[fmIndexPair.first] + " - " + fmNames[fmIndexPair.second]; } - // clang-format on } else if ( m_eclipseView->currentFaultResultColors()->resultVariable() == RiaResultNames::formationBinaryAllanResultName() )