#3565 Cell Edge : Move field private and whitespace fixes

This commit is contained in:
Magne Sjaastad 2018-10-25 22:15:23 +02:00
parent fb57cf048d
commit fbaa49b72c
3 changed files with 55 additions and 50 deletions

View File

@ -55,7 +55,7 @@ RimCellEdgeColors::RimCellEdgeColors()
{
CAF_PDM_InitObject("Cell Edge Result", ":/EdgeResult_1.png", "", "");
CAF_PDM_InitField(&enableCellEdgeColors, "EnableCellEdgeColors", true, "Enable Cell Edge Results", "", "", "");
CAF_PDM_InitField(&m_enableCellEdgeColors, "EnableCellEdgeColors", true, "Enable Cell Edge Results", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_propertyType, "propertyType", "Property Type", "", "", "");
@ -98,7 +98,7 @@ void RimCellEdgeColors::setReservoirView(RimEclipseView* ownerReservoirView)
//--------------------------------------------------------------------------------------------------
void RimCellEdgeColors::loadResult()
{
if (!enableCellEdgeColors) return;
if (!m_enableCellEdgeColors) return;
if (!m_reservoirView->currentGridCellResults()) return;
if (isUsingSingleVariable())
@ -396,7 +396,7 @@ void RimCellEdgeColors::resetResultIndices()
//--------------------------------------------------------------------------------------------------
bool RimCellEdgeColors::hasResult() const
{
if (!enableCellEdgeColors()) return false;
if (!m_enableCellEdgeColors()) return false;
if (isUsingSingleVariable() && m_singleVarEdgeResultColors->isFlowDiagOrInjectionFlooding())
{
@ -568,12 +568,20 @@ QString RimCellEdgeColors::resultVariableUiShortName() const
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCellEdgeColors::setActive(bool active)
{
m_enableCellEdgeColors = active;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* RimCellEdgeColors::objectToggleField()
{
return &enableCellEdgeColors;
return &m_enableCellEdgeColors;
}
//--------------------------------------------------------------------------------------------------

View File

@ -75,7 +75,7 @@ public:
QString resultVariableUiName() const;
QString resultVariableUiShortName() const;
caf::PdmField<bool> enableCellEdgeColors;
void setActive(bool active);
double ignoredScalarValue() { return m_ignoredResultScalar; }
void gridScalarIndices(size_t resultIndices[6]);
@ -96,7 +96,6 @@ public:
void updateUiFieldsFromActiveResult();
protected:
void initAfterRead() override;
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly ) override;
@ -113,6 +112,7 @@ private:
caf::PdmFieldHandle* objectToggleField() override;
caf::PdmField<bool> m_enableCellEdgeColors;
caf::PdmField<QString> m_resultVariable;
caf::PdmField<bool> useXVariable;
caf::PdmField<bool> useYVariable;
@ -122,10 +122,7 @@ private:
caf::PdmPointer<RimEclipseView> m_reservoirView;
double m_ignoredResultScalar;
caf::PdmField<caf::AppEnum<PropertyType>> m_propertyType;
caf::PdmChildField<RimRegularLegendConfig*> m_legendConfig;
caf::PdmChildField<RimEclipseCellColors*> m_singleVarEdgeResultColors;
};

View File

@ -272,7 +272,7 @@ RimEclipseView* RimEclipseCase::createAndAddReservoirView()
rimEclipseView->hasUserRequestedAnimation = true;
rimEclipseView->cellEdgeResult()->setResultVariable("MULT");
rimEclipseView->cellEdgeResult()->enableCellEdgeColors = false;
rimEclipseView->cellEdgeResult()->setActive(false);
rimEclipseView->fractureColors()->setDefaultResultName();
}
@ -356,7 +356,7 @@ Rim2dEclipseView* RimEclipseCase::create2dContourMap()
contourMap->hasUserRequestedAnimation = true;
contourMap->cellEdgeResult()->setResultVariable("MULT");
contourMap->cellEdgeResult()->enableCellEdgeColors = false;
contourMap->cellEdgeResult()->setActive(false);
contourMap->fractureColors()->setDefaultResultName();
}