mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1252 Add and use transparent color for both ellipse and stim plan objects
This commit is contained in:
parent
5ccde99cb3
commit
7f75f7e509
@ -89,10 +89,19 @@ void RivWellFracturePartMgr::updatePartGeometry(caf::DisplayCoordTransform* disp
|
||||
m_part = new cvf::Part;
|
||||
m_part->setDrawable(geo.p());
|
||||
|
||||
caf::SurfaceEffectGenerator surfaceGen(cvf::Color4f(cvf::Color3f(cvf::Color3::BROWN)), caf::PO_1);
|
||||
cvf::ref<cvf::Effect> eff = surfaceGen.generateCachedEffect();
|
||||
cvf::Color4f fractureColor = cvf::Color4f(cvf::Color3f(cvf::Color3::BROWN));
|
||||
|
||||
RimEclipseView* activeView = dynamic_cast<RimEclipseView*>(RiaApplication::instance()->activeReservoirView());
|
||||
if (activeView)
|
||||
{
|
||||
fractureColor = cvf::Color4f(activeView->stimPlanColors->defaultColor(), activeView->stimPlanColors->opacityLevel());
|
||||
}
|
||||
|
||||
caf::SurfaceEffectGenerator surfaceGen(fractureColor, caf::PO_1);
|
||||
cvf::ref<cvf::Effect> eff = surfaceGen.generateCachedEffect();
|
||||
m_part->setEffect(eff.p());
|
||||
|
||||
m_part->setPriority(RivPartPriority::PartType::Transparent);
|
||||
}
|
||||
}
|
||||
|
||||
@ -201,8 +210,7 @@ void RivWellFracturePartMgr::updatePartGeometryTexture(caf::DisplayCoordTransfor
|
||||
}
|
||||
else
|
||||
{
|
||||
cvf::Color4f fractureColor = cvf::Color4f(cvf::Color3f(cvf::Color3::BROWN));
|
||||
fractureColor.a() = opacityLevel;
|
||||
cvf::Color4f fractureColor = cvf::Color4f(activeView->stimPlanColors->defaultColor(), opacityLevel);
|
||||
|
||||
caf::SurfaceEffectGenerator surfaceGen(fractureColor, caf::PO_1);
|
||||
cvf::ref<cvf::Effect> eff = surfaceGen.generateCachedEffect();
|
||||
|
@ -42,13 +42,15 @@ RimStimPlanColors::RimStimPlanColors()
|
||||
{
|
||||
CAF_PDM_InitObject("StimPlan Colors", ":/FractureSymbol16x16.png", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_resultNameAndUnit, "ResultName", QString(""), "Result Variable", "", "", "");
|
||||
CAF_PDM_InitField(&m_resultNameAndUnit, "ResultName", QString(""), "StimPlan Result Variable", "", "", "");
|
||||
CAF_PDM_InitField(&m_opacityLevel, "opacityLevel", 0.2f, "Transparency", "", "", "");
|
||||
CAF_PDM_InitField(&m_defaultColor, "DefaultColor", cvf::Color3f(cvf::Color3::BROWN), "Default Color", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_legendConfigurations, "LegendConfigurations", "", "", "", "");
|
||||
m_legendConfigurations.uiCapability()->setUiTreeHidden(true);
|
||||
|
||||
m_name = "StimPlan Colors";
|
||||
m_name = "Fracture Colors";
|
||||
m_name.uiCapability()->setUiReadOnly(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -203,6 +205,14 @@ float RimStimPlanColors::opacityLevel() const
|
||||
return m_opacityLevel();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
cvf::Color3f RimStimPlanColors::defaultColor() const
|
||||
{
|
||||
return m_defaultColor();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -297,6 +307,8 @@ void RimStimPlanColors::defineUiOrdering(QString uiConfigName, caf::PdmUiOrderin
|
||||
{
|
||||
uiOrdering.add(&m_resultNameAndUnit);
|
||||
uiOrdering.add(&m_opacityLevel);
|
||||
uiOrdering.add(&m_defaultColor);
|
||||
|
||||
uiOrdering.setForgetRemainingFields(true);
|
||||
}
|
||||
|
||||
|
@ -25,10 +25,14 @@
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
|
||||
// Include to make Pdm work for cvf::Color
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
|
||||
namespace caf {
|
||||
class PdmOptionItemInfo;
|
||||
}
|
||||
|
||||
|
||||
class RimLegendConfig;
|
||||
class RimFractureTemplateCollection;
|
||||
|
||||
@ -48,6 +52,7 @@ public:
|
||||
QString resultName() const;
|
||||
QString unit() const;
|
||||
float opacityLevel() const;
|
||||
cvf::Color3f defaultColor() const;
|
||||
|
||||
void loadDataAndUpdate();
|
||||
void updateLegendData();
|
||||
@ -68,6 +73,7 @@ private:
|
||||
|
||||
private:
|
||||
caf::PdmField<float> m_opacityLevel;
|
||||
caf::PdmField<cvf::Color3f> m_defaultColor;
|
||||
caf::PdmField<QString> m_resultNameAndUnit;
|
||||
caf::PdmChildArrayField<RimLegendConfig*> m_legendConfigurations;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user