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 
142 protected:
144  ~vtkFileSeriesReader() override;
145 
146  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
147  vtkInformationVector* outputVector) override;
149 
151  {
152  return 1;
153  };
156  {
157  return 1;
158  };
159  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
160  vtkInformationVector* outputVector) override;
161 
163 
168  virtual int RequestInformationForInput(
169  int index, vtkInformation* request = nullptr, vtkInformationVector* outputVector = nullptr);
170 
175  virtual int ReadMetaDataFile(const char* metafilename, vtkStringArray* filesToRead,
176  std::vector<double>& timeValues, int maxFilesToRead = VTK_INT_MAX);
177 
182 
187 
191  virtual void UpdateMetaData();
192 
196  void ResetTimeRanges();
197 
201  void RemoveAllFileNamesInternal();
202  void AddFileNameInternal(const char*);
203 
207  virtual void RemoveAllRealFileNamesInternal();
208 
212  void CopyRealFileNamesFromFileNames();
213 
215 
216  int ChooseInput(vtkInformation*);
217 
218 private:
219  vtkFileSeriesReader(const vtkFileSeriesReader&) = delete;
220  void operator=(const vtkFileSeriesReader&) = delete;
221 
222  vtkFileSeriesReaderInternals* Internal;
223 };
224 
225 #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
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.