(#266) Functions to be called from a constructor cannot be virtual

Improved immediate mode to be applied on all renderings
This commit is contained in:
Magne Sjaastad 2015-11-16 10:00:22 +01:00
parent 121ee80295
commit 6e56ee28c2
2 changed files with 17 additions and 8 deletions

View File

@ -135,7 +135,7 @@ caf::Viewer::~Viewer()
}
//--------------------------------------------------------------------------------------------------
/// This method is supposed to setup the contents of the main rendering
///
//--------------------------------------------------------------------------------------------------
void caf::Viewer::setupMainRendering()
{
@ -152,9 +152,7 @@ void caf::Viewer::setupMainRendering()
}
//--------------------------------------------------------------------------------------------------
/// This method is supposed to assemble the rendering sequence (cvf::RenderSequence) based on
/// the Viewers renderings. THe ViewerBase has only one rendering. The m_mainRendering
/// Reimplement to build more advanced rendering sequences
///
//--------------------------------------------------------------------------------------------------
void caf::Viewer::setupRenderingSequence()
{
@ -163,7 +161,6 @@ void caf::Viewer::setupRenderingSequence()
updateCamera(width(), height());
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -754,9 +751,20 @@ QSize caf::Viewer::sizeHint() const
return QSize(500, 400);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void caf::Viewer::enableForcedImmediateMode(bool enable)
{
m_mainRendering->renderEngine()->enableForcedImmediateMode(enable);
cvf::uint rIdx = m_renderingSequence->renderingCount();
for (rIdx = 0; rIdx < m_renderingSequence->renderingCount(); rIdx++)
{
cvf::Rendering* rendering = m_renderingSequence->rendering(rIdx);
if (rendering && rendering->scene())
{
rendering->renderEngine()->enableForcedImmediateMode(enable);
}
}
}
//--------------------------------------------------------------------------------------------------

View File

@ -146,8 +146,6 @@ protected:
virtual void paintOverlayItems(QPainter* painter) {};
// Overridable methods to setup the render system
virtual void setupMainRendering();
virtual void setupRenderingSequence();
virtual void optimizeClippingPlanes();
// Standard overrides. Not for overriding
@ -169,6 +167,9 @@ protected:
double m_maxFarPlaneDistance;
private:
void setupMainRendering();
void setupRenderingSequence();
void updateCamera(int width, int height);
void releaseOGlResourcesForCurrentFrame();