25 #ifndef vtkXMLWriter_h
26 #define vtkXMLWriter_h
28 #include "vtkIOXMLModule.h"
62 enum { BigEndian, LittleEndian };
77 enum { Int32=32, Int64=64 };
84 enum { UInt32=32, UInt64=64 };
92 vtkGetMacro(ByteOrder,
int);
93 void SetByteOrderToBigEndian();
94 void SetByteOrderToLittleEndian();
102 virtual void SetHeaderType(
int);
103 vtkGetMacro(HeaderType,
int);
104 void SetHeaderTypeToUInt32();
105 void SetHeaderTypeToUInt64();
113 virtual void SetIdType(
int);
114 vtkGetMacro(IdType,
int);
115 void SetIdTypeToInt32();
116 void SetIdTypeToInt64();
123 vtkSetStringMacro(FileName);
132 vtkGetMacro(WriteToOutputString,
int);
156 void SetCompressorType(
int compressorType);
159 this->SetCompressorType(NONE);
163 this->SetCompressorType(ZLIB);
174 virtual void SetBlockSize(
size_t blockSize);
175 vtkGetMacro(BlockSize,
size_t);
185 vtkGetMacro(DataMode,
int);
186 void SetDataModeToAscii();
187 void SetDataModeToBinary();
188 void SetDataModeToAppended();
200 vtkGetMacro(EncodeAppendedData,
int);
219 virtual const char* GetDefaultFileExtension()=0;
236 vtkGetMacro(NumberOfTimeSteps,
int);
246 void WriteNextTime(
double time);
253 virtual int RequestInformation(
299 # if VTK_SIZEOF_SHORT == 4
300 typedef short Int32IdType;
301 # elif VTK_SIZEOF_INT == 4
302 typedef int Int32IdType;
303 # elif VTK_SIZEOF_LONG == 4
304 typedef long Int32IdType;
306 # error "No native data type can represent a signed 32-bit integer."
331 virtual int WriteInternal();
338 virtual const char* GetDataSetName()=0;
341 virtual int GetDataSetMajorVersion();
342 virtual int GetDataSetMinorVersion();
346 virtual int StartFile();
347 virtual void WriteFileAttributes();
348 virtual int EndFile();
350 void DeleteAFile(
const char*
name);
352 virtual int WritePrimaryElement(ostream &os,
vtkIndent indent);
353 virtual void WritePrimaryElementAttributes(ostream &os,
vtkIndent indent);
354 void StartAppendedData();
355 void EndAppendedData();
364 vtkTypeInt64 ReserveAttributeSpace(
const char* attr,
size_t length=20);
366 vtkTypeInt64 GetAppendedDataOffset();
367 void WriteAppendedDataOffset(vtkTypeInt64 streamPos,
368 vtkTypeInt64 &lastoffset,
370 void ForwardAppendedDataOffset(vtkTypeInt64 streamPos,
373 void ForwardAppendedDataDouble(vtkTypeInt64 streamPos,
377 int WriteScalarAttribute(
const char*
name,
int data);
378 int WriteScalarAttribute(
const char*
name,
float data);
379 int WriteScalarAttribute(
const char*
name,
double data);
380 #ifdef VTK_USE_64BIT_IDS
384 int WriteVectorAttribute(
const char*
name,
int length,
int*
data);
385 int WriteVectorAttribute(
const char*
name,
int length,
float*
data);
386 int WriteVectorAttribute(
const char*
name,
int length,
double*
data);
387 #ifdef VTK_USE_64BIT_IDS
391 int WriteDataModeAttribute(
const char*
name);
392 int WriteWordTypeAttribute(
const char*
name,
int dataType);
393 int WriteStringAttribute(
const char*
name,
const char*
value);
399 const char* alternateName,
int writeNumTuples,
int timestep);
402 const char* alternateName=0,
int writeNumTuples=0);
406 OffsetsManager &offs,
const char* alternateName=0,
int writeNumTuples=0,
412 vtkTypeInt64 &lastoffset);
421 void WriteFieldDataAppendedData(
vtkFieldData* fd,
int timestep,
425 void WritePointDataAppendedData(
vtkPointData* pd,
int timestep,
429 void WriteCellDataAppendedData(
vtkCellData* cd,
int timestep,
447 const char* alternateName=0);
452 int WriteBinaryDataBlock(
unsigned char* in_data,
size_t numWords,
int wordType);
453 void PerformByteSwap(
void*
data,
size_t numWords,
size_t wordSize);
454 int CreateCompressionHeader(
size_t size);
455 int WriteCompressionBlock(
unsigned char*
data,
size_t size);
456 int WriteCompressionHeader();
457 size_t GetWordTypeSize(
int dataType);
458 const char* GetWordTypeName(
int dataType);
459 size_t GetOutputWordTypeSize(
int dataType);
461 char** CreateStringArray(
int numStrings);
462 void DestroyStringArray(
int numStrings,
char** strings);
466 virtual void GetProgressRange(
float range[2]);
467 virtual void SetProgressRange(
const float range[2],
int curStep,
int numSteps);
468 virtual void SetProgressRange(
const float range[2],
int curStep,
const float* fractions);
469 virtual void SetProgressPartial(
float fraction);
470 virtual void UpdateProgressDiscrete(
float progress);
471 float ProgressRange[2];
501 friend class vtkXMLWriterHelper;
505 void operator=(const
vtkXMLWriter&) VTK_DELETE_FUNCTION;
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.
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
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
std::ostringstream * OutStringStream
size_t CompressionBlockNumber
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
Abstract superclass to iterate over elements in an vtkAbstractArray.
represent and manipulate attribute data in a dataset
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void SetCompressorTypeToNone()
Convenience functions to set the compressor to certain known types.
vtkTypeInt64 CompressionHeaderPosition
Wraps a binary output stream with a VTK interface.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
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