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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -30,17 +30,16 @@
|
||||
|
||||
#include <set>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicShowTotalAllocationDataFeature, "RicShowTotalAllocationDataFeature");
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicShowTotalAllocationDataFeature, "RicShowTotalAllocationDataFeature" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicShowTotalAllocationDataFeature::isCommandEnabled()
|
||||
{
|
||||
std::set<RimWellAllocationPlot*> wellAllocPlots = RicShowTotalAllocationDataFeature::selectedWellAllocationPlots();
|
||||
|
||||
if (wellAllocPlots.size() > 0)
|
||||
if ( wellAllocPlots.size() > 0 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -49,16 +48,16 @@ bool RicShowTotalAllocationDataFeature::isCommandEnabled()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicShowTotalAllocationDataFeature::onActionTriggered(bool isChecked)
|
||||
void RicShowTotalAllocationDataFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
this->disableModelChangeContribution();
|
||||
|
||||
std::set<RimWellAllocationPlot*> wellAllocPlots = RicShowTotalAllocationDataFeature::selectedWellAllocationPlots();
|
||||
CVF_ASSERT(wellAllocPlots.size() > 0);
|
||||
CVF_ASSERT( wellAllocPlots.size() > 0 );
|
||||
|
||||
for (auto wellAllocPlot : wellAllocPlots)
|
||||
for ( auto wellAllocPlot : wellAllocPlots )
|
||||
{
|
||||
QString txt = wellAllocPlot->description();
|
||||
txt += "\n";
|
||||
@@ -66,42 +65,41 @@ void RicShowTotalAllocationDataFeature::onActionTriggered(bool isChecked)
|
||||
txt += wellAllocPlot->totalWellFlowPlot()->totalAllocationAsText();
|
||||
|
||||
QString title = "Total Allocation (" + wellAllocPlot->wellName() + ")";
|
||||
|
||||
RicShowPlotDataFeature::showTextWindow(title, txt);
|
||||
|
||||
RicShowPlotDataFeature::showTextWindow( title, txt );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicShowTotalAllocationDataFeature::setupActionLook(QAction* actionToSetup)
|
||||
void RicShowTotalAllocationDataFeature::setupActionLook( QAction* actionToSetup )
|
||||
{
|
||||
actionToSetup->setText("Show Total Allocation Data");
|
||||
//actionToSetup->setIcon(QIcon(":/PlotWindow24x24.png"));
|
||||
actionToSetup->setText( "Show Total Allocation Data" );
|
||||
// actionToSetup->setIcon(QIcon(":/PlotWindow24x24.png"));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<RimWellAllocationPlot*> RicShowTotalAllocationDataFeature::selectedWellAllocationPlots()
|
||||
{
|
||||
std::set<RimWellAllocationPlot*> wellAllocPlots;
|
||||
|
||||
std::vector<caf::PdmObject*> objects;
|
||||
caf::SelectionManager::instance()->objectsByType(&objects);
|
||||
for (auto obj : objects)
|
||||
caf::SelectionManager::instance()->objectsByType( &objects );
|
||||
for ( auto obj : objects )
|
||||
{
|
||||
CVF_ASSERT(obj);
|
||||
CVF_ASSERT( obj );
|
||||
|
||||
RimWellAllocationPlot* parentPlot = nullptr;
|
||||
obj->firstAncestorOrThisOfType(parentPlot);
|
||||
obj->firstAncestorOrThisOfType( parentPlot );
|
||||
|
||||
if (parentPlot)
|
||||
if ( parentPlot )
|
||||
{
|
||||
wellAllocPlots.insert(parentPlot);
|
||||
wellAllocPlots.insert( parentPlot );
|
||||
}
|
||||
}
|
||||
|
||||
return wellAllocPlots;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user