VTK  9.7.20261008
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
47#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
49
50#include <set> // For std::set
51#include <vector> // For std::vector
52
53VTK_ABI_NAMESPACE_BEGIN
54class vtkDataAssembly;
55
57{
58public:
61 void PrintSelf(ostream& os, vtkIndent indent) override;
62
67
75 vtkGetMacro(AssemblyTag, int);
76
78
90 bool AddSelector(const char* selector);
92 void SetSelector(const char* selector);
94
96
100 const char* GetSelector(int index) const;
102
103protected:
106
107 // Get the name of the data set being read.
108 const char* GetDataSetName() override;
109
111
112 // Read the XML element for the subtree of a composite dataset.
113 // dataSetIndex is used to rank the leaf nodes in an inorder traversal.
115 const char* filePath, unsigned int& dataSetIndex) override;
116
117 // Reads file version < 1.0.
118 virtual void ReadVersion0(vtkXMLDataElement* element, vtkCompositeDataSet* composite,
119 const char* filePath, unsigned int& dataSetIndex);
120
122
126 void CreateMetaData(vtkXMLDataElement* ePrimary) override;
127
133 const std::string& filePath) override;
134
135private:
137 void operator=(const vtkXMLMultiBlockDataReader&) = delete;
138
139 virtual int FillMetaData(vtkCompositeDataSet* composite, vtkXMLDataElement* element);
140
141 void ReadCompositeInternal(vtkXMLDataElement* element, vtkCompositeDataSet* composite,
142 const char* filePath, unsigned int& dataSetIndex, unsigned int& compositeIndex);
143
144 bool IsBlockSelected(unsigned int compositeIndex);
145
146 int AssemblyTag = 0;
148 std::set<std::string> Selectors;
149 std::vector<unsigned int> SelectedCompositeIds;
150 bool DistributePiecesInMultiPieces;
151};
152
153VTK_ABI_NAMESPACE_END
154#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)
#define VTK_MARSHALAUTO