VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/IO/XML/vtkXMLPolyDataReader.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkXMLPolyDataReader.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm 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 =========================================================================*/
00034 #ifndef vtkXMLPolyDataReader_h
00035 #define vtkXMLPolyDataReader_h
00036 
00037 #include "vtkIOXMLModule.h" // For export macro
00038 #include "vtkXMLUnstructuredDataReader.h"
00039 
00040 class vtkPolyData;
00041 
00042 class VTKIOXML_EXPORT vtkXMLPolyDataReader : public vtkXMLUnstructuredDataReader
00043 {
00044 public:
00045   vtkTypeMacro(vtkXMLPolyDataReader,vtkXMLUnstructuredDataReader);
00046   void PrintSelf(ostream& os, vtkIndent indent);
00047   static vtkXMLPolyDataReader *New();
00048 
00050 
00051   vtkPolyData *GetOutput();
00052   vtkPolyData *GetOutput(int idx);
00054 
00056 
00057   virtual vtkIdType GetNumberOfVerts();
00058   virtual vtkIdType GetNumberOfLines();
00059   virtual vtkIdType GetNumberOfStrips();
00060   virtual vtkIdType GetNumberOfPolys();
00062 
00063 protected:
00064   vtkXMLPolyDataReader();
00065   ~vtkXMLPolyDataReader();
00066 
00067   const char* GetDataSetName();
00068   void GetOutputUpdateExtent(int& piece, int& numberOfPieces, int& ghostLevel);
00069   void SetupOutputTotals();
00070   void SetupNextPiece();
00071   void SetupPieces(int numPieces);
00072   void DestroyPieces();
00073 
00074   void SetupOutputData();
00075   int ReadPiece(vtkXMLDataElement* ePiece);
00076   int ReadPieceData();
00077 
00078   // Read a data array whose tuples coorrespond to cells.
00079   virtual int ReadArrayForCells(vtkXMLDataElement* da,
00080     vtkAbstractArray* outArray);
00081 
00082   // Get the number of cells in the given piece.  Valid after
00083   // UpdateInformation.
00084   virtual vtkIdType GetNumberOfCellsInPiece(int piece);
00085 
00086   virtual int FillOutputPortInformation(int, vtkInformation*);
00087 
00088   // The size of the UpdatePiece.
00089   int TotalNumberOfVerts;
00090   int TotalNumberOfLines;
00091   int TotalNumberOfStrips;
00092   int TotalNumberOfPolys;
00093   vtkIdType StartVert;
00094   vtkIdType StartLine;
00095   vtkIdType StartStrip;
00096   vtkIdType StartPoly;
00097 
00098   // The cell elements for each piece.
00099   vtkXMLDataElement** VertElements;
00100   vtkXMLDataElement** LineElements;
00101   vtkXMLDataElement** StripElements;
00102   vtkXMLDataElement** PolyElements;
00103   vtkIdType* NumberOfVerts;
00104   vtkIdType* NumberOfLines;
00105   vtkIdType* NumberOfStrips;
00106   vtkIdType* NumberOfPolys;
00107 
00108   // For TimeStep support
00109   int VertsTimeStep;
00110   unsigned long VertsOffset;
00111   int LinesTimeStep;
00112   unsigned long LinesOffset;
00113   int StripsTimeStep;
00114   unsigned long StripsOffset;
00115   int PolysTimeStep;
00116   unsigned long PolysOffset;
00117 
00118 private:
00119   vtkXMLPolyDataReader(const vtkXMLPolyDataReader&);  // Not implemented.
00120   void operator=(const vtkXMLPolyDataReader&);  // Not implemented.
00121 };
00122 
00123 #endif