VTK  9.2.6
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 "vtkDataSetWriter.h"
30 #include "vtkIOParallelModule.h" // For export macro
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  vtkSetFilePathMacro(FilePattern);
88  vtkGetFilePathMacro(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(
119  vtkDataSet* input, char* root, char* str, size_t strSize, ostream* fptr);
120  int WriteImageMetaData(vtkImageData* input, char* root, char* str, size_t strSize, ostream* fptr);
121  int WriteRectilinearGridMetaData(
122  vtkRectilinearGrid* input, char* root, char* str, size_t strSize, ostream* fptr);
123  int WriteStructuredGridMetaData(
124  vtkStructuredGrid* input, char* root, char* str, size_t strSize, ostream* fptr);
125 
127  int EndPiece;
130 
132 
133  char* FilePattern;
134 
135  void DeleteFiles();
136 
137  typedef std::map<int, std::vector<int>> ExtentsType;
138  ExtentsType Extents;
139 
141 
142 private:
143  vtkPDataSetWriter(const vtkPDataSetWriter&) = delete;
144  void operator=(const vtkPDataSetWriter&) = delete;
145 };
146 
147 #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()
vtkSetFilePathMacro(FileName)
Specify the file name of VTK data file to write.
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:53
Manages writing pieces of a data set.
vtkGetFilePathMacro(FileName)
Specify the file name of VTK data file to write.
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.