This commit is contained in:
Magne Sjaastad 2013-12-18 13:21:03 +01:00
parent b7f305b142
commit f492f0eda2
3 changed files with 9 additions and 6 deletions

View File

@ -632,7 +632,7 @@ cvf::ref<cvf::Effect> RivFaultPartMgr::cellResultEffect(const cvf::ScalarMapper*
caf::PolygonOffset polygonOffset = caf::PO_1;
caf::ScalarMapperEffectGenerator scalarEffgen(mapper, polygonOffset);
scalarEffgen.setCullBackfaces(faceCullingMode());
scalarEffgen.setFaceCulling(faceCullingMode());
scalarEffgen.setOpacityLevel(m_opacityLevel);
@ -641,6 +641,9 @@ cvf::ref<cvf::Effect> RivFaultPartMgr::cellResultEffect(const cvf::ScalarMapper*
return scalarEffect;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::FaceCulling RivFaultPartMgr::faceCullingMode() const
{
bool isShowingGrid = m_rimFaultCollection->isGridVisualizationMode();
@ -670,4 +673,4 @@ caf::FaceCulling RivFaultPartMgr::faceCullingMode() const
}
}
return caf::FC_NONE;
}
}

View File

@ -313,7 +313,7 @@ void SurfaceEffectGenerator::updateCommonEffect(cvf::Effect* effect) const
effect->setRenderState(blender.p());
}
// Backface culling
// Face culling
if (m_cullBackfaces != FC_NONE)
{
cvf::ref<cvf::RenderStateCullFace> faceCulling = new cvf::RenderStateCullFace;

View File

@ -155,9 +155,9 @@ class ScalarMapperEffectGenerator : public EffectGenerator
public:
ScalarMapperEffectGenerator(const cvf::ScalarMapper* scalarMapper, PolygonOffset polygonOffset);
void setOpacityLevel(float opacity) { m_opacityLevel = cvf::Math::clamp(opacity, 0.0f , 1.0f ); }
void setUndefinedColor(cvf::Color3f color) { m_undefinedColor = color; }
void setCullBackfaces(FaceCulling faceCullMode) { m_faceCulling = faceCullMode; }
void setOpacityLevel(float opacity) { m_opacityLevel = cvf::Math::clamp(opacity, 0.0f , 1.0f ); }
void setUndefinedColor(cvf::Color3f color) { m_undefinedColor = color; }
void setFaceCulling(FaceCulling faceCulling) { m_faceCulling = faceCulling; }
public:
static cvf::ref<cvf::TextureImage> addAlphaAndUndefStripes(const cvf::TextureImage* texImg, const cvf::Color3f& undefScalarColor, float opacityLevel);
static bool isImagesEqual(const cvf::TextureImage* texImg1, const cvf::TextureImage* texImg2);