00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00022 #ifndef __vtkXMLStructuredDataWriter_h
00023 #define __vtkXMLStructuredDataWriter_h
00024
00025 #include "vtkXMLWriter.h"
00026
00027 class vtkExtentTranslator;
00028 class vtkDataArray;
00029 class vtkInformation;
00030 class vtkInformationVector;
00031
00032 class VTK_IO_EXPORT vtkXMLStructuredDataWriter : public vtkXMLWriter
00033 {
00034 public:
00035 vtkTypeRevisionMacro(vtkXMLStructuredDataWriter,vtkXMLWriter);
00036 void PrintSelf(ostream& os, vtkIndent indent);
00037
00039
00041 vtkSetMacro(NumberOfPieces, int);
00042 vtkGetMacro(NumberOfPieces, int);
00044
00046
00049 vtkSetVector6Macro(WriteExtent, int);
00050 vtkGetVector6Macro(WriteExtent, int);
00052
00054
00055 virtual void SetExtentTranslator(vtkExtentTranslator*);
00056 vtkGetObjectMacro(ExtentTranslator, vtkExtentTranslator);
00058
00059 protected:
00060 vtkXMLStructuredDataWriter();
00061 ~vtkXMLStructuredDataWriter();
00062
00063
00064 virtual void WritePrimaryElementAttributes(ostream &os, vtkIndent indent);
00065 virtual void WriteAppendedPiece(int index, vtkIndent indent);
00066 virtual void WriteAppendedPieceData(int index);
00067 virtual void WriteInlinePiece(vtkIndent indent);
00068 virtual void GetInputExtent(int* extent)=0;
00069
00070 virtual int WriteHeader();
00071 virtual int WriteAPiece();
00072 virtual int WriteFooter();
00073
00074 virtual void AllocatePositionArrays();
00075 virtual void DeletePositionArrays();
00076
00077 void SetupExtentTranslator();
00078 vtkDataArray* CreateExactExtent(vtkDataArray* array, int* inExtent,
00079 int* outExtent, int isPoint);
00080 virtual int WriteInlineMode(vtkIndent indent);
00081 vtkIdType GetStartTuple(int* extent, vtkIdType* increments,
00082 int i, int j, int k);
00083 void CalculatePieceFractions(float* fractions);
00084
00085
00086 vtkDataArray* CreateArrayForPoints(vtkDataArray* inArray);
00087 vtkDataArray* CreateArrayForCells(vtkDataArray* inArray);
00088
00089 void SetInputUpdateExtent(int piece);
00090 int ProcessRequest(vtkInformation* request,
00091 vtkInformationVector** inputVector,
00092 vtkInformationVector* outputVector);
00093
00094 vtkSetVector6Macro(InternalWriteExtent, int);
00095
00096
00097 int WriteExtent[6];
00098
00099
00100 int InternalWriteExtent[6];
00101
00102
00103 int NumberOfPieces;
00104
00105
00106 vtkExtentTranslator* ExtentTranslator;
00107
00108 float* ProgressFractions;
00109
00110 int CurrentPiece;
00111
00112
00113
00114 OffsetsManagerArray *PointDataOM;
00115 OffsetsManagerArray *CellDataOM;
00116
00117 private:
00118 vtkXMLStructuredDataWriter(const vtkXMLStructuredDataWriter&);
00119 void operator=(const vtkXMLStructuredDataWriter&);
00120 };
00121
00122 #endif