FaultCelledge : Extracted a method from some duplicate code.

This commit is contained in:
Jacob Støren 2014-07-04 09:12:42 +02:00 committed by Magne Sjaastad
parent 066a2c5749
commit 34d62964d6
2 changed files with 52 additions and 1 deletions

View File

@ -404,6 +404,7 @@ void RivGridPartMgr::setResultsTransparentForWellCells(const std::vector<cvf::ub
//--------------------------------------------------------------------------------------------------
void RivGridPartMgr::updateCellEdgeResultColor(size_t timeStepIndex, RimResultSlot* cellResultSlot, RimCellEdgeResultSlot* cellEdgeResultSlot)
{
/*
if (m_surfaceFaces.notNull())
{
cvf::DrawableGeo* dg = dynamic_cast<cvf::DrawableGeo*>(m_surfaceFaces->drawable());
@ -424,6 +425,20 @@ void RivGridPartMgr::updateCellEdgeResultColor(size_t timeStepIndex, RimResultSl
m_surfaceFaces->setEffect(eff.p());
}
}
*/
updateCellEdgeResultColorOnPart(
m_surfaceFaces.p(),
&m_surfaceGenerator,
timeStepIndex, cellResultSlot, cellEdgeResultSlot);
if (m_faultFaces.notNull())
{
updateCellEdgeResultColorOnPart(
m_faultFaces.p(),
&m_faultGenerator,
timeStepIndex, cellResultSlot, cellEdgeResultSlot);
}
/*
if (m_faultFaces.notNull())
{
cvf::DrawableGeo* dg = dynamic_cast<cvf::DrawableGeo*>(m_faultFaces->drawable());
@ -444,6 +459,37 @@ void RivGridPartMgr::updateCellEdgeResultColor(size_t timeStepIndex, RimResultSl
m_faultFaces->setEffect(eff.p());
}
}
*/
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivGridPartMgr::updateCellEdgeResultColorOnPart( cvf::Part* facePart,
cvf::StructGridGeometryGenerator* surfaceGenerator,
size_t timeStepIndex,
RimResultSlot* cellResultSlot,
RimCellEdgeResultSlot* cellEdgeResultSlot)
{
if (facePart)
{
cvf::DrawableGeo* dg = dynamic_cast<cvf::DrawableGeo*>(facePart->drawable());
if (dg)
{
RivCellEdgeGeometryGenerator::addCellEdgeResultsToDrawableGeo(timeStepIndex, cellResultSlot, cellEdgeResultSlot,
surfaceGenerator, dg, m_grid->gridIndex(), m_opacityLevel );
cvf::ScalarMapper* cellScalarMapper = NULL;
if (cellResultSlot->hasResult()) cellScalarMapper = cellResultSlot->legendConfig()->scalarMapper();
CellEdgeEffectGenerator cellFaceEffectGen(cellEdgeResultSlot->legendConfig()->scalarMapper(), cellScalarMapper);
cellFaceEffectGen.setOpacityLevel(m_opacityLevel);
cellFaceEffectGen.setDefaultCellColor(m_defaultColor);
cvf::ref<cvf::Effect> eff = cellFaceEffectGen.generateEffect();
facePart->setEffect(eff.p());
}
}
}
//--------------------------------------------------------------------------------------------------

View File

@ -96,6 +96,11 @@ private:
const cvf::UIntArray* gridCellToWellIndexMap,
const cvf::StructGridQuadToCellFaceMapper* quadsToCellFaceMapper,
cvf::Vec2fArray* resultTextureCoords);
void updateCellEdgeResultColorOnPart(cvf::Part* facePart,
cvf::StructGridGeometryGenerator* surfaceGenerator,
size_t timeStepIndex,
RimResultSlot* cellResultSlot,
RimCellEdgeResultSlot* cellEdgeResultSlot);
private:
size_t m_gridIdx;
cvf::cref<RigGridBase> m_grid;
@ -112,7 +117,7 @@ private:
cvf::ref<cvf::Part> m_surfaceGridLines;
// Fault visualization
// Fault visualization: Dead ?? JJS
cvf::StructGridGeometryGenerator m_faultGenerator;
RigFaultFaceVisibilityFilter m_faultFaceFilter;
cvf::ref<cvf::Part> m_faultFaces;