Legend config: Do not show two configs when loading new case

This commit is contained in:
Magne Sjaastad 2014-06-13 08:12:45 +02:00
parent a29a388df2
commit 6a20f16de1
4 changed files with 25 additions and 8 deletions

View File

@ -174,8 +174,8 @@ RimReservoirView::RimReservoirView()
this->cellResult()->setReservoirView(this);
this->cellResult()->legendConfig()->setReservoirView(this);
this->cellResult()->legendConfig()->setPosition(cvf::Vec2ui(10, 120));
this->cellEdgeResult()->setReservoirView(this);
this->cellEdgeResult()->legendConfig()->setReservoirView(this);
this->cellEdgeResult()->legendConfig()->setPosition(cvf::Vec2ui(10, 320));

View File

@ -47,7 +47,7 @@ public:
RimDefines::PorosityModelType porosityModel() const { return m_porosityModel(); }
void setPorosityModel(RimDefines::PorosityModelType val);
QString resultVariable() const { return m_resultVariable(); }
void setResultVariable(const QString& val);
virtual void setResultVariable(const QString& val);
void setPorosityModelUiFieldHidden(bool hide);
void loadResult();

View File

@ -35,14 +35,18 @@ RimResultSlot::RimResultSlot()
CAF_PDM_InitObject("Result Slot", "", "", "");
CAF_PDM_InitFieldNoDefault(&legendConfig, "LegendDefinition", "Legend Definition", "", "", "");
this->legendConfig = new RimLegendConfig();
this->legendConfig.setUiHidden(true);
this->legendConfig.setUiChildrenHidden(true);
CAF_PDM_InitFieldNoDefault(&m_legendConfigData, "ResultVarLegendDefinitionList", "", "", "", "");
m_legendConfigData.setUiHidden(true);
m_legendConfigData.setUiChildrenHidden(true);
CAF_PDM_InitFieldNoDefault(&ternaryLegendConfig, "TernaryLegendDefinition", "Ternary Legend Definition", "", "", "");
ternaryLegendConfig = new RimTernaryLegendConfig();
legendConfig = new RimLegendConfig();
this->ternaryLegendConfig = new RimTernaryLegendConfig();
this->ternaryLegendConfig.setUiHidden(true);
this->ternaryLegendConfig.setUiChildrenHidden(true);
}
//--------------------------------------------------------------------------------------------------
@ -73,6 +77,8 @@ void RimResultSlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, co
{
if (m_reservoirView) m_reservoirView->animationMode = true;
}
RiuMainWindow::instance()->uiPdmModel()->updateUiSubTree(this);
}
if (m_reservoirView) m_reservoirView->createDisplayModelAndRedraw();
@ -128,7 +134,6 @@ void RimResultSlot::changeLegendConfig(QString resultVarNameOfNewLegend)
this->legendConfig.setUiChildrenHidden(false);
}
RiuMainWindow::instance()->uiPdmModel()->updateUiSubTree(this);
}
//--------------------------------------------------------------------------------------------------
@ -159,6 +164,16 @@ void RimResultSlot::setReservoirView(RimReservoirView* ownerReservoirView)
(*it)->setReservoirView(ownerReservoirView);
}
if (ternaryLegendConfig) ternaryLegendConfig->setReservoirView(ownerReservoirView);
this->ternaryLegendConfig()->setReservoirView(ownerReservoirView);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimResultSlot::setResultVariable(const QString& val)
{
RimResultDefinition::setResultVariable(val);
this->changeLegendConfig(val);
}

View File

@ -43,7 +43,9 @@ public:
caf::PdmField<RimTernaryLegendConfig*> ternaryLegendConfig;
// Overridden methods
virtual void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue );
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue);
virtual void setResultVariable(const QString& resultName);
protected:
virtual void initAfterRead();