00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00022 #ifndef __vtkXMLUnstructuredDataWriter_h
00023 #define __vtkXMLUnstructuredDataWriter_h
00024
00025 #include "vtkXMLWriter.h"
00026
00027 class vtkPointSet;
00028 class vtkCellArray;
00029 class vtkDataArray;
00030 class vtkIdTypeArray;
00031
00032 class VTK_IO_EXPORT vtkXMLUnstructuredDataWriter : public vtkXMLWriter
00033 {
00034 public:
00035 vtkTypeMacro(vtkXMLUnstructuredDataWriter,vtkXMLWriter);
00036 void PrintSelf(ostream& os, vtkIndent indent);
00037
00039
00041 vtkSetMacro(NumberOfPieces, int);
00042 vtkGetMacro(NumberOfPieces, int);
00044
00046
00048 vtkSetMacro(WritePiece, int);
00049 vtkGetMacro(WritePiece, int);
00051
00053
00054 vtkSetMacro(GhostLevel, int);
00055 vtkGetMacro(GhostLevel, int);
00057
00058
00059 int ProcessRequest(vtkInformation*,
00060 vtkInformationVector**,
00061 vtkInformationVector*);
00062
00063 protected:
00064 vtkXMLUnstructuredDataWriter();
00065 ~vtkXMLUnstructuredDataWriter();
00066
00067 vtkPointSet* GetInputAsPointSet();
00068 virtual const char* GetDataSetName()=0;
00069 virtual void SetInputUpdateExtent(int piece, int numPieces,
00070 int ghostLevel);
00071
00072 virtual int WriteHeader();
00073 virtual int WriteAPiece();
00074 virtual int WriteFooter();
00075
00076 virtual void AllocatePositionArrays();
00077 virtual void DeletePositionArrays();
00078
00079 virtual int WriteInlineMode(vtkIndent indent);
00080 virtual void WriteInlinePieceAttributes();
00081 virtual void WriteInlinePiece(vtkIndent indent);
00082
00083 virtual void WriteAppendedPieceAttributes(int index);
00084 virtual void WriteAppendedPiece(int index, vtkIndent indent);
00085 virtual void WriteAppendedPieceData(int index);
00086
00087 void WriteCellsInline(const char* name, vtkCellArray* cells,
00088 vtkDataArray* types, vtkIndent indent);
00089 void WriteCellsAppended(const char* name, vtkDataArray* types,
00090 vtkIndent indent, OffsetsManagerGroup *cellsManager);
00091 void WriteCellsAppendedData(vtkCellArray* cells, vtkDataArray* types,
00092 int timestep, OffsetsManagerGroup *cellsManager);
00093 void ConvertCells(vtkCellArray* cells);
00094
00095
00096
00097 virtual vtkIdType GetNumberOfInputPoints();
00098 virtual vtkIdType GetNumberOfInputCells()=0;
00099 void CalculateDataFractions(float* fractions);
00100 void CalculateCellFractions(float* fractions, vtkIdType typesSize);
00101
00102
00103 int NumberOfPieces;
00104
00105
00106 int WritePiece;
00107
00108
00109 int GhostLevel;
00110
00111
00112 unsigned long* NumberOfPointsPositions;
00113
00114
00115 OffsetsManagerGroup *PointsOM;
00116 OffsetsManagerArray *PointDataOM;
00117 OffsetsManagerArray *CellDataOM;
00118
00119
00120 vtkIdTypeArray* CellPoints;
00121 vtkIdTypeArray* CellOffsets;
00122
00123 int CurrentPiece;
00124
00125 private:
00126 vtkXMLUnstructuredDataWriter(const vtkXMLUnstructuredDataWriter&);
00127 void operator=(const vtkXMLUnstructuredDataWriter&);
00128 };
00129
00130 #endif