VTK
vtkXMLPDataObjectWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkXMLPDataObjectWriter.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
28 #ifndef vtkXMLPDataObjectWriter_h
29 #define vtkXMLPDataObjectWriter_h
30 
31 #include "vtkIOParallelXMLModule.h" // For export macro
32 #include "vtkXMLWriter.h"
33 
34 class vtkCallbackCommand;
36 
37 class VTKIOPARALLELXML_EXPORT vtkXMLPDataObjectWriter : public vtkXMLWriter
38 {
39 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
44 
47  vtkSetMacro(NumberOfPieces, int);
48  vtkGetMacro(NumberOfPieces, int);
50 
52 
55  vtkSetMacro(StartPiece, int);
56  vtkGetMacro(StartPiece, int);
57  vtkSetMacro(EndPiece, int);
58  vtkGetMacro(EndPiece, int);
60 
62 
65  vtkSetMacro(GhostLevel, int);
66  vtkGetMacro(GhostLevel, int);
68 
70 
73  vtkSetMacro(UseSubdirectory, bool);
74  vtkGetMacro(UseSubdirectory, bool);
76 
78 
84  virtual void SetWriteSummaryFile(int flag);
85  vtkGetMacro(WriteSummaryFile, int);
86  vtkBooleanMacro(WriteSummaryFile, int);
88 
90 
95  virtual void SetController(vtkMultiProcessController*);
96  vtkGetObjectMacro(Controller, vtkMultiProcessController);
98 
103  int ProcessRequest(vtkInformation* request, vtkInformationVector** inputVector,
104  vtkInformationVector* outputVector) override;
105 
106 protected:
108  ~vtkXMLPDataObjectWriter() override;
109 
113  int WriteInternal() override;
114 
118  int WriteData() override;
119 
123  virtual void WritePData(vtkIndent indent) = 0;
124 
129  virtual int WritePiece(int index) = 0;
130 
135  virtual int WritePieceInternal() = 0;
136 
140  virtual int RequestUpdateExtent(vtkInformation* request, vtkInformationVector** inputVector,
141  vtkInformationVector* outputVector);
142 
148  virtual void PrepareSummaryFile();
149 
153  virtual void WritePPieceAttributes(int index);
154 
156 
159  char* CreatePieceFileName(int index, const char* path = nullptr);
160  void SplitFileName();
162 
166  static void ProgressCallbackFunction(vtkObject*, unsigned long, void*, void*);
167 
172  vtkGetMacro(ContinuingExecution, bool);
173 
177  vtkGetMacro(CurrentPiece, int);
178 
182  virtual void ProgressCallback(vtkAlgorithm* w);
183 
187  void DeleteFiles();
188 
193 
195 
197  int EndPiece;
202 
203  char* PathName;
207 
211  unsigned char* PieceWrittenFlags;
212 
216  virtual void SetupPieceFileNameExtension();
217 
218 private:
220  void operator=(const vtkXMLPDataObjectWriter&) = delete;
221 
225  int CurrentPiece;
226 
231  bool ContinuingExecution;
232 };
233 
234 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:59
Store vtkAlgorithm input/output information.
int ProcessRequest(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Write data in a parallel XML format.
virtual int WriteData()
Definition: vtkXMLWriter.h:360
supports function callbacks
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:59
Superclass for VTK's XML file writers.
Definition: vtkXMLWriter.h:62
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual int WriteInternal()
vtkMultiProcessController * Controller
unsigned char * PieceWrittenFlags
Flags used to keep track of which pieces were written out.
vtkCallbackCommand * InternalProgressObserver
The observer to report progress from the internal writer.
Store zero or more vtkInformation instances.
Multiprocessing communication superclass.