Debug Tools : Add globalCellIndicesToOneBasedIJKText used as input to cell based range filter

This commit is contained in:
Magne Sjaastad
2018-05-31 15:21:47 +02:00
parent 083d6f04bf
commit 3505b9d31a

View File

@@ -18,6 +18,10 @@
#pragma once
#include "RigMainGrid.h"
#include <QString>
class RigActiveCellInfo;
class RigFemPartCollection;
class RigMainGrid;
@@ -26,7 +30,7 @@ class Rim3dView;
namespace cvf
{
class StructGridInterface;
class StructGridInterface;
}
class QString;
@@ -45,8 +49,34 @@ public:
static const RigActiveCellInfo* activeCellInfo(Rim3dView* rimView);
template<class InputIterator>
static QString globalCellIndicesToOneBasedIJKText(InputIterator first, InputIterator last, const RigMainGrid* mainGrid)
{
QString txt;
if (mainGrid)
{
while (first != last)
{
size_t globalCellIndex = *first;
size_t i, j, k;
mainGrid->ijkFromCellIndex(globalCellIndex, &i, &j, &k);
i++;
j++;
k++;
QString itemText = QString("%1 %2 %3").arg(i).arg(j).arg(k);
txt += itemText + "\n";
++first;
}
}
return txt;
}
private:
static RigMainGrid* eclipseMainGrid(RimCase* rimCase);
static RigFemPartCollection* geoMechPartCollection(RimCase* rimCase);
};