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 ReaderType getReaderType ()
00100 {return GENERIC;};
00101
00102
00103 #if 1 SoDEPRECATED
00106 virtual void setDataChar( const SbBox3f &size, const SoDataSet::DataType &type, const SbVec3s &dim, int headerSize = 0)
00107 {
00108 SbVec3i32 dimI32( dim[0], dim[1], dim[2] );
00109 setDataChar( size, type, dimI32, headerSize );
00110 }
00111
00112 #endif
00114 #if 1 SoDEPRECATED
00124 inline void setNumTimeSteps( int ) {}
00125
00126 #endif
00128 #if 1 SoDEPRECATED
00134 void setDataChar( SbBox3f &size, SoDataSet::DataType &type, SbVec3s &smalldim, int headerSize = 0) {
00135 SbVec3i32 dim(smalldim[0],smalldim[1],smalldim[2]);
00136 setDataChar( size, type, dim, headerSize );
00137 }
00138
00139 #endif
00141 private:
00142 SbBox3f m_size;
00143 SbVec3i32 m_dim;
00144 SoDataSet::DataType m_type;
00145
00146 int m_headerSize;
00147 int m_bytesPerVoxel;
00148 };
00149
00150 #endif // _SO_VR_GENERIC_FILE_READER_
00151
00152
00153