diff --git a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp index 48b3932c7f..55cdb1cb13 100644 --- a/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivWellPathPartMgr.cpp @@ -399,6 +399,8 @@ void RivWellPathPartMgr::appendStaticGeometryPartsToModel(cvf::ModelBasicList* m //-------------------------------------------------------------------------------------------------- void RivWellPathPartMgr::appendDynamicGeometryPartsToModel(RimView* view, cvf::ModelBasicList* model) { + CVF_ASSERT(view && model); + RimWellPathCollection* wellPathCollection = this->wellPathCollection(); if (!wellPathCollection) return; @@ -410,32 +412,25 @@ void RivWellPathPartMgr::appendDynamicGeometryPartsToModel(RimView* view, cvf::M if (wellPathCollection->wellPathVisibility() != RimWellPathCollection::FORCE_ALL_ON && m_rimWellPath->showWellPath() == false) return; - cvf::ref displayCoordTransform = view->displayCoordTransform(); - double characteristicCellSize = 10.0; QDateTime currentDateTime; + double characteristicCellSize = 10.0; - RimEclipseView* eclipseView = dynamic_cast(view); - if (eclipseView) + RimCase* rimCase = nullptr; + view->firstAncestorOrThisOfType(rimCase); + if (rimCase) { - RigMainGrid* mainGrid = eclipseView->mainGrid(); - if (mainGrid) - { - characteristicCellSize = mainGrid->characteristicIJCellSize(); - } + std::vector timeStepDates = rimCase->timeStepDates(); - RimEclipseCase* eclipseCase = nullptr; - view->firstAncestorOrThisOfType(eclipseCase); - if (eclipseCase) + if (view->currentTimeStep() < timeStepDates.size()) { - std::vector timeStepDates = eclipseCase->timeStepDates(); - - if (view->currentTimeStep() < timeStepDates.size()) - { - currentDateTime = timeStepDates[view->currentTimeStep()]; - } + currentDateTime = timeStepDates[view->currentTimeStep()]; } + + characteristicCellSize = rimCase->characteristicCellSize(); } + cvf::ref displayCoordTransform = view->displayCoordTransform(); + appendPerforationsToModel(currentDateTime, model, displayCoordTransform.p(), characteristicCellSize); } diff --git a/ApplicationCode/ProjectDataModel/RimCase.h b/ApplicationCode/ProjectDataModel/RimCase.h index a5b1788172..cb274de8f0 100644 --- a/ApplicationCode/ProjectDataModel/RimCase.h +++ b/ApplicationCode/ProjectDataModel/RimCase.h @@ -62,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 7f102c395d..8b85a6d12d 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp @@ -679,6 +679,20 @@ void RimEclipseCase::reloadDataAndUpdate() } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimEclipseCase::characteristicCellSize() const +{ + const RigEclipseCaseData* rigEclipseCase = eclipseCaseData(); + if (rigEclipseCase) + { + return rigEclipseCase->mainGrid()->characteristicIJCellSize(); + } + + return 10.0; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCase.h b/ApplicationCode/ProjectDataModel/RimEclipseCase.h index 77672d95d8..8f04cdde9c 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCase.h +++ b/ApplicationCode/ProjectDataModel/RimEclipseCase.h @@ -100,6 +100,9 @@ public: void reloadDataAndUpdate(); virtual void reloadEclipseGridFile() = 0; + + virtual double characteristicCellSize() const override; + protected: virtual void initAfterRead(); virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ); diff --git a/ApplicationCode/ProjectDataModel/RimGeoMechCase.cpp b/ApplicationCode/ProjectDataModel/RimGeoMechCase.cpp index 4b97888443..a3d4b7c78c 100644 --- a/ApplicationCode/ProjectDataModel/RimGeoMechCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimGeoMechCase.cpp @@ -289,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 1e2c70de54..8af598bd1e 100644 --- a/ApplicationCode/ProjectDataModel/RimGeoMechCase.h +++ b/ApplicationCode/ProjectDataModel/RimGeoMechCase.h @@ -65,9 +65,12 @@ public: virtual cvf::BoundingBox activeCellsBoundingBox() const; virtual cvf::BoundingBox allCellsBoundingBox() const; + virtual double characteristicCellSize() const override; + // Fields: caf::PdmChildArrayField geoMechViews; + private: static std::vector dateTimeVectorFromTimeStepStrings(const QStringList& timeStepStrings);