mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user