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/devices/SoCpuBufferObject.h>
00026
00027 #include <LDM/tiles/SoBufferPropertiesInterface.h>
00028 #include <LDM/tiles/SoLDMBufferObjectInterface.h>
00029 #include <LDM/compressors/SoDataCompressor.h>
00030
00031 class SoGLBufferObject;
00032 class SoCpuBufferCompressedImpl;
00033
00048 class SoCpuBufferCompressed: public SoCpuBufferObject, public SoBufferPropertiesInterface, public SoLDMBufferObjectInterface
00049 {
00050 SO_TYPED_CLASS_HEADER();
00051
00052
00053 public:
00054
00058 SoCpuBufferCompressed();
00059
00063 SoCpuBufferCompressed(SoDataCompressor* compressor);
00064
00076 virtual void map( SoBufferObject* targetBufferObject, SoBufferObject::AccessMode accessMode, size_t startPosition = 0, size_t mappingSize = SO_BUFFER_SIZE_ALL );
00077
00083 virtual void map( SoCpuBufferObject* targetBufferObject, SoBufferObject::AccessMode accessMode, size_t startPosition = 0, size_t mappingSize = SO_BUFFER_SIZE_ALL);
00084
00090 virtual void map( SoGLBufferObject* targetBufferObject, SoBufferObject::AccessMode accessMode, size_t startPosition = 0, size_t mappingSize = SO_BUFFER_SIZE_ALL);
00091
00098 virtual void* map( SoBufferObject::AccessMode accessMode, size_t offset = 0, size_t count = SO_BUFFER_SIZE_ALL );
00099
00108 virtual void unmap( SoCpuBufferObject* bufferObject );
00109
00118 virtual void unmap( SoGLBufferObject* bufferObject );
00119
00128 virtual void unmap( SoBufferObject* bufferObject );
00129
00135 virtual void unmap();
00136
00145 virtual bool getMinMax( double& min, double& max);
00146
00153 virtual void setMinMax(const double& min, const double& max);
00154
00158 size_t getRealSize() const;
00159
00165 virtual void setCompressor( SoDataCompressor* compressor );
00166
00167 private:
00168 SoCpuBufferCompressed(SoDataCompressor* compressor, const SoDataCompressor::TileInfo& tileInfo);
00169 bool setTileInfo( const SoDataCompressor::TileInfo& tileInfo);
00170
00171 private:
00175 virtual ~SoCpuBufferCompressed();
00176
00177 SoINTERNAL private:
00178
00179 virtual SoCpuBufferObject* createCachedBuffer();
00180 virtual void prefetchBuffer();
00181
00182 friend class SoCpuBufferCompressedImpl;
00183
00184 SoCpuBufferCompressed( SoCpuBufferCompressedImpl* impl);
00185 };
00186