VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/IO/XML/vtkXMLPUnstructuredDataReader.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkXMLPUnstructuredDataReader.h
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 =========================================================================*/
00025 #ifndef vtkXMLPUnstructuredDataReader_h
00026 #define vtkXMLPUnstructuredDataReader_h
00027 
00028 #include "vtkIOXMLModule.h" // For export macro
00029 #include "vtkXMLPDataReader.h"
00030 
00031 class vtkPointSet;
00032 class vtkCellArray;
00033 class vtkXMLUnstructuredDataReader;
00034 
00035 class VTKIOXML_EXPORT vtkXMLPUnstructuredDataReader : public vtkXMLPDataReader
00036 {
00037 public:
00038   vtkTypeMacro(vtkXMLPUnstructuredDataReader,vtkXMLPDataReader);
00039   void PrintSelf(ostream& os, vtkIndent indent);
00040 
00041   // For the specified port, copy the information this reader sets up in
00042   // SetupOutputInformation to outInfo
00043   virtual void CopyOutputInformation(vtkInformation *outInfo, int port);
00044 
00045 protected:
00046   vtkXMLPUnstructuredDataReader();
00047   ~vtkXMLPUnstructuredDataReader();
00048 
00049   virtual int RequestInformation(vtkInformation *request,
00050                                  vtkInformationVector **inputVector,
00051                                  vtkInformationVector *outputVector);
00052 
00053 
00054   vtkPointSet* GetOutputAsPointSet();
00055   vtkPointSet* GetPieceInputAsPointSet(int piece);
00056   virtual void SetupOutputTotals();
00057   virtual void SetupNextPiece();
00058   vtkIdType GetNumberOfPoints();
00059   vtkIdType GetNumberOfCells();
00060   void CopyArrayForPoints(vtkDataArray* inArray, vtkDataArray* outArray);
00061 
00062   void SetupEmptyOutput();
00063 
00064   // Setup the output's information.
00065   void SetupOutputInformation(vtkInformation *outInfo);
00066 
00067   void SetupOutputData();
00068   virtual void GetOutputUpdateExtent(int& piece, int& numberOfPieces,
00069                                      int& ghostLevel)=0;
00070 
00071   // Pipeline execute data driver.  Called by vtkXMLReader.
00072   void ReadXMLData();
00073   int ReadPrimaryElement(vtkXMLDataElement* ePrimary);
00074   void SetupUpdateExtent(int piece, int numberOfPieces, int ghostLevel);
00075 
00076   int ReadPieceData();
00077   void CopyCellArray(vtkIdType totalNumberOfCells, vtkCellArray* inCells,
00078                      vtkCellArray* outCells);
00079 
00080   // Get the number of points/cells in the given piece.  Valid after
00081   // UpdateInformation.
00082   virtual vtkIdType GetNumberOfPointsInPiece(int piece);
00083   virtual vtkIdType GetNumberOfCellsInPiece(int piece);
00084 
00085   // The update request.
00086   int UpdatePiece;
00087   int UpdateNumberOfPieces;
00088   int UpdateGhostLevel;
00089 
00090   // The range of pieces from the file that will form the UpdatePiece.
00091   int StartPiece;
00092   int EndPiece;
00093   vtkIdType TotalNumberOfPoints;
00094   vtkIdType TotalNumberOfCells;
00095   vtkIdType StartPoint;
00096 
00097   // The PPoints element with point information.
00098   vtkXMLDataElement* PPointsElement;
00099 
00100 private:
00101   vtkXMLPUnstructuredDataReader(const vtkXMLPUnstructuredDataReader&);  // Not implemented.
00102   void operator=(const vtkXMLPUnstructuredDataReader&);  // Not implemented.
00103 };
00104 
00105 #endif