Handling new field "Disable Lighting" in the view (#311)

This commit is contained in:
Stein Dale 2015-06-17 15:07:20 +02:00
parent 4b1a71fd91
commit 8bdb957c8c
7 changed files with 31 additions and 12 deletions

View File

@ -26,6 +26,7 @@
#include "RimEclipseView.h"
#include "RimGeoMechResultSlot.h"
#include "RimLegendConfig.h"
#include "RimGeoMechView.h"
#include "RivResultToTextureMapper.h"
#include "RivScalarMapperUtils.h"
@ -278,7 +279,7 @@ void RivFemPartPartMgr::updateCellResultColor(size_t timeStepIndex, RimGeoMechRe
}
}
RivScalarMapperUtils::applyTextureResultsToPart(m_surfaceFaces.p(), m_surfaceFacesTextureCoords.p(), mapper, m_opacityLevel, caf::FC_NONE);
RivScalarMapperUtils::applyTextureResultsToPart(m_surfaceFaces.p(), m_surfaceFacesTextureCoords.p(), mapper, m_opacityLevel, caf::FC_NONE, cellResultSlot->reservoirView()->isLightingDisabled());
}
}

View File

@ -107,8 +107,8 @@ void RivFaultPartMgr::updateCellResultColor(size_t timeStepIndex, RimResultSlot*
if (cellResultSlot->hasStaticResult()) resTimeStepIdx = 0;
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultSlot->porosityModel());
RigCaseData* eclipseCase = cellResultSlot->reservoirView()->eclipseCase()->reservoirData();
RimEclipseView* eclipseView = cellResultSlot->reservoirView();
RigCaseData* eclipseCase = eclipseView->eclipseCase()->reservoirData();
// Faults
if (m_nativeFaultFaces.notNull())
@ -123,7 +123,7 @@ void RivFaultPartMgr::updateCellResultColor(size_t timeStepIndex, RimResultSlot*
texturer.createTextureCoords(m_nativeFaultFacesTextureCoords.p());
const RivTernaryScalarMapper* mapper = cellResultSlot->ternaryLegendConfig()->scalarMapper();
RivScalarMapperUtils::applyTernaryTextureResultsToPart(m_nativeFaultFaces.p(), m_nativeFaultFacesTextureCoords.p(), mapper, m_opacityLevel, this->faceCullingMode());
RivScalarMapperUtils::applyTernaryTextureResultsToPart(m_nativeFaultFaces.p(), m_nativeFaultFacesTextureCoords.p(), mapper, m_opacityLevel, this->faceCullingMode(), eclipseView->isLightingDisabled());
}
else
{
@ -140,7 +140,7 @@ void RivFaultPartMgr::updateCellResultColor(size_t timeStepIndex, RimResultSlot*
texturer.createTextureCoords(m_nativeFaultFacesTextureCoords.p());
const cvf::ScalarMapper* mapper = cellResultSlot->legendConfig()->scalarMapper();
RivScalarMapperUtils::applyTextureResultsToPart(m_nativeFaultFaces.p(), m_nativeFaultFacesTextureCoords.p(), mapper, m_opacityLevel, this->faceCullingMode());
RivScalarMapperUtils::applyTextureResultsToPart(m_nativeFaultFaces.p(), m_nativeFaultFacesTextureCoords.p(), mapper, m_opacityLevel, this->faceCullingMode(), eclipseView->isLightingDisabled());
}
}
@ -156,7 +156,7 @@ void RivFaultPartMgr::updateCellResultColor(size_t timeStepIndex, RimResultSlot*
texturer.createTextureCoords(m_oppositeFaultFacesTextureCoords.p());
const RivTernaryScalarMapper* mapper = cellResultSlot->ternaryLegendConfig()->scalarMapper();
RivScalarMapperUtils::applyTernaryTextureResultsToPart(m_oppositeFaultFaces.p(), m_oppositeFaultFacesTextureCoords.p(), mapper, m_opacityLevel, this->faceCullingMode());
RivScalarMapperUtils::applyTernaryTextureResultsToPart(m_oppositeFaultFaces.p(), m_oppositeFaultFacesTextureCoords.p(), mapper, m_opacityLevel, this->faceCullingMode(), eclipseView->isLightingDisabled());
}
else
{
@ -173,7 +173,7 @@ void RivFaultPartMgr::updateCellResultColor(size_t timeStepIndex, RimResultSlot*
texturer.createTextureCoords(m_oppositeFaultFacesTextureCoords.p());
const cvf::ScalarMapper* mapper = cellResultSlot->legendConfig()->scalarMapper();
RivScalarMapperUtils::applyTextureResultsToPart(m_oppositeFaultFaces.p(), m_oppositeFaultFacesTextureCoords.p(), mapper, m_opacityLevel, this->faceCullingMode());
RivScalarMapperUtils::applyTextureResultsToPart(m_oppositeFaultFaces.p(), m_oppositeFaultFacesTextureCoords.p(), mapper, m_opacityLevel, this->faceCullingMode(), eclipseView->isLightingDisabled());
}
}
}
@ -192,7 +192,7 @@ void RivFaultPartMgr::updateCellEdgeResultColor(size_t timeStepIndex, RimResultS
{
cvf::ref<cvf::Effect> eff = RivScalarMapperUtils::createCellEdgeEffect(dg, m_nativeFaultGenerator->quadToCellFaceMapper(),
m_grid->gridIndex(),
timeStepIndex, cellResultSlot, cellEdgeResultSlot, m_opacityLevel, m_defaultColor, this->faceCullingMode());
timeStepIndex, cellResultSlot, cellEdgeResultSlot, m_opacityLevel, m_defaultColor, this->faceCullingMode(), cellResultSlot->reservoirView()->isLightingDisabled());
m_nativeFaultFaces->setEffect(eff.p());
}
@ -204,7 +204,7 @@ void RivFaultPartMgr::updateCellEdgeResultColor(size_t timeStepIndex, RimResultS
if (dg)
{
cvf::ref<cvf::Effect> eff = RivScalarMapperUtils::createCellEdgeEffect(dg, m_oppositeFaultGenerator->quadToCellFaceMapper(), m_grid->gridIndex(),
timeStepIndex, cellResultSlot, cellEdgeResultSlot, m_opacityLevel, m_defaultColor, this->faceCullingMode());
timeStepIndex, cellResultSlot, cellEdgeResultSlot, m_opacityLevel, m_defaultColor, this->faceCullingMode(), cellResultSlot->reservoirView()->isLightingDisabled());
m_oppositeFaultFaces->setEffect(eff.p());
}

View File

@ -242,7 +242,7 @@ void RivGridPartMgr::updateCellResultColor(size_t timeStepIndex, RimResultSlot*
texturer.createTextureCoords(m_surfaceFacesTextureCoords.p());
const RivTernaryScalarMapper* mapper = cellResultSlot->ternaryLegendConfig()->scalarMapper();
RivScalarMapperUtils::applyTernaryTextureResultsToPart(m_surfaceFaces.p(), m_surfaceFacesTextureCoords.p(), mapper, m_opacityLevel, caf::FC_NONE);
RivScalarMapperUtils::applyTernaryTextureResultsToPart(m_surfaceFaces.p(), m_surfaceFacesTextureCoords.p(), mapper, m_opacityLevel, caf::FC_NONE, cellResultSlot->reservoirView()->isLightingDisabled());
}
else
{
@ -258,7 +258,7 @@ void RivGridPartMgr::updateCellResultColor(size_t timeStepIndex, RimResultSlot*
texturer.createTextureCoords(m_surfaceFacesTextureCoords.p());
const cvf::ScalarMapper* mapper = cellResultSlot->legendConfig()->scalarMapper();
RivScalarMapperUtils::applyTextureResultsToPart(m_surfaceFaces.p(), m_surfaceFacesTextureCoords.p(), mapper, m_opacityLevel, caf::FC_NONE);
RivScalarMapperUtils::applyTextureResultsToPart(m_surfaceFaces.p(), m_surfaceFacesTextureCoords.p(), mapper, m_opacityLevel, caf::FC_NONE, cellResultSlot->reservoirView()->isLightingDisabled());
}
}
}
@ -274,7 +274,7 @@ void RivGridPartMgr::updateCellEdgeResultColor(size_t timeStepIndex, RimResultSl
if (dg)
{
cvf::ref<cvf::Effect> eff = RivScalarMapperUtils::createCellEdgeEffect(dg, m_surfaceGenerator.quadToCellFaceMapper(), m_grid->gridIndex(),
timeStepIndex, cellResultSlot, cellEdgeResultSlot, m_opacityLevel, m_defaultColor, caf::FC_NONE);
timeStepIndex, cellResultSlot, cellEdgeResultSlot, m_opacityLevel, m_defaultColor, caf::FC_NONE, cellResultSlot->reservoirView()->isLightingDisabled());
m_surfaceFaces->setEffect(eff.p());
}

View File

@ -694,6 +694,8 @@ void RimEclipseView::loadDataAndUpdate()
setDefaultView();
}
bool resultPresent = cellResult() ? cellResult()->hasStaticResult() || cellResult()->hasDynamicResult() : false;
uiEnableDisableLighting(resultPresent);
}

View File

@ -26,6 +26,7 @@
#include "cafPdmUiListEditor.h"
#include "RigGeoMechCaseData.h"
#include "RigFemPartResultsCollection.h"
#include "RiuMainWindow.h"
namespace caf {
@ -134,6 +135,15 @@ void RimGeoMechResultSlot::setReservoirView(RimGeoMechView* ownerReservoirView)
m_reservoirView = ownerReservoirView;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimGeoMechView* RimGeoMechResultSlot::reservoirView()
{
return m_reservoirView;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -177,6 +187,8 @@ void RimGeoMechResultSlot::fieldChangedByUi(const caf::PdmFieldHandle* changedFi
if (m_reservoirView->geoMechCase()->geoMechData()->femPartResults()->assertResultsLoaded(this->resultAddress()))
{
m_reservoirView->hasUserRequestedAnimation = true;
m_reservoirView->uiEnableDisableLighting(true);
RiuMainWindow::instance()->refreshDrawStyleActions();
}
m_reservoirView->createDisplayModelAndRedraw();

View File

@ -43,6 +43,8 @@ public:
virtual ~RimGeoMechResultSlot(void);
void setReservoirView(RimGeoMechView* ownerReservoirView);
RimGeoMechView* reservoirView();
RigGeoMechCaseData* ownerCaseData();
bool hasResult();

View File

@ -71,6 +71,8 @@ void RimResultSlot::fieldChangedByUi(const caf::PdmFieldHandle* changedField, co
if (oldValue != newValue)
{
changeLegendConfig(this->resultVariable());
if (m_reservoirView) m_reservoirView->uiEnableDisableLighting(true);
RiuMainWindow::instance()->refreshDrawStyleActions();
}
if (newValue != RimDefines::undefinedResultName())