VTK  9.6.20260422
vtkXMLPartitionedDataSetCollectionReader.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 vtkXMLPartitionedDataSetCollectionReader_h
25#define vtkXMLPartitionedDataSetCollectionReader_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 virtual bool AddSelector(const char* selector);
71 virtual void ClearSelectors();
72 virtual void SetSelector(const char* selector);
74
76
79 virtual int GetNumberOfSelectors() const;
80 virtual const char* GetSelector(int index) const;
82
83protected:
86
87 // Read the XML element for the subtree of a composite dataset.
88 // dataSetIndex is used to rank the leaf nodes in an inorder traversal.
90 const char* filePath, unsigned int& dataSetIndex) override;
91
92 // Get the name of the data set being read.
93 const char* GetDataSetName() override;
94
95 int FillOutputPortInformation(int, vtkInformation* info) override;
96
97 virtual const char* GetXMLPartitionsName() { return "Partitions"; }
98
99 virtual const char* GetXMLPartitionIndexName() { return "index"; }
100
104 void CreateMetaData(vtkXMLDataElement* ePrimary) override;
105
111 const std::string& filePath) override;
112
116 virtual bool IsBlockSelected(unsigned int compositeIndex);
117
121 virtual bool CanReadDataObject(vtkDataObject* dataObject);
122
123private:
126 void operator=(const vtkXMLPartitionedDataSetCollectionReader&) = delete;
127
128 int AssemblyTag = 0;
130 std::set<std::string> Selectors;
131 std::vector<unsigned int> SelectedCompositeIds;
132};
133
134VTK_ABI_NAMESPACE_END
135#endif
abstract superclass for composite (multi-block or AMR) datasets
hierarchical representation to use with vtkPartitionedDataSetCollection
general representation of visualization data
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 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...
virtual int GetNumberOfSelectors() const
API to access selectors.
virtual bool AddSelector(const char *selector)
API to set selectors.
const char * GetDataSetName() override
Get the name of the data set being read.
int FillOutputPortInformation(int, vtkInformation *info) override
Fill the output port information objects for this algorithm.
void ReadComposite(vtkXMLDataElement *element, vtkCompositeDataSet *composite, const char *filePath, unsigned int &dataSetIndex) override
virtual void SetSelector(const char *selector)
API to set selectors.
virtual const char * GetSelector(int index) const
API to access selectors.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void CreateMetaData(vtkXMLDataElement *ePrimary) override
Create the meta-data from the partitioned dataset collection from the file.
virtual bool CanReadDataObject(vtkDataObject *dataObject)
Given the data object class, return whether it is allowed.
vtkGetNewMacro(Assembly, vtkDataAssembly)
Get the data full data assembly associated with the input.
virtual void ClearSelectors()
API to set selectors.
virtual bool IsBlockSelected(unsigned int compositeIndex)
Given the composite id, this method tells if the block should be read.
static vtkXMLPartitionedDataSetCollectionReader * New()