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);
46 
48 
51  vtkCompositeDataSet* GetOutput();
52  vtkCompositeDataSet* GetOutput(int);
54 
55 protected:
58 
59  // Get the name of the data set being read.
60  virtual const char* GetDataSetName();
61 
62  // Returns the primary element pass to ReadPrimaryElement().
63  vtkXMLDataElement* GetPrimaryElement();
64 
65  virtual void ReadXMLData();
66  virtual int ReadPrimaryElement(vtkXMLDataElement* ePrimary);
67 
68  // Setup the output with no data available. Used in error cases.
69  virtual void SetupEmptyOutput();
70 
72 
73  // Create a default executive.
75 
76  vtkXMLReader* GetReaderOfType(const char* type);
77 
81 
82 
83 
84  // Adds a child data object to the composite parent. childXML is the XML for
85  // the child data object need to obtain certain meta-data about the child.
86  void AddChild(vtkCompositeDataSet* parent,
87  vtkDataObject* child, vtkXMLDataElement* childXML);
88 
89  // Read the XML element for the subtree of a the composite dataset.
90  // dataSetIndex is used to rank the leaf nodes in an inorder traversal.
91  virtual void ReadComposite(vtkXMLDataElement* element,
92  vtkCompositeDataSet* composite, const char* filePath,
93  unsigned int &dataSetIndex)=0;
94 
95  // Read the vtkDataSet (a leaf) in the composite dataset.
96  virtual vtkDataSet* ReadDataset(vtkXMLDataElement* xmlElem, const char* filePath);
97 
98  // Counts "DataSet" elements in the subtree.
99  unsigned int CountLeaves(vtkXMLDataElement* elem);
100 
105  int ShouldReadDataSet(unsigned int datasetIndex);
106 
107 private:
108  vtkXMLCompositeDataReader(const vtkXMLCompositeDataReader&) VTK_DELETE_FUNCTION;
109  void operator=(const vtkXMLCompositeDataReader&) VTK_DELETE_FUNCTION;
110 
111  vtkXMLCompositeDataReaderInternals* Internal;
112 };
113 
114 #endif
virtual const char * GetDataSetName()=0
virtual void SetupEmptyOutput()=0
Represents an XML element and those nested inside.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
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)
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