VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkXMLStructuredDataReader.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 __vtkXMLStructuredDataReader_h 00027 #define __vtkXMLStructuredDataReader_h 00028 00029 #include "vtkIOXMLModule.h" // For export macro 00030 #include "vtkXMLDataReader.h" 00031 00032 00033 class VTKIOXML_EXPORT vtkXMLStructuredDataReader : public vtkXMLDataReader 00034 { 00035 public: 00036 vtkTypeMacro(vtkXMLStructuredDataReader,vtkXMLDataReader); 00037 void PrintSelf(ostream& os, vtkIndent indent); 00038 00040 virtual vtkIdType GetNumberOfPoints(); 00041 00043 virtual vtkIdType GetNumberOfCells(); 00044 00046 00050 vtkSetMacro(WholeSlices, int); 00051 vtkGetMacro(WholeSlices, int); 00052 vtkBooleanMacro(WholeSlices, int); 00054 00056 00058 virtual void CopyOutputInformation(vtkInformation *outInfo, int port); 00059 protected: 00060 vtkXMLStructuredDataReader(); 00061 ~vtkXMLStructuredDataReader(); 00063 00064 virtual void SetOutputExtent(int* extent)=0; 00065 int ReadPrimaryElement(vtkXMLDataElement* ePrimary); 00066 00067 // Pipeline execute data driver. Called by vtkXMLReader. 00068 void ReadXMLData(); 00069 00070 // Internal representation of pieces in the file that may have come 00071 // from a streamed write. 00072 int* PieceExtents; 00073 int* PiecePointDimensions; 00074 vtkIdType* PiecePointIncrements; 00075 int* PieceCellDimensions; 00076 vtkIdType* PieceCellIncrements; 00077 00078 // Whether to read in whole slices mode. 00079 int WholeSlices; 00080 00081 // The update extent and corresponding increments and dimensions. 00082 int UpdateExtent[6]; 00083 int PointDimensions[3]; 00084 int CellDimensions[3]; 00085 vtkIdType PointIncrements[3]; 00086 vtkIdType CellIncrements[3]; 00087 00088 int WholeExtent[6]; 00089 00090 // The extent currently being read. 00091 int SubExtent[6]; 00092 int SubPointDimensions[3]; 00093 int SubCellDimensions[3]; 00094 00095 // Override methods from superclass. 00096 void SetupEmptyOutput(); 00097 void SetupPieces(int numPieces); 00098 void DestroyPieces(); 00099 virtual int ReadArrayForPoints(vtkXMLDataElement* da, 00100 vtkAbstractArray* outArray); 00101 virtual int ReadArrayForCells(vtkXMLDataElement* da, 00102 vtkAbstractArray* outArray); 00103 00104 // Internal utility methods. 00105 int ReadPiece(vtkXMLDataElement* ePiece); 00106 virtual int ReadSubExtent( 00107 int* inExtent, int* inDimensions, vtkIdType* inIncrements, 00108 int* outExtent,int* outDimensions,vtkIdType* outIncrements, 00109 int* subExtent, int* subDimensions, vtkXMLDataElement* da, 00110 vtkAbstractArray* array); 00111 00112 private: 00113 vtkXMLStructuredDataReader(const vtkXMLStructuredDataReader&); // Not implemented. 00114 void operator=(const vtkXMLStructuredDataReader&); // Not implemented. 00115 }; 00116 00117 #endif