From 9428b72df4a3e730febab483ab0d27bd4f590c38 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 13 Aug 2014 09:24:04 +0200 Subject: [PATCH] Cell edge now handles also ternary --- .../RivCellEdgeEffectGenerator.cpp | 322 +++++++++++++----- .../RivCellEdgeEffectGenerator.h | 21 +- .../ModelVisualization/RivGridPartMgr.cpp | 27 +- 3 files changed, 274 insertions(+), 96 deletions(-) diff --git a/ApplicationCode/ModelVisualization/RivCellEdgeEffectGenerator.cpp b/ApplicationCode/ModelVisualization/RivCellEdgeEffectGenerator.cpp index 195f75f2aa..c46ec71451 100644 --- a/ApplicationCode/ModelVisualization/RivCellEdgeEffectGenerator.cpp +++ b/ApplicationCode/ModelVisualization/RivCellEdgeEffectGenerator.cpp @@ -18,6 +18,8 @@ #include "RiaStdInclude.h" +#include "RivCellEdgeEffectGenerator.h" + #include "RigCaseCellResultsData.h" #include "RigCaseData.h" #include "RigCellEdgeResultAccessor.h" @@ -31,10 +33,12 @@ #include "RimResultSlot.h" #include "RimWellCollection.h" -#include "RivCellEdgeEffectGenerator.h" +#include "RivTernaryScalarMapper.h" +#include "RimTernaryLegendConfig.h" #include "cvfStructGridGeometryGenerator.h" #include "cvfqtUtils.h" +#include "RivTernaryTextureCoordsCreator.h" //-------------------------------------------------------------------------------------------------- @@ -85,7 +89,7 @@ void RivCellEdgeGeometryGenerator::addCellEdgeResultsToDrawableGeo( cellEdgeColorTextureCoordsArrays.push_back(colorArray.p()); } - cvf::ScalarMapper* cellResultScalarMapper = cellResultSlot->legendConfig()->scalarMapper(); + cvf::ScalarMapper* cellResultScalarMapper = cellResultSlot->legendConfig()->scalarMapper(); cvf::ScalarMapper* edgeResultScalarMapper = cellEdgeResultSlot->legendConfig()->scalarMapper(); double ignoredScalarValue = cellEdgeResultSlot->ignoredScalarValue(); @@ -112,39 +116,42 @@ void RivCellEdgeGeometryGenerator::addCellEdgeResultsToDrawableGeo( faceIndexArray->set(quadIdx * 4 + 2, quadToCellFace->cellFace(quadIdx) ); faceIndexArray->set(quadIdx * 4 + 3, quadToCellFace->cellFace(quadIdx) ); - float cellColorTextureCoord = 0.5f; // If no results exists, the texture will have a special color - size_t cellIndex = quadToCellFace->cellIndex(quadIdx); - { + size_t cellIndex = quadToCellFace->cellIndex(quadIdx); + { cvf::StructGridInterface::FaceType cellFace = quadToCellFace->cellFace(quadIdx); - double scalarValue = cellCenterDataAccessObject->cellFaceScalar(cellIndex, cellFace); + double scalarValue = cellCenterDataAccessObject->cellFaceScalar(cellIndex, cellFace); - if (scalarValue != HUGE_VAL) - { - cellColorTextureCoord = cellResultScalarMapper->mapToTextureCoord(scalarValue)[0]; - // If we are dealing with wellcells, the default is transparent. - // we need to make cells opaque if there are no wellpipe through them. - if (opacityLevel < 1.0f) - { - cvf::uint wellIndex = gridCellToWellindexMap->get(cellIndex); - if (wellIndex != cvf::UNDEFINED_UINT) - { - if ( !(*isWellPipeVisible)[wellIndex]) - { - cellColorTextureCoord += 2.0f; // The shader must interpret values in the range 2-3 as "opaque" - } - } - } - } - else - { - cellColorTextureCoord = -1.0f; // Undefined texture coord. Shader handles this. - } - } + { + float cellColorTextureCoord = 0.5f; // If no results exists, the texture will have a special color + if (scalarValue != HUGE_VAL) + { + cellColorTextureCoord = cellResultScalarMapper->mapToTextureCoord(scalarValue)[0]; + // If we are dealing with wellcells, the default is transparent. + // we need to make cells opaque if there are no wellpipe through them. + if (opacityLevel < 1.0f) + { + cvf::uint wellIndex = gridCellToWellindexMap->get(cellIndex); + if (wellIndex != cvf::UNDEFINED_UINT) + { + if (!(*isWellPipeVisible)[wellIndex]) + { + cellColorTextureCoord += 2.0f; // The shader must interpret values in the range 2-3 as "opaque" + } + } + } + } + else + { + cellColorTextureCoord = -1.0f; // Undefined texture coord. Shader handles this. + } + + cellColorTextureCoordArray->set(quadIdx * 4 + 0, cellColorTextureCoord); + cellColorTextureCoordArray->set(quadIdx * 4 + 1, cellColorTextureCoord); + cellColorTextureCoordArray->set(quadIdx * 4 + 2, cellColorTextureCoord); + cellColorTextureCoordArray->set(quadIdx * 4 + 3, cellColorTextureCoord); + } + } - cellColorTextureCoordArray->set(quadIdx * 4 + 0, cellColorTextureCoord); - cellColorTextureCoordArray->set(quadIdx * 4 + 1, cellColorTextureCoord); - cellColorTextureCoordArray->set(quadIdx * 4 + 2, cellColorTextureCoord); - cellColorTextureCoordArray->set(quadIdx * 4 + 3, cellColorTextureCoord); float edgeColor; for (size_t cubeFaceIdx = 0; cubeFaceIdx < 6; cubeFaceIdx++) @@ -181,32 +188,6 @@ void RivCellEdgeGeometryGenerator::addCellEdgeResultsToDrawableGeo( geo->setVertexAttribute(new cvf::FloatVertexAttribute("a_colorNegK", cellEdgeColorTextureCoordsArrays.at(5))); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -cvf::ref RivCellEdgeGeometryGenerator::createCellCenterResultAccessor(RimResultSlot* cellResultSlot, size_t timeStepIndex, RigCaseData* eclipseCase, const RigGridBase* grid) -{ - cvf::ref resultAccessor = NULL; - - if (cellResultSlot->hasResult()) - { - if (!cellResultSlot->hasDynamicResult()) - { - // Static result values are located at time step 0 - timeStepIndex = 0; - } - - RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultSlot->porosityModel()); - resultAccessor = RigResultAccessorFactory::createResultAccessor(eclipseCase, grid->gridIndex(), porosityModel, timeStepIndex, cellResultSlot->resultVariable()); - } - - if (resultAccessor.isNull()) - { - resultAccessor = new RigHugeValResultAccessor; - } - - return resultAccessor; -} //-------------------------------------------------------------------------------------------------- /// @@ -236,6 +217,134 @@ cvf::ref RivCellEdgeGeometryGenerator::createCellEdgeCenterRe return cellEdgeResultAccessor; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RivCellEdgeGeometryGenerator::addTernaryCellEdgeResultsToDrawableGeo(size_t timeStepIndex, RimResultSlot* cellResultSlot, RimCellEdgeResultSlot* cellEdgeResultSlot, cvf::StructGridGeometryGenerator* generator, cvf::DrawableGeo* geo, size_t gridIndex, float opacityLevel) +{ + RigCaseData* eclipseCase = cellResultSlot->reservoirView()->eclipseCase()->reservoirData(); + CVF_ASSERT(eclipseCase != NULL); + + const RigGridBase* grid = dynamic_cast(generator->activeGrid()); + CVF_ASSERT(grid != NULL); + + cvf::ref cellEdgeResultAccessor = createCellEdgeCenterResultAccessor(cellResultSlot, cellEdgeResultSlot, timeStepIndex, eclipseCase, grid); + + const cvf::StructGridQuadToCellFaceMapper* quadToCellFaceMapper = generator->quadToCellFaceMapper(); + + size_t vertexCount = geo->vertexArray()->size(); + size_t quadCount = vertexCount / 4; + + cvf::ref localCoords = new cvf::Vec2fArray; + localCoords->resize(vertexCount); + + cvf::ref faceIndexArray = new cvf::IntArray; + faceIndexArray->resize(vertexCount); + + cvf::ref vCellColorTextureCoordArray = new cvf::Vec2fArray; + vCellColorTextureCoordArray->resize(vertexCount); + + // Build six cell face color arrays + cvf::Collection cellEdgeColorTextureCoordsArrays; + size_t idx; + for (idx = 0; idx < 6; idx++) + { + cvf::ref colorArray = new cvf::FloatArray; + colorArray->resize(vertexCount); + cellEdgeColorTextureCoordsArrays.push_back(colorArray.p()); + } + + RivTernaryScalarMapper* ternaryCellResultScalarMapper = cellResultSlot->ternaryLegendConfig()->scalarMapper(); + cvf::ScalarMapper* edgeResultScalarMapper = cellEdgeResultSlot->legendConfig()->scalarMapper(); + + double ignoredScalarValue = cellEdgeResultSlot->ignoredScalarValue(); + + RivTernaryTextureCoordsCreator texturer(cellResultSlot, cellResultSlot->ternaryLegendConfig(), + timeStepIndex, + grid->gridIndex(), + quadToCellFaceMapper); + + texturer.createTextureCoords(vCellColorTextureCoordArray.p()); + +#pragma omp parallel for + for (int quadIdx = 0; quadIdx < static_cast(quadCount); quadIdx++) + { + localCoords->set(quadIdx * 4 + 0, cvf::Vec2f(0, 0)); + localCoords->set(quadIdx * 4 + 1, cvf::Vec2f(1, 0)); + localCoords->set(quadIdx * 4 + 2, cvf::Vec2f(1, 1)); + localCoords->set(quadIdx * 4 + 3, cvf::Vec2f(0, 1)); + + faceIndexArray->set(quadIdx * 4 + 0, quadToCellFaceMapper->cellFace(quadIdx)); + faceIndexArray->set(quadIdx * 4 + 1, quadToCellFaceMapper->cellFace(quadIdx)); + faceIndexArray->set(quadIdx * 4 + 2, quadToCellFaceMapper->cellFace(quadIdx)); + faceIndexArray->set(quadIdx * 4 + 3, quadToCellFaceMapper->cellFace(quadIdx)); + + size_t cellIndex = quadToCellFaceMapper->cellIndex(quadIdx); + + float edgeColor; + for (size_t cubeFaceIdx = 0; cubeFaceIdx < 6; cubeFaceIdx++) + { + edgeColor = -1.0f; // Undefined texture coord. Shader handles this. + + double scalarValue = cellEdgeResultAccessor->cellFaceScalar(cellIndex, static_cast(cubeFaceIdx)); + + if (scalarValue != HUGE_VAL && scalarValue != ignoredScalarValue) + { + edgeColor = edgeResultScalarMapper->mapToTextureCoord(scalarValue)[0]; + } + + cvf::FloatArray* colArr = cellEdgeColorTextureCoordsArrays.at(cubeFaceIdx); + + colArr->set(quadIdx * 4 + 0, edgeColor); + colArr->set(quadIdx * 4 + 1, edgeColor); + colArr->set(quadIdx * 4 + 2, edgeColor); + colArr->set(quadIdx * 4 + 3, edgeColor); + } + } + + geo->setVertexAttribute(new cvf::Vec2fVertexAttribute("a_localCoord", localCoords.p())); + geo->setVertexAttribute(new cvf::Vec2fVertexAttribute("a_cellTextureCoord", vCellColorTextureCoordArray.p())); + + cvf::ref faceIntAttribute = new cvf::IntVertexAttributeDirect("a_face", faceIndexArray.p()); + geo->setVertexAttribute(faceIntAttribute.p()); + + geo->setVertexAttribute(new cvf::FloatVertexAttribute("a_colorPosI", cellEdgeColorTextureCoordsArrays.at(0))); + geo->setVertexAttribute(new cvf::FloatVertexAttribute("a_colorNegI", cellEdgeColorTextureCoordsArrays.at(1))); + geo->setVertexAttribute(new cvf::FloatVertexAttribute("a_colorPosJ", cellEdgeColorTextureCoordsArrays.at(2))); + geo->setVertexAttribute(new cvf::FloatVertexAttribute("a_colorNegJ", cellEdgeColorTextureCoordsArrays.at(3))); + geo->setVertexAttribute(new cvf::FloatVertexAttribute("a_colorPosK", cellEdgeColorTextureCoordsArrays.at(4))); + geo->setVertexAttribute(new cvf::FloatVertexAttribute("a_colorNegK", cellEdgeColorTextureCoordsArrays.at(5))); + +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +cvf::ref RivCellEdgeGeometryGenerator::createCellCenterResultAccessor(RimResultSlot* cellResultSlot, size_t timeStepIndex, RigCaseData* eclipseCase, const RigGridBase* grid) +{ + cvf::ref resultAccessor = NULL; + + if (cellResultSlot->hasResult()) + { + if (!cellResultSlot->hasDynamicResult()) + { + // Static result values are located at time step 0 + timeStepIndex = 0; + } + + RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultSlot->porosityModel()); + resultAccessor = RigResultAccessorFactory::createResultAccessor(eclipseCase, grid->gridIndex(), porosityModel, timeStepIndex, cellResultSlot->resultVariable()); + } + + if (resultAccessor.isNull()) + { + resultAccessor = new RigHugeValResultAccessor; + } + + return resultAccessor; +} + + @@ -244,11 +353,10 @@ cvf::ref RivCellEdgeGeometryGenerator::createCellEdgeCenterRe //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -CellEdgeEffectGenerator::CellEdgeEffectGenerator(const cvf::ScalarMapper* edgeScalarMapper, const cvf::ScalarMapper* cellScalarMapper) +CellEdgeEffectGenerator::CellEdgeEffectGenerator(const cvf::ScalarMapper* edgeScalarMapper) { CVF_ASSERT(edgeScalarMapper != NULL); - m_cellScalarMapper = cellScalarMapper; m_edgeScalarMapper = edgeScalarMapper; m_cullBackfaces = false; @@ -256,6 +364,21 @@ CellEdgeEffectGenerator::CellEdgeEffectGenerator(const cvf::ScalarMapper* edgeSc m_defaultCellColor = cvf::Color3f(cvf::Color3::WHITE); } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void CellEdgeEffectGenerator::setScalarMapper(const cvf::ScalarMapper* cellScalarMapper) +{ + m_cellScalarMapper = cellScalarMapper; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void CellEdgeEffectGenerator::setTernaryScalarMapper(const RivTernaryScalarMapper* ternaryScalarMapper) +{ + m_ternaryCellScalarMapper = ternaryScalarMapper; +} //-------------------------------------------------------------------------------------------------- /// @@ -267,7 +390,8 @@ bool CellEdgeEffectGenerator::isEqual(const EffectGenerator* other) const if (otherCellFaceEffectGenerator && m_cellScalarMapper.p() == otherCellFaceEffectGenerator->m_cellScalarMapper.p() && m_edgeScalarMapper.p() == otherCellFaceEffectGenerator->m_edgeScalarMapper.p() - && m_cullBackfaces == otherCellFaceEffectGenerator->m_cullBackfaces + && m_ternaryCellScalarMapper.p() == otherCellFaceEffectGenerator->m_ternaryCellScalarMapper.p() + && m_cullBackfaces == otherCellFaceEffectGenerator->m_cullBackfaces && m_opacityLevel == otherCellFaceEffectGenerator->m_opacityLevel && m_undefinedColor == otherCellFaceEffectGenerator->m_undefinedColor && m_defaultCellColor == otherCellFaceEffectGenerator->m_defaultCellColor @@ -300,7 +424,9 @@ bool CellEdgeEffectGenerator::isEqual(const EffectGenerator* other) const //-------------------------------------------------------------------------------------------------- caf::EffectGenerator* CellEdgeEffectGenerator::copy() const { - CellEdgeEffectGenerator * newEffect = new CellEdgeEffectGenerator(m_edgeScalarMapper.p(), m_cellScalarMapper.p()); + CellEdgeEffectGenerator * newEffect = new CellEdgeEffectGenerator(m_edgeScalarMapper.p()); + newEffect->setScalarMapper(m_cellScalarMapper.p()); + newEffect->setTernaryScalarMapper(m_ternaryCellScalarMapper.p()); newEffect->m_edgeTextureImage = m_edgeTextureImage; newEffect->m_cellTextureImage = m_cellTextureImage; @@ -317,36 +443,54 @@ caf::EffectGenerator* CellEdgeEffectGenerator::copy() const //-------------------------------------------------------------------------------------------------- void CellEdgeEffectGenerator::updateForShaderBasedRendering(cvf::Effect* effect) const { - cvf::ref eff = effect; + cvf::ref eff = effect; - // Set up shader program + // Set up shader program - cvf::ShaderProgramGenerator shaderGen("CellEdgeFaceShaderProgramGenerator", cvf::ShaderSourceProvider::instance()); - { - QFile data(":/Shader/fs_CellFace.glsl"); - if (data.open(QFile::ReadOnly)) - { - QTextStream in(&data); + cvf::ShaderProgramGenerator shaderGen("CellEdgeFaceShaderProgramGenerator", cvf::ShaderSourceProvider::instance()); + { + QFile data(":/Shader/fs_CellFace.glsl"); + if (data.open(QFile::ReadOnly)) + { + QTextStream in(&data); - QString data = in.readAll(); - cvf::String cvfString = cvfqt::Utils::toString(data); + QString data = in.readAll(); + cvf::String cvfString = cvfqt::Utils::toString(data); - shaderGen.addFragmentCode(cvfString); - } - } + shaderGen.addFragmentCode(cvfString); + } + } - { - QFile data(":/Shader/vs_CellFace.glsl"); - if (data.open(QFile::ReadOnly)) - { - QTextStream in(&data); + if (m_ternaryCellScalarMapper.notNull()) + { + { + QFile data(":/Shader/vs_2dTextureCellFace.glsl"); + if (data.open(QFile::ReadOnly)) + { + QTextStream in(&data); - QString data = in.readAll(); - cvf::String cvfString = cvfqt::Utils::toString(data); + QString data = in.readAll(); + cvf::String cvfString = cvfqt::Utils::toString(data); - shaderGen.addVertexCode(cvfString); - } - } + shaderGen.addVertexCode(cvfString); + } + } + } + else + { + { + QFile data(":/Shader/vs_CellFace.glsl"); + if (data.open(QFile::ReadOnly)) + { + QTextStream in(&data); + + QString data = in.readAll(); + cvf::String cvfString = cvfqt::Utils::toString(data); + + shaderGen.addVertexCode(cvfString); + } + } + } shaderGen.addFragmentCode(caf::CommonShaderSources::light_AmbientDiffuse()); shaderGen.addFragmentCode(cvf::ShaderSourceRepository::fs_Standard); @@ -361,7 +505,12 @@ void CellEdgeEffectGenerator::updateForShaderBasedRendering(cvf::Effect* effect) cvf::ref modifiedCellTextImage; m_edgeScalarMapper->updateTexture(m_edgeTextureImage.p()); - if (m_cellScalarMapper.notNull()) + if (m_ternaryCellScalarMapper.notNull()) + { + m_ternaryCellScalarMapper->updateTexture(m_cellTextureImage.p(), m_opacityLevel); + modifiedCellTextImage = m_cellTextureImage; + } + else if (m_cellScalarMapper.notNull()) { m_cellScalarMapper->updateTexture(m_cellTextureImage.p()); modifiedCellTextImage = caf::ScalarMapperEffectGenerator::addAlphaAndUndefStripes(m_cellTextureImage.p(), m_undefinedColor, m_opacityLevel); @@ -422,3 +571,4 @@ void CellEdgeEffectGenerator::updateForFixedFunctionRendering(cvf::Effect* effec surfaceGen.updateEffect(effect); } + diff --git a/ApplicationCode/ModelVisualization/RivCellEdgeEffectGenerator.h b/ApplicationCode/ModelVisualization/RivCellEdgeEffectGenerator.h index c670f414a6..40e6fe4dfd 100644 --- a/ApplicationCode/ModelVisualization/RivCellEdgeEffectGenerator.h +++ b/ApplicationCode/ModelVisualization/RivCellEdgeEffectGenerator.h @@ -31,7 +31,7 @@ class RimResultSlot; class RigGridBase; class RigResultAccessor; class RigCaseData; - +class RivTernaryScalarMapper; class RivCellEdgeGeometryGenerator { @@ -44,6 +44,15 @@ public: size_t gridIndex, float opacityLevel); + static void addTernaryCellEdgeResultsToDrawableGeo(size_t timeStepIndex, + RimResultSlot* cellResultSlot, + RimCellEdgeResultSlot* cellEdgeResultSlot, + cvf::StructGridGeometryGenerator* generator, + cvf::DrawableGeo* geo, + size_t gridIndex, + float opacityLevel); + + private: static cvf::ref createCellCenterResultAccessor( RimResultSlot* cellResultSlot, @@ -134,7 +143,10 @@ private: class CellEdgeEffectGenerator : public caf::EffectGenerator { public: - CellEdgeEffectGenerator(const cvf::ScalarMapper* edgeScalarMapper, const cvf::ScalarMapper* cellScalarMapper); + CellEdgeEffectGenerator(const cvf::ScalarMapper* edgeScalarMapper); + + void setScalarMapper(const cvf::ScalarMapper* cellScalarMapper); + void setTernaryScalarMapper(const RivTernaryScalarMapper* ternaryScalarMapper); void setOpacityLevel(float opacity) { m_opacityLevel = cvf::Math::clamp(opacity, 0.0f , 1.0f ); } void setUndefinedColor(cvf::Color3f color) { m_undefinedColor = color; } @@ -154,10 +166,11 @@ private: cvf::cref m_cellScalarMapper; mutable cvf::ref m_cellTextureImage; - float m_opacityLevel; + cvf::cref m_ternaryCellScalarMapper; + + float m_opacityLevel; bool m_cullBackfaces; cvf::Color3f m_undefinedColor; cvf::Color3f m_defaultCellColor; - }; diff --git a/ApplicationCode/ModelVisualization/RivGridPartMgr.cpp b/ApplicationCode/ModelVisualization/RivGridPartMgr.cpp index ad4017a1d8..f941f86e8a 100644 --- a/ApplicationCode/ModelVisualization/RivGridPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivGridPartMgr.cpp @@ -285,16 +285,31 @@ void RivGridPartMgr::updateCellEdgeResultColorOnPart( cvf::Part* facePart, { if (facePart) { - cvf::DrawableGeo* dg = dynamic_cast(facePart->drawable()); + CellEdgeEffectGenerator cellFaceEffectGen(cellEdgeResultSlot->legendConfig()->scalarMapper()); + + cvf::DrawableGeo* dg = dynamic_cast(facePart->drawable()); if (dg) { - RivCellEdgeGeometryGenerator::addCellEdgeResultsToDrawableGeo(timeStepIndex, cellResultSlot, cellEdgeResultSlot, - surfaceGenerator, dg, m_grid->gridIndex(), m_opacityLevel ); + if (cellResultSlot->isTernarySaturationSelected()) + { + RivCellEdgeGeometryGenerator::addTernaryCellEdgeResultsToDrawableGeo(timeStepIndex, cellResultSlot, cellEdgeResultSlot, + surfaceGenerator, dg, m_grid->gridIndex(), m_opacityLevel); - cvf::ScalarMapper* cellScalarMapper = NULL; - if (cellResultSlot->hasResult()) cellScalarMapper = cellResultSlot->legendConfig()->scalarMapper(); + RivTernaryScalarMapper* ternaryCellScalarMapper = cellResultSlot->ternaryLegendConfig()->scalarMapper(); + cellFaceEffectGen.setTernaryScalarMapper(ternaryCellScalarMapper); + } + else + { + if (cellResultSlot->hasResult()) + { + RivCellEdgeGeometryGenerator::addCellEdgeResultsToDrawableGeo(timeStepIndex, cellResultSlot, cellEdgeResultSlot, + surfaceGenerator, dg, m_grid->gridIndex(), m_opacityLevel); + + cvf::ScalarMapper* cellScalarMapper = cellResultSlot->legendConfig()->scalarMapper(); + cellFaceEffectGen.setScalarMapper(cellScalarMapper); + } + } - CellEdgeEffectGenerator cellFaceEffectGen(cellEdgeResultSlot->legendConfig()->scalarMapper(), cellScalarMapper); cellFaceEffectGen.setOpacityLevel(m_opacityLevel); cellFaceEffectGen.setDefaultCellColor(m_defaultColor);