VTK
vtkXMLCompositeDataReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkXMLCompositeDataReader.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
29 #ifndef vtkXMLCompositeDataReader_h
30 #define vtkXMLCompositeDataReader_h
31 
32 #include "vtkIOXMLModule.h" // For export macro
33 #include "vtkXMLReader.h"
34 
38 
39 struct vtkXMLCompositeDataReaderInternals;
40 
41 class VTKIOXML_EXPORT vtkXMLCompositeDataReader : public vtkXMLReader
42 {
43 public:
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
47  enum
48  {
50  Interleave
51  };
52 
65  vtkSetClampMacro(PieceDistribution, int, Block, Interleave)
66  vtkGetMacro(PieceDistribution, int)
73  vtkCompositeDataSet* GetOutput();
74  vtkCompositeDataSet* GetOutput(int);
76 
77 protected:
79  ~vtkXMLCompositeDataReader() override;
80 
81  // Get the name of the data set being read.
82  const char* GetDataSetName() override;
83 
84  // Returns the primary element pass to ReadPrimaryElement().
85  vtkXMLDataElement* GetPrimaryElement();
86 
87  void ReadXMLData() override;
88  int ReadPrimaryElement(vtkXMLDataElement* ePrimary) override;
89 
90  // Setup the output with no data available. Used in error cases.
91  void SetupEmptyOutput() override;
92 
93  int FillOutputPortInformation(int, vtkInformation* info) override;
94 
95  // Create a default executive.
97 
98  vtkXMLReader* GetReaderOfType(const char* type);
99 
102  vtkInformationVector*) override;
103 
104 
105 
106  // Adds a child data object to the composite parent. childXML is the XML for
107  // the child data object need to obtain certain meta-data about the child.
108  void AddChild(vtkCompositeDataSet* parent,
109  vtkDataObject* child, vtkXMLDataElement* childXML);
110 
111  // Read the XML element for the subtree of a the composite dataset.
112  // dataSetIndex is used to rank the leaf nodes in an inorder traversal.
113  virtual void ReadComposite(vtkXMLDataElement* element,
114  vtkCompositeDataSet* composite, const char* filePath,
115  unsigned int &dataSetIndex)=0;
116 
117  // Read the vtkDataSet (a leaf) in the composite dataset.
118  virtual vtkDataSet* ReadDataset(vtkXMLDataElement* xmlElem, const char* filePath);
119 
120  // Read the vtkDataObject (a leaf) in the composite dataset.
121  virtual vtkDataObject* ReadDataObject(vtkXMLDataElement* xmlElem, const char* filePath);
122 
123  // Counts "DataSet" elements in the subtree.
124  unsigned int CountLeaves(vtkXMLDataElement* elem);
125 
130  int ShouldReadDataSet(unsigned int datasetIndex);
131 
132  bool DataSetIsValidForBlockStrategy(unsigned int datasetIndex);
133  bool DataSetIsValidForInterleaveStrategy(unsigned int datasetIndex);
134 
135 private:
137  void operator=(const vtkXMLCompositeDataReader&) = delete;
138 
139  int PieceDistribution;
140 
141  vtkXMLCompositeDataReaderInternals* Internal;
142 };
143 
144 #endif
virtual const char * GetDataSetName()=0
virtual void SetupEmptyOutput()=0
Represents an XML element and those nested inside.
virtual vtkExecutive * CreateDefaultExecutive()
Create a default executive.
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
Reader for multi-group datasets.
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
virtual void ReadXMLData()
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:49
abstract superclass for composite (multi-block or AMR) datasets
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Fill the output port information objects for this algorithm.
a simple class to control print indentation
Definition: vtkIndent.h:39
Key for integer values in vtkInformation.
virtual int ReadPrimaryElement(vtkXMLDataElement *ePrimary)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Store zero or more vtkInformation instances.
general representation of visualization data
Definition: vtkDataObject.h:64
Superclass for VTK's XML format readers.
Definition: vtkXMLReader.h:43