VTK  9.0.20210301
VTXvtkBase.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: VTXvtkBase.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  * VTXvtkBase.h : abstract class for schemas of type
18  * [VTK XML file formats schemas]
19  * (https://vtk.org/wp-content/uploads/2015/04/file-formats.pdf)
20  * Provide common functionality.
21  *
22  * Created on: May 6, 2019
23  * Author: William F Godoy godoywf@ornl.gov
24  */
25 
26 #ifndef VTK_IO_ADIOS2_VTX_SCHEMA_VTK_VTXvtkBase_h
27 #define VTK_IO_ADIOS2_VTX_SCHEMA_VTK_VTXvtkBase_h
28 
29 #include "VTX/common/VTXTypes.h"
30 #include "VTX/schema/VTXSchema.h"
31 
32 #include <map>
33 #include <set>
34 #include <string>
35 #include <vector>
36 
37 namespace vtx
38 {
39 namespace schema
40 {
41 
42 class VTXvtkBase : public VTXSchema
43 {
44 public:
46  const std::string& type, const std::string& schema, adios2::IO& io, adios2::Engine& engine);
47 
48  // can't use = default, due to forward class not defined
49  virtual ~VTXvtkBase();
50 
51 protected:
52  std::vector<types::Piece> Pieces;
53 
54  const static std::set<std::string> TIMENames;
55  const static std::set<std::string> SpecialNames;
56  const static std::map<types::DataSetType, std::string> DataSetTypes;
57 
58  virtual void DoFill(vtkMultiBlockDataSet* multiBlock, const size_t step) = 0;
59  virtual void ReadPiece(const size_t step, const size_t pieceID) = 0;
60 
61  bool ReadDataSets(const types::DataSetType type, const size_t step, const size_t pieceID);
62 
63  virtual void Init() = 0;
64  void InitTimes() final;
65 
66  std::string DataSetType(const types::DataSetType type) const noexcept;
67 };
68 
69 } // end namespace schema
70 } // end namespace vtx
71 
72 #endif /* VTK_IO_ADIOS2_VTX_SCHEMA_VTK_VTXvtkBase_h */
vtx::VTXSchema
Abstract common class to supported ADIOS2 schemas.
Definition: VTXSchema.h:43
vtx::types::DataSetType
DataSetType
Definition: VTXTypes.h:42
vtx::schema::VTXvtkBase::DataSetType
std::string DataSetType(const types::DataSetType type) const noexcept
vtkX3D::type
@ type
Definition: vtkX3D.h:522
vtx
Definition: vtkADIOS2VTXReader.h:36
vtx::schema::VTXvtkBase::ReadDataSets
bool ReadDataSets(const types::DataSetType type, const size_t step, const size_t pieceID)
vtx::schema::VTXvtkBase::TIMENames
static const std::set< std::string > TIMENames
Definition: VTXvtkBase.h:54
vtkMultiBlockDataSet
Composite dataset that organizes datasets into blocks.
Definition: vtkMultiBlockDataSet.h:46
vtx::schema::VTXvtkBase
Definition: VTXvtkBase.h:43
vtx::schema::VTXvtkBase::VTXvtkBase
VTXvtkBase(const std::string &type, const std::string &schema, adios2::IO &io, adios2::Engine &engine)
vtx::schema::VTXvtkBase::InitTimes
void InitTimes() final
vtx::schema::VTXvtkBase::DoFill
virtual void DoFill(vtkMultiBlockDataSet *multiBlock, const size_t step)=0
vtx::schema::VTXvtkBase::Pieces
std::vector< types::Piece > Pieces
Definition: VTXvtkBase.h:52
vtx::schema::VTXvtkBase::DataSetTypes
static const std::map< types::DataSetType, std::string > DataSetTypes
Definition: VTXvtkBase.h:56
vtx::schema::VTXvtkBase::SpecialNames
static const std::set< std::string > SpecialNames
Definition: VTXvtkBase.h:55
vtx::schema::VTXvtkBase::ReadPiece
virtual void ReadPiece(const size_t step, const size_t pieceID)=0
VTXSchema.h
vtkX3D::string
@ string
Definition: vtkX3D.h:496
vtx::schema::VTXvtkBase::~VTXvtkBase
virtual ~VTXvtkBase()
VTXTypes.h
vtx::schema::VTXvtkBase::Init
virtual void Init()=0