SoCpuBufferObject Class Reference
[CPU device]

VSG extension CPU buffer object class More...

#include <Inventor/devices/SoCpuBufferObject.h>

Inheritance diagram for SoCpuBufferObject:
SoBufferObject SoRefCounter SoTypedObject SoCpuBufferBasicProperty SoCpuBufferBitSet SoCpuBufferCompressed SoCpuBufferFromVolumeReader SoCpuBufferUniform SoCpuBufferAsyncBasicProperty

List of all members.

Public Member Functions

 SoCpuBufferObject ()
 SoCpuBufferObject (void *buffer, size_t size)
void setBuffer (void *buffer, size_t size)
virtual SoBufferObjectcreateInstance () const
virtual void clearInstance ()

Detailed Description

VSG extension CPU buffer object class

This class provides management functions for CPU memory buffers.

By default memory allocations have the maximum possible alignment to allow use with (for example) SSE instructions.

Memory is managed using the new/delete operators. On Microsoft Windows platforms it is possible to use VirtualAlloc/VirtualFree instead by setting OIV_BUFFER_USE_VIRTUAL_ALLOC (see SoPreferences).

See SoBufferObject for general information about buffer objects.

See SoBufferedShape for an example of storing vertices in a CPU buffer.

NOTE:
SoBufferObject classes are reference counted objects (just like nodes, paths, etc). Therefore you cannot create an SoBufferObject on the stack. And to delete an SoBufferObject you must ref and unref the object. The SoRef smart pointer is a safe and convenient way to create buffer objects. See examples in SoBufferObject.

EXAMPLE

EXAMPLE

SEE ALSO

SoGLBufferObject

See related examples:

ComputeBatch, ComputeSlice, DataTransform


Constructor & Destructor Documentation

SoCpuBufferObject::SoCpuBufferObject (  ) 

Default constructor.

The contents of the buffer are initially empty.

SoCpuBufferObject::SoCpuBufferObject ( void *  buffer,
size_t  size 
)

Constructor that takes an existing block of CPU memory.


This memory is owned, and should be freed by, the application.

Parameters:
buffer Pointer to the buffer to manage.
size Size of buffer in bytes.

Member Function Documentation

virtual void SoCpuBufferObject::clearInstance (  )  [virtual]

This function clears the content of the buffer, it frees the memory if the mode was COPY.

Implements SoBufferObject.

virtual SoBufferObject* SoCpuBufferObject::createInstance (  )  const [virtual]

Create a new buffer with the same properties as the current one.


The new instance will have the same context or device properties, but no memory is allocated.

Implements SoBufferObject.

Reimplemented in SoCpuBufferBitSet.

void SoCpuBufferObject::setBuffer ( void *  buffer,
size_t  size 
)

Request that the buffer object manage an existing block of memory.


The application still owns this memory and is responsible for releasing the memory (when no SoCpuBufferObjects have a reference on it).

We recommend to use the most aligned memory pointer possible to enable optimized algorithm usage.

NOTE: If another buffer object is currently mapped into another buffer, the other buffer is automatically unmapped and its contents are undefined.


The documentation for this class was generated from the following file:

Open Inventor Toolkit reference manual, generated on 15 Mar 2023
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/