Merge branch 'dev' into pre-proto

This commit is contained in:
Magne Sjaastad
2017-04-20 13:40:56 +02:00
3055 changed files with 298219 additions and 130262 deletions

4
.gitignore vendored
View File

@@ -57,10 +57,6 @@ CTest*.cmake
*.opensdf
*.unsuccessfulbuild
ipch/
[Oo]bj/
[Bb]in
[Dd]ebug*/
[Rr]elease*/
Ankh.NoLoad
#Temp files

View File

@@ -49,9 +49,9 @@
#include "RimEclipseView.h"
#include "RimEclipseWellCollection.h"
#include "RimFaultCollection.h"
#include "RimFlowCharacteristicsPlot.h"
#include "RimFlowPlotCollection.h"
#include "RimFormationNamesCollection.h"
#include "RimFlowCharacteristicsPlot.h"
#include "RimFractureTemplateCollection.h"
#include "RimGeoMechCase.h"
#include "RimGeoMechCellColors.h"
@@ -69,6 +69,7 @@
#include "RimSummaryCurveFilter.h"
#include "RimSummaryPlot.h"
#include "RimSummaryPlotCollection.h"
#include "RimTreeViewStateSerializer.h"
#include "RimViewLinker.h"
#include "RimViewLinkerCollection.h"
#include "RimWellAllocationPlot.h"
@@ -100,10 +101,12 @@
#include "cafPdmFieldCvfColor.h"
#include "cafPdmFieldCvfMat4d.h"
#include "cafPdmSettings.h"
#include "cafPdmUiModelChangeDetector.h"
#include "cafPdmUiTreeView.h"
#include "cafProgressInfo.h"
#include "cafUiProcess.h"
#include "cafUtils.h"
#include "cvfProgramOptions.h"
#include "cvfqtUtils.h"
@@ -115,6 +118,7 @@
#include <QMessageBox>
#include <QTimer>
#include <QUrl>
#include <QTreeView>
#include "gtest/gtest.h"
@@ -620,6 +624,47 @@ void RiaApplication::loadAndUpdatePlotData()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiaApplication::storeTreeViewState()
{
{
if (mainPlotWindow() && mainPlotWindow()->projectTreeView())
{
caf::PdmUiTreeView* projectTreeView = mainPlotWindow()->projectTreeView();
QString treeViewState;
RimTreeViewStateSerializer::storeTreeViewStateToString(projectTreeView->treeView(), treeViewState);
QModelIndex mi = projectTreeView->treeView()->currentIndex();
QString encodedModelIndexString;
RimTreeViewStateSerializer::encodeStringFromModelIndex(mi, encodedModelIndexString);
project()->plotWindowTreeViewState = treeViewState;
project()->plotWindowCurrentModelIndexPath = encodedModelIndexString;
}
}
{
caf::PdmUiTreeView* projectTreeView = RiuMainWindow::instance()->projectTreeView();
if (projectTreeView)
{
QString treeViewState;
RimTreeViewStateSerializer::storeTreeViewStateToString(projectTreeView->treeView(), treeViewState);
QModelIndex mi = projectTreeView->treeView()->currentIndex();
QString encodedModelIndexString;
RimTreeViewStateSerializer::encodeStringFromModelIndex(mi, encodedModelIndexString);
project()->mainWindowTreeViewState = treeViewState;
project()->mainWindowCurrentModelIndexPath = encodedModelIndexString;
}
}
}
//--------------------------------------------------------------------------------------------------
/// Add a list of well path file paths (JSON files) to the well path collection
//--------------------------------------------------------------------------------------------------
@@ -720,6 +765,55 @@ bool RiaApplication::saveProjectPromptForFileName()
return bSaveOk;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaApplication::hasValidProjectFileExtension(const QString& fileName)
{
if (fileName.contains(".rsp", Qt::CaseInsensitive) || fileName.contains(".rip", Qt::CaseInsensitive))
{
return true;
}
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaApplication::askUserToSaveModifiedProject()
{
if (caf::PdmUiModelChangeDetector::instance()->isModelChanged())
{
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Question);
QString questionText;
questionText = QString("The current project is modified.\n\nDo you want to save the changes?");
msgBox.setText(questionText);
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
int ret = msgBox.exec();
if (ret == QMessageBox::Cancel)
{
return false;
}
else if (ret == QMessageBox::Yes)
{
if (!saveProject())
{
return false;
}
}
else
{
caf::PdmUiModelChangeDetector::instance()->reset();
}
}
return true;
}
//--------------------------------------------------------------------------------------------------
///
@@ -728,6 +822,8 @@ bool RiaApplication::saveProjectAs(const QString& fileName)
{
m_project->fileName = fileName;
storeTreeViewState();
if (!m_project->writeFile())
{
QMessageBox::warning(NULL, "Error when saving project file", QString("Not possible to save project file. Make sure you have sufficient access rights.\n\nProject file location : %1").arg(fileName));
@@ -740,10 +836,11 @@ bool RiaApplication::saveProjectAs(const QString& fileName)
m_recentFileActionProvider->addFileName(fileName);
caf::PdmUiModelChangeDetector::instance()->reset();
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -2047,7 +2144,7 @@ bool RiaApplication::openFile(const QString& fileName)
bool loadingSucceded = false;
if (fileName.contains(".rsp", Qt::CaseInsensitive) || fileName.contains(".rip", Qt::CaseInsensitive))
if (RiaApplication::hasValidProjectFileExtension(fileName))
{
loadingSucceded = loadProject(fileName);
}
@@ -2082,6 +2179,11 @@ bool RiaApplication::openFile(const QString& fileName)
}
}
if (loadingSucceded && !RiaApplication::hasValidProjectFileExtension(fileName))
{
caf::PdmUiModelChangeDetector::instance()->setModelChanged();
}
return loadingSucceded;
}

View File

@@ -126,7 +126,11 @@ public:
bool saveProject();
bool saveProjectAs(const QString& fileName);
bool saveProjectPromptForFileName();
static bool hasValidProjectFileExtension(const QString& fileName);
bool askUserToSaveModifiedProject();
void closeProject();
void addWellPathsToModel(QList<QString> wellPathFilePaths);
void addWellLogsToModel(const QList<QString>& wellLogFilePaths);
@@ -208,6 +212,8 @@ private:
void deleteMainPlotWindow();
void loadAndUpdatePlotData();
void storeTreeViewState();
private slots:
void slotWorkerProcessFinished(int exitCode, QProcess::ExitStatus exitStatus);

View File

@@ -163,12 +163,7 @@ void RiaPreferences::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
newCaseBehaviourGroup->add(&loadAndShowSoil);
newCaseBehaviourGroup->add(&showLasCurveWithoutTvdWarning);
std::vector<caf::PdmFieldHandle*> readerSettingsFields;
readerSettings->fields(readerSettingsFields);
for (size_t i = 0; i < readerSettingsFields.size(); i++)
{
newCaseBehaviourGroup->add(readerSettingsFields[i]);
}
readerSettings->defineUiOrdering(uiConfigName, *newCaseBehaviourGroup);
caf::PdmUiGroup* ssihubGroup = uiOrdering.addNewGroup("SSIHUB");
ssihubGroup->add(&ssihubAddress);

View File

@@ -29,9 +29,7 @@ include_directories(
${ResInsight_SOURCE_DIR}/ThirdParty/Qwt/src
${ERT_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${ResInsight_SOURCE_DIR}/ThirdParty/custom-opm-common/opm-common/
${custom-opm-parser_SOURCE_DIR}/opm-parser/
${boost-Subset_SOURCE_DIR}
${custom-opm-flowdiagnostics_SOURCE_DIR}/opm-flowdiagnostics/
${custom-opm-flowdiag-app_SOURCE_DIR}/opm-flowdiagnostics-applications/
${custom-opm-flowdiag-app_SOURCE_DIR}/opmCore
@@ -278,20 +276,6 @@ endif ()
# Set up libraries and dependent projects to link with
#############################################################################
if (MSVC)
set (RI_BOOST_LIBRARIES
debug ${Boost_SYSTEM_LIBRARY_DEBUG}
optimized ${Boost_SYSTEM_LIBRARY_RELEASE}
debug ${Boost_FILESYSTEM_LIBRARY_DEBUG}
optimized ${Boost_FILESYSTEM_LIBRARY_RELEASE}
debug ${Boost_REGEX_LIBRARY_DEBUG}
optimized ${Boost_REGEX_LIBRARY_RELEASE}
)
else()
set (RI_BOOST_LIBRARIES ${Boost_LIBRARIES})
endif()
set( LINK_LIBRARIES
${OPM_LIBRARIES}
@@ -309,9 +293,8 @@ set( LINK_LIBRARIES
${OPENGL_LIBRARIES}
${QT_LIBRARIES}
${RI_BOOST_LIBRARIES}
)
set( EXTERNAL_LINK_LIBRARIES ${ERT_LIBRARY_LIST} )
# According to ivarun this is needed on OpenSuse, and Fedora. See: https://github.com/OPM/ResInsight/pull/7
@@ -340,9 +323,6 @@ if(RESINSIGHT_ENABLE_COTIRE)
# multiple QRC files are not supported
set_source_files_properties (qrc_cafAnimControl.cxx PROPERTIES COTIRE_EXCLUDED TRUE)
# TODO: Revisit why opm-parser is not working
set_source_files_properties (UnitTests/opm-parser-Test.cpp PROPERTIES COTIRE_EXCLUDED TRUE)
# variables at global file scope
set_source_files_properties (ModelVisualization/Intersections/RivIntersectionGeometryGenerator.cpp PROPERTIES COTIRE_EXCLUDED TRUE)
@@ -355,13 +335,9 @@ if(RESINSIGHT_ENABLE_COTIRE)
# using namespace cvf
set_source_files_properties (GeoMech/GeoMechVisualization/RivFemPartGeometryGenerator.cpp PROPERTIES COTIRE_EXCLUDED TRUE)
set_source_files_properties (UnitTests/cvfGeometryTools-Test.cpp PROPERTIES COTIRE_EXCLUDED TRUE)
set_source_files_properties (UnitTests/opm-parser-Performance-Test.cpp PROPERTIES COTIRE_EXCLUDED TRUE)
# opm parser
set_source_files_properties (FileInterface/RifReaderOpmParserInput.cpp PROPERTIES COTIRE_EXCLUDED TRUE)
set_source_files_properties (ProjectDataModel/RimProject.cpp PROPERTIES COTIRE_EXCLUDED TRUE)
set_source_files_properties (UnitTests/opm-parser-Performance-Test.cpp PROPERTIES COTIRE_EXCLUDED TRUE)
set_source_files_properties (UnitTests/opm-Test.cpp PROPERTIES COTIRE_EXCLUDED TRUE)
set_target_properties(ResInsight PROPERTIES COTIRE_ENABLE_PRECOMPILED_HEADER FALSE)

View File

@@ -37,8 +37,12 @@ bool RicCloseProjectFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicCloseProjectFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RiaApplication* app = RiaApplication::instance();
if (!app->askUserToSaveModifiedProject()) return;
app->closeProject();
}

View File

@@ -42,6 +42,8 @@ bool RicEditPreferencesFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicEditPreferencesFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RiaApplication* app = RiaApplication::instance();
QStringList tabNames = app->preferences()->tabNames();

View File

@@ -37,7 +37,11 @@ bool RicExitApplicationFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicExitApplicationFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RiaApplication* app = RiaApplication::instance();
if (!app->askUserToSaveModifiedProject()) return;
app->closeAllWindows();
}

View File

@@ -48,6 +48,8 @@ bool RicHelpAboutFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicHelpAboutFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
caf::AboutDialog dlg(NULL);
dlg.setApplicationName(RI_APPLICATION_NAME);
@@ -100,6 +102,8 @@ bool RicHelpCommandLineFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicHelpCommandLineFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RiaApplication* app = RiaApplication::instance();
QString text = app->commandLineParameterHelp();
app->showFormattedTextInMessageBox(text);
@@ -131,6 +135,8 @@ bool RicHelpOpenUsersGuideFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicHelpOpenUsersGuideFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
QString usersGuideUrl = "http://resinsight.org/docs/home";
if (!QDesktopServices::openUrl(usersGuideUrl))

View File

@@ -39,6 +39,8 @@ bool RicLaunchUnitTestsFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicLaunchUnitTestsFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RiaApplication::instance()->launchUnitTestsWithConsole();
}

View File

@@ -41,6 +41,9 @@ bool RicOpenLastUsedFileFeature::isCommandEnabled()
void RicOpenLastUsedFileFeature::onActionTriggered(bool isChecked)
{
RiaApplication* app = RiaApplication::instance();
if (!app->askUserToSaveModifiedProject()) return;
QString fileName = app->preferences()->lastUsedProjectFileName;
if (app->loadProject(fileName))

View File

@@ -42,6 +42,9 @@ bool RicOpenProjectFeature::isCommandEnabled()
void RicOpenProjectFeature::onActionTriggered(bool isChecked)
{
RiaApplication* app = RiaApplication::instance();
if (!app->askUserToSaveModifiedProject()) return;
QString defaultDir = app->lastUsedDialogDirectory("BINARY_GRID");
QString fileName = QFileDialog::getOpenFileName(NULL, "Open ResInsight Project", defaultDir, "ResInsight project (*.rsp *.rip);;All files(*.*)");

View File

@@ -40,9 +40,9 @@ bool RicSaveProjectAsFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicSaveProjectAsFeature::onActionTriggered(bool isChecked)
{
RiaApplication* app = RiaApplication::instance();
this->disableModelChangeContribution();
RicSaveProjectFeature::storeTreeViewState();
RiaApplication* app = RiaApplication::instance();
app->saveProjectPromptForFileName();
}

View File

@@ -20,16 +20,7 @@
#include "RiaApplication.h"
#include "RimTreeViewStateSerializer.h"
#include "RimProject.h"
#include "RiuMainWindow.h"
#include "RiuMainPlotWindow.h"
#include "cafPdmUiTreeView.h"
#include <QAction>
#include <QTreeView>
CAF_CMD_SOURCE_INIT(RicSaveProjectFeature, "RicSaveProjectFeature");
@@ -46,9 +37,9 @@ bool RicSaveProjectFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicSaveProjectFeature::onActionTriggered(bool isChecked)
{
RiaApplication* app = RiaApplication::instance();
this->disableModelChangeContribution();
RicSaveProjectFeature::storeTreeViewState();
RiaApplication* app = RiaApplication::instance();
app->saveProject();
}
@@ -63,44 +54,3 @@ void RicSaveProjectFeature::setupActionLook(QAction* actionToSetup)
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicSaveProjectFeature::storeTreeViewState()
{
{
RiaApplication* app = RiaApplication::instance();
if (app->mainPlotWindow() && app->mainPlotWindow()->projectTreeView())
{
caf::PdmUiTreeView* projectTreeView = app->mainPlotWindow()->projectTreeView();
QString treeViewState;
RimTreeViewStateSerializer::storeTreeViewStateToString(projectTreeView->treeView(), treeViewState);
QModelIndex mi = projectTreeView->treeView()->currentIndex();
QString encodedModelIndexString;
RimTreeViewStateSerializer::encodeStringFromModelIndex(mi, encodedModelIndexString);
RiaApplication::instance()->project()->plotWindowTreeViewState = treeViewState;
RiaApplication::instance()->project()->plotWindowCurrentModelIndexPath = encodedModelIndexString;
}
}
{
caf::PdmUiTreeView* projectTreeView = RiuMainWindow::instance()->projectTreeView();
if (projectTreeView)
{
QString treeViewState;
RimTreeViewStateSerializer::storeTreeViewStateToString(projectTreeView->treeView(), treeViewState);
QModelIndex mi = projectTreeView->treeView()->currentIndex();
QString encodedModelIndexString;
RimTreeViewStateSerializer::encodeStringFromModelIndex(mi, encodedModelIndexString);
RiaApplication::instance()->project()->mainWindowTreeViewState = treeViewState;
RiaApplication::instance()->project()->mainWindowCurrentModelIndexPath = encodedModelIndexString;
}
}
}

View File

@@ -28,9 +28,6 @@ class RicSaveProjectFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
public:
static void storeTreeViewState();
protected:
// Overrides
virtual bool isCommandEnabled() override;

View File

@@ -39,6 +39,8 @@ bool RicShowMainWindowFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicShowMainWindowFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RiuMainWindow* mainWnd = RiuMainWindow::instance();
if (mainWnd->isMinimized())

View File

@@ -31,13 +31,143 @@
#include <QBoxLayout>
#include <QClipboard>
#include <QMenu>
#include <QPlainTextEdit>
CAF_CMD_SOURCE_INIT(RicShowPlotDataFeature, "RicShowPlotDataFeature");
//--------------------------------------------------------------------------------------------------
///
///
/// RiuQPlainTextEdit
///
///
//--------------------------------------------------------------------------------------------------
void RiuQPlainTextEdit::keyPressEvent(QKeyEvent *e)
{
if ( e->key() == Qt::Key_C && e->modifiers() == Qt::ControlModifier )
{
slotCopyContentToClipboard();
e->setAccepted(true);
}
else
{
QPlainTextEdit::keyPressEvent(e);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuQPlainTextEdit::slotCopyContentToClipboard()
{
QTextCursor cursor(this->textCursor());
QString textForClipboard;
QString selText = cursor.selectedText();
if (!selText.isEmpty())
{
QTextDocument doc;
doc.setPlainText(selText);
textForClipboard = doc.toPlainText();
}
if (textForClipboard.isEmpty())
{
textForClipboard = this->toPlainText();
}
if (!textForClipboard.isEmpty())
{
QClipboard* clipboard = QApplication::clipboard();
if (clipboard)
{
clipboard->setText(textForClipboard);
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuQPlainTextEdit::slotSelectAll()
{
this->selectAll();
}
//--------------------------------------------------------------------------------------------------
///
///
/// RicTextWidget
///
///
//--------------------------------------------------------------------------------------------------
RicTextWidget::RicTextWidget(QWidget* parent) : QDialog(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint)
{
m_textEdit = new RiuQPlainTextEdit(this);
m_textEdit->setReadOnly(true);
m_textEdit->setLineWrapMode(QPlainTextEdit::NoWrap);
QFont font("Courier", 8);
m_textEdit->setFont(font);
m_textEdit->setContextMenuPolicy(Qt::NoContextMenu);
QVBoxLayout* layout = new QVBoxLayout();
layout->addWidget(m_textEdit);
setLayout(layout);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicTextWidget::setText(const QString& text)
{
m_textEdit->setPlainText(text);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicTextWidget::contextMenuEvent(QContextMenuEvent* event)
{
QMenu menu;
{
QAction* actionToSetup = new QAction(this);
actionToSetup->setText("Copy");
actionToSetup->setIcon(QIcon(":/Copy.png"));
actionToSetup->setShortcuts(QKeySequence::Copy);
connect(actionToSetup, SIGNAL(triggered()), m_textEdit, SLOT(slotCopyContentToClipboard()));
menu.addAction(actionToSetup);
}
{
QAction* actionToSetup = new QAction(this);
actionToSetup->setText("Select All");
actionToSetup->setShortcuts(QKeySequence::SelectAll);
connect(actionToSetup, SIGNAL(triggered()), m_textEdit, SLOT(slotSelectAll()));
menu.addAction(actionToSetup);
}
menu.exec(event->globalPos());
}
//--------------------------------------------------------------------------------------------------
///
///
/// RicShowPlotDataFeature
///
///
//--------------------------------------------------------------------------------------------------
bool RicShowPlotDataFeature::isCommandEnabled()
@@ -58,6 +188,8 @@ bool RicShowPlotDataFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicShowPlotDataFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
std::vector<RimSummaryPlot*> selectedSummaryPlots;
caf::SelectionManager::instance()->objectsByType(&selectedSummaryPlots);
@@ -129,104 +261,3 @@ void RicShowPlotDataFeature::showTextWindow(const QString& title, const QString&
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicTextWidget::RicTextWidget(QWidget* parent) : QDialog(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint)
{
m_textEdit = new QPlainTextEdit(this);
m_textEdit->setReadOnly(true);
m_textEdit->setLineWrapMode(QPlainTextEdit::NoWrap);
QFont font("Courier", 8);
m_textEdit->setFont(font);
m_textEdit->setContextMenuPolicy(Qt::NoContextMenu);
QVBoxLayout* layout = new QVBoxLayout();
layout->addWidget(m_textEdit);
setLayout(layout);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicTextWidget::setText(const QString& text)
{
m_textEdit->setPlainText(text);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicTextWidget::slotCopyContentToClipboard()
{
QTextCursor cursor(m_textEdit->textCursor());
QString textForClipboard;
QString selText = cursor.selectedText();
if (!selText.isEmpty())
{
QTextDocument doc;
doc.setPlainText(selText);
textForClipboard = doc.toPlainText();
}
if (textForClipboard.isEmpty())
{
textForClipboard = m_textEdit->toPlainText();
}
if (!textForClipboard.isEmpty())
{
QClipboard* clipboard = QApplication::clipboard();
if (clipboard)
{
clipboard->setText(textForClipboard);
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicTextWidget::slotSelectAll()
{
m_textEdit->selectAll();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicTextWidget::contextMenuEvent(QContextMenuEvent* event)
{
QMenu menu;
{
QAction* actionToSetup = new QAction(this);
actionToSetup->setText("Copy");
actionToSetup->setIcon(QIcon(":/Copy.png"));
actionToSetup->setShortcuts(QKeySequence::Copy);
connect(actionToSetup, SIGNAL(triggered()), this, SLOT(slotCopyContentToClipboard()));
menu.addAction(actionToSetup);
}
{
QAction* actionToSetup = new QAction(this);
actionToSetup->setText("Select All");
actionToSetup->setShortcuts(QKeySequence::SelectAll);
connect(actionToSetup, SIGNAL(triggered()), this, SLOT(slotSelectAll()));
menu.addAction(actionToSetup);
}
menu.exec(event->globalPos());
}

View File

@@ -21,8 +21,24 @@
#include "cafCmdFeature.h"
#include <QDialog>
#include <QPlainTextEdit>
class RiuQPlainTextEdit : public QPlainTextEdit
{
Q_OBJECT
public:
explicit RiuQPlainTextEdit(QWidget *parent = 0) : QPlainTextEdit(parent) {}
protected:
virtual void keyPressEvent(QKeyEvent *e) override;
private slots:
void slotCopyContentToClipboard();
void slotSelectAll();
};
class QPlainTextEdit;
//--------------------------------------------------------------------------------------------------
///
@@ -36,12 +52,8 @@ public:
void setText(const QString& text);
private slots:
void slotCopyContentToClipboard();
void slotSelectAll();
private:
QPlainTextEdit* m_textEdit;
RiuQPlainTextEdit* m_textEdit;
protected:
virtual void contextMenuEvent(QContextMenuEvent *) override;
@@ -61,7 +73,7 @@ protected:
virtual void onActionTriggered( bool isChecked );
virtual void setupActionLook( QAction* actionToSetup );
private:
public:
static void showTextWindow(const QString& title, const QString& text);
};

View File

@@ -37,6 +37,8 @@ bool RicShowPlotWindowFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicShowPlotWindowFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RiaApplication::instance()->getOrCreateAndShowMainPlotWindow();
}

View File

@@ -47,6 +47,8 @@ bool RicTileWindowsFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicTileWindowsFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RiuMainWindow* mainWindow = RiuMainWindow::instance();
if (mainWindow)
{

View File

@@ -6,7 +6,6 @@ endif()
set (SOURCE_GROUP_HEADER_FILES
${CEE_CURRENT_LIST_DIR}RicAddEclipseInputPropertyFeature.h
${CEE_CURRENT_LIST_DIR}RicAddOpmInputPropertyFeature.h
${CEE_CURRENT_LIST_DIR}RicComputeStatisticsFeature.h
${CEE_CURRENT_LIST_DIR}RicCreateGridCaseGroupFeature.h
${CEE_CURRENT_LIST_DIR}RicEclipseCaseNewGroupExec.h
@@ -18,7 +17,6 @@ ${CEE_CURRENT_LIST_DIR}RicEclipsePropertyFilterNewExec.h
${CEE_CURRENT_LIST_DIR}RicEclipsePropertyFilterNewFeature.h
${CEE_CURRENT_LIST_DIR}RicImportEclipseCaseFeature.h
${CEE_CURRENT_LIST_DIR}RicImportInputEclipseCaseFeature.h
${CEE_CURRENT_LIST_DIR}RicImportInputEclipseCaseOpmFeature.h
${CEE_CURRENT_LIST_DIR}RicNewStatisticsCaseFeature.h
${CEE_CURRENT_LIST_DIR}RicSaveEclipseInputPropertyFeature.h
${CEE_CURRENT_LIST_DIR}RicSaveEclipseResultAsInputPropertyExec.h
@@ -28,7 +26,6 @@ ${CEE_CURRENT_LIST_DIR}RicApplyPropertyFilterAsCellResultFeature.h
set (SOURCE_GROUP_SOURCE_FILES
${CEE_CURRENT_LIST_DIR}RicAddEclipseInputPropertyFeature.cpp
${CEE_CURRENT_LIST_DIR}RicAddOpmInputPropertyFeature.cpp
${CEE_CURRENT_LIST_DIR}RicComputeStatisticsFeature.cpp
${CEE_CURRENT_LIST_DIR}RicCreateGridCaseGroupFeature.cpp
${CEE_CURRENT_LIST_DIR}RicEclipseCaseNewGroupExec.cpp
@@ -40,7 +37,6 @@ ${CEE_CURRENT_LIST_DIR}RicEclipsePropertyFilterNewExec.cpp
${CEE_CURRENT_LIST_DIR}RicEclipsePropertyFilterNewFeature.cpp
${CEE_CURRENT_LIST_DIR}RicImportEclipseCaseFeature.cpp
${CEE_CURRENT_LIST_DIR}RicImportInputEclipseCaseFeature.cpp
${CEE_CURRENT_LIST_DIR}RicImportInputEclipseCaseOpmFeature.cpp
${CEE_CURRENT_LIST_DIR}RicNewStatisticsCaseFeature.cpp
${CEE_CURRENT_LIST_DIR}RicSaveEclipseInputPropertyFeature.cpp
${CEE_CURRENT_LIST_DIR}RicSaveEclipseResultAsInputPropertyExec.cpp

View File

@@ -21,7 +21,6 @@
#include "RimEclipseInputPropertyCollection.h"
#include "RimEclipseInputCase.h"
#include "RimEclipseInputCaseOpm.h"
#include "RiaApplication.h"
#include "RiuMainWindow.h"
@@ -40,18 +39,6 @@ CAF_CMD_SOURCE_INIT(RicAddEclipseInputPropertyFeature, "RicAddEclipseInputProper
//--------------------------------------------------------------------------------------------------
bool RicAddEclipseInputPropertyFeature::isCommandEnabled()
{
RimEclipseInputPropertyCollection* inputProp = selectedInputPropertyCollection();
if (inputProp)
{
RimEclipseInputCaseOpm* inputCaseOpm = NULL;
inputProp->firstAncestorOrThisOfType(inputCaseOpm);
if (inputCaseOpm)
{
return false;
}
}
return selectedInputPropertyCollection() != NULL;
}

View File

@@ -1,115 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016- 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicAddOpmInputPropertyFeature.h"
#include "RiaApplication.h"
#include "RimEclipseInputCaseOpm.h"
#include "RimEclipseInputPropertyCollection.h"
#include "RiuMainWindow.h"
#include "cafSelectionManager.h"
#include <QAction>
#include <QFileDialog>
#include <QFileInfo>
#include <QStringList>
CAF_CMD_SOURCE_INIT(RicAddOpmInputPropertyFeature, "RicAddOpmInputPropertyFeature");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicAddOpmInputPropertyFeature::isCommandEnabled()
{
RimEclipseInputPropertyCollection* inputProp = selectedInputPropertyCollection();
if (inputProp)
{
RimEclipseInputCaseOpm* inputCaseOpm = NULL;
inputProp->firstAncestorOrThisOfType(inputCaseOpm);
if (inputCaseOpm)
{
return true;
}
}
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicAddOpmInputPropertyFeature::onActionTriggered(bool isChecked)
{
RiaApplication* app = RiaApplication::instance();
QString defaultDir = app->lastUsedDialogDirectory("INPUT_FILES");
QStringList fileNames = QFileDialog::getOpenFileNames(NULL, "Select Eclipse Input Property Files", defaultDir, "All Files (*.* *)");
if (fileNames.isEmpty()) return;
// Remember the directory to next time
defaultDir = QFileInfo(fileNames.last()).absolutePath();
app->setLastUsedDialogDirectory("INPUT_FILES", defaultDir);
RimEclipseInputPropertyCollection* inputPropertyCollection = selectedInputPropertyCollection();
if (inputPropertyCollection)
{
addEclipseInputProperty(fileNames, inputPropertyCollection);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicAddOpmInputPropertyFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setText("Add Input Property");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEclipseInputPropertyCollection* RicAddOpmInputPropertyFeature::selectedInputPropertyCollection() const
{
std::vector<RimEclipseInputPropertyCollection*> selection;
caf::SelectionManager::instance()->objectsByType(&selection);
return selection.size() > 0 ? selection[0] : NULL;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicAddOpmInputPropertyFeature::addEclipseInputProperty(const QStringList& fileNames, RimEclipseInputPropertyCollection* inputPropertyCollection)
{
CVF_ASSERT(inputPropertyCollection);
RimEclipseInputCaseOpm* inputCaseOpm = NULL;
inputPropertyCollection->firstAncestorOrThisOfType(inputCaseOpm);
if (inputCaseOpm)
{
inputCaseOpm->appendPropertiesFromStandaloneFiles(fileNames);
}
inputPropertyCollection->updateConnectedEditors();
}

View File

@@ -1,45 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2015- Statoil ASA
// Copyright (C) 2015- Ceetron Solutions 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
#include "cafCmdFeature.h"
class RimEclipseInputPropertyCollection;
class QStringList;
//==================================================================================================
///
//==================================================================================================
class RicAddOpmInputPropertyFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
// Overrides
virtual bool isCommandEnabled();
virtual void onActionTriggered( bool isChecked );
virtual void setupActionLook( QAction* actionToSetup );
private:
RimEclipseInputPropertyCollection* selectedInputPropertyCollection() const;
static void addEclipseInputProperty(const QStringList& fileNames, RimEclipseInputPropertyCollection* inputPropertyCollection);
};

View File

@@ -34,10 +34,7 @@ CAF_CMD_SOURCE_INIT(RicCreateGridCaseGroupFeature, "RicCreateGridCaseGroupFeatur
//--------------------------------------------------------------------------------------------------
bool RicCreateGridCaseGroupFeature::isCommandEnabled()
{
std::vector<RimEclipseCaseCollection*> selection;
caf::SelectionManager::instance()->objectsByType(&selection);
return selection.size() > 0;
return true;
}
//--------------------------------------------------------------------------------------------------

View File

@@ -1,100 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicImportInputEclipseCaseOpmFeature.h"
#include "RiaApplication.h"
#include "RimDefines.h"
#include "RimEclipseCaseCollection.h"
#include "RimEclipseCellColors.h"
#include "RimEclipseInputCaseOpm.h"
#include "RimEclipseView.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RiuMainWindow.h"
#include "cafSelectionManager.h"
#include <QAction>
#include <QFileDialog>
CAF_CMD_SOURCE_INIT(RicImportInputEclipseCaseOpmFeature, "RicImportInputEclipseCaseOpmFeature");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicImportInputEclipseCaseOpmFeature::isCommandEnabled()
{
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicImportInputEclipseCaseOpmFeature::onActionTriggered(bool isChecked)
{
RiaApplication* app = RiaApplication::instance();
QString defaultDir = app->lastUsedDialogDirectory("INPUT_FILES");
QString fileName = QFileDialog::getOpenFileName(RiuMainWindow::instance(), "Import Eclipse Input file", defaultDir, "Eclipse Input Files (*.GRDECL);;All Files (*.*)");
if (fileName.isEmpty()) return;
// Remember the path to next time
app->setLastUsedDialogDirectory("INPUT_FILES", QFileInfo(fileName).absolutePath());
RimProject* proj = app->project();
RimEclipseCaseCollection* analysisModels = proj->activeOilField() ? proj->activeOilField()->analysisModels() : NULL;
if (analysisModels)
{
// This code originates from RiaApplication::openInputEclipseCaseFromFileNames
RimEclipseInputCaseOpm* rimInputReservoir = new RimEclipseInputCaseOpm();
proj->assignCaseIdToCase(rimInputReservoir);
rimInputReservoir->importNewEclipseGridAndProperties(fileName);
analysisModels->cases.push_back(rimInputReservoir);
RimEclipseView* riv = rimInputReservoir->createAndAddReservoirView();
riv->cellResult()->setResultType(RimDefines::INPUT_PROPERTY);
riv->hasUserRequestedAnimation = true;
riv->loadDataAndUpdate();
if (!riv->cellResult()->hasResult())
{
riv->cellResult()->setResultVariable(RimDefines::undefinedResultName());
}
analysisModels->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem(riv->cellResult());
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicImportInputEclipseCaseOpmFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setIcon(QIcon(":/EclipseInput48x48.png"));
actionToSetup->setText("Import Input Eclipse Case (opm-parser) - BETA");
}

View File

@@ -1,39 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafCmdFeature.h"
#include <vector>
//==================================================================================================
///
//==================================================================================================
class RicImportInputEclipseCaseOpmFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
// Overrides
virtual bool isCommandEnabled();
virtual void onActionTriggered( bool isChecked );
virtual void setupActionLook( QAction* actionToSetup );
};

View File

@@ -51,6 +51,8 @@ bool RicSaveEclipseInputPropertyFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicSaveEclipseInputPropertyFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RimEclipseInputProperty* inputProperty = selectedInputProperty();
if (!inputProperty) return;

View File

@@ -47,6 +47,8 @@ bool RicSaveEclipseResultAsInputPropertyFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicSaveEclipseResultAsInputPropertyFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
std::vector<RimEclipseCellColors*> selection;
caf::SelectionManager::instance()->objectsByType(&selection);
if (selection.size() == 1)

View File

@@ -13,6 +13,7 @@ ${CEE_CURRENT_LIST_DIR}RicShowContributingWellsFeature.h
${CEE_CURRENT_LIST_DIR}RicShowContributingWellsFeatureImpl.h
${CEE_CURRENT_LIST_DIR}RicPlotProductionRateFeature.h
${CEE_CURRENT_LIST_DIR}RicSelectViewUI.h
${CEE_CURRENT_LIST_DIR}RicShowTotalAllocationDataFeature.h
)
set (SOURCE_GROUP_SOURCE_FILES
@@ -24,6 +25,7 @@ ${CEE_CURRENT_LIST_DIR}RicShowContributingWellsFeature.cpp
${CEE_CURRENT_LIST_DIR}RicShowContributingWellsFeatureImpl.cpp
${CEE_CURRENT_LIST_DIR}RicPlotProductionRateFeature.cpp
${CEE_CURRENT_LIST_DIR}RicSelectViewUI.cpp
${CEE_CURRENT_LIST_DIR}RicShowTotalAllocationDataFeature.cpp
)
list(APPEND CODE_HEADER_FILES

View File

@@ -0,0 +1,107 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicShowTotalAllocationDataFeature.h"
#include "ApplicationCommands/RicShowPlotDataFeature.h"
#include "RimTotalWellAllocationPlot.h"
#include "RimWellAllocationPlot.h"
#include "cafSelectionManager.h"
#include "cvfAssert.h"
#include <QAction>
#include <set>
CAF_CMD_SOURCE_INIT(RicShowTotalAllocationDataFeature, "RicShowTotalAllocationDataFeature");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicShowTotalAllocationDataFeature::isCommandEnabled()
{
std::set<RimWellAllocationPlot*> wellAllocPlots = RicShowTotalAllocationDataFeature::selectedWellAllocationPlots();
if (wellAllocPlots.size() > 0)
{
return true;
}
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicShowTotalAllocationDataFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
std::set<RimWellAllocationPlot*> wellAllocPlots = RicShowTotalAllocationDataFeature::selectedWellAllocationPlots();
CVF_ASSERT(wellAllocPlots.size() > 0);
for (auto wellAllocPlot : wellAllocPlots)
{
QString txt = wellAllocPlot->description();
txt += "\n";
txt += "\n";
txt += wellAllocPlot->totalWellFlowPlot()->totalAllocationAsText();
QString title = "Total Allocation (" + wellAllocPlot->wellName() + ")";
RicShowPlotDataFeature::showTextWindow(title, txt);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicShowTotalAllocationDataFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setText("Show Total Allocation");
//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)
{
CVF_ASSERT(obj);
RimWellAllocationPlot* parentPlot = nullptr;
obj->firstAncestorOrThisOfType(parentPlot);
if (parentPlot)
{
wellAllocPlots.insert(parentPlot);
}
}
return wellAllocPlots;
}

View File

@@ -0,0 +1,42 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafCmdFeature.h"
#include <set>
class RimWellAllocationPlot;
//==================================================================================================
///
//==================================================================================================
class RicShowTotalAllocationDataFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
// Overrides
virtual bool isCommandEnabled() override;
virtual void onActionTriggered(bool isChecked) override;
virtual void setupActionLook(QAction* actionToSetup) override;
private:
static std::set<RimWellAllocationPlot*> selectedWellAllocationPlots();
};

View File

@@ -23,6 +23,7 @@
#include "RimCalcScript.h"
#include "RiaApplication.h"
#include "RiuMainWindow.h"
#include "cafSelectionManager.h"
#include "cvfAssert.h"
@@ -49,6 +50,9 @@ void RicExecuteScriptFeature::onActionTriggered(bool isChecked)
std::vector<RimCalcScript*> selection = RicScriptFeatureImpl::selectedScripts();
CVF_ASSERT(selection.size() > 0);
RiuMainWindow* mainWindow = RiuMainWindow::instance();
mainWindow->showProcessMonitorDockPanel();
RimCalcScript* calcScript = selection[0];
RiaApplication* app = RiaApplication::instance();

View File

@@ -21,6 +21,7 @@
#include "RimCase.h"
#include "RiaApplication.h"
#include "RiuMainWindow.h"
#include "cafSelectionManager.h"
@@ -74,6 +75,9 @@ void RicExecuteScriptForCasesFeature::slotExecuteScriptForSelectedCases()
QString scriptAbsolutePath = action->data().toString();
RiuMainWindow* mainWindow = RiuMainWindow::instance();
mainWindow->showProcessMonitorDockPanel();
RiaApplication* app = RiaApplication::instance();
QString octavePath = app->octavePath();
if (!octavePath.isEmpty())

View File

@@ -57,6 +57,8 @@ bool RicCopyReferencesToClipboardFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicCopyReferencesToClipboardFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
if (!isAnyCopyableObjectSelected()) return;
std::vector<QString> referenceList;

View File

@@ -117,7 +117,8 @@ void RicPasteEclipseCasesFeature::addCasesToGridCaseGroup(PdmObjectGroup& object
RimEclipseResultCase* eclCase = dynamic_cast<RimEclipseResultCase*>(objectGroup.objects[i]);
if (eclCase)
{
RimEclipseResultCase* eclCaseCopy = dynamic_cast<RimEclipseResultCase*>(eclCase->copyByXmlSerialization(PdmDefaultObjectFactory::instance()));
RimEclipseResultCase* eclCaseCopy = new RimEclipseResultCase();
eclCaseCopy->setCaseInfo(eclCase->caseUserDescription(), eclCase->gridFileName());
resultCases.push_back(eclCaseCopy);
}
}

View File

@@ -21,6 +21,8 @@
#include "RiaApplication.h"
#include "RiuMainWindow.h"
#include "RicPasteFeatureImpl.h"
#include "RimEclipseCase.h"
@@ -83,6 +85,8 @@ void RicPasteEclipseViewsFeature::onActionTriggered(bool isChecked)
std::vector<caf::PdmPointer<RimEclipseView> > eclipseViews;
objectGroup.objectsByType(&eclipseViews);
RimEclipseView* lastViewCopy = nullptr;
// Add cases to case group
for (size_t i = 0; i < eclipseViews.size(); i++)
{
@@ -97,16 +101,18 @@ void RicPasteEclipseViewsFeature::onActionTriggered(bool isChecked)
// Resolve references after reservoir view has been inserted into Rim structures
// Intersections referencing a well path/ simulation well requires this
// TODO: initAfterReadRecursively can probably be removed
rimReservoirView->initAfterReadRecursively();
rimReservoirView->resolveReferencesRecursively();
rimReservoirView->initAfterReadRecursively();
rimReservoirView->loadDataAndUpdate();
caf::PdmDocument::updateUiIconStateRecursively(rimReservoirView);
eclipseCase->updateConnectedEditors();
lastViewCopy = rimReservoirView;
}
if (lastViewCopy) RiuMainWindow::instance()->selectAsCurrentItem(lastViewCopy);
}
//--------------------------------------------------------------------------------------------------

View File

@@ -21,6 +21,8 @@
#include "RicPasteFeatureImpl.h"
#include "RiuMainWindow.h"
#include "RimGeoMechView.h"
#include "RimGeoMechCase.h"
@@ -77,6 +79,8 @@ void RicPasteGeoMechViewsFeature::onActionTriggered(bool isChecked)
std::vector<caf::PdmPointer<RimGeoMechView> > geomViews;
objectGroup.objectsByType(&geomViews);
RimGeoMechView* lastViewCopy = nullptr;
// Add cases to case group
for (size_t i = 0; i < geomViews.size(); i++)
{
@@ -89,15 +93,19 @@ void RicPasteGeoMechViewsFeature::onActionTriggered(bool isChecked)
// Resolve references after reservoir view has been inserted into Rim structures
// Intersections referencing a well path requires this
rimReservoirView->initAfterReadRecursively();
rimReservoirView->resolveReferencesRecursively();
rimReservoirView->initAfterReadRecursively();
caf::PdmDocument::updateUiIconStateRecursively(rimReservoirView);
rimReservoirView->loadDataAndUpdate();
geomCase->updateConnectedEditors();
lastViewCopy = rimReservoirView;
}
if (lastViewCopy) RiuMainWindow::instance()->selectAsCurrentItem(lastViewCopy);
}
//--------------------------------------------------------------------------------------------------

View File

@@ -158,6 +158,26 @@ void RicCloseCaseFeature::deleteEclipseCase(RimEclipseCase* eclipseCase)
}
else
{
RimIdenticalGridCaseGroup* caseGroup = caseCollection->parentCaseGroup();
if (caseGroup)
{
// When deleting the last source case for statistics, remove any views on statistics cases.
// This is done because the views do not work well
if (caseGroup->caseCollection()->reservoirs.size() == 1)
{
std::vector<caf::PdmObjectHandle*> children;
caseGroup->statisticsCaseCollection()->reservoirs.childObjects(&children);
for (size_t i = children.size(); i-- > 0;)
{
caf::PdmObjectHandle* obj = children[i];
delete obj;
caseGroup->statisticsCaseCollection()->reservoirs.erase(i);
}
caseGroup->statisticsCaseCollection()->uiCapability()->updateConnectedEditors();
}
}
removeCaseFromAllGroups(eclipseCase);
}
}

View File

@@ -57,6 +57,8 @@ bool RicExportFaultsFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicExportFaultsFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
std::vector<RimFault*> selectedFaults;
caf::SelectionManager::instance()->objectsByType(&selectedFaults);
@@ -70,6 +72,11 @@ void RicExportFaultsFeature::onActionTriggered(bool isChecked)
QString selectedDir = QFileDialog::getExistingDirectory(NULL, tr("Select Directory"), defaultDir);
if (selectedDir.isNull()) {
// Stop if folder selection was cancelled.
return;
}
for (RimFault* rimFault : selectedFaults)
{
RimEclipseCase* eclCase = nullptr;
@@ -106,6 +113,75 @@ void RicExportFaultsFeature::setupActionLook(QAction* actionToSetup)
actionToSetup->setIcon(QIcon(":/Save.png"));
}
//--------------------------------------------------------------------------------------------------
/// Order FaultCellAndFace by i, j, face then k.
//--------------------------------------------------------------------------------------------------
bool RicExportFaultsFeature::faultOrdering(FaultCellAndFace first, FaultCellAndFace second)
{
size_t i1, i2, j1, j2, k1, k2;
cvf::StructGridInterface::FaceType f1, f2;
std::tie(i1, j1, k1, f1) = first;
std::tie(i2, j2, k2, f2) = second;
if (i1 == i2)
{
if (j1 == j2)
{
if (f1 == f2)
{
return k1 < k2;
}
else
{
return f1 < f2;
}
}
else
{
return j1 < j2;
}
}
else
{
return i1 < i2;
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RicExportFaultsFeature::faceText(cvf::StructGridInterface::FaceType faceType)
{
switch (faceType)
{
case cvf::StructGridInterface::POS_I: return QString(" I");
case cvf::StructGridInterface::NEG_I: return QString("-I");
case cvf::StructGridInterface::POS_J: return QString(" J");
case cvf::StructGridInterface::NEG_J: return QString("-J");
case cvf::StructGridInterface::POS_K: return QString(" K");
case cvf::StructGridInterface::NEG_K: return QString("-K");
default: CVF_ASSERT(false);
}
return "";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportFaultsFeature::writeLine(QTextStream & stream, QString faultName, size_t i, size_t j, size_t startK, size_t endK, cvf::StructGridInterface::FaceType faceType)
{
// Convert indices to eclipse format
i++;
j++;
startK++;
endK++;
stream << "'" << faultName << "'" << " " << i << " " << i
<< " " << j << " " << j
<< " " << startK << " " << endK
<< " " << RicExportFaultsFeature::faceText(faceType) << " / ";
stream << endl;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -126,33 +202,55 @@ void RicExportFaultsFeature::saveFault(QString completeFilename, const RigMainGr
stream << "-- Name I1 I2 J1 J2 K1 K2 Face ( I/J/K )" << endl;
// 'NAME' 1 1 1 1 1 2 J /
for (const RigFault::FaultFace& fface: faultFaces)
{
size_t i1, j1, k1, i2, j2, k2;
std::vector<FaultCellAndFace> faultCellAndFaces;
bool ok = mainGrid->ijkFromCellIndex(fface.m_nativeReservoirCellIndex, &i1, &j1, &k1);
for (const RigFault::FaultFace& faultCellAndFace : faultFaces)
{
size_t i, j, k;
bool ok = mainGrid->ijkFromCellIndex(faultCellAndFace.m_nativeReservoirCellIndex, &i, &j, &k);
if (!ok) continue;
ok = mainGrid->ijkFromCellIndex(fface.m_oppositeReservoirCellIndex, &i2, &j2, &k2);
QString faceText;
switch (fface.m_nativeFace)
{
case cvf::StructGridInterface::POS_I: faceText = " I"; break;
case cvf::StructGridInterface::NEG_I: faceText = "-I"; break;
case cvf::StructGridInterface::POS_J: faceText = " J"; break;
case cvf::StructGridInterface::NEG_J: faceText = "-J"; break;
case cvf::StructGridInterface::POS_K: faceText = " K"; break;
case cvf::StructGridInterface::NEG_K: faceText = "-K"; break;
}
stream << "'" << faultName << "'" << " " << i1 << " " << i2
<< " " << j1 << " " << j2
<< " " << k1 << " " << k2
<< " " << faceText << " / ";
stream << endl ;
faultCellAndFaces.push_back(std::make_tuple(i, j, k, faultCellAndFace.m_nativeFace));
}
stream << "/" << endl;
// Sort order: i, j, face then k.
std::sort(faultCellAndFaces.begin(), faultCellAndFaces.end(), RicExportFaultsFeature::faultOrdering);
}
size_t lastI = std::numeric_limits<size_t>::max();
size_t lastJ = std::numeric_limits<size_t>::max();
size_t lastK = std::numeric_limits<size_t>::max();
size_t startK = std::numeric_limits<size_t>::max();
cvf::StructGridInterface::FaceType lastFaceType = cvf::StructGridInterface::FaceType::NO_FACE;
for (const FaultCellAndFace &faultCellAndFace : faultCellAndFaces)
{
size_t i, j, k;
cvf::StructGridInterface::FaceType faceType;
std::tie(i, j, k, faceType) = faultCellAndFace;
if (i != lastI || j != lastJ || lastFaceType != faceType || k != lastK+1)
{
// No fault should have no face
if (lastFaceType != cvf::StructGridInterface::FaceType::NO_FACE)
{
RicExportFaultsFeature::writeLine(stream, faultName, lastI, lastJ, startK, lastK, lastFaceType);
}
lastI = i;
lastJ = j;
lastK = k;
lastFaceType = faceType;
startK = k;
}
else
{
lastK = k;
}
}
// No fault should have no face
if (lastFaceType != cvf::StructGridInterface::FaceType::NO_FACE)
{
RicExportFaultsFeature::writeLine(stream, faultName, lastI, lastJ, startK, lastK, lastFaceType);
}
stream << "/" << endl;
}

View File

@@ -26,6 +26,8 @@
class RigMainGrid;
typedef std::tuple<size_t, size_t, size_t, cvf::StructGridInterface::FaceType> FaultCellAndFace;
//==================================================================================================
///
//==================================================================================================
@@ -41,5 +43,8 @@ protected:
private:
static void saveFault(QString completeFilename, const RigMainGrid* mainGrid, const std::vector<RigFault::FaultFace>& faultFaces, QString faultName);
static bool faultOrdering(FaultCellAndFace first, FaultCellAndFace second);
static QString faceText(cvf::StructGridInterface::FaceType faceType);
static void writeLine(QTextStream &stream, QString faultName, size_t i, size_t j, size_t startK, size_t endK, cvf::StructGridInterface::FaceType faceType);
};

View File

@@ -68,6 +68,8 @@ bool RicExportMultipleSnapshotsFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicExportMultipleSnapshotsFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RimProject* proj = RiaApplication::instance()->project();
if (proj)
@@ -152,10 +154,8 @@ void RicExportMultipleSnapshotsFeature::exportMultipleSnapshots(const QString& f
copyOfGeoMechView->setGeoMechCase(geomCase);
// Resolve references after reservoir view has been inserted into Rim structures
// Intersections referencing a well path/ simulation well requires this
// TODO: initAfterReadRecursively can probably be removed
copyOfGeoMechView->initAfterReadRecursively();
copyOfGeoMechView->resolveReferencesRecursively();
copyOfGeoMechView->initAfterReadRecursively();
copyOfGeoMechView->loadDataAndUpdate();

View File

@@ -54,6 +54,8 @@ bool RicExportToLasFileFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicExportToLasFileFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return;
std::vector<RimWellLogCurve*> curves = RicWellLogPlotCurveFeatureImpl::selectedWellLogCurves();

View File

@@ -26,6 +26,7 @@
#include "RimView.h"
#include "RiuMainWindow.h"
#include "RiaLogging.h"
#include "cafSelectionManager.h"
@@ -36,9 +37,9 @@ CAF_CMD_SOURCE_INIT(RicNewViewFeature, "RicNewViewFeature");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewViewFeature::addReservoirView()
void RicNewViewFeature::addReservoirView(RimEclipseCase* eclipseCase, RimGeoMechCase* geomCase)
{
RimView* newView = createReservoirView();
RimView* newView = createReservoirView(eclipseCase, geomCase);
if (newView)
{
@@ -62,7 +63,18 @@ bool RicNewViewFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicNewViewFeature::onActionTriggered(bool isChecked)
{
addReservoirView();
// Establish type of selected object
RimEclipseCase* eclipseCase = selectedEclipseCase();
RimGeoMechCase* geomCase = selectedGeoMechCase();
RimGeoMechView* geoMechView = selectedGeoMechView();
RimEclipseView* reservoirView = selectedEclipseView();
// Find case to insert into
if (geoMechView) geomCase = geoMechView->geoMechCase();
if (reservoirView) eclipseCase = reservoirView->eclipseCase();
addReservoirView(eclipseCase, geomCase);
}
//--------------------------------------------------------------------------------------------------
@@ -77,18 +89,8 @@ void RicNewViewFeature::setupActionLook(QAction* actionToSetup)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimView* RicNewViewFeature::createReservoirView()
RimView* RicNewViewFeature::createReservoirView(RimEclipseCase* eclipseCase, RimGeoMechCase* geomCase)
{
// Establish type of selected object
RimEclipseCase* eclipseCase = selectedEclipseCase();
RimGeoMechCase* geomCase = selectedGeoMechCase();
RimGeoMechView* geoMechView = selectedGeoMechView();
RimEclipseView* reservoirView = selectedEclipseView();
// Find case to insert into
if (geoMechView) geomCase = geoMechView->geoMechCase();
if (reservoirView) eclipseCase = reservoirView->eclipseCase();
RimView* insertedView = NULL;
if (eclipseCase)

View File

@@ -35,7 +35,7 @@ class RicNewViewFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT;
public:
static void addReservoirView();
static void addReservoirView(RimEclipseCase* eclipseCase, RimGeoMechCase* geomCase);
protected:
// Overrides
@@ -44,7 +44,7 @@ protected:
virtual void setupActionLook( QAction* actionToSetup );
private:
static RimView* createReservoirView();
static RimView* createReservoirView(RimEclipseCase* eclipseCase, RimGeoMechCase* geomCase);
static RimEclipseCase* selectedEclipseCase();
static RimGeoMechCase* selectedGeoMechCase();

View File

@@ -19,6 +19,7 @@
#include "RicSnapshotViewToClipboardFeature.h"
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RimMainPlotCollection.h"
#include "RimProject.h"
@@ -51,6 +52,8 @@ bool RicSnapshotViewToClipboardFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicSnapshotViewToClipboardFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RimViewWindow* viewWindow = RiaApplication::activeViewWindow();
if (viewWindow)
@@ -119,6 +122,17 @@ void RicSnapshotViewToFileFeature::onActionTriggered(bool isChecked)
RiaApplication* app = RiaApplication::instance();
RimProject* proj = app->project();
// Get active view window before displaying the file selection dialog
// If this is done after the file save dialog is displayed (and closed)
// app->activeViewWindow() returns NULL on Linux
RimViewWindow* viewWindow = app->activeViewWindow();
if (!viewWindow)
{
RiaLogging::error("No view window is available, nothing to do");
return;
}
QString startPath;
if (!proj->fileName().isEmpty())
{
@@ -141,7 +155,6 @@ void RicSnapshotViewToFileFeature::onActionTriggered(bool isChecked)
// Remember the directory to next time
app->setLastUsedDialogDirectory("IMAGE_SNAPSHOT", QFileInfo(fileName).absolutePath());
RimViewWindow* viewWindow = app->activeViewWindow();
RicSnapshotViewToFileFeature::saveSnapshotAs(fileName, viewWindow);
}

View File

@@ -56,6 +56,8 @@ bool RicAsciiExportSummaryPlotFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicAsciiExportSummaryPlotFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RiaApplication* app = RiaApplication::instance();
QString projectFolder = app->currentProjectPath();

View File

@@ -53,6 +53,8 @@ bool RicViewZoomAllFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicViewZoomAllFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
QWidget* topLevelWidget = RiaApplication::activeWindow();
if (dynamic_cast<RiuMainWindow*>(topLevelWidget))

View File

@@ -54,6 +54,8 @@ bool RicAsciiExportWellLogPlotFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicAsciiExportWellLogPlotFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RiaApplication* app = RiaApplication::instance();
QString projectFolder = app->currentProjectPath();

View File

@@ -19,7 +19,6 @@ ${CEE_CURRENT_LIST_DIR}RifReaderInterface.h
${CEE_CURRENT_LIST_DIR}RifReaderMockModel.h
${CEE_CURRENT_LIST_DIR}RifReaderSettings.h
${CEE_CURRENT_LIST_DIR}RifEclipseSummaryAddress.h
${CEE_CURRENT_LIST_DIR}RifReaderOpmParserInput.h
${CEE_CURRENT_LIST_DIR}RifEclipseWellCompletionExporter.h
${CEE_CURRENT_LIST_DIR}RifEclipseExportTools.h
)
@@ -39,7 +38,6 @@ ${CEE_CURRENT_LIST_DIR}RifReaderInterface.cpp
${CEE_CURRENT_LIST_DIR}RifReaderMockModel.cpp
${CEE_CURRENT_LIST_DIR}RifReaderSettings.cpp
${CEE_CURRENT_LIST_DIR}RifEclipseSummaryAddress.cpp
${CEE_CURRENT_LIST_DIR}RifReaderOpmParserInput.cpp
${CEE_CURRENT_LIST_DIR}RifEclipseWellCompletionExporter.cpp
${CEE_CURRENT_LIST_DIR}RifEclipseExportTools.cpp
)

View File

@@ -649,7 +649,7 @@ void RifEclipseInputFileTools::parseAndReadFaults(const QString& fileName, cvf::
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifEclipseInputFileTools::readFaultsInGridSection(const QString& fileName, cvf::Collection<RigFault>* faults, std::vector<QString>* filenamesWithFaults)
void RifEclipseInputFileTools::readFaultsInGridSection(const QString& fileName, cvf::Collection<RigFault>* faults, std::vector<QString>* filenamesWithFaults, const QString& faultIncludeFileAbsolutePathPrefix)
{
QFile data(fileName);
if (!data.open(QFile::ReadOnly))
@@ -669,7 +669,7 @@ void RifEclipseInputFileTools::readFaultsInGridSection(const QString& fileName,
std::vector< std::pair<QString, QString> > pathAliasDefinitions;
parseAndReadPathAliasKeyword(fileName, &pathAliasDefinitions);
readFaultsAndParseIncludeStatementsRecursively(data, gridPos, pathAliasDefinitions, faults, filenamesWithFaults, &isEditKeywordDetected);
readFaultsAndParseIncludeStatementsRecursively(data, gridPos, pathAliasDefinitions, faults, filenamesWithFaults, &isEditKeywordDetected, faultIncludeFileAbsolutePathPrefix);
}
@@ -758,7 +758,8 @@ bool RifEclipseInputFileTools::readFaultsAndParseIncludeStatementsRecursively(
const std::vector< std::pair<QString, QString> >& pathAliasDefinitions,
cvf::Collection<RigFault>* faults,
std::vector<QString>* filenamesWithFaults,
bool* isEditKeywordDetected)
bool* isEditKeywordDetected,
const QString& faultIncludeFileAbsolutePathPrefix)
{
QString line;
@@ -819,6 +820,14 @@ bool RifEclipseInputFileTools::readFaultsAndParseIncludeStatementsRecursively(
includeFilename.replace(textToReplace, entry.second);
}
#ifdef WIN32
if (includeFilename.startsWith('/'))
{
// Absolute UNIX path, prefix on Windows
includeFilename = faultIncludeFileAbsolutePathPrefix + includeFilename;
}
#endif
QFileInfo fi(currentFileFolder, includeFilename);
if (fi.exists())
{
@@ -828,7 +837,7 @@ bool RifEclipseInputFileTools::readFaultsAndParseIncludeStatementsRecursively(
{
//qDebug() << "Found include statement, and start parsing of\n " << absoluteFilename;
if (!readFaultsAndParseIncludeStatementsRecursively(includeFile, 0, pathAliasDefinitions, faults, filenamesWithFaults, isEditKeywordDetected))
if (!readFaultsAndParseIncludeStatementsRecursively(includeFile, 0, pathAliasDefinitions, faults, filenamesWithFaults, isEditKeywordDetected, faultIncludeFileAbsolutePathPrefix))
{
qDebug() << "Error when parsing include file : " << absoluteFilename;
}

View File

@@ -65,7 +65,7 @@ public:
static std::map<QString, QString> readProperties(const QString& fileName, RigEclipseCaseData* eclipseCase);
static bool readProperty (const QString& fileName, RigEclipseCaseData* eclipseCase, const QString& eclipseKeyWord, const QString& resultName );
static void readFaultsInGridSection(const QString& fileName, cvf::Collection<RigFault>* faults, std::vector<QString>* filenamesWithFaults);
static void readFaultsInGridSection(const QString& fileName, cvf::Collection<RigFault>* faults, std::vector<QString>* filenamesWithFaults, const QString& faultIncludeFileAbsolutePathPrefix);
static void readFaults(const QString& fileName, const std::vector< RifKeywordAndFilePos >& fileKeywords, cvf::Collection<RigFault>* faults);
static void parseAndReadFaults(const QString& fileName, cvf::Collection<RigFault>* faults);
@@ -83,7 +83,8 @@ public:
const std::vector< std::pair<QString, QString> >& pathAliasDefinitions,
cvf::Collection<RigFault>* faults,
std::vector<QString>* filenamesWithFaults,
bool* isEditKeywordDetected);
bool* isEditKeywordDetected,
const QString& faultIncludeFileAbsolutePathPrefix);
static cvf::StructGridInterface::FaceEnum faceEnumFromText(const QString& faceString);

View File

@@ -151,27 +151,27 @@ void RifEclipseOutputFileTools::timeSteps(ecl_file_type* ecl_file, std::vector<Q
{
ecl_kw_type* kwINTEHEAD = ecl_file_iget_named_kw(ecl_file, INTEHEAD_KW, i);
CVF_ASSERT(kwINTEHEAD);
if (kwINTEHEAD)
int day = 0;
int month = 0;
int year = 0;
getDayMonthYear(kwINTEHEAD, &day, &month, &year);
QDateTime reportDateTime(QDate(year, month, day));
CVF_ASSERT(reportDateTime.isValid());
double dayFraction = dayFractions[i];
int milliseconds = static_cast<int>(dayFraction * 24.0 * 60.0 * 60.0 * 1000.0);
int seconds = milliseconds % 1000;
milliseconds -= seconds * 1000;
QTime time(0, 0);
time = time.addSecs(seconds);
time = time.addMSecs(milliseconds);
reportDateTime.setTime(time);
if (std::find(timeSteps->begin(), timeSteps->end(), reportDateTime) == timeSteps->end())
{
int day = 0;
int month = 0;
int year = 0;
getDayMonthYear(kwINTEHEAD, &day, &month, &year);
QDateTime reportDateTime(QDate(year, month, day));
CVF_ASSERT(reportDateTime.isValid());
double dayFraction = dayFractions[i];
int seconds = static_cast<int>(dayFraction * 24.0 * 60.0 * 60.0);
QTime time(0, 0);
time = time.addSecs(seconds);
reportDateTime.setTime(time);
if (std::find(timeSteps->begin(), timeSteps->end(), reportDateTime) == timeSteps->end())
{
timeSteps->push_back(reportDateTime);
}
timeSteps->push_back(reportDateTime);
}
}
}

View File

@@ -24,7 +24,6 @@
#include "RifEclipseOutputFileTools.h"
#include "RifEclipseRestartFilesetAccess.h"
#include "RifEclipseUnifiedRestartFileAccess.h"
#include "RifReaderOpmParserInput.h"
#include "RigActiveCellInfo.h"
#include "RigCaseCellResultsData.h"
@@ -391,7 +390,6 @@ bool RifReaderEclipseOutput::open(const QString& fileName, RigEclipseCaseData* e
{
cvf::Collection<RigFault> faults;
//importFaultsOpmParser(fileSet, &faults);
importFaults(fileSet, &faults);
RigMainGrid* mainGrid = eclipseCase->mainGrid();
@@ -438,20 +436,6 @@ bool RifReaderEclipseOutput::open(const QString& fileName, RigEclipseCaseData* e
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifReaderEclipseOutput::importFaultsOpmParser(const QStringList& fileSet, cvf::Collection<RigFault>* faults) const
{
foreach(QString fname, fileSet)
{
if (fname.endsWith(".DATA"))
{
RifReaderOpmParserInput::readFaults(fname, faults);
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -473,7 +457,7 @@ void RifReaderEclipseOutput::importFaults(const QStringList& fileSet, cvf::Colle
if (fname.endsWith(".DATA"))
{
std::vector<QString> filenamesWithFaults;
RifEclipseInputFileTools::readFaultsInGridSection(fname, faults, &filenamesWithFaults);
RifEclipseInputFileTools::readFaultsInGridSection(fname, faults, &filenamesWithFaults, faultIncludeFileAbsolutePathPrefix());
std::sort(filenamesWithFaults.begin(), filenamesWithFaults.end());
std::vector<QString>::iterator last = std::unique(filenamesWithFaults.begin(), filenamesWithFaults.end());
@@ -746,7 +730,12 @@ void RifReaderEclipseOutput::buildMetaData()
staticDate.push_back(m_timeSteps.front());
}
std::vector<int> reportNumbers = m_dynamicResultsAccess->reportNumbers();
std::vector<int> reportNumbers;
if (m_dynamicResultsAccess.notNull())
{
reportNumbers = m_dynamicResultsAccess->reportNumbers();
}
if ( reportNumbers.size() > 0 )
{
staticReportNumber.push_back(reportNumbers.front());

View File

@@ -71,7 +71,6 @@ private:
static RigWellResultPoint createWellResultPoint(const RigGridBase* grid, const well_conn_type* ert_connection, int ertBranchId, int ertSegmentId, const char* wellName);
void importFaultsOpmParser(const QStringList& fileSet, cvf::Collection<RigFault>* faults) const;
void importFaults(const QStringList& fileSet, cvf::Collection<RigFault>* faults);

View File

@@ -67,3 +67,13 @@ bool RifReaderInterface::isNNCsEnabled()
return false;
}
const QString RifReaderInterface::faultIncludeFileAbsolutePathPrefix()
{
if (m_settings.notNull())
{
return m_settings->faultIncludeFileAbsolutePathPrefix;
}
return QString();
}

View File

@@ -59,6 +59,7 @@ public:
bool isFaultImportEnabled();
bool isImportOfCompleteMswDataEnabled();
bool isNNCsEnabled();
const QString faultIncludeFileAbsolutePathPrefix();
virtual bool open(const QString& fileName, RigEclipseCaseData* eclipseCase) = 0;
virtual void close() = 0;

View File

@@ -1,618 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RifReaderOpmParserInput.h"
#include "RifReaderEclipseOutput.h"
#include "RigCaseCellResultsData.h"
#include "RigEclipseCaseData.h"
#include "RigMainGrid.h"
#include "RimEclipseInputCaseOpm.h"
#include "RimEclipseInputProperty.h"
#include "RimEclipseInputPropertyCollection.h"
#include "RiuMainWindow.h"
#include "RiuProcessMonitor.h"
#include "cafProgressInfo.h"
#include "cvfBase.h"
#include "opm/parser/eclipse/Deck/DeckItem.hpp"
#include "opm/parser/eclipse/Deck/Section.hpp"
#include "opm/parser/eclipse/Parser/MessageContainer.hpp"
#include "opm/parser/eclipse/Parser/ParseContext.hpp"
#include "opm/parser/eclipse/Parser/Parser.hpp"
#include "../generated-source/include/opm/parser/eclipse/Parser/ParserKeywords/F.hpp"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifReaderOpmParserInput::importGridPropertiesFaults(const QString& fileName, RigEclipseCaseData* caseData)
{
RiuMainWindow::instance()->processMonitor()->addStringToLog(QString("\nStarted reading of grid and properties from file : " + fileName + "\n"));
{
std::shared_ptr<const Opm::EclipseGrid> eclipseGrid;
std::string errorMessage;
std::shared_ptr<Opm::Deck> deck;
try
{
Opm::Parser parser;
// A default ParseContext will set up all parsing errors to throw exceptions
Opm::ParseContext parseContext;
RifReaderOpmParserInput::initUsingWarnings(&parseContext);
deck = parser.parseFile(fileName.toStdString(), parseContext);
if (deck)
{
eclipseGrid = Opm::Parser::parseGrid(*deck, parseContext);
if (eclipseGrid && eclipseGrid->c_ptr())
{
RifReaderEclipseOutput::transferGeometry(eclipseGrid->c_ptr(), caseData);
}
else
{
throw std::invalid_argument("No valid 3D grid detected");
}
Opm::TableManager tableManager(*deck);
Opm::Eclipse3DProperties properties(*deck, tableManager, *eclipseGrid);
std::vector<std::string> predefKeywords = RifReaderOpmParserInput::knownPropertyKeywords();
for (auto keyword : predefKeywords)
{
if (properties.supportsGridProperty(keyword))
{
if (properties.hasDeckDoubleGridProperty(keyword))
{
auto allValues = properties.getDoubleGridProperty(keyword).getData();
QString newResultName = caseData->results(RifReaderInterface::MATRIX_RESULTS)->makeResultNameUnique(QString::fromStdString(keyword));
size_t resultIndex = RifReaderOpmParserPropertyReader::findOrCreateResult(newResultName, caseData);
if (resultIndex != cvf::UNDEFINED_SIZE_T)
{
std::vector< std::vector<double> >& newPropertyData = caseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(resultIndex);
newPropertyData.push_back(allValues);
}
}
else if (properties.hasDeckIntGridProperty(keyword))
{
auto intValues = properties.getIntGridProperty(keyword).getData();
QString newResultName = caseData->results(RifReaderInterface::MATRIX_RESULTS)->makeResultNameUnique(QString::fromStdString(keyword));
size_t resultIndex = RifReaderOpmParserPropertyReader::findOrCreateResult(newResultName, caseData);
if (resultIndex != cvf::UNDEFINED_SIZE_T)
{
std::vector< std::vector<double> >& newPropertyData = caseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(resultIndex);
std::vector<double> doubleValues;
doubleValues.insert(std::end(doubleValues), std::begin(intValues), std::end(intValues));
newPropertyData.push_back(doubleValues);
}
}
}
if (caseData->results(RifReaderInterface::MATRIX_RESULTS)->resultCount() == 0)
{
// Eclipse3DProperties was not able to extract results. This is often the case when reading a GRDECL file directly
// Parse for known keywords by analyzing the present keywords in the deck
RifReaderOpmParserPropertyReader propertyReader(deck);
std::set<std::string> keywordsOnFile = propertyReader.keywords();
std::vector<std::string> predefKeywords = RifReaderOpmParserInput::knownPropertyKeywords();
for (auto keyword : predefKeywords)
{
if (std::find(keywordsOnFile.begin(), keywordsOnFile.end(), keyword) != keywordsOnFile.end())
{
QString newResultName = caseData->results(RifReaderInterface::MATRIX_RESULTS)->makeResultNameUnique(QString::fromStdString(keyword));
propertyReader.copyPropertyToCaseData(keyword, caseData, newResultName);
}
}
}
if (caseData->mainGrid())
{
cvf::Collection<RigFault> faults;
importFaults(*deck, &faults);
if (faults.size() > 0)
{
caseData->mainGrid()->setFaults(faults);
}
}
}
}
}
catch (std::exception& e)
{
errorMessage = e.what();
}
catch (...)
{
errorMessage = "Unknown exception throwm from Opm::Parser";
}
if (deck)
{
const Opm::MessageContainer& messages = deck->getMessageContainer();
if (messages.size() > 0)
{
RiuMainWindow::instance()->processMonitor()->addStringToLog("\n\nLog messages from Deck : \n");
}
for (auto m : messages)
{
RiuMainWindow::instance()->processMonitor()->addStringToLog(" Deck : " + QString::fromStdString(m.message) + "\n");
}
}
if (eclipseGrid)
{
const Opm::MessageContainer& messages = eclipseGrid->getMessageContainer();
if (messages.size() > 0)
{
RiuMainWindow::instance()->processMonitor()->addStringToLog("\n\nLog messages from EclipseGrid : \n");
}
for (auto m : messages)
{
RiuMainWindow::instance()->processMonitor()->addStringToLog(" EclipseGrid :" + QString::fromStdString(m.message) + "\n");
}
}
if (errorMessage.size() > 0)
{
RiuMainWindow::instance()->processMonitor()->addStringToLog("\n\nError messages : \n");
RiuMainWindow::instance()->processMonitor()->addStringToLog(" " + QString::fromStdString(errorMessage) + "\n");
RiuMainWindow::instance()->processMonitor()->addStringToLog(QString("Failed reading of grid and properties from file : " + fileName + "\n"));
}
else
{
RiuMainWindow::instance()->processMonitor()->addStringToLog(QString("Completed reading of grid and properties from file : " + fileName + "\n"));
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifReaderOpmParserInput::readFaults(const QString& fileName, cvf::Collection<RigFault>* faults)
{
{
std::string errorMessage;
try
{
Opm::Parser parser;
// A default ParseContext will set up all parsing errors to throw exceptions
Opm::ParseContext parseContext;
RifReaderOpmParserInput::initUsingWarnings(&parseContext);
auto deckptr = parser.parseFile(fileName.toStdString(), parseContext);
const Opm::Deck& deck = *deckptr;
importFaults(deck, faults);
}
catch (std::exception& e)
{
errorMessage = e.what();
}
catch (...)
{
errorMessage = "Unknown exception throwm from Opm::Parser";
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifReaderOpmParserInput::importFaults(const Opm::Deck& deck, cvf::Collection<RigFault>* faults)
{
{
std::string errorMessage;
try
{
RigFault* fault = NULL;
// The following is based on Opm::FaultCollection
// Not possible to use this class, as the logic in ResInsight handles IJK-values instead
// of cell indices
const auto& faultKeywords = deck.getKeywordList<Opm::ParserKeywords::FAULTS>();
for (auto keyword_iter = faultKeywords.begin(); keyword_iter != faultKeywords.end(); ++keyword_iter) {
const auto& faultsKeyword = *keyword_iter;
for (auto iter = faultsKeyword->begin(); iter != faultsKeyword->end(); ++iter) {
const auto& faultRecord = *iter;
const std::string& faultName = faultRecord.getItem(0).get< std::string >(0);
int I1 = faultRecord.getItem(1).get< int >(0) - 1;
int I2 = faultRecord.getItem(2).get< int >(0) - 1;
int J1 = faultRecord.getItem(3).get< int >(0) - 1;
int J2 = faultRecord.getItem(4).get< int >(0) - 1;
int K1 = faultRecord.getItem(5).get< int >(0) - 1;
int K2 = faultRecord.getItem(6).get< int >(0) - 1;
const std::string& faceText = faultRecord.getItem(7).get< std::string >(0);
cvf::StructGridInterface::FaceEnum cellFaceEnum = RifReaderOpmParserInput::faceEnumFromText(QString::fromStdString(faceText));
QString name = QString::fromStdString(faultName);
// Guard against invalid cell ranges by limiting lowest possible range value to zero
cvf::CellRange cellrange(CVF_MAX(I1, 0), CVF_MAX(J1, 0), CVF_MAX(K1, 0), CVF_MAX(I2, 0), CVF_MAX(J2, 0), CVF_MAX(K2, 0));
if (!(fault && fault->name() == name))
{
if (findFaultByName(*faults, name) == cvf::UNDEFINED_SIZE_T)
{
RigFault* newFault = new RigFault;
newFault->setName(name);
faults->push_back(newFault);
}
size_t faultIndex = findFaultByName(*faults, name);
if (faultIndex == cvf::UNDEFINED_SIZE_T)
{
CVF_ASSERT(faultIndex != cvf::UNDEFINED_SIZE_T);
continue;
}
fault = faults->at(faultIndex);
}
CVF_ASSERT(fault);
fault->addCellRangeForFace(cellFaceEnum, cellrange);
}
}
}
catch (std::exception& e)
{
errorMessage = e.what();
}
catch (...)
{
errorMessage = "Unknown exception throwm from Opm::Parser";
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<std::string> RifReaderOpmParserInput::knownPropertyKeywords()
{
std::vector<std::string> knownKeywords;
knownKeywords.push_back("AQUIFERA");
knownKeywords.push_back("ACTNUM");
knownKeywords.push_back("EQLNUM");
knownKeywords.push_back("FIPNUM");
knownKeywords.push_back("KRG");
knownKeywords.push_back("KRGR");
knownKeywords.push_back("KRO");
knownKeywords.push_back("KRORG");
knownKeywords.push_back("KRORW");
knownKeywords.push_back("KRW");
knownKeywords.push_back("KRWR");
knownKeywords.push_back("MINPVV");
knownKeywords.push_back("MULTPV");
knownKeywords.push_back("MULTX");
knownKeywords.push_back("MULTX-");
knownKeywords.push_back("MULTY");
knownKeywords.push_back("MULTY-");
knownKeywords.push_back("MULTZ");
knownKeywords.push_back("NTG");
knownKeywords.push_back("PCG");
knownKeywords.push_back("PCW");
knownKeywords.push_back("PERMX");
knownKeywords.push_back("PERMY");
knownKeywords.push_back("PERMZ");
knownKeywords.push_back("PORO");
knownKeywords.push_back("PVTNUM");
knownKeywords.push_back("SATNUM");
knownKeywords.push_back("SGCR");
knownKeywords.push_back("SGL");
knownKeywords.push_back("SGLPC");
knownKeywords.push_back("SGU");
knownKeywords.push_back("SGWCR");
knownKeywords.push_back("SWATINIT");
knownKeywords.push_back("SWCR");
knownKeywords.push_back("SWGCR");
knownKeywords.push_back("SWL");
knownKeywords.push_back("SWLPC");
knownKeywords.push_back("TRANX");
knownKeywords.push_back("TRANY");
knownKeywords.push_back("TRANZ");
return knownKeywords;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<std::string> RifReaderOpmParserInput::allParserConfigKeys()
{
std::vector<std::string> configKeys;
configKeys.push_back(Opm::ParseContext::PARSE_UNKNOWN_KEYWORD);
configKeys.push_back(Opm::ParseContext::PARSE_RANDOM_TEXT);
configKeys.push_back(Opm::ParseContext::PARSE_RANDOM_SLASH);
configKeys.push_back(Opm::ParseContext::PARSE_MISSING_DIMS_KEYWORD);
configKeys.push_back(Opm::ParseContext::PARSE_EXTRA_DATA);
configKeys.push_back(Opm::ParseContext::PARSE_MISSING_INCLUDE);
configKeys.push_back(Opm::ParseContext::UNSUPPORTED_SCHEDULE_GEO_MODIFIER);
configKeys.push_back(Opm::ParseContext::UNSUPPORTED_COMPORD_TYPE);
configKeys.push_back(Opm::ParseContext::UNSUPPORTED_INITIAL_THPRES);
configKeys.push_back(Opm::ParseContext::INTERNAL_ERROR_UNINITIALIZED_THPRES);
configKeys.push_back(Opm::ParseContext::PARSE_MISSING_SECTIONS);
return configKeys;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RifReaderOpmParserInput::findFaultByName(const cvf::Collection<RigFault>& faults, const QString& name)
{
for (size_t i = 0; i < faults.size(); i++)
{
if (faults.at(i)->name() == name)
{
return i;
}
}
return cvf::UNDEFINED_SIZE_T;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::StructGridInterface::FaceEnum RifReaderOpmParserInput::faceEnumFromText(const QString& faceString)
{
QString upperCaseText = faceString.toUpper().trimmed();
if (upperCaseText == "X" || upperCaseText == "X+" || upperCaseText == "I" || upperCaseText == "I+") return cvf::StructGridInterface::POS_I;
if (upperCaseText == "Y" || upperCaseText == "Y+" || upperCaseText == "J" || upperCaseText == "J+") return cvf::StructGridInterface::POS_J;
if (upperCaseText == "Z" || upperCaseText == "Z+" || upperCaseText == "K" || upperCaseText == "K+") return cvf::StructGridInterface::POS_K;
if (upperCaseText == "X-" || upperCaseText == "I-") return cvf::StructGridInterface::NEG_I;
if (upperCaseText == "Y-" || upperCaseText == "J-") return cvf::StructGridInterface::NEG_J;
if (upperCaseText == "Z-" || upperCaseText == "K-") return cvf::StructGridInterface::NEG_K;
return cvf::StructGridInterface::NO_FACE;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifReaderOpmParserInput::initUsingWarnings(Opm::ParseContext* parseContext)
{
if (!parseContext) return;
for (auto state : allParserConfigKeys())
{
parseContext->addKey(state);
}
// Treat all parsing errors as warnings
parseContext->update(Opm::InputError::WARN);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RifReaderOpmParserPropertyReader::findOrCreateResult(const QString& newResultName, RigEclipseCaseData* reservoir)
{
size_t resultIndex = reservoir->results(RifReaderInterface::MATRIX_RESULTS)->findScalarResultIndex(newResultName);
if (resultIndex == cvf::UNDEFINED_SIZE_T)
{
resultIndex = reservoir->results(RifReaderInterface::MATRIX_RESULTS)->addEmptyScalarResult(RimDefines::INPUT_PROPERTY, newResultName, false);
}
return resultIndex;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RifReaderOpmParserPropertyReader::RifReaderOpmParserPropertyReader(std::shared_ptr< Opm::Deck > deck)
: m_deck(deck)
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RifReaderOpmParserPropertyReader::RifReaderOpmParserPropertyReader(const QString& fileName)
{
open(fileName);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RifReaderOpmParserPropertyReader::open(const QString& fileName)
{
{
std::string errorMessage;
try
{
Opm::Parser parser;
// A default ParseContext will set up all parsing errors to throw exceptions
Opm::ParseContext parseContext;
// Treat all parsing errors as warnings
parseContext.update(Opm::InputError::WARN);
m_deck = parser.parseFile(fileName.toStdString(), parseContext);
}
catch (std::exception& e)
{
errorMessage = e.what();
}
catch (...)
{
errorMessage = "Unknown exception throwm from Opm::Parser";
}
}
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::set<std::string> RifReaderOpmParserPropertyReader::keywords() const
{
std::set<std::string> ids;
if (m_deck)
{
for (auto it = m_deck->begin(); it != m_deck->end(); it++)
{
ids.insert(it->name());
}
}
return ids;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RifReaderOpmParserPropertyReader::copyPropertyToCaseData(const std::string& keywordName, RigEclipseCaseData* caseData, const QString& resultName)
{
{
std::string errorMessage;
try
{
if (m_deck->hasKeyword(keywordName))
{
bool isItemCountEqual = isDataItemCountIdenticalToMainGridCellCount(m_deck, keywordName, caseData);
if (isItemCountEqual)
{
std::vector<double> allValues;
getAllValuesForKeyword(m_deck, keywordName, allValues);
size_t resultIndex = RifReaderOpmParserPropertyReader::findOrCreateResult(resultName, caseData);
if (resultIndex != cvf::UNDEFINED_SIZE_T)
{
std::vector< std::vector<double> >& newPropertyData = caseData->results(RifReaderInterface::MATRIX_RESULTS)->cellScalarResults(resultIndex);
newPropertyData.push_back(allValues);
}
}
}
}
catch (std::exception& e)
{
errorMessage = e.what();
}
catch (...)
{
errorMessage = "Unknown exception throwm from Opm::Parser";
}
QString fileName = QString::fromStdString(m_deck->getDataFile());
if (errorMessage.size() > 0)
{
RiuMainWindow::instance()->processMonitor()->addStringToLog(" " + QString::fromStdString(errorMessage) + "\n");
RiuMainWindow::instance()->processMonitor()->addStringToLog(QString("Error detected while reading property %1 from file : %2\n").arg(QString::fromStdString(keywordName)).arg(fileName));
}
else
{
RiuMainWindow::instance()->processMonitor()->addStringToLog(QString("Completed reading of property %1 from file : %2\n").arg(QString::fromStdString(keywordName)).arg(fileName));
}
}
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifReaderOpmParserPropertyReader::getAllValuesForKeyword(std::shared_ptr< Opm::Deck > deck, const std::string& keyword, std::vector<double>& allValues)
{
for (auto deckKeyword : deck->getKeywordList(keyword))
{
if (deckKeyword->isDataKeyword() && deckKeyword->size() == 1)
{
auto deckRecord = deckKeyword->getDataRecord();
if (deckRecord.size() == 1)
{
if (deckRecord.getDataItem().typeof() == Opm::DeckItem::integer)
{
auto opmData = deckKeyword->getIntData();
allValues.insert(std::end(allValues), std::begin(opmData), std::end(opmData));
}
else if (deckRecord.getDataItem().typeof() == Opm::DeckItem::fdouble)
{
auto opmData = deckKeyword->getRawDoubleData();
allValues.insert(std::end(allValues), std::begin(opmData), std::end(opmData));
}
}
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RifReaderOpmParserPropertyReader::isDataItemCountIdenticalToMainGridCellCount(std::shared_ptr< Opm::Deck > deck, const std::string& keyword, RigEclipseCaseData* caseData)
{
bool isEqual = false;
{
size_t valueCount = 0;
for (auto deckKeyword : deck->getKeywordList(keyword))
{
if (deckKeyword->isDataKeyword())
{
valueCount += deckKeyword->getDataSize();
}
}
if (valueCount == caseData->mainGrid()->cellCount())
{
isEqual = true;
}
}
return isEqual;
}

View File

@@ -1,89 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RigFault.h"
#include "cvfCollection.h"
#include <map>
#include <memory>
#include <set>
#include <string>
#include <vector>
#include <QString>
class RigEclipseCaseData;
namespace Opm {
class Deck;
class ParseContext;
}
//==================================================================================================
//
//
//
//==================================================================================================
class RifReaderOpmParserInput
{
public:
static void importGridPropertiesFaults(const QString& fileName, RigEclipseCaseData* eclipseCase);
static void readFaults(const QString& fileName, cvf::Collection<RigFault>* faults);
static std::vector<std::string> knownPropertyKeywords();
private:
static void importFaults(const Opm::Deck& deck, cvf::Collection<RigFault>* faults);
static std::vector<std::string> allParserConfigKeys();
static size_t findFaultByName(const cvf::Collection<RigFault>& faults, const QString& name);
static cvf::StructGridInterface::FaceEnum faceEnumFromText(const QString& faceString);
static void initUsingWarnings(Opm::ParseContext* parseContext);
};
//==================================================================================================
//
//
//
//==================================================================================================
class RifReaderOpmParserPropertyReader
{
public:
explicit RifReaderOpmParserPropertyReader(std::shared_ptr< Opm::Deck > deck);
explicit RifReaderOpmParserPropertyReader(const QString& fileName);
std::set<std::string> keywords() const;
bool copyPropertyToCaseData(const std::string& keywordName, RigEclipseCaseData* eclipseCase, const QString& resultName);
static size_t findOrCreateResult(const QString& newResultName, RigEclipseCaseData* reservoir);
private:
static void getAllValuesForKeyword(std::shared_ptr< Opm::Deck > deck, const std::string& keyword, std::vector<double>& allValues);
static bool isDataItemCountIdenticalToMainGridCellCount(std::shared_ptr< Opm::Deck > deck, const std::string& keyword, RigEclipseCaseData* caseData);
bool open(const QString& fileName);
private:
std::shared_ptr< Opm::Deck > m_deck;
};

View File

@@ -39,6 +39,8 @@ RifReaderSettings::RifReaderSettings()
CAF_PDM_InitField(&importAdvancedMswData, "importAdvancedMswData", false, "Import advanced MSW data", "", "", "");
importAdvancedMswData.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
CAF_PDM_InitField(&faultIncludeFileAbsolutePathPrefix, "faultIncludeFileAbsolutePathPrefix", QString(), "Fault Include File Absolute Path Prefix", "", "Path used to prefix absolute UNIX paths in fault include statements on Windows", "");
}
//--------------------------------------------------------------------------------------------------
@@ -58,3 +60,13 @@ void RifReaderSettings::defineEditorAttribute(const caf::PdmFieldHandle* field,
}
}
void RifReaderSettings::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
uiOrdering.add(&importFaults);
uiOrdering.add(&importNNCs);
uiOrdering.add(&importAdvancedMswData);
#ifdef WIN32
uiOrdering.add(&faultIncludeFileAbsolutePathPrefix);
#endif
}

View File

@@ -39,9 +39,12 @@ public:
caf::PdmField<bool> importFaults;
caf::PdmField<bool> importNNCs;
caf::PdmField<bool> importAdvancedMswData;
caf::PdmField<QString> faultIncludeFileAbsolutePathPrefix;
protected:
virtual void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute);
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
};

View File

@@ -34,8 +34,8 @@ add_library( ${PROJECT_NAME}
RigFemPartGrid.cpp
RigFemResultAddress.h
RigFemResultPosEnum.h
RimGeoMechTopologyItem.h
RimGeoMechTopologyItem.cpp
RimGeoMechGeometrySelectionItem.h
RimGeoMechGeometrySelectionItem.cpp
)
target_link_libraries( ${PROJECT_NAME} LibCore cafTensor ResultStatisticsCache)

View File

@@ -0,0 +1,108 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimGeoMechGeometrySelectionItem.h"
#include "RimGeoMechCase.h"
#include "RimGeoMechView.h"
#include "RiuSelectionManager.h"
CAF_PDM_SOURCE_INIT(RimGeoMechGeometrySelectionItem, "GeoMechGeometrySelectionItem");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGeoMechGeometrySelectionItem::RimGeoMechGeometrySelectionItem()
{
CAF_PDM_InitObject("GeoMech Topology Item", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_geoMechCase, "GeoMechCase", "Geo Mech Case", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_gridIndex, "m_gridIndex", "GridIndex", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_cellIndex, "m_cellIndex", "CellIndex", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_elementFace, "m_elementFace", "ElementFace", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_hasIntersectionTriangle, "m_hasIntersectionTriangle", "HasIntersectionTriangle", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_intersectionTriangle_0, "m_intersectionTriangle_0", "IntersectionTriangle_0", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_intersectionTriangle_1, "m_intersectionTriangle_1", "IntersectionTriangle_1", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_intersectionTriangle_2, "m_intersectionTriangle_2", "IntersectionTriangle_2", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_localIntersectionPoint, "m_localIntersectionPoint", "LocalIntersectionPoint", "", "", "");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGeoMechGeometrySelectionItem::~RimGeoMechGeometrySelectionItem()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechGeometrySelectionItem::setFromSelectionItem(const RiuGeoMechSelectionItem* selectionItem)
{
m_geoMechCase = selectionItem->m_view->geoMechCase();
m_gridIndex = selectionItem->m_gridIndex;
m_cellIndex = selectionItem->m_cellIndex;
m_elementFace = selectionItem->m_elementFace;
m_hasIntersectionTriangle = selectionItem->m_hasIntersectionTriangle;
m_intersectionTriangle_0 = cvf::Vec3d(selectionItem->m_intersectionTriangle[0]);
m_intersectionTriangle_1 = cvf::Vec3d(selectionItem->m_intersectionTriangle[1]);
m_intersectionTriangle_2 = cvf::Vec3d(selectionItem->m_intersectionTriangle[2]);
m_localIntersectionPoint = selectionItem->m_localIntersectionPoint;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimGeoMechGeometrySelectionItem::geometrySelectionText() const
{
QString text;
/*
if (m_geoMechCase)
{
text += m_geoMechCase->caseUserDescription();
}
else
{
text = "No case";
}
text += ", ";
text += QString("Grid index %1").arg(m_gridIndex);
text += ", ";
text += RigTimeHistoryResultAccessor::geometrySelectionText(m_geoMechCase->eclipseCaseData(), m_gridIndex, m_cellIndex);
*/
return text;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGeoMechCase* RimGeoMechGeometrySelectionItem::geoMechCase() const
{
return m_geoMechCase;
}

View File

@@ -0,0 +1,61 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RimGeometrySelectionItem.h"
#include "cafPdmField.h"
#include "cafPdmFieldCvfVec3d.h"
#include "cafPdmPtrField.h"
class RiuGeoMechSelectionItem;
class RimGeoMechCase;
//==================================================================================================
///
///
//==================================================================================================
class RimGeoMechGeometrySelectionItem : public RimGeometrySelectionItem
{
CAF_PDM_HEADER_INIT;
public:
RimGeoMechGeometrySelectionItem();
virtual ~RimGeoMechGeometrySelectionItem() override;
void setFromSelectionItem(const RiuGeoMechSelectionItem* selectionItem);
virtual QString geometrySelectionText() const override;
RimGeoMechCase* geoMechCase() const;
public:
caf::PdmField<size_t> m_gridIndex;
caf::PdmField<size_t> m_cellIndex;
caf::PdmField<int> m_elementFace;
caf::PdmField<bool> m_hasIntersectionTriangle;
caf::PdmField<cvf::Vec3d> m_intersectionTriangle_0;
caf::PdmField<cvf::Vec3d> m_intersectionTriangle_1;
caf::PdmField<cvf::Vec3d> m_intersectionTriangle_2;
caf::PdmField<cvf::Vec3d> m_localIntersectionPoint;
private:
caf::PdmPtrField<RimGeoMechCase*> m_geoMechCase;
};

View File

@@ -1,109 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimGeoMechTopologyItem.h"
#include "RimGeoMechCase.h"
#include "RimGeoMechView.h"
#include "RiuSelectionManager.h"
CAF_PDM_SOURCE_INIT(RimGeoMechTopologyItem, "RimGeoMechTopologyItem");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGeoMechTopologyItem::RimGeoMechTopologyItem()
{
CAF_PDM_InitObject("GeoMech Topology Item", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_geoMechCase, "GeoMechCase", "Geo Mech Case", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_gridIndex, "m_gridIndex", "m_gridIndex", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_cellIndex, "m_cellIndex", "m_cellIndex", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_elementFace, "m_elementFace", "m_elementFace", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_hasIntersectionTriangle, "m_hasIntersectionTriangle", "m_hasIntersectionTriangle", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_intersectionTriangle_0, "m_intersectionTriangle_0", "m_intersectionTriangle_0", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_intersectionTriangle_1, "m_intersectionTriangle_1", "m_intersectionTriangle_1", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_intersectionTriangle_2, "m_intersectionTriangle_2", "m_intersectionTriangle_2", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_localIntersectionPoint, "m_localIntersectionPoint", "m_localIntersectionPoint", "", "", "");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGeoMechTopologyItem::~RimGeoMechTopologyItem()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechTopologyItem::setFromSelectionItem(const RiuGeoMechSelectionItem* selectionItem)
{
m_geoMechCase = selectionItem->m_view->geoMechCase();
m_gridIndex = selectionItem->m_gridIndex;
m_cellIndex = selectionItem->m_cellIndex;
m_elementFace = selectionItem->m_elementFace;
m_hasIntersectionTriangle = selectionItem->m_hasIntersectionTriangle;
m_intersectionTriangle_0 = cvf::Vec3d(selectionItem->m_intersectionTriangle[0]);
m_intersectionTriangle_1 = cvf::Vec3d(selectionItem->m_intersectionTriangle[1]);
m_intersectionTriangle_2 = cvf::Vec3d(selectionItem->m_intersectionTriangle[2]);
m_localIntersectionPoint = selectionItem->m_localIntersectionPoint;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimGeoMechTopologyItem::topologyText() const
{
QString text;
/*
if (m_geoMechCase)
{
text += m_geoMechCase->caseUserDescription();
}
else
{
text = "No case";
}
text += ", ";
text += QString("Grid index %1").arg(m_gridIndex);
text += ", ";
text += RigTimeHistoryResultAccessor::topologyText(m_geoMechCase->eclipseCaseData(), m_gridIndex, m_cellIndex);
*/
return text;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGeoMechCase* RimGeoMechTopologyItem::geoMechCase() const
{
return m_geoMechCase;
}

View File

@@ -1,61 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RimPickingTopologyItem.h"
#include "cafPdmField.h"
#include "cafPdmFieldCvfVec3d.h"
#include "cafPdmPtrField.h"
class RiuGeoMechSelectionItem;
class RimGeoMechCase;
//==================================================================================================
///
///
//==================================================================================================
class RimGeoMechTopologyItem : public RimPickingTopologyItem
{
CAF_PDM_HEADER_INIT;
public:
RimGeoMechTopologyItem();
virtual ~RimGeoMechTopologyItem() override;
void setFromSelectionItem(const RiuGeoMechSelectionItem* selectionItem);
virtual QString topologyText() const override;
RimGeoMechCase* geoMechCase() const;
public:
caf::PdmField<size_t> m_gridIndex;
caf::PdmField<size_t> m_cellIndex;
caf::PdmField<int> m_elementFace;
caf::PdmField<bool> m_hasIntersectionTriangle;
caf::PdmField<cvf::Vec3d> m_intersectionTriangle_0;
caf::PdmField<cvf::Vec3d> m_intersectionTriangle_1;
caf::PdmField<cvf::Vec3d> m_intersectionTriangle_2;
caf::PdmField<cvf::Vec3d> m_localIntersectionPoint;
private:
caf::PdmPtrField<RimGeoMechCase*> m_geoMechCase;
};

View File

@@ -81,7 +81,6 @@ ${CEE_CURRENT_LIST_DIR}RimIntersectionCollection.h
${CEE_CURRENT_LIST_DIR}RimContextCommandBuilder.h
${CEE_CURRENT_LIST_DIR}RimGridCollection.h
${CEE_CURRENT_LIST_DIR}RimPlotCurve.h
${CEE_CURRENT_LIST_DIR}RimEclipseInputCaseOpm.h
${CEE_CURRENT_LIST_DIR}RimIntersectionBox.h
${CEE_CURRENT_LIST_DIR}RimMultiSnapshotDefinition.h
${CEE_CURRENT_LIST_DIR}RimMdiWindowController.h
@@ -89,8 +88,8 @@ ${CEE_CURRENT_LIST_DIR}RimPropertyFilter.h
${CEE_CURRENT_LIST_DIR}RimNamedObject.h
${CEE_CURRENT_LIST_DIR}RimCheckableNamedObject.h
${CEE_CURRENT_LIST_DIR}RimGridTimeHistoryCurve.h
${CEE_CURRENT_LIST_DIR}RimPickingTopologyItem.h
${CEE_CURRENT_LIST_DIR}RimEclipseTopologyItem.h
${CEE_CURRENT_LIST_DIR}RimGeometrySelectionItem.h
${CEE_CURRENT_LIST_DIR}RimEclipseGeometrySelectionItem.h
${CEE_CURRENT_LIST_DIR}RimEllipseFractureTemplate.h
${CEE_CURRENT_LIST_DIR}RimFractureTemplateCollection.h
${CEE_CURRENT_LIST_DIR}RimFracture.h
@@ -182,7 +181,6 @@ ${CEE_CURRENT_LIST_DIR}RimIntersectionCollection.cpp
${CEE_CURRENT_LIST_DIR}RimContextCommandBuilder.cpp
${CEE_CURRENT_LIST_DIR}RimGridCollection.cpp
${CEE_CURRENT_LIST_DIR}RimPlotCurve.cpp
${CEE_CURRENT_LIST_DIR}RimEclipseInputCaseOpm.cpp
${CEE_CURRENT_LIST_DIR}RimIntersectionBox.cpp
${CEE_CURRENT_LIST_DIR}RimMultiSnapshotDefinition.cpp
${CEE_CURRENT_LIST_DIR}RimMdiWindowController.cpp
@@ -190,8 +188,8 @@ ${CEE_CURRENT_LIST_DIR}RimPropertyFilter.cpp
${CEE_CURRENT_LIST_DIR}RimNamedObject.cpp
${CEE_CURRENT_LIST_DIR}RimCheckableNamedObject.cpp
${CEE_CURRENT_LIST_DIR}RimGridTimeHistoryCurve.cpp
${CEE_CURRENT_LIST_DIR}RimPickingTopologyItem.cpp
${CEE_CURRENT_LIST_DIR}RimEclipseTopologyItem.cpp
${CEE_CURRENT_LIST_DIR}RimGeometrySelectionItem.cpp
${CEE_CURRENT_LIST_DIR}RimEclipseGeometrySelectionItem.cpp
${CEE_CURRENT_LIST_DIR}RimEllipseFractureTemplate.cpp
${CEE_CURRENT_LIST_DIR}RimFractureTemplateCollection.cpp
${CEE_CURRENT_LIST_DIR}RimFracture.cpp

View File

@@ -52,6 +52,8 @@ RimFlowCharacteristicsPlot::RimFlowCharacteristicsPlot()
CAF_PDM_InitFieldNoDefault(&m_case, "FlowCase", "Case", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_flowDiagSolution, "FlowDiagSolution", "Flow Diag Solution", "", "", "");
m_flowDiagSolution.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&m_timeStepSelectionType, "TimeSelectionType", "Time Steps", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_selectedTimeSteps, "SelectedTimeSteps", "", "", "", "");
@@ -138,7 +140,10 @@ QList<caf::PdmOptionItemInfo> RimFlowCharacteristicsPlot::calculateValueOptions(
for ( RimEclipseResultCase* c : cases )
{
options.push_back(caf::PdmOptionItemInfo(c->caseUserDescription(), c, false, c->uiIcon()));
if ( c->defaultFlowDiagSolution() )
{
options.push_back(caf::PdmOptionItemInfo(c->caseUserDescription(), c, false, c->uiIcon()));
}
}
}
}
@@ -148,9 +153,9 @@ QList<caf::PdmOptionItemInfo> RimFlowCharacteristicsPlot::calculateValueOptions(
{
std::vector<RimFlowDiagSolution*> flowSols = m_case->flowDiagSolutions();
options.push_back(caf::PdmOptionItemInfo("None", nullptr));
for ( RimFlowDiagSolution* flowSol : flowSols )
{
options.push_back(caf::PdmOptionItemInfo("None", nullptr));
options.push_back(caf::PdmOptionItemInfo(flowSol->userDescription(), flowSol, false, flowSol->uiIcon()));
}
}

View File

@@ -317,44 +317,20 @@ RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusInTimeSte
//--------------------------------------------------------------------------------------------------
cvf::Color3f RimFlowDiagSolution::tracerColor(const QString& tracerName) const
{
RimEclipseResultCase* eclCase;
this->firstAncestorOrThisOfType(eclCase);
QString wellName = removeCrossFlowEnding(tracerName);
if ( eclCase )
{
RimEclipseView* activeView = dynamic_cast<RimEclipseView*>(RiaApplication::instance()->activeReservoirView());
if (activeView)
{
RimEclipseWell* well = activeView->wellCollection->findWell(wellName);
if (well)
{
return well->wellPipeColor();
}
}
else
{
// If we do not find a well color, use index in well result data to be able to get variation of tracer colors
// This can be the case if we do not have any views at all
const cvf::Collection<RigSingleWellResultsData>& wellResults = eclCase->eclipseCaseData()->wellResults();
for ( size_t wIdx = 0; wIdx < wellResults.size(); ++wIdx )
{
if ( wellResults[wIdx]->m_wellName == wellName )
{
return RiaColorTables::wellsPaletteColors().cycledColor3f(wIdx);
}
}
}
}
if (wellName == RIG_FLOW_TOTAL_NAME) return cvf::Color3f::LIGHT_GRAY;
if (wellName == RIG_RESERVOIR_TRACER_NAME) return cvf::Color3f::LIGHT_GRAY;
if (wellName == RIG_TINY_TRACER_GROUP_NAME) return cvf::Color3f::DARK_GRAY;
RimEclipseResultCase* eclCase;
this->firstAncestorOrThisOfType(eclCase);
if ( eclCase )
{
return eclCase->defaultWellColor(wellName);
}
return cvf::Color3f::LIGHT_GRAY;
}

View File

@@ -37,10 +37,10 @@ RimFlowPlotCollection::RimFlowPlotCollection()
CAF_PDM_InitFieldNoDefault(&m_flowCharacteristicsPlot, "FlowCharacteristicsPlot", "", "", "", "");
m_flowCharacteristicsPlot.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&m_defaultWellAllocPlot, "DefaultFlowPlot", "", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_defaultWellAllocPlot, "DefaultWellAllocationPlot", "", "", "", "");
m_defaultWellAllocPlot.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&m_storedWellAllocPlots, "FlowPlots", "Stored Plots", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_storedWellAllocPlots, "StoredWellAllocationPlots", "Stored Plots", "", "", "");
}
//--------------------------------------------------------------------------------------------------

View File

@@ -138,6 +138,24 @@ QString RimTotalWellAllocationPlot::description() const
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimTotalWellAllocationPlot::totalAllocationAsText() const
{
QString txt;
for (auto a : m_sliceInfo)
{
txt += a.first;
txt += "\t";
txt += QString::number(a.second);
txt += "\n";
}
return txt;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -150,6 +168,8 @@ void RimTotalWellAllocationPlot::addSlice(const QString& name, const cvf::Color3
m_wellTotalAllocationPlotWidget->addItem(name, sliceColor, value);
m_wellTotalAllocationPlotWidget->update();
}
m_sliceInfo.push_back(std::make_pair(name, value));
}
@@ -163,6 +183,8 @@ void RimTotalWellAllocationPlot::clearSlices()
m_wellTotalAllocationPlotWidget->clear();
m_wellTotalAllocationPlotWidget->update();
}
m_sliceInfo.clear();
}
//--------------------------------------------------------------------------------------------------

View File

@@ -27,6 +27,8 @@
#include <QPointer>
#include <vector>
class RiuWellAllocationPlot;
class RimEclipseWell;
class RimWellLogPlot;
@@ -55,6 +57,7 @@ public:
void setDescription(const QString& description);
QString description() const;
QString totalAllocationAsText() const;
void addSlice(const QString& name, const cvf::Color3f& color, float value);
void clearSlices();
@@ -80,4 +83,6 @@ private:
caf::PdmField<QString> m_userName;
QPointer<RiuNightchartsWidget> m_wellTotalAllocationPlotWidget;
std::vector<std::pair<QString, float> > m_sliceInfo;
};

View File

@@ -80,15 +80,13 @@ RimWellAllocationPlot::RimWellAllocationPlot()
CAF_PDM_InitFieldNoDefault(&m_case, "CurveCase", "Case", "", "", "");
m_case.uiCapability()->setUiTreeChildrenHidden(true);
CAF_PDM_InitField(&m_timeStep, "PlotTimeStep", 0, "Time Step", "", "", "");
CAF_PDM_InitField(&m_wellName, "WellName", QString("None"), "Well", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_flowDiagSolution, "FlowDiagSolution", "Flow Diag Solution", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_flowType, "FlowType", "Flow Type", "", "", "");
CAF_PDM_InitField(&m_groupSmallContributions, "GroupSmallContributions", true, "Group Small Contributions", "", "", "");
CAF_PDM_InitField(&m_smallContributionsThreshold, "SmallContributionsThreshold", 0.005, "Threshold", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_accumulatedWellFlowPlot, "AccumulatedWellFlowPlot", "Accumulated Well Flow", "", "", "");
CAF_PDM_InitField(&m_timeStep, "PlotTimeStep", 0, "Time Step", "", "", "");
CAF_PDM_InitField(&m_wellName, "WellName", QString("None"), "Well", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_flowDiagSolution, "FlowDiagSolution", "Plot Type", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_flowType, "FlowType", "Flow Type", "", "", "");
CAF_PDM_InitField(&m_groupSmallContributions, "GroupSmallContributions", true, "Group Small Contributions", "", "", "");
CAF_PDM_InitField(&m_smallContributionsThreshold, "SmallContributionsThreshold", 0.005, "Threshold", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_accumulatedWellFlowPlot, "AccumulatedWellFlowPlot", "Accumulated Well Flow", "", "", "");
m_accumulatedWellFlowPlot.uiCapability()->setUiHidden(true);
m_accumulatedWellFlowPlot = new RimWellLogPlot;
m_accumulatedWellFlowPlot->setDepthUnit(RimDefines::UNIT_NONE);
@@ -515,6 +513,14 @@ RimTotalWellAllocationPlot* RimWellAllocationPlot::totalWellFlowPlot()
return m_totalWellAllocationPlot();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmObject* RimWellAllocationPlot::plotLegend()
{
return m_wellAllocationPlotLegend;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -540,16 +546,7 @@ QList<caf::PdmOptionItemInfo> RimWellAllocationPlot::calculateValueOptions(const
if (fieldNeedingOptions == &m_wellName)
{
std::set<QString> sortedWellNames;
if ( m_case && m_case->eclipseCaseData() )
{
const cvf::Collection<RigSingleWellResultsData>& wellRes = m_case->eclipseCaseData()->wellResults();
for ( size_t wIdx = 0; wIdx < wellRes.size(); ++wIdx )
{
sortedWellNames.insert(wellRes[wIdx]->m_wellName);
}
}
std::set<QString> sortedWellNames = this->findSortedWellNames();
QIcon simWellIcon(":/Well.png");
for ( const QString& wname: sortedWellNames )
@@ -595,12 +592,18 @@ QList<caf::PdmOptionItemInfo> RimWellAllocationPlot::calculateValueOptions(const
{
if (m_case)
{
std::vector<RimFlowDiagSolution*> flowSols = m_case->flowDiagSolutions();
//std::vector<RimFlowDiagSolution*> flowSols = m_case->flowDiagSolutions();
// options.push_back(caf::PdmOptionItemInfo("None", nullptr));
//for (RimFlowDiagSolution* flowSol : flowSols)
//{
// options.push_back(caf::PdmOptionItemInfo(flowSol->userDescription(), flowSol, false, flowSol->uiIcon()));
//}
for (RimFlowDiagSolution* flowSol : flowSols)
RimFlowDiagSolution* defaultFlowSolution = m_case->defaultFlowDiagSolution();
options.push_back(caf::PdmOptionItemInfo("Well Flow", nullptr));
if (defaultFlowSolution)
{
options.push_back(caf::PdmOptionItemInfo("None", nullptr));
options.push_back(caf::PdmOptionItemInfo(flowSol->userDescription(), flowSol, false, flowSol->uiIcon()));
options.push_back(caf::PdmOptionItemInfo("Allocation", defaultFlowSolution ));
}
}
}
@@ -645,8 +648,30 @@ void RimWellAllocationPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedF
{
updateWidgetTitleWindowTitle();
}
else if ( changedField == &m_case)
{
if ( m_flowDiagSolution && m_case )
{
m_flowDiagSolution = m_case->defaultFlowDiagSolution();
}
else
{
m_flowDiagSolution = nullptr;
}
if (!m_case) m_timeStep = 0;
else if (m_timeStep >= static_cast<int>(m_case->timeStepDates().size()))
{
m_timeStep = std::max(0, ((int)m_case->timeStepDates().size()) - 1);
}
std::set<QString> sortedWellNames = findSortedWellNames();
if (!sortedWellNames.size()) m_wellName = "";
else if ( sortedWellNames.count(m_wellName()) == 0 ){ m_wellName = *sortedWellNames.begin();}
loadDataAndUpdate();
}
else if ( changedField == &m_wellName
|| changedField == &m_case
|| changedField == &m_timeStep
|| changedField == &m_flowDiagSolution
|| changedField == &m_groupSmallContributions
@@ -657,6 +682,25 @@ void RimWellAllocationPlot::fieldChangedByUi(const caf::PdmFieldHandle* changedF
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::set<QString> RimWellAllocationPlot::findSortedWellNames()
{
std::set<QString> sortedWellNames;
if ( m_case && m_case->eclipseCaseData() )
{
const cvf::Collection<RigSingleWellResultsData>& wellRes = m_case->eclipseCaseData()->wellResults();
for ( size_t wIdx = 0; wIdx < wellRes.size(); ++wIdx )
{
sortedWellNames.insert(wellRes[wIdx]->m_wellName);
}
}
return sortedWellNames;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -678,6 +722,19 @@ QImage RimWellAllocationPlot::snapshotWindowContent()
//--------------------------------------------------------------------------------------------------
void RimWellAllocationPlot::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
uiOrdering.add(&m_userName);
uiOrdering.add(&m_showPlotTitle);
caf::PdmUiGroup& dataGroup = *uiOrdering.addNewGroup("Plot Data");
dataGroup.add(&m_case);
dataGroup.add(&m_timeStep);
dataGroup.add(&m_wellName);
caf::PdmUiGroup& optionGroup = *uiOrdering.addNewGroup("Options");
optionGroup.add(&m_flowDiagSolution);
optionGroup.add(&m_flowType);
optionGroup.add(&m_groupSmallContributions);
optionGroup.add(&m_smallContributionsThreshold);
m_smallContributionsThreshold.uiCapability()->setUiReadOnly(!m_groupSmallContributions());
}

View File

@@ -68,6 +68,7 @@ public:
RimWellLogPlot* accumulatedWellFlowPlot();
RimTotalWellAllocationPlot* totalWellFlowPlot();
caf::PdmObject* plotLegend();
RimFlowDiagSolution* flowDiagSolution();
int timeStep();
@@ -80,6 +81,9 @@ protected:
// Overridden PDM methods
virtual caf::PdmFieldHandle* userDescriptionField() { return &m_userName; }
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
std::set<QString> findSortedWellNames();
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
virtual QImage snapshotWindowContent() override;

View File

@@ -40,7 +40,7 @@
///
//==================================================================================================
CAF_PDM_SOURCE_INIT(RimWellFlowRateCurve, "RimWellFlowRateCurve");
CAF_PDM_SOURCE_INIT(RimWellFlowRateCurve, "WellFlowRateCurve");
//--------------------------------------------------------------------------------------------------
///
@@ -149,6 +149,19 @@ void RimWellFlowRateCurve::updateCurveAppearance()
m_qwtPlotCurve->setCurveAttribute(QwtPlotCurve::Inverted, true);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellFlowRateCurve::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
uiOrdering.add(&m_curveName);
m_curveName.uiCapability()->setUiReadOnly(true);
uiOrdering.add(&m_curveColor);
m_curveColor.uiCapability()->setUiReadOnly(true);
uiOrdering.skipRemainingFields();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -49,6 +49,8 @@ protected:
virtual void onLoadDataAndUpdate() override;
virtual void updateCurveAppearance() override;
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
private:
bool isUsingConnectionNumberDepthType() const;
RimWellAllocationPlot* wellAllocationPlot() const;

View File

@@ -39,7 +39,7 @@ CAF_PDM_XML_ABSTRACT_SOURCE_INIT(RimCase, "RimCase");
//--------------------------------------------------------------------------------------------------
RimCase::RimCase()
{
CAF_PDM_InitField(&caseUserDescription, "CaseUserDescription", QString(), "Case name", "", "" ,"");
CAF_PDM_InitField(&caseUserDescription, "CaseUserDescription", QString(), "Case Name", "", "" ,"");
CAF_PDM_InitField(&caseId, "CaseId", -1, "Case ID", "", "" ,"");
caseId.uiCapability()->setUiReadOnly(true);

View File

@@ -61,8 +61,9 @@ public:
virtual void updateFormationNamesData() = 0;
private:
protected:
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
private:
virtual caf::PdmFieldHandle* userDescriptionField() override { return &caseUserDescription; }
};

View File

@@ -172,7 +172,6 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
else if (dynamic_cast<RimEclipseInputPropertyCollection*>(uiItem))
{
commandIds << "RicAddEclipseInputPropertyFeature";
commandIds << "RicAddOpmInputPropertyFeature";
}
else if (dynamic_cast<RimEclipseInputProperty*>(uiItem))
{
@@ -429,6 +428,8 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
commandIds << "RicCopyReferencesToClipboardFeature";
commandIds << "RicShowPlotDataFeature";
commandIds << "RicShowTotalAllocationDataFeature";
commandIds << "RicSummaryCurveSwitchAxisFeature";
// Work in progress -- End

View File

@@ -21,12 +21,14 @@
#include "RimEclipseCase.h"
#include "RiaApplication.h"
#include "RiaColorTables.h"
#include "RiaPreferences.h"
#include "RigActiveCellInfo.h"
#include "RigCaseCellResultsData.h"
#include "RigEclipseCaseData.h"
#include "RigMainGrid.h"
#include "RigSingleWellResultsData.h"
#include "RimCaseCollection.h"
#include "RimCellEdgeColors.h"
@@ -133,6 +135,48 @@ const RigEclipseCaseData* RimEclipseCase::eclipseCaseData() const
return m_rigEclipseCase.p();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f RimEclipseCase::defaultWellColor(const QString& wellName)
{
if ( m_wellToColorMap.empty() )
{
const caf::ColorTable& colorTable = RiaColorTables::wellsPaletteColors();
cvf::Color3ubArray wellColors = colorTable.color3ubArray();
cvf::Color3ubArray interpolatedWellColors = wellColors;
const cvf::Collection<RigSingleWellResultsData>& wellResults = this->eclipseCaseData()->wellResults();
if ( wellResults.size() > 1 )
{
interpolatedWellColors = caf::ColorTable::interpolateColorArray(wellColors, wellResults.size());
}
for ( size_t wIdx = 0; wIdx < wellResults.size(); ++wIdx )
{
m_wellToColorMap[wellResults[wIdx]->m_wellName] = cvf::Color3f::BLACK;
}
size_t wIdx = 0;
for ( auto & wNameColorPair: m_wellToColorMap )
{
wNameColorPair.second = cvf::Color3f(interpolatedWellColors[wIdx]);
++wIdx;
}
}
auto nmColor = m_wellToColorMap.find(wellName);
if (nmColor != m_wellToColorMap.end())
{
return nmColor->second;
}
else
{
return cvf::Color3f::LIGHT_GRAY;
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -190,10 +234,8 @@ RimEclipseView* RimEclipseCase::createCopyAndAddView(const RimEclipseView* sourc
reservoirViews().push_back(rimEclipseView);
// Resolve references after reservoir view has been inserted into Rim structures
// Intersections referencing a well path/ simulation well requires this
// TODO: initAfterReadRecursively can probably be removed
rimEclipseView->initAfterReadRecursively();
rimEclipseView->resolveReferencesRecursively();
rimEclipseView->initAfterReadRecursively();
return rimEclipseView;
}
@@ -573,28 +615,47 @@ QStringList RimEclipseCase::timeStepStrings()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimEclipseCase::timeStepName(int frameIdx)
{
std::vector<QDateTime> timeStepDates = this->timeStepDates();
CVF_ASSERT(frameIdx < timeStepDates.size());
CVF_ASSERT(frameIdx < static_cast<int>(timeStepDates.size()));
if (m_timeStepFormatString.isEmpty())
{
bool hasHoursAndMinutesInTimesteps = false;
bool hasSecondsInTimesteps = false;
bool hasMillisecondsInTimesteps = false;
for (size_t i = 0; i < timeStepDates.size(); i++)
{
if (timeStepDates[i].time().hour() != 0.0 || timeStepDates[i].time().minute() != 0.0)
if (timeStepDates[i].time().msec() != 0.0)
{
hasMillisecondsInTimesteps = true;
hasSecondsInTimesteps = true;
hasHoursAndMinutesInTimesteps = true;
break;
}
else if (timeStepDates[i].time().second() != 0.0) {
hasHoursAndMinutesInTimesteps = true;
hasSecondsInTimesteps = true;
}
else if (timeStepDates[i].time().hour() != 0.0 || timeStepDates[i].time().minute() != 0.0)
{
hasHoursAndMinutesInTimesteps = true;
}
}
m_timeStepFormatString = "dd.MMM yyyy";
if (hasHoursAndMinutesInTimesteps)
{
m_timeStepFormatString += " - hh:mm";
if (hasSecondsInTimesteps)
{
m_timeStepFormatString += ":ss";
if (hasMillisecondsInTimesteps)
{
m_timeStepFormatString += ".zzz";
}
}
}
}

View File

@@ -31,6 +31,7 @@
#include "cvfBase.h"
#include "cvfObject.h"
#include "cvfColor3.h"
class QString;
@@ -69,6 +70,7 @@ public:
RigEclipseCaseData* eclipseCaseData();
const RigEclipseCaseData* eclipseCaseData() const;
cvf::Color3f defaultWellColor(const QString& wellName);
RimReservoirCellResultsStorage* results(RifReaderInterface::PorosityModelResultType porosityModel);
@@ -108,13 +110,15 @@ protected:
void setReservoirData(RigEclipseCaseData* eclipseCase);
private:
cvf::ref<RigEclipseCaseData> m_rigEclipseCase;
cvf::ref<RigEclipseCaseData> m_rigEclipseCase;
private:
caf::PdmChildField<RimReservoirCellResultsStorage*> m_matrixModelResults;
caf::PdmChildField<RimReservoirCellResultsStorage*> m_fractureModelResults;
QString m_timeStepFormatString;
std::map<QString , cvf::Color3f> m_wellToColorMap;
// Obsolete fields
protected:
caf::PdmField<QString> caseName;

View File

@@ -0,0 +1,110 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimEclipseGeometrySelectionItem.h"
#include "RigTimeHistoryResultAccessor.h"
#include "RimEclipseCase.h"
#include "RimEclipseView.h"
#include "RiuSelectionManager.h"
CAF_PDM_SOURCE_INIT(RimEclipseGeometrySelectionItem, "EclipseGeometrySelectionItem");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEclipseGeometrySelectionItem::RimEclipseGeometrySelectionItem()
{
CAF_PDM_InitObject("Eclipse Geometry Selection Item", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_eclipseCase, "EclipseCase", "Eclipse Case", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_gridIndex, "GridIndex", "m_gridIndex", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_cellIndex, "CellIndex", "m_cellIndex", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_localIntersectionPoint, "LocalIntersectionPoint", "m_localIntersectionPoint", "", "", "");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEclipseGeometrySelectionItem::~RimEclipseGeometrySelectionItem()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseGeometrySelectionItem::setFromSelectionItem(const RiuEclipseSelectionItem* selectionItem)
{
m_gridIndex = selectionItem->m_gridIndex;
m_cellIndex = selectionItem->m_cellIndex;
m_localIntersectionPoint = selectionItem->m_localIntersectionPoint;
m_eclipseCase = selectionItem->m_view->eclipseCase();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimEclipseGeometrySelectionItem::geometrySelectionText() const
{
QString text;
if (m_eclipseCase)
{
text += m_eclipseCase->caseUserDescription();
}
else
{
text = "No case";
}
text += ", ";
text += QString("Grid index %1").arg(m_gridIndex);
text += ", ";
text += RigTimeHistoryResultAccessor::geometrySelectionText(m_eclipseCase->eclipseCaseData(), m_gridIndex, m_cellIndex);
return text;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEclipseCase* RimEclipseGeometrySelectionItem::eclipseCase() const
{
return m_eclipseCase;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RimEclipseGeometrySelectionItem::gridIndex() const
{
return m_gridIndex;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RimEclipseGeometrySelectionItem::cellIndex() const
{
return m_cellIndex;
}

View File

@@ -0,0 +1,56 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RimGeometrySelectionItem.h"
#include "cafPdmField.h"
#include "cafPdmFieldCvfVec3d.h"
#include "cafPdmPtrField.h"
class RimEclipseCase;
class RiuEclipseSelectionItem;
//==================================================================================================
///
///
//==================================================================================================
class RimEclipseGeometrySelectionItem : public RimGeometrySelectionItem
{
CAF_PDM_HEADER_INIT;
public:
RimEclipseGeometrySelectionItem();
virtual ~RimEclipseGeometrySelectionItem() override;
void setFromSelectionItem(const RiuEclipseSelectionItem* selectionItem);
virtual QString geometrySelectionText() const override;
RimEclipseCase* eclipseCase() const;
size_t gridIndex() const;
size_t cellIndex() const;
private:
caf::PdmPtrField<RimEclipseCase*> m_eclipseCase;
caf::PdmField<size_t> m_gridIndex;
caf::PdmField<size_t> m_cellIndex;
caf::PdmField<cvf::Vec3d> m_localIntersectionPoint;
};

View File

@@ -51,7 +51,7 @@ RimEclipseInputCase::RimEclipseInputCase()
: RimEclipseCase()
{
CAF_PDM_InitObject("RimInputCase", ":/EclipseInput48x48.png", "", "");
CAF_PDM_InitField(&m_gridFileName, "GridFileName", QString(), "Case grid filename", "", "" ,"");
CAF_PDM_InitField(&m_gridFileName, "GridFileName", QString(), "Case File Name", "", "" ,"");
m_gridFileName.uiCapability()->setUiReadOnly(true);
CAF_PDM_InitFieldNoDefault(&m_additionalFileNames, "AdditionalFileNames", "Additional files", "", "" ,"");
m_additionalFileNames.uiCapability()->setUiReadOnly(true);
@@ -375,6 +375,23 @@ cvf::ref<RifReaderInterface> RimEclipseInputCase::createMockModel(QString modelN
return mockFileInterface.p();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseInputCase::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
uiOrdering.add(&caseUserDescription);
uiOrdering.add(&caseId);
uiOrdering.add(&m_gridFileName);
uiOrdering.add(&m_additionalFileNames);
auto group = uiOrdering.addNewGroup("Case Options");
group->add(&activeFormationNames);
group->add(&flipXAxis);
group->add(&flipYAxis);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -60,6 +60,9 @@ public:
virtual void updateFilePathsFromProjectPath(const QString& projectPath, const QString& oldProjectPath);
protected:
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
private:
cvf::ref<RifReaderInterface> createMockModel(QString modelName);

View File

@@ -1,269 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimEclipseInputCaseOpm.h"
#include "RiaApplication.h"
#include "RiaPreferences.h"
#include "RifReaderOpmParserInput.h"
#include "RifReaderSettings.h"
#include "RigCaseCellResultsData.h"
#include "RigEclipseCaseData.h"
#include "RigMainGrid.h"
#include "RimEclipseCase.h"
#include "RimEclipseInputProperty.h"
#include "RimEclipseInputPropertyCollection.h"
#include "RimReservoirCellResultsStorage.h"
#include "RimTools.h"
#include "cafProgressInfo.h"
#include <QFileInfo>
CAF_PDM_SOURCE_INIT(RimEclipseInputCaseOpm, "EclipseInputCaseOpm");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEclipseInputCaseOpm::RimEclipseInputCaseOpm()
: RimEclipseCase()
{
CAF_PDM_InitObject("RimInputCase", ":/EclipseInput48x48.png", "", "");
CAF_PDM_InitField(&m_gridFileName, "GridFileName", QString(), "Case grid filename", "", "" ,"");
m_gridFileName.uiCapability()->setUiReadOnly(true);
CAF_PDM_InitFieldNoDefault(&m_additionalFileNames, "AdditionalFileNames", "Additional files", "", "", "");
m_additionalFileNames.uiCapability()->setUiReadOnly(true);
CAF_PDM_InitFieldNoDefault(&m_inputPropertyCollection, "InputPropertyCollection", "", "", "", "");
m_inputPropertyCollection = new RimEclipseInputPropertyCollection;
m_inputPropertyCollection->parentField()->uiCapability()->setUiHidden(true);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEclipseInputCaseOpm::~RimEclipseInputCaseOpm()
{
delete m_inputPropertyCollection;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseInputCaseOpm::importNewEclipseGridAndProperties(const QString& fileName)
{
m_gridFileName = fileName;
QFileInfo gridFileName(m_gridFileName);
QString caseName = gridFileName.completeBaseName();
this->caseUserDescription = caseName + " (opm-parser)";
importEclipseGridAndProperties(m_gridFileName);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseInputCaseOpm::appendPropertiesFromStandaloneFiles(const QStringList& fileNames)
{
for (auto filename : fileNames)
{
QFileInfo fi(filename);
if (!fi.exists()) continue;
RifReaderOpmParserPropertyReader propertyReader(filename);
std::set<std::string> fileKeywordSet = propertyReader.keywords();
std::vector<std::string> knownKeywords = RifReaderOpmParserInput::knownPropertyKeywords();
for (auto knownKeyword : knownKeywords)
{
if (fileKeywordSet.count(knownKeyword) > 0)
{
QString qtKnownKeyword = QString::fromStdString(knownKeyword);
QString resultName = this->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->makeResultNameUnique(qtKnownKeyword);
if (propertyReader.copyPropertyToCaseData(knownKeyword, this->eclipseCaseData(), resultName))
{
RimEclipseInputProperty* inputProperty = new RimEclipseInputProperty;
inputProperty->resultName = resultName;
inputProperty->eclipseKeyword = qtKnownKeyword;
inputProperty->fileName = filename;
inputProperty->resolvedState = RimEclipseInputProperty::RESOLVED;
m_inputPropertyCollection->inputProperties.push_back(inputProperty);
}
}
}
m_additionalFileNames.v().push_back(filename);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimEclipseInputCaseOpm::openEclipseGridFile()
{
importEclipseGridAndProperties(m_gridFileName);
loadAndSyncronizeInputProperties();
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimEclipseInputCaseOpm::locationOnDisc() const
{
if (m_gridFileName().isEmpty()) return QString();
QFileInfo fi(m_gridFileName);
return fi.absolutePath();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseInputCaseOpm::updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath)
{
bool foundFile = false;
std::vector<QString> searchedPaths;
m_gridFileName = RimTools::relocateFile(m_gridFileName(), newProjectPath, oldProjectPath, &foundFile, &searchedPaths);
for (size_t i = 0; i < m_additionalFileNames().size(); i++)
{
m_additionalFileNames.v()[i] = RimTools::relocateFile(m_additionalFileNames()[i], newProjectPath, oldProjectPath, &foundFile, &searchedPaths);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseInputCaseOpm::importEclipseGridAndProperties(const QString& fileName)
{
if (this->eclipseCaseData() == NULL)
{
this->setReservoirData(new RigEclipseCaseData);
RifReaderOpmParserInput::importGridPropertiesFaults(fileName, eclipseCaseData());
if (this->eclipseCaseData()->mainGrid() == NULL)
{
return;
}
this->eclipseCaseData()->mainGrid()->setFlipAxis(flipXAxis, flipYAxis);
computeCachedData();
RiaApplication* app = RiaApplication::instance();
if (app->preferences()->autocomputeDepthRelatedProperties)
{
RimReservoirCellResultsStorage* matrixResults = results(RifReaderInterface::MATRIX_RESULTS);
RimReservoirCellResultsStorage* fractureResults = results(RifReaderInterface::FRACTURE_RESULTS);
matrixResults->computeDepthRelatedResults();
fractureResults->computeDepthRelatedResults();
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseInputCaseOpm::loadAndSyncronizeInputProperties()
{
// Make sure we actually have reservoir data
CVF_ASSERT(this->eclipseCaseData());
CVF_ASSERT(this->eclipseCaseData()->mainGrid()->gridPointDimensions() != cvf::Vec3st(0, 0, 0));
// Then read the properties from all the files referenced by the InputReservoir
for (QString filename : m_additionalFileNames())
{
QFileInfo fileNameInfo(filename);
bool isExistingFile = fileNameInfo.exists();
// Find the input property objects referring to the file
std::vector<RimEclipseInputProperty*> ipsUsingThisFile = this->m_inputPropertyCollection()->findInputProperties(filename);
if (!isExistingFile)
{
for (auto inputProperty : ipsUsingThisFile)
{
inputProperty->resolvedState = RimEclipseInputProperty::FILE_MISSING;
}
}
else
{
RifReaderOpmParserPropertyReader propertyReader(filename);
std::set<std::string> fileKeywordSet = propertyReader.keywords();
for (auto inputProperty : ipsUsingThisFile)
{
QString kw = inputProperty->eclipseKeyword();
inputProperty->resolvedState = RimEclipseInputProperty::KEYWORD_NOT_IN_FILE;
if (fileKeywordSet.count(kw.toStdString()))
{
if (propertyReader.copyPropertyToCaseData(kw.toStdString(), this->eclipseCaseData(), inputProperty->resultName))
{
inputProperty->resolvedState = RimEclipseInputProperty::RESOLVED;
}
}
fileKeywordSet.erase(kw.toStdString());
}
if (!fileKeywordSet.empty())
{
std::vector<std::string> knownKeywords = RifReaderOpmParserInput::knownPropertyKeywords();
for (auto knownKeyword : knownKeywords)
{
if (fileKeywordSet.count(knownKeyword) > 0)
{
QString qtKnownKeyword = QString::fromStdString(knownKeyword);
QString resultName = this->eclipseCaseData()->results(RifReaderInterface::MATRIX_RESULTS)->makeResultNameUnique(qtKnownKeyword);
if (propertyReader.copyPropertyToCaseData(knownKeyword, this->eclipseCaseData(), resultName))
{
RimEclipseInputProperty* inputProperty = new RimEclipseInputProperty;
inputProperty->resultName = resultName;
inputProperty->eclipseKeyword = qtKnownKeyword;
inputProperty->fileName = filename;
inputProperty->resolvedState = RimEclipseInputProperty::RESOLVED;
m_inputPropertyCollection->inputProperties.push_back(inputProperty);
}
}
}
}
}
}
for(auto inputProperty : m_inputPropertyCollection->inputProperties())
{
if (inputProperty->resolvedState() == RimEclipseInputProperty::UNKNOWN)
{
inputProperty->resolvedState = RimEclipseInputProperty::FILE_MISSING;
}
}
}

View File

@@ -1,69 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RimEclipseCase.h"
#include "cafPdmChildField.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include "cvfBase.h"
#include "cvfObject.h"
class RimEclipseInputProperty;
class RimEclipseInputPropertyCollection;
//==================================================================================================
//
// This class is intended to replace RimEclipseInputCase when the opm-parser is considered stable
//
//==================================================================================================
class RimEclipseInputCaseOpm : public RimEclipseCase
{
CAF_PDM_HEADER_INIT;
public:
RimEclipseInputCaseOpm();
virtual ~RimEclipseInputCaseOpm();
void importNewEclipseGridAndProperties(const QString& fileName);
void appendPropertiesFromStandaloneFiles(const QStringList& fileNames);
// RimCase overrides
virtual bool openEclipseGridFile(); // Find grid file among file set. Read, Find read and validate property date. Syncronize child property sets.
// Overrides from RimCase
virtual QString locationOnDisc() const;
virtual QString gridFileName() const { return m_gridFileName();}
virtual void updateFilePathsFromProjectPath(const QString& projectPath, const QString& oldProjectPath);
private:
void importEclipseGridAndProperties(const QString& fileName);
void loadAndSyncronizeInputProperties();
private:
caf::PdmChildField<RimEclipseInputPropertyCollection*> m_inputPropertyCollection;
caf::PdmField<std::vector<QString> > m_additionalFileNames;
caf::PdmField<QString> m_gridFileName;
};

View File

@@ -186,24 +186,26 @@ void RimEclipsePropertyFilter::defineUiOrdering(QString uiConfigName, caf::PdmUi
caf::PdmUiGroup* group1 = uiOrdering.addNewGroup("Result");
resultDefinition->uiOrdering(uiConfigName, *group1);
caf::PdmUiGroup& group2 = *(uiOrdering.addNewGroup("Filter Settings"));
// Fields declared in RimCellFilter
uiOrdering.add(&filterMode);
group2.add(&filterMode);
uiOrdering.add(&m_rangeLabelText);
group2.add(&m_rangeLabelText);
if (resultDefinition->hasCategoryResult())
{
uiOrdering.add(&m_useCategorySelection);
group2.add(&m_useCategorySelection);
}
if ( resultDefinition->hasCategoryResult() && m_useCategorySelection() )
{
uiOrdering.add(&m_selectedCategoryValues);
group2.add(&m_selectedCategoryValues);
}
else
{
uiOrdering.add(&m_lowerBound);
uiOrdering.add(&m_upperBound);
group2.add(&m_lowerBound);
group2.add(&m_upperBound);
}
uiOrdering.skipRemainingFields(true);

View File

@@ -55,10 +55,13 @@ RimEclipseResultCase::RimEclipseResultCase()
{
CAF_PDM_InitObject("Eclipse Case", ":/Case48x48.png", "", "");
CAF_PDM_InitField(&caseFileName, "CaseFileName", QString(), "Case file name", "", "" ,"");
CAF_PDM_InitField(&caseFileName, "CaseFileName", QString(), "Case File Name", "", "" ,"");
caseFileName.uiCapability()->setUiReadOnly(true);
CAF_PDM_InitFieldNoDefault (&m_flowDiagSolutions, "FlowDiagSolutions", "Flow Diagnostics Solutions", "", "", "");
m_flowDiagSolutions.uiCapability()->setUiHidden(true);
m_flowDiagSolutions.uiCapability()->setUiTreeHidden(true);
m_flowDiagSolutions.uiCapability()->setUiTreeChildrenHidden(true);
// Obsolete, unused field
CAF_PDM_InitField(&caseDirectory, "CaseFolder", QString(), "Directory", "", "" ,"");
@@ -432,5 +435,11 @@ void RimEclipseResultCase::defineUiOrdering(QString uiConfigName, caf::PdmUiOrde
uiOrdering.add(&caseUserDescription);
uiOrdering.add(&caseId);
uiOrdering.add(&caseFileName);
auto group = uiOrdering.addNewGroup("Case Options");
group->add(&activeFormationNames);
group->add(&flipXAxis);
group->add(&flipYAxis);
}

View File

@@ -100,7 +100,8 @@ RimEclipseResultDefinition::RimEclipseResultDefinition()
CAF_PDM_InitFieldNoDefault(&m_flowSolutionUiField, "MFlowDiagSolution", "Solution", "", "", "");
m_flowSolutionUiField.xmlCapability()->setIOReadable(false);
m_flowSolutionUiField.xmlCapability()->setIOWritable(false);
m_flowSolutionUiField.uiCapability()->setUiHidden(true); // For now since there are only one to choose from
CAF_PDM_InitFieldNoDefault(&m_selectedTracersUiField, "MSelectedTracers", " ", "", "", "");
m_selectedTracersUiField.xmlCapability()->setIOReadable(false);
m_selectedTracersUiField.xmlCapability()->setIOWritable(false);
@@ -672,7 +673,7 @@ RigFlowDiagResultAddress RimEclipseResultDefinition::flowDiagResAddress() const
}
else
{
RimFlowDiagSolution* flowSol = m_flowSolutionUiField();
RimFlowDiagSolution* flowSol = m_flowSolution();
if (flowSol)
{
std::vector<QString> tracerNames = flowSol->tracerNames();

View File

@@ -75,7 +75,7 @@ RimEclipseStatisticsCase::RimEclipseStatisticsCase()
m_selectionSummary.xmlCapability()->setIOReadable(false);
m_selectionSummary.uiCapability()->setUiReadOnly(true);
m_selectionSummary.uiCapability()->setUiEditorTypeName(caf::PdmUiTextEditor::uiEditorTypeName());
m_selectionSummary.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::TOP);
m_selectionSummary.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
CAF_PDM_InitFieldNoDefault(&m_resultType, "ResultType", "Result Type", "", "", "");
m_resultType.xmlCapability()->setIOWritable(false);
@@ -114,6 +114,11 @@ RimEclipseStatisticsCase::RimEclipseStatisticsCase()
CAF_PDM_InitField(&m_useZeroAsInactiveCellValue, "UseZeroAsInactiveCellValue", false, "Use Zero as Inactive Cell Value", "", "", "");
m_populateSelectionAfterLoadingGrid = false;
// These does not work properly for statistics case, so hide for now
flipXAxis.uiCapability()->setUiHidden(true);
flipYAxis.uiCapability()->setUiHidden(true);
activeFormationNames.uiCapability()->setUiHidden(true);
}
//--------------------------------------------------------------------------------------------------
@@ -339,12 +344,16 @@ void RimEclipseStatisticsCase::defineUiOrdering(QString uiConfigName, caf::PdmUi
updatePercentileUiVisibility();
uiOrdering.add(&caseUserDescription);
uiOrdering.add(&caseId);
uiOrdering.add(&m_calculateEditCommand);
uiOrdering.add(&m_selectionSummary);
caf::PdmUiGroup * group = uiOrdering.addNewGroup("Properties to consider");
uiOrdering.add(&m_calculateEditCommand);
caf::PdmUiGroup * group = uiOrdering.addNewGroup("Summary of Calculation Setup");
group->add(&m_useZeroAsInactiveCellValue);
m_useZeroAsInactiveCellValue.uiCapability()->setUiHidden(hasComputedStatistics());
group->add(&m_selectionSummary);
group = uiOrdering.addNewGroup("Properties to consider");
group->setUiHidden(hasComputedStatistics());
group->add(&m_resultType);
group->add(&m_porosityModel);
@@ -357,8 +366,6 @@ void RimEclipseStatisticsCase::defineUiOrdering(QString uiConfigName, caf::PdmUi
group->add(&m_selectedFractureGeneratedProperties);
group->add(&m_selectedFractureInputProperties);
uiOrdering.add(&m_useZeroAsInactiveCellValue);
m_useZeroAsInactiveCellValue.uiCapability()->setUiHidden(hasComputedStatistics());
group = uiOrdering.addNewGroup("Percentile setup");
group->setUiHidden(hasComputedStatistics());
@@ -368,6 +375,11 @@ void RimEclipseStatisticsCase::defineUiOrdering(QString uiConfigName, caf::PdmUi
group->add(&m_midPercentile);
group->add(&m_highPercentile);
group = uiOrdering.addNewGroup("Case Options");
group->add(&m_wellDataSourceCase);
group->add(&activeFormationNames);
group->add(&flipXAxis);
group->add(&flipYAxis);
}
QList<caf::PdmOptionItemInfo> toOptionList(const QStringList& varList)
@@ -451,6 +463,7 @@ QList<caf::PdmOptionItemInfo> RimEclipseStatisticsCase::calculateValueOptions(co
return toOptionList(sourceCaseNames);
}
if (!options.size()) options = RimEclipseCase::calculateValueOptions(fieldNeedingOptions, useOptionsOnly);
return options;
}
@@ -460,6 +473,8 @@ QList<caf::PdmOptionItemInfo> RimEclipseStatisticsCase::calculateValueOptions(co
//--------------------------------------------------------------------------------------------------
void RimEclipseStatisticsCase::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
RimEclipseCase::fieldChangedByUi(changedField, oldValue, newValue);
if (&m_resultType == changedField || &m_porosityModel == changedField)
{
}
@@ -701,7 +716,7 @@ void RimEclipseStatisticsCase::computeStatisticsAndUpdateViews()
if (reservoirViews.size() == 0)
{
RicNewViewFeature::addReservoirView();
RicNewViewFeature::addReservoirView(this, nullptr);
}
}

View File

@@ -1,111 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimEclipseTopologyItem.h"
#include "RigTimeHistoryResultAccessor.h"
#include "RimEclipseCase.h"
#include "RimEclipseView.h"
#include "RiuSelectionManager.h"
CAF_PDM_SOURCE_INIT(RimEclipseTopologyItem, "RimEclipseTopologyItem");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEclipseTopologyItem::RimEclipseTopologyItem()
{
CAF_PDM_InitObject("Eclipse Topoloty Item", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_eclipseCase, "EclipseCase", "Eclipse Case", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_gridIndex, "m_gridIndex", "m_gridIndex", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_cellIndex, "m_cellIndex", "m_cellIndex", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_localIntersectionPoint, "m_localIntersectionPoint", "m_localIntersectionPoint", "", "", "");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEclipseTopologyItem::~RimEclipseTopologyItem()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseTopologyItem::setFromSelectionItem(const RiuEclipseSelectionItem* selectionItem)
{
m_gridIndex = selectionItem->m_gridIndex;
m_cellIndex = selectionItem->m_cellIndex;
m_localIntersectionPoint = selectionItem->m_localIntersectionPoint;
m_eclipseCase = selectionItem->m_view->eclipseCase();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimEclipseTopologyItem::topologyText() const
{
QString text;
if (m_eclipseCase)
{
text += m_eclipseCase->caseUserDescription();
}
else
{
text = "No case";
}
text += ", ";
text += QString("Grid index %1").arg(m_gridIndex);
text += ", ";
text += RigTimeHistoryResultAccessor::topologyText(m_eclipseCase->eclipseCaseData(), m_gridIndex, m_cellIndex);
return text;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEclipseCase* RimEclipseTopologyItem::eclipseCase() const
{
return m_eclipseCase;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RimEclipseTopologyItem::gridIndex() const
{
return m_gridIndex;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
size_t RimEclipseTopologyItem::cellIndex() const
{
return m_cellIndex;
}

View File

@@ -1,56 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RimPickingTopologyItem.h"
#include "cafPdmField.h"
#include "cafPdmFieldCvfVec3d.h"
#include "cafPdmPtrField.h"
class RimEclipseCase;
class RiuEclipseSelectionItem;
//==================================================================================================
///
///
//==================================================================================================
class RimEclipseTopologyItem : public RimPickingTopologyItem
{
CAF_PDM_HEADER_INIT;
public:
RimEclipseTopologyItem();
virtual ~RimEclipseTopologyItem() override;
void setFromSelectionItem(const RiuEclipseSelectionItem* selectionItem);
virtual QString topologyText() const override;
RimEclipseCase* eclipseCase() const;
size_t gridIndex() const;
size_t cellIndex() const;
private:
caf::PdmPtrField<RimEclipseCase*> m_eclipseCase;
caf::PdmField<size_t> m_gridIndex;
caf::PdmField<size_t> m_cellIndex;
caf::PdmField<cvf::Vec3d> m_localIntersectionPoint;
};

View File

@@ -440,14 +440,18 @@ void RimEclipseView::createDisplayModel()
*/
// Well path model
RigMainGrid* mainGrid = this->mainGrid();
m_wellPathPipeVizModel->removeAllParts();
addWellPathsToModel(m_wellPathPipeVizModel.p(),
mainGrid->displayModelOffset(),
mainGrid->characteristicIJCellSize(),
currentActiveCellInfo()->geometryBoundingBox(),
m_reservoirGridPartManager->scaleTransform());
RigMainGrid* mainGrid = this->mainGrid();
if (mainGrid)
{
addWellPathsToModel(m_wellPathPipeVizModel.p(),
mainGrid->displayModelOffset(),
mainGrid->characteristicIJCellSize(),
currentActiveCellInfo()->geometryBoundingBox(),
m_reservoirGridPartManager->scaleTransform());
}
m_viewer->addStaticModelOnce(m_wellPathPipeVizModel.p());
@@ -1337,15 +1341,7 @@ const std::vector<RivCellSetEnum>& RimEclipseView::visibleGridParts() const
//--------------------------------------------------------------------------------------------------
void RimEclipseView::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
caf::PdmUiGroup* viewGroup = uiOrdering.addNewGroup("Viewer");
viewGroup->add(&name);
viewGroup->add(&backgroundColor);
viewGroup->add(&showGridBox);
caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup("Grid Appearance");
gridGroup->add(&scaleZ);
gridGroup->add(&meshMode);
gridGroup->add(&surfaceMode);
RimView::defineUiOrdering(uiConfigName, uiOrdering);
caf::PdmUiGroup* cellGroup = uiOrdering.addNewGroup("Cell Visibility");
cellGroup->add(&showMainGrid);

View File

@@ -61,8 +61,8 @@ RimEclipseWell::RimEclipseWell()
CAF_PDM_InitField(&showWellPipe, "ShowWellPipe", true, "Pipe", "", "", "");
CAF_PDM_InitField(&showWellSpheres, "ShowWellSpheres", false, "Spheres", "", "", "");
CAF_PDM_InitField(&wellHeadScaleFactor, "WellHeadScaleFactor", 1.0, "Well Head Scale Factor", "", "", "");
CAF_PDM_InitField(&pipeScaleFactor, "WellPipeRadiusScale", 1.0, "Pipe Scale Factor", "", "", "");
CAF_PDM_InitField(&wellHeadScaleFactor, "WellHeadScaleFactor", 1.0, "Well Head Scale", "", "", "");
CAF_PDM_InitField(&pipeScaleFactor, "WellPipeRadiusScale", 1.0, "Pipe Radius Scale", "", "", "");
CAF_PDM_InitField(&wellPipeColor, "WellPipeColor", cvf::Color3f(0.588f, 0.588f, 0.804f), "Pipe Color", "", "", "");
CAF_PDM_InitField(&showWellCells, "ShowWellCells", false, "Well Cells", "", "", "");
@@ -353,16 +353,17 @@ void RimEclipseWell::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering&
appearanceGroup->add(&showWellPipe);
appearanceGroup->add(&showWellSpheres);
caf::PdmUiGroup* sizeScalingGroup = uiOrdering.addNewGroup("Size Scaling");
sizeScalingGroup->add(&pipeScaleFactor);
sizeScalingGroup->add(&wellHeadScaleFactor);
uiOrdering.add(&wellPipeColor);
uiOrdering.add(&showWellCells);
uiOrdering.add(&showWellCellFence);
caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup("Well Cells and Fence");
filterGroup->add(&showWellCells);
filterGroup->add(&showWellCellFence);
showWellCellFence.uiCapability()->setUiReadOnly(!showWellCells());
caf::PdmUiGroup* sizeScalingGroup = uiOrdering.addNewGroup("Size Scaling");
sizeScalingGroup->add(&wellHeadScaleFactor);
sizeScalingGroup->add(&pipeScaleFactor);
caf::PdmUiGroup* colorGroup = uiOrdering.addNewGroup("Colors");
colorGroup->add(&wellPipeColor);
uiOrdering.skipRemainingFields(true);
}

View File

@@ -87,8 +87,8 @@ namespace caf
template<>
void RimEclipseWellCollection::WellHeadPositionEnum::setUp()
{
addItem(RimEclipseWellCollection::WELLHEAD_POS_ACTIVE_CELLS_BB, "WELLHEAD_POS_ACTIVE_CELLS_BB", "All Active Cells");
addItem(RimEclipseWellCollection::WELLHEAD_POS_TOP_COLUMN, "WELLHEAD_POS_TOP_COLUMN", "Active Cell Column");
addItem(RimEclipseWellCollection::WELLHEAD_POS_ACTIVE_CELLS_BB, "WELLHEAD_POS_ACTIVE_CELLS_BB", "Top of Active Cells");
addItem(RimEclipseWellCollection::WELLHEAD_POS_TOP_COLUMN, "WELLHEAD_POS_TOP_COLUMN", "Top of Active Cell Column");
setDefault(RimEclipseWellCollection::WELLHEAD_POS_TOP_COLUMN);
}
}
@@ -116,7 +116,9 @@ RimEclipseWellCollection::RimEclipseWellCollection()
CAF_PDM_InitField(&isActive, "Active", true, "Active", "", "", "");
isActive.uiCapability()->setUiHidden(true);
CAF_PDM_InitField(&showWellsIntersectingVisibleCells, "ShowWellsIntersectingVisibleCells", false, "Hide Wells Not Intersecting Filtered Cells", "", "", "");
//CAF_PDM_InitField(&showWellsIntersectingVisibleCells, "ShowWellsIntersectingVisibleCells", false, "Hide Wells Not Intersecting Filtered Cells", "", "", "");
CAF_PDM_InitField(&showWellsIntersectingVisibleCells, "ShowWellsIntersectingVisibleCells", false, "Wells Through Visible Cells Only", "", "", "");
//CAF_PDM_InitField(&showWellsIntersectingVisibleCells, "ShowWellsIntersectingVisibleCells", false, "Hide Wells Missing Visible Cells", "", "", "");
// Appearance
CAF_PDM_InitFieldNoDefault(&m_showWellHead, "ShowWellHeadTristate", "Well Head", "", "", "");
@@ -141,28 +143,28 @@ RimEclipseWellCollection::RimEclipseWellCollection()
m_showWellSpheres.xmlCapability()->setIOWritable(false);
// Scaling
CAF_PDM_InitField(&wellHeadScaleFactor, "WellHeadScale", 1.0, "Well Head Scale Factor", "", "", "");
CAF_PDM_InitField(&pipeScaleFactor, "WellPipeRadiusScale", 0.1, "Well Pipe Scale Factor", "", "", "");
CAF_PDM_InitField(&spheresScaleFactor, "CellCenterSphereScale", 0.2, "Well Sphere Scale Factor", "", "", "");
CAF_PDM_InitField(&wellHeadScaleFactor, "WellHeadScale", 1.0, "Well Head Scale", "", "", "");
CAF_PDM_InitField(&pipeScaleFactor, "WellPipeRadiusScale", 0.1, "Pipe Radius Scale ", "", "", "");
CAF_PDM_InitField(&spheresScaleFactor, "CellCenterSphereScale", 0.2, "Sphere Radius Scale", "", "", "");
// Color
cvf::Color3f defWellLabelColor = RiaApplication::instance()->preferences()->defaultWellLabelColor();
CAF_PDM_InitField(&wellLabelColor, "WellLabelColor", defWellLabelColor, "Well Label Color", "", "", "");
CAF_PDM_InitField(&wellLabelColor, "WellLabelColor", defWellLabelColor, "Label Color", "", "", "");
CAF_PDM_InitField(&showConnectionStatusColors, "ShowConnectionStatusColors", true, "Show Connection Status Colors Along Well", "", "", "");
CAF_PDM_InitField(&showConnectionStatusColors, "ShowConnectionStatusColors", true, "Color Pipe Connections", "", "", "");
cvf::Color3f defaultApplyColor = cvf::Color3f::YELLOW;
CAF_PDM_InitField(&m_wellColorForApply, "WellColorForApply", defaultApplyColor, "Well Color", "", "", "");
CAF_PDM_InitField(&m_wellColorForApply, "WellColorForApply", defaultApplyColor, "", "", "", "");
CAF_PDM_InitField(&m_applySingleColorToWells, "ApplySingleColorToWells", false, "", "", "", "");
CAF_PDM_InitField(&m_applySingleColorToWells, "ApplySingleColorToWells", false, "Uniform Pipe Colors", "", "", "");
m_applySingleColorToWells.uiCapability()->setUiEditorTypeName(caf::PdmUiPushButtonEditor::uiEditorTypeName());
m_applySingleColorToWells.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
m_applySingleColorToWells.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::LEFT);
m_applySingleColorToWells.xmlCapability()->setIOReadable(false);
m_applySingleColorToWells.xmlCapability()->setIOWritable(false);
CAF_PDM_InitField(&m_applyIndividualColorsToWells, "ApplyIndividualColorsToWells", false, "", "", "", "");
CAF_PDM_InitField(&m_applyIndividualColorsToWells, "ApplyIndividualColorsToWells", false, "Unique Pipe Colors", "", "", "");
m_applyIndividualColorsToWells.uiCapability()->setUiEditorTypeName(caf::PdmUiPushButtonEditor::uiEditorTypeName());
m_applyIndividualColorsToWells.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
m_applyIndividualColorsToWells.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::LEFT);
m_applyIndividualColorsToWells.xmlCapability()->setIOReadable(false);
m_applyIndividualColorsToWells.xmlCapability()->setIOWritable(false);
@@ -178,8 +180,8 @@ RimEclipseWellCollection::RimEclipseWellCollection()
CAF_PDM_InitField(&wellCellFenceType, "DefaultWellFenceDirection", WellFenceEnum(K_DIRECTION), "Well Fence Direction", "", "", "");
CAF_PDM_InitField(&wellCellTransparencyLevel, "WellCellTransparency", 0.5, "Well Cell Transparency", "", "", "");
CAF_PDM_InitField(&isAutoDetectingBranches, "IsAutoDetectingBranches", true, "Branch Detection", "", "Toggle wether the well pipe visualization will try to detect when a part of the well \nis really a branch, and thus is starting from wellhead", "");
CAF_PDM_InitField(&wellHeadPosition, "WellHeadPosition", WellHeadPositionEnum(WELLHEAD_POS_TOP_COLUMN), "Well Head Position On Top Of", "", "", "");
CAF_PDM_InitField(&isAutoDetectingBranches, "IsAutoDetectingBranches", true, "Branch Detection", "", "Toggle whether the well pipe visualization will try to detect when a part of the well \nis really a branch, and thus is starting from wellhead", "");
CAF_PDM_InitField(&wellHeadPosition, "WellHeadPosition", WellHeadPositionEnum(WELLHEAD_POS_TOP_COLUMN), "Well Head Position", "", "", "");
CAF_PDM_InitFieldNoDefault(&wells, "Wells", "Wells", "", "", "");
wells.uiCapability()->setUiHidden(true);
@@ -201,7 +203,7 @@ RimEclipseWellCollection::RimEclipseWellCollection()
CAF_PDM_InitField(&obsoleteField_showWellLabel, "ShowWellLabel", true, "Show Well Label", "", "", "");
CAF_PDM_InitField(&obsoleteField_showWellCellFence, "ShowWellFences", false, "Show Well Cell Fence", "", "", "");
CAF_PDM_InitField(&m_showWellCommunicationLines, "ShowWellCommunicationLines", false, "Show Communication Lines", "", "", "");
CAF_PDM_InitField(&m_showWellCommunicationLines, "ShowWellCommunicationLines", false, "Communication Lines", "", "", "");
obsoleteField_showWellHead.uiCapability()->setUiHidden(true);
obsoleteField_showWellLabel.uiCapability()->setUiHidden(true);
@@ -474,23 +476,17 @@ void RimEclipseWellCollection::fieldChangedByUi(const caf::PdmFieldHandle* chang
//--------------------------------------------------------------------------------------------------
void RimEclipseWellCollection::assignDefaultWellColors()
{
const caf::ColorTable& colorTable = RiaColorTables::wellsPaletteColors();
cvf::Color3ubArray wellColors = colorTable.color3ubArray();
cvf::Color3ubArray interpolatedWellColors = wellColors;
if (wells.size() > 1)
{
interpolatedWellColors = caf::ColorTable::interpolateColorArray(wellColors, wells.size());
}
RimEclipseCase* ownerCase;
firstAncestorOrThisOfTypeAsserted(ownerCase);
for (size_t wIdx = 0; wIdx < wells.size(); ++wIdx)
{
RimEclipseWell* well = wells[wIdx];
if (well)
if (well && well->wellResults() )
{
cvf::Color3f col = cvf::Color3f(interpolatedWellColors[wIdx]);
well->wellPipeColor = col;
well->updateConnectedEditors();
well->wellPipeColor = ownerCase->defaultWellColor(well->wellResults()->m_wellName);
}
}
@@ -528,42 +524,41 @@ void RimEclipseWellCollection::defineUiOrdering(QString uiConfigName, caf::PdmUi
{
updateStateForVisibilityCheckboxes();
uiOrdering.add(&showWellsIntersectingVisibleCells);
caf::PdmUiGroup* appearanceGroup = uiOrdering.addNewGroup("Visibility");
appearanceGroup->add(&showWellsIntersectingVisibleCells);
appearanceGroup->add(&m_showWellLabel);
appearanceGroup->add(&m_showWellHead);
appearanceGroup->add(&m_showWellPipe);
appearanceGroup->add(&m_showWellSpheres);
appearanceGroup->add(&m_showWellCommunicationLines);
caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup("Well Cells and Fence");
filterGroup->add(&m_showWellCells);
filterGroup->add(&m_showWellCellFence);
filterGroup->add(&wellCellFenceType);
caf::PdmUiGroup* sizeScalingGroup = uiOrdering.addNewGroup("Size Scaling");
sizeScalingGroup->add(&wellHeadScaleFactor);
sizeScalingGroup->add(&pipeScaleFactor);
sizeScalingGroup->add(&spheresScaleFactor);
caf::PdmUiGroup* colorGroup = uiOrdering.addNewGroup("Color");
caf::PdmUiGroup* colorGroup = uiOrdering.addNewGroup("Colors");
colorGroup->setCollapsedByDefault(true);
colorGroup->add(&showConnectionStatusColors);
colorGroup->add(&wellLabelColor);
colorGroup->add(&m_applyIndividualColorsToWells);
colorGroup->add(&m_applySingleColorToWells);
colorGroup->add(&m_wellColorForApply);
caf::PdmUiGroup* singleWellColorGroup = colorGroup->addNewGroup("Uniform Well Coloring");
singleWellColorGroup->add(&m_wellColorForApply);
singleWellColorGroup->add(&m_applySingleColorToWells);
caf::PdmUiGroup* wellPipeGroup = uiOrdering.addNewGroup("Well Pipe Geometry");
caf::PdmUiGroup* wellPipeGroup = uiOrdering.addNewGroup("Well Pipe Geometry" );
wellPipeGroup->add(&wellPipeCoordType);
wellPipeGroup->add(&isAutoDetectingBranches);
wellPipeGroup->add(&showConnectionStatusColors);
caf::PdmUiGroup* advancedGroup = uiOrdering.addNewGroup("Advanced");
advancedGroup->setCollapsedByDefault(true);
advancedGroup->add(&wellCellTransparencyLevel);
advancedGroup->add(&wellHeadPosition);
caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup("Well Cells");
filterGroup->add(&obsoleteField_wellCellsToRangeFilterMode);
filterGroup->add(&m_showWellCells);
filterGroup->add(&m_showWellCellFence);
filterGroup->add(&wellCellFenceType);
RimEclipseResultCase* ownerCase;
firstAncestorOrThisOfTypeAsserted(ownerCase);
m_showWellCommunicationLines.uiCapability()->setUiHidden(!ownerCase->flowDiagSolverInterface());
@@ -712,7 +707,7 @@ void RimEclipseWellCollection::defineEditorAttribute(const caf::PdmFieldHandle*
caf::PdmUiPushButtonEditorAttribute* editorAttr = dynamic_cast<caf::PdmUiPushButtonEditorAttribute*>(attribute);
if (editorAttr)
{
editorAttr->m_buttonText = "Apply Default Well Colors";
editorAttr->m_buttonText = "Apply";
}
}
@@ -724,13 +719,13 @@ void RimEclipseWellCollection::defineEditorAttribute(const caf::PdmFieldHandle*
QColor col;
col.setRgbF(m_wellColorForApply().r(), m_wellColorForApply().g(), m_wellColorForApply().b());
QPixmap pixmap(100, 100);
QPixmap pixmap(20, 20);
pixmap.fill(col);
QIcon colorIcon(pixmap);
editorAttr->m_buttonIcon = colorIcon;
editorAttr->m_buttonText = "Apply Uniform Well Color";
editorAttr->m_buttonText = "Apply";
}
}
}

View File

@@ -50,7 +50,7 @@ RimGeoMechCase::RimGeoMechCase(void)
{
CAF_PDM_InitObject("Geomechanical Case", ":/GeoMechCase48x48.png", "", "");
CAF_PDM_InitField(&m_caseFileName, "CaseFileName", QString(), "Case file name", "", "", "");
CAF_PDM_InitField(&m_caseFileName, "CaseFileName", QString(), "Case File Name", "", "", "");
m_caseFileName.uiCapability()->setUiReadOnly(true);
CAF_PDM_InitFieldNoDefault(&geoMechViews, "GeoMechViews", "", "", "", "");
geoMechViews.uiCapability()->setUiHidden(true);

View File

@@ -135,17 +135,18 @@ void RimGeoMechPropertyFilter::defineUiOrdering(QString uiConfigName, caf::PdmUi
caf::PdmUiGroup* group1 = uiOrdering.addNewGroup("Result");
resultDefinition->uiOrdering(uiConfigName, *group1);
uiOrdering.add(&isActive);
uiOrdering.add(&filterMode);
caf::PdmUiGroup& group2 = *(uiOrdering.addNewGroup("Filter Settings"));
group2.add(&filterMode);
if ( resultDefinition->hasCategoryResult() )
{
uiOrdering.add(&m_selectedCategoryValues);
group2.add(&m_selectedCategoryValues);
}
else
{
uiOrdering.add(&lowerBound);
uiOrdering.add(&upperBound);
group2.add(&lowerBound);
group2.add(&upperBound);
}
updateReadOnlyStateOfAllFields();

View File

@@ -0,0 +1,38 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimGeometrySelectionItem.h"
CAF_PDM_XML_ABSTRACT_SOURCE_INIT(RimGeometrySelectionItem, "GeometrySelectionItem");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGeometrySelectionItem::RimGeometrySelectionItem()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGeometrySelectionItem::~RimGeometrySelectionItem()
{
}

View File

@@ -0,0 +1,32 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafPdmObject.h"
class RimGeometrySelectionItem : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimGeometrySelectionItem();
virtual ~RimGeometrySelectionItem();
virtual QString geometrySelectionText() const = 0;
};

Some files were not shown because too many files have changed in this diff Show More