#1440 Merge dev into pre-proto (WellPath viz restructure and constness)

Had to do quite a bit constness fiddeling to make the merge work
This commit is contained in:
Jacob Støren 2017-06-22 10:42:07 +02:00
commit 33b037a80b
50 changed files with 650 additions and 510 deletions

View File

@ -46,11 +46,11 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdatValuesForWellPath(const RimWellPath* wellPath,
std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdatValuesForWellPath(RimWellPath* wellPath,
const RicExportCompletionDataSettingsUi& settings,
QTextStream* outputStreamForIntermediateResultsText)
{
const RimEclipseCase* caseToApply = settings.caseToApply();
RimEclipseCase* caseToApply = settings.caseToApply();
std::vector<RimFracture*> fracturesAlongWellPath;
wellPath->descendantsIncludingThisOfType(fracturesAlongWellPath);
@ -65,7 +65,7 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdatValuesForSimWell(const RimEclipseCase* eclipseCase,
std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdatValuesForSimWell(RimEclipseCase* eclipseCase,
const RimEclipseWell* well,
size_t timeStep,
QTextStream* outputStreamForIntermediateResultsText)
@ -103,7 +103,7 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdatValues(const RimEclipseCase* caseToApply,
std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdatValues(RimEclipseCase* caseToApply,
const QString& wellPathName,
const RigWellPath* wellPathGeometry,
const std::vector<RimFracture*> fractures,

View File

@ -31,17 +31,17 @@ class RimFracture;
class RicExportFractureCompletionsImpl
{
public:
static std::vector<RigCompletionData> generateCompdatValuesForWellPath(const RimWellPath* wellPath,
static std::vector<RigCompletionData> generateCompdatValuesForWellPath(RimWellPath* wellPath,
const RicExportCompletionDataSettingsUi& settings,
QTextStream* outputStreamForIntermediateResultsText);
static std::vector<RigCompletionData> generateCompdatValuesForSimWell(const RimEclipseCase* eclipseCase,
static std::vector<RigCompletionData> generateCompdatValuesForSimWell(RimEclipseCase* eclipseCase,
const RimEclipseWell* well,
size_t timeStep,
QTextStream* outputStreamForIntermediateResultsText);
private:
static std::vector<RigCompletionData> generateCompdatValues(const RimEclipseCase* caseToApply,
static std::vector<RigCompletionData> generateCompdatValues(RimEclipseCase* caseToApply,
const QString& wellPathName,
const RigWellPath* wellPathGeometry,
const std::vector<RimFracture*> fractures,

View File

@ -171,8 +171,7 @@ void RicNewFishbonesSubsFeature::askUserToSetUsefulScaling(RimFishbonesCollectio
if (autoAdjustSettings)
{
activeView->setScaleZAndUpdate(1.0);
wellPathColl->scheduleGeometryRegenAndRedrawViews();
activeView->scheduleCreateDisplayModelAndRedraw();
RiuMainWindow::instance()->updateScaleValue();
}

View File

@ -60,7 +60,7 @@ void RicNewPerforationIntervalAtMeasuredDepthFeature::onActionTriggered(bool isC
wellPath->firstAncestorOrThisOfTypeAsserted(wellPathCollection);
wellPathCollection->uiCapability()->updateConnectedEditors();
wellPathCollection->scheduleGeometryRegenAndRedrawViews();
wellPathCollection->scheduleRedrawAffectedViews();
RiuMainWindow::instance()->selectAsCurrentItem(perforationInterval);
}

View File

@ -64,7 +64,7 @@ void RicNewPerforationIntervalFeature::onActionTriggered(bool isChecked)
if (!wellPathCollection) return;
wellPathCollection->uiCapability()->updateConnectedEditors();
wellPathCollection->scheduleGeometryRegenAndRedrawViews();
wellPathCollection->scheduleRedrawAffectedViews();
RiuMainWindow::instance()->selectAsCurrentItem(perforationInterval);
}

View File

@ -157,7 +157,7 @@ void RicDeleteItemExec::redo()
if (wellPathColl)
{
wellPathColl->scheduleGeometryRegenAndRedrawViews();
wellPathColl->scheduleRedrawAffectedViews();
wellPathColl->uiCapability()->updateConnectedEditors();
}

View File

@ -77,7 +77,7 @@ void RicDeleteSubItemsFeature::onActionTriggered(bool isChecked)
wellPathColl->deleteAllWellPaths();
wellPathColl->updateConnectedEditors();
wellPathColl->scheduleGeometryRegenAndRedrawViews();
wellPathColl->scheduleRedrawAffectedViews();
}
}
}

View File

@ -146,7 +146,7 @@ void RicSnapshotViewToFileFeature::onActionTriggered(bool isChecked)
startPath += "/image.png";
QString fileName = QFileDialog::getSaveFileName(NULL, tr("Export to File"), startPath, tr("Image files (*.bmp *.png * *.jpg)"));
QString fileName = QFileDialog::getSaveFileName(NULL, tr("Export to File"), startPath);
if (fileName.isEmpty())
{
return;

View File

@ -67,7 +67,7 @@ void RicWellPathFracturesDeleteAllFeature::onActionTriggered(bool isChecked)
RimWellPathCollection* wellPathColl = nullptr;
fractureCollection->firstAncestorOrThisOfType(wellPathColl);
if (wellPathColl) wellPathColl->scheduleGeometryRegenAndRedrawViews();
if (wellPathColl) wellPathColl->scheduleRedrawAffectedViews();
}
}

View File

@ -67,7 +67,7 @@ void RicWellPathDeleteFeature::onActionTriggered(bool isChecked)
}
wellPathCollection->uiCapability()->updateConnectedEditors();
wellPathCollection->scheduleGeometryRegenAndRedrawViews();
wellPathCollection->scheduleRedrawAffectedViews();
}
//--------------------------------------------------------------------------------------------------

View File

@ -283,7 +283,7 @@ cvf::Vec3f RigFemPart::faceNormal(int elmIdx, int faceIdx) const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
float RigFemPart::characteristicElementSize()
float RigFemPart::characteristicElementSize() const
{
if (m_characteristicElementSize != std::numeric_limits<float>::infinity()) return m_characteristicElementSize;

View File

@ -78,7 +78,7 @@ public:
{ return m_elmNeighbors[elementIndex].faceInNeighborElm[faceIndex]; }
cvf::BoundingBox boundingBox() const;
float characteristicElementSize();
float characteristicElementSize() const;
const std::vector<int>& possibleGridCornerElements() const { return m_possibleGridCornerElements; }
void findIntersectingCells(const cvf::BoundingBox& inputBB, std::vector<size_t>* elementIndices) const;
@ -106,7 +106,7 @@ private:
std::vector< Neighbors > m_elmNeighbors;
std::vector<int> m_possibleGridCornerElements;
float m_characteristicElementSize;
mutable float m_characteristicElementSize;
mutable cvf::BoundingBox m_boundingBox;
mutable cvf::ref<cvf::BoundingBoxTree> m_elementSearchTree;

View File

@ -88,7 +88,7 @@ size_t RigFemPartCollection::totalElementCount() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
float RigFemPartCollection::characteristicElementSize()
float RigFemPartCollection::characteristicElementSize() const
{
if (partCount())
{

View File

@ -36,7 +36,7 @@ public:
int partCount() const;
size_t totalElementCount() const;
float characteristicElementSize();
float characteristicElementSize() const;
cvf::BoundingBox boundingBox() const;

View File

@ -1840,7 +1840,7 @@ std::vector< RigFemResultAddress> RigFemPartResultsCollection::getResAddrToCompo
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<std::string> RigFemPartResultsCollection::stepNames()
std::vector<std::string> RigFemPartResultsCollection::stepNames() const
{
CVF_ASSERT(m_readerInterface.notNull());
return m_readerInterface->stepNames();

View File

@ -51,7 +51,7 @@ public:
double parameterFrictionAngleRad() const { return m_frictionAngleRad; }
std::map<std::string, std::vector<std::string> > scalarFieldAndComponentNames(RigFemResultPosEnum resPos);
std::vector<std::string> stepNames();
std::vector<std::string> stepNames() const;
bool assertResultsLoaded(const RigFemResultAddress& resVarAddr);
void deleteResult(const RigFemResultAddress& resVarAddr);

View File

@ -44,8 +44,8 @@ public:
virtual bool openFile(const std::string& fileName, std::string* errorMessage) = 0;
virtual bool readFemParts(RigFemPartCollection* geoMechCase) = 0;
virtual std::vector<std::string> stepNames() = 0;
virtual std::vector<double> frameTimes(int stepIndex) = 0;
virtual std::vector<std::string> stepNames() const = 0;
virtual std::vector<double> frameTimes(int stepIndex) const = 0;
virtual std::vector<std::string> elementSetNames(int partIndex) = 0;
virtual std::vector<size_t> elementSet(int partIndex, int setIndex) = 0;

View File

@ -422,7 +422,7 @@ bool RifOdbReader::readFemParts(RigFemPartCollection* femParts)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<std::string> RifOdbReader::stepNames()
std::vector<std::string> RifOdbReader::stepNames() const
{
CVF_ASSERT(m_odb != NULL);
@ -442,7 +442,7 @@ std::vector<std::string> RifOdbReader::stepNames()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RifOdbReader::frameTimes(int stepIndex)
std::vector<double> RifOdbReader::frameTimes(int stepIndex) const
{
CVF_ASSERT(m_odb != NULL);

View File

@ -44,8 +44,8 @@ public:
virtual bool openFile(const std::string& fileName, std::string* errorMessage);
virtual bool readFemParts(RigFemPartCollection* geoMechCase);
virtual std::vector<std::string> stepNames();
virtual std::vector<double> frameTimes(int stepIndex);
virtual std::vector<std::string> stepNames() const override;
virtual std::vector<double> frameTimes(int stepIndex) const override;
virtual std::vector<std::string> elementSetNames(int partIndex);
virtual std::vector<size_t> elementSet(int partIndex, int setIndex);

View File

@ -19,7 +19,6 @@ ${CEE_CURRENT_LIST_DIR}RivReservoirSimWellsPartMgr.h
${CEE_CURRENT_LIST_DIR}RivSourceInfo.h
${CEE_CURRENT_LIST_DIR}RivWellPathSourceInfo.h
${CEE_CURRENT_LIST_DIR}RivWellPathPartMgr.h
${CEE_CURRENT_LIST_DIR}RivWellPathCollectionPartMgr.h
${CEE_CURRENT_LIST_DIR}RivSimWellPipesPartMgr.h
${CEE_CURRENT_LIST_DIR}RivWellHeadPartMgr.h
${CEE_CURRENT_LIST_DIR}RivResultToTextureMapper.h
@ -60,7 +59,6 @@ ${CEE_CURRENT_LIST_DIR}RivReservoirSimWellsPartMgr.cpp
${CEE_CURRENT_LIST_DIR}RivSourceInfo.cpp
${CEE_CURRENT_LIST_DIR}RivWellPathSourceInfo.cpp
${CEE_CURRENT_LIST_DIR}RivWellPathPartMgr.cpp
${CEE_CURRENT_LIST_DIR}RivWellPathCollectionPartMgr.cpp
${CEE_CURRENT_LIST_DIR}RivSimWellPipesPartMgr.cpp
${CEE_CURRENT_LIST_DIR}RivWellHeadPartMgr.cpp
${CEE_CURRENT_LIST_DIR}RivTextureCoordsCreator.cpp

View File

@ -54,7 +54,7 @@ RivFishbonesSubsPartMgr::~RivFishbonesSubsPartMgr()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivFishbonesSubsPartMgr::appendGeometryPartsToModel(cvf::ModelBasicList* model, caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize)
void RivFishbonesSubsPartMgr::appendGeometryPartsToModel(cvf::ModelBasicList* model, const caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize)
{
clearGeometryCache();
@ -82,7 +82,7 @@ void RivFishbonesSubsPartMgr::clearGeometryCache()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivFishbonesSubsPartMgr::buildParts(caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize)
void RivFishbonesSubsPartMgr::buildParts(const caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize)
{
RimWellPath* wellPath = nullptr;
m_rimFishbonesSubs->firstAncestorOrThisOfTypeAsserted(wellPath);

View File

@ -53,11 +53,11 @@ public:
RivFishbonesSubsPartMgr(RimFishbonesMultipleSubs* subs);
~RivFishbonesSubsPartMgr();
void appendGeometryPartsToModel(cvf::ModelBasicList* model, caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize);
void appendGeometryPartsToModel(cvf::ModelBasicList* model, const caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize);
void clearGeometryCache();
private:
void buildParts(caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize);
void buildParts(const caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize);
private:

View File

@ -66,7 +66,7 @@ RivWellFracturePartMgr::~RivWellFracturePartMgr()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivWellFracturePartMgr::updatePartGeometry(caf::DisplayCoordTransform* displayCoordTransform)
void RivWellFracturePartMgr::updatePartGeometry(const caf::DisplayCoordTransform* displayCoordTransform)
{
if (m_part.notNull()) return;
if (!displayCoordTransform) return;
@ -116,7 +116,7 @@ void RivWellFracturePartMgr::updatePartGeometry(caf::DisplayCoordTransform* disp
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivWellFracturePartMgr::updatePartGeometryTexture(caf::DisplayCoordTransform* displayCoordTransform)
void RivWellFracturePartMgr::updatePartGeometryTexture(const caf::DisplayCoordTransform* displayCoordTransform)
{
if (m_part.notNull()) return;
if (!displayCoordTransform) return;
@ -231,7 +231,7 @@ void RivWellFracturePartMgr::updatePartGeometryTexture(caf::DisplayCoordTransfor
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivWellFracturePartMgr::generateFractureOutlinePolygonPart(caf::DisplayCoordTransform* displayCoordTransform)
void RivWellFracturePartMgr::generateFractureOutlinePolygonPart(const caf::DisplayCoordTransform* displayCoordTransform)
{
m_polygonPart = nullptr;
@ -256,7 +256,7 @@ void RivWellFracturePartMgr::generateFractureOutlinePolygonPart(caf::DisplayCoor
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivWellFracturePartMgr::generateStimPlanMeshPart(caf::DisplayCoordTransform* displayCoordTransform)
void RivWellFracturePartMgr::generateStimPlanMeshPart(const caf::DisplayCoordTransform* displayCoordTransform)
{
m_stimPlanMeshPart = nullptr;
@ -285,7 +285,7 @@ void RivWellFracturePartMgr::generateStimPlanMeshPart(caf::DisplayCoordTransform
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::ref<cvf::DrawableGeo> RivWellFracturePartMgr::createStimPlanMeshDrawable(RimStimPlanFractureTemplate* stimPlanFracTemplate, caf::DisplayCoordTransform* displayCoordTransform)
cvf::ref<cvf::DrawableGeo> RivWellFracturePartMgr::createStimPlanMeshDrawable(RimStimPlanFractureTemplate* stimPlanFracTemplate, const caf::DisplayCoordTransform* displayCoordTransform)
{
//TODO: This is needed to avoid errors when loading project with stimPlan fractures with multipled timesteps.
//Should probably be moved, since it now is called twice in some cases...
@ -356,7 +356,7 @@ void RivWellFracturePartMgr::getPolygonBB(float &polygonXmin, float &polygonXmax
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::ref<cvf::DrawableGeo> RivWellFracturePartMgr::createPolygonDrawable(caf::DisplayCoordTransform* displayCoordTransform)
cvf::ref<cvf::DrawableGeo> RivWellFracturePartMgr::createPolygonDrawable(const caf::DisplayCoordTransform* displayCoordTransform)
{
std::vector<cvf::uint> lineIndices;
std::vector<cvf::Vec3f> vertices;
@ -398,7 +398,7 @@ cvf::ref<cvf::DrawableGeo> RivWellFracturePartMgr::createPolygonDrawable(caf::Di
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<cvf::Vec3f> RivWellFracturePartMgr::transfromToFractureDisplayCoords(std::vector<cvf::Vec3f> coordinatesVector, cvf::Mat4f m, caf::DisplayCoordTransform* displayCoordTransform)
std::vector<cvf::Vec3f> RivWellFracturePartMgr::transfromToFractureDisplayCoords(std::vector<cvf::Vec3f> coordinatesVector, cvf::Mat4f m, const caf::DisplayCoordTransform* displayCoordTransform)
{
std::vector<cvf::Vec3f> polygonInDisplayCoords;
for (cvf::Vec3f v : coordinatesVector)
@ -432,7 +432,7 @@ std::vector<double> RivWellFracturePartMgr::mirrorDataAtSingleDepth(std::vector<
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivWellFracturePartMgr::appendGeometryPartsToModel(cvf::ModelBasicList* model, caf::DisplayCoordTransform* displayCoordTransform)
void RivWellFracturePartMgr::appendGeometryPartsToModel(cvf::ModelBasicList* model, const caf::DisplayCoordTransform* displayCoordTransform)
{
clearGeometryCache();

View File

@ -51,24 +51,24 @@ public:
RivWellFracturePartMgr(RimFracture* well);
~RivWellFracturePartMgr();
void appendGeometryPartsToModel(cvf::ModelBasicList* model, caf::DisplayCoordTransform* displayCoordTransform);
void appendGeometryPartsToModel(cvf::ModelBasicList* model, const caf::DisplayCoordTransform* displayCoordTransform);
void clearGeometryCache();
static std::vector<double> mirrorDataAtSingleDepth(std::vector<double> depthData);
private:
void updatePartGeometry(caf::DisplayCoordTransform* displayCoordTransform);
void updatePartGeometryTexture(caf::DisplayCoordTransform* displayCoordTransform);
void updatePartGeometry(const caf::DisplayCoordTransform* displayCoordTransform);
void updatePartGeometryTexture(const caf::DisplayCoordTransform* displayCoordTransform);
void generateFractureOutlinePolygonPart(caf::DisplayCoordTransform* displayCoordTransform);
void generateStimPlanMeshPart(caf::DisplayCoordTransform* displayCoordTransform);
void generateFractureOutlinePolygonPart(const caf::DisplayCoordTransform* displayCoordTransform);
void generateStimPlanMeshPart(const caf::DisplayCoordTransform* displayCoordTransform);
cvf::ref<cvf::DrawableGeo> createPolygonDrawable(caf::DisplayCoordTransform* displayCoordTransform);
cvf::ref<cvf::DrawableGeo> createStimPlanMeshDrawable(RimStimPlanFractureTemplate* stimPlanFracTemplate, caf::DisplayCoordTransform* displayCoordTransform);
cvf::ref<cvf::DrawableGeo> createPolygonDrawable(const caf::DisplayCoordTransform* displayCoordTransform);
cvf::ref<cvf::DrawableGeo> createStimPlanMeshDrawable(RimStimPlanFractureTemplate* stimPlanFracTemplate, const caf::DisplayCoordTransform* displayCoordTransform);
void getPolygonBB(float &polygonXmin, float &polygonXmax, float &polygonYmin, float &polygonYmax);
std::vector<cvf::Vec3f> transfromToFractureDisplayCoords(std::vector<cvf::Vec3f> polygon, cvf::Mat4f m, caf::DisplayCoordTransform* displayCoordTransform);
std::vector<cvf::Vec3f> transfromToFractureDisplayCoords(std::vector<cvf::Vec3f> polygon, cvf::Mat4f m, const caf::DisplayCoordTransform* displayCoordTransform);
bool stimPlanCellTouchesPolygon(const std::vector<cvf::Vec3f>& polygon, double xMin, double xMax, double yMin, double yMax, float polygonXmin, float polygonXmax, float polygonYmin, float polygonYmax);
static cvf::ref<cvf::DrawableGeo> createGeo(const std::vector<cvf::uint>& triangleIndices, const std::vector<cvf::Vec3f>& nodeCoords);

View File

@ -1,86 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2011- Statoil ASA
// Copyright (C) 2013- Ceetron Solutions AS
// Copyright (C) 2011-2012 Ceetron AS
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RivWellPathCollectionPartMgr.h"
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "RivWellPathPartMgr.h"
#include "cafDisplayCoordTransform.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivWellPathCollectionPartMgr::RivWellPathCollectionPartMgr(RimWellPathCollection* wellPathCollection)
{
m_wellPathCollection = wellPathCollection;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivWellPathCollectionPartMgr::~RivWellPathCollectionPartMgr()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivWellPathCollectionPartMgr::scheduleGeometryRegen()
{
for (size_t wIdx = 0; wIdx < m_wellPathCollection->wellPaths.size(); wIdx++)
{
m_wellPathCollection->wellPaths[wIdx]->partMgr()->scheduleGeometryRegen();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivWellPathCollectionPartMgr::setScaleTransform(cvf::Transform * scaleTransform)
{
for (size_t wIdx = 0; wIdx < m_wellPathCollection->wellPaths.size(); wIdx++)
{
m_wellPathCollection->wellPaths[wIdx]->partMgr()->setScaleTransform(scaleTransform);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivWellPathCollectionPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* model, cvf::Vec3d displayModelOffset,
cvf::Transform* scaleTransform, double characteristicCellSize, cvf::BoundingBox wellPathClipBoundingBox,
caf::DisplayCoordTransform* displayCoordTransform)
{
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++)
{
RivWellPathPartMgr* partMgr = m_wellPathCollection->wellPaths[wIdx]->partMgr();
partMgr->setScaleTransform(scaleTransform);
partMgr->appendStaticGeometryPartsToModel(model, displayModelOffset, characteristicCellSize, wellPathClipBoundingBox, displayCoordTransform);
}
}

View File

@ -1,67 +0,0 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2011- Statoil ASA
// Copyright (C) 2013- Ceetron Solutions AS
// Copyright (C) 2011-2012 Ceetron AS
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cvfBase.h"
#include "cvfCollection.h"
#include "cafPdmPointer.h"
#include "cvfVector3.h"
#include "cvfBoundingBox.h"
#include "cvfTransform.h"
#include "cafPdmPointer.h"
class RimWellPathCollection;
class RimProject;
class RivWellPathPartMgr;
namespace cvf
{
class ModelBasicList;
}
namespace caf
{
class DisplayCoordTransform;
}
class RivWellPathCollectionPartMgr : public cvf::Object
{
public:
explicit RivWellPathCollectionPartMgr(RimWellPathCollection* wellPathCollection);
~RivWellPathCollectionPartMgr();
void scheduleGeometryRegen();
void setScaleTransform(cvf::Transform * scaleTransform);
void appendStaticGeometryPartsToModel(
cvf::ModelBasicList* model,
cvf::Vec3d displayModelOffset,
cvf::Transform* scaleTransform,
double characteristicCellSize,
cvf::BoundingBox wellPathClipBoundingBox,
caf::DisplayCoordTransform* displayCoordTransform);
private:
caf::PdmPointer<RimWellPathCollection> m_wellPathCollection;
};

View File

@ -19,35 +19,37 @@
/////////////////////////////////////////////////////////////////////////////////
#include "RivWellPathPartMgr.h"
#include "RiaApplication.h"
#include "RigMainGrid.h"
#include "RigWellPath.h"
#include "RimFracture.h"
#include "RimEclipseCase.h"
#include "RimEclipseView.h"
#include "RimFishboneWellPath.h"
#include "RimFishboneWellPathCollection.h"
#include "RimFishbonesCollection.h"
#include "RimFishbonesMultipleSubs.h"
#include "RimPerforationCollection.h"
#include "RimPerforationInterval.h"
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "RimWellPathFracture.h"
#include "RimWellPathFractureCollection.h"
#include "RimFishboneWellPath.h"
#include "RimFishbonesCollection.h"
#include "RimFishboneWellPathCollection.h"
#include "RimPerforationInterval.h"
#include "RimPerforationCollection.h"
#include "RivFishbonesSubsPartMgr.h"
#include "RivObjectSourceInfo.h"
#include "RivPartPriority.h"
#include "RivPipeGeometryGenerator.h"
#include "RivPartPriority.h"
#include "RivWellFracturePartMgr.h"
#include "RivWellPathPartMgr.h"
#include "RivWellPathSourceInfo.h"
#include "RivObjectSourceInfo.h"
#include "cafDisplayCoordTransform.h"
#include "cafEffectGenerator.h"
#include "cafDisplayCoordTransform.h"
#include "cvfDrawableGeo.h"
#include "cvfDrawableText.h"
#include "cvfFont.h"
@ -56,6 +58,7 @@
#include "cvfScalarMapperDiscreteLinear.h"
#include "cvfTransform.h"
#include "cvfqtUtils.h"
#include "RimWellPathFracture.h"
//--------------------------------------------------------------------------------------------------
@ -63,9 +66,7 @@
//--------------------------------------------------------------------------------------------------
RivWellPathPartMgr::RivWellPathPartMgr(RimWellPath* wellPath)
{
m_rimWellPath = wellPath;
m_needsTransformUpdate = true;
m_rimWellPath = wellPath;
// Setup a scalar mapper
cvf::ref<cvf::ScalarMapperDiscreteLinear> scalarMapper = new cvf::ScalarMapperDiscreteLinear;
@ -99,7 +100,7 @@ RivWellPathPartMgr::~RivWellPathPartMgr()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivWellPathPartMgr::appendFracturePartsToModel(cvf::ModelBasicList* model, caf::DisplayCoordTransform* displayCoordTransform)
void RivWellPathPartMgr::appendFracturePartsToModel(cvf::ModelBasicList* model, const caf::DisplayCoordTransform* displayCoordTransform)
{
if (!m_rimWellPath || !m_rimWellPath->fractureCollection()->isChecked()) return;
@ -114,32 +115,21 @@ void RivWellPathPartMgr::appendFracturePartsToModel(cvf::ModelBasicList* model,
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivWellPathPartMgr::appendFishbonesPartsToModel(cvf::ModelBasicList* model, caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize)
void RivWellPathPartMgr::appendFishbonesPartsToModel(cvf::ModelBasicList* model, const caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize)
{
if (!m_rimWellPath || !m_rimWellPath->fishbonesCollection()->isChecked()) return;
if ( !m_rimWellPath || !m_rimWellPath->fishbonesCollection()->isChecked() ) return;
// This concept is taken from RivReservoirSimWellsPartMgr, and is required to be able to have
// separate part managers for each view
if (m_fishbonesPartMgrs.size() != m_rimWellPath->fishbonesCollection()->fishbonesSubs.size())
for ( auto rimFishboneSubs : m_rimWellPath->fishbonesCollection()->fishbonesSubs() )
{
m_fishbonesPartMgrs.clear();
for (auto rimFishboneSubs : m_rimWellPath->fishbonesCollection()->fishbonesSubs())
{
m_fishbonesPartMgrs.push_back(new RivFishbonesSubsPartMgr(rimFishboneSubs));
}
}
for (auto rivFishbonesPartManager : m_fishbonesPartMgrs)
{
rivFishbonesPartManager->appendGeometryPartsToModel(model, displayCoordTransform, characteristicCellSize);
cvf::ref<RivFishbonesSubsPartMgr> fishbSubPartMgr = new RivFishbonesSubsPartMgr(rimFishboneSubs);
fishbSubPartMgr->appendGeometryPartsToModel(model, displayCoordTransform, characteristicCellSize);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivWellPathPartMgr::appendCompletionsToModel(cvf::ModelBasicList* model, caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize)
void RivWellPathPartMgr::appendCompletionsToModel(cvf::ModelBasicList* model, const caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize)
{
if (!m_rimWellPath || !m_rimWellPath->fishbonesCollection()->wellPathCollection()->isChecked()) return;
@ -166,13 +156,12 @@ void RivWellPathPartMgr::appendCompletionsToModel(cvf::ModelBasicList* model, ca
model->addPart(part.p());
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivWellPathPartMgr::appendPerforationsToModel(cvf::ModelBasicList* model, caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize)
void RivWellPathPartMgr::appendPerforationsToModel(const QDateTime& currentViewDate, cvf::ModelBasicList* model, const caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize)
{
if (!m_rimWellPath || !m_rimWellPath->perforationIntervalCollection()->isChecked()) return;
@ -196,6 +185,8 @@ void RivWellPathPartMgr::appendPerforationsToModel(cvf::ModelBasicList* model, c
if (!perforation->isChecked()) continue;
if (perforation->startMD() > perforation->endMD()) continue;
if (currentViewDate.isValid() && !perforation->isActiveOnDate(currentViewDate)) continue;
std::vector<cvf::Vec3d> displayCoords;
displayCoords.push_back(displayCoordTransform->transformToDisplayCoord(wellPathGeometry->interpolatedPointAlongWellPath(perforation->startMD())));
for (size_t i = 0; i < wellPathGeometry->m_measuredDepths.size(); ++i)
@ -225,8 +216,9 @@ void RivWellPathPartMgr::appendPerforationsToModel(cvf::ModelBasicList* model, c
//--------------------------------------------------------------------------------------------------
/// The pipe geometry needs to be rebuilt on scale change to keep the pipes round
//--------------------------------------------------------------------------------------------------
void RivWellPathPartMgr::buildWellPathParts(cvf::Vec3d displayModelOffset, double characteristicCellSize,
cvf::BoundingBox wellPathClipBoundingBox)
void RivWellPathPartMgr::buildWellPathParts(const caf::DisplayCoordTransform* displayCoordTransform,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox)
{
RimWellPathCollection* wellPathCollection = this->wellPathCollection();
if (!wellPathCollection) return;
@ -239,7 +231,7 @@ void RivWellPathPartMgr::buildWellPathParts(cvf::Vec3d displayModelOffset, doubl
clearAllBranchData();
double wellPathRadius = this->wellPathRadius(characteristicCellSize, wellPathCollection);
cvf::Vec3d textPosition = wellPathGeometry->m_wellPathPoints[0];
cvf::Vec3d textPosition;
// Generate the well path geometry as a line and pipe structure
{
@ -279,7 +271,6 @@ void RivWellPathPartMgr::buildWellPathParts(cvf::Vec3d displayModelOffset, doubl
if (clippedPoints.size() < 2) return;
textPosition = clippedPoints[0];
cvfCoords->assign(clippedPoints);
}
else
@ -290,12 +281,11 @@ void RivWellPathPartMgr::buildWellPathParts(cvf::Vec3d displayModelOffset, doubl
// Scale the centerline coordinates using the Z-scale transform of the grid and correct for the display offset.
for (size_t cIdx = 0; cIdx < cvfCoords->size(); ++cIdx)
{
cvf::Vec4d transfCoord = m_scaleTransform->worldTransform() * cvf::Vec4d((*cvfCoords)[cIdx] - displayModelOffset, 1);
(*cvfCoords)[cIdx][0] = transfCoord[0];
(*cvfCoords)[cIdx][1] = transfCoord[1];
(*cvfCoords)[cIdx][2] = transfCoord[2];
(*cvfCoords)[cIdx] = displayCoordTransform->transformToDisplayCoord((*cvfCoords)[cIdx]);
}
textPosition = cvfCoords->get(0);
pbd.m_pipeGeomGenerator->setPipeCenterCoords(cvfCoords.p());
pbd.m_surfaceDrawable = pbd.m_pipeGeomGenerator->createPipeSurface();
pbd.m_centerLineDrawable = pbd.m_pipeGeomGenerator->createCenterLine();
@ -328,10 +318,7 @@ void RivWellPathPartMgr::buildWellPathParts(cvf::Vec3d displayModelOffset, doubl
// Generate label with well-path name
textPosition -= displayModelOffset;
textPosition.transformPoint(m_scaleTransform->worldTransform());
textPosition.z() += characteristicCellSize; // * m_rimReservoirView->wellCollection()->wellHeadScaleFactor();
textPosition.z() += 1.2 * characteristicCellSize;
textPosition.z() += 2.2 * characteristicCellSize;
m_wellLabelPart = NULL;
if (wellPathCollection->showWellPathLabel() && m_rimWellPath->showWellPathLabel() && !m_rimWellPath->name().isEmpty())
@ -363,16 +350,16 @@ void RivWellPathPartMgr::buildWellPathParts(cvf::Vec3d displayModelOffset, doubl
m_wellLabelPart = part;
}
m_needsTransformUpdate = false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* model, cvf::Vec3d displayModelOffset,
double characteristicCellSize, cvf::BoundingBox wellPathClipBoundingBox,
caf::DisplayCoordTransform* displayCoordTransform)
void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* model,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform)
{
RimWellPathCollection* wellPathCollection = this->wellPathCollection();
if (!wellPathCollection) return;
@ -383,18 +370,15 @@ void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* m
if (wellPathCollection->wellPathVisibility() != RimWellPathCollection::FORCE_ALL_ON && m_rimWellPath->showWellPath() == false )
return;
if (m_needsTransformUpdate)
{
// The pipe geometry needs to be rebuilt on scale change to keep the pipes round
buildWellPathParts(displayModelOffset, characteristicCellSize, wellPathClipBoundingBox);
// The pipe geometry needs to be rebuilt on scale change to keep the pipes round
buildWellPathParts(displayCoordTransform, characteristicCellSize, wellPathClipBoundingBox);
for (RimWellPathFracture* f : m_rimWellPath->fractureCollection()->fractures())
{
// Always recompute geometry, as the well part can be displayed in more than one view
f->fracturePartManager()->clearGeometryCache();
}
for (RimWellPathFracture* f : m_rimWellPath->fractureCollection()->fractures())
{
// Always recompute geometry, as the well part can be displayed in more than one view
f->fracturePartManager()->clearGeometryCache();
}
if (m_pipeBranchData.m_surfacePart.notNull())
{
model->addPart(m_pipeBranchData.m_surfacePart.p());
@ -414,29 +398,31 @@ void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* m
appendFishbonesPartsToModel(model, displayCoordTransform, characteristicCellSize);
appendCompletionsToModel(model, displayCoordTransform, characteristicCellSize);
appendPerforationsToModel(model, displayCoordTransform, characteristicCellSize);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivWellPathPartMgr::setScaleTransform( cvf::Transform * scaleTransform )
void RivWellPathPartMgr::appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model,
const QDateTime& timeStamp,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform)
{
if (m_scaleTransform.isNull() || m_scaleTransform.p() != scaleTransform)
{
m_scaleTransform = scaleTransform;
scheduleGeometryRegen();
}
}
CVF_ASSERT(model);
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivWellPathPartMgr::scheduleGeometryRegen()
{
m_needsTransformUpdate = true;
RimWellPathCollection* wellPathCollection = this->wellPathCollection();
if (!wellPathCollection) return;
m_fishbonesPartMgrs.clear();
if (m_rimWellPath.isNull()) return;
if (wellPathCollection->wellPathVisibility() == RimWellPathCollection::FORCE_ALL_OFF)
return;
if (wellPathCollection->wellPathVisibility() != RimWellPathCollection::FORCE_ALL_ON && m_rimWellPath->showWellPath() == false)
return;
appendPerforationsToModel(timeStamp, model, displayCoordTransform, characteristicCellSize);
}
//--------------------------------------------------------------------------------------------------

View File

@ -45,39 +45,55 @@ class RimWellPath;
class RivFishbonesSubsPartMgr;
class RimWellPathCollection;
class QDateTime;
class RivWellPathPartMgr : public cvf::Object
{
public:
explicit RivWellPathPartMgr(RimWellPath* wellPath);
~RivWellPathPartMgr();
void setScaleTransform(cvf::Transform * scaleTransform);
void appendStaticGeometryPartsToModel(cvf::ModelBasicList* model,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform);
void scheduleGeometryRegen();
void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model,
const QDateTime& timeStamp,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform);
void appendStaticGeometryPartsToModel(cvf::ModelBasicList* model, cvf::Vec3d displayModelOffset,
double characteristicCellSize, cvf::BoundingBox wellPathClipBoundingBox,
caf::DisplayCoordTransform* displayCoordTransform);
size_t segmentIndexFromTriangleIndex(size_t triangleIndex);
size_t segmentIndexFromTriangleIndex(size_t triangleIndex);
private:
void appendFishbonesPartsToModel(cvf::ModelBasicList* model, caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize);
void appendCompletionsToModel(cvf::ModelBasicList* model, caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize);
void appendPerforationsToModel(cvf::ModelBasicList* model, caf::DisplayCoordTransform* displayCoordTransform, double characteristicCellSize);
void buildWellPathParts(cvf::Vec3d displayModelOffset, double characteristicCellSize, cvf::BoundingBox wellPathClipBoundingBox);
inline RimWellPathCollection* wellPathCollection();
inline double wellPathRadius(double characteristicCellSize, RimWellPathCollection* wellPathCollection);
void appendFracturePartsToModel(cvf::ModelBasicList* model, caf::DisplayCoordTransform* displayCoordTransform);
void clearAllBranchData();
void appendFishbonesPartsToModel(cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform,
double characteristicCellSize);
void appendCompletionsToModel(cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform,
double characteristicCellSize);
void appendPerforationsToModel(const QDateTime& currentViewDate,
cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform,
double characteristicCellSize);
void appendFracturePartsToModel(cvf::ModelBasicList* model,
const caf::DisplayCoordTransform* displayCoordTransform);
void buildWellPathParts(const caf::DisplayCoordTransform* displayCoordTransform,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox);
void clearAllBranchData();
inline RimWellPathCollection* wellPathCollection();
inline double wellPathRadius(double characteristicCellSize, RimWellPathCollection* wellPathCollection);
private:
caf::PdmPointer<RimWellPath> m_rimWellPath;
cvf::ref<cvf::Transform> m_scaleTransform;
bool m_needsTransformUpdate;
struct RivPipeBranchData
{
cvf::ref<RivPipeGeometryGenerator> m_pipeGeomGenerator;
@ -94,5 +110,4 @@ private:
cvf::ref<cvf::Effect> m_scalarMapperSurfaceEffect;
cvf::ref<cvf::Effect> m_scalarMapperMeshEffect;
cvf::Collection<RivFishbonesSubsPartMgr> m_fishbonesPartMgrs;
};

View File

@ -51,8 +51,9 @@ public:
virtual void updateFilePathsFromProjectPath(const QString& projectPath, const QString& oldProjectPath) = 0;
virtual QStringList timeStepStrings() = 0;
virtual QString timeStepName(int frameIdx) = 0;
virtual std::vector<QDateTime> timeStepDates() const = 0;
virtual QStringList timeStepStrings() const = 0;
virtual QString timeStepName(int frameIdx) const = 0;
virtual cvf::BoundingBox activeCellsBoundingBox() const = 0;
virtual cvf::BoundingBox allCellsBoundingBox() const = 0;
@ -61,6 +62,8 @@ public:
virtual void updateFormationNamesData() = 0;
virtual double characteristicCellSize() const = 0;
protected:
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
private:

View File

@ -76,14 +76,20 @@ RimEclipseCase::RimEclipseCase()
CAF_PDM_InitField(&flipXAxis, "FlipXAxis", false, "Flip X Axis", "", "", "");
CAF_PDM_InitField(&flipYAxis, "FlipYAxis", false, "Flip Y Axis", "", "", "");
CAF_PDM_InitFieldNoDefault(&filesContainingFaults, "FilesContainingFaults", "", "", "", "");
filesContainingFaults.uiCapability()->setUiHidden(true);
CAF_PDM_InitFieldNoDefault(&m_filesContainingFaultsSemColSeparated, "CachedFileNamesContainingFaults", "", "", "", "");
m_filesContainingFaultsSemColSeparated.uiCapability()->setUiHidden(true);
// Obsolete fields
CAF_PDM_InitFieldNoDefault(&m_filesContainingFaults_OBSOLETE, "FilesContainingFaults", "", "", "", "");
m_filesContainingFaults_OBSOLETE.xmlCapability()->setIOWritable(false);
m_filesContainingFaults_OBSOLETE.uiCapability()->setUiHidden(true);
// Obsolete field
CAF_PDM_InitField(&caseName, "CaseName", QString(), "Obsolete", "", "" ,"");
caseName.xmlCapability()->setIOWritable(false);
caseName.uiCapability()->setUiHidden(true);
// Init
m_matrixModelResults = new RimReservoirCellResultsStorage;
m_matrixModelResults.uiCapability()->setUiHidden(true);
m_matrixModelResults.uiCapability()->setUiTreeChildrenHidden(true);
@ -422,6 +428,51 @@ void RimEclipseCase::setReservoirData(RigEclipseCaseData* eclipseCase)
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseCase::createTimeStepFormatString()
{
std::vector<QDateTime> timeStepDates = this->timeStepDates();
bool hasHoursAndMinutesInTimesteps = false;
bool hasSecondsInTimesteps = false;
bool hasMillisecondsInTimesteps = false;
for (size_t i = 0; i < timeStepDates.size(); i++)
{
if (timeStepDates[i].time().msec() != 0.0)
{
hasMillisecondsInTimesteps = true;
hasSecondsInTimesteps = true;
hasHoursAndMinutesInTimesteps = true;
break;
}
else if (timeStepDates[i].time().second() != 0.0)
{
hasHoursAndMinutesInTimesteps = true;
hasSecondsInTimesteps = true;
}
else if (timeStepDates[i].time().hour() != 0.0 || timeStepDates[i].time().minute() != 0.0)
{
hasHoursAndMinutesInTimesteps = true;
}
}
m_timeStepFormatString = "dd.MMM yyyy";
if (hasHoursAndMinutesInTimesteps)
{
m_timeStepFormatString += " - hh:mm";
if (hasSecondsInTimesteps)
{
m_timeStepFormatString += ":ss";
if (hasMillisecondsInTimesteps)
{
m_timeStepFormatString += ".zzz";
}
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -470,7 +521,7 @@ cvf::Vec3d RimEclipseCase::displayModelOffset() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimReservoirCellResultsStorage* RimEclipseCase::results(RifReaderInterface::PorosityModelResultType porosityModel) const
RimReservoirCellResultsStorage* RimEclipseCase::results(RifReaderInterface::PorosityModelResultType porosityModel)
{
if (porosityModel == RifReaderInterface::MATRIX_RESULTS)
{
@ -480,7 +531,51 @@ RimReservoirCellResultsStorage* RimEclipseCase::results(RifReaderInterface::Poro
return m_fractureModelResults();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const RimReservoirCellResultsStorage* RimEclipseCase::results(RifReaderInterface::PorosityModelResultType porosityModel) const
{
if (porosityModel == RifReaderInterface::MATRIX_RESULTS)
{
return m_matrixModelResults();
}
return m_fractureModelResults();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<QString> RimEclipseCase::filesContainingFaults() const
{
QString separatedPaths = m_filesContainingFaultsSemColSeparated;
QStringList pathList = separatedPaths.split(";", QString::SkipEmptyParts);
std::vector<QString> stdPathList;
for (auto& path: pathList) stdPathList.push_back(path);
return stdPathList;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseCase::setFilesContainingFaults(const std::vector<QString>& val)
{
QString separatedPaths;
for (size_t i = 0; i < val.size(); ++i)
{
const auto& path = val[i];
separatedPaths += path;
if (!(i+1 >= val.size()) )
{
separatedPaths += ";";
}
}
m_filesContainingFaultsSemColSeparated = separatedPaths;
}
//--------------------------------------------------------------------------------------------------
///
@ -516,6 +611,8 @@ bool RimEclipseCase::openReserviorCase()
if (results->cellResults()) results->cellResults()->createPlaceholderResultEntries();
}
createTimeStepFormatString();
return true;
}
@ -535,7 +632,7 @@ std::vector<RimView*> RimEclipseCase::views()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QStringList RimEclipseCase::timeStepStrings()
QStringList RimEclipseCase::timeStepStrings() const
{
QStringList stringList;
@ -551,50 +648,11 @@ QStringList RimEclipseCase::timeStepStrings()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimEclipseCase::timeStepName(int frameIdx)
QString RimEclipseCase::timeStepName(int frameIdx) const
{
std::vector<QDateTime> timeStepDates = this->timeStepDates();
CVF_ASSERT(frameIdx < static_cast<int>(timeStepDates.size()));
if (m_timeStepFormatString.isEmpty())
{
bool hasHoursAndMinutesInTimesteps = false;
bool hasSecondsInTimesteps = false;
bool hasMillisecondsInTimesteps = false;
for (size_t i = 0; i < timeStepDates.size(); i++)
{
if (timeStepDates[i].time().msec() != 0.0)
{
hasMillisecondsInTimesteps = true;
hasSecondsInTimesteps = true;
hasHoursAndMinutesInTimesteps = true;
break;
}
else if (timeStepDates[i].time().second() != 0.0) {
hasHoursAndMinutesInTimesteps = true;
hasSecondsInTimesteps = true;
}
else if (timeStepDates[i].time().hour() != 0.0 || timeStepDates[i].time().minute() != 0.0)
{
hasHoursAndMinutesInTimesteps = true;
}
}
m_timeStepFormatString = "dd.MMM yyyy";
if (hasHoursAndMinutesInTimesteps)
{
m_timeStepFormatString += " - hh:mm";
if (hasSecondsInTimesteps)
{
m_timeStepFormatString += ":ss";
if (hasMillisecondsInTimesteps)
{
m_timeStepFormatString += ".zzz";
}
}
}
}
QDateTime date = timeStepDates.at(frameIdx);
return date.toString(m_timeStepFormatString);
@ -626,6 +684,7 @@ void RimEclipseCase::reloadDataAndUpdate()
RimEclipseView* reservoirView = reservoirViews()[i];
CVF_ASSERT(reservoirView);
reservoirView->loadDataAndUpdate();
reservoirView->updateGridBoxData();
}
RimProject* project = RiaApplication::instance()->project();
@ -663,7 +722,21 @@ void RimEclipseCase::reloadDataAndUpdate()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<QDateTime> RimEclipseCase::timeStepDates()
double RimEclipseCase::characteristicCellSize() const
{
const RigEclipseCaseData* rigEclipseCase = eclipseCaseData();
if (rigEclipseCase)
{
return rigEclipseCase->mainGrid()->characteristicIJCellSize();
}
return 10.0;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<QDateTime> RimEclipseCase::timeStepDates() const
{
return results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->timeStepDates();
}

View File

@ -63,8 +63,8 @@ public:
caf::PdmField<bool> flipXAxis;
caf::PdmField<bool> flipYAxis;
caf::PdmField<std::vector<QString> > filesContainingFaults;
std::vector<QString> filesContainingFaults() const;
void setFilesContainingFaults(const std::vector<QString>& val);
bool openReserviorCase();
virtual bool openEclipseGridFile() = 0;
@ -73,7 +73,8 @@ public:
const RigEclipseCaseData* eclipseCaseData() const;
cvf::Color3f defaultWellColor(const QString& wellName);
RimReservoirCellResultsStorage* results(RifReaderInterface::PorosityModelResultType porosityModel) const ;
RimReservoirCellResultsStorage* results(RifReaderInterface::PorosityModelResultType porosityModel);
const RimReservoirCellResultsStorage* results(RifReaderInterface::PorosityModelResultType porosityModel) const;
RimEclipseView* createAndAddReservoirView();
RimEclipseView* createCopyAndAddView(const RimEclipseView* sourceView);
@ -87,9 +88,9 @@ public:
RimCaseCollection* parentCaseCollection();
virtual std::vector<RimView*> views();
virtual QStringList timeStepStrings();
virtual QString timeStepName(int frameIdx);
std::vector<QDateTime> timeStepDates();
virtual QStringList timeStepStrings() const override;
virtual QString timeStepName(int frameIdx) const override;
virtual std::vector<QDateTime> timeStepDates() const override;
virtual cvf::BoundingBox activeCellsBoundingBox() const;
@ -99,8 +100,8 @@ public:
void reloadDataAndUpdate();
virtual void reloadEclipseGridFile() = 0;
// Overridden methods from PdmObject
public:
virtual double characteristicCellSize() const override;
protected:
virtual void initAfterRead();
@ -114,16 +115,22 @@ protected:
void setReservoirData(RigEclipseCaseData* eclipseCase);
private:
cvf::ref<RigEclipseCaseData> m_rigEclipseCase;
void createTimeStepFormatString();
private:
cvf::ref<RigEclipseCaseData> m_rigEclipseCase;
QString m_timeStepFormatString;
std::map<QString , cvf::Color3f> m_wellToColorMap;
caf::PdmField<QString > m_filesContainingFaultsSemColSeparated;
caf::PdmChildField<RimReservoirCellResultsStorage*> m_matrixModelResults;
caf::PdmChildField<RimReservoirCellResultsStorage*> m_fractureModelResults;
QString m_timeStepFormatString;
std::map<QString , cvf::Color3f> m_wellToColorMap;
// Obsolete fields
protected:
caf::PdmField<QString> caseName;
private:
caf::PdmField<std::vector<QString> > m_filesContainingFaults_OBSOLETE;
};

View File

@ -117,7 +117,7 @@ bool RimEclipseResultCase::openEclipseGridFile()
return false;
}
this->filesContainingFaults = readerInterface->filenamesWithFaults();
this->setFilesContainingFaults(readerInterface->filenamesWithFaults());
this->setReservoirData( eclipseCase.p() );
}
@ -359,13 +359,14 @@ void RimEclipseResultCase::updateFilePathsFromProjectPath(const QString& newProj
caseFileName = RimTools::relocateFile(caseFileName(), newProjectPath, oldProjectPath, &foundFile, &searchedPaths);
std::vector<QString> relocatedFaultFiles;
for (auto faultFileName : filesContainingFaults())
const std::vector<QString>& orgFilesContainingFaults = filesContainingFaults();
for (auto faultFileName : orgFilesContainingFaults)
{
QString relocatedFaultFile = RimTools::relocateFile(faultFileName, newProjectPath, oldProjectPath, &foundFile, &searchedPaths);
relocatedFaultFiles.push_back(relocatedFaultFile);
}
filesContainingFaults = relocatedFaultFiles;
setFilesContainingFaults(relocatedFaultFiles);
#if 0 // Output the search path for debugging
for (size_t i = 0; i < searchedPaths.size(); ++i)

View File

@ -67,7 +67,6 @@
#include "RivReservoirViewPartMgr.h"
#include "RivSingleCellPartGenerator.h"
#include "RivTernarySaturationOverlayItem.h"
#include "RivWellPathCollectionPartMgr.h"
#include "RivWellFracturePartMgr.h"
#include "cafCadNavigation.h"
@ -440,22 +439,13 @@ void RimEclipseView::createDisplayModel()
*/
// Well path model
m_wellPathPipeVizModel->removeAllParts();
RigMainGrid* mainGrid = this->mainGrid();
if (mainGrid)
{
// NB! StimPlan legend colors must be updated before well path geometry is added to the model
// as the fracture geometry depends on the StimPlan legend colors
stimPlanColors->updateLegendData();
// NB! StimPlan legend colors must be updated before well path geometry is added to the model
// as the fracture geometry depends on the StimPlan legend colors
stimPlanColors->updateLegendData();
addWellPathsToModel(m_wellPathPipeVizModel.p(),
mainGrid->displayModelOffset(),
mainGrid->characteristicIJCellSize(),
currentActiveCellInfo()->geometryBoundingBox(),
m_reservoirGridPartManager->scaleTransform());
}
addWellPathsToModel(m_wellPathPipeVizModel.p(), currentActiveCellInfo()->geometryBoundingBox());
m_viewer->addStaticModelOnce(m_wellPathPipeVizModel.p());
@ -638,44 +628,71 @@ void RimEclipseView::updateCurrentTimeStep()
crossSectionCollection->applySingleColorEffect();
}
// Simulation Wells
if (m_viewer)
{
cvf::Scene* frameScene = m_viewer->frame(m_currentTimeStep);
if (frameScene)
{
cvf::ref<cvf::ModelBasicList> simWellModelBasicList = new cvf::ModelBasicList;
simWellModelBasicList->setName("SimWellPipeMod");
m_simWellsPartManager->appendDynamicGeometryPartsToModel(simWellModelBasicList.p(), m_currentTimeStep);
simWellModelBasicList->updateBoundingBoxesRecursive();
this->removeModelByName(frameScene, simWellModelBasicList->name());
frameScene->addModel(simWellModelBasicList.p());
cvf::ref<caf::DisplayCoordTransform> transForm = this->displayCoordTransform();
std::vector<RimFracture*> fractures;
this->descendantsIncludingThisOfType(fractures);
for (RimFracture* f : fractures)
// Simulation Wells
{
RimEclipseWell* eclWell = nullptr;
f->firstAncestorOrThisOfType(eclWell);
if (eclWell)
{
bool isAnyGeometryPresent = eclWell->isWellPipeVisible(m_currentTimeStep) || eclWell->isWellSpheresVisible(m_currentTimeStep);
if (!isAnyGeometryPresent)
{
continue;
}
}
cvf::String name = "SimWellPipeMod";
this->removeModelByName(frameScene, name);
f->fracturePartManager()->appendGeometryPartsToModel(simWellModelBasicList.p(), transForm.p());
cvf::ref<cvf::ModelBasicList> simWellModelBasicList = new cvf::ModelBasicList;
simWellModelBasicList->setName(name);
m_simWellsPartManager->appendDynamicGeometryPartsToModel(simWellModelBasicList.p(), m_currentTimeStep);
simWellModelBasicList->updateBoundingBoxesRecursive();
frameScene->addModel(simWellModelBasicList.p());
m_simWellsPartManager->updatePipeResultColor(m_currentTimeStep);
}
simWellModelBasicList->updateBoundingBoxesRecursive();
// Well Paths
{
cvf::String name = "WellPathMod";
this->removeModelByName(frameScene, name);
cvf::ref<cvf::ModelBasicList> wellPathModelBasicList = new cvf::ModelBasicList;
wellPathModelBasicList->setName(name);
m_simWellsPartManager->updatePipeResultColor(m_currentTimeStep);
addDynamicWellPathsToModel(wellPathModelBasicList.p(), currentActiveCellInfo()->geometryBoundingBox());
frameScene->addModel(wellPathModelBasicList.p());
}
// Sim Well Fractures
{
cvf::String name = "SimWellFracturesModel";
this->removeModelByName(frameScene, name);
cvf::ref<cvf::ModelBasicList> simWellFracturesModelBasicList = new cvf::ModelBasicList;
simWellFracturesModelBasicList->setName(name);
cvf::ref<caf::DisplayCoordTransform> transForm = this->displayCoordTransform();
std::vector<RimFracture*> fractures;
this->descendantsIncludingThisOfType(fractures);
for (RimFracture* f : fractures)
{
RimEclipseWell* eclWell = nullptr;
f->firstAncestorOrThisOfType(eclWell);
if (eclWell)
{
bool isAnyGeometryPresent = eclWell->isWellPipeVisible(m_currentTimeStep) || eclWell->isWellSpheresVisible(m_currentTimeStep);
if (!isAnyGeometryPresent)
{
continue;
}
}
f->fracturePartManager()->appendGeometryPartsToModel(simWellFracturesModelBasicList.p(), transForm.p());
}
simWellFracturesModelBasicList->updateBoundingBoxesRecursive();
}
}
}

View File

@ -89,6 +89,38 @@ RimGeoMechCase::~RimGeoMechCase(void)
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechCase::setFileName(const QString& fileName)
{
m_caseFileName = fileName;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimGeoMechCase::caseFileName() const
{
return m_caseFileName();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigGeoMechCaseData* RimGeoMechCase::geoMechData()
{
return m_geoMechCaseData.p();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const RigGeoMechCaseData* RimGeoMechCase::geoMechData() const
{
return m_geoMechCaseData.p();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -172,6 +204,16 @@ std::vector<RimView*> RimGeoMechCase::views()
return views;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<QDateTime> RimGeoMechCase::timeStepDates() const
{
QStringList timeStrings = timeStepStrings();
return RimGeoMechCase::dateTimeVectorFromTimeStepStrings(timeStrings);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -191,11 +233,11 @@ void RimGeoMechCase::initAfterRead()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QStringList RimGeoMechCase::timeStepStrings()
QStringList RimGeoMechCase::timeStepStrings() const
{
QStringList stringList;
RigGeoMechCaseData* rigCaseData = geoMechData();
const RigGeoMechCaseData* rigCaseData = geoMechData();
if (rigCaseData && rigCaseData->femPartResults())
{
std::vector<std::string> stepNames = rigCaseData->femPartResults()->stepNames();
@ -211,9 +253,9 @@ QStringList RimGeoMechCase::timeStepStrings()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimGeoMechCase::timeStepName(int frameIdx)
QString RimGeoMechCase::timeStepName(int frameIdx) const
{
RigGeoMechCaseData* rigCaseData = geoMechData();
const RigGeoMechCaseData* rigCaseData = geoMechData();
if (rigCaseData && rigCaseData->femPartResults())
{
std::vector<std::string> stepNames = rigCaseData->femPartResults()->stepNames();
@ -247,6 +289,21 @@ cvf::BoundingBox RimGeoMechCase::allCellsBoundingBox() const
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimGeoMechCase::characteristicCellSize() const
{
if (geoMechData() && geoMechData()->femParts())
{
double cellSize = geoMechData()->femParts()->characteristicElementSize();
return cellSize;
}
return 10.0;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -46,32 +46,34 @@ public:
RimGeoMechCase(void);
virtual ~RimGeoMechCase(void);
void setFileName(const QString& fileName) {m_caseFileName = fileName;}
QString caseFileName() const {return m_caseFileName();}
void setFileName(const QString& fileName);
QString caseFileName() const;
bool openGeoMechCase(std::string* errorMessage);
RigGeoMechCaseData* geoMechData() { return m_geoMechCaseData.p(); }
const RigGeoMechCaseData* geoMechData() const { return m_geoMechCaseData.p(); }
RigGeoMechCaseData* geoMechData();
const RigGeoMechCaseData* geoMechData() const;
RimGeoMechView* createAndAddReservoirView();
virtual void updateFilePathsFromProjectPath(const QString& projectPath, const QString& oldProjectPath);
virtual std::vector<RimView*> views();
virtual QStringList timeStepStrings();
virtual QString timeStepName(int frameIdx);
virtual std::vector<QDateTime> timeStepDates() const override;
virtual QStringList timeStepStrings() const override;
virtual QString timeStepName(int frameIdx) const override;
virtual cvf::BoundingBox activeCellsBoundingBox() const;
virtual cvf::BoundingBox allCellsBoundingBox() const;
virtual double characteristicCellSize() const override;
// Fields:
caf::PdmChildArrayField<RimGeoMechView*> geoMechViews;
static std::vector<QDateTime> dateTimeVectorFromTimeStepStrings(const QStringList& timeStepStrings);
private:
static std::vector<QDateTime> dateTimeVectorFromTimeStepStrings(const QStringList& timeStepStrings);
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
@ -85,6 +87,4 @@ private:
caf::PdmField<QString> m_caseFileName;
caf::PdmField<double> m_cohesion;
caf::PdmField<double> m_frictionAngleDeg;
protected:
};

View File

@ -210,15 +210,10 @@ void RimGeoMechView::createDisplayModel()
// Well path model
double characteristicCellSize = geoMechCase()->geoMechData()->femParts()->characteristicElementSize();
cvf::BoundingBox femBBox = geoMechCase()->geoMechData()->femParts()->boundingBox();
m_wellPathPipeVizModel->removeAllParts();
addWellPathsToModel(m_wellPathPipeVizModel.p(),
cvf::Vec3d(0, 0, 0),
characteristicCellSize,
femBBox,
scaleTransform());
addWellPathsToModel(m_wellPathPipeVizModel.p(), femBBox);
m_viewer->addStaticModelOnce(m_wellPathPipeVizModel.p());
@ -259,14 +254,32 @@ void RimGeoMechView::updateCurrentTimeStep()
cvf::Scene* frameScene = m_viewer->frame(m_currentTimeStep);
if (frameScene)
{
// Grid model
cvf::ref<cvf::ModelBasicList> frameParts = new cvf::ModelBasicList;
frameParts->setName("GridModel");
m_vizLogic->appendPartsToModel(m_currentTimeStep, frameParts.p());
frameParts->updateBoundingBoxesRecursive();
{
// Grid model
cvf::String name = "GridModel";
this->removeModelByName(frameScene, name);
this->removeModelByName(frameScene, frameParts->name());
frameScene->addModel(frameParts.p());
cvf::ref<cvf::ModelBasicList> frameParts = new cvf::ModelBasicList;
frameParts->setName(name);
m_vizLogic->appendPartsToModel(m_currentTimeStep, frameParts.p());
frameParts->updateBoundingBoxesRecursive();
frameScene->addModel(frameParts.p());
}
// Well Paths
{
cvf::String name = "WellPathMod";
this->removeModelByName(frameScene, name);
cvf::ref<cvf::ModelBasicList> wellPathModelBasicList = new cvf::ModelBasicList;
wellPathModelBasicList->setName(name);
cvf::BoundingBox femBBox = geoMechCase()->geoMechData()->femParts()->boundingBox();
addDynamicWellPathsToModel(wellPathModelBasicList.p(), femBBox);
frameScene->addModel(wellPathModelBasicList.p());
}
}
}
@ -283,6 +296,7 @@ void RimGeoMechView::updateCurrentTimeStep()
{
crossSectionCollection->applySingleColorEffect();
}
}
else
{

View File

@ -385,8 +385,7 @@ std::vector<time_t> RimGridTimeHistoryCurve::timeStepValues() const
{
std::vector<double> values = timeHistResultAccessor->timeHistoryValues();
QStringList stepNames = geoMechTopItem->geoMechCase()->timeStepStrings();
std::vector<QDateTime> dates = RimGeoMechCase::dateTimeVectorFromTimeStepStrings(stepNames);
std::vector<QDateTime> dates = geoMechTopItem->geoMechCase()->timeStepDates();
if (dates.size() == values.size())
{
for (QDateTime dt : dates)
@ -430,8 +429,7 @@ std::vector<double> RimGridTimeHistoryCurve::daysSinceSimulationStart() const
{
std::vector<double> values = timeHistResultAccessor->timeHistoryValues();
QStringList stepNames = geoMechTopItem->geoMechCase()->timeStepStrings();
std::vector<QDateTime> dates = RimGeoMechCase::dateTimeVectorFromTimeStepStrings(stepNames);
std::vector<QDateTime> dates = geoMechTopItem->geoMechCase()->timeStepDates();
if (dates.size() == values.size())
{
if (!dates.empty()) {

View File

@ -40,8 +40,6 @@
#include "RiuMainWindow.h"
#include "RiuViewer.h"
#include "RivWellPathCollectionPartMgr.h"
#include "cafDisplayCoordTransform.h"
#include "cafFrameAnimationControl.h"
#include "cafPdmObjectFactory.h"
@ -54,6 +52,7 @@
#include "cvfViewport.h"
#include <limits.h>
#include "cvfTransform.h"
namespace caf {
@ -423,6 +422,18 @@ void RimView::endAnimation()
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellPathCollection* RimView::wellPathsPartManager()
{
RimProject* proj = nullptr;
this->firstAncestorOrThisOfTypeAsserted(proj);
CVF_ASSERT(proj && proj->activeOilField() && proj->activeOilField()->wellPathCollection());
return proj->activeOilField()->wellPathCollection();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -600,8 +611,7 @@ void RimView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QV
// Regenerate well paths
RimOilField* oilFields = RiaApplication::instance()->project() ? RiaApplication::instance()->project()->activeOilField() : NULL;
RimWellPathCollection* wellPathCollection = (oilFields) ? oilFields->wellPathCollection() : NULL;
if (wellPathCollection) wellPathCollection->wellPathCollectionPartMgr()->scheduleGeometryRegen();
crossSectionCollection->updateIntersectionBoxGeometry();
if (m_viewer)
@ -703,25 +713,42 @@ void RimView::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QV
///
//--------------------------------------------------------------------------------------------------
void RimView::addWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList,
const cvf::Vec3d& displayModelOffset,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox,
cvf::Transform* scaleTransform)
const cvf::BoundingBox& wellPathClipBoundingBox)
{
RimOilField* oilFields = RiaApplication::instance()->project() ? RiaApplication::instance()->project()->activeOilField() : NULL;
RimWellPathCollection* wellPathCollection = oilFields ? oilFields->wellPathCollection() : NULL;
RivWellPathCollectionPartMgr* wellPathCollectionPartMgr = wellPathCollection ? wellPathCollection->wellPathCollectionPartMgr() : NULL;
if (!this->ownerCase()) return;
if (wellPathCollectionPartMgr)
cvf::ref<caf::DisplayCoordTransform> transForm = displayCoordTransform();
wellPathsPartManager()->appendStaticGeometryPartsToModel(wellPathModelBasicList,
this->ownerCase()->characteristicCellSize(),
wellPathClipBoundingBox,
transForm.p());
wellPathModelBasicList->updateBoundingBoxesRecursive();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimView::addDynamicWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList, const cvf::BoundingBox& wellPathClipBoundingBox)
{
if (!this->ownerCase()) return;
cvf::ref<caf::DisplayCoordTransform> transForm = displayCoordTransform();
QDateTime currentTimeStamp;
std::vector<QDateTime> timeStamps = ownerCase()->timeStepDates();
if (currentTimeStep() < timeStamps.size())
{
wellPathCollectionPartMgr->appendStaticGeometryPartsToModel(wellPathModelBasicList,
displayModelOffset,
scaleTransform,
characteristicCellSize,
wellPathClipBoundingBox,
this->displayCoordTransform().p());
currentTimeStamp = timeStamps[currentTimeStep()];
}
wellPathsPartManager()->appendDynamicGeometryPartsToModel(wellPathModelBasicList,
currentTimeStamp,
this->ownerCase()->characteristicCellSize(),
wellPathClipBoundingBox,
transForm.p());
wellPathModelBasicList->updateBoundingBoxesRecursive();
}

View File

@ -50,6 +50,7 @@ class RimPropertyFilterCollection;
class RimViewController;
class RimViewLinker;
class RiuViewer;
class RimWellPathCollection;
namespace cvf
{
@ -169,6 +170,7 @@ public:
public:
virtual void loadDataAndUpdate() = 0;
void updateGridBoxData();
virtual RimCase* ownerCase() = 0;
virtual caf::PdmFieldHandle* userDescriptionField() { return &name; }
@ -177,17 +179,16 @@ protected:
void setDefaultView();
void addWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList,
const cvf::Vec3d& displayModelOffset,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox,
cvf::Transform* scaleTransform);
const cvf::BoundingBox& wellPathClipBoundingBox);
void addDynamicWellPathsToModel(cvf::ModelBasicList* wellPathModelBasicList,
const cvf::BoundingBox& wellPathClipBoundingBox);
static void removeModelByName(cvf::Scene* scene, const cvf::String& modelName);
virtual void createDisplayModel() = 0;
void createHighlightAndGridBoxDisplayModel();
void updateGridBoxData();
virtual void createPartCollectionFromSelection(cvf::Collection<cvf::Part>* parts) = 0;
@ -203,6 +204,8 @@ protected:
virtual void resetLegendsInViewer() = 0;
virtual void calculateCurrentTotalCellVisibility(cvf::UByteArray* totalVisibility) = 0;
RimWellPathCollection* wellPathsPartManager();
QPointer<RiuViewer> m_viewer;
caf::PdmField<int> m_currentTimeStep;

View File

@ -426,7 +426,14 @@ QString RimWellLogPlot::asciiDataForPlotExport() const
if (curveNames.size() == 1)
{
curveDepths = curveData->measuredDepthPlotValues(RiaDefines::UNIT_NONE);
if (depthType() == TRUE_VERTICAL_DEPTH)
{
curveDepths = curveData->trueDepthPlotValues(depthUnit());
}
else
{
curveDepths = curveData->measuredDepthPlotValues(depthUnit());
}
}
std::vector<double> xPlotValues = curveData->xPlotValues();
@ -435,9 +442,9 @@ QString RimWellLogPlot::asciiDataForPlotExport() const
}
for (int i = static_cast<int>(curveDepths.size()) - 1; i >= 0; i--)
for (size_t i = 0; i < curveDepths.size(); ++i)
{
if (i == static_cast<int>(curveDepths.size()) - 1)
if (i == 0)
{
if (depthType() == CONNECTION_NUMBER) out += "Connection";
else if (depthType() == MEASURED_DEPTH) out += "MD ";
@ -446,7 +453,7 @@ QString RimWellLogPlot::asciiDataForPlotExport() const
for (QString name : curveNames) out += " \t" + name;
out += "\n";
}
else if (curveDepths[i] == curveDepths[i+1])
else if (curveDepths[i] == curveDepths[i-1])
{
continue;
}

View File

@ -269,8 +269,6 @@ RivWellPathPartMgr* RimWellPath::partMgr()
//--------------------------------------------------------------------------------------------------
void RimWellPath::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
partMgr()->scheduleGeometryRegen();
RimProject* proj;
this->firstAncestorOrThisOfTypeAsserted(proj);
if (changedField == &showWellPath)

View File

@ -37,8 +37,6 @@
#include "RiuMainWindow.h"
#include "RivWellPathCollectionPartMgr.h"
#include "RifWellPathImporter.h"
#include "cafPdmUiEditorHandle.h"
@ -50,6 +48,7 @@
#include <fstream>
#include <cmath>
#include "RivWellPathPartMgr.h"
namespace caf
{
@ -94,8 +93,6 @@ RimWellPathCollection::RimWellPathCollection()
wellPaths.uiCapability()->setUiHidden(true);
m_wellPathCollectionPartManager = new RivWellPathCollectionPartMgr(this);
m_wellPathImporter = new RifWellPathImporter;
}
@ -115,7 +112,7 @@ RimWellPathCollection::~RimWellPathCollection()
//--------------------------------------------------------------------------------------------------
void RimWellPathCollection::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
{
scheduleGeometryRegenAndRedrawViews();
scheduleRedrawAffectedViews();
}
@ -327,14 +324,51 @@ caf::PdmFieldHandle* RimWellPathCollection::objectToggleField()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathCollection::scheduleGeometryRegenAndRedrawViews()
void RimWellPathCollection::scheduleRedrawAffectedViews()
{
m_wellPathCollectionPartManager->scheduleGeometryRegen();
RimProject* proj;
this->firstAncestorOrThisOfType(proj);
if (proj) proj->createDisplayModelAndRedrawAllViews();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathCollection::appendStaticGeometryPartsToModel(cvf::ModelBasicList* model,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform)
{
if (!this->isActive()) return;
if (this->wellPathVisibility() == RimWellPathCollection::FORCE_ALL_OFF) return;
for (size_t wIdx = 0; wIdx < this->wellPaths.size(); wIdx++)
{
RivWellPathPartMgr* partMgr = this->wellPaths[wIdx]->partMgr();
partMgr->appendStaticGeometryPartsToModel(model, characteristicCellSize, wellPathClipBoundingBox, displayCoordTransform);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPathCollection::appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model,
const QDateTime& timeStamp,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform)
{
if (!this->isActive()) return;
if (this->wellPathVisibility() == RimWellPathCollection::FORCE_ALL_OFF) return;
for (size_t wIdx = 0; wIdx < this->wellPaths.size(); wIdx++)
{
RivWellPathPartMgr* partMgr = this->wellPaths[wIdx]->partMgr();
partMgr->appendDynamicGeometryPartsToModel(model, timeStamp, characteristicCellSize, wellPathClipBoundingBox, displayCoordTransform);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -36,13 +36,19 @@
#include <QString>
//class RimFractureCollection;
class RivWellPathCollectionPartMgr;
class RifWellPathImporter;
class RimWellPath;
class RimProject;
class RigWellPath;
namespace cvf {
class ModelBasicList;
class BoundingBox;
}
namespace caf {
class DisplayCoordTransform;
}
//==================================================================================================
///
@ -77,13 +83,8 @@ public:
caf::PdmField<bool> wellPathClip;
caf::PdmField<int> wellPathClipZDistance;
caf::PdmChildArrayField<RimWellPath*> wellPaths;
// caf::PdmChildField<RimFractureCollection*> fractureCollection;
caf::PdmChildArrayField<RimWellPath*> wellPaths;
RivWellPathCollectionPartMgr* wellPathCollectionPartMgr() { return m_wellPathCollectionPartManager.p(); }
void readWellPathFiles();
void addWellPaths(QStringList filePaths);
@ -93,8 +94,18 @@ public:
RimWellPath* wellPathByName(const QString& wellPathName) const;
void addWellLogs(const QStringList& filePaths);
void scheduleRedrawAffectedViews();
void scheduleGeometryRegenAndRedrawViews();
void appendStaticGeometryPartsToModel(cvf::ModelBasicList* model,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform);
void appendDynamicGeometryPartsToModel(cvf::ModelBasicList* model,
const QDateTime& timeStamp,
double characteristicCellSize,
const cvf::BoundingBox& wellPathClipBoundingBox,
const caf::DisplayCoordTransform* displayCoordTransform);
void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath);
protected:
virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue );
@ -108,7 +119,5 @@ private:
RiaEclipseUnitTools::UnitSystemType findUnitSystemForWellPath(const RimWellPath* wellPath);
cvf::ref<RivWellPathCollectionPartMgr> m_wellPathCollectionPartManager;
RifWellPathImporter* m_wellPathImporter;
};

View File

@ -35,7 +35,7 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigEclipseToStimPlanCellTransmissibilityCalculator::RigEclipseToStimPlanCellTransmissibilityCalculator(const RimEclipseCase* caseToApply,
RigEclipseToStimPlanCellTransmissibilityCalculator::RigEclipseToStimPlanCellTransmissibilityCalculator(RimEclipseCase* caseToApply,
cvf::Mat4f fractureTransform,
double skinFactor,
double cDarcy,

View File

@ -33,7 +33,7 @@ class RigFractureCell;
class RigEclipseToStimPlanCellTransmissibilityCalculator
{
public:
explicit RigEclipseToStimPlanCellTransmissibilityCalculator(const RimEclipseCase* caseToApply,
explicit RigEclipseToStimPlanCellTransmissibilityCalculator(RimEclipseCase* caseToApply,
cvf::Mat4f fractureTransform,
double skinFactor,
double cDarcy,
@ -48,7 +48,7 @@ private:
private:
const RimEclipseCase* m_case;
RimEclipseCase* m_case;
double m_cDarcy;
double m_fractureSkinFactor;
cvf::Mat4f m_fractureTransform;

View File

@ -195,8 +195,7 @@ void RiuSelectionChangedHandler::addCurveFromSelectionItem(const RiuGeoMechSelec
std::vector<double> timeHistoryValues = timeHistResultAccessor->timeHistoryValues();
QStringList stepNames = geoMechView->geoMechCase()->timeStepStrings();
std::vector<QDateTime> dates = RimGeoMechCase::dateTimeVectorFromTimeStepStrings(stepNames);
std::vector<QDateTime> dates = geoMechView->geoMechCase()->timeStepDates();
if (dates.size() == timeHistoryValues.size())
{
RiuMainWindow::instance()->resultPlot()->addCurve(curveName, geomSelectionItem->m_color, dates, timeHistoryValues);

View File

@ -14,7 +14,7 @@ set(ERT_GITHUB_SHA "06a39878636af0bc52582430ad0431450e51139c")
set(OPM_FLOWDIAGNOSTICS_SHA "b6e59ddcd2feba450c8612a7402c9239e442c0d4")
# https://github.com/OPM/opm-flowdiagnostics-applications
set(OPM_FLOWDIAGNOSTICS_APPLICATIONS_SHA "ccaaa4dd1b553e131a3051687fd615fe728b76ee")
set(OPM_FLOWDIAGNOSTICS_APPLICATIONS_SHA "c78f50897cea10ed56c7eadd1a1b23aa5ffbc56e")
# https://github.com/OPM/opm-parser/blob/master/opm/parser/eclipse/Units/Units.hpp
# This file was moved from opm-core to opm-parser october 2016

View File

@ -992,6 +992,10 @@ private:
/// of main grid's section within a view.
std::string firstKeyword_;
/// True if path (or pointer) to unified restart file was passed
/// as constructor argument.
bool isUnified_;
/// Map LGR names to integral grid IDs.
std::unique_ptr<ECLImpl::GridIDCache> gridIDCache_;
@ -1021,44 +1025,55 @@ Opm::ECLRestartData::Impl::Impl(Path prefix)
: prefix_ (std::move(prefix))
, result_ (openResultSet(deriveRestartPath(prefix_)))
, firstKeyword_(firstFileKeyword(result_.get()))
, isUnified_ (firstKeyword_ == "SEQNUM")
{}
Opm::ECLRestartData::Impl::Impl(std::shared_ptr<ecl_file_type> rstrt)
: prefix_ (ecl_file_get_src_file(rstrt.get()))
, result_ (std::move(rstrt))
, firstKeyword_(firstFileKeyword(result_.get()))
, isUnified_ (firstKeyword_ == "SEQNUM")
{}
Opm::ECLRestartData::Impl::Impl(const Impl& rhs)
: prefix_ (rhs.prefix_)
, result_ (openResultSet(deriveRestartPath(prefix_)))
, firstKeyword_(firstFileKeyword(result_.get()))
, isUnified_ (rhs.isUnified_)
{}
Opm::ECLRestartData::Impl::Impl(Impl&& rhs)
: prefix_ (std::move(rhs.prefix_))
, result_ (std::move(rhs.result_))
, firstKeyword_(std::move(rhs.firstKeyword_))
, isUnified_ (rhs.isUnified_)
{}
bool Opm::ECLRestartData::Impl::selectReportStep(const int step)
{
if (! ecl_file_has_report_step(*this, step)) {
if (isUnified_ && ! ecl_file_has_report_step(*this, step)) {
return false;
}
this->gridIDCache_.reset();
if (auto* globView = ecl_file_get_global_view(*this)) {
// Ignore sequence numbers, dates, and simulation time.
const auto seqnum = -1;
const auto dates = static_cast<std::size_t>(-1);
const auto simdays = -1.0;
if (isUnified_) {
// Set active block view to particular report step.
// Ignore sequence numbers, dates, and simulation time.
const auto seqnum = -1;
const auto dates = static_cast<std::size_t>(-1);
const auto simdays = -1.0;
this->activeBlock_ =
ecl_file_view_add_restart_view(globView, seqnum,
step, dates, simdays);
this->activeBlock_ =
ecl_file_view_add_restart_view(globView, seqnum,
step, dates, simdays);
} else {
// Set active block view to global.
this->activeBlock_ = globView;
}
// Update grid id cache from active view.
if (this->activeBlock_ != nullptr) {
this->gridIDCache_
.reset(new ECLImpl::GridIDCache(this->activeBlock_));

View File

@ -109,6 +109,10 @@ namespace Opm {
/// step.
///
/// This is needed when working with dynamic restart data.
/// If constructed from a unified restart file, this function
/// will check that the requested step is available in the
/// file. If constructed from a non-unified restart file, no
/// such check is performed.
///
/// \param[in] step Report step number.
///

View File

@ -1,23 +1,52 @@
@startuml
/'
package Viz{
class RivWellPathPartMgr
class RivFishbonesSubsPartMgr
class RivWellFracturePartMgr
}
'/
RimView --> RivWellPathCollectionPartMgr
RivWellPathCollectionPartMgr -* "N" RivWellPathPartMgr
class RivWellPathPartMgr {
RimWellPath* m_wellPath
package Pdm{
class RimView
class RimOilField
class RimEclipseCaseCollection
class RimCase
class RimWellPath
class RimWellPathCollection
class RimFishbonesMultipleSubs
class RimWellPathCompletions
class RimFishboneWellPathCollection
class RimPerforationCollection
class RimWellPathFractureCollection
class RimFishbonesCollection
class RimFracture
}
class RimWellPath {
RimWellPathFractureCollection m_fractureCollection;
}
RivWellPathPartMgr ..> RimWellPath
RimWellPath *--> RivWellPathPartMgr
class RimWellPathFractureCollection {
caf::PdmChildArrayField<RimWellPathFracture*> fractures;
}
RivWellPathPartMgr *--> "n" RivFishbonesSubsPartMgr
RivFishbonesSubsPartMgr ..> RimFishbonesMultipleSubs
RivWellFracturePartMgr ...> RimFracture
RimOilField *--> RimWellPathCollection
RimOilField *--> RimEclipseCaseCollection
RimEclipseCaseCollection *--> "n" RimCase
RimCase *--> "n" RimView
RimWellPathCollection *--> "n" RimWellPath
RimWellPath *--> RimWellPathCompletions
RimFishbonesCollection *--> RimFishbonesMultipleSubs
RimFishbonesCollection *--> RimFishboneWellPathCollection
RimWellPathCompletions *--> RimFishbonesCollection
RimWellPathCompletions *--> RimPerforationCollection
RimWellPathCompletions *--> RimWellPathFractureCollection
RimWellPathFractureCollection *--> "n" RimFracture
RimFracture *--> RivWellFracturePartMgr
@enduml