mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +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:
@@ -183,19 +183,22 @@ void OpenGl_Group::UpdateAspectText (const Standard_Boolean theIsGlobal)
|
||||
// function : AddPrimitiveArray
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void OpenGl_Group::AddPrimitiveArray (const Handle(Graphic3d_ArrayOfPrimitives)& thePrim,
|
||||
const Standard_Boolean theToEvalMinMax)
|
||||
void OpenGl_Group::AddPrimitiveArray (const Graphic3d_TypeOfPrimitiveArray theType,
|
||||
const Handle(Graphic3d_IndexBuffer)& theIndices,
|
||||
const Handle(Graphic3d_Buffer)& theAttribs,
|
||||
const Handle(Graphic3d_BoundBuffer)& theBounds,
|
||||
const Standard_Boolean theToEvalMinMax)
|
||||
{
|
||||
if (IsDeleted()
|
||||
|| !thePrim->IsValid())
|
||||
|| theAttribs.IsNull())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
OpenGl_PrimitiveArray* anArray = new OpenGl_PrimitiveArray ((CALL_DEF_PARRAY *)thePrim->Array());
|
||||
OpenGl_PrimitiveArray* anArray = new OpenGl_PrimitiveArray (theType, theIndices, theAttribs, theBounds);
|
||||
AddElement (anArray);
|
||||
|
||||
Graphic3d_Group::AddPrimitiveArray (thePrim, theToEvalMinMax);
|
||||
Graphic3d_Group::AddPrimitiveArray (theType, theIndices, theAttribs, theBounds, theToEvalMinMax);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
|
Reference in New Issue
Block a user