Refactor well log track settings into modular classes

* Refactor well log track settings into modular classes

Major refactoring of RimWellLogTrack to delegate property axis, formation, region annotation, and well path attribute settings to dedicated settings classes. Introduces RimWellLogPropertyAxisSettings, RimWellLogFormationSettings, RimWellLogRegionAnnotationSettings, and RimWellLogWellPathAttributeSettings, each encapsulating related fields, UI logic, and option handling. Old fields are retained for migration and backward compatibility. Updates enums and signatures for consistency.
This commit is contained in:
Magne Sjaastad authored and GitHub committed 2026-02-09 15:33:18 +01:00
1 parent 3449c8fea8
commit 93bd0b9c9d
51 files changed
+2449 -1106

No files matched your search

@@ -38,6 +38,7 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RiaOsduDefines.h
${CMAKE_CURRENT_LIST_DIR}/RiaCloudDefines.h
${CMAKE_CURRENT_LIST_DIR}/RiaWellFlowDefines.h
${CMAKE_CURRENT_LIST_DIR}/RiaWellLogTrackDefines.h
${CMAKE_CURRENT_LIST_DIR}/RiaQuickAccessScheduler.h
${CMAKE_CURRENT_LIST_DIR}/RiaGridDefines.h
${CMAKE_CURRENT_LIST_DIR}/RiaModelExportDefines.h
@@ -83,6 +84,7 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RiaOsduDefines.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaCloudDefines.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaWellFlowDefines.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaWellLogTrackDefines.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaQuickAccessScheduler.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaGridDefines.cpp
${CMAKE_CURRENT_LIST_DIR}/RiaModelExportDefines.cpp
@@ -82,14 +82,14 @@ void caf::AppEnum<RiaDefines::EclipseUnitSystem>::setUp()
}
template <>
void caf::AppEnum<RiaDefines::DepthTypeEnum>::setUp()
void caf::AppEnum<RiaDefines::DepthType>::setUp()
{
addItem( RiaDefines::DepthTypeEnum::MEASURED_DEPTH, "MEASURED_DEPTH", "Measured Depth" );
addItem( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, "TRUE_VERTICAL_DEPTH", "True Vertical Depth (MSL)" );
addItem( RiaDefines::DepthTypeEnum::PSEUDO_LENGTH, "PSEUDO_LENGTH", "Pseudo Length" );
addItem( RiaDefines::DepthTypeEnum::CONNECTION_NUMBER, "CONNECTION_NUMBER", "Connection Number" );
addItem( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB, "TRUE_VERTICAL_DEPTH_RKB", "True Vertical Depth (RKB)" );
setDefault( RiaDefines::DepthTypeEnum::MEASURED_DEPTH );
addItem( RiaDefines::DepthType::MEASURED_DEPTH, "MEASURED_DEPTH", "Measured Depth" );
addItem( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH, "TRUE_VERTICAL_DEPTH", "True Vertical Depth (MSL)" );
addItem( RiaDefines::DepthType::PSEUDO_LENGTH, "PSEUDO_LENGTH", "Pseudo Length" );
addItem( RiaDefines::DepthType::CONNECTION_NUMBER, "CONNECTION_NUMBER", "Connection Number" );
addItem( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH_RKB, "TRUE_VERTICAL_DEPTH_RKB", "True Vertical Depth (RKB)" );
setDefault( RiaDefines::DepthType::MEASURED_DEPTH );
}
template <>
+1 -1
View File
@@ -109,7 +109,7 @@ DepthUnitType fromEclipseUnit( EclipseUnitSystem eclipseUnit );
EclipseUnitSystem fromDepthUnit( DepthUnitType depthUnit );
// Depth types used for well log plots
enum class DepthTypeEnum
enum class DepthType
{
MEASURED_DEPTH,
TRUE_VERTICAL_DEPTH,
@@ -107,6 +107,26 @@ void caf::AppEnum<RiaDefines::ReadOutType>::setUp()
setDefault( RiaDefines::ReadOutType::SNAP_TO_POINT );
}
template <>
void AppEnum<RiaDefines::RegionAnnotationType>::setUp()
{
addItem( RiaDefines::RegionAnnotationType::NO_ANNOTATIONS, "NO_ANNOTATIONS", "No Annotations" );
addItem( RiaDefines::RegionAnnotationType::FORMATION_ANNOTATIONS, "FORMATIONS", "Formations" );
addItem( RiaDefines::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS, "RESULT_PROPERTY", "Result Property" );
setDefault( RiaDefines::RegionAnnotationType::NO_ANNOTATIONS );
}
template <>
void AppEnum<RiaDefines::RegionDisplay>::setUp()
{
addItem( RiaDefines::DARK_LINES, "DARK_LINES", "Dark Lines" );
addItem( RiaDefines::LIGHT_LINES, "LIGHT_LINES", "Light Lines" );
addItem( RiaDefines::COLORED_LINES, "COLORED_LINES", "Colored Lines" );
addItem( RiaDefines::COLOR_SHADING, "COLOR_SHADING", "Color Shading" );
addItem( RiaDefines::COLOR_SHADING_AND_LINES, "SHADING_AND_LINES", "Color Shading and Lines" );
setDefault( RiaDefines::COLOR_SHADING_AND_LINES );
}
}; // namespace caf
//--------------------------------------------------------------------------------------------------
@@ -0,0 +1,59 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2025- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RiaWellLogTrackDefines.h"
namespace caf
{
template <>
void AppEnum<RiaDefines::WellLogTrackTrajectoryType>::setUp()
{
addItem( RiaDefines::WellLogTrackTrajectoryType::WELL_PATH, "WELL_PATH", "Well Path" );
addItem( RiaDefines::WellLogTrackTrajectoryType::SIMULATION_WELL, "SIMULATION_WELL", "Simulation Well" );
setDefault( RiaDefines::WellLogTrackTrajectoryType::WELL_PATH );
}
template <>
void AppEnum<RiaDefines::WellLogTrackFormationSource>::setUp()
{
addItem( RiaDefines::WellLogTrackFormationSource::CASE, "CASE", "Case" );
addItem( RiaDefines::WellLogTrackFormationSource::WELL_PICK_FILTER, "WELL_PICK_FILTER", "Well Picks for Well Path" );
setDefault( RiaDefines::WellLogTrackFormationSource::CASE );
}
template <>
void AppEnum<RiaDefines::WellLogTrackFormationLevel>::setUp()
{
addItem( RiaDefines::WellLogTrackFormationLevel::NONE, "NONE", "None" );
addItem( RiaDefines::WellLogTrackFormationLevel::ALL, "ALL", "All" );
addItem( RiaDefines::WellLogTrackFormationLevel::GROUP, "GROUP", "Formation Group" );
addItem( RiaDefines::WellLogTrackFormationLevel::LEVEL0, "LEVEL0", "Formation" );
addItem( RiaDefines::WellLogTrackFormationLevel::LEVEL1, "LEVEL1", "Formation 1" );
addItem( RiaDefines::WellLogTrackFormationLevel::LEVEL2, "LEVEL2", "Formation 2" );
addItem( RiaDefines::WellLogTrackFormationLevel::LEVEL3, "LEVEL3", "Formation 3" );
addItem( RiaDefines::WellLogTrackFormationLevel::LEVEL4, "LEVEL4", "Formation 4" );
addItem( RiaDefines::WellLogTrackFormationLevel::LEVEL5, "LEVEL5", "Formation 5" );
addItem( RiaDefines::WellLogTrackFormationLevel::LEVEL6, "LEVEL6", "Formation 6" );
addItem( RiaDefines::WellLogTrackFormationLevel::LEVEL7, "LEVEL7", "Formation 7" );
addItem( RiaDefines::WellLogTrackFormationLevel::LEVEL8, "LEVEL8", "Formation 8" );
addItem( RiaDefines::WellLogTrackFormationLevel::LEVEL9, "LEVEL9", "Formation 9" );
addItem( RiaDefines::WellLogTrackFormationLevel::LEVEL10, "LEVEL10", "Formation 10" );
setDefault( RiaDefines::WellLogTrackFormationLevel::ALL );
}
} // namespace caf
@@ -0,0 +1,57 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2025- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafAppEnum.h"
namespace RiaDefines
{
enum class WellLogTrackTrajectoryType
{
WELL_PATH,
SIMULATION_WELL
};
enum class WellLogTrackFormationSource
{
CASE,
WELL_PICK_FILTER
};
enum class WellLogTrackFormationLevel
{
GROUP,
LEVEL0,
LEVEL1,
LEVEL2,
LEVEL3,
LEVEL4,
LEVEL5,
LEVEL6,
LEVEL7,
LEVEL8,
LEVEL9,
LEVEL10,
ALL,
UNKNOWN,
NONE
};
} // namespace RiaDefines
+2
View File
@@ -128,6 +128,7 @@ list(
ProjectDataModel/ProcessControl/CMakeLists_files.cmake
ProjectDataModel/Polygons/CMakeLists_files.cmake
ProjectDataModel/WellLog/CMakeLists_files.cmake
ProjectDataModel/WellLog/WellLogTrack/CMakeLists_files.cmake
ProjectDataModel/WellMeasurement/CMakeLists_files.cmake
ProjectDataModel/WellPath/CMakeLists_files.cmake
ProjectDataModel/Tools/CMakeLists_files.cmake
@@ -397,6 +398,7 @@ target_include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/CellFilters
${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/ProcessControl
${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/WellLog
${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/WellLog/WellLogTrack
${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/WellMeasurement
${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModel/WellPath
${CMAKE_CURRENT_SOURCE_DIR}/ProjectDataModelCommands
@@ -159,7 +159,7 @@ RimStimPlanModelPlot* RicNewStimPlanModelPlotFeature::createPlot( RimStimPlanMod
plot->setPlotTitleVisible( true );
plot->setLegendsVisible( true );
plot->setLegendsHorizontal( false );
plot->setDepthType( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH );
plot->setDepthType( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH );
plot->setAutoScaleDepthValuesEnabled( true );
}
@@ -224,9 +224,9 @@ ExtractionCurveType* RicWellLogTools::addExtractionCurve( RimWellLogTrack*
{
caseToApply = commonDataSource->caseToApply();
}
else if ( plotTrack->formationNamesCase() )
else if ( plotTrack->formationCase() )
{
caseToApply = plotTrack->formationNamesCase();
caseToApply = plotTrack->formationCase();
}
else
{
@@ -386,7 +386,7 @@ RimWellLogRftCurve* RicWellLogTools::addRftCurve( RimWellLogTrack* plotTrack, co
curve->setColor( curveColor );
plotTrack->addCurve( curve );
plotTrack->setFormationTrajectoryType( RimWellLogTrack::SIMULATION_WELL );
plotTrack->setFormationTrajectoryType( RiaDefines::WellLogTrackTrajectoryType::SIMULATION_WELL );
plotTrack->updateConnectedEditors();
RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
@@ -122,7 +122,7 @@ RimWellBoreStabilityPlot* RicNewWellBoreStabilityPlotFeature::createPlot( RimGeo
plot->setPlotTitleVisible( true );
plot->setLegendsVisible( true );
plot->setLegendsHorizontal( true );
plot->setDepthType( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB );
plot->setDepthType( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH_RKB );
plot->setAutoScaleDepthValuesEnabled( true );
RicNewWellLogPlotFeatureImpl::updateAfterCreation( plot );
@@ -96,12 +96,12 @@ void RicNewWellLogExtractionCurveFeature::onActionTriggered( bool isChecked )
if ( wellPath )
{
newWellLogPlotTrack->setFormationWellPath( wellPath );
newWellLogPlotTrack->setFormationTrajectoryType( RimWellLogTrack::WELL_PATH );
newWellLogPlotTrack->setFormationTrajectoryType( RiaDefines::WellLogTrackTrajectoryType::WELL_PATH );
}
else
{
newWellLogPlotTrack->setFormationSimWellName( simWell->name() );
newWellLogPlotTrack->setFormationTrajectoryType( RimWellLogTrack::SIMULATION_WELL );
newWellLogPlotTrack->setFormationTrajectoryType( RiaDefines::WellLogTrackTrajectoryType::SIMULATION_WELL );
newWellLogPlotTrack->setFormationBranchIndex( branchIndex );
newWellLogPlotTrack->setFormationBranchDetection( useBranchDetection );
}
@@ -232,11 +232,11 @@ RimWellLogTrack*
if ( wellPathToApply )
{
plotTrack->setFormationTrajectoryType( RimWellLogTrack::WELL_PATH );
plotTrack->setFormationTrajectoryType( RiaDefines::WellLogTrackTrajectoryType::WELL_PATH );
}
else if ( !simWellToApply.isEmpty() )
{
plotTrack->setFormationTrajectoryType( RimWellLogTrack::SIMULATION_WELL );
plotTrack->setFormationTrajectoryType( RiaDefines::WellLogTrackTrajectoryType::SIMULATION_WELL );
}
if ( !branchDetectionToApply.isPartiallyTrue() )
@@ -108,7 +108,7 @@ RimWellAllocationPlot::RimWellAllocationPlot()
CAF_PDM_InitFieldNoDefault( &m_accumulatedWellFlowPlot, "AccumulatedWellFlowPlot", "Accumulated Well Flow" );
m_accumulatedWellFlowPlot = new RimWellLogPlot;
m_accumulatedWellFlowPlot->setDepthUnit( RiaDefines::DepthUnitType::UNIT_NONE );
m_accumulatedWellFlowPlot->setDepthType( RiaDefines::DepthTypeEnum::CONNECTION_NUMBER );
m_accumulatedWellFlowPlot->setDepthType( RiaDefines::DepthType::CONNECTION_NUMBER );
m_accumulatedWellFlowPlot->setLegendsVisible( false );
m_accumulatedWellFlowPlot->uiCapability()->setUiIconFromResourceString( ":/WellFlowPlot16x16.png" );
@@ -124,9 +124,8 @@ RimWellAllocationPlot::RimWellAllocationPlot()
setAsPlotMdiWindow();
m_accumulatedWellFlowPlot->setAvailableDepthUnits( {} );
m_accumulatedWellFlowPlot->setAvailableDepthTypes( { RiaDefines::DepthTypeEnum::CONNECTION_NUMBER,
RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH,
RiaDefines::DepthTypeEnum::PSEUDO_LENGTH } );
m_accumulatedWellFlowPlot->setAvailableDepthTypes(
{ RiaDefines::DepthType::CONNECTION_NUMBER, RiaDefines::DepthType::TRUE_VERTICAL_DEPTH, RiaDefines::DepthType::PSEUDO_LENGTH } );
m_accumulatedWellFlowPlot->setCommonDataSourceEnabled( false );
m_accumulatedWellFlowPlot->nameConfig()->setCustomName( "Accumulated Flow Chart" );
@@ -351,7 +350,7 @@ void RimWellAllocationPlot::updateFromWell()
auto depthType = accumulatedWellFlowPlot()->depthType();
if ( depthType == RiaDefines::DepthTypeEnum::MEASURED_DEPTH ) return;
if ( depthType == RiaDefines::DepthType::MEASURED_DEPTH ) return;
// Create tracks and curves from the calculated data
@@ -370,10 +369,10 @@ void RimWellAllocationPlot::updateFromWell()
accumulatedWellFlowPlot()->addPlot( plotTrack );
const std::vector<double>& depthValues =
depthType == RiaDefines::DepthTypeEnum::CONNECTION_NUMBER ? wfCalculator->connectionNumbersFromTop( brIdx )
: depthType == RiaDefines::DepthTypeEnum::PSEUDO_LENGTH ? wfCalculator->pseudoLengthFromTop( brIdx )
: depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH ? wfCalculator->trueVerticalDepth( brIdx )
: std::vector<double>();
depthType == RiaDefines::DepthType::CONNECTION_NUMBER ? wfCalculator->connectionNumbersFromTop( brIdx )
: depthType == RiaDefines::DepthType::PSEUDO_LENGTH ? wfCalculator->pseudoLengthFromTop( brIdx )
: depthType == RiaDefines::DepthType::TRUE_VERTICAL_DEPTH ? wfCalculator->trueVerticalDepth( brIdx )
: std::vector<double>();
if ( !depthValues.empty() )
{
@@ -382,7 +381,7 @@ void RimWellAllocationPlot::updateFromWell()
{
std::vector<double> curveDepthValues = depthValues;
std::vector<double> accFlow;
if ( depthType == RiaDefines::DepthTypeEnum::CONNECTION_NUMBER )
if ( depthType == RiaDefines::DepthType::CONNECTION_NUMBER )
{
accFlow = ( m_flowType == ACCUMULATED ? wfCalculator->accumulatedTracerFlowPrConnection( tracerName, brIdx )
: wfCalculator->tracerFlowPrConnection( tracerName, brIdx ) );
@@ -404,7 +403,7 @@ void RimWellAllocationPlot::updateFromWell()
}
}
}
else if ( depthType == RiaDefines::DepthTypeEnum::PSEUDO_LENGTH || depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH )
else if ( depthType == RiaDefines::DepthType::PSEUDO_LENGTH || depthType == RiaDefines::DepthType::TRUE_VERTICAL_DEPTH )
{
accFlow = ( m_flowType == ACCUMULATED ? wfCalculator->accumulatedTracerFlowPrPseudoLength( tracerName, brIdx )
: wfCalculator->tracerFlowPrPseudoLength( tracerName, brIdx ) );
@@ -502,7 +501,7 @@ void RimWellAllocationPlot::updateWellFlowPlotXAxisTitle( RimWellLogTrack* plotT
///
//--------------------------------------------------------------------------------------------------
void RimWellAllocationPlot::addStackedCurve( const QString& tracerName,
RiaDefines::DepthTypeEnum depthType,
RiaDefines::DepthType depthType,
const std::vector<double>& depthValues,
const std::vector<double>& accFlow,
RimWellLogTrack* plotTrack,
@@ -114,7 +114,7 @@ private:
void updateWellFlowPlotXAxisTitle( RimWellLogTrack* plotTrack );
void addStackedCurve( const QString& tracerName,
RiaDefines::DepthTypeEnum depthType,
RiaDefines::DepthType depthType,
const std::vector<double>& depthValues,
const std::vector<double>& accFlow,
RimWellLogTrack* plotTrack,
@@ -270,7 +270,7 @@ void RimWellFlowRateCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedF
bool RimWellFlowRateCurve::isUsingConnectionNumberDepthType() const
{
auto wellLogPlot = firstAncestorOrThisOfType<RimWellLogPlot>();
return wellLogPlot && wellLogPlot->depthType() == RiaDefines::DepthTypeEnum::CONNECTION_NUMBER;
return wellLogPlot && wellLogPlot->depthType() == RiaDefines::DepthType::CONNECTION_NUMBER;
}
//--------------------------------------------------------------------------------------------------
@@ -285,7 +285,7 @@ RimWellAllocationPlot* RimWellFlowRateCurve::wellAllocationPlot() const
///
//--------------------------------------------------------------------------------------------------
void RimWellFlowRateCurve::setFlowValuesPrDepthValue( const QString& curveName,
RiaDefines::DepthTypeEnum depthType,
RiaDefines::DepthType depthType,
const std::vector<double>& depthValues,
const std::vector<double>& flowRates )
{
@@ -39,7 +39,7 @@ public:
~RimWellFlowRateCurve() override;
void setFlowValuesPrDepthValue( const QString& curveName,
RiaDefines::DepthTypeEnum depthType,
RiaDefines::DepthType depthType,
const std::vector<double>& depthValues,
const std::vector<double>& flowRates );
@@ -141,7 +141,7 @@ RimWellPltPlot::RimWellPltPlot()
m_isOnLoad = true;
m_plotLegendsHorizontal = false;
setAvailableDepthTypes( { RiaDefines::DepthTypeEnum::MEASURED_DEPTH } );
setAvailableDepthTypes( { RiaDefines::DepthType::MEASURED_DEPTH } );
setPlotTitleVisible( true );
}
@@ -225,7 +225,7 @@ void RimWellPltPlot::updateFormationsOnPlot() const
RimWellLogTrack* track = dynamic_cast<RimWellLogTrack*>( plotByIndex( 0 ) );
if ( track )
{
RimCase* formationNamesCase = track->formationNamesCase();
RimCase* formationNamesCase = track->formationCase();
if ( !formationNamesCase )
{
@@ -93,7 +93,7 @@ RimWellRftPlot::RimWellRftPlot()
CAF_PDM_InitFieldNoDefault( &m_wellLogPlot_OBSOLETE, "WellLog", "Well Log" );
m_wellLogPlot_OBSOLETE.xmlCapability()->setIOWritable( false );
m_depthType = RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH;
m_depthType = RiaDefines::DepthType::TRUE_VERTICAL_DEPTH;
CAF_PDM_InitFieldNoDefault( &m_wellPathNameOrSimWellName, "WellName", "Well Name" );
CAF_PDM_InitField( &m_branchIndex, "BranchIndex", 0, "Branch Index" );
@@ -126,7 +126,7 @@ RimWellRftPlot::RimWellRftPlot()
// TODO: may want to support TRUE_VERTICAL_DEPTH_RKB in the future
// It was developed for regular well log plots and requires some more work for RFT plots.
setAvailableDepthTypes( { RiaDefines::DepthTypeEnum::MEASURED_DEPTH, RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH } );
setAvailableDepthTypes( { RiaDefines::DepthType::MEASURED_DEPTH, RiaDefines::DepthType::TRUE_VERTICAL_DEPTH } );
m_nameConfig->setCustomName( "RFT Plot" );
setNamingMethod( RiaDefines::ObjectNamingMethod::CUSTOM );
@@ -199,7 +199,7 @@ void RimWellRftPlot::updateFormationsOnPlot() const
RimWellLogTrack* track = dynamic_cast<RimWellLogTrack*>( plotByIndex( 0 ) );
if ( track )
{
formationNamesCase = track->formationNamesCase();
formationNamesCase = track->formationCase();
if ( !formationNamesCase )
{
@@ -747,7 +747,7 @@ void RimWellRftPlot::updateCurvesInPlot( const std::set<RiaRftPltCurveDefinition
}
}
if ( depthType() == RiaDefines::DepthTypeEnum::MEASURED_DEPTH )
if ( depthType() == RiaDefines::DepthType::MEASURED_DEPTH )
{
assignWellPathToExtractionCurves();
}
@@ -1276,7 +1276,7 @@ void RimWellRftPlot::onLoadDataAndUpdate()
updateMdiWindowVisibility();
updateFormationsOnPlot();
if ( depthType() == RiaDefines::DepthTypeEnum::MEASURED_DEPTH )
if ( depthType() == RiaDefines::DepthType::MEASURED_DEPTH )
{
assignWellPathToExtractionCurves();
}
@@ -128,7 +128,7 @@ void RimFormationNames::updateConnectedViews()
for ( RimWellLogTrack* track : tracks )
{
// The track may be referring to the case for other reasons than formations.
if ( track->formationNamesCase() == caseObj )
if ( track->formationCase() == caseObj )
{
track->loadDataAndUpdate();
}
@@ -114,7 +114,7 @@ RimDepthTrackPlot::RimDepthTrackPlot()
CAF_PDM_InitField( &m_nameTemplateText, "TemplateText", templateText, "Template Text" );
CAF_PDM_InitFieldNoDefault( &m_namingMethod, "PlotNamingMethod", "Plot Name" );
caf::AppEnum<RimDepthTrackPlot::DepthTypeEnum> depthType = RiaDefines::DepthTypeEnum::MEASURED_DEPTH;
caf::AppEnum<RimDepthTrackPlot::DepthTypeEnum> depthType = RiaDefines::DepthType::MEASURED_DEPTH;
CAF_PDM_InitScriptableField( &m_depthType, "DepthType", depthType, "Type" );
caf::AppEnum<RiaDefines::DepthUnitType> depthUnit = RiaDefines::DepthUnitType::UNIT_METER;
@@ -158,9 +158,9 @@ RimDepthTrackPlot::RimDepthTrackPlot()
CAF_PDM_InitFieldNoDefault( &m_depthOrientation, "DepthOrientation", "Orientation" );
m_availableDepthUnits = { RiaDefines::DepthUnitType::UNIT_METER, RiaDefines::DepthUnitType::UNIT_FEET };
m_availableDepthTypes = { RiaDefines::DepthTypeEnum::MEASURED_DEPTH,
RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH,
RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB };
m_availableDepthTypes = { RiaDefines::DepthType::MEASURED_DEPTH,
RiaDefines::DepthType::TRUE_VERTICAL_DEPTH,
RiaDefines::DepthType::TRUE_VERTICAL_DEPTH_RKB };
m_minAvailableDepth = HUGE_VAL;
m_maxAvailableDepth = -HUGE_VAL;
@@ -1373,28 +1373,28 @@ QString RimDepthTrackPlot::depthAxisTitle() const
switch ( m_depthType.value() )
{
case RiaDefines::DepthTypeEnum::MEASURED_DEPTH:
case RiaDefines::DepthType::MEASURED_DEPTH:
depthTitle = "MD";
break;
case RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH:
case RiaDefines::DepthType::TRUE_VERTICAL_DEPTH:
depthTitle = "TVDMSL";
break;
case RiaDefines::DepthTypeEnum::PSEUDO_LENGTH:
case RiaDefines::DepthType::PSEUDO_LENGTH:
depthTitle = "PL";
break;
case RiaDefines::DepthTypeEnum::CONNECTION_NUMBER:
case RiaDefines::DepthType::CONNECTION_NUMBER:
depthTitle = "Connection";
break;
case RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB:
case RiaDefines::DepthType::TRUE_VERTICAL_DEPTH_RKB:
depthTitle = "TVDRKB";
break;
}
if ( m_depthType() == RiaDefines::DepthTypeEnum::CONNECTION_NUMBER ) return depthTitle;
if ( m_depthType() == RiaDefines::DepthType::CONNECTION_NUMBER ) return depthTitle;
if ( m_depthUnit == RiaDefines::DepthUnitType::UNIT_METER )
{
@@ -70,7 +70,7 @@ public:
};
using AxisGridEnum = caf::AppEnum<AxisGridVisibility>;
using DepthTypeEnum = RiaDefines::DepthTypeEnum;
using DepthTypeEnum = RiaDefines::DepthType;
enum class DepthOrientation_OBSOLETE
{
@@ -15,7 +15,6 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RimEnsembleWellLogStatisticsCurve.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlotCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlot.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogTrack.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogLasCurve.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogExtractionCurve.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogLasFile.h
@@ -41,7 +40,6 @@ set(SOURCE_GROUP_HEADER_FILES
set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlotCollection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogTrack.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogCurve.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogExtractionCurve.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogLasFile.cpp
@@ -82,7 +82,7 @@ void Rim3dWellLogRftCurve::curveValuesAndMds( std::vector<double>* values, std::
// These values are for a simulation well
*values = curveData->propertyValues();
*measuredDepthValues = curveData->depths( RiaDefines::DepthTypeEnum::MEASURED_DEPTH );
*measuredDepthValues = curveData->depths( RiaDefines::DepthType::MEASURED_DEPTH );
}
//--------------------------------------------------------------------------------------------------
@@ -137,15 +137,15 @@ void RimEnsembleWellLogStatisticsCurve::performDataExtraction( bool* isUsingPseu
addDatapointsForBottomOfSegment( tvDepthValues, dummyValues );
}
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> validDepths;
std::map<RiaDefines::DepthType, std::vector<double>> validDepths;
if ( values.size() == measuredDepthValues.size() )
{
validDepths.insert( std::make_pair( RiaDefines::DepthTypeEnum::MEASURED_DEPTH, measuredDepthValues ) );
validDepths.insert( std::make_pair( RiaDefines::DepthType::MEASURED_DEPTH, measuredDepthValues ) );
}
if ( values.size() == tvDepthValues.size() )
{
validDepths.insert( std::make_pair( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, tvDepthValues ) );
validDepths.insert( std::make_pair( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB, tvDepthValues ) );
validDepths.insert( std::make_pair( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH, tvDepthValues ) );
validDepths.insert( std::make_pair( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH_RKB, tvDepthValues ) );
}
bool useLogarithmicScale = false;
@@ -164,7 +164,7 @@ void RimWellLogCalculatedCurve::onLoadDataAndUpdate( bool updateParentPlot )
}
// Find the data for resampling
const auto depthType = RiaDefines::DepthTypeEnum::MEASURED_DEPTH;
const auto depthType = RiaDefines::DepthType::MEASURED_DEPTH;
const std::vector<double> depthValues = depthValuesFromSource( depthType );
const auto depthUnit = firstCurveData->depthUnit();
const auto propertyUnit = firstCurveData->propertyValueUnit();
@@ -207,7 +207,7 @@ void RimWellLogCalculatedCurve::onLoadDataAndUpdate( bool updateParentPlot )
const bool isExtractionCurve = false;
// Set curve data
auto depthsMap = std::map<RiaDefines::DepthTypeEnum, std::vector<double>>();
auto depthsMap = std::map<RiaDefines::DepthType, std::vector<double>>();
depthsMap[depthType] = calculatedDepthValues;
setPropertyValuesAndDepths( calculatedPropertyValues, depthsMap, 0.0, depthUnit, isExtractionCurve, useLogarithmicScale, propertyUnit );
@@ -281,7 +281,7 @@ double RimWellLogCalculatedCurve::calculateValue( double firstValue, double seco
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RimWellLogCalculatedCurve::depthValuesFromSource( RiaDefines::DepthTypeEnum depthType ) const
std::vector<double> RimWellLogCalculatedCurve::depthValuesFromSource( RiaDefines::DepthType depthType ) const
{
if ( !m_firstWellLogCurve || !m_firstWellLogCurve->curveData() || !m_secondWellLogCurve || !m_secondWellLogCurve->curveData() )
{
@@ -351,7 +351,7 @@ std::vector<double> RimWellLogCalculatedCurve::unionDepthValuesFromVectors( cons
/// indicates enter and exit of k-layer. However, when curves are resampled, this info is not
/// representative and duplicated depth values are not needed.
//--------------------------------------------------------------------------------------------------
std::vector<double> RimWellLogCalculatedCurve::unionDepthValuesFromCurves( RiaDefines::DepthTypeEnum depthType ) const
std::vector<double> RimWellLogCalculatedCurve::unionDepthValuesFromCurves( RiaDefines::DepthType depthType ) const
{
if ( !m_firstWellLogCurve || !m_firstWellLogCurve->curveData() || !m_secondWellLogCurve || !m_secondWellLogCurve->curveData() )
{
@@ -82,8 +82,8 @@ private:
void connectWellLogCurveChangedToSlots( RimWellLogCurve* wellLogCurve );
void disconnectWellLogCurveChangedFromSlots( RimWellLogCurve* wellLogCurve );
std::vector<double> depthValuesFromSource( RiaDefines::DepthTypeEnum depthType ) const;
std::vector<double> unionDepthValuesFromCurves( RiaDefines::DepthTypeEnum depthType ) const;
std::vector<double> depthValuesFromSource( RiaDefines::DepthType depthType ) const;
std::vector<double> unionDepthValuesFromCurves( RiaDefines::DepthType depthType ) const;
private:
caf::PdmPtrField<RimCase*> m_case;
@@ -122,7 +122,7 @@ bool RimWellLogCurve::depthValueRangeInData( double* minimumValue, double* maxim
//--------------------------------------------------------------------------------------------------
void RimWellLogCurve::setPropertyValuesAndDepths( const std::vector<double>& propertyValues,
const std::vector<double>& depths,
RiaDefines::DepthTypeEnum depthType,
RiaDefines::DepthType depthType,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
@@ -137,12 +137,12 @@ void RimWellLogCurve::setPropertyValuesAndDepths( const std::vector<double>& pro
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogCurve::setPropertyValuesAndDepths( const std::vector<double>& propertyValues,
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& depths,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
bool useLogarithmicScale,
void RimWellLogCurve::setPropertyValuesAndDepths( const std::vector<double>& propertyValues,
const std::map<RiaDefines::DepthType, std::vector<double>>& depths,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
bool useLogarithmicScale,
const QString& propertyUnit )
{
@@ -207,8 +207,8 @@ void RimWellLogCurve::setPropertyValuesWithMdAndTVD( const std::vector<double>&
bool useLogarithmicScale,
const QString& propertyUnit )
{
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> depths = { { RiaDefines::DepthTypeEnum::MEASURED_DEPTH, measuredDepths },
{ RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, tvdMSL } };
std::map<RiaDefines::DepthType, std::vector<double>> depths = { { RiaDefines::DepthType::MEASURED_DEPTH, measuredDepths },
{ RiaDefines::DepthType::TRUE_VERTICAL_DEPTH, tvdMSL } };
setPropertyValuesAndDepths( propertyValues, depths, rkbDiff, depthUnit, isExtractionCurve, useLogarithmicScale, propertyUnit );
}
@@ -301,7 +301,7 @@ double RimWellLogCurve::closestYValueForX( double xValue ) const
{
if ( m_curveData.isNull() ) return std::numeric_limits<double>::infinity();
auto depths = m_curveData->depths( RiaDefines::DepthTypeEnum::MEASURED_DEPTH );
auto depths = m_curveData->depths( RiaDefines::DepthType::MEASURED_DEPTH );
auto values = m_curveData->propertyValues();
if ( depths.empty() || values.empty() ) return std::numeric_limits<double>::infinity();
@@ -76,7 +76,7 @@ protected:
void setPropertyValuesAndDepths( const std::vector<double>& propertyValues,
const std::vector<double>& depths,
RiaDefines::DepthTypeEnum depthType,
RiaDefines::DepthType depthType,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
@@ -94,12 +94,12 @@ protected:
void setPropertyAndDepthValuesToPlotCurve( const std::vector<double>& propertyValues, const std::vector<double>& depthValues );
void setPropertyValuesAndDepths( const std::vector<double>& propertyValues,
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& depths,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
bool useLogarithmicScale,
void setPropertyValuesAndDepths( const std::vector<double>& propertyValues,
const std::map<RiaDefines::DepthType, std::vector<double>>& depths,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
bool useLogarithmicScale,
const QString& propertyUnit = RiaWellLogUnitTools<double>::noUnitString() );
void setPropertyAndDepthsAndErrors( const std::vector<double>& propertyValues,
@@ -409,19 +409,19 @@ void RimWellLogCurveCommonDataSource::analyseCurvesAndTracks( const std::vector<
}
if ( track->showFormations() )
{
m_uniqueTrajectoryTypes.insert( track->formationTrajectoryType() );
if ( track->formationTrajectoryType() == RimWellLogTrack::WELL_PATH )
m_uniqueTrajectoryTypes.insert( static_cast<int>( track->formationTrajectoryType() ) );
if ( track->formationTrajectoryType() == RiaDefines::WellLogTrackTrajectoryType::WELL_PATH )
{
m_uniqueWellPaths.insert( track->formationWellPath() );
}
else if ( track->formationTrajectoryType() == RimWellLogTrack::SIMULATION_WELL )
else if ( track->formationTrajectoryType() == RiaDefines::WellLogTrackTrajectoryType::SIMULATION_WELL )
{
m_uniqueWellNames.insert( track->formationSimWellName() );
}
m_uniqueBranchDetection.insert( track->formationBranchDetection() );
m_uniqueBranchIndices.insert( track->formationBranchIndex() );
m_uniqueCases.insert( track->formationNamesCase() );
m_uniqueCases.insert( track->formationCase() );
m_uniqueWellPaths.insert( track->formationWellPath() );
}
}
@@ -349,9 +349,9 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate( bool updateParentPlot )
RimDepthTrackPlot* wellLogPlot = firstAncestorOrThisOfType<RimDepthTrackPlot>();
if ( !wellLogPlot ) return;
RiaDefines::DepthTypeEnum depthType = wellLogPlot->depthType();
RiaDefines::DepthType depthType = wellLogPlot->depthType();
RiaDefines::DepthUnitType displayUnit = wellLogPlot->depthUnit();
if ( depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH || depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB )
if ( depthType == RiaDefines::DepthType::TRUE_VERTICAL_DEPTH || depthType == RiaDefines::DepthType::TRUE_VERTICAL_DEPTH_RKB )
{
isUsingPseudoLength = false;
}
@@ -476,7 +476,7 @@ void RimWellLogExtractionCurve::extractData( bool* isUsin
{
setPropertyValuesAndDepths( curveData.values,
curveData.measuredDepthValues,
RiaDefines::DepthTypeEnum::MEASURED_DEPTH,
RiaDefines::DepthType::MEASURED_DEPTH,
0.0,
curveData.depthUnit,
!performDataSmoothing,
@@ -136,18 +136,18 @@ void RimWellLogLasFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
}
}
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> validDepths;
std::map<RiaDefines::DepthType, std::vector<double>> validDepths;
if ( values.size() == measuredDepthValues.size() )
{
validDepths.insert( std::make_pair( RiaDefines::DepthTypeEnum::MEASURED_DEPTH, measuredDepthValues ) );
validDepths.insert( std::make_pair( RiaDefines::DepthType::MEASURED_DEPTH, measuredDepthValues ) );
}
if ( values.size() == tvdMslValues.size() )
{
validDepths.insert( std::make_pair( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, tvdMslValues ) );
validDepths.insert( std::make_pair( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH, tvdMslValues ) );
}
if ( values.size() == tvdRkbValues.size() )
{
validDepths.insert( std::make_pair( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB, tvdRkbValues ) );
validDepths.insert( std::make_pair( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH_RKB, tvdRkbValues ) );
}
bool useLogarithmicScale = false;
@@ -189,7 +189,7 @@ void RimWellLogLasFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
displayUnit = wellLogPlot->depthUnit();
}
RiaDefines::DepthTypeEnum depthType = RiaDefines::DepthTypeEnum::MEASURED_DEPTH;
RiaDefines::DepthType depthType = RiaDefines::DepthType::MEASURED_DEPTH;
if ( wellLogPlot && curveData()->availableDepthTypes().count( wellLogPlot->depthType() ) )
{
depthType = wellLogPlot->depthType();
@@ -756,12 +756,12 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
if ( m_plotCurve )
{
if ( wellLogPlot->depthType() == RiaDefines::DepthTypeEnum::MEASURED_DEPTH )
if ( wellLogPlot->depthType() == RiaDefines::DepthType::MEASURED_DEPTH )
{
m_plotCurve->setPerPointLabels( perPointLabels );
auto propertyValues = curveData()->propertyValuesByIntervals();
auto depthValues = curveData()->depthValuesByIntervals( RiaDefines::DepthTypeEnum::MEASURED_DEPTH, displayUnit );
auto depthValues = curveData()->depthValuesByIntervals( RiaDefines::DepthType::MEASURED_DEPTH, displayUnit );
if ( !errors.empty() )
{
@@ -788,8 +788,8 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
{
m_plotCurve->setPerPointLabels( perPointLabels );
auto propertyValues = curveData()->propertyValuesByIntervals();
auto depthValues = curveData()->depthValuesByIntervals( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, displayUnit );
auto propertyValues = curveData()->propertyValuesByIntervals();
auto depthValues = curveData()->depthValuesByIntervals( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH, displayUnit );
bool useLogarithmicScale = false;
if ( !errors.empty() )
@@ -0,0 +1,19 @@
set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RimWellLogTrack.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogPropertyAxisSettings.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogFormationSettings.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogRegionAnnotationSettings.h
${CMAKE_CURRENT_LIST_DIR}/RimWellLogWellPathAttributeSettings.h
)
set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RimWellLogTrack.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogPropertyAxisSettings.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogFormationSettings.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogRegionAnnotationSettings.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellLogWellPathAttributeSettings.cpp
)
list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES})
@@ -0,0 +1,367 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2026- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimWellLogFormationSettings.h"
#include "RiaSimWellBranchTools.h"
#include "RiaWellLogTrackDefines.h"
#include "RimCase.h"
#include "RimEclipseCase.h"
#include "RimTools.h"
#include "RimWellLogTrack.h"
#include "RimWellPath.h"
#include "RigEclipseCaseData.h"
#include "cafPdmUiGroup.h"
CAF_PDM_SOURCE_INIT( RimWellLogFormationSettings, "RimWellLogFormationSettings" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogFormationSettings::RimWellLogFormationSettings()
{
CAF_PDM_InitObject( "Formation Settings" );
CAF_PDM_InitFieldNoDefault( &m_formationSource, "FormationSource", "Source" );
CAF_PDM_InitFieldNoDefault( &m_formationTrajectoryType, "FormationTrajectoryType", "Trajectory" );
CAF_PDM_InitFieldNoDefault( &m_formationWellPathForSourceCase, "FormationWellPath", "Well Path" );
m_formationWellPathForSourceCase.uiCapability()->setUiTreeChildrenHidden( true );
CAF_PDM_InitFieldNoDefault( &m_formationWellPathForSourceWellPath, "FormationWellPathForSourceWellPath", "Well Path" );
m_formationWellPathForSourceWellPath.uiCapability()->setUiTreeChildrenHidden( true );
CAF_PDM_InitField( &m_formationSimWellName, "FormationSimulationWellName", QString( "None" ), "Simulation Well" );
CAF_PDM_InitField( &m_formationBranchIndex, "FormationBranchIndex", 0, " " );
CAF_PDM_InitField( &m_formationBranchDetection,
"FormationBranchDetection",
true,
"Branch Detection",
"",
"Compute branches based on how simulation well cells are organized",
"" );
CAF_PDM_InitFieldNoDefault( &m_formationCase, "FormationCase", "Formation Case" );
m_formationCase.uiCapability()->setUiTreeChildrenHidden( true );
CAF_PDM_InitFieldNoDefault( &m_formationLevel, "FormationLevel", "Well Pick Filter" );
CAF_PDM_InitField( &m_showFormationFluids, "ShowFormationFluids", false, "Show Fluids" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaDefines::WellLogTrackFormationSource RimWellLogFormationSettings::formationSource() const
{
return m_formationSource();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogFormationSettings::setFormationSource( RiaDefines::WellLogTrackFormationSource source )
{
m_formationSource = source;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimCase* RimWellLogFormationSettings::formationCase() const
{
return m_formationCase();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogFormationSettings::setFormationCase( RimCase* rimCase )
{
m_formationCase = rimCase;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaDefines::WellLogTrackTrajectoryType RimWellLogFormationSettings::trajectoryType() const
{
return m_formationTrajectoryType();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogFormationSettings::setTrajectoryType( RiaDefines::WellLogTrackTrajectoryType trajectoryType )
{
m_formationTrajectoryType = trajectoryType;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellPath* RimWellLogFormationSettings::wellPathForSourceCase() const
{
return m_formationWellPathForSourceCase();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogFormationSettings::setWellPathForSourceCase( RimWellPath* wellPath )
{
m_formationWellPathForSourceCase = wellPath;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellPath* RimWellLogFormationSettings::wellPathForSourceWellPath() const
{
return m_formationWellPathForSourceWellPath();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogFormationSettings::setWellPathForSourceWellPath( RimWellPath* wellPath )
{
m_formationWellPathForSourceWellPath = wellPath;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimWellLogFormationSettings::simWellName() const
{
return m_formationSimWellName();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogFormationSettings::setSimWellName( const QString& simWellName )
{
m_formationSimWellName = simWellName;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RimWellLogFormationSettings::branchIndex() const
{
return m_formationBranchIndex();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogFormationSettings::setBranchIndex( int branchIndex )
{
m_formationBranchIndex = branchIndex;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogFormationSettings::branchDetection() const
{
return m_formationBranchDetection();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogFormationSettings::setBranchDetection( bool branchDetection )
{
m_formationBranchDetection = branchDetection;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaDefines::WellLogTrackFormationLevel RimWellLogFormationSettings::formationLevel() const
{
return m_formationLevel();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogFormationSettings::setFormationLevel( RiaDefines::WellLogTrackFormationLevel level )
{
m_formationLevel = level;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogFormationSettings::showFormationFluids() const
{
return m_showFormationFluids();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogFormationSettings::setShowFormationFluids( bool show )
{
m_showFormationFluids = show;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogFormationSettings::uiOrdering( const QString& uiConfigName, caf::PdmUiOrdering& uiOrdering, bool formationsForCaseWithSimWellOnly )
{
if ( !formationsForCaseWithSimWellOnly )
{
uiOrdering.add( &m_formationSource );
}
if ( m_formationSource() == RiaDefines::WellLogTrackFormationSource::CASE )
{
uiOrdering.add( &m_formationCase );
if ( !formationsForCaseWithSimWellOnly )
{
uiOrdering.add( &m_formationTrajectoryType );
if ( m_formationTrajectoryType() == RiaDefines::WellLogTrackTrajectoryType::WELL_PATH )
{
uiOrdering.add( &m_formationWellPathForSourceCase );
}
}
if ( formationsForCaseWithSimWellOnly || m_formationTrajectoryType() == RiaDefines::WellLogTrackTrajectoryType::SIMULATION_WELL )
{
uiOrdering.add( &m_formationSimWellName );
RiaSimWellBranchTools::appendSimWellBranchFieldsIfRequiredFromSimWellName( &uiOrdering,
m_formationSimWellName,
m_formationBranchDetection,
m_formationBranchIndex );
}
}
else if ( m_formationSource() == RiaDefines::WellLogTrackFormationSource::WELL_PICK_FILTER )
{
uiOrdering.add( &m_formationWellPathForSourceWellPath );
if ( m_formationWellPathForSourceWellPath() )
{
uiOrdering.add( &m_formationLevel );
uiOrdering.add( &m_showFormationFluids );
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogFormationSettings::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
if ( changedField == &m_formationSource && m_formationSource() == RiaDefines::WellLogTrackFormationSource::WELL_PICK_FILTER )
{
std::vector<RimWellPath*> wellPaths;
RimTools::wellPathWithFormations( &wellPaths );
for ( RimWellPath* wellPath : wellPaths )
{
if ( wellPath == m_formationWellPathForSourceCase )
{
m_formationWellPathForSourceWellPath = m_formationWellPathForSourceCase();
break;
}
}
}
auto track = firstAncestorOrThisOfType<RimWellLogTrack>();
if ( track )
{
track->loadDataAndUpdate();
track->updateConnectedEditors();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> RimWellLogFormationSettings::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
{
QList<caf::PdmOptionItemInfo> options;
if ( fieldNeedingOptions == &m_formationWellPathForSourceCase )
{
RimTools::wellPathOptionItems( &options );
}
else if ( fieldNeedingOptions == &m_formationWellPathForSourceWellPath )
{
RimTools::wellPathWithFormationsOptionItems( &options );
}
else if ( fieldNeedingOptions == &m_formationCase )
{
RimTools::caseOptionItems( &options );
}
else if ( fieldNeedingOptions == &m_formationSimWellName )
{
std::set<QString> sortedWellNames;
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( m_formationCase.value() );
if ( eclipseCase && eclipseCase->eclipseCaseData() )
{
sortedWellNames = eclipseCase->eclipseCaseData()->findSortedWellNames();
}
caf::IconProvider simWellIcon( ":/Well.svg" );
for ( const QString& wname : sortedWellNames )
{
options.push_back( caf::PdmOptionItemInfo( wname, wname, false, simWellIcon ) );
}
}
else if ( fieldNeedingOptions == &m_formationBranchIndex )
{
auto simulationWellBranches = RiaSimWellBranchTools::simulationWellBranches( m_formationSimWellName(), m_formationBranchDetection );
options = RiaSimWellBranchTools::valueOptionsForBranchIndexField( simulationWellBranches );
}
else if ( fieldNeedingOptions == &m_formationLevel )
{
if ( m_formationWellPathForSourceWellPath )
{
const RigWellPathFormations* formations = m_formationWellPathForSourceWellPath->formationsGeometry();
if ( formations )
{
using FormationLevelEnum = caf::AppEnum<RiaDefines::WellLogTrackFormationLevel>;
options.push_back( caf::PdmOptionItemInfo( FormationLevelEnum::uiText( RiaDefines::WellLogTrackFormationLevel::NONE ),
RiaDefines::WellLogTrackFormationLevel::NONE ) );
options.push_back( caf::PdmOptionItemInfo( FormationLevelEnum::uiText( RiaDefines::WellLogTrackFormationLevel::ALL ),
RiaDefines::WellLogTrackFormationLevel::ALL ) );
for ( const auto& level : formations->formationsLevelsPresent() )
{
options.push_back( caf::PdmOptionItemInfo( FormationLevelEnum::uiText( level ), level ) );
}
}
}
}
return options;
}
@@ -0,0 +1,101 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2026- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RiaWellLogTrackDefines.h"
#include "Well/RigWellPathFormations.h"
#include "cafAppEnum.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include "cafPdmPtrField.h"
class RimCase;
class RimWellPath;
class RimWellLogTrack;
//==================================================================================================
///
/// Settings class for formation/trajectory configuration in well log tracks
///
//==================================================================================================
class RimWellLogFormationSettings : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimWellLogFormationSettings();
// Formation source
RiaDefines::WellLogTrackFormationSource formationSource() const;
void setFormationSource( RiaDefines::WellLogTrackFormationSource source );
// Formation case
RimCase* formationCase() const;
void setFormationCase( RimCase* rimCase );
// Trajectory type
RiaDefines::WellLogTrackTrajectoryType trajectoryType() const;
void setTrajectoryType( RiaDefines::WellLogTrackTrajectoryType trajectoryType );
// Well paths
RimWellPath* wellPathForSourceCase() const;
void setWellPathForSourceCase( RimWellPath* wellPath );
RimWellPath* wellPathForSourceWellPath() const;
void setWellPathForSourceWellPath( RimWellPath* wellPath );
// Simulation well
QString simWellName() const;
void setSimWellName( const QString& simWellName );
int branchIndex() const;
void setBranchIndex( int branchIndex );
bool branchDetection() const;
void setBranchDetection( bool branchDetection );
// Formation level
RiaDefines::WellLogTrackFormationLevel formationLevel() const;
void setFormationLevel( RiaDefines::WellLogTrackFormationLevel level );
// Show fluids
bool showFormationFluids() const;
void setShowFormationFluids( bool show );
// UI ordering helper
void uiOrdering( const QString& uiConfigName, caf::PdmUiOrdering& uiOrdering, bool formationsForCaseWithSimWellOnly );
protected:
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
private:
caf::PdmField<caf::AppEnum<RiaDefines::WellLogTrackFormationSource>> m_formationSource;
caf::PdmPtrField<RimCase*> m_formationCase;
caf::PdmField<caf::AppEnum<RiaDefines::WellLogTrackTrajectoryType>> m_formationTrajectoryType;
caf::PdmPtrField<RimWellPath*> m_formationWellPathForSourceCase;
caf::PdmPtrField<RimWellPath*> m_formationWellPathForSourceWellPath;
caf::PdmField<QString> m_formationSimWellName;
caf::PdmField<int> m_formationBranchIndex;
caf::PdmField<bool> m_formationBranchDetection;
caf::PdmField<caf::AppEnum<RiaDefines::WellLogTrackFormationLevel>> m_formationLevel;
caf::PdmField<bool> m_showFormationFluids;
};
@@ -0,0 +1,296 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2026- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimWellLogPropertyAxisSettings.h"
#include "RimWellLogTrack.h"
#include "cafPdmUiDoubleValueEditor.h"
#define RI_LOGPLOTTRACK_MINX_DEFAULT -10.0
#define RI_LOGPLOTTRACK_MAXX_DEFAULT 100.0
CAF_PDM_SOURCE_INIT( RimWellLogPropertyAxisSettings, "RimWellLogPropertyAxisSettings" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogPropertyAxisSettings::RimWellLogPropertyAxisSettings()
{
CAF_PDM_InitObject( "Property Axis Settings" );
CAF_PDM_InitField( &m_isEnabled, "IsEnabled", true, "Show Axis" );
CAF_PDM_InitField( &m_visibleRangeMin, "VisibleRangeMin", RI_LOGPLOTTRACK_MINX_DEFAULT, "Min" );
m_visibleRangeMin.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleValueEditor::uiEditorTypeName() );
CAF_PDM_InitField( &m_visibleRangeMax, "VisibleRangeMax", RI_LOGPLOTTRACK_MAXX_DEFAULT, "Max" );
m_visibleRangeMax.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleValueEditor::uiEditorTypeName() );
CAF_PDM_InitField( &m_isAutoScaleEnabled, "IsAutoScaleEnabled", true, "Auto Scale" );
m_isAutoScaleEnabled.uiCapability()->setUiHidden( true );
CAF_PDM_InitField( &m_isLogarithmicScaleEnabled, "IsLogarithmicScaleEnabled", false, "Logarithmic Scale" );
CAF_PDM_InitField( &m_isAxisInverted, "IsAxisInverted", false, "Invert Axis Range" );
CAF_PDM_InitFieldNoDefault( &m_gridVisibility, "GridVisibility", "Show Grid Lines" );
CAF_PDM_InitField( &m_minAndMaxTicksOnly, "MinAndMaxTicksOnly", false, "Show Ticks at Min and Max" );
CAF_PDM_InitField( &m_explicitTickIntervals, "ExplicitTickIntervals", false, "Manually Set Tick Intervals" );
CAF_PDM_InitField( &m_majorTickInterval, "MajorTickInterval", 0.0, "Major Tick Interval" );
m_majorTickInterval.uiCapability()->setUiHidden( true );
CAF_PDM_InitField( &m_minorTickInterval, "MinorTickInterval", 0.0, "Minor Tick Interval" );
m_minorTickInterval.uiCapability()->setUiHidden( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogPropertyAxisSettings::~RimWellLogPropertyAxisSettings()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogPropertyAxisSettings::isEnabled() const
{
return m_isEnabled();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPropertyAxisSettings::setEnabled( bool enable )
{
m_isEnabled = enable;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimWellLogPropertyAxisSettings::visibleRangeMin() const
{
return m_visibleRangeMin();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimWellLogPropertyAxisSettings::visibleRangeMax() const
{
return m_visibleRangeMax();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPropertyAxisSettings::setVisibleRange( double minValue, double maxValue )
{
m_visibleRangeMin = minValue;
m_visibleRangeMax = maxValue;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogPropertyAxisSettings::isAutoScaleEnabled() const
{
return m_isAutoScaleEnabled();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPropertyAxisSettings::setAutoScaleEnabled( bool enabled )
{
m_isAutoScaleEnabled = enabled;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogPropertyAxisSettings::isLogarithmicScaleEnabled() const
{
return m_isLogarithmicScaleEnabled();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPropertyAxisSettings::setLogarithmicScaleEnabled( bool enabled )
{
m_isLogarithmicScaleEnabled = enabled;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogPropertyAxisSettings::isAxisInverted() const
{
return m_isAxisInverted();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPropertyAxisSettings::setAxisInverted( bool inverted )
{
m_isAxisInverted = inverted;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimDepthTrackPlot::AxisGridVisibility RimWellLogPropertyAxisSettings::gridVisibility() const
{
return m_gridVisibility();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPropertyAxisSettings::setGridVisibility( RimDepthTrackPlot::AxisGridVisibility visibility )
{
m_gridVisibility = visibility;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogPropertyAxisSettings::isMinAndMaxTicksOnly() const
{
return m_minAndMaxTicksOnly();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPropertyAxisSettings::setMinAndMaxTicksOnly( bool enable )
{
m_minAndMaxTicksOnly = enable;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogPropertyAxisSettings::isExplicitTickIntervals() const
{
return m_explicitTickIntervals();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPropertyAxisSettings::setExplicitTickIntervals( bool enable )
{
m_explicitTickIntervals = enable;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimWellLogPropertyAxisSettings::majorTickInterval() const
{
return m_majorTickInterval();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimWellLogPropertyAxisSettings::minorTickInterval() const
{
return m_minorTickInterval();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPropertyAxisSettings::setTickIntervals( double majorInterval, double minorInterval )
{
m_majorTickInterval = majorInterval;
m_minorTickInterval = minorInterval;
m_explicitTickIntervals = true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPropertyAxisSettings::uiOrdering( const QString& uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
caf::PdmUiGroup* propertyAxisGroup = uiOrdering.addNewGroup( "Property Axis" );
propertyAxisGroup->add( &m_isEnabled );
propertyAxisGroup->add( &m_isLogarithmicScaleEnabled );
propertyAxisGroup->add( &m_isAxisInverted );
propertyAxisGroup->add( &m_visibleRangeMin );
propertyAxisGroup->add( &m_visibleRangeMax );
propertyAxisGroup->add( &m_gridVisibility );
propertyAxisGroup->add( &m_explicitTickIntervals );
if ( m_explicitTickIntervals() )
{
m_majorTickInterval.uiCapability()->setUiHidden( false );
m_minorTickInterval.uiCapability()->setUiHidden( false );
propertyAxisGroup->add( &m_majorTickInterval );
propertyAxisGroup->add( &m_minorTickInterval );
}
else
{
m_majorTickInterval.uiCapability()->setUiHidden( true );
m_minorTickInterval.uiCapability()->setUiHidden( true );
}
propertyAxisGroup->add( &m_minAndMaxTicksOnly );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPropertyAxisSettings::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
{
auto track = firstAncestorOrThisOfType<RimWellLogTrack>();
if ( track )
{
if ( changedField == &m_isEnabled )
{
track->updateAxes();
track->updateConnectedEditors();
}
else if ( changedField == &m_isLogarithmicScaleEnabled || changedField == &m_isAxisInverted )
{
track->loadDataAndUpdate();
track->updateConnectedEditors();
}
else if ( changedField == &m_visibleRangeMin || changedField == &m_visibleRangeMax )
{
m_isAutoScaleEnabled = false;
track->updatePlotWidgetFromAxisRanges();
track->updateConnectedEditors();
}
else if ( changedField == &m_gridVisibility || changedField == &m_explicitTickIntervals || changedField == &m_majorTickInterval ||
changedField == &m_minorTickInterval || changedField == &m_minAndMaxTicksOnly )
{
track->updatePropertyValueAxisAndGridTickIntervals();
track->updateConnectedEditors();
}
}
}
@@ -0,0 +1,92 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2026- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RimDepthTrackPlot.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
//==================================================================================================
///
/// Settings class for property axis configuration in well log tracks
///
//==================================================================================================
class RimWellLogPropertyAxisSettings : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimWellLogPropertyAxisSettings();
~RimWellLogPropertyAxisSettings() override;
// Axis visibility
bool isEnabled() const;
void setEnabled( bool enable );
// Value range
double visibleRangeMin() const;
double visibleRangeMax() const;
void setVisibleRange( double minValue, double maxValue );
// Auto scale
bool isAutoScaleEnabled() const;
void setAutoScaleEnabled( bool enabled );
// Logarithmic scale
bool isLogarithmicScaleEnabled() const;
void setLogarithmicScaleEnabled( bool enabled );
// Axis inversion
bool isAxisInverted() const;
void setAxisInverted( bool inverted );
// Grid visibility
RimDepthTrackPlot::AxisGridVisibility gridVisibility() const;
void setGridVisibility( RimDepthTrackPlot::AxisGridVisibility visibility );
// Tick settings
bool isMinAndMaxTicksOnly() const;
void setMinAndMaxTicksOnly( bool enable );
bool isExplicitTickIntervals() const;
void setExplicitTickIntervals( bool enable );
double majorTickInterval() const;
double minorTickInterval() const;
void setTickIntervals( double majorInterval, double minorInterval );
void uiOrdering( const QString& uiConfigName, caf::PdmUiOrdering& uiOrdering );
protected:
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
private:
caf::PdmField<bool> m_isEnabled;
caf::PdmField<double> m_visibleRangeMin;
caf::PdmField<double> m_visibleRangeMax;
caf::PdmField<bool> m_isAutoScaleEnabled;
caf::PdmField<bool> m_isLogarithmicScaleEnabled;
caf::PdmField<bool> m_isAxisInverted;
caf::PdmField<RimDepthTrackPlot::AxisGridEnum> m_gridVisibility;
caf::PdmField<bool> m_minAndMaxTicksOnly;
caf::PdmField<bool> m_explicitTickIntervals;
caf::PdmField<double> m_majorTickInterval;
caf::PdmField<double> m_minorTickInterval;
};
@@ -0,0 +1,233 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2026- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimWellLogRegionAnnotationSettings.h"
#include "RimColorLegend.h"
#include "RimRegularLegendConfig.h"
#include "RimTools.h"
#include "RimWellLogTrack.h"
#include "cafPdmUiSliderEditor.h"
CAF_PDM_SOURCE_INIT( RimWellLogRegionAnnotationSettings, "RimWellLogRegionAnnotationSettings" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogRegionAnnotationSettings::RimWellLogRegionAnnotationSettings()
{
CAF_PDM_InitObject( "Region Annotation Settings" );
CAF_PDM_InitFieldNoDefault( &m_regionAnnotationType, "AnnotationType", "Region Annotations" );
CAF_PDM_InitFieldNoDefault( &m_regionAnnotationDisplay, "RegionDisplay", "Region Display" );
CAF_PDM_InitFieldNoDefault( &m_colorShadingLegend, "ColorShadingLegend", "Colors" );
m_colorShadingLegend = RimRegularLegendConfig::mapToColorLegend( RimRegularLegendConfig::ColorRangesType::NORMAL );
CAF_PDM_InitField( &m_colorShadingTransparency, "ColorShadingTransparency", 50, "Color Transparency" );
m_colorShadingTransparency.uiCapability()->setUiEditorTypeName( caf::PdmUiSliderEditor::uiEditorTypeName() );
CAF_PDM_InitField( &m_showRegionLabels, "ShowFormationLabels", true, "Show Labels" );
caf::FontTools::RelativeSizeEnum regionLabelFontSizeDefault = caf::FontTools::RelativeSize::Small;
CAF_PDM_InitField( &m_regionLabelFontSize, "RegionLabelFontSize", regionLabelFontSizeDefault, "Font Size" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogRegionAnnotationSettings::~RimWellLogRegionAnnotationSettings()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaDefines::RegionAnnotationType RimWellLogRegionAnnotationSettings::annotationType() const
{
return m_regionAnnotationType();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogRegionAnnotationSettings::setAnnotationType( RiaDefines::RegionAnnotationType type )
{
m_regionAnnotationType = type;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiaDefines::RegionDisplay RimWellLogRegionAnnotationSettings::annotationDisplay() const
{
return m_regionAnnotationDisplay();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogRegionAnnotationSettings::setAnnotationDisplay( RiaDefines::RegionDisplay display )
{
m_regionAnnotationDisplay = display;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimColorLegend* RimWellLogRegionAnnotationSettings::colorShadingLegend() const
{
return m_colorShadingLegend();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogRegionAnnotationSettings::setColorShadingLegend( RimColorLegend* legend )
{
m_colorShadingLegend = legend;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RimWellLogRegionAnnotationSettings::colorShadingTransparency() const
{
return m_colorShadingTransparency();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogRegionAnnotationSettings::setColorShadingTransparency( int transparency )
{
m_colorShadingTransparency = transparency;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogRegionAnnotationSettings::showRegionLabels() const
{
return m_showRegionLabels();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogRegionAnnotationSettings::setShowRegionLabels( bool show )
{
m_showRegionLabels = show;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::FontTools::RelativeSize RimWellLogRegionAnnotationSettings::regionLabelFontSize() const
{
return m_regionLabelFontSize();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogRegionAnnotationSettings::setRegionLabelFontSize( caf::FontTools::RelativeSize fontSize )
{
m_regionLabelFontSize = fontSize;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogRegionAnnotationSettings::showFormations() const
{
return m_regionAnnotationType() == RiaDefines::RegionAnnotationType::FORMATION_ANNOTATIONS;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogRegionAnnotationSettings::uiOrdering( const QString& uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
uiOrdering.add( &m_regionAnnotationType );
uiOrdering.add( &m_regionAnnotationDisplay );
uiOrdering.add( &m_showRegionLabels );
if ( m_regionAnnotationType() == RiaDefines::RegionAnnotationType::RESULT_PROPERTY_ANNOTATIONS )
{
uiOrdering.add( &m_regionLabelFontSize );
}
if ( m_regionAnnotationDisplay() & RiaDefines::COLOR_SHADING || m_regionAnnotationDisplay() & RiaDefines::COLORED_LINES )
{
uiOrdering.add( &m_colorShadingLegend );
if ( m_regionAnnotationDisplay() & RiaDefines::COLOR_SHADING )
{
uiOrdering.add( &m_colorShadingTransparency );
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogRegionAnnotationSettings::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
{
auto track = firstAncestorOrThisOfType<RimWellLogTrack>();
if ( track )
{
track->loadDataAndUpdate();
track->updateConnectedEditors();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogRegionAnnotationSettings::defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute )
{
if ( field == &m_colorShadingTransparency )
{
auto sliderAttrib = dynamic_cast<caf::PdmUiSliderEditorAttribute*>( attribute );
if ( sliderAttrib )
{
sliderAttrib->m_minimum = 0;
sliderAttrib->m_maximum = 100;
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> RimWellLogRegionAnnotationSettings::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
{
QList<caf::PdmOptionItemInfo> options;
if ( fieldNeedingOptions == &m_colorShadingLegend )
{
RimTools::colorLegendOptionItems( &options );
}
return options;
}
@@ -0,0 +1,85 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2026- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RiaPlotDefines.h"
#include "cafAppEnum.h"
#include "cafFontTools.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include "cafPdmPtrField.h"
class RimColorLegend;
//==================================================================================================
///
/// Settings class for region annotation configuration in well log tracks
///
//==================================================================================================
class RimWellLogRegionAnnotationSettings : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
using RegionAnnotationTypeEnum = caf::AppEnum<RiaDefines::RegionAnnotationType>;
using RegionAnnotationDisplayEnum = caf::AppEnum<RiaDefines::RegionDisplay>;
RimWellLogRegionAnnotationSettings();
~RimWellLogRegionAnnotationSettings() override;
// Annotation type
RiaDefines::RegionAnnotationType annotationType() const;
void setAnnotationType( RiaDefines::RegionAnnotationType type );
// Annotation display
RiaDefines::RegionDisplay annotationDisplay() const;
void setAnnotationDisplay( RiaDefines::RegionDisplay display );
// Color shading
RimColorLegend* colorShadingLegend() const;
void setColorShadingLegend( RimColorLegend* legend );
int colorShadingTransparency() const;
void setColorShadingTransparency( int transparency );
// Region labels
bool showRegionLabels() const;
void setShowRegionLabels( bool show );
caf::FontTools::RelativeSize regionLabelFontSize() const;
void setRegionLabelFontSize( caf::FontTools::RelativeSize fontSize );
// Helpers
bool showFormations() const;
void uiOrdering( const QString& uiConfigName, caf::PdmUiOrdering& uiOrdering );
protected:
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
private:
caf::PdmField<RegionAnnotationTypeEnum> m_regionAnnotationType;
caf::PdmField<RegionAnnotationDisplayEnum> m_regionAnnotationDisplay;
caf::PdmPtrField<RimColorLegend*> m_colorShadingLegend;
caf::PdmField<int> m_colorShadingTransparency;
caf::PdmField<bool> m_showRegionLabels;
caf::PdmField<caf::AppEnum<caf::FontTools::RelativeSize>> m_regionLabelFontSize;
};
@@ -19,6 +19,7 @@
#pragma once
#include "RiaWellLogTrackDefines.h"
#include "RimWellLogPlot.h"
#include "RiaPlotDefines.h"
@@ -30,6 +31,7 @@
#include "RiuPlotAxis.h"
#include "cafPdmChildArrayField.h"
#include "cafPdmChildField.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include "cafPdmPtrField.h"
@@ -58,6 +60,10 @@ class RigWellLogExtractor;
class RimEclipseResultDefinition;
class RimColorLegend;
class RimEnsembleWellLogCurveSet;
class RimWellLogPropertyAxisSettings;
class RimWellLogFormationSettings;
class RimWellLogRegionAnnotationSettings;
class RimWellLogWellPathAttributeSettings;
class RiuPlotAnnotationTool;
struct CurveSamplingPointData
@@ -78,17 +84,6 @@ class RimWellLogTrack : public RimPlot
CAF_PDM_HEADER_INIT;
public:
enum TrajectoryType
{
WELL_PATH,
SIMULATION_WELL
};
enum FormationSource
{
CASE,
WELL_PICK_FILTER
};
using RegionAnnotationTypeEnum = caf::AppEnum<RiaDefines::RegionAnnotationType>;
using RegionAnnotationDisplayEnum = caf::AppEnum<RiaDefines::RegionDisplay>;
@@ -116,19 +111,19 @@ public:
void setPropertyValueAxisTitle( const QString& text );
QString depthAxisTitle() const;
void setFormationWellPath( RimWellPath* wellPath );
RimWellPath* formationWellPath() const;
void setFormationSimWellName( const QString& simWellName );
QString formationSimWellName() const;
void setFormationBranchDetection( bool branchDetection );
bool formationBranchDetection() const;
void setFormationBranchIndex( int branchIndex );
int formationBranchIndex() const;
void setFormationCase( RimCase* rimCase );
RimCase* formationNamesCase() const;
void setFormationTrajectoryType( TrajectoryType trajectoryType );
TrajectoryType formationTrajectoryType() const;
void setRegionPropertyResultType( RiaDefines::ResultCatType resultCatType, const QString& resultVariable );
void setFormationWellPath( RimWellPath* wellPath );
RimWellPath* formationWellPath() const;
void setFormationSimWellName( const QString& simWellName );
QString formationSimWellName() const;
void setFormationBranchDetection( bool branchDetection );
bool formationBranchDetection() const;
void setFormationBranchIndex( int branchIndex );
int formationBranchIndex() const;
void setFormationCase( RimCase* rimCase );
RimCase* formationCase() const;
void setFormationTrajectoryType( RiaDefines::WellLogTrackTrajectoryType trajectoryType );
RiaDefines::WellLogTrackTrajectoryType formationTrajectoryType() const;
void setRegionPropertyResultType( RiaDefines::ResultCatType resultCatType, const QString& resultVariable );
void detachAllCurves() override;
void reattachAllCurves() override;
@@ -270,7 +265,6 @@ private:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void initAfterRead() override;
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
caf::PdmFieldHandle* userDescriptionField() override;
@@ -284,8 +278,6 @@ private:
int branchIndex,
bool useBranchDetection );
void setFormationFieldsUiReadOnly( bool readOnly = true );
void updateRegionAnnotationsOnPlot();
void updateFormationNamesOnPlot();
void updateResultPropertyNamesOnPlot();
@@ -305,7 +297,7 @@ private:
void handleWheelEvent( QWheelEvent* event ) override;
void doUpdateLayout() override;
std::vector<std::pair<double, double>> waterAndRockRegions( RiaDefines::DepthTypeEnum depthType,
std::vector<std::pair<double, double>> waterAndRockRegions( RiaDefines::DepthType depthType,
const RigGeoMechWellLogExtractor* extractor ) const;
void connectCurveSignals( RimWellLogCurve* curve );
@@ -315,18 +307,30 @@ private:
caf::PdmField<QString> m_description;
caf::PdmChildArrayField<RimWellLogCurve*> m_curves;
// Property value axis
caf::PdmField<bool> m_isPropertyAxisEnabled;
caf::PdmField<double> m_visiblePropertyValueRangeMin;
caf::PdmField<double> m_visiblePropertyValueRangeMax;
caf::PdmField<bool> m_isAutoScalePropertyValuesEnabled;
caf::PdmField<bool> m_isPropertyLogarithmicScaleEnabled;
caf::PdmField<bool> m_invertPropertyValueAxis;
caf::PdmField<RimWellLogPlot::AxisGridEnum> m_propertyValueAxisGridVisibility;
caf::PdmField<bool> m_propertyAxisMinAndMaxTicksOnly;
caf::PdmField<bool> m_explicitTickIntervalsPropertyValueAxis;
caf::PdmField<double> m_majorTickIntervalPropertyAxis;
caf::PdmField<double> m_minorTickIntervalPropertyAxis;
// Property value axis settings
caf::PdmChildField<RimWellLogPropertyAxisSettings*> m_propertyAxisSettings;
// Formation settings
caf::PdmChildField<RimWellLogFormationSettings*> m_formationSettings;
// Region annotation settings
caf::PdmChildField<RimWellLogRegionAnnotationSettings*> m_regionAnnotationSettings;
// Well path attribute settings
caf::PdmChildField<RimWellLogWellPathAttributeSettings*> m_wellPathAttributeSettings;
// OBSOLETE: Property value axis fields (migrated to RimWellLogPropertyAxisSettings)
caf::PdmField<bool> m_isPropertyAxisEnabled_OBSOLETE;
caf::PdmField<double> m_visiblePropertyValueRangeMin_OBSOLETE;
caf::PdmField<double> m_visiblePropertyValueRangeMax_OBSOLETE;
caf::PdmField<bool> m_isAutoScalePropertyValuesEnabled_OBSOLETE;
caf::PdmField<bool> m_isPropertyLogarithmicScaleEnabled_OBSOLETE;
caf::PdmField<bool> m_invertPropertyValueAxis_OBSOLETE;
caf::PdmField<RimWellLogPlot::AxisGridEnum> m_propertyValueAxisGridVisibility_OBSOLETE;
caf::PdmField<bool> m_propertyAxisMinAndMaxTicksOnly_OBSOLETE;
caf::PdmField<bool> m_explicitTickIntervalsPropertyValueAxis_OBSOLETE;
caf::PdmField<double> m_majorTickIntervalPropertyAxis_OBSOLETE;
caf::PdmField<double> m_minorTickIntervalPropertyAxis_OBSOLETE;
// Depth axis
caf::PdmField<double> m_visibleDepthRangeMin;
@@ -334,34 +338,40 @@ private:
RimFontSizeField m_axisFontSize;
caf::PdmField<RegionAnnotationTypeEnum> m_regionAnnotationType;
caf::PdmField<RegionAnnotationDisplayEnum> m_regionAnnotationDisplay;
caf::PdmPtrField<RimColorLegend*> m_colorShadingLegend;
caf::PdmField<int> m_colorShadingTransparency;
caf::PdmField<bool> m_showRegionLabels;
RimFontSizeField m_regionLabelFontSize;
caf::PdmField<caf::AppEnum<FormationSource>> m_formationSource;
caf::PdmPtrField<RimCase*> m_formationCase;
caf::PdmField<caf::AppEnum<TrajectoryType>> m_formationTrajectoryType;
caf::PdmPtrField<RimWellPath*> m_formationWellPathForSourceCase;
caf::PdmPtrField<RimWellPath*> m_formationWellPathForSourceWellPath;
caf::PdmField<QString> m_formationSimWellName;
caf::PdmField<int> m_formationBranchIndex;
caf::PdmField<caf::AppEnum<RigWellPathFormations::FormationLevel>> m_formationLevel;
caf::PdmField<bool> m_showformationFluids;
caf::PdmField<bool> m_formationBranchDetection;
caf::PdmField<bool> m_showWellPathAttributes;
caf::PdmField<bool> m_showWellPathCompletions;
caf::PdmField<bool> m_showWellPathComponentsBothSides;
caf::PdmField<bool> m_showWellPathComponentLabels;
caf::PdmField<bool> m_wellPathAttributesInLegend;
caf::PdmField<bool> m_wellPathCompletionsInLegend;
caf::PdmPtrField<RimWellPath*> m_wellPathComponentSource;
caf::PdmPtrField<RimWellPathAttributeCollection*> m_wellPathAttributeCollection;
caf::PdmChildField<RimEclipseResultDefinition*> m_resultDefinition;
caf::PdmField<double> m_overburdenHeight;
caf::PdmField<double> m_underburdenHeight;
caf::PdmChildField<RimEnsembleWellLogCurveSet*> m_ensembleWellLogCurveSet;
// OBSOLETE: Region annotation fields (migrated to RimWellLogRegionAnnotationSettings)
caf::PdmField<RegionAnnotationTypeEnum> m_regionAnnotationType_OBSOLETE;
caf::PdmField<RegionAnnotationDisplayEnum> m_regionAnnotationDisplay_OBSOLETE;
caf::PdmPtrField<RimColorLegend*> m_colorShadingLegend_OBSOLETE;
caf::PdmField<int> m_colorShadingTransparency_OBSOLETE;
caf::PdmField<bool> m_showRegionLabels_OBSOLETE;
RimFontSizeField m_regionLabelFontSize_OBSOLETE;
// OBSOLETE: Formation fields (migrated to RimWellLogFormationSettings)
caf::PdmField<caf::AppEnum<RiaDefines::WellLogTrackFormationSource>> m_formationSource_OBSOLETE;
caf::PdmPtrField<RimCase*> m_formationCase_OBSOLETE;
caf::PdmField<caf::AppEnum<RiaDefines::WellLogTrackTrajectoryType>> m_formationTrajectoryType_OBSOLETE;
caf::PdmPtrField<RimWellPath*> m_formationWellPathForSourceCase_OBSOLETE;
caf::PdmPtrField<RimWellPath*> m_formationWellPathForSourceWellPath_OBSOLETE;
caf::PdmField<QString> m_formationSimWellName_OBSOLETE;
caf::PdmField<int> m_formationBranchIndex_OBSOLETE;
caf::PdmField<caf::AppEnum<RiaDefines::WellLogTrackFormationLevel>> m_formationLevel_OBSOLETE;
caf::PdmField<bool> m_showformationFluids_OBSOLETE;
caf::PdmField<bool> m_formationBranchDetection_OBSOLETE;
// OBSOLETE: Well path attribute fields (migrated to RimWellLogWellPathAttributeSettings)
caf::PdmField<bool> m_showWellPathAttributes_OBSOLETE;
caf::PdmField<bool> m_showWellPathCompletions_OBSOLETE;
caf::PdmField<bool> m_showWellPathComponentsBothSides_OBSOLETE;
caf::PdmField<bool> m_showWellPathComponentLabels_OBSOLETE;
caf::PdmField<bool> m_wellPathAttributesInLegend_OBSOLETE;
caf::PdmField<bool> m_wellPathCompletionsInLegend_OBSOLETE;
caf::PdmPtrField<RimWellPath*> m_wellPathComponentSource_OBSOLETE;
caf::PdmPtrField<RimWellPathAttributeCollection*> m_wellPathAttributeCollection_OBSOLETE;
caf::PdmField<double> m_overburdenHeight_OBSOLETE;
caf::PdmField<double> m_underburdenHeight_OBSOLETE;
caf::PdmChildField<RimEclipseResultDefinition*> m_resultDefinition;
caf::PdmChildField<RimEnsembleWellLogCurveSet*> m_ensembleWellLogCurveSet;
caf::PdmField<bool> m_autoCheckStateBasedOnCurveData;
@@ -0,0 +1,262 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2026- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimWellLogWellPathAttributeSettings.h"
#include "RimTools.h"
#include "RimWellLogTrack.h"
#include "RimWellPath.h"
#include "RimWellPathAttributeCollection.h"
#include "cafPdmUiOrdering.h"
CAF_PDM_SOURCE_INIT( RimWellLogWellPathAttributeSettings, "RimWellLogWellPathAttributeSettings" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogWellPathAttributeSettings::RimWellLogWellPathAttributeSettings()
{
CAF_PDM_InitObject( "Well Path Attribute Settings" );
CAF_PDM_InitField( &m_showWellPathAttributes, "ShowWellPathAttributes", false, "Show Well Attributes" );
CAF_PDM_InitField( &m_wellPathAttributesInLegend, "WellPathAttributesInLegend", true, "Attributes in Legend" );
CAF_PDM_InitField( &m_showWellPathCompletions, "ShowWellPathCompletions", true, "Show Well Completions" );
CAF_PDM_InitField( &m_wellPathCompletionsInLegend, "WellPathCompletionsInLegend", true, "Completions in Legend" );
CAF_PDM_InitField( &m_showWellPathComponentsBothSides, "ShowWellPathAttrBothSides", true, "Show Both Sides" );
CAF_PDM_InitField( &m_showWellPathComponentLabels, "ShowWellPathAttrLabels", false, "Show Labels" );
CAF_PDM_InitFieldNoDefault( &m_wellPathComponentSource, "AttributesWellPathSource", "Well Path" );
CAF_PDM_InitFieldNoDefault( &m_wellPathAttributeCollection, "AttributesCollection", "Well Attributes" );
CAF_PDM_InitField( &m_overburdenHeight, "OverburdenHeight", 0.0, "Overburden Height" );
m_overburdenHeight.uiCapability()->setUiHidden( true );
CAF_PDM_InitField( &m_underburdenHeight, "UnderburdenHeight", 0.0, "Underburden Height" );
m_underburdenHeight.uiCapability()->setUiHidden( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogWellPathAttributeSettings::~RimWellLogWellPathAttributeSettings()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogWellPathAttributeSettings::showWellPathAttributes() const
{
return m_showWellPathAttributes();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogWellPathAttributeSettings::setShowWellPathAttributes( bool show )
{
m_showWellPathAttributes = show;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogWellPathAttributeSettings::showWellPathCompletions() const
{
return m_showWellPathCompletions();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogWellPathAttributeSettings::setShowWellPathCompletions( bool show )
{
m_showWellPathCompletions = show;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogWellPathAttributeSettings::showBothSides() const
{
return m_showWellPathComponentsBothSides();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogWellPathAttributeSettings::setShowBothSides( bool show )
{
m_showWellPathComponentsBothSides = show;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogWellPathAttributeSettings::showComponentLabels() const
{
return m_showWellPathComponentLabels();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogWellPathAttributeSettings::setShowComponentLabels( bool show )
{
m_showWellPathComponentLabels = show;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogWellPathAttributeSettings::showAttributesInLegend() const
{
return m_wellPathAttributesInLegend();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogWellPathAttributeSettings::setShowAttributesInLegend( bool show )
{
m_wellPathAttributesInLegend = show;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellLogWellPathAttributeSettings::showCompletionsInLegend() const
{
return m_wellPathCompletionsInLegend();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogWellPathAttributeSettings::setShowCompletionsInLegend( bool show )
{
m_wellPathCompletionsInLegend = show;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellPath* RimWellLogWellPathAttributeSettings::wellPathComponentSource() const
{
return m_wellPathComponentSource();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogWellPathAttributeSettings::setWellPathComponentSource( RimWellPath* wellPath )
{
m_wellPathComponentSource = wellPath;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellPathAttributeCollection* RimWellLogWellPathAttributeSettings::wellPathAttributeCollection() const
{
return m_wellPathAttributeCollection();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogWellPathAttributeSettings::setWellPathAttributeCollection( RimWellPathAttributeCollection* collection )
{
m_wellPathAttributeCollection = collection;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimWellLogWellPathAttributeSettings::overburdenHeight() const
{
return m_overburdenHeight();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogWellPathAttributeSettings::setOverburdenHeight( double height )
{
m_overburdenHeight = height;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimWellLogWellPathAttributeSettings::underburdenHeight() const
{
return m_underburdenHeight();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogWellPathAttributeSettings::setUnderburdenHeight( double height )
{
m_underburdenHeight = height;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogWellPathAttributeSettings::uiOrdering( const QString& uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
uiOrdering.add( &m_showWellPathAttributes );
uiOrdering.add( &m_showWellPathCompletions );
uiOrdering.add( &m_wellPathAttributesInLegend );
uiOrdering.add( &m_wellPathCompletionsInLegend );
uiOrdering.add( &m_showWellPathComponentsBothSides );
uiOrdering.add( &m_showWellPathComponentLabels );
uiOrdering.add( &m_wellPathComponentSource );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogWellPathAttributeSettings::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
{
auto track = firstAncestorOrThisOfType<RimWellLogTrack>();
if ( track )
{
track->loadDataAndUpdate();
track->updateConnectedEditors();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> RimWellLogWellPathAttributeSettings::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
{
QList<caf::PdmOptionItemInfo> options;
if ( fieldNeedingOptions == &m_wellPathComponentSource )
{
RimTools::wellPathOptionItems( &options );
options.push_front( caf::PdmOptionItemInfo( "None", nullptr ) );
}
return options;
}
@@ -0,0 +1,94 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2026- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include "cafPdmPtrField.h"
class RimWellPath;
class RimWellPathAttributeCollection;
//==================================================================================================
///
/// Settings class for well path attribute/completion display in well log tracks
///
//==================================================================================================
class RimWellLogWellPathAttributeSettings : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimWellLogWellPathAttributeSettings();
~RimWellLogWellPathAttributeSettings() override;
// Show attributes/completions
bool showWellPathAttributes() const;
void setShowWellPathAttributes( bool show );
bool showWellPathCompletions() const;
void setShowWellPathCompletions( bool show );
// Display options
bool showBothSides() const;
void setShowBothSides( bool show );
bool showComponentLabels() const;
void setShowComponentLabels( bool show );
// Legend options
bool showAttributesInLegend() const;
void setShowAttributesInLegend( bool show );
bool showCompletionsInLegend() const;
void setShowCompletionsInLegend( bool show );
// Well path source
RimWellPath* wellPathComponentSource() const;
void setWellPathComponentSource( RimWellPath* wellPath );
RimWellPathAttributeCollection* wellPathAttributeCollection() const;
void setWellPathAttributeCollection( RimWellPathAttributeCollection* collection );
// Overburden/underburden
double overburdenHeight() const;
void setOverburdenHeight( double height );
double underburdenHeight() const;
void setUnderburdenHeight( double height );
// UI ordering
void uiOrdering( const QString& uiConfigName, caf::PdmUiOrdering& uiOrdering );
protected:
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
private:
caf::PdmField<bool> m_showWellPathAttributes;
caf::PdmField<bool> m_showWellPathCompletions;
caf::PdmField<bool> m_showWellPathComponentsBothSides;
caf::PdmField<bool> m_showWellPathComponentLabels;
caf::PdmField<bool> m_wellPathAttributesInLegend;
caf::PdmField<bool> m_wellPathCompletionsInLegend;
caf::PdmPtrField<RimWellPath*> m_wellPathComponentSource;
caf::PdmPtrField<RimWellPathAttributeCollection*> m_wellPathAttributeCollection;
caf::PdmField<double> m_overburdenHeight;
caf::PdmField<double> m_underburdenHeight;
};
@@ -126,7 +126,7 @@ void RimWellMeasurementCurve::onLoadDataAndUpdate( bool updateParentPlot )
bool useLogarithmicScale = false;
setPropertyValuesAndDepths( values,
measuredDepthValues,
RiaDefines::DepthTypeEnum::MEASURED_DEPTH,
RiaDefines::DepthType::MEASURED_DEPTH,
0.0,
RiaDefines::DepthUnitType::UNIT_METER,
false,
@@ -150,7 +150,7 @@ void RimWellMeasurementCurve::onLoadDataAndUpdate( bool updateParentPlot )
displayUnit = wellLogPlot->depthUnit();
}
RiaDefines::DepthTypeEnum depthType = RiaDefines::DepthTypeEnum::MEASURED_DEPTH;
RiaDefines::DepthType depthType = RiaDefines::DepthType::MEASURED_DEPTH;
if ( wellLogPlot && curveData()->availableDepthTypes().count( wellLogPlot->depthType() ) )
{
depthType = wellLogPlot->depthType();
@@ -177,28 +177,25 @@ public:
if ( firstCurveData->depthUnit() == RiaDefines::DepthUnitType::UNIT_METER )
{
lasFile->AddLog( "DEPTH", "M", "Depth in meters", firstCurveData->depths( RiaDefines::DepthTypeEnum::MEASURED_DEPTH ) );
lasFile->AddLog( "DEPTH", "M", "Depth in meters", firstCurveData->depths( RiaDefines::DepthType::MEASURED_DEPTH ) );
}
else if ( firstCurveData->depthUnit() == RiaDefines::DepthUnitType::UNIT_FEET )
{
lasFile->AddLog( "DEPTH", "FT", "Depth in feet", firstCurveData->depths( RiaDefines::DepthTypeEnum::MEASURED_DEPTH ) );
lasFile->AddLog( "DEPTH", "FT", "Depth in feet", firstCurveData->depths( RiaDefines::DepthType::MEASURED_DEPTH ) );
}
else if ( firstCurveData->depthUnit() == RiaDefines::DepthUnitType::UNIT_NONE )
{
lasFile->AddLog( "DEPTH", "", "Depth in Connection number", firstCurveData->depths( RiaDefines::DepthTypeEnum::MEASURED_DEPTH ) );
lasFile->AddLog( "DEPTH", "", "Depth in Connection number", firstCurveData->depths( RiaDefines::DepthType::MEASURED_DEPTH ) );
}
if ( !firstCurveData->depths( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH ).empty() )
if ( !firstCurveData->depths( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH ).empty() )
{
lasFile->AddLog( "TVDMSL",
"M",
"True vertical depth in meters",
firstCurveData->depths( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH ) );
lasFile->AddLog( "TVDMSL", "M", "True vertical depth in meters", firstCurveData->depths( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH ) );
if ( m_exportTvdrkb && m_rkbDiff != -1.0 )
{
// Export True Vertical Depth Rotary Kelly Bushing - TVDRKB
std::vector<double> tvdrkbValues = firstCurveData->depths( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH );
std::vector<double> tvdrkbValues = firstCurveData->depths( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH );
for ( auto& value : tvdrkbValues )
{
value += m_rkbDiff;
@@ -222,7 +219,7 @@ public:
double minDepth = 0.0;
double maxDepth = 0.0;
firstCurveData->calculateDepthRange( RiaDefines::DepthTypeEnum::MEASURED_DEPTH, firstCurveData->depthUnit(), &minDepth, &maxDepth );
firstCurveData->calculateDepthRange( RiaDefines::DepthType::MEASURED_DEPTH, firstCurveData->depthUnit(), &minDepth, &maxDepth );
lasFile->setStartDepth( minDepth );
lasFile->setStopDepth( maxDepth );
@@ -71,7 +71,7 @@ void RigWellLogCurveData::setDepthUnit( RiaDefines::DepthUnitType depthUnit )
//--------------------------------------------------------------------------------------------------
void RigWellLogCurveData::setValuesAndDepths( const std::vector<double>& xValues,
const std::vector<double>& depths,
RiaDefines::DepthTypeEnum depthType,
RiaDefines::DepthType depthType,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
@@ -95,12 +95,12 @@ void RigWellLogCurveData::setValuesAndDepths( const std::vector<double>& xValues
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigWellLogCurveData::setValuesAndDepths( const std::vector<double>& xValues,
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& depths,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
bool useLogarithmicScale )
void RigWellLogCurveData::setValuesAndDepths( const std::vector<double>& xValues,
const std::map<RiaDefines::DepthType, std::vector<double>>& depths,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
bool useLogarithmicScale )
{
for ( auto it = depths.begin(); it != depths.end(); ++it )
{
@@ -143,7 +143,7 @@ std::vector<double> RigWellLogCurveData::propertyValues( const QString& units )
{
std::vector<double> convertedValues;
if ( units != m_propertyValueUnitString &&
RiaWellLogUnitTools<double>::convertValues( depths( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB ),
RiaWellLogUnitTools<double>::convertValues( depths( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH_RKB ),
m_propertyValues,
&convertedValues,
m_propertyValueUnitString,
@@ -165,7 +165,7 @@ QString RigWellLogCurveData::propertyValueUnit() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RigWellLogCurveData::depths( RiaDefines::DepthTypeEnum depthType ) const
std::vector<double> RigWellLogCurveData::depths( RiaDefines::DepthType depthType ) const
{
auto it = m_depths.find( depthType );
if ( it != m_depths.end() )
@@ -173,19 +173,18 @@ std::vector<double> RigWellLogCurveData::depths( RiaDefines::DepthTypeEnum depth
return it->second;
}
if ( depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB && m_depths.count( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH ) )
if ( depthType == RiaDefines::DepthType::TRUE_VERTICAL_DEPTH_RKB && m_depths.count( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH ) )
{
std::vector<double> tvds = depths( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH );
std::vector<double> tvds = depths( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH );
for ( double& tvdValue : tvds )
{
tvdValue += m_rkbDiff;
}
return tvds;
}
else if ( depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH &&
m_depths.count( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB ) )
else if ( depthType == RiaDefines::DepthType::TRUE_VERTICAL_DEPTH && m_depths.count( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH_RKB ) )
{
std::vector<double> tvds = depths( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB );
std::vector<double> tvds = depths( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH_RKB );
for ( double& tvdValue : tvds )
{
tvdValue -= m_rkbDiff;
@@ -199,7 +198,7 @@ std::vector<double> RigWellLogCurveData::depths( RiaDefines::DepthTypeEnum depth
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RigWellLogCurveData::depths( RiaDefines::DepthTypeEnum depthType, RiaDefines::DepthUnitType destinationDepthUnit ) const
std::vector<double> RigWellLogCurveData::depths( RiaDefines::DepthType depthType, RiaDefines::DepthUnitType destinationDepthUnit ) const
{
return depthsForDepthUnit( depths( depthType ), m_depthUnit, destinationDepthUnit );
}
@@ -207,9 +206,9 @@ std::vector<double> RigWellLogCurveData::depths( RiaDefines::DepthTypeEnum depth
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::set<RiaDefines::DepthTypeEnum> RigWellLogCurveData::availableDepthTypes() const
std::set<RiaDefines::DepthType> RigWellLogCurveData::availableDepthTypes() const
{
std::set<RiaDefines::DepthTypeEnum> depthTypes;
std::set<RiaDefines::DepthType> depthTypes;
for ( auto depthValuePair : m_depths )
{
@@ -218,15 +217,15 @@ std::set<RiaDefines::DepthTypeEnum> RigWellLogCurveData::availableDepthTypes() c
if ( m_rkbDiff != 0.0 )
{
if ( depthTypes.count( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH ) &&
!depthTypes.count( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB ) )
if ( depthTypes.count( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH ) &&
!depthTypes.count( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH_RKB ) )
{
depthTypes.insert( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB );
depthTypes.insert( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH_RKB );
}
else if ( depthTypes.count( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB ) &&
!depthTypes.count( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH ) )
else if ( depthTypes.count( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH_RKB ) &&
!depthTypes.count( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH ) )
{
depthTypes.insert( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH );
depthTypes.insert( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH );
}
}
@@ -247,7 +246,7 @@ std::vector<double> RigWellLogCurveData::propertyValuesByIntervals() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RigWellLogCurveData::depthValuesByIntervals( RiaDefines::DepthTypeEnum depthType,
std::vector<double> RigWellLogCurveData::depthValuesByIntervals( RiaDefines::DepthType depthType,
RiaDefines::DepthUnitType destinationDepthUnit ) const
{
const std::vector<double> depthValues = RigWellLogCurveData::depthsForDepthUnit( depths( depthType ), m_depthUnit, destinationDepthUnit );
@@ -278,8 +277,8 @@ cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateResampledCurveData(
bool isTVDAvailable = false;
std::vector<double> tvDepths;
auto mdIt = m_depths.find( RiaDefines::DepthTypeEnum::MEASURED_DEPTH );
auto tvdIt = m_depths.find( RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH );
auto mdIt = m_depths.find( RiaDefines::DepthType::MEASURED_DEPTH );
auto tvdIt = m_depths.find( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH );
if ( tvdIt != m_depths.end() && !tvdIt->second.empty() ) isTVDAvailable = true;
@@ -328,15 +327,15 @@ cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateResampledCurveData(
if ( isTVDAvailable )
{
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> resampledDepths =
{ { RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, tvDepths }, { RiaDefines::DepthTypeEnum::MEASURED_DEPTH, measuredDepths } };
std::map<RiaDefines::DepthType, std::vector<double>> resampledDepths = { { RiaDefines::DepthType::TRUE_VERTICAL_DEPTH, tvDepths },
{ RiaDefines::DepthType::MEASURED_DEPTH, measuredDepths } };
reSampledData->setValuesAndDepths( xValues, resampledDepths, m_rkbDiff, m_depthUnit, true, m_useLogarithmicScale );
}
else
{
reSampledData->setValuesAndDepths( xValues,
measuredDepths,
RiaDefines::DepthTypeEnum::MEASURED_DEPTH,
RiaDefines::DepthType::MEASURED_DEPTH,
0.0,
m_depthUnit,
m_isExtractionCurve,
@@ -352,16 +351,15 @@ cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateResampledCurveData(
/// resampledDepths vector for the resampling type. The depth values for remaining depth types
/// are created by linear interpolation between first and second depth value of the resampling type.
//--------------------------------------------------------------------------------------------------
void RigWellLogCurveData::createAndAddInterpolatedSegmentValueAndDepths(
std::vector<double>& resampledValues,
std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& resampledDepths,
RiaDefines::DepthTypeEnum resamplingDepthType,
double targetDepthValue,
size_t firstIndex,
size_t secondIndex,
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& originalDepths,
const std::vector<double>& propertyValues,
double eps )
void RigWellLogCurveData::createAndAddInterpolatedSegmentValueAndDepths( std::vector<double>& resampledValues,
std::map<RiaDefines::DepthType, std::vector<double>>& resampledDepths,
RiaDefines::DepthType resamplingDepthType,
double targetDepthValue,
size_t firstIndex,
size_t secondIndex,
const std::map<RiaDefines::DepthType, std::vector<double>>& originalDepths,
const std::vector<double>& propertyValues,
double eps )
{
if ( !originalDepths.contains( resamplingDepthType ) ) return;
@@ -417,11 +415,11 @@ bool isRightOf( double x1, double x2, bool reverseOrder, double eps )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::pair<std::vector<double>, std::map<RiaDefines::DepthTypeEnum, std::vector<double>>>
RigWellLogCurveData::createResampledValuesAndDepths( RiaDefines::DepthTypeEnum resamplingDepthType,
const std::vector<double>& targetDepths,
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& originalDepths,
const std::vector<double>& propertyValues )
std::pair<std::vector<double>, std::map<RiaDefines::DepthType, std::vector<double>>>
RigWellLogCurveData::createResampledValuesAndDepths( RiaDefines::DepthType resamplingDepthType,
const std::vector<double>& targetDepths,
const std::map<RiaDefines::DepthType, std::vector<double>>& originalDepths,
const std::vector<double>& propertyValues )
{
const double eps = 1.0e-8;
@@ -429,10 +427,10 @@ std::pair<std::vector<double>, std::map<RiaDefines::DepthTypeEnum, std::vector<d
if ( depthIt == originalDepths.end() || depthIt->second.empty() ) return {};
const auto& depthValues = depthIt->second;
bool reverseOrder = resamplingDepthType == RiaDefines::DepthTypeEnum::CONNECTION_NUMBER;
bool reverseOrder = resamplingDepthType == RiaDefines::DepthType::CONNECTION_NUMBER;
std::vector<double> resampledValues;
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> resampledDepths;
std::vector<double> resampledValues;
std::map<RiaDefines::DepthType, std::vector<double>> resampledDepths;
size_t segmentSearchStartIdx = 0;
for ( const auto& targetDepth : targetDepths )
@@ -521,7 +519,7 @@ std::pair<std::vector<double>, std::map<RiaDefines::DepthTypeEnum, std::vector<d
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateResampledCurveData( RiaDefines::DepthTypeEnum resamplingDepthType,
cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateResampledCurveData( RiaDefines::DepthType resamplingDepthType,
const std::vector<double>& depths ) const
{
const auto [xValues, resampledDepths] = createResampledValuesAndDepths( resamplingDepthType, depths, m_depths, m_propertyValues );
@@ -541,7 +539,7 @@ void RigWellLogCurveData::calculateIntervalsOfContinousValidValues()
m_intervalsOfContinousValidValues.clear();
if ( !m_isExtractionCurve || !m_depths.count( RiaDefines::DepthTypeEnum::MEASURED_DEPTH ) )
if ( !m_isExtractionCurve || !m_depths.count( RiaDefines::DepthType::MEASURED_DEPTH ) )
{
m_intervalsOfContinousValidValues = intervalsOfValidValues;
}
@@ -551,7 +549,7 @@ void RigWellLogCurveData::calculateIntervalsOfContinousValidValues()
for ( size_t intIdx = 0; intIdx < intervalsCount; intIdx++ )
{
std::vector<std::pair<size_t, size_t>> depthValuesIntervals;
splitIntervalAtEmptySpace( m_depths[RiaDefines::DepthTypeEnum::MEASURED_DEPTH],
splitIntervalAtEmptySpace( m_depths[RiaDefines::DepthType::MEASURED_DEPTH],
intervalsOfValidValues[intIdx].first,
intervalsOfValidValues[intIdx].second,
&depthValuesIntervals );
@@ -629,7 +627,7 @@ void RigWellLogCurveData::splitIntervalAtEmptySpace( const std::vector<double>&
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RigWellLogCurveData::calculateDepthRange( RiaDefines::DepthTypeEnum depthType,
bool RigWellLogCurveData::calculateDepthRange( RiaDefines::DepthType depthType,
RiaDefines::DepthUnitType depthUnit,
double* minimumDepth,
double* maximumDepth ) const
@@ -47,18 +47,18 @@ public:
void setValuesAndDepths( const std::vector<double>& propertyValues,
const std::vector<double>& depths,
RiaDefines::DepthTypeEnum depthType,
RiaDefines::DepthType depthType,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
bool useLogarithmicScale );
void setValuesAndDepths( const std::vector<double>& propertyValues,
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& depths,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
bool useLogarithmicScale );
void setValuesAndDepths( const std::vector<double>& propertyValues,
const std::map<RiaDefines::DepthType, std::vector<double>>& depths,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve,
bool useLogarithmicScale );
void setPropertyValueUnit( const QString& propertyValueUnitString );
@@ -66,40 +66,40 @@ public:
std::vector<double> propertyValues( const QString& units ) const;
QString propertyValueUnit() const;
std::vector<double> depths( RiaDefines::DepthTypeEnum depthType ) const;
std::vector<double> depths( RiaDefines::DepthTypeEnum depthType, RiaDefines::DepthUnitType destinationDepthUnit ) const;
std::vector<double> depths( RiaDefines::DepthType depthType ) const;
std::vector<double> depths( RiaDefines::DepthType depthType, RiaDefines::DepthUnitType destinationDepthUnit ) const;
std::set<RiaDefines::DepthTypeEnum> availableDepthTypes() const;
std::set<RiaDefines::DepthType> availableDepthTypes() const;
bool calculateDepthRange( RiaDefines::DepthTypeEnum depthType, RiaDefines::DepthUnitType depthUnit, double* minMD, double* maxMD ) const;
bool calculateDepthRange( RiaDefines::DepthType depthType, RiaDefines::DepthUnitType depthUnit, double* minMD, double* maxMD ) const;
RiaDefines::DepthUnitType depthUnit() const;
std::vector<double> propertyValuesByIntervals() const;
std::vector<double> depthValuesByIntervals( RiaDefines::DepthTypeEnum depthType, RiaDefines::DepthUnitType destinationDepthUnit ) const;
std::vector<double> depthValuesByIntervals( RiaDefines::DepthType depthType, RiaDefines::DepthUnitType destinationDepthUnit ) const;
std::vector<std::pair<size_t, size_t>> polylineStartStopIndices() const;
cvf::ref<RigWellLogCurveData> calculateResampledCurveData( double newMeasuredDepthStepSize ) const;
cvf::ref<RigWellLogCurveData> calculateResampledCurveData( RiaDefines::DepthTypeEnum resamplingDepthType,
cvf::ref<RigWellLogCurveData> calculateResampledCurveData( RiaDefines::DepthType resamplingDepthType,
const std::vector<double>& depths ) const;
// Made static due to unit testing
static void createAndAddInterpolatedSegmentValueAndDepths( std::vector<double>& resampledValues,
std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& resampledDepths,
RiaDefines::DepthTypeEnum resamplingDepthType,
double targetDepthValue,
size_t firstIndex,
size_t secondIndex,
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& originalDepths,
const std::vector<double>& propertyValues,
double eps );
static void createAndAddInterpolatedSegmentValueAndDepths( std::vector<double>& resampledValues,
std::map<RiaDefines::DepthType, std::vector<double>>& resampledDepths,
RiaDefines::DepthType resamplingDepthType,
double targetDepthValue,
size_t firstIndex,
size_t secondIndex,
const std::map<RiaDefines::DepthType, std::vector<double>>& originalDepths,
const std::vector<double>& propertyValues,
double eps );
// Made static due to unit testing
static std::pair<std::vector<double>, std::map<RiaDefines::DepthTypeEnum, std::vector<double>>>
createResampledValuesAndDepths( RiaDefines::DepthTypeEnum resamplingDepthType,
const std::vector<double>& targetDepths,
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& originalDepths,
const std::vector<double>& propertyValues );
static std::pair<std::vector<double>, std::map<RiaDefines::DepthType, std::vector<double>>>
createResampledValuesAndDepths( RiaDefines::DepthType resamplingDepthType,
const std::vector<double>& targetDepths,
const std::map<RiaDefines::DepthType, std::vector<double>>& originalDepths,
const std::vector<double>& propertyValues );
private:
void calculateIntervalsOfContinousValidValues();
@@ -114,11 +114,11 @@ private:
std::vector<std::pair<size_t, size_t>>* intervals );
private:
std::vector<double> m_propertyValues;
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> m_depths;
bool m_isExtractionCurve;
double m_rkbDiff;
bool m_useLogarithmicScale;
std::vector<double> m_propertyValues;
std::map<RiaDefines::DepthType, std::vector<double>> m_depths;
bool m_isExtractionCurve;
double m_rkbDiff;
bool m_useLogarithmicScale;
std::vector<std::pair<size_t, size_t>> m_intervalsOfContinousValidValues;
@@ -47,13 +47,13 @@ RigWellPathFormations::RigWellPathFormations( const std::vector<RigWellPathForma
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigWellPathFormations::depthAndFormationNamesWithoutDuplicatesOnDepth( std::vector<QString>* names,
std::vector<double>* measuredDepths,
RimWellLogPlot::DepthTypeEnum depthType ) const
void RigWellPathFormations::depthAndFormationNamesWithoutDuplicatesOnDepth( std::vector<QString>* names,
std::vector<double>* measuredDepths,
RiaDefines::DepthType depthType ) const
{
std::map<double, bool, DepthComp> tempMakeVectorUniqueOnMeasuredDepth;
if ( depthType == RiaDefines::DepthTypeEnum::MEASURED_DEPTH )
if ( depthType == RiaDefines::DepthType::MEASURED_DEPTH )
{
for ( const std::pair<RigWellPathFormation, FormationLevel>& formation : m_formations )
{
@@ -75,7 +75,7 @@ void RigWellPathFormations::depthAndFormationNamesWithoutDuplicatesOnDepth( std:
}
}
}
else if ( depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH )
else if ( depthType == RiaDefines::DepthType::TRUE_VERTICAL_DEPTH )
{
for ( const std::pair<RigWellPathFormation, FormationLevel>& formation : m_formations )
{
@@ -97,49 +97,6 @@ void RigWellPathFormations::depthAndFormationNamesWithoutDuplicatesOnDepth( std:
}
}
}
/*
for (const std::pair<RigWellPathFormation, FormationLevel>& formation : m_formations)
{
if (!tempMakeVectorUniqueOnMeasuredDepth.count(formation.first.mdTop))
{
double depth;
if (depthType == RiaDefines::MEASURED_DEPTH)
{
depth = formation.first.mdTop;
}
else if (depthType == RiaDefines::TRUE_VERTICAL_DEPTH)
{
depth = formation.first.tvdTop;
}
else return;
measuredDepths->push_back(depth);
names->push_back(formation.first.formationName + " Top");
tempMakeVectorUniqueOnMeasuredDepth[depth] = true;
}
}
for (const std::pair<RigWellPathFormation, FormationLevel>& formation : m_formations)
{
double depth;
if (depthType == RiaDefines::MEASURED_DEPTH)
{
depth = formation.first.mdBase;
}
else if (depthType == RiaDefines::TRUE_VERTICAL_DEPTH)
{
depth = formation.first.tvdBase;
}
else return;
if (!tempMakeVectorUniqueOnMeasuredDepth.count(formation.first.mdBase))
{
measuredDepths->push_back(depth);
names->push_back(formation.first.formationName + " Base");
tempMakeVectorUniqueOnMeasuredDepth[depth] = true;
}
}*/
}
//--------------------------------------------------------------------------------------------------
@@ -149,7 +106,7 @@ void RigWellPathFormations::evaluateFormationsForOnePosition( const std::vector<
const FormationLevel& maxLevel,
const PickPosition& position,
std::map<double, LevelAndName, DepthComp>* uniqueListMaker,
RimWellLogPlot::DepthTypeEnum depthType ) const
RiaDefines::DepthType depthType ) const
{
QString postFix;
@@ -166,7 +123,7 @@ void RigWellPathFormations::evaluateFormationsForOnePosition( const std::vector<
{
double depth;
if ( depthType == RiaDefines::DepthTypeEnum::MEASURED_DEPTH )
if ( depthType == RiaDefines::DepthType::MEASURED_DEPTH )
{
if ( position == TOP )
{
@@ -177,7 +134,7 @@ void RigWellPathFormations::evaluateFormationsForOnePosition( const std::vector<
depth = formation.first.mdBase;
}
}
else if ( depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH )
else if ( depthType == RiaDefines::DepthType::TRUE_VERTICAL_DEPTH )
{
if ( position == TOP )
{
@@ -207,7 +164,7 @@ void RigWellPathFormations::evaluateFormations( const std::vector<std::pair<RigW
const FormationLevel& maxLevel,
std::vector<QString>* names,
std::vector<double>* depths,
RimWellLogPlot::DepthTypeEnum depthType ) const
RiaDefines::DepthType depthType ) const
{
std::map<double, LevelAndName, DepthComp> tempMakeVectorUniqueOnDepth;
@@ -227,18 +184,18 @@ void RigWellPathFormations::evaluateFormations( const std::vector<std::pair<RigW
void RigWellPathFormations::evaluateFluids( const std::vector<RigWellPathFormation>& fluidFormations,
std::vector<QString>* names,
std::vector<double>* depths,
RimWellLogPlot::DepthTypeEnum depthType ) const
RiaDefines::DepthType depthType ) const
{
std::map<double, QString, DepthComp> uniqueListMaker;
for ( const RigWellPathFormation& formation : fluidFormations )
{
double depthBase;
if ( depthType == RiaDefines::DepthTypeEnum::MEASURED_DEPTH )
if ( depthType == RiaDefines::DepthType::MEASURED_DEPTH )
{
depthBase = formation.mdBase;
}
else if ( depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH )
else if ( depthType == RiaDefines::DepthType::TRUE_VERTICAL_DEPTH )
{
depthBase = formation.tvdBase;
}
@@ -251,11 +208,11 @@ void RigWellPathFormations::evaluateFluids( const std::vector<RigWellPathFormati
for ( const RigWellPathFormation& formation : fluidFormations )
{
double depthTop;
if ( depthType == RiaDefines::DepthTypeEnum::MEASURED_DEPTH )
if ( depthType == RiaDefines::DepthType::MEASURED_DEPTH )
{
depthTop = formation.mdTop;
}
else if ( depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH )
else if ( depthType == RiaDefines::DepthType::TRUE_VERTICAL_DEPTH )
{
depthTop = formation.tvdTop;
}
@@ -275,11 +232,11 @@ void RigWellPathFormations::evaluateFluids( const std::vector<RigWellPathFormati
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigWellPathFormations::depthAndFormationNamesUpToLevel( FormationLevel level,
std::vector<QString>* names,
std::vector<double>* depths,
bool includeFluids,
RimWellLogPlot::DepthTypeEnum depthType ) const
void RigWellPathFormations::depthAndFormationNamesUpToLevel( FormationLevel level,
std::vector<QString>* names,
std::vector<double>* depths,
bool includeFluids,
RiaDefines::DepthType depthType ) const
{
names->clear();
depths->clear();
@@ -289,11 +246,11 @@ void RigWellPathFormations::depthAndFormationNamesUpToLevel( FormationLevel
evaluateFluids( m_fluids, names, depths, depthType );
}
if ( level == RigWellPathFormations::NONE )
if ( level == FormationLevel::NONE )
{
return;
}
else if ( level == RigWellPathFormations::ALL )
else if ( level == FormationLevel::ALL )
{
depthAndFormationNamesWithoutDuplicatesOnDepth( names, depths, depthType );
}
@@ -369,7 +326,7 @@ RigWellPathFormations::FormationLevel RigWellPathFormations::detectLevel( QStrin
}
if ( isGroupName )
{
return RigWellPathFormations::GROUP;
return FormationLevel::GROUP;
}
QStringList formationNameSplitted = formationName.split( " " );
@@ -389,7 +346,7 @@ RigWellPathFormations::FormationLevel RigWellPathFormations::detectLevel( QStrin
}
if ( levelDesctiptorCandidates.empty() )
{
return RigWellPathFormations::LEVEL0;
return FormationLevel::LEVEL0;
}
if ( levelDesctiptorCandidates.size() > 1 )
@@ -405,7 +362,7 @@ RigWellPathFormations::FormationLevel RigWellPathFormations::detectLevel( QStrin
}
}
}
if ( levelDesctiptorCandidates.size() != 1 ) return RigWellPathFormations::UNKNOWN;
if ( levelDesctiptorCandidates.size() != 1 ) return FormationLevel::UNKNOWN;
QString levelDescriptor = levelDesctiptorCandidates[0];
@@ -420,27 +377,27 @@ RigWellPathFormations::FormationLevel RigWellPathFormations::detectLevel( QStrin
switch ( dotCount )
{
case 0:
return RigWellPathFormations::LEVEL1;
return FormationLevel::LEVEL1;
case 1:
return RigWellPathFormations::LEVEL2;
return FormationLevel::LEVEL2;
case 2:
return RigWellPathFormations::LEVEL3;
return FormationLevel::LEVEL3;
case 3:
return RigWellPathFormations::LEVEL4;
return FormationLevel::LEVEL4;
case 4:
return RigWellPathFormations::LEVEL5;
return FormationLevel::LEVEL5;
case 5:
return RigWellPathFormations::LEVEL6;
return FormationLevel::LEVEL6;
case 6:
return RigWellPathFormations::LEVEL7;
return FormationLevel::LEVEL7;
case 7:
return RigWellPathFormations::LEVEL8;
return FormationLevel::LEVEL8;
case 8:
return RigWellPathFormations::LEVEL9;
return FormationLevel::LEVEL9;
case 9:
return RigWellPathFormations::LEVEL10;
return FormationLevel::LEVEL10;
default:
break;
}
return RigWellPathFormations::UNKNOWN;
return FormationLevel::UNKNOWN;
}
@@ -18,11 +18,12 @@
#pragma once
#include "RiaDefines.h"
#include "RiaWellLogTrackDefines.h"
#include "cvfMath.h"
#include "cvfObject.h"
#include "RimWellLogPlot.h"
#include <map>
#include <utility>
#include <vector>
@@ -44,33 +45,16 @@ struct RigWellPathFormation
class RigWellPathFormations : public cvf::Object
{
public:
enum FormationLevel
{
GROUP,
LEVEL0,
LEVEL1,
LEVEL2,
LEVEL3,
LEVEL4,
LEVEL5,
LEVEL6,
LEVEL7,
LEVEL8,
LEVEL9,
LEVEL10,
ALL,
UNKNOWN,
NONE
};
using FormationLevel = RiaDefines::WellLogTrackFormationLevel;
public:
RigWellPathFormations( const std::vector<RigWellPathFormation>& formations, const QString& filePath, const QString& key );
void depthAndFormationNamesUpToLevel( FormationLevel level,
std::vector<QString>* names,
std::vector<double>* depths,
bool includeFluids,
RimWellLogPlot::DepthTypeEnum depthType ) const;
void depthAndFormationNamesUpToLevel( FormationLevel level,
std::vector<QString>* names,
std::vector<double>* depths,
bool includeFluids,
RiaDefines::DepthType depthType ) const;
std::vector<FormationLevel> formationsLevelsPresent() const;
@@ -95,14 +79,14 @@ private:
struct LevelAndName
{
LevelAndName() = default;
LevelAndName( RigWellPathFormations::FormationLevel level, QString name )
LevelAndName( FormationLevel level, QString name )
: level( level )
, name( name )
{
}
RigWellPathFormations::FormationLevel level;
QString name;
FormationLevel level;
QString name;
};
enum PickPosition
@@ -116,22 +100,22 @@ private:
const FormationLevel& maxLevel,
std::vector<QString>* names,
std::vector<double>* depths,
RimWellLogPlot::DepthTypeEnum depthType ) const;
RiaDefines::DepthType depthType ) const;
void evaluateFluids( const std::vector<RigWellPathFormation>& fluidFormations,
std::vector<QString>* names,
std::vector<double>* depths,
RimWellLogPlot::DepthTypeEnum depthType ) const;
RiaDefines::DepthType depthType ) const;
void evaluateFormationsForOnePosition( const std::vector<std::pair<RigWellPathFormation, FormationLevel>>& formations,
const FormationLevel& maxLevel,
const PickPosition& position,
std::map<double, LevelAndName, DepthComp>* uniqueListMaker,
RimWellLogPlot::DepthTypeEnum depthType ) const;
RiaDefines::DepthType depthType ) const;
void depthAndFormationNamesWithoutDuplicatesOnDepth( std::vector<QString>* names,
std::vector<double>* measuredDepths,
RimWellLogPlot::DepthTypeEnum depthType ) const;
void depthAndFormationNamesWithoutDuplicatesOnDepth( std::vector<QString>* names,
std::vector<double>* measuredDepths,
RiaDefines::DepthType depthType ) const;
bool isFluid( QString formationName );
FormationLevel detectLevel( QString formationName );
@@ -34,17 +34,17 @@
TEST( RigWellLogCurveData, createAndAddInterpolatedSegmentValueAndDepths_first )
{
// Input data
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>> originalDepths =
{ { RiaDefines::DepthTypeEnum::MEASURED_DEPTH, { 0.0, 20.0, 40.0 } },
{ RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, { 0.0, 30.0, 60.0 } },
{ RiaDefines::DepthTypeEnum::PSEUDO_LENGTH, { 0.0, 40.0, 80.0 } } };
const std::map<RiaDefines::DepthType, std::vector<double>> originalDepths =
{ { RiaDefines::DepthType::MEASURED_DEPTH, { 0.0, 20.0, 40.0 } },
{ RiaDefines::DepthType::TRUE_VERTICAL_DEPTH, { 0.0, 30.0, 60.0 } },
{ RiaDefines::DepthType::PSEUDO_LENGTH, { 0.0, 40.0, 80.0 } } };
const std::vector<double> propertyValues = { 0.0, 100.0, 150.0 };
const double eps = 1e-6;
// Output data
const auto resamplingDepthType = RiaDefines::DepthTypeEnum::MEASURED_DEPTH;
std::vector<double> resampledValues;
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> resampledDepths;
const auto resamplingDepthType = RiaDefines::DepthType::MEASURED_DEPTH;
std::vector<double> resampledValues;
std::map<RiaDefines::DepthType, std::vector<double>> resampledDepths;
// Target data (resampling with MEASURED_DEPTH)
const double targetDepthValue = 10.0; // Halfway between index 0 and 1 for MEASURED_DEPTH in originalDepths
@@ -68,14 +68,14 @@ TEST( RigWellLogCurveData, createAndAddInterpolatedSegmentValueAndDepths_first )
ASSERT_EQ( resampledDepths.size(), size_t( 3 ) );
ASSERT_EQ( resampledDepths[RiaDefines::DepthTypeEnum::MEASURED_DEPTH].size(), size_t( 1 ) );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::MEASURED_DEPTH][0], 10.0 );
ASSERT_EQ( resampledDepths[RiaDefines::DepthType::MEASURED_DEPTH].size(), size_t( 1 ) );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthType::MEASURED_DEPTH][0], 10.0 );
ASSERT_EQ( resampledDepths[RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH].size(), size_t( 1 ) );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH][0], 15.0 );
ASSERT_EQ( resampledDepths[RiaDefines::DepthType::TRUE_VERTICAL_DEPTH].size(), size_t( 1 ) );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthType::TRUE_VERTICAL_DEPTH][0], 15.0 );
ASSERT_EQ( resampledDepths[RiaDefines::DepthTypeEnum::PSEUDO_LENGTH].size(), size_t( 1 ) );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::PSEUDO_LENGTH][0], 20.0 );
ASSERT_EQ( resampledDepths[RiaDefines::DepthType::PSEUDO_LENGTH].size(), size_t( 1 ) );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthType::PSEUDO_LENGTH][0], 20.0 );
}
//--------------------------------------------------------------------------------------------------
@@ -84,17 +84,17 @@ TEST( RigWellLogCurveData, createAndAddInterpolatedSegmentValueAndDepths_first )
TEST( RigWellLogCurveData, createAndAddInterpolatedSegmentValueAndDepths_second )
{
// Input data
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>> originalDepths =
{ { RiaDefines::DepthTypeEnum::MEASURED_DEPTH, { 0.0, 20.0, 40.0 } },
{ RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, { 0.0, 30.0, 60.0 } },
{ RiaDefines::DepthTypeEnum::PSEUDO_LENGTH, { 0.0, 40.0, 80.0 } } };
const std::map<RiaDefines::DepthType, std::vector<double>> originalDepths =
{ { RiaDefines::DepthType::MEASURED_DEPTH, { 0.0, 20.0, 40.0 } },
{ RiaDefines::DepthType::TRUE_VERTICAL_DEPTH, { 0.0, 30.0, 60.0 } },
{ RiaDefines::DepthType::PSEUDO_LENGTH, { 0.0, 40.0, 80.0 } } };
const std::vector<double> propertyValues = { 0.0, 100.0, 150.0 };
const double eps = 1e-6;
// Output data
const auto resamplingDepthType = RiaDefines::DepthTypeEnum::MEASURED_DEPTH;
std::vector<double> resampledValues;
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> resampledDepths;
const auto resamplingDepthType = RiaDefines::DepthType::MEASURED_DEPTH;
std::vector<double> resampledValues;
std::map<RiaDefines::DepthType, std::vector<double>> resampledDepths;
// Target data (resampling with MEASURED_DEPTH)
const double firstTargetDepthValue = 10.0; // Halfway between first and second index for MEASURED_DEPTH in originalDepths
@@ -132,17 +132,17 @@ TEST( RigWellLogCurveData, createAndAddInterpolatedSegmentValueAndDepths_second
ASSERT_EQ( resampledDepths.size(), size_t( 3 ) );
ASSERT_EQ( resampledDepths[RiaDefines::DepthTypeEnum::MEASURED_DEPTH].size(), size_t( 2 ) );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::MEASURED_DEPTH][0], 10.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::MEASURED_DEPTH][1], 30.0 );
ASSERT_EQ( resampledDepths[RiaDefines::DepthType::MEASURED_DEPTH].size(), size_t( 2 ) );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthType::MEASURED_DEPTH][0], 10.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthType::MEASURED_DEPTH][1], 30.0 );
ASSERT_EQ( resampledDepths[RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH].size(), size_t( 2 ) );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH][0], 15.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH][1], 45.0 );
ASSERT_EQ( resampledDepths[RiaDefines::DepthType::TRUE_VERTICAL_DEPTH].size(), size_t( 2 ) );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthType::TRUE_VERTICAL_DEPTH][0], 15.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthType::TRUE_VERTICAL_DEPTH][1], 45.0 );
ASSERT_EQ( resampledDepths[RiaDefines::DepthTypeEnum::PSEUDO_LENGTH].size(), size_t( 2 ) );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::PSEUDO_LENGTH][0], 20.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::PSEUDO_LENGTH][1], 60.0 );
ASSERT_EQ( resampledDepths[RiaDefines::DepthType::PSEUDO_LENGTH].size(), size_t( 2 ) );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthType::PSEUDO_LENGTH][0], 20.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthType::PSEUDO_LENGTH][1], 60.0 );
}
//--------------------------------------------------------------------------------------------------
@@ -151,26 +151,26 @@ TEST( RigWellLogCurveData, createAndAddInterpolatedSegmentValueAndDepths_second
TEST( RigWellLogCurveData, CreateResampledValuesAndDepthsTest )
{
// Input data
RiaDefines::DepthTypeEnum resamplingDepthType = RiaDefines::DepthTypeEnum::MEASURED_DEPTH;
const std::vector<double> targetDepths = { 0.0, 5.0, 10.0, 15.0 };
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>> originalDepths =
{ { RiaDefines::DepthTypeEnum::MEASURED_DEPTH, { 0.0, 10.0, 20.0 } },
{ RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, { 0.0, 20.0, 40.0 } },
{ RiaDefines::DepthTypeEnum::PSEUDO_LENGTH, { 0.0, 30.0, 60.0 } } };
RiaDefines::DepthType resamplingDepthType = RiaDefines::DepthType::MEASURED_DEPTH;
const std::vector<double> targetDepths = { 0.0, 5.0, 10.0, 15.0 };
const std::map<RiaDefines::DepthType, std::vector<double>> originalDepths =
{ { RiaDefines::DepthType::MEASURED_DEPTH, { 0.0, 10.0, 20.0 } },
{ RiaDefines::DepthType::TRUE_VERTICAL_DEPTH, { 0.0, 20.0, 40.0 } },
{ RiaDefines::DepthType::PSEUDO_LENGTH, { 0.0, 30.0, 60.0 } } };
const std::vector<double> propertyValues = { 0.0, 100.0, 200.0 };
// Call the function under test
auto result = RigWellLogCurveData::createResampledValuesAndDepths( resamplingDepthType, targetDepths, originalDepths, propertyValues );
// Check the results
std::vector<double>& resampledPropertyValues = result.first;
std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& resampledDepths = result.second;
const auto expectedSize = targetDepths.size();
std::vector<double>& resampledPropertyValues = result.first;
std::map<RiaDefines::DepthType, std::vector<double>>& resampledDepths = result.second;
const auto expectedSize = targetDepths.size();
ASSERT_EQ( resampledDepths.size(), originalDepths.size() );
ASSERT_EQ( resampledDepths[RiaDefines::DepthTypeEnum::MEASURED_DEPTH].size(), expectedSize );
ASSERT_EQ( resampledDepths[RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH].size(), expectedSize );
ASSERT_EQ( resampledDepths[RiaDefines::DepthTypeEnum::PSEUDO_LENGTH].size(), expectedSize );
ASSERT_EQ( resampledDepths[RiaDefines::DepthType::MEASURED_DEPTH].size(), expectedSize );
ASSERT_EQ( resampledDepths[RiaDefines::DepthType::TRUE_VERTICAL_DEPTH].size(), expectedSize );
ASSERT_EQ( resampledDepths[RiaDefines::DepthType::PSEUDO_LENGTH].size(), expectedSize );
ASSERT_EQ( resampledPropertyValues.size(), expectedSize );
@@ -180,18 +180,18 @@ TEST( RigWellLogCurveData, CreateResampledValuesAndDepthsTest )
ASSERT_DOUBLE_EQ( resampledPropertyValues[2], 100.0 );
ASSERT_DOUBLE_EQ( resampledPropertyValues[3], 150.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::MEASURED_DEPTH][0], 0.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::MEASURED_DEPTH][1], 5.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::MEASURED_DEPTH][2], 10.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::MEASURED_DEPTH][3], 15.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthType::MEASURED_DEPTH][0], 0.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthType::MEASURED_DEPTH][1], 5.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthType::MEASURED_DEPTH][2], 10.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthType::MEASURED_DEPTH][3], 15.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH][0], 0.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH][1], 10.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH][2], 20.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH][3], 30.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthType::TRUE_VERTICAL_DEPTH][0], 0.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthType::TRUE_VERTICAL_DEPTH][1], 10.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthType::TRUE_VERTICAL_DEPTH][2], 20.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthType::TRUE_VERTICAL_DEPTH][3], 30.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::PSEUDO_LENGTH][0], 0.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::PSEUDO_LENGTH][1], 15.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::PSEUDO_LENGTH][2], 30.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::PSEUDO_LENGTH][3], 45.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthType::PSEUDO_LENGTH][0], 0.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthType::PSEUDO_LENGTH][1], 15.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthType::PSEUDO_LENGTH][2], 30.0 );
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthType::PSEUDO_LENGTH][3], 45.0 );
}
@@ -45,7 +45,7 @@ RiuWellPathComponentPlotItem::RiuWellPathComponentPlotItem( const RimWellPath* w
: m_wellPath( wellPath )
, m_componentType( RiaDefines::WellPathComponentType::WELL_PATH )
, m_columnOffset( 0.0 )
, m_depthType( RiaDefines::DepthTypeEnum::MEASURED_DEPTH )
, m_depthType( RiaDefines::DepthType::MEASURED_DEPTH )
, m_depthOrientation( RiaDefines::Orientation::VERTICAL )
, m_maxColumnOffset( 0.0 )
, m_showLabel( false )
@@ -63,7 +63,7 @@ RiuWellPathComponentPlotItem::RiuWellPathComponentPlotItem( const RimWellPath* w
RiuWellPathComponentPlotItem::RiuWellPathComponentPlotItem( const RimWellPath* wellPath, const RimWellPathComponentInterface* component )
: m_wellPath( wellPath )
, m_columnOffset( 0.0 )
, m_depthType( RiaDefines::DepthTypeEnum::MEASURED_DEPTH )
, m_depthType( RiaDefines::DepthType::MEASURED_DEPTH )
, m_maxColumnOffset( 0.0 )
, m_showLabel( false )
{
@@ -298,7 +298,7 @@ std::pair<double, double> RiuWellPathComponentPlotItem::depthsOfDepthType() cons
double startDepth = m_startMD;
double endDepth = m_endMD;
if ( m_depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH || m_depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB )
if ( m_depthType == RiaDefines::DepthType::TRUE_VERTICAL_DEPTH || m_depthType == RiaDefines::DepthType::TRUE_VERTICAL_DEPTH_RKB )
{
endDepth = -m_wellPath->wellPathGeometry()->interpolatedPointAlongWellPath( m_endMD ).z();
double rkbDiff = m_wellPath->wellPathGeometry()->rkbDiff();
@@ -310,11 +310,11 @@ std::pair<double, double> RiuWellPathComponentPlotItem::depthsOfDepthType() cons
if ( m_componentType == RiaDefines::WellPathComponentType::WELL_PATH )
{
startDepth = 0.0;
if ( m_depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH )
if ( m_depthType == RiaDefines::DepthType::TRUE_VERTICAL_DEPTH )
{
startDepth -= rkbDiff;
}
else if ( m_depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB )
else if ( m_depthType == RiaDefines::DepthType::TRUE_VERTICAL_DEPTH_RKB )
{
endDepth += m_wellPath->wellPathGeometry()->rkbDiff();
}
@@ -322,7 +322,7 @@ std::pair<double, double> RiuWellPathComponentPlotItem::depthsOfDepthType() cons
else
{
startDepth = -m_wellPath->wellPathGeometry()->interpolatedPointAlongWellPath( m_startMD ).z();
if ( m_depthType == RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH_RKB )
if ( m_depthType == RiaDefines::DepthType::TRUE_VERTICAL_DEPTH_RKB )
{
startDepth += m_wellPath->wellPathGeometry()->rkbDiff();
endDepth += m_wellPath->wellPathGeometry()->rkbDiff();