00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkXMLPUnstructuredDataReader.h,v $ 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 =========================================================================*/ 00025 #ifndef __vtkXMLPUnstructuredDataReader_h 00026 #define __vtkXMLPUnstructuredDataReader_h 00027 00028 #include "vtkXMLPDataReader.h" 00029 00030 class vtkPointSet; 00031 class vtkCellArray; 00032 class vtkXMLUnstructuredDataReader; 00033 00034 class VTK_IO_EXPORT vtkXMLPUnstructuredDataReader : public vtkXMLPDataReader 00035 { 00036 public: 00037 vtkTypeRevisionMacro(vtkXMLPUnstructuredDataReader,vtkXMLPDataReader); 00038 void PrintSelf(ostream& os, vtkIndent indent); 00039 00040 protected: 00041 vtkXMLPUnstructuredDataReader(); 00042 ~vtkXMLPUnstructuredDataReader(); 00043 00044 vtkPointSet* GetOutputAsPointSet(); 00045 vtkPointSet* GetPieceInputAsPointSet(int piece); 00046 virtual void SetupOutputTotals(); 00047 virtual void SetupNextPiece(); 00048 vtkIdType GetNumberOfPoints(); 00049 vtkIdType GetNumberOfCells(); 00050 void CopyArrayForPoints(vtkDataArray* inArray, vtkDataArray* outArray); 00051 00052 void SetupEmptyOutput(); 00053 void SetupOutputInformation(); 00054 void SetupOutputData(); 00055 virtual void GetOutputUpdateExtent(int& piece, int& numberOfPieces, 00056 int& ghostLevel)=0; 00057 00058 // Pipeline execute data driver. Called by vtkXMLReader. 00059 void ReadXMLData(); 00060 int ReadPrimaryElement(vtkXMLDataElement* ePrimary); 00061 void SetupUpdateExtent(int piece, int numberOfPieces, int ghostLevel); 00062 00063 int ReadPieceData(); 00064 void CopyCellArray(vtkIdType totalNumberOfCells, vtkCellArray* inCells, 00065 vtkCellArray* outCells); 00066 00067 // Get the number of points/cells in the given piece. Valid after 00068 // UpdateInformation. 00069 virtual vtkIdType GetNumberOfPointsInPiece(int piece); 00070 virtual vtkIdType GetNumberOfCellsInPiece(int piece); 00071 00072 // The update request. 00073 int UpdatePiece; 00074 int UpdateNumberOfPieces; 00075 int UpdateGhostLevel; 00076 00077 // The range of pieces from the file that will form the UpdatePiece. 00078 int StartPiece; 00079 int EndPiece; 00080 vtkIdType TotalNumberOfPoints; 00081 vtkIdType TotalNumberOfCells; 00082 vtkIdType StartPoint; 00083 00084 // The PPoints element with point information. 00085 vtkXMLDataElement* PPointsElement; 00086 00087 private: 00088 vtkXMLPUnstructuredDataReader(const vtkXMLPUnstructuredDataReader&); // Not implemented. 00089 void operator=(const vtkXMLPUnstructuredDataReader&); // Not implemented. 00090 }; 00091 00092 #endif