vtkXMLPVDWriter.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
11 #ifndef vtkXMLPVDWriter_h
12 #define vtkXMLPVDWriter_h
13 
14 #include "vtkPVVTKExtensionsIOCoreModule.h" //needed for exports
15 #include "vtkXMLWriter.h"
16 
17 class vtkCallbackCommand;
18 class vtkXMLPVDWriterInternals;
19 
21 {
22 public:
23  static vtkXMLPVDWriter* New();
24  vtkTypeMacro(vtkXMLPVDWriter, vtkXMLWriter);
25  void PrintSelf(ostream& os, vtkIndent indent) override;
26 
30  const char* GetDefaultFileExtension() override;
31 
33 
37  vtkGetMacro(Piece, int);
38  vtkSetMacro(Piece, int);
40 
42 
45  vtkGetMacro(NumberOfPieces, int);
46  vtkSetMacro(NumberOfPieces, int);
48 
50 
54  vtkGetMacro(GhostLevel, int);
55  vtkSetMacro(GhostLevel, int);
57 
59 
63  vtkSetMacro(WriteAllTimeSteps, int);
64  vtkGetMacro(WriteAllTimeSteps, int);
65  vtkBooleanMacro(WriteAllTimeSteps, int);
67 
71  void AddInputData(vtkDataObject*);
72 
74 
78  vtkGetMacro(WriteCollectionFile, int);
79  virtual void SetWriteCollectionFile(int flag);
81 
82  // See the vtkAlgorithm for a description of what these do
84 
85 protected:
87  ~vtkXMLPVDWriter() override;
88 
89  // see algorithm for more info
90  int FillInputPortInformation(int port, vtkInformation* info) override;
91 
92  // add in request update extent to set time step information
93  virtual int RequestUpdateExtent(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
94 
95  // Replace vtkXMLWriter's writing driver method.
97  int WriteData() override;
98  const char* GetDataSetName() override;
99 
100  // Methods to create the set of writers matching the set of inputs.
101  void CreateWriters();
102  vtkXMLWriterBase* GetWriter(int index);
103 
104  // Methods to help construct internal file names.
105  void SplitFileName();
106  const char* GetFilePrefix();
107  const char* GetFilePath();
108 
109  // Methods to construct the list of entries for the collection file.
110  void AppendEntry(const char* entry);
111  void DeleteAllEntries();
112 
113  // Write the collection file if it is requested.
114  int WriteCollectionFileIfRequested();
115 
116  // Make a directory.
117  void MakeDirectory(const char* name);
118 
119  // Remove a directory.
120  void RemoveADirectory(const char* name);
121 
122  // Internal implementation details.
123  vtkXMLPVDWriterInternals* Internal;
124 
125  // The piece number to write.
126  int Piece;
127 
128  // The number of pieces into which the inputs are split.
130 
131  // The number of ghost levels to write for unstructured data.
133 
134  // Whether to write the collection file on this node.
137 
138  // Callback registered with the ProgressObserver.
139  static void ProgressCallbackFunction(vtkObject*, unsigned long, void*, void*);
140  // Progress callback from internal writer.
141  virtual void ProgressCallback(vtkAlgorithm* w);
142 
143  // The observer to report progress from the internal writer.
145 
146  // Garbage collection support.
147  void ReportReferences(vtkGarbageCollector*) override;
148 
149  // The current time step for time series inputs.
151 
152  // Option to write all time steps (ON) or just the current one (OFF)
154 
155 private:
156  vtkXMLPVDWriter(const vtkXMLPVDWriter&) = delete;
157  void operator=(const vtkXMLPVDWriter&) = delete;
158 };
159 
160 #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 &)