mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2438 2d Intersection View: Update intersection view on 3dOverlayInfo update
This commit is contained in:
parent
022d2ffd2d
commit
f909a7ea27
@ -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 += "<b>--" + ownerCase()->caseUserDescription() + "--</b>";
|
||||
}
|
||||
|
||||
RimGeoMechView * geoView = nullptr;
|
||||
m_intersection->firstAncestorOrThisOfType(geoView);
|
||||
if (geoView && geoView->overlayInfoConfig()->showCaseInfo())
|
||||
{
|
||||
overlayInfoText += "<b>--" + ownerCase()->caseUserDescription() + "--</b>";
|
||||
}
|
||||
|
||||
overlayInfoText += "<p>";
|
||||
overlayInfoText += "<b>Intersection:</b> " + m_intersection->name() + "<br>";
|
||||
|
||||
if (m_intersection->simulationWell())
|
||||
{
|
||||
overlayInfoText += "<b>Simulation Well:</b> " + m_intersection->simulationWell()->name() + "<br>";;
|
||||
}
|
||||
else if (m_intersection->wellPath())
|
||||
{
|
||||
overlayInfoText += "<b>Well Path:</b> " + m_intersection->wellPath()->name() + "<br>";;
|
||||
}
|
||||
|
||||
if (eclView)
|
||||
{
|
||||
if (eclView->overlayInfoConfig()->showAnimProgress())
|
||||
{
|
||||
m_viewer->showAnimationProgress(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_viewer->showAnimationProgress(false);
|
||||
}
|
||||
|
||||
if (eclView->overlayInfoConfig()->showResultInfo())
|
||||
{
|
||||
overlayInfoText += "<b>Cell Result:</b> " + eclView->cellResult()->resultVariableUiShortName() + "<br>";
|
||||
}
|
||||
}
|
||||
|
||||
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("<b>Cell result:</b> %1, %2<br>").arg(resultPos).arg(fieldName);
|
||||
}
|
||||
else
|
||||
{
|
||||
overlayInfoText += QString("<b>Cell result:</b> %1, %2, %3<br>").arg(resultPos).arg(fieldName).arg(compName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
overlayInfoText += "</p>";
|
||||
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 += "<b>--" + ownerCase()->caseUserDescription() + "--</b>";
|
||||
}
|
||||
|
||||
RimGeoMechView * geoView = nullptr;
|
||||
m_intersection->firstAncestorOrThisOfType(geoView);
|
||||
if (geoView && geoView->overlayInfoConfig()->showCaseInfo())
|
||||
{
|
||||
overlayInfoText += "<b>--" + ownerCase()->caseUserDescription() + "--</b>";
|
||||
}
|
||||
|
||||
overlayInfoText += "<p>";
|
||||
overlayInfoText += "<b>Intersection:</b> " + m_intersection->name() + "<br>";
|
||||
|
||||
if (m_intersection->simulationWell())
|
||||
{
|
||||
overlayInfoText += "<b>Simulation Well:</b> " + m_intersection->simulationWell()->name() + "<br>";;
|
||||
}
|
||||
else if (m_intersection->wellPath())
|
||||
{
|
||||
overlayInfoText += "<b>Well Path:</b> " + m_intersection->wellPath()->name() + "<br>";;
|
||||
}
|
||||
|
||||
cvf::OverlayItem* legend = nullptr;
|
||||
|
||||
if (eclView)
|
||||
{
|
||||
if (eclView->overlayInfoConfig()->showAnimProgress())
|
||||
{
|
||||
m_viewer->showAnimationProgress(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_viewer->showAnimationProgress(false);
|
||||
}
|
||||
|
||||
if (eclView->overlayInfoConfig()->showResultInfo())
|
||||
{
|
||||
overlayInfoText += "<b>Cell Result:</b> " + eclView->cellResult()->resultVariableUiShortName() + "<br>";
|
||||
}
|
||||
|
||||
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("<b>Cell result:</b> %1, %2<br>").arg(resultPos).arg(fieldName);
|
||||
}
|
||||
else
|
||||
{
|
||||
overlayInfoText += QString("<b>Cell result:</b> %1, %2, %3<br>").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 += "</p>";
|
||||
m_viewer->setInfoText(overlayInfoText);
|
||||
m_viewer->showInfoText(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -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;
|
||||
|
@ -728,7 +728,7 @@ void Rim3dOverlayInfoConfig::update3DInfo()
|
||||
{
|
||||
for (Rim2dIntersectionView* view : rimCase->intersectionViewCollection()->views())
|
||||
{
|
||||
view->updateLegends();
|
||||
view->update3dInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user