00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _SO_LDM_WRITER_
00026 #define _SO_LDM_WRITER_
00027
00028 #include <LDM/nodes/SoDataSet.h>
00029 class SoLDMWriterConverter;
00030 class SoLDMWriterReader;
00031 class SoConverterParameters;
00032
00245 class SoLDMWriter
00246 {
00247 public:
00251 SoLDMWriter();
00252
00256 virtual ~SoLDMWriter();
00257
00264 void setXmlCallback( void (*xmlCB)( FILE*, void * userData ), void * userData );
00265
00272 int initialize( const SbString & filename,
00273 const SoDataSet & inputVolData,
00274 SoConverterParameters* parameters );
00275
00282 int initialize( const SbString & filename,
00283 const SbBox3f & size, const SbVec3i32 & dimension, SoDataSet::DataType dataType,
00284 SoConverterParameters* parameters );
00285
00309 int writeSubVolume( const SbBox3i32 & subVolume, SoBufferObject* data, SbBool doLowerResolution = TRUE, SbBool doOverlappingTiles = TRUE );
00310
00316 int writeTile( const SbVec3i32 & location, SoBufferObject* data, int resolution = 0 );
00317
00321 int writeTile( const SoLDMTileID & tileID, SoBufferObject* data );
00322
00328 int finish( SbBool doMultiResolution = TRUE );
00329
00330 #if 1 SoDEPRECATED
00333 int writeSubVolume( const SbBox3i32 & subVolume, const void * data, SbBool doLowerResolution = TRUE, SbBool doOverlappingTiles = TRUE );
00334 SoDEPRECATED
00336 int writeTile( const SbVec3i32 & location, void * data, int resolution = 0 );
00337 SoDEPRECATED
00339 int writeTile( const SoLDMTileID & tileID, void * data );
00340
00341 #endif
00343 #if 1 SoDEPRECATED
00354 int initialize( const SbString & filename,
00355 const SoDataSet & inputVolData,
00356 int argc = 0, char** argv = NULL );
00357 SoDEPRECATED
00367 int initialize( const SbString & filename,
00368 const SbBox3f & size, const SbVec3i32 & dimension, SoDataSet::DataType dataType,
00369 int argc = 0, char** argv = NULL );
00370
00371 #endif
00373 private:
00374
00375 int finish( bool doMultiResolution )
00376 { return finish( (SbBool)doMultiResolution ); }
00377
00378 void disableWarning(bool flag) { m_warning = flag; };
00379
00380 private:
00381 void (*m_xmlCB)( FILE*, void* );
00382 void *m_xmlCBUserData;
00383
00384 bool m_initiated;
00385 int m_retCode;
00386 SoLDMWriterConverter *m_converter;
00387 SoLDMReader* m_reader;
00388 void release();
00389
00390
00392 bool init(const SbString & filename);
00393
00394 int initiateConverter( const SbString & filename, int argc = 0, char** argv = NULL );
00395 int initiateConverter( const SbString & filename, SoConverterParameters* parameters );
00396
00397 private:
00399 bool m_warning;
00400
00401 };
00402
00403 #endif // _SO_LDM_WRITER_
00404
00405
00406