1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-24 13:50:49 +03:00

0024819: TKOpenGl - extend the ray-tracing core by visualization of lines, text and point sprites

OpenGl_GraphicDriver::Redraw() - do not recompute structures more than required
OpenGl_Workspace::Raytrace() - bind proper FBO before clearing it
Visual3d_View::Redraw() - perform automatic 2nd redraw on device lost
This commit is contained in:
osa
2014-07-03 15:49:48 +04:00
committed by apn
parent 8d3865d870
commit a89742cf17
11 changed files with 508 additions and 93 deletions

View File

@@ -453,7 +453,10 @@ void OpenGl_View::Render (const Handle(OpenGl_PrinterContext)& thePrintContext,
// ====================================
// Render background
DrawBackground (*theWorkspace);
if (theWorkspace->ToRedrawGL())
{
DrawBackground (*theWorkspace);
}
// Switch off lighting by default
glDisable(GL_LIGHTING);
@@ -600,26 +603,22 @@ void OpenGl_View::Render (const Handle(OpenGl_PrinterContext)& thePrintContext,
OpenGl_ShaderProgram::Unbind (aContext);
}
// display global trihedron
if (myTrihedron != NULL)
// Render trihedron
if (theWorkspace->ToRedrawGL())
{
myTrihedron->Render (theWorkspace);
}
if (myGraduatedTrihedron != NULL)
{
myGraduatedTrihedron->Render (theWorkspace);
}
RedrawTrihedron (theWorkspace);
// Restore face culling
if ( myBackfacing )
{
if ( isCullFace )
// Restore face culling
if ( myBackfacing )
{
glEnable ( GL_CULL_FACE );
glCullFace ( GL_BACK );
if ( isCullFace )
{
glEnable ( GL_CULL_FACE );
glCullFace ( GL_BACK );
}
else
glDisable ( GL_CULL_FACE );
}
else
glDisable ( GL_CULL_FACE );
}
// ===============================
@@ -846,6 +845,21 @@ void OpenGl_View::RedrawLayer2d (const Handle(OpenGl_PrinterContext)& thePrintCo
/*----------------------------------------------------------------------*/
void OpenGl_View::RedrawTrihedron (const Handle(OpenGl_Workspace) &theWorkspace)
{
// display global trihedron
if (myTrihedron != NULL)
{
myTrihedron->Render (theWorkspace);
}
if (myGraduatedTrihedron != NULL)
{
myGraduatedTrihedron->Render (theWorkspace);
}
}
/*----------------------------------------------------------------------*/
//call_togl_create_bg_texture
void OpenGl_View::CreateBackgroundTexture (const Standard_CString theFilePath,
const Aspect_FillMethod theFillStyle)