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 =========================================================================*/
23 #ifndef vtkPDataSetWriter_h
24 #define vtkPDataSetWriter_h
25 
26 #include "vtkIOParallelModule.h" // For export macro
27 #include "vtkDataSetWriter.h"
28 
29 #include <map> // for keeping track of extents
30 #include <vector> // for keeping track of extents
31 
32 class vtkImageData;
33 class vtkRectilinearGrid;
34 class vtkStructuredGrid;
36 
37 class VTKIOPARALLEL_EXPORT vtkPDataSetWriter : public vtkDataSetWriter
38 {
39 public:
40  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
42  static vtkPDataSetWriter *New();
43 
47  int Write() VTK_OVERRIDE;
48 
50 
53  void SetNumberOfPieces(int num);
54  vtkGetMacro(NumberOfPieces, int);
56 
58 
62  vtkSetMacro(GhostLevel, int);
63  vtkGetMacro(GhostLevel, int);
65 
67 
73  vtkSetMacro(StartPiece, int);
74  vtkGetMacro(StartPiece, int);
75  vtkSetMacro(EndPiece, int);
76  vtkGetMacro(EndPiece, int);
78 
80 
84  vtkSetStringMacro(FilePattern);
85  vtkGetStringMacro(FilePattern);
87 
89 
95  vtkSetMacro(UseRelativeFileNames, int);
96  vtkGetMacro(UseRelativeFileNames, int);
97  vtkBooleanMacro(UseRelativeFileNames, int);
99 
101 
106  virtual void SetController(vtkMultiProcessController*);
107  vtkGetObjectMacro(Controller, vtkMultiProcessController);
109 
110 protected:
112  ~vtkPDataSetWriter() VTK_OVERRIDE;
113 
114  ostream *OpenFile();
115  int WriteUnstructuredMetaData(vtkDataSet *input,
116  char *root, char *str, ostream *fptr);
117  int WriteImageMetaData(vtkImageData *input,
118  char *root, char *str, ostream *fptr);
119  int WriteRectilinearGridMetaData(vtkRectilinearGrid *input,
120  char *root, char *str, ostream *fptr);
121  int WriteStructuredGridMetaData(vtkStructuredGrid *input,
122  char *root, char *str, ostream *fptr);
123 
124  int StartPiece;
125  int EndPiece;
126  int NumberOfPieces;
127  int GhostLevel;
128 
129  int UseRelativeFileNames;
130 
131  char *FilePattern;
132 
133  void DeleteFiles();
134 
135  typedef std::map<int, std::vector<int> > ExtentsType;
136  ExtentsType Extents;
137 
139 
140 private:
141  vtkPDataSetWriter(const vtkPDataSetWriter&) VTK_DELETE_FUNCTION;
142  void operator=(const vtkPDataSetWriter&) VTK_DELETE_FUNCTION;
143 };
144 
145 #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:56
static vtkDataSetWriter * New()
std::map< int, std::vector< int > > ExtentsType
a simple class to control print indentation
Definition: vtkIndent.h:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
Manages writing pieces of a data set.
topologically regular array of data
virtual int Write()
Write data to output.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
write any type of vtk dataset to file
Multiprocessing communication superclass.