Skip to content

Commit

Permalink
#1138 - pre-proto - Adding field in RimStimPlanColors for transparency
Browse files Browse the repository at this point in the history
  • Loading branch information
astridkbjorke committed Feb 20, 2017
1 parent 0a80163 commit c84f4ef
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ApplicationCode/ModelVisualization/RivWellFracturePartMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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())
{
Expand Down
2 changes: 2 additions & 0 deletions ApplicationCode/ProjectDataModel/RimStimPlanColors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions ApplicationCode/ProjectDataModel/RimStimPlanColors.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ class RimStimPlanColors : public caf::PdmObject
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;
Expand Down

0 comments on commit c84f4ef

Please sign in to comment.