VTK  9.6.20260620
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
44
45#ifndef vtkXMLPDataObjectWriter_h
46#define vtkXMLPDataObjectWriter_h
47
48#include "vtkIOParallelXMLModule.h" // For export macro
49#include "vtkXMLWriter.h"
50
51VTK_ABI_NAMESPACE_BEGIN
54
55class VTKIOPARALLELXML_EXPORT vtkXMLPDataObjectWriter : public vtkXMLWriter
56{
57public:
59 void PrintSelf(ostream& os, vtkIndent indent) override;
60
62
67 vtkSetMacro(NumberOfPieces, int);
68 vtkGetMacro(NumberOfPieces, int);
70
72
78 vtkSetMacro(StartPiece, int);
79 vtkGetMacro(StartPiece, int);
80 vtkSetMacro(EndPiece, int);
81 vtkGetMacro(EndPiece, int);
83
85
88 vtkSetMacro(GhostLevel, int);
89 vtkGetMacro(GhostLevel, int);
91
93
96 vtkSetMacro(UseSubdirectory, bool);
97 vtkGetMacro(UseSubdirectory, bool);
99
101
107 virtual void SetWriteSummaryFile(int flag);
108 vtkGetMacro(WriteSummaryFile, int);
109 vtkBooleanMacro(WriteSummaryFile, int);
111
113
126
132 vtkInformationVector* outputVector) override;
133
134protected:
137
141 int WriteInternal() override;
142
146 int WriteData() override;
147
151 virtual void WritePData(vtkIndent indent) = 0;
152
157 virtual int WritePiece(int index) = 0;
158
163 virtual int WritePieceInternal() = 0;
164
168 virtual int RequestUpdateExtent(vtkInformation* request, vtkInformationVector** inputVector,
169 vtkInformationVector* outputVector);
170
176 virtual void PrepareSummaryFile();
177
181 virtual void WritePPieceAttributes(int index);
182
184
187 char* CreatePieceFileName(int index, const char* path = nullptr);
190
194 static void ProgressCallbackFunction(vtkObject*, unsigned long, void*, void*);
195
200 vtkGetMacro(ContinuingExecution, bool);
201
205 vtkGetMacro(CurrentPiece, int);
206
211
216
221
223
230
231 char* PathName;
235
239 unsigned char* PieceWrittenFlags;
240
245
246private:
248 void operator=(const vtkXMLPDataObjectWriter&) = delete;
249
253 int CurrentPiece;
254
259 bool ContinuingExecution;
260};
261
262VTK_ABI_NAMESPACE_END
263#endif
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
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 *)
Set/Get the controller used to coordinate piece assignment, exchange metadata across ranks,...
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.
int vtkTypeBool
Definition vtkABI.h:64