mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
FaultCelledge : Extracted a method from some duplicate code.
This commit is contained in:
parent
066a2c5749
commit
34d62964d6
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user