• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

dox/IO/vtkXMLCompositeDataReader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   ParaView
00004   Module:    $RCSfile: vtkXMLCompositeDataReader.h,v $
00005 
00006   Copyright (c) Kitware, Inc.
00007   All rights reserved.
00008   See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00028 #ifndef __vtkXMLCompositeDataReader_h
00029 #define __vtkXMLCompositeDataReader_h
00030 
00031 #include "vtkXMLReader.h"
00032 
00033 class vtkCompositeDataSet;
00034 //BTX
00035 struct vtkXMLCompositeDataReaderInternals;
00036 //ETX
00037 
00038 class VTK_IO_EXPORT vtkXMLCompositeDataReader : public vtkXMLReader
00039 {
00040 public:
00041   vtkTypeRevisionMacro(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   // Get the name of the data set being read.
00055   virtual const char* GetDataSetName();
00056 
00057   // Returns the primary element pass to ReadPrimaryElement().
00058   vtkXMLDataElement* GetPrimaryElement();
00059 
00060   virtual void ReadXMLData();
00061   virtual int ReadPrimaryElement(vtkXMLDataElement* ePrimary);
00062 
00063   // Setup the output with no data available.  Used in error cases.
00064   virtual void SetupEmptyOutput();
00065 
00066   virtual int FillOutputPortInformation(int, vtkInformation* info);
00067 
00068   // Create a default executive.
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   // Adds a child data object to the composite parent. childXML is the XML for
00080   // the child data object need to obtain certain meta-data about the child.
00081   void AddChild(vtkCompositeDataSet* parent, 
00082     vtkDataObject* child, vtkXMLDataElement* childXML);
00083 
00084   // Read the XML element for the subtree of a the composite dataset.
00085   // dataSetIndex is used to rank the leaf nodes in an inorder traversal.
00086   virtual void ReadComposite(vtkXMLDataElement* element, 
00087     vtkCompositeDataSet* composite, const char* filePath, 
00088     unsigned int &dataSetIndex)=0;
00089 
00090   // Read the vtkDataSet (a leaf) in the composite dataset.
00091   virtual vtkDataSet* ReadDataset(vtkXMLDataElement* xmlElem, const char* filePath);
00092 
00093   // Counts "DataSet" elements in the subtree.
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&);  // Not implemented.
00114   void operator=(const vtkXMLCompositeDataReader&);  // Not implemented.
00115 
00116   vtkXMLCompositeDataReaderInternals* Internal;
00117 };
00118 
00119 #endif

Generated by  doxygen 1.7.1