#559 : Linked Views: Linking legend definitions

This commit is contained in:
Magne Sjaastad
2016-12-09 20:36:31 +01:00
parent 2692abe7fe
commit 3fabe5f8b5
8 changed files with 144 additions and 11 deletions

View File

@@ -19,15 +19,17 @@
#include "RimTernaryLegendConfig.h"
#include "cafPdmUiPushButtonEditor.h"
#include "cafPdmUiTextEditor.h"
#include "RiaApplication.h"
#include "RimEclipseView.h"
#include "RimViewLinker.h"
#include "RivTernarySaturationOverlayItem.h"
#include "RivTernaryScalarMapper.h"
#include "cafPdmUiPushButtonEditor.h"
#include "cafPdmUiTextEditor.h"
#include "cvfqtUtils.h"
#include <cmath>
@@ -152,6 +154,18 @@ void RimTernaryLegendConfig::fieldChangedByUi(const caf::PdmFieldHandle* changed
updateLabelText();
updateLegend();
RimView* view = nullptr;
this->firstAncestorOrThisOfType(view);
if (view)
{
RimViewLinker* viewLinker = view->assosiatedViewLinker();
if (viewLinker)
{
viewLinker->updateCellResult();
}
}
if (m_reservoirView) m_reservoirView->updateCurrentTimeStepAndRedraw();
}
@@ -231,6 +245,24 @@ void RimTernaryLegendConfig::recreateLegend()
updateLegend();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimTernaryLegendConfig::setUiValuesFromLegendConfig(const RimTernaryLegendConfig* otherLegendConfig)
{
this->precision = otherLegendConfig->precision;
this->rangeMode = otherLegendConfig->rangeMode;
this->userDefinedMaxValueSoil = otherLegendConfig->userDefinedMaxValueSoil;
this->userDefinedMinValueSoil = otherLegendConfig->userDefinedMinValueSoil;
this->userDefinedMaxValueSgas = otherLegendConfig->userDefinedMaxValueSgas;
this->userDefinedMinValueSgas = otherLegendConfig->userDefinedMinValueSgas;
this->userDefinedMaxValueSwat = otherLegendConfig->userDefinedMaxValueSwat;
this->userDefinedMinValueSwat = otherLegendConfig->userDefinedMinValueSwat;
this->applyLocalMinMax = otherLegendConfig->applyLocalMinMax;
this->applyGlobalMinMax = otherLegendConfig->applyGlobalMinMax;
this->applyFullRangeMinMax = otherLegendConfig->applyFullRangeMinMax;
}
//--------------------------------------------------------------------------------------------------
/// Rounding the double value to given number of significant digits
//--------------------------------------------------------------------------------------------------