1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-13 14:27:08 +03:00

0029823: Visualization, TKOpenGl - highlighting by Bounding Box mistreats Local Transformation

The problem when object transformation was applied to the bounding box twice has been fixed in OpenGl_Structure.
OpenGl_ShaderManager has been extended with GLSL program drawing bounding box.
OpenGl_Structure does not create extra Groups for drawing bounding box.
This commit is contained in:
mnv
2018-07-02 11:21:35 +03:00
committed by bugmaster
parent 1b661a81d5
commit 98b15dbfce
7 changed files with 208 additions and 164 deletions

View File

@@ -32,6 +32,7 @@
#include <OpenGl_Texture.hxx>
class OpenGl_View;
class OpenGl_VertexBuffer;
//! List of shader programs.
typedef NCollection_Sequence<Handle(OpenGl_ShaderProgram)> OpenGl_ShaderProgramList;
@@ -204,6 +205,19 @@ public:
&& myContext->BindProgram (aProgram);
}
//! Bind program for rendering bounding box.
Standard_Boolean BindBoundBoxProgram()
{
if (myBoundBoxProgram.IsNull())
{
prepareStdProgramBoundBox();
}
return bindProgramWithState (myBoundBoxProgram);
}
//! Returns bounding box vertex buffer.
const Handle(OpenGl_VertexBuffer)& BoundBoxVertBuffer() const { return myBoundBoxVertBuffer; }
public:
//! Returns current state of OCCT light sources.
@@ -538,6 +552,9 @@ protected:
Standard_EXPORT Standard_Boolean prepareStdProgramStereo (Handle(OpenGl_ShaderProgram)& theProgram,
const Graphic3d_StereoMode theStereoMode);
//! Prepare standard GLSL program for bounding box.
Standard_EXPORT Standard_Boolean prepareStdProgramBoundBox();
protected:
//! Packed properties of light source
@@ -606,11 +623,14 @@ protected:
Handle(OpenGl_SetOfShaderPrograms) myUnlitPrograms; //!< programs matrix without lighting
Handle(OpenGl_ShaderProgram) myFontProgram; //!< standard program for textured text
Handle(OpenGl_ShaderProgram) myBlitProgram; //!< standard program for FBO blit emulation
Handle(OpenGl_ShaderProgram) myBoundBoxProgram; //!< standard program for bounding box
Handle(OpenGl_ShaderProgram) myOitCompositingProgram[2]; //!< standard program for OIT compositing (default and MSAA).
OpenGl_MapOfShaderPrograms myMapOfLightPrograms; //!< map of lighting programs depending on lights configuration
Handle(OpenGl_ShaderProgram) myStereoPrograms[Graphic3d_StereoMode_NB]; //!< standard stereo programs
Handle(OpenGl_VertexBuffer) myBoundBoxVertBuffer; //!< bounding box vertex buffer
OpenGl_Context* myContext; //!< OpenGL context
protected: