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 SOCPUBUFFERFROMVOLUMEREADER_H
00024 #define SOCPUBUFFERFROMVOLUMEREADER_H
00025
00026 class SoVolumeReader;
00027 class SoDataSet;
00028
00029
00030 #include <Inventor/SbDataType.h>
00031 #include <Inventor/devices/SoCpuBufferObject.h>
00032
00033
00034 #include <LDM/SoLDMTileID.h>
00035 #include <LDM/tiles/SoBufferPropertiesInterface.h>
00036 #include <LDM/tiles/SoLDMBufferObjectInterface.h>
00037
00049 class SoCpuBufferFromVolumeReader: public SoCpuBufferObject, public SoBufferPropertiesInterface, public SoLDMBufferObjectInterface
00050 {
00051 SO_TYPED_CLASS_HEADER();
00052
00053
00054 public:
00055
00062 SoCpuBufferFromVolumeReader( SoDataSet* dataset, SoLDMTileID tileId );
00063
00075 virtual void map( SoBufferObject* targetBufferObject, AccessMode accessMode, size_t startPosition, size_t mappingSize = SO_BUFFER_SIZE_ALL);
00076
00082 virtual void map( SoCpuBufferObject* targetBufferObject, AccessMode accessMode, size_t startPosition = 0, size_t mappingSize = SO_BUFFER_SIZE_ALL );
00083
00089 virtual void map( SoGLBufferObject* targetBufferObject, AccessMode accessMode, size_t startPosition = 0, size_t mappingSize = SO_BUFFER_SIZE_ALL );
00090
00091
00098 virtual void* map( AccessMode accessMode );
00099
00108 virtual void unmap( SoCpuBufferObject* bufferObject );
00109
00118 virtual void unmap( SoGLBufferObject* bufferObject );
00119
00126 void unmap( SoBufferObject* bufferObject );
00127
00133 virtual void unmap();
00134
00141 virtual bool setSize( size_t size );
00142
00151 bool getMinMax ( double& min, double& max);
00152
00156 size_t getRealSize() const;
00157
00158 private:
00162 virtual ~SoCpuBufferFromVolumeReader();
00163
00164 SoINTERNAL private:
00165
00166 virtual SoCpuBufferObject* createCachedBuffer();
00167
00168 virtual void prefetchBuffer();
00169
00170 private:
00171
00172 SoLDMTileID m_tileId;
00173 SoDataSet* m_ds;
00174
00178 SoCpuBufferFromVolumeReader() {}
00179
00180 };
00181
00182 #endif //SOCPUBUFFERFROMVOLUMEREADER_H
00183
00184