00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _SO_VR_MEMORY_READER_
00024 #define _SO_VR_MEMORY_READER_
00025
00026 #include <LDM/readers/SoVolumeReader.h>
00027
00028 #ifdef _MSC_VER
00029 #pragma warning( push )
00030 #pragma warning(disable:4251)
00031 #endif
00032
00033 class SoBufferObject;
00034
00045 class SoVRMemoryReader : public SoVolumeReader
00046 {
00047
00048 SO_FIELDCONTAINER_HEADER(SoVRMemoryReader);
00049
00050 public:
00051
00055 SoVRMemoryReader();
00056
00063 virtual ReadError getDataChar( SbBox3f &size, SoDataSet::DataType &type, SbVec3i32 &dim );
00064
00070 virtual void getSubSlice( const SbBox2i32& subSlice, int sliceNumber, void * data );
00071
00076 virtual void getSubSlice(const SbBox2i32& subSlice, int sliceNumber, SoBufferObject * dataBuffer);
00077
00081 void setProperties ( const SbBox3f& size, SoDataSet::DataType type, const SbVec3i32 &dim,
00082 const SbVec2i32 &padding, SoBufferObject* internalData, int sigBits);
00083
00087 void setProperties ( const SbBox3f& size, SoDataSet::DataType type, const SbVec3i32 &dim,
00088 SoBufferObject* internalData, int sigBits);
00089
00093 void setProperties ( SbBox3f size, SoDataSet::DataType type, SbVec3s dim,
00094 SoBufferObject* internalData, int sigBits = 0);
00098 virtual int getNumSignificantBits();
00099
00103 virtual SoVolumeReader::ReaderType getReaderType ()
00104 {return MEMORY;}
00105
00109 virtual SbBool isThreadSafe() const;
00110
00113 virtual SoVolumeWriter* getConfiguredWriter();
00114
00115 private:
00116 SbBox3f m_size;
00117 SbVec3i32 m_dim;
00118 SbVec2i32 m_padding;
00119 SoDataSet::DataType m_type;
00120 int m_headerSize;
00121 SoRef<SoBufferObject> m_internalBuffer;
00122 int m_sigBits;
00123 };
00124
00125 #ifdef _MSC_VER
00126 #pragma warning( pop )
00127 #endif
00128
00129 #endif // _SO_VR_MEMORY_READER_
00130
00131
00132