VTK  9.1.0
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 "vtkDataSetWriter.h"
27#include "vtkIOParallelModule.h" // For export macro
28
29#include <map> // for keeping track of extents
30#include <vector> // for keeping track of extents
31
32class vtkImageData;
36
37class VTKIOPARALLEL_EXPORT vtkPDataSetWriter : public vtkDataSetWriter
38{
39public:
40 void PrintSelf(ostream& os, vtkIndent indent) override;
43
47 int Write() 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 vtkSetFilePathMacro(FilePattern);
85 vtkGetFilePathMacro(FilePattern);
87
89
95 vtkSetMacro(UseRelativeFileNames, vtkTypeBool);
96 vtkGetMacro(UseRelativeFileNames, vtkTypeBool);
97 vtkBooleanMacro(UseRelativeFileNames, vtkTypeBool);
99
101
107 vtkGetObjectMacro(Controller, vtkMultiProcessController);
109
110protected:
113
114 ostream* OpenFile();
116 vtkDataSet* input, char* root, char* str, size_t strSize, ostream* fptr);
117 int WriteImageMetaData(vtkImageData* input, char* root, char* str, size_t strSize, ostream* fptr);
119 vtkRectilinearGrid* input, char* root, char* str, size_t strSize, ostream* fptr);
121 vtkStructuredGrid* input, char* root, char* str, size_t strSize, ostream* fptr);
122
127
129
131
133
134 typedef std::map<int, std::vector<int>> ExtentsType;
136
138
139private:
140 vtkPDataSetWriter(const vtkPDataSetWriter&) = delete;
141 void operator=(const vtkPDataSetWriter&) = delete;
142};
143
144#endif
write any type of vtk dataset to file
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
a simple class to control print indentation
Definition: vtkIndent.h:113
Multiprocessing communication superclass.
Manages writing pieces of a data set.
ostream * OpenFile()
vtkGetFilePathMacro(FilePattern)
This file pattern uses the file name and piece number to construct a file name for the piece file.
int WriteImageMetaData(vtkImageData *input, char *root, char *str, size_t strSize, ostream *fptr)
int WriteUnstructuredMetaData(vtkDataSet *input, char *root, char *str, size_t strSize, ostream *fptr)
vtkTypeBool UseRelativeFileNames
int Write() override
Write the pvtk file and cooresponding vtk files.
vtkSetFilePathMacro(FilePattern)
This file pattern uses the file name and piece number to construct a file name for the piece file.
vtkMultiProcessController * Controller
void SetNumberOfPieces(int num)
This is how many pieces the whole data set will be divided into.
~vtkPDataSetWriter() override
int WriteRectilinearGridMetaData(vtkRectilinearGrid *input, char *root, char *str, size_t strSize, ostream *fptr)
virtual void SetController(vtkMultiProcessController *)
Controller used to communicate data type of blocks.
std::map< int, std::vector< int > > ExtentsType
static vtkPDataSetWriter * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int WriteStructuredGridMetaData(vtkStructuredGrid *input, char *root, char *str, size_t strSize, ostream *fptr)
a dataset that is topologically regular with variable spacing in the three coordinate directions
topologically regular array of data
int vtkTypeBool
Definition: vtkABI.h:69