Package com.openinventor.ldm.tiles
Class SoCpuBufferUniform
java.lang.Object
com.openinventor.inventor.Inventor
com.openinventor.inventor.devices.SoBufferObject
com.openinventor.inventor.devices.SoCpuBufferObject
com.openinventor.ldm.tiles.SoCpuBufferUniform
- All Implemented Interfaces:
SafeDisposable
LDM buffer object optimized for uniform (single value) tile data.
This type of buffer efficiently represents a uniform tile, in other words a tile in which every value is the same. The buffer can be used like any other buffer, but uses very little memory when its contents are not actually being accessed.
SoBufferPropertiesInterface
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.openinventor.inventor.devices.SoBufferObject
SoBufferObject.AccessModes
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
Field Summary
Fields inherited from class com.openinventor.inventor.devices.SoBufferObject
SO_BUFFER_SIZE_ALL
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.SoCpuBufferUniform
(double value, SbDataType valueType) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]
Get the min and max values in the buffer, if they are known.long
Returns the real size of the buffer in bytes.getType()
Get the type of the value of the uniform tile.double
getValue()
Get the value of the uniform tile.void
map
(SoCpuBufferObject targetBufferObject, SoBufferObject.AccessModes accessMode) Calls map(targetBufferObject, accessMode, (long)0, (long)SO_BUFFER_SIZE_ALL).void
map
(SoCpuBufferObject targetBufferObject, SoBufferObject.AccessModes accessMode, long startPosition) Calls map(targetBufferObject, accessMode, startPosition, (long)SO_BUFFER_SIZE_ALL).void
map
(SoCpuBufferObject targetBufferObject, SoBufferObject.AccessModes accessMode, long startPosition, long mappingSize) Map the current buffer object into the specified CPU buffer object.void
map
(SoGLBufferObject targetBufferObject, SoBufferObject.AccessModes accessMode) Calls map(targetBufferObject, accessMode, (long)0, (long)SO_BUFFER_SIZE_ALL).void
map
(SoGLBufferObject targetBufferObject, SoBufferObject.AccessModes accessMode, long startPosition) Calls map(targetBufferObject, accessMode, startPosition, (long)SO_BUFFER_SIZE_ALL).void
map
(SoGLBufferObject targetBufferObject, SoBufferObject.AccessModes accessMode, long startPosition, long mappingSize) Map the current buffer object into the specified GL buffer object.void
setRealSize
(long realSize) Set the real size of the buffer object in bytes.void
setValue
(double value, SbDataType dataType) Set the value and data type for this uniform buffer.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.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.Methods inherited from class com.openinventor.inventor.devices.SoCpuBufferObject
clearInstance, setBuffer, setSize
Methods inherited from class com.openinventor.inventor.devices.SoBufferObject
createInstance, dispose, getContext, getMappedBufferObject, getMappedBufferObjectAccessMode, getMappedBufferObjectPosition, getMappedBufferObjectSize, getSize, isDisposable, lockBuffer, map, map, map, map, map, map, memcpy, memcpy, memcpy, memcpy, unlockBuffer, unmap, unmap
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
Constructor Details
-
SoCpuBufferUniform
public SoCpuBufferUniform()Default constructor. -
SoCpuBufferUniform
Constructor.- Parameters:
value
- Initial value of uniform buffer.valueType
- Initial value type of uniform buffer.
-
-
Method Details
-
map
Calls map(targetBufferObject, accessMode, (long)0, (long)SO_BUFFER_SIZE_ALL). -
map
public void map(SoCpuBufferObject targetBufferObject, SoBufferObject.AccessModes accessMode, long startPosition) Calls map(targetBufferObject, accessMode, startPosition, (long)SO_BUFFER_SIZE_ALL). -
map
Calls map(targetBufferObject, accessMode, (long)0, (long)SO_BUFFER_SIZE_ALL). -
map
public void map(SoGLBufferObject targetBufferObject, SoBufferObject.AccessModes accessMode, long startPosition) Calls map(targetBufferObject, accessMode, startPosition, (long)SO_BUFFER_SIZE_ALL). -
map
public void map(SoGLBufferObject targetBufferObject, SoBufferObject.AccessModes accessMode, long startPosition, long mappingSize) Map the current buffer object into the specified GL buffer object.
See the general map method for more information.
-
map
public void map(SoCpuBufferObject targetBufferObject, SoBufferObject.AccessModes accessMode, long startPosition, long mappingSize) Map the current buffer object into the specified CPU buffer object.
See the general map method for more information.
-
getValue
public double getValue()Get the value of the uniform tile. -
setRealSize
public void setRealSize(long realSize) Set the real size of the buffer object in bytes. -
getRealSize
public long getRealSize()Returns the real size of the buffer in bytes. -
getType
Get the type of the value of the uniform tile. -
getMinMax
public double[] getMinMax()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:
min
- user variable to store min valuemax
- user variable to store max value
-
unmap
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
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:
bufferObject
- Buffer to be unmapped.
-
setValue
Set the value and data type for this uniform buffer.
-