VTK
dox/IO/XML/vtkXMLUniformGridAMRReader.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   ParaView
00004   Module:    vtkXMLUniformGridAMRReader.h
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 =========================================================================*/
00033 #ifndef __vtkXMLUniformGridAMRReader_h
00034 #define __vtkXMLUniformGridAMRReader_h
00035 
00036 #include "vtkIOXMLModule.h" // For export macro
00037 #include "vtkXMLCompositeDataReader.h"
00038 #include "vtkSmartPointer.h" // needed for vtkSmartPointer.
00039 
00040 class vtkOverlappingAMR;
00041 class vtkUniformGridAMR;
00042 
00043 class VTKIOXML_EXPORT vtkXMLUniformGridAMRReader :
00044   public vtkXMLCompositeDataReader
00045 {
00046 public:
00047   static vtkXMLUniformGridAMRReader* New();
00048   vtkTypeMacro(vtkXMLUniformGridAMRReader,vtkXMLCompositeDataReader);
00049   void PrintSelf(ostream& os, vtkIndent indent);
00050 
00052 
00059   vtkSetMacro(MaximumLevelsToReadByDefault, unsigned int);
00060   vtkGetMacro(MaximumLevelsToReadByDefault, unsigned int);
00062 
00063 protected:
00064   vtkXMLUniformGridAMRReader();
00065   ~vtkXMLUniformGridAMRReader();
00066 
00067   // Test if the reader can read a file with the given version number.
00068   virtual int CanReadFileVersion(int major, int minor)
00069     {
00070     return (major == 1 && minor == 1)? 1 : 0;
00071     }
00072 
00077   virtual int CanReadFileWithDataType(const char* dsname);
00078 
00082   virtual int ReadVTKFile(vtkXMLDataElement* eVTKFile);
00083 
00088   virtual int ReadPrimaryElement(vtkXMLDataElement* ePrimary);
00089 
00091 
00094   virtual int RequestDataObject(vtkInformation *request,
00095     vtkInformationVector **inputVector, vtkInformationVector *outputVector);
00097 
00099 
00101   virtual int RequestInformation(vtkInformation *request,
00102     vtkInformationVector **inputVector, vtkInformationVector *outputVector);
00104 
00105   // Get the name of the data set being read.
00106   virtual const char* GetDataSetName();
00107 
00108   // Read the XML element for the subtree of a the composite dataset.
00109   // dataSetIndex is used to rank the leaf nodes in an inorder traversal.
00110   virtual void ReadComposite(vtkXMLDataElement* element,
00111     vtkCompositeDataSet* composite, const char* filePath,
00112     unsigned int &dataSetIndex);
00113 
00114   // Read the vtkDataSet (a leaf) in the composite dataset.
00115   virtual vtkDataSet* ReadDataset(vtkXMLDataElement* xmlElem, const char* filePath);
00116 
00117   vtkSmartPointer<vtkOverlappingAMR> Metadata;
00118   unsigned int MaximumLevelsToReadByDefault;
00119 
00120 private:
00121   vtkXMLUniformGridAMRReader(const vtkXMLUniformGridAMRReader&);  // Not implemented.
00122   void operator=(const vtkXMLUniformGridAMRReader&);  // Not implemented.
00123 
00124   char* OutputDataType;
00125   vtkSetStringMacro(OutputDataType);
00126 };
00127 
00128 #endif