LDM buffer object optimized for bitset tile data. More...
#include <LDM/tiles/SoCpuBufferBitSet.h>
Public Member Functions | |
SoCpuBufferBitSet () | |
SoCpuBufferBitSet (SoCpuBufferObject *cpuBuffer) | |
virtual SoBufferObject * | createInstance () const |
virtual void | map (SoBufferObject *targetBufferObject, AccessMode accessMode, size_t startPosition=0, size_t mappingSize=SO_BUFFER_SIZE_ALL) |
virtual void | map (SoCpuBufferObject *targetBufferObject, AccessMode accessMode, size_t startPosition=0, size_t mappingSize=SO_BUFFER_SIZE_ALL) |
virtual void | map (SoGLBufferObject *targetBufferObject, AccessMode accessMode, size_t startPosition=0, size_t mappingSize=SO_BUFFER_SIZE_ALL) |
virtual void * | map (AccessMode accessMode) |
virtual void | unmap (SoCpuBufferObject *bufferObject) |
virtual void | unmap (SoGLBufferObject *bufferObject) |
virtual void | unmap (SoBufferObject *bufferObject) |
virtual void | unmap () |
virtual void | memcpy (SoBufferObject *sourceBufferObject, size_t destOffset=0, size_t sourceOffset=0, size_t copySize=SO_BUFFER_SIZE_ALL) |
virtual void | memset (void *value, size_t valueSize=1, size_t offset=0, size_t count=SO_BUFFER_SIZE_ALL) |
virtual bool | getMinMax (double &min, double &max) |
virtual void | setMinMax (const double &min, const double &max) |
virtual size_t | getRealSize () const |
virtual bool | setSize (size_t size) |
Deprecated | |
| |
SoDEPRECATED | SoCpuBufferBitSet (SoDataCompressor *compressor) |
virtual SoDEPRECATED void | setCompressor (SoDataCompressor *compressor) |
virtual SoDEPRECATED void | setBufferUncompress (unsigned char *dataBuffer, size_t bufferSize) |
virtual SoDEPRECATED void | setBufferCompressed (bool) |
This type of buffer efficiently represents a tile containing bitset data. The buffer can be used like any other buffer, but uses less memory when its contents are not actually being accessed.
SoBufferPropertiesInterface, SoCpuBufferObject
SoCpuBufferBitSet::SoCpuBufferBitSet | ( | ) |
Default constructor.
SoCpuBufferBitSet::SoCpuBufferBitSet | ( | SoCpuBufferObject * | cpuBuffer | ) |
Constructor from a SoCpuBufferObject containing a bitset.
SoDEPRECATED SoCpuBufferBitSet::SoCpuBufferBitSet | ( | SoDataCompressor * | compressor | ) |
Constructor with compressor given as parameter.
virtual SoBufferObject* SoCpuBufferBitSet::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.
Reimplemented from SoCpuBufferObject.
virtual bool SoCpuBufferBitSet::getMinMax | ( | double & | min, | |
double & | max | |||
) | [virtual] |
Get the min and max values in the buffer, if they are known.
Returns false if these values have not been set or computed. Returns true if values are available.
min | user variable to store min value | |
max | user variable to store max value |
Implements SoBufferPropertiesInterface.
virtual size_t SoCpuBufferBitSet::getRealSize | ( | ) | const [virtual] |
Returns the size of the buffer in bytes.
For this type of buffer the real size is the same as the size of the SoBufferObject.
Implements SoBufferPropertiesInterface.
virtual void* SoCpuBufferBitSet::map | ( | AccessMode | accessMode | ) | [virtual] |
Returns a pointer to the memory array used for the storage of the buffer.
Reimplemented from SoCpuBufferObject.
virtual void SoCpuBufferBitSet::map | ( | SoGLBufferObject * | targetBufferObject, | |
AccessMode | accessMode, | |||
size_t | startPosition = 0 , |
|||
size_t | mappingSize = SO_BUFFER_SIZE_ALL | |||
) | [virtual] |
Map the current buffer object into the specified GL buffer object.
See the general map method for more information.
Reimplemented from SoCpuBufferObject.
virtual void SoCpuBufferBitSet::map | ( | SoCpuBufferObject * | targetBufferObject, | |
AccessMode | accessMode, | |||
size_t | startPosition = 0 , |
|||
size_t | mappingSize = SO_BUFFER_SIZE_ALL | |||
) | [virtual] |
Map the current buffer object into the specified CPU buffer object.
See the general map method for more information.
Implements SoBufferObject.
virtual void SoCpuBufferBitSet::map | ( | SoBufferObject * | targetBufferObject, | |
AccessMode | accessMode, | |||
size_t | startPosition = 0 , |
|||
size_t | mappingSize = SO_BUFFER_SIZE_ALL | |||
) | [virtual] |
Map the current buffer object into the specified buffer object.
It is useful in order to use a buffer in multiple contexts (e.g. OpenGL and CUDA).
targetBufferObject | The buffer object which will be the mapped version of this buffer. | |
accessMode | The access mode used for the mapping. | |
startPosition | offset in source buffer to map from (default is start of buffer). | |
mappingSize | size from the startPosition, if SO_BUFFER_SIZE_ALL then the whole buffer is mapped. |
Reimplemented from SoCpuBufferObject.
virtual void SoCpuBufferBitSet::memcpy | ( | SoBufferObject * | sourceBufferObject, | |
size_t | destOffset = 0 , |
|||
size_t | sourceOffset = 0 , |
|||
size_t | copySize = SO_BUFFER_SIZE_ALL | |||
) | [virtual] |
Copies data from the specified buffer object into this buffer object.
If the size or the offset are not valid an error is reported (SoDebugError). This buffer is not resized, if it is too small an error is reported.
sourceBufferObject | The buffer object to be copied. | |
destOffset | The starting offset in the destination buffer object, useful for data subsets. | |
sourceOffset | The starting offset in the source buffer object, useful for data subsets. | |
copySize | The number of bytes to copy from the source buffer object (SO_BUFFER_SIZE_ALL means all). |
Reimplemented from SoCpuBufferObject.
virtual void SoCpuBufferBitSet::memset | ( | void * | value, | |
size_t | valueSize = 1 , |
|||
size_t | offset = 0 , |
|||
size_t | count = SO_BUFFER_SIZE_ALL | |||
) | [virtual] |
This function sets the contents of (or a portion of) this buffer object to the specified value.
Sets 0 if value = 0, 1 if value != 0.
The valueSize parameter provides a way to do a memset with float, short, byte, etc values. The first value changed in this buffer is given by the offset argument. The number of values to change.
value | is a pointer to the value to set in the buffer. | |
valueSize | The size in bytes of the value. Default is 1 byte. | |
offset | Index of first value to be changed. Default is 0. | |
count | The number of values to change. Default is number of values in buffer. |
Reimplemented from SoCpuBufferObject.
virtual SoDEPRECATED void SoCpuBufferBitSet::setBufferCompressed | ( | bool | ) | [inline, virtual] |
Set the state of the buffer.Flag must be set to true if buffer is compressed, or false otherwise.
virtual SoDEPRECATED void SoCpuBufferBitSet::setBufferUncompress | ( | unsigned char * | dataBuffer, | |
size_t | bufferSize | |||
) | [virtual] |
Set the data associated to this buffer.
dataBuffer | Pointer to buffer containing data | |
bufferSize | Size (in byte) of the data buffer |
virtual SoDEPRECATED void SoCpuBufferBitSet::setCompressor | ( | SoDataCompressor * | compressor | ) | [virtual] |
Set the compressor used to decompress buffer.
compressor | Pointer to the compressor to use |
virtual void SoCpuBufferBitSet::setMinMax | ( | const double & | min, | |
const double & | max | |||
) | [virtual] |
Set min and max values for this buffer.
min | user variable containing min value | |
max | user variable containing max value |
virtual bool SoCpuBufferBitSet::setSize | ( | size_t | size | ) | [virtual] |
Sets the size in bytes of the buffer object.
Return FALSE if allocation failed. TRUE otherwise
size | The size in bytes of the raw buffer object. |
Reimplemented from SoCpuBufferObject.
virtual void SoCpuBufferBitSet::unmap | ( | ) | [virtual] |
Unmap a mapped buffer.
No error is reported if the buffer was not mapped.
Reimplemented from SoCpuBufferObject.
virtual void SoCpuBufferBitSet::unmap | ( | SoBufferObject * | bufferObject | ) | [virtual] |
Remove the specified bufferObject from the list of buffers which map the current buffer.
If the access mode supports writing the specified buffer is sync'd with the buffer.
bufferObject | Buffer to be unmapped. |
Reimplemented from SoCpuBufferObject.
virtual void SoCpuBufferBitSet::unmap | ( | SoGLBufferObject * | bufferObject | ) | [virtual] |
Unmap the specified GL buffer object
It is defined just to speed up the call when the type of the object is known.
If the access mode supports writing the specified buffer is sync'd with the buffer.
See the general unmap function for more information.
bufferObject | Buffer to be unmapped. |
Reimplemented from SoCpuBufferObject.
virtual void SoCpuBufferBitSet::unmap | ( | SoCpuBufferObject * | bufferObject | ) | [virtual] |
Unmap the specified CPU buffer object
It is defined just to speed up the call when the type of the object is known.
Remove the specified bufferObject from the list of buffers which map the current buffer.
See the general unmap function for more information.
Implements SoBufferObject.