VTK  9.3.20240420
vtkXMLPDataObjectWriter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
16#ifndef vtkXMLPDataObjectWriter_h
17#define vtkXMLPDataObjectWriter_h
18
19#include "vtkIOParallelXMLModule.h" // For export macro
20#include "vtkXMLWriter.h"
21
22VTK_ABI_NAMESPACE_BEGIN
25
26class VTKIOPARALLELXML_EXPORT vtkXMLPDataObjectWriter : public vtkXMLWriter
27{
28public:
30 void PrintSelf(ostream& os, vtkIndent indent) override;
31
33
36 vtkSetMacro(NumberOfPieces, int);
37 vtkGetMacro(NumberOfPieces, int);
39
41
44 vtkSetMacro(StartPiece, int);
45 vtkGetMacro(StartPiece, int);
46 vtkSetMacro(EndPiece, int);
47 vtkGetMacro(EndPiece, int);
49
51
54 vtkSetMacro(GhostLevel, int);
55 vtkGetMacro(GhostLevel, int);
57
59
62 vtkSetMacro(UseSubdirectory, bool);
63 vtkGetMacro(UseSubdirectory, bool);
65
67
73 virtual void SetWriteSummaryFile(int flag);
74 vtkGetMacro(WriteSummaryFile, int);
75 vtkBooleanMacro(WriteSummaryFile, int);
77
79
85 vtkGetObjectMacro(Controller, vtkMultiProcessController);
87
93 vtkInformationVector* outputVector) override;
94
95protected:
98
102 int WriteInternal() override;
103
107 int WriteData() override;
108
112 virtual void WritePData(vtkIndent indent) = 0;
113
118 virtual int WritePiece(int index) = 0;
119
124 virtual int WritePieceInternal() = 0;
125
129 virtual int RequestUpdateExtent(vtkInformation* request, vtkInformationVector** inputVector,
130 vtkInformationVector* outputVector);
131
137 virtual void PrepareSummaryFile();
138
142 virtual void WritePPieceAttributes(int index);
143
145
148 char* CreatePieceFileName(int index, const char* path = nullptr);
151
155 static void ProgressCallbackFunction(vtkObject*, unsigned long, void*, void*);
156
161 vtkGetMacro(ContinuingExecution, bool);
162
166 vtkGetMacro(CurrentPiece, int);
167
172
177
182
184
191
192 char* PathName;
196
200 unsigned char* PieceWrittenFlags;
201
206
207private:
209 void operator=(const vtkXMLPDataObjectWriter&) = delete;
210
214 int CurrentPiece;
215
220 bool ContinuingExecution;
221};
222
223VTK_ABI_NAMESPACE_END
224#endif
Superclass for all sources, filters, and sinks in VTK.
supports function callbacks
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Multiprocessing communication superclass.
abstract base class for most VTK objects
Definition vtkObject.h:162
Write data in a parallel XML format.
unsigned char * PieceWrittenFlags
Flags used to keep track of which pieces were written out.
vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Overridden to handle passing the CONTINUE_EXECUTING() flags to the executive.
virtual void ProgressCallback(vtkAlgorithm *w)
Progress callback from internal writer.
virtual int WritePieceInternal()=0
Method called by WriteInternal().
static void ProgressCallbackFunction(vtkObject *, unsigned long, void *, void *)
Callback registered with the InternalProgressObserver.
int WriteInternal() override
Override writing method from superclass.
vtkCallbackCommand * InternalProgressObserver
The observer to report progress from the internal writer.
virtual void WritePData(vtkIndent indent)=0
Write Data associated with the input dataset.
vtkMultiProcessController * Controller
int WriteData() override
Write data from the input dataset.
void DeleteFiles()
Method used to delete all written files.
char * CreatePieceFileName(int index, const char *path=nullptr)
Methods for creating a filename for each piece in the dataset.
void SplitFileName()
Methods for creating a filename for each piece in the dataset.
virtual void SetController(vtkMultiProcessController *)
Controller used to communicate data type of blocks.
virtual void SetWriteSummaryFile(int flag)
Get/Set whether the writer should write the summary file that refers to all of the pieces' individual...
~vtkXMLPDataObjectWriter() override
virtual int RequestUpdateExtent(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Overridden to make appropriate piece request from upstream.
virtual void WritePPieceAttributes(int index)
Write the attributes of the piece at the given index.
virtual void SetupPieceFileNameExtension()
Initializes PieceFileNameExtension.
virtual void PrepareSummaryFile()
Collect information between ranks before writing the summary file.
virtual int WritePiece(int index)=0
Write a piece of the dataset on disk.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Superclass for VTK's XML file writers.
int vtkTypeBool
Definition vtkABI.h:64