From c84f4efbb1ed47226609ba9b491934108879d672 Mon Sep 17 00:00:00 2001 From: astridkbjorke Date: Mon, 20 Feb 2017 13:24:22 +0100 Subject: [PATCH] #1138 - pre-proto - Adding field in RimStimPlanColors for transparency --- .../ModelVisualization/RivWellFracturePartMgr.cpp | 8 ++++++-- ApplicationCode/ProjectDataModel/RimStimPlanColors.cpp | 2 ++ ApplicationCode/ProjectDataModel/RimStimPlanColors.h | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/ModelVisualization/RivWellFracturePartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellFracturePartMgr.cpp index 7d25419fc3..225c69f06b 100644 --- a/ApplicationCode/ModelVisualization/RivWellFracturePartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivWellFracturePartMgr.cpp @@ -115,9 +115,11 @@ void RivWellFracturePartMgr::updatePartGeometryTexture(caf::DisplayCoordTransfor RimLegendConfig* legendConfig = nullptr; RimEclipseView* activeView = dynamic_cast(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()) { diff --git a/ApplicationCode/ProjectDataModel/RimStimPlanColors.cpp b/ApplicationCode/ProjectDataModel/RimStimPlanColors.cpp index 9ef3929a50..b731b432a4 100644 --- a/ApplicationCode/ProjectDataModel/RimStimPlanColors.cpp +++ b/ApplicationCode/ProjectDataModel/RimStimPlanColors.cpp @@ -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); diff --git a/ApplicationCode/ProjectDataModel/RimStimPlanColors.h b/ApplicationCode/ProjectDataModel/RimStimPlanColors.h index b7105b43ac..cd26b80460 100644 --- a/ApplicationCode/ProjectDataModel/RimStimPlanColors.h +++ b/ApplicationCode/ProjectDataModel/RimStimPlanColors.h @@ -51,6 +51,9 @@ class RimStimPlanColors : public caf::PdmObject void loadDataAndUpdate(); void updateLegendData(); + caf::PdmField opacityLevel; + + protected: virtual QList calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override; virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;