mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2141 Fracture Legend : If conductivity, use legend to set ellipse fracture color
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
#include "RimCase.h"
|
#include "RimCase.h"
|
||||||
#include "RimEclipseView.h"
|
#include "RimEclipseView.h"
|
||||||
|
#include "RimEllipseFractureTemplate.h"
|
||||||
#include "RimFracture.h"
|
#include "RimFracture.h"
|
||||||
#include "RimFractureContainment.h"
|
#include "RimFractureContainment.h"
|
||||||
#include "RimFractureTemplate.h"
|
#include "RimFractureTemplate.h"
|
||||||
@@ -55,6 +56,8 @@
|
|||||||
#include "cvfScalarMapperContinuousLinear.h"
|
#include "cvfScalarMapperContinuousLinear.h"
|
||||||
#include "cvfTransform.h"
|
#include "cvfTransform.h"
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
@@ -272,6 +275,30 @@ cvf::ref<cvf::Part> RivWellFracturePartMgr::createEllipseSurfacePart(const RimEc
|
|||||||
surfacePart->setSourceInfo(new RivObjectSourceInfo(m_rimFracture));
|
surfacePart->setSourceInfo(new RivObjectSourceInfo(m_rimFracture));
|
||||||
|
|
||||||
cvf::Color4f fractureColor = cvf::Color4f(activeView.stimPlanColors->defaultColor());
|
cvf::Color4f fractureColor = cvf::Color4f(activeView.stimPlanColors->defaultColor());
|
||||||
|
|
||||||
|
RimLegendConfig* legendConfig = nullptr;
|
||||||
|
if (activeView.stimPlanColors() && activeView.stimPlanColors()->isChecked())
|
||||||
|
{
|
||||||
|
legendConfig = activeView.stimPlanColors()->activeLegend();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (legendConfig && legendConfig->scalarMapper())
|
||||||
|
{
|
||||||
|
cvf::Color3ub resultColor = cvf::Color3ub(cvf::Color3::LIGHT_GRAY);
|
||||||
|
|
||||||
|
if (activeView.stimPlanColors->resultName().startsWith("CONDUCTIVITY", Qt::CaseInsensitive))
|
||||||
|
{
|
||||||
|
RimEllipseFractureTemplate* ellipseFractureTemplate = dynamic_cast<RimEllipseFractureTemplate*>(m_rimFracture->fractureTemplate());
|
||||||
|
if (ellipseFractureTemplate)
|
||||||
|
{
|
||||||
|
double conductivity = ellipseFractureTemplate->conductivity();
|
||||||
|
resultColor = legendConfig->scalarMapper()->mapToColor(conductivity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fractureColor.set(cvf::Color3f::fromByteColor(resultColor.r(), resultColor.g(), resultColor.b()));
|
||||||
|
}
|
||||||
|
|
||||||
caf::SurfaceEffectGenerator surfaceGen(fractureColor, caf::PO_1);
|
caf::SurfaceEffectGenerator surfaceGen(fractureColor, caf::PO_1);
|
||||||
cvf::ref<cvf::Effect> eff = surfaceGen.generateCachedEffect();
|
cvf::ref<cvf::Effect> eff = surfaceGen.generateCachedEffect();
|
||||||
surfacePart->setEffect(eff.p());
|
surfacePart->setEffect(eff.p());
|
||||||
|
|||||||
Reference in New Issue
Block a user