#811, #812 WIP, Formation names coloring of cells. First shot. Works but needs refinment.

This commit is contained in:
Jacob Støren
2016-09-06 10:27:30 +02:00
parent ca6e650a72
commit c903e87dfd
28 changed files with 373 additions and 50 deletions

View File

@@ -50,40 +50,3 @@ private:
cvf::ref<RigFormationNames> m_formationNamesData;
};
class RigFormationNames: public cvf::Object
{
public:
int formationIndexFromKLayerIdx(size_t Kidx)
{
if(Kidx >= m_nameIndexPrKLayer.size()) return -1;
return m_nameIndexPrKLayer[Kidx];
}
QString formationNameFromKLayerIdx(size_t Kidx)
{
int idx = formationIndexFromKLayerIdx(Kidx);
if (idx >= m_formationNames.size()) return "";
if (idx == -1) return "";
return m_formationNames[idx];
}
void appendFormationRange(const QString& name, int kStartIdx, int kEndIdx)
{
CVF_ASSERT(kStartIdx <= kEndIdx);
int nameIdx = static_cast<int>(m_formationNames.size());
m_formationNames.push_back(name);
if (kEndIdx >= static_cast<int>(m_nameIndexPrKLayer.size())) m_nameIndexPrKLayer.resize(kEndIdx + 1, -1);
for (int kIdx = kStartIdx; kIdx <= kEndIdx; ++kIdx)
{
m_nameIndexPrKLayer[kIdx] = nameIdx;
}
}
private:
std::vector<int> m_nameIndexPrKLayer;
std::vector<QString> m_formationNames;
};