mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#559 : Linked Views: Linking legend definitions
This commit is contained in:
@@ -66,9 +66,10 @@ RimViewController::RimViewController(void)
|
||||
CAF_PDM_InitFieldNoDefault(&m_managedView, "ManagedView", "Linked View", "", "", "");
|
||||
m_managedView.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
|
||||
CAF_PDM_InitField(&m_syncCamera, "SyncCamera", true, "Camera", "", "", "");
|
||||
CAF_PDM_InitField(&m_syncTimeStep, "SyncTimeStep", true, "Time Step", "", "", "");
|
||||
CAF_PDM_InitField(&m_syncCellResult, "SyncCellResult", false, "Cell Color Result", "", "", "");
|
||||
CAF_PDM_InitField(&m_syncCamera, "SyncCamera", true, "Camera", "", "", "");
|
||||
CAF_PDM_InitField(&m_syncTimeStep, "SyncTimeStep", true, "Time Step", "", "", "");
|
||||
CAF_PDM_InitField(&m_syncCellResult, "SyncCellResult", false, "Cell Result", "", "", "");
|
||||
CAF_PDM_InitField(&m_syncLegendDefinitions, "SyncLegendDefinitions", true, " Legend Definition", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_syncVisibleCells, "SyncVisibleCells", false, "Visible Cells", "", "", "");
|
||||
/// We do not support this. Consider to remove sometime
|
||||
@@ -185,6 +186,10 @@ void RimViewController::fieldChangedByUi(const caf::PdmFieldHandle* changedField
|
||||
managedGeoView()->cellResult()->updateIconState();
|
||||
}
|
||||
}
|
||||
else if (changedField == &m_syncLegendDefinitions)
|
||||
{
|
||||
updateLegendDefinitions();
|
||||
}
|
||||
else if (changedField == &m_syncRangeFilters)
|
||||
{
|
||||
if (!m_syncRangeFilters)
|
||||
@@ -365,6 +370,7 @@ void RimViewController::updateOptionSensitivity()
|
||||
{
|
||||
isMasterAndDependentViewDifferentType = true;
|
||||
}
|
||||
|
||||
if (geoMasterView && !managedGeoView())
|
||||
{
|
||||
isMasterAndDependentViewDifferentType = true;
|
||||
@@ -374,10 +380,22 @@ void RimViewController::updateOptionSensitivity()
|
||||
{
|
||||
this->m_syncCellResult.uiCapability()->setUiReadOnly(true);
|
||||
this->m_syncCellResult = false;
|
||||
|
||||
this->m_syncLegendDefinitions.uiCapability()->setUiReadOnly(true);
|
||||
this->m_syncLegendDefinitions = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->m_syncCellResult.uiCapability()->setUiReadOnly(false);
|
||||
|
||||
if (this->m_syncCellResult)
|
||||
{
|
||||
this->m_syncLegendDefinitions.uiCapability()->setUiReadOnly(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->m_syncLegendDefinitions.uiCapability()->setUiReadOnly(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (isPropertyFilterControlPossible())
|
||||
@@ -390,7 +408,6 @@ void RimViewController::updateOptionSensitivity()
|
||||
this->m_syncPropertyFilters = false;
|
||||
}
|
||||
|
||||
|
||||
if (isRangeFilterControlPossible())
|
||||
{
|
||||
this->m_syncRangeFilters.uiCapability()->setUiReadOnly(false);
|
||||
@@ -440,6 +457,7 @@ void RimViewController::defineUiOrdering(QString uiConfigName, caf::PdmUiOrderin
|
||||
scriptGroup->add(&m_syncCamera);
|
||||
scriptGroup->add(&m_syncTimeStep);
|
||||
scriptGroup->add(&m_syncCellResult);
|
||||
scriptGroup->add(&m_syncLegendDefinitions);
|
||||
|
||||
caf::PdmUiGroup* visibleCells = uiOrdering.addNewGroup("Link Cell Filters");
|
||||
visibleCells->add(&m_syncVisibleCells);
|
||||
@@ -498,6 +516,17 @@ void RimViewController::updateResultColorsControl()
|
||||
viewLinker->updateCellResult();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewController::updateLegendDefinitions()
|
||||
{
|
||||
if (!this->isLegendDefinitionsControlled()) return;
|
||||
|
||||
RimViewLinker* viewLinker = ownerViewLinker();
|
||||
viewLinker->updateCellResult();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -714,6 +743,21 @@ bool RimViewController::isResultColorControlled()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimViewController::isLegendDefinitionsControlled()
|
||||
{
|
||||
if (ownerViewLinker()->isActive() && this->m_isActive())
|
||||
{
|
||||
return m_syncLegendDefinitions;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user