2015-08-26 05:27:29 -05: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 09:22:53 -06:00
|
|
|
#include "RimWellLogCurve.h"
|
2015-09-18 03:50:01 -05:00
|
|
|
|
2017-02-24 07:14:29 -06:00
|
|
|
#include "RigWellLogCurveData.h"
|
2015-09-18 03:50:01 -05:00
|
|
|
|
2017-02-24 07:14:29 -06:00
|
|
|
#include "RimWellLogPlot.h"
|
2015-11-04 09:14:42 -06:00
|
|
|
#include "RimWellLogTrack.h"
|
2015-09-22 04:17:24 -05:00
|
|
|
|
2015-11-06 01:32:58 -06:00
|
|
|
#include "RiuLineSegmentQwtPlotCurve.h"
|
2015-11-04 09:14:42 -06:00
|
|
|
#include "RiuWellLogTrack.h"
|
2015-09-17 11:42:35 -05:00
|
|
|
|
2015-12-01 09:22:18 -06:00
|
|
|
#include "cafPdmUiComboBoxEditor.h"
|
|
|
|
|
2015-08-30 19:06:37 -05:00
|
|
|
#include "cvfAssert.h"
|
2015-08-27 09:13:49 -05:00
|
|
|
|
2015-12-08 13:39:06 -06:00
|
|
|
#include "qwt_symbol.h"
|
|
|
|
|
2015-09-18 06:02:33 -05:00
|
|
|
// NB! Special macro for pure virtual class
|
2015-11-04 09:19:38 -06:00
|
|
|
CAF_PDM_XML_ABSTRACT_SOURCE_INIT(RimWellLogCurve, "WellLogPlotCurve");
|
2015-08-27 09:13:49 -05:00
|
|
|
|
2015-12-08 13:39:06 -06:00
|
|
|
|
2015-08-27 09:13:49 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-11-04 09:19:38 -06:00
|
|
|
RimWellLogCurve::RimWellLogCurve()
|
2016-05-23 08:44:15 -05:00
|
|
|
{
|
|
|
|
CAF_PDM_InitObject("WellLogCurve", ":/WellLogCurve16x16.png", "", "");
|
|
|
|
|
|
|
|
m_qwtPlotCurve->setXAxis(QwtPlot::xTop);
|
|
|
|
m_qwtPlotCurve->setYAxis(QwtPlot::yLeft);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimWellLogCurve::~RimWellLogCurve()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2015-09-01 07:50:26 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-11-04 09:19:38 -06:00
|
|
|
bool RimWellLogCurve::depthRange(double* minimumDepth, double* maximumDepth) const
|
2015-09-01 07:50:26 -05:00
|
|
|
{
|
|
|
|
CVF_ASSERT(minimumDepth && maximumDepth);
|
2015-10-27 08:44:53 -05:00
|
|
|
CVF_ASSERT(m_qwtPlotCurve);
|
2015-10-28 10:49:52 -05:00
|
|
|
|
2015-10-27 08:44:53 -05:00
|
|
|
if (m_qwtPlotCurve->data()->size() < 1)
|
2015-09-01 07:50:26 -05:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-10-27 08:44:53 -05:00
|
|
|
*minimumDepth = m_qwtPlotCurve->minYValue();
|
|
|
|
*maximumDepth = m_qwtPlotCurve->maxYValue();
|
2015-09-01 07:50:26 -05:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
2015-09-01 04:25:09 -05:00
|
|
|
|
2015-09-18 03:50:01 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-11-04 09:19:38 -06:00
|
|
|
bool RimWellLogCurve::valueRange(double* minimumValue, double* maximumValue) const
|
2015-09-18 03:50:01 -05:00
|
|
|
{
|
|
|
|
CVF_ASSERT(minimumValue && maximumValue);
|
2015-10-27 08:44:53 -05:00
|
|
|
CVF_ASSERT(m_qwtPlotCurve);
|
2015-09-18 03:50:01 -05:00
|
|
|
|
2015-10-27 08:44:53 -05:00
|
|
|
if (m_qwtPlotCurve->data()->size() < 1)
|
2015-09-18 03:50:01 -05:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-10-27 08:44:53 -05:00
|
|
|
*minimumValue = m_qwtPlotCurve->minXValue();
|
|
|
|
*maximumValue = m_qwtPlotCurve->maxXValue();
|
2015-09-18 03:50:01 -05:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-09-18 06:43:09 -05:00
|
|
|
|
2015-09-22 04:17:24 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2016-09-13 02:59:34 -05:00
|
|
|
void RimWellLogCurve::updateZoomInParentPlot()
|
2015-09-22 04:17:24 -05:00
|
|
|
{
|
|
|
|
RimWellLogPlot* wellLogPlot;
|
2016-09-21 06:59:41 -05:00
|
|
|
firstAncestorOrThisOfType(wellLogPlot);
|
2015-09-22 04:54:58 -05:00
|
|
|
if (wellLogPlot)
|
2015-09-22 04:17:24 -05:00
|
|
|
{
|
2015-10-27 08:44:53 -05:00
|
|
|
wellLogPlot->calculateAvailableDepthRange();
|
2015-12-07 05:03:33 -06:00
|
|
|
wellLogPlot->updateDepthZoom();
|
2015-09-22 04:54:58 -05:00
|
|
|
}
|
|
|
|
|
2015-11-04 08:57:06 -06:00
|
|
|
RimWellLogTrack* plotTrack;
|
2016-09-21 06:59:41 -05:00
|
|
|
firstAncestorOrThisOfType(plotTrack);
|
2015-09-22 04:54:58 -05:00
|
|
|
if (plotTrack)
|
|
|
|
{
|
2016-09-13 02:59:34 -05:00
|
|
|
plotTrack->updateXZoomAndParentPlotDepthZoom();
|
2015-09-22 04:17:24 -05:00
|
|
|
}
|
|
|
|
}
|
2015-09-22 08:23:52 -05:00
|
|
|
|
2016-05-23 08:44:15 -05:00
|
|
|
|
2015-10-15 04:27:12 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2015-11-04 09:19:38 -06:00
|
|
|
const RigWellLogCurveData* RimWellLogCurve::curveData() const
|
2015-10-15 04:27:12 -05:00
|
|
|
{
|
|
|
|
return m_curveData.p();
|
|
|
|
}
|