33 #ifndef vtkXMLWriter_h 34 #define vtkXMLWriter_h 36 #include "vtkIOXMLModule.h" 71 enum { BigEndian, LittleEndian };
86 enum { Int32=32, Int64=64 };
93 enum { UInt32=32, UInt64=64 };
100 vtkSetMacro(ByteOrder,
int);
101 vtkGetMacro(ByteOrder,
int);
102 void SetByteOrderToBigEndian();
103 void SetByteOrderToLittleEndian();
111 virtual void SetHeaderType(
int);
112 vtkGetMacro(HeaderType,
int);
113 void SetHeaderTypeToUInt32();
114 void SetHeaderTypeToUInt64();
122 virtual void SetIdType(
int);
123 vtkGetMacro(IdType,
int);
124 void SetIdTypeToInt32();
125 void SetIdTypeToInt64();
132 vtkSetStringMacro(FileName);
133 vtkGetStringMacro(FileName);
167 void SetCompressorType(
int compressorType);
170 this->SetCompressorType(NONE);
174 this->SetCompressorType(LZ4);
178 this->SetCompressorType(ZLIB);
182 this->SetCompressorType(LZMA);
185 void SetCompressionLevel(
int compressorLevel);
186 vtkGetMacro(CompressionLevel,
int);
196 virtual void SetBlockSize(
size_t blockSize);
197 vtkGetMacro(BlockSize,
size_t);
206 vtkSetMacro(DataMode,
int);
207 vtkGetMacro(DataMode,
int);
208 void SetDataModeToAscii();
209 void SetDataModeToBinary();
210 void SetDataModeToAppended();
241 virtual const char* GetDefaultFileExtension()=0;
258 vtkGetMacro(NumberOfTimeSteps,
int);
259 vtkSetMacro(NumberOfTimeSteps,
int);
268 void WriteNextTime(
double time);
275 virtual int RequestInformation(
321 # if VTK_SIZEOF_SHORT == 4 322 typedef short Int32IdType;
323 # elif VTK_SIZEOF_INT == 4 324 typedef int Int32IdType;
325 # elif VTK_SIZEOF_LONG == 4 326 typedef long Int32IdType;
328 # error "No native data type can represent a signed 32-bit integer." 345 int CompressionLevel = 5;
356 virtual int WriteInternal();
363 virtual const char* GetDataSetName()=0;
366 virtual int GetDataSetMajorVersion();
367 virtual int GetDataSetMinorVersion();
371 virtual int StartFile();
372 virtual void WriteFileAttributes();
373 virtual int EndFile();
375 void DeleteAFile(
const char*
name);
377 virtual int WritePrimaryElement(ostream &os,
vtkIndent indent);
378 virtual void WritePrimaryElementAttributes(ostream &os,
vtkIndent indent);
379 void StartAppendedData();
380 void EndAppendedData();
389 vtkTypeInt64 ReserveAttributeSpace(
const char* attr,
size_t length=20);
391 vtkTypeInt64 GetAppendedDataOffset();
392 void WriteAppendedDataOffset(vtkTypeInt64 streamPos,
393 vtkTypeInt64 &lastoffset,
394 const char* attr=
nullptr);
395 void ForwardAppendedDataOffset(vtkTypeInt64 streamPos,
397 const char* attr=
nullptr);
398 void ForwardAppendedDataDouble(vtkTypeInt64 streamPos,
402 int WriteScalarAttribute(
const char* name,
int data);
403 int WriteScalarAttribute(
const char* name,
float data);
404 int WriteScalarAttribute(
const char* name,
double data);
405 #ifdef VTK_USE_64BIT_IDS 406 int WriteScalarAttribute(
const char* name,
vtkIdType data);
409 int WriteVectorAttribute(
const char* name,
int length,
int* data);
410 int WriteVectorAttribute(
const char* name,
int length,
float* data);
411 int WriteVectorAttribute(
const char* name,
int length,
double* data);
412 #ifdef VTK_USE_64BIT_IDS 413 int WriteVectorAttribute(
const char* name,
int length,
vtkIdType* data);
416 int WriteDataModeAttribute(
const char* name);
417 int WriteWordTypeAttribute(
const char* name,
int dataType);
418 int WriteStringAttribute(
const char* name,
const char* value);
424 const char* alternateName,
int writeNumTuples,
int timestep);
427 const char* alternateName=
nullptr,
int writeNumTuples=0);
431 OffsetsManager &offs,
const char* alternateName=
nullptr,
int writeNumTuples=0,
437 vtkTypeInt64 &lastoffset);
446 void WriteFieldDataAppendedData(
vtkFieldData* fd,
int timestep,
450 void WritePointDataAppendedData(
vtkPointData* pd,
int timestep,
454 void WriteCellDataAppendedData(
vtkCellData* cd,
int timestep,
472 const char* alternateName=
nullptr);
477 int WriteBinaryDataBlock(
unsigned char* in_data,
size_t numWords,
int wordType);
478 void PerformByteSwap(
void* data,
size_t numWords,
size_t wordSize);
479 int CreateCompressionHeader(
size_t size);
480 int WriteCompressionBlock(
unsigned char* data,
size_t size);
481 int WriteCompressionHeader();
482 size_t GetWordTypeSize(
int dataType);
483 const char* GetWordTypeName(
int dataType);
484 size_t GetOutputWordTypeSize(
int dataType);
486 char** CreateStringArray(
int numStrings);
487 void DestroyStringArray(
int numStrings,
char** strings);
491 virtual void GetProgressRange(
float range[2]);
492 virtual void SetProgressRange(
const float range[2],
int curStep,
int numSteps);
493 virtual void SetProgressRange(
const float range[2],
int curStep,
const float* fractions);
494 virtual void SetProgressPartial(
float fraction);
495 virtual void UpdateProgressDiscrete(
float progress);
496 float ProgressRange[2];
530 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()
Assign a data object as input.
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)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
std::string GetOutputString()
Enable writing to an OutputString instead of the default, a file.
Helper class due to PIMPL excess.
vtkTypeBool EncodeAppendedData
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Implementation template for a array iterator.
vtkOutputStream * DataStream
void SetCompressorTypeToLZ4()
Convenience functions to set the compressor to certain known types.
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
void SetCompressorTypeToLZMA()
Convenience functions to set the compressor to certain known types.
vtkTypeBool WriteToOutputString
abstract superclass for arrays of numeric data
std::ostringstream * OutStringStream
size_t CompressionBlockNumber
Abstract superclass to iterate over elements in an vtkAbstractArray.
represent and manipulate attribute data in a dataset
void SetCompressorTypeToNone()
Convenience functions to set the compressor to certain known types.
vtkTypeInt64 CompressionHeaderPosition
Wraps a binary output stream with a VTK interface.
vtkDataCompressor * Compressor
unsigned char * ByteSwapBuffer
general representation of visualization data
void SetCompressorTypeToZLib()
Convenience functions to set the compressor to certain known types.
represent and manipulate 3D points
vtkXMLDataHeader * CompressionHeader
int UserContinueExecuting
OffsetsManagerGroup * FieldDataOM
represent and manipulate fields of data
Int32IdType * Int32IdTypeBuffer