#1138 - pre-proto - Adding field in RimStimPlanColors for transparency

This commit is contained in:
astridkbjorke
2017-02-20 13:24:22 +01:00
parent 0a801635dd
commit c84f4efbb1
3 changed files with 11 additions and 2 deletions

View File

@@ -115,9 +115,11 @@ void RivWellFracturePartMgr::updatePartGeometryTexture(caf::DisplayCoordTransfor
RimLegendConfig* legendConfig = nullptr;
RimEclipseView* activeView = dynamic_cast<RimEclipseView*>(RiaApplication::instance()->activeReservoirView());
RimStimPlanColors* stimPlanColors;
if (activeView)
{
legendConfig = activeView->stimPlanColors->activeLegend();
stimPlanColors = activeView->stimPlanColors;
legendConfig = stimPlanColors->activeLegend();
}
// Note : If no legend is found, draw geo using a single color
@@ -179,7 +181,9 @@ void RivWellFracturePartMgr::updatePartGeometryTexture(caf::DisplayCoordTransfor
geo->setTextureCoordArray(textureCoords.p());
caf::ScalarMapperEffectGenerator effGen(scalarMapper, caf::PO_NEG_LARGE);
effGen.setOpacityLevel(0.2f);
float opacityLevel = activeView->stimPlanColors->opacityLevel();
effGen.setOpacityLevel(opacityLevel);
if (activeView && activeView->isLightingDisabled())
{

View File

@@ -43,6 +43,8 @@ RimStimPlanColors::RimStimPlanColors()
CAF_PDM_InitObject("StimPlan Colors", ":/draw_style_faults_24x24.png", "", "");
CAF_PDM_InitField(&m_resultNameAndUnit, "ResultName", QString(""), "Result Variable", "", "", "");
CAF_PDM_InitField(&opacityLevel, "opacityLevel", 0.2f, "StimPlan grid Transparency", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_legendConfigurations, "LegendConfigurations", "", "", "", "");
m_legendConfigurations.uiCapability()->setUiTreeHidden(true);

View File

@@ -51,6 +51,9 @@ public:
void loadDataAndUpdate();
void updateLegendData();
caf::PdmField<float> opacityLevel;
protected:
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;