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 
88 
92  virtual int CanReadFile(const char* filename);
93 
98  virtual void AddFileName(const char* fname);
99 
103  virtual void RemoveAllFileNames();
104 
108  virtual unsigned int GetNumberOfFileNames();
109 
113  virtual const char* GetFileName(unsigned int idx);
114 
115  const char* GetCurrentFileName();
116 
118 
121  vtkGetMacro(UseMetaFile, int);
122  vtkSetMacro(UseMetaFile, int);
123  vtkBooleanMacro(UseMetaFile, int);
125 
127 
131  vtkGetMacro(IgnoreReaderTime, bool);
132  vtkSetMacro(IgnoreReaderTime, bool);
133  vtkBooleanMacro(IgnoreReaderTime, bool);
135 
136  // Expose number of files, first filename and current file number as
137  // information keys for potential use in the internal reader
138  static vtkInformationIntegerKey* FILE_SERIES_NUMBER_OF_FILES();
139  static vtkInformationIntegerKey* FILE_SERIES_CURRENT_FILE_NUMBER();
140  static vtkInformationStringKey* FILE_SERIES_FIRST_FILENAME();
141 
145  unsigned long GetErrorCode() override;
146 
147 protected:
149  ~vtkFileSeriesReader() override;
150 
151  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
152  vtkInformationVector* outputVector) override;
154 
156  {
157  return 1;
158  };
161  {
162  return 1;
163  };
164  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
165  vtkInformationVector* outputVector) override;
166 
168 
173  virtual int RequestInformationForInput(
174  int index, vtkInformation* request = nullptr, vtkInformationVector* outputVector = nullptr);
175 
180  virtual int ReadMetaDataFile(const char* metafilename, vtkStringArray* filesToRead,
181  std::vector<double>& timeValues, int maxFilesToRead = VTK_INT_MAX);
182 
187 
192 
196  virtual void UpdateMetaData();
197 
201  void ResetTimeRanges();
202 
206  void RemoveAllFileNamesInternal();
207  void AddFileNameInternal(const char*);
208 
212  virtual void RemoveAllRealFileNamesInternal();
213 
217  void CopyRealFileNamesFromFileNames();
218 
220 
221  int ChooseInput(vtkInformation*);
222 
223 private:
224  vtkFileSeriesReader(const vtkFileSeriesReader&) = delete;
225  void operator=(const vtkFileSeriesReader&) = delete;
226 
227  vtkFileSeriesReaderInternals* Internal;
228 };
229 
230 #endif
int UseMetaFile
True if use a meta-file, false otherwise.
static vtkMetaReader * New()
#define VTKPVVTKEXTENSIONSIOCORE_EXPORT
#define VTK_INT_MAX
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.