mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-07 18:30:55 +03:00
0025060: Capping breaks highlighting of shaded AIS_Shape with displayed edges
Capping algorithm - remember and restore depth function mode.
This commit is contained in:
parent
fe9fc66996
commit
347423b2c2
@ -103,6 +103,12 @@ void OpenGl_CappingAlgo::RenderCapping (const Handle(OpenGl_Workspace)& theWork
|
|||||||
// prepare for rendering the clip planes
|
// prepare for rendering the clip planes
|
||||||
glEnable (GL_STENCIL_TEST);
|
glEnable (GL_STENCIL_TEST);
|
||||||
|
|
||||||
|
// remember current state of depth
|
||||||
|
// function and change its value
|
||||||
|
GLint aDepthFuncPrev;
|
||||||
|
glGetIntegerv (GL_DEPTH_FUNC, &aDepthFuncPrev);
|
||||||
|
glDepthFunc (GL_LESS);
|
||||||
|
|
||||||
// generate capping for every clip plane
|
// generate capping for every clip plane
|
||||||
for (aCappingIt.Init (aContextPlanes); aCappingIt.More(); aCappingIt.Next())
|
for (aCappingIt.Init (aContextPlanes); aCappingIt.More(); aCappingIt.Next())
|
||||||
{
|
{
|
||||||
@ -158,7 +164,6 @@ void OpenGl_CappingAlgo::RenderCapping (const Handle(OpenGl_Workspace)& theWork
|
|||||||
// render capping plane using the generated stencil mask
|
// render capping plane using the generated stencil mask
|
||||||
glColorMask (GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
glColorMask (GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||||
glDepthMask (GL_TRUE);
|
glDepthMask (GL_TRUE);
|
||||||
glDepthFunc (GL_LESS);
|
|
||||||
glStencilFunc (GL_EQUAL, 1, 0x01);
|
glStencilFunc (GL_EQUAL, 1, 0x01);
|
||||||
glStencilOp (GL_KEEP, GL_KEEP, GL_KEEP);
|
glStencilOp (GL_KEEP, GL_KEEP, GL_KEEP);
|
||||||
glEnable (GL_DEPTH_TEST);
|
glEnable (GL_DEPTH_TEST);
|
||||||
@ -168,6 +173,7 @@ void OpenGl_CappingAlgo::RenderCapping (const Handle(OpenGl_Workspace)& theWork
|
|||||||
|
|
||||||
// restore previous application state
|
// restore previous application state
|
||||||
glClear (GL_STENCIL_BUFFER_BIT);
|
glClear (GL_STENCIL_BUFFER_BIT);
|
||||||
|
glDepthFunc (aDepthFuncPrev);
|
||||||
glStencilFunc (GL_ALWAYS, 0, 0xFF);
|
glStencilFunc (GL_ALWAYS, 0, 0xFF);
|
||||||
glDisable (GL_STENCIL_TEST);
|
glDisable (GL_STENCIL_TEST);
|
||||||
|
|
||||||
|
27
tests/bugs/vis/bug25060
Normal file
27
tests/bugs/vis/bug25060
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "CR25060"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
#######################################################################
|
||||||
|
# Capping breaks highlighting of shaded AIS_Shape with displayed edges.
|
||||||
|
#######################################################################
|
||||||
|
vinit View1
|
||||||
|
box b 10 10 10
|
||||||
|
vdisplay b
|
||||||
|
vshowfaceboundary b 1
|
||||||
|
vclipplane create pln1
|
||||||
|
vclipplane set pln1 object b
|
||||||
|
vclipplane change pln1 equation 0 1 0 -5
|
||||||
|
vclipplane change pln1 capping on
|
||||||
|
vsetdispmode 1
|
||||||
|
vfit
|
||||||
|
vmoveto 304 146
|
||||||
|
|
||||||
|
set x_coord 304
|
||||||
|
set y_coord 146
|
||||||
|
checkcolor $x_coord $y_coord 0 1 1
|
||||||
|
if { $stat != 1 } {
|
||||||
|
puts "Error : Highlighting is broken."
|
||||||
|
}
|
||||||
|
|
||||||
|
set only_screen 1
|
Loading…
x
Reference in New Issue
Block a user