#1242 Do not use transparency on ellipse, default transparency set to 1.0

This commit is contained in:
Magne Sjaastad
2017-02-23 11:25:21 +01:00
parent 7f75f7e509
commit f59c4b4b9e
3 changed files with 24 additions and 5 deletions

View File

@@ -24,6 +24,7 @@
#include "RimOilField.h"
#include "RimProject.h"
#include "cafPdmUiDoubleSliderEditor.h"
#include "cafPdmUiItem.h"
#include "cafPdmUiTreeOrdering.h"
@@ -43,7 +44,9 @@ RimStimPlanColors::RimStimPlanColors()
CAF_PDM_InitObject("StimPlan Colors", ":/FractureSymbol16x16.png", "", "");
CAF_PDM_InitField(&m_resultNameAndUnit, "ResultName", QString(""), "StimPlan Result Variable", "", "", "");
CAF_PDM_InitField(&m_opacityLevel, "opacityLevel", 0.2f, "Transparency", "", "", "");
CAF_PDM_InitField(&m_opacityLevel, "opacityLevel", 1.0f, "Transparency", "", "", "");
m_opacityLevel.uiCapability()->setUiEditorTypeName(caf::PdmUiDoubleSliderEditor::uiEditorTypeName());
CAF_PDM_InitField(&m_defaultColor, "DefaultColor", cvf::Color3f(cvf::Color3::BROWN), "Default Color", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_legendConfigurations, "LegendConfigurations", "", "", "", "");
@@ -312,3 +315,21 @@ void RimStimPlanColors::defineUiOrdering(QString uiConfigName, caf::PdmUiOrderin
uiOrdering.setForgetRemainingFields(true);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimStimPlanColors::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute)
{
if (field == &m_opacityLevel)
{
caf::PdmUiDoubleSliderEditorAttribute* myAttr = dynamic_cast<caf::PdmUiDoubleSliderEditorAttribute*>(attribute);
if (myAttr)
{
myAttr->m_minimum = 0.0;
myAttr->m_maximum = 1.0;
myAttr->m_decimals = 2;
myAttr->m_sliderTickCount = 100;
}
}
}