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_GENERIC_FILE_READER_
00024 #define _SO_VR_GENERIC_FILE_READER_
00025
00026 #include <LDM/readers/SoVolumeReader.h>
00027 #include <VolumeViz/nodes/SoVolumeData.h>
00028
00029
00055 class SoVRGenericFileReader : public SoVolumeReader
00056 {
00057 SO_FIELDCONTAINER_HEADER(SoVRGenericFileReader);
00058
00059 public:
00061 SoVRGenericFileReader();
00062
00069 virtual ReadError getDataChar( SbBox3f &size, SoDataSet::DataType &type, SbVec3i32 &dim ) {
00070 size = m_size;
00071 type = m_type;
00072 dim = m_dim;
00073 return RD_NO_ERROR;
00074 };
00075
00081 virtual void getSubSlice( const SbBox2i32& subSlice, int sliceNumber, void * data );
00082
00088 void setDataChar( const SbBox3f &size, const SoDataSet::DataType &type, const SbVec3i32 &dim, int headerSize = 0) {
00089 m_size = size;
00090 m_type = type;
00091 m_dim = dim;
00092 m_bytesPerVoxel = SoVolumeData::dataSize( type );
00093 m_headerSize = headerSize;
00094 }
00095
00099 virtual SoVolumeReader::ReaderType getReaderType ()
00100 {return GENERIC;};
00101
00102 #if 1 SoDEPRECATED
00108 void setDataChar( SbBox3f &size, SoDataSet::DataType &type, SbVec3s &smalldim, int headerSize = 0) {
00109 SbVec3i32 dim(smalldim[0],smalldim[1],smalldim[2]);
00110 setDataChar( size, type, dim, headerSize );
00111 }
00112
00113 #endif
00115 private:
00116 SbBox3f m_size;
00117 SbVec3i32 m_dim;
00118 SoDataSet::DataType m_type;
00119
00120 int m_headerSize;
00121 };
00122
00123 #endif // _SO_VR_GENERIC_FILE_READER_
00124
00125
00126