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
00246 class SoLDMWriter
00247 {
00248 public:
00252 SoLDMWriter();
00253
00257 virtual ~SoLDMWriter();
00258
00265 void setXmlCallback( void (*xmlCB)( FILE*, void * userData ), void * userData );
00266
00273 int initialize( const SbString & filename,
00274 const SoDataSet & inputVolData,
00275 SoConverterParameters* parameters );
00276
00283 int initialize( const SbString & filename,
00284 const SbBox3f & size, const SbVec3i32 & dimension, SoDataSet::DataType dataType,
00285 SoConverterParameters* parameters );
00286
00310 int writeSubVolume( const SbBox3i32 & subVolume, SoBufferObject* data, SbBool doLowerResolution = TRUE, SbBool doOverlappingTiles = TRUE );
00311
00317 int writeTile( const SbVec3i32 & location, SoBufferObject* data, int resolution = 0 );
00318
00322 int writeTile( const SoLDMTileID & tileID, SoBufferObject* data );
00323
00329 int finish( SbBool doMultiResolution = TRUE );
00330
00331 #if 1 SoDEPRECATED
00334 int writeSubVolume( const SbBox3i32 & subVolume, const void * data, SbBool doLowerResolution = TRUE, SbBool doOverlappingTiles = TRUE );
00335 SoDEPRECATED
00337 int writeTile( const SbVec3i32 & location, void * data, int resolution = 0 );
00338 SoDEPRECATED
00340 int writeTile( const SoLDMTileID & tileID, void * data );
00341
00342 #endif
00344 #if 1 SoDEPRECATED
00355 int initialize( const SbString & filename,
00356 const SoDataSet & inputVolData,
00357 int argc = 0, char** argv = NULL );
00358 SoDEPRECATED
00368 int initialize( const SbString & filename,
00369 const SbBox3f & size, const SbVec3i32 & dimension, SoDataSet::DataType dataType,
00370 int argc = 0, char** argv = NULL );
00371
00372 #endif
00374 private:
00375
00376 int finish( bool doMultiResolution )
00377 { return finish( (SbBool)doMultiResolution ); }
00378
00379 void disableWarning(bool flag) { m_warning = flag; };
00380
00381 private:
00382 void (*m_xmlCB)( FILE*, void* );
00383 void *m_xmlCBUserData;
00384
00385 bool m_initiated;
00386 int m_retCode;
00387 SoLDMWriterConverter *m_converter;
00388 SoLDMReader* m_reader;
00389 void release();
00390
00391
00393 bool init(const SbString & filename);
00394
00395 int initiateConverter( const SbString & filename, int argc = 0, char** argv = NULL );
00396 int initiateConverter( const SbString & filename, SoConverterParameters* parameters );
00397
00398 private:
00400 bool m_warning;
00401
00402 };
00403
00404 #endif // _SO_LDM_WRITER_
00405
00406
00407