VTK: IO/ParallelXML/vtkXMLPDataObjectWriter.h Source File

| VTK 9.3.1

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
22 VTK_ABI_NAMESPACE_BEGIN
23 class vtkCallbackCommand;
24 class vtkMultiProcessController;
25
26 class VTKIOPARALLELXML_EXPORT vtkXMLPDataObjectWriter : public vtkXMLWriter
27 {
28 public:
29 vtkTypeMacro(vtkXMLPDataObjectWriter, vtkXMLWriter);
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
84 virtual void SetController(vtkMultiProcessController*);
85 vtkGetObjectMacro(Controller, vtkMultiProcessController);
87
92 vtkTypeBool ProcessRequest(vtkInformation* request, vtkInformationVector** inputVector,
93 vtkInformationVector* outputVector) override;
94
95 protected:
96 vtkXMLPDataObjectWriter();
97 ~vtkXMLPDataObjectWriter() override;
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);
149 void SplitFileName();
151
155 static void ProgressCallbackFunction(vtkObject*, unsigned long, void*, void*);
156
161 vtkGetMacro(ContinuingExecution, bool);
162
166 vtkGetMacro(CurrentPiece, int);
167
171 virtual void ProgressCallback(vtkAlgorithm* w);
172
176 void DeleteFiles();
177
181 vtkCallbackCommand* InternalProgressObserver;
182
183 vtkMultiProcessController* Controller;
184
185 int StartPiece;
186 int EndPiece;
187 int NumberOfPieces;
188 int GhostLevel;
189 int WriteSummaryFile;
190 bool UseSubdirectory;
191
192 char* PathName;
193 char* FileNameBase;
194 char* FileNameExtension;
195 char* PieceFileNameExtension;
196
200 unsigned char* PieceWrittenFlags;
201
205 virtual void SetupPieceFileNameExtension();
206
207 private:
208 vtkXMLPDataObjectWriter(const vtkXMLPDataObjectWriter&) = delete;
209 void operator=(const vtkXMLPDataObjectWriter&) = delete;
210
214 int CurrentPiece;
215
220 bool ContinuingExecution;
221 };
222
223 VTK_ABI_NAMESPACE_END
224 #endif
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:61
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:49
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkMultiProcessController
Multiprocessing communication superclass.
Definition: vtkMultiProcessController.h:72
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkXMLPDataObjectWriter
Write data in a parallel XML format.
Definition: vtkXMLPDataObjectWriter.h:27
vtkXMLPDataObjectWriter::WriteSummaryFile
int WriteSummaryFile
Definition: vtkXMLPDataObjectWriter.h:189
vtkXMLPDataObjectWriter::PieceWrittenFlags
unsigned char * PieceWrittenFlags
Flags used to keep track of which pieces were written out.
Definition: vtkXMLPDataObjectWriter.h:200
vtkXMLPDataObjectWriter::vtkXMLPDataObjectWriter
vtkXMLPDataObjectWriter()
vtkXMLPDataObjectWriter::FileNameExtension
char * FileNameExtension
Definition: vtkXMLPDataObjectWriter.h:194
vtkXMLPDataObjectWriter::ProcessRequest
vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Overridden to handle passing the CONTINUE_EXECUTING() flags to the executive.
vtkXMLPDataObjectWriter::ProgressCallback
virtual void ProgressCallback(vtkAlgorithm *w)
Progress callback from internal writer.
vtkXMLPDataObjectWriter::NumberOfPieces
int NumberOfPieces
Definition: vtkXMLPDataObjectWriter.h:187
vtkXMLPDataObjectWriter::WritePieceInternal
virtual int WritePieceInternal()=0
Method called by WriteInternal().
vtkXMLPDataObjectWriter::ProgressCallbackFunction
static void ProgressCallbackFunction(vtkObject *, unsigned long, void *, void *)
Callback registered with the InternalProgressObserver.
vtkXMLPDataObjectWriter::UseSubdirectory
bool UseSubdirectory
Definition: vtkXMLPDataObjectWriter.h:190
vtkXMLPDataObjectWriter::StartPiece
int StartPiece
Definition: vtkXMLPDataObjectWriter.h:185
vtkXMLPDataObjectWriter::WriteInternal
int WriteInternal() override
Override writing method from superclass.
vtkXMLPDataObjectWriter::InternalProgressObserver
vtkCallbackCommand * InternalProgressObserver
The observer to report progress from the internal writer.
Definition: vtkXMLPDataObjectWriter.h:181
vtkXMLPDataObjectWriter::WritePData
virtual void WritePData(vtkIndent indent)=0
Write Data associated with the input dataset.
vtkXMLPDataObjectWriter::Controller
vtkMultiProcessController * Controller
Definition: vtkXMLPDataObjectWriter.h:183
vtkXMLPDataObjectWriter::WriteData
int WriteData() override
Write data from the input dataset.
vtkXMLPDataObjectWriter::CreatePieceFileName
char * CreatePieceFileName(int index, const char *path=nullptr)
Methods for creating a filename for each piece in the dataset.
vtkXMLPDataObjectWriter::DeleteFiles
void DeleteFiles()
Method used to delete all written files.
vtkXMLPDataObjectWriter::PieceFileNameExtension
char * PieceFileNameExtension
Definition: vtkXMLPDataObjectWriter.h:195
vtkXMLPDataObjectWriter::GhostLevel
int GhostLevel
Definition: vtkXMLPDataObjectWriter.h:188
vtkXMLPDataObjectWriter::EndPiece
int EndPiece
Definition: vtkXMLPDataObjectWriter.h:186
vtkXMLPDataObjectWriter::SplitFileName
void SplitFileName()
Methods for creating a filename for each piece in the dataset.
vtkXMLPDataObjectWriter::SetController
virtual void SetController(vtkMultiProcessController *)
Controller used to communicate data type of blocks.
vtkXMLPDataObjectWriter::SetWriteSummaryFile
virtual void SetWriteSummaryFile(int flag)
Get/Set whether the writer should write the summary file that refers to all of the pieces' individual...
vtkXMLPDataObjectWriter::~vtkXMLPDataObjectWriter
~vtkXMLPDataObjectWriter() override
vtkXMLPDataObjectWriter::RequestUpdateExtent
virtual int RequestUpdateExtent(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Overridden to make appropriate piece request from upstream.
vtkXMLPDataObjectWriter::PathName
char * PathName
Definition: vtkXMLPDataObjectWriter.h:192
vtkXMLPDataObjectWriter::FileNameBase
char * FileNameBase
Definition: vtkXMLPDataObjectWriter.h:193
vtkXMLPDataObjectWriter::WritePPieceAttributes
virtual void WritePPieceAttributes(int index)
Write the attributes of the piece at the given index.
vtkXMLPDataObjectWriter::SetupPieceFileNameExtension
virtual void SetupPieceFileNameExtension()
Initializes PieceFileNameExtension.
vtkXMLPDataObjectWriter::PrepareSummaryFile
virtual void PrepareSummaryFile()
Collect information between ranks before writing the summary file.
vtkXMLPDataObjectWriter::WritePiece
virtual int WritePiece(int index)=0
Write a piece of the dataset on disk.
vtkXMLPDataObjectWriter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkXMLWriter
Superclass for VTK's XML file writers.
Definition: vtkXMLWriter.h:54
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkXMLWriter.h