ResInsight/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp

114 lines
4.1 KiB
C++
Raw Normal View History

/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2015- Statoil ASA
// Copyright (C) 2015- Ceetron Solutions AS
2019-09-06 06:17:36 -05:00
//
// 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.
2019-09-06 06:17:36 -05:00
//
// 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.
2019-09-06 06:17:36 -05:00
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimWellLogPlot.h"
#include "RigWellLogCurveData.h"
2018-08-07 06:34:13 -05:00
#include "RigWellPath.h"
#include "RimEclipseCase.h"
2019-09-06 06:17:36 -05:00
#include "RimGeoMechCase.h"
#include "RimPlot.h"
#include "RimWellAllocationPlot.h"
#include "RimWellLogCurve.h"
#include "RimWellLogCurveCommonDataSource.h"
#include "RimWellLogTrack.h"
2019-12-19 04:37:40 -06:00
#include "RiuMultiPlotPage.h"
2018-04-26 23:28:08 -05:00
#include "RiuPlotMainWindow.h"
2019-10-10 06:33:57 -05:00
#include "RiuPlotMainWindowTools.h"
#include "RiuQwtPlotWidget.h"
#include "RiuWellLogPlot.h"
#include "cafPdmFieldScriptingCapability.h"
#include "cafPdmObjectScriptingCapability.h"
#include "cafPdmUiComboBoxEditor.h"
#include "cafPdmUiDoubleValueEditor.h"
#include "cvfAssert.h"
#include <QKeyEvent>
#include <cmath>
2015-09-01 08:15:54 -05:00
#define RI_LOGPLOT_MINDEPTH_DEFAULT 0.0
#define RI_LOGPLOT_MAXDEPTH_DEFAULT 1000.0
CAF_PDM_SOURCE_INIT( RimWellLogPlot, "WellLogPlot" );
//--------------------------------------------------------------------------------------------------
2019-09-06 06:17:36 -05:00
///
//--------------------------------------------------------------------------------------------------
RimWellLogPlot::RimWellLogPlot()
{
2020-03-03 03:43:07 -06:00
CAF_PDM_InitScriptableObject( "Well Log Plot",
":/WellLogPlot16x16.png",
"",
"A Well Log Plot With a shared Depth Axis and Multiple Tracks" );
setDeletable( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogPlot::~RimWellLogPlot()
{
}
//--------------------------------------------------------------------------------------------------
2019-09-04 12:29:44 -05:00
/// Move-assignment operator. Argument has to be passed with std::move()
//--------------------------------------------------------------------------------------------------
2019-09-06 06:17:36 -05:00
RimWellLogPlot& RimWellLogPlot::operator=( RimWellLogPlot&& rhs )
{
RimPlotWindow::operator=( std::move( rhs ) );
// Move all tracks
std::vector<RimPlot*> plots = rhs.m_plots.childObjects();
rhs.m_plots.clear();
for ( RimPlot* plot : plots )
{
m_plots.push_back( plot );
}
// Deliberately don't set m_plotWindowTitle. This operator is used for copying parameters from children.
// This only happens for some plots that used to own a plot but now inherits the plot.
// These all had their own description at top level which we don't want to overwrite.
m_showPlotWindowTitle = rhs.m_showPlotWindowTitle;
auto dataSource = rhs.m_commonDataSource();
2019-09-06 06:17:36 -05:00
rhs.m_commonDataSource.removeChildObject( dataSource );
m_commonDataSource = dataSource;
2019-09-06 06:17:36 -05:00
m_depthType = rhs.m_depthType();
m_depthUnit = rhs.m_depthUnit();
m_minVisibleDepth = rhs.m_minVisibleDepth();
m_maxVisibleDepth = rhs.m_maxVisibleDepth();
m_depthAxisGridVisibility = rhs.m_depthAxisGridVisibility();
m_isAutoScaleDepthEnabled = rhs.m_isAutoScaleDepthEnabled();
// Deliberately don't copy m_nameConfig. This operator is used for copying parameters from children.
// This only happens for some plots that used to own a plot but now inherits the plot.
// These all had their own description at top level which we don't want to overwrite.
m_minAvailableDepth = rhs.m_minAvailableDepth;
m_maxAvailableDepth = rhs.m_maxAvailableDepth;
return *this;
}