Well log plots now contain one plot per trace

This commit is contained in:
Pål Hagen
2015-08-28 14:25:14 +02:00
parent 7401160677
commit 4e83cff8a2
7 changed files with 133 additions and 6 deletions

View File

@@ -19,12 +19,21 @@
#include "RiuWellLogPlot.h"
#include "RiuWellLogTracePlot.h"
#include "RimWellLogPlot.h"
#include "RimWellLogPlotTrace.h"
#include <QHBoxLayout>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiuWellLogPlot::RiuWellLogPlot(QWidget* parent)
: QwtPlot(parent)
: QWidget(parent)
{
m_layout = new QHBoxLayout(this);
setLayout(m_layout);
}
//--------------------------------------------------------------------------------------------------
@@ -33,3 +42,32 @@ RiuWellLogPlot::RiuWellLogPlot(QWidget* parent)
RiuWellLogPlot::~RiuWellLogPlot()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuWellLogPlot::update(const RimWellLogPlot& plot)
{
clear();
for (size_t traceIdx = 0; traceIdx < plot.traces.size(); traceIdx++)
{
RiuWellLogTracePlot* tracePlot = new RiuWellLogTracePlot(this);
m_layout->addWidget(tracePlot);
m_children.append(tracePlot);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuWellLogPlot::clear()
{
for (int childIdx = 0; childIdx < m_children.size(); childIdx++)
{
m_layout->removeWidget(m_children[childIdx]);
delete m_children[childIdx];
}
m_children.clear();
}