IO/vtkXMLUnstructuredDataReader.h Source File

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

# IO/vtkXMLUnstructuredDataReader.h

Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program:   Visualization Toolkit
    00004   Module:    $RCSfile: vtkXMLUnstructuredDataReader.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 =========================================================================*/
    00039 #ifndef __vtkXMLUnstructuredDataReader_h
    00040 #define __vtkXMLUnstructuredDataReader_h
    00041
    00042 #include "vtkXMLDataReader.h"
    00043
    00044 class vtkCellArray;
    00045 class vtkIdTypeArray;
    00046 class vtkPointSet;
    00047 class vtkUnsignedCharArray;
    00048
    00049 class VTK_IO_EXPORT vtkXMLUnstructuredDataReader : public vtkXMLDataReader
    00050 {
    00051 public:
    00052   vtkTypeRevisionMacro(vtkXMLUnstructuredDataReader,vtkXMLDataReader);
    00053   void PrintSelf(ostream& os, vtkIndent indent);
    00054
    00056   virtual vtkIdType GetNumberOfPoints();
    00057
    00059   virtual vtkIdType GetNumberOfCells();
    00060
    00065   void SetupUpdateExtent(int piece, int numberOfPieces, int ghostLevel);
    00066
    00067 protected:
    00068   vtkXMLUnstructuredDataReader();
    00069   ~vtkXMLUnstructuredDataReader();
    00070
    00071   vtkPointSet* GetOutputAsPointSet();
    00072   vtkXMLDataElement* FindDataArrayWithName(vtkXMLDataElement* eParent,
    00073                                            const char* name);
    00074   vtkIdTypeArray* ConvertToIdTypeArray(vtkDataArray* a);
    00075   vtkUnsignedCharArray* ConvertToUnsignedCharArray(vtkDataArray* a);
    00076
    00077   // Pipeline execute data driver.  Called by vtkXMLReader.
    00078   void ReadXMLData();
    00079
    00080   virtual void SetupEmptyOutput();
    00081   virtual void GetOutputUpdateExtent(int& piece, int& numberOfPieces,
    00082                                      int& ghostLevel)=0;
    00083   virtual void SetupOutputTotals();
    00084   virtual void SetupNextPiece();
    00085   void SetupPieces(int numPieces);
    00086   void DestroyPieces();
    00087
    00088   void SetupOutputInformation();
    00089   void SetupOutputData();
    00090   int ReadPiece(vtkXMLDataElement* ePiece);
    00091   int ReadPieceData();
    00092   int ReadCellArray(vtkIdType numberOfCells, vtkIdType totalNumberOfCells,
    00093                     vtkXMLDataElement* eCells, vtkCellArray* outCells);
    00094
    00095   // Read a data array whose tuples coorrespond to points.
    00096   int ReadArrayForPoints(vtkXMLDataElement* da, vtkDataArray* outArray);
    00097
    00098   // The update request.
    00099   int UpdatePiece;
    00100   int UpdateNumberOfPieces;
    00101   int UpdateGhostLevel;
    00102
    00103   // The range of pieces from the file that will form the UpdatePiece.
    00104   int StartPiece;
    00105   int EndPiece;
    00106   vtkIdType TotalNumberOfPoints;
    00107   vtkIdType TotalNumberOfCells;
    00108   vtkIdType StartPoint;
    00109
    00110   // The Points element for each piece.
    00111   vtkXMLDataElement** PointElements;
    00112   vtkIdType* NumberOfPoints;
    00113
    00114 private:
    00115   vtkXMLUnstructuredDataReader(const vtkXMLUnstructuredDataReader&);  // Not implemented.
    00116   void operator=(const vtkXMLUnstructuredDataReader&);  // Not implemented.
    00117 };
    00118
    00119 #endif