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:
@@ -3,17 +3,17 @@
|
||||
// Copyright (C) 2011- Statoil ASA
|
||||
// Copyright (C) 2013- Ceetron Solutions AS
|
||||
// Copyright (C) 2011-2012 Ceetron AS
|
||||
//
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -25,61 +25,73 @@
|
||||
#include "RimEclipseCaseCollection.h"
|
||||
#include "RimFormationNamesCollection.h"
|
||||
#include "RimFractureTemplateCollection.h"
|
||||
#include "RimValveTemplateCollection.h"
|
||||
#include "RimGeoMechModels.h"
|
||||
#include "RimObservedSummaryData.h"
|
||||
#include "RimMeasurement.h"
|
||||
#include "RimObservedDataCollection.h"
|
||||
#include "RimObservedSummaryData.h"
|
||||
#include "RimSummaryCase.h"
|
||||
#include "RimSummaryCaseMainCollection.h"
|
||||
#include "RimValveTemplateCollection.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimMeasurement.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimOilField, "ResInsightOilField");
|
||||
CAF_PDM_SOURCE_INIT( RimOilField, "ResInsightOilField" );
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimOilField::RimOilField(void)
|
||||
RimOilField::RimOilField( void )
|
||||
{
|
||||
CAF_PDM_InitObject("Oil Field", "", "", "");
|
||||
CAF_PDM_InitObject( "Oil Field", "", "", "" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&analysisModels, "AnalysisModels", "Grid Models", ":/GridModels.png", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&geoMechModels, "GeoMechModels", "Geo Mech Models", ":/GridModels.png", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&wellPathCollection, "WellPathCollection", "Well Paths", ":/WellCollection.png", "", "");
|
||||
CAF_PDM_InitFieldNoDefault( &analysisModels, "AnalysisModels", "Grid Models", ":/GridModels.png", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &geoMechModels, "GeoMechModels", "Geo Mech Models", ":/GridModels.png", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &wellPathCollection, "WellPathCollection", "Well Paths", ":/WellCollection.png", "", "" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&completionTemplateCollection, "CompletionTemplateCollection", "", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault( &completionTemplateCollection, "CompletionTemplateCollection", "", "", "", "" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&summaryCaseMainCollection,"SummaryCaseCollection","Summary Cases",":/GridModels.png","","");
|
||||
CAF_PDM_InitFieldNoDefault(&formationNamesCollection,"FormationNamesCollection","Formations","","","");
|
||||
CAF_PDM_InitFieldNoDefault(&observedDataCollection, "ObservedDataCollection", "Observed Data", ":/Cases16x16.png", "", "");
|
||||
CAF_PDM_InitFieldNoDefault( &summaryCaseMainCollection,
|
||||
"SummaryCaseCollection",
|
||||
"Summary Cases",
|
||||
":/GridModels.png",
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitFieldNoDefault( &formationNamesCollection, "FormationNamesCollection", "Formations", "", "", "" );
|
||||
CAF_PDM_InitFieldNoDefault( &observedDataCollection,
|
||||
"ObservedDataCollection",
|
||||
"Observed Data",
|
||||
":/Cases16x16.png",
|
||||
"",
|
||||
"" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&annotationCollection, "AnnotationCollection", "Annotations", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault( &annotationCollection, "AnnotationCollection", "Annotations", "", "", "" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_fractureTemplateCollection_OBSOLETE,
|
||||
"FractureDefinitionCollection",
|
||||
"Defenition of Fractures",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(
|
||||
&m_fractureTemplateCollection_OBSOLETE, "FractureDefinitionCollection", "Defenition of Fractures", "", "", "");
|
||||
|
||||
completionTemplateCollection = new RimCompletionTemplateCollection;
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&measurement, "Measurement", "Measurement", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault( &measurement, "Measurement", "Measurement", "", "", "" );
|
||||
measurement = new RimMeasurement();
|
||||
measurement.xmlCapability()->disableIO();
|
||||
|
||||
analysisModels = new RimEclipseCaseCollection();
|
||||
wellPathCollection = new RimWellPathCollection();
|
||||
analysisModels = new RimEclipseCaseCollection();
|
||||
wellPathCollection = new RimWellPathCollection();
|
||||
summaryCaseMainCollection = new RimSummaryCaseMainCollection();
|
||||
observedDataCollection = new RimObservedDataCollection();
|
||||
formationNamesCollection = new RimFormationNamesCollection();
|
||||
annotationCollection = new RimAnnotationCollection();
|
||||
observedDataCollection = new RimObservedDataCollection();
|
||||
formationNamesCollection = new RimFormationNamesCollection();
|
||||
annotationCollection = new RimAnnotationCollection();
|
||||
|
||||
m_fractureTemplateCollection_OBSOLETE = new RimFractureTemplateCollection;
|
||||
m_fractureTemplateCollection_OBSOLETE.xmlCapability()->setIOWritable(false);
|
||||
m_fractureTemplateCollection_OBSOLETE.xmlCapability()->setIOWritable( false );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimOilField::~RimOilField(void)
|
||||
{
|
||||
}
|
||||
RimOilField::~RimOilField( void ) {}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -114,25 +126,25 @@ const RimValveTemplateCollection* RimOilField::valveTemplateCollection() const
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimOilField::uniqueShortNameForCase(RimSummaryCase* summaryCase)
|
||||
QString RimOilField::uniqueShortNameForCase( RimSummaryCase* summaryCase )
|
||||
{
|
||||
std::set<QString> allAutoShortNames;
|
||||
|
||||
std::vector<RimSummaryCase*> allCases = summaryCaseMainCollection->allSummaryCases();
|
||||
std::vector<RimSummaryCase*> allCases = summaryCaseMainCollection->allSummaryCases();
|
||||
std::vector<RimObservedSummaryData*> observedDataCases = observedDataCollection->allObservedSummaryData();
|
||||
|
||||
for (auto observedData : observedDataCases)
|
||||
|
||||
for ( auto observedData : observedDataCases )
|
||||
{
|
||||
allCases.push_back(observedData);
|
||||
allCases.push_back( observedData );
|
||||
}
|
||||
|
||||
for (RimSummaryCase* sumCase : allCases)
|
||||
|
||||
for ( RimSummaryCase* sumCase : allCases )
|
||||
{
|
||||
if (sumCase && sumCase != summaryCase)
|
||||
if ( sumCase && sumCase != summaryCase )
|
||||
{
|
||||
allAutoShortNames.insert(sumCase->shortName());
|
||||
allAutoShortNames.insert( sumCase->shortName() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,16 +153,16 @@ QString RimOilField::uniqueShortNameForCase(RimSummaryCase* summaryCase)
|
||||
QString caseName = summaryCase->caseName();
|
||||
QString shortName;
|
||||
|
||||
if (caseName.size() > 2)
|
||||
if ( caseName.size() > 2 )
|
||||
{
|
||||
QString candidate;
|
||||
candidate += caseName[0];
|
||||
|
||||
for (int i = 1; i < caseName.size(); ++i)
|
||||
for ( int i = 1; i < caseName.size(); ++i )
|
||||
{
|
||||
if (allAutoShortNames.count(candidate + caseName[i]) == 0)
|
||||
if ( allAutoShortNames.count( candidate + caseName[i] ) == 0 )
|
||||
{
|
||||
shortName = candidate + caseName[i];
|
||||
shortName = candidate + caseName[i];
|
||||
foundUnique = true;
|
||||
break;
|
||||
}
|
||||
@@ -158,22 +170,22 @@ QString RimOilField::uniqueShortNameForCase(RimSummaryCase* summaryCase)
|
||||
}
|
||||
else
|
||||
{
|
||||
shortName = caseName.left(2);
|
||||
if (allAutoShortNames.count(shortName) == 0)
|
||||
shortName = caseName.left( 2 );
|
||||
if ( allAutoShortNames.count( shortName ) == 0 )
|
||||
{
|
||||
foundUnique = true;
|
||||
}
|
||||
}
|
||||
|
||||
QString candidate = shortName;
|
||||
int autoNumber = 0;
|
||||
QString candidate = shortName;
|
||||
int autoNumber = 0;
|
||||
|
||||
while (!foundUnique)
|
||||
while ( !foundUnique )
|
||||
{
|
||||
candidate = shortName + QString::number(autoNumber++);
|
||||
if (allAutoShortNames.count(candidate) == 0)
|
||||
candidate = shortName + QString::number( autoNumber++ );
|
||||
if ( allAutoShortNames.count( candidate ) == 0 )
|
||||
{
|
||||
shortName = candidate;
|
||||
shortName = candidate;
|
||||
foundUnique = true;
|
||||
}
|
||||
}
|
||||
@@ -187,10 +199,9 @@ QString RimOilField::uniqueShortNameForCase(RimSummaryCase* summaryCase)
|
||||
void RimOilField::initAfterRead()
|
||||
{
|
||||
RimFractureTemplateCollection* fractureTemplateCollection = m_fractureTemplateCollection_OBSOLETE.value();
|
||||
if (!fractureTemplateCollection->fractureTemplates().empty())
|
||||
if ( !fractureTemplateCollection->fractureTemplates().empty() )
|
||||
{
|
||||
m_fractureTemplateCollection_OBSOLETE.removeChildObject(fractureTemplateCollection);
|
||||
completionTemplateCollection->setFractureTemplateCollection(fractureTemplateCollection);
|
||||
m_fractureTemplateCollection_OBSOLETE.removeChildObject( fractureTemplateCollection );
|
||||
completionTemplateCollection->setFractureTemplateCollection( fractureTemplateCollection );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user