VTK  9.2.6
vtkXMLWriter2.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkXMLWriter2.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 =========================================================================*/
35 #ifndef vtkXMLWriter2_h
36 #define vtkXMLWriter2_h
37 
38 #include "vtkIOParallelXMLModule.h" // For export macro
39 #include "vtkXMLWriterBase.h"
40 
41 #include <string> // for std::string
42 #include <tuple> // for std::tuple
43 #include <utility> // for std::pair
44 #include <vector> // for std::vector
45 
47 
48 class VTKIOPARALLELXML_EXPORT vtkXMLWriter2 : public vtkXMLWriterBase
49 {
50 public:
52  void PrintSelf(ostream& os, vtkIndent indent) override;
53 
55 
60  void SetController(vtkMultiProcessController* controller);
61  vtkGetObjectMacro(Controller, vtkMultiProcessController);
63 
65 
72  vtkSetClampMacro(NumberOfGhostLevels, int, 0, VTK_INT_MAX);
73  vtkGetMacro(NumberOfGhostLevels, int);
75 
80  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
81 
82 protected:
83  vtkXMLWriter2();
84  ~vtkXMLWriter2() override;
85 
87 
94  {
95  return 1;
96  }
98  {
99  return 1;
100  }
101  virtual int RequestUpdateExtent(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
102  virtual int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) = 0;
104 
115  static std::tuple<std::string, std::string, std::string> SplitFileName(const std::string& fname);
116 
123  void AddArtifact(const std::string& fname, bool isDir = false);
124 
128  void AddRootArtifact(const std::string& fname, bool isDir = false);
129 
136  bool MakeDirectory(const std::string& dirname) const;
137 
141  static int ExclusiveScanSum(vtkMultiProcessController* controller, int value);
142 
147  std::vector<std::string> Gather(vtkMultiProcessController* controller,
148  const std::vector<std::string>& values, int destinationRank);
149 
150 private:
151  vtkXMLWriter2(const vtkXMLWriter2&) = delete;
152  void operator=(const vtkXMLWriter2&) = delete;
153 
157  void DeleteArtifacts();
158 
159  vtkMultiProcessController* Controller;
160  int NumberOfGhostLevels;
161  std::vector<std::pair<std::string, bool>> Artifacts;
162 };
163 
164 #endif
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Methods for various pipeline passes that can be overridden by subclasses to do the work for the reque...
Definition: vtkXMLWriter2.h:93
Store vtkAlgorithm input/output information.
#define VTK_INT_MAX
Definition: vtkType.h:155
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int vtkTypeBool
Definition: vtkABI.h:69
virtual vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
a simple class to control print indentation
Definition: vtkIndent.h:39
Abstract base class for VTK-XML writers.
virtual int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Methods for various pipeline passes that can be overridden by subclasses to do the work for the reque...
Definition: vtkXMLWriter2.h:97
base class for new-style XML Writers
Definition: vtkXMLWriter2.h:48
Store zero or more vtkInformation instances.
Multiprocessing communication superclass.