ParaView
vtkXMLCollectionReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkXMLCollectionReader.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 vtkXMLCollectionReader_h
30 #define vtkXMLCollectionReader_h
31 
32 #include "vtkPVVTKExtensionsDefaultModule.h" //needed for exports
33 #include "vtkXMLReader.h"
34 
35 class vtkXMLCollectionReaderInternals;
36 
37 class VTKPVVTKEXTENSIONSDEFAULT_EXPORT vtkXMLCollectionReader : public vtkXMLReader
38 {
39 public:
40  static vtkXMLCollectionReader* New();
41  vtkTypeMacro(vtkXMLCollectionReader, vtkXMLReader);
42  void PrintSelf(ostream& os, vtkIndent indent);
43 
45 
51  virtual void SetRestriction(const char* name, const char* value);
52  virtual const char* GetRestriction(const char* name);
54 
56 
63  virtual void SetRestrictionAsIndex(const char* name, int index);
64  virtual int GetRestrictionAsIndex(const char* name);
66 
71  int GetNumberOfAttributes();
72 
78  const char* GetAttributeName(int attribute);
79 
84  int GetAttributeIndex(const char* name);
85 
89  int GetNumberOfAttributeValues(int attribute);
90 
92 
98  const char* GetAttributeValue(int attribute, int index);
99  const char* GetAttributeValue(const char* name, int index);
101 
103 
107  int GetAttributeValueIndex(int attribute, const char* value);
108  int GetAttributeValueIndex(const char* name, const char* value);
110 
117  vtkXMLDataElement* GetOutputXMLDataElement(int index);
118 
120 
124  vtkSetMacro(ForceOutputTypeToMultiBlock, int);
125  vtkGetMacro(ForceOutputTypeToMultiBlock, int);
126  vtkBooleanMacro(ForceOutputTypeToMultiBlock, int);
128 
129 protected:
132 
133  void BuildRestrictedDataSets();
134 
137 
138  // Get the name of the data set being read.
139  virtual const char* GetDataSetName();
140 
141  virtual int ReadPrimaryElement(vtkXMLDataElement* ePrimary);
142  virtual int FillOutputPortInformation(int, vtkInformation* info);
143 
144  vtkDataObject* SetupOutput(const char* filePath, int index);
145 
146  virtual int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector,
147  vtkInformationVector* outputVector);
148 
149  // Overload of vtkXMLReader function, so we can handle updating the
150  // information on multiple outputs
151  virtual int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
152  vtkInformationVector* outputVector);
153 
154  // Setup the output with no data available. Used in error cases.
155  virtual void SetupEmptyOutput();
156 
157  void ReadXMLData();
158  void ReadXMLDataImpl();
159 
160  // Callback registered with the InternalProgressObserver.
161  static void InternalProgressCallbackFunction(vtkObject*, unsigned long, void*, void*);
162  // Progress callback from XMLParser.
163  virtual void InternalProgressCallback();
164 
165  // The observer to report progress from the internal readers.
166  vtkCallbackCommand* InternalProgressObserver;
167 
168  // Internal implementation details.
169  vtkXMLCollectionReaderInternals* Internal;
170 
171  void AddAttributeNameValue(const char* name, const char* value);
172 
173  virtual void SetRestrictionImpl(const char* name, const char* value, bool doModify);
174 
175  void ReadAFile(int index, int updatePiece, int updateNumPieces, int updateGhostLevels,
176  vtkDataObject* actualOutput);
177 
178 private:
179  vtkXMLCollectionReader(const vtkXMLCollectionReader&) VTK_DELETE_FUNCTION;
180  void operator=(const vtkXMLCollectionReader&) VTK_DELETE_FUNCTION;
181 
182  int CurrentOutput;
183 };
184 
185 #endif
Read a file wrapping many other XML files.
vtkXMLCollectionReaderInternals * Internal
vtkCallbackCommand * InternalProgressObserver