Salome HOME
updated copyright message
[modules/paravis.git] / src / Plugins / MEDReader / plugin / MEDReaderIO / vtkFileSeriesGroupReader.h
1 // Copyright (C) 2022-2023  CEA, EDF
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef vtkFileSeriesGroupReader_h
21 #define vtkFileSeriesGroupReader_h
22
23 #include "vtkMetaReader.h"
24
25 #include <memory>
26
27 struct vtkFileSeriesGroupReaderInternals;
28
29 class VTK_EXPORT vtkFileSeriesGroupReader : public vtkMetaReader
30 {
31 public:
32   static vtkFileSeriesGroupReader* New();
33   vtkTypeMacro(vtkFileSeriesGroupReader, vtkMetaReader);
34   void PrintSelf(ostream& os, vtkIndent indent) override;
35
36   /**
37    * CanReadFile is forwarded to the internal reader if it supports it.
38    */
39   virtual int CanReadFile(const char* filename);
40
41   /**
42    * Adds names of files to be read. The files are read in the order
43    * they are added.
44    */
45   virtual void AddFileName(const char* fname);
46
47   /**
48    * Remove all file names.
49    */
50   virtual void RemoveAllFileNames();
51
52   /**
53    * Returns the number of file names added by AddFileName.
54    */
55   virtual unsigned int GetNumberOfFileNames();
56
57   /**
58    * Returns the name of a file with index idx.
59    */
60   virtual const char* GetFileName(unsigned int idx);
61
62 protected:
63   vtkFileSeriesGroupReader();
64   ~vtkFileSeriesGroupReader() override;
65
66   /**
67    * Add/Remove filenames without changing the MTime.
68    */
69   void RemoveAllFileNamesInternal();
70   void AddFileNameInternal(const char*);
71
72   int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector);
73   int RequestData(vtkInformation* vtkNotUsed(request), vtkInformationVector** inputVector, vtkInformationVector* outputVector);
74   int FillOutputPortInformation(int vtkNotUsed(port), vtkInformation* info);
75
76 private:
77   vtkFileSeriesGroupReader(const vtkFileSeriesGroupReader&) = delete;
78   void operator=(const vtkFileSeriesGroupReader&) = delete;
79
80   std::unique_ptr<vtkFileSeriesGroupReaderInternals> Internals;
81 };
82
83 #endif