00001 /*======================================================================= 00002 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00003 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00004 *** *** 00005 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00006 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00007 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00008 *** *** 00009 *** RESTRICTED RIGHTS LEGEND *** 00010 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00011 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00012 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00013 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00014 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00015 *** *** 00016 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : Thibaut Andrieu (Jun 2011) 00022 **=======================================================================*/ 00023 00024 #if !defined _SO_VR_LDM_FILE_WRITER_H_ 00025 #define _SO_VR_LDM_FILE_WRITER_H_ 00026 00027 #include <LDM/writers/SoVolumeWriter.h> 00028 #include <LDM/converters/SoLDMWriter.h> 00029 #include <Inventor/fields/SoSFUInt32.h> 00030 #include <Inventor/fields/SoSFVec3i32.h> 00031 #include <Inventor/fields/SoSFBool.h> 00032 #include <Inventor/fields/SoSFDouble.h> 00033 #include <Inventor/fields/SoSFVec2d.h> 00034 #include <Inventor/fields/SoMFFloat.h> 00035 #include <LDM/readers/SoVolumeReader.h> 00036 00037 #ifdef _MSC_VER 00038 #pragma warning( push ) 00039 #pragma warning(disable:4251) 00040 #endif // ! _MSC_VER 00041 00042 00149 class SoVRLdmFileWriter : public SoVolumeWriter 00150 { 00151 SO_FIELDCONTAINER_HEADER( SoVRLdmFileWriter ); 00152 00153 public: 00154 00156 SoSFString headerFilename; 00157 00159 SoSFString dataFilename; 00160 00163 SoSFString originalFilename; 00164 00166 SoSFVec3i32 tileDimension; 00167 00169 SoSFBool doMultiResolution; 00170 00178 SoSFInt32 lowResAlgorithm; 00179 00182 SoSFBool saveAsBitSet; 00183 00190 SoSFDouble bitSetThreashold; 00191 00194 SoSFBool isRGBA; 00195 00208 SoSFBool enableHistogram; 00209 00215 SoSFBool enableTileMinMax; 00216 00222 SoSFDouble undefinedValue; 00223 00229 SoSFDouble defaultValue; 00230 00239 SoSFString compressionName; 00240 00255 SoSFInt32 compressionLevel; 00256 00258 SoSFBool headerOnly; 00259 00261 SoSFBool verbose; 00262 00270 SoSFBool crcCheck; 00271 00274 SoSFVec2d inputDataRange; 00275 00277 SoSFEnum coordinateType; 00278 00280 SoMFFloat coordinatesX; 00281 00283 SoMFFloat coordinatesY; 00284 00286 SoMFFloat coordinatesZ; 00287 00289 enum CoordinateType { 00291 COORDINATES_UNIFORM = SoVolumeReader::COORDINATES_UNIFORM, 00293 COORDINATES_RECTILINEAR = SoVolumeReader::COORDINATES_RECTILINEAR 00294 }; 00295 00296 00298 SoVRLdmFileWriter(); 00299 00302 virtual SbBool initialize(); 00303 00308 virtual SbBool closeAllHandles(); 00309 00311 virtual SbBool restoreAllHandles(); 00312 00314 virtual SbBool isDataConverted() const; 00315 00317 virtual SbBool writeTile( const SoLDMTileID& tileId, SoBufferObject* buffer ); 00318 00322 virtual SbBool finish(); 00323 00324 private: 00325 00332 SoSFBool forceAlwaysUpdateLowRes; 00333 00335 virtual void notify(SoNotList *); 00336 00337 private: 00338 00340 virtual ~SoVRLdmFileWriter(); 00341 00342 private: 00343 00345 bool m_isInitialized; 00346 00349 SoLDMWriter m_ldmWriter; 00350 00352 std::vector<char*> m_writerParameters; 00353 00354 }; 00355 00356 #ifdef _MSC_VER 00357 #pragma warning(pop) 00358 #endif 00359 00360 #endif // _SO_VR_LDM_FILE_WRITER_H_ 00361 00362 00363