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 void SetupOutputInformation(vtkInformation *outInfo); 00071 00072 // Internal representation of pieces in the file that may have come 00073 // from a streamed write. 00074 int* PieceExtents; 00075 int* PiecePointDimensions; 00076 vtkIdType* PiecePointIncrements; 00077 int* PieceCellDimensions; 00078 vtkIdType* PieceCellIncrements; 00079 00080 // Whether to read in whole slices mode. 00081 int WholeSlices; 00082 00083 // The update extent and corresponding increments and dimensions. 00084 int UpdateExtent[6]; 00085 int PointDimensions[3]; 00086 int CellDimensions[3]; 00087 vtkIdType PointIncrements[3]; 00088 vtkIdType CellIncrements[3]; 00089 00090 int WholeExtent[6]; 00091 00092 // The extent currently being read. 00093 int SubExtent[6]; 00094 int SubPointDimensions[3]; 00095 int SubCellDimensions[3]; 00096 00097 // Override methods from superclass. 00098 void SetupEmptyOutput(); 00099 void SetupPieces(int numPieces); 00100 void DestroyPieces(); 00101 virtual int ReadArrayForPoints(vtkXMLDataElement* da, 00102 vtkAbstractArray* outArray); 00103 virtual int ReadArrayForCells(vtkXMLDataElement* da, 00104 vtkAbstractArray* outArray); 00105 00106 // Internal utility methods. 00107 int ReadPiece(vtkXMLDataElement* ePiece); 00108 virtual int ReadSubExtent( 00109 int* inExtent, int* inDimensions, vtkIdType* inIncrements, 00110 int* outExtent,int* outDimensions,vtkIdType* outIncrements, 00111 int* subExtent, int* subDimensions, vtkXMLDataElement* da, 00112 vtkAbstractArray* array); 00113 00114 private: 00115 vtkXMLStructuredDataReader(const vtkXMLStructuredDataReader&); // Not implemented. 00116 void operator=(const vtkXMLStructuredDataReader&); // Not implemented. 00117 }; 00118 00119 #endif