riMULTXYZ: Added tolerances for CellEdge and Calculations

This commit is contained in:
Jacob Støren
2014-08-28 11:24:41 +02:00
parent 5377742bbc
commit edd7a671d9
3 changed files with 16 additions and 9 deletions

View File

@@ -150,7 +150,7 @@ void RivCellEdgeGeometryUtils::addCellEdgeResultsToDrawableGeo(
double scalarValue = cellEdgeResultAccessor->cellFaceScalar(cellIndex, static_cast<cvf::StructGridInterface::FaceType>(cubeFaceIdx));
if (scalarValue != HUGE_VAL && scalarValue != ignoredScalarValue)
if (!hideScalarValue(scalarValue, ignoredScalarValue, 1e-2))
{
edgeColor = edgeResultScalarMapper->mapToTextureCoord(scalarValue)[0];
}
@@ -178,6 +178,10 @@ void RivCellEdgeGeometryUtils::addCellEdgeResultsToDrawableGeo(
geo->setVertexAttribute(new cvf::FloatVertexAttribute("a_colorNegK", cellEdgeColorTextureCoordsArrays.at(5)));
}
bool RivCellEdgeGeometryUtils::hideScalarValue(double scalarValue, double scalarValueToHide, double tolerance)
{
return (scalarValue == HUGE_VAL || abs(scalarValue - scalarValueToHide) <= scalarValueToHide*tolerance);
}
//--------------------------------------------------------------------------------------------------
///
@@ -247,7 +251,7 @@ void RivCellEdgeGeometryUtils::addTernaryCellEdgeResultsToDrawableGeo(size_t tim
double scalarValue = cellEdgeResultAccessor->cellFaceScalar(cellIndex, static_cast<cvf::StructGridInterface::FaceType>(cubeFaceIdx));
if (scalarValue != HUGE_VAL && scalarValue != ignoredScalarValue)
if (!hideScalarValue(scalarValue, ignoredScalarValue, 1e-2))
{
edgeColor = edgeResultScalarMapper->mapToTextureCoord(scalarValue)[0];
}

View File

@@ -67,4 +67,6 @@ private:
size_t timeStepIndex,
RigCaseData* eclipseCase,
const RigGridBase* grid);
static bool hideScalarValue(double scalarValue, double scalarValueToHide, double tolerance);
};