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 "vtkPVVTKExtensionsIOCoreModule.h" //needed for exports
27 #include "vtkXMLWriter.h"
28 
29 class vtkCallbackCommand;
30 class vtkXMLPVDWriterInternals;
31 
33 {
34 public:
35  static vtkXMLPVDWriter* New();
36  vtkTypeMacro(vtkXMLPVDWriter, vtkXMLWriter);
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
42  const char* GetDefaultFileExtension() override;
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 
71 
75  vtkSetMacro(WriteAllTimeSteps, int);
76  vtkGetMacro(WriteAllTimeSteps, int);
77  vtkBooleanMacro(WriteAllTimeSteps, int);
79 
83  void AddInputData(vtkDataObject*);
84 
86 
90  vtkGetMacro(WriteCollectionFile, int);
91  virtual void SetWriteCollectionFile(int flag);
93 
94  // See the vtkAlgorithm for a description of what these do
96 
97 protected:
99  ~vtkXMLPVDWriter() override;
100 
101  // see algorithm for more info
102  int FillInputPortInformation(int port, vtkInformation* info) override;
103 
104  // add in request update extent to set time step information
105  virtual int RequestUpdateExtent(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
106 
107  // Replace vtkXMLWriter's writing driver method.
109  int WriteData() override;
110  const char* GetDataSetName() override;
111 
112  // Methods to create the set of writers matching the set of inputs.
113  void CreateWriters();
114  vtkXMLWriter* GetWriter(int index);
115 
116  // Methods to help construct internal file names.
117  void SplitFileName();
118  const char* GetFilePrefix();
119  const char* GetFilePath();
120 
121  // Methods to construct the list of entries for the collection file.
122  void AppendEntry(const char* entry);
123  void DeleteAllEntries();
124 
125  // Write the collection file if it is requested.
126  int WriteCollectionFileIfRequested();
127 
128  // Make a directory.
129  void MakeDirectory(const char* name);
130 
131  // Remove a directory.
132  void RemoveADirectory(const char* name);
133 
134  // Internal implementation details.
135  vtkXMLPVDWriterInternals* Internal;
136 
137  // The piece number to write.
138  int Piece;
139 
140  // The number of pieces into which the inputs are split.
142 
143  // The number of ghost levels to write for unstructured data.
145 
146  // Whether to write the collection file on this node.
149 
150  // Callback registered with the ProgressObserver.
151  static void ProgressCallbackFunction(vtkObject*, unsigned long, void*, void*);
152  // Progress callback from internal writer.
153  virtual void ProgressCallback(vtkAlgorithm* w);
154 
155  // The observer to report progress from the internal writer.
157 
158  // Garbage collection support.
159  void ReportReferences(vtkGarbageCollector*) override;
160 
161  // The current time step for time series inputs.
163 
164  // Option to write all time steps (ON) or just the current one (OFF)
166 
167 private:
168  vtkXMLPVDWriter(const vtkXMLPVDWriter&) = delete;
169  void operator=(const vtkXMLPVDWriter&) = delete;
170 };
171 
172 #endif
virtual const char * GetDataSetName()=0
vtkCallbackCommand * ProgressObserver
#define VTKPVVTKEXTENSIONSIOCORE_EXPORT
gio::GenericIOWriter * GetWriter(MPI_Comm comm, const std::string &fileName)
This method constructs and returns the underlying GenericIO writer.
vtkXMLPVDWriterInternals * Internal
int WriteCollectionFileInitialized
virtual int WriteData()
void PrintSelf(ostream &os, vtkIndent indent)
virtual const char * GetDefaultFileExtension()=0
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
virtual int FillInputPortInformation(int port, vtkInformation *info)
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
void ReportReferences(vtkGarbageCollector *) VTK_OVERRIDE
static vtkAlgorithm * New()
Data writer for ParaView.
void operator=(const vtkObjectBase &)