mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#254 Show fault colors in combination with cell edge colors
This commit is contained in:
@@ -51,6 +51,7 @@ void RivCellEdgeGeometryUtils::addCellEdgeResultsToDrawableGeo(
|
|||||||
const cvf::StructGridQuadToCellFaceMapper* quadToCellFaceMapper,
|
const cvf::StructGridQuadToCellFaceMapper* quadToCellFaceMapper,
|
||||||
cvf::DrawableGeo* geo,
|
cvf::DrawableGeo* geo,
|
||||||
size_t gridIndex,
|
size_t gridIndex,
|
||||||
|
bool useDefaultValueForHugeVals,
|
||||||
float opacityLevel)
|
float opacityLevel)
|
||||||
{
|
{
|
||||||
RigCaseData* eclipseCase = cellResultColors->reservoirView()->eclipseCase()->reservoirData();
|
RigCaseData* eclipseCase = cellResultColors->reservoirView()->eclipseCase()->reservoirData();
|
||||||
@@ -117,9 +118,13 @@ void RivCellEdgeGeometryUtils::addCellEdgeResultsToDrawableGeo(
|
|||||||
|
|
||||||
{
|
{
|
||||||
float cellColorTextureCoord = 0.5f; // If no results exists, the texture will have a special color
|
float cellColorTextureCoord = 0.5f; // If no results exists, the texture will have a special color
|
||||||
|
if (useDefaultValueForHugeVals || scalarValue != HUGE_VAL)
|
||||||
|
{
|
||||||
if (scalarValue != HUGE_VAL)
|
if (scalarValue != HUGE_VAL)
|
||||||
{
|
{
|
||||||
cellColorTextureCoord = cellResultScalarMapper->mapToTextureCoord(scalarValue)[0];
|
cellColorTextureCoord = cellResultScalarMapper->mapToTextureCoord(scalarValue)[0];
|
||||||
|
}
|
||||||
|
|
||||||
// If we are dealing with wellcells, the default is transparent.
|
// If we are dealing with wellcells, the default is transparent.
|
||||||
// we need to make cells opaque if there are no wellpipe through them.
|
// we need to make cells opaque if there are no wellpipe through them.
|
||||||
if (opacityLevel < 1.0f)
|
if (opacityLevel < 1.0f)
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ public:
|
|||||||
const cvf::StructGridQuadToCellFaceMapper* quadToCellFaceMapper,
|
const cvf::StructGridQuadToCellFaceMapper* quadToCellFaceMapper,
|
||||||
cvf::DrawableGeo* geo,
|
cvf::DrawableGeo* geo,
|
||||||
size_t gridIndex,
|
size_t gridIndex,
|
||||||
|
bool useDefaultValueForHugeVals,
|
||||||
float opacityLevel);
|
float opacityLevel);
|
||||||
|
|
||||||
static void addTernaryCellEdgeResultsToDrawableGeo(size_t timeStepIndex,
|
static void addTernaryCellEdgeResultsToDrawableGeo(size_t timeStepIndex,
|
||||||
|
|||||||
@@ -90,12 +90,23 @@ cvf::ref<cvf::Effect> RivScalarMapperUtils::createCellEdgeEffect(cvf::DrawableGe
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RivCellEdgeGeometryUtils::addCellEdgeResultsToDrawableGeo(timeStepIndex, cellResultColors, cellEdgeResultColors,
|
bool useDefaultValueForHugeVals = false;
|
||||||
quadToCellFaceMapper, dg, gridIndex, opacityLevel);
|
if (!cellResultColors->hasResult())
|
||||||
|
{
|
||||||
|
useDefaultValueForHugeVals = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
RivCellEdgeGeometryUtils::addCellEdgeResultsToDrawableGeo(timeStepIndex, cellResultColors, cellEdgeResultColors,
|
||||||
|
quadToCellFaceMapper, dg, gridIndex, useDefaultValueForHugeVals, opacityLevel);
|
||||||
|
|
||||||
|
if (cellResultColors->hasResult())
|
||||||
|
{
|
||||||
|
// If no scalar mapper is set for the effect, a default color is used to fill the texture
|
||||||
|
// This is what we want when the fault colors should be visible in combination with cell edge
|
||||||
cvf::ScalarMapper* cellScalarMapper = cellResultColors->legendConfig()->scalarMapper();
|
cvf::ScalarMapper* cellScalarMapper = cellResultColors->legendConfig()->scalarMapper();
|
||||||
cellFaceEffectGen.setScalarMapper(cellScalarMapper);
|
cellFaceEffectGen.setScalarMapper(cellScalarMapper);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
cellFaceEffectGen.setOpacityLevel(opacityLevel);
|
cellFaceEffectGen.setOpacityLevel(opacityLevel);
|
||||||
cellFaceEffectGen.setDefaultCellColor(defaultColor);
|
cellFaceEffectGen.setDefaultCellColor(defaultColor);
|
||||||
|
|||||||
Reference in New Issue
Block a user