Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

dox/IO/vtkXMLStructuredDataReader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkXMLStructuredDataReader.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00030 #ifndef __vtkXMLStructuredDataReader_h
00031 #define __vtkXMLStructuredDataReader_h
00032 
00033 #include "vtkXMLDataReader.h"
00034 
00035 
00036 class VTK_IO_EXPORT vtkXMLStructuredDataReader : public vtkXMLDataReader
00037 {
00038 public:
00039   vtkTypeRevisionMacro(vtkXMLStructuredDataReader,vtkXMLDataReader);
00040   void PrintSelf(ostream& os, vtkIndent indent);  
00041   
00043   virtual vtkIdType GetNumberOfPoints();
00044   
00046   virtual vtkIdType GetNumberOfCells();
00047   
00049 
00053   vtkSetMacro(WholeSlices, int);
00054   vtkGetMacro(WholeSlices, int);
00055   vtkBooleanMacro(WholeSlices, int);
00057   
00058 protected:
00059   vtkXMLStructuredDataReader();
00060   ~vtkXMLStructuredDataReader();
00061   
00062   virtual void SetOutputExtent(int* extent)=0;
00063   int ReadPrimaryElement(vtkXMLDataElement* ePrimary);
00064   
00065   // Pipeline execute data driver.  Called by vtkXMLReader.
00066   void ReadXMLData();
00067   
00068   // Internal representation of pieces in the file that may have come
00069   // from a streamed write.
00070   int* PieceExtents;
00071   int* PiecePointDimensions;
00072   int* PiecePointIncrements;
00073   int* PieceCellDimensions;
00074   int* PieceCellIncrements;
00075   
00076   // Whether to read in whole slices mode.
00077   int WholeSlices;
00078   
00079   // The update extent and corresponding increments and dimensions.
00080   int UpdateExtent[6];
00081   int PointDimensions[3];
00082   int CellDimensions[3];
00083   int PointIncrements[3];
00084   int CellIncrements[3];
00085   
00086   // The extent currently being read.
00087   int SubExtent[6];
00088   int SubPointDimensions[3];
00089   int SubCellDimensions[3];
00090   
00091   // Override methods from superclass.
00092   void SetupEmptyOutput();
00093   void SetupPieces(int numPieces);
00094   void DestroyPieces();
00095   int ReadArrayForPoints(vtkXMLDataElement* da, vtkDataArray* outArray);
00096   int ReadArrayForCells(vtkXMLDataElement* da, vtkDataArray* outArray);
00097   
00098   // Internal utility methods.
00099   int ReadPiece(vtkXMLDataElement* ePiece);
00100   int ReadSubExtent(int* inExtent, int* inDimensions, int* inIncrements,
00101                     int* outExtent, int* outDimensions, int* outIncrements,
00102                     int* subExtent, int* subDimensions, vtkXMLDataElement* da,
00103                     vtkDataArray* array);
00104   
00105 private:
00106   vtkXMLStructuredDataReader(const vtkXMLStructuredDataReader&);  // Not implemented.
00107   void operator=(const vtkXMLStructuredDataReader&);  // Not implemented.
00108 };
00109 
00110 #endif