00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkXMLPUnstructuredDataReader.h,v $ 00005 Language: C++ 00006 00007 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 00008 All rights reserved. 00009 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00010 00011 This software is distributed WITHOUT ANY WARRANTY; without even 00012 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00013 PURPOSE. See the above copyright notice for more information. 00014 00015 =========================================================================*/ 00029 #ifndef __vtkXMLPUnstructuredDataReader_h 00030 #define __vtkXMLPUnstructuredDataReader_h 00031 00032 #include "vtkXMLPDataReader.h" 00033 00034 class vtkPointSet; 00035 class vtkCellArray; 00036 class vtkXMLUnstructuredDataReader; 00037 00038 class VTK_IO_EXPORT vtkXMLPUnstructuredDataReader : public vtkXMLPDataReader 00039 { 00040 public: 00041 vtkTypeRevisionMacro(vtkXMLPUnstructuredDataReader,vtkXMLPDataReader); 00042 void PrintSelf(ostream& os, vtkIndent indent); 00043 00044 protected: 00045 vtkXMLPUnstructuredDataReader(); 00046 ~vtkXMLPUnstructuredDataReader(); 00047 00048 vtkPointSet* GetOutputAsPointSet(); 00049 vtkPointSet* GetPieceInputAsPointSet(int piece); 00050 virtual void SetupOutputTotals(); 00051 virtual void SetupNextPiece(); 00052 vtkIdType GetNumberOfPoints(); 00053 vtkIdType GetNumberOfCells(); 00054 void CopyArrayForPoints(vtkDataArray* inArray, vtkDataArray* outArray); 00055 00056 void SetupEmptyOutput(); 00057 void SetupOutputInformation(); 00058 void SetupOutputData(); 00059 virtual void GetOutputUpdateExtent(int& piece, int& numberOfPieces, 00060 int& ghostLevel)=0; 00061 00062 // Pipeline execute data driver. Called by vtkXMLReader. 00063 void ReadXMLData(); 00064 int ReadPrimaryElement(vtkXMLDataElement* ePrimary); 00065 void SetupUpdateExtent(int piece, int numberOfPieces, int ghostLevel); 00066 00067 int ReadPieceData(); 00068 void CopyCellArray(vtkIdType totalNumberOfCells, vtkCellArray* inCells, 00069 vtkCellArray* outCells); 00070 00071 // The update request. 00072 int UpdatePiece; 00073 int UpdateNumberOfPieces; 00074 int UpdateGhostLevel; 00075 00076 // The range of pieces from the file that will form the UpdatePiece. 00077 int StartPiece; 00078 int EndPiece; 00079 vtkIdType TotalNumberOfPoints; 00080 vtkIdType TotalNumberOfCells; 00081 vtkIdType StartPoint; 00082 00083 // The PPoints element with point information. 00084 vtkXMLDataElement* PPointsElement; 00085 00086 private: 00087 vtkXMLPUnstructuredDataReader(const vtkXMLPUnstructuredDataReader&); // Not implemented. 00088 void operator=(const vtkXMLPUnstructuredDataReader&); // Not implemented. 00089 }; 00090 00091 #endif