mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-07-05 12:15:50 +03:00
0024353: TKOpenGl - crash in IsRaytracedStructure when clearing mutli-connected presentation
Correction of test cases for issue CR24353
This commit is contained in:
parent
bf62b306ab
commit
d5af86261d
@ -146,7 +146,8 @@ OpenGl_RaytraceLight::OpenGl_RaytraceLight (const OpenGl_RTVec4f& theDiffuse,
|
|||||||
// =======================================================================
|
// =======================================================================
|
||||||
OpenGl_RTVec4f OpenGl_RaytraceScene::Center (const int theTriangle) const
|
OpenGl_RTVec4f OpenGl_RaytraceScene::Center (const int theTriangle) const
|
||||||
{
|
{
|
||||||
const OpenGl_RTVec4i anIndex (Triangles [theTriangle]);
|
const OpenGl_RTVec4i& anIndex = Triangles [theTriangle];
|
||||||
|
|
||||||
return ( Vertices[anIndex.x()] +
|
return ( Vertices[anIndex.x()] +
|
||||||
Vertices[anIndex.y()] +
|
Vertices[anIndex.y()] +
|
||||||
Vertices[anIndex.z()] ) * ( 1.f / 3.f );
|
Vertices[anIndex.z()] ) * ( 1.f / 3.f );
|
||||||
@ -159,7 +160,8 @@ OpenGl_RTVec4f OpenGl_RaytraceScene::Center (const int theTriangle) const
|
|||||||
float OpenGl_RaytraceScene::CenterAxis (const int theTriangle,
|
float OpenGl_RaytraceScene::CenterAxis (const int theTriangle,
|
||||||
const int theAxis) const
|
const int theAxis) const
|
||||||
{
|
{
|
||||||
const OpenGl_RTVec4i anIndex (Triangles [theTriangle]);
|
const OpenGl_RTVec4i& anIndex = Triangles [theTriangle];
|
||||||
|
|
||||||
return ( Vertices[anIndex.x()][theAxis] +
|
return ( Vertices[anIndex.x()][theAxis] +
|
||||||
Vertices[anIndex.y()][theAxis] +
|
Vertices[anIndex.y()][theAxis] +
|
||||||
Vertices[anIndex.z()][theAxis] ) * ( 1.f / 3.f );
|
Vertices[anIndex.z()][theAxis] ) * ( 1.f / 3.f );
|
||||||
@ -171,11 +173,11 @@ float OpenGl_RaytraceScene::CenterAxis (const int theTriangle,
|
|||||||
// =======================================================================
|
// =======================================================================
|
||||||
OpenGl_AABB OpenGl_RaytraceScene::Box (const int theTriangle) const
|
OpenGl_AABB OpenGl_RaytraceScene::Box (const int theTriangle) const
|
||||||
{
|
{
|
||||||
const OpenGl_RTVec4i anIndex (Triangles[theTriangle]);
|
const OpenGl_RTVec4i& anIndex = Triangles[theTriangle];
|
||||||
|
|
||||||
const OpenGl_RTVec4f pA = Vertices[anIndex.x()];
|
const OpenGl_RTVec4f& pA = Vertices[anIndex.x()];
|
||||||
const OpenGl_RTVec4f pB = Vertices[anIndex.y()];
|
const OpenGl_RTVec4f& pB = Vertices[anIndex.y()];
|
||||||
const OpenGl_RTVec4f pC = Vertices[anIndex.z()];
|
const OpenGl_RTVec4f& pC = Vertices[anIndex.z()];
|
||||||
|
|
||||||
OpenGl_AABB aBox (pA);
|
OpenGl_AABB aBox (pA);
|
||||||
|
|
||||||
|
@ -385,6 +385,27 @@ void OpenGl_Structure::UnregisterAncestorStructure (const OpenGl_Structure* theS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// =======================================================================
|
||||||
|
// function : UnregisterFromAncestorStructure
|
||||||
|
// purpose :
|
||||||
|
// =======================================================================
|
||||||
|
void OpenGl_Structure::UnregisterFromAncestorStructure() const
|
||||||
|
{
|
||||||
|
for (OpenGl_ListOfStructure::Iterator anIta (myAncestorStructures); anIta.More(); anIta.Next())
|
||||||
|
{
|
||||||
|
OpenGl_Structure* anAncestor = const_cast<OpenGl_Structure*> (anIta.ChangeValue());
|
||||||
|
|
||||||
|
for (OpenGl_ListOfStructure::Iterator anIts (anAncestor->myConnected); anIts.More(); anIts.Next())
|
||||||
|
{
|
||||||
|
if (anIts.Value() == this)
|
||||||
|
{
|
||||||
|
anAncestor->myConnected.Remove (anIts);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
// function : UpdateStateWithAncestorStructures
|
// function : UpdateStateWithAncestorStructures
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -778,6 +799,11 @@ void OpenGl_Structure::Release (const Handle(OpenGl_Context)& theGlCtx)
|
|||||||
OpenGl_Element::Destroy (theGlCtx, myAspectMarker);
|
OpenGl_Element::Destroy (theGlCtx, myAspectMarker);
|
||||||
OpenGl_Element::Destroy (theGlCtx, myAspectText);
|
OpenGl_Element::Destroy (theGlCtx, myAspectText);
|
||||||
ClearHighlightColor (theGlCtx);
|
ClearHighlightColor (theGlCtx);
|
||||||
|
|
||||||
|
#ifdef HAVE_OPENCL
|
||||||
|
// Remove from connected list of ancestor
|
||||||
|
UnregisterFromAncestorStructure();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
|
@ -138,6 +138,9 @@ protected:
|
|||||||
//! Unregisters ancestor connected structure (for updating ray-tracing state).
|
//! Unregisters ancestor connected structure (for updating ray-tracing state).
|
||||||
void UnregisterAncestorStructure (const OpenGl_Structure* theStructure) const;
|
void UnregisterAncestorStructure (const OpenGl_Structure* theStructure) const;
|
||||||
|
|
||||||
|
//! Unregisters structure from ancestor structure (for updating ray-tracing state).
|
||||||
|
void UnregisterFromAncestorStructure() const;
|
||||||
|
|
||||||
//! Updates modification state for structure and its parents.
|
//! Updates modification state for structure and its parents.
|
||||||
void UpdateStateWithAncestorStructures() const;
|
void UpdateStateWithAncestorStructures() const;
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
using namespace OpenGl_Raytrace;
|
using namespace OpenGl_Raytrace;
|
||||||
|
|
||||||
//! Use this macro to output ray-tracing debug info
|
//! Use this macro to output ray-tracing debug info
|
||||||
// #define RAY_TRACE_PRINT_INFO
|
//#define RAY_TRACE_PRINT_INFO
|
||||||
|
|
||||||
#ifdef RAY_TRACE_PRINT_INFO
|
#ifdef RAY_TRACE_PRINT_INFO
|
||||||
#include <OSD_Timer.hxx>
|
#include <OSD_Timer.hxx>
|
||||||
|
32
tests/v3d/raytrace/connected
Normal file
32
tests/v3d/raytrace/connected
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
puts "TODO ?OCC24130 Windows: TKOpenGl | Type\: Error | ID\: 0 | Severity\: High | Message\:"
|
||||||
|
|
||||||
|
puts "========"
|
||||||
|
puts "Ray Tracing - check rendering of multi-connected structures"
|
||||||
|
puts "========"
|
||||||
|
|
||||||
|
# create boxes
|
||||||
|
box b1 0 0 0 1 2 3
|
||||||
|
box b2 3 0 0 3 2 1
|
||||||
|
|
||||||
|
# draw box
|
||||||
|
vinit View1
|
||||||
|
vclear
|
||||||
|
vsetdispmode 1
|
||||||
|
vraytrace 0
|
||||||
|
vaxo
|
||||||
|
vconnectsh b1c -3 0 0 1 0 0 0 0 1 b1 b2
|
||||||
|
vfit
|
||||||
|
vrotate 0.2 0.0 0.0
|
||||||
|
vclear
|
||||||
|
vconnectsh b1c -3 0 0 1 0 0 0 0 1 b1 b2
|
||||||
|
|
||||||
|
# take snapshot with fixed pipeline
|
||||||
|
vdump $::imagedir/${::casename}_OFF.png
|
||||||
|
|
||||||
|
# turn on ray tracing
|
||||||
|
vraytrace 1
|
||||||
|
vclinfo
|
||||||
|
vdump $::imagedir/${::casename}_rt1.png
|
||||||
|
|
||||||
|
vclear
|
||||||
|
vconnectsh b1c -3 0 0 1 0 0 0 0 1 b1 b2
|
Loading…
x
Reference in New Issue
Block a user