diff --git a/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp b/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp index 889afbc09f..2832b0e13a 100644 --- a/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp +++ b/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.cpp @@ -166,6 +166,113 @@ bool Rim2dIntersectionView::isTimeStepDependentDataVisible() const return false; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void Rim2dIntersectionView::update3dInfo() +{ + if (!m_viewer) return; + + QString overlayInfoText; + + RimEclipseView * eclView = nullptr; + m_intersection->firstAncestorOrThisOfType(eclView); + if (eclView && eclView->overlayInfoConfig()->showCaseInfo()) + { + overlayInfoText += "--" + ownerCase()->caseUserDescription() + "--"; + } + + RimGeoMechView * geoView = nullptr; + m_intersection->firstAncestorOrThisOfType(geoView); + if (geoView && geoView->overlayInfoConfig()->showCaseInfo()) + { + overlayInfoText += "--" + ownerCase()->caseUserDescription() + "--"; + } + + overlayInfoText += "

"; + overlayInfoText += "Intersection: " + m_intersection->name() + "
"; + + if (m_intersection->simulationWell()) + { + overlayInfoText += "Simulation Well: " + m_intersection->simulationWell()->name() + "
";; + } + else if (m_intersection->wellPath()) + { + overlayInfoText += "Well Path: " + m_intersection->wellPath()->name() + "
";; + } + + if (eclView) + { + if (eclView->overlayInfoConfig()->showAnimProgress()) + { + m_viewer->showAnimationProgress(true); + } + else + { + m_viewer->showAnimationProgress(false); + } + + if (eclView->overlayInfoConfig()->showResultInfo()) + { + overlayInfoText += "Cell Result: " + eclView->cellResult()->resultVariableUiShortName() + "
"; + } + } + + if (geoView) + { + if (geoView->overlayInfoConfig()->showAnimProgress()) + { + m_viewer->showAnimationProgress(true); + } + else + { + m_viewer->showAnimationProgress(false); + } + + if (geoView->overlayInfoConfig()->showResultInfo()) + { + QString resultPos; + QString fieldName = geoView->cellResultResultDefinition()->resultFieldUiName(); + QString compName = geoView->cellResultResultDefinition()->resultComponentUiName(); + + switch (geoView->cellResultResultDefinition()->resultPositionType()) + { + case RIG_NODAL: + resultPos = "Nodal"; + break; + + case RIG_ELEMENT_NODAL: + resultPos = "Element nodal"; + break; + + case RIG_INTEGRATION_POINT: + resultPos = "Integration point"; + break; + + case RIG_ELEMENT: + resultPos = "Element"; + break; + default: + break; + } + if (compName == "") + { + overlayInfoText += QString("Cell result: %1, %2
").arg(resultPos).arg(fieldName); + } + else + { + overlayInfoText += QString("Cell result: %1, %2, %3
").arg(resultPos).arg(fieldName).arg(compName); + } + } + } + + + overlayInfoText += "

"; + m_viewer->setInfoText(overlayInfoText); + m_viewer->showInfoText(true); + m_viewer->update(); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -315,6 +422,7 @@ void Rim2dIntersectionView::clampCurrentTimestep() void Rim2dIntersectionView::updateCurrentTimeStep() { updateLegends(); + update3dInfo(); if ((this->hasUserRequestedAnimation() && this->hasResults())) { @@ -341,52 +449,16 @@ void Rim2dIntersectionView::updateLegends() if (!hasResults()) return; - QString overlayInfoText; - RimEclipseView * eclView = nullptr; m_intersection->firstAncestorOrThisOfType(eclView); - if (eclView && eclView->overlayInfoConfig()->showCaseInfo()) - { - overlayInfoText += "--" + ownerCase()->caseUserDescription() + "--"; - } RimGeoMechView * geoView = nullptr; m_intersection->firstAncestorOrThisOfType(geoView); - if (geoView && geoView->overlayInfoConfig()->showCaseInfo()) - { - overlayInfoText += "--" + ownerCase()->caseUserDescription() + "--"; - } - - overlayInfoText += "

"; - overlayInfoText += "Intersection: " + m_intersection->name() + "
"; - - if (m_intersection->simulationWell()) - { - overlayInfoText += "Simulation Well: " + m_intersection->simulationWell()->name() + "
";; - } - else if (m_intersection->wellPath()) - { - overlayInfoText += "Well Path: " + m_intersection->wellPath()->name() + "
";; - } cvf::OverlayItem* legend = nullptr; if (eclView) { - if (eclView->overlayInfoConfig()->showAnimProgress()) - { - m_viewer->showAnimationProgress(true); - } - else - { - m_viewer->showAnimationProgress(false); - } - - if (eclView->overlayInfoConfig()->showResultInfo()) - { - overlayInfoText += "Cell Result: " + eclView->cellResult()->resultVariableUiShortName() + "
"; - } - m_legendConfig()->setUiValuesFromLegendConfig(eclView->cellResult()->legendConfig()); m_ternaryLegendConfig()->setUiValuesFromLegendConfig(eclView->cellResult()->ternaryLegendConfig()); @@ -404,51 +476,6 @@ void Rim2dIntersectionView::updateLegends() if (geoView) { - if (geoView->overlayInfoConfig()->showAnimProgress()) - { - m_viewer->showAnimationProgress(true); - } - else - { - m_viewer->showAnimationProgress(false); - } - - if (geoView->overlayInfoConfig()->showResultInfo()) - { - QString resultPos; - QString fieldName = geoView->cellResultResultDefinition()->resultFieldUiName(); - QString compName = geoView->cellResultResultDefinition()->resultComponentUiName(); - - switch (geoView->cellResultResultDefinition()->resultPositionType()) - { - case RIG_NODAL: - resultPos = "Nodal"; - break; - - case RIG_ELEMENT_NODAL: - resultPos = "Element nodal"; - break; - - case RIG_INTEGRATION_POINT: - resultPos = "Integration point"; - break; - - case RIG_ELEMENT: - resultPos = "Element"; - break; - default: - break; - } - if (compName == "") - { - overlayInfoText += QString("Cell result: %1, %2
").arg(resultPos).arg(fieldName); - } - else - { - overlayInfoText += QString("Cell result: %1, %2, %3
").arg(resultPos).arg(fieldName).arg(compName); - } - } - m_legendConfig()->setUiValuesFromLegendConfig(geoView->cellResult()->legendConfig()); geoView->updateLegendTextAndRanges(m_legendConfig(), m_currentTimeStep()); @@ -459,10 +486,6 @@ void Rim2dIntersectionView::updateLegends() { m_viewer->addColorLegendToBottomLeftCorner(legend); } - - overlayInfoText += "

"; - m_viewer->setInfoText(overlayInfoText); - m_viewer->showInfoText(true); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.h b/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.h index b5a50e4fa0..13a65aada3 100644 --- a/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.h +++ b/ApplicationCode/ProjectDataModel/Rim2dIntersectionView.h @@ -56,9 +56,10 @@ public: virtual bool isTimeStepDependentDataVisible() const override; - void updateLegends(); + void update3dInfo(); protected: + void updateLegends(); virtual void axisLabels(cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel) override; virtual void createDisplayModel() override; diff --git a/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp b/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp index 1ef1a6605b..65fd77ac90 100644 --- a/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp +++ b/ApplicationCode/ProjectDataModel/Rim3dOverlayInfoConfig.cpp @@ -728,7 +728,7 @@ void Rim3dOverlayInfoConfig::update3DInfo() { for (Rim2dIntersectionView* view : rimCase->intersectionViewCollection()->views()) { - view->updateLegends(); + view->update3dInfo(); } } }