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