mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4683 clang-format on all files in ApplicationCode
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -28,55 +28,51 @@
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogTrack.h"
|
||||
|
||||
#include "RiuPlotMainWindow.h"
|
||||
#include "RiuNightchartsWidget.h"
|
||||
#include "RiuPlotMainWindow.h"
|
||||
#include "RiuWellAllocationPlot.h"
|
||||
|
||||
#include "cvfColor3.h"
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimTotalWellAllocationPlot, "TotalWellAllocationPlot");
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimTotalWellAllocationPlot, "TotalWellAllocationPlot" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimTotalWellAllocationPlot::RimTotalWellAllocationPlot()
|
||||
{
|
||||
CAF_PDM_InitObject("Total Allocation", ":/WellAllocPie16x16.png", "", "");
|
||||
CAF_PDM_InitObject( "Total Allocation", ":/WellAllocPie16x16.png", "", "" );
|
||||
|
||||
CAF_PDM_InitField(&m_userName, "PlotDescription", QString("Total Allocation"), "Name", "", "", "");
|
||||
m_userName.uiCapability()->setUiReadOnly(true);
|
||||
|
||||
CAF_PDM_InitField(&m_showPlotTitle, "ShowPlotTitle", true, "Show Plot Title", "", "", "");
|
||||
CAF_PDM_InitField( &m_userName, "PlotDescription", QString( "Total Allocation" ), "Name", "", "", "" );
|
||||
m_userName.uiCapability()->setUiReadOnly( true );
|
||||
|
||||
CAF_PDM_InitField( &m_showPlotTitle, "ShowPlotTitle", true, "Show Plot Title", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimTotalWellAllocationPlot::~RimTotalWellAllocationPlot()
|
||||
{
|
||||
removeMdiWindowFromMdiArea();
|
||||
|
||||
|
||||
deleteViewWidget();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimTotalWellAllocationPlot::deleteViewWidget()
|
||||
{
|
||||
if (m_wellTotalAllocationPlotWidget)
|
||||
if ( m_wellTotalAllocationPlotWidget )
|
||||
{
|
||||
m_wellTotalAllocationPlotWidget->deleteLater();
|
||||
m_wellTotalAllocationPlotWidget= nullptr;
|
||||
m_wellTotalAllocationPlotWidget = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QWidget* RimTotalWellAllocationPlot::viewWidget()
|
||||
{
|
||||
@@ -84,31 +80,27 @@ QWidget* RimTotalWellAllocationPlot::viewWidget()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimTotalWellAllocationPlot::zoomAll()
|
||||
void RimTotalWellAllocationPlot::zoomAll() {}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimTotalWellAllocationPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue )
|
||||
{
|
||||
}
|
||||
RimViewWindow::fieldChangedByUi( changedField, oldValue, newValue );
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimTotalWellAllocationPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
RimViewWindow::fieldChangedByUi(changedField, oldValue, newValue);
|
||||
|
||||
if (changedField == &m_userName ||
|
||||
changedField == &m_showPlotTitle)
|
||||
if ( changedField == &m_userName || changedField == &m_showPlotTitle )
|
||||
{
|
||||
updateMdiWindowTitle();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QImage RimTotalWellAllocationPlot::snapshotWindowContent()
|
||||
{
|
||||
@@ -120,35 +112,34 @@ QImage RimTotalWellAllocationPlot::snapshotWindowContent()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimTotalWellAllocationPlot::setDescription(const QString& description)
|
||||
void RimTotalWellAllocationPlot::setDescription( const QString& description )
|
||||
{
|
||||
m_userName = description;
|
||||
this->updateMdiWindowTitle();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimTotalWellAllocationPlot::description() const
|
||||
{
|
||||
return m_userName();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimTotalWellAllocationPlot::totalAllocationAsText() const
|
||||
{
|
||||
QString txt;
|
||||
|
||||
for (auto a : m_sliceInfo)
|
||||
for ( auto a : m_sliceInfo )
|
||||
{
|
||||
txt += a.first;
|
||||
txt += "\t";
|
||||
txt += QString::number(a.second);
|
||||
txt += QString::number( a.second );
|
||||
txt += "\n";
|
||||
}
|
||||
|
||||
@@ -156,24 +147,23 @@ QString RimTotalWellAllocationPlot::totalAllocationAsText() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimTotalWellAllocationPlot::addSlice(const QString& name, const cvf::Color3f& color, float value)
|
||||
void RimTotalWellAllocationPlot::addSlice( const QString& name, const cvf::Color3f& color, float value )
|
||||
{
|
||||
if ( m_wellTotalAllocationPlotWidget )
|
||||
{
|
||||
QColor sliceColor(color.rByte(), color.gByte(), color.bByte());
|
||||
QColor sliceColor( color.rByte(), color.gByte(), color.bByte() );
|
||||
|
||||
m_wellTotalAllocationPlotWidget->addItem(name, sliceColor, value);
|
||||
m_wellTotalAllocationPlotWidget->addItem( name, sliceColor, value );
|
||||
m_wellTotalAllocationPlotWidget->update();
|
||||
}
|
||||
|
||||
m_sliceInfo.push_back(std::make_pair(name, value));
|
||||
m_sliceInfo.push_back( std::make_pair( name, value ) );
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimTotalWellAllocationPlot::clearSlices()
|
||||
{
|
||||
@@ -187,22 +177,19 @@ void RimTotalWellAllocationPlot::clearSlices()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimTotalWellAllocationPlot::onLoadDataAndUpdate()
|
||||
{
|
||||
updateMdiWindowVisibility();
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QWidget* RimTotalWellAllocationPlot::createViewWidget(QWidget* mainWindowParent)
|
||||
QWidget* RimTotalWellAllocationPlot::createViewWidget( QWidget* mainWindowParent )
|
||||
{
|
||||
m_wellTotalAllocationPlotWidget = new RiuNightchartsWidget(mainWindowParent);
|
||||
m_wellTotalAllocationPlotWidget->showLegend(false);
|
||||
m_wellTotalAllocationPlotWidget = new RiuNightchartsWidget( mainWindowParent );
|
||||
m_wellTotalAllocationPlotWidget->showLegend( false );
|
||||
return m_wellTotalAllocationPlotWidget;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user