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
vtkXMLPDataWriter::FileNameBase
char * FileNameBase
Definition: vtkXMLPDataWriter.h:138
vtkXMLWriter::ProcessRequest
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
vtkXMLPDataWriter::PathName
char * PathName
Definition: vtkXMLPDataWriter.h:137
vtkXMLWriter::WritePrimaryElementAttributes
virtual void WritePrimaryElementAttributes(ostream &os, vtkIndent indent)
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:59
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkXMLWriter.h
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:59
vtkXMLPDataWriter
Write data in a parallel XML format.
Definition: vtkXMLPDataWriter.h:34
vtkXMLPDataWriter::EndPiece
int EndPiece
Definition: vtkXMLPDataWriter.h:132
vtkXMLPDataWriter::Controller
vtkMultiProcessController * Controller
Definition: vtkXMLPDataWriter.h:145
vtkXMLWriter::WriteInternal
virtual int WriteInternal()
vtkXMLPDataWriter::FileNameExtension
char * FileNameExtension
Definition: vtkXMLPDataWriter.h:139
vtkXMLWriter
Superclass for VTK's XML file writers.
Definition: vtkXMLWriter.h:53
vtkMultiProcessController
Multiprocessing communication superclass.
Definition: vtkMultiProcessController.h:82
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkXMLWriter::WriteData
virtual int WriteData()
Definition: vtkXMLWriter.h:335
vtkXMLPDataWriter::WriteSummaryFile
int WriteSummaryFile
Definition: vtkXMLPDataWriter.h:135
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkXMLPDataWriter::ProgressObserver
vtkCallbackCommand * ProgressObserver
Definition: vtkXMLPDataWriter.h:143
vtkXMLWriter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkXMLPDataWriter::GhostLevel
int GhostLevel
Definition: vtkXMLPDataWriter.h:134
vtkCallbackCommand
supports function callbacks
Definition: vtkCallbackCommand.h:50
vtkXMLPDataWriter::NumberOfPieces
int NumberOfPieces
Definition: vtkXMLPDataWriter.h:133
vtkXMLPDataWriter::PieceFileNameExtension
char * PieceFileNameExtension
Definition: vtkXMLPDataWriter.h:140
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtkXMLPDataWriter::StartPiece
int StartPiece
Definition: vtkXMLPDataWriter.h:131