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

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 =========================================================================*/
00036 #ifndef __vtkXMLStructuredDataReader_h
00037 #define __vtkXMLStructuredDataReader_h
00038 
00039 #include "vtkXMLDataReader.h"
00040 
00041 
00042 class VTK_IO_EXPORT vtkXMLStructuredDataReader : public vtkXMLDataReader
00043 {
00044 public:
00045   vtkTypeRevisionMacro(vtkXMLStructuredDataReader,vtkXMLDataReader);
00046   void PrintSelf(ostream& os, vtkIndent indent);  
00047   
00049   virtual vtkIdType GetNumberOfPoints();
00050   
00052   virtual vtkIdType GetNumberOfCells();
00053   
00055 
00059   vtkSetMacro(WholeSlices, int);
00060   vtkGetMacro(WholeSlices, int);
00061   vtkBooleanMacro(WholeSlices, int);
00063   
00064 protected:
00065   vtkXMLStructuredDataReader();
00066   ~vtkXMLStructuredDataReader();
00067   
00068   virtual void SetOutputExtent(int* extent)=0;
00069   int ReadPrimaryElement(vtkXMLDataElement* ePrimary);
00070   
00071   // Pipeline execute data driver.  Called by vtkXMLReader.
00072   void ReadXMLData();
00073   
00074   // Internal representation of pieces in the file that may have come
00075   // from a streamed write.
00076   int* PieceExtents;
00077   int* PiecePointDimensions;
00078   int* PiecePointIncrements;
00079   int* PieceCellDimensions;
00080   int* PieceCellIncrements;
00081   
00082   // Whether to read in whole slices mode.
00083   int WholeSlices;
00084   
00085   // The update extent and corresponding increments and dimensions.
00086   int UpdateExtent[6];
00087   int PointDimensions[3];
00088   int CellDimensions[3];
00089   int PointIncrements[3];
00090   int CellIncrements[3];
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   int ReadArrayForPoints(vtkXMLDataElement* da, vtkDataArray* outArray);
00102   int ReadArrayForCells(vtkXMLDataElement* da, vtkDataArray* outArray);
00103   
00104   // Internal utility methods.
00105   int ReadPiece(vtkXMLDataElement* ePiece);
00106   int ReadSubExtent(int* inExtent, int* inDimensions, int* inIncrements,
00107                     int* outExtent, int* outDimensions, int* outIncrements,
00108                     int* subExtent, int* subDimensions, vtkXMLDataElement* da,
00109                     vtkDataArray* array);
00110   
00111 private:
00112   vtkXMLStructuredDataReader(const vtkXMLStructuredDataReader&);  // Not implemented.
00113   void operator=(const vtkXMLStructuredDataReader&);  // Not implemented.
00114 };
00115 
00116 #endif