VTK
vtkPDataSetWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPDataSetWriter.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 =========================================================================*/
26 #ifndef vtkPDataSetWriter_h
27 #define vtkPDataSetWriter_h
28 
29 #include "vtkIOParallelModule.h" // For export macro
30 #include "vtkDataSetWriter.h"
31 
32 #include <map> // for keeping track of extents
33 #include <vector> // for keeping track of extents
34 
35 class vtkImageData;
36 class vtkRectilinearGrid;
37 class vtkStructuredGrid;
39 
40 class VTKIOPARALLEL_EXPORT vtkPDataSetWriter : public vtkDataSetWriter
41 {
42 public:
43  void PrintSelf(ostream& os, vtkIndent indent) override;
45  static vtkPDataSetWriter *New();
46 
50  int Write() override;
51 
53 
56  void SetNumberOfPieces(int num);
57  vtkGetMacro(NumberOfPieces, int);
59 
61 
65  vtkSetMacro(GhostLevel, int);
66  vtkGetMacro(GhostLevel, int);
68 
70 
76  vtkSetMacro(StartPiece, int);
77  vtkGetMacro(StartPiece, int);
78  vtkSetMacro(EndPiece, int);
79  vtkGetMacro(EndPiece, int);
81 
83 
87  vtkSetStringMacro(FilePattern);
88  vtkGetStringMacro(FilePattern);
90 
92 
98  vtkSetMacro(UseRelativeFileNames, vtkTypeBool);
99  vtkGetMacro(UseRelativeFileNames, vtkTypeBool);
100  vtkBooleanMacro(UseRelativeFileNames, vtkTypeBool);
102 
104 
109  virtual void SetController(vtkMultiProcessController*);
110  vtkGetObjectMacro(Controller, vtkMultiProcessController);
112 
113 protected:
115  ~vtkPDataSetWriter() override;
116 
117  ostream *OpenFile();
118  int WriteUnstructuredMetaData(vtkDataSet *input,
119  char *root, char *str,
120  size_t strSize, ostream *fptr);
121  int WriteImageMetaData(vtkImageData *input,
122  char *root, char *str,
123  size_t strSize, ostream *fptr);
124  int WriteRectilinearGridMetaData(vtkRectilinearGrid *input,
125  char *root, char *str,
126  size_t strSize, ostream *fptr);
127  int WriteStructuredGridMetaData(vtkStructuredGrid *input,
128  char *root, char *str,
129  size_t strSize, ostream *fptr);
130 
132  int EndPiece;
135 
137 
138  char *FilePattern;
139 
140  void DeleteFiles();
141 
142  typedef std::map<int, std::vector<int> > ExtentsType;
143  ExtentsType Extents;
144 
146 
147 private:
148  vtkPDataSetWriter(const vtkPDataSetWriter&) = delete;
149  void operator=(const vtkPDataSetWriter&) = delete;
150 };
151 
152 #endif
a dataset that is topologically regular with variable spacing in the three coordinate directions ...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
static vtkDataSetWriter * New()
int vtkTypeBool
Definition: vtkABI.h:69
std::map< int, std::vector< int > > ExtentsType
vtkTypeBool UseRelativeFileNames
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
Manages writing pieces of a data set.
topologically regular array of data
virtual int Write()
Write data to output.
vtkMultiProcessController * Controller
write any type of vtk dataset to file
Multiprocessing communication superclass.