00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkXMLUnstructuredGridWriter.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 =========================================================================*/ 00029 #ifndef __vtkXMLUnstructuredGridWriter_h 00030 #define __vtkXMLUnstructuredGridWriter_h 00031 00032 #include "vtkXMLUnstructuredDataWriter.h" 00033 00034 class vtkUnstructuredGrid; 00035 00036 class VTK_IO_EXPORT vtkXMLUnstructuredGridWriter : public vtkXMLUnstructuredDataWriter 00037 { 00038 public: 00039 vtkTypeRevisionMacro(vtkXMLUnstructuredGridWriter,vtkXMLUnstructuredDataWriter); 00040 void PrintSelf(ostream& os, vtkIndent indent); 00041 static vtkXMLUnstructuredGridWriter* New(); 00042 00044 00045 void SetInput(vtkUnstructuredGrid* input); 00046 vtkUnstructuredGrid* GetInput(); 00048 00050 const char* GetDefaultFileExtension(); 00051 00052 protected: 00053 vtkXMLUnstructuredGridWriter(); 00054 ~vtkXMLUnstructuredGridWriter(); 00055 00056 const char* GetDataSetName(); 00057 void SetInputUpdateExtent(int piece, int numPieces, int ghostLevel); 00058 00059 void WriteInlinePieceAttributes(); 00060 void WriteInlinePiece(vtkIndent indent); 00061 00062 int WriteAppendedMode(vtkIndent indent); 00063 void WriteAppendedPieceAttributes(int index); 00064 void WriteAppendedPiece(int index, vtkIndent indent); 00065 void WriteAppendedPieceData(int index); 00066 00067 virtual vtkIdType GetNumberOfInputCells(); 00068 void CalculateSuperclassFraction(float* fractions); 00069 00070 // Positions of attributes for each piece. 00071 unsigned long* NumberOfCellsPositions; 00072 unsigned long** CellsPositions; 00073 00074 private: 00075 vtkXMLUnstructuredGridWriter(const vtkXMLUnstructuredGridWriter&); // Not implemented. 00076 void operator=(const vtkXMLUnstructuredGridWriter&); // Not implemented. 00077 }; 00078 00079 #endif