VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkXMLPUnstructuredDataReader.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 =========================================================================*/ 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 vtkTypeMacro(vtkXMLPUnstructuredDataReader,vtkXMLPDataReader); 00038 void PrintSelf(ostream& os, vtkIndent indent); 00039 00040 // For the specified port, copy the information this reader sets up in 00041 // SetupOutputInformation to outInfo 00042 virtual void CopyOutputInformation(vtkInformation *outInfo, int port); 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 00058 // Setup the output's information. 00059 void SetupOutputInformation(vtkInformation *outInfo); 00060 00061 void SetupOutputData(); 00062 virtual void GetOutputUpdateExtent(int& piece, int& numberOfPieces, 00063 int& ghostLevel)=0; 00064 00065 // Pipeline execute data driver. Called by vtkXMLReader. 00066 void ReadXMLData(); 00067 int ReadPrimaryElement(vtkXMLDataElement* ePrimary); 00068 void SetupUpdateExtent(int piece, int numberOfPieces, int ghostLevel); 00069 00070 int ReadPieceData(); 00071 void CopyCellArray(vtkIdType totalNumberOfCells, vtkCellArray* inCells, 00072 vtkCellArray* outCells); 00073 00074 // Get the number of points/cells in the given piece. Valid after 00075 // UpdateInformation. 00076 virtual vtkIdType GetNumberOfPointsInPiece(int piece); 00077 virtual vtkIdType GetNumberOfCellsInPiece(int piece); 00078 00079 // The update request. 00080 int UpdatePiece; 00081 int UpdateNumberOfPieces; 00082 int UpdateGhostLevel; 00083 00084 // The range of pieces from the file that will form the UpdatePiece. 00085 int StartPiece; 00086 int EndPiece; 00087 vtkIdType TotalNumberOfPoints; 00088 vtkIdType TotalNumberOfCells; 00089 vtkIdType StartPoint; 00090 00091 // The PPoints element with point information. 00092 vtkXMLDataElement* PPointsElement; 00093 00094 private: 00095 vtkXMLPUnstructuredDataReader(const vtkXMLPUnstructuredDataReader&); // Not implemented. 00096 void operator=(const vtkXMLPUnstructuredDataReader&); // Not implemented. 00097 }; 00098 00099 #endif