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 =========================================================================*/
28 #ifndef vtkXMLCompositeDataReader_h
29 #define vtkXMLCompositeDataReader_h
30 
31 #include "vtkIOXMLModule.h" // For export macro
32 #include "vtkXMLReader.h"
33 
37 //BTX
38 struct vtkXMLCompositeDataReaderInternals;
39 //ETX
40 
42 {
43 public:
45  void PrintSelf(ostream& os, vtkIndent indent);
46 
48 
49  vtkCompositeDataSet* GetOutput();
50  vtkCompositeDataSet* GetOutput(int);
52 
53 protected:
56 
57  // Get the name of the data set being read.
58  virtual const char* GetDataSetName();
59 
60  // Returns the primary element pass to ReadPrimaryElement().
61  vtkXMLDataElement* GetPrimaryElement();
62 
63  virtual void ReadXMLData();
64  virtual int ReadPrimaryElement(vtkXMLDataElement* ePrimary);
65 
66  // Setup the output with no data available. Used in error cases.
67  virtual void SetupEmptyOutput();
68 
70 
71  // Create a default executive.
73 
74  vtkXMLReader* GetReaderOfType(const char* type);
75 
79 
80 
81 
82  // Adds a child data object to the composite parent. childXML is the XML for
83  // the child data object need to obtain certain meta-data about the child.
84  void AddChild(vtkCompositeDataSet* parent,
85  vtkDataObject* child, vtkXMLDataElement* childXML);
86 
87  // Read the XML element for the subtree of a the composite dataset.
88  // dataSetIndex is used to rank the leaf nodes in an inorder traversal.
89  virtual void ReadComposite(vtkXMLDataElement* element,
90  vtkCompositeDataSet* composite, const char* filePath,
91  unsigned int &dataSetIndex)=0;
92 
93  // Read the vtkDataSet (a leaf) in the composite dataset.
94  virtual vtkDataSet* ReadDataset(vtkXMLDataElement* xmlElem, const char* filePath);
95 
96  // Counts "DataSet" elements in the subtree.
97  unsigned int CountLeaves(vtkXMLDataElement* elem);
98 
101  int ShouldReadDataSet(unsigned int datasetIndex);
102 
103 private:
104  vtkXMLCompositeDataReader(const vtkXMLCompositeDataReader&); // Not implemented.
105  void operator=(const vtkXMLCompositeDataReader&); // Not implemented.
106 
107  vtkXMLCompositeDataReaderInternals* Internal;
108 };
109 
110 #endif
virtual const char * GetDataSetName()=0
virtual void SetupEmptyOutput()=0
Represents an XML element and those nested inside.
void PrintSelf(ostream &os, vtkIndent indent)
virtual vtkExecutive * CreateDefaultExecutive()
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:61
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:51
abstract superclass for composite (multi-block or AMR) datasets
virtual int FillOutputPortInformation(int port, vtkInformation *info)
a simple class to control print indentation
Definition: vtkIndent.h:38
#define VTKIOXML_EXPORT
Key for integer values in vtkInformation.
virtual int ReadPrimaryElement(vtkXMLDataElement *ePrimary)
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:41