From fbaa49b72c0c575a358a4f581b1f7094fd47f499 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 25 Oct 2018 22:15:23 +0200 Subject: [PATCH] #3565 Cell Edge : Move field private and whitespace fixes --- .../ProjectDataModel/RimCellEdgeColors.cpp | 16 +++- .../ProjectDataModel/RimCellEdgeColors.h | 85 +++++++++---------- .../ProjectDataModel/RimEclipseCase.cpp | 4 +- 3 files changed, 55 insertions(+), 50 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimCellEdgeColors.cpp b/ApplicationCode/ProjectDataModel/RimCellEdgeColors.cpp index ddc9c5f4b4..5a5de5301e 100644 --- a/ApplicationCode/ProjectDataModel/RimCellEdgeColors.cpp +++ b/ApplicationCode/ProjectDataModel/RimCellEdgeColors.cpp @@ -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; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimCellEdgeColors.h b/ApplicationCode/ProjectDataModel/RimCellEdgeColors.h index 05f4fde9e0..49a63fc9f7 100644 --- a/ApplicationCode/ProjectDataModel/RimCellEdgeColors.h +++ b/ApplicationCode/ProjectDataModel/RimCellEdgeColors.h @@ -67,65 +67,62 @@ public: typedef caf::AppEnum EdgeFaceEnum; - void setReservoirView(RimEclipseView* ownerReservoirView); - void setEclipseCase(RimEclipseCase* eclipseCase); + void setReservoirView(RimEclipseView* ownerReservoirView); + void setEclipseCase(RimEclipseCase* eclipseCase); - void setResultVariable(const QString& variableName); - QString resultVariable() const; - QString resultVariableUiName() const; - QString resultVariableUiShortName() const; + void setResultVariable(const QString& variableName); + QString resultVariable() const; + QString resultVariableUiName() const; + QString resultVariableUiShortName() const; - caf::PdmField enableCellEdgeColors; + void setActive(bool active); - double ignoredScalarValue() { return m_ignoredResultScalar; } - void gridScalarIndices(size_t resultIndices[6]); - void cellEdgeMetaData(std::vector* metaData); + double ignoredScalarValue() { return m_ignoredResultScalar; } + void gridScalarIndices(size_t resultIndices[6]); + void cellEdgeMetaData(std::vector* metaData); - void loadResult(); - bool hasResult() const; - bool hasCategoryResult() const; - bool isUsingSingleVariable() const; + void loadResult(); + bool hasResult() const; + bool hasCategoryResult() const; + bool isUsingSingleVariable() const; - RimEclipseCellColors* singleVarEdgeResultColors(); - RimRegularLegendConfig* legendConfig(); - PropertyType propertyType() const; + RimEclipseCellColors* singleVarEdgeResultColors(); + RimRegularLegendConfig* legendConfig(); + PropertyType propertyType() const; - void minMaxCellEdgeValues(double& min, double& max); - void posNegClosestToZero(double& pos, double& neg); + void minMaxCellEdgeValues(double& min, double& max); + void posNegClosestToZero(double& pos, double& neg); - void updateUiFieldsFromActiveResult(); + void updateUiFieldsFromActiveResult(); protected: + void initAfterRead() override; + void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; + QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly ) override; + void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override; + void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override; - void initAfterRead() override; - void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override; - QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly ) override; - void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override; - void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "") override; - - QStringList findResultVariableNames(); + QStringList findResultVariableNames(); private: - void resetResultIndices(); - void updateIgnoredScalarValue(); + void resetResultIndices(); + void updateIgnoredScalarValue(); - void gridScalarResultNames(std::vector* resultNames); + void gridScalarResultNames(std::vector* resultNames); - caf::PdmFieldHandle* objectToggleField() override; + caf::PdmFieldHandle* objectToggleField() override; - caf::PdmField m_resultVariable; - caf::PdmField useXVariable; - caf::PdmField useYVariable; - caf::PdmField useZVariable; + caf::PdmField m_enableCellEdgeColors; + caf::PdmField m_resultVariable; + caf::PdmField useXVariable; + caf::PdmField useYVariable; + caf::PdmField useZVariable; - std::array, 6 > m_resultNameToIndexPairs; - caf::PdmPointer m_reservoirView; - double m_ignoredResultScalar; - - - caf::PdmField > m_propertyType; - caf::PdmChildField m_legendConfig; - caf::PdmChildField m_singleVarEdgeResultColors; + std::array, 6> m_resultNameToIndexPairs; + caf::PdmPointer m_reservoirView; + double m_ignoredResultScalar; + caf::PdmField> m_propertyType; + caf::PdmChildField m_legendConfig; + caf::PdmChildField m_singleVarEdgeResultColors; }; - diff --git a/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp b/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp index bc11ff9edd..5184b41960 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseCase.cpp @@ -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(); }