00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00028 #ifndef __vtkXMLCompositeDataReader_h
00029 #define __vtkXMLCompositeDataReader_h
00030
00031 #include "vtkXMLReader.h"
00032
00033 class vtkCompositeDataSet;
00034
00035 struct vtkXMLCompositeDataReaderInternals;
00036
00037
00038 class VTK_IO_EXPORT vtkXMLCompositeDataReader : public vtkXMLReader
00039 {
00040 public:
00041 vtkTypeMacro(vtkXMLCompositeDataReader,vtkXMLReader);
00042 void PrintSelf(ostream& os, vtkIndent indent);
00043
00045
00046 vtkCompositeDataSet* GetOutput();
00047 vtkCompositeDataSet* GetOutput(int);
00049
00050 protected:
00051 vtkXMLCompositeDataReader();
00052 ~vtkXMLCompositeDataReader();
00053
00054
00055 virtual const char* GetDataSetName();
00056
00057
00058 vtkXMLDataElement* GetPrimaryElement();
00059
00060 virtual void ReadXMLData();
00061 virtual int ReadPrimaryElement(vtkXMLDataElement* ePrimary);
00062
00063
00064 virtual void SetupEmptyOutput();
00065
00066 virtual int FillOutputPortInformation(int, vtkInformation* info);
00067
00068
00069 virtual vtkExecutive* CreateDefaultExecutive();
00070
00071 vtkXMLReader* GetReaderOfType(const char* type);
00072
00073 virtual int RequestInformation(vtkInformation*,
00074 vtkInformationVector**,
00075 vtkInformationVector*);
00076
00077
00078
00079
00080
00081 void AddChild(vtkCompositeDataSet* parent,
00082 vtkDataObject* child, vtkXMLDataElement* childXML);
00083
00084
00085
00086 virtual void ReadComposite(vtkXMLDataElement* element,
00087 vtkCompositeDataSet* composite, const char* filePath,
00088 unsigned int &dataSetIndex)=0;
00089
00090
00091 virtual vtkDataSet* ReadDataset(vtkXMLDataElement* xmlElem, const char* filePath);
00092
00093
00094 unsigned int CountLeaves(vtkXMLDataElement* elem);
00095
00098 int ShouldReadDataSet(unsigned int datasetIndex);
00099
00101
00102 virtual int CanReadFileVersion(int major, int vtkNotUsed(minor))
00103 {
00104 if (major > 1)
00105 {
00106 return 0;
00107 }
00108 return 1;
00109 }
00111
00112 private:
00113 vtkXMLCompositeDataReader(const vtkXMLCompositeDataReader&);
00114 void operator=(const vtkXMLCompositeDataReader&);
00115
00116 vtkXMLCompositeDataReaderInternals* Internal;
00117 };
00118
00119 #endif