#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) 2018- Equinor 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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -22,29 +22,31 @@
#include "RimCase.h"
#include "RimIntersection.h"
CAF_PDM_SOURCE_INIT(Rim2dIntersectionViewCollection, "Intersection2dViewCollection");
CAF_PDM_SOURCE_INIT( Rim2dIntersectionViewCollection, "Intersection2dViewCollection" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
Rim2dIntersectionViewCollection::Rim2dIntersectionViewCollection()
{
CAF_PDM_InitObject("2D Intersection Views", ":/CrossSection16x16.png", "", "");
CAF_PDM_InitObject( "2D Intersection Views", ":/CrossSection16x16.png", "", "" );
CAF_PDM_InitFieldNoDefault(&m_intersectionViews, "IntersectionViews", "Intersection Views", ":/CrossSection16x16.png", "", "");
m_intersectionViews.uiCapability()->setUiTreeHidden(true);
CAF_PDM_InitFieldNoDefault( &m_intersectionViews,
"IntersectionViews",
"Intersection Views",
":/CrossSection16x16.png",
"",
"" );
m_intersectionViews.uiCapability()->setUiTreeHidden( true );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
Rim2dIntersectionViewCollection::~Rim2dIntersectionViewCollection()
{
}
Rim2dIntersectionViewCollection::~Rim2dIntersectionViewCollection() {}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
std::vector<Rim2dIntersectionView*> Rim2dIntersectionViewCollection::views()
{
@@ -52,21 +54,22 @@ std::vector<Rim2dIntersectionView*> Rim2dIntersectionViewCollection::views()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void Rim2dIntersectionViewCollection::syncFromExistingIntersections( bool doUpdate )
{
RimCase* parentCase = nullptr;
this->firstAncestorOrThisOfTypeAsserted(parentCase);
this->firstAncestorOrThisOfTypeAsserted( parentCase );
std::vector<RimIntersection*> allOrderedIntersectionsInCase;
parentCase->descendantsIncludingThisOfType(allOrderedIntersectionsInCase);
parentCase->descendantsIncludingThisOfType( allOrderedIntersectionsInCase );
std::set<RimIntersection*> currentIntersections(allOrderedIntersectionsInCase.begin(), allOrderedIntersectionsInCase.end());
std::set<RimIntersection*> currentIntersections( allOrderedIntersectionsInCase.begin(),
allOrderedIntersectionsInCase.end() );
// Delete views without a valid intersection
for ( Rim2dIntersectionView* iv: m_intersectionViews )
for ( Rim2dIntersectionView* iv : m_intersectionViews )
{
if ( iv && !iv->intersection() )
{
@@ -76,14 +79,14 @@ void Rim2dIntersectionViewCollection::syncFromExistingIntersections( bool doUpda
// Clean up the container by removing nullptr's
m_intersectionViews.removeChildObject(nullptr);
m_intersectionViews.removeChildObject( nullptr );
// Build map from intersection to view
std::map<RimIntersection*, Rim2dIntersectionView*> intersectionToViewMap;
for (Rim2dIntersectionView* iv: m_intersectionViews)
for ( Rim2dIntersectionView* iv : m_intersectionViews )
{
CVF_ASSERT (iv && iv->intersection());
CVF_ASSERT( iv && iv->intersection() );
intersectionToViewMap[iv->intersection()] = iv;
}
@@ -91,33 +94,33 @@ void Rim2dIntersectionViewCollection::syncFromExistingIntersections( bool doUpda
// Insert the old views in correct order, and create new views as we go
for (RimIntersection* intersection : allOrderedIntersectionsInCase)
for ( RimIntersection* intersection : allOrderedIntersectionsInCase )
{
auto it = intersectionToViewMap.find(intersection);
if (it == intersectionToViewMap.end())
auto it = intersectionToViewMap.find( intersection );
if ( it == intersectionToViewMap.end() )
{
Rim2dIntersectionView* newView = new Rim2dIntersectionView();
Rim3dView* view = nullptr;
intersection->firstAncestorOrThisOfType(view);
if (view)
intersection->firstAncestorOrThisOfType( view );
if ( view )
{
newView->setCurrentTimeStep(view->currentTimeStep());
newView->setCurrentTimeStep( view->currentTimeStep() );
}
newView->setIntersection(intersection);
m_intersectionViews.push_back(newView);
newView->setIntersection( intersection );
m_intersectionViews.push_back( newView );
}
else
{
m_intersectionViews.push_back(it->second);
m_intersectionViews.push_back( it->second );
}
}
if (doUpdate) this->updateConnectedEditors();
RimCase* rimCase = nullptr;
firstAncestorOrThisOfType(rimCase);
if ( doUpdate ) this->updateConnectedEditors();
if (rimCase) rimCase->updateConnectedEditors();
RimCase* rimCase = nullptr;
firstAncestorOrThisOfType( rimCase );
if ( rimCase ) rimCase->updateConnectedEditors();
}