00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #if !defined SOCPUBUFFERUNIFORM_H
00024 #define SOCPUBUFFERUNIFORM_H
00025
00026
00027 #include <Inventor/SbDataType.h>
00028 #include <Inventor/devices/SoCpuBufferObject.h>
00029
00030
00031 #include <LDM/tiles/SoBufferPropertiesInterface.h>
00032 #include <LDM/tiles/SoLDMBufferObjectInterface.h>
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, AccessMode accessMode, size_t startPosition = 0, size_t mappingSize = SO_BUFFER_SIZE_ALL );
00081
00087 virtual void map( SoCpuBufferObject* targetBufferObject, AccessMode accessMode, size_t startPosition = 0, size_t mappingSize = SO_BUFFER_SIZE_ALL );
00088
00094 virtual void map( SoGLBufferObject* targetBufferObject, 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( AccessMode accessMode );
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
00164 virtual bool setSize( size_t size );
00165
00174 virtual bool getMinMax ( double& min, double& max);
00175
00179 virtual double getValue() const;
00180
00184 virtual SbDataType getType() const;
00185
00189 void setValue(const double &value, const SbDataType &dataType);
00190
00194 virtual size_t getRealSize() const;
00195
00199 virtual void setRealSize(const size_t &realSize);
00200
00201 private:
00205 virtual ~SoCpuBufferUniform();
00206
00207 private:
00208
00210 virtual SoBufferObject* clone() const;
00211
00212 SoINTERNAL private:
00213
00214 virtual SoCpuBufferObject* createCachedBuffer();
00215
00216 virtual void prefetchBuffer();
00217
00218 private:
00219 double m_value;
00220 SbDataType m_type;
00221
00222 };
00223
00224 #endif //SOCPUBUFFERUNIFORM_H
00225
00226