VTK  9.0.20200704
VTXSchemaManager.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: VTXSchemaManager.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm 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  * VTXSchemaManager.h : reusable class that manages a reader that
18  * is a derived type of VTXSchema
19  *
20  * Created on: May 31, 2019
21  * Author: William F Godoy godoywf@ornl.gov
22  */
23 
24 #ifndef VTK_IO_ADIOS2_VTX_VTXSchemaManager_H_
25 #define VTK_IO_ADIOS2_VTX_VTXSchemaManager_H_
26 
27 #include <memory>
28 #include <set>
29 #include <string>
30 
31 #include "vtkMultiBlockDataSet.h"
32 
33 #include "schema/VTXSchema.h"
34 #include <adios2.h>
35 
36 namespace vtx
37 {
38 
40 {
41 public:
43  double Time = 0.;
45  size_t Step = 0;
46 
48  std::unique_ptr<VTXSchema> Reader;
49 
50  VTXSchemaManager() = default;
51  ~VTXSchemaManager() = default;
52 
60  void Update(const std::string& streamName, const size_t step = 0,
61  const std::string& schemaName = "vtk.xml");
62 
68  void Fill(vtkMultiBlockDataSet* multiblock, const size_t step = 0);
69 
70 private:
72  std::string StreamName;
73 
75  std::unique_ptr<adios2::ADIOS> ADIOS;
76 
78  adios2::IO IO;
79 
81  adios2::Engine Engine;
82 
84  std::string SchemaName;
85 
86  static const std::set<std::string> SupportedTypes;
87 
89  void InitReader();
90 
92  bool InitReaderXMLVTK();
93 };
94 
95 } // end namespace adios2vtk
96 
97 #endif /* VTK_IO_ADIOS2_VTX_VTXSchemaManager_h */
vtx::VTXSchemaManager::Reader
std::unique_ptr< VTXSchema > Reader
managed polymorphic reader, could be extended in a container
Definition: VTXSchemaManager.h:48
vtx
Definition: vtkADIOS2VTXReader.h:35
vtx::VTXSchemaManager
Definition: VTXSchemaManager.h:39
vtkMultiBlockDataSet
Composite dataset that organizes datasets into blocks.
Definition: vtkMultiBlockDataSet.h:45
vtx::VTXSchemaManager::Step
size_t Step
current adios2 step
Definition: VTXSchemaManager.h:45
VTXSchema.h
vtkX3D::string
Definition: vtkX3D.h:496
vtx::VTXSchemaManager::Update
void Update(const std::string &streamName, const size_t step=0, const std::string &schemaName="vtk.xml")
Updates metadata if stream is changed.
vtx::VTXSchemaManager::Fill
void Fill(vtkMultiBlockDataSet *multiblock, const size_t step=0)
Fill multiblock data.
vtx::VTXSchemaManager::~VTXSchemaManager
~VTXSchemaManager()=default
vtx::VTXSchemaManager::Time
double Time
current time
Definition: VTXSchemaManager.h:43
vtkMultiBlockDataSet.h
vtx::VTXSchemaManager::VTXSchemaManager
VTXSchemaManager()=default