VTK  9.7.0
vtkXMLMultiBlockDataReader.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright (c) Kitware, Inc.
3// SPDX-License-Identifier: BSD-3-Clause
23
24#ifndef vtkXMLMultiBlockDataReader_h
25#define vtkXMLMultiBlockDataReader_h
26
27#include "vtkIOXMLModule.h" // For export macro
29
30#include <set> // For std::set
31#include <vector> // For std::vector
32
33VTK_ABI_NAMESPACE_BEGIN
34class vtkDataAssembly;
35
37{
38public:
41 void PrintSelf(ostream& os, vtkIndent indent) override;
42
47
55 vtkGetMacro(AssemblyTag, int);
56
58
70 bool AddSelector(const char* selector);
72 void SetSelector(const char* selector);
74
76
80 const char* GetSelector(int index) const;
82
83protected:
86
87 // Get the name of the data set being read.
88 const char* GetDataSetName() override;
89
90 int FillOutputPortInformation(int, vtkInformation* info) override;
91
92 // Read the XML element for the subtree of a composite dataset.
93 // dataSetIndex is used to rank the leaf nodes in an inorder traversal.
95 const char* filePath, unsigned int& dataSetIndex) override;
96
97 // Reads file version < 1.0.
98 virtual void ReadVersion0(vtkXMLDataElement* element, vtkCompositeDataSet* composite,
99 const char* filePath, unsigned int& dataSetIndex);
100
102
106 void CreateMetaData(vtkXMLDataElement* ePrimary) override;
107
113 const std::string& filePath) override;
114
115private:
117 void operator=(const vtkXMLMultiBlockDataReader&) = delete;
118
119 virtual int FillMetaData(vtkCompositeDataSet* composite, vtkXMLDataElement* element);
120
121 void ReadCompositeInternal(vtkXMLDataElement* element, vtkCompositeDataSet* composite,
122 const char* filePath, unsigned int& dataSetIndex, unsigned int& compositeIndex);
123
124 bool IsBlockSelected(unsigned int compositeIndex);
125
126 int AssemblyTag = 0;
128 std::set<std::string> Selectors;
129 std::vector<unsigned int> SelectedCompositeIds;
130 bool DistributePiecesInMultiPieces;
131};
132
133VTK_ABI_NAMESPACE_END
134#endif
abstract superclass for composite (multi-block or AMR) datasets
hierarchical representation to use with vtkPartitionedDataSetCollection
a simple class to control print indentation
Definition vtkIndent.h:29
Store vtkAlgorithm input/output information.
Allocate and hold a VTK object.
Definition vtkNew.h:59
Represents an XML element and those nested inside.
void SetSelector(const char *selector)
API to set selectors.
void ReadComposite(vtkXMLDataElement *element, vtkCompositeDataSet *composite, const char *filePath, unsigned int &dataSetIndex) override
static vtkXMLMultiBlockDataReader * New()
int GetNumberOfSelectors() const
API to access selectors.
void ClearSelectors()
API to set selectors.
vtkGetNewMacro(Assembly, vtkDataAssembly)
Get the data full data assembly associated with the input.
void SyncCompositeDataArraySelections(vtkCompositeDataSet *composite, vtkXMLDataElement *element, const std::string &filePath) override
Recursively synchronize the data array selection of the reader for the file specified in the XML elem...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
const char * GetSelector(int index) const
API to access selectors.
bool AddSelector(const char *selector)
API to set selectors.
void PrepareToCreateMetaData(vtkXMLDataElement *ePrimary) override
Prepare to create the meta-data from the composite dataset from the file.
void CreateMetaData(vtkXMLDataElement *ePrimary) override
Read the meta-data from the Multiblock from the file.
int FillOutputPortInformation(int, vtkInformation *info) override
~vtkXMLMultiBlockDataReader() override
const char * GetDataSetName() override
Get the name of the data set being read.
virtual void ReadVersion0(vtkXMLDataElement *element, vtkCompositeDataSet *composite, const char *filePath, unsigned int &dataSetIndex)