RifEclipseDataTableFormatter. Renamed method to clearify its purpose

This commit is contained in:
Bjørn Erik Jensen 2018-08-29 08:41:06 +02:00
parent 6b5f7ed1d9
commit c4577084dc
3 changed files with 13 additions and 13 deletions

View File

@ -668,7 +668,7 @@ void RicWellPathExportCompletionDataFeatureImpl::generateCompsegTable(
formatter.add(intersection.gridName());
}
cvf::Vec3st ijk = intersection.gridLocalCellIJK();
formatter.addZeroBasedCellIndex(ijk.x()).addZeroBasedCellIndex(ijk.y()).addZeroBasedCellIndex(
formatter.addOneBasedCellIndex(ijk.x()).addOneBasedCellIndex(ijk.y()).addOneBasedCellIndex(
ijk.z());
formatter.add(completion.branchNumber());
@ -1127,10 +1127,10 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompdatTableUsingFormatte
formatter.add(gridName);
}
formatter.addZeroBasedCellIndex(data.completionDataGridCell().localCellIndexI())
.addZeroBasedCellIndex(data.completionDataGridCell().localCellIndexJ())
.addZeroBasedCellIndex(data.completionDataGridCell().localCellIndexK())
.addZeroBasedCellIndex(data.completionDataGridCell().localCellIndexK());
formatter.addOneBasedCellIndex(data.completionDataGridCell().localCellIndexI())
.addOneBasedCellIndex(data.completionDataGridCell().localCellIndexJ())
.addOneBasedCellIndex(data.completionDataGridCell().localCellIndexK())
.addOneBasedCellIndex(data.completionDataGridCell().localCellIndexK());
switch (data.connectionState())
{
case OPEN:
@ -1240,9 +1240,9 @@ void RicWellPathExportCompletionDataFeatureImpl::exportWpimultTableUsingFormatte
formatter.add(completion.wpimult());
formatter.addZeroBasedCellIndex(completion.completionDataGridCell().localCellIndexI())
.addZeroBasedCellIndex(completion.completionDataGridCell().localCellIndexJ())
.addZeroBasedCellIndex(completion.completionDataGridCell().localCellIndexK());
formatter.addOneBasedCellIndex(completion.completionDataGridCell().localCellIndexI())
.addOneBasedCellIndex(completion.completionDataGridCell().localCellIndexJ())
.addOneBasedCellIndex(completion.completionDataGridCell().localCellIndexK());
formatter.rowCompleted();
}

View File

@ -266,16 +266,16 @@ RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::add(size_t num)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::addZeroBasedCellIndex(size_t index)
RifEclipseDataTableFormatter& RifEclipseDataTableFormatter::addOneBasedCellIndex(size_t zeroBasedIndex)
{
size_t column = m_lineBuffer.size();
CVF_ASSERT(column < m_columns.size());
// Increase index by 1 to use Eclipse 1-based cell index instead of ResInsight 0-based
index++;
zeroBasedIndex++;
m_columns[column].width = std::max(measure(index), m_columns[column].width);
m_lineBuffer.push_back(format(index));
m_columns[column].width = std::max(measure(zeroBasedIndex), m_columns[column].width);
m_lineBuffer.push_back(format(zeroBasedIndex));
return *this;
}

View File

@ -116,7 +116,7 @@ public:
RifEclipseDataTableFormatter& add(double num);
RifEclipseDataTableFormatter& add(int num);
RifEclipseDataTableFormatter& add(size_t num);
RifEclipseDataTableFormatter& addZeroBasedCellIndex(size_t index);
RifEclipseDataTableFormatter& addOneBasedCellIndex(size_t zeroBasedIndex);
RifEclipseDataTableFormatter& addValueOrDefaultMarker(double value, double defaultValue);
RifEclipseDataTableFormatter& comment(const QString& str);
RifEclipseDataTableFormatter& addHorizontalLine(const QChar& str);