Add depth unit (MD/TVD) dropdown to RFT correlation report plot

Adds a top-level Depth Unit dropdown to RimRftCorrelationReportPlot, restricted to measured depth and true vertical depth. The selection is pushed down to the owned RimWellRftPlot sub-plot on construction, project load, and whenever the dropdown changes.
This commit is contained in:
Magne Sjaastad committed 2026-10-06 11:18:06 +02:00
1 parent 1da4a9e188
commit 99848442a6
2 files changed
+52

No files matched your search

@@ -32,6 +32,7 @@
#include "DockManager.h"
#include "DockWidget.h"
#include "cafPdmOptionItemInfo.h"
#include "cafPdmUiCheckBoxEditor.h"
#include "cafPdmUiTreeOrdering.h"
#include "cafSelectionManager.h"
@@ -108,6 +109,8 @@ RimRftCorrelationReportPlot::RimRftCorrelationReportPlot()
CAF_PDM_InitFieldNoDefault( &m_parameterRftCrossPlot, "ParameterRftCrossPlot", "Cross Plot" );
CAF_PDM_InitFieldNoDefault( &m_tornadoPlot, "TornadoPlot", "Tornado Plot" );
CAF_PDM_InitField( &m_depthType, "DepthType", caf::AppEnum<RiaDefines::DepthType>( RiaDefines::DepthType::TRUE_VERTICAL_DEPTH ), "Depth Unit" );
CAF_PDM_InitField( &m_showDockTitleBars, "ShowDockTitleBars", false, "Show Title Bars" );
caf::PdmUiNativeCheckBoxEditor::configureFieldForEditor( &m_showDockTitleBars );
@@ -127,6 +130,8 @@ RimRftCorrelationReportPlot::RimRftCorrelationReportPlot()
m_tornadoPlot = new RimRftTornadoPlot;
m_tornadoPlot->setParameterSelectedCallback( [this]( const QString& paramName ) { onTornadoParameterSelected( paramName ); } );
applyDepthTypeToSubPlots();
}
//--------------------------------------------------------------------------------------------------
@@ -187,6 +192,8 @@ void RimRftCorrelationReportPlot::initializeFromSourcePlot( RimWellRftPlot* sour
{
if ( !source ) return;
applyDepthTypeToSubPlots();
m_wellRftPlot->setSimWellOrWellPathName( source->simWellOrWellPathName() );
// A fresh RimWellRftPlot has no tracks; syncCurvesFromUiSelection exits early without one.
@@ -349,6 +356,8 @@ void RimRftCorrelationReportPlot::initAfterRead()
m_wellRftPlot->detachFromDockPermanently();
m_wellRftPlot->setShowWindow( true );
}
applyDepthTypeToSubPlots();
}
//--------------------------------------------------------------------------------------------------
@@ -404,6 +413,8 @@ void RimRftCorrelationReportPlot::onLoadDataAndUpdate()
//--------------------------------------------------------------------------------------------------
void RimRftCorrelationReportPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
uiOrdering.add( &m_depthType );
// Delegate cross-plot settings (ensemble, well, depth range, parameter) to the cross plot
m_parameterRftCrossPlot->uiOrdering( uiConfigName, uiOrdering );
@@ -435,6 +446,10 @@ void RimRftCorrelationReportPlot::fieldChangedByUi( const caf::PdmFieldHandle* c
updateDockTitleBarsVisibility();
return;
}
if ( changedField == &m_depthType )
{
applyDepthTypeToSubPlots();
}
loadDataAndUpdate();
}
@@ -522,6 +537,36 @@ void RimRftCorrelationReportPlot::syncTornadoInputsFromCrossPlot()
m_tornadoPlot->setDepthRange( m_parameterRftCrossPlot->depthRangeMin(), m_parameterRftCrossPlot->depthRangeMax() );
}
//--------------------------------------------------------------------------------------------------
/// Pushes the selected depth unit (MD/TVD) down to the sub plots that present a depth axis.
//--------------------------------------------------------------------------------------------------
void RimRftCorrelationReportPlot::applyDepthTypeToSubPlots()
{
if ( !m_wellRftPlot() ) return;
m_wellRftPlot->setAvailableDepthTypes( { RiaDefines::DepthType::MEASURED_DEPTH, RiaDefines::DepthType::TRUE_VERTICAL_DEPTH } );
m_wellRftPlot->setDepthType( m_depthType() );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> RimRftCorrelationReportPlot::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
{
QList<caf::PdmOptionItemInfo> options;
if ( fieldNeedingOptions == &m_depthType )
{
using DepthAppEnum = caf::AppEnum<RiaDefines::DepthType>;
for ( auto depthType : { RiaDefines::DepthType::MEASURED_DEPTH, RiaDefines::DepthType::TRUE_VERTICAL_DEPTH } )
{
options.push_back( caf::PdmOptionItemInfo( DepthAppEnum::uiText( depthType ), depthType ) );
}
}
return options;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -17,9 +17,12 @@
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RiaDefines.h"
#include "RimPlotWindow.h"
#include "RimReportPlotGroup.h"
#include "cafAppEnum.h"
#include "cafPdmChildField.h"
#include "cafPdmField.h"
#include "cafPdmProxyValueField.h"
@@ -80,11 +83,13 @@ private:
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void childFieldChangedByUi( const caf::PdmFieldHandle* changedChildField ) override;
void doUpdateLayout() override {}
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
void updateDockTitleBarsVisibility();
void syncCrossPlotSelectionToRftPlot();
void onTornadoParameterSelected( const QString& paramName );
void syncTornadoInputsFromCrossPlot();
void applyDepthTypeToSubPlots();
private:
caf::PdmProxyValueField<QString> m_name;
@@ -93,6 +98,8 @@ private:
caf::PdmChildField<RimParameterRftCrossPlot*> m_parameterRftCrossPlot;
caf::PdmChildField<RimRftTornadoPlot*> m_tornadoPlot;
caf::PdmField<caf::AppEnum<RiaDefines::DepthType>> m_depthType;
caf::PdmField<bool> m_showDockTitleBars;
caf::PdmField<QString> m_dockState;