vtkXMLUnstructuredDataWriter.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00033 #ifndef __vtkXMLUnstructuredDataWriter_h
00034 #define __vtkXMLUnstructuredDataWriter_h
00035
00036 #include "vtkXMLWriter.h"
00037
00038 class vtkPointSet;
00039 class vtkCellArray;
00040 class vtkDataArray;
00041 class vtkIdTypeArray;
00042
00043 class VTK_IO_EXPORT vtkXMLUnstructuredDataWriter : public vtkXMLWriter
00044 {
00045 public:
00046 vtkTypeRevisionMacro(vtkXMLUnstructuredDataWriter,vtkXMLWriter);
00047 void PrintSelf(ostream& os, vtkIndent indent);
00048
00050
00052 vtkSetMacro(NumberOfPieces, int);
00053 vtkGetMacro(NumberOfPieces, int);
00055
00057
00059 vtkSetMacro(WritePiece, int);
00060 vtkGetMacro(WritePiece, int);
00062
00064
00065 vtkSetMacro(GhostLevel, int);
00066 vtkGetMacro(GhostLevel, int);
00068
00069 protected:
00070 vtkXMLUnstructuredDataWriter();
00071 ~vtkXMLUnstructuredDataWriter();
00072
00073 vtkPointSet* GetInputAsPointSet();
00074 virtual const char* GetDataSetName()=0;
00075 virtual void SetInputUpdateExtent(int piece, int numPieces,
00076 int ghostLevel)=0;
00077
00078
00079 int WriteData();
00080
00081 virtual int WriteInlineMode(vtkIndent indent);
00082 virtual void WriteInlinePieceAttributes();
00083 virtual void WriteInlinePiece(vtkIndent indent);
00084
00085 virtual int WriteAppendedMode(vtkIndent indent);
00086 virtual void WriteAppendedPieceAttributes(int index);
00087 virtual void WriteAppendedPiece(int index, vtkIndent indent);
00088 virtual void WriteAppendedPieceData(int index);
00089
00090 void WriteCellsInline(const char* name, vtkCellArray* cells,
00091 vtkDataArray* types, vtkIndent indent);
00092 unsigned long* WriteCellsAppended(const char* name, vtkDataArray* types,
00093 vtkIndent indent);
00094 void WriteCellsAppendedData(vtkCellArray* cells, vtkDataArray* types,
00095 unsigned long* positions);
00096 void ConvertCells(vtkCellArray* cells);
00097
00098
00099
00100 virtual vtkIdType GetNumberOfInputPoints();
00101 virtual vtkIdType GetNumberOfInputCells()=0;
00102 void CalculateDataFractions(float* fractions);
00103 void CalculateCellFractions(float* fractions, vtkIdType typesSize);
00104
00105
00106 int NumberOfPieces;
00107
00108
00109 int WritePiece;
00110
00111
00112 int GhostLevel;
00113
00114
00115 unsigned long* PointsPositions;
00116 unsigned long* NumberOfPointsPositions;
00117 unsigned long** PointDataPositions;
00118 unsigned long** CellDataPositions;
00119
00120
00121 vtkIdTypeArray* CellPoints;
00122 vtkIdTypeArray* CellOffsets;
00123
00124 private:
00125 vtkXMLUnstructuredDataWriter(const vtkXMLUnstructuredDataWriter&);
00126 void operator=(const vtkXMLUnstructuredDataWriter&);
00127 };
00128
00129 #endif