ParaView
vtkXMLPVDWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkXMLPVDWriter.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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 =========================================================================*/
23 #ifndef vtkXMLPVDWriter_h
24 #define vtkXMLPVDWriter_h
25 
26 #include "vtkPVVTKExtensionsDefaultModule.h" //needed for exports
27 #include "vtkXMLWriter.h"
28 
29 class vtkCallbackCommand;
30 class vtkXMLPVDWriterInternals;
31 
32 class VTKPVVTKEXTENSIONSDEFAULT_EXPORT vtkXMLPVDWriter : public vtkXMLWriter
33 {
34 public:
35  static vtkXMLPVDWriter* New();
36  vtkTypeMacro(vtkXMLPVDWriter, vtkXMLWriter);
37  void PrintSelf(ostream& os, vtkIndent indent);
38 
42  virtual const char* GetDefaultFileExtension();
43 
45 
49  vtkGetMacro(Piece, int);
50  vtkSetMacro(Piece, int);
52 
54 
57  vtkGetMacro(NumberOfPieces, int);
58  vtkSetMacro(NumberOfPieces, int);
60 
62 
66  vtkGetMacro(GhostLevel, int);
67  vtkSetMacro(GhostLevel, int);
69 
73  void AddInputData(vtkDataObject*);
74 
76 
80  vtkGetMacro(WriteCollectionFile, int);
81  virtual void SetWriteCollectionFile(int flag);
83 
84  // See the vtkAlgorithm for a desciption of what these do
85  int ProcessRequest(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
86 
87 protected:
89  ~vtkXMLPVDWriter();
90 
91  // see algorithm for more info
92  virtual int FillInputPortInformation(int port, vtkInformation* info);
93 
94  // Replace vtkXMLWriter's writing driver method.
95  int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
96  virtual int WriteData();
97  virtual const char* GetDataSetName();
98 
99  // Methods to create the set of writers matching the set of inputs.
100  void CreateWriters();
101  vtkXMLWriter* GetWriter(int index);
102 
103  // Methods to help construct internal file names.
104  void SplitFileName();
105  const char* GetFilePrefix();
106  const char* GetFilePath();
107 
108  // Methods to construct the list of entries for the collection file.
109  void AppendEntry(const char* entry);
110  void DeleteAllEntries();
111 
112  // Write the collection file if it is requested.
113  int WriteCollectionFileIfRequested();
114 
115  // Make a directory.
116  void MakeDirectory(const char* name);
117 
118  // Remove a directory.
119  void RemoveADirectory(const char* name);
120 
121  // Internal implementation details.
122  vtkXMLPVDWriterInternals* Internal;
123 
124  // The piece number to write.
125  int Piece;
126 
127  // The number of pieces into which the inputs are split.
129 
130  // The number of ghost levels to write for unstructured data.
132 
133  // Whether to write the collection file on this node.
136 
137  // Callback registered with the ProgressObserver.
138  static void ProgressCallbackFunction(vtkObject*, unsigned long, void*, void*);
139  // Progress callback from internal writer.
140  virtual void ProgressCallback(vtkAlgorithm* w);
141 
142  // The observer to report progress from the internal writer.
143  vtkCallbackCommand* ProgressObserver;
144 
145  // Garbage collection support.
146  virtual void ReportReferences(vtkGarbageCollector*);
147 
148 private:
149  vtkXMLPVDWriter(const vtkXMLPVDWriter&) VTK_DELETE_FUNCTION;
150  void operator=(const vtkXMLPVDWriter&) VTK_DELETE_FUNCTION;
151 };
152 
153 #endif
vtkCallbackCommand * ProgressObserver
gio::GenericIOWriter * GetWriter(MPI_Comm comm, const std::string &fileName)
This method constructs and returns the underlying GenericIO writer.
vtkXMLPVDWriterInternals * Internal
int WriteCollectionFileInitialized
Data writer for ParaView.