ParaView
vtkParallelSerialWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkParallelSerialWriter.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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 =========================================================================*/
27 #ifndef vtkParallelSerialWriter_h
28 #define vtkParallelSerialWriter_h
29 
30 #include "vtkDataObjectAlgorithm.h"
31 #include "vtkPVVTKExtensionsDefaultModule.h" //needed for exports
32 
34 
35 class VTKPVVTKEXTENSIONSDEFAULT_EXPORT vtkParallelSerialWriter : public vtkDataObjectAlgorithm
36 {
37 public:
38  static vtkParallelSerialWriter* New();
39  vtkTypeMacro(vtkParallelSerialWriter, vtkDataObjectAlgorithm);
40  void PrintSelf(ostream& os, vtkIndent indent);
41 
43 
46  void SetWriter(vtkAlgorithm*);
47  vtkGetObjectMacro(Writer, vtkAlgorithm);
49 
53  virtual vtkMTimeType GetMTime();
54 
56 
60  vtkSetStringMacro(FileNameMethod);
61  vtkGetStringMacro(FileNameMethod);
63 
65 
68  vtkSetStringMacro(FileName);
69  vtkGetStringMacro(FileName);
71 
75  int Write();
76 
78 
82  vtkGetMacro(Piece, int);
83  vtkSetMacro(Piece, int);
85 
87 
90  vtkGetMacro(NumberOfPieces, int);
91  vtkSetMacro(NumberOfPieces, int);
93 
95 
98  vtkGetMacro(GhostLevel, int);
99  vtkSetMacro(GhostLevel, int);
101 
103 
107  void SetPreGatherHelper(vtkAlgorithm*);
108  vtkGetObjectMacro(PreGatherHelper, vtkAlgorithm);
110 
112 
118  void SetPostGatherHelper(vtkAlgorithm*);
119  vtkGetObjectMacro(PostGatherHelper, vtkAlgorithm);
121 
123 
127  vtkGetMacro(WriteAllTimeSteps, int);
128  vtkSetMacro(WriteAllTimeSteps, int);
129  vtkBooleanMacro(WriteAllTimeSteps, int);
131 
135  void SetInterpreter(vtkClientServerInterpreter* interp) { this->Interpreter = interp; }
136 
137 protected:
140 
141  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
142  vtkInformationVector* outputVector);
143  int RequestUpdateExtent(vtkInformation* request, vtkInformationVector** inputVector,
144  vtkInformationVector* outputVector);
145  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
146  vtkInformationVector* outputVector);
147 
148 private:
149  vtkParallelSerialWriter(const vtkParallelSerialWriter&) VTK_DELETE_FUNCTION;
150  void operator=(const vtkParallelSerialWriter&) VTK_DELETE_FUNCTION;
151 
152  void WriteATimestep(vtkDataObject* input);
153  void WriteAFile(const char* fname, vtkDataObject* input);
154 
155  void SetWriterFileName(const char* fname);
156  void WriteInternal();
157 
158  vtkAlgorithm* PreGatherHelper;
159  vtkAlgorithm* PostGatherHelper;
160 
161  vtkAlgorithm* Writer;
162  char* FileNameMethod;
163  int Piece;
164  int NumberOfPieces;
165  int GhostLevel;
166 
167  int WriteAllTimeSteps;
168  int NumberOfTimeSteps;
169  int CurrentTimeIndex;
170 
171  // The name of the output file.
172  char* FileName;
173 
174  vtkClientServerInterpreter* Interpreter;
175 };
176 
177 #endif
void SetInterpreter(vtkClientServerInterpreter *interp)
Get/Set the interpreter to use to call methods on the writer.
Run-time VTK interpreter.
parallel meta-writer for serial formats