Added method Graphic3d_Buffer::DefaultAllocator(), which is now used across code.
#include <Graphic3d_AttribBuffer.hxx>
#include <Graphic3d_MutableIndexBuffer.hxx>
-#include <NCollection_AlignedAllocator.hxx>
#include <TCollection_AsciiString.hxx>
#include <stdio.h>
myIndices.Nullify();
myBounds.Nullify();
- Handle(NCollection_AlignedAllocator) anAlloc = new NCollection_AlignedAllocator (16);
+ const Handle(NCollection_BaseAllocator)& anAlloc = Graphic3d_Buffer::DefaultAllocator();
if ((theArrayOptions & Graphic3d_ArrayFlags_AttribsMutable) != 0
|| (theArrayOptions & Graphic3d_ArrayFlags_AttribsDeinterleaved) != 0)
{
// commercial license or contractual agreement.
#include <Graphic3d_Buffer.hxx>
+
#include <Graphic3d_BoundBuffer.hxx>
#include <Graphic3d_MutableIndexBuffer.hxx>
+#include <NCollection_AlignedAllocator.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Buffer, NCollection_Buffer)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_IndexBuffer, Graphic3d_Buffer)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_BoundBuffer, NCollection_Buffer)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_MutableIndexBuffer, Graphic3d_IndexBuffer)
+// =======================================================================
+// function : DefaultAllocator
+// purpose :
+// =======================================================================
+const Handle(NCollection_BaseAllocator)& Graphic3d_Buffer::DefaultAllocator()
+{
+ static const Handle(NCollection_BaseAllocator) THE_ALLOC = new NCollection_AlignedAllocator (16);
+ return THE_ALLOC;
+}
+
// =======================================================================
// function : DumpJson
// purpose :
class Graphic3d_Buffer : public NCollection_Buffer
{
DEFINE_STANDARD_RTTIEXT(Graphic3d_Buffer, NCollection_Buffer)
+public:
+
+ //! Return default vertex data allocator.
+ Standard_EXPORT static const Handle(NCollection_BaseAllocator)& DefaultAllocator();
+
public:
//! Empty constructor.
// commercial license or contractual agreement.
#include <Graphic3d_HatchStyle.hxx>
-#include <NCollection_AlignedAllocator.hxx>
+
#include <Standard_Atomic.hxx>
#include <Standard_ProgramError.hxx>
"Hatch pattern must be a 32*32 bitmap (Image_Format_Gray format)");
const Standard_Size aByteSize = thePattern->SizeBytes();
- Handle(NCollection_AlignedAllocator) anAllocator = new NCollection_AlignedAllocator (16);
+ const Handle(NCollection_BaseAllocator)& anAllocator = Image_PixMap::DefaultAllocator();
myPattern = new NCollection_Buffer (anAllocator);
myPattern->Allocate (aByteSize);
std::memcpy (myPattern->ChangeData(), thePattern->Data(), aByteSize);
#include <OpenGl_BackgroundArray.hxx>
#include <Aspect_FillMethod.hxx>
-#include <NCollection_AlignedAllocator.hxx>
#include <OpenGl_Texture.hxx>
#include <OpenGl_View.hxx>
#include <Graphic3d_TextureParams.hxx>
if (myAttribs.IsNull())
{
- Handle(NCollection_AlignedAllocator) anAlloc = new NCollection_AlignedAllocator (16);
- myAttribs = new Graphic3d_Buffer (anAlloc);
+ myAttribs = new Graphic3d_Buffer (Graphic3d_Buffer::DefaultAllocator());
}
if (!myAttribs->Init (4, aGragientAttribInfo, 2))
{
if (myAttribs.IsNull())
{
- Handle(NCollection_AlignedAllocator) anAlloc = new NCollection_AlignedAllocator (16);
- myAttribs = new Graphic3d_Buffer (anAlloc);
+ myAttribs = new Graphic3d_Buffer (Graphic3d_Buffer::DefaultAllocator());
}
if (!myAttribs->Init (4, aTextureAttribInfo, 2))
{
if (myAttribs.IsNull())
{
- Handle(NCollection_AlignedAllocator) anAlloc = new NCollection_AlignedAllocator (16);
- myAttribs = new Graphic3d_Buffer (anAlloc);
- myIndices = new Graphic3d_IndexBuffer (anAlloc);
+ myAttribs = new Graphic3d_Buffer (Graphic3d_Buffer::DefaultAllocator());
+ myIndices = new Graphic3d_IndexBuffer (Graphic3d_Buffer::DefaultAllocator());
}
if (!myAttribs->Init (8, aCubeMapAttribInfo, 1)
|| !myIndices->Init<unsigned short> (14))
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <NCollection_AlignedAllocator.hxx>
#include <OpenGl_CappingPlaneResource.hxx>
+
#include <OpenGl_Context.hxx>
#include <OpenGl_Vec.hxx>
#include <OpenGl_ShaderManager.hxx>
myEquationMod ((unsigned int )-1),
myAspectMod ((unsigned int )-1)
{
- // Fill primitive array
- Handle(NCollection_AlignedAllocator) anAlloc = new NCollection_AlignedAllocator (16);
- Handle(Graphic3d_Buffer) anAttribs = new Graphic3d_Buffer (anAlloc);
+ Handle(Graphic3d_Buffer) anAttribs = new Graphic3d_Buffer (Graphic3d_Buffer::DefaultAllocator());
Graphic3d_Attribute anAttribInfo[] =
{
{ Graphic3d_TOA_POS, Graphic3d_TOD_VEC4 },
#include <OpenGl_FrameBuffer.hxx>
#include <OpenGl_ArbFBO.hxx>
-#include <NCollection_AlignedAllocator.hxx>
#include <Standard_Assert.hxx>
#include <TCollection_ExtendedString.hxx>
if (toConvRgba2Rgb)
{
- Handle(NCollection_BaseAllocator) anAlloc = new NCollection_AlignedAllocator (16);
const Standard_Size aRowSize = theImage.SizeX() * 4;
- NCollection_Buffer aRowBuffer (anAlloc);
+ NCollection_Buffer aRowBuffer (Image_PixMap::DefaultAllocator());
if (!aRowBuffer.Allocate (aRowSize))
{
return Standard_False;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
+#include <OpenGl_PrimitiveArray.hxx>
+
#include <OpenGl_Aspects.hxx>
#include <OpenGl_Context.hxx>
#include <OpenGl_GraphicDriver.hxx>
#include <OpenGl_IndexBuffer.hxx>
#include <OpenGl_PointSprite.hxx>
-#include <OpenGl_PrimitiveArray.hxx>
#include <OpenGl_Sampler.hxx>
#include <OpenGl_ShaderManager.hxx>
#include <OpenGl_ShaderProgram.hxx>
#include <OpenGl_View.hxx>
#include <OpenGl_Workspace.hxx>
#include <Graphic3d_TextureParams.hxx>
-#include <NCollection_AlignedAllocator.hxx>
namespace
{
if (myAttribs->NbElements > std::numeric_limits<GLushort>::max())
{
- Handle(Graphic3d_Buffer) anAttribs = new Graphic3d_Buffer (new NCollection_AlignedAllocator (16));
+ Handle(Graphic3d_Buffer) anAttribs = new Graphic3d_Buffer (Graphic3d_Buffer::DefaultAllocator());
if (!anAttribs->Init (myIndices->NbElements, myAttribs->AttributesArray(), myAttribs->NbAttributes))
{
return Standard_False; // failed to initialize attribute array
#include <OpenGl_VertexBufferCompat.hxx>
-#include <NCollection_AlignedAllocator.hxx>
-
-
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_VertexBufferCompat,OpenGl_VertexBuffer)
// =======================================================================
if (myBufferId == NO_BUFFER)
{
myBufferId = (GLuint )-1; // dummy identifier...
- Handle(NCollection_AlignedAllocator) anAlloc = new NCollection_AlignedAllocator (16);
- myData = new NCollection_Buffer (anAlloc);
+ myData = new NCollection_Buffer (Graphic3d_Buffer::DefaultAllocator());
}
return myBufferId != NO_BUFFER;
}
#include <Graphic3d_TextureParams.hxx>
#include <Graphic3d_TransformUtils.hxx>
-#include <NCollection_AlignedAllocator.hxx>
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_Workspace,Standard_Transient)
#include <Select3D_SensitivePrimitiveArray.hxx>
-#include <NCollection_AlignedAllocator.hxx>
#include <OSD_Parallel.hxx>
#include <Standard_Atomic.hxx>
myPatchSizeMax (1),
myPatchDistance (ShortRealLast()),
myIs3d (false),
- myBvhIndices (new NCollection_AlignedAllocator(16)),
+ myBvhIndices (Graphic3d_Buffer::DefaultAllocator()),
myMinDepthElem (RealLast()),
myMinDepthNode (RealLast()),
myMinDepthEdge (RealLast()),