00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #pragma once
00024
00025 #include <Inventor/SbDataType.h>
00026 #include <Inventor/devices/SoCpuBufferObject.h>
00027 #include <LDM/tiles/SoBufferPropertiesInterface.h>
00028 #include <LDM/tiles/SoLDMBufferObjectInterface.h>
00029
00030
00031 class SoGLBufferObject;
00032 class SoCpuBufferUniformImpl;
00033
00049 class SoCpuBufferUniform: public SoCpuBufferObject, public SoBufferPropertiesInterface, public SoLDMBufferObjectInterface
00050 {
00051 SO_TYPED_CLASS_HEADER();
00052
00053
00054 public:
00055
00059 SoCpuBufferUniform();
00060
00067 SoCpuBufferUniform(const double value, SbDataType valueType );
00068
00080 virtual void map( SoBufferObject* targetBufferObject, SoBufferObject::AccessMode accessMode, size_t startPosition = 0, size_t mappingSize = SO_BUFFER_SIZE_ALL );
00081
00087 virtual void map( SoCpuBufferObject* targetBufferObject, SoBufferObject::AccessMode accessMode, size_t startPosition = 0, size_t mappingSize = SO_BUFFER_SIZE_ALL );
00088
00094 virtual void map( SoGLBufferObject* targetBufferObject, SoBufferObject::AccessMode accessMode, size_t startPosition = 0, size_t mappingSize = SO_BUFFER_SIZE_ALL );
00095
00104 virtual void unmap( SoCpuBufferObject* bufferObject );
00105
00114 virtual void unmap( SoGLBufferObject* bufferObject );
00115
00124 virtual void unmap( SoBufferObject* bufferObject );
00125
00132 virtual void* map( SoBufferObject::AccessMode accessMode, size_t offset = 0, size_t count = SO_BUFFER_SIZE_ALL );
00133
00139 virtual void unmap();
00140
00151 virtual void memset( void* data, size_t dataSize = 1, size_t offset = 0, size_t count = SO_BUFFER_SIZE_ALL );
00152
00156 virtual void memcpy( SoBufferObject* sourceBufferObject, size_t destOffset, size_t sourceOffset, size_t copySize );
00157
00166 virtual bool getMinMax( double& min, double& max);
00167
00171 virtual double getValue() const;
00172
00176 virtual SbDataType getType() const;
00177
00181 void setValue(const double &value, const SbDataType &dataType);
00182
00186 virtual size_t getRealSize() const;
00187
00191 virtual void setRealSize(const size_t &realSize);
00192
00193 private:
00197 virtual ~SoCpuBufferUniform();
00198
00199 private:
00200
00202 virtual SoBufferObject* clone() const;
00203
00204 SoINTERNAL private:
00205
00206 virtual SoCpuBufferObject* createCachedBuffer();
00207 virtual void prefetchBuffer();
00208
00209 friend class SoCpuBufferUniformImpl;
00210
00211 SoCpuBufferUniform(SoCpuBufferUniformImpl* impl);
00212 };
00213
00214