2012-05-18 02:45:23 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2011-2012 Statoil ASA, 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>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
2013-05-06 03:55:00 -05:00
|
|
|
#include <QApplication>
|
2012-05-18 02:45:23 -05:00
|
|
|
#include <QProcess>
|
2013-05-06 03:55:00 -05:00
|
|
|
#include "cafPdmObject.h"
|
|
|
|
#include "cafPdmField.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
#include "cvfBase.h"
|
|
|
|
#include "cvfObject.h"
|
2013-05-06 03:55:00 -05:00
|
|
|
#include "cvfFont.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
class RIProcess;
|
2013-03-22 09:43:42 -05:00
|
|
|
class RigCaseData;
|
|
|
|
class RimCase;
|
2012-05-18 02:45:23 -05:00
|
|
|
class Drawable;
|
|
|
|
class RiaSocketServer;
|
2013-03-22 09:50:44 -05:00
|
|
|
class RiaPreferences;
|
2013-05-06 03:55:00 -05:00
|
|
|
class RimReservoirView;
|
|
|
|
class RimProject;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
namespace caf
|
|
|
|
{
|
|
|
|
class UiProcess;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==================================================================================================
|
2013-03-22 09:50:44 -05:00
|
|
|
class RiaApplication : public QApplication
|
2012-05-18 02:45:23 -05:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
enum RINavigationPolicy
|
|
|
|
{
|
|
|
|
NAVIGATION_POLICY_CEETRON,
|
|
|
|
NAVIGATION_POLICY_CAD
|
|
|
|
};
|
|
|
|
|
|
|
|
public:
|
2013-03-22 09:50:44 -05:00
|
|
|
RiaApplication(int& argc, char** argv);
|
|
|
|
~RiaApplication();
|
|
|
|
static RiaApplication* instance();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
bool parseArguments();
|
|
|
|
|
|
|
|
void setActiveReservoirView(RimReservoirView*);
|
|
|
|
RimReservoirView* activeReservoirView();
|
|
|
|
const RimReservoirView* activeReservoirView() const;
|
|
|
|
|
2013-05-06 03:55:00 -05:00
|
|
|
RimProject* project();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
void createMockModel();
|
|
|
|
void createResultsMockModel();
|
|
|
|
void createLargeResultsMockModel();
|
2012-06-26 09:10:41 -05:00
|
|
|
void createInputMockModel();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2012-10-23 02:59:57 -05:00
|
|
|
QString defaultFileDialogDirectory(const QString& dialogName);
|
|
|
|
void setDefaultFileDialogDirectory(const QString& dialogName, const QString& defaultDirectory);
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
bool openEclipseCaseFromFile(const QString& fileName);
|
2012-06-26 09:10:41 -05:00
|
|
|
bool openEclipseCase(const QString& caseName, const QString& caseFileName);
|
2013-02-27 08:27:33 -06:00
|
|
|
bool addEclipseCases(const QStringList& fileNames);
|
2012-06-26 09:10:41 -05:00
|
|
|
bool openInputEclipseCase(const QString& caseName, const QStringList& caseFileNames);
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
bool loadLastUsedProject();
|
2012-06-26 09:10:41 -05:00
|
|
|
QString currentProjectFileName() const;
|
2012-05-18 02:45:23 -05:00
|
|
|
bool loadProject(const QString& fileName);
|
|
|
|
bool saveProject();
|
|
|
|
bool saveProjectAs(const QString& fileName);
|
|
|
|
bool saveProjectPromptForFileName();
|
|
|
|
bool closeProject(bool askToSaveIfDirty);
|
Added visualization of Well Paths in reservoir views.
Added PDM objects for a list of well paths (RimWellPathCollection) and for individual well paths (RimWellPath).
RimWellPathCollection uses RivWellPathCollectionPartMgr to generate visualization parts for each well path in the collection.
RimWellPath handles geometry defined in RigWellPath, and RivWellPathPartMgr is used to generate visualization parts. The well path visualization parts are generated by reusing RivPipeGeometryGenerator (also used for well pipes).
Added features:
- Select Open Well Paths in File menu to open one or more well path files, file format supported is Statoil JSON format.
- Each well path has a label showing the name, and the PDM window will show additional info (Id, Source System, UTM Zone, Update Date and User, Survey Type, File Path).
- Possible to turn on / off visibility, set thickness, set color for individual well paths.
- List of well paths including specified parameters/settings will be stored in project file.
- Possible to clip all well paths at a specified distance to the reservoir as this is the relevant area to see, and if showing whole well path it may be problematic for auto zoom etc.
Known problems:
- Well paths are not shown in some types of reservoir views, for instance reservoir views showing well pipes. Will look into this later.
p4#: 21658
2013-05-16 07:10:22 -05:00
|
|
|
void addWellPathsToModel(QList<QString> wellPathFilePaths);
|
|
|
|
|
2013-02-06 04:43:26 -06:00
|
|
|
void copySnapshotToClipboard();
|
|
|
|
void saveSnapshotPromtpForFilename();
|
|
|
|
void saveSnapshotAs(const QString& fileName);
|
2013-02-08 10:04:35 -06:00
|
|
|
void saveSnapshotForAllViews(const QString& snapshotFolderName);
|
|
|
|
void runRegressionTest(const QString& testRootPath);
|
|
|
|
void updateRegressionTest(const QString& testRootPath );
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
void processNonGuiEvents();
|
|
|
|
|
|
|
|
static const char* getVersionStringApp(bool includeCrtInfo);
|
|
|
|
|
|
|
|
void setUseShaders(bool enable);
|
|
|
|
bool useShaders() const;
|
|
|
|
|
|
|
|
void setShowPerformanceInfo(bool enable);
|
|
|
|
bool showPerformanceInfo() const;
|
|
|
|
|
|
|
|
RINavigationPolicy navigationPolicy() const;
|
2013-04-24 00:35:31 -05:00
|
|
|
QString scriptDirectories() const;
|
2012-05-18 02:45:23 -05:00
|
|
|
QString scriptEditorPath() const;
|
|
|
|
QString octavePath() const;
|
|
|
|
|
|
|
|
bool launchProcess(const QString& program, const QStringList& arguments);
|
2013-05-27 08:38:03 -05:00
|
|
|
bool launchProcessForMultipleCases(const QString& program, const QStringList& arguments, const std::vector<int>& caseIds);
|
2012-08-31 12:12:47 -05:00
|
|
|
void terminateProcess();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-04-19 01:02:36 -05:00
|
|
|
RiaPreferences* preferences();
|
2012-05-18 02:45:23 -05:00
|
|
|
void readPreferences();
|
|
|
|
void writePreferences();
|
|
|
|
void applyPreferences();
|
|
|
|
|
2013-04-19 01:02:36 -05:00
|
|
|
cvf::Font* standardFont();
|
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
private:
|
|
|
|
void onProjectOpenedOrClosed();
|
|
|
|
void setWindowCaptionFromAppState();
|
|
|
|
|
2013-05-03 03:07:53 -05:00
|
|
|
QImage grabFrameBufferImage();
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void slotWorkerProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
2013-02-08 10:04:35 -06:00
|
|
|
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
private:
|
2013-04-19 01:02:36 -05:00
|
|
|
caf::PdmPointer<RimReservoirView> m_activeReservoirView;
|
|
|
|
caf::PdmPointer<RimProject> m_project;
|
|
|
|
|
|
|
|
RiaSocketServer* m_socketServer;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-04-19 01:02:36 -05:00
|
|
|
caf::UiProcess* m_workerProcess;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-05-27 08:38:03 -05:00
|
|
|
// Execute for all settings
|
|
|
|
std::list<int> m_currentCaseIds;
|
|
|
|
QString m_currentProgram;
|
|
|
|
QStringList m_currentArguments;
|
|
|
|
|
|
|
|
|
2013-04-19 01:02:36 -05:00
|
|
|
RiaPreferences* m_preferences;
|
2012-05-18 02:45:23 -05:00
|
|
|
|
2013-04-19 01:02:36 -05:00
|
|
|
std::map<QString, QString> m_fileDialogDefaultDirectories;
|
|
|
|
QString m_startupDefaultDirectory;
|
2012-10-23 02:59:57 -05:00
|
|
|
|
2013-04-19 01:02:36 -05:00
|
|
|
cvf::ref<cvf::Font> m_standardFont;
|
2012-05-18 02:45:23 -05:00
|
|
|
};
|