30 #ifndef vtkXMLWriter_h 31 #define vtkXMLWriter_h 33 #include "vtkIOXMLModule.h" 68 enum { BigEndian, LittleEndian };
83 enum { Int32=32, Int64=64 };
90 enum { UInt32=32, UInt64=64 };
97 vtkSetMacro(ByteOrder,
int);
98 vtkGetMacro(ByteOrder,
int);
99 void SetByteOrderToBigEndian();
100 void SetByteOrderToLittleEndian();
108 virtual void SetHeaderType(
int);
109 vtkGetMacro(HeaderType,
int);
110 void SetHeaderTypeToUInt32();
111 void SetHeaderTypeToUInt64();
119 virtual void SetIdType(
int);
120 vtkGetMacro(IdType,
int);
121 void SetIdTypeToInt32();
122 void SetIdTypeToInt64();
129 vtkSetStringMacro(FileName);
130 vtkGetStringMacro(FileName);
164 void SetCompressorType(
int compressorType);
167 this->SetCompressorType(NONE);
171 this->SetCompressorType(LZ4);
175 this->SetCompressorType(ZLIB);
179 this->SetCompressorType(LZMA);
182 void SetCompressionLevel(
int compressorLevel);
183 vtkGetMacro(CompressionLevel,
int);
193 virtual void SetBlockSize(
size_t blockSize);
194 vtkGetMacro(BlockSize,
size_t);
203 vtkSetMacro(DataMode,
int);
204 vtkGetMacro(DataMode,
int);
205 void SetDataModeToAscii();
206 void SetDataModeToBinary();
207 void SetDataModeToAppended();
238 virtual const char* GetDefaultFileExtension()=0;
255 vtkGetMacro(NumberOfTimeSteps,
int);
256 vtkSetMacro(NumberOfTimeSteps,
int);
265 void WriteNextTime(
double time);
272 virtual int RequestInformation(
318 # if VTK_SIZEOF_SHORT == 4 319 typedef short Int32IdType;
320 # elif VTK_SIZEOF_INT == 4 321 typedef int Int32IdType;
322 # elif VTK_SIZEOF_LONG == 4 323 typedef long Int32IdType;
325 # error "No native data type can represent a signed 32-bit integer." 342 int CompressionLevel = 5;
353 virtual int WriteInternal();
360 virtual const char* GetDataSetName()=0;
363 virtual int GetDataSetMajorVersion();
364 virtual int GetDataSetMinorVersion();
368 virtual int StartFile();
369 virtual void WriteFileAttributes();
370 virtual int EndFile();
372 void DeleteAFile(
const char*
name);
374 virtual int WritePrimaryElement(ostream &os,
vtkIndent indent);
375 virtual void WritePrimaryElementAttributes(ostream &os,
vtkIndent indent);
376 void StartAppendedData();
377 void EndAppendedData();
386 vtkTypeInt64 ReserveAttributeSpace(
const char* attr,
size_t length=20);
388 vtkTypeInt64 GetAppendedDataOffset();
389 void WriteAppendedDataOffset(vtkTypeInt64 streamPos,
390 vtkTypeInt64 &lastoffset,
391 const char* attr=
nullptr);
392 void ForwardAppendedDataOffset(vtkTypeInt64 streamPos,
394 const char* attr=
nullptr);
395 void ForwardAppendedDataDouble(vtkTypeInt64 streamPos,
399 int WriteScalarAttribute(
const char*
name,
int data);
400 int WriteScalarAttribute(
const char*
name,
float data);
401 int WriteScalarAttribute(
const char*
name,
double data);
402 #ifdef VTK_USE_64BIT_IDS 406 int WriteVectorAttribute(
const char*
name,
int length,
int*
data);
407 int WriteVectorAttribute(
const char*
name,
int length,
float*
data);
408 int WriteVectorAttribute(
const char*
name,
int length,
double*
data);
409 #ifdef VTK_USE_64BIT_IDS 413 int WriteDataModeAttribute(
const char*
name);
414 int WriteWordTypeAttribute(
const char*
name,
int dataType);
415 int WriteStringAttribute(
const char*
name,
const char*
value);
421 const char* alternateName,
int writeNumTuples,
int timestep);
424 const char* alternateName=
nullptr,
int writeNumTuples=0);
428 OffsetsManager &offs,
const char* alternateName=
nullptr,
int writeNumTuples=0,
434 vtkTypeInt64 &lastoffset);
443 void WriteFieldDataAppendedData(
vtkFieldData* fd,
int timestep,
447 void WritePointDataAppendedData(
vtkPointData* pd,
int timestep,
451 void WriteCellDataAppendedData(
vtkCellData* cd,
int timestep,
469 const char* alternateName=
nullptr);
474 int WriteBinaryDataBlock(
unsigned char* in_data,
size_t numWords,
int wordType);
475 void PerformByteSwap(
void*
data,
size_t numWords,
size_t wordSize);
476 int CreateCompressionHeader(
size_t size);
477 int WriteCompressionBlock(
unsigned char*
data,
size_t size);
478 int WriteCompressionHeader();
479 size_t GetWordTypeSize(
int dataType);
480 const char* GetWordTypeName(
int dataType);
481 size_t GetOutputWordTypeSize(
int dataType);
483 char** CreateStringArray(
int numStrings);
484 void DestroyStringArray(
int numStrings,
char** strings);
488 virtual void GetProgressRange(
float range[2]);
489 virtual void SetProgressRange(
const float range[2],
int curStep,
int numSteps);
490 virtual void SetProgressRange(
const float range[2],
int curStep,
const float* fractions);
491 virtual void SetProgressPartial(
float fraction);
492 virtual void UpdateProgressDiscrete(
float progress);
493 float ProgressRange[2];
527 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