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 vtkTypeRevisionMacro(vtkXMLUnstructuredDataWriter,
vtkXMLWriter);
00036
void PrintSelf(ostream& os,
vtkIndent indent);
00037
00039
00041 vtkSetMacro(NumberOfPieces,
int);
00042 vtkGetMacro(NumberOfPieces,
int);
00044
00046
00047 vtkSetMacro(WritePiece,
int);
00048 vtkGetMacro(WritePiece,
int);
00050
00052
00053 vtkSetMacro(GhostLevel,
int);
00054 vtkGetMacro(GhostLevel,
int);
00056
00057
protected:
00058 vtkXMLUnstructuredDataWriter();
00059 ~vtkXMLUnstructuredDataWriter();
00060
00061
vtkPointSet* GetInputAsPointSet();
00062
virtual const char*
GetDataSetName()=0;
00063
virtual void SetInputUpdateExtent(
int piece,
int numPieces,
00064
int ghostLevel)=0;
00065
00066
00067
int WriteData();
00068
00069
virtual int WriteInlineMode(
vtkIndent indent);
00070
virtual void WriteInlinePieceAttributes();
00071
virtual void WriteInlinePiece(
vtkIndent indent);
00072
00073
virtual int WriteAppendedMode(
vtkIndent indent);
00074
virtual void WriteAppendedPieceAttributes(
int index);
00075
virtual void WriteAppendedPiece(
int index,
vtkIndent indent);
00076
virtual void WriteAppendedPieceData(
int index);
00077
00078
void WriteCellsInline(
const char* name,
vtkCellArray* cells,
00079
vtkDataArray* types,
vtkIndent indent);
00080
unsigned long* WriteCellsAppended(
const char* name,
vtkDataArray* types,
00081
vtkIndent indent);
00082
void WriteCellsAppendedData(
vtkCellArray* cells,
vtkDataArray* types,
00083
unsigned long* positions);
00084
void ConvertCells(
vtkCellArray* cells);
00085
00086
00087
00088
virtual vtkIdType GetNumberOfInputPoints();
00089
virtual vtkIdType GetNumberOfInputCells()=0;
00090
void CalculateDataFractions(
float* fractions);
00091
void CalculateCellFractions(
float* fractions,
vtkIdType typesSize);
00092
00093
00094 int NumberOfPieces;
00095
00096
00097 int WritePiece;
00098
00099
00100 int GhostLevel;
00101
00102
00103 unsigned long* PointsPositions;
00104 unsigned long* NumberOfPointsPositions;
00105 unsigned long** PointDataPositions;
00106 unsigned long** CellDataPositions;
00107
00108
00109 vtkIdTypeArray* CellPoints;
00110 vtkIdTypeArray* CellOffsets;
00111
00112
private:
00113 vtkXMLUnstructuredDataWriter(
const vtkXMLUnstructuredDataWriter&);
00114
void operator=(
const vtkXMLUnstructuredDataWriter&);
00115 };
00116
00117
#endif