vtkFileSeriesReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkFileSeriesReader.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 =========================================================================*/
15 
16 /*
17  * Copyright 2008 Sandia Corporation.
18  * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
19  * license for use of this work by or on behalf of the
20  * U.S. Government. Redistribution and use in source and binary forms, with
21  * or without modification, are permitted provided that this Notice and any
22  * statement of authorship are reproduced on all copies.
23  */
24 
80 #ifndef vtkFileSeriesReader_h
81 #define vtkFileSeriesReader_h
82 
83 #include "vtkMetaReader.h"
84 #include "vtkPVVTKExtensionsIOCoreModule.h" //needed for exports
85 
86 #include <vector> // Needed for protected API
87 
90 class vtkStringArray;
91 
92 struct vtkFileSeriesReaderInternals;
93 
95 {
96 public:
97  static vtkFileSeriesReader* New();
99  void PrintSelf(ostream& os, vtkIndent indent) override;
100 
108 
112  virtual int CanReadFile(const char* filename);
113 
118  virtual void AddFileName(const char* fname);
119 
123  virtual void RemoveAllFileNames();
124 
128  virtual unsigned int GetNumberOfFileNames();
129 
133  virtual const char* GetFileName(unsigned int idx);
134 
135  const char* GetCurrentFileName();
136 
138 
141  vtkGetMacro(UseMetaFile, int);
142  vtkSetMacro(UseMetaFile, int);
143  vtkBooleanMacro(UseMetaFile, int);
145 
147 
151  vtkGetMacro(IgnoreReaderTime, bool);
152  vtkSetMacro(IgnoreReaderTime, bool);
153  vtkBooleanMacro(IgnoreReaderTime, bool);
155 
156  // Expose number of files, first filename and current file number as
157  // information keys for potential use in the internal reader
158  static vtkInformationIntegerKey* FILE_SERIES_NUMBER_OF_FILES();
159  static vtkInformationIntegerKey* FILE_SERIES_CURRENT_FILE_NUMBER();
160  static vtkInformationStringKey* FILE_SERIES_FIRST_FILENAME();
161 
162 protected:
164  ~vtkFileSeriesReader() override;
165 
166  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
167  vtkInformationVector* outputVector) override;
169 
171  {
172  return 1;
173  };
176  {
177  return 1;
178  };
179  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
180  vtkInformationVector* outputVector) override;
181 
183 
188  virtual int RequestInformationForInput(
189  int index, vtkInformation* request = NULL, vtkInformationVector* outputVector = NULL);
190 
195  virtual int ReadMetaDataFile(const char* metafilename, vtkStringArray* filesToRead,
196  std::vector<double>& timeValues, int maxFilesToRead = VTK_INT_MAX);
197 
202 
207 
211  virtual void UpdateMetaData();
212 
216  void ResetTimeRanges();
217 
221  void RemoveAllFileNamesInternal();
222  void AddFileNameInternal(const char*);
223 
227  virtual void RemoveAllRealFileNamesInternal();
228 
232  void CopyRealFileNamesFromFileNames();
233 
235 
236  int ChooseInput(vtkInformation*);
237 
238 private:
239  vtkFileSeriesReader(const vtkFileSeriesReader&) = delete;
240  void operator=(const vtkFileSeriesReader&) = delete;
241 
242  vtkFileSeriesReaderInternals* Internal;
243 };
244 
245 #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 RequestUpdateTime(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Common functionality for meta-readers.
Definition: vtkMetaReader.h:33
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.