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

0024406: Visualization - crash on re-usage of the same primitive array

Redesign Graphic3d_ArrayOfPrimitives
Store vertices data in buffer objects managed using smart-pointers
- no more low-level memory corruption by memory releasing after VBO creation.
Remove broken hasEdgeInfos.

Interleave vertex attributes (position, color, normal, uv) in single buffer.
Remove from Graphic3d_ArrayOfPrimitives methods ::Orientate().
Remove structures Graphic3d_PrimitiveArray, CALL_DEF_PARRAY.
Add support for 2D vertex arrays.

Graphic3d_Group - remove array or primitive arrays.
Introduce more universal method Graphic3d_Group::AddPrimitiveArray().

Fix warning
This commit is contained in:
kgv
2014-04-17 18:01:04 +04:00
committed by apn
parent c002793be1
commit 871fa1038d
45 changed files with 2346 additions and 1980 deletions

View File

@@ -380,32 +380,53 @@ protected: //! @name methods related to ray-tracing
const OpenGl_PrimitiveArray* theArray, int theMatID, const Standard_ShortReal* theTrans);
//! Adds vertex indices from OpenGL primitive array to ray-traced scene geometry.
Standard_Boolean AddRaytraceVertexIndices (OpenGl_TriangleSet* theSet,
const CALL_DEF_PARRAY* theArray, Standard_Integer theOffset, Standard_Integer theCount, Standard_Integer theMatID);
Standard_Boolean AddRaytraceVertexIndices (OpenGl_TriangleSet& theSet,
const OpenGl_PrimitiveArray& theArray,
Standard_Integer theOffset,
Standard_Integer theCount,
Standard_Integer theMatID);
//! Adds OpenGL triangle array to ray-traced scene geometry.
Standard_Boolean AddRaytraceTriangleArray (OpenGl_TriangleSet* theSet,
const CALL_DEF_PARRAY* theArray, Standard_Integer theOffset, Standard_Integer theCount, Standard_Integer theMatID);
Standard_Boolean AddRaytraceTriangleArray (OpenGl_TriangleSet& theSet,
const Handle(Graphic3d_IndexBuffer)& theIndices,
Standard_Integer theOffset,
Standard_Integer theCount,
Standard_Integer theMatID);
//! Adds OpenGL triangle fan array to ray-traced scene geometry.
Standard_Boolean AddRaytraceTriangleFanArray (OpenGl_TriangleSet* theSet,
const CALL_DEF_PARRAY* theArray, Standard_Integer theOffset, Standard_Integer theCount, Standard_Integer theMatID);
Standard_Boolean AddRaytraceTriangleFanArray (OpenGl_TriangleSet& theSet,
const Handle(Graphic3d_IndexBuffer)& theIndices,
Standard_Integer theOffset,
Standard_Integer theCount,
Standard_Integer theMatID);
//! Adds OpenGL triangle strip array to ray-traced scene geometry.
Standard_Boolean AddRaytraceTriangleStripArray (OpenGl_TriangleSet* theSet,
const CALL_DEF_PARRAY* theArray, Standard_Integer theOffset, Standard_Integer theCount, Standard_Integer theMatID);
Standard_Boolean AddRaytraceTriangleStripArray (OpenGl_TriangleSet& theSet,
const Handle(Graphic3d_IndexBuffer)& theIndices,
Standard_Integer theOffset,
Standard_Integer theCount,
Standard_Integer theMatID);
//! Adds OpenGL quadrangle array to ray-traced scene geometry.
Standard_Boolean AddRaytraceQuadrangleArray (OpenGl_TriangleSet* theSet,
const CALL_DEF_PARRAY* theArray, Standard_Integer theOffset, Standard_Integer theCount, Standard_Integer theMatID);
Standard_Boolean AddRaytraceQuadrangleArray (OpenGl_TriangleSet& theSet,
const Handle(Graphic3d_IndexBuffer)& theIndices,
Standard_Integer theOffset,
Standard_Integer theCount,
Standard_Integer theMatID);
//! Adds OpenGL quadrangle strip array to ray-traced scene geometry.
Standard_Boolean AddRaytraceQuadrangleStripArray (OpenGl_TriangleSet* theSet,
const CALL_DEF_PARRAY* theArray, Standard_Integer theOffset, Standard_Integer theCount, Standard_Integer theMatID);
Standard_Boolean AddRaytraceQuadrangleStripArray (OpenGl_TriangleSet& theSet,
const Handle(Graphic3d_IndexBuffer)& theIndices,
Standard_Integer theOffset,
Standard_Integer theCount,
Standard_Integer theMatID);
//! Adds OpenGL polygon array to ray-traced scene geometry.
Standard_Boolean AddRaytracePolygonArray (OpenGl_TriangleSet* theSet,
const CALL_DEF_PARRAY* theArray, Standard_Integer theOffset, Standard_Integer theCount, Standard_Integer theMatID);
Standard_Boolean AddRaytracePolygonArray (OpenGl_TriangleSet& theSet,
const Handle(Graphic3d_IndexBuffer)& theIndices,
Standard_Integer theOffset,
Standard_Integer theCount,
Standard_Integer theMatID);
//! Loads and compiles shader object from specified source.
Handle(OpenGl_ShaderObject) LoadShader (const ShaderSource& theSource, GLenum theType);