From ca7ebe16e678d858c3694c909562c426994baeff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Jensen?= Date: Fri, 15 Sep 2017 08:30:29 +0200 Subject: [PATCH] #1888 Curve appearance. Added curly braces and minor refactoring --- .../RicSummaryCurveCreator.cpp | 21 +++++++++++++------ .../RicSummaryCurveCreator.h | 2 +- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp index 72d43f5441..22482b6752 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.cpp @@ -260,7 +260,9 @@ QList RicSummaryCurveCreator::calculateValueOptions(cons itemNames.insert(name); } for (const auto& iName : itemNames) + { options.push_back(caf::PdmOptionItemInfo(iName, iName)); + } } } return options; @@ -482,10 +484,6 @@ void RicSummaryCurveCreator::defineUiOrdering(QString uiConfigName, caf::PdmUiOr } */ - - //caf::PdmUiGroup* curvesGroup = uiOrdering.addNewGroup("Curves"); - //curvesGroup->add(&m_selectedCurveTexts); - uiOrdering.skipRemainingFields(true); } @@ -499,7 +497,9 @@ std::set RicSummaryCurveCreator::findPossibleSummaryAd auto isVectorField = identifierAndField != nullptr && identifierAndField->summaryIdentifier() == RifEclipseSummaryAddress::INPUT_VECTOR_NAME; auto controllingIdentifierAndField = identifierAndField != nullptr ? lookupControllingField(identifierAndField) : nullptr; if (!isVectorField && controllingIdentifierAndField != nullptr && controllingIdentifierAndField->pdmField()->v().size() == 0) + { return addrUnion; + } for (RimSummaryCase* currCase : m_selectedCases) { @@ -528,7 +528,9 @@ std::set RicSummaryCurveCreator::findPossibleSummaryAd //if (!m_summaryFilter->isIncludedByFilter(allAddresses[i])) continue; if (addressSelected) + { addrUnion.insert(allAddresses[i]); + } } } } @@ -546,7 +548,9 @@ std::vector RicSummaryCurveC for (const auto& identifierAndFieldItem : identifierAndFieldList) { if (identifierAndFieldItem == identifierAndField) + { break; + } selections.push_back(identifierAndFieldItem); } return selections; @@ -554,6 +558,7 @@ std::vector RicSummaryCurveC //-------------------------------------------------------------------------------------------------- /// Returns the stringified value for the specified value in the specfied address object +/// Todo: Move this method to RicElipseSummaryAddress class //-------------------------------------------------------------------------------------------------- QString RicSummaryCurveCreator::getIdentifierTextFromAddress(RifEclipseSummaryAddress::SummaryIdentifierType itemTypeInput, const RifEclipseSummaryAddress &address) { @@ -582,7 +587,9 @@ RicSummaryCurveCreator::SummaryIdentifierAndField* RicSummaryCurveCreator::findI for (const auto& itemTypeInput : itemTypes.second) { if (pdmFieldHandle == itemTypeInput->pdmField()) + { return itemTypeInput; + } } } return nullptr; @@ -626,7 +633,9 @@ bool RicSummaryCurveCreator::isAddressSelected(const RifEclipseSummaryAddress &a } } if (!match) + { return false; + } } return true; } @@ -753,14 +762,14 @@ void RicSummaryCurveCreator::syncCurvesFromUiSelection() currentCurveDefs.begin(), currentCurveDefs.end(), std::inserter(newCurveDefs, newCurveDefs.end())); } - createCurvesFromCurveDefinitions(newCurveDefs, deleteCurves); + updateCurvesFromCurveDefinitions(newCurveDefs, deleteCurves); } } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicSummaryCurveCreator::createCurvesFromCurveDefinitions(const std::set >& curveDefsToAdd, +void RicSummaryCurveCreator::updateCurvesFromCurveDefinitions(const std::set >& curveDefsToAdd, const std::set& curvesToDelete) { RimSummaryCase* prevCase = nullptr; diff --git a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.h b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.h index 191d8e3cf9..5e2262d6e3 100644 --- a/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.h +++ b/ApplicationCode/Commands/SummaryPlotCommands/RicSummaryCurveCreator.h @@ -99,7 +99,7 @@ private: void loadDataAndUpdatePlot(); void syncCurvesFromUiSelection(); - void createCurvesFromCurveDefinitions(const std::set >& curveDefsToAdd, + void updateCurvesFromCurveDefinitions(const std::set >& curveDefsToAdd, const std::set& curvesToDelete); std::set getAllSummaryCaseNames(); std::set getAllSummaryWellNames();