Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoCpuBufferBitSet Class Reference

Large Data Management LDM buffer object optimized for bitset tile data. More...

#include <LDM/tiles/SoCpuBufferBitSet.h>

+ Inheritance diagram for SoCpuBufferBitSet:

Public Member Functions

 SoCpuBufferBitSet ()
 Default constructor.
 
 SoCpuBufferBitSet (SoCpuBufferObject *cpuBuffer)
 Constructor from a SoCpuBufferObject containing a bitset.
 
virtual SoBufferObjectcreateInstance () const
 Create a new buffer with the same properties as the current one.
 
virtual void map (SoBufferObject *targetBufferObject, SoBufferObject::AccessMode accessMode, size_t startPosition=0, size_t mappingSize=SO_BUFFER_SIZE_ALL)
 Map the current buffer object into the specified buffer object.
 
virtual void map (SoCpuBufferObject *targetBufferObject, SoBufferObject::AccessMode accessMode, size_t startPosition=0, size_t mappingSize=SO_BUFFER_SIZE_ALL)
 Map the current buffer object into the specified CPU buffer object.
 
virtual void map (SoGLBufferObject *targetBufferObject, SoBufferObject::AccessMode accessMode, size_t startPosition=0, size_t mappingSize=SO_BUFFER_SIZE_ALL)
 Map the current buffer object into the specified GL buffer object.
 
virtual void * map (SoBufferObject::AccessMode accessMode, size_t offset=0, size_t count=SO_BUFFER_SIZE_ALL)
 Returns a pointer to the memory array used for the storage of the buffer.
 
virtual void unmap (SoCpuBufferObject *bufferObject)
 Unmap the specified CPU buffer object
It is defined just to speed up the call when the type of the object is known.
 
virtual void unmap (SoGLBufferObject *bufferObject)
 Unmap the specified GL buffer object
It is defined just to speed up the call when the type of the object is known.
 
virtual void unmap (SoBufferObject *bufferObject)
 Remove the specified bufferObject from the list of buffers which map the current buffer.
 
virtual void unmap ()
 Unmap a mapped buffer.
 
virtual void memcpy (SoBufferObject *sourceBufferObject, size_t destOffset=0, size_t sourceOffset=0, size_t copySize=SO_BUFFER_SIZE_ALL)
 Copies data from the specified buffer object into this buffer object.
 
virtual void memset (void *value, size_t valueSize=1, size_t offset=0, size_t count=SO_BUFFER_SIZE_ALL)
 This function sets the contents of (or a portion of) this buffer object to the specified value.
 
virtual bool getMinMax (double &min, double &max)
 Get the min and max values in the buffer, if they are known.
 
virtual void setMinMax (const double &min, const double &max)
 Set min and max values for this buffer.
 
virtual size_t getRealSize () const
 Returns the size of the buffer in bytes.
 
- Public Member Functions inherited from SoCpuBufferObject
 SoCpuBufferObject ()
 Default constructor.
 
 SoCpuBufferObject (void *buffer, size_t size)
 Constructor that takes an existing block of CPU memory.
 
void setBuffer (void *buffer, size_t size)
 Request that the buffer object manage an existing block of memory.
 
virtual void clearInstance ()
 This function clears the content of the buffer, it frees the memory if the mode was COPY.
 
- Public Member Functions inherited from SoBufferObject
void lockBuffer ()
 Locks the buffer against concurrent calls from different threads.
 
void unlockBuffer ()
 Unlocks the buffer object.
 
virtual bool setSize (size_t size)
 Sets the size in bytes of the buffer object.
 
virtual size_t getSize () const
 Returns the size, in bytes, of the buffer object.
 
SoDeviceContextgetContext () const
 Returns the device context where this buffer is valid.
 
SoBufferObjectgetMappedBufferObject () const
 Returns a pointer to the buffer object which is mapped by the actual object.
 
AccessMode getMappedBufferObjectAccessMode ()
 Returns the access mode used for the buffer mapping.
 
size_t getMappedBufferObjectPosition () const
 Returns the position in the source buffer mapped in this buffer.
 
size_t getMappedBufferObjectSize () const
 Returns the size of the mapped area in bytes.
 
- Public Member Functions inherited from SoRefCounter
void ref () const
 Adds a reference to an instance.
 
void unref () const
 Removes a reference from an instance.
 
void unrefNoDelete () const
 unrefNoDelete() should be called when it is desired to decrement the reference count, but not delete the instance if this brings the reference count to zero.
 
int getRefCount () const
 Returns current reference count.
 
void lock () const
 lock this instance.
 
void unlock () const
 unlock this instance.
 
- Public Member Functions inherited from SoTypedObject
virtual SoType getTypeId () const =0
 Returns the type identifier for a specific instance.
 
SbBool isOfType (const SoType &type) const
 Returns TRUE if this object is of the type specified in type or is derived from that type.
 
template<typename TypedObjectClass >
SbBool isOfType () const
 Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class.
 
- Public Member Functions inherited from SoBufferPropertiesInterface
 SoBufferPropertiesInterface ()
 Default constructor.
 
virtual ~SoBufferPropertiesInterface ()
 Destructor.
 
- Public Member Functions inherited from SoLDMBufferObjectInterface
 SoLDMBufferObjectInterface ()
 Default constructor.
 
virtual ~SoLDMBufferObjectInterface ()
 Destructor.
 
virtual void prefetch ()
 Simply expand the given buffer to OIV cache.
 

Friends

class SoCpuBufferBitSetImpl
 

Additional Inherited Members

- Public Types inherited from SoBufferObject
enum  AccessMode {
  READ_ONLY ,
  SET ,
  READ_WRITE
}
 This enum provides the possible access modes for a mapped buffer object. More...
 
- Static Public Member Functions inherited from SoTypedObject
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 

Detailed Description

Large Data Management LDM buffer object optimized for bitset tile data.

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.

SEE ALSO

SoBufferPropertiesInterface, SoCpuBufferObject

Definition at line 47 of file SoCpuBufferBitSet.h.

Constructor & Destructor Documentation

◆ SoCpuBufferBitSet() [1/2]

SoCpuBufferBitSet::SoCpuBufferBitSet ( )

Default constructor.

◆ SoCpuBufferBitSet() [2/2]

SoCpuBufferBitSet::SoCpuBufferBitSet ( SoCpuBufferObject cpuBuffer)

Constructor from a SoCpuBufferObject containing a bitset.

Member Function Documentation

◆ createInstance()

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.

◆ getMinMax()

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.

Parameters
minuser variable to store min value
maxuser variable to store max value

Implements SoBufferPropertiesInterface.

◆ getRealSize()

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.

◆ map() [1/4]

virtual void SoCpuBufferBitSet::map ( SoBufferObject targetBufferObject,
SoBufferObject::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.

Parameters
targetBufferObjectThe buffer object which will be the mapped version of this buffer.
accessModeThe access mode used for the mapping.
startPositionoffset in source buffer to map from (default is start of buffer).
mappingSizesize from the startPosition, if SO_BUFFER_SIZE_ALL then the whole buffer is mapped.

Reimplemented from SoBufferObject.

◆ map() [2/4]

virtual void * SoCpuBufferBitSet::map ( SoBufferObject::AccessMode  accessMode,
size_t  offset = 0,
size_t  count = SO_BUFFER_SIZE_ALL 
)
virtual

Returns a pointer to the memory array used for the storage of the buffer.

Returns
Pointer to the memory array used for the storage.

Reimplemented from SoBufferObject.

◆ map() [3/4]

virtual void SoCpuBufferBitSet::map ( SoCpuBufferObject targetBufferObject,
SoBufferObject::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.

◆ map() [4/4]

virtual void SoCpuBufferBitSet::map ( SoGLBufferObject targetBufferObject,
SoBufferObject::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.

◆ memcpy()

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.

Warning
Source and destination overlaping support is implementation dependent, if not supported an error is reported.
Parameters
sourceBufferObjectThe buffer object to be copied.
destOffsetThe starting offset in the destination buffer object, useful for data subsets.
sourceOffsetThe starting offset in the source buffer object, useful for data subsets.
copySizeThe number of bytes to copy from the source buffer object (SO_BUFFER_SIZE_ALL means all).

Reimplemented from SoBufferObject.

◆ memset()

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.

Parameters
valueis a pointer to the value to set in the buffer.
valueSizeThe size in bytes of the value. Default is 1 byte.
offsetIndex of first value to be changed. Default is 0.
countThe number of values to change. Default is number of values in buffer.

Reimplemented from SoBufferObject.

◆ setMinMax()

virtual void SoCpuBufferBitSet::setMinMax ( const double &  min,
const double &  max 
)
virtual

Set min and max values for this buffer.

Parameters
minuser variable containing min value
maxuser variable containing max value

◆ unmap() [1/4]

virtual void SoCpuBufferBitSet::unmap ( )
virtual

Unmap a mapped buffer.

No error is reported if the buffer was not mapped.

Reimplemented from SoBufferObject.

◆ unmap() [2/4]

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.

Parameters
bufferObjectBuffer to be unmapped.

Reimplemented from SoBufferObject.

◆ unmap() [3/4]

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.

◆ unmap() [4/4]

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.

Parameters
bufferObjectBuffer to be unmapped.

Friends And Related Symbol Documentation

◆ SoCpuBufferBitSetImpl

friend class SoCpuBufferBitSetImpl
friend

Definition at line 223 of file SoCpuBufferBitSet.h.


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