24 #ifndef vtkXMLWriter_h
25 #define vtkXMLWriter_h
29 #include <vtksys/ios/sstream>
62 enum { BigEndian, LittleEndian };
79 enum { Int32=32, Int64=64 };
85 enum { UInt32=32, UInt64=64 };
92 vtkSetMacro(ByteOrder,
int);
93 vtkGetMacro(ByteOrder,
int);
94 void SetByteOrderToBigEndian();
95 void SetByteOrderToLittleEndian();
101 virtual void SetHeaderType(
int);
102 vtkGetMacro(HeaderType,
int);
103 void SetHeaderTypeToUInt32();
104 void SetHeaderTypeToUInt64();
110 virtual void SetIdType(
int);
111 vtkGetMacro(IdType,
int);
112 void SetIdTypeToInt32();
113 void SetIdTypeToInt64();
118 vtkSetStringMacro(FileName);
119 vtkGetStringMacro(FileName);
124 vtkSetMacro(WriteToOutputString,
int);
125 vtkGetMacro(WriteToOutputString,
int);
126 vtkBooleanMacro(WriteToOutputString,
int);
147 void SetCompressorType(
int compressorType);
150 this->SetCompressorType(NONE);
154 this->SetCompressorType(ZLIB);
163 virtual void SetBlockSize(
size_t blockSize);
164 vtkGetMacro(BlockSize,
size_t);
171 vtkSetMacro(DataMode,
int);
172 vtkGetMacro(DataMode,
int);
173 void SetDataModeToAscii();
174 void SetDataModeToBinary();
175 void SetDataModeToAppended();
184 vtkSetMacro(EncodeAppendedData,
int);
185 vtkGetMacro(EncodeAppendedData,
int);
186 vtkBooleanMacro(EncodeAppendedData,
int);
200 virtual const char* GetDefaultFileExtension()=0;
212 vtkSetMacro(TimeStep,
int);
213 vtkGetMacro(TimeStep,
int);
218 vtkGetVector2Macro(TimeStepRange,
int);
219 vtkSetVector2Macro(TimeStepRange,
int);
224 vtkGetMacro(NumberOfTimeSteps,
int);
225 vtkSetMacro(NumberOfTimeSteps,
int);
232 void WriteNextTime(
double time);
239 virtual int RequestInformation(
286 # if VTK_SIZEOF_SHORT == 4
287 typedef short Int32IdType;
288 # elif VTK_SIZEOF_INT == 4
289 typedef int Int32IdType;
290 # elif VTK_SIZEOF_LONG == 4
291 typedef long Int32IdType;
293 # error "No native data type can represent a signed 32-bit integer."
319 virtual int WriteInternal();
326 virtual const char* GetDataSetName()=0;
329 virtual int GetDataSetMajorVersion();
330 virtual int GetDataSetMinorVersion();
334 virtual int StartFile();
335 virtual void WriteFileAttributes();
336 virtual int EndFile();
338 void DeleteAFile(
const char*
name);
340 virtual int WritePrimaryElement(ostream &os,
vtkIndent indent);
341 virtual void WritePrimaryElementAttributes(ostream &os,
vtkIndent indent);
342 void StartAppendedData();
343 void EndAppendedData();
352 vtkTypeInt64 ReserveAttributeSpace(
const char* attr,
size_t length=20);
354 vtkTypeInt64 GetAppendedDataOffset();
355 void WriteAppendedDataOffset(vtkTypeInt64 streamPos,
356 vtkTypeInt64 &lastoffset,
358 void ForwardAppendedDataOffset(vtkTypeInt64 streamPos,
361 void ForwardAppendedDataDouble(vtkTypeInt64 streamPos,
365 int WriteScalarAttribute(
const char*
name,
int data);
366 int WriteScalarAttribute(
const char*
name,
float data);
367 int WriteScalarAttribute(
const char*
name,
double data);
368 #ifdef VTK_USE_64BIT_IDS
372 int WriteVectorAttribute(
const char*
name,
int length,
int*
data);
373 int WriteVectorAttribute(
const char*
name,
int length,
float*
data);
374 int WriteVectorAttribute(
const char*
name,
int length,
double*
data);
375 #ifdef VTK_USE_64BIT_IDS
379 int WriteDataModeAttribute(
const char*
name);
380 int WriteWordTypeAttribute(
const char*
name,
int dataType);
381 int WriteStringAttribute(
const char*
name,
const char*
value);
384 const char* alternateName,
int writeNumTuples,
int timestep);
387 const char* alternateName=0,
int writeNumTuples=0);
391 OffsetsManager &offs,
const char* alternateName=0,
int writeNumTuples=0,
397 vtkTypeInt64 &lastoffset);
406 void WriteFieldDataAppendedData(
vtkFieldData* fd,
int timestep,
410 void WritePointDataAppendedData(
vtkPointData* pd,
int timestep,
414 void WriteCellDataAppendedData(
vtkCellData* cd,
int timestep,
432 const char* alternateName=0);
437 int WriteBinaryDataBlock(
unsigned char* in_data,
size_t numWords,
int wordType);
438 void PerformByteSwap(
void*
data,
size_t numWords,
size_t wordSize);
439 int CreateCompressionHeader(
size_t size);
440 int WriteCompressionBlock(
unsigned char*
data,
size_t size);
441 int WriteCompressionHeader();
442 size_t GetWordTypeSize(
int dataType);
443 const char* GetWordTypeName(
int dataType);
444 size_t GetOutputWordTypeSize(
int dataType);
446 char** CreateStringArray(
int numStrings);
447 void DestroyStringArray(
int numStrings,
char** strings);
451 virtual void GetProgressRange(
float range[2]);
452 virtual void SetProgressRange(
const float range[2],
int curStep,
int numSteps);
453 virtual void SetProgressRange(
const float range[2],
int curStep,
const float* fractions);
454 virtual void SetProgressPartial(
float fraction);
455 virtual void UpdateProgressDiscrete(
float progress);
456 float ProgressRange[2];
473 int TimeStepRange[2];
489 friend class vtkXMLWriterHelper;
vtkTypeInt64 * NumberOfTimeValues
Wrapper around std::string to keep symbols short.
Abstract interface for data compression classes.
represent and manipulate point attribute data
vtkDataObject * GetInput()
abstract class to specify dataset behavior
Abstract superclass for all arrays.
vtksys_ios::ostringstream * OutStringStream
represent and manipulate cell attribute data
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
std::string GetOutputString()
Helper class due to PIMPL excess.
Implementation template for a array iterator.
vtkOutputStream * DataStream
Superclass for all sources, filters, and sinks in VTK.
vtkTypeInt64 AppendedDataPosition
Superclass for VTK's XML file writers.
a simple class to control print indentation
abstract superclass for arrays of numeric data
size_t CompressionBlockNumber
Abstract superclass to iterate over elements in an vtkAbstractArray.
represent and manipulate attribute data in a dataset
void SetCompressorTypeToNone()
vtkTypeInt64 CompressionHeaderPosition
Wraps a binary output stream with a VTK interface.
vtkDataCompressor * Compressor
unsigned char * ByteSwapBuffer
general representation of visualization data
void SetCompressorTypeToZLib()
represent and manipulate 3D points
vtkXMLDataHeader * CompressionHeader
int UserContinueExecuting
OffsetsManagerGroup * FieldDataOM
represent and manipulate fields of data
Int32IdType * Int32IdTypeBuffer
void PrintSelf(ostream &os, vtkIndent indent)