mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-06 18:26:22 +03:00
0024717: TKOpenGl - globally defined clipping planes blink when operating with view
Specify viewer (global) clippings in correct view transformation space. Correction of test case for issue CR24717
This commit is contained in:
parent
a0fc422a3a
commit
cddbf6a985
@ -1145,7 +1145,7 @@ void OpenGl_View::RedrawScene (const Handle(OpenGl_PrinterContext)& thePrintCont
|
|||||||
aPlaneFront = new Graphic3d_ClipPlane (aFrontEquation);
|
aPlaneFront = new Graphic3d_ClipPlane (aFrontEquation);
|
||||||
}
|
}
|
||||||
|
|
||||||
// do some "memory allocation"-wise optimization
|
// Specify slicing planes with identity transformation
|
||||||
if (!aPlaneBack.IsNull() || !aPlaneFront.IsNull())
|
if (!aPlaneBack.IsNull() || !aPlaneFront.IsNull())
|
||||||
{
|
{
|
||||||
Graphic3d_SequenceOfHClipPlane aSlicingPlanes;
|
Graphic3d_SequenceOfHClipPlane aSlicingPlanes;
|
||||||
@ -1164,32 +1164,6 @@ void OpenGl_View::RedrawScene (const Handle(OpenGl_PrinterContext)& thePrintCont
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply user clipping planes
|
|
||||||
if (!myClipPlanes.IsEmpty())
|
|
||||||
{
|
|
||||||
Graphic3d_SequenceOfHClipPlane aUserPlanes;
|
|
||||||
Graphic3d_SequenceOfHClipPlane::Iterator aClippingIt (myClipPlanes);
|
|
||||||
for (; aClippingIt.More(); aClippingIt.Next())
|
|
||||||
{
|
|
||||||
const Handle(Graphic3d_ClipPlane)& aClipPlane = aClippingIt.Value();
|
|
||||||
if (aClipPlane->IsOn())
|
|
||||||
{
|
|
||||||
aUserPlanes.Append (aClipPlane);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!aUserPlanes.IsEmpty())
|
|
||||||
{
|
|
||||||
// add planes at actual matrix state.
|
|
||||||
aContext->ChangeClipping().AddWorld (aUserPlanes);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!aContext->ShaderManager()->IsEmpty())
|
|
||||||
{
|
|
||||||
aContext->ShaderManager()->UpdateClippingState();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#if !defined(GL_ES_VERSION_2_0)
|
#if !defined(GL_ES_VERSION_2_0)
|
||||||
// Setup view projection
|
// Setup view projection
|
||||||
glMatrixMode (GL_PROJECTION);
|
glMatrixMode (GL_PROJECTION);
|
||||||
@ -1221,6 +1195,31 @@ void OpenGl_View::RedrawScene (const Handle(OpenGl_PrinterContext)& thePrintCont
|
|||||||
// Setup view orientation
|
// Setup view orientation
|
||||||
theWorkspace->SetViewMatrix (theOrientation);
|
theWorkspace->SetViewMatrix (theOrientation);
|
||||||
|
|
||||||
|
// Specify clipping planes in view transformation space
|
||||||
|
if (!myClipPlanes.IsEmpty())
|
||||||
|
{
|
||||||
|
Graphic3d_SequenceOfHClipPlane aUserPlanes;
|
||||||
|
Graphic3d_SequenceOfHClipPlane::Iterator aClippingIt (myClipPlanes);
|
||||||
|
for (; aClippingIt.More(); aClippingIt.Next())
|
||||||
|
{
|
||||||
|
const Handle(Graphic3d_ClipPlane)& aClipPlane = aClippingIt.Value();
|
||||||
|
if (aClipPlane->IsOn())
|
||||||
|
{
|
||||||
|
aUserPlanes.Append (aClipPlane);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!aUserPlanes.IsEmpty())
|
||||||
|
{
|
||||||
|
aContext->ChangeClipping().AddWorld (aUserPlanes);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!aContext->ShaderManager()->IsEmpty())
|
||||||
|
{
|
||||||
|
aContext->ShaderManager()->UpdateClippingState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if !defined(GL_ES_VERSION_2_0)
|
#if !defined(GL_ES_VERSION_2_0)
|
||||||
// Apply Lights
|
// Apply Lights
|
||||||
{
|
{
|
||||||
|
30
tests/bugs/vis/bug24717
Normal file
30
tests/bugs/vis/bug24717
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC24717"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
####################################################################################
|
||||||
|
# TKOpenGl - globally defined clipping planes blink when operating with view
|
||||||
|
# Test checks that state of clippings always corresponds to a state of viewed
|
||||||
|
# scene.
|
||||||
|
####################################################################################
|
||||||
|
|
||||||
|
set check_x 204
|
||||||
|
set check_y 204
|
||||||
|
|
||||||
|
vinit View1
|
||||||
|
vsetdispmode 1
|
||||||
|
box b 1 1 1
|
||||||
|
vdisplay b
|
||||||
|
vmoveto $check_x $check_y
|
||||||
|
vclipplane create pln1
|
||||||
|
vclipplane set pln1 view Driver1/Viewer1/View1
|
||||||
|
vclipplane change pln1 equation 0 1 0 0
|
||||||
|
vfit
|
||||||
|
|
||||||
|
checkcolor $check_x $check_y 0 1 1
|
||||||
|
|
||||||
|
if {$stat != 1} {
|
||||||
|
puts "Error : Viewer clipping is broken."
|
||||||
|
}
|
||||||
|
|
||||||
|
vdump ${imagedir}/${casename}.png
|
Loading…
x
Reference in New Issue
Block a user