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 "vtkIOXMLModule.h" // For export macro 00029 #include "vtkXMLPDataReader.h" 00030 00031 class vtkPointSet; 00032 class vtkCellArray; 00033 class vtkXMLUnstructuredDataReader; 00034 00035 class VTKIOXML_EXPORT vtkXMLPUnstructuredDataReader : public vtkXMLPDataReader 00036 { 00037 public: 00038 vtkTypeMacro(vtkXMLPUnstructuredDataReader,vtkXMLPDataReader); 00039 void PrintSelf(ostream& os, vtkIndent indent); 00040 00041 // For the specified port, copy the information this reader sets up in 00042 // SetupOutputInformation to outInfo 00043 virtual void CopyOutputInformation(vtkInformation *outInfo, int port); 00044 00045 protected: 00046 vtkXMLPUnstructuredDataReader(); 00047 ~vtkXMLPUnstructuredDataReader(); 00048 00049 vtkPointSet* GetOutputAsPointSet(); 00050 vtkPointSet* GetPieceInputAsPointSet(int piece); 00051 virtual void SetupOutputTotals(); 00052 virtual void SetupNextPiece(); 00053 vtkIdType GetNumberOfPoints(); 00054 vtkIdType GetNumberOfCells(); 00055 void CopyArrayForPoints(vtkDataArray* inArray, vtkDataArray* outArray); 00056 00057 void SetupEmptyOutput(); 00058 00059 // Setup the output's information. 00060 void SetupOutputInformation(vtkInformation *outInfo); 00061 00062 void SetupOutputData(); 00063 virtual void GetOutputUpdateExtent(int& piece, int& numberOfPieces, 00064 int& ghostLevel)=0; 00065 00066 // Pipeline execute data driver. Called by vtkXMLReader. 00067 void ReadXMLData(); 00068 int ReadPrimaryElement(vtkXMLDataElement* ePrimary); 00069 void SetupUpdateExtent(int piece, int numberOfPieces, int ghostLevel); 00070 00071 int ReadPieceData(); 00072 void CopyCellArray(vtkIdType totalNumberOfCells, vtkCellArray* inCells, 00073 vtkCellArray* outCells); 00074 00075 // Get the number of points/cells in the given piece. Valid after 00076 // UpdateInformation. 00077 virtual vtkIdType GetNumberOfPointsInPiece(int piece); 00078 virtual vtkIdType GetNumberOfCellsInPiece(int piece); 00079 00080 // The update request. 00081 int UpdatePiece; 00082 int UpdateNumberOfPieces; 00083 int UpdateGhostLevel; 00084 00085 // The range of pieces from the file that will form the UpdatePiece. 00086 int StartPiece; 00087 int EndPiece; 00088 vtkIdType TotalNumberOfPoints; 00089 vtkIdType TotalNumberOfCells; 00090 vtkIdType StartPoint; 00091 00092 // The PPoints element with point information. 00093 vtkXMLDataElement* PPointsElement; 00094 00095 private: 00096 vtkXMLPUnstructuredDataReader(const vtkXMLPUnstructuredDataReader&); // Not implemented. 00097 void operator=(const vtkXMLPUnstructuredDataReader&); // Not implemented. 00098 }; 00099 00100 #endif