mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#438) Showing "MD" or "TVD" on top of Y-axis according to depth type
This commit is contained in:
parent
fa8f6108c7
commit
7901c3c4bd
@ -161,6 +161,14 @@ void RimWellLogPlotTrace::loadDataAndUpdate()
|
||||
{
|
||||
CVF_ASSERT(m_viewer);
|
||||
|
||||
RimWellLogPlot* wellLogPlot;
|
||||
firstAnchestorOrThisOfType(wellLogPlot);
|
||||
if (wellLogPlot)
|
||||
{
|
||||
QString depthTitle = wellLogPlot->depthType() == RimWellLogPlot::MEASURED_DEPTH ? "MD" : "TVD";
|
||||
m_viewer->setDepthTitle(depthTitle);
|
||||
}
|
||||
|
||||
for (size_t cIdx = 0; cIdx < curves.size(); ++cIdx)
|
||||
{
|
||||
curves[cIdx]->updatePlotData();
|
||||
|
@ -26,6 +26,8 @@
|
||||
#include "qwt_legend.h"
|
||||
#include "qwt_scale_engine.h"
|
||||
#include "qwt_plot_layout.h"
|
||||
#include "qwt_scale_draw.h"
|
||||
#include "qwt_text.h"
|
||||
|
||||
#include <QWheelEvent>
|
||||
#include <QFont>
|
||||
@ -109,6 +111,13 @@ void RiuWellLogTracePlot::setDefaults()
|
||||
QFont yAxisFont = axisFont(QwtPlot::yLeft);
|
||||
yAxisFont.setPixelSize(9);
|
||||
setAxisFont(QwtPlot::yLeft, yAxisFont);
|
||||
|
||||
QwtText axisTitleY = axisTitle(QwtPlot::yLeft);
|
||||
QFont yAxisTitleFont = axisTitleY.font();
|
||||
yAxisTitleFont.setPixelSize(12);
|
||||
axisTitleY.setFont(yAxisTitleFont);
|
||||
axisTitleY.setRenderFlags(Qt::AlignRight);
|
||||
setAxisTitle(QwtPlot::yLeft, axisTitleY);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -121,6 +130,16 @@ void RiuWellLogTracePlot::setDepthRange(double minDepth, double maxDepth)
|
||||
//replot();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogTracePlot::setDepthTitle(const QString& title)
|
||||
{
|
||||
QwtText axisTitleY = axisTitle(QwtPlot::yLeft);
|
||||
axisTitleY.setText(title);
|
||||
setAxisTitle(QwtPlot::yLeft, axisTitleY);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -41,6 +41,7 @@ public:
|
||||
virtual ~RiuWellLogTracePlot();
|
||||
|
||||
void setDepthRange(double minDepth, double maxDepth);
|
||||
void setDepthTitle(const QString& title);
|
||||
|
||||
protected:
|
||||
virtual bool eventFilter(QObject* watched, QEvent* event);
|
||||
|
Loading…
Reference in New Issue
Block a user