Realization in Ensemble RFT-plot hover info + refactoring of point tracker functionality

* Add realization number to mouse over text for Ensemble RFT

* Refactor Curve Info Text Provider functionality

- Refactor provider implementation, to separate RiuWellLogTrack from the point tracker and text provider.
- Move creating of point tracker outside of RiuWellLogTrack.
- Makes it possible to override/write new CurveInfoTextProvider implementation when needed.

* Add guards for nullptr
This commit is contained in:
Jørgen Herje
2023-02-23 15:08:22 +01:00
committed by Magne Sjaastad
parent 52b60d8be5
commit ed3539a418
8 changed files with 240 additions and 137 deletions

View File

@@ -46,6 +46,7 @@
#include "RimWellAllocationPlot.h"
#include "RimWellLogCurve.h"
#include "RimWellLogCurveCommonDataSource.h"
#include "RimWellLogCurveInfoTextProvider.h"
#include "RimWellLogPlotNameConfig.h"
#include "RimWellLogTrack.h"
#include "RimWellPath.h"
@@ -55,6 +56,7 @@
#include "RiuPlotMainWindowTools.h"
#include "RiuQwtPlotWidget.h"
#include "RiuWellLogPlot.h"
#include "RiuWellLogTrack.h"
#include "cafPdmFieldReorderCapability.h"
#include "cafPdmFieldScriptingCapability.h"
@@ -812,6 +814,11 @@ void RimDepthTrackPlot::recreatePlotWidgets()
plotVector[tIdx]->createPlotWidget();
m_viewer->addPlot( plotVector[tIdx]->plotWidget() );
}
for ( size_t idx = 0; idx < m_plots.size(); ++idx )
{
createAndSetCurveTextProvider( m_plots[idx] );
}
}
//--------------------------------------------------------------------------------------------------
@@ -1300,6 +1307,29 @@ caf::PdmFieldHandle* RimDepthTrackPlot::userDescriptionField()
return &m_plotWindowTitle;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimDepthTrackPlot::createAndSetCurveTextProvider( RimWellLogTrack* track )
{
if ( !track ) return;
auto* qwtPlotWidget = dynamic_cast<RiuQwtPlotWidget*>( track->plotWidget() );
if ( !qwtPlotWidget ) return;
new RiuWellLogCurvePointTracker( qwtPlotWidget->qwtPlot(), curveTextProvider(), track );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiuPlotCurveInfoTextProvider* RimDepthTrackPlot::curveTextProvider() const
{
static auto textProvider = RimWellLogCurveInfoTextProvider();
return &textProvider;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------