mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added support for cell edge on faults
This commit is contained in:
parent
2c903a0d18
commit
7e5c46cf59
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "RivCellEdgeEffectGenerator.h"
|
#include "RivCellEdgeEffectGenerator.h"
|
||||||
|
|
||||||
|
|
||||||
#include "RigCaseCellResultsData.h"
|
#include "RigCaseCellResultsData.h"
|
||||||
#include "RigCaseData.h"
|
#include "RigCaseData.h"
|
||||||
#include "RigCellEdgeResultAccessor.h"
|
#include "RigCellEdgeResultAccessor.h"
|
||||||
@ -31,14 +32,14 @@
|
|||||||
#include "RimCellEdgeResultSlot.h"
|
#include "RimCellEdgeResultSlot.h"
|
||||||
#include "RimReservoirView.h"
|
#include "RimReservoirView.h"
|
||||||
#include "RimResultSlot.h"
|
#include "RimResultSlot.h"
|
||||||
|
#include "RimTernaryLegendConfig.h"
|
||||||
#include "RimWellCollection.h"
|
#include "RimWellCollection.h"
|
||||||
|
|
||||||
#include "RivTernaryScalarMapper.h"
|
#include "RivTernaryScalarMapper.h"
|
||||||
#include "RimTernaryLegendConfig.h"
|
#include "RivTernaryTextureCoordsCreator.h"
|
||||||
|
|
||||||
#include "cvfStructGridGeometryGenerator.h"
|
#include "cvfStructGridGeometryGenerator.h"
|
||||||
#include "cvfqtUtils.h"
|
#include "cvfqtUtils.h"
|
||||||
#include "RivTernaryTextureCoordsCreator.h"
|
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -48,7 +49,7 @@ void RivCellEdgeGeometryGenerator::addCellEdgeResultsToDrawableGeo(
|
|||||||
size_t timeStepIndex,
|
size_t timeStepIndex,
|
||||||
RimResultSlot* cellResultSlot,
|
RimResultSlot* cellResultSlot,
|
||||||
RimCellEdgeResultSlot* cellEdgeResultSlot,
|
RimCellEdgeResultSlot* cellEdgeResultSlot,
|
||||||
cvf::StructGridGeometryGenerator* generator,
|
const cvf::StructGridQuadToCellFaceMapper* quadToCellFaceMapper,
|
||||||
cvf::DrawableGeo* geo,
|
cvf::DrawableGeo* geo,
|
||||||
size_t gridIndex,
|
size_t gridIndex,
|
||||||
float opacityLevel)
|
float opacityLevel)
|
||||||
@ -56,16 +57,10 @@ void RivCellEdgeGeometryGenerator::addCellEdgeResultsToDrawableGeo(
|
|||||||
RigCaseData* eclipseCase = cellResultSlot->reservoirView()->eclipseCase()->reservoirData();
|
RigCaseData* eclipseCase = cellResultSlot->reservoirView()->eclipseCase()->reservoirData();
|
||||||
CVF_ASSERT(eclipseCase != NULL);
|
CVF_ASSERT(eclipseCase != NULL);
|
||||||
|
|
||||||
const RigGridBase* grid = dynamic_cast<const RigGridBase*>(generator->activeGrid());
|
|
||||||
CVF_ASSERT(grid != NULL);
|
|
||||||
|
|
||||||
// Create result access objects
|
// Create result access objects
|
||||||
|
|
||||||
cvf::ref<RigResultAccessor> cellCenterDataAccessObject = createCellCenterResultAccessor(cellResultSlot, timeStepIndex, eclipseCase, grid);
|
cvf::ref<RigResultAccessor> cellCenterDataAccessObject = createCellCenterResultAccessor(cellResultSlot, timeStepIndex, eclipseCase, eclipseCase->grid(gridIndex));
|
||||||
cvf::ref<RigResultAccessor> cellEdgeResultAccessor = createCellEdgeCenterResultAccessor(cellResultSlot, cellEdgeResultSlot, timeStepIndex, eclipseCase, grid);
|
cvf::ref<RigResultAccessor> cellEdgeResultAccessor = createCellEdgeCenterResultAccessor(cellResultSlot, cellEdgeResultSlot, timeStepIndex, eclipseCase, eclipseCase->grid(gridIndex));
|
||||||
|
|
||||||
|
|
||||||
const cvf::StructGridQuadToCellFaceMapper* quadToCellFace = generator->quadToCellFaceMapper();
|
|
||||||
|
|
||||||
size_t vertexCount = geo->vertexArray()->size();
|
size_t vertexCount = geo->vertexArray()->size();
|
||||||
size_t quadCount = vertexCount / 4;
|
size_t quadCount = vertexCount / 4;
|
||||||
@ -111,14 +106,14 @@ void RivCellEdgeGeometryGenerator::addCellEdgeResultsToDrawableGeo(
|
|||||||
localCoords->set(quadIdx * 4 + 2, cvf::Vec2f(1, 1));
|
localCoords->set(quadIdx * 4 + 2, cvf::Vec2f(1, 1));
|
||||||
localCoords->set(quadIdx * 4 + 3, cvf::Vec2f(0, 1));
|
localCoords->set(quadIdx * 4 + 3, cvf::Vec2f(0, 1));
|
||||||
|
|
||||||
faceIndexArray->set(quadIdx * 4 + 0, quadToCellFace->cellFace(quadIdx) );
|
faceIndexArray->set(quadIdx * 4 + 0, quadToCellFaceMapper->cellFace(quadIdx) );
|
||||||
faceIndexArray->set(quadIdx * 4 + 1, quadToCellFace->cellFace(quadIdx) );
|
faceIndexArray->set(quadIdx * 4 + 1, quadToCellFaceMapper->cellFace(quadIdx) );
|
||||||
faceIndexArray->set(quadIdx * 4 + 2, quadToCellFace->cellFace(quadIdx) );
|
faceIndexArray->set(quadIdx * 4 + 2, quadToCellFaceMapper->cellFace(quadIdx) );
|
||||||
faceIndexArray->set(quadIdx * 4 + 3, quadToCellFace->cellFace(quadIdx) );
|
faceIndexArray->set(quadIdx * 4 + 3, quadToCellFaceMapper->cellFace(quadIdx) );
|
||||||
|
|
||||||
size_t cellIndex = quadToCellFace->cellIndex(quadIdx);
|
size_t cellIndex = quadToCellFaceMapper->cellIndex(quadIdx);
|
||||||
{
|
{
|
||||||
cvf::StructGridInterface::FaceType cellFace = quadToCellFace->cellFace(quadIdx);
|
cvf::StructGridInterface::FaceType cellFace = quadToCellFaceMapper->cellFace(quadIdx);
|
||||||
double scalarValue = cellCenterDataAccessObject->cellFaceScalar(cellIndex, cellFace);
|
double scalarValue = cellCenterDataAccessObject->cellFaceScalar(cellIndex, cellFace);
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -192,45 +187,14 @@ void RivCellEdgeGeometryGenerator::addCellEdgeResultsToDrawableGeo(
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
cvf::ref<RigResultAccessor> RivCellEdgeGeometryGenerator::createCellEdgeCenterResultAccessor(
|
void RivCellEdgeGeometryGenerator::addTernaryCellEdgeResultsToDrawableGeo(size_t timeStepIndex, RimResultSlot* cellResultSlot, RimCellEdgeResultSlot* cellEdgeResultSlot,
|
||||||
RimResultSlot* cellResultSlot,
|
const cvf::StructGridQuadToCellFaceMapper* quadToCellFaceMapper,
|
||||||
RimCellEdgeResultSlot* cellEdgeResultSlot,
|
cvf::DrawableGeo* geo, size_t gridIndex, float opacityLevel)
|
||||||
size_t timeStepIndex,
|
|
||||||
RigCaseData* eclipseCase,
|
|
||||||
const RigGridBase* grid)
|
|
||||||
{
|
|
||||||
cvf::ref<RigCellEdgeResultAccessor> cellEdgeResultAccessor = new RigCellEdgeResultAccessor();
|
|
||||||
{
|
|
||||||
size_t resultIndices[6];
|
|
||||||
cellEdgeResultSlot->gridScalarIndices(resultIndices);
|
|
||||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultSlot->porosityModel());
|
|
||||||
|
|
||||||
size_t cubeFaceIdx;
|
|
||||||
for (cubeFaceIdx = 0; cubeFaceIdx < 6; cubeFaceIdx++)
|
|
||||||
{
|
|
||||||
// Assuming static values to be mapped onto cell edge, always using time step zero
|
|
||||||
cvf::ref<RigResultAccessor> daObj = RigResultAccessorFactory::createResultAccessor(eclipseCase, grid->gridIndex(), porosityModel, 0, resultIndices[cubeFaceIdx]);
|
|
||||||
cellEdgeResultAccessor->setDataAccessObjectForFace(static_cast<cvf::StructGridInterface::FaceType>(cubeFaceIdx), daObj.p());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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();
|
RigCaseData* eclipseCase = cellResultSlot->reservoirView()->eclipseCase()->reservoirData();
|
||||||
CVF_ASSERT(eclipseCase != NULL);
|
CVF_ASSERT(eclipseCase != NULL);
|
||||||
|
|
||||||
const RigGridBase* grid = dynamic_cast<const RigGridBase*>(generator->activeGrid());
|
cvf::ref<RigResultAccessor> cellEdgeResultAccessor = createCellEdgeCenterResultAccessor(cellResultSlot, cellEdgeResultSlot, timeStepIndex, eclipseCase, eclipseCase->grid(gridIndex));
|
||||||
CVF_ASSERT(grid != NULL);
|
|
||||||
|
|
||||||
cvf::ref<RigResultAccessor> cellEdgeResultAccessor = createCellEdgeCenterResultAccessor(cellResultSlot, cellEdgeResultSlot, timeStepIndex, eclipseCase, grid);
|
|
||||||
|
|
||||||
const cvf::StructGridQuadToCellFaceMapper* quadToCellFaceMapper = generator->quadToCellFaceMapper();
|
|
||||||
|
|
||||||
size_t vertexCount = geo->vertexArray()->size();
|
size_t vertexCount = geo->vertexArray()->size();
|
||||||
size_t quadCount = vertexCount / 4;
|
size_t quadCount = vertexCount / 4;
|
||||||
@ -261,7 +225,7 @@ void RivCellEdgeGeometryGenerator::addTernaryCellEdgeResultsToDrawableGeo(size_t
|
|||||||
|
|
||||||
RivTernaryTextureCoordsCreator texturer(cellResultSlot, cellResultSlot->ternaryLegendConfig(),
|
RivTernaryTextureCoordsCreator texturer(cellResultSlot, cellResultSlot->ternaryLegendConfig(),
|
||||||
timeStepIndex,
|
timeStepIndex,
|
||||||
grid->gridIndex(),
|
gridIndex,
|
||||||
quadToCellFaceMapper);
|
quadToCellFaceMapper);
|
||||||
|
|
||||||
texturer.createTextureCoords(vCellColorTextureCoordArray.p());
|
texturer.createTextureCoords(vCellColorTextureCoordArray.p());
|
||||||
@ -317,6 +281,34 @@ void RivCellEdgeGeometryGenerator::addTernaryCellEdgeResultsToDrawableGeo(size_t
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
cvf::ref<RigResultAccessor> RivCellEdgeGeometryGenerator::createCellEdgeCenterResultAccessor(
|
||||||
|
RimResultSlot* cellResultSlot,
|
||||||
|
RimCellEdgeResultSlot* cellEdgeResultSlot,
|
||||||
|
size_t timeStepIndex,
|
||||||
|
RigCaseData* eclipseCase,
|
||||||
|
const RigGridBase* grid)
|
||||||
|
{
|
||||||
|
cvf::ref<RigCellEdgeResultAccessor> cellEdgeResultAccessor = new RigCellEdgeResultAccessor();
|
||||||
|
{
|
||||||
|
size_t resultIndices[6];
|
||||||
|
cellEdgeResultSlot->gridScalarIndices(resultIndices);
|
||||||
|
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultSlot->porosityModel());
|
||||||
|
|
||||||
|
size_t cubeFaceIdx;
|
||||||
|
for (cubeFaceIdx = 0; cubeFaceIdx < 6; cubeFaceIdx++)
|
||||||
|
{
|
||||||
|
// Assuming static values to be mapped onto cell edge, always using time step zero
|
||||||
|
cvf::ref<RigResultAccessor> daObj = RigResultAccessorFactory::createResultAccessor(eclipseCase, grid->gridIndex(), porosityModel, 0, resultIndices[cubeFaceIdx]);
|
||||||
|
cellEdgeResultAccessor->setDataAccessObjectForFace(static_cast<cvf::StructGridInterface::FaceType>(cubeFaceIdx), daObj.p());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return cellEdgeResultAccessor;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -22,8 +22,8 @@
|
|||||||
|
|
||||||
namespace cvf
|
namespace cvf
|
||||||
{
|
{
|
||||||
class StructGridGeometryGenerator;
|
|
||||||
class DrawableGeo;
|
class DrawableGeo;
|
||||||
|
class StructGridQuadToCellFaceMapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
class RimCellEdgeResultSlot;
|
class RimCellEdgeResultSlot;
|
||||||
@ -33,13 +33,14 @@ class RigResultAccessor;
|
|||||||
class RigCaseData;
|
class RigCaseData;
|
||||||
class RivTernaryScalarMapper;
|
class RivTernaryScalarMapper;
|
||||||
|
|
||||||
|
|
||||||
class RivCellEdgeGeometryGenerator
|
class RivCellEdgeGeometryGenerator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void addCellEdgeResultsToDrawableGeo(size_t timeStepIndex,
|
static void addCellEdgeResultsToDrawableGeo(size_t timeStepIndex,
|
||||||
RimResultSlot* cellResultSlot,
|
RimResultSlot* cellResultSlot,
|
||||||
RimCellEdgeResultSlot* cellEdgeResultSlot,
|
RimCellEdgeResultSlot* cellEdgeResultSlot,
|
||||||
cvf::StructGridGeometryGenerator* generator,
|
const cvf::StructGridQuadToCellFaceMapper* quadToCellFaceMapper,
|
||||||
cvf::DrawableGeo* geo,
|
cvf::DrawableGeo* geo,
|
||||||
size_t gridIndex,
|
size_t gridIndex,
|
||||||
float opacityLevel);
|
float opacityLevel);
|
||||||
@ -47,7 +48,7 @@ public:
|
|||||||
static void addTernaryCellEdgeResultsToDrawableGeo(size_t timeStepIndex,
|
static void addTernaryCellEdgeResultsToDrawableGeo(size_t timeStepIndex,
|
||||||
RimResultSlot* cellResultSlot,
|
RimResultSlot* cellResultSlot,
|
||||||
RimCellEdgeResultSlot* cellEdgeResultSlot,
|
RimCellEdgeResultSlot* cellEdgeResultSlot,
|
||||||
cvf::StructGridGeometryGenerator* generator,
|
const cvf::StructGridQuadToCellFaceMapper* quadToCellFaceMapper,
|
||||||
cvf::DrawableGeo* geo,
|
cvf::DrawableGeo* geo,
|
||||||
size_t gridIndex,
|
size_t gridIndex,
|
||||||
float opacityLevel);
|
float opacityLevel);
|
||||||
|
@ -182,7 +182,30 @@ void RivFaultPartMgr::updateCellResultColor(size_t timeStepIndex, RimResultSlot*
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RivFaultPartMgr::updateCellEdgeResultColor(size_t timeStepIndex, RimResultSlot* cellResultSlot, RimCellEdgeResultSlot* cellEdgeResultSlot)
|
void RivFaultPartMgr::updateCellEdgeResultColor(size_t timeStepIndex, RimResultSlot* cellResultSlot, RimCellEdgeResultSlot* cellEdgeResultSlot)
|
||||||
{
|
{
|
||||||
|
if (m_nativeFaultFaces.notNull())
|
||||||
|
{
|
||||||
|
cvf::DrawableGeo* dg = dynamic_cast<cvf::DrawableGeo*>(m_nativeFaultFaces->drawable());
|
||||||
|
if (dg)
|
||||||
|
{
|
||||||
|
cvf::ref<cvf::Effect> eff = RivScalarMapperUtils::createCellEdgeEffect(dg, m_nativeFaultGenerator->quadToCellFaceMapper(),
|
||||||
|
m_grid->gridIndex(),
|
||||||
|
timeStepIndex, cellResultSlot, cellEdgeResultSlot, m_opacityLevel, m_defaultColor);
|
||||||
|
|
||||||
|
m_nativeFaultFaces->setEffect(eff.p());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_oppositeFaultFaces.notNull())
|
||||||
|
{
|
||||||
|
cvf::DrawableGeo* dg = dynamic_cast<cvf::DrawableGeo*>(m_oppositeFaultFaces->drawable());
|
||||||
|
if (dg)
|
||||||
|
{
|
||||||
|
cvf::ref<cvf::Effect> eff = RivScalarMapperUtils::createCellEdgeEffect(dg, m_oppositeFaultGenerator->quadToCellFaceMapper(), m_grid->gridIndex(),
|
||||||
|
timeStepIndex, cellResultSlot, cellEdgeResultSlot, m_opacityLevel, m_defaultColor);
|
||||||
|
|
||||||
|
m_oppositeFaultFaces->setEffect(eff.p());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const int priFaultGeo = 1;
|
const int priFaultGeo = 1;
|
||||||
|
@ -268,54 +268,15 @@ void RivGridPartMgr::updateCellResultColor(size_t timeStepIndex, RimResultSlot*
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RivGridPartMgr::updateCellEdgeResultColor(size_t timeStepIndex, RimResultSlot* cellResultSlot, RimCellEdgeResultSlot* cellEdgeResultSlot)
|
void RivGridPartMgr::updateCellEdgeResultColor(size_t timeStepIndex, RimResultSlot* cellResultSlot, RimCellEdgeResultSlot* cellEdgeResultSlot)
|
||||||
{
|
{
|
||||||
updateCellEdgeResultColorOnPart(
|
if (m_surfaceFaces.notNull())
|
||||||
m_surfaceFaces.p(),
|
|
||||||
&m_surfaceGenerator,
|
|
||||||
timeStepIndex, cellResultSlot, cellEdgeResultSlot);
|
|
||||||
|
|
||||||
}
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RivGridPartMgr::updateCellEdgeResultColorOnPart( cvf::Part* facePart,
|
|
||||||
cvf::StructGridGeometryGenerator* surfaceGenerator,
|
|
||||||
size_t timeStepIndex,
|
|
||||||
RimResultSlot* cellResultSlot,
|
|
||||||
RimCellEdgeResultSlot* cellEdgeResultSlot)
|
|
||||||
{
|
|
||||||
if (facePart)
|
|
||||||
{
|
{
|
||||||
CellEdgeEffectGenerator cellFaceEffectGen(cellEdgeResultSlot->legendConfig()->scalarMapper());
|
cvf::DrawableGeo* dg = dynamic_cast<cvf::DrawableGeo*>(m_surfaceFaces->drawable());
|
||||||
|
|
||||||
cvf::DrawableGeo* dg = dynamic_cast<cvf::DrawableGeo*>(facePart->drawable());
|
|
||||||
if (dg)
|
if (dg)
|
||||||
{
|
{
|
||||||
if (cellResultSlot->isTernarySaturationSelected())
|
cvf::ref<cvf::Effect> eff = RivScalarMapperUtils::createCellEdgeEffect(dg, m_surfaceGenerator.quadToCellFaceMapper(), m_grid->gridIndex(),
|
||||||
{
|
timeStepIndex, cellResultSlot, cellEdgeResultSlot, m_opacityLevel, m_defaultColor);
|
||||||
RivCellEdgeGeometryGenerator::addTernaryCellEdgeResultsToDrawableGeo(timeStepIndex, cellResultSlot, cellEdgeResultSlot,
|
|
||||||
surfaceGenerator, dg, m_grid->gridIndex(), m_opacityLevel);
|
|
||||||
|
|
||||||
RivTernaryScalarMapper* ternaryCellScalarMapper = cellResultSlot->ternaryLegendConfig()->scalarMapper();
|
m_surfaceFaces->setEffect(eff.p());
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cellFaceEffectGen.setOpacityLevel(m_opacityLevel);
|
|
||||||
cellFaceEffectGen.setDefaultCellColor(m_defaultColor);
|
|
||||||
|
|
||||||
cvf::ref<cvf::Effect> eff = cellFaceEffectGen.generateEffect();
|
|
||||||
|
|
||||||
facePart->setEffect(eff.p());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,11 +64,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void generatePartGeometry(cvf::StructGridGeometryGenerator& geoBuilder);
|
void generatePartGeometry(cvf::StructGridGeometryGenerator& geoBuilder);
|
||||||
void updateCellEdgeResultColorOnPart(cvf::Part* facePart,
|
|
||||||
cvf::StructGridGeometryGenerator* surfaceGenerator,
|
|
||||||
size_t timeStepIndex,
|
|
||||||
RimResultSlot* cellResultSlot,
|
|
||||||
RimCellEdgeResultSlot* cellEdgeResultSlot);
|
|
||||||
private:
|
private:
|
||||||
size_t m_gridIdx;
|
size_t m_gridIdx;
|
||||||
cvf::cref<RigGridBase> m_grid;
|
cvf::cref<RigGridBase> m_grid;
|
||||||
|
@ -197,3 +197,15 @@ void RivReservoirPartMgr::setFaultForceVisibility(bool isGeneratedByFilter)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RivReservoirPartMgr::updateFaultCellEdgeResultColor(size_t timeStepIndex, RimResultSlot* cellResultSlot, RimCellEdgeResultSlot* cellEdgeResultSlot)
|
||||||
|
{
|
||||||
|
if (m_faultsPartMgr.notNull())
|
||||||
|
{
|
||||||
|
m_faultsPartMgr->updateCellEdgeResultColor(timeStepIndex, cellResultSlot, cellEdgeResultSlot);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -64,6 +64,8 @@ public:
|
|||||||
|
|
||||||
// Faults
|
// Faults
|
||||||
void updateFaultColors(size_t timeStepIndex, RimResultSlot* cellResultSlot);
|
void updateFaultColors(size_t timeStepIndex, RimResultSlot* cellResultSlot);
|
||||||
|
void updateFaultCellEdgeResultColor(size_t timeStepIndex, RimResultSlot* cellResultSlot,
|
||||||
|
RimCellEdgeResultSlot* cellEdgeResultSlot);
|
||||||
void appendFaultPartsToModel(cvf::ModelBasicList* model);
|
void appendFaultPartsToModel(cvf::ModelBasicList* model);
|
||||||
void appendFaultLabelPartsToModel(cvf::ModelBasicList* model);
|
void appendFaultLabelPartsToModel(cvf::ModelBasicList* model);
|
||||||
private:
|
private:
|
||||||
|
@ -795,7 +795,16 @@ void RivReservoirViewPartMgr::updateCellResultColor(ReservoirGeometryCacheType g
|
|||||||
void RivReservoirViewPartMgr::updateCellEdgeResultColor(ReservoirGeometryCacheType geometryType, size_t timeStepIndex, RimResultSlot* cellResultSlot, RimCellEdgeResultSlot* cellEdgeResultSlot)
|
void RivReservoirViewPartMgr::updateCellEdgeResultColor(ReservoirGeometryCacheType geometryType, size_t timeStepIndex, RimResultSlot* cellResultSlot, RimCellEdgeResultSlot* cellEdgeResultSlot)
|
||||||
{
|
{
|
||||||
RivReservoirPartMgr * pmgr = reservoirPartManager( geometryType, timeStepIndex );
|
RivReservoirPartMgr * pmgr = reservoirPartManager( geometryType, timeStepIndex );
|
||||||
pmgr->updateCellEdgeResultColor(timeStepIndex, cellResultSlot, cellEdgeResultSlot );
|
pmgr->updateCellEdgeResultColor(timeStepIndex, cellResultSlot, cellEdgeResultSlot);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RivReservoirViewPartMgr::updateFaultCellEdgeResultColor(ReservoirGeometryCacheType geometryType, size_t timeStepIndex, RimResultSlot* cellResultSlot, RimCellEdgeResultSlot* cellEdgeResultSlot)
|
||||||
|
{
|
||||||
|
RivReservoirPartMgr * pmgr = reservoirPartManager(geometryType, timeStepIndex);
|
||||||
|
pmgr->updateFaultCellEdgeResultColor(timeStepIndex, cellResultSlot, cellEdgeResultSlot);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -66,12 +66,16 @@ public:
|
|||||||
void updateCellResultColor (ReservoirGeometryCacheType geometryType, size_t timeStepIndex,
|
void updateCellResultColor (ReservoirGeometryCacheType geometryType, size_t timeStepIndex,
|
||||||
RimResultSlot* cellResultSlot);
|
RimResultSlot* cellResultSlot);
|
||||||
void updateCellEdgeResultColor(ReservoirGeometryCacheType geometryType, size_t timeStepIndex,
|
void updateCellEdgeResultColor(ReservoirGeometryCacheType geometryType, size_t timeStepIndex,
|
||||||
RimResultSlot* cellResultSlot, RimCellEdgeResultSlot* cellEdgeResultSlot);
|
RimResultSlot* cellResultSlot,
|
||||||
|
RimCellEdgeResultSlot* cellEdgeResultSlot);
|
||||||
|
|
||||||
// Faults
|
// Faults
|
||||||
void appendFaultsStaticGeometryPartsToModel(cvf::ModelBasicList* model, ReservoirGeometryCacheType geometryType);
|
void appendFaultsStaticGeometryPartsToModel(cvf::ModelBasicList* model, ReservoirGeometryCacheType geometryType);
|
||||||
void appendFaultsDynamicGeometryPartsToModel(cvf::ModelBasicList* model, ReservoirGeometryCacheType geometryType, size_t frameIndex);
|
void appendFaultsDynamicGeometryPartsToModel(cvf::ModelBasicList* model, ReservoirGeometryCacheType geometryType, size_t frameIndex);
|
||||||
void updateFaultColors(ReservoirGeometryCacheType geometryType, size_t timeStepIndex, RimResultSlot* cellResultSlot);
|
void updateFaultColors(ReservoirGeometryCacheType geometryType, size_t timeStepIndex, RimResultSlot* cellResultSlot);
|
||||||
|
void updateFaultCellEdgeResultColor( ReservoirGeometryCacheType geometryType, size_t timeStepIndex,
|
||||||
|
RimResultSlot* cellResultSlot,
|
||||||
|
RimCellEdgeResultSlot* cellEdgeResultSlot);
|
||||||
|
|
||||||
// Fault labels
|
// Fault labels
|
||||||
ReservoirGeometryCacheType geometryTypeForFaultLabels(const std::vector<ReservoirGeometryCacheType>& geometryTypes) const;
|
ReservoirGeometryCacheType geometryTypeForFaultLabels(const std::vector<ReservoirGeometryCacheType>& geometryTypes) const;
|
||||||
|
@ -18,8 +18,15 @@
|
|||||||
|
|
||||||
#include "RivScalarMapperUtils.h"
|
#include "RivScalarMapperUtils.h"
|
||||||
|
|
||||||
#include "RivTernaryScalarMapperEffectGenerator.h"
|
#include "RimCellEdgeResultSlot.h"
|
||||||
|
#include "RimLegendConfig.h"
|
||||||
|
#include "RimReservoirView.h"
|
||||||
|
#include "RimResultSlot.h"
|
||||||
|
#include "RimTernaryLegendConfig.h"
|
||||||
|
|
||||||
|
#include "RivCellEdgeEffectGenerator.h"
|
||||||
#include "RivTernaryScalarMapper.h"
|
#include "RivTernaryScalarMapper.h"
|
||||||
|
#include "RivTernaryScalarMapperEffectGenerator.h"
|
||||||
|
|
||||||
#include "cafEffectGenerator.h"
|
#include "cafEffectGenerator.h"
|
||||||
|
|
||||||
@ -55,6 +62,47 @@ void RivScalarMapperUtils::applyTernaryTextureResultsToPart(cvf::Part* part, cvf
|
|||||||
part->setEffect(scalarEffect.p());
|
part->setEffect(scalarEffect.p());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
cvf::ref<cvf::Effect> RivScalarMapperUtils::createCellEdgeEffect(cvf::DrawableGeo* dg,
|
||||||
|
const cvf::StructGridQuadToCellFaceMapper* quadToCellFaceMapper,
|
||||||
|
size_t gridIndex,
|
||||||
|
size_t timeStepIndex,
|
||||||
|
RimResultSlot* cellResultSlot,
|
||||||
|
RimCellEdgeResultSlot* cellEdgeResultSlot,
|
||||||
|
float opacityLevel,
|
||||||
|
cvf::Color3f defaultColor)
|
||||||
|
{
|
||||||
|
CellEdgeEffectGenerator cellFaceEffectGen(cellEdgeResultSlot->legendConfig()->scalarMapper());
|
||||||
|
|
||||||
|
if (cellResultSlot->isTernarySaturationSelected())
|
||||||
|
{
|
||||||
|
RivCellEdgeGeometryGenerator::addTernaryCellEdgeResultsToDrawableGeo(timeStepIndex, cellResultSlot, cellEdgeResultSlot,
|
||||||
|
quadToCellFaceMapper, dg, gridIndex, opacityLevel);
|
||||||
|
|
||||||
|
RivTernaryScalarMapper* ternaryCellScalarMapper = cellResultSlot->ternaryLegendConfig()->scalarMapper();
|
||||||
|
cellFaceEffectGen.setTernaryScalarMapper(ternaryCellScalarMapper);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (cellResultSlot->hasResult())
|
||||||
|
{
|
||||||
|
RivCellEdgeGeometryGenerator::addCellEdgeResultsToDrawableGeo(timeStepIndex, cellResultSlot, cellEdgeResultSlot,
|
||||||
|
quadToCellFaceMapper, dg, gridIndex, opacityLevel);
|
||||||
|
|
||||||
|
cvf::ScalarMapper* cellScalarMapper = cellResultSlot->legendConfig()->scalarMapper();
|
||||||
|
cellFaceEffectGen.setScalarMapper(cellScalarMapper);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cellFaceEffectGen.setOpacityLevel(opacityLevel);
|
||||||
|
cellFaceEffectGen.setDefaultCellColor(defaultColor);
|
||||||
|
|
||||||
|
cvf::ref<cvf::Effect> eff = cellFaceEffectGen.generateEffect();
|
||||||
|
return eff;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -84,3 +132,4 @@ cvf::ref<cvf::Effect> RivScalarMapperUtils::createTernaryScalarMapperEffect(cons
|
|||||||
|
|
||||||
return scalarEffect;
|
return scalarEffect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,9 +26,13 @@ namespace cvf
|
|||||||
class ScalarMapper;
|
class ScalarMapper;
|
||||||
class Part;
|
class Part;
|
||||||
class Effect;
|
class Effect;
|
||||||
|
class StructGridQuadToCellFaceMapper;
|
||||||
|
class DrawableGeo;
|
||||||
}
|
}
|
||||||
|
|
||||||
class RivTernaryScalarMapper;
|
class RivTernaryScalarMapper;
|
||||||
|
class RimResultSlot;
|
||||||
|
class RimCellEdgeResultSlot;
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
///
|
///
|
||||||
@ -39,6 +43,15 @@ public:
|
|||||||
static void applyTextureResultsToPart(cvf::Part* part, cvf::Vec2fArray* textureCoords, const cvf::ScalarMapper* mapper, float opacityLevel);
|
static void applyTextureResultsToPart(cvf::Part* part, cvf::Vec2fArray* textureCoords, const cvf::ScalarMapper* mapper, float opacityLevel);
|
||||||
static void applyTernaryTextureResultsToPart(cvf::Part* part, cvf::Vec2fArray* textureCoords, const RivTernaryScalarMapper* mapper, float opacityLevel);
|
static void applyTernaryTextureResultsToPart(cvf::Part* part, cvf::Vec2fArray* textureCoords, const RivTernaryScalarMapper* mapper, float opacityLevel);
|
||||||
|
|
||||||
|
static cvf::ref<cvf::Effect> createCellEdgeEffect(cvf::DrawableGeo* dg,
|
||||||
|
const cvf::StructGridQuadToCellFaceMapper* quadToCellFaceMapper,
|
||||||
|
size_t gridIndex,
|
||||||
|
size_t timeStepIndex,
|
||||||
|
RimResultSlot* cellResultSlot,
|
||||||
|
RimCellEdgeResultSlot* cellEdgeResultSlot,
|
||||||
|
float opacityLevel,
|
||||||
|
cvf::Color3f defaultColor);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static cvf::ref<cvf::Effect> createScalarMapperEffect(const cvf::ScalarMapper* mapper, float opacityLevel);
|
static cvf::ref<cvf::Effect> createScalarMapperEffect(const cvf::ScalarMapper* mapper, float opacityLevel);
|
||||||
static cvf::ref<cvf::Effect> createTernaryScalarMapperEffect(const RivTernaryScalarMapper* mapper, float opacityLevel);
|
static cvf::ref<cvf::Effect> createTernaryScalarMapperEffect(const RivTernaryScalarMapper* mapper, float opacityLevel);
|
||||||
|
@ -2057,15 +2057,23 @@ void RimReservoirView::updateFaultColors()
|
|||||||
// Update all fault geometry
|
// Update all fault geometry
|
||||||
std::vector<RivReservoirViewPartMgr::ReservoirGeometryCacheType> faultGeometriesToRecolor = visibleFaultGeometryTypes();
|
std::vector<RivReservoirViewPartMgr::ReservoirGeometryCacheType> faultGeometriesToRecolor = visibleFaultGeometryTypes();
|
||||||
|
|
||||||
RimResultSlot* resultSlot = this->cellResult();
|
RimResultSlot* faultResultSlot = this->cellResult();
|
||||||
if (this->faultResultSettings()->customFaultResult())
|
if (this->faultResultSettings()->customFaultResult())
|
||||||
{
|
{
|
||||||
resultSlot = this->faultResultSettings()->customFaultResult();
|
faultResultSlot = this->faultResultSettings()->customFaultResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (size_t i = 0; i < faultGeometriesToRecolor.size(); ++i)
|
for (size_t i = 0; i < faultGeometriesToRecolor.size(); ++i)
|
||||||
{
|
{
|
||||||
m_reservoirGridPartManager->updateFaultColors(faultGeometriesToRecolor[i], m_currentTimeStep, resultSlot);
|
if (this->animationMode() && this->cellEdgeResult()->hasResult())
|
||||||
|
{
|
||||||
|
m_reservoirGridPartManager->updateFaultCellEdgeResultColor(faultGeometriesToRecolor[i], m_currentTimeStep, faultResultSlot, this->cellEdgeResult());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_reservoirGridPartManager->updateFaultColors(faultGeometriesToRecolor[i], m_currentTimeStep, faultResultSlot);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user