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 
74 class VTKPVVTKEXTENSIONSIOCORE_EXPORT vtkFileSeriesReader : public vtkMetaReader
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 
162  int FillOutputPortInformation(int port, vtkInformation* info) override;
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
vtkInformationStringKey
vtkFileSeriesReader::UseJsonMetaFile
bool UseJsonMetaFile
True if meta-file is of Json format, false otherwise.
Definition: vtkFileSeriesReader.h:186
vtkInformationVector
vtkFileSeriesReader::IgnoreReaderTime
bool IgnoreReaderTime
Definition: vtkFileSeriesReader.h:214
vtkMetaReader
Common functionality for meta-readers.
Definition: vtkMetaReader.h:21
vtkDataObjectAlgorithm::RequestUpdateExtent
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkMetaReader::FillOutputPortInformation
int FillOutputPortInformation(int port, vtkInformation *info) override
vtkFileSeriesReader::RequestUpdateTimeDependentInformation
virtual int RequestUpdateTimeDependentInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Definition: vtkFileSeriesReader.h:154
vtkFileSeriesReader
meta-reader to read file series
Definition: vtkFileSeriesReader.h:74
vtkInformationIntegerKey
vtkIndent
vtkMetaReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
vtkFileSeriesReader::UseMetaFile
int UseMetaFile
True if use a meta-file, false otherwise.
Definition: vtkFileSeriesReader.h:181
vtkDataObjectAlgorithm::ProcessRequest
virtual int ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkInformation
vtkMetaReader::New
static vtkMetaReader * New()
vtkStringArray
vtkFileSeriesReader::RequestUpdateTime
int RequestUpdateTime(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Definition: vtkFileSeriesReader.h:150
vtkDataObjectAlgorithm::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkDataObjectAlgorithm::RequestInformation
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkMetaReader.h