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

IO/vtkXMLStructuredDataReader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkXMLStructuredDataReader.h,v $
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 "vtkXMLDataReader.h"
00030 
00031 
00032 class VTK_IO_EXPORT vtkXMLStructuredDataReader : public vtkXMLDataReader
00033 {
00034 public:
00035   vtkTypeRevisionMacro(vtkXMLStructuredDataReader,vtkXMLDataReader);
00036   void PrintSelf(ostream& os, vtkIndent indent);  
00037   
00039   virtual vtkIdType GetNumberOfPoints();
00040   
00042   virtual vtkIdType GetNumberOfCells();
00043   
00045 
00049   vtkSetMacro(WholeSlices, int);
00050   vtkGetMacro(WholeSlices, int);
00051   vtkBooleanMacro(WholeSlices, int);
00053   
00054 protected:
00055   vtkXMLStructuredDataReader();
00056   ~vtkXMLStructuredDataReader();
00057   
00058   virtual void SetOutputExtent(int* extent)=0;
00059   int ReadPrimaryElement(vtkXMLDataElement* ePrimary);
00060   
00061   // Pipeline execute data driver.  Called by vtkXMLReader.
00062   void ReadXMLData();
00063   
00064   // Internal representation of pieces in the file that may have come
00065   // from a streamed write.
00066   int* PieceExtents;
00067   int* PiecePointDimensions;
00068   int* PiecePointIncrements;
00069   int* PieceCellDimensions;
00070   int* PieceCellIncrements;
00071   
00072   // Whether to read in whole slices mode.
00073   int WholeSlices;
00074   
00075   // The update extent and corresponding increments and dimensions.
00076   int UpdateExtent[6];
00077   int PointDimensions[3];
00078   int CellDimensions[3];
00079   int PointIncrements[3];
00080   int CellIncrements[3];
00081   
00082   // The extent currently being read.
00083   int SubExtent[6];
00084   int SubPointDimensions[3];
00085   int SubCellDimensions[3];
00086   
00087   // Override methods from superclass.
00088   void SetupEmptyOutput();
00089   void SetupPieces(int numPieces);
00090   void DestroyPieces();
00091   int ReadArrayForPoints(vtkXMLDataElement* da, vtkDataArray* outArray);
00092   int ReadArrayForCells(vtkXMLDataElement* da, vtkDataArray* outArray);
00093   
00094   // Internal utility methods.
00095   int ReadPiece(vtkXMLDataElement* ePiece);
00096   int ReadSubExtent(int* inExtent, int* inDimensions, int* inIncrements,
00097                     int* outExtent, int* outDimensions, int* outIncrements,
00098                     int* subExtent, int* subDimensions, vtkXMLDataElement* da,
00099                     vtkDataArray* array);
00100   
00101 private:
00102   vtkXMLStructuredDataReader(const vtkXMLStructuredDataReader&);  // Not implemented.
00103   void operator=(const vtkXMLStructuredDataReader&);  // Not implemented.
00104 };
00105 
00106 #endif