24 #ifndef __vtkXMLWriter_h
25 #define __vtkXMLWriter_h
59 enum { BigEndian, LittleEndian };
87 enum { Int32=32, Int64=64 };
94 vtkSetMacro(ByteOrder,
int);
95 vtkGetMacro(ByteOrder,
int);
96 void SetByteOrderToBigEndian();
97 void SetByteOrderToLittleEndian();
103 virtual void SetIdType(
int);
104 vtkGetMacro(IdType,
int);
105 void SetIdTypeToInt32();
106 void SetIdTypeToInt64();
111 vtkSetStringMacro(FileName);
112 vtkGetStringMacro(FileName);
132 void SetCompressorType(
int compressorType);
135 this->SetCompressorType(NONE);
139 this->SetCompressorType(ZLIB);
148 virtual void SetBlockSize(
unsigned int blockSize);
149 vtkGetMacro(BlockSize,
unsigned int);
156 vtkSetMacro(DataMode,
int);
157 vtkGetMacro(DataMode,
int);
158 void SetDataModeToAscii();
159 void SetDataModeToBinary();
160 void SetDataModeToAppended();
169 vtkSetMacro(EncodeAppendedData,
int);
170 vtkGetMacro(EncodeAppendedData,
int);
171 vtkBooleanMacro(EncodeAppendedData,
int);
184 virtual const char* GetDefaultFileExtension()=0;
196 vtkSetMacro(TimeStep,
int);
197 vtkGetMacro(TimeStep,
int);
202 vtkGetVector2Macro(TimeStepRange,
int);
203 vtkSetVector2Macro(TimeStepRange,
int);
208 vtkGetMacro(NumberOfTimeSteps,
int);
209 vtkSetMacro(NumberOfTimeSteps,
int);
216 void WriteNextTime(
double time);
223 virtual int RequestInformation(
260 #if VTK_SIZEOF_SHORT == 4
261 typedef unsigned short HeaderType;
262 #elif VTK_SIZEOF_INT == 4
263 typedef unsigned int HeaderType;
264 #elif VTK_SIZEOF_LONG == 4
265 typedef unsigned long HeaderType;
267 # error "No native data type can represent an unsigned 32-bit integer."
275 # if VTK_SIZEOF_SHORT == 4
276 typedef short Int32IdType;
277 # elif VTK_SIZEOF_INT == 4
278 typedef int Int32IdType;
279 # elif VTK_SIZEOF_LONG == 4
280 typedef long Int32IdType;
282 # error "No native data type can represent a signed 32-bit integer."
309 virtual int WriteInternal();
316 virtual const char* GetDataSetName()=0;
319 virtual int GetDataSetMajorVersion();
320 virtual int GetDataSetMinorVersion();
325 virtual void WriteFileAttributes();
328 void DeleteAFile(
const char*
name);
330 virtual int WritePrimaryElement(ostream &os,
vtkIndent indent);
331 virtual void WritePrimaryElementAttributes(ostream &os,
vtkIndent indent);
332 void StartAppendedData();
333 void EndAppendedData();
342 OffsetType ReserveAttributeSpace(
const char* attr,
int length=20);
344 OffsetType GetAppendedDataOffset();
345 OffsetType WriteAppendedDataOffset(OffsetType streamPos,
346 OffsetType &lastoffset,
348 OffsetType ForwardAppendedDataOffset(OffsetType streamPos,
351 OffsetType ForwardAppendedDataDouble(OffsetType streamPos,
355 int WriteScalarAttribute(
const char*
name,
int data);
356 int WriteScalarAttribute(
const char*
name,
float data);
357 int WriteScalarAttribute(
const char*
name,
double data);
358 #ifdef VTK_USE_64BIT_IDS
362 int WriteVectorAttribute(
const char*
name,
int length,
int*
data);
363 int WriteVectorAttribute(
const char*
name,
int length,
float*
data);
364 int WriteVectorAttribute(
const char*
name,
int length,
double*
data);
365 #ifdef VTK_USE_64BIT_IDS
369 int WriteDataModeAttribute(
const char*
name);
370 int WriteWordTypeAttribute(
const char*
name,
int dataType);
371 int WriteStringAttribute(
const char*
name,
const char*
value);
374 const char* alternateName,
int writeNumTuples,
int timestep);
377 const char* alternateName=0,
int writeNumTuples=0);
381 OffsetsManager &offs,
const char* alternateName=0,
int writeNumTuples=0,
387 OffsetType &lastoffset);
396 void WriteFieldDataAppendedData(
vtkFieldData* fd,
int timestep,
400 void WritePointDataAppendedData(
vtkPointData* pd,
int timestep,
404 void WriteCellDataAppendedData(
vtkCellData* cd,
int timestep,
425 const char* alternateName=0);
430 int WriteBinaryDataInternal(
void*
data, OffsetType numWords,
int wordType);
431 int WriteBinaryDataBlock(
unsigned char* in_data, OffsetType numWords,
int wordType);
432 void PerformByteSwap(
void*
data, OffsetType numWords,
int wordSize);
433 int CreateCompressionHeader(OffsetType
size);
434 int WriteCompressionBlock(
unsigned char*
data, OffsetType
size);
435 int WriteCompressionHeader();
436 OffsetType GetWordTypeSize(
int dataType);
437 const char* GetWordTypeName(
int dataType);
438 OffsetType GetOutputWordTypeSize(
int dataType);
440 char** CreateStringArray(
int numStrings);
441 void DestroyStringArray(
int numStrings,
char** strings);
445 virtual void GetProgressRange(
float*
range);
446 virtual void SetProgressRange(
float*
range,
int curStep,
int numSteps);
447 virtual void SetProgressRange(
float*
range,
int curStep,
float* fractions);
448 virtual void SetProgressPartial(
float fraction);
449 virtual void UpdateProgressDiscrete(
float progress);
450 float ProgressRange[2];
462 int TimeStepRange[2];
470 friend class vtkXMLWriterHelper;
OffsetType CompressionBlockNumber
Wrapper around vtkstd::string to keep symbols short.
unsigned long * NumberOfTimeValues
Abstract interface for data compression classes.
represent and manipulate point attribute data
vtkDataObject * GetInput()
OffsetType AppendedDataPosition
abstract class to specify dataset behavior
Abstract superclass for all arrays.
represent and manipulate cell attribute data
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Helper class due to PIMPL excess.
Implementation template for a array iterator.
vtkOutputStream * DataStream
unsigned int CompressionHeaderLength
Superclass for all sources, filters, and sinks in VTK.
HeaderType * CompressionHeader
Superclass for VTK's XML file writers.
a simple class to control print indentation
OffsetType CompressionHeaderPosition
abstract superclass for arrays of numeric data
Abstract superclass to iterate over elements in an vtkAbstractArray.
represent and manipulate attribute data in a dataset
void SetCompressorTypeToNone()
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
int UserContinueExecuting
OffsetsManagerGroup * FieldDataOM
represent and manipulate fields of data
Int32IdType * Int32IdTypeBuffer
void PrintSelf(ostream &os, vtkIndent indent)