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 "vtkXMLPDataReader.h" 00030 00031 class vtkExtentSplitter; 00032 class vtkExtentTranslator; 00033 //class vtkTableExtentTranslator; 00034 class vtkXMLStructuredDataReader; 00035 00036 class VTK_IO_EXPORT vtkXMLPStructuredDataReader : public vtkXMLPDataReader 00037 { 00038 public: 00039 vtkTypeMacro(vtkXMLPStructuredDataReader,vtkXMLPDataReader); 00040 void PrintSelf(ostream& os, vtkIndent indent); 00041 00046 virtual vtkExtentTranslator* GetExtentTranslator(); 00047 00048 // For the specified port, copy the information this reader sets up in 00049 // SetupOutputInformation to outInfo 00050 virtual void CopyOutputInformation(vtkInformation *outInfo, int port); 00051 protected: 00052 vtkXMLPStructuredDataReader(); 00053 ~vtkXMLPStructuredDataReader(); 00054 00055 vtkIdType GetNumberOfPoints(); 00056 vtkIdType GetNumberOfCells(); 00057 void CopyArrayForPoints(vtkDataArray* inArray, vtkDataArray* outArray); 00058 void CopyArrayForCells(vtkDataArray* inArray, vtkDataArray* outArray); 00059 00060 virtual void SetOutputExtent(int* extent)=0; 00061 virtual void GetPieceInputExtent(int index, int* extent)=0; 00062 00063 // Pipeline execute data driver. Called by vtkXMLReader. 00064 void ReadXMLData(); 00065 int ReadPrimaryElement(vtkXMLDataElement* ePrimary); 00066 00067 void SetupOutputData(); 00068 00069 void SetupPieces(int numPieces); 00070 void DestroyPieces(); 00071 int ReadPiece(vtkXMLDataElement* ePiece); 00072 int ReadPieceData(); 00073 void CopySubExtent(int* inExtent, int* inDimensions, vtkIdType* inIncrements, 00074 int* outExtent,int* outDimensions,vtkIdType* outIncrements, 00075 int* subExtent, int* subDimensions, 00076 vtkDataArray* inArray, vtkDataArray* outArray); 00077 int ComputePieceSubExtents(); 00078 00079 //vtkTableExtentTranslator* ExtentTranslator; 00080 vtkExtentSplitter* ExtentSplitter; 00081 00082 // The extent to be updated in the output. 00083 int UpdateExtent[6]; 00084 int PointDimensions[3]; 00085 vtkIdType PointIncrements[3]; 00086 int CellDimensions[3]; 00087 vtkIdType CellIncrements[3]; 00088 00089 // The extent currently being read from a piece. 00090 int SubExtent[6]; 00091 int SubPointDimensions[3]; 00092 int SubCellDimensions[3]; 00093 int SubPieceExtent[6]; 00094 int SubPiecePointDimensions[3]; 00095 vtkIdType SubPiecePointIncrements[3]; 00096 int SubPieceCellDimensions[3]; 00097 vtkIdType SubPieceCellIncrements[3]; 00098 00099 // Information per-piece. 00100 int* PieceExtents; 00101 00102 virtual int RequestInformation(vtkInformation *request, 00103 vtkInformationVector **inputVector, 00104 vtkInformationVector *outputVector); 00105 00106 private: 00107 vtkXMLPStructuredDataReader(const vtkXMLPStructuredDataReader&); // Not implemented. 00108 void operator=(const vtkXMLPStructuredDataReader&); // Not implemented. 00109 }; 00110 00111 #endif