vtkFileSeriesReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
4 
60 #ifndef vtkFileSeriesReader_h
61 #define vtkFileSeriesReader_h
62 
63 #include "vtkMetaReader.h"
64 #include "vtkPVVTKExtensionsIOCoreModule.h" //needed for exports
65 
66 #include <vector> // Needed for protected API
67 
70 class vtkStringArray;
71 
72 struct vtkFileSeriesReaderInternals;
73 
75 {
76 public:
77  static vtkFileSeriesReader* New();
79  void PrintSelf(ostream& os, vtkIndent indent) override;
80 
86  void SetReader(vtkAlgorithm* reader) override;
87 
95 
99  virtual int CanReadFile(const char* filename);
100 
105  virtual void AddFileName(const char* fname);
106 
110  virtual void RemoveAllFileNames();
111 
115  virtual unsigned int GetNumberOfFileNames();
116 
120  virtual const char* GetFileName(unsigned int idx);
121 
122  const char* GetCurrentFileName();
123 
125 
128  vtkGetMacro(UseMetaFile, int);
129  vtkSetMacro(UseMetaFile, int);
130  vtkBooleanMacro(UseMetaFile, int);
132 
134 
138  vtkGetMacro(IgnoreReaderTime, bool);
139  vtkSetMacro(IgnoreReaderTime, bool);
140  vtkBooleanMacro(IgnoreReaderTime, bool);
142 
143  // Expose number of files, first filename and current file number as
144  // information keys for potential use in the internal reader
145  static vtkInformationIntegerKey* FILE_SERIES_NUMBER_OF_FILES();
146  static vtkInformationIntegerKey* FILE_SERIES_CURRENT_FILE_NUMBER();
147  static vtkInformationStringKey* FILE_SERIES_FIRST_FILENAME();
148 
152  unsigned long GetErrorCode() override;
153 
154 protected:
156  ~vtkFileSeriesReader() override;
157 
158  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
159  vtkInformationVector* outputVector) override;
161 
163  {
164  return 1;
165  };
168  {
169  return 1;
170  };
171  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
172  vtkInformationVector* outputVector) override;
173 
175 
180  virtual int RequestInformationForInput(
181  int index, vtkInformation* request = nullptr, vtkInformationVector* outputVector = nullptr);
182 
187  virtual int ReadMetaDataFile(const char* metafilename, vtkStringArray* filesToRead,
188  std::vector<double>& timeValues, int maxFilesToRead = VTK_INT_MAX);
189 
194 
199 
203  virtual void UpdateMetaData();
204 
208  void ResetTimeRanges();
209 
213  void RemoveAllFileNamesInternal();
214  void AddFileNameInternal(const char*);
215 
219  virtual void RemoveAllRealFileNamesInternal();
220 
224  void CopyRealFileNamesFromFileNames();
225 
227 
228  int ChooseInput(vtkInformation*);
229 
230 private:
231  vtkFileSeriesReader(const vtkFileSeriesReader&) = delete;
232  void operator=(const vtkFileSeriesReader&) = delete;
233 
234  vtkFileSeriesReaderInternals* Internal;
235 };
236 
237 #endif
int UseMetaFile
True if use a meta-file, false otherwise.
static vtkMetaReader * New()
#define VTKPVVTKEXTENSIONSIOCORE_EXPORT
#define VTK_INT_MAX
virtual void SetReader(vtkAlgorithm *)
Set/get the internal reader.
void PrintSelf(ostream &os, vtkIndent indent) override
info
int FillOutputPortInformation(int port, vtkInformation *info) override
meta-reader to read file series
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Common functionality for meta-readers.
Definition: vtkMetaReader.h:21
virtual unsigned long GetErrorCode()
int RequestUpdateTime(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual int ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
port
index
virtual int RequestUpdateTimeDependentInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
bool UseJsonMetaFile
True if meta-file is of Json format, false otherwise.