30 #ifndef vtkXMLWriter_h 31 #define vtkXMLWriter_h 34 #include "vtkIOXMLModule.h" 116 vtkSetMacro(ByteOrder,
int);
117 vtkGetMacro(ByteOrder,
int);
118 void SetByteOrderToBigEndian();
119 void SetByteOrderToLittleEndian();
127 virtual void SetHeaderType(
int);
128 vtkGetMacro(HeaderType,
int);
129 void SetHeaderTypeToUInt32();
130 void SetHeaderTypeToUInt64();
138 virtual void SetIdType(
int);
139 vtkGetMacro(IdType,
int);
140 void SetIdTypeToInt32();
141 void SetIdTypeToInt64();
148 vtkSetStringMacro(FileName);
149 vtkGetStringMacro(FileName);
183 void SetCompressorType(
int compressorType);
189 void SetCompressionLevel(
int compressorLevel);
190 vtkGetMacro(CompressionLevel,
int);
200 virtual void SetBlockSize(
size_t blockSize);
201 vtkGetMacro(BlockSize,
size_t);
210 vtkSetMacro(DataMode,
int);
211 vtkGetMacro(DataMode,
int);
212 void SetDataModeToAscii();
213 void SetDataModeToBinary();
214 void SetDataModeToAppended();
245 virtual const char* GetDefaultFileExtension() = 0;
260 vtkGetMacro(NumberOfTimeSteps,
int);
261 vtkSetMacro(NumberOfTimeSteps,
int);
270 void WriteNextTime(
double time);
320 #if VTK_SIZEOF_SHORT == 4 321 typedef short Int32IdType;
322 #elif VTK_SIZEOF_INT == 4 323 typedef int Int32IdType;
324 #elif VTK_SIZEOF_LONG == 4 325 typedef long Int32IdType;
327 #error "No native data type can represent a signed 32-bit integer." 344 int CompressionLevel = 5;
355 virtual int WriteInternal();
362 virtual const char* GetDataSetName() = 0;
365 virtual int GetDataSetMajorVersion();
366 virtual int GetDataSetMinorVersion();
370 virtual int StartFile();
371 virtual void WriteFileAttributes();
372 virtual int EndFile();
374 void DeleteAFile(
const char*
name);
376 virtual int WritePrimaryElement(ostream& os,
vtkIndent indent);
377 virtual void WritePrimaryElementAttributes(ostream& os,
vtkIndent indent);
378 void StartAppendedData();
379 void EndAppendedData();
388 vtkTypeInt64 ReserveAttributeSpace(
const char* attr,
size_t length = 20);
390 vtkTypeInt64 GetAppendedDataOffset();
391 void WriteAppendedDataOffset(
392 vtkTypeInt64 streamPos, vtkTypeInt64& lastoffset,
const char* attr =
nullptr);
393 void ForwardAppendedDataOffset(
394 vtkTypeInt64 streamPos, vtkTypeInt64
offset,
const char* attr =
nullptr);
395 void ForwardAppendedDataDouble(vtkTypeInt64 streamPos,
double value,
const char* attr);
397 int WriteScalarAttribute(
const char*
name,
int data);
398 int WriteScalarAttribute(
const char*
name,
float data);
399 int WriteScalarAttribute(
const char*
name,
double data);
400 #ifdef VTK_USE_64BIT_IDS 404 int WriteVectorAttribute(
const char*
name,
int length,
int*
data);
405 int WriteVectorAttribute(
const char*
name,
int length,
float*
data);
406 int WriteVectorAttribute(
const char*
name,
int length,
double*
data);
407 #ifdef VTK_USE_64BIT_IDS 411 int WriteDataModeAttribute(
const char*
name);
412 int WriteWordTypeAttribute(
const char*
name,
int dataType);
413 int WriteStringAttribute(
const char*
name,
const char*
value);
419 int writeNumTuples,
int timestep);
420 virtual void WriteArrayFooter(
423 const char* alternateName =
nullptr,
int writeNumTuples = 0);
427 const char* alternateName =
nullptr,
int writeNumTuples = 0,
int timestep = 0);
431 void WriteArrayAppendedData(
vtkAbstractArray* a, vtkTypeInt64 pos, vtkTypeInt64& lastoffset);
448 void WriteCoordinatesInline(
461 int WriteBinaryDataBlock(
unsigned char* in_data,
size_t numWords,
int wordType);
462 void PerformByteSwap(
void*
data,
size_t numWords,
size_t wordSize);
463 int CreateCompressionHeader(
size_t size);
464 int WriteCompressionBlock(
unsigned char*
data,
size_t size);
465 int WriteCompressionHeader();
466 size_t GetWordTypeSize(
int dataType);
467 const char* GetWordTypeName(
int dataType);
468 size_t GetOutputWordTypeSize(
int dataType);
470 char** CreateStringArray(
int numStrings);
471 void DestroyStringArray(
int numStrings,
char** strings);
475 virtual void GetProgressRange(
float range[2]);
476 virtual void SetProgressRange(
const float range[2],
int curStep,
int numSteps);
477 virtual void SetProgressRange(
const float range[2],
int curStep,
const float* fractions);
478 virtual void SetProgressPartial(
float fraction);
479 virtual void UpdateProgressDiscrete(
float progress);
480 float ProgressRange[2];
514 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
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
virtual vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
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