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);
45  static vtkPDataSetWriter *New();
46 
50  virtual int Write();
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, int);
99  vtkGetMacro(UseRelativeFileNames, int);
100  vtkBooleanMacro(UseRelativeFileNames, int);
102 
104 
109  virtual void SetController(vtkMultiProcessController*);
110  vtkGetObjectMacro(Controller, vtkMultiProcessController);
112 
113 protected:
116 
117  ostream *OpenFile();
118  int WriteUnstructuredMetaData(vtkDataSet *input,
119  char *root, char *str, ostream *fptr);
120  int WriteImageMetaData(vtkImageData *input,
121  char *root, char *str, ostream *fptr);
122  int WriteRectilinearGridMetaData(vtkRectilinearGrid *input,
123  char *root, char *str, ostream *fptr);
124  int WriteStructuredGridMetaData(vtkStructuredGrid *input,
125  char *root, char *str, ostream *fptr);
126 
128  int EndPiece;
131 
133 
134  char *FilePattern;
135 
136  void DeleteFiles();
137 
138  typedef std::map<int, std::vector<int> > ExtentsType;
139  ExtentsType Extents;
140 
142 
143 private:
144  vtkPDataSetWriter(const vtkPDataSetWriter&) VTK_DELETE_FUNCTION;
145  void operator=(const vtkPDataSetWriter&) VTK_DELETE_FUNCTION;
146 };
147 
148 #endif
a dataset that is topologically regular with variable spacing in the three coordinate directions ...
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
static vtkDataSetWriter * New()
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
std::map< int, std::vector< int > > ExtentsType
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
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.
vtkMultiProcessController * Controller
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.