VTK  9.6.20260415
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
42
43#ifndef vtkXMLMultiBlockDataReader_h
44#define vtkXMLMultiBlockDataReader_h
45
46#include "vtkIOXMLModule.h" // For export macro
48
49#include <set> // For std::set
50#include <vector> // For std::vector
51
52VTK_ABI_NAMESPACE_BEGIN
53class vtkDataAssembly;
54
56{
57public:
60 void PrintSelf(ostream& os, vtkIndent indent) override;
61
66
74 vtkGetMacro(AssemblyTag, int);
75
77
89 bool AddSelector(const char* selector);
91 void SetSelector(const char* selector);
93
95
99 const char* GetSelector(int index) const;
101
102protected:
105
106 // Get the name of the data set being read.
107 const char* GetDataSetName() override;
108
110
111 // Read the XML element for the subtree of a composite dataset.
112 // dataSetIndex is used to rank the leaf nodes in an inorder traversal.
114 const char* filePath, unsigned int& dataSetIndex) override;
115
116 // Reads file version < 1.0.
117 virtual void ReadVersion0(vtkXMLDataElement* element, vtkCompositeDataSet* composite,
118 const char* filePath, unsigned int& dataSetIndex);
119
121
125 void CreateMetaData(vtkXMLDataElement* ePrimary) override;
126
132 const std::string& filePath) override;
133
134private:
136 void operator=(const vtkXMLMultiBlockDataReader&) = delete;
137
138 virtual int FillMetaData(vtkCompositeDataSet* composite, vtkXMLDataElement* element);
139
140 void ReadCompositeInternal(vtkXMLDataElement* element, vtkCompositeDataSet* composite,
141 const char* filePath, unsigned int& dataSetIndex, unsigned int& compositeIndex);
142
143 bool IsBlockSelected(unsigned int compositeIndex);
144
145 int AssemblyTag = 0;
147 std::set<std::string> Selectors;
148 std::vector<unsigned int> SelectedCompositeIds;
149 bool DistributePiecesInMultiPieces;
150};
151
152VTK_ABI_NAMESPACE_END
153#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:108
Store vtkAlgorithm input/output information.
Allocate and hold a VTK object.
Definition vtkNew.h:168
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
Fill the output port information objects for this algorithm.
~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)