mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 07:00:17 -05:00
Remove 95 cvf include lines that the including file does not use. Found by extracting the symbols declared by every VizFwk header, including symbols they re-export, and flagging includes where none of those symbols appear anywhere in the file. Each removal is verified by a full build. Most of them are cvfVector3.h and cvfObject.h, left behind as the files they were once needed by changed. pch.h is left untouched. It includes cvfObject.h and cvfVector3.h on purpose, so that the files using the precompiled header do not have to. Note that a clean build after removing an include does not prove the include was unnecessary, only that the declarations still arrive some other way. That path can differ between platforms and with RESINSIGHT_ENABLE_UNITY_BUILD, so this needs a CI round on Linux as well.
249 lines
9.7 KiB
C++
249 lines
9.7 KiB
C++
/////////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Copyright (C) 2017 Statoil ASA
|
|
//
|
|
// 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.
|
|
//
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#include "RimTofAccumulatedPhaseFractionsPlot.h"
|
|
|
|
#include "RiaPreferences.h"
|
|
|
|
#include "RimEclipseView.h"
|
|
#include "RimSimWellInViewCollection.h"
|
|
#include "RimWellAllocationPlot.h"
|
|
|
|
#include "RigTofAccumulatedPhaseFractionsCalculator.h"
|
|
#include "Well/RigSimWellData.h"
|
|
|
|
#include "RimProject.h"
|
|
#include "RimWellLogPlot.h"
|
|
#include "RimWellLogTrack.h"
|
|
|
|
#include "RiuPlotMainWindow.h"
|
|
#include "RiuTofAccumulatedPhaseFractionsPlot.h"
|
|
#include "RiuWellAllocationPlot.h"
|
|
|
|
CAF_PDM_SOURCE_INIT( RimTofAccumulatedPhaseFractionsPlot, "TofAccumulatedPhaseFractionsPlot" );
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
RimTofAccumulatedPhaseFractionsPlot::RimTofAccumulatedPhaseFractionsPlot()
|
|
{
|
|
CAF_PDM_InitObject( "Cumulative Saturation by Time of Flight", ":/TOFAccSatPlot16x16.png" );
|
|
|
|
CAF_PDM_InitField( &m_userName, "PlotDescription", QString( "Cumulative Saturation by Time of Flight" ), "Name" );
|
|
m_userName.uiCapability()->setUiHidden( true );
|
|
|
|
CAF_PDM_InitField( &m_showPlotTitle, "ShowPlotTitle", true, "Show Plot Title" );
|
|
m_showPlotTitle.uiCapability()->setUiHidden( true );
|
|
|
|
CAF_PDM_InitField( &m_maxTof, "MaxTof", 50, "Max Time of Flight [year]" );
|
|
m_showWindow = false;
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
RimTofAccumulatedPhaseFractionsPlot::~RimTofAccumulatedPhaseFractionsPlot()
|
|
{
|
|
removeWindowFromDock();
|
|
|
|
if ( m_tofAccumulatedPhaseFractionsPlotWidget )
|
|
{
|
|
m_tofAccumulatedPhaseFractionsPlotWidget->hide();
|
|
m_tofAccumulatedPhaseFractionsPlotWidget->setParent( nullptr );
|
|
delete m_tofAccumulatedPhaseFractionsPlotWidget;
|
|
m_tofAccumulatedPhaseFractionsPlotWidget = nullptr;
|
|
}
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
/// TODO: implement properly
|
|
//--------------------------------------------------------------------------------------------------
|
|
int RimTofAccumulatedPhaseFractionsPlot::id() const
|
|
{
|
|
return -1;
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
void RimTofAccumulatedPhaseFractionsPlot::deleteViewWidget()
|
|
{
|
|
if ( m_tofAccumulatedPhaseFractionsPlotWidget )
|
|
{
|
|
m_tofAccumulatedPhaseFractionsPlotWidget->hide();
|
|
m_tofAccumulatedPhaseFractionsPlotWidget->setParent( nullptr );
|
|
delete m_tofAccumulatedPhaseFractionsPlotWidget;
|
|
m_tofAccumulatedPhaseFractionsPlotWidget = nullptr;
|
|
}
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
void RimTofAccumulatedPhaseFractionsPlot::reloadFromWell()
|
|
{
|
|
onLoadDataAndUpdate();
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
RimEclipseResultCase* RimTofAccumulatedPhaseFractionsPlot::resultCase()
|
|
{
|
|
auto allocationPlot = firstAncestorOrThisOfTypeAsserted<RimWellAllocationPlot>();
|
|
|
|
return allocationPlot->rimCase();
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
QString RimTofAccumulatedPhaseFractionsPlot::tracerName()
|
|
{
|
|
auto allocationPlot = firstAncestorOrThisOfTypeAsserted<RimWellAllocationPlot>();
|
|
|
|
return allocationPlot->wellName();
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
size_t RimTofAccumulatedPhaseFractionsPlot::timeStep()
|
|
{
|
|
auto allocationPlot = firstAncestorOrThisOfTypeAsserted<RimWellAllocationPlot>();
|
|
|
|
return static_cast<size_t>( allocationPlot->timeStep() );
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
int RimTofAccumulatedPhaseFractionsPlot::fontSize() const
|
|
{
|
|
return caf::FontTools::absolutePointSize( RiaPreferences::current()->defaultPlotFontSize() );
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
void RimTofAccumulatedPhaseFractionsPlot::updateFonts()
|
|
{
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
QWidget* RimTofAccumulatedPhaseFractionsPlot::viewWidget()
|
|
{
|
|
return m_tofAccumulatedPhaseFractionsPlotWidget;
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
void RimTofAccumulatedPhaseFractionsPlot::zoomAll()
|
|
{
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
void RimTofAccumulatedPhaseFractionsPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
|
const QVariant& oldValue,
|
|
const QVariant& newValue )
|
|
{
|
|
RimViewWindow::fieldChangedByUi( changedField, oldValue, newValue );
|
|
|
|
if ( changedField == &m_userName || changedField == &m_showPlotTitle )
|
|
{
|
|
updateWindowTitle();
|
|
}
|
|
else if ( changedField == &m_maxTof )
|
|
{
|
|
onLoadDataAndUpdate();
|
|
}
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
QImage RimTofAccumulatedPhaseFractionsPlot::snapshotWindowContent()
|
|
{
|
|
QImage image;
|
|
|
|
// TODO
|
|
|
|
return image;
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
void RimTofAccumulatedPhaseFractionsPlot::setDescription( const QString& description )
|
|
{
|
|
m_userName = description;
|
|
updateWindowTitle();
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
QString RimTofAccumulatedPhaseFractionsPlot::description() const
|
|
{
|
|
return m_userName();
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
/// TODO: Implement properly
|
|
//--------------------------------------------------------------------------------------------------
|
|
void RimTofAccumulatedPhaseFractionsPlot::assignIdIfNecessary()
|
|
{
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
void RimTofAccumulatedPhaseFractionsPlot::onLoadDataAndUpdate()
|
|
{
|
|
updateDockWindowVisibility();
|
|
|
|
if ( m_tofAccumulatedPhaseFractionsPlotWidget && m_showWindow() )
|
|
{
|
|
RigTofAccumulatedPhaseFractionsCalculator calc( resultCase(), tracerName(), timeStep() );
|
|
|
|
const std::vector<double>& xValues = calc.sortedUniqueTOFValues();
|
|
const std::vector<double>& watValues = calc.accumulatedPhaseFractionsSwat();
|
|
const std::vector<double>& oilValues = calc.accumulatedPhaseFractionsSoil();
|
|
const std::vector<double>& gasValues = calc.accumulatedPhaseFractionsSgas();
|
|
|
|
m_tofAccumulatedPhaseFractionsPlotWidget->setSamples( xValues, watValues, oilValues, gasValues, m_maxTof() );
|
|
}
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
QWidget* RimTofAccumulatedPhaseFractionsPlot::createViewWidget( QWidget* mainWindowParent )
|
|
{
|
|
if ( !m_tofAccumulatedPhaseFractionsPlotWidget )
|
|
{
|
|
m_tofAccumulatedPhaseFractionsPlotWidget = new RiuTofAccumulatedPhaseFractionsPlot( this, mainWindowParent );
|
|
}
|
|
return m_tofAccumulatedPhaseFractionsPlotWidget;
|
|
}
|