mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#656) Added text effect to effect generator
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivGridBoxGenerator::RivGridBoxGenerator(cvf::ShaderProgram* textShaderProgram)
|
||||
RivGridBoxGenerator::RivGridBoxGenerator()
|
||||
: m_gridColor(cvf::Color3f::LIGHT_GRAY),
|
||||
m_gridLegendColor(cvf::Color3f::BLACK)
|
||||
{
|
||||
@@ -44,12 +44,6 @@ RivGridBoxGenerator::RivGridBoxGenerator(cvf::ShaderProgram* textShaderProgram)
|
||||
|
||||
m_scaleZ = 1.0;
|
||||
m_displayModelOffset = cvf::Vec3d::ZERO;
|
||||
|
||||
m_textEffect = new cvf::Effect;
|
||||
if (textShaderProgram)
|
||||
{
|
||||
m_textEffect->setShaderProgram(textShaderProgram);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -562,7 +556,9 @@ void RivGridBoxGenerator::createLegend(EdgeType edge, cvf::Collection<cvf::Part>
|
||||
part->setDrawable(geo.p());
|
||||
part->updateBoundingBox();
|
||||
|
||||
part->setEffect(m_textEffect.p());
|
||||
caf::TextEffectGenerator textGen;
|
||||
cvf::ref<cvf::Effect> eff = textGen.generateCachedEffect();
|
||||
part->setEffect(eff.p());
|
||||
|
||||
parts->push_back(part.p());
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace cvf
|
||||
class RivGridBoxGenerator
|
||||
{
|
||||
public:
|
||||
RivGridBoxGenerator(cvf::ShaderProgram* textShaderProgram);
|
||||
RivGridBoxGenerator();
|
||||
|
||||
void setScaleZ(double scaleZ);
|
||||
void setDisplayModelOffset(cvf::Vec3d offset);
|
||||
@@ -126,7 +126,5 @@ private:
|
||||
|
||||
cvf::Color3f m_gridColor;
|
||||
cvf::Color3f m_gridLegendColor;
|
||||
|
||||
cvf::ref<cvf::Effect> m_textEffect;
|
||||
};
|
||||
|
||||
|
||||
@@ -167,12 +167,7 @@ RiuViewer::RiuViewer(const QGLFormat& format, QWidget* parent)
|
||||
// which solves the problem
|
||||
setContextMenuPolicy(Qt::PreventContextMenu);
|
||||
|
||||
cvf::ShaderProgram* textShaderProgram = NULL;
|
||||
if (format.directRendering())
|
||||
{
|
||||
textShaderProgram = cvfOpenGLContext()->resourceManager()->getLinkedTextShaderProgram(cvfOpenGLContext());
|
||||
}
|
||||
m_gridBoxGenerator = new RivGridBoxGenerator(textShaderProgram);
|
||||
m_gridBoxGenerator = new RivGridBoxGenerator;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user