mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2426 Add working legends to 2D intersection Views. Refactor to make legend update code work from a separate view with separate legend configs. Make sure legend and results are updated as the main view is updated. Adjust legendconfig->setTitle to use QString
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include "RiaColorTables.h"
|
||||
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimIntersectionCollection.h"
|
||||
#include "RimViewLinker.h"
|
||||
|
||||
#include "RivTernarySaturationOverlayItem.h"
|
||||
@@ -146,7 +147,7 @@ void RimTernaryLegendConfig::fieldChangedByUi(const caf::PdmFieldHandle* changed
|
||||
updateLabelText();
|
||||
updateLegend();
|
||||
|
||||
Rim3dView* view = nullptr;
|
||||
RimGridView* view = nullptr;
|
||||
this->firstAncestorOrThisOfType(view);
|
||||
|
||||
if (view)
|
||||
@@ -158,6 +159,7 @@ void RimTernaryLegendConfig::fieldChangedByUi(const caf::PdmFieldHandle* changed
|
||||
}
|
||||
|
||||
view->updateCurrentTimeStepAndRedraw();
|
||||
view->crossSectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,6 +246,7 @@ void RimTernaryLegendConfig::setUiValuesFromLegendConfig(const RimTernaryLegendC
|
||||
{
|
||||
QString serializedObjectString = otherLegendConfig->writeObjectToXmlString();
|
||||
this->readObjectFromXmlString(serializedObjectString, caf::PdmDefaultObjectFactory::instance());
|
||||
this->updateLegend();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -316,6 +319,14 @@ void RimTernaryLegendConfig::defineUiOrdering(QString uiConfigName, caf::PdmUiOr
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RivTernarySaturationOverlayItem* RimTernaryLegendConfig::legend() const
|
||||
{
|
||||
return m_legend.p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -324,6 +335,14 @@ RivTernarySaturationOverlayItem* RimTernaryLegendConfig::legend()
|
||||
return m_legend.p();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimTernaryLegendConfig::setTitle(const QString& title)
|
||||
{
|
||||
m_legend->setTitle(cvfqt::Utils::toString(title));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -462,7 +481,7 @@ void RimTernaryLegendConfig::updateLabelText()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivTernaryScalarMapper* RimTernaryLegendConfig::scalarMapper()
|
||||
const RivTernaryScalarMapper* RimTernaryLegendConfig::scalarMapper() const
|
||||
{
|
||||
return m_scalarMapper.p();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user