VTK  9.7.1
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
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 
33 VTK_ABI_NAMESPACE_BEGIN
34 class vtkDataAssembly;
35 
37 {
38 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
46  vtkGetNewMacro(Assembly, vtkDataAssembly);
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 
83 protected:
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.
89  void ReadComposite(vtkXMLDataElement* element, vtkCompositeDataSet* composite,
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 
123 private:
126  void operator=(const vtkXMLPartitionedDataSetCollectionReader&) = delete;
127 
128  int AssemblyTag = 0;
129  vtkNew<vtkDataAssembly> Assembly;
130  std::set<std::string> Selectors;
131  std::vector<unsigned int> SelectedCompositeIds;
132 };
133 
134 VTK_ABI_NAMESPACE_END
135 #endif
Represents an XML element and those nested inside.
Store vtkAlgorithm input/output information.
Reader for multi-group datasets.
virtual void SyncCompositeDataArraySelections(vtkCompositeDataSet *composite, vtkXMLDataElement *element, const std::string &filePath)=0
Recursively synchronize the data array selection of the reader for the file specified in the XML elem...
abstract superclass for composite (multi-block or AMR) datasets
const char * GetDataSetName() override
Get the name of the data set being read.
a simple class to control print indentation
Definition: vtkIndent.h:28
int FillOutputPortInformation(int, vtkInformation *info) override
Fill the output port information objects for this algorithm.
virtual void ReadComposite(vtkXMLDataElement *element, vtkCompositeDataSet *composite, const char *filePath, unsigned int &dataSetIndex)=0
static vtkAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
hierarchical representation to use with vtkPartitionedDataSetCollection
general representation of visualization data
Definition: vtkDataObject.h:55
virtual void CreateMetaData(vtkXMLDataElement *ePrimary)=0
Create the meta-data from the composite dataset from the file.