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 ReaderType getReaderType ()
00104 {return MEMORY;}
00105
00109 virtual SbBool isThreadSafe() const;
00110
00113 virtual SoVolumeWriter* getConfiguredWriter();
00114
00115 #if 1 SoDEPRECATED
00121 SoVRMemoryReader(const SbBox3f& size, SoDataSet::DataType type, const SbVec3i32& dim, const SbVec2i32& padding,
00122 void* internalData, int sigBits = 0);
00123 SoDEPRECATED
00128 SoVRMemoryReader( SbBox3f size, SoDataSet::DataType type, SbVec3s smalldim, void* internalData, int sigBits = 0);
00129
00130 #endif
00132 #if 1 SoDEPRECATED
00139 SoVRMemoryReader(const SbBox3f& size, SoDataSet::DataType type, const SbVec3i32& dim, void* internalData, int sigBits = 0);
00140
00141 #endif
00143 #if 1 SoDEPRECATED
00149 void setProperties ( const SbBox3f& size, SoDataSet::DataType type, const SbVec3i32 &dim,
00150 const SbVec2i32 &padding, void* internalData, int sigBits);
00151 SoDEPRECATED
00156 void setProperties ( const SbBox3f& size, SoDataSet::DataType type, const SbVec3i32 &dim,
00157 void* internalData, int sigBits);
00158 SoDEPRECATED
00163 void setProperties ( SbBox3f size, SoDataSet::DataType type, SbVec3s dim,
00164 void* internalData, int sigBits = 0);
00165
00166 #endif
00168 private:
00169 SbBox3f m_size;
00170 SbVec3i32 m_dim;
00171 SbVec2i32 m_padding;
00172 SoDataSet::DataType m_type;
00173 int m_headerSize;
00174 int m_bytesPerVoxel;
00175 SoRef<SoBufferObject> m_internalBuffer;
00176 int m_sigBits;
00177 };
00178
00179 #ifdef _MSC_VER
00180 #pragma warning( pop )
00181 #endif
00182
00183 #endif // _SO_VR_MEMORY_READER_
00184
00185
00186