#4683 clang-format on all files in ApplicationCode

This commit is contained in:
Magne Sjaastad
2019-09-06 10:40:57 +02:00
parent 3a317504bb
commit fe9e567825
2092 changed files with 117952 additions and 111846 deletions

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -23,6 +23,7 @@
#include "RicWellLogTools.h"
#include "RigFlowDiagResults.h"
#include "Rim3dView.h"
#include "RimEclipseResultCase.h"
#include "RimEclipseView.h"
#include "RimFlowCharacteristicsPlot.h"
@@ -30,84 +31,84 @@
#include "RimFlowPlotCollection.h"
#include "RimMainPlotCollection.h"
#include "RimProject.h"
#include "Rim3dView.h"
#include "RiuPlotMainWindowTools.h"
#include <QAction>
CAF_CMD_SOURCE_INIT(RicShowFlowCharacteristicsPlotFeature, "RicShowFlowCharacteristicsPlotFeature");
CAF_CMD_SOURCE_INIT( RicShowFlowCharacteristicsPlotFeature, "RicShowFlowCharacteristicsPlotFeature" );
RimEclipseResultCase* activeEclipseResultCase()
{
Rim3dView * activeView = RiaApplication::instance()->activeReservoirView();
Rim3dView* activeView = RiaApplication::instance()->activeReservoirView();
RimEclipseView* eclView = dynamic_cast<RimEclipseView*>(activeView);
RimEclipseView* eclView = dynamic_cast<RimEclipseView*>( activeView );
if (!eclView) return nullptr;
if ( !eclView ) return nullptr;
RimEclipseResultCase* eclCase = dynamic_cast<RimEclipseResultCase*>(eclView->ownerCase());
RimEclipseResultCase* eclCase = dynamic_cast<RimEclipseResultCase*>( eclView->ownerCase() );
return eclCase;
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicShowFlowCharacteristicsPlotFeature::isCommandEnabled()
{
RimEclipseResultCase* eclCase = activeEclipseResultCase();
if (!eclCase) return false;
if ( !eclCase ) return false;
if (!eclCase->defaultFlowDiagSolution()) return false;
if ( !eclCase->defaultFlowDiagSolution() ) return false;
if (RicWellLogTools::isWellPathOrSimWellSelectedInView()) return false;
if ( RicWellLogTools::isWellPathOrSimWellSelectedInView() ) return false;
return true;
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicShowFlowCharacteristicsPlotFeature::onActionTriggered(bool isChecked)
void RicShowFlowCharacteristicsPlotFeature::onActionTriggered( bool isChecked )
{
RimEclipseResultCase* eclCase = activeEclipseResultCase();
if (eclCase && eclCase->defaultFlowDiagSolution())
if ( eclCase && eclCase->defaultFlowDiagSolution() )
{
// Make sure flow results for the the active timestep is calculated, to avoid an empty plot
{
Rim3dView * activeView = RiaApplication::instance()->activeReservoirView();
if (activeView && eclCase->defaultFlowDiagSolution()->flowDiagResults())
Rim3dView* activeView = RiaApplication::instance()->activeReservoirView();
if ( activeView && eclCase->defaultFlowDiagSolution()->flowDiagResults() )
{
// Trigger calculation
eclCase->defaultFlowDiagSolution()->flowDiagResults()->maxAbsPairFlux(activeView->currentTimeStep());
eclCase->defaultFlowDiagSolution()->flowDiagResults()->maxAbsPairFlux( activeView->currentTimeStep() );
}
}
if (RiaApplication::instance()->project())
if ( RiaApplication::instance()->project() )
{
RimFlowPlotCollection* flowPlotColl = RiaApplication::instance()->project()->mainPlotCollection->flowPlotCollection();
if (flowPlotColl)
RimFlowPlotCollection* flowPlotColl =
RiaApplication::instance()->project()->mainPlotCollection->flowPlotCollection();
if ( flowPlotColl )
{
RiuPlotMainWindowTools::showPlotMainWindow();
flowPlotColl->defaultFlowCharacteristicsPlot()->setFromFlowSolution(eclCase->defaultFlowDiagSolution());
flowPlotColl->defaultFlowCharacteristicsPlot()->setFromFlowSolution( eclCase->defaultFlowDiagSolution() );
flowPlotColl->defaultFlowCharacteristicsPlot()->updateConnectedEditors();
// Make sure the summary plot window is created and visible
RiuPlotMainWindowTools::selectAsCurrentItem(flowPlotColl->defaultFlowCharacteristicsPlot());
RiuPlotMainWindowTools::selectAsCurrentItem( flowPlotColl->defaultFlowCharacteristicsPlot() );
}
}
}
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicShowFlowCharacteristicsPlotFeature::setupActionLook(QAction* actionToSetup)
void RicShowFlowCharacteristicsPlotFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon(QIcon(":/WellAllocPlot16x16.png"));
actionToSetup->setText("Plot Flow Characteristics");
actionToSetup->setIcon( QIcon( ":/WellAllocPlot16x16.png" ) );
actionToSetup->setText( "Plot Flow Characteristics" );
}