33 #ifndef vtkXMLWriter_h
34 #define vtkXMLWriter_h
36 #include "vtkIOXMLModule.h"
90 vtkGetMacro(NumberOfTimeSteps,
int);
91 vtkSetMacro(NumberOfTimeSteps,
int);
100 void WriteNextTime(
double time);
124 #if VTK_SIZEOF_SHORT == 4
125 typedef short Int32IdType;
126 #elif VTK_SIZEOF_INT == 4
127 typedef int Int32IdType;
128 #elif VTK_SIZEOF_LONG == 4
129 typedef long Int32IdType;
131 #error "No native data type can represent a signed 32-bit integer."
154 virtual int WriteInternal();
161 virtual const char* GetDataSetName() = 0;
165 virtual int StartFile();
166 virtual void WriteFileAttributes();
167 virtual int EndFile();
169 void DeleteAFile(
const char*
name);
171 virtual int WritePrimaryElement(ostream& os,
vtkIndent indent);
172 virtual void WritePrimaryElementAttributes(ostream& os,
vtkIndent indent);
173 void StartAppendedData();
174 void EndAppendedData();
183 vtkTypeInt64 ReserveAttributeSpace(
const char* attr,
size_t length = 20);
185 vtkTypeInt64 GetAppendedDataOffset();
186 void WriteAppendedDataOffset(
187 vtkTypeInt64 streamPos, vtkTypeInt64& lastoffset,
const char* attr =
nullptr);
188 void ForwardAppendedDataOffset(
189 vtkTypeInt64 streamPos, vtkTypeInt64
offset,
const char* attr =
nullptr);
190 void ForwardAppendedDataDouble(vtkTypeInt64 streamPos,
double value,
const char* attr);
192 int WriteScalarAttribute(
const char*
name,
int data);
193 int WriteScalarAttribute(
const char*
name,
float data);
194 int WriteScalarAttribute(
const char*
name,
double data);
195 #ifdef VTK_USE_64BIT_IDS
199 int WriteVectorAttribute(
const char*
name,
int length,
int*
data);
200 int WriteVectorAttribute(
const char*
name,
int length,
float*
data);
201 int WriteVectorAttribute(
const char*
name,
int length,
double*
data);
202 #ifdef VTK_USE_64BIT_IDS
206 int WriteDataModeAttribute(
const char*
name);
207 int WriteWordTypeAttribute(
const char*
name,
int dataType);
208 int WriteStringAttribute(
const char*
name,
const char*
value);
214 int writeNumTuples,
int timestep);
215 virtual void WriteArrayFooter(
218 const char* alternateName =
nullptr,
int writeNumTuples = 0);
222 const char* alternateName =
nullptr,
int writeNumTuples = 0,
int timestep = 0);
226 void WriteArrayAppendedData(
vtkAbstractArray* a, vtkTypeInt64 pos, vtkTypeInt64& lastoffset);
243 void WriteCoordinatesInline(
256 int WriteBinaryDataBlock(
unsigned char* in_data,
size_t numWords,
int wordType);
257 void PerformByteSwap(
void*
data,
size_t numWords,
size_t wordSize);
258 int CreateCompressionHeader(
size_t size);
259 int WriteCompressionBlock(
unsigned char*
data,
size_t size);
260 int WriteCompressionHeader();
261 size_t GetWordTypeSize(
int dataType);
262 const char* GetWordTypeName(
int dataType);
263 size_t GetOutputWordTypeSize(
int dataType);
265 char** CreateStringArray(
int numStrings);
266 void DestroyStringArray(
int numStrings,
char** strings);
270 virtual void GetProgressRange(
float range[2]);
271 virtual void SetProgressRange(
const float range[2],
int curStep,
int numSteps);
272 virtual void SetProgressRange(
const float range[2],
int curStep,
const float* fractions);
273 virtual void SetProgressPartial(
float fraction);
274 virtual void UpdateProgressDiscrete(
float progress);
275 float ProgressRange[2];
301 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
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Helper class due to PIMPL excess.
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...
vtkTypeInt64 AppendedDataPosition
Superclass for VTK's XML file writers.
a simple class to control print indentation
Abstract base class for VTK-XML writers.
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
vtkTypeInt64 CompressionHeaderPosition
Wraps a binary output stream with a VTK interface.
unsigned char * ByteSwapBuffer
general representation of visualization data
represent and manipulate 3D points
vtkXMLDataHeader * CompressionHeader
int UserContinueExecuting
OffsetsManagerGroup * FieldDataOM
represent and manipulate fields of data
Int32IdType * Int32IdTypeBuffer