Whitespace

This commit is contained in:
Magne Sjaastad
2017-12-14 11:35:24 +01:00
parent 71b7523e3c
commit dabdcd0aa4
2 changed files with 50 additions and 56 deletions

View File

@@ -28,8 +28,6 @@
#include "cafPdmUiPushButtonEditor.h"
CAF_PDM_SOURCE_INIT(RimSummaryCurveAutoName, "SummaryCurveAutoName");
//--------------------------------------------------------------------------------------------------
@@ -37,6 +35,7 @@ CAF_PDM_SOURCE_INIT(RimSummaryCurveAutoName, "SummaryCurveAutoName");
//--------------------------------------------------------------------------------------------------
RimSummaryCurveAutoName::RimSummaryCurveAutoName()
{
// clang-format off
CAF_PDM_InitObject("RimSummaryCurveAutoName", "", "", "");
CAF_PDM_InitField(&m_vectorName, "VectorName", true, "Vector Name", "", "", "");
@@ -50,12 +49,15 @@ RimSummaryCurveAutoName::RimSummaryCurveAutoName()
CAF_PDM_InitField(&m_aquiferNumber, "Aquifer", true, "Aquifer Number", "", "", "");
CAF_PDM_InitField(&m_caseName, "CaseName", true, "Case Name", "", "", "");
// clang-format on
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimSummaryCurveAutoName::curveName(const RifEclipseSummaryAddress& summaryAddress, const RimSummaryPlotNameHelper* nameHelper) const
QString RimSummaryCurveAutoName::curveName(const RifEclipseSummaryAddress& summaryAddress,
const RimSummaryPlotNameHelper* nameHelper) const
{
std::string text;
@@ -82,7 +84,7 @@ QString RimSummaryCurveAutoName::curveName(const RifEclipseSummaryAddress& summa
{
if (m_aquiferNumber)
{
if (text.size() > 0) text +=":";
if (text.size() > 0) text += ":";
text += std::to_string(summaryAddress.aquiferNumber());
}
}
@@ -94,7 +96,7 @@ QString RimSummaryCurveAutoName::curveName(const RifEclipseSummaryAddress& summa
bool skipSubString = nameHelper && nameHelper->isRegionInTitle();
if (!skipSubString)
{
if (text.size() > 0) text +=":";
if (text.size() > 0) text += ":";
text += std::to_string(summaryAddress.regionNumber());
}
}
@@ -123,9 +125,7 @@ QString RimSummaryCurveAutoName::curveName(const RifEclipseSummaryAddress& summa
}
}
break;
case RifEclipseSummaryAddress::SUMMARY_WELL:
{
appendWellName(text, summaryAddress, nameHelper);
case RifEclipseSummaryAddress::SUMMARY_WELL: { appendWellName(text, summaryAddress, nameHelper);
}
break;
case RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION:
@@ -135,9 +135,8 @@ QString RimSummaryCurveAutoName::curveName(const RifEclipseSummaryAddress& summa
if (m_completion)
{
if (text.size() > 0) text += ":";
text += std::to_string(summaryAddress.cellI()) + ", "
+ std::to_string(summaryAddress.cellJ()) + ", "
+ std::to_string(summaryAddress.cellK());
text += std::to_string(summaryAddress.cellI()) + ", " + std::to_string(summaryAddress.cellJ()) + ", " +
std::to_string(summaryAddress.cellK());
}
}
break;
@@ -155,9 +154,8 @@ QString RimSummaryCurveAutoName::curveName(const RifEclipseSummaryAddress& summa
if (m_completion)
{
if (text.size() > 0) text += ":";
text += std::to_string(summaryAddress.cellI()) + ", "
+ std::to_string(summaryAddress.cellJ()) + ", "
+ std::to_string(summaryAddress.cellK());
text += std::to_string(summaryAddress.cellI()) + ", " + std::to_string(summaryAddress.cellJ()) + ", " +
std::to_string(summaryAddress.cellK());
}
}
break;
@@ -177,9 +175,8 @@ QString RimSummaryCurveAutoName::curveName(const RifEclipseSummaryAddress& summa
if (m_completion)
{
if (text.size() > 0) text += ":";
text += std::to_string(summaryAddress.cellI()) + ", "
+ std::to_string(summaryAddress.cellJ()) + ", "
+ std::to_string(summaryAddress.cellK());
text += std::to_string(summaryAddress.cellI()) + ", " + std::to_string(summaryAddress.cellJ()) + ", " +
std::to_string(summaryAddress.cellK());
}
}
break;
@@ -190,9 +187,8 @@ QString RimSummaryCurveAutoName::curveName(const RifEclipseSummaryAddress& summa
if (m_completion)
{
if (text.size() > 0) text += ":";
text += std::to_string(summaryAddress.cellI()) + ", "
+ std::to_string(summaryAddress.cellJ()) + ", "
+ std::to_string(summaryAddress.cellK());
text += std::to_string(summaryAddress.cellI()) + ", " + std::to_string(summaryAddress.cellJ()) + ", " +
std::to_string(summaryAddress.cellK());
}
}
break;
@@ -235,7 +231,8 @@ void RimSummaryCurveAutoName::applySettings(const RimSummaryCurveAutoName& other
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryCurveAutoName::appendWellName(std::string& text, const RifEclipseSummaryAddress& summaryAddress, const RimSummaryPlotNameHelper* nameHelper) const
void RimSummaryCurveAutoName::appendWellName(std::string& text, const RifEclipseSummaryAddress& summaryAddress,
const RimSummaryPlotNameHelper* nameHelper) const
{
bool skipSubString = nameHelper && nameHelper->isWellNameInTitle();
if (skipSubString) return;
@@ -262,7 +259,8 @@ void RimSummaryCurveAutoName::appendLgrName(std::string& text, const RifEclipseS
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimSummaryCurveAutoName::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
void RimSummaryCurveAutoName::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue,
const QVariant& newValue)
{
// NOTE: The curve filter is parent object of a summary curve, and the update is supposed to update
// the first parent, not the grandparent. This is the reason for not using firstAncestorOrThisOfType()
@@ -303,4 +301,3 @@ void RimSummaryCurveAutoName::defineUiOrdering(QString uiConfigName, caf::PdmUiO
uiOrdering.skipRemainingFields();
}

View File

@@ -16,35 +16,33 @@
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafPdmField.h"
#include "cafPdmObject.h"
class RifEclipseSummaryAddress;
class RimSummaryPlotNameHelper;
class RimSummaryCurveAutoName : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimSummaryCurveAutoName();;
RimSummaryCurveAutoName();
QString curveName(const RifEclipseSummaryAddress& summaryAddress, const RimSummaryPlotNameHelper* nameHelper) const;
void applySettings(const RimSummaryCurveAutoName& other);
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
protected:
private:
friend class RimSummaryCurve;
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue,
const QVariant& newValue) override;
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
private:
void appendWellName(std::string& text, const RifEclipseSummaryAddress& summaryAddress, const RimSummaryPlotNameHelper* nameHelper) const;
void appendWellName(std::string& text, const RifEclipseSummaryAddress& summaryAddress,
const RimSummaryPlotNameHelper* nameHelper) const;
void appendLgrName(std::string& text, const RifEclipseSummaryAddress& summaryAddress) const;
private:
@@ -62,4 +60,3 @@ private:
caf::PdmField<bool> m_showAdvancedProperties;
};