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

@@ -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;
};