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 SOCPUBUFFERCOMPRESSED_H
00024 #define SOCPUBUFFERCOMPRESSED_H
00025
00026 class SoDataCompressor;
00027
00028
00029 #include <Inventor/devices/SoCpuBufferObject.h>
00030
00031
00032 #include <LDM/tiles/SoBufferPropertiesInterface.h>
00033 #include <LDM/tiles/SoLDMBufferObjectInterface.h>
00034 #include <LDM/compressors/SoDataCompressor.h>
00035
00050 class SoCpuBufferCompressed: public SoCpuBufferObject, public SoBufferPropertiesInterface, public SoLDMBufferObjectInterface
00051 {
00052 SO_TYPED_CLASS_HEADER();
00053
00054
00055 public:
00056
00057
00061 SoCpuBufferCompressed();
00062
00066 SoCpuBufferCompressed(SoDataCompressor* compressor);
00067
00079 virtual void map( SoBufferObject* targetBufferObject, AccessMode accessMode, size_t startPosition = 0, size_t mappingSize = SO_BUFFER_SIZE_ALL );
00080
00086 virtual void map( SoCpuBufferObject* targetBufferObject, AccessMode accessMode, size_t startPosition = 0, size_t mappingSize = SO_BUFFER_SIZE_ALL);
00087
00093 virtual void map( SoGLBufferObject* targetBufferObject, AccessMode accessMode, size_t startPosition = 0, size_t mappingSize = SO_BUFFER_SIZE_ALL);
00094
00101 virtual void* map( AccessMode accessMode );
00102
00111 virtual void unmap( SoCpuBufferObject* bufferObject );
00112
00121 virtual void unmap( SoGLBufferObject* bufferObject );
00122
00131 virtual void unmap( SoBufferObject* bufferObject );
00132
00138 virtual void unmap();
00139
00148 virtual bool getMinMax ( double& min, double& max);
00149
00156 virtual void setMinMax(const double& min, const double& max);
00157
00161 size_t getRealSize() const;
00162
00168 virtual void setCompressor( SoDataCompressor* compressor );
00169
00176 virtual bool setSize( size_t size );
00177
00178 private:
00179 SoCpuBufferCompressed(SoDataCompressor* compressor, const SoDataCompressor::TileInfo& tileInfo);
00180 bool setTileInfo( const SoDataCompressor::TileInfo& tileInfo);
00181
00182 private:
00186 virtual ~SoCpuBufferCompressed();
00187
00188 SoINTERNAL private:
00189
00190 virtual SoCpuBufferObject* createCachedBuffer();
00191
00192 virtual void prefetchBuffer();
00193
00194 private:
00195 SoDataCompressor* m_compressor;
00196 SoDataCompressor::TileInfo m_tileInfo;
00197
00198
00199 };
00200
00201 #endif //SOCPUBUFFERCOMPRESSED_H
00202