vtkSpyPlotReaderMap.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
3 // SPDX-License-Identifier: BSD-3-Clause
13 #ifndef vtkSpyPlotReaderMap_h
14 #define vtkSpyPlotReaderMap_h
15 
16 #include "vtkPVVTKExtensionsIOSPCTHModule.h" //needed for exports
17 
18 #include <map> // for std::map
19 #include <string> // for std::string
20 #include <vector> // for std::vector
21 
23 class vtkSpyPlotReader;
25 
27 {
28 public:
29  typedef std::map<std::string, vtkSpyPlotUniReader*> MapOfStringToSPCTH;
30  typedef std::vector<std::string> VectorOfStrings;
31  MapOfStringToSPCTH Files;
32 
33  // Initialize the file-map. The filename can either be a case file or a spcth
34  // file. In case of later, we detect fileseries automatically.
35  // This method should ideally be called only on the 0th node to avoid reading
36  // reads for meta-data on all the nodes.
37  bool Initialize(const char* filename);
38 
39  void Clean(vtkSpyPlotUniReader* save);
40  vtkSpyPlotUniReader* GetReader(MapOfStringToSPCTH::iterator& it, vtkSpyPlotReader* parent);
41  void TellReadersToCheck(vtkSpyPlotReader* parent);
42 
43  bool Save(vtkMultiProcessStream& stream);
44  bool Load(vtkMultiProcessStream& stream);
45 
46 private:
52  bool InitializeFromSpyFile(const char*);
53 
55 
60  bool InitializeFromCaseFile(const char*);
61 };
63 
64 #endif
65 
66 // VTK-HeaderTest-Exclude: vtkSpyPlotReaderMap.h
std::map< std::string, vtkSpyPlotUniReader * > MapOfStringToSPCTH
Maps strings to vtkSpyPlotUniReaders.
std::vector< std::string > VectorOfStrings
MapOfStringToSPCTH Files
Read SPCTH Spy Plot file format.
#define VTKPVVTKEXTENSIONSIOSPCTH_EXPORT
gio::GenericIOReader * GetReader(MPI_Comm comm, bool posix, int distribution, const std::string &fileName)
This method constructs and returns the underlying GenericIO reader.
Read SPCTH Spy Plot file format.