Improved logarithmic color legends for zero and negative values

p4#: 21804
This commit is contained in:
Magne Sjaastad
2013-06-03 13:08:11 +02:00
parent 1d3d13c927
commit 0021e2f861
7 changed files with 222 additions and 2 deletions

View File

@@ -334,3 +334,29 @@ void RimCellEdgeResultSlot::minMaxCellEdgeValues(double& min, double& max)
max = globalMax;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimCellEdgeResultSlot::posNegClosestToZero(double& pos, double& neg)
{
pos = HUGE_VAL;
neg = -HUGE_VAL;
size_t resultIndices[6];
this->gridScalarIndices(resultIndices);
size_t idx;
for (idx = 0; idx < 6; idx++)
{
if (resultIndices[idx] == cvf::UNDEFINED_SIZE_T) continue;
{
double localPos, localNeg;
m_reservoirView->currentGridCellResults()->cellResults()->posNegClosestToZero(resultIndices[idx], localPos, localNeg);
if (localPos > 0 && localPos < pos) pos = localPos;
if (localNeg < 0 && localNeg > neg) neg = localNeg;
}
}
}