2015-08-26 12:27:29 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2015- Statoil ASA
|
|
|
|
|
// Copyright (C) 2015- Ceetron Solutions AS
|
|
|
|
|
//
|
|
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
//
|
|
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2015-11-04 16:22:53 +01:00
|
|
|
#include "RimWellLogCurve.h"
|
2015-09-18 10:50:01 +02:00
|
|
|
|
2015-09-01 14:50:26 +02:00
|
|
|
#include "RimWellLogPlot.h"
|
2015-09-18 10:50:01 +02:00
|
|
|
|
2015-11-04 16:14:42 +01:00
|
|
|
#include "RimWellLogTrack.h"
|
2015-09-22 11:17:24 +02:00
|
|
|
|
2015-11-06 08:32:58 +01:00
|
|
|
#include "RiuLineSegmentQwtPlotCurve.h"
|
2015-11-04 16:14:42 +01:00
|
|
|
#include "RiuWellLogTrack.h"
|
2015-09-17 18:42:35 +02:00
|
|
|
|
2015-12-01 16:22:18 +01:00
|
|
|
#include "cafPdmUiComboBoxEditor.h"
|
|
|
|
|
|
2015-08-31 02:06:37 +02:00
|
|
|
#include "cvfAssert.h"
|
2015-08-27 16:13:49 +02:00
|
|
|
|
2015-12-08 20:39:06 +01:00
|
|
|
#include "qwt_symbol.h"
|
|
|
|
|
|
2015-09-18 13:02:33 +02:00
|
|
|
// NB! Special macro for pure virtual class
|
2015-11-04 16:19:38 +01:00
|
|
|
CAF_PDM_XML_ABSTRACT_SOURCE_INIT(RimWellLogCurve, "WellLogPlotCurve");
|
2015-08-27 16:13:49 +02:00
|
|
|
|
2015-12-08 20:39:06 +01:00
|
|
|
|
2015-08-27 16:13:49 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-11-04 16:19:38 +01:00
|
|
|
RimWellLogCurve::RimWellLogCurve()
|
2016-05-23 15:44:15 +02:00
|
|
|
{
|
|
|
|
|
CAF_PDM_InitObject("WellLogCurve", ":/WellLogCurve16x16.png", "", "");
|
|
|
|
|
|
|
|
|
|
m_qwtPlotCurve->setXAxis(QwtPlot::xTop);
|
|
|
|
|
m_qwtPlotCurve->setYAxis(QwtPlot::yLeft);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
RimWellLogCurve::~RimWellLogCurve()
|
|
|
|
|
{
|
|
|
|
|
m_qwtPlotCurve->detach();
|
|
|
|
|
delete m_qwtPlotCurve;
|
|
|
|
|
m_qwtPlotCurve = NULL;
|
|
|
|
|
|
2016-05-23 17:13:03 +02:00
|
|
|
if (m_parentQwtPlot)
|
2016-05-23 15:44:15 +02:00
|
|
|
{
|
2016-05-23 17:13:03 +02:00
|
|
|
m_parentQwtPlot->replot();
|
2016-05-23 15:44:15 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-01 14:50:26 +02:00
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-11-04 16:19:38 +01:00
|
|
|
bool RimWellLogCurve::depthRange(double* minimumDepth, double* maximumDepth) const
|
2015-09-01 14:50:26 +02:00
|
|
|
{
|
|
|
|
|
CVF_ASSERT(minimumDepth && maximumDepth);
|
2015-10-27 14:44:53 +01:00
|
|
|
CVF_ASSERT(m_qwtPlotCurve);
|
2015-10-28 16:49:52 +01:00
|
|
|
|
2015-10-27 14:44:53 +01:00
|
|
|
if (m_qwtPlotCurve->data()->size() < 1)
|
2015-09-01 14:50:26 +02:00
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2015-10-27 14:44:53 +01:00
|
|
|
*minimumDepth = m_qwtPlotCurve->minYValue();
|
|
|
|
|
*maximumDepth = m_qwtPlotCurve->maxYValue();
|
2015-09-01 14:50:26 +02:00
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2015-09-01 11:25:09 +02:00
|
|
|
|
2015-09-18 10:50:01 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-11-04 16:19:38 +01:00
|
|
|
bool RimWellLogCurve::valueRange(double* minimumValue, double* maximumValue) const
|
2015-09-18 10:50:01 +02:00
|
|
|
{
|
|
|
|
|
CVF_ASSERT(minimumValue && maximumValue);
|
2015-10-27 14:44:53 +01:00
|
|
|
CVF_ASSERT(m_qwtPlotCurve);
|
2015-09-18 10:50:01 +02:00
|
|
|
|
2015-10-27 14:44:53 +01:00
|
|
|
if (m_qwtPlotCurve->data()->size() < 1)
|
2015-09-18 10:50:01 +02:00
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2015-10-27 14:44:53 +01:00
|
|
|
*minimumValue = m_qwtPlotCurve->minXValue();
|
|
|
|
|
*maximumValue = m_qwtPlotCurve->maxXValue();
|
2015-09-18 10:50:01 +02:00
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-18 13:43:09 +02:00
|
|
|
|
2015-09-22 11:17:24 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2016-09-13 09:59:34 +02:00
|
|
|
void RimWellLogCurve::updateZoomInParentPlot()
|
2015-09-22 11:17:24 +02:00
|
|
|
{
|
|
|
|
|
RimWellLogPlot* wellLogPlot;
|
2016-09-21 13:59:41 +02:00
|
|
|
firstAncestorOrThisOfType(wellLogPlot);
|
2015-09-22 11:54:58 +02:00
|
|
|
if (wellLogPlot)
|
2015-09-22 11:17:24 +02:00
|
|
|
{
|
2015-10-27 14:44:53 +01:00
|
|
|
wellLogPlot->calculateAvailableDepthRange();
|
2015-12-07 12:03:33 +01:00
|
|
|
wellLogPlot->updateDepthZoom();
|
2015-09-22 11:54:58 +02:00
|
|
|
}
|
|
|
|
|
|
2015-11-04 15:57:06 +01:00
|
|
|
RimWellLogTrack* plotTrack;
|
2016-09-21 13:59:41 +02:00
|
|
|
firstAncestorOrThisOfType(plotTrack);
|
2015-09-22 11:54:58 +02:00
|
|
|
if (plotTrack)
|
|
|
|
|
{
|
2016-09-13 09:59:34 +02:00
|
|
|
plotTrack->updateXZoomAndParentPlotDepthZoom();
|
2015-09-22 11:17:24 +02:00
|
|
|
}
|
|
|
|
|
}
|
2015-09-22 15:23:52 +02:00
|
|
|
|
2016-05-23 15:44:15 +02:00
|
|
|
|
2015-10-15 11:27:12 +02:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
|
///
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-11-04 16:19:38 +01:00
|
|
|
const RigWellLogCurveData* RimWellLogCurve::curveData() const
|
2015-10-15 11:27:12 +02:00
|
|
|
{
|
|
|
|
|
return m_curveData.p();
|
|
|
|
|
}
|