VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkXMLPStructuredDataReader.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 =========================================================================*/ 00026 #ifndef vtkXMLPStructuredDataReader_h 00027 #define vtkXMLPStructuredDataReader_h 00028 00029 #include "vtkIOXMLModule.h" // For export macro 00030 #include "vtkXMLPDataReader.h" 00031 00032 class vtkExtentSplitter; 00033 class vtkXMLStructuredDataReader; 00034 00035 class VTKIOXML_EXPORT vtkXMLPStructuredDataReader : public vtkXMLPDataReader 00036 { 00037 public: 00038 vtkTypeMacro(vtkXMLPStructuredDataReader,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 protected: 00045 vtkXMLPStructuredDataReader(); 00046 ~vtkXMLPStructuredDataReader(); 00047 00048 vtkIdType GetNumberOfPoints(); 00049 vtkIdType GetNumberOfCells(); 00050 void CopyArrayForPoints(vtkDataArray* inArray, vtkDataArray* outArray); 00051 void CopyArrayForCells(vtkDataArray* inArray, vtkDataArray* outArray); 00052 00053 virtual void SetOutputExtent(int* extent)=0; 00054 virtual void GetPieceInputExtent(int index, int* extent)=0; 00055 00056 // Pipeline execute data driver. Called by vtkXMLReader. 00057 void ReadXMLData(); 00058 int ReadPrimaryElement(vtkXMLDataElement* ePrimary); 00059 00060 void SetupOutputData(); 00061 00062 void SetupPieces(int numPieces); 00063 void DestroyPieces(); 00064 int ReadPiece(vtkXMLDataElement* ePiece); 00065 int ReadPieceData(); 00066 void CopySubExtent(int* inExtent, int* inDimensions, vtkIdType* inIncrements, 00067 int* outExtent,int* outDimensions,vtkIdType* outIncrements, 00068 int* subExtent, int* subDimensions, 00069 vtkDataArray* inArray, vtkDataArray* outArray); 00070 int ComputePieceSubExtents(); 00071 00072 vtkExtentSplitter* ExtentSplitter; 00073 00074 // The extent to be updated in the output. 00075 int UpdateExtent[6]; 00076 int PointDimensions[3]; 00077 vtkIdType PointIncrements[3]; 00078 int CellDimensions[3]; 00079 vtkIdType CellIncrements[3]; 00080 00081 // The extent currently being read from a piece. 00082 int SubExtent[6]; 00083 int SubPointDimensions[3]; 00084 int SubCellDimensions[3]; 00085 int SubPieceExtent[6]; 00086 int SubPiecePointDimensions[3]; 00087 vtkIdType SubPiecePointIncrements[3]; 00088 int SubPieceCellDimensions[3]; 00089 vtkIdType SubPieceCellIncrements[3]; 00090 00091 // Information per-piece. 00092 int* PieceExtents; 00093 00094 virtual int RequestInformation(vtkInformation *request, 00095 vtkInformationVector **inputVector, 00096 vtkInformationVector *outputVector); 00097 00098 private: 00099 vtkXMLPStructuredDataReader(const vtkXMLPStructuredDataReader&); // Not implemented. 00100 void operator=(const vtkXMLPStructuredDataReader&); // Not implemented. 00101 }; 00102 00103 #endif