diff --git a/ApplicationCode/Commands/CompletionCommands/RicExportFractureCompletionsImpl.cpp b/ApplicationCode/Commands/CompletionCommands/RicExportFractureCompletionsImpl.cpp index cd4c402f80..bc0ff81610 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicExportFractureCompletionsImpl.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicExportFractureCompletionsImpl.cpp @@ -46,11 +46,11 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RicExportFractureCompletionsImpl::generateCompdatValuesForWellPath(const RimWellPath* wellPath, +std::vector RicExportFractureCompletionsImpl::generateCompdatValuesForWellPath(RimWellPath* wellPath, const RicExportCompletionDataSettingsUi& settings, QTextStream* outputStreamForIntermediateResultsText) { - const RimEclipseCase* caseToApply = settings.caseToApply(); + RimEclipseCase* caseToApply = settings.caseToApply(); std::vector fracturesAlongWellPath; wellPath->descendantsIncludingThisOfType(fracturesAlongWellPath); @@ -65,7 +65,7 @@ std::vector RicExportFractureCompletionsImpl::generateCompdat //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RicExportFractureCompletionsImpl::generateCompdatValuesForSimWell(const RimEclipseCase* eclipseCase, +std::vector RicExportFractureCompletionsImpl::generateCompdatValuesForSimWell(RimEclipseCase* eclipseCase, const RimEclipseWell* well, size_t timeStep, QTextStream* outputStreamForIntermediateResultsText) @@ -103,7 +103,7 @@ std::vector RicExportFractureCompletionsImpl::generateCompdat //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RicExportFractureCompletionsImpl::generateCompdatValues(const RimEclipseCase* caseToApply, +std::vector RicExportFractureCompletionsImpl::generateCompdatValues(RimEclipseCase* caseToApply, const QString& wellPathName, const RigWellPath* wellPathGeometry, const std::vector fractures, diff --git a/ApplicationCode/Commands/CompletionCommands/RicExportFractureCompletionsImpl.h b/ApplicationCode/Commands/CompletionCommands/RicExportFractureCompletionsImpl.h index dd60dd4e7e..870ecae8cc 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicExportFractureCompletionsImpl.h +++ b/ApplicationCode/Commands/CompletionCommands/RicExportFractureCompletionsImpl.h @@ -31,17 +31,17 @@ class RimFracture; class RicExportFractureCompletionsImpl { public: - static std::vector generateCompdatValuesForWellPath(const RimWellPath* wellPath, + static std::vector generateCompdatValuesForWellPath(RimWellPath* wellPath, const RicExportCompletionDataSettingsUi& settings, QTextStream* outputStreamForIntermediateResultsText); - static std::vector generateCompdatValuesForSimWell(const RimEclipseCase* eclipseCase, + static std::vector generateCompdatValuesForSimWell(RimEclipseCase* eclipseCase, const RimEclipseWell* well, size_t timeStep, QTextStream* outputStreamForIntermediateResultsText); private: - static std::vector generateCompdatValues(const RimEclipseCase* caseToApply, + static std::vector generateCompdatValues(RimEclipseCase* caseToApply, const QString& wellPathName, const RigWellPath* wellPathGeometry, const std::vector fractures, diff --git a/ApplicationCode/Commands/CompletionCommands/RicNewFishbonesSubsFeature.cpp b/ApplicationCode/Commands/CompletionCommands/RicNewFishbonesSubsFeature.cpp index 8caec03595..18b7fb5078 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicNewFishbonesSubsFeature.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicNewFishbonesSubsFeature.cpp @@ -171,8 +171,7 @@ void RicNewFishbonesSubsFeature::askUserToSetUsefulScaling(RimFishbonesCollectio if (autoAdjustSettings) { activeView->setScaleZAndUpdate(1.0); - - wellPathColl->scheduleGeometryRegenAndRedrawViews(); + activeView->scheduleCreateDisplayModelAndRedraw(); RiuMainWindow::instance()->updateScaleValue(); } diff --git a/ApplicationCode/Commands/CompletionCommands/RicNewPerforationIntervalAtMeasuredDepthFeature.cpp b/ApplicationCode/Commands/CompletionCommands/RicNewPerforationIntervalAtMeasuredDepthFeature.cpp index ad5f91a9c2..95a85c979f 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicNewPerforationIntervalAtMeasuredDepthFeature.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicNewPerforationIntervalAtMeasuredDepthFeature.cpp @@ -60,7 +60,7 @@ void RicNewPerforationIntervalAtMeasuredDepthFeature::onActionTriggered(bool isC wellPath->firstAncestorOrThisOfTypeAsserted(wellPathCollection); wellPathCollection->uiCapability()->updateConnectedEditors(); - wellPathCollection->scheduleGeometryRegenAndRedrawViews(); + wellPathCollection->scheduleRedrawAffectedViews(); RiuMainWindow::instance()->selectAsCurrentItem(perforationInterval); } diff --git a/ApplicationCode/Commands/CompletionCommands/RicNewPerforationIntervalFeature.cpp b/ApplicationCode/Commands/CompletionCommands/RicNewPerforationIntervalFeature.cpp index 5be1e9c01b..cc55aaea97 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicNewPerforationIntervalFeature.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicNewPerforationIntervalFeature.cpp @@ -64,7 +64,7 @@ void RicNewPerforationIntervalFeature::onActionTriggered(bool isChecked) if (!wellPathCollection) return; wellPathCollection->uiCapability()->updateConnectedEditors(); - wellPathCollection->scheduleGeometryRegenAndRedrawViews(); + wellPathCollection->scheduleRedrawAffectedViews(); RiuMainWindow::instance()->selectAsCurrentItem(perforationInterval); } diff --git a/ApplicationCode/Commands/RicDeleteItemExec.cpp b/ApplicationCode/Commands/RicDeleteItemExec.cpp index d4e8a00a8f..3f91f1a4c1 100644 --- a/ApplicationCode/Commands/RicDeleteItemExec.cpp +++ b/ApplicationCode/Commands/RicDeleteItemExec.cpp @@ -157,7 +157,7 @@ void RicDeleteItemExec::redo() if (wellPathColl) { - wellPathColl->scheduleGeometryRegenAndRedrawViews(); + wellPathColl->scheduleRedrawAffectedViews(); wellPathColl->uiCapability()->updateConnectedEditors(); } diff --git a/ApplicationCode/Commands/RicDeleteSubItemsFeature.cpp b/ApplicationCode/Commands/RicDeleteSubItemsFeature.cpp index e7d81966a6..8c0d668543 100644 --- a/ApplicationCode/Commands/RicDeleteSubItemsFeature.cpp +++ b/ApplicationCode/Commands/RicDeleteSubItemsFeature.cpp @@ -77,7 +77,7 @@ void RicDeleteSubItemsFeature::onActionTriggered(bool isChecked) wellPathColl->deleteAllWellPaths(); wellPathColl->updateConnectedEditors(); - wellPathColl->scheduleGeometryRegenAndRedrawViews(); + wellPathColl->scheduleRedrawAffectedViews(); } } } diff --git a/ApplicationCode/Commands/RicSnapshotViewToClipboardFeature.cpp b/ApplicationCode/Commands/RicSnapshotViewToClipboardFeature.cpp index 05b198be5f..d884e8e9dd 100644 --- a/ApplicationCode/Commands/RicSnapshotViewToClipboardFeature.cpp +++ b/ApplicationCode/Commands/RicSnapshotViewToClipboardFeature.cpp @@ -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; diff --git a/ApplicationCode/Commands/RicWellPathFracturesDeleteAllFeature.cpp b/ApplicationCode/Commands/RicWellPathFracturesDeleteAllFeature.cpp index 0152d7c1cb..83c5e09f39 100644 --- a/ApplicationCode/Commands/RicWellPathFracturesDeleteAllFeature.cpp +++ b/ApplicationCode/Commands/RicWellPathFracturesDeleteAllFeature.cpp @@ -67,7 +67,7 @@ void RicWellPathFracturesDeleteAllFeature::onActionTriggered(bool isChecked) RimWellPathCollection* wellPathColl = nullptr; fractureCollection->firstAncestorOrThisOfType(wellPathColl); - if (wellPathColl) wellPathColl->scheduleGeometryRegenAndRedrawViews(); + if (wellPathColl) wellPathColl->scheduleRedrawAffectedViews(); } } diff --git a/ApplicationCode/Commands/WellPathCommands/RicWellPathDeleteFeature.cpp b/ApplicationCode/Commands/WellPathCommands/RicWellPathDeleteFeature.cpp index d419766521..c44d12bf29 100644 --- a/ApplicationCode/Commands/WellPathCommands/RicWellPathDeleteFeature.cpp +++ b/ApplicationCode/Commands/WellPathCommands/RicWellPathDeleteFeature.cpp @@ -67,7 +67,7 @@ void RicWellPathDeleteFeature::onActionTriggered(bool isChecked) } wellPathCollection->uiCapability()->updateConnectedEditors(); - wellPathCollection->scheduleGeometryRegenAndRedrawViews(); + wellPathCollection->scheduleRedrawAffectedViews(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPart.cpp b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPart.cpp index dc2c4bee97..e4a5ba220a 100644 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPart.cpp +++ b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPart.cpp @@ -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::infinity()) return m_characteristicElementSize; diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPart.h b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPart.h index 7c8230e35c..5c856f5e45 100644 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPart.h +++ b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPart.h @@ -78,7 +78,7 @@ public: { return m_elmNeighbors[elementIndex].faceInNeighborElm[faceIndex]; } cvf::BoundingBox boundingBox() const; - float characteristicElementSize(); + float characteristicElementSize() const; const std::vector& possibleGridCornerElements() const { return m_possibleGridCornerElements; } void findIntersectingCells(const cvf::BoundingBox& inputBB, std::vector* elementIndices) const; @@ -106,7 +106,7 @@ private: std::vector< Neighbors > m_elmNeighbors; std::vector m_possibleGridCornerElements; - float m_characteristicElementSize; + mutable float m_characteristicElementSize; mutable cvf::BoundingBox m_boundingBox; mutable cvf::ref m_elementSearchTree; diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartCollection.cpp b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartCollection.cpp index cd735dea19..f0f7429c34 100644 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartCollection.cpp +++ b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartCollection.cpp @@ -88,7 +88,7 @@ size_t RigFemPartCollection::totalElementCount() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -float RigFemPartCollection::characteristicElementSize() +float RigFemPartCollection::characteristicElementSize() const { if (partCount()) { diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartCollection.h b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartCollection.h index 5f172de9b7..3e78e1d04d 100644 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartCollection.h +++ b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartCollection.h @@ -36,7 +36,7 @@ public: int partCount() const; size_t totalElementCount() const; - float characteristicElementSize(); + float characteristicElementSize() const; cvf::BoundingBox boundingBox() const; diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp index a7a1060638..d3b32816af 100644 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp +++ b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp @@ -1840,7 +1840,7 @@ std::vector< RigFemResultAddress> RigFemPartResultsCollection::getResAddrToCompo //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RigFemPartResultsCollection::stepNames() +std::vector RigFemPartResultsCollection::stepNames() const { CVF_ASSERT(m_readerInterface.notNull()); return m_readerInterface->stepNames(); diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.h b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.h index 5659479e1b..cf6e82620e 100644 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.h +++ b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.h @@ -51,7 +51,7 @@ public: double parameterFrictionAngleRad() const { return m_frictionAngleRad; } std::map > scalarFieldAndComponentNames(RigFemResultPosEnum resPos); - std::vector stepNames(); + std::vector stepNames() const; bool assertResultsLoaded(const RigFemResultAddress& resVarAddr); void deleteResult(const RigFemResultAddress& resVarAddr); diff --git a/ApplicationCode/GeoMech/OdbReader/RifGeoMechReaderInterface.h b/ApplicationCode/GeoMech/OdbReader/RifGeoMechReaderInterface.h index ac3b2fadf0..6ec6370e65 100644 --- a/ApplicationCode/GeoMech/OdbReader/RifGeoMechReaderInterface.h +++ b/ApplicationCode/GeoMech/OdbReader/RifGeoMechReaderInterface.h @@ -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 stepNames() = 0; - virtual std::vector frameTimes(int stepIndex) = 0; + virtual std::vector stepNames() const = 0; + virtual std::vector frameTimes(int stepIndex) const = 0; virtual std::vector elementSetNames(int partIndex) = 0; virtual std::vector elementSet(int partIndex, int setIndex) = 0; diff --git a/ApplicationCode/GeoMech/OdbReader/RifOdbReader.cpp b/ApplicationCode/GeoMech/OdbReader/RifOdbReader.cpp index 59a1339df4..f2844f7c2f 100644 --- a/ApplicationCode/GeoMech/OdbReader/RifOdbReader.cpp +++ b/ApplicationCode/GeoMech/OdbReader/RifOdbReader.cpp @@ -422,7 +422,7 @@ bool RifOdbReader::readFemParts(RigFemPartCollection* femParts) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RifOdbReader::stepNames() +std::vector RifOdbReader::stepNames() const { CVF_ASSERT(m_odb != NULL); @@ -442,7 +442,7 @@ std::vector RifOdbReader::stepNames() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RifOdbReader::frameTimes(int stepIndex) +std::vector RifOdbReader::frameTimes(int stepIndex) const { CVF_ASSERT(m_odb != NULL); diff --git a/ApplicationCode/GeoMech/OdbReader/RifOdbReader.h b/ApplicationCode/GeoMech/OdbReader/RifOdbReader.h index be1004c0c9..6e2df2008d 100644 --- a/ApplicationCode/GeoMech/OdbReader/RifOdbReader.h +++ b/ApplicationCode/GeoMech/OdbReader/RifOdbReader.h @@ -44,8 +44,8 @@ public: virtual bool openFile(const std::string& fileName, std::string* errorMessage); virtual bool readFemParts(RigFemPartCollection* geoMechCase); - virtual std::vector stepNames(); - virtual std::vector frameTimes(int stepIndex); + virtual std::vector stepNames() const override; + virtual std::vector frameTimes(int stepIndex) const override; virtual std::vector elementSetNames(int partIndex); virtual std::vector elementSet(int partIndex, int setIndex); diff --git a/ApplicationCode/ModelVisualization/CMakeLists_files.cmake b/ApplicationCode/ModelVisualization/CMakeLists_files.cmake index 84eb117611..6dee791823 100644 --- a/ApplicationCode/ModelVisualization/CMakeLists_files.cmake +++ b/ApplicationCode/ModelVisualization/CMakeLists_files.cmake @@ -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 diff --git a/ApplicationCode/ModelVisualization/RivFishbonesSubsPartMgr.cpp b/ApplicationCode/ModelVisualization/RivFishbonesSubsPartMgr.cpp index 414dd140a2..1efa5f1305 100644 --- a/ApplicationCode/ModelVisualization/RivFishbonesSubsPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivFishbonesSubsPartMgr.cpp @@ -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); diff --git a/ApplicationCode/ModelVisualization/RivFishbonesSubsPartMgr.h b/ApplicationCode/ModelVisualization/RivFishbonesSubsPartMgr.h index a5d16a53fc..162f01ab8f 100644 --- a/ApplicationCode/ModelVisualization/RivFishbonesSubsPartMgr.h +++ b/ApplicationCode/ModelVisualization/RivFishbonesSubsPartMgr.h @@ -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: diff --git a/ApplicationCode/ModelVisualization/RivWellFracturePartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellFracturePartMgr.cpp index 08b9a00031..e62e1d74de 100644 --- a/ApplicationCode/ModelVisualization/RivWellFracturePartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivWellFracturePartMgr.cpp @@ -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 RivWellFracturePartMgr::createStimPlanMeshDrawable(RimStimPlanFractureTemplate* stimPlanFracTemplate, caf::DisplayCoordTransform* displayCoordTransform) +cvf::ref 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 RivWellFracturePartMgr::createPolygonDrawable(caf::DisplayCoordTransform* displayCoordTransform) +cvf::ref RivWellFracturePartMgr::createPolygonDrawable(const caf::DisplayCoordTransform* displayCoordTransform) { std::vector lineIndices; std::vector vertices; @@ -398,7 +398,7 @@ cvf::ref RivWellFracturePartMgr::createPolygonDrawable(caf::Di //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::vector RivWellFracturePartMgr::transfromToFractureDisplayCoords(std::vector coordinatesVector, cvf::Mat4f m, caf::DisplayCoordTransform* displayCoordTransform) +std::vector RivWellFracturePartMgr::transfromToFractureDisplayCoords(std::vector coordinatesVector, cvf::Mat4f m, const caf::DisplayCoordTransform* displayCoordTransform) { std::vector polygonInDisplayCoords; for (cvf::Vec3f v : coordinatesVector) @@ -432,7 +432,7 @@ std::vector RivWellFracturePartMgr::mirrorDataAtSingleDepth(std::vector< //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RivWellFracturePartMgr::appendGeometryPartsToModel(cvf::ModelBasicList* model, caf::DisplayCoordTransform* displayCoordTransform) +void RivWellFracturePartMgr::appendGeometryPartsToModel(cvf::ModelBasicList* model, const caf::DisplayCoordTransform* displayCoordTransform) { clearGeometryCache(); diff --git a/ApplicationCode/ModelVisualization/RivWellFracturePartMgr.h b/ApplicationCode/ModelVisualization/RivWellFracturePartMgr.h index 5ce70cd545..e3cc1e1109 100644 --- a/ApplicationCode/ModelVisualization/RivWellFracturePartMgr.h +++ b/ApplicationCode/ModelVisualization/RivWellFracturePartMgr.h @@ -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 mirrorDataAtSingleDepth(std::vector 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 createPolygonDrawable(caf::DisplayCoordTransform* displayCoordTransform); - cvf::ref createStimPlanMeshDrawable(RimStimPlanFractureTemplate* stimPlanFracTemplate, caf::DisplayCoordTransform* displayCoordTransform); + cvf::ref createPolygonDrawable(const caf::DisplayCoordTransform* displayCoordTransform); + cvf::ref createStimPlanMeshDrawable(RimStimPlanFractureTemplate* stimPlanFracTemplate, const caf::DisplayCoordTransform* displayCoordTransform); void getPolygonBB(float &polygonXmin, float &polygonXmax, float &polygonYmin, float &polygonYmax); - std::vector transfromToFractureDisplayCoords(std::vector polygon, cvf::Mat4f m, caf::DisplayCoordTransform* displayCoordTransform); + std::vector transfromToFractureDisplayCoords(std::vector polygon, cvf::Mat4f m, const caf::DisplayCoordTransform* displayCoordTransform); bool stimPlanCellTouchesPolygon(const std::vector& polygon, double xMin, double xMax, double yMin, double yMax, float polygonXmin, float polygonXmax, float polygonYmin, float polygonYmax); static cvf::ref createGeo(const std::vector& triangleIndices, const std::vector& nodeCoords); diff --git a/ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.cpp deleted file mode 100644 index ee34e401b2..0000000000 --- a/ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.cpp +++ /dev/null @@ -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 -// 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); - } -} - diff --git a/ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.h b/ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.h deleted file mode 100644 index cf4fc4821d..0000000000 --- a/ApplicationCode/ModelVisualization/RivWellPathCollectionPartMgr.h +++ /dev/null @@ -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 -// 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 m_wellPathCollection; -}; diff --git a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp index 15c1099807..808362ffc8 100644 --- a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp @@ -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 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 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 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); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.h b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.h index 613965abb4..ab98a97210 100644 --- a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.h +++ b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.h @@ -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 m_rimWellPath; - cvf::ref m_scaleTransform; - bool m_needsTransformUpdate; - struct RivPipeBranchData { cvf::ref m_pipeGeomGenerator; @@ -94,5 +110,4 @@ private: cvf::ref m_scalarMapperSurfaceEffect; cvf::ref m_scalarMapperMeshEffect; - cvf::Collection m_fishbonesPartMgrs; }; diff --git a/ApplicationCode/ProjectDataModel/RimCase.h b/ApplicationCode/ProjectDataModel/RimCase.h index 675c5649ac..cb274de8f0 100644 --- a/ApplicationCode/ProjectDataModel/RimCase.h +++ b/ApplicationCode/ProjectDataModel/RimCase.h @@ -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 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 calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override; private: diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp index a2c5136455..15e66567ea 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp @@ -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 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 RimEclipseCase::filesContainingFaults() const +{ + QString separatedPaths = m_filesContainingFaultsSemColSeparated; + QStringList pathList = separatedPaths.split(";", QString::SkipEmptyParts); + std::vector stdPathList; + + for (auto& path: pathList) stdPathList.push_back(path); + + return stdPathList; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimEclipseCase::setFilesContainingFaults(const std::vector& 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 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 timeStepDates = this->timeStepDates(); CVF_ASSERT(frameIdx < static_cast(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 RimEclipseCase::timeStepDates() +double RimEclipseCase::characteristicCellSize() const +{ + const RigEclipseCaseData* rigEclipseCase = eclipseCaseData(); + if (rigEclipseCase) + { + return rigEclipseCase->mainGrid()->characteristicIJCellSize(); + } + + return 10.0; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RimEclipseCase::timeStepDates() const { return results(RifReaderInterface::MATRIX_RESULTS)->cellResults()->timeStepDates(); } diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCase.h b/ApplicationCode/ProjectDataModel/RimEclipseCase.h index 5795c5c04b..be06012899 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCase.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseCase.h @@ -63,8 +63,8 @@ public: caf::PdmField flipXAxis; caf::PdmField flipYAxis; - caf::PdmField > filesContainingFaults; - + std::vector filesContainingFaults() const; + void setFilesContainingFaults(const std::vector& 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 views(); - virtual QStringList timeStepStrings(); - virtual QString timeStepName(int frameIdx); - std::vector timeStepDates(); + virtual QStringList timeStepStrings() const override; + virtual QString timeStepName(int frameIdx) const override; + virtual std::vector 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 m_rigEclipseCase; + void createTimeStepFormatString(); private: + cvf::ref m_rigEclipseCase; + QString m_timeStepFormatString; + std::map m_wellToColorMap; + caf::PdmField m_filesContainingFaultsSemColSeparated; + + caf::PdmChildField m_matrixModelResults; caf::PdmChildField m_fractureModelResults; - QString m_timeStepFormatString; - - std::map m_wellToColorMap; // Obsolete fields protected: caf::PdmField caseName; +private: + caf::PdmField > m_filesContainingFaults_OBSOLETE; + }; diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp index af62e82d3e..0cae5e39c7 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultCase.cpp @@ -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 relocatedFaultFiles; - for (auto faultFileName : filesContainingFaults()) + const std::vector& 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) diff --git a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp index 80c3eb532e..ad0914d829 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp @@ -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 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 transForm = this->displayCoordTransform(); - - std::vector 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 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 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 simWellFracturesModelBasicList = new cvf::ModelBasicList; + simWellFracturesModelBasicList->setName(name); + + cvf::ref transForm = this->displayCoordTransform(); + + std::vector 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(); + } } } diff --git a/ApplicationCode/ProjectDataModel/RimGeoMechCase.cpp b/ApplicationCode/ProjectDataModel/RimGeoMechCase.cpp index 47759350be..a3d4b7c78c 100644 --- a/ApplicationCode/ProjectDataModel/RimGeoMechCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimGeoMechCase.cpp @@ -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 RimGeoMechCase::views() return views; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector 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 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 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; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimGeoMechCase.h b/ApplicationCode/ProjectDataModel/RimGeoMechCase.h index 08926ce81a..8af598bd1e 100644 --- a/ApplicationCode/ProjectDataModel/RimGeoMechCase.h +++ b/ApplicationCode/ProjectDataModel/RimGeoMechCase.h @@ -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 views(); - virtual QStringList timeStepStrings(); - virtual QString timeStepName(int frameIdx); + virtual std::vector 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 geoMechViews; - static std::vector dateTimeVectorFromTimeStepStrings(const QStringList& timeStepStrings); - - private: + static std::vector 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 m_caseFileName; caf::PdmField m_cohesion; caf::PdmField m_frictionAngleDeg; -protected: - }; diff --git a/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp b/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp index 3b7240578a..c635a57ad0 100644 --- a/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp +++ b/ApplicationCode/ProjectDataModel/RimGeoMechView.cpp @@ -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 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 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 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 { diff --git a/ApplicationCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp b/ApplicationCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp index 6c93a71c3e..ccb3fa4afe 100644 --- a/ApplicationCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp +++ b/ApplicationCode/ProjectDataModel/RimGridTimeHistoryCurve.cpp @@ -385,8 +385,7 @@ std::vector RimGridTimeHistoryCurve::timeStepValues() const { std::vector values = timeHistResultAccessor->timeHistoryValues(); - QStringList stepNames = geoMechTopItem->geoMechCase()->timeStepStrings(); - std::vector dates = RimGeoMechCase::dateTimeVectorFromTimeStepStrings(stepNames); + std::vector dates = geoMechTopItem->geoMechCase()->timeStepDates(); if (dates.size() == values.size()) { for (QDateTime dt : dates) @@ -430,8 +429,7 @@ std::vector RimGridTimeHistoryCurve::daysSinceSimulationStart() const { std::vector values = timeHistResultAccessor->timeHistoryValues(); - QStringList stepNames = geoMechTopItem->geoMechCase()->timeStepStrings(); - std::vector dates = RimGeoMechCase::dateTimeVectorFromTimeStepStrings(stepNames); + std::vector dates = geoMechTopItem->geoMechCase()->timeStepDates(); if (dates.size() == values.size()) { if (!dates.empty()) { diff --git a/ApplicationCode/ProjectDataModel/RimView.cpp b/ApplicationCode/ProjectDataModel/RimView.cpp index 3edaba8f8a..dcc035e3ed 100644 --- a/ApplicationCode/ProjectDataModel/RimView.cpp +++ b/ApplicationCode/ProjectDataModel/RimView.cpp @@ -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 +#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 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 transForm = displayCoordTransform(); + + QDateTime currentTimeStamp; + std::vector 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(); } diff --git a/ApplicationCode/ProjectDataModel/RimView.h b/ApplicationCode/ProjectDataModel/RimView.h index 098c4fdabc..5e16a0abfd 100644 --- a/ApplicationCode/ProjectDataModel/RimView.h +++ b/ApplicationCode/ProjectDataModel/RimView.h @@ -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* parts) = 0; @@ -203,6 +204,8 @@ protected: virtual void resetLegendsInViewer() = 0; virtual void calculateCurrentTotalCellVisibility(cvf::UByteArray* totalVisibility) = 0; + RimWellPathCollection* wellPathsPartManager(); + QPointer m_viewer; caf::PdmField m_currentTimeStep; diff --git a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp index 55ae2afaec..f72d300979 100644 --- a/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellLogPlot.cpp @@ -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 xPlotValues = curveData->xPlotValues(); @@ -435,9 +442,9 @@ QString RimWellLogPlot::asciiDataForPlotExport() const } - for (int i = static_cast(curveDepths.size()) - 1; i >= 0; i--) + for (size_t i = 0; i < curveDepths.size(); ++i) { - if (i == static_cast(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; } diff --git a/ApplicationCode/ProjectDataModel/RimWellPath.cpp b/ApplicationCode/ProjectDataModel/RimWellPath.cpp index 79f9afe84c..3ba360984a 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPath.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellPath.cpp @@ -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) diff --git a/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp b/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp index eb43556279..16c65a832c 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp @@ -37,8 +37,6 @@ #include "RiuMainWindow.h" -#include "RivWellPathCollectionPartMgr.h" - #include "RifWellPathImporter.h" #include "cafPdmUiEditorHandle.h" @@ -50,6 +48,7 @@ #include #include +#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); + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimWellPathCollection.h b/ApplicationCode/ProjectDataModel/RimWellPathCollection.h index d63d2e53e7..f5878403ec 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPathCollection.h +++ b/ApplicationCode/ProjectDataModel/RimWellPathCollection.h @@ -36,13 +36,19 @@ #include -//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 wellPathClip; caf::PdmField wellPathClipZDistance; - caf::PdmChildArrayField wellPaths; -// caf::PdmChildField fractureCollection; - - + caf::PdmChildArrayField 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 m_wellPathCollectionPartManager; - RifWellPathImporter* m_wellPathImporter; }; diff --git a/ApplicationCode/ReservoirDataModel/RigEclipseToStimPlanCellTransmissibilityCalculator.cpp b/ApplicationCode/ReservoirDataModel/RigEclipseToStimPlanCellTransmissibilityCalculator.cpp index 786a8b3983..ad14a95747 100644 --- a/ApplicationCode/ReservoirDataModel/RigEclipseToStimPlanCellTransmissibilityCalculator.cpp +++ b/ApplicationCode/ReservoirDataModel/RigEclipseToStimPlanCellTransmissibilityCalculator.cpp @@ -35,7 +35,7 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigEclipseToStimPlanCellTransmissibilityCalculator::RigEclipseToStimPlanCellTransmissibilityCalculator(const RimEclipseCase* caseToApply, +RigEclipseToStimPlanCellTransmissibilityCalculator::RigEclipseToStimPlanCellTransmissibilityCalculator(RimEclipseCase* caseToApply, cvf::Mat4f fractureTransform, double skinFactor, double cDarcy, diff --git a/ApplicationCode/ReservoirDataModel/RigEclipseToStimPlanCellTransmissibilityCalculator.h b/ApplicationCode/ReservoirDataModel/RigEclipseToStimPlanCellTransmissibilityCalculator.h index 6896bd00ea..439c1063c6 100644 --- a/ApplicationCode/ReservoirDataModel/RigEclipseToStimPlanCellTransmissibilityCalculator.h +++ b/ApplicationCode/ReservoirDataModel/RigEclipseToStimPlanCellTransmissibilityCalculator.h @@ -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; diff --git a/ApplicationCode/UserInterface/RiuSelectionChangedHandler.cpp b/ApplicationCode/UserInterface/RiuSelectionChangedHandler.cpp index 3a5ecd5fb0..11ad19921e 100644 --- a/ApplicationCode/UserInterface/RiuSelectionChangedHandler.cpp +++ b/ApplicationCode/UserInterface/RiuSelectionChangedHandler.cpp @@ -195,8 +195,7 @@ void RiuSelectionChangedHandler::addCurveFromSelectionItem(const RiuGeoMechSelec std::vector timeHistoryValues = timeHistResultAccessor->timeHistoryValues(); - QStringList stepNames = geoMechView->geoMechCase()->timeStepStrings(); - std::vector dates = RimGeoMechCase::dateTimeVectorFromTimeStepStrings(stepNames); + std::vector dates = geoMechView->geoMechCase()->timeStepDates(); if (dates.size() == timeHistoryValues.size()) { RiuMainWindow::instance()->resultPlot()->addCurve(curveName, geomSelectionItem->m_color, dates, timeHistoryValues); diff --git a/ResInsightVersion.cmake b/ResInsightVersion.cmake index b80f06dd11..20dc1d4419 100644 --- a/ResInsightVersion.cmake +++ b/ResInsightVersion.cmake @@ -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 diff --git a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.cpp b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.cpp index 8d2cff11bb..8520734519 100644 --- a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.cpp +++ b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.cpp @@ -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 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 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(-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(-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_)); diff --git a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.hpp b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.hpp index c48b6a4645..aa101932e9 100644 --- a/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.hpp +++ b/ThirdParty/custom-opm-flowdiag-app/opm-flowdiagnostics-applications/opm/utility/ECLResultData.hpp @@ -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. /// diff --git a/doc/well_path_part_manager.plantuml b/doc/well_path_part_manager.plantuml index 7c5e7509b3..983cd2d6c7 100644 --- a/doc/well_path_part_manager.plantuml +++ b/doc/well_path_part_manager.plantuml @@ -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 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