Merge pull request #107 from OPM/internal

Update to 1.0.0
This commit is contained in:
Magne Sjaastad 2013-10-25 01:48:47 -07:00
commit 04b54d89c9
105 changed files with 5000 additions and 255 deletions

View File

@ -72,6 +72,7 @@
#include "RimCellPropertyFilterCollection.h"
#include "Rim3dOverlayInfoConfig.h"
#include "RimWellCollection.h"
#include "cafCeetronPlusNavigation.h"
namespace caf
{
@ -1132,7 +1133,7 @@ void RiaApplication::applyPreferences()
}
else
{
m_activeReservoirView->viewer()->setNavigationPolicy(new caf::CeetronNavigation);
m_activeReservoirView->viewer()->setNavigationPolicy(new caf::CeetronPlusNavigation);
}
m_activeReservoirView->viewer()->enablePerfInfoHud(m_preferences->showHud());
@ -1631,10 +1632,8 @@ QString RiaApplication::commandLineParameterHelp() const
"\n"
"-project <filename> Open project file <filename>\n"
"\n"
"-case <casename> Open Eclipse case <casename>\n"
"-case <casename> Import Eclipse case <casename>\n"
" (do not include .GRID/.EGRID)\n"
"\n"
"-startdir The default directory for open/save commands\n"
"\n"
"-savesnapshots Save snapshot of all views to 'snapshots' folder in project file folder\n"
" Application closes after snapshots are written to file\n"

View File

@ -27,7 +27,7 @@ CAF_PDM_SOURCE_INIT(RiaRegressionTest, "RiaRegressionTest");
//--------------------------------------------------------------------------------------------------
RiaRegressionTest::RiaRegressionTest(void)
{
CAF_PDM_InitFieldNoDefault(&applicationWorkingFolder, "workingFolder", "Application Working Folder", "", "", "");
CAF_PDM_InitFieldNoDefault(&applicationWorkingFolder, "workingFolder", "Folder containing <b>compare</b>", "", "Location of compare tool from Image Magic suite", "");
applicationWorkingFolder.setUiEditorTypeName(caf::PdmUiFilePathEditor::uiEditorTypeName());
CAF_PDM_InitFieldNoDefault(&regressionTestFolder, "regressionTestFolder", "Regression Test Folder", "", "", "");

View File

@ -1464,6 +1464,9 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL
if (activeCellInfo->globalActiveCellCount() > 0)
{
size_t timeStepsAllCells = keywordDataItemCounts[i] / activeCellInfo->globalCellCount();
size_t timeStepsAllCellsRest = keywordDataItemCounts[i] % activeCellInfo->globalCellCount();
size_t timeStepsMatrix = keywordDataItemCounts[i] / activeCellInfo->globalActiveCellCount();
size_t timeStepsMatrixRest = keywordDataItemCounts[i] % activeCellInfo->globalActiveCellCount();
@ -1479,6 +1482,11 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL
keywordsWithCorrectNumberOfDataItems.push_back(keywords[i]);
}
}
else if (timeStepsAllCellsRest == 0)
{
keywordsWithCorrectNumberOfDataItems.push_back(keywords[i]);
}
}
else
{
@ -1486,6 +1494,10 @@ QStringList RifReaderEclipseOutput::validKeywordsForPorosityModel(const QStringL
{
keywordsWithCorrectNumberOfDataItems.push_back(keywords[i]);
}
else if (timeStepsAllCellsRest == 0)
{
keywordsWithCorrectNumberOfDataItems.push_back(keywords[i]);
}
}
}
else

View File

@ -84,6 +84,7 @@ void RivWellPathCollectionPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBa
{
setScaleTransform(scaleTransform);
if (!m_wellPathCollection->isActive()) return;
if (m_wellPathCollection->wellPathVisibility() == RimWellPathCollection::FORCE_ALL_OFF) return;
for (size_t wIdx = 0; wIdx < m_wellPathCollection->wellPaths.size(); wIdx++)

View File

@ -43,6 +43,7 @@ ${CEE_CURRENT_LIST_DIR}RimReservoirCellResultsCacher.h
${CEE_CURRENT_LIST_DIR}RimStatisticsCaseEvaluator.h
${CEE_CURRENT_LIST_DIR}RimMimeData.h
${CEE_CURRENT_LIST_DIR}RimCommandObject.h
${CEE_CURRENT_LIST_DIR}RimTools.h
)
set (SOURCE_GROUP_SOURCE_FILES
@ -84,6 +85,7 @@ ${CEE_CURRENT_LIST_DIR}RimReservoirCellResultsCacher.cpp
${CEE_CURRENT_LIST_DIR}RimStatisticsCaseEvaluator.cpp
${CEE_CURRENT_LIST_DIR}RimMimeData.cpp
${CEE_CURRENT_LIST_DIR}RimCommandObject.cpp
${CEE_CURRENT_LIST_DIR}RimTools.cpp
)
list(APPEND CODE_HEADER_FILES

View File

@ -40,7 +40,7 @@ CAF_PDM_SOURCE_INIT(Rim3dOverlayInfoConfig, "View3dOverlayInfoConfig");
//--------------------------------------------------------------------------------------------------
Rim3dOverlayInfoConfig::Rim3dOverlayInfoConfig()
{
CAF_PDM_InitObject("Overlay 3D info", ":/Legend.png", "", "");
CAF_PDM_InitObject("Overlay 3D info", ":/InfoBox16x16.png", "", "");
CAF_PDM_InitField(&active, "Active", true, "Active", "", "", "");
active.setUiHidden(true);

View File

@ -61,7 +61,7 @@ RimIdenticalGridCaseGroup::RimIdenticalGridCaseGroup()
groupId.setUiReadOnly(true);
CAF_PDM_InitFieldNoDefault(&statisticsCaseCollection, "StatisticsCaseCollection", "Derived Statistics", ":/Histograms16x16.png", "", "");
CAF_PDM_InitFieldNoDefault(&caseCollection, "CaseCollection", "Cases", ":/Cases16x16.png", "", "");
CAF_PDM_InitFieldNoDefault(&caseCollection, "CaseCollection", "Source Cases", ":/Cases16x16.png", "", "");
caseCollection = new RimCaseCollection;
statisticsCaseCollection = new RimCaseCollection;

View File

@ -123,7 +123,7 @@ void RimProject::close()
casesObsolete.deleteAllChildObjects();
caseGroupsObsolete.deleteAllChildObjects();
wellPathImport = new RimWellPathImport();
wellPathImport->regions().deleteAllChildObjects();
commandObjects.deleteAllChildObjects();
@ -344,6 +344,16 @@ void RimProject::setProjectFileNameAndUpdateDependencies(const QString& fileName
{
cases[i]->updateFilePathsFromProjectPath(newProjectPath, oldProjectPath);
}
// Update path to well path file cache
for (size_t oilFieldIdx = 0; oilFieldIdx < oilFields().size(); oilFieldIdx++)
{
RimOilField* oilField = oilFields[oilFieldIdx];
if (oilField == NULL || oilField->wellPathCollection == NULL) continue;
oilField->wellPathCollection->updateFilePathsFromProjectPath();
}
wellPathImport->updateFilePaths();
}
//--------------------------------------------------------------------------------------------------

View File

@ -47,6 +47,7 @@
#include "RimWellPathCollection.h"
#include "RimOilField.h"
#include "RimAnalysisModels.h"
#include "RimTools.h"
CAF_PDM_SOURCE_INIT(RimReservoirCellResultsStorage, "ReservoirCellResultStorage");
@ -211,11 +212,8 @@ QString RimReservoirCellResultsStorage::getValidCacheFileName()
//--------------------------------------------------------------------------------------------------
QString RimReservoirCellResultsStorage::getCacheDirectoryPath()
{
QString cacheDirPath;
QString projectFileName = RiaApplication::instance()->project()->fileName();
QFileInfo fileInfo(projectFileName);
cacheDirPath = fileInfo.canonicalPath();
cacheDirPath += "/" + fileInfo.completeBaseName() + "_cache";
QString cacheDirPath = RimTools::getCacheRootDirectoryPathFromProject();
cacheDirPath += "_cache";
return cacheDirPath;
}

View File

@ -72,6 +72,7 @@
#include "cvfOverlayScalarMapperLegend.h"
#include <limits.h>
#include "cafCeetronPlusNavigation.h"
namespace caf {
@ -122,7 +123,7 @@ RimReservoirView::RimReservoirView()
CAF_PDM_InitFieldNoDefault(&cellEdgeResult, "GridCellEdgeResult", "Cell Edge Result", ":/EdgeResult_1.png", "", "");
cellEdgeResult = new RimCellEdgeResultSlot();
CAF_PDM_InitFieldNoDefault(&overlayInfoConfig, "OverlayInfoConfig", "Overlay Info", "", "", "");
CAF_PDM_InitFieldNoDefault(&overlayInfoConfig, "OverlayInfoConfig", "Info Box", "", "", "");
overlayInfoConfig = new Rim3dOverlayInfoConfig();
overlayInfoConfig->setReservoirView(this);
@ -141,7 +142,7 @@ RimReservoirView::RimReservoirView()
CAF_PDM_InitField(&animationMode, "AnimationMode", false, "Animation Mode","", "", "");
animationMode.setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&wellCollection, "WellCollection","Wells", "", "", "");
CAF_PDM_InitFieldNoDefault(&wellCollection, "WellCollection", "Simulation Wells", "", "", "");
wellCollection = new RimWellCollection;
CAF_PDM_InitFieldNoDefault(&rangeFilterCollection, "RangeFilters", "Range Filters", "", "", "");
@ -165,7 +166,7 @@ RimReservoirView::RimReservoirView()
CAF_PDM_InitField(&showInactiveCells, "ShowInactiveCells", false, "Show Inactive Cells", "", "", "");
CAF_PDM_InitField(&showInvalidCells, "ShowInvalidCells", false, "Show Invalid Cells", "", "", "");
cvf::Color3f defBackgColor = preferences->defaultViewerBackgroundColor();
CAF_PDM_InitField(&backgroundColor, "ViewBackgroundColor", defBackgColor, "Viewer Background", "", "", "");
CAF_PDM_InitField(&backgroundColor, "ViewBackgroundColor", defBackgColor, "Background", "", "", "");
CAF_PDM_InitField(&cameraPosition, "CameraPosition", cvf::Mat4d::IDENTITY, "", "", "", "");
@ -234,7 +235,7 @@ void RimReservoirView::updateViewerWidget()
if (RiaApplication::instance()->navigationPolicy() == RiaApplication::NAVIGATION_POLICY_CEETRON)
{
m_viewer->setNavigationPolicy(new caf::CeetronNavigation);
m_viewer->setNavigationPolicy(new caf::CeetronPlusNavigation);
}
else
{
@ -1610,3 +1611,23 @@ caf::PdmFieldHandle* RimReservoirView::objectToggleField()
return &showWindow;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimReservoirView::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
caf::PdmUiGroup* viewGroup = uiOrdering.addNewGroup("Viewer");
viewGroup->add(&name);
viewGroup->add(&backgroundColor);
caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup("Grid Appearance");
gridGroup->add(&scaleZ);
gridGroup->add(&meshMode);
gridGroup->add(&surfaceMode);
caf::PdmUiGroup* cellGroup = uiOrdering.addNewGroup("Cell Visibility");
cellGroup->add(&showMainGrid);
cellGroup->add(&showInactiveCells);
cellGroup->add(&showInvalidCells);
}

View File

@ -191,12 +191,14 @@ public:
protected:
virtual void initAfterRead();
virtual void setupBeforeSave();
virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
// Really private
private:
void syncronizeWellsWithResults();
void clampCurrentTimestep();
private:
caf::PdmField<int> m_currentTimeStep;
QPointer<RiuViewer> m_viewer;

View File

@ -0,0 +1,62 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RiaStdInclude.h"
#include "RimTools.h"
#include "RivWellPathCollectionPartMgr.h"
#include "RimProject.h"
#include "RimCase.h"
#include "RimIdenticalGridCaseGroup.h"
#include "RimScriptCollection.h"
#include "RimReservoirView.h"
#include "RimReservoirCellResultsCacher.h"
#include "RimCaseCollection.h"
#include "RimResultSlot.h"
#include "RimCellEdgeResultSlot.h"
#include "RimCellPropertyFilterCollection.h"
#include "RimWellCollection.h"
#include "Rim3dOverlayInfoConfig.h"
#include "RimWellPathCollection.h"
#include "RivWellPathPartMgr.h"
#include "RimWellPathCollection.h"
#include "RimCellRangeFilterCollection.h"
#include "RimOilField.h"
#include "RimAnalysisModels.h"
#include "RiaApplication.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimTools::getCacheRootDirectoryPathFromProject()
{
if (!RiaApplication::instance()->project())
{
return QString();
}
QString projectFileName = RiaApplication::instance()->project()->fileName();
QString cacheRootFolderPath;
QFileInfo fileInfo(projectFileName);
cacheRootFolderPath = fileInfo.canonicalPath();
cacheRootFolderPath += "/" + fileInfo.completeBaseName();
return cacheRootFolderPath;
}

View File

@ -0,0 +1,27 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
class RimProject;
class RimTools
{
public:
static QString getCacheRootDirectoryPathFromProject();
};

View File

@ -223,6 +223,15 @@ void RimUiTreeView::contextMenuEvent(QContextMenuEvent* event)
else if (dynamic_cast<RimWellPathCollection*>(uiItem->dataObject().p()))
{
menu.addAction(QString("Delete All Well Paths"), this, SLOT(slotDeleteAllWellPaths()));
RiuMainWindow* ruiMainWindow = RiuMainWindow::instance();
ruiMainWindow->appendActionsContextMenuForPdmObject(uiItem->dataObject().p(), &menu);
}
else if (dynamic_cast<RimAnalysisModels*>(uiItem->dataObject().p()))
{
RiuMainWindow* ruiMainWindow = RiuMainWindow::instance();
ruiMainWindow->appendActionsContextMenuForPdmObject(uiItem->dataObject().p(), &menu);
menu.addAction(QString("New Grid Case Group"), this, SLOT(slotAddCaseGroup()));
}
// Execute script on selection of cases
@ -1586,7 +1595,16 @@ void RimUiTreeView::slotDeleteAllWellPaths()
if (myModel)
{
myModel->deleteAllWellPaths(currentIndex());
caf::PdmUiTreeItem* uiItem = myModel->getTreeItemFromIndex(currentIndex());
if (uiItem && uiItem->dataObject())
{
RimWellPathCollection* wellPathCollection = dynamic_cast<RimWellPathCollection*>(uiItem->dataObject().p());
if (wellPathCollection)
{
wellPathCollection->scheduleGeometryRegenAndRedrawViews();
}
}
}
}

View File

@ -246,11 +246,11 @@ bool RimWell::calculateWellPipeVisibility(size_t frameIndex)
//--------------------------------------------------------------------------------------------------
void RimWell::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
caf::PdmUiGroup* pipeGroup = uiOrdering.addNewGroup("Well pipe");
caf::PdmUiGroup* pipeGroup = uiOrdering.addNewGroup("Appearance");
pipeGroup->add(&showWellPipes);
pipeGroup->add(&pipeRadiusScaleFactor);
pipeGroup->add(&wellPipeColor);
pipeGroup->add(&showWellLabel);
pipeGroup->add(&wellPipeColor);
pipeGroup->add(&pipeRadiusScaleFactor);
caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup("Range filter");
filterGroup->add(&showWellCells);

View File

@ -50,9 +50,9 @@ namespace caf
template<>
void RimWellCollection::WellCellsRangeFilterEnum::setUp()
{
addItem(RimWellCollection::RANGE_ADD_NONE, "FORCE_ALL_OFF", "Off");
addItem(RimWellCollection::RANGE_ADD_NONE, "FORCE_ALL_OFF", "All Off");
addItem(RimWellCollection::RANGE_ADD_INDIVIDUAL, "ALL_ON", "Individually");
addItem(RimWellCollection::RANGE_ADD_ALL, "FORCE_ALL_ON", "On");
addItem(RimWellCollection::RANGE_ADD_ALL, "FORCE_ALL_ON", "All On");
}
}
@ -271,7 +271,7 @@ void RimWellCollection::setReservoirView(RimReservoirView* ownerReservoirView)
//--------------------------------------------------------------------------------------------------
void RimWellCollection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup("Range filter");
caf::PdmUiGroup* filterGroup = uiOrdering.addNewGroup("Well range filter");
filterGroup->add(&wellCellsToRangeFilterMode);
filterGroup->add(&showWellCellFences);
filterGroup->add(&wellCellFenceType);

View File

@ -21,6 +21,8 @@
#include "cafAppEnum.h"
#include "cafPdmField.h"
#include "RiaApplication.h"
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "RimProject.h"
@ -40,8 +42,10 @@
#include "Rim3dOverlayInfoConfig.h"
#include "RimOilField.h"
#include "RimAnalysisModels.h"
#include <fstream>
#include <limits>
#include "RimTools.h"
CAF_PDM_SOURCE_INIT(RimWellPath, "WellPath");
@ -235,3 +239,103 @@ void RimWellPath::readAsciiWellPathFile()
setWellPathGeometry(wpData.m_wellPathGeometry.p());
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPath::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
caf::PdmUiGroup* appGroup = uiOrdering.addNewGroup("Appearance");
appGroup->add(&showWellPathLabel);
appGroup->add(&wellPathColor);
appGroup->add(&wellPathRadiusScaleFactor);
caf::PdmUiGroup* fileInfoGroup = uiOrdering.addNewGroup("File");
fileInfoGroup->add(&filepath);
fileInfoGroup->add(&wellPathIndexInFile);
caf::PdmUiGroup* ssihubGroup = uiOrdering.addNewGroup("Well Info");
ssihubGroup->add(&id);
ssihubGroup->add(&sourceSystem);
ssihubGroup->add(&utmZone);
ssihubGroup->add(&updateDate);
ssihubGroup->add(&updateUser);
ssihubGroup->add(&m_surveyType);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimWellPath::getCacheDirectoryPath()
{
QString cacheDirPath = RimTools::getCacheRootDirectoryPathFromProject();
cacheDirPath += "_wellpaths";
return cacheDirPath;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimWellPath::getCacheFileName()
{
QString cacheFileName;
// Make the path correct related to the possibly new project filename
QString newCacheDirPath = getCacheDirectoryPath();
QFileInfo oldCacheFile(filepath);
cacheFileName = newCacheDirPath + "/" + oldCacheFile.fileName();
return cacheFileName;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPath::setupBeforeSave()
{
// SSIHUB is the only source for populating Id, use text in this field to decide if the cache file must be copied to new project cache location
if (!isStoredInCache())
{
return;
}
QDir::root().mkpath(getCacheDirectoryPath());
QString newCacheFileName = getCacheFileName();
// Use QFileInfo to get same string representation to avoid issues with mix of forward and backward slashes
QFileInfo prevFileInfo(filepath);
QFileInfo currentFileInfo(newCacheFileName);
if (prevFileInfo.absoluteFilePath().compare(currentFileInfo.absoluteFilePath()) != 0)
{
QFile::copy(filepath, newCacheFileName);
filepath = newCacheFileName;
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimWellPath::isStoredInCache()
{
// SSIHUB is the only source for populating Id, use text in this field to decide if the cache file must be copied to new project cache location
return !id().isEmpty();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPath::updateFilePathsFromProjectPath()
{
QString newCacheFileName = getCacheFileName();
if (QFile::exists(newCacheFileName))
{
filepath = newCacheFileName;
}
}

View File

@ -64,7 +64,9 @@ public:
RivWellPathPartMgr* partMgr();
void readWellPathFile();
void updateFilePathsFromProjectPath();
private:
@ -74,7 +76,13 @@ private:
QString surveyType() { return m_surveyType; }
void setSurveyType(QString surveyType);
virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
bool isStoredInCache();
QString getCacheFileName();
QString getCacheDirectoryPath();
virtual void setupBeforeSave();
caf::PdmField<QString> id;
caf::PdmField<QString> sourceSystem;
caf::PdmField<QString> utmZone;

View File

@ -66,6 +66,9 @@ RimWellPathCollection::RimWellPathCollection()
{
CAF_PDM_InitObject("Wells", ":/WellCollection.png", "", "");
CAF_PDM_InitField(&isActive, "Active", true, "Active", "", "", "");
isActive.setUiHidden(true);
CAF_PDM_InitField(&showWellPathLabel, "ShowWellPathLabel", true, "Show well path labels", "", "", "");
cvf::Color3f defWellLabelColor = RiaApplication::instance()->preferences()->defaultWellLabelColor();
@ -105,8 +108,7 @@ RimWellPathCollection::~RimWellPathCollection()
//--------------------------------------------------------------------------------------------------
void RimWellPathCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
m_wellPathCollectionPartManager->scheduleGeometryRegen();
if (m_project) m_project->createDisplayModelAndRedrawAllViews();
scheduleGeometryRegenAndRedrawViews();
}
@ -198,6 +200,52 @@ void RimWellPathCollection::addWellPaths( QStringList filePaths )
readWellPathFiles();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathCollection::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
caf::PdmUiGroup* wellHeadGroup = uiOrdering.addNewGroup("Well labels");
wellHeadGroup->add(&showWellPathLabel);
wellHeadGroup->add(&wellPathLabelColor);
caf::PdmUiGroup* wellPipe = uiOrdering.addNewGroup("Well pipe");
wellPipe->add(&wellPathVisibility);
wellPipe->add(&wellPathRadiusScaleFactor);
caf::PdmUiGroup* advancedGroup = uiOrdering.addNewGroup("Clipping");
advancedGroup->add(&wellPathClip);
advancedGroup->add(&wellPathClipZDistance);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimWellPathCollection::objectToggleField()
{
return &isActive;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathCollection::scheduleGeometryRegenAndRedrawViews()
{
m_wellPathCollectionPartManager->scheduleGeometryRegen();
if (m_project) m_project->createDisplayModelAndRedrawAllViews();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathCollection::updateFilePathsFromProjectPath()
{
for (size_t wellPathIdx = 0; wellPathIdx < wellPaths.size(); wellPathIdx++)
{
wellPaths[wellPathIdx]->updateFilePathsFromProjectPath();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -51,6 +51,8 @@ public:
};
typedef caf::AppEnum<RimWellPathCollection::WellVisibilityType> WellVisibilityEnum;
caf::PdmField<bool> isActive;
caf::PdmField<bool> showWellPathLabel;
caf::PdmField<cvf::Color3f> wellPathLabelColor;
@ -61,7 +63,7 @@ public:
caf::PdmField<int> wellPathClipZDistance;
caf::PdmPointersField<RimWellPath*> wellPaths;
RivWellPathCollectionPartMgr* wellPathCollectionPartMgr() { return m_wellPathCollectionPartManager.p(); }
@ -71,7 +73,13 @@ public:
virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue );
void scheduleGeometryRegenAndRedrawViews();
void updateFilePathsFromProjectPath();
private:
virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
virtual caf::PdmFieldHandle* objectToggleField();
caf::PdmPointer<RimProject> m_project;
cvf::ref<RivWellPathCollectionPartMgr> m_wellPathCollectionPartManager;

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

View File

@ -40,6 +40,8 @@
<file>draw_style_faults_24x24.png</file>
<file>Case48x48.png</file>
<file>GridModels.png</file>
<file>draw_style_WellCellsToRangeFilter_24x24.png</file>
<file>InfoBox16x16.png</file>
</qresource>
<qresource prefix="/Shader/">
<file>fs_CellFace.glsl</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -61,6 +61,7 @@
#include "Rim3dOverlayInfoConfig.h"
#include "RiuWellImportWizard.h"
#include "RimCalcScript.h"
#include "RimTools.h"
#include "RiaRegressionTest.h"
@ -185,13 +186,14 @@ void RiuMainWindow::closeEvent(QCloseEvent* event)
void RiuMainWindow::createActions()
{
// File actions
m_openEclipseCaseAction = new QAction(QIcon(":/Case48x48.png"), "&Open Eclipse Case", this);
m_openInputEclipseFileAction= new QAction(QIcon(":/EclipseInput48x48.png"), "&Open Input Eclipse Case", this);
m_openMultipleEclipseCasesAction = new QAction(QIcon(":/CreateGridCaseGroup16x16.png"), "&Create Grid Case Group from Files", this);
m_openProjectAction = new QAction(style()->standardIcon(QStyle::SP_DirOpenIcon), "&Open Project", this);
m_openLastUsedProjectAction = new QAction("Open &Last Used Project", this);
m_importWellPathsFromFileAction = new QAction(QIcon(":/Well.png"), "&Import Well Paths from File", this);
m_importEclipseCaseAction = new QAction(QIcon(":/Case48x48.png"), "Import &Eclipse Case", this);
m_importInputEclipseFileAction= new QAction(QIcon(":/EclipseInput48x48.png"), "Import &Input Eclipse Case", this);
m_openMultipleEclipseCasesAction = new QAction(QIcon(":/CreateGridCaseGroup16x16.png"), "&Create Grid Case Group from Files", this);
m_importWellPathsFromFileAction = new QAction(QIcon(":/Well.png"), "Import &Well Paths from File", this);
m_importWellPathsFromSSIHubAction = new QAction(QIcon(":/WellCollection.png"),"Import Well Paths from &SSI-hub", this);
m_mockModelAction = new QAction("&Mock Model", this);
@ -213,13 +215,13 @@ void RiuMainWindow::createActions()
m_closeProjectAction = new QAction("&Close Project", this);
m_exitAction = new QAction("E&xit", this);
connect(m_openEclipseCaseAction, SIGNAL(triggered()), SLOT(slotOpenBinaryGridFiles()));
connect(m_openInputEclipseFileAction,SIGNAL(triggered()), SLOT(slotOpenInputFiles()));
connect(m_openMultipleEclipseCasesAction,SIGNAL(triggered()), SLOT(slotOpenMultipleCases()));
connect(m_openProjectAction, SIGNAL(triggered()), SLOT(slotOpenProject()));
connect(m_openLastUsedProjectAction,SIGNAL(triggered()), SLOT(slotOpenLastUsedProject()));
connect(m_importWellPathsFromFileAction, SIGNAL(triggered()), SLOT(slotImportWellPathsFromFile()));
connect(m_importWellPathsFromSSIHubAction, SIGNAL(triggered()), SLOT(slotImportWellPathsFromSSIHub()));
connect(m_openProjectAction, SIGNAL(triggered()), SLOT(slotOpenProject()));
connect(m_openLastUsedProjectAction, SIGNAL(triggered()), SLOT(slotOpenLastUsedProject()));
connect(m_importEclipseCaseAction, SIGNAL(triggered()), SLOT(slotImportEclipseCase()));
connect(m_importInputEclipseFileAction, SIGNAL(triggered()), SLOT(slotImportInputEclipseFiles()));
connect(m_openMultipleEclipseCasesAction, SIGNAL(triggered()), SLOT(slotOpenMultipleCases()));
connect(m_importWellPathsFromFileAction, SIGNAL(triggered()), SLOT(slotImportWellPathsFromFile()));
connect(m_importWellPathsFromSSIHubAction, SIGNAL(triggered()), SLOT(slotImportWellPathsFromSSIHub()));
connect(m_mockModelAction, SIGNAL(triggered()), SLOT(slotMockModel()));
connect(m_mockResultsModelAction, SIGNAL(triggered()), SLOT(slotMockResultsModel()));
@ -279,6 +281,8 @@ void RiuMainWindow::createActions()
connect(m_aboutAction, SIGNAL(triggered()), SLOT(slotAbout()));
m_commandLineHelpAction = new QAction("&Command Line Help", this);
connect(m_commandLineHelpAction, SIGNAL(triggered()), SLOT(slotShowCommandLineHelp()));
m_openUsersGuideInBrowserAction = new QAction("&Users Guide", this);
connect(m_openUsersGuideInBrowserAction, SIGNAL(triggered()), SLOT(slotOpenUsersGuideInBrowserAction()));
// Draw style actions
m_dsActionGroup = new QActionGroup(this);
@ -297,11 +301,17 @@ void RiuMainWindow::createActions()
connect(m_dsActionGroup, SIGNAL(triggered(QAction*)), SLOT(slotDrawStyleChanged(QAction*)));
m_drawStyleToggleFaultsAction = new QAction( QIcon(":/draw_style_faults_24x24.png"), "&Show Faults Only", this);
m_drawStyleToggleFaultsAction->setCheckable(true);
connect(m_drawStyleToggleFaultsAction, SIGNAL(toggled(bool)), SLOT(slotToggleFaultsAction(bool)));
m_addWellCellsToRangeFilterAction = new QAction(QIcon(":/draw_style_WellCellsToRangeFilter_24x24.png"), "&Add Well Cells To Range Filter", this);
m_addWellCellsToRangeFilterAction->setCheckable(true);
m_addWellCellsToRangeFilterAction->setToolTip("Add Well Cells To Range Filter based on the individual settings");
connect(m_addWellCellsToRangeFilterAction, SIGNAL(toggled(bool)), SLOT(slotAddWellCellsToRangeFilterAction(bool)));
}
@ -318,8 +328,8 @@ void RiuMainWindow::createMenus()
fileMenu->addSeparator();
QMenu* importMenu = fileMenu->addMenu("&Import");
importMenu->addAction(m_openEclipseCaseAction);
importMenu->addAction(m_openInputEclipseFileAction);
importMenu->addAction(m_importEclipseCaseAction);
importMenu->addAction(m_importInputEclipseFileAction);
importMenu->addAction(m_openMultipleEclipseCasesAction);
importMenu->addSeparator();
importMenu->addAction(m_importWellPathsFromFileAction);
@ -333,6 +343,9 @@ void RiuMainWindow::createMenus()
fileMenu->addAction(m_saveProjectAction);
fileMenu->addAction(m_saveProjectAsAction);
fileMenu->addSeparator();
QMenu* testMenu = fileMenu->addMenu("&Testing");
fileMenu->addSeparator();
fileMenu->addAction(m_closeProjectAction);
fileMenu->addSeparator();
@ -363,18 +376,15 @@ void RiuMainWindow::createMenus()
connect(viewMenu, SIGNAL(aboutToShow()), SLOT(slotRefreshViewActions()));
// Debug menu
QMenu* debugMenu = menuBar()->addMenu("&Debug");
debugMenu->addAction(m_mockModelAction);
debugMenu->addAction(m_mockResultsModelAction);
debugMenu->addAction(m_mockLargeResultsModelAction);
debugMenu->addAction(m_mockInputModelAction);
debugMenu->addSeparator();
debugMenu->addAction(m_createCommandObject);
debugMenu->addSeparator();
debugMenu->addAction(m_showRegressionTestDialog);
debugMenu->addAction(m_executePaintEventPerformanceTest);
connect(debugMenu, SIGNAL(aboutToShow()), SLOT(slotRefreshDebugActions()));
testMenu->addAction(m_mockModelAction);
testMenu->addAction(m_mockResultsModelAction);
testMenu->addAction(m_mockLargeResultsModelAction);
testMenu->addAction(m_mockInputModelAction);
testMenu->addSeparator();
testMenu->addAction(m_createCommandObject);
testMenu->addSeparator();
testMenu->addAction(m_showRegressionTestDialog);
testMenu->addAction(m_executePaintEventPerformanceTest);
// Windows menu
m_windowMenu = menuBar()->addMenu("&Windows");
@ -382,8 +392,10 @@ void RiuMainWindow::createMenus()
// Help menu
QMenu* helpMenu = menuBar()->addMenu("&Help");
helpMenu->addAction(m_aboutAction);
helpMenu->addAction(m_openUsersGuideInBrowserAction);
helpMenu->addAction(m_commandLineHelpAction);
helpMenu->addSeparator();
helpMenu->addAction(m_aboutAction);
}
@ -396,8 +408,8 @@ void RiuMainWindow::createToolBars()
m_standardToolBar = addToolBar(tr("Standard"));
m_standardToolBar->setObjectName(m_standardToolBar->windowTitle());
m_standardToolBar->addAction(m_openEclipseCaseAction);
m_standardToolBar->addAction(m_openInputEclipseFileAction);
m_standardToolBar->addAction(m_importEclipseCaseAction);
m_standardToolBar->addAction(m_importInputEclipseFileAction);
m_standardToolBar->addAction(m_openProjectAction);
//m_standardToolBar->addAction(m_openLastUsedProjectAction);
m_standardToolBar->addAction(m_saveProjectAction);
@ -424,6 +436,7 @@ void RiuMainWindow::createToolBars()
m_viewToolBar->addAction(m_drawStyleLinesSolidAction);
m_viewToolBar->addAction(m_drawStyleSurfOnlyAction);
m_viewToolBar->addAction(m_drawStyleToggleFaultsAction);
m_viewToolBar->addAction(m_addWellCellsToRangeFilterAction);
QLabel* scaleLabel = new QLabel(m_viewToolBar);
scaleLabel->setText("Scale");
@ -693,7 +706,7 @@ void RiuMainWindow::slotAbout()
dlg.setApplicationName(RI_APPLICATION_NAME);
dlg.setApplicationVersion(RiaApplication::getVersionStringApp(true));
dlg.setCopyright("Copyright 2012 Statoil ASA, Ceetron AS");
dlg.setCopyright("Copyright 2011-2013 Statoil ASA, Ceetron AS");
dlg.showCeeVizVersion(false);
#ifdef _DEBUG
@ -720,14 +733,14 @@ void RiuMainWindow::slotAbout()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMainWindow::slotOpenBinaryGridFiles()
void RiuMainWindow::slotImportEclipseCase()
{
if (checkForDocumentModifications())
{
RiaApplication* app = RiaApplication::instance();
QString defaultDir = app->defaultFileDialogDirectory("BINARY_GRID");
QStringList fileNames = QFileDialog::getOpenFileNames(this, "Open Eclipse File", defaultDir, "Eclipse Grid Files (*.GRID *.EGRID)");
QStringList fileNames = QFileDialog::getOpenFileNames(this, "Import Eclipse File", defaultDir, "Eclipse Grid Files (*.GRID *.EGRID)");
if (fileNames.size()) defaultDir = QFileInfo(fileNames.last()).absolutePath();
app->setDefaultFileDialogDirectory("BINARY_GRID", defaultDir);
@ -748,13 +761,13 @@ void RiuMainWindow::slotOpenBinaryGridFiles()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMainWindow::slotOpenInputFiles()
void RiuMainWindow::slotImportInputEclipseFiles()
{
if (checkForDocumentModifications())
{
RiaApplication* app = RiaApplication::instance();
QString defaultDir = app->defaultFileDialogDirectory("INPUT_FILES");
QStringList fileNames = QFileDialog::getOpenFileNames(this, "Open Eclipse Input Files", defaultDir, "Eclipse Input Files and Input Properties (*.GRDECL *)");
QStringList fileNames = QFileDialog::getOpenFileNames(this, "Import Eclipse Input Files", defaultDir, "Eclipse Input Files and Input Properties (*.GRDECL *)");
if (fileNames.isEmpty()) return;
@ -1187,13 +1200,6 @@ void RiuMainWindow::slotShowPerformanceInfo(bool enable)
RiaApplication::instance()->setShowPerformanceInfo(enable);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMainWindow::slotRefreshDebugActions()
{
RiaApplication* app = RiaApplication::instance();
}
//--------------------------------------------------------------------------------------------------
///
@ -1491,12 +1497,19 @@ void RiuMainWindow::refreshDrawStyleActions()
m_drawStyleToggleFaultsAction->setEnabled(enable);
m_addWellCellsToRangeFilterAction->setEnabled(enable);
if (enable)
{
RimReservoirView* riv = RiaApplication::instance()->activeReservoirView();
m_drawStyleToggleFaultsAction->blockSignals(true);
m_drawStyleToggleFaultsAction->setChecked( RiaApplication::instance()->activeReservoirView()->meshMode == RimReservoirView::FAULTS_MESH
|| RiaApplication::instance()->activeReservoirView()->surfaceMode == RimReservoirView::FAULTS);
m_drawStyleToggleFaultsAction->setChecked( riv->meshMode == RimReservoirView::FAULTS_MESH
|| riv->surfaceMode == RimReservoirView::FAULTS);
m_drawStyleToggleFaultsAction->blockSignals(false);
m_addWellCellsToRangeFilterAction->blockSignals(true);
m_addWellCellsToRangeFilterAction->setChecked( riv->wellCollection()->wellCellsToRangeFilterMode() != RimWellCollection::RANGE_ADD_NONE);
m_addWellCellsToRangeFilterAction->blockSignals(false);
}
}
@ -1631,22 +1644,15 @@ void RiuMainWindow::slotImportWellPathsFromSSIHub()
// Update the UTM bounding box from the reservoir
app->project()->computeUtmAreaOfInterest();
QString wellPathsFolderPath;
QString projectFileName = app->project()->fileName();
QFileInfo fileInfo(projectFileName);
wellPathsFolderPath = fileInfo.canonicalPath();
QString wellPathFolderName = fileInfo.completeBaseName() + "_wellpaths";
QDir projFolder(wellPathsFolderPath);
projFolder.mkdir(wellPathFolderName);
wellPathsFolderPath += "/" + wellPathFolderName;
QString wellPathsFolderPath = RimTools::getCacheRootDirectoryPathFromProject();
wellPathsFolderPath += "_wellpaths";
QDir::root().mkpath(wellPathsFolderPath);
RimWellPathImport* copyOfWellPathImport = dynamic_cast<RimWellPathImport*>(app->project()->wellPathImport->deepCopy());
RiuWellImportWizard wellImportwizard(app->preferences()->ssihubAddress, wellPathsFolderPath, copyOfWellPathImport, this);
RimWellPathImport* wellPathObjectToBeDeleted = NULL;
// Get password/username from application cache
{
QString ssihubUsername = app->cacheDataObject("ssihub_username").toString();
@ -1664,11 +1670,18 @@ void RiuMainWindow::slotImportWellPathsFromSSIHub()
app->project()->createDisplayModelAndRedrawAllViews();
}
wellPathObjectToBeDeleted = app->project()->wellPathImport;
app->project()->wellPathImport = copyOfWellPathImport;
app->setCacheDataObject("ssihub_username", wellImportwizard.field("username"));
app->setCacheDataObject("ssihub_password", wellImportwizard.field("password"));
}
else
{
wellPathObjectToBeDeleted = copyOfWellPathImport;
}
delete wellPathObjectToBeDeleted;
}
//--------------------------------------------------------------------------------------------------
@ -1768,3 +1781,54 @@ void RiuMainWindow::setDefaultWindowSize()
{
resize(1000, 810);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMainWindow::slotAddWellCellsToRangeFilterAction(bool doAdd)
{
RimReservoirView* riv = RiaApplication::instance()->activeReservoirView();
if (riv)
{
caf::AppEnum<RimWellCollection::WellCellsRangeFilterType> rangeAddType;
rangeAddType = doAdd ? RimWellCollection::RANGE_ADD_INDIVIDUAL : RimWellCollection::RANGE_ADD_NONE;
riv->wellCollection()->wellCellsToRangeFilterMode.setValueFromUi(static_cast<unsigned int>(rangeAddType.index()));
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMainWindow::slotOpenUsersGuideInBrowserAction()
{
QString usersGuideUrl = "https://github.com/OPM/ResInsight/wiki";
if (!QDesktopServices::openUrl(usersGuideUrl))
{
QErrorMessage* errorHandler = QErrorMessage::qtHandler();
errorHandler->showMessage("Failed open browser with the following url\n\n" + usersGuideUrl);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMainWindow::appendActionsContextMenuForPdmObject(caf::PdmObject* pdmObject, QMenu* menu)
{
if (!menu)
{
return;
}
if (dynamic_cast<RimWellPathCollection*>(pdmObject))
{
menu->addAction(m_importWellPathsFromFileAction);
menu->addAction(m_importWellPathsFromSSIHubAction);
}
else if (dynamic_cast<RimAnalysisModels*>(pdmObject))
{
menu->addAction(m_importEclipseCaseAction);
menu->addAction(m_importInputEclipseFileAction);
menu->addAction(m_openMultipleEclipseCasesAction);
}
}

View File

@ -95,6 +95,9 @@ public:
void setDefaultWindowSize();
void appendActionsContextMenuForPdmObject(caf::PdmObject* pdmObject, QMenu* menu);
protected:
virtual void closeEvent(QCloseEvent* event);
@ -121,8 +124,8 @@ private:
private:
// File actions
QAction* m_openEclipseCaseAction;
QAction* m_openInputEclipseFileAction;
QAction* m_importEclipseCaseAction;
QAction* m_importInputEclipseFileAction;
QAction* m_openMultipleEclipseCasesAction;
QAction* m_openProjectAction;
QAction* m_openLastUsedProjectAction;
@ -163,6 +166,7 @@ private:
// Help actions
QAction* m_aboutAction;
QAction* m_commandLineHelpAction;
QAction* m_openUsersGuideInBrowserAction;
// Animation
caf::AnimationToolBar* m_animationToolBar;
@ -186,8 +190,8 @@ private:
private slots:
// File slots
void slotOpenBinaryGridFiles();
void slotOpenInputFiles();
void slotImportEclipseCase();
void slotImportInputEclipseFiles();
void slotOpenMultipleCases();
void slotOpenProject();
void slotOpenLastUsedProject();
@ -217,9 +221,9 @@ private slots:
void slotDrawStyleChanged(QAction* activatedAction);
void slotToggleFaultsAction(bool);
void slotAddWellCellsToRangeFilterAction(bool doAdd);
// Debug slots
void slotRefreshDebugActions();
void slotUseShaders(bool enable);
void slotShowPerformanceInfo(bool enable);
@ -244,6 +248,7 @@ private slots:
// Help slots
void slotAbout();
void slotShowCommandLineHelp();
void slotOpenUsersGuideInBrowserAction();
void slotSubWindowActivated(QMdiSubWindow* subWindow);
void slotCurrentChanged(const QModelIndex & current, const QModelIndex & previous);
@ -269,8 +274,9 @@ private:
QAction* m_drawStyleLinesAction;
QAction* m_drawStyleLinesSolidAction;
QAction* m_drawStyleSurfOnlyAction;
void refreshDrawStyleActions();
QAction* m_addWellCellsToRangeFilterAction;
void refreshDrawStyleActions();
std::vector<QPointer<QDockWidget> > additionalProjectTrees;
std::vector<QPointer<QDockWidget> > additionalPropertyEditors;
};

View File

@ -41,13 +41,21 @@ RimOilFieldEntry::RimOilFieldEntry()
CAF_PDM_InitFieldNoDefault(&name, "OilFieldName", "OilFieldName", "", "", "");
CAF_PDM_InitFieldNoDefault(&edmId, "EdmId", "EdmId", "", "", "");
CAF_PDM_InitField(&selected, "Selected", true, "Selected", "", "", "");
CAF_PDM_InitField(&selected, "Selected", false, "Selected", "", "", "");
CAF_PDM_InitFieldNoDefault(&wellsFilePath, "wellsFilePath", "wellsFilePath", "", "", "");
CAF_PDM_InitFieldNoDefault(&wells, "Wells", "", "", "", "");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimOilFieldEntry::~RimOilFieldEntry()
{
wells.deleteAllChildObjects();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -116,4 +124,3 @@ RimWellPathEntry* RimOilFieldEntry::find(const QString& name, RimWellPathEntry::
return NULL;
}

View File

@ -31,6 +31,7 @@ class RimOilFieldEntry : public caf::PdmObject
public:
RimOilFieldEntry();
~RimOilFieldEntry();
caf::PdmField<QString> name;

View File

@ -38,6 +38,14 @@ RimOilRegionEntry::RimOilRegionEntry()
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimOilRegionEntry::~RimOilRegionEntry()
{
fields.deleteAllChildObjects();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -77,5 +85,3 @@ void RimOilRegionEntry::updateState()
}
}

View File

@ -32,6 +32,7 @@ class RimOilRegionEntry : public caf::PdmObject
public:
RimOilRegionEntry();
~RimOilRegionEntry();
virtual caf::PdmFieldHandle* userDescriptionField();
virtual caf::PdmFieldHandle* objectToggleField();

View File

@ -17,8 +17,14 @@
/////////////////////////////////////////////////////////////////////////////////
#include "RimWellPathImport.h"
#include "RimTools.h"
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "cafPdmUiTreeViewEditor.h"
#include <QFileInfo>
namespace caf {
template<>
@ -201,5 +207,45 @@ void RimWellPathImport::defineObjectEditorAttribute(QString uiConfigName, caf::P
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellPathImport::~RimWellPathImport()
{
regions.deleteAllChildObjects();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathImport::updateFilePaths()
{
QString wellPathsFolderPath = RimTools::getCacheRootDirectoryPathFromProject();
wellPathsFolderPath += "_wellpaths";
for (size_t regionIdx = 0; regionIdx < this->regions.size(); regionIdx++)
{
for (size_t fIdx = 0; fIdx < this->regions[regionIdx]->fields.size(); fIdx++)
{
RimOilFieldEntry* oilField = this->regions[regionIdx]->fields[fIdx];
QFileInfo fi(oilField->wellsFilePath);
QString newWellsFilePath = wellPathsFolderPath + "/" + fi.fileName();
oilField->wellsFilePath = newWellsFilePath;
for (size_t wIdx = 0; wIdx < oilField->wells.size(); wIdx++)
{
RimWellPathEntry* rimWellPathEntry = oilField->wells[wIdx];
QFileInfo fiWell(rimWellPathEntry->wellPathFilePath);
QString newFilePath = wellPathsFolderPath + "/" + fiWell.fileName();
rimWellPathEntry->wellPathFilePath = newFilePath;
}
}
}
}

View File

@ -41,6 +41,7 @@ public:
public:
RimWellPathImport();
~RimWellPathImport();
caf::PdmField<bool> wellTypeSurvey;
caf::PdmField<bool> wellTypePlans;
@ -61,7 +62,7 @@ public:
void updateFieldVisibility();
void updateFilePaths();
};

View File

@ -50,7 +50,7 @@ RimWellPathEntry::RimWellPathEntry()
CAF_PDM_InitObject("WellPathEntry", "", "", "");
CAF_PDM_InitFieldNoDefault(&name, "Name", "Name", "", "", "");
CAF_PDM_InitField(&selected, "Selected", true, "Selected", "", "", "");
CAF_PDM_InitField(&selected, "Selected", false, "Selected", "", "", "");
caf::AppEnum< RimWellPathEntry::WellTypeEnum > wellType = WELL_ALL;
CAF_PDM_InitField(&wellPathType, "WellPathType", wellType, "Well path type", "", "", "");

View File

@ -558,9 +558,12 @@ QStringList RiuWellImportWizard::absoluteFilePathsToWellPaths() const
RimWellPathEntry* wellPathEntry = oilField->wells[wIdx];
QString wellStatus;
if (QFile::exists(oilField->wells[wIdx]->wellPathFilePath))
if (wellPathEntry->selected)
{
filePaths += oilField->wells[wIdx]->wellPathFilePath;
if (QFile::exists(oilField->wells[wIdx]->wellPathFilePath))
{
filePaths += oilField->wells[wIdx]->wellPathFilePath;
}
}
}
}
@ -910,10 +913,7 @@ void WellSelectionPage::buildWellTreeView()
for (size_t wIdx = 0; wIdx < oilField->wells.size(); wIdx++)
{
RimWellPathEntry* wellPathEntry = oilField->wells[wIdx];
if (wellPathEntry->selected)
{
fieldGroup->objects.push_back(wellPathEntry);
}
fieldGroup->objects.push_back(wellPathEntry);
}
}
}

61
BuildInstructions.md Normal file
View File

@ -0,0 +1,61 @@
## Build instructions
ResInsight uses the CMake build system and requires CMake version 2.8 or higher. Moreover, you need version 4.7.3 of Qt or newer, look below for dependency list.
### CMAKE configuration
If you check the button 'Grouped' in the GUI, the CMake variables are grouped by prefix. This makes it easier to see all settings for ResInsight.
| CMake Name | Description |
|--------------|---------|
| `RESINSIGHT_USE_OPENMP` | Enable OpenMP multi-core parallel building |
| `RESINSIGHT_PRIVATE_INSTALL` | Install as an independent bundle including the necessary Qt libraries |
| `RESINSIGHT_BUILD_DOCUMENTATION` | Use Doxygen to create the HTML based API documentation |
| `RESINSIGHT_OCTAVE_PLUGIN_MKOCTFILE` | Location of Octave tool mkoctfile used to compile Octave plugins |
| `RESINSIGHT_OCTAVE_PLUGIN_QMAKE` | Location of qmake to find Qt include files and libraries used to compile Octave plugins |
| `RESINSIGHT_OCTAVE_PLUGIN_32_BIT` | Windows 64-bit: Flag used to control if Octave plugins will be compiled using 32-bit build environment |
#### Build without Octave plugins
It is possible to compile ResInsight without compiling the Octave plugins. This can be done by specifying blank for the Octave CMake variables. The Octave plugin module will not be build, and CMake will show warnings like 'Failed to find mkoctfile'. This will not break the build or compilation of ResInsight.
#### Build instructions Visual Studio
- Open the CMake GUI
- Set the path to the source code
- Set the path to the build directory
- Click "Configure" and select your preferred compiler, "Visual Studio 10" or "Visual Studio 10 Win64"
- Set the build variables and click "Configure" again
- Click "Generate", and one solution file and several project files will be created in the build directory
- Open the solution file in Visual Studio
#### Optional - build instructions Octave plugins
To be able to compile the Octave plugins, the path to the Octave development tool `mkoctfile` must be provided. In addition, if you compile x64, you must specify the location of 32-bit version of Qt, as the Octave plugins on Windows are currently only supported for x86.
See description for `RESINSIGHT_OCTAVE_PLUGIN_QMAKE` and `RESINSIGHT_OCTAVE_PLUGIN_32_BIT` above.
##### Octave installation
Currently tested and verified version on Windows is Octave 3.6.1. NB! Version 3.6.2 has compile issues using VS2010, this version will not be able to compile the Octave plugins.
- Download and install Octave 3.6.1 for VS2010 from [SourceForge](http://sourceforge.net/projects/octave/files/Octave%20Windows%20binaries/Octave%203.6.1%20for%20Windows%20Microsoft%20Visual%20Studio/octave-3.6.1-vs2010-setup-1.exe/download)
- Download a [missing library file](http://dl.dropbox.com/u/45539519/dirent-vs2010.lib), rename to **dirent.lib** and copy it into Octave lib folder, typically **c:/Octave-3.6.1/lib/dirent.lib** See details on [SourceForge](http://sourceforge.net/mailarchive/message.php?msg_id=28933804)
### Linux
An out-of-tree build is typically done with
mkdir ResInsight/build
cd ResInsight/build
cmake ..
make
make install
You will find the ResInsight binary under the Install directory in your build directory.
#### Dependencies for Debian based distributions
sudo apt-get install git cmake build-essential octave octave-headers qt4-dev-tools
If you are running Ubuntu 12.10 or newer, you will need to replace octave-headers with liboctave-dev :
sudo apt-get install git cmake build-essential octave liboctave-dev qt4-dev-tools

View File

@ -78,7 +78,15 @@ include_directories(
# Qt
################################################################################
set (QT_COMPONENTS_REQUIRED QtCore QtGui QtMain QtOpenGl QtNetwork QtScript QtScriptTools)
find_package (Qt4 COMPONENTS ${QT_COMPONENTS_REQUIRED} REQUIRED)
find_package (Qt4 COMPONENTS ${QT_COMPONENTS_REQUIRED})
if ( NOT QT4_FOUND )
message(FATAL_ERROR "Package Qt4 is required, but not found. Please specify qmake for variable QT_QMAKE_EXECUTABLE")
endif ( NOT QT4_FOUND )
if (QT_VERSION_MINOR LESS 6)
message(FATAL_ERROR "Qt 4.6 is required, please specify qmake for variable QT_QMAKE_EXECUTABLE")
endif()
include (${QT_USE_FILE})
# Open GL

View File

@ -0,0 +1,82 @@
[ Contents ](UsersGuide.md#contents)
-----
## Grid Case Groups and Statistics
![](images/GridCaseGroupTree.png)
**Grid Case Group**'s are designed to make it easy to calculate statistics per cell and per timestep of a large number of Eclipse simulation Cases with identical Grids (often labeled *realizations*).
If you have several Eclipse simulations with different input parameters available, you can put all the realizations into a Grid Case Group and easily calculate each of the cells mean value, range and max/min values at each timestep between the realizations.
### Creating Grid Case Groups
#### From files
The easiest way to create a **Grid Case Group** is to use the Import command:
**File->Import->Create Grid Case Group from Files**
An import dialog is opened:
![](images/CreateGridCaseGroupFromFileDialog.png)
1. Add one or more search folders to the list on the left.
2. The *.EGRID or *.GRID files found in these directories and sub directories are shown in the list to the right.
3. If you want to remove some *.EGRID files from the list, select them and press the **Remove** button.
4. When you are ready, press the **OK** button.
ResInsight then creates a **Grid Case Group** for you, and populates its **Source Cases** with the Cases you selected. Then the first of those Cases are read completely, while the others are just scanned to verify that the Grids match and to detect changes in the Active Cells layout.
This makes it quite fast to lo ad even a quite large number of realizations.
#### Manually
A Grid Case Group can be created from the context menu available when right clicking a Result Case, Input Case or a different Grid Case Group. **Source Cases** can then be added by using the mouse to *drag and drop* cases with equal grids into the **Grid Case Group**'s **Source Case** folder.
This is useful if you want to create statistics based only on a subset of the source cases in an already created **Grid Case Group**.
**Drag and Drop** of cases will normally copy the cases to the new destination, but moving them is possible by pressing and holding the **Shift** key while dropping.
### Viewing special Source Cases
To reduce the number of views, only a view for the first case is created automatically. If you want to inspect the results of a particular source case, right click the case and select **New view** from the context menu. A new 3D View will the be created on that particular case.
*TIP:* To reduce memory usage, project loading time etc. it is vise to delete the 3D Views you do not need. 3D Views use a lot of system resources.
### Statistics ##
After creating a grid case group, an empty **Statistics Case** is created for you in the **Derived Statistics** folder of the **Grid Case Group**.
#### Setting up and Calculate
The properties of an uncalculated and a calculated **Statistics Case** is shown below:
![](images/StatisticsCaseProperties.png) ![](images/StatisticsCasePropertiesCalculated.png)
- **Compute**: Starts to calculate requested statistical Properties.
- **Edit** : Deletes the calculated results, and makes the controls to edit the setup available.
- **Summary of calculation setup** : Summarizes what to calculate
- **Properties to consider**: These options makes it possible to select what Eclipse properties to include in the Statistical calculations. Adding variables increase the memory usage and the computational time.
- **Percentile Setup**: Selects whether to calculate percentiles, what method and what percentile levels should be used. Turning this off speeds up the calculations.
- **Well Data Source Case**: This option selects which set of **Simulation Wells** to be shown along with the statistical results. You can select one of the **Source Cases**.
##### Percentile Methods
Three Percentile methods are implemented:
- **Interpolated Observation**
The values are sorted, and the two observations representing the probabilities closest to the percentile are interpolated to find the value for the percentile. This is the default method.
- **Nearest Observation**
The values are sorted, and the first observation representing a probability higher or equal to the percentile probability is selected as the value for the percentile. This method is by some considered to be statistically more puristic.
- **Histogram based estimate**
A histogram is created and the percentile is calculated based on the histogram. This method will be faster when having a large number of realizations, because no value sorting is involved. You would however need several hundred realizations before this method should be considered.
#### Viewing the results
When the computation is complete, you have to create a 3D View on the **Statistics Case** to view the results. Use the Context menu available by right clicking the **Statistics Case** to create it.
#### Adding Statistics Cases
A new statistical calculation can be created by activating the context menu for **Derived Statistic->New Statistics Case**.
------
[ Contents ](UsersGuide.md#contents)

View File

@ -0,0 +1,19 @@
[ Contents ](UsersGuide.md#contents)
------
## Command Line Parameters #
| Parameter | Description |
|-----------|-------------|
| `-help, -?` | Displays help text and version info |
| `-last` | Open last used project |
| `-project <filename>` | Open project file <filename> |
| `-case <casename>` | Import Eclipse case <casename> (do not include .GRID/.EGRID) |
| `-savesnapshots` | Save snapshot of all views to 'snapshots' folder in project file folder. Application closes after snapshots are written to file. |
| `-regressiontest <folder>` | Run a regression test on all sub-folders starting with `TestCase*` of the given folder. **RegressionTest.rip** files in the sub-folders will be opened and snapshots of all the views is written to the sub-sub-folder **RegTestGeneratedImages**. Then difference images is generated in the sub-sub-folder **RegTestDiffImages** based on the images in sub-sub-folder **RegTestBaseImages**. The results are presented in **ResInsightRegressionTestReport.html** that is written in the given folder. |
| `-updateregressiontestbase <folder>` | For all sub-folders starting with `TestCase*`, copy the images in the sub-sub-folder **RegTestGeneratedImages** to the sub-sub-folder **RegTestBaseImages** after deleting **RegTestBaseImages** completely. |
See also the [Regression Test System ](RegressionTestSystem.md) for a more in-depth explanation.
------
[ Contents ](UsersGuide.md#contents)

View File

@ -0,0 +1,167 @@
[ Contents ](UsersGuide.md#contents)
-----
## Getting started with ResInsight
### Installation
Installation instructions for ResInsight can be found here: [Installation and Configuration](Installation.md)
### User interface overview
The application has a main area and several docking windows. The different docking
windows can be managed from the **Windows** menu or directly using the local menu bar of the docking window.
![ResInsight User Interface](images/ResInsightUIFullSizeWindows.png)
#### Docking Windows
- **Project Tree** - contains all application objects in a tree structure.
- **Property Editor** - displays all properties for the selected object in the **Project Tree**
- **Process Monitor** - displays output from Octave when executing Octave scripts
- **Result Info** - displays info for the object being hit in the 3D scene when clicking with left mouse button
*TIP:* A new project tree and property editor can be added from **Windows->New Project and Property View**.
### Toolbars
A selected subset of actions are presented as controls in the toolbar. The different sections in the toolbar can be dragged and positioned anywhere as small floating toolbars. Management of the toolbar is done by right-clicking on the toolbar and then manipulating the displayed menu.
#### 3D Views
In the main area of the application, several 3D views can be open at the same time. One of them will be active and the active view can be either maximized to use the whole main area, or normalized so that you can see all the open 3D views.
*TIP:* To see views next to each other select the **Restore down** icon in the application show here for Windows :
![Restore Down](images/RestoreDown.PNG)
#### Editing the views
Most of the settings and features of ResInsight is accessible through the **Project Tree** and the **Property Editor**. Selecting an item in the **Project Tree** activates the corresponding 3D View, and shows the item properties in the **Property Editor** available for editing.
Toggling a checkbox next to an item in the **Project Tree** will toggle visibility in the 3D view. Toggling a checkbox for a collection of items will affect the visibility for all items in the collection. ![](images/TreeViewToggle.png)
Context menu commands are also available to do special operations on a selected set of items.
### Cases and their types
A *Case* in ResInsight means a Grid model with a particular set of results or property data. There are
three different Case types:
##### Result case ![](images/Case24x24.png)
This is a Case based on the results of an Eclipse analysis, read from a grid file together with restart data.
##### Input case ![](images/EclipseInput24x24.png)
This Case type is based on a `*.GRDECL` file, or a part of an Eclipse *Input* file. This Case type supports loading single ASCII files defining Eclipse Cell Properties, and also to export modified property sets to ASCII files.
Each of the Eclipse properties is listed as separate entities in the **Project Tree**, and can be renamed and exported.
##### Statistics case ![](images/Histogram24x24.png)
This is a Case type that belongs to a *Grid Case Group* and makes statistical calculations based on the source cases in the Grid Case Group.
#### Grid Case Groups ![](images/GridCaseGroup24x24.png)
A **Grid Case Group** is a group of **Result Cases** with identical grids, but generally different active cells, initial values and results. These cases are called *Source Cases*.
The purpose of a Grid Case group is to make it easy to calculate statistics across the source cases both for static and dynamic Eclipse Properties.
See [ Multiple realizations and statistics ](CaseGroupsAndStatistics.md) for more on this.
### Importing data
#### Input data support ###
ResInsight supports the following type of Eclipse input data:
- `*.GRID` and `*.EGRID` files along with their `*.INIT` and restart files `*.XNNN` and `*.UNRST`.
- Grid and Property data from `*.GRDECL` files.
#### Importing Eclipse cases
##### Eclipse Results
1. Select **File->Import->Import Eclipse Case** and select an `*.EGRID` or `*.GRID` Eclipse file for import.
2. The case is imported, and a view of the case is created
*TIP:* You can select several grid files in one go by multiple selection of files( Ctrl + left mouse button, Shift + left mouse button).
##### Eclipse ASCII input data
1. Select **File->Import->Import Input Eclipse Case** and select a `*.GRDECL` file.
2. The case is imported, and a view of the case is created
3. Right click the **Input Properties** in the generated **Input Case** and use the context menu to import additional Eclipse Property data files.
##### Handling missing or wrong MAPAXES
The X and Y grid data can be negated in order to make the Grid model appear correctly in ResInsight. This functionality is accessible in the **Property Editor** for all Case types as the toggle buttons **Flip X Axis** and **Flip Y Axis** as shown in the example below.
![](images/CaseProperties.png)
### Model navigation
ResInsight comes with two 3D navigation modes. The active mode can be selected in the **Preferences** dialog (**Edit -> Preferences**).
|Abbreviation | Meaning |
|-------------|---------|
|LMB | Pressing left mouse button |
|MMB | Pressing Middle mouse button or scroll wheel button |
|RMB | Pressing Right mouse button |
#### Ceetron navigation mode
|Mouse interaction | Action |
|------------------|---------|
|LMB | Pan model |
|MMB | Zoom to mouse pointer location |
|Scroll wheel | Zoom to mouse pointer location |
|RMB | Rotate model |
| | |
|RMB single click | Context menu |
|LMB single click | Update status bar and **Result Info** |
#### CAD navigation mode
|Mouse interaction | Action |
|------------------|--------|
|MMB | Rotate model |
|MMB + Shift | Pan model |
|Scroll wheel | Zoom to mouse pointer location |
| | |
|RMB single click | Context menu |
|LMB single click | Update status bar and **Result Info** |
### Project files and Cache directory
ResInsight stores which cases you have imported and all the settings for each view etc. in a project file with the extension `.rsp`.
This file only contains references to the real data files, and even references to data files generated by ResInsight itself.
Statistics calculations, property sets you generate by using Octave, and well paths are saved to a folder in the same directory as you save the project file, and is named \<ProjectFileName\>_cache. So if you need to move your project, make sure you move this folder as well.
*TIP:* The `.rsp`-file is an XML file, and can be edited by any text editor.
### Export options
#### Snapshot images
##### Single View ![](images/SnapShot.png) ![](images/SnapShotSave.png)
Image export of current 3D view can be launched from **File -> Export -> Snapshot To File**. A snapshot can also be copied to clipboard using **Edit->Copy Snapshot To Clipboard**.
##### All Views ![](images/SnapShotSaveViews.png)
If a project contains multiple views, all views can be exported using **File -> Export -> Snapshot All Views To File**.
It is also possible to snapshot all views from the command line. See [ Command Line Arguments] (CommandLineParameters.md)
#### Export of Eclipse Properties as ASCII data
Eclipse Properties can be exported to Eclipse ASCII files by activating the context menu for a **Cell Result**. ![](images/ExportProperty.png)
The command will export the property set currently loaded and shown in the 3D View to a file with the following format:
-- Exported from ResInsight
<keyword>
<One number per cell separated by spaces>
/
------
[ Contents ](UsersGuide.md#contents)

View File

@ -0,0 +1,29 @@
[ Contents ](UsersGuide.md#contents)
-----
## Installation and configuration
### Windows
1. Download ZIP binary distribution from [https://github.com/OPM/ResInsight/releases](https://github.com/OPM/ResInsight/releases "release section on GitHub")
2. Extract content from ZIP file
3. (OPTIONAL) Launch ResInsight.exe, open **Edit ->Preferences** and define location of Octave, usually 'ResInsightRoot/octave/bin/octave.exe'
#### Optional - Octave installation
Currently tested and verified version on Windows is Octave 3.6.1. NB! Version 3.6.2 has compile issues using VS2010, this version will not be able to compile the Octave plugins.
- Download and install Octave 3.6.1 for VS2010 from [SourceForge](http://sourceforge.net/projects/octave/files/Octave%20Windows%20binaries/Octave%203.6.1%20for%20Windows%20Microsoft%20Visual%20Studio/octave-3.6.1-vs2010-setup-1.exe/download)
- Download a [missing library file](http://dl.dropbox.com/u/45539519/dirent-vs2010.lib), rename to **dirent.lib** and copy it into Octave lib folder, typically **c:/Octave-3.6.1/lib/dirent.lib** See details on [SourceForge](http://sourceforge.net/mailarchive/message.php?msg_id=28933804)
## Linux
1. Download TAR.GZ binary distribution from [https://github.com/OPM/ResInsight/releases](https://github.com/OPM/ResInsight/releases "release section on GitHub")
2. Extract content from TAR file
3. (OPTIONAL) Launch ResInsight, open **Edit -> Preferences** and define location of Octave in the field **Octave**, usually 'ResInsightRoot/octave/bin/octave-cli'
------
[ Contents ](UsersGuide.md#contents)

View File

@ -0,0 +1,42 @@
[ Contents ](UsersGuide.md#contents)
-----
## Octave Interface
ResInsight provides a flexible interface to [Octave](http://www.gnu.org/software/octave/ "Octave").
This includes a set of Octave functions that communicates with a running ResInsight session, features in ResInsight that makes it easy to manage and edit Octave scripts, and their execution using Octave.
The Octave functions are documented in [ Octave Interface Reference](OctaveInterfaceReference.md).
### Script management
Octave scripts are available in the **Scripts** folder in the **Project Tree**.
![](images/OctaveScriptTree.png)
This folder contains an entry for each of the directories you have added as a **Script Folder**. Each of the folder lists available `*.m` files and sub directories. The tree is continuously updated to reflect the file structure on disk.
#### Adding Script Folders
You can add directories by right clicking the **Scripts** item to access the context menu.
Multiple standard script folder locations can also be defined in the field **Shared Script Folder(s)** in the **Preferences Dialog** (**Edit -> Preferences**).
#### Editing scripts
To enable script editing from ResInsight you need to set up the path to a text editor in the **Script Editor** field in the **Preferences Dialog** (**Edit -> Preferences**)
When done, scripts can be edited using the context menu command **Edit** on the script item in the tree.
### Script execution
Octave scripts can be executed with or without a selection of cases as context. The [ Octave Interface Reference](OctaveInterfaceReference.md) highlights in more depth how to design your Octave scripts to utilize these features.
#### Without a case selection
A script can be started by navigating to the script in the **Project Tree**, and selecting **Execute** from the context menu. The currently active case (The one with the active 3D View) will then be set as ResInsight's *Current Case*.
#### With a case selection
One script can be executed on many cases by first selecting a set of cases, and then activating **Execute script** from the context menu for the case selection. The script is then executed once pr selected case. Each time ResInsight's *Current Case* is updated, making it accessible from the Octave script.
![](images/ExecuteOctaveScriptOnSelectedCases.png)
------
[ Contents ](UsersGuide.md#contents)

View File

@ -0,0 +1,222 @@
[ Contents ](UsersGuide.md#contents)
-----
# Octave Interface Reference
## Introduction
To identify a ResInsight case uniquely in the Octave script, an integer Id (CaseId) is used. This Id can be retrieved in several ways, but there are two main modes of operation regarding this for a particular octave script: Either the script is designed to work on a single case (the "Current Case"), or the script is designed to access the selection and traverse the cases by itself.
### Single case scripts
Single case scripts do not need to address cases explicitly, but works on what ResInsight considers being the "Current Case". When the user selects several cases and executes a script on them, ResInsight loops over all cases in the selection, sets the current case and executes the script. All references to the "Current Case" from the script will then refer to the case currently being processed by ResInsight.
The Current Case can be accessed directly using **riGetCurrentCase()**, but the more direct way is to *omit the CaseId parameter* in the functions, the Current Case is then automatically used.
### Multi case scripts
Scripts can access the selection state in ResInsight, and also retrieve lists of Case Groups and cases including some meta information. This can be used if the scripts need to get values from some cases, and store the results in others, etc.
### Case Types
The case type (Labeled "CaseType" in the following specification) of a case is returned as a text string when retrieving lists of cases, and is one of the following:
| Case Type | Description |
|----------------|-------------|
|ResultCase | A binary Eclipse case |
|InputCase | A case based on ASCII Eclipse input data |
|StatisticsCase | A statistics case based on many source cases in Grid Case Group |
|SourceCase | A binary Eclipse case in a Grid Case Group |
### Unresolved issues
The issue around having multiple instances of ResInsight is still not addressed, but might affect the function signatures by adding a port number parameter to all of them. We will try to find ways to avoid this, but are still not certain that we will succeed.
## Specification
### Project Information
The case information is presented in an octave Structure called CaseInfo, and contains the following fields:
CaseInfo = {
CaseId = int # A project-unique integer used to address this
# particular case
CaseName = string # The name that has been assigned to the case
# in ResInsight.
CaseType = string # See the description above
CaseGroupId = int # A project-unique integer identifying the
# CaseGroup this case is a member of.
# -1 if not in a CaseGroup. Valid only for
# Statistics-, and SourceCases
}
#### CaseInfo riGetCurrentCase()
This function returns a CaseInfo Structure for the Case considered being the "Current Case" by ResInsight. When ResInsight loops over a selection of cases and executes an Octave script for each of them, this function returns the CaseInfo for that particular Case.
#### Vector[CaseInfo] riGetSelectedCases()
This function returns a CaseInfo Structure for each of the cases selected in ResInsight at the time when the script launched.
#### Vector[CaseGroupInfo] riGetCaseGroups()
This function returns a CaseGroupInfo Structure for each of the case groups in the current ResInsight project.
CaseGroupInfo = {
CaseGroupId = int # A project-unique integer used to address
# this particular CaseGroup
CaseGroupName = string # The name assigned to the CaseGroup
# in ResInsight
}
#### Vector[CaseInfo] riGetCases([CaseGroupId])
This function returns a CaseInfo Structure for all the cases in the current ResInsight project, including the Statistics cases and Source cases in a Grid Case Group.
If a CaseGroupId is provided, only the cases in that Case Group will be returned.
### Retrieving Grid Metadata
#### Matrix[numActiveCells][9] riGetActiveCellInfo([CaseId], [PorosityModel = "Matrix"|"Fracture"] )
This function returns a two dimensional matrix containing grid and IJK information about each of the active cells in the requested case. The columns contain the following information:
[GridIdx, I, J, K, ParentGridIdx, PI, PJ, PK, CoarseBoxIdx]
GridIdx # The index of the grid the cell resides in.
# Main grid has index 0
I, J, K # 1-based index address of the cell in the grid.
ParentGridIdx # The index to the grid that this cell's grid
# is residing in.
PI, PJ, PK # 1-based address of the parent grid cell that
# this cell is a part of.
CoarseBoxIdx # 1-based coarsening box index, -1 if none.
# Coarsening box info can be retrieved using
# **riGetCoarseningInfo()**
If the CaseId is not defined, ResInsight's Current Case is used.
#### Matrix[numCoarseGroups][6] riGetCoarseningInfo([CaseId])
This function returns all coarse box definitions used in the grid.
The columns contain the following information:
[I1, I2, J1, J2, K1, K2]: 1-based index addresses of the min and max corners of the coarsening box.
If the CaseId is not defined, ResInsight's Current Case is used.
#### Matrix[numGrids][3] riGetGridDimensions([CaseId])
This function returns a two dimensional matrix: One row for each grid, starting with the main grid.
*NOTE*: This means that the "normal" GridIndices where 0 means Main Grid does not work directly with this matrix. You have to add 1.
The columns contain the following information:
[NI, NJ, NK]: I, J, K dimensions of the grid.
If the CaseId is not defined, ResInsight's Current Case is used.
#### Vector[TimeStepDate] riGetTimeStepDates([CaseId])
This function returns the date information for each of the time steps in the case as a Vector of Structures.
The Structure is defined as:
TimeStepDate = {
Year = int # The year eg. 2013
Month = int # The month. Eg. 12
Day = int # The day in the month. Eg. 24
Hour = int # The hour of the day. Eg. 17
Minute = int # The minute in the hour. Eg. 55
Second = int # The second within the minute. Eg. 30
}
If the CaseId is not defined, ResInsight's Current Case is used.
#### Vector[DecimalDay] riGetTimeStepDays([CaseId])
This function returns the time from the simulation start as decimal days for all the time steps as a Vector of doubles.
If the CaseId is not defined, ResInsight's Current Case is used.
### Retrieving Property Data
#### Vector[PropertyInfo] riGetPropertyNames([CaseId] ], [PorosityModel = "Matrix"|"Fracture"])
This function returns the name and type of all the properties in the case as a Vector of Structures.
The Structure is defined as:
PropertyInfo {
PropName = string # Name of the property as received from
# the analysis tool
PropType = string # The type of the property: "StaticNative",
# "DynamicNative", "Input", "Generated"
}
If the CaseId is not defined, ResInsight's Current Case is used.
#### Matrix[numActiveCells][numTimestepsRequested] riGetActiveCellProperty([CaseId], PropertyName, [RequestedTimeSteps], [PorosityModel = "Matrix"|"Fracture"])
This function returns a two dimensional matrix: [ActiveCells][Num TimestepsRequested] containing the requested property data from the case with CaseId.
If the case contains coarse-cells, the results are expanded onto the active cells.
If the CaseId is not defined, ResInsight's Current Case is used.
The RequestedTimeSteps must contain a list of indices to the requested timesteps. If not defined, all the timesteps are returned.
#### Matrix[numI][numJ][numK][numTimestepsRequested] <font style="color:darkblue"> riGetGridProperty</font> ([CaseId], GridIndex , PropertyName, [RequestedTimeSteps], [PorosityModel = "Matrix"|"Fracture"])
This function returns a matrix of the requested property data for all the grid cells in the requested grid for each requested timestep.
Grids are indexed from 0 (main grid) to max number of LGR's
If the CaseId is not defined, ResInsight's Current Case is used.
The RequestedTimeSteps must contain a list of indices to the requested time steps. If not defined, all the timesteps are returned.
Writing Back to ResInsight
#### riSetActiveCellProperty( Matrix[numActiveCells][numTimeSteps], [CaseId], PropertyName, [TimeStepIndices], [PorosityModel = "Matrix"|"Fracture"])
Interprets the supplied matrix as a property set defined for the active cells in the case, and puts the data into ResInsight as a "Generated" property with the name "PropertyName".
The "TimeStepIndices" argument is used to "label" all the time steps present in the supplied data matrix, and must thus be complete. The time step data will then be put into ResInsight at the time steps requested.
If the CaseId is not defined, ResInsight's Current Case is used.
#### riSetGridProperty( Matrix[numI][numJ][numK][numTimeSteps], [CaseId], GridIndex, PropertyName, [TimeStepIndices], [PorosityModel = "Matrix"|"Fracture"])
Interprets the supplied matrix as a property set defined for all cells in one of the grids in a case, and puts the data into ResInsight as a "Generated" property with the name "PropertyName".
The "TimeStepIndices" argument is used to "label" all the time steps present in the supplied data matrix, and must thus be complete. The time step data will then be put into ResInsight at the time steps requested.
If the CaseId is not defined, ResInsight's Current Case is used.
### Cell Geometry Functions
#### Matrix[numI][numJ][numK][3] riGetCellCenters([CaseId], GridIndex)
This function returns the UTM coordinates (X, Y, Z) of the center point of all the cells in the grid.
If the CaseId is not defined, ResInsight's Current Case is used.
#### Matrix[ActiveCells][3] riGetActiveCellCenters([CaseId], [PorosityModel = "Matrix"|"Fracture"])
This function returns the UTM coordinates (X, Y, Z) of the center point of each of the active cells.
If the CaseId is not defined, ResInsight's Current Case is used.
Cell Corner Index layout
The corner indices follow the ECLIPSE standard:
6-------------7 |k
/| /| | /j
/ | / | |/
/ | / | *---i
4-------------5 |
| | | |
| 2---------|---3
| / | /
| / | /
|/ |/
0-------------1
#### Matrix[numI][numJ][numK][8][3] riGetCellCorners([CaseId], GridIndex)
This function returns the UTM coordinates(X, Y, Z) of the 8 corners of all the cells in the grid.
If the CaseId is not defined, ResInsight's Current Case is used.
#### Matrix[ActiveCells][8][3] riGetActiveCellCorners([CaseId], [PorosityModel = "Matrix"|"Fracture"])
This function returns the UTM coordinates (X, Y, Z) of the 8 corners of each of the active cells.
If the CaseId is not defined, ResInsight's Current Case is used.
### Well Data Functions
#### Vector[WellNames] riGetWellNames([CaseId])
This function returns the names of all the wells in the case as a Vector of strings.
If the CaseId is not defined, ResInsight's Current Case is used.
Vector[WellCellInfo] riGetWellCells([CaseId], WellName, TimeStep)
This function returns the cells defined in the specified well for the time step requested as a vector of Structures. The Structure is defined as:
WellCellInfo {
I, J, K = int # Index to the cell in the grid
GridIndex = int # the index of the grid. Main grid has index 0.
CellStatus = int # is either 0 or 1, meaning the cell is closed
# or open respectively
BranchId = int # Branch id of the branch intersecting the cell
SegmentId = int # Branch segment id of the branch intersecting the cell
}
If the CaseId is not defined, ResInsight's Current Case is used.
#### Vector[WellStatus] riGetWellStatus ([CaseId], WellName, [RequestedTimeSteps])
This function returns the status information for a specified well for each requested time step as a vector of Structures. The Structure is defined as:
WellStatus {
WellType = string # "Producer", "OilInjector",
# "WaterInjector", "GasInjector", "NotDefined"
WellStatus = int # is either 0 or 1, meaning the well is shut
# or open respectively
}
If the CaseId is not defined, ResInsight's Current Case is used.
------
[ Contents ](UsersGuide.md#contents)

View File

@ -0,0 +1,14 @@
# Documentation #
Documentation files uses the GitHub markdown syntax. A common file extension for markdown files is .md.
[GitHub Markdown syntax](https://help.github.com/articles/github-flavored-markdown)
## How to produce PDF from markdown files ##
Pandoc can be used to generated PDF from a markdown file like this
pandoc -f markdown_github GettingStarted.md -o GettingStarted.pdf
See here for information on Pandoc
[http://johnmacfarlane.net/pandoc/](http://johnmacfarlane.net/pandoc/)

View File

@ -0,0 +1,48 @@
[ Contents ](UsersGuide.md#contents)
-----
## Regression test system
A regression tool for QA is build into ResInsight. This tool will do the following:
1. Scan a directory for sub directories containing a **RegressionTest.rip** files.
2. Each found project file will be opened, and all views in this project will be exported as snapshot images to file.
3. When snapshot images from all projects are completed, difference images based on generated and QA-approved images are computed.
4. Based on these three sets of images, an HTML report is created and automatically displayed.
### Starting regression tests
To be able to run regression tests you need the **compare** tool from the [ImageMagic suite](http://www.imagemagick.org/script/compare.php).
You can start the tests either from the command line or from the ResInsight Gui.
From the ResInsight Gui select : **File->Testing->Regression Test Dialog**
![](images/RegressionTestDialog.png)
Specify location of compare tool in **Folder containing compare**. The current working directory of ResInsight is temporarily changed to this path during execution.
### Creating regression tests
An example of the folder structure is shown below:
RegressionTestFolder/
TestCase1/
RegressionTest.rip
RegTestBaseImages/
RegTestDiffImages/
RegTestGeneratedImages/
TestCase2/
...
To create regression tests you need to do the following:
1. Create a root directory containing one directory for each test case.
2. In each of the **Test Case** folders create a ResInsight project file called **RegressionTest.rip**.
3. Run the regression test for the first time, and thereby creating images that can be used as Base images.
4. Rename the generated RegTestGeneratedImages/ folder to RegTestBaseImages/
Now you are all set to test new releases of ResInsight towards your own Regression tests.
------
[ Contents ](UsersGuide.md#contents)

View File

@ -0,0 +1,142 @@
[ Contents ](UsersGuide.md#contents)
-----
## Working with 3D Views
3D Views are the windows displaying the Grid Models. The visualization is controlled by the **Project Tree** item representing the **View** and their subitems. Each item has a set of proerties that can be editied in the **Property View**.
![](images/3DViewOverview.png)
Below is a description of the most important View settings and their properties.
### Cell Result ![](images/CellResult.png)
The **Cell Result** item defines which Eclipse property the 3D View uses for the main cell color. The property can be chosen in the property panel of the **Cell Result** item. The mapping between cell values and color is defined by the **Legend Definition** ![](images/Legend.png) along with some appearance settings on the Legend itself. (Number format etc.)
### Cell Edge Results ![](images/EdgeResult_1.png)
The **Cell Edge Result** visualization mode is one of ResInsight's special features. Its main use is to show the MULT(X, Y, Z) properties at the same time.
This will show the MULT property values *different from 1.0* along the correct edges of the cells. In effect this highlights the faults and makes it easy to verify all the MULT values in one go.
![](images/CellEdgeExample.png)
ResInsight supports all properties ending with X, Y, Z and X-, Y-, Z-. However, it is only the MULT property that ignores values of 1.0.
When selecting a result variable for cell edge, a second legend shows up in the 3D view showing the variation in values for this second property. Color legend management is available when selecting the **Legend Definition** item belonging to the **Cell Edge Result** item.
### Info Box
The **Info Box** controls the visibility of the animation progress, the Case description box, and the results histogram.
The **Results Histogram** shows a histogram of the complete time series of the currently loaded **Cell Result** together with:
- The mean value ( a blue line )
- P10 and P90 ( red lines )
![](images/HistogramExample.png)
### Cell Filters
Cell Filters are used to control visibility of the cells in the 3D view. Three types of filters exists:
- **Range filter** : Define a IJK subset of the model.
- **Property filter** : Define a value range for a property to control cell visibility.
- **Well cell filter** : Display grid cells that has connections to a well. Controlled from the **Simulation Wells** item.
All filters can be turned on or off using the toggle in the **Project Tree** and controlled from their corresponding **Property Editor**.
#### Range filters
Using range filters enables the user to define a set of IJK visible regions in the 3D view.
A new range filter can be added by activating the context menu for the **Range Filters** collection in the **Project Tree**.
*TIP:* An I,J or K-slice range filter can be added directly from a Cell in the **3D View** by rightclicking the cell and using the context menu.
Below is a snapshot of the **Property Editor** of the **Range Filter** :
![](images/RangeFilterProperties.png)
- **Filter Type** : The filter can either make the specified range visible ( *Include* ), or remove the range from the View ( *Exclude* ).
- **Grid** : This option selects which of the grids the range is addressing.
- **Apply to Subgrids** : This option tells ResInsight to use the visibility of the cells in the current grid to control the visibility of the cells in sub-LGR's. If this option is turned off, Sub LGR-cells is not included in this particular Range Filter.
The **Start** and **Width** labels in front of the sliders features a number in parenthesis denoting maximum available value.<br>
The **Start** labels shows the index of the start of the active cells.<br>
The **Width** labels shows the number of active cells from the start of the active cells.
#### Property filters
**Property filters** apply to the results of the **Range filters**. Below is a snapshot of the **Property Editor** of the **Property Filter**.
![](images/PropertyFilterProperties.png)
This filter filters the cells based on a property value range (Min - Max). Cells in the range are either shown or hidden depending on the **Filter Type** ( *Include* / *Exclude* ). Exclude-filters removes the selected cells from the **View** even if some other filter includes them.
A new property filter can be made by activating the context menu for **Property Filters**. The new property filter is based on the currently viewed cell result by default.
### Simulation Wells
This item controls the overall settings for how wells in the Eclipse simulation are visualized.
The wells are shown in two ways:
1. A pipe through all cells with well connections
2. By adding the well cells to the set of visible cells
The latter is handled internally as a special range filter, and adds cells to the set of range filtered cells.
The Property Editor of the **Simulation Wells** item is shown below:
![](images/SimulationWellsProperties.png)
- **Add cells to range filter** This option controls how the well cells
(cells with connections to wells) are added to the set of range filtered cells.
- *All On* will add the cells from all wells disregarding the individual settings on the well.
- *All Off* will prevent any well cells to be added.
- *Individually* will respect the individual settings for each well, and add the cells from the wells with this option set on.
- **Use Well Fence** and
- **Well Fence direction** Controls whether to add extensions of the well cells in the I, J or K direction to the set of range filtered cells
- **Well head** These options control the appearance and position of the well labels and and symbols of the top of the well
- **Global Well Pipe Visibility** Controls if and when to show the pipe representation of the wells. The options are:
- *All On* will show the pipes from all wells disregarding the individual settings on the well.
- *All Off* will hide all simulation well pipes.
- *Individual* Will respect the individual settings for each well, and only show the well pipes from the wells with this option set on. See below.
- *Visible Cells Filtered* This option will only show the pipes of wells that are connected to visible cells. That means the combined result of **Range Filters**, **Property Filters** and any **Well Range Filters**.
*NOTE* : All Wells with **Well Range Filter** turned on will always be visible with this option selected.
- **Pipe Radius Scale** Scaling the pipe radius by the average max cell size.
- **Geometry based Branch detection** Applies only to ordinary wells (not MSW)
and will detect that parts of a well really is a branch. Those well parts will
be visualized as a branch starting at the well head instead of at the previous connected cell.
##### Well pipes of Multi Segment Wells
###### Geometry approximation
The pipe geometry generated for MSW's are based on the topology of the well (branch/segment structure) and the position of the cells being connected. The segment lengths are used as hints to place the branch points at sensible places. Thus the pipe geometry itself is not geometrically correct, but makes the topology of the well easier to see.
###### Dummy branches
Often MSW's are modeled using a long stem without connections and a multitude of small branches; one for each connection. ResInsight offsets the the pipe within the cell to clearly show how the topology of the well is defined.
![](images/MSWDummyBranchExample.png)
###### Picking reveals Segment/Branch info
Branch and segment info of a MSW-connected-Cell is shown in the **Result Info** window when picking a cell in the 3D View. This can be handy when relating the visualization to the input files.
### Individual Simulation Well options
Each of the wells can have some individual settings. These options works as specializations of the ones set on the global level (**Simulation Wells** See above) but will *only come into play when they are not ignored by the global settings*.
This is particularly important to notice for the **Show Well Pipe** and **Range Filter** options. They will not have effect if the corresponding global settings in **Simulation Wells** allows them to.
The properties of a single well are shown below.
![](images/WellProperties.png)
One option needs further explanation:
- **Pipe Radius Scale** This option is a scale that is added to the "global" scale set in the **Simulation Wells** properties.
------
[ Contents ](UsersGuide.md#contents)

View File

@ -0,0 +1,30 @@
# ![](images/AppLogo48x48.png) ResInsight 1.0 Users Guide
## Introduction
ResInsight is an open source, cross-platform 3D visualization and post processing tool for reservoir models and simulations. The system also constitutes a framework for further development and support for new data sources and visualization methods, e.g. additional solvers, seismic data, CSEM, geomechanics, and more.
The user interface is tailored for efficient interpretation of reservoir simulation data with specialized visualizations of properties, faults and wells. It enables easy handling of a large number of realizations and calculation of statistics. To be highly responsive, ResInsight exploits multi-core CPUs and GPUs. Integration with GNU Octave enables powerful and flexible result manipulation and computations. Derived results can be returned to ResInsight for further handling and visualization. Eventually, derived and computed properties can be directly exported to Eclipse input formats for further simulation cycles and parameter studies.
The main input data is
`*.GRID` and `*.EGRID` files along with their `*.INIT` and restart files `*.XNNN` and `*.UNRST`.
ResInsight also supports selected parts of Eclipse input files and can read grid
information and corresponding cell property data sets.
ResInsight has been co-developed by Statoil ASA, Ceetron Solutions AS, and Ceetron AS with the aim to provide a versatile tool for professionals who need to visualize and process reservoir models.
### Contents
- [ Getting Started ](GettingStarted.md)
- [ Working with 3D Views ](ReservoirViews.md)
- [ Multiple realizations and statistics ](CaseGroupsAndStatistics.md)
- [ Octave Interface](OctaveInterface.md)
- [ Well Trajectories ](WellPaths.md)
### Appendix
- [ Octave Interface Reference](OctaveInterfaceReference.md)
- [ Regression Test System ](RegressionTestSystem.md)
- [ Command Line Arguments](CommandLineParameters.md)

View File

@ -0,0 +1,74 @@
[ Contents ](UsersGuide.md#contents)
-----
## Well trajectories
ResInsight can import Well trajectories from simple Ascii files.
In addition, a Statoil specific solution to retrieve Well Trajectories from their internal web service is implemented.
### Ascii Well Trajectories
The command **File -> Import -> Import Well Paths From File** will read the well paths in the selected file, and create one entry for each trajectory under the ![](images/WellCollection.png) **Wells** item in the **Project Tree**.
The supported ASCII format is quite flexible but the main requirements are:
1. Each data line must contain four numbers: X Y TVD MD separated with white-space.
2. A line starting with none-number-characters are ignored, unless :
1. If the line contains a pair of : ', `, ´, or the text between the quotation marks is used as a well name.
2. If the line contains the case insensitive string "name " the rest of the line is used as a well name.
3. If a well name is found, a new well is created and the following data points ends up in it.
###### Example 1:
WELLNAME: WELL1
4507.0 5638.5 0.0 0.0
4507 5638.5 4628.6 1628.6
4297.4 5938.5 4632.4 1998.387
-999
WELLNAME: WELL2
5507.0 4638.5 0.0 0.0
5507 4638.5 3628.6 1628.6
5297.4 4938.5 3632.4 1998.387
-999
###### Example 2:
X Y TVD MD
Name Well_1
5507.0 4638.5 0.0 0.0
5507 4638.5 3628.6 1628.6
5297.4 4938.5 3632.4 1998.387
Name Well_2
5507.0 4638.5 0.0 0.0
5507 4638.5 3628.6 1628.6
5297.4 4938.5 3632.4 1998.387
The trajectory data is not copied into the ResInsight project as such. The project file only stores the file path, and the next time you open the project, ResInsight will try to read the well data from the file again.
### Importing from SSI-Hub (Internal Statoil web-service)
The command **File -> Import -> Import Well Paths From SSI-hub** launches a wizard to guide you through the process of selecting the well trajectories you need.
After completing the wizard, the wells imported are accessible as Items under the ![](images/WellCollection.png) **Wells** item in the **Project Tree**.
The trajectory data is not copied into the ResInsight project as such, but is stored in files in a directory called <ProjectFileName>_wellpaths in the same directory as your project file.
### Well Trajectory visualization
All the imported well trajectories are available below the ![](images/WellCollection.png) **Wells** item in the **Project Tree**.
![](images/WellsInTree.png)
The visible wells are always shown in all the 3D Views in the complete project, so the toggles and settings control the overall project visibility of the Well Trajectories. The **Property Editor** of the **Wells** item is shown below
![](images/WellPathCollectionProperties.png)
- **Global well path visibility** This option forces the well paths on or off, ignoring the individual settings unless it is set to Individual.
- **Clip Well Paths** This option hides the top of the Well Trajectories to avoid displaying the very long lines from the reservoir to the sea surface.
- **Well Path clipping depth distance** This number is the distance from the top of the reservoir to the clipping depth.
------
[ Contents ](UsersGuide.md#contents)

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 491 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 669 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 986 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

View File

@ -98,6 +98,7 @@ public:
bool operator!= (T value) const { return m_value != value;}
operator T () const { return m_value;}
size_t index() const { return EnumMapper::instance()->index(m_value);}
QString text() const { return EnumMapper::instance()->text(m_value);}
QString uiText() const { return EnumMapper::instance()->uiText(m_value);}

View File

@ -81,6 +81,8 @@ public:
PdmObject* ownerObject() { return m_ownerObject; }
// Generalized access methods for User interface
// The QVariant encapsulates the real value, or an index into the valueOptions
//
virtual QVariant uiValue() const { return QVariant(); }
virtual void setValueFromUi(const QVariant& ) { }

View File

@ -48,6 +48,13 @@ namespace caf
//==================================================================================================
//--------------------------------------------------------------------------------------------------
/// This method is supposed to be the interface for the implementation of UI editors to set values into
/// the field. The data to set must be encapsulated in a QVariant.
/// This method triggers PdmObject::fieldChangedByUi() and PdmObject::updateConnectedEditors(), an thus
/// makes the application and the UI aware of the change.
///
/// Note : If the field has optionValues the interface is _index-based_. The QVariant must contain
/// an UInt representing the index to the option selected by the user interface.
///
//--------------------------------------------------------------------------------------------------
template<typename DataType >
@ -131,6 +138,9 @@ void caf::PdmField<DataType>::setValueFromUi(const QVariant& uiValue)
/// This method calls the virtual PdmObject::calculateValueOptions to get the list provided from the
/// application, then possibly adds the current field value(s) to the list, to
/// make sure the actual values are shown
///
/// Note: This method is missing the uiConfigName concept. This is a Todo. The m_optionEntryCache
/// then needs to be stored pr. uiConfigName.
//--------------------------------------------------------------------------------------------------
template<typename DataType >
QList<PdmOptionItemInfo> caf::PdmField<DataType>::valueOptions(bool* useOptionsOnly)
@ -190,16 +200,24 @@ QList<PdmOptionItemInfo> caf::PdmField<DataType>::valueOptions(bool* useOptionsO
// If we have no options, use the options defined by the type. Normally only caf::AppEnum type
#if 0
m_optionEntryCache = PdmFieldTypeSpecialization<DataType>::valueOptions(useOptionsOnly, m_fieldValue);
return m_optionEntryCache;
#else
return PdmFieldTypeSpecialization<DataType>::valueOptions(useOptionsOnly, m_fieldValue);
#endif
}
//--------------------------------------------------------------------------------------------------
/// Extracts a QVariant representation of the data in the field to be used in the UI.
/// Note that for fields with a none empty valueOptions list the returned QVariant contains the
/// indexes to the selected options rather than the actual values, if they can be found.
/// If this is a multivalue field, and we cant find all of the field values among the options,
/// the method asserts (For now), forcing the valueOptions to always contain the field values.
/// Single value fields will return -1 if the option is not found, allowing the concept of "nothing selected"
///
/// Note : For fields with a none-empty valueOptions list, the returned QVariant contains the
/// _indexes_ to the selected options rather than the actual values, if they can be found.
///
/// If this is a multivalue field, and we cant find all of the field values among the options,
/// the method asserts (For now), forcing the valueOptions to always contain the field values.
/// Single value fields will return -1 if the option is not found, allowing the concept of "nothing selected"
//--------------------------------------------------------------------------------------------------
template<typename DataType >
QVariant caf::PdmField<DataType>::uiValue() const

View File

@ -252,8 +252,15 @@ public:
//==================================================================================================
/// Partial specialization for PdmField< caf::AppEnum<T> >
///
/// Note : Makes the setUiValue() and uiValue() interface index based, and NOT based on real enum values.
/// The valueOptions() interface is thus also index based (the value in the PdmOptionItemInfo is index NOT enum)
/// This is probably going to change, ans it is strange.
/// This conversion should really be done in the editors we think (now)
//==================================================================================================
#define PDMFIELDAPPENUM_USE_INDEX_BASED_INTERFACE 1
template <typename T>
class PdmFieldTypeSpecialization < caf::AppEnum<T> >
{
@ -261,13 +268,22 @@ public:
/// Convert the field value into a QVariant
static QVariant convert(const caf::AppEnum<T>& value)
{
#if PDMFIELDAPPENUM_USE_INDEX_BASED_INTERFACE
return QVariant(static_cast<unsigned int>(caf::AppEnum<T>::index(value)));
#else
unsigned int enumVal = value;
return QVariant(enumVal);
#endif
}
/// Set the field value from a QVariant
static void setFromVariant(const QVariant& variantValue, caf::AppEnum<T>& value)
{
#if PDMFIELDAPPENUM_USE_INDEX_BASED_INTERFACE
value.setFromIndex(variantValue.toInt());
#else
value = static_cast<T> (variantValue.toInt());
#endif
}
/// Methods to get a list of options for a field, specialized for AppEnum
@ -280,7 +296,11 @@ public:
int i;
for (i = 0; i < optionTexts.size(); ++i)
{
#if PDMFIELDAPPENUM_USE_INDEX_BASED_INTERFACE
optionList.push_back(PdmOptionItemInfo(optionTexts[i], static_cast<unsigned int>(i)));
#else
optionList.push_back(PdmOptionItemInfo(optionTexts[i], caf::AppEnum<T>::fromIndex(i)));
#endif
}
return optionList;

View File

@ -88,11 +88,6 @@ PdmUiTreeViewEditor::PdmUiTreeViewEditor()
//--------------------------------------------------------------------------------------------------
PdmUiTreeViewEditor::~PdmUiTreeViewEditor()
{
if (m_proxyEditor)
{
delete m_proxyEditor;
m_proxyEditor = NULL;
}
}
//--------------------------------------------------------------------------------------------------

View File

@ -21,6 +21,8 @@ add_library( ${PROJECT_NAME}
cafCadNavigation.h
cafCeetronNavigation.cpp
cafCeetronNavigation.h
cafCeetronPlusNavigation.cpp
cafCeetronPlusNavigation.h
cafNavigationPolicy.cpp
cafNavigationPolicy.h
cafOpenGLWidget.cpp

View File

@ -0,0 +1,262 @@
//##################################################################################################
//
// Copyright (C) 2011, Ceetron AS
// This is UNPUBLISHED PROPRIETARY SOURCE CODE of Ceetron AS. The contents of this file may
// not be disclosed to third parties, copied or duplicated in any form, in whole or in part,
// without the prior written permission of Ceetron AS.
//##################################################################################################
#include "cafCeetronPlusNavigation.h"
#include "cafViewer.h"
#include "cvfCamera.h"
#include "cvfScene.h"
#include "cvfModel.h"
#include "cvfViewport.h"
#include "cvfHitItemCollection.h"
#include "cvfRay.h"
#include <QInputEvent>
#include <QHBoxLayout>
using cvf::ManipulatorTrackball;
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void caf::CeetronPlusNavigation::init()
{
m_trackball = new cvf::ManipulatorTrackball;
m_trackball->setCamera(m_viewer->mainCamera());
m_isRotCenterInitialized = false;
m_hasMovedMouseDuringNavigation = false;
m_isNavigating = false;
m_isZooming = false;
m_lastPosX = 0;
m_lastPosY = 0;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool caf::CeetronPlusNavigation::handleInputEvent(QInputEvent* inputEvent)
{
if (! inputEvent) return false;
bool isEventHandled = false;
switch (inputEvent->type())
{
case QEvent::MouseButtonPress:
{
QMouseEvent * me = static_cast<QMouseEvent*>( inputEvent);
int translatedMousePosX = me->x();
int translatedMousePosY = m_viewer->height() - me->y();
if (me->button() == Qt::RightButton)
{
cvf::HitItemCollection hic;
bool hitSomething = m_viewer->rayPick(me->x(), me->y(), &hic);
if (hitSomething)
{
cvf::Vec3d pointOfInterest = hic.firstItem()->intersectionPoint();
m_trackball->setRotationPoint(pointOfInterest);
m_pointOfInterest = pointOfInterest;
}
else
{
initializeRotationCenter();
}
m_trackball->startNavigation(cvf::ManipulatorTrackball::ROTATE, translatedMousePosX, translatedMousePosY);
//m_viewer->setCursor(RICursors::get(RICursors::ROTATE));
m_isNavigating = true;
m_hasMovedMouseDuringNavigation = false;
isEventHandled = true;
}
else if (me->button() == Qt::LeftButton)
{
if (me->modifiers() == Qt::NoModifier)
{
m_trackball->startNavigation(cvf::ManipulatorTrackball::PAN, translatedMousePosX, translatedMousePosY);
m_isNavigating = true;
m_hasMovedMouseDuringNavigation = false;
isEventHandled = true;
}
}
else if (me->button() == Qt::MidButton)
{
if (me->modifiers() == Qt::NoModifier)
{
QMouseEvent* we = static_cast<QMouseEvent*> ( inputEvent);
m_lastPosX = we->x();
m_lastPosY = we->y();
m_zoomRay = m_viewer->mainCamera()->rayFromWindowCoordinates(translatedMousePosX, translatedMousePosY);
m_isNavigating = true;
m_hasMovedMouseDuringNavigation = false;
isEventHandled = true;
m_isZooming = true;
}
}
}
break;
case QEvent::MouseButtonRelease:
{
if (m_isNavigating)
{
QMouseEvent * me = static_cast<QMouseEvent*>( inputEvent);
if (me->button() == Qt::RightButton || me->button() == Qt::LeftButton )
{
m_trackball->endNavigation();
m_isNavigating = false;
if (m_hasMovedMouseDuringNavigation) isEventHandled = true;
m_hasMovedMouseDuringNavigation = false;
}
else if ( me->button() == Qt::MidButton )
{
m_isZooming = false;
m_isNavigating = false;
if (m_hasMovedMouseDuringNavigation) isEventHandled = true;
m_hasMovedMouseDuringNavigation = false;
}
}
}
break;
case QEvent::MouseMove:
{
initializeRotationCenter();
if (m_isRotCenterInitialized)
{
QMouseEvent * me = static_cast<QMouseEvent*>( inputEvent);
int translatedMousePosX = me->x();
int translatedMousePosY = m_viewer->height() - me->y();
if (m_isNavigating)
{
if (m_isZooming)
{
int delta = 3*(m_lastPosY - me->y());
this->zoomAlongRay(m_zoomRay.p(), delta);
m_lastPosX = me->x();
m_lastPosY = me->y();
}
else
{
bool needRedraw = m_trackball->updateNavigation(translatedMousePosX, translatedMousePosY);
if (needRedraw)
{
m_viewer->update();
}
}
isEventHandled = true;
m_hasMovedMouseDuringNavigation = true;
}
}
}
break;
case QEvent::Wheel:
{
if (inputEvent->modifiers() == Qt::NoModifier)
{
initializeRotationCenter();
if (m_isRotCenterInitialized)
{
QWheelEvent* we = static_cast<QWheelEvent*> ( inputEvent);
int translatedMousePosX = we->x();
int translatedMousePosY = m_viewer->height() - we->y();
int delta = we->delta();
cvf::ref<cvf::Ray> ray;
if (delta < 0)
ray = m_viewer->mainCamera()->rayFromWindowCoordinates(translatedMousePosX, translatedMousePosY);
else
ray = m_viewer->mainCamera()->rayFromWindowCoordinates((int)(1.0*translatedMousePosX), (int)(1.0*translatedMousePosY));
zoomAlongRay(ray.p(), delta);
}
isEventHandled = true;
}
}
break;
}
return false;//isEventHandled;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void caf::CeetronPlusNavigation::initializeRotationCenter()
{
if(m_isRotCenterInitialized || m_trackball.isNull() || !m_viewer->mainScene() || !m_viewer->currentScene()->boundingBox().isValid()) return;
m_pointOfInterest = m_viewer->currentScene()->boundingBox().center();
m_trackball->setRotationPoint(m_pointOfInterest);
m_isRotCenterInitialized = true;
}
//--------------------------------------------------------------------------------------------------
/// Repositions and orients the camera to view the rotation point along the
/// direction "alongDirection". The distance to the rotation point is maintained.
///
//--------------------------------------------------------------------------------------------------
void caf::CeetronPlusNavigation::setView( const cvf::Vec3d& alongDirection, const cvf::Vec3d& upDirection )
{
m_trackball->setView(alongDirection, upDirection);
/*
if (m_camera.isNull()) return;
Vec3d dir = alongDirection;
if (!dir.normalize()) return;
Vec3d up = upDirection;
if(!up.normalize()) up = Vec3d::Z_AXIS;
if((up * dir) < 1e-2) up = dir.perpendicularVector();
Vec3d cToE = m_camera->position() - m_rotationPoint;
Vec3d newEye = m_rotationPoint - cToE.length() * dir;
m_camera->setFromLookAt(newEye, m_rotationPoint, upDirection);
*/
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Vec3d caf::CeetronPlusNavigation::pointOfInterest()
{
initializeRotationCenter();
return m_pointOfInterest;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void caf::CeetronPlusNavigation::setPointOfInterest(cvf::Vec3d poi)
{
m_pointOfInterest = poi;
m_trackball->setRotationPoint(poi);
m_isRotCenterInitialized = true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void caf::CeetronPlusNavigation::zoomAlongRay(cvf::Ray* ray, int delta)
{
if (ray && abs(delta) > 0)
{
cvf::Vec3d pos, vrp, up;
m_viewer->mainCamera()->toLookAt(&pos, &vrp, &up);
double scale = delta/8.0 * 1.0/150 * (pos - m_pointOfInterest).length();
cvf::Vec3d trans = scale * ray->direction();
cvf::Vec3d newPos = pos + trans;
cvf::Vec3d newVrp = vrp + trans;
m_viewer->mainCamera()->setFromLookAt(newPos, newVrp, up );
m_viewer->update();
}
}

View File

@ -0,0 +1,51 @@
//##################################################################################################
//
// Copyright (C) 2011, Ceetron AS
// This is UNPUBLISHED PROPRIETARY SOURCE CODE of Ceetron AS. The contents of this file may
// not be disclosed to third parties, copied or duplicated in any form, in whole or in part,
// without the prior written permission of Ceetron AS.
//##################################################################################################
#pragma once
#include "cvfBase.h"
#include "cafNavigationPolicy.h"
#include "cvfManipulatorTrackball.h"
#include "cvfRay.h"
namespace caf
{
class CeetronPlusNavigation : public NavigationPolicy
{
protected:
// General navigation policy overrides
virtual void init();
virtual bool handleInputEvent(QInputEvent* inputEvent);
virtual void setView( const cvf::Vec3d& alongDirection, const cvf::Vec3d& upDirection );
virtual cvf::Vec3d pointOfInterest();
virtual void setPointOfInterest(cvf::Vec3d poi);
// PdvNavigation specific
void initializeRotationCenter();
cvf::ref<cvf::ManipulatorTrackball> m_trackball;
bool m_isRotCenterInitialized;
cvf::Vec3d m_pointOfInterest;
bool m_isNavigating;
bool m_hasMovedMouseDuringNavigation;
// Handle mid mouse button zoom
void zoomAlongRay( cvf::Ray* ray, int delta );
bool m_isZooming;
cvf::ref<cvf::Ray> m_zoomRay;
int m_lastPosX; /// Previous mouse position
int m_lastPosY;
};
} // End namespace caf

View File

@ -1,4 +1,7 @@
# mkoctfile -I../../QtInstall/Qt-4.7.3/include/QtNetwork -I../../QtInstall/Qt-4.7.3/include/QtCore -I../../QtInstall/Qt-4.7.3/include -L../../QtInstall/Qt-4.7.3/lib -lQtCore -lQtNetwork getEclipseProperty.cpp
# Some of the functionality in this CMakeLists.txt might be easier to maintain if we use a CMake macro to find configuration info for Octave
# This file is currently (2.8.12) not part of default CMake installation
# See http://www.cmake.org/Wiki/CMakeUserFindOctave
set(CPP_SOURCES
riGetActiveCellProperty.cpp
@ -32,87 +35,90 @@ endif()
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set (QT_LIBRARY_POSTFIX 4)
if (CMAKE_CL_64)
option(RESINSIGHT_OCTAVE_PLUGIN_32_BIT "Use 32-bit environment for compilation on Windows (mkoctfile and Qt used for Octave must match)" OFF)
endif()
endif()
# Find location of Octave based on mkoctfile
find_program(RESINSIGHT_OCTAVE_PLUGIN_MKOCTFILE mkoctfile)
if(RESINSIGHT_OCTAVE_PLUGIN_MKOCTFILE)
get_filename_component(RESINSIGHT_OCTAVE_BIN_DIR ${RESINSIGHT_OCTAVE_PLUGIN_MKOCTFILE} PATH)
STRING(REPLACE "/bin" "" OCTAVE_HOME ${RESINSIGHT_OCTAVE_BIN_DIR})
else()
message(WARNING "Failed to find mkoctfile, no Octave plugins will be compiled. Please specify RESINSIGHT_OCTAVE_PLUGIN_MKOCTFILE")
endif()
find_program(RESINSIGHT_OCTAVE_PLUGIN_QMAKE NAMES qmake-qt4 qmake)
if(RESINSIGHT_OCTAVE_PLUGIN_QMAKE)
get_filename_component(OCTAVE_QMAKE_DIR ${RESINSIGHT_OCTAVE_PLUGIN_QMAKE} PATH)
STRING(REPLACE "/bin" "" OCTAVE_QT_ROOT ${OCTAVE_QMAKE_DIR})
SET(OCTAVE_QT_INCLUDE_DIR ${OCTAVE_QT_ROOT}/include)
SET(OCTAVE_QT_QTCORE_INCLUDE_DIR ${OCTAVE_QT_ROOT}/include/QtCore)
SET(OCTAVE_QT_QTNETWORK_INCLUDE_DIR ${OCTAVE_QT_ROOT}/include/QtNetwork)
SET(OCTAVE_QT_LIBRARY_DIR ${OCTAVE_QT_ROOT}/lib)
else()
message(WARNING "Failed to find Qt to be used to compile Octave plugins, no Octave plugins will be compiled. Please specify RESINSIGHT_OCTAVE_PLUGIN_QMAKE")
endif()
# Clear the list of binary oct files to be produced
set(OCTAVE_BINARY_OCT_FILES)
# On Windows, the Octave plugins are compiled using 32-bit VS2010
# To be able to do so, we need to establish all Qt-related variables for a 32-bit configuration
# In addition, VS2010 32-bit compile environment must be launched
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows" AND CMAKE_CL_64)
find_program(RESINSIGHT_OCTAVE_PLUGIN_32BIT_QMAKE_EXE 32bitqmake)
if(RESINSIGHT_OCTAVE_PLUGIN_32BIT_QMAKE_EXE)
get_filename_component(32BIT_QMAKE_PATH ${RESINSIGHT_OCTAVE_PLUGIN_32BIT_QMAKE_EXE} PATH) # Get path to 32-bit Qt binary directory
STRING(REPLACE "/bin" "" OCTAVE_QT_ROOT ${32BIT_QMAKE_PATH})
if (RESINSIGHT_OCTAVE_PLUGIN_QMAKE AND RESINSIGHT_OCTAVE_PLUGIN_MKOCTFILE)
foreach(srcFileName IN LISTS CPP_SOURCES)
SET(OCTAVE_QT_INCLUDE_DIR ${OCTAVE_QT_ROOT}/include)
SET(OCTAVE_QT_QTCORE_INCLUDE_DIR ${OCTAVE_QT_ROOT}/include/QtCore)
SET(OCTAVE_QT_QTNETWORK_INCLUDE_DIR ${OCTAVE_QT_ROOT}/include/QtNetwork)
SET(OCTAVE_QT_LIBRARY_DIR ${OCTAVE_QT_ROOT}/lib)
endif()
else()
SET(OCTAVE_QT_INCLUDE_DIR ${QT_INCLUDE_DIR})
SET(OCTAVE_QT_QTCORE_INCLUDE_DIR ${QT_QTCORE_INCLUDE_DIR})
SET(OCTAVE_QT_QTNETWORK_INCLUDE_DIR ${QT_QTNETWORK_INCLUDE_DIR})
SET(OCTAVE_QT_LIBRARY_DIR ${QT_LIBRARY_DIR})
endif()
if(NOT IS_ABSOLUTE "${srcFileName}")
set(srcFileName "${CMAKE_CURRENT_SOURCE_DIR}/${srcFileName}")
endif()
find_program(RESINSIGHT_OCTAVE_PLUGIN_MKOCTFILE_EXE mkoctfile)
if(NOT RESINSIGHT_OCTAVE_PLUGIN_MKOCTFILE_EXE)
message(WARNING "Failed to find mkoctfile")
else()
get_filename_component(baseFilename "${srcFileName}" NAME_WE)
# Get path to Octave binary directory to be able to build .oct files if Octave is not in path
get_filename_component(OCTAVE_PATH ${RESINSIGHT_OCTAVE_PLUGIN_MKOCTFILE_EXE} PATH)
set(octFileName "${CMAKE_CURRENT_BINARY_DIR}/${baseFilename}.oct")
foreach(srcFileName IN LISTS CPP_SOURCES)
if(NOT IS_ABSOLUTE "${srcFileName}")
set(srcFileName "${CMAKE_CURRENT_SOURCE_DIR}/${srcFileName}")
endif()
get_filename_component(baseFilename "${srcFileName}" NAME_WE)
set(octFileName "${CMAKE_CURRENT_BINARY_DIR}/${baseFilename}.oct")
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
if (CMAKE_CL_64)
# The following line calls the build configuration for x86 VS2010 compiler
# call "\"%VS100COMNTOOLS%../../VC/vcvarsall.bat\"" x86
add_custom_command(
OUTPUT "${octFileName}"
COMMAND call "\"%VS100COMNTOOLS%../../VC/vcvarsall.bat\"" x86
COMMAND ${CMAKE_COMMAND} ARGS -E chdir ${OCTAVE_PATH} ${RESINSIGHT_OCTAVE_PLUGIN_MKOCTFILE_EXE} -I${OCTAVE_QT_QTNETWORK_INCLUDE_DIR}
-I${OCTAVE_QT_QTCORE_INCLUDE_DIR} -I${OCTAVE_QT_INCLUDE_DIR} ${RPATH_COMMAND}
-L${OCTAVE_QT_LIBRARY_DIR} -lQtCore${QT_LIBRARY_POSTFIX} -lQtNetwork${QT_LIBRARY_POSTFIX} -o "${octFileName}" "${srcFileName}"
DEPENDS "${srcFileName}"
COMMENT "===> Generating ${octFileName}"
)
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
if (CMAKE_CL_64 AND RESINSIGHT_OCTAVE_PLUGIN_32_BIT)
# The following line calls the build configuration for x86 VS2010 compiler
# call "\"%VS100COMNTOOLS%../../VC/vcvarsall.bat\"" x86
add_custom_command(
OUTPUT "${octFileName}"
COMMAND call "\"%VS100COMNTOOLS%../../VC/vcvarsall.bat\"" x86
COMMAND ${CMAKE_COMMAND} ARGS -E chdir ${RESINSIGHT_OCTAVE_BIN_DIR} ${RESINSIGHT_OCTAVE_PLUGIN_MKOCTFILE} -I${OCTAVE_QT_QTNETWORK_INCLUDE_DIR}
-I${OCTAVE_QT_QTCORE_INCLUDE_DIR} -I${OCTAVE_QT_INCLUDE_DIR} ${RPATH_COMMAND}
-L${OCTAVE_QT_LIBRARY_DIR} -lQtCore${QT_LIBRARY_POSTFIX} -lQtNetwork${QT_LIBRARY_POSTFIX} -o "${octFileName}" "${srcFileName}"
DEPENDS "${srcFileName}"
COMMENT "===> 32-bit x86 VS2010 : Generating ${octFileName}"
)
else()
add_custom_command(
OUTPUT "${octFileName}"
COMMAND ${CMAKE_COMMAND} ARGS -E chdir ${RESINSIGHT_OCTAVE_BIN_DIR} ${RESINSIGHT_OCTAVE_PLUGIN_MKOCTFILE} -I${OCTAVE_QT_QTNETWORK_INCLUDE_DIR}
-I${OCTAVE_QT_QTCORE_INCLUDE_DIR} -I${OCTAVE_QT_INCLUDE_DIR} ${RPATH_COMMAND}
-L${OCTAVE_QT_LIBRARY_DIR} -lQtCore${QT_LIBRARY_POSTFIX} -lQtNetwork${QT_LIBRARY_POSTFIX} -o "${octFileName}" "${srcFileName}"
DEPENDS "${srcFileName}"
COMMENT "===> Generating ${octFileName}"
)
endif()
else()
add_custom_command(
OUTPUT "${octFileName}"
COMMAND ${CMAKE_COMMAND} ARGS -E chdir ${OCTAVE_PATH} ${RESINSIGHT_OCTAVE_PLUGIN_MKOCTFILE_EXE} -I${OCTAVE_QT_QTNETWORK_INCLUDE_DIR}
-I${OCTAVE_QT_QTCORE_INCLUDE_DIR} -I${OCTAVE_QT_INCLUDE_DIR} ${RPATH_COMMAND}
-L${OCTAVE_QT_LIBRARY_DIR} -lQtCore${QT_LIBRARY_POSTFIX} -lQtNetwork${QT_LIBRARY_POSTFIX} -o "${octFileName}" "${srcFileName}"
COMMAND OCTAVE_HOME=${OCTAVE_HOME} ${RESINSIGHT_OCTAVE_PLUGIN_MKOCTFILE}
-I${OCTAVE_QT_QTNETWORK_INCLUDE_DIR} -I${OCTAVE_QT_QTCORE_INCLUDE_DIR} -I${OCTAVE_QT_INCLUDE_DIR} ${RPATH_COMMAND}
-L${OCTAVE_QT_LIBRARY_DIR} -lQtCore -lQtNetwork -o "${octFileName}" "${srcFileName}"
DEPENDS "${srcFileName}"
COMMENT "Generating ${octFileName}"
COMMENT "===> Generating ${octFileName}"
)
endif()
else()
add_custom_command(
OUTPUT "${octFileName}"
COMMAND ${RESINSIGHT_OCTAVE_PLUGIN_MKOCTFILE_EXE} -I${QT_QTNETWORK_INCLUDE_DIR} -I${QT_QTCORE_INCLUDE_DIR} -I${QT_INCLUDE_DIR} ${RPATH_COMMAND} -L${QT_LIBRARY_DIR} -lQtCore${QT_LIBRARY_POSTFIX} -lQtNetwork${QT_LIBRARY_POSTFIX} -o "${octFileName}" "${srcFileName}"
DEPENDS "${srcFileName}"
COMMENT "Generating ${octFileName}"
)
endif()
list(APPEND OCTAVE_BINARY_OCT_FILES "${octFileName}")
list(APPEND OCTAVE_BINARY_OCT_FILES "${octFileName}")
endforeach()
endforeach()
add_custom_target(octave_plugins ALL DEPENDS
add_custom_target(octave_plugins ALL DEPENDS
"${CMAKE_CURRENT_BINARY_DIR}/riGetActiveCellProperty.oct"
"${CMAKE_CURRENT_BINARY_DIR}/riSetActiveCellProperty.oct"
"${CMAKE_CURRENT_BINARY_DIR}/riGetActiveCellInfo.oct"
@ -131,18 +137,19 @@ else()
"${CMAKE_CURRENT_BINARY_DIR}/riGetActiveCellCorners.oct"
"${CMAKE_CURRENT_BINARY_DIR}/riGetGridProperty.oct"
"${CMAKE_CURRENT_BINARY_DIR}/riSetGridProperty.oct"
"${CMAKE_CURRENT_BINARY_DIR}/riGetPropertyNames.oct"
"${CMAKE_CURRENT_BINARY_DIR}/riGetWellNames.oct"
"${CMAKE_CURRENT_BINARY_DIR}/riGetWellStatus.oct"
"${CMAKE_CURRENT_BINARY_DIR}/riGetWellCells.oct"
"${CMAKE_CURRENT_BINARY_DIR}/riGetPropertyNames.oct"
"${CMAKE_CURRENT_BINARY_DIR}/riGetWellNames.oct"
"${CMAKE_CURRENT_BINARY_DIR}/riGetWellStatus.oct"
"${CMAKE_CURRENT_BINARY_DIR}/riGetWellCells.oct"
SOURCES ${CPP_SOURCES}
)
)
# Copy Octave generated *.oct files to application folder, will make it possible to use Octave functions
# directly from the location of the ResInsight binaries
if (true)
foreach (oct_bin ${OCTAVE_BINARY_OCT_FILES})
get_filename_component(Filename "${oct_bin}" NAME)
if(MSVC)
@ -157,34 +164,35 @@ else()
"${oct_bin}"
"${CMAKE_CURRENT_BINARY_DIR}/../ApplicationCode/${Filename}"
)
endif()
endif()
endforeach( oct_bin )
endif()
# Make ResInsight dependant on Octave, makes it easiser to debug Octave functionality by compiling ResInsight
add_dependencies(ResInsight octave_plugins)
endif()
if (RESINSIGHT_PRIVATE_INSTALL)
install(FILES ${OCTAVE_BINARY_OCT_FILES} DESTINATION ${RESINSIGHT_FINAL_NAME})
else (RESINSIGHT_PRIVATE_INSTALL)
# probe for site location of .oct files
if (NOT OCTAVE_SITE_OCT_DIR)
find_program (OCTAVE_CONFIG_COMMAND
octave-config
DOC "Path to Octave component and library information retrieval"
)
exec_program (${OCTAVE_CONFIG_COMMAND}
ARGS --oct-site-dir
OUTPUT_VARIABLE OCTAVE_SITE_OCT_DIR
)
set (OCTAVE_SITE_OCT_DIR "${OCTAVE_SITE_OCT_DIR}" CACHE LOCATION "Octave plugin directory")
endif (NOT OCTAVE_SITE_OCT_DIR)
if (RESINSIGHT_PRIVATE_INSTALL)
install(FILES ${OCTAVE_BINARY_OCT_FILES} DESTINATION ${RESINSIGHT_FINAL_NAME})
else (RESINSIGHT_PRIVATE_INSTALL)
# probe for site location of .oct files
if (NOT OCTAVE_SITE_OCT_DIR)
find_program (OCTAVE_CONFIG_COMMAND
octave-config
DOC "Path to Octave component and library information retrieval"
)
exec_program (${OCTAVE_CONFIG_COMMAND}
ARGS --oct-site-dir
OUTPUT_VARIABLE OCTAVE_SITE_OCT_DIR
)
set (OCTAVE_SITE_OCT_DIR "${OCTAVE_SITE_OCT_DIR}" CACHE LOCATION "Octave plugin directory")
endif (NOT OCTAVE_SITE_OCT_DIR)
install (FILES ${OCTAVE_BINARY_OCT_FILES}
DESTINATION ${OCTAVE_SITE_OCT_DIR}
)
endif (RESINSIGHT_PRIVATE_INSTALL)
install (FILES ${OCTAVE_BINARY_OCT_FILES}
DESTINATION ${OCTAVE_SITE_OCT_DIR}
)
endif (RESINSIGHT_PRIVATE_INSTALL)
endif (RESINSIGHT_OCTAVE_PLUGIN_QMAKE AND RESINSIGHT_OCTAVE_PLUGIN_MKOCTFILE)

46
README
View File

@ -1,46 +0,0 @@
This is the README file for ResInsight.
ResInsight is a 3D viewer and post processing tool for reservoir models. It has been co-developed by Statoil and Ceetron AS / Ceetron Solutions AS with the aim to provide a versatile tool for professionals who need to visualize and process reservoir models. The software is copyrighted by Ceetron and Statoil and licensed under GPL 3+. See COPYING for details.
DEPENDENCIES
ResInsight uses the Ensambles/ert library to access eclipse result files, and the two projects collaborates closely. The source code of the approved ert library version is embedded in the ResInsight source code tree, making downloading and building simple.
ResInsight also features an interface to Octave, making it possible to retrieve data from ResInsight, process them using Octave, and write them back into ResInsight for viewing. If you want to build ResInsight with this feature, you need to install Octave.
http://www.gnu.org/software/octave/
https://github.com/Ensembles/ert
ON WHAT PLATFORMS DOES IT RUN?
ResInsight is designed cross-platform from the start. Efforts have been made to ensure that code will compile and run on linux and windows platforms, but the tested platforms are currently 64 bit RHE 5, RHE 6 and Windows 7.
There has been attemts to make ResInsight build and run on OSX as well, but the tweaks needed (submitted by Roland Kaufmann) is not yet incorporated.
DOCUMENTATION
No efforts to provide documentation has been made yet.
DOWNLOADING RESINSIGHT
git clone git://github.com/OPM/ResInsight.git
CONTRIBUTION
Contributions are very welcome, although it might take some time for the team to accept pull requests that is not in the main line of the projects focus. Please use the dev branch for contributions and pull requests, as it is the branch dedicated to the day to day development. The master branch is used as a branch for distributing the latest stable release.
Release branches that might pop up are dedicated bug fix branches for the release in question.
BUILDING RESINSIGHT - Linux
ResInsight uses the cmake build system and requires cmake version 2.8 or higher. Moreover, you need version 4.7.3 of Qt or newer, look below for dependecy list. An out-of-tree build is typically done with
mkdir ResInsight/build
cd ResInsight/build
cmake ..
make
make install
You will find the ResInsight binary under the Install directory in your build directory.
BUILDING RESINSIGHT - Windows
Open the CMake GUI.
Set the path to the source code: <ResInsight-sourcecode-folder>
Set the path to the build directory: <ResInsight-build-folder>
Click "Configure" and select your preferred compiler, "Visual Studio 10" or "Visual Studio 10 Win64"
Set the build variables and click "Configure" again.
Click "Generate", and a project file will be created in the build directory <ResInsight-build-folder>
DEPENDENCIES FOR DEBIAN BASED DISTRIBUTIONS
sudo apt-get install git cmake build-essential octave octave-headers qt4-dev-tools
If you are running Ubuntu 12.10 or newer, you will need to replace octave-headers with liboctave-dev in the line above.

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