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

vtkXMLPStructuredDataReader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkXMLPStructuredDataReader.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 __vtkXMLPStructuredDataReader_h
00037 #define __vtkXMLPStructuredDataReader_h
00038 
00039 #include "vtkXMLPDataReader.h"
00040 
00041 class vtkExtentSplitter;
00042 class vtkExtentTranslator;
00043 class vtkTableExtentTranslator;
00044 class vtkXMLStructuredDataReader;
00045 
00046 class VTK_IO_EXPORT vtkXMLPStructuredDataReader : public vtkXMLPDataReader
00047 {
00048 public:
00049   vtkTypeRevisionMacro(vtkXMLPStructuredDataReader,vtkXMLPDataReader);
00050   void PrintSelf(ostream& os, vtkIndent indent);
00051   
00056   virtual vtkExtentTranslator* GetExtentTranslator();
00057   
00058 protected:
00059   vtkXMLPStructuredDataReader();
00060   ~vtkXMLPStructuredDataReader();
00061   
00062   vtkIdType GetNumberOfPoints();
00063   vtkIdType GetNumberOfCells();
00064   void CopyArrayForPoints(vtkDataArray* inArray, vtkDataArray* outArray);
00065   void CopyArrayForCells(vtkDataArray* inArray, vtkDataArray* outArray);
00066   
00067   virtual void SetOutputExtent(int* extent)=0;
00068   virtual void GetPieceInputExtent(int index, int* extent)=0;
00069   
00070   // Pipeline execute data driver.  Called by vtkXMLReader.
00071   void ReadXMLData();
00072   int ReadPrimaryElement(vtkXMLDataElement* ePrimary);
00073   
00074   void SetupOutputInformation();
00075   void SetupEmptyOutput();
00076   void SetupPieces(int numPieces);
00077   void DestroyPieces();
00078   int ReadPiece(vtkXMLDataElement* ePiece);
00079   int ReadPieceData();
00080   void CopySubExtent(int* inExtent, int* inDimensions, int* inIncrements,
00081                      int* outExtent, int* outDimensions, int* outIncrements,
00082                      int* subExtent, int* subDimensions,
00083                      vtkDataArray* inArray, vtkDataArray* outArray);
00084   int ComputePieceSubExtents();
00085   
00086   vtkTableExtentTranslator* ExtentTranslator;
00087   vtkExtentSplitter* ExtentSplitter;
00088   
00089   // The extent to be updated in the output.
00090   int UpdateExtent[6];
00091   int PointDimensions[3];
00092   int PointIncrements[3];
00093   int CellDimensions[3];
00094   int CellIncrements[3];
00095   
00096   // The extent currently being read from a piece.
00097   int SubExtent[6];
00098   int SubPointDimensions[3];
00099   int SubCellDimensions[3];
00100   int SubPieceExtent[6];
00101   int SubPiecePointDimensions[3];
00102   int SubPiecePointIncrements[3];
00103   int SubPieceCellDimensions[3];
00104   int SubPieceCellIncrements[3];
00105   
00106   // Information per-piece.
00107   int* PieceExtents;
00108   
00109 private:
00110   vtkXMLPStructuredDataReader(const vtkXMLPStructuredDataReader&);  // Not implemented.
00111   void operator=(const vtkXMLPStructuredDataReader&);  // Not implemented.
00112 };
00113 
00114 #endif