VTK
vtkXMLPDataWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkXMLPDataWriter.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 =========================================================================*/
25 #ifndef vtkXMLPDataWriter_h
26 #define vtkXMLPDataWriter_h
27 
28 #include "vtkIOParallelXMLModule.h" // For export macro
29 #include "vtkXMLWriter.h"
30 
31 class vtkCallbackCommand;
33 
34 class VTKIOPARALLELXML_EXPORT vtkXMLPDataWriter : public vtkXMLWriter
35 {
36 public:
38  void PrintSelf(ostream& os, vtkIndent indent);
39 
41 
44  vtkSetMacro(NumberOfPieces, int);
45  vtkGetMacro(NumberOfPieces, int);
47 
49 
52  vtkSetMacro(StartPiece, int);
53  vtkGetMacro(StartPiece, int);
54  vtkSetMacro(EndPiece, int);
55  vtkGetMacro(EndPiece, int);
57 
59 
62  vtkSetMacro(GhostLevel, int);
63  vtkGetMacro(GhostLevel, int);
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 
88 
93  virtual int ProcessRequest(vtkInformation* request,
94  vtkInformationVector** inputVector, vtkInformationVector* outputVector);
95 
96 protected:
99 
103  virtual int RequestUpdateExtent(vtkInformation *request,
104  vtkInformationVector **inputVector, vtkInformationVector *outputVector);
105 
106  // Override writing method from superclass.
107  virtual int WriteInternal();
108 
109  // Subclasses can override this method to collect information between ranks
110  // before writing the summary file. This method is called on all ranks while
111  // summary file is only written on 1 rank (rank 0).
112  virtual void PrepareSummaryFile();
113 
114  virtual vtkXMLWriter* CreatePieceWriter(int index)=0;
115 
116  virtual void WritePrimaryElementAttributes(ostream &os, vtkIndent indent);
117  int WriteData();
118  virtual void WritePData(vtkIndent indent);
119  virtual void WritePPieceAttributes(int index);
120 
121  char* CreatePieceFileName(int index, const char* path=0);
122  void SplitFileName();
123  virtual int WritePiece(int index);
124 
125  // Callback registered with the ProgressObserver.
126  static void ProgressCallbackFunction(vtkObject*, unsigned long, void*,
127  void*);
128  // Progress callback from internal writer.
129  virtual void ProgressCallback(vtkAlgorithm* w);
130 
132  int EndPiece;
136 
137  char* PathName;
141 
142  // The observer to report progress from the internal writer.
144 
146 
151  vtkGetMacro(ContinuingExecution, bool);
152 
153 private:
154  vtkXMLPDataWriter(const vtkXMLPDataWriter&) VTK_DELETE_FUNCTION;
155  void operator=(const vtkXMLPDataWriter&) VTK_DELETE_FUNCTION;
156 
160  void DeleteFiles();
161 
165  void SetupPieceFileNameExtension();
166 
167  // Indicates the piece currently being written.
168  int CurrentPiece;
169 
170  // Set in WriteInternal() to request continued execution from the executive to
171  // write more pieces.
172  bool ContinuingExecution;
173 
174  // Flags used to keep track of which pieces were written out.
175  unsigned char *PieceWrittenFlags;
176 };
177 
178 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:59
Store vtkAlgorithm input/output information.
vtkMultiProcessController * Controller
virtual int WriteData()
Definition: vtkXMLWriter.h:335
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:53
a simple class to control print indentation
Definition: vtkIndent.h:39
Write data in a parallel XML format.
virtual int WriteInternal()
vtkCallbackCommand * ProgressObserver
virtual void WritePrimaryElementAttributes(ostream &os, vtkIndent indent)
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
Store zero or more vtkInformation instances.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
Multiprocessing communication superclass.