Basic well log plot functionality with dummy data up & running

Traces can be added to and deleted from well log plots, and curves with
dummy data can be added and deleted. TODO: Replace dummy data with real
well log data and data extracted from the model.
This commit is contained in:
Pål Hagen
2015-08-31 02:06:37 +02:00
parent 3f09c1bc66
commit 9d4f9d617f
10 changed files with 172 additions and 34 deletions

View File

@@ -19,6 +19,11 @@
#include "RimWellLogPlotCurve.h"
#include "RiuWellLogTracePlot.h"
#include "qwt_plot_curve.h"
#include "cvfAssert.h"
CAF_PDM_SOURCE_INIT(RimWellLogPlotCurve, "WellLogPlotCurve");
@@ -31,6 +36,8 @@ RimWellLogPlotCurve::RimWellLogPlotCurve()
CAF_PDM_InitField(&show, "Show", true, "Show curve", "", "", "");
show.uiCapability()->setUiHidden(true);
m_plotCurve = new QwtPlotCurve;
}
//--------------------------------------------------------------------------------------------------
@@ -38,6 +45,10 @@ RimWellLogPlotCurve::RimWellLogPlotCurve()
//--------------------------------------------------------------------------------------------------
RimWellLogPlotCurve::~RimWellLogPlotCurve()
{
m_plotCurve->detach();
m_plot->replot();
delete m_plotCurve;
}
//--------------------------------------------------------------------------------------------------
@@ -54,3 +65,52 @@ caf::PdmFieldHandle* RimWellLogPlotCurve::objectToggleField()
{
return &show;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPlotCurve::plot(std::vector<double> depthValues, std::vector<double> values)
{
CVF_ASSERT(m_plot);
m_depthValues = depthValues;
m_values = values;
m_plotCurve->setTitle(this->uiName());
m_plotCurve->setSamples(values.data(), depthValues.data(), (int) depthValues.size());
m_plotCurve->attach(m_plot);
m_plot->replot();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RimWellLogPlotCurve::pointCount() const
{
return m_depthValues.size();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const double* RimWellLogPlotCurve::depthValues() const
{
return m_depthValues.data();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const double* RimWellLogPlotCurve::values() const
{
return m_values.data();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPlotCurve::setPlot(RiuWellLogTracePlot* plot)
{
m_plot = plot;
}