#3591 Improve edges on contour map.

This commit is contained in:
Gaute Lindkvist
2018-10-31 16:09:14 +01:00
parent f87f1430dc
commit ee388ca4b0
11 changed files with 131 additions and 45 deletions

View File

@@ -19,8 +19,6 @@
#include "RivScalarMapperUtils.h"
#include "RiaColorTables.h"
#include "RimCellEdgeColors.h"
#include "RimEclipseCellColors.h"
#include "RimEclipseView.h"
@@ -41,14 +39,14 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivScalarMapperUtils::applyTextureResultsToPart(cvf::Part* part, cvf::Vec2fArray* textureCoords, const cvf::ScalarMapper* mapper, float opacityLevel, caf::FaceCulling faceCulling, bool disableLighting)
void RivScalarMapperUtils::applyTextureResultsToPart(cvf::Part* part, cvf::Vec2fArray* textureCoords, const cvf::ScalarMapper* mapper, float opacityLevel, caf::FaceCulling faceCulling, bool disableLighting, const cvf::Color3f& undefColor)
{
CVF_ASSERT(part && textureCoords && mapper);
cvf::DrawableGeo* dg = dynamic_cast<cvf::DrawableGeo*>(part->drawable());
if (dg) dg->setTextureCoordArray(textureCoords);
cvf::ref<cvf::Effect> scalarEffect = RivScalarMapperUtils::createScalarMapperEffect(mapper, opacityLevel, faceCulling, disableLighting);
cvf::ref<cvf::Effect> scalarEffect = RivScalarMapperUtils::createScalarMapperEffect(mapper, opacityLevel, faceCulling, disableLighting, undefColor);
part->setEffect(scalarEffect.p());
}
@@ -122,7 +120,7 @@ cvf::ref<cvf::Effect> RivScalarMapperUtils::createCellEdgeEffect(cvf::DrawableGe
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::ref<cvf::Effect> RivScalarMapperUtils::createScalarMapperEffect(const cvf::ScalarMapper* mapper, float opacityLevel, caf::FaceCulling faceCulling, bool disableLighting)
cvf::ref<cvf::Effect> RivScalarMapperUtils::createScalarMapperEffect(const cvf::ScalarMapper* mapper, float opacityLevel, caf::FaceCulling faceCulling, bool disableLighting, const cvf::Color3f& undefColor)
{
CVF_ASSERT(mapper);
@@ -130,7 +128,7 @@ cvf::ref<cvf::Effect> RivScalarMapperUtils::createScalarMapperEffect(const cvf::
caf::ScalarMapperEffectGenerator scalarEffgen(mapper, polygonOffset);
scalarEffgen.setOpacityLevel(opacityLevel);
scalarEffgen.setFaceCulling(faceCulling);
scalarEffgen.setUndefinedColor(RiaColorTables::undefinedCellColor());
scalarEffgen.setUndefinedColor(undefColor);
scalarEffgen.disableLighting(disableLighting);
cvf::ref<cvf::Effect> scalarEffect = scalarEffgen.generateCachedEffect();