2013-12-04 12:04:42 +01:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
2014-09-24 07:14:52 +02:00
|
|
|
// Copyright (C) Statoil ASA
|
|
|
|
|
// Copyright (C) Ceetron Solutions AS
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2013-12-04 12:04:42 +01:00
|
|
|
// 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.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2013-12-04 12:04:42 +01:00
|
|
|
// 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.
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2013-12-04 12:04:42 +01:00
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#pragma once
|
2015-09-25 15:57:43 +02:00
|
|
|
|
|
|
|
|
#include "cvfObject.h"
|
|
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
|
|
2016-11-25 14:21:40 +01:00
|
|
|
#include <map>
|
2019-09-06 10:40:57 +02:00
|
|
|
#include <vector>
|
2015-09-25 15:57:43 +02:00
|
|
|
|
2013-12-04 12:04:42 +01:00
|
|
|
class RimProject;
|
|
|
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
|
//
|
2019-09-06 10:40:57 +02:00
|
|
|
//
|
2013-12-04 12:04:42 +01:00
|
|
|
//
|
|
|
|
|
//==================================================================================================
|
|
|
|
|
class RiaProjectModifier : public cvf::Object
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
RiaProjectModifier();
|
|
|
|
|
|
2019-11-03 14:08:21 +01:00
|
|
|
void setReplaceCaseFirstOccurrence( const QString& newGridFileName );
|
|
|
|
|
void setReplaceCase( int caseIdToReplace, const QString& newGridFileName );
|
2013-12-04 12:04:42 +01:00
|
|
|
|
2019-11-03 14:08:21 +01:00
|
|
|
void setReplaceSourceCasesFirstOccurrence( const std::vector<QString>& newGridFileNames );
|
|
|
|
|
void setReplaceSourceCasesById( int caseGroupIdToReplace, const std::vector<QString>& newGridFileNames );
|
2013-12-04 12:04:42 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
void setReplacePropertiesFolderFirstOccurrence( QString newPropertiesFolder );
|
|
|
|
|
void setReplacePropertiesFolder( int caseIdToReplace, QString newPropertiesFolder );
|
2017-06-28 20:10:06 +02:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
bool applyModificationsToProject( RimProject* project );
|
2013-12-04 12:04:42 +01:00
|
|
|
|
|
|
|
|
private:
|
2019-09-06 10:40:57 +02:00
|
|
|
void replaceSourceCases( RimProject* project );
|
|
|
|
|
void replaceCase( RimProject* project );
|
|
|
|
|
void replacePropertiesFolder( RimProject* project );
|
2017-06-28 20:10:06 +02:00
|
|
|
|
2019-11-03 14:08:21 +01:00
|
|
|
static QString makeFilePathAbsolute( const QString& relOrAbsolutePath );
|
|
|
|
|
static QString caseNameFromGridFileName( const QString& fullGridFilePathName );
|
2013-12-04 12:04:42 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
static int firstCaseId( RimProject* project );
|
|
|
|
|
static int firstGroupId( RimProject* project );
|
|
|
|
|
static int firstInputCaseId( RimProject* project );
|
2013-12-04 12:04:42 +01:00
|
|
|
|
2019-09-06 10:40:57 +02:00
|
|
|
static int firstOccurrenceId();
|
2016-11-28 11:30:03 +01:00
|
|
|
|
2016-11-25 14:21:40 +01:00
|
|
|
private:
|
2019-09-06 10:40:57 +02:00
|
|
|
std::map<int, QString> m_caseIdToGridFileNameMap;
|
|
|
|
|
std::map<int, std::vector<QString>> m_groupIdToGridFileNamesMap;
|
|
|
|
|
std::map<int, QString> m_caseIdToPropertiesFolderMap;
|
2013-12-04 12:04:42 +01:00
|
|
|
};
|