vtkFileSeriesWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkFileSeriesWriter.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 =========================================================================*/
24 #ifndef vtkFileSeriesWriter_h
25 #define vtkFileSeriesWriter_h
26 
27 #include "vtkDataObjectAlgorithm.h"
28 #include "vtkPVVTKExtensionsIOCoreModule.h" //needed for exports
30 
32 {
33 public:
34  static vtkFileSeriesWriter* New();
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
39 
42  virtual void SetWriter(vtkAlgorithm*);
43  vtkGetObjectMacro(Writer, vtkAlgorithm);
45 
49  vtkMTimeType GetMTime() override;
50 
52 
56  vtkSetStringMacro(FileNameMethod);
57  vtkGetStringMacro(FileNameMethod);
59 
61 
64  vtkSetStringMacro(FileName);
65  vtkGetStringMacro(FileName);
67 
71  int Write();
72 
74 
79  vtkGetMacro(WriteAllTimeSteps, int);
80  vtkSetMacro(WriteAllTimeSteps, int);
81  vtkBooleanMacro(WriteAllTimeSteps, int);
83 
85 
92  vtkGetStringMacro(FileNameSuffix);
93  vtkSetStringMacro(FileNameSuffix);
95 
97 
100  vtkGetMacro(MinTimeStep, int);
101  vtkSetClampMacro(MinTimeStep, int, 0, VTK_INT_MAX);
103 
105 
110  vtkGetMacro(MaxTimeStep, int);
111  vtkSetMacro(MaxTimeStep, int);
113 
115 
118  vtkGetMacro(TimeStepStride, int);
119  vtkSetClampMacro(TimeStepStride, int, 1, VTK_INT_MAX);
121 
126 
130  void SetInterpreter(vtkClientServerInterpreter* interp) { this->Interpreter = interp; }
131 
135  static bool SuffixValidation(char* fileNameSuffix);
136 
137 protected:
139  ~vtkFileSeriesWriter() override;
140 
141  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
142  vtkInformationVector* outputVector) override;
143  int RequestUpdateExtent(vtkInformation* request, vtkInformationVector** inputVector,
144  vtkInformationVector* outputVector) override;
145  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
146  vtkInformationVector* outputVector) override;
147 
148 private:
149  vtkFileSeriesWriter(const vtkFileSeriesWriter&) = delete;
150  void operator=(const vtkFileSeriesWriter&) = delete;
151 
152  void SetWriterFileName(const char* fname);
153  bool WriteATimestep(vtkDataObject*, vtkInformation* inInfo);
154  void WriteInternal();
155 
156  vtkAlgorithm* Writer;
157  char* FileNameMethod;
158 
159  int WriteAllTimeSteps;
160  char* FileNameSuffix;
161  int NumberOfTimeSteps;
162  int CurrentTimeIndex;
163  int MinTimeStep;
164  int MaxTimeStep;
165  int TimeStepStride;
166 
167  // The name of the output file.
168  char* FileName;
169 
170  vtkClientServerInterpreter* Interpreter;
171 };
172 
173 #endif
#define VTKPVVTKEXTENSIONSIOCORE_EXPORT
static vtkDataObjectAlgorithm * New()
vtkTypeUInt64 vtkMTimeType
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
Run-time VTK interpreter.
meta-writer for writing a file series using writers that are not time-aware.
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual vtkMTimeType GetMTime()
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual int ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
void operator=(const vtkObjectBase &)
void SetInterpreter(vtkClientServerInterpreter *interp)
Get/Set the interpreter to use to call methods on the writer.