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 "vtkPVVTKExtensionsIOCoreModule.h" //needed for exports
33 #include "vtkXMLReader.h"
34 
35 class vtkXMLCollectionReaderInternals;
36 
38 {
39 public:
40  static vtkXMLCollectionReader* New();
42  void PrintSelf(ostream& os, vtkIndent indent) override;
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:
131  ~vtkXMLCollectionReader() override;
132 
133  void BuildRestrictedDataSets();
134 
137 
138  // Get the name of the data set being read.
139  const char* GetDataSetName() override;
140 
141  int ReadPrimaryElement(vtkXMLDataElement* ePrimary) override;
142  int FillOutputPortInformation(int, vtkInformation* info) override;
143 
144  vtkDataObject* SetupOutput(const std::string& filePath, int index);
145 
149  vtkXMLReader* SetupReader(const std::string& filePath, int index);
150 
151  int RequestDataObject(vtkInformation* request, vtkInformationVector** inputVector,
152  vtkInformationVector* outputVector) override;
153 
154  // Overload of vtkXMLReader function, so we can handle updating the
155  // information on multiple outputs
156  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
157  vtkInformationVector* outputVector) override;
158 
159  // Setup the output with no data available. Used in error cases.
160  void SetupEmptyOutput() override;
161 
162  void ReadXMLData() override;
163  void ReadXMLDataImpl();
164 
165  // Progress callback from XMLParser.
166  virtual void InternalProgressCallback();
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 
183  void FillArraySelectionUsingReaders(const std::string& filePath);
184 
185 private:
187  void operator=(const vtkXMLCollectionReader&) = delete;
188 
189  int CurrentOutput;
190 };
191 
192 #endif
virtual const char * GetDataSetName()=0
virtual void SetupEmptyOutput()=0
void PrintSelf(ostream &os, vtkIndent indent)
#define VTKPVVTKEXTENSIONSIOCORE_EXPORT
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
virtual void ReadXMLData()
Read a file wrapping many other XML files.
virtual int FillOutputPortInformation(int port, vtkInformation *info)
vtkXMLCollectionReaderInternals * Internal
virtual int ReadPrimaryElement(vtkXMLDataElement *ePrimary)
virtual int RequestDataObject(vtkInformation *vtkNotUsed(request), vtkInformationVector **vtkNotUsed(inputVector), vtkInformationVector *vtkNotUsed(outputVector))
static vtkAlgorithm * New()
void operator=(const vtkObjectBase &)